diff --git a/http/deposit.js b/http/deposit.js index 5c88cc8..639f291 100644 --- a/http/deposit.js +++ b/http/deposit.js @@ -7,6 +7,13 @@ export const address = () => { method: "POST", }); }; +const fddIsPass = () => { + return http.request({ + url: "/api/wxuser/fdd/status/pass", + method: "POST", + }); +}; export default { address, + fddIsPass, }; diff --git a/node_modules/.bin/acorn b/node_modules/.bin/acorn new file mode 100644 index 0000000..46a3e61 --- /dev/null +++ b/node_modules/.bin/acorn @@ -0,0 +1,12 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../acorn/bin/acorn" "$@" +else + exec node "$basedir/../acorn/bin/acorn" "$@" +fi diff --git a/node_modules/.bin/acorn.cmd b/node_modules/.bin/acorn.cmd new file mode 100644 index 0000000..a9324df --- /dev/null +++ b/node_modules/.bin/acorn.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\acorn\bin\acorn" %* diff --git a/node_modules/.bin/acorn.ps1 b/node_modules/.bin/acorn.ps1 new file mode 100644 index 0000000..6f6dcdd --- /dev/null +++ b/node_modules/.bin/acorn.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../acorn/bin/acorn" $args + } else { + & "$basedir/node$exe" "$basedir/../acorn/bin/acorn" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../acorn/bin/acorn" $args + } else { + & "node$exe" "$basedir/../acorn/bin/acorn" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/browserslist b/node_modules/.bin/browserslist new file mode 100644 index 0000000..68dd69d --- /dev/null +++ b/node_modules/.bin/browserslist @@ -0,0 +1,12 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../browserslist/cli.js" "$@" +else + exec node "$basedir/../browserslist/cli.js" "$@" +fi diff --git a/node_modules/.bin/browserslist.cmd b/node_modules/.bin/browserslist.cmd new file mode 100644 index 0000000..f93c251 --- /dev/null +++ b/node_modules/.bin/browserslist.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\browserslist\cli.js" %* diff --git a/node_modules/.bin/browserslist.ps1 b/node_modules/.bin/browserslist.ps1 new file mode 100644 index 0000000..01e10a0 --- /dev/null +++ b/node_modules/.bin/browserslist.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../browserslist/cli.js" $args + } else { + & "$basedir/node$exe" "$basedir/../browserslist/cli.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../browserslist/cli.js" $args + } else { + & "node$exe" "$basedir/../browserslist/cli.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/json5 b/node_modules/.bin/json5 new file mode 100644 index 0000000..977b750 --- /dev/null +++ b/node_modules/.bin/json5 @@ -0,0 +1,12 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../json5/lib/cli.js" "$@" +else + exec node "$basedir/../json5/lib/cli.js" "$@" +fi diff --git a/node_modules/.bin/json5.cmd b/node_modules/.bin/json5.cmd new file mode 100644 index 0000000..95c137f --- /dev/null +++ b/node_modules/.bin/json5.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\json5\lib\cli.js" %* diff --git a/node_modules/.bin/json5.ps1 b/node_modules/.bin/json5.ps1 new file mode 100644 index 0000000..8700ddb --- /dev/null +++ b/node_modules/.bin/json5.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../json5/lib/cli.js" $args + } else { + & "$basedir/node$exe" "$basedir/../json5/lib/cli.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../json5/lib/cli.js" $args + } else { + & "node$exe" "$basedir/../json5/lib/cli.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/sass b/node_modules/.bin/sass new file mode 100644 index 0000000..44ba6e9 --- /dev/null +++ b/node_modules/.bin/sass @@ -0,0 +1,12 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../sass/sass.js" "$@" +else + exec node "$basedir/../sass/sass.js" "$@" +fi diff --git a/node_modules/.bin/sass.cmd b/node_modules/.bin/sass.cmd new file mode 100644 index 0000000..0cf95f6 --- /dev/null +++ b/node_modules/.bin/sass.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\sass\sass.js" %* diff --git a/node_modules/.bin/sass.ps1 b/node_modules/.bin/sass.ps1 new file mode 100644 index 0000000..715ffd5 --- /dev/null +++ b/node_modules/.bin/sass.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../sass/sass.js" $args + } else { + & "$basedir/node$exe" "$basedir/../sass/sass.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../sass/sass.js" $args + } else { + & "node$exe" "$basedir/../sass/sass.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/semver b/node_modules/.bin/semver new file mode 100644 index 0000000..77443e7 --- /dev/null +++ b/node_modules/.bin/semver @@ -0,0 +1,12 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../semver/bin/semver.js" "$@" +else + exec node "$basedir/../semver/bin/semver.js" "$@" +fi diff --git a/node_modules/.bin/semver.cmd b/node_modules/.bin/semver.cmd new file mode 100644 index 0000000..9913fa9 --- /dev/null +++ b/node_modules/.bin/semver.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\semver\bin\semver.js" %* diff --git a/node_modules/.bin/semver.ps1 b/node_modules/.bin/semver.ps1 new file mode 100644 index 0000000..314717a --- /dev/null +++ b/node_modules/.bin/semver.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../semver/bin/semver.js" $args + } else { + & "$basedir/node$exe" "$basedir/../semver/bin/semver.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../semver/bin/semver.js" $args + } else { + & "node$exe" "$basedir/../semver/bin/semver.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/terser b/node_modules/.bin/terser new file mode 100644 index 0000000..2d3fa89 --- /dev/null +++ b/node_modules/.bin/terser @@ -0,0 +1,12 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../terser/bin/terser" "$@" +else + exec node "$basedir/../terser/bin/terser" "$@" +fi diff --git a/node_modules/.bin/terser.cmd b/node_modules/.bin/terser.cmd new file mode 100644 index 0000000..abf66a8 --- /dev/null +++ b/node_modules/.bin/terser.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\terser\bin\terser" %* diff --git a/node_modules/.bin/terser.ps1 b/node_modules/.bin/terser.ps1 new file mode 100644 index 0000000..0bbfff6 --- /dev/null +++ b/node_modules/.bin/terser.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../terser/bin/terser" $args + } else { + & "$basedir/node$exe" "$basedir/../terser/bin/terser" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../terser/bin/terser" $args + } else { + & "node$exe" "$basedir/../terser/bin/terser" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/update-browserslist-db b/node_modules/.bin/update-browserslist-db new file mode 100644 index 0000000..8cde7e3 --- /dev/null +++ b/node_modules/.bin/update-browserslist-db @@ -0,0 +1,12 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../update-browserslist-db/cli.js" "$@" +else + exec node "$basedir/../update-browserslist-db/cli.js" "$@" +fi diff --git a/node_modules/.bin/update-browserslist-db.cmd b/node_modules/.bin/update-browserslist-db.cmd new file mode 100644 index 0000000..2e14905 --- /dev/null +++ b/node_modules/.bin/update-browserslist-db.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\update-browserslist-db\cli.js" %* diff --git a/node_modules/.bin/update-browserslist-db.ps1 b/node_modules/.bin/update-browserslist-db.ps1 new file mode 100644 index 0000000..7abdf26 --- /dev/null +++ b/node_modules/.bin/update-browserslist-db.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../update-browserslist-db/cli.js" $args + } else { + & "$basedir/node$exe" "$basedir/../update-browserslist-db/cli.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../update-browserslist-db/cli.js" $args + } else { + & "node$exe" "$basedir/../update-browserslist-db/cli.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/webpack b/node_modules/.bin/webpack new file mode 100644 index 0000000..e674801 --- /dev/null +++ b/node_modules/.bin/webpack @@ -0,0 +1,12 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../webpack/bin/webpack.js" "$@" +else + exec node "$basedir/../webpack/bin/webpack.js" "$@" +fi diff --git a/node_modules/.bin/webpack.cmd b/node_modules/.bin/webpack.cmd new file mode 100644 index 0000000..5b1e07b --- /dev/null +++ b/node_modules/.bin/webpack.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\webpack\bin\webpack.js" %* diff --git a/node_modules/.bin/webpack.ps1 b/node_modules/.bin/webpack.ps1 new file mode 100644 index 0000000..57bb525 --- /dev/null +++ b/node_modules/.bin/webpack.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../webpack/bin/webpack.js" $args + } else { + & "$basedir/node$exe" "$basedir/../webpack/bin/webpack.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../webpack/bin/webpack.js" $args + } else { + & "node$exe" "$basedir/../webpack/bin/webpack.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json new file mode 100644 index 0000000..0692935 --- /dev/null +++ b/node_modules/.package-lock.json @@ -0,0 +1,1266 @@ +{ + "name": "uView", + "version": "1.8.6", + "lockfileVersion": 2, + "requires": true, + "packages": { + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", + "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", + "dev": true, + "peer": true, + "dependencies": { + "@jridgewell/set-array": "^1.0.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.9" + }, + "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, + "peer": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/set-array": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", + "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", + "dev": true, + "peer": true, + "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, + "peer": true, + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.0", + "@jridgewell/trace-mapping": "^0.3.9" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", + "dev": true, + "peer": true + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.19", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.19.tgz", + "integrity": "sha512-kf37QtfW+Hwx/buWGMPcR60iF9ziHa6r/CZJIHbmcm4+0qrXiVdxegAH0F6yddEVQ7zdkjcGCgCzUu+BcbhQxw==", + "dev": true, + "peer": true, + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@types/eslint": { + "version": "8.44.2", + "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.44.2.tgz", + "integrity": "sha512-sdPRb9K6iL5XZOmBubg8yiFp5yS/JdUDQsq5e6h95km91MCYMuvp7mh1fjPEYUhvHepKpZOjnEaMBR4PxjWDzg==", + "dev": true, + "peer": true, + "dependencies": { + "@types/estree": "*", + "@types/json-schema": "*" + } + }, + "node_modules/@types/eslint-scope": { + "version": "3.7.4", + "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.4.tgz", + "integrity": "sha512-9K4zoImiZc3HlIp6AVUDE4CWYx22a+lhSZMYNpbjW04+YF0KWj4pJXnEMjdnFTiQibFFmElcsasJXDbdI/EPhA==", + "dev": true, + "peer": true, + "dependencies": { + "@types/eslint": "*", + "@types/estree": "*" + } + }, + "node_modules/@types/estree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.1.tgz", + "integrity": "sha512-LG4opVs2ANWZ1TJoKc937iMmNstM/d0ae1vNbnBvBhqCSezgVUOzcLCqbI5elV8Vy6WKwKjaqR+zO9VKirBBCA==", + "dev": true, + "peer": true + }, + "node_modules/@types/json-schema": { + "version": "7.0.13", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.13.tgz", + "integrity": "sha512-RbSSoHliUbnXj3ny0CNFOoxrIDV6SUGyStHsvDqosw6CkdPV8TtWGlfecuK4ToyMEAql6pzNxgCFKanovUzlgQ==", + "dev": true + }, + "node_modules/@types/node": { + "version": "20.6.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.6.2.tgz", + "integrity": "sha512-Y+/1vGBHV/cYk6OI1Na/LHzwnlNCAfU3ZNGrc1LdRe/LAIbdDPTTv/HU3M7yXN448aTVDq3eKRm2cg7iKLb8gw==", + "dev": true, + "peer": true + }, + "node_modules/@webassemblyjs/ast": { + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.6.tgz", + "integrity": "sha512-IN1xI7PwOvLPgjcf180gC1bqn3q/QaOCwYUahIOhbYUu8KA/3tw2RT/T0Gidi1l7Hhj5D/INhJxiICObqpMu4Q==", + "dev": true, + "peer": true, + "dependencies": { + "@webassemblyjs/helper-numbers": "1.11.6", + "@webassemblyjs/helper-wasm-bytecode": "1.11.6" + } + }, + "node_modules/@webassemblyjs/floating-point-hex-parser": { + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.6.tgz", + "integrity": "sha512-ejAj9hfRJ2XMsNHk/v6Fu2dGS+i4UaXBXGemOfQ/JfQ6mdQg/WXtwleQRLLS4OvfDhv8rYnVwH27YJLMyYsxhw==", + "dev": true, + "peer": true + }, + "node_modules/@webassemblyjs/helper-api-error": { + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.6.tgz", + "integrity": "sha512-o0YkoP4pVu4rN8aTJgAyj9hC2Sv5UlkzCHhxqWj8butaLvnpdc2jOwh4ewE6CX0txSfLn/UYaV/pheS2Txg//Q==", + "dev": true, + "peer": true + }, + "node_modules/@webassemblyjs/helper-buffer": { + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.11.6.tgz", + "integrity": "sha512-z3nFzdcp1mb8nEOFFk8DrYLpHvhKC3grJD2ardfKOzmbmJvEf/tPIqCY+sNcwZIY8ZD7IkB2l7/pqhUhqm7hLA==", + "dev": true, + "peer": true + }, + "node_modules/@webassemblyjs/helper-numbers": { + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.6.tgz", + "integrity": "sha512-vUIhZ8LZoIWHBohiEObxVm6hwP034jwmc9kuq5GdHZH0wiLVLIPcMCdpJzG4C11cHoQ25TFIQj9kaVADVX7N3g==", + "dev": true, + "peer": true, + "dependencies": { + "@webassemblyjs/floating-point-hex-parser": "1.11.6", + "@webassemblyjs/helper-api-error": "1.11.6", + "@xtuc/long": "4.2.2" + } + }, + "node_modules/@webassemblyjs/helper-wasm-bytecode": { + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.6.tgz", + "integrity": "sha512-sFFHKwcmBprO9e7Icf0+gddyWYDViL8bpPjJJl0WHxCdETktXdmtWLGVzoHbqUcY4Be1LkNfwTmXOJUFZYSJdA==", + "dev": true, + "peer": true + }, + "node_modules/@webassemblyjs/helper-wasm-section": { + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.11.6.tgz", + "integrity": "sha512-LPpZbSOwTpEC2cgn4hTydySy1Ke+XEu+ETXuoyvuyezHO3Kjdu90KK95Sh9xTbmjrCsUwvWwCOQQNta37VrS9g==", + "dev": true, + "peer": true, + "dependencies": { + "@webassemblyjs/ast": "1.11.6", + "@webassemblyjs/helper-buffer": "1.11.6", + "@webassemblyjs/helper-wasm-bytecode": "1.11.6", + "@webassemblyjs/wasm-gen": "1.11.6" + } + }, + "node_modules/@webassemblyjs/ieee754": { + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.11.6.tgz", + "integrity": "sha512-LM4p2csPNvbij6U1f19v6WR56QZ8JcHg3QIJTlSwzFcmx6WSORicYj6I63f9yU1kEUtrpG+kjkiIAkevHpDXrg==", + "dev": true, + "peer": true, + "dependencies": { + "@xtuc/ieee754": "^1.2.0" + } + }, + "node_modules/@webassemblyjs/leb128": { + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.11.6.tgz", + "integrity": "sha512-m7a0FhE67DQXgouf1tbN5XQcdWoNgaAuoULHIfGFIEVKA6tu/edls6XnIlkmS6FrXAquJRPni3ZZKjw6FSPjPQ==", + "dev": true, + "peer": true, + "dependencies": { + "@xtuc/long": "4.2.2" + } + }, + "node_modules/@webassemblyjs/utf8": { + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.11.6.tgz", + "integrity": "sha512-vtXf2wTQ3+up9Zsg8sa2yWiQpzSsMyXj0qViVP6xKGCUT8p8YJ6HqI7l5eCnWx1T/FYdsv07HQs2wTFbbof/RA==", + "dev": true, + "peer": true + }, + "node_modules/@webassemblyjs/wasm-edit": { + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.11.6.tgz", + "integrity": "sha512-Ybn2I6fnfIGuCR+Faaz7YcvtBKxvoLV3Lebn1tM4o/IAJzmi9AWYIPWpyBfU8cC+JxAO57bk4+zdsTjJR+VTOw==", + "dev": true, + "peer": true, + "dependencies": { + "@webassemblyjs/ast": "1.11.6", + "@webassemblyjs/helper-buffer": "1.11.6", + "@webassemblyjs/helper-wasm-bytecode": "1.11.6", + "@webassemblyjs/helper-wasm-section": "1.11.6", + "@webassemblyjs/wasm-gen": "1.11.6", + "@webassemblyjs/wasm-opt": "1.11.6", + "@webassemblyjs/wasm-parser": "1.11.6", + "@webassemblyjs/wast-printer": "1.11.6" + } + }, + "node_modules/@webassemblyjs/wasm-gen": { + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.11.6.tgz", + "integrity": "sha512-3XOqkZP/y6B4F0PBAXvI1/bky7GryoogUtfwExeP/v7Nzwo1QLcq5oQmpKlftZLbT+ERUOAZVQjuNVak6UXjPA==", + "dev": true, + "peer": true, + "dependencies": { + "@webassemblyjs/ast": "1.11.6", + "@webassemblyjs/helper-wasm-bytecode": "1.11.6", + "@webassemblyjs/ieee754": "1.11.6", + "@webassemblyjs/leb128": "1.11.6", + "@webassemblyjs/utf8": "1.11.6" + } + }, + "node_modules/@webassemblyjs/wasm-opt": { + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.11.6.tgz", + "integrity": "sha512-cOrKuLRE7PCe6AsOVl7WasYf3wbSo4CeOk6PkrjS7g57MFfVUF9u6ysQBBODX0LdgSvQqRiGz3CXvIDKcPNy4g==", + "dev": true, + "peer": true, + "dependencies": { + "@webassemblyjs/ast": "1.11.6", + "@webassemblyjs/helper-buffer": "1.11.6", + "@webassemblyjs/wasm-gen": "1.11.6", + "@webassemblyjs/wasm-parser": "1.11.6" + } + }, + "node_modules/@webassemblyjs/wasm-parser": { + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.11.6.tgz", + "integrity": "sha512-6ZwPeGzMJM3Dqp3hCsLgESxBGtT/OeCvCZ4TA1JUPYgmhAx38tTPR9JaKy0S5H3evQpO/h2uWs2j6Yc/fjkpTQ==", + "dev": true, + "peer": true, + "dependencies": { + "@webassemblyjs/ast": "1.11.6", + "@webassemblyjs/helper-api-error": "1.11.6", + "@webassemblyjs/helper-wasm-bytecode": "1.11.6", + "@webassemblyjs/ieee754": "1.11.6", + "@webassemblyjs/leb128": "1.11.6", + "@webassemblyjs/utf8": "1.11.6" + } + }, + "node_modules/@webassemblyjs/wast-printer": { + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.11.6.tgz", + "integrity": "sha512-JM7AhRcE+yW2GWYaKeHL5vt4xqee5N2WcezptmgyhNS+ScggqcT1OtXykhAb13Sn5Yas0j2uv9tHgrjwvzAP4A==", + "dev": true, + "peer": true, + "dependencies": { + "@webassemblyjs/ast": "1.11.6", + "@xtuc/long": "4.2.2" + } + }, + "node_modules/@xtuc/ieee754": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", + "integrity": "sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==", + "dev": true, + "peer": true + }, + "node_modules/@xtuc/long": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz", + "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", + "dev": true, + "peer": true + }, + "node_modules/acorn": { + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", + "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==", + "dev": true, + "peer": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-import-assertions": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/acorn-import-assertions/-/acorn-import-assertions-1.9.0.tgz", + "integrity": "sha512-cmMwop9x+8KFhxvKrKfPYmN6/pKTYYHBqLa0DfvVZcKMJWNyWLnaqND7dx/qn66R7ewM1UX5XMaDVP5wlVTaVA==", + "dev": true, + "peer": true, + "peerDependencies": { + "acorn": "^8" + } + }, + "node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ajv-keywords": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", + "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", + "dev": true, + "peerDependencies": { + "ajv": "^6.9.1" + } + }, + "node_modules/anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmmirror.com/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/big.js": { + "version": "5.2.2", + "resolved": "https://registry.npmmirror.com/big.js/-/big.js-5.2.2.tgz", + "integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/binary-extensions": { + "version": "2.3.0", + "resolved": "https://registry.npmmirror.com/binary-extensions/-/binary-extensions-2.3.0.tgz", + "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==", + "engines": { + "node": ">=8" + } + }, + "node_modules/braces": { + "version": "3.0.2", + "resolved": "https://registry.npmmirror.com/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dependencies": { + "fill-range": "^7.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/browserslist": { + "version": "4.21.10", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.10.tgz", + "integrity": "sha512-bipEBdZfVH5/pwrvqc+Ub0kUPVfGUhlKxbvfD+z1BDnPEO/X98ruXGA1WP5ASpAFKan7Qr6j736IacbZQuAlKQ==", + "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" + } + ], + "peer": true, + "dependencies": { + "caniuse-lite": "^1.0.30001517", + "electron-to-chromium": "^1.4.477", + "node-releases": "^2.0.13", + "update-browserslist-db": "^1.0.11" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, + "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, + "peer": true + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001535", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001535.tgz", + "integrity": "sha512-48jLyUkiWFfhm/afF7cQPqPjaUmSraEhK4j+FCTJpgnGGEZHqyLe3hmWH7lIooZdSzXL0ReMvHz0vKDoTBsrwg==", + "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" + } + ], + "peer": true + }, + "node_modules/chokidar": { + "version": "3.6.0", + "resolved": "https://registry.npmmirror.com/chokidar/-/chokidar-3.6.0.tgz", + "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/chrome-trace-event": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz", + "integrity": "sha512-p3KULyQg4S7NIHixdwbGX+nFHkoBiA4YQmyWtjb8XngSKV124nJmRysgAeujbUVb15vh+RvFUfCPqU7rXk+hZg==", + "dev": true, + "peer": true, + "engines": { + "node": ">=6.0" + } + }, + "node_modules/clone-deep": { + "version": "4.0.1", + "resolved": "https://registry.npmmirror.com/clone-deep/-/clone-deep-4.0.1.tgz", + "integrity": "sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ==", + "dev": true, + "dependencies": { + "is-plain-object": "^2.0.4", + "kind-of": "^6.0.2", + "shallow-clone": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "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, + "peer": true + }, + "node_modules/dayjs": { + "version": "1.11.10", + "resolved": "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.10.tgz", + "integrity": "sha512-vjAczensTgRcqDERK0SR2XMwsF/tSvnvlv6VcF2GIhg6Sx4yOIt/irsr1RDJsKiIyBzJDpCoXiWWq28MqH2cnQ==" + }, + "node_modules/electron-to-chromium": { + "version": "1.4.523", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.523.tgz", + "integrity": "sha512-9AreocSUWnzNtvLcbpng6N+GkXnCcBR80IQkxRC9Dfdyg4gaWNUPBujAHUpKkiUkoSoR9UlhA4zD/IgBklmhzg==", + "dev": true, + "peer": true + }, + "node_modules/emojis-list": { + "version": "3.0.0", + "resolved": "https://registry.npmmirror.com/emojis-list/-/emojis-list-3.0.0.tgz", + "integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==", + "dev": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/enhanced-resolve": { + "version": "5.15.0", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.15.0.tgz", + "integrity": "sha512-LXYT42KJ7lpIKECr2mAXIaMldcNCh/7E0KBKOu4KSfkHmP+mZmSs+8V5gBAqisWBy0OO4W5Oyys0GO1Y8KtdKg==", + "dev": true, + "peer": true, + "dependencies": { + "graceful-fs": "^4.2.4", + "tapable": "^2.2.0" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/es-module-lexer": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.3.1.tgz", + "integrity": "sha512-JUFAyicQV9mXc3YRxPnDlrfBKpqt6hUYzz9/boprUJHs4e4KVr3XwOF70doO6gwXUor6EWZJAyWAfKki84t20Q==", + "dev": true, + "peer": true + }, + "node_modules/escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "dev": true, + "peer": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "dev": true, + "peer": true, + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "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, + "peer": true, + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esrecurse/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, + "peer": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true, + "peer": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/events": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", + "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", + "dev": true, + "peer": true, + "engines": { + "node": ">=0.8.x" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "node_modules/fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmmirror.com/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmmirror.com/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/glob-to-regexp": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz", + "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==", + "dev": true, + "peer": true + }, + "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, + "peer": true + }, + "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, + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/immutable": { + "version": "4.3.5", + "resolved": "https://registry.npmmirror.com/immutable/-/immutable-4.3.5.tgz", + "integrity": "sha512-8eabxkth9gZatlwl5TBuJnCsoTADlL6ftEr7A4qgdaTsPyreilDSnUk57SO+jfKcNtxPa22U5KK6DSeAYhpBJw==" + }, + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmmirror.com/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmmirror.com/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmmirror.com/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmmirror.com/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmmirror.com/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "dev": true, + "dependencies": { + "isobject": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmmirror.com/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/jest-worker": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.5.1.tgz", + "integrity": "sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==", + "dev": true, + "peer": true, + "dependencies": { + "@types/node": "*", + "merge-stream": "^2.0.0", + "supports-color": "^8.0.0" + }, + "engines": { + "node": ">= 10.13.0" + } + }, + "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, + "peer": 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 + }, + "node_modules/json5": { + "version": "1.0.2", + "resolved": "https://registry.npmmirror.com/json5/-/json5-1.0.2.tgz", + "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", + "dev": true, + "dependencies": { + "minimist": "^1.2.0" + }, + "bin": { + "json5": "lib/cli.js" + } + }, + "node_modules/kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmmirror.com/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/loader-runner": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.3.0.tgz", + "integrity": "sha512-3R/1M+yS3j5ou80Me59j7F9IMs4PXs3VqRrm0TU3AbKPxlmpoY1TNscJV/oGJXo8qCatFGTfDbY6W6ipGOYXfg==", + "dev": true, + "peer": true, + "engines": { + "node": ">=6.11.5" + } + }, + "node_modules/loader-utils": { + "version": "1.4.2", + "resolved": "https://registry.npmmirror.com/loader-utils/-/loader-utils-1.4.2.tgz", + "integrity": "sha512-I5d00Pd/jwMD2QCduo657+YM/6L3KZu++pmX9VFncxaxvHcru9jx1lBaFft+r4Mt2jK0Yhp41XlRAihzPxHNCg==", + "dev": true, + "dependencies": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^1.0.1" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmmirror.com/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + }, + "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, + "peer": true + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "dev": true, + "peer": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dev": true, + "peer": true, + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmmirror.com/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "dev": true + }, + "node_modules/neo-async": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", + "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", + "dev": true + }, + "node_modules/node-releases": { + "version": "2.0.13", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.13.tgz", + "integrity": "sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ==", + "dev": true, + "peer": true + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmmirror.com/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/picocolors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", + "dev": true, + "peer": true + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmmirror.com/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "engines": { + "node": ">=8.6" + } + }, + "node_modules/punycode": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", + "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dev": true, + "peer": true, + "dependencies": { + "safe-buffer": "^5.1.0" + } + }, + "node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmmirror.com/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "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" + } + ], + "peer": true + }, + "node_modules/sass": { + "version": "1.72.0", + "resolved": "https://registry.npmmirror.com/sass/-/sass-1.72.0.tgz", + "integrity": "sha512-Gpczt3WA56Ly0Mn8Sl21Vj94s1axi9hDIzDFn9Ph9x3C3p4nNyvsqJoQyVXKou6cBlfFWEgRW4rT8Tb4i3XnVA==", + "dependencies": { + "chokidar": ">=3.0.0 <4.0.0", + "immutable": "^4.0.0", + "source-map-js": ">=0.6.2 <2.0.0" + }, + "bin": { + "sass": "sass.js" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/sass-loader": { + "version": "8.0.2", + "resolved": "https://registry.npmmirror.com/sass-loader/-/sass-loader-8.0.2.tgz", + "integrity": "sha512-7o4dbSK8/Ol2KflEmSco4jTjQoV988bM82P9CZdmo9hR3RLnvNc0ufMNdMrB0caq38JQ/FgF4/7RcbcfKzxoFQ==", + "dev": true, + "dependencies": { + "clone-deep": "^4.0.1", + "loader-utils": "^1.2.3", + "neo-async": "^2.6.1", + "schema-utils": "^2.6.1", + "semver": "^6.3.0" + }, + "engines": { + "node": ">= 8.9.0" + }, + "peerDependencies": { + "fibers": ">= 3.1.0", + "node-sass": "^4.0.0", + "sass": "^1.3.0", + "webpack": "^4.36.0 || ^5.0.0" + }, + "peerDependenciesMeta": { + "fibers": { + "optional": true + }, + "node-sass": { + "optional": true + }, + "sass": { + "optional": true + } + } + }, + "node_modules/sass-loader/node_modules/schema-utils": { + "version": "2.7.1", + "resolved": "https://registry.npmmirror.com/schema-utils/-/schema-utils-2.7.1.tgz", + "integrity": "sha512-SHiNtMOUGWBQJwzISiVYKu82GiV4QYGePp3odlY1tuKO7gPtphAT5R/py0fA6xtbgLL/RvtJZnU9b8s0F1q0Xg==", + "dev": true, + "dependencies": { + "@types/json-schema": "^7.0.5", + "ajv": "^6.12.4", + "ajv-keywords": "^3.5.2" + }, + "engines": { + "node": ">= 8.9.0" + } + }, + "node_modules/schema-utils": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.3.0.tgz", + "integrity": "sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg==", + "dev": true, + "peer": true, + "dependencies": { + "@types/json-schema": "^7.0.8", + "ajv": "^6.12.5", + "ajv-keywords": "^3.5.2" + }, + "engines": { + "node": ">= 10.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + } + }, + "node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmmirror.com/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.1", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.1.tgz", + "integrity": "sha512-owoXEFjWRllis8/M1Q+Cw5k8ZH40e3zhp/ovX+Xr/vi1qj6QesbyXXViFbpNvWvPNAD62SutwEXavefrLJWj7w==", + "dev": true, + "peer": true, + "dependencies": { + "randombytes": "^2.1.0" + } + }, + "node_modules/shallow-clone": { + "version": "3.0.1", + "resolved": "https://registry.npmmirror.com/shallow-clone/-/shallow-clone-3.0.1.tgz", + "integrity": "sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA==", + "dev": true, + "dependencies": { + "kind-of": "^6.0.2" + }, + "engines": { + "node": ">=8" + } + }, + "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, + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-js": { + "version": "1.2.0", + "resolved": "https://registry.npmmirror.com/source-map-js/-/source-map-js-1.2.0.tgz", + "integrity": "sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==", + "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, + "peer": true, + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "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, + "peer": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/tapable": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", + "integrity": "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==", + "dev": true, + "peer": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/terser": { + "version": "5.19.4", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.19.4.tgz", + "integrity": "sha512-6p1DjHeuluwxDXcuT9VR8p64klWJKo1ILiy19s6C9+0Bh2+NWTX6nD9EPppiER4ICkHDVB1RkVpin/YW2nQn/g==", + "dev": true, + "peer": 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-webpack-plugin": { + "version": "5.3.9", + "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.9.tgz", + "integrity": "sha512-ZuXsqE07EcggTWQjXUj+Aot/OMcD0bMKGgF63f7UxYcu5/AJF53aIpK1YoP5xR9l6s/Hy2b+t1AM0bLNPRuhwA==", + "dev": true, + "peer": true, + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.17", + "jest-worker": "^27.4.5", + "schema-utils": "^3.1.1", + "serialize-javascript": "^6.0.1", + "terser": "^5.16.8" + }, + "engines": { + "node": ">= 10.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependencies": { + "webpack": "^5.1.0" + }, + "peerDependenciesMeta": { + "@swc/core": { + "optional": true + }, + "esbuild": { + "optional": true + }, + "uglify-js": { + "optional": true + } + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmmirror.com/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/update-browserslist-db": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.11.tgz", + "integrity": "sha512-dCwEFf0/oT85M1fHBg4F0jtLwJrutGoHSQXCh7u4o2t1drG+c0a9Flnqww6XUKSfQMPpJBRjU8d4RXB09qtvaA==", + "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" + } + ], + "peer": true, + "dependencies": { + "escalade": "^3.1.1", + "picocolors": "^1.0.0" + }, + "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, + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/watchpack": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.0.tgz", + "integrity": "sha512-Lcvm7MGST/4fup+ifyKi2hjyIAwcdI4HRgtvTpIUxBRhB+RFtUh8XtDOxUfctVCnhVi+QQj49i91OyvzkJl6cg==", + "dev": true, + "peer": true, + "dependencies": { + "glob-to-regexp": "^0.4.1", + "graceful-fs": "^4.1.2" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/webpack": { + "version": "5.88.2", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.88.2.tgz", + "integrity": "sha512-JmcgNZ1iKj+aiR0OvTYtWQqJwq37Pf683dY9bVORwVbUrDhLhdn/PlO2sHsFHPkj7sHNQF3JwaAkp49V+Sq1tQ==", + "dev": true, + "peer": true, + "dependencies": { + "@types/eslint-scope": "^3.7.3", + "@types/estree": "^1.0.0", + "@webassemblyjs/ast": "^1.11.5", + "@webassemblyjs/wasm-edit": "^1.11.5", + "@webassemblyjs/wasm-parser": "^1.11.5", + "acorn": "^8.7.1", + "acorn-import-assertions": "^1.9.0", + "browserslist": "^4.14.5", + "chrome-trace-event": "^1.0.2", + "enhanced-resolve": "^5.15.0", + "es-module-lexer": "^1.2.1", + "eslint-scope": "5.1.1", + "events": "^3.2.0", + "glob-to-regexp": "^0.4.1", + "graceful-fs": "^4.2.9", + "json-parse-even-better-errors": "^2.3.1", + "loader-runner": "^4.2.0", + "mime-types": "^2.1.27", + "neo-async": "^2.6.2", + "schema-utils": "^3.2.0", + "tapable": "^2.1.1", + "terser-webpack-plugin": "^5.3.7", + "watchpack": "^2.4.0", + "webpack-sources": "^3.2.3" + }, + "bin": { + "webpack": "bin/webpack.js" + }, + "engines": { + "node": ">=10.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependenciesMeta": { + "webpack-cli": { + "optional": true + } + } + }, + "node_modules/webpack-sources": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.3.tgz", + "integrity": "sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==", + "dev": true, + "peer": true, + "engines": { + "node": ">=10.13.0" + } + } + } +} diff --git a/node_modules/@jridgewell/gen-mapping/LICENSE b/node_modules/@jridgewell/gen-mapping/LICENSE new file mode 100644 index 0000000..352f071 --- /dev/null +++ b/node_modules/@jridgewell/gen-mapping/LICENSE @@ -0,0 +1,19 @@ +Copyright 2022 Justin Ridgewell + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/@jridgewell/gen-mapping/README.md b/node_modules/@jridgewell/gen-mapping/README.md new file mode 100644 index 0000000..4066cdb --- /dev/null +++ b/node_modules/@jridgewell/gen-mapping/README.md @@ -0,0 +1,227 @@ +# @jridgewell/gen-mapping + +> Generate source maps + +`gen-mapping` allows you to generate a source map during transpilation or minification. +With a source map, you're able to trace the original location in the source file, either in Chrome's +DevTools or using a library like [`@jridgewell/trace-mapping`][trace-mapping]. + +You may already be familiar with the [`source-map`][source-map] package's `SourceMapGenerator`. This +provides the same `addMapping` and `setSourceContent` API. + +## Installation + +```sh +npm install @jridgewell/gen-mapping +``` + +## Usage + +```typescript +import { GenMapping, addMapping, setSourceContent, toEncodedMap, toDecodedMap } from '@jridgewell/gen-mapping'; + +const map = new GenMapping({ + file: 'output.js', + sourceRoot: 'https://example.com/', +}); + +setSourceContent(map, 'input.js', `function foo() {}`); + +addMapping(map, { + // Lines start at line 1, columns at column 0. + generated: { line: 1, column: 0 }, + source: 'input.js', + original: { line: 1, column: 0 }, +}); + +addMapping(map, { + generated: { line: 1, column: 9 }, + source: 'input.js', + original: { line: 1, column: 9 }, + name: 'foo', +}); + +assert.deepEqual(toDecodedMap(map), { + version: 3, + file: 'output.js', + names: ['foo'], + sourceRoot: 'https://example.com/', + sources: ['input.js'], + sourcesContent: ['function foo() {}'], + mappings: [ + [ [0, 0, 0, 0], [9, 0, 0, 9, 0] ] + ], +}); + +assert.deepEqual(toEncodedMap(map), { + version: 3, + file: 'output.js', + names: ['foo'], + sourceRoot: 'https://example.com/', + sources: ['input.js'], + sourcesContent: ['function foo() {}'], + mappings: 'AAAA,SAASA', +}); +``` + +### Smaller Sourcemaps + +Not everything needs to be added to a sourcemap, and needless markings can cause signficantly +larger file sizes. `gen-mapping` exposes `maybeAddSegment`/`maybeAddMapping` APIs that will +intelligently determine if this marking adds useful information. If not, the marking will be +skipped. + +```typescript +import { maybeAddMapping } from '@jridgewell/gen-mapping'; + +const map = new GenMapping(); + +// Adding a sourceless marking at the beginning of a line isn't useful. +maybeAddMapping(map, { + generated: { line: 1, column: 0 }, +}); + +// Adding a new source marking is useful. +maybeAddMapping(map, { + generated: { line: 1, column: 0 }, + source: 'input.js', + original: { line: 1, column: 0 }, +}); + +// But adding another marking pointing to the exact same original location isn't, even if the +// generated column changed. +maybeAddMapping(map, { + generated: { line: 1, column: 9 }, + source: 'input.js', + original: { line: 1, column: 0 }, +}); + +assert.deepEqual(toEncodedMap(map), { + version: 3, + names: [], + sources: ['input.js'], + sourcesContent: [null], + mappings: 'AAAA', +}); +``` + +## Benchmarks + +``` +node v18.0.0 + +amp.js.map +Memory Usage: +gen-mapping: addSegment 5852872 bytes +gen-mapping: addMapping 7716042 bytes +source-map-js 6143250 bytes +source-map-0.6.1 6124102 bytes +source-map-0.8.0 6121173 bytes +Smallest memory usage is gen-mapping: addSegment + +Adding speed: +gen-mapping: addSegment x 441 ops/sec ±2.07% (90 runs sampled) +gen-mapping: addMapping x 350 ops/sec ±2.40% (86 runs sampled) +source-map-js: addMapping x 169 ops/sec ±2.42% (80 runs sampled) +source-map-0.6.1: addMapping x 167 ops/sec ±2.56% (80 runs sampled) +source-map-0.8.0: addMapping x 168 ops/sec ±2.52% (80 runs sampled) +Fastest is gen-mapping: addSegment + +Generate speed: +gen-mapping: decoded output x 150,824,370 ops/sec ±0.07% (102 runs sampled) +gen-mapping: encoded output x 663 ops/sec ±0.22% (98 runs sampled) +source-map-js: encoded output x 197 ops/sec ±0.45% (84 runs sampled) +source-map-0.6.1: encoded output x 198 ops/sec ±0.33% (85 runs sampled) +source-map-0.8.0: encoded output x 197 ops/sec ±0.06% (93 runs sampled) +Fastest is gen-mapping: decoded output + + +*** + + +babel.min.js.map +Memory Usage: +gen-mapping: addSegment 37578063 bytes +gen-mapping: addMapping 37212897 bytes +source-map-js 47638527 bytes +source-map-0.6.1 47690503 bytes +source-map-0.8.0 47470188 bytes +Smallest memory usage is gen-mapping: addMapping + +Adding speed: +gen-mapping: addSegment x 31.05 ops/sec ±8.31% (43 runs sampled) +gen-mapping: addMapping x 29.83 ops/sec ±7.36% (51 runs sampled) +source-map-js: addMapping x 20.73 ops/sec ±6.22% (38 runs sampled) +source-map-0.6.1: addMapping x 20.03 ops/sec ±10.51% (38 runs sampled) +source-map-0.8.0: addMapping x 19.30 ops/sec ±8.27% (37 runs sampled) +Fastest is gen-mapping: addSegment + +Generate speed: +gen-mapping: decoded output x 381,379,234 ops/sec ±0.29% (96 runs sampled) +gen-mapping: encoded output x 95.15 ops/sec ±2.98% (72 runs sampled) +source-map-js: encoded output x 15.20 ops/sec ±7.41% (33 runs sampled) +source-map-0.6.1: encoded output x 16.36 ops/sec ±10.46% (31 runs sampled) +source-map-0.8.0: encoded output x 16.06 ops/sec ±6.45% (31 runs sampled) +Fastest is gen-mapping: decoded output + + +*** + + +preact.js.map +Memory Usage: +gen-mapping: addSegment 416247 bytes +gen-mapping: addMapping 419824 bytes +source-map-js 1024619 bytes +source-map-0.6.1 1146004 bytes +source-map-0.8.0 1113250 bytes +Smallest memory usage is gen-mapping: addSegment + +Adding speed: +gen-mapping: addSegment x 13,755 ops/sec ±0.15% (98 runs sampled) +gen-mapping: addMapping x 13,013 ops/sec ±0.11% (101 runs sampled) +source-map-js: addMapping x 4,564 ops/sec ±0.21% (98 runs sampled) +source-map-0.6.1: addMapping x 4,562 ops/sec ±0.11% (99 runs sampled) +source-map-0.8.0: addMapping x 4,593 ops/sec ±0.11% (100 runs sampled) +Fastest is gen-mapping: addSegment + +Generate speed: +gen-mapping: decoded output x 379,864,020 ops/sec ±0.23% (93 runs sampled) +gen-mapping: encoded output x 14,368 ops/sec ±4.07% (82 runs sampled) +source-map-js: encoded output x 5,261 ops/sec ±0.21% (99 runs sampled) +source-map-0.6.1: encoded output x 5,124 ops/sec ±0.58% (99 runs sampled) +source-map-0.8.0: encoded output x 5,434 ops/sec ±0.33% (96 runs sampled) +Fastest is gen-mapping: decoded output + + +*** + + +react.js.map +Memory Usage: +gen-mapping: addSegment 975096 bytes +gen-mapping: addMapping 1102981 bytes +source-map-js 2918836 bytes +source-map-0.6.1 2885435 bytes +source-map-0.8.0 2874336 bytes +Smallest memory usage is gen-mapping: addSegment + +Adding speed: +gen-mapping: addSegment x 4,772 ops/sec ±0.15% (100 runs sampled) +gen-mapping: addMapping x 4,456 ops/sec ±0.13% (97 runs sampled) +source-map-js: addMapping x 1,618 ops/sec ±0.24% (97 runs sampled) +source-map-0.6.1: addMapping x 1,622 ops/sec ±0.12% (99 runs sampled) +source-map-0.8.0: addMapping x 1,631 ops/sec ±0.12% (100 runs sampled) +Fastest is gen-mapping: addSegment + +Generate speed: +gen-mapping: decoded output x 379,107,695 ops/sec ±0.07% (99 runs sampled) +gen-mapping: encoded output x 5,421 ops/sec ±1.60% (89 runs sampled) +source-map-js: encoded output x 2,113 ops/sec ±1.81% (98 runs sampled) +source-map-0.6.1: encoded output x 2,126 ops/sec ±0.10% (100 runs sampled) +source-map-0.8.0: encoded output x 2,176 ops/sec ±0.39% (98 runs sampled) +Fastest is gen-mapping: decoded output +``` + +[source-map]: https://www.npmjs.com/package/source-map +[trace-mapping]: https://github.com/jridgewell/trace-mapping diff --git a/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.mjs b/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.mjs new file mode 100644 index 0000000..5aeb5cc --- /dev/null +++ b/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.mjs @@ -0,0 +1,230 @@ +import { SetArray, put } from '@jridgewell/set-array'; +import { encode } from '@jridgewell/sourcemap-codec'; +import { TraceMap, decodedMappings } from '@jridgewell/trace-mapping'; + +const COLUMN = 0; +const SOURCES_INDEX = 1; +const SOURCE_LINE = 2; +const SOURCE_COLUMN = 3; +const NAMES_INDEX = 4; + +const NO_NAME = -1; +/** + * A low-level API to associate a generated position with an original source position. Line and + * column here are 0-based, unlike `addMapping`. + */ +let addSegment; +/** + * A high-level API to associate a generated position with an original source position. Line is + * 1-based, but column is 0-based, due to legacy behavior in `source-map` library. + */ +let addMapping; +/** + * Same as `addSegment`, but will only add the segment if it generates useful information in the + * resulting map. This only works correctly if segments are added **in order**, meaning you should + * not add a segment with a lower generated line/column than one that came before. + */ +let maybeAddSegment; +/** + * Same as `addMapping`, but will only add the mapping if it generates useful information in the + * resulting map. This only works correctly if mappings are added **in order**, meaning you should + * not add a mapping with a lower generated line/column than one that came before. + */ +let maybeAddMapping; +/** + * Adds/removes the content of the source file to the source map. + */ +let setSourceContent; +/** + * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects + * a sourcemap, or to JSON.stringify. + */ +let toDecodedMap; +/** + * Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects + * a sourcemap, or to JSON.stringify. + */ +let toEncodedMap; +/** + * Constructs a new GenMapping, using the already present mappings of the input. + */ +let fromMap; +/** + * Returns an array of high-level mapping objects for every recorded segment, which could then be + * passed to the `source-map` library. + */ +let allMappings; +// This split declaration is only so that terser can elminiate the static initialization block. +let addSegmentInternal; +/** + * Provides the state to generate a sourcemap. + */ +class GenMapping { + constructor({ file, sourceRoot } = {}) { + this._names = new SetArray(); + this._sources = new SetArray(); + this._sourcesContent = []; + this._mappings = []; + this.file = file; + this.sourceRoot = sourceRoot; + } +} +(() => { + addSegment = (map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) => { + return addSegmentInternal(false, map, genLine, genColumn, source, sourceLine, sourceColumn, name, content); + }; + maybeAddSegment = (map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) => { + return addSegmentInternal(true, map, genLine, genColumn, source, sourceLine, sourceColumn, name, content); + }; + addMapping = (map, mapping) => { + return addMappingInternal(false, map, mapping); + }; + maybeAddMapping = (map, mapping) => { + return addMappingInternal(true, map, mapping); + }; + setSourceContent = (map, source, content) => { + const { _sources: sources, _sourcesContent: sourcesContent } = map; + sourcesContent[put(sources, source)] = content; + }; + toDecodedMap = (map) => { + const { file, sourceRoot, _mappings: mappings, _sources: sources, _sourcesContent: sourcesContent, _names: names, } = map; + removeEmptyFinalLines(mappings); + return { + version: 3, + file: file || undefined, + names: names.array, + sourceRoot: sourceRoot || undefined, + sources: sources.array, + sourcesContent, + mappings, + }; + }; + toEncodedMap = (map) => { + const decoded = toDecodedMap(map); + return Object.assign(Object.assign({}, decoded), { mappings: encode(decoded.mappings) }); + }; + allMappings = (map) => { + const out = []; + const { _mappings: mappings, _sources: sources, _names: names } = map; + for (let i = 0; i < mappings.length; i++) { + const line = mappings[i]; + for (let j = 0; j < line.length; j++) { + const seg = line[j]; + const generated = { line: i + 1, column: seg[COLUMN] }; + let source = undefined; + let original = undefined; + let name = undefined; + if (seg.length !== 1) { + source = sources.array[seg[SOURCES_INDEX]]; + original = { line: seg[SOURCE_LINE] + 1, column: seg[SOURCE_COLUMN] }; + if (seg.length === 5) + name = names.array[seg[NAMES_INDEX]]; + } + out.push({ generated, source, original, name }); + } + } + return out; + }; + fromMap = (input) => { + const map = new TraceMap(input); + const gen = new GenMapping({ file: map.file, sourceRoot: map.sourceRoot }); + putAll(gen._names, map.names); + putAll(gen._sources, map.sources); + gen._sourcesContent = map.sourcesContent || map.sources.map(() => null); + gen._mappings = decodedMappings(map); + return gen; + }; + // Internal helpers + addSegmentInternal = (skipable, map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) => { + const { _mappings: mappings, _sources: sources, _sourcesContent: sourcesContent, _names: names, } = map; + const line = getLine(mappings, genLine); + const index = getColumnIndex(line, genColumn); + if (!source) { + if (skipable && skipSourceless(line, index)) + return; + return insert(line, index, [genColumn]); + } + const sourcesIndex = put(sources, source); + const namesIndex = name ? put(names, name) : NO_NAME; + if (sourcesIndex === sourcesContent.length) + sourcesContent[sourcesIndex] = content !== null && content !== void 0 ? content : null; + if (skipable && skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex)) { + return; + } + return insert(line, index, name + ? [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex] + : [genColumn, sourcesIndex, sourceLine, sourceColumn]); + }; +})(); +function getLine(mappings, index) { + for (let i = mappings.length; i <= index; i++) { + mappings[i] = []; + } + return mappings[index]; +} +function getColumnIndex(line, genColumn) { + let index = line.length; + for (let i = index - 1; i >= 0; index = i--) { + const current = line[i]; + if (genColumn >= current[COLUMN]) + break; + } + return index; +} +function insert(array, index, value) { + for (let i = array.length; i > index; i--) { + array[i] = array[i - 1]; + } + array[index] = value; +} +function removeEmptyFinalLines(mappings) { + const { length } = mappings; + let len = length; + for (let i = len - 1; i >= 0; len = i, i--) { + if (mappings[i].length > 0) + break; + } + if (len < length) + mappings.length = len; +} +function putAll(strarr, array) { + for (let i = 0; i < array.length; i++) + put(strarr, array[i]); +} +function skipSourceless(line, index) { + // The start of a line is already sourceless, so adding a sourceless segment to the beginning + // doesn't generate any useful information. + if (index === 0) + return true; + const prev = line[index - 1]; + // If the previous segment is also sourceless, then adding another sourceless segment doesn't + // genrate any new information. Else, this segment will end the source/named segment and point to + // a sourceless position, which is useful. + return prev.length === 1; +} +function skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex) { + // A source/named segment at the start of a line gives position at that genColumn + if (index === 0) + return false; + const prev = line[index - 1]; + // If the previous segment is sourceless, then we're transitioning to a source. + if (prev.length === 1) + return false; + // If the previous segment maps to the exact same source position, then this segment doesn't + // provide any new position information. + return (sourcesIndex === prev[SOURCES_INDEX] && + sourceLine === prev[SOURCE_LINE] && + sourceColumn === prev[SOURCE_COLUMN] && + namesIndex === (prev.length === 5 ? prev[NAMES_INDEX] : NO_NAME)); +} +function addMappingInternal(skipable, map, mapping) { + const { generated, source, original, name, content } = mapping; + if (!source) { + return addSegmentInternal(skipable, map, generated.line - 1, generated.column, null, null, null, null, null); + } + const s = source; + return addSegmentInternal(skipable, map, generated.line - 1, generated.column, s, original.line - 1, original.column, name, content); +} + +export { GenMapping, addMapping, addSegment, allMappings, fromMap, maybeAddMapping, maybeAddSegment, setSourceContent, toDecodedMap, toEncodedMap }; +//# sourceMappingURL=gen-mapping.mjs.map diff --git a/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.mjs.map b/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.mjs.map new file mode 100644 index 0000000..2fee0cd --- /dev/null +++ b/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"gen-mapping.mjs","sources":["../src/sourcemap-segment.ts","../src/gen-mapping.ts"],"sourcesContent":["type GeneratedColumn = number;\ntype SourcesIndex = number;\ntype SourceLine = number;\ntype SourceColumn = number;\ntype NamesIndex = number;\n\nexport type SourceMapSegment =\n | [GeneratedColumn]\n | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn]\n | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn, NamesIndex];\n\nexport const COLUMN = 0;\nexport const SOURCES_INDEX = 1;\nexport const SOURCE_LINE = 2;\nexport const SOURCE_COLUMN = 3;\nexport const NAMES_INDEX = 4;\n","import { SetArray, put } from '@jridgewell/set-array';\nimport { encode } from '@jridgewell/sourcemap-codec';\nimport { TraceMap, decodedMappings } from '@jridgewell/trace-mapping';\n\nimport {\n COLUMN,\n SOURCES_INDEX,\n SOURCE_LINE,\n SOURCE_COLUMN,\n NAMES_INDEX,\n} from './sourcemap-segment';\n\nimport type { SourceMapInput } from '@jridgewell/trace-mapping';\nimport type { SourceMapSegment } from './sourcemap-segment';\nimport type { DecodedSourceMap, EncodedSourceMap, Pos, Mapping } from './types';\n\nexport type { DecodedSourceMap, EncodedSourceMap, Mapping };\n\nexport type Options = {\n file?: string | null;\n sourceRoot?: string | null;\n};\n\nconst NO_NAME = -1;\n\n/**\n * A low-level API to associate a generated position with an original source position. Line and\n * column here are 0-based, unlike `addMapping`.\n */\nexport let addSegment: {\n (\n map: GenMapping,\n genLine: number,\n genColumn: number,\n source?: null,\n sourceLine?: null,\n sourceColumn?: null,\n name?: null,\n content?: null,\n ): void;\n (\n map: GenMapping,\n genLine: number,\n genColumn: number,\n source: string,\n sourceLine: number,\n sourceColumn: number,\n name?: null,\n content?: string | null,\n ): void;\n (\n map: GenMapping,\n genLine: number,\n genColumn: number,\n source: string,\n sourceLine: number,\n sourceColumn: number,\n name: string,\n content?: string | null,\n ): void;\n};\n\n/**\n * A high-level API to associate a generated position with an original source position. Line is\n * 1-based, but column is 0-based, due to legacy behavior in `source-map` library.\n */\nexport let addMapping: {\n (\n map: GenMapping,\n mapping: {\n generated: Pos;\n source?: null;\n original?: null;\n name?: null;\n content?: null;\n },\n ): void;\n (\n map: GenMapping,\n mapping: {\n generated: Pos;\n source: string;\n original: Pos;\n name?: null;\n content?: string | null;\n },\n ): void;\n (\n map: GenMapping,\n mapping: {\n generated: Pos;\n source: string;\n original: Pos;\n name: string;\n content?: string | null;\n },\n ): void;\n};\n\n/**\n * Same as `addSegment`, but will only add the segment if it generates useful information in the\n * resulting map. This only works correctly if segments are added **in order**, meaning you should\n * not add a segment with a lower generated line/column than one that came before.\n */\nexport let maybeAddSegment: typeof addSegment;\n\n/**\n * Same as `addMapping`, but will only add the mapping if it generates useful information in the\n * resulting map. This only works correctly if mappings are added **in order**, meaning you should\n * not add a mapping with a lower generated line/column than one that came before.\n */\nexport let maybeAddMapping: typeof addMapping;\n\n/**\n * Adds/removes the content of the source file to the source map.\n */\nexport let setSourceContent: (map: GenMapping, source: string, content: string | null) => void;\n\n/**\n * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects\n * a sourcemap, or to JSON.stringify.\n */\nexport let toDecodedMap: (map: GenMapping) => DecodedSourceMap;\n\n/**\n * Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects\n * a sourcemap, or to JSON.stringify.\n */\nexport let toEncodedMap: (map: GenMapping) => EncodedSourceMap;\n\n/**\n * Constructs a new GenMapping, using the already present mappings of the input.\n */\nexport let fromMap: (input: SourceMapInput) => GenMapping;\n\n/**\n * Returns an array of high-level mapping objects for every recorded segment, which could then be\n * passed to the `source-map` library.\n */\nexport let allMappings: (map: GenMapping) => Mapping[];\n\n// This split declaration is only so that terser can elminiate the static initialization block.\nlet addSegmentInternal: (\n skipable: boolean,\n map: GenMapping,\n genLine: number,\n genColumn: number,\n source: S,\n sourceLine: S extends string ? number : null | undefined,\n sourceColumn: S extends string ? number : null | undefined,\n name: S extends string ? string | null | undefined : null | undefined,\n content: S extends string ? string | null | undefined : null | undefined,\n) => void;\n\n/**\n * Provides the state to generate a sourcemap.\n */\nexport class GenMapping {\n private _names = new SetArray();\n private _sources = new SetArray();\n private _sourcesContent: (string | null)[] = [];\n private _mappings: SourceMapSegment[][] = [];\n declare file: string | null | undefined;\n declare sourceRoot: string | null | undefined;\n\n constructor({ file, sourceRoot }: Options = {}) {\n this.file = file;\n this.sourceRoot = sourceRoot;\n }\n\n static {\n addSegment = (map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) => {\n return addSegmentInternal(\n false,\n map,\n genLine,\n genColumn,\n source,\n sourceLine,\n sourceColumn,\n name,\n content,\n );\n };\n\n maybeAddSegment = (\n map,\n genLine,\n genColumn,\n source,\n sourceLine,\n sourceColumn,\n name,\n content,\n ) => {\n return addSegmentInternal(\n true,\n map,\n genLine,\n genColumn,\n source,\n sourceLine,\n sourceColumn,\n name,\n content,\n );\n };\n\n addMapping = (map, mapping) => {\n return addMappingInternal(false, map, mapping as Parameters[2]);\n };\n\n maybeAddMapping = (map, mapping) => {\n return addMappingInternal(true, map, mapping as Parameters[2]);\n };\n\n setSourceContent = (map, source, content) => {\n const { _sources: sources, _sourcesContent: sourcesContent } = map;\n sourcesContent[put(sources, source)] = content;\n };\n\n toDecodedMap = (map) => {\n const {\n file,\n sourceRoot,\n _mappings: mappings,\n _sources: sources,\n _sourcesContent: sourcesContent,\n _names: names,\n } = map;\n removeEmptyFinalLines(mappings);\n\n return {\n version: 3,\n file: file || undefined,\n names: names.array,\n sourceRoot: sourceRoot || undefined,\n sources: sources.array,\n sourcesContent,\n mappings,\n };\n };\n\n toEncodedMap = (map) => {\n const decoded = toDecodedMap(map);\n return {\n ...decoded,\n mappings: encode(decoded.mappings as SourceMapSegment[][]),\n };\n };\n\n allMappings = (map) => {\n const out: Mapping[] = [];\n const { _mappings: mappings, _sources: sources, _names: names } = map;\n\n for (let i = 0; i < mappings.length; i++) {\n const line = mappings[i];\n for (let j = 0; j < line.length; j++) {\n const seg = line[j];\n\n const generated = { line: i + 1, column: seg[COLUMN] };\n let source: string | undefined = undefined;\n let original: Pos | undefined = undefined;\n let name: string | undefined = undefined;\n\n if (seg.length !== 1) {\n source = sources.array[seg[SOURCES_INDEX]];\n original = { line: seg[SOURCE_LINE] + 1, column: seg[SOURCE_COLUMN] };\n\n if (seg.length === 5) name = names.array[seg[NAMES_INDEX]];\n }\n\n out.push({ generated, source, original, name } as Mapping);\n }\n }\n\n return out;\n };\n\n fromMap = (input) => {\n const map = new TraceMap(input);\n const gen = new GenMapping({ file: map.file, sourceRoot: map.sourceRoot });\n\n putAll(gen._names, map.names);\n putAll(gen._sources, map.sources as string[]);\n gen._sourcesContent = map.sourcesContent || map.sources.map(() => null);\n gen._mappings = decodedMappings(map) as GenMapping['_mappings'];\n\n return gen;\n };\n\n // Internal helpers\n addSegmentInternal = (\n skipable,\n map,\n genLine,\n genColumn,\n source,\n sourceLine,\n sourceColumn,\n name,\n content,\n ) => {\n const {\n _mappings: mappings,\n _sources: sources,\n _sourcesContent: sourcesContent,\n _names: names,\n } = map;\n const line = getLine(mappings, genLine);\n const index = getColumnIndex(line, genColumn);\n\n if (!source) {\n if (skipable && skipSourceless(line, index)) return;\n return insert(line, index, [genColumn]);\n }\n\n // Sigh, TypeScript can't figure out sourceLine and sourceColumn aren't nullish if source\n // isn't nullish.\n assert(sourceLine);\n assert(sourceColumn);\n\n const sourcesIndex = put(sources, source);\n const namesIndex = name ? put(names, name) : NO_NAME;\n if (sourcesIndex === sourcesContent.length) sourcesContent[sourcesIndex] = content ?? null;\n\n if (skipable && skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex)) {\n return;\n }\n\n return insert(\n line,\n index,\n name\n ? [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex]\n : [genColumn, sourcesIndex, sourceLine, sourceColumn],\n );\n };\n }\n}\n\nfunction assert(_val: unknown): asserts _val is T {\n // noop.\n}\n\nfunction getLine(mappings: SourceMapSegment[][], index: number): SourceMapSegment[] {\n for (let i = mappings.length; i <= index; i++) {\n mappings[i] = [];\n }\n return mappings[index];\n}\n\nfunction getColumnIndex(line: SourceMapSegment[], genColumn: number): number {\n let index = line.length;\n for (let i = index - 1; i >= 0; index = i--) {\n const current = line[i];\n if (genColumn >= current[COLUMN]) break;\n }\n return index;\n}\n\nfunction insert(array: T[], index: number, value: T) {\n for (let i = array.length; i > index; i--) {\n array[i] = array[i - 1];\n }\n array[index] = value;\n}\n\nfunction removeEmptyFinalLines(mappings: SourceMapSegment[][]) {\n const { length } = mappings;\n let len = length;\n for (let i = len - 1; i >= 0; len = i, i--) {\n if (mappings[i].length > 0) break;\n }\n if (len < length) mappings.length = len;\n}\n\nfunction putAll(strarr: SetArray, array: string[]) {\n for (let i = 0; i < array.length; i++) put(strarr, array[i]);\n}\n\nfunction skipSourceless(line: SourceMapSegment[], index: number): boolean {\n // The start of a line is already sourceless, so adding a sourceless segment to the beginning\n // doesn't generate any useful information.\n if (index === 0) return true;\n\n const prev = line[index - 1];\n // If the previous segment is also sourceless, then adding another sourceless segment doesn't\n // genrate any new information. Else, this segment will end the source/named segment and point to\n // a sourceless position, which is useful.\n return prev.length === 1;\n}\n\nfunction skipSource(\n line: SourceMapSegment[],\n index: number,\n sourcesIndex: number,\n sourceLine: number,\n sourceColumn: number,\n namesIndex: number,\n): boolean {\n // A source/named segment at the start of a line gives position at that genColumn\n if (index === 0) return false;\n\n const prev = line[index - 1];\n\n // If the previous segment is sourceless, then we're transitioning to a source.\n if (prev.length === 1) return false;\n\n // If the previous segment maps to the exact same source position, then this segment doesn't\n // provide any new position information.\n return (\n sourcesIndex === prev[SOURCES_INDEX] &&\n sourceLine === prev[SOURCE_LINE] &&\n sourceColumn === prev[SOURCE_COLUMN] &&\n namesIndex === (prev.length === 5 ? prev[NAMES_INDEX] : NO_NAME)\n );\n}\n\nfunction addMappingInternal(\n skipable: boolean,\n map: GenMapping,\n mapping: {\n generated: Pos;\n source: S;\n original: S extends string ? Pos : null | undefined;\n name: S extends string ? string | null | undefined : null | undefined;\n content: S extends string ? string | null | undefined : null | undefined;\n },\n) {\n const { generated, source, original, name, content } = mapping;\n if (!source) {\n return addSegmentInternal(\n skipable,\n map,\n generated.line - 1,\n generated.column,\n null,\n null,\n null,\n null,\n null,\n );\n }\n const s: string = source;\n assert(original);\n return addSegmentInternal(\n skipable,\n map,\n generated.line - 1,\n generated.column,\n s,\n original.line - 1,\n original.column,\n name,\n content,\n );\n}\n"],"names":[],"mappings":";;;;AAWO,MAAM,MAAM,GAAG,CAAC,CAAC;AACjB,MAAM,aAAa,GAAG,CAAC,CAAC;AACxB,MAAM,WAAW,GAAG,CAAC,CAAC;AACtB,MAAM,aAAa,GAAG,CAAC,CAAC;AACxB,MAAM,WAAW,GAAG,CAAC;;ACQ5B,MAAM,OAAO,GAAG,CAAC,CAAC,CAAC;AAEnB;;;AAGG;AACQ,IAAA,WA+BT;AAEF;;;AAGG;AACQ,IAAA,WA+BT;AAEF;;;;AAIG;AACQ,IAAA,gBAAmC;AAE9C;;;;AAIG;AACQ,IAAA,gBAAmC;AAE9C;;AAEG;AACQ,IAAA,iBAAoF;AAE/F;;;AAGG;AACQ,IAAA,aAAoD;AAE/D;;;AAGG;AACQ,IAAA,aAAoD;AAE/D;;AAEG;AACQ,IAAA,QAA+C;AAE1D;;;AAGG;AACQ,IAAA,YAA4C;AAEvD;AACA,IAAI,kBAUK,CAAC;AAEV;;AAEG;MACU,UAAU,CAAA;AAQrB,IAAA,WAAA,CAAY,EAAE,IAAI,EAAE,UAAU,KAAc,EAAE,EAAA;AAPtC,QAAA,IAAA,CAAA,MAAM,GAAG,IAAI,QAAQ,EAAE,CAAC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ping.umd.js b/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.umd.js new file mode 100644 index 0000000..d9fcf5c --- /dev/null +++ b/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.umd.js @@ -0,0 +1,236 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@jridgewell/set-array'), require('@jridgewell/sourcemap-codec'), require('@jridgewell/trace-mapping')) : + typeof define === 'function' && define.amd ? define(['exports', '@jridgewell/set-array', '@jridgewell/sourcemap-codec', '@jridgewell/trace-mapping'], factory) : + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.genMapping = {}, global.setArray, global.sourcemapCodec, global.traceMapping)); +})(this, (function (exports, setArray, sourcemapCodec, traceMapping) { 'use strict'; + + const COLUMN = 0; + const SOURCES_INDEX = 1; + const SOURCE_LINE = 2; + const SOURCE_COLUMN = 3; + const NAMES_INDEX = 4; + + const NO_NAME = -1; + /** + * A low-level API to associate a generated position with an original source position. Line and + * column here are 0-based, unlike `addMapping`. + */ + exports.addSegment = void 0; + /** + * A high-level API to associate a generated position with an original source position. Line is + * 1-based, but column is 0-based, due to legacy behavior in `source-map` library. + */ + exports.addMapping = void 0; + /** + * Same as `addSegment`, but will only add the segment if it generates useful information in the + * resulting map. This only works correctly if segments are added **in order**, meaning you should + * not add a segment with a lower generated line/column than one that came before. + */ + exports.maybeAddSegment = void 0; + /** + * Same as `addMapping`, but will only add the mapping if it generates useful information in the + * resulting map. This only works correctly if mappings are added **in order**, meaning you should + * not add a mapping with a lower generated line/column than one that came before. + */ + exports.maybeAddMapping = void 0; + /** + * Adds/removes the content of the source file to the source map. + */ + exports.setSourceContent = void 0; + /** + * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects + * a sourcemap, or to JSON.stringify. + */ + exports.toDecodedMap = void 0; + /** + * Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects + * a sourcemap, or to JSON.stringify. + */ + exports.toEncodedMap = void 0; + /** + * Constructs a new GenMapping, using the already present mappings of the input. + */ + exports.fromMap = void 0; + /** + * Returns an array of high-level mapping objects for every recorded segment, which could then be + * passed to the `source-map` library. + */ + exports.allMappings = void 0; + // This split declaration is only so that terser can elminiate the static initialization block. + let addSegmentInternal; + /** + * Provides the state to generate a sourcemap. + */ + class GenMapping { + constructor({ file, sourceRoot } = {}) { + this._names = new setArray.SetArray(); + this._sources = new setArray.SetArray(); + this._sourcesContent = []; + this._mappings = []; + this.file = file; + this.sourceRoot = sourceRoot; + } + } + (() => { + exports.addSegment = (map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) => { + return addSegmentInternal(false, map, genLine, genColumn, source, sourceLine, sourceColumn, name, content); + }; + exports.maybeAddSegment = (map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) => { + return addSegmentInternal(true, map, genLine, genColumn, source, sourceLine, sourceColumn, name, content); + }; + exports.addMapping = (map, mapping) => { + return addMappingInternal(false, map, mapping); + }; + exports.maybeAddMapping = (map, mapping) => { + return addMappingInternal(true, map, mapping); + }; + exports.setSourceContent = (map, source, content) => { + const { _sources: sources, _sourcesContent: sourcesContent } = map; + sourcesContent[setArray.put(sources, source)] = content; + }; + exports.toDecodedMap = (map) => { + const { file, sourceRoot, _mappings: mappings, _sources: sources, _sourcesContent: sourcesContent, _names: names, } = map; + removeEmptyFinalLines(mappings); + return { + version: 3, + file: file || undefined, + names: names.array, + sourceRoot: sourceRoot || undefined, + sources: sources.array, + sourcesContent, + mappings, + }; + }; + exports.toEncodedMap = (map) => { + const decoded = exports.toDecodedMap(map); + return Object.assign(Object.assign({}, decoded), { mappings: sourcemapCodec.encode(decoded.mappings) }); + }; + exports.allMappings = (map) => { + const out = []; + const { _mappings: mappings, _sources: sources, _names: names } = map; + for (let i = 0; i < mappings.length; i++) { + const line = mappings[i]; + for (let j = 0; j < line.length; j++) { + const seg = line[j]; + const generated = { line: i + 1, column: seg[COLUMN] }; + let source = undefined; + let original = undefined; + let name = undefined; + if (seg.length !== 1) { + source = sources.array[seg[SOURCES_INDEX]]; + original = { line: seg[SOURCE_LINE] + 1, column: seg[SOURCE_COLUMN] }; + if (seg.length === 5) + name = names.array[seg[NAMES_INDEX]]; + } + out.push({ generated, source, original, name }); + } + } + return out; + }; + exports.fromMap = (input) => { + const map = new traceMapping.TraceMap(input); + const gen = new GenMapping({ file: map.file, sourceRoot: map.sourceRoot }); + putAll(gen._names, map.names); + putAll(gen._sources, map.sources); + gen._sourcesContent = map.sourcesContent || map.sources.map(() => null); + gen._mappings = traceMapping.decodedMappings(map); + return gen; + }; + // Internal helpers + addSegmentInternal = (skipable, map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) => { + const { _mappings: mappings, _sources: sources, _sourcesContent: sourcesContent, _names: names, } = map; + const line = getLine(mappings, genLine); + const index = getColumnIndex(line, genColumn); + if (!source) { + if (skipable && skipSourceless(line, index)) + return; + return insert(line, index, [genColumn]); + } + const sourcesIndex = setArray.put(sources, source); + const namesIndex = name ? setArray.put(names, name) : NO_NAME; + if (sourcesIndex === sourcesContent.length) + sourcesContent[sourcesIndex] = content !== null && content !== void 0 ? content : null; + if (skipable && skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex)) { + return; + } + return insert(line, index, name + ? [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex] + : [genColumn, sourcesIndex, sourceLine, sourceColumn]); + }; + })(); + function getLine(mappings, index) { + for (let i = mappings.length; i <= index; i++) { + mappings[i] = []; + } + return mappings[index]; + } + function getColumnIndex(line, genColumn) { + let index = line.length; + for (let i = index - 1; i >= 0; index = i--) { + const current = line[i]; + if (genColumn >= current[COLUMN]) + break; + } + return index; + } + function insert(array, index, value) { + for (let i = array.length; i > index; i--) { + array[i] = array[i - 1]; + } + array[index] = value; + } + function removeEmptyFinalLines(mappings) { + const { length } = mappings; + let len = length; + for (let i = len - 1; i >= 0; len = i, i--) { + if (mappings[i].length > 0) + break; + } + if (len < length) + mappings.length = len; + } + function putAll(strarr, array) { + for (let i = 0; i < array.length; i++) + setArray.put(strarr, array[i]); + } + function skipSourceless(line, index) { + // The start of a line is already sourceless, so adding a sourceless segment to the beginning + // doesn't generate any useful information. + if (index === 0) + return true; + const prev = line[index - 1]; + // If the previous segment is also sourceless, then adding another sourceless segment doesn't + // genrate any new information. Else, this segment will end the source/named segment and point to + // a sourceless position, which is useful. + return prev.length === 1; + } + function skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex) { + // A source/named segment at the start of a line gives position at that genColumn + if (index === 0) + return false; + const prev = line[index - 1]; + // If the previous segment is sourceless, then we're transitioning to a source. + if (prev.length === 1) + return false; + // If the previous segment maps to the exact same source position, then this segment doesn't + // provide any new position information. + return (sourcesIndex === prev[SOURCES_INDEX] && + sourceLine === prev[SOURCE_LINE] && + sourceColumn === prev[SOURCE_COLUMN] && + namesIndex === (prev.length === 5 ? prev[NAMES_INDEX] : NO_NAME)); + } + function addMappingInternal(skipable, map, mapping) { + const { generated, source, original, name, content } = mapping; + if (!source) { + return addSegmentInternal(skipable, map, generated.line - 1, generated.column, null, null, null, null, null); + } + const s = source; + return addSegmentInternal(skipable, map, generated.line - 1, generated.column, s, original.line - 1, original.column, name, content); + } + + exports.GenMapping = GenMapping; + + Object.defineProperty(exports, '__esModule', { value: true }); + +})); +//# sourceMappingURL=gen-mapping.umd.js.map diff --git a/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.umd.js.map b/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.umd.js.map new file mode 100644 index 0000000..7cc8d14 --- /dev/null +++ b/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.umd.js.map @@ -0,0 +1 @@ +{"version":3,"file":"gen-mapping.umd.js","sources":["../src/sourcemap-segment.ts","../src/gen-mapping.ts"],"sourcesContent":["type GeneratedColumn = number;\ntype SourcesIndex = number;\ntype SourceLine = number;\ntype SourceColumn = number;\ntype NamesIndex = number;\n\nexport type SourceMapSegment =\n | [GeneratedColumn]\n | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn]\n | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn, NamesIndex];\n\nexport const COLUMN = 0;\nexport const SOURCES_INDEX = 1;\nexport const SOURCE_LINE = 2;\nexport const SOURCE_COLUMN = 3;\nexport const NAMES_INDEX = 4;\n","import { SetArray, put } from '@jridgewell/set-array';\nimport { encode } from '@jridgewell/sourcemap-codec';\nimport { TraceMap, decodedMappings } from '@jridgewell/trace-mapping';\n\nimport {\n COLUMN,\n SOURCES_INDEX,\n SOURCE_LINE,\n SOURCE_COLUMN,\n NAMES_INDEX,\n} from './sourcemap-segment';\n\nimport type { SourceMapInput } from '@jridgewell/trace-mapping';\nimport type { SourceMapSegment } from './sourcemap-segment';\nimport type { DecodedSourceMap, EncodedSourceMap, Pos, Mapping } from './types';\n\nexport type { DecodedSourceMap, EncodedSourceMap, Mapping };\n\nexport type Options = {\n file?: string | null;\n sourceRoot?: string | null;\n};\n\nconst NO_NAME = -1;\n\n/**\n * A low-level API to associate a generated position with an original source position. Line and\n * column here are 0-based, unlike `addMapping`.\n */\nexport let addSegment: {\n (\n map: GenMapping,\n genLine: number,\n genColumn: number,\n source?: null,\n sourceLine?: null,\n sourceColumn?: null,\n name?: null,\n content?: null,\n ): void;\n (\n map: GenMapping,\n genLine: number,\n genColumn: number,\n source: string,\n sourceLine: number,\n sourceColumn: number,\n name?: null,\n content?: string | null,\n ): void;\n (\n map: GenMapping,\n genLine: number,\n genColumn: number,\n source: string,\n sourceLine: number,\n sourceColumn: number,\n name: string,\n content?: string | null,\n ): void;\n};\n\n/**\n * A high-level API to associate a generated position with an original source position. Line is\n * 1-based, but column is 0-based, due to legacy behavior in `source-map` library.\n */\nexport let addMapping: {\n (\n map: GenMapping,\n mapping: {\n generated: Pos;\n source?: null;\n original?: null;\n name?: null;\n content?: null;\n },\n ): void;\n (\n map: GenMapping,\n mapping: {\n generated: Pos;\n source: string;\n original: Pos;\n name?: null;\n content?: string | null;\n },\n ): void;\n (\n map: GenMapping,\n mapping: {\n generated: Pos;\n source: string;\n original: Pos;\n name: string;\n content?: string | null;\n },\n ): void;\n};\n\n/**\n * Same as `addSegment`, but will only add the segment if it generates useful information in the\n * resulting map. This only works correctly if segments are added **in order**, meaning you should\n * not add a segment with a lower generated line/column than one that came before.\n */\nexport let maybeAddSegment: typeof addSegment;\n\n/**\n * Same as `addMapping`, but will only add the mapping if it generates useful information in the\n * resulting map. This only works correctly if mappings are added **in order**, meaning you should\n * not add a mapping with a lower generated line/column than one that came before.\n */\nexport let maybeAddMapping: typeof addMapping;\n\n/**\n * Adds/removes the content of the source file to the source map.\n */\nexport let setSourceContent: (map: GenMapping, source: string, content: string | null) => void;\n\n/**\n * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects\n * a sourcemap, or to JSON.stringify.\n */\nexport let toDecodedMap: (map: GenMapping) => DecodedSourceMap;\n\n/**\n * Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects\n * a sourcemap, or to JSON.stringify.\n */\nexport let toEncodedMap: (map: GenMapping) => EncodedSourceMap;\n\n/**\n * Constructs a new GenMapping, using the already present mappings of the input.\n */\nexport let fromMap: (input: SourceMapInput) => GenMapping;\n\n/**\n * Returns an array of high-level mapping objects for every recorded segment, which could then be\n * passed to the `source-map` library.\n */\nexport let allMappings: (map: GenMapping) => Mapping[];\n\n// This split declaration is only so that terser can elminiate the static initialization block.\nlet addSegmentInternal: (\n skipable: boolean,\n map: GenMapping,\n genLine: number,\n genColumn: number,\n source: S,\n sourceLine: S extends string ? number : null | undefined,\n sourceColumn: S extends string ? number : null | undefined,\n name: S extends string ? string | null | undefined : null | undefined,\n content: S extends string ? string | null | undefined : null | undefined,\n) => void;\n\n/**\n * Provides the state to generate a sourcemap.\n */\nexport class GenMapping {\n private _names = new SetArray();\n private _sources = new SetArray();\n private _sourcesContent: (string | null)[] = [];\n private _mappings: SourceMapSegment[][] = [];\n declare file: string | null | undefined;\n declare sourceRoot: string | null | undefined;\n\n constructor({ file, sourceRoot }: Options = {}) {\n this.file = file;\n this.sourceRoot = sourceRoot;\n }\n\n static {\n addSegment = (map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) => {\n return addSegmentInternal(\n false,\n map,\n genLine,\n genColumn,\n source,\n sourceLine,\n sourceColumn,\n name,\n content,\n );\n };\n\n maybeAddSegment = (\n map,\n genLine,\n genColumn,\n source,\n sourceLine,\n sourceColumn,\n name,\n content,\n ) => {\n return addSegmentInternal(\n true,\n map,\n genLine,\n genColumn,\n source,\n sourceLine,\n sourceColumn,\n name,\n content,\n );\n };\n\n addMapping = (map, mapping) => {\n return addMappingInternal(false, map, mapping as Parameters[2]);\n };\n\n maybeAddMapping = (map, mapping) => {\n return addMappingInternal(true, map, mapping as Parameters[2]);\n };\n\n setSourceContent = (map, source, content) => {\n const { _sources: sources, _sourcesContent: sourcesContent } = map;\n sourcesContent[put(sources, source)] = content;\n };\n\n toDecodedMap = (map) => {\n const {\n file,\n sourceRoot,\n _mappings: mappings,\n _sources: sources,\n _sourcesContent: sourcesContent,\n _names: names,\n } = map;\n removeEmptyFinalLines(mappings);\n\n return {\n version: 3,\n file: file || undefined,\n names: names.array,\n sourceRoot: sourceRoot || undefined,\n sources: sources.array,\n sourcesContent,\n mappings,\n };\n };\n\n toEncodedMap = (map) => {\n const decoded = toDecodedMap(map);\n return {\n ...decoded,\n mappings: encode(decoded.mappings as SourceMapSegment[][]),\n };\n };\n\n allMappings = (map) => {\n const out: Mapping[] = [];\n const { _mappings: mappings, _sources: sources, _names: names } = map;\n\n for (let i = 0; i < mappings.length; i++) {\n const line = mappings[i];\n for (let j = 0; j < line.length; j++) {\n const seg = line[j];\n\n const generated = { line: i + 1, column: seg[COLUMN] };\n let source: string | undefined = undefined;\n let original: Pos | undefined = undefined;\n let name: string | undefined = undefined;\n\n if (seg.length !== 1) {\n source = sources.array[seg[SOURCES_INDEX]];\n original = { line: seg[SOURCE_LINE] + 1, column: seg[SOURCE_COLUMN] };\n\n if (seg.length === 5) name = names.array[seg[NAMES_INDEX]];\n }\n\n out.push({ generated, source, original, name } as Mapping);\n }\n }\n\n return out;\n };\n\n fromMap = (input) => {\n const map = new TraceMap(input);\n const gen = new GenMapping({ file: map.file, sourceRoot: map.sourceRoot });\n\n putAll(gen._names, map.names);\n putAll(gen._sources, map.sources as string[]);\n gen._sourcesContent = map.sourcesContent || map.sources.map(() => null);\n gen._mappings = decodedMappings(map) as GenMapping['_mappings'];\n\n return gen;\n };\n\n // Internal helpers\n addSegmentInternal = (\n skipable,\n map,\n genLine,\n genColumn,\n source,\n sourceLine,\n sourceColumn,\n name,\n content,\n ) => {\n const {\n _mappings: mappings,\n _sources: sources,\n _sourcesContent: sourcesContent,\n _names: names,\n } = map;\n const line = getLine(mappings, genLine);\n const index = getColumnIndex(line, genColumn);\n\n if (!source) {\n if (skipable && skipSourceless(line, index)) return;\n return insert(line, index, [genColumn]);\n }\n\n // Sigh, TypeScript can't figure out sourceLine and sourceColumn aren't nullish if source\n // isn't nullish.\n assert(sourceLine);\n assert(sourceColumn);\n\n const sourcesIndex = put(sources, source);\n const namesIndex = name ? put(names, name) : NO_NAME;\n if (sourcesIndex === sourcesContent.length) sourcesContent[sourcesIndex] = content ?? null;\n\n if (skipable && skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex)) {\n return;\n }\n\n return insert(\n line,\n index,\n name\n ? [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex]\n : [genColumn, sourcesIndex, sourceLine, sourceColumn],\n );\n };\n }\n}\n\nfunction assert(_val: unknown): asserts _val is T {\n // noop.\n}\n\nfunction getLine(mappings: SourceMapSegment[][], index: number): SourceMapSegment[] {\n for (let i = mappings.length; i <= index; i++) {\n mappings[i] = [];\n }\n return mappings[index];\n}\n\nfunction getColumnIndex(line: SourceMapSegment[], genColumn: number): number {\n let index = line.length;\n for (let i = index - 1; i >= 0; index = i--) {\n const current = line[i];\n if (genColumn >= current[COLUMN]) break;\n }\n return index;\n}\n\nfunction insert(array: T[], index: number, value: T) {\n for (let i = array.length; i > index; i--) {\n array[i] = array[i - 1];\n }\n array[index] = value;\n}\n\nfunction removeEmptyFinalLines(mappings: SourceMapSegment[][]) {\n const { length } = mappings;\n let len = length;\n for (let i = len - 1; i >= 0; len = i, i--) {\n if (mappings[i].length > 0) break;\n }\n if (len < length) mappings.length = len;\n}\n\nfunction putAll(strarr: SetArray, array: string[]) {\n for (let i = 0; i < array.length; i++) put(strarr, array[i]);\n}\n\nfunction skipSourceless(line: SourceMapSegment[], index: number): boolean {\n // The start of a line is already sourceless, so adding a sourceless segment to the beginning\n // doesn't generate any useful information.\n if (index === 0) return true;\n\n const prev = line[index - 1];\n // If the previous segment is also sourceless, then adding another sourceless segment doesn't\n // genrate any new information. Else, this segment will end the source/named segment and point to\n // a sourceless position, which is useful.\n return prev.length === 1;\n}\n\nfunction skipSource(\n line: SourceMapSegment[],\n index: number,\n sourcesIndex: number,\n sourceLine: number,\n sourceColumn: number,\n namesIndex: number,\n): boolean {\n // A source/named segment at the start of a line gives position at that genColumn\n if (index === 0) return false;\n\n const prev = line[index - 1];\n\n // If the previous segment is sourceless, then we're transitioning to a source.\n if (prev.length === 1) return false;\n\n // If the previous segment maps to the exact same source position, then this segment doesn't\n // provide any new position information.\n return (\n sourcesIndex === prev[SOURCES_INDEX] &&\n sourceLine === prev[SOURCE_LINE] &&\n sourceColumn === prev[SOURCE_COLUMN] &&\n namesIndex === (prev.length === 5 ? prev[NAMES_INDEX] : NO_NAME)\n );\n}\n\nfunction addMappingInternal(\n skipable: boolean,\n map: GenMapping,\n mapping: {\n generated: Pos;\n source: S;\n original: S extends string ? Pos : null | undefined;\n name: S extends string ? string | null | undefined : null | undefined;\n content: S extends string ? string | null | undefined : null | undefined;\n },\n) {\n const { generated, source, original, name, content } = mapping;\n if (!source) {\n return addSegmentInternal(\n skipable,\n map,\n generated.line - 1,\n generated.column,\n null,\n null,\n null,\n null,\n null,\n );\n }\n const s: string = source;\n assert(original);\n return addSegmentInternal(\n skipable,\n map,\n generated.line - 1,\n generated.column,\n s,\n original.line - 1,\n original.column,\n name,\n content,\n );\n}\n"],"names":["addSegment","addMapping","maybeAddSegment","maybeAddMapping","setSourceContent","toDecodedMap","toEncodedMap","fromMap","allMappings","SetArray","put","encode","TraceMap","decodedMappings"],"mappings":";;;;;;IAWO,MAAM,MAAM,GAAG,CAAC,CAAC;IACjB,MAAM,aAAa,GAAG,CAAC,CAAC;IACxB,MAAM,WAAW,GAAG,CAAC,CAAC;IACtB,MAAM,aAAa,GAAG,CAAC,CAAC;IACxB,MAAM,WAAW,GAAG,CAAC;;ICQ5B,MAAM,OAAO,GAAG,CAAC,CAAC,CAAC;IAEnB;;;IAGG;AACQA,gCA+BT;IAEF;;;IAGG;AACQC,gCA+BT;IAEF;;;;IAIG;AACQC,qCAAmC;IAE9C;;;;IAIG;AACQC,qCAAmC;IAE9C;;IAEG;AACQC,sCAAoF;IAE/F;;;IAGG;AACQC,kCAAoD;IAE/D;;;IAGG;AACQC,kCAAoD;IAE/D;;IAEG;AACQC,6BAA+C;IAE1D;;;IAGG;AACQC,iCAA4C;IAEvD;IACA,IAAI,kBAUK,CAAC;IAEV;;IAEG;UACU,UAAU,CAAA;IAQrB,IAAA,WAAA,CAAY,EAAE,IAAI,EAAE,UAAU,KAAc,EAAE,EAAA;IAPtC,QAAA,IAAA,CAAA,MAAM,GAAG,IAAIC,iBAAQ,EAAE,CAAC;IACxB,QAAA,IAAA,CAAA,QAAQ,GAAG,IAAIA,iBAAQ,EAAE,CAAC;YAC1B,IAAe,CAAA,eAAA,GAAsB,EAAE,CAAC;YACxC,IAAS,CAAA,SAAA,GAAyB,EAAE,CAAC;IAK3C,QAAA,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACjB,QAAA,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;SAC9B;IA2KF,CAAA;IAzKC,CAAA,MAAA;IACE,IAAAT,kBAAU,GAAG,CAAC,GAAG,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,YAAY,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,UAAU,KAAK,IAAI,CAAC,WAAW,CAAC;IAChC,QAAA,YAAY,KAAK,IAAI,CAAC,aAAa,CAAC;YACpC,UAAU,MAAM,IAAI,CAAC,MAAM,KAAK,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,OAAO,CAAC,EAChE;IACJ,CAAC;IAED,SAAS,kBAAkB,CACzB,QAAiB,EACjB,GAAe,EACf,OAMC,EAAA;IAED,IAAA,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;QAC/D,IAAI,CAAC,MAAM,EAAE;YACX,OAAO,kBAAkB,CACvB,QAAQ,EACR,GAAG,EACH,SAAS,CAAC,IAAI,GAAG,CAAC,EAClB,SAAS,CAAC,MAAM,EAChB,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,CACL,CAAC;IACH,KAAA;QACD,MAAM,CAAC,GAAW,MAAM,CAAC;IAEzB,IAAA,OAAO,kBAAkB,CACvB,QAAQ,EACR,GAAG,EACH,SAAS,CAAC,IAAI,GAAG,CAAC,EAClB,SAAS,CAAC,MAAM,EAChB,CAAC,EACD,QAAQ,CAAC,IAAI,GAAG,CAAC,EACjB,QAAQ,CAAC,MAAM,EACf,IAAI,EACJ,OAAO,CACR,CAAC;IACJ;;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/@jridgewell/gen-mapping/dist/types/gen-mapping.d.ts b/node_modules/@jridgewell/gen-mapping/dist/types/gen-mapping.d.ts new file mode 100644 index 0000000..d510d74 --- /dev/null +++ b/node_modules/@jridgewell/gen-mapping/dist/types/gen-mapping.d.ts @@ -0,0 +1,90 @@ +import type { SourceMapInput } from '@jridgewell/trace-mapping'; +import type { DecodedSourceMap, EncodedSourceMap, Pos, Mapping } from './types'; +export type { DecodedSourceMap, EncodedSourceMap, Mapping }; +export declare type Options = { + file?: string | null; + sourceRoot?: string | null; +}; +/** + * A low-level API to associate a generated position with an original source position. Line and + * column here are 0-based, unlike `addMapping`. + */ +export declare let addSegment: { + (map: GenMapping, genLine: number, genColumn: number, source?: null, sourceLine?: null, sourceColumn?: null, name?: null, content?: null): void; + (map: GenMapping, genLine: number, genColumn: number, source: string, sourceLine: number, sourceColumn: number, name?: null, content?: string | null): void; + (map: GenMapping, genLine: number, genColumn: number, source: string, sourceLine: number, sourceColumn: number, name: string, content?: string | null): void; +}; +/** + * A high-level API to associate a generated position with an original source position. Line is + * 1-based, but column is 0-based, due to legacy behavior in `source-map` library. + */ +export declare let addMapping: { + (map: GenMapping, mapping: { + generated: Pos; + source?: null; + original?: null; + name?: null; + content?: null; + }): void; + (map: GenMapping, mapping: { + generated: Pos; + source: string; + original: Pos; + name?: null; + content?: string | null; + }): void; + (map: GenMapping, mapping: { + generated: Pos; + source: string; + original: Pos; + name: string; + content?: string | null; + }): void; +}; +/** + * Same as `addSegment`, but will only add the segment if it generates useful information in the + * resulting map. This only works correctly if segments are added **in order**, meaning you should + * not add a segment with a lower generated line/column than one that came before. + */ +export declare let maybeAddSegment: typeof addSegment; +/** + * Same as `addMapping`, but will only add the mapping if it generates useful information in the + * resulting map. This only works correctly if mappings are added **in order**, meaning you should + * not add a mapping with a lower generated line/column than one that came before. + */ +export declare let maybeAddMapping: typeof addMapping; +/** + * Adds/removes the content of the source file to the source map. + */ +export declare let setSourceContent: (map: GenMapping, source: string, content: string | null) => void; +/** + * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects + * a sourcemap, or to JSON.stringify. + */ +export declare let toDecodedMap: (map: GenMapping) => DecodedSourceMap; +/** + * Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects + * a sourcemap, or to JSON.stringify. + */ +export declare let toEncodedMap: (map: GenMapping) => EncodedSourceMap; +/** + * Constructs a new GenMapping, using the already present mappings of the input. + */ +export declare let fromMap: (input: SourceMapInput) => GenMapping; +/** + * Returns an array of high-level mapping objects for every recorded segment, which could then be + * passed to the `source-map` library. + */ +export declare let allMappings: (map: GenMapping) => Mapping[]; +/** + * Provides the state to generate a sourcemap. + */ +export declare class GenMapping { + private _names; + private _sources; + private _sourcesContent; + private _mappings; + file: string | null | undefined; + sourceRoot: string | null | undefined; + constructor({ file, sourceRoot }?: Options); +} diff --git a/node_modules/@jridgewell/gen-mapping/dist/types/sourcemap-segment.d.ts b/node_modules/@jridgewell/gen-mapping/dist/types/sourcemap-segment.d.ts new file mode 100644 index 0000000..e187ba9 --- /dev/null +++ b/node_modules/@jridgewell/gen-mapping/dist/types/sourcemap-segment.d.ts @@ -0,0 +1,12 @@ +declare type GeneratedColumn = number; +declare type SourcesIndex = number; +declare type SourceLine = number; +declare type SourceColumn = number; +declare type NamesIndex = number; +export declare type SourceMapSegment = [GeneratedColumn] | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn] | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn, NamesIndex]; +export declare const COLUMN = 0; +export declare const SOURCES_INDEX = 1; +export declare const SOURCE_LINE = 2; +export declare const SOURCE_COLUMN = 3; +export declare const NAMES_INDEX = 4; +export {}; diff --git a/node_modules/@jridgewell/gen-mapping/dist/types/types.d.ts b/node_modules/@jridgewell/gen-mapping/dist/types/types.d.ts new file mode 100644 index 0000000..b309c81 --- /dev/null +++ b/node_modules/@jridgewell/gen-mapping/dist/types/types.d.ts @@ -0,0 +1,35 @@ +import type { SourceMapSegment } from './sourcemap-segment'; +export interface SourceMapV3 { + file?: string | null; + names: readonly string[]; + sourceRoot?: string; + sources: readonly (string | null)[]; + sourcesContent?: readonly (string | null)[]; + version: 3; +} +export interface EncodedSourceMap extends SourceMapV3 { + mappings: string; +} +export interface DecodedSourceMap extends SourceMapV3 { + mappings: readonly SourceMapSegment[][]; +} +export interface Pos { + line: number; + column: number; +} +export declare type Mapping = { + generated: Pos; + source: undefined; + original: undefined; + name: undefined; +} | { + generated: Pos; + source: string; + original: Pos; + name: string; +} | { + generated: Pos; + source: string; + original: Pos; + name: undefined; +}; diff --git a/node_modules/@jridgewell/gen-mapping/package.json b/node_modules/@jridgewell/gen-mapping/package.json new file mode 100644 index 0000000..69e0ac8 --- /dev/null +++ b/node_modules/@jridgewell/gen-mapping/package.json @@ -0,0 +1,77 @@ +{ + "name": "@jridgewell/gen-mapping", + "version": "0.3.3", + "description": "Generate source maps", + "keywords": [ + "source", + "map" + ], + "author": "Justin Ridgewell ", + "license": "MIT", + "repository": "https://github.com/jridgewell/gen-mapping", + "main": "dist/gen-mapping.umd.js", + "module": "dist/gen-mapping.mjs", + "types": "dist/types/gen-mapping.d.ts", + "exports": { + ".": [ + { + "types": "./dist/types/gen-mapping.d.ts", + "browser": "./dist/gen-mapping.umd.js", + "require": "./dist/gen-mapping.umd.js", + "import": "./dist/gen-mapping.mjs" + }, + "./dist/gen-mapping.umd.js" + ], + "./package.json": "./package.json" + }, + "files": [ + "dist" + ], + "engines": { + "node": ">=6.0.0" + }, + "scripts": { + "benchmark": "run-s build:rollup benchmark:*", + "benchmark:install": "cd benchmark && npm install", + "benchmark:only": "node benchmark/index.mjs", + "prebuild": "rm -rf dist", + "build": "run-s -n build:*", + "build:rollup": "rollup -c rollup.config.js", + "build:ts": "tsc --project tsconfig.build.json", + "lint": "run-s -n lint:*", + "lint:prettier": "npm run test:lint:prettier -- --write", + "lint:ts": "npm run test:lint:ts -- --fix", + "pretest": "run-s build:rollup", + "test": "run-s -n test:lint test:coverage", + "test:debug": "mocha --inspect-brk", + "test:lint": "run-s -n test:lint:*", + "test:lint:prettier": "prettier --check '{src,test}/**/*.ts'", + "test:lint:ts": "eslint '{src,test}/**/*.ts'", + "test:only": "mocha", + "test:coverage": "c8 mocha", + "test:watch": "run-p 'build:rollup -- --watch' 'test:only -- --watch'", + "prepublishOnly": "npm run preversion", + "preversion": "run-s test build" + }, + "devDependencies": { + "@rollup/plugin-typescript": "8.3.2", + "@types/mocha": "9.1.1", + "@types/node": "17.0.29", + "@typescript-eslint/eslint-plugin": "5.21.0", + "@typescript-eslint/parser": "5.21.0", + "benchmark": "2.1.4", + "c8": "7.11.2", + "eslint": "8.14.0", + "eslint-config-prettier": "8.5.0", + "mocha": "9.2.2", + "npm-run-all": "4.1.5", + "prettier": "2.6.2", + "rollup": "2.70.2", + "typescript": "4.6.3" + }, + "dependencies": { + "@jridgewell/set-array": "^1.0.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.9" + } +} diff --git a/node_modules/@jridgewell/resolve-uri/LICENSE b/node_modules/@jridgewell/resolve-uri/LICENSE new file mode 100644 index 0000000..0a81b2a --- /dev/null +++ b/node_modules/@jridgewell/resolve-uri/LICENSE @@ -0,0 +1,19 @@ +Copyright 2019 Justin Ridgewell + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/node_modules/@jridgewell/resolve-uri/README.md b/node_modules/@jridgewell/resolve-uri/README.md new file mode 100644 index 0000000..2fe70df --- /dev/null +++ b/node_modules/@jridgewell/resolve-uri/README.md @@ -0,0 +1,40 @@ +# @jridgewell/resolve-uri + +> Resolve a URI relative to an optional base URI + +Resolve any combination of absolute URIs, protocol-realtive URIs, absolute paths, or relative paths. + +## Installation + +```sh +npm install @jridgewell/resolve-uri +``` + +## Usage + +```typescript +function resolve(input: string, base?: string): string; +``` + +```js +import resolve from '@jridgewell/resolve-uri'; + +resolve('foo', 'https://example.com'); // => 'https://example.com/foo' +``` + +| Input | Base | Resolution | Explanation | +|-----------------------|-------------------------|--------------------------------|--------------------------------------------------------------| +| `https://example.com` | _any_ | `https://example.com/` | Input is normalized only | +| `//example.com` | `https://base.com/` | `https://example.com/` | Input inherits the base's protocol | +| `//example.com` | _rest_ | `//example.com/` | Input is normalized only | +| `/example` | `https://base.com/` | `https://base.com/example` | Input inherits the base's origin | +| `/example` | `//base.com/` | `//base.com/example` | Input inherits the base's host and remains protocol relative | +| `/example` | _rest_ | `/example` | Input is normalized only | +| `example` | `https://base.com/dir/` | `https://base.com/dir/example` | Input is joined with the base | +| `example` | `https://base.com/file` | `https://base.com/example` | Input is joined with the base without its file | +| `example` | `//base.com/dir/` | `//base.com/dir/example` | Input is joined with the base's last directory | +| `example` | `//base.com/file` | `//base.com/example` | Input is joined with the base without its file | +| `example` | `/base/dir/` | `/base/dir/example` | Input is joined with the base's last directory | +| `example` | `/base/file` | `/base/example` | Input is joined with the base without its file | +| `example` | `base/dir/` | `base/dir/example` | Input is joined with the base's last directory | +| `example` | `base/file` | `base/example` | Input is joined with the base without its file | diff --git a/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs b/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs new file mode 100644 index 0000000..94d8dce --- /dev/null +++ b/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs @@ -0,0 +1,242 @@ +// Matches the scheme of a URL, eg "http://" +const schemeRegex = /^[\w+.-]+:\/\//; +/** + * Matches the parts of a URL: + * 1. Scheme, including ":", guaranteed. + * 2. User/password, including "@", optional. + * 3. Host, guaranteed. + * 4. Port, including ":", optional. + * 5. Path, including "/", optional. + * 6. Query, including "?", optional. + * 7. Hash, including "#", optional. + */ +const urlRegex = /^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?(\?[^#]*)?(#.*)?/; +/** + * File URLs are weird. They dont' need the regular `//` in the scheme, they may or may not start + * with a leading `/`, they can have a domain (but only if they don't start with a Windows drive). + * + * 1. Host, optional. + * 2. Path, which may include "/", guaranteed. + * 3. Query, including "?", optional. + * 4. Hash, including "#", optional. + */ +const fileRegex = /^file:(?:\/\/((?![a-z]:)[^/#?]*)?)?(\/?[^#?]*)(\?[^#]*)?(#.*)?/i; +var UrlType; +(function (UrlType) { + UrlType[UrlType["Empty"] = 1] = "Empty"; + UrlType[UrlType["Hash"] = 2] = "Hash"; + UrlType[UrlType["Query"] = 3] = "Query"; + UrlType[UrlType["RelativePath"] = 4] = "RelativePath"; + UrlType[UrlType["AbsolutePath"] = 5] = "AbsolutePath"; + UrlType[UrlType["SchemeRelative"] = 6] = "SchemeRelative"; + UrlType[UrlType["Absolute"] = 7] = "Absolute"; +})(UrlType || (UrlType = {})); +function isAbsoluteUrl(input) { + return schemeRegex.test(input); +} +function isSchemeRelativeUrl(input) { + return input.startsWith('//'); +} +function isAbsolutePath(input) { + return input.startsWith('/'); +} +function isFileUrl(input) { + return input.startsWith('file:'); +} +function isRelative(input) { + return /^[.?#]/.test(input); +} +function parseAbsoluteUrl(input) { + const match = urlRegex.exec(input); + return makeUrl(match[1], match[2] || '', match[3], match[4] || '', match[5] || '/', match[6] || '', match[7] || ''); +} +function parseFileUrl(input) { + const match = fileRegex.exec(input); + const path = match[2]; + return makeUrl('file:', '', match[1] || '', '', isAbsolutePath(path) ? path : '/' + path, match[3] || '', match[4] || ''); +} +function makeUrl(scheme, user, host, port, path, query, hash) { + return { + scheme, + user, + host, + port, + path, + query, + hash, + type: UrlType.Absolute, + }; +} +function parseUrl(input) { + if (isSchemeRelativeUrl(input)) { + const url = parseAbsoluteUrl('http:' + input); + url.scheme = ''; + url.type = UrlType.SchemeRelative; + return url; + } + if (isAbsolutePath(input)) { + const url = parseAbsoluteUrl('http://foo.com' + input); + url.scheme = ''; + url.host = ''; + url.type = UrlType.AbsolutePath; + return url; + } + if (isFileUrl(input)) + return parseFileUrl(input); + if (isAbsoluteUrl(input)) + return parseAbsoluteUrl(input); + const url = parseAbsoluteUrl('http://foo.com/' + input); + url.scheme = ''; + url.host = ''; + url.type = input + ? input.startsWith('?') + ? UrlType.Query + : input.startsWith('#') + ? UrlType.Hash + : UrlType.RelativePath + : UrlType.Empty; + return url; +} +function stripPathFilename(path) { + // If a path ends with a parent directory "..", then it's a relative path with excess parent + // paths. It's not a file, so we can't strip it. + if (path.endsWith('/..')) + return path; + const index = path.lastIndexOf('/'); + return path.slice(0, index + 1); +} +function mergePaths(url, base) { + normalizePath(base, base.type); + // If the path is just a "/", then it was an empty path to begin with (remember, we're a relative + // path). + if (url.path === '/') { + url.path = base.path; + } + else { + // Resolution happens relative to the base path's directory, not the file. + url.path = stripPathFilename(base.path) + url.path; + } +} +/** + * The path can have empty directories "//", unneeded parents "foo/..", or current directory + * "foo/.". We need to normalize to a standard representation. + */ +function normalizePath(url, type) { + const rel = type <= UrlType.RelativePath; + const pieces = url.path.split('/'); + // We need to preserve the first piece always, so that we output a leading slash. The item at + // pieces[0] is an empty string. + let pointer = 1; + // Positive is the number of real directories we've output, used for popping a parent directory. + // Eg, "foo/bar/.." will have a positive 2, and we can decrement to be left with just "foo". + let positive = 0; + // We need to keep a trailing slash if we encounter an empty directory (eg, splitting "foo/" will + // generate `["foo", ""]` pieces). And, if we pop a parent directory. But once we encounter a + // real directory, we won't need to append, unless the other conditions happen again. + let addTrailingSlash = false; + for (let i = 1; i < pieces.length; i++) { + const piece = pieces[i]; + // An empty directory, could be a trailing slash, or just a double "//" in the path. + if (!piece) { + addTrailingSlash = true; + continue; + } + // If we encounter a real directory, then we don't need to append anymore. + addTrailingSlash = false; + // A current directory, which we can always drop. + if (piece === '.') + continue; + // A parent directory, we need to see if there are any real directories we can pop. Else, we + // have an excess of parents, and we'll need to keep the "..". + if (piece === '..') { + if (positive) { + addTrailingSlash = true; + positive--; + pointer--; + } + else if (rel) { + // If we're in a relativePath, then we need to keep the excess parents. Else, in an absolute + // URL, protocol relative URL, or an absolute path, we don't need to keep excess. + pieces[pointer++] = piece; + } + continue; + } + // We've encountered a real directory. Move it to the next insertion pointer, which accounts for + // any popped or dropped directories. + pieces[pointer++] = piece; + positive++; + } + let path = ''; + for (let i = 1; i < pointer; i++) { + path += '/' + pieces[i]; + } + if (!path || (addTrailingSlash && !path.endsWith('/..'))) { + path += '/'; + } + url.path = path; +} +/** + * Attempts to resolve `input` URL/path relative to `base`. + */ +function resolve(input, base) { + if (!input && !base) + return ''; + const url = parseUrl(input); + let inputType = url.type; + if (base && inputType !== UrlType.Absolute) { + const baseUrl = parseUrl(base); + const baseType = baseUrl.type; + switch (inputType) { + case UrlType.Empty: + url.hash = baseUrl.hash; + // fall through + case UrlType.Hash: + url.query = baseUrl.query; + // fall through + case UrlType.Query: + case UrlType.RelativePath: + mergePaths(url, baseUrl); + // fall through + case UrlType.AbsolutePath: + // The host, user, and port are joined, you can't copy one without the others. + url.user = baseUrl.user; + url.host = baseUrl.host; + url.port = baseUrl.port; + // fall through + case UrlType.SchemeRelative: + // The input doesn't have a schema at least, so we need to copy at least that over. + url.scheme = baseUrl.scheme; + } + if (baseType > inputType) + inputType = baseType; + } + normalizePath(url, inputType); + const queryHash = url.query + url.hash; + switch (inputType) { + // This is impossible, because of the empty checks at the start of the function. + // case UrlType.Empty: + case UrlType.Hash: + case UrlType.Query: + return queryHash; + case UrlType.RelativePath: { + // The first char is always a "/", and we need it to be relative. + const path = url.path.slice(1); + if (!path) + return queryHash || '.'; + if (isRelative(base || input) && !isRelative(path)) { + // If base started with a leading ".", or there is no base and input started with a ".", + // then we need to ensure that the relative path starts with a ".". We don't know if + // relative starts with a "..", though, so check before prepending. + return './' + path + queryHash; + } + return path + queryHash; + } + case UrlType.AbsolutePath: + return url.path + queryHash; + default: + return url.scheme + '//' + url.user + url.host + url.port + url.path + queryHash; + } +} + +export { resolve as default }; +//# sourceMappingURL=resolve-uri.mjs.map diff --git a/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs.map b/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs.map new file mode 100644 index 0000000..009d043 --- /dev/null +++ b/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"resolve-uri.mjs","sources":["../src/resolve-uri.ts"],"sourcesContent":["// Matches the scheme of a URL, eg \"http://\"\nconst schemeRegex = /^[\\w+.-]+:\\/\\//;\n\n/**\n * Matches the parts of a URL:\n * 1. Scheme, including \":\", guaranteed.\n * 2. User/password, including \"@\", optional.\n * 3. Host, guaranteed.\n * 4. Port, including \":\", optional.\n * 5. Path, including \"/\", optional.\n * 6. Query, including \"?\", optional.\n * 7. Hash, including \"#\", optional.\n */\nconst urlRegex = /^([\\w+.-]+:)\\/\\/([^@/#?]*@)?([^:/#?]*)(:\\d+)?(\\/[^#?]*)?(\\?[^#]*)?(#.*)?/;\n\n/**\n * File URLs are weird. They dont' need the regular `//` in the scheme, they may or may not start\n * with a leading `/`, they can have a domain (but only if they don't start with a Windows drive).\n *\n * 1. Host, optional.\n * 2. Path, which may include \"/\", guaranteed.\n * 3. Query, including \"?\", optional.\n * 4. Hash, including \"#\", optional.\n */\nconst fileRegex = /^file:(?:\\/\\/((?![a-z]:)[^/#?]*)?)?(\\/?[^#?]*)(\\?[^#]*)?(#.*)?/i;\n\ntype Url = {\n scheme: string;\n user: string;\n host: string;\n port: string;\n path: string;\n query: string;\n hash: string;\n type: UrlType;\n};\n\nenum UrlType {\n Empty = 1,\n Hash = 2,\n Query = 3,\n RelativePath = 4,\n AbsolutePath = 5,\n SchemeRelative = 6,\n Absolute = 7,\n}\n\nfunction isAbsoluteUrl(input: string): boolean {\n return schemeRegex.test(input);\n}\n\nfunction isSchemeRelativeUrl(input: string): boolean {\n return input.startsWith('//');\n}\n\nfunction isAbsolutePath(input: string): boolean {\n return input.startsWith('/');\n}\n\nfunction isFileUrl(input: string): boolean {\n return input.startsWith('file:');\n}\n\nfunction isRelative(input: string): boolean {\n return /^[.?#]/.test(input);\n}\n\nfunction parseAbsoluteUrl(input: string): Url {\n const match = urlRegex.exec(input)!;\n return makeUrl(\n match[1],\n match[2] || '',\n match[3],\n match[4] || '',\n match[5] || '/',\n match[6] || '',\n match[7] || '',\n );\n}\n\nfunction parseFileUrl(input: string): Url {\n const match = fileRegex.exec(input)!;\n const path = match[2];\n return makeUrl(\n 'file:',\n '',\n match[1] || '',\n '',\n isAbsolutePath(path) ? path : '/' + path,\n match[3] || '',\n match[4] || '',\n );\n}\n\nfunction makeUrl(\n scheme: string,\n user: string,\n host: string,\n port: string,\n path: string,\n query: string,\n hash: string,\n): Url {\n return {\n scheme,\n user,\n host,\n port,\n path,\n query,\n hash,\n type: UrlType.Absolute,\n };\n}\n\nfunction parseUrl(input: string): Url {\n if (isSchemeRelativeUrl(input)) {\n const url = parseAbsoluteUrl('http:' + input);\n url.scheme = '';\n url.type = UrlType.SchemeRelative;\n return url;\n }\n\n if (isAbsolutePath(input)) {\n const url = parseAbsoluteUrl('http://foo.com' + input);\n url.scheme = '';\n url.host = '';\n url.type = UrlType.AbsolutePath;\n return url;\n }\n\n if (isFileUrl(input)) return parseFileUrl(input);\n\n if (isAbsoluteUrl(input)) return parseAbsoluteUrl(input);\n\n const url = parseAbsoluteUrl('http://foo.com/' + input);\n url.scheme = '';\n url.host = '';\n url.type = input\n ? input.startsWith('?')\n ? UrlType.Query\n : input.startsWith('#')\n ? UrlType.Hash\n : UrlType.RelativePath\n : UrlType.Empty;\n return url;\n}\n\nfunction stripPathFilename(path: string): string {\n // If a path ends with a parent directory \"..\", then it's a relative path with excess parent\n // paths. It's not a file, so we can't strip it.\n if (path.endsWith('/..')) return path;\n const index = path.lastIndexOf('/');\n return path.slice(0, index + 1);\n}\n\nfunction mergePaths(url: Url, base: Url) {\n normalizePath(base, base.type);\n\n // If the path is just a \"/\", then it was an empty path to begin with (remember, we're a relative\n // path).\n if (url.path === '/') {\n url.path = base.path;\n } else {\n // Resolution happens relative to the base path's directory, not the file.\n url.path = stripPathFilename(base.path) + url.path;\n }\n}\n\n/**\n * The path can have empty directories \"//\", unneeded parents \"foo/..\", or current directory\n * \"foo/.\". We need to normalize to a standard representation.\n */\nfunction normalizePath(url: Url, type: UrlType) {\n const rel = type <= UrlType.RelativePath;\n const pieces = url.path.split('/');\n\n // We need to preserve the first piece always, so that we output a leading slash. The item at\n // pieces[0] is an empty string.\n let pointer = 1;\n\n // Positive is the number of real directories we've output, used for popping a parent directory.\n // Eg, \"foo/bar/..\" will have a positive 2, and we can decrement to be left with just \"foo\".\n let positive = 0;\n\n // We need to keep a trailing slash if we encounter an empty directory (eg, splitting \"foo/\" will\n // generate `[\"foo\", \"\"]` pieces). And, if we pop a parent directory. But once we encounter a\n // real directory, we won't need to append, unless the other conditions happen again.\n let addTrailingSlash = false;\n\n for (let i = 1; i < pieces.length; i++) {\n const piece = pieces[i];\n\n // An empty directory, could be a trailing slash, or just a double \"//\" in the path.\n if (!piece) {\n addTrailingSlash = true;\n continue;\n }\n\n // If we encounter a real directory, then we don't need to append anymore.\n addTrailingSlash = false;\n\n // A current directory, which we can always drop.\n if (piece === '.') continue;\n\n // A parent directory, we need to see if there are any real directories we can pop. Else, we\n // have an excess of parents, and we'll need to keep the \"..\".\n if (piece === '..') {\n if (positive) {\n addTrailingSlash = true;\n positive--;\n pointer--;\n } else if (rel) {\n // If we're in a relativePath, then we need to keep the excess parents. Else, in an absolute\n // URL, protocol relative URL, or an absolute path, we don't need to keep excess.\n pieces[pointer++] = piece;\n }\n continue;\n }\n\n // We've encountered a real directory. Move it to the next insertion pointer, which accounts for\n // any popped or dropped directories.\n pieces[pointer++] = piece;\n positive++;\n }\n\n let path = '';\n for (let i = 1; i < pointer; i++) {\n path += '/' + pieces[i];\n }\n if (!path || (addTrailingSlash && !path.endsWith('/..'))) {\n path += '/';\n }\n url.path = path;\n}\n\n/**\n * Attempts to resolve `input` URL/path relative to `base`.\n */\nexport default function resolve(input: string, base: string | undefined): string {\n if (!input && !base) return '';\n\n const url = parseUrl(input);\n let inputType = url.type;\n\n if (base && inputType !== UrlType.Absolute) {\n const baseUrl = parseUrl(base);\n const baseType = baseUrl.type;\n\n switch (inputType) {\n case UrlType.Empty:\n url.hash = baseUrl.hash;\n // fall through\n\n case UrlType.Hash:\n url.query = baseUrl.query;\n // fall through\n\n case UrlType.Query:\n case UrlType.RelativePath:\n mergePaths(url, baseUrl);\n // fall through\n\n case UrlType.AbsolutePath:\n // The host, user, and port are joined, you can't copy one without the others.\n url.user = baseUrl.user;\n url.host = baseUrl.host;\n url.port = baseUrl.port;\n // fall through\n\n case UrlType.SchemeRelative:\n // The input doesn't have a schema at least, so we need to copy at least that over.\n url.scheme = baseUrl.scheme;\n }\n if (baseType > inputType) inputType = baseType;\n }\n\n normalizePath(url, inputType);\n\n const queryHash = url.query + url.hash;\n switch (inputType) {\n // This is impossible, because of the empty checks at the start of the function.\n // case UrlType.Empty:\n\n case UrlType.Hash:\n case UrlType.Query:\n return queryHash;\n\n case UrlType.RelativePath: {\n // The first char is always a \"/\", and we need it to be relative.\n const path = url.path.slice(1);\n\n if (!path) return queryHash || '.';\n\n if (isRelative(base || input) && !isRelative(path)) {\n // If base started with a leading \".\", or there is no base and input started with a \".\",\n // then we need to ensure that the relative path starts with a \".\". We don't know if\n // relative starts with a \"..\", though, so check before prepending.\n return './' + path + queryHash;\n }\n\n return path + queryHash;\n }\n\n case UrlType.AbsolutePath:\n return url.path + queryHash;\n\n default:\n return url.scheme + '//' + url.user + url.host + url.port + url.path + queryHash;\n }\n}\n"],"names":[],"mappings":"AAAA;AACA,MAAM,WAAW,GAAG,gBAAgB,CAAC;AAErC;;;;;;;;;;AAUA,MAAM,QAAQ,GAAG,0EAA0E,CAAC;AAE5F;;;;;;;;;AASA,MAAM,SAAS,GAAG,iEAAiE,CAAC;AAapF,IA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zB,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YAE/B,IAAI,CAAC,IAAI;gBAAE,OAAO,SAAS,IAAI,GAAG,CAAC;YAEnC,IAAI,UAAU,CAAC,IAAI,IAAI,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE;;;;gBAIlD,OAAO,IAAI,GAAG,IAAI,GAAG,SAAS,CAAC;aAChC;YAED,OAAO,IAAI,GAAG,SAAS,CAAC;SACzB;QAED,KAAK,OAAO,CAAC,YAAY;YACvB,OAAO,GAAG,CAAC,IAAI,GAAG,SAAS,CAAC;QAE9B;YACE,OAAO,GAAG,CAAC,MAAM,GAAG,IAAI,GAAG,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,GAAG,SAAS,CAAC;KACpF;AACH;;;;"} \ No newline at end of file diff --git a/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js b/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js new file mode 100644 index 0000000..0700a2d --- /dev/null +++ b/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js @@ -0,0 +1,250 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : + typeof define === 'function' && define.amd ? define(factory) : + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.resolveURI = factory()); +})(this, (function () { 'use strict'; + + // Matches the scheme of a URL, eg "http://" + const schemeRegex = /^[\w+.-]+:\/\//; + /** + * Matches the parts of a URL: + * 1. Scheme, including ":", guaranteed. + * 2. User/password, including "@", optional. + * 3. Host, guaranteed. + * 4. Port, including ":", optional. + * 5. Path, including "/", optional. + * 6. Query, including "?", optional. + * 7. Hash, including "#", optional. + */ + const urlRegex = /^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?(\?[^#]*)?(#.*)?/; + /** + * File URLs are weird. They dont' need the regular `//` in the scheme, they may or may not start + * with a leading `/`, they can have a domain (but only if they don't start with a Windows drive). + * + * 1. Host, optional. + * 2. Path, which may include "/", guaranteed. + * 3. Query, including "?", optional. + * 4. Hash, including "#", optional. + */ + const fileRegex = /^file:(?:\/\/((?![a-z]:)[^/#?]*)?)?(\/?[^#?]*)(\?[^#]*)?(#.*)?/i; + var UrlType; + (function (UrlType) { + UrlType[UrlType["Empty"] = 1] = "Empty"; + UrlType[UrlType["Hash"] = 2] = "Hash"; + UrlType[UrlType["Query"] = 3] = "Query"; + UrlType[UrlType["RelativePath"] = 4] = "RelativePath"; + UrlType[UrlType["AbsolutePath"] = 5] = "AbsolutePath"; + UrlType[UrlType["SchemeRelative"] = 6] = "SchemeRelative"; + UrlType[UrlType["Absolute"] = 7] = "Absolute"; + })(UrlType || (UrlType = {})); + function isAbsoluteUrl(input) { + return schemeRegex.test(input); + } + function isSchemeRelativeUrl(input) { + return input.startsWith('//'); + } + function isAbsolutePath(input) { + return input.startsWith('/'); + } + function isFileUrl(input) { + return input.startsWith('file:'); + } + function isRelative(input) { + return /^[.?#]/.test(input); + } + function parseAbsoluteUrl(input) { + const match = urlRegex.exec(input); + return makeUrl(match[1], match[2] || '', match[3], match[4] || '', match[5] || '/', match[6] || '', match[7] || ''); + } + function parseFileUrl(input) { + const match = fileRegex.exec(input); + const path = match[2]; + return makeUrl('file:', '', match[1] || '', '', isAbsolutePath(path) ? path : '/' + path, match[3] || '', match[4] || ''); + } + function makeUrl(scheme, user, host, port, path, query, hash) { + return { + scheme, + user, + host, + port, + path, + query, + hash, + type: UrlType.Absolute, + }; + } + function parseUrl(input) { + if (isSchemeRelativeUrl(input)) { + const url = parseAbsoluteUrl('http:' + input); + url.scheme = ''; + url.type = UrlType.SchemeRelative; + return url; + } + if (isAbsolutePath(input)) { + const url = parseAbsoluteUrl('http://foo.com' + input); + url.scheme = ''; + url.host = ''; + url.type = UrlType.AbsolutePath; + return url; + } + if (isFileUrl(input)) + return parseFileUrl(input); + if (isAbsoluteUrl(input)) + return parseAbsoluteUrl(input); + const url = parseAbsoluteUrl('http://foo.com/' + input); + url.scheme = ''; + url.host = ''; + url.type = input + ? input.startsWith('?') + ? UrlType.Query + : input.startsWith('#') + ? UrlType.Hash + : UrlType.RelativePath + : UrlType.Empty; + return url; + } + function stripPathFilename(path) { + // If a path ends with a parent directory "..", then it's a relative path with excess parent + // paths. It's not a file, so we can't strip it. + if (path.endsWith('/..')) + return path; + const index = path.lastIndexOf('/'); + return path.slice(0, index + 1); + } + function mergePaths(url, base) { + normalizePath(base, base.type); + // If the path is just a "/", then it was an empty path to begin with (remember, we're a relative + // path). + if (url.path === '/') { + url.path = base.path; + } + else { + // Resolution happens relative to the base path's directory, not the file. + url.path = stripPathFilename(base.path) + url.path; + } + } + /** + * The path can have empty directories "//", unneeded parents "foo/..", or current directory + * "foo/.". We need to normalize to a standard representation. + */ + function normalizePath(url, type) { + const rel = type <= UrlType.RelativePath; + const pieces = url.path.split('/'); + // We need to preserve the first piece always, so that we output a leading slash. The item at + // pieces[0] is an empty string. + let pointer = 1; + // Positive is the number of real directories we've output, used for popping a parent directory. + // Eg, "foo/bar/.." will have a positive 2, and we can decrement to be left with just "foo". + let positive = 0; + // We need to keep a trailing slash if we encounter an empty directory (eg, splitting "foo/" will + // generate `["foo", ""]` pieces). And, if we pop a parent directory. But once we encounter a + // real directory, we won't need to append, unless the other conditions happen again. + let addTrailingSlash = false; + for (let i = 1; i < pieces.length; i++) { + const piece = pieces[i]; + // An empty directory, could be a trailing slash, or just a double "//" in the path. + if (!piece) { + addTrailingSlash = true; + continue; + } + // If we encounter a real directory, then we don't need to append anymore. + addTrailingSlash = false; + // A current directory, which we can always drop. + if (piece === '.') + continue; + // A parent directory, we need to see if there are any real directories we can pop. Else, we + // have an excess of parents, and we'll need to keep the "..". + if (piece === '..') { + if (positive) { + addTrailingSlash = true; + positive--; + pointer--; + } + else if (rel) { + // If we're in a relativePath, then we need to keep the excess parents. Else, in an absolute + // URL, protocol relative URL, or an absolute path, we don't need to keep excess. + pieces[pointer++] = piece; + } + continue; + } + // We've encountered a real directory. Move it to the next insertion pointer, which accounts for + // any popped or dropped directories. + pieces[pointer++] = piece; + positive++; + } + let path = ''; + for (let i = 1; i < pointer; i++) { + path += '/' + pieces[i]; + } + if (!path || (addTrailingSlash && !path.endsWith('/..'))) { + path += '/'; + } + url.path = path; + } + /** + * Attempts to resolve `input` URL/path relative to `base`. + */ + function resolve(input, base) { + if (!input && !base) + return ''; + const url = parseUrl(input); + let inputType = url.type; + if (base && inputType !== UrlType.Absolute) { + const baseUrl = parseUrl(base); + const baseType = baseUrl.type; + switch (inputType) { + case UrlType.Empty: + url.hash = baseUrl.hash; + // fall through + case UrlType.Hash: + url.query = baseUrl.query; + // fall through + case UrlType.Query: + case UrlType.RelativePath: + mergePaths(url, baseUrl); + // fall through + case UrlType.AbsolutePath: + // The host, user, and port are joined, you can't copy one without the others. + url.user = baseUrl.user; + url.host = baseUrl.host; + url.port = baseUrl.port; + // fall through + case UrlType.SchemeRelative: + // The input doesn't have a schema at least, so we need to copy at least that over. + url.scheme = baseUrl.scheme; + } + if (baseType > inputType) + inputType = baseType; + } + normalizePath(url, inputType); + const queryHash = url.query + url.hash; + switch (inputType) { + // This is impossible, because of the empty checks at the start of the function. + // case UrlType.Empty: + case UrlType.Hash: + case UrlType.Query: + return queryHash; + case UrlType.RelativePath: { + // The first char is always a "/", and we need it to be relative. + const path = url.path.slice(1); + if (!path) + return queryHash || '.'; + if (isRelative(base || input) && !isRelative(path)) { + // If base started with a leading ".", or there is no base and input started with a ".", + // then we need to ensure that the relative path starts with a ".". We don't know if + // relative starts with a "..", though, so check before prepending. + return './' + path + queryHash; + } + return path + queryHash; + } + case UrlType.AbsolutePath: + return url.path + queryHash; + default: + return url.scheme + '//' + url.user + url.host + url.port + url.path + queryHash; + } + } + + return resolve; + +})); +//# sourceMappingURL=resolve-uri.umd.js.map diff --git a/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js.map b/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js.map new file mode 100644 index 0000000..a3e39eb --- /dev/null +++ b/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js.map @@ -0,0 +1 @@ +{"version":3,"file":"resolve-uri.umd.js","sources":["../src/resolve-uri.ts"],"sourcesContent":["// Matches the scheme of a URL, eg \"http://\"\nconst schemeRegex = /^[\\w+.-]+:\\/\\//;\n\n/**\n * Matches the parts of a URL:\n * 1. Scheme, including \":\", guaranteed.\n * 2. User/password, including \"@\", optional.\n * 3. Host, guaranteed.\n * 4. Port, including \":\", optional.\n * 5. Path, including \"/\", optional.\n * 6. Query, including \"?\", optional.\n * 7. Hash, including \"#\", optional.\n */\nconst urlRegex = /^([\\w+.-]+:)\\/\\/([^@/#?]*@)?([^:/#?]*)(:\\d+)?(\\/[^#?]*)?(\\?[^#]*)?(#.*)?/;\n\n/**\n * File URLs are weird. They dont' need the regular `//` in the scheme, they may or may not start\n * with a leading `/`, they can have a domain (but only if they don't start with a Windows drive).\n *\n * 1. Host, optional.\n * 2. Path, which may include \"/\", guaranteed.\n * 3. Query, including \"?\", optional.\n * 4. Hash, including \"#\", optional.\n */\nconst fileRegex = /^file:(?:\\/\\/((?![a-z]:)[^/#?]*)?)?(\\/?[^#?]*)(\\?[^#]*)?(#.*)?/i;\n\ntype Url = {\n scheme: string;\n user: string;\n host: string;\n port: string;\n path: string;\n query: string;\n hash: string;\n type: UrlType;\n};\n\nenum UrlType {\n Empty = 1,\n Hash = 2,\n Query = 3,\n RelativePath = 4,\n AbsolutePath = 5,\n SchemeRelative = 6,\n Absolute = 7,\n}\n\nfunction isAbsoluteUrl(input: string): boolean {\n return schemeRegex.test(input);\n}\n\nfunction isSchemeRelativeUrl(input: string): boolean {\n return input.startsWith('//');\n}\n\nfunction isAbsolutePath(input: string): boolean {\n return input.startsWith('/');\n}\n\nfunction isFileUrl(input: string): boolean {\n return input.startsWith('file:');\n}\n\nfunction isRelative(input: string): boolean {\n return /^[.?#]/.test(input);\n}\n\nfunction parseAbsoluteUrl(input: string): Url {\n const match = urlRegex.exec(input)!;\n return makeUrl(\n match[1],\n match[2] || '',\n match[3],\n match[4] || '',\n match[5] || '/',\n match[6] || '',\n match[7] || '',\n );\n}\n\nfunction parseFileUrl(input: string): Url {\n const match = fileRegex.exec(input)!;\n const path = match[2];\n return makeUrl(\n 'file:',\n '',\n match[1] || '',\n '',\n isAbsolutePath(path) ? path : '/' + path,\n match[3] || '',\n match[4] || '',\n );\n}\n\nfunction makeUrl(\n scheme: string,\n user: string,\n host: string,\n port: string,\n path: string,\n query: string,\n hash: string,\n): Url {\n return {\n scheme,\n user,\n host,\n port,\n path,\n query,\n hash,\n type: UrlType.Absolute,\n };\n}\n\nfunction parseUrl(input: string): Url {\n if (isSchemeRelativeUrl(input)) {\n const url = parseAbsoluteUrl('http:' + input);\n url.scheme = '';\n url.type = UrlType.SchemeRelative;\n return url;\n }\n\n if (isAbsolutePath(input)) {\n const url = parseAbsoluteUrl('http://foo.com' + input);\n url.scheme = '';\n url.host = '';\n url.type = UrlType.AbsolutePath;\n return url;\n }\n\n if (isFileUrl(input)) return parseFileUrl(input);\n\n if (isAbsoluteUrl(input)) return parseAbsoluteUrl(input);\n\n const url = parseAbsoluteUrl('http://foo.com/' + input);\n url.scheme = '';\n url.host = '';\n url.type = input\n ? input.startsWith('?')\n ? UrlType.Query\n : input.startsWith('#')\n ? UrlType.Hash\n : UrlType.RelativePath\n : UrlType.Empty;\n return url;\n}\n\nfunction stripPathFilename(path: string): string {\n // If a path ends with a parent directory \"..\", then it's a relative path with excess parent\n // paths. It's not a file, so we can't strip it.\n if (path.endsWith('/..')) return path;\n const index = path.lastIndexOf('/');\n return path.slice(0, index + 1);\n}\n\nfunction mergePaths(url: Url, base: Url) {\n normalizePath(base, base.type);\n\n // If the path is just a \"/\", then it was an empty path to begin with (remember, we're a relative\n // path).\n if (url.path === '/') {\n url.path = base.path;\n } else {\n // Resolution happens relative to the base path's directory, not the file.\n url.path = stripPathFilename(base.path) + url.path;\n }\n}\n\n/**\n * The path can have empty directories \"//\", unneeded parents \"foo/..\", or current directory\n * \"foo/.\". We need to normalize to a standard representation.\n */\nfunction normalizePath(url: Url, type: UrlType) {\n const rel = type <= UrlType.RelativePath;\n const pieces = url.path.split('/');\n\n // We need to preserve the first piece always, so that we output a leading slash. The item at\n // pieces[0] is an empty string.\n let pointer = 1;\n\n // Positive is the number of real directories we've output, used for popping a parent directory.\n // Eg, \"foo/bar/..\" will have a positive 2, and we can decrement to be left with just \"foo\".\n let positive = 0;\n\n // We need to keep a trailing slash if we encounter an empty directory (eg, splitting \"foo/\" will\n // generate `[\"foo\", \"\"]` pieces). And, if we pop a parent directory. But once we encounter a\n // real directory, we won't need to append, unless the other conditions happen again.\n let addTrailingSlash = false;\n\n for (let i = 1; i < pieces.length; i++) {\n const piece = pieces[i];\n\n // An empty directory, could be a trailing slash, or just a double \"//\" in the path.\n if (!piece) {\n addTrailingSlash = true;\n continue;\n }\n\n // If we encounter a real directory, then we don't need to append anymore.\n addTrailingSlash = false;\n\n // A current directory, which we can always drop.\n if (piece === '.') continue;\n\n // A parent directory, we need to see if there are any real directories we can pop. Else, we\n // have an excess of parents, and we'll need to keep the \"..\".\n if (piece === '..') {\n if (positive) {\n addTrailingSlash = true;\n positive--;\n pointer--;\n } else if (rel) {\n // If we're in a relativePath, then we need to keep the excess parents. Else, in an absolute\n // URL, protocol relative URL, or an absolute path, we don't need to keep excess.\n pieces[pointer++] = piece;\n }\n continue;\n }\n\n // We've encountered a real directory. Move it to the next insertion pointer, which accounts for\n // any popped or dropped directories.\n pieces[pointer++] = piece;\n positive++;\n }\n\n let path = '';\n for (let i = 1; i < pointer; i++) {\n path += '/' + pieces[i];\n }\n if (!path || (addTrailingSlash && !path.endsWith('/..'))) {\n path += '/';\n }\n url.path = path;\n}\n\n/**\n * Attempts to resolve `input` URL/path relative to `base`.\n */\nexport default function resolve(input: string, base: string | undefined): string {\n if (!input && !base) return '';\n\n const url = parseUrl(input);\n let inputType = url.type;\n\n if (base && inputType !== UrlType.Absolute) {\n const baseUrl = parseUrl(base);\n const baseType = baseUrl.type;\n\n switch (inputType) {\n case UrlType.Empty:\n url.hash = baseUrl.hash;\n // fall through\n\n case UrlType.Hash:\n url.query = baseUrl.query;\n // fall through\n\n case UrlType.Query:\n case UrlType.RelativePath:\n mergePaths(url, baseUrl);\n // fall through\n\n case UrlType.AbsolutePath:\n // The host, user, and port are joined, you can't copy one without the others.\n url.user = baseUrl.user;\n url.host = baseUrl.host;\n url.port = baseUrl.port;\n // fall through\n\n case UrlType.SchemeRelative:\n // The input doesn't have a schema at least, so we need to copy at least that over.\n url.scheme = baseUrl.scheme;\n }\n if (baseType > inputType) inputType = baseType;\n }\n\n normalizePath(url, inputType);\n\n const queryHash = url.query + url.hash;\n switch (inputType) {\n // This is impossible, because of the empty checks at the start of the function.\n // case UrlType.Empty:\n\n case UrlType.Hash:\n case UrlType.Query:\n return queryHash;\n\n case UrlType.RelativePath: {\n // The first char is always a \"/\", and we need it to be relative.\n const path = url.path.slice(1);\n\n if (!path) return queryHash || '.';\n\n if (isRelative(base || input) && !isRelative(path)) {\n // If base started with a leading \".\", or there is no base and input started with a \".\",\n // then we need to ensure that the relative path starts with a \".\". We don't know if\n // relative starts with a \"..\", though, so check before prepending.\n return './' + path + queryHash;\n }\n\n return path + queryHash;\n }\n\n case UrlType.AbsolutePath:\n return url.path + queryHash;\n\n default:\n return url.scheme + '//' + url.user + url.host + url.port + url.path + queryHash;\n }\n}\n"],"names":[],"mappings":";;;;;;IAAA;IACA,MAAM,WAAW,GAAG,gBAAgB,CAAC;IAErC;;;;;;;;;;IAUA,MAAM,QAAQ,GAAG,0EAA0E,CAAC;IAE5F;;;;;;;;;IASA,MAAM,SAAS,GAAG,iEAAiE,CAAC;IAapF,IAAK,OAQJ;IARD,WAAK,OAAO;QACV,uCAAS,CAAA;QACT,qCAAQ,CA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CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;gBAE/B,IAAI,CAAC,IAAI;oBAAE,OAAO,SAAS,IAAI,GAAG,CAAC;gBAEnC,IAAI,UAAU,CAAC,IAAI,IAAI,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE;;;;oBAIlD,OAAO,IAAI,GAAG,IAAI,GAAG,SAAS,CAAC;iBAChC;gBAED,OAAO,IAAI,GAAG,SAAS,CAAC;aACzB;YAED,KAAK,OAAO,CAAC,YAAY;gBACvB,OAAO,GAAG,CAAC,IAAI,GAAG,SAAS,CAAC;YAE9B;gBACE,OAAO,GAAG,CAAC,MAAM,GAAG,IAAI,GAAG,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,GAAG,SAAS,CAAC;SACpF;IACH;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/@jridgewell/resolve-uri/dist/types/resolve-uri.d.ts b/node_modules/@jridgewell/resolve-uri/dist/types/resolve-uri.d.ts new file mode 100644 index 0000000..b7f0b3b --- /dev/null +++ b/node_modules/@jridgewell/resolve-uri/dist/types/resolve-uri.d.ts @@ -0,0 +1,4 @@ +/** + * Attempts to resolve `input` URL/path relative to `base`. + */ +export default function resolve(input: string, base: string | undefined): string; diff --git a/node_modules/@jridgewell/resolve-uri/package.json b/node_modules/@jridgewell/resolve-uri/package.json new file mode 100644 index 0000000..6bffa7b --- /dev/null +++ b/node_modules/@jridgewell/resolve-uri/package.json @@ -0,0 +1,69 @@ +{ + "name": "@jridgewell/resolve-uri", + "version": "3.1.1", + "description": "Resolve a URI relative to an optional base URI", + "keywords": [ + "resolve", + "uri", + "url", + "path" + ], + "author": "Justin Ridgewell ", + "license": "MIT", + "repository": "https://github.com/jridgewell/resolve-uri", + "main": "dist/resolve-uri.umd.js", + "module": "dist/resolve-uri.mjs", + "types": "dist/types/resolve-uri.d.ts", + "exports": { + ".": [ + { + "types": "./dist/types/resolve-uri.d.ts", + "browser": "./dist/resolve-uri.umd.js", + "require": "./dist/resolve-uri.umd.js", + "import": "./dist/resolve-uri.mjs" + }, + "./dist/resolve-uri.umd.js" + ], + "./package.json": "./package.json" + }, + "files": [ + "dist" + ], + "engines": { + "node": ">=6.0.0" + }, + "scripts": { + "prebuild": "rm -rf dist", + "build": "run-s -n build:*", + "build:rollup": "rollup -c rollup.config.js", + "build:ts": "tsc --project tsconfig.build.json", + "lint": "run-s -n lint:*", + "lint:prettier": "npm run test:lint:prettier -- --write", + "lint:ts": "npm run test:lint:ts -- --fix", + "pretest": "run-s build:rollup", + "test": "run-s -n test:lint test:only", + "test:debug": "mocha --inspect-brk", + "test:lint": "run-s -n test:lint:*", + "test:lint:prettier": "prettier --check '{src,test}/**/*.ts'", + "test:lint:ts": "eslint '{src,test}/**/*.ts'", + "test:only": "mocha", + "test:coverage": "c8 mocha", + "test:watch": "mocha --watch", + "prepublishOnly": "npm run preversion", + "preversion": "run-s test build" + }, + "devDependencies": { + "@jridgewell/resolve-uri-latest": "npm:@jridgewell/resolve-uri@*", + "@rollup/plugin-typescript": "8.3.0", + "@typescript-eslint/eslint-plugin": "5.10.0", + "@typescript-eslint/parser": "5.10.0", + "c8": "7.11.0", + "eslint": "8.7.0", + "eslint-config-prettier": "8.3.0", + "mocha": "9.2.0", + "npm-run-all": "4.1.5", + "prettier": "2.5.1", + "rollup": "2.66.0", + "typescript": "4.5.5" + } +} diff --git a/node_modules/@jridgewell/set-array/LICENSE b/node_modules/@jridgewell/set-array/LICENSE new file mode 100644 index 0000000..352f071 --- /dev/null +++ b/node_modules/@jridgewell/set-array/LICENSE @@ -0,0 +1,19 @@ +Copyright 2022 Justin Ridgewell + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/@jridgewell/set-array/README.md b/node_modules/@jridgewell/set-array/README.md new file mode 100644 index 0000000..2ed155f --- /dev/null +++ b/node_modules/@jridgewell/set-array/README.md @@ -0,0 +1,37 @@ +# @jridgewell/set-array + +> Like a Set, but provides the index of the `key` in the backing array + +This is designed to allow synchronizing a second array with the contents of the backing array, like +how in a sourcemap `sourcesContent[i]` is the source content associated with `source[i]`, and there +are never duplicates. + +## Installation + +```sh +npm install @jridgewell/set-array +``` + +## Usage + +```js +import { SetArray, get, put, pop } from '@jridgewell/set-array'; + +const sa = new SetArray(); + +let index = put(sa, 'first'); +assert.strictEqual(index, 0); + +index = put(sa, 'second'); +assert.strictEqual(index, 1); + +assert.deepEqual(sa.array, [ 'first', 'second' ]); + +index = get(sa, 'first'); +assert.strictEqual(index, 0); + +pop(sa); +index = get(sa, 'second'); +assert.strictEqual(index, undefined); +assert.deepEqual(sa.array, [ 'first' ]); +``` diff --git a/node_modules/@jridgewell/set-array/dist/set-array.mjs b/node_modules/@jridgewell/set-array/dist/set-array.mjs new file mode 100644 index 0000000..b7f1a9c --- /dev/null +++ b/node_modules/@jridgewell/set-array/dist/set-array.mjs @@ -0,0 +1,48 @@ +/** + * Gets the index associated with `key` in the backing array, if it is already present. + */ +let get; +/** + * Puts `key` into the backing array, if it is not already present. Returns + * the index of the `key` in the backing array. + */ +let put; +/** + * Pops the last added item out of the SetArray. + */ +let pop; +/** + * SetArray acts like a `Set` (allowing only one occurrence of a string `key`), but provides the + * index of the `key` in the backing array. + * + * This is designed to allow synchronizing a second array with the contents of the backing array, + * like how in a sourcemap `sourcesContent[i]` is the source content associated with `source[i]`, + * and there are never duplicates. + */ +class SetArray { + constructor() { + this._indexes = { __proto__: null }; + this.array = []; + } +} +(() => { + get = (strarr, key) => strarr._indexes[key]; + put = (strarr, key) => { + // The key may or may not be present. If it is present, it's a number. + const index = get(strarr, key); + if (index !== undefined) + return index; + const { array, _indexes: indexes } = strarr; + return (indexes[key] = array.push(key) - 1); + }; + pop = (strarr) => { + const { array, _indexes: indexes } = strarr; + if (array.length === 0) + return; + const last = array.pop(); + indexes[last] = undefined; + }; +})(); + +export { SetArray, get, pop, put }; +//# sourceMappingURL=set-array.mjs.map diff --git a/node_modules/@jridgewell/set-array/dist/set-array.mjs.map b/node_modules/@jridgewell/set-array/dist/set-array.mjs.map new file mode 100644 index 0000000..ead5643 --- /dev/null +++ b/node_modules/@jridgewell/set-array/dist/set-array.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"set-array.mjs","sources":["../src/set-array.ts"],"sourcesContent":["/**\n * Gets the index associated with `key` in the backing array, if it is already present.\n */\nexport let get: (strarr: SetArray, key: string) => number | undefined;\n\n/**\n * Puts `key` into the backing array, if it is not already present. Returns\n * the index of the `key` in the backing array.\n */\nexport let put: (strarr: SetArray, key: string) => number;\n\n/**\n * Pops the last added item out of the SetArray.\n */\nexport let pop: (strarr: SetArray) => void;\n\n/**\n * SetArray acts like a `Set` (allowing only one occurrence of a string `key`), but provides the\n * index of the `key` in the backing array.\n *\n * This is designed to allow synchronizing a second array with the contents of the backing array,\n * like how in a sourcemap `sourcesContent[i]` is the source content associated with `source[i]`,\n * and there are never duplicates.\n */\nexport class SetArray {\n private declare _indexes: { [key: string]: number | undefined };\n declare array: readonly string[];\n\n constructor() {\n this._indexes = { __proto__: null } as any;\n this.array = [];\n }\n\n static {\n get = (strarr, key) => strarr._indexes[key];\n\n put = (strarr, key) => {\n // The key may or may not be present. If it is present, it's a number.\n const index = get(strarr, key);\n if (index !== undefined) return index;\n\n const { array, _indexes: indexes } = strarr;\n\n return (indexes[key] = (array as string[]).push(key) - 1);\n };\n\n pop = (strarr) => {\n const { array, _indexes: indexes } = strarr;\n if (array.length === 0) return;\n\n const last = (array as string[]).pop()!;\n indexes[last] = undefined;\n };\n }\n}\n"],"names":[],"mappings":"AAAA;;;IAGW,IAA2D;AAEtE;;;;IAIW,IAA+C;AAE1D;;;IAGW,IAAgC;AAE3C;;;;;;;;MAQa,QAAQ;IAInB;QACE,IAAI,CAAC,QAAQ,GAAG,EAAE,SAAS,EAAE,IAAI,EAAS,CAAC;QAC3C,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;KACjB;CAuBF;AArBC;IACE,GAAG,GAAG,CAAC,MAAM,EAAE,GAAG,KAAK,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;IAE5C,GAAG,GAAG,CAAC,MAAM,EAAE,GAAG;;QAEhB,MAAM,KAAK,GAAG,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QAC/B,IAAI,KAAK,KAAK,SAAS;YAAE,OAAO,KAAK,CAAC;QAEtC,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC;QAE5C,QAAQ,OAAO,CAAC,GAAG,CAAC,GAAI,KAAkB,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;KAC3D,CAAC;IAEF,GAAG,GAAG,CAAC,MAAM;QACX,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC;QAC5C,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO;QAE/B,MAAM,IAAI,GAAI,KAAkB,CAAC,GAAG,EAAG,CAAC;QACxC,OAAO,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC;KAC3B,CAAC;AACJ,CAAC,GAAA;;;;"} \ No newline at end of file diff --git a/node_modules/@jridgewell/set-array/dist/set-array.umd.js b/node_modules/@jridgewell/set-array/dist/set-array.umd.js new file mode 100644 index 0000000..a1c200a --- /dev/null +++ b/node_modules/@jridgewell/set-array/dist/set-array.umd.js @@ -0,0 +1,58 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : + typeof define === 'function' && define.amd ? define(['exports'], factory) : + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.setArray = {})); +})(this, (function (exports) { 'use strict'; + + /** + * Gets the index associated with `key` in the backing array, if it is already present. + */ + exports.get = void 0; + /** + * Puts `key` into the backing array, if it is not already present. Returns + * the index of the `key` in the backing array. + */ + exports.put = void 0; + /** + * Pops the last added item out of the SetArray. + */ + exports.pop = void 0; + /** + * SetArray acts like a `Set` (allowing only one occurrence of a string `key`), but provides the + * index of the `key` in the backing array. + * + * This is designed to allow synchronizing a second array with the contents of the backing array, + * like how in a sourcemap `sourcesContent[i]` is the source content associated with `source[i]`, + * and there are never duplicates. + */ + class SetArray { + constructor() { + this._indexes = { __proto__: null }; + this.array = []; + } + } + (() => { + exports.get = (strarr, key) => strarr._indexes[key]; + exports.put = (strarr, key) => { + // The key may or may not be present. If it is present, it's a number. + const index = exports.get(strarr, key); + if (index !== undefined) + return index; + const { array, _indexes: indexes } = strarr; + return (indexes[key] = array.push(key) - 1); + }; + exports.pop = (strarr) => { + const { array, _indexes: indexes } = strarr; + if (array.length === 0) + return; + const last = array.pop(); + indexes[last] = undefined; + }; + })(); + + exports.SetArray = SetArray; + + Object.defineProperty(exports, '__esModule', { value: true }); + +})); +//# sourceMappingURL=set-array.umd.js.map diff --git a/node_modules/@jridgewell/set-array/dist/set-array.umd.js.map b/node_modules/@jridgewell/set-array/dist/set-array.umd.js.map new file mode 100644 index 0000000..10005af --- /dev/null +++ b/node_modules/@jridgewell/set-array/dist/set-array.umd.js.map @@ -0,0 +1 @@ +{"version":3,"file":"set-array.umd.js","sources":["../src/set-array.ts"],"sourcesContent":["/**\n * Gets the index associated with `key` in the backing array, if it is already present.\n */\nexport let get: (strarr: SetArray, key: string) => number | undefined;\n\n/**\n * Puts `key` into the backing array, if it is not already present. Returns\n * the index of the `key` in the backing array.\n */\nexport let put: (strarr: SetArray, key: string) => number;\n\n/**\n * Pops the last added item out of the SetArray.\n */\nexport let pop: (strarr: SetArray) => void;\n\n/**\n * SetArray acts like a `Set` (allowing only one occurrence of a string `key`), but provides the\n * index of the `key` in the backing array.\n *\n * This is designed to allow synchronizing a second array with the contents of the backing array,\n * like how in a sourcemap `sourcesContent[i]` is the source content associated with `source[i]`,\n * and there are never duplicates.\n */\nexport class SetArray {\n private declare _indexes: { [key: string]: number | undefined };\n declare array: readonly string[];\n\n constructor() {\n this._indexes = { __proto__: null } as any;\n this.array = [];\n }\n\n static {\n get = (strarr, key) => strarr._indexes[key];\n\n put = (strarr, key) => {\n // The key may or may not be present. If it is present, it's a number.\n const index = get(strarr, key);\n if (index !== undefined) return index;\n\n const { array, _indexes: indexes } = strarr;\n\n return (indexes[key] = (array as string[]).push(key) - 1);\n };\n\n pop = (strarr) => {\n const { array, _indexes: indexes } = strarr;\n if (array.length === 0) return;\n\n const last = (array as string[]).pop()!;\n indexes[last] = undefined;\n };\n }\n}\n"],"names":["get","put","pop"],"mappings":";;;;;;IAAA;;;AAGWA,yBAA2D;IAEtE;;;;AAIWC,yBAA+C;IAE1D;;;AAGWC,yBAAgC;IAE3C;;;;;;;;UAQa,QAAQ;QAInB;YACE,IAAI,CAAC,QAAQ,GAAG,EAAE,SAAS,EAAE,IAAI,EAAS,CAAC;YAC3C,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;SACjB;KAuBF;IArBC;QACEF,WAAG,GAAG,CAAC,MAAM,EAAE,GAAG,KAAK,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;QAE5CC,WAAG,GAAG,CAAC,MAAM,EAAE,GAAG;;YAEhB,MAAM,KAAK,GAAGD,WAAG,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;YAC/B,IAAI,KAAK,KAAK,SAAS;gBAAE,OAAO,KAAK,CAAC;YAEtC,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC;YAE5C,QAAQ,OAAO,CAAC,GAAG,CAAC,GAAI,KAAkB,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;SAC3D,CAAC;QAEFE,WAAG,GAAG,CAAC,MAAM;YACX,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC;YAC5C,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;gBAAE,OAAO;YAE/B,MAAM,IAAI,GAAI,KAAkB,CAAC,GAAG,EAAG,CAAC;YACxC,OAAO,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC;SAC3B,CAAC;IACJ,CAAC,GAAA;;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/@jridgewell/set-array/dist/types/set-array.d.ts b/node_modules/@jridgewell/set-array/dist/types/set-array.d.ts new file mode 100644 index 0000000..7ed59b9 --- /dev/null +++ b/node_modules/@jridgewell/set-array/dist/types/set-array.d.ts @@ -0,0 +1,26 @@ +/** + * Gets the index associated with `key` in the backing array, if it is already present. + */ +export declare let get: (strarr: SetArray, key: string) => number | undefined; +/** + * Puts `key` into the backing array, if it is not already present. Returns + * the index of the `key` in the backing array. + */ +export declare let put: (strarr: SetArray, key: string) => number; +/** + * Pops the last added item out of the SetArray. + */ +export declare let pop: (strarr: SetArray) => void; +/** + * SetArray acts like a `Set` (allowing only one occurrence of a string `key`), but provides the + * index of the `key` in the backing array. + * + * This is designed to allow synchronizing a second array with the contents of the backing array, + * like how in a sourcemap `sourcesContent[i]` is the source content associated with `source[i]`, + * and there are never duplicates. + */ +export declare class SetArray { + private _indexes; + array: readonly string[]; + constructor(); +} diff --git a/node_modules/@jridgewell/set-array/package.json b/node_modules/@jridgewell/set-array/package.json new file mode 100644 index 0000000..aec4ee0 --- /dev/null +++ b/node_modules/@jridgewell/set-array/package.json @@ -0,0 +1,66 @@ +{ + "name": "@jridgewell/set-array", + "version": "1.1.2", + "description": "Like a Set, but provides the index of the `key` in the backing array", + "keywords": [], + "author": "Justin Ridgewell ", + "license": "MIT", + "repository": "https://github.com/jridgewell/set-array", + "main": "dist/set-array.umd.js", + "module": "dist/set-array.mjs", + "typings": "dist/types/set-array.d.ts", + "exports": { + ".": [ + { + "types": "./dist/types/set-array.d.ts", + "browser": "./dist/set-array.umd.js", + "require": "./dist/set-array.umd.js", + "import": "./dist/set-array.mjs" + }, + "./dist/set-array.umd.js" + ], + "./package.json": "./package.json" + }, + "files": [ + "dist", + "src" + ], + "engines": { + "node": ">=6.0.0" + }, + "scripts": { + "prebuild": "rm -rf dist", + "build": "run-s -n build:*", + "build:rollup": "rollup -c rollup.config.js", + "build:ts": "tsc --project tsconfig.build.json", + "lint": "run-s -n lint:*", + "lint:prettier": "npm run test:lint:prettier -- --write", + "lint:ts": "npm run test:lint:ts -- --fix", + "pretest": "run-s build:rollup", + "test": "run-s -n test:lint test:only", + "test:debug": "mocha --inspect-brk", + "test:lint": "run-s -n test:lint:*", + "test:lint:prettier": "prettier --check '{src,test}/**/*.ts'", + "test:lint:ts": "eslint '{src,test}/**/*.ts'", + "test:only": "mocha", + "test:coverage": "c8 mocha", + "test:watch": "mocha --watch", + "prepublishOnly": "npm run preversion", + "preversion": "run-s test build" + }, + "devDependencies": { + "@rollup/plugin-typescript": "8.3.0", + "@types/mocha": "9.1.1", + "@types/node": "17.0.29", + "@typescript-eslint/eslint-plugin": "5.10.0", + "@typescript-eslint/parser": "5.10.0", + "c8": "7.11.0", + "eslint": "8.7.0", + "eslint-config-prettier": "8.3.0", + "mocha": "9.2.0", + "npm-run-all": "4.1.5", + "prettier": "2.5.1", + "rollup": "2.66.0", + "typescript": "4.5.5" + } +} diff --git a/node_modules/@jridgewell/set-array/src/set-array.ts b/node_modules/@jridgewell/set-array/src/set-array.ts new file mode 100644 index 0000000..f9ff604 --- /dev/null +++ b/node_modules/@jridgewell/set-array/src/set-array.ts @@ -0,0 +1,55 @@ +/** + * Gets the index associated with `key` in the backing array, if it is already present. + */ +export let get: (strarr: SetArray, key: string) => number | undefined; + +/** + * Puts `key` into the backing array, if it is not already present. Returns + * the index of the `key` in the backing array. + */ +export let put: (strarr: SetArray, key: string) => number; + +/** + * Pops the last added item out of the SetArray. + */ +export let pop: (strarr: SetArray) => void; + +/** + * SetArray acts like a `Set` (allowing only one occurrence of a string `key`), but provides the + * index of the `key` in the backing array. + * + * This is designed to allow synchronizing a second array with the contents of the backing array, + * like how in a sourcemap `sourcesContent[i]` is the source content associated with `source[i]`, + * and there are never duplicates. + */ +export class SetArray { + private declare _indexes: { [key: string]: number | undefined }; + declare array: readonly string[]; + + constructor() { + this._indexes = { __proto__: null } as any; + this.array = []; + } + + static { + get = (strarr, key) => strarr._indexes[key]; + + put = (strarr, key) => { + // The key may or may not be present. If it is present, it's a number. + const index = get(strarr, key); + if (index !== undefined) return index; + + const { array, _indexes: indexes } = strarr; + + return (indexes[key] = (array as string[]).push(key) - 1); + }; + + pop = (strarr) => { + const { array, _indexes: indexes } = strarr; + if (array.length === 0) return; + + const last = (array as string[]).pop()!; + indexes[last] = undefined; + }; + } +} diff --git a/node_modules/@jridgewell/source-map/LICENSE b/node_modules/@jridgewell/source-map/LICENSE new file mode 100644 index 0000000..0a81b2a --- /dev/null +++ b/node_modules/@jridgewell/source-map/LICENSE @@ -0,0 +1,19 @@ +Copyright 2019 Justin Ridgewell + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/node_modules/@jridgewell/source-map/README.md b/node_modules/@jridgewell/source-map/README.md new file mode 100644 index 0000000..cb58e33 --- /dev/null +++ b/node_modules/@jridgewell/source-map/README.md @@ -0,0 +1,82 @@ +# @jridgewell/source-map + +> Packages `@jridgewell/trace-mapping` and `@jridgewell/gen-mapping` into the familiar source-map API + +This isn't the full API, but it's the core functionality. This wraps +[@jridgewell/trace-mapping][trace-mapping] and [@jridgewell/gen-mapping][gen-mapping] +implementations. + +## Installation + +```sh +npm install @jridgewell/source-map +``` + +## Usage + +TODO + +### SourceMapConsumer + +```typescript +import { SourceMapConsumer } from '@jridgewell/source-map'; +const smc = new SourceMapConsumer({ + version: 3, + names: ['foo'], + sources: ['input.js'], + mappings: 'AAAAA', +}); +``` + +#### SourceMapConsumer.prototype.originalPositionFor(generatedPosition) + +```typescript +const smc = new SourceMapConsumer(map); +smc.originalPositionFor({ line: 1, column: 0 }); +``` + +### SourceMapGenerator + +```typescript +import { SourceMapGenerator } from '@jridgewell/source-map'; +const smg = new SourceMapGenerator({ + file: 'output.js', + sourceRoot: 'https://example.com/', +}); +``` + +#### SourceMapGenerator.prototype.addMapping(mapping) + +```typescript +const smg = new SourceMapGenerator(); +smg.addMapping({ + generated: { line: 1, column: 0 }, + source: 'input.js', + original: { line: 1, column: 0 }, + name: 'foo', +}); +``` + +#### SourceMapGenerator.prototype.setSourceContent(sourceFile, sourceContent) + +```typescript +const smg = new SourceMapGenerator(); +smg.setSourceContent('input.js', 'foobar'); +``` + +#### SourceMapGenerator.prototype.toJSON() + +```typescript +const smg = new SourceMapGenerator(); +smg.toJSON(); // { version: 3, names: [], sources: [], mappings: '' } +``` + +#### SourceMapGenerator.prototype.toDecodedMap() + +```typescript +const smg = new SourceMapGenerator(); +smg.toDecodedMap(); // { version: 3, names: [], sources: [], mappings: [] } +``` + +[trace-mapping]: https://github.com/jridgewell/trace-mapping/ +[gen-mapping]: https://github.com/jridgewell/gen-mapping/ diff --git a/node_modules/@jridgewell/source-map/dist/source-map.mjs b/node_modules/@jridgewell/source-map/dist/source-map.mjs new file mode 100644 index 0000000..aa1bc2c --- /dev/null +++ b/node_modules/@jridgewell/source-map/dist/source-map.mjs @@ -0,0 +1,928 @@ +const comma = ','.charCodeAt(0); +const semicolon = ';'.charCodeAt(0); +const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; +const intToChar = new Uint8Array(64); // 64 possible chars. +const charToInteger = new Uint8Array(128); // z is 122 in ASCII +for (let i = 0; i < chars.length; i++) { + const c = chars.charCodeAt(i); + charToInteger[c] = i; + intToChar[i] = c; +} +// Provide a fallback for older environments. +const td = typeof TextDecoder !== 'undefined' + ? new TextDecoder() + : typeof Buffer !== 'undefined' + ? { + decode(buf) { + const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength); + return out.toString(); + }, + } + : { + decode(buf) { + let out = ''; + for (let i = 0; i < buf.length; i++) { + out += String.fromCharCode(buf[i]); + } + return out; + }, + }; +function decode(mappings) { + const state = new Int32Array(5); + const decoded = []; + let line = []; + let sorted = true; + let lastCol = 0; + for (let i = 0; i < mappings.length;) { + const c = mappings.charCodeAt(i); + if (c === comma) { + i++; + } + else if (c === semicolon) { + state[0] = lastCol = 0; + if (!sorted) + sort(line); + sorted = true; + decoded.push(line); + line = []; + i++; + } + else { + i = decodeInteger(mappings, i, state, 0); // generatedCodeColumn + const col = state[0]; + if (col < lastCol) + sorted = false; + lastCol = col; + if (!hasMoreSegments(mappings, i)) { + line.push([col]); + continue; + } + i = decodeInteger(mappings, i, state, 1); // sourceFileIndex + i = decodeInteger(mappings, i, state, 2); // sourceCodeLine + i = decodeInteger(mappings, i, state, 3); // sourceCodeColumn + if (!hasMoreSegments(mappings, i)) { + line.push([col, state[1], state[2], state[3]]); + continue; + } + i = decodeInteger(mappings, i, state, 4); // nameIndex + line.push([col, state[1], state[2], state[3], state[4]]); + } + } + if (!sorted) + sort(line); + decoded.push(line); + return decoded; +} +function decodeInteger(mappings, pos, state, j) { + let value = 0; + let shift = 0; + let integer = 0; + do { + const c = mappings.charCodeAt(pos++); + integer = charToInteger[c]; + value |= (integer & 31) << shift; + shift += 5; + } while (integer & 32); + const shouldNegate = value & 1; + value >>>= 1; + if (shouldNegate) { + value = -0x80000000 | -value; + } + state[j] += value; + return pos; +} +function hasMoreSegments(mappings, i) { + if (i >= mappings.length) + return false; + const c = mappings.charCodeAt(i); + if (c === comma || c === semicolon) + return false; + return true; +} +function sort(line) { + line.sort(sortComparator$1); +} +function sortComparator$1(a, b) { + return a[0] - b[0]; +} +function encode(decoded) { + const state = new Int32Array(5); + let buf = new Uint8Array(1024); + let pos = 0; + for (let i = 0; i < decoded.length; i++) { + const line = decoded[i]; + if (i > 0) { + buf = reserve(buf, pos, 1); + buf[pos++] = semicolon; + } + if (line.length === 0) + continue; + state[0] = 0; + for (let j = 0; j < line.length; j++) { + const segment = line[j]; + // We can push up to 5 ints, each int can take at most 7 chars, and we + // may push a comma. + buf = reserve(buf, pos, 36); + if (j > 0) + buf[pos++] = comma; + pos = encodeInteger(buf, pos, state, segment, 0); // generatedCodeColumn + if (segment.length === 1) + continue; + pos = encodeInteger(buf, pos, state, segment, 1); // sourceFileIndex + pos = encodeInteger(buf, pos, state, segment, 2); // sourceCodeLine + pos = encodeInteger(buf, pos, state, segment, 3); // sourceCodeColumn + if (segment.length === 4) + continue; + pos = encodeInteger(buf, pos, state, segment, 4); // nameIndex + } + } + return td.decode(buf.subarray(0, pos)); +} +function reserve(buf, pos, count) { + if (buf.length > pos + count) + return buf; + const swap = new Uint8Array(buf.length * 2); + swap.set(buf); + return swap; +} +function encodeInteger(buf, pos, state, segment, j) { + const next = segment[j]; + let num = next - state[j]; + state[j] = next; + num = num < 0 ? (-num << 1) | 1 : num << 1; + do { + let clamped = num & 0b011111; + num >>>= 5; + if (num > 0) + clamped |= 0b100000; + buf[pos++] = intToChar[clamped]; + } while (num > 0); + return pos; +} + +// Matches the scheme of a URL, eg "http://" +const schemeRegex = /^[\w+.-]+:\/\//; +/** + * Matches the parts of a URL: + * 1. Scheme, including ":", guaranteed. + * 2. User/password, including "@", optional. + * 3. Host, guaranteed. + * 4. Port, including ":", optional. + * 5. Path, including "/", optional. + */ +const urlRegex = /^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?/; +/** + * File URLs are weird. They dont' need the regular `//` in the scheme, they may or may not start + * with a leading `/`, they can have a domain (but only if they don't start with a Windows drive). + * + * 1. Host, optional. + * 2. Path, which may inclue "/", guaranteed. + */ +const fileRegex = /^file:(?:\/\/((?![a-z]:)[^/]*)?)?(\/?.*)/i; +function isAbsoluteUrl(input) { + return schemeRegex.test(input); +} +function isSchemeRelativeUrl(input) { + return input.startsWith('//'); +} +function isAbsolutePath(input) { + return input.startsWith('/'); +} +function isFileUrl(input) { + return input.startsWith('file:'); +} +function parseAbsoluteUrl(input) { + const match = urlRegex.exec(input); + return makeUrl(match[1], match[2] || '', match[3], match[4] || '', match[5] || '/'); +} +function parseFileUrl(input) { + const match = fileRegex.exec(input); + const path = match[2]; + return makeUrl('file:', '', match[1] || '', '', isAbsolutePath(path) ? path : '/' + path); +} +function makeUrl(scheme, user, host, port, path) { + return { + scheme, + user, + host, + port, + path, + relativePath: false, + }; +} +function parseUrl(input) { + if (isSchemeRelativeUrl(input)) { + const url = parseAbsoluteUrl('http:' + input); + url.scheme = ''; + return url; + } + if (isAbsolutePath(input)) { + const url = parseAbsoluteUrl('http://foo.com' + input); + url.scheme = ''; + url.host = ''; + return url; + } + if (isFileUrl(input)) + return parseFileUrl(input); + if (isAbsoluteUrl(input)) + return parseAbsoluteUrl(input); + const url = parseAbsoluteUrl('http://foo.com/' + input); + url.scheme = ''; + url.host = ''; + url.relativePath = true; + return url; +} +function stripPathFilename(path) { + // If a path ends with a parent directory "..", then it's a relative path with excess parent + // paths. It's not a file, so we can't strip it. + if (path.endsWith('/..')) + return path; + const index = path.lastIndexOf('/'); + return path.slice(0, index + 1); +} +function mergePaths(url, base) { + // If we're not a relative path, then we're an absolute path, and it doesn't matter what base is. + if (!url.relativePath) + return; + normalizePath(base); + // If the path is just a "/", then it was an empty path to begin with (remember, we're a relative + // path). + if (url.path === '/') { + url.path = base.path; + } + else { + // Resolution happens relative to the base path's directory, not the file. + url.path = stripPathFilename(base.path) + url.path; + } + // If the base path is absolute, then our path is now absolute too. + url.relativePath = base.relativePath; +} +/** + * The path can have empty directories "//", unneeded parents "foo/..", or current directory + * "foo/.". We need to normalize to a standard representation. + */ +function normalizePath(url) { + const { relativePath } = url; + const pieces = url.path.split('/'); + // We need to preserve the first piece always, so that we output a leading slash. The item at + // pieces[0] is an empty string. + let pointer = 1; + // Positive is the number of real directories we've output, used for popping a parent directory. + // Eg, "foo/bar/.." will have a positive 2, and we can decrement to be left with just "foo". + let positive = 0; + // We need to keep a trailing slash if we encounter an empty directory (eg, splitting "foo/" will + // generate `["foo", ""]` pieces). And, if we pop a parent directory. But once we encounter a + // real directory, we won't need to append, unless the other conditions happen again. + let addTrailingSlash = false; + for (let i = 1; i < pieces.length; i++) { + const piece = pieces[i]; + // An empty directory, could be a trailing slash, or just a double "//" in the path. + if (!piece) { + addTrailingSlash = true; + continue; + } + // If we encounter a real directory, then we don't need to append anymore. + addTrailingSlash = false; + // A current directory, which we can always drop. + if (piece === '.') + continue; + // A parent directory, we need to see if there are any real directories we can pop. Else, we + // have an excess of parents, and we'll need to keep the "..". + if (piece === '..') { + if (positive) { + addTrailingSlash = true; + positive--; + pointer--; + } + else if (relativePath) { + // If we're in a relativePath, then we need to keep the excess parents. Else, in an absolute + // URL, protocol relative URL, or an absolute path, we don't need to keep excess. + pieces[pointer++] = piece; + } + continue; + } + // We've encountered a real directory. Move it to the next insertion pointer, which accounts for + // any popped or dropped directories. + pieces[pointer++] = piece; + positive++; + } + let path = ''; + for (let i = 1; i < pointer; i++) { + path += '/' + pieces[i]; + } + if (!path || (addTrailingSlash && !path.endsWith('/..'))) { + path += '/'; + } + url.path = path; +} +/** + * Attempts to resolve `input` URL/path relative to `base`. + */ +function resolve$1(input, base) { + if (!input && !base) + return ''; + const url = parseUrl(input); + // If we have a base, and the input isn't already an absolute URL, then we need to merge. + if (base && !url.scheme) { + const baseUrl = parseUrl(base); + url.scheme = baseUrl.scheme; + // If there's no host, then we were just a path. + if (!url.host) { + // The host, user, and port are joined, you can't copy one without the others. + url.user = baseUrl.user; + url.host = baseUrl.host; + url.port = baseUrl.port; + } + mergePaths(url, baseUrl); + } + normalizePath(url); + // If the input (and base, if there was one) are both relative, then we need to output a relative. + if (url.relativePath) { + // The first char is always a "/". + const path = url.path.slice(1); + if (!path) + return '.'; + // If base started with a leading ".", or there is no base and input started with a ".", then we + // need to ensure that the relative path starts with a ".". We don't know if relative starts + // with a "..", though, so check before prepending. + const keepRelative = (base || input).startsWith('.'); + return !keepRelative || path.startsWith('.') ? path : './' + path; + } + // If there's no host (and no scheme/user/port), then we need to output an absolute path. + if (!url.scheme && !url.host) + return url.path; + // We're outputting either an absolute URL, or a protocol relative one. + return `${url.scheme}//${url.user}${url.host}${url.port}${url.path}`; +} + +function resolve(input, base) { + // The base is always treated as a directory, if it's not empty. + // https://github.com/mozilla/source-map/blob/8cb3ee57/lib/util.js#L327 + // https://github.com/chromium/chromium/blob/da4adbb3/third_party/blink/renderer/devtools/front_end/sdk/SourceMap.js#L400-L401 + if (base && !base.endsWith('/')) + base += '/'; + return resolve$1(input, base); +} + +/** + * Removes everything after the last "/", but leaves the slash. + */ +function stripFilename(path) { + if (!path) + return ''; + const index = path.lastIndexOf('/'); + return path.slice(0, index + 1); +} + +const COLUMN$1 = 0; +const SOURCES_INDEX$1 = 1; +const SOURCE_LINE$1 = 2; +const SOURCE_COLUMN$1 = 3; +const NAMES_INDEX$1 = 4; + +function maybeSort(mappings, owned) { + const unsortedIndex = nextUnsortedSegmentLine(mappings, 0); + if (unsortedIndex === mappings.length) + return mappings; + // If we own the array (meaning we parsed it from JSON), then we're free to directly mutate it. If + // not, we do not want to modify the consumer's input array. + if (!owned) + mappings = mappings.slice(); + for (let i = unsortedIndex; i < mappings.length; i = nextUnsortedSegmentLine(mappings, i + 1)) { + mappings[i] = sortSegments(mappings[i], owned); + } + return mappings; +} +function nextUnsortedSegmentLine(mappings, start) { + for (let i = start; i < mappings.length; i++) { + if (!isSorted(mappings[i])) + return i; + } + return mappings.length; +} +function isSorted(line) { + for (let j = 1; j < line.length; j++) { + if (line[j][COLUMN$1] < line[j - 1][COLUMN$1]) { + return false; + } + } + return true; +} +function sortSegments(line, owned) { + if (!owned) + line = line.slice(); + return line.sort(sortComparator); +} +function sortComparator(a, b) { + return a[COLUMN$1] - b[COLUMN$1]; +} + +let found = false; +/** + * A binary search implementation that returns the index if a match is found. + * If no match is found, then the left-index (the index associated with the item that comes just + * before the desired index) is returned. To maintain proper sort order, a splice would happen at + * the next index: + * + * ```js + * const array = [1, 3]; + * const needle = 2; + * const index = binarySearch(array, needle, (item, needle) => item - needle); + * + * assert.equal(index, 0); + * array.splice(index + 1, 0, needle); + * assert.deepEqual(array, [1, 2, 3]); + * ``` + */ +function binarySearch(haystack, needle, low, high) { + while (low <= high) { + const mid = low + ((high - low) >> 1); + const cmp = haystack[mid][COLUMN$1] - needle; + if (cmp === 0) { + found = true; + return mid; + } + if (cmp < 0) { + low = mid + 1; + } + else { + high = mid - 1; + } + } + found = false; + return low - 1; +} +function upperBound(haystack, needle, index) { + for (let i = index + 1; i < haystack.length; i++, index++) { + if (haystack[i][COLUMN$1] !== needle) + break; + } + return index; +} +function lowerBound(haystack, needle, index) { + for (let i = index - 1; i >= 0; i--, index--) { + if (haystack[i][COLUMN$1] !== needle) + break; + } + return index; +} +function memoizedState() { + return { + lastKey: -1, + lastNeedle: -1, + lastIndex: -1, + }; +} +/** + * This overly complicated beast is just to record the last tested line/column and the resulting + * index, allowing us to skip a few tests if mappings are monotonically increasing. + */ +function memoizedBinarySearch(haystack, needle, state, key) { + const { lastKey, lastNeedle, lastIndex } = state; + let low = 0; + let high = haystack.length - 1; + if (key === lastKey) { + if (needle === lastNeedle) { + found = lastIndex !== -1 && haystack[lastIndex][COLUMN$1] === needle; + return lastIndex; + } + if (needle >= lastNeedle) { + // lastIndex may be -1 if the previous needle was not found. + low = lastIndex === -1 ? 0 : lastIndex; + } + else { + high = lastIndex; + } + } + state.lastKey = key; + state.lastNeedle = needle; + return (state.lastIndex = binarySearch(haystack, needle, low, high)); +} + +const AnyMap = function (map, mapUrl) { + const parsed = typeof map === 'string' ? JSON.parse(map) : map; + if (!('sections' in parsed)) + return new TraceMap(parsed, mapUrl); + const mappings = []; + const sources = []; + const sourcesContent = []; + const names = []; + const { sections } = parsed; + let i = 0; + for (; i < sections.length - 1; i++) { + const no = sections[i + 1].offset; + addSection(sections[i], mapUrl, mappings, sources, sourcesContent, names, no.line, no.column); + } + if (sections.length > 0) { + addSection(sections[i], mapUrl, mappings, sources, sourcesContent, names, Infinity, Infinity); + } + const joined = { + version: 3, + file: parsed.file, + names, + sources, + sourcesContent, + mappings, + }; + return presortedDecodedMap(joined); +}; +function addSection(section, mapUrl, mappings, sources, sourcesContent, names, stopLine, stopColumn) { + const map = AnyMap(section.map, mapUrl); + const { line: lineOffset, column: columnOffset } = section.offset; + const sourcesOffset = sources.length; + const namesOffset = names.length; + const decoded = decodedMappings(map); + const { resolvedSources } = map; + append(sources, resolvedSources); + append(sourcesContent, map.sourcesContent || fillSourcesContent(resolvedSources.length)); + append(names, map.names); + // If this section jumps forwards several lines, we need to add lines to the output mappings catch up. + for (let i = mappings.length; i <= lineOffset; i++) + mappings.push([]); + // We can only add so many lines before we step into the range that the next section's map + // controls. When we get to the last line, then we'll start checking the segments to see if + // they've crossed into the column range. + const stopI = stopLine - lineOffset; + const len = Math.min(decoded.length, stopI + 1); + for (let i = 0; i < len; i++) { + const line = decoded[i]; + // On the 0th loop, the line will already exist due to a previous section, or the line catch up + // loop above. + const out = i === 0 ? mappings[lineOffset] : (mappings[lineOffset + i] = []); + // On the 0th loop, the section's column offset shifts us forward. On all other lines (since the + // map can be multiple lines), it doesn't. + const cOffset = i === 0 ? columnOffset : 0; + for (let j = 0; j < line.length; j++) { + const seg = line[j]; + const column = cOffset + seg[COLUMN$1]; + // If this segment steps into the column range that the next section's map controls, we need + // to stop early. + if (i === stopI && column >= stopColumn) + break; + if (seg.length === 1) { + out.push([column]); + continue; + } + const sourcesIndex = sourcesOffset + seg[SOURCES_INDEX$1]; + const sourceLine = seg[SOURCE_LINE$1]; + const sourceColumn = seg[SOURCE_COLUMN$1]; + if (seg.length === 4) { + out.push([column, sourcesIndex, sourceLine, sourceColumn]); + continue; + } + out.push([column, sourcesIndex, sourceLine, sourceColumn, namesOffset + seg[NAMES_INDEX$1]]); + } + } +} +function append(arr, other) { + for (let i = 0; i < other.length; i++) + arr.push(other[i]); +} +// Sourcemaps don't need to have sourcesContent, and if they don't, we need to create an array of +// equal length to the sources. This is because the sources and sourcesContent are paired arrays, +// where `sourcesContent[i]` is the content of the `sources[i]` file. If we didn't, then joined +// sourcemap would desynchronize the sources/contents. +function fillSourcesContent(len) { + const sourcesContent = []; + for (let i = 0; i < len; i++) + sourcesContent[i] = null; + return sourcesContent; +} + +const INVALID_ORIGINAL_MAPPING = Object.freeze({ + source: null, + line: null, + column: null, + name: null, +}); +Object.freeze({ + line: null, + column: null, +}); +const LINE_GTR_ZERO = '`line` must be greater than 0 (lines start at line 1)'; +const COL_GTR_EQ_ZERO = '`column` must be greater than or equal to 0 (columns start at column 0)'; +const LEAST_UPPER_BOUND = -1; +const GREATEST_LOWER_BOUND = 1; +/** + * Returns the decoded (array of lines of segments) form of the SourceMap's mappings field. + */ +let decodedMappings; +/** + * A higher-level API to find the source/line/column associated with a generated line/column + * (think, from a stack trace). Line is 1-based, but column is 0-based, due to legacy behavior in + * `source-map` library. + */ +let originalPositionFor; +/** + * A helper that skips sorting of the input map's mappings array, which can be expensive for larger + * maps. + */ +let presortedDecodedMap; +class TraceMap { + constructor(map, mapUrl) { + this._decodedMemo = memoizedState(); + this._bySources = undefined; + this._bySourceMemos = undefined; + const isString = typeof map === 'string'; + if (!isString && map.constructor === TraceMap) + return map; + const parsed = (isString ? JSON.parse(map) : map); + const { version, file, names, sourceRoot, sources, sourcesContent } = parsed; + this.version = version; + this.file = file; + this.names = names; + this.sourceRoot = sourceRoot; + this.sources = sources; + this.sourcesContent = sourcesContent; + if (sourceRoot || mapUrl) { + const from = resolve(sourceRoot || '', stripFilename(mapUrl)); + this.resolvedSources = sources.map((s) => resolve(s || '', from)); + } + else { + this.resolvedSources = sources.map((s) => s || ''); + } + const { mappings } = parsed; + if (typeof mappings === 'string') { + this._encoded = mappings; + this._decoded = undefined; + } + else { + this._encoded = undefined; + this._decoded = maybeSort(mappings, isString); + } + } +} +(() => { + decodedMappings = (map) => { + return (map._decoded || (map._decoded = decode(map._encoded))); + }; + originalPositionFor = (map, { line, column, bias }) => { + line--; + if (line < 0) + throw new Error(LINE_GTR_ZERO); + if (column < 0) + throw new Error(COL_GTR_EQ_ZERO); + const decoded = decodedMappings(map); + // It's common for parent source maps to have pointers to lines that have no + // mapping (like a "//# sourceMappingURL=") at the end of the child file. + if (line >= decoded.length) + return INVALID_ORIGINAL_MAPPING; + const segment = traceSegmentInternal(decoded[line], map._decodedMemo, line, column, bias || GREATEST_LOWER_BOUND); + if (segment == null) + return INVALID_ORIGINAL_MAPPING; + if (segment.length == 1) + return INVALID_ORIGINAL_MAPPING; + const { names, resolvedSources } = map; + return { + source: resolvedSources[segment[SOURCES_INDEX$1]], + line: segment[SOURCE_LINE$1] + 1, + column: segment[SOURCE_COLUMN$1], + name: segment.length === 5 ? names[segment[NAMES_INDEX$1]] : null, + }; + }; + presortedDecodedMap = (map, mapUrl) => { + const clone = Object.assign({}, map); + clone.mappings = []; + const tracer = new TraceMap(clone, mapUrl); + tracer._decoded = map.mappings; + return tracer; + }; +})(); +function traceSegmentInternal(segments, memo, line, column, bias) { + let index = memoizedBinarySearch(segments, column, memo, line); + if (found) { + index = (bias === LEAST_UPPER_BOUND ? upperBound : lowerBound)(segments, column, index); + } + else if (bias === LEAST_UPPER_BOUND) + index++; + if (index === -1 || index === segments.length) + return null; + return segments[index]; +} + +/** + * Gets the index associated with `key` in the backing array, if it is already present. + */ +let get; +/** + * Puts `key` into the backing array, if it is not already present. Returns + * the index of the `key` in the backing array. + */ +let put; +/** + * SetArray acts like a `Set` (allowing only one occurrence of a string `key`), but provides the + * index of the `key` in the backing array. + * + * This is designed to allow synchronizing a second array with the contents of the backing array, + * like how in a sourcemap `sourcesContent[i]` is the source content associated with `source[i]`, + * and there are never duplicates. + */ +class SetArray { + constructor() { + this._indexes = { __proto__: null }; + this.array = []; + } +} +(() => { + get = (strarr, key) => strarr._indexes[key]; + put = (strarr, key) => { + // The key may or may not be present. If it is present, it's a number. + const index = get(strarr, key); + if (index !== undefined) + return index; + const { array, _indexes: indexes } = strarr; + return (indexes[key] = array.push(key) - 1); + }; +})(); + +const COLUMN = 0; +const SOURCES_INDEX = 1; +const SOURCE_LINE = 2; +const SOURCE_COLUMN = 3; +const NAMES_INDEX = 4; + +const NO_NAME = -1; +/** + * Same as `addMapping`, but will only add the mapping if it generates useful information in the + * resulting map. This only works correctly if mappings are added **in order**, meaning you should + * not add a mapping with a lower generated line/column than one that came before. + */ +let maybeAddMapping; +/** + * Adds/removes the content of the source file to the source map. + */ +let setSourceContent; +/** + * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects + * a sourcemap, or to JSON.stringify. + */ +let toDecodedMap; +/** + * Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects + * a sourcemap, or to JSON.stringify. + */ +let toEncodedMap; +// This split declaration is only so that terser can elminiate the static initialization block. +let addSegmentInternal; +/** + * Provides the state to generate a sourcemap. + */ +class GenMapping { + constructor({ file, sourceRoot } = {}) { + this._names = new SetArray(); + this._sources = new SetArray(); + this._sourcesContent = []; + this._mappings = []; + this.file = file; + this.sourceRoot = sourceRoot; + } +} +(() => { + maybeAddMapping = (map, mapping) => { + return addMappingInternal(true, map, mapping); + }; + setSourceContent = (map, source, content) => { + const { _sources: sources, _sourcesContent: sourcesContent } = map; + sourcesContent[put(sources, source)] = content; + }; + toDecodedMap = (map) => { + const { file, sourceRoot, _mappings: mappings, _sources: sources, _sourcesContent: sourcesContent, _names: names, } = map; + removeEmptyFinalLines(mappings); + return { + version: 3, + file: file || undefined, + names: names.array, + sourceRoot: sourceRoot || undefined, + sources: sources.array, + sourcesContent, + mappings, + }; + }; + toEncodedMap = (map) => { + const decoded = toDecodedMap(map); + return Object.assign(Object.assign({}, decoded), { mappings: encode(decoded.mappings) }); + }; + // Internal helpers + addSegmentInternal = (skipable, map, genLine, genColumn, source, sourceLine, sourceColumn, name) => { + const { _mappings: mappings, _sources: sources, _sourcesContent: sourcesContent, _names: names, } = map; + const line = getLine(mappings, genLine); + const index = getColumnIndex(line, genColumn); + if (!source) { + if (skipable && skipSourceless(line, index)) + return; + return insert(line, index, [genColumn]); + } + const sourcesIndex = put(sources, source); + const namesIndex = name ? put(names, name) : NO_NAME; + if (sourcesIndex === sourcesContent.length) + sourcesContent[sourcesIndex] = null; + if (skipable && skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex)) { + return; + } + return insert(line, index, name + ? [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex] + : [genColumn, sourcesIndex, sourceLine, sourceColumn]); + }; +})(); +function getLine(mappings, index) { + for (let i = mappings.length; i <= index; i++) { + mappings[i] = []; + } + return mappings[index]; +} +function getColumnIndex(line, genColumn) { + let index = line.length; + for (let i = index - 1; i >= 0; index = i--) { + const current = line[i]; + if (genColumn >= current[COLUMN]) + break; + } + return index; +} +function insert(array, index, value) { + for (let i = array.length; i > index; i--) { + array[i] = array[i - 1]; + } + array[index] = value; +} +function removeEmptyFinalLines(mappings) { + const { length } = mappings; + let len = length; + for (let i = len - 1; i >= 0; len = i, i--) { + if (mappings[i].length > 0) + break; + } + if (len < length) + mappings.length = len; +} +function skipSourceless(line, index) { + // The start of a line is already sourceless, so adding a sourceless segment to the beginning + // doesn't generate any useful information. + if (index === 0) + return true; + const prev = line[index - 1]; + // If the previous segment is also sourceless, then adding another sourceless segment doesn't + // genrate any new information. Else, this segment will end the source/named segment and point to + // a sourceless position, which is useful. + return prev.length === 1; +} +function skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex) { + // A source/named segment at the start of a line gives position at that genColumn + if (index === 0) + return false; + const prev = line[index - 1]; + // If the previous segment is sourceless, then we're transitioning to a source. + if (prev.length === 1) + return false; + // If the previous segment maps to the exact same source position, then this segment doesn't + // provide any new position information. + return (sourcesIndex === prev[SOURCES_INDEX] && + sourceLine === prev[SOURCE_LINE] && + sourceColumn === prev[SOURCE_COLUMN] && + namesIndex === (prev.length === 5 ? prev[NAMES_INDEX] : NO_NAME)); +} +function addMappingInternal(skipable, map, mapping) { + const { generated, source, original, name } = mapping; + if (!source) { + return addSegmentInternal(skipable, map, generated.line - 1, generated.column, null, null, null, null); + } + const s = source; + return addSegmentInternal(skipable, map, generated.line - 1, generated.column, s, original.line - 1, original.column, name); +} + +class SourceMapConsumer { + constructor(map, mapUrl) { + const trace = (this._map = new AnyMap(map, mapUrl)); + this.file = trace.file; + this.names = trace.names; + this.sourceRoot = trace.sourceRoot; + this.sources = trace.resolvedSources; + this.sourcesContent = trace.sourcesContent; + } + originalPositionFor(needle) { + return originalPositionFor(this._map, needle); + } + destroy() { + // noop. + } +} +class SourceMapGenerator { + constructor(opts) { + this._map = new GenMapping(opts); + } + addMapping(mapping) { + maybeAddMapping(this._map, mapping); + } + setSourceContent(source, content) { + setSourceContent(this._map, source, content); + } + toJSON() { + return toEncodedMap(this._map); + } + toDecodedMap() { + return toDecodedMap(this._map); + } +} + +export { SourceMapConsumer, SourceMapGenerator }; +//# sourceMappingURL=source-map.mjs.map diff --git a/node_modules/@jridgewell/source-map/dist/source-map.mjs.map b/node_modules/@jridgewell/source-map/dist/source-map.mjs.map new file mode 100644 index 0000000..82b6484 --- /dev/null +++ b/node_modules/@jridgewell/source-map/dist/source-map.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"source-map.mjs","sources":["../node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs","../node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs","../node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs","../node_modules/@jridgewell/set-array/dist/set-array.mjs","../node_modules/@jridgewell/gen-mapping/dist/gen-mapping.mjs","../../src/source-map.ts"],"sourcesContent":["const comma = ','.charCodeAt(0);\nconst semicolon = ';'.charCodeAt(0);\nconst chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\nconst intToChar = new Uint8Array(64); // 64 possible chars.\nconst charToInteger = new Uint8Array(128); // z is 122 in ASCII\nfor (let i = 0; i < chars.length; i++) {\n const c = chars.charCodeAt(i);\n charToInteger[c] = i;\n intToChar[i] = c;\n}\n// Provide a fallback for older environments.\nconst td = typeof TextDecoder !== 'undefined'\n ? new TextDecoder()\n : typeof Buffer !== 'undefined'\n ? {\n decode(buf) {\n const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength);\n return out.toString();\n },\n }\n : {\n decode(buf) {\n let out = '';\n for (let i = 0; i < buf.length; i++) {\n out += String.fromCharCode(buf[i]);\n }\n return out;\n },\n };\nfunction decode(mappings) {\n const state = new Int32Array(5);\n const decoded = [];\n let line = [];\n let sorted = true;\n let lastCol = 0;\n for (let i = 0; i < mappings.length;) {\n const c = mappings.charCodeAt(i);\n if (c === comma) {\n i++;\n }\n else if (c === semicolon) {\n state[0] = lastCol = 0;\n if (!sorted)\n sort(line);\n sorted = true;\n decoded.push(line);\n line = [];\n i++;\n }\n else {\n i = decodeInteger(mappings, i, state, 0); // generatedCodeColumn\n const col = state[0];\n if (col < lastCol)\n sorted = false;\n lastCol = col;\n if (!hasMoreSegments(mappings, i)) {\n line.push([col]);\n continue;\n }\n i = decodeInteger(mappings, i, state, 1); // sourceFileIndex\n i = decodeInteger(mappings, i, state, 2); // sourceCodeLine\n i = decodeInteger(mappings, i, state, 3); // sourceCodeColumn\n if (!hasMoreSegments(mappings, i)) {\n line.push([col, state[1], state[2], state[3]]);\n continue;\n }\n i = decodeInteger(mappings, i, state, 4); // nameIndex\n line.push([col, state[1], state[2], state[3], state[4]]);\n }\n }\n if (!sorted)\n sort(line);\n decoded.push(line);\n return decoded;\n}\nfunction decodeInteger(mappings, pos, state, j) {\n let value = 0;\n let shift = 0;\n let integer = 0;\n do {\n const c = mappings.charCodeAt(pos++);\n integer = charToInteger[c];\n value |= (integer & 31) << shift;\n shift += 5;\n } while (integer & 32);\n const shouldNegate = value & 1;\n value >>>= 1;\n if (shouldNegate) {\n value = -0x80000000 | -value;\n }\n state[j] += value;\n return pos;\n}\nfunction hasMoreSegments(mappings, i) {\n if (i >= mappings.length)\n return false;\n const c = mappings.charCodeAt(i);\n if (c === comma || c === semicolon)\n return false;\n return true;\n}\nfunction sort(line) {\n line.sort(sortComparator);\n}\nfunction sortComparator(a, b) {\n return a[0] - b[0];\n}\nfunction encode(decoded) {\n const state = new Int32Array(5);\n let buf = new Uint8Array(1024);\n let pos = 0;\n for (let i = 0; i < decoded.length; i++) {\n const line = decoded[i];\n if (i > 0) {\n buf = reserve(buf, pos, 1);\n buf[pos++] = semicolon;\n }\n if (line.length === 0)\n continue;\n state[0] = 0;\n for (let j = 0; j < line.length; j++) {\n const segment = line[j];\n // We can push up to 5 ints, each int can take at most 7 chars, and we\n // may push a comma.\n buf = reserve(buf, pos, 36);\n if (j > 0)\n buf[pos++] = comma;\n pos = encodeInteger(buf, pos, state, segment, 0); // generatedCodeColumn\n if (segment.length === 1)\n continue;\n pos = encodeInteger(buf, pos, state, segment, 1); // sourceFileIndex\n pos = encodeInteger(buf, pos, state, segment, 2); // sourceCodeLine\n pos = encodeInteger(buf, pos, state, segment, 3); // sourceCodeColumn\n if (segment.length === 4)\n continue;\n pos = encodeInteger(buf, pos, state, segment, 4); // nameIndex\n }\n }\n return td.decode(buf.subarray(0, pos));\n}\nfunction reserve(buf, pos, count) {\n if (buf.length > pos + count)\n return buf;\n const swap = new Uint8Array(buf.length * 2);\n swap.set(buf);\n return swap;\n}\nfunction encodeInteger(buf, pos, state, segment, j) {\n const next = segment[j];\n let num = next - state[j];\n state[j] = next;\n num = num < 0 ? (-num << 1) | 1 : num << 1;\n do {\n let clamped = num & 0b011111;\n num >>>= 5;\n if (num > 0)\n clamped |= 0b100000;\n buf[pos++] = intToChar[clamped];\n } while (num > 0);\n return pos;\n}\n\nexport { decode, encode };\n//# sourceMappingURL=sourcemap-codec.mjs.map\n","// Matches the scheme of a URL, eg \"http://\"\nconst schemeRegex = /^[\\w+.-]+:\\/\\//;\n/**\n * Matches the parts of a URL:\n * 1. Scheme, including \":\", guaranteed.\n * 2. User/password, including \"@\", optional.\n * 3. Host, guaranteed.\n * 4. Port, including \":\", optional.\n * 5. Path, including \"/\", optional.\n */\nconst urlRegex = /^([\\w+.-]+:)\\/\\/([^@/#?]*@)?([^:/#?]*)(:\\d+)?(\\/[^#?]*)?/;\n/**\n * File URLs are weird. They dont' need the regular `//` in the scheme, they may or may not start\n * with a leading `/`, they can have a domain (but only if they don't start with a Windows drive).\n *\n * 1. Host, optional.\n * 2. Path, which may inclue \"/\", guaranteed.\n */\nconst fileRegex = /^file:(?:\\/\\/((?![a-z]:)[^/]*)?)?(\\/?.*)/i;\nfunction isAbsoluteUrl(input) {\n return schemeRegex.test(input);\n}\nfunction isSchemeRelativeUrl(input) {\n return input.startsWith('//');\n}\nfunction isAbsolutePath(input) {\n return input.startsWith('/');\n}\nfunction isFileUrl(input) {\n return input.startsWith('file:');\n}\nfunction parseAbsoluteUrl(input) {\n const match = urlRegex.exec(input);\n return makeUrl(match[1], match[2] || '', match[3], match[4] || '', match[5] || '/');\n}\nfunction parseFileUrl(input) {\n const match = fileRegex.exec(input);\n const path = match[2];\n return makeUrl('file:', '', match[1] || '', '', isAbsolutePath(path) ? path : '/' + path);\n}\nfunction makeUrl(scheme, user, host, port, path) {\n return {\n scheme,\n user,\n host,\n port,\n path,\n relativePath: false,\n };\n}\nfunction parseUrl(input) {\n if (isSchemeRelativeUrl(input)) {\n const url = parseAbsoluteUrl('http:' + input);\n url.scheme = '';\n return url;\n }\n if (isAbsolutePath(input)) {\n const url = parseAbsoluteUrl('http://foo.com' + input);\n url.scheme = '';\n url.host = '';\n return url;\n }\n if (isFileUrl(input))\n return parseFileUrl(input);\n if (isAbsoluteUrl(input))\n return parseAbsoluteUrl(input);\n const url = parseAbsoluteUrl('http://foo.com/' + input);\n url.scheme = '';\n url.host = '';\n url.relativePath = true;\n return url;\n}\nfunction stripPathFilename(path) {\n // If a path ends with a parent directory \"..\", then it's a relative path with excess parent\n // paths. It's not a file, so we can't strip it.\n if (path.endsWith('/..'))\n return path;\n const index = path.lastIndexOf('/');\n return path.slice(0, index + 1);\n}\nfunction mergePaths(url, base) {\n // If we're not a relative path, then we're an absolute path, and it doesn't matter what base is.\n if (!url.relativePath)\n return;\n normalizePath(base);\n // If the path is just a \"/\", then it was an empty path to begin with (remember, we're a relative\n // path).\n if (url.path === '/') {\n url.path = base.path;\n }\n else {\n // Resolution happens relative to the base path's directory, not the file.\n url.path = stripPathFilename(base.path) + url.path;\n }\n // If the base path is absolute, then our path is now absolute too.\n url.relativePath = base.relativePath;\n}\n/**\n * The path can have empty directories \"//\", unneeded parents \"foo/..\", or current directory\n * \"foo/.\". We need to normalize to a standard representation.\n */\nfunction normalizePath(url) {\n const { relativePath } = url;\n const pieces = url.path.split('/');\n // We need to preserve the first piece always, so that we output a leading slash. The item at\n // pieces[0] is an empty string.\n let pointer = 1;\n // Positive is the number of real directories we've output, used for popping a parent directory.\n // Eg, \"foo/bar/..\" will have a positive 2, and we can decrement to be left with just \"foo\".\n let positive = 0;\n // We need to keep a trailing slash if we encounter an empty directory (eg, splitting \"foo/\" will\n // generate `[\"foo\", \"\"]` pieces). And, if we pop a parent directory. But once we encounter a\n // real directory, we won't need to append, unless the other conditions happen again.\n let addTrailingSlash = false;\n for (let i = 1; i < pieces.length; i++) {\n const piece = pieces[i];\n // An empty directory, could be a trailing slash, or just a double \"//\" in the path.\n if (!piece) {\n addTrailingSlash = true;\n continue;\n }\n // If we encounter a real directory, then we don't need to append anymore.\n addTrailingSlash = false;\n // A current directory, which we can always drop.\n if (piece === '.')\n continue;\n // A parent directory, we need to see if there are any real directories we can pop. Else, we\n // have an excess of parents, and we'll need to keep the \"..\".\n if (piece === '..') {\n if (positive) {\n addTrailingSlash = true;\n positive--;\n pointer--;\n }\n else if (relativePath) {\n // If we're in a relativePath, then we need to keep the excess parents. Else, in an absolute\n // URL, protocol relative URL, or an absolute path, we don't need to keep excess.\n pieces[pointer++] = piece;\n }\n continue;\n }\n // We've encountered a real directory. Move it to the next insertion pointer, which accounts for\n // any popped or dropped directories.\n pieces[pointer++] = piece;\n positive++;\n }\n let path = '';\n for (let i = 1; i < pointer; i++) {\n path += '/' + pieces[i];\n }\n if (!path || (addTrailingSlash && !path.endsWith('/..'))) {\n path += '/';\n }\n url.path = path;\n}\n/**\n * Attempts to resolve `input` URL/path relative to `base`.\n */\nfunction resolve(input, base) {\n if (!input && !base)\n return '';\n const url = parseUrl(input);\n // If we have a base, and the input isn't already an absolute URL, then we need to merge.\n if (base && !url.scheme) {\n const baseUrl = parseUrl(base);\n url.scheme = baseUrl.scheme;\n // If there's no host, then we were just a path.\n if (!url.host) {\n // The host, user, and port are joined, you can't copy one without the others.\n url.user = baseUrl.user;\n url.host = baseUrl.host;\n url.port = baseUrl.port;\n }\n mergePaths(url, baseUrl);\n }\n normalizePath(url);\n // If the input (and base, if there was one) are both relative, then we need to output a relative.\n if (url.relativePath) {\n // The first char is always a \"/\".\n const path = url.path.slice(1);\n if (!path)\n return '.';\n // If base started with a leading \".\", or there is no base and input started with a \".\", then we\n // need to ensure that the relative path starts with a \".\". We don't know if relative starts\n // with a \"..\", though, so check before prepending.\n const keepRelative = (base || input).startsWith('.');\n return !keepRelative || path.startsWith('.') ? path : './' + path;\n }\n // If there's no host (and no scheme/user/port), then we need to output an absolute path.\n if (!url.scheme && !url.host)\n return url.path;\n // We're outputting either an absolute URL, or a protocol relative one.\n return `${url.scheme}//${url.user}${url.host}${url.port}${url.path}`;\n}\n\nexport { resolve as default };\n//# sourceMappingURL=resolve-uri.mjs.map\n","import { encode, decode } from '@jridgewell/sourcemap-codec';\nimport resolveUri from '@jridgewell/resolve-uri';\n\nfunction resolve(input, base) {\n // The base is always treated as a directory, if it's not empty.\n // https://github.com/mozilla/source-map/blob/8cb3ee57/lib/util.js#L327\n // https://github.com/chromium/chromium/blob/da4adbb3/third_party/blink/renderer/devtools/front_end/sdk/SourceMap.js#L400-L401\n if (base && !base.endsWith('/'))\n base += '/';\n return resolveUri(input, base);\n}\n\n/**\n * Removes everything after the last \"/\", but leaves the slash.\n */\nfunction stripFilename(path) {\n if (!path)\n return '';\n const index = path.lastIndexOf('/');\n return path.slice(0, index + 1);\n}\n\nconst COLUMN = 0;\nconst SOURCES_INDEX = 1;\nconst SOURCE_LINE = 2;\nconst SOURCE_COLUMN = 3;\nconst NAMES_INDEX = 4;\nconst REV_GENERATED_LINE = 1;\nconst REV_GENERATED_COLUMN = 2;\n\nfunction maybeSort(mappings, owned) {\n const unsortedIndex = nextUnsortedSegmentLine(mappings, 0);\n if (unsortedIndex === mappings.length)\n return mappings;\n // If we own the array (meaning we parsed it from JSON), then we're free to directly mutate it. If\n // not, we do not want to modify the consumer's input array.\n if (!owned)\n mappings = mappings.slice();\n for (let i = unsortedIndex; i < mappings.length; i = nextUnsortedSegmentLine(mappings, i + 1)) {\n mappings[i] = sortSegments(mappings[i], owned);\n }\n return mappings;\n}\nfunction nextUnsortedSegmentLine(mappings, start) {\n for (let i = start; i < mappings.length; i++) {\n if (!isSorted(mappings[i]))\n return i;\n }\n return mappings.length;\n}\nfunction isSorted(line) {\n for (let j = 1; j < line.length; j++) {\n if (line[j][COLUMN] < line[j - 1][COLUMN]) {\n return false;\n }\n }\n return true;\n}\nfunction sortSegments(line, owned) {\n if (!owned)\n line = line.slice();\n return line.sort(sortComparator);\n}\nfunction sortComparator(a, b) {\n return a[COLUMN] - b[COLUMN];\n}\n\nlet found = false;\n/**\n * A binary search implementation that returns the index if a match is found.\n * If no match is found, then the left-index (the index associated with the item that comes just\n * before the desired index) is returned. To maintain proper sort order, a splice would happen at\n * the next index:\n *\n * ```js\n * const array = [1, 3];\n * const needle = 2;\n * const index = binarySearch(array, needle, (item, needle) => item - needle);\n *\n * assert.equal(index, 0);\n * array.splice(index + 1, 0, needle);\n * assert.deepEqual(array, [1, 2, 3]);\n * ```\n */\nfunction binarySearch(haystack, needle, low, high) {\n while (low <= high) {\n const mid = low + ((high - low) >> 1);\n const cmp = haystack[mid][COLUMN] - needle;\n if (cmp === 0) {\n found = true;\n return mid;\n }\n if (cmp < 0) {\n low = mid + 1;\n }\n else {\n high = mid - 1;\n }\n }\n found = false;\n return low - 1;\n}\nfunction upperBound(haystack, needle, index) {\n for (let i = index + 1; i < haystack.length; i++, index++) {\n if (haystack[i][COLUMN] !== needle)\n break;\n }\n return index;\n}\nfunction lowerBound(haystack, needle, index) {\n for (let i = index - 1; i >= 0; i--, index--) {\n if (haystack[i][COLUMN] !== needle)\n break;\n }\n return index;\n}\nfunction memoizedState() {\n return {\n lastKey: -1,\n lastNeedle: -1,\n lastIndex: -1,\n };\n}\n/**\n * This overly complicated beast is just to record the last tested line/column and the resulting\n * index, allowing us to skip a few tests if mappings are monotonically increasing.\n */\nfunction memoizedBinarySearch(haystack, needle, state, key) {\n const { lastKey, lastNeedle, lastIndex } = state;\n let low = 0;\n let high = haystack.length - 1;\n if (key === lastKey) {\n if (needle === lastNeedle) {\n found = lastIndex !== -1 && haystack[lastIndex][COLUMN] === needle;\n return lastIndex;\n }\n if (needle >= lastNeedle) {\n // lastIndex may be -1 if the previous needle was not found.\n low = lastIndex === -1 ? 0 : lastIndex;\n }\n else {\n high = lastIndex;\n }\n }\n state.lastKey = key;\n state.lastNeedle = needle;\n return (state.lastIndex = binarySearch(haystack, needle, low, high));\n}\n\n// Rebuilds the original source files, with mappings that are ordered by source line/column instead\n// of generated line/column.\nfunction buildBySources(decoded, memos) {\n const sources = memos.map(buildNullArray);\n for (let i = 0; i < decoded.length; i++) {\n const line = decoded[i];\n for (let j = 0; j < line.length; j++) {\n const seg = line[j];\n if (seg.length === 1)\n continue;\n const sourceIndex = seg[SOURCES_INDEX];\n const sourceLine = seg[SOURCE_LINE];\n const sourceColumn = seg[SOURCE_COLUMN];\n const originalSource = sources[sourceIndex];\n const originalLine = (originalSource[sourceLine] || (originalSource[sourceLine] = []));\n const memo = memos[sourceIndex];\n // The binary search either found a match, or it found the left-index just before where the\n // segment should go. Either way, we want to insert after that. And there may be multiple\n // generated segments associated with an original location, so there may need to move several\n // indexes before we find where we need to insert.\n const index = upperBound(originalLine, sourceColumn, memoizedBinarySearch(originalLine, sourceColumn, memo, sourceLine));\n insert(originalLine, (memo.lastIndex = index + 1), [sourceColumn, i, seg[COLUMN]]);\n }\n }\n return sources;\n}\nfunction insert(array, index, value) {\n for (let i = array.length; i > index; i--) {\n array[i] = array[i - 1];\n }\n array[index] = value;\n}\n// Null arrays allow us to use ordered index keys without actually allocating contiguous memory like\n// a real array. We use a null-prototype object to avoid prototype pollution and deoptimizations.\n// Numeric properties on objects are magically sorted in ascending order by the engine regardless of\n// the insertion order. So, by setting any numeric keys, even out of order, we'll get ascending\n// order when iterating with for-in.\nfunction buildNullArray() {\n return { __proto__: null };\n}\n\nconst AnyMap = function (map, mapUrl) {\n const parsed = typeof map === 'string' ? JSON.parse(map) : map;\n if (!('sections' in parsed))\n return new TraceMap(parsed, mapUrl);\n const mappings = [];\n const sources = [];\n const sourcesContent = [];\n const names = [];\n const { sections } = parsed;\n let i = 0;\n for (; i < sections.length - 1; i++) {\n const no = sections[i + 1].offset;\n addSection(sections[i], mapUrl, mappings, sources, sourcesContent, names, no.line, no.column);\n }\n if (sections.length > 0) {\n addSection(sections[i], mapUrl, mappings, sources, sourcesContent, names, Infinity, Infinity);\n }\n const joined = {\n version: 3,\n file: parsed.file,\n names,\n sources,\n sourcesContent,\n mappings,\n };\n return presortedDecodedMap(joined);\n};\nfunction addSection(section, mapUrl, mappings, sources, sourcesContent, names, stopLine, stopColumn) {\n const map = AnyMap(section.map, mapUrl);\n const { line: lineOffset, column: columnOffset } = section.offset;\n const sourcesOffset = sources.length;\n const namesOffset = names.length;\n const decoded = decodedMappings(map);\n const { resolvedSources } = map;\n append(sources, resolvedSources);\n append(sourcesContent, map.sourcesContent || fillSourcesContent(resolvedSources.length));\n append(names, map.names);\n // If this section jumps forwards several lines, we need to add lines to the output mappings catch up.\n for (let i = mappings.length; i <= lineOffset; i++)\n mappings.push([]);\n // We can only add so many lines before we step into the range that the next section's map\n // controls. When we get to the last line, then we'll start checking the segments to see if\n // they've crossed into the column range.\n const stopI = stopLine - lineOffset;\n const len = Math.min(decoded.length, stopI + 1);\n for (let i = 0; i < len; i++) {\n const line = decoded[i];\n // On the 0th loop, the line will already exist due to a previous section, or the line catch up\n // loop above.\n const out = i === 0 ? mappings[lineOffset] : (mappings[lineOffset + i] = []);\n // On the 0th loop, the section's column offset shifts us forward. On all other lines (since the\n // map can be multiple lines), it doesn't.\n const cOffset = i === 0 ? columnOffset : 0;\n for (let j = 0; j < line.length; j++) {\n const seg = line[j];\n const column = cOffset + seg[COLUMN];\n // If this segment steps into the column range that the next section's map controls, we need\n // to stop early.\n if (i === stopI && column >= stopColumn)\n break;\n if (seg.length === 1) {\n out.push([column]);\n continue;\n }\n const sourcesIndex = sourcesOffset + seg[SOURCES_INDEX];\n const sourceLine = seg[SOURCE_LINE];\n const sourceColumn = seg[SOURCE_COLUMN];\n if (seg.length === 4) {\n out.push([column, sourcesIndex, sourceLine, sourceColumn]);\n continue;\n }\n out.push([column, sourcesIndex, sourceLine, sourceColumn, namesOffset + seg[NAMES_INDEX]]);\n }\n }\n}\nfunction append(arr, other) {\n for (let i = 0; i < other.length; i++)\n arr.push(other[i]);\n}\n// Sourcemaps don't need to have sourcesContent, and if they don't, we need to create an array of\n// equal length to the sources. This is because the sources and sourcesContent are paired arrays,\n// where `sourcesContent[i]` is the content of the `sources[i]` file. If we didn't, then joined\n// sourcemap would desynchronize the sources/contents.\nfunction fillSourcesContent(len) {\n const sourcesContent = [];\n for (let i = 0; i < len; i++)\n sourcesContent[i] = null;\n return sourcesContent;\n}\n\nconst INVALID_ORIGINAL_MAPPING = Object.freeze({\n source: null,\n line: null,\n column: null,\n name: null,\n});\nconst INVALID_GENERATED_MAPPING = Object.freeze({\n line: null,\n column: null,\n});\nconst LINE_GTR_ZERO = '`line` must be greater than 0 (lines start at line 1)';\nconst COL_GTR_EQ_ZERO = '`column` must be greater than or equal to 0 (columns start at column 0)';\nconst LEAST_UPPER_BOUND = -1;\nconst GREATEST_LOWER_BOUND = 1;\n/**\n * Returns the encoded (VLQ string) form of the SourceMap's mappings field.\n */\nlet encodedMappings;\n/**\n * Returns the decoded (array of lines of segments) form of the SourceMap's mappings field.\n */\nlet decodedMappings;\n/**\n * A low-level API to find the segment associated with a generated line/column (think, from a\n * stack trace). Line and column here are 0-based, unlike `originalPositionFor`.\n */\nlet traceSegment;\n/**\n * A higher-level API to find the source/line/column associated with a generated line/column\n * (think, from a stack trace). Line is 1-based, but column is 0-based, due to legacy behavior in\n * `source-map` library.\n */\nlet originalPositionFor;\n/**\n * Finds the source/line/column directly after the mapping returned by originalPositionFor, provided\n * the found mapping is from the same source and line as the originalPositionFor mapping.\n *\n * Eg, in the code `let id = 1`, `originalPositionAfter` could find the mapping associated with `1`\n * using the same needle that would return `id` when calling `originalPositionFor`.\n */\nlet generatedPositionFor;\n/**\n * Iterates each mapping in generated position order.\n */\nlet eachMapping;\n/**\n * A helper that skips sorting of the input map's mappings array, which can be expensive for larger\n * maps.\n */\nlet presortedDecodedMap;\n/**\n * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects\n * a sourcemap, or to JSON.stringify.\n */\nlet decodedMap;\n/**\n * Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects\n * a sourcemap, or to JSON.stringify.\n */\nlet encodedMap;\nclass TraceMap {\n constructor(map, mapUrl) {\n this._decodedMemo = memoizedState();\n this._bySources = undefined;\n this._bySourceMemos = undefined;\n const isString = typeof map === 'string';\n if (!isString && map.constructor === TraceMap)\n return map;\n const parsed = (isString ? JSON.parse(map) : map);\n const { version, file, names, sourceRoot, sources, sourcesContent } = parsed;\n this.version = version;\n this.file = file;\n this.names = names;\n this.sourceRoot = sourceRoot;\n this.sources = sources;\n this.sourcesContent = sourcesContent;\n if (sourceRoot || mapUrl) {\n const from = resolve(sourceRoot || '', stripFilename(mapUrl));\n this.resolvedSources = sources.map((s) => resolve(s || '', from));\n }\n else {\n this.resolvedSources = sources.map((s) => s || '');\n }\n const { mappings } = parsed;\n if (typeof mappings === 'string') {\n this._encoded = mappings;\n this._decoded = undefined;\n }\n else {\n this._encoded = undefined;\n this._decoded = maybeSort(mappings, isString);\n }\n }\n}\n(() => {\n encodedMappings = (map) => {\n var _a;\n return ((_a = map._encoded) !== null && _a !== void 0 ? _a : (map._encoded = encode(map._decoded)));\n };\n decodedMappings = (map) => {\n return (map._decoded || (map._decoded = decode(map._encoded)));\n };\n traceSegment = (map, line, column) => {\n const decoded = decodedMappings(map);\n // It's common for parent source maps to have pointers to lines that have no\n // mapping (like a \"//# sourceMappingURL=\") at the end of the child file.\n if (line >= decoded.length)\n return null;\n return traceSegmentInternal(decoded[line], map._decodedMemo, line, column, GREATEST_LOWER_BOUND);\n };\n originalPositionFor = (map, { line, column, bias }) => {\n line--;\n if (line < 0)\n throw new Error(LINE_GTR_ZERO);\n if (column < 0)\n throw new Error(COL_GTR_EQ_ZERO);\n const decoded = decodedMappings(map);\n // It's common for parent source maps to have pointers to lines that have no\n // mapping (like a \"//# sourceMappingURL=\") at the end of the child file.\n if (line >= decoded.length)\n return INVALID_ORIGINAL_MAPPING;\n const segment = traceSegmentInternal(decoded[line], map._decodedMemo, line, column, bias || GREATEST_LOWER_BOUND);\n if (segment == null)\n return INVALID_ORIGINAL_MAPPING;\n if (segment.length == 1)\n return INVALID_ORIGINAL_MAPPING;\n const { names, resolvedSources } = map;\n return {\n source: resolvedSources[segment[SOURCES_INDEX]],\n line: segment[SOURCE_LINE] + 1,\n column: segment[SOURCE_COLUMN],\n name: segment.length === 5 ? names[segment[NAMES_INDEX]] : null,\n };\n };\n generatedPositionFor = (map, { source, line, column, bias }) => {\n line--;\n if (line < 0)\n throw new Error(LINE_GTR_ZERO);\n if (column < 0)\n throw new Error(COL_GTR_EQ_ZERO);\n const { sources, resolvedSources } = map;\n let sourceIndex = sources.indexOf(source);\n if (sourceIndex === -1)\n sourceIndex = resolvedSources.indexOf(source);\n if (sourceIndex === -1)\n return INVALID_GENERATED_MAPPING;\n const generated = (map._bySources || (map._bySources = buildBySources(decodedMappings(map), (map._bySourceMemos = sources.map(memoizedState)))));\n const memos = map._bySourceMemos;\n const segments = generated[sourceIndex][line];\n if (segments == null)\n return INVALID_GENERATED_MAPPING;\n const segment = traceSegmentInternal(segments, memos[sourceIndex], line, column, bias || GREATEST_LOWER_BOUND);\n if (segment == null)\n return INVALID_GENERATED_MAPPING;\n return {\n line: segment[REV_GENERATED_LINE] + 1,\n column: segment[REV_GENERATED_COLUMN],\n };\n };\n eachMapping = (map, cb) => {\n const decoded = decodedMappings(map);\n const { names, resolvedSources } = map;\n for (let i = 0; i < decoded.length; i++) {\n const line = decoded[i];\n for (let j = 0; j < line.length; j++) {\n const seg = line[j];\n const generatedLine = i + 1;\n const generatedColumn = seg[0];\n let source = null;\n let originalLine = null;\n let originalColumn = null;\n let name = null;\n if (seg.length !== 1) {\n source = resolvedSources[seg[1]];\n originalLine = seg[2] + 1;\n originalColumn = seg[3];\n }\n if (seg.length === 5)\n name = names[seg[4]];\n cb({\n generatedLine,\n generatedColumn,\n source,\n originalLine,\n originalColumn,\n name,\n });\n }\n }\n };\n presortedDecodedMap = (map, mapUrl) => {\n const clone = Object.assign({}, map);\n clone.mappings = [];\n const tracer = new TraceMap(clone, mapUrl);\n tracer._decoded = map.mappings;\n return tracer;\n };\n decodedMap = (map) => {\n return {\n version: 3,\n file: map.file,\n names: map.names,\n sourceRoot: map.sourceRoot,\n sources: map.sources,\n sourcesContent: map.sourcesContent,\n mappings: decodedMappings(map),\n };\n };\n encodedMap = (map) => {\n return {\n version: 3,\n file: map.file,\n names: map.names,\n sourceRoot: map.sourceRoot,\n sources: map.sources,\n sourcesContent: map.sourcesContent,\n mappings: encodedMappings(map),\n };\n };\n})();\nfunction traceSegmentInternal(segments, memo, line, column, bias) {\n let index = memoizedBinarySearch(segments, column, memo, line);\n if (found) {\n index = (bias === LEAST_UPPER_BOUND ? upperBound : lowerBound)(segments, column, index);\n }\n else if (bias === LEAST_UPPER_BOUND)\n index++;\n if (index === -1 || index === segments.length)\n return null;\n return segments[index];\n}\n\nexport { AnyMap, GREATEST_LOWER_BOUND, LEAST_UPPER_BOUND, TraceMap, decodedMap, decodedMappings, eachMapping, encodedMap, encodedMappings, generatedPositionFor, originalPositionFor, presortedDecodedMap, traceSegment };\n//# sourceMappingURL=trace-mapping.mjs.map\n","/**\n * Gets the index associated with `key` in the backing array, if it is already present.\n */\nlet get;\n/**\n * Puts `key` into the backing array, if it is not already present. Returns\n * the index of the `key` in the backing array.\n */\nlet put;\n/**\n * Pops the last added item out of the SetArray.\n */\nlet pop;\n/**\n * SetArray acts like a `Set` (allowing only one occurrence of a string `key`), but provides the\n * index of the `key` in the backing array.\n *\n * This is designed to allow synchronizing a second array with the contents of the backing array,\n * like how in a sourcemap `sourcesContent[i]` is the source content associated with `source[i]`,\n * and there are never duplicates.\n */\nclass SetArray {\n constructor() {\n this._indexes = { __proto__: null };\n this.array = [];\n }\n}\n(() => {\n get = (strarr, key) => strarr._indexes[key];\n put = (strarr, key) => {\n // The key may or may not be present. If it is present, it's a number.\n const index = get(strarr, key);\n if (index !== undefined)\n return index;\n const { array, _indexes: indexes } = strarr;\n return (indexes[key] = array.push(key) - 1);\n };\n pop = (strarr) => {\n const { array, _indexes: indexes } = strarr;\n if (array.length === 0)\n return;\n const last = array.pop();\n indexes[last] = undefined;\n };\n})();\n\nexport { SetArray, get, pop, put };\n//# sourceMappingURL=set-array.mjs.map\n","import { SetArray, put } from '@jridgewell/set-array';\nimport { encode } from '@jridgewell/sourcemap-codec';\nimport { TraceMap, decodedMappings } from '@jridgewell/trace-mapping';\n\nconst COLUMN = 0;\nconst SOURCES_INDEX = 1;\nconst SOURCE_LINE = 2;\nconst SOURCE_COLUMN = 3;\nconst NAMES_INDEX = 4;\n\nconst NO_NAME = -1;\n/**\n * A low-level API to associate a generated position with an original source position. Line and\n * column here are 0-based, unlike `addMapping`.\n */\nlet addSegment;\n/**\n * A high-level API to associate a generated position with an original source position. Line is\n * 1-based, but column is 0-based, due to legacy behavior in `source-map` library.\n */\nlet addMapping;\n/**\n * Same as `addSegment`, but will only add the segment if it generates useful information in the\n * resulting map. This only works correctly if segments are added **in order**, meaning you should\n * not add a segment with a lower generated line/column than one that came before.\n */\nlet maybeAddSegment;\n/**\n * Same as `addMapping`, but will only add the mapping if it generates useful information in the\n * resulting map. This only works correctly if mappings are added **in order**, meaning you should\n * not add a mapping with a lower generated line/column than one that came before.\n */\nlet maybeAddMapping;\n/**\n * Adds/removes the content of the source file to the source map.\n */\nlet setSourceContent;\n/**\n * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects\n * a sourcemap, or to JSON.stringify.\n */\nlet toDecodedMap;\n/**\n * Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects\n * a sourcemap, or to JSON.stringify.\n */\nlet toEncodedMap;\n/**\n * Constructs a new GenMapping, using the already present mappings of the input.\n */\nlet fromMap;\n/**\n * Returns an array of high-level mapping objects for every recorded segment, which could then be\n * passed to the `source-map` library.\n */\nlet allMappings;\n// This split declaration is only so that terser can elminiate the static initialization block.\nlet addSegmentInternal;\n/**\n * Provides the state to generate a sourcemap.\n */\nclass GenMapping {\n constructor({ file, sourceRoot } = {}) {\n this._names = new SetArray();\n this._sources = new SetArray();\n this._sourcesContent = [];\n this._mappings = [];\n this.file = file;\n this.sourceRoot = sourceRoot;\n }\n}\n(() => {\n addSegment = (map, genLine, genColumn, source, sourceLine, sourceColumn, name) => {\n return addSegmentInternal(false, map, genLine, genColumn, source, sourceLine, sourceColumn, name);\n };\n maybeAddSegment = (map, genLine, genColumn, source, sourceLine, sourceColumn, name) => {\n return addSegmentInternal(true, map, genLine, genColumn, source, sourceLine, sourceColumn, name);\n };\n addMapping = (map, mapping) => {\n return addMappingInternal(false, map, mapping);\n };\n maybeAddMapping = (map, mapping) => {\n return addMappingInternal(true, map, mapping);\n };\n setSourceContent = (map, source, content) => {\n const { _sources: sources, _sourcesContent: sourcesContent } = map;\n sourcesContent[put(sources, source)] = content;\n };\n toDecodedMap = (map) => {\n const { file, sourceRoot, _mappings: mappings, _sources: sources, _sourcesContent: sourcesContent, _names: names, } = map;\n removeEmptyFinalLines(mappings);\n return {\n version: 3,\n file: file || undefined,\n names: names.array,\n sourceRoot: sourceRoot || undefined,\n sources: sources.array,\n sourcesContent,\n mappings,\n };\n };\n toEncodedMap = (map) => {\n const decoded = toDecodedMap(map);\n return Object.assign(Object.assign({}, decoded), { mappings: encode(decoded.mappings) });\n };\n allMappings = (map) => {\n const out = [];\n const { _mappings: mappings, _sources: sources, _names: names } = map;\n for (let i = 0; i < mappings.length; i++) {\n const line = mappings[i];\n for (let j = 0; j < line.length; j++) {\n const seg = line[j];\n const generated = { line: i + 1, column: seg[COLUMN] };\n let source = undefined;\n let original = undefined;\n let name = undefined;\n if (seg.length !== 1) {\n source = sources.array[seg[SOURCES_INDEX]];\n original = { line: seg[SOURCE_LINE] + 1, column: seg[SOURCE_COLUMN] };\n if (seg.length === 5)\n name = names.array[seg[NAMES_INDEX]];\n }\n out.push({ generated, source, original, name });\n }\n }\n return out;\n };\n fromMap = (input) => {\n const map = new TraceMap(input);\n const gen = new GenMapping({ file: map.file, sourceRoot: map.sourceRoot });\n putAll(gen._names, map.names);\n putAll(gen._sources, map.sources);\n gen._sourcesContent = map.sourcesContent || map.sources.map(() => null);\n gen._mappings = decodedMappings(map);\n return gen;\n };\n // Internal helpers\n addSegmentInternal = (skipable, map, genLine, genColumn, source, sourceLine, sourceColumn, name) => {\n const { _mappings: mappings, _sources: sources, _sourcesContent: sourcesContent, _names: names, } = map;\n const line = getLine(mappings, genLine);\n const index = getColumnIndex(line, genColumn);\n if (!source) {\n if (skipable && skipSourceless(line, index))\n return;\n return insert(line, index, [genColumn]);\n }\n const sourcesIndex = put(sources, source);\n const namesIndex = name ? put(names, name) : NO_NAME;\n if (sourcesIndex === sourcesContent.length)\n sourcesContent[sourcesIndex] = null;\n if (skipable && skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex)) {\n return;\n }\n return insert(line, index, name\n ? [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex]\n : [genColumn, sourcesIndex, sourceLine, sourceColumn]);\n };\n})();\nfunction getLine(mappings, index) {\n for (let i = mappings.length; i <= index; i++) {\n mappings[i] = [];\n }\n return mappings[index];\n}\nfunction getColumnIndex(line, genColumn) {\n let index = line.length;\n for (let i = index - 1; i >= 0; index = i--) {\n const current = line[i];\n if (genColumn >= current[COLUMN])\n break;\n }\n return index;\n}\nfunction insert(array, index, value) {\n for (let i = array.length; i > index; i--) {\n array[i] = array[i - 1];\n }\n array[index] = value;\n}\nfunction removeEmptyFinalLines(mappings) {\n const { length } = mappings;\n let len = length;\n for (let i = len - 1; i >= 0; len = i, i--) {\n if (mappings[i].length > 0)\n break;\n }\n if (len < length)\n mappings.length = len;\n}\nfunction putAll(strarr, array) {\n for (let i = 0; i < array.length; i++)\n put(strarr, array[i]);\n}\nfunction skipSourceless(line, index) {\n // The start of a line is already sourceless, so adding a sourceless segment to the beginning\n // doesn't generate any useful information.\n if (index === 0)\n return true;\n const prev = line[index - 1];\n // If the previous segment is also sourceless, then adding another sourceless segment doesn't\n // genrate any new information. Else, this segment will end the source/named segment and point to\n // a sourceless position, which is useful.\n return prev.length === 1;\n}\nfunction skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex) {\n // A source/named segment at the start of a line gives position at that genColumn\n if (index === 0)\n return false;\n const prev = line[index - 1];\n // If the previous segment is sourceless, then we're transitioning to a source.\n if (prev.length === 1)\n return false;\n // If the previous segment maps to the exact same source position, then this segment doesn't\n // provide any new position information.\n return (sourcesIndex === prev[SOURCES_INDEX] &&\n sourceLine === prev[SOURCE_LINE] &&\n sourceColumn === prev[SOURCE_COLUMN] &&\n namesIndex === (prev.length === 5 ? prev[NAMES_INDEX] : NO_NAME));\n}\nfunction addMappingInternal(skipable, map, mapping) {\n const { generated, source, original, name } = mapping;\n if (!source) {\n return addSegmentInternal(skipable, map, generated.line - 1, generated.column, null, null, null, null);\n }\n const s = source;\n return addSegmentInternal(skipable, map, generated.line - 1, generated.column, s, original.line - 1, original.column, name);\n}\n\nexport { GenMapping, addMapping, addSegment, allMappings, fromMap, maybeAddMapping, maybeAddSegment, setSourceContent, toDecodedMap, toEncodedMap };\n//# sourceMappingURL=gen-mapping.mjs.map\n","import { AnyMap, originalPositionFor } from '@jridgewell/trace-mapping';\nimport {\n GenMapping,\n maybeAddMapping,\n toDecodedMap,\n toEncodedMap,\n setSourceContent,\n} from '@jridgewell/gen-mapping';\n\nimport type { TraceMap, SectionedSourceMapInput } from '@jridgewell/trace-mapping';\nexport type { TraceMap, SectionedSourceMapInput };\n\nimport type { Mapping, EncodedSourceMap, DecodedSourceMap } from '@jridgewell/gen-mapping';\nexport type { Mapping, EncodedSourceMap, DecodedSourceMap };\n\nexport class SourceMapConsumer {\n private declare _map: TraceMap;\n declare file: TraceMap['file'];\n declare names: TraceMap['names'];\n declare sourceRoot: TraceMap['sourceRoot'];\n declare sources: TraceMap['sources'];\n declare sourcesContent: TraceMap['sourcesContent'];\n\n constructor(map: ConstructorParameters[0], mapUrl: Parameters[1]) {\n const trace = (this._map = new AnyMap(map, mapUrl));\n\n this.file = trace.file;\n this.names = trace.names;\n this.sourceRoot = trace.sourceRoot;\n this.sources = trace.resolvedSources;\n this.sourcesContent = trace.sourcesContent;\n }\n\n originalPositionFor(\n needle: Parameters[1],\n ): ReturnType {\n return originalPositionFor(this._map, needle);\n }\n\n destroy() {\n // noop.\n }\n}\n\nexport class SourceMapGenerator {\n private declare _map: GenMapping;\n\n constructor(opts: ConstructorParameters[0]) {\n this._map = new GenMapping(opts);\n }\n\n addMapping(mapping: Parameters[1]): ReturnType {\n maybeAddMapping(this._map, mapping);\n }\n\n setSourceContent(\n source: Parameters[1],\n content: Parameters[2],\n ): ReturnType {\n setSourceContent(this._map, source, content);\n }\n\n toJSON(): ReturnType {\n return toEncodedMap(this._map);\n }\n\n toDecodedMap(): ReturnType {\n return toDecodedMap(this._map);\n }\n}\n"],"names":["sortComparator","resolve","resolveUri","COLUMN","SOURCES_INDEX","SOURCE_LINE","SOURCE_COLUMN","NAMES_INDEX"],"mappings":"AAAA,MAAM,KAAK,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;AAChC,MAAM,SAAS,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;AACpC,MAAM,KAAK,GAAG,kEAAkE,CAAC;AACjF,MAAM,SAAS,GAAG,IAAI,UAAU,CAAC,EAAE,CAAC,CA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AE,IAAI,CAAC,CAAC;AAChI;;MCnNa,iBAAiB;IAQ5B,YAAY,GAA4C,EAAE,MAAoC;QAC5F,MAAM,KAAK,IAAI,IAAI,CAAC,IAAI,GAAG,IAAI,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC,CAAC;QAEpD,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;QACvB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;QACzB,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,UAAU,CAAC;QACnC,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,eAAe,CAAC;QACrC,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC,cAAc,CAAC;KAC5C;IAED,mBAAmB,CACjB,MAAiD;QAEjD,OAAO,mBAAmB,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;KAC/C;IAED,OAAO;;KAEN;CACF;MAEY,kBAAkB;IAG7B,YAAY,IAAiD;QAC3D,IAAI,CAAC,IAAI,GAAG,IAAI,UAAU,CAAC,IAAI,CAAC,CAAC;KAClC;IAED,UAAU,CAAC,OAA8C;QACvD,eAAe,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;KACrC;IAED,gBAAgB,CACd,MAA8C,EAC9C,OAA+C;QAE/C,gBAAgB,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;KAC9C;IAED,MAAM;QACJ,OAAO,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;KAChC;IAED,YAAY;QACV,OAAO,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;KAChC;;;;;"} \ No newline at end of file diff --git a/node_modules/@jridgewell/source-map/dist/source-map.umd.js b/node_modules/@jridgewell/source-map/dist/source-map.umd.js new file mode 100644 index 0000000..77ec63b --- /dev/null +++ b/node_modules/@jridgewell/source-map/dist/source-map.umd.js @@ -0,0 +1,939 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : + typeof define === 'function' && define.amd ? define(['exports'], factory) : + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.sourceMap = {})); +})(this, (function (exports) { 'use strict'; + + const comma = ','.charCodeAt(0); + const semicolon = ';'.charCodeAt(0); + const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; + const intToChar = new Uint8Array(64); // 64 possible chars. + const charToInteger = new Uint8Array(128); // z is 122 in ASCII + for (let i = 0; i < chars.length; i++) { + const c = chars.charCodeAt(i); + charToInteger[c] = i; + intToChar[i] = c; + } + // Provide a fallback for older environments. + const td = typeof TextDecoder !== 'undefined' + ? new TextDecoder() + : typeof Buffer !== 'undefined' + ? { + decode(buf) { + const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength); + return out.toString(); + }, + } + : { + decode(buf) { + let out = ''; + for (let i = 0; i < buf.length; i++) { + out += String.fromCharCode(buf[i]); + } + return out; + }, + }; + function decode(mappings) { + const state = new Int32Array(5); + const decoded = []; + let line = []; + let sorted = true; + let lastCol = 0; + for (let i = 0; i < mappings.length;) { + const c = mappings.charCodeAt(i); + if (c === comma) { + i++; + } + else if (c === semicolon) { + state[0] = lastCol = 0; + if (!sorted) + sort(line); + sorted = true; + decoded.push(line); + line = []; + i++; + } + else { + i = decodeInteger(mappings, i, state, 0); // generatedCodeColumn + const col = state[0]; + if (col < lastCol) + sorted = false; + lastCol = col; + if (!hasMoreSegments(mappings, i)) { + line.push([col]); + continue; + } + i = decodeInteger(mappings, i, state, 1); // sourceFileIndex + i = decodeInteger(mappings, i, state, 2); // sourceCodeLine + i = decodeInteger(mappings, i, state, 3); // sourceCodeColumn + if (!hasMoreSegments(mappings, i)) { + line.push([col, state[1], state[2], state[3]]); + continue; + } + i = decodeInteger(mappings, i, state, 4); // nameIndex + line.push([col, state[1], state[2], state[3], state[4]]); + } + } + if (!sorted) + sort(line); + decoded.push(line); + return decoded; + } + function decodeInteger(mappings, pos, state, j) { + let value = 0; + let shift = 0; + let integer = 0; + do { + const c = mappings.charCodeAt(pos++); + integer = charToInteger[c]; + value |= (integer & 31) << shift; + shift += 5; + } while (integer & 32); + const shouldNegate = value & 1; + value >>>= 1; + if (shouldNegate) { + value = -0x80000000 | -value; + } + state[j] += value; + return pos; + } + function hasMoreSegments(mappings, i) { + if (i >= mappings.length) + return false; + const c = mappings.charCodeAt(i); + if (c === comma || c === semicolon) + return false; + return true; + } + function sort(line) { + line.sort(sortComparator$1); + } + function sortComparator$1(a, b) { + return a[0] - b[0]; + } + function encode(decoded) { + const state = new Int32Array(5); + let buf = new Uint8Array(1024); + let pos = 0; + for (let i = 0; i < decoded.length; i++) { + const line = decoded[i]; + if (i > 0) { + buf = reserve(buf, pos, 1); + buf[pos++] = semicolon; + } + if (line.length === 0) + continue; + state[0] = 0; + for (let j = 0; j < line.length; j++) { + const segment = line[j]; + // We can push up to 5 ints, each int can take at most 7 chars, and we + // may push a comma. + buf = reserve(buf, pos, 36); + if (j > 0) + buf[pos++] = comma; + pos = encodeInteger(buf, pos, state, segment, 0); // generatedCodeColumn + if (segment.length === 1) + continue; + pos = encodeInteger(buf, pos, state, segment, 1); // sourceFileIndex + pos = encodeInteger(buf, pos, state, segment, 2); // sourceCodeLine + pos = encodeInteger(buf, pos, state, segment, 3); // sourceCodeColumn + if (segment.length === 4) + continue; + pos = encodeInteger(buf, pos, state, segment, 4); // nameIndex + } + } + return td.decode(buf.subarray(0, pos)); + } + function reserve(buf, pos, count) { + if (buf.length > pos + count) + return buf; + const swap = new Uint8Array(buf.length * 2); + swap.set(buf); + return swap; + } + function encodeInteger(buf, pos, state, segment, j) { + const next = segment[j]; + let num = next - state[j]; + state[j] = next; + num = num < 0 ? (-num << 1) | 1 : num << 1; + do { + let clamped = num & 0b011111; + num >>>= 5; + if (num > 0) + clamped |= 0b100000; + buf[pos++] = intToChar[clamped]; + } while (num > 0); + return pos; + } + + // Matches the scheme of a URL, eg "http://" + const schemeRegex = /^[\w+.-]+:\/\//; + /** + * Matches the parts of a URL: + * 1. Scheme, including ":", guaranteed. + * 2. User/password, including "@", optional. + * 3. Host, guaranteed. + * 4. Port, including ":", optional. + * 5. Path, including "/", optional. + */ + const urlRegex = /^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?/; + /** + * File URLs are weird. They dont' need the regular `//` in the scheme, they may or may not start + * with a leading `/`, they can have a domain (but only if they don't start with a Windows drive). + * + * 1. Host, optional. + * 2. Path, which may inclue "/", guaranteed. + */ + const fileRegex = /^file:(?:\/\/((?![a-z]:)[^/]*)?)?(\/?.*)/i; + function isAbsoluteUrl(input) { + return schemeRegex.test(input); + } + function isSchemeRelativeUrl(input) { + return input.startsWith('//'); + } + function isAbsolutePath(input) { + return input.startsWith('/'); + } + function isFileUrl(input) { + return input.startsWith('file:'); + } + function parseAbsoluteUrl(input) { + const match = urlRegex.exec(input); + return makeUrl(match[1], match[2] || '', match[3], match[4] || '', match[5] || '/'); + } + function parseFileUrl(input) { + const match = fileRegex.exec(input); + const path = match[2]; + return makeUrl('file:', '', match[1] || '', '', isAbsolutePath(path) ? path : '/' + path); + } + function makeUrl(scheme, user, host, port, path) { + return { + scheme, + user, + host, + port, + path, + relativePath: false, + }; + } + function parseUrl(input) { + if (isSchemeRelativeUrl(input)) { + const url = parseAbsoluteUrl('http:' + input); + url.scheme = ''; + return url; + } + if (isAbsolutePath(input)) { + const url = parseAbsoluteUrl('http://foo.com' + input); + url.scheme = ''; + url.host = ''; + return url; + } + if (isFileUrl(input)) + return parseFileUrl(input); + if (isAbsoluteUrl(input)) + return parseAbsoluteUrl(input); + const url = parseAbsoluteUrl('http://foo.com/' + input); + url.scheme = ''; + url.host = ''; + url.relativePath = true; + return url; + } + function stripPathFilename(path) { + // If a path ends with a parent directory "..", then it's a relative path with excess parent + // paths. It's not a file, so we can't strip it. + if (path.endsWith('/..')) + return path; + const index = path.lastIndexOf('/'); + return path.slice(0, index + 1); + } + function mergePaths(url, base) { + // If we're not a relative path, then we're an absolute path, and it doesn't matter what base is. + if (!url.relativePath) + return; + normalizePath(base); + // If the path is just a "/", then it was an empty path to begin with (remember, we're a relative + // path). + if (url.path === '/') { + url.path = base.path; + } + else { + // Resolution happens relative to the base path's directory, not the file. + url.path = stripPathFilename(base.path) + url.path; + } + // If the base path is absolute, then our path is now absolute too. + url.relativePath = base.relativePath; + } + /** + * The path can have empty directories "//", unneeded parents "foo/..", or current directory + * "foo/.". We need to normalize to a standard representation. + */ + function normalizePath(url) { + const { relativePath } = url; + const pieces = url.path.split('/'); + // We need to preserve the first piece always, so that we output a leading slash. The item at + // pieces[0] is an empty string. + let pointer = 1; + // Positive is the number of real directories we've output, used for popping a parent directory. + // Eg, "foo/bar/.." will have a positive 2, and we can decrement to be left with just "foo". + let positive = 0; + // We need to keep a trailing slash if we encounter an empty directory (eg, splitting "foo/" will + // generate `["foo", ""]` pieces). And, if we pop a parent directory. But once we encounter a + // real directory, we won't need to append, unless the other conditions happen again. + let addTrailingSlash = false; + for (let i = 1; i < pieces.length; i++) { + const piece = pieces[i]; + // An empty directory, could be a trailing slash, or just a double "//" in the path. + if (!piece) { + addTrailingSlash = true; + continue; + } + // If we encounter a real directory, then we don't need to append anymore. + addTrailingSlash = false; + // A current directory, which we can always drop. + if (piece === '.') + continue; + // A parent directory, we need to see if there are any real directories we can pop. Else, we + // have an excess of parents, and we'll need to keep the "..". + if (piece === '..') { + if (positive) { + addTrailingSlash = true; + positive--; + pointer--; + } + else if (relativePath) { + // If we're in a relativePath, then we need to keep the excess parents. Else, in an absolute + // URL, protocol relative URL, or an absolute path, we don't need to keep excess. + pieces[pointer++] = piece; + } + continue; + } + // We've encountered a real directory. Move it to the next insertion pointer, which accounts for + // any popped or dropped directories. + pieces[pointer++] = piece; + positive++; + } + let path = ''; + for (let i = 1; i < pointer; i++) { + path += '/' + pieces[i]; + } + if (!path || (addTrailingSlash && !path.endsWith('/..'))) { + path += '/'; + } + url.path = path; + } + /** + * Attempts to resolve `input` URL/path relative to `base`. + */ + function resolve$1(input, base) { + if (!input && !base) + return ''; + const url = parseUrl(input); + // If we have a base, and the input isn't already an absolute URL, then we need to merge. + if (base && !url.scheme) { + const baseUrl = parseUrl(base); + url.scheme = baseUrl.scheme; + // If there's no host, then we were just a path. + if (!url.host) { + // The host, user, and port are joined, you can't copy one without the others. + url.user = baseUrl.user; + url.host = baseUrl.host; + url.port = baseUrl.port; + } + mergePaths(url, baseUrl); + } + normalizePath(url); + // If the input (and base, if there was one) are both relative, then we need to output a relative. + if (url.relativePath) { + // The first char is always a "/". + const path = url.path.slice(1); + if (!path) + return '.'; + // If base started with a leading ".", or there is no base and input started with a ".", then we + // need to ensure that the relative path starts with a ".". We don't know if relative starts + // with a "..", though, so check before prepending. + const keepRelative = (base || input).startsWith('.'); + return !keepRelative || path.startsWith('.') ? path : './' + path; + } + // If there's no host (and no scheme/user/port), then we need to output an absolute path. + if (!url.scheme && !url.host) + return url.path; + // We're outputting either an absolute URL, or a protocol relative one. + return `${url.scheme}//${url.user}${url.host}${url.port}${url.path}`; + } + + function resolve(input, base) { + // The base is always treated as a directory, if it's not empty. + // https://github.com/mozilla/source-map/blob/8cb3ee57/lib/util.js#L327 + // https://github.com/chromium/chromium/blob/da4adbb3/third_party/blink/renderer/devtools/front_end/sdk/SourceMap.js#L400-L401 + if (base && !base.endsWith('/')) + base += '/'; + return resolve$1(input, base); + } + + /** + * Removes everything after the last "/", but leaves the slash. + */ + function stripFilename(path) { + if (!path) + return ''; + const index = path.lastIndexOf('/'); + return path.slice(0, index + 1); + } + + const COLUMN$1 = 0; + const SOURCES_INDEX$1 = 1; + const SOURCE_LINE$1 = 2; + const SOURCE_COLUMN$1 = 3; + const NAMES_INDEX$1 = 4; + + function maybeSort(mappings, owned) { + const unsortedIndex = nextUnsortedSegmentLine(mappings, 0); + if (unsortedIndex === mappings.length) + return mappings; + // If we own the array (meaning we parsed it from JSON), then we're free to directly mutate it. If + // not, we do not want to modify the consumer's input array. + if (!owned) + mappings = mappings.slice(); + for (let i = unsortedIndex; i < mappings.length; i = nextUnsortedSegmentLine(mappings, i + 1)) { + mappings[i] = sortSegments(mappings[i], owned); + } + return mappings; + } + function nextUnsortedSegmentLine(mappings, start) { + for (let i = start; i < mappings.length; i++) { + if (!isSorted(mappings[i])) + return i; + } + return mappings.length; + } + function isSorted(line) { + for (let j = 1; j < line.length; j++) { + if (line[j][COLUMN$1] < line[j - 1][COLUMN$1]) { + return false; + } + } + return true; + } + function sortSegments(line, owned) { + if (!owned) + line = line.slice(); + return line.sort(sortComparator); + } + function sortComparator(a, b) { + return a[COLUMN$1] - b[COLUMN$1]; + } + + let found = false; + /** + * A binary search implementation that returns the index if a match is found. + * If no match is found, then the left-index (the index associated with the item that comes just + * before the desired index) is returned. To maintain proper sort order, a splice would happen at + * the next index: + * + * ```js + * const array = [1, 3]; + * const needle = 2; + * const index = binarySearch(array, needle, (item, needle) => item - needle); + * + * assert.equal(index, 0); + * array.splice(index + 1, 0, needle); + * assert.deepEqual(array, [1, 2, 3]); + * ``` + */ + function binarySearch(haystack, needle, low, high) { + while (low <= high) { + const mid = low + ((high - low) >> 1); + const cmp = haystack[mid][COLUMN$1] - needle; + if (cmp === 0) { + found = true; + return mid; + } + if (cmp < 0) { + low = mid + 1; + } + else { + high = mid - 1; + } + } + found = false; + return low - 1; + } + function upperBound(haystack, needle, index) { + for (let i = index + 1; i < haystack.length; i++, index++) { + if (haystack[i][COLUMN$1] !== needle) + break; + } + return index; + } + function lowerBound(haystack, needle, index) { + for (let i = index - 1; i >= 0; i--, index--) { + if (haystack[i][COLUMN$1] !== needle) + break; + } + return index; + } + function memoizedState() { + return { + lastKey: -1, + lastNeedle: -1, + lastIndex: -1, + }; + } + /** + * This overly complicated beast is just to record the last tested line/column and the resulting + * index, allowing us to skip a few tests if mappings are monotonically increasing. + */ + function memoizedBinarySearch(haystack, needle, state, key) { + const { lastKey, lastNeedle, lastIndex } = state; + let low = 0; + let high = haystack.length - 1; + if (key === lastKey) { + if (needle === lastNeedle) { + found = lastIndex !== -1 && haystack[lastIndex][COLUMN$1] === needle; + return lastIndex; + } + if (needle >= lastNeedle) { + // lastIndex may be -1 if the previous needle was not found. + low = lastIndex === -1 ? 0 : lastIndex; + } + else { + high = lastIndex; + } + } + state.lastKey = key; + state.lastNeedle = needle; + return (state.lastIndex = binarySearch(haystack, needle, low, high)); + } + + const AnyMap = function (map, mapUrl) { + const parsed = typeof map === 'string' ? JSON.parse(map) : map; + if (!('sections' in parsed)) + return new TraceMap(parsed, mapUrl); + const mappings = []; + const sources = []; + const sourcesContent = []; + const names = []; + const { sections } = parsed; + let i = 0; + for (; i < sections.length - 1; i++) { + const no = sections[i + 1].offset; + addSection(sections[i], mapUrl, mappings, sources, sourcesContent, names, no.line, no.column); + } + if (sections.length > 0) { + addSection(sections[i], mapUrl, mappings, sources, sourcesContent, names, Infinity, Infinity); + } + const joined = { + version: 3, + file: parsed.file, + names, + sources, + sourcesContent, + mappings, + }; + return presortedDecodedMap(joined); + }; + function addSection(section, mapUrl, mappings, sources, sourcesContent, names, stopLine, stopColumn) { + const map = AnyMap(section.map, mapUrl); + const { line: lineOffset, column: columnOffset } = section.offset; + const sourcesOffset = sources.length; + const namesOffset = names.length; + const decoded = decodedMappings(map); + const { resolvedSources } = map; + append(sources, resolvedSources); + append(sourcesContent, map.sourcesContent || fillSourcesContent(resolvedSources.length)); + append(names, map.names); + // If this section jumps forwards several lines, we need to add lines to the output mappings catch up. + for (let i = mappings.length; i <= lineOffset; i++) + mappings.push([]); + // We can only add so many lines before we step into the range that the next section's map + // controls. When we get to the last line, then we'll start checking the segments to see if + // they've crossed into the column range. + const stopI = stopLine - lineOffset; + const len = Math.min(decoded.length, stopI + 1); + for (let i = 0; i < len; i++) { + const line = decoded[i]; + // On the 0th loop, the line will already exist due to a previous section, or the line catch up + // loop above. + const out = i === 0 ? mappings[lineOffset] : (mappings[lineOffset + i] = []); + // On the 0th loop, the section's column offset shifts us forward. On all other lines (since the + // map can be multiple lines), it doesn't. + const cOffset = i === 0 ? columnOffset : 0; + for (let j = 0; j < line.length; j++) { + const seg = line[j]; + const column = cOffset + seg[COLUMN$1]; + // If this segment steps into the column range that the next section's map controls, we need + // to stop early. + if (i === stopI && column >= stopColumn) + break; + if (seg.length === 1) { + out.push([column]); + continue; + } + const sourcesIndex = sourcesOffset + seg[SOURCES_INDEX$1]; + const sourceLine = seg[SOURCE_LINE$1]; + const sourceColumn = seg[SOURCE_COLUMN$1]; + if (seg.length === 4) { + out.push([column, sourcesIndex, sourceLine, sourceColumn]); + continue; + } + out.push([column, sourcesIndex, sourceLine, sourceColumn, namesOffset + seg[NAMES_INDEX$1]]); + } + } + } + function append(arr, other) { + for (let i = 0; i < other.length; i++) + arr.push(other[i]); + } + // Sourcemaps don't need to have sourcesContent, and if they don't, we need to create an array of + // equal length to the sources. This is because the sources and sourcesContent are paired arrays, + // where `sourcesContent[i]` is the content of the `sources[i]` file. If we didn't, then joined + // sourcemap would desynchronize the sources/contents. + function fillSourcesContent(len) { + const sourcesContent = []; + for (let i = 0; i < len; i++) + sourcesContent[i] = null; + return sourcesContent; + } + + const INVALID_ORIGINAL_MAPPING = Object.freeze({ + source: null, + line: null, + column: null, + name: null, + }); + Object.freeze({ + line: null, + column: null, + }); + const LINE_GTR_ZERO = '`line` must be greater than 0 (lines start at line 1)'; + const COL_GTR_EQ_ZERO = '`column` must be greater than or equal to 0 (columns start at column 0)'; + const LEAST_UPPER_BOUND = -1; + const GREATEST_LOWER_BOUND = 1; + /** + * Returns the decoded (array of lines of segments) form of the SourceMap's mappings field. + */ + let decodedMappings; + /** + * A higher-level API to find the source/line/column associated with a generated line/column + * (think, from a stack trace). Line is 1-based, but column is 0-based, due to legacy behavior in + * `source-map` library. + */ + let originalPositionFor; + /** + * A helper that skips sorting of the input map's mappings array, which can be expensive for larger + * maps. + */ + let presortedDecodedMap; + class TraceMap { + constructor(map, mapUrl) { + this._decodedMemo = memoizedState(); + this._bySources = undefined; + this._bySourceMemos = undefined; + const isString = typeof map === 'string'; + if (!isString && map.constructor === TraceMap) + return map; + const parsed = (isString ? JSON.parse(map) : map); + const { version, file, names, sourceRoot, sources, sourcesContent } = parsed; + this.version = version; + this.file = file; + this.names = names; + this.sourceRoot = sourceRoot; + this.sources = sources; + this.sourcesContent = sourcesContent; + if (sourceRoot || mapUrl) { + const from = resolve(sourceRoot || '', stripFilename(mapUrl)); + this.resolvedSources = sources.map((s) => resolve(s || '', from)); + } + else { + this.resolvedSources = sources.map((s) => s || ''); + } + const { mappings } = parsed; + if (typeof mappings === 'string') { + this._encoded = mappings; + this._decoded = undefined; + } + else { + this._encoded = undefined; + this._decoded = maybeSort(mappings, isString); + } + } + } + (() => { + decodedMappings = (map) => { + return (map._decoded || (map._decoded = decode(map._encoded))); + }; + originalPositionFor = (map, { line, column, bias }) => { + line--; + if (line < 0) + throw new Error(LINE_GTR_ZERO); + if (column < 0) + throw new Error(COL_GTR_EQ_ZERO); + const decoded = decodedMappings(map); + // It's common for parent source maps to have pointers to lines that have no + // mapping (like a "//# sourceMappingURL=") at the end of the child file. + if (line >= decoded.length) + return INVALID_ORIGINAL_MAPPING; + const segment = traceSegmentInternal(decoded[line], map._decodedMemo, line, column, bias || GREATEST_LOWER_BOUND); + if (segment == null) + return INVALID_ORIGINAL_MAPPING; + if (segment.length == 1) + return INVALID_ORIGINAL_MAPPING; + const { names, resolvedSources } = map; + return { + source: resolvedSources[segment[SOURCES_INDEX$1]], + line: segment[SOURCE_LINE$1] + 1, + column: segment[SOURCE_COLUMN$1], + name: segment.length === 5 ? names[segment[NAMES_INDEX$1]] : null, + }; + }; + presortedDecodedMap = (map, mapUrl) => { + const clone = Object.assign({}, map); + clone.mappings = []; + const tracer = new TraceMap(clone, mapUrl); + tracer._decoded = map.mappings; + return tracer; + }; + })(); + function traceSegmentInternal(segments, memo, line, column, bias) { + let index = memoizedBinarySearch(segments, column, memo, line); + if (found) { + index = (bias === LEAST_UPPER_BOUND ? upperBound : lowerBound)(segments, column, index); + } + else if (bias === LEAST_UPPER_BOUND) + index++; + if (index === -1 || index === segments.length) + return null; + return segments[index]; + } + + /** + * Gets the index associated with `key` in the backing array, if it is already present. + */ + let get; + /** + * Puts `key` into the backing array, if it is not already present. Returns + * the index of the `key` in the backing array. + */ + let put; + /** + * SetArray acts like a `Set` (allowing only one occurrence of a string `key`), but provides the + * index of the `key` in the backing array. + * + * This is designed to allow synchronizing a second array with the contents of the backing array, + * like how in a sourcemap `sourcesContent[i]` is the source content associated with `source[i]`, + * and there are never duplicates. + */ + class SetArray { + constructor() { + this._indexes = { __proto__: null }; + this.array = []; + } + } + (() => { + get = (strarr, key) => strarr._indexes[key]; + put = (strarr, key) => { + // The key may or may not be present. If it is present, it's a number. + const index = get(strarr, key); + if (index !== undefined) + return index; + const { array, _indexes: indexes } = strarr; + return (indexes[key] = array.push(key) - 1); + }; + })(); + + const COLUMN = 0; + const SOURCES_INDEX = 1; + const SOURCE_LINE = 2; + const SOURCE_COLUMN = 3; + const NAMES_INDEX = 4; + + const NO_NAME = -1; + /** + * Same as `addMapping`, but will only add the mapping if it generates useful information in the + * resulting map. This only works correctly if mappings are added **in order**, meaning you should + * not add a mapping with a lower generated line/column than one that came before. + */ + let maybeAddMapping; + /** + * Adds/removes the content of the source file to the source map. + */ + let setSourceContent; + /** + * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects + * a sourcemap, or to JSON.stringify. + */ + let toDecodedMap; + /** + * Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects + * a sourcemap, or to JSON.stringify. + */ + let toEncodedMap; + // This split declaration is only so that terser can elminiate the static initialization block. + let addSegmentInternal; + /** + * Provides the state to generate a sourcemap. + */ + class GenMapping { + constructor({ file, sourceRoot } = {}) { + this._names = new SetArray(); + this._sources = new SetArray(); + this._sourcesContent = []; + this._mappings = []; + this.file = file; + this.sourceRoot = sourceRoot; + } + } + (() => { + maybeAddMapping = (map, mapping) => { + return addMappingInternal(true, map, mapping); + }; + setSourceContent = (map, source, content) => { + const { _sources: sources, _sourcesContent: sourcesContent } = map; + sourcesContent[put(sources, source)] = content; + }; + toDecodedMap = (map) => { + const { file, sourceRoot, _mappings: mappings, _sources: sources, _sourcesContent: sourcesContent, _names: names, } = map; + removeEmptyFinalLines(mappings); + return { + version: 3, + file: file || undefined, + names: names.array, + sourceRoot: sourceRoot || undefined, + sources: sources.array, + sourcesContent, + mappings, + }; + }; + toEncodedMap = (map) => { + const decoded = toDecodedMap(map); + return Object.assign(Object.assign({}, decoded), { mappings: encode(decoded.mappings) }); + }; + // Internal helpers + addSegmentInternal = (skipable, map, genLine, genColumn, source, sourceLine, sourceColumn, name) => { + const { _mappings: mappings, _sources: sources, _sourcesContent: sourcesContent, _names: names, } = map; + const line = getLine(mappings, genLine); + const index = getColumnIndex(line, genColumn); + if (!source) { + if (skipable && skipSourceless(line, index)) + return; + return insert(line, index, [genColumn]); + } + const sourcesIndex = put(sources, source); + const namesIndex = name ? put(names, name) : NO_NAME; + if (sourcesIndex === sourcesContent.length) + sourcesContent[sourcesIndex] = null; + if (skipable && skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex)) { + return; + } + return insert(line, index, name + ? [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex] + : [genColumn, sourcesIndex, sourceLine, sourceColumn]); + }; + })(); + function getLine(mappings, index) { + for (let i = mappings.length; i <= index; i++) { + mappings[i] = []; + } + return mappings[index]; + } + function getColumnIndex(line, genColumn) { + let index = line.length; + for (let i = index - 1; i >= 0; index = i--) { + const current = line[i]; + if (genColumn >= current[COLUMN]) + break; + } + return index; + } + function insert(array, index, value) { + for (let i = array.length; i > index; i--) { + array[i] = array[i - 1]; + } + array[index] = value; + } + function removeEmptyFinalLines(mappings) { + const { length } = mappings; + let len = length; + for (let i = len - 1; i >= 0; len = i, i--) { + if (mappings[i].length > 0) + break; + } + if (len < length) + mappings.length = len; + } + function skipSourceless(line, index) { + // The start of a line is already sourceless, so adding a sourceless segment to the beginning + // doesn't generate any useful information. + if (index === 0) + return true; + const prev = line[index - 1]; + // If the previous segment is also sourceless, then adding another sourceless segment doesn't + // genrate any new information. Else, this segment will end the source/named segment and point to + // a sourceless position, which is useful. + return prev.length === 1; + } + function skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex) { + // A source/named segment at the start of a line gives position at that genColumn + if (index === 0) + return false; + const prev = line[index - 1]; + // If the previous segment is sourceless, then we're transitioning to a source. + if (prev.length === 1) + return false; + // If the previous segment maps to the exact same source position, then this segment doesn't + // provide any new position information. + return (sourcesIndex === prev[SOURCES_INDEX] && + sourceLine === prev[SOURCE_LINE] && + sourceColumn === prev[SOURCE_COLUMN] && + namesIndex === (prev.length === 5 ? prev[NAMES_INDEX] : NO_NAME)); + } + function addMappingInternal(skipable, map, mapping) { + const { generated, source, original, name } = mapping; + if (!source) { + return addSegmentInternal(skipable, map, generated.line - 1, generated.column, null, null, null, null); + } + const s = source; + return addSegmentInternal(skipable, map, generated.line - 1, generated.column, s, original.line - 1, original.column, name); + } + + class SourceMapConsumer { + constructor(map, mapUrl) { + const trace = (this._map = new AnyMap(map, mapUrl)); + this.file = trace.file; + this.names = trace.names; + this.sourceRoot = trace.sourceRoot; + this.sources = trace.resolvedSources; + this.sourcesContent = trace.sourcesContent; + } + originalPositionFor(needle) { + return originalPositionFor(this._map, needle); + } + destroy() { + // noop. + } + } + class SourceMapGenerator { + constructor(opts) { + this._map = new GenMapping(opts); + } + addMapping(mapping) { + maybeAddMapping(this._map, mapping); + } + setSourceContent(source, content) { + setSourceContent(this._map, source, content); + } + toJSON() { + return toEncodedMap(this._map); + } + toDecodedMap() { + return toDecodedMap(this._map); + } + } + + exports.SourceMapConsumer = SourceMapConsumer; + exports.SourceMapGenerator = SourceMapGenerator; + + Object.defineProperty(exports, '__esModule', { value: true }); + +})); +//# sourceMappingURL=source-map.umd.js.map diff --git a/node_modules/@jridgewell/source-map/dist/source-map.umd.js.map b/node_modules/@jridgewell/source-map/dist/source-map.umd.js.map new file mode 100644 index 0000000..358767e --- /dev/null +++ b/node_modules/@jridgewell/source-map/dist/source-map.umd.js.map @@ -0,0 +1 @@ +{"version":3,"file":"source-map.umd.js","sources":["../node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs","../node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs","../node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs","../node_modules/@jridgewell/set-array/dist/set-array.mjs","../node_modules/@jridgewell/gen-mapping/dist/gen-mapping.mjs","../../src/source-map.ts"],"sourcesContent":["const comma = ','.charCodeAt(0);\nconst semicolon = ';'.charCodeAt(0);\nconst chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\nconst intToChar = new Uint8Array(64); // 64 possible chars.\nconst charToInteger = new Uint8Array(128); // z is 122 in ASCII\nfor (let i = 0; i < chars.length; i++) {\n const c = chars.charCodeAt(i);\n charToInteger[c] = i;\n intToChar[i] = c;\n}\n// Provide a fallback for older environments.\nconst td = typeof TextDecoder !== 'undefined'\n ? new TextDecoder()\n : typeof Buffer !== 'undefined'\n ? {\n decode(buf) {\n const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength);\n return out.toString();\n },\n }\n : {\n decode(buf) {\n let out = '';\n for (let i = 0; i < buf.length; i++) {\n out += String.fromCharCode(buf[i]);\n }\n return out;\n },\n };\nfunction decode(mappings) {\n const state = new Int32Array(5);\n const decoded = [];\n let line = [];\n let sorted = true;\n let lastCol = 0;\n for (let i = 0; i < mappings.length;) {\n const c = mappings.charCodeAt(i);\n if (c === comma) {\n i++;\n }\n else if (c === semicolon) {\n state[0] = lastCol = 0;\n if (!sorted)\n sort(line);\n sorted = true;\n decoded.push(line);\n line = [];\n i++;\n }\n else {\n i = decodeInteger(mappings, i, state, 0); // generatedCodeColumn\n const col = state[0];\n if (col < lastCol)\n sorted = false;\n lastCol = col;\n if (!hasMoreSegments(mappings, i)) {\n line.push([col]);\n continue;\n }\n i = decodeInteger(mappings, i, state, 1); // sourceFileIndex\n i = decodeInteger(mappings, i, state, 2); // sourceCodeLine\n i = decodeInteger(mappings, i, state, 3); // sourceCodeColumn\n if (!hasMoreSegments(mappings, i)) {\n line.push([col, state[1], state[2], state[3]]);\n continue;\n }\n i = decodeInteger(mappings, i, state, 4); // nameIndex\n line.push([col, state[1], state[2], state[3], state[4]]);\n }\n }\n if (!sorted)\n sort(line);\n decoded.push(line);\n return decoded;\n}\nfunction decodeInteger(mappings, pos, state, j) {\n let value = 0;\n let shift = 0;\n let integer = 0;\n do {\n const c = mappings.charCodeAt(pos++);\n integer = charToInteger[c];\n value |= (integer & 31) << shift;\n shift += 5;\n } while (integer & 32);\n const shouldNegate = value & 1;\n value >>>= 1;\n if (shouldNegate) {\n value = -0x80000000 | -value;\n }\n state[j] += value;\n return pos;\n}\nfunction hasMoreSegments(mappings, i) {\n if (i >= mappings.length)\n return false;\n const c = mappings.charCodeAt(i);\n if (c === comma || c === semicolon)\n return false;\n return true;\n}\nfunction sort(line) {\n line.sort(sortComparator);\n}\nfunction sortComparator(a, b) {\n return a[0] - b[0];\n}\nfunction encode(decoded) {\n const state = new Int32Array(5);\n let buf = new Uint8Array(1024);\n let pos = 0;\n for (let i = 0; i < decoded.length; i++) {\n const line = decoded[i];\n if (i > 0) {\n buf = reserve(buf, pos, 1);\n buf[pos++] = semicolon;\n }\n if (line.length === 0)\n continue;\n state[0] = 0;\n for (let j = 0; j < line.length; j++) {\n const segment = line[j];\n // We can push up to 5 ints, each int can take at most 7 chars, and we\n // may push a comma.\n buf = reserve(buf, pos, 36);\n if (j > 0)\n buf[pos++] = comma;\n pos = encodeInteger(buf, pos, state, segment, 0); // generatedCodeColumn\n if (segment.length === 1)\n continue;\n pos = encodeInteger(buf, pos, state, segment, 1); // sourceFileIndex\n pos = encodeInteger(buf, pos, state, segment, 2); // sourceCodeLine\n pos = encodeInteger(buf, pos, state, segment, 3); // sourceCodeColumn\n if (segment.length === 4)\n continue;\n pos = encodeInteger(buf, pos, state, segment, 4); // nameIndex\n }\n }\n return td.decode(buf.subarray(0, pos));\n}\nfunction reserve(buf, pos, count) {\n if (buf.length > pos + count)\n return buf;\n const swap = new Uint8Array(buf.length * 2);\n swap.set(buf);\n return swap;\n}\nfunction encodeInteger(buf, pos, state, segment, j) {\n const next = segment[j];\n let num = next - state[j];\n state[j] = next;\n num = num < 0 ? (-num << 1) | 1 : num << 1;\n do {\n let clamped = num & 0b011111;\n num >>>= 5;\n if (num > 0)\n clamped |= 0b100000;\n buf[pos++] = intToChar[clamped];\n } while (num > 0);\n return pos;\n}\n\nexport { decode, encode };\n//# sourceMappingURL=sourcemap-codec.mjs.map\n","// Matches the scheme of a URL, eg \"http://\"\nconst schemeRegex = /^[\\w+.-]+:\\/\\//;\n/**\n * Matches the parts of a URL:\n * 1. Scheme, including \":\", guaranteed.\n * 2. User/password, including \"@\", optional.\n * 3. Host, guaranteed.\n * 4. Port, including \":\", optional.\n * 5. Path, including \"/\", optional.\n */\nconst urlRegex = /^([\\w+.-]+:)\\/\\/([^@/#?]*@)?([^:/#?]*)(:\\d+)?(\\/[^#?]*)?/;\n/**\n * File URLs are weird. They dont' need the regular `//` in the scheme, they may or may not start\n * with a leading `/`, they can have a domain (but only if they don't start with a Windows drive).\n *\n * 1. Host, optional.\n * 2. Path, which may inclue \"/\", guaranteed.\n */\nconst fileRegex = /^file:(?:\\/\\/((?![a-z]:)[^/]*)?)?(\\/?.*)/i;\nfunction isAbsoluteUrl(input) {\n return schemeRegex.test(input);\n}\nfunction isSchemeRelativeUrl(input) {\n return input.startsWith('//');\n}\nfunction isAbsolutePath(input) {\n return input.startsWith('/');\n}\nfunction isFileUrl(input) {\n return input.startsWith('file:');\n}\nfunction parseAbsoluteUrl(input) {\n const match = urlRegex.exec(input);\n return makeUrl(match[1], match[2] || '', match[3], match[4] || '', match[5] || '/');\n}\nfunction parseFileUrl(input) {\n const match = fileRegex.exec(input);\n const path = match[2];\n return makeUrl('file:', '', match[1] || '', '', isAbsolutePath(path) ? path : '/' + path);\n}\nfunction makeUrl(scheme, user, host, port, path) {\n return {\n scheme,\n user,\n host,\n port,\n path,\n relativePath: false,\n };\n}\nfunction parseUrl(input) {\n if (isSchemeRelativeUrl(input)) {\n const url = parseAbsoluteUrl('http:' + input);\n url.scheme = '';\n return url;\n }\n if (isAbsolutePath(input)) {\n const url = parseAbsoluteUrl('http://foo.com' + input);\n url.scheme = '';\n url.host = '';\n return url;\n }\n if (isFileUrl(input))\n return parseFileUrl(input);\n if (isAbsoluteUrl(input))\n return parseAbsoluteUrl(input);\n const url = parseAbsoluteUrl('http://foo.com/' + input);\n url.scheme = '';\n url.host = '';\n url.relativePath = true;\n return url;\n}\nfunction stripPathFilename(path) {\n // If a path ends with a parent directory \"..\", then it's a relative path with excess parent\n // paths. It's not a file, so we can't strip it.\n if (path.endsWith('/..'))\n return path;\n const index = path.lastIndexOf('/');\n return path.slice(0, index + 1);\n}\nfunction mergePaths(url, base) {\n // If we're not a relative path, then we're an absolute path, and it doesn't matter what base is.\n if (!url.relativePath)\n return;\n normalizePath(base);\n // If the path is just a \"/\", then it was an empty path to begin with (remember, we're a relative\n // path).\n if (url.path === '/') {\n url.path = base.path;\n }\n else {\n // Resolution happens relative to the base path's directory, not the file.\n url.path = stripPathFilename(base.path) + url.path;\n }\n // If the base path is absolute, then our path is now absolute too.\n url.relativePath = base.relativePath;\n}\n/**\n * The path can have empty directories \"//\", unneeded parents \"foo/..\", or current directory\n * \"foo/.\". We need to normalize to a standard representation.\n */\nfunction normalizePath(url) {\n const { relativePath } = url;\n const pieces = url.path.split('/');\n // We need to preserve the first piece always, so that we output a leading slash. The item at\n // pieces[0] is an empty string.\n let pointer = 1;\n // Positive is the number of real directories we've output, used for popping a parent directory.\n // Eg, \"foo/bar/..\" will have a positive 2, and we can decrement to be left with just \"foo\".\n let positive = 0;\n // We need to keep a trailing slash if we encounter an empty directory (eg, splitting \"foo/\" will\n // generate `[\"foo\", \"\"]` pieces). And, if we pop a parent directory. But once we encounter a\n // real directory, we won't need to append, unless the other conditions happen again.\n let addTrailingSlash = false;\n for (let i = 1; i < pieces.length; i++) {\n const piece = pieces[i];\n // An empty directory, could be a trailing slash, or just a double \"//\" in the path.\n if (!piece) {\n addTrailingSlash = true;\n continue;\n }\n // If we encounter a real directory, then we don't need to append anymore.\n addTrailingSlash = false;\n // A current directory, which we can always drop.\n if (piece === '.')\n continue;\n // A parent directory, we need to see if there are any real directories we can pop. Else, we\n // have an excess of parents, and we'll need to keep the \"..\".\n if (piece === '..') {\n if (positive) {\n addTrailingSlash = true;\n positive--;\n pointer--;\n }\n else if (relativePath) {\n // If we're in a relativePath, then we need to keep the excess parents. Else, in an absolute\n // URL, protocol relative URL, or an absolute path, we don't need to keep excess.\n pieces[pointer++] = piece;\n }\n continue;\n }\n // We've encountered a real directory. Move it to the next insertion pointer, which accounts for\n // any popped or dropped directories.\n pieces[pointer++] = piece;\n positive++;\n }\n let path = '';\n for (let i = 1; i < pointer; i++) {\n path += '/' + pieces[i];\n }\n if (!path || (addTrailingSlash && !path.endsWith('/..'))) {\n path += '/';\n }\n url.path = path;\n}\n/**\n * Attempts to resolve `input` URL/path relative to `base`.\n */\nfunction resolve(input, base) {\n if (!input && !base)\n return '';\n const url = parseUrl(input);\n // If we have a base, and the input isn't already an absolute URL, then we need to merge.\n if (base && !url.scheme) {\n const baseUrl = parseUrl(base);\n url.scheme = baseUrl.scheme;\n // If there's no host, then we were just a path.\n if (!url.host) {\n // The host, user, and port are joined, you can't copy one without the others.\n url.user = baseUrl.user;\n url.host = baseUrl.host;\n url.port = baseUrl.port;\n }\n mergePaths(url, baseUrl);\n }\n normalizePath(url);\n // If the input (and base, if there was one) are both relative, then we need to output a relative.\n if (url.relativePath) {\n // The first char is always a \"/\".\n const path = url.path.slice(1);\n if (!path)\n return '.';\n // If base started with a leading \".\", or there is no base and input started with a \".\", then we\n // need to ensure that the relative path starts with a \".\". We don't know if relative starts\n // with a \"..\", though, so check before prepending.\n const keepRelative = (base || input).startsWith('.');\n return !keepRelative || path.startsWith('.') ? path : './' + path;\n }\n // If there's no host (and no scheme/user/port), then we need to output an absolute path.\n if (!url.scheme && !url.host)\n return url.path;\n // We're outputting either an absolute URL, or a protocol relative one.\n return `${url.scheme}//${url.user}${url.host}${url.port}${url.path}`;\n}\n\nexport { resolve as default };\n//# sourceMappingURL=resolve-uri.mjs.map\n","import { encode, decode } from '@jridgewell/sourcemap-codec';\nimport resolveUri from '@jridgewell/resolve-uri';\n\nfunction resolve(input, base) {\n // The base is always treated as a directory, if it's not empty.\n // https://github.com/mozilla/source-map/blob/8cb3ee57/lib/util.js#L327\n // https://github.com/chromium/chromium/blob/da4adbb3/third_party/blink/renderer/devtools/front_end/sdk/SourceMap.js#L400-L401\n if (base && !base.endsWith('/'))\n base += '/';\n return resolveUri(input, base);\n}\n\n/**\n * Removes everything after the last \"/\", but leaves the slash.\n */\nfunction stripFilename(path) {\n if (!path)\n return '';\n const index = path.lastIndexOf('/');\n return path.slice(0, index + 1);\n}\n\nconst COLUMN = 0;\nconst SOURCES_INDEX = 1;\nconst SOURCE_LINE = 2;\nconst SOURCE_COLUMN = 3;\nconst NAMES_INDEX = 4;\nconst REV_GENERATED_LINE = 1;\nconst REV_GENERATED_COLUMN = 2;\n\nfunction maybeSort(mappings, owned) {\n const unsortedIndex = nextUnsortedSegmentLine(mappings, 0);\n if (unsortedIndex === mappings.length)\n return mappings;\n // If we own the array (meaning we parsed it from JSON), then we're free to directly mutate it. If\n // not, we do not want to modify the consumer's input array.\n if (!owned)\n mappings = mappings.slice();\n for (let i = unsortedIndex; i < mappings.length; i = nextUnsortedSegmentLine(mappings, i + 1)) {\n mappings[i] = sortSegments(mappings[i], owned);\n }\n return mappings;\n}\nfunction nextUnsortedSegmentLine(mappings, start) {\n for (let i = start; i < mappings.length; i++) {\n if (!isSorted(mappings[i]))\n return i;\n }\n return mappings.length;\n}\nfunction isSorted(line) {\n for (let j = 1; j < line.length; j++) {\n if (line[j][COLUMN] < line[j - 1][COLUMN]) {\n return false;\n }\n }\n return true;\n}\nfunction sortSegments(line, owned) {\n if (!owned)\n line = line.slice();\n return line.sort(sortComparator);\n}\nfunction sortComparator(a, b) {\n return a[COLUMN] - b[COLUMN];\n}\n\nlet found = false;\n/**\n * A binary search implementation that returns the index if a match is found.\n * If no match is found, then the left-index (the index associated with the item that comes just\n * before the desired index) is returned. To maintain proper sort order, a splice would happen at\n * the next index:\n *\n * ```js\n * const array = [1, 3];\n * const needle = 2;\n * const index = binarySearch(array, needle, (item, needle) => item - needle);\n *\n * assert.equal(index, 0);\n * array.splice(index + 1, 0, needle);\n * assert.deepEqual(array, [1, 2, 3]);\n * ```\n */\nfunction binarySearch(haystack, needle, low, high) {\n while (low <= high) {\n const mid = low + ((high - low) >> 1);\n const cmp = haystack[mid][COLUMN] - needle;\n if (cmp === 0) {\n found = true;\n return mid;\n }\n if (cmp < 0) {\n low = mid + 1;\n }\n else {\n high = mid - 1;\n }\n }\n found = false;\n return low - 1;\n}\nfunction upperBound(haystack, needle, index) {\n for (let i = index + 1; i < haystack.length; i++, index++) {\n if (haystack[i][COLUMN] !== needle)\n break;\n }\n return index;\n}\nfunction lowerBound(haystack, needle, index) {\n for (let i = index - 1; i >= 0; i--, index--) {\n if (haystack[i][COLUMN] !== needle)\n break;\n }\n return index;\n}\nfunction memoizedState() {\n return {\n lastKey: -1,\n lastNeedle: -1,\n lastIndex: -1,\n };\n}\n/**\n * This overly complicated beast is just to record the last tested line/column and the resulting\n * index, allowing us to skip a few tests if mappings are monotonically increasing.\n */\nfunction memoizedBinarySearch(haystack, needle, state, key) {\n const { lastKey, lastNeedle, lastIndex } = state;\n let low = 0;\n let high = haystack.length - 1;\n if (key === lastKey) {\n if (needle === lastNeedle) {\n found = lastIndex !== -1 && haystack[lastIndex][COLUMN] === needle;\n return lastIndex;\n }\n if (needle >= lastNeedle) {\n // lastIndex may be -1 if the previous needle was not found.\n low = lastIndex === -1 ? 0 : lastIndex;\n }\n else {\n high = lastIndex;\n }\n }\n state.lastKey = key;\n state.lastNeedle = needle;\n return (state.lastIndex = binarySearch(haystack, needle, low, high));\n}\n\n// Rebuilds the original source files, with mappings that are ordered by source line/column instead\n// of generated line/column.\nfunction buildBySources(decoded, memos) {\n const sources = memos.map(buildNullArray);\n for (let i = 0; i < decoded.length; i++) {\n const line = decoded[i];\n for (let j = 0; j < line.length; j++) {\n const seg = line[j];\n if (seg.length === 1)\n continue;\n const sourceIndex = seg[SOURCES_INDEX];\n const sourceLine = seg[SOURCE_LINE];\n const sourceColumn = seg[SOURCE_COLUMN];\n const originalSource = sources[sourceIndex];\n const originalLine = (originalSource[sourceLine] || (originalSource[sourceLine] = []));\n const memo = memos[sourceIndex];\n // The binary search either found a match, or it found the left-index just before where the\n // segment should go. Either way, we want to insert after that. And there may be multiple\n // generated segments associated with an original location, so there may need to move several\n // indexes before we find where we need to insert.\n const index = upperBound(originalLine, sourceColumn, memoizedBinarySearch(originalLine, sourceColumn, memo, sourceLine));\n insert(originalLine, (memo.lastIndex = index + 1), [sourceColumn, i, seg[COLUMN]]);\n }\n }\n return sources;\n}\nfunction insert(array, index, value) {\n for (let i = array.length; i > index; i--) {\n array[i] = array[i - 1];\n }\n array[index] = value;\n}\n// Null arrays allow us to use ordered index keys without actually allocating contiguous memory like\n// a real array. We use a null-prototype object to avoid prototype pollution and deoptimizations.\n// Numeric properties on objects are magically sorted in ascending order by the engine regardless of\n// the insertion order. So, by setting any numeric keys, even out of order, we'll get ascending\n// order when iterating with for-in.\nfunction buildNullArray() {\n return { __proto__: null };\n}\n\nconst AnyMap = function (map, mapUrl) {\n const parsed = typeof map === 'string' ? JSON.parse(map) : map;\n if (!('sections' in parsed))\n return new TraceMap(parsed, mapUrl);\n const mappings = [];\n const sources = [];\n const sourcesContent = [];\n const names = [];\n const { sections } = parsed;\n let i = 0;\n for (; i < sections.length - 1; i++) {\n const no = sections[i + 1].offset;\n addSection(sections[i], mapUrl, mappings, sources, sourcesContent, names, no.line, no.column);\n }\n if (sections.length > 0) {\n addSection(sections[i], mapUrl, mappings, sources, sourcesContent, names, Infinity, Infinity);\n }\n const joined = {\n version: 3,\n file: parsed.file,\n names,\n sources,\n sourcesContent,\n mappings,\n };\n return presortedDecodedMap(joined);\n};\nfunction addSection(section, mapUrl, mappings, sources, sourcesContent, names, stopLine, stopColumn) {\n const map = AnyMap(section.map, mapUrl);\n const { line: lineOffset, column: columnOffset } = section.offset;\n const sourcesOffset = sources.length;\n const namesOffset = names.length;\n const decoded = decodedMappings(map);\n const { resolvedSources } = map;\n append(sources, resolvedSources);\n append(sourcesContent, map.sourcesContent || fillSourcesContent(resolvedSources.length));\n append(names, map.names);\n // If this section jumps forwards several lines, we need to add lines to the output mappings catch up.\n for (let i = mappings.length; i <= lineOffset; i++)\n mappings.push([]);\n // We can only add so many lines before we step into the range that the next section's map\n // controls. When we get to the last line, then we'll start checking the segments to see if\n // they've crossed into the column range.\n const stopI = stopLine - lineOffset;\n const len = Math.min(decoded.length, stopI + 1);\n for (let i = 0; i < len; i++) {\n const line = decoded[i];\n // On the 0th loop, the line will already exist due to a previous section, or the line catch up\n // loop above.\n const out = i === 0 ? mappings[lineOffset] : (mappings[lineOffset + i] = []);\n // On the 0th loop, the section's column offset shifts us forward. On all other lines (since the\n // map can be multiple lines), it doesn't.\n const cOffset = i === 0 ? columnOffset : 0;\n for (let j = 0; j < line.length; j++) {\n const seg = line[j];\n const column = cOffset + seg[COLUMN];\n // If this segment steps into the column range that the next section's map controls, we need\n // to stop early.\n if (i === stopI && column >= stopColumn)\n break;\n if (seg.length === 1) {\n out.push([column]);\n continue;\n }\n const sourcesIndex = sourcesOffset + seg[SOURCES_INDEX];\n const sourceLine = seg[SOURCE_LINE];\n const sourceColumn = seg[SOURCE_COLUMN];\n if (seg.length === 4) {\n out.push([column, sourcesIndex, sourceLine, sourceColumn]);\n continue;\n }\n out.push([column, sourcesIndex, sourceLine, sourceColumn, namesOffset + seg[NAMES_INDEX]]);\n }\n }\n}\nfunction append(arr, other) {\n for (let i = 0; i < other.length; i++)\n arr.push(other[i]);\n}\n// Sourcemaps don't need to have sourcesContent, and if they don't, we need to create an array of\n// equal length to the sources. This is because the sources and sourcesContent are paired arrays,\n// where `sourcesContent[i]` is the content of the `sources[i]` file. If we didn't, then joined\n// sourcemap would desynchronize the sources/contents.\nfunction fillSourcesContent(len) {\n const sourcesContent = [];\n for (let i = 0; i < len; i++)\n sourcesContent[i] = null;\n return sourcesContent;\n}\n\nconst INVALID_ORIGINAL_MAPPING = Object.freeze({\n source: null,\n line: null,\n column: null,\n name: null,\n});\nconst INVALID_GENERATED_MAPPING = Object.freeze({\n line: null,\n column: null,\n});\nconst LINE_GTR_ZERO = '`line` must be greater than 0 (lines start at line 1)';\nconst COL_GTR_EQ_ZERO = '`column` must be greater than or equal to 0 (columns start at column 0)';\nconst LEAST_UPPER_BOUND = -1;\nconst GREATEST_LOWER_BOUND = 1;\n/**\n * Returns the encoded (VLQ string) form of the SourceMap's mappings field.\n */\nlet encodedMappings;\n/**\n * Returns the decoded (array of lines of segments) form of the SourceMap's mappings field.\n */\nlet decodedMappings;\n/**\n * A low-level API to find the segment associated with a generated line/column (think, from a\n * stack trace). Line and column here are 0-based, unlike `originalPositionFor`.\n */\nlet traceSegment;\n/**\n * A higher-level API to find the source/line/column associated with a generated line/column\n * (think, from a stack trace). Line is 1-based, but column is 0-based, due to legacy behavior in\n * `source-map` library.\n */\nlet originalPositionFor;\n/**\n * Finds the source/line/column directly after the mapping returned by originalPositionFor, provided\n * the found mapping is from the same source and line as the originalPositionFor mapping.\n *\n * Eg, in the code `let id = 1`, `originalPositionAfter` could find the mapping associated with `1`\n * using the same needle that would return `id` when calling `originalPositionFor`.\n */\nlet generatedPositionFor;\n/**\n * Iterates each mapping in generated position order.\n */\nlet eachMapping;\n/**\n * A helper that skips sorting of the input map's mappings array, which can be expensive for larger\n * maps.\n */\nlet presortedDecodedMap;\n/**\n * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects\n * a sourcemap, or to JSON.stringify.\n */\nlet decodedMap;\n/**\n * Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects\n * a sourcemap, or to JSON.stringify.\n */\nlet encodedMap;\nclass TraceMap {\n constructor(map, mapUrl) {\n this._decodedMemo = memoizedState();\n this._bySources = undefined;\n this._bySourceMemos = undefined;\n const isString = typeof map === 'string';\n if (!isString && map.constructor === TraceMap)\n return map;\n const parsed = (isString ? JSON.parse(map) : map);\n const { version, file, names, sourceRoot, sources, sourcesContent } = parsed;\n this.version = version;\n this.file = file;\n this.names = names;\n this.sourceRoot = sourceRoot;\n this.sources = sources;\n this.sourcesContent = sourcesContent;\n if (sourceRoot || mapUrl) {\n const from = resolve(sourceRoot || '', stripFilename(mapUrl));\n this.resolvedSources = sources.map((s) => resolve(s || '', from));\n }\n else {\n this.resolvedSources = sources.map((s) => s || '');\n }\n const { mappings } = parsed;\n if (typeof mappings === 'string') {\n this._encoded = mappings;\n this._decoded = undefined;\n }\n else {\n this._encoded = undefined;\n this._decoded = maybeSort(mappings, isString);\n }\n }\n}\n(() => {\n encodedMappings = (map) => {\n var _a;\n return ((_a = map._encoded) !== null && _a !== void 0 ? _a : (map._encoded = encode(map._decoded)));\n };\n decodedMappings = (map) => {\n return (map._decoded || (map._decoded = decode(map._encoded)));\n };\n traceSegment = (map, line, column) => {\n const decoded = decodedMappings(map);\n // It's common for parent source maps to have pointers to lines that have no\n // mapping (like a \"//# sourceMappingURL=\") at the end of the child file.\n if (line >= decoded.length)\n return null;\n return traceSegmentInternal(decoded[line], map._decodedMemo, line, column, GREATEST_LOWER_BOUND);\n };\n originalPositionFor = (map, { line, column, bias }) => {\n line--;\n if (line < 0)\n throw new Error(LINE_GTR_ZERO);\n if (column < 0)\n throw new Error(COL_GTR_EQ_ZERO);\n const decoded = decodedMappings(map);\n // It's common for parent source maps to have pointers to lines that have no\n // mapping (like a \"//# sourceMappingURL=\") at the end of the child file.\n if (line >= decoded.length)\n return INVALID_ORIGINAL_MAPPING;\n const segment = traceSegmentInternal(decoded[line], map._decodedMemo, line, column, bias || GREATEST_LOWER_BOUND);\n if (segment == null)\n return INVALID_ORIGINAL_MAPPING;\n if (segment.length == 1)\n return INVALID_ORIGINAL_MAPPING;\n const { names, resolvedSources } = map;\n return {\n source: resolvedSources[segment[SOURCES_INDEX]],\n line: segment[SOURCE_LINE] + 1,\n column: segment[SOURCE_COLUMN],\n name: segment.length === 5 ? names[segment[NAMES_INDEX]] : null,\n };\n };\n generatedPositionFor = (map, { source, line, column, bias }) => {\n line--;\n if (line < 0)\n throw new Error(LINE_GTR_ZERO);\n if (column < 0)\n throw new Error(COL_GTR_EQ_ZERO);\n const { sources, resolvedSources } = map;\n let sourceIndex = sources.indexOf(source);\n if (sourceIndex === -1)\n sourceIndex = resolvedSources.indexOf(source);\n if (sourceIndex === -1)\n return INVALID_GENERATED_MAPPING;\n const generated = (map._bySources || (map._bySources = buildBySources(decodedMappings(map), (map._bySourceMemos = sources.map(memoizedState)))));\n const memos = map._bySourceMemos;\n const segments = generated[sourceIndex][line];\n if (segments == null)\n return INVALID_GENERATED_MAPPING;\n const segment = traceSegmentInternal(segments, memos[sourceIndex], line, column, bias || GREATEST_LOWER_BOUND);\n if (segment == null)\n return INVALID_GENERATED_MAPPING;\n return {\n line: segment[REV_GENERATED_LINE] + 1,\n column: segment[REV_GENERATED_COLUMN],\n };\n };\n eachMapping = (map, cb) => {\n const decoded = decodedMappings(map);\n const { names, resolvedSources } = map;\n for (let i = 0; i < decoded.length; i++) {\n const line = decoded[i];\n for (let j = 0; j < line.length; j++) {\n const seg = line[j];\n const generatedLine = i + 1;\n const generatedColumn = seg[0];\n let source = null;\n let originalLine = null;\n let originalColumn = null;\n let name = null;\n if (seg.length !== 1) {\n source = resolvedSources[seg[1]];\n originalLine = seg[2] + 1;\n originalColumn = seg[3];\n }\n if (seg.length === 5)\n name = names[seg[4]];\n cb({\n generatedLine,\n generatedColumn,\n source,\n originalLine,\n originalColumn,\n name,\n });\n }\n }\n };\n presortedDecodedMap = (map, mapUrl) => {\n const clone = Object.assign({}, map);\n clone.mappings = [];\n const tracer = new TraceMap(clone, mapUrl);\n tracer._decoded = map.mappings;\n return tracer;\n };\n decodedMap = (map) => {\n return {\n version: 3,\n file: map.file,\n names: map.names,\n sourceRoot: map.sourceRoot,\n sources: map.sources,\n sourcesContent: map.sourcesContent,\n mappings: decodedMappings(map),\n };\n };\n encodedMap = (map) => {\n return {\n version: 3,\n file: map.file,\n names: map.names,\n sourceRoot: map.sourceRoot,\n sources: map.sources,\n sourcesContent: map.sourcesContent,\n mappings: encodedMappings(map),\n };\n };\n})();\nfunction traceSegmentInternal(segments, memo, line, column, bias) {\n let index = memoizedBinarySearch(segments, column, memo, line);\n if (found) {\n index = (bias === LEAST_UPPER_BOUND ? upperBound : lowerBound)(segments, column, index);\n }\n else if (bias === LEAST_UPPER_BOUND)\n index++;\n if (index === -1 || index === segments.length)\n return null;\n return segments[index];\n}\n\nexport { AnyMap, GREATEST_LOWER_BOUND, LEAST_UPPER_BOUND, TraceMap, decodedMap, decodedMappings, eachMapping, encodedMap, encodedMappings, generatedPositionFor, originalPositionFor, presortedDecodedMap, traceSegment };\n//# sourceMappingURL=trace-mapping.mjs.map\n","/**\n * Gets the index associated with `key` in the backing array, if it is already present.\n */\nlet get;\n/**\n * Puts `key` into the backing array, if it is not already present. Returns\n * the index of the `key` in the backing array.\n */\nlet put;\n/**\n * Pops the last added item out of the SetArray.\n */\nlet pop;\n/**\n * SetArray acts like a `Set` (allowing only one occurrence of a string `key`), but provides the\n * index of the `key` in the backing array.\n *\n * This is designed to allow synchronizing a second array with the contents of the backing array,\n * like how in a sourcemap `sourcesContent[i]` is the source content associated with `source[i]`,\n * and there are never duplicates.\n */\nclass SetArray {\n constructor() {\n this._indexes = { __proto__: null };\n this.array = [];\n }\n}\n(() => {\n get = (strarr, key) => strarr._indexes[key];\n put = (strarr, key) => {\n // The key may or may not be present. If it is present, it's a number.\n const index = get(strarr, key);\n if (index !== undefined)\n return index;\n const { array, _indexes: indexes } = strarr;\n return (indexes[key] = array.push(key) - 1);\n };\n pop = (strarr) => {\n const { array, _indexes: indexes } = strarr;\n if (array.length === 0)\n return;\n const last = array.pop();\n indexes[last] = undefined;\n };\n})();\n\nexport { SetArray, get, pop, put };\n//# sourceMappingURL=set-array.mjs.map\n","import { SetArray, put } from '@jridgewell/set-array';\nimport { encode } from '@jridgewell/sourcemap-codec';\nimport { TraceMap, decodedMappings } from '@jridgewell/trace-mapping';\n\nconst COLUMN = 0;\nconst SOURCES_INDEX = 1;\nconst SOURCE_LINE = 2;\nconst SOURCE_COLUMN = 3;\nconst NAMES_INDEX = 4;\n\nconst NO_NAME = -1;\n/**\n * A low-level API to associate a generated position with an original source position. Line and\n * column here are 0-based, unlike `addMapping`.\n */\nlet addSegment;\n/**\n * A high-level API to associate a generated position with an original source position. Line is\n * 1-based, but column is 0-based, due to legacy behavior in `source-map` library.\n */\nlet addMapping;\n/**\n * Same as `addSegment`, but will only add the segment if it generates useful information in the\n * resulting map. This only works correctly if segments are added **in order**, meaning you should\n * not add a segment with a lower generated line/column than one that came before.\n */\nlet maybeAddSegment;\n/**\n * Same as `addMapping`, but will only add the mapping if it generates useful information in the\n * resulting map. This only works correctly if mappings are added **in order**, meaning you should\n * not add a mapping with a lower generated line/column than one that came before.\n */\nlet maybeAddMapping;\n/**\n * Adds/removes the content of the source file to the source map.\n */\nlet setSourceContent;\n/**\n * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects\n * a sourcemap, or to JSON.stringify.\n */\nlet toDecodedMap;\n/**\n * Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects\n * a sourcemap, or to JSON.stringify.\n */\nlet toEncodedMap;\n/**\n * Constructs a new GenMapping, using the already present mappings of the input.\n */\nlet fromMap;\n/**\n * Returns an array of high-level mapping objects for every recorded segment, which could then be\n * passed to the `source-map` library.\n */\nlet allMappings;\n// This split declaration is only so that terser can elminiate the static initialization block.\nlet addSegmentInternal;\n/**\n * Provides the state to generate a sourcemap.\n */\nclass GenMapping {\n constructor({ file, sourceRoot } = {}) {\n this._names = new SetArray();\n this._sources = new SetArray();\n this._sourcesContent = [];\n this._mappings = [];\n this.file = file;\n this.sourceRoot = sourceRoot;\n }\n}\n(() => {\n addSegment = (map, genLine, genColumn, source, sourceLine, sourceColumn, name) => {\n return addSegmentInternal(false, map, genLine, genColumn, source, sourceLine, sourceColumn, name);\n };\n maybeAddSegment = (map, genLine, genColumn, source, sourceLine, sourceColumn, name) => {\n return addSegmentInternal(true, map, genLine, genColumn, source, sourceLine, sourceColumn, name);\n };\n addMapping = (map, mapping) => {\n return addMappingInternal(false, map, mapping);\n };\n maybeAddMapping = (map, mapping) => {\n return addMappingInternal(true, map, mapping);\n };\n setSourceContent = (map, source, content) => {\n const { _sources: sources, _sourcesContent: sourcesContent } = map;\n sourcesContent[put(sources, source)] = content;\n };\n toDecodedMap = (map) => {\n const { file, sourceRoot, _mappings: mappings, _sources: sources, _sourcesContent: sourcesContent, _names: names, } = map;\n removeEmptyFinalLines(mappings);\n return {\n version: 3,\n file: file || undefined,\n names: names.array,\n sourceRoot: sourceRoot || undefined,\n sources: sources.array,\n sourcesContent,\n mappings,\n };\n };\n toEncodedMap = (map) => {\n const decoded = toDecodedMap(map);\n return Object.assign(Object.assign({}, decoded), { mappings: encode(decoded.mappings) });\n };\n allMappings = (map) => {\n const out = [];\n const { _mappings: mappings, _sources: sources, _names: names } = map;\n for (let i = 0; i < mappings.length; i++) {\n const line = mappings[i];\n for (let j = 0; j < line.length; j++) {\n const seg = line[j];\n const generated = { line: i + 1, column: seg[COLUMN] };\n let source = undefined;\n let original = undefined;\n let name = undefined;\n if (seg.length !== 1) {\n source = sources.array[seg[SOURCES_INDEX]];\n original = { line: seg[SOURCE_LINE] + 1, column: seg[SOURCE_COLUMN] };\n if (seg.length === 5)\n name = names.array[seg[NAMES_INDEX]];\n }\n out.push({ generated, source, original, name });\n }\n }\n return out;\n };\n fromMap = (input) => {\n const map = new TraceMap(input);\n const gen = new GenMapping({ file: map.file, sourceRoot: map.sourceRoot });\n putAll(gen._names, map.names);\n putAll(gen._sources, map.sources);\n gen._sourcesContent = map.sourcesContent || map.sources.map(() => null);\n gen._mappings = decodedMappings(map);\n return gen;\n };\n // Internal helpers\n addSegmentInternal = (skipable, map, genLine, genColumn, source, sourceLine, sourceColumn, name) => {\n const { _mappings: mappings, _sources: sources, _sourcesContent: sourcesContent, _names: names, } = map;\n const line = getLine(mappings, genLine);\n const index = getColumnIndex(line, genColumn);\n if (!source) {\n if (skipable && skipSourceless(line, index))\n return;\n return insert(line, index, [genColumn]);\n }\n const sourcesIndex = put(sources, source);\n const namesIndex = name ? put(names, name) : NO_NAME;\n if (sourcesIndex === sourcesContent.length)\n sourcesContent[sourcesIndex] = null;\n if (skipable && skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex)) {\n return;\n }\n return insert(line, index, name\n ? [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex]\n : [genColumn, sourcesIndex, sourceLine, sourceColumn]);\n };\n})();\nfunction getLine(mappings, index) {\n for (let i = mappings.length; i <= index; i++) {\n mappings[i] = [];\n }\n return mappings[index];\n}\nfunction getColumnIndex(line, genColumn) {\n let index = line.length;\n for (let i = index - 1; i >= 0; index = i--) {\n const current = line[i];\n if (genColumn >= current[COLUMN])\n break;\n }\n return index;\n}\nfunction insert(array, index, value) {\n for (let i = array.length; i > index; i--) {\n array[i] = array[i - 1];\n }\n array[index] = value;\n}\nfunction removeEmptyFinalLines(mappings) {\n const { length } = mappings;\n let len = length;\n for (let i = len - 1; i >= 0; len = i, i--) {\n if (mappings[i].length > 0)\n break;\n }\n if (len < length)\n mappings.length = len;\n}\nfunction putAll(strarr, array) {\n for (let i = 0; i < array.length; i++)\n put(strarr, array[i]);\n}\nfunction skipSourceless(line, index) {\n // The start of a line is already sourceless, so adding a sourceless segment to the beginning\n // doesn't generate any useful information.\n if (index === 0)\n return true;\n const prev = line[index - 1];\n // If the previous segment is also sourceless, then adding another sourceless segment doesn't\n // genrate any new information. Else, this segment will end the source/named segment and point to\n // a sourceless position, which is useful.\n return prev.length === 1;\n}\nfunction skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex) {\n // A source/named segment at the start of a line gives position at that genColumn\n if (index === 0)\n return false;\n const prev = line[index - 1];\n // If the previous segment is sourceless, then we're transitioning to a source.\n if (prev.length === 1)\n return false;\n // If the previous segment maps to the exact same source position, then this segment doesn't\n // provide any new position information.\n return (sourcesIndex === prev[SOURCES_INDEX] &&\n sourceLine === prev[SOURCE_LINE] &&\n sourceColumn === prev[SOURCE_COLUMN] &&\n namesIndex === (prev.length === 5 ? prev[NAMES_INDEX] : NO_NAME));\n}\nfunction addMappingInternal(skipable, map, mapping) {\n const { generated, source, original, name } = mapping;\n if (!source) {\n return addSegmentInternal(skipable, map, generated.line - 1, generated.column, null, null, null, null);\n }\n const s = source;\n return addSegmentInternal(skipable, map, generated.line - 1, generated.column, s, original.line - 1, original.column, name);\n}\n\nexport { GenMapping, addMapping, addSegment, allMappings, fromMap, maybeAddMapping, maybeAddSegment, setSourceContent, toDecodedMap, toEncodedMap };\n//# sourceMappingURL=gen-mapping.mjs.map\n","import { AnyMap, originalPositionFor } from '@jridgewell/trace-mapping';\nimport {\n GenMapping,\n maybeAddMapping,\n toDecodedMap,\n toEncodedMap,\n setSourceContent,\n} from '@jridgewell/gen-mapping';\n\nimport type { TraceMap, SectionedSourceMapInput } from '@jridgewell/trace-mapping';\nexport type { TraceMap, SectionedSourceMapInput };\n\nimport type { Mapping, EncodedSourceMap, DecodedSourceMap } from '@jridgewell/gen-mapping';\nexport type { Mapping, EncodedSourceMap, DecodedSourceMap };\n\nexport class SourceMapConsumer {\n private declare _map: TraceMap;\n declare file: TraceMap['file'];\n declare names: TraceMap['names'];\n declare sourceRoot: TraceMap['sourceRoot'];\n declare sources: TraceMap['sources'];\n declare sourcesContent: TraceMap['sourcesContent'];\n\n constructor(map: ConstructorParameters[0], mapUrl: Parameters[1]) {\n const trace = (this._map = new AnyMap(map, mapUrl));\n\n this.file = trace.file;\n this.names = trace.names;\n this.sourceRoot = trace.sourceRoot;\n this.sources = trace.resolvedSources;\n this.sourcesContent = trace.sourcesContent;\n }\n\n originalPositionFor(\n needle: Parameters[1],\n ): ReturnType {\n return originalPositionFor(this._map, needle);\n }\n\n destroy() {\n // noop.\n }\n}\n\nexport class SourceMapGenerator {\n private declare _map: GenMapping;\n\n constructor(opts: ConstructorParameters[0]) {\n this._map = new GenMapping(opts);\n }\n\n addMapping(mapping: Parameters[1]): ReturnType {\n maybeAddMapping(this._map, mapping);\n }\n\n setSourceContent(\n source: Parameters[1],\n content: Parameters[2],\n ): ReturnType {\n setSourceContent(this._map, source, content);\n }\n\n toJSON(): ReturnType {\n return toEncodedMap(this._map);\n }\n\n toDecodedMap(): ReturnType {\n return toDecodedMap(this._map);\n }\n}\n"],"names":["sortComparator","resolve","resolveUri","COLUMN","SOURCES_INDEX","SOURCE_LINE","SOURCE_COLUMN","NAMES_INDEX"],"mappings":";;;;;;IAAA,MAAM,KAAK,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;IAChC,MAAM,SAAS,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;IACpC,MAAM,KAAK,GAAG,kEAAkE,CAAC;IACjF,MAAM,SAAS,GAAG,IAAI,UAAU,CAAC,EAAE,CAAC,CAAC;IACrC,MAAM,aAAa,GAAG,IAAI,UAAU,CAAC,GAAG,CAAC,CAAC;IAC1C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;IACvC,IAAI,MAAM,CAAC,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;IAClC,IAAI,aAAa,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IACzB,IAAI,SAAS,CAAC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UAAU,GAAG,KAAK,CAAC,UAAU,CAAC;YACnC,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,eAAe,CAAC;YACrC,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC,cAAc,CAAC;SAC5C;QAED,mBAAmB,CACjB,MAAiD;YAEjD,OAAO,mBAAmB,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;SAC/C;QAED,OAAO;;SAEN;KACF;UAEY,kBAAkB;QAG7B,YAAY,IAAiD;YAC3D,IAAI,CAAC,IAAI,GAAG,IAAI,UAAU,CAAC,IAAI,CAAC,CAAC;SAClC;QAED,UAAU,CAAC,OAA8C;YACvD,eAAe,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;SACrC;QAED,gBAAgB,CACd,MAA8C,EAC9C,OAA+C;YAE/C,gBAAgB,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;SAC9C;QAED,MAAM;YACJ,OAAO,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;SAChC;QAED,YAAY;YACV,OAAO,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;SAChC;;;;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/@jridgewell/source-map/dist/types/source-map.d.ts b/node_modules/@jridgewell/source-map/dist/types/source-map.d.ts new file mode 100644 index 0000000..25ec1d0 --- /dev/null +++ b/node_modules/@jridgewell/source-map/dist/types/source-map.d.ts @@ -0,0 +1,25 @@ +import { AnyMap, originalPositionFor } from '@jridgewell/trace-mapping'; +import { GenMapping, maybeAddMapping, toDecodedMap, toEncodedMap, setSourceContent } from '@jridgewell/gen-mapping'; +import type { TraceMap, SectionedSourceMapInput } from '@jridgewell/trace-mapping'; +export type { TraceMap, SectionedSourceMapInput }; +import type { Mapping, EncodedSourceMap, DecodedSourceMap } from '@jridgewell/gen-mapping'; +export type { Mapping, EncodedSourceMap, DecodedSourceMap }; +export declare class SourceMapConsumer { + private _map; + file: TraceMap['file']; + names: TraceMap['names']; + sourceRoot: TraceMap['sourceRoot']; + sources: TraceMap['sources']; + sourcesContent: TraceMap['sourcesContent']; + constructor(map: ConstructorParameters[0], mapUrl: Parameters[1]); + originalPositionFor(needle: Parameters[1]): ReturnType; + destroy(): void; +} +export declare class SourceMapGenerator { + private _map; + constructor(opts: ConstructorParameters[0]); + addMapping(mapping: Parameters[1]): ReturnType; + setSourceContent(source: Parameters[1], content: Parameters[2]): ReturnType; + toJSON(): ReturnType; + toDecodedMap(): ReturnType; +} diff --git a/node_modules/@jridgewell/source-map/package.json b/node_modules/@jridgewell/source-map/package.json new file mode 100644 index 0000000..87f1650 --- /dev/null +++ b/node_modules/@jridgewell/source-map/package.json @@ -0,0 +1,71 @@ +{ + "name": "@jridgewell/source-map", + "version": "0.3.5", + "description": "Packages @jridgewell/trace-mapping and @jridgewell/gen-mapping into the familiar source-map API", + "keywords": [ + "sourcemap", + "source", + "map" + ], + "author": "Justin Ridgewell ", + "license": "MIT", + "repository": "https://github.com/jridgewell/source-map", + "main": "dist/source-map.umd.js", + "module": "dist/source-map.mjs", + "types": "dist/types/source-map.d.ts", + "exports": { + ".": [ + { + "types": "./dist/types/source-map.d.ts", + "browser": "./dist/source-map.umd.js", + "require": "./dist/source-map.umd.js", + "import": "./dist/source-map.mjs" + }, + "./dist/source-map.umd.js" + ], + "./package.json": "./package.json" + }, + "files": [ + "dist" + ], + "scripts": { + "prebuild": "rm -rf dist", + "build": "run-s -n build:*", + "build:rollup": "rollup -c rollup.config.js", + "build:ts": "tsc --project tsconfig.build.json", + "lint": "run-s -n lint:*", + "lint:prettier": "npm run test:lint:prettier -- --write", + "lint:ts": "npm run test:lint:ts -- --fix", + "pretest": "run-s build:rollup", + "test": "run-s -n test:lint test:only", + "test:debug": "mocha --inspect-brk", + "test:lint": "run-s -n test:lint:*", + "test:lint:prettier": "prettier --check '{src,test}/**/*.ts'", + "test:lint:ts": "eslint '{src,test}/**/*.ts'", + "test:only": "mocha", + "test:coverage": "c8 mocha", + "test:watch": "mocha --watch", + "prepublishOnly": "npm run preversion", + "preversion": "run-s test build" + }, + "devDependencies": { + "@rollup/plugin-node-resolve": "13.2.1", + "@rollup/plugin-typescript": "8.3.0", + "@types/mocha": "9.1.1", + "@types/node": "17.0.30", + "@typescript-eslint/eslint-plugin": "5.10.0", + "@typescript-eslint/parser": "5.10.0", + "c8": "7.11.0", + "eslint": "8.7.0", + "eslint-config-prettier": "8.3.0", + "mocha": "9.2.0", + "npm-run-all": "4.1.5", + "prettier": "2.5.1", + "rollup": "2.66.0", + "typescript": "4.5.5" + }, + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.0", + "@jridgewell/trace-mapping": "^0.3.9" + } +} diff --git a/node_modules/@jridgewell/sourcemap-codec/LICENSE b/node_modules/@jridgewell/sourcemap-codec/LICENSE new file mode 100644 index 0000000..a331065 --- /dev/null +++ b/node_modules/@jridgewell/sourcemap-codec/LICENSE @@ -0,0 +1,21 @@ +The MIT License + +Copyright (c) 2015 Rich Harris + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/@jridgewell/sourcemap-codec/README.md b/node_modules/@jridgewell/sourcemap-codec/README.md new file mode 100644 index 0000000..5cbb315 --- /dev/null +++ b/node_modules/@jridgewell/sourcemap-codec/README.md @@ -0,0 +1,200 @@ +# @jridgewell/sourcemap-codec + +Encode/decode the `mappings` property of a [sourcemap](https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit). + + +## Why? + +Sourcemaps are difficult to generate and manipulate, because the `mappings` property – the part that actually links the generated code back to the original source – is encoded using an obscure method called [Variable-length quantity](https://en.wikipedia.org/wiki/Variable-length_quantity). On top of that, each segment in the mapping contains offsets rather than absolute indices, which means that you can't look at a segment in isolation – you have to understand the whole sourcemap. + +This package makes the process slightly easier. + + +## Installation + +```bash +npm install @jridgewell/sourcemap-codec +``` + + +## Usage + +```js +import { encode, decode } from '@jridgewell/sourcemap-codec'; + +var decoded = decode( ';EAEEA,EAAE,EAAC,CAAE;ECQY,UACC' ); + +assert.deepEqual( decoded, [ + // the first line (of the generated code) has no mappings, + // as shown by the starting semi-colon (which separates lines) + [], + + // the second line contains four (comma-separated) segments + [ + // segments are encoded as you'd expect: + // [ generatedCodeColumn, sourceIndex, sourceCodeLine, sourceCodeColumn, nameIndex ] + + // i.e. the first segment begins at column 2, and maps back to the second column + // of the second line (both zero-based) of the 0th source, and uses the 0th + // name in the `map.names` array + [ 2, 0, 2, 2, 0 ], + + // the remaining segments are 4-length rather than 5-length, + // because they don't map a name + [ 4, 0, 2, 4 ], + [ 6, 0, 2, 5 ], + [ 7, 0, 2, 7 ] + ], + + // the final line contains two segments + [ + [ 2, 1, 10, 19 ], + [ 12, 1, 11, 20 ] + ] +]); + +var encoded = encode( decoded ); +assert.equal( encoded, ';EAEEA,EAAE,EAAC,CAAE;ECQY,UACC' ); +``` + +## Benchmarks + +``` +node v18.0.0 + +amp.js.map - 45120 segments + +Decode Memory Usage: +@jridgewell/sourcemap-codec 5479160 bytes +sourcemap-codec 5659336 bytes +source-map-0.6.1 17144440 bytes +source-map-0.8.0 6867424 bytes +Smallest memory usage is @jridgewell/sourcemap-codec + +Decode speed: +decode: @jridgewell/sourcemap-codec x 502 ops/sec ±1.03% (90 runs sampled) +decode: sourcemap-codec x 445 ops/sec ±0.97% (92 runs sampled) +decode: source-map-0.6.1 x 36.01 ops/sec ±1.64% (49 runs sampled) +decode: source-map-0.8.0 x 367 ops/sec ±0.04% (95 runs sampled) +Fastest is decode: @jridgewell/sourcemap-codec + +Encode Memory Usage: +@jridgewell/sourcemap-codec 1261620 bytes +sourcemap-codec 9119248 bytes +source-map-0.6.1 8968560 bytes +source-map-0.8.0 8952952 bytes +Smallest memory usage is @jridgewell/sourcemap-codec + +Encode speed: +encode: @jridgewell/sourcemap-codec x 738 ops/sec ±0.42% (98 runs sampled) +encode: sourcemap-codec x 238 ops/sec ±0.73% (88 runs sampled) +encode: source-map-0.6.1 x 162 ops/sec ±0.43% (84 runs sampled) +encode: source-map-0.8.0 x 191 ops/sec ±0.34% (90 runs sampled) +Fastest is encode: @jridgewell/sourcemap-codec + + +*** + + +babel.min.js.map - 347793 segments + +Decode Memory Usage: +@jridgewell/sourcemap-codec 35338184 bytes +sourcemap-codec 35922736 bytes +source-map-0.6.1 62366360 bytes +source-map-0.8.0 44337416 bytes +Smallest memory usage is @jridgewell/sourcemap-codec + +Decode speed: +decode: @jridgewell/sourcemap-codec x 40.35 ops/sec ±4.47% (54 runs sampled) +decode: sourcemap-codec x 36.76 ops/sec ±3.67% (51 runs sampled) +decode: source-map-0.6.1 x 4.44 ops/sec ±2.15% (16 runs sampled) +decode: source-map-0.8.0 x 59.35 ops/sec ±0.05% (78 runs sampled) +Fastest is decode: source-map-0.8.0 + +Encode Memory Usage: +@jridgewell/sourcemap-codec 7212604 bytes +sourcemap-codec 21421456 bytes +source-map-0.6.1 25286888 bytes +source-map-0.8.0 25498744 bytes +Smallest memory usage is @jridgewell/sourcemap-codec + +Encode speed: +encode: @jridgewell/sourcemap-codec x 112 ops/sec ±0.13% (84 runs sampled) +encode: sourcemap-codec x 30.23 ops/sec ±2.76% (53 runs sampled) +encode: source-map-0.6.1 x 19.43 ops/sec ±3.70% (37 runs sampled) +encode: source-map-0.8.0 x 19.40 ops/sec ±3.26% (37 runs sampled) +Fastest is encode: @jridgewell/sourcemap-codec + + +*** + + +preact.js.map - 1992 segments + +Decode Memory Usage: +@jridgewell/sourcemap-codec 500272 bytes +sourcemap-codec 516864 bytes +source-map-0.6.1 1596672 bytes +source-map-0.8.0 517272 bytes +Smallest memory usage is @jridgewell/sourcemap-codec + +Decode speed: +decode: @jridgewell/sourcemap-codec x 16,137 ops/sec ±0.17% (99 runs sampled) +decode: sourcemap-codec x 12,139 ops/sec ±0.13% (99 runs sampled) +decode: source-map-0.6.1 x 1,264 ops/sec ±0.12% (100 runs sampled) +decode: source-map-0.8.0 x 9,894 ops/sec ±0.08% (101 runs sampled) +Fastest is decode: @jridgewell/sourcemap-codec + +Encode Memory Usage: +@jridgewell/sourcemap-codec 321026 bytes +sourcemap-codec 830832 bytes +source-map-0.6.1 586608 bytes +source-map-0.8.0 586680 bytes +Smallest memory usage is @jridgewell/sourcemap-codec + +Encode speed: +encode: @jridgewell/sourcemap-codec x 19,876 ops/sec ±0.78% (95 runs sampled) +encode: sourcemap-codec x 6,983 ops/sec ±0.15% (100 runs sampled) +encode: source-map-0.6.1 x 5,070 ops/sec ±0.12% (102 runs sampled) +encode: source-map-0.8.0 x 5,641 ops/sec ±0.17% (100 runs sampled) +Fastest is encode: @jridgewell/sourcemap-codec + + +*** + + +react.js.map - 5726 segments + +Decode Memory Usage: +@jridgewell/sourcemap-codec 734848 bytes +sourcemap-codec 954200 bytes +source-map-0.6.1 2276432 bytes +source-map-0.8.0 955488 bytes +Smallest memory usage is @jridgewell/sourcemap-codec + +Decode speed: +decode: @jridgewell/sourcemap-codec x 5,723 ops/sec ±0.12% (98 runs sampled) +decode: sourcemap-codec x 4,555 ops/sec ±0.09% (101 runs sampled) +decode: source-map-0.6.1 x 437 ops/sec ±0.11% (93 runs sampled) +decode: source-map-0.8.0 x 3,441 ops/sec ±0.15% (100 runs sampled) +Fastest is decode: @jridgewell/sourcemap-codec + +Encode Memory Usage: +@jridgewell/sourcemap-codec 638672 bytes +sourcemap-codec 1109840 bytes +source-map-0.6.1 1321224 bytes +source-map-0.8.0 1324448 bytes +Smallest memory usage is @jridgewell/sourcemap-codec + +Encode speed: +encode: @jridgewell/sourcemap-codec x 6,801 ops/sec ±0.48% (98 runs sampled) +encode: sourcemap-codec x 2,533 ops/sec ±0.13% (101 runs sampled) +encode: source-map-0.6.1 x 2,248 ops/sec ±0.08% (100 runs sampled) +encode: source-map-0.8.0 x 2,303 ops/sec ±0.15% (100 runs sampled) +Fastest is encode: @jridgewell/sourcemap-codec +``` + +# License + +MIT diff --git a/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs b/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs new file mode 100644 index 0000000..3dff372 --- /dev/null +++ b/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs @@ -0,0 +1,164 @@ +const comma = ','.charCodeAt(0); +const semicolon = ';'.charCodeAt(0); +const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; +const intToChar = new Uint8Array(64); // 64 possible chars. +const charToInt = new Uint8Array(128); // z is 122 in ASCII +for (let i = 0; i < chars.length; i++) { + const c = chars.charCodeAt(i); + intToChar[i] = c; + charToInt[c] = i; +} +// Provide a fallback for older environments. +const td = typeof TextDecoder !== 'undefined' + ? /* #__PURE__ */ new TextDecoder() + : typeof Buffer !== 'undefined' + ? { + decode(buf) { + const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength); + return out.toString(); + }, + } + : { + decode(buf) { + let out = ''; + for (let i = 0; i < buf.length; i++) { + out += String.fromCharCode(buf[i]); + } + return out; + }, + }; +function decode(mappings) { + const state = new Int32Array(5); + const decoded = []; + let index = 0; + do { + const semi = indexOf(mappings, index); + const line = []; + let sorted = true; + let lastCol = 0; + state[0] = 0; + for (let i = index; i < semi; i++) { + let seg; + i = decodeInteger(mappings, i, state, 0); // genColumn + const col = state[0]; + if (col < lastCol) + sorted = false; + lastCol = col; + if (hasMoreVlq(mappings, i, semi)) { + i = decodeInteger(mappings, i, state, 1); // sourcesIndex + i = decodeInteger(mappings, i, state, 2); // sourceLine + i = decodeInteger(mappings, i, state, 3); // sourceColumn + if (hasMoreVlq(mappings, i, semi)) { + i = decodeInteger(mappings, i, state, 4); // namesIndex + seg = [col, state[1], state[2], state[3], state[4]]; + } + else { + seg = [col, state[1], state[2], state[3]]; + } + } + else { + seg = [col]; + } + line.push(seg); + } + if (!sorted) + sort(line); + decoded.push(line); + index = semi + 1; + } while (index <= mappings.length); + return decoded; +} +function indexOf(mappings, index) { + const idx = mappings.indexOf(';', index); + return idx === -1 ? mappings.length : idx; +} +function decodeInteger(mappings, pos, state, j) { + let value = 0; + let shift = 0; + let integer = 0; + do { + const c = mappings.charCodeAt(pos++); + integer = charToInt[c]; + value |= (integer & 31) << shift; + shift += 5; + } while (integer & 32); + const shouldNegate = value & 1; + value >>>= 1; + if (shouldNegate) { + value = -0x80000000 | -value; + } + state[j] += value; + return pos; +} +function hasMoreVlq(mappings, i, length) { + if (i >= length) + return false; + return mappings.charCodeAt(i) !== comma; +} +function sort(line) { + line.sort(sortComparator); +} +function sortComparator(a, b) { + return a[0] - b[0]; +} +function encode(decoded) { + const state = new Int32Array(5); + const bufLength = 1024 * 16; + const subLength = bufLength - 36; + const buf = new Uint8Array(bufLength); + const sub = buf.subarray(0, subLength); + let pos = 0; + let out = ''; + for (let i = 0; i < decoded.length; i++) { + const line = decoded[i]; + if (i > 0) { + if (pos === bufLength) { + out += td.decode(buf); + pos = 0; + } + buf[pos++] = semicolon; + } + if (line.length === 0) + continue; + state[0] = 0; + for (let j = 0; j < line.length; j++) { + const segment = line[j]; + // We can push up to 5 ints, each int can take at most 7 chars, and we + // may push a comma. + if (pos > subLength) { + out += td.decode(sub); + buf.copyWithin(0, subLength, pos); + pos -= subLength; + } + if (j > 0) + buf[pos++] = comma; + pos = encodeInteger(buf, pos, state, segment, 0); // genColumn + if (segment.length === 1) + continue; + pos = encodeInteger(buf, pos, state, segment, 1); // sourcesIndex + pos = encodeInteger(buf, pos, state, segment, 2); // sourceLine + pos = encodeInteger(buf, pos, state, segment, 3); // sourceColumn + if (segment.length === 4) + continue; + pos = encodeInteger(buf, pos, state, segment, 4); // namesIndex + } + } + return out + td.decode(buf.subarray(0, pos)); +} +function encodeInteger(buf, pos, state, segment, j) { + const next = segment[j]; + let num = next - state[j]; + state[j] = next; + num = num < 0 ? (-num << 1) | 1 : num << 1; + do { + let clamped = num & 0b011111; + num >>>= 5; + if (num > 0) + clamped |= 0b100000; + buf[pos++] = intToChar[clamped]; + } while (num > 0); + return pos; +} + +export { decode, encode }; +//# sourceMappingURL=sourcemap-codec.mjs.map diff --git a/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs.map b/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs.map new file mode 100644 index 0000000..236fd12 --- /dev/null +++ b/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"sourcemap-codec.mjs","sources":["../src/sourcemap-codec.ts"],"sourcesContent":["export type SourceMapSegment =\n | [number]\n | [number, number, number, number]\n | [number, number, number, number, number];\nexport type SourceMapLine = SourceMapSegment[];\nexport type SourceMapMappings = SourceMapLine[];\n\nconst comma = ','.charCodeAt(0);\nconst semicolon = ';'.charCodeAt(0);\nconst chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\nconst intToChar = new Uint8Array(64); // 64 possible chars.\nconst charToInt = new Uint8Array(128); // z is 122 in ASCII\n\nfor (let i = 0; i < chars.length; i++) {\n const c = chars.charCodeAt(i);\n intToChar[i] = c;\n charToInt[c] = i;\n}\n\n// Provide a fallback for older environments.\nconst td =\n typeof TextDecoder !== 'undefined'\n ? /* #__PURE__ */ new TextDecoder()\n : typeof Buffer !== 'undefined'\n ? {\n decode(buf: Uint8Array) {\n const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength);\n return out.toString();\n },\n }\n : {\n decode(buf: Uint8Array) {\n let out = '';\n for (let i = 0; i < buf.length; i++) {\n out += String.fromCharCode(buf[i]);\n }\n return out;\n },\n };\n\nexport function decode(mappings: string): SourceMapMappings {\n const state: [number, number, number, number, number] = new Int32Array(5) as any;\n const decoded: SourceMapMappings = [];\n\n let index = 0;\n do {\n const semi = indexOf(mappings, index);\n const line: SourceMapLine = [];\n let sorted = true;\n let lastCol = 0;\n state[0] = 0;\n\n for (let i = index; i < semi; i++) {\n let seg: SourceMapSegment;\n\n i = decodeInteger(mappings, i, state, 0); // genColumn\n const col = state[0];\n if (col < lastCol) sorted = false;\n lastCol = col;\n\n if (hasMoreVlq(mappings, i, semi)) {\n i = decodeInteger(mappings, i, state, 1); // sourcesIndex\n i = decodeInteger(mappings, i, state, 2); // sourceLine\n i = decodeInteger(mappings, i, state, 3); // sourceColumn\n\n if (hasMoreVlq(mappings, i, semi)) {\n i = decodeInteger(mappings, i, state, 4); // namesIndex\n seg = [col, state[1], state[2], state[3], state[4]];\n } else {\n seg = [col, state[1], state[2], state[3]];\n }\n } else {\n seg = [col];\n }\n\n line.push(seg);\n }\n\n if (!sorted) sort(line);\n decoded.push(line);\n index = semi + 1;\n } while (index <= mappings.length);\n\n return decoded;\n}\n\nfunction indexOf(mappings: string, index: number): number {\n const idx = mappings.indexOf(';', index);\n return idx === -1 ? mappings.length : idx;\n}\n\nfunction decodeInteger(mappings: string, pos: number, state: SourceMapSegment, j: number): number {\n let value = 0;\n let shift = 0;\n let integer = 0;\n\n do {\n const c = mappings.charCodeAt(pos++);\n integer = charToInt[c];\n value |= (integer & 31) << shift;\n shift += 5;\n } while (integer & 32);\n\n const shouldNegate = value & 1;\n value >>>= 1;\n\n if (shouldNegate) {\n value = -0x80000000 | -value;\n }\n\n state[j] += value;\n return pos;\n}\n\nfunction hasMoreVlq(mappings: string, i: number, length: number): boolean {\n if (i >= length) return false;\n return mappings.charCodeAt(i) !== comma;\n}\n\nfunction sort(line: SourceMapSegment[]) {\n line.sort(sortComparator);\n}\n\nfunction sortComparator(a: SourceMapSegment, b: SourceMapSegment): number {\n return a[0] - b[0];\n}\n\nexport function encode(decoded: SourceMapMappings): string;\nexport function encode(decoded: Readonly): string;\nexport function encode(decoded: Readonly): string {\n const state: [number, number, number, number, number] = new Int32Array(5) as any;\n const bufLength = 1024 * 16;\n const subLength = bufLength - 36;\n const buf = new Uint8Array(bufLength);\n const sub = buf.subarray(0, subLength);\n let pos = 0;\n let out = '';\n\n for (let i = 0; i < decoded.length; i++) {\n const line = decoded[i];\n if (i > 0) {\n if (pos === bufLength) {\n out += td.decode(buf);\n pos = 0;\n }\n buf[pos++] = semicolon;\n }\n if (line.length === 0) continue;\n\n state[0] = 0;\n\n for (let j = 0; j < line.length; j++) {\n const segment = line[j];\n // We can push up to 5 ints, each int can take at most 7 chars, and we\n // may push a comma.\n if (pos > subLength) {\n out += td.decode(sub);\n buf.copyWithin(0, subLength, pos);\n pos -= subLength;\n }\n if (j > 0) buf[pos++] = comma;\n\n pos = encodeInteger(buf, pos, state, segment, 0); // genColumn\n\n if (segment.length === 1) continue;\n pos = encodeInteger(buf, pos, state, segment, 1); // sourcesIndex\n pos = encodeInteger(buf, pos, state, segment, 2); // sourceLine\n pos = encodeInteger(buf, pos, state, segment, 3); // sourceColumn\n\n if (segment.length === 4) continue;\n pos = encodeInteger(buf, pos, state, segment, 4); // namesIndex\n }\n }\n\n return out + td.decode(buf.subarray(0, pos));\n}\n\nfunction encodeInteger(\n buf: Uint8Array,\n pos: number,\n state: SourceMapSegment,\n segment: SourceMapSegment,\n j: number,\n): number {\n const next = segment[j];\n let num = next - state[j];\n state[j] = next;\n\n num = num < 0 ? (-num << 1) | 1 : num << 1;\n do {\n let clamped = num & 0b011111;\n num >>>= 5;\n if (num > 0) clamped |= 0b100000;\n buf[pos++] = intToChar[clamped];\n } while (num > 0);\n\n return pos;\n}\n"],"names":[],"mappings":"AAOA,MAAM,KAAK,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;AAChC,MAAM,SAAS,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;AACpC,MAAM,KAAK,GAAG,kEAAkE,CAAC;AACjF,MAAM,SAAS,GAAG,IAAI,UAAU,CAAC,EAAE,CAAC,CAAC;AACrC,MAAM,SAAS,GAAG,IAAI,UAAU,CAAC,GAAG,CAAC,CAAC;AAEtC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;IACrC,MAAM,CAAC,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;IAC9B,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IACjB,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;CAClB;AAED;AACA,MAAM,EAAE,GACN,OAAO,WAAW,KAAK,WAAW;sBACd,IAAI,WAAW,EAAE;MACjC,OAAO,MAAM,KAAK,WAAW;UAC7B;YACE,MAAM,CAAC,GAAe;gBACpB,MAAM,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,UAAU,EAAE,GAAG,CAAC,UAAU,CAAC,CAAC;gBACpE,OAAO,GAAG,CAAC,QAAQ,EAAE,CAAC;aACvB;SACF;UACD;YACE,MAAM,CAAC,GAAe;gBACpB,IAAI,GAAG,GAAG,EAAE,CAAC;gBACb,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;oBACnC,GAAG,IAAI,MAAM,CAAC,YAAY,CAAC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AAO,EAAE,CAAC,CAAC,CAAC;YACjD,GAAG,GAAG,aAAa,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC;YAEjD,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;gBAAE,SAAS;YACnC,GAAG,GAAG,aAAa,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC;SAClD;KACF;IAED,OAAO,GAAG,GAAG,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;AAC/C,CAAC;AAED,SAAS,aAAa,CACpB,GAAe,EACf,GAAW,EACX,KAAuB,EACvB,OAAyB,EACzB,CAAS;IAET,MAAM,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IACxB,IAAI,GAAG,GAAG,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IAC1B,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;IAEhB,GAAG,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,CAAC;IAC3C,GAAG;QACD,IAAI,OAAO,GAAG,GAAG,GAAG,QAAQ,CAAC;QAC7B,GAAG,MAAM,CAAC,CAAC;QACX,IAAI,GAAG,GAAG,CAAC;YAAE,OAAO,IAAI,QAAQ,CAAC;QACjC,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC;KACjC,QAAQ,GAAG,GAAG,CAAC,EAAE;IAElB,OAAO,GAAG,CAAC;AACb;;;;"} \ No newline at end of file diff --git a/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js b/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js new file mode 100644 index 0000000..bec92a9 --- /dev/null +++ b/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js @@ -0,0 +1,175 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : + typeof define === 'function' && define.amd ? define(['exports'], factory) : + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.sourcemapCodec = {})); +})(this, (function (exports) { 'use strict'; + + const comma = ','.charCodeAt(0); + const semicolon = ';'.charCodeAt(0); + const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; + const intToChar = new Uint8Array(64); // 64 possible chars. + const charToInt = new Uint8Array(128); // z is 122 in ASCII + for (let i = 0; i < chars.length; i++) { + const c = chars.charCodeAt(i); + intToChar[i] = c; + charToInt[c] = i; + } + // Provide a fallback for older environments. + const td = typeof TextDecoder !== 'undefined' + ? /* #__PURE__ */ new TextDecoder() + : typeof Buffer !== 'undefined' + ? { + decode(buf) { + const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength); + return out.toString(); + }, + } + : { + decode(buf) { + let out = ''; + for (let i = 0; i < buf.length; i++) { + out += String.fromCharCode(buf[i]); + } + return out; + }, + }; + function decode(mappings) { + const state = new Int32Array(5); + const decoded = []; + let index = 0; + do { + const semi = indexOf(mappings, index); + const line = []; + let sorted = true; + let lastCol = 0; + state[0] = 0; + for (let i = index; i < semi; i++) { + let seg; + i = decodeInteger(mappings, i, state, 0); // genColumn + const col = state[0]; + if (col < lastCol) + sorted = false; + lastCol = col; + if (hasMoreVlq(mappings, i, semi)) { + i = decodeInteger(mappings, i, state, 1); // sourcesIndex + i = decodeInteger(mappings, i, state, 2); // sourceLine + i = decodeInteger(mappings, i, state, 3); // sourceColumn + if (hasMoreVlq(mappings, i, semi)) { + i = decodeInteger(mappings, i, state, 4); // namesIndex + seg = [col, state[1], state[2], state[3], state[4]]; + } + else { + seg = [col, state[1], state[2], state[3]]; + } + } + else { + seg = [col]; + } + line.push(seg); + } + if (!sorted) + sort(line); + decoded.push(line); + index = semi + 1; + } while (index <= mappings.length); + return decoded; + } + function indexOf(mappings, index) { + const idx = mappings.indexOf(';', index); + return idx === -1 ? mappings.length : idx; + } + function decodeInteger(mappings, pos, state, j) { + let value = 0; + let shift = 0; + let integer = 0; + do { + const c = mappings.charCodeAt(pos++); + integer = charToInt[c]; + value |= (integer & 31) << shift; + shift += 5; + } while (integer & 32); + const shouldNegate = value & 1; + value >>>= 1; + if (shouldNegate) { + value = -0x80000000 | -value; + } + state[j] += value; + return pos; + } + function hasMoreVlq(mappings, i, length) { + if (i >= length) + return false; + return mappings.charCodeAt(i) !== comma; + } + function sort(line) { + line.sort(sortComparator); + } + function sortComparator(a, b) { + return a[0] - b[0]; + } + function encode(decoded) { + const state = new Int32Array(5); + const bufLength = 1024 * 16; + const subLength = bufLength - 36; + const buf = new Uint8Array(bufLength); + const sub = buf.subarray(0, subLength); + let pos = 0; + let out = ''; + for (let i = 0; i < decoded.length; i++) { + const line = decoded[i]; + if (i > 0) { + if (pos === bufLength) { + out += td.decode(buf); + pos = 0; + } + buf[pos++] = semicolon; + } + if (line.length === 0) + continue; + state[0] = 0; + for (let j = 0; j < line.length; j++) { + const segment = line[j]; + // We can push up to 5 ints, each int can take at most 7 chars, and we + // may push a comma. + if (pos > subLength) { + out += td.decode(sub); + buf.copyWithin(0, subLength, pos); + pos -= subLength; + } + if (j > 0) + buf[pos++] = comma; + pos = encodeInteger(buf, pos, state, segment, 0); // genColumn + if (segment.length === 1) + continue; + pos = encodeInteger(buf, pos, state, segment, 1); // sourcesIndex + pos = encodeInteger(buf, pos, state, segment, 2); // sourceLine + pos = encodeInteger(buf, pos, state, segment, 3); // sourceColumn + if (segment.length === 4) + continue; + pos = encodeInteger(buf, pos, state, segment, 4); // namesIndex + } + } + return out + td.decode(buf.subarray(0, pos)); + } + function encodeInteger(buf, pos, state, segment, j) { + const next = segment[j]; + let num = next - state[j]; + state[j] = next; + num = num < 0 ? (-num << 1) | 1 : num << 1; + do { + let clamped = num & 0b011111; + num >>>= 5; + if (num > 0) + clamped |= 0b100000; + buf[pos++] = intToChar[clamped]; + } while (num > 0); + return pos; + } + + exports.decode = decode; + exports.encode = encode; + + Object.defineProperty(exports, '__esModule', { value: true }); + +})); +//# sourceMappingURL=sourcemap-codec.umd.js.map diff --git a/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js.map b/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js.map new file mode 100644 index 0000000..b6b2003 --- /dev/null +++ b/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js.map @@ -0,0 +1 @@ +{"version":3,"file":"sourcemap-codec.umd.js","sources":["../src/sourcemap-codec.ts"],"sourcesContent":["export type SourceMapSegment =\n | [number]\n | [number, number, number, number]\n | [number, number, number, number, number];\nexport type SourceMapLine = SourceMapSegment[];\nexport type SourceMapMappings = SourceMapLine[];\n\nconst comma = ','.charCodeAt(0);\nconst semicolon = ';'.charCodeAt(0);\nconst chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\nconst intToChar = new Uint8Array(64); // 64 possible chars.\nconst charToInt = new Uint8Array(128); // z is 122 in ASCII\n\nfor (let i = 0; i < chars.length; i++) {\n const c = chars.charCodeAt(i);\n intToChar[i] = c;\n charToInt[c] = i;\n}\n\n// Provide a fallback for older environments.\nconst td =\n typeof TextDecoder !== 'undefined'\n ? /* #__PURE__ */ new TextDecoder()\n : typeof Buffer !== 'undefined'\n ? {\n decode(buf: Uint8Array) {\n const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength);\n return out.toString();\n },\n }\n : {\n decode(buf: Uint8Array) {\n let out = '';\n for (let i = 0; i < buf.length; i++) {\n out += String.fromCharCode(buf[i]);\n }\n return out;\n },\n };\n\nexport function decode(mappings: string): SourceMapMappings {\n const state: [number, number, number, number, number] = new Int32Array(5) as any;\n const decoded: SourceMapMappings = [];\n\n let index = 0;\n do {\n const semi = indexOf(mappings, index);\n const line: SourceMapLine = [];\n let sorted = true;\n let lastCol = 0;\n state[0] = 0;\n\n for (let i = index; i < semi; i++) {\n let seg: SourceMapSegment;\n\n i = decodeInteger(mappings, i, state, 0); // genColumn\n const col = state[0];\n if (col < lastCol) sorted = false;\n lastCol = col;\n\n if (hasMoreVlq(mappings, i, semi)) {\n i = decodeInteger(mappings, i, state, 1); // sourcesIndex\n i = decodeInteger(mappings, i, state, 2); // sourceLine\n i = decodeInteger(mappings, i, state, 3); // sourceColumn\n\n if (hasMoreVlq(mappings, i, semi)) {\n i = decodeInteger(mappings, i, state, 4); // namesIndex\n seg = [col, state[1], state[2], state[3], state[4]];\n } else {\n seg = [col, state[1], state[2], state[3]];\n }\n } else {\n seg = [col];\n }\n\n line.push(seg);\n }\n\n if (!sorted) sort(line);\n decoded.push(line);\n index = semi + 1;\n } while (index <= mappings.length);\n\n return decoded;\n}\n\nfunction indexOf(mappings: string, index: number): number {\n const idx = mappings.indexOf(';', index);\n return idx === -1 ? mappings.length : idx;\n}\n\nfunction decodeInteger(mappings: string, pos: number, state: SourceMapSegment, j: number): number {\n let value = 0;\n let shift = 0;\n let integer = 0;\n\n do {\n const c = mappings.charCodeAt(pos++);\n integer = charToInt[c];\n value |= (integer & 31) << shift;\n shift += 5;\n } while (integer & 32);\n\n const shouldNegate = value & 1;\n value >>>= 1;\n\n if (shouldNegate) {\n value = -0x80000000 | -value;\n }\n\n state[j] += value;\n return pos;\n}\n\nfunction hasMoreVlq(mappings: string, i: number, length: number): boolean {\n if (i >= length) return false;\n return mappings.charCodeAt(i) !== comma;\n}\n\nfunction sort(line: SourceMapSegment[]) {\n line.sort(sortComparator);\n}\n\nfunction sortComparator(a: SourceMapSegment, b: SourceMapSegment): number {\n return a[0] - b[0];\n}\n\nexport function encode(decoded: SourceMapMappings): string;\nexport function encode(decoded: Readonly): string;\nexport function encode(decoded: Readonly): string {\n const state: [number, number, number, number, number] = new Int32Array(5) as any;\n const bufLength = 1024 * 16;\n const subLength = bufLength - 36;\n const buf = new Uint8Array(bufLength);\n const sub = buf.subarray(0, subLength);\n let pos = 0;\n let out = '';\n\n for (let i = 0; i < decoded.length; i++) {\n const line = decoded[i];\n if (i > 0) {\n if (pos === bufLength) {\n out += td.decode(buf);\n pos = 0;\n }\n buf[pos++] = semicolon;\n }\n if (line.length === 0) continue;\n\n state[0] = 0;\n\n for (let j = 0; j < line.length; j++) {\n const segment = line[j];\n // We can push up to 5 ints, each int can take at most 7 chars, and we\n // may push a comma.\n if (pos > subLength) {\n out += td.decode(sub);\n buf.copyWithin(0, subLength, pos);\n pos -= subLength;\n }\n if (j > 0) buf[pos++] = comma;\n\n pos = encodeInteger(buf, pos, state, segment, 0); // genColumn\n\n if (segment.length === 1) continue;\n pos = encodeInteger(buf, pos, state, segment, 1); // sourcesIndex\n pos = encodeInteger(buf, pos, state, segment, 2); // sourceLine\n pos = encodeInteger(buf, pos, state, segment, 3); // sourceColumn\n\n if (segment.length === 4) continue;\n pos = encodeInteger(buf, pos, state, segment, 4); // namesIndex\n }\n }\n\n return out + td.decode(buf.subarray(0, pos));\n}\n\nfunction encodeInteger(\n buf: Uint8Array,\n pos: number,\n state: SourceMapSegment,\n segment: SourceMapSegment,\n j: number,\n): number {\n const next = segment[j];\n let num = next - state[j];\n state[j] = next;\n\n num = num < 0 ? (-num << 1) | 1 : num << 1;\n do {\n let clamped = num & 0b011111;\n num >>>= 5;\n if (num > 0) clamped |= 0b100000;\n buf[pos++] = intToChar[clamped];\n } while (num > 0);\n\n return pos;\n}\n"],"names":[],"mappings":";;;;;;IAOA,MAAM,KAAK,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;IAChC,MAAM,SAAS,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;IACpC,MAAM,KAAK,GAAG,kEAAkE,CAAC;IACjF,MAAM,SAAS,GAAG,IAAI,UAAU,CAAC,EAAE,CAAC,CAAC;IACrC,MAAM,SAAS,GAAG,IAAI,UAAU,CAAC,G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AAC;IAC/C,CAAC;IAED,SAAS,aAAa,CACpB,GAAe,EACf,GAAW,EACX,KAAuB,EACvB,OAAyB,EACzB,CAAS;QAET,MAAM,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;QACxB,IAAI,GAAG,GAAG,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QAC1B,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;QAEhB,GAAG,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,CAAC;QAC3C,GAAG;YACD,IAAI,OAAO,GAAG,GAAG,GAAG,QAAQ,CAAC;YAC7B,GAAG,MAAM,CAAC,CAAC;YACX,IAAI,GAAG,GAAG,CAAC;gBAAE,OAAO,IAAI,QAAQ,CAAC;YACjC,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC;SACjC,QAAQ,GAAG,GAAG,CAAC,EAAE;QAElB,OAAO,GAAG,CAAC;IACb;;;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/@jridgewell/sourcemap-codec/dist/types/sourcemap-codec.d.ts b/node_modules/@jridgewell/sourcemap-codec/dist/types/sourcemap-codec.d.ts new file mode 100644 index 0000000..410d320 --- /dev/null +++ b/node_modules/@jridgewell/sourcemap-codec/dist/types/sourcemap-codec.d.ts @@ -0,0 +1,6 @@ +export declare type SourceMapSegment = [number] | [number, number, number, number] | [number, number, number, number, number]; +export declare type SourceMapLine = SourceMapSegment[]; +export declare type SourceMapMappings = SourceMapLine[]; +export declare function decode(mappings: string): SourceMapMappings; +export declare function encode(decoded: SourceMapMappings): string; +export declare function encode(decoded: Readonly): string; diff --git a/node_modules/@jridgewell/sourcemap-codec/package.json b/node_modules/@jridgewell/sourcemap-codec/package.json new file mode 100644 index 0000000..578448f --- /dev/null +++ b/node_modules/@jridgewell/sourcemap-codec/package.json @@ -0,0 +1,74 @@ +{ + "name": "@jridgewell/sourcemap-codec", + "version": "1.4.15", + "description": "Encode/decode sourcemap mappings", + "keywords": [ + "sourcemap", + "vlq" + ], + "main": "dist/sourcemap-codec.umd.js", + "module": "dist/sourcemap-codec.mjs", + "types": "dist/types/sourcemap-codec.d.ts", + "files": [ + "dist" + ], + "exports": { + ".": [ + { + "types": "./dist/types/sourcemap-codec.d.ts", + "browser": "./dist/sourcemap-codec.umd.js", + "require": "./dist/sourcemap-codec.umd.js", + "import": "./dist/sourcemap-codec.mjs" + }, + "./dist/sourcemap-codec.umd.js" + ], + "./package.json": "./package.json" + }, + "scripts": { + "benchmark": "run-s build:rollup benchmark:*", + "benchmark:install": "cd benchmark && npm install", + "benchmark:only": "node --expose-gc benchmark/index.js", + "build": "run-s -n build:*", + "build:rollup": "rollup -c rollup.config.js", + "build:ts": "tsc --project tsconfig.build.json", + "lint": "run-s -n lint:*", + "lint:prettier": "npm run test:lint:prettier -- --write", + "lint:ts": "npm run test:lint:ts -- --fix", + "prebuild": "rm -rf dist", + "prepublishOnly": "npm run preversion", + "preversion": "run-s test build", + "pretest": "run-s build:rollup", + "test": "run-s -n test:lint test:only", + "test:debug": "mocha --inspect-brk", + "test:lint": "run-s -n test:lint:*", + "test:lint:prettier": "prettier --check '{src,test}/**/*.ts'", + "test:lint:ts": "eslint '{src,test}/**/*.ts'", + "test:only": "mocha", + "test:coverage": "c8 mocha", + "test:watch": "mocha --watch" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/jridgewell/sourcemap-codec.git" + }, + "author": "Rich Harris", + "license": "MIT", + "devDependencies": { + "@rollup/plugin-typescript": "8.3.0", + "@types/node": "17.0.15", + "@typescript-eslint/eslint-plugin": "5.10.0", + "@typescript-eslint/parser": "5.10.0", + "benchmark": "2.1.4", + "c8": "7.11.2", + "eslint": "8.7.0", + "eslint-config-prettier": "8.3.0", + "mocha": "9.2.0", + "npm-run-all": "4.1.5", + "prettier": "2.5.1", + "rollup": "2.64.0", + "source-map": "0.6.1", + "source-map-js": "1.0.2", + "sourcemap-codec": "1.4.8", + "typescript": "4.5.4" + } +} diff --git a/node_modules/@jridgewell/trace-mapping/LICENSE b/node_modules/@jridgewell/trace-mapping/LICENSE new file mode 100644 index 0000000..37bb488 --- /dev/null +++ b/node_modules/@jridgewell/trace-mapping/LICENSE @@ -0,0 +1,19 @@ +Copyright 2022 Justin Ridgewell + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/@jridgewell/trace-mapping/README.md b/node_modules/@jridgewell/trace-mapping/README.md new file mode 100644 index 0000000..cc5e4f9 --- /dev/null +++ b/node_modules/@jridgewell/trace-mapping/README.md @@ -0,0 +1,252 @@ +# @jridgewell/trace-mapping + +> Trace the original position through a source map + +`trace-mapping` allows you to take the line and column of an output file and trace it to the +original location in the source file through a source map. + +You may already be familiar with the [`source-map`][source-map] package's `SourceMapConsumer`. This +provides the same `originalPositionFor` and `generatedPositionFor` API, without requiring WASM. + +## Installation + +```sh +npm install @jridgewell/trace-mapping +``` + +## Usage + +```typescript +import { + TraceMap, + originalPositionFor, + generatedPositionFor, + sourceContentFor, +} from '@jridgewell/trace-mapping'; + +const tracer = new TraceMap({ + version: 3, + sources: ['input.js'], + sourcesContent: ['content of input.js'], + names: ['foo'], + mappings: 'KAyCIA', +}); + +// Lines start at line 1, columns at column 0. +const traced = originalPositionFor(tracer, { line: 1, column: 5 }); +assert.deepEqual(traced, { + source: 'input.js', + line: 42, + column: 4, + name: 'foo', +}); + +const content = sourceContentFor(tracer, traced.source); +assert.strictEqual(content, 'content for input.js'); + +const generated = generatedPositionFor(tracer, { + source: 'input.js', + line: 42, + column: 4, +}); +assert.deepEqual(generated, { + line: 1, + column: 5, +}); +``` + +We also provide a lower level API to get the actual segment that matches our line and column. Unlike +`originalPositionFor`, `traceSegment` uses a 0-base for `line`: + +```typescript +import { traceSegment } from '@jridgewell/trace-mapping'; + +// line is 0-base. +const traced = traceSegment(tracer, /* line */ 0, /* column */ 5); + +// Segments are [outputColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex] +// Again, line is 0-base and so is sourceLine +assert.deepEqual(traced, [5, 0, 41, 4, 0]); +``` + +### SectionedSourceMaps + +The sourcemap spec defines a special `sections` field that's designed to handle concatenation of +output code with associated sourcemaps. This type of sourcemap is rarely used (no major build tool +produces it), but if you are hand coding a concatenation you may need it. We provide an `AnyMap` +helper that can receive either a regular sourcemap or a `SectionedSourceMap` and returns a +`TraceMap` instance: + +```typescript +import { AnyMap } from '@jridgewell/trace-mapping'; +const fooOutput = 'foo'; +const barOutput = 'bar'; +const output = [fooOutput, barOutput].join('\n'); + +const sectioned = new AnyMap({ + version: 3, + sections: [ + { + // 0-base line and column + offset: { line: 0, column: 0 }, + // fooOutput's sourcemap + map: { + version: 3, + sources: ['foo.js'], + names: ['foo'], + mappings: 'AAAAA', + }, + }, + { + // barOutput's sourcemap will not affect the first line, only the second + offset: { line: 1, column: 0 }, + map: { + version: 3, + sources: ['bar.js'], + names: ['bar'], + mappings: 'AAAAA', + }, + }, + ], +}); + +const traced = originalPositionFor(sectioned, { + line: 2, + column: 0, +}); + +assert.deepEqual(traced, { + source: 'bar.js', + line: 1, + column: 0, + name: 'bar', +}); +``` + +## Benchmarks + +``` +node v18.0.0 + +amp.js.map - 45120 segments + +Memory Usage: +trace-mapping decoded 562400 bytes +trace-mapping encoded 5706544 bytes +source-map-js 10717664 bytes +source-map-0.6.1 17446384 bytes +source-map-0.8.0 9701757 bytes +Smallest memory usage is trace-mapping decoded + +Init speed: +trace-mapping: decoded JSON input x 180 ops/sec ±0.34% (85 runs sampled) +trace-mapping: encoded JSON input x 364 ops/sec ±1.77% (89 runs sampled) +trace-mapping: decoded Object input x 3,116 ops/sec ±0.50% (96 runs sampled) +trace-mapping: encoded Object input x 410 ops/sec ±2.62% (85 runs sampled) +source-map-js: encoded Object input x 84.23 ops/sec ±0.91% (73 runs sampled) +source-map-0.6.1: encoded Object input x 37.21 ops/sec ±2.08% (51 runs sampled) +Fastest is trace-mapping: decoded Object input + +Trace speed: +trace-mapping: decoded originalPositionFor x 3,952,212 ops/sec ±0.17% (98 runs sampled) +trace-mapping: encoded originalPositionFor x 3,487,468 ops/sec ±1.58% (90 runs sampled) +source-map-js: encoded originalPositionFor x 827,730 ops/sec ±0.78% (97 runs sampled) +source-map-0.6.1: encoded originalPositionFor x 748,991 ops/sec ±0.53% (94 runs sampled) +source-map-0.8.0: encoded originalPositionFor x 2,532,894 ops/sec ±0.57% (95 runs sampled) +Fastest is trace-mapping: decoded originalPositionFor + + +*** + + +babel.min.js.map - 347793 segments + +Memory Usage: +trace-mapping decoded 89832 bytes +trace-mapping encoded 35474640 bytes +source-map-js 51257176 bytes +source-map-0.6.1 63515664 bytes +source-map-0.8.0 42933752 bytes +Smallest memory usage is trace-mapping decoded + +Init speed: +trace-mapping: decoded JSON input x 15.41 ops/sec ±8.65% (34 runs sampled) +trace-mapping: encoded JSON input x 28.20 ops/sec ±12.87% (42 runs sampled) +trace-mapping: decoded Object input x 964 ops/sec ±0.36% (99 runs sampled) +trace-mapping: encoded Object input x 31.77 ops/sec ±13.79% (45 runs sampled) +source-map-js: encoded Object input x 6.45 ops/sec ±5.16% (21 runs sampled) +source-map-0.6.1: encoded Object input x 4.07 ops/sec ±5.24% (15 runs sampled) +Fastest is trace-mapping: decoded Object input + +Trace speed: +trace-mapping: decoded originalPositionFor x 7,183,038 ops/sec ±0.58% (95 runs sampled) +trace-mapping: encoded originalPositionFor x 5,192,185 ops/sec ±0.41% (100 runs sampled) +source-map-js: encoded originalPositionFor x 4,259,489 ops/sec ±0.79% (94 runs sampled) +source-map-0.6.1: encoded originalPositionFor x 3,742,629 ops/sec ±0.71% (95 runs sampled) +source-map-0.8.0: encoded originalPositionFor x 6,270,211 ops/sec ±0.64% (94 runs sampled) +Fastest is trace-mapping: decoded originalPositionFor + + +*** + + +preact.js.map - 1992 segments + +Memory Usage: +trace-mapping decoded 37128 bytes +trace-mapping encoded 247280 bytes +source-map-js 1143536 bytes +source-map-0.6.1 1290992 bytes +source-map-0.8.0 96544 bytes +Smallest memory usage is trace-mapping decoded + +Init speed: +trace-mapping: decoded JSON input x 3,483 ops/sec ±0.30% (98 runs sampled) +trace-mapping: encoded JSON input x 6,092 ops/sec ±0.18% (97 runs sampled) +trace-mapping: decoded Object input x 249,076 ops/sec ±0.24% (98 runs sampled) +trace-mapping: encoded Object input x 14,555 ops/sec ±0.48% (100 runs sampled) +source-map-js: encoded Object input x 2,447 ops/sec ±0.36% (99 runs sampled) +source-map-0.6.1: encoded Object input x 1,201 ops/sec ±0.57% (96 runs sampled) +Fastest is trace-mapping: decoded Object input + +Trace speed: +trace-mapping: decoded originalPositionFor x 7,620,192 ops/sec ±0.09% (99 runs sampled) +trace-mapping: encoded originalPositionFor x 6,872,554 ops/sec ±0.30% (97 runs sampled) +source-map-js: encoded originalPositionFor x 2,489,570 ops/sec ±0.35% (94 runs sampled) +source-map-0.6.1: encoded originalPositionFor x 1,698,633 ops/sec ±0.28% (98 runs sampled) +source-map-0.8.0: encoded originalPositionFor x 4,015,644 ops/sec ±0.22% (98 runs sampled) +Fastest is trace-mapping: decoded originalPositionFor + + +*** + + +react.js.map - 5726 segments + +Memory Usage: +trace-mapping decoded 16176 bytes +trace-mapping encoded 681552 bytes +source-map-js 2418352 bytes +source-map-0.6.1 2443672 bytes +source-map-0.8.0 111768 bytes +Smallest memory usage is trace-mapping decoded + +Init speed: +trace-mapping: decoded JSON input x 1,720 ops/sec ±0.34% (98 runs sampled) +trace-mapping: encoded JSON input x 4,406 ops/sec ±0.35% (100 runs sampled) +trace-mapping: decoded Object input x 92,122 ops/sec ±0.10% (99 runs sampled) +trace-mapping: encoded Object input x 5,385 ops/sec ±0.37% (99 runs sampled) +source-map-js: encoded Object input x 794 ops/sec ±0.40% (98 runs sampled) +source-map-0.6.1: encoded Object input x 416 ops/sec ±0.54% (91 runs sampled) +Fastest is trace-mapping: decoded Object input + +Trace speed: +trace-mapping: decoded originalPositionFor x 32,759,519 ops/sec ±0.33% (100 runs sampled) +trace-mapping: encoded originalPositionFor x 31,116,306 ops/sec ±0.33% (97 runs sampled) +source-map-js: encoded originalPositionFor x 17,458,435 ops/sec ±0.44% (97 runs sampled) +source-map-0.6.1: encoded originalPositionFor x 12,687,097 ops/sec ±0.43% (95 runs sampled) +source-map-0.8.0: encoded originalPositionFor x 23,538,275 ops/sec ±0.38% (95 runs sampled) +Fastest is trace-mapping: decoded originalPositionFor +``` + +[source-map]: https://www.npmjs.com/package/source-map diff --git a/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs b/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs new file mode 100644 index 0000000..917a330 --- /dev/null +++ b/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs @@ -0,0 +1,552 @@ +import { encode, decode } from '@jridgewell/sourcemap-codec'; +import resolveUri from '@jridgewell/resolve-uri'; + +function resolve(input, base) { + // The base is always treated as a directory, if it's not empty. + // https://github.com/mozilla/source-map/blob/8cb3ee57/lib/util.js#L327 + // https://github.com/chromium/chromium/blob/da4adbb3/third_party/blink/renderer/devtools/front_end/sdk/SourceMap.js#L400-L401 + if (base && !base.endsWith('/')) + base += '/'; + return resolveUri(input, base); +} + +/** + * Removes everything after the last "/", but leaves the slash. + */ +function stripFilename(path) { + if (!path) + return ''; + const index = path.lastIndexOf('/'); + return path.slice(0, index + 1); +} + +const COLUMN = 0; +const SOURCES_INDEX = 1; +const SOURCE_LINE = 2; +const SOURCE_COLUMN = 3; +const NAMES_INDEX = 4; +const REV_GENERATED_LINE = 1; +const REV_GENERATED_COLUMN = 2; + +function maybeSort(mappings, owned) { + const unsortedIndex = nextUnsortedSegmentLine(mappings, 0); + if (unsortedIndex === mappings.length) + return mappings; + // If we own the array (meaning we parsed it from JSON), then we're free to directly mutate it. If + // not, we do not want to modify the consumer's input array. + if (!owned) + mappings = mappings.slice(); + for (let i = unsortedIndex; i < mappings.length; i = nextUnsortedSegmentLine(mappings, i + 1)) { + mappings[i] = sortSegments(mappings[i], owned); + } + return mappings; +} +function nextUnsortedSegmentLine(mappings, start) { + for (let i = start; i < mappings.length; i++) { + if (!isSorted(mappings[i])) + return i; + } + return mappings.length; +} +function isSorted(line) { + for (let j = 1; j < line.length; j++) { + if (line[j][COLUMN] < line[j - 1][COLUMN]) { + return false; + } + } + return true; +} +function sortSegments(line, owned) { + if (!owned) + line = line.slice(); + return line.sort(sortComparator); +} +function sortComparator(a, b) { + return a[COLUMN] - b[COLUMN]; +} + +let found = false; +/** + * A binary search implementation that returns the index if a match is found. + * If no match is found, then the left-index (the index associated with the item that comes just + * before the desired index) is returned. To maintain proper sort order, a splice would happen at + * the next index: + * + * ```js + * const array = [1, 3]; + * const needle = 2; + * const index = binarySearch(array, needle, (item, needle) => item - needle); + * + * assert.equal(index, 0); + * array.splice(index + 1, 0, needle); + * assert.deepEqual(array, [1, 2, 3]); + * ``` + */ +function binarySearch(haystack, needle, low, high) { + while (low <= high) { + const mid = low + ((high - low) >> 1); + const cmp = haystack[mid][COLUMN] - needle; + if (cmp === 0) { + found = true; + return mid; + } + if (cmp < 0) { + low = mid + 1; + } + else { + high = mid - 1; + } + } + found = false; + return low - 1; +} +function upperBound(haystack, needle, index) { + for (let i = index + 1; i < haystack.length; index = i++) { + if (haystack[i][COLUMN] !== needle) + break; + } + return index; +} +function lowerBound(haystack, needle, index) { + for (let i = index - 1; i >= 0; index = i--) { + if (haystack[i][COLUMN] !== needle) + break; + } + return index; +} +function memoizedState() { + return { + lastKey: -1, + lastNeedle: -1, + lastIndex: -1, + }; +} +/** + * This overly complicated beast is just to record the last tested line/column and the resulting + * index, allowing us to skip a few tests if mappings are monotonically increasing. + */ +function memoizedBinarySearch(haystack, needle, state, key) { + const { lastKey, lastNeedle, lastIndex } = state; + let low = 0; + let high = haystack.length - 1; + if (key === lastKey) { + if (needle === lastNeedle) { + found = lastIndex !== -1 && haystack[lastIndex][COLUMN] === needle; + return lastIndex; + } + if (needle >= lastNeedle) { + // lastIndex may be -1 if the previous needle was not found. + low = lastIndex === -1 ? 0 : lastIndex; + } + else { + high = lastIndex; + } + } + state.lastKey = key; + state.lastNeedle = needle; + return (state.lastIndex = binarySearch(haystack, needle, low, high)); +} + +// Rebuilds the original source files, with mappings that are ordered by source line/column instead +// of generated line/column. +function buildBySources(decoded, memos) { + const sources = memos.map(buildNullArray); + for (let i = 0; i < decoded.length; i++) { + const line = decoded[i]; + for (let j = 0; j < line.length; j++) { + const seg = line[j]; + if (seg.length === 1) + continue; + const sourceIndex = seg[SOURCES_INDEX]; + const sourceLine = seg[SOURCE_LINE]; + const sourceColumn = seg[SOURCE_COLUMN]; + const originalSource = sources[sourceIndex]; + const originalLine = (originalSource[sourceLine] || (originalSource[sourceLine] = [])); + const memo = memos[sourceIndex]; + // The binary search either found a match, or it found the left-index just before where the + // segment should go. Either way, we want to insert after that. And there may be multiple + // generated segments associated with an original location, so there may need to move several + // indexes before we find where we need to insert. + const index = upperBound(originalLine, sourceColumn, memoizedBinarySearch(originalLine, sourceColumn, memo, sourceLine)); + insert(originalLine, (memo.lastIndex = index + 1), [sourceColumn, i, seg[COLUMN]]); + } + } + return sources; +} +function insert(array, index, value) { + for (let i = array.length; i > index; i--) { + array[i] = array[i - 1]; + } + array[index] = value; +} +// Null arrays allow us to use ordered index keys without actually allocating contiguous memory like +// a real array. We use a null-prototype object to avoid prototype pollution and deoptimizations. +// Numeric properties on objects are magically sorted in ascending order by the engine regardless of +// the insertion order. So, by setting any numeric keys, even out of order, we'll get ascending +// order when iterating with for-in. +function buildNullArray() { + return { __proto__: null }; +} + +const AnyMap = function (map, mapUrl) { + const parsed = typeof map === 'string' ? JSON.parse(map) : map; + if (!('sections' in parsed)) + return new TraceMap(parsed, mapUrl); + const mappings = []; + const sources = []; + const sourcesContent = []; + const names = []; + recurse(parsed, mapUrl, mappings, sources, sourcesContent, names, 0, 0, Infinity, Infinity); + const joined = { + version: 3, + file: parsed.file, + names, + sources, + sourcesContent, + mappings, + }; + return presortedDecodedMap(joined); +}; +function recurse(input, mapUrl, mappings, sources, sourcesContent, names, lineOffset, columnOffset, stopLine, stopColumn) { + const { sections } = input; + for (let i = 0; i < sections.length; i++) { + const { map, offset } = sections[i]; + let sl = stopLine; + let sc = stopColumn; + if (i + 1 < sections.length) { + const nextOffset = sections[i + 1].offset; + sl = Math.min(stopLine, lineOffset + nextOffset.line); + if (sl === stopLine) { + sc = Math.min(stopColumn, columnOffset + nextOffset.column); + } + else if (sl < stopLine) { + sc = columnOffset + nextOffset.column; + } + } + addSection(map, mapUrl, mappings, sources, sourcesContent, names, lineOffset + offset.line, columnOffset + offset.column, sl, sc); + } +} +function addSection(input, mapUrl, mappings, sources, sourcesContent, names, lineOffset, columnOffset, stopLine, stopColumn) { + if ('sections' in input) + return recurse(...arguments); + const map = new TraceMap(input, mapUrl); + const sourcesOffset = sources.length; + const namesOffset = names.length; + const decoded = decodedMappings(map); + const { resolvedSources, sourcesContent: contents } = map; + append(sources, resolvedSources); + append(names, map.names); + if (contents) + append(sourcesContent, contents); + else + for (let i = 0; i < resolvedSources.length; i++) + sourcesContent.push(null); + for (let i = 0; i < decoded.length; i++) { + const lineI = lineOffset + i; + // We can only add so many lines before we step into the range that the next section's map + // controls. When we get to the last line, then we'll start checking the segments to see if + // they've crossed into the column range. But it may not have any columns that overstep, so we + // still need to check that we don't overstep lines, too. + if (lineI > stopLine) + return; + // The out line may already exist in mappings (if we're continuing the line started by a + // previous section). Or, we may have jumped ahead several lines to start this section. + const out = getLine(mappings, lineI); + // On the 0th loop, the section's column offset shifts us forward. On all other lines (since the + // map can be multiple lines), it doesn't. + const cOffset = i === 0 ? columnOffset : 0; + const line = decoded[i]; + for (let j = 0; j < line.length; j++) { + const seg = line[j]; + const column = cOffset + seg[COLUMN]; + // If this segment steps into the column range that the next section's map controls, we need + // to stop early. + if (lineI === stopLine && column >= stopColumn) + return; + if (seg.length === 1) { + out.push([column]); + continue; + } + const sourcesIndex = sourcesOffset + seg[SOURCES_INDEX]; + const sourceLine = seg[SOURCE_LINE]; + const sourceColumn = seg[SOURCE_COLUMN]; + out.push(seg.length === 4 + ? [column, sourcesIndex, sourceLine, sourceColumn] + : [column, sourcesIndex, sourceLine, sourceColumn, namesOffset + seg[NAMES_INDEX]]); + } + } +} +function append(arr, other) { + for (let i = 0; i < other.length; i++) + arr.push(other[i]); +} +function getLine(arr, index) { + for (let i = arr.length; i <= index; i++) + arr[i] = []; + return arr[index]; +} + +const LINE_GTR_ZERO = '`line` must be greater than 0 (lines start at line 1)'; +const COL_GTR_EQ_ZERO = '`column` must be greater than or equal to 0 (columns start at column 0)'; +const LEAST_UPPER_BOUND = -1; +const GREATEST_LOWER_BOUND = 1; +/** + * Returns the encoded (VLQ string) form of the SourceMap's mappings field. + */ +let encodedMappings; +/** + * Returns the decoded (array of lines of segments) form of the SourceMap's mappings field. + */ +let decodedMappings; +/** + * A low-level API to find the segment associated with a generated line/column (think, from a + * stack trace). Line and column here are 0-based, unlike `originalPositionFor`. + */ +let traceSegment; +/** + * A higher-level API to find the source/line/column associated with a generated line/column + * (think, from a stack trace). Line is 1-based, but column is 0-based, due to legacy behavior in + * `source-map` library. + */ +let originalPositionFor; +/** + * Finds the generated line/column position of the provided source/line/column source position. + */ +let generatedPositionFor; +/** + * Finds all generated line/column positions of the provided source/line/column source position. + */ +let allGeneratedPositionsFor; +/** + * Iterates each mapping in generated position order. + */ +let eachMapping; +/** + * Retrieves the source content for a particular source, if its found. Returns null if not. + */ +let sourceContentFor; +/** + * A helper that skips sorting of the input map's mappings array, which can be expensive for larger + * maps. + */ +let presortedDecodedMap; +/** + * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects + * a sourcemap, or to JSON.stringify. + */ +let decodedMap; +/** + * Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects + * a sourcemap, or to JSON.stringify. + */ +let encodedMap; +class TraceMap { + constructor(map, mapUrl) { + const isString = typeof map === 'string'; + if (!isString && map._decodedMemo) + return map; + const parsed = (isString ? JSON.parse(map) : map); + const { version, file, names, sourceRoot, sources, sourcesContent } = parsed; + this.version = version; + this.file = file; + this.names = names; + this.sourceRoot = sourceRoot; + this.sources = sources; + this.sourcesContent = sourcesContent; + const from = resolve(sourceRoot || '', stripFilename(mapUrl)); + this.resolvedSources = sources.map((s) => resolve(s || '', from)); + const { mappings } = parsed; + if (typeof mappings === 'string') { + this._encoded = mappings; + this._decoded = undefined; + } + else { + this._encoded = undefined; + this._decoded = maybeSort(mappings, isString); + } + this._decodedMemo = memoizedState(); + this._bySources = undefined; + this._bySourceMemos = undefined; + } +} +(() => { + encodedMappings = (map) => { + var _a; + return ((_a = map._encoded) !== null && _a !== void 0 ? _a : (map._encoded = encode(map._decoded))); + }; + decodedMappings = (map) => { + return (map._decoded || (map._decoded = decode(map._encoded))); + }; + traceSegment = (map, line, column) => { + const decoded = decodedMappings(map); + // It's common for parent source maps to have pointers to lines that have no + // mapping (like a "//# sourceMappingURL=") at the end of the child file. + if (line >= decoded.length) + return null; + const segments = decoded[line]; + const index = traceSegmentInternal(segments, map._decodedMemo, line, column, GREATEST_LOWER_BOUND); + return index === -1 ? null : segments[index]; + }; + originalPositionFor = (map, { line, column, bias }) => { + line--; + if (line < 0) + throw new Error(LINE_GTR_ZERO); + if (column < 0) + throw new Error(COL_GTR_EQ_ZERO); + const decoded = decodedMappings(map); + // It's common for parent source maps to have pointers to lines that have no + // mapping (like a "//# sourceMappingURL=") at the end of the child file. + if (line >= decoded.length) + return OMapping(null, null, null, null); + const segments = decoded[line]; + const index = traceSegmentInternal(segments, map._decodedMemo, line, column, bias || GREATEST_LOWER_BOUND); + if (index === -1) + return OMapping(null, null, null, null); + const segment = segments[index]; + if (segment.length === 1) + return OMapping(null, null, null, null); + const { names, resolvedSources } = map; + return OMapping(resolvedSources[segment[SOURCES_INDEX]], segment[SOURCE_LINE] + 1, segment[SOURCE_COLUMN], segment.length === 5 ? names[segment[NAMES_INDEX]] : null); + }; + allGeneratedPositionsFor = (map, { source, line, column, bias }) => { + // SourceMapConsumer uses LEAST_UPPER_BOUND for some reason, so we follow suit. + return generatedPosition(map, source, line, column, bias || LEAST_UPPER_BOUND, true); + }; + generatedPositionFor = (map, { source, line, column, bias }) => { + return generatedPosition(map, source, line, column, bias || GREATEST_LOWER_BOUND, false); + }; + eachMapping = (map, cb) => { + const decoded = decodedMappings(map); + const { names, resolvedSources } = map; + for (let i = 0; i < decoded.length; i++) { + const line = decoded[i]; + for (let j = 0; j < line.length; j++) { + const seg = line[j]; + const generatedLine = i + 1; + const generatedColumn = seg[0]; + let source = null; + let originalLine = null; + let originalColumn = null; + let name = null; + if (seg.length !== 1) { + source = resolvedSources[seg[1]]; + originalLine = seg[2] + 1; + originalColumn = seg[3]; + } + if (seg.length === 5) + name = names[seg[4]]; + cb({ + generatedLine, + generatedColumn, + source, + originalLine, + originalColumn, + name, + }); + } + } + }; + sourceContentFor = (map, source) => { + const { sources, resolvedSources, sourcesContent } = map; + if (sourcesContent == null) + return null; + let index = sources.indexOf(source); + if (index === -1) + index = resolvedSources.indexOf(source); + return index === -1 ? null : sourcesContent[index]; + }; + presortedDecodedMap = (map, mapUrl) => { + const tracer = new TraceMap(clone(map, []), mapUrl); + tracer._decoded = map.mappings; + return tracer; + }; + decodedMap = (map) => { + return clone(map, decodedMappings(map)); + }; + encodedMap = (map) => { + return clone(map, encodedMappings(map)); + }; + function generatedPosition(map, source, line, column, bias, all) { + line--; + if (line < 0) + throw new Error(LINE_GTR_ZERO); + if (column < 0) + throw new Error(COL_GTR_EQ_ZERO); + const { sources, resolvedSources } = map; + let sourceIndex = sources.indexOf(source); + if (sourceIndex === -1) + sourceIndex = resolvedSources.indexOf(source); + if (sourceIndex === -1) + return all ? [] : GMapping(null, null); + const generated = (map._bySources || (map._bySources = buildBySources(decodedMappings(map), (map._bySourceMemos = sources.map(memoizedState))))); + const segments = generated[sourceIndex][line]; + if (segments == null) + return all ? [] : GMapping(null, null); + const memo = map._bySourceMemos[sourceIndex]; + if (all) + return sliceGeneratedPositions(segments, memo, line, column, bias); + const index = traceSegmentInternal(segments, memo, line, column, bias); + if (index === -1) + return GMapping(null, null); + const segment = segments[index]; + return GMapping(segment[REV_GENERATED_LINE] + 1, segment[REV_GENERATED_COLUMN]); + } +})(); +function clone(map, mappings) { + return { + version: map.version, + file: map.file, + names: map.names, + sourceRoot: map.sourceRoot, + sources: map.sources, + sourcesContent: map.sourcesContent, + mappings, + }; +} +function OMapping(source, line, column, name) { + return { source, line, column, name }; +} +function GMapping(line, column) { + return { line, column }; +} +function traceSegmentInternal(segments, memo, line, column, bias) { + let index = memoizedBinarySearch(segments, column, memo, line); + if (found) { + index = (bias === LEAST_UPPER_BOUND ? upperBound : lowerBound)(segments, column, index); + } + else if (bias === LEAST_UPPER_BOUND) + index++; + if (index === -1 || index === segments.length) + return -1; + return index; +} +function sliceGeneratedPositions(segments, memo, line, column, bias) { + let min = traceSegmentInternal(segments, memo, line, column, GREATEST_LOWER_BOUND); + // We ignored the bias when tracing the segment so that we're guarnateed to find the first (in + // insertion order) segment that matched. Even if we did respect the bias when tracing, we would + // still need to call `lowerBound()` to find the first segment, which is slower than just looking + // for the GREATEST_LOWER_BOUND to begin with. The only difference that matters for us is when the + // binary search didn't match, in which case GREATEST_LOWER_BOUND just needs to increment to + // match LEAST_UPPER_BOUND. + if (!found && bias === LEAST_UPPER_BOUND) + min++; + if (min === -1 || min === segments.length) + return []; + // We may have found the segment that started at an earlier column. If this is the case, then we + // need to slice all generated segments that match _that_ column, because all such segments span + // to our desired column. + const matchedColumn = found ? column : segments[min][COLUMN]; + // The binary search is not guaranteed to find the lower bound when a match wasn't found. + if (!found) + min = lowerBound(segments, matchedColumn, min); + const max = upperBound(segments, matchedColumn, min); + const result = []; + for (; min <= max; min++) { + const segment = segments[min]; + result.push(GMapping(segment[REV_GENERATED_LINE] + 1, segment[REV_GENERATED_COLUMN])); + } + return result; +} + +export { AnyMap, GREATEST_LOWER_BOUND, LEAST_UPPER_BOUND, TraceMap, allGeneratedPositionsFor, decodedMap, decodedMappings, eachMapping, encodedMap, encodedMappings, generatedPositionFor, originalPositionFor, presortedDecodedMap, sourceContentFor, traceSegment }; +//# sourceMappingURL=trace-mapping.mjs.map diff --git a/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs.map b/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs.map new file mode 100644 index 0000000..4d40aa1 --- /dev/null +++ b/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"trace-mapping.mjs","sources":["../src/resolve.ts","../src/strip-filename.ts","../src/sourcemap-segment.ts","../src/sort.ts","../src/binary-search.ts","../src/by-source.ts","../src/any-map.ts","../src/trace-mapping.ts"],"sourcesContent":["import resolveUri from '@jridgewell/resolve-uri';\n\nexport default function resolve(input: string, base: string | undefined): string {\n // The base is always treated as a directory, if it's not empty.\n // https://github.com/mozilla/source-map/blob/8cb3ee57/lib/util.js#L327\n // https://github.com/chromium/chromium/blob/da4adbb3/third_party/blink/renderer/devtools/front_end/sdk/SourceMap.js#L400-L401\n if (base && !base.endsWith('/')) base += '/';\n\n return resolveUri(input, base);\n}\n","/**\n * Removes everything after the last \"/\", but leaves the slash.\n */\nexport default function stripFilename(path: string | undefined | null): string {\n if (!path) return '';\n const index = path.lastIndexOf('/');\n return path.slice(0, index + 1);\n}\n","type GeneratedColumn = number;\ntype SourcesIndex = number;\ntype SourceLine = number;\ntype SourceColumn = number;\ntype NamesIndex = number;\n\ntype GeneratedLine = number;\n\nexport type SourceMapSegment =\n | [GeneratedColumn]\n | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn]\n | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn, NamesIndex];\n\nexport type ReverseSegment = [SourceColumn, GeneratedLine, GeneratedColumn];\n\nexport const COLUMN = 0;\nexport const SOURCES_INDEX = 1;\nexport const SOURCE_LINE = 2;\nexport const SOURCE_COLUMN = 3;\nexport const NAMES_INDEX = 4;\n\nexport const REV_GENERATED_LINE = 1;\nexport const REV_GENERATED_COLUMN = 2;\n","import { COLUMN } from './sourcemap-segment';\n\nimport type { SourceMapSegment } from './sourcemap-segment';\n\nexport default function maybeSort(\n mappings: SourceMapSegment[][],\n owned: boolean,\n): SourceMapSegment[][] {\n const unsortedIndex = nextUnsortedSegmentLine(mappings, 0);\n if (unsortedIndex === mappings.length) return mappings;\n\n // If we own the array (meaning we parsed it from JSON), then we're free to directly mutate it. If\n // not, we do not want to modify the consumer's input array.\n if (!owned) mappings = mappings.slice();\n\n for (let i = unsortedIndex; i < mappings.length; i = nextUnsortedSegmentLine(mappings, i + 1)) {\n mappings[i] = sortSegments(mappings[i], owned);\n }\n return mappings;\n}\n\nfunction nextUnsortedSegmentLine(mappings: SourceMapSegment[][], start: number): number {\n for (let i = start; i < mappings.length; i++) {\n if (!isSorted(mappings[i])) return i;\n }\n return mappings.length;\n}\n\nfunction isSorted(line: SourceMapSegment[]): boolean {\n for (let j = 1; j < line.length; j++) {\n if (line[j][COLUMN] < line[j - 1][COLUMN]) {\n return false;\n }\n }\n return true;\n}\n\nfunction sortSegments(line: SourceMapSegment[], owned: boolean): SourceMapSegment[] {\n if (!owned) line = line.slice();\n return line.sort(sortComparator);\n}\n\nfunction sortComparator(a: SourceMapSegment, b: SourceMapSegment): number {\n return a[COLUMN] - b[COLUMN];\n}\n","import type { SourceMapSegment, ReverseSegment } from './sourcemap-segment';\nimport { COLUMN } from './sourcemap-segment';\n\nexport type MemoState = {\n lastKey: number;\n lastNeedle: number;\n lastIndex: number;\n};\n\nexport let found = false;\n\n/**\n * A binary search implementation that returns the index if a match is found.\n * If no match is found, then the left-index (the index associated with the item that comes just\n * before the desired index) is returned. To maintain proper sort order, a splice would happen at\n * the next index:\n *\n * ```js\n * const array = [1, 3];\n * const needle = 2;\n * const index = binarySearch(array, needle, (item, needle) => item - needle);\n *\n * assert.equal(index, 0);\n * array.splice(index + 1, 0, needle);\n * assert.deepEqual(array, [1, 2, 3]);\n * ```\n */\nexport function binarySearch(\n haystack: SourceMapSegment[] | ReverseSegment[],\n needle: number,\n low: number,\n high: number,\n): number {\n while (low <= high) {\n const mid = low + ((high - low) >> 1);\n const cmp = haystack[mid][COLUMN] - needle;\n\n if (cmp === 0) {\n found = true;\n return mid;\n }\n\n if (cmp < 0) {\n low = mid + 1;\n } else {\n high = mid - 1;\n }\n }\n\n found = false;\n return low - 1;\n}\n\nexport function upperBound(\n haystack: SourceMapSegment[] | ReverseSegment[],\n needle: number,\n index: number,\n): number {\n for (let i = index + 1; i < haystack.length; index = i++) {\n if (haystack[i][COLUMN] !== needle) break;\n }\n return index;\n}\n\nexport function lowerBound(\n haystack: SourceMapSegment[] | ReverseSegment[],\n needle: number,\n index: number,\n): number {\n for (let i = index - 1; i >= 0; index = i--) {\n if (haystack[i][COLUMN] !== needle) break;\n }\n return index;\n}\n\nexport function memoizedState(): MemoState {\n return {\n lastKey: -1,\n lastNeedle: -1,\n lastIndex: -1,\n };\n}\n\n/**\n * This overly complicated beast is just to record the last tested line/column and the resulting\n * index, allowing us to skip a few tests if mappings are monotonically increasing.\n */\nexport function memoizedBinarySearch(\n haystack: SourceMapSegment[] | ReverseSegment[],\n needle: number,\n state: MemoState,\n key: number,\n): number {\n const { lastKey, lastNeedle, lastIndex } = state;\n\n let low = 0;\n let high = haystack.length - 1;\n if (key === lastKey) {\n if (needle === lastNeedle) {\n found = lastIndex !== -1 && haystack[lastIndex][COLUMN] === needle;\n return lastIndex;\n }\n\n if (needle >= lastNeedle) {\n // lastIndex may be -1 if the previous needle was not found.\n low = lastIndex === -1 ? 0 : lastIndex;\n } else {\n high = lastIndex;\n }\n }\n state.lastKey = key;\n state.lastNeedle = needle;\n\n return (state.lastIndex = binarySearch(haystack, needle, low, high));\n}\n","import { COLUMN, SOURCES_INDEX, SOURCE_LINE, SOURCE_COLUMN } from './sourcemap-segment';\nimport { memoizedBinarySearch, upperBound } from './binary-search';\n\nimport type { ReverseSegment, SourceMapSegment } from './sourcemap-segment';\nimport type { MemoState } from './binary-search';\n\nexport type Source = {\n __proto__: null;\n [line: number]: Exclude[];\n};\n\n// Rebuilds the original source files, with mappings that are ordered by source line/column instead\n// of generated line/column.\nexport default function buildBySources(\n decoded: readonly SourceMapSegment[][],\n memos: MemoState[],\n): Source[] {\n const sources: Source[] = memos.map(buildNullArray);\n\n for (let i = 0; i < decoded.length; i++) {\n const line = decoded[i];\n for (let j = 0; j < line.length; j++) {\n const seg = line[j];\n if (seg.length === 1) continue;\n\n const sourceIndex = seg[SOURCES_INDEX];\n const sourceLine = seg[SOURCE_LINE];\n const sourceColumn = seg[SOURCE_COLUMN];\n const originalSource = sources[sourceIndex];\n const originalLine = (originalSource[sourceLine] ||= []);\n const memo = memos[sourceIndex];\n\n // The binary search either found a match, or it found the left-index just before where the\n // segment should go. Either way, we want to insert after that. And there may be multiple\n // generated segments associated with an original location, so there may need to move several\n // indexes before we find where we need to insert.\n const index = upperBound(\n originalLine,\n sourceColumn,\n memoizedBinarySearch(originalLine, sourceColumn, memo, sourceLine),\n );\n\n insert(originalLine, (memo.lastIndex = index + 1), [sourceColumn, i, seg[COLUMN]]);\n }\n }\n\n return sources;\n}\n\nfunction insert(array: T[], index: number, value: T) {\n for (let i = array.length; i > index; i--) {\n array[i] = array[i - 1];\n }\n array[index] = value;\n}\n\n// Null arrays allow us to use ordered index keys without actually allocating contiguous memory like\n// a real array. We use a null-prototype object to avoid prototype pollution and deoptimizations.\n// Numeric properties on objects are magically sorted in ascending order by the engine regardless of\n// the insertion order. So, by setting any numeric keys, even out of order, we'll get ascending\n// order when iterating with for-in.\nfunction buildNullArray(): T {\n return { __proto__: null } as T;\n}\n","import { TraceMap, presortedDecodedMap, decodedMappings } from './trace-mapping';\nimport {\n COLUMN,\n SOURCES_INDEX,\n SOURCE_LINE,\n SOURCE_COLUMN,\n NAMES_INDEX,\n} from './sourcemap-segment';\n\nimport type {\n Section,\n SectionedSourceMap,\n DecodedSourceMap,\n SectionedSourceMapInput,\n Ro,\n} from './types';\nimport type { SourceMapSegment } from './sourcemap-segment';\n\ntype AnyMap = {\n new (map: SectionedSourceMapInput, mapUrl?: string | null): TraceMap;\n (map: SectionedSourceMapInput, mapUrl?: string | null): TraceMap;\n};\n\nexport const AnyMap: AnyMap = function (map, mapUrl) {\n const parsed =\n typeof map === 'string' ? (JSON.parse(map) as Exclude) : map;\n\n if (!('sections' in parsed)) return new TraceMap(parsed, mapUrl);\n\n const mappings: SourceMapSegment[][] = [];\n const sources: string[] = [];\n const sourcesContent: (string | null)[] = [];\n const names: string[] = [];\n\n recurse(parsed, mapUrl, mappings, sources, sourcesContent, names, 0, 0, Infinity, Infinity);\n\n const joined: DecodedSourceMap = {\n version: 3,\n file: parsed.file,\n names,\n sources,\n sourcesContent,\n mappings,\n };\n\n return presortedDecodedMap(joined);\n} as AnyMap;\n\nfunction recurse(\n input: Ro,\n mapUrl: string | null | undefined,\n mappings: SourceMapSegment[][],\n sources: string[],\n sourcesContent: (string | null)[],\n names: string[],\n lineOffset: number,\n columnOffset: number,\n stopLine: number,\n stopColumn: number,\n) {\n const { sections } = input;\n for (let i = 0; i < sections.length; i++) {\n const { map, offset } = sections[i];\n\n let sl = stopLine;\n let sc = stopColumn;\n if (i + 1 < sections.length) {\n const nextOffset = sections[i + 1].offset;\n sl = Math.min(stopLine, lineOffset + nextOffset.line);\n\n if (sl === stopLine) {\n sc = Math.min(stopColumn, columnOffset + nextOffset.column);\n } else if (sl < stopLine) {\n sc = columnOffset + nextOffset.column;\n }\n }\n\n addSection(\n map,\n mapUrl,\n mappings,\n sources,\n sourcesContent,\n names,\n lineOffset + offset.line,\n columnOffset + offset.column,\n sl,\n sc,\n );\n }\n}\n\nfunction addSection(\n input: Ro,\n mapUrl: string | null | undefined,\n mappings: SourceMapSegment[][],\n sources: string[],\n sourcesContent: (string | null)[],\n names: string[],\n lineOffset: number,\n columnOffset: number,\n stopLine: number,\n stopColumn: number,\n) {\n if ('sections' in input) return recurse(...(arguments as unknown as Parameters));\n\n const map = new TraceMap(input, mapUrl);\n const sourcesOffset = sources.length;\n const namesOffset = names.length;\n const decoded = decodedMappings(map);\n const { resolvedSources, sourcesContent: contents } = map;\n\n append(sources, resolvedSources);\n append(names, map.names);\n if (contents) append(sourcesContent, contents);\n else for (let i = 0; i < resolvedSources.length; i++) sourcesContent.push(null);\n\n for (let i = 0; i < decoded.length; i++) {\n const lineI = lineOffset + i;\n\n // We can only add so many lines before we step into the range that the next section's map\n // controls. When we get to the last line, then we'll start checking the segments to see if\n // they've crossed into the column range. But it may not have any columns that overstep, so we\n // still need to check that we don't overstep lines, too.\n if (lineI > stopLine) return;\n\n // The out line may already exist in mappings (if we're continuing the line started by a\n // previous section). Or, we may have jumped ahead several lines to start this section.\n const out = getLine(mappings, lineI);\n // On the 0th loop, the section's column offset shifts us forward. On all other lines (since the\n // map can be multiple lines), it doesn't.\n const cOffset = i === 0 ? columnOffset : 0;\n\n const line = decoded[i];\n for (let j = 0; j < line.length; j++) {\n const seg = line[j];\n const column = cOffset + seg[COLUMN];\n\n // If this segment steps into the column range that the next section's map controls, we need\n // to stop early.\n if (lineI === stopLine && column >= stopColumn) return;\n\n if (seg.length === 1) {\n out.push([column]);\n continue;\n }\n\n const sourcesIndex = sourcesOffset + seg[SOURCES_INDEX];\n const sourceLine = seg[SOURCE_LINE];\n const sourceColumn = seg[SOURCE_COLUMN];\n out.push(\n seg.length === 4\n ? [column, sourcesIndex, sourceLine, sourceColumn]\n : [column, sourcesIndex, sourceLine, sourceColumn, namesOffset + seg[NAMES_INDEX]],\n );\n }\n }\n}\n\nfunction append(arr: T[], other: T[]) {\n for (let i = 0; i < other.length; i++) arr.push(other[i]);\n}\n\nfunction getLine(arr: T[][], index: number): T[] {\n for (let i = arr.length; i <= index; i++) arr[i] = [];\n return arr[index];\n}\n","import { encode, decode } from '@jridgewell/sourcemap-codec';\n\nimport resolve from './resolve';\nimport stripFilename from './strip-filename';\nimport maybeSort from './sort';\nimport buildBySources from './by-source';\nimport {\n memoizedState,\n memoizedBinarySearch,\n upperBound,\n lowerBound,\n found as bsFound,\n} from './binary-search';\nimport {\n COLUMN,\n SOURCES_INDEX,\n SOURCE_LINE,\n SOURCE_COLUMN,\n NAMES_INDEX,\n REV_GENERATED_LINE,\n REV_GENERATED_COLUMN,\n} from './sourcemap-segment';\n\nimport type { SourceMapSegment, ReverseSegment } from './sourcemap-segment';\nimport type {\n SourceMapV3,\n DecodedSourceMap,\n EncodedSourceMap,\n InvalidOriginalMapping,\n OriginalMapping,\n InvalidGeneratedMapping,\n GeneratedMapping,\n SourceMapInput,\n Needle,\n SourceNeedle,\n SourceMap,\n EachMapping,\n Bias,\n} from './types';\nimport type { Source } from './by-source';\nimport type { MemoState } from './binary-search';\n\nexport type { SourceMapSegment } from './sourcemap-segment';\nexport type {\n SourceMapInput,\n SectionedSourceMapInput,\n DecodedSourceMap,\n EncodedSourceMap,\n SectionedSourceMap,\n InvalidOriginalMapping,\n OriginalMapping as Mapping,\n OriginalMapping,\n InvalidGeneratedMapping,\n GeneratedMapping,\n EachMapping,\n} from './types';\n\nconst LINE_GTR_ZERO = '`line` must be greater than 0 (lines start at line 1)';\nconst COL_GTR_EQ_ZERO = '`column` must be greater than or equal to 0 (columns start at column 0)';\n\nexport const LEAST_UPPER_BOUND = -1;\nexport const GREATEST_LOWER_BOUND = 1;\n\n/**\n * Returns the encoded (VLQ string) form of the SourceMap's mappings field.\n */\nexport let encodedMappings: (map: TraceMap) => EncodedSourceMap['mappings'];\n\n/**\n * Returns the decoded (array of lines of segments) form of the SourceMap's mappings field.\n */\nexport let decodedMappings: (map: TraceMap) => Readonly;\n\n/**\n * A low-level API to find the segment associated with a generated line/column (think, from a\n * stack trace). Line and column here are 0-based, unlike `originalPositionFor`.\n */\nexport let traceSegment: (\n map: TraceMap,\n line: number,\n column: number,\n) => Readonly | null;\n\n/**\n * A higher-level API to find the source/line/column associated with a generated line/column\n * (think, from a stack trace). Line is 1-based, but column is 0-based, due to legacy behavior in\n * `source-map` library.\n */\nexport let originalPositionFor: (\n map: TraceMap,\n needle: Needle,\n) => OriginalMapping | InvalidOriginalMapping;\n\n/**\n * Finds the generated line/column position of the provided source/line/column source position.\n */\nexport let generatedPositionFor: (\n map: TraceMap,\n needle: SourceNeedle,\n) => GeneratedMapping | InvalidGeneratedMapping;\n\n/**\n * Finds all generated line/column positions of the provided source/line/column source position.\n */\nexport let allGeneratedPositionsFor: (map: TraceMap, needle: SourceNeedle) => GeneratedMapping[];\n\n/**\n * Iterates each mapping in generated position order.\n */\nexport let eachMapping: (map: TraceMap, cb: (mapping: EachMapping) => void) => void;\n\n/**\n * Retrieves the source content for a particular source, if its found. Returns null if not.\n */\nexport let sourceContentFor: (map: TraceMap, source: string) => string | null;\n\n/**\n * A helper that skips sorting of the input map's mappings array, which can be expensive for larger\n * maps.\n */\nexport let presortedDecodedMap: (map: DecodedSourceMap, mapUrl?: string) => TraceMap;\n\n/**\n * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects\n * a sourcemap, or to JSON.stringify.\n */\nexport let decodedMap: (\n map: TraceMap,\n) => Omit & { mappings: readonly SourceMapSegment[][] };\n\n/**\n * Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects\n * a sourcemap, or to JSON.stringify.\n */\nexport let encodedMap: (map: TraceMap) => EncodedSourceMap;\n\nexport { AnyMap } from './any-map';\n\nexport class TraceMap implements SourceMap {\n declare version: SourceMapV3['version'];\n declare file: SourceMapV3['file'];\n declare names: SourceMapV3['names'];\n declare sourceRoot: SourceMapV3['sourceRoot'];\n declare sources: SourceMapV3['sources'];\n declare sourcesContent: SourceMapV3['sourcesContent'];\n\n declare resolvedSources: string[];\n private declare _encoded: string | undefined;\n\n private declare _decoded: SourceMapSegment[][] | undefined;\n private declare _decodedMemo: MemoState;\n\n private declare _bySources: Source[] | undefined;\n private declare _bySourceMemos: MemoState[] | undefined;\n\n constructor(map: SourceMapInput, mapUrl?: string | null) {\n const isString = typeof map === 'string';\n\n if (!isString && (map as unknown as { _decodedMemo: any })._decodedMemo) return map as TraceMap;\n\n const parsed = (isString ? JSON.parse(map) : map) as DecodedSourceMap | EncodedSourceMap;\n\n const { version, file, names, sourceRoot, sources, sourcesContent } = parsed;\n this.version = version;\n this.file = file;\n this.names = names;\n this.sourceRoot = sourceRoot;\n this.sources = sources;\n this.sourcesContent = sourcesContent;\n\n const from = resolve(sourceRoot || '', stripFilename(mapUrl));\n this.resolvedSources = sources.map((s) => resolve(s || '', from));\n\n const { mappings } = parsed;\n if (typeof mappings === 'string') {\n this._encoded = mappings;\n this._decoded = undefined;\n } else {\n this._encoded = undefined;\n this._decoded = maybeSort(mappings, isString);\n }\n\n this._decodedMemo = memoizedState();\n this._bySources = undefined;\n this._bySourceMemos = undefined;\n }\n\n static {\n encodedMappings = (map) => {\n return (map._encoded ??= encode(map._decoded!));\n };\n\n decodedMappings = (map) => {\n return (map._decoded ||= decode(map._encoded!));\n };\n\n traceSegment = (map, line, column) => {\n const decoded = decodedMappings(map);\n\n // It's common for parent source maps to have pointers to lines that have no\n // mapping (like a \"//# sourceMappingURL=\") at the end of the child file.\n if (line >= decoded.length) return null;\n\n const segments = decoded[line];\n const index = traceSegmentInternal(\n segments,\n map._decodedMemo,\n line,\n column,\n GREATEST_LOWER_BOUND,\n );\n\n return index === -1 ? null : segments[index];\n };\n\n originalPositionFor = (map, { line, column, bias }) => {\n line--;\n if (line < 0) throw new Error(LINE_GTR_ZERO);\n if (column < 0) throw new Error(COL_GTR_EQ_ZERO);\n\n const decoded = decodedMappings(map);\n\n // It's common for parent source maps to have pointers to lines that have no\n // mapping (like a \"//# sourceMappingURL=\") at the end of the child file.\n if (line >= decoded.length) return OMapping(null, null, null, null);\n\n const segments = decoded[line];\n const index = traceSegmentInternal(\n segments,\n map._decodedMemo,\n line,\n column,\n bias || GREATEST_LOWER_BOUND,\n );\n\n if (index === -1) return OMapping(null, null, null, null);\n\n const segment = segments[index];\n if (segment.length === 1) return OMapping(null, null, null, null);\n\n const { names, resolvedSources } = map;\n return OMapping(\n resolvedSources[segment[SOURCES_INDEX]],\n segment[SOURCE_LINE] + 1,\n segment[SOURCE_COLUMN],\n segment.length === 5 ? names[segment[NAMES_INDEX]] : null,\n );\n };\n\n allGeneratedPositionsFor = (map, { source, line, column, bias }) => {\n // SourceMapConsumer uses LEAST_UPPER_BOUND for some reason, so we follow suit.\n return generatedPosition(map, source, line, column, bias || LEAST_UPPER_BOUND, true);\n };\n\n generatedPositionFor = (map, { source, line, column, bias }) => {\n return generatedPosition(map, source, line, column, bias || GREATEST_LOWER_BOUND, false);\n };\n\n eachMapping = (map, cb) => {\n const decoded = decodedMappings(map);\n const { names, resolvedSources } = map;\n\n for (let i = 0; i < decoded.length; i++) {\n const line = decoded[i];\n for (let j = 0; j < line.length; j++) {\n const seg = line[j];\n\n const generatedLine = i + 1;\n const generatedColumn = seg[0];\n let source = null;\n let originalLine = null;\n let originalColumn = null;\n let name = null;\n if (seg.length !== 1) {\n source = resolvedSources[seg[1]];\n originalLine = seg[2] + 1;\n originalColumn = seg[3];\n }\n if (seg.length === 5) name = names[seg[4]];\n\n cb({\n generatedLine,\n generatedColumn,\n source,\n originalLine,\n originalColumn,\n name,\n } as EachMapping);\n }\n }\n };\n\n sourceContentFor = (map, source) => {\n const { sources, resolvedSources, sourcesContent } = map;\n if (sourcesContent == null) return null;\n\n let index = sources.indexOf(source);\n if (index === -1) index = resolvedSources.indexOf(source);\n\n return index === -1 ? null : sourcesContent[index];\n };\n\n presortedDecodedMap = (map, mapUrl) => {\n const tracer = new TraceMap(clone(map, []), mapUrl);\n tracer._decoded = map.mappings;\n return tracer;\n };\n\n decodedMap = (map) => {\n return clone(map, decodedMappings(map));\n };\n\n encodedMap = (map) => {\n return clone(map, encodedMappings(map));\n };\n\n function generatedPosition(\n map: TraceMap,\n source: string,\n line: number,\n column: number,\n bias: Bias,\n all: false,\n ): GeneratedMapping | InvalidGeneratedMapping;\n function generatedPosition(\n map: TraceMap,\n source: string,\n line: number,\n column: number,\n bias: Bias,\n all: true,\n ): GeneratedMapping[];\n function generatedPosition(\n map: TraceMap,\n source: string,\n line: number,\n column: number,\n bias: Bias,\n all: boolean,\n ): GeneratedMapping | InvalidGeneratedMapping | GeneratedMapping[] {\n line--;\n if (line < 0) throw new Error(LINE_GTR_ZERO);\n if (column < 0) throw new Error(COL_GTR_EQ_ZERO);\n\n const { sources, resolvedSources } = map;\n let sourceIndex = sources.indexOf(source);\n if (sourceIndex === -1) sourceIndex = resolvedSources.indexOf(source);\n if (sourceIndex === -1) return all ? [] : GMapping(null, null);\n\n const generated = (map._bySources ||= buildBySources(\n decodedMappings(map),\n (map._bySourceMemos = sources.map(memoizedState)),\n ));\n\n const segments = generated[sourceIndex][line];\n if (segments == null) return all ? [] : GMapping(null, null);\n\n const memo = map._bySourceMemos![sourceIndex];\n\n if (all) return sliceGeneratedPositions(segments, memo, line, column, bias);\n\n const index = traceSegmentInternal(segments, memo, line, column, bias);\n if (index === -1) return GMapping(null, null);\n\n const segment = segments[index];\n return GMapping(segment[REV_GENERATED_LINE] + 1, segment[REV_GENERATED_COLUMN]);\n }\n }\n}\n\nfunction clone(\n map: TraceMap | DecodedSourceMap | EncodedSourceMap,\n mappings: T,\n): T extends string ? EncodedSourceMap : DecodedSourceMap {\n return {\n version: map.version,\n file: map.file,\n names: map.names,\n sourceRoot: map.sourceRoot,\n sources: map.sources,\n sourcesContent: map.sourcesContent,\n mappings,\n } as any;\n}\n\nfunction OMapping(source: null, line: null, column: null, name: null): InvalidOriginalMapping;\nfunction OMapping(\n source: string,\n line: number,\n column: number,\n name: string | null,\n): OriginalMapping;\nfunction OMapping(\n source: string | null,\n line: number | null,\n column: number | null,\n name: string | null,\n): OriginalMapping | InvalidOriginalMapping {\n return { source, line, column, name } as any;\n}\n\nfunction GMapping(line: null, column: null): InvalidGeneratedMapping;\nfunction GMapping(line: number, column: number): GeneratedMapping;\nfunction GMapping(\n line: number | null,\n column: number | null,\n): GeneratedMapping | InvalidGeneratedMapping {\n return { line, column } as any;\n}\n\nfunction traceSegmentInternal(\n segments: SourceMapSegment[],\n memo: MemoState,\n line: number,\n column: number,\n bias: Bias,\n): number;\nfunction traceSegmentInternal(\n segments: ReverseSegment[],\n memo: MemoState,\n line: number,\n column: number,\n bias: Bias,\n): number;\nfunction traceSegmentInternal(\n segments: SourceMapSegment[] | ReverseSegment[],\n memo: MemoState,\n line: number,\n column: number,\n bias: Bias,\n): number {\n let index = memoizedBinarySearch(segments, column, memo, line);\n if (bsFound) {\n index = (bias === LEAST_UPPER_BOUND ? upperBound : lowerBound)(segments, column, index);\n } else if (bias === LEAST_UPPER_BOUND) index++;\n\n if (index === -1 || index === segments.length) return -1;\n return index;\n}\n\nfunction sliceGeneratedPositions(\n segments: ReverseSegment[],\n memo: MemoState,\n line: number,\n column: number,\n bias: Bias,\n): GeneratedMapping[] {\n let min = traceSegmentInternal(segments, memo, line, column, GREATEST_LOWER_BOUND);\n\n // We ignored the bias when tracing the segment so that we're guarnateed to find the first (in\n // insertion order) segment that matched. Even if we did respect the bias when tracing, we would\n // still need to call `lowerBound()` to find the first segment, which is slower than just looking\n // for the GREATEST_LOWER_BOUND to begin with. The only difference that matters for us is when the\n // binary search didn't match, in which case GREATEST_LOWER_BOUND just needs to increment to\n // match LEAST_UPPER_BOUND.\n if (!bsFound && bias === LEAST_UPPER_BOUND) min++;\n\n if (min === -1 || min === segments.length) return [];\n\n // We may have found the segment that started at an earlier column. If this is the case, then we\n // need to slice all generated segments that match _that_ column, because all such segments span\n // to our desired column.\n const matchedColumn = bsFound ? column : segments[min][COLUMN];\n\n // The binary search is not guaranteed to find the lower bound when a match wasn't found.\n if (!bsFound) min = lowerBound(segments, matchedColumn, min);\n const max = upperBound(segments, matchedColumn, min);\n\n const result = [];\n for (; min <= max; min++) {\n const segment = segments[min];\n result.push(GMapping(segment[REV_GENERATED_LINE] + 1, segment[REV_GENERATED_COLUMN]));\n }\n return result;\n}\n"],"names":["bsFound"],"mappings":";;;AAEc,SAAU,OAAO,CAAC,KAAa,EAAE,IAAwB,EAAA;;;;IAIrE,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC;QAAE,IAAI,IAAI,GAAG,CAAC;AAE7C,IAAA,OAAO,UAAU,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;AACjC;;ACTA;;AAEG;AACqB,SAAA,aAAa,CAAC,IAA+B,EAAA;AACnE,IAAA,IAAI,CAAC,IAAI;AAAE,QAAA,OAAO,EAAE,CAAC;IACrB,MAAM,KAAK,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IACpC,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC;AAClC;;ACQO,MAAM,MAAM,GAAG,CAAC,CAAC;AACjB,MAAM,aAAa,GAAG,CAAC,CAAC;AACxB,MAAM,WAAW,GAAG,CAAC,CAAC;AACtB,MAAM,aAAa,GAAG,CAAC,CAAC;AACxB,MAAM,WAAW,GAAG,CAAC,CAAC;AAEtB,MAAM,kBAAkB,GAAG,CAAC,CAAC;AAC7B,MAAM,oBAAoB,GAAG,CAA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C,QAAQ,EAAE,aAAa,EAAE,GAAG,CAAC,CAAC;IAC7D,MAAM,GAAG,GAAG,UAAU,CAAC,QAAQ,EAAE,aAAa,EAAE,GAAG,CAAC,CAAC;IAErD,MAAM,MAAM,GAAG,EAAE,CAAC;AAClB,IAAA,OAAO,GAAG,IAAI,GAAG,EAAE,GAAG,EAAE,EAAE;AACxB,QAAA,MAAM,OAAO,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC;AAC9B,QAAA,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,kBAAkB,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC;AACvF,KAAA;AACD,IAAA,OAAO,MAAM,CAAC;AAChB;;;;"} \ No newline at end of file diff --git a/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js b/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js new file mode 100644 index 0000000..a3251f1 --- /dev/null +++ b/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js @@ -0,0 +1,566 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@jridgewell/sourcemap-codec'), require('@jridgewell/resolve-uri')) : + typeof define === 'function' && define.amd ? define(['exports', '@jridgewell/sourcemap-codec', '@jridgewell/resolve-uri'], factory) : + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.traceMapping = {}, global.sourcemapCodec, global.resolveURI)); +})(this, (function (exports, sourcemapCodec, resolveUri) { 'use strict'; + + function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } + + var resolveUri__default = /*#__PURE__*/_interopDefaultLegacy(resolveUri); + + function resolve(input, base) { + // The base is always treated as a directory, if it's not empty. + // https://github.com/mozilla/source-map/blob/8cb3ee57/lib/util.js#L327 + // https://github.com/chromium/chromium/blob/da4adbb3/third_party/blink/renderer/devtools/front_end/sdk/SourceMap.js#L400-L401 + if (base && !base.endsWith('/')) + base += '/'; + return resolveUri__default["default"](input, base); + } + + /** + * Removes everything after the last "/", but leaves the slash. + */ + function stripFilename(path) { + if (!path) + return ''; + const index = path.lastIndexOf('/'); + return path.slice(0, index + 1); + } + + const COLUMN = 0; + const SOURCES_INDEX = 1; + const SOURCE_LINE = 2; + const SOURCE_COLUMN = 3; + const NAMES_INDEX = 4; + const REV_GENERATED_LINE = 1; + const REV_GENERATED_COLUMN = 2; + + function maybeSort(mappings, owned) { + const unsortedIndex = nextUnsortedSegmentLine(mappings, 0); + if (unsortedIndex === mappings.length) + return mappings; + // If we own the array (meaning we parsed it from JSON), then we're free to directly mutate it. If + // not, we do not want to modify the consumer's input array. + if (!owned) + mappings = mappings.slice(); + for (let i = unsortedIndex; i < mappings.length; i = nextUnsortedSegmentLine(mappings, i + 1)) { + mappings[i] = sortSegments(mappings[i], owned); + } + return mappings; + } + function nextUnsortedSegmentLine(mappings, start) { + for (let i = start; i < mappings.length; i++) { + if (!isSorted(mappings[i])) + return i; + } + return mappings.length; + } + function isSorted(line) { + for (let j = 1; j < line.length; j++) { + if (line[j][COLUMN] < line[j - 1][COLUMN]) { + return false; + } + } + return true; + } + function sortSegments(line, owned) { + if (!owned) + line = line.slice(); + return line.sort(sortComparator); + } + function sortComparator(a, b) { + return a[COLUMN] - b[COLUMN]; + } + + let found = false; + /** + * A binary search implementation that returns the index if a match is found. + * If no match is found, then the left-index (the index associated with the item that comes just + * before the desired index) is returned. To maintain proper sort order, a splice would happen at + * the next index: + * + * ```js + * const array = [1, 3]; + * const needle = 2; + * const index = binarySearch(array, needle, (item, needle) => item - needle); + * + * assert.equal(index, 0); + * array.splice(index + 1, 0, needle); + * assert.deepEqual(array, [1, 2, 3]); + * ``` + */ + function binarySearch(haystack, needle, low, high) { + while (low <= high) { + const mid = low + ((high - low) >> 1); + const cmp = haystack[mid][COLUMN] - needle; + if (cmp === 0) { + found = true; + return mid; + } + if (cmp < 0) { + low = mid + 1; + } + else { + high = mid - 1; + } + } + found = false; + return low - 1; + } + function upperBound(haystack, needle, index) { + for (let i = index + 1; i < haystack.length; index = i++) { + if (haystack[i][COLUMN] !== needle) + break; + } + return index; + } + function lowerBound(haystack, needle, index) { + for (let i = index - 1; i >= 0; index = i--) { + if (haystack[i][COLUMN] !== needle) + break; + } + return index; + } + function memoizedState() { + return { + lastKey: -1, + lastNeedle: -1, + lastIndex: -1, + }; + } + /** + * This overly complicated beast is just to record the last tested line/column and the resulting + * index, allowing us to skip a few tests if mappings are monotonically increasing. + */ + function memoizedBinarySearch(haystack, needle, state, key) { + const { lastKey, lastNeedle, lastIndex } = state; + let low = 0; + let high = haystack.length - 1; + if (key === lastKey) { + if (needle === lastNeedle) { + found = lastIndex !== -1 && haystack[lastIndex][COLUMN] === needle; + return lastIndex; + } + if (needle >= lastNeedle) { + // lastIndex may be -1 if the previous needle was not found. + low = lastIndex === -1 ? 0 : lastIndex; + } + else { + high = lastIndex; + } + } + state.lastKey = key; + state.lastNeedle = needle; + return (state.lastIndex = binarySearch(haystack, needle, low, high)); + } + + // Rebuilds the original source files, with mappings that are ordered by source line/column instead + // of generated line/column. + function buildBySources(decoded, memos) { + const sources = memos.map(buildNullArray); + for (let i = 0; i < decoded.length; i++) { + const line = decoded[i]; + for (let j = 0; j < line.length; j++) { + const seg = line[j]; + if (seg.length === 1) + continue; + const sourceIndex = seg[SOURCES_INDEX]; + const sourceLine = seg[SOURCE_LINE]; + const sourceColumn = seg[SOURCE_COLUMN]; + const originalSource = sources[sourceIndex]; + const originalLine = (originalSource[sourceLine] || (originalSource[sourceLine] = [])); + const memo = memos[sourceIndex]; + // The binary search either found a match, or it found the left-index just before where the + // segment should go. Either way, we want to insert after that. And there may be multiple + // generated segments associated with an original location, so there may need to move several + // indexes before we find where we need to insert. + const index = upperBound(originalLine, sourceColumn, memoizedBinarySearch(originalLine, sourceColumn, memo, sourceLine)); + insert(originalLine, (memo.lastIndex = index + 1), [sourceColumn, i, seg[COLUMN]]); + } + } + return sources; + } + function insert(array, index, value) { + for (let i = array.length; i > index; i--) { + array[i] = array[i - 1]; + } + array[index] = value; + } + // Null arrays allow us to use ordered index keys without actually allocating contiguous memory like + // a real array. We use a null-prototype object to avoid prototype pollution and deoptimizations. + // Numeric properties on objects are magically sorted in ascending order by the engine regardless of + // the insertion order. So, by setting any numeric keys, even out of order, we'll get ascending + // order when iterating with for-in. + function buildNullArray() { + return { __proto__: null }; + } + + const AnyMap = function (map, mapUrl) { + const parsed = typeof map === 'string' ? JSON.parse(map) : map; + if (!('sections' in parsed)) + return new TraceMap(parsed, mapUrl); + const mappings = []; + const sources = []; + const sourcesContent = []; + const names = []; + recurse(parsed, mapUrl, mappings, sources, sourcesContent, names, 0, 0, Infinity, Infinity); + const joined = { + version: 3, + file: parsed.file, + names, + sources, + sourcesContent, + mappings, + }; + return exports.presortedDecodedMap(joined); + }; + function recurse(input, mapUrl, mappings, sources, sourcesContent, names, lineOffset, columnOffset, stopLine, stopColumn) { + const { sections } = input; + for (let i = 0; i < sections.length; i++) { + const { map, offset } = sections[i]; + let sl = stopLine; + let sc = stopColumn; + if (i + 1 < sections.length) { + const nextOffset = sections[i + 1].offset; + sl = Math.min(stopLine, lineOffset + nextOffset.line); + if (sl === stopLine) { + sc = Math.min(stopColumn, columnOffset + nextOffset.column); + } + else if (sl < stopLine) { + sc = columnOffset + nextOffset.column; + } + } + addSection(map, mapUrl, mappings, sources, sourcesContent, names, lineOffset + offset.line, columnOffset + offset.column, sl, sc); + } + } + function addSection(input, mapUrl, mappings, sources, sourcesContent, names, lineOffset, columnOffset, stopLine, stopColumn) { + if ('sections' in input) + return recurse(...arguments); + const map = new TraceMap(input, mapUrl); + const sourcesOffset = sources.length; + const namesOffset = names.length; + const decoded = exports.decodedMappings(map); + const { resolvedSources, sourcesContent: contents } = map; + append(sources, resolvedSources); + append(names, map.names); + if (contents) + append(sourcesContent, contents); + else + for (let i = 0; i < resolvedSources.length; i++) + sourcesContent.push(null); + for (let i = 0; i < decoded.length; i++) { + const lineI = lineOffset + i; + // We can only add so many lines before we step into the range that the next section's map + // controls. When we get to the last line, then we'll start checking the segments to see if + // they've crossed into the column range. But it may not have any columns that overstep, so we + // still need to check that we don't overstep lines, too. + if (lineI > stopLine) + return; + // The out line may already exist in mappings (if we're continuing the line started by a + // previous section). Or, we may have jumped ahead several lines to start this section. + const out = getLine(mappings, lineI); + // On the 0th loop, the section's column offset shifts us forward. On all other lines (since the + // map can be multiple lines), it doesn't. + const cOffset = i === 0 ? columnOffset : 0; + const line = decoded[i]; + for (let j = 0; j < line.length; j++) { + const seg = line[j]; + const column = cOffset + seg[COLUMN]; + // If this segment steps into the column range that the next section's map controls, we need + // to stop early. + if (lineI === stopLine && column >= stopColumn) + return; + if (seg.length === 1) { + out.push([column]); + continue; + } + const sourcesIndex = sourcesOffset + seg[SOURCES_INDEX]; + const sourceLine = seg[SOURCE_LINE]; + const sourceColumn = seg[SOURCE_COLUMN]; + out.push(seg.length === 4 + ? [column, sourcesIndex, sourceLine, sourceColumn] + : [column, sourcesIndex, sourceLine, sourceColumn, namesOffset + seg[NAMES_INDEX]]); + } + } + } + function append(arr, other) { + for (let i = 0; i < other.length; i++) + arr.push(other[i]); + } + function getLine(arr, index) { + for (let i = arr.length; i <= index; i++) + arr[i] = []; + return arr[index]; + } + + const LINE_GTR_ZERO = '`line` must be greater than 0 (lines start at line 1)'; + const COL_GTR_EQ_ZERO = '`column` must be greater than or equal to 0 (columns start at column 0)'; + const LEAST_UPPER_BOUND = -1; + const GREATEST_LOWER_BOUND = 1; + /** + * Returns the encoded (VLQ string) form of the SourceMap's mappings field. + */ + exports.encodedMappings = void 0; + /** + * Returns the decoded (array of lines of segments) form of the SourceMap's mappings field. + */ + exports.decodedMappings = void 0; + /** + * A low-level API to find the segment associated with a generated line/column (think, from a + * stack trace). Line and column here are 0-based, unlike `originalPositionFor`. + */ + exports.traceSegment = void 0; + /** + * A higher-level API to find the source/line/column associated with a generated line/column + * (think, from a stack trace). Line is 1-based, but column is 0-based, due to legacy behavior in + * `source-map` library. + */ + exports.originalPositionFor = void 0; + /** + * Finds the generated line/column position of the provided source/line/column source position. + */ + exports.generatedPositionFor = void 0; + /** + * Finds all generated line/column positions of the provided source/line/column source position. + */ + exports.allGeneratedPositionsFor = void 0; + /** + * Iterates each mapping in generated position order. + */ + exports.eachMapping = void 0; + /** + * Retrieves the source content for a particular source, if its found. Returns null if not. + */ + exports.sourceContentFor = void 0; + /** + * A helper that skips sorting of the input map's mappings array, which can be expensive for larger + * maps. + */ + exports.presortedDecodedMap = void 0; + /** + * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects + * a sourcemap, or to JSON.stringify. + */ + exports.decodedMap = void 0; + /** + * Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects + * a sourcemap, or to JSON.stringify. + */ + exports.encodedMap = void 0; + class TraceMap { + constructor(map, mapUrl) { + const isString = typeof map === 'string'; + if (!isString && map._decodedMemo) + return map; + const parsed = (isString ? JSON.parse(map) : map); + const { version, file, names, sourceRoot, sources, sourcesContent } = parsed; + this.version = version; + this.file = file; + this.names = names; + this.sourceRoot = sourceRoot; + this.sources = sources; + this.sourcesContent = sourcesContent; + const from = resolve(sourceRoot || '', stripFilename(mapUrl)); + this.resolvedSources = sources.map((s) => resolve(s || '', from)); + const { mappings } = parsed; + if (typeof mappings === 'string') { + this._encoded = mappings; + this._decoded = undefined; + } + else { + this._encoded = undefined; + this._decoded = maybeSort(mappings, isString); + } + this._decodedMemo = memoizedState(); + this._bySources = undefined; + this._bySourceMemos = undefined; + } + } + (() => { + exports.encodedMappings = (map) => { + var _a; + return ((_a = map._encoded) !== null && _a !== void 0 ? _a : (map._encoded = sourcemapCodec.encode(map._decoded))); + }; + exports.decodedMappings = (map) => { + return (map._decoded || (map._decoded = sourcemapCodec.decode(map._encoded))); + }; + exports.traceSegment = (map, line, column) => { + const decoded = exports.decodedMappings(map); + // It's common for parent source maps to have pointers to lines that have no + // mapping (like a "//# sourceMappingURL=") at the end of the child file. + if (line >= decoded.length) + return null; + const segments = decoded[line]; + const index = traceSegmentInternal(segments, map._decodedMemo, line, column, GREATEST_LOWER_BOUND); + return index === -1 ? null : segments[index]; + }; + exports.originalPositionFor = (map, { line, column, bias }) => { + line--; + if (line < 0) + throw new Error(LINE_GTR_ZERO); + if (column < 0) + throw new Error(COL_GTR_EQ_ZERO); + const decoded = exports.decodedMappings(map); + // It's common for parent source maps to have pointers to lines that have no + // mapping (like a "//# sourceMappingURL=") at the end of the child file. + if (line >= decoded.length) + return OMapping(null, null, null, null); + const segments = decoded[line]; + const index = traceSegmentInternal(segments, map._decodedMemo, line, column, bias || GREATEST_LOWER_BOUND); + if (index === -1) + return OMapping(null, null, null, null); + const segment = segments[index]; + if (segment.length === 1) + return OMapping(null, null, null, null); + const { names, resolvedSources } = map; + return OMapping(resolvedSources[segment[SOURCES_INDEX]], segment[SOURCE_LINE] + 1, segment[SOURCE_COLUMN], segment.length === 5 ? names[segment[NAMES_INDEX]] : null); + }; + exports.allGeneratedPositionsFor = (map, { source, line, column, bias }) => { + // SourceMapConsumer uses LEAST_UPPER_BOUND for some reason, so we follow suit. + return generatedPosition(map, source, line, column, bias || LEAST_UPPER_BOUND, true); + }; + exports.generatedPositionFor = (map, { source, line, column, bias }) => { + return generatedPosition(map, source, line, column, bias || GREATEST_LOWER_BOUND, false); + }; + exports.eachMapping = (map, cb) => { + const decoded = exports.decodedMappings(map); + const { names, resolvedSources } = map; + for (let i = 0; i < decoded.length; i++) { + const line = decoded[i]; + for (let j = 0; j < line.length; j++) { + const seg = line[j]; + const generatedLine = i + 1; + const generatedColumn = seg[0]; + let source = null; + let originalLine = null; + let originalColumn = null; + let name = null; + if (seg.length !== 1) { + source = resolvedSources[seg[1]]; + originalLine = seg[2] + 1; + originalColumn = seg[3]; + } + if (seg.length === 5) + name = names[seg[4]]; + cb({ + generatedLine, + generatedColumn, + source, + originalLine, + originalColumn, + name, + }); + } + } + }; + exports.sourceContentFor = (map, source) => { + const { sources, resolvedSources, sourcesContent } = map; + if (sourcesContent == null) + return null; + let index = sources.indexOf(source); + if (index === -1) + index = resolvedSources.indexOf(source); + return index === -1 ? null : sourcesContent[index]; + }; + exports.presortedDecodedMap = (map, mapUrl) => { + const tracer = new TraceMap(clone(map, []), mapUrl); + tracer._decoded = map.mappings; + return tracer; + }; + exports.decodedMap = (map) => { + return clone(map, exports.decodedMappings(map)); + }; + exports.encodedMap = (map) => { + return clone(map, exports.encodedMappings(map)); + }; + function generatedPosition(map, source, line, column, bias, all) { + line--; + if (line < 0) + throw new Error(LINE_GTR_ZERO); + if (column < 0) + throw new Error(COL_GTR_EQ_ZERO); + const { sources, resolvedSources } = map; + let sourceIndex = sources.indexOf(source); + if (sourceIndex === -1) + sourceIndex = resolvedSources.indexOf(source); + if (sourceIndex === -1) + return all ? [] : GMapping(null, null); + const generated = (map._bySources || (map._bySources = buildBySources(exports.decodedMappings(map), (map._bySourceMemos = sources.map(memoizedState))))); + const segments = generated[sourceIndex][line]; + if (segments == null) + return all ? [] : GMapping(null, null); + const memo = map._bySourceMemos[sourceIndex]; + if (all) + return sliceGeneratedPositions(segments, memo, line, column, bias); + const index = traceSegmentInternal(segments, memo, line, column, bias); + if (index === -1) + return GMapping(null, null); + const segment = segments[index]; + return GMapping(segment[REV_GENERATED_LINE] + 1, segment[REV_GENERATED_COLUMN]); + } + })(); + function clone(map, mappings) { + return { + version: map.version, + file: map.file, + names: map.names, + sourceRoot: map.sourceRoot, + sources: map.sources, + sourcesContent: map.sourcesContent, + mappings, + }; + } + function OMapping(source, line, column, name) { + return { source, line, column, name }; + } + function GMapping(line, column) { + return { line, column }; + } + function traceSegmentInternal(segments, memo, line, column, bias) { + let index = memoizedBinarySearch(segments, column, memo, line); + if (found) { + index = (bias === LEAST_UPPER_BOUND ? upperBound : lowerBound)(segments, column, index); + } + else if (bias === LEAST_UPPER_BOUND) + index++; + if (index === -1 || index === segments.length) + return -1; + return index; + } + function sliceGeneratedPositions(segments, memo, line, column, bias) { + let min = traceSegmentInternal(segments, memo, line, column, GREATEST_LOWER_BOUND); + // We ignored the bias when tracing the segment so that we're guarnateed to find the first (in + // insertion order) segment that matched. Even if we did respect the bias when tracing, we would + // still need to call `lowerBound()` to find the first segment, which is slower than just looking + // for the GREATEST_LOWER_BOUND to begin with. The only difference that matters for us is when the + // binary search didn't match, in which case GREATEST_LOWER_BOUND just needs to increment to + // match LEAST_UPPER_BOUND. + if (!found && bias === LEAST_UPPER_BOUND) + min++; + if (min === -1 || min === segments.length) + return []; + // We may have found the segment that started at an earlier column. If this is the case, then we + // need to slice all generated segments that match _that_ column, because all such segments span + // to our desired column. + const matchedColumn = found ? column : segments[min][COLUMN]; + // The binary search is not guaranteed to find the lower bound when a match wasn't found. + if (!found) + min = lowerBound(segments, matchedColumn, min); + const max = upperBound(segments, matchedColumn, min); + const result = []; + for (; min <= max; min++) { + const segment = segments[min]; + result.push(GMapping(segment[REV_GENERATED_LINE] + 1, segment[REV_GENERATED_COLUMN])); + } + return result; + } + + exports.AnyMap = AnyMap; + exports.GREATEST_LOWER_BOUND = GREATEST_LOWER_BOUND; + exports.LEAST_UPPER_BOUND = LEAST_UPPER_BOUND; + exports.TraceMap = TraceMap; + + Object.defineProperty(exports, '__esModule', { value: true }); + +})); +//# sourceMappingURL=trace-mapping.umd.js.map diff --git a/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js.map b/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js.map new file mode 100644 index 0000000..fee1219 --- /dev/null +++ b/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js.map @@ -0,0 +1 @@ +{"version":3,"file":"trace-mapping.umd.js","sources":["../src/resolve.ts","../src/strip-filename.ts","../src/sourcemap-segment.ts","../src/sort.ts","../src/binary-search.ts","../src/by-source.ts","../src/any-map.ts","../src/trace-mapping.ts"],"sourcesContent":["import resolveUri from '@jridgewell/resolve-uri';\n\nexport default function resolve(input: string, base: string | undefined): string {\n // The base is always treated as a directory, if it's not empty.\n // https://github.com/mozilla/source-map/blob/8cb3ee57/lib/util.js#L327\n // https://github.com/chromium/chromium/blob/da4adbb3/third_party/blink/renderer/devtools/front_end/sdk/SourceMap.js#L400-L401\n if (base && !base.endsWith('/')) base += '/';\n\n return resolveUri(input, base);\n}\n","/**\n * Removes everything after the last \"/\", but leaves the slash.\n */\nexport default function stripFilename(path: string | undefined | null): string {\n if (!path) return '';\n const index = path.lastIndexOf('/');\n return path.slice(0, index + 1);\n}\n","type GeneratedColumn = number;\ntype SourcesIndex = number;\ntype SourceLine = number;\ntype SourceColumn = number;\ntype NamesIndex = number;\n\ntype GeneratedLine = number;\n\nexport type SourceMapSegment =\n | [GeneratedColumn]\n | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn]\n | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn, NamesIndex];\n\nexport type ReverseSegment = [SourceColumn, GeneratedLine, GeneratedColumn];\n\nexport const COLUMN = 0;\nexport const SOURCES_INDEX = 1;\nexport const SOURCE_LINE = 2;\nexport const SOURCE_COLUMN = 3;\nexport const NAMES_INDEX = 4;\n\nexport const REV_GENERATED_LINE = 1;\nexport const REV_GENERATED_COLUMN = 2;\n","import { COLUMN } from './sourcemap-segment';\n\nimport type { SourceMapSegment } from './sourcemap-segment';\n\nexport default function maybeSort(\n mappings: SourceMapSegment[][],\n owned: boolean,\n): SourceMapSegment[][] {\n const unsortedIndex = nextUnsortedSegmentLine(mappings, 0);\n if (unsortedIndex === mappings.length) return mappings;\n\n // If we own the array (meaning we parsed it from JSON), then we're free to directly mutate it. If\n // not, we do not want to modify the consumer's input array.\n if (!owned) mappings = mappings.slice();\n\n for (let i = unsortedIndex; i < mappings.length; i = nextUnsortedSegmentLine(mappings, i + 1)) {\n mappings[i] = sortSegments(mappings[i], owned);\n }\n return mappings;\n}\n\nfunction nextUnsortedSegmentLine(mappings: SourceMapSegment[][], start: number): number {\n for (let i = start; i < mappings.length; i++) {\n if (!isSorted(mappings[i])) return i;\n }\n return mappings.length;\n}\n\nfunction isSorted(line: SourceMapSegment[]): boolean {\n for (let j = 1; j < line.length; j++) {\n if (line[j][COLUMN] < line[j - 1][COLUMN]) {\n return false;\n }\n }\n return true;\n}\n\nfunction sortSegments(line: SourceMapSegment[], owned: boolean): SourceMapSegment[] {\n if (!owned) line = line.slice();\n return line.sort(sortComparator);\n}\n\nfunction sortComparator(a: SourceMapSegment, b: SourceMapSegment): number {\n return a[COLUMN] - b[COLUMN];\n}\n","import type { SourceMapSegment, ReverseSegment } from './sourcemap-segment';\nimport { COLUMN } from './sourcemap-segment';\n\nexport type MemoState = {\n lastKey: number;\n lastNeedle: number;\n lastIndex: number;\n};\n\nexport let found = false;\n\n/**\n * A binary search implementation that returns the index if a match is found.\n * If no match is found, then the left-index (the index associated with the item that comes just\n * before the desired index) is returned. To maintain proper sort order, a splice would happen at\n * the next index:\n *\n * ```js\n * const array = [1, 3];\n * const needle = 2;\n * const index = binarySearch(array, needle, (item, needle) => item - needle);\n *\n * assert.equal(index, 0);\n * array.splice(index + 1, 0, needle);\n * assert.deepEqual(array, [1, 2, 3]);\n * ```\n */\nexport function binarySearch(\n haystack: SourceMapSegment[] | ReverseSegment[],\n needle: number,\n low: number,\n high: number,\n): number {\n while (low <= high) {\n const mid = low + ((high - low) >> 1);\n const cmp = haystack[mid][COLUMN] - needle;\n\n if (cmp === 0) {\n found = true;\n return mid;\n }\n\n if (cmp < 0) {\n low = mid + 1;\n } else {\n high = mid - 1;\n }\n }\n\n found = false;\n return low - 1;\n}\n\nexport function upperBound(\n haystack: SourceMapSegment[] | ReverseSegment[],\n needle: number,\n index: number,\n): number {\n for (let i = index + 1; i < haystack.length; index = i++) {\n if (haystack[i][COLUMN] !== needle) break;\n }\n return index;\n}\n\nexport function lowerBound(\n haystack: SourceMapSegment[] | ReverseSegment[],\n needle: number,\n index: number,\n): number {\n for (let i = index - 1; i >= 0; index = i--) {\n if (haystack[i][COLUMN] !== needle) break;\n }\n return index;\n}\n\nexport function memoizedState(): MemoState {\n return {\n lastKey: -1,\n lastNeedle: -1,\n lastIndex: -1,\n };\n}\n\n/**\n * This overly complicated beast is just to record the last tested line/column and the resulting\n * index, allowing us to skip a few tests if mappings are monotonically increasing.\n */\nexport function memoizedBinarySearch(\n haystack: SourceMapSegment[] | ReverseSegment[],\n needle: number,\n state: MemoState,\n key: number,\n): number {\n const { lastKey, lastNeedle, lastIndex } = state;\n\n let low = 0;\n let high = haystack.length - 1;\n if (key === lastKey) {\n if (needle === lastNeedle) {\n found = lastIndex !== -1 && haystack[lastIndex][COLUMN] === needle;\n return lastIndex;\n }\n\n if (needle >= lastNeedle) {\n // lastIndex may be -1 if the previous needle was not found.\n low = lastIndex === -1 ? 0 : lastIndex;\n } else {\n high = lastIndex;\n }\n }\n state.lastKey = key;\n state.lastNeedle = needle;\n\n return (state.lastIndex = binarySearch(haystack, needle, low, high));\n}\n","import { COLUMN, SOURCES_INDEX, SOURCE_LINE, SOURCE_COLUMN } from './sourcemap-segment';\nimport { memoizedBinarySearch, upperBound } from './binary-search';\n\nimport type { ReverseSegment, SourceMapSegment } from './sourcemap-segment';\nimport type { MemoState } from './binary-search';\n\nexport type Source = {\n __proto__: null;\n [line: number]: Exclude[];\n};\n\n// Rebuilds the original source files, with mappings that are ordered by source line/column instead\n// of generated line/column.\nexport default function buildBySources(\n decoded: readonly SourceMapSegment[][],\n memos: MemoState[],\n): Source[] {\n const sources: Source[] = memos.map(buildNullArray);\n\n for (let i = 0; i < decoded.length; i++) {\n const line = decoded[i];\n for (let j = 0; j < line.length; j++) {\n const seg = line[j];\n if (seg.length === 1) continue;\n\n const sourceIndex = seg[SOURCES_INDEX];\n const sourceLine = seg[SOURCE_LINE];\n const sourceColumn = seg[SOURCE_COLUMN];\n const originalSource = sources[sourceIndex];\n const originalLine = (originalSource[sourceLine] ||= []);\n const memo = memos[sourceIndex];\n\n // The binary search either found a match, or it found the left-index just before where the\n // segment should go. Either way, we want to insert after that. And there may be multiple\n // generated segments associated with an original location, so there may need to move several\n // indexes before we find where we need to insert.\n const index = upperBound(\n originalLine,\n sourceColumn,\n memoizedBinarySearch(originalLine, sourceColumn, memo, sourceLine),\n );\n\n insert(originalLine, (memo.lastIndex = index + 1), [sourceColumn, i, seg[COLUMN]]);\n }\n }\n\n return sources;\n}\n\nfunction insert(array: T[], index: number, value: T) {\n for (let i = array.length; i > index; i--) {\n array[i] = array[i - 1];\n }\n array[index] = value;\n}\n\n// Null arrays allow us to use ordered index keys without actually allocating contiguous memory like\n// a real array. We use a null-prototype object to avoid prototype pollution and deoptimizations.\n// Numeric properties on objects are magically sorted in ascending order by the engine regardless of\n// the insertion order. So, by setting any numeric keys, even out of order, we'll get ascending\n// order when iterating with for-in.\nfunction buildNullArray(): T {\n return { __proto__: null } as T;\n}\n","import { TraceMap, presortedDecodedMap, decodedMappings } from './trace-mapping';\nimport {\n COLUMN,\n SOURCES_INDEX,\n SOURCE_LINE,\n SOURCE_COLUMN,\n NAMES_INDEX,\n} from './sourcemap-segment';\n\nimport type {\n Section,\n SectionedSourceMap,\n DecodedSourceMap,\n SectionedSourceMapInput,\n Ro,\n} from './types';\nimport type { SourceMapSegment } from './sourcemap-segment';\n\ntype AnyMap = {\n new (map: SectionedSourceMapInput, mapUrl?: string | null): TraceMap;\n (map: SectionedSourceMapInput, mapUrl?: string | null): TraceMap;\n};\n\nexport const AnyMap: AnyMap = function (map, mapUrl) {\n const parsed =\n typeof map === 'string' ? (JSON.parse(map) as Exclude) : map;\n\n if (!('sections' in parsed)) return new TraceMap(parsed, mapUrl);\n\n const mappings: SourceMapSegment[][] = [];\n const sources: string[] = [];\n const sourcesContent: (string | null)[] = [];\n const names: string[] = [];\n\n recurse(parsed, mapUrl, mappings, sources, sourcesContent, names, 0, 0, Infinity, Infinity);\n\n const joined: DecodedSourceMap = {\n version: 3,\n file: parsed.file,\n names,\n sources,\n sourcesContent,\n mappings,\n };\n\n return presortedDecodedMap(joined);\n} as AnyMap;\n\nfunction recurse(\n input: Ro,\n mapUrl: string | null | undefined,\n mappings: SourceMapSegment[][],\n sources: string[],\n sourcesContent: (string | null)[],\n names: string[],\n lineOffset: number,\n columnOffset: number,\n stopLine: number,\n stopColumn: number,\n) {\n const { sections } = input;\n for (let i = 0; i < sections.length; i++) {\n const { map, offset } = sections[i];\n\n let sl = stopLine;\n let sc = stopColumn;\n if (i + 1 < sections.length) {\n const nextOffset = sections[i + 1].offset;\n sl = Math.min(stopLine, lineOffset + nextOffset.line);\n\n if (sl === stopLine) {\n sc = Math.min(stopColumn, columnOffset + nextOffset.column);\n } else if (sl < stopLine) {\n sc = columnOffset + nextOffset.column;\n }\n }\n\n addSection(\n map,\n mapUrl,\n mappings,\n sources,\n sourcesContent,\n names,\n lineOffset + offset.line,\n columnOffset + offset.column,\n sl,\n sc,\n );\n }\n}\n\nfunction addSection(\n input: Ro,\n mapUrl: string | null | undefined,\n mappings: SourceMapSegment[][],\n sources: string[],\n sourcesContent: (string | null)[],\n names: string[],\n lineOffset: number,\n columnOffset: number,\n stopLine: number,\n stopColumn: number,\n) {\n if ('sections' in input) return recurse(...(arguments as unknown as Parameters));\n\n const map = new TraceMap(input, mapUrl);\n const sourcesOffset = sources.length;\n const namesOffset = names.length;\n const decoded = decodedMappings(map);\n const { resolvedSources, sourcesContent: contents } = map;\n\n append(sources, resolvedSources);\n append(names, map.names);\n if (contents) append(sourcesContent, contents);\n else for (let i = 0; i < resolvedSources.length; i++) sourcesContent.push(null);\n\n for (let i = 0; i < decoded.length; i++) {\n const lineI = lineOffset + i;\n\n // We can only add so many lines before we step into the range that the next section's map\n // controls. When we get to the last line, then we'll start checking the segments to see if\n // they've crossed into the column range. But it may not have any columns that overstep, so we\n // still need to check that we don't overstep lines, too.\n if (lineI > stopLine) return;\n\n // The out line may already exist in mappings (if we're continuing the line started by a\n // previous section). Or, we may have jumped ahead several lines to start this section.\n const out = getLine(mappings, lineI);\n // On the 0th loop, the section's column offset shifts us forward. On all other lines (since the\n // map can be multiple lines), it doesn't.\n const cOffset = i === 0 ? columnOffset : 0;\n\n const line = decoded[i];\n for (let j = 0; j < line.length; j++) {\n const seg = line[j];\n const column = cOffset + seg[COLUMN];\n\n // If this segment steps into the column range that the next section's map controls, we need\n // to stop early.\n if (lineI === stopLine && column >= stopColumn) return;\n\n if (seg.length === 1) {\n out.push([column]);\n continue;\n }\n\n const sourcesIndex = sourcesOffset + seg[SOURCES_INDEX];\n const sourceLine = seg[SOURCE_LINE];\n const sourceColumn = seg[SOURCE_COLUMN];\n out.push(\n seg.length === 4\n ? [column, sourcesIndex, sourceLine, sourceColumn]\n : [column, sourcesIndex, sourceLine, sourceColumn, namesOffset + seg[NAMES_INDEX]],\n );\n }\n }\n}\n\nfunction append(arr: T[], other: T[]) {\n for (let i = 0; i < other.length; i++) arr.push(other[i]);\n}\n\nfunction getLine(arr: T[][], index: number): T[] {\n for (let i = arr.length; i <= index; i++) arr[i] = [];\n return arr[index];\n}\n","import { encode, decode } from '@jridgewell/sourcemap-codec';\n\nimport resolve from './resolve';\nimport stripFilename from './strip-filename';\nimport maybeSort from './sort';\nimport buildBySources from './by-source';\nimport {\n memoizedState,\n memoizedBinarySearch,\n upperBound,\n lowerBound,\n found as bsFound,\n} from './binary-search';\nimport {\n COLUMN,\n SOURCES_INDEX,\n SOURCE_LINE,\n SOURCE_COLUMN,\n NAMES_INDEX,\n REV_GENERATED_LINE,\n REV_GENERATED_COLUMN,\n} from './sourcemap-segment';\n\nimport type { SourceMapSegment, ReverseSegment } from './sourcemap-segment';\nimport type {\n SourceMapV3,\n DecodedSourceMap,\n EncodedSourceMap,\n InvalidOriginalMapping,\n OriginalMapping,\n InvalidGeneratedMapping,\n GeneratedMapping,\n SourceMapInput,\n Needle,\n SourceNeedle,\n SourceMap,\n EachMapping,\n Bias,\n} from './types';\nimport type { Source } from './by-source';\nimport type { MemoState } from './binary-search';\n\nexport type { SourceMapSegment } from './sourcemap-segment';\nexport type {\n SourceMapInput,\n SectionedSourceMapInput,\n DecodedSourceMap,\n EncodedSourceMap,\n SectionedSourceMap,\n InvalidOriginalMapping,\n OriginalMapping as Mapping,\n OriginalMapping,\n InvalidGeneratedMapping,\n GeneratedMapping,\n EachMapping,\n} from './types';\n\nconst LINE_GTR_ZERO = '`line` must be greater than 0 (lines start at line 1)';\nconst COL_GTR_EQ_ZERO = '`column` must be greater than or equal to 0 (columns start at column 0)';\n\nexport const LEAST_UPPER_BOUND = -1;\nexport const GREATEST_LOWER_BOUND = 1;\n\n/**\n * Returns the encoded (VLQ string) form of the SourceMap's mappings field.\n */\nexport let encodedMappings: (map: TraceMap) => EncodedSourceMap['mappings'];\n\n/**\n * Returns the decoded (array of lines of segments) form of the SourceMap's mappings field.\n */\nexport let decodedMappings: (map: TraceMap) => Readonly;\n\n/**\n * A low-level API to find the segment associated with a generated line/column (think, from a\n * stack trace). Line and column here are 0-based, unlike `originalPositionFor`.\n */\nexport let traceSegment: (\n map: TraceMap,\n line: number,\n column: number,\n) => Readonly | null;\n\n/**\n * A higher-level API to find the source/line/column associated with a generated line/column\n * (think, from a stack trace). Line is 1-based, but column is 0-based, due to legacy behavior in\n * `source-map` library.\n */\nexport let originalPositionFor: (\n map: TraceMap,\n needle: Needle,\n) => OriginalMapping | InvalidOriginalMapping;\n\n/**\n * Finds the generated line/column position of the provided source/line/column source position.\n */\nexport let generatedPositionFor: (\n map: TraceMap,\n needle: SourceNeedle,\n) => GeneratedMapping | InvalidGeneratedMapping;\n\n/**\n * Finds all generated line/column positions of the provided source/line/column source position.\n */\nexport let allGeneratedPositionsFor: (map: TraceMap, needle: SourceNeedle) => GeneratedMapping[];\n\n/**\n * Iterates each mapping in generated position order.\n */\nexport let eachMapping: (map: TraceMap, cb: (mapping: EachMapping) => void) => void;\n\n/**\n * Retrieves the source content for a particular source, if its found. Returns null if not.\n */\nexport let sourceContentFor: (map: TraceMap, source: string) => string | null;\n\n/**\n * A helper that skips sorting of the input map's mappings array, which can be expensive for larger\n * maps.\n */\nexport let presortedDecodedMap: (map: DecodedSourceMap, mapUrl?: string) => TraceMap;\n\n/**\n * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects\n * a sourcemap, or to JSON.stringify.\n */\nexport let decodedMap: (\n map: TraceMap,\n) => Omit & { mappings: readonly SourceMapSegment[][] };\n\n/**\n * Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects\n * a sourcemap, or to JSON.stringify.\n */\nexport let encodedMap: (map: TraceMap) => EncodedSourceMap;\n\nexport { AnyMap } from './any-map';\n\nexport class TraceMap implements SourceMap {\n declare version: SourceMapV3['version'];\n declare file: SourceMapV3['file'];\n declare names: SourceMapV3['names'];\n declare sourceRoot: SourceMapV3['sourceRoot'];\n declare sources: SourceMapV3['sources'];\n declare sourcesContent: SourceMapV3['sourcesContent'];\n\n declare resolvedSources: string[];\n private declare _encoded: string | undefined;\n\n private declare _decoded: SourceMapSegment[][] | undefined;\n private declare _decodedMemo: MemoState;\n\n private declare _bySources: Source[] | undefined;\n private declare _bySourceMemos: MemoState[] | undefined;\n\n constructor(map: SourceMapInput, mapUrl?: string | null) {\n const isString = typeof map === 'string';\n\n if (!isString && (map as unknown as { _decodedMemo: any })._decodedMemo) return map as TraceMap;\n\n const parsed = (isString ? JSON.parse(map) : map) as DecodedSourceMap | EncodedSourceMap;\n\n const { version, file, names, sourceRoot, sources, sourcesContent } = parsed;\n this.version = version;\n this.file = file;\n this.names = names;\n this.sourceRoot = sourceRoot;\n this.sources = sources;\n this.sourcesContent = sourcesContent;\n\n const from = resolve(sourceRoot || '', stripFilename(mapUrl));\n this.resolvedSources = sources.map((s) => resolve(s || '', from));\n\n const { mappings } = parsed;\n if (typeof mappings === 'string') {\n this._encoded = mappings;\n this._decoded = undefined;\n } else {\n this._encoded = undefined;\n this._decoded = maybeSort(mappings, isString);\n }\n\n this._decodedMemo = memoizedState();\n this._bySources = undefined;\n this._bySourceMemos = undefined;\n }\n\n static {\n encodedMappings = (map) => {\n return (map._encoded ??= encode(map._decoded!));\n };\n\n decodedMappings = (map) => {\n return (map._decoded ||= decode(map._encoded!));\n };\n\n traceSegment = (map, line, column) => {\n const decoded = decodedMappings(map);\n\n // It's common for parent source maps to have pointers to lines that have no\n // mapping (like a \"//# sourceMappingURL=\") at the end of the child file.\n if (line >= decoded.length) return null;\n\n const segments = decoded[line];\n const index = traceSegmentInternal(\n segments,\n map._decodedMemo,\n line,\n column,\n GREATEST_LOWER_BOUND,\n );\n\n return index === -1 ? null : segments[index];\n };\n\n originalPositionFor = (map, { line, column, bias }) => {\n line--;\n if (line < 0) throw new Error(LINE_GTR_ZERO);\n if (column < 0) throw new Error(COL_GTR_EQ_ZERO);\n\n const decoded = decodedMappings(map);\n\n // It's common for parent source maps to have pointers to lines that have no\n // mapping (like a \"//# sourceMappingURL=\") at the end of the child file.\n if (line >= decoded.length) return OMapping(null, null, null, null);\n\n const segments = decoded[line];\n const index = traceSegmentInternal(\n segments,\n map._decodedMemo,\n line,\n column,\n bias || GREATEST_LOWER_BOUND,\n );\n\n if (index === -1) return OMapping(null, null, null, null);\n\n const segment = segments[index];\n if (segment.length === 1) return OMapping(null, null, null, null);\n\n const { names, resolvedSources } = map;\n return OMapping(\n resolvedSources[segment[SOURCES_INDEX]],\n segment[SOURCE_LINE] + 1,\n segment[SOURCE_COLUMN],\n segment.length === 5 ? names[segment[NAMES_INDEX]] : null,\n );\n };\n\n allGeneratedPositionsFor = (map, { source, line, column, bias }) => {\n // SourceMapConsumer uses LEAST_UPPER_BOUND for some reason, so we follow suit.\n return generatedPosition(map, source, line, column, bias || LEAST_UPPER_BOUND, true);\n };\n\n generatedPositionFor = (map, { source, line, column, bias }) => {\n return generatedPosition(map, source, line, column, bias || GREATEST_LOWER_BOUND, false);\n };\n\n eachMapping = (map, cb) => {\n const decoded = decodedMappings(map);\n const { names, resolvedSources } = map;\n\n for (let i = 0; i < decoded.length; i++) {\n const line = decoded[i];\n for (let j = 0; j < line.length; j++) {\n const seg = line[j];\n\n const generatedLine = i + 1;\n const generatedColumn = seg[0];\n let source = null;\n let originalLine = null;\n let originalColumn = null;\n let name = null;\n if (seg.length !== 1) {\n source = resolvedSources[seg[1]];\n originalLine = seg[2] + 1;\n originalColumn = seg[3];\n }\n if (seg.length === 5) name = names[seg[4]];\n\n cb({\n generatedLine,\n generatedColumn,\n source,\n originalLine,\n originalColumn,\n name,\n } as EachMapping);\n }\n }\n };\n\n sourceContentFor = (map, source) => {\n const { sources, resolvedSources, sourcesContent } = map;\n if (sourcesContent == null) return null;\n\n let index = sources.indexOf(source);\n if (index === -1) index = resolvedSources.indexOf(source);\n\n return index === -1 ? null : sourcesContent[index];\n };\n\n presortedDecodedMap = (map, mapUrl) => {\n const tracer = new TraceMap(clone(map, []), mapUrl);\n tracer._decoded = map.mappings;\n return tracer;\n };\n\n decodedMap = (map) => {\n return clone(map, decodedMappings(map));\n };\n\n encodedMap = (map) => {\n return clone(map, encodedMappings(map));\n };\n\n function generatedPosition(\n map: TraceMap,\n source: string,\n line: number,\n column: number,\n bias: Bias,\n all: false,\n ): GeneratedMapping | InvalidGeneratedMapping;\n function generatedPosition(\n map: TraceMap,\n source: string,\n line: number,\n column: number,\n bias: Bias,\n all: true,\n ): GeneratedMapping[];\n function generatedPosition(\n map: TraceMap,\n source: string,\n line: number,\n column: number,\n bias: Bias,\n all: boolean,\n ): GeneratedMapping | InvalidGeneratedMapping | GeneratedMapping[] {\n line--;\n if (line < 0) throw new Error(LINE_GTR_ZERO);\n if (column < 0) throw new Error(COL_GTR_EQ_ZERO);\n\n const { sources, resolvedSources } = map;\n let sourceIndex = sources.indexOf(source);\n if (sourceIndex === -1) sourceIndex = resolvedSources.indexOf(source);\n if (sourceIndex === -1) return all ? [] : GMapping(null, null);\n\n const generated = (map._bySources ||= buildBySources(\n decodedMappings(map),\n (map._bySourceMemos = sources.map(memoizedState)),\n ));\n\n const segments = generated[sourceIndex][line];\n if (segments == null) return all ? [] : GMapping(null, null);\n\n const memo = map._bySourceMemos![sourceIndex];\n\n if (all) return sliceGeneratedPositions(segments, memo, line, column, bias);\n\n const index = traceSegmentInternal(segments, memo, line, column, bias);\n if (index === -1) return GMapping(null, null);\n\n const segment = segments[index];\n return GMapping(segment[REV_GENERATED_LINE] + 1, segment[REV_GENERATED_COLUMN]);\n }\n }\n}\n\nfunction clone(\n map: TraceMap | DecodedSourceMap | EncodedSourceMap,\n mappings: T,\n): T extends string ? EncodedSourceMap : DecodedSourceMap {\n return {\n version: map.version,\n file: map.file,\n names: map.names,\n sourceRoot: map.sourceRoot,\n sources: map.sources,\n sourcesContent: map.sourcesContent,\n mappings,\n } as any;\n}\n\nfunction OMapping(source: null, line: null, column: null, name: null): InvalidOriginalMapping;\nfunction OMapping(\n source: string,\n line: number,\n column: number,\n name: string | null,\n): OriginalMapping;\nfunction OMapping(\n source: string | null,\n line: number | null,\n column: number | null,\n name: string | null,\n): OriginalMapping | InvalidOriginalMapping {\n return { source, line, column, name } as any;\n}\n\nfunction GMapping(line: null, column: null): InvalidGeneratedMapping;\nfunction GMapping(line: number, column: number): GeneratedMapping;\nfunction GMapping(\n line: number | null,\n column: number | null,\n): GeneratedMapping | InvalidGeneratedMapping {\n return { line, column } as any;\n}\n\nfunction traceSegmentInternal(\n segments: SourceMapSegment[],\n memo: MemoState,\n line: number,\n column: number,\n bias: Bias,\n): number;\nfunction traceSegmentInternal(\n segments: ReverseSegment[],\n memo: MemoState,\n line: number,\n column: number,\n bias: Bias,\n): number;\nfunction traceSegmentInternal(\n segments: SourceMapSegment[] | ReverseSegment[],\n memo: MemoState,\n line: number,\n column: number,\n bias: Bias,\n): number {\n let index = memoizedBinarySearch(segments, column, memo, line);\n if (bsFound) {\n index = (bias === LEAST_UPPER_BOUND ? upperBound : lowerBound)(segments, column, index);\n } else if (bias === LEAST_UPPER_BOUND) index++;\n\n if (index === -1 || index === segments.length) return -1;\n return index;\n}\n\nfunction sliceGeneratedPositions(\n segments: ReverseSegment[],\n memo: MemoState,\n line: number,\n column: number,\n bias: Bias,\n): GeneratedMapping[] {\n let min = traceSegmentInternal(segments, memo, line, column, GREATEST_LOWER_BOUND);\n\n // We ignored the bias when tracing the segment so that we're guarnateed to find the first (in\n // insertion order) segment that matched. Even if we did respect the bias when tracing, we would\n // still need to call `lowerBound()` to find the first segment, which is slower than just looking\n // for the GREATEST_LOWER_BOUND to begin with. The only difference that matters for us is when the\n // binary search didn't match, in which case GREATEST_LOWER_BOUND just needs to increment to\n // match LEAST_UPPER_BOUND.\n if (!bsFound && bias === LEAST_UPPER_BOUND) min++;\n\n if (min === -1 || min === segments.length) return [];\n\n // We may have found the segment that started at an earlier column. If this is the case, then we\n // need to slice all generated segments that match _that_ column, because all such segments span\n // to our desired column.\n const matchedColumn = bsFound ? column : segments[min][COLUMN];\n\n // The binary search is not guaranteed to find the lower bound when a match wasn't found.\n if (!bsFound) min = lowerBound(segments, matchedColumn, min);\n const max = upperBound(segments, matchedColumn, min);\n\n const result = [];\n for (; min <= max; min++) {\n const segment = segments[min];\n result.push(GMapping(segment[REV_GENERATED_LINE] + 1, segment[REV_GENERATED_COLUMN]));\n }\n return result;\n}\n"],"names":["resolveUri","presortedDecodedMap","decodedMappings","encodedMappings","traceSegment","originalPositionFor","generatedPositionFor","allGeneratedPositionsFor","eachMapping","sourceContentFor","decodedMap","encodedMap","encode","decode","bsFound"],"mappings":";;;;;;;;;;IAEc,SAAU,OAAO,CAAC,KAAa,EAAE,IAAwB,EAAA;;;;QAIrE,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC;YAAE,IAAI,IAAI,GAAG,CAAC;IAE7C,IAAA,OAAOA,8BAAU,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IACjC;;ICTA;;IAEG;IACqB,SAAA,aAAa,CAAC,IAA+B,EAAA;IACnE,IAAA,IAAI,CAAC,IAAI;IAAE,QAAA,OAAO,EAAE,CAAC;QACrB,MAAM,KAAK,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;QACpC,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,GAAG,CAA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D,IAAI,GAAG,KAAK,CAAC,CAAC,IAAI,GAAG,KAAK,QAAQ,CAAC,MAAM;IAAE,QAAA,OAAO,EAAE,CAAC;;;;IAKrD,IAAA,MAAM,aAAa,GAAGA,KAAO,GAAG,MAAM,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC;;IAG/D,IAAA,IAAI,CAACA,KAAO;YAAE,GAAG,GAAG,UAAU,CAAC,QAAQ,EAAE,aAAa,EAAE,GAAG,CAAC,CAAC;QAC7D,MAAM,GAAG,GAAG,UAAU,CAAC,QAAQ,EAAE,aAAa,EAAE,GAAG,CAAC,CAAC;QAErD,MAAM,MAAM,GAAG,EAAE,CAAC;IAClB,IAAA,OAAO,GAAG,IAAI,GAAG,EAAE,GAAG,EAAE,EAAE;IACxB,QAAA,MAAM,OAAO,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC;IAC9B,QAAA,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,kBAAkB,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC;IACvF,KAAA;IACD,IAAA,OAAO,MAAM,CAAC;IAChB;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/@jridgewell/trace-mapping/dist/types/any-map.d.ts b/node_modules/@jridgewell/trace-mapping/dist/types/any-map.d.ts new file mode 100644 index 0000000..08bca6b --- /dev/null +++ b/node_modules/@jridgewell/trace-mapping/dist/types/any-map.d.ts @@ -0,0 +1,8 @@ +import { TraceMap } from './trace-mapping'; +import type { SectionedSourceMapInput } from './types'; +declare type AnyMap = { + new (map: SectionedSourceMapInput, mapUrl?: string | null): TraceMap; + (map: SectionedSourceMapInput, mapUrl?: string | null): TraceMap; +}; +export declare const AnyMap: AnyMap; +export {}; diff --git a/node_modules/@jridgewell/trace-mapping/dist/types/binary-search.d.ts b/node_modules/@jridgewell/trace-mapping/dist/types/binary-search.d.ts new file mode 100644 index 0000000..88820e5 --- /dev/null +++ b/node_modules/@jridgewell/trace-mapping/dist/types/binary-search.d.ts @@ -0,0 +1,32 @@ +import type { SourceMapSegment, ReverseSegment } from './sourcemap-segment'; +export declare type MemoState = { + lastKey: number; + lastNeedle: number; + lastIndex: number; +}; +export declare let found: boolean; +/** + * A binary search implementation that returns the index if a match is found. + * If no match is found, then the left-index (the index associated with the item that comes just + * before the desired index) is returned. To maintain proper sort order, a splice would happen at + * the next index: + * + * ```js + * const array = [1, 3]; + * const needle = 2; + * const index = binarySearch(array, needle, (item, needle) => item - needle); + * + * assert.equal(index, 0); + * array.splice(index + 1, 0, needle); + * assert.deepEqual(array, [1, 2, 3]); + * ``` + */ +export declare function binarySearch(haystack: SourceMapSegment[] | ReverseSegment[], needle: number, low: number, high: number): number; +export declare function upperBound(haystack: SourceMapSegment[] | ReverseSegment[], needle: number, index: number): number; +export declare function lowerBound(haystack: SourceMapSegment[] | ReverseSegment[], needle: number, index: number): number; +export declare function memoizedState(): MemoState; +/** + * This overly complicated beast is just to record the last tested line/column and the resulting + * index, allowing us to skip a few tests if mappings are monotonically increasing. + */ +export declare function memoizedBinarySearch(haystack: SourceMapSegment[] | ReverseSegment[], needle: number, state: MemoState, key: number): number; diff --git a/node_modules/@jridgewell/trace-mapping/dist/types/by-source.d.ts b/node_modules/@jridgewell/trace-mapping/dist/types/by-source.d.ts new file mode 100644 index 0000000..8d1e538 --- /dev/null +++ b/node_modules/@jridgewell/trace-mapping/dist/types/by-source.d.ts @@ -0,0 +1,7 @@ +import type { ReverseSegment, SourceMapSegment } from './sourcemap-segment'; +import type { MemoState } from './binary-search'; +export declare type Source = { + __proto__: null; + [line: number]: Exclude[]; +}; +export default function buildBySources(decoded: readonly SourceMapSegment[][], memos: MemoState[]): Source[]; diff --git a/node_modules/@jridgewell/trace-mapping/dist/types/resolve.d.ts b/node_modules/@jridgewell/trace-mapping/dist/types/resolve.d.ts new file mode 100644 index 0000000..cf7d4f8 --- /dev/null +++ b/node_modules/@jridgewell/trace-mapping/dist/types/resolve.d.ts @@ -0,0 +1 @@ +export default function resolve(input: string, base: string | undefined): string; diff --git a/node_modules/@jridgewell/trace-mapping/dist/types/sort.d.ts b/node_modules/@jridgewell/trace-mapping/dist/types/sort.d.ts new file mode 100644 index 0000000..2bfb5dc --- /dev/null +++ b/node_modules/@jridgewell/trace-mapping/dist/types/sort.d.ts @@ -0,0 +1,2 @@ +import type { SourceMapSegment } from './sourcemap-segment'; +export default function maybeSort(mappings: SourceMapSegment[][], owned: boolean): SourceMapSegment[][]; diff --git a/node_modules/@jridgewell/trace-mapping/dist/types/sourcemap-segment.d.ts b/node_modules/@jridgewell/trace-mapping/dist/types/sourcemap-segment.d.ts new file mode 100644 index 0000000..6d70924 --- /dev/null +++ b/node_modules/@jridgewell/trace-mapping/dist/types/sourcemap-segment.d.ts @@ -0,0 +1,16 @@ +declare type GeneratedColumn = number; +declare type SourcesIndex = number; +declare type SourceLine = number; +declare type SourceColumn = number; +declare type NamesIndex = number; +declare type GeneratedLine = number; +export declare type SourceMapSegment = [GeneratedColumn] | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn] | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn, NamesIndex]; +export declare type ReverseSegment = [SourceColumn, GeneratedLine, GeneratedColumn]; +export declare const COLUMN = 0; +export declare const SOURCES_INDEX = 1; +export declare const SOURCE_LINE = 2; +export declare const SOURCE_COLUMN = 3; +export declare const NAMES_INDEX = 4; +export declare const REV_GENERATED_LINE = 1; +export declare const REV_GENERATED_COLUMN = 2; +export {}; diff --git a/node_modules/@jridgewell/trace-mapping/dist/types/strip-filename.d.ts b/node_modules/@jridgewell/trace-mapping/dist/types/strip-filename.d.ts new file mode 100644 index 0000000..bead5c1 --- /dev/null +++ b/node_modules/@jridgewell/trace-mapping/dist/types/strip-filename.d.ts @@ -0,0 +1,4 @@ +/** + * Removes everything after the last "/", but leaves the slash. + */ +export default function stripFilename(path: string | undefined | null): string; diff --git a/node_modules/@jridgewell/trace-mapping/dist/types/trace-mapping.d.ts b/node_modules/@jridgewell/trace-mapping/dist/types/trace-mapping.d.ts new file mode 100644 index 0000000..c125ead --- /dev/null +++ b/node_modules/@jridgewell/trace-mapping/dist/types/trace-mapping.d.ts @@ -0,0 +1,74 @@ +import type { SourceMapSegment } from './sourcemap-segment'; +import type { SourceMapV3, DecodedSourceMap, EncodedSourceMap, InvalidOriginalMapping, OriginalMapping, InvalidGeneratedMapping, GeneratedMapping, SourceMapInput, Needle, SourceNeedle, SourceMap, EachMapping } from './types'; +export type { SourceMapSegment } from './sourcemap-segment'; +export type { SourceMapInput, SectionedSourceMapInput, DecodedSourceMap, EncodedSourceMap, SectionedSourceMap, InvalidOriginalMapping, OriginalMapping as Mapping, OriginalMapping, InvalidGeneratedMapping, GeneratedMapping, EachMapping, } from './types'; +export declare const LEAST_UPPER_BOUND = -1; +export declare const GREATEST_LOWER_BOUND = 1; +/** + * Returns the encoded (VLQ string) form of the SourceMap's mappings field. + */ +export declare let encodedMappings: (map: TraceMap) => EncodedSourceMap['mappings']; +/** + * Returns the decoded (array of lines of segments) form of the SourceMap's mappings field. + */ +export declare let decodedMappings: (map: TraceMap) => Readonly; +/** + * A low-level API to find the segment associated with a generated line/column (think, from a + * stack trace). Line and column here are 0-based, unlike `originalPositionFor`. + */ +export declare let traceSegment: (map: TraceMap, line: number, column: number) => Readonly | null; +/** + * A higher-level API to find the source/line/column associated with a generated line/column + * (think, from a stack trace). Line is 1-based, but column is 0-based, due to legacy behavior in + * `source-map` library. + */ +export declare let originalPositionFor: (map: TraceMap, needle: Needle) => OriginalMapping | InvalidOriginalMapping; +/** + * Finds the generated line/column position of the provided source/line/column source position. + */ +export declare let generatedPositionFor: (map: TraceMap, needle: SourceNeedle) => GeneratedMapping | InvalidGeneratedMapping; +/** + * Finds all generated line/column positions of the provided source/line/column source position. + */ +export declare let allGeneratedPositionsFor: (map: TraceMap, needle: SourceNeedle) => GeneratedMapping[]; +/** + * Iterates each mapping in generated position order. + */ +export declare let eachMapping: (map: TraceMap, cb: (mapping: EachMapping) => void) => void; +/** + * Retrieves the source content for a particular source, if its found. Returns null if not. + */ +export declare let sourceContentFor: (map: TraceMap, source: string) => string | null; +/** + * A helper that skips sorting of the input map's mappings array, which can be expensive for larger + * maps. + */ +export declare let presortedDecodedMap: (map: DecodedSourceMap, mapUrl?: string) => TraceMap; +/** + * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects + * a sourcemap, or to JSON.stringify. + */ +export declare let decodedMap: (map: TraceMap) => Omit & { + mappings: readonly SourceMapSegment[][]; +}; +/** + * Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects + * a sourcemap, or to JSON.stringify. + */ +export declare let encodedMap: (map: TraceMap) => EncodedSourceMap; +export { AnyMap } from './any-map'; +export declare class TraceMap implements SourceMap { + version: SourceMapV3['version']; + file: SourceMapV3['file']; + names: SourceMapV3['names']; + sourceRoot: SourceMapV3['sourceRoot']; + sources: SourceMapV3['sources']; + sourcesContent: SourceMapV3['sourcesContent']; + resolvedSources: string[]; + private _encoded; + private _decoded; + private _decodedMemo; + private _bySources; + private _bySourceMemos; + constructor(map: SourceMapInput, mapUrl?: string | null); +} diff --git a/node_modules/@jridgewell/trace-mapping/dist/types/types.d.ts b/node_modules/@jridgewell/trace-mapping/dist/types/types.d.ts new file mode 100644 index 0000000..2f4fd45 --- /dev/null +++ b/node_modules/@jridgewell/trace-mapping/dist/types/types.d.ts @@ -0,0 +1,92 @@ +import type { SourceMapSegment } from './sourcemap-segment'; +import type { GREATEST_LOWER_BOUND, LEAST_UPPER_BOUND, TraceMap } from './trace-mapping'; +export interface SourceMapV3 { + file?: string | null; + names: string[]; + sourceRoot?: string; + sources: (string | null)[]; + sourcesContent?: (string | null)[]; + version: 3; +} +export interface EncodedSourceMap extends SourceMapV3 { + mappings: string; +} +export interface DecodedSourceMap extends SourceMapV3 { + mappings: SourceMapSegment[][]; +} +export interface Section { + offset: { + line: number; + column: number; + }; + map: EncodedSourceMap | DecodedSourceMap | SectionedSourceMap; +} +export interface SectionedSourceMap { + file?: string | null; + sections: Section[]; + version: 3; +} +export declare type OriginalMapping = { + source: string | null; + line: number; + column: number; + name: string | null; +}; +export declare type InvalidOriginalMapping = { + source: null; + line: null; + column: null; + name: null; +}; +export declare type GeneratedMapping = { + line: number; + column: number; +}; +export declare type InvalidGeneratedMapping = { + line: null; + column: null; +}; +export declare type Bias = typeof GREATEST_LOWER_BOUND | typeof LEAST_UPPER_BOUND; +export declare type SourceMapInput = string | Ro | Ro | TraceMap; +export declare type SectionedSourceMapInput = SourceMapInput | Ro; +export declare type Needle = { + line: number; + column: number; + bias?: Bias; +}; +export declare type SourceNeedle = { + source: string; + line: number; + column: number; + bias?: Bias; +}; +export declare type EachMapping = { + generatedLine: number; + generatedColumn: number; + source: null; + originalLine: null; + originalColumn: null; + name: null; +} | { + generatedLine: number; + generatedColumn: number; + source: string | null; + originalLine: number; + originalColumn: number; + name: string | null; +}; +export declare abstract class SourceMap { + version: SourceMapV3['version']; + file: SourceMapV3['file']; + names: SourceMapV3['names']; + sourceRoot: SourceMapV3['sourceRoot']; + sources: SourceMapV3['sources']; + sourcesContent: SourceMapV3['sourcesContent']; + resolvedSources: SourceMapV3['sources']; +} +export declare type Ro = T extends Array ? V[] | Readonly | RoArray | Readonly> : T extends object ? T | Readonly | RoObject | Readonly> : T; +declare type RoArray = Ro[]; +declare type RoObject = { + [K in keyof T]: T[K] | Ro; +}; +export {}; diff --git a/node_modules/@jridgewell/trace-mapping/package.json b/node_modules/@jridgewell/trace-mapping/package.json new file mode 100644 index 0000000..7280d75 --- /dev/null +++ b/node_modules/@jridgewell/trace-mapping/package.json @@ -0,0 +1,75 @@ +{ + "name": "@jridgewell/trace-mapping", + "version": "0.3.19", + "description": "Trace the original position through a source map", + "keywords": [ + "source", + "map" + ], + "main": "dist/trace-mapping.umd.js", + "module": "dist/trace-mapping.mjs", + "types": "dist/types/trace-mapping.d.ts", + "files": [ + "dist" + ], + "exports": { + ".": [ + { + "types": "./dist/types/trace-mapping.d.ts", + "browser": "./dist/trace-mapping.umd.js", + "require": "./dist/trace-mapping.umd.js", + "import": "./dist/trace-mapping.mjs" + }, + "./dist/trace-mapping.umd.js" + ], + "./package.json": "./package.json" + }, + "author": "Justin Ridgewell ", + "repository": { + "type": "git", + "url": "git+https://github.com/jridgewell/trace-mapping.git" + }, + "license": "MIT", + "scripts": { + "benchmark": "run-s build:rollup benchmark:*", + "benchmark:install": "cd benchmark && npm install", + "benchmark:only": "node --expose-gc benchmark/index.mjs", + "build": "run-s -n build:*", + "build:rollup": "rollup -c rollup.config.js", + "build:ts": "tsc --project tsconfig.build.json", + "lint": "run-s -n lint:*", + "lint:prettier": "npm run test:lint:prettier -- --write", + "lint:ts": "npm run test:lint:ts -- --fix", + "prebuild": "rm -rf dist", + "prepublishOnly": "npm run preversion", + "preversion": "run-s test build", + "test": "run-s -n test:lint test:only", + "test:debug": "ava debug", + "test:lint": "run-s -n test:lint:*", + "test:lint:prettier": "prettier --check '{src,test}/**/*.ts' '**/*.md'", + "test:lint:ts": "eslint '{src,test}/**/*.ts'", + "test:only": "c8 ava", + "test:watch": "ava --watch" + }, + "devDependencies": { + "@rollup/plugin-typescript": "8.5.0", + "@typescript-eslint/eslint-plugin": "5.39.0", + "@typescript-eslint/parser": "5.39.0", + "ava": "4.3.3", + "benchmark": "2.1.4", + "c8": "7.12.0", + "esbuild": "0.15.10", + "eslint": "8.25.0", + "eslint-config-prettier": "8.5.0", + "eslint-plugin-no-only-tests": "3.0.0", + "npm-run-all": "4.1.5", + "prettier": "2.7.1", + "rollup": "2.79.1", + "tsx": "3.10.1", + "typescript": "4.8.4" + }, + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } +} diff --git a/node_modules/@types/eslint-scope/LICENSE b/node_modules/@types/eslint-scope/LICENSE new file mode 100644 index 0000000..9e841e7 --- /dev/null +++ b/node_modules/@types/eslint-scope/LICENSE @@ -0,0 +1,21 @@ + MIT License + + Copyright (c) Microsoft Corporation. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE diff --git a/node_modules/@types/eslint-scope/README.md b/node_modules/@types/eslint-scope/README.md new file mode 100644 index 0000000..f1c5149 --- /dev/null +++ b/node_modules/@types/eslint-scope/README.md @@ -0,0 +1,85 @@ +# Installation +> `npm install --save @types/eslint-scope` + +# Summary +This package contains type definitions for eslint-scope (https://github.com/eslint/eslint-scope). + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/eslint-scope. +## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/eslint-scope/index.d.ts) +````ts +// Type definitions for eslint-scope 3.7 +// Project: https://github.com/eslint/eslint-scope +// Definitions by: Toru Nagashima +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 3.8 +import * as eslint from "eslint"; +import * as estree from "estree"; + +export const version: string; + +export class ScopeManager implements eslint.Scope.ScopeManager { + scopes: Scope[]; + globalScope: Scope; + acquire(node: {}, inner?: boolean): Scope | null; + getDeclaredVariables(node: {}): Variable[]; +} + +export class Scope implements eslint.Scope.Scope { + type: "block" | "catch" | "class" | "for" | "function" | "function-expression-name" | "global" | "module" | "switch" | "with" | "TDZ"; + isStrict: boolean; + upper: Scope | null; + childScopes: Scope[]; + variableScope: Scope; + block: estree.Node; + variables: Variable[]; + set: Map; + references: Reference[]; + through: Reference[]; + functionExpressionScope: boolean; +} + +export class Variable implements eslint.Scope.Variable { + name: string; + scope: Scope; + identifiers: estree.Identifier[]; + references: Reference[]; + defs: eslint.Scope.Definition[]; +} + +export class Reference implements eslint.Scope.Reference { + identifier: estree.Identifier; + from: Scope; + resolved: Variable | null; + writeExpr: estree.Node | null; + init: boolean; + + isWrite(): boolean; + isRead(): boolean; + isWriteOnly(): boolean; + isReadOnly(): boolean; + isReadWrite(): boolean; +} + +export interface AnalysisOptions { + optimistic?: boolean; + directive?: boolean; + ignoreEval?: boolean; + nodejsScope?: boolean; + impliedStrict?: boolean; + fallback?: string | ((node: {}) => string[]); + sourceType?: "script" | "module"; + ecmaVersion?: number; +} + +export function analyze(ast: {}, options?: AnalysisOptions): ScopeManager; + +```` + +### Additional Details + * Last updated: Thu, 30 Jun 2022 19:02:28 GMT + * Dependencies: [@types/eslint](https://npmjs.com/package/@types/eslint), [@types/estree](https://npmjs.com/package/@types/estree) + * Global values: none + +# Credits +These definitions were written by [Toru Nagashima](https://github.com/mysticatea). diff --git a/node_modules/@types/eslint-scope/index.d.ts b/node_modules/@types/eslint-scope/index.d.ts new file mode 100644 index 0000000..3dc1db6 --- /dev/null +++ b/node_modules/@types/eslint-scope/index.d.ts @@ -0,0 +1,65 @@ +// Type definitions for eslint-scope 3.7 +// Project: https://github.com/eslint/eslint-scope +// Definitions by: Toru Nagashima +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 3.8 +import * as eslint from "eslint"; +import * as estree from "estree"; + +export const version: string; + +export class ScopeManager implements eslint.Scope.ScopeManager { + scopes: Scope[]; + globalScope: Scope; + acquire(node: {}, inner?: boolean): Scope | null; + getDeclaredVariables(node: {}): Variable[]; +} + +export class Scope implements eslint.Scope.Scope { + type: "block" | "catch" | "class" | "for" | "function" | "function-expression-name" | "global" | "module" | "switch" | "with" | "TDZ"; + isStrict: boolean; + upper: Scope | null; + childScopes: Scope[]; + variableScope: Scope; + block: estree.Node; + variables: Variable[]; + set: Map; + references: Reference[]; + through: Reference[]; + functionExpressionScope: boolean; +} + +export class Variable implements eslint.Scope.Variable { + name: string; + scope: Scope; + identifiers: estree.Identifier[]; + references: Reference[]; + defs: eslint.Scope.Definition[]; +} + +export class Reference implements eslint.Scope.Reference { + identifier: estree.Identifier; + from: Scope; + resolved: Variable | null; + writeExpr: estree.Node | null; + init: boolean; + + isWrite(): boolean; + isRead(): boolean; + isWriteOnly(): boolean; + isReadOnly(): boolean; + isReadWrite(): boolean; +} + +export interface AnalysisOptions { + optimistic?: boolean; + directive?: boolean; + ignoreEval?: boolean; + nodejsScope?: boolean; + impliedStrict?: boolean; + fallback?: string | ((node: {}) => string[]); + sourceType?: "script" | "module"; + ecmaVersion?: number; +} + +export function analyze(ast: {}, options?: AnalysisOptions): ScopeManager; diff --git a/node_modules/@types/eslint-scope/package.json b/node_modules/@types/eslint-scope/package.json new file mode 100644 index 0000000..a7df829 --- /dev/null +++ b/node_modules/@types/eslint-scope/package.json @@ -0,0 +1,28 @@ +{ + "name": "@types/eslint-scope", + "version": "3.7.4", + "description": "TypeScript definitions for eslint-scope", + "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/eslint-scope", + "license": "MIT", + "contributors": [ + { + "name": "Toru Nagashima", + "url": "https://github.com/mysticatea", + "githubUsername": "mysticatea" + } + ], + "main": "", + "types": "index.d.ts", + "repository": { + "type": "git", + "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", + "directory": "types/eslint-scope" + }, + "scripts": {}, + "dependencies": { + "@types/eslint": "*", + "@types/estree": "*" + }, + "typesPublisherContentHash": "81c8e26e146b6b132a88bc06480ec59c5006561f35388cbc65756710cd486f05", + "typeScriptVersion": "4.0" +} \ No newline at end of file diff --git a/node_modules/@types/eslint/LICENSE b/node_modules/@types/eslint/LICENSE new file mode 100644 index 0000000..9e841e7 --- /dev/null +++ b/node_modules/@types/eslint/LICENSE @@ -0,0 +1,21 @@ + MIT License + + Copyright (c) Microsoft Corporation. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE diff --git a/node_modules/@types/eslint/README.md b/node_modules/@types/eslint/README.md new file mode 100644 index 0000000..6fd110f --- /dev/null +++ b/node_modules/@types/eslint/README.md @@ -0,0 +1,16 @@ +# Installation +> `npm install --save @types/eslint` + +# Summary +This package contains type definitions for eslint (https://eslint.org). + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/eslint. + +### Additional Details + * Last updated: Fri, 04 Aug 2023 20:19:53 GMT + * Dependencies: [@types/estree](https://npmjs.com/package/@types/estree), [@types/json-schema](https://npmjs.com/package/@types/json-schema) + * Global values: none + +# Credits +These definitions were written by [Pierre-Marie Dartus](https://github.com/pmdartus), [Jed Fox](https://github.com/j-f1), [Saad Quadri](https://github.com/saadq), [Jason Kwok](https://github.com/JasonHK), [Brad Zacher](https://github.com/bradzacher), and [JounQin](https://github.com/JounQin). diff --git a/node_modules/@types/eslint/helpers.d.ts b/node_modules/@types/eslint/helpers.d.ts new file mode 100644 index 0000000..0cf2141 --- /dev/null +++ b/node_modules/@types/eslint/helpers.d.ts @@ -0,0 +1,3 @@ +type Prepend = ((_: Addend, ..._1: Tuple) => any) extends (..._: infer Result) => any + ? Result + : never; diff --git a/node_modules/@types/eslint/index.d.ts b/node_modules/@types/eslint/index.d.ts new file mode 100644 index 0000000..e3eba94 --- /dev/null +++ b/node_modules/@types/eslint/index.d.ts @@ -0,0 +1,1209 @@ +// Type definitions for eslint 8.44 +// Project: https://eslint.org +// Definitions by: Pierre-Marie Dartus +// Jed Fox +// Saad Quadri +// Jason Kwok +// Brad Zacher +// JounQin +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +import * as ESTree from "estree"; +import { JSONSchema4 } from "json-schema"; + +export namespace AST { + type TokenType = + | "Boolean" + | "Null" + | "Identifier" + | "Keyword" + | "Punctuator" + | "JSXIdentifier" + | "JSXText" + | "Numeric" + | "String" + | "RegularExpression"; + + interface Token { + type: TokenType; + value: string; + range: Range; + loc: SourceLocation; + } + + interface SourceLocation { + start: ESTree.Position; + end: ESTree.Position; + } + + type Range = [number, number]; + + interface Program extends ESTree.Program { + comments: ESTree.Comment[]; + tokens: Token[]; + loc: SourceLocation; + range: Range; + } +} + +export namespace Scope { + interface ScopeManager { + scopes: Scope[]; + globalScope: Scope | null; + + acquire(node: ESTree.Node, inner?: boolean): Scope | null; + + getDeclaredVariables(node: ESTree.Node): Variable[]; + } + + interface Scope { + type: + | "block" + | "catch" + | "class" + | "for" + | "function" + | "function-expression-name" + | "global" + | "module" + | "switch" + | "with" + | "TDZ"; + isStrict: boolean; + upper: Scope | null; + childScopes: Scope[]; + variableScope: Scope; + block: ESTree.Node; + variables: Variable[]; + set: Map; + references: Reference[]; + through: Reference[]; + functionExpressionScope: boolean; + } + + interface Variable { + name: string; + scope: Scope; + identifiers: ESTree.Identifier[]; + references: Reference[]; + defs: Definition[]; + } + + interface Reference { + identifier: ESTree.Identifier; + from: Scope; + resolved: Variable | null; + writeExpr: ESTree.Node | null; + init: boolean; + + isWrite(): boolean; + + isRead(): boolean; + + isWriteOnly(): boolean; + + isReadOnly(): boolean; + + isReadWrite(): boolean; + } + + type DefinitionType = + | { type: "CatchClause"; node: ESTree.CatchClause; parent: null } + | { type: "ClassName"; node: ESTree.ClassDeclaration | ESTree.ClassExpression; parent: null } + | { type: "FunctionName"; node: ESTree.FunctionDeclaration | ESTree.FunctionExpression; parent: null } + | { type: "ImplicitGlobalVariable"; node: ESTree.Program; parent: null } + | { + type: "ImportBinding"; + node: ESTree.ImportSpecifier | ESTree.ImportDefaultSpecifier | ESTree.ImportNamespaceSpecifier; + parent: ESTree.ImportDeclaration; + } + | { + type: "Parameter"; + node: ESTree.FunctionDeclaration | ESTree.FunctionExpression | ESTree.ArrowFunctionExpression; + parent: null; + } + | { type: "TDZ"; node: any; parent: null } + | { type: "Variable"; node: ESTree.VariableDeclarator; parent: ESTree.VariableDeclaration }; + + type Definition = DefinitionType & { name: ESTree.Identifier }; +} + +//#region SourceCode + +export class SourceCode { + text: string; + ast: AST.Program; + lines: string[]; + hasBOM: boolean; + parserServices: SourceCode.ParserServices; + scopeManager: Scope.ScopeManager; + visitorKeys: SourceCode.VisitorKeys; + + constructor(text: string, ast: AST.Program); + constructor(config: SourceCode.Config); + + static splitLines(text: string): string[]; + + getText(node?: ESTree.Node, beforeCount?: number, afterCount?: number): string; + + getLines(): string[]; + + getAllComments(): ESTree.Comment[]; + + getAncestors(node: ESTree.Node): ESTree.Node[]; + + getComments(node: ESTree.Node): { leading: ESTree.Comment[]; trailing: ESTree.Comment[] }; + + getDeclaredVariables(node: ESTree.Node): Scope.Variable[]; + + getJSDocComment(node: ESTree.Node): ESTree.Comment | null; + + getNodeByRangeIndex(index: number): ESTree.Node | null; + + isSpaceBetweenTokens(first: AST.Token, second: AST.Token): boolean; + + getLocFromIndex(index: number): ESTree.Position; + + getIndexFromLoc(location: ESTree.Position): number; + + // Inherited methods from TokenStore + // --------------------------------- + + getTokenByRangeStart(offset: number, options?: { includeComments: false }): AST.Token | null; + getTokenByRangeStart(offset: number, options: { includeComments: boolean }): AST.Token | ESTree.Comment | null; + + getFirstToken: SourceCode.UnaryNodeCursorWithSkipOptions; + + getFirstTokens: SourceCode.UnaryNodeCursorWithCountOptions; + + getLastToken: SourceCode.UnaryNodeCursorWithSkipOptions; + + getLastTokens: SourceCode.UnaryNodeCursorWithCountOptions; + + getTokenBefore: SourceCode.UnaryCursorWithSkipOptions; + + getTokensBefore: SourceCode.UnaryCursorWithCountOptions; + + getTokenAfter: SourceCode.UnaryCursorWithSkipOptions; + + getTokensAfter: SourceCode.UnaryCursorWithCountOptions; + + getFirstTokenBetween: SourceCode.BinaryCursorWithSkipOptions; + + getFirstTokensBetween: SourceCode.BinaryCursorWithCountOptions; + + getLastTokenBetween: SourceCode.BinaryCursorWithSkipOptions; + + getLastTokensBetween: SourceCode.BinaryCursorWithCountOptions; + + getTokensBetween: SourceCode.BinaryCursorWithCountOptions; + + getTokens: ((node: ESTree.Node, beforeCount?: number, afterCount?: number) => AST.Token[]) & + SourceCode.UnaryNodeCursorWithCountOptions; + + commentsExistBetween( + left: ESTree.Node | AST.Token | ESTree.Comment, + right: ESTree.Node | AST.Token | ESTree.Comment, + ): boolean; + + getCommentsBefore(nodeOrToken: ESTree.Node | AST.Token): ESTree.Comment[]; + + getCommentsAfter(nodeOrToken: ESTree.Node | AST.Token): ESTree.Comment[]; + + getCommentsInside(node: ESTree.Node): ESTree.Comment[]; + + getScope(node: ESTree.Node): Scope.Scope; + + isSpaceBetween( + first: ESTree.Node|AST.Token, + second: ESTree.Node|AST.Token + ): boolean; + + markVariableAsUsed(name: string, refNode?: ESTree.Node): boolean; +} + +export namespace SourceCode { + interface Config { + text: string; + ast: AST.Program; + parserServices?: ParserServices | undefined; + scopeManager?: Scope.ScopeManager | undefined; + visitorKeys?: VisitorKeys | undefined; + } + + type ParserServices = any; + + interface VisitorKeys { + [nodeType: string]: string[]; + } + + interface UnaryNodeCursorWithSkipOptions { + ( + node: ESTree.Node, + options: + | ((token: AST.Token) => token is T) + | { filter: (token: AST.Token) => token is T; includeComments?: false | undefined; skip?: number | undefined }, + ): T | null; + ( + node: ESTree.Node, + options: { + filter: (tokenOrComment: AST.Token | ESTree.Comment) => tokenOrComment is T; + includeComments: boolean; + skip?: number | undefined; + }, + ): T | null; + ( + node: ESTree.Node, + options?: + | { filter?: ((token: AST.Token) => boolean) | undefined; includeComments?: false | undefined; skip?: number | undefined } + | ((token: AST.Token) => boolean) + | number, + ): AST.Token | null; + ( + node: ESTree.Node, + options: { + filter?: ((token: AST.Token | ESTree.Comment) => boolean) | undefined; + includeComments: boolean; + skip?: number | undefined; + }, + ): AST.Token | ESTree.Comment | null; + } + + interface UnaryNodeCursorWithCountOptions { + ( + node: ESTree.Node, + options: + | ((token: AST.Token) => token is T) + | { filter: (token: AST.Token) => token is T; includeComments?: false | undefined; count?: number | undefined }, + ): T[]; + ( + node: ESTree.Node, + options: { + filter: (tokenOrComment: AST.Token | ESTree.Comment) => tokenOrComment is T; + includeComments: boolean; + count?: number | undefined; + }, + ): T[]; + ( + node: ESTree.Node, + options?: + | { filter?: ((token: AST.Token) => boolean) | undefined; includeComments?: false | undefined; count?: number | undefined } + | ((token: AST.Token) => boolean) + | number, + ): AST.Token[]; + ( + node: ESTree.Node, + options: { + filter?: ((token: AST.Token | ESTree.Comment) => boolean) | undefined; + includeComments: boolean; + count?: number | undefined; + }, + ): Array; + } + + interface UnaryCursorWithSkipOptions { + ( + node: ESTree.Node | AST.Token | ESTree.Comment, + options: + | ((token: AST.Token) => token is T) + | { filter: (token: AST.Token) => token is T; includeComments?: false | undefined; skip?: number | undefined }, + ): T | null; + ( + node: ESTree.Node | AST.Token | ESTree.Comment, + options: { + filter: (tokenOrComment: AST.Token | ESTree.Comment) => tokenOrComment is T; + includeComments: boolean; + skip?: number | undefined; + }, + ): T | null; + ( + node: ESTree.Node | AST.Token | ESTree.Comment, + options?: + | { filter?: ((token: AST.Token) => boolean) | undefined; includeComments?: false | undefined; skip?: number | undefined } + | ((token: AST.Token) => boolean) + | number, + ): AST.Token | null; + ( + node: ESTree.Node | AST.Token | ESTree.Comment, + options: { + filter?: ((token: AST.Token | ESTree.Comment) => boolean) | undefined; + includeComments: boolean; + skip?: number | undefined; + }, + ): AST.Token | ESTree.Comment | null; + } + + interface UnaryCursorWithCountOptions { + ( + node: ESTree.Node | AST.Token | ESTree.Comment, + options: + | ((token: AST.Token) => token is T) + | { filter: (token: AST.Token) => token is T; includeComments?: false | undefined; count?: number | undefined }, + ): T[]; + ( + node: ESTree.Node | AST.Token | ESTree.Comment, + options: { + filter: (tokenOrComment: AST.Token | ESTree.Comment) => tokenOrComment is T; + includeComments: boolean; + count?: number | undefined; + }, + ): T[]; + ( + node: ESTree.Node | AST.Token | ESTree.Comment, + options?: + | { filter?: ((token: AST.Token) => boolean) | undefined; includeComments?: false | undefined; count?: number | undefined } + | ((token: AST.Token) => boolean) + | number, + ): AST.Token[]; + ( + node: ESTree.Node | AST.Token | ESTree.Comment, + options: { + filter?: ((token: AST.Token | ESTree.Comment) => boolean) | undefined; + includeComments: boolean; + count?: number | undefined; + }, + ): Array; + } + + interface BinaryCursorWithSkipOptions { + ( + left: ESTree.Node | AST.Token | ESTree.Comment, + right: ESTree.Node | AST.Token | ESTree.Comment, + options: + | ((token: AST.Token) => token is T) + | { filter: (token: AST.Token) => token is T; includeComments?: false | undefined; skip?: number | undefined }, + ): T | null; + ( + left: ESTree.Node | AST.Token | ESTree.Comment, + right: ESTree.Node | AST.Token | ESTree.Comment, + options: { + filter: (tokenOrComment: AST.Token | ESTree.Comment) => tokenOrComment is T; + includeComments: boolean; + skip?: number | undefined; + }, + ): T | null; + ( + left: ESTree.Node | AST.Token | ESTree.Comment, + right: ESTree.Node | AST.Token | ESTree.Comment, + options?: + | { filter?: ((token: AST.Token) => boolean) | undefined; includeComments?: false | undefined; skip?: number | undefined } + | ((token: AST.Token) => boolean) + | number, + ): AST.Token | null; + ( + left: ESTree.Node | AST.Token | ESTree.Comment, + right: ESTree.Node | AST.Token | ESTree.Comment, + options: { + filter?: ((token: AST.Token | ESTree.Comment) => boolean) | undefined; + includeComments: boolean; + skip?: number | undefined; + }, + ): AST.Token | ESTree.Comment | null; + } + + interface BinaryCursorWithCountOptions { + ( + left: ESTree.Node | AST.Token | ESTree.Comment, + right: ESTree.Node | AST.Token | ESTree.Comment, + options: + | ((token: AST.Token) => token is T) + | { filter: (token: AST.Token) => token is T; includeComments?: false | undefined; count?: number | undefined }, + ): T[]; + ( + left: ESTree.Node | AST.Token | ESTree.Comment, + right: ESTree.Node | AST.Token | ESTree.Comment, + options: { + filter: (tokenOrComment: AST.Token | ESTree.Comment) => tokenOrComment is T; + includeComments: boolean; + count?: number | undefined; + }, + ): T[]; + ( + left: ESTree.Node | AST.Token | ESTree.Comment, + right: ESTree.Node | AST.Token | ESTree.Comment, + options?: + | { filter?: ((token: AST.Token) => boolean) | undefined; includeComments?: false | undefined; count?: number | undefined } + | ((token: AST.Token) => boolean) + | number, + ): AST.Token[]; + ( + left: ESTree.Node | AST.Token | ESTree.Comment, + right: ESTree.Node | AST.Token | ESTree.Comment, + options: { + filter?: ((token: AST.Token | ESTree.Comment) => boolean) | undefined; + includeComments: boolean; + count?: number | undefined; + }, + ): Array; + } +} + +//#endregion + +export namespace Rule { + /** + * TODO: Old style rules are planned to be removed in v9, remove this type then (https://github.com/eslint/rfcs/blob/main/designs/2021-schema-object-rules/README.md) + * @deprecated Use `RuleModule` instead. + */ + type OldStyleRule = RuleModule["create"]; + + interface RuleModule { + create(context: RuleContext): RuleListener; + meta?: RuleMetaData | undefined; + schema?: RuleMetaData["schema"]; + } + + type NodeTypes = ESTree.Node["type"]; + interface NodeListener { + ArrayExpression?: ((node: ESTree.ArrayExpression & NodeParentExtension) => void) | undefined; + "ArrayExpression:exit"?: ((node: ESTree.ArrayExpression & NodeParentExtension) => void) | undefined; + ArrayPattern?: ((node: ESTree.ArrayPattern & NodeParentExtension) => void) | undefined; + "ArrayPattern:exit"?: ((node: ESTree.ArrayPattern & NodeParentExtension) => void) | undefined; + ArrowFunctionExpression?: ((node: ESTree.ArrowFunctionExpression & NodeParentExtension) => void) | undefined; + "ArrowFunctionExpression:exit"?: ((node: ESTree.ArrowFunctionExpression & NodeParentExtension) => void) | undefined; + AssignmentExpression?: ((node: ESTree.AssignmentExpression & NodeParentExtension) => void) | undefined; + "AssignmentExpression:exit"?: ((node: ESTree.AssignmentExpression & NodeParentExtension) => void) | undefined; + AssignmentPattern?: ((node: ESTree.AssignmentPattern & NodeParentExtension) => void) | undefined; + "AssignmentPattern:exit"?: ((node: ESTree.AssignmentPattern & NodeParentExtension) => void) | undefined; + AwaitExpression?: ((node: ESTree.AwaitExpression & NodeParentExtension) => void) | undefined; + "AwaitExpression:exit"?: ((node: ESTree.AwaitExpression & NodeParentExtension) => void) | undefined; + BinaryExpression?: ((node: ESTree.BinaryExpression & NodeParentExtension) => void) | undefined; + "BinaryExpression:exit"?: ((node: ESTree.BinaryExpression & NodeParentExtension) => void) | undefined; + BlockStatement?: ((node: ESTree.BlockStatement & NodeParentExtension) => void) | undefined; + "BlockStatement:exit"?: ((node: ESTree.BlockStatement & NodeParentExtension) => void) | undefined; + BreakStatement?: ((node: ESTree.BreakStatement & NodeParentExtension) => void) | undefined; + "BreakStatement:exit"?: ((node: ESTree.BreakStatement & NodeParentExtension) => void) | undefined; + CallExpression?: ((node: ESTree.CallExpression & NodeParentExtension) => void) | undefined; + "CallExpression:exit"?: ((node: ESTree.CallExpression & NodeParentExtension) => void) | undefined; + CatchClause?: ((node: ESTree.CatchClause & NodeParentExtension) => void) | undefined; + "CatchClause:exit"?: ((node: ESTree.CatchClause & NodeParentExtension) => void) | undefined; + ChainExpression?: ((node: ESTree.ChainExpression & NodeParentExtension) => void) | undefined; + "ChainExpression:exit"?: ((node: ESTree.ChainExpression & NodeParentExtension) => void) | undefined; + ClassBody?: ((node: ESTree.ClassBody & NodeParentExtension) => void) | undefined; + "ClassBody:exit"?: ((node: ESTree.ClassBody & NodeParentExtension) => void) | undefined; + ClassDeclaration?: ((node: ESTree.ClassDeclaration & NodeParentExtension) => void) | undefined; + "ClassDeclaration:exit"?: ((node: ESTree.ClassDeclaration & NodeParentExtension) => void) | undefined; + ClassExpression?: ((node: ESTree.ClassExpression & NodeParentExtension) => void) | undefined; + "ClassExpression:exit"?: ((node: ESTree.ClassExpression & NodeParentExtension) => void) | undefined; + ConditionalExpression?: ((node: ESTree.ConditionalExpression & NodeParentExtension) => void) | undefined; + "ConditionalExpression:exit"?: ((node: ESTree.ConditionalExpression & NodeParentExtension) => void) | undefined; + ContinueStatement?: ((node: ESTree.ContinueStatement & NodeParentExtension) => void) | undefined; + "ContinueStatement:exit"?: ((node: ESTree.ContinueStatement & NodeParentExtension) => void) | undefined; + DebuggerStatement?: ((node: ESTree.DebuggerStatement & NodeParentExtension) => void) | undefined; + "DebuggerStatement:exit"?: ((node: ESTree.DebuggerStatement & NodeParentExtension) => void) | undefined; + DoWhileStatement?: ((node: ESTree.DoWhileStatement & NodeParentExtension) => void) | undefined; + "DoWhileStatement:exit"?: ((node: ESTree.DoWhileStatement & NodeParentExtension) => void) | undefined; + EmptyStatement?: ((node: ESTree.EmptyStatement & NodeParentExtension) => void) | undefined; + "EmptyStatement:exit"?: ((node: ESTree.EmptyStatement & NodeParentExtension) => void) | undefined; + ExportAllDeclaration?: ((node: ESTree.ExportAllDeclaration & NodeParentExtension) => void) | undefined; + "ExportAllDeclaration:exit"?: ((node: ESTree.ExportAllDeclaration & NodeParentExtension) => void) | undefined; + ExportDefaultDeclaration?: ((node: ESTree.ExportDefaultDeclaration & NodeParentExtension) => void) | undefined; + "ExportDefaultDeclaration:exit"?: ((node: ESTree.ExportDefaultDeclaration & NodeParentExtension) => void) | undefined; + ExportNamedDeclaration?: ((node: ESTree.ExportNamedDeclaration & NodeParentExtension) => void) | undefined; + "ExportNamedDeclaration:exit"?: ((node: ESTree.ExportNamedDeclaration & NodeParentExtension) => void) | undefined; + ExportSpecifier?: ((node: ESTree.ExportSpecifier & NodeParentExtension) => void) | undefined; + "ExportSpecifier:exit"?: ((node: ESTree.ExportSpecifier & NodeParentExtension) => void) | undefined; + ExpressionStatement?: ((node: ESTree.ExpressionStatement & NodeParentExtension) => void) | undefined; + "ExpressionStatement:exit"?: ((node: ESTree.ExpressionStatement & NodeParentExtension) => void) | undefined; + ForInStatement?: ((node: ESTree.ForInStatement & NodeParentExtension) => void) | undefined; + "ForInStatement:exit"?: ((node: ESTree.ForInStatement & NodeParentExtension) => void) | undefined; + ForOfStatement?: ((node: ESTree.ForOfStatement & NodeParentExtension) => void) | undefined; + "ForOfStatement:exit"?: ((node: ESTree.ForOfStatement & NodeParentExtension) => void) | undefined; + ForStatement?: ((node: ESTree.ForStatement & NodeParentExtension) => void) | undefined; + "ForStatement:exit"?: ((node: ESTree.ForStatement & NodeParentExtension) => void) | undefined; + FunctionDeclaration?: ((node: ESTree.FunctionDeclaration & NodeParentExtension) => void) | undefined; + "FunctionDeclaration:exit"?: ((node: ESTree.FunctionDeclaration & NodeParentExtension) => void) | undefined; + FunctionExpression?: ((node: ESTree.FunctionExpression & NodeParentExtension) => void) | undefined; + "FunctionExpression:exit"?: ((node: ESTree.FunctionExpression & NodeParentExtension) => void) | undefined; + Identifier?: ((node: ESTree.Identifier & NodeParentExtension) => void) | undefined; + "Identifier:exit"?: ((node: ESTree.Identifier & NodeParentExtension) => void) | undefined; + IfStatement?: ((node: ESTree.IfStatement & NodeParentExtension) => void) | undefined; + "IfStatement:exit"?: ((node: ESTree.IfStatement & NodeParentExtension) => void) | undefined; + ImportDeclaration?: ((node: ESTree.ImportDeclaration & NodeParentExtension) => void) | undefined; + "ImportDeclaration:exit"?: ((node: ESTree.ImportDeclaration & NodeParentExtension) => void) | undefined; + ImportDefaultSpecifier?: ((node: ESTree.ImportDefaultSpecifier & NodeParentExtension) => void) | undefined; + "ImportDefaultSpecifier:exit"?: ((node: ESTree.ImportDefaultSpecifier & NodeParentExtension) => void) | undefined; + ImportExpression?: ((node: ESTree.ImportExpression & NodeParentExtension) => void) | undefined; + "ImportExpression:exit"?: ((node: ESTree.ImportExpression & NodeParentExtension) => void) | undefined; + ImportNamespaceSpecifier?: ((node: ESTree.ImportNamespaceSpecifier & NodeParentExtension) => void) | undefined; + "ImportNamespaceSpecifier:exit"?: ((node: ESTree.ImportNamespaceSpecifier & NodeParentExtension) => void) | undefined; + ImportSpecifier?: ((node: ESTree.ImportSpecifier & NodeParentExtension) => void) | undefined; + "ImportSpecifier:exit"?: ((node: ESTree.ImportSpecifier & NodeParentExtension) => void) | undefined; + LabeledStatement?: ((node: ESTree.LabeledStatement & NodeParentExtension) => void) | undefined; + "LabeledStatement:exit"?: ((node: ESTree.LabeledStatement & NodeParentExtension) => void) | undefined; + Literal?: ((node: ESTree.Literal & NodeParentExtension) => void) | undefined; + "Literal:exit"?: ((node: ESTree.Literal & NodeParentExtension) => void) | undefined; + LogicalExpression?: ((node: ESTree.LogicalExpression & NodeParentExtension) => void) | undefined; + "LogicalExpression:exit"?: ((node: ESTree.LogicalExpression & NodeParentExtension) => void) | undefined; + MemberExpression?: ((node: ESTree.MemberExpression & NodeParentExtension) => void) | undefined; + "MemberExpression:exit"?: ((node: ESTree.MemberExpression & NodeParentExtension) => void) | undefined; + MetaProperty?: ((node: ESTree.MetaProperty & NodeParentExtension) => void) | undefined; + "MetaProperty:exit"?: ((node: ESTree.MetaProperty & NodeParentExtension) => void) | undefined; + MethodDefinition?: ((node: ESTree.MethodDefinition & NodeParentExtension) => void) | undefined; + "MethodDefinition:exit"?: ((node: ESTree.MethodDefinition & NodeParentExtension) => void) | undefined; + NewExpression?: ((node: ESTree.NewExpression & NodeParentExtension) => void) | undefined; + "NewExpression:exit"?: ((node: ESTree.NewExpression & NodeParentExtension) => void) | undefined; + ObjectExpression?: ((node: ESTree.ObjectExpression & NodeParentExtension) => void) | undefined; + "ObjectExpression:exit"?: ((node: ESTree.ObjectExpression & NodeParentExtension) => void) | undefined; + ObjectPattern?: ((node: ESTree.ObjectPattern & NodeParentExtension) => void) | undefined; + "ObjectPattern:exit"?: ((node: ESTree.ObjectPattern & NodeParentExtension) => void) | undefined; + PrivateIdentifier?: ((node: ESTree.PrivateIdentifier & NodeParentExtension) => void) | undefined; + "PrivateIdentifier:exit"?: ((node: ESTree.PrivateIdentifier & NodeParentExtension) => void) | undefined; + Program?: ((node: ESTree.Program) => void) | undefined; + "Program:exit"?: ((node: ESTree.Program) => void) | undefined; + Property?: ((node: ESTree.Property & NodeParentExtension) => void) | undefined; + "Property:exit"?: ((node: ESTree.Property & NodeParentExtension) => void) | undefined; + PropertyDefinition?: ((node: ESTree.PropertyDefinition & NodeParentExtension) => void) | undefined; + "PropertyDefinition:exit"?: ((node: ESTree.PropertyDefinition & NodeParentExtension) => void) | undefined; + RestElement?: ((node: ESTree.RestElement & NodeParentExtension) => void) | undefined; + "RestElement:exit"?: ((node: ESTree.RestElement & NodeParentExtension) => void) | undefined; + ReturnStatement?: ((node: ESTree.ReturnStatement & NodeParentExtension) => void) | undefined; + "ReturnStatement:exit"?: ((node: ESTree.ReturnStatement & NodeParentExtension) => void) | undefined; + SequenceExpression?: ((node: ESTree.SequenceExpression & NodeParentExtension) => void) | undefined; + "SequenceExpression:exit"?: ((node: ESTree.SequenceExpression & NodeParentExtension) => void) | undefined; + SpreadElement?: ((node: ESTree.SpreadElement & NodeParentExtension) => void) | undefined; + "SpreadElement:exit"?: ((node: ESTree.SpreadElement & NodeParentExtension) => void) | undefined; + StaticBlock?: ((node: ESTree.StaticBlock & NodeParentExtension) => void) | undefined; + "StaticBlock:exit"?: ((node: ESTree.StaticBlock & NodeParentExtension) => void) | undefined; + Super?: ((node: ESTree.Super & NodeParentExtension) => void) | undefined; + "Super:exit"?: ((node: ESTree.Super & NodeParentExtension) => void) | undefined; + SwitchCase?: ((node: ESTree.SwitchCase & NodeParentExtension) => void) | undefined; + "SwitchCase:exit"?: ((node: ESTree.SwitchCase & NodeParentExtension) => void) | undefined; + SwitchStatement?: ((node: ESTree.SwitchStatement & NodeParentExtension) => void) | undefined; + "SwitchStatement:exit"?: ((node: ESTree.SwitchStatement & NodeParentExtension) => void) | undefined; + TaggedTemplateExpression?: ((node: ESTree.TaggedTemplateExpression & NodeParentExtension) => void) | undefined; + "TaggedTemplateExpression:exit"?: ((node: ESTree.TaggedTemplateExpression & NodeParentExtension) => void) | undefined; + TemplateElement?: ((node: ESTree.TemplateElement & NodeParentExtension) => void) | undefined; + "TemplateElement:exit"?: ((node: ESTree.TemplateElement & NodeParentExtension) => void) | undefined; + TemplateLiteral?: ((node: ESTree.TemplateLiteral & NodeParentExtension) => void) | undefined; + "TemplateLiteral:exit"?: ((node: ESTree.TemplateLiteral & NodeParentExtension) => void) | undefined; + ThisExpression?: ((node: ESTree.ThisExpression & NodeParentExtension) => void) | undefined; + "ThisExpression:exit"?: ((node: ESTree.ThisExpression & NodeParentExtension) => void) | undefined; + ThrowStatement?: ((node: ESTree.ThrowStatement & NodeParentExtension) => void) | undefined; + "ThrowStatement:exit"?: ((node: ESTree.ThrowStatement & NodeParentExtension) => void) | undefined; + TryStatement?: ((node: ESTree.TryStatement & NodeParentExtension) => void) | undefined; + "TryStatement:exit"?: ((node: ESTree.TryStatement & NodeParentExtension) => void) | undefined; + UnaryExpression?: ((node: ESTree.UnaryExpression & NodeParentExtension) => void) | undefined; + "UnaryExpression:exit"?: ((node: ESTree.UnaryExpression & NodeParentExtension) => void) | undefined; + UpdateExpression?: ((node: ESTree.UpdateExpression & NodeParentExtension) => void) | undefined; + "UpdateExpression:exit"?: ((node: ESTree.UpdateExpression & NodeParentExtension) => void) | undefined; + VariableDeclaration?: ((node: ESTree.VariableDeclaration & NodeParentExtension) => void) | undefined; + "VariableDeclaration:exit"?: ((node: ESTree.VariableDeclaration & NodeParentExtension) => void) | undefined; + VariableDeclarator?: ((node: ESTree.VariableDeclarator & NodeParentExtension) => void) | undefined; + "VariableDeclarator:exit"?: ((node: ESTree.VariableDeclarator & NodeParentExtension) => void) | undefined; + WhileStatement?: ((node: ESTree.WhileStatement & NodeParentExtension) => void) | undefined; + "WhileStatement:exit"?: ((node: ESTree.WhileStatement & NodeParentExtension) => void) | undefined; + WithStatement?: ((node: ESTree.WithStatement & NodeParentExtension) => void) | undefined; + "WithStatement:exit"?: ((node: ESTree.WithStatement & NodeParentExtension) => void) | undefined; + YieldExpression?: ((node: ESTree.YieldExpression & NodeParentExtension) => void) | undefined; + "YieldExpression:exit"?: ((node: ESTree.YieldExpression & NodeParentExtension) => void) | undefined; + } + + interface NodeParentExtension { + parent: Node; + } + type Node = ESTree.Node & NodeParentExtension; + + interface RuleListener extends NodeListener { + onCodePathStart?(codePath: CodePath, node: Node): void; + + onCodePathEnd?(codePath: CodePath, node: Node): void; + + onCodePathSegmentStart?(segment: CodePathSegment, node: Node): void; + + onCodePathSegmentEnd?(segment: CodePathSegment, node: Node): void; + + onCodePathSegmentLoop?(fromSegment: CodePathSegment, toSegment: CodePathSegment, node: Node): void; + + [key: string]: + | ((codePath: CodePath, node: Node) => void) + | ((segment: CodePathSegment, node: Node) => void) + | ((fromSegment: CodePathSegment, toSegment: CodePathSegment, node: Node) => void) + | ((node: Node) => void) + | NodeListener[keyof NodeListener] + | undefined; + } + + interface CodePath { + id: string; + initialSegment: CodePathSegment; + finalSegments: CodePathSegment[]; + returnedSegments: CodePathSegment[]; + thrownSegments: CodePathSegment[]; + currentSegments: CodePathSegment[]; + upper: CodePath | null; + childCodePaths: CodePath[]; + } + + interface CodePathSegment { + id: string; + nextSegments: CodePathSegment[]; + prevSegments: CodePathSegment[]; + reachable: boolean; + } + + interface RuleMetaData { + docs?: { + /** Provides a short description of the rule. */ + description?: string | undefined; + /** + * TODO: remove this field in next major release of @types/eslint. + * @deprecated no longer used + */ + category?: string | undefined; + /** Whether the rule is enabled in the plugin's `recommended` configuration. */ + recommended?: boolean | undefined; + /** Specifies the URL at which the full documentation can be accessed (enabling code editors to provide a helpful link on highlighted rule violations). */ + url?: string | undefined; + /** + * TODO: remove this field in next major release of @types/eslint. + * @deprecated use `meta.hasSuggestions` instead + */ + suggestion?: boolean | undefined; + } | undefined; + /** Violation and suggestion messages. */ + messages?: { [messageId: string]: string } | undefined; + /** + * Specifies if the `--fix` option on the command line automatically fixes problems reported by the rule. + * Mandatory for fixable rules. + */ + fixable?: "code" | "whitespace" | undefined; + /** + * Specifies the [options](https://eslint.org/docs/latest/developer-guide/working-with-rules#options-schemas) + * so ESLint can prevent invalid [rule configurations](https://eslint.org/docs/latest/user-guide/configuring/rules#configuring-rules). + * TODO: schema is potentially planned to be no longer be optional in v9 (https://github.com/eslint/rfcs/blob/main/designs/2021-schema-object-rules/README.md) + */ + schema?: JSONSchema4 | JSONSchema4[] | undefined; + + /** Indicates whether the rule has been deprecated. Omit if not deprecated. */ + deprecated?: boolean | undefined; + /** The name of the rule(s) this rule was replaced by, if it was deprecated. */ + replacedBy?: readonly string[]; + + /** + * Indicates the type of rule: + * - `"problem"` means the rule is identifying code that either will cause an error or may cause a confusing behavior. Developers should consider this a high priority to resolve. + * - `"suggestion"` means the rule is identifying something that could be done in a better way but no errors will occur if the code isn’t changed. + * - `"layout"` means the rule cares primarily about whitespace, semicolons, commas, and parentheses, + * all the parts of the program that determine how the code looks rather than how it executes. + * These rules work on parts of the code that aren’t specified in the AST. + */ + type?: "problem" | "suggestion" | "layout" | undefined; + /** + * Specifies whether the rule can return suggestions (defaults to `false` if omitted). + * Mandatory for rules that provide suggestions. + */ + hasSuggestions?: boolean | undefined; + } + + interface RuleContext { + id: string; + options: any[]; + settings: { [name: string]: any }; + parserPath: string; + parserOptions: Linter.ParserOptions; + parserServices: SourceCode.ParserServices; + cwd: string; + filename: string; + physicalFilename: string; + sourceCode: SourceCode; + + getAncestors(): ESTree.Node[]; + + getDeclaredVariables(node: ESTree.Node): Scope.Variable[]; + + /** @deprecated Use property `filename` directly instead */ + getFilename(): string; + + /** @deprecated Use property `physicalFilename` directly instead */ + getPhysicalFilename(): string; + + /** @deprecated Use property `cwd` directly instead */ + getCwd(): string; + + getScope(): Scope.Scope; + + /** @deprecated Use property `sourceCode` directly instead */ + getSourceCode(): SourceCode; + + markVariableAsUsed(name: string): boolean; + + report(descriptor: ReportDescriptor): void; + } + + type ReportFixer = (fixer: RuleFixer) => null | Fix | IterableIterator | Fix[]; + + interface ReportDescriptorOptionsBase { + data?: { [key: string]: string }; + + fix?: null | ReportFixer; + } + + interface SuggestionReportOptions { + data?: { [key: string]: string }; + + fix: ReportFixer; + } + + type SuggestionDescriptorMessage = { desc: string } | { messageId: string }; + type SuggestionReportDescriptor = SuggestionDescriptorMessage & SuggestionReportOptions; + + interface ReportDescriptorOptions extends ReportDescriptorOptionsBase { + suggest?: SuggestionReportDescriptor[] | null | undefined; + } + + type ReportDescriptor = ReportDescriptorMessage & ReportDescriptorLocation & ReportDescriptorOptions; + type ReportDescriptorMessage = { message: string } | { messageId: string }; + type ReportDescriptorLocation = + | { node: ESTree.Node } + | { loc: AST.SourceLocation | { line: number; column: number } }; + + interface RuleFixer { + insertTextAfter(nodeOrToken: ESTree.Node | AST.Token, text: string): Fix; + + insertTextAfterRange(range: AST.Range, text: string): Fix; + + insertTextBefore(nodeOrToken: ESTree.Node | AST.Token, text: string): Fix; + + insertTextBeforeRange(range: AST.Range, text: string): Fix; + + remove(nodeOrToken: ESTree.Node | AST.Token): Fix; + + removeRange(range: AST.Range): Fix; + + replaceText(nodeOrToken: ESTree.Node | AST.Token, text: string): Fix; + + replaceTextRange(range: AST.Range, text: string): Fix; + } + + interface Fix { + range: AST.Range; + text: string; + } +} + +//#region Linter + +export class Linter { + static version: string; + + version: string; + + constructor(options?: { cwd?: string | undefined, configType?: 'flat' }); + + verify(code: SourceCode | string, config: Linter.Config | Linter.FlatConfig[], filename?: string): Linter.LintMessage[]; + verify(code: SourceCode | string, config: Linter.Config | Linter.FlatConfig[], options: Linter.LintOptions): Linter.LintMessage[]; + + verifyAndFix(code: string, config: Linter.Config | Linter.FlatConfig[], filename?: string): Linter.FixReport; + verifyAndFix(code: string, config: Linter.Config | Linter.FlatConfig[], options: Linter.FixOptions): Linter.FixReport; + + getSourceCode(): SourceCode; + + defineRule(name: string, rule: Rule.RuleModule): void; + + defineRules(rules: { [name: string]: Rule.RuleModule }): void; + + getRules(): Map; + + defineParser(name: string, parser: Linter.ParserModule): void; +} + +export namespace Linter { + type Severity = 0 | 1 | 2; + type StringSeverity = "off" | "warn" | "error"; + + type RuleLevel = Severity | StringSeverity; + type RuleLevelAndOptions = Prepend, RuleLevel>; + + type RuleEntry = RuleLevel | RuleLevelAndOptions; + + interface RulesRecord { + [rule: string]: RuleEntry; + } + + interface HasRules { + rules?: Partial | undefined; + } + + interface BaseConfig extends HasRules { + $schema?: string | undefined; + env?: { [name: string]: boolean } | undefined; + extends?: string | string[] | undefined; + globals?: { [name: string]: boolean | "off" | "readonly" | "readable" | "writable" | "writeable" } | undefined; + noInlineConfig?: boolean | undefined; + overrides?: Array> | undefined; + parser?: string | undefined; + parserOptions?: ParserOptions | undefined; + plugins?: string[] | undefined; + processor?: string | undefined; + reportUnusedDisableDirectives?: boolean | undefined; + settings?: { [name: string]: any } | undefined; + } + + interface ConfigOverride extends BaseConfig { + excludedFiles?: string | string[] | undefined; + files: string | string[]; + } + + // https://github.com/eslint/eslint/blob/v6.8.0/conf/config-schema.js + interface Config extends BaseConfig { + ignorePatterns?: string | string[] | undefined; + root?: boolean | undefined; + } + + interface ParserOptions { + ecmaVersion?: 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020 | 2021 | 2022 | 2023 | 2024 | "latest" | undefined; + sourceType?: "script" | "module" | undefined; + ecmaFeatures?: { + globalReturn?: boolean | undefined; + impliedStrict?: boolean | undefined; + jsx?: boolean | undefined; + experimentalObjectRestSpread?: boolean | undefined; + [key: string]: any; + } | undefined; + [key: string]: any; + } + + interface LintOptions { + filename?: string | undefined; + preprocess?: ((code: string) => string[]) | undefined; + postprocess?: ((problemLists: LintMessage[][]) => LintMessage[]) | undefined; + filterCodeBlock?: boolean | undefined; + disableFixes?: boolean | undefined; + allowInlineConfig?: boolean | undefined; + reportUnusedDisableDirectives?: boolean | undefined; + } + + interface LintSuggestion { + desc: string; + fix: Rule.Fix; + messageId?: string | undefined; + } + + interface LintMessage { + column: number; + line: number; + endColumn?: number | undefined; + endLine?: number | undefined; + ruleId: string | null; + message: string; + messageId?: string | undefined; + nodeType?: string | undefined; + fatal?: true | undefined; + severity: Severity; + fix?: Rule.Fix | undefined; + /** @deprecated Use `linter.getSourceCode()` */ + source?: string | null | undefined; + suggestions?: LintSuggestion[] | undefined; + } + + interface LintSuppression { + kind: string; + justification: string; + } + + interface SuppressedLintMessage extends LintMessage { + suppressions: LintSuppression[]; + } + + interface FixOptions extends LintOptions { + fix?: boolean | undefined; + } + + interface FixReport { + fixed: boolean; + output: string; + messages: LintMessage[]; + } + + type ParserModule = ESLint.ObjectMetaProperties & ( + { parse(text: string, options?: any): AST.Program; } + | { parseForESLint(text: string, options?: any): ESLintParseResult; } + ); + + interface ESLintParseResult { + ast: AST.Program; + parserServices?: SourceCode.ParserServices | undefined; + scopeManager?: Scope.ScopeManager | undefined; + visitorKeys?: SourceCode.VisitorKeys | undefined; + } + + interface ProcessorFile { + text: string; + filename: string; + } + + // https://eslint.org/docs/developer-guide/working-with-plugins#processors-in-plugins + interface Processor extends ESLint.ObjectMetaProperties { + supportsAutofix?: boolean | undefined; + preprocess?(text: string, filename: string): T[]; + postprocess?(messages: LintMessage[][], filename: string): LintMessage[]; + } + + type FlatConfigFileSpec = string | ((filePath: string) => boolean); + + interface FlatConfig { + /** + * An array of glob patterns indicating the files that the configuration + * object should apply to. If not specified, the configuration object applies + * to all files + */ + files?: Array; + /** + * An array of glob patterns indicating the files that the configuration + * object should not apply to. If not specified, the configuration object + * applies to all files matched by files + */ + ignores?: FlatConfigFileSpec[]; + /** + * An object containing settings related to how JavaScript is configured for + * linting. + */ + languageOptions?: { + /** + * The version of ECMAScript to support. May be any year (i.e., 2022) or + * version (i.e., 5). Set to "latest" for the most recent supported version. + * @default "latest" + */ + ecmaVersion?: ParserOptions["ecmaVersion"], + /** + * The type of JavaScript source code. Possible values are "script" for + * traditional script files, "module" for ECMAScript modules (ESM), and + * "commonjs" for CommonJS files. (default: "module" for .js and .mjs + * files; "commonjs" for .cjs files) + */ + sourceType?: "script" | "module" | "commonjs", + /** + * An object specifying additional objects that should be added to the + * global scope during linting. + */ + globals?: ESLint.Environment["globals"], + /** + * An object containing a parse() or parseForESLint() method. + * If not configured, the default ESLint parser (Espree) will be used. + */ + parser?: ParserModule, + /** + * An object specifying additional options that are passed directly to the + * parser() method on the parser. The available options are parser-dependent + */ + parserOptions?: ESLint.Environment["parserOptions"], + }; + /** + * An object containing settings related to the linting process + */ + linterOptions?: { + /** + * A Boolean value indicating if inline configuration is allowed. + */ + noInlineConfig?: boolean, + /** + * A Boolean value indicating if unused disable directives should be + * tracked and reported. + */ + reportUnusedDisableDirectives?: boolean, + }; + /** + * Either an object containing preprocess() and postprocess() methods or a + * string indicating the name of a processor inside of a plugin + * (i.e., "pluginName/processorName"). + */ + processor?: string | Processor; + /** + * An object containing a name-value mapping of plugin names to plugin objects. + * When files is specified, these plugins are only available to the matching files. + */ + plugins?: Record; + /** + * An object containing the configured rules. When files or ignores are specified, + * these rule configurations are only available to the matching files. + */ + rules?: RulesRecord; + /** + * An object containing name-value pairs of information that should be + * available to all rules. + */ + settings?: Record; + } +} + +//#endregion + +//#region ESLint + +export class ESLint { + static version: string; + + static outputFixes(results: ESLint.LintResult[]): Promise; + + static getErrorResults(results: ESLint.LintResult[]): ESLint.LintResult[]; + + constructor(options?: ESLint.Options); + + lintFiles(patterns: string | string[]): Promise; + + lintText(code: string, options?: { filePath?: string | undefined; warnIgnored?: boolean | undefined }): Promise; + + getRulesMetaForResults(results: ESLint.LintResult[]): ESLint.LintResultData['rulesMeta']; + + calculateConfigForFile(filePath: string): Promise; + + isPathIgnored(filePath: string): Promise; + + loadFormatter(nameOrPath?: string): Promise; +} + +export namespace ESLint { + type ConfigData = Omit, "$schema">; + + interface Environment { + globals?: { [name: string]: boolean; } | undefined; + parserOptions?: Linter.ParserOptions | undefined; + } + + interface ObjectMetaProperties { + /** @deprecated Use `meta.name` instead. */ + name?: string | undefined; + + /** @deprecated Use `meta.version` instead. */ + version?: string | undefined; + + meta?: { + name?: string | undefined; + version?: string | undefined; + }; + } + + interface Plugin extends ObjectMetaProperties { + configs?: Record | undefined; + environments?: Record | undefined; + processors?: Record | undefined; + rules?: Record | undefined; + } + + interface Options { + // File enumeration + cwd?: string | undefined; + errorOnUnmatchedPattern?: boolean | undefined; + extensions?: string[] | undefined; + globInputPaths?: boolean | undefined; + ignore?: boolean | undefined; + ignorePath?: string | undefined; + + // Linting + allowInlineConfig?: boolean | undefined; + baseConfig?: Linter.Config | undefined; + overrideConfig?: Linter.Config | undefined; + overrideConfigFile?: string | undefined; + plugins?: Record | undefined; + reportUnusedDisableDirectives?: Linter.StringSeverity | undefined; + resolvePluginsRelativeTo?: string | undefined; + rulePaths?: string[] | undefined; + useEslintrc?: boolean | undefined; + + // Autofix + fix?: boolean | ((message: Linter.LintMessage) => boolean) | undefined; + fixTypes?: Array | undefined; + + // Cache-related + cache?: boolean | undefined; + cacheLocation?: string | undefined; + cacheStrategy?: "content" | "metadata" | undefined; + } + + interface LintResult { + filePath: string; + messages: Linter.LintMessage[]; + suppressedMessages: Linter.SuppressedLintMessage[]; + errorCount: number; + fatalErrorCount: number; + warningCount: number; + fixableErrorCount: number; + fixableWarningCount: number; + output?: string | undefined; + source?: string | undefined; + usedDeprecatedRules: DeprecatedRuleUse[]; + } + + interface LintResultData { + cwd: string; + rulesMeta: { + [ruleId: string]: Rule.RuleMetaData; + }; + } + + interface DeprecatedRuleUse { + ruleId: string; + replacedBy: string[]; + } + + interface Formatter { + format(results: LintResult[], data?: LintResultData): string | Promise; + } + + // Docs reference the type by this name + type EditInfo = Rule.Fix; +} + +//#endregion + +//#region RuleTester + +export class RuleTester { + constructor(config?: any); + + run( + name: string, + rule: Rule.RuleModule, + tests: { + valid?: Array | undefined; + invalid?: RuleTester.InvalidTestCase[] | undefined; + }, + ): void; + + static only( + item: string | RuleTester.ValidTestCase | RuleTester.InvalidTestCase, + ): RuleTester.ValidTestCase | RuleTester.InvalidTestCase; +} + +export namespace RuleTester { + interface ValidTestCase { + name?: string; + code: string; + options?: any; + filename?: string | undefined; + only?: boolean; + parserOptions?: Linter.ParserOptions | undefined; + settings?: { [name: string]: any } | undefined; + parser?: string | undefined; + globals?: { [name: string]: boolean } | undefined; + } + + interface SuggestionOutput { + messageId?: string | undefined; + desc?: string | undefined; + data?: Record | undefined; + output: string; + } + + interface InvalidTestCase extends ValidTestCase { + errors: number | Array; + output?: string | null | undefined; + } + + interface TestCaseError { + message?: string | RegExp | undefined; + messageId?: string | undefined; + type?: string | undefined; + data?: any; + line?: number | undefined; + column?: number | undefined; + endLine?: number | undefined; + endColumn?: number | undefined; + suggestions?: SuggestionOutput[] | undefined; + } +} + +//#endregion diff --git a/node_modules/@types/eslint/package.json b/node_modules/@types/eslint/package.json new file mode 100644 index 0000000..716ce28 --- /dev/null +++ b/node_modules/@types/eslint/package.json @@ -0,0 +1,65 @@ +{ + "name": "@types/eslint", + "version": "8.44.2", + "description": "TypeScript definitions for eslint", + "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/eslint", + "license": "MIT", + "contributors": [ + { + "name": "Pierre-Marie Dartus", + "url": "https://github.com/pmdartus", + "githubUsername": "pmdartus" + }, + { + "name": "Jed Fox", + "url": "https://github.com/j-f1", + "githubUsername": "j-f1" + }, + { + "name": "Saad Quadri", + "url": "https://github.com/saadq", + "githubUsername": "saadq" + }, + { + "name": "Jason Kwok", + "url": "https://github.com/JasonHK", + "githubUsername": "JasonHK" + }, + { + "name": "Brad Zacher", + "url": "https://github.com/bradzacher", + "githubUsername": "bradzacher" + }, + { + "name": "JounQin", + "url": "https://github.com/JounQin", + "githubUsername": "JounQin" + } + ], + "main": "", + "types": "index.d.ts", + "repository": { + "type": "git", + "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", + "directory": "types/eslint" + }, + "scripts": {}, + "dependencies": { + "@types/estree": "*", + "@types/json-schema": "*" + }, + "typesPublisherContentHash": "97b0176e71d5a8db5e07c2bd8d35d2ed6738aa1eaa3f7175881f9942d304c0ba", + "typeScriptVersion": "4.3", + "exports": { + ".": { + "types": "./index.d.ts" + }, + "./use-at-your-own-risk": { + "types": "./use-at-your-own-risk.d.ts" + }, + "./rules": { + "types": "./rules/index.d.ts" + }, + "./package.json": "./package.json" + } +} \ No newline at end of file diff --git a/node_modules/@types/eslint/rules/best-practices.d.ts b/node_modules/@types/eslint/rules/best-practices.d.ts new file mode 100644 index 0000000..68be5d9 --- /dev/null +++ b/node_modules/@types/eslint/rules/best-practices.d.ts @@ -0,0 +1,931 @@ +import { Linter } from "../index"; + +export interface BestPractices extends Linter.RulesRecord { + /** + * Rule to enforce getter and setter pairs in objects. + * + * @since 0.22.0 + * @see https://eslint.org/docs/rules/accessor-pairs + */ + "accessor-pairs": Linter.RuleEntry< + [ + Partial<{ + /** + * @default true + */ + setWithoutGet: boolean; + /** + * @default false + */ + getWithoutSet: boolean; + }>, + ] + >; + + /** + * Rule to enforce `return` statements in callbacks of array methods. + * + * @since 2.0.0-alpha-1 + * @see https://eslint.org/docs/rules/array-callback-return + */ + "array-callback-return": Linter.RuleEntry< + [ + Partial<{ + /** + * @default false + */ + allowImplicit: boolean; + }>, + ] + >; + + /** + * Rule to enforce the use of variables within the scope they are defined. + * + * @since 0.1.0 + * @see https://eslint.org/docs/rules/block-scoped-var + */ + "block-scoped-var": Linter.RuleEntry<[]>; + + /** + * Rule to enforce that class methods utilize `this`. + * + * @since 3.4.0 + * @see https://eslint.org/docs/rules/class-methods-use-this + */ + "class-methods-use-this": Linter.RuleEntry< + [ + Partial<{ + exceptMethods: string[]; + }>, + ] + >; + + /** + * Rule to enforce a maximum cyclomatic complexity allowed in a program. + * + * @since 0.0.9 + * @see https://eslint.org/docs/rules/complexity + */ + complexity: Linter.RuleEntry< + [ + | Partial<{ + /** + * @default 20 + */ + max: number; + /** + * @deprecated + * @default 20 + */ + maximum: number; + }> + | number, + ] + >; + + /** + * Rule to require `return` statements to either always or never specify values. + * + * @since 0.4.0 + * @see https://eslint.org/docs/rules/consistent-return + */ + "consistent-return": Linter.RuleEntry< + [ + Partial<{ + /** + * @default false + */ + treatUndefinedAsUnspecified: boolean; + }>, + ] + >; + + /** + * Rule to enforce consistent brace style for all control statements. + * + * @since 0.0.2 + * @see https://eslint.org/docs/rules/curly + */ + curly: Linter.RuleEntry<["all" | "multi" | "multi-line" | "multi-or-nest" | "consistent"]>; + + /** + * Rule to require `default` cases in `switch` statements. + * + * @since 0.6.0 + * @see https://eslint.org/docs/rules/default-case + */ + "default-case": Linter.RuleEntry< + [ + Partial<{ + /** + * @default '^no default$' + */ + commentPattern: string; + }>, + ] + >; + + /** + * Rule to enforce consistent newlines before and after dots. + * + * @since 0.21.0 + * @see https://eslint.org/docs/rules/dot-location + */ + "dot-location": Linter.RuleEntry<["object" | "property"]>; + + /** + * Rule to enforce dot notation whenever possible. + * + * @since 0.0.7 + * @see https://eslint.org/docs/rules/dot-notation + */ + "dot-notation": Linter.RuleEntry< + [ + Partial<{ + /** + * @default true + */ + allowKeywords: boolean; + allowPattern: string; + }>, + ] + >; + + /** + * Rule to require the use of `===` and `!==`. + * + * @since 0.0.2 + * @see https://eslint.org/docs/rules/eqeqeq + */ + eqeqeq: + | Linter.RuleEntry< + [ + "always", + Partial<{ + /** + * @default 'always' + */ + null: "always" | "never" | "ignore"; + }>, + ] + > + | Linter.RuleEntry<["smart" | "allow-null"]>; + + /** + * Rule to require `for-in` loops to include an `if` statement. + * + * @since 0.0.6 + * @see https://eslint.org/docs/rules/guard-for-in + */ + "guard-for-in": Linter.RuleEntry<[]>; + + /** + * Rule to enforce a maximum number of classes per file. + * + * @since 5.0.0-alpha.3 + * @see https://eslint.org/docs/rules/max-classes-per-file + */ + "max-classes-per-file": Linter.RuleEntry<[number]>; + + /** + * Rule to disallow the use of `alert`, `confirm`, and `prompt`. + * + * @since 0.0.5 + * @see https://eslint.org/docs/rules/no-alert + */ + "no-alert": Linter.RuleEntry<[]>; + + /** + * Rule to disallow the use of `arguments.caller` or `arguments.callee`. + * + * @since 0.0.6 + * @see https://eslint.org/docs/rules/no-caller + */ + "no-caller": Linter.RuleEntry<[]>; + + /** + * Rule to disallow lexical declarations in case clauses. + * + * @remarks + * Recommended by ESLint, the rule was enabled in `eslint:recommended`. + * + * @since 1.9.0 + * @see https://eslint.org/docs/rules/no-case-declarations + */ + "no-case-declarations": Linter.RuleEntry<[]>; + + /** + * Rule to disallow division operators explicitly at the beginning of regular expressions. + * + * @since 0.1.0 + * @see https://eslint.org/docs/rules/no-div-regex + */ + "no-div-regex": Linter.RuleEntry<[]>; + + /** + * Rule to disallow `else` blocks after `return` statements in `if` statements. + * + * @since 0.0.9 + * @see https://eslint.org/docs/rules/no-else-return + */ + "no-else-return": Linter.RuleEntry< + [ + Partial<{ + /** + * @default true + */ + allowElseIf: boolean; + }>, + ] + >; + + /** + * Rule to disallow empty functions. + * + * @since 2.0.0 + * @see https://eslint.org/docs/rules/no-empty-function + */ + "no-empty-function": Linter.RuleEntry< + [ + Partial<{ + /** + * @default [] + */ + allow: Array< + | "functions" + | "arrowFunctions" + | "generatorFunctions" + | "methods" + | "generatorMethods" + | "getters" + | "setters" + | "constructors" + >; + }>, + ] + >; + + /** + * Rule to disallow empty destructuring patterns. + * + * @remarks + * Recommended by ESLint, the rule was enabled in `eslint:recommended`. + * + * @since 1.7.0 + * @see https://eslint.org/docs/rules/no-empty-pattern + */ + "no-empty-pattern": Linter.RuleEntry<[]>; + + /** + * Rule to disallow `null` comparisons without type-checking operators. + * + * @since 0.0.9 + * @see https://eslint.org/docs/rules/no-eq-null + */ + "no-eq-null": Linter.RuleEntry<[]>; + + /** + * Rule to disallow the use of `eval()`. + * + * @since 0.0.2 + * @see https://eslint.org/docs/rules/no-eval + */ + "no-eval": Linter.RuleEntry< + [ + Partial<{ + /** + * @default false + */ + allowIndirect: boolean; + }>, + ] + >; + + /** + * Rule to disallow extending native types. + * + * @since 0.1.4 + * @see https://eslint.org/docs/rules/no-extend-native + */ + "no-extend-native": Linter.RuleEntry< + [ + Partial<{ + exceptions: string[]; + }>, + ] + >; + + /** + * Rule to disallow unnecessary calls to `.bind()`. + * + * @since 0.8.0 + * @see https://eslint.org/docs/rules/no-extra-bind + */ + "no-extra-bind": Linter.RuleEntry<[]>; + + /** + * Rule to disallow unnecessary labels. + * + * @since 2.0.0-rc.0 + * @see https://eslint.org/docs/rules/no-extra-label + */ + "no-extra-label": Linter.RuleEntry<[]>; + + /** + * Rule to disallow fallthrough of `case` statements. + * + * @remarks + * Recommended by ESLint, the rule was enabled in `eslint:recommended`. + * + * @since 0.0.7 + * @see https://eslint.org/docs/rules/no-fallthrough + */ + "no-fallthrough": Linter.RuleEntry< + [ + Partial<{ + /** + * @default 'falls?\s?through' + */ + commentPattern: string; + }>, + ] + >; + + /** + * Rule to disallow leading or trailing decimal points in numeric literals. + * + * @since 0.0.6 + * @see https://eslint.org/docs/rules/no-floating-decimal + */ + "no-floating-decimal": Linter.RuleEntry<[]>; + + /** + * Rule to disallow assignments to native objects or read-only global variables. + * + * @remarks + * Recommended by ESLint, the rule was enabled in `eslint:recommended`. + * + * @since 3.3.0 + * @see https://eslint.org/docs/rules/no-global-assign + */ + "no-global-assign": Linter.RuleEntry< + [ + Partial<{ + exceptions: string[]; + }>, + ] + >; + + /** + * Rule to disallow shorthand type conversions. + * + * @since 1.0.0-rc-2 + * @see https://eslint.org/docs/rules/no-implicit-coercion + */ + "no-implicit-coercion": Linter.RuleEntry< + [ + Partial<{ + /** + * @default true + */ + boolean: boolean; + /** + * @default true + */ + number: boolean; + /** + * @default true + */ + string: boolean; + /** + * @default [] + */ + allow: Array<"~" | "!!" | "+" | "*">; + }>, + ] + >; + + /** + * Rule to disallow variable and `function` declarations in the global scope. + * + * @since 2.0.0-alpha-1 + * @see https://eslint.org/docs/rules/no-implicit-globals + */ + "no-implicit-globals": Linter.RuleEntry<[]>; + + /** + * Rule to disallow the use of `eval()`-like methods. + * + * @since 0.0.7 + * @see https://eslint.org/docs/rules/no-implied-eval + */ + "no-implied-eval": Linter.RuleEntry<[]>; + + /** + * Rule to disallow `this` keywords outside of classes or class-like objects. + * + * @since 1.0.0-rc-2 + * @see https://eslint.org/docs/rules/no-invalid-this + */ + "no-invalid-this": Linter.RuleEntry<[]>; + + /** + * Rule to disallow the use of the `__iterator__` property. + * + * @since 0.0.9 + * @see https://eslint.org/docs/rules/no-iterator + */ + "no-iterator": Linter.RuleEntry<[]>; + + /** + * Rule to disallow labeled statements. + * + * @since 0.4.0 + * @see https://eslint.org/docs/rules/no-labels + */ + "no-labels": Linter.RuleEntry< + [ + Partial<{ + /** + * @default false + */ + allowLoop: boolean; + /** + * @default false + */ + allowSwitch: boolean; + }>, + ] + >; + + /** + * Rule to disallow unnecessary nested blocks. + * + * @since 0.4.0 + * @see https://eslint.org/docs/rules/no-lone-blocks + */ + "no-lone-blocks": Linter.RuleEntry<[]>; + + /** + * Rule to disallow function declarations that contain unsafe references inside loop statements. + * + * @since 0.0.9 + * @see https://eslint.org/docs/rules/no-loop-func + */ + "no-loop-func": Linter.RuleEntry<[]>; + + /** + * Rule to disallow magic numbers. + * + * @since 1.7.0 + * @see https://eslint.org/docs/rules/no-magic-numbers + */ + "no-magic-numbers": Linter.RuleEntry< + [ + Partial<{ + /** + * @default [] + */ + ignore: number[]; + /** + * @default false + */ + ignoreArrayIndexes: boolean; + /** + * @default false + */ + enforceConst: boolean; + /** + * @default false + */ + detectObjects: boolean; + }>, + ] + >; + + /** + * Rule to disallow multiple spaces. + * + * @since 0.9.0 + * @see https://eslint.org/docs/rules/no-multi-spaces + */ + "no-multi-spaces": Linter.RuleEntry< + [ + Partial<{ + /** + * @default false + */ + ignoreEOLComments: boolean; + /** + * @default { Property: true } + */ + exceptions: Record; + }>, + ] + >; + + /** + * Rule to disallow multiline strings. + * + * @since 0.0.9 + * @see https://eslint.org/docs/rules/no-multi-str + */ + "no-multi-str": Linter.RuleEntry<[]>; + + /** + * Rule to disallow `new` operators outside of assignments or comparisons. + * + * @since 0.0.7 + * @see https://eslint.org/docs/rules/no-new + */ + "no-new": Linter.RuleEntry<[]>; + + /** + * Rule to disallow `new` operators with the `Function` object. + * + * @since 0.0.7 + * @see https://eslint.org/docs/rules/no-new-func + */ + "no-new-func": Linter.RuleEntry<[]>; + + /** + * Rule to disallow `new` operators with the `String`, `Number`, and `Boolean` objects. + * + * @since 0.0.6 + * @see https://eslint.org/docs/rules/no-new-wrappers + */ + "no-new-wrappers": Linter.RuleEntry<[]>; + + /** + * Rule to disallow octal literals. + * + * @remarks + * Recommended by ESLint, the rule was enabled in `eslint:recommended`. + * + * @since 0.0.6 + * @see https://eslint.org/docs/rules/no-octal + */ + "no-octal": Linter.RuleEntry<[]>; + + /** + * Rule to disallow octal escape sequences in string literals. + * + * @since 0.0.9 + * @see https://eslint.org/docs/rules/no-octal-escape + */ + "no-octal-escape": Linter.RuleEntry<[]>; + + /** + * Rule to disallow reassigning `function` parameters. + * + * @since 0.18.0 + * @see https://eslint.org/docs/rules/no-param-reassign + */ + "no-param-reassign": Linter.RuleEntry< + [ + Partial<{ + /** + * @default false + */ + props: boolean; + /** + * @default [] + */ + ignorePropertyModificationsFor: string[]; + }>, + ] + >; + + /** + * Rule to disallow the use of the `__proto__` property. + * + * @since 0.0.9 + * @see https://eslint.org/docs/rules/no-proto + */ + "no-proto": Linter.RuleEntry<[]>; + + /** + * Rule to disallow variable redeclaration. + * + * @remarks + * Recommended by ESLint, the rule was enabled in `eslint:recommended`. + * + * @since 0.0.9 + * @see https://eslint.org/docs/rules/no-redeclare + */ + "no-redeclare": Linter.RuleEntry< + [ + Partial<{ + /** + * @default true + */ + builtinGlobals: boolean; + }>, + ] + >; + + /** + * Rule to disallow certain properties on certain objects. + * + * @since 3.5.0 + * @see https://eslint.org/docs/rules/no-restricted-properties + */ + "no-restricted-properties": Linter.RuleEntry< + [ + ...Array< + | { + object: string; + property?: string | undefined; + message?: string | undefined; + } + | { + property: string; + message?: string | undefined; + } + > + ] + >; + + /** + * Rule to disallow assignment operators in `return` statements. + * + * @since 0.0.9 + * @see https://eslint.org/docs/rules/no-return-assign + */ + "no-return-assign": Linter.RuleEntry<["except-parens" | "always"]>; + + /** + * Rule to disallow unnecessary `return await`. + * + * @since 3.10.0 + * @see https://eslint.org/docs/rules/no-return-await + */ + "no-return-await": Linter.RuleEntry<[]>; + + /** + * Rule to disallow `javascript:` urls. + * + * @since 0.0.9 + * @see https://eslint.org/docs/rules/no-script-url + */ + "no-script-url": Linter.RuleEntry<[]>; + + /** + * Rule to disallow assignments where both sides are exactly the same. + * + * @remarks + * Recommended by ESLint, the rule was enabled in `eslint:recommended`. + * + * @since 2.0.0-rc.0 + * @see https://eslint.org/docs/rules/no-self-assign + */ + "no-self-assign": Linter.RuleEntry<[]>; + + /** + * Rule to disallow comparisons where both sides are exactly the same. + * + * @since 0.0.9 + * @see https://eslint.org/docs/rules/no-self-compare + */ + "no-self-compare": Linter.RuleEntry<[]>; + + /** + * Rule to disallow comma operators. + * + * @since 0.5.1 + * @see https://eslint.org/docs/rules/no-sequences + */ + "no-sequences": Linter.RuleEntry<[]>; + + /** + * Rule to disallow throwing literals as exceptions. + * + * @since 0.15.0 + * @see https://eslint.org/docs/rules/no-throw-literal + */ + "no-throw-literal": Linter.RuleEntry<[]>; + + /** + * Rule to disallow unmodified loop conditions. + * + * @since 2.0.0-alpha-2 + * @see https://eslint.org/docs/rules/no-unmodified-loop-condition + */ + "no-unmodified-loop-condition": Linter.RuleEntry<[]>; + + /** + * Rule to disallow unused expressions. + * + * @since 0.1.0 + * @see https://eslint.org/docs/rules/no-unused-expressions + */ + "no-unused-expressions": Linter.RuleEntry< + [ + Partial<{ + /** + * @default false + */ + allowShortCircuit: boolean; + /** + * @default false + */ + allowTernary: boolean; + /** + * @default false + */ + allowTaggedTemplates: boolean; + }>, + ] + >; + + /** + * Rule to disallow unused labels. + * + * @remarks + * Recommended by ESLint, the rule was enabled in `eslint:recommended`. + * + * @since 2.0.0-rc.0 + * @see https://eslint.org/docs/rules/no-unused-labels + */ + "no-unused-labels": Linter.RuleEntry<[]>; + + /** + * Rule to disallow unnecessary calls to `.call()` and `.apply()`. + * + * @since 1.0.0-rc-1 + * @see https://eslint.org/docs/rules/no-useless-call + */ + "no-useless-call": Linter.RuleEntry<[]>; + + /** + * Rule to disallow unnecessary `catch` clauses. + * + * @remarks + * Recommended by ESLint, the rule was enabled in `eslint:recommended`. + * + * @since 5.11.0 + * @see https://eslint.org/docs/rules/no-useless-catch + */ + "no-useless-catch": Linter.RuleEntry<[]>; + + /** + * Rule to disallow unnecessary concatenation of literals or template literals. + * + * @since 1.3.0 + * @see https://eslint.org/docs/rules/no-useless-concat + */ + "no-useless-concat": Linter.RuleEntry<[]>; + + /** + * Rule to disallow unnecessary escape characters. + * + * @remarks + * Recommended by ESLint, the rule was enabled in `eslint:recommended`. + * + * @since 2.5.0 + * @see https://eslint.org/docs/rules/no-useless-escape + */ + "no-useless-escape": Linter.RuleEntry<[]>; + + /** + * Rule to disallow redundant return statements. + * + * @since 3.9.0 + * @see https://eslint.org/docs/rules/no-useless-return + */ + "no-useless-return": Linter.RuleEntry<[]>; + + /** + * Rule to disallow `void` operators. + * + * @since 0.8.0 + * @see https://eslint.org/docs/rules/no-void + */ + "no-void": Linter.RuleEntry<[]>; + + /** + * Rule to disallow specified warning terms in comments. + * + * @since 0.4.4 + * @see https://eslint.org/docs/rules/no-warning-comments + */ + "no-warning-comments": Linter.RuleEntry< + [ + { + /** + * @default ["todo", "fixme", "xxx"] + */ + terms: string[]; + /** + * @default 'start' + */ + location: "start" | "anywhere"; + }, + ] + >; + + /** + * Rule to disallow `with` statements. + * + * @remarks + * Recommended by ESLint, the rule was enabled in `eslint:recommended`. + * + * @since 0.0.2 + * @see https://eslint.org/docs/rules/no-with + */ + "no-with": Linter.RuleEntry<[]>; + + /** + * Rule to enforce using named capture group in regular expression. + * + * @since 5.15.0 + * @see https://eslint.org/docs/rules/prefer-named-capture-group + */ + "prefer-named-capture-group": Linter.RuleEntry<[]>; + + /** + * Rule to require using Error objects as Promise rejection reasons. + * + * @since 3.14.0 + * @see https://eslint.org/docs/rules/prefer-promise-reject-errors + */ + "prefer-promise-reject-errors": Linter.RuleEntry< + [ + Partial<{ + /** + * @default false + */ + allowEmptyReject: boolean; + }>, + ] + >; + + /** + * Rule to enforce the consistent use of the radix argument when using `parseInt()`. + * + * @since 0.0.7 + * @see https://eslint.org/docs/rules/radix + */ + radix: Linter.RuleEntry<["always" | "as-needed"]>; + + /** + * Rule to disallow async functions which have no `await` expression. + * + * @since 3.11.0 + * @see https://eslint.org/docs/rules/require-await + */ + "require-await": Linter.RuleEntry<[]>; + + /** + * Rule to enforce the use of `u` flag on RegExp. + * + * @since 5.3.0 + * @see https://eslint.org/docs/rules/require-unicode-regexp + */ + "require-unicode-regexp": Linter.RuleEntry<[]>; + + /** + * Rule to require `var` declarations be placed at the top of their containing scope. + * + * @since 0.8.0 + * @see https://eslint.org/docs/rules/vars-on-top + */ + "vars-on-top": Linter.RuleEntry<[]>; + + /** + * Rule to require parentheses around immediate `function` invocations. + * + * @since 0.0.9 + * @see https://eslint.org/docs/rules/wrap-iife + */ + "wrap-iife": Linter.RuleEntry< + [ + "outside" | "inside" | "any", + Partial<{ + /** + * @default false + */ + functionPrototypeMethods: boolean; + }>, + ] + >; + + /** + * Rule to require or disallow “Yoda” conditions. + * + * @since 0.7.1 + * @see https://eslint.org/docs/rules/yoda + */ + yoda: + | Linter.RuleEntry< + [ + "never", + Partial<{ + exceptRange: boolean; + onlyEquality: boolean; + }>, + ] + > + | Linter.RuleEntry<["always"]>; +} diff --git a/node_modules/@types/eslint/rules/deprecated.d.ts b/node_modules/@types/eslint/rules/deprecated.d.ts new file mode 100644 index 0000000..f18607c --- /dev/null +++ b/node_modules/@types/eslint/rules/deprecated.d.ts @@ -0,0 +1,267 @@ +import { Linter } from "../index"; + +export interface Deprecated extends Linter.RulesRecord { + /** + * Rule to enforce consistent indentation. + * + * @since 4.0.0-alpha.0 + * @deprecated since 4.0.0, use [`indent`](https://eslint.org/docs/rules/indent) instead. + * @see https://eslint.org/docs/rules/indent-legacy + */ + "indent-legacy": Linter.RuleEntry< + [ + number | "tab", + Partial<{ + /** + * @default 0 + */ + SwitchCase: number; + /** + * @default 1 + */ + VariableDeclarator: + | Partial<{ + /** + * @default 1 + */ + var: number | "first"; + /** + * @default 1 + */ + let: number | "first"; + /** + * @default 1 + */ + const: number | "first"; + }> + | number + | "first"; + /** + * @default 1 + */ + outerIIFEBody: number; + /** + * @default 1 + */ + MemberExpression: number | "off"; + /** + * @default { parameters: 1, body: 1 } + */ + FunctionDeclaration: Partial<{ + /** + * @default 1 + */ + parameters: number | "first" | "off"; + /** + * @default 1 + */ + body: number; + }>; + /** + * @default { parameters: 1, body: 1 } + */ + FunctionExpression: Partial<{ + /** + * @default 1 + */ + parameters: number | "first" | "off"; + /** + * @default 1 + */ + body: number; + }>; + /** + * @default { arguments: 1 } + */ + CallExpression: Partial<{ + /** + * @default 1 + */ + arguments: number | "first" | "off"; + }>; + /** + * @default 1 + */ + ArrayExpression: number | "first" | "off"; + /** + * @default 1 + */ + ObjectExpression: number | "first" | "off"; + /** + * @default 1 + */ + ImportDeclaration: number | "first" | "off"; + /** + * @default false + */ + flatTernaryExpressions: boolean; + ignoredNodes: string[]; + /** + * @default false + */ + ignoreComments: boolean; + }>, + ] + >; + + /** + * Rule to require or disallow newlines around directives. + * + * @since 3.5.0 + * @deprecated since 4.0.0, use [`padding-line-between-statements`](https://eslint.org/docs/rules/padding-line-between-statements) instead. + * @see https://eslint.org/docs/rules/lines-around-directive + */ + "lines-around-directive": Linter.RuleEntry<["always" | "never"]>; + + /** + * Rule to require or disallow an empty line after variable declarations. + * + * @since 0.18.0 + * @deprecated since 4.0.0, use [`padding-line-between-statements`](https://eslint.org/docs/rules/padding-line-between-statements) instead. + * @see https://eslint.org/docs/rules/newline-after-var + */ + "newline-after-var": Linter.RuleEntry<["always" | "never"]>; + + /** + * Rule to require an empty line before `return` statements. + * + * @since 2.3.0 + * @deprecated since 4.0.0, use [`padding-line-between-statements`](https://eslint.org/docs/rules/padding-line-between-statements) instead. + * @see https://eslint.org/docs/rules/newline-before-return + */ + "newline-before-return": Linter.RuleEntry<[]>; + + /** + * Rule to disallow shadowing of variables inside of `catch`. + * + * @since 0.0.9 + * @deprecated since 5.1.0, use [`no-shadow`](https://eslint.org/docs/rules/no-shadow) instead. + * @see https://eslint.org/docs/rules/no-catch-shadow + */ + "no-catch-shadow": Linter.RuleEntry<[]>; + + /** + * Rule to disallow reassignment of native objects. + * + * @since 0.0.9 + * @deprecated since 3.3.0, use [`no-global-assign`](https://eslint.org/docs/rules/no-global-assign) instead. + * @see https://eslint.org/docs/rules/no-native-reassign + */ + "no-native-reassign": Linter.RuleEntry< + [ + Partial<{ + exceptions: string[]; + }>, + ] + >; + + /** + * Rule to disallow negating the left operand in `in` expressions. + * + * @since 0.1.2 + * @deprecated since 3.3.0, use [`no-unsafe-negation`](https://eslint.org/docs/rules/no-unsafe-negation) instead. + * @see https://eslint.org/docs/rules/no-negated-in-lhs + */ + "no-negated-in-lhs": Linter.RuleEntry<[]>; + + /** + * Rule to disallow spacing between function identifiers and their applications. + * + * @since 0.1.2 + * @deprecated since 3.3.0, use [`func-call-spacing`](https://eslint.org/docs/rules/func-call-spacing) instead. + * @see https://eslint.org/docs/rules/no-spaced-func + */ + "no-spaced-func": Linter.RuleEntry<[]>; + + /** + * Rule to suggest using `Reflect` methods where applicable. + * + * @since 1.0.0-rc-2 + * @deprecated since 3.9.0 + * @see https://eslint.org/docs/rules/prefer-reflect + */ + "prefer-reflect": Linter.RuleEntry< + [ + Partial<{ + exceptions: string[]; + }>, + ] + >; + + /** + * Rule to require JSDoc comments. + * + * @since 1.4.0 + * @deprecated since 5.10.0 + * @see https://eslint.org/docs/rules/require-jsdoc + */ + "require-jsdoc": Linter.RuleEntry< + [ + Partial<{ + require: Partial<{ + /** + * @default true + */ + FunctionDeclaration: boolean; + /** + * @default false + */ + MethodDefinition: boolean; + /** + * @default false + */ + ClassDeclaration: boolean; + /** + * @default false + */ + ArrowFunctionExpression: boolean; + /** + * @default false + */ + FunctionExpression: boolean; + }>; + }>, + ] + >; + + /** + * Rule to enforce valid JSDoc comments. + * + * @since 0.4.0 + * @deprecated since 5.10.0 + * @see https://eslint.org/docs/rules/valid-jsdoc + */ + "valid-jsdoc": Linter.RuleEntry< + [ + Partial<{ + prefer: Record; + preferType: Record; + /** + * @default true + */ + requireReturn: boolean; + /** + * @default true + */ + requireReturnType: boolean; + /** + * @remarks + * Also accept for regular expression pattern + */ + matchDescription: string; + /** + * @default true + */ + requireParamDescription: boolean; + /** + * @default true + */ + requireReturnDescription: boolean; + /** + * @default true + */ + requireParamType: boolean; + }>, + ] + >; +} diff --git a/node_modules/@types/eslint/rules/ecmascript-6.d.ts b/node_modules/@types/eslint/rules/ecmascript-6.d.ts new file mode 100644 index 0000000..966f359 --- /dev/null +++ b/node_modules/@types/eslint/rules/ecmascript-6.d.ts @@ -0,0 +1,502 @@ +import { Linter } from "../index"; + +export interface ECMAScript6 extends Linter.RulesRecord { + /** + * Rule to require braces around arrow function bodies. + * + * @since 1.8.0 + * @see https://eslint.org/docs/rules/arrow-body-style + */ + "arrow-body-style": + | Linter.RuleEntry< + [ + "as-needed", + Partial<{ + /** + * @default false + */ + requireReturnForObjectLiteral: boolean; + }>, + ] + > + | Linter.RuleEntry<["always" | "never"]>; + + /** + * Rule to require parentheses around arrow function arguments. + * + * @since 1.0.0-rc-1 + * @see https://eslint.org/docs/rules/arrow-parens + */ + "arrow-parens": + | Linter.RuleEntry<["always"]> + | Linter.RuleEntry< + [ + "as-needed", + Partial<{ + /** + * @default false + */ + requireForBlockBody: boolean; + }>, + ] + >; + + /** + * Rule to enforce consistent spacing before and after the arrow in arrow functions. + * + * @since 1.0.0-rc-1 + * @see https://eslint.org/docs/rules/arrow-spacing + */ + "arrow-spacing": Linter.RuleEntry<[]>; + + /** + * Rule to require `super()` calls in constructors. + * + * @remarks + * Recommended by ESLint, the rule was enabled in `eslint:recommended`. + * + * @since 0.24.0 + * @see https://eslint.org/docs/rules/constructor-super + */ + "constructor-super": Linter.RuleEntry<[]>; + + /** + * Rule to enforce consistent spacing around `*` operators in generator functions. + * + * @since 0.17.0 + * @see https://eslint.org/docs/rules/generator-star-spacing + */ + "generator-star-spacing": Linter.RuleEntry< + [ + | Partial<{ + before: boolean; + after: boolean; + named: + | Partial<{ + before: boolean; + after: boolean; + }> + | "before" + | "after" + | "both" + | "neither"; + anonymous: + | Partial<{ + before: boolean; + after: boolean; + }> + | "before" + | "after" + | "both" + | "neither"; + method: + | Partial<{ + before: boolean; + after: boolean; + }> + | "before" + | "after" + | "both" + | "neither"; + }> + | "before" + | "after" + | "both" + | "neither", + ] + >; + + /** + * Rule to disallow reassigning class members. + * + * @remarks + * Recommended by ESLint, the rule was enabled in `eslint:recommended`. + * + * @since 1.0.0-rc-1 + * @see https://eslint.org/docs/rules/no-class-assign + */ + "no-class-assign": Linter.RuleEntry<[]>; + + /** + * Rule to disallow arrow functions where they could be confused with comparisons. + * + * @since 2.0.0-alpha-2 + * @see https://eslint.org/docs/rules/no-confusing-arrow + */ + "no-confusing-arrow": Linter.RuleEntry< + [ + Partial<{ + /** + * @default true + */ + allowParens: boolean; + }>, + ] + >; + + /** + * Rule to disallow reassigning `const` variables. + * + * @remarks + * Recommended by ESLint, the rule was enabled in `eslint:recommended`. + * + * @since 1.0.0-rc-1 + * @see https://eslint.org/docs/rules/no-const-assign + */ + "no-const-assign": Linter.RuleEntry<[]>; + + /** + * Rule to disallow duplicate class members. + * + * @remarks + * Recommended by ESLint, the rule was enabled in `eslint:recommended`. + * + * @since 1.2.0 + * @see https://eslint.org/docs/rules/no-dupe-class-members + */ + "no-dupe-class-members": Linter.RuleEntry<[]>; + + /** + * Rule to disallow duplicate module imports. + * + * @since 2.5.0 + * @see https://eslint.org/docs/rules/no-duplicate-import + */ + "no-duplicate-import": Linter.RuleEntry< + [ + Partial<{ + /** + * @default false + */ + includeExports: boolean; + }>, + ] + >; + + /** + * Rule to disallow `new` operators with the `Symbol` object. + * + * @remarks + * Recommended by ESLint, the rule was enabled in `eslint:recommended`. + * + * @since 2.0.0-beta.1 + * @see https://eslint.org/docs/rules/no-new-symbol + */ + "no-new-symbol": Linter.RuleEntry<[]>; + + /** + * Rule to disallow specified modules when loaded by `import`. + * + * @since 2.0.0-alpha-1 + * @see https://eslint.org/docs/rules/no-restricted-imports + */ + "no-restricted-imports": Linter.RuleEntry< + [ + ...Array< + | string + | { + name: string; + importNames?: string[] | undefined; + message?: string | undefined; + } + | Partial<{ + paths: Array< + | string + | { + name: string; + importNames?: string[] | undefined; + message?: string | undefined; + } + >; + patterns: string[]; + }> + > + ] + >; + + /** + * Rule to disallow `this`/`super` before calling `super()` in constructors. + * + * @remarks + * Recommended by ESLint, the rule was enabled in `eslint:recommended`. + * + * @since 0.24.0 + * @see https://eslint.org/docs/rules/no-this-before-super + */ + "no-this-before-super": Linter.RuleEntry<[]>; + + /** + * Rule to disallow unnecessary computed property keys in object literals. + * + * @since 2.9.0 + * @see https://eslint.org/docs/rules/no-useless-computed-key + */ + "no-useless-computed-key": Linter.RuleEntry<[]>; + + /** + * Rule to disallow unnecessary constructors. + * + * @since 2.0.0-beta.1 + * @see https://eslint.org/docs/rules/no-useless-constructor + */ + "no-useless-constructor": Linter.RuleEntry<[]>; + + /** + * Rule to disallow renaming import, export, and destructured assignments to the same name. + * + * @since 2.11.0 + * @see https://eslint.org/docs/rules/no-useless-rename + */ + "no-useless-rename": Linter.RuleEntry< + [ + Partial<{ + /** + * @default false + */ + ignoreImport: boolean; + /** + * @default false + */ + ignoreExport: boolean; + /** + * @default false + */ + ignoreDestructuring: boolean; + }>, + ] + >; + + /** + * Rule to require `let` or `const` instead of `var`. + * + * @since 0.12.0 + * @see https://eslint.org/docs/rules/no-var + */ + "no-var": Linter.RuleEntry<[]>; + + /** + * Rule to require or disallow method and property shorthand syntax for object literals. + * + * @since 0.20.0 + * @see https://eslint.org/docs/rules/object-shorthand + */ + "object-shorthand": + | Linter.RuleEntry< + [ + "always" | "methods", + Partial<{ + /** + * @default false + */ + avoidQuotes: boolean; + /** + * @default false + */ + ignoreConstructors: boolean; + /** + * @default false + */ + avoidExplicitReturnArrows: boolean; + }>, + ] + > + | Linter.RuleEntry< + [ + "properties", + Partial<{ + /** + * @default false + */ + avoidQuotes: boolean; + }>, + ] + > + | Linter.RuleEntry<["never" | "consistent" | "consistent-as-needed"]>; + + /** + * Rule to require using arrow functions for callbacks. + * + * @since 1.2.0 + * @see https://eslint.org/docs/rules/prefer-arrow-callback + */ + "prefer-arrow-callback": Linter.RuleEntry< + [ + Partial<{ + /** + * @default false + */ + allowNamedFunctions: boolean; + /** + * @default true + */ + allowUnboundThis: boolean; + }>, + ] + >; + + /** + * Rule to require `const` declarations for variables that are never reassigned after declared. + * + * @since 0.23.0 + * @see https://eslint.org/docs/rules/prefer-const + */ + "prefer-const": Linter.RuleEntry< + [ + Partial<{ + /** + * @default 'any' + */ + destructuring: "any" | "all"; + /** + * @default false + */ + ignoreReadBeforeAssign: boolean; + }>, + ] + >; + + /** + * Rule to require destructuring from arrays and/or objects. + * + * @since 3.13.0 + * @see https://eslint.org/docs/rules/prefer-destructuring + */ + "prefer-destructuring": Linter.RuleEntry< + [ + Partial< + | { + VariableDeclarator: Partial<{ + array: boolean; + object: boolean; + }>; + AssignmentExpression: Partial<{ + array: boolean; + object: boolean; + }>; + } + | { + array: boolean; + object: boolean; + } + >, + Partial<{ + enforceForRenamedProperties: boolean; + }>, + ] + >; + + /** + * Rule to disallow `parseInt()` and `Number.parseInt()` in favor of binary, octal, and hexadecimal literals. + * + * @since 3.5.0 + * @see https://eslint.org/docs/rules/prefer-numeric-literals + */ + "prefer-numeric-literals": Linter.RuleEntry<[]>; + + /** + * Rule to require rest parameters instead of `arguments`. + * + * @since 2.0.0-alpha-1 + * @see https://eslint.org/docs/rules/prefer-rest-params + */ + "prefer-rest-params": Linter.RuleEntry<[]>; + + /** + * Rule to require spread operators instead of `.apply()`. + * + * @since 1.0.0-rc-1 + * @see https://eslint.org/docs/rules/prefer-spread + */ + "prefer-spread": Linter.RuleEntry<[]>; + + /** + * Rule to require template literals instead of string concatenation. + * + * @since 1.2.0 + * @see https://eslint.org/docs/rules/prefer-template + */ + "prefer-template": Linter.RuleEntry<[]>; + + /** + * Rule to require generator functions to contain `yield`. + * + * @remarks + * Recommended by ESLint, the rule was enabled in `eslint:recommended`. + * + * @since 1.0.0-rc-1 + * @see https://eslint.org/docs/rules/require-yield + */ + "require-yield": Linter.RuleEntry<[]>; + + /** + * Rule to enforce spacing between rest and spread operators and their expressions. + * + * @since 2.12.0 + * @see https://eslint.org/docs/rules/rest-spread-spacing + */ + "rest-spread-spacing": Linter.RuleEntry<["never" | "always"]>; + + /** + * Rule to enforce sorted import declarations within modules. + * + * @since 2.0.0-beta.1 + * @see https://eslint.org/docs/rules/sort-imports + */ + "sort-imports": Linter.RuleEntry< + [ + Partial<{ + /** + * @default false + */ + ignoreCase: boolean; + /** + * @default false + */ + ignoreDeclarationSort: boolean; + /** + * @default false + */ + ignoreMemberSort: boolean; + /** + * @default ['none', 'all', 'multiple', 'single'] + */ + memberSyntaxSortOrder: Array<"none" | "all" | "multiple" | "single">; + }>, + ] + >; + + /** + * Rule to require symbol descriptions. + * + * @since 3.4.0 + * @see https://eslint.org/docs/rules/symbol-description + */ + "symbol-description": Linter.RuleEntry<[]>; + + /** + * Rule to require or disallow spacing around embedded expressions of template strings. + * + * @since 2.0.0-rc.0 + * @see https://eslint.org/docs/rules/template-curly-spacing + */ + "template-curly-spacing": Linter.RuleEntry<["never" | "always"]>; + + /** + * Rule to require or disallow spacing around the `*` in `yield*` expressions. + * + * @since 2.0.0-alpha-1 + * @see https://eslint.org/docs/rules/yield-star-spacing + */ + "yield-star-spacing": Linter.RuleEntry< + [ + | Partial<{ + before: boolean; + after: boolean; + }> + | "before" + | "after" + | "both" + | "neither", + ] + >; +} diff --git a/node_modules/@types/eslint/rules/index.d.ts b/node_modules/@types/eslint/rules/index.d.ts new file mode 100644 index 0000000..e0f517b --- /dev/null +++ b/node_modules/@types/eslint/rules/index.d.ts @@ -0,0 +1,21 @@ +import { Linter } from "../index"; + +import { BestPractices } from "./best-practices"; +import { Deprecated } from "./deprecated"; +import { ECMAScript6 } from "./ecmascript-6"; +import { NodeJSAndCommonJS } from "./node-commonjs"; +import { PossibleErrors } from "./possible-errors"; +import { StrictMode } from "./strict-mode"; +import { StylisticIssues } from "./stylistic-issues"; +import { Variables } from "./variables"; + +export interface ESLintRules + extends Linter.RulesRecord, + PossibleErrors, + BestPractices, + StrictMode, + Variables, + NodeJSAndCommonJS, + StylisticIssues, + ECMAScript6, + Deprecated {} diff --git a/node_modules/@types/eslint/rules/node-commonjs.d.ts b/node_modules/@types/eslint/rules/node-commonjs.d.ts new file mode 100644 index 0000000..c248029 --- /dev/null +++ b/node_modules/@types/eslint/rules/node-commonjs.d.ts @@ -0,0 +1,133 @@ +import { Linter } from "../index"; + +export interface NodeJSAndCommonJS extends Linter.RulesRecord { + /** + * Rule to require `return` statements after callbacks. + * + * @since 1.0.0-rc-1 + * @see https://eslint.org/docs/rules/callback-return + */ + "callback-return": Linter.RuleEntry<[string[]]>; + + /** + * Rule to require `require()` calls to be placed at top-level module scope. + * + * @since 1.4.0 + * @see https://eslint.org/docs/rules/global-require + */ + "global-require": Linter.RuleEntry<[]>; + + /** + * Rule to require error handling in callbacks. + * + * @since 0.4.5 + * @see https://eslint.org/docs/rules/handle-callback-err + */ + "handle-callback-err": Linter.RuleEntry<[string]>; + + /** + * Rule to disallow use of the `Buffer()` constructor. + * + * @since 4.0.0-alpha.0 + * @see https://eslint.org/docs/rules/no-buffer-constructor + */ + "no-buffer-constructor": Linter.RuleEntry<[]>; + + /** + * Rule to disallow `require` calls to be mixed with regular variable declarations. + * + * @since 0.0.9 + * @see https://eslint.org/docs/rules/no-mixed-requires + */ + "no-mixed-requires": Linter.RuleEntry< + [ + Partial<{ + /** + * @default false + */ + grouping: boolean; + /** + * @default false + */ + allowCall: boolean; + }>, + ] + >; + + /** + * Rule to disallow `new` operators with calls to `require`. + * + * @since 0.6.0 + * @see https://eslint.org/docs/rules/no-new-require + */ + "no-new-require": Linter.RuleEntry<[]>; + + /** + * Rule to disallow string concatenation when using `__dirname` and `__filename`. + * + * @since 0.4.0 + * @see https://eslint.org/docs/rules/no-path-concat + */ + "no-path-concat": Linter.RuleEntry<[]>; + + /** + * Rule to disallow the use of `process.env`. + * + * @since 0.9.0 + * @see https://eslint.org/docs/rules/no-process-env + */ + "no-process-env": Linter.RuleEntry<[]>; + + /** + * Rule to disallow the use of `process.exit()`. + * + * @since 0.4.0 + * @see https://eslint.org/docs/rules/no-process-exit + */ + "no-process-exit": Linter.RuleEntry<[]>; + + /** + * Rule to disallow specified modules when loaded by `require`. + * + * @since 0.6.0 + * @see https://eslint.org/docs/rules/no-restricted-modules + */ + "no-restricted-modules": Linter.RuleEntry< + [ + ...Array< + | string + | { + name: string; + message?: string | undefined; + } + | Partial<{ + paths: Array< + | string + | { + name: string; + message?: string | undefined; + } + >; + patterns: string[]; + }> + > + ] + >; + + /** + * Rule to disallow synchronous methods. + * + * @since 0.0.9 + * @see https://eslint.org/docs/rules/no-sync + */ + "no-sync": Linter.RuleEntry< + [ + { + /** + * @default false + */ + allowAtRootLevel: boolean; + }, + ] + >; +} diff --git a/node_modules/@types/eslint/rules/possible-errors.d.ts b/node_modules/@types/eslint/rules/possible-errors.d.ts new file mode 100644 index 0000000..c27a862 --- /dev/null +++ b/node_modules/@types/eslint/rules/possible-errors.d.ts @@ -0,0 +1,484 @@ +import { Linter } from "../index"; + +export interface PossibleErrors extends Linter.RulesRecord { + /** + * Rule to enforce `for` loop update clause moving the counter in the right direction. + * + * @remarks + * Recommended by ESLint, the rule was enabled in `eslint:recommended`. + * + * @since 4.0.0-beta.0 + * @see https://eslint.org/docs/rules/for-direction + */ + "for-direction": Linter.RuleEntry<[]>; + + /** + * Rule to enforce `return` statements in getters. + * + * @remarks + * Recommended by ESLint, the rule was enabled in `eslint:recommended`. + * + * @since 4.2.0 + * @see https://eslint.org/docs/rules/getter-return + */ + "getter-return": Linter.RuleEntry< + [ + Partial<{ + /** + * @default false + */ + allowImplicit: boolean; + }>, + ] + >; + + /** + * Rule to disallow using an async function as a `Promise` executor. + * + * @remarks + * Recommended by ESLint, the rule was enabled in `eslint:recommended`. + * + * @since 5.3.0 + * @see https://eslint.org/docs/rules/no-async-promise-executor + */ + "no-async-promise-executor": Linter.RuleEntry<[]>; + + /** + * Rule to disallow `await` inside of loops. + * + * @since 3.12.0 + * @see https://eslint.org/docs/rules/no-await-in-loop + */ + "no-await-in-loop": Linter.RuleEntry<[]>; + + /** + * Rule to disallow comparing against `-0`. + * + * @remarks + * Recommended by ESLint, the rule was enabled in `eslint:recommended`. + * + * @since 3.17.0 + * @see https://eslint.org/docs/rules/no-compare-neg-zero + */ + "no-compare-neg-zero": Linter.RuleEntry<[]>; + + /** + * Rule to disallow assignment operators in conditional statements. + * + * @remarks + * Recommended by ESLint, the rule was enabled in `eslint:recommended`. + * + * @since 0.0.9 + * @see https://eslint.org/docs/rules/no-cond-assign + */ + "no-cond-assign": Linter.RuleEntry<["except-parens" | "always"]>; + + /** + * Rule to disallow the use of `console`. + * + * @since 0.0.2 + * @see https://eslint.org/docs/rules/no-console + */ + "no-console": Linter.RuleEntry< + [ + Partial<{ + allow: Array; + }>, + ] + >; + + /** + * Rule to disallow constant expressions in conditions. + * + * @remarks + * Recommended by ESLint, the rule was enabled in `eslint:recommended`. + * + * @since 0.4.1 + * @see https://eslint.org/docs/rules/no-constant-condition + */ + "no-constant-condition": Linter.RuleEntry< + [ + { + /** + * @default true + */ + checkLoops: boolean; + }, + ] + >; + + /** + * Rule to disallow control characters in regular expressions. + * + * @remarks + * Recommended by ESLint, the rule was enabled in `eslint:recommended`. + * + * @since 0.1.0 + * @see https://eslint.org/docs/rules/no-control-regex + */ + "no-control-regex": Linter.RuleEntry<[]>; + + /** + * Rule to disallow the use of `debugger`. + * + * @remarks + * Recommended by ESLint, the rule was enabled in `eslint:recommended`. + * + * @since 0.0.2 + * @see https://eslint.org/docs/rules/no-debugger + */ + "no-debugger": Linter.RuleEntry<[]>; + + /** + * Rule to disallow duplicate arguments in `function` definitions. + * + * @remarks + * Recommended by ESLint, the rule was enabled in `eslint:recommended`. + * + * @since 0.16.0 + * @see https://eslint.org/docs/rules/no-dupe-args + */ + "no-dupe-args": Linter.RuleEntry<[]>; + + /** + * Rule to disallow duplicate keys in object literals. + * + * @remarks + * Recommended by ESLint, the rule was enabled in `eslint:recommended`. + * + * @since 0.0.9 + * @see https://eslint.org/docs/rules/no-dupe-keys + */ + "no-dupe-keys": Linter.RuleEntry<[]>; + + /** + * Rule to disallow a duplicate case label. + * + * @remarks + * Recommended by ESLint, the rule was enabled in `eslint:recommended`. + * + * @since 0.17.0 + * @see https://eslint.org/docs/rules/no-duplicate-case + */ + "no-duplicate-case": Linter.RuleEntry<[]>; + + /** + * Rule to disallow empty block statements. + * + * @remarks + * Recommended by ESLint, the rule was enabled in `eslint:recommended`. + * + * @since 0.0.2 + * @see https://eslint.org/docs/rules/no-empty + */ + "no-empty": Linter.RuleEntry< + [ + Partial<{ + /** + * @default false + */ + allowEmptyCatch: boolean; + }>, + ] + >; + + /** + * Rule to disallow empty character classes in regular expressions. + * + * @remarks + * Recommended by ESLint, the rule was enabled in `eslint:recommended`. + * + * @since 0.22.0 + * @see https://eslint.org/docs/rules/no-empty-character-class + */ + "no-empty-character-class": Linter.RuleEntry<[]>; + + /** + * Rule to disallow reassigning exceptions in `catch` clauses. + * + * @remarks + * Recommended by ESLint, the rule was enabled in `eslint:recommended`. + * + * @since 0.0.9 + * @see https://eslint.org/docs/rules/no-ex-assign + */ + "no-ex-assign": Linter.RuleEntry<[]>; + + /** + * Rule to disallow unnecessary boolean casts. + * + * @remarks + * Recommended by ESLint, the rule was enabled in `eslint:recommended`. + * + * @since 0.4.0 + * @see https://eslint.org/docs/rules/no-extra-boolean-cast + */ + "no-extra-boolean-cast": Linter.RuleEntry<[]>; + + /** + * Rule to disallow unnecessary parentheses. + * + * @since 0.1.4 + * @see https://eslint.org/docs/rules/no-extra-parens + */ + "no-extra-parens": + | Linter.RuleEntry< + [ + "all", + Partial<{ + /** + * @default true, + */ + conditionalAssign: boolean; + /** + * @default true + */ + returnAssign: boolean; + /** + * @default true + */ + nestedBinaryExpressions: boolean; + /** + * @default 'none' + */ + ignoreJSX: "none" | "all" | "multi-line" | "single-line"; + /** + * @default true + */ + enforceForArrowConditionals: boolean; + }>, + ] + > + | Linter.RuleEntry<["functions"]>; + + /** + * Rule to disallow unnecessary semicolons. + * + * @remarks + * Recommended by ESLint, the rule was enabled in `eslint:recommended`. + * + * @since 0.0.9 + * @see https://eslint.org/docs/rules/no-extra-semi + */ + "no-extra-semi": Linter.RuleEntry<[]>; + + /** + * Rule to disallow reassigning `function` declarations. + * + * @remarks + * Recommended by ESLint, the rule was enabled in `eslint:recommended`. + * + * @since 0.0.9 + * @see https://eslint.org/docs/rules/no-func-assign + */ + "no-func-assign": Linter.RuleEntry<[]>; + + /** + * Rule to disallow variable or `function` declarations in nested blocks. + * + * @remarks + * Recommended by ESLint, the rule was enabled in `eslint:recommended`. + * + * @since 0.6.0 + * @see https://eslint.org/docs/rules/no-inner-declarations + */ + "no-inner-declarations": Linter.RuleEntry<["functions" | "both"]>; + + /** + * Rule to disallow invalid regular expression strings in `RegExp` constructors. + * + * @remarks + * Recommended by ESLint, the rule was enabled in `eslint:recommended`. + * + * @since 0.1.4 + * @see https://eslint.org/docs/rules/no-invalid-regexp + */ + "no-invalid-regexp": Linter.RuleEntry< + [ + Partial<{ + allowConstructorFlags: string[]; + }>, + ] + >; + + /** + * Rule to disallow irregular whitespace. + * + * @remarks + * Recommended by ESLint, the rule was enabled in `eslint:recommended`. + * + * @since 0.9.0 + * @see https://eslint.org/docs/rules/no-irregular-whitespace + */ + "no-irregular-whitespace": Linter.RuleEntry< + [ + Partial<{ + /** + * @default true + */ + skipStrings: boolean; + /** + * @default false + */ + skipComments: boolean; + /** + * @default false + */ + skipRegExps: boolean; + /** + * @default false + */ + skipTemplates: boolean; + }>, + ] + >; + + /** + * Rule to disallow characters which are made with multiple code points in character class syntax. + * + * @remarks + * Recommended by ESLint, the rule was enabled in `eslint:recommended`. + * + * @since 5.3.0 + * @see https://eslint.org/docs/rules/no-misleading-character-class + */ + "no-misleading-character-class": Linter.RuleEntry<[]>; + + /** + * Rule to disallow calling global object properties as functions. + * + * @remarks + * Recommended by ESLint, the rule was enabled in `eslint:recommended`. + * + * @since 0.0.9 + * @see https://eslint.org/docs/rules/no-obj-calls + */ + "no-obj-calls": Linter.RuleEntry<[]>; + + /** + * Rule to disallow use of `Object.prototypes` builtins directly. + * + * @remarks + * Recommended by ESLint, the rule was enabled in `eslint:recommended`. + * + * @since 2.11.0 + * @see https://eslint.org/docs/rules/no-prototype-builtins + */ + "no-prototype-builtins": Linter.RuleEntry<[]>; + + /** + * Rule to disallow multiple spaces in regular expressions. + * + * @remarks + * Recommended by ESLint, the rule was enabled in `eslint:recommended`. + * + * @since 0.4.0 + * @see https://eslint.org/docs/rules/no-regex-spaces + */ + "no-regex-spaces": Linter.RuleEntry<[]>; + + /** + * Rule to disallow sparse arrays. + * + * @remarks + * Recommended by ESLint, the rule was enabled in `eslint:recommended`. + * + * @since 0.4.0 + * @see https://eslint.org/docs/rules/no-sparse-arrays + */ + "no-sparse-arrays": Linter.RuleEntry<[]>; + + /** + * Rule to disallow template literal placeholder syntax in regular strings. + * + * @since 3.3.0 + * @see https://eslint.org/docs/rules/no-template-curly-in-string + */ + "no-template-curly-in-string": Linter.RuleEntry<[]>; + + /** + * Rule to disallow confusing multiline expressions. + * + * @remarks + * Recommended by ESLint, the rule was enabled in `eslint:recommended`. + * + * @since 0.24.0 + * @see https://eslint.org/docs/rules/no-unexpected-multiline + */ + "no-unexpected-multiline": Linter.RuleEntry<[]>; + + /** + * Rule to disallow unreachable code after `return`, `throw`, `continue`, and `break` statements. + * + * @remarks + * Recommended by ESLint, the rule was enabled in `eslint:recommended`. + * + * @since 0.0.6 + * @see https://eslint.org/docs/rules/no-unreachable + */ + "no-unreachable": Linter.RuleEntry<[]>; + + /** + * Rule to disallow control flow statements in `finally` blocks. + * + * @remarks + * Recommended by ESLint, the rule was enabled in `eslint:recommended`. + * + * @since 2.9.0 + * @see https://eslint.org/docs/rules/no-unsafe-finally + */ + "no-unsafe-finally": Linter.RuleEntry<[]>; + + /** + * Rule to disallow negating the left operand of relational operators. + * + * @remarks + * Recommended by ESLint, the rule was enabled in `eslint:recommended`. + * + * @since 3.3.0 + * @see https://eslint.org/docs/rules/no-unsafe-negation + */ + "no-unsafe-negation": Linter.RuleEntry<[]>; + + /** + * Rule to disallow assignments that can lead to race conditions due to usage of `await` or `yield`. + * + * @remarks + * Recommended by ESLint, the rule was enabled in `eslint:recommended`. + * + * @since 5.3.0 + * @see https://eslint.org/docs/rules/require-atomic-updates + */ + "require-atomic-updates": Linter.RuleEntry<[]>; + + /** + * Rule to require calls to `isNaN()` when checking for `NaN`. + * + * @remarks + * Recommended by ESLint, the rule was enabled in `eslint:recommended`. + * + * @since 0.0.6 + * @see https://eslint.org/docs/rules/use-isnan + */ + "use-isnan": Linter.RuleEntry<[]>; + + /** + * Rule to enforce comparing `typeof` expressions against valid strings. + * + * @remarks + * Recommended by ESLint, the rule was enabled in `eslint:recommended`. + * + * @since 0.5.0 + * @see https://eslint.org/docs/rules/valid-typeof + */ + "valid-typeof": Linter.RuleEntry< + [ + Partial<{ + /** + * @default false + */ + requireStringLiterals: boolean; + }>, + ] + >; +} diff --git a/node_modules/@types/eslint/rules/strict-mode.d.ts b/node_modules/@types/eslint/rules/strict-mode.d.ts new file mode 100644 index 0000000..d63929b --- /dev/null +++ b/node_modules/@types/eslint/rules/strict-mode.d.ts @@ -0,0 +1,11 @@ +import { Linter } from "../index"; + +export interface StrictMode extends Linter.RulesRecord { + /** + * Rule to require or disallow strict mode directives. + * + * @since 0.1.0 + * @see https://eslint.org/docs/rules/strict + */ + strict: Linter.RuleEntry<["safe" | "global" | "function" | "never"]>; +} diff --git a/node_modules/@types/eslint/rules/stylistic-issues.d.ts b/node_modules/@types/eslint/rules/stylistic-issues.d.ts new file mode 100644 index 0000000..c0f53bd --- /dev/null +++ b/node_modules/@types/eslint/rules/stylistic-issues.d.ts @@ -0,0 +1,1897 @@ +import { Linter } from "../index"; + +export interface StylisticIssues extends Linter.RulesRecord { + /** + * Rule to enforce linebreaks after opening and before closing array brackets. + * + * @since 4.0.0-alpha.1 + * @see https://eslint.org/docs/rules/array-bracket-newline + */ + "array-bracket-newline": Linter.RuleEntry< + [ + | "always" + | "never" + | "consistent" + | Partial<{ + /** + * @default true + */ + multiline: boolean; + /** + * @default null + */ + minItems: number | null; + }>, + ] + >; + + /** + * Rule to enforce consistent spacing inside array brackets. + * + * @since 0.24.0 + * @see https://eslint.org/docs/rules/array-bracket-spacing + */ + "array-bracket-spacing": + | Linter.RuleEntry< + [ + "never", + Partial<{ + /** + * @default false + */ + singleValue: boolean; + /** + * @default false + */ + objectsInArrays: boolean; + /** + * @default false + */ + arraysInArrays: boolean; + }>, + ] + > + | Linter.RuleEntry< + [ + "always", + Partial<{ + /** + * @default true + */ + singleValue: boolean; + /** + * @default true + */ + objectsInArrays: boolean; + /** + * @default true + */ + arraysInArrays: boolean; + }>, + ] + >; + + /** + * Rule to enforce line breaks after each array element. + * + * @since 4.0.0-rc.0 + * @see https://eslint.org/docs/rules/array-element-newline + */ + "array-element-newline": Linter.RuleEntry< + [ + | "always" + | "never" + | "consistent" + | Partial<{ + /** + * @default true + */ + multiline: boolean; + /** + * @default null + */ + minItems: number | null; + }>, + ] + >; + + /** + * Rule to disallow or enforce spaces inside of blocks after opening block and before closing block. + * + * @since 1.2.0 + * @see https://eslint.org/docs/rules/block-spacing + */ + "block-spacing": Linter.RuleEntry<["always" | "never"]>; + + /** + * Rule to enforce consistent brace style for blocks. + * + * @since 0.0.7 + * @see https://eslint.org/docs/rules/brace-style + */ + "brace-style": Linter.RuleEntry< + [ + "1tbs" | "stroustrup" | "allman", + Partial<{ + /** + * @default false + */ + allowSingleLine: boolean; + }>, + ] + >; + + /** + * Rule to enforce camelcase naming convention. + * + * @since 0.0.2 + * @see https://eslint.org/docs/rules/camelcase + */ + camelcase: Linter.RuleEntry< + [ + Partial<{ + /** + * @default 'always' + */ + properties: "always" | "never"; + /** + * @default false + */ + ignoreDestructuring: boolean; + /** + * @remarks + * Also accept for regular expression patterns + */ + allow: string[]; + }>, + ] + >; + + /** + * Rule to enforce or disallow capitalization of the first letter of a comment. + * + * @since 3.11.0 + * @see https://eslint.org/docs/rules/capitalized-comments + */ + "capitalized-comments": Linter.RuleEntry< + [ + "always" | "never", + Partial<{ + ignorePattern: string; + /** + * @default false + */ + ignoreInlineComments: boolean; + /** + * @default false + */ + ignoreConsecutiveComments: boolean; + }>, + ] + >; + + /** + * Rule to require or disallow trailing commas. + * + * @since 0.16.0 + * @see https://eslint.org/docs/rules/comma-dangle + */ + "comma-dangle": Linter.RuleEntry< + [ + | "never" + | "always" + | "always-multiline" + | "only-multiline" + | Partial<{ + /** + * @default 'never' + */ + arrays: "never" | "always" | "always-multiline" | "only-multiline"; + /** + * @default 'never' + */ + objects: "never" | "always" | "always-multiline" | "only-multiline"; + /** + * @default 'never' + */ + imports: "never" | "always" | "always-multiline" | "only-multiline"; + /** + * @default 'never' + */ + exports: "never" | "always" | "always-multiline" | "only-multiline"; + /** + * @default 'never' + */ + functions: "never" | "always" | "always-multiline" | "only-multiline"; + }>, + ] + >; + + /** + * Rule to enforce consistent spacing before and after commas. + * + * @since 0.9.0 + * @see https://eslint.org/docs/rules/comma-spacing + */ + "comma-spacing": Linter.RuleEntry< + [ + Partial<{ + /** + * @default false + */ + before: boolean; + /** + * @default true + */ + after: boolean; + }>, + ] + >; + + /** + * Rule to enforce consistent comma style. + * + * @since 0.9.0 + * @see https://eslint.org/docs/rules/comma-style + */ + "comma-style": Linter.RuleEntry< + [ + "last" | "first", + Partial<{ + exceptions: Record; + }>, + ] + >; + + /** + * Rule to enforce consistent spacing inside computed property brackets. + * + * @since 0.23.0 + * @see https://eslint.org/docs/rules/computed-property-spacing + */ + "computed-property-spacing": Linter.RuleEntry<["never" | "always"]>; + + /** + * Rule to enforce consistent naming when capturing the current execution context. + * + * @since 0.0.9 + * @see https://eslint.org/docs/rules/consistent-this + */ + "consistent-this": Linter.RuleEntry<[...string[]]>; + + /** + * Rule to require or disallow newline at the end of files. + * + * @since 0.7.1 + * @see https://eslint.org/docs/rules/eol-last + */ + "eol-last": Linter.RuleEntry< + [ + "always" | "never", // | 'unix' | 'windows' + ] + >; + + /** + * Rule to require or disallow spacing between function identifiers and their invocations. + * + * @since 3.3.0 + * @see https://eslint.org/docs/rules/func-call-spacing + */ + "func-call-spacing": Linter.RuleEntry<["never" | "always"]>; + + /** + * Rule to require function names to match the name of the variable or property to which they are assigned. + * + * @since 3.8.0 + * @see https://eslint.org/docs/rules/func-name-matching + */ + "func-name-matching": + | Linter.RuleEntry< + [ + "always" | "never", + Partial<{ + /** + * @default false + */ + considerPropertyDescriptor: boolean; + /** + * @default false + */ + includeCommonJSModuleExports: boolean; + }>, + ] + > + | Linter.RuleEntry< + [ + Partial<{ + /** + * @default false + */ + considerPropertyDescriptor: boolean; + /** + * @default false + */ + includeCommonJSModuleExports: boolean; + }>, + ] + >; + + /** + * Rule to require or disallow named `function` expressions. + * + * @since 0.4.0 + * @see https://eslint.org/docs/rules/func-names + */ + "func-names": Linter.RuleEntry< + [ + "always" | "as-needed" | "never", + Partial<{ + generators: "always" | "as-needed" | "never"; + }>, + ] + >; + + /** + * Rule to enforce the consistent use of either `function` declarations or expressions. + * + * @since 0.2.0 + * @see https://eslint.org/docs/rules/func-style + */ + "func-style": Linter.RuleEntry< + [ + "expression" | "declaration", + Partial<{ + /** + * @default false + */ + allowArrowFunctions: boolean; + }>, + ] + >; + + /** + * Rule to enforce consistent line breaks inside function parentheses. + * + * @since 4.6.0 + * @see https://eslint.org/docs/rules/function-paren-newline + */ + "function-paren-newline": Linter.RuleEntry< + [ + | "always" + | "never" + | "multiline" + | "multiline-arguments" + | "consistent" + | Partial<{ + minItems: number; + }>, + ] + >; + + /** + * Rule to disallow specified identifiers. + * + * @since 2.0.0-beta.2 + * @see https://eslint.org/docs/rules/id-blacklist + */ + "id-blacklist": Linter.RuleEntry<[...string[]]>; + + /** + * Rule to enforce minimum and maximum identifier lengths. + * + * @since 1.0.0 + * @see https://eslint.org/docs/rules/id-length + */ + "id-length": Linter.RuleEntry< + [ + Partial<{ + /** + * @default 2 + */ + min: number; + /** + * @default Infinity + */ + max: number; + /** + * @default 'always' + */ + properties: "always" | "never"; + exceptions: string[]; + }>, + ] + >; + + /** + * Rule to require identifiers to match a specified regular expression. + * + * @since 1.0.0 + * @see https://eslint.org/docs/rules/id-match + */ + "id-match": Linter.RuleEntry< + [ + string, + Partial<{ + /** + * @default false + */ + properties: boolean; + /** + * @default false + */ + onlyDeclarations: boolean; + /** + * @default false + */ + ignoreDestructuring: boolean; + }>, + ] + >; + + /** + * Rule to enforce the location of arrow function bodies. + * + * @since 4.12.0 + * @see https://eslint.org/docs/rules/implicit-arrow-linebreak + */ + "implicit-arrow-linebreak": Linter.RuleEntry<["beside" | "below"]>; + + /** + * Rule to enforce consistent indentation. + * + * @since 0.14.0 + * @see https://eslint.org/docs/rules/indent + */ + indent: Linter.RuleEntry< + [ + number | "tab", + Partial<{ + /** + * @default 0 + */ + SwitchCase: number; + /** + * @default 1 + */ + VariableDeclarator: + | Partial<{ + /** + * @default 1 + */ + var: number | "first"; + /** + * @default 1 + */ + let: number | "first"; + /** + * @default 1 + */ + const: number | "first"; + }> + | number + | "first"; + /** + * @default 1 + */ + outerIIFEBody: number; + /** + * @default 1 + */ + MemberExpression: number | "off"; + /** + * @default { parameters: 1, body: 1 } + */ + FunctionDeclaration: Partial<{ + /** + * @default 1 + */ + parameters: number | "first" | "off"; + /** + * @default 1 + */ + body: number; + }>; + /** + * @default { parameters: 1, body: 1 } + */ + FunctionExpression: Partial<{ + /** + * @default 1 + */ + parameters: number | "first" | "off"; + /** + * @default 1 + */ + body: number; + }>; + /** + * @default { arguments: 1 } + */ + CallExpression: Partial<{ + /** + * @default 1 + */ + arguments: number | "first" | "off"; + }>; + /** + * @default 1 + */ + ArrayExpression: number | "first" | "off"; + /** + * @default 1 + */ + ObjectExpression: number | "first" | "off"; + /** + * @default 1 + */ + ImportDeclaration: number | "first" | "off"; + /** + * @default false + */ + flatTernaryExpressions: boolean; + ignoredNodes: string[]; + /** + * @default false + */ + ignoreComments: boolean; + }>, + ] + >; + + /** + * Rule to enforce the consistent use of either double or single quotes in JSX attributes. + * + * @since 1.4.0 + * @see https://eslint.org/docs/rules/jsx-quotes + */ + "jsx-quotes": Linter.RuleEntry<["prefer-double" | "prefer-single"]>; + + /** + * Rule to enforce consistent spacing between keys and values in object literal properties. + * + * @since 0.9.0 + * @see https://eslint.org/docs/rules/key-spacing + */ + "key-spacing": Linter.RuleEntry< + [ + | Partial< + | { + /** + * @default false + */ + beforeColon: boolean; + /** + * @default true + */ + afterColon: boolean; + /** + * @default 'strict' + */ + mode: "strict" | "minimum"; + align: + | Partial<{ + /** + * @default false + */ + beforeColon: boolean; + /** + * @default true + */ + afterColon: boolean; + /** + * @default 'colon' + */ + on: "value" | "colon"; + /** + * @default 'strict' + */ + mode: "strict" | "minimum"; + }> + | "value" + | "colon"; + } + | { + singleLine?: Partial<{ + /** + * @default false + */ + beforeColon: boolean; + /** + * @default true + */ + afterColon: boolean; + /** + * @default 'strict' + */ + mode: "strict" | "minimum"; + }> | undefined; + multiLine?: Partial<{ + /** + * @default false + */ + beforeColon: boolean; + /** + * @default true + */ + afterColon: boolean; + /** + * @default 'strict' + */ + mode: "strict" | "minimum"; + align: + | Partial<{ + /** + * @default false + */ + beforeColon: boolean; + /** + * @default true + */ + afterColon: boolean; + /** + * @default 'colon' + */ + on: "value" | "colon"; + /** + * @default 'strict' + */ + mode: "strict" | "minimum"; + }> + | "value" + | "colon"; + }> | undefined; + } + > + | { + align: Partial<{ + /** + * @default false + */ + beforeColon: boolean; + /** + * @default true + */ + afterColon: boolean; + /** + * @default 'colon' + */ + on: "value" | "colon"; + /** + * @default 'strict' + */ + mode: "strict" | "minimum"; + }>; + singleLine?: Partial<{ + /** + * @default false + */ + beforeColon: boolean; + /** + * @default true + */ + afterColon: boolean; + /** + * @default 'strict' + */ + mode: "strict" | "minimum"; + }> | undefined; + multiLine?: Partial<{ + /** + * @default false + */ + beforeColon: boolean; + /** + * @default true + */ + afterColon: boolean; + /** + * @default 'strict' + */ + mode: "strict" | "minimum"; + }> | undefined; + }, + ] + >; + + /** + * Rule to enforce consistent spacing before and after keywords. + * + * @since 2.0.0-beta.1 + * @see https://eslint.org/docs/rules/keyword-spacing + */ + "keyword-spacing": Linter.RuleEntry< + [ + Partial<{ + /** + * @default true + */ + before: boolean; + /** + * @default true + */ + after: boolean; + overrides: Record< + string, + Partial<{ + before: boolean; + after: boolean; + }> + >; + }>, + ] + >; + + /** + * Rule to enforce position of line comments. + * + * @since 3.5.0 + * @see https://eslint.org/docs/rules/line-comment-position + */ + "line-comment-position": Linter.RuleEntry< + [ + Partial<{ + /** + * @default 'above' + */ + position: "above" | "beside"; + ignorePattern: string; + /** + * @default true + */ + applyDefaultIgnorePatterns: boolean; + }>, + ] + >; + + /** + * Rule to enforce consistent linebreak style. + * + * @since 0.21.0 + * @see https://eslint.org/docs/rules/linebreak-style + */ + "linebreak-style": Linter.RuleEntry<["unix" | "windows"]>; + + /** + * Rule to require empty lines around comments. + * + * @since 0.22.0 + * @see https://eslint.org/docs/rules/lines-around-comment + */ + "lines-around-comment": Linter.RuleEntry< + [ + Partial<{ + /** + * @default true + */ + beforeBlockComment: boolean; + /** + * @default false + */ + afterBlockComment: boolean; + /** + * @default false + */ + beforeLineComment: boolean; + /** + * @default false + */ + afterLineComment: boolean; + /** + * @default false + */ + allowBlockStart: boolean; + /** + * @default false + */ + allowBlockEnd: boolean; + /** + * @default false + */ + allowObjectStart: boolean; + /** + * @default false + */ + allowObjectEnd: boolean; + /** + * @default false + */ + allowArrayStart: boolean; + /** + * @default false + */ + allowArrayEnd: boolean; + /** + * @default false + */ + allowClassStart: boolean; + /** + * @default false + */ + allowClassEnd: boolean; + ignorePattern: string; + /** + * @default true + */ + applyDefaultIgnorePatterns: boolean; + }>, + ] + >; + + /** + * Rule to require or disallow an empty line between class members. + * + * @since 4.9.0 + * @see https://eslint.org/docs/rules/lines-between-class-members + */ + "lines-between-class-members": Linter.RuleEntry< + [ + "always" | "never", + Partial<{ + /** + * @default false + */ + exceptAfterSingleLine: boolean; + }>, + ] + >; + + /** + * Rule to enforce a maximum depth that blocks can be nested. + * + * @since 0.0.9 + * @see https://eslint.org/docs/rules/max-depth + */ + "max-depth": Linter.RuleEntry< + [ + Partial<{ + /** + * @default 4 + */ + max: number; + }>, + ] + >; + + /** + * Rule to enforce a maximum line length. + * + * @since 0.0.9 + * @see https://eslint.org/docs/rules/max-len + */ + "max-len": Linter.RuleEntry< + [ + Partial<{ + /** + * @default 80 + */ + code: number; + /** + * @default 4 + */ + tabWidth: number; + comments: number; + ignorePattern: string; + /** + * @default false + */ + ignoreComments: boolean; + /** + * @default false + */ + ignoreTrailingComments: boolean; + /** + * @default false + */ + ignoreUrls: boolean; + /** + * @default false + */ + ignoreStrings: boolean; + /** + * @default false + */ + ignoreTemplateLiterals: boolean; + /** + * @default false + */ + ignoreRegExpLiterals: boolean; + }>, + ] + >; + + /** + * Rule to enforce a maximum number of lines per file. + * + * @since 2.12.0 + * @see https://eslint.org/docs/rules/max-lines + */ + "max-lines": Linter.RuleEntry< + [ + | Partial<{ + /** + * @default 300 + */ + max: number; + /** + * @default false + */ + skipBlankLines: boolean; + /** + * @default false + */ + skipComments: boolean; + }> + | number, + ] + >; + + /** + * Rule to enforce a maximum number of line of code in a function. + * + * @since 5.0.0 + * @see https://eslint.org/docs/rules/max-lines-per-function + */ + "max-lines-per-function": Linter.RuleEntry< + [ + Partial<{ + /** + * @default 50 + */ + max: number; + /** + * @default false + */ + skipBlankLines: boolean; + /** + * @default false + */ + skipComments: boolean; + /** + * @default false + */ + IIFEs: boolean; + }>, + ] + >; + + /** + * Rule to enforce a maximum depth that callbacks can be nested. + * + * @since 0.2.0 + * @see https://eslint.org/docs/rules/max-nested-callbacks + */ + "max-nested-callbacks": Linter.RuleEntry< + [ + | Partial<{ + /** + * @default 10 + */ + max: number; + }> + | number, + ] + >; + + /** + * Rule to enforce a maximum number of parameters in function definitions. + * + * @since 0.0.9 + * @see https://eslint.org/docs/rules/max-params + */ + "max-params": Linter.RuleEntry< + [ + | Partial<{ + /** + * @default 3 + */ + max: number; + }> + | number, + ] + >; + + /** + * Rule to enforce a maximum number of statements allowed in function blocks. + * + * @since 0.0.9 + * @see https://eslint.org/docs/rules/max-statements + */ + "max-statements": Linter.RuleEntry< + [ + | Partial<{ + /** + * @default 10 + */ + max: number; + /** + * @default false + */ + ignoreTopLevelFunctions: boolean; + }> + | number, + ] + >; + + /** + * Rule to enforce a maximum number of statements allowed per line. + * + * @since 2.5.0 + * @see https://eslint.org/docs/rules/max-statements-per-line + */ + "max-statements-per-line": Linter.RuleEntry< + [ + | Partial<{ + /** + * @default 1 + */ + max: number; + }> + | number, + ] + >; + + /** + * Rule to enforce a particular style for multiline comments. + * + * @since 4.10.0 + * @see https://eslint.org/docs/rules/multiline-comment-style + */ + "multiline-comment-style": Linter.RuleEntry<["starred-block" | "bare-block" | "separate-lines"]>; + + /** + * Rule to enforce newlines between operands of ternary expressions. + * + * @since 3.1.0 + * @see https://eslint.org/docs/rules/multiline-ternary + */ + "multiline-ternary": Linter.RuleEntry<["always" | "always-multiline" | "never"]>; + + /** + * Rule to require constructor names to begin with a capital letter. + * + * @since 0.0.3-0 + * @see https://eslint.org/docs/rules/new-cap + */ + "new-cap": Linter.RuleEntry< + [ + Partial<{ + /** + * @default true + */ + newIsCap: boolean; + /** + * @default true + */ + capIsNew: boolean; + newIsCapExceptions: string[]; + newIsCapExceptionPattern: string; + capIsNewExceptions: string[]; + capIsNewExceptionPattern: string; + /** + * @default true + */ + properties: boolean; + }>, + ] + >; + + /** + * Rule to enforce or disallow parentheses when invoking a constructor with no arguments. + * + * @since 0.0.6 + * @see https://eslint.org/docs/rules/new-parens + */ + "new-parens": Linter.RuleEntry<["always" | "never"]>; + + /** + * Rule to require a newline after each call in a method chain. + * + * @since 2.0.0-rc.0 + * @see https://eslint.org/docs/rules/newline-per-chained-call + */ + "newline-per-chained-call": Linter.RuleEntry< + [ + { + /** + * @default 2 + */ + ignoreChainWithDepth: number; + }, + ] + >; + + /** + * Rule to disallow `Array` constructors. + * + * @since 0.4.0 + * @see https://eslint.org/docs/rules/no-array-constructor + */ + "no-array-constructor": Linter.RuleEntry<[]>; + + /** + * Rule to disallow bitwise operators. + * + * @since 0.0.2 + * @see https://eslint.org/docs/rules/no-bitwise + */ + "no-bitwise": Linter.RuleEntry< + [ + Partial<{ + allow: string[]; + /** + * @default false + */ + int32Hint: boolean; + }>, + ] + >; + + /** + * Rule to disallow `continue` statements. + * + * @since 0.19.0 + * @see https://eslint.org/docs/rules/no-continue + */ + "no-continue": Linter.RuleEntry<[]>; + + /** + * Rule to disallow inline comments after code. + * + * @since 0.10.0 + * @see https://eslint.org/docs/rules/no-inline-comments + */ + "no-inline-comments": Linter.RuleEntry<[]>; + + /** + * Rule to disallow `if` statements as the only statement in `else` blocks. + * + * @since 0.6.0 + * @see https://eslint.org/docs/rules/no-lonely-if + */ + "no-lonely-if": Linter.RuleEntry<[]>; + + /** + * Rule to disallow mixed binary operators. + * + * @since 2.12.0 + * @see https://eslint.org/docs/rules/no-mixed-operators + */ + "no-mixed-operators": Linter.RuleEntry< + [ + Partial<{ + /** + * @default + * [ + * ["+", "-", "*", "/", "%", "**"], + * ["&", "|", "^", "~", "<<", ">>", ">>>"], + * ["==", "!=", "===", "!==", ">", ">=", "<", "<="], + * ["&&", "||"], + * ["in", "instanceof"] + * ] + */ + groups: string[][]; + /** + * @default true + */ + allowSamePrecedence: boolean; + }>, + ] + >; + + /** + * Rule to disallow mixed spaces and tabs for indentation. + * + * @remarks + * Recommended by ESLint, the rule was enabled in `eslint:recommended`. + * + * @since 0.7.1 + * @see https://eslint.org/docs/rules/no-mixed-spaces-and-tabs + */ + "no-mixed-spaces-and-tabs": Linter.RuleEntry<["smart-tabs"]>; + + /** + * Rule to disallow use of chained assignment expressions. + * + * @since 3.14.0 + * @see https://eslint.org/docs/rules/no-multi-assign + */ + "no-multi-assign": Linter.RuleEntry<[]>; + + /** + * Rule to disallow multiple empty lines. + * + * @since 0.9.0 + * @see https://eslint.org/docs/rules/no-multiple-empty-lines + */ + "no-multiple-empty-lines": Linter.RuleEntry< + [ + | Partial<{ + /** + * @default 2 + */ + max: number; + maxEOF: number; + maxBOF: number; + }> + | number, + ] + >; + + /** + * Rule to disallow negated conditions. + * + * @since 1.6.0 + * @see https://eslint.org/docs/rules/no-negated-condition + */ + "no-negated-condition": Linter.RuleEntry<[]>; + + /** + * Rule to disallow nested ternary expressions. + * + * @since 0.2.0 + * @see https://eslint.org/docs/rules/no-nested-ternary + */ + "no-nested-ternary": Linter.RuleEntry<[]>; + + /** + * Rule to disallow `Object` constructors. + * + * @since 0.0.9 + * @see https://eslint.org/docs/rules/no-new-object + */ + "no-new-object": Linter.RuleEntry<[]>; + + /** + * Rule to disallow the unary operators `++` and `--`. + * + * @since 0.0.9 + * @see https://eslint.org/docs/rules/no-plusplus + */ + "no-plusplus": Linter.RuleEntry< + [ + Partial<{ + /** + * @default false + */ + allowForLoopAfterthoughts: boolean; + }>, + ] + >; + + /** + * Rule to disallow specified syntax. + * + * @since 1.4.0 + * @see https://eslint.org/docs/rules/no-restricted-syntax + */ + "no-restricted-syntax": Linter.RuleEntry< + [ + ...Array< + | string + | { + selector: string; + message?: string | undefined; + } + > + ] + >; + + /** + * Rule to disallow all tabs. + * + * @since 3.2.0 + * @see https://eslint.org/docs/rules/no-tabs + */ + "no-tabs": Linter.RuleEntry< + [ + Partial<{ + /** + * @default false + */ + allowIndentationTabs: boolean; + }>, + ] + >; + + /** + * Rule to disallow ternary operators. + * + * @since 0.0.9 + * @see https://eslint.org/docs/rules/no-ternary + */ + "no-ternary": Linter.RuleEntry<[]>; + + /** + * Rule to disallow trailing whitespace at the end of lines. + * + * @since 0.7.1 + * @see https://eslint.org/docs/rules/no-trailing-spaces + */ + "no-trailing-spaces": Linter.RuleEntry< + [ + Partial<{ + /** + * @default false + */ + skipBlankLines: boolean; + /** + * @default false + */ + ignoreComments: boolean; + }>, + ] + >; + + /** + * Rule to disallow dangling underscores in identifiers. + * + * @since 0.0.9 + * @see https://eslint.org/docs/rules/no-underscore-dangle + */ + "no-underscore-dangle": Linter.RuleEntry< + [ + Partial<{ + allow: string[]; + /** + * @default false + */ + allowAfterThis: boolean; + /** + * @default false + */ + allowAfterSuper: boolean; + /** + * @default false + */ + enforceInMethodNames: boolean; + }>, + ] + >; + + /** + * Rule to disallow ternary operators when simpler alternatives exist. + * + * @since 0.21.0 + * @see https://eslint.org/docs/rules/no-unneeded-ternary + */ + "no-unneeded-ternary": Linter.RuleEntry< + [ + Partial<{ + /** + * @default true + */ + defaultAssignment: boolean; + }>, + ] + >; + + /** + * Rule to disallow whitespace before properties. + * + * @since 2.0.0-beta.1 + * @see https://eslint.org/docs/rules/no-whitespace-before-property + */ + "no-whitespace-before-property": Linter.RuleEntry<[]>; + + /** + * Rule to enforce the location of single-line statements. + * + * @since 3.17.0 + * @see https://eslint.org/docs/rules/nonblock-statement-body-position + */ + "nonblock-statement-body-position": Linter.RuleEntry< + [ + "beside" | "below" | "any", + Partial<{ + overrides: Record; + }>, + ] + >; + + /** + * Rule to enforce consistent line breaks inside braces. + * + * @since 2.12.0 + * @see https://eslint.org/docs/rules/object-curly-newline + */ + "object-curly-newline": Linter.RuleEntry< + [ + | "always" + | "never" + | Partial<{ + /** + * @default false + */ + multiline: boolean; + minProperties: number; + /** + * @default true + */ + consistent: boolean; + }> + | Partial< + Record< + "ObjectExpression" | "ObjectPattern" | "ImportDeclaration" | "ExportDeclaration", + | "always" + | "never" + | Partial<{ + /** + * @default false + */ + multiline: boolean; + minProperties: number; + /** + * @default true + */ + consistent: boolean; + }> + > + >, + ] + >; + + /** + * Rule to enforce consistent spacing inside braces. + * + * @since 0.22.0 + * @see https://eslint.org/docs/rules/object-curly-spacing + */ + "object-curly-spacing": + | Linter.RuleEntry< + [ + "never", + { + /** + * @default false + */ + arraysInObjects: boolean; + /** + * @default false + */ + objectsInObjects: boolean; + }, + ] + > + | Linter.RuleEntry< + [ + "always", + { + /** + * @default true + */ + arraysInObjects: boolean; + /** + * @default true + */ + objectsInObjects: boolean; + }, + ] + >; + + /** + * Rule to enforce placing object properties on separate lines. + * + * @since 2.10.0 + * @see https://eslint.org/docs/rules/object-property-newline + */ + "object-property-newline": Linter.RuleEntry< + [ + Partial<{ + /** + * @default false + */ + allowAllPropertiesOnSameLine: boolean; + }>, + ] + >; + + /** + * Rule to enforce variables to be declared either together or separately in functions. + * + * @since 0.0.9 + * @see https://eslint.org/docs/rules/one-var + */ + "one-var": Linter.RuleEntry< + [ + | "always" + | "never" + | "consecutive" + | Partial< + { + /** + * @default false + */ + separateRequires: boolean; + } & Record<"var" | "let" | "const", "always" | "never" | "consecutive"> + > + | Partial>, + ] + >; + + /** + * Rule to require or disallow newlines around variable declarations. + * + * @since 2.0.0-beta.3 + * @see https://eslint.org/docs/rules/one-var-declaration-per-line + */ + "one-var-declaration-per-line": Linter.RuleEntry<["initializations" | "always"]>; + + /** + * Rule to require or disallow assignment operator shorthand where possible. + * + * @since 0.10.0 + * @see https://eslint.org/docs/rules/operator-assignment + */ + "operator-assignment": Linter.RuleEntry<["always" | "never"]>; + + /** + * Rule to enforce consistent linebreak style for operators. + * + * @since 0.19.0 + * @see https://eslint.org/docs/rules/operator-linebreak + */ + "operator-linebreak": Linter.RuleEntry< + [ + "after" | "before" | "none", + Partial<{ + overrides: Record; + }>, + ] + >; + + /** + * Rule to require or disallow padding within blocks. + * + * @since 0.9.0 + * @see https://eslint.org/docs/rules/padded-blocks + */ + "padded-blocks": Linter.RuleEntry< + [ + "always" | "never" | Partial>, + { + /** + * @default false + */ + allowSingleLineBlocks: boolean; + }, + ] + >; + + /** + * Rule to require or disallow padding lines between statements. + * + * @since 4.0.0-beta.0 + * @see https://eslint.org/docs/rules/padding-line-between-statements + */ + "padding-line-between-statements": Linter.RuleEntry< + [ + ...Array< + { + blankLine: "any" | "never" | "always"; + } & Record<"prev" | "next", string | string[]> + > + ] + >; + + /** + * Rule to disallow using Object.assign with an object literal as the first argument and prefer the use of object spread instead. + * + * @since 5.0.0-alpha.3 + * @see https://eslint.org/docs/rules/prefer-object-spread + */ + "prefer-object-spread": Linter.RuleEntry<[]>; + + /** + * Rule to require quotes around object literal property names. + * + * @since 0.0.6 + * @see https://eslint.org/docs/rules/quote-props + */ + "quote-props": + | Linter.RuleEntry<["always" | "consistent"]> + | Linter.RuleEntry< + [ + "as-needed", + Partial<{ + /** + * @default false + */ + keywords: boolean; + /** + * @default true + */ + unnecessary: boolean; + /** + * @default false + */ + numbers: boolean; + }>, + ] + > + | Linter.RuleEntry< + [ + "consistent-as-needed", + Partial<{ + /** + * @default false + */ + keywords: boolean; + }>, + ] + >; + + /** + * Rule to enforce the consistent use of either backticks, double, or single quotes. + * + * @since 0.0.7 + * @see https://eslint.org/docs/rules/quotes + */ + quotes: Linter.RuleEntry< + [ + "double" | "single" | "backtick", + Partial<{ + /** + * @default false + */ + avoidEscape: boolean; + /** + * @default false + */ + allowTemplateLiterals: boolean; + }>, + ] + >; + + /** + * Rule to require or disallow semicolons instead of ASI. + * + * @since 0.0.6 + * @see https://eslint.org/docs/rules/semi + */ + semi: + | Linter.RuleEntry< + [ + "always", + Partial<{ + /** + * @default false + */ + omitLastInOneLineBlock: boolean; + }>, + ] + > + | Linter.RuleEntry< + [ + "never", + Partial<{ + /** + * @default 'any' + */ + beforeStatementContinuationChars: "any" | "always" | "never"; + }>, + ] + >; + + /** + * Rule to enforce consistent spacing before and after semicolons. + * + * @since 0.16.0 + * @see https://eslint.org/docs/rules/semi-spacing + */ + "semi-spacing": Linter.RuleEntry< + [ + Partial<{ + /** + * @default false + */ + before: boolean; + /** + * @default true + */ + after: boolean; + }>, + ] + >; + + /** + * Rule to enforce location of semicolons. + * + * @since 4.0.0-beta.0 + * @see https://eslint.org/docs/rules/semi-style + */ + "semi-style": Linter.RuleEntry<["last" | "first"]>; + + /** + * Rule to require object keys to be sorted. + * + * @since 3.3.0 + * @see https://eslint.org/docs/rules/sort-keys + */ + "sort-keys": Linter.RuleEntry< + [ + "asc" | "desc", + Partial<{ + /** + * @default true + */ + caseSensitive: boolean; + /** + * @default 2 + */ + minKeys: number; + /** + * @default false + */ + natural: boolean; + /** + * @default false + */ + allowLineSeparatedGroups: boolean; + }>, + ] + >; + + /** + * Rule to require variables within the same declaration block to be sorted. + * + * @since 0.2.0 + * @see https://eslint.org/docs/rules/sort-vars + */ + "sort-vars": Linter.RuleEntry< + [ + Partial<{ + /** + * @default false + */ + ignoreCase: boolean; + }>, + ] + >; + + /** + * Rule to enforce consistent spacing before blocks. + * + * @since 0.9.0 + * @see https://eslint.org/docs/rules/space-before-blocks + */ + "space-before-blocks": Linter.RuleEntry< + ["always" | "never" | Partial>] + >; + + /** + * Rule to enforce consistent spacing before `function` definition opening parenthesis. + * + * @since 0.18.0 + * @see https://eslint.org/docs/rules/space-before-function-paren + */ + "space-before-function-paren": Linter.RuleEntry< + ["always" | "never" | Partial>] + >; + + /** + * Rule to enforce consistent spacing inside parentheses. + * + * @since 0.8.0 + * @see https://eslint.org/docs/rules/space-in-parens + */ + "space-in-parens": Linter.RuleEntry< + [ + "never" | "always", + Partial<{ + exceptions: string[]; + }>, + ] + >; + + /** + * Rule to require spacing around infix operators. + * + * @since 0.2.0 + * @see https://eslint.org/docs/rules/space-infix-ops + */ + "space-infix-ops": Linter.RuleEntry< + [ + Partial<{ + /** + * @default false + */ + int32Hint: boolean; + }>, + ] + >; + + /** + * Rule to enforce consistent spacing before or after unary operators. + * + * @since 0.10.0 + * @see https://eslint.org/docs/rules/space-unary-ops + */ + "space-unary-ops": Linter.RuleEntry< + [ + Partial<{ + /** + * @default true + */ + words: boolean; + /** + * @default false + */ + nonwords: boolean; + overrides: Record; + }>, + ] + >; + + /** + * Rule to enforce consistent spacing after the `//` or `/*` in a comment. + * + * @since 0.23.0 + * @see https://eslint.org/docs/rules/spaced-comment + */ + "spaced-comment": Linter.RuleEntry< + [ + "always" | "never", + { + exceptions: string[]; + markers: string[]; + line: { + exceptions: string[]; + markers: string[]; + }; + block: { + exceptions: string[]; + markers: string[]; + /** + * @default false + */ + balanced: boolean; + }; + }, + ] + >; + + /** + * Rule to enforce spacing around colons of switch statements. + * + * @since 4.0.0-beta.0 + * @see https://eslint.org/docs/rules/switch-colon-spacing + */ + "switch-colon-spacing": Linter.RuleEntry< + [ + Partial<{ + /** + * @default false + */ + before: boolean; + /** + * @default true + */ + after: boolean; + }>, + ] + >; + + /** + * Rule to require or disallow spacing between template tags and their literals. + * + * @since 3.15.0 + * @see https://eslint.org/docs/rules/template-tag-spacing + */ + "template-tag-spacing": Linter.RuleEntry<["never" | "always"]>; + + /** + * Rule to require or disallow Unicode byte order mark (BOM). + * + * @since 2.11.0 + * @see https://eslint.org/docs/rules/unicode-bom + */ + "unicode-bom": Linter.RuleEntry<["never" | "always"]>; + + /** + * Rule to require parenthesis around regex literals. + * + * @since 0.1.0 + * @see https://eslint.org/docs/rules/wrap-regex + */ + "wrap-regex": Linter.RuleEntry<[]>; +} diff --git a/node_modules/@types/eslint/rules/variables.d.ts b/node_modules/@types/eslint/rules/variables.d.ts new file mode 100644 index 0000000..6347531 --- /dev/null +++ b/node_modules/@types/eslint/rules/variables.d.ts @@ -0,0 +1,187 @@ +import { Linter } from "../index"; + +export interface Variables extends Linter.RulesRecord { + /** + * Rule to require or disallow initialization in variable declarations. + * + * @since 1.0.0-rc-1 + * @see https://eslint.org/docs/rules/init-declarations + */ + "init-declarations": + | Linter.RuleEntry<["always"]> + | Linter.RuleEntry< + [ + "never", + Partial<{ + ignoreForLoopInit: boolean; + }>, + ] + >; + + /** + * Rule to disallow deleting variables. + * + * @remarks + * Recommended by ESLint, the rule was enabled in `eslint:recommended`. + * + * @since 0.0.9 + * @see https://eslint.org/docs/rules/no-delete-var + */ + "no-delete-var": Linter.RuleEntry<[]>; + + /** + * Rule to disallow labels that share a name with a variable. + * + * @since 0.0.9 + * @see https://eslint.org/docs/rules/no-label-var + */ + "no-label-var": Linter.RuleEntry<[]>; + + /** + * Rule to disallow specified global variables. + * + * @since 2.3.0 + * @see https://eslint.org/docs/rules/no-restricted-globals + */ + "no-restricted-globals": Linter.RuleEntry< + [ + ...Array< + | string + | { + name: string; + message?: string | undefined; + } + > + ] + >; + + /** + * Rule to disallow variable declarations from shadowing variables declared in the outer scope. + * + * @since 0.0.9 + * @see https://eslint.org/docs/rules/no-shadow + */ + "no-shadow": Linter.RuleEntry< + [ + Partial<{ + /** + * @default false + */ + builtinGlobals: boolean; + /** + * @default 'functions' + */ + hoist: "functions" | "all" | "never"; + allow: string[]; + }>, + ] + >; + + /** + * Rule to disallow identifiers from shadowing restricted names. + * + * @remarks + * Recommended by ESLint, the rule was enabled in `eslint:recommended`. + * + * @since 0.1.4 + * @see https://eslint.org/docs/rules/no-shadow-restricted-names + */ + "no-shadow-restricted-names": Linter.RuleEntry<[]>; + + /** + * Rule to disallow the use of undeclared variables unless mentioned in `global` comments. + * + * @remarks + * Recommended by ESLint, the rule was enabled in `eslint:recommended`. + * + * @since 0.0.9 + * @see https://eslint.org/docs/rules/no-undef + */ + "no-undef": Linter.RuleEntry< + [ + Partial<{ + /** + * @default false + */ + typeof: boolean; + }>, + ] + >; + + /** + * Rule to disallow initializing variables to `undefined`. + * + * @since 0.0.6 + * @see https://eslint.org/docs/rules/no-undef-init + */ + "no-undef-init": Linter.RuleEntry<[]>; + + /** + * Rule to disallow the use of `undefined` as an identifier. + * + * @since 0.7.1 + * @see https://eslint.org/docs/rules/no-undefined + */ + "no-undefined": Linter.RuleEntry<[]>; + + /** + * Rule to disallow unused variables. + * + * @remarks + * Recommended by ESLint, the rule was enabled in `eslint:recommended`. + * + * @since 0.0.9 + * @see https://eslint.org/docs/rules/no-unused-vars + */ + "no-unused-vars": Linter.RuleEntry< + [ + Partial<{ + /** + * @default 'all' + */ + vars: "all" | "local"; + varsIgnorePattern: string; + /** + * @default 'after-used' + */ + args: "after-used" | "all" | "none"; + /** + * @default false + */ + ignoreRestSiblings: boolean; + argsIgnorePattern: string; + /** + * @default 'none' + */ + caughtErrors: "none" | "all"; + caughtErrorsIgnorePattern: string; + }>, + ] + >; + + /** + * Rule to disallow the use of variables before they are defined. + * + * @since 0.0.9 + * @see https://eslint.org/docs/rules/no-use-before-define + */ + "no-use-before-define": Linter.RuleEntry< + [ + | Partial<{ + /** + * @default true + */ + functions: boolean; + /** + * @default true + */ + classes: boolean; + /** + * @default true + */ + variables: boolean; + }> + | "nofunc", + ] + >; +} diff --git a/node_modules/@types/eslint/use-at-your-own-risk.d.ts b/node_modules/@types/eslint/use-at-your-own-risk.d.ts new file mode 100644 index 0000000..29492ca --- /dev/null +++ b/node_modules/@types/eslint/use-at-your-own-risk.d.ts @@ -0,0 +1,8 @@ +/** @deprecated */ +export const builtinRules: Map; +/** @deprecated */ +export class FileEnumerator { + constructor(params?: {cwd?: string, configArrayFactory?: any, extensions?: any, globInputPaths?: boolean, errorOnUnmatchedPattern?: boolean, ignore?: boolean}); + isTargetPath(filePath: string, providedConfig?: any): boolean; + iterateFiles(patternOrPatterns: string | string[]): IterableIterator<{config: any, filePath: string, ignored: boolean}>; +} \ No newline at end of file diff --git a/node_modules/@types/estree/LICENSE b/node_modules/@types/estree/LICENSE new file mode 100644 index 0000000..9e841e7 --- /dev/null +++ b/node_modules/@types/estree/LICENSE @@ -0,0 +1,21 @@ + MIT License + + Copyright (c) Microsoft Corporation. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE diff --git a/node_modules/@types/estree/README.md b/node_modules/@types/estree/README.md new file mode 100644 index 0000000..4517726 --- /dev/null +++ b/node_modules/@types/estree/README.md @@ -0,0 +1,16 @@ +# Installation +> `npm install --save @types/estree` + +# Summary +This package contains type definitions for estree (https://github.com/estree/estree). + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/estree. + +### Additional Details + * Last updated: Wed, 19 Apr 2023 05:02:44 GMT + * Dependencies: none + * Global values: none + +# Credits +These definitions were written by [RReverser](https://github.com/RReverser). diff --git a/node_modules/@types/estree/flow.d.ts b/node_modules/@types/estree/flow.d.ts new file mode 100644 index 0000000..9d001a9 --- /dev/null +++ b/node_modules/@types/estree/flow.d.ts @@ -0,0 +1,167 @@ +declare namespace ESTree { + interface FlowTypeAnnotation extends Node {} + + interface FlowBaseTypeAnnotation extends FlowTypeAnnotation {} + + interface FlowLiteralTypeAnnotation extends FlowTypeAnnotation, Literal {} + + interface FlowDeclaration extends Declaration {} + + interface AnyTypeAnnotation extends FlowBaseTypeAnnotation {} + + interface ArrayTypeAnnotation extends FlowTypeAnnotation { + elementType: FlowTypeAnnotation; + } + + interface BooleanLiteralTypeAnnotation extends FlowLiteralTypeAnnotation {} + + interface BooleanTypeAnnotation extends FlowBaseTypeAnnotation {} + + interface ClassImplements extends Node { + id: Identifier; + typeParameters?: TypeParameterInstantiation | null; + } + + interface ClassProperty { + key: Expression; + value?: Expression | null; + typeAnnotation?: TypeAnnotation | null; + computed: boolean; + static: boolean; + } + + interface DeclareClass extends FlowDeclaration { + id: Identifier; + typeParameters?: TypeParameterDeclaration | null; + body: ObjectTypeAnnotation; + extends: InterfaceExtends[]; + } + + interface DeclareFunction extends FlowDeclaration { + id: Identifier; + } + + interface DeclareModule extends FlowDeclaration { + id: Literal | Identifier; + body: BlockStatement; + } + + interface DeclareVariable extends FlowDeclaration { + id: Identifier; + } + + interface FunctionTypeAnnotation extends FlowTypeAnnotation { + params: FunctionTypeParam[]; + returnType: FlowTypeAnnotation; + rest?: FunctionTypeParam | null; + typeParameters?: TypeParameterDeclaration | null; + } + + interface FunctionTypeParam { + name: Identifier; + typeAnnotation: FlowTypeAnnotation; + optional: boolean; + } + + interface GenericTypeAnnotation extends FlowTypeAnnotation { + id: Identifier | QualifiedTypeIdentifier; + typeParameters?: TypeParameterInstantiation | null; + } + + interface InterfaceExtends extends Node { + id: Identifier | QualifiedTypeIdentifier; + typeParameters?: TypeParameterInstantiation | null; + } + + interface InterfaceDeclaration extends FlowDeclaration { + id: Identifier; + typeParameters?: TypeParameterDeclaration | null; + extends: InterfaceExtends[]; + body: ObjectTypeAnnotation; + } + + interface IntersectionTypeAnnotation extends FlowTypeAnnotation { + types: FlowTypeAnnotation[]; + } + + interface MixedTypeAnnotation extends FlowBaseTypeAnnotation {} + + interface NullableTypeAnnotation extends FlowTypeAnnotation { + typeAnnotation: TypeAnnotation; + } + + interface NumberLiteralTypeAnnotation extends FlowLiteralTypeAnnotation {} + + interface NumberTypeAnnotation extends FlowBaseTypeAnnotation {} + + interface StringLiteralTypeAnnotation extends FlowLiteralTypeAnnotation {} + + interface StringTypeAnnotation extends FlowBaseTypeAnnotation {} + + interface TupleTypeAnnotation extends FlowTypeAnnotation { + types: FlowTypeAnnotation[]; + } + + interface TypeofTypeAnnotation extends FlowTypeAnnotation { + argument: FlowTypeAnnotation; + } + + interface TypeAlias extends FlowDeclaration { + id: Identifier; + typeParameters?: TypeParameterDeclaration | null; + right: FlowTypeAnnotation; + } + + interface TypeAnnotation extends Node { + typeAnnotation: FlowTypeAnnotation; + } + + interface TypeCastExpression extends Expression { + expression: Expression; + typeAnnotation: TypeAnnotation; + } + + interface TypeParameterDeclaration extends Node { + params: Identifier[]; + } + + interface TypeParameterInstantiation extends Node { + params: FlowTypeAnnotation[]; + } + + interface ObjectTypeAnnotation extends FlowTypeAnnotation { + properties: ObjectTypeProperty[]; + indexers: ObjectTypeIndexer[]; + callProperties: ObjectTypeCallProperty[]; + } + + interface ObjectTypeCallProperty extends Node { + value: FunctionTypeAnnotation; + static: boolean; + } + + interface ObjectTypeIndexer extends Node { + id: Identifier; + key: FlowTypeAnnotation; + value: FlowTypeAnnotation; + static: boolean; + } + + interface ObjectTypeProperty extends Node { + key: Expression; + value: FlowTypeAnnotation; + optional: boolean; + static: boolean; + } + + interface QualifiedTypeIdentifier extends Node { + qualification: Identifier | QualifiedTypeIdentifier; + id: Identifier; + } + + interface UnionTypeAnnotation extends FlowTypeAnnotation { + types: FlowTypeAnnotation[]; + } + + interface VoidTypeAnnotation extends FlowBaseTypeAnnotation {} +} diff --git a/node_modules/@types/estree/index.d.ts b/node_modules/@types/estree/index.d.ts new file mode 100644 index 0000000..bcf50cb --- /dev/null +++ b/node_modules/@types/estree/index.d.ts @@ -0,0 +1,680 @@ +// Type definitions for non-npm package estree 1.0 +// Project: https://github.com/estree/estree +// Definitions by: RReverser +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +// This definition file follows a somewhat unusual format. ESTree allows +// runtime type checks based on the `type` parameter. In order to explain this +// to typescript we want to use discriminated union types: +// https://github.com/Microsoft/TypeScript/pull/9163 +// +// For ESTree this is a bit tricky because the high level interfaces like +// Node or Function are pulling double duty. We want to pass common fields down +// to the interfaces that extend them (like Identifier or +// ArrowFunctionExpression), but you can't extend a type union or enforce +// common fields on them. So we've split the high level interfaces into two +// types, a base type which passes down inherited fields, and a type union of +// all types which extend the base type. Only the type union is exported, and +// the union is how other types refer to the collection of inheriting types. +// +// This makes the definitions file here somewhat more difficult to maintain, +// but it has the notable advantage of making ESTree much easier to use as +// an end user. + +export interface BaseNodeWithoutComments { + // Every leaf interface that extends BaseNode must specify a type property. + // The type property should be a string literal. For example, Identifier + // has: `type: "Identifier"` + type: string; + loc?: SourceLocation | null | undefined; + range?: [number, number] | undefined; +} + +export interface BaseNode extends BaseNodeWithoutComments { + leadingComments?: Comment[] | undefined; + trailingComments?: Comment[] | undefined; +} + +export interface NodeMap { + AssignmentProperty: AssignmentProperty; + CatchClause: CatchClause; + Class: Class; + ClassBody: ClassBody; + Expression: Expression; + Function: Function; + Identifier: Identifier; + Literal: Literal; + MethodDefinition: MethodDefinition; + ModuleDeclaration: ModuleDeclaration; + ModuleSpecifier: ModuleSpecifier; + Pattern: Pattern; + PrivateIdentifier: PrivateIdentifier; + Program: Program; + Property: Property; + PropertyDefinition: PropertyDefinition; + SpreadElement: SpreadElement; + Statement: Statement; + Super: Super; + SwitchCase: SwitchCase; + TemplateElement: TemplateElement; + VariableDeclarator: VariableDeclarator; +} + +export type Node = NodeMap[keyof NodeMap]; + +export interface Comment extends BaseNodeWithoutComments { + type: 'Line' | 'Block'; + value: string; +} + +export interface SourceLocation { + source?: string | null | undefined; + start: Position; + end: Position; +} + +export interface Position { + /** >= 1 */ + line: number; + /** >= 0 */ + column: number; +} + +export interface Program extends BaseNode { + type: 'Program'; + sourceType: 'script' | 'module'; + body: Array; + comments?: Comment[] | undefined; +} + +export interface Directive extends BaseNode { + type: 'ExpressionStatement'; + expression: Literal; + directive: string; +} + +export interface BaseFunction extends BaseNode { + params: Pattern[]; + generator?: boolean | undefined; + async?: boolean | undefined; + // The body is either BlockStatement or Expression because arrow functions + // can have a body that's either. FunctionDeclarations and + // FunctionExpressions have only BlockStatement bodies. + body: BlockStatement | Expression; +} + +export type Function = FunctionDeclaration | FunctionExpression | ArrowFunctionExpression; + +export type Statement = + | ExpressionStatement + | BlockStatement + | StaticBlock + | EmptyStatement + | DebuggerStatement + | WithStatement + | ReturnStatement + | LabeledStatement + | BreakStatement + | ContinueStatement + | IfStatement + | SwitchStatement + | ThrowStatement + | TryStatement + | WhileStatement + | DoWhileStatement + | ForStatement + | ForInStatement + | ForOfStatement + | Declaration; + +export interface BaseStatement extends BaseNode {} + +export interface EmptyStatement extends BaseStatement { + type: 'EmptyStatement'; +} + +export interface BlockStatement extends BaseStatement { + type: 'BlockStatement'; + body: Statement[]; + innerComments?: Comment[] | undefined; +} + +export interface StaticBlock extends Omit { + type: 'StaticBlock'; +} + +export interface ExpressionStatement extends BaseStatement { + type: 'ExpressionStatement'; + expression: Expression; +} + +export interface IfStatement extends BaseStatement { + type: 'IfStatement'; + test: Expression; + consequent: Statement; + alternate?: Statement | null | undefined; +} + +export interface LabeledStatement extends BaseStatement { + type: 'LabeledStatement'; + label: Identifier; + body: Statement; +} + +export interface BreakStatement extends BaseStatement { + type: 'BreakStatement'; + label?: Identifier | null | undefined; +} + +export interface ContinueStatement extends BaseStatement { + type: 'ContinueStatement'; + label?: Identifier | null | undefined; +} + +export interface WithStatement extends BaseStatement { + type: 'WithStatement'; + object: Expression; + body: Statement; +} + +export interface SwitchStatement extends BaseStatement { + type: 'SwitchStatement'; + discriminant: Expression; + cases: SwitchCase[]; +} + +export interface ReturnStatement extends BaseStatement { + type: 'ReturnStatement'; + argument?: Expression | null | undefined; +} + +export interface ThrowStatement extends BaseStatement { + type: 'ThrowStatement'; + argument: Expression; +} + +export interface TryStatement extends BaseStatement { + type: 'TryStatement'; + block: BlockStatement; + handler?: CatchClause | null | undefined; + finalizer?: BlockStatement | null | undefined; +} + +export interface WhileStatement extends BaseStatement { + type: 'WhileStatement'; + test: Expression; + body: Statement; +} + +export interface DoWhileStatement extends BaseStatement { + type: 'DoWhileStatement'; + body: Statement; + test: Expression; +} + +export interface ForStatement extends BaseStatement { + type: 'ForStatement'; + init?: VariableDeclaration | Expression | null | undefined; + test?: Expression | null | undefined; + update?: Expression | null | undefined; + body: Statement; +} + +export interface BaseForXStatement extends BaseStatement { + left: VariableDeclaration | Pattern; + right: Expression; + body: Statement; +} + +export interface ForInStatement extends BaseForXStatement { + type: 'ForInStatement'; +} + +export interface DebuggerStatement extends BaseStatement { + type: 'DebuggerStatement'; +} + +export type Declaration = FunctionDeclaration | VariableDeclaration | ClassDeclaration; + +export interface BaseDeclaration extends BaseStatement {} + +export interface FunctionDeclaration extends BaseFunction, BaseDeclaration { + type: 'FunctionDeclaration'; + /** It is null when a function declaration is a part of the `export default function` statement */ + id: Identifier | null; + body: BlockStatement; +} + +export interface VariableDeclaration extends BaseDeclaration { + type: 'VariableDeclaration'; + declarations: VariableDeclarator[]; + kind: 'var' | 'let' | 'const'; +} + +export interface VariableDeclarator extends BaseNode { + type: 'VariableDeclarator'; + id: Pattern; + init?: Expression | null | undefined; +} + +export interface ExpressionMap { + ArrayExpression: ArrayExpression; + ArrowFunctionExpression: ArrowFunctionExpression; + AssignmentExpression: AssignmentExpression; + AwaitExpression: AwaitExpression; + BinaryExpression: BinaryExpression; + CallExpression: CallExpression; + ChainExpression: ChainExpression; + ClassExpression: ClassExpression; + ConditionalExpression: ConditionalExpression; + FunctionExpression: FunctionExpression; + Identifier: Identifier; + ImportExpression: ImportExpression; + Literal: Literal; + LogicalExpression: LogicalExpression; + MemberExpression: MemberExpression; + MetaProperty: MetaProperty; + NewExpression: NewExpression; + ObjectExpression: ObjectExpression; + SequenceExpression: SequenceExpression; + TaggedTemplateExpression: TaggedTemplateExpression; + TemplateLiteral: TemplateLiteral; + ThisExpression: ThisExpression; + UnaryExpression: UnaryExpression; + UpdateExpression: UpdateExpression; + YieldExpression: YieldExpression; +} + +export type Expression = ExpressionMap[keyof ExpressionMap]; + +export interface BaseExpression extends BaseNode {} + +export type ChainElement = SimpleCallExpression | MemberExpression; + +export interface ChainExpression extends BaseExpression { + type: 'ChainExpression'; + expression: ChainElement; +} + +export interface ThisExpression extends BaseExpression { + type: 'ThisExpression'; +} + +export interface ArrayExpression extends BaseExpression { + type: 'ArrayExpression'; + elements: Array; +} + +export interface ObjectExpression extends BaseExpression { + type: 'ObjectExpression'; + properties: Array; +} + +export interface PrivateIdentifier extends BaseNode { + type: 'PrivateIdentifier'; + name: string; +} + +export interface Property extends BaseNode { + type: 'Property'; + key: Expression | PrivateIdentifier; + value: Expression | Pattern; // Could be an AssignmentProperty + kind: 'init' | 'get' | 'set'; + method: boolean; + shorthand: boolean; + computed: boolean; +} + +export interface PropertyDefinition extends BaseNode { + type: 'PropertyDefinition'; + key: Expression | PrivateIdentifier; + value?: Expression | null | undefined; + computed: boolean; + static: boolean; +} + +export interface FunctionExpression extends BaseFunction, BaseExpression { + id?: Identifier | null | undefined; + type: 'FunctionExpression'; + body: BlockStatement; +} + +export interface SequenceExpression extends BaseExpression { + type: 'SequenceExpression'; + expressions: Expression[]; +} + +export interface UnaryExpression extends BaseExpression { + type: 'UnaryExpression'; + operator: UnaryOperator; + prefix: true; + argument: Expression; +} + +export interface BinaryExpression extends BaseExpression { + type: 'BinaryExpression'; + operator: BinaryOperator; + left: Expression; + right: Expression; +} + +export interface AssignmentExpression extends BaseExpression { + type: 'AssignmentExpression'; + operator: AssignmentOperator; + left: Pattern | MemberExpression; + right: Expression; +} + +export interface UpdateExpression extends BaseExpression { + type: 'UpdateExpression'; + operator: UpdateOperator; + argument: Expression; + prefix: boolean; +} + +export interface LogicalExpression extends BaseExpression { + type: 'LogicalExpression'; + operator: LogicalOperator; + left: Expression; + right: Expression; +} + +export interface ConditionalExpression extends BaseExpression { + type: 'ConditionalExpression'; + test: Expression; + alternate: Expression; + consequent: Expression; +} + +export interface BaseCallExpression extends BaseExpression { + callee: Expression | Super; + arguments: Array; +} +export type CallExpression = SimpleCallExpression | NewExpression; + +export interface SimpleCallExpression extends BaseCallExpression { + type: 'CallExpression'; + optional: boolean; +} + +export interface NewExpression extends BaseCallExpression { + type: 'NewExpression'; +} + +export interface MemberExpression extends BaseExpression, BasePattern { + type: 'MemberExpression'; + object: Expression | Super; + property: Expression | PrivateIdentifier; + computed: boolean; + optional: boolean; +} + +export type Pattern = Identifier | ObjectPattern | ArrayPattern | RestElement | AssignmentPattern | MemberExpression; + +export interface BasePattern extends BaseNode {} + +export interface SwitchCase extends BaseNode { + type: 'SwitchCase'; + test?: Expression | null | undefined; + consequent: Statement[]; +} + +export interface CatchClause extends BaseNode { + type: 'CatchClause'; + param: Pattern | null; + body: BlockStatement; +} + +export interface Identifier extends BaseNode, BaseExpression, BasePattern { + type: 'Identifier'; + name: string; +} + +export type Literal = SimpleLiteral | RegExpLiteral | BigIntLiteral; + +export interface SimpleLiteral extends BaseNode, BaseExpression { + type: 'Literal'; + value: string | boolean | number | null; + raw?: string | undefined; +} + +export interface RegExpLiteral extends BaseNode, BaseExpression { + type: 'Literal'; + value?: RegExp | null | undefined; + regex: { + pattern: string; + flags: string; + }; + raw?: string | undefined; +} + +export interface BigIntLiteral extends BaseNode, BaseExpression { + type: 'Literal'; + value?: bigint | null | undefined; + bigint: string; + raw?: string | undefined; +} + +export type UnaryOperator = '-' | '+' | '!' | '~' | 'typeof' | 'void' | 'delete'; + +export type BinaryOperator = + | '==' + | '!=' + | '===' + | '!==' + | '<' + | '<=' + | '>' + | '>=' + | '<<' + | '>>' + | '>>>' + | '+' + | '-' + | '*' + | '/' + | '%' + | '**' + | '|' + | '^' + | '&' + | 'in' + | 'instanceof'; + +export type LogicalOperator = '||' | '&&' | '??'; + +export type AssignmentOperator = + | '=' + | '+=' + | '-=' + | '*=' + | '/=' + | '%=' + | '**=' + | '<<=' + | '>>=' + | '>>>=' + | '|=' + | '^=' + | '&=' + | '||=' + | '&&=' + | '??='; + +export type UpdateOperator = '++' | '--'; + +export interface ForOfStatement extends BaseForXStatement { + type: 'ForOfStatement'; + await: boolean; +} + +export interface Super extends BaseNode { + type: 'Super'; +} + +export interface SpreadElement extends BaseNode { + type: 'SpreadElement'; + argument: Expression; +} + +export interface ArrowFunctionExpression extends BaseExpression, BaseFunction { + type: 'ArrowFunctionExpression'; + expression: boolean; + body: BlockStatement | Expression; +} + +export interface YieldExpression extends BaseExpression { + type: 'YieldExpression'; + argument?: Expression | null | undefined; + delegate: boolean; +} + +export interface TemplateLiteral extends BaseExpression { + type: 'TemplateLiteral'; + quasis: TemplateElement[]; + expressions: Expression[]; +} + +export interface TaggedTemplateExpression extends BaseExpression { + type: 'TaggedTemplateExpression'; + tag: Expression; + quasi: TemplateLiteral; +} + +export interface TemplateElement extends BaseNode { + type: 'TemplateElement'; + tail: boolean; + value: { + /** It is null when the template literal is tagged and the text has an invalid escape (e.g. - tag`\unicode and \u{55}`) */ + cooked?: string | null | undefined; + raw: string; + }; +} + +export interface AssignmentProperty extends Property { + value: Pattern; + kind: 'init'; + method: boolean; // false +} + +export interface ObjectPattern extends BasePattern { + type: 'ObjectPattern'; + properties: Array; +} + +export interface ArrayPattern extends BasePattern { + type: 'ArrayPattern'; + elements: Array; +} + +export interface RestElement extends BasePattern { + type: 'RestElement'; + argument: Pattern; +} + +export interface AssignmentPattern extends BasePattern { + type: 'AssignmentPattern'; + left: Pattern; + right: Expression; +} + +export type Class = ClassDeclaration | ClassExpression; +export interface BaseClass extends BaseNode { + superClass?: Expression | null | undefined; + body: ClassBody; +} + +export interface ClassBody extends BaseNode { + type: 'ClassBody'; + body: Array; +} + +export interface MethodDefinition extends BaseNode { + type: 'MethodDefinition'; + key: Expression | PrivateIdentifier; + value: FunctionExpression; + kind: 'constructor' | 'method' | 'get' | 'set'; + computed: boolean; + static: boolean; +} + +export interface ClassDeclaration extends BaseClass, BaseDeclaration { + type: 'ClassDeclaration'; + /** It is null when a class declaration is a part of the `export default class` statement */ + id: Identifier | null; +} + +export interface ClassExpression extends BaseClass, BaseExpression { + type: 'ClassExpression'; + id?: Identifier | null | undefined; +} + +export interface MetaProperty extends BaseExpression { + type: 'MetaProperty'; + meta: Identifier; + property: Identifier; +} + +export type ModuleDeclaration = + | ImportDeclaration + | ExportNamedDeclaration + | ExportDefaultDeclaration + | ExportAllDeclaration; +export interface BaseModuleDeclaration extends BaseNode {} + +export type ModuleSpecifier = ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier | ExportSpecifier; +export interface BaseModuleSpecifier extends BaseNode { + local: Identifier; +} + +export interface ImportDeclaration extends BaseModuleDeclaration { + type: 'ImportDeclaration'; + specifiers: Array; + source: Literal; +} + +export interface ImportSpecifier extends BaseModuleSpecifier { + type: 'ImportSpecifier'; + imported: Identifier; +} + +export interface ImportExpression extends BaseExpression { + type: 'ImportExpression'; + source: Expression; +} + +export interface ImportDefaultSpecifier extends BaseModuleSpecifier { + type: 'ImportDefaultSpecifier'; +} + +export interface ImportNamespaceSpecifier extends BaseModuleSpecifier { + type: 'ImportNamespaceSpecifier'; +} + +export interface ExportNamedDeclaration extends BaseModuleDeclaration { + type: 'ExportNamedDeclaration'; + declaration?: Declaration | null | undefined; + specifiers: ExportSpecifier[]; + source?: Literal | null | undefined; +} + +export interface ExportSpecifier extends BaseModuleSpecifier { + type: 'ExportSpecifier'; + exported: Identifier; +} + +export interface ExportDefaultDeclaration extends BaseModuleDeclaration { + type: 'ExportDefaultDeclaration'; + declaration: Declaration | Expression; +} + +export interface ExportAllDeclaration extends BaseModuleDeclaration { + type: 'ExportAllDeclaration'; + exported: Identifier | null; + source: Literal; +} + +export interface AwaitExpression extends BaseExpression { + type: 'AwaitExpression'; + argument: Expression; +} diff --git a/node_modules/@types/estree/package.json b/node_modules/@types/estree/package.json new file mode 100644 index 0000000..77f2788 --- /dev/null +++ b/node_modules/@types/estree/package.json @@ -0,0 +1,25 @@ +{ + "name": "@types/estree", + "version": "1.0.1", + "description": "TypeScript definitions for estree", + "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/estree", + "license": "MIT", + "contributors": [ + { + "name": "RReverser", + "url": "https://github.com/RReverser", + "githubUsername": "RReverser" + } + ], + "main": "", + "types": "index.d.ts", + "repository": { + "type": "git", + "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", + "directory": "types/estree" + }, + "scripts": {}, + "dependencies": {}, + "typesPublisherContentHash": "6bb5253923dc858fe2d49a5555adfc2902dcbdb5536fa2b595339f0b498c29cf", + "typeScriptVersion": "4.3" +} \ No newline at end of file diff --git a/node_modules/@types/json-schema/LICENSE b/node_modules/@types/json-schema/LICENSE new file mode 100644 index 0000000..9e841e7 --- /dev/null +++ b/node_modules/@types/json-schema/LICENSE @@ -0,0 +1,21 @@ + MIT License + + Copyright (c) Microsoft Corporation. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE diff --git a/node_modules/@types/json-schema/README.md b/node_modules/@types/json-schema/README.md new file mode 100644 index 0000000..aee60ba --- /dev/null +++ b/node_modules/@types/json-schema/README.md @@ -0,0 +1,16 @@ +# Installation +> `npm install --save @types/json-schema` + +# Summary +This package contains type definitions for json-schema 4.0, 6.0 and (https://github.com/kriszyp/json-schema). + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/json-schema. + +### Additional Details + * Last updated: Fri, 15 Sep 2023 20:36:37 GMT + * Dependencies: none + * Global values: none + +# Credits +These definitions were written by [Boris Cherny](https://github.com/bcherny), [Lucian Buzzo](https://github.com/lucianbuzzo), [Roland Groza](https://github.com/rolandjitsu), and [Jason Kwok](https://github.com/JasonHK). diff --git a/node_modules/@types/json-schema/index.d.ts b/node_modules/@types/json-schema/index.d.ts new file mode 100644 index 0000000..a6d8f5d --- /dev/null +++ b/node_modules/@types/json-schema/index.d.ts @@ -0,0 +1,758 @@ +// Type definitions for json-schema 4.0, 6.0 and 7.0 +// Project: https://github.com/kriszyp/json-schema +// Definitions by: Boris Cherny +// Lucian Buzzo +// Roland Groza +// Jason Kwok +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +// ================================================================================================== +// JSON Schema Draft 04 +// ================================================================================================== + +/** + * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.1 + */ +export type JSONSchema4TypeName = + | "string" // + | "number" + | "integer" + | "boolean" + | "object" + | "array" + | "null" + | "any"; + +/** + * @see https://tools.ietf.org/html/draft-zyp-json-schema-04#section-3.5 + */ +export type JSONSchema4Type = + | string // + | number + | boolean + | JSONSchema4Object + | JSONSchema4Array + | null; + +// Workaround for infinite type recursion +export interface JSONSchema4Object { + [key: string]: JSONSchema4Type; +} + +// Workaround for infinite type recursion +// https://github.com/Microsoft/TypeScript/issues/3496#issuecomment-128553540 +export interface JSONSchema4Array extends Array {} + +/** + * Meta schema + * + * Recommended values: + * - 'http://json-schema.org/schema#' + * - 'http://json-schema.org/hyper-schema#' + * - 'http://json-schema.org/draft-04/schema#' + * - 'http://json-schema.org/draft-04/hyper-schema#' + * - 'http://json-schema.org/draft-03/schema#' + * - 'http://json-schema.org/draft-03/hyper-schema#' + * + * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-5 + */ +export type JSONSchema4Version = string; + +/** + * JSON Schema V4 + * @see https://tools.ietf.org/html/draft-zyp-json-schema-04 + */ +export interface JSONSchema4 { + id?: string | undefined; + $ref?: string | undefined; + $schema?: JSONSchema4Version | undefined; + + /** + * This attribute is a string that provides a short description of the + * instance property. + * + * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.21 + */ + title?: string | undefined; + + /** + * This attribute is a string that provides a full description of the of + * purpose the instance property. + * + * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.22 + */ + description?: string | undefined; + + default?: JSONSchema4Type | undefined; + multipleOf?: number | undefined; + maximum?: number | undefined; + exclusiveMaximum?: boolean | undefined; + minimum?: number | undefined; + exclusiveMinimum?: boolean | undefined; + maxLength?: number | undefined; + minLength?: number | undefined; + pattern?: string | undefined; + + /** + * May only be defined when "items" is defined, and is a tuple of JSONSchemas. + * + * This provides a definition for additional items in an array instance + * when tuple definitions of the items is provided. This can be false + * to indicate additional items in the array are not allowed, or it can + * be a schema that defines the schema of the additional items. + * + * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.6 + */ + additionalItems?: boolean | JSONSchema4 | undefined; + + /** + * This attribute defines the allowed items in an instance array, and + * MUST be a schema or an array of schemas. The default value is an + * empty schema which allows any value for items in the instance array. + * + * When this attribute value is a schema and the instance value is an + * array, then all the items in the array MUST be valid according to the + * schema. + * + * When this attribute value is an array of schemas and the instance + * value is an array, each position in the instance array MUST conform + * to the schema in the corresponding position for this array. This + * called tuple typing. When tuple typing is used, additional items are + * allowed, disallowed, or constrained by the "additionalItems" + * (Section 5.6) attribute using the same rules as + * "additionalProperties" (Section 5.4) for objects. + * + * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.5 + */ + items?: JSONSchema4 | JSONSchema4[] | undefined; + + maxItems?: number | undefined; + minItems?: number | undefined; + uniqueItems?: boolean | undefined; + maxProperties?: number | undefined; + minProperties?: number | undefined; + + /** + * This attribute indicates if the instance must have a value, and not + * be undefined. This is false by default, making the instance + * optional. + * + * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.7 + */ + required?: boolean | string[] | undefined; + + /** + * This attribute defines a schema for all properties that are not + * explicitly defined in an object type definition. If specified, the + * value MUST be a schema or a boolean. If false is provided, no + * additional properties are allowed beyond the properties defined in + * the schema. The default value is an empty schema which allows any + * value for additional properties. + * + * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.4 + */ + additionalProperties?: boolean | JSONSchema4 | undefined; + + definitions?: { + [k: string]: JSONSchema4; + } | undefined; + + /** + * This attribute is an object with property definitions that define the + * valid values of instance object property values. When the instance + * value is an object, the property values of the instance object MUST + * conform to the property definitions in this object. In this object, + * each property definition's value MUST be a schema, and the property's + * name MUST be the name of the instance property that it defines. The + * instance property value MUST be valid according to the schema from + * the property definition. Properties are considered unordered, the + * order of the instance properties MAY be in any order. + * + * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.2 + */ + properties?: { + [k: string]: JSONSchema4; + } | undefined; + + /** + * This attribute is an object that defines the schema for a set of + * property names of an object instance. The name of each property of + * this attribute's object is a regular expression pattern in the ECMA + * 262/Perl 5 format, while the value is a schema. If the pattern + * matches the name of a property on the instance object, the value of + * the instance's property MUST be valid against the pattern name's + * schema value. + * + * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.3 + */ + patternProperties?: { + [k: string]: JSONSchema4; + } | undefined; + dependencies?: { + [k: string]: JSONSchema4 | string[]; + } | undefined; + + /** + * This provides an enumeration of all possible values that are valid + * for the instance property. This MUST be an array, and each item in + * the array represents a possible value for the instance value. If + * this attribute is defined, the instance value MUST be one of the + * values in the array in order for the schema to be valid. + * + * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.19 + */ + enum?: JSONSchema4Type[] | undefined; + + /** + * A single type, or a union of simple types + */ + type?: JSONSchema4TypeName | JSONSchema4TypeName[] | undefined; + + allOf?: JSONSchema4[] | undefined; + anyOf?: JSONSchema4[] | undefined; + oneOf?: JSONSchema4[] | undefined; + not?: JSONSchema4 | undefined; + + /** + * The value of this property MUST be another schema which will provide + * a base schema which the current schema will inherit from. The + * inheritance rules are such that any instance that is valid according + * to the current schema MUST be valid according to the referenced + * schema. This MAY also be an array, in which case, the instance MUST + * be valid for all the schemas in the array. A schema that extends + * another schema MAY define additional attributes, constrain existing + * attributes, or add other constraints. + * + * Conceptually, the behavior of extends can be seen as validating an + * instance against all constraints in the extending schema as well as + * the extended schema(s). + * + * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.26 + */ + extends?: string | string[] | undefined; + + /** + * @see https://tools.ietf.org/html/draft-zyp-json-schema-04#section-5.6 + */ + [k: string]: any; + + format?: string | undefined; +} + +// ================================================================================================== +// JSON Schema Draft 06 +// ================================================================================================== + +export type JSONSchema6TypeName = + | "string" // + | "number" + | "integer" + | "boolean" + | "object" + | "array" + | "null" + | "any"; + +export type JSONSchema6Type = + | string // + | number + | boolean + | JSONSchema6Object + | JSONSchema6Array + | null; + +// Workaround for infinite type recursion +export interface JSONSchema6Object { + [key: string]: JSONSchema6Type; +} + +// Workaround for infinite type recursion +// https://github.com/Microsoft/TypeScript/issues/3496#issuecomment-128553540 +export interface JSONSchema6Array extends Array {} + +/** + * Meta schema + * + * Recommended values: + * - 'http://json-schema.org/schema#' + * - 'http://json-schema.org/hyper-schema#' + * - 'http://json-schema.org/draft-06/schema#' + * - 'http://json-schema.org/draft-06/hyper-schema#' + * + * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-5 + */ +export type JSONSchema6Version = string; + +/** + * JSON Schema V6 + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01 + */ +export type JSONSchema6Definition = JSONSchema6 | boolean; +export interface JSONSchema6 { + $id?: string | undefined; + $ref?: string | undefined; + $schema?: JSONSchema6Version | undefined; + + /** + * Must be strictly greater than 0. + * A numeric instance is valid only if division by this keyword's value results in an integer. + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.1 + */ + multipleOf?: number | undefined; + + /** + * Representing an inclusive upper limit for a numeric instance. + * This keyword validates only if the instance is less than or exactly equal to "maximum". + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.2 + */ + maximum?: number | undefined; + + /** + * Representing an exclusive upper limit for a numeric instance. + * This keyword validates only if the instance is strictly less than (not equal to) to "exclusiveMaximum". + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.3 + */ + exclusiveMaximum?: number | undefined; + + /** + * Representing an inclusive lower limit for a numeric instance. + * This keyword validates only if the instance is greater than or exactly equal to "minimum". + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.4 + */ + minimum?: number | undefined; + + /** + * Representing an exclusive lower limit for a numeric instance. + * This keyword validates only if the instance is strictly greater than (not equal to) to "exclusiveMinimum". + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.5 + */ + exclusiveMinimum?: number | undefined; + + /** + * Must be a non-negative integer. + * A string instance is valid against this keyword if its length is less than, or equal to, the value of this keyword. + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.6 + */ + maxLength?: number | undefined; + + /** + * Must be a non-negative integer. + * A string instance is valid against this keyword if its length is greater than, or equal to, the value of this keyword. + * Omitting this keyword has the same behavior as a value of 0. + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.7 + */ + minLength?: number | undefined; + + /** + * Should be a valid regular expression, according to the ECMA 262 regular expression dialect. + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.8 + */ + pattern?: string | undefined; + + /** + * This keyword determines how child instances validate for arrays, and does not directly validate the immediate instance itself. + * Omitting this keyword has the same behavior as an empty schema. + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.9 + */ + items?: JSONSchema6Definition | JSONSchema6Definition[] | undefined; + + /** + * This keyword determines how child instances validate for arrays, and does not directly validate the immediate instance itself. + * If "items" is an array of schemas, validation succeeds if every instance element + * at a position greater than the size of "items" validates against "additionalItems". + * Otherwise, "additionalItems" MUST be ignored, as the "items" schema + * (possibly the default value of an empty schema) is applied to all elements. + * Omitting this keyword has the same behavior as an empty schema. + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.10 + */ + additionalItems?: JSONSchema6Definition | undefined; + + /** + * Must be a non-negative integer. + * An array instance is valid against "maxItems" if its size is less than, or equal to, the value of this keyword. + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.11 + */ + maxItems?: number | undefined; + + /** + * Must be a non-negative integer. + * An array instance is valid against "maxItems" if its size is greater than, or equal to, the value of this keyword. + * Omitting this keyword has the same behavior as a value of 0. + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.12 + */ + minItems?: number | undefined; + + /** + * If this keyword has boolean value false, the instance validates successfully. + * If it has boolean value true, the instance validates successfully if all of its elements are unique. + * Omitting this keyword has the same behavior as a value of false. + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.13 + */ + uniqueItems?: boolean | undefined; + + /** + * An array instance is valid against "contains" if at least one of its elements is valid against the given schema. + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.14 + */ + contains?: JSONSchema6Definition | undefined; + + /** + * Must be a non-negative integer. + * An object instance is valid against "maxProperties" if its number of properties is less than, or equal to, the value of this keyword. + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.15 + */ + maxProperties?: number | undefined; + + /** + * Must be a non-negative integer. + * An object instance is valid against "maxProperties" if its number of properties is greater than, + * or equal to, the value of this keyword. + * Omitting this keyword has the same behavior as a value of 0. + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.16 + */ + minProperties?: number | undefined; + + /** + * Elements of this array must be unique. + * An object instance is valid against this keyword if every item in the array is the name of a property in the instance. + * Omitting this keyword has the same behavior as an empty array. + * + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.17 + */ + required?: string[] | undefined; + + /** + * This keyword determines how child instances validate for objects, and does not directly validate the immediate instance itself. + * Validation succeeds if, for each name that appears in both the instance and as a name within this keyword's value, + * the child instance for that name successfully validates against the corresponding schema. + * Omitting this keyword has the same behavior as an empty object. + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.18 + */ + properties?: { + [k: string]: JSONSchema6Definition; + } | undefined; + + /** + * This attribute is an object that defines the schema for a set of property names of an object instance. + * The name of each property of this attribute's object is a regular expression pattern in the ECMA 262, while the value is a schema. + * If the pattern matches the name of a property on the instance object, the value of the instance's property + * MUST be valid against the pattern name's schema value. + * Omitting this keyword has the same behavior as an empty object. + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.19 + */ + patternProperties?: { + [k: string]: JSONSchema6Definition; + } | undefined; + + /** + * This attribute defines a schema for all properties that are not explicitly defined in an object type definition. + * If specified, the value MUST be a schema or a boolean. + * If false is provided, no additional properties are allowed beyond the properties defined in the schema. + * The default value is an empty schema which allows any value for additional properties. + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.20 + */ + additionalProperties?: JSONSchema6Definition | undefined; + + /** + * This keyword specifies rules that are evaluated if the instance is an object and contains a certain property. + * Each property specifies a dependency. + * If the dependency value is an array, each element in the array must be unique. + * Omitting this keyword has the same behavior as an empty object. + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.21 + */ + dependencies?: { + [k: string]: JSONSchema6Definition | string[]; + } | undefined; + + /** + * Takes a schema which validates the names of all properties rather than their values. + * Note the property name that the schema is testing will always be a string. + * Omitting this keyword has the same behavior as an empty schema. + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.22 + */ + propertyNames?: JSONSchema6Definition | undefined; + + /** + * This provides an enumeration of all possible values that are valid + * for the instance property. This MUST be an array, and each item in + * the array represents a possible value for the instance value. If + * this attribute is defined, the instance value MUST be one of the + * values in the array in order for the schema to be valid. + * + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.23 + */ + enum?: JSONSchema6Type[] | undefined; + + /** + * More readable form of a one-element "enum" + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.24 + */ + const?: JSONSchema6Type | undefined; + + /** + * A single type, or a union of simple types + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.25 + */ + type?: JSONSchema6TypeName | JSONSchema6TypeName[] | undefined; + + /** + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.26 + */ + allOf?: JSONSchema6Definition[] | undefined; + + /** + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.27 + */ + anyOf?: JSONSchema6Definition[] | undefined; + + /** + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.28 + */ + oneOf?: JSONSchema6Definition[] | undefined; + + /** + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.29 + */ + not?: JSONSchema6Definition | undefined; + + /** + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-7.1 + */ + definitions?: { + [k: string]: JSONSchema6Definition; + } | undefined; + + /** + * This attribute is a string that provides a short description of the instance property. + * + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-7.2 + */ + title?: string | undefined; + + /** + * This attribute is a string that provides a full description of the of purpose the instance property. + * + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-7.2 + */ + description?: string | undefined; + + /** + * This keyword can be used to supply a default JSON value associated with a particular schema. + * It is RECOMMENDED that a default value be valid against the associated schema. + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-7.3 + */ + default?: JSONSchema6Type | undefined; + + /** + * Array of examples with no validation effect the value of "default" is usable as an example without repeating it under this keyword + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-7.4 + */ + examples?: JSONSchema6Type[] | undefined; + + /** + * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-8 + */ + format?: string | undefined; +} + +// ================================================================================================== +// JSON Schema Draft 07 +// ================================================================================================== +// https://tools.ietf.org/html/draft-handrews-json-schema-validation-01 +// -------------------------------------------------------------------------------------------------- + +/** + * Primitive type + * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.1.1 + */ +export type JSONSchema7TypeName = + | "string" // + | "number" + | "integer" + | "boolean" + | "object" + | "array" + | "null"; + +/** + * Primitive type + * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.1.1 + */ +export type JSONSchema7Type = + | string // + | number + | boolean + | JSONSchema7Object + | JSONSchema7Array + | null; + +// Workaround for infinite type recursion +export interface JSONSchema7Object { + [key: string]: JSONSchema7Type; +} + +// Workaround for infinite type recursion +// https://github.com/Microsoft/TypeScript/issues/3496#issuecomment-128553540 +export interface JSONSchema7Array extends Array {} + +/** + * Meta schema + * + * Recommended values: + * - 'http://json-schema.org/schema#' + * - 'http://json-schema.org/hyper-schema#' + * - 'http://json-schema.org/draft-07/schema#' + * - 'http://json-schema.org/draft-07/hyper-schema#' + * + * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-5 + */ +export type JSONSchema7Version = string; + +/** + * JSON Schema v7 + * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01 + */ +export type JSONSchema7Definition = JSONSchema7 | boolean; +export interface JSONSchema7 { + $id?: string | undefined; + $ref?: string | undefined; + $schema?: JSONSchema7Version | undefined; + $comment?: string | undefined; + + /** + * @see https://datatracker.ietf.org/doc/html/draft-bhutton-json-schema-00#section-8.2.4 + * @see https://datatracker.ietf.org/doc/html/draft-bhutton-json-schema-validation-00#appendix-A + */ + $defs?: { + [key: string]: JSONSchema7Definition; + } | undefined; + + /** + * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.1 + */ + type?: JSONSchema7TypeName | JSONSchema7TypeName[] | undefined; + enum?: JSONSchema7Type[] | undefined; + const?: JSONSchema7Type | undefined; + + /** + * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.2 + */ + multipleOf?: number | undefined; + maximum?: number | undefined; + exclusiveMaximum?: number | undefined; + minimum?: number | undefined; + exclusiveMinimum?: number | undefined; + + /** + * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.3 + */ + maxLength?: number | undefined; + minLength?: number | undefined; + pattern?: string | undefined; + + /** + * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.4 + */ + items?: JSONSchema7Definition | JSONSchema7Definition[] | undefined; + additionalItems?: JSONSchema7Definition | undefined; + maxItems?: number | undefined; + minItems?: number | undefined; + uniqueItems?: boolean | undefined; + contains?: JSONSchema7Definition | undefined; + + /** + * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.5 + */ + maxProperties?: number | undefined; + minProperties?: number | undefined; + required?: string[] | undefined; + properties?: { + [key: string]: JSONSchema7Definition; + } | undefined; + patternProperties?: { + [key: string]: JSONSchema7Definition; + } | undefined; + additionalProperties?: JSONSchema7Definition | undefined; + dependencies?: { + [key: string]: JSONSchema7Definition | string[]; + } | undefined; + propertyNames?: JSONSchema7Definition | undefined; + + /** + * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.6 + */ + if?: JSONSchema7Definition | undefined; + then?: JSONSchema7Definition | undefined; + else?: JSONSchema7Definition | undefined; + + /** + * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.7 + */ + allOf?: JSONSchema7Definition[] | undefined; + anyOf?: JSONSchema7Definition[] | undefined; + oneOf?: JSONSchema7Definition[] | undefined; + not?: JSONSchema7Definition | undefined; + + /** + * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-7 + */ + format?: string | undefined; + + /** + * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-8 + */ + contentMediaType?: string | undefined; + contentEncoding?: string | undefined; + + /** + * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-9 + */ + definitions?: { + [key: string]: JSONSchema7Definition; + } | undefined; + + /** + * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-10 + */ + title?: string | undefined; + description?: string | undefined; + default?: JSONSchema7Type | undefined; + readOnly?: boolean | undefined; + writeOnly?: boolean | undefined; + examples?: JSONSchema7Type | undefined; +} + +export interface ValidationResult { + valid: boolean; + errors: ValidationError[]; +} + +export interface ValidationError { + property: string; + message: string; +} + +/** + * To use the validator call JSONSchema.validate with an instance object and an optional schema object. + * If a schema is provided, it will be used to validate. If the instance object refers to a schema (self-validating), + * that schema will be used to validate and the schema parameter is not necessary (if both exist, + * both validations will occur). + */ +export function validate(instance: {}, schema: JSONSchema4 | JSONSchema6 | JSONSchema7): ValidationResult; + +/** + * The checkPropertyChange method will check to see if an value can legally be in property with the given schema + * This is slightly different than the validate method in that it will fail if the schema is readonly and it will + * not check for self-validation, it is assumed that the passed in value is already internally valid. + */ +export function checkPropertyChange( + value: any, + schema: JSONSchema4 | JSONSchema6 | JSONSchema7, + property: string, +): ValidationResult; + +/** + * This checks to ensure that the result is valid and will throw an appropriate error message if it is not. + */ +export function mustBeValid(result: ValidationResult): void; diff --git a/node_modules/@types/json-schema/package.json b/node_modules/@types/json-schema/package.json new file mode 100644 index 0000000..f30a8ca --- /dev/null +++ b/node_modules/@types/json-schema/package.json @@ -0,0 +1,40 @@ +{ + "name": "@types/json-schema", + "version": "7.0.13", + "description": "TypeScript definitions for json-schema 4.0, 6.0 and", + "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/json-schema", + "license": "MIT", + "contributors": [ + { + "name": "Boris Cherny", + "url": "https://github.com/bcherny", + "githubUsername": "bcherny" + }, + { + "name": "Lucian Buzzo", + "url": "https://github.com/lucianbuzzo", + "githubUsername": "lucianbuzzo" + }, + { + "name": "Roland Groza", + "url": "https://github.com/rolandjitsu", + "githubUsername": "rolandjitsu" + }, + { + "name": "Jason Kwok", + "url": "https://github.com/JasonHK", + "githubUsername": "JasonHK" + } + ], + "main": "", + "types": "index.d.ts", + "repository": { + "type": "git", + "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", + "directory": "types/json-schema" + }, + "scripts": {}, + "dependencies": {}, + "typesPublisherContentHash": "85f3277dfcda7a00b7ff8c2ad838d5d9dc8ecaccbaee5f6d53252195d6818981", + "typeScriptVersion": "4.5" +} \ No newline at end of file diff --git a/node_modules/@types/node/LICENSE b/node_modules/@types/node/LICENSE new file mode 100644 index 0000000..9e841e7 --- /dev/null +++ b/node_modules/@types/node/LICENSE @@ -0,0 +1,21 @@ + MIT License + + Copyright (c) Microsoft Corporation. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE diff --git a/node_modules/@types/node/README.md b/node_modules/@types/node/README.md new file mode 100644 index 0000000..326e68a --- /dev/null +++ b/node_modules/@types/node/README.md @@ -0,0 +1,16 @@ +# Installation +> `npm install --save @types/node` + +# Summary +This package contains type definitions for Node.js (https://nodejs.org/). + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node. + +### Additional Details + * Last updated: Sat, 16 Sep 2023 06:34:52 GMT + * Dependencies: none + * Global values: `AbortController`, `AbortSignal`, `__dirname`, `__filename`, `console`, `exports`, `gc`, `global`, `module`, `process`, `require`, `structuredClone` + +# Credits +These definitions were written by [Microsoft TypeScript](https://github.com/Microsoft), [DefinitelyTyped](https://github.com/DefinitelyTyped), [Alberto Schiabel](https://github.com/jkomyno), [Alvis HT Tang](https://github.com/alvis), [Andrew Makarov](https://github.com/r3nya), [Benjamin Toueg](https://github.com/btoueg), [Chigozirim C.](https://github.com/smac89), [David Junger](https://github.com/touffy), [Deividas Bakanas](https://github.com/DeividasBakanas), [Eugene Y. Q. Shen](https://github.com/eyqs), [Hannes Magnusson](https://github.com/Hannes-Magnusson-CK), [Huw](https://github.com/hoo29), [Kelvin Jin](https://github.com/kjin), [Klaus Meinhardt](https://github.com/ajafff), [Lishude](https://github.com/islishude), [Mariusz Wiktorczyk](https://github.com/mwiktorczyk), [Mohsen Azimi](https://github.com/mohsen1), [Nicolas Even](https://github.com/n-e), [Nikita Galkin](https://github.com/galkin), [Parambir Singh](https://github.com/parambirs), [Sebastian Silbermann](https://github.com/eps1lon), [Thomas den Hollander](https://github.com/ThomasdenH), [Wilco Bakker](https://github.com/WilcoBakker), [wwwy3y3](https://github.com/wwwy3y3), [Samuel Ainsworth](https://github.com/samuela), [Kyle Uehlein](https://github.com/kuehlein), [Thanik Bhongbhibhat](https://github.com/bhongy), [Marcin Kopacz](https://github.com/chyzwar), [Trivikram Kamat](https://github.com/trivikr), [Junxiao Shi](https://github.com/yoursunny), [Ilia Baryshnikov](https://github.com/qwelias), [ExE Boss](https://github.com/ExE-Boss), [Piotr Błażejewicz](https://github.com/peterblazejewicz), [Anna Henningsen](https://github.com/addaleax), [Victor Perin](https://github.com/victorperin), [Yongsheng Zhang](https://github.com/ZYSzys), [NodeJS Contributors](https://github.com/NodeJS), [Linus Unnebäck](https://github.com/LinusU), [wafuwafu13](https://github.com/wafuwafu13), [Matteo Collina](https://github.com/mcollina), and [Dmitry Semigradsky](https://github.com/Semigradsky). diff --git a/node_modules/@types/node/assert.d.ts b/node_modules/@types/node/assert.d.ts new file mode 100644 index 0000000..c3d8f5d --- /dev/null +++ b/node_modules/@types/node/assert.d.ts @@ -0,0 +1,972 @@ +/** + * The `node:assert` module provides a set of assertion functions for verifying + * invariants. + * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/assert.js) + */ +declare module 'node:assert' { + /** + * An alias of {@link ok}. + * @since v0.5.9 + * @param value The input that is checked for being truthy. + */ + function assert(value: unknown, message?: string | Error): asserts value; + namespace assert { + /** + * Indicates the failure of an assertion. All errors thrown by the `node:assert`module will be instances of the `AssertionError` class. + */ + class AssertionError extends Error { + /** + * Set to the `actual` argument for methods such as {@link assert.strictEqual()}. + */ + actual: unknown; + /** + * Set to the `expected` argument for methods such as {@link assert.strictEqual()}. + */ + expected: unknown; + /** + * Set to the passed in operator value. + */ + operator: string; + /** + * Indicates if the message was auto-generated (`true`) or not. + */ + generatedMessage: boolean; + /** + * Value is always `ERR_ASSERTION` to show that the error is an assertion error. + */ + code: 'ERR_ASSERTION'; + constructor(options?: { + /** If provided, the error message is set to this value. */ + message?: string | undefined; + /** The `actual` property on the error instance. */ + actual?: unknown | undefined; + /** The `expected` property on the error instance. */ + expected?: unknown | undefined; + /** The `operator` property on the error instance. */ + operator?: string | undefined; + /** If provided, the generated stack trace omits frames before this function. */ + // tslint:disable-next-line:ban-types + stackStartFn?: Function | undefined; + }); + } + /** + * This feature is deprecated and will be removed in a future version. + * Please consider using alternatives such as the `mock` helper function. + * @since v14.2.0, v12.19.0 + * @deprecated Deprecated + */ + class CallTracker { + /** + * The wrapper function is expected to be called exactly `exact` times. If the + * function has not been called exactly `exact` times when `tracker.verify()` is called, then `tracker.verify()` will throw an + * error. + * + * ```js + * import assert from 'node:assert'; + * + * // Creates call tracker. + * const tracker = new assert.CallTracker(); + * + * function func() {} + * + * // Returns a function that wraps func() that must be called exact times + * // before tracker.verify(). + * const callsfunc = tracker.calls(func); + * ``` + * @since v14.2.0, v12.19.0 + * @param [fn='A no-op function'] + * @param [exact=1] + * @return that wraps `fn`. + */ + calls(exact?: number): () => void; + calls any>(fn?: Func, exact?: number): Func; + /** + * Example: + * + * ```js + * import assert from 'node:assert'; + * + * const tracker = new assert.CallTracker(); + * + * function func() {} + * const callsfunc = tracker.calls(func); + * callsfunc(1, 2, 3); + * + * assert.deepStrictEqual(tracker.getCalls(callsfunc), + * [{ thisArg: undefined, arguments: [1, 2, 3] }]); + * ``` + * @since v18.8.0, v16.18.0 + * @param fn + * @return An Array with all the calls to a tracked function. + */ + getCalls(fn: Function): CallTrackerCall[]; + /** + * The arrays contains information about the expected and actual number of calls of + * the functions that have not been called the expected number of times. + * + * ```js + * import assert from 'node:assert'; + * + * // Creates call tracker. + * const tracker = new assert.CallTracker(); + * + * function func() {} + * + * // Returns a function that wraps func() that must be called exact times + * // before tracker.verify(). + * const callsfunc = tracker.calls(func, 2); + * + * // Returns an array containing information on callsfunc() + * console.log(tracker.report()); + * // [ + * // { + * // message: 'Expected the func function to be executed 2 time(s) but was + * // executed 0 time(s).', + * // actual: 0, + * // expected: 2, + * // operator: 'func', + * // stack: stack trace + * // } + * // ] + * ``` + * @since v14.2.0, v12.19.0 + * @return An Array of objects containing information about the wrapper functions returned by `calls`. + */ + report(): CallTrackerReportInformation[]; + /** + * Reset calls of the call tracker. + * If a tracked function is passed as an argument, the calls will be reset for it. + * If no arguments are passed, all tracked functions will be reset. + * + * ```js + * import assert from 'node:assert'; + * + * const tracker = new assert.CallTracker(); + * + * function func() {} + * const callsfunc = tracker.calls(func); + * + * callsfunc(); + * // Tracker was called once + * assert.strictEqual(tracker.getCalls(callsfunc).length, 1); + * + * tracker.reset(callsfunc); + * assert.strictEqual(tracker.getCalls(callsfunc).length, 0); + * ``` + * @since v18.8.0, v16.18.0 + * @param fn a tracked function to reset. + */ + reset(fn?: Function): void; + /** + * Iterates through the list of functions passed to `tracker.calls()` and will throw an error for functions that + * have not been called the expected number of times. + * + * ```js + * import assert from 'node:assert'; + * + * // Creates call tracker. + * const tracker = new assert.CallTracker(); + * + * function func() {} + * + * // Returns a function that wraps func() that must be called exact times + * // before tracker.verify(). + * const callsfunc = tracker.calls(func, 2); + * + * callsfunc(); + * + * // Will throw an error since callsfunc() was only called once. + * tracker.verify(); + * ``` + * @since v14.2.0, v12.19.0 + */ + verify(): void; + } + interface CallTrackerCall { + thisArg: object; + arguments: unknown[]; + } + interface CallTrackerReportInformation { + message: string; + /** The actual number of times the function was called. */ + actual: number; + /** The number of times the function was expected to be called. */ + expected: number; + /** The name of the function that is wrapped. */ + operator: string; + /** A stack trace of the function. */ + stack: object; + } + type AssertPredicate = RegExp | (new () => object) | ((thrown: unknown) => boolean) | object | Error; + /** + * Throws an `AssertionError` with the provided error message or a default + * error message. If the `message` parameter is an instance of an `Error` then + * it will be thrown instead of the `AssertionError`. + * + * ```js + * import assert from 'node:assert/strict'; + * + * assert.fail(); + * // AssertionError [ERR_ASSERTION]: Failed + * + * assert.fail('boom'); + * // AssertionError [ERR_ASSERTION]: boom + * + * assert.fail(new TypeError('need array')); + * // TypeError: need array + * ``` + * + * Using `assert.fail()` with more than two arguments is possible but deprecated. + * See below for further details. + * @since v0.1.21 + * @param [message='Failed'] + */ + function fail(message?: string | Error): never; + /** @deprecated since v10.0.0 - use fail([message]) or other assert functions instead. */ + function fail( + actual: unknown, + expected: unknown, + message?: string | Error, + operator?: string, + // tslint:disable-next-line:ban-types + stackStartFn?: Function + ): never; + /** + * Tests if `value` is truthy. It is equivalent to`assert.equal(!!value, true, message)`. + * + * If `value` is not truthy, an `AssertionError` is thrown with a `message`property set equal to the value of the `message` parameter. If the `message`parameter is `undefined`, a default + * error message is assigned. If the `message`parameter is an instance of an `Error` then it will be thrown instead of the`AssertionError`. + * If no arguments are passed in at all `message` will be set to the string:`` 'No value argument passed to `assert.ok()`' ``. + * + * Be aware that in the `repl` the error message will be different to the one + * thrown in a file! See below for further details. + * + * ```js + * import assert from 'node:assert/strict'; + * + * assert.ok(true); + * // OK + * assert.ok(1); + * // OK + * + * assert.ok(); + * // AssertionError: No value argument passed to `assert.ok()` + * + * assert.ok(false, 'it\'s false'); + * // AssertionError: it's false + * + * // In the repl: + * assert.ok(typeof 123 === 'string'); + * // AssertionError: false == true + * + * // In a file (e.g. test.js): + * assert.ok(typeof 123 === 'string'); + * // AssertionError: The expression evaluated to a falsy value: + * // + * // assert.ok(typeof 123 === 'string') + * + * assert.ok(false); + * // AssertionError: The expression evaluated to a falsy value: + * // + * // assert.ok(false) + * + * assert.ok(0); + * // AssertionError: The expression evaluated to a falsy value: + * // + * // assert.ok(0) + * ``` + * + * ```js + * import assert from 'node:assert/strict'; + * + * // Using `assert()` works the same: + * assert(0); + * // AssertionError: The expression evaluated to a falsy value: + * // + * // assert(0) + * ``` + * @since v0.1.21 + */ + function ok(value: unknown, message?: string | Error): asserts value; + /** + * **Strict assertion mode** + * + * An alias of {@link strictEqual}. + * + * **Legacy assertion mode** + * + * > Stability: 3 - Legacy: Use {@link strictEqual} instead. + * + * Tests shallow, coercive equality between the `actual` and `expected` parameters + * using the [`==` operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Equality). `NaN` is specially handled + * and treated as being identical if both sides are `NaN`. + * + * ```js + * import assert from 'node:assert'; + * + * assert.equal(1, 1); + * // OK, 1 == 1 + * assert.equal(1, '1'); + * // OK, 1 == '1' + * assert.equal(NaN, NaN); + * // OK + * + * assert.equal(1, 2); + * // AssertionError: 1 == 2 + * assert.equal({ a: { b: 1 } }, { a: { b: 1 } }); + * // AssertionError: { a: { b: 1 } } == { a: { b: 1 } } + * ``` + * + * If the values are not equal, an `AssertionError` is thrown with a `message`property set equal to the value of the `message` parameter. If the `message`parameter is undefined, a default + * error message is assigned. If the `message`parameter is an instance of an `Error` then it will be thrown instead of the`AssertionError`. + * @since v0.1.21 + */ + function equal(actual: unknown, expected: unknown, message?: string | Error): void; + /** + * **Strict assertion mode** + * + * An alias of {@link notStrictEqual}. + * + * **Legacy assertion mode** + * + * > Stability: 3 - Legacy: Use {@link notStrictEqual} instead. + * + * Tests shallow, coercive inequality with the [`!=` operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Inequality). `NaN` is + * specially handled and treated as being identical if both sides are `NaN`. + * + * ```js + * import assert from 'node:assert'; + * + * assert.notEqual(1, 2); + * // OK + * + * assert.notEqual(1, 1); + * // AssertionError: 1 != 1 + * + * assert.notEqual(1, '1'); + * // AssertionError: 1 != '1' + * ``` + * + * If the values are equal, an `AssertionError` is thrown with a `message`property set equal to the value of the `message` parameter. If the `message`parameter is undefined, a default error + * message is assigned. If the `message`parameter is an instance of an `Error` then it will be thrown instead of the`AssertionError`. + * @since v0.1.21 + */ + function notEqual(actual: unknown, expected: unknown, message?: string | Error): void; + /** + * **Strict assertion mode** + * + * An alias of {@link deepStrictEqual}. + * + * **Legacy assertion mode** + * + * > Stability: 3 - Legacy: Use {@link deepStrictEqual} instead. + * + * Tests for deep equality between the `actual` and `expected` parameters. Consider + * using {@link deepStrictEqual} instead. {@link deepEqual} can have + * surprising results. + * + * _Deep equality_ means that the enumerable "own" properties of child objects + * are also recursively evaluated by the following rules. + * @since v0.1.21 + */ + function deepEqual(actual: unknown, expected: unknown, message?: string | Error): void; + /** + * **Strict assertion mode** + * + * An alias of {@link notDeepStrictEqual}. + * + * **Legacy assertion mode** + * + * > Stability: 3 - Legacy: Use {@link notDeepStrictEqual} instead. + * + * Tests for any deep inequality. Opposite of {@link deepEqual}. + * + * ```js + * import assert from 'node:assert'; + * + * const obj1 = { + * a: { + * b: 1, + * }, + * }; + * const obj2 = { + * a: { + * b: 2, + * }, + * }; + * const obj3 = { + * a: { + * b: 1, + * }, + * }; + * const obj4 = { __proto__: obj1 }; + * + * assert.notDeepEqual(obj1, obj1); + * // AssertionError: { a: { b: 1 } } notDeepEqual { a: { b: 1 } } + * + * assert.notDeepEqual(obj1, obj2); + * // OK + * + * assert.notDeepEqual(obj1, obj3); + * // AssertionError: { a: { b: 1 } } notDeepEqual { a: { b: 1 } } + * + * assert.notDeepEqual(obj1, obj4); + * // OK + * ``` + * + * If the values are deeply equal, an `AssertionError` is thrown with a`message` property set equal to the value of the `message` parameter. If the`message` parameter is undefined, a default + * error message is assigned. If the`message` parameter is an instance of an `Error` then it will be thrown + * instead of the `AssertionError`. + * @since v0.1.21 + */ + function notDeepEqual(actual: unknown, expected: unknown, message?: string | Error): void; + /** + * Tests strict equality between the `actual` and `expected` parameters as + * determined by [`Object.is()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is). + * + * ```js + * import assert from 'node:assert/strict'; + * + * assert.strictEqual(1, 2); + * // AssertionError [ERR_ASSERTION]: Expected inputs to be strictly equal: + * // + * // 1 !== 2 + * + * assert.strictEqual(1, 1); + * // OK + * + * assert.strictEqual('Hello foobar', 'Hello World!'); + * // AssertionError [ERR_ASSERTION]: Expected inputs to be strictly equal: + * // + actual - expected + * // + * // + 'Hello foobar' + * // - 'Hello World!' + * // ^ + * + * const apples = 1; + * const oranges = 2; + * assert.strictEqual(apples, oranges, `apples ${apples} !== oranges ${oranges}`); + * // AssertionError [ERR_ASSERTION]: apples 1 !== oranges 2 + * + * assert.strictEqual(1, '1', new TypeError('Inputs are not identical')); + * // TypeError: Inputs are not identical + * ``` + * + * If the values are not strictly equal, an `AssertionError` is thrown with a`message` property set equal to the value of the `message` parameter. If the`message` parameter is undefined, a + * default error message is assigned. If the`message` parameter is an instance of an `Error` then it will be thrown + * instead of the `AssertionError`. + * @since v0.1.21 + */ + function strictEqual(actual: unknown, expected: T, message?: string | Error): asserts actual is T; + /** + * Tests strict inequality between the `actual` and `expected` parameters as + * determined by [`Object.is()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is). + * + * ```js + * import assert from 'node:assert/strict'; + * + * assert.notStrictEqual(1, 2); + * // OK + * + * assert.notStrictEqual(1, 1); + * // AssertionError [ERR_ASSERTION]: Expected "actual" to be strictly unequal to: + * // + * // 1 + * + * assert.notStrictEqual(1, '1'); + * // OK + * ``` + * + * If the values are strictly equal, an `AssertionError` is thrown with a`message` property set equal to the value of the `message` parameter. If the`message` parameter is undefined, a + * default error message is assigned. If the`message` parameter is an instance of an `Error` then it will be thrown + * instead of the `AssertionError`. + * @since v0.1.21 + */ + function notStrictEqual(actual: unknown, expected: unknown, message?: string | Error): void; + /** + * Tests for deep equality between the `actual` and `expected` parameters. + * "Deep" equality means that the enumerable "own" properties of child objects + * are recursively evaluated also by the following rules. + * @since v1.2.0 + */ + function deepStrictEqual(actual: unknown, expected: T, message?: string | Error): asserts actual is T; + /** + * Tests for deep strict inequality. Opposite of {@link deepStrictEqual}. + * + * ```js + * import assert from 'node:assert/strict'; + * + * assert.notDeepStrictEqual({ a: 1 }, { a: '1' }); + * // OK + * ``` + * + * If the values are deeply and strictly equal, an `AssertionError` is thrown + * with a `message` property set equal to the value of the `message` parameter. If + * the `message` parameter is undefined, a default error message is assigned. If + * the `message` parameter is an instance of an `Error` then it will be thrown + * instead of the `AssertionError`. + * @since v1.2.0 + */ + function notDeepStrictEqual(actual: unknown, expected: unknown, message?: string | Error): void; + /** + * Expects the function `fn` to throw an error. + * + * If specified, `error` can be a [`Class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes), + * [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions), a validation function, + * a validation object where each property will be tested for strict deep equality, + * or an instance of error where each property will be tested for strict deep + * equality including the non-enumerable `message` and `name` properties. When + * using an object, it is also possible to use a regular expression, when + * validating against a string property. See below for examples. + * + * If specified, `message` will be appended to the message provided by the`AssertionError` if the `fn` call fails to throw or in case the error validation + * fails. + * + * Custom validation object/error instance: + * + * ```js + * import assert from 'node:assert/strict'; + * + * const err = new TypeError('Wrong value'); + * err.code = 404; + * err.foo = 'bar'; + * err.info = { + * nested: true, + * baz: 'text', + * }; + * err.reg = /abc/i; + * + * assert.throws( + * () => { + * throw err; + * }, + * { + * name: 'TypeError', + * message: 'Wrong value', + * info: { + * nested: true, + * baz: 'text', + * }, + * // Only properties on the validation object will be tested for. + * // Using nested objects requires all properties to be present. Otherwise + * // the validation is going to fail. + * }, + * ); + * + * // Using regular expressions to validate error properties: + * assert.throws( + * () => { + * throw err; + * }, + * { + * // The `name` and `message` properties are strings and using regular + * // expressions on those will match against the string. If they fail, an + * // error is thrown. + * name: /^TypeError$/, + * message: /Wrong/, + * foo: 'bar', + * info: { + * nested: true, + * // It is not possible to use regular expressions for nested properties! + * baz: 'text', + * }, + * // The `reg` property contains a regular expression and only if the + * // validation object contains an identical regular expression, it is going + * // to pass. + * reg: /abc/i, + * }, + * ); + * + * // Fails due to the different `message` and `name` properties: + * assert.throws( + * () => { + * const otherErr = new Error('Not found'); + * // Copy all enumerable properties from `err` to `otherErr`. + * for (const [key, value] of Object.entries(err)) { + * otherErr[key] = value; + * } + * throw otherErr; + * }, + * // The error's `message` and `name` properties will also be checked when using + * // an error as validation object. + * err, + * ); + * ``` + * + * Validate instanceof using constructor: + * + * ```js + * import assert from 'node:assert/strict'; + * + * assert.throws( + * () => { + * throw new Error('Wrong value'); + * }, + * Error, + * ); + * ``` + * + * Validate error message using [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions): + * + * Using a regular expression runs `.toString` on the error object, and will + * therefore also include the error name. + * + * ```js + * import assert from 'node:assert/strict'; + * + * assert.throws( + * () => { + * throw new Error('Wrong value'); + * }, + * /^Error: Wrong value$/, + * ); + * ``` + * + * Custom error validation: + * + * The function must return `true` to indicate all internal validations passed. + * It will otherwise fail with an `AssertionError`. + * + * ```js + * import assert from 'node:assert/strict'; + * + * assert.throws( + * () => { + * throw new Error('Wrong value'); + * }, + * (err) => { + * assert(err instanceof Error); + * assert(/value/.test(err)); + * // Avoid returning anything from validation functions besides `true`. + * // Otherwise, it's not clear what part of the validation failed. Instead, + * // throw an error about the specific validation that failed (as done in this + * // example) and add as much helpful debugging information to that error as + * // possible. + * return true; + * }, + * 'unexpected error', + * ); + * ``` + * + * `error` cannot be a string. If a string is provided as the second + * argument, then `error` is assumed to be omitted and the string will be used for`message` instead. This can lead to easy-to-miss mistakes. Using the same + * message as the thrown error message is going to result in an`ERR_AMBIGUOUS_ARGUMENT` error. Please read the example below carefully if using + * a string as the second argument gets considered: + * + * ```js + * import assert from 'node:assert/strict'; + * + * function throwingFirst() { + * throw new Error('First'); + * } + * + * function throwingSecond() { + * throw new Error('Second'); + * } + * + * function notThrowing() {} + * + * // The second argument is a string and the input function threw an Error. + * // The first case will not throw as it does not match for the error message + * // thrown by the input function! + * assert.throws(throwingFirst, 'Second'); + * // In the next example the message has no benefit over the message from the + * // error and since it is not clear if the user intended to actually match + * // against the error message, Node.js throws an `ERR_AMBIGUOUS_ARGUMENT` error. + * assert.throws(throwingSecond, 'Second'); + * // TypeError [ERR_AMBIGUOUS_ARGUMENT] + * + * // The string is only used (as message) in case the function does not throw: + * assert.throws(notThrowing, 'Second'); + * // AssertionError [ERR_ASSERTION]: Missing expected exception: Second + * + * // If it was intended to match for the error message do this instead: + * // It does not throw because the error messages match. + * assert.throws(throwingSecond, /Second$/); + * + * // If the error message does not match, an AssertionError is thrown. + * assert.throws(throwingFirst, /Second$/); + * // AssertionError [ERR_ASSERTION] + * ``` + * + * Due to the confusing error-prone notation, avoid a string as the second + * argument. + * @since v0.1.21 + */ + function throws(block: () => unknown, message?: string | Error): void; + function throws(block: () => unknown, error: AssertPredicate, message?: string | Error): void; + /** + * Asserts that the function `fn` does not throw an error. + * + * Using `assert.doesNotThrow()` is actually not useful because there + * is no benefit in catching an error and then rethrowing it. Instead, consider + * adding a comment next to the specific code path that should not throw and keep + * error messages as expressive as possible. + * + * When `assert.doesNotThrow()` is called, it will immediately call the `fn`function. + * + * If an error is thrown and it is the same type as that specified by the `error`parameter, then an `AssertionError` is thrown. If the error is of a + * different type, or if the `error` parameter is undefined, the error is + * propagated back to the caller. + * + * If specified, `error` can be a [`Class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes), + * [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions), or a validation + * function. See {@link throws} for more details. + * + * The following, for instance, will throw the `TypeError` because there is no + * matching error type in the assertion: + * + * ```js + * import assert from 'node:assert/strict'; + * + * assert.doesNotThrow( + * () => { + * throw new TypeError('Wrong value'); + * }, + * SyntaxError, + * ); + * ``` + * + * However, the following will result in an `AssertionError` with the message + * 'Got unwanted exception...': + * + * ```js + * import assert from 'node:assert/strict'; + * + * assert.doesNotThrow( + * () => { + * throw new TypeError('Wrong value'); + * }, + * TypeError, + * ); + * ``` + * + * If an `AssertionError` is thrown and a value is provided for the `message`parameter, the value of `message` will be appended to the `AssertionError` message: + * + * ```js + * import assert from 'node:assert/strict'; + * + * assert.doesNotThrow( + * () => { + * throw new TypeError('Wrong value'); + * }, + * /Wrong value/, + * 'Whoops', + * ); + * // Throws: AssertionError: Got unwanted exception: Whoops + * ``` + * @since v0.1.21 + */ + function doesNotThrow(block: () => unknown, message?: string | Error): void; + function doesNotThrow(block: () => unknown, error: AssertPredicate, message?: string | Error): void; + /** + * Throws `value` if `value` is not `undefined` or `null`. This is useful when + * testing the `error` argument in callbacks. The stack trace contains all frames + * from the error passed to `ifError()` including the potential new frames for`ifError()` itself. + * + * ```js + * import assert from 'node:assert/strict'; + * + * assert.ifError(null); + * // OK + * assert.ifError(0); + * // AssertionError [ERR_ASSERTION]: ifError got unwanted exception: 0 + * assert.ifError('error'); + * // AssertionError [ERR_ASSERTION]: ifError got unwanted exception: 'error' + * assert.ifError(new Error()); + * // AssertionError [ERR_ASSERTION]: ifError got unwanted exception: Error + * + * // Create some random error frames. + * let err; + * (function errorFrame() { + * err = new Error('test error'); + * })(); + * + * (function ifErrorFrame() { + * assert.ifError(err); + * })(); + * // AssertionError [ERR_ASSERTION]: ifError got unwanted exception: test error + * // at ifErrorFrame + * // at errorFrame + * ``` + * @since v0.1.97 + */ + function ifError(value: unknown): asserts value is null | undefined; + /** + * Awaits the `asyncFn` promise or, if `asyncFn` is a function, immediately + * calls the function and awaits the returned promise to complete. It will then + * check that the promise is rejected. + * + * If `asyncFn` is a function and it throws an error synchronously,`assert.rejects()` will return a rejected `Promise` with that error. If the + * function does not return a promise, `assert.rejects()` will return a rejected`Promise` with an `ERR_INVALID_RETURN_VALUE` error. In both cases the error + * handler is skipped. + * + * Besides the async nature to await the completion behaves identically to {@link throws}. + * + * If specified, `error` can be a [`Class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes), + * [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions), a validation function, + * an object where each property will be tested for, or an instance of error where + * each property will be tested for including the non-enumerable `message` and`name` properties. + * + * If specified, `message` will be the message provided by the `AssertionError` if the `asyncFn` fails to reject. + * + * ```js + * import assert from 'node:assert/strict'; + * + * await assert.rejects( + * async () => { + * throw new TypeError('Wrong value'); + * }, + * { + * name: 'TypeError', + * message: 'Wrong value', + * }, + * ); + * ``` + * + * ```js + * import assert from 'node:assert/strict'; + * + * await assert.rejects( + * async () => { + * throw new TypeError('Wrong value'); + * }, + * (err) => { + * assert.strictEqual(err.name, 'TypeError'); + * assert.strictEqual(err.message, 'Wrong value'); + * return true; + * }, + * ); + * ``` + * + * ```js + * import assert from 'node:assert/strict'; + * + * assert.rejects( + * Promise.reject(new Error('Wrong value')), + * Error, + * ).then(() => { + * // ... + * }); + * ``` + * + * `error` cannot be a string. If a string is provided as the second + * argument, then `error` is assumed to be omitted and the string will be used for`message` instead. This can lead to easy-to-miss mistakes. Please read the + * example in {@link throws} carefully if using a string as the second + * argument gets considered. + * @since v10.0.0 + */ + function rejects(block: (() => Promise) | Promise, message?: string | Error): Promise; + function rejects(block: (() => Promise) | Promise, error: AssertPredicate, message?: string | Error): Promise; + /** + * Awaits the `asyncFn` promise or, if `asyncFn` is a function, immediately + * calls the function and awaits the returned promise to complete. It will then + * check that the promise is not rejected. + * + * If `asyncFn` is a function and it throws an error synchronously,`assert.doesNotReject()` will return a rejected `Promise` with that error. If + * the function does not return a promise, `assert.doesNotReject()` will return a + * rejected `Promise` with an `ERR_INVALID_RETURN_VALUE` error. In both cases + * the error handler is skipped. + * + * Using `assert.doesNotReject()` is actually not useful because there is little + * benefit in catching a rejection and then rejecting it again. Instead, consider + * adding a comment next to the specific code path that should not reject and keep + * error messages as expressive as possible. + * + * If specified, `error` can be a [`Class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes), + * [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions), or a validation + * function. See {@link throws} for more details. + * + * Besides the async nature to await the completion behaves identically to {@link doesNotThrow}. + * + * ```js + * import assert from 'node:assert/strict'; + * + * await assert.doesNotReject( + * async () => { + * throw new TypeError('Wrong value'); + * }, + * SyntaxError, + * ); + * ``` + * + * ```js + * import assert from 'node:assert/strict'; + * + * assert.doesNotReject(Promise.reject(new TypeError('Wrong value'))) + * .then(() => { + * // ... + * }); + * ``` + * @since v10.0.0 + */ + function doesNotReject(block: (() => Promise) | Promise, message?: string | Error): Promise; + function doesNotReject(block: (() => Promise) | Promise, error: AssertPredicate, message?: string | Error): Promise; + /** + * Expects the `string` input to match the regular expression. + * + * ```js + * import assert from 'node:assert/strict'; + * + * assert.match('I will fail', /pass/); + * // AssertionError [ERR_ASSERTION]: The input did not match the regular ... + * + * assert.match(123, /pass/); + * // AssertionError [ERR_ASSERTION]: The "string" argument must be of type string. + * + * assert.match('I will pass', /pass/); + * // OK + * ``` + * + * If the values do not match, or if the `string` argument is of another type than`string`, an `AssertionError` is thrown with a `message` property set equal + * to the value of the `message` parameter. If the `message` parameter is + * undefined, a default error message is assigned. If the `message` parameter is an + * instance of an `Error` then it will be thrown instead of the `AssertionError`. + * @since v13.6.0, v12.16.0 + */ + function match(value: string, regExp: RegExp, message?: string | Error): void; + /** + * Expects the `string` input not to match the regular expression. + * + * ```js + * import assert from 'node:assert/strict'; + * + * assert.doesNotMatch('I will fail', /fail/); + * // AssertionError [ERR_ASSERTION]: The input was expected to not match the ... + * + * assert.doesNotMatch(123, /pass/); + * // AssertionError [ERR_ASSERTION]: The "string" argument must be of type string. + * + * assert.doesNotMatch('I will pass', /different/); + * // OK + * ``` + * + * If the values do match, or if the `string` argument is of another type than`string`, an `AssertionError` is thrown with a `message` property set equal + * to the value of the `message` parameter. If the `message` parameter is + * undefined, a default error message is assigned. If the `message` parameter is an + * instance of an `Error` then it will be thrown instead of the `AssertionError`. + * @since v13.6.0, v12.16.0 + */ + function doesNotMatch(value: string, regExp: RegExp, message?: string | Error): void; + const strict: Omit & { + (value: unknown, message?: string | Error): asserts value; + equal: typeof strictEqual; + notEqual: typeof notStrictEqual; + deepEqual: typeof deepStrictEqual; + notDeepEqual: typeof notDeepStrictEqual; + // Mapped types and assertion functions are incompatible? + // TS2775: Assertions require every name in the call target + // to be declared with an explicit type annotation. + ok: typeof ok; + strictEqual: typeof strictEqual; + deepStrictEqual: typeof deepStrictEqual; + ifError: typeof ifError; + strict: typeof strict; + }; + } + export = assert; +} +declare module 'assert' { + import assert = require('node:assert'); + export = assert; +} diff --git a/node_modules/@types/node/assert/strict.d.ts b/node_modules/@types/node/assert/strict.d.ts new file mode 100644 index 0000000..b4319b9 --- /dev/null +++ b/node_modules/@types/node/assert/strict.d.ts @@ -0,0 +1,8 @@ +declare module 'assert/strict' { + import { strict } from 'node:assert'; + export = strict; +} +declare module 'node:assert/strict' { + import { strict } from 'node:assert'; + export = strict; +} diff --git a/node_modules/@types/node/async_hooks.d.ts b/node_modules/@types/node/async_hooks.d.ts new file mode 100644 index 0000000..51da4a4 --- /dev/null +++ b/node_modules/@types/node/async_hooks.d.ts @@ -0,0 +1,532 @@ +/** + * We strongly discourage the use of the `async_hooks` API. + * Other APIs that can cover most of its use cases include: + * + * * `AsyncLocalStorage` tracks async context + * * `process.getActiveResourcesInfo()` tracks active resources + * + * The `node:async_hooks` module provides an API to track asynchronous resources. + * It can be accessed using: + * + * ```js + * import async_hooks from 'node:async_hooks'; + * ``` + * @experimental + * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/async_hooks.js) + */ +declare module 'node:async_hooks' { + /** + * ```js + * import { executionAsyncId } from 'node:async_hooks'; + * import fs from 'node:fs'; + * + * console.log(executionAsyncId()); // 1 - bootstrap + * const path = '.'; + * fs.open(path, 'r', (err, fd) => { + * console.log(executionAsyncId()); // 6 - open() + * }); + * ``` + * + * The ID returned from `executionAsyncId()` is related to execution timing, not + * causality (which is covered by `triggerAsyncId()`): + * + * ```js + * const server = net.createServer((conn) => { + * // Returns the ID of the server, not of the new connection, because the + * // callback runs in the execution scope of the server's MakeCallback(). + * async_hooks.executionAsyncId(); + * + * }).listen(port, () => { + * // Returns the ID of a TickObject (process.nextTick()) because all + * // callbacks passed to .listen() are wrapped in a nextTick(). + * async_hooks.executionAsyncId(); + * }); + * ``` + * + * Promise contexts may not get precise `executionAsyncIds` by default. + * See the section on `promise execution tracking`. + * @since v8.1.0 + * @return The `asyncId` of the current execution context. Useful to track when something calls. + */ + function executionAsyncId(): number; + /** + * Resource objects returned by `executionAsyncResource()` are most often internal + * Node.js handle objects with undocumented APIs. Using any functions or properties + * on the object is likely to crash your application and should be avoided. + * + * Using `executionAsyncResource()` in the top-level execution context will + * return an empty object as there is no handle or request object to use, + * but having an object representing the top-level can be helpful. + * + * ```js + * import { open } from 'node:fs'; + * import { executionAsyncId, executionAsyncResource } from 'node:async_hooks'; + * + * console.log(executionAsyncId(), executionAsyncResource()); // 1 {} + * open(new URL(import.meta.url), 'r', (err, fd) => { + * console.log(executionAsyncId(), executionAsyncResource()); // 7 FSReqWrap + * }); + * ``` + * + * This can be used to implement continuation local storage without the + * use of a tracking `Map` to store the metadata: + * + * ```js + * import { createServer } from 'node:http'; + * import { + * executionAsyncId, + * executionAsyncResource, + * createHook, + * } from 'async_hooks'; + * const sym = Symbol('state'); // Private symbol to avoid pollution + * + * createHook({ + * init(asyncId, type, triggerAsyncId, resource) { + * const cr = executionAsyncResource(); + * if (cr) { + * resource[sym] = cr[sym]; + * } + * }, + * }).enable(); + * + * const server = createServer((req, res) => { + * executionAsyncResource()[sym] = { state: req.url }; + * setTimeout(function() { + * res.end(JSON.stringify(executionAsyncResource()[sym])); + * }, 100); + * }).listen(3000); + * ``` + * @since v13.9.0, v12.17.0 + * @return The resource representing the current execution. Useful to store data within the resource. + */ + function executionAsyncResource(): object; + /** + * ```js + * const server = net.createServer((conn) => { + * // The resource that caused (or triggered) this callback to be called + * // was that of the new connection. Thus the return value of triggerAsyncId() + * // is the asyncId of "conn". + * async_hooks.triggerAsyncId(); + * + * }).listen(port, () => { + * // Even though all callbacks passed to .listen() are wrapped in a nextTick() + * // the callback itself exists because the call to the server's .listen() + * // was made. So the return value would be the ID of the server. + * async_hooks.triggerAsyncId(); + * }); + * ``` + * + * Promise contexts may not get valid `triggerAsyncId`s by default. See + * the section on `promise execution tracking`. + * @return The ID of the resource responsible for calling the callback that is currently being executed. + */ + function triggerAsyncId(): number; + interface HookCallbacks { + /** + * Called when a class is constructed that has the possibility to emit an asynchronous event. + * @param asyncId a unique ID for the async resource + * @param type the type of the async resource + * @param triggerAsyncId the unique ID of the async resource in whose execution context this async resource was created + * @param resource reference to the resource representing the async operation, needs to be released during destroy + */ + init?(asyncId: number, type: string, triggerAsyncId: number, resource: object): void; + /** + * When an asynchronous operation is initiated or completes a callback is called to notify the user. + * The before callback is called just before said callback is executed. + * @param asyncId the unique identifier assigned to the resource about to execute the callback. + */ + before?(asyncId: number): void; + /** + * Called immediately after the callback specified in before is completed. + * @param asyncId the unique identifier assigned to the resource which has executed the callback. + */ + after?(asyncId: number): void; + /** + * Called when a promise has resolve() called. This may not be in the same execution id + * as the promise itself. + * @param asyncId the unique id for the promise that was resolve()d. + */ + promiseResolve?(asyncId: number): void; + /** + * Called after the resource corresponding to asyncId is destroyed + * @param asyncId a unique ID for the async resource + */ + destroy?(asyncId: number): void; + } + interface AsyncHook { + /** + * Enable the callbacks for a given AsyncHook instance. If no callbacks are provided enabling is a noop. + */ + enable(): this; + /** + * Disable the callbacks for a given AsyncHook instance from the global pool of AsyncHook callbacks to be executed. Once a hook has been disabled it will not be called again until enabled. + */ + disable(): this; + } + /** + * Registers functions to be called for different lifetime events of each async + * operation. + * + * The callbacks `init()`/`before()`/`after()`/`destroy()` are called for the + * respective asynchronous event during a resource's lifetime. + * + * All callbacks are optional. For example, if only resource cleanup needs to + * be tracked, then only the `destroy` callback needs to be passed. The + * specifics of all functions that can be passed to `callbacks` is in the `Hook Callbacks` section. + * + * ```js + * import { createHook } from 'node:async_hooks'; + * + * const asyncHook = createHook({ + * init(asyncId, type, triggerAsyncId, resource) { }, + * destroy(asyncId) { }, + * }); + * ``` + * + * The callbacks will be inherited via the prototype chain: + * + * ```js + * class MyAsyncCallbacks { + * init(asyncId, type, triggerAsyncId, resource) { } + * destroy(asyncId) {} + * } + * + * class MyAddedCallbacks extends MyAsyncCallbacks { + * before(asyncId) { } + * after(asyncId) { } + * } + * + * const asyncHook = async_hooks.createHook(new MyAddedCallbacks()); + * ``` + * + * Because promises are asynchronous resources whose lifecycle is tracked + * via the async hooks mechanism, the `init()`, `before()`, `after()`, and`destroy()` callbacks _must not_ be async functions that return promises. + * @since v8.1.0 + * @param callbacks The `Hook Callbacks` to register + * @return Instance used for disabling and enabling hooks + */ + function createHook(callbacks: HookCallbacks): AsyncHook; + interface AsyncResourceOptions { + /** + * The ID of the execution context that created this async event. + * @default executionAsyncId() + */ + triggerAsyncId?: number | undefined; + /** + * Disables automatic `emitDestroy` when the object is garbage collected. + * This usually does not need to be set (even if `emitDestroy` is called + * manually), unless the resource's `asyncId` is retrieved and the + * sensitive API's `emitDestroy` is called with it. + * @default false + */ + requireManualDestroy?: boolean | undefined; + } + /** + * The class `AsyncResource` is designed to be extended by the embedder's async + * resources. Using this, users can easily trigger the lifetime events of their + * own resources. + * + * The `init` hook will trigger when an `AsyncResource` is instantiated. + * + * The following is an overview of the `AsyncResource` API. + * + * ```js + * import { AsyncResource, executionAsyncId } from 'node:async_hooks'; + * + * // AsyncResource() is meant to be extended. Instantiating a + * // new AsyncResource() also triggers init. If triggerAsyncId is omitted then + * // async_hook.executionAsyncId() is used. + * const asyncResource = new AsyncResource( + * type, { triggerAsyncId: executionAsyncId(), requireManualDestroy: false }, + * ); + * + * // Run a function in the execution context of the resource. This will + * // * establish the context of the resource + * // * trigger the AsyncHooks before callbacks + * // * call the provided function `fn` with the supplied arguments + * // * trigger the AsyncHooks after callbacks + * // * restore the original execution context + * asyncResource.runInAsyncScope(fn, thisArg, ...args); + * + * // Call AsyncHooks destroy callbacks. + * asyncResource.emitDestroy(); + * + * // Return the unique ID assigned to the AsyncResource instance. + * asyncResource.asyncId(); + * + * // Return the trigger ID for the AsyncResource instance. + * asyncResource.triggerAsyncId(); + * ``` + */ + class AsyncResource { + /** + * AsyncResource() is meant to be extended. Instantiating a + * new AsyncResource() also triggers init. If triggerAsyncId is omitted then + * async_hook.executionAsyncId() is used. + * @param type The type of async event. + * @param triggerAsyncId The ID of the execution context that created + * this async event (default: `executionAsyncId()`), or an + * AsyncResourceOptions object (since v9.3.0) + */ + constructor(type: string, triggerAsyncId?: number | AsyncResourceOptions); + /** + * Binds the given function to the current execution context. + * @since v14.8.0, v12.19.0 + * @param fn The function to bind to the current execution context. + * @param type An optional name to associate with the underlying `AsyncResource`. + */ + static bind any, ThisArg>(fn: Func, type?: string, thisArg?: ThisArg): Func; + /** + * Binds the given function to execute to this `AsyncResource`'s scope. + * @since v14.8.0, v12.19.0 + * @param fn The function to bind to the current `AsyncResource`. + */ + bind any>(fn: Func): Func; + /** + * Call the provided function with the provided arguments in the execution context + * of the async resource. This will establish the context, trigger the AsyncHooks + * before callbacks, call the function, trigger the AsyncHooks after callbacks, and + * then restore the original execution context. + * @since v9.6.0 + * @param fn The function to call in the execution context of this async resource. + * @param thisArg The receiver to be used for the function call. + * @param args Optional arguments to pass to the function. + */ + runInAsyncScope(fn: (this: This, ...args: any[]) => Result, thisArg?: This, ...args: any[]): Result; + /** + * Call all `destroy` hooks. This should only ever be called once. An error will + * be thrown if it is called more than once. This **must** be manually called. If + * the resource is left to be collected by the GC then the `destroy` hooks will + * never be called. + * @return A reference to `asyncResource`. + */ + emitDestroy(): this; + /** + * @return The unique `asyncId` assigned to the resource. + */ + asyncId(): number; + /** + * + * @return The same `triggerAsyncId` that is passed to the `AsyncResource` constructor. + */ + triggerAsyncId(): number; + } + /** + * This class creates stores that stay coherent through asynchronous operations. + * + * While you can create your own implementation on top of the `node:async_hooks`module, `AsyncLocalStorage` should be preferred as it is a performant and memory + * safe implementation that involves significant optimizations that are non-obvious + * to implement. + * + * The following example uses `AsyncLocalStorage` to build a simple logger + * that assigns IDs to incoming HTTP requests and includes them in messages + * logged within each request. + * + * ```js + * import http from 'node:http'; + * import { AsyncLocalStorage } from 'node:async_hooks'; + * + * const asyncLocalStorage = new AsyncLocalStorage(); + * + * function logWithId(msg) { + * const id = asyncLocalStorage.getStore(); + * console.log(`${id !== undefined ? id : '-'}:`, msg); + * } + * + * let idSeq = 0; + * http.createServer((req, res) => { + * asyncLocalStorage.run(idSeq++, () => { + * logWithId('start'); + * // Imagine any chain of async operations here + * setImmediate(() => { + * logWithId('finish'); + * res.end(); + * }); + * }); + * }).listen(8080); + * + * http.get('http://localhost:8080'); + * http.get('http://localhost:8080'); + * // Prints: + * // 0: start + * // 1: start + * // 0: finish + * // 1: finish + * ``` + * + * Each instance of `AsyncLocalStorage` maintains an independent storage context. + * Multiple instances can safely exist simultaneously without risk of interfering + * with each other's data. + * @since v13.10.0, v12.17.0 + */ + class AsyncLocalStorage { + /** + * Binds the given function to the current execution context. + * @since v19.8.0 + * @experimental + * @param fn The function to bind to the current execution context. + * @return A new function that calls `fn` within the captured execution context. + */ + static bind any>(fn: Func): Func; + /** + * Captures the current execution context and returns a function that accepts a + * function as an argument. Whenever the returned function is called, it + * calls the function passed to it within the captured context. + * + * ```js + * const asyncLocalStorage = new AsyncLocalStorage(); + * const runInAsyncScope = asyncLocalStorage.run(123, () => AsyncLocalStorage.snapshot()); + * const result = asyncLocalStorage.run(321, () => runInAsyncScope(() => asyncLocalStorage.getStore())); + * console.log(result); // returns 123 + * ``` + * + * AsyncLocalStorage.snapshot() can replace the use of AsyncResource for simple + * async context tracking purposes, for example: + * + * ```js + * class Foo { + * #runInAsyncScope = AsyncLocalStorage.snapshot(); + * + * get() { return this.#runInAsyncScope(() => asyncLocalStorage.getStore()); } + * } + * + * const foo = asyncLocalStorage.run(123, () => new Foo()); + * console.log(asyncLocalStorage.run(321, () => foo.get())); // returns 123 + * ``` + * @since v19.8.0 + * @experimental + * @return A new function with the signature `(fn: (...args) : R, ...args) : R`. + */ + static snapshot(): (fn: (...args: TArgs) => R, ...args: TArgs) => R; + /** + * Disables the instance of `AsyncLocalStorage`. All subsequent calls + * to `asyncLocalStorage.getStore()` will return `undefined` until`asyncLocalStorage.run()` or `asyncLocalStorage.enterWith()` is called again. + * + * When calling `asyncLocalStorage.disable()`, all current contexts linked to the + * instance will be exited. + * + * Calling `asyncLocalStorage.disable()` is required before the`asyncLocalStorage` can be garbage collected. This does not apply to stores + * provided by the `asyncLocalStorage`, as those objects are garbage collected + * along with the corresponding async resources. + * + * Use this method when the `asyncLocalStorage` is not in use anymore + * in the current process. + * @since v13.10.0, v12.17.0 + * @experimental + */ + disable(): void; + /** + * Returns the current store. + * If called outside of an asynchronous context initialized by + * calling `asyncLocalStorage.run()` or `asyncLocalStorage.enterWith()`, it + * returns `undefined`. + * @since v13.10.0, v12.17.0 + */ + getStore(): T | undefined; + /** + * Runs a function synchronously within a context and returns its + * return value. The store is not accessible outside of the callback function. + * The store is accessible to any asynchronous operations created within the + * callback. + * + * The optional `args` are passed to the callback function. + * + * If the callback function throws an error, the error is thrown by `run()` too. + * The stacktrace is not impacted by this call and the context is exited. + * + * Example: + * + * ```js + * const store = { id: 2 }; + * try { + * asyncLocalStorage.run(store, () => { + * asyncLocalStorage.getStore(); // Returns the store object + * setTimeout(() => { + * asyncLocalStorage.getStore(); // Returns the store object + * }, 200); + * throw new Error(); + * }); + * } catch (e) { + * asyncLocalStorage.getStore(); // Returns undefined + * // The error will be caught here + * } + * ``` + * @since v13.10.0, v12.17.0 + */ + run(store: T, callback: () => R): R; + run(store: T, callback: (...args: TArgs) => R, ...args: TArgs): R; + /** + * Runs a function synchronously outside of a context and returns its + * return value. The store is not accessible within the callback function or + * the asynchronous operations created within the callback. Any `getStore()`call done within the callback function will always return `undefined`. + * + * The optional `args` are passed to the callback function. + * + * If the callback function throws an error, the error is thrown by `exit()` too. + * The stacktrace is not impacted by this call and the context is re-entered. + * + * Example: + * + * ```js + * // Within a call to run + * try { + * asyncLocalStorage.getStore(); // Returns the store object or value + * asyncLocalStorage.exit(() => { + * asyncLocalStorage.getStore(); // Returns undefined + * throw new Error(); + * }); + * } catch (e) { + * asyncLocalStorage.getStore(); // Returns the same object or value + * // The error will be caught here + * } + * ``` + * @since v13.10.0, v12.17.0 + * @experimental + */ + exit(callback: (...args: TArgs) => R, ...args: TArgs): R; + /** + * Transitions into the context for the remainder of the current + * synchronous execution and then persists the store through any following + * asynchronous calls. + * + * Example: + * + * ```js + * const store = { id: 1 }; + * // Replaces previous store with the given store object + * asyncLocalStorage.enterWith(store); + * asyncLocalStorage.getStore(); // Returns the store object + * someAsyncOperation(() => { + * asyncLocalStorage.getStore(); // Returns the same object + * }); + * ``` + * + * This transition will continue for the _entire_ synchronous execution. + * This means that if, for example, the context is entered within an event + * handler subsequent event handlers will also run within that context unless + * specifically bound to another context with an `AsyncResource`. That is why`run()` should be preferred over `enterWith()` unless there are strong reasons + * to use the latter method. + * + * ```js + * const store = { id: 1 }; + * + * emitter.on('my-event', () => { + * asyncLocalStorage.enterWith(store); + * }); + * emitter.on('my-event', () => { + * asyncLocalStorage.getStore(); // Returns the same object + * }); + * + * asyncLocalStorage.getStore(); // Returns undefined + * emitter.emit('my-event'); + * asyncLocalStorage.getStore(); // Returns the same object + * ``` + * @since v13.11.0, v12.17.0 + * @experimental + */ + enterWith(store: T): void; + } +} +declare module 'async_hooks' { + export * from 'node:async_hooks'; +} diff --git a/node_modules/@types/node/buffer.d.ts b/node_modules/@types/node/buffer.d.ts new file mode 100644 index 0000000..9917995 --- /dev/null +++ b/node_modules/@types/node/buffer.d.ts @@ -0,0 +1,2354 @@ +/** + * `Buffer` objects are used to represent a fixed-length sequence of bytes. Many + * Node.js APIs support `Buffer`s. + * + * The `Buffer` class is a subclass of JavaScript's [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) class and + * extends it with methods that cover additional use cases. Node.js APIs accept + * plain [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) s wherever `Buffer`s are supported as well. + * + * While the `Buffer` class is available within the global scope, it is still + * recommended to explicitly reference it via an import or require statement. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * // Creates a zero-filled Buffer of length 10. + * const buf1 = Buffer.alloc(10); + * + * // Creates a Buffer of length 10, + * // filled with bytes which all have the value `1`. + * const buf2 = Buffer.alloc(10, 1); + * + * // Creates an uninitialized buffer of length 10. + * // This is faster than calling Buffer.alloc() but the returned + * // Buffer instance might contain old data that needs to be + * // overwritten using fill(), write(), or other functions that fill the Buffer's + * // contents. + * const buf3 = Buffer.allocUnsafe(10); + * + * // Creates a Buffer containing the bytes [1, 2, 3]. + * const buf4 = Buffer.from([1, 2, 3]); + * + * // Creates a Buffer containing the bytes [1, 1, 1, 1] – the entries + * // are all truncated using `(value & 255)` to fit into the range 0–255. + * const buf5 = Buffer.from([257, 257.5, -255, '1']); + * + * // Creates a Buffer containing the UTF-8-encoded bytes for the string 'tést': + * // [0x74, 0xc3, 0xa9, 0x73, 0x74] (in hexadecimal notation) + * // [116, 195, 169, 115, 116] (in decimal notation) + * const buf6 = Buffer.from('tést'); + * + * // Creates a Buffer containing the Latin-1 bytes [0x74, 0xe9, 0x73, 0x74]. + * const buf7 = Buffer.from('tést', 'latin1'); + * ``` + * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/buffer.js) + */ +declare module 'node:buffer' { + import { BinaryLike } from 'node:crypto'; + import { ReadableStream as WebReadableStream } from 'node:stream/web'; + /** + * This function returns `true` if `input` contains only valid UTF-8-encoded data, + * including the case in which `input` is empty. + * + * Throws if the `input` is a detached array buffer. + * @since v19.4.0, v18.14.0 + * @param input The input to validate. + */ + export function isUtf8(input: Buffer | ArrayBuffer | NodeJS.TypedArray): boolean; + /** + * This function returns `true` if `input` contains only valid ASCII-encoded data, + * including the case in which `input` is empty. + * + * Throws if the `input` is a detached array buffer. + * @since v19.6.0, v18.15.0 + * @param input The input to validate. + */ + export function isAscii(input: Buffer | ArrayBuffer | NodeJS.TypedArray): boolean; + export const INSPECT_MAX_BYTES: number; + export const kMaxLength: number; + export const kStringMaxLength: number; + export const constants: { + MAX_LENGTH: number; + MAX_STRING_LENGTH: number; + }; + export type TranscodeEncoding = 'ascii' | 'utf8' | 'utf16le' | 'ucs2' | 'latin1' | 'binary'; + /** + * Re-encodes the given `Buffer` or `Uint8Array` instance from one character + * encoding to another. Returns a new `Buffer` instance. + * + * Throws if the `fromEnc` or `toEnc` specify invalid character encodings or if + * conversion from `fromEnc` to `toEnc` is not permitted. + * + * Encodings supported by `buffer.transcode()` are: `'ascii'`, `'utf8'`,`'utf16le'`, `'ucs2'`, `'latin1'`, and `'binary'`. + * + * The transcoding process will use substitution characters if a given byte + * sequence cannot be adequately represented in the target encoding. For instance: + * + * ```js + * import { Buffer, transcode } from 'node:buffer'; + * + * const newBuf = transcode(Buffer.from('€'), 'utf8', 'ascii'); + * console.log(newBuf.toString('ascii')); + * // Prints: '?' + * ``` + * + * Because the Euro (`€`) sign is not representable in US-ASCII, it is replaced + * with `?` in the transcoded `Buffer`. + * @since v7.1.0 + * @param source A `Buffer` or `Uint8Array` instance. + * @param fromEnc The current encoding. + * @param toEnc To target encoding. + */ + export function transcode(source: Uint8Array, fromEnc: TranscodeEncoding, toEnc: TranscodeEncoding): Buffer; + export const SlowBuffer: { + /** @deprecated since v6.0.0, use `Buffer.allocUnsafeSlow()` */ + new (size: number): Buffer; + prototype: Buffer; + }; + /** + * Resolves a `'blob:nodedata:...'` an associated `Blob` object registered using + * a prior call to `URL.createObjectURL()`. + * @since v16.7.0 + * @experimental + * @param id A `'blob:nodedata:...` URL string returned by a prior call to `URL.createObjectURL()`. + */ + export function resolveObjectURL(id: string): Blob | undefined; + export { Buffer }; + /** + * @experimental + */ + export interface BlobOptions { + /** + * @default 'utf8' + */ + encoding?: BufferEncoding | undefined; + /** + * The Blob content-type. The intent is for `type` to convey + * the MIME media type of the data, however no validation of the type format + * is performed. + */ + type?: string | undefined; + } + /** + * A [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob) encapsulates immutable, raw data that can be safely shared across + * multiple worker threads. + * @since v15.7.0, v14.18.0 + */ + export class Blob { + /** + * The total size of the `Blob` in bytes. + * @since v15.7.0, v14.18.0 + */ + readonly size: number; + /** + * The content-type of the `Blob`. + * @since v15.7.0, v14.18.0 + */ + readonly type: string; + /** + * Creates a new `Blob` object containing a concatenation of the given sources. + * + * {ArrayBuffer}, {TypedArray}, {DataView}, and {Buffer} sources are copied into + * the 'Blob' and can therefore be safely modified after the 'Blob' is created. + * + * String sources are also copied into the `Blob`. + */ + constructor(sources: Array, options?: BlobOptions); + /** + * Returns a promise that fulfills with an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) containing a copy of + * the `Blob` data. + * @since v15.7.0, v14.18.0 + */ + arrayBuffer(): Promise; + /** + * Creates and returns a new `Blob` containing a subset of this `Blob` objects + * data. The original `Blob` is not altered. + * @since v15.7.0, v14.18.0 + * @param start The starting index. + * @param end The ending index. + * @param type The content-type for the new `Blob` + */ + slice(start?: number, end?: number, type?: string): Blob; + /** + * Returns a promise that fulfills with the contents of the `Blob` decoded as a + * UTF-8 string. + * @since v15.7.0, v14.18.0 + */ + text(): Promise; + /** + * Returns a new `ReadableStream` that allows the content of the `Blob` to be read. + * @since v16.7.0 + */ + stream(): WebReadableStream; + } + export interface FileOptions { + /** + * One of either `'transparent'` or `'native'`. When set to `'native'`, line endings in string source parts will be + * converted to the platform native line-ending as specified by `require('node:os').EOL`. + */ + endings?: 'native' | 'transparent'; + /** The File content-type. */ + type?: string; + /** The last modified date of the file. `Default`: Date.now(). */ + lastModified?: number; + } + /** + * A [`File`](https://developer.mozilla.org/en-US/docs/Web/API/File) provides information about files. + * @since v19.2.0, v18.13.0 + */ + export class File extends Blob { + constructor(sources: Array, fileName: string, options?: FileOptions); + /** + * The name of the `File`. + * @since v19.2.0, v18.13.0 + */ + readonly name: string; + /** + * The last modified date of the `File`. + * @since v19.2.0, v18.13.0 + */ + readonly lastModified: number; + } + export import atob = globalThis.atob; + export import btoa = globalThis.btoa; + import { Blob as NodeBlob } from 'buffer'; + // This conditional type will be the existing global Blob in a browser, or + // the copy below in a Node environment. + type __Blob = typeof globalThis extends { onmessage: any; Blob: infer T } ? T : NodeBlob; + global { + namespace NodeJS { + export { BufferEncoding }; + } + // Buffer class + type BufferEncoding = + | 'ascii' + | 'utf8' + | 'utf-8' + | 'utf16le' + | 'ucs2' + | 'ucs-2' + | 'base64' + | 'base64url' + | 'latin1' + | 'binary' + | 'hex'; + type WithImplicitCoercion = + | T + | { + valueOf(): T; + }; + /** + * Raw data is stored in instances of the Buffer class. + * A Buffer is similar to an array of integers but corresponds to a raw memory allocation outside the V8 heap. A Buffer cannot be resized. + * Valid string encodings: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'base64url'|'binary'(deprecated)|'hex' + */ + interface BufferConstructor { + /** + * Allocates a new buffer containing the given {str}. + * + * @param str String to store in buffer. + * @param encoding encoding to use, optional. Default is 'utf8' + * @deprecated since v10.0.0 - Use `Buffer.from(string[, encoding])` instead. + */ + new (str: string, encoding?: BufferEncoding): Buffer; + /** + * Allocates a new buffer of {size} octets. + * + * @param size count of octets to allocate. + * @deprecated since v10.0.0 - Use `Buffer.alloc()` instead (also see `Buffer.allocUnsafe()`). + */ + new (size: number): Buffer; + /** + * Allocates a new buffer containing the given {array} of octets. + * + * @param array The octets to store. + * @deprecated since v10.0.0 - Use `Buffer.from(array)` instead. + */ + new (array: Uint8Array): Buffer; + /** + * Produces a Buffer backed by the same allocated memory as + * the given {ArrayBuffer}/{SharedArrayBuffer}. + * + * + * @param arrayBuffer The ArrayBuffer with which to share memory. + * @deprecated since v10.0.0 - Use `Buffer.from(arrayBuffer[, byteOffset[, length]])` instead. + */ + new (arrayBuffer: ArrayBuffer | SharedArrayBuffer): Buffer; + /** + * Allocates a new buffer containing the given {array} of octets. + * + * @param array The octets to store. + * @deprecated since v10.0.0 - Use `Buffer.from(array)` instead. + */ + new (array: ReadonlyArray): Buffer; + /** + * Copies the passed {buffer} data onto a new {Buffer} instance. + * + * @param buffer The buffer to copy. + * @deprecated since v10.0.0 - Use `Buffer.from(buffer)` instead. + */ + new (buffer: Buffer): Buffer; + /** + * Allocates a new `Buffer` using an `array` of bytes in the range `0` – `255`. + * Array entries outside that range will be truncated to fit into it. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * // Creates a new Buffer containing the UTF-8 bytes of the string 'buffer'. + * const buf = Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]); + * ``` + * + * If `array` is an `Array`\-like object (that is, one with a `length` property of + * type `number`), it is treated as if it is an array, unless it is a `Buffer` or + * a `Uint8Array`. This means all other `TypedArray` variants get treated as an`Array`. To create a `Buffer` from the bytes backing a `TypedArray`, use `Buffer.copyBytesFrom()`. + * + * A `TypeError` will be thrown if `array` is not an `Array` or another type + * appropriate for `Buffer.from()` variants. + * + * `Buffer.from(array)` and `Buffer.from(string)` may also use the internal`Buffer` pool like `Buffer.allocUnsafe()` does. + * @since v5.10.0 + */ + from( + arrayBuffer: WithImplicitCoercion, + byteOffset?: number, + length?: number, + ): Buffer; + /** + * Creates a new Buffer using the passed {data} + * @param data data to create a new Buffer + */ + from(data: Uint8Array | ReadonlyArray): Buffer; + from(data: WithImplicitCoercion | string>): Buffer; + /** + * Creates a new Buffer containing the given JavaScript string {str}. + * If provided, the {encoding} parameter identifies the character encoding. + * If not provided, {encoding} defaults to 'utf8'. + */ + from( + str: + | WithImplicitCoercion + | { + [Symbol.toPrimitive](hint: 'string'): string; + }, + encoding?: BufferEncoding, + ): Buffer; + /** + * Creates a new Buffer using the passed {data} + * @param values to create a new Buffer + */ + of(...items: number[]): Buffer; + /** + * Returns `true` if `obj` is a `Buffer`, `false` otherwise. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * Buffer.isBuffer(Buffer.alloc(10)); // true + * Buffer.isBuffer(Buffer.from('foo')); // true + * Buffer.isBuffer('a string'); // false + * Buffer.isBuffer([]); // false + * Buffer.isBuffer(new Uint8Array(1024)); // false + * ``` + * @since v0.1.101 + */ + isBuffer(obj: any): obj is Buffer; + /** + * Returns `true` if `encoding` is the name of a supported character encoding, + * or `false` otherwise. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * console.log(Buffer.isEncoding('utf8')); + * // Prints: true + * + * console.log(Buffer.isEncoding('hex')); + * // Prints: true + * + * console.log(Buffer.isEncoding('utf/8')); + * // Prints: false + * + * console.log(Buffer.isEncoding('')); + * // Prints: false + * ``` + * @since v0.9.1 + * @param encoding A character encoding name to check. + */ + isEncoding(encoding: string): encoding is BufferEncoding; + /** + * Returns the byte length of a string when encoded using `encoding`. + * This is not the same as [`String.prototype.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length), which does not account + * for the encoding that is used to convert the string into bytes. + * + * For `'base64'`, `'base64url'`, and `'hex'`, this function assumes valid input. + * For strings that contain non-base64/hex-encoded data (e.g. whitespace), the + * return value might be greater than the length of a `Buffer` created from the + * string. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const str = '\u00bd + \u00bc = \u00be'; + * + * console.log(`${str}: ${str.length} characters, ` + + * `${Buffer.byteLength(str, 'utf8')} bytes`); + * // Prints: ½ + ¼ = ¾: 9 characters, 12 bytes + * ``` + * + * When `string` is a + * `Buffer`/[`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView)/[`TypedArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/- + * Reference/Global_Objects/TypedArray)/[`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer)/[`SharedArrayBuffer`](https://develop- + * er.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer), the byte length as reported by `.byteLength`is returned. + * @since v0.1.90 + * @param string A value to calculate the length of. + * @param [encoding='utf8'] If `string` is a string, this is its encoding. + * @return The number of bytes contained within `string`. + */ + byteLength( + string: string | NodeJS.ArrayBufferView | ArrayBuffer | SharedArrayBuffer, + encoding?: BufferEncoding, + ): number; + /** + * Returns a new `Buffer` which is the result of concatenating all the `Buffer`instances in the `list` together. + * + * If the list has no items, or if the `totalLength` is 0, then a new zero-length`Buffer` is returned. + * + * If `totalLength` is not provided, it is calculated from the `Buffer` instances + * in `list` by adding their lengths. + * + * If `totalLength` is provided, it is coerced to an unsigned integer. If the + * combined length of the `Buffer`s in `list` exceeds `totalLength`, the result is + * truncated to `totalLength`. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * // Create a single `Buffer` from a list of three `Buffer` instances. + * + * const buf1 = Buffer.alloc(10); + * const buf2 = Buffer.alloc(14); + * const buf3 = Buffer.alloc(18); + * const totalLength = buf1.length + buf2.length + buf3.length; + * + * console.log(totalLength); + * // Prints: 42 + * + * const bufA = Buffer.concat([buf1, buf2, buf3], totalLength); + * + * console.log(bufA); + * // Prints: + * console.log(bufA.length); + * // Prints: 42 + * ``` + * + * `Buffer.concat()` may also use the internal `Buffer` pool like `Buffer.allocUnsafe()` does. + * @since v0.7.11 + * @param list List of `Buffer` or {@link Uint8Array} instances to concatenate. + * @param totalLength Total length of the `Buffer` instances in `list` when concatenated. + */ + concat(list: ReadonlyArray, totalLength?: number): Buffer; + /** + * Copies the underlying memory of `view` into a new `Buffer`. + * + * ```js + * const u16 = new Uint16Array([0, 0xffff]); + * const buf = Buffer.copyBytesFrom(u16, 1, 1); + * u16[1] = 0; + * console.log(buf.length); // 2 + * console.log(buf[0]); // 255 + * console.log(buf[1]); // 255 + * ``` + * @since v19.8.0 + * @param view The {TypedArray} to copy. + * @param [offset=': 0'] The starting offset within `view`. + * @param [length=view.length - offset] The number of elements from `view` to copy. + */ + copyBytesFrom(view: NodeJS.TypedArray, offset?: number, length?: number): Buffer; + /** + * Compares `buf1` to `buf2`, typically for the purpose of sorting arrays of`Buffer` instances. This is equivalent to calling `buf1.compare(buf2)`. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf1 = Buffer.from('1234'); + * const buf2 = Buffer.from('0123'); + * const arr = [buf1, buf2]; + * + * console.log(arr.sort(Buffer.compare)); + * // Prints: [ , ] + * // (This result is equal to: [buf2, buf1].) + * ``` + * @since v0.11.13 + * @return Either `-1`, `0`, or `1`, depending on the result of the comparison. See `compare` for details. + */ + compare(buf1: Uint8Array, buf2: Uint8Array): -1 | 0 | 1; + /** + * Allocates a new `Buffer` of `size` bytes. If `fill` is `undefined`, the`Buffer` will be zero-filled. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.alloc(5); + * + * console.log(buf); + * // Prints: + * ``` + * + * If `size` is larger than {@link constants.MAX_LENGTH} or smaller than 0, `ERR_OUT_OF_RANGE` is thrown. + * + * If `fill` is specified, the allocated `Buffer` will be initialized by calling `buf.fill(fill)`. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.alloc(5, 'a'); + * + * console.log(buf); + * // Prints: + * ``` + * + * If both `fill` and `encoding` are specified, the allocated `Buffer` will be + * initialized by calling `buf.fill(fill, encoding)`. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.alloc(11, 'aGVsbG8gd29ybGQ=', 'base64'); + * + * console.log(buf); + * // Prints: + * ``` + * + * Calling `Buffer.alloc()` can be measurably slower than the alternative `Buffer.allocUnsafe()` but ensures that the newly created `Buffer` instance + * contents will never contain sensitive data from previous allocations, including + * data that might not have been allocated for `Buffer`s. + * + * A `TypeError` will be thrown if `size` is not a number. + * @since v5.10.0 + * @param size The desired length of the new `Buffer`. + * @param [fill=0] A value to pre-fill the new `Buffer` with. + * @param [encoding='utf8'] If `fill` is a string, this is its encoding. + */ + alloc(size: number, fill?: string | Uint8Array | number, encoding?: BufferEncoding): Buffer; + /** + * Allocates a new `Buffer` of `size` bytes. If `size` is larger than {@link constants.MAX_LENGTH} or smaller than 0, `ERR_OUT_OF_RANGE` is thrown. + * + * The underlying memory for `Buffer` instances created in this way is _not_ + * _initialized_. The contents of the newly created `Buffer` are unknown and _may contain sensitive data_. Use `Buffer.alloc()` instead to initialize`Buffer` instances with zeroes. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.allocUnsafe(10); + * + * console.log(buf); + * // Prints (contents may vary): + * + * buf.fill(0); + * + * console.log(buf); + * // Prints: + * ``` + * + * A `TypeError` will be thrown if `size` is not a number. + * + * The `Buffer` module pre-allocates an internal `Buffer` instance of + * size `Buffer.poolSize` that is used as a pool for the fast allocation of new`Buffer` instances created using `Buffer.allocUnsafe()`, `Buffer.from(array)`, + * and `Buffer.concat()` only when `size` is less than or equal to`Buffer.poolSize >> 1` (floor of `Buffer.poolSize` divided by two). + * + * Use of this pre-allocated internal memory pool is a key difference between + * calling `Buffer.alloc(size, fill)` vs. `Buffer.allocUnsafe(size).fill(fill)`. + * Specifically, `Buffer.alloc(size, fill)` will _never_ use the internal `Buffer`pool, while `Buffer.allocUnsafe(size).fill(fill)`_will_ use the internal`Buffer` pool if `size` is less + * than or equal to half `Buffer.poolSize`. The + * difference is subtle but can be important when an application requires the + * additional performance that `Buffer.allocUnsafe()` provides. + * @since v5.10.0 + * @param size The desired length of the new `Buffer`. + */ + allocUnsafe(size: number): Buffer; + /** + * Allocates a new `Buffer` of `size` bytes. If `size` is larger than {@link constants.MAX_LENGTH} or smaller than 0, `ERR_OUT_OF_RANGE` is thrown. A zero-length `Buffer` is created if + * `size` is 0. + * + * The underlying memory for `Buffer` instances created in this way is _not_ + * _initialized_. The contents of the newly created `Buffer` are unknown and _may contain sensitive data_. Use `buf.fill(0)` to initialize + * such `Buffer` instances with zeroes. + * + * When using `Buffer.allocUnsafe()` to allocate new `Buffer` instances, + * allocations under 4 KiB are sliced from a single pre-allocated `Buffer`. This + * allows applications to avoid the garbage collection overhead of creating many + * individually allocated `Buffer` instances. This approach improves both + * performance and memory usage by eliminating the need to track and clean up as + * many individual `ArrayBuffer` objects. + * + * However, in the case where a developer may need to retain a small chunk of + * memory from a pool for an indeterminate amount of time, it may be appropriate + * to create an un-pooled `Buffer` instance using `Buffer.allocUnsafeSlow()` and + * then copying out the relevant bits. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * // Need to keep around a few small chunks of memory. + * const store = []; + * + * socket.on('readable', () => { + * let data; + * while (null !== (data = readable.read())) { + * // Allocate for retained data. + * const sb = Buffer.allocUnsafeSlow(10); + * + * // Copy the data into the new allocation. + * data.copy(sb, 0, 0, 10); + * + * store.push(sb); + * } + * }); + * ``` + * + * A `TypeError` will be thrown if `size` is not a number. + * @since v5.12.0 + * @param size The desired length of the new `Buffer`. + */ + allocUnsafeSlow(size: number): Buffer; + /** + * This is the size (in bytes) of pre-allocated internal `Buffer` instances used + * for pooling. This value may be modified. + * @since v0.11.3 + */ + poolSize: number; + } + interface Buffer extends Uint8Array { + /** + * Writes `string` to `buf` at `offset` according to the character encoding in`encoding`. The `length` parameter is the number of bytes to write. If `buf` did + * not contain enough space to fit the entire string, only part of `string` will be + * written. However, partially encoded characters will not be written. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.alloc(256); + * + * const len = buf.write('\u00bd + \u00bc = \u00be', 0); + * + * console.log(`${len} bytes: ${buf.toString('utf8', 0, len)}`); + * // Prints: 12 bytes: ½ + ¼ = ¾ + * + * const buffer = Buffer.alloc(10); + * + * const length = buffer.write('abcd', 8); + * + * console.log(`${length} bytes: ${buffer.toString('utf8', 8, 10)}`); + * // Prints: 2 bytes : ab + * ``` + * @since v0.1.90 + * @param string String to write to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write `string`. + * @param [length=buf.length - offset] Maximum number of bytes to write (written bytes will not exceed `buf.length - offset`). + * @param [encoding='utf8'] The character encoding of `string`. + * @return Number of bytes written. + */ + write(string: string, encoding?: BufferEncoding): number; + write(string: string, offset: number, encoding?: BufferEncoding): number; + write(string: string, offset: number, length: number, encoding?: BufferEncoding): number; + /** + * Decodes `buf` to a string according to the specified character encoding in`encoding`. `start` and `end` may be passed to decode only a subset of `buf`. + * + * If `encoding` is `'utf8'` and a byte sequence in the input is not valid UTF-8, + * then each invalid byte is replaced with the replacement character `U+FFFD`. + * + * The maximum length of a string instance (in UTF-16 code units) is available + * as {@link constants.MAX_STRING_LENGTH}. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf1 = Buffer.allocUnsafe(26); + * + * for (let i = 0; i < 26; i++) { + * // 97 is the decimal ASCII value for 'a'. + * buf1[i] = i + 97; + * } + * + * console.log(buf1.toString('utf8')); + * // Prints: abcdefghijklmnopqrstuvwxyz + * console.log(buf1.toString('utf8', 0, 5)); + * // Prints: abcde + * + * const buf2 = Buffer.from('tést'); + * + * console.log(buf2.toString('hex')); + * // Prints: 74c3a97374 + * console.log(buf2.toString('utf8', 0, 3)); + * // Prints: té + * console.log(buf2.toString(undefined, 0, 3)); + * // Prints: té + * ``` + * @since v0.1.90 + * @param [encoding='utf8'] The character encoding to use. + * @param [start=0] The byte offset to start decoding at. + * @param [end=buf.length] The byte offset to stop decoding at (not inclusive). + */ + toString(encoding?: BufferEncoding, start?: number, end?: number): string; + /** + * Returns a JSON representation of `buf`. [`JSON.stringify()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify) implicitly calls + * this function when stringifying a `Buffer` instance. + * + * `Buffer.from()` accepts objects in the format returned from this method. + * In particular, `Buffer.from(buf.toJSON())` works like `Buffer.from(buf)`. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5]); + * const json = JSON.stringify(buf); + * + * console.log(json); + * // Prints: {"type":"Buffer","data":[1,2,3,4,5]} + * + * const copy = JSON.parse(json, (key, value) => { + * return value && value.type === 'Buffer' ? + * Buffer.from(value) : + * value; + * }); + * + * console.log(copy); + * // Prints: + * ``` + * @since v0.9.2 + */ + toJSON(): { + type: 'Buffer'; + data: number[]; + }; + /** + * Returns `true` if both `buf` and `otherBuffer` have exactly the same bytes,`false` otherwise. Equivalent to `buf.compare(otherBuffer) === 0`. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf1 = Buffer.from('ABC'); + * const buf2 = Buffer.from('414243', 'hex'); + * const buf3 = Buffer.from('ABCD'); + * + * console.log(buf1.equals(buf2)); + * // Prints: true + * console.log(buf1.equals(buf3)); + * // Prints: false + * ``` + * @since v0.11.13 + * @param otherBuffer A `Buffer` or {@link Uint8Array} with which to compare `buf`. + */ + equals(otherBuffer: Uint8Array): boolean; + /** + * Compares `buf` with `target` and returns a number indicating whether `buf`comes before, after, or is the same as `target` in sort order. + * Comparison is based on the actual sequence of bytes in each `Buffer`. + * + * * `0` is returned if `target` is the same as `buf` + * * `1` is returned if `target` should come _before_`buf` when sorted. + * * `-1` is returned if `target` should come _after_`buf` when sorted. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf1 = Buffer.from('ABC'); + * const buf2 = Buffer.from('BCD'); + * const buf3 = Buffer.from('ABCD'); + * + * console.log(buf1.compare(buf1)); + * // Prints: 0 + * console.log(buf1.compare(buf2)); + * // Prints: -1 + * console.log(buf1.compare(buf3)); + * // Prints: -1 + * console.log(buf2.compare(buf1)); + * // Prints: 1 + * console.log(buf2.compare(buf3)); + * // Prints: 1 + * console.log([buf1, buf2, buf3].sort(Buffer.compare)); + * // Prints: [ , , ] + * // (This result is equal to: [buf1, buf3, buf2].) + * ``` + * + * The optional `targetStart`, `targetEnd`, `sourceStart`, and `sourceEnd`arguments can be used to limit the comparison to specific ranges within `target`and `buf` respectively. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf1 = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8, 9]); + * const buf2 = Buffer.from([5, 6, 7, 8, 9, 1, 2, 3, 4]); + * + * console.log(buf1.compare(buf2, 5, 9, 0, 4)); + * // Prints: 0 + * console.log(buf1.compare(buf2, 0, 6, 4)); + * // Prints: -1 + * console.log(buf1.compare(buf2, 5, 6, 5)); + * // Prints: 1 + * ``` + * + * `ERR_OUT_OF_RANGE` is thrown if `targetStart < 0`, `sourceStart < 0`,`targetEnd > target.byteLength`, or `sourceEnd > source.byteLength`. + * @since v0.11.13 + * @param target A `Buffer` or {@link Uint8Array} with which to compare `buf`. + * @param [targetStart=0] The offset within `target` at which to begin comparison. + * @param [targetEnd=target.length] The offset within `target` at which to end comparison (not inclusive). + * @param [sourceStart=0] The offset within `buf` at which to begin comparison. + * @param [sourceEnd=buf.length] The offset within `buf` at which to end comparison (not inclusive). + */ + compare( + target: Uint8Array, + targetStart?: number, + targetEnd?: number, + sourceStart?: number, + sourceEnd?: number, + ): -1 | 0 | 1; + /** + * Copies data from a region of `buf` to a region in `target`, even if the `target`memory region overlaps with `buf`. + * + * [`TypedArray.prototype.set()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) performs the same operation, and is available + * for all TypedArrays, including Node.js `Buffer`s, although it takes + * different function arguments. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * // Create two `Buffer` instances. + * const buf1 = Buffer.allocUnsafe(26); + * const buf2 = Buffer.allocUnsafe(26).fill('!'); + * + * for (let i = 0; i < 26; i++) { + * // 97 is the decimal ASCII value for 'a'. + * buf1[i] = i + 97; + * } + * + * // Copy `buf1` bytes 16 through 19 into `buf2` starting at byte 8 of `buf2`. + * buf1.copy(buf2, 8, 16, 20); + * // This is equivalent to: + * // buf2.set(buf1.subarray(16, 20), 8); + * + * console.log(buf2.toString('ascii', 0, 25)); + * // Prints: !!!!!!!!qrst!!!!!!!!!!!!! + * ``` + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * // Create a `Buffer` and copy data from one region to an overlapping region + * // within the same `Buffer`. + * + * const buf = Buffer.allocUnsafe(26); + * + * for (let i = 0; i < 26; i++) { + * // 97 is the decimal ASCII value for 'a'. + * buf[i] = i + 97; + * } + * + * buf.copy(buf, 0, 4, 10); + * + * console.log(buf.toString()); + * // Prints: efghijghijklmnopqrstuvwxyz + * ``` + * @since v0.1.90 + * @param target A `Buffer` or {@link Uint8Array} to copy into. + * @param [targetStart=0] The offset within `target` at which to begin writing. + * @param [sourceStart=0] The offset within `buf` from which to begin copying. + * @param [sourceEnd=buf.length] The offset within `buf` at which to stop copying (not inclusive). + * @return The number of bytes copied. + */ + copy(target: Uint8Array, targetStart?: number, sourceStart?: number, sourceEnd?: number): number; + /** + * Returns a new `Buffer` that references the same memory as the original, but + * offset and cropped by the `start` and `end` indices. + * + * This method is not compatible with the `Uint8Array.prototype.slice()`, + * which is a superclass of `Buffer`. To copy the slice, use`Uint8Array.prototype.slice()`. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.from('buffer'); + * + * const copiedBuf = Uint8Array.prototype.slice.call(buf); + * copiedBuf[0]++; + * console.log(copiedBuf.toString()); + * // Prints: cuffer + * + * console.log(buf.toString()); + * // Prints: buffer + * + * // With buf.slice(), the original buffer is modified. + * const notReallyCopiedBuf = buf.slice(); + * notReallyCopiedBuf[0]++; + * console.log(notReallyCopiedBuf.toString()); + * // Prints: cuffer + * console.log(buf.toString()); + * // Also prints: cuffer (!) + * ``` + * @since v0.3.0 + * @deprecated Use `subarray` instead. + * @param [start=0] Where the new `Buffer` will start. + * @param [end=buf.length] Where the new `Buffer` will end (not inclusive). + */ + slice(start?: number, end?: number): Buffer; + /** + * Returns a new `Buffer` that references the same memory as the original, but + * offset and cropped by the `start` and `end` indices. + * + * Specifying `end` greater than `buf.length` will return the same result as + * that of `end` equal to `buf.length`. + * + * This method is inherited from [`TypedArray.prototype.subarray()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray). + * + * Modifying the new `Buffer` slice will modify the memory in the original `Buffer`because the allocated memory of the two objects overlap. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * // Create a `Buffer` with the ASCII alphabet, take a slice, and modify one byte + * // from the original `Buffer`. + * + * const buf1 = Buffer.allocUnsafe(26); + * + * for (let i = 0; i < 26; i++) { + * // 97 is the decimal ASCII value for 'a'. + * buf1[i] = i + 97; + * } + * + * const buf2 = buf1.subarray(0, 3); + * + * console.log(buf2.toString('ascii', 0, buf2.length)); + * // Prints: abc + * + * buf1[0] = 33; + * + * console.log(buf2.toString('ascii', 0, buf2.length)); + * // Prints: !bc + * ``` + * + * Specifying negative indexes causes the slice to be generated relative to the + * end of `buf` rather than the beginning. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.from('buffer'); + * + * console.log(buf.subarray(-6, -1).toString()); + * // Prints: buffe + * // (Equivalent to buf.subarray(0, 5).) + * + * console.log(buf.subarray(-6, -2).toString()); + * // Prints: buff + * // (Equivalent to buf.subarray(0, 4).) + * + * console.log(buf.subarray(-5, -2).toString()); + * // Prints: uff + * // (Equivalent to buf.subarray(1, 4).) + * ``` + * @since v3.0.0 + * @param [start=0] Where the new `Buffer` will start. + * @param [end=buf.length] Where the new `Buffer` will end (not inclusive). + */ + subarray(start?: number, end?: number): Buffer; + /** + * Writes `value` to `buf` at the specified `offset` as big-endian. + * + * `value` is interpreted and written as a two's complement signed integer. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.allocUnsafe(8); + * + * buf.writeBigInt64BE(0x0102030405060708n, 0); + * + * console.log(buf); + * // Prints: + * ``` + * @since v12.0.0, v10.20.0 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`. + * @return `offset` plus the number of bytes written. + */ + writeBigInt64BE(value: bigint, offset?: number): number; + /** + * Writes `value` to `buf` at the specified `offset` as little-endian. + * + * `value` is interpreted and written as a two's complement signed integer. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.allocUnsafe(8); + * + * buf.writeBigInt64LE(0x0102030405060708n, 0); + * + * console.log(buf); + * // Prints: + * ``` + * @since v12.0.0, v10.20.0 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`. + * @return `offset` plus the number of bytes written. + */ + writeBigInt64LE(value: bigint, offset?: number): number; + /** + * Writes `value` to `buf` at the specified `offset` as big-endian. + * + * This function is also available under the `writeBigUint64BE` alias. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.allocUnsafe(8); + * + * buf.writeBigUInt64BE(0xdecafafecacefaden, 0); + * + * console.log(buf); + * // Prints: + * ``` + * @since v12.0.0, v10.20.0 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`. + * @return `offset` plus the number of bytes written. + */ + writeBigUInt64BE(value: bigint, offset?: number): number; + /** + * @alias Buffer.writeBigUInt64BE + * @since v14.10.0, v12.19.0 + */ + writeBigUint64BE(value: bigint, offset?: number): number; + /** + * Writes `value` to `buf` at the specified `offset` as little-endian + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.allocUnsafe(8); + * + * buf.writeBigUInt64LE(0xdecafafecacefaden, 0); + * + * console.log(buf); + * // Prints: + * ``` + * + * This function is also available under the `writeBigUint64LE` alias. + * @since v12.0.0, v10.20.0 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`. + * @return `offset` plus the number of bytes written. + */ + writeBigUInt64LE(value: bigint, offset?: number): number; + /** + * @alias Buffer.writeBigUInt64LE + * @since v14.10.0, v12.19.0 + */ + writeBigUint64LE(value: bigint, offset?: number): number; + /** + * Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as little-endian. Supports up to 48 bits of accuracy. Behavior is undefined + * when `value` is anything other than an unsigned integer. + * + * This function is also available under the `writeUintLE` alias. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.allocUnsafe(6); + * + * buf.writeUIntLE(0x1234567890ab, 0, 6); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.5.5 + * @param value Number to be written to `buf`. + * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`. + * @param byteLength Number of bytes to write. Must satisfy `0 < byteLength <= 6`. + * @return `offset` plus the number of bytes written. + */ + writeUIntLE(value: number, offset: number, byteLength: number): number; + /** + * @alias Buffer.writeUIntLE + * @since v14.9.0, v12.19.0 + */ + writeUintLE(value: number, offset: number, byteLength: number): number; + /** + * Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as big-endian. Supports up to 48 bits of accuracy. Behavior is undefined + * when `value` is anything other than an unsigned integer. + * + * This function is also available under the `writeUintBE` alias. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.allocUnsafe(6); + * + * buf.writeUIntBE(0x1234567890ab, 0, 6); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.5.5 + * @param value Number to be written to `buf`. + * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`. + * @param byteLength Number of bytes to write. Must satisfy `0 < byteLength <= 6`. + * @return `offset` plus the number of bytes written. + */ + writeUIntBE(value: number, offset: number, byteLength: number): number; + /** + * @alias Buffer.writeUIntBE + * @since v14.9.0, v12.19.0 + */ + writeUintBE(value: number, offset: number, byteLength: number): number; + /** + * Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as little-endian. Supports up to 48 bits of accuracy. Behavior is undefined + * when `value` is anything other than a signed integer. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.allocUnsafe(6); + * + * buf.writeIntLE(0x1234567890ab, 0, 6); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.11.15 + * @param value Number to be written to `buf`. + * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`. + * @param byteLength Number of bytes to write. Must satisfy `0 < byteLength <= 6`. + * @return `offset` plus the number of bytes written. + */ + writeIntLE(value: number, offset: number, byteLength: number): number; + /** + * Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as big-endian. Supports up to 48 bits of accuracy. Behavior is undefined when`value` is anything other than a + * signed integer. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.allocUnsafe(6); + * + * buf.writeIntBE(0x1234567890ab, 0, 6); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.11.15 + * @param value Number to be written to `buf`. + * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`. + * @param byteLength Number of bytes to write. Must satisfy `0 < byteLength <= 6`. + * @return `offset` plus the number of bytes written. + */ + writeIntBE(value: number, offset: number, byteLength: number): number; + /** + * Reads an unsigned, big-endian 64-bit integer from `buf` at the specified`offset`. + * + * This function is also available under the `readBigUint64BE` alias. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.from([0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff]); + * + * console.log(buf.readBigUInt64BE(0)); + * // Prints: 4294967295n + * ``` + * @since v12.0.0, v10.20.0 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`. + */ + readBigUInt64BE(offset?: number): bigint; + /** + * @alias Buffer.readBigUInt64BE + * @since v14.10.0, v12.19.0 + */ + readBigUint64BE(offset?: number): bigint; + /** + * Reads an unsigned, little-endian 64-bit integer from `buf` at the specified`offset`. + * + * This function is also available under the `readBigUint64LE` alias. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.from([0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff]); + * + * console.log(buf.readBigUInt64LE(0)); + * // Prints: 18446744069414584320n + * ``` + * @since v12.0.0, v10.20.0 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`. + */ + readBigUInt64LE(offset?: number): bigint; + /** + * @alias Buffer.readBigUInt64LE + * @since v14.10.0, v12.19.0 + */ + readBigUint64LE(offset?: number): bigint; + /** + * Reads a signed, big-endian 64-bit integer from `buf` at the specified `offset`. + * + * Integers read from a `Buffer` are interpreted as two's complement signed + * values. + * @since v12.0.0, v10.20.0 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`. + */ + readBigInt64BE(offset?: number): bigint; + /** + * Reads a signed, little-endian 64-bit integer from `buf` at the specified`offset`. + * + * Integers read from a `Buffer` are interpreted as two's complement signed + * values. + * @since v12.0.0, v10.20.0 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`. + */ + readBigInt64LE(offset?: number): bigint; + /** + * Reads `byteLength` number of bytes from `buf` at the specified `offset`and interprets the result as an unsigned, little-endian integer supporting + * up to 48 bits of accuracy. + * + * This function is also available under the `readUintLE` alias. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]); + * + * console.log(buf.readUIntLE(0, 6).toString(16)); + * // Prints: ab9078563412 + * ``` + * @since v0.11.15 + * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`. + * @param byteLength Number of bytes to read. Must satisfy `0 < byteLength <= 6`. + */ + readUIntLE(offset: number, byteLength: number): number; + /** + * @alias Buffer.readUIntLE + * @since v14.9.0, v12.19.0 + */ + readUintLE(offset: number, byteLength: number): number; + /** + * Reads `byteLength` number of bytes from `buf` at the specified `offset`and interprets the result as an unsigned big-endian integer supporting + * up to 48 bits of accuracy. + * + * This function is also available under the `readUintBE` alias. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]); + * + * console.log(buf.readUIntBE(0, 6).toString(16)); + * // Prints: 1234567890ab + * console.log(buf.readUIntBE(1, 6).toString(16)); + * // Throws ERR_OUT_OF_RANGE. + * ``` + * @since v0.11.15 + * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`. + * @param byteLength Number of bytes to read. Must satisfy `0 < byteLength <= 6`. + */ + readUIntBE(offset: number, byteLength: number): number; + /** + * @alias Buffer.readUIntBE + * @since v14.9.0, v12.19.0 + */ + readUintBE(offset: number, byteLength: number): number; + /** + * Reads `byteLength` number of bytes from `buf` at the specified `offset`and interprets the result as a little-endian, two's complement signed value + * supporting up to 48 bits of accuracy. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]); + * + * console.log(buf.readIntLE(0, 6).toString(16)); + * // Prints: -546f87a9cbee + * ``` + * @since v0.11.15 + * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`. + * @param byteLength Number of bytes to read. Must satisfy `0 < byteLength <= 6`. + */ + readIntLE(offset: number, byteLength: number): number; + /** + * Reads `byteLength` number of bytes from `buf` at the specified `offset`and interprets the result as a big-endian, two's complement signed value + * supporting up to 48 bits of accuracy. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]); + * + * console.log(buf.readIntBE(0, 6).toString(16)); + * // Prints: 1234567890ab + * console.log(buf.readIntBE(1, 6).toString(16)); + * // Throws ERR_OUT_OF_RANGE. + * console.log(buf.readIntBE(1, 0).toString(16)); + * // Throws ERR_OUT_OF_RANGE. + * ``` + * @since v0.11.15 + * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`. + * @param byteLength Number of bytes to read. Must satisfy `0 < byteLength <= 6`. + */ + readIntBE(offset: number, byteLength: number): number; + /** + * Reads an unsigned 8-bit integer from `buf` at the specified `offset`. + * + * This function is also available under the `readUint8` alias. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.from([1, -2]); + * + * console.log(buf.readUInt8(0)); + * // Prints: 1 + * console.log(buf.readUInt8(1)); + * // Prints: 254 + * console.log(buf.readUInt8(2)); + * // Throws ERR_OUT_OF_RANGE. + * ``` + * @since v0.5.0 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 1`. + */ + readUInt8(offset?: number): number; + /** + * @alias Buffer.readUInt8 + * @since v14.9.0, v12.19.0 + */ + readUint8(offset?: number): number; + /** + * Reads an unsigned, little-endian 16-bit integer from `buf` at the specified`offset`. + * + * This function is also available under the `readUint16LE` alias. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.from([0x12, 0x34, 0x56]); + * + * console.log(buf.readUInt16LE(0).toString(16)); + * // Prints: 3412 + * console.log(buf.readUInt16LE(1).toString(16)); + * // Prints: 5634 + * console.log(buf.readUInt16LE(2).toString(16)); + * // Throws ERR_OUT_OF_RANGE. + * ``` + * @since v0.5.5 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`. + */ + readUInt16LE(offset?: number): number; + /** + * @alias Buffer.readUInt16LE + * @since v14.9.0, v12.19.0 + */ + readUint16LE(offset?: number): number; + /** + * Reads an unsigned, big-endian 16-bit integer from `buf` at the specified`offset`. + * + * This function is also available under the `readUint16BE` alias. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.from([0x12, 0x34, 0x56]); + * + * console.log(buf.readUInt16BE(0).toString(16)); + * // Prints: 1234 + * console.log(buf.readUInt16BE(1).toString(16)); + * // Prints: 3456 + * ``` + * @since v0.5.5 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`. + */ + readUInt16BE(offset?: number): number; + /** + * @alias Buffer.readUInt16BE + * @since v14.9.0, v12.19.0 + */ + readUint16BE(offset?: number): number; + /** + * Reads an unsigned, little-endian 32-bit integer from `buf` at the specified`offset`. + * + * This function is also available under the `readUint32LE` alias. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78]); + * + * console.log(buf.readUInt32LE(0).toString(16)); + * // Prints: 78563412 + * console.log(buf.readUInt32LE(1).toString(16)); + * // Throws ERR_OUT_OF_RANGE. + * ``` + * @since v0.5.5 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. + */ + readUInt32LE(offset?: number): number; + /** + * @alias Buffer.readUInt32LE + * @since v14.9.0, v12.19.0 + */ + readUint32LE(offset?: number): number; + /** + * Reads an unsigned, big-endian 32-bit integer from `buf` at the specified`offset`. + * + * This function is also available under the `readUint32BE` alias. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78]); + * + * console.log(buf.readUInt32BE(0).toString(16)); + * // Prints: 12345678 + * ``` + * @since v0.5.5 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. + */ + readUInt32BE(offset?: number): number; + /** + * @alias Buffer.readUInt32BE + * @since v14.9.0, v12.19.0 + */ + readUint32BE(offset?: number): number; + /** + * Reads a signed 8-bit integer from `buf` at the specified `offset`. + * + * Integers read from a `Buffer` are interpreted as two's complement signed values. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.from([-1, 5]); + * + * console.log(buf.readInt8(0)); + * // Prints: -1 + * console.log(buf.readInt8(1)); + * // Prints: 5 + * console.log(buf.readInt8(2)); + * // Throws ERR_OUT_OF_RANGE. + * ``` + * @since v0.5.0 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 1`. + */ + readInt8(offset?: number): number; + /** + * Reads a signed, little-endian 16-bit integer from `buf` at the specified`offset`. + * + * Integers read from a `Buffer` are interpreted as two's complement signed values. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.from([0, 5]); + * + * console.log(buf.readInt16LE(0)); + * // Prints: 1280 + * console.log(buf.readInt16LE(1)); + * // Throws ERR_OUT_OF_RANGE. + * ``` + * @since v0.5.5 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`. + */ + readInt16LE(offset?: number): number; + /** + * Reads a signed, big-endian 16-bit integer from `buf` at the specified `offset`. + * + * Integers read from a `Buffer` are interpreted as two's complement signed values. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.from([0, 5]); + * + * console.log(buf.readInt16BE(0)); + * // Prints: 5 + * ``` + * @since v0.5.5 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`. + */ + readInt16BE(offset?: number): number; + /** + * Reads a signed, little-endian 32-bit integer from `buf` at the specified`offset`. + * + * Integers read from a `Buffer` are interpreted as two's complement signed values. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.from([0, 0, 0, 5]); + * + * console.log(buf.readInt32LE(0)); + * // Prints: 83886080 + * console.log(buf.readInt32LE(1)); + * // Throws ERR_OUT_OF_RANGE. + * ``` + * @since v0.5.5 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. + */ + readInt32LE(offset?: number): number; + /** + * Reads a signed, big-endian 32-bit integer from `buf` at the specified `offset`. + * + * Integers read from a `Buffer` are interpreted as two's complement signed values. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.from([0, 0, 0, 5]); + * + * console.log(buf.readInt32BE(0)); + * // Prints: 5 + * ``` + * @since v0.5.5 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. + */ + readInt32BE(offset?: number): number; + /** + * Reads a 32-bit, little-endian float from `buf` at the specified `offset`. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.from([1, 2, 3, 4]); + * + * console.log(buf.readFloatLE(0)); + * // Prints: 1.539989614439558e-36 + * console.log(buf.readFloatLE(1)); + * // Throws ERR_OUT_OF_RANGE. + * ``` + * @since v0.11.15 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. + */ + readFloatLE(offset?: number): number; + /** + * Reads a 32-bit, big-endian float from `buf` at the specified `offset`. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.from([1, 2, 3, 4]); + * + * console.log(buf.readFloatBE(0)); + * // Prints: 2.387939260590663e-38 + * ``` + * @since v0.11.15 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. + */ + readFloatBE(offset?: number): number; + /** + * Reads a 64-bit, little-endian double from `buf` at the specified `offset`. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8]); + * + * console.log(buf.readDoubleLE(0)); + * // Prints: 5.447603722011605e-270 + * console.log(buf.readDoubleLE(1)); + * // Throws ERR_OUT_OF_RANGE. + * ``` + * @since v0.11.15 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 8`. + */ + readDoubleLE(offset?: number): number; + /** + * Reads a 64-bit, big-endian double from `buf` at the specified `offset`. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8]); + * + * console.log(buf.readDoubleBE(0)); + * // Prints: 8.20788039913184e-304 + * ``` + * @since v0.11.15 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 8`. + */ + readDoubleBE(offset?: number): number; + reverse(): this; + /** + * Interprets `buf` as an array of unsigned 16-bit integers and swaps the + * byte order _in-place_. Throws `ERR_INVALID_BUFFER_SIZE` if `buf.length` is not a multiple of 2. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]); + * + * console.log(buf1); + * // Prints: + * + * buf1.swap16(); + * + * console.log(buf1); + * // Prints: + * + * const buf2 = Buffer.from([0x1, 0x2, 0x3]); + * + * buf2.swap16(); + * // Throws ERR_INVALID_BUFFER_SIZE. + * ``` + * + * One convenient use of `buf.swap16()` is to perform a fast in-place conversion + * between UTF-16 little-endian and UTF-16 big-endian: + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.from('This is little-endian UTF-16', 'utf16le'); + * buf.swap16(); // Convert to big-endian UTF-16 text. + * ``` + * @since v5.10.0 + * @return A reference to `buf`. + */ + swap16(): Buffer; + /** + * Interprets `buf` as an array of unsigned 32-bit integers and swaps the + * byte order _in-place_. Throws `ERR_INVALID_BUFFER_SIZE` if `buf.length` is not a multiple of 4. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]); + * + * console.log(buf1); + * // Prints: + * + * buf1.swap32(); + * + * console.log(buf1); + * // Prints: + * + * const buf2 = Buffer.from([0x1, 0x2, 0x3]); + * + * buf2.swap32(); + * // Throws ERR_INVALID_BUFFER_SIZE. + * ``` + * @since v5.10.0 + * @return A reference to `buf`. + */ + swap32(): Buffer; + /** + * Interprets `buf` as an array of 64-bit numbers and swaps byte order _in-place_. + * Throws `ERR_INVALID_BUFFER_SIZE` if `buf.length` is not a multiple of 8. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]); + * + * console.log(buf1); + * // Prints: + * + * buf1.swap64(); + * + * console.log(buf1); + * // Prints: + * + * const buf2 = Buffer.from([0x1, 0x2, 0x3]); + * + * buf2.swap64(); + * // Throws ERR_INVALID_BUFFER_SIZE. + * ``` + * @since v6.3.0 + * @return A reference to `buf`. + */ + swap64(): Buffer; + /** + * Writes `value` to `buf` at the specified `offset`. `value` must be a + * valid unsigned 8-bit integer. Behavior is undefined when `value` is anything + * other than an unsigned 8-bit integer. + * + * This function is also available under the `writeUint8` alias. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.allocUnsafe(4); + * + * buf.writeUInt8(0x3, 0); + * buf.writeUInt8(0x4, 1); + * buf.writeUInt8(0x23, 2); + * buf.writeUInt8(0x42, 3); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.5.0 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 1`. + * @return `offset` plus the number of bytes written. + */ + writeUInt8(value: number, offset?: number): number; + /** + * @alias Buffer.writeUInt8 + * @since v14.9.0, v12.19.0 + */ + writeUint8(value: number, offset?: number): number; + /** + * Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a valid unsigned 16-bit integer. Behavior is undefined when `value` is + * anything other than an unsigned 16-bit integer. + * + * This function is also available under the `writeUint16LE` alias. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.allocUnsafe(4); + * + * buf.writeUInt16LE(0xdead, 0); + * buf.writeUInt16LE(0xbeef, 2); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.5.5 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`. + * @return `offset` plus the number of bytes written. + */ + writeUInt16LE(value: number, offset?: number): number; + /** + * @alias Buffer.writeUInt16LE + * @since v14.9.0, v12.19.0 + */ + writeUint16LE(value: number, offset?: number): number; + /** + * Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a valid unsigned 16-bit integer. Behavior is undefined when `value`is anything other than an + * unsigned 16-bit integer. + * + * This function is also available under the `writeUint16BE` alias. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.allocUnsafe(4); + * + * buf.writeUInt16BE(0xdead, 0); + * buf.writeUInt16BE(0xbeef, 2); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.5.5 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`. + * @return `offset` plus the number of bytes written. + */ + writeUInt16BE(value: number, offset?: number): number; + /** + * @alias Buffer.writeUInt16BE + * @since v14.9.0, v12.19.0 + */ + writeUint16BE(value: number, offset?: number): number; + /** + * Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a valid unsigned 32-bit integer. Behavior is undefined when `value` is + * anything other than an unsigned 32-bit integer. + * + * This function is also available under the `writeUint32LE` alias. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.allocUnsafe(4); + * + * buf.writeUInt32LE(0xfeedface, 0); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.5.5 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. + * @return `offset` plus the number of bytes written. + */ + writeUInt32LE(value: number, offset?: number): number; + /** + * @alias Buffer.writeUInt32LE + * @since v14.9.0, v12.19.0 + */ + writeUint32LE(value: number, offset?: number): number; + /** + * Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a valid unsigned 32-bit integer. Behavior is undefined when `value`is anything other than an + * unsigned 32-bit integer. + * + * This function is also available under the `writeUint32BE` alias. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.allocUnsafe(4); + * + * buf.writeUInt32BE(0xfeedface, 0); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.5.5 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. + * @return `offset` plus the number of bytes written. + */ + writeUInt32BE(value: number, offset?: number): number; + /** + * @alias Buffer.writeUInt32BE + * @since v14.9.0, v12.19.0 + */ + writeUint32BE(value: number, offset?: number): number; + /** + * Writes `value` to `buf` at the specified `offset`. `value` must be a valid + * signed 8-bit integer. Behavior is undefined when `value` is anything other than + * a signed 8-bit integer. + * + * `value` is interpreted and written as a two's complement signed integer. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.allocUnsafe(2); + * + * buf.writeInt8(2, 0); + * buf.writeInt8(-2, 1); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.5.0 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 1`. + * @return `offset` plus the number of bytes written. + */ + writeInt8(value: number, offset?: number): number; + /** + * Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a valid signed 16-bit integer. Behavior is undefined when `value` is + * anything other than a signed 16-bit integer. + * + * The `value` is interpreted and written as a two's complement signed integer. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.allocUnsafe(2); + * + * buf.writeInt16LE(0x0304, 0); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.5.5 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`. + * @return `offset` plus the number of bytes written. + */ + writeInt16LE(value: number, offset?: number): number; + /** + * Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a valid signed 16-bit integer. Behavior is undefined when `value` is + * anything other than a signed 16-bit integer. + * + * The `value` is interpreted and written as a two's complement signed integer. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.allocUnsafe(2); + * + * buf.writeInt16BE(0x0102, 0); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.5.5 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`. + * @return `offset` plus the number of bytes written. + */ + writeInt16BE(value: number, offset?: number): number; + /** + * Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a valid signed 32-bit integer. Behavior is undefined when `value` is + * anything other than a signed 32-bit integer. + * + * The `value` is interpreted and written as a two's complement signed integer. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.allocUnsafe(4); + * + * buf.writeInt32LE(0x05060708, 0); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.5.5 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. + * @return `offset` plus the number of bytes written. + */ + writeInt32LE(value: number, offset?: number): number; + /** + * Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a valid signed 32-bit integer. Behavior is undefined when `value` is + * anything other than a signed 32-bit integer. + * + * The `value` is interpreted and written as a two's complement signed integer. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.allocUnsafe(4); + * + * buf.writeInt32BE(0x01020304, 0); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.5.5 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. + * @return `offset` plus the number of bytes written. + */ + writeInt32BE(value: number, offset?: number): number; + /** + * Writes `value` to `buf` at the specified `offset` as little-endian. Behavior is + * undefined when `value` is anything other than a JavaScript number. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.allocUnsafe(4); + * + * buf.writeFloatLE(0xcafebabe, 0); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.11.15 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. + * @return `offset` plus the number of bytes written. + */ + writeFloatLE(value: number, offset?: number): number; + /** + * Writes `value` to `buf` at the specified `offset` as big-endian. Behavior is + * undefined when `value` is anything other than a JavaScript number. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.allocUnsafe(4); + * + * buf.writeFloatBE(0xcafebabe, 0); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.11.15 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. + * @return `offset` plus the number of bytes written. + */ + writeFloatBE(value: number, offset?: number): number; + /** + * Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a JavaScript number. Behavior is undefined when `value` is anything + * other than a JavaScript number. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.allocUnsafe(8); + * + * buf.writeDoubleLE(123.456, 0); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.11.15 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 8`. + * @return `offset` plus the number of bytes written. + */ + writeDoubleLE(value: number, offset?: number): number; + /** + * Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a JavaScript number. Behavior is undefined when `value` is anything + * other than a JavaScript number. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.allocUnsafe(8); + * + * buf.writeDoubleBE(123.456, 0); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.11.15 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 8`. + * @return `offset` plus the number of bytes written. + */ + writeDoubleBE(value: number, offset?: number): number; + /** + * Fills `buf` with the specified `value`. If the `offset` and `end` are not given, + * the entire `buf` will be filled: + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * // Fill a `Buffer` with the ASCII character 'h'. + * + * const b = Buffer.allocUnsafe(50).fill('h'); + * + * console.log(b.toString()); + * // Prints: hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh + * + * // Fill a buffer with empty string + * const c = Buffer.allocUnsafe(5).fill(''); + * + * console.log(c.fill('')); + * // Prints: + * ``` + * + * `value` is coerced to a `uint32` value if it is not a string, `Buffer`, or + * integer. If the resulting integer is greater than `255` (decimal), `buf` will be + * filled with `value & 255`. + * + * If the final write of a `fill()` operation falls on a multi-byte character, + * then only the bytes of that character that fit into `buf` are written: + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * // Fill a `Buffer` with character that takes up two bytes in UTF-8. + * + * console.log(Buffer.allocUnsafe(5).fill('\u0222')); + * // Prints: + * ``` + * + * If `value` contains invalid characters, it is truncated; if no valid + * fill data remains, an exception is thrown: + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.allocUnsafe(5); + * + * console.log(buf.fill('a')); + * // Prints: + * console.log(buf.fill('aazz', 'hex')); + * // Prints: + * console.log(buf.fill('zz', 'hex')); + * // Throws an exception. + * ``` + * @since v0.5.0 + * @param value The value with which to fill `buf`. Empty value (string, Uint8Array, Buffer) is coerced to `0`. + * @param [offset=0] Number of bytes to skip before starting to fill `buf`. + * @param [end=buf.length] Where to stop filling `buf` (not inclusive). + * @param [encoding='utf8'] The encoding for `value` if `value` is a string. + * @return A reference to `buf`. + */ + fill(value: string | Uint8Array | number, offset?: number, end?: number, encoding?: BufferEncoding): this; + /** + * If `value` is: + * + * * a string, `value` is interpreted according to the character encoding in`encoding`. + * * a `Buffer` or [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array), `value` will be used in its entirety. + * To compare a partial `Buffer`, use `buf.subarray`. + * * a number, `value` will be interpreted as an unsigned 8-bit integer + * value between `0` and `255`. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.from('this is a buffer'); + * + * console.log(buf.indexOf('this')); + * // Prints: 0 + * console.log(buf.indexOf('is')); + * // Prints: 2 + * console.log(buf.indexOf(Buffer.from('a buffer'))); + * // Prints: 8 + * console.log(buf.indexOf(97)); + * // Prints: 8 (97 is the decimal ASCII value for 'a') + * console.log(buf.indexOf(Buffer.from('a buffer example'))); + * // Prints: -1 + * console.log(buf.indexOf(Buffer.from('a buffer example').slice(0, 8))); + * // Prints: 8 + * + * const utf16Buffer = Buffer.from('\u039a\u0391\u03a3\u03a3\u0395', 'utf16le'); + * + * console.log(utf16Buffer.indexOf('\u03a3', 0, 'utf16le')); + * // Prints: 4 + * console.log(utf16Buffer.indexOf('\u03a3', -4, 'utf16le')); + * // Prints: 6 + * ``` + * + * If `value` is not a string, number, or `Buffer`, this method will throw a`TypeError`. If `value` is a number, it will be coerced to a valid byte value, + * an integer between 0 and 255. + * + * If `byteOffset` is not a number, it will be coerced to a number. If the result + * of coercion is `NaN` or `0`, then the entire buffer will be searched. This + * behavior matches [`String.prototype.indexOf()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf). + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const b = Buffer.from('abcdef'); + * + * // Passing a value that's a number, but not a valid byte. + * // Prints: 2, equivalent to searching for 99 or 'c'. + * console.log(b.indexOf(99.9)); + * console.log(b.indexOf(256 + 99)); + * + * // Passing a byteOffset that coerces to NaN or 0. + * // Prints: 1, searching the whole buffer. + * console.log(b.indexOf('b', undefined)); + * console.log(b.indexOf('b', {})); + * console.log(b.indexOf('b', null)); + * console.log(b.indexOf('b', [])); + * ``` + * + * If `value` is an empty string or empty `Buffer` and `byteOffset` is less + * than `buf.length`, `byteOffset` will be returned. If `value` is empty and`byteOffset` is at least `buf.length`, `buf.length` will be returned. + * @since v1.5.0 + * @param value What to search for. + * @param [byteOffset=0] Where to begin searching in `buf`. If negative, then offset is calculated from the end of `buf`. + * @param [encoding='utf8'] If `value` is a string, this is the encoding used to determine the binary representation of the string that will be searched for in `buf`. + * @return The index of the first occurrence of `value` in `buf`, or `-1` if `buf` does not contain `value`. + */ + indexOf(value: string | number | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number; + /** + * Identical to `buf.indexOf()`, except the last occurrence of `value` is found + * rather than the first occurrence. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.from('this buffer is a buffer'); + * + * console.log(buf.lastIndexOf('this')); + * // Prints: 0 + * console.log(buf.lastIndexOf('buffer')); + * // Prints: 17 + * console.log(buf.lastIndexOf(Buffer.from('buffer'))); + * // Prints: 17 + * console.log(buf.lastIndexOf(97)); + * // Prints: 15 (97 is the decimal ASCII value for 'a') + * console.log(buf.lastIndexOf(Buffer.from('yolo'))); + * // Prints: -1 + * console.log(buf.lastIndexOf('buffer', 5)); + * // Prints: 5 + * console.log(buf.lastIndexOf('buffer', 4)); + * // Prints: -1 + * + * const utf16Buffer = Buffer.from('\u039a\u0391\u03a3\u03a3\u0395', 'utf16le'); + * + * console.log(utf16Buffer.lastIndexOf('\u03a3', undefined, 'utf16le')); + * // Prints: 6 + * console.log(utf16Buffer.lastIndexOf('\u03a3', -5, 'utf16le')); + * // Prints: 4 + * ``` + * + * If `value` is not a string, number, or `Buffer`, this method will throw a`TypeError`. If `value` is a number, it will be coerced to a valid byte value, + * an integer between 0 and 255. + * + * If `byteOffset` is not a number, it will be coerced to a number. Any arguments + * that coerce to `NaN`, like `{}` or `undefined`, will search the whole buffer. + * This behavior matches [`String.prototype.lastIndexOf()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/lastIndexOf). + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const b = Buffer.from('abcdef'); + * + * // Passing a value that's a number, but not a valid byte. + * // Prints: 2, equivalent to searching for 99 or 'c'. + * console.log(b.lastIndexOf(99.9)); + * console.log(b.lastIndexOf(256 + 99)); + * + * // Passing a byteOffset that coerces to NaN. + * // Prints: 1, searching the whole buffer. + * console.log(b.lastIndexOf('b', undefined)); + * console.log(b.lastIndexOf('b', {})); + * + * // Passing a byteOffset that coerces to 0. + * // Prints: -1, equivalent to passing 0. + * console.log(b.lastIndexOf('b', null)); + * console.log(b.lastIndexOf('b', [])); + * ``` + * + * If `value` is an empty string or empty `Buffer`, `byteOffset` will be returned. + * @since v6.0.0 + * @param value What to search for. + * @param [byteOffset=buf.length - 1] Where to begin searching in `buf`. If negative, then offset is calculated from the end of `buf`. + * @param [encoding='utf8'] If `value` is a string, this is the encoding used to determine the binary representation of the string that will be searched for in `buf`. + * @return The index of the last occurrence of `value` in `buf`, or `-1` if `buf` does not contain `value`. + */ + lastIndexOf(value: string | number | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number; + /** + * Creates and returns an [iterator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) of `[index, byte]` pairs from the contents + * of `buf`. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * // Log the entire contents of a `Buffer`. + * + * const buf = Buffer.from('buffer'); + * + * for (const pair of buf.entries()) { + * console.log(pair); + * } + * // Prints: + * // [0, 98] + * // [1, 117] + * // [2, 102] + * // [3, 102] + * // [4, 101] + * // [5, 114] + * ``` + * @since v1.1.0 + */ + entries(): IterableIterator<[number, number]>; + /** + * Equivalent to `buf.indexOf() !== -1`. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.from('this is a buffer'); + * + * console.log(buf.includes('this')); + * // Prints: true + * console.log(buf.includes('is')); + * // Prints: true + * console.log(buf.includes(Buffer.from('a buffer'))); + * // Prints: true + * console.log(buf.includes(97)); + * // Prints: true (97 is the decimal ASCII value for 'a') + * console.log(buf.includes(Buffer.from('a buffer example'))); + * // Prints: false + * console.log(buf.includes(Buffer.from('a buffer example').slice(0, 8))); + * // Prints: true + * console.log(buf.includes('this', 4)); + * // Prints: false + * ``` + * @since v5.3.0 + * @param value What to search for. + * @param [byteOffset=0] Where to begin searching in `buf`. If negative, then offset is calculated from the end of `buf`. + * @param [encoding='utf8'] If `value` is a string, this is its encoding. + * @return `true` if `value` was found in `buf`, `false` otherwise. + */ + includes(value: string | number | Buffer, byteOffset?: number, encoding?: BufferEncoding): boolean; + /** + * Creates and returns an [iterator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) of `buf` keys (indices). + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.from('buffer'); + * + * for (const key of buf.keys()) { + * console.log(key); + * } + * // Prints: + * // 0 + * // 1 + * // 2 + * // 3 + * // 4 + * // 5 + * ``` + * @since v1.1.0 + */ + keys(): IterableIterator; + /** + * Creates and returns an [iterator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) for `buf` values (bytes). This function is + * called automatically when a `Buffer` is used in a `for..of` statement. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.from('buffer'); + * + * for (const value of buf.values()) { + * console.log(value); + * } + * // Prints: + * // 98 + * // 117 + * // 102 + * // 102 + * // 101 + * // 114 + * + * for (const value of buf) { + * console.log(value); + * } + * // Prints: + * // 98 + * // 117 + * // 102 + * // 102 + * // 101 + * // 114 + * ``` + * @since v1.1.0 + */ + values(): IterableIterator; + } + var Buffer: BufferConstructor; + /** + * Decodes a string of Base64-encoded data into bytes, and encodes those bytes + * into a string using Latin-1 (ISO-8859-1). + * + * The `data` may be any JavaScript-value that can be coerced into a string. + * + * **This function is only provided for compatibility with legacy web platform APIs** + * **and should never be used in new code, because they use strings to represent** + * **binary data and predate the introduction of typed arrays in JavaScript.** + * **For code running using Node.js APIs, converting between base64-encoded strings** + * **and binary data should be performed using `Buffer.from(str, 'base64')` and`buf.toString('base64')`.** + * @since v15.13.0, v14.17.0 + * @legacy Use `Buffer.from(data, 'base64')` instead. + * @param data The Base64-encoded input string. + */ + function atob(data: string): string; + /** + * Decodes a string into bytes using Latin-1 (ISO-8859), and encodes those bytes + * into a string using Base64. + * + * The `data` may be any JavaScript-value that can be coerced into a string. + * + * **This function is only provided for compatibility with legacy web platform APIs** + * **and should never be used in new code, because they use strings to represent** + * **binary data and predate the introduction of typed arrays in JavaScript.** + * **For code running using Node.js APIs, converting between base64-encoded strings** + * **and binary data should be performed using `Buffer.from(str, 'base64')` and`buf.toString('base64')`.** + * @since v15.13.0, v14.17.0 + * @legacy Use `buf.toString('base64')` instead. + * @param data An ASCII (Latin1) string. + */ + function btoa(data: string): string; + interface Blob extends __Blob {} + /** + * `Blob` class is a global reference for `require('node:buffer').Blob` + * https://nodejs.org/api/buffer.html#class-blob + * @since v18.0.0 + */ + var Blob: typeof globalThis extends { + onmessage: any; + Blob: infer T; + } + ? T + : typeof NodeBlob; + } +} +declare module 'buffer' { + export * from 'node:buffer'; +} diff --git a/node_modules/@types/node/child_process.d.ts b/node_modules/@types/node/child_process.d.ts new file mode 100644 index 0000000..3cdf09d --- /dev/null +++ b/node_modules/@types/node/child_process.d.ts @@ -0,0 +1,1400 @@ +/** + * The `node:child_process` module provides the ability to spawn subprocesses in + * a manner that is similar, but not identical, to [`popen(3)`](http://man7.org/linux/man-pages/man3/popen.3.html). This capability + * is primarily provided by the {@link spawn} function: + * + * ```js + * const { spawn } = require('node:child_process'); + * const ls = spawn('ls', ['-lh', '/usr']); + * + * ls.stdout.on('data', (data) => { + * console.log(`stdout: ${data}`); + * }); + * + * ls.stderr.on('data', (data) => { + * console.error(`stderr: ${data}`); + * }); + * + * ls.on('close', (code) => { + * console.log(`child process exited with code ${code}`); + * }); + * ``` + * + * By default, pipes for `stdin`, `stdout`, and `stderr` are established between + * the parent Node.js process and the spawned subprocess. These pipes have + * limited (and platform-specific) capacity. If the subprocess writes to + * stdout in excess of that limit without the output being captured, the + * subprocess blocks waiting for the pipe buffer to accept more data. This is + * identical to the behavior of pipes in the shell. Use the `{ stdio: 'ignore' }`option if the output will not be consumed. + * + * The command lookup is performed using the `options.env.PATH` environment + * variable if `env` is in the `options` object. Otherwise, `process.env.PATH` is + * used. If `options.env` is set without `PATH`, lookup on Unix is performed + * on a default search path search of `/usr/bin:/bin` (see your operating system's + * manual for execvpe/execvp), on Windows the current processes environment + * variable `PATH` is used. + * + * On Windows, environment variables are case-insensitive. Node.js + * lexicographically sorts the `env` keys and uses the first one that + * case-insensitively matches. Only first (in lexicographic order) entry will be + * passed to the subprocess. This might lead to issues on Windows when passing + * objects to the `env` option that have multiple variants of the same key, such as`PATH` and `Path`. + * + * The {@link spawn} method spawns the child process asynchronously, + * without blocking the Node.js event loop. The {@link spawnSync} function provides equivalent functionality in a synchronous manner that blocks + * the event loop until the spawned process either exits or is terminated. + * + * For convenience, the `node:child_process` module provides a handful of + * synchronous and asynchronous alternatives to {@link spawn} and {@link spawnSync}. Each of these alternatives are implemented on + * top of {@link spawn} or {@link spawnSync}. + * + * * {@link exec}: spawns a shell and runs a command within that + * shell, passing the `stdout` and `stderr` to a callback function when + * complete. + * * {@link execFile}: similar to {@link exec} except + * that it spawns the command directly without first spawning a shell by + * default. + * * {@link fork}: spawns a new Node.js process and invokes a + * specified module with an IPC communication channel established that allows + * sending messages between parent and child. + * * {@link execSync}: a synchronous version of {@link exec} that will block the Node.js event loop. + * * {@link execFileSync}: a synchronous version of {@link execFile} that will block the Node.js event loop. + * + * For certain use cases, such as automating shell scripts, the `synchronous counterparts` may be more convenient. In many cases, however, + * the synchronous methods can have significant impact on performance due to + * stalling the event loop while spawned processes complete. + * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/child_process.js) + */ +declare module 'node:child_process' { + import { ObjectEncodingOptions } from 'node:fs'; + import { EventEmitter, Abortable } from 'node:events'; + import * as net from 'node:net'; + import { Writable, Readable, Stream, Pipe } from 'node:stream'; + import { URL } from 'node:url'; + type Serializable = string | object | number | boolean | bigint; + type SendHandle = net.Socket | net.Server; + /** + * Instances of the `ChildProcess` represent spawned child processes. + * + * Instances of `ChildProcess` are not intended to be created directly. Rather, + * use the {@link spawn}, {@link exec},{@link execFile}, or {@link fork} methods to create + * instances of `ChildProcess`. + * @since v2.2.0 + */ + class ChildProcess extends EventEmitter { + /** + * A `Writable Stream` that represents the child process's `stdin`. + * + * If a child process waits to read all of its input, the child will not continue + * until this stream has been closed via `end()`. + * + * If the child was spawned with `stdio[0]` set to anything other than `'pipe'`, + * then this will be `null`. + * + * `subprocess.stdin` is an alias for `subprocess.stdio[0]`. Both properties will + * refer to the same value. + * + * The `subprocess.stdin` property can be `null` or `undefined`if the child process could not be successfully spawned. + * @since v0.1.90 + */ + stdin: Writable | null; + /** + * A `Readable Stream` that represents the child process's `stdout`. + * + * If the child was spawned with `stdio[1]` set to anything other than `'pipe'`, + * then this will be `null`. + * + * `subprocess.stdout` is an alias for `subprocess.stdio[1]`. Both properties will + * refer to the same value. + * + * ```js + * const { spawn } = require('node:child_process'); + * + * const subprocess = spawn('ls'); + * + * subprocess.stdout.on('data', (data) => { + * console.log(`Received chunk ${data}`); + * }); + * ``` + * + * The `subprocess.stdout` property can be `null` or `undefined`if the child process could not be successfully spawned. + * @since v0.1.90 + */ + stdout: Readable | null; + /** + * A `Readable Stream` that represents the child process's `stderr`. + * + * If the child was spawned with `stdio[2]` set to anything other than `'pipe'`, + * then this will be `null`. + * + * `subprocess.stderr` is an alias for `subprocess.stdio[2]`. Both properties will + * refer to the same value. + * + * The `subprocess.stderr` property can be `null` or `undefined`if the child process could not be successfully spawned. + * @since v0.1.90 + */ + stderr: Readable | null; + /** + * The `subprocess.channel` property is a reference to the child's IPC channel. If + * no IPC channel exists, this property is `undefined`. + * @since v7.1.0 + */ + readonly channel?: Pipe | null | undefined; + /** + * A sparse array of pipes to the child process, corresponding with positions in + * the `stdio` option passed to {@link spawn} that have been set + * to the value `'pipe'`. `subprocess.stdio[0]`, `subprocess.stdio[1]`, and`subprocess.stdio[2]` are also available as `subprocess.stdin`,`subprocess.stdout`, and `subprocess.stderr`, + * respectively. + * + * In the following example, only the child's fd `1` (stdout) is configured as a + * pipe, so only the parent's `subprocess.stdio[1]` is a stream, all other values + * in the array are `null`. + * + * ```js + * const assert = require('node:assert'); + * const fs = require('node:fs'); + * const child_process = require('node:child_process'); + * + * const subprocess = child_process.spawn('ls', { + * stdio: [ + * 0, // Use parent's stdin for child. + * 'pipe', // Pipe child's stdout to parent. + * fs.openSync('err.out', 'w'), // Direct child's stderr to a file. + * ], + * }); + * + * assert.strictEqual(subprocess.stdio[0], null); + * assert.strictEqual(subprocess.stdio[0], subprocess.stdin); + * + * assert(subprocess.stdout); + * assert.strictEqual(subprocess.stdio[1], subprocess.stdout); + * + * assert.strictEqual(subprocess.stdio[2], null); + * assert.strictEqual(subprocess.stdio[2], subprocess.stderr); + * ``` + * + * The `subprocess.stdio` property can be `undefined` if the child process could + * not be successfully spawned. + * @since v0.7.10 + */ + readonly stdio: [ + Writable | null, + // stdin + Readable | null, + // stdout + Readable | null, + // stderr + Readable | Writable | null | undefined, + // extra + Readable | Writable | null | undefined // extra + ]; + /** + * The `subprocess.killed` property indicates whether the child process + * successfully received a signal from `subprocess.kill()`. The `killed` property + * does not indicate that the child process has been terminated. + * @since v0.5.10 + */ + readonly killed: boolean; + /** + * Returns the process identifier (PID) of the child process. If the child process + * fails to spawn due to errors, then the value is `undefined` and `error` is + * emitted. + * + * ```js + * const { spawn } = require('node:child_process'); + * const grep = spawn('grep', ['ssh']); + * + * console.log(`Spawned child pid: ${grep.pid}`); + * grep.stdin.end(); + * ``` + * @since v0.1.90 + */ + readonly pid?: number | undefined; + /** + * The `subprocess.connected` property indicates whether it is still possible to + * send and receive messages from a child process. When `subprocess.connected` is`false`, it is no longer possible to send or receive messages. + * @since v0.7.2 + */ + readonly connected: boolean; + /** + * The `subprocess.exitCode` property indicates the exit code of the child process. + * If the child process is still running, the field will be `null`. + */ + readonly exitCode: number | null; + /** + * The `subprocess.signalCode` property indicates the signal received by + * the child process if any, else `null`. + */ + readonly signalCode: NodeJS.Signals | null; + /** + * The `subprocess.spawnargs` property represents the full list of command-line + * arguments the child process was launched with. + */ + readonly spawnargs: string[]; + /** + * The `subprocess.spawnfile` property indicates the executable file name of + * the child process that is launched. + * + * For {@link fork}, its value will be equal to `process.execPath`. + * For {@link spawn}, its value will be the name of + * the executable file. + * For {@link exec}, its value will be the name of the shell + * in which the child process is launched. + */ + readonly spawnfile: string; + /** + * The `subprocess.kill()` method sends a signal to the child process. If no + * argument is given, the process will be sent the `'SIGTERM'` signal. See [`signal(7)`](http://man7.org/linux/man-pages/man7/signal.7.html) for a list of available signals. This function + * returns `true` if [`kill(2)`](http://man7.org/linux/man-pages/man2/kill.2.html) succeeds, and `false` otherwise. + * + * ```js + * const { spawn } = require('node:child_process'); + * const grep = spawn('grep', ['ssh']); + * + * grep.on('close', (code, signal) => { + * console.log( + * `child process terminated due to receipt of signal ${signal}`); + * }); + * + * // Send SIGHUP to process. + * grep.kill('SIGHUP'); + * ``` + * + * The `ChildProcess` object may emit an `'error'` event if the signal + * cannot be delivered. Sending a signal to a child process that has already exited + * is not an error but may have unforeseen consequences. Specifically, if the + * process identifier (PID) has been reassigned to another process, the signal will + * be delivered to that process instead which can have unexpected results. + * + * While the function is called `kill`, the signal delivered to the child process + * may not actually terminate the process. + * + * See [`kill(2)`](http://man7.org/linux/man-pages/man2/kill.2.html) for reference. + * + * On Windows, where POSIX signals do not exist, the `signal` argument will be + * ignored, and the process will be killed forcefully and abruptly (similar to`'SIGKILL'`). + * See `Signal Events` for more details. + * + * On Linux, child processes of child processes will not be terminated + * when attempting to kill their parent. This is likely to happen when running a + * new process in a shell or with the use of the `shell` option of `ChildProcess`: + * + * ```js + * 'use strict'; + * const { spawn } = require('node:child_process'); + * + * const subprocess = spawn( + * 'sh', + * [ + * '-c', + * `node -e "setInterval(() => { + * console.log(process.pid, 'is alive') + * }, 500);"`, + * ], { + * stdio: ['inherit', 'inherit', 'inherit'], + * }, + * ); + * + * setTimeout(() => { + * subprocess.kill(); // Does not terminate the Node.js process in the shell. + * }, 2000); + * ``` + * @since v0.1.90 + */ + kill(signal?: NodeJS.Signals | number): boolean; + /** + * Calls {@link ChildProcess.kill} with `'SIGTERM'`. + * @since v20.5.0 + */ + [Symbol.dispose](): void; + /** + * When an IPC channel has been established between the parent and child ( + * i.e. when using {@link fork}), the `subprocess.send()` method can + * be used to send messages to the child process. When the child process is a + * Node.js instance, these messages can be received via the `'message'` event. + * + * The message goes through serialization and parsing. The resulting + * message might not be the same as what is originally sent. + * + * For example, in the parent script: + * + * ```js + * const cp = require('node:child_process'); + * const n = cp.fork(`${__dirname}/sub.js`); + * + * n.on('message', (m) => { + * console.log('PARENT got message:', m); + * }); + * + * // Causes the child to print: CHILD got message: { hello: 'world' } + * n.send({ hello: 'world' }); + * ``` + * + * And then the child script, `'sub.js'` might look like this: + * + * ```js + * process.on('message', (m) => { + * console.log('CHILD got message:', m); + * }); + * + * // Causes the parent to print: PARENT got message: { foo: 'bar', baz: null } + * process.send({ foo: 'bar', baz: NaN }); + * ``` + * + * Child Node.js processes will have a `process.send()` method of their own + * that allows the child to send messages back to the parent. + * + * There is a special case when sending a `{cmd: 'NODE_foo'}` message. Messages + * containing a `NODE_` prefix in the `cmd` property are reserved for use within + * Node.js core and will not be emitted in the child's `'message'` event. Rather, such messages are emitted using the`'internalMessage'` event and are consumed internally by Node.js. + * Applications should avoid using such messages or listening for`'internalMessage'` events as it is subject to change without notice. + * + * The optional `sendHandle` argument that may be passed to `subprocess.send()` is + * for passing a TCP server or socket object to the child process. The child will + * receive the object as the second argument passed to the callback function + * registered on the `'message'` event. Any data that is received + * and buffered in the socket will not be sent to the child. + * + * The optional `callback` is a function that is invoked after the message is + * sent but before the child may have received it. The function is called with a + * single argument: `null` on success, or an `Error` object on failure. + * + * If no `callback` function is provided and the message cannot be sent, an`'error'` event will be emitted by the `ChildProcess` object. This can + * happen, for instance, when the child process has already exited. + * + * `subprocess.send()` will return `false` if the channel has closed or when the + * backlog of unsent messages exceeds a threshold that makes it unwise to send + * more. Otherwise, the method returns `true`. The `callback` function can be + * used to implement flow control. + * + * #### Example: sending a server object + * + * The `sendHandle` argument can be used, for instance, to pass the handle of + * a TCP server object to the child process as illustrated in the example below: + * + * ```js + * const subprocess = require('node:child_process').fork('subprocess.js'); + * + * // Open up the server object and send the handle. + * const server = require('node:net').createServer(); + * server.on('connection', (socket) => { + * socket.end('handled by parent'); + * }); + * server.listen(1337, () => { + * subprocess.send('server', server); + * }); + * ``` + * + * The child would then receive the server object as: + * + * ```js + * process.on('message', (m, server) => { + * if (m === 'server') { + * server.on('connection', (socket) => { + * socket.end('handled by child'); + * }); + * } + * }); + * ``` + * + * Once the server is now shared between the parent and child, some connections + * can be handled by the parent and some by the child. + * + * While the example above uses a server created using the `node:net` module,`node:dgram` module servers use exactly the same workflow with the exceptions of + * listening on a `'message'` event instead of `'connection'` and using`server.bind()` instead of `server.listen()`. This is, however, only + * supported on Unix platforms. + * + * #### Example: sending a socket object + * + * Similarly, the `sendHandler` argument can be used to pass the handle of a + * socket to the child process. The example below spawns two children that each + * handle connections with "normal" or "special" priority: + * + * ```js + * const { fork } = require('node:child_process'); + * const normal = fork('subprocess.js', ['normal']); + * const special = fork('subprocess.js', ['special']); + * + * // Open up the server and send sockets to child. Use pauseOnConnect to prevent + * // the sockets from being read before they are sent to the child process. + * const server = require('node:net').createServer({ pauseOnConnect: true }); + * server.on('connection', (socket) => { + * + * // If this is special priority... + * if (socket.remoteAddress === '74.125.127.100') { + * special.send('socket', socket); + * return; + * } + * // This is normal priority. + * normal.send('socket', socket); + * }); + * server.listen(1337); + * ``` + * + * The `subprocess.js` would receive the socket handle as the second argument + * passed to the event callback function: + * + * ```js + * process.on('message', (m, socket) => { + * if (m === 'socket') { + * if (socket) { + * // Check that the client socket exists. + * // It is possible for the socket to be closed between the time it is + * // sent and the time it is received in the child process. + * socket.end(`Request handled with ${process.argv[2]} priority`); + * } + * } + * }); + * ``` + * + * Do not use `.maxConnections` on a socket that has been passed to a subprocess. + * The parent cannot track when the socket is destroyed. + * + * Any `'message'` handlers in the subprocess should verify that `socket` exists, + * as the connection may have been closed during the time it takes to send the + * connection to the child. + * @since v0.5.9 + * @param options The `options` argument, if present, is an object used to parameterize the sending of certain types of handles. `options` supports the following properties: + */ + send(message: Serializable, callback?: (error: Error | null) => void): boolean; + send(message: Serializable, sendHandle?: SendHandle, callback?: (error: Error | null) => void): boolean; + send(message: Serializable, sendHandle?: SendHandle, options?: MessageOptions, callback?: (error: Error | null) => void): boolean; + /** + * Closes the IPC channel between parent and child, allowing the child to exit + * gracefully once there are no other connections keeping it alive. After calling + * this method the `subprocess.connected` and `process.connected` properties in + * both the parent and child (respectively) will be set to `false`, and it will be + * no longer possible to pass messages between the processes. + * + * The `'disconnect'` event will be emitted when there are no messages in the + * process of being received. This will most often be triggered immediately after + * calling `subprocess.disconnect()`. + * + * When the child process is a Node.js instance (e.g. spawned using {@link fork}), the `process.disconnect()` method can be invoked + * within the child process to close the IPC channel as well. + * @since v0.7.2 + */ + disconnect(): void; + /** + * By default, the parent will wait for the detached child to exit. To prevent the + * parent from waiting for a given `subprocess` to exit, use the`subprocess.unref()` method. Doing so will cause the parent's event loop to not + * include the child in its reference count, allowing the parent to exit + * independently of the child, unless there is an established IPC channel between + * the child and the parent. + * + * ```js + * const { spawn } = require('node:child_process'); + * + * const subprocess = spawn(process.argv[0], ['child_program.js'], { + * detached: true, + * stdio: 'ignore', + * }); + * + * subprocess.unref(); + * ``` + * @since v0.7.10 + */ + unref(): void; + /** + * Calling `subprocess.ref()` after making a call to `subprocess.unref()` will + * restore the removed reference count for the child process, forcing the parent + * to wait for the child to exit before exiting itself. + * + * ```js + * const { spawn } = require('node:child_process'); + * + * const subprocess = spawn(process.argv[0], ['child_program.js'], { + * detached: true, + * stdio: 'ignore', + * }); + * + * subprocess.unref(); + * subprocess.ref(); + * ``` + * @since v0.7.10 + */ + ref(): void; + /** + * events.EventEmitter + * 1. close + * 2. disconnect + * 3. error + * 4. exit + * 5. message + * 6. spawn + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: 'close', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; + addListener(event: 'disconnect', listener: () => void): this; + addListener(event: 'error', listener: (err: Error) => void): this; + addListener(event: 'exit', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; + addListener(event: 'message', listener: (message: Serializable, sendHandle: SendHandle) => void): this; + addListener(event: 'spawn', listener: () => void): this; + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: 'close', code: number | null, signal: NodeJS.Signals | null): boolean; + emit(event: 'disconnect'): boolean; + emit(event: 'error', err: Error): boolean; + emit(event: 'exit', code: number | null, signal: NodeJS.Signals | null): boolean; + emit(event: 'message', message: Serializable, sendHandle: SendHandle): boolean; + emit(event: 'spawn', listener: () => void): boolean; + on(event: string, listener: (...args: any[]) => void): this; + on(event: 'close', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; + on(event: 'disconnect', listener: () => void): this; + on(event: 'error', listener: (err: Error) => void): this; + on(event: 'exit', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; + on(event: 'message', listener: (message: Serializable, sendHandle: SendHandle) => void): this; + on(event: 'spawn', listener: () => void): this; + once(event: string, listener: (...args: any[]) => void): this; + once(event: 'close', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; + once(event: 'disconnect', listener: () => void): this; + once(event: 'error', listener: (err: Error) => void): this; + once(event: 'exit', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; + once(event: 'message', listener: (message: Serializable, sendHandle: SendHandle) => void): this; + once(event: 'spawn', listener: () => void): this; + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: 'close', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; + prependListener(event: 'disconnect', listener: () => void): this; + prependListener(event: 'error', listener: (err: Error) => void): this; + prependListener(event: 'exit', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; + prependListener(event: 'message', listener: (message: Serializable, sendHandle: SendHandle) => void): this; + prependListener(event: 'spawn', listener: () => void): this; + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'close', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; + prependOnceListener(event: 'disconnect', listener: () => void): this; + prependOnceListener(event: 'error', listener: (err: Error) => void): this; + prependOnceListener(event: 'exit', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; + prependOnceListener(event: 'message', listener: (message: Serializable, sendHandle: SendHandle) => void): this; + prependOnceListener(event: 'spawn', listener: () => void): this; + } + // return this object when stdio option is undefined or not specified + interface ChildProcessWithoutNullStreams extends ChildProcess { + stdin: Writable; + stdout: Readable; + stderr: Readable; + readonly stdio: [ + Writable, + Readable, + Readable, + // stderr + Readable | Writable | null | undefined, + // extra, no modification + Readable | Writable | null | undefined // extra, no modification + ]; + } + // return this object when stdio option is a tuple of 3 + interface ChildProcessByStdio extends ChildProcess { + stdin: I; + stdout: O; + stderr: E; + readonly stdio: [ + I, + O, + E, + Readable | Writable | null | undefined, + // extra, no modification + Readable | Writable | null | undefined // extra, no modification + ]; + } + interface MessageOptions { + keepOpen?: boolean | undefined; + } + type IOType = 'overlapped' | 'pipe' | 'ignore' | 'inherit'; + type StdioOptions = IOType | Array; + type SerializationType = 'json' | 'advanced'; + interface MessagingOptions extends Abortable { + /** + * Specify the kind of serialization used for sending messages between processes. + * @default 'json' + */ + serialization?: SerializationType | undefined; + /** + * The signal value to be used when the spawned process will be killed by the abort signal. + * @default 'SIGTERM' + */ + killSignal?: NodeJS.Signals | number | undefined; + /** + * In milliseconds the maximum amount of time the process is allowed to run. + */ + timeout?: number | undefined; + } + interface ProcessEnvOptions { + uid?: number | undefined; + gid?: number | undefined; + cwd?: string | URL | undefined; + env?: NodeJS.ProcessEnv | undefined; + } + interface CommonOptions extends ProcessEnvOptions { + /** + * @default false + */ + windowsHide?: boolean | undefined; + /** + * @default 0 + */ + timeout?: number | undefined; + } + interface CommonSpawnOptions extends CommonOptions, MessagingOptions, Abortable { + argv0?: string | undefined; + /** + * Can be set to 'pipe', 'inherit', 'overlapped', or 'ignore', or an array of these strings. + * If passed as an array, the first element is used for `stdin`, the second for + * `stdout`, and the third for `stderr`. A fourth element can be used to + * specify the `stdio` behavior beyond the standard streams. See + * {@link ChildProcess.stdio} for more information. + * + * @default 'pipe' + */ + stdio?: StdioOptions | undefined; + shell?: boolean | string | undefined; + windowsVerbatimArguments?: boolean | undefined; + } + interface SpawnOptions extends CommonSpawnOptions { + detached?: boolean | undefined; + } + interface SpawnOptionsWithoutStdio extends SpawnOptions { + stdio?: StdioPipeNamed | StdioPipe[] | undefined; + } + type StdioNull = 'inherit' | 'ignore' | Stream; + type StdioPipeNamed = 'pipe' | 'overlapped'; + type StdioPipe = undefined | null | StdioPipeNamed; + interface SpawnOptionsWithStdioTuple extends SpawnOptions { + stdio: [Stdin, Stdout, Stderr]; + } + /** + * The `child_process.spawn()` method spawns a new process using the given`command`, with command-line arguments in `args`. If omitted, `args` defaults + * to an empty array. + * + * **If the `shell` option is enabled, do not pass unsanitized user input to this** + * **function. Any input containing shell metacharacters may be used to trigger** + * **arbitrary command execution.** + * + * A third argument may be used to specify additional options, with these defaults: + * + * ```js + * const defaults = { + * cwd: undefined, + * env: process.env, + * }; + * ``` + * + * Use `cwd` to specify the working directory from which the process is spawned. + * If not given, the default is to inherit the current working directory. If given, + * but the path does not exist, the child process emits an `ENOENT` error + * and exits immediately. `ENOENT` is also emitted when the command + * does not exist. + * + * Use `env` to specify environment variables that will be visible to the new + * process, the default is `process.env`. + * + * `undefined` values in `env` will be ignored. + * + * Example of running `ls -lh /usr`, capturing `stdout`, `stderr`, and the + * exit code: + * + * ```js + * const { spawn } = require('node:child_process'); + * const ls = spawn('ls', ['-lh', '/usr']); + * + * ls.stdout.on('data', (data) => { + * console.log(`stdout: ${data}`); + * }); + * + * ls.stderr.on('data', (data) => { + * console.error(`stderr: ${data}`); + * }); + * + * ls.on('close', (code) => { + * console.log(`child process exited with code ${code}`); + * }); + * ``` + * + * Example: A very elaborate way to run `ps ax | grep ssh` + * + * ```js + * const { spawn } = require('node:child_process'); + * const ps = spawn('ps', ['ax']); + * const grep = spawn('grep', ['ssh']); + * + * ps.stdout.on('data', (data) => { + * grep.stdin.write(data); + * }); + * + * ps.stderr.on('data', (data) => { + * console.error(`ps stderr: ${data}`); + * }); + * + * ps.on('close', (code) => { + * if (code !== 0) { + * console.log(`ps process exited with code ${code}`); + * } + * grep.stdin.end(); + * }); + * + * grep.stdout.on('data', (data) => { + * console.log(data.toString()); + * }); + * + * grep.stderr.on('data', (data) => { + * console.error(`grep stderr: ${data}`); + * }); + * + * grep.on('close', (code) => { + * if (code !== 0) { + * console.log(`grep process exited with code ${code}`); + * } + * }); + * ``` + * + * Example of checking for failed `spawn`: + * + * ```js + * const { spawn } = require('node:child_process'); + * const subprocess = spawn('bad_command'); + * + * subprocess.on('error', (err) => { + * console.error('Failed to start subprocess.'); + * }); + * ``` + * + * Certain platforms (macOS, Linux) will use the value of `argv[0]` for the process + * title while others (Windows, SunOS) will use `command`. + * + * Node.js overwrites `argv[0]` with `process.execPath` on startup, so`process.argv[0]` in a Node.js child process will not match the `argv0`parameter passed to `spawn` from the parent. Retrieve + * it with the`process.argv0` property instead. + * + * If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.kill()` on the child process except + * the error passed to the callback will be an `AbortError`: + * + * ```js + * const { spawn } = require('node:child_process'); + * const controller = new AbortController(); + * const { signal } = controller; + * const grep = spawn('grep', ['ssh'], { signal }); + * grep.on('error', (err) => { + * // This will be called with err being an AbortError if the controller aborts + * }); + * controller.abort(); // Stops the child process + * ``` + * @since v0.1.90 + * @param command The command to run. + * @param args List of string arguments. + */ + function spawn(command: string, options?: SpawnOptionsWithoutStdio): ChildProcessWithoutNullStreams; + function spawn(command: string, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; + function spawn(command: string, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; + function spawn(command: string, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; + function spawn(command: string, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; + function spawn(command: string, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; + function spawn(command: string, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; + function spawn(command: string, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; + function spawn(command: string, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; + function spawn(command: string, options: SpawnOptions): ChildProcess; + // overloads of spawn with 'args' + function spawn(command: string, args?: ReadonlyArray, options?: SpawnOptionsWithoutStdio): ChildProcessWithoutNullStreams; + function spawn(command: string, args: ReadonlyArray, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; + function spawn(command: string, args: ReadonlyArray, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; + function spawn(command: string, args: ReadonlyArray, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; + function spawn(command: string, args: ReadonlyArray, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; + function spawn(command: string, args: ReadonlyArray, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; + function spawn(command: string, args: ReadonlyArray, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; + function spawn(command: string, args: ReadonlyArray, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; + function spawn(command: string, args: ReadonlyArray, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; + function spawn(command: string, args: ReadonlyArray, options: SpawnOptions): ChildProcess; + interface ExecOptions extends CommonOptions { + shell?: string | undefined; + signal?: AbortSignal | undefined; + maxBuffer?: number | undefined; + killSignal?: NodeJS.Signals | number | undefined; + } + interface ExecOptionsWithStringEncoding extends ExecOptions { + encoding: BufferEncoding; + } + interface ExecOptionsWithBufferEncoding extends ExecOptions { + encoding: BufferEncoding | null; // specify `null`. + } + interface ExecException extends Error { + cmd?: string | undefined; + killed?: boolean | undefined; + code?: number | undefined; + signal?: NodeJS.Signals | undefined; + } + /** + * Spawns a shell then executes the `command` within that shell, buffering any + * generated output. The `command` string passed to the exec function is processed + * directly by the shell and special characters (vary based on [shell](https://en.wikipedia.org/wiki/List_of_command-line_interpreters)) + * need to be dealt with accordingly: + * + * ```js + * const { exec } = require('node:child_process'); + * + * exec('"/path/to/test file/test.sh" arg1 arg2'); + * // Double quotes are used so that the space in the path is not interpreted as + * // a delimiter of multiple arguments. + * + * exec('echo "The \\$HOME variable is $HOME"'); + * // The $HOME variable is escaped in the first instance, but not in the second. + * ``` + * + * **Never pass unsanitized user input to this function. Any input containing shell** + * **metacharacters may be used to trigger arbitrary command execution.** + * + * If a `callback` function is provided, it is called with the arguments`(error, stdout, stderr)`. On success, `error` will be `null`. On error,`error` will be an instance of `Error`. The + * `error.code` property will be + * the exit code of the process. By convention, any exit code other than `0`indicates an error. `error.signal` will be the signal that terminated the + * process. + * + * The `stdout` and `stderr` arguments passed to the callback will contain the + * stdout and stderr output of the child process. By default, Node.js will decode + * the output as UTF-8 and pass strings to the callback. The `encoding` option + * can be used to specify the character encoding used to decode the stdout and + * stderr output. If `encoding` is `'buffer'`, or an unrecognized character + * encoding, `Buffer` objects will be passed to the callback instead. + * + * ```js + * const { exec } = require('node:child_process'); + * exec('cat *.js missing_file | wc -l', (error, stdout, stderr) => { + * if (error) { + * console.error(`exec error: ${error}`); + * return; + * } + * console.log(`stdout: ${stdout}`); + * console.error(`stderr: ${stderr}`); + * }); + * ``` + * + * If `timeout` is greater than `0`, the parent will send the signal + * identified by the `killSignal` property (the default is `'SIGTERM'`) if the + * child runs longer than `timeout` milliseconds. + * + * Unlike the [`exec(3)`](http://man7.org/linux/man-pages/man3/exec.3.html) POSIX system call, `child_process.exec()` does not replace + * the existing process and uses a shell to execute the command. + * + * If this method is invoked as its `util.promisify()` ed version, it returns + * a `Promise` for an `Object` with `stdout` and `stderr` properties. The returned`ChildProcess` instance is attached to the `Promise` as a `child` property. In + * case of an error (including any error resulting in an exit code other than 0), a + * rejected promise is returned, with the same `error` object given in the + * callback, but with two additional properties `stdout` and `stderr`. + * + * ```js + * const util = require('node:util'); + * const exec = util.promisify(require('node:child_process').exec); + * + * async function lsExample() { + * const { stdout, stderr } = await exec('ls'); + * console.log('stdout:', stdout); + * console.error('stderr:', stderr); + * } + * lsExample(); + * ``` + * + * If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.kill()` on the child process except + * the error passed to the callback will be an `AbortError`: + * + * ```js + * const { exec } = require('node:child_process'); + * const controller = new AbortController(); + * const { signal } = controller; + * const child = exec('grep ssh', { signal }, (error) => { + * console.error(error); // an AbortError + * }); + * controller.abort(); + * ``` + * @since v0.1.90 + * @param command The command to run, with space-separated arguments. + * @param callback called with the output when process terminates. + */ + function exec(command: string, callback?: (error: ExecException | null, stdout: string, stderr: string) => void): ChildProcess; + // `options` with `"buffer"` or `null` for `encoding` means stdout/stderr are definitely `Buffer`. + function exec( + command: string, + options: { + encoding: 'buffer' | null; + } & ExecOptions, + callback?: (error: ExecException | null, stdout: Buffer, stderr: Buffer) => void + ): ChildProcess; + // `options` with well known `encoding` means stdout/stderr are definitely `string`. + function exec( + command: string, + options: { + encoding: BufferEncoding; + } & ExecOptions, + callback?: (error: ExecException | null, stdout: string, stderr: string) => void + ): ChildProcess; + // `options` with an `encoding` whose type is `string` means stdout/stderr could either be `Buffer` or `string`. + // There is no guarantee the `encoding` is unknown as `string` is a superset of `BufferEncoding`. + function exec( + command: string, + options: { + encoding: BufferEncoding; + } & ExecOptions, + callback?: (error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void + ): ChildProcess; + // `options` without an `encoding` means stdout/stderr are definitely `string`. + function exec(command: string, options: ExecOptions, callback?: (error: ExecException | null, stdout: string, stderr: string) => void): ChildProcess; + // fallback if nothing else matches. Worst case is always `string | Buffer`. + function exec( + command: string, + options: (ObjectEncodingOptions & ExecOptions) | undefined | null, + callback?: (error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void + ): ChildProcess; + interface PromiseWithChild extends Promise { + child: ChildProcess; + } + namespace exec { + function __promisify__(command: string): PromiseWithChild<{ + stdout: string; + stderr: string; + }>; + function __promisify__( + command: string, + options: { + encoding: 'buffer' | null; + } & ExecOptions + ): PromiseWithChild<{ + stdout: Buffer; + stderr: Buffer; + }>; + function __promisify__( + command: string, + options: { + encoding: BufferEncoding; + } & ExecOptions + ): PromiseWithChild<{ + stdout: string; + stderr: string; + }>; + function __promisify__( + command: string, + options: ExecOptions + ): PromiseWithChild<{ + stdout: string; + stderr: string; + }>; + function __promisify__( + command: string, + options?: (ObjectEncodingOptions & ExecOptions) | null + ): PromiseWithChild<{ + stdout: string | Buffer; + stderr: string | Buffer; + }>; + } + interface ExecFileOptions extends CommonOptions, Abortable { + maxBuffer?: number | undefined; + killSignal?: NodeJS.Signals | number | undefined; + windowsVerbatimArguments?: boolean | undefined; + shell?: boolean | string | undefined; + signal?: AbortSignal | undefined; + } + interface ExecFileOptionsWithStringEncoding extends ExecFileOptions { + encoding: BufferEncoding; + } + interface ExecFileOptionsWithBufferEncoding extends ExecFileOptions { + encoding: 'buffer' | null; + } + interface ExecFileOptionsWithOtherEncoding extends ExecFileOptions { + encoding: BufferEncoding; + } + type ExecFileException = + & Omit + & Omit + & { code?: string | number | undefined | null }; + /** + * The `child_process.execFile()` function is similar to {@link exec} except that it does not spawn a shell by default. Rather, the specified + * executable `file` is spawned directly as a new process making it slightly more + * efficient than {@link exec}. + * + * The same options as {@link exec} are supported. Since a shell is + * not spawned, behaviors such as I/O redirection and file globbing are not + * supported. + * + * ```js + * const { execFile } = require('node:child_process'); + * const child = execFile('node', ['--version'], (error, stdout, stderr) => { + * if (error) { + * throw error; + * } + * console.log(stdout); + * }); + * ``` + * + * The `stdout` and `stderr` arguments passed to the callback will contain the + * stdout and stderr output of the child process. By default, Node.js will decode + * the output as UTF-8 and pass strings to the callback. The `encoding` option + * can be used to specify the character encoding used to decode the stdout and + * stderr output. If `encoding` is `'buffer'`, or an unrecognized character + * encoding, `Buffer` objects will be passed to the callback instead. + * + * If this method is invoked as its `util.promisify()` ed version, it returns + * a `Promise` for an `Object` with `stdout` and `stderr` properties. The returned`ChildProcess` instance is attached to the `Promise` as a `child` property. In + * case of an error (including any error resulting in an exit code other than 0), a + * rejected promise is returned, with the same `error` object given in the + * callback, but with two additional properties `stdout` and `stderr`. + * + * ```js + * const util = require('node:util'); + * const execFile = util.promisify(require('node:child_process').execFile); + * async function getVersion() { + * const { stdout } = await execFile('node', ['--version']); + * console.log(stdout); + * } + * getVersion(); + * ``` + * + * **If the `shell` option is enabled, do not pass unsanitized user input to this** + * **function. Any input containing shell metacharacters may be used to trigger** + * **arbitrary command execution.** + * + * If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.kill()` on the child process except + * the error passed to the callback will be an `AbortError`: + * + * ```js + * const { execFile } = require('node:child_process'); + * const controller = new AbortController(); + * const { signal } = controller; + * const child = execFile('node', ['--version'], { signal }, (error) => { + * console.error(error); // an AbortError + * }); + * controller.abort(); + * ``` + * @since v0.1.91 + * @param file The name or path of the executable file to run. + * @param args List of string arguments. + * @param callback Called with the output when process terminates. + */ + function execFile(file: string): ChildProcess; + function execFile(file: string, options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null): ChildProcess; + function execFile(file: string, args?: ReadonlyArray | null): ChildProcess; + function execFile(file: string, args: ReadonlyArray | undefined | null, options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null): ChildProcess; + // no `options` definitely means stdout/stderr are `string`. + function execFile(file: string, callback: (error: ExecFileException | null, stdout: string, stderr: string) => void): ChildProcess; + function execFile(file: string, args: ReadonlyArray | undefined | null, callback: (error: ExecFileException | null, stdout: string, stderr: string) => void): ChildProcess; + // `options` with `"buffer"` or `null` for `encoding` means stdout/stderr are definitely `Buffer`. + function execFile(file: string, options: ExecFileOptionsWithBufferEncoding, callback: (error: ExecFileException | null, stdout: Buffer, stderr: Buffer) => void): ChildProcess; + function execFile( + file: string, + args: ReadonlyArray | undefined | null, + options: ExecFileOptionsWithBufferEncoding, + callback: (error: ExecFileException | null, stdout: Buffer, stderr: Buffer) => void + ): ChildProcess; + // `options` with well known `encoding` means stdout/stderr are definitely `string`. + function execFile(file: string, options: ExecFileOptionsWithStringEncoding, callback: (error: ExecFileException | null, stdout: string, stderr: string) => void): ChildProcess; + function execFile( + file: string, + args: ReadonlyArray | undefined | null, + options: ExecFileOptionsWithStringEncoding, + callback: (error: ExecFileException | null, stdout: string, stderr: string) => void + ): ChildProcess; + // `options` with an `encoding` whose type is `string` means stdout/stderr could either be `Buffer` or `string`. + // There is no guarantee the `encoding` is unknown as `string` is a superset of `BufferEncoding`. + function execFile(file: string, options: ExecFileOptionsWithOtherEncoding, callback: (error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void): ChildProcess; + function execFile( + file: string, + args: ReadonlyArray | undefined | null, + options: ExecFileOptionsWithOtherEncoding, + callback: (error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void + ): ChildProcess; + // `options` without an `encoding` means stdout/stderr are definitely `string`. + function execFile(file: string, options: ExecFileOptions, callback: (error: ExecFileException | null, stdout: string, stderr: string) => void): ChildProcess; + function execFile( + file: string, + args: ReadonlyArray | undefined | null, + options: ExecFileOptions, + callback: (error: ExecFileException | null, stdout: string, stderr: string) => void + ): ChildProcess; + // fallback if nothing else matches. Worst case is always `string | Buffer`. + function execFile( + file: string, + options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null, + callback: ((error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void) | undefined | null + ): ChildProcess; + function execFile( + file: string, + args: ReadonlyArray | undefined | null, + options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null, + callback: ((error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void) | undefined | null + ): ChildProcess; + namespace execFile { + function __promisify__(file: string): PromiseWithChild<{ + stdout: string; + stderr: string; + }>; + function __promisify__( + file: string, + args: ReadonlyArray | undefined | null + ): PromiseWithChild<{ + stdout: string; + stderr: string; + }>; + function __promisify__( + file: string, + options: ExecFileOptionsWithBufferEncoding + ): PromiseWithChild<{ + stdout: Buffer; + stderr: Buffer; + }>; + function __promisify__( + file: string, + args: ReadonlyArray | undefined | null, + options: ExecFileOptionsWithBufferEncoding + ): PromiseWithChild<{ + stdout: Buffer; + stderr: Buffer; + }>; + function __promisify__( + file: string, + options: ExecFileOptionsWithStringEncoding + ): PromiseWithChild<{ + stdout: string; + stderr: string; + }>; + function __promisify__( + file: string, + args: ReadonlyArray | undefined | null, + options: ExecFileOptionsWithStringEncoding + ): PromiseWithChild<{ + stdout: string; + stderr: string; + }>; + function __promisify__( + file: string, + options: ExecFileOptionsWithOtherEncoding + ): PromiseWithChild<{ + stdout: string | Buffer; + stderr: string | Buffer; + }>; + function __promisify__( + file: string, + args: ReadonlyArray | undefined | null, + options: ExecFileOptionsWithOtherEncoding + ): PromiseWithChild<{ + stdout: string | Buffer; + stderr: string | Buffer; + }>; + function __promisify__( + file: string, + options: ExecFileOptions + ): PromiseWithChild<{ + stdout: string; + stderr: string; + }>; + function __promisify__( + file: string, + args: ReadonlyArray | undefined | null, + options: ExecFileOptions + ): PromiseWithChild<{ + stdout: string; + stderr: string; + }>; + function __promisify__( + file: string, + options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null + ): PromiseWithChild<{ + stdout: string | Buffer; + stderr: string | Buffer; + }>; + function __promisify__( + file: string, + args: ReadonlyArray | undefined | null, + options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null + ): PromiseWithChild<{ + stdout: string | Buffer; + stderr: string | Buffer; + }>; + } + interface ForkOptions extends ProcessEnvOptions, MessagingOptions, Abortable { + execPath?: string | undefined; + execArgv?: string[] | undefined; + silent?: boolean | undefined; + /** + * Can be set to 'pipe', 'inherit', 'overlapped', or 'ignore', or an array of these strings. + * If passed as an array, the first element is used for `stdin`, the second for + * `stdout`, and the third for `stderr`. A fourth element can be used to + * specify the `stdio` behavior beyond the standard streams. See + * {@link ChildProcess.stdio} for more information. + * + * @default 'pipe' + */ + stdio?: StdioOptions | undefined; + detached?: boolean | undefined; + windowsVerbatimArguments?: boolean | undefined; + } + /** + * The `child_process.fork()` method is a special case of {@link spawn} used specifically to spawn new Node.js processes. + * Like {@link spawn}, a `ChildProcess` object is returned. The + * returned `ChildProcess` will have an additional communication channel + * built-in that allows messages to be passed back and forth between the parent and + * child. See `subprocess.send()` for details. + * + * Keep in mind that spawned Node.js child processes are + * independent of the parent with exception of the IPC communication channel + * that is established between the two. Each process has its own memory, with + * their own V8 instances. Because of the additional resource allocations + * required, spawning a large number of child Node.js processes is not + * recommended. + * + * By default, `child_process.fork()` will spawn new Node.js instances using the `process.execPath` of the parent process. The `execPath` property in the`options` object allows for an alternative + * execution path to be used. + * + * Node.js processes launched with a custom `execPath` will communicate with the + * parent process using the file descriptor (fd) identified using the + * environment variable `NODE_CHANNEL_FD` on the child process. + * + * Unlike the [`fork(2)`](http://man7.org/linux/man-pages/man2/fork.2.html) POSIX system call, `child_process.fork()` does not clone the + * current process. + * + * The `shell` option available in {@link spawn} is not supported by`child_process.fork()` and will be ignored if set. + * + * If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.kill()` on the child process except + * the error passed to the callback will be an `AbortError`: + * + * ```js + * if (process.argv[2] === 'child') { + * setTimeout(() => { + * console.log(`Hello from ${process.argv[2]}!`); + * }, 1_000); + * } else { + * const { fork } = require('node:child_process'); + * const controller = new AbortController(); + * const { signal } = controller; + * const child = fork(__filename, ['child'], { signal }); + * child.on('error', (err) => { + * // This will be called with err being an AbortError if the controller aborts + * }); + * controller.abort(); // Stops the child process + * } + * ``` + * @since v0.5.0 + * @param modulePath The module to run in the child. + * @param args List of string arguments. + */ + function fork(modulePath: string, options?: ForkOptions): ChildProcess; + function fork(modulePath: string, args?: ReadonlyArray, options?: ForkOptions): ChildProcess; + interface SpawnSyncOptions extends CommonSpawnOptions { + input?: string | NodeJS.ArrayBufferView | undefined; + maxBuffer?: number | undefined; + encoding?: BufferEncoding | 'buffer' | null | undefined; + } + interface SpawnSyncOptionsWithStringEncoding extends SpawnSyncOptions { + encoding: BufferEncoding; + } + interface SpawnSyncOptionsWithBufferEncoding extends SpawnSyncOptions { + encoding?: 'buffer' | null | undefined; + } + interface SpawnSyncReturns { + pid: number; + output: Array; + stdout: T; + stderr: T; + status: number | null; + signal: NodeJS.Signals | null; + error?: Error | undefined; + } + /** + * The `child_process.spawnSync()` method is generally identical to {@link spawn} with the exception that the function will not return + * until the child process has fully closed. When a timeout has been encountered + * and `killSignal` is sent, the method won't return until the process has + * completely exited. If the process intercepts and handles the `SIGTERM` signal + * and doesn't exit, the parent process will wait until the child process has + * exited. + * + * **If the `shell` option is enabled, do not pass unsanitized user input to this** + * **function. Any input containing shell metacharacters may be used to trigger** + * **arbitrary command execution.** + * @since v0.11.12 + * @param command The command to run. + * @param args List of string arguments. + */ + function spawnSync(command: string): SpawnSyncReturns; + function spawnSync(command: string, options: SpawnSyncOptionsWithStringEncoding): SpawnSyncReturns; + function spawnSync(command: string, options: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns; + function spawnSync(command: string, options?: SpawnSyncOptions): SpawnSyncReturns; + function spawnSync(command: string, args: ReadonlyArray): SpawnSyncReturns; + function spawnSync(command: string, args: ReadonlyArray, options: SpawnSyncOptionsWithStringEncoding): SpawnSyncReturns; + function spawnSync(command: string, args: ReadonlyArray, options: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns; + function spawnSync(command: string, args?: ReadonlyArray, options?: SpawnSyncOptions): SpawnSyncReturns; + interface CommonExecOptions extends CommonOptions { + input?: string | NodeJS.ArrayBufferView | undefined; + /** + * Can be set to 'pipe', 'inherit, or 'ignore', or an array of these strings. + * If passed as an array, the first element is used for `stdin`, the second for + * `stdout`, and the third for `stderr`. A fourth element can be used to + * specify the `stdio` behavior beyond the standard streams. See + * {@link ChildProcess.stdio} for more information. + * + * @default 'pipe' + */ + stdio?: StdioOptions | undefined; + killSignal?: NodeJS.Signals | number | undefined; + maxBuffer?: number | undefined; + encoding?: BufferEncoding | 'buffer' | null | undefined; + } + interface ExecSyncOptions extends CommonExecOptions { + shell?: string | undefined; + } + interface ExecSyncOptionsWithStringEncoding extends ExecSyncOptions { + encoding: BufferEncoding; + } + interface ExecSyncOptionsWithBufferEncoding extends ExecSyncOptions { + encoding?: 'buffer' | null | undefined; + } + /** + * The `child_process.execSync()` method is generally identical to {@link exec} with the exception that the method will not return + * until the child process has fully closed. When a timeout has been encountered + * and `killSignal` is sent, the method won't return until the process has + * completely exited. If the child process intercepts and handles the `SIGTERM`signal and doesn't exit, the parent process will wait until the child process + * has exited. + * + * If the process times out or has a non-zero exit code, this method will throw. + * The `Error` object will contain the entire result from {@link spawnSync}. + * + * **Never pass unsanitized user input to this function. Any input containing shell** + * **metacharacters may be used to trigger arbitrary command execution.** + * @since v0.11.12 + * @param command The command to run. + * @return The stdout from the command. + */ + function execSync(command: string): Buffer; + function execSync(command: string, options: ExecSyncOptionsWithStringEncoding): string; + function execSync(command: string, options: ExecSyncOptionsWithBufferEncoding): Buffer; + function execSync(command: string, options?: ExecSyncOptions): string | Buffer; + interface ExecFileSyncOptions extends CommonExecOptions { + shell?: boolean | string | undefined; + } + interface ExecFileSyncOptionsWithStringEncoding extends ExecFileSyncOptions { + encoding: BufferEncoding; + } + interface ExecFileSyncOptionsWithBufferEncoding extends ExecFileSyncOptions { + encoding?: 'buffer' | null; // specify `null`. + } + /** + * The `child_process.execFileSync()` method is generally identical to {@link execFile} with the exception that the method will not + * return until the child process has fully closed. When a timeout has been + * encountered and `killSignal` is sent, the method won't return until the process + * has completely exited. + * + * If the child process intercepts and handles the `SIGTERM` signal and + * does not exit, the parent process will still wait until the child process has + * exited. + * + * If the process times out or has a non-zero exit code, this method will throw an `Error` that will include the full result of the underlying {@link spawnSync}. + * + * **If the `shell` option is enabled, do not pass unsanitized user input to this** + * **function. Any input containing shell metacharacters may be used to trigger** + * **arbitrary command execution.** + * @since v0.11.12 + * @param file The name or path of the executable file to run. + * @param args List of string arguments. + * @return The stdout from the command. + */ + function execFileSync(file: string): Buffer; + function execFileSync(file: string, options: ExecFileSyncOptionsWithStringEncoding): string; + function execFileSync(file: string, options: ExecFileSyncOptionsWithBufferEncoding): Buffer; + function execFileSync(file: string, options?: ExecFileSyncOptions): string | Buffer; + function execFileSync(file: string, args: ReadonlyArray): Buffer; + function execFileSync(file: string, args: ReadonlyArray, options: ExecFileSyncOptionsWithStringEncoding): string; + function execFileSync(file: string, args: ReadonlyArray, options: ExecFileSyncOptionsWithBufferEncoding): Buffer; + function execFileSync(file: string, args?: ReadonlyArray, options?: ExecFileSyncOptions): string | Buffer; +} +declare module 'child_process' { + export * from 'node:child_process'; +} diff --git a/node_modules/@types/node/cluster.d.ts b/node_modules/@types/node/cluster.d.ts new file mode 100644 index 0000000..f5d6942 --- /dev/null +++ b/node_modules/@types/node/cluster.d.ts @@ -0,0 +1,414 @@ +/** + * Clusters of Node.js processes can be used to run multiple instances of Node.js + * that can distribute workloads among their application threads. When process + * isolation is not needed, use the `worker_threads` module instead, which + * allows running multiple application threads within a single Node.js instance. + * + * The cluster module allows easy creation of child processes that all share + * server ports. + * + * ```js + * import cluster from 'node:cluster'; + * import http from 'node:http'; + * import { availableParallelism } from 'node:os'; + * import process from 'node:process'; + * + * const numCPUs = availableParallelism(); + * + * if (cluster.isPrimary) { + * console.log(`Primary ${process.pid} is running`); + * + * // Fork workers. + * for (let i = 0; i < numCPUs; i++) { + * cluster.fork(); + * } + * + * cluster.on('exit', (worker, code, signal) => { + * console.log(`worker ${worker.process.pid} died`); + * }); + * } else { + * // Workers can share any TCP connection + * // In this case it is an HTTP server + * http.createServer((req, res) => { + * res.writeHead(200); + * res.end('hello world\n'); + * }).listen(8000); + * + * console.log(`Worker ${process.pid} started`); + * } + * ``` + * + * Running Node.js will now share port 8000 between the workers: + * + * ```console + * $ node server.js + * Primary 3596 is running + * Worker 4324 started + * Worker 4520 started + * Worker 6056 started + * Worker 5644 started + * ``` + * + * On Windows, it is not yet possible to set up a named pipe server in a worker. + * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/cluster.js) + */ +declare module 'node:cluster' { + import * as child from 'node:child_process'; + import EventEmitter = require('node:events'); + import * as net from 'node:net'; + type SerializationType = 'json' | 'advanced'; + export interface ClusterSettings { + execArgv?: string[] | undefined; // default: process.execArgv + exec?: string | undefined; + args?: string[] | undefined; + silent?: boolean | undefined; + stdio?: any[] | undefined; + uid?: number | undefined; + gid?: number | undefined; + inspectPort?: number | (() => number) | undefined; + serialization?: SerializationType | undefined; + cwd?: string | undefined; + windowsHide?: boolean | undefined; + } + export interface Address { + address: string; + port: number; + addressType: number | 'udp4' | 'udp6'; // 4, 6, -1, "udp4", "udp6" + } + /** + * A `Worker` object contains all public information and method about a worker. + * In the primary it can be obtained using `cluster.workers`. In a worker + * it can be obtained using `cluster.worker`. + * @since v0.7.0 + */ + export class Worker extends EventEmitter { + /** + * Each new worker is given its own unique id, this id is stored in the`id`. + * + * While a worker is alive, this is the key that indexes it in`cluster.workers`. + * @since v0.8.0 + */ + id: number; + /** + * All workers are created using `child_process.fork()`, the returned object + * from this function is stored as `.process`. In a worker, the global `process`is stored. + * + * See: `Child Process module`. + * + * Workers will call `process.exit(0)` if the `'disconnect'` event occurs + * on `process` and `.exitedAfterDisconnect` is not `true`. This protects against + * accidental disconnection. + * @since v0.7.0 + */ + process: child.ChildProcess; + /** + * Send a message to a worker or primary, optionally with a handle. + * + * In the primary, this sends a message to a specific worker. It is identical to `ChildProcess.send()`. + * + * In a worker, this sends a message to the primary. It is identical to`process.send()`. + * + * This example will echo back all messages from the primary: + * + * ```js + * if (cluster.isPrimary) { + * const worker = cluster.fork(); + * worker.send('hi there'); + * + * } else if (cluster.isWorker) { + * process.on('message', (msg) => { + * process.send(msg); + * }); + * } + * ``` + * @since v0.7.0 + * @param options The `options` argument, if present, is an object used to parameterize the sending of certain types of handles. `options` supports the following properties: + */ + send(message: child.Serializable, callback?: (error: Error | null) => void): boolean; + send(message: child.Serializable, sendHandle: child.SendHandle, callback?: (error: Error | null) => void): boolean; + send(message: child.Serializable, sendHandle: child.SendHandle, options?: child.MessageOptions, callback?: (error: Error | null) => void): boolean; + /** + * This function will kill the worker. In the primary worker, it does this by + * disconnecting the `worker.process`, and once disconnected, killing with`signal`. In the worker, it does it by killing the process with `signal`. + * + * The `kill()` function kills the worker process without waiting for a graceful + * disconnect, it has the same behavior as `worker.process.kill()`. + * + * This method is aliased as `worker.destroy()` for backwards compatibility. + * + * In a worker, `process.kill()` exists, but it is not this function; + * it is `kill()`. + * @since v0.9.12 + * @param [signal='SIGTERM'] Name of the kill signal to send to the worker process. + */ + kill(signal?: string): void; + destroy(signal?: string): void; + /** + * In a worker, this function will close all servers, wait for the `'close'` event + * on those servers, and then disconnect the IPC channel. + * + * In the primary, an internal message is sent to the worker causing it to call`.disconnect()` on itself. + * + * Causes `.exitedAfterDisconnect` to be set. + * + * After a server is closed, it will no longer accept new connections, + * but connections may be accepted by any other listening worker. Existing + * connections will be allowed to close as usual. When no more connections exist, + * see `server.close()`, the IPC channel to the worker will close allowing it + * to die gracefully. + * + * The above applies _only_ to server connections, client connections are not + * automatically closed by workers, and disconnect does not wait for them to close + * before exiting. + * + * In a worker, `process.disconnect` exists, but it is not this function; + * it is `disconnect()`. + * + * Because long living server connections may block workers from disconnecting, it + * may be useful to send a message, so application specific actions may be taken to + * close them. It also may be useful to implement a timeout, killing a worker if + * the `'disconnect'` event has not been emitted after some time. + * + * ```js + * if (cluster.isPrimary) { + * const worker = cluster.fork(); + * let timeout; + * + * worker.on('listening', (address) => { + * worker.send('shutdown'); + * worker.disconnect(); + * timeout = setTimeout(() => { + * worker.kill(); + * }, 2000); + * }); + * + * worker.on('disconnect', () => { + * clearTimeout(timeout); + * }); + * + * } else if (cluster.isWorker) { + * const net = require('node:net'); + * const server = net.createServer((socket) => { + * // Connections never end + * }); + * + * server.listen(8000); + * + * process.on('message', (msg) => { + * if (msg === 'shutdown') { + * // Initiate graceful close of any connections to server + * } + * }); + * } + * ``` + * @since v0.7.7 + * @return A reference to `worker`. + */ + disconnect(): void; + /** + * This function returns `true` if the worker is connected to its primary via its + * IPC channel, `false` otherwise. A worker is connected to its primary after it + * has been created. It is disconnected after the `'disconnect'` event is emitted. + * @since v0.11.14 + */ + isConnected(): boolean; + /** + * This function returns `true` if the worker's process has terminated (either + * because of exiting or being signaled). Otherwise, it returns `false`. + * + * ```js + * import cluster from 'node:cluster'; + * import http from 'node:http'; + * import { availableParallelism } from 'node:os'; + * import process from 'node:process'; + * + * const numCPUs = availableParallelism(); + * + * if (cluster.isPrimary) { + * console.log(`Primary ${process.pid} is running`); + * + * // Fork workers. + * for (let i = 0; i < numCPUs; i++) { + * cluster.fork(); + * } + * + * cluster.on('fork', (worker) => { + * console.log('worker is dead:', worker.isDead()); + * }); + * + * cluster.on('exit', (worker, code, signal) => { + * console.log('worker is dead:', worker.isDead()); + * }); + * } else { + * // Workers can share any TCP connection. In this case, it is an HTTP server. + * http.createServer((req, res) => { + * res.writeHead(200); + * res.end(`Current process\n ${process.pid}`); + * process.kill(process.pid); + * }).listen(8000); + * } + * ``` + * @since v0.11.14 + */ + isDead(): boolean; + /** + * This property is `true` if the worker exited due to `.disconnect()`. + * If the worker exited any other way, it is `false`. If the + * worker has not exited, it is `undefined`. + * + * The boolean `worker.exitedAfterDisconnect` allows distinguishing between + * voluntary and accidental exit, the primary may choose not to respawn a worker + * based on this value. + * + * ```js + * cluster.on('exit', (worker, code, signal) => { + * if (worker.exitedAfterDisconnect === true) { + * console.log('Oh, it was just voluntary – no need to worry'); + * } + * }); + * + * // kill worker + * worker.kill(); + * ``` + * @since v6.0.0 + */ + exitedAfterDisconnect: boolean; + /** + * events.EventEmitter + * 1. disconnect + * 2. error + * 3. exit + * 4. listening + * 5. message + * 6. online + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: 'disconnect', listener: () => void): this; + addListener(event: 'error', listener: (error: Error) => void): this; + addListener(event: 'exit', listener: (code: number, signal: string) => void): this; + addListener(event: 'listening', listener: (address: Address) => void): this; + addListener(event: 'message', listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + addListener(event: 'online', listener: () => void): this; + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: 'disconnect'): boolean; + emit(event: 'error', error: Error): boolean; + emit(event: 'exit', code: number, signal: string): boolean; + emit(event: 'listening', address: Address): boolean; + emit(event: 'message', message: any, handle: net.Socket | net.Server): boolean; + emit(event: 'online'): boolean; + on(event: string, listener: (...args: any[]) => void): this; + on(event: 'disconnect', listener: () => void): this; + on(event: 'error', listener: (error: Error) => void): this; + on(event: 'exit', listener: (code: number, signal: string) => void): this; + on(event: 'listening', listener: (address: Address) => void): this; + on(event: 'message', listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + on(event: 'online', listener: () => void): this; + once(event: string, listener: (...args: any[]) => void): this; + once(event: 'disconnect', listener: () => void): this; + once(event: 'error', listener: (error: Error) => void): this; + once(event: 'exit', listener: (code: number, signal: string) => void): this; + once(event: 'listening', listener: (address: Address) => void): this; + once(event: 'message', listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + once(event: 'online', listener: () => void): this; + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: 'disconnect', listener: () => void): this; + prependListener(event: 'error', listener: (error: Error) => void): this; + prependListener(event: 'exit', listener: (code: number, signal: string) => void): this; + prependListener(event: 'listening', listener: (address: Address) => void): this; + prependListener(event: 'message', listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + prependListener(event: 'online', listener: () => void): this; + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'disconnect', listener: () => void): this; + prependOnceListener(event: 'error', listener: (error: Error) => void): this; + prependOnceListener(event: 'exit', listener: (code: number, signal: string) => void): this; + prependOnceListener(event: 'listening', listener: (address: Address) => void): this; + prependOnceListener(event: 'message', listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + prependOnceListener(event: 'online', listener: () => void): this; + } + export interface Cluster extends EventEmitter { + disconnect(callback?: () => void): void; + fork(env?: any): Worker; + /** @deprecated since v16.0.0 - use isPrimary. */ + readonly isMaster: boolean; + readonly isPrimary: boolean; + readonly isWorker: boolean; + schedulingPolicy: number; + readonly settings: ClusterSettings; + /** @deprecated since v16.0.0 - use setupPrimary. */ + setupMaster(settings?: ClusterSettings): void; + /** + * `setupPrimary` is used to change the default 'fork' behavior. Once called, the settings will be present in cluster.settings. + */ + setupPrimary(settings?: ClusterSettings): void; + readonly worker?: Worker | undefined; + readonly workers?: NodeJS.Dict | undefined; + readonly SCHED_NONE: number; + readonly SCHED_RR: number; + /** + * events.EventEmitter + * 1. disconnect + * 2. exit + * 3. fork + * 4. listening + * 5. message + * 6. online + * 7. setup + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: 'disconnect', listener: (worker: Worker) => void): this; + addListener(event: 'exit', listener: (worker: Worker, code: number, signal: string) => void): this; + addListener(event: 'fork', listener: (worker: Worker) => void): this; + addListener(event: 'listening', listener: (worker: Worker, address: Address) => void): this; + addListener(event: 'message', listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + addListener(event: 'online', listener: (worker: Worker) => void): this; + addListener(event: 'setup', listener: (settings: ClusterSettings) => void): this; + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: 'disconnect', worker: Worker): boolean; + emit(event: 'exit', worker: Worker, code: number, signal: string): boolean; + emit(event: 'fork', worker: Worker): boolean; + emit(event: 'listening', worker: Worker, address: Address): boolean; + emit(event: 'message', worker: Worker, message: any, handle: net.Socket | net.Server): boolean; + emit(event: 'online', worker: Worker): boolean; + emit(event: 'setup', settings: ClusterSettings): boolean; + on(event: string, listener: (...args: any[]) => void): this; + on(event: 'disconnect', listener: (worker: Worker) => void): this; + on(event: 'exit', listener: (worker: Worker, code: number, signal: string) => void): this; + on(event: 'fork', listener: (worker: Worker) => void): this; + on(event: 'listening', listener: (worker: Worker, address: Address) => void): this; + on(event: 'message', listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + on(event: 'online', listener: (worker: Worker) => void): this; + on(event: 'setup', listener: (settings: ClusterSettings) => void): this; + once(event: string, listener: (...args: any[]) => void): this; + once(event: 'disconnect', listener: (worker: Worker) => void): this; + once(event: 'exit', listener: (worker: Worker, code: number, signal: string) => void): this; + once(event: 'fork', listener: (worker: Worker) => void): this; + once(event: 'listening', listener: (worker: Worker, address: Address) => void): this; + once(event: 'message', listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + once(event: 'online', listener: (worker: Worker) => void): this; + once(event: 'setup', listener: (settings: ClusterSettings) => void): this; + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: 'disconnect', listener: (worker: Worker) => void): this; + prependListener(event: 'exit', listener: (worker: Worker, code: number, signal: string) => void): this; + prependListener(event: 'fork', listener: (worker: Worker) => void): this; + prependListener(event: 'listening', listener: (worker: Worker, address: Address) => void): this; + // the handle is a net.Socket or net.Server object, or undefined. + prependListener(event: 'message', listener: (worker: Worker, message: any, handle?: net.Socket | net.Server) => void): this; + prependListener(event: 'online', listener: (worker: Worker) => void): this; + prependListener(event: 'setup', listener: (settings: ClusterSettings) => void): this; + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'disconnect', listener: (worker: Worker) => void): this; + prependOnceListener(event: 'exit', listener: (worker: Worker, code: number, signal: string) => void): this; + prependOnceListener(event: 'fork', listener: (worker: Worker) => void): this; + prependOnceListener(event: 'listening', listener: (worker: Worker, address: Address) => void): this; + // the handle is a net.Socket or net.Server object, or undefined. + prependOnceListener(event: 'message', listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; + prependOnceListener(event: 'online', listener: (worker: Worker) => void): this; + prependOnceListener(event: 'setup', listener: (settings: ClusterSettings) => void): this; + } + const cluster: Cluster; + export default cluster; +} +declare module 'cluster' { + export * from 'node:cluster'; + export { default as default } from 'node:cluster'; +} diff --git a/node_modules/@types/node/console.d.ts b/node_modules/@types/node/console.d.ts new file mode 100644 index 0000000..7e35638 --- /dev/null +++ b/node_modules/@types/node/console.d.ts @@ -0,0 +1,412 @@ +/** + * The `node:console` module provides a simple debugging console that is similar to + * the JavaScript console mechanism provided by web browsers. + * + * The module exports two specific components: + * + * * A `Console` class with methods such as `console.log()`, `console.error()`, and`console.warn()` that can be used to write to any Node.js stream. + * * A global `console` instance configured to write to `process.stdout` and `process.stderr`. The global `console` can be used without calling`require('node:console')`. + * + * _**Warning**_: The global console object's methods are neither consistently + * synchronous like the browser APIs they resemble, nor are they consistently + * asynchronous like all other Node.js streams. See the `note on process I/O` for + * more information. + * + * Example using the global `console`: + * + * ```js + * console.log('hello world'); + * // Prints: hello world, to stdout + * console.log('hello %s', 'world'); + * // Prints: hello world, to stdout + * console.error(new Error('Whoops, something bad happened')); + * // Prints error message and stack trace to stderr: + * // Error: Whoops, something bad happened + * // at [eval]:5:15 + * // at Script.runInThisContext (node:vm:132:18) + * // at Object.runInThisContext (node:vm:309:38) + * // at node:internal/process/execution:77:19 + * // at [eval]-wrapper:6:22 + * // at evalScript (node:internal/process/execution:76:60) + * // at node:internal/main/eval_string:23:3 + * + * const name = 'Will Robinson'; + * console.warn(`Danger ${name}! Danger!`); + * // Prints: Danger Will Robinson! Danger!, to stderr + * ``` + * + * Example using the `Console` class: + * + * ```js + * const out = getStreamSomehow(); + * const err = getStreamSomehow(); + * const myConsole = new console.Console(out, err); + * + * myConsole.log('hello world'); + * // Prints: hello world, to out + * myConsole.log('hello %s', 'world'); + * // Prints: hello world, to out + * myConsole.error(new Error('Whoops, something bad happened')); + * // Prints: [Error: Whoops, something bad happened], to err + * + * const name = 'Will Robinson'; + * myConsole.warn(`Danger ${name}! Danger!`); + * // Prints: Danger Will Robinson! Danger!, to err + * ``` + * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/console.js) + */ +declare module 'console' { + import console = require('node:console'); + export = console; +} +declare module 'node:console' { + import { InspectOptions } from 'node:util'; + global { + // This needs to be global to avoid TS2403 in case lib.dom.d.ts is present in the same build + interface Console { + Console: console.ConsoleConstructor; + /** + * `console.assert()` writes a message if `value` is [falsy](https://developer.mozilla.org/en-US/docs/Glossary/Falsy) or omitted. It only + * writes a message and does not otherwise affect execution. The output always + * starts with `"Assertion failed"`. If provided, `message` is formatted using `util.format()`. + * + * If `value` is [truthy](https://developer.mozilla.org/en-US/docs/Glossary/Truthy), nothing happens. + * + * ```js + * console.assert(true, 'does nothing'); + * + * console.assert(false, 'Whoops %s work', 'didn\'t'); + * // Assertion failed: Whoops didn't work + * + * console.assert(); + * // Assertion failed + * ``` + * @since v0.1.101 + * @param value The value tested for being truthy. + * @param message All arguments besides `value` are used as error message. + */ + assert(value: any, message?: string, ...optionalParams: any[]): void; + /** + * When `stdout` is a TTY, calling `console.clear()` will attempt to clear the + * TTY. When `stdout` is not a TTY, this method does nothing. + * + * The specific operation of `console.clear()` can vary across operating systems + * and terminal types. For most Linux operating systems, `console.clear()`operates similarly to the `clear` shell command. On Windows, `console.clear()`will clear only the output in the + * current terminal viewport for the Node.js + * binary. + * @since v8.3.0 + */ + clear(): void; + /** + * Maintains an internal counter specific to `label` and outputs to `stdout` the + * number of times `console.count()` has been called with the given `label`. + * + * ```js + * > console.count() + * default: 1 + * undefined + * > console.count('default') + * default: 2 + * undefined + * > console.count('abc') + * abc: 1 + * undefined + * > console.count('xyz') + * xyz: 1 + * undefined + * > console.count('abc') + * abc: 2 + * undefined + * > console.count() + * default: 3 + * undefined + * > + * ``` + * @since v8.3.0 + * @param label The display label for the counter. + */ + count(label?: string): void; + /** + * Resets the internal counter specific to `label`. + * + * ```js + * > console.count('abc'); + * abc: 1 + * undefined + * > console.countReset('abc'); + * undefined + * > console.count('abc'); + * abc: 1 + * undefined + * > + * ``` + * @since v8.3.0 + * @param label The display label for the counter. + */ + countReset(label?: string): void; + /** + * The `console.debug()` function is an alias for {@link log}. + * @since v8.0.0 + */ + debug(message?: any, ...optionalParams: any[]): void; + /** + * Uses `util.inspect()` on `obj` and prints the resulting string to `stdout`. + * This function bypasses any custom `inspect()` function defined on `obj`. + * @since v0.1.101 + */ + dir(obj: any, options?: InspectOptions): void; + /** + * This method calls `console.log()` passing it the arguments received. + * This method does not produce any XML formatting. + * @since v8.0.0 + */ + dirxml(...data: any[]): void; + /** + * Prints to `stderr` with newline. Multiple arguments can be passed, with the + * first used as the primary message and all additional used as substitution + * values similar to [`printf(3)`](http://man7.org/linux/man-pages/man3/printf.3.html) (the arguments are all passed to `util.format()`). + * + * ```js + * const code = 5; + * console.error('error #%d', code); + * // Prints: error #5, to stderr + * console.error('error', code); + * // Prints: error 5, to stderr + * ``` + * + * If formatting elements (e.g. `%d`) are not found in the first string then `util.inspect()` is called on each argument and the resulting string + * values are concatenated. See `util.format()` for more information. + * @since v0.1.100 + */ + error(message?: any, ...optionalParams: any[]): void; + /** + * Increases indentation of subsequent lines by spaces for `groupIndentation`length. + * + * If one or more `label`s are provided, those are printed first without the + * additional indentation. + * @since v8.5.0 + */ + group(...label: any[]): void; + /** + * An alias for {@link group}. + * @since v8.5.0 + */ + groupCollapsed(...label: any[]): void; + /** + * Decreases indentation of subsequent lines by spaces for `groupIndentation`length. + * @since v8.5.0 + */ + groupEnd(): void; + /** + * The `console.info()` function is an alias for {@link log}. + * @since v0.1.100 + */ + info(message?: any, ...optionalParams: any[]): void; + /** + * Prints to `stdout` with newline. Multiple arguments can be passed, with the + * first used as the primary message and all additional used as substitution + * values similar to [`printf(3)`](http://man7.org/linux/man-pages/man3/printf.3.html) (the arguments are all passed to `util.format()`). + * + * ```js + * const count = 5; + * console.log('count: %d', count); + * // Prints: count: 5, to stdout + * console.log('count:', count); + * // Prints: count: 5, to stdout + * ``` + * + * See `util.format()` for more information. + * @since v0.1.100 + */ + log(message?: any, ...optionalParams: any[]): void; + /** + * Try to construct a table with the columns of the properties of `tabularData`(or use `properties`) and rows of `tabularData` and log it. Falls back to just + * logging the argument if it can’t be parsed as tabular. + * + * ```js + * // These can't be parsed as tabular data + * console.table(Symbol()); + * // Symbol() + * + * console.table(undefined); + * // undefined + * + * console.table([{ a: 1, b: 'Y' }, { a: 'Z', b: 2 }]); + * // ┌─────────┬─────┬─────┐ + * // │ (index) │ a │ b │ + * // ├─────────┼─────┼─────┤ + * // │ 0 │ 1 │ 'Y' │ + * // │ 1 │ 'Z' │ 2 │ + * // └─────────┴─────┴─────┘ + * + * console.table([{ a: 1, b: 'Y' }, { a: 'Z', b: 2 }], ['a']); + * // ┌─────────┬─────┐ + * // │ (index) │ a │ + * // ├─────────┼─────┤ + * // │ 0 │ 1 │ + * // │ 1 │ 'Z' │ + * // └─────────┴─────┘ + * ``` + * @since v10.0.0 + * @param properties Alternate properties for constructing the table. + */ + table(tabularData: any, properties?: ReadonlyArray): void; + /** + * Starts a timer that can be used to compute the duration of an operation. Timers + * are identified by a unique `label`. Use the same `label` when calling {@link timeEnd} to stop the timer and output the elapsed time in + * suitable time units to `stdout`. For example, if the elapsed + * time is 3869ms, `console.timeEnd()` displays "3.869s". + * @since v0.1.104 + */ + time(label?: string): void; + /** + * Stops a timer that was previously started by calling {@link time} and + * prints the result to `stdout`: + * + * ```js + * console.time('100-elements'); + * for (let i = 0; i < 100; i++) {} + * console.timeEnd('100-elements'); + * // prints 100-elements: 225.438ms + * ``` + * @since v0.1.104 + */ + timeEnd(label?: string): void; + /** + * For a timer that was previously started by calling {@link time}, prints + * the elapsed time and other `data` arguments to `stdout`: + * + * ```js + * console.time('process'); + * const value = expensiveProcess1(); // Returns 42 + * console.timeLog('process', value); + * // Prints "process: 365.227ms 42". + * doExpensiveProcess2(value); + * console.timeEnd('process'); + * ``` + * @since v10.7.0 + */ + timeLog(label?: string, ...data: any[]): void; + /** + * Prints to `stderr` the string `'Trace: '`, followed by the `util.format()` formatted message and stack trace to the current position in the code. + * + * ```js + * console.trace('Show me'); + * // Prints: (stack trace will vary based on where trace is called) + * // Trace: Show me + * // at repl:2:9 + * // at REPLServer.defaultEval (repl.js:248:27) + * // at bound (domain.js:287:14) + * // at REPLServer.runBound [as eval] (domain.js:300:12) + * // at REPLServer. (repl.js:412:12) + * // at emitOne (events.js:82:20) + * // at REPLServer.emit (events.js:169:7) + * // at REPLServer.Interface._onLine (readline.js:210:10) + * // at REPLServer.Interface._line (readline.js:549:8) + * // at REPLServer.Interface._ttyWrite (readline.js:826:14) + * ``` + * @since v0.1.104 + */ + trace(message?: any, ...optionalParams: any[]): void; + /** + * The `console.warn()` function is an alias for {@link error}. + * @since v0.1.100 + */ + warn(message?: any, ...optionalParams: any[]): void; + // --- Inspector mode only --- + /** + * This method does not display anything unless used in the inspector. + * Starts a JavaScript CPU profile with an optional label. + */ + profile(label?: string): void; + /** + * This method does not display anything unless used in the inspector. + * Stops the current JavaScript CPU profiling session if one has been started and prints the report to the Profiles panel of the inspector. + */ + profileEnd(label?: string): void; + /** + * This method does not display anything unless used in the inspector. + * Adds an event with the label `label` to the Timeline panel of the inspector. + */ + timeStamp(label?: string): void; + } + /** + * The `console` module provides a simple debugging console that is similar to the + * JavaScript console mechanism provided by web browsers. + * + * The module exports two specific components: + * + * * A `Console` class with methods such as `console.log()`, `console.error()` and`console.warn()` that can be used to write to any Node.js stream. + * * A global `console` instance configured to write to `process.stdout` and `process.stderr`. The global `console` can be used without calling`require('console')`. + * + * _**Warning**_: The global console object's methods are neither consistently + * synchronous like the browser APIs they resemble, nor are they consistently + * asynchronous like all other Node.js streams. See the `note on process I/O` for + * more information. + * + * Example using the global `console`: + * + * ```js + * console.log('hello world'); + * // Prints: hello world, to stdout + * console.log('hello %s', 'world'); + * // Prints: hello world, to stdout + * console.error(new Error('Whoops, something bad happened')); + * // Prints error message and stack trace to stderr: + * // Error: Whoops, something bad happened + * // at [eval]:5:15 + * // at Script.runInThisContext (node:vm:132:18) + * // at Object.runInThisContext (node:vm:309:38) + * // at node:internal/process/execution:77:19 + * // at [eval]-wrapper:6:22 + * // at evalScript (node:internal/process/execution:76:60) + * // at node:internal/main/eval_string:23:3 + * + * const name = 'Will Robinson'; + * console.warn(`Danger ${name}! Danger!`); + * // Prints: Danger Will Robinson! Danger!, to stderr + * ``` + * + * Example using the `Console` class: + * + * ```js + * const out = getStreamSomehow(); + * const err = getStreamSomehow(); + * const myConsole = new console.Console(out, err); + * + * myConsole.log('hello world'); + * // Prints: hello world, to out + * myConsole.log('hello %s', 'world'); + * // Prints: hello world, to out + * myConsole.error(new Error('Whoops, something bad happened')); + * // Prints: [Error: Whoops, something bad happened], to err + * + * const name = 'Will Robinson'; + * myConsole.warn(`Danger ${name}! Danger!`); + * // Prints: Danger Will Robinson! Danger!, to err + * ``` + * @see [source](https://github.com/nodejs/node/blob/v16.4.2/lib/console.js) + */ + namespace console { + interface ConsoleConstructorOptions { + stdout: NodeJS.WritableStream; + stderr?: NodeJS.WritableStream | undefined; + ignoreErrors?: boolean | undefined; + colorMode?: boolean | 'auto' | undefined; + inspectOptions?: InspectOptions | undefined; + /** + * Set group indentation + * @default 2 + */ + groupIndentation?: number | undefined; + } + interface ConsoleConstructor { + prototype: Console; + new (stdout: NodeJS.WritableStream, stderr?: NodeJS.WritableStream, ignoreErrors?: boolean): Console; + new (options: ConsoleConstructorOptions): Console; + } + } + var console: Console; + } + export = globalThis.console; +} diff --git a/node_modules/@types/node/constants.d.ts b/node_modules/@types/node/constants.d.ts new file mode 100644 index 0000000..d70cf3f --- /dev/null +++ b/node_modules/@types/node/constants.d.ts @@ -0,0 +1,18 @@ +/** @deprecated since v6.3.0 - use constants property exposed by the relevant module instead. */ +declare module 'node:constants' { + import { constants as osConstants, SignalConstants } from 'node:os'; + import { constants as cryptoConstants } from 'node:crypto'; + import { constants as fsConstants } from 'node:fs'; + + const exp: typeof osConstants.errno & + typeof osConstants.priority & + SignalConstants & + typeof cryptoConstants & + typeof fsConstants; + export = exp; +} + +declare module 'constants' { + import constants = require('node:constants'); + export = constants; +} diff --git a/node_modules/@types/node/crypto.d.ts b/node_modules/@types/node/crypto.d.ts new file mode 100644 index 0000000..07ac946 --- /dev/null +++ b/node_modules/@types/node/crypto.d.ts @@ -0,0 +1,3978 @@ +/** + * The `node:crypto` module provides cryptographic functionality that includes a + * set of wrappers for OpenSSL's hash, HMAC, cipher, decipher, sign, and verify + * functions. + * + * ```js + * const { createHmac } = await import('node:crypto'); + * + * const secret = 'abcdefg'; + * const hash = createHmac('sha256', secret) + * .update('I love cupcakes') + * .digest('hex'); + * console.log(hash); + * // Prints: + * // c0fa1bc00531bd78ef38c628449c5102aeabd49b5dc3a2a516ea6ea959d6658e + * ``` + * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/crypto.js) + */ +declare module 'node:crypto' { + import * as stream from 'node:stream'; + import { PeerCertificate } from 'node:tls'; + /** + * SPKAC is a Certificate Signing Request mechanism originally implemented by + * Netscape and was specified formally as part of HTML5's `keygen` element. + * + * `` is deprecated since [HTML 5.2](https://www.w3.org/TR/html52/changes.html#features-removed) and new projects + * should not use this element anymore. + * + * The `node:crypto` module provides the `Certificate` class for working with SPKAC + * data. The most common usage is handling output generated by the HTML5`` element. Node.js uses [OpenSSL's SPKAC + * implementation](https://www.openssl.org/docs/man3.0/man1/openssl-spkac.html) internally. + * @since v0.11.8 + */ + class Certificate { + /** + * ```js + * const { Certificate } = await import('node:crypto'); + * const spkac = getSpkacSomehow(); + * const challenge = Certificate.exportChallenge(spkac); + * console.log(challenge.toString('utf8')); + * // Prints: the challenge as a UTF8 string + * ``` + * @since v9.0.0 + * @param encoding The `encoding` of the `spkac` string. + * @return The challenge component of the `spkac` data structure, which includes a public key and a challenge. + */ + static exportChallenge(spkac: BinaryLike): Buffer; + /** + * ```js + * const { Certificate } = await import('node:crypto'); + * const spkac = getSpkacSomehow(); + * const publicKey = Certificate.exportPublicKey(spkac); + * console.log(publicKey); + * // Prints: the public key as + * ``` + * @since v9.0.0 + * @param encoding The `encoding` of the `spkac` string. + * @return The public key component of the `spkac` data structure, which includes a public key and a challenge. + */ + static exportPublicKey(spkac: BinaryLike, encoding?: string): Buffer; + /** + * ```js + * import { Buffer } from 'node:buffer'; + * const { Certificate } = await import('node:crypto'); + * + * const spkac = getSpkacSomehow(); + * console.log(Certificate.verifySpkac(Buffer.from(spkac))); + * // Prints: true or false + * ``` + * @since v9.0.0 + * @param encoding The `encoding` of the `spkac` string. + * @return `true` if the given `spkac` data structure is valid, `false` otherwise. + */ + static verifySpkac(spkac: NodeJS.ArrayBufferView): boolean; + /** + * @deprecated + * @param spkac + * @returns The challenge component of the `spkac` data structure, + * which includes a public key and a challenge. + */ + exportChallenge(spkac: BinaryLike): Buffer; + /** + * @deprecated + * @param spkac + * @param encoding The encoding of the spkac string. + * @returns The public key component of the `spkac` data structure, + * which includes a public key and a challenge. + */ + exportPublicKey(spkac: BinaryLike, encoding?: string): Buffer; + /** + * @deprecated + * @param spkac + * @returns `true` if the given `spkac` data structure is valid, + * `false` otherwise. + */ + verifySpkac(spkac: NodeJS.ArrayBufferView): boolean; + } + namespace constants { + // https://nodejs.org/dist/latest-v20.x/docs/api/crypto.html#crypto-constants + const OPENSSL_VERSION_NUMBER: number; + /** Applies multiple bug workarounds within OpenSSL. See https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html for detail. */ + const SSL_OP_ALL: number; + /** Allows legacy insecure renegotiation between OpenSSL and unpatched clients or servers. See https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html. */ + const SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION: number; + /** Attempts to use the server's preferences instead of the client's when selecting a cipher. See https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html. */ + const SSL_OP_CIPHER_SERVER_PREFERENCE: number; + /** Instructs OpenSSL to use Cisco's "speshul" version of DTLS_BAD_VER. */ + const SSL_OP_CISCO_ANYCONNECT: number; + /** Instructs OpenSSL to turn on cookie exchange. */ + const SSL_OP_COOKIE_EXCHANGE: number; + /** Instructs OpenSSL to add server-hello extension from an early version of the cryptopro draft. */ + const SSL_OP_CRYPTOPRO_TLSEXT_BUG: number; + /** Instructs OpenSSL to disable a SSL 3.0/TLS 1.0 vulnerability workaround added in OpenSSL 0.9.6d. */ + const SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS: number; + /** Allows initial connection to servers that do not support RI. */ + const SSL_OP_LEGACY_SERVER_CONNECT: number; + /** Instructs OpenSSL to disable support for SSL/TLS compression. */ + const SSL_OP_NO_COMPRESSION: number; + const SSL_OP_NO_QUERY_MTU: number; + /** Instructs OpenSSL to always start a new session when performing renegotiation. */ + const SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION: number; + const SSL_OP_NO_SSLv2: number; + const SSL_OP_NO_SSLv3: number; + const SSL_OP_NO_TICKET: number; + const SSL_OP_NO_TLSv1: number; + const SSL_OP_NO_TLSv1_1: number; + const SSL_OP_NO_TLSv1_2: number; + /** Instructs OpenSSL to disable version rollback attack detection. */ + const SSL_OP_TLS_ROLLBACK_BUG: number; + const ENGINE_METHOD_RSA: number; + const ENGINE_METHOD_DSA: number; + const ENGINE_METHOD_DH: number; + const ENGINE_METHOD_RAND: number; + const ENGINE_METHOD_EC: number; + const ENGINE_METHOD_CIPHERS: number; + const ENGINE_METHOD_DIGESTS: number; + const ENGINE_METHOD_PKEY_METHS: number; + const ENGINE_METHOD_PKEY_ASN1_METHS: number; + const ENGINE_METHOD_ALL: number; + const ENGINE_METHOD_NONE: number; + const DH_CHECK_P_NOT_SAFE_PRIME: number; + const DH_CHECK_P_NOT_PRIME: number; + const DH_UNABLE_TO_CHECK_GENERATOR: number; + const DH_NOT_SUITABLE_GENERATOR: number; + const RSA_PKCS1_PADDING: number; + const RSA_SSLV23_PADDING: number; + const RSA_NO_PADDING: number; + const RSA_PKCS1_OAEP_PADDING: number; + const RSA_X931_PADDING: number; + const RSA_PKCS1_PSS_PADDING: number; + /** Sets the salt length for RSA_PKCS1_PSS_PADDING to the digest size when signing or verifying. */ + const RSA_PSS_SALTLEN_DIGEST: number; + /** Sets the salt length for RSA_PKCS1_PSS_PADDING to the maximum permissible value when signing data. */ + const RSA_PSS_SALTLEN_MAX_SIGN: number; + /** Causes the salt length for RSA_PKCS1_PSS_PADDING to be determined automatically when verifying a signature. */ + const RSA_PSS_SALTLEN_AUTO: number; + const POINT_CONVERSION_COMPRESSED: number; + const POINT_CONVERSION_UNCOMPRESSED: number; + const POINT_CONVERSION_HYBRID: number; + /** Specifies the built-in default cipher list used by Node.js (colon-separated values). */ + const defaultCoreCipherList: string; + /** Specifies the active default cipher list used by the current Node.js process (colon-separated values). */ + const defaultCipherList: string; + } + interface HashOptions extends stream.TransformOptions { + /** + * For XOF hash functions such as `shake256`, the + * outputLength option can be used to specify the desired output length in bytes. + */ + outputLength?: number | undefined; + } + /** @deprecated since v10.0.0 */ + const fips: boolean; + /** + * Creates and returns a `Hash` object that can be used to generate hash digests + * using the given `algorithm`. Optional `options` argument controls stream + * behavior. For XOF hash functions such as `'shake256'`, the `outputLength` option + * can be used to specify the desired output length in bytes. + * + * The `algorithm` is dependent on the available algorithms supported by the + * version of OpenSSL on the platform. Examples are `'sha256'`, `'sha512'`, etc. + * On recent releases of OpenSSL, `openssl list -digest-algorithms` will + * display the available digest algorithms. + * + * Example: generating the sha256 sum of a file + * + * ```js + * import { + * createReadStream, + * } from 'node:fs'; + * import { argv } from 'node:process'; + * const { + * createHash, + * } = await import('node:crypto'); + * + * const filename = argv[2]; + * + * const hash = createHash('sha256'); + * + * const input = createReadStream(filename); + * input.on('readable', () => { + * // Only one element is going to be produced by the + * // hash stream. + * const data = input.read(); + * if (data) + * hash.update(data); + * else { + * console.log(`${hash.digest('hex')} ${filename}`); + * } + * }); + * ``` + * @since v0.1.92 + * @param options `stream.transform` options + */ + function createHash(algorithm: string, options?: HashOptions): Hash; + /** + * Creates and returns an `Hmac` object that uses the given `algorithm` and `key`. + * Optional `options` argument controls stream behavior. + * + * The `algorithm` is dependent on the available algorithms supported by the + * version of OpenSSL on the platform. Examples are `'sha256'`, `'sha512'`, etc. + * On recent releases of OpenSSL, `openssl list -digest-algorithms` will + * display the available digest algorithms. + * + * The `key` is the HMAC key used to generate the cryptographic HMAC hash. If it is + * a `KeyObject`, its type must be `secret`. If it is a string, please consider `caveats when using strings as inputs to cryptographic APIs`. If it was + * obtained from a cryptographically secure source of entropy, such as {@link randomBytes} or {@link generateKey}, its length should not + * exceed the block size of `algorithm` (e.g., 512 bits for SHA-256). + * + * Example: generating the sha256 HMAC of a file + * + * ```js + * import { + * createReadStream, + * } from 'node:fs'; + * import { argv } from 'node:process'; + * const { + * createHmac, + * } = await import('node:crypto'); + * + * const filename = argv[2]; + * + * const hmac = createHmac('sha256', 'a secret'); + * + * const input = createReadStream(filename); + * input.on('readable', () => { + * // Only one element is going to be produced by the + * // hash stream. + * const data = input.read(); + * if (data) + * hmac.update(data); + * else { + * console.log(`${hmac.digest('hex')} ${filename}`); + * } + * }); + * ``` + * @since v0.1.94 + * @param options `stream.transform` options + */ + function createHmac(algorithm: string, key: BinaryLike | KeyObject, options?: stream.TransformOptions): Hmac; + // https://nodejs.org/api/buffer.html#buffer_buffers_and_character_encodings + type BinaryToTextEncoding = 'base64' | 'base64url' | 'hex' | 'binary'; + type CharacterEncoding = 'utf8' | 'utf-8' | 'utf16le' | 'latin1'; + type LegacyCharacterEncoding = 'ascii' | 'binary' | 'ucs2' | 'ucs-2'; + type Encoding = BinaryToTextEncoding | CharacterEncoding | LegacyCharacterEncoding; + type ECDHKeyFormat = 'compressed' | 'uncompressed' | 'hybrid'; + /** + * The `Hash` class is a utility for creating hash digests of data. It can be + * used in one of two ways: + * + * * As a `stream` that is both readable and writable, where data is written + * to produce a computed hash digest on the readable side, or + * * Using the `hash.update()` and `hash.digest()` methods to produce the + * computed hash. + * + * The {@link createHash} method is used to create `Hash` instances. `Hash`objects are not to be created directly using the `new` keyword. + * + * Example: Using `Hash` objects as streams: + * + * ```js + * const { + * createHash, + * } = await import('node:crypto'); + * + * const hash = createHash('sha256'); + * + * hash.on('readable', () => { + * // Only one element is going to be produced by the + * // hash stream. + * const data = hash.read(); + * if (data) { + * console.log(data.toString('hex')); + * // Prints: + * // 6a2da20943931e9834fc12cfe5bb47bbd9ae43489a30726962b576f4e3993e50 + * } + * }); + * + * hash.write('some data to hash'); + * hash.end(); + * ``` + * + * Example: Using `Hash` and piped streams: + * + * ```js + * import { createReadStream } from 'node:fs'; + * import { stdout } from 'node:process'; + * const { createHash } = await import('node:crypto'); + * + * const hash = createHash('sha256'); + * + * const input = createReadStream('test.js'); + * input.pipe(hash).setEncoding('hex').pipe(stdout); + * ``` + * + * Example: Using the `hash.update()` and `hash.digest()` methods: + * + * ```js + * const { + * createHash, + * } = await import('node:crypto'); + * + * const hash = createHash('sha256'); + * + * hash.update('some data to hash'); + * console.log(hash.digest('hex')); + * // Prints: + * // 6a2da20943931e9834fc12cfe5bb47bbd9ae43489a30726962b576f4e3993e50 + * ``` + * @since v0.1.92 + */ + class Hash extends stream.Transform { + private constructor(); + /** + * Creates a new `Hash` object that contains a deep copy of the internal state + * of the current `Hash` object. + * + * The optional `options` argument controls stream behavior. For XOF hash + * functions such as `'shake256'`, the `outputLength` option can be used to + * specify the desired output length in bytes. + * + * An error is thrown when an attempt is made to copy the `Hash` object after + * its `hash.digest()` method has been called. + * + * ```js + * // Calculate a rolling hash. + * const { + * createHash, + * } = await import('node:crypto'); + * + * const hash = createHash('sha256'); + * + * hash.update('one'); + * console.log(hash.copy().digest('hex')); + * + * hash.update('two'); + * console.log(hash.copy().digest('hex')); + * + * hash.update('three'); + * console.log(hash.copy().digest('hex')); + * + * // Etc. + * ``` + * @since v13.1.0 + * @param options `stream.transform` options + */ + copy(options?: stream.TransformOptions): Hash; + /** + * Updates the hash content with the given `data`, the encoding of which + * is given in `inputEncoding`. + * If `encoding` is not provided, and the `data` is a string, an + * encoding of `'utf8'` is enforced. If `data` is a `Buffer`, `TypedArray`, or`DataView`, then `inputEncoding` is ignored. + * + * This can be called many times with new data as it is streamed. + * @since v0.1.92 + * @param inputEncoding The `encoding` of the `data` string. + */ + update(data: BinaryLike): Hash; + update(data: string, inputEncoding: Encoding): Hash; + /** + * Calculates the digest of all of the data passed to be hashed (using the `hash.update()` method). + * If `encoding` is provided a string will be returned; otherwise + * a `Buffer` is returned. + * + * The `Hash` object can not be used again after `hash.digest()` method has been + * called. Multiple calls will cause an error to be thrown. + * @since v0.1.92 + * @param encoding The `encoding` of the return value. + */ + digest(): Buffer; + digest(encoding: BinaryToTextEncoding): string; + } + /** + * The `Hmac` class is a utility for creating cryptographic HMAC digests. It can + * be used in one of two ways: + * + * * As a `stream` that is both readable and writable, where data is written + * to produce a computed HMAC digest on the readable side, or + * * Using the `hmac.update()` and `hmac.digest()` methods to produce the + * computed HMAC digest. + * + * The {@link createHmac} method is used to create `Hmac` instances. `Hmac`objects are not to be created directly using the `new` keyword. + * + * Example: Using `Hmac` objects as streams: + * + * ```js + * const { + * createHmac, + * } = await import('node:crypto'); + * + * const hmac = createHmac('sha256', 'a secret'); + * + * hmac.on('readable', () => { + * // Only one element is going to be produced by the + * // hash stream. + * const data = hmac.read(); + * if (data) { + * console.log(data.toString('hex')); + * // Prints: + * // 7fd04df92f636fd450bc841c9418e5825c17f33ad9c87c518115a45971f7f77e + * } + * }); + * + * hmac.write('some data to hash'); + * hmac.end(); + * ``` + * + * Example: Using `Hmac` and piped streams: + * + * ```js + * import { createReadStream } from 'node:fs'; + * import { stdout } from 'node:process'; + * const { + * createHmac, + * } = await import('node:crypto'); + * + * const hmac = createHmac('sha256', 'a secret'); + * + * const input = createReadStream('test.js'); + * input.pipe(hmac).pipe(stdout); + * ``` + * + * Example: Using the `hmac.update()` and `hmac.digest()` methods: + * + * ```js + * const { + * createHmac, + * } = await import('node:crypto'); + * + * const hmac = createHmac('sha256', 'a secret'); + * + * hmac.update('some data to hash'); + * console.log(hmac.digest('hex')); + * // Prints: + * // 7fd04df92f636fd450bc841c9418e5825c17f33ad9c87c518115a45971f7f77e + * ``` + * @since v0.1.94 + */ + class Hmac extends stream.Transform { + private constructor(); + /** + * Updates the `Hmac` content with the given `data`, the encoding of which + * is given in `inputEncoding`. + * If `encoding` is not provided, and the `data` is a string, an + * encoding of `'utf8'` is enforced. If `data` is a `Buffer`, `TypedArray`, or`DataView`, then `inputEncoding` is ignored. + * + * This can be called many times with new data as it is streamed. + * @since v0.1.94 + * @param inputEncoding The `encoding` of the `data` string. + */ + update(data: BinaryLike): Hmac; + update(data: string, inputEncoding: Encoding): Hmac; + /** + * Calculates the HMAC digest of all of the data passed using `hmac.update()`. + * If `encoding` is + * provided a string is returned; otherwise a `Buffer` is returned; + * + * The `Hmac` object can not be used again after `hmac.digest()` has been + * called. Multiple calls to `hmac.digest()` will result in an error being thrown. + * @since v0.1.94 + * @param encoding The `encoding` of the return value. + */ + digest(): Buffer; + digest(encoding: BinaryToTextEncoding): string; + } + type KeyObjectType = 'secret' | 'public' | 'private'; + interface KeyExportOptions { + type: 'pkcs1' | 'spki' | 'pkcs8' | 'sec1'; + format: T; + cipher?: string | undefined; + passphrase?: string | Buffer | undefined; + } + interface JwkKeyExportOptions { + format: 'jwk'; + } + interface JsonWebKey { + crv?: string | undefined; + d?: string | undefined; + dp?: string | undefined; + dq?: string | undefined; + e?: string | undefined; + k?: string | undefined; + kty?: string | undefined; + n?: string | undefined; + p?: string | undefined; + q?: string | undefined; + qi?: string | undefined; + x?: string | undefined; + y?: string | undefined; + [key: string]: unknown; + } + interface AsymmetricKeyDetails { + /** + * Key size in bits (RSA, DSA). + */ + modulusLength?: number | undefined; + /** + * Public exponent (RSA). + */ + publicExponent?: bigint | undefined; + /** + * Name of the message digest (RSA-PSS). + */ + hashAlgorithm?: string | undefined; + /** + * Name of the message digest used by MGF1 (RSA-PSS). + */ + mgf1HashAlgorithm?: string | undefined; + /** + * Minimal salt length in bytes (RSA-PSS). + */ + saltLength?: number | undefined; + /** + * Size of q in bits (DSA). + */ + divisorLength?: number | undefined; + /** + * Name of the curve (EC). + */ + namedCurve?: string | undefined; + } + /** + * Node.js uses a `KeyObject` class to represent a symmetric or asymmetric key, + * and each kind of key exposes different functions. The {@link createSecretKey}, {@link createPublicKey} and {@link createPrivateKey} methods are used to create `KeyObject`instances. `KeyObject` + * objects are not to be created directly using the `new`keyword. + * + * Most applications should consider using the new `KeyObject` API instead of + * passing keys as strings or `Buffer`s due to improved security features. + * + * `KeyObject` instances can be passed to other threads via `postMessage()`. + * The receiver obtains a cloned `KeyObject`, and the `KeyObject` does not need to + * be listed in the `transferList` argument. + * @since v11.6.0 + */ + class KeyObject { + private constructor(); + /** + * Example: Converting a `CryptoKey` instance to a `KeyObject`: + * + * ```js + * const { KeyObject } = await import('node:crypto'); + * const { subtle } = globalThis.crypto; + * + * const key = await subtle.generateKey({ + * name: 'HMAC', + * hash: 'SHA-256', + * length: 256, + * }, true, ['sign', 'verify']); + * + * const keyObject = KeyObject.from(key); + * console.log(keyObject.symmetricKeySize); + * // Prints: 32 (symmetric key size in bytes) + * ``` + * @since v15.0.0 + */ + static from(key: webcrypto.CryptoKey): KeyObject; + /** + * For asymmetric keys, this property represents the type of the key. Supported key + * types are: + * + * * `'rsa'` (OID 1.2.840.113549.1.1.1) + * * `'rsa-pss'` (OID 1.2.840.113549.1.1.10) + * * `'dsa'` (OID 1.2.840.10040.4.1) + * * `'ec'` (OID 1.2.840.10045.2.1) + * * `'x25519'` (OID 1.3.101.110) + * * `'x448'` (OID 1.3.101.111) + * * `'ed25519'` (OID 1.3.101.112) + * * `'ed448'` (OID 1.3.101.113) + * * `'dh'` (OID 1.2.840.113549.1.3.1) + * + * This property is `undefined` for unrecognized `KeyObject` types and symmetric + * keys. + * @since v11.6.0 + */ + asymmetricKeyType?: KeyType | undefined; + /** + * For asymmetric keys, this property represents the size of the embedded key in + * bytes. This property is `undefined` for symmetric keys. + */ + asymmetricKeySize?: number | undefined; + /** + * This property exists only on asymmetric keys. Depending on the type of the key, + * this object contains information about the key. None of the information obtained + * through this property can be used to uniquely identify a key or to compromise + * the security of the key. + * + * For RSA-PSS keys, if the key material contains a `RSASSA-PSS-params` sequence, + * the `hashAlgorithm`, `mgf1HashAlgorithm`, and `saltLength` properties will be + * set. + * + * Other key details might be exposed via this API using additional attributes. + * @since v15.7.0 + */ + asymmetricKeyDetails?: AsymmetricKeyDetails | undefined; + /** + * For symmetric keys, the following encoding options can be used: + * + * For public keys, the following encoding options can be used: + * + * For private keys, the following encoding options can be used: + * + * The result type depends on the selected encoding format, when PEM the + * result is a string, when DER it will be a buffer containing the data + * encoded as DER, when [JWK](https://tools.ietf.org/html/rfc7517) it will be an object. + * + * When [JWK](https://tools.ietf.org/html/rfc7517) encoding format was selected, all other encoding options are + * ignored. + * + * PKCS#1, SEC1, and PKCS#8 type keys can be encrypted by using a combination of + * the `cipher` and `format` options. The PKCS#8 `type` can be used with any`format` to encrypt any key algorithm (RSA, EC, or DH) by specifying a`cipher`. PKCS#1 and SEC1 can only be + * encrypted by specifying a `cipher`when the PEM `format` is used. For maximum compatibility, use PKCS#8 for + * encrypted private keys. Since PKCS#8 defines its own + * encryption mechanism, PEM-level encryption is not supported when encrypting + * a PKCS#8 key. See [RFC 5208](https://www.rfc-editor.org/rfc/rfc5208.txt) for PKCS#8 encryption and [RFC 1421](https://www.rfc-editor.org/rfc/rfc1421.txt) for + * PKCS#1 and SEC1 encryption. + * @since v11.6.0 + */ + export(options: KeyExportOptions<'pem'>): string | Buffer; + export(options?: KeyExportOptions<'der'>): Buffer; + export(options?: JwkKeyExportOptions): JsonWebKey; + /** + * For secret keys, this property represents the size of the key in bytes. This + * property is `undefined` for asymmetric keys. + * @since v11.6.0 + */ + symmetricKeySize?: number | undefined; + /** + * Depending on the type of this `KeyObject`, this property is either`'secret'` for secret (symmetric) keys, `'public'` for public (asymmetric) keys + * or `'private'` for private (asymmetric) keys. + * @since v11.6.0 + */ + type: KeyObjectType; + } + type CipherCCMTypes = 'aes-128-ccm' | 'aes-192-ccm' | 'aes-256-ccm' | 'chacha20-poly1305'; + type CipherGCMTypes = 'aes-128-gcm' | 'aes-192-gcm' | 'aes-256-gcm'; + type CipherOCBTypes = 'aes-128-ocb' | 'aes-192-ocb' | 'aes-256-ocb'; + type BinaryLike = string | NodeJS.ArrayBufferView; + type CipherKey = BinaryLike | KeyObject; + interface CipherCCMOptions extends stream.TransformOptions { + authTagLength: number; + } + interface CipherGCMOptions extends stream.TransformOptions { + authTagLength?: number | undefined; + } + interface CipherOCBOptions extends stream.TransformOptions { + authTagLength: number; + } + /** + * Creates and returns a `Cipher` object that uses the given `algorithm` and`password`. + * + * The `options` argument controls stream behavior and is optional except when a + * cipher in CCM or OCB mode (e.g. `'aes-128-ccm'`) is used. In that case, the`authTagLength` option is required and specifies the length of the + * authentication tag in bytes, see `CCM mode`. In GCM mode, the `authTagLength`option is not required but can be used to set the length of the authentication + * tag that will be returned by `getAuthTag()` and defaults to 16 bytes. + * For `chacha20-poly1305`, the `authTagLength` option defaults to 16 bytes. + * + * The `algorithm` is dependent on OpenSSL, examples are `'aes192'`, etc. On + * recent OpenSSL releases, `openssl list -cipher-algorithms` will + * display the available cipher algorithms. + * + * The `password` is used to derive the cipher key and initialization vector (IV). + * The value must be either a `'latin1'` encoded string, a `Buffer`, a`TypedArray`, or a `DataView`. + * + * **This function is semantically insecure for all** + * **supported ciphers and fatally flawed for ciphers in counter mode (such as CTR,** + * **GCM, or CCM).** + * + * The implementation of `crypto.createCipher()` derives keys using the OpenSSL + * function [`EVP_BytesToKey`](https://www.openssl.org/docs/man3.0/man3/EVP_BytesToKey.html) with the digest algorithm set to MD5, one + * iteration, and no salt. The lack of salt allows dictionary attacks as the same + * password always creates the same key. The low iteration count and + * non-cryptographically secure hash algorithm allow passwords to be tested very + * rapidly. + * + * In line with OpenSSL's recommendation to use a more modern algorithm instead of [`EVP_BytesToKey`](https://www.openssl.org/docs/man3.0/man3/EVP_BytesToKey.html) it is recommended that + * developers derive a key and IV on + * their own using {@link scrypt} and to use {@link createCipheriv} to create the `Cipher` object. Users should not use ciphers with counter mode + * (e.g. CTR, GCM, or CCM) in `crypto.createCipher()`. A warning is emitted when + * they are used in order to avoid the risk of IV reuse that causes + * vulnerabilities. For the case when IV is reused in GCM, see [Nonce-Disrespecting Adversaries](https://github.com/nonce-disrespect/nonce-disrespect) for details. + * @since v0.1.94 + * @deprecated Since v10.0.0 - Use {@link createCipheriv} instead. + * @param options `stream.transform` options + */ + function createCipher(algorithm: CipherCCMTypes, password: BinaryLike, options: CipherCCMOptions): CipherCCM; + /** @deprecated since v10.0.0 use `createCipheriv()` */ + function createCipher(algorithm: CipherGCMTypes, password: BinaryLike, options?: CipherGCMOptions): CipherGCM; + /** @deprecated since v10.0.0 use `createCipheriv()` */ + function createCipher(algorithm: string, password: BinaryLike, options?: stream.TransformOptions): Cipher; + /** + * Creates and returns a `Cipher` object, with the given `algorithm`, `key` and + * initialization vector (`iv`). + * + * The `options` argument controls stream behavior and is optional except when a + * cipher in CCM or OCB mode (e.g. `'aes-128-ccm'`) is used. In that case, the`authTagLength` option is required and specifies the length of the + * authentication tag in bytes, see `CCM mode`. In GCM mode, the `authTagLength`option is not required but can be used to set the length of the authentication + * tag that will be returned by `getAuthTag()` and defaults to 16 bytes. + * For `chacha20-poly1305`, the `authTagLength` option defaults to 16 bytes. + * + * The `algorithm` is dependent on OpenSSL, examples are `'aes192'`, etc. On + * recent OpenSSL releases, `openssl list -cipher-algorithms` will + * display the available cipher algorithms. + * + * The `key` is the raw key used by the `algorithm` and `iv` is an [initialization vector](https://en.wikipedia.org/wiki/Initialization_vector). Both arguments must be `'utf8'` encoded + * strings,`Buffers`, `TypedArray`, or `DataView`s. The `key` may optionally be + * a `KeyObject` of type `secret`. If the cipher does not need + * an initialization vector, `iv` may be `null`. + * + * When passing strings for `key` or `iv`, please consider `caveats when using strings as inputs to cryptographic APIs`. + * + * Initialization vectors should be unpredictable and unique; ideally, they will be + * cryptographically random. They do not have to be secret: IVs are typically just + * added to ciphertext messages unencrypted. It may sound contradictory that + * something has to be unpredictable and unique, but does not have to be secret; + * remember that an attacker must not be able to predict ahead of time what a + * given IV will be. + * @since v0.1.94 + * @param options `stream.transform` options + */ + function createCipheriv(algorithm: CipherCCMTypes, key: CipherKey, iv: BinaryLike, options: CipherCCMOptions): CipherCCM; + function createCipheriv(algorithm: CipherOCBTypes, key: CipherKey, iv: BinaryLike, options: CipherOCBOptions): CipherOCB; + function createCipheriv(algorithm: CipherGCMTypes, key: CipherKey, iv: BinaryLike, options?: CipherGCMOptions): CipherGCM; + function createCipheriv(algorithm: string, key: CipherKey, iv: BinaryLike | null, options?: stream.TransformOptions): Cipher; + /** + * Instances of the `Cipher` class are used to encrypt data. The class can be + * used in one of two ways: + * + * * As a `stream` that is both readable and writable, where plain unencrypted + * data is written to produce encrypted data on the readable side, or + * * Using the `cipher.update()` and `cipher.final()` methods to produce + * the encrypted data. + * + * The {@link createCipher} or {@link createCipheriv} methods are + * used to create `Cipher` instances. `Cipher` objects are not to be created + * directly using the `new` keyword. + * + * Example: Using `Cipher` objects as streams: + * + * ```js + * const { + * scrypt, + * randomFill, + * createCipheriv, + * } = await import('node:crypto'); + * + * const algorithm = 'aes-192-cbc'; + * const password = 'Password used to generate key'; + * + * // First, we'll generate the key. The key length is dependent on the algorithm. + * // In this case for aes192, it is 24 bytes (192 bits). + * scrypt(password, 'salt', 24, (err, key) => { + * if (err) throw err; + * // Then, we'll generate a random initialization vector + * randomFill(new Uint8Array(16), (err, iv) => { + * if (err) throw err; + * + * // Once we have the key and iv, we can create and use the cipher... + * const cipher = createCipheriv(algorithm, key, iv); + * + * let encrypted = ''; + * cipher.setEncoding('hex'); + * + * cipher.on('data', (chunk) => encrypted += chunk); + * cipher.on('end', () => console.log(encrypted)); + * + * cipher.write('some clear text data'); + * cipher.end(); + * }); + * }); + * ``` + * + * Example: Using `Cipher` and piped streams: + * + * ```js + * import { + * createReadStream, + * createWriteStream, + * } from 'node:fs'; + * + * import { + * pipeline, + * } from 'node:stream'; + * + * const { + * scrypt, + * randomFill, + * createCipheriv, + * } = await import('node:crypto'); + * + * const algorithm = 'aes-192-cbc'; + * const password = 'Password used to generate key'; + * + * // First, we'll generate the key. The key length is dependent on the algorithm. + * // In this case for aes192, it is 24 bytes (192 bits). + * scrypt(password, 'salt', 24, (err, key) => { + * if (err) throw err; + * // Then, we'll generate a random initialization vector + * randomFill(new Uint8Array(16), (err, iv) => { + * if (err) throw err; + * + * const cipher = createCipheriv(algorithm, key, iv); + * + * const input = createReadStream('test.js'); + * const output = createWriteStream('test.enc'); + * + * pipeline(input, cipher, output, (err) => { + * if (err) throw err; + * }); + * }); + * }); + * ``` + * + * Example: Using the `cipher.update()` and `cipher.final()` methods: + * + * ```js + * const { + * scrypt, + * randomFill, + * createCipheriv, + * } = await import('node:crypto'); + * + * const algorithm = 'aes-192-cbc'; + * const password = 'Password used to generate key'; + * + * // First, we'll generate the key. The key length is dependent on the algorithm. + * // In this case for aes192, it is 24 bytes (192 bits). + * scrypt(password, 'salt', 24, (err, key) => { + * if (err) throw err; + * // Then, we'll generate a random initialization vector + * randomFill(new Uint8Array(16), (err, iv) => { + * if (err) throw err; + * + * const cipher = createCipheriv(algorithm, key, iv); + * + * let encrypted = cipher.update('some clear text data', 'utf8', 'hex'); + * encrypted += cipher.final('hex'); + * console.log(encrypted); + * }); + * }); + * ``` + * @since v0.1.94 + */ + class Cipher extends stream.Transform { + private constructor(); + /** + * Updates the cipher with `data`. If the `inputEncoding` argument is given, + * the `data`argument is a string using the specified encoding. If the `inputEncoding`argument is not given, `data` must be a `Buffer`, `TypedArray`, or`DataView`. If `data` is a `Buffer`, + * `TypedArray`, or `DataView`, then`inputEncoding` is ignored. + * + * The `outputEncoding` specifies the output format of the enciphered + * data. If the `outputEncoding`is specified, a string using the specified encoding is returned. If no`outputEncoding` is provided, a `Buffer` is returned. + * + * The `cipher.update()` method can be called multiple times with new data until `cipher.final()` is called. Calling `cipher.update()` after `cipher.final()` will result in an error being + * thrown. + * @since v0.1.94 + * @param inputEncoding The `encoding` of the data. + * @param outputEncoding The `encoding` of the return value. + */ + update(data: BinaryLike): Buffer; + update(data: string, inputEncoding: Encoding): Buffer; + update(data: NodeJS.ArrayBufferView, inputEncoding: undefined, outputEncoding: Encoding): string; + update(data: string, inputEncoding: Encoding | undefined, outputEncoding: Encoding): string; + /** + * Once the `cipher.final()` method has been called, the `Cipher` object can no + * longer be used to encrypt data. Attempts to call `cipher.final()` more than + * once will result in an error being thrown. + * @since v0.1.94 + * @param outputEncoding The `encoding` of the return value. + * @return Any remaining enciphered contents. If `outputEncoding` is specified, a string is returned. If an `outputEncoding` is not provided, a {@link Buffer} is returned. + */ + final(): Buffer; + final(outputEncoding: BufferEncoding): string; + /** + * When using block encryption algorithms, the `Cipher` class will automatically + * add padding to the input data to the appropriate block size. To disable the + * default padding call `cipher.setAutoPadding(false)`. + * + * When `autoPadding` is `false`, the length of the entire input data must be a + * multiple of the cipher's block size or `cipher.final()` will throw an error. + * Disabling automatic padding is useful for non-standard padding, for instance + * using `0x0` instead of PKCS padding. + * + * The `cipher.setAutoPadding()` method must be called before `cipher.final()`. + * @since v0.7.1 + * @param [autoPadding=true] + * @return for method chaining. + */ + setAutoPadding(autoPadding?: boolean): this; + } + interface CipherCCM extends Cipher { + setAAD( + buffer: NodeJS.ArrayBufferView, + options: { + plaintextLength: number; + } + ): this; + getAuthTag(): Buffer; + } + interface CipherGCM extends Cipher { + setAAD( + buffer: NodeJS.ArrayBufferView, + options?: { + plaintextLength: number; + } + ): this; + getAuthTag(): Buffer; + } + interface CipherOCB extends Cipher { + setAAD( + buffer: NodeJS.ArrayBufferView, + options?: { + plaintextLength: number; + } + ): this; + getAuthTag(): Buffer; + } + /** + * Creates and returns a `Decipher` object that uses the given `algorithm` and`password` (key). + * + * The `options` argument controls stream behavior and is optional except when a + * cipher in CCM or OCB mode (e.g. `'aes-128-ccm'`) is used. In that case, the`authTagLength` option is required and specifies the length of the + * authentication tag in bytes, see `CCM mode`. + * For `chacha20-poly1305`, the `authTagLength` option defaults to 16 bytes. + * + * **This function is semantically insecure for all** + * **supported ciphers and fatally flawed for ciphers in counter mode (such as CTR,** + * **GCM, or CCM).** + * + * The implementation of `crypto.createDecipher()` derives keys using the OpenSSL + * function [`EVP_BytesToKey`](https://www.openssl.org/docs/man3.0/man3/EVP_BytesToKey.html) with the digest algorithm set to MD5, one + * iteration, and no salt. The lack of salt allows dictionary attacks as the same + * password always creates the same key. The low iteration count and + * non-cryptographically secure hash algorithm allow passwords to be tested very + * rapidly. + * + * In line with OpenSSL's recommendation to use a more modern algorithm instead of [`EVP_BytesToKey`](https://www.openssl.org/docs/man3.0/man3/EVP_BytesToKey.html) it is recommended that + * developers derive a key and IV on + * their own using {@link scrypt} and to use {@link createDecipheriv} to create the `Decipher` object. + * @since v0.1.94 + * @deprecated Since v10.0.0 - Use {@link createDecipheriv} instead. + * @param options `stream.transform` options + */ + function createDecipher(algorithm: CipherCCMTypes, password: BinaryLike, options: CipherCCMOptions): DecipherCCM; + /** @deprecated since v10.0.0 use `createDecipheriv()` */ + function createDecipher(algorithm: CipherGCMTypes, password: BinaryLike, options?: CipherGCMOptions): DecipherGCM; + /** @deprecated since v10.0.0 use `createDecipheriv()` */ + function createDecipher(algorithm: string, password: BinaryLike, options?: stream.TransformOptions): Decipher; + /** + * Creates and returns a `Decipher` object that uses the given `algorithm`, `key`and initialization vector (`iv`). + * + * The `options` argument controls stream behavior and is optional except when a + * cipher in CCM or OCB mode (e.g. `'aes-128-ccm'`) is used. In that case, the`authTagLength` option is required and specifies the length of the + * authentication tag in bytes, see `CCM mode`. In GCM mode, the `authTagLength`option is not required but can be used to restrict accepted authentication tags + * to those with the specified length. + * For `chacha20-poly1305`, the `authTagLength` option defaults to 16 bytes. + * + * The `algorithm` is dependent on OpenSSL, examples are `'aes192'`, etc. On + * recent OpenSSL releases, `openssl list -cipher-algorithms` will + * display the available cipher algorithms. + * + * The `key` is the raw key used by the `algorithm` and `iv` is an [initialization vector](https://en.wikipedia.org/wiki/Initialization_vector). Both arguments must be `'utf8'` encoded + * strings,`Buffers`, `TypedArray`, or `DataView`s. The `key` may optionally be + * a `KeyObject` of type `secret`. If the cipher does not need + * an initialization vector, `iv` may be `null`. + * + * When passing strings for `key` or `iv`, please consider `caveats when using strings as inputs to cryptographic APIs`. + * + * Initialization vectors should be unpredictable and unique; ideally, they will be + * cryptographically random. They do not have to be secret: IVs are typically just + * added to ciphertext messages unencrypted. It may sound contradictory that + * something has to be unpredictable and unique, but does not have to be secret; + * remember that an attacker must not be able to predict ahead of time what a given + * IV will be. + * @since v0.1.94 + * @param options `stream.transform` options + */ + function createDecipheriv(algorithm: CipherCCMTypes, key: CipherKey, iv: BinaryLike, options: CipherCCMOptions): DecipherCCM; + function createDecipheriv(algorithm: CipherOCBTypes, key: CipherKey, iv: BinaryLike, options: CipherOCBOptions): DecipherOCB; + function createDecipheriv(algorithm: CipherGCMTypes, key: CipherKey, iv: BinaryLike, options?: CipherGCMOptions): DecipherGCM; + function createDecipheriv(algorithm: string, key: CipherKey, iv: BinaryLike | null, options?: stream.TransformOptions): Decipher; + /** + * Instances of the `Decipher` class are used to decrypt data. The class can be + * used in one of two ways: + * + * * As a `stream` that is both readable and writable, where plain encrypted + * data is written to produce unencrypted data on the readable side, or + * * Using the `decipher.update()` and `decipher.final()` methods to + * produce the unencrypted data. + * + * The {@link createDecipher} or {@link createDecipheriv} methods are + * used to create `Decipher` instances. `Decipher` objects are not to be created + * directly using the `new` keyword. + * + * Example: Using `Decipher` objects as streams: + * + * ```js + * import { Buffer } from 'node:buffer'; + * const { + * scryptSync, + * createDecipheriv, + * } = await import('node:crypto'); + * + * const algorithm = 'aes-192-cbc'; + * const password = 'Password used to generate key'; + * // Key length is dependent on the algorithm. In this case for aes192, it is + * // 24 bytes (192 bits). + * // Use the async `crypto.scrypt()` instead. + * const key = scryptSync(password, 'salt', 24); + * // The IV is usually passed along with the ciphertext. + * const iv = Buffer.alloc(16, 0); // Initialization vector. + * + * const decipher = createDecipheriv(algorithm, key, iv); + * + * let decrypted = ''; + * decipher.on('readable', () => { + * let chunk; + * while (null !== (chunk = decipher.read())) { + * decrypted += chunk.toString('utf8'); + * } + * }); + * decipher.on('end', () => { + * console.log(decrypted); + * // Prints: some clear text data + * }); + * + * // Encrypted with same algorithm, key and iv. + * const encrypted = + * 'e5f79c5915c02171eec6b212d5520d44480993d7d622a7c4c2da32f6efda0ffa'; + * decipher.write(encrypted, 'hex'); + * decipher.end(); + * ``` + * + * Example: Using `Decipher` and piped streams: + * + * ```js + * import { + * createReadStream, + * createWriteStream, + * } from 'node:fs'; + * import { Buffer } from 'node:buffer'; + * const { + * scryptSync, + * createDecipheriv, + * } = await import('node:crypto'); + * + * const algorithm = 'aes-192-cbc'; + * const password = 'Password used to generate key'; + * // Use the async `crypto.scrypt()` instead. + * const key = scryptSync(password, 'salt', 24); + * // The IV is usually passed along with the ciphertext. + * const iv = Buffer.alloc(16, 0); // Initialization vector. + * + * const decipher = createDecipheriv(algorithm, key, iv); + * + * const input = createReadStream('test.enc'); + * const output = createWriteStream('test.js'); + * + * input.pipe(decipher).pipe(output); + * ``` + * + * Example: Using the `decipher.update()` and `decipher.final()` methods: + * + * ```js + * import { Buffer } from 'node:buffer'; + * const { + * scryptSync, + * createDecipheriv, + * } = await import('node:crypto'); + * + * const algorithm = 'aes-192-cbc'; + * const password = 'Password used to generate key'; + * // Use the async `crypto.scrypt()` instead. + * const key = scryptSync(password, 'salt', 24); + * // The IV is usually passed along with the ciphertext. + * const iv = Buffer.alloc(16, 0); // Initialization vector. + * + * const decipher = createDecipheriv(algorithm, key, iv); + * + * // Encrypted using same algorithm, key and iv. + * const encrypted = + * 'e5f79c5915c02171eec6b212d5520d44480993d7d622a7c4c2da32f6efda0ffa'; + * let decrypted = decipher.update(encrypted, 'hex', 'utf8'); + * decrypted += decipher.final('utf8'); + * console.log(decrypted); + * // Prints: some clear text data + * ``` + * @since v0.1.94 + */ + class Decipher extends stream.Transform { + private constructor(); + /** + * Updates the decipher with `data`. If the `inputEncoding` argument is given, + * the `data`argument is a string using the specified encoding. If the `inputEncoding`argument is not given, `data` must be a `Buffer`. If `data` is a `Buffer` then `inputEncoding` is + * ignored. + * + * The `outputEncoding` specifies the output format of the enciphered + * data. If the `outputEncoding`is specified, a string using the specified encoding is returned. If no`outputEncoding` is provided, a `Buffer` is returned. + * + * The `decipher.update()` method can be called multiple times with new data until `decipher.final()` is called. Calling `decipher.update()` after `decipher.final()` will result in an error + * being thrown. + * @since v0.1.94 + * @param inputEncoding The `encoding` of the `data` string. + * @param outputEncoding The `encoding` of the return value. + */ + update(data: NodeJS.ArrayBufferView): Buffer; + update(data: string, inputEncoding: Encoding): Buffer; + update(data: NodeJS.ArrayBufferView, inputEncoding: undefined, outputEncoding: Encoding): string; + update(data: string, inputEncoding: Encoding | undefined, outputEncoding: Encoding): string; + /** + * Once the `decipher.final()` method has been called, the `Decipher` object can + * no longer be used to decrypt data. Attempts to call `decipher.final()` more + * than once will result in an error being thrown. + * @since v0.1.94 + * @param outputEncoding The `encoding` of the return value. + * @return Any remaining deciphered contents. If `outputEncoding` is specified, a string is returned. If an `outputEncoding` is not provided, a {@link Buffer} is returned. + */ + final(): Buffer; + final(outputEncoding: BufferEncoding): string; + /** + * When data has been encrypted without standard block padding, calling`decipher.setAutoPadding(false)` will disable automatic padding to prevent `decipher.final()` from checking for and + * removing padding. + * + * Turning auto padding off will only work if the input data's length is a + * multiple of the ciphers block size. + * + * The `decipher.setAutoPadding()` method must be called before `decipher.final()`. + * @since v0.7.1 + * @param [autoPadding=true] + * @return for method chaining. + */ + setAutoPadding(auto_padding?: boolean): this; + } + interface DecipherCCM extends Decipher { + setAuthTag(buffer: NodeJS.ArrayBufferView): this; + setAAD( + buffer: NodeJS.ArrayBufferView, + options: { + plaintextLength: number; + } + ): this; + } + interface DecipherGCM extends Decipher { + setAuthTag(buffer: NodeJS.ArrayBufferView): this; + setAAD( + buffer: NodeJS.ArrayBufferView, + options?: { + plaintextLength: number; + } + ): this; + } + interface DecipherOCB extends Decipher { + setAuthTag(buffer: NodeJS.ArrayBufferView): this; + setAAD( + buffer: NodeJS.ArrayBufferView, + options?: { + plaintextLength: number; + } + ): this; + } + interface PrivateKeyInput { + key: string | Buffer; + format?: KeyFormat | undefined; + type?: 'pkcs1' | 'pkcs8' | 'sec1' | undefined; + passphrase?: string | Buffer | undefined; + encoding?: string | undefined; + } + interface PublicKeyInput { + key: string | Buffer; + format?: KeyFormat | undefined; + type?: 'pkcs1' | 'spki' | undefined; + encoding?: string | undefined; + } + /** + * Asynchronously generates a new random secret key of the given `length`. The`type` will determine which validations will be performed on the `length`. + * + * ```js + * const { + * generateKey, + * } = await import('node:crypto'); + * + * generateKey('hmac', { length: 512 }, (err, key) => { + * if (err) throw err; + * console.log(key.export().toString('hex')); // 46e..........620 + * }); + * ``` + * + * The size of a generated HMAC key should not exceed the block size of the + * underlying hash function. See {@link createHmac} for more information. + * @since v15.0.0 + * @param type The intended use of the generated secret key. Currently accepted values are `'hmac'` and `'aes'`. + */ + function generateKey( + type: 'hmac' | 'aes', + options: { + length: number; + }, + callback: (err: Error | null, key: KeyObject) => void + ): void; + /** + * Synchronously generates a new random secret key of the given `length`. The`type` will determine which validations will be performed on the `length`. + * + * ```js + * const { + * generateKeySync, + * } = await import('node:crypto'); + * + * const key = generateKeySync('hmac', { length: 512 }); + * console.log(key.export().toString('hex')); // e89..........41e + * ``` + * + * The size of a generated HMAC key should not exceed the block size of the + * underlying hash function. See {@link createHmac} for more information. + * @since v15.0.0 + * @param type The intended use of the generated secret key. Currently accepted values are `'hmac'` and `'aes'`. + */ + function generateKeySync( + type: 'hmac' | 'aes', + options: { + length: number; + } + ): KeyObject; + interface JsonWebKeyInput { + key: JsonWebKey; + format: 'jwk'; + } + /** + * Creates and returns a new key object containing a private key. If `key` is a + * string or `Buffer`, `format` is assumed to be `'pem'`; otherwise, `key`must be an object with the properties described above. + * + * If the private key is encrypted, a `passphrase` must be specified. The length + * of the passphrase is limited to 1024 bytes. + * @since v11.6.0 + */ + function createPrivateKey(key: PrivateKeyInput | string | Buffer | JsonWebKeyInput): KeyObject; + /** + * Creates and returns a new key object containing a public key. If `key` is a + * string or `Buffer`, `format` is assumed to be `'pem'`; if `key` is a `KeyObject`with type `'private'`, the public key is derived from the given private key; + * otherwise, `key` must be an object with the properties described above. + * + * If the format is `'pem'`, the `'key'` may also be an X.509 certificate. + * + * Because public keys can be derived from private keys, a private key may be + * passed instead of a public key. In that case, this function behaves as if {@link createPrivateKey} had been called, except that the type of the + * returned `KeyObject` will be `'public'` and that the private key cannot be + * extracted from the returned `KeyObject`. Similarly, if a `KeyObject` with type`'private'` is given, a new `KeyObject` with type `'public'` will be returned + * and it will be impossible to extract the private key from the returned object. + * @since v11.6.0 + */ + function createPublicKey(key: PublicKeyInput | string | Buffer | KeyObject | JsonWebKeyInput): KeyObject; + /** + * Creates and returns a new key object containing a secret key for symmetric + * encryption or `Hmac`. + * @since v11.6.0 + * @param encoding The string encoding when `key` is a string. + */ + function createSecretKey(key: NodeJS.ArrayBufferView): KeyObject; + function createSecretKey(key: string, encoding: BufferEncoding): KeyObject; + /** + * Creates and returns a `Sign` object that uses the given `algorithm`. Use {@link getHashes} to obtain the names of the available digest algorithms. + * Optional `options` argument controls the `stream.Writable` behavior. + * + * In some cases, a `Sign` instance can be created using the name of a signature + * algorithm, such as `'RSA-SHA256'`, instead of a digest algorithm. This will use + * the corresponding digest algorithm. This does not work for all signature + * algorithms, such as `'ecdsa-with-SHA256'`, so it is best to always use digest + * algorithm names. + * @since v0.1.92 + * @param options `stream.Writable` options + */ + function createSign(algorithm: string, options?: stream.WritableOptions): Sign; + type DSAEncoding = 'der' | 'ieee-p1363'; + interface SigningOptions { + /** + * @see crypto.constants.RSA_PKCS1_PADDING + */ + padding?: number | undefined; + saltLength?: number | undefined; + dsaEncoding?: DSAEncoding | undefined; + } + interface SignPrivateKeyInput extends PrivateKeyInput, SigningOptions {} + interface SignKeyObjectInput extends SigningOptions { + key: KeyObject; + } + interface VerifyPublicKeyInput extends PublicKeyInput, SigningOptions {} + interface VerifyKeyObjectInput extends SigningOptions { + key: KeyObject; + } + interface VerifyJsonWebKeyInput extends JsonWebKeyInput, SigningOptions {} + type KeyLike = string | Buffer | KeyObject; + /** + * The `Sign` class is a utility for generating signatures. It can be used in one + * of two ways: + * + * * As a writable `stream`, where data to be signed is written and the `sign.sign()` method is used to generate and return the signature, or + * * Using the `sign.update()` and `sign.sign()` methods to produce the + * signature. + * + * The {@link createSign} method is used to create `Sign` instances. The + * argument is the string name of the hash function to use. `Sign` objects are not + * to be created directly using the `new` keyword. + * + * Example: Using `Sign` and `Verify` objects as streams: + * + * ```js + * const { + * generateKeyPairSync, + * createSign, + * createVerify, + * } = await import('node:crypto'); + * + * const { privateKey, publicKey } = generateKeyPairSync('ec', { + * namedCurve: 'sect239k1', + * }); + * + * const sign = createSign('SHA256'); + * sign.write('some data to sign'); + * sign.end(); + * const signature = sign.sign(privateKey, 'hex'); + * + * const verify = createVerify('SHA256'); + * verify.write('some data to sign'); + * verify.end(); + * console.log(verify.verify(publicKey, signature, 'hex')); + * // Prints: true + * ``` + * + * Example: Using the `sign.update()` and `verify.update()` methods: + * + * ```js + * const { + * generateKeyPairSync, + * createSign, + * createVerify, + * } = await import('node:crypto'); + * + * const { privateKey, publicKey } = generateKeyPairSync('rsa', { + * modulusLength: 2048, + * }); + * + * const sign = createSign('SHA256'); + * sign.update('some data to sign'); + * sign.end(); + * const signature = sign.sign(privateKey); + * + * const verify = createVerify('SHA256'); + * verify.update('some data to sign'); + * verify.end(); + * console.log(verify.verify(publicKey, signature)); + * // Prints: true + * ``` + * @since v0.1.92 + */ + class Sign extends stream.Writable { + private constructor(); + /** + * Updates the `Sign` content with the given `data`, the encoding of which + * is given in `inputEncoding`. + * If `encoding` is not provided, and the `data` is a string, an + * encoding of `'utf8'` is enforced. If `data` is a `Buffer`, `TypedArray`, or`DataView`, then `inputEncoding` is ignored. + * + * This can be called many times with new data as it is streamed. + * @since v0.1.92 + * @param inputEncoding The `encoding` of the `data` string. + */ + update(data: BinaryLike): this; + update(data: string, inputEncoding: Encoding): this; + /** + * Calculates the signature on all the data passed through using either `sign.update()` or `sign.write()`. + * + * If `privateKey` is not a `KeyObject`, this function behaves as if`privateKey` had been passed to {@link createPrivateKey}. If it is an + * object, the following additional properties can be passed: + * + * If `outputEncoding` is provided a string is returned; otherwise a `Buffer` is returned. + * + * The `Sign` object can not be again used after `sign.sign()` method has been + * called. Multiple calls to `sign.sign()` will result in an error being thrown. + * @since v0.1.92 + */ + sign(privateKey: KeyLike | SignKeyObjectInput | SignPrivateKeyInput): Buffer; + sign(privateKey: KeyLike | SignKeyObjectInput | SignPrivateKeyInput, outputFormat: BinaryToTextEncoding): string; + } + /** + * Creates and returns a `Verify` object that uses the given algorithm. + * Use {@link getHashes} to obtain an array of names of the available + * signing algorithms. Optional `options` argument controls the`stream.Writable` behavior. + * + * In some cases, a `Verify` instance can be created using the name of a signature + * algorithm, such as `'RSA-SHA256'`, instead of a digest algorithm. This will use + * the corresponding digest algorithm. This does not work for all signature + * algorithms, such as `'ecdsa-with-SHA256'`, so it is best to always use digest + * algorithm names. + * @since v0.1.92 + * @param options `stream.Writable` options + */ + function createVerify(algorithm: string, options?: stream.WritableOptions): Verify; + /** + * The `Verify` class is a utility for verifying signatures. It can be used in one + * of two ways: + * + * * As a writable `stream` where written data is used to validate against the + * supplied signature, or + * * Using the `verify.update()` and `verify.verify()` methods to verify + * the signature. + * + * The {@link createVerify} method is used to create `Verify` instances.`Verify` objects are not to be created directly using the `new` keyword. + * + * See `Sign` for examples. + * @since v0.1.92 + */ + class Verify extends stream.Writable { + private constructor(); + /** + * Updates the `Verify` content with the given `data`, the encoding of which + * is given in `inputEncoding`. + * If `inputEncoding` is not provided, and the `data` is a string, an + * encoding of `'utf8'` is enforced. If `data` is a `Buffer`, `TypedArray`, or`DataView`, then `inputEncoding` is ignored. + * + * This can be called many times with new data as it is streamed. + * @since v0.1.92 + * @param inputEncoding The `encoding` of the `data` string. + */ + update(data: BinaryLike): Verify; + update(data: string, inputEncoding: Encoding): Verify; + /** + * Verifies the provided data using the given `object` and `signature`. + * + * If `object` is not a `KeyObject`, this function behaves as if`object` had been passed to {@link createPublicKey}. If it is an + * object, the following additional properties can be passed: + * + * The `signature` argument is the previously calculated signature for the data, in + * the `signatureEncoding`. + * If a `signatureEncoding` is specified, the `signature` is expected to be a + * string; otherwise `signature` is expected to be a `Buffer`,`TypedArray`, or `DataView`. + * + * The `verify` object can not be used again after `verify.verify()` has been + * called. Multiple calls to `verify.verify()` will result in an error being + * thrown. + * + * Because public keys can be derived from private keys, a private key may + * be passed instead of a public key. + * @since v0.1.92 + */ + verify(object: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput | VerifyJsonWebKeyInput, signature: NodeJS.ArrayBufferView): boolean; + verify(object: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput | VerifyJsonWebKeyInput, signature: string, signature_format?: BinaryToTextEncoding): boolean; + } + /** + * Creates a `DiffieHellman` key exchange object using the supplied `prime` and an + * optional specific `generator`. + * + * The `generator` argument can be a number, string, or `Buffer`. If`generator` is not specified, the value `2` is used. + * + * If `primeEncoding` is specified, `prime` is expected to be a string; otherwise + * a `Buffer`, `TypedArray`, or `DataView` is expected. + * + * If `generatorEncoding` is specified, `generator` is expected to be a string; + * otherwise a number, `Buffer`, `TypedArray`, or `DataView` is expected. + * @since v0.11.12 + * @param primeEncoding The `encoding` of the `prime` string. + * @param [generator=2] + * @param generatorEncoding The `encoding` of the `generator` string. + */ + function createDiffieHellman(primeLength: number, generator?: number): DiffieHellman; + function createDiffieHellman(prime: ArrayBuffer | NodeJS.ArrayBufferView, generator?: number | ArrayBuffer | NodeJS.ArrayBufferView): DiffieHellman; + function createDiffieHellman(prime: ArrayBuffer | NodeJS.ArrayBufferView, generator: string, generatorEncoding: BinaryToTextEncoding): DiffieHellman; + function createDiffieHellman(prime: string, primeEncoding: BinaryToTextEncoding, generator?: number | ArrayBuffer | NodeJS.ArrayBufferView): DiffieHellman; + function createDiffieHellman(prime: string, primeEncoding: BinaryToTextEncoding, generator: string, generatorEncoding: BinaryToTextEncoding): DiffieHellman; + /** + * The `DiffieHellman` class is a utility for creating Diffie-Hellman key + * exchanges. + * + * Instances of the `DiffieHellman` class can be created using the {@link createDiffieHellman} function. + * + * ```js + * import assert from 'node:assert'; + * + * const { + * createDiffieHellman, + * } = await import('node:crypto'); + * + * // Generate Alice's keys... + * const alice = createDiffieHellman(2048); + * const aliceKey = alice.generateKeys(); + * + * // Generate Bob's keys... + * const bob = createDiffieHellman(alice.getPrime(), alice.getGenerator()); + * const bobKey = bob.generateKeys(); + * + * // Exchange and generate the secret... + * const aliceSecret = alice.computeSecret(bobKey); + * const bobSecret = bob.computeSecret(aliceKey); + * + * // OK + * assert.strictEqual(aliceSecret.toString('hex'), bobSecret.toString('hex')); + * ``` + * @since v0.5.0 + */ + class DiffieHellman { + private constructor(); + /** + * Generates private and public Diffie-Hellman key values unless they have been + * generated or computed already, and returns + * the public key in the specified `encoding`. This key should be + * transferred to the other party. + * If `encoding` is provided a string is returned; otherwise a `Buffer` is returned. + * + * This function is a thin wrapper around [`DH_generate_key()`](https://www.openssl.org/docs/man3.0/man3/DH_generate_key.html). In particular, + * once a private key has been generated or set, calling this function only updates + * the public key but does not generate a new private key. + * @since v0.5.0 + * @param encoding The `encoding` of the return value. + */ + generateKeys(): Buffer; + generateKeys(encoding: BinaryToTextEncoding): string; + /** + * Computes the shared secret using `otherPublicKey` as the other + * party's public key and returns the computed shared secret. The supplied + * key is interpreted using the specified `inputEncoding`, and secret is + * encoded using specified `outputEncoding`. + * If the `inputEncoding` is not + * provided, `otherPublicKey` is expected to be a `Buffer`,`TypedArray`, or `DataView`. + * + * If `outputEncoding` is given a string is returned; otherwise, a `Buffer` is returned. + * @since v0.5.0 + * @param inputEncoding The `encoding` of an `otherPublicKey` string. + * @param outputEncoding The `encoding` of the return value. + */ + computeSecret(otherPublicKey: NodeJS.ArrayBufferView, inputEncoding?: null, outputEncoding?: null): Buffer; + computeSecret(otherPublicKey: string, inputEncoding: BinaryToTextEncoding, outputEncoding?: null): Buffer; + computeSecret(otherPublicKey: NodeJS.ArrayBufferView, inputEncoding: null, outputEncoding: BinaryToTextEncoding): string; + computeSecret(otherPublicKey: string, inputEncoding: BinaryToTextEncoding, outputEncoding: BinaryToTextEncoding): string; + /** + * Returns the Diffie-Hellman prime in the specified `encoding`. + * If `encoding` is provided a string is + * returned; otherwise a `Buffer` is returned. + * @since v0.5.0 + * @param encoding The `encoding` of the return value. + */ + getPrime(): Buffer; + getPrime(encoding: BinaryToTextEncoding): string; + /** + * Returns the Diffie-Hellman generator in the specified `encoding`. + * If `encoding` is provided a string is + * returned; otherwise a `Buffer` is returned. + * @since v0.5.0 + * @param encoding The `encoding` of the return value. + */ + getGenerator(): Buffer; + getGenerator(encoding: BinaryToTextEncoding): string; + /** + * Returns the Diffie-Hellman public key in the specified `encoding`. + * If `encoding` is provided a + * string is returned; otherwise a `Buffer` is returned. + * @since v0.5.0 + * @param encoding The `encoding` of the return value. + */ + getPublicKey(): Buffer; + getPublicKey(encoding: BinaryToTextEncoding): string; + /** + * Returns the Diffie-Hellman private key in the specified `encoding`. + * If `encoding` is provided a + * string is returned; otherwise a `Buffer` is returned. + * @since v0.5.0 + * @param encoding The `encoding` of the return value. + */ + getPrivateKey(): Buffer; + getPrivateKey(encoding: BinaryToTextEncoding): string; + /** + * Sets the Diffie-Hellman public key. If the `encoding` argument is provided,`publicKey` is expected + * to be a string. If no `encoding` is provided, `publicKey` is expected + * to be a `Buffer`, `TypedArray`, or `DataView`. + * @since v0.5.0 + * @param encoding The `encoding` of the `publicKey` string. + */ + setPublicKey(publicKey: NodeJS.ArrayBufferView): void; + setPublicKey(publicKey: string, encoding: BufferEncoding): void; + /** + * Sets the Diffie-Hellman private key. If the `encoding` argument is provided,`privateKey` is expected + * to be a string. If no `encoding` is provided, `privateKey` is expected + * to be a `Buffer`, `TypedArray`, or `DataView`. + * + * This function does not automatically compute the associated public key. Either `diffieHellman.setPublicKey()` or `diffieHellman.generateKeys()` can be + * used to manually provide the public key or to automatically derive it. + * @since v0.5.0 + * @param encoding The `encoding` of the `privateKey` string. + */ + setPrivateKey(privateKey: NodeJS.ArrayBufferView): void; + setPrivateKey(privateKey: string, encoding: BufferEncoding): void; + /** + * A bit field containing any warnings and/or errors resulting from a check + * performed during initialization of the `DiffieHellman` object. + * + * The following values are valid for this property (as defined in `node:constants` module): + * + * * `DH_CHECK_P_NOT_SAFE_PRIME` + * * `DH_CHECK_P_NOT_PRIME` + * * `DH_UNABLE_TO_CHECK_GENERATOR` + * * `DH_NOT_SUITABLE_GENERATOR` + * @since v0.11.12 + */ + verifyError: number; + } + /** + * The `DiffieHellmanGroup` class takes a well-known modp group as its argument. + * It works the same as `DiffieHellman`, except that it does not allow changing its keys after creation. + * In other words, it does not implement `setPublicKey()` or `setPrivateKey()` methods. + * + * ```js + * const { createDiffieHellmanGroup } = await import('node:crypto'); + * const dh = createDiffieHellmanGroup('modp1'); + * ``` + * The name (e.g. `'modp1'`) is taken from [RFC 2412](https://www.rfc-editor.org/rfc/rfc2412.txt) (modp1 and 2) and [RFC 3526](https://www.rfc-editor.org/rfc/rfc3526.txt): + * ```bash + * $ perl -ne 'print "$1\n" if /"(modp\d+)"/' src/node_crypto_groups.h + * modp1 # 768 bits + * modp2 # 1024 bits + * modp5 # 1536 bits + * modp14 # 2048 bits + * modp15 # etc. + * modp16 + * modp17 + * modp18 + * ``` + * @since v0.7.5 + */ + const DiffieHellmanGroup: DiffieHellmanGroupConstructor; + interface DiffieHellmanGroupConstructor { + new (name: string): DiffieHellmanGroup; + (name: string): DiffieHellmanGroup; + readonly prototype: DiffieHellmanGroup; + } + type DiffieHellmanGroup = Omit; + /** + * Creates a predefined `DiffieHellmanGroup` key exchange object. The + * supported groups are listed in the documentation for `DiffieHellmanGroup`. + * + * The returned object mimics the interface of objects created by {@link createDiffieHellman}, but will not allow changing + * the keys (with `diffieHellman.setPublicKey()`, for example). The + * advantage of using this method is that the parties do not have to + * generate nor exchange a group modulus beforehand, saving both processor + * and communication time. + * + * Example (obtaining a shared secret): + * + * ```js + * const { + * getDiffieHellman, + * } = await import('node:crypto'); + * const alice = getDiffieHellman('modp14'); + * const bob = getDiffieHellman('modp14'); + * + * alice.generateKeys(); + * bob.generateKeys(); + * + * const aliceSecret = alice.computeSecret(bob.getPublicKey(), null, 'hex'); + * const bobSecret = bob.computeSecret(alice.getPublicKey(), null, 'hex'); + * + * // aliceSecret and bobSecret should be the same + * console.log(aliceSecret === bobSecret); + * ``` + * @since v0.7.5 + */ + function getDiffieHellman(groupName: string): DiffieHellmanGroup; + /** + * An alias for {@link getDiffieHellman} + * @since v0.9.3 + */ + function createDiffieHellmanGroup(name: string): DiffieHellmanGroup; + /** + * Provides an asynchronous Password-Based Key Derivation Function 2 (PBKDF2) + * implementation. A selected HMAC digest algorithm specified by `digest` is + * applied to derive a key of the requested byte length (`keylen`) from the`password`, `salt` and `iterations`. + * + * The supplied `callback` function is called with two arguments: `err` and`derivedKey`. If an error occurs while deriving the key, `err` will be set; + * otherwise `err` will be `null`. By default, the successfully generated`derivedKey` will be passed to the callback as a `Buffer`. An error will be + * thrown if any of the input arguments specify invalid values or types. + * + * The `iterations` argument must be a number set as high as possible. The + * higher the number of iterations, the more secure the derived key will be, + * but will take a longer amount of time to complete. + * + * The `salt` should be as unique as possible. It is recommended that a salt is + * random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details. + * + * When passing strings for `password` or `salt`, please consider `caveats when using strings as inputs to cryptographic APIs`. + * + * ```js + * const { + * pbkdf2, + * } = await import('node:crypto'); + * + * pbkdf2('secret', 'salt', 100000, 64, 'sha512', (err, derivedKey) => { + * if (err) throw err; + * console.log(derivedKey.toString('hex')); // '3745e48...08d59ae' + * }); + * ``` + * + * An array of supported digest functions can be retrieved using {@link getHashes}. + * + * This API uses libuv's threadpool, which can have surprising and + * negative performance implications for some applications; see the `UV_THREADPOOL_SIZE` documentation for more information. + * @since v0.5.5 + */ + function pbkdf2(password: BinaryLike, salt: BinaryLike, iterations: number, keylen: number, digest: string, callback: (err: Error | null, derivedKey: Buffer) => void): void; + /** + * Provides a synchronous Password-Based Key Derivation Function 2 (PBKDF2) + * implementation. A selected HMAC digest algorithm specified by `digest` is + * applied to derive a key of the requested byte length (`keylen`) from the`password`, `salt` and `iterations`. + * + * If an error occurs an `Error` will be thrown, otherwise the derived key will be + * returned as a `Buffer`. + * + * The `iterations` argument must be a number set as high as possible. The + * higher the number of iterations, the more secure the derived key will be, + * but will take a longer amount of time to complete. + * + * The `salt` should be as unique as possible. It is recommended that a salt is + * random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details. + * + * When passing strings for `password` or `salt`, please consider `caveats when using strings as inputs to cryptographic APIs`. + * + * ```js + * const { + * pbkdf2Sync, + * } = await import('node:crypto'); + * + * const key = pbkdf2Sync('secret', 'salt', 100000, 64, 'sha512'); + * console.log(key.toString('hex')); // '3745e48...08d59ae' + * ``` + * + * An array of supported digest functions can be retrieved using {@link getHashes}. + * @since v0.9.3 + */ + function pbkdf2Sync(password: BinaryLike, salt: BinaryLike, iterations: number, keylen: number, digest: string): Buffer; + /** + * Generates cryptographically strong pseudorandom data. The `size` argument + * is a number indicating the number of bytes to generate. + * + * If a `callback` function is provided, the bytes are generated asynchronously + * and the `callback` function is invoked with two arguments: `err` and `buf`. + * If an error occurs, `err` will be an `Error` object; otherwise it is `null`. The`buf` argument is a `Buffer` containing the generated bytes. + * + * ```js + * // Asynchronous + * const { + * randomBytes, + * } = await import('node:crypto'); + * + * randomBytes(256, (err, buf) => { + * if (err) throw err; + * console.log(`${buf.length} bytes of random data: ${buf.toString('hex')}`); + * }); + * ``` + * + * If the `callback` function is not provided, the random bytes are generated + * synchronously and returned as a `Buffer`. An error will be thrown if + * there is a problem generating the bytes. + * + * ```js + * // Synchronous + * const { + * randomBytes, + * } = await import('node:crypto'); + * + * const buf = randomBytes(256); + * console.log( + * `${buf.length} bytes of random data: ${buf.toString('hex')}`); + * ``` + * + * The `crypto.randomBytes()` method will not complete until there is + * sufficient entropy available. + * This should normally never take longer than a few milliseconds. The only time + * when generating the random bytes may conceivably block for a longer period of + * time is right after boot, when the whole system is still low on entropy. + * + * This API uses libuv's threadpool, which can have surprising and + * negative performance implications for some applications; see the `UV_THREADPOOL_SIZE` documentation for more information. + * + * The asynchronous version of `crypto.randomBytes()` is carried out in a single + * threadpool request. To minimize threadpool task length variation, partition + * large `randomBytes` requests when doing so as part of fulfilling a client + * request. + * @since v0.5.8 + * @param size The number of bytes to generate. The `size` must not be larger than `2**31 - 1`. + * @return if the `callback` function is not provided. + */ + function randomBytes(size: number): Buffer; + function randomBytes(size: number, callback: (err: Error | null, buf: Buffer) => void): void; + function pseudoRandomBytes(size: number): Buffer; + function pseudoRandomBytes(size: number, callback: (err: Error | null, buf: Buffer) => void): void; + /** + * Return a random integer `n` such that `min <= n < max`. This + * implementation avoids [modulo bias](https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle#Modulo_bias). + * + * The range (`max - min`) must be less than 248. `min` and `max` must + * be [safe integers](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isSafeInteger). + * + * If the `callback` function is not provided, the random integer is + * generated synchronously. + * + * ```js + * // Asynchronous + * const { + * randomInt, + * } = await import('node:crypto'); + * + * randomInt(3, (err, n) => { + * if (err) throw err; + * console.log(`Random number chosen from (0, 1, 2): ${n}`); + * }); + * ``` + * + * ```js + * // Synchronous + * const { + * randomInt, + * } = await import('node:crypto'); + * + * const n = randomInt(3); + * console.log(`Random number chosen from (0, 1, 2): ${n}`); + * ``` + * + * ```js + * // With `min` argument + * const { + * randomInt, + * } = await import('node:crypto'); + * + * const n = randomInt(1, 7); + * console.log(`The dice rolled: ${n}`); + * ``` + * @since v14.10.0, v12.19.0 + * @param [min=0] Start of random range (inclusive). + * @param max End of random range (exclusive). + * @param callback `function(err, n) {}`. + */ + function randomInt(max: number): number; + function randomInt(min: number, max: number): number; + function randomInt(max: number, callback: (err: Error | null, value: number) => void): void; + function randomInt(min: number, max: number, callback: (err: Error | null, value: number) => void): void; + /** + * Synchronous version of {@link randomFill}. + * + * ```js + * import { Buffer } from 'node:buffer'; + * const { randomFillSync } = await import('node:crypto'); + * + * const buf = Buffer.alloc(10); + * console.log(randomFillSync(buf).toString('hex')); + * + * randomFillSync(buf, 5); + * console.log(buf.toString('hex')); + * + * // The above is equivalent to the following: + * randomFillSync(buf, 5, 5); + * console.log(buf.toString('hex')); + * ``` + * + * Any `ArrayBuffer`, `TypedArray` or `DataView` instance may be passed as`buffer`. + * + * ```js + * import { Buffer } from 'node:buffer'; + * const { randomFillSync } = await import('node:crypto'); + * + * const a = new Uint32Array(10); + * console.log(Buffer.from(randomFillSync(a).buffer, + * a.byteOffset, a.byteLength).toString('hex')); + * + * const b = new DataView(new ArrayBuffer(10)); + * console.log(Buffer.from(randomFillSync(b).buffer, + * b.byteOffset, b.byteLength).toString('hex')); + * + * const c = new ArrayBuffer(10); + * console.log(Buffer.from(randomFillSync(c)).toString('hex')); + * ``` + * @since v7.10.0, v6.13.0 + * @param buffer Must be supplied. The size of the provided `buffer` must not be larger than `2**31 - 1`. + * @param [offset=0] + * @param [size=buffer.length - offset] + * @return The object passed as `buffer` argument. + */ + function randomFillSync(buffer: T, offset?: number, size?: number): T; + /** + * This function is similar to {@link randomBytes} but requires the first + * argument to be a `Buffer` that will be filled. It also + * requires that a callback is passed in. + * + * If the `callback` function is not provided, an error will be thrown. + * + * ```js + * import { Buffer } from 'node:buffer'; + * const { randomFill } = await import('node:crypto'); + * + * const buf = Buffer.alloc(10); + * randomFill(buf, (err, buf) => { + * if (err) throw err; + * console.log(buf.toString('hex')); + * }); + * + * randomFill(buf, 5, (err, buf) => { + * if (err) throw err; + * console.log(buf.toString('hex')); + * }); + * + * // The above is equivalent to the following: + * randomFill(buf, 5, 5, (err, buf) => { + * if (err) throw err; + * console.log(buf.toString('hex')); + * }); + * ``` + * + * Any `ArrayBuffer`, `TypedArray`, or `DataView` instance may be passed as`buffer`. + * + * While this includes instances of `Float32Array` and `Float64Array`, this + * function should not be used to generate random floating-point numbers. The + * result may contain `+Infinity`, `-Infinity`, and `NaN`, and even if the array + * contains finite numbers only, they are not drawn from a uniform random + * distribution and have no meaningful lower or upper bounds. + * + * ```js + * import { Buffer } from 'node:buffer'; + * const { randomFill } = await import('node:crypto'); + * + * const a = new Uint32Array(10); + * randomFill(a, (err, buf) => { + * if (err) throw err; + * console.log(Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength) + * .toString('hex')); + * }); + * + * const b = new DataView(new ArrayBuffer(10)); + * randomFill(b, (err, buf) => { + * if (err) throw err; + * console.log(Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength) + * .toString('hex')); + * }); + * + * const c = new ArrayBuffer(10); + * randomFill(c, (err, buf) => { + * if (err) throw err; + * console.log(Buffer.from(buf).toString('hex')); + * }); + * ``` + * + * This API uses libuv's threadpool, which can have surprising and + * negative performance implications for some applications; see the `UV_THREADPOOL_SIZE` documentation for more information. + * + * The asynchronous version of `crypto.randomFill()` is carried out in a single + * threadpool request. To minimize threadpool task length variation, partition + * large `randomFill` requests when doing so as part of fulfilling a client + * request. + * @since v7.10.0, v6.13.0 + * @param buffer Must be supplied. The size of the provided `buffer` must not be larger than `2**31 - 1`. + * @param [offset=0] + * @param [size=buffer.length - offset] + * @param callback `function(err, buf) {}`. + */ + function randomFill(buffer: T, callback: (err: Error | null, buf: T) => void): void; + function randomFill(buffer: T, offset: number, callback: (err: Error | null, buf: T) => void): void; + function randomFill(buffer: T, offset: number, size: number, callback: (err: Error | null, buf: T) => void): void; + interface ScryptOptions { + cost?: number | undefined; + blockSize?: number | undefined; + parallelization?: number | undefined; + N?: number | undefined; + r?: number | undefined; + p?: number | undefined; + maxmem?: number | undefined; + } + /** + * Provides an asynchronous [scrypt](https://en.wikipedia.org/wiki/Scrypt) implementation. Scrypt is a password-based + * key derivation function that is designed to be expensive computationally and + * memory-wise in order to make brute-force attacks unrewarding. + * + * The `salt` should be as unique as possible. It is recommended that a salt is + * random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details. + * + * When passing strings for `password` or `salt`, please consider `caveats when using strings as inputs to cryptographic APIs`. + * + * The `callback` function is called with two arguments: `err` and `derivedKey`.`err` is an exception object when key derivation fails, otherwise `err` is`null`. `derivedKey` is passed to the + * callback as a `Buffer`. + * + * An exception is thrown when any of the input arguments specify invalid values + * or types. + * + * ```js + * const { + * scrypt, + * } = await import('node:crypto'); + * + * // Using the factory defaults. + * scrypt('password', 'salt', 64, (err, derivedKey) => { + * if (err) throw err; + * console.log(derivedKey.toString('hex')); // '3745e48...08d59ae' + * }); + * // Using a custom N parameter. Must be a power of two. + * scrypt('password', 'salt', 64, { N: 1024 }, (err, derivedKey) => { + * if (err) throw err; + * console.log(derivedKey.toString('hex')); // '3745e48...aa39b34' + * }); + * ``` + * @since v10.5.0 + */ + function scrypt(password: BinaryLike, salt: BinaryLike, keylen: number, callback: (err: Error | null, derivedKey: Buffer) => void): void; + function scrypt(password: BinaryLike, salt: BinaryLike, keylen: number, options: ScryptOptions, callback: (err: Error | null, derivedKey: Buffer) => void): void; + /** + * Provides a synchronous [scrypt](https://en.wikipedia.org/wiki/Scrypt) implementation. Scrypt is a password-based + * key derivation function that is designed to be expensive computationally and + * memory-wise in order to make brute-force attacks unrewarding. + * + * The `salt` should be as unique as possible. It is recommended that a salt is + * random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details. + * + * When passing strings for `password` or `salt`, please consider `caveats when using strings as inputs to cryptographic APIs`. + * + * An exception is thrown when key derivation fails, otherwise the derived key is + * returned as a `Buffer`. + * + * An exception is thrown when any of the input arguments specify invalid values + * or types. + * + * ```js + * const { + * scryptSync, + * } = await import('node:crypto'); + * // Using the factory defaults. + * + * const key1 = scryptSync('password', 'salt', 64); + * console.log(key1.toString('hex')); // '3745e48...08d59ae' + * // Using a custom N parameter. Must be a power of two. + * const key2 = scryptSync('password', 'salt', 64, { N: 1024 }); + * console.log(key2.toString('hex')); // '3745e48...aa39b34' + * ``` + * @since v10.5.0 + */ + function scryptSync(password: BinaryLike, salt: BinaryLike, keylen: number, options?: ScryptOptions): Buffer; + interface RsaPublicKey { + key: KeyLike; + padding?: number | undefined; + } + interface RsaPrivateKey { + key: KeyLike; + passphrase?: string | undefined; + /** + * @default 'sha1' + */ + oaepHash?: string | undefined; + oaepLabel?: NodeJS.TypedArray | undefined; + padding?: number | undefined; + } + /** + * Encrypts the content of `buffer` with `key` and returns a new `Buffer` with encrypted content. The returned data can be decrypted using + * the corresponding private key, for example using {@link privateDecrypt}. + * + * If `key` is not a `KeyObject`, this function behaves as if`key` had been passed to {@link createPublicKey}. If it is an + * object, the `padding` property can be passed. Otherwise, this function uses`RSA_PKCS1_OAEP_PADDING`. + * + * Because RSA public keys can be derived from private keys, a private key may + * be passed instead of a public key. + * @since v0.11.14 + */ + function publicEncrypt(key: RsaPublicKey | RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer; + /** + * Decrypts `buffer` with `key`.`buffer` was previously encrypted using + * the corresponding private key, for example using {@link privateEncrypt}. + * + * If `key` is not a `KeyObject`, this function behaves as if`key` had been passed to {@link createPublicKey}. If it is an + * object, the `padding` property can be passed. Otherwise, this function uses`RSA_PKCS1_PADDING`. + * + * Because RSA public keys can be derived from private keys, a private key may + * be passed instead of a public key. + * @since v1.1.0 + */ + function publicDecrypt(key: RsaPublicKey | RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer; + /** + * Decrypts `buffer` with `privateKey`. `buffer` was previously encrypted using + * the corresponding public key, for example using {@link publicEncrypt}. + * + * If `privateKey` is not a `KeyObject`, this function behaves as if`privateKey` had been passed to {@link createPrivateKey}. If it is an + * object, the `padding` property can be passed. Otherwise, this function uses`RSA_PKCS1_OAEP_PADDING`. + * @since v0.11.14 + */ + function privateDecrypt(privateKey: RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer; + /** + * Encrypts `buffer` with `privateKey`. The returned data can be decrypted using + * the corresponding public key, for example using {@link publicDecrypt}. + * + * If `privateKey` is not a `KeyObject`, this function behaves as if`privateKey` had been passed to {@link createPrivateKey}. If it is an + * object, the `padding` property can be passed. Otherwise, this function uses`RSA_PKCS1_PADDING`. + * @since v1.1.0 + */ + function privateEncrypt(privateKey: RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer; + /** + * ```js + * const { + * getCiphers, + * } = await import('node:crypto'); + * + * console.log(getCiphers()); // ['aes-128-cbc', 'aes-128-ccm', ...] + * ``` + * @since v0.9.3 + * @return An array with the names of the supported cipher algorithms. + */ + function getCiphers(): string[]; + /** + * ```js + * const { + * getCurves, + * } = await import('node:crypto'); + * + * console.log(getCurves()); // ['Oakley-EC2N-3', 'Oakley-EC2N-4', ...] + * ``` + * @since v2.3.0 + * @return An array with the names of the supported elliptic curves. + */ + function getCurves(): string[]; + /** + * @since v10.0.0 + * @return `1` if and only if a FIPS compliant crypto provider is currently in use, `0` otherwise. A future semver-major release may change the return type of this API to a {boolean}. + */ + function getFips(): 1 | 0; + /** + * Enables the FIPS compliant crypto provider in a FIPS-enabled Node.js build. + * Throws an error if FIPS mode is not available. + * @since v10.0.0 + * @param bool `true` to enable FIPS mode. + */ + function setFips(bool: boolean): void; + /** + * ```js + * const { + * getHashes, + * } = await import('node:crypto'); + * + * console.log(getHashes()); // ['DSA', 'DSA-SHA', 'DSA-SHA1', ...] + * ``` + * @since v0.9.3 + * @return An array of the names of the supported hash algorithms, such as `'RSA-SHA256'`. Hash algorithms are also called "digest" algorithms. + */ + function getHashes(): string[]; + /** + * The `ECDH` class is a utility for creating Elliptic Curve Diffie-Hellman (ECDH) + * key exchanges. + * + * Instances of the `ECDH` class can be created using the {@link createECDH} function. + * + * ```js + * import assert from 'node:assert'; + * + * const { + * createECDH, + * } = await import('node:crypto'); + * + * // Generate Alice's keys... + * const alice = createECDH('secp521r1'); + * const aliceKey = alice.generateKeys(); + * + * // Generate Bob's keys... + * const bob = createECDH('secp521r1'); + * const bobKey = bob.generateKeys(); + * + * // Exchange and generate the secret... + * const aliceSecret = alice.computeSecret(bobKey); + * const bobSecret = bob.computeSecret(aliceKey); + * + * assert.strictEqual(aliceSecret.toString('hex'), bobSecret.toString('hex')); + * // OK + * ``` + * @since v0.11.14 + */ + class ECDH { + private constructor(); + /** + * Converts the EC Diffie-Hellman public key specified by `key` and `curve` to the + * format specified by `format`. The `format` argument specifies point encoding + * and can be `'compressed'`, `'uncompressed'` or `'hybrid'`. The supplied key is + * interpreted using the specified `inputEncoding`, and the returned key is encoded + * using the specified `outputEncoding`. + * + * Use {@link getCurves} to obtain a list of available curve names. + * On recent OpenSSL releases, `openssl ecparam -list_curves` will also display + * the name and description of each available elliptic curve. + * + * If `format` is not specified the point will be returned in `'uncompressed'`format. + * + * If the `inputEncoding` is not provided, `key` is expected to be a `Buffer`,`TypedArray`, or `DataView`. + * + * Example (uncompressing a key): + * + * ```js + * const { + * createECDH, + * ECDH, + * } = await import('node:crypto'); + * + * const ecdh = createECDH('secp256k1'); + * ecdh.generateKeys(); + * + * const compressedKey = ecdh.getPublicKey('hex', 'compressed'); + * + * const uncompressedKey = ECDH.convertKey(compressedKey, + * 'secp256k1', + * 'hex', + * 'hex', + * 'uncompressed'); + * + * // The converted key and the uncompressed public key should be the same + * console.log(uncompressedKey === ecdh.getPublicKey('hex')); + * ``` + * @since v10.0.0 + * @param inputEncoding The `encoding` of the `key` string. + * @param outputEncoding The `encoding` of the return value. + * @param [format='uncompressed'] + */ + static convertKey( + key: BinaryLike, + curve: string, + inputEncoding?: BinaryToTextEncoding, + outputEncoding?: 'latin1' | 'hex' | 'base64' | 'base64url', + format?: 'uncompressed' | 'compressed' | 'hybrid' + ): Buffer | string; + /** + * Generates private and public EC Diffie-Hellman key values, and returns + * the public key in the specified `format` and `encoding`. This key should be + * transferred to the other party. + * + * The `format` argument specifies point encoding and can be `'compressed'` or`'uncompressed'`. If `format` is not specified, the point will be returned in`'uncompressed'` format. + * + * If `encoding` is provided a string is returned; otherwise a `Buffer` is returned. + * @since v0.11.14 + * @param encoding The `encoding` of the return value. + * @param [format='uncompressed'] + */ + generateKeys(): Buffer; + generateKeys(encoding: BinaryToTextEncoding, format?: ECDHKeyFormat): string; + /** + * Computes the shared secret using `otherPublicKey` as the other + * party's public key and returns the computed shared secret. The supplied + * key is interpreted using specified `inputEncoding`, and the returned secret + * is encoded using the specified `outputEncoding`. + * If the `inputEncoding` is not + * provided, `otherPublicKey` is expected to be a `Buffer`, `TypedArray`, or`DataView`. + * + * If `outputEncoding` is given a string will be returned; otherwise a `Buffer` is returned. + * + * `ecdh.computeSecret` will throw an`ERR_CRYPTO_ECDH_INVALID_PUBLIC_KEY` error when `otherPublicKey`lies outside of the elliptic curve. Since `otherPublicKey` is + * usually supplied from a remote user over an insecure network, + * be sure to handle this exception accordingly. + * @since v0.11.14 + * @param inputEncoding The `encoding` of the `otherPublicKey` string. + * @param outputEncoding The `encoding` of the return value. + */ + computeSecret(otherPublicKey: NodeJS.ArrayBufferView): Buffer; + computeSecret(otherPublicKey: string, inputEncoding: BinaryToTextEncoding): Buffer; + computeSecret(otherPublicKey: NodeJS.ArrayBufferView, outputEncoding: BinaryToTextEncoding): string; + computeSecret(otherPublicKey: string, inputEncoding: BinaryToTextEncoding, outputEncoding: BinaryToTextEncoding): string; + /** + * If `encoding` is specified, a string is returned; otherwise a `Buffer` is + * returned. + * @since v0.11.14 + * @param encoding The `encoding` of the return value. + * @return The EC Diffie-Hellman in the specified `encoding`. + */ + getPrivateKey(): Buffer; + getPrivateKey(encoding: BinaryToTextEncoding): string; + /** + * The `format` argument specifies point encoding and can be `'compressed'` or`'uncompressed'`. If `format` is not specified the point will be returned in`'uncompressed'` format. + * + * If `encoding` is specified, a string is returned; otherwise a `Buffer` is + * returned. + * @since v0.11.14 + * @param encoding The `encoding` of the return value. + * @param [format='uncompressed'] + * @return The EC Diffie-Hellman public key in the specified `encoding` and `format`. + */ + getPublicKey(encoding?: null, format?: ECDHKeyFormat): Buffer; + getPublicKey(encoding: BinaryToTextEncoding, format?: ECDHKeyFormat): string; + /** + * Sets the EC Diffie-Hellman private key. + * If `encoding` is provided, `privateKey` is expected + * to be a string; otherwise `privateKey` is expected to be a `Buffer`,`TypedArray`, or `DataView`. + * + * If `privateKey` is not valid for the curve specified when the `ECDH` object was + * created, an error is thrown. Upon setting the private key, the associated + * public point (key) is also generated and set in the `ECDH` object. + * @since v0.11.14 + * @param encoding The `encoding` of the `privateKey` string. + */ + setPrivateKey(privateKey: NodeJS.ArrayBufferView): void; + setPrivateKey(privateKey: string, encoding: BinaryToTextEncoding): void; + } + /** + * Creates an Elliptic Curve Diffie-Hellman (`ECDH`) key exchange object using a + * predefined curve specified by the `curveName` string. Use {@link getCurves} to obtain a list of available curve names. On recent + * OpenSSL releases, `openssl ecparam -list_curves` will also display the name + * and description of each available elliptic curve. + * @since v0.11.14 + */ + function createECDH(curveName: string): ECDH; + /** + * This function compares the underlying bytes that represent the given`ArrayBuffer`, `TypedArray`, or `DataView` instances using a constant-time + * algorithm. + * + * This function does not leak timing information that + * would allow an attacker to guess one of the values. This is suitable for + * comparing HMAC digests or secret values like authentication cookies or [capability urls](https://www.w3.org/TR/capability-urls/). + * + * `a` and `b` must both be `Buffer`s, `TypedArray`s, or `DataView`s, and they + * must have the same byte length. An error is thrown if `a` and `b` have + * different byte lengths. + * + * If at least one of `a` and `b` is a `TypedArray` with more than one byte per + * entry, such as `Uint16Array`, the result will be computed using the platform + * byte order. + * + * **When both of the inputs are `Float32Array`s or`Float64Array`s, this function might return unexpected results due to IEEE 754** + * **encoding of floating-point numbers. In particular, neither `x === y` nor`Object.is(x, y)` implies that the byte representations of two floating-point** + * **numbers `x` and `y` are equal.** + * + * Use of `crypto.timingSafeEqual` does not guarantee that the _surrounding_ code + * is timing-safe. Care should be taken to ensure that the surrounding code does + * not introduce timing vulnerabilities. + * @since v6.6.0 + */ + function timingSafeEqual(a: NodeJS.ArrayBufferView, b: NodeJS.ArrayBufferView): boolean; + type KeyType = 'rsa' | 'rsa-pss' | 'dsa' | 'ec' | 'ed25519' | 'ed448' | 'x25519' | 'x448'; + type KeyFormat = 'pem' | 'der' | 'jwk'; + interface BasePrivateKeyEncodingOptions { + format: T; + cipher?: string | undefined; + passphrase?: string | undefined; + } + interface KeyPairKeyObjectResult { + publicKey: KeyObject; + privateKey: KeyObject; + } + interface ED25519KeyPairKeyObjectOptions {} + interface ED448KeyPairKeyObjectOptions {} + interface X25519KeyPairKeyObjectOptions {} + interface X448KeyPairKeyObjectOptions {} + interface ECKeyPairKeyObjectOptions { + /** + * Name of the curve to use + */ + namedCurve: string; + } + interface RSAKeyPairKeyObjectOptions { + /** + * Key size in bits + */ + modulusLength: number; + /** + * Public exponent + * @default 0x10001 + */ + publicExponent?: number | undefined; + } + interface RSAPSSKeyPairKeyObjectOptions { + /** + * Key size in bits + */ + modulusLength: number; + /** + * Public exponent + * @default 0x10001 + */ + publicExponent?: number | undefined; + /** + * Name of the message digest + */ + hashAlgorithm?: string; + /** + * Name of the message digest used by MGF1 + */ + mgf1HashAlgorithm?: string; + /** + * Minimal salt length in bytes + */ + saltLength?: string; + } + interface DSAKeyPairKeyObjectOptions { + /** + * Key size in bits + */ + modulusLength: number; + /** + * Size of q in bits + */ + divisorLength: number; + } + interface RSAKeyPairOptions { + /** + * Key size in bits + */ + modulusLength: number; + /** + * Public exponent + * @default 0x10001 + */ + publicExponent?: number | undefined; + publicKeyEncoding: { + type: 'pkcs1' | 'spki'; + format: PubF; + }; + privateKeyEncoding: BasePrivateKeyEncodingOptions & { + type: 'pkcs1' | 'pkcs8'; + }; + } + interface RSAPSSKeyPairOptions { + /** + * Key size in bits + */ + modulusLength: number; + /** + * Public exponent + * @default 0x10001 + */ + publicExponent?: number | undefined; + /** + * Name of the message digest + */ + hashAlgorithm?: string; + /** + * Name of the message digest used by MGF1 + */ + mgf1HashAlgorithm?: string; + /** + * Minimal salt length in bytes + */ + saltLength?: string; + publicKeyEncoding: { + type: 'spki'; + format: PubF; + }; + privateKeyEncoding: BasePrivateKeyEncodingOptions & { + type: 'pkcs8'; + }; + } + interface DSAKeyPairOptions { + /** + * Key size in bits + */ + modulusLength: number; + /** + * Size of q in bits + */ + divisorLength: number; + publicKeyEncoding: { + type: 'spki'; + format: PubF; + }; + privateKeyEncoding: BasePrivateKeyEncodingOptions & { + type: 'pkcs8'; + }; + } + interface ECKeyPairOptions { + /** + * Name of the curve to use. + */ + namedCurve: string; + publicKeyEncoding: { + type: 'pkcs1' | 'spki'; + format: PubF; + }; + privateKeyEncoding: BasePrivateKeyEncodingOptions & { + type: 'sec1' | 'pkcs8'; + }; + } + interface ED25519KeyPairOptions { + publicKeyEncoding: { + type: 'spki'; + format: PubF; + }; + privateKeyEncoding: BasePrivateKeyEncodingOptions & { + type: 'pkcs8'; + }; + } + interface ED448KeyPairOptions { + publicKeyEncoding: { + type: 'spki'; + format: PubF; + }; + privateKeyEncoding: BasePrivateKeyEncodingOptions & { + type: 'pkcs8'; + }; + } + interface X25519KeyPairOptions { + publicKeyEncoding: { + type: 'spki'; + format: PubF; + }; + privateKeyEncoding: BasePrivateKeyEncodingOptions & { + type: 'pkcs8'; + }; + } + interface X448KeyPairOptions { + publicKeyEncoding: { + type: 'spki'; + format: PubF; + }; + privateKeyEncoding: BasePrivateKeyEncodingOptions & { + type: 'pkcs8'; + }; + } + interface KeyPairSyncResult { + publicKey: T1; + privateKey: T2; + } + /** + * Generates a new asymmetric key pair of the given `type`. RSA, RSA-PSS, DSA, EC, + * Ed25519, Ed448, X25519, X448, and DH are currently supported. + * + * If a `publicKeyEncoding` or `privateKeyEncoding` was specified, this function + * behaves as if `keyObject.export()` had been called on its result. Otherwise, + * the respective part of the key is returned as a `KeyObject`. + * + * When encoding public keys, it is recommended to use `'spki'`. When encoding + * private keys, it is recommended to use `'pkcs8'` with a strong passphrase, + * and to keep the passphrase confidential. + * + * ```js + * const { + * generateKeyPairSync, + * } = await import('node:crypto'); + * + * const { + * publicKey, + * privateKey, + * } = generateKeyPairSync('rsa', { + * modulusLength: 4096, + * publicKeyEncoding: { + * type: 'spki', + * format: 'pem', + * }, + * privateKeyEncoding: { + * type: 'pkcs8', + * format: 'pem', + * cipher: 'aes-256-cbc', + * passphrase: 'top secret', + * }, + * }); + * ``` + * + * The return value `{ publicKey, privateKey }` represents the generated key pair. + * When PEM encoding was selected, the respective key will be a string, otherwise + * it will be a buffer containing the data encoded as DER. + * @since v10.12.0 + * @param type Must be `'rsa'`, `'rsa-pss'`, `'dsa'`, `'ec'`, `'ed25519'`, `'ed448'`, `'x25519'`, `'x448'`, or `'dh'`. + */ + function generateKeyPairSync(type: 'rsa', options: RSAKeyPairOptions<'pem', 'pem'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'rsa', options: RSAKeyPairOptions<'pem', 'der'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'rsa', options: RSAKeyPairOptions<'der', 'pem'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'rsa', options: RSAKeyPairOptions<'der', 'der'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'rsa', options: RSAKeyPairKeyObjectOptions): KeyPairKeyObjectResult; + function generateKeyPairSync(type: 'rsa-pss', options: RSAPSSKeyPairOptions<'pem', 'pem'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'rsa-pss', options: RSAPSSKeyPairOptions<'pem', 'der'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'rsa-pss', options: RSAPSSKeyPairOptions<'der', 'pem'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'rsa-pss', options: RSAPSSKeyPairOptions<'der', 'der'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'rsa-pss', options: RSAPSSKeyPairKeyObjectOptions): KeyPairKeyObjectResult; + function generateKeyPairSync(type: 'dsa', options: DSAKeyPairOptions<'pem', 'pem'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'dsa', options: DSAKeyPairOptions<'pem', 'der'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'dsa', options: DSAKeyPairOptions<'der', 'pem'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'dsa', options: DSAKeyPairOptions<'der', 'der'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'dsa', options: DSAKeyPairKeyObjectOptions): KeyPairKeyObjectResult; + function generateKeyPairSync(type: 'ec', options: ECKeyPairOptions<'pem', 'pem'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'ec', options: ECKeyPairOptions<'pem', 'der'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'ec', options: ECKeyPairOptions<'der', 'pem'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'ec', options: ECKeyPairOptions<'der', 'der'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'ec', options: ECKeyPairKeyObjectOptions): KeyPairKeyObjectResult; + function generateKeyPairSync(type: 'ed25519', options: ED25519KeyPairOptions<'pem', 'pem'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'ed25519', options: ED25519KeyPairOptions<'pem', 'der'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'ed25519', options: ED25519KeyPairOptions<'der', 'pem'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'ed25519', options: ED25519KeyPairOptions<'der', 'der'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'ed25519', options?: ED25519KeyPairKeyObjectOptions): KeyPairKeyObjectResult; + function generateKeyPairSync(type: 'ed448', options: ED448KeyPairOptions<'pem', 'pem'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'ed448', options: ED448KeyPairOptions<'pem', 'der'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'ed448', options: ED448KeyPairOptions<'der', 'pem'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'ed448', options: ED448KeyPairOptions<'der', 'der'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'ed448', options?: ED448KeyPairKeyObjectOptions): KeyPairKeyObjectResult; + function generateKeyPairSync(type: 'x25519', options: X25519KeyPairOptions<'pem', 'pem'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'x25519', options: X25519KeyPairOptions<'pem', 'der'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'x25519', options: X25519KeyPairOptions<'der', 'pem'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'x25519', options: X25519KeyPairOptions<'der', 'der'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'x25519', options?: X25519KeyPairKeyObjectOptions): KeyPairKeyObjectResult; + function generateKeyPairSync(type: 'x448', options: X448KeyPairOptions<'pem', 'pem'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'x448', options: X448KeyPairOptions<'pem', 'der'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'x448', options: X448KeyPairOptions<'der', 'pem'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'x448', options: X448KeyPairOptions<'der', 'der'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'x448', options?: X448KeyPairKeyObjectOptions): KeyPairKeyObjectResult; + /** + * Generates a new asymmetric key pair of the given `type`. RSA, RSA-PSS, DSA, EC, + * Ed25519, Ed448, X25519, X448, and DH are currently supported. + * + * If a `publicKeyEncoding` or `privateKeyEncoding` was specified, this function + * behaves as if `keyObject.export()` had been called on its result. Otherwise, + * the respective part of the key is returned as a `KeyObject`. + * + * It is recommended to encode public keys as `'spki'` and private keys as`'pkcs8'` with encryption for long-term storage: + * + * ```js + * const { + * generateKeyPair, + * } = await import('node:crypto'); + * + * generateKeyPair('rsa', { + * modulusLength: 4096, + * publicKeyEncoding: { + * type: 'spki', + * format: 'pem', + * }, + * privateKeyEncoding: { + * type: 'pkcs8', + * format: 'pem', + * cipher: 'aes-256-cbc', + * passphrase: 'top secret', + * }, + * }, (err, publicKey, privateKey) => { + * // Handle errors and use the generated key pair. + * }); + * ``` + * + * On completion, `callback` will be called with `err` set to `undefined` and`publicKey` / `privateKey` representing the generated key pair. + * + * If this method is invoked as its `util.promisify()` ed version, it returns + * a `Promise` for an `Object` with `publicKey` and `privateKey` properties. + * @since v10.12.0 + * @param type Must be `'rsa'`, `'rsa-pss'`, `'dsa'`, `'ec'`, `'ed25519'`, `'ed448'`, `'x25519'`, `'x448'`, or `'dh'`. + */ + function generateKeyPair(type: 'rsa', options: RSAKeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void; + function generateKeyPair(type: 'rsa', options: RSAKeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void; + function generateKeyPair(type: 'rsa', options: RSAKeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void; + function generateKeyPair(type: 'rsa', options: RSAKeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void; + function generateKeyPair(type: 'rsa', options: RSAKeyPairKeyObjectOptions, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void; + function generateKeyPair(type: 'rsa-pss', options: RSAPSSKeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void; + function generateKeyPair(type: 'rsa-pss', options: RSAPSSKeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void; + function generateKeyPair(type: 'rsa-pss', options: RSAPSSKeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void; + function generateKeyPair(type: 'rsa-pss', options: RSAPSSKeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void; + function generateKeyPair(type: 'rsa-pss', options: RSAPSSKeyPairKeyObjectOptions, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void; + function generateKeyPair(type: 'dsa', options: DSAKeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void; + function generateKeyPair(type: 'dsa', options: DSAKeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void; + function generateKeyPair(type: 'dsa', options: DSAKeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void; + function generateKeyPair(type: 'dsa', options: DSAKeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void; + function generateKeyPair(type: 'dsa', options: DSAKeyPairKeyObjectOptions, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void; + function generateKeyPair(type: 'ec', options: ECKeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void; + function generateKeyPair(type: 'ec', options: ECKeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void; + function generateKeyPair(type: 'ec', options: ECKeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void; + function generateKeyPair(type: 'ec', options: ECKeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void; + function generateKeyPair(type: 'ec', options: ECKeyPairKeyObjectOptions, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void; + function generateKeyPair(type: 'ed25519', options: ED25519KeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void; + function generateKeyPair(type: 'ed25519', options: ED25519KeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void; + function generateKeyPair(type: 'ed25519', options: ED25519KeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void; + function generateKeyPair(type: 'ed25519', options: ED25519KeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void; + function generateKeyPair(type: 'ed25519', options: ED25519KeyPairKeyObjectOptions | undefined, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void; + function generateKeyPair(type: 'ed448', options: ED448KeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void; + function generateKeyPair(type: 'ed448', options: ED448KeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void; + function generateKeyPair(type: 'ed448', options: ED448KeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void; + function generateKeyPair(type: 'ed448', options: ED448KeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void; + function generateKeyPair(type: 'ed448', options: ED448KeyPairKeyObjectOptions | undefined, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void; + function generateKeyPair(type: 'x25519', options: X25519KeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void; + function generateKeyPair(type: 'x25519', options: X25519KeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void; + function generateKeyPair(type: 'x25519', options: X25519KeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void; + function generateKeyPair(type: 'x25519', options: X25519KeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void; + function generateKeyPair(type: 'x25519', options: X25519KeyPairKeyObjectOptions | undefined, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void; + function generateKeyPair(type: 'x448', options: X448KeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void; + function generateKeyPair(type: 'x448', options: X448KeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void; + function generateKeyPair(type: 'x448', options: X448KeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void; + function generateKeyPair(type: 'x448', options: X448KeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void; + function generateKeyPair(type: 'x448', options: X448KeyPairKeyObjectOptions | undefined, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void; + namespace generateKeyPair { + function __promisify__( + type: 'rsa', + options: RSAKeyPairOptions<'pem', 'pem'> + ): Promise<{ + publicKey: string; + privateKey: string; + }>; + function __promisify__( + type: 'rsa', + options: RSAKeyPairOptions<'pem', 'der'> + ): Promise<{ + publicKey: string; + privateKey: Buffer; + }>; + function __promisify__( + type: 'rsa', + options: RSAKeyPairOptions<'der', 'pem'> + ): Promise<{ + publicKey: Buffer; + privateKey: string; + }>; + function __promisify__( + type: 'rsa', + options: RSAKeyPairOptions<'der', 'der'> + ): Promise<{ + publicKey: Buffer; + privateKey: Buffer; + }>; + function __promisify__(type: 'rsa', options: RSAKeyPairKeyObjectOptions): Promise; + function __promisify__( + type: 'rsa-pss', + options: RSAPSSKeyPairOptions<'pem', 'pem'> + ): Promise<{ + publicKey: string; + privateKey: string; + }>; + function __promisify__( + type: 'rsa-pss', + options: RSAPSSKeyPairOptions<'pem', 'der'> + ): Promise<{ + publicKey: string; + privateKey: Buffer; + }>; + function __promisify__( + type: 'rsa-pss', + options: RSAPSSKeyPairOptions<'der', 'pem'> + ): Promise<{ + publicKey: Buffer; + privateKey: string; + }>; + function __promisify__( + type: 'rsa-pss', + options: RSAPSSKeyPairOptions<'der', 'der'> + ): Promise<{ + publicKey: Buffer; + privateKey: Buffer; + }>; + function __promisify__(type: 'rsa-pss', options: RSAPSSKeyPairKeyObjectOptions): Promise; + function __promisify__( + type: 'dsa', + options: DSAKeyPairOptions<'pem', 'pem'> + ): Promise<{ + publicKey: string; + privateKey: string; + }>; + function __promisify__( + type: 'dsa', + options: DSAKeyPairOptions<'pem', 'der'> + ): Promise<{ + publicKey: string; + privateKey: Buffer; + }>; + function __promisify__( + type: 'dsa', + options: DSAKeyPairOptions<'der', 'pem'> + ): Promise<{ + publicKey: Buffer; + privateKey: string; + }>; + function __promisify__( + type: 'dsa', + options: DSAKeyPairOptions<'der', 'der'> + ): Promise<{ + publicKey: Buffer; + privateKey: Buffer; + }>; + function __promisify__(type: 'dsa', options: DSAKeyPairKeyObjectOptions): Promise; + function __promisify__( + type: 'ec', + options: ECKeyPairOptions<'pem', 'pem'> + ): Promise<{ + publicKey: string; + privateKey: string; + }>; + function __promisify__( + type: 'ec', + options: ECKeyPairOptions<'pem', 'der'> + ): Promise<{ + publicKey: string; + privateKey: Buffer; + }>; + function __promisify__( + type: 'ec', + options: ECKeyPairOptions<'der', 'pem'> + ): Promise<{ + publicKey: Buffer; + privateKey: string; + }>; + function __promisify__( + type: 'ec', + options: ECKeyPairOptions<'der', 'der'> + ): Promise<{ + publicKey: Buffer; + privateKey: Buffer; + }>; + function __promisify__(type: 'ec', options: ECKeyPairKeyObjectOptions): Promise; + function __promisify__( + type: 'ed25519', + options: ED25519KeyPairOptions<'pem', 'pem'> + ): Promise<{ + publicKey: string; + privateKey: string; + }>; + function __promisify__( + type: 'ed25519', + options: ED25519KeyPairOptions<'pem', 'der'> + ): Promise<{ + publicKey: string; + privateKey: Buffer; + }>; + function __promisify__( + type: 'ed25519', + options: ED25519KeyPairOptions<'der', 'pem'> + ): Promise<{ + publicKey: Buffer; + privateKey: string; + }>; + function __promisify__( + type: 'ed25519', + options: ED25519KeyPairOptions<'der', 'der'> + ): Promise<{ + publicKey: Buffer; + privateKey: Buffer; + }>; + function __promisify__(type: 'ed25519', options?: ED25519KeyPairKeyObjectOptions): Promise; + function __promisify__( + type: 'ed448', + options: ED448KeyPairOptions<'pem', 'pem'> + ): Promise<{ + publicKey: string; + privateKey: string; + }>; + function __promisify__( + type: 'ed448', + options: ED448KeyPairOptions<'pem', 'der'> + ): Promise<{ + publicKey: string; + privateKey: Buffer; + }>; + function __promisify__( + type: 'ed448', + options: ED448KeyPairOptions<'der', 'pem'> + ): Promise<{ + publicKey: Buffer; + privateKey: string; + }>; + function __promisify__( + type: 'ed448', + options: ED448KeyPairOptions<'der', 'der'> + ): Promise<{ + publicKey: Buffer; + privateKey: Buffer; + }>; + function __promisify__(type: 'ed448', options?: ED448KeyPairKeyObjectOptions): Promise; + function __promisify__( + type: 'x25519', + options: X25519KeyPairOptions<'pem', 'pem'> + ): Promise<{ + publicKey: string; + privateKey: string; + }>; + function __promisify__( + type: 'x25519', + options: X25519KeyPairOptions<'pem', 'der'> + ): Promise<{ + publicKey: string; + privateKey: Buffer; + }>; + function __promisify__( + type: 'x25519', + options: X25519KeyPairOptions<'der', 'pem'> + ): Promise<{ + publicKey: Buffer; + privateKey: string; + }>; + function __promisify__( + type: 'x25519', + options: X25519KeyPairOptions<'der', 'der'> + ): Promise<{ + publicKey: Buffer; + privateKey: Buffer; + }>; + function __promisify__(type: 'x25519', options?: X25519KeyPairKeyObjectOptions): Promise; + function __promisify__( + type: 'x448', + options: X448KeyPairOptions<'pem', 'pem'> + ): Promise<{ + publicKey: string; + privateKey: string; + }>; + function __promisify__( + type: 'x448', + options: X448KeyPairOptions<'pem', 'der'> + ): Promise<{ + publicKey: string; + privateKey: Buffer; + }>; + function __promisify__( + type: 'x448', + options: X448KeyPairOptions<'der', 'pem'> + ): Promise<{ + publicKey: Buffer; + privateKey: string; + }>; + function __promisify__( + type: 'x448', + options: X448KeyPairOptions<'der', 'der'> + ): Promise<{ + publicKey: Buffer; + privateKey: Buffer; + }>; + function __promisify__(type: 'x448', options?: X448KeyPairKeyObjectOptions): Promise; + } + /** + * Calculates and returns the signature for `data` using the given private key and + * algorithm. If `algorithm` is `null` or `undefined`, then the algorithm is + * dependent upon the key type (especially Ed25519 and Ed448). + * + * If `key` is not a `KeyObject`, this function behaves as if `key` had been + * passed to {@link createPrivateKey}. If it is an object, the following + * additional properties can be passed: + * + * If the `callback` function is provided this function uses libuv's threadpool. + * @since v12.0.0 + */ + function sign(algorithm: string | null | undefined, data: NodeJS.ArrayBufferView, key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput): Buffer; + function sign( + algorithm: string | null | undefined, + data: NodeJS.ArrayBufferView, + key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput, + callback: (error: Error | null, data: Buffer) => void + ): void; + /** + * Verifies the given signature for `data` using the given key and algorithm. If`algorithm` is `null` or `undefined`, then the algorithm is dependent upon the + * key type (especially Ed25519 and Ed448). + * + * If `key` is not a `KeyObject`, this function behaves as if `key` had been + * passed to {@link createPublicKey}. If it is an object, the following + * additional properties can be passed: + * + * The `signature` argument is the previously calculated signature for the `data`. + * + * Because public keys can be derived from private keys, a private key or a public + * key may be passed for `key`. + * + * If the `callback` function is provided this function uses libuv's threadpool. + * @since v12.0.0 + */ + function verify( + algorithm: string | null | undefined, + data: NodeJS.ArrayBufferView, + key: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput | VerifyJsonWebKeyInput, + signature: NodeJS.ArrayBufferView + ): boolean; + function verify( + algorithm: string | null | undefined, + data: NodeJS.ArrayBufferView, + key: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput | VerifyJsonWebKeyInput, + signature: NodeJS.ArrayBufferView, + callback: (error: Error | null, result: boolean) => void + ): void; + /** + * Computes the Diffie-Hellman secret based on a `privateKey` and a `publicKey`. + * Both keys must have the same `asymmetricKeyType`, which must be one of `'dh'`(for Diffie-Hellman), `'ec'` (for ECDH), `'x448'`, or `'x25519'` (for ECDH-ES). + * @since v13.9.0, v12.17.0 + */ + function diffieHellman(options: { privateKey: KeyObject; publicKey: KeyObject }): Buffer; + type CipherMode = 'cbc' | 'ccm' | 'cfb' | 'ctr' | 'ecb' | 'gcm' | 'ocb' | 'ofb' | 'stream' | 'wrap' | 'xts'; + interface CipherInfoOptions { + /** + * A test key length. + */ + keyLength?: number | undefined; + /** + * A test IV length. + */ + ivLength?: number | undefined; + } + interface CipherInfo { + /** + * The name of the cipher. + */ + name: string; + /** + * The nid of the cipher. + */ + nid: number; + /** + * The block size of the cipher in bytes. + * This property is omitted when mode is 'stream'. + */ + blockSize?: number | undefined; + /** + * The expected or default initialization vector length in bytes. + * This property is omitted if the cipher does not use an initialization vector. + */ + ivLength?: number | undefined; + /** + * The expected or default key length in bytes. + */ + keyLength: number; + /** + * The cipher mode. + */ + mode: CipherMode; + } + /** + * Returns information about a given cipher. + * + * Some ciphers accept variable length keys and initialization vectors. By default, + * the `crypto.getCipherInfo()` method will return the default values for these + * ciphers. To test if a given key length or iv length is acceptable for given + * cipher, use the `keyLength` and `ivLength` options. If the given values are + * unacceptable, `undefined` will be returned. + * @since v15.0.0 + * @param nameOrNid The name or nid of the cipher to query. + */ + function getCipherInfo(nameOrNid: string | number, options?: CipherInfoOptions): CipherInfo | undefined; + /** + * HKDF is a simple key derivation function defined in RFC 5869\. The given `ikm`,`salt` and `info` are used with the `digest` to derive a key of `keylen` bytes. + * + * The supplied `callback` function is called with two arguments: `err` and`derivedKey`. If an errors occurs while deriving the key, `err` will be set; + * otherwise `err` will be `null`. The successfully generated `derivedKey` will + * be passed to the callback as an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer). An error will be thrown if any + * of the input arguments specify invalid values or types. + * + * ```js + * import { Buffer } from 'node:buffer'; + * const { + * hkdf, + * } = await import('node:crypto'); + * + * hkdf('sha512', 'key', 'salt', 'info', 64, (err, derivedKey) => { + * if (err) throw err; + * console.log(Buffer.from(derivedKey).toString('hex')); // '24156e2...5391653' + * }); + * ``` + * @since v15.0.0 + * @param digest The digest algorithm to use. + * @param ikm The input keying material. Must be provided but can be zero-length. + * @param salt The salt value. Must be provided but can be zero-length. + * @param info Additional info value. Must be provided but can be zero-length, and cannot be more than 1024 bytes. + * @param keylen The length of the key to generate. Must be greater than 0. The maximum allowable value is `255` times the number of bytes produced by the selected digest function (e.g. `sha512` + * generates 64-byte hashes, making the maximum HKDF output 16320 bytes). + */ + function hkdf(digest: string, irm: BinaryLike | KeyObject, salt: BinaryLike, info: BinaryLike, keylen: number, callback: (err: Error | null, derivedKey: ArrayBuffer) => void): void; + /** + * Provides a synchronous HKDF key derivation function as defined in RFC 5869\. The + * given `ikm`, `salt` and `info` are used with the `digest` to derive a key of`keylen` bytes. + * + * The successfully generated `derivedKey` will be returned as an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer). + * + * An error will be thrown if any of the input arguments specify invalid values or + * types, or if the derived key cannot be generated. + * + * ```js + * import { Buffer } from 'node:buffer'; + * const { + * hkdfSync, + * } = await import('node:crypto'); + * + * const derivedKey = hkdfSync('sha512', 'key', 'salt', 'info', 64); + * console.log(Buffer.from(derivedKey).toString('hex')); // '24156e2...5391653' + * ``` + * @since v15.0.0 + * @param digest The digest algorithm to use. + * @param ikm The input keying material. Must be provided but can be zero-length. + * @param salt The salt value. Must be provided but can be zero-length. + * @param info Additional info value. Must be provided but can be zero-length, and cannot be more than 1024 bytes. + * @param keylen The length of the key to generate. Must be greater than 0. The maximum allowable value is `255` times the number of bytes produced by the selected digest function (e.g. `sha512` + * generates 64-byte hashes, making the maximum HKDF output 16320 bytes). + */ + function hkdfSync(digest: string, ikm: BinaryLike | KeyObject, salt: BinaryLike, info: BinaryLike, keylen: number): ArrayBuffer; + interface SecureHeapUsage { + /** + * The total allocated secure heap size as specified using the `--secure-heap=n` command-line flag. + */ + total: number; + /** + * The minimum allocation from the secure heap as specified using the `--secure-heap-min` command-line flag. + */ + min: number; + /** + * The total number of bytes currently allocated from the secure heap. + */ + used: number; + /** + * The calculated ratio of `used` to `total` allocated bytes. + */ + utilization: number; + } + /** + * @since v15.6.0 + */ + function secureHeapUsed(): SecureHeapUsage; + interface RandomUUIDOptions { + /** + * By default, to improve performance, + * Node.js will pre-emptively generate and persistently cache enough + * random data to generate up to 128 random UUIDs. To generate a UUID + * without using the cache, set `disableEntropyCache` to `true`. + * + * @default `false` + */ + disableEntropyCache?: boolean | undefined; + } + type UUID = `${string}-${string}-${string}-${string}-${string}`; + /** + * Generates a random [RFC 4122](https://www.rfc-editor.org/rfc/rfc4122.txt) version 4 UUID. The UUID is generated using a + * cryptographic pseudorandom number generator. + * @since v15.6.0, v14.17.0 + */ + function randomUUID(options?: RandomUUIDOptions): UUID; + interface X509CheckOptions { + /** + * @default 'always' + */ + subject?: 'always' | 'default' | 'never'; + /** + * @default true + */ + wildcards?: boolean; + /** + * @default true + */ + partialWildcards?: boolean; + /** + * @default false + */ + multiLabelWildcards?: boolean; + /** + * @default false + */ + singleLabelSubdomains?: boolean; + } + /** + * Encapsulates an X509 certificate and provides read-only access to + * its information. + * + * ```js + * const { X509Certificate } = await import('node:crypto'); + * + * const x509 = new X509Certificate('{... pem encoded cert ...}'); + * + * console.log(x509.subject); + * ``` + * @since v15.6.0 + */ + class X509Certificate { + /** + * Will be \`true\` if this is a Certificate Authority (CA) certificate. + * @since v15.6.0 + */ + readonly ca: boolean; + /** + * The SHA-1 fingerprint of this certificate. + * + * Because SHA-1 is cryptographically broken and because the security of SHA-1 is + * significantly worse than that of algorithms that are commonly used to sign + * certificates, consider using `x509.fingerprint256` instead. + * @since v15.6.0 + */ + readonly fingerprint: string; + /** + * The SHA-256 fingerprint of this certificate. + * @since v15.6.0 + */ + readonly fingerprint256: string; + /** + * The SHA-512 fingerprint of this certificate. + * + * Because computing the SHA-256 fingerprint is usually faster and because it is + * only half the size of the SHA-512 fingerprint, `x509.fingerprint256` may be + * a better choice. While SHA-512 presumably provides a higher level of security in + * general, the security of SHA-256 matches that of most algorithms that are + * commonly used to sign certificates. + * @since v17.2.0, v16.14.0 + */ + readonly fingerprint512: string; + /** + * The complete subject of this certificate. + * @since v15.6.0 + */ + readonly subject: string; + /** + * The subject alternative name specified for this certificate. + * + * This is a comma-separated list of subject alternative names. Each entry begins + * with a string identifying the kind of the subject alternative name followed by + * a colon and the value associated with the entry. + * + * Earlier versions of Node.js incorrectly assumed that it is safe to split this + * property at the two-character sequence `', '` (see [CVE-2021-44532](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-44532)). However, + * both malicious and legitimate certificates can contain subject alternative names + * that include this sequence when represented as a string. + * + * After the prefix denoting the type of the entry, the remainder of each entry + * might be enclosed in quotes to indicate that the value is a JSON string literal. + * For backward compatibility, Node.js only uses JSON string literals within this + * property when necessary to avoid ambiguity. Third-party code should be prepared + * to handle both possible entry formats. + * @since v15.6.0 + */ + readonly subjectAltName: string | undefined; + /** + * A textual representation of the certificate's authority information access + * extension. + * + * This is a line feed separated list of access descriptions. Each line begins with + * the access method and the kind of the access location, followed by a colon and + * the value associated with the access location. + * + * After the prefix denoting the access method and the kind of the access location, + * the remainder of each line might be enclosed in quotes to indicate that the + * value is a JSON string literal. For backward compatibility, Node.js only uses + * JSON string literals within this property when necessary to avoid ambiguity. + * Third-party code should be prepared to handle both possible entry formats. + * @since v15.6.0 + */ + readonly infoAccess: string | undefined; + /** + * An array detailing the key usages for this certificate. + * @since v15.6.0 + */ + readonly keyUsage: string[]; + /** + * The issuer identification included in this certificate. + * @since v15.6.0 + */ + readonly issuer: string; + /** + * The issuer certificate or `undefined` if the issuer certificate is not + * available. + * @since v15.9.0 + */ + readonly issuerCertificate?: X509Certificate | undefined; + /** + * The public key `KeyObject` for this certificate. + * @since v15.6.0 + */ + readonly publicKey: KeyObject; + /** + * A `Buffer` containing the DER encoding of this certificate. + * @since v15.6.0 + */ + readonly raw: Buffer; + /** + * The serial number of this certificate. + * + * Serial numbers are assigned by certificate authorities and do not uniquely + * identify certificates. Consider using `x509.fingerprint256` as a unique + * identifier instead. + * @since v15.6.0 + */ + readonly serialNumber: string; + /** + * The date/time from which this certificate is considered valid. + * @since v15.6.0 + */ + readonly validFrom: string; + /** + * The date/time until which this certificate is considered valid. + * @since v15.6.0 + */ + readonly validTo: string; + constructor(buffer: BinaryLike); + /** + * Checks whether the certificate matches the given email address. + * + * If the `'subject'` option is undefined or set to `'default'`, the certificate + * subject is only considered if the subject alternative name extension either does + * not exist or does not contain any email addresses. + * + * If the `'subject'` option is set to `'always'` and if the subject alternative + * name extension either does not exist or does not contain a matching email + * address, the certificate subject is considered. + * + * If the `'subject'` option is set to `'never'`, the certificate subject is never + * considered, even if the certificate contains no subject alternative names. + * @since v15.6.0 + * @return Returns `email` if the certificate matches, `undefined` if it does not. + */ + checkEmail(email: string, options?: Pick): string | undefined; + /** + * Checks whether the certificate matches the given host name. + * + * If the certificate matches the given host name, the matching subject name is + * returned. The returned name might be an exact match (e.g., `foo.example.com`) + * or it might contain wildcards (e.g., `*.example.com`). Because host name + * comparisons are case-insensitive, the returned subject name might also differ + * from the given `name` in capitalization. + * + * If the `'subject'` option is undefined or set to `'default'`, the certificate + * subject is only considered if the subject alternative name extension either does + * not exist or does not contain any DNS names. This behavior is consistent with [RFC 2818](https://www.rfc-editor.org/rfc/rfc2818.txt) ("HTTP Over TLS"). + * + * If the `'subject'` option is set to `'always'` and if the subject alternative + * name extension either does not exist or does not contain a matching DNS name, + * the certificate subject is considered. + * + * If the `'subject'` option is set to `'never'`, the certificate subject is never + * considered, even if the certificate contains no subject alternative names. + * @since v15.6.0 + * @return Returns a subject name that matches `name`, or `undefined` if no subject name matches `name`. + */ + checkHost(name: string, options?: X509CheckOptions): string | undefined; + /** + * Checks whether the certificate matches the given IP address (IPv4 or IPv6). + * + * Only [RFC 5280](https://www.rfc-editor.org/rfc/rfc5280.txt) `iPAddress` subject alternative names are considered, and they + * must match the given `ip` address exactly. Other subject alternative names as + * well as the subject field of the certificate are ignored. + * @since v15.6.0 + * @return Returns `ip` if the certificate matches, `undefined` if it does not. + */ + checkIP(ip: string): string | undefined; + /** + * Checks whether this certificate was issued by the given `otherCert`. + * @since v15.6.0 + */ + checkIssued(otherCert: X509Certificate): boolean; + /** + * Checks whether the public key for this certificate is consistent with + * the given private key. + * @since v15.6.0 + * @param privateKey A private key. + */ + checkPrivateKey(privateKey: KeyObject): boolean; + /** + * There is no standard JSON encoding for X509 certificates. The`toJSON()` method returns a string containing the PEM encoded + * certificate. + * @since v15.6.0 + */ + toJSON(): string; + /** + * Returns information about this certificate using the legacy `certificate object` encoding. + * @since v15.6.0 + */ + toLegacyObject(): PeerCertificate; + /** + * Returns the PEM-encoded certificate. + * @since v15.6.0 + */ + toString(): string; + /** + * Verifies that this certificate was signed by the given public key. + * Does not perform any other validation checks on the certificate. + * @since v15.6.0 + * @param publicKey A public key. + */ + verify(publicKey: KeyObject): boolean; + } + type LargeNumberLike = NodeJS.ArrayBufferView | SharedArrayBuffer | ArrayBuffer | bigint; + interface GeneratePrimeOptions { + add?: LargeNumberLike | undefined; + rem?: LargeNumberLike | undefined; + /** + * @default false + */ + safe?: boolean | undefined; + bigint?: boolean | undefined; + } + interface GeneratePrimeOptionsBigInt extends GeneratePrimeOptions { + bigint: true; + } + interface GeneratePrimeOptionsArrayBuffer extends GeneratePrimeOptions { + bigint?: false | undefined; + } + /** + * Generates a pseudorandom prime of `size` bits. + * + * If `options.safe` is `true`, the prime will be a safe prime -- that is,`(prime - 1) / 2` will also be a prime. + * + * The `options.add` and `options.rem` parameters can be used to enforce additional + * requirements, e.g., for Diffie-Hellman: + * + * * If `options.add` and `options.rem` are both set, the prime will satisfy the + * condition that `prime % add = rem`. + * * If only `options.add` is set and `options.safe` is not `true`, the prime will + * satisfy the condition that `prime % add = 1`. + * * If only `options.add` is set and `options.safe` is set to `true`, the prime + * will instead satisfy the condition that `prime % add = 3`. This is necessary + * because `prime % add = 1` for `options.add > 2` would contradict the condition + * enforced by `options.safe`. + * * `options.rem` is ignored if `options.add` is not given. + * + * Both `options.add` and `options.rem` must be encoded as big-endian sequences + * if given as an `ArrayBuffer`, `SharedArrayBuffer`, `TypedArray`, `Buffer`, or`DataView`. + * + * By default, the prime is encoded as a big-endian sequence of octets + * in an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer). If the `bigint` option is `true`, then a + * [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) is provided. + * @since v15.8.0 + * @param size The size (in bits) of the prime to generate. + */ + function generatePrime(size: number, callback: (err: Error | null, prime: ArrayBuffer) => void): void; + function generatePrime(size: number, options: GeneratePrimeOptionsBigInt, callback: (err: Error | null, prime: bigint) => void): void; + function generatePrime(size: number, options: GeneratePrimeOptionsArrayBuffer, callback: (err: Error | null, prime: ArrayBuffer) => void): void; + function generatePrime(size: number, options: GeneratePrimeOptions, callback: (err: Error | null, prime: ArrayBuffer | bigint) => void): void; + /** + * Generates a pseudorandom prime of `size` bits. + * + * If `options.safe` is `true`, the prime will be a safe prime -- that is,`(prime - 1) / 2` will also be a prime. + * + * The `options.add` and `options.rem` parameters can be used to enforce additional + * requirements, e.g., for Diffie-Hellman: + * + * * If `options.add` and `options.rem` are both set, the prime will satisfy the + * condition that `prime % add = rem`. + * * If only `options.add` is set and `options.safe` is not `true`, the prime will + * satisfy the condition that `prime % add = 1`. + * * If only `options.add` is set and `options.safe` is set to `true`, the prime + * will instead satisfy the condition that `prime % add = 3`. This is necessary + * because `prime % add = 1` for `options.add > 2` would contradict the condition + * enforced by `options.safe`. + * * `options.rem` is ignored if `options.add` is not given. + * + * Both `options.add` and `options.rem` must be encoded as big-endian sequences + * if given as an `ArrayBuffer`, `SharedArrayBuffer`, `TypedArray`, `Buffer`, or`DataView`. + * + * By default, the prime is encoded as a big-endian sequence of octets + * in an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer). If the `bigint` option is `true`, then a + * [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) is provided. + * @since v15.8.0 + * @param size The size (in bits) of the prime to generate. + */ + function generatePrimeSync(size: number): ArrayBuffer; + function generatePrimeSync(size: number, options: GeneratePrimeOptionsBigInt): bigint; + function generatePrimeSync(size: number, options: GeneratePrimeOptionsArrayBuffer): ArrayBuffer; + function generatePrimeSync(size: number, options: GeneratePrimeOptions): ArrayBuffer | bigint; + interface CheckPrimeOptions { + /** + * The number of Miller-Rabin probabilistic primality iterations to perform. + * When the value is 0 (zero), a number of checks is used that yields a false positive rate of at most `2**-64` for random input. + * Care must be used when selecting a number of checks. + * Refer to the OpenSSL documentation for the BN_is_prime_ex function nchecks options for more details. + * + * @default 0 + */ + checks?: number | undefined; + } + /** + * Checks the primality of the `candidate`. + * @since v15.8.0 + * @param candidate A possible prime encoded as a sequence of big endian octets of arbitrary length. + */ + function checkPrime(value: LargeNumberLike, callback: (err: Error | null, result: boolean) => void): void; + function checkPrime(value: LargeNumberLike, options: CheckPrimeOptions, callback: (err: Error | null, result: boolean) => void): void; + /** + * Checks the primality of the `candidate`. + * @since v15.8.0 + * @param candidate A possible prime encoded as a sequence of big endian octets of arbitrary length. + * @return `true` if the candidate is a prime with an error probability less than `0.25 ** options.checks`. + */ + function checkPrimeSync(candidate: LargeNumberLike, options?: CheckPrimeOptions): boolean; + /** + * Load and set the `engine` for some or all OpenSSL functions (selected by flags). + * + * `engine` could be either an id or a path to the engine's shared library. + * + * The optional `flags` argument uses `ENGINE_METHOD_ALL` by default. The `flags`is a bit field taking one of or a mix of the following flags (defined in`crypto.constants`): + * + * * `crypto.constants.ENGINE_METHOD_RSA` + * * `crypto.constants.ENGINE_METHOD_DSA` + * * `crypto.constants.ENGINE_METHOD_DH` + * * `crypto.constants.ENGINE_METHOD_RAND` + * * `crypto.constants.ENGINE_METHOD_EC` + * * `crypto.constants.ENGINE_METHOD_CIPHERS` + * * `crypto.constants.ENGINE_METHOD_DIGESTS` + * * `crypto.constants.ENGINE_METHOD_PKEY_METHS` + * * `crypto.constants.ENGINE_METHOD_PKEY_ASN1_METHS` + * * `crypto.constants.ENGINE_METHOD_ALL` + * * `crypto.constants.ENGINE_METHOD_NONE` + * @since v0.11.11 + * @param flags + */ + function setEngine(engine: string, flags?: number): void; + /** + * A convenient alias for {@link webcrypto.getRandomValues}. This + * implementation is not compliant with the Web Crypto spec, to write + * web-compatible code use {@link webcrypto.getRandomValues} instead. + * @since v17.4.0 + * @return Returns `typedArray`. + */ + function getRandomValues(typedArray: T): T; + /** + * A convenient alias for `crypto.webcrypto.subtle`. + * @since v17.4.0 + */ + const subtle: webcrypto.SubtleCrypto; + /** + * An implementation of the Web Crypto API standard. + * + * See the {@link https://nodejs.org/docs/latest/api/webcrypto.html Web Crypto API documentation} for details. + * @since v15.0.0 + */ + const webcrypto: webcrypto.Crypto; + namespace webcrypto { + type BufferSource = ArrayBufferView | ArrayBuffer; + type KeyFormat = 'jwk' | 'pkcs8' | 'raw' | 'spki'; + type KeyType = 'private' | 'public' | 'secret'; + type KeyUsage = 'decrypt' | 'deriveBits' | 'deriveKey' | 'encrypt' | 'sign' | 'unwrapKey' | 'verify' | 'wrapKey'; + type AlgorithmIdentifier = Algorithm | string; + type HashAlgorithmIdentifier = AlgorithmIdentifier; + type NamedCurve = string; + type BigInteger = Uint8Array; + interface AesCbcParams extends Algorithm { + iv: BufferSource; + } + interface AesCtrParams extends Algorithm { + counter: BufferSource; + length: number; + } + interface AesDerivedKeyParams extends Algorithm { + length: number; + } + interface AesGcmParams extends Algorithm { + additionalData?: BufferSource; + iv: BufferSource; + tagLength?: number; + } + interface AesKeyAlgorithm extends KeyAlgorithm { + length: number; + } + interface AesKeyGenParams extends Algorithm { + length: number; + } + interface Algorithm { + name: string; + } + interface EcKeyAlgorithm extends KeyAlgorithm { + namedCurve: NamedCurve; + } + interface EcKeyGenParams extends Algorithm { + namedCurve: NamedCurve; + } + interface EcKeyImportParams extends Algorithm { + namedCurve: NamedCurve; + } + interface EcdhKeyDeriveParams extends Algorithm { + public: CryptoKey; + } + interface EcdsaParams extends Algorithm { + hash: HashAlgorithmIdentifier; + } + interface Ed448Params extends Algorithm { + context?: BufferSource; + } + interface HkdfParams extends Algorithm { + hash: HashAlgorithmIdentifier; + info: BufferSource; + salt: BufferSource; + } + interface HmacImportParams extends Algorithm { + hash: HashAlgorithmIdentifier; + length?: number; + } + interface HmacKeyAlgorithm extends KeyAlgorithm { + hash: KeyAlgorithm; + length: number; + } + interface HmacKeyGenParams extends Algorithm { + hash: HashAlgorithmIdentifier; + length?: number; + } + interface JsonWebKey { + alg?: string; + crv?: string; + d?: string; + dp?: string; + dq?: string; + e?: string; + ext?: boolean; + k?: string; + key_ops?: string[]; + kty?: string; + n?: string; + oth?: RsaOtherPrimesInfo[]; + p?: string; + q?: string; + qi?: string; + use?: string; + x?: string; + y?: string; + } + interface KeyAlgorithm { + name: string; + } + interface Pbkdf2Params extends Algorithm { + hash: HashAlgorithmIdentifier; + iterations: number; + salt: BufferSource; + } + interface RsaHashedImportParams extends Algorithm { + hash: HashAlgorithmIdentifier; + } + interface RsaHashedKeyAlgorithm extends RsaKeyAlgorithm { + hash: KeyAlgorithm; + } + interface RsaHashedKeyGenParams extends RsaKeyGenParams { + hash: HashAlgorithmIdentifier; + } + interface RsaKeyAlgorithm extends KeyAlgorithm { + modulusLength: number; + publicExponent: BigInteger; + } + interface RsaKeyGenParams extends Algorithm { + modulusLength: number; + publicExponent: BigInteger; + } + interface RsaOaepParams extends Algorithm { + label?: BufferSource; + } + interface RsaOtherPrimesInfo { + d?: string; + r?: string; + t?: string; + } + interface RsaPssParams extends Algorithm { + saltLength: number; + } + /** + * Calling `require('node:crypto').webcrypto` returns an instance of the `Crypto` class. + * `Crypto` is a singleton that provides access to the remainder of the crypto API. + * @since v15.0.0 + */ + interface Crypto { + /** + * Provides access to the `SubtleCrypto` API. + * @since v15.0.0 + */ + readonly subtle: SubtleCrypto; + /** + * Generates cryptographically strong random values. + * The given `typedArray` is filled with random values, and a reference to `typedArray` is returned. + * + * The given `typedArray` must be an integer-based instance of {@link NodeJS.TypedArray}, i.e. `Float32Array` and `Float64Array` are not accepted. + * + * An error will be thrown if the given `typedArray` is larger than 65,536 bytes. + * @since v15.0.0 + */ + getRandomValues>(typedArray: T): T; + /** + * Generates a random {@link https://www.rfc-editor.org/rfc/rfc4122.txt RFC 4122} version 4 UUID. + * The UUID is generated using a cryptographic pseudorandom number generator. + * @since v16.7.0 + */ + randomUUID(): UUID; + CryptoKey: CryptoKeyConstructor; + } + // This constructor throws ILLEGAL_CONSTRUCTOR so it should not be newable. + interface CryptoKeyConstructor { + /** Illegal constructor */ + (_: { readonly _: unique symbol }): never; // Allows instanceof to work but not be callable by the user. + readonly length: 0; + readonly name: 'CryptoKey'; + readonly prototype: CryptoKey; + } + /** + * @since v15.0.0 + */ + interface CryptoKey { + /** + * An object detailing the algorithm for which the key can be used along with additional algorithm-specific parameters. + * @since v15.0.0 + */ + readonly algorithm: KeyAlgorithm; + /** + * When `true`, the {@link CryptoKey} can be extracted using either `subtleCrypto.exportKey()` or `subtleCrypto.wrapKey()`. + * @since v15.0.0 + */ + readonly extractable: boolean; + /** + * A string identifying whether the key is a symmetric (`'secret'`) or asymmetric (`'private'` or `'public'`) key. + * @since v15.0.0 + */ + readonly type: KeyType; + /** + * An array of strings identifying the operations for which the key may be used. + * + * The possible usages are: + * - `'encrypt'` - The key may be used to encrypt data. + * - `'decrypt'` - The key may be used to decrypt data. + * - `'sign'` - The key may be used to generate digital signatures. + * - `'verify'` - The key may be used to verify digital signatures. + * - `'deriveKey'` - The key may be used to derive a new key. + * - `'deriveBits'` - The key may be used to derive bits. + * - `'wrapKey'` - The key may be used to wrap another key. + * - `'unwrapKey'` - The key may be used to unwrap another key. + * + * Valid key usages depend on the key algorithm (identified by `cryptokey.algorithm.name`). + * @since v15.0.0 + */ + readonly usages: KeyUsage[]; + } + /** + * The `CryptoKeyPair` is a simple dictionary object with `publicKey` and `privateKey` properties, representing an asymmetric key pair. + * @since v15.0.0 + */ + interface CryptoKeyPair { + /** + * A {@link CryptoKey} whose type will be `'private'`. + * @since v15.0.0 + */ + privateKey: CryptoKey; + /** + * A {@link CryptoKey} whose type will be `'public'`. + * @since v15.0.0 + */ + publicKey: CryptoKey; + } + /** + * @since v15.0.0 + */ + interface SubtleCrypto { + /** + * Using the method and parameters specified in `algorithm` and the keying material provided by `key`, + * `subtle.decrypt()` attempts to decipher the provided `data`. If successful, + * the returned promise will be resolved with an `` containing the plaintext result. + * + * The algorithms currently supported include: + * + * - `'RSA-OAEP'` + * - `'AES-CTR'` + * - `'AES-CBC'` + * - `'AES-GCM'` + * @since v15.0.0 + */ + decrypt(algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, key: CryptoKey, data: BufferSource): Promise; + /** + * Using the method and parameters specified in `algorithm` and the keying material provided by `baseKey`, + * `subtle.deriveBits()` attempts to generate `length` bits. + * The Node.js implementation requires that when `length` is a number it must be multiple of `8`. + * When `length` is `null` the maximum number of bits for a given algorithm is generated. This is allowed + * for the `'ECDH'`, `'X25519'`, and `'X448'` algorithms. + * If successful, the returned promise will be resolved with an `` containing the generated data. + * + * The algorithms currently supported include: + * + * - `'ECDH'` + * - `'X25519'` + * - `'X448'` + * - `'HKDF'` + * - `'PBKDF2'` + * @since v15.0.0 + */ + deriveBits(algorithm: EcdhKeyDeriveParams, baseKey: CryptoKey, length: number | null): Promise; + deriveBits(algorithm: AlgorithmIdentifier | HkdfParams | Pbkdf2Params, baseKey: CryptoKey, length: number): Promise; + /** + * Using the method and parameters specified in `algorithm`, and the keying material provided by `baseKey`, + * `subtle.deriveKey()` attempts to generate a new ` based on the method and parameters in `derivedKeyAlgorithm`. + * + * Calling `subtle.deriveKey()` is equivalent to calling `subtle.deriveBits()` to generate raw keying material, + * then passing the result into the `subtle.importKey()` method using the `deriveKeyAlgorithm`, `extractable`, and `keyUsages` parameters as input. + * + * The algorithms currently supported include: + * + * - `'ECDH'` + * - `'X25519'` + * - `'X448'` + * - `'HKDF'` + * - `'PBKDF2'` + * @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}. + * @since v15.0.0 + */ + deriveKey( + algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params, + baseKey: CryptoKey, + derivedKeyAlgorithm: AlgorithmIdentifier | AesDerivedKeyParams | HmacImportParams | HkdfParams | Pbkdf2Params, + extractable: boolean, + keyUsages: ReadonlyArray + ): Promise; + /** + * Using the method identified by `algorithm`, `subtle.digest()` attempts to generate a digest of `data`. + * If successful, the returned promise is resolved with an `` containing the computed digest. + * + * If `algorithm` is provided as a ``, it must be one of: + * + * - `'SHA-1'` + * - `'SHA-256'` + * - `'SHA-384'` + * - `'SHA-512'` + * + * If `algorithm` is provided as an ``, it must have a `name` property whose value is one of the above. + * @since v15.0.0 + */ + digest(algorithm: AlgorithmIdentifier, data: BufferSource): Promise; + /** + * Using the method and parameters specified by `algorithm` and the keying material provided by `key`, + * `subtle.encrypt()` attempts to encipher `data`. If successful, + * the returned promise is resolved with an `` containing the encrypted result. + * + * The algorithms currently supported include: + * + * - `'RSA-OAEP'` + * - `'AES-CTR'` + * - `'AES-CBC'` + * - `'AES-GCM'` + * @since v15.0.0 + */ + encrypt(algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, key: CryptoKey, data: BufferSource): Promise; + /** + * Exports the given key into the specified format, if supported. + * + * If the `` is not extractable, the returned promise will reject. + * + * When `format` is either `'pkcs8'` or `'spki'` and the export is successful, + * the returned promise will be resolved with an `` containing the exported key data. + * + * When `format` is `'jwk'` and the export is successful, the returned promise will be resolved with a + * JavaScript object conforming to the {@link https://tools.ietf.org/html/rfc7517 JSON Web Key} specification. + * @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, or `'jwk'`. + * @returns `` containing ``. + * @since v15.0.0 + */ + exportKey(format: 'jwk', key: CryptoKey): Promise; + exportKey(format: Exclude, key: CryptoKey): Promise; + /** + * Using the method and parameters provided in `algorithm`, + * `subtle.generateKey()` attempts to generate new keying material. + * Depending the method used, the method may generate either a single `` or a ``. + * + * The `` (public and private key) generating algorithms supported include: + * + * - `'RSASSA-PKCS1-v1_5'` + * - `'RSA-PSS'` + * - `'RSA-OAEP'` + * - `'ECDSA'` + * - `'Ed25519'` + * - `'Ed448'` + * - `'ECDH'` + * - `'X25519'` + * - `'X448'` + * The `` (secret key) generating algorithms supported include: + * + * - `'HMAC'` + * - `'AES-CTR'` + * - `'AES-CBC'` + * - `'AES-GCM'` + * - `'AES-KW'` + * @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}. + * @since v15.0.0 + */ + generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams, extractable: boolean, keyUsages: ReadonlyArray): Promise; + generateKey(algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: ReadonlyArray): Promise; + generateKey(algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: KeyUsage[]): Promise; + /** + * The `subtle.importKey()` method attempts to interpret the provided `keyData` as the given `format` + * to create a `` instance using the provided `algorithm`, `extractable`, and `keyUsages` arguments. + * If the import is successful, the returned promise will be resolved with the created ``. + * + * If importing a `'PBKDF2'` key, `extractable` must be `false`. + * @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, or `'jwk'`. + * @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}. + * @since v15.0.0 + */ + importKey( + format: 'jwk', + keyData: JsonWebKey, + algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm, + extractable: boolean, + keyUsages: ReadonlyArray + ): Promise; + importKey( + format: Exclude, + keyData: BufferSource, + algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm, + extractable: boolean, + keyUsages: KeyUsage[] + ): Promise; + /** + * Using the method and parameters given by `algorithm` and the keying material provided by `key`, + * `subtle.sign()` attempts to generate a cryptographic signature of `data`. If successful, + * the returned promise is resolved with an `` containing the generated signature. + * + * The algorithms currently supported include: + * + * - `'RSASSA-PKCS1-v1_5'` + * - `'RSA-PSS'` + * - `'ECDSA'` + * - `'Ed25519'` + * - `'Ed448'` + * - `'HMAC'` + * @since v15.0.0 + */ + sign(algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams | Ed448Params, key: CryptoKey, data: BufferSource): Promise; + /** + * In cryptography, "wrapping a key" refers to exporting and then encrypting the keying material. + * The `subtle.unwrapKey()` method attempts to decrypt a wrapped key and create a `` instance. + * It is equivalent to calling `subtle.decrypt()` first on the encrypted key data (using the `wrappedKey`, `unwrapAlgo`, and `unwrappingKey` arguments as input) + * then passing the results in to the `subtle.importKey()` method using the `unwrappedKeyAlgo`, `extractable`, and `keyUsages` arguments as inputs. + * If successful, the returned promise is resolved with a `` object. + * + * The wrapping algorithms currently supported include: + * + * - `'RSA-OAEP'` + * - `'AES-CTR'` + * - `'AES-CBC'` + * - `'AES-GCM'` + * - `'AES-KW'` + * + * The unwrapped key algorithms supported include: + * + * - `'RSASSA-PKCS1-v1_5'` + * - `'RSA-PSS'` + * - `'RSA-OAEP'` + * - `'ECDSA'` + * - `'Ed25519'` + * - `'Ed448'` + * - `'ECDH'` + * - `'X25519'` + * - `'X448'` + * - `'HMAC'` + * - `'AES-CTR'` + * - `'AES-CBC'` + * - `'AES-GCM'` + * - `'AES-KW'` + * @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, or `'jwk'`. + * @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}. + * @since v15.0.0 + */ + unwrapKey( + format: KeyFormat, + wrappedKey: BufferSource, + unwrappingKey: CryptoKey, + unwrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, + unwrappedKeyAlgorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm, + extractable: boolean, + keyUsages: KeyUsage[] + ): Promise; + /** + * Using the method and parameters given in `algorithm` and the keying material provided by `key`, + * `subtle.verify()` attempts to verify that `signature` is a valid cryptographic signature of `data`. + * The returned promise is resolved with either `true` or `false`. + * + * The algorithms currently supported include: + * + * - `'RSASSA-PKCS1-v1_5'` + * - `'RSA-PSS'` + * - `'ECDSA'` + * - `'Ed25519'` + * - `'Ed448'` + * - `'HMAC'` + * @since v15.0.0 + */ + verify(algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams | Ed448Params, key: CryptoKey, signature: BufferSource, data: BufferSource): Promise; + /** + * In cryptography, "wrapping a key" refers to exporting and then encrypting the keying material. + * The `subtle.wrapKey()` method exports the keying material into the format identified by `format`, + * then encrypts it using the method and parameters specified by `wrapAlgo` and the keying material provided by `wrappingKey`. + * It is the equivalent to calling `subtle.exportKey()` using `format` and `key` as the arguments, + * then passing the result to the `subtle.encrypt()` method using `wrappingKey` and `wrapAlgo` as inputs. + * If successful, the returned promise will be resolved with an `` containing the encrypted key data. + * + * The wrapping algorithms currently supported include: + * + * - `'RSA-OAEP'` + * - `'AES-CTR'` + * - `'AES-CBC'` + * - `'AES-GCM'` + * - `'AES-KW'` + * @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, or `'jwk'`. + * @since v15.0.0 + */ + wrapKey(format: KeyFormat, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams): Promise; + } + } +} +declare module 'crypto' { + export * from 'node:crypto'; +} diff --git a/node_modules/@types/node/dgram.d.ts b/node_modules/@types/node/dgram.d.ts new file mode 100644 index 0000000..b1e95b2 --- /dev/null +++ b/node_modules/@types/node/dgram.d.ts @@ -0,0 +1,550 @@ +/** + * The `node:dgram` module provides an implementation of UDP datagram sockets. + * + * ```js + * import dgram from 'node:dgram'; + * + * const server = dgram.createSocket('udp4'); + * + * server.on('error', (err) => { + * console.error(`server error:\n${err.stack}`); + * server.close(); + * }); + * + * server.on('message', (msg, rinfo) => { + * console.log(`server got: ${msg} from ${rinfo.address}:${rinfo.port}`); + * }); + * + * server.on('listening', () => { + * const address = server.address(); + * console.log(`server listening ${address.address}:${address.port}`); + * }); + * + * server.bind(41234); + * // Prints: server listening 0.0.0.0:41234 + * ``` + * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/dgram.js) + */ +declare module 'node:dgram' { + import { AddressInfo } from 'node:net'; + import * as dns from 'node:dns'; + import { EventEmitter, Abortable } from 'node:events'; + interface RemoteInfo { + address: string; + family: 'IPv4' | 'IPv6'; + port: number; + size: number; + } + interface BindOptions { + port?: number | undefined; + address?: string | undefined; + exclusive?: boolean | undefined; + fd?: number | undefined; + } + type SocketType = 'udp4' | 'udp6'; + interface SocketOptions extends Abortable { + type: SocketType; + reuseAddr?: boolean | undefined; + /** + * @default false + */ + ipv6Only?: boolean | undefined; + recvBufferSize?: number | undefined; + sendBufferSize?: number | undefined; + lookup?: ((hostname: string, options: dns.LookupOneOptions, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void) => void) | undefined; + } + /** + * Creates a `dgram.Socket` object. Once the socket is created, calling `socket.bind()` will instruct the socket to begin listening for datagram + * messages. When `address` and `port` are not passed to `socket.bind()` the + * method will bind the socket to the "all interfaces" address on a random port + * (it does the right thing for both `udp4` and `udp6` sockets). The bound address + * and port can be retrieved using `socket.address().address` and `socket.address().port`. + * + * If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.close()` on the socket: + * + * ```js + * const controller = new AbortController(); + * const { signal } = controller; + * const server = dgram.createSocket({ type: 'udp4', signal }); + * server.on('message', (msg, rinfo) => { + * console.log(`server got: ${msg} from ${rinfo.address}:${rinfo.port}`); + * }); + * // Later, when you want to close the server. + * controller.abort(); + * ``` + * @since v0.11.13 + * @param options Available options are: + * @param callback Attached as a listener for `'message'` events. Optional. + */ + function createSocket(type: SocketType, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket; + function createSocket(options: SocketOptions, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket; + /** + * Encapsulates the datagram functionality. + * + * New instances of `dgram.Socket` are created using {@link createSocket}. + * The `new` keyword is not to be used to create `dgram.Socket` instances. + * @since v0.1.99 + */ + class Socket extends EventEmitter { + /** + * Tells the kernel to join a multicast group at the given `multicastAddress` and`multicastInterface` using the `IP_ADD_MEMBERSHIP` socket option. If the`multicastInterface` argument is not + * specified, the operating system will choose + * one interface and will add membership to it. To add membership to every + * available interface, call `addMembership` multiple times, once per interface. + * + * When called on an unbound socket, this method will implicitly bind to a random + * port, listening on all interfaces. + * + * When sharing a UDP socket across multiple `cluster` workers, the`socket.addMembership()` function must be called only once or an`EADDRINUSE` error will occur: + * + * ```js + * import cluster from 'node:cluster'; + * import dgram from 'node:dgram'; + * + * if (cluster.isPrimary) { + * cluster.fork(); // Works ok. + * cluster.fork(); // Fails with EADDRINUSE. + * } else { + * const s = dgram.createSocket('udp4'); + * s.bind(1234, () => { + * s.addMembership('224.0.0.114'); + * }); + * } + * ``` + * @since v0.6.9 + */ + addMembership(multicastAddress: string, multicastInterface?: string): void; + /** + * Returns an object containing the address information for a socket. + * For UDP sockets, this object will contain `address`, `family`, and `port`properties. + * + * This method throws `EBADF` if called on an unbound socket. + * @since v0.1.99 + */ + address(): AddressInfo; + /** + * For UDP sockets, causes the `dgram.Socket` to listen for datagram + * messages on a named `port` and optional `address`. If `port` is not + * specified or is `0`, the operating system will attempt to bind to a + * random port. If `address` is not specified, the operating system will + * attempt to listen on all addresses. Once binding is complete, a`'listening'` event is emitted and the optional `callback` function is + * called. + * + * Specifying both a `'listening'` event listener and passing a`callback` to the `socket.bind()` method is not harmful but not very + * useful. + * + * A bound datagram socket keeps the Node.js process running to receive + * datagram messages. + * + * If binding fails, an `'error'` event is generated. In rare case (e.g. + * attempting to bind with a closed socket), an `Error` may be thrown. + * + * Example of a UDP server listening on port 41234: + * + * ```js + * import dgram from 'node:dgram'; + * + * const server = dgram.createSocket('udp4'); + * + * server.on('error', (err) => { + * console.error(`server error:\n${err.stack}`); + * server.close(); + * }); + * + * server.on('message', (msg, rinfo) => { + * console.log(`server got: ${msg} from ${rinfo.address}:${rinfo.port}`); + * }); + * + * server.on('listening', () => { + * const address = server.address(); + * console.log(`server listening ${address.address}:${address.port}`); + * }); + * + * server.bind(41234); + * // Prints: server listening 0.0.0.0:41234 + * ``` + * @since v0.1.99 + * @param callback with no parameters. Called when binding is complete. + */ + bind(port?: number, address?: string, callback?: () => void): this; + bind(port?: number, callback?: () => void): this; + bind(callback?: () => void): this; + bind(options: BindOptions, callback?: () => void): this; + /** + * Close the underlying socket and stop listening for data on it. If a callback is + * provided, it is added as a listener for the `'close'` event. + * @since v0.1.99 + * @param callback Called when the socket has been closed. + */ + close(callback?: () => void): this; + /** + * Associates the `dgram.Socket` to a remote address and port. Every + * message sent by this handle is automatically sent to that destination. Also, + * the socket will only receive messages from that remote peer. + * Trying to call `connect()` on an already connected socket will result + * in an `ERR_SOCKET_DGRAM_IS_CONNECTED` exception. If `address` is not + * provided, `'127.0.0.1'` (for `udp4` sockets) or `'::1'` (for `udp6` sockets) + * will be used by default. Once the connection is complete, a `'connect'` event + * is emitted and the optional `callback` function is called. In case of failure, + * the `callback` is called or, failing this, an `'error'` event is emitted. + * @since v12.0.0 + * @param callback Called when the connection is completed or on error. + */ + connect(port: number, address?: string, callback?: () => void): void; + connect(port: number, callback: () => void): void; + /** + * A synchronous function that disassociates a connected `dgram.Socket` from + * its remote address. Trying to call `disconnect()` on an unbound or already + * disconnected socket will result in an `ERR_SOCKET_DGRAM_NOT_CONNECTED` exception. + * @since v12.0.0 + */ + disconnect(): void; + /** + * Instructs the kernel to leave a multicast group at `multicastAddress` using the`IP_DROP_MEMBERSHIP` socket option. This method is automatically called by the + * kernel when the socket is closed or the process terminates, so most apps will + * never have reason to call this. + * + * If `multicastInterface` is not specified, the operating system will attempt to + * drop membership on all valid interfaces. + * @since v0.6.9 + */ + dropMembership(multicastAddress: string, multicastInterface?: string): void; + /** + * This method throws `ERR_SOCKET_BUFFER_SIZE` if called on an unbound socket. + * @since v8.7.0 + * @return the `SO_RCVBUF` socket receive buffer size in bytes. + */ + getRecvBufferSize(): number; + /** + * This method throws `ERR_SOCKET_BUFFER_SIZE` if called on an unbound socket. + * @since v8.7.0 + * @return the `SO_SNDBUF` socket send buffer size in bytes. + */ + getSendBufferSize(): number; + /** + * By default, binding a socket will cause it to block the Node.js process from + * exiting as long as the socket is open. The `socket.unref()` method can be used + * to exclude the socket from the reference counting that keeps the Node.js + * process active. The `socket.ref()` method adds the socket back to the reference + * counting and restores the default behavior. + * + * Calling `socket.ref()` multiples times will have no additional effect. + * + * The `socket.ref()` method returns a reference to the socket so calls can be + * chained. + * @since v0.9.1 + */ + ref(): this; + /** + * Returns an object containing the `address`, `family`, and `port` of the remote + * endpoint. This method throws an `ERR_SOCKET_DGRAM_NOT_CONNECTED` exception + * if the socket is not connected. + * @since v12.0.0 + */ + remoteAddress(): AddressInfo; + /** + * Broadcasts a datagram on the socket. + * For connectionless sockets, the destination `port` and `address` must be + * specified. Connected sockets, on the other hand, will use their associated + * remote endpoint, so the `port` and `address` arguments must not be set. + * + * The `msg` argument contains the message to be sent. + * Depending on its type, different behavior can apply. If `msg` is a `Buffer`, + * any `TypedArray` or a `DataView`, + * the `offset` and `length` specify the offset within the `Buffer` where the + * message begins and the number of bytes in the message, respectively. + * If `msg` is a `String`, then it is automatically converted to a `Buffer`with `'utf8'` encoding. With messages that + * contain multi-byte characters, `offset` and `length` will be calculated with + * respect to `byte length` and not the character position. + * If `msg` is an array, `offset` and `length` must not be specified. + * + * The `address` argument is a string. If the value of `address` is a host name, + * DNS will be used to resolve the address of the host. If `address` is not + * provided or otherwise nullish, `'127.0.0.1'` (for `udp4` sockets) or `'::1'`(for `udp6` sockets) will be used by default. + * + * If the socket has not been previously bound with a call to `bind`, the socket + * is assigned a random port number and is bound to the "all interfaces" address + * (`'0.0.0.0'` for `udp4` sockets, `'::0'` for `udp6` sockets.) + * + * An optional `callback` function may be specified to as a way of reporting + * DNS errors or for determining when it is safe to reuse the `buf` object. + * DNS lookups delay the time to send for at least one tick of the + * Node.js event loop. + * + * The only way to know for sure that the datagram has been sent is by using a`callback`. If an error occurs and a `callback` is given, the error will be + * passed as the first argument to the `callback`. If a `callback` is not given, + * the error is emitted as an `'error'` event on the `socket` object. + * + * Offset and length are optional but both _must_ be set if either are used. + * They are supported only when the first argument is a `Buffer`, a `TypedArray`, + * or a `DataView`. + * + * This method throws `ERR_SOCKET_BAD_PORT` if called on an unbound socket. + * + * Example of sending a UDP packet to a port on `localhost`; + * + * ```js + * import dgram from 'node:dgram'; + * import { Buffer } from 'node:buffer'; + * + * const message = Buffer.from('Some bytes'); + * const client = dgram.createSocket('udp4'); + * client.send(message, 41234, 'localhost', (err) => { + * client.close(); + * }); + * ``` + * + * Example of sending a UDP packet composed of multiple buffers to a port on`127.0.0.1`; + * + * ```js + * import dgram from 'node:dgram'; + * import { Buffer } from 'node:buffer'; + * + * const buf1 = Buffer.from('Some '); + * const buf2 = Buffer.from('bytes'); + * const client = dgram.createSocket('udp4'); + * client.send([buf1, buf2], 41234, (err) => { + * client.close(); + * }); + * ``` + * + * Sending multiple buffers might be faster or slower depending on the + * application and operating system. Run benchmarks to + * determine the optimal strategy on a case-by-case basis. Generally speaking, + * however, sending multiple buffers is faster. + * + * Example of sending a UDP packet using a socket connected to a port on`localhost`: + * + * ```js + * import dgram from 'node:dgram'; + * import { Buffer } from 'node:buffer'; + * + * const message = Buffer.from('Some bytes'); + * const client = dgram.createSocket('udp4'); + * client.connect(41234, 'localhost', (err) => { + * client.send(message, (err) => { + * client.close(); + * }); + * }); + * ``` + * @since v0.1.99 + * @param msg Message to be sent. + * @param offset Offset in the buffer where the message starts. + * @param length Number of bytes in the message. + * @param port Destination port. + * @param address Destination host name or IP address. + * @param callback Called when the message has been sent. + */ + send(msg: string | Uint8Array | ReadonlyArray, port?: number, address?: string, callback?: (error: Error | null, bytes: number) => void): void; + send(msg: string | Uint8Array | ReadonlyArray, port?: number, callback?: (error: Error | null, bytes: number) => void): void; + send(msg: string | Uint8Array | ReadonlyArray, callback?: (error: Error | null, bytes: number) => void): void; + send(msg: string | Uint8Array, offset: number, length: number, port?: number, address?: string, callback?: (error: Error | null, bytes: number) => void): void; + send(msg: string | Uint8Array, offset: number, length: number, port?: number, callback?: (error: Error | null, bytes: number) => void): void; + send(msg: string | Uint8Array, offset: number, length: number, callback?: (error: Error | null, bytes: number) => void): void; + /** + * Sets or clears the `SO_BROADCAST` socket option. When set to `true`, UDP + * packets may be sent to a local interface's broadcast address. + * + * This method throws `EBADF` if called on an unbound socket. + * @since v0.6.9 + */ + setBroadcast(flag: boolean): void; + /** + * _All references to scope in this section are referring to [IPv6 Zone Indices](https://en.wikipedia.org/wiki/IPv6_address#Scoped_literal_IPv6_addresses), which are defined by [RFC + * 4007](https://tools.ietf.org/html/rfc4007). In string form, an IP_ + * _with a scope index is written as `'IP%scope'` where scope is an interface name_ + * _or interface number._ + * + * Sets the default outgoing multicast interface of the socket to a chosen + * interface or back to system interface selection. The `multicastInterface` must + * be a valid string representation of an IP from the socket's family. + * + * For IPv4 sockets, this should be the IP configured for the desired physical + * interface. All packets sent to multicast on the socket will be sent on the + * interface determined by the most recent successful use of this call. + * + * For IPv6 sockets, `multicastInterface` should include a scope to indicate the + * interface as in the examples that follow. In IPv6, individual `send` calls can + * also use explicit scope in addresses, so only packets sent to a multicast + * address without specifying an explicit scope are affected by the most recent + * successful use of this call. + * + * This method throws `EBADF` if called on an unbound socket. + * + * #### Example: IPv6 outgoing multicast interface + * + * On most systems, where scope format uses the interface name: + * + * ```js + * const socket = dgram.createSocket('udp6'); + * + * socket.bind(1234, () => { + * socket.setMulticastInterface('::%eth1'); + * }); + * ``` + * + * On Windows, where scope format uses an interface number: + * + * ```js + * const socket = dgram.createSocket('udp6'); + * + * socket.bind(1234, () => { + * socket.setMulticastInterface('::%2'); + * }); + * ``` + * + * #### Example: IPv4 outgoing multicast interface + * + * All systems use an IP of the host on the desired physical interface: + * + * ```js + * const socket = dgram.createSocket('udp4'); + * + * socket.bind(1234, () => { + * socket.setMulticastInterface('10.0.0.2'); + * }); + * ``` + * @since v8.6.0 + */ + setMulticastInterface(multicastInterface: string): void; + /** + * Sets or clears the `IP_MULTICAST_LOOP` socket option. When set to `true`, + * multicast packets will also be received on the local interface. + * + * This method throws `EBADF` if called on an unbound socket. + * @since v0.3.8 + */ + setMulticastLoopback(flag: boolean): boolean; + /** + * Sets the `IP_MULTICAST_TTL` socket option. While TTL generally stands for + * "Time to Live", in this context it specifies the number of IP hops that a + * packet is allowed to travel through, specifically for multicast traffic. Each + * router or gateway that forwards a packet decrements the TTL. If the TTL is + * decremented to 0 by a router, it will not be forwarded. + * + * The `ttl` argument may be between 0 and 255\. The default on most systems is `1`. + * + * This method throws `EBADF` if called on an unbound socket. + * @since v0.3.8 + */ + setMulticastTTL(ttl: number): number; + /** + * Sets the `SO_RCVBUF` socket option. Sets the maximum socket receive buffer + * in bytes. + * + * This method throws `ERR_SOCKET_BUFFER_SIZE` if called on an unbound socket. + * @since v8.7.0 + */ + setRecvBufferSize(size: number): void; + /** + * Sets the `SO_SNDBUF` socket option. Sets the maximum socket send buffer + * in bytes. + * + * This method throws `ERR_SOCKET_BUFFER_SIZE` if called on an unbound socket. + * @since v8.7.0 + */ + setSendBufferSize(size: number): void; + /** + * Sets the `IP_TTL` socket option. While TTL generally stands for "Time to Live", + * in this context it specifies the number of IP hops that a packet is allowed to + * travel through. Each router or gateway that forwards a packet decrements the + * TTL. If the TTL is decremented to 0 by a router, it will not be forwarded. + * Changing TTL values is typically done for network probes or when multicasting. + * + * The `ttl` argument may be between 1 and 255\. The default on most systems + * is 64. + * + * This method throws `EBADF` if called on an unbound socket. + * @since v0.1.101 + */ + setTTL(ttl: number): number; + /** + * By default, binding a socket will cause it to block the Node.js process from + * exiting as long as the socket is open. The `socket.unref()` method can be used + * to exclude the socket from the reference counting that keeps the Node.js + * process active, allowing the process to exit even if the socket is still + * listening. + * + * Calling `socket.unref()` multiple times will have no addition effect. + * + * The `socket.unref()` method returns a reference to the socket so calls can be + * chained. + * @since v0.9.1 + */ + unref(): this; + /** + * Tells the kernel to join a source-specific multicast channel at the given`sourceAddress` and `groupAddress`, using the `multicastInterface` with the`IP_ADD_SOURCE_MEMBERSHIP` socket + * option. If the `multicastInterface` argument + * is not specified, the operating system will choose one interface and will add + * membership to it. To add membership to every available interface, call`socket.addSourceSpecificMembership()` multiple times, once per interface. + * + * When called on an unbound socket, this method will implicitly bind to a random + * port, listening on all interfaces. + * @since v13.1.0, v12.16.0 + */ + addSourceSpecificMembership(sourceAddress: string, groupAddress: string, multicastInterface?: string): void; + /** + * Instructs the kernel to leave a source-specific multicast channel at the given`sourceAddress` and `groupAddress` using the `IP_DROP_SOURCE_MEMBERSHIP`socket option. This method is + * automatically called by the kernel when the + * socket is closed or the process terminates, so most apps will never have + * reason to call this. + * + * If `multicastInterface` is not specified, the operating system will attempt to + * drop membership on all valid interfaces. + * @since v13.1.0, v12.16.0 + */ + dropSourceSpecificMembership(sourceAddress: string, groupAddress: string, multicastInterface?: string): void; + /** + * events.EventEmitter + * 1. close + * 2. connect + * 3. error + * 4. listening + * 5. message + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: 'close', listener: () => void): this; + addListener(event: 'connect', listener: () => void): this; + addListener(event: 'error', listener: (err: Error) => void): this; + addListener(event: 'listening', listener: () => void): this; + addListener(event: 'message', listener: (msg: Buffer, rinfo: RemoteInfo) => void): this; + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: 'close'): boolean; + emit(event: 'connect'): boolean; + emit(event: 'error', err: Error): boolean; + emit(event: 'listening'): boolean; + emit(event: 'message', msg: Buffer, rinfo: RemoteInfo): boolean; + on(event: string, listener: (...args: any[]) => void): this; + on(event: 'close', listener: () => void): this; + on(event: 'connect', listener: () => void): this; + on(event: 'error', listener: (err: Error) => void): this; + on(event: 'listening', listener: () => void): this; + on(event: 'message', listener: (msg: Buffer, rinfo: RemoteInfo) => void): this; + once(event: string, listener: (...args: any[]) => void): this; + once(event: 'close', listener: () => void): this; + once(event: 'connect', listener: () => void): this; + once(event: 'error', listener: (err: Error) => void): this; + once(event: 'listening', listener: () => void): this; + once(event: 'message', listener: (msg: Buffer, rinfo: RemoteInfo) => void): this; + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: 'close', listener: () => void): this; + prependListener(event: 'connect', listener: () => void): this; + prependListener(event: 'error', listener: (err: Error) => void): this; + prependListener(event: 'listening', listener: () => void): this; + prependListener(event: 'message', listener: (msg: Buffer, rinfo: RemoteInfo) => void): this; + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'close', listener: () => void): this; + prependOnceListener(event: 'connect', listener: () => void): this; + prependOnceListener(event: 'error', listener: (err: Error) => void): this; + prependOnceListener(event: 'listening', listener: () => void): this; + prependOnceListener(event: 'message', listener: (msg: Buffer, rinfo: RemoteInfo) => void): this; + /** + * Calls `socket.close()` and returns a promise that fulfills when the socket has closed. + * @since v20.5.0 + */ + [Symbol.asyncDispose](): Promise; + } +} +declare module 'dgram' { + export * from 'node:dgram'; +} diff --git a/node_modules/@types/node/diagnostics_channel.d.ts b/node_modules/@types/node/diagnostics_channel.d.ts new file mode 100644 index 0000000..41ab138 --- /dev/null +++ b/node_modules/@types/node/diagnostics_channel.d.ts @@ -0,0 +1,191 @@ +/** + * The `node:diagnostics_channel` module provides an API to create named channels + * to report arbitrary message data for diagnostics purposes. + * + * It can be accessed using: + * + * ```js + * import diagnostics_channel from 'node:diagnostics_channel'; + * ``` + * + * It is intended that a module writer wanting to report diagnostics messages + * will create one or many top-level channels to report messages through. + * Channels may also be acquired at runtime but it is not encouraged + * due to the additional overhead of doing so. Channels may be exported for + * convenience, but as long as the name is known it can be acquired anywhere. + * + * If you intend for your module to produce diagnostics data for others to + * consume it is recommended that you include documentation of what named + * channels are used along with the shape of the message data. Channel names + * should generally include the module name to avoid collisions with data from + * other modules. + * @since v15.1.0, v14.17.0 + * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/diagnostics_channel.js) + */ +declare module 'node:diagnostics_channel' { + /** + * Check if there are active subscribers to the named channel. This is helpful if + * the message you want to send might be expensive to prepare. + * + * This API is optional but helpful when trying to publish messages from very + * performance-sensitive code. + * + * ```js + * import diagnostics_channel from 'node:diagnostics_channel'; + * + * if (diagnostics_channel.hasSubscribers('my-channel')) { + * // There are subscribers, prepare and publish message + * } + * ``` + * @since v15.1.0, v14.17.0 + * @param name The channel name + * @return If there are active subscribers + */ + function hasSubscribers(name: string | symbol): boolean; + /** + * This is the primary entry-point for anyone wanting to publish to a named + * channel. It produces a channel object which is optimized to reduce overhead at + * publish time as much as possible. + * + * ```js + * import diagnostics_channel from 'node:diagnostics_channel'; + * + * const channel = diagnostics_channel.channel('my-channel'); + * ``` + * @since v15.1.0, v14.17.0 + * @param name The channel name + * @return The named channel object + */ + function channel(name: string | symbol): Channel; + type ChannelListener = (message: unknown, name: string | symbol) => void; + /** + * Register a message handler to subscribe to this channel. This message handler + * will be run synchronously whenever a message is published to the channel. Any + * errors thrown in the message handler will trigger an `'uncaughtException'`. + * + * ```js + * import diagnostics_channel from 'node:diagnostics_channel'; + * + * diagnostics_channel.subscribe('my-channel', (message, name) => { + * // Received data + * }); + * ``` + * @since v18.7.0, v16.17.0 + * @param name The channel name + * @param onMessage The handler to receive channel messages + */ + function subscribe(name: string | symbol, onMessage: ChannelListener): void; + /** + * Remove a message handler previously registered to this channel with {@link subscribe}. + * + * ```js + * import diagnostics_channel from 'node:diagnostics_channel'; + * + * function onMessage(message, name) { + * // Received data + * } + * + * diagnostics_channel.subscribe('my-channel', onMessage); + * + * diagnostics_channel.unsubscribe('my-channel', onMessage); + * ``` + * @since v18.7.0, v16.17.0 + * @param name The channel name + * @param onMessage The previous subscribed handler to remove + * @return `true` if the handler was found, `false` otherwise. + */ + function unsubscribe(name: string | symbol, onMessage: ChannelListener): boolean; + /** + * The class `Channel` represents an individual named channel within the data + * pipeline. It is used to track subscribers and to publish messages when there + * are subscribers present. It exists as a separate object to avoid channel + * lookups at publish time, enabling very fast publish speeds and allowing + * for heavy use while incurring very minimal cost. Channels are created with {@link channel}, constructing a channel directly + * with `new Channel(name)` is not supported. + * @since v15.1.0, v14.17.0 + */ + class Channel { + readonly name: string | symbol; + /** + * Check if there are active subscribers to this channel. This is helpful if + * the message you want to send might be expensive to prepare. + * + * This API is optional but helpful when trying to publish messages from very + * performance-sensitive code. + * + * ```js + * import diagnostics_channel from 'node:diagnostics_channel'; + * + * const channel = diagnostics_channel.channel('my-channel'); + * + * if (channel.hasSubscribers) { + * // There are subscribers, prepare and publish message + * } + * ``` + * @since v15.1.0, v14.17.0 + */ + readonly hasSubscribers: boolean; + private constructor(name: string | symbol); + /** + * Publish a message to any subscribers to the channel. This will trigger + * message handlers synchronously so they will execute within the same context. + * + * ```js + * import diagnostics_channel from 'node:diagnostics_channel'; + * + * const channel = diagnostics_channel.channel('my-channel'); + * + * channel.publish({ + * some: 'message', + * }); + * ``` + * @since v15.1.0, v14.17.0 + * @param message The message to send to the channel subscribers + */ + publish(message: unknown): void; + /** + * Register a message handler to subscribe to this channel. This message handler + * will be run synchronously whenever a message is published to the channel. Any + * errors thrown in the message handler will trigger an `'uncaughtException'`. + * + * ```js + * import diagnostics_channel from 'node:diagnostics_channel'; + * + * const channel = diagnostics_channel.channel('my-channel'); + * + * channel.subscribe((message, name) => { + * // Received data + * }); + * ``` + * @since v15.1.0, v14.17.0 + * @deprecated Since v18.7.0,v16.17.0 - Use {@link subscribe(name, onMessage)} + * @param onMessage The handler to receive channel messages + */ + subscribe(onMessage: ChannelListener): void; + /** + * Remove a message handler previously registered to this channel with `channel.subscribe(onMessage)`. + * + * ```js + * import diagnostics_channel from 'node:diagnostics_channel'; + * + * const channel = diagnostics_channel.channel('my-channel'); + * + * function onMessage(message, name) { + * // Received data + * } + * + * channel.subscribe(onMessage); + * + * channel.unsubscribe(onMessage); + * ``` + * @since v15.1.0, v14.17.0 + * @deprecated Since v18.7.0,v16.17.0 - Use {@link unsubscribe(name, onMessage)} + * @param onMessage The previous subscribed handler to remove + * @return `true` if the handler was found, `false` otherwise. + */ + unsubscribe(onMessage: ChannelListener): void; + } +} +declare module 'diagnostics_channel' { + export * from 'node:diagnostics_channel'; +} diff --git a/node_modules/@types/node/dns.d.ts b/node_modules/@types/node/dns.d.ts new file mode 100644 index 0000000..8bd086c --- /dev/null +++ b/node_modules/@types/node/dns.d.ts @@ -0,0 +1,668 @@ +/** + * The `node:dns` module enables name resolution. For example, use it to look up IP + * addresses of host names. + * + * Although named for the [Domain Name System (DNS)](https://en.wikipedia.org/wiki/Domain_Name_System), it does not always use the + * DNS protocol for lookups. {@link lookup} uses the operating system + * facilities to perform name resolution. It may not need to perform any network + * communication. To perform name resolution the way other applications on the same + * system do, use {@link lookup}. + * + * ```js + * const dns = require('node:dns'); + * + * dns.lookup('example.org', (err, address, family) => { + * console.log('address: %j family: IPv%s', address, family); + * }); + * // address: "93.184.216.34" family: IPv4 + * ``` + * + * All other functions in the `node:dns` module connect to an actual DNS server to + * perform name resolution. They will always use the network to perform DNS + * queries. These functions do not use the same set of configuration files used by {@link lookup} (e.g. `/etc/hosts`). Use these functions to always perform + * DNS queries, bypassing other name-resolution facilities. + * + * ```js + * const dns = require('node:dns'); + * + * dns.resolve4('archive.org', (err, addresses) => { + * if (err) throw err; + * + * console.log(`addresses: ${JSON.stringify(addresses)}`); + * + * addresses.forEach((a) => { + * dns.reverse(a, (err, hostnames) => { + * if (err) { + * throw err; + * } + * console.log(`reverse for ${a}: ${JSON.stringify(hostnames)}`); + * }); + * }); + * }); + * ``` + * + * See the `Implementation considerations section` for more information. + * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/dns.js) + */ +declare module 'node:dns' { + import * as dnsPromises from 'node:dns/promises'; + // Supported getaddrinfo flags. + export const ADDRCONFIG: number; + export const V4MAPPED: number; + /** + * If `dns.V4MAPPED` is specified, return resolved IPv6 addresses as + * well as IPv4 mapped IPv6 addresses. + */ + export const ALL: number; + export interface LookupOptions { + family?: number | undefined; + hints?: number | undefined; + all?: boolean | undefined; + /** + * @default true + */ + verbatim?: boolean | undefined; + } + export interface LookupOneOptions extends LookupOptions { + all?: false | undefined; + } + export interface LookupAllOptions extends LookupOptions { + all: true; + } + export interface LookupAddress { + address: string; + family: number; + } + /** + * Resolves a host name (e.g. `'nodejs.org'`) into the first found A (IPv4) or + * AAAA (IPv6) record. All `option` properties are optional. If `options` is an + * integer, then it must be `4` or `6` – if `options` is `0` or not provided, then + * IPv4 and IPv6 addresses are both returned if found. + * + * With the `all` option set to `true`, the arguments for `callback` change to`(err, addresses)`, with `addresses` being an array of objects with the + * properties `address` and `family`. + * + * On error, `err` is an `Error` object, where `err.code` is the error code. + * Keep in mind that `err.code` will be set to `'ENOTFOUND'` not only when + * the host name does not exist but also when the lookup fails in other ways + * such as no available file descriptors. + * + * `dns.lookup()` does not necessarily have anything to do with the DNS protocol. + * The implementation uses an operating system facility that can associate names + * with addresses and vice versa. This implementation can have subtle but + * important consequences on the behavior of any Node.js program. Please take some + * time to consult the `Implementation considerations section` before using`dns.lookup()`. + * + * Example usage: + * + * ```js + * const dns = require('node:dns'); + * const options = { + * family: 6, + * hints: dns.ADDRCONFIG | dns.V4MAPPED, + * }; + * dns.lookup('example.com', options, (err, address, family) => + * console.log('address: %j family: IPv%s', address, family)); + * // address: "2606:2800:220:1:248:1893:25c8:1946" family: IPv6 + * + * // When options.all is true, the result will be an Array. + * options.all = true; + * dns.lookup('example.com', options, (err, addresses) => + * console.log('addresses: %j', addresses)); + * // addresses: [{"address":"2606:2800:220:1:248:1893:25c8:1946","family":6}] + * ``` + * + * If this method is invoked as its `util.promisify()` ed version, and `all`is not set to `true`, it returns a `Promise` for an `Object` with `address` and`family` properties. + * @since v0.1.90 + */ + export function lookup(hostname: string, family: number, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void): void; + export function lookup(hostname: string, options: LookupOneOptions, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void): void; + export function lookup(hostname: string, options: LookupAllOptions, callback: (err: NodeJS.ErrnoException | null, addresses: LookupAddress[]) => void): void; + export function lookup(hostname: string, options: LookupOptions, callback: (err: NodeJS.ErrnoException | null, address: string | LookupAddress[], family: number) => void): void; + export function lookup(hostname: string, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void): void; + export namespace lookup { + function __promisify__(hostname: string, options: LookupAllOptions): Promise; + function __promisify__(hostname: string, options?: LookupOneOptions | number): Promise; + function __promisify__(hostname: string, options: LookupOptions): Promise; + } + /** + * Resolves the given `address` and `port` into a host name and service using + * the operating system's underlying `getnameinfo` implementation. + * + * If `address` is not a valid IP address, a `TypeError` will be thrown. + * The `port` will be coerced to a number. If it is not a legal port, a `TypeError`will be thrown. + * + * On an error, `err` is an `Error` object, where `err.code` is the error code. + * + * ```js + * const dns = require('node:dns'); + * dns.lookupService('127.0.0.1', 22, (err, hostname, service) => { + * console.log(hostname, service); + * // Prints: localhost ssh + * }); + * ``` + * + * If this method is invoked as its `util.promisify()` ed version, it returns a`Promise` for an `Object` with `hostname` and `service` properties. + * @since v0.11.14 + */ + export function lookupService(address: string, port: number, callback: (err: NodeJS.ErrnoException | null, hostname: string, service: string) => void): void; + export namespace lookupService { + function __promisify__( + address: string, + port: number + ): Promise<{ + hostname: string; + service: string; + }>; + } + export interface ResolveOptions { + ttl: boolean; + } + export interface ResolveWithTtlOptions extends ResolveOptions { + ttl: true; + } + export interface RecordWithTtl { + address: string; + ttl: number; + } + /** @deprecated Use `AnyARecord` or `AnyAaaaRecord` instead. */ + export type AnyRecordWithTtl = AnyARecord | AnyAaaaRecord; + export interface AnyARecord extends RecordWithTtl { + type: 'A'; + } + export interface AnyAaaaRecord extends RecordWithTtl { + type: 'AAAA'; + } + export interface CaaRecord { + critical: number; + issue?: string | undefined; + issuewild?: string | undefined; + iodef?: string | undefined; + contactemail?: string | undefined; + contactphone?: string | undefined; + } + export interface MxRecord { + priority: number; + exchange: string; + } + export interface AnyMxRecord extends MxRecord { + type: 'MX'; + } + export interface NaptrRecord { + flags: string; + service: string; + regexp: string; + replacement: string; + order: number; + preference: number; + } + export interface AnyNaptrRecord extends NaptrRecord { + type: 'NAPTR'; + } + export interface SoaRecord { + nsname: string; + hostmaster: string; + serial: number; + refresh: number; + retry: number; + expire: number; + minttl: number; + } + export interface AnySoaRecord extends SoaRecord { + type: 'SOA'; + } + export interface SrvRecord { + priority: number; + weight: number; + port: number; + name: string; + } + export interface AnySrvRecord extends SrvRecord { + type: 'SRV'; + } + export interface AnyTxtRecord { + type: 'TXT'; + entries: string[]; + } + export interface AnyNsRecord { + type: 'NS'; + value: string; + } + export interface AnyPtrRecord { + type: 'PTR'; + value: string; + } + export interface AnyCnameRecord { + type: 'CNAME'; + value: string; + } + export type AnyRecord = AnyARecord | AnyAaaaRecord | AnyCnameRecord | AnyMxRecord | AnyNaptrRecord | AnyNsRecord | AnyPtrRecord | AnySoaRecord | AnySrvRecord | AnyTxtRecord; + /** + * Uses the DNS protocol to resolve a host name (e.g. `'nodejs.org'`) into an array + * of the resource records. The `callback` function has arguments`(err, records)`. When successful, `records` will be an array of resource + * records. The type and structure of individual results varies based on `rrtype`: + * + * + * + * On error, `err` is an `Error` object, where `err.code` is one of the `DNS error codes`. + * @since v0.1.27 + * @param hostname Host name to resolve. + * @param [rrtype='A'] Resource record type. + */ + export function resolve(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; + export function resolve(hostname: string, rrtype: 'A', callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; + export function resolve(hostname: string, rrtype: 'AAAA', callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; + export function resolve(hostname: string, rrtype: 'ANY', callback: (err: NodeJS.ErrnoException | null, addresses: AnyRecord[]) => void): void; + export function resolve(hostname: string, rrtype: 'CNAME', callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; + export function resolve(hostname: string, rrtype: 'MX', callback: (err: NodeJS.ErrnoException | null, addresses: MxRecord[]) => void): void; + export function resolve(hostname: string, rrtype: 'NAPTR', callback: (err: NodeJS.ErrnoException | null, addresses: NaptrRecord[]) => void): void; + export function resolve(hostname: string, rrtype: 'NS', callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; + export function resolve(hostname: string, rrtype: 'PTR', callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; + export function resolve(hostname: string, rrtype: 'SOA', callback: (err: NodeJS.ErrnoException | null, addresses: SoaRecord) => void): void; + export function resolve(hostname: string, rrtype: 'SRV', callback: (err: NodeJS.ErrnoException | null, addresses: SrvRecord[]) => void): void; + export function resolve(hostname: string, rrtype: 'TXT', callback: (err: NodeJS.ErrnoException | null, addresses: string[][]) => void): void; + export function resolve( + hostname: string, + rrtype: string, + callback: (err: NodeJS.ErrnoException | null, addresses: string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | string[][] | AnyRecord[]) => void + ): void; + export namespace resolve { + function __promisify__(hostname: string, rrtype?: 'A' | 'AAAA' | 'CNAME' | 'NS' | 'PTR'): Promise; + function __promisify__(hostname: string, rrtype: 'ANY'): Promise; + function __promisify__(hostname: string, rrtype: 'MX'): Promise; + function __promisify__(hostname: string, rrtype: 'NAPTR'): Promise; + function __promisify__(hostname: string, rrtype: 'SOA'): Promise; + function __promisify__(hostname: string, rrtype: 'SRV'): Promise; + function __promisify__(hostname: string, rrtype: 'TXT'): Promise; + function __promisify__(hostname: string, rrtype: string): Promise; + } + /** + * Uses the DNS protocol to resolve a IPv4 addresses (`A` records) for the`hostname`. The `addresses` argument passed to the `callback` function + * will contain an array of IPv4 addresses (e.g.`['74.125.79.104', '74.125.79.105', '74.125.79.106']`). + * @since v0.1.16 + * @param hostname Host name to resolve. + */ + export function resolve4(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; + export function resolve4(hostname: string, options: ResolveWithTtlOptions, callback: (err: NodeJS.ErrnoException | null, addresses: RecordWithTtl[]) => void): void; + export function resolve4(hostname: string, options: ResolveOptions, callback: (err: NodeJS.ErrnoException | null, addresses: string[] | RecordWithTtl[]) => void): void; + export namespace resolve4 { + function __promisify__(hostname: string): Promise; + function __promisify__(hostname: string, options: ResolveWithTtlOptions): Promise; + function __promisify__(hostname: string, options?: ResolveOptions): Promise; + } + /** + * Uses the DNS protocol to resolve IPv6 addresses (`AAAA` records) for the`hostname`. The `addresses` argument passed to the `callback` function + * will contain an array of IPv6 addresses. + * @since v0.1.16 + * @param hostname Host name to resolve. + */ + export function resolve6(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; + export function resolve6(hostname: string, options: ResolveWithTtlOptions, callback: (err: NodeJS.ErrnoException | null, addresses: RecordWithTtl[]) => void): void; + export function resolve6(hostname: string, options: ResolveOptions, callback: (err: NodeJS.ErrnoException | null, addresses: string[] | RecordWithTtl[]) => void): void; + export namespace resolve6 { + function __promisify__(hostname: string): Promise; + function __promisify__(hostname: string, options: ResolveWithTtlOptions): Promise; + function __promisify__(hostname: string, options?: ResolveOptions): Promise; + } + /** + * Uses the DNS protocol to resolve `CNAME` records for the `hostname`. The`addresses` argument passed to the `callback` function + * will contain an array of canonical name records available for the `hostname`(e.g. `['bar.example.com']`). + * @since v0.3.2 + */ + export function resolveCname(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; + export namespace resolveCname { + function __promisify__(hostname: string): Promise; + } + /** + * Uses the DNS protocol to resolve `CAA` records for the `hostname`. The`addresses` argument passed to the `callback` function + * will contain an array of certification authority authorization records + * available for the `hostname` (e.g. `[{critical: 0, iodef: 'mailto:pki@example.com'}, {critical: 128, issue: 'pki.example.com'}]`). + * @since v15.0.0, v14.17.0 + */ + export function resolveCaa(hostname: string, callback: (err: NodeJS.ErrnoException | null, records: CaaRecord[]) => void): void; + export namespace resolveCaa { + function __promisify__(hostname: string): Promise; + } + /** + * Uses the DNS protocol to resolve mail exchange records (`MX` records) for the`hostname`. The `addresses` argument passed to the `callback` function will + * contain an array of objects containing both a `priority` and `exchange`property (e.g. `[{priority: 10, exchange: 'mx.example.com'}, ...]`). + * @since v0.1.27 + */ + export function resolveMx(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: MxRecord[]) => void): void; + export namespace resolveMx { + function __promisify__(hostname: string): Promise; + } + /** + * Uses the DNS protocol to resolve regular expression-based records (`NAPTR`records) for the `hostname`. The `addresses` argument passed to the `callback`function will contain an array of + * objects with the following properties: + * + * * `flags` + * * `service` + * * `regexp` + * * `replacement` + * * `order` + * * `preference` + * + * ```js + * { + * flags: 's', + * service: 'SIP+D2U', + * regexp: '', + * replacement: '_sip._udp.example.com', + * order: 30, + * preference: 100 + * } + * ``` + * @since v0.9.12 + */ + export function resolveNaptr(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: NaptrRecord[]) => void): void; + export namespace resolveNaptr { + function __promisify__(hostname: string): Promise; + } + /** + * Uses the DNS protocol to resolve name server records (`NS` records) for the`hostname`. The `addresses` argument passed to the `callback` function will + * contain an array of name server records available for `hostname`(e.g. `['ns1.example.com', 'ns2.example.com']`). + * @since v0.1.90 + */ + export function resolveNs(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; + export namespace resolveNs { + function __promisify__(hostname: string): Promise; + } + /** + * Uses the DNS protocol to resolve pointer records (`PTR` records) for the`hostname`. The `addresses` argument passed to the `callback` function will + * be an array of strings containing the reply records. + * @since v6.0.0 + */ + export function resolvePtr(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; + export namespace resolvePtr { + function __promisify__(hostname: string): Promise; + } + /** + * Uses the DNS protocol to resolve a start of authority record (`SOA` record) for + * the `hostname`. The `address` argument passed to the `callback` function will + * be an object with the following properties: + * + * * `nsname` + * * `hostmaster` + * * `serial` + * * `refresh` + * * `retry` + * * `expire` + * * `minttl` + * + * ```js + * { + * nsname: 'ns.example.com', + * hostmaster: 'root.example.com', + * serial: 2013101809, + * refresh: 10000, + * retry: 2400, + * expire: 604800, + * minttl: 3600 + * } + * ``` + * @since v0.11.10 + */ + export function resolveSoa(hostname: string, callback: (err: NodeJS.ErrnoException | null, address: SoaRecord) => void): void; + export namespace resolveSoa { + function __promisify__(hostname: string): Promise; + } + /** + * Uses the DNS protocol to resolve service records (`SRV` records) for the`hostname`. The `addresses` argument passed to the `callback` function will + * be an array of objects with the following properties: + * + * * `priority` + * * `weight` + * * `port` + * * `name` + * + * ```js + * { + * priority: 10, + * weight: 5, + * port: 21223, + * name: 'service.example.com' + * } + * ``` + * @since v0.1.27 + */ + export function resolveSrv(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: SrvRecord[]) => void): void; + export namespace resolveSrv { + function __promisify__(hostname: string): Promise; + } + /** + * Uses the DNS protocol to resolve text queries (`TXT` records) for the`hostname`. The `records` argument passed to the `callback` function is a + * two-dimensional array of the text records available for `hostname` (e.g.`[ ['v=spf1 ip4:0.0.0.0 ', '~all' ] ]`). Each sub-array contains TXT chunks of + * one record. Depending on the use case, these could be either joined together or + * treated separately. + * @since v0.1.27 + */ + export function resolveTxt(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[][]) => void): void; + export namespace resolveTxt { + function __promisify__(hostname: string): Promise; + } + /** + * Uses the DNS protocol to resolve all records (also known as `ANY` or `*` query). + * The `ret` argument passed to the `callback` function will be an array containing + * various types of records. Each object has a property `type` that indicates the + * type of the current record. And depending on the `type`, additional properties + * will be present on the object: + * + * + * + * Here is an example of the `ret` object passed to the callback: + * + * ```js + * [ { type: 'A', address: '127.0.0.1', ttl: 299 }, + * { type: 'CNAME', value: 'example.com' }, + * { type: 'MX', exchange: 'alt4.aspmx.l.example.com', priority: 50 }, + * { type: 'NS', value: 'ns1.example.com' }, + * { type: 'TXT', entries: [ 'v=spf1 include:_spf.example.com ~all' ] }, + * { type: 'SOA', + * nsname: 'ns1.example.com', + * hostmaster: 'admin.example.com', + * serial: 156696742, + * refresh: 900, + * retry: 900, + * expire: 1800, + * minttl: 60 } ] + * ``` + * + * DNS server operators may choose not to respond to `ANY`queries. It may be better to call individual methods like {@link resolve4},{@link resolveMx}, and so on. For more details, see [RFC + * 8482](https://tools.ietf.org/html/rfc8482). + */ + export function resolveAny(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: AnyRecord[]) => void): void; + export namespace resolveAny { + function __promisify__(hostname: string): Promise; + } + /** + * Performs a reverse DNS query that resolves an IPv4 or IPv6 address to an + * array of host names. + * + * On error, `err` is an `Error` object, where `err.code` is + * one of the `DNS error codes`. + * @since v0.1.16 + */ + export function reverse(ip: string, callback: (err: NodeJS.ErrnoException | null, hostnames: string[]) => void): void; + /** + * Get the default value for `verbatim` in {@link lookup} and `dnsPromises.lookup()`. The value could be: + * + * * `ipv4first`: for `verbatim` defaulting to `false`. + * * `verbatim`: for `verbatim` defaulting to `true`. + * @since v20.1.0 + */ + export function getDefaultResultOrder(): 'ipv4first' | 'verbatim'; + /** + * Sets the IP address and port of servers to be used when performing DNS + * resolution. The `servers` argument is an array of [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6) formatted + * addresses. If the port is the IANA default DNS port (53) it can be omitted. + * + * ```js + * dns.setServers([ + * '4.4.4.4', + * '[2001:4860:4860::8888]', + * '4.4.4.4:1053', + * '[2001:4860:4860::8888]:1053', + * ]); + * ``` + * + * An error will be thrown if an invalid address is provided. + * + * The `dns.setServers()` method must not be called while a DNS query is in + * progress. + * + * The {@link setServers} method affects only {@link resolve},`dns.resolve*()` and {@link reverse} (and specifically _not_ {@link lookup}). + * + * This method works much like [resolve.conf](https://man7.org/linux/man-pages/man5/resolv.conf.5.html). + * That is, if attempting to resolve with the first server provided results in a`NOTFOUND` error, the `resolve()` method will _not_ attempt to resolve with + * subsequent servers provided. Fallback DNS servers will only be used if the + * earlier ones time out or result in some other error. + * @since v0.11.3 + * @param servers array of `RFC 5952` formatted addresses + */ + export function setServers(servers: ReadonlyArray): void; + /** + * Returns an array of IP address strings, formatted according to [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6), + * that are currently configured for DNS resolution. A string will include a port + * section if a custom port is used. + * + * ```js + * [ + * '4.4.4.4', + * '2001:4860:4860::8888', + * '4.4.4.4:1053', + * '[2001:4860:4860::8888]:1053', + * ] + * ``` + * @since v0.11.3 + */ + export function getServers(): string[]; + /** + * Set the default value of `verbatim` in {@link lookup} and `dnsPromises.lookup()`. The value could be: + * + * * `ipv4first`: sets default `verbatim` `false`. + * * `verbatim`: sets default `verbatim` `true`. + * + * The default is `verbatim` and {@link setDefaultResultOrder} have higher + * priority than `--dns-result-order`. When using `worker threads`,{@link setDefaultResultOrder} from the main thread won't affect the default + * dns orders in workers. + * @since v16.4.0, v14.18.0 + * @param order must be `'ipv4first'` or `'verbatim'`. + */ + export function setDefaultResultOrder(order: 'ipv4first' | 'verbatim'): void; + // Error codes + export const NODATA: string; + export const FORMERR: string; + export const SERVFAIL: string; + export const NOTFOUND: string; + export const NOTIMP: string; + export const REFUSED: string; + export const BADQUERY: string; + export const BADNAME: string; + export const BADFAMILY: string; + export const BADRESP: string; + export const CONNREFUSED: string; + export const TIMEOUT: string; + export const EOF: string; + export const FILE: string; + export const NOMEM: string; + export const DESTRUCTION: string; + export const BADSTR: string; + export const BADFLAGS: string; + export const NONAME: string; + export const BADHINTS: string; + export const NOTINITIALIZED: string; + export const LOADIPHLPAPI: string; + export const ADDRGETNETWORKPARAMS: string; + export const CANCELLED: string; + export interface ResolverOptions { + timeout?: number | undefined; + /** + * @default 4 + */ + tries?: number; + } + /** + * An independent resolver for DNS requests. + * + * Creating a new resolver uses the default server settings. Setting + * the servers used for a resolver using `resolver.setServers()` does not affect + * other resolvers: + * + * ```js + * const { Resolver } = require('node:dns'); + * const resolver = new Resolver(); + * resolver.setServers(['4.4.4.4']); + * + * // This request will use the server at 4.4.4.4, independent of global settings. + * resolver.resolve4('example.org', (err, addresses) => { + * // ... + * }); + * ``` + * + * The following methods from the `node:dns` module are available: + * + * * `resolver.getServers()` + * * `resolver.resolve()` + * * `resolver.resolve4()` + * * `resolver.resolve6()` + * * `resolver.resolveAny()` + * * `resolver.resolveCaa()` + * * `resolver.resolveCname()` + * * `resolver.resolveMx()` + * * `resolver.resolveNaptr()` + * * `resolver.resolveNs()` + * * `resolver.resolvePtr()` + * * `resolver.resolveSoa()` + * * `resolver.resolveSrv()` + * * `resolver.resolveTxt()` + * * `resolver.reverse()` + * * `resolver.setServers()` + * @since v8.3.0 + */ + export class Resolver { + constructor(options?: ResolverOptions); + /** + * Cancel all outstanding DNS queries made by this resolver. The corresponding + * callbacks will be called with an error with code `ECANCELLED`. + * @since v8.3.0 + */ + cancel(): void; + getServers: typeof getServers; + resolve: typeof resolve; + resolve4: typeof resolve4; + resolve6: typeof resolve6; + resolveAny: typeof resolveAny; + resolveCaa: typeof resolveCaa; + resolveCname: typeof resolveCname; + resolveMx: typeof resolveMx; + resolveNaptr: typeof resolveNaptr; + resolveNs: typeof resolveNs; + resolvePtr: typeof resolvePtr; + resolveSoa: typeof resolveSoa; + resolveSrv: typeof resolveSrv; + resolveTxt: typeof resolveTxt; + reverse: typeof reverse; + /** + * The resolver instance will send its requests from the specified IP address. + * This allows programs to specify outbound interfaces when used on multi-homed + * systems. + * + * If a v4 or v6 address is not specified, it is set to the default and the + * operating system will choose a local address automatically. + * + * The resolver will use the v4 local address when making requests to IPv4 DNS + * servers, and the v6 local address when making requests to IPv6 DNS servers. + * The `rrtype` of resolution requests has no impact on the local address used. + * @since v15.1.0, v14.17.0 + * @param [ipv4='0.0.0.0'] A string representation of an IPv4 address. + * @param [ipv6='::0'] A string representation of an IPv6 address. + */ + setLocalAddress(ipv4?: string, ipv6?: string): void; + setServers: typeof setServers; + } + export { dnsPromises as promises }; +} +declare module 'dns' { + export * from 'node:dns'; +} diff --git a/node_modules/@types/node/dns/promises.d.ts b/node_modules/@types/node/dns/promises.d.ts new file mode 100644 index 0000000..e5c7649 --- /dev/null +++ b/node_modules/@types/node/dns/promises.d.ts @@ -0,0 +1,414 @@ +/** + * The `dns.promises` API provides an alternative set of asynchronous DNS methods + * that return `Promise` objects rather than using callbacks. The API is accessible + * via `require('node:dns').promises` or `require('node:dns/promises')`. + * @since v10.6.0 + */ +declare module 'node:dns/promises' { + import { + LookupAddress, + LookupOneOptions, + LookupAllOptions, + LookupOptions, + AnyRecord, + CaaRecord, + MxRecord, + NaptrRecord, + SoaRecord, + SrvRecord, + ResolveWithTtlOptions, + RecordWithTtl, + ResolveOptions, + ResolverOptions, + } from 'node:dns'; + /** + * Returns an array of IP address strings, formatted according to [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6), + * that are currently configured for DNS resolution. A string will include a port + * section if a custom port is used. + * + * ```js + * [ + * '4.4.4.4', + * '2001:4860:4860::8888', + * '4.4.4.4:1053', + * '[2001:4860:4860::8888]:1053', + * ] + * ``` + * @since v10.6.0 + */ + function getServers(): string[]; + /** + * Resolves a host name (e.g. `'nodejs.org'`) into the first found A (IPv4) or + * AAAA (IPv6) record. All `option` properties are optional. If `options` is an + * integer, then it must be `4` or `6` – if `options` is not provided, then IPv4 + * and IPv6 addresses are both returned if found. + * + * With the `all` option set to `true`, the `Promise` is resolved with `addresses`being an array of objects with the properties `address` and `family`. + * + * On error, the `Promise` is rejected with an `Error` object, where `err.code`is the error code. + * Keep in mind that `err.code` will be set to `'ENOTFOUND'` not only when + * the host name does not exist but also when the lookup fails in other ways + * such as no available file descriptors. + * + * `dnsPromises.lookup()` does not necessarily have anything to do with the DNS + * protocol. The implementation uses an operating system facility that can + * associate names with addresses and vice versa. This implementation can have + * subtle but important consequences on the behavior of any Node.js program. Please + * take some time to consult the `Implementation considerations section` before + * using `dnsPromises.lookup()`. + * + * Example usage: + * + * ```js + * const dns = require('node:dns'); + * const dnsPromises = dns.promises; + * const options = { + * family: 6, + * hints: dns.ADDRCONFIG | dns.V4MAPPED, + * }; + * + * dnsPromises.lookup('example.com', options).then((result) => { + * console.log('address: %j family: IPv%s', result.address, result.family); + * // address: "2606:2800:220:1:248:1893:25c8:1946" family: IPv6 + * }); + * + * // When options.all is true, the result will be an Array. + * options.all = true; + * dnsPromises.lookup('example.com', options).then((result) => { + * console.log('addresses: %j', result); + * // addresses: [{"address":"2606:2800:220:1:248:1893:25c8:1946","family":6}] + * }); + * ``` + * @since v10.6.0 + */ + function lookup(hostname: string, family: number): Promise; + function lookup(hostname: string, options: LookupOneOptions): Promise; + function lookup(hostname: string, options: LookupAllOptions): Promise; + function lookup(hostname: string, options: LookupOptions): Promise; + function lookup(hostname: string): Promise; + /** + * Resolves the given `address` and `port` into a host name and service using + * the operating system's underlying `getnameinfo` implementation. + * + * If `address` is not a valid IP address, a `TypeError` will be thrown. + * The `port` will be coerced to a number. If it is not a legal port, a `TypeError`will be thrown. + * + * On error, the `Promise` is rejected with an `Error` object, where `err.code`is the error code. + * + * ```js + * const dnsPromises = require('node:dns').promises; + * dnsPromises.lookupService('127.0.0.1', 22).then((result) => { + * console.log(result.hostname, result.service); + * // Prints: localhost ssh + * }); + * ``` + * @since v10.6.0 + */ + function lookupService( + address: string, + port: number + ): Promise<{ + hostname: string; + service: string; + }>; + /** + * Uses the DNS protocol to resolve a host name (e.g. `'nodejs.org'`) into an array + * of the resource records. When successful, the `Promise` is resolved with an + * array of resource records. The type and structure of individual results vary + * based on `rrtype`: + * + * + * + * On error, the `Promise` is rejected with an `Error` object, where `err.code`is one of the `DNS error codes`. + * @since v10.6.0 + * @param hostname Host name to resolve. + * @param [rrtype='A'] Resource record type. + */ + function resolve(hostname: string): Promise; + function resolve(hostname: string, rrtype: 'A'): Promise; + function resolve(hostname: string, rrtype: 'AAAA'): Promise; + function resolve(hostname: string, rrtype: 'ANY'): Promise; + function resolve(hostname: string, rrtype: 'CAA'): Promise; + function resolve(hostname: string, rrtype: 'CNAME'): Promise; + function resolve(hostname: string, rrtype: 'MX'): Promise; + function resolve(hostname: string, rrtype: 'NAPTR'): Promise; + function resolve(hostname: string, rrtype: 'NS'): Promise; + function resolve(hostname: string, rrtype: 'PTR'): Promise; + function resolve(hostname: string, rrtype: 'SOA'): Promise; + function resolve(hostname: string, rrtype: 'SRV'): Promise; + function resolve(hostname: string, rrtype: 'TXT'): Promise; + function resolve(hostname: string, rrtype: string): Promise; + /** + * Uses the DNS protocol to resolve IPv4 addresses (`A` records) for the`hostname`. On success, the `Promise` is resolved with an array of IPv4 + * addresses (e.g. `['74.125.79.104', '74.125.79.105', '74.125.79.106']`). + * @since v10.6.0 + * @param hostname Host name to resolve. + */ + function resolve4(hostname: string): Promise; + function resolve4(hostname: string, options: ResolveWithTtlOptions): Promise; + function resolve4(hostname: string, options: ResolveOptions): Promise; + /** + * Uses the DNS protocol to resolve IPv6 addresses (`AAAA` records) for the`hostname`. On success, the `Promise` is resolved with an array of IPv6 + * addresses. + * @since v10.6.0 + * @param hostname Host name to resolve. + */ + function resolve6(hostname: string): Promise; + function resolve6(hostname: string, options: ResolveWithTtlOptions): Promise; + function resolve6(hostname: string, options: ResolveOptions): Promise; + /** + * Uses the DNS protocol to resolve all records (also known as `ANY` or `*` query). + * On success, the `Promise` is resolved with an array containing various types of + * records. Each object has a property `type` that indicates the type of the + * current record. And depending on the `type`, additional properties will be + * present on the object: + * + * + * + * Here is an example of the result object: + * + * ```js + * [ { type: 'A', address: '127.0.0.1', ttl: 299 }, + * { type: 'CNAME', value: 'example.com' }, + * { type: 'MX', exchange: 'alt4.aspmx.l.example.com', priority: 50 }, + * { type: 'NS', value: 'ns1.example.com' }, + * { type: 'TXT', entries: [ 'v=spf1 include:_spf.example.com ~all' ] }, + * { type: 'SOA', + * nsname: 'ns1.example.com', + * hostmaster: 'admin.example.com', + * serial: 156696742, + * refresh: 900, + * retry: 900, + * expire: 1800, + * minttl: 60 } ] + * ``` + * @since v10.6.0 + */ + function resolveAny(hostname: string): Promise; + /** + * Uses the DNS protocol to resolve `CAA` records for the `hostname`. On success, + * the `Promise` is resolved with an array of objects containing available + * certification authority authorization records available for the `hostname`(e.g. `[{critical: 0, iodef: 'mailto:pki@example.com'},{critical: 128, issue: 'pki.example.com'}]`). + * @since v15.0.0, v14.17.0 + */ + function resolveCaa(hostname: string): Promise; + /** + * Uses the DNS protocol to resolve `CNAME` records for the `hostname`. On success, + * the `Promise` is resolved with an array of canonical name records available for + * the `hostname` (e.g. `['bar.example.com']`). + * @since v10.6.0 + */ + function resolveCname(hostname: string): Promise; + /** + * Uses the DNS protocol to resolve mail exchange records (`MX` records) for the`hostname`. On success, the `Promise` is resolved with an array of objects + * containing both a `priority` and `exchange` property (e.g.`[{priority: 10, exchange: 'mx.example.com'}, ...]`). + * @since v10.6.0 + */ + function resolveMx(hostname: string): Promise; + /** + * Uses the DNS protocol to resolve regular expression-based records (`NAPTR`records) for the `hostname`. On success, the `Promise` is resolved with an array + * of objects with the following properties: + * + * * `flags` + * * `service` + * * `regexp` + * * `replacement` + * * `order` + * * `preference` + * + * ```js + * { + * flags: 's', + * service: 'SIP+D2U', + * regexp: '', + * replacement: '_sip._udp.example.com', + * order: 30, + * preference: 100 + * } + * ``` + * @since v10.6.0 + */ + function resolveNaptr(hostname: string): Promise; + /** + * Uses the DNS protocol to resolve name server records (`NS` records) for the`hostname`. On success, the `Promise` is resolved with an array of name server + * records available for `hostname` (e.g.`['ns1.example.com', 'ns2.example.com']`). + * @since v10.6.0 + */ + function resolveNs(hostname: string): Promise; + /** + * Uses the DNS protocol to resolve pointer records (`PTR` records) for the`hostname`. On success, the `Promise` is resolved with an array of strings + * containing the reply records. + * @since v10.6.0 + */ + function resolvePtr(hostname: string): Promise; + /** + * Uses the DNS protocol to resolve a start of authority record (`SOA` record) for + * the `hostname`. On success, the `Promise` is resolved with an object with the + * following properties: + * + * * `nsname` + * * `hostmaster` + * * `serial` + * * `refresh` + * * `retry` + * * `expire` + * * `minttl` + * + * ```js + * { + * nsname: 'ns.example.com', + * hostmaster: 'root.example.com', + * serial: 2013101809, + * refresh: 10000, + * retry: 2400, + * expire: 604800, + * minttl: 3600 + * } + * ``` + * @since v10.6.0 + */ + function resolveSoa(hostname: string): Promise; + /** + * Uses the DNS protocol to resolve service records (`SRV` records) for the`hostname`. On success, the `Promise` is resolved with an array of objects with + * the following properties: + * + * * `priority` + * * `weight` + * * `port` + * * `name` + * + * ```js + * { + * priority: 10, + * weight: 5, + * port: 21223, + * name: 'service.example.com' + * } + * ``` + * @since v10.6.0 + */ + function resolveSrv(hostname: string): Promise; + /** + * Uses the DNS protocol to resolve text queries (`TXT` records) for the`hostname`. On success, the `Promise` is resolved with a two-dimensional array + * of the text records available for `hostname` (e.g.`[ ['v=spf1 ip4:0.0.0.0 ', '~all' ] ]`). Each sub-array contains TXT chunks of + * one record. Depending on the use case, these could be either joined together or + * treated separately. + * @since v10.6.0 + */ + function resolveTxt(hostname: string): Promise; + /** + * Performs a reverse DNS query that resolves an IPv4 or IPv6 address to an + * array of host names. + * + * On error, the `Promise` is rejected with an `Error` object, where `err.code`is one of the `DNS error codes`. + * @since v10.6.0 + */ + function reverse(ip: string): Promise; + /** + * Sets the IP address and port of servers to be used when performing DNS + * resolution. The `servers` argument is an array of [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6) formatted + * addresses. If the port is the IANA default DNS port (53) it can be omitted. + * + * ```js + * dnsPromises.setServers([ + * '4.4.4.4', + * '[2001:4860:4860::8888]', + * '4.4.4.4:1053', + * '[2001:4860:4860::8888]:1053', + * ]); + * ``` + * + * An error will be thrown if an invalid address is provided. + * + * The `dnsPromises.setServers()` method must not be called while a DNS query is in + * progress. + * + * This method works much like [resolve.conf](https://man7.org/linux/man-pages/man5/resolv.conf.5.html). + * That is, if attempting to resolve with the first server provided results in a`NOTFOUND` error, the `resolve()` method will _not_ attempt to resolve with + * subsequent servers provided. Fallback DNS servers will only be used if the + * earlier ones time out or result in some other error. + * @since v10.6.0 + * @param servers array of `RFC 5952` formatted addresses + */ + function setServers(servers: ReadonlyArray): void; + /** + * Set the default value of `verbatim` in `dns.lookup()` and `dnsPromises.lookup()`. The value could be: + * + * * `ipv4first`: sets default `verbatim` `false`. + * * `verbatim`: sets default `verbatim` `true`. + * + * The default is `verbatim` and `dnsPromises.setDefaultResultOrder()` have + * higher priority than `--dns-result-order`. When using `worker threads`,`dnsPromises.setDefaultResultOrder()` from the main thread won't affect the + * default dns orders in workers. + * @since v16.4.0, v14.18.0 + * @param order must be `'ipv4first'` or `'verbatim'`. + */ + function setDefaultResultOrder(order: 'ipv4first' | 'verbatim'): void; + /** + * An independent resolver for DNS requests. + * + * Creating a new resolver uses the default server settings. Setting + * the servers used for a resolver using `resolver.setServers()` does not affect + * other resolvers: + * + * ```js + * const { Resolver } = require('node:dns').promises; + * const resolver = new Resolver(); + * resolver.setServers(['4.4.4.4']); + * + * // This request will use the server at 4.4.4.4, independent of global settings. + * resolver.resolve4('example.org').then((addresses) => { + * // ... + * }); + * + * // Alternatively, the same code can be written using async-await style. + * (async function() { + * const addresses = await resolver.resolve4('example.org'); + * })(); + * ``` + * + * The following methods from the `dnsPromises` API are available: + * + * * `resolver.getServers()` + * * `resolver.resolve()` + * * `resolver.resolve4()` + * * `resolver.resolve6()` + * * `resolver.resolveAny()` + * * `resolver.resolveCaa()` + * * `resolver.resolveCname()` + * * `resolver.resolveMx()` + * * `resolver.resolveNaptr()` + * * `resolver.resolveNs()` + * * `resolver.resolvePtr()` + * * `resolver.resolveSoa()` + * * `resolver.resolveSrv()` + * * `resolver.resolveTxt()` + * * `resolver.reverse()` + * * `resolver.setServers()` + * @since v10.6.0 + */ + class Resolver { + constructor(options?: ResolverOptions); + cancel(): void; + getServers: typeof getServers; + resolve: typeof resolve; + resolve4: typeof resolve4; + resolve6: typeof resolve6; + resolveAny: typeof resolveAny; + resolveCaa: typeof resolveCaa; + resolveCname: typeof resolveCname; + resolveMx: typeof resolveMx; + resolveNaptr: typeof resolveNaptr; + resolveNs: typeof resolveNs; + resolvePtr: typeof resolvePtr; + resolveSoa: typeof resolveSoa; + resolveSrv: typeof resolveSrv; + resolveTxt: typeof resolveTxt; + reverse: typeof reverse; + setLocalAddress(ipv4?: string, ipv6?: string): void; + setServers: typeof setServers; + } +} +declare module 'dns/promises' { + export * from 'node:dns/promises'; +} diff --git a/node_modules/@types/node/dom-events.d.ts b/node_modules/@types/node/dom-events.d.ts new file mode 100644 index 0000000..b9c1c3a --- /dev/null +++ b/node_modules/@types/node/dom-events.d.ts @@ -0,0 +1,126 @@ +export {}; // Don't export anything! + +//// DOM-like Events +// NB: The Event / EventTarget / EventListener implementations below were copied +// from lib.dom.d.ts, then edited to reflect Node's documentation at +// https://nodejs.org/api/events.html#class-eventtarget. +// Please read that link to understand important implementation differences. + +// This conditional type will be the existing global Event in a browser, or +// the copy below in a Node environment. +type __Event = typeof globalThis extends { onmessage: any, Event: any } +? {} +: { + /** This is not used in Node.js and is provided purely for completeness. */ + readonly bubbles: boolean; + /** Alias for event.stopPropagation(). This is not used in Node.js and is provided purely for completeness. */ + cancelBubble: () => void; + /** True if the event was created with the cancelable option */ + readonly cancelable: boolean; + /** This is not used in Node.js and is provided purely for completeness. */ + readonly composed: boolean; + /** Returns an array containing the current EventTarget as the only entry or empty if the event is not being dispatched. This is not used in Node.js and is provided purely for completeness. */ + composedPath(): [EventTarget?] + /** Alias for event.target. */ + readonly currentTarget: EventTarget | null; + /** Is true if cancelable is true and event.preventDefault() has been called. */ + readonly defaultPrevented: boolean; + /** This is not used in Node.js and is provided purely for completeness. */ + readonly eventPhase: 0 | 2; + /** The `AbortSignal` "abort" event is emitted with `isTrusted` set to `true`. The value is `false` in all other cases. */ + readonly isTrusted: boolean; + /** Sets the `defaultPrevented` property to `true` if `cancelable` is `true`. */ + preventDefault(): void; + /** This is not used in Node.js and is provided purely for completeness. */ + returnValue: boolean; + /** Alias for event.target. */ + readonly srcElement: EventTarget | null; + /** Stops the invocation of event listeners after the current one completes. */ + stopImmediatePropagation(): void; + /** This is not used in Node.js and is provided purely for completeness. */ + stopPropagation(): void; + /** The `EventTarget` dispatching the event */ + readonly target: EventTarget | null; + /** The millisecond timestamp when the Event object was created. */ + readonly timeStamp: number; + /** Returns the type of event, e.g. "click", "hashchange", or "submit". */ + readonly type: string; +}; + +// See comment above explaining conditional type +type __EventTarget = typeof globalThis extends { onmessage: any, EventTarget: any } +? {} +: { + /** + * Adds a new handler for the `type` event. Any given `listener` is added only once per `type` and per `capture` option value. + * + * If the `once` option is true, the `listener` is removed after the next time a `type` event is dispatched. + * + * The `capture` option is not used by Node.js in any functional way other than tracking registered event listeners per the `EventTarget` specification. + * Specifically, the `capture` option is used as part of the key when registering a `listener`. + * Any individual `listener` may be added once with `capture = false`, and once with `capture = true`. + */ + addEventListener( + type: string, + listener: EventListener | EventListenerObject, + options?: AddEventListenerOptions | boolean, + ): void; + /** Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise. */ + dispatchEvent(event: Event): boolean; + /** Removes the event listener in target's event listener list with the same type, callback, and options. */ + removeEventListener( + type: string, + listener: EventListener | EventListenerObject, + options?: EventListenerOptions | boolean, + ): void; +}; + +interface EventInit { + bubbles?: boolean; + cancelable?: boolean; + composed?: boolean; +} + +interface EventListenerOptions { + /** Not directly used by Node.js. Added for API completeness. Default: `false`. */ + capture?: boolean; +} + +interface AddEventListenerOptions extends EventListenerOptions { + /** When `true`, the listener is automatically removed when it is first invoked. Default: `false`. */ + once?: boolean; + /** When `true`, serves as a hint that the listener will not call the `Event` object's `preventDefault()` method. Default: false. */ + passive?: boolean; +} + +interface EventListener { + (evt: Event): void; +} + +interface EventListenerObject { + handleEvent(object: Event): void; +} + +import {} from 'events'; // Make this an ambient declaration +declare global { + /** An event which takes place in the DOM. */ + interface Event extends __Event {} + var Event: typeof globalThis extends { onmessage: any, Event: infer T } + ? T + : { + prototype: __Event; + new (type: string, eventInitDict?: EventInit): __Event; + }; + + /** + * EventTarget is a DOM interface implemented by objects that can + * receive events and may have listeners for them. + */ + interface EventTarget extends __EventTarget {} + var EventTarget: typeof globalThis extends { onmessage: any, EventTarget: infer T } + ? T + : { + prototype: __EventTarget; + new (): __EventTarget; + }; +} diff --git a/node_modules/@types/node/domain.d.ts b/node_modules/@types/node/domain.d.ts new file mode 100644 index 0000000..546aae7 --- /dev/null +++ b/node_modules/@types/node/domain.d.ts @@ -0,0 +1,170 @@ +/** + * **This module is pending deprecation.** Once a replacement API has been + * finalized, this module will be fully deprecated. Most developers should + * **not** have cause to use this module. Users who absolutely must have + * the functionality that domains provide may rely on it for the time being + * but should expect to have to migrate to a different solution + * in the future. + * + * Domains provide a way to handle multiple different IO operations as a + * single group. If any of the event emitters or callbacks registered to a + * domain emit an `'error'` event, or throw an error, then the domain object + * will be notified, rather than losing the context of the error in the`process.on('uncaughtException')` handler, or causing the program to + * exit immediately with an error code. + * @deprecated Since v1.4.2 - Deprecated + * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/domain.js) + */ +declare module 'node:domain' { + import EventEmitter = require('node:events'); + /** + * The `Domain` class encapsulates the functionality of routing errors and + * uncaught exceptions to the active `Domain` object. + * + * To handle the errors that it catches, listen to its `'error'` event. + */ + class Domain extends EventEmitter { + /** + * An array of timers and event emitters that have been explicitly added + * to the domain. + */ + members: Array; + /** + * The `enter()` method is plumbing used by the `run()`, `bind()`, and`intercept()` methods to set the active domain. It sets `domain.active` and`process.domain` to the domain, and implicitly + * pushes the domain onto the domain + * stack managed by the domain module (see {@link exit} for details on the + * domain stack). The call to `enter()` delimits the beginning of a chain of + * asynchronous calls and I/O operations bound to a domain. + * + * Calling `enter()` changes only the active domain, and does not alter the domain + * itself. `enter()` and `exit()` can be called an arbitrary number of times on a + * single domain. + */ + enter(): void; + /** + * The `exit()` method exits the current domain, popping it off the domain stack. + * Any time execution is going to switch to the context of a different chain of + * asynchronous calls, it's important to ensure that the current domain is exited. + * The call to `exit()` delimits either the end of or an interruption to the chain + * of asynchronous calls and I/O operations bound to a domain. + * + * If there are multiple, nested domains bound to the current execution context,`exit()` will exit any domains nested within this domain. + * + * Calling `exit()` changes only the active domain, and does not alter the domain + * itself. `enter()` and `exit()` can be called an arbitrary number of times on a + * single domain. + */ + exit(): void; + /** + * Run the supplied function in the context of the domain, implicitly + * binding all event emitters, timers, and low-level requests that are + * created in that context. Optionally, arguments can be passed to + * the function. + * + * This is the most basic way to use a domain. + * + * ```js + * const domain = require('node:domain'); + * const fs = require('node:fs'); + * const d = domain.create(); + * d.on('error', (er) => { + * console.error('Caught error!', er); + * }); + * d.run(() => { + * process.nextTick(() => { + * setTimeout(() => { // Simulating some various async stuff + * fs.open('non-existent file', 'r', (er, fd) => { + * if (er) throw er; + * // proceed... + * }); + * }, 100); + * }); + * }); + * ``` + * + * In this example, the `d.on('error')` handler will be triggered, rather + * than crashing the program. + */ + run(fn: (...args: any[]) => T, ...args: any[]): T; + /** + * Explicitly adds an emitter to the domain. If any event handlers called by + * the emitter throw an error, or if the emitter emits an `'error'` event, it + * will be routed to the domain's `'error'` event, just like with implicit + * binding. + * + * This also works with timers that are returned from `setInterval()` and `setTimeout()`. If their callback function throws, it will be caught by + * the domain `'error'` handler. + * + * If the Timer or `EventEmitter` was already bound to a domain, it is removed + * from that one, and bound to this one instead. + * @param emitter emitter or timer to be added to the domain + */ + add(emitter: EventEmitter | NodeJS.Timer): void; + /** + * The opposite of {@link add}. Removes domain handling from the + * specified emitter. + * @param emitter emitter or timer to be removed from the domain + */ + remove(emitter: EventEmitter | NodeJS.Timer): void; + /** + * The returned function will be a wrapper around the supplied callback + * function. When the returned function is called, any errors that are + * thrown will be routed to the domain's `'error'` event. + * + * ```js + * const d = domain.create(); + * + * function readSomeFile(filename, cb) { + * fs.readFile(filename, 'utf8', d.bind((er, data) => { + * // If this throws, it will also be passed to the domain. + * return cb(er, data ? JSON.parse(data) : null); + * })); + * } + * + * d.on('error', (er) => { + * // An error occurred somewhere. If we throw it now, it will crash the program + * // with the normal line number and stack message. + * }); + * ``` + * @param callback The callback function + * @return The bound function + */ + bind(callback: T): T; + /** + * This method is almost identical to {@link bind}. However, in + * addition to catching thrown errors, it will also intercept `Error` objects sent as the first argument to the function. + * + * In this way, the common `if (err) return callback(err);` pattern can be replaced + * with a single error handler in a single place. + * + * ```js + * const d = domain.create(); + * + * function readSomeFile(filename, cb) { + * fs.readFile(filename, 'utf8', d.intercept((data) => { + * // Note, the first argument is never passed to the + * // callback since it is assumed to be the 'Error' argument + * // and thus intercepted by the domain. + * + * // If this throws, it will also be passed to the domain + * // so the error-handling logic can be moved to the 'error' + * // event on the domain instead of being repeated throughout + * // the program. + * return cb(null, JSON.parse(data)); + * })); + * } + * + * d.on('error', (er) => { + * // An error occurred somewhere. If we throw it now, it will crash the program + * // with the normal line number and stack message. + * }); + * ``` + * @param callback The callback function + * @return The intercepted function + */ + intercept(callback: T): T; + } + function create(): Domain; +} +declare module 'domain' { + export * from 'node:domain'; +} diff --git a/node_modules/@types/node/events.d.ts b/node_modules/@types/node/events.d.ts new file mode 100644 index 0000000..59e264b --- /dev/null +++ b/node_modules/@types/node/events.d.ts @@ -0,0 +1,788 @@ +/** + * Much of the Node.js core API is built around an idiomatic asynchronous + * event-driven architecture in which certain kinds of objects (called "emitters") + * emit named events that cause `Function` objects ("listeners") to be called. + * + * For instance: a `net.Server` object emits an event each time a peer + * connects to it; a `fs.ReadStream` emits an event when the file is opened; + * a `stream` emits an event whenever data is available to be read. + * + * All objects that emit events are instances of the `EventEmitter` class. These + * objects expose an `eventEmitter.on()` function that allows one or more + * functions to be attached to named events emitted by the object. Typically, + * event names are camel-cased strings but any valid JavaScript property key + * can be used. + * + * When the `EventEmitter` object emits an event, all of the functions attached + * to that specific event are called _synchronously_. Any values returned by the + * called listeners are _ignored_ and discarded. + * + * The following example shows a simple `EventEmitter` instance with a single + * listener. The `eventEmitter.on()` method is used to register listeners, while + * the `eventEmitter.emit()` method is used to trigger the event. + * + * ```js + * import { EventEmitter } from 'node:events'; + * + * class MyEmitter extends EventEmitter {} + * + * const myEmitter = new MyEmitter(); + * myEmitter.on('event', () => { + * console.log('an event occurred!'); + * }); + * myEmitter.emit('event'); + * ``` + * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/events.js) + */ +declare module 'node:events' { + // NOTE: This class is in the docs but is **not actually exported** by Node. + // If https://github.com/nodejs/node/issues/39903 gets resolved and Node + // actually starts exporting the class, uncomment below. + // import { EventListener, EventListenerObject } from '__dom-events'; + // /** The NodeEventTarget is a Node.js-specific extension to EventTarget that emulates a subset of the EventEmitter API. */ + // interface NodeEventTarget extends EventTarget { + // /** + // * Node.js-specific extension to the `EventTarget` class that emulates the equivalent `EventEmitter` API. + // * The only difference between `addListener()` and `addEventListener()` is that addListener() will return a reference to the EventTarget. + // */ + // addListener(type: string, listener: EventListener | EventListenerObject, options?: { once: boolean }): this; + // /** Node.js-specific extension to the `EventTarget` class that returns an array of event `type` names for which event listeners are registered. */ + // eventNames(): string[]; + // /** Node.js-specific extension to the `EventTarget` class that returns the number of event listeners registered for the `type`. */ + // listenerCount(type: string): number; + // /** Node.js-specific alias for `eventTarget.removeListener()`. */ + // off(type: string, listener: EventListener | EventListenerObject): this; + // /** Node.js-specific alias for `eventTarget.addListener()`. */ + // on(type: string, listener: EventListener | EventListenerObject, options?: { once: boolean }): this; + // /** Node.js-specific extension to the `EventTarget` class that adds a `once` listener for the given event `type`. This is equivalent to calling `on` with the `once` option set to `true`. */ + // once(type: string, listener: EventListener | EventListenerObject): this; + // /** + // * Node.js-specific extension to the `EventTarget` class. + // * If `type` is specified, removes all registered listeners for `type`, + // * otherwise removes all registered listeners. + // */ + // removeAllListeners(type: string): this; + // /** + // * Node.js-specific extension to the `EventTarget` class that removes the listener for the given `type`. + // * The only difference between `removeListener()` and `removeEventListener()` is that `removeListener()` will return a reference to the `EventTarget`. + // */ + // removeListener(type: string, listener: EventListener | EventListenerObject): this; + // } + interface EventEmitterOptions { + /** + * Enables automatic capturing of promise rejection. + */ + captureRejections?: boolean | undefined; + } + // Any EventTarget with a Node-style `once` function + interface _NodeEventTarget { + once(eventName: string | symbol, listener: (...args: any[]) => void): this; + } + // Any EventTarget with a DOM-style `addEventListener` + interface _DOMEventTarget { + addEventListener( + eventName: string, + listener: (...args: any[]) => void, + opts?: { + once: boolean; + } + ): any; + } + interface StaticEventEmitterOptions { + signal?: AbortSignal | undefined; + } + interface EventEmitter extends NodeJS.EventEmitter {} + /** + * The `EventEmitter` class is defined and exposed by the `node:events` module: + * + * ```js + * import { EventEmitter } from 'node:events'; + * ``` + * + * All `EventEmitter`s emit the event `'newListener'` when new listeners are + * added and `'removeListener'` when existing listeners are removed. + * + * It supports the following option: + * @since v0.1.26 + */ + class EventEmitter { + constructor(options?: EventEmitterOptions); + /** + * Creates a `Promise` that is fulfilled when the `EventEmitter` emits the given + * event or that is rejected if the `EventEmitter` emits `'error'` while waiting. + * The `Promise` will resolve with an array of all the arguments emitted to the + * given event. + * + * This method is intentionally generic and works with the web platform [EventTarget](https://dom.spec.whatwg.org/#interface-eventtarget) interface, which has no special`'error'` event + * semantics and does not listen to the `'error'` event. + * + * ```js + * import { once, EventEmitter } from 'node:events'; + * import process from 'node:process'; + * + * const ee = new EventEmitter(); + * + * process.nextTick(() => { + * ee.emit('myevent', 42); + * }); + * + * const [value] = await once(ee, 'myevent'); + * console.log(value); + * + * const err = new Error('kaboom'); + * process.nextTick(() => { + * ee.emit('error', err); + * }); + * + * try { + * await once(ee, 'myevent'); + * } catch (err) { + * console.error('error happened', err); + * } + * ``` + * + * The special handling of the `'error'` event is only used when `events.once()`is used to wait for another event. If `events.once()` is used to wait for the + * '`error'` event itself, then it is treated as any other kind of event without + * special handling: + * + * ```js + * import { EventEmitter, once } from 'node:events'; + * + * const ee = new EventEmitter(); + * + * once(ee, 'error') + * .then(([err]) => console.log('ok', err.message)) + * .catch((err) => console.error('error', err.message)); + * + * ee.emit('error', new Error('boom')); + * + * // Prints: ok boom + * ``` + * + * An `AbortSignal` can be used to cancel waiting for the event: + * + * ```js + * import { EventEmitter, once } from 'node:events'; + * + * const ee = new EventEmitter(); + * const ac = new AbortController(); + * + * async function foo(emitter, event, signal) { + * try { + * await once(emitter, event, { signal }); + * console.log('event emitted!'); + * } catch (error) { + * if (error.name === 'AbortError') { + * console.error('Waiting for the event was canceled!'); + * } else { + * console.error('There was an error', error.message); + * } + * } + * } + * + * foo(ee, 'foo', ac.signal); + * ac.abort(); // Abort waiting for the event + * ee.emit('foo'); // Prints: Waiting for the event was canceled! + * ``` + * @since v11.13.0, v10.16.0 + */ + static once(emitter: _NodeEventTarget, eventName: string | symbol, options?: StaticEventEmitterOptions): Promise; + static once(emitter: _DOMEventTarget, eventName: string, options?: StaticEventEmitterOptions): Promise; + /** + * ```js + * import { on, EventEmitter } from 'node:events'; + * import process from 'node:process'; + * + * const ee = new EventEmitter(); + * + * // Emit later on + * process.nextTick(() => { + * ee.emit('foo', 'bar'); + * ee.emit('foo', 42); + * }); + * + * for await (const event of on(ee, 'foo')) { + * // The execution of this inner block is synchronous and it + * // processes one event at a time (even with await). Do not use + * // if concurrent execution is required. + * console.log(event); // prints ['bar'] [42] + * } + * // Unreachable here + * ``` + * + * Returns an `AsyncIterator` that iterates `eventName` events. It will throw + * if the `EventEmitter` emits `'error'`. It removes all listeners when + * exiting the loop. The `value` returned by each iteration is an array + * composed of the emitted event arguments. + * + * An `AbortSignal` can be used to cancel waiting on events: + * + * ```js + * import { on, EventEmitter } from 'node:events'; + * import process from 'node:process'; + * + * const ac = new AbortController(); + * + * (async () => { + * const ee = new EventEmitter(); + * + * // Emit later on + * process.nextTick(() => { + * ee.emit('foo', 'bar'); + * ee.emit('foo', 42); + * }); + * + * for await (const event of on(ee, 'foo', { signal: ac.signal })) { + * // The execution of this inner block is synchronous and it + * // processes one event at a time (even with await). Do not use + * // if concurrent execution is required. + * console.log(event); // prints ['bar'] [42] + * } + * // Unreachable here + * })(); + * + * process.nextTick(() => ac.abort()); + * ``` + * @since v13.6.0, v12.16.0 + * @param eventName The name of the event being listened for + * @return that iterates `eventName` events emitted by the `emitter` + */ + static on(emitter: NodeJS.EventEmitter, eventName: string, options?: StaticEventEmitterOptions): AsyncIterableIterator; + /** + * A class method that returns the number of listeners for the given `eventName`registered on the given `emitter`. + * + * ```js + * import { EventEmitter, listenerCount } from 'node:events'; + * + * const myEmitter = new EventEmitter(); + * myEmitter.on('event', () => {}); + * myEmitter.on('event', () => {}); + * console.log(listenerCount(myEmitter, 'event')); + * // Prints: 2 + * ``` + * @since v0.9.12 + * @deprecated Since v3.2.0 - Use `listenerCount` instead. + * @param emitter The emitter to query + * @param eventName The event name + */ + static listenerCount(emitter: NodeJS.EventEmitter, eventName: string | symbol): number; + /** + * Returns a copy of the array of listeners for the event named `eventName`. + * + * For `EventEmitter`s this behaves exactly the same as calling `.listeners` on + * the emitter. + * + * For `EventTarget`s this is the only way to get the event listeners for the + * event target. This is useful for debugging and diagnostic purposes. + * + * ```js + * import { getEventListeners, EventEmitter } from 'node:events'; + * + * { + * const ee = new EventEmitter(); + * const listener = () => console.log('Events are fun'); + * ee.on('foo', listener); + * console.log(getEventListeners(ee, 'foo')); // [ [Function: listener] ] + * } + * { + * const et = new EventTarget(); + * const listener = () => console.log('Events are fun'); + * et.addEventListener('foo', listener); + * console.log(getEventListeners(et, 'foo')); // [ [Function: listener] ] + * } + * ``` + * @since v15.2.0, v14.17.0 + */ + static getEventListeners(emitter: _DOMEventTarget | NodeJS.EventEmitter, name: string | symbol): Function[]; + /** + * Returns the currently set max amount of listeners. + * + * For `EventEmitter`s this behaves exactly the same as calling `.getMaxListeners` on + * the emitter. + * + * For `EventTarget`s this is the only way to get the max event listeners for the + * event target. If the number of event handlers on a single EventTarget exceeds + * the max set, the EventTarget will print a warning. + * + * ```js + * import { getMaxListeners, setMaxListeners, EventEmitter } from 'node:events'; + * + * { + * const ee = new EventEmitter(); + * console.log(getMaxListeners(ee)); // 10 + * setMaxListeners(11, ee); + * console.log(getMaxListeners(ee)); // 11 + * } + * { + * const et = new EventTarget(); + * console.log(getMaxListeners(et)); // 10 + * setMaxListeners(11, et); + * console.log(getMaxListeners(et)); // 11 + * } + * ``` + * @since v19.9.0 + */ + static getMaxListeners(emitter: _DOMEventTarget | NodeJS.EventEmitter): number; + /** + * ```js + * import { setMaxListeners, EventEmitter } from 'node:events'; + * + * const target = new EventTarget(); + * const emitter = new EventEmitter(); + * + * setMaxListeners(5, target, emitter); + * ``` + * @since v15.4.0 + * @param n A non-negative number. The maximum number of listeners per `EventTarget` event. + * @param eventsTargets Zero or more {EventTarget} or {EventEmitter} instances. If none are specified, `n` is set as the default max for all newly created {EventTarget} and {EventEmitter} + * objects. + */ + static setMaxListeners(n?: number, ...eventTargets: Array<_DOMEventTarget | NodeJS.EventEmitter>): void; + /** + * Listens once to the `abort` event on the provided `signal`. + * + * Listening to the `abort` event on abort signals is unsafe and may + * lead to resource leaks since another third party with the signal can + * call `e.stopImmediatePropagation()`. Unfortunately Node.js cannot change + * this since it would violate the web standard. Additionally, the original + * API makes it easy to forget to remove listeners. + * + * This API allows safely using `AbortSignal`s in Node.js APIs by solving these + * two issues by listening to the event such that `stopImmediatePropagation` does + * not prevent the listener from running. + * + * Returns a disposable so that it may be unsubscribed from more easily. + * + * ```js + * import { addAbortListener } from 'node:events'; + * + * function example(signal) { + * let disposable; + * try { + * signal.addEventListener('abort', (e) => e.stopImmediatePropagation()); + * disposable = addAbortListener(signal, (e) => { + * // Do something when signal is aborted. + * }); + * } finally { + * disposable?.[Symbol.dispose](); + * } + * } + * ``` + * @since v20.5.0 + * @experimental + * @return that removes the `abort` listener. + */ + static addAbortListener(signal: AbortSignal, resource: (event: Event) => void): Disposable; + /** + * This symbol shall be used to install a listener for only monitoring `'error'`events. Listeners installed using this symbol are called before the regular`'error'` listeners are called. + * + * Installing a listener using this symbol does not change the behavior once an`'error'` event is emitted. Therefore, the process will still crash if no + * regular `'error'` listener is installed. + * @since v13.6.0, v12.17.0 + */ + static readonly errorMonitor: unique symbol; + /** + * Value: `Symbol.for('nodejs.rejection')` + * + * See how to write a custom `rejection handler`. + * @since v13.4.0, v12.16.0 + */ + static readonly captureRejectionSymbol: unique symbol; + /** + * Value: [boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type) + * + * Change the default `captureRejections` option on all new `EventEmitter` objects. + * @since v13.4.0, v12.16.0 + */ + static captureRejections: boolean; + /** + * By default, a maximum of `10` listeners can be registered for any single + * event. This limit can be changed for individual `EventEmitter` instances + * using the `emitter.setMaxListeners(n)` method. To change the default + * for _all_`EventEmitter` instances, the `events.defaultMaxListeners`property can be used. If this value is not a positive number, a `RangeError`is thrown. + * + * Take caution when setting the `events.defaultMaxListeners` because the + * change affects _all_`EventEmitter` instances, including those created before + * the change is made. However, calling `emitter.setMaxListeners(n)` still has + * precedence over `events.defaultMaxListeners`. + * + * This is not a hard limit. The `EventEmitter` instance will allow + * more listeners to be added but will output a trace warning to stderr indicating + * that a "possible EventEmitter memory leak" has been detected. For any single`EventEmitter`, the `emitter.getMaxListeners()` and `emitter.setMaxListeners()`methods can be used to + * temporarily avoid this warning: + * + * ```js + * import { EventEmitter } from 'node:events'; + * const emitter = new EventEmitter(); + * emitter.setMaxListeners(emitter.getMaxListeners() + 1); + * emitter.once('event', () => { + * // do stuff + * emitter.setMaxListeners(Math.max(emitter.getMaxListeners() - 1, 0)); + * }); + * ``` + * + * The `--trace-warnings` command-line flag can be used to display the + * stack trace for such warnings. + * + * The emitted warning can be inspected with `process.on('warning')` and will + * have the additional `emitter`, `type`, and `count` properties, referring to + * the event emitter instance, the event's name and the number of attached + * listeners, respectively. + * Its `name` property is set to `'MaxListenersExceededWarning'`. + * @since v0.11.2 + */ + static defaultMaxListeners: number; + } + import internal = require('node:events'); + namespace EventEmitter { + // Should just be `export { EventEmitter }`, but that doesn't work in TypeScript 3.4 + export { internal as EventEmitter }; + export interface Abortable { + /** + * When provided the corresponding `AbortController` can be used to cancel an asynchronous action. + */ + signal?: AbortSignal | undefined; + } + } + global { + namespace NodeJS { + interface EventEmitter { + /** + * Alias for `emitter.on(eventName, listener)`. + * @since v0.1.26 + */ + addListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + /** + * Adds the `listener` function to the end of the listeners array for the + * event named `eventName`. No checks are made to see if the `listener` has + * already been added. Multiple calls passing the same combination of `eventName`and `listener` will result in the `listener` being added, and called, multiple + * times. + * + * ```js + * server.on('connection', (stream) => { + * console.log('someone connected!'); + * }); + * ``` + * + * Returns a reference to the `EventEmitter`, so that calls can be chained. + * + * By default, event listeners are invoked in the order they are added. The`emitter.prependListener()` method can be used as an alternative to add the + * event listener to the beginning of the listeners array. + * + * ```js + * import { EventEmitter } from 'node:events'; + * const myEE = new EventEmitter(); + * myEE.on('foo', () => console.log('a')); + * myEE.prependListener('foo', () => console.log('b')); + * myEE.emit('foo'); + * // Prints: + * // b + * // a + * ``` + * @since v0.1.101 + * @param eventName The name of the event. + * @param listener The callback function + */ + on(eventName: string | symbol, listener: (...args: any[]) => void): this; + /** + * Adds a **one-time**`listener` function for the event named `eventName`. The + * next time `eventName` is triggered, this listener is removed and then invoked. + * + * ```js + * server.once('connection', (stream) => { + * console.log('Ah, we have our first user!'); + * }); + * ``` + * + * Returns a reference to the `EventEmitter`, so that calls can be chained. + * + * By default, event listeners are invoked in the order they are added. The`emitter.prependOnceListener()` method can be used as an alternative to add the + * event listener to the beginning of the listeners array. + * + * ```js + * import { EventEmitter } from 'node:events'; + * const myEE = new EventEmitter(); + * myEE.once('foo', () => console.log('a')); + * myEE.prependOnceListener('foo', () => console.log('b')); + * myEE.emit('foo'); + * // Prints: + * // b + * // a + * ``` + * @since v0.3.0 + * @param eventName The name of the event. + * @param listener The callback function + */ + once(eventName: string | symbol, listener: (...args: any[]) => void): this; + /** + * Removes the specified `listener` from the listener array for the event named`eventName`. + * + * ```js + * const callback = (stream) => { + * console.log('someone connected!'); + * }; + * server.on('connection', callback); + * // ... + * server.removeListener('connection', callback); + * ``` + * + * `removeListener()` will remove, at most, one instance of a listener from the + * listener array. If any single listener has been added multiple times to the + * listener array for the specified `eventName`, then `removeListener()` must be + * called multiple times to remove each instance. + * + * Once an event is emitted, all listeners attached to it at the + * time of emitting are called in order. This implies that any`removeListener()` or `removeAllListeners()` calls _after_ emitting and _before_ the last listener finishes execution + * will not remove them from`emit()` in progress. Subsequent events behave as expected. + * + * ```js + * import { EventEmitter } from 'node:events'; + * class MyEmitter extends EventEmitter {} + * const myEmitter = new MyEmitter(); + * + * const callbackA = () => { + * console.log('A'); + * myEmitter.removeListener('event', callbackB); + * }; + * + * const callbackB = () => { + * console.log('B'); + * }; + * + * myEmitter.on('event', callbackA); + * + * myEmitter.on('event', callbackB); + * + * // callbackA removes listener callbackB but it will still be called. + * // Internal listener array at time of emit [callbackA, callbackB] + * myEmitter.emit('event'); + * // Prints: + * // A + * // B + * + * // callbackB is now removed. + * // Internal listener array [callbackA] + * myEmitter.emit('event'); + * // Prints: + * // A + * ``` + * + * Because listeners are managed using an internal array, calling this will + * change the position indices of any listener registered _after_ the listener + * being removed. This will not impact the order in which listeners are called, + * but it means that any copies of the listener array as returned by + * the `emitter.listeners()` method will need to be recreated. + * + * When a single function has been added as a handler multiple times for a single + * event (as in the example below), `removeListener()` will remove the most + * recently added instance. In the example the `once('ping')`listener is removed: + * + * ```js + * import { EventEmitter } from 'node:events'; + * const ee = new EventEmitter(); + * + * function pong() { + * console.log('pong'); + * } + * + * ee.on('ping', pong); + * ee.once('ping', pong); + * ee.removeListener('ping', pong); + * + * ee.emit('ping'); + * ee.emit('ping'); + * ``` + * + * Returns a reference to the `EventEmitter`, so that calls can be chained. + * @since v0.1.26 + */ + removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + /** + * Alias for `emitter.removeListener()`. + * @since v10.0.0 + */ + off(eventName: string | symbol, listener: (...args: any[]) => void): this; + /** + * Removes all listeners, or those of the specified `eventName`. + * + * It is bad practice to remove listeners added elsewhere in the code, + * particularly when the `EventEmitter` instance was created by some other + * component or module (e.g. sockets or file streams). + * + * Returns a reference to the `EventEmitter`, so that calls can be chained. + * @since v0.1.26 + */ + removeAllListeners(event?: string | symbol): this; + /** + * By default `EventEmitter`s will print a warning if more than `10` listeners are + * added for a particular event. This is a useful default that helps finding + * memory leaks. The `emitter.setMaxListeners()` method allows the limit to be + * modified for this specific `EventEmitter` instance. The value can be set to`Infinity` (or `0`) to indicate an unlimited number of listeners. + * + * Returns a reference to the `EventEmitter`, so that calls can be chained. + * @since v0.3.5 + */ + setMaxListeners(n: number): this; + /** + * Returns the current max listener value for the `EventEmitter` which is either + * set by `emitter.setMaxListeners(n)` or defaults to {@link defaultMaxListeners}. + * @since v1.0.0 + */ + getMaxListeners(): number; + /** + * Returns a copy of the array of listeners for the event named `eventName`. + * + * ```js + * server.on('connection', (stream) => { + * console.log('someone connected!'); + * }); + * console.log(util.inspect(server.listeners('connection'))); + * // Prints: [ [Function] ] + * ``` + * @since v0.1.26 + */ + listeners(eventName: string | symbol): Function[]; + /** + * Returns a copy of the array of listeners for the event named `eventName`, + * including any wrappers (such as those created by `.once()`). + * + * ```js + * import { EventEmitter } from 'node:events'; + * const emitter = new EventEmitter(); + * emitter.once('log', () => console.log('log once')); + * + * // Returns a new Array with a function `onceWrapper` which has a property + * // `listener` which contains the original listener bound above + * const listeners = emitter.rawListeners('log'); + * const logFnWrapper = listeners[0]; + * + * // Logs "log once" to the console and does not unbind the `once` event + * logFnWrapper.listener(); + * + * // Logs "log once" to the console and removes the listener + * logFnWrapper(); + * + * emitter.on('log', () => console.log('log persistently')); + * // Will return a new Array with a single function bound by `.on()` above + * const newListeners = emitter.rawListeners('log'); + * + * // Logs "log persistently" twice + * newListeners[0](); + * emitter.emit('log'); + * ``` + * @since v9.4.0 + */ + rawListeners(eventName: string | symbol): Function[]; + /** + * Synchronously calls each of the listeners registered for the event named`eventName`, in the order they were registered, passing the supplied arguments + * to each. + * + * Returns `true` if the event had listeners, `false` otherwise. + * + * ```js + * import { EventEmitter } from 'node:events'; + * const myEmitter = new EventEmitter(); + * + * // First listener + * myEmitter.on('event', function firstListener() { + * console.log('Helloooo! first listener'); + * }); + * // Second listener + * myEmitter.on('event', function secondListener(arg1, arg2) { + * console.log(`event with parameters ${arg1}, ${arg2} in second listener`); + * }); + * // Third listener + * myEmitter.on('event', function thirdListener(...args) { + * const parameters = args.join(', '); + * console.log(`event with parameters ${parameters} in third listener`); + * }); + * + * console.log(myEmitter.listeners('event')); + * + * myEmitter.emit('event', 1, 2, 3, 4, 5); + * + * // Prints: + * // [ + * // [Function: firstListener], + * // [Function: secondListener], + * // [Function: thirdListener] + * // ] + * // Helloooo! first listener + * // event with parameters 1, 2 in second listener + * // event with parameters 1, 2, 3, 4, 5 in third listener + * ``` + * @since v0.1.26 + */ + emit(eventName: string | symbol, ...args: any[]): boolean; + /** + * Returns the number of listeners listening for the event named `eventName`. + * If `listener` is provided, it will return how many times the listener is found + * in the list of the listeners of the event. + * @since v3.2.0 + * @param eventName The name of the event being listened for + * @param listener The event handler function + */ + listenerCount(eventName: string | symbol, listener?: Function): number; + /** + * Adds the `listener` function to the _beginning_ of the listeners array for the + * event named `eventName`. No checks are made to see if the `listener` has + * already been added. Multiple calls passing the same combination of `eventName`and `listener` will result in the `listener` being added, and called, multiple + * times. + * + * ```js + * server.prependListener('connection', (stream) => { + * console.log('someone connected!'); + * }); + * ``` + * + * Returns a reference to the `EventEmitter`, so that calls can be chained. + * @since v6.0.0 + * @param eventName The name of the event. + * @param listener The callback function + */ + prependListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + /** + * Adds a **one-time**`listener` function for the event named `eventName` to the _beginning_ of the listeners array. The next time `eventName` is triggered, this + * listener is removed, and then invoked. + * + * ```js + * server.prependOnceListener('connection', (stream) => { + * console.log('Ah, we have our first user!'); + * }); + * ``` + * + * Returns a reference to the `EventEmitter`, so that calls can be chained. + * @since v6.0.0 + * @param eventName The name of the event. + * @param listener The callback function + */ + prependOnceListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + /** + * Returns an array listing the events for which the emitter has registered + * listeners. The values in the array are strings or `Symbol`s. + * + * ```js + * import { EventEmitter } from 'node:events'; + * + * const myEE = new EventEmitter(); + * myEE.on('foo', () => {}); + * myEE.on('bar', () => {}); + * + * const sym = Symbol('symbol'); + * myEE.on(sym, () => {}); + * + * console.log(myEE.eventNames()); + * // Prints: [ 'foo', 'bar', Symbol(symbol) ] + * ``` + * @since v6.0.0 + */ + eventNames(): Array; + } + } + } + export = EventEmitter; +} +declare module 'events' { + import events = require('node:events'); + export = events; +} diff --git a/node_modules/@types/node/fs.d.ts b/node_modules/@types/node/fs.d.ts new file mode 100644 index 0000000..4595874 --- /dev/null +++ b/node_modules/@types/node/fs.d.ts @@ -0,0 +1,4087 @@ +/** + * The `node:fs` module enables interacting with the file system in a + * way modeled on standard POSIX functions. + * + * To use the promise-based APIs: + * + * ```js + * import * as fs from 'node:fs/promises'; + * ``` + * + * To use the callback and sync APIs: + * + * ```js + * import * as fs from 'node:fs'; + * ``` + * + * All file system operations have synchronous, callback, and promise-based + * forms, and are accessible using both CommonJS syntax and ES6 Modules (ESM). + * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/fs.js) + */ +declare module 'node:fs' { + import * as stream from 'node:stream'; + import { Abortable, EventEmitter } from 'node:events'; + import { URL } from 'node:url'; + import * as promises from 'node:fs/promises'; + export { promises }; + /** + * Valid types for path values in "fs". + */ + export type PathLike = string | Buffer | URL; + export type PathOrFileDescriptor = PathLike | number; + export type TimeLike = string | number | Date; + export type NoParamCallback = (err: NodeJS.ErrnoException | null) => void; + export type BufferEncodingOption = + | 'buffer' + | { + encoding: 'buffer'; + }; + export interface ObjectEncodingOptions { + encoding?: BufferEncoding | null | undefined; + } + export type EncodingOption = ObjectEncodingOptions | BufferEncoding | undefined | null; + export type OpenMode = number | string; + export type Mode = number | string; + export interface StatsBase { + isFile(): boolean; + isDirectory(): boolean; + isBlockDevice(): boolean; + isCharacterDevice(): boolean; + isSymbolicLink(): boolean; + isFIFO(): boolean; + isSocket(): boolean; + dev: T; + ino: T; + mode: T; + nlink: T; + uid: T; + gid: T; + rdev: T; + size: T; + blksize: T; + blocks: T; + atimeMs: T; + mtimeMs: T; + ctimeMs: T; + birthtimeMs: T; + atime: Date; + mtime: Date; + ctime: Date; + birthtime: Date; + } + export interface Stats extends StatsBase {} + /** + * A `fs.Stats` object provides information about a file. + * + * Objects returned from {@link stat}, {@link lstat}, {@link fstat}, and + * their synchronous counterparts are of this type. + * If `bigint` in the `options` passed to those methods is true, the numeric values + * will be `bigint` instead of `number`, and the object will contain additional + * nanosecond-precision properties suffixed with `Ns`. + * + * ```console + * Stats { + * dev: 2114, + * ino: 48064969, + * mode: 33188, + * nlink: 1, + * uid: 85, + * gid: 100, + * rdev: 0, + * size: 527, + * blksize: 4096, + * blocks: 8, + * atimeMs: 1318289051000.1, + * mtimeMs: 1318289051000.1, + * ctimeMs: 1318289051000.1, + * birthtimeMs: 1318289051000.1, + * atime: Mon, 10 Oct 2011 23:24:11 GMT, + * mtime: Mon, 10 Oct 2011 23:24:11 GMT, + * ctime: Mon, 10 Oct 2011 23:24:11 GMT, + * birthtime: Mon, 10 Oct 2011 23:24:11 GMT } + * ``` + * + * `bigint` version: + * + * ```console + * BigIntStats { + * dev: 2114n, + * ino: 48064969n, + * mode: 33188n, + * nlink: 1n, + * uid: 85n, + * gid: 100n, + * rdev: 0n, + * size: 527n, + * blksize: 4096n, + * blocks: 8n, + * atimeMs: 1318289051000n, + * mtimeMs: 1318289051000n, + * ctimeMs: 1318289051000n, + * birthtimeMs: 1318289051000n, + * atimeNs: 1318289051000000000n, + * mtimeNs: 1318289051000000000n, + * ctimeNs: 1318289051000000000n, + * birthtimeNs: 1318289051000000000n, + * atime: Mon, 10 Oct 2011 23:24:11 GMT, + * mtime: Mon, 10 Oct 2011 23:24:11 GMT, + * ctime: Mon, 10 Oct 2011 23:24:11 GMT, + * birthtime: Mon, 10 Oct 2011 23:24:11 GMT } + * ``` + * @since v0.1.21 + */ + export class Stats {} + export interface StatsFsBase { + /** Type of file system. */ + type: T; + /** Optimal transfer block size. */ + bsize: T; + /** Total data blocks in file system. */ + blocks: T; + /** Free blocks in file system. */ + bfree: T; + /** Available blocks for unprivileged users */ + bavail: T; + /** Total file nodes in file system. */ + files: T; + /** Free file nodes in file system. */ + ffree: T; + } + export interface StatsFs extends StatsFsBase {} + /** + * Provides information about a mounted file system. + * + * Objects returned from {@link statfs} and its synchronous counterpart are of + * this type. If `bigint` in the `options` passed to those methods is `true`, the + * numeric values will be `bigint` instead of `number`. + * + * ```console + * StatFs { + * type: 1397114950, + * bsize: 4096, + * blocks: 121938943, + * bfree: 61058895, + * bavail: 61058895, + * files: 999, + * ffree: 1000000 + * } + * ``` + * + * `bigint` version: + * + * ```console + * StatFs { + * type: 1397114950n, + * bsize: 4096n, + * blocks: 121938943n, + * bfree: 61058895n, + * bavail: 61058895n, + * files: 999n, + * ffree: 1000000n + * } + * ``` + * @since v19.6.0, v18.15.0 + */ + export class StatsFs {} + export interface BigIntStatsFs extends StatsFsBase {} + export interface StatFsOptions { + bigint?: boolean | undefined; + } + /** + * A representation of a directory entry, which can be a file or a subdirectory + * within the directory, as returned by reading from an `fs.Dir`. The + * directory entry is a combination of the file name and file type pairs. + * + * Additionally, when {@link readdir} or {@link readdirSync} is called with + * the `withFileTypes` option set to `true`, the resulting array is filled with `fs.Dirent` objects, rather than strings or `Buffer` s. + * @since v10.10.0 + */ + export class Dirent { + /** + * Returns `true` if the `fs.Dirent` object describes a regular file. + * @since v10.10.0 + */ + isFile(): boolean; + /** + * Returns `true` if the `fs.Dirent` object describes a file system + * directory. + * @since v10.10.0 + */ + isDirectory(): boolean; + /** + * Returns `true` if the `fs.Dirent` object describes a block device. + * @since v10.10.0 + */ + isBlockDevice(): boolean; + /** + * Returns `true` if the `fs.Dirent` object describes a character device. + * @since v10.10.0 + */ + isCharacterDevice(): boolean; + /** + * Returns `true` if the `fs.Dirent` object describes a symbolic link. + * @since v10.10.0 + */ + isSymbolicLink(): boolean; + /** + * Returns `true` if the `fs.Dirent` object describes a first-in-first-out + * (FIFO) pipe. + * @since v10.10.0 + */ + isFIFO(): boolean; + /** + * Returns `true` if the `fs.Dirent` object describes a socket. + * @since v10.10.0 + */ + isSocket(): boolean; + /** + * The file name that this `fs.Dirent` object refers to. The type of this + * value is determined by the `options.encoding` passed to {@link readdir} or {@link readdirSync}. + * @since v10.10.0 + */ + name: string; + /** + * The base path that this `fs.Dirent` object refers to. + * @since v20.1.0 + */ + path: string; + } + /** + * A class representing a directory stream. + * + * Created by {@link opendir}, {@link opendirSync}, or `fsPromises.opendir()`. + * + * ```js + * import { opendir } from 'node:fs/promises'; + * + * try { + * const dir = await opendir('./'); + * for await (const dirent of dir) + * console.log(dirent.name); + * } catch (err) { + * console.error(err); + * } + * ``` + * + * When using the async iterator, the `fs.Dir` object will be automatically + * closed after the iterator exits. + * @since v12.12.0 + */ + export class Dir implements AsyncIterable { + /** + * The read-only path of this directory as was provided to {@link opendir},{@link opendirSync}, or `fsPromises.opendir()`. + * @since v12.12.0 + */ + readonly path: string; + /** + * Asynchronously iterates over the directory via `readdir(3)` until all entries have been read. + */ + [Symbol.asyncIterator](): AsyncIterableIterator; + /** + * Asynchronously close the directory's underlying resource handle. + * Subsequent reads will result in errors. + * + * A promise is returned that will be resolved after the resource has been + * closed. + * @since v12.12.0 + */ + close(): Promise; + close(cb: NoParamCallback): void; + /** + * Synchronously close the directory's underlying resource handle. + * Subsequent reads will result in errors. + * @since v12.12.0 + */ + closeSync(): void; + /** + * Asynchronously read the next directory entry via [`readdir(3)`](http://man7.org/linux/man-pages/man3/readdir.3.html) as an `fs.Dirent`. + * + * A promise is returned that will be resolved with an `fs.Dirent`, or `null`if there are no more directory entries to read. + * + * Directory entries returned by this function are in no particular order as + * provided by the operating system's underlying directory mechanisms. + * Entries added or removed while iterating over the directory might not be + * included in the iteration results. + * @since v12.12.0 + * @return containing {fs.Dirent|null} + */ + read(): Promise; + read(cb: (err: NodeJS.ErrnoException | null, dirEnt: Dirent | null) => void): void; + /** + * Synchronously read the next directory entry as an `fs.Dirent`. See the + * POSIX [`readdir(3)`](http://man7.org/linux/man-pages/man3/readdir.3.html) documentation for more detail. + * + * If there are no more directory entries to read, `null` will be returned. + * + * Directory entries returned by this function are in no particular order as + * provided by the operating system's underlying directory mechanisms. + * Entries added or removed while iterating over the directory might not be + * included in the iteration results. + * @since v12.12.0 + */ + readSync(): Dirent | null; + } + /** + * Class: fs.StatWatcher + * @since v14.3.0, v12.20.0 + * Extends `EventEmitter` + * A successful call to {@link watchFile} method will return a new fs.StatWatcher object. + */ + export interface StatWatcher extends EventEmitter { + /** + * When called, requests that the Node.js event loop _not_ exit so long as the `fs.StatWatcher` is active. Calling `watcher.ref()` multiple times will have + * no effect. + * + * By default, all `fs.StatWatcher` objects are "ref'ed", making it normally + * unnecessary to call `watcher.ref()` unless `watcher.unref()` had been + * called previously. + * @since v14.3.0, v12.20.0 + */ + ref(): this; + /** + * When called, the active `fs.StatWatcher` object will not require the Node.js + * event loop to remain active. If there is no other activity keeping the + * event loop running, the process may exit before the `fs.StatWatcher` object's + * callback is invoked. Calling `watcher.unref()` multiple times will have + * no effect. + * @since v14.3.0, v12.20.0 + */ + unref(): this; + } + export interface FSWatcher extends EventEmitter { + /** + * Stop watching for changes on the given `fs.FSWatcher`. Once stopped, the `fs.FSWatcher` object is no longer usable. + * @since v0.5.8 + */ + close(): void; + /** + * events.EventEmitter + * 1. change + * 2. error + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: 'change', listener: (eventType: string, filename: string | Buffer) => void): this; + addListener(event: 'error', listener: (error: Error) => void): this; + addListener(event: 'close', listener: () => void): this; + on(event: string, listener: (...args: any[]) => void): this; + on(event: 'change', listener: (eventType: string, filename: string | Buffer) => void): this; + on(event: 'error', listener: (error: Error) => void): this; + on(event: 'close', listener: () => void): this; + once(event: string, listener: (...args: any[]) => void): this; + once(event: 'change', listener: (eventType: string, filename: string | Buffer) => void): this; + once(event: 'error', listener: (error: Error) => void): this; + once(event: 'close', listener: () => void): this; + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: 'change', listener: (eventType: string, filename: string | Buffer) => void): this; + prependListener(event: 'error', listener: (error: Error) => void): this; + prependListener(event: 'close', listener: () => void): this; + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'change', listener: (eventType: string, filename: string | Buffer) => void): this; + prependOnceListener(event: 'error', listener: (error: Error) => void): this; + prependOnceListener(event: 'close', listener: () => void): this; + } + /** + * Instances of `fs.ReadStream` are created and returned using the {@link createReadStream} function. + * @since v0.1.93 + */ + export class ReadStream extends stream.Readable { + close(callback?: (err?: NodeJS.ErrnoException | null) => void): void; + /** + * The number of bytes that have been read so far. + * @since v6.4.0 + */ + bytesRead: number; + /** + * The path to the file the stream is reading from as specified in the first + * argument to `fs.createReadStream()`. If `path` is passed as a string, then`readStream.path` will be a string. If `path` is passed as a `Buffer`, then`readStream.path` will be a + * `Buffer`. If `fd` is specified, then`readStream.path` will be `undefined`. + * @since v0.1.93 + */ + path: string | Buffer; + /** + * This property is `true` if the underlying file has not been opened yet, + * i.e. before the `'ready'` event is emitted. + * @since v11.2.0, v10.16.0 + */ + pending: boolean; + /** + * events.EventEmitter + * 1. open + * 2. close + * 3. ready + */ + addListener(event: 'close', listener: () => void): this; + addListener(event: 'data', listener: (chunk: Buffer | string) => void): this; + addListener(event: 'end', listener: () => void): this; + addListener(event: 'error', listener: (err: Error) => void): this; + addListener(event: 'open', listener: (fd: number) => void): this; + addListener(event: 'pause', listener: () => void): this; + addListener(event: 'readable', listener: () => void): this; + addListener(event: 'ready', listener: () => void): this; + addListener(event: 'resume', listener: () => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + on(event: 'close', listener: () => void): this; + on(event: 'data', listener: (chunk: Buffer | string) => void): this; + on(event: 'end', listener: () => void): this; + on(event: 'error', listener: (err: Error) => void): this; + on(event: 'open', listener: (fd: number) => void): this; + on(event: 'pause', listener: () => void): this; + on(event: 'readable', listener: () => void): this; + on(event: 'ready', listener: () => void): this; + on(event: 'resume', listener: () => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + once(event: 'close', listener: () => void): this; + once(event: 'data', listener: (chunk: Buffer | string) => void): this; + once(event: 'end', listener: () => void): this; + once(event: 'error', listener: (err: Error) => void): this; + once(event: 'open', listener: (fd: number) => void): this; + once(event: 'pause', listener: () => void): this; + once(event: 'readable', listener: () => void): this; + once(event: 'ready', listener: () => void): this; + once(event: 'resume', listener: () => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + prependListener(event: 'close', listener: () => void): this; + prependListener(event: 'data', listener: (chunk: Buffer | string) => void): this; + prependListener(event: 'end', listener: () => void): this; + prependListener(event: 'error', listener: (err: Error) => void): this; + prependListener(event: 'open', listener: (fd: number) => void): this; + prependListener(event: 'pause', listener: () => void): this; + prependListener(event: 'readable', listener: () => void): this; + prependListener(event: 'ready', listener: () => void): this; + prependListener(event: 'resume', listener: () => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'close', listener: () => void): this; + prependOnceListener(event: 'data', listener: (chunk: Buffer | string) => void): this; + prependOnceListener(event: 'end', listener: () => void): this; + prependOnceListener(event: 'error', listener: (err: Error) => void): this; + prependOnceListener(event: 'open', listener: (fd: number) => void): this; + prependOnceListener(event: 'pause', listener: () => void): this; + prependOnceListener(event: 'readable', listener: () => void): this; + prependOnceListener(event: 'ready', listener: () => void): this; + prependOnceListener(event: 'resume', listener: () => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + } + /** + * * Extends `stream.Writable` + * + * Instances of `fs.WriteStream` are created and returned using the {@link createWriteStream} function. + * @since v0.1.93 + */ + export class WriteStream extends stream.Writable { + /** + * Closes `writeStream`. Optionally accepts a + * callback that will be executed once the `writeStream`is closed. + * @since v0.9.4 + */ + close(callback?: (err?: NodeJS.ErrnoException | null) => void): void; + /** + * The number of bytes written so far. Does not include data that is still queued + * for writing. + * @since v0.4.7 + */ + bytesWritten: number; + /** + * The path to the file the stream is writing to as specified in the first + * argument to {@link createWriteStream}. If `path` is passed as a string, then`writeStream.path` will be a string. If `path` is passed as a `Buffer`, then`writeStream.path` will be a + * `Buffer`. + * @since v0.1.93 + */ + path: string | Buffer; + /** + * This property is `true` if the underlying file has not been opened yet, + * i.e. before the `'ready'` event is emitted. + * @since v11.2.0 + */ + pending: boolean; + /** + * events.EventEmitter + * 1. open + * 2. close + * 3. ready + */ + addListener(event: 'close', listener: () => void): this; + addListener(event: 'drain', listener: () => void): this; + addListener(event: 'error', listener: (err: Error) => void): this; + addListener(event: 'finish', listener: () => void): this; + addListener(event: 'open', listener: (fd: number) => void): this; + addListener(event: 'pipe', listener: (src: stream.Readable) => void): this; + addListener(event: 'ready', listener: () => void): this; + addListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + on(event: 'close', listener: () => void): this; + on(event: 'drain', listener: () => void): this; + on(event: 'error', listener: (err: Error) => void): this; + on(event: 'finish', listener: () => void): this; + on(event: 'open', listener: (fd: number) => void): this; + on(event: 'pipe', listener: (src: stream.Readable) => void): this; + on(event: 'ready', listener: () => void): this; + on(event: 'unpipe', listener: (src: stream.Readable) => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + once(event: 'close', listener: () => void): this; + once(event: 'drain', listener: () => void): this; + once(event: 'error', listener: (err: Error) => void): this; + once(event: 'finish', listener: () => void): this; + once(event: 'open', listener: (fd: number) => void): this; + once(event: 'pipe', listener: (src: stream.Readable) => void): this; + once(event: 'ready', listener: () => void): this; + once(event: 'unpipe', listener: (src: stream.Readable) => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + prependListener(event: 'close', listener: () => void): this; + prependListener(event: 'drain', listener: () => void): this; + prependListener(event: 'error', listener: (err: Error) => void): this; + prependListener(event: 'finish', listener: () => void): this; + prependListener(event: 'open', listener: (fd: number) => void): this; + prependListener(event: 'pipe', listener: (src: stream.Readable) => void): this; + prependListener(event: 'ready', listener: () => void): this; + prependListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'close', listener: () => void): this; + prependOnceListener(event: 'drain', listener: () => void): this; + prependOnceListener(event: 'error', listener: (err: Error) => void): this; + prependOnceListener(event: 'finish', listener: () => void): this; + prependOnceListener(event: 'open', listener: (fd: number) => void): this; + prependOnceListener(event: 'pipe', listener: (src: stream.Readable) => void): this; + prependOnceListener(event: 'ready', listener: () => void): this; + prependOnceListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + } + /** + * Asynchronously rename file at `oldPath` to the pathname provided + * as `newPath`. In the case that `newPath` already exists, it will + * be overwritten. If there is a directory at `newPath`, an error will + * be raised instead. No arguments other than a possible exception are + * given to the completion callback. + * + * See also: [`rename(2)`](http://man7.org/linux/man-pages/man2/rename.2.html). + * + * ```js + * import { rename } from 'node:fs'; + * + * rename('oldFile.txt', 'newFile.txt', (err) => { + * if (err) throw err; + * console.log('Rename complete!'); + * }); + * ``` + * @since v0.0.2 + */ + export function rename(oldPath: PathLike, newPath: PathLike, callback: NoParamCallback): void; + export namespace rename { + /** + * Asynchronous rename(2) - Change the name or location of a file or directory. + * @param oldPath A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + function __promisify__(oldPath: PathLike, newPath: PathLike): Promise; + } + /** + * Renames the file from `oldPath` to `newPath`. Returns `undefined`. + * + * See the POSIX [`rename(2)`](http://man7.org/linux/man-pages/man2/rename.2.html) documentation for more details. + * @since v0.1.21 + */ + export function renameSync(oldPath: PathLike, newPath: PathLike): void; + /** + * Truncates the file. No arguments other than a possible exception are + * given to the completion callback. A file descriptor can also be passed as the + * first argument. In this case, `fs.ftruncate()` is called. + * + * ```js + * import { truncate } from 'node:fs'; + * // Assuming that 'path/file.txt' is a regular file. + * truncate('path/file.txt', (err) => { + * if (err) throw err; + * console.log('path/file.txt was truncated'); + * }); + * ``` + * + * Passing a file descriptor is deprecated and may result in an error being thrown + * in the future. + * + * See the POSIX [`truncate(2)`](http://man7.org/linux/man-pages/man2/truncate.2.html) documentation for more details. + * @since v0.8.6 + * @param [len=0] + */ + export function truncate(path: PathLike, len: number | undefined | null, callback: NoParamCallback): void; + /** + * Asynchronous truncate(2) - Truncate a file to a specified length. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function truncate(path: PathLike, callback: NoParamCallback): void; + export namespace truncate { + /** + * Asynchronous truncate(2) - Truncate a file to a specified length. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param len If not specified, defaults to `0`. + */ + function __promisify__(path: PathLike, len?: number | null): Promise; + } + /** + * Truncates the file. Returns `undefined`. A file descriptor can also be + * passed as the first argument. In this case, `fs.ftruncateSync()` is called. + * + * Passing a file descriptor is deprecated and may result in an error being thrown + * in the future. + * @since v0.8.6 + * @param [len=0] + */ + export function truncateSync(path: PathLike, len?: number | null): void; + /** + * Truncates the file descriptor. No arguments other than a possible exception are + * given to the completion callback. + * + * See the POSIX [`ftruncate(2)`](http://man7.org/linux/man-pages/man2/ftruncate.2.html) documentation for more detail. + * + * If the file referred to by the file descriptor was larger than `len` bytes, only + * the first `len` bytes will be retained in the file. + * + * For example, the following program retains only the first four bytes of the + * file: + * + * ```js + * import { open, close, ftruncate } from 'node:fs'; + * + * function closeFd(fd) { + * close(fd, (err) => { + * if (err) throw err; + * }); + * } + * + * open('temp.txt', 'r+', (err, fd) => { + * if (err) throw err; + * + * try { + * ftruncate(fd, 4, (err) => { + * closeFd(fd); + * if (err) throw err; + * }); + * } catch (err) { + * closeFd(fd); + * if (err) throw err; + * } + * }); + * ``` + * + * If the file previously was shorter than `len` bytes, it is extended, and the + * extended part is filled with null bytes (`'\0'`): + * + * If `len` is negative then `0` will be used. + * @since v0.8.6 + * @param [len=0] + */ + export function ftruncate(fd: number, len: number | undefined | null, callback: NoParamCallback): void; + /** + * Asynchronous ftruncate(2) - Truncate a file to a specified length. + * @param fd A file descriptor. + */ + export function ftruncate(fd: number, callback: NoParamCallback): void; + export namespace ftruncate { + /** + * Asynchronous ftruncate(2) - Truncate a file to a specified length. + * @param fd A file descriptor. + * @param len If not specified, defaults to `0`. + */ + function __promisify__(fd: number, len?: number | null): Promise; + } + /** + * Truncates the file descriptor. Returns `undefined`. + * + * For detailed information, see the documentation of the asynchronous version of + * this API: {@link ftruncate}. + * @since v0.8.6 + * @param [len=0] + */ + export function ftruncateSync(fd: number, len?: number | null): void; + /** + * Asynchronously changes owner and group of a file. No arguments other than a + * possible exception are given to the completion callback. + * + * See the POSIX [`chown(2)`](http://man7.org/linux/man-pages/man2/chown.2.html) documentation for more detail. + * @since v0.1.97 + */ + export function chown(path: PathLike, uid: number, gid: number, callback: NoParamCallback): void; + export namespace chown { + /** + * Asynchronous chown(2) - Change ownership of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function __promisify__(path: PathLike, uid: number, gid: number): Promise; + } + /** + * Synchronously changes owner and group of a file. Returns `undefined`. + * This is the synchronous version of {@link chown}. + * + * See the POSIX [`chown(2)`](http://man7.org/linux/man-pages/man2/chown.2.html) documentation for more detail. + * @since v0.1.97 + */ + export function chownSync(path: PathLike, uid: number, gid: number): void; + /** + * Sets the owner of the file. No arguments other than a possible exception are + * given to the completion callback. + * + * See the POSIX [`fchown(2)`](http://man7.org/linux/man-pages/man2/fchown.2.html) documentation for more detail. + * @since v0.4.7 + */ + export function fchown(fd: number, uid: number, gid: number, callback: NoParamCallback): void; + export namespace fchown { + /** + * Asynchronous fchown(2) - Change ownership of a file. + * @param fd A file descriptor. + */ + function __promisify__(fd: number, uid: number, gid: number): Promise; + } + /** + * Sets the owner of the file. Returns `undefined`. + * + * See the POSIX [`fchown(2)`](http://man7.org/linux/man-pages/man2/fchown.2.html) documentation for more detail. + * @since v0.4.7 + * @param uid The file's new owner's user id. + * @param gid The file's new group's group id. + */ + export function fchownSync(fd: number, uid: number, gid: number): void; + /** + * Set the owner of the symbolic link. No arguments other than a possible + * exception are given to the completion callback. + * + * See the POSIX [`lchown(2)`](http://man7.org/linux/man-pages/man2/lchown.2.html) documentation for more detail. + */ + export function lchown(path: PathLike, uid: number, gid: number, callback: NoParamCallback): void; + export namespace lchown { + /** + * Asynchronous lchown(2) - Change ownership of a file. Does not dereference symbolic links. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function __promisify__(path: PathLike, uid: number, gid: number): Promise; + } + /** + * Set the owner for the path. Returns `undefined`. + * + * See the POSIX [`lchown(2)`](http://man7.org/linux/man-pages/man2/lchown.2.html) documentation for more details. + * @param uid The file's new owner's user id. + * @param gid The file's new group's group id. + */ + export function lchownSync(path: PathLike, uid: number, gid: number): void; + /** + * Changes the access and modification times of a file in the same way as {@link utimes}, with the difference that if the path refers to a symbolic + * link, then the link is not dereferenced: instead, the timestamps of the + * symbolic link itself are changed. + * + * No arguments other than a possible exception are given to the completion + * callback. + * @since v14.5.0, v12.19.0 + */ + export function lutimes(path: PathLike, atime: TimeLike, mtime: TimeLike, callback: NoParamCallback): void; + export namespace lutimes { + /** + * Changes the access and modification times of a file in the same way as `fsPromises.utimes()`, + * with the difference that if the path refers to a symbolic link, then the link is not + * dereferenced: instead, the timestamps of the symbolic link itself are changed. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param atime The last access time. If a string is provided, it will be coerced to number. + * @param mtime The last modified time. If a string is provided, it will be coerced to number. + */ + function __promisify__(path: PathLike, atime: TimeLike, mtime: TimeLike): Promise; + } + /** + * Change the file system timestamps of the symbolic link referenced by `path`. + * Returns `undefined`, or throws an exception when parameters are incorrect or + * the operation fails. This is the synchronous version of {@link lutimes}. + * @since v14.5.0, v12.19.0 + */ + export function lutimesSync(path: PathLike, atime: TimeLike, mtime: TimeLike): void; + /** + * Asynchronously changes the permissions of a file. No arguments other than a + * possible exception are given to the completion callback. + * + * See the POSIX [`chmod(2)`](http://man7.org/linux/man-pages/man2/chmod.2.html) documentation for more detail. + * + * ```js + * import { chmod } from 'node:fs'; + * + * chmod('my_file.txt', 0o775, (err) => { + * if (err) throw err; + * console.log('The permissions for file "my_file.txt" have been changed!'); + * }); + * ``` + * @since v0.1.30 + */ + export function chmod(path: PathLike, mode: Mode, callback: NoParamCallback): void; + export namespace chmod { + /** + * Asynchronous chmod(2) - Change permissions of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. + */ + function __promisify__(path: PathLike, mode: Mode): Promise; + } + /** + * For detailed information, see the documentation of the asynchronous version of + * this API: {@link chmod}. + * + * See the POSIX [`chmod(2)`](http://man7.org/linux/man-pages/man2/chmod.2.html) documentation for more detail. + * @since v0.6.7 + */ + export function chmodSync(path: PathLike, mode: Mode): void; + /** + * Sets the permissions on the file. No arguments other than a possible exception + * are given to the completion callback. + * + * See the POSIX [`fchmod(2)`](http://man7.org/linux/man-pages/man2/fchmod.2.html) documentation for more detail. + * @since v0.4.7 + */ + export function fchmod(fd: number, mode: Mode, callback: NoParamCallback): void; + export namespace fchmod { + /** + * Asynchronous fchmod(2) - Change permissions of a file. + * @param fd A file descriptor. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. + */ + function __promisify__(fd: number, mode: Mode): Promise; + } + /** + * Sets the permissions on the file. Returns `undefined`. + * + * See the POSIX [`fchmod(2)`](http://man7.org/linux/man-pages/man2/fchmod.2.html) documentation for more detail. + * @since v0.4.7 + */ + export function fchmodSync(fd: number, mode: Mode): void; + /** + * Changes the permissions on a symbolic link. No arguments other than a possible + * exception are given to the completion callback. + * + * This method is only implemented on macOS. + * + * See the POSIX [`lchmod(2)`](https://www.freebsd.org/cgi/man.cgi?query=lchmod&sektion=2) documentation for more detail. + * @deprecated Since v0.4.7 + */ + export function lchmod(path: PathLike, mode: Mode, callback: NoParamCallback): void; + /** @deprecated */ + export namespace lchmod { + /** + * Asynchronous lchmod(2) - Change permissions of a file. Does not dereference symbolic links. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. + */ + function __promisify__(path: PathLike, mode: Mode): Promise; + } + /** + * Changes the permissions on a symbolic link. Returns `undefined`. + * + * This method is only implemented on macOS. + * + * See the POSIX [`lchmod(2)`](https://www.freebsd.org/cgi/man.cgi?query=lchmod&sektion=2) documentation for more detail. + * @deprecated Since v0.4.7 + */ + export function lchmodSync(path: PathLike, mode: Mode): void; + /** + * Asynchronous [`stat(2)`](http://man7.org/linux/man-pages/man2/stat.2.html). The callback gets two arguments `(err, stats)` where`stats` is an `fs.Stats` object. + * + * In case of an error, the `err.code` will be one of `Common System Errors`. + * + * {@link stat} follows symbolic links. Use {@link lstat} to look at the + * links themselves. + * + * Using `fs.stat()` to check for the existence of a file before calling`fs.open()`, `fs.readFile()`, or `fs.writeFile()` is not recommended. + * Instead, user code should open/read/write the file directly and handle the + * error raised if the file is not available. + * + * To check if a file exists without manipulating it afterwards, {@link access} is recommended. + * + * For example, given the following directory structure: + * + * ```text + * - txtDir + * -- file.txt + * - app.js + * ``` + * + * The next program will check for the stats of the given paths: + * + * ```js + * import { stat } from 'node:fs'; + * + * const pathsToCheck = ['./txtDir', './txtDir/file.txt']; + * + * for (let i = 0; i < pathsToCheck.length; i++) { + * stat(pathsToCheck[i], (err, stats) => { + * console.log(stats.isDirectory()); + * console.log(stats); + * }); + * } + * ``` + * + * The resulting output will resemble: + * + * ```console + * true + * Stats { + * dev: 16777220, + * mode: 16877, + * nlink: 3, + * uid: 501, + * gid: 20, + * rdev: 0, + * blksize: 4096, + * ino: 14214262, + * size: 96, + * blocks: 0, + * atimeMs: 1561174653071.963, + * mtimeMs: 1561174614583.3518, + * ctimeMs: 1561174626623.5366, + * birthtimeMs: 1561174126937.2893, + * atime: 2019-06-22T03:37:33.072Z, + * mtime: 2019-06-22T03:36:54.583Z, + * ctime: 2019-06-22T03:37:06.624Z, + * birthtime: 2019-06-22T03:28:46.937Z + * } + * false + * Stats { + * dev: 16777220, + * mode: 33188, + * nlink: 1, + * uid: 501, + * gid: 20, + * rdev: 0, + * blksize: 4096, + * ino: 14214074, + * size: 8, + * blocks: 8, + * atimeMs: 1561174616618.8555, + * mtimeMs: 1561174614584, + * ctimeMs: 1561174614583.8145, + * birthtimeMs: 1561174007710.7478, + * atime: 2019-06-22T03:36:56.619Z, + * mtime: 2019-06-22T03:36:54.584Z, + * ctime: 2019-06-22T03:36:54.584Z, + * birthtime: 2019-06-22T03:26:47.711Z + * } + * ``` + * @since v0.0.2 + */ + export function stat(path: PathLike, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void; + export function stat( + path: PathLike, + options: + | (StatOptions & { + bigint?: false | undefined; + }) + | undefined, + callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void + ): void; + export function stat( + path: PathLike, + options: StatOptions & { + bigint: true; + }, + callback: (err: NodeJS.ErrnoException | null, stats: BigIntStats) => void + ): void; + export function stat(path: PathLike, options: StatOptions | undefined, callback: (err: NodeJS.ErrnoException | null, stats: Stats | BigIntStats) => void): void; + export namespace stat { + /** + * Asynchronous stat(2) - Get file status. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function __promisify__( + path: PathLike, + options?: StatOptions & { + bigint?: false | undefined; + } + ): Promise; + function __promisify__( + path: PathLike, + options: StatOptions & { + bigint: true; + } + ): Promise; + function __promisify__(path: PathLike, options?: StatOptions): Promise; + } + export interface StatSyncFn extends Function { + (path: PathLike, options?: undefined): Stats; + ( + path: PathLike, + options?: StatSyncOptions & { + bigint?: false | undefined; + throwIfNoEntry: false; + } + ): Stats | undefined; + ( + path: PathLike, + options: StatSyncOptions & { + bigint: true; + throwIfNoEntry: false; + } + ): BigIntStats | undefined; + ( + path: PathLike, + options?: StatSyncOptions & { + bigint?: false | undefined; + } + ): Stats; + ( + path: PathLike, + options: StatSyncOptions & { + bigint: true; + } + ): BigIntStats; + ( + path: PathLike, + options: StatSyncOptions & { + bigint: boolean; + throwIfNoEntry?: false | undefined; + } + ): Stats | BigIntStats; + (path: PathLike, options?: StatSyncOptions): Stats | BigIntStats | undefined; + } + /** + * Synchronous stat(2) - Get file status. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export const statSync: StatSyncFn; + /** + * Invokes the callback with the `fs.Stats` for the file descriptor. + * + * See the POSIX [`fstat(2)`](http://man7.org/linux/man-pages/man2/fstat.2.html) documentation for more detail. + * @since v0.1.95 + */ + export function fstat(fd: number, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void; + export function fstat( + fd: number, + options: + | (StatOptions & { + bigint?: false | undefined; + }) + | undefined, + callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void + ): void; + export function fstat( + fd: number, + options: StatOptions & { + bigint: true; + }, + callback: (err: NodeJS.ErrnoException | null, stats: BigIntStats) => void + ): void; + export function fstat(fd: number, options: StatOptions | undefined, callback: (err: NodeJS.ErrnoException | null, stats: Stats | BigIntStats) => void): void; + export namespace fstat { + /** + * Asynchronous fstat(2) - Get file status. + * @param fd A file descriptor. + */ + function __promisify__( + fd: number, + options?: StatOptions & { + bigint?: false | undefined; + } + ): Promise; + function __promisify__( + fd: number, + options: StatOptions & { + bigint: true; + } + ): Promise; + function __promisify__(fd: number, options?: StatOptions): Promise; + } + /** + * Retrieves the `fs.Stats` for the file descriptor. + * + * See the POSIX [`fstat(2)`](http://man7.org/linux/man-pages/man2/fstat.2.html) documentation for more detail. + * @since v0.1.95 + */ + export function fstatSync( + fd: number, + options?: StatOptions & { + bigint?: false | undefined; + } + ): Stats; + export function fstatSync( + fd: number, + options: StatOptions & { + bigint: true; + } + ): BigIntStats; + export function fstatSync(fd: number, options?: StatOptions): Stats | BigIntStats; + /** + * Retrieves the `fs.Stats` for the symbolic link referred to by the path. + * The callback gets two arguments `(err, stats)` where `stats` is a `fs.Stats` object. `lstat()` is identical to `stat()`, except that if `path` is a symbolic + * link, then the link itself is stat-ed, not the file that it refers to. + * + * See the POSIX [`lstat(2)`](http://man7.org/linux/man-pages/man2/lstat.2.html) documentation for more details. + * @since v0.1.30 + */ + export function lstat(path: PathLike, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void; + export function lstat( + path: PathLike, + options: + | (StatOptions & { + bigint?: false | undefined; + }) + | undefined, + callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void + ): void; + export function lstat( + path: PathLike, + options: StatOptions & { + bigint: true; + }, + callback: (err: NodeJS.ErrnoException | null, stats: BigIntStats) => void + ): void; + export function lstat(path: PathLike, options: StatOptions | undefined, callback: (err: NodeJS.ErrnoException | null, stats: Stats | BigIntStats) => void): void; + export namespace lstat { + /** + * Asynchronous lstat(2) - Get file status. Does not dereference symbolic links. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function __promisify__( + path: PathLike, + options?: StatOptions & { + bigint?: false | undefined; + } + ): Promise; + function __promisify__( + path: PathLike, + options: StatOptions & { + bigint: true; + } + ): Promise; + function __promisify__(path: PathLike, options?: StatOptions): Promise; + } + /** + * Asynchronous [`statfs(2)`](http://man7.org/linux/man-pages/man2/statfs.2.html). Returns information about the mounted file system which + * contains `path`. The callback gets two arguments `(err, stats)` where `stats`is an `fs.StatFs` object. + * + * In case of an error, the `err.code` will be one of `Common System Errors`. + * @since v19.6.0, v18.15.0 + * @param path A path to an existing file or directory on the file system to be queried. + */ + export function statfs(path: PathLike, callback: (err: NodeJS.ErrnoException | null, stats: StatsFs) => void): void; + export function statfs( + path: PathLike, + options: + | (StatFsOptions & { + bigint?: false | undefined; + }) + | undefined, + callback: (err: NodeJS.ErrnoException | null, stats: StatsFs) => void + ): void; + export function statfs( + path: PathLike, + options: StatFsOptions & { + bigint: true; + }, + callback: (err: NodeJS.ErrnoException | null, stats: BigIntStatsFs) => void + ): void; + export function statfs(path: PathLike, options: StatFsOptions | undefined, callback: (err: NodeJS.ErrnoException | null, stats: StatsFs | BigIntStatsFs) => void): void; + export namespace statfs { + /** + * Asynchronous statfs(2) - Returns information about the mounted file system which contains path. The callback gets two arguments (err, stats) where stats is an object. + * @param path A path to an existing file or directory on the file system to be queried. + */ + function __promisify__( + path: PathLike, + options?: StatFsOptions & { + bigint?: false | undefined; + } + ): Promise; + function __promisify__( + path: PathLike, + options: StatFsOptions & { + bigint: true; + } + ): Promise; + function __promisify__(path: PathLike, options?: StatFsOptions): Promise; + } + /** + * Synchronous [`statfs(2)`](http://man7.org/linux/man-pages/man2/statfs.2.html). Returns information about the mounted file system which + * contains `path`. + * + * In case of an error, the `err.code` will be one of `Common System Errors`. + * @since v19.6.0, v18.15.0 + * @param path A path to an existing file or directory on the file system to be queried. + */ + export function statfsSync( + path: PathLike, + options?: StatFsOptions & { + bigint?: false | undefined; + } + ): StatsFs; + export function statfsSync( + path: PathLike, + options: StatFsOptions & { + bigint: true; + } + ): BigIntStatsFs; + export function statfsSync(path: PathLike, options?: StatFsOptions): StatsFs | BigIntStatsFs; + /** + * Synchronous lstat(2) - Get file status. Does not dereference symbolic links. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export const lstatSync: StatSyncFn; + /** + * Creates a new link from the `existingPath` to the `newPath`. See the POSIX [`link(2)`](http://man7.org/linux/man-pages/man2/link.2.html) documentation for more detail. No arguments other than + * a possible + * exception are given to the completion callback. + * @since v0.1.31 + */ + export function link(existingPath: PathLike, newPath: PathLike, callback: NoParamCallback): void; + export namespace link { + /** + * Asynchronous link(2) - Create a new link (also known as a hard link) to an existing file. + * @param existingPath A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function __promisify__(existingPath: PathLike, newPath: PathLike): Promise; + } + /** + * Creates a new link from the `existingPath` to the `newPath`. See the POSIX [`link(2)`](http://man7.org/linux/man-pages/man2/link.2.html) documentation for more detail. Returns `undefined`. + * @since v0.1.31 + */ + export function linkSync(existingPath: PathLike, newPath: PathLike): void; + /** + * Creates the link called `path` pointing to `target`. No arguments other than a + * possible exception are given to the completion callback. + * + * See the POSIX [`symlink(2)`](http://man7.org/linux/man-pages/man2/symlink.2.html) documentation for more details. + * + * The `type` argument is only available on Windows and ignored on other platforms. + * It can be set to `'dir'`, `'file'`, or `'junction'`. If the `type` argument is + * not a string, Node.js will autodetect `target` type and use `'file'` or `'dir'`. + * If the `target` does not exist, `'file'` will be used. Windows junction points + * require the destination path to be absolute. When using `'junction'`, the`target` argument will automatically be normalized to absolute path. Junction + * points on NTFS volumes can only point to directories. + * + * Relative targets are relative to the link's parent directory. + * + * ```js + * import { symlink } from 'node:fs'; + * + * symlink('./mew', './mewtwo', callback); + * ``` + * + * The above example creates a symbolic link `mewtwo` which points to `mew` in the + * same directory: + * + * ```bash + * $ tree . + * . + * ├── mew + * └── mewtwo -> ./mew + * ``` + * @since v0.1.31 + * @param [type='null'] + */ + export function symlink(target: PathLike, path: PathLike, type: symlink.Type | undefined | null, callback: NoParamCallback): void; + /** + * Asynchronous symlink(2) - Create a new symbolic link to an existing file. + * @param target A path to an existing file. If a URL is provided, it must use the `file:` protocol. + * @param path A path to the new symlink. If a URL is provided, it must use the `file:` protocol. + */ + export function symlink(target: PathLike, path: PathLike, callback: NoParamCallback): void; + export namespace symlink { + /** + * Asynchronous symlink(2) - Create a new symbolic link to an existing file. + * @param target A path to an existing file. If a URL is provided, it must use the `file:` protocol. + * @param path A path to the new symlink. If a URL is provided, it must use the `file:` protocol. + * @param type May be set to `'dir'`, `'file'`, or `'junction'` (default is `'file'`) and is only available on Windows (ignored on other platforms). + * When using `'junction'`, the `target` argument will automatically be normalized to an absolute path. + */ + function __promisify__(target: PathLike, path: PathLike, type?: string | null): Promise; + type Type = 'dir' | 'file' | 'junction'; + } + /** + * Returns `undefined`. + * + * For detailed information, see the documentation of the asynchronous version of + * this API: {@link symlink}. + * @since v0.1.31 + * @param [type='null'] + */ + export function symlinkSync(target: PathLike, path: PathLike, type?: symlink.Type | null): void; + /** + * Reads the contents of the symbolic link referred to by `path`. The callback gets + * two arguments `(err, linkString)`. + * + * See the POSIX [`readlink(2)`](http://man7.org/linux/man-pages/man2/readlink.2.html) documentation for more details. + * + * The optional `options` argument can be a string specifying an encoding, or an + * object with an `encoding` property specifying the character encoding to use for + * the link path passed to the callback. If the `encoding` is set to `'buffer'`, + * the link path returned will be passed as a `Buffer` object. + * @since v0.1.31 + */ + export function readlink(path: PathLike, options: EncodingOption, callback: (err: NodeJS.ErrnoException | null, linkString: string) => void): void; + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readlink(path: PathLike, options: BufferEncodingOption, callback: (err: NodeJS.ErrnoException | null, linkString: Buffer) => void): void; + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readlink(path: PathLike, options: EncodingOption, callback: (err: NodeJS.ErrnoException | null, linkString: string | Buffer) => void): void; + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function readlink(path: PathLike, callback: (err: NodeJS.ErrnoException | null, linkString: string) => void): void; + export namespace readlink { + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function __promisify__(path: PathLike, options?: EncodingOption): Promise; + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function __promisify__(path: PathLike, options: BufferEncodingOption): Promise; + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function __promisify__(path: PathLike, options?: EncodingOption): Promise; + } + /** + * Returns the symbolic link's string value. + * + * See the POSIX [`readlink(2)`](http://man7.org/linux/man-pages/man2/readlink.2.html) documentation for more details. + * + * The optional `options` argument can be a string specifying an encoding, or an + * object with an `encoding` property specifying the character encoding to use for + * the link path returned. If the `encoding` is set to `'buffer'`, + * the link path returned will be passed as a `Buffer` object. + * @since v0.1.31 + */ + export function readlinkSync(path: PathLike, options?: EncodingOption): string; + /** + * Synchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readlinkSync(path: PathLike, options: BufferEncodingOption): Buffer; + /** + * Synchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readlinkSync(path: PathLike, options?: EncodingOption): string | Buffer; + /** + * Asynchronously computes the canonical pathname by resolving `.`, `..`, and + * symbolic links. + * + * A canonical pathname is not necessarily unique. Hard links and bind mounts can + * expose a file system entity through many pathnames. + * + * This function behaves like [`realpath(3)`](http://man7.org/linux/man-pages/man3/realpath.3.html), with some exceptions: + * + * 1. No case conversion is performed on case-insensitive file systems. + * 2. The maximum number of symbolic links is platform-independent and generally + * (much) higher than what the native [`realpath(3)`](http://man7.org/linux/man-pages/man3/realpath.3.html) implementation supports. + * + * The `callback` gets two arguments `(err, resolvedPath)`. May use `process.cwd`to resolve relative paths. + * + * Only paths that can be converted to UTF8 strings are supported. + * + * The optional `options` argument can be a string specifying an encoding, or an + * object with an `encoding` property specifying the character encoding to use for + * the path passed to the callback. If the `encoding` is set to `'buffer'`, + * the path returned will be passed as a `Buffer` object. + * + * If `path` resolves to a socket or a pipe, the function will return a system + * dependent name for that object. + * @since v0.1.31 + */ + export function realpath(path: PathLike, options: EncodingOption, callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void): void; + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function realpath(path: PathLike, options: BufferEncodingOption, callback: (err: NodeJS.ErrnoException | null, resolvedPath: Buffer) => void): void; + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function realpath(path: PathLike, options: EncodingOption, callback: (err: NodeJS.ErrnoException | null, resolvedPath: string | Buffer) => void): void; + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function realpath(path: PathLike, callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void): void; + export namespace realpath { + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function __promisify__(path: PathLike, options?: EncodingOption): Promise; + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function __promisify__(path: PathLike, options: BufferEncodingOption): Promise; + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function __promisify__(path: PathLike, options?: EncodingOption): Promise; + /** + * Asynchronous [`realpath(3)`](http://man7.org/linux/man-pages/man3/realpath.3.html). + * + * The `callback` gets two arguments `(err, resolvedPath)`. + * + * Only paths that can be converted to UTF8 strings are supported. + * + * The optional `options` argument can be a string specifying an encoding, or an + * object with an `encoding` property specifying the character encoding to use for + * the path passed to the callback. If the `encoding` is set to `'buffer'`, + * the path returned will be passed as a `Buffer` object. + * + * On Linux, when Node.js is linked against musl libc, the procfs file system must + * be mounted on `/proc` in order for this function to work. Glibc does not have + * this restriction. + * @since v9.2.0 + */ + function native(path: PathLike, options: EncodingOption, callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void): void; + function native(path: PathLike, options: BufferEncodingOption, callback: (err: NodeJS.ErrnoException | null, resolvedPath: Buffer) => void): void; + function native(path: PathLike, options: EncodingOption, callback: (err: NodeJS.ErrnoException | null, resolvedPath: string | Buffer) => void): void; + function native(path: PathLike, callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void): void; + } + /** + * Returns the resolved pathname. + * + * For detailed information, see the documentation of the asynchronous version of + * this API: {@link realpath}. + * @since v0.1.31 + */ + export function realpathSync(path: PathLike, options?: EncodingOption): string; + /** + * Synchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function realpathSync(path: PathLike, options: BufferEncodingOption): Buffer; + /** + * Synchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function realpathSync(path: PathLike, options?: EncodingOption): string | Buffer; + export namespace realpathSync { + function native(path: PathLike, options?: EncodingOption): string; + function native(path: PathLike, options: BufferEncodingOption): Buffer; + function native(path: PathLike, options?: EncodingOption): string | Buffer; + } + /** + * Asynchronously removes a file or symbolic link. No arguments other than a + * possible exception are given to the completion callback. + * + * ```js + * import { unlink } from 'node:fs'; + * // Assuming that 'path/file.txt' is a regular file. + * unlink('path/file.txt', (err) => { + * if (err) throw err; + * console.log('path/file.txt was deleted'); + * }); + * ``` + * + * `fs.unlink()` will not work on a directory, empty or otherwise. To remove a + * directory, use {@link rmdir}. + * + * See the POSIX [`unlink(2)`](http://man7.org/linux/man-pages/man2/unlink.2.html) documentation for more details. + * @since v0.0.2 + */ + export function unlink(path: PathLike, callback: NoParamCallback): void; + export namespace unlink { + /** + * Asynchronous unlink(2) - delete a name and possibly the file it refers to. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function __promisify__(path: PathLike): Promise; + } + /** + * Synchronous [`unlink(2)`](http://man7.org/linux/man-pages/man2/unlink.2.html). Returns `undefined`. + * @since v0.1.21 + */ + export function unlinkSync(path: PathLike): void; + export interface RmDirOptions { + /** + * If an `EBUSY`, `EMFILE`, `ENFILE`, `ENOTEMPTY`, or + * `EPERM` error is encountered, Node.js will retry the operation with a linear + * backoff wait of `retryDelay` ms longer on each try. This option represents the + * number of retries. This option is ignored if the `recursive` option is not + * `true`. + * @default 0 + */ + maxRetries?: number | undefined; + /** + * @deprecated since v14.14.0 In future versions of Node.js and will trigger a warning + * `fs.rmdir(path, { recursive: true })` will throw if `path` does not exist or is a file. + * Use `fs.rm(path, { recursive: true, force: true })` instead. + * + * If `true`, perform a recursive directory removal. In + * recursive mode, operations are retried on failure. + * @default false + */ + recursive?: boolean | undefined; + /** + * The amount of time in milliseconds to wait between retries. + * This option is ignored if the `recursive` option is not `true`. + * @default 100 + */ + retryDelay?: number | undefined; + } + /** + * Asynchronous [`rmdir(2)`](http://man7.org/linux/man-pages/man2/rmdir.2.html). No arguments other than a possible exception are given + * to the completion callback. + * + * Using `fs.rmdir()` on a file (not a directory) results in an `ENOENT` error on + * Windows and an `ENOTDIR` error on POSIX. + * + * To get a behavior similar to the `rm -rf` Unix command, use {@link rm} with options `{ recursive: true, force: true }`. + * @since v0.0.2 + */ + export function rmdir(path: PathLike, callback: NoParamCallback): void; + export function rmdir(path: PathLike, options: RmDirOptions, callback: NoParamCallback): void; + export namespace rmdir { + /** + * Asynchronous rmdir(2) - delete a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function __promisify__(path: PathLike, options?: RmDirOptions): Promise; + } + /** + * Synchronous [`rmdir(2)`](http://man7.org/linux/man-pages/man2/rmdir.2.html). Returns `undefined`. + * + * Using `fs.rmdirSync()` on a file (not a directory) results in an `ENOENT` error + * on Windows and an `ENOTDIR` error on POSIX. + * + * To get a behavior similar to the `rm -rf` Unix command, use {@link rmSync} with options `{ recursive: true, force: true }`. + * @since v0.1.21 + */ + export function rmdirSync(path: PathLike, options?: RmDirOptions): void; + export interface RmOptions { + /** + * When `true`, exceptions will be ignored if `path` does not exist. + * @default false + */ + force?: boolean | undefined; + /** + * If an `EBUSY`, `EMFILE`, `ENFILE`, `ENOTEMPTY`, or + * `EPERM` error is encountered, Node.js will retry the operation with a linear + * backoff wait of `retryDelay` ms longer on each try. This option represents the + * number of retries. This option is ignored if the `recursive` option is not + * `true`. + * @default 0 + */ + maxRetries?: number | undefined; + /** + * If `true`, perform a recursive directory removal. In + * recursive mode, operations are retried on failure. + * @default false + */ + recursive?: boolean | undefined; + /** + * The amount of time in milliseconds to wait between retries. + * This option is ignored if the `recursive` option is not `true`. + * @default 100 + */ + retryDelay?: number | undefined; + } + /** + * Asynchronously removes files and directories (modeled on the standard POSIX `rm`utility). No arguments other than a possible exception are given to the + * completion callback. + * @since v14.14.0 + */ + export function rm(path: PathLike, callback: NoParamCallback): void; + export function rm(path: PathLike, options: RmOptions, callback: NoParamCallback): void; + export namespace rm { + /** + * Asynchronously removes files and directories (modeled on the standard POSIX `rm` utility). + */ + function __promisify__(path: PathLike, options?: RmOptions): Promise; + } + /** + * Synchronously removes files and directories (modeled on the standard POSIX `rm`utility). Returns `undefined`. + * @since v14.14.0 + */ + export function rmSync(path: PathLike, options?: RmOptions): void; + export interface MakeDirectoryOptions { + /** + * Indicates whether parent folders should be created. + * If a folder was created, the path to the first created folder will be returned. + * @default false + */ + recursive?: boolean | undefined; + /** + * A file mode. If a string is passed, it is parsed as an octal integer. If not specified + * @default 0o777 + */ + mode?: Mode | undefined; + } + /** + * Asynchronously creates a directory. + * + * The callback is given a possible exception and, if `recursive` is `true`, the + * first directory path created, `(err[, path])`.`path` can still be `undefined` when `recursive` is `true`, if no directory was + * created (for instance, if it was previously created). + * + * The optional `options` argument can be an integer specifying `mode` (permission + * and sticky bits), or an object with a `mode` property and a `recursive`property indicating whether parent directories should be created. Calling`fs.mkdir()` when `path` is a directory that + * exists results in an error only + * when `recursive` is false. If `recursive` is false and the directory exists, + * an `EEXIST` error occurs. + * + * ```js + * import { mkdir } from 'node:fs'; + * + * // Create ./tmp/a/apple, regardless of whether ./tmp and ./tmp/a exist. + * mkdir('./tmp/a/apple', { recursive: true }, (err) => { + * if (err) throw err; + * }); + * ``` + * + * On Windows, using `fs.mkdir()` on the root directory even with recursion will + * result in an error: + * + * ```js + * import { mkdir } from 'node:fs'; + * + * mkdir('/', { recursive: true }, (err) => { + * // => [Error: EPERM: operation not permitted, mkdir 'C:\'] + * }); + * ``` + * + * See the POSIX [`mkdir(2)`](http://man7.org/linux/man-pages/man2/mkdir.2.html) documentation for more details. + * @since v0.1.8 + */ + export function mkdir( + path: PathLike, + options: MakeDirectoryOptions & { + recursive: true; + }, + callback: (err: NodeJS.ErrnoException | null, path?: string) => void + ): void; + /** + * Asynchronous mkdir(2) - create a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders + * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. + */ + export function mkdir( + path: PathLike, + options: + | Mode + | (MakeDirectoryOptions & { + recursive?: false | undefined; + }) + | null + | undefined, + callback: NoParamCallback + ): void; + /** + * Asynchronous mkdir(2) - create a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders + * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. + */ + export function mkdir(path: PathLike, options: Mode | MakeDirectoryOptions | null | undefined, callback: (err: NodeJS.ErrnoException | null, path?: string) => void): void; + /** + * Asynchronous mkdir(2) - create a directory with a mode of `0o777`. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function mkdir(path: PathLike, callback: NoParamCallback): void; + export namespace mkdir { + /** + * Asynchronous mkdir(2) - create a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders + * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. + */ + function __promisify__( + path: PathLike, + options: MakeDirectoryOptions & { + recursive: true; + } + ): Promise; + /** + * Asynchronous mkdir(2) - create a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders + * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. + */ + function __promisify__( + path: PathLike, + options?: + | Mode + | (MakeDirectoryOptions & { + recursive?: false | undefined; + }) + | null + ): Promise; + /** + * Asynchronous mkdir(2) - create a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders + * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. + */ + function __promisify__(path: PathLike, options?: Mode | MakeDirectoryOptions | null): Promise; + } + /** + * Synchronously creates a directory. Returns `undefined`, or if `recursive` is`true`, the first directory path created. + * This is the synchronous version of {@link mkdir}. + * + * See the POSIX [`mkdir(2)`](http://man7.org/linux/man-pages/man2/mkdir.2.html) documentation for more details. + * @since v0.1.21 + */ + export function mkdirSync( + path: PathLike, + options: MakeDirectoryOptions & { + recursive: true; + } + ): string | undefined; + /** + * Synchronous mkdir(2) - create a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders + * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. + */ + export function mkdirSync( + path: PathLike, + options?: + | Mode + | (MakeDirectoryOptions & { + recursive?: false | undefined; + }) + | null + ): void; + /** + * Synchronous mkdir(2) - create a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders + * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. + */ + export function mkdirSync(path: PathLike, options?: Mode | MakeDirectoryOptions | null): string | undefined; + /** + * Creates a unique temporary directory. + * + * Generates six random characters to be appended behind a required`prefix` to create a unique temporary directory. Due to platform + * inconsistencies, avoid trailing `X` characters in `prefix`. Some platforms, + * notably the BSDs, can return more than six random characters, and replace + * trailing `X` characters in `prefix` with random characters. + * + * The created directory path is passed as a string to the callback's second + * parameter. + * + * The optional `options` argument can be a string specifying an encoding, or an + * object with an `encoding` property specifying the character encoding to use. + * + * ```js + * import { mkdtemp } from 'node:fs'; + * import { join } from 'node:path'; + * import { tmpdir } from 'node:os'; + * + * mkdtemp(join(tmpdir(), 'foo-'), (err, directory) => { + * if (err) throw err; + * console.log(directory); + * // Prints: /tmp/foo-itXde2 or C:\Users\...\AppData\Local\Temp\foo-itXde2 + * }); + * ``` + * + * The `fs.mkdtemp()` method will append the six randomly selected characters + * directly to the `prefix` string. For instance, given a directory `/tmp`, if the + * intention is to create a temporary directory _within_`/tmp`, the `prefix`must end with a trailing platform-specific path separator + * (`require('node:path').sep`). + * + * ```js + * import { tmpdir } from 'node:os'; + * import { mkdtemp } from 'node:fs'; + * + * // The parent directory for the new temporary directory + * const tmpDir = tmpdir(); + * + * // This method is *INCORRECT*: + * mkdtemp(tmpDir, (err, directory) => { + * if (err) throw err; + * console.log(directory); + * // Will print something similar to `/tmpabc123`. + * // A new temporary directory is created at the file system root + * // rather than *within* the /tmp directory. + * }); + * + * // This method is *CORRECT*: + * import { sep } from 'node:path'; + * mkdtemp(`${tmpDir}${sep}`, (err, directory) => { + * if (err) throw err; + * console.log(directory); + * // Will print something similar to `/tmp/abc123`. + * // A new temporary directory is created within + * // the /tmp directory. + * }); + * ``` + * @since v5.10.0 + */ + export function mkdtemp(prefix: string, options: EncodingOption, callback: (err: NodeJS.ErrnoException | null, folder: string) => void): void; + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function mkdtemp( + prefix: string, + options: + | 'buffer' + | { + encoding: 'buffer'; + }, + callback: (err: NodeJS.ErrnoException | null, folder: Buffer) => void + ): void; + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function mkdtemp(prefix: string, options: EncodingOption, callback: (err: NodeJS.ErrnoException | null, folder: string | Buffer) => void): void; + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + */ + export function mkdtemp(prefix: string, callback: (err: NodeJS.ErrnoException | null, folder: string) => void): void; + export namespace mkdtemp { + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function __promisify__(prefix: string, options?: EncodingOption): Promise; + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function __promisify__(prefix: string, options: BufferEncodingOption): Promise; + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function __promisify__(prefix: string, options?: EncodingOption): Promise; + } + /** + * Returns the created directory path. + * + * For detailed information, see the documentation of the asynchronous version of + * this API: {@link mkdtemp}. + * + * The optional `options` argument can be a string specifying an encoding, or an + * object with an `encoding` property specifying the character encoding to use. + * @since v5.10.0 + */ + export function mkdtempSync(prefix: string, options?: EncodingOption): string; + /** + * Synchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function mkdtempSync(prefix: string, options: BufferEncodingOption): Buffer; + /** + * Synchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function mkdtempSync(prefix: string, options?: EncodingOption): string | Buffer; + /** + * Reads the contents of a directory. The callback gets two arguments `(err, files)`where `files` is an array of the names of the files in the directory excluding`'.'` and `'..'`. + * + * See the POSIX [`readdir(3)`](http://man7.org/linux/man-pages/man3/readdir.3.html) documentation for more details. + * + * The optional `options` argument can be a string specifying an encoding, or an + * object with an `encoding` property specifying the character encoding to use for + * the filenames passed to the callback. If the `encoding` is set to `'buffer'`, + * the filenames returned will be passed as `Buffer` objects. + * + * If `options.withFileTypes` is set to `true`, the `files` array will contain `fs.Dirent` objects. + * @since v0.1.8 + */ + export function readdir( + path: PathLike, + options: + | { + encoding: BufferEncoding | null; + withFileTypes?: false | undefined; + recursive?: boolean | undefined; + } + | BufferEncoding + | undefined + | null, + callback: (err: NodeJS.ErrnoException | null, files: string[]) => void + ): void; + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readdir( + path: PathLike, + options: + | { + encoding: 'buffer'; + withFileTypes?: false | undefined; + recursive?: boolean | undefined; + } + | 'buffer', + callback: (err: NodeJS.ErrnoException | null, files: Buffer[]) => void + ): void; + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readdir( + path: PathLike, + options: + | (ObjectEncodingOptions & { + withFileTypes?: false | undefined; + recursive?: boolean | undefined; + }) + | BufferEncoding + | undefined + | null, + callback: (err: NodeJS.ErrnoException | null, files: string[] | Buffer[]) => void + ): void; + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function readdir(path: PathLike, callback: (err: NodeJS.ErrnoException | null, files: string[]) => void): void; + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options If called with `withFileTypes: true` the result data will be an array of Dirent. + */ + export function readdir( + path: PathLike, + options: ObjectEncodingOptions & { + withFileTypes: true; + recursive?: boolean | undefined; + }, + callback: (err: NodeJS.ErrnoException | null, files: Dirent[]) => void + ): void; + export namespace readdir { + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function __promisify__( + path: PathLike, + options?: + | { + encoding: BufferEncoding | null; + withFileTypes?: false | undefined; + recursive?: boolean | undefined; + } + | BufferEncoding + | null + ): Promise; + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function __promisify__( + path: PathLike, + options: + | 'buffer' + | { + encoding: 'buffer'; + withFileTypes?: false | undefined; + recursive?: boolean | undefined; + } + ): Promise; + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function __promisify__( + path: PathLike, + options?: + | (ObjectEncodingOptions & { + withFileTypes?: false | undefined; + recursive?: boolean | undefined; + }) + | BufferEncoding + | null + ): Promise; + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options If called with `withFileTypes: true` the result data will be an array of Dirent + */ + function __promisify__( + path: PathLike, + options: ObjectEncodingOptions & { + withFileTypes: true; + recursive?: boolean | undefined; + } + ): Promise; + } + /** + * Reads the contents of the directory. + * + * See the POSIX [`readdir(3)`](http://man7.org/linux/man-pages/man3/readdir.3.html) documentation for more details. + * + * The optional `options` argument can be a string specifying an encoding, or an + * object with an `encoding` property specifying the character encoding to use for + * the filenames returned. If the `encoding` is set to `'buffer'`, + * the filenames returned will be passed as `Buffer` objects. + * + * If `options.withFileTypes` is set to `true`, the result will contain `fs.Dirent` objects. + * @since v0.1.21 + */ + export function readdirSync( + path: PathLike, + options?: + | { + encoding: BufferEncoding | null; + withFileTypes?: false | undefined; + recursive?: boolean | undefined; + } + | BufferEncoding + | null + ): string[]; + /** + * Synchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readdirSync( + path: PathLike, + options: + | { + encoding: 'buffer'; + withFileTypes?: false | undefined; + recursive?: boolean | undefined; + } + | 'buffer' + ): Buffer[]; + /** + * Synchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readdirSync( + path: PathLike, + options?: + | (ObjectEncodingOptions & { + withFileTypes?: false | undefined; + recursive?: boolean | undefined; + }) + | BufferEncoding + | null + ): string[] | Buffer[]; + /** + * Synchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options If called with `withFileTypes: true` the result data will be an array of Dirent. + */ + export function readdirSync( + path: PathLike, + options: ObjectEncodingOptions & { + withFileTypes: true; + recursive?: boolean | undefined; + } + ): Dirent[]; + /** + * Closes the file descriptor. No arguments other than a possible exception are + * given to the completion callback. + * + * Calling `fs.close()` on any file descriptor (`fd`) that is currently in use + * through any other `fs` operation may lead to undefined behavior. + * + * See the POSIX [`close(2)`](http://man7.org/linux/man-pages/man2/close.2.html) documentation for more detail. + * @since v0.0.2 + */ + export function close(fd: number, callback?: NoParamCallback): void; + export namespace close { + /** + * Asynchronous close(2) - close a file descriptor. + * @param fd A file descriptor. + */ + function __promisify__(fd: number): Promise; + } + /** + * Closes the file descriptor. Returns `undefined`. + * + * Calling `fs.closeSync()` on any file descriptor (`fd`) that is currently in use + * through any other `fs` operation may lead to undefined behavior. + * + * See the POSIX [`close(2)`](http://man7.org/linux/man-pages/man2/close.2.html) documentation for more detail. + * @since v0.1.21 + */ + export function closeSync(fd: number): void; + /** + * Asynchronous file open. See the POSIX [`open(2)`](http://man7.org/linux/man-pages/man2/open.2.html) documentation for more details. + * + * `mode` sets the file mode (permission and sticky bits), but only if the file was + * created. On Windows, only the write permission can be manipulated; see {@link chmod}. + * + * The callback gets two arguments `(err, fd)`. + * + * Some characters (`< > : " / \ | ? *`) are reserved under Windows as documented + * by [Naming Files, Paths, and Namespaces](https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file). Under NTFS, if the filename contains + * a colon, Node.js will open a file system stream, as described by [this MSDN page](https://docs.microsoft.com/en-us/windows/desktop/FileIO/using-streams). + * + * Functions based on `fs.open()` exhibit this behavior as well:`fs.writeFile()`, `fs.readFile()`, etc. + * @since v0.0.2 + * @param [flags='r'] See `support of file system `flags``. + * @param [mode=0o666] + */ + export function open(path: PathLike, flags: OpenMode | undefined, mode: Mode | undefined | null, callback: (err: NodeJS.ErrnoException | null, fd: number) => void): void; + /** + * Asynchronous open(2) - open and possibly create a file. If the file is created, its mode will be `0o666`. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param [flags='r'] See `support of file system `flags``. + */ + export function open(path: PathLike, flags: OpenMode | undefined, callback: (err: NodeJS.ErrnoException | null, fd: number) => void): void; + /** + * Asynchronous open(2) - open and possibly create a file. If the file is created, its mode will be `0o666`. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function open(path: PathLike, callback: (err: NodeJS.ErrnoException | null, fd: number) => void): void; + export namespace open { + /** + * Asynchronous open(2) - open and possibly create a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. If not supplied, defaults to `0o666`. + */ + function __promisify__(path: PathLike, flags: OpenMode, mode?: Mode | null): Promise; + } + /** + * Returns an integer representing the file descriptor. + * + * For detailed information, see the documentation of the asynchronous version of + * this API: {@link open}. + * @since v0.1.21 + * @param [flags='r'] + * @param [mode=0o666] + */ + export function openSync(path: PathLike, flags: OpenMode, mode?: Mode | null): number; + /** + * Change the file system timestamps of the object referenced by `path`. + * + * The `atime` and `mtime` arguments follow these rules: + * + * * Values can be either numbers representing Unix epoch time in seconds,`Date`s, or a numeric string like `'123456789.0'`. + * * If the value can not be converted to a number, or is `NaN`, `Infinity`, or`-Infinity`, an `Error` will be thrown. + * @since v0.4.2 + */ + export function utimes(path: PathLike, atime: TimeLike, mtime: TimeLike, callback: NoParamCallback): void; + export namespace utimes { + /** + * Asynchronously change file timestamps of the file referenced by the supplied path. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param atime The last access time. If a string is provided, it will be coerced to number. + * @param mtime The last modified time. If a string is provided, it will be coerced to number. + */ + function __promisify__(path: PathLike, atime: TimeLike, mtime: TimeLike): Promise; + } + /** + * Returns `undefined`. + * + * For detailed information, see the documentation of the asynchronous version of + * this API: {@link utimes}. + * @since v0.4.2 + */ + export function utimesSync(path: PathLike, atime: TimeLike, mtime: TimeLike): void; + /** + * Change the file system timestamps of the object referenced by the supplied file + * descriptor. See {@link utimes}. + * @since v0.4.2 + */ + export function futimes(fd: number, atime: TimeLike, mtime: TimeLike, callback: NoParamCallback): void; + export namespace futimes { + /** + * Asynchronously change file timestamps of the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param atime The last access time. If a string is provided, it will be coerced to number. + * @param mtime The last modified time. If a string is provided, it will be coerced to number. + */ + function __promisify__(fd: number, atime: TimeLike, mtime: TimeLike): Promise; + } + /** + * Synchronous version of {@link futimes}. Returns `undefined`. + * @since v0.4.2 + */ + export function futimesSync(fd: number, atime: TimeLike, mtime: TimeLike): void; + /** + * Request that all data for the open file descriptor is flushed to the storage + * device. The specific implementation is operating system and device specific. + * Refer to the POSIX [`fsync(2)`](http://man7.org/linux/man-pages/man2/fsync.2.html) documentation for more detail. No arguments other + * than a possible exception are given to the completion callback. + * @since v0.1.96 + */ + export function fsync(fd: number, callback: NoParamCallback): void; + export namespace fsync { + /** + * Asynchronous fsync(2) - synchronize a file's in-core state with the underlying storage device. + * @param fd A file descriptor. + */ + function __promisify__(fd: number): Promise; + } + /** + * Request that all data for the open file descriptor is flushed to the storage + * device. The specific implementation is operating system and device specific. + * Refer to the POSIX [`fsync(2)`](http://man7.org/linux/man-pages/man2/fsync.2.html) documentation for more detail. Returns `undefined`. + * @since v0.1.96 + */ + export function fsyncSync(fd: number): void; + /** + * Write `buffer` to the file specified by `fd`. + * + * `offset` determines the part of the buffer to be written, and `length` is + * an integer specifying the number of bytes to write. + * + * `position` refers to the offset from the beginning of the file where this data + * should be written. If `typeof position !== 'number'`, the data will be written + * at the current position. See [`pwrite(2)`](http://man7.org/linux/man-pages/man2/pwrite.2.html). + * + * The callback will be given three arguments `(err, bytesWritten, buffer)` where`bytesWritten` specifies how many _bytes_ were written from `buffer`. + * + * If this method is invoked as its `util.promisify()` ed version, it returns + * a promise for an `Object` with `bytesWritten` and `buffer` properties. + * + * It is unsafe to use `fs.write()` multiple times on the same file without waiting + * for the callback. For this scenario, {@link createWriteStream} is + * recommended. + * + * On Linux, positional writes don't work when the file is opened in append mode. + * The kernel ignores the position argument and always appends the data to + * the end of the file. + * @since v0.0.2 + * @param [offset=0] + * @param [length=buffer.byteLength - offset] + * @param [position='null'] + */ + export function write( + fd: number, + buffer: TBuffer, + offset: number | undefined | null, + length: number | undefined | null, + position: number | undefined | null, + callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void + ): void; + /** + * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param offset The part of the buffer to be written. If not supplied, defaults to `0`. + * @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`. + */ + export function write( + fd: number, + buffer: TBuffer, + offset: number | undefined | null, + length: number | undefined | null, + callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void + ): void; + /** + * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param offset The part of the buffer to be written. If not supplied, defaults to `0`. + */ + export function write( + fd: number, + buffer: TBuffer, + offset: number | undefined | null, + callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void + ): void; + /** + * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + */ + export function write(fd: number, buffer: TBuffer, callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void): void; + /** + * Asynchronously writes `string` to the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param string A string to write. + * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. + * @param encoding The expected string encoding. + */ + export function write( + fd: number, + string: string, + position: number | undefined | null, + encoding: BufferEncoding | undefined | null, + callback: (err: NodeJS.ErrnoException | null, written: number, str: string) => void + ): void; + /** + * Asynchronously writes `string` to the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param string A string to write. + * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. + */ + export function write(fd: number, string: string, position: number | undefined | null, callback: (err: NodeJS.ErrnoException | null, written: number, str: string) => void): void; + /** + * Asynchronously writes `string` to the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param string A string to write. + */ + export function write(fd: number, string: string, callback: (err: NodeJS.ErrnoException | null, written: number, str: string) => void): void; + export namespace write { + /** + * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param offset The part of the buffer to be written. If not supplied, defaults to `0`. + * @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`. + * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. + */ + function __promisify__( + fd: number, + buffer?: TBuffer, + offset?: number, + length?: number, + position?: number | null + ): Promise<{ + bytesWritten: number; + buffer: TBuffer; + }>; + /** + * Asynchronously writes `string` to the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param string A string to write. + * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. + * @param encoding The expected string encoding. + */ + function __promisify__( + fd: number, + string: string, + position?: number | null, + encoding?: BufferEncoding | null + ): Promise<{ + bytesWritten: number; + buffer: string; + }>; + } + /** + * For detailed information, see the documentation of the asynchronous version of + * this API: {@link write}. + * @since v0.1.21 + * @param [offset=0] + * @param [length=buffer.byteLength - offset] + * @param [position='null'] + * @return The number of bytes written. + */ + export function writeSync(fd: number, buffer: NodeJS.ArrayBufferView, offset?: number | null, length?: number | null, position?: number | null): number; + /** + * Synchronously writes `string` to the file referenced by the supplied file descriptor, returning the number of bytes written. + * @param fd A file descriptor. + * @param string A string to write. + * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. + * @param encoding The expected string encoding. + */ + export function writeSync(fd: number, string: string, position?: number | null, encoding?: BufferEncoding | null): number; + export type ReadPosition = number | bigint; + export interface ReadSyncOptions { + /** + * @default 0 + */ + offset?: number | undefined; + /** + * @default `length of buffer` + */ + length?: number | undefined; + /** + * @default null + */ + position?: ReadPosition | null | undefined; + } + export interface ReadAsyncOptions extends ReadSyncOptions { + buffer?: TBuffer; + } + /** + * Read data from the file specified by `fd`. + * + * The callback is given the three arguments, `(err, bytesRead, buffer)`. + * + * If the file is not modified concurrently, the end-of-file is reached when the + * number of bytes read is zero. + * + * If this method is invoked as its `util.promisify()` ed version, it returns + * a promise for an `Object` with `bytesRead` and `buffer` properties. + * @since v0.0.2 + * @param buffer The buffer that the data will be written to. + * @param offset The position in `buffer` to write the data to. + * @param length The number of bytes to read. + * @param position Specifies where to begin reading from in the file. If `position` is `null` or `-1 `, data will be read from the current file position, and the file position will be updated. If + * `position` is an integer, the file position will be unchanged. + */ + export function read( + fd: number, + buffer: TBuffer, + offset: number, + length: number, + position: ReadPosition | null, + callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: TBuffer) => void + ): void; + /** + * Similar to the above `fs.read` function, this version takes an optional `options` object. + * If not otherwise specified in an `options` object, + * `buffer` defaults to `Buffer.alloc(16384)`, + * `offset` defaults to `0`, + * `length` defaults to `buffer.byteLength`, `- offset` as of Node 17.6.0 + * `position` defaults to `null` + * @since v12.17.0, 13.11.0 + */ + export function read( + fd: number, + options: ReadAsyncOptions, + callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: TBuffer) => void + ): void; + export function read(fd: number, callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: NodeJS.ArrayBufferView) => void): void; + export namespace read { + /** + * @param fd A file descriptor. + * @param buffer The buffer that the data will be written to. + * @param offset The offset in the buffer at which to start writing. + * @param length The number of bytes to read. + * @param position The offset from the beginning of the file from which data should be read. If `null`, data will be read from the current position. + */ + function __promisify__( + fd: number, + buffer: TBuffer, + offset: number, + length: number, + position: number | null + ): Promise<{ + bytesRead: number; + buffer: TBuffer; + }>; + function __promisify__( + fd: number, + options: ReadAsyncOptions + ): Promise<{ + bytesRead: number; + buffer: TBuffer; + }>; + function __promisify__(fd: number): Promise<{ + bytesRead: number; + buffer: NodeJS.ArrayBufferView; + }>; + } + /** + * Returns the number of `bytesRead`. + * + * For detailed information, see the documentation of the asynchronous version of + * this API: {@link read}. + * @since v0.1.21 + * @param [position='null'] + */ + export function readSync(fd: number, buffer: NodeJS.ArrayBufferView, offset: number, length: number, position: ReadPosition | null): number; + /** + * Similar to the above `fs.readSync` function, this version takes an optional `options` object. + * If no `options` object is specified, it will default with the above values. + */ + export function readSync(fd: number, buffer: NodeJS.ArrayBufferView, opts?: ReadSyncOptions): number; + /** + * Asynchronously reads the entire contents of a file. + * + * ```js + * import { readFile } from 'node:fs'; + * + * readFile('/etc/passwd', (err, data) => { + * if (err) throw err; + * console.log(data); + * }); + * ``` + * + * The callback is passed two arguments `(err, data)`, where `data` is the + * contents of the file. + * + * If no encoding is specified, then the raw buffer is returned. + * + * If `options` is a string, then it specifies the encoding: + * + * ```js + * import { readFile } from 'node:fs'; + * + * readFile('/etc/passwd', 'utf8', callback); + * ``` + * + * When the path is a directory, the behavior of `fs.readFile()` and {@link readFileSync} is platform-specific. On macOS, Linux, and Windows, an + * error will be returned. On FreeBSD, a representation of the directory's contents + * will be returned. + * + * ```js + * import { readFile } from 'node:fs'; + * + * // macOS, Linux, and Windows + * readFile('', (err, data) => { + * // => [Error: EISDIR: illegal operation on a directory, read ] + * }); + * + * // FreeBSD + * readFile('', (err, data) => { + * // => null, + * }); + * ``` + * + * It is possible to abort an ongoing request using an `AbortSignal`. If a + * request is aborted the callback is called with an `AbortError`: + * + * ```js + * import { readFile } from 'node:fs'; + * + * const controller = new AbortController(); + * const signal = controller.signal; + * readFile(fileInfo[0].name, { signal }, (err, buf) => { + * // ... + * }); + * // When you want to abort the request + * controller.abort(); + * ``` + * + * The `fs.readFile()` function buffers the entire file. To minimize memory costs, + * when possible prefer streaming via `fs.createReadStream()`. + * + * Aborting an ongoing request does not abort individual operating + * system requests but rather the internal buffering `fs.readFile` performs. + * @since v0.1.29 + * @param path filename or file descriptor + */ + export function readFile( + path: PathOrFileDescriptor, + options: + | ({ + encoding?: null | undefined; + flag?: string | undefined; + } & Abortable) + | undefined + | null, + callback: (err: NodeJS.ErrnoException | null, data: Buffer) => void + ): void; + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + export function readFile( + path: PathOrFileDescriptor, + options: + | ({ + encoding: BufferEncoding; + flag?: string | undefined; + } & Abortable) + | BufferEncoding, + callback: (err: NodeJS.ErrnoException | null, data: string) => void + ): void; + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + export function readFile( + path: PathOrFileDescriptor, + options: + | (ObjectEncodingOptions & { + flag?: string | undefined; + } & Abortable) + | BufferEncoding + | undefined + | null, + callback: (err: NodeJS.ErrnoException | null, data: string | Buffer) => void + ): void; + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + */ + export function readFile(path: PathOrFileDescriptor, callback: (err: NodeJS.ErrnoException | null, data: Buffer) => void): void; + export namespace readFile { + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param options An object that may contain an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + function __promisify__( + path: PathOrFileDescriptor, + options?: { + encoding?: null | undefined; + flag?: string | undefined; + } | null + ): Promise; + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + function __promisify__( + path: PathOrFileDescriptor, + options: + | { + encoding: BufferEncoding; + flag?: string | undefined; + } + | BufferEncoding + ): Promise; + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + function __promisify__( + path: PathOrFileDescriptor, + options?: + | (ObjectEncodingOptions & { + flag?: string | undefined; + }) + | BufferEncoding + | null + ): Promise; + } + /** + * Returns the contents of the `path`. + * + * For detailed information, see the documentation of the asynchronous version of + * this API: {@link readFile}. + * + * If the `encoding` option is specified then this function returns a + * string. Otherwise it returns a buffer. + * + * Similar to {@link readFile}, when the path is a directory, the behavior of`fs.readFileSync()` is platform-specific. + * + * ```js + * import { readFileSync } from 'node:fs'; + * + * // macOS, Linux, and Windows + * readFileSync(''); + * // => [Error: EISDIR: illegal operation on a directory, read ] + * + * // FreeBSD + * readFileSync(''); // => + * ``` + * @since v0.1.8 + * @param path filename or file descriptor + */ + export function readFileSync( + path: PathOrFileDescriptor, + options?: { + encoding?: null | undefined; + flag?: string | undefined; + } | null + ): Buffer; + /** + * Synchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + export function readFileSync( + path: PathOrFileDescriptor, + options: + | { + encoding: BufferEncoding; + flag?: string | undefined; + } + | BufferEncoding + ): string; + /** + * Synchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + export function readFileSync( + path: PathOrFileDescriptor, + options?: + | (ObjectEncodingOptions & { + flag?: string | undefined; + }) + | BufferEncoding + | null + ): string | Buffer; + export type WriteFileOptions = + | (ObjectEncodingOptions & + Abortable & { + mode?: Mode | undefined; + flag?: string | undefined; + }) + | BufferEncoding + | null; + /** + * When `file` is a filename, asynchronously writes data to the file, replacing the + * file if it already exists. `data` can be a string or a buffer. + * + * When `file` is a file descriptor, the behavior is similar to calling`fs.write()` directly (which is recommended). See the notes below on using + * a file descriptor. + * + * The `encoding` option is ignored if `data` is a buffer. + * + * The `mode` option only affects the newly created file. See {@link open} for more details. + * + * ```js + * import { writeFile } from 'node:fs'; + * import { Buffer } from 'node:buffer'; + * + * const data = new Uint8Array(Buffer.from('Hello Node.js')); + * writeFile('message.txt', data, (err) => { + * if (err) throw err; + * console.log('The file has been saved!'); + * }); + * ``` + * + * If `options` is a string, then it specifies the encoding: + * + * ```js + * import { writeFile } from 'node:fs'; + * + * writeFile('message.txt', 'Hello Node.js', 'utf8', callback); + * ``` + * + * It is unsafe to use `fs.writeFile()` multiple times on the same file without + * waiting for the callback. For this scenario, {@link createWriteStream} is + * recommended. + * + * Similarly to `fs.readFile` \- `fs.writeFile` is a convenience method that + * performs multiple `write` calls internally to write the buffer passed to it. + * For performance sensitive code consider using {@link createWriteStream}. + * + * It is possible to use an `AbortSignal` to cancel an `fs.writeFile()`. + * Cancelation is "best effort", and some amount of data is likely still + * to be written. + * + * ```js + * import { writeFile } from 'node:fs'; + * import { Buffer } from 'node:buffer'; + * + * const controller = new AbortController(); + * const { signal } = controller; + * const data = new Uint8Array(Buffer.from('Hello Node.js')); + * writeFile('message.txt', data, { signal }, (err) => { + * // When a request is aborted - the callback is called with an AbortError + * }); + * // When the request should be aborted + * controller.abort(); + * ``` + * + * Aborting an ongoing request does not abort individual operating + * system requests but rather the internal buffering `fs.writeFile` performs. + * @since v0.1.29 + * @param file filename or file descriptor + */ + export function writeFile(file: PathOrFileDescriptor, data: string | NodeJS.ArrayBufferView, options: WriteFileOptions, callback: NoParamCallback): void; + /** + * Asynchronously writes data to a file, replacing the file if it already exists. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. + */ + export function writeFile(path: PathOrFileDescriptor, data: string | NodeJS.ArrayBufferView, callback: NoParamCallback): void; + export namespace writeFile { + /** + * Asynchronously writes data to a file, replacing the file if it already exists. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. + * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `mode` is not supplied, the default of `0o666` is used. + * If `mode` is a string, it is parsed as an octal integer. + * If `flag` is not supplied, the default of `'w'` is used. + */ + function __promisify__(path: PathOrFileDescriptor, data: string | NodeJS.ArrayBufferView, options?: WriteFileOptions): Promise; + } + /** + * Returns `undefined`. + * + * The `mode` option only affects the newly created file. See {@link open} for more details. + * + * For detailed information, see the documentation of the asynchronous version of + * this API: {@link writeFile}. + * @since v0.1.29 + * @param file filename or file descriptor + */ + export function writeFileSync(file: PathOrFileDescriptor, data: string | NodeJS.ArrayBufferView, options?: WriteFileOptions): void; + /** + * Asynchronously append data to a file, creating the file if it does not yet + * exist. `data` can be a string or a `Buffer`. + * + * The `mode` option only affects the newly created file. See {@link open} for more details. + * + * ```js + * import { appendFile } from 'node:fs'; + * + * appendFile('message.txt', 'data to append', (err) => { + * if (err) throw err; + * console.log('The "data to append" was appended to file!'); + * }); + * ``` + * + * If `options` is a string, then it specifies the encoding: + * + * ```js + * import { appendFile } from 'node:fs'; + * + * appendFile('message.txt', 'data to append', 'utf8', callback); + * ``` + * + * The `path` may be specified as a numeric file descriptor that has been opened + * for appending (using `fs.open()` or `fs.openSync()`). The file descriptor will + * not be closed automatically. + * + * ```js + * import { open, close, appendFile } from 'node:fs'; + * + * function closeFd(fd) { + * close(fd, (err) => { + * if (err) throw err; + * }); + * } + * + * open('message.txt', 'a', (err, fd) => { + * if (err) throw err; + * + * try { + * appendFile(fd, 'data to append', 'utf8', (err) => { + * closeFd(fd); + * if (err) throw err; + * }); + * } catch (err) { + * closeFd(fd); + * throw err; + * } + * }); + * ``` + * @since v0.6.7 + * @param path filename or file descriptor + */ + export function appendFile(path: PathOrFileDescriptor, data: string | Uint8Array, options: WriteFileOptions, callback: NoParamCallback): void; + /** + * Asynchronously append data to a file, creating the file if it does not exist. + * @param file A path to a file. If a URL is provided, it must use the `file:` protocol. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. + */ + export function appendFile(file: PathOrFileDescriptor, data: string | Uint8Array, callback: NoParamCallback): void; + export namespace appendFile { + /** + * Asynchronously append data to a file, creating the file if it does not exist. + * @param file A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. + * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `mode` is not supplied, the default of `0o666` is used. + * If `mode` is a string, it is parsed as an octal integer. + * If `flag` is not supplied, the default of `'a'` is used. + */ + function __promisify__(file: PathOrFileDescriptor, data: string | Uint8Array, options?: WriteFileOptions): Promise; + } + /** + * Synchronously append data to a file, creating the file if it does not yet + * exist. `data` can be a string or a `Buffer`. + * + * The `mode` option only affects the newly created file. See {@link open} for more details. + * + * ```js + * import { appendFileSync } from 'node:fs'; + * + * try { + * appendFileSync('message.txt', 'data to append'); + * console.log('The "data to append" was appended to file!'); + * } catch (err) { + * // Handle the error + * } + * ``` + * + * If `options` is a string, then it specifies the encoding: + * + * ```js + * import { appendFileSync } from 'node:fs'; + * + * appendFileSync('message.txt', 'data to append', 'utf8'); + * ``` + * + * The `path` may be specified as a numeric file descriptor that has been opened + * for appending (using `fs.open()` or `fs.openSync()`). The file descriptor will + * not be closed automatically. + * + * ```js + * import { openSync, closeSync, appendFileSync } from 'node:fs'; + * + * let fd; + * + * try { + * fd = openSync('message.txt', 'a'); + * appendFileSync(fd, 'data to append', 'utf8'); + * } catch (err) { + * // Handle the error + * } finally { + * if (fd !== undefined) + * closeSync(fd); + * } + * ``` + * @since v0.6.7 + * @param path filename or file descriptor + */ + export function appendFileSync(path: PathOrFileDescriptor, data: string | Uint8Array, options?: WriteFileOptions): void; + /** + * Watch for changes on `filename`. The callback `listener` will be called each + * time the file is accessed. + * + * The `options` argument may be omitted. If provided, it should be an object. The`options` object may contain a boolean named `persistent` that indicates + * whether the process should continue to run as long as files are being watched. + * The `options` object may specify an `interval` property indicating how often the + * target should be polled in milliseconds. + * + * The `listener` gets two arguments the current stat object and the previous + * stat object: + * + * ```js + * import { watchFile } from 'fs'; + * + * watchFile('message.text', (curr, prev) => { + * console.log(`the current mtime is: ${curr.mtime}`); + * console.log(`the previous mtime was: ${prev.mtime}`); + * }); + * ``` + * + * These stat objects are instances of `fs.Stat`. If the `bigint` option is `true`, + * the numeric values in these objects are specified as `BigInt`s. + * + * To be notified when the file was modified, not just accessed, it is necessary + * to compare `curr.mtimeMs` and `prev.mtimeMs`. + * + * When an `fs.watchFile` operation results in an `ENOENT` error, it + * will invoke the listener once, with all the fields zeroed (or, for dates, the + * Unix Epoch). If the file is created later on, the listener will be called + * again, with the latest stat objects. This is a change in functionality since + * v0.10. + * + * Using {@link watch} is more efficient than `fs.watchFile` and`fs.unwatchFile`. `fs.watch` should be used instead of `fs.watchFile` and`fs.unwatchFile` when possible. + * + * When a file being watched by `fs.watchFile()` disappears and reappears, + * then the contents of `previous` in the second callback event (the file's + * reappearance) will be the same as the contents of `previous` in the first + * callback event (its disappearance). + * + * This happens when: + * + * * the file is deleted, followed by a restore + * * the file is renamed and then renamed a second time back to its original name + * @since v0.1.31 + */ + export interface WatchFileOptions { + bigint?: boolean | undefined; + persistent?: boolean | undefined; + interval?: number | undefined; + } + /** + * Watch for changes on `filename`. The callback `listener` will be called each + * time the file is accessed. + * + * The `options` argument may be omitted. If provided, it should be an object. The`options` object may contain a boolean named `persistent` that indicates + * whether the process should continue to run as long as files are being watched. + * The `options` object may specify an `interval` property indicating how often the + * target should be polled in milliseconds. + * + * The `listener` gets two arguments the current stat object and the previous + * stat object: + * + * ```js + * import { watchFile } from 'node:fs'; + * + * watchFile('message.text', (curr, prev) => { + * console.log(`the current mtime is: ${curr.mtime}`); + * console.log(`the previous mtime was: ${prev.mtime}`); + * }); + * ``` + * + * These stat objects are instances of `fs.Stat`. If the `bigint` option is `true`, + * the numeric values in these objects are specified as `BigInt`s. + * + * To be notified when the file was modified, not just accessed, it is necessary + * to compare `curr.mtimeMs` and `prev.mtimeMs`. + * + * When an `fs.watchFile` operation results in an `ENOENT` error, it + * will invoke the listener once, with all the fields zeroed (or, for dates, the + * Unix Epoch). If the file is created later on, the listener will be called + * again, with the latest stat objects. This is a change in functionality since + * v0.10. + * + * Using {@link watch} is more efficient than `fs.watchFile` and`fs.unwatchFile`. `fs.watch` should be used instead of `fs.watchFile` and`fs.unwatchFile` when possible. + * + * When a file being watched by `fs.watchFile()` disappears and reappears, + * then the contents of `previous` in the second callback event (the file's + * reappearance) will be the same as the contents of `previous` in the first + * callback event (its disappearance). + * + * This happens when: + * + * * the file is deleted, followed by a restore + * * the file is renamed and then renamed a second time back to its original name + * @since v0.1.31 + */ + export function watchFile( + filename: PathLike, + options: + | (WatchFileOptions & { + bigint?: false | undefined; + }) + | undefined, + listener: StatsListener + ): StatWatcher; + export function watchFile( + filename: PathLike, + options: + | (WatchFileOptions & { + bigint: true; + }) + | undefined, + listener: BigIntStatsListener + ): StatWatcher; + /** + * Watch for changes on `filename`. The callback `listener` will be called each time the file is accessed. + * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + */ + export function watchFile(filename: PathLike, listener: StatsListener): StatWatcher; + /** + * Stop watching for changes on `filename`. If `listener` is specified, only that + * particular listener is removed. Otherwise, _all_ listeners are removed, + * effectively stopping watching of `filename`. + * + * Calling `fs.unwatchFile()` with a filename that is not being watched is a + * no-op, not an error. + * + * Using {@link watch} is more efficient than `fs.watchFile()` and`fs.unwatchFile()`. `fs.watch()` should be used instead of `fs.watchFile()`and `fs.unwatchFile()` when possible. + * @since v0.1.31 + * @param listener Optional, a listener previously attached using `fs.watchFile()` + */ + export function unwatchFile(filename: PathLike, listener?: StatsListener): void; + export function unwatchFile(filename: PathLike, listener?: BigIntStatsListener): void; + export interface WatchOptions extends Abortable { + encoding?: BufferEncoding | 'buffer' | undefined; + persistent?: boolean | undefined; + recursive?: boolean | undefined; + } + export type WatchEventType = 'rename' | 'change'; + export type WatchListener = (event: WatchEventType, filename: T | null) => void; + export type StatsListener = (curr: Stats, prev: Stats) => void; + export type BigIntStatsListener = (curr: BigIntStats, prev: BigIntStats) => void; + /** + * Watch for changes on `filename`, where `filename` is either a file or a + * directory. + * + * The second argument is optional. If `options` is provided as a string, it + * specifies the `encoding`. Otherwise `options` should be passed as an object. + * + * The listener callback gets two arguments `(eventType, filename)`. `eventType`is either `'rename'` or `'change'`, and `filename` is the name of the file + * which triggered the event. + * + * On most platforms, `'rename'` is emitted whenever a filename appears or + * disappears in the directory. + * + * The listener callback is attached to the `'change'` event fired by `fs.FSWatcher`, but it is not the same thing as the `'change'` value of`eventType`. + * + * If a `signal` is passed, aborting the corresponding AbortController will close + * the returned `fs.FSWatcher`. + * @since v0.5.10 + * @param listener + */ + export function watch( + filename: PathLike, + options: + | (WatchOptions & { + encoding: 'buffer'; + }) + | 'buffer', + listener?: WatchListener + ): FSWatcher; + /** + * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`. + * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `persistent` is not supplied, the default of `true` is used. + * If `recursive` is not supplied, the default of `false` is used. + */ + export function watch(filename: PathLike, options?: WatchOptions | BufferEncoding | null, listener?: WatchListener): FSWatcher; + /** + * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`. + * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `persistent` is not supplied, the default of `true` is used. + * If `recursive` is not supplied, the default of `false` is used. + */ + export function watch(filename: PathLike, options: WatchOptions | string, listener?: WatchListener): FSWatcher; + /** + * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`. + * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + */ + export function watch(filename: PathLike, listener?: WatchListener): FSWatcher; + /** + * Test whether or not the given path exists by checking with the file system. + * Then call the `callback` argument with either true or false: + * + * ```js + * import { exists } from 'node:fs'; + * + * exists('/etc/passwd', (e) => { + * console.log(e ? 'it exists' : 'no passwd!'); + * }); + * ``` + * + * **The parameters for this callback are not consistent with other Node.js** + * **callbacks.** Normally, the first parameter to a Node.js callback is an `err`parameter, optionally followed by other parameters. The `fs.exists()` callback + * has only one boolean parameter. This is one reason `fs.access()` is recommended + * instead of `fs.exists()`. + * + * Using `fs.exists()` to check for the existence of a file before calling`fs.open()`, `fs.readFile()`, or `fs.writeFile()` is not recommended. Doing + * so introduces a race condition, since other processes may change the file's + * state between the two calls. Instead, user code should open/read/write the + * file directly and handle the error raised if the file does not exist. + * + * **write (NOT RECOMMENDED)** + * + * ```js + * import { exists, open, close } from 'node:fs'; + * + * exists('myfile', (e) => { + * if (e) { + * console.error('myfile already exists'); + * } else { + * open('myfile', 'wx', (err, fd) => { + * if (err) throw err; + * + * try { + * writeMyData(fd); + * } finally { + * close(fd, (err) => { + * if (err) throw err; + * }); + * } + * }); + * } + * }); + * ``` + * + * **write (RECOMMENDED)** + * + * ```js + * import { open, close } from 'node:fs'; + * open('myfile', 'wx', (err, fd) => { + * if (err) { + * if (err.code === 'EEXIST') { + * console.error('myfile already exists'); + * return; + * } + * + * throw err; + * } + * + * try { + * writeMyData(fd); + * } finally { + * close(fd, (err) => { + * if (err) throw err; + * }); + * } + * }); + * ``` + * + * **read (NOT RECOMMENDED)** + * + * ```js + * import { open, close, exists } from 'node:fs'; + * + * exists('myfile', (e) => { + * if (e) { + * open('myfile', 'r', (err, fd) => { + * if (err) throw err; + * + * try { + * readMyData(fd); + * } finally { + * close(fd, (err) => { + * if (err) throw err; + * }); + * } + * }); + * } else { + * console.error('myfile does not exist'); + * } + * }); + * ``` + * + * **read (RECOMMENDED)** + * + * ```js + * import { open, close } from 'node:fs'; + * + * open('myfile', 'r', (err, fd) => { + * if (err) { + * if (err.code === 'ENOENT') { + * console.error('myfile does not exist'); + * return; + * } + * + * throw err; + * } + * + * try { + * readMyData(fd); + * } finally { + * close(fd, (err) => { + * if (err) throw err; + * }); + * } + * }); + * ``` + * + * The "not recommended" examples above check for existence and then use the + * file; the "recommended" examples are better because they use the file directly + * and handle the error, if any. + * + * In general, check for the existence of a file only if the file won't be + * used directly, for example when its existence is a signal from another + * process. + * @since v0.0.2 + * @deprecated Since v1.0.0 - Use {@link stat} or {@link access} instead. + */ + export function exists(path: PathLike, callback: (exists: boolean) => void): void; + /** @deprecated */ + export namespace exists { + /** + * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + function __promisify__(path: PathLike): Promise; + } + /** + * Returns `true` if the path exists, `false` otherwise. + * + * For detailed information, see the documentation of the asynchronous version of + * this API: {@link exists}. + * + * `fs.exists()` is deprecated, but `fs.existsSync()` is not. The `callback`parameter to `fs.exists()` accepts parameters that are inconsistent with other + * Node.js callbacks. `fs.existsSync()` does not use a callback. + * + * ```js + * import { existsSync } from 'node:fs'; + * + * if (existsSync('/etc/passwd')) + * console.log('The path exists.'); + * ``` + * @since v0.1.21 + */ + export function existsSync(path: PathLike): boolean; + export namespace constants { + // File Access Constants + /** Constant for fs.access(). File is visible to the calling process. */ + const F_OK: number; + /** Constant for fs.access(). File can be read by the calling process. */ + const R_OK: number; + /** Constant for fs.access(). File can be written by the calling process. */ + const W_OK: number; + /** Constant for fs.access(). File can be executed by the calling process. */ + const X_OK: number; + // File Copy Constants + /** Constant for fs.copyFile. Flag indicating the destination file should not be overwritten if it already exists. */ + const COPYFILE_EXCL: number; + /** + * Constant for fs.copyFile. copy operation will attempt to create a copy-on-write reflink. + * If the underlying platform does not support copy-on-write, then a fallback copy mechanism is used. + */ + const COPYFILE_FICLONE: number; + /** + * Constant for fs.copyFile. Copy operation will attempt to create a copy-on-write reflink. + * If the underlying platform does not support copy-on-write, then the operation will fail with an error. + */ + const COPYFILE_FICLONE_FORCE: number; + // File Open Constants + /** Constant for fs.open(). Flag indicating to open a file for read-only access. */ + const O_RDONLY: number; + /** Constant for fs.open(). Flag indicating to open a file for write-only access. */ + const O_WRONLY: number; + /** Constant for fs.open(). Flag indicating to open a file for read-write access. */ + const O_RDWR: number; + /** Constant for fs.open(). Flag indicating to create the file if it does not already exist. */ + const O_CREAT: number; + /** Constant for fs.open(). Flag indicating that opening a file should fail if the O_CREAT flag is set and the file already exists. */ + const O_EXCL: number; + /** + * Constant for fs.open(). Flag indicating that if path identifies a terminal device, + * opening the path shall not cause that terminal to become the controlling terminal for the process + * (if the process does not already have one). + */ + const O_NOCTTY: number; + /** Constant for fs.open(). Flag indicating that if the file exists and is a regular file, and the file is opened successfully for write access, its length shall be truncated to zero. */ + const O_TRUNC: number; + /** Constant for fs.open(). Flag indicating that data will be appended to the end of the file. */ + const O_APPEND: number; + /** Constant for fs.open(). Flag indicating that the open should fail if the path is not a directory. */ + const O_DIRECTORY: number; + /** + * constant for fs.open(). + * Flag indicating reading accesses to the file system will no longer result in + * an update to the atime information associated with the file. + * This flag is available on Linux operating systems only. + */ + const O_NOATIME: number; + /** Constant for fs.open(). Flag indicating that the open should fail if the path is a symbolic link. */ + const O_NOFOLLOW: number; + /** Constant for fs.open(). Flag indicating that the file is opened for synchronous I/O. */ + const O_SYNC: number; + /** Constant for fs.open(). Flag indicating that the file is opened for synchronous I/O with write operations waiting for data integrity. */ + const O_DSYNC: number; + /** Constant for fs.open(). Flag indicating to open the symbolic link itself rather than the resource it is pointing to. */ + const O_SYMLINK: number; + /** Constant for fs.open(). When set, an attempt will be made to minimize caching effects of file I/O. */ + const O_DIRECT: number; + /** Constant for fs.open(). Flag indicating to open the file in nonblocking mode when possible. */ + const O_NONBLOCK: number; + // File Type Constants + /** Constant for fs.Stats mode property for determining a file's type. Bit mask used to extract the file type code. */ + const S_IFMT: number; + /** Constant for fs.Stats mode property for determining a file's type. File type constant for a regular file. */ + const S_IFREG: number; + /** Constant for fs.Stats mode property for determining a file's type. File type constant for a directory. */ + const S_IFDIR: number; + /** Constant for fs.Stats mode property for determining a file's type. File type constant for a character-oriented device file. */ + const S_IFCHR: number; + /** Constant for fs.Stats mode property for determining a file's type. File type constant for a block-oriented device file. */ + const S_IFBLK: number; + /** Constant for fs.Stats mode property for determining a file's type. File type constant for a FIFO/pipe. */ + const S_IFIFO: number; + /** Constant for fs.Stats mode property for determining a file's type. File type constant for a symbolic link. */ + const S_IFLNK: number; + /** Constant for fs.Stats mode property for determining a file's type. File type constant for a socket. */ + const S_IFSOCK: number; + // File Mode Constants + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable, writable and executable by owner. */ + const S_IRWXU: number; + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable by owner. */ + const S_IRUSR: number; + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating writable by owner. */ + const S_IWUSR: number; + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating executable by owner. */ + const S_IXUSR: number; + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable, writable and executable by group. */ + const S_IRWXG: number; + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable by group. */ + const S_IRGRP: number; + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating writable by group. */ + const S_IWGRP: number; + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating executable by group. */ + const S_IXGRP: number; + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable, writable and executable by others. */ + const S_IRWXO: number; + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable by others. */ + const S_IROTH: number; + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating writable by others. */ + const S_IWOTH: number; + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating executable by others. */ + const S_IXOTH: number; + /** + * When set, a memory file mapping is used to access the file. This flag + * is available on Windows operating systems only. On other operating systems, + * this flag is ignored. + */ + const UV_FS_O_FILEMAP: number; + } + /** + * Tests a user's permissions for the file or directory specified by `path`. + * The `mode` argument is an optional integer that specifies the accessibility + * checks to be performed. `mode` should be either the value `fs.constants.F_OK`or a mask consisting of the bitwise OR of any of `fs.constants.R_OK`,`fs.constants.W_OK`, and `fs.constants.X_OK` + * (e.g.`fs.constants.W_OK | fs.constants.R_OK`). Check `File access constants` for + * possible values of `mode`. + * + * The final argument, `callback`, is a callback function that is invoked with + * a possible error argument. If any of the accessibility checks fail, the error + * argument will be an `Error` object. The following examples check if`package.json` exists, and if it is readable or writable. + * + * ```js + * import { access, constants } from 'node:fs'; + * + * const file = 'package.json'; + * + * // Check if the file exists in the current directory. + * access(file, constants.F_OK, (err) => { + * console.log(`${file} ${err ? 'does not exist' : 'exists'}`); + * }); + * + * // Check if the file is readable. + * access(file, constants.R_OK, (err) => { + * console.log(`${file} ${err ? 'is not readable' : 'is readable'}`); + * }); + * + * // Check if the file is writable. + * access(file, constants.W_OK, (err) => { + * console.log(`${file} ${err ? 'is not writable' : 'is writable'}`); + * }); + * + * // Check if the file is readable and writable. + * access(file, constants.R_OK | constants.W_OK, (err) => { + * console.log(`${file} ${err ? 'is not' : 'is'} readable and writable`); + * }); + * ``` + * + * Do not use `fs.access()` to check for the accessibility of a file before calling`fs.open()`, `fs.readFile()`, or `fs.writeFile()`. Doing + * so introduces a race condition, since other processes may change the file's + * state between the two calls. Instead, user code should open/read/write the + * file directly and handle the error raised if the file is not accessible. + * + * **write (NOT RECOMMENDED)** + * + * ```js + * import { access, open, close } from 'node:fs'; + * + * access('myfile', (err) => { + * if (!err) { + * console.error('myfile already exists'); + * return; + * } + * + * open('myfile', 'wx', (err, fd) => { + * if (err) throw err; + * + * try { + * writeMyData(fd); + * } finally { + * close(fd, (err) => { + * if (err) throw err; + * }); + * } + * }); + * }); + * ``` + * + * **write (RECOMMENDED)** + * + * ```js + * import { open, close } from 'node:fs'; + * + * open('myfile', 'wx', (err, fd) => { + * if (err) { + * if (err.code === 'EEXIST') { + * console.error('myfile already exists'); + * return; + * } + * + * throw err; + * } + * + * try { + * writeMyData(fd); + * } finally { + * close(fd, (err) => { + * if (err) throw err; + * }); + * } + * }); + * ``` + * + * **read (NOT RECOMMENDED)** + * + * ```js + * import { access, open, close } from 'node:fs'; + * access('myfile', (err) => { + * if (err) { + * if (err.code === 'ENOENT') { + * console.error('myfile does not exist'); + * return; + * } + * + * throw err; + * } + * + * open('myfile', 'r', (err, fd) => { + * if (err) throw err; + * + * try { + * readMyData(fd); + * } finally { + * close(fd, (err) => { + * if (err) throw err; + * }); + * } + * }); + * }); + * ``` + * + * **read (RECOMMENDED)** + * + * ```js + * import { open, close } from 'node:fs'; + * + * open('myfile', 'r', (err, fd) => { + * if (err) { + * if (err.code === 'ENOENT') { + * console.error('myfile does not exist'); + * return; + * } + * + * throw err; + * } + * + * try { + * readMyData(fd); + * } finally { + * close(fd, (err) => { + * if (err) throw err; + * }); + * } + * }); + * ``` + * + * The "not recommended" examples above check for accessibility and then use the + * file; the "recommended" examples are better because they use the file directly + * and handle the error, if any. + * + * In general, check for the accessibility of a file only if the file will not be + * used directly, for example when its accessibility is a signal from another + * process. + * + * On Windows, access-control policies (ACLs) on a directory may limit access to + * a file or directory. The `fs.access()` function, however, does not check the + * ACL and therefore may report that a path is accessible even if the ACL restricts + * the user from reading or writing to it. + * @since v0.11.15 + * @param [mode=fs.constants.F_OK] + */ + export function access(path: PathLike, mode: number | undefined, callback: NoParamCallback): void; + /** + * Asynchronously tests a user's permissions for the file specified by path. + * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + */ + export function access(path: PathLike, callback: NoParamCallback): void; + export namespace access { + /** + * Asynchronously tests a user's permissions for the file specified by path. + * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + function __promisify__(path: PathLike, mode?: number): Promise; + } + /** + * Synchronously tests a user's permissions for the file or directory specified + * by `path`. The `mode` argument is an optional integer that specifies the + * accessibility checks to be performed. `mode` should be either the value`fs.constants.F_OK` or a mask consisting of the bitwise OR of any of`fs.constants.R_OK`, `fs.constants.W_OK`, and + * `fs.constants.X_OK` (e.g.`fs.constants.W_OK | fs.constants.R_OK`). Check `File access constants` for + * possible values of `mode`. + * + * If any of the accessibility checks fail, an `Error` will be thrown. Otherwise, + * the method will return `undefined`. + * + * ```js + * import { accessSync, constants } from 'node:fs'; + * + * try { + * accessSync('etc/passwd', constants.R_OK | constants.W_OK); + * console.log('can read/write'); + * } catch (err) { + * console.error('no access!'); + * } + * ``` + * @since v0.11.15 + * @param [mode=fs.constants.F_OK] + */ + export function accessSync(path: PathLike, mode?: number): void; + interface StreamOptions { + flags?: string | undefined; + encoding?: BufferEncoding | undefined; + fd?: number | promises.FileHandle | undefined; + mode?: number | undefined; + autoClose?: boolean | undefined; + emitClose?: boolean | undefined; + start?: number | undefined; + signal?: AbortSignal | null | undefined; + highWaterMark?: number | undefined; + } + interface FSImplementation { + open?: (...args: any[]) => any; + close?: (...args: any[]) => any; + } + interface CreateReadStreamFSImplementation extends FSImplementation { + read: (...args: any[]) => any; + } + interface CreateWriteStreamFSImplementation extends FSImplementation { + write: (...args: any[]) => any; + writev?: (...args: any[]) => any; + } + interface ReadStreamOptions extends StreamOptions { + fs?: CreateReadStreamFSImplementation | null | undefined; + end?: number | undefined; + } + interface WriteStreamOptions extends StreamOptions { + fs?: CreateWriteStreamFSImplementation | null | undefined; + } + /** + * Unlike the 16 KiB default `highWaterMark` for a `stream.Readable`, the stream + * returned by this method has a default `highWaterMark` of 64 KiB. + * + * `options` can include `start` and `end` values to read a range of bytes from + * the file instead of the entire file. Both `start` and `end` are inclusive and + * start counting at 0, allowed values are in the + * \[0, [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER)\] range. If `fd` is specified and `start` is + * omitted or `undefined`, `fs.createReadStream()` reads sequentially from the + * current file position. The `encoding` can be any one of those accepted by `Buffer`. + * + * If `fd` is specified, `ReadStream` will ignore the `path` argument and will use + * the specified file descriptor. This means that no `'open'` event will be + * emitted. `fd` should be blocking; non-blocking `fd`s should be passed to `net.Socket`. + * + * If `fd` points to a character device that only supports blocking reads + * (such as keyboard or sound card), read operations do not finish until data is + * available. This can prevent the process from exiting and the stream from + * closing naturally. + * + * By default, the stream will emit a `'close'` event after it has been + * destroyed. Set the `emitClose` option to `false` to change this behavior. + * + * By providing the `fs` option, it is possible to override the corresponding `fs`implementations for `open`, `read`, and `close`. When providing the `fs` option, + * an override for `read` is required. If no `fd` is provided, an override for`open` is also required. If `autoClose` is `true`, an override for `close` is + * also required. + * + * ```js + * import { createReadStream } from 'node:fs'; + * + * // Create a stream from some character device. + * const stream = createReadStream('/dev/input/event0'); + * setTimeout(() => { + * stream.close(); // This may not close the stream. + * // Artificially marking end-of-stream, as if the underlying resource had + * // indicated end-of-file by itself, allows the stream to close. + * // This does not cancel pending read operations, and if there is such an + * // operation, the process may still not be able to exit successfully + * // until it finishes. + * stream.push(null); + * stream.read(0); + * }, 100); + * ``` + * + * If `autoClose` is false, then the file descriptor won't be closed, even if + * there's an error. It is the application's responsibility to close it and make + * sure there's no file descriptor leak. If `autoClose` is set to true (default + * behavior), on `'error'` or `'end'` the file descriptor will be closed + * automatically. + * + * `mode` sets the file mode (permission and sticky bits), but only if the + * file was created. + * + * An example to read the last 10 bytes of a file which is 100 bytes long: + * + * ```js + * import { createReadStream } from 'node:fs'; + * + * createReadStream('sample.txt', { start: 90, end: 99 }); + * ``` + * + * If `options` is a string, then it specifies the encoding. + * @since v0.1.31 + */ + export function createReadStream(path: PathLike, options?: BufferEncoding | ReadStreamOptions): ReadStream; + /** + * `options` may also include a `start` option to allow writing data at some + * position past the beginning of the file, allowed values are in the + * \[0, [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER)\] range. Modifying a file rather than + * replacing it may require the `flags` option to be set to `r+` rather than the + * default `w`. The `encoding` can be any one of those accepted by `Buffer`. + * + * If `autoClose` is set to true (default behavior) on `'error'` or `'finish'`the file descriptor will be closed automatically. If `autoClose` is false, + * then the file descriptor won't be closed, even if there's an error. + * It is the application's responsibility to close it and make sure there's no + * file descriptor leak. + * + * By default, the stream will emit a `'close'` event after it has been + * destroyed. Set the `emitClose` option to `false` to change this behavior. + * + * By providing the `fs` option it is possible to override the corresponding `fs`implementations for `open`, `write`, `writev`, and `close`. Overriding `write()`without `writev()` can reduce + * performance as some optimizations (`_writev()`) + * will be disabled. When providing the `fs` option, overrides for at least one of`write` and `writev` are required. If no `fd` option is supplied, an override + * for `open` is also required. If `autoClose` is `true`, an override for `close`is also required. + * + * Like `fs.ReadStream`, if `fd` is specified, `fs.WriteStream` will ignore the`path` argument and will use the specified file descriptor. This means that no`'open'` event will be + * emitted. `fd` should be blocking; non-blocking `fd`s + * should be passed to `net.Socket`. + * + * If `options` is a string, then it specifies the encoding. + * @since v0.1.31 + */ + export function createWriteStream(path: PathLike, options?: BufferEncoding | WriteStreamOptions): WriteStream; + /** + * Forces all currently queued I/O operations associated with the file to the + * operating system's synchronized I/O completion state. Refer to the POSIX [`fdatasync(2)`](http://man7.org/linux/man-pages/man2/fdatasync.2.html) documentation for details. No arguments other + * than a possible + * exception are given to the completion callback. + * @since v0.1.96 + */ + export function fdatasync(fd: number, callback: NoParamCallback): void; + export namespace fdatasync { + /** + * Asynchronous fdatasync(2) - synchronize a file's in-core state with storage device. + * @param fd A file descriptor. + */ + function __promisify__(fd: number): Promise; + } + /** + * Forces all currently queued I/O operations associated with the file to the + * operating system's synchronized I/O completion state. Refer to the POSIX [`fdatasync(2)`](http://man7.org/linux/man-pages/man2/fdatasync.2.html) documentation for details. Returns `undefined`. + * @since v0.1.96 + */ + export function fdatasyncSync(fd: number): void; + /** + * Asynchronously copies `src` to `dest`. By default, `dest` is overwritten if it + * already exists. No arguments other than a possible exception are given to the + * callback function. Node.js makes no guarantees about the atomicity of the copy + * operation. If an error occurs after the destination file has been opened for + * writing, Node.js will attempt to remove the destination. + * + * `mode` is an optional integer that specifies the behavior + * of the copy operation. It is possible to create a mask consisting of the bitwise + * OR of two or more values (e.g.`fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE`). + * + * * `fs.constants.COPYFILE_EXCL`: The copy operation will fail if `dest` already + * exists. + * * `fs.constants.COPYFILE_FICLONE`: The copy operation will attempt to create a + * copy-on-write reflink. If the platform does not support copy-on-write, then a + * fallback copy mechanism is used. + * * `fs.constants.COPYFILE_FICLONE_FORCE`: The copy operation will attempt to + * create a copy-on-write reflink. If the platform does not support + * copy-on-write, then the operation will fail. + * + * ```js + * import { copyFile, constants } from 'node:fs'; + * + * function callback(err) { + * if (err) throw err; + * console.log('source.txt was copied to destination.txt'); + * } + * + * // destination.txt will be created or overwritten by default. + * copyFile('source.txt', 'destination.txt', callback); + * + * // By using COPYFILE_EXCL, the operation will fail if destination.txt exists. + * copyFile('source.txt', 'destination.txt', constants.COPYFILE_EXCL, callback); + * ``` + * @since v8.5.0 + * @param src source filename to copy + * @param dest destination filename of the copy operation + * @param [mode=0] modifiers for copy operation. + */ + export function copyFile(src: PathLike, dest: PathLike, callback: NoParamCallback): void; + export function copyFile(src: PathLike, dest: PathLike, mode: number, callback: NoParamCallback): void; + export namespace copyFile { + function __promisify__(src: PathLike, dst: PathLike, mode?: number): Promise; + } + /** + * Synchronously copies `src` to `dest`. By default, `dest` is overwritten if it + * already exists. Returns `undefined`. Node.js makes no guarantees about the + * atomicity of the copy operation. If an error occurs after the destination file + * has been opened for writing, Node.js will attempt to remove the destination. + * + * `mode` is an optional integer that specifies the behavior + * of the copy operation. It is possible to create a mask consisting of the bitwise + * OR of two or more values (e.g.`fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE`). + * + * * `fs.constants.COPYFILE_EXCL`: The copy operation will fail if `dest` already + * exists. + * * `fs.constants.COPYFILE_FICLONE`: The copy operation will attempt to create a + * copy-on-write reflink. If the platform does not support copy-on-write, then a + * fallback copy mechanism is used. + * * `fs.constants.COPYFILE_FICLONE_FORCE`: The copy operation will attempt to + * create a copy-on-write reflink. If the platform does not support + * copy-on-write, then the operation will fail. + * + * ```js + * import { copyFileSync, constants } from 'node:fs'; + * + * // destination.txt will be created or overwritten by default. + * copyFileSync('source.txt', 'destination.txt'); + * console.log('source.txt was copied to destination.txt'); + * + * // By using COPYFILE_EXCL, the operation will fail if destination.txt exists. + * copyFileSync('source.txt', 'destination.txt', constants.COPYFILE_EXCL); + * ``` + * @since v8.5.0 + * @param src source filename to copy + * @param dest destination filename of the copy operation + * @param [mode=0] modifiers for copy operation. + */ + export function copyFileSync(src: PathLike, dest: PathLike, mode?: number): void; + /** + * Write an array of `ArrayBufferView`s to the file specified by `fd` using`writev()`. + * + * `position` is the offset from the beginning of the file where this data + * should be written. If `typeof position !== 'number'`, the data will be written + * at the current position. + * + * The callback will be given three arguments: `err`, `bytesWritten`, and`buffers`. `bytesWritten` is how many bytes were written from `buffers`. + * + * If this method is `util.promisify()` ed, it returns a promise for an`Object` with `bytesWritten` and `buffers` properties. + * + * It is unsafe to use `fs.writev()` multiple times on the same file without + * waiting for the callback. For this scenario, use {@link createWriteStream}. + * + * On Linux, positional writes don't work when the file is opened in append mode. + * The kernel ignores the position argument and always appends the data to + * the end of the file. + * @since v12.9.0 + * @param [position='null'] + */ + export function writev(fd: number, buffers: ReadonlyArray, cb: (err: NodeJS.ErrnoException | null, bytesWritten: number, buffers: NodeJS.ArrayBufferView[]) => void): void; + export function writev( + fd: number, + buffers: ReadonlyArray, + position: number, + cb: (err: NodeJS.ErrnoException | null, bytesWritten: number, buffers: NodeJS.ArrayBufferView[]) => void + ): void; + export interface WriteVResult { + bytesWritten: number; + buffers: NodeJS.ArrayBufferView[]; + } + export namespace writev { + function __promisify__(fd: number, buffers: ReadonlyArray, position?: number): Promise; + } + /** + * For detailed information, see the documentation of the asynchronous version of + * this API: {@link writev}. + * @since v12.9.0 + * @param [position='null'] + * @return The number of bytes written. + */ + export function writevSync(fd: number, buffers: ReadonlyArray, position?: number): number; + /** + * Read from a file specified by `fd` and write to an array of `ArrayBufferView`s + * using `readv()`. + * + * `position` is the offset from the beginning of the file from where data + * should be read. If `typeof position !== 'number'`, the data will be read + * from the current position. + * + * The callback will be given three arguments: `err`, `bytesRead`, and`buffers`. `bytesRead` is how many bytes were read from the file. + * + * If this method is invoked as its `util.promisify()` ed version, it returns + * a promise for an `Object` with `bytesRead` and `buffers` properties. + * @since v13.13.0, v12.17.0 + * @param [position='null'] + */ + export function readv(fd: number, buffers: ReadonlyArray, cb: (err: NodeJS.ErrnoException | null, bytesRead: number, buffers: NodeJS.ArrayBufferView[]) => void): void; + export function readv( + fd: number, + buffers: ReadonlyArray, + position: number, + cb: (err: NodeJS.ErrnoException | null, bytesRead: number, buffers: NodeJS.ArrayBufferView[]) => void + ): void; + export interface ReadVResult { + bytesRead: number; + buffers: NodeJS.ArrayBufferView[]; + } + export namespace readv { + function __promisify__(fd: number, buffers: ReadonlyArray, position?: number): Promise; + } + /** + * For detailed information, see the documentation of the asynchronous version of + * this API: {@link readv}. + * @since v13.13.0, v12.17.0 + * @param [position='null'] + * @return The number of bytes read. + */ + export function readvSync(fd: number, buffers: ReadonlyArray, position?: number): number; + + export interface OpenAsBlobOptions { + /** + * An optional mime type for the blob. + * + * @default 'undefined' + */ + type?: string | undefined; + } + + /** + * Returns a `Blob` whose data is backed by the given file. + * + * The file must not be modified after the `Blob` is created. Any modifications + * will cause reading the `Blob` data to fail with a `DOMException` error. + * Synchronous stat operations on the file when the `Blob` is created, and before + * each read in order to detect whether the file data has been modified on disk. + * + * ```js + * import { openAsBlob } from 'node:fs'; + * + * const blob = await openAsBlob('the.file.txt'); + * const ab = await blob.arrayBuffer(); + * blob.stream(); + * ``` + * @since v19.8.0 + * @experimental + */ + export function openAsBlob(path: PathLike, options?: OpenAsBlobOptions): Promise; + + export interface OpenDirOptions { + /** + * @default 'utf8' + */ + encoding?: BufferEncoding | undefined; + /** + * Number of directory entries that are buffered + * internally when reading from the directory. Higher values lead to better + * performance but higher memory usage. + * @default 32 + */ + bufferSize?: number | undefined; + /** + * @default false + */ + recursive?: boolean; + } + /** + * Synchronously open a directory. See [`opendir(3)`](http://man7.org/linux/man-pages/man3/opendir.3.html). + * + * Creates an `fs.Dir`, which contains all further functions for reading from + * and cleaning up the directory. + * + * The `encoding` option sets the encoding for the `path` while opening the + * directory and subsequent read operations. + * @since v12.12.0 + */ + export function opendirSync(path: PathLike, options?: OpenDirOptions): Dir; + /** + * Asynchronously open a directory. See the POSIX [`opendir(3)`](http://man7.org/linux/man-pages/man3/opendir.3.html) documentation for + * more details. + * + * Creates an `fs.Dir`, which contains all further functions for reading from + * and cleaning up the directory. + * + * The `encoding` option sets the encoding for the `path` while opening the + * directory and subsequent read operations. + * @since v12.12.0 + */ + export function opendir(path: PathLike, cb: (err: NodeJS.ErrnoException | null, dir: Dir) => void): void; + export function opendir(path: PathLike, options: OpenDirOptions, cb: (err: NodeJS.ErrnoException | null, dir: Dir) => void): void; + export namespace opendir { + function __promisify__(path: PathLike, options?: OpenDirOptions): Promise; + } + export interface BigIntStats extends StatsBase { + atimeNs: bigint; + mtimeNs: bigint; + ctimeNs: bigint; + birthtimeNs: bigint; + } + export interface BigIntOptions { + bigint: true; + } + export interface StatOptions { + bigint?: boolean | undefined; + } + export interface StatSyncOptions extends StatOptions { + throwIfNoEntry?: boolean | undefined; + } + interface CopyOptionsBase { + /** + * Dereference symlinks + * @default false + */ + dereference?: boolean; + /** + * When `force` is `false`, and the destination + * exists, throw an error. + * @default false + */ + errorOnExist?: boolean; + /** + * Overwrite existing file or directory. _The copy + * operation will ignore errors if you set this to false and the destination + * exists. Use the `errorOnExist` option to change this behavior. + * @default true + */ + force?: boolean; + /** + * Modifiers for copy operation. See `mode` flag of {@link copyFileSync()} + */ + mode?: number; + /** + * When `true` timestamps from `src` will + * be preserved. + * @default false + */ + preserveTimestamps?: boolean; + /** + * Copy directories recursively. + * @default false + */ + recursive?: boolean; + /** + * When true, path resolution for symlinks will be skipped + * @default false + */ + verbatimSymlinks?: boolean; + } + export interface CopyOptions extends CopyOptionsBase { + /** + * Function to filter copied files/directories. Return + * `true` to copy the item, `false` to ignore it. + */ + filter?(source: string, destination: string): boolean | Promise; + } + export interface CopySyncOptions extends CopyOptionsBase { + /** + * Function to filter copied files/directories. Return + * `true` to copy the item, `false` to ignore it. + */ + filter?(source: string, destination: string): boolean; + } + /** + * Asynchronously copies the entire directory structure from `src` to `dest`, + * including subdirectories and files. + * + * When copying a directory to another directory, globs are not supported and + * behavior is similar to `cp dir1/ dir2/`. + * @since v16.7.0 + * @experimental + * @param src source path to copy. + * @param dest destination path to copy to. + */ + export function cp(source: string | URL, destination: string | URL, callback: (err: NodeJS.ErrnoException | null) => void): void; + export function cp(source: string | URL, destination: string | URL, opts: CopyOptions, callback: (err: NodeJS.ErrnoException | null) => void): void; + /** + * Synchronously copies the entire directory structure from `src` to `dest`, + * including subdirectories and files. + * + * When copying a directory to another directory, globs are not supported and + * behavior is similar to `cp dir1/ dir2/`. + * @since v16.7.0 + * @experimental + * @param src source path to copy. + * @param dest destination path to copy to. + */ + export function cpSync(source: string | URL, destination: string | URL, opts?: CopySyncOptions): void; +} +declare module 'fs' { + export * from 'node:fs'; +} diff --git a/node_modules/@types/node/fs/promises.d.ts b/node_modules/@types/node/fs/promises.d.ts new file mode 100644 index 0000000..cec8322 --- /dev/null +++ b/node_modules/@types/node/fs/promises.d.ts @@ -0,0 +1,1203 @@ +/** + * The `fs/promises` API provides asynchronous file system methods that return + * promises. + * + * The promise APIs use the underlying Node.js threadpool to perform file + * system operations off the event loop thread. These operations are not + * synchronized or threadsafe. Care must be taken when performing multiple + * concurrent modifications on the same file or data corruption may occur. + * @since v10.0.0 + */ +declare module 'node:fs/promises' { + import { Abortable } from 'node:events'; + import { Stream } from 'node:stream'; + import { ReadableStream } from 'node:stream/web'; + import { + BigIntStats, + BigIntStatsFs, + BufferEncodingOption, + constants as fsConstants, + CopyOptions, + Dir, + Dirent, + MakeDirectoryOptions, + Mode, + ObjectEncodingOptions, + OpenDirOptions, + OpenMode, + PathLike, + ReadStream, + ReadVResult, + RmDirOptions, + RmOptions, + StatOptions, + StatFsOptions, + Stats, + StatsFs, + TimeLike, + WatchEventType, + WatchOptions, + WriteStream, + WriteVResult, + } from 'node:fs'; + import { Interface as ReadlineInterface } from 'node:readline'; + interface FileChangeInfo { + eventType: WatchEventType; + filename: T | null; + } + interface FlagAndOpenMode { + mode?: Mode | undefined; + flag?: OpenMode | undefined; + } + interface FileReadResult { + bytesRead: number; + buffer: T; + } + interface FileReadOptions { + /** + * @default `Buffer.alloc(0xffff)` + */ + buffer?: T; + /** + * @default 0 + */ + offset?: number | null; + /** + * @default `buffer.byteLength` + */ + length?: number | null; + position?: number | null; + } + interface CreateReadStreamOptions { + encoding?: BufferEncoding | null | undefined; + autoClose?: boolean | undefined; + emitClose?: boolean | undefined; + start?: number | undefined; + end?: number | undefined; + highWaterMark?: number | undefined; + } + interface CreateWriteStreamOptions { + encoding?: BufferEncoding | null | undefined; + autoClose?: boolean | undefined; + emitClose?: boolean | undefined; + start?: number | undefined; + highWaterMark?: number | undefined; + } + interface ReadableWebStreamOptions { + /** + * Whether to open a normal or a `'bytes'` stream. + * @since v20.0.0 + */ + type?: 'bytes' | undefined; + } + // TODO: Add `EventEmitter` close + interface FileHandle { + /** + * The numeric file descriptor managed by the {FileHandle} object. + * @since v10.0.0 + */ + readonly fd: number; + /** + * Alias of `filehandle.writeFile()`. + * + * When operating on file handles, the mode cannot be changed from what it was set + * to with `fsPromises.open()`. Therefore, this is equivalent to `filehandle.writeFile()`. + * @since v10.0.0 + * @return Fulfills with `undefined` upon success. + */ + appendFile(data: string | Uint8Array, options?: (ObjectEncodingOptions & FlagAndOpenMode) | BufferEncoding | null): Promise; + /** + * Changes the ownership of the file. A wrapper for [`chown(2)`](http://man7.org/linux/man-pages/man2/chown.2.html). + * @since v10.0.0 + * @param uid The file's new owner's user id. + * @param gid The file's new group's group id. + * @return Fulfills with `undefined` upon success. + */ + chown(uid: number, gid: number): Promise; + /** + * Modifies the permissions on the file. See [`chmod(2)`](http://man7.org/linux/man-pages/man2/chmod.2.html). + * @since v10.0.0 + * @param mode the file mode bit mask. + * @return Fulfills with `undefined` upon success. + */ + chmod(mode: Mode): Promise; + /** + * Unlike the 16 KiB default `highWaterMark` for a `stream.Readable`, the stream + * returned by this method has a default `highWaterMark` of 64 KiB. + * + * `options` can include `start` and `end` values to read a range of bytes from + * the file instead of the entire file. Both `start` and `end` are inclusive and + * start counting at 0, allowed values are in the + * \[0, [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER)\] range. If `start` is + * omitted or `undefined`, `filehandle.createReadStream()` reads sequentially from + * the current file position. The `encoding` can be any one of those accepted by `Buffer`. + * + * If the `FileHandle` points to a character device that only supports blocking + * reads (such as keyboard or sound card), read operations do not finish until data + * is available. This can prevent the process from exiting and the stream from + * closing naturally. + * + * By default, the stream will emit a `'close'` event after it has been + * destroyed. Set the `emitClose` option to `false` to change this behavior. + * + * ```js + * import { open } from 'node:fs/promises'; + * + * const fd = await open('/dev/input/event0'); + * // Create a stream from some character device. + * const stream = fd.createReadStream(); + * setTimeout(() => { + * stream.close(); // This may not close the stream. + * // Artificially marking end-of-stream, as if the underlying resource had + * // indicated end-of-file by itself, allows the stream to close. + * // This does not cancel pending read operations, and if there is such an + * // operation, the process may still not be able to exit successfully + * // until it finishes. + * stream.push(null); + * stream.read(0); + * }, 100); + * ``` + * + * If `autoClose` is false, then the file descriptor won't be closed, even if + * there's an error. It is the application's responsibility to close it and make + * sure there's no file descriptor leak. If `autoClose` is set to true (default + * behavior), on `'error'` or `'end'` the file descriptor will be closed + * automatically. + * + * An example to read the last 10 bytes of a file which is 100 bytes long: + * + * ```js + * import { open } from 'node:fs/promises'; + * + * const fd = await open('sample.txt'); + * fd.createReadStream({ start: 90, end: 99 }); + * ``` + * @since v16.11.0 + */ + createReadStream(options?: CreateReadStreamOptions): ReadStream; + /** + * `options` may also include a `start` option to allow writing data at some + * position past the beginning of the file, allowed values are in the + * \[0, [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER)\] range. Modifying a file rather than + * replacing it may require the `flags` `open` option to be set to `r+` rather than + * the default `r`. The `encoding` can be any one of those accepted by `Buffer`. + * + * If `autoClose` is set to true (default behavior) on `'error'` or `'finish'`the file descriptor will be closed automatically. If `autoClose` is false, + * then the file descriptor won't be closed, even if there's an error. + * It is the application's responsibility to close it and make sure there's no + * file descriptor leak. + * + * By default, the stream will emit a `'close'` event after it has been + * destroyed. Set the `emitClose` option to `false` to change this behavior. + * @since v16.11.0 + */ + createWriteStream(options?: CreateWriteStreamOptions): WriteStream; + /** + * Forces all currently queued I/O operations associated with the file to the + * operating system's synchronized I/O completion state. Refer to the POSIX [`fdatasync(2)`](http://man7.org/linux/man-pages/man2/fdatasync.2.html) documentation for details. + * + * Unlike `filehandle.sync` this method does not flush modified metadata. + * @since v10.0.0 + * @return Fulfills with `undefined` upon success. + */ + datasync(): Promise; + /** + * Request that all data for the open file descriptor is flushed to the storage + * device. The specific implementation is operating system and device specific. + * Refer to the POSIX [`fsync(2)`](http://man7.org/linux/man-pages/man2/fsync.2.html) documentation for more detail. + * @since v10.0.0 + * @return Fulfills with `undefined` upon success. + */ + sync(): Promise; + /** + * Reads data from the file and stores that in the given buffer. + * + * If the file is not modified concurrently, the end-of-file is reached when the + * number of bytes read is zero. + * @since v10.0.0 + * @param buffer A buffer that will be filled with the file data read. + * @param offset The location in the buffer at which to start filling. + * @param length The number of bytes to read. + * @param position The location where to begin reading data from the file. If `null`, data will be read from the current file position, and the position will be updated. If `position` is an + * integer, the current file position will remain unchanged. + * @return Fulfills upon success with an object with two properties: + */ + read(buffer: T, offset?: number | null, length?: number | null, position?: number | null): Promise>; + read(options?: FileReadOptions): Promise>; + /** + * Returns a `ReadableStream` that may be used to read the files data. + * + * An error will be thrown if this method is called more than once or is called + * after the `FileHandle` is closed or closing. + * + * ```js + * import { + * open, + * } from 'node:fs/promises'; + * + * const file = await open('./some/file/to/read'); + * + * for await (const chunk of file.readableWebStream()) + * console.log(chunk); + * + * await file.close(); + * ``` + * + * While the `ReadableStream` will read the file to completion, it will not + * close the `FileHandle` automatically. User code must still call the`fileHandle.close()` method. + * @since v17.0.0 + * @experimental + */ + readableWebStream(options?: ReadableWebStreamOptions): ReadableStream; + /** + * Asynchronously reads the entire contents of a file. + * + * If `options` is a string, then it specifies the `encoding`. + * + * The `FileHandle` has to support reading. + * + * If one or more `filehandle.read()` calls are made on a file handle and then a`filehandle.readFile()` call is made, the data will be read from the current + * position till the end of the file. It doesn't always read from the beginning + * of the file. + * @since v10.0.0 + * @return Fulfills upon a successful read with the contents of the file. If no encoding is specified (using `options.encoding`), the data is returned as a {Buffer} object. Otherwise, the + * data will be a string. + */ + readFile( + options?: { + encoding?: null | undefined; + flag?: OpenMode | undefined; + } | null + ): Promise; + /** + * Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically. + * The `FileHandle` must have been opened for reading. + * @param options An object that may contain an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + readFile( + options: + | { + encoding: BufferEncoding; + flag?: OpenMode | undefined; + } + | BufferEncoding + ): Promise; + /** + * Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically. + * The `FileHandle` must have been opened for reading. + * @param options An object that may contain an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + readFile( + options?: + | (ObjectEncodingOptions & { + flag?: OpenMode | undefined; + }) + | BufferEncoding + | null + ): Promise; + /** + * Convenience method to create a `readline` interface and stream over the file. + * See `filehandle.createReadStream()` for the options. + * + * ```js + * import { open } from 'node:fs/promises'; + * + * const file = await open('./some/file/to/read'); + * + * for await (const line of file.readLines()) { + * console.log(line); + * } + * ``` + * @since v18.11.0 + */ + readLines(options?: CreateReadStreamOptions): ReadlineInterface; + /** + * @since v10.0.0 + * @return Fulfills with an {fs.Stats} for the file. + */ + stat( + opts?: StatOptions & { + bigint?: false | undefined; + } + ): Promise; + stat( + opts: StatOptions & { + bigint: true; + } + ): Promise; + stat(opts?: StatOptions): Promise; + /** + * Truncates the file. + * + * If the file was larger than `len` bytes, only the first `len` bytes will be + * retained in the file. + * + * The following example retains only the first four bytes of the file: + * + * ```js + * import { open } from 'node:fs/promises'; + * + * let filehandle = null; + * try { + * filehandle = await open('temp.txt', 'r+'); + * await filehandle.truncate(4); + * } finally { + * await filehandle?.close(); + * } + * ``` + * + * If the file previously was shorter than `len` bytes, it is extended, and the + * extended part is filled with null bytes (`'\0'`): + * + * If `len` is negative then `0` will be used. + * @since v10.0.0 + * @param [len=0] + * @return Fulfills with `undefined` upon success. + */ + truncate(len?: number): Promise; + /** + * Change the file system timestamps of the object referenced by the `FileHandle` then resolves the promise with no arguments upon success. + * @since v10.0.0 + */ + utimes(atime: TimeLike, mtime: TimeLike): Promise; + /** + * Asynchronously writes data to a file, replacing the file if it already exists.`data` can be a string, a buffer, an + * [AsyncIterable](https://tc39.github.io/ecma262/#sec-asynciterable-interface), or an + * [Iterable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#The_iterable_protocol) object. + * The promise is resolved with no arguments upon success. + * + * If `options` is a string, then it specifies the `encoding`. + * + * The `FileHandle` has to support writing. + * + * It is unsafe to use `filehandle.writeFile()` multiple times on the same file + * without waiting for the promise to be resolved (or rejected). + * + * If one or more `filehandle.write()` calls are made on a file handle and then a`filehandle.writeFile()` call is made, the data will be written from the + * current position till the end of the file. It doesn't always write from the + * beginning of the file. + * @since v10.0.0 + */ + writeFile(data: string | Uint8Array, options?: (ObjectEncodingOptions & FlagAndOpenMode & Abortable) | BufferEncoding | null): Promise; + /** + * Write `buffer` to the file. + * + * The promise is resolved with an object containing two properties: + * + * It is unsafe to use `filehandle.write()` multiple times on the same file + * without waiting for the promise to be resolved (or rejected). For this + * scenario, use `filehandle.createWriteStream()`. + * + * On Linux, positional writes do not work when the file is opened in append mode. + * The kernel ignores the position argument and always appends the data to + * the end of the file. + * @since v10.0.0 + * @param offset The start position from within `buffer` where the data to write begins. + * @param [length=buffer.byteLength - offset] The number of bytes from `buffer` to write. + * @param [position='null'] The offset from the beginning of the file where the data from `buffer` should be written. If `position` is not a `number`, the data will be written at the current + * position. See the POSIX pwrite(2) documentation for more detail. + */ + write( + buffer: TBuffer, + offset?: number | null, + length?: number | null, + position?: number | null + ): Promise<{ + bytesWritten: number; + buffer: TBuffer; + }>; + write( + data: string, + position?: number | null, + encoding?: BufferEncoding | null + ): Promise<{ + bytesWritten: number; + buffer: string; + }>; + /** + * Write an array of [ArrayBufferView](https://developer.mozilla.org/en-US/docs/Web/API/ArrayBufferView) s to the file. + * + * The promise is resolved with an object containing a two properties: + * + * It is unsafe to call `writev()` multiple times on the same file without waiting + * for the promise to be resolved (or rejected). + * + * On Linux, positional writes don't work when the file is opened in append mode. + * The kernel ignores the position argument and always appends the data to + * the end of the file. + * @since v12.9.0 + * @param [position='null'] The offset from the beginning of the file where the data from `buffers` should be written. If `position` is not a `number`, the data will be written at the current + * position. + */ + writev(buffers: ReadonlyArray, position?: number): Promise; + /** + * Read from a file and write to an array of [ArrayBufferView](https://developer.mozilla.org/en-US/docs/Web/API/ArrayBufferView) s + * @since v13.13.0, v12.17.0 + * @param [position='null'] The offset from the beginning of the file where the data should be read from. If `position` is not a `number`, the data will be read from the current position. + * @return Fulfills upon success an object containing two properties: + */ + readv(buffers: ReadonlyArray, position?: number): Promise; + /** + * Closes the file handle after waiting for any pending operation on the handle to + * complete. + * + * ```js + * import { open } from 'node:fs/promises'; + * + * let filehandle; + * try { + * filehandle = await open('thefile.txt', 'r'); + * } finally { + * await filehandle?.close(); + * } + * ``` + * @since v10.0.0 + * @return Fulfills with `undefined` upon success. + */ + close(): Promise; + /** + * An alias for {@link FileHandle.close()}. + * @since v20.4.0 + */ + [Symbol.asyncDispose](): Promise; + } + const constants: typeof fsConstants; + /** + * Tests a user's permissions for the file or directory specified by `path`. + * The `mode` argument is an optional integer that specifies the accessibility + * checks to be performed. `mode` should be either the value `fs.constants.F_OK`or a mask consisting of the bitwise OR of any of `fs.constants.R_OK`,`fs.constants.W_OK`, and `fs.constants.X_OK` + * (e.g.`fs.constants.W_OK | fs.constants.R_OK`). Check `File access constants` for + * possible values of `mode`. + * + * If the accessibility check is successful, the promise is resolved with no + * value. If any of the accessibility checks fail, the promise is rejected + * with an [Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) object. The following example checks if the file`/etc/passwd` can be read and + * written by the current process. + * + * ```js + * import { access, constants } from 'node:fs/promises'; + * + * try { + * await access('/etc/passwd', constants.R_OK | constants.W_OK); + * console.log('can access'); + * } catch { + * console.error('cannot access'); + * } + * ``` + * + * Using `fsPromises.access()` to check for the accessibility of a file before + * calling `fsPromises.open()` is not recommended. Doing so introduces a race + * condition, since other processes may change the file's state between the two + * calls. Instead, user code should open/read/write the file directly and handle + * the error raised if the file is not accessible. + * @since v10.0.0 + * @param [mode=fs.constants.F_OK] + * @return Fulfills with `undefined` upon success. + */ + function access(path: PathLike, mode?: number): Promise; + /** + * Asynchronously copies `src` to `dest`. By default, `dest` is overwritten if it + * already exists. + * + * No guarantees are made about the atomicity of the copy operation. If an + * error occurs after the destination file has been opened for writing, an attempt + * will be made to remove the destination. + * + * ```js + * import { copyFile, constants } from 'node:fs/promises'; + * + * try { + * await copyFile('source.txt', 'destination.txt'); + * console.log('source.txt was copied to destination.txt'); + * } catch { + * console.error('The file could not be copied'); + * } + * + * // By using COPYFILE_EXCL, the operation will fail if destination.txt exists. + * try { + * await copyFile('source.txt', 'destination.txt', constants.COPYFILE_EXCL); + * console.log('source.txt was copied to destination.txt'); + * } catch { + * console.error('The file could not be copied'); + * } + * ``` + * @since v10.0.0 + * @param src source filename to copy + * @param dest destination filename of the copy operation + * @param [mode=0] Optional modifiers that specify the behavior of the copy operation. It is possible to create a mask consisting of the bitwise OR of two or more values (e.g. + * `fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE`) + * @return Fulfills with `undefined` upon success. + */ + function copyFile(src: PathLike, dest: PathLike, mode?: number): Promise; + /** + * Opens a `FileHandle`. + * + * Refer to the POSIX [`open(2)`](http://man7.org/linux/man-pages/man2/open.2.html) documentation for more detail. + * + * Some characters (`< > : " / \ | ? *`) are reserved under Windows as documented + * by [Naming Files, Paths, and Namespaces](https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file). Under NTFS, if the filename contains + * a colon, Node.js will open a file system stream, as described by [this MSDN page](https://docs.microsoft.com/en-us/windows/desktop/FileIO/using-streams). + * @since v10.0.0 + * @param [flags='r'] See `support of file system `flags``. + * @param [mode=0o666] Sets the file mode (permission and sticky bits) if the file is created. + * @return Fulfills with a {FileHandle} object. + */ + function open(path: PathLike, flags?: string | number, mode?: Mode): Promise; + /** + * Renames `oldPath` to `newPath`. + * @since v10.0.0 + * @return Fulfills with `undefined` upon success. + */ + function rename(oldPath: PathLike, newPath: PathLike): Promise; + /** + * Truncates (shortens or extends the length) of the content at `path` to `len`bytes. + * @since v10.0.0 + * @param [len=0] + * @return Fulfills with `undefined` upon success. + */ + function truncate(path: PathLike, len?: number): Promise; + /** + * Removes the directory identified by `path`. + * + * Using `fsPromises.rmdir()` on a file (not a directory) results in the + * promise being rejected with an `ENOENT` error on Windows and an `ENOTDIR`error on POSIX. + * + * To get a behavior similar to the `rm -rf` Unix command, use `fsPromises.rm()` with options `{ recursive: true, force: true }`. + * @since v10.0.0 + * @return Fulfills with `undefined` upon success. + */ + function rmdir(path: PathLike, options?: RmDirOptions): Promise; + /** + * Removes files and directories (modeled on the standard POSIX `rm` utility). + * @since v14.14.0 + * @return Fulfills with `undefined` upon success. + */ + function rm(path: PathLike, options?: RmOptions): Promise; + /** + * Asynchronously creates a directory. + * + * The optional `options` argument can be an integer specifying `mode` (permission + * and sticky bits), or an object with a `mode` property and a `recursive`property indicating whether parent directories should be created. Calling`fsPromises.mkdir()` when `path` is a directory + * that exists results in a + * rejection only when `recursive` is false. + * + * ```js + * import { mkdir } from 'node:fs/promises'; + * + * try { + * const projectFolder = new URL('./test/project/', import.meta.url); + * const createDir = await mkdir(projectFolder, { recursive: true }); + * + * console.log(`created ${createDir}`); + * } catch (err) { + * console.error(err.message); + * } + * ``` + * @since v10.0.0 + * @return Upon success, fulfills with `undefined` if `recursive` is `false`, or the first directory path created if `recursive` is `true`. + */ + function mkdir( + path: PathLike, + options: MakeDirectoryOptions & { + recursive: true; + } + ): Promise; + /** + * Asynchronous mkdir(2) - create a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders + * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. + */ + function mkdir( + path: PathLike, + options?: + | Mode + | (MakeDirectoryOptions & { + recursive?: false | undefined; + }) + | null + ): Promise; + /** + * Asynchronous mkdir(2) - create a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders + * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. + */ + function mkdir(path: PathLike, options?: Mode | MakeDirectoryOptions | null): Promise; + /** + * Reads the contents of a directory. + * + * The optional `options` argument can be a string specifying an encoding, or an + * object with an `encoding` property specifying the character encoding to use for + * the filenames. If the `encoding` is set to `'buffer'`, the filenames returned + * will be passed as `Buffer` objects. + * + * If `options.withFileTypes` is set to `true`, the resolved array will contain `fs.Dirent` objects. + * + * ```js + * import { readdir } from 'node:fs/promises'; + * + * try { + * const files = await readdir(path); + * for (const file of files) + * console.log(file); + * } catch (err) { + * console.error(err); + * } + * ``` + * @since v10.0.0 + * @return Fulfills with an array of the names of the files in the directory excluding `'.'` and `'..'`. + */ + function readdir( + path: PathLike, + options?: + | (ObjectEncodingOptions & { + withFileTypes?: false | undefined; + recursive?: boolean | undefined; + }) + | BufferEncoding + | null + ): Promise; + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function readdir( + path: PathLike, + options: + | { + encoding: 'buffer'; + withFileTypes?: false | undefined; + recursive?: boolean | undefined; + } + | 'buffer' + ): Promise; + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function readdir( + path: PathLike, + options?: + | (ObjectEncodingOptions & { + withFileTypes?: false | undefined; + recursive?: boolean | undefined; + }) + | BufferEncoding + | null + ): Promise; + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options If called with `withFileTypes: true` the result data will be an array of Dirent. + */ + function readdir( + path: PathLike, + options: ObjectEncodingOptions & { + withFileTypes: true; + recursive?: boolean | undefined; + } + ): Promise; + /** + * Reads the contents of the symbolic link referred to by `path`. See the POSIX [`readlink(2)`](http://man7.org/linux/man-pages/man2/readlink.2.html) documentation for more detail. The promise is + * resolved with the`linkString` upon success. + * + * The optional `options` argument can be a string specifying an encoding, or an + * object with an `encoding` property specifying the character encoding to use for + * the link path returned. If the `encoding` is set to `'buffer'`, the link path + * returned will be passed as a `Buffer` object. + * @since v10.0.0 + * @return Fulfills with the `linkString` upon success. + */ + function readlink(path: PathLike, options?: ObjectEncodingOptions | BufferEncoding | null): Promise; + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function readlink(path: PathLike, options: BufferEncodingOption): Promise; + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function readlink(path: PathLike, options?: ObjectEncodingOptions | string | null): Promise; + /** + * Creates a symbolic link. + * + * The `type` argument is only used on Windows platforms and can be one of `'dir'`,`'file'`, or `'junction'`. If the `type` argument is not a string, Node.js will + * autodetect `target` type and use `'file'` or `'dir'`. If the `target` does not + * exist, `'file'` will be used. Windows junction points require the destination + * path to be absolute. When using `'junction'`, the `target` argument will + * automatically be normalized to absolute path. Junction points on NTFS volumes + * can only point to directories. + * @since v10.0.0 + * @param [type='null'] + * @return Fulfills with `undefined` upon success. + */ + function symlink(target: PathLike, path: PathLike, type?: string | null): Promise; + /** + * Equivalent to `fsPromises.stat()` unless `path` refers to a symbolic link, + * in which case the link itself is stat-ed, not the file that it refers to. + * Refer to the POSIX [`lstat(2)`](http://man7.org/linux/man-pages/man2/lstat.2.html) document for more detail. + * @since v10.0.0 + * @return Fulfills with the {fs.Stats} object for the given symbolic link `path`. + */ + function lstat( + path: PathLike, + opts?: StatOptions & { + bigint?: false | undefined; + } + ): Promise; + function lstat( + path: PathLike, + opts: StatOptions & { + bigint: true; + } + ): Promise; + function lstat(path: PathLike, opts?: StatOptions): Promise; + /** + * @since v10.0.0 + * @return Fulfills with the {fs.Stats} object for the given `path`. + */ + function stat( + path: PathLike, + opts?: StatOptions & { + bigint?: false | undefined; + } + ): Promise; + function stat( + path: PathLike, + opts: StatOptions & { + bigint: true; + } + ): Promise; + function stat(path: PathLike, opts?: StatOptions): Promise; + /** + * @since v19.6.0, v18.15.0 + * @return Fulfills with the {fs.StatFs} object for the given `path`. + */ + function statfs( + path: PathLike, + opts?: StatFsOptions & { + bigint?: false | undefined; + } + ): Promise; + function statfs( + path: PathLike, + opts: StatFsOptions & { + bigint: true; + } + ): Promise; + function statfs(path: PathLike, opts?: StatFsOptions): Promise; + /** + * Creates a new link from the `existingPath` to the `newPath`. See the POSIX [`link(2)`](http://man7.org/linux/man-pages/man2/link.2.html) documentation for more detail. + * @since v10.0.0 + * @return Fulfills with `undefined` upon success. + */ + function link(existingPath: PathLike, newPath: PathLike): Promise; + /** + * If `path` refers to a symbolic link, then the link is removed without affecting + * the file or directory to which that link refers. If the `path` refers to a file + * path that is not a symbolic link, the file is deleted. See the POSIX [`unlink(2)`](http://man7.org/linux/man-pages/man2/unlink.2.html) documentation for more detail. + * @since v10.0.0 + * @return Fulfills with `undefined` upon success. + */ + function unlink(path: PathLike): Promise; + /** + * Changes the permissions of a file. + * @since v10.0.0 + * @return Fulfills with `undefined` upon success. + */ + function chmod(path: PathLike, mode: Mode): Promise; + /** + * Changes the permissions on a symbolic link. + * + * This method is only implemented on macOS. + * @deprecated Since v10.0.0 + * @return Fulfills with `undefined` upon success. + */ + function lchmod(path: PathLike, mode: Mode): Promise; + /** + * Changes the ownership on a symbolic link. + * @since v10.0.0 + * @return Fulfills with `undefined` upon success. + */ + function lchown(path: PathLike, uid: number, gid: number): Promise; + /** + * Changes the access and modification times of a file in the same way as `fsPromises.utimes()`, with the difference that if the path refers to a + * symbolic link, then the link is not dereferenced: instead, the timestamps of + * the symbolic link itself are changed. + * @since v14.5.0, v12.19.0 + * @return Fulfills with `undefined` upon success. + */ + function lutimes(path: PathLike, atime: TimeLike, mtime: TimeLike): Promise; + /** + * Changes the ownership of a file. + * @since v10.0.0 + * @return Fulfills with `undefined` upon success. + */ + function chown(path: PathLike, uid: number, gid: number): Promise; + /** + * Change the file system timestamps of the object referenced by `path`. + * + * The `atime` and `mtime` arguments follow these rules: + * + * * Values can be either numbers representing Unix epoch time, `Date`s, or a + * numeric string like `'123456789.0'`. + * * If the value can not be converted to a number, or is `NaN`, `Infinity`, or`-Infinity`, an `Error` will be thrown. + * @since v10.0.0 + * @return Fulfills with `undefined` upon success. + */ + function utimes(path: PathLike, atime: TimeLike, mtime: TimeLike): Promise; + /** + * Determines the actual location of `path` using the same semantics as the`fs.realpath.native()` function. + * + * Only paths that can be converted to UTF8 strings are supported. + * + * The optional `options` argument can be a string specifying an encoding, or an + * object with an `encoding` property specifying the character encoding to use for + * the path. If the `encoding` is set to `'buffer'`, the path returned will be + * passed as a `Buffer` object. + * + * On Linux, when Node.js is linked against musl libc, the procfs file system must + * be mounted on `/proc` in order for this function to work. Glibc does not have + * this restriction. + * @since v10.0.0 + * @return Fulfills with the resolved path upon success. + */ + function realpath(path: PathLike, options?: ObjectEncodingOptions | BufferEncoding | null): Promise; + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function realpath(path: PathLike, options: BufferEncodingOption): Promise; + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function realpath(path: PathLike, options?: ObjectEncodingOptions | BufferEncoding | null): Promise; + /** + * Creates a unique temporary directory. A unique directory name is generated by + * appending six random characters to the end of the provided `prefix`. Due to + * platform inconsistencies, avoid trailing `X` characters in `prefix`. Some + * platforms, notably the BSDs, can return more than six random characters, and + * replace trailing `X` characters in `prefix` with random characters. + * + * The optional `options` argument can be a string specifying an encoding, or an + * object with an `encoding` property specifying the character encoding to use. + * + * ```js + * import { mkdtemp } from 'node:fs/promises'; + * import { join } from 'node:path'; + * import { tmpdir } from 'node:os'; + * + * try { + * await mkdtemp(join(tmpdir(), 'foo-')); + * } catch (err) { + * console.error(err); + * } + * ``` + * + * The `fsPromises.mkdtemp()` method will append the six randomly selected + * characters directly to the `prefix` string. For instance, given a directory`/tmp`, if the intention is to create a temporary directory _within_`/tmp`, the`prefix` must end with a trailing + * platform-specific path separator + * (`require('node:path').sep`). + * @since v10.0.0 + * @return Fulfills with a string containing the file system path of the newly created temporary directory. + */ + function mkdtemp(prefix: string, options?: ObjectEncodingOptions | BufferEncoding | null): Promise; + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required `prefix` to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function mkdtemp(prefix: string, options: BufferEncodingOption): Promise; + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required `prefix` to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function mkdtemp(prefix: string, options?: ObjectEncodingOptions | BufferEncoding | null): Promise; + /** + * Asynchronously writes data to a file, replacing the file if it already exists.`data` can be a string, a buffer, an + * [AsyncIterable](https://tc39.github.io/ecma262/#sec-asynciterable-interface), or an + * [Iterable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#The_iterable_protocol) object. + * + * The `encoding` option is ignored if `data` is a buffer. + * + * If `options` is a string, then it specifies the encoding. + * + * The `mode` option only affects the newly created file. See `fs.open()` for more details. + * + * Any specified `FileHandle` has to support writing. + * + * It is unsafe to use `fsPromises.writeFile()` multiple times on the same file + * without waiting for the promise to be settled. + * + * Similarly to `fsPromises.readFile` \- `fsPromises.writeFile` is a convenience + * method that performs multiple `write` calls internally to write the buffer + * passed to it. For performance sensitive code consider using `fs.createWriteStream()` or `filehandle.createWriteStream()`. + * + * It is possible to use an `AbortSignal` to cancel an `fsPromises.writeFile()`. + * Cancelation is "best effort", and some amount of data is likely still + * to be written. + * + * ```js + * import { writeFile } from 'node:fs/promises'; + * import { Buffer } from 'node:buffer'; + * + * try { + * const controller = new AbortController(); + * const { signal } = controller; + * const data = new Uint8Array(Buffer.from('Hello Node.js')); + * const promise = writeFile('message.txt', data, { signal }); + * + * // Abort the request before the promise settles. + * controller.abort(); + * + * await promise; + * } catch (err) { + * // When a request is aborted - err is an AbortError + * console.error(err); + * } + * ``` + * + * Aborting an ongoing request does not abort individual operating + * system requests but rather the internal buffering `fs.writeFile` performs. + * @since v10.0.0 + * @param file filename or `FileHandle` + * @return Fulfills with `undefined` upon success. + */ + function writeFile( + file: PathLike | FileHandle, + data: string | NodeJS.ArrayBufferView | Iterable | AsyncIterable | Stream, + options?: + | (ObjectEncodingOptions & { + mode?: Mode | undefined; + flag?: OpenMode | undefined; + } & Abortable) + | BufferEncoding + | null + ): Promise; + /** + * Asynchronously append data to a file, creating the file if it does not yet + * exist. `data` can be a string or a `Buffer`. + * + * If `options` is a string, then it specifies the `encoding`. + * + * The `mode` option only affects the newly created file. See `fs.open()` for more details. + * + * The `path` may be specified as a `FileHandle` that has been opened + * for appending (using `fsPromises.open()`). + * @since v10.0.0 + * @param path filename or {FileHandle} + * @return Fulfills with `undefined` upon success. + */ + function appendFile(path: PathLike | FileHandle, data: string | Uint8Array, options?: (ObjectEncodingOptions & FlagAndOpenMode) | BufferEncoding | null): Promise; + /** + * Asynchronously reads the entire contents of a file. + * + * If no encoding is specified (using `options.encoding`), the data is returned + * as a `Buffer` object. Otherwise, the data will be a string. + * + * If `options` is a string, then it specifies the encoding. + * + * When the `path` is a directory, the behavior of `fsPromises.readFile()` is + * platform-specific. On macOS, Linux, and Windows, the promise will be rejected + * with an error. On FreeBSD, a representation of the directory's contents will be + * returned. + * + * An example of reading a `package.json` file located in the same directory of the + * running code: + * + * ```js + * import { readFile } from 'node:fs/promises'; + * try { + * const filePath = new URL('./package.json', import.meta.url); + * const contents = await readFile(filePath, { encoding: 'utf8' }); + * console.log(contents); + * } catch (err) { + * console.error(err.message); + * } + * ``` + * + * It is possible to abort an ongoing `readFile` using an `AbortSignal`. If a + * request is aborted the promise returned is rejected with an `AbortError`: + * + * ```js + * import { readFile } from 'node:fs/promises'; + * + * try { + * const controller = new AbortController(); + * const { signal } = controller; + * const promise = readFile(fileName, { signal }); + * + * // Abort the request before the promise settles. + * controller.abort(); + * + * await promise; + * } catch (err) { + * // When a request is aborted - err is an AbortError + * console.error(err); + * } + * ``` + * + * Aborting an ongoing request does not abort individual operating + * system requests but rather the internal buffering `fs.readFile` performs. + * + * Any specified `FileHandle` has to support reading. + * @since v10.0.0 + * @param path filename or `FileHandle` + * @return Fulfills with the contents of the file. + */ + function readFile( + path: PathLike | FileHandle, + options?: + | ({ + encoding?: null | undefined; + flag?: OpenMode | undefined; + } & Abortable) + | null + ): Promise; + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * If a `FileHandle` is provided, the underlying file will _not_ be closed automatically. + * @param options An object that may contain an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + function readFile( + path: PathLike | FileHandle, + options: + | ({ + encoding: BufferEncoding; + flag?: OpenMode | undefined; + } & Abortable) + | BufferEncoding + ): Promise; + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * If a `FileHandle` is provided, the underlying file will _not_ be closed automatically. + * @param options An object that may contain an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + function readFile( + path: PathLike | FileHandle, + options?: + | (ObjectEncodingOptions & + Abortable & { + flag?: OpenMode | undefined; + }) + | BufferEncoding + | null + ): Promise; + /** + * Asynchronously open a directory for iterative scanning. See the POSIX [`opendir(3)`](http://man7.org/linux/man-pages/man3/opendir.3.html) documentation for more detail. + * + * Creates an `fs.Dir`, which contains all further functions for reading from + * and cleaning up the directory. + * + * The `encoding` option sets the encoding for the `path` while opening the + * directory and subsequent read operations. + * + * Example using async iteration: + * + * ```js + * import { opendir } from 'node:fs/promises'; + * + * try { + * const dir = await opendir('./'); + * for await (const dirent of dir) + * console.log(dirent.name); + * } catch (err) { + * console.error(err); + * } + * ``` + * + * When using the async iterator, the `fs.Dir` object will be automatically + * closed after the iterator exits. + * @since v12.12.0 + * @return Fulfills with an {fs.Dir}. + */ + function opendir(path: PathLike, options?: OpenDirOptions): Promise; + /** + * Returns an async iterator that watches for changes on `filename`, where `filename`is either a file or a directory. + * + * ```js + * const { watch } = require('node:fs/promises'); + * + * const ac = new AbortController(); + * const { signal } = ac; + * setTimeout(() => ac.abort(), 10000); + * + * (async () => { + * try { + * const watcher = watch(__filename, { signal }); + * for await (const event of watcher) + * console.log(event); + * } catch (err) { + * if (err.name === 'AbortError') + * return; + * throw err; + * } + * })(); + * ``` + * + * On most platforms, `'rename'` is emitted whenever a filename appears or + * disappears in the directory. + * + * All the `caveats` for `fs.watch()` also apply to `fsPromises.watch()`. + * @since v15.9.0, v14.18.0 + * @return of objects with the properties: + */ + function watch( + filename: PathLike, + options: + | (WatchOptions & { + encoding: 'buffer'; + }) + | 'buffer' + ): AsyncIterable>; + /** + * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`. + * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `persistent` is not supplied, the default of `true` is used. + * If `recursive` is not supplied, the default of `false` is used. + */ + function watch(filename: PathLike, options?: WatchOptions | BufferEncoding): AsyncIterable>; + /** + * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`. + * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `persistent` is not supplied, the default of `true` is used. + * If `recursive` is not supplied, the default of `false` is used. + */ + function watch(filename: PathLike, options: WatchOptions | string): AsyncIterable> | AsyncIterable>; + /** + * Asynchronously copies the entire directory structure from `src` to `dest`, + * including subdirectories and files. + * + * When copying a directory to another directory, globs are not supported and + * behavior is similar to `cp dir1/ dir2/`. + * @since v16.7.0 + * @experimental + * @param src source path to copy. + * @param dest destination path to copy to. + * @return Fulfills with `undefined` upon success. + */ + function cp(source: string | URL, destination: string | URL, opts?: CopyOptions): Promise; +} +declare module 'fs/promises' { + export * from 'node:fs/promises'; +} diff --git a/node_modules/@types/node/globals.d.ts b/node_modules/@types/node/globals.d.ts new file mode 100644 index 0000000..1336d61 --- /dev/null +++ b/node_modules/@types/node/globals.d.ts @@ -0,0 +1,325 @@ +// Declare "static" methods in Error +interface ErrorConstructor { + /** Create .stack property on a target object */ + captureStackTrace(targetObject: object, constructorOpt?: Function): void; + + /** + * Optional override for formatting stack traces + * + * @see https://v8.dev/docs/stack-trace-api#customizing-stack-traces + */ + prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined; + + stackTraceLimit: number; +} + +/*-----------------------------------------------* + * * + * GLOBAL * + * * + ------------------------------------------------*/ + +// For backwards compability +interface NodeRequire extends NodeJS.Require { } +interface RequireResolve extends NodeJS.RequireResolve { } +interface NodeModule extends NodeJS.Module { } + +declare var process: NodeJS.Process; +declare var console: Console; + +declare var __filename: string; +declare var __dirname: string; + +declare var require: NodeRequire; +declare var module: NodeModule; + +// Same as module.exports +declare var exports: any; + +/** + * Only available if `--expose-gc` is passed to the process. + */ +declare var gc: undefined | (() => void); + +//#region borrowed +// from https://github.com/microsoft/TypeScript/blob/38da7c600c83e7b31193a62495239a0fe478cb67/lib/lib.webworker.d.ts#L633 until moved to separate lib +/** A controller object that allows you to abort one or more DOM requests as and when desired. */ +interface AbortController { + /** + * Returns the AbortSignal object associated with this object. + */ + + readonly signal: AbortSignal; + /** + * Invoking this method will set this object's AbortSignal's aborted flag and signal to any observers that the associated activity is to be aborted. + */ + abort(reason?: any): void; +} + +/** A signal object that allows you to communicate with a DOM request (such as a Fetch) and abort it if required via an AbortController object. */ +interface AbortSignal extends EventTarget { + /** + * Returns true if this AbortSignal's AbortController has signaled to abort, and false otherwise. + */ + readonly aborted: boolean; + readonly reason: any; + onabort: null | ((this: AbortSignal, event: Event) => any); + throwIfAborted(): void; +} + +declare var AbortController: typeof globalThis extends {onmessage: any; AbortController: infer T} + ? T + : { + prototype: AbortController; + new(): AbortController; + }; + +declare var AbortSignal: typeof globalThis extends {onmessage: any; AbortSignal: infer T} + ? T + : { + prototype: AbortSignal; + new(): AbortSignal; + abort(reason?: any): AbortSignal; + timeout(milliseconds: number): AbortSignal; + }; +//#endregion borrowed + +//#region Disposable +interface SymbolConstructor { + /** + * A method that is used to release resources held by an object. Called by the semantics of the `using` statement. + */ + readonly dispose: unique symbol; + + /** + * A method that is used to asynchronously release resources held by an object. Called by the semantics of the `await using` statement. + */ + readonly asyncDispose: unique symbol; +} + +interface Disposable { + [Symbol.dispose](): void; +} + +interface AsyncDisposable { + [Symbol.asyncDispose](): PromiseLike; +} +//#endregion Disposable + +//#region ArrayLike.at() +interface RelativeIndexable { + /** + * Takes an integer value and returns the item at that index, + * allowing for positive and negative integers. + * Negative integers count back from the last item in the array. + */ + at(index: number): T | undefined; +} +interface String extends RelativeIndexable {} +interface Array extends RelativeIndexable {} +interface ReadonlyArray extends RelativeIndexable {} +interface Int8Array extends RelativeIndexable {} +interface Uint8Array extends RelativeIndexable {} +interface Uint8ClampedArray extends RelativeIndexable {} +interface Int16Array extends RelativeIndexable {} +interface Uint16Array extends RelativeIndexable {} +interface Int32Array extends RelativeIndexable {} +interface Uint32Array extends RelativeIndexable {} +interface Float32Array extends RelativeIndexable {} +interface Float64Array extends RelativeIndexable {} +interface BigInt64Array extends RelativeIndexable {} +interface BigUint64Array extends RelativeIndexable {} +//#endregion ArrayLike.at() end + +/** + * @since v17.0.0 + * + * Creates a deep clone of an object. + */ +declare function structuredClone( + value: T, + transfer?: { transfer: ReadonlyArray }, +): T; + +/*----------------------------------------------* +* * +* GLOBAL INTERFACES * +* * +*-----------------------------------------------*/ +declare namespace NodeJS { + interface CallSite { + /** + * Value of "this" + */ + getThis(): unknown; + + /** + * Type of "this" as a string. + * This is the name of the function stored in the constructor field of + * "this", if available. Otherwise the object's [[Class]] internal + * property. + */ + getTypeName(): string | null; + + /** + * Current function + */ + getFunction(): Function | undefined; + + /** + * Name of the current function, typically its name property. + * If a name property is not available an attempt will be made to try + * to infer a name from the function's context. + */ + getFunctionName(): string | null; + + /** + * Name of the property [of "this" or one of its prototypes] that holds + * the current function + */ + getMethodName(): string | null; + + /** + * Name of the script [if this function was defined in a script] + */ + getFileName(): string | undefined; + + /** + * Current line number [if this function was defined in a script] + */ + getLineNumber(): number | null; + + /** + * Current column number [if this function was defined in a script] + */ + getColumnNumber(): number | null; + + /** + * A call site object representing the location where eval was called + * [if this function was created using a call to eval] + */ + getEvalOrigin(): string | undefined; + + /** + * Is this a toplevel invocation, that is, is "this" the global object? + */ + isToplevel(): boolean; + + /** + * Does this call take place in code defined by a call to eval? + */ + isEval(): boolean; + + /** + * Is this call in native V8 code? + */ + isNative(): boolean; + + /** + * Is this a constructor call? + */ + isConstructor(): boolean; + } + + interface ErrnoException extends Error { + errno?: number | undefined; + code?: string | undefined; + path?: string | undefined; + syscall?: string | undefined; + } + + interface ReadableStream extends EventEmitter { + readable: boolean; + read(size?: number): string | Buffer; + setEncoding(encoding: BufferEncoding): this; + pause(): this; + resume(): this; + isPaused(): boolean; + pipe(destination: T, options?: { end?: boolean | undefined; }): T; + unpipe(destination?: WritableStream): this; + unshift(chunk: string | Uint8Array, encoding?: BufferEncoding): void; + wrap(oldStream: ReadableStream): this; + [Symbol.asyncIterator](): AsyncIterableIterator; + } + + interface WritableStream extends EventEmitter { + writable: boolean; + write(buffer: Uint8Array | string, cb?: (err?: Error | null) => void): boolean; + write(str: string, encoding?: BufferEncoding, cb?: (err?: Error | null) => void): boolean; + end(cb?: () => void): this; + end(data: string | Uint8Array, cb?: () => void): this; + end(str: string, encoding?: BufferEncoding, cb?: () => void): this; + } + + interface ReadWriteStream extends ReadableStream, WritableStream { } + + interface RefCounted { + ref(): this; + unref(): this; + } + + type TypedArray = + | Uint8Array + | Uint8ClampedArray + | Uint16Array + | Uint32Array + | Int8Array + | Int16Array + | Int32Array + | BigUint64Array + | BigInt64Array + | Float32Array + | Float64Array; + type ArrayBufferView = TypedArray | DataView; + + interface Require { + (id: string): any; + resolve: RequireResolve; + cache: Dict; + /** + * @deprecated + */ + extensions: RequireExtensions; + main: Module | undefined; + } + + interface RequireResolve { + (id: string, options?: { paths?: string[] | undefined; }): string; + paths(request: string): string[] | null; + } + + interface RequireExtensions extends Dict<(m: Module, filename: string) => any> { + '.js': (m: Module, filename: string) => any; + '.json': (m: Module, filename: string) => any; + '.node': (m: Module, filename: string) => any; + } + interface Module { + /** + * `true` if the module is running during the Node.js preload + */ + isPreloading: boolean; + exports: any; + require: Require; + id: string; + filename: string; + loaded: boolean; + /** @deprecated since v14.6.0 Please use `require.main` and `module.children` instead. */ + parent: Module | null | undefined; + children: Module[]; + /** + * @since v11.14.0 + * + * The directory name of the module. This is usually the same as the path.dirname() of the module.id. + */ + path: string; + paths: string[]; + } + + interface Dict { + [key: string]: T | undefined; + } + + interface ReadOnlyDict { + readonly [key: string]: T | undefined; + } +} diff --git a/node_modules/@types/node/globals.global.d.ts b/node_modules/@types/node/globals.global.d.ts new file mode 100644 index 0000000..ef1198c --- /dev/null +++ b/node_modules/@types/node/globals.global.d.ts @@ -0,0 +1 @@ +declare var global: typeof globalThis; diff --git a/node_modules/@types/node/http.d.ts b/node_modules/@types/node/http.d.ts new file mode 100644 index 0000000..ba0ac3d --- /dev/null +++ b/node_modules/@types/node/http.d.ts @@ -0,0 +1,1756 @@ +/** + * To use the HTTP server and client one must `require('node:http')`. + * + * The HTTP interfaces in Node.js are designed to support many features + * of the protocol which have been traditionally difficult to use. + * In particular, large, possibly chunk-encoded, messages. The interface is + * careful to never buffer entire requests or responses, so the + * user is able to stream data. + * + * HTTP message headers are represented by an object like this: + * + * ```js + * { 'content-length': '123', + * 'content-type': 'text/plain', + * 'connection': 'keep-alive', + * 'host': 'example.com', + * 'accept': '*' } + * ``` + * + * Keys are lowercased. Values are not modified. + * + * In order to support the full spectrum of possible HTTP applications, the Node.js + * HTTP API is very low-level. It deals with stream handling and message + * parsing only. It parses a message into headers and body but it does not + * parse the actual headers or the body. + * + * See `message.headers` for details on how duplicate headers are handled. + * + * The raw headers as they were received are retained in the `rawHeaders`property, which is an array of `[key, value, key2, value2, ...]`. For + * example, the previous message header object might have a `rawHeaders`list like the following: + * + * ```js + * [ 'ConTent-Length', '123456', + * 'content-LENGTH', '123', + * 'content-type', 'text/plain', + * 'CONNECTION', 'keep-alive', + * 'Host', 'example.com', + * 'accepT', '*' ] + * ``` + * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/http.js) + */ +declare module 'node:http' { + import * as stream from 'node:stream'; + import { URL } from 'node:url'; + import { LookupOptions } from 'node:dns'; + import { EventEmitter } from 'node:events'; + import { TcpSocketConnectOpts, Socket, Server as NetServer, LookupFunction } from 'node:net'; + // incoming headers will never contain number + interface IncomingHttpHeaders extends NodeJS.Dict { + accept?: string | undefined; + 'accept-language'?: string | undefined; + 'accept-patch'?: string | undefined; + 'accept-ranges'?: string | undefined; + 'access-control-allow-credentials'?: string | undefined; + 'access-control-allow-headers'?: string | undefined; + 'access-control-allow-methods'?: string | undefined; + 'access-control-allow-origin'?: string | undefined; + 'access-control-expose-headers'?: string | undefined; + 'access-control-max-age'?: string | undefined; + 'access-control-request-headers'?: string | undefined; + 'access-control-request-method'?: string | undefined; + age?: string | undefined; + allow?: string | undefined; + 'alt-svc'?: string | undefined; + authorization?: string | undefined; + 'cache-control'?: string | undefined; + connection?: string | undefined; + 'content-disposition'?: string | undefined; + 'content-encoding'?: string | undefined; + 'content-language'?: string | undefined; + 'content-length'?: string | undefined; + 'content-location'?: string | undefined; + 'content-range'?: string | undefined; + 'content-type'?: string | undefined; + cookie?: string | undefined; + date?: string | undefined; + etag?: string | undefined; + expect?: string | undefined; + expires?: string | undefined; + forwarded?: string | undefined; + from?: string | undefined; + host?: string | undefined; + 'if-match'?: string | undefined; + 'if-modified-since'?: string | undefined; + 'if-none-match'?: string | undefined; + 'if-unmodified-since'?: string | undefined; + 'last-modified'?: string | undefined; + location?: string | undefined; + origin?: string | undefined; + pragma?: string | undefined; + 'proxy-authenticate'?: string | undefined; + 'proxy-authorization'?: string | undefined; + 'public-key-pins'?: string | undefined; + range?: string | undefined; + referer?: string | undefined; + 'retry-after'?: string | undefined; + 'sec-websocket-accept'?: string | undefined; + 'sec-websocket-extensions'?: string | undefined; + 'sec-websocket-key'?: string | undefined; + 'sec-websocket-protocol'?: string | undefined; + 'sec-websocket-version'?: string | undefined; + 'set-cookie'?: string[] | undefined; + 'strict-transport-security'?: string | undefined; + tk?: string | undefined; + trailer?: string | undefined; + 'transfer-encoding'?: string | undefined; + upgrade?: string | undefined; + 'user-agent'?: string | undefined; + vary?: string | undefined; + via?: string | undefined; + warning?: string | undefined; + 'www-authenticate'?: string | undefined; + } + // outgoing headers allows numbers (as they are converted internally to strings) + type OutgoingHttpHeader = number | string | string[]; + interface OutgoingHttpHeaders extends NodeJS.Dict {} + interface ClientRequestArgs { + _defaultAgent?: Agent | undefined; + agent?: Agent | boolean | undefined; + auth?: string | null | undefined; + // https://github.com/nodejs/node/blob/master/lib/_http_client.js#L278 + createConnection?: + | ((options: ClientRequestArgs, oncreate: (err: Error, socket: Socket) => void) => Socket) + | undefined; + defaultPort?: number | string | undefined; + family?: number | undefined; + headers?: OutgoingHttpHeaders | undefined; + hints?: LookupOptions['hints']; + host?: string | null | undefined; + hostname?: string | null | undefined; + insecureHTTPParser?: boolean | undefined; + localAddress?: string | undefined; + localPort?: number | undefined; + lookup?: LookupFunction | undefined; + /** + * @default 16384 + */ + maxHeaderSize?: number | undefined; + method?: string | undefined; + path?: string | null | undefined; + port?: number | string | null | undefined; + protocol?: string | null | undefined; + setHost?: boolean | undefined; + signal?: AbortSignal | undefined; + socketPath?: string | undefined; + timeout?: number | undefined; + uniqueHeaders?: Array | undefined; + joinDuplicateHeaders?: boolean; + } + interface ServerOptions< + Request extends typeof IncomingMessage = typeof IncomingMessage, + Response extends typeof ServerResponse = typeof ServerResponse, + > { + /** + * Specifies the `IncomingMessage` class to be used. Useful for extending the original `IncomingMessage`. + */ + IncomingMessage?: Request | undefined; + /** + * Specifies the `ServerResponse` class to be used. Useful for extending the original `ServerResponse`. + */ + ServerResponse?: Response | undefined; + /** + * Sets the timeout value in milliseconds for receiving the entire request from the client. + * @see Server.requestTimeout for more information. + * @default 300000 + * @since v18.0.0 + */ + requestTimeout?: number | undefined; + /** + * It joins the field line values of multiple headers in a request with `, ` instead of discarding the duplicates. + * @default false + * @since v18.14.0 + */ + joinDuplicateHeaders?: boolean; + /** + * The number of milliseconds of inactivity a server needs to wait for additional incoming data, + * after it has finished writing the last response, before a socket will be destroyed. + * @see Server.keepAliveTimeout for more information. + * @default 5000 + * @since v18.0.0 + */ + keepAliveTimeout?: number | undefined; + /** + * Sets the interval value in milliseconds to check for request and headers timeout in incomplete requests. + * @default 30000 + */ + connectionsCheckingInterval?: number | undefined; + /** + * Optionally overrides all `socket`s' `readableHighWaterMark` and `writableHighWaterMark`. + * This affects `highWaterMark` property of both `IncomingMessage` and `ServerResponse`. + * Default: @see stream.getDefaultHighWaterMark(). + * @since v20.1.0 + */ + highWaterMark?: number | undefined; + /** + * Use an insecure HTTP parser that accepts invalid HTTP headers when `true`. + * Using the insecure parser should be avoided. + * See --insecure-http-parser for more information. + * @default false + */ + insecureHTTPParser?: boolean | undefined; + /** + * Optionally overrides the value of + * `--max-http-header-size` for requests received by this server, i.e. + * the maximum length of request headers in bytes. + * @default 16384 + * @since v13.3.0 + */ + maxHeaderSize?: number | undefined; + /** + * If set to `true`, it disables the use of Nagle's algorithm immediately after a new incoming connection is received. + * @default true + * @since v16.5.0 + */ + noDelay?: boolean | undefined; + /** + * If set to `true`, it enables keep-alive functionality on the socket immediately after a new incoming connection is received, + * similarly on what is done in `socket.setKeepAlive([enable][, initialDelay])`. + * @default false + * @since v16.5.0 + */ + keepAlive?: boolean | undefined; + /** + * If set to a positive number, it sets the initial delay before the first keepalive probe is sent on an idle socket. + * @default 0 + * @since v16.5.0 + */ + keepAliveInitialDelay?: number | undefined; + /** + * A list of response headers that should be sent only once. + * If the header's value is an array, the items will be joined using `; `. + */ + uniqueHeaders?: Array | undefined; + } + type RequestListener< + Request extends typeof IncomingMessage = typeof IncomingMessage, + Response extends typeof ServerResponse = typeof ServerResponse, + > = (req: InstanceType, res: InstanceType & { req: InstanceType }) => void; + /** + * @since v0.1.17 + */ + class Server< + Request extends typeof IncomingMessage = typeof IncomingMessage, + Response extends typeof ServerResponse = typeof ServerResponse, + > extends NetServer { + constructor(requestListener?: RequestListener); + constructor(options: ServerOptions, requestListener?: RequestListener); + /** + * Sets the timeout value for sockets, and emits a `'timeout'` event on + * the Server object, passing the socket as an argument, if a timeout + * occurs. + * + * If there is a `'timeout'` event listener on the Server object, then it + * will be called with the timed-out socket as an argument. + * + * By default, the Server does not timeout sockets. However, if a callback + * is assigned to the Server's `'timeout'` event, timeouts must be handled + * explicitly. + * @since v0.9.12 + * @param [msecs=0 (no timeout)] + */ + setTimeout(msecs?: number, callback?: () => void): this; + setTimeout(callback: () => void): this; + /** + * Limits maximum incoming headers count. If set to 0, no limit will be applied. + * @since v0.7.0 + */ + maxHeadersCount: number | null; + /** + * The maximum number of requests socket can handle + * before closing keep alive connection. + * + * A value of `0` will disable the limit. + * + * When the limit is reached it will set the `Connection` header value to `close`, + * but will not actually close the connection, subsequent requests sent + * after the limit is reached will get `503 Service Unavailable` as a response. + * @since v16.10.0 + */ + maxRequestsPerSocket: number | null; + /** + * The number of milliseconds of inactivity before a socket is presumed + * to have timed out. + * + * A value of `0` will disable the timeout behavior on incoming connections. + * + * The socket timeout logic is set up on connection, so changing this + * value only affects new connections to the server, not any existing connections. + * @since v0.9.12 + */ + timeout: number; + /** + * Limit the amount of time the parser will wait to receive the complete HTTP + * headers. + * + * If the timeout expires, the server responds with status 408 without + * forwarding the request to the request listener and then closes the connection. + * + * It must be set to a non-zero value (e.g. 120 seconds) to protect against + * potential Denial-of-Service attacks in case the server is deployed without a + * reverse proxy in front. + * @since v11.3.0, v10.14.0 + */ + headersTimeout: number; + /** + * The number of milliseconds of inactivity a server needs to wait for additional + * incoming data, after it has finished writing the last response, before a socket + * will be destroyed. If the server receives new data before the keep-alive + * timeout has fired, it will reset the regular inactivity timeout, i.e.,`server.timeout`. + * + * A value of `0` will disable the keep-alive timeout behavior on incoming + * connections. + * A value of `0` makes the http server behave similarly to Node.js versions prior + * to 8.0.0, which did not have a keep-alive timeout. + * + * The socket timeout logic is set up on connection, so changing this value only + * affects new connections to the server, not any existing connections. + * @since v8.0.0 + */ + keepAliveTimeout: number; + /** + * Sets the timeout value in milliseconds for receiving the entire request from + * the client. + * + * If the timeout expires, the server responds with status 408 without + * forwarding the request to the request listener and then closes the connection. + * + * It must be set to a non-zero value (e.g. 120 seconds) to protect against + * potential Denial-of-Service attacks in case the server is deployed without a + * reverse proxy in front. + * @since v14.11.0 + */ + requestTimeout: number; + /** + * Closes all connections connected to this server. + * @since v18.2.0 + */ + closeAllConnections(): void; + /** + * Closes all connections connected to this server which are not sending a request + * or waiting for a response. + * @since v18.2.0 + */ + closeIdleConnections(): void; + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: 'close', listener: () => void): this; + addListener(event: 'connection', listener: (socket: Socket) => void): this; + addListener(event: 'error', listener: (err: Error) => void): this; + addListener(event: 'listening', listener: () => void): this; + addListener(event: 'checkContinue', listener: RequestListener): this; + addListener(event: 'checkExpectation', listener: RequestListener): this; + addListener(event: 'clientError', listener: (err: Error, socket: stream.Duplex) => void): this; + addListener(event: 'connect', listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void): this; + addListener(event: 'dropRequest', listener: (req: InstanceType, socket: stream.Duplex) => void): this; + addListener(event: 'request', listener: RequestListener): this; + addListener(event: 'upgrade', listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void): this; + emit(event: string, ...args: any[]): boolean; + emit(event: 'close'): boolean; + emit(event: 'connection', socket: Socket): boolean; + emit(event: 'error', err: Error): boolean; + emit(event: 'listening'): boolean; + emit( + event: 'checkContinue', + req: InstanceType, + res: InstanceType & { req: InstanceType }, + ): boolean; + emit( + event: 'checkExpectation', + req: InstanceType, + res: InstanceType & { req: InstanceType }, + ): boolean; + emit(event: 'clientError', err: Error, socket: stream.Duplex): boolean; + emit(event: 'connect', req: InstanceType, socket: stream.Duplex, head: Buffer): boolean; + emit(event: 'dropRequest', req: InstanceType, socket: stream.Duplex): boolean; + emit( + event: 'request', + req: InstanceType, + res: InstanceType & { req: InstanceType }, + ): boolean; + emit(event: 'upgrade', req: InstanceType, socket: stream.Duplex, head: Buffer): boolean; + on(event: string, listener: (...args: any[]) => void): this; + on(event: 'close', listener: () => void): this; + on(event: 'connection', listener: (socket: Socket) => void): this; + on(event: 'error', listener: (err: Error) => void): this; + on(event: 'listening', listener: () => void): this; + on(event: 'checkContinue', listener: RequestListener): this; + on(event: 'checkExpectation', listener: RequestListener): this; + on(event: 'clientError', listener: (err: Error, socket: stream.Duplex) => void): this; + on(event: 'connect', listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void): this; + on(event: 'dropRequest', listener: (req: InstanceType, socket: stream.Duplex) => void): this; + on(event: 'request', listener: RequestListener): this; + on(event: 'upgrade', listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void): this; + once(event: string, listener: (...args: any[]) => void): this; + once(event: 'close', listener: () => void): this; + once(event: 'connection', listener: (socket: Socket) => void): this; + once(event: 'error', listener: (err: Error) => void): this; + once(event: 'listening', listener: () => void): this; + once(event: 'checkContinue', listener: RequestListener): this; + once(event: 'checkExpectation', listener: RequestListener): this; + once(event: 'clientError', listener: (err: Error, socket: stream.Duplex) => void): this; + once(event: 'connect', listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void): this; + once(event: 'dropRequest', listener: (req: InstanceType, socket: stream.Duplex) => void): this; + once(event: 'request', listener: RequestListener): this; + once(event: 'upgrade', listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void): this; + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: 'close', listener: () => void): this; + prependListener(event: 'connection', listener: (socket: Socket) => void): this; + prependListener(event: 'error', listener: (err: Error) => void): this; + prependListener(event: 'listening', listener: () => void): this; + prependListener(event: 'checkContinue', listener: RequestListener): this; + prependListener(event: 'checkExpectation', listener: RequestListener): this; + prependListener(event: 'clientError', listener: (err: Error, socket: stream.Duplex) => void): this; + prependListener(event: 'connect', listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void): this; + prependListener(event: 'dropRequest', listener: (req: InstanceType, socket: stream.Duplex) => void): this; + prependListener(event: 'request', listener: RequestListener): this; + prependListener(event: 'upgrade', listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void): this; + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'close', listener: () => void): this; + prependOnceListener(event: 'connection', listener: (socket: Socket) => void): this; + prependOnceListener(event: 'error', listener: (err: Error) => void): this; + prependOnceListener(event: 'listening', listener: () => void): this; + prependOnceListener(event: 'checkContinue', listener: RequestListener): this; + prependOnceListener(event: 'checkExpectation', listener: RequestListener): this; + prependOnceListener(event: 'clientError', listener: (err: Error, socket: stream.Duplex) => void): this; + prependOnceListener(event: 'connect', listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void): this; + prependOnceListener(event: 'dropRequest', listener: (req: InstanceType, socket: stream.Duplex) => void): this; + prependOnceListener(event: 'request', listener: RequestListener): this; + prependOnceListener(event: 'upgrade', listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void): this; + } + /** + * This class serves as the parent class of {@link ClientRequest} and {@link ServerResponse}. It is an abstract outgoing message from + * the perspective of the participants of an HTTP transaction. + * @since v0.1.17 + */ + class OutgoingMessage extends stream.Writable { + readonly req: Request; + chunkedEncoding: boolean; + shouldKeepAlive: boolean; + useChunkedEncodingByDefault: boolean; + sendDate: boolean; + /** + * @deprecated Use `writableEnded` instead. + */ + finished: boolean; + /** + * Read-only. `true` if the headers were sent, otherwise `false`. + * @since v0.9.3 + */ + readonly headersSent: boolean; + /** + * Alias of `outgoingMessage.socket`. + * @since v0.3.0 + * @deprecated Since v15.12.0,v14.17.1 - Use `socket` instead. + */ + readonly connection: Socket | null; + /** + * Reference to the underlying socket. Usually, users will not want to access + * this property. + * + * After calling `outgoingMessage.end()`, this property will be nulled. + * @since v0.3.0 + */ + readonly socket: Socket | null; + constructor(); + /** + * Once a socket is associated with the message and is connected,`socket.setTimeout()` will be called with `msecs` as the first parameter. + * @since v0.9.12 + * @param callback Optional function to be called when a timeout occurs. Same as binding to the `timeout` event. + */ + setTimeout(msecs: number, callback?: () => void): this; + /** + * Sets a single header value. If the header already exists in the to-be-sent + * headers, its value will be replaced. Use an array of strings to send multiple + * headers with the same name. + * @since v0.4.0 + * @param name Header name + * @param value Header value + */ + setHeader(name: string, value: number | string | ReadonlyArray): this; + /** + * Append a single header value for the header object. + * + * If the value is an array, this is equivalent of calling this method multiple + * times. + * + * If there were no previous value for the header, this is equivalent of calling `outgoingMessage.setHeader(name, value)`. + * + * Depending of the value of `options.uniqueHeaders` when the client request or the + * server were created, this will end up in the header being sent multiple times or + * a single time with values joined using `; `. + * @since v18.3.0, v16.17.0 + * @param name Header name + * @param value Header value + */ + appendHeader(name: string, value: string | ReadonlyArray): this; + /** + * Gets the value of the HTTP header with the given name. If that header is not + * set, the returned value will be `undefined`. + * @since v0.4.0 + * @param name Name of header + */ + getHeader(name: string): number | string | string[] | undefined; + /** + * Returns a shallow copy of the current outgoing headers. Since a shallow + * copy is used, array values may be mutated without additional calls to + * various header-related HTTP module methods. The keys of the returned + * object are the header names and the values are the respective header + * values. All header names are lowercase. + * + * The object returned by the `outgoingMessage.getHeaders()` method does + * not prototypically inherit from the JavaScript `Object`. This means that + * typical `Object` methods such as `obj.toString()`, `obj.hasOwnProperty()`, + * and others are not defined and will not work. + * + * ```js + * outgoingMessage.setHeader('Foo', 'bar'); + * outgoingMessage.setHeader('Set-Cookie', ['foo=bar', 'bar=baz']); + * + * const headers = outgoingMessage.getHeaders(); + * // headers === { foo: 'bar', 'set-cookie': ['foo=bar', 'bar=baz'] } + * ``` + * @since v7.7.0 + */ + getHeaders(): OutgoingHttpHeaders; + /** + * Returns an array containing the unique names of the current outgoing headers. + * All names are lowercase. + * @since v7.7.0 + */ + getHeaderNames(): string[]; + /** + * Returns `true` if the header identified by `name` is currently set in the + * outgoing headers. The header name is case-insensitive. + * + * ```js + * const hasContentType = outgoingMessage.hasHeader('content-type'); + * ``` + * @since v7.7.0 + */ + hasHeader(name: string): boolean; + /** + * Removes a header that is queued for implicit sending. + * + * ```js + * outgoingMessage.removeHeader('Content-Encoding'); + * ``` + * @since v0.4.0 + * @param name Header name + */ + removeHeader(name: string): void; + /** + * Adds HTTP trailers (headers but at the end of the message) to the message. + * + * Trailers will **only** be emitted if the message is chunked encoded. If not, + * the trailers will be silently discarded. + * + * HTTP requires the `Trailer` header to be sent to emit trailers, + * with a list of header field names in its value, e.g. + * + * ```js + * message.writeHead(200, { 'Content-Type': 'text/plain', + * 'Trailer': 'Content-MD5' }); + * message.write(fileData); + * message.addTrailers({ 'Content-MD5': '7895bf4b8828b55ceaf47747b4bca667' }); + * message.end(); + * ``` + * + * Attempting to set a header field name or value that contains invalid characters + * will result in a `TypeError` being thrown. + * @since v0.3.0 + */ + addTrailers(headers: OutgoingHttpHeaders | ReadonlyArray<[string, string]>): void; + /** + * Flushes the message headers. + * + * For efficiency reason, Node.js normally buffers the message headers + * until `outgoingMessage.end()` is called or the first chunk of message data + * is written. It then tries to pack the headers and data into a single TCP + * packet. + * + * It is usually desired (it saves a TCP round-trip), but not when the first + * data is not sent until possibly much later. `outgoingMessage.flushHeaders()`bypasses the optimization and kickstarts the message. + * @since v1.6.0 + */ + flushHeaders(): void; + } + /** + * This object is created internally by an HTTP server, not by the user. It is + * passed as the second parameter to the `'request'` event. + * @since v0.1.17 + */ + class ServerResponse extends OutgoingMessage { + /** + * When using implicit headers (not calling `response.writeHead()` explicitly), + * this property controls the status code that will be sent to the client when + * the headers get flushed. + * + * ```js + * response.statusCode = 404; + * ``` + * + * After response header was sent to the client, this property indicates the + * status code which was sent out. + * @since v0.4.0 + */ + statusCode: number; + /** + * When using implicit headers (not calling `response.writeHead()` explicitly), + * this property controls the status message that will be sent to the client when + * the headers get flushed. If this is left as `undefined` then the standard + * message for the status code will be used. + * + * ```js + * response.statusMessage = 'Not found'; + * ``` + * + * After response header was sent to the client, this property indicates the + * status message which was sent out. + * @since v0.11.8 + */ + statusMessage: string; + /** + * If set to `true`, Node.js will check whether the `Content-Length`header value and the size of the body, in bytes, are equal. + * Mismatching the `Content-Length` header value will result + * in an `Error` being thrown, identified by `code:``'ERR_HTTP_CONTENT_LENGTH_MISMATCH'`. + * @since v18.10.0, v16.18.0 + */ + strictContentLength: boolean; + constructor(req: Request); + assignSocket(socket: Socket): void; + detachSocket(socket: Socket): void; + /** + * Sends an HTTP/1.1 100 Continue message to the client, indicating that + * the request body should be sent. See the `'checkContinue'` event on`Server`. + * @since v0.3.0 + */ + writeContinue(callback?: () => void): void; + /** + * Sends an HTTP/1.1 103 Early Hints message to the client with a Link header, + * indicating that the user agent can preload/preconnect the linked resources. + * The `hints` is an object containing the values of headers to be sent with + * early hints message. The optional `callback` argument will be called when + * the response message has been written. + * + * **Example** + * + * ```js + * const earlyHintsLink = '; rel=preload; as=style'; + * response.writeEarlyHints({ + * 'link': earlyHintsLink, + * }); + * + * const earlyHintsLinks = [ + * '; rel=preload; as=style', + * '; rel=preload; as=script', + * ]; + * response.writeEarlyHints({ + * 'link': earlyHintsLinks, + * 'x-trace-id': 'id for diagnostics', + * }); + * + * const earlyHintsCallback = () => console.log('early hints message sent'); + * response.writeEarlyHints({ + * 'link': earlyHintsLinks, + * }, earlyHintsCallback); + * ``` + * @since v18.11.0 + * @param hints An object containing the values of headers + * @param callback Will be called when the response message has been written + */ + writeEarlyHints(hints: Record, callback?: () => void): void; + /** + * Sends a response header to the request. The status code is a 3-digit HTTP + * status code, like `404`. The last argument, `headers`, are the response headers. + * Optionally one can give a human-readable `statusMessage` as the second + * argument. + * + * `headers` may be an `Array` where the keys and values are in the same list. + * It is _not_ a list of tuples. So, the even-numbered offsets are key values, + * and the odd-numbered offsets are the associated values. The array is in the same + * format as `request.rawHeaders`. + * + * Returns a reference to the `ServerResponse`, so that calls can be chained. + * + * ```js + * const body = 'hello world'; + * response + * .writeHead(200, { + * 'Content-Length': Buffer.byteLength(body), + * 'Content-Type': 'text/plain', + * }) + * .end(body); + * ``` + * + * This method must only be called once on a message and it must + * be called before `response.end()` is called. + * + * If `response.write()` or `response.end()` are called before calling + * this, the implicit/mutable headers will be calculated and call this function. + * + * When headers have been set with `response.setHeader()`, they will be merged + * with any headers passed to `response.writeHead()`, with the headers passed + * to `response.writeHead()` given precedence. + * + * If this method is called and `response.setHeader()` has not been called, + * it will directly write the supplied header values onto the network channel + * without caching internally, and the `response.getHeader()` on the header + * will not yield the expected result. If progressive population of headers is + * desired with potential future retrieval and modification, use `response.setHeader()` instead. + * + * ```js + * // Returns content-type = text/plain + * const server = http.createServer((req, res) => { + * res.setHeader('Content-Type', 'text/html'); + * res.setHeader('X-Foo', 'bar'); + * res.writeHead(200, { 'Content-Type': 'text/plain' }); + * res.end('ok'); + * }); + * ``` + * + * `Content-Length` is read in bytes, not characters. Use `Buffer.byteLength()` to determine the length of the body in bytes. Node.js + * will check whether `Content-Length` and the length of the body which has + * been transmitted are equal or not. + * + * Attempting to set a header field name or value that contains invalid characters + * will result in a \[`Error`\]\[\] being thrown. + * @since v0.1.30 + */ + writeHead( + statusCode: number, + statusMessage?: string, + headers?: OutgoingHttpHeaders | OutgoingHttpHeader[], + ): this; + writeHead(statusCode: number, headers?: OutgoingHttpHeaders | OutgoingHttpHeader[]): this; + /** + * Sends a HTTP/1.1 102 Processing message to the client, indicating that + * the request body should be sent. + * @since v10.0.0 + */ + writeProcessing(): void; + } + interface InformationEvent { + statusCode: number; + statusMessage: string; + httpVersion: string; + httpVersionMajor: number; + httpVersionMinor: number; + headers: IncomingHttpHeaders; + rawHeaders: string[]; + } + /** + * This object is created internally and returned from {@link request}. It + * represents an _in-progress_ request whose header has already been queued. The + * header is still mutable using the `setHeader(name, value)`,`getHeader(name)`, `removeHeader(name)` API. The actual header will + * be sent along with the first data chunk or when calling `request.end()`. + * + * To get the response, add a listener for `'response'` to the request object.`'response'` will be emitted from the request object when the response + * headers have been received. The `'response'` event is executed with one + * argument which is an instance of {@link IncomingMessage}. + * + * During the `'response'` event, one can add listeners to the + * response object; particularly to listen for the `'data'` event. + * + * If no `'response'` handler is added, then the response will be + * entirely discarded. However, if a `'response'` event handler is added, + * then the data from the response object **must** be consumed, either by + * calling `response.read()` whenever there is a `'readable'` event, or + * by adding a `'data'` handler, or by calling the `.resume()` method. + * Until the data is consumed, the `'end'` event will not fire. Also, until + * the data is read it will consume memory that can eventually lead to a + * 'process out of memory' error. + * + * For backward compatibility, `res` will only emit `'error'` if there is an`'error'` listener registered. + * + * Set `Content-Length` header to limit the response body size. + * If `response.strictContentLength` is set to `true`, mismatching the`Content-Length` header value will result in an `Error` being thrown, + * identified by `code:``'ERR_HTTP_CONTENT_LENGTH_MISMATCH'`. + * + * `Content-Length` value should be in bytes, not characters. Use `Buffer.byteLength()` to determine the length of the body in bytes. + * @since v0.1.17 + */ + class ClientRequest extends OutgoingMessage { + /** + * The `request.aborted` property will be `true` if the request has + * been aborted. + * @since v0.11.14 + * @deprecated Since v17.0.0,v16.12.0 - Check `destroyed` instead. + */ + aborted: boolean; + /** + * The request host. + * @since v14.5.0, v12.19.0 + */ + host: string; + /** + * The request protocol. + * @since v14.5.0, v12.19.0 + */ + protocol: string; + /** + * When sending request through a keep-alive enabled agent, the underlying socket + * might be reused. But if server closes connection at unfortunate time, client + * may run into a 'ECONNRESET' error. + * + * ```js + * import http from 'node:http'; + * + * // Server has a 5 seconds keep-alive timeout by default + * http + * .createServer((req, res) => { + * res.write('hello\n'); + * res.end(); + * }) + * .listen(3000); + * + * setInterval(() => { + * // Adapting a keep-alive agent + * http.get('http://localhost:3000', { agent }, (res) => { + * res.on('data', (data) => { + * // Do nothing + * }); + * }); + * }, 5000); // Sending request on 5s interval so it's easy to hit idle timeout + * ``` + * + * By marking a request whether it reused socket or not, we can do + * automatic error retry base on it. + * + * ```js + * import http from 'node:http'; + * const agent = new http.Agent({ keepAlive: true }); + * + * function retriableRequest() { + * const req = http + * .get('http://localhost:3000', { agent }, (res) => { + * // ... + * }) + * .on('error', (err) => { + * // Check if retry is needed + * if (req.reusedSocket && err.code === 'ECONNRESET') { + * retriableRequest(); + * } + * }); + * } + * + * retriableRequest(); + * ``` + * @since v13.0.0, v12.16.0 + */ + reusedSocket: boolean; + /** + * Limits maximum response headers count. If set to 0, no limit will be applied. + */ + maxHeadersCount: number; + constructor(url: string | URL | ClientRequestArgs, cb?: (res: IncomingMessage) => void); + /** + * The request method. + * @since v0.1.97 + */ + method: string; + /** + * The request path. + * @since v0.4.0 + */ + path: string; + /** + * Marks the request as aborting. Calling this will cause remaining data + * in the response to be dropped and the socket to be destroyed. + * @since v0.3.8 + * @deprecated Since v14.1.0,v13.14.0 - Use `destroy` instead. + */ + abort(): void; + onSocket(socket: Socket): void; + /** + * Once a socket is assigned to this request and is connected `socket.setTimeout()` will be called. + * @since v0.5.9 + * @param timeout Milliseconds before a request times out. + * @param callback Optional function to be called when a timeout occurs. Same as binding to the `'timeout'` event. + */ + setTimeout(timeout: number, callback?: () => void): this; + /** + * Once a socket is assigned to this request and is connected `socket.setNoDelay()` will be called. + * @since v0.5.9 + */ + setNoDelay(noDelay?: boolean): void; + /** + * Once a socket is assigned to this request and is connected `socket.setKeepAlive()` will be called. + * @since v0.5.9 + */ + setSocketKeepAlive(enable?: boolean, initialDelay?: number): void; + /** + * Returns an array containing the unique names of the current outgoing raw + * headers. Header names are returned with their exact casing being set. + * + * ```js + * request.setHeader('Foo', 'bar'); + * request.setHeader('Set-Cookie', ['foo=bar', 'bar=baz']); + * + * const headerNames = request.getRawHeaderNames(); + * // headerNames === ['Foo', 'Set-Cookie'] + * ``` + * @since v15.13.0, v14.17.0 + */ + getRawHeaderNames(): string[]; + /** + * @deprecated + */ + addListener(event: 'abort', listener: () => void): this; + addListener(event: 'connect', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; + addListener(event: 'continue', listener: () => void): this; + addListener(event: 'information', listener: (info: InformationEvent) => void): this; + addListener(event: 'response', listener: (response: IncomingMessage) => void): this; + addListener(event: 'socket', listener: (socket: Socket) => void): this; + addListener(event: 'timeout', listener: () => void): this; + addListener(event: 'upgrade', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; + addListener(event: 'close', listener: () => void): this; + addListener(event: 'drain', listener: () => void): this; + addListener(event: 'error', listener: (err: Error) => void): this; + addListener(event: 'finish', listener: () => void): this; + addListener(event: 'pipe', listener: (src: stream.Readable) => void): this; + addListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + /** + * @deprecated + */ + on(event: 'abort', listener: () => void): this; + on(event: 'connect', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; + on(event: 'continue', listener: () => void): this; + on(event: 'information', listener: (info: InformationEvent) => void): this; + on(event: 'response', listener: (response: IncomingMessage) => void): this; + on(event: 'socket', listener: (socket: Socket) => void): this; + on(event: 'timeout', listener: () => void): this; + on(event: 'upgrade', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; + on(event: 'close', listener: () => void): this; + on(event: 'drain', listener: () => void): this; + on(event: 'error', listener: (err: Error) => void): this; + on(event: 'finish', listener: () => void): this; + on(event: 'pipe', listener: (src: stream.Readable) => void): this; + on(event: 'unpipe', listener: (src: stream.Readable) => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + /** + * @deprecated + */ + once(event: 'abort', listener: () => void): this; + once(event: 'connect', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; + once(event: 'continue', listener: () => void): this; + once(event: 'information', listener: (info: InformationEvent) => void): this; + once(event: 'response', listener: (response: IncomingMessage) => void): this; + once(event: 'socket', listener: (socket: Socket) => void): this; + once(event: 'timeout', listener: () => void): this; + once(event: 'upgrade', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; + once(event: 'close', listener: () => void): this; + once(event: 'drain', listener: () => void): this; + once(event: 'error', listener: (err: Error) => void): this; + once(event: 'finish', listener: () => void): this; + once(event: 'pipe', listener: (src: stream.Readable) => void): this; + once(event: 'unpipe', listener: (src: stream.Readable) => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + /** + * @deprecated + */ + prependListener(event: 'abort', listener: () => void): this; + prependListener(event: 'connect', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; + prependListener(event: 'continue', listener: () => void): this; + prependListener(event: 'information', listener: (info: InformationEvent) => void): this; + prependListener(event: 'response', listener: (response: IncomingMessage) => void): this; + prependListener(event: 'socket', listener: (socket: Socket) => void): this; + prependListener(event: 'timeout', listener: () => void): this; + prependListener(event: 'upgrade', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; + prependListener(event: 'close', listener: () => void): this; + prependListener(event: 'drain', listener: () => void): this; + prependListener(event: 'error', listener: (err: Error) => void): this; + prependListener(event: 'finish', listener: () => void): this; + prependListener(event: 'pipe', listener: (src: stream.Readable) => void): this; + prependListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + /** + * @deprecated + */ + prependOnceListener(event: 'abort', listener: () => void): this; + prependOnceListener(event: 'connect', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; + prependOnceListener(event: 'continue', listener: () => void): this; + prependOnceListener(event: 'information', listener: (info: InformationEvent) => void): this; + prependOnceListener(event: 'response', listener: (response: IncomingMessage) => void): this; + prependOnceListener(event: 'socket', listener: (socket: Socket) => void): this; + prependOnceListener(event: 'timeout', listener: () => void): this; + prependOnceListener(event: 'upgrade', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; + prependOnceListener(event: 'close', listener: () => void): this; + prependOnceListener(event: 'drain', listener: () => void): this; + prependOnceListener(event: 'error', listener: (err: Error) => void): this; + prependOnceListener(event: 'finish', listener: () => void): this; + prependOnceListener(event: 'pipe', listener: (src: stream.Readable) => void): this; + prependOnceListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + } + /** + * An `IncomingMessage` object is created by {@link Server} or {@link ClientRequest} and passed as the first argument to the `'request'` and `'response'` event respectively. It may be used to + * access response + * status, headers, and data. + * + * Different from its `socket` value which is a subclass of `stream.Duplex`, the`IncomingMessage` itself extends `stream.Readable` and is created separately to + * parse and emit the incoming HTTP headers and payload, as the underlying socket + * may be reused multiple times in case of keep-alive. + * @since v0.1.17 + */ + class IncomingMessage extends stream.Readable { + constructor(socket: Socket); + /** + * The `message.aborted` property will be `true` if the request has + * been aborted. + * @since v10.1.0 + * @deprecated Since v17.0.0,v16.12.0 - Check `message.destroyed` from stream.Readable. + */ + aborted: boolean; + /** + * In case of server request, the HTTP version sent by the client. In the case of + * client response, the HTTP version of the connected-to server. + * Probably either `'1.1'` or `'1.0'`. + * + * Also `message.httpVersionMajor` is the first integer and`message.httpVersionMinor` is the second. + * @since v0.1.1 + */ + httpVersion: string; + httpVersionMajor: number; + httpVersionMinor: number; + /** + * The `message.complete` property will be `true` if a complete HTTP message has + * been received and successfully parsed. + * + * This property is particularly useful as a means of determining if a client or + * server fully transmitted a message before a connection was terminated: + * + * ```js + * const req = http.request({ + * host: '127.0.0.1', + * port: 8080, + * method: 'POST', + * }, (res) => { + * res.resume(); + * res.on('end', () => { + * if (!res.complete) + * console.error( + * 'The connection was terminated while the message was still being sent'); + * }); + * }); + * ``` + * @since v0.3.0 + */ + complete: boolean; + /** + * Alias for `message.socket`. + * @since v0.1.90 + * @deprecated Since v16.0.0 - Use `socket`. + */ + connection: Socket; + /** + * The `net.Socket` object associated with the connection. + * + * With HTTPS support, use `request.socket.getPeerCertificate()` to obtain the + * client's authentication details. + * + * This property is guaranteed to be an instance of the `net.Socket` class, + * a subclass of `stream.Duplex`, unless the user specified a socket + * type other than `net.Socket` or internally nulled. + * @since v0.3.0 + */ + socket: Socket; + /** + * The request/response headers object. + * + * Key-value pairs of header names and values. Header names are lower-cased. + * + * ```js + * // Prints something like: + * // + * // { 'user-agent': 'curl/7.22.0', + * // host: '127.0.0.1:8000', + * // accept: '*' } + * console.log(request.headers); + * ``` + * + * Duplicates in raw headers are handled in the following ways, depending on the + * header name: + * + * * Duplicates of `age`, `authorization`, `content-length`, `content-type`,`etag`, `expires`, `from`, `host`, `if-modified-since`, `if-unmodified-since`,`last-modified`, `location`, + * `max-forwards`, `proxy-authorization`, `referer`,`retry-after`, `server`, or `user-agent` are discarded. + * To allow duplicate values of the headers listed above to be joined, + * use the option `joinDuplicateHeaders` in {@link request} and {@link createServer}. See RFC 9110 Section 5.3 for more + * information. + * * `set-cookie` is always an array. Duplicates are added to the array. + * * For duplicate `cookie` headers, the values are joined together with `; `. + * * For all other headers, the values are joined together with `, `. + * @since v0.1.5 + */ + headers: IncomingHttpHeaders; + /** + * Similar to `message.headers`, but there is no join logic and the values are + * always arrays of strings, even for headers received just once. + * + * ```js + * // Prints something like: + * // + * // { 'user-agent': ['curl/7.22.0'], + * // host: ['127.0.0.1:8000'], + * // accept: ['*'] } + * console.log(request.headersDistinct); + * ``` + * @since v18.3.0, v16.17.0 + */ + headersDistinct: NodeJS.Dict; + /** + * The raw request/response headers list exactly as they were received. + * + * The keys and values are in the same list. It is _not_ a + * list of tuples. So, the even-numbered offsets are key values, and the + * odd-numbered offsets are the associated values. + * + * Header names are not lowercased, and duplicates are not merged. + * + * ```js + * // Prints something like: + * // + * // [ 'user-agent', + * // 'this is invalid because there can be only one', + * // 'User-Agent', + * // 'curl/7.22.0', + * // 'Host', + * // '127.0.0.1:8000', + * // 'ACCEPT', + * // '*' ] + * console.log(request.rawHeaders); + * ``` + * @since v0.11.6 + */ + rawHeaders: string[]; + /** + * The request/response trailers object. Only populated at the `'end'` event. + * @since v0.3.0 + */ + trailers: NodeJS.Dict; + /** + * Similar to `message.trailers`, but there is no join logic and the values are + * always arrays of strings, even for headers received just once. + * Only populated at the `'end'` event. + * @since v18.3.0, v16.17.0 + */ + trailersDistinct: NodeJS.Dict; + /** + * The raw request/response trailer keys and values exactly as they were + * received. Only populated at the `'end'` event. + * @since v0.11.6 + */ + rawTrailers: string[]; + /** + * Calls `message.socket.setTimeout(msecs, callback)`. + * @since v0.5.9 + */ + setTimeout(msecs: number, callback?: () => void): this; + /** + * **Only valid for request obtained from {@link Server}.** + * + * The request method as a string. Read only. Examples: `'GET'`, `'DELETE'`. + * @since v0.1.1 + */ + method?: string | undefined; + /** + * **Only valid for request obtained from {@link Server}.** + * + * Request URL string. This contains only the URL that is present in the actual + * HTTP request. Take the following request: + * + * ```http + * GET /status?name=ryan HTTP/1.1 + * Accept: text/plain + * ``` + * + * To parse the URL into its parts: + * + * ```js + * new URL(request.url, `http://${request.headers.host}`); + * ``` + * + * When `request.url` is `'/status?name=ryan'` and `request.headers.host` is`'localhost:3000'`: + * + * ```console + * $ node + * > new URL(request.url, `http://${request.headers.host}`) + * URL { + * href: 'http://localhost:3000/status?name=ryan', + * origin: 'http://localhost:3000', + * protocol: 'http:', + * username: '', + * password: '', + * host: 'localhost:3000', + * hostname: 'localhost', + * port: '3000', + * pathname: '/status', + * search: '?name=ryan', + * searchParams: URLSearchParams { 'name' => 'ryan' }, + * hash: '' + * } + * ``` + * @since v0.1.90 + */ + url?: string | undefined; + /** + * **Only valid for response obtained from {@link ClientRequest}.** + * + * The 3-digit HTTP response status code. E.G. `404`. + * @since v0.1.1 + */ + statusCode?: number | undefined; + /** + * **Only valid for response obtained from {@link ClientRequest}.** + * + * The HTTP response status message (reason phrase). E.G. `OK` or `Internal Server Error`. + * @since v0.11.10 + */ + statusMessage?: string | undefined; + /** + * Calls `destroy()` on the socket that received the `IncomingMessage`. If `error`is provided, an `'error'` event is emitted on the socket and `error` is passed + * as an argument to any listeners on the event. + * @since v0.3.0 + */ + destroy(error?: Error): this; + } + interface AgentOptions extends Partial { + /** + * Keep sockets around in a pool to be used by other requests in the future. Default = false + */ + keepAlive?: boolean | undefined; + /** + * When using HTTP KeepAlive, how often to send TCP KeepAlive packets over sockets being kept alive. Default = 1000. + * Only relevant if keepAlive is set to true. + */ + keepAliveMsecs?: number | undefined; + /** + * Maximum number of sockets to allow per host. Default for Node 0.10 is 5, default for Node 0.12 is Infinity + */ + maxSockets?: number | undefined; + /** + * Maximum number of sockets allowed for all hosts in total. Each request will use a new socket until the maximum is reached. Default: Infinity. + */ + maxTotalSockets?: number | undefined; + /** + * Maximum number of sockets to leave open in a free state. Only relevant if keepAlive is set to true. Default = 256. + */ + maxFreeSockets?: number | undefined; + /** + * Socket timeout in milliseconds. This will set the timeout after the socket is connected. + */ + timeout?: number | undefined; + /** + * Scheduling strategy to apply when picking the next free socket to use. + * @default `lifo` + */ + scheduling?: 'fifo' | 'lifo' | undefined; + } + /** + * An `Agent` is responsible for managing connection persistence + * and reuse for HTTP clients. It maintains a queue of pending requests + * for a given host and port, reusing a single socket connection for each + * until the queue is empty, at which time the socket is either destroyed + * or put into a pool where it is kept to be used again for requests to the + * same host and port. Whether it is destroyed or pooled depends on the`keepAlive` `option`. + * + * Pooled connections have TCP Keep-Alive enabled for them, but servers may + * still close idle connections, in which case they will be removed from the + * pool and a new connection will be made when a new HTTP request is made for + * that host and port. Servers may also refuse to allow multiple requests + * over the same connection, in which case the connection will have to be + * remade for every request and cannot be pooled. The `Agent` will still make + * the requests to that server, but each one will occur over a new connection. + * + * When a connection is closed by the client or the server, it is removed + * from the pool. Any unused sockets in the pool will be unrefed so as not + * to keep the Node.js process running when there are no outstanding requests. + * (see `socket.unref()`). + * + * It is good practice, to `destroy()` an `Agent` instance when it is no + * longer in use, because unused sockets consume OS resources. + * + * Sockets are removed from an agent when the socket emits either + * a `'close'` event or an `'agentRemove'` event. When intending to keep one + * HTTP request open for a long time without keeping it in the agent, something + * like the following may be done: + * + * ```js + * http.get(options, (res) => { + * // Do stuff + * }).on('socket', (socket) => { + * socket.emit('agentRemove'); + * }); + * ``` + * + * An agent may also be used for an individual request. By providing`{agent: false}` as an option to the `http.get()` or `http.request()`functions, a one-time use `Agent` with default options + * will be used + * for the client connection. + * + * `agent:false`: + * + * ```js + * http.get({ + * hostname: 'localhost', + * port: 80, + * path: '/', + * agent: false, // Create a new agent just for this one request + * }, (res) => { + * // Do stuff with response + * }); + * ``` + * @since v0.3.4 + */ + class Agent extends EventEmitter { + /** + * By default set to 256. For agents with `keepAlive` enabled, this + * sets the maximum number of sockets that will be left open in the free + * state. + * @since v0.11.7 + */ + maxFreeSockets: number; + /** + * By default set to `Infinity`. Determines how many concurrent sockets the agent + * can have open per origin. Origin is the returned value of `agent.getName()`. + * @since v0.3.6 + */ + maxSockets: number; + /** + * By default set to `Infinity`. Determines how many concurrent sockets the agent + * can have open. Unlike `maxSockets`, this parameter applies across all origins. + * @since v14.5.0, v12.19.0 + */ + maxTotalSockets: number; + /** + * An object which contains arrays of sockets currently awaiting use by + * the agent when `keepAlive` is enabled. Do not modify. + * + * Sockets in the `freeSockets` list will be automatically destroyed and + * removed from the array on `'timeout'`. + * @since v0.11.4 + */ + readonly freeSockets: NodeJS.ReadOnlyDict; + /** + * An object which contains arrays of sockets currently in use by the + * agent. Do not modify. + * @since v0.3.6 + */ + readonly sockets: NodeJS.ReadOnlyDict; + /** + * An object which contains queues of requests that have not yet been assigned to + * sockets. Do not modify. + * @since v0.5.9 + */ + readonly requests: NodeJS.ReadOnlyDict; + constructor(opts?: AgentOptions); + /** + * Destroy any sockets that are currently in use by the agent. + * + * It is usually not necessary to do this. However, if using an + * agent with `keepAlive` enabled, then it is best to explicitly shut down + * the agent when it is no longer needed. Otherwise, + * sockets might stay open for quite a long time before the server + * terminates them. + * @since v0.11.4 + */ + destroy(): void; + } + const METHODS: string[]; + const STATUS_CODES: { + [errorCode: number]: string | undefined; + [errorCode: string]: string | undefined; + }; + /** + * Returns a new instance of {@link Server}. + * + * The `requestListener` is a function which is automatically + * added to the `'request'` event. + * + * ```js + * import http from 'node:http'; + * + * // Create a local server to receive data from + * const server = http.createServer((req, res) => { + * res.writeHead(200, { 'Content-Type': 'application/json' }); + * res.end(JSON.stringify({ + * data: 'Hello World!', + * })); + * }); + * + * server.listen(8000); + * ``` + * + * ```js + * import http from 'node:http'; + * + * // Create a local server to receive data from + * const server = http.createServer(); + * + * // Listen to the request event + * server.on('request', (request, res) => { + * res.writeHead(200, { 'Content-Type': 'application/json' }); + * res.end(JSON.stringify({ + * data: 'Hello World!', + * })); + * }); + * + * server.listen(8000); + * ``` + * @since v0.1.13 + */ + function createServer< + Request extends typeof IncomingMessage = typeof IncomingMessage, + Response extends typeof ServerResponse = typeof ServerResponse, + >(requestListener?: RequestListener): Server; + function createServer< + Request extends typeof IncomingMessage = typeof IncomingMessage, + Response extends typeof ServerResponse = typeof ServerResponse, + >( + options: ServerOptions, + requestListener?: RequestListener, + ): Server; + // although RequestOptions are passed as ClientRequestArgs to ClientRequest directly, + // create interface RequestOptions would make the naming more clear to developers + interface RequestOptions extends ClientRequestArgs {} + /** + * `options` in `socket.connect()` are also supported. + * + * Node.js maintains several connections per server to make HTTP requests. + * This function allows one to transparently issue requests. + * + * `url` can be a string or a `URL` object. If `url` is a + * string, it is automatically parsed with `new URL()`. If it is a `URL` object, it will be automatically converted to an ordinary `options` object. + * + * If both `url` and `options` are specified, the objects are merged, with the`options` properties taking precedence. + * + * The optional `callback` parameter will be added as a one-time listener for + * the `'response'` event. + * + * `http.request()` returns an instance of the {@link ClientRequest} class. The `ClientRequest` instance is a writable stream. If one needs to + * upload a file with a POST request, then write to the `ClientRequest` object. + * + * ```js + * import http from 'node:http'; + * import { Buffer } from 'node:buffer'; + * + * const postData = JSON.stringify({ + * 'msg': 'Hello World!', + * }); + * + * const options = { + * hostname: 'www.google.com', + * port: 80, + * path: '/upload', + * method: 'POST', + * headers: { + * 'Content-Type': 'application/json', + * 'Content-Length': Buffer.byteLength(postData), + * }, + * }; + * + * const req = http.request(options, (res) => { + * console.log(`STATUS: ${res.statusCode}`); + * console.log(`HEADERS: ${JSON.stringify(res.headers)}`); + * res.setEncoding('utf8'); + * res.on('data', (chunk) => { + * console.log(`BODY: ${chunk}`); + * }); + * res.on('end', () => { + * console.log('No more data in response.'); + * }); + * }); + * + * req.on('error', (e) => { + * console.error(`problem with request: ${e.message}`); + * }); + * + * // Write data to request body + * req.write(postData); + * req.end(); + * ``` + * + * In the example `req.end()` was called. With `http.request()` one + * must always call `req.end()` to signify the end of the request - + * even if there is no data being written to the request body. + * + * If any error is encountered during the request (be that with DNS resolution, + * TCP level errors, or actual HTTP parse errors) an `'error'` event is emitted + * on the returned request object. As with all `'error'` events, if no listeners + * are registered the error will be thrown. + * + * There are a few special headers that should be noted. + * + * * Sending a 'Connection: keep-alive' will notify Node.js that the connection to + * the server should be persisted until the next request. + * * Sending a 'Content-Length' header will disable the default chunked encoding. + * * Sending an 'Expect' header will immediately send the request headers. + * Usually, when sending 'Expect: 100-continue', both a timeout and a listener + * for the `'continue'` event should be set. See RFC 2616 Section 8.2.3 for more + * information. + * * Sending an Authorization header will override using the `auth` option + * to compute basic authentication. + * + * Example using a `URL` as `options`: + * + * ```js + * const options = new URL('http://abc:xyz@example.com'); + * + * const req = http.request(options, (res) => { + * // ... + * }); + * ``` + * + * In a successful request, the following events will be emitted in the following + * order: + * + * * `'socket'` + * * `'response'` + * * `'data'` any number of times, on the `res` object + * (`'data'` will not be emitted at all if the response body is empty, for + * instance, in most redirects) + * * `'end'` on the `res` object + * * `'close'` + * + * In the case of a connection error, the following events will be emitted: + * + * * `'socket'` + * * `'error'` + * * `'close'` + * + * In the case of a premature connection close before the response is received, + * the following events will be emitted in the following order: + * + * * `'socket'` + * * `'error'` with an error with message `'Error: socket hang up'` and code`'ECONNRESET'` + * * `'close'` + * + * In the case of a premature connection close after the response is received, + * the following events will be emitted in the following order: + * + * * `'socket'` + * * `'response'` + * * `'data'` any number of times, on the `res` object + * * (connection closed here) + * * `'aborted'` on the `res` object + * * `'error'` on the `res` object with an error with message`'Error: aborted'` and code `'ECONNRESET'` + * * `'close'` + * * `'close'` on the `res` object + * + * If `req.destroy()` is called before a socket is assigned, the following + * events will be emitted in the following order: + * + * * (`req.destroy()` called here) + * * `'error'` with an error with message `'Error: socket hang up'` and code`'ECONNRESET'`, or the error with which `req.destroy()` was called + * * `'close'` + * + * If `req.destroy()` is called before the connection succeeds, the following + * events will be emitted in the following order: + * + * * `'socket'` + * * (`req.destroy()` called here) + * * `'error'` with an error with message `'Error: socket hang up'` and code`'ECONNRESET'`, or the error with which `req.destroy()` was called + * * `'close'` + * + * If `req.destroy()` is called after the response is received, the following + * events will be emitted in the following order: + * + * * `'socket'` + * * `'response'` + * * `'data'` any number of times, on the `res` object + * * (`req.destroy()` called here) + * * `'aborted'` on the `res` object + * * `'error'` on the `res` object with an error with message `'Error: aborted'`and code `'ECONNRESET'`, or the error with which `req.destroy()` was called + * * `'close'` + * * `'close'` on the `res` object + * + * If `req.abort()` is called before a socket is assigned, the following + * events will be emitted in the following order: + * + * * (`req.abort()` called here) + * * `'abort'` + * * `'close'` + * + * If `req.abort()` is called before the connection succeeds, the following + * events will be emitted in the following order: + * + * * `'socket'` + * * (`req.abort()` called here) + * * `'abort'` + * * `'error'` with an error with message `'Error: socket hang up'` and code`'ECONNRESET'` + * * `'close'` + * + * If `req.abort()` is called after the response is received, the following + * events will be emitted in the following order: + * + * * `'socket'` + * * `'response'` + * * `'data'` any number of times, on the `res` object + * * (`req.abort()` called here) + * * `'abort'` + * * `'aborted'` on the `res` object + * * `'error'` on the `res` object with an error with message`'Error: aborted'` and code `'ECONNRESET'`. + * * `'close'` + * * `'close'` on the `res` object + * + * Setting the `timeout` option or using the `setTimeout()` function will + * not abort the request or do anything besides add a `'timeout'` event. + * + * Passing an `AbortSignal` and then calling `abort()` on the corresponding`AbortController` will behave the same way as calling `.destroy()` on the + * request. Specifically, the `'error'` event will be emitted with an error with + * the message `'AbortError: The operation was aborted'`, the code `'ABORT_ERR'`and the `cause`, if one was provided. + * @since v0.3.6 + */ + function request(options: RequestOptions | string | URL, callback?: (res: IncomingMessage) => void): ClientRequest; + function request(url: string | URL, options: RequestOptions, callback?: (res: IncomingMessage) => void): ClientRequest; + /** + * Since most requests are GET requests without bodies, Node.js provides this + * convenience method. The only difference between this method and {@link request} is that it sets the method to GET by default and calls `req.end()`automatically. The callback must take care to + * consume the response + * data for reasons stated in {@link ClientRequest} section. + * + * The `callback` is invoked with a single argument that is an instance of {@link IncomingMessage}. + * + * JSON fetching example: + * + * ```js + * http.get('http://localhost:8000/', (res) => { + * const { statusCode } = res; + * const contentType = res.headers['content-type']; + * + * let error; + * // Any 2xx status code signals a successful response but + * // here we're only checking for 200. + * if (statusCode !== 200) { + * error = new Error('Request Failed.\n' + + * `Status Code: ${statusCode}`); + * } else if (!/^application\/json/.test(contentType)) { + * error = new Error('Invalid content-type.\n' + + * `Expected application/json but received ${contentType}`); + * } + * if (error) { + * console.error(error.message); + * // Consume response data to free up memory + * res.resume(); + * return; + * } + * + * res.setEncoding('utf8'); + * let rawData = ''; + * res.on('data', (chunk) => { rawData += chunk; }); + * res.on('end', () => { + * try { + * const parsedData = JSON.parse(rawData); + * console.log(parsedData); + * } catch (e) { + * console.error(e.message); + * } + * }); + * }).on('error', (e) => { + * console.error(`Got error: ${e.message}`); + * }); + * + * // Create a local server to receive data from + * const server = http.createServer((req, res) => { + * res.writeHead(200, { 'Content-Type': 'application/json' }); + * res.end(JSON.stringify({ + * data: 'Hello World!', + * })); + * }); + * + * server.listen(8000); + * ``` + * @since v0.3.6 + * @param options Accepts the same `options` as {@link request}, with the method set to GET by default. + */ + function get(options: RequestOptions | string | URL, callback?: (res: IncomingMessage) => void): ClientRequest; + function get(url: string | URL, options: RequestOptions, callback?: (res: IncomingMessage) => void): ClientRequest; + /** + * Performs the low-level validations on the provided `name` that are done when`res.setHeader(name, value)` is called. + * + * Passing illegal value as `name` will result in a `TypeError` being thrown, + * identified by `code: 'ERR_INVALID_HTTP_TOKEN'`. + * + * It is not necessary to use this method before passing headers to an HTTP request + * or response. The HTTP module will automatically validate such headers. + * Examples: + * + * Example: + * + * ```js + * import { validateHeaderName } from 'node:http'; + * + * try { + * validateHeaderName(''); + * } catch (err) { + * console.error(err instanceof TypeError); // --> true + * console.error(err.code); // --> 'ERR_INVALID_HTTP_TOKEN' + * console.error(err.message); // --> 'Header name must be a valid HTTP token [""]' + * } + * ``` + * @since v14.3.0 + * @param [label='Header name'] Label for error message. + */ + function validateHeaderName(name: string): void; + /** + * Performs the low-level validations on the provided `value` that are done when`res.setHeader(name, value)` is called. + * + * Passing illegal value as `value` will result in a `TypeError` being thrown. + * + * * Undefined value error is identified by `code: 'ERR_HTTP_INVALID_HEADER_VALUE'`. + * * Invalid value character error is identified by `code: 'ERR_INVALID_CHAR'`. + * + * It is not necessary to use this method before passing headers to an HTTP request + * or response. The HTTP module will automatically validate such headers. + * + * Examples: + * + * ```js + * import { validateHeaderValue } from 'node:http'; + * + * try { + * validateHeaderValue('x-my-header', undefined); + * } catch (err) { + * console.error(err instanceof TypeError); // --> true + * console.error(err.code === 'ERR_HTTP_INVALID_HEADER_VALUE'); // --> true + * console.error(err.message); // --> 'Invalid value "undefined" for header "x-my-header"' + * } + * + * try { + * validateHeaderValue('x-my-header', 'oʊmɪɡə'); + * } catch (err) { + * console.error(err instanceof TypeError); // --> true + * console.error(err.code === 'ERR_INVALID_CHAR'); // --> true + * console.error(err.message); // --> 'Invalid character in header content ["x-my-header"]' + * } + * ``` + * @since v14.3.0 + * @param name Header name + * @param value Header value + */ + function validateHeaderValue(name: string, value: string): void; + /** + * Set the maximum number of idle HTTP parsers. + * @since v18.8.0, v16.18.0 + * @param [max=1000] + */ + function setMaxIdleHTTPParsers(max: number): void; + let globalAgent: Agent; + /** + * Read-only property specifying the maximum allowed size of HTTP headers in bytes. + * Defaults to 16KB. Configurable using the `--max-http-header-size` CLI option. + */ + const maxHeaderSize: number; +} +declare module 'http' { + export * from 'node:http'; +} diff --git a/node_modules/@types/node/http2.d.ts b/node_modules/@types/node/http2.d.ts new file mode 100644 index 0000000..2f245a9 --- /dev/null +++ b/node_modules/@types/node/http2.d.ts @@ -0,0 +1,2129 @@ +/** + * The `node:http2` module provides an implementation of the [HTTP/2](https://tools.ietf.org/html/rfc7540) protocol. + * It can be accessed using: + * + * ```js + * const http2 = require('node:http2'); + * ``` + * @since v8.4.0 + * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/http2.js) + */ +declare module 'node:http2' { + import EventEmitter = require('node:events'); + import * as fs from 'node:fs'; + import * as net from 'node:net'; + import * as stream from 'node:stream'; + import * as tls from 'node:tls'; + import * as url from 'node:url'; + import { IncomingHttpHeaders as Http1IncomingHttpHeaders, OutgoingHttpHeaders, IncomingMessage, ServerResponse } from 'node:http'; + export { OutgoingHttpHeaders } from 'node:http'; + export interface IncomingHttpStatusHeader { + ':status'?: number | undefined; + } + export interface IncomingHttpHeaders extends Http1IncomingHttpHeaders { + ':path'?: string | undefined; + ':method'?: string | undefined; + ':authority'?: string | undefined; + ':scheme'?: string | undefined; + } + // Http2Stream + export interface StreamPriorityOptions { + exclusive?: boolean | undefined; + parent?: number | undefined; + weight?: number | undefined; + silent?: boolean | undefined; + } + export interface StreamState { + localWindowSize?: number | undefined; + state?: number | undefined; + localClose?: number | undefined; + remoteClose?: number | undefined; + sumDependencyWeight?: number | undefined; + weight?: number | undefined; + } + export interface ServerStreamResponseOptions { + endStream?: boolean | undefined; + waitForTrailers?: boolean | undefined; + } + export interface StatOptions { + offset: number; + length: number; + } + export interface ServerStreamFileResponseOptions { + statCheck?(stats: fs.Stats, headers: OutgoingHttpHeaders, statOptions: StatOptions): void | boolean; + waitForTrailers?: boolean | undefined; + offset?: number | undefined; + length?: number | undefined; + } + export interface ServerStreamFileResponseOptionsWithError extends ServerStreamFileResponseOptions { + onError?(err: NodeJS.ErrnoException): void; + } + export interface Http2Stream extends stream.Duplex { + /** + * Set to `true` if the `Http2Stream` instance was aborted abnormally. When set, + * the `'aborted'` event will have been emitted. + * @since v8.4.0 + */ + readonly aborted: boolean; + /** + * This property shows the number of characters currently buffered to be written. + * See `net.Socket.bufferSize` for details. + * @since v11.2.0, v10.16.0 + */ + readonly bufferSize: number; + /** + * Set to `true` if the `Http2Stream` instance has been closed. + * @since v9.4.0 + */ + readonly closed: boolean; + /** + * Set to `true` if the `Http2Stream` instance has been destroyed and is no longer + * usable. + * @since v8.4.0 + */ + readonly destroyed: boolean; + /** + * Set to `true` if the `END_STREAM` flag was set in the request or response + * HEADERS frame received, indicating that no additional data should be received + * and the readable side of the `Http2Stream` will be closed. + * @since v10.11.0 + */ + readonly endAfterHeaders: boolean; + /** + * The numeric stream identifier of this `Http2Stream` instance. Set to `undefined`if the stream identifier has not yet been assigned. + * @since v8.4.0 + */ + readonly id?: number | undefined; + /** + * Set to `true` if the `Http2Stream` instance has not yet been assigned a + * numeric stream identifier. + * @since v9.4.0 + */ + readonly pending: boolean; + /** + * Set to the `RST_STREAM` `error code` reported when the `Http2Stream` is + * destroyed after either receiving an `RST_STREAM` frame from the connected peer, + * calling `http2stream.close()`, or `http2stream.destroy()`. Will be`undefined` if the `Http2Stream` has not been closed. + * @since v8.4.0 + */ + readonly rstCode: number; + /** + * An object containing the outbound headers sent for this `Http2Stream`. + * @since v9.5.0 + */ + readonly sentHeaders: OutgoingHttpHeaders; + /** + * An array of objects containing the outbound informational (additional) headers + * sent for this `Http2Stream`. + * @since v9.5.0 + */ + readonly sentInfoHeaders?: OutgoingHttpHeaders[] | undefined; + /** + * An object containing the outbound trailers sent for this `HttpStream`. + * @since v9.5.0 + */ + readonly sentTrailers?: OutgoingHttpHeaders | undefined; + /** + * A reference to the `Http2Session` instance that owns this `Http2Stream`. The + * value will be `undefined` after the `Http2Stream` instance is destroyed. + * @since v8.4.0 + */ + readonly session: Http2Session | undefined; + /** + * Provides miscellaneous information about the current state of the`Http2Stream`. + * + * A current state of this `Http2Stream`. + * @since v8.4.0 + */ + readonly state: StreamState; + /** + * Closes the `Http2Stream` instance by sending an `RST_STREAM` frame to the + * connected HTTP/2 peer. + * @since v8.4.0 + * @param [code=http2.constants.NGHTTP2_NO_ERROR] Unsigned 32-bit integer identifying the error code. + * @param callback An optional function registered to listen for the `'close'` event. + */ + close(code?: number, callback?: () => void): void; + /** + * Updates the priority for this `Http2Stream` instance. + * @since v8.4.0 + */ + priority(options: StreamPriorityOptions): void; + /** + * ```js + * const http2 = require('node:http2'); + * const client = http2.connect('http://example.org:8000'); + * const { NGHTTP2_CANCEL } = http2.constants; + * const req = client.request({ ':path': '/' }); + * + * // Cancel the stream if there's no activity after 5 seconds + * req.setTimeout(5000, () => req.close(NGHTTP2_CANCEL)); + * ``` + * @since v8.4.0 + */ + setTimeout(msecs: number, callback?: () => void): void; + /** + * Sends a trailing `HEADERS` frame to the connected HTTP/2 peer. This method + * will cause the `Http2Stream` to be immediately closed and must only be + * called after the `'wantTrailers'` event has been emitted. When sending a + * request or sending a response, the `options.waitForTrailers` option must be set + * in order to keep the `Http2Stream` open after the final `DATA` frame so that + * trailers can be sent. + * + * ```js + * const http2 = require('node:http2'); + * const server = http2.createServer(); + * server.on('stream', (stream) => { + * stream.respond(undefined, { waitForTrailers: true }); + * stream.on('wantTrailers', () => { + * stream.sendTrailers({ xyz: 'abc' }); + * }); + * stream.end('Hello World'); + * }); + * ``` + * + * The HTTP/1 specification forbids trailers from containing HTTP/2 pseudo-header + * fields (e.g. `':method'`, `':path'`, etc). + * @since v10.0.0 + */ + sendTrailers(headers: OutgoingHttpHeaders): void; + addListener(event: 'aborted', listener: () => void): this; + addListener(event: 'close', listener: () => void): this; + addListener(event: 'data', listener: (chunk: Buffer | string) => void): this; + addListener(event: 'drain', listener: () => void): this; + addListener(event: 'end', listener: () => void): this; + addListener(event: 'error', listener: (err: Error) => void): this; + addListener(event: 'finish', listener: () => void): this; + addListener(event: 'frameError', listener: (frameType: number, errorCode: number) => void): this; + addListener(event: 'pipe', listener: (src: stream.Readable) => void): this; + addListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; + addListener(event: 'streamClosed', listener: (code: number) => void): this; + addListener(event: 'timeout', listener: () => void): this; + addListener(event: 'trailers', listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; + addListener(event: 'wantTrailers', listener: () => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + emit(event: 'aborted'): boolean; + emit(event: 'close'): boolean; + emit(event: 'data', chunk: Buffer | string): boolean; + emit(event: 'drain'): boolean; + emit(event: 'end'): boolean; + emit(event: 'error', err: Error): boolean; + emit(event: 'finish'): boolean; + emit(event: 'frameError', frameType: number, errorCode: number): boolean; + emit(event: 'pipe', src: stream.Readable): boolean; + emit(event: 'unpipe', src: stream.Readable): boolean; + emit(event: 'streamClosed', code: number): boolean; + emit(event: 'timeout'): boolean; + emit(event: 'trailers', trailers: IncomingHttpHeaders, flags: number): boolean; + emit(event: 'wantTrailers'): boolean; + emit(event: string | symbol, ...args: any[]): boolean; + on(event: 'aborted', listener: () => void): this; + on(event: 'close', listener: () => void): this; + on(event: 'data', listener: (chunk: Buffer | string) => void): this; + on(event: 'drain', listener: () => void): this; + on(event: 'end', listener: () => void): this; + on(event: 'error', listener: (err: Error) => void): this; + on(event: 'finish', listener: () => void): this; + on(event: 'frameError', listener: (frameType: number, errorCode: number) => void): this; + on(event: 'pipe', listener: (src: stream.Readable) => void): this; + on(event: 'unpipe', listener: (src: stream.Readable) => void): this; + on(event: 'streamClosed', listener: (code: number) => void): this; + on(event: 'timeout', listener: () => void): this; + on(event: 'trailers', listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; + on(event: 'wantTrailers', listener: () => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + once(event: 'aborted', listener: () => void): this; + once(event: 'close', listener: () => void): this; + once(event: 'data', listener: (chunk: Buffer | string) => void): this; + once(event: 'drain', listener: () => void): this; + once(event: 'end', listener: () => void): this; + once(event: 'error', listener: (err: Error) => void): this; + once(event: 'finish', listener: () => void): this; + once(event: 'frameError', listener: (frameType: number, errorCode: number) => void): this; + once(event: 'pipe', listener: (src: stream.Readable) => void): this; + once(event: 'unpipe', listener: (src: stream.Readable) => void): this; + once(event: 'streamClosed', listener: (code: number) => void): this; + once(event: 'timeout', listener: () => void): this; + once(event: 'trailers', listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; + once(event: 'wantTrailers', listener: () => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + prependListener(event: 'aborted', listener: () => void): this; + prependListener(event: 'close', listener: () => void): this; + prependListener(event: 'data', listener: (chunk: Buffer | string) => void): this; + prependListener(event: 'drain', listener: () => void): this; + prependListener(event: 'end', listener: () => void): this; + prependListener(event: 'error', listener: (err: Error) => void): this; + prependListener(event: 'finish', listener: () => void): this; + prependListener(event: 'frameError', listener: (frameType: number, errorCode: number) => void): this; + prependListener(event: 'pipe', listener: (src: stream.Readable) => void): this; + prependListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; + prependListener(event: 'streamClosed', listener: (code: number) => void): this; + prependListener(event: 'timeout', listener: () => void): this; + prependListener(event: 'trailers', listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; + prependListener(event: 'wantTrailers', listener: () => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'aborted', listener: () => void): this; + prependOnceListener(event: 'close', listener: () => void): this; + prependOnceListener(event: 'data', listener: (chunk: Buffer | string) => void): this; + prependOnceListener(event: 'drain', listener: () => void): this; + prependOnceListener(event: 'end', listener: () => void): this; + prependOnceListener(event: 'error', listener: (err: Error) => void): this; + prependOnceListener(event: 'finish', listener: () => void): this; + prependOnceListener(event: 'frameError', listener: (frameType: number, errorCode: number) => void): this; + prependOnceListener(event: 'pipe', listener: (src: stream.Readable) => void): this; + prependOnceListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; + prependOnceListener(event: 'streamClosed', listener: (code: number) => void): this; + prependOnceListener(event: 'timeout', listener: () => void): this; + prependOnceListener(event: 'trailers', listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; + prependOnceListener(event: 'wantTrailers', listener: () => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + } + export interface ClientHttp2Stream extends Http2Stream { + addListener(event: 'continue', listener: () => {}): this; + addListener(event: 'headers', listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + addListener(event: 'push', listener: (headers: IncomingHttpHeaders, flags: number) => void): this; + addListener(event: 'response', listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + emit(event: 'continue'): boolean; + emit(event: 'headers', headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number): boolean; + emit(event: 'push', headers: IncomingHttpHeaders, flags: number): boolean; + emit(event: 'response', headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number): boolean; + emit(event: string | symbol, ...args: any[]): boolean; + on(event: 'continue', listener: () => {}): this; + on(event: 'headers', listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + on(event: 'push', listener: (headers: IncomingHttpHeaders, flags: number) => void): this; + on(event: 'response', listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + once(event: 'continue', listener: () => {}): this; + once(event: 'headers', listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + once(event: 'push', listener: (headers: IncomingHttpHeaders, flags: number) => void): this; + once(event: 'response', listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + prependListener(event: 'continue', listener: () => {}): this; + prependListener(event: 'headers', listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + prependListener(event: 'push', listener: (headers: IncomingHttpHeaders, flags: number) => void): this; + prependListener(event: 'response', listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'continue', listener: () => {}): this; + prependOnceListener(event: 'headers', listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + prependOnceListener(event: 'push', listener: (headers: IncomingHttpHeaders, flags: number) => void): this; + prependOnceListener(event: 'response', listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + } + export interface ServerHttp2Stream extends Http2Stream { + /** + * True if headers were sent, false otherwise (read-only). + * @since v8.4.0 + */ + readonly headersSent: boolean; + /** + * Read-only property mapped to the `SETTINGS_ENABLE_PUSH` flag of the remote + * client's most recent `SETTINGS` frame. Will be `true` if the remote peer + * accepts push streams, `false` otherwise. Settings are the same for every`Http2Stream` in the same `Http2Session`. + * @since v8.4.0 + */ + readonly pushAllowed: boolean; + /** + * Sends an additional informational `HEADERS` frame to the connected HTTP/2 peer. + * @since v8.4.0 + */ + additionalHeaders(headers: OutgoingHttpHeaders): void; + /** + * Initiates a push stream. The callback is invoked with the new `Http2Stream`instance created for the push stream passed as the second argument, or an`Error` passed as the first argument. + * + * ```js + * const http2 = require('node:http2'); + * const server = http2.createServer(); + * server.on('stream', (stream) => { + * stream.respond({ ':status': 200 }); + * stream.pushStream({ ':path': '/' }, (err, pushStream, headers) => { + * if (err) throw err; + * pushStream.respond({ ':status': 200 }); + * pushStream.end('some pushed data'); + * }); + * stream.end('some data'); + * }); + * ``` + * + * Setting the weight of a push stream is not allowed in the `HEADERS` frame. Pass + * a `weight` value to `http2stream.priority` with the `silent` option set to`true` to enable server-side bandwidth balancing between concurrent streams. + * + * Calling `http2stream.pushStream()` from within a pushed stream is not permitted + * and will throw an error. + * @since v8.4.0 + * @param callback Callback that is called once the push stream has been initiated. + */ + pushStream(headers: OutgoingHttpHeaders, callback?: (err: Error | null, pushStream: ServerHttp2Stream, headers: OutgoingHttpHeaders) => void): void; + pushStream(headers: OutgoingHttpHeaders, options?: StreamPriorityOptions, callback?: (err: Error | null, pushStream: ServerHttp2Stream, headers: OutgoingHttpHeaders) => void): void; + /** + * ```js + * const http2 = require('node:http2'); + * const server = http2.createServer(); + * server.on('stream', (stream) => { + * stream.respond({ ':status': 200 }); + * stream.end('some data'); + * }); + * ``` + * + * Initiates a response. When the `options.waitForTrailers` option is set, the`'wantTrailers'` event will be emitted immediately after queuing the last chunk + * of payload data to be sent. The `http2stream.sendTrailers()` method can then be + * used to sent trailing header fields to the peer. + * + * When `options.waitForTrailers` is set, the `Http2Stream` will not automatically + * close when the final `DATA` frame is transmitted. User code must call either`http2stream.sendTrailers()` or `http2stream.close()` to close the`Http2Stream`. + * + * ```js + * const http2 = require('node:http2'); + * const server = http2.createServer(); + * server.on('stream', (stream) => { + * stream.respond({ ':status': 200 }, { waitForTrailers: true }); + * stream.on('wantTrailers', () => { + * stream.sendTrailers({ ABC: 'some value to send' }); + * }); + * stream.end('some data'); + * }); + * ``` + * @since v8.4.0 + */ + respond(headers?: OutgoingHttpHeaders, options?: ServerStreamResponseOptions): void; + /** + * Initiates a response whose data is read from the given file descriptor. No + * validation is performed on the given file descriptor. If an error occurs while + * attempting to read data using the file descriptor, the `Http2Stream` will be + * closed using an `RST_STREAM` frame using the standard `INTERNAL_ERROR` code. + * + * When used, the `Http2Stream` object's `Duplex` interface will be closed + * automatically. + * + * ```js + * const http2 = require('node:http2'); + * const fs = require('node:fs'); + * + * const server = http2.createServer(); + * server.on('stream', (stream) => { + * const fd = fs.openSync('/some/file', 'r'); + * + * const stat = fs.fstatSync(fd); + * const headers = { + * 'content-length': stat.size, + * 'last-modified': stat.mtime.toUTCString(), + * 'content-type': 'text/plain; charset=utf-8', + * }; + * stream.respondWithFD(fd, headers); + * stream.on('close', () => fs.closeSync(fd)); + * }); + * ``` + * + * The optional `options.statCheck` function may be specified to give user code + * an opportunity to set additional content headers based on the `fs.Stat` details + * of the given fd. If the `statCheck` function is provided, the`http2stream.respondWithFD()` method will perform an `fs.fstat()` call to + * collect details on the provided file descriptor. + * + * The `offset` and `length` options may be used to limit the response to a + * specific range subset. This can be used, for instance, to support HTTP Range + * requests. + * + * The file descriptor or `FileHandle` is not closed when the stream is closed, + * so it will need to be closed manually once it is no longer needed. + * Using the same file descriptor concurrently for multiple streams + * is not supported and may result in data loss. Re-using a file descriptor + * after a stream has finished is supported. + * + * When the `options.waitForTrailers` option is set, the `'wantTrailers'` event + * will be emitted immediately after queuing the last chunk of payload data to be + * sent. The `http2stream.sendTrailers()` method can then be used to sent trailing + * header fields to the peer. + * + * When `options.waitForTrailers` is set, the `Http2Stream` will not automatically + * close when the final `DATA` frame is transmitted. User code _must_ call either`http2stream.sendTrailers()` or `http2stream.close()` to close the`Http2Stream`. + * + * ```js + * const http2 = require('node:http2'); + * const fs = require('node:fs'); + * + * const server = http2.createServer(); + * server.on('stream', (stream) => { + * const fd = fs.openSync('/some/file', 'r'); + * + * const stat = fs.fstatSync(fd); + * const headers = { + * 'content-length': stat.size, + * 'last-modified': stat.mtime.toUTCString(), + * 'content-type': 'text/plain; charset=utf-8', + * }; + * stream.respondWithFD(fd, headers, { waitForTrailers: true }); + * stream.on('wantTrailers', () => { + * stream.sendTrailers({ ABC: 'some value to send' }); + * }); + * + * stream.on('close', () => fs.closeSync(fd)); + * }); + * ``` + * @since v8.4.0 + * @param fd A readable file descriptor. + */ + respondWithFD(fd: number | fs.promises.FileHandle, headers?: OutgoingHttpHeaders, options?: ServerStreamFileResponseOptions): void; + /** + * Sends a regular file as the response. The `path` must specify a regular file + * or an `'error'` event will be emitted on the `Http2Stream` object. + * + * When used, the `Http2Stream` object's `Duplex` interface will be closed + * automatically. + * + * The optional `options.statCheck` function may be specified to give user code + * an opportunity to set additional content headers based on the `fs.Stat` details + * of the given file: + * + * If an error occurs while attempting to read the file data, the `Http2Stream`will be closed using an `RST_STREAM` frame using the standard `INTERNAL_ERROR`code. If the `onError` callback is + * defined, then it will be called. Otherwise + * the stream will be destroyed. + * + * Example using a file path: + * + * ```js + * const http2 = require('node:http2'); + * const server = http2.createServer(); + * server.on('stream', (stream) => { + * function statCheck(stat, headers) { + * headers['last-modified'] = stat.mtime.toUTCString(); + * } + * + * function onError(err) { + * // stream.respond() can throw if the stream has been destroyed by + * // the other side. + * try { + * if (err.code === 'ENOENT') { + * stream.respond({ ':status': 404 }); + * } else { + * stream.respond({ ':status': 500 }); + * } + * } catch (err) { + * // Perform actual error handling. + * console.error(err); + * } + * stream.end(); + * } + * + * stream.respondWithFile('/some/file', + * { 'content-type': 'text/plain; charset=utf-8' }, + * { statCheck, onError }); + * }); + * ``` + * + * The `options.statCheck` function may also be used to cancel the send operation + * by returning `false`. For instance, a conditional request may check the stat + * results to determine if the file has been modified to return an appropriate`304` response: + * + * ```js + * const http2 = require('node:http2'); + * const server = http2.createServer(); + * server.on('stream', (stream) => { + * function statCheck(stat, headers) { + * // Check the stat here... + * stream.respond({ ':status': 304 }); + * return false; // Cancel the send operation + * } + * stream.respondWithFile('/some/file', + * { 'content-type': 'text/plain; charset=utf-8' }, + * { statCheck }); + * }); + * ``` + * + * The `content-length` header field will be automatically set. + * + * The `offset` and `length` options may be used to limit the response to a + * specific range subset. This can be used, for instance, to support HTTP Range + * requests. + * + * The `options.onError` function may also be used to handle all the errors + * that could happen before the delivery of the file is initiated. The + * default behavior is to destroy the stream. + * + * When the `options.waitForTrailers` option is set, the `'wantTrailers'` event + * will be emitted immediately after queuing the last chunk of payload data to be + * sent. The `http2stream.sendTrailers()` method can then be used to sent trailing + * header fields to the peer. + * + * When `options.waitForTrailers` is set, the `Http2Stream` will not automatically + * close when the final `DATA` frame is transmitted. User code must call either`http2stream.sendTrailers()` or `http2stream.close()` to close the`Http2Stream`. + * + * ```js + * const http2 = require('node:http2'); + * const server = http2.createServer(); + * server.on('stream', (stream) => { + * stream.respondWithFile('/some/file', + * { 'content-type': 'text/plain; charset=utf-8' }, + * { waitForTrailers: true }); + * stream.on('wantTrailers', () => { + * stream.sendTrailers({ ABC: 'some value to send' }); + * }); + * }); + * ``` + * @since v8.4.0 + */ + respondWithFile(path: string, headers?: OutgoingHttpHeaders, options?: ServerStreamFileResponseOptionsWithError): void; + } + // Http2Session + export interface Settings { + headerTableSize?: number | undefined; + enablePush?: boolean | undefined; + initialWindowSize?: number | undefined; + maxFrameSize?: number | undefined; + maxConcurrentStreams?: number | undefined; + maxHeaderListSize?: number | undefined; + enableConnectProtocol?: boolean | undefined; + } + export interface ClientSessionRequestOptions { + endStream?: boolean | undefined; + exclusive?: boolean | undefined; + parent?: number | undefined; + weight?: number | undefined; + waitForTrailers?: boolean | undefined; + signal?: AbortSignal | undefined; + } + export interface SessionState { + effectiveLocalWindowSize?: number | undefined; + effectiveRecvDataLength?: number | undefined; + nextStreamID?: number | undefined; + localWindowSize?: number | undefined; + lastProcStreamID?: number | undefined; + remoteWindowSize?: number | undefined; + outboundQueueSize?: number | undefined; + deflateDynamicTableSize?: number | undefined; + inflateDynamicTableSize?: number | undefined; + } + export interface Http2Session extends EventEmitter { + /** + * Value will be `undefined` if the `Http2Session` is not yet connected to a + * socket, `h2c` if the `Http2Session` is not connected to a `TLSSocket`, or + * will return the value of the connected `TLSSocket`'s own `alpnProtocol`property. + * @since v9.4.0 + */ + readonly alpnProtocol?: string | undefined; + /** + * Will be `true` if this `Http2Session` instance has been closed, otherwise`false`. + * @since v9.4.0 + */ + readonly closed: boolean; + /** + * Will be `true` if this `Http2Session` instance is still connecting, will be set + * to `false` before emitting `connect` event and/or calling the `http2.connect`callback. + * @since v10.0.0 + */ + readonly connecting: boolean; + /** + * Will be `true` if this `Http2Session` instance has been destroyed and must no + * longer be used, otherwise `false`. + * @since v8.4.0 + */ + readonly destroyed: boolean; + /** + * Value is `undefined` if the `Http2Session` session socket has not yet been + * connected, `true` if the `Http2Session` is connected with a `TLSSocket`, + * and `false` if the `Http2Session` is connected to any other kind of socket + * or stream. + * @since v9.4.0 + */ + readonly encrypted?: boolean | undefined; + /** + * A prototype-less object describing the current local settings of this`Http2Session`. The local settings are local to _this_`Http2Session` instance. + * @since v8.4.0 + */ + readonly localSettings: Settings; + /** + * If the `Http2Session` is connected to a `TLSSocket`, the `originSet` property + * will return an `Array` of origins for which the `Http2Session` may be + * considered authoritative. + * + * The `originSet` property is only available when using a secure TLS connection. + * @since v9.4.0 + */ + readonly originSet?: string[] | undefined; + /** + * Indicates whether the `Http2Session` is currently waiting for acknowledgment of + * a sent `SETTINGS` frame. Will be `true` after calling the`http2session.settings()` method. Will be `false` once all sent `SETTINGS`frames have been acknowledged. + * @since v8.4.0 + */ + readonly pendingSettingsAck: boolean; + /** + * A prototype-less object describing the current remote settings of this`Http2Session`. The remote settings are set by the _connected_ HTTP/2 peer. + * @since v8.4.0 + */ + readonly remoteSettings: Settings; + /** + * Returns a `Proxy` object that acts as a `net.Socket` (or `tls.TLSSocket`) but + * limits available methods to ones safe to use with HTTP/2. + * + * `destroy`, `emit`, `end`, `pause`, `read`, `resume`, and `write` will throw + * an error with code `ERR_HTTP2_NO_SOCKET_MANIPULATION`. See `Http2Session and Sockets` for more information. + * + * `setTimeout` method will be called on this `Http2Session`. + * + * All other interactions will be routed directly to the socket. + * @since v8.4.0 + */ + readonly socket: net.Socket | tls.TLSSocket; + /** + * Provides miscellaneous information about the current state of the`Http2Session`. + * + * An object describing the current status of this `Http2Session`. + * @since v8.4.0 + */ + readonly state: SessionState; + /** + * The `http2session.type` will be equal to`http2.constants.NGHTTP2_SESSION_SERVER` if this `Http2Session` instance is a + * server, and `http2.constants.NGHTTP2_SESSION_CLIENT` if the instance is a + * client. + * @since v8.4.0 + */ + readonly type: number; + /** + * Gracefully closes the `Http2Session`, allowing any existing streams to + * complete on their own and preventing new `Http2Stream` instances from being + * created. Once closed, `http2session.destroy()`_might_ be called if there + * are no open `Http2Stream` instances. + * + * If specified, the `callback` function is registered as a handler for the`'close'` event. + * @since v9.4.0 + */ + close(callback?: () => void): void; + /** + * Immediately terminates the `Http2Session` and the associated `net.Socket` or`tls.TLSSocket`. + * + * Once destroyed, the `Http2Session` will emit the `'close'` event. If `error`is not undefined, an `'error'` event will be emitted immediately before the`'close'` event. + * + * If there are any remaining open `Http2Streams` associated with the`Http2Session`, those will also be destroyed. + * @since v8.4.0 + * @param error An `Error` object if the `Http2Session` is being destroyed due to an error. + * @param code The HTTP/2 error code to send in the final `GOAWAY` frame. If unspecified, and `error` is not undefined, the default is `INTERNAL_ERROR`, otherwise defaults to `NO_ERROR`. + */ + destroy(error?: Error, code?: number): void; + /** + * Transmits a `GOAWAY` frame to the connected peer _without_ shutting down the`Http2Session`. + * @since v9.4.0 + * @param code An HTTP/2 error code + * @param lastStreamID The numeric ID of the last processed `Http2Stream` + * @param opaqueData A `TypedArray` or `DataView` instance containing additional data to be carried within the `GOAWAY` frame. + */ + goaway(code?: number, lastStreamID?: number, opaqueData?: NodeJS.ArrayBufferView): void; + /** + * Sends a `PING` frame to the connected HTTP/2 peer. A `callback` function must + * be provided. The method will return `true` if the `PING` was sent, `false`otherwise. + * + * The maximum number of outstanding (unacknowledged) pings is determined by the`maxOutstandingPings` configuration option. The default maximum is 10. + * + * If provided, the `payload` must be a `Buffer`, `TypedArray`, or `DataView`containing 8 bytes of data that will be transmitted with the `PING` and + * returned with the ping acknowledgment. + * + * The callback will be invoked with three arguments: an error argument that will + * be `null` if the `PING` was successfully acknowledged, a `duration` argument + * that reports the number of milliseconds elapsed since the ping was sent and the + * acknowledgment was received, and a `Buffer` containing the 8-byte `PING`payload. + * + * ```js + * session.ping(Buffer.from('abcdefgh'), (err, duration, payload) => { + * if (!err) { + * console.log(`Ping acknowledged in ${duration} milliseconds`); + * console.log(`With payload '${payload.toString()}'`); + * } + * }); + * ``` + * + * If the `payload` argument is not specified, the default payload will be the + * 64-bit timestamp (little endian) marking the start of the `PING` duration. + * @since v8.9.3 + * @param payload Optional ping payload. + */ + ping(callback: (err: Error | null, duration: number, payload: Buffer) => void): boolean; + ping(payload: NodeJS.ArrayBufferView, callback: (err: Error | null, duration: number, payload: Buffer) => void): boolean; + /** + * Calls `ref()` on this `Http2Session`instance's underlying `net.Socket`. + * @since v9.4.0 + */ + ref(): void; + /** + * Sets the local endpoint's window size. + * The `windowSize` is the total window size to set, not + * the delta. + * + * ```js + * const http2 = require('node:http2'); + * + * const server = http2.createServer(); + * const expectedWindowSize = 2 ** 20; + * server.on('connect', (session) => { + * + * // Set local window size to be 2 ** 20 + * session.setLocalWindowSize(expectedWindowSize); + * }); + * ``` + * @since v15.3.0, v14.18.0 + */ + setLocalWindowSize(windowSize: number): void; + /** + * Used to set a callback function that is called when there is no activity on + * the `Http2Session` after `msecs` milliseconds. The given `callback` is + * registered as a listener on the `'timeout'` event. + * @since v8.4.0 + */ + setTimeout(msecs: number, callback?: () => void): void; + /** + * Updates the current local settings for this `Http2Session` and sends a new`SETTINGS` frame to the connected HTTP/2 peer. + * + * Once called, the `http2session.pendingSettingsAck` property will be `true`while the session is waiting for the remote peer to acknowledge the new + * settings. + * + * The new settings will not become effective until the `SETTINGS` acknowledgment + * is received and the `'localSettings'` event is emitted. It is possible to send + * multiple `SETTINGS` frames while acknowledgment is still pending. + * @since v8.4.0 + * @param callback Callback that is called once the session is connected or right away if the session is already connected. + */ + settings(settings: Settings, callback?: (err: Error | null, settings: Settings, duration: number) => void): void; + /** + * Calls `unref()` on this `Http2Session`instance's underlying `net.Socket`. + * @since v9.4.0 + */ + unref(): void; + addListener(event: 'close', listener: () => void): this; + addListener(event: 'error', listener: (err: Error) => void): this; + addListener(event: 'frameError', listener: (frameType: number, errorCode: number, streamID: number) => void): this; + addListener(event: 'goaway', listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this; + addListener(event: 'localSettings', listener: (settings: Settings) => void): this; + addListener(event: 'ping', listener: () => void): this; + addListener(event: 'remoteSettings', listener: (settings: Settings) => void): this; + addListener(event: 'timeout', listener: () => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + emit(event: 'close'): boolean; + emit(event: 'error', err: Error): boolean; + emit(event: 'frameError', frameType: number, errorCode: number, streamID: number): boolean; + emit(event: 'goaway', errorCode: number, lastStreamID: number, opaqueData: Buffer): boolean; + emit(event: 'localSettings', settings: Settings): boolean; + emit(event: 'ping'): boolean; + emit(event: 'remoteSettings', settings: Settings): boolean; + emit(event: 'timeout'): boolean; + emit(event: string | symbol, ...args: any[]): boolean; + on(event: 'close', listener: () => void): this; + on(event: 'error', listener: (err: Error) => void): this; + on(event: 'frameError', listener: (frameType: number, errorCode: number, streamID: number) => void): this; + on(event: 'goaway', listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this; + on(event: 'localSettings', listener: (settings: Settings) => void): this; + on(event: 'ping', listener: () => void): this; + on(event: 'remoteSettings', listener: (settings: Settings) => void): this; + on(event: 'timeout', listener: () => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + once(event: 'close', listener: () => void): this; + once(event: 'error', listener: (err: Error) => void): this; + once(event: 'frameError', listener: (frameType: number, errorCode: number, streamID: number) => void): this; + once(event: 'goaway', listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this; + once(event: 'localSettings', listener: (settings: Settings) => void): this; + once(event: 'ping', listener: () => void): this; + once(event: 'remoteSettings', listener: (settings: Settings) => void): this; + once(event: 'timeout', listener: () => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + prependListener(event: 'close', listener: () => void): this; + prependListener(event: 'error', listener: (err: Error) => void): this; + prependListener(event: 'frameError', listener: (frameType: number, errorCode: number, streamID: number) => void): this; + prependListener(event: 'goaway', listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this; + prependListener(event: 'localSettings', listener: (settings: Settings) => void): this; + prependListener(event: 'ping', listener: () => void): this; + prependListener(event: 'remoteSettings', listener: (settings: Settings) => void): this; + prependListener(event: 'timeout', listener: () => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'close', listener: () => void): this; + prependOnceListener(event: 'error', listener: (err: Error) => void): this; + prependOnceListener(event: 'frameError', listener: (frameType: number, errorCode: number, streamID: number) => void): this; + prependOnceListener(event: 'goaway', listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this; + prependOnceListener(event: 'localSettings', listener: (settings: Settings) => void): this; + prependOnceListener(event: 'ping', listener: () => void): this; + prependOnceListener(event: 'remoteSettings', listener: (settings: Settings) => void): this; + prependOnceListener(event: 'timeout', listener: () => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + } + export interface ClientHttp2Session extends Http2Session { + /** + * For HTTP/2 Client `Http2Session` instances only, the `http2session.request()`creates and returns an `Http2Stream` instance that can be used to send an + * HTTP/2 request to the connected server. + * + * When a `ClientHttp2Session` is first created, the socket may not yet be + * connected. if `clienthttp2session.request()` is called during this time, the + * actual request will be deferred until the socket is ready to go. + * If the `session` is closed before the actual request be executed, an`ERR_HTTP2_GOAWAY_SESSION` is thrown. + * + * This method is only available if `http2session.type` is equal to`http2.constants.NGHTTP2_SESSION_CLIENT`. + * + * ```js + * const http2 = require('node:http2'); + * const clientSession = http2.connect('https://localhost:1234'); + * const { + * HTTP2_HEADER_PATH, + * HTTP2_HEADER_STATUS, + * } = http2.constants; + * + * const req = clientSession.request({ [HTTP2_HEADER_PATH]: '/' }); + * req.on('response', (headers) => { + * console.log(headers[HTTP2_HEADER_STATUS]); + * req.on('data', (chunk) => { // .. }); + * req.on('end', () => { // .. }); + * }); + * ``` + * + * When the `options.waitForTrailers` option is set, the `'wantTrailers'` event + * is emitted immediately after queuing the last chunk of payload data to be sent. + * The `http2stream.sendTrailers()` method can then be called to send trailing + * headers to the peer. + * + * When `options.waitForTrailers` is set, the `Http2Stream` will not automatically + * close when the final `DATA` frame is transmitted. User code must call either`http2stream.sendTrailers()` or `http2stream.close()` to close the`Http2Stream`. + * + * When `options.signal` is set with an `AbortSignal` and then `abort` on the + * corresponding `AbortController` is called, the request will emit an `'error'`event with an `AbortError` error. + * + * The `:method` and `:path` pseudo-headers are not specified within `headers`, + * they respectively default to: + * + * * `:method` \= `'GET'` + * * `:path` \= `/` + * @since v8.4.0 + */ + request(headers?: OutgoingHttpHeaders, options?: ClientSessionRequestOptions): ClientHttp2Stream; + addListener(event: 'altsvc', listener: (alt: string, origin: string, stream: number) => void): this; + addListener(event: 'origin', listener: (origins: string[]) => void): this; + addListener(event: 'connect', listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + addListener(event: 'stream', listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + emit(event: 'altsvc', alt: string, origin: string, stream: number): boolean; + emit(event: 'origin', origins: ReadonlyArray): boolean; + emit(event: 'connect', session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket): boolean; + emit(event: 'stream', stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number): boolean; + emit(event: string | symbol, ...args: any[]): boolean; + on(event: 'altsvc', listener: (alt: string, origin: string, stream: number) => void): this; + on(event: 'origin', listener: (origins: string[]) => void): this; + on(event: 'connect', listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + on(event: 'stream', listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + once(event: 'altsvc', listener: (alt: string, origin: string, stream: number) => void): this; + once(event: 'origin', listener: (origins: string[]) => void): this; + once(event: 'connect', listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + once(event: 'stream', listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + prependListener(event: 'altsvc', listener: (alt: string, origin: string, stream: number) => void): this; + prependListener(event: 'origin', listener: (origins: string[]) => void): this; + prependListener(event: 'connect', listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + prependListener(event: 'stream', listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'altsvc', listener: (alt: string, origin: string, stream: number) => void): this; + prependOnceListener(event: 'origin', listener: (origins: string[]) => void): this; + prependOnceListener(event: 'connect', listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + prependOnceListener(event: 'stream', listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + } + export interface AlternativeServiceOptions { + origin: number | string | url.URL; + } + export interface ServerHttp2Session extends Http2Session { + readonly server: Http2Server | Http2SecureServer; + /** + * Submits an `ALTSVC` frame (as defined by [RFC 7838](https://tools.ietf.org/html/rfc7838)) to the connected client. + * + * ```js + * const http2 = require('node:http2'); + * + * const server = http2.createServer(); + * server.on('session', (session) => { + * // Set altsvc for origin https://example.org:80 + * session.altsvc('h2=":8000"', 'https://example.org:80'); + * }); + * + * server.on('stream', (stream) => { + * // Set altsvc for a specific stream + * stream.session.altsvc('h2=":8000"', stream.id); + * }); + * ``` + * + * Sending an `ALTSVC` frame with a specific stream ID indicates that the alternate + * service is associated with the origin of the given `Http2Stream`. + * + * The `alt` and origin string _must_ contain only ASCII bytes and are + * strictly interpreted as a sequence of ASCII bytes. The special value `'clear'`may be passed to clear any previously set alternative service for a given + * domain. + * + * When a string is passed for the `originOrStream` argument, it will be parsed as + * a URL and the origin will be derived. For instance, the origin for the + * HTTP URL `'https://example.org/foo/bar'` is the ASCII string`'https://example.org'`. An error will be thrown if either the given string + * cannot be parsed as a URL or if a valid origin cannot be derived. + * + * A `URL` object, or any object with an `origin` property, may be passed as`originOrStream`, in which case the value of the `origin` property will be + * used. The value of the `origin` property _must_ be a properly serialized + * ASCII origin. + * @since v9.4.0 + * @param alt A description of the alternative service configuration as defined by `RFC 7838`. + * @param originOrStream Either a URL string specifying the origin (or an `Object` with an `origin` property) or the numeric identifier of an active `Http2Stream` as given by the + * `http2stream.id` property. + */ + altsvc(alt: string, originOrStream: number | string | url.URL | AlternativeServiceOptions): void; + /** + * Submits an `ORIGIN` frame (as defined by [RFC 8336](https://tools.ietf.org/html/rfc8336)) to the connected client + * to advertise the set of origins for which the server is capable of providing + * authoritative responses. + * + * ```js + * const http2 = require('node:http2'); + * const options = getSecureOptionsSomehow(); + * const server = http2.createSecureServer(options); + * server.on('stream', (stream) => { + * stream.respond(); + * stream.end('ok'); + * }); + * server.on('session', (session) => { + * session.origin('https://example.com', 'https://example.org'); + * }); + * ``` + * + * When a string is passed as an `origin`, it will be parsed as a URL and the + * origin will be derived. For instance, the origin for the HTTP URL`'https://example.org/foo/bar'` is the ASCII string`'https://example.org'`. An error will be thrown if either the given + * string + * cannot be parsed as a URL or if a valid origin cannot be derived. + * + * A `URL` object, or any object with an `origin` property, may be passed as + * an `origin`, in which case the value of the `origin` property will be + * used. The value of the `origin` property _must_ be a properly serialized + * ASCII origin. + * + * Alternatively, the `origins` option may be used when creating a new HTTP/2 + * server using the `http2.createSecureServer()` method: + * + * ```js + * const http2 = require('node:http2'); + * const options = getSecureOptionsSomehow(); + * options.origins = ['https://example.com', 'https://example.org']; + * const server = http2.createSecureServer(options); + * server.on('stream', (stream) => { + * stream.respond(); + * stream.end('ok'); + * }); + * ``` + * @since v10.12.0 + * @param origins One or more URL Strings passed as separate arguments. + */ + origin( + ...origins: Array< + | string + | url.URL + | { + origin: string; + } + > + ): void; + addListener(event: 'connect', listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + addListener(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + emit(event: 'connect', session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket): boolean; + emit(event: 'stream', stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number): boolean; + emit(event: string | symbol, ...args: any[]): boolean; + on(event: 'connect', listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + on(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + once(event: 'connect', listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + once(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + prependListener(event: 'connect', listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + prependListener(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'connect', listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + prependOnceListener(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + } + // Http2Server + export interface SessionOptions { + maxDeflateDynamicTableSize?: number | undefined; + maxSessionMemory?: number | undefined; + maxHeaderListPairs?: number | undefined; + maxOutstandingPings?: number | undefined; + maxSendHeaderBlockLength?: number | undefined; + paddingStrategy?: number | undefined; + peerMaxConcurrentStreams?: number | undefined; + settings?: Settings | undefined; + /** + * Specifies a timeout in milliseconds that + * a server should wait when an [`'unknownProtocol'`][] is emitted. If the + * socket has not been destroyed by that time the server will destroy it. + * @default 100000 + */ + unknownProtocolTimeout?: number | undefined; + selectPadding?(frameLen: number, maxFrameLen: number): number; + } + export interface ClientSessionOptions extends SessionOptions { + maxReservedRemoteStreams?: number | undefined; + createConnection?: ((authority: url.URL, option: SessionOptions) => stream.Duplex) | undefined; + protocol?: 'http:' | 'https:' | undefined; + } + export interface ServerSessionOptions extends SessionOptions { + Http1IncomingMessage?: typeof IncomingMessage | undefined; + Http1ServerResponse?: typeof ServerResponse | undefined; + Http2ServerRequest?: typeof Http2ServerRequest | undefined; + Http2ServerResponse?: typeof Http2ServerResponse | undefined; + } + export interface SecureClientSessionOptions extends ClientSessionOptions, tls.ConnectionOptions {} + export interface SecureServerSessionOptions extends ServerSessionOptions, tls.TlsOptions {} + export interface ServerOptions extends ServerSessionOptions {} + export interface SecureServerOptions extends SecureServerSessionOptions { + allowHTTP1?: boolean | undefined; + origins?: string[] | undefined; + } + interface HTTP2ServerCommon { + setTimeout(msec?: number, callback?: () => void): this; + /** + * Throws ERR_HTTP2_INVALID_SETTING_VALUE for invalid settings values. + * Throws ERR_INVALID_ARG_TYPE for invalid settings argument. + */ + updateSettings(settings: Settings): void; + } + export interface Http2Server extends net.Server, HTTP2ServerCommon { + addListener(event: 'checkContinue', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + addListener(event: 'request', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + addListener(event: 'session', listener: (session: ServerHttp2Session) => void): this; + addListener(event: 'sessionError', listener: (err: Error) => void): this; + addListener(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + addListener(event: 'timeout', listener: () => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + emit(event: 'checkContinue', request: Http2ServerRequest, response: Http2ServerResponse): boolean; + emit(event: 'request', request: Http2ServerRequest, response: Http2ServerResponse): boolean; + emit(event: 'session', session: ServerHttp2Session): boolean; + emit(event: 'sessionError', err: Error): boolean; + emit(event: 'stream', stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number): boolean; + emit(event: 'timeout'): boolean; + emit(event: string | symbol, ...args: any[]): boolean; + on(event: 'checkContinue', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + on(event: 'request', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + on(event: 'session', listener: (session: ServerHttp2Session) => void): this; + on(event: 'sessionError', listener: (err: Error) => void): this; + on(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + on(event: 'timeout', listener: () => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + once(event: 'checkContinue', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + once(event: 'request', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + once(event: 'session', listener: (session: ServerHttp2Session) => void): this; + once(event: 'sessionError', listener: (err: Error) => void): this; + once(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + once(event: 'timeout', listener: () => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + prependListener(event: 'checkContinue', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + prependListener(event: 'request', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + prependListener(event: 'session', listener: (session: ServerHttp2Session) => void): this; + prependListener(event: 'sessionError', listener: (err: Error) => void): this; + prependListener(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + prependListener(event: 'timeout', listener: () => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'checkContinue', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + prependOnceListener(event: 'request', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + prependOnceListener(event: 'session', listener: (session: ServerHttp2Session) => void): this; + prependOnceListener(event: 'sessionError', listener: (err: Error) => void): this; + prependOnceListener(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + prependOnceListener(event: 'timeout', listener: () => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + } + export interface Http2SecureServer extends tls.Server, HTTP2ServerCommon { + addListener(event: 'checkContinue', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + addListener(event: 'request', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + addListener(event: 'session', listener: (session: ServerHttp2Session) => void): this; + addListener(event: 'sessionError', listener: (err: Error) => void): this; + addListener(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + addListener(event: 'timeout', listener: () => void): this; + addListener(event: 'unknownProtocol', listener: (socket: tls.TLSSocket) => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + emit(event: 'checkContinue', request: Http2ServerRequest, response: Http2ServerResponse): boolean; + emit(event: 'request', request: Http2ServerRequest, response: Http2ServerResponse): boolean; + emit(event: 'session', session: ServerHttp2Session): boolean; + emit(event: 'sessionError', err: Error): boolean; + emit(event: 'stream', stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number): boolean; + emit(event: 'timeout'): boolean; + emit(event: 'unknownProtocol', socket: tls.TLSSocket): boolean; + emit(event: string | symbol, ...args: any[]): boolean; + on(event: 'checkContinue', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + on(event: 'request', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + on(event: 'session', listener: (session: ServerHttp2Session) => void): this; + on(event: 'sessionError', listener: (err: Error) => void): this; + on(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + on(event: 'timeout', listener: () => void): this; + on(event: 'unknownProtocol', listener: (socket: tls.TLSSocket) => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + once(event: 'checkContinue', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + once(event: 'request', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + once(event: 'session', listener: (session: ServerHttp2Session) => void): this; + once(event: 'sessionError', listener: (err: Error) => void): this; + once(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + once(event: 'timeout', listener: () => void): this; + once(event: 'unknownProtocol', listener: (socket: tls.TLSSocket) => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + prependListener(event: 'checkContinue', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + prependListener(event: 'request', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + prependListener(event: 'session', listener: (session: ServerHttp2Session) => void): this; + prependListener(event: 'sessionError', listener: (err: Error) => void): this; + prependListener(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + prependListener(event: 'timeout', listener: () => void): this; + prependListener(event: 'unknownProtocol', listener: (socket: tls.TLSSocket) => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'checkContinue', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + prependOnceListener(event: 'request', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + prependOnceListener(event: 'session', listener: (session: ServerHttp2Session) => void): this; + prependOnceListener(event: 'sessionError', listener: (err: Error) => void): this; + prependOnceListener(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + prependOnceListener(event: 'timeout', listener: () => void): this; + prependOnceListener(event: 'unknownProtocol', listener: (socket: tls.TLSSocket) => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + } + /** + * A `Http2ServerRequest` object is created by {@link Server} or {@link SecureServer} and passed as the first argument to the `'request'` event. It may be used to access a request status, + * headers, and + * data. + * @since v8.4.0 + */ + export class Http2ServerRequest extends stream.Readable { + constructor(stream: ServerHttp2Stream, headers: IncomingHttpHeaders, options: stream.ReadableOptions, rawHeaders: ReadonlyArray); + /** + * The `request.aborted` property will be `true` if the request has + * been aborted. + * @since v10.1.0 + */ + readonly aborted: boolean; + /** + * The request authority pseudo header field. Because HTTP/2 allows requests + * to set either `:authority` or `host`, this value is derived from`req.headers[':authority']` if present. Otherwise, it is derived from`req.headers['host']`. + * @since v8.4.0 + */ + readonly authority: string; + /** + * See `request.socket`. + * @since v8.4.0 + * @deprecated Since v13.0.0 - Use `socket`. + */ + readonly connection: net.Socket | tls.TLSSocket; + /** + * The `request.complete` property will be `true` if the request has + * been completed, aborted, or destroyed. + * @since v12.10.0 + */ + readonly complete: boolean; + /** + * The request/response headers object. + * + * Key-value pairs of header names and values. Header names are lower-cased. + * + * ```js + * // Prints something like: + * // + * // { 'user-agent': 'curl/7.22.0', + * // host: '127.0.0.1:8000', + * // accept: '*' } + * console.log(request.headers); + * ``` + * + * See `HTTP/2 Headers Object`. + * + * In HTTP/2, the request path, host name, protocol, and method are represented as + * special headers prefixed with the `:` character (e.g. `':path'`). These special + * headers will be included in the `request.headers` object. Care must be taken not + * to inadvertently modify these special headers or errors may occur. For instance, + * removing all headers from the request will cause errors to occur: + * + * ```js + * removeAllHeaders(request.headers); + * assert(request.url); // Fails because the :path header has been removed + * ``` + * @since v8.4.0 + */ + readonly headers: IncomingHttpHeaders; + /** + * In case of server request, the HTTP version sent by the client. In the case of + * client response, the HTTP version of the connected-to server. Returns`'2.0'`. + * + * Also `message.httpVersionMajor` is the first integer and`message.httpVersionMinor` is the second. + * @since v8.4.0 + */ + readonly httpVersion: string; + readonly httpVersionMinor: number; + readonly httpVersionMajor: number; + /** + * The request method as a string. Read-only. Examples: `'GET'`, `'DELETE'`. + * @since v8.4.0 + */ + readonly method: string; + /** + * The raw request/response headers list exactly as they were received. + * + * The keys and values are in the same list. It is _not_ a + * list of tuples. So, the even-numbered offsets are key values, and the + * odd-numbered offsets are the associated values. + * + * Header names are not lowercased, and duplicates are not merged. + * + * ```js + * // Prints something like: + * // + * // [ 'user-agent', + * // 'this is invalid because there can be only one', + * // 'User-Agent', + * // 'curl/7.22.0', + * // 'Host', + * // '127.0.0.1:8000', + * // 'ACCEPT', + * // '*' ] + * console.log(request.rawHeaders); + * ``` + * @since v8.4.0 + */ + readonly rawHeaders: string[]; + /** + * The raw request/response trailer keys and values exactly as they were + * received. Only populated at the `'end'` event. + * @since v8.4.0 + */ + readonly rawTrailers: string[]; + /** + * The request scheme pseudo header field indicating the scheme + * portion of the target URL. + * @since v8.4.0 + */ + readonly scheme: string; + /** + * Returns a `Proxy` object that acts as a `net.Socket` (or `tls.TLSSocket`) but + * applies getters, setters, and methods based on HTTP/2 logic. + * + * `destroyed`, `readable`, and `writable` properties will be retrieved from and + * set on `request.stream`. + * + * `destroy`, `emit`, `end`, `on` and `once` methods will be called on`request.stream`. + * + * `setTimeout` method will be called on `request.stream.session`. + * + * `pause`, `read`, `resume`, and `write` will throw an error with code`ERR_HTTP2_NO_SOCKET_MANIPULATION`. See `Http2Session and Sockets` for + * more information. + * + * All other interactions will be routed directly to the socket. With TLS support, + * use `request.socket.getPeerCertificate()` to obtain the client's + * authentication details. + * @since v8.4.0 + */ + readonly socket: net.Socket | tls.TLSSocket; + /** + * The `Http2Stream` object backing the request. + * @since v8.4.0 + */ + readonly stream: ServerHttp2Stream; + /** + * The request/response trailers object. Only populated at the `'end'` event. + * @since v8.4.0 + */ + readonly trailers: IncomingHttpHeaders; + /** + * Request URL string. This contains only the URL that is present in the actual + * HTTP request. If the request is: + * + * ```http + * GET /status?name=ryan HTTP/1.1 + * Accept: text/plain + * ``` + * + * Then `request.url` will be: + * + * ```js + * '/status?name=ryan' + * ``` + * + * To parse the url into its parts, `new URL()` can be used: + * + * ```console + * $ node + * > new URL('/status?name=ryan', 'http://example.com') + * URL { + * href: 'http://example.com/status?name=ryan', + * origin: 'http://example.com', + * protocol: 'http:', + * username: '', + * password: '', + * host: 'example.com', + * hostname: 'example.com', + * port: '', + * pathname: '/status', + * search: '?name=ryan', + * searchParams: URLSearchParams { 'name' => 'ryan' }, + * hash: '' + * } + * ``` + * @since v8.4.0 + */ + url: string; + /** + * Sets the `Http2Stream`'s timeout value to `msecs`. If a callback is + * provided, then it is added as a listener on the `'timeout'` event on + * the response object. + * + * If no `'timeout'` listener is added to the request, the response, or + * the server, then `Http2Stream` s are destroyed when they time out. If a + * handler is assigned to the request, the response, or the server's `'timeout'`events, timed out sockets must be handled explicitly. + * @since v8.4.0 + */ + setTimeout(msecs: number, callback?: () => void): void; + read(size?: number): Buffer | string | null; + addListener(event: 'aborted', listener: (hadError: boolean, code: number) => void): this; + addListener(event: 'close', listener: () => void): this; + addListener(event: 'data', listener: (chunk: Buffer | string) => void): this; + addListener(event: 'end', listener: () => void): this; + addListener(event: 'readable', listener: () => void): this; + addListener(event: 'error', listener: (err: Error) => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + emit(event: 'aborted', hadError: boolean, code: number): boolean; + emit(event: 'close'): boolean; + emit(event: 'data', chunk: Buffer | string): boolean; + emit(event: 'end'): boolean; + emit(event: 'readable'): boolean; + emit(event: 'error', err: Error): boolean; + emit(event: string | symbol, ...args: any[]): boolean; + on(event: 'aborted', listener: (hadError: boolean, code: number) => void): this; + on(event: 'close', listener: () => void): this; + on(event: 'data', listener: (chunk: Buffer | string) => void): this; + on(event: 'end', listener: () => void): this; + on(event: 'readable', listener: () => void): this; + on(event: 'error', listener: (err: Error) => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + once(event: 'aborted', listener: (hadError: boolean, code: number) => void): this; + once(event: 'close', listener: () => void): this; + once(event: 'data', listener: (chunk: Buffer | string) => void): this; + once(event: 'end', listener: () => void): this; + once(event: 'readable', listener: () => void): this; + once(event: 'error', listener: (err: Error) => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + prependListener(event: 'aborted', listener: (hadError: boolean, code: number) => void): this; + prependListener(event: 'close', listener: () => void): this; + prependListener(event: 'data', listener: (chunk: Buffer | string) => void): this; + prependListener(event: 'end', listener: () => void): this; + prependListener(event: 'readable', listener: () => void): this; + prependListener(event: 'error', listener: (err: Error) => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'aborted', listener: (hadError: boolean, code: number) => void): this; + prependOnceListener(event: 'close', listener: () => void): this; + prependOnceListener(event: 'data', listener: (chunk: Buffer | string) => void): this; + prependOnceListener(event: 'end', listener: () => void): this; + prependOnceListener(event: 'readable', listener: () => void): this; + prependOnceListener(event: 'error', listener: (err: Error) => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + } + /** + * This object is created internally by an HTTP server, not by the user. It is + * passed as the second parameter to the `'request'` event. + * @since v8.4.0 + */ + export class Http2ServerResponse extends stream.Writable { + constructor(stream: ServerHttp2Stream); + /** + * See `response.socket`. + * @since v8.4.0 + * @deprecated Since v13.0.0 - Use `socket`. + */ + readonly connection: net.Socket | tls.TLSSocket; + /** + * Boolean value that indicates whether the response has completed. Starts + * as `false`. After `response.end()` executes, the value will be `true`. + * @since v8.4.0 + * @deprecated Since v13.4.0,v12.16.0 - Use `writableEnded`. + */ + readonly finished: boolean; + /** + * True if headers were sent, false otherwise (read-only). + * @since v8.4.0 + */ + readonly headersSent: boolean; + /** + * A reference to the original HTTP2 `request` object. + * @since v15.7.0 + */ + readonly req: Http2ServerRequest; + /** + * Returns a `Proxy` object that acts as a `net.Socket` (or `tls.TLSSocket`) but + * applies getters, setters, and methods based on HTTP/2 logic. + * + * `destroyed`, `readable`, and `writable` properties will be retrieved from and + * set on `response.stream`. + * + * `destroy`, `emit`, `end`, `on` and `once` methods will be called on`response.stream`. + * + * `setTimeout` method will be called on `response.stream.session`. + * + * `pause`, `read`, `resume`, and `write` will throw an error with code`ERR_HTTP2_NO_SOCKET_MANIPULATION`. See `Http2Session and Sockets` for + * more information. + * + * All other interactions will be routed directly to the socket. + * + * ```js + * const http2 = require('node:http2'); + * const server = http2.createServer((req, res) => { + * const ip = req.socket.remoteAddress; + * const port = req.socket.remotePort; + * res.end(`Your IP address is ${ip} and your source port is ${port}.`); + * }).listen(3000); + * ``` + * @since v8.4.0 + */ + readonly socket: net.Socket | tls.TLSSocket; + /** + * The `Http2Stream` object backing the response. + * @since v8.4.0 + */ + readonly stream: ServerHttp2Stream; + /** + * When true, the Date header will be automatically generated and sent in + * the response if it is not already present in the headers. Defaults to true. + * + * This should only be disabled for testing; HTTP requires the Date header + * in responses. + * @since v8.4.0 + */ + sendDate: boolean; + /** + * When using implicit headers (not calling `response.writeHead()` explicitly), + * this property controls the status code that will be sent to the client when + * the headers get flushed. + * + * ```js + * response.statusCode = 404; + * ``` + * + * After response header was sent to the client, this property indicates the + * status code which was sent out. + * @since v8.4.0 + */ + statusCode: number; + /** + * Status message is not supported by HTTP/2 (RFC 7540 8.1.2.4). It returns + * an empty string. + * @since v8.4.0 + */ + statusMessage: ''; + /** + * This method adds HTTP trailing headers (a header but at the end of the + * message) to the response. + * + * Attempting to set a header field name or value that contains invalid characters + * will result in a `TypeError` being thrown. + * @since v8.4.0 + */ + addTrailers(trailers: OutgoingHttpHeaders): void; + /** + * This method signals to the server that all of the response headers and body + * have been sent; that server should consider this message complete. + * The method, `response.end()`, MUST be called on each response. + * + * If `data` is specified, it is equivalent to calling `response.write(data, encoding)` followed by `response.end(callback)`. + * + * If `callback` is specified, it will be called when the response stream + * is finished. + * @since v8.4.0 + */ + end(callback?: () => void): this; + end(data: string | Uint8Array, callback?: () => void): this; + end(data: string | Uint8Array, encoding: BufferEncoding, callback?: () => void): this; + /** + * Reads out a header that has already been queued but not sent to the client. + * The name is case-insensitive. + * + * ```js + * const contentType = response.getHeader('content-type'); + * ``` + * @since v8.4.0 + */ + getHeader(name: string): string; + /** + * Returns an array containing the unique names of the current outgoing headers. + * All header names are lowercase. + * + * ```js + * response.setHeader('Foo', 'bar'); + * response.setHeader('Set-Cookie', ['foo=bar', 'bar=baz']); + * + * const headerNames = response.getHeaderNames(); + * // headerNames === ['foo', 'set-cookie'] + * ``` + * @since v8.4.0 + */ + getHeaderNames(): string[]; + /** + * Returns a shallow copy of the current outgoing headers. Since a shallow copy + * is used, array values may be mutated without additional calls to various + * header-related http module methods. The keys of the returned object are the + * header names and the values are the respective header values. All header names + * are lowercase. + * + * The object returned by the `response.getHeaders()` method _does not_prototypically inherit from the JavaScript `Object`. This means that typical`Object` methods such as `obj.toString()`, + * `obj.hasOwnProperty()`, and others + * are not defined and _will not work_. + * + * ```js + * response.setHeader('Foo', 'bar'); + * response.setHeader('Set-Cookie', ['foo=bar', 'bar=baz']); + * + * const headers = response.getHeaders(); + * // headers === { foo: 'bar', 'set-cookie': ['foo=bar', 'bar=baz'] } + * ``` + * @since v8.4.0 + */ + getHeaders(): OutgoingHttpHeaders; + /** + * Returns `true` if the header identified by `name` is currently set in the + * outgoing headers. The header name matching is case-insensitive. + * + * ```js + * const hasContentType = response.hasHeader('content-type'); + * ``` + * @since v8.4.0 + */ + hasHeader(name: string): boolean; + /** + * Removes a header that has been queued for implicit sending. + * + * ```js + * response.removeHeader('Content-Encoding'); + * ``` + * @since v8.4.0 + */ + removeHeader(name: string): void; + /** + * Sets a single header value for implicit headers. If this header already exists + * in the to-be-sent headers, its value will be replaced. Use an array of strings + * here to send multiple headers with the same name. + * + * ```js + * response.setHeader('Content-Type', 'text/html; charset=utf-8'); + * ``` + * + * or + * + * ```js + * response.setHeader('Set-Cookie', ['type=ninja', 'language=javascript']); + * ``` + * + * Attempting to set a header field name or value that contains invalid characters + * will result in a `TypeError` being thrown. + * + * When headers have been set with `response.setHeader()`, they will be merged + * with any headers passed to `response.writeHead()`, with the headers passed + * to `response.writeHead()` given precedence. + * + * ```js + * // Returns content-type = text/plain + * const server = http2.createServer((req, res) => { + * res.setHeader('Content-Type', 'text/html; charset=utf-8'); + * res.setHeader('X-Foo', 'bar'); + * res.writeHead(200, { 'Content-Type': 'text/plain; charset=utf-8' }); + * res.end('ok'); + * }); + * ``` + * @since v8.4.0 + */ + setHeader(name: string, value: number | string | ReadonlyArray): void; + /** + * Sets the `Http2Stream`'s timeout value to `msecs`. If a callback is + * provided, then it is added as a listener on the `'timeout'` event on + * the response object. + * + * If no `'timeout'` listener is added to the request, the response, or + * the server, then `Http2Stream` s are destroyed when they time out. If a + * handler is assigned to the request, the response, or the server's `'timeout'`events, timed out sockets must be handled explicitly. + * @since v8.4.0 + */ + setTimeout(msecs: number, callback?: () => void): void; + /** + * If this method is called and `response.writeHead()` has not been called, + * it will switch to implicit header mode and flush the implicit headers. + * + * This sends a chunk of the response body. This method may + * be called multiple times to provide successive parts of the body. + * + * In the `node:http` module, the response body is omitted when the + * request is a HEAD request. Similarly, the `204` and `304` responses _must not_ include a message body. + * + * `chunk` can be a string or a buffer. If `chunk` is a string, + * the second parameter specifies how to encode it into a byte stream. + * By default the `encoding` is `'utf8'`. `callback` will be called when this chunk + * of data is flushed. + * + * This is the raw HTTP body and has nothing to do with higher-level multi-part + * body encodings that may be used. + * + * The first time `response.write()` is called, it will send the buffered + * header information and the first chunk of the body to the client. The second + * time `response.write()` is called, Node.js assumes data will be streamed, + * and sends the new data separately. That is, the response is buffered up to the + * first chunk of the body. + * + * Returns `true` if the entire data was flushed successfully to the kernel + * buffer. Returns `false` if all or part of the data was queued in user memory.`'drain'` will be emitted when the buffer is free again. + * @since v8.4.0 + */ + write(chunk: string | Uint8Array, callback?: (err: Error) => void): boolean; + write(chunk: string | Uint8Array, encoding: BufferEncoding, callback?: (err: Error) => void): boolean; + /** + * Sends a status `100 Continue` to the client, indicating that the request body + * should be sent. See the `'checkContinue'` event on `Http2Server` and`Http2SecureServer`. + * @since v8.4.0 + */ + writeContinue(): void; + /** + * Sends a status `103 Early Hints` to the client with a Link header, + * indicating that the user agent can preload/preconnect the linked resources. + * The `hints` is an object containing the values of headers to be sent with + * early hints message. + * + * **Example** + * + * ```js + * const earlyHintsLink = '; rel=preload; as=style'; + * response.writeEarlyHints({ + * 'link': earlyHintsLink, + * }); + * + * const earlyHintsLinks = [ + * '; rel=preload; as=style', + * '; rel=preload; as=script', + * ]; + * response.writeEarlyHints({ + * 'link': earlyHintsLinks, + * }); + * ``` + * @since v18.11.0 + */ + writeEarlyHints(hints: Record): void; + /** + * Sends a response header to the request. The status code is a 3-digit HTTP + * status code, like `404`. The last argument, `headers`, are the response headers. + * + * Returns a reference to the `Http2ServerResponse`, so that calls can be chained. + * + * For compatibility with `HTTP/1`, a human-readable `statusMessage` may be + * passed as the second argument. However, because the `statusMessage` has no + * meaning within HTTP/2, the argument will have no effect and a process warning + * will be emitted. + * + * ```js + * const body = 'hello world'; + * response.writeHead(200, { + * 'Content-Length': Buffer.byteLength(body), + * 'Content-Type': 'text/plain; charset=utf-8', + * }); + * ``` + * + * `Content-Length` is given in bytes not characters. The`Buffer.byteLength()` API may be used to determine the number of bytes in a + * given encoding. On outbound messages, Node.js does not check if Content-Length + * and the length of the body being transmitted are equal or not. However, when + * receiving messages, Node.js will automatically reject messages when the`Content-Length` does not match the actual payload size. + * + * This method may be called at most one time on a message before `response.end()` is called. + * + * If `response.write()` or `response.end()` are called before calling + * this, the implicit/mutable headers will be calculated and call this function. + * + * When headers have been set with `response.setHeader()`, they will be merged + * with any headers passed to `response.writeHead()`, with the headers passed + * to `response.writeHead()` given precedence. + * + * ```js + * // Returns content-type = text/plain + * const server = http2.createServer((req, res) => { + * res.setHeader('Content-Type', 'text/html; charset=utf-8'); + * res.setHeader('X-Foo', 'bar'); + * res.writeHead(200, { 'Content-Type': 'text/plain; charset=utf-8' }); + * res.end('ok'); + * }); + * ``` + * + * Attempting to set a header field name or value that contains invalid characters + * will result in a `TypeError` being thrown. + * @since v8.4.0 + */ + writeHead(statusCode: number, headers?: OutgoingHttpHeaders): this; + writeHead(statusCode: number, statusMessage: string, headers?: OutgoingHttpHeaders): this; + /** + * Call `http2stream.pushStream()` with the given headers, and wrap the + * given `Http2Stream` on a newly created `Http2ServerResponse` as the callback + * parameter if successful. When `Http2ServerRequest` is closed, the callback is + * called with an error `ERR_HTTP2_INVALID_STREAM`. + * @since v8.4.0 + * @param headers An object describing the headers + * @param callback Called once `http2stream.pushStream()` is finished, or either when the attempt to create the pushed `Http2Stream` has failed or has been rejected, or the state of + * `Http2ServerRequest` is closed prior to calling the `http2stream.pushStream()` method + */ + createPushResponse(headers: OutgoingHttpHeaders, callback: (err: Error | null, res: Http2ServerResponse) => void): void; + addListener(event: 'close', listener: () => void): this; + addListener(event: 'drain', listener: () => void): this; + addListener(event: 'error', listener: (error: Error) => void): this; + addListener(event: 'finish', listener: () => void): this; + addListener(event: 'pipe', listener: (src: stream.Readable) => void): this; + addListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + emit(event: 'close'): boolean; + emit(event: 'drain'): boolean; + emit(event: 'error', error: Error): boolean; + emit(event: 'finish'): boolean; + emit(event: 'pipe', src: stream.Readable): boolean; + emit(event: 'unpipe', src: stream.Readable): boolean; + emit(event: string | symbol, ...args: any[]): boolean; + on(event: 'close', listener: () => void): this; + on(event: 'drain', listener: () => void): this; + on(event: 'error', listener: (error: Error) => void): this; + on(event: 'finish', listener: () => void): this; + on(event: 'pipe', listener: (src: stream.Readable) => void): this; + on(event: 'unpipe', listener: (src: stream.Readable) => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + once(event: 'close', listener: () => void): this; + once(event: 'drain', listener: () => void): this; + once(event: 'error', listener: (error: Error) => void): this; + once(event: 'finish', listener: () => void): this; + once(event: 'pipe', listener: (src: stream.Readable) => void): this; + once(event: 'unpipe', listener: (src: stream.Readable) => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + prependListener(event: 'close', listener: () => void): this; + prependListener(event: 'drain', listener: () => void): this; + prependListener(event: 'error', listener: (error: Error) => void): this; + prependListener(event: 'finish', listener: () => void): this; + prependListener(event: 'pipe', listener: (src: stream.Readable) => void): this; + prependListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'close', listener: () => void): this; + prependOnceListener(event: 'drain', listener: () => void): this; + prependOnceListener(event: 'error', listener: (error: Error) => void): this; + prependOnceListener(event: 'finish', listener: () => void): this; + prependOnceListener(event: 'pipe', listener: (src: stream.Readable) => void): this; + prependOnceListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + } + export namespace constants { + const NGHTTP2_SESSION_SERVER: number; + const NGHTTP2_SESSION_CLIENT: number; + const NGHTTP2_STREAM_STATE_IDLE: number; + const NGHTTP2_STREAM_STATE_OPEN: number; + const NGHTTP2_STREAM_STATE_RESERVED_LOCAL: number; + const NGHTTP2_STREAM_STATE_RESERVED_REMOTE: number; + const NGHTTP2_STREAM_STATE_HALF_CLOSED_LOCAL: number; + const NGHTTP2_STREAM_STATE_HALF_CLOSED_REMOTE: number; + const NGHTTP2_STREAM_STATE_CLOSED: number; + const NGHTTP2_NO_ERROR: number; + const NGHTTP2_PROTOCOL_ERROR: number; + const NGHTTP2_INTERNAL_ERROR: number; + const NGHTTP2_FLOW_CONTROL_ERROR: number; + const NGHTTP2_SETTINGS_TIMEOUT: number; + const NGHTTP2_STREAM_CLOSED: number; + const NGHTTP2_FRAME_SIZE_ERROR: number; + const NGHTTP2_REFUSED_STREAM: number; + const NGHTTP2_CANCEL: number; + const NGHTTP2_COMPRESSION_ERROR: number; + const NGHTTP2_CONNECT_ERROR: number; + const NGHTTP2_ENHANCE_YOUR_CALM: number; + const NGHTTP2_INADEQUATE_SECURITY: number; + const NGHTTP2_HTTP_1_1_REQUIRED: number; + const NGHTTP2_ERR_FRAME_SIZE_ERROR: number; + const NGHTTP2_FLAG_NONE: number; + const NGHTTP2_FLAG_END_STREAM: number; + const NGHTTP2_FLAG_END_HEADERS: number; + const NGHTTP2_FLAG_ACK: number; + const NGHTTP2_FLAG_PADDED: number; + const NGHTTP2_FLAG_PRIORITY: number; + const DEFAULT_SETTINGS_HEADER_TABLE_SIZE: number; + const DEFAULT_SETTINGS_ENABLE_PUSH: number; + const DEFAULT_SETTINGS_INITIAL_WINDOW_SIZE: number; + const DEFAULT_SETTINGS_MAX_FRAME_SIZE: number; + const MAX_MAX_FRAME_SIZE: number; + const MIN_MAX_FRAME_SIZE: number; + const MAX_INITIAL_WINDOW_SIZE: number; + const NGHTTP2_DEFAULT_WEIGHT: number; + const NGHTTP2_SETTINGS_HEADER_TABLE_SIZE: number; + const NGHTTP2_SETTINGS_ENABLE_PUSH: number; + const NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS: number; + const NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE: number; + const NGHTTP2_SETTINGS_MAX_FRAME_SIZE: number; + const NGHTTP2_SETTINGS_MAX_HEADER_LIST_SIZE: number; + const PADDING_STRATEGY_NONE: number; + const PADDING_STRATEGY_MAX: number; + const PADDING_STRATEGY_CALLBACK: number; + const HTTP2_HEADER_STATUS: string; + const HTTP2_HEADER_METHOD: string; + const HTTP2_HEADER_AUTHORITY: string; + const HTTP2_HEADER_SCHEME: string; + const HTTP2_HEADER_PATH: string; + const HTTP2_HEADER_ACCEPT_CHARSET: string; + const HTTP2_HEADER_ACCEPT_ENCODING: string; + const HTTP2_HEADER_ACCEPT_LANGUAGE: string; + const HTTP2_HEADER_ACCEPT_RANGES: string; + const HTTP2_HEADER_ACCEPT: string; + const HTTP2_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN: string; + const HTTP2_HEADER_AGE: string; + const HTTP2_HEADER_ALLOW: string; + const HTTP2_HEADER_AUTHORIZATION: string; + const HTTP2_HEADER_CACHE_CONTROL: string; + const HTTP2_HEADER_CONNECTION: string; + const HTTP2_HEADER_CONTENT_DISPOSITION: string; + const HTTP2_HEADER_CONTENT_ENCODING: string; + const HTTP2_HEADER_CONTENT_LANGUAGE: string; + const HTTP2_HEADER_CONTENT_LENGTH: string; + const HTTP2_HEADER_CONTENT_LOCATION: string; + const HTTP2_HEADER_CONTENT_MD5: string; + const HTTP2_HEADER_CONTENT_RANGE: string; + const HTTP2_HEADER_CONTENT_TYPE: string; + const HTTP2_HEADER_COOKIE: string; + const HTTP2_HEADER_DATE: string; + const HTTP2_HEADER_ETAG: string; + const HTTP2_HEADER_EXPECT: string; + const HTTP2_HEADER_EXPIRES: string; + const HTTP2_HEADER_FROM: string; + const HTTP2_HEADER_HOST: string; + const HTTP2_HEADER_IF_MATCH: string; + const HTTP2_HEADER_IF_MODIFIED_SINCE: string; + const HTTP2_HEADER_IF_NONE_MATCH: string; + const HTTP2_HEADER_IF_RANGE: string; + const HTTP2_HEADER_IF_UNMODIFIED_SINCE: string; + const HTTP2_HEADER_LAST_MODIFIED: string; + const HTTP2_HEADER_LINK: string; + const HTTP2_HEADER_LOCATION: string; + const HTTP2_HEADER_MAX_FORWARDS: string; + const HTTP2_HEADER_PREFER: string; + const HTTP2_HEADER_PROXY_AUTHENTICATE: string; + const HTTP2_HEADER_PROXY_AUTHORIZATION: string; + const HTTP2_HEADER_RANGE: string; + const HTTP2_HEADER_REFERER: string; + const HTTP2_HEADER_REFRESH: string; + const HTTP2_HEADER_RETRY_AFTER: string; + const HTTP2_HEADER_SERVER: string; + const HTTP2_HEADER_SET_COOKIE: string; + const HTTP2_HEADER_STRICT_TRANSPORT_SECURITY: string; + const HTTP2_HEADER_TRANSFER_ENCODING: string; + const HTTP2_HEADER_TE: string; + const HTTP2_HEADER_UPGRADE: string; + const HTTP2_HEADER_USER_AGENT: string; + const HTTP2_HEADER_VARY: string; + const HTTP2_HEADER_VIA: string; + const HTTP2_HEADER_WWW_AUTHENTICATE: string; + const HTTP2_HEADER_HTTP2_SETTINGS: string; + const HTTP2_HEADER_KEEP_ALIVE: string; + const HTTP2_HEADER_PROXY_CONNECTION: string; + const HTTP2_METHOD_ACL: string; + const HTTP2_METHOD_BASELINE_CONTROL: string; + const HTTP2_METHOD_BIND: string; + const HTTP2_METHOD_CHECKIN: string; + const HTTP2_METHOD_CHECKOUT: string; + const HTTP2_METHOD_CONNECT: string; + const HTTP2_METHOD_COPY: string; + const HTTP2_METHOD_DELETE: string; + const HTTP2_METHOD_GET: string; + const HTTP2_METHOD_HEAD: string; + const HTTP2_METHOD_LABEL: string; + const HTTP2_METHOD_LINK: string; + const HTTP2_METHOD_LOCK: string; + const HTTP2_METHOD_MERGE: string; + const HTTP2_METHOD_MKACTIVITY: string; + const HTTP2_METHOD_MKCALENDAR: string; + const HTTP2_METHOD_MKCOL: string; + const HTTP2_METHOD_MKREDIRECTREF: string; + const HTTP2_METHOD_MKWORKSPACE: string; + const HTTP2_METHOD_MOVE: string; + const HTTP2_METHOD_OPTIONS: string; + const HTTP2_METHOD_ORDERPATCH: string; + const HTTP2_METHOD_PATCH: string; + const HTTP2_METHOD_POST: string; + const HTTP2_METHOD_PRI: string; + const HTTP2_METHOD_PROPFIND: string; + const HTTP2_METHOD_PROPPATCH: string; + const HTTP2_METHOD_PUT: string; + const HTTP2_METHOD_REBIND: string; + const HTTP2_METHOD_REPORT: string; + const HTTP2_METHOD_SEARCH: string; + const HTTP2_METHOD_TRACE: string; + const HTTP2_METHOD_UNBIND: string; + const HTTP2_METHOD_UNCHECKOUT: string; + const HTTP2_METHOD_UNLINK: string; + const HTTP2_METHOD_UNLOCK: string; + const HTTP2_METHOD_UPDATE: string; + const HTTP2_METHOD_UPDATEREDIRECTREF: string; + const HTTP2_METHOD_VERSION_CONTROL: string; + const HTTP_STATUS_CONTINUE: number; + const HTTP_STATUS_SWITCHING_PROTOCOLS: number; + const HTTP_STATUS_PROCESSING: number; + const HTTP_STATUS_OK: number; + const HTTP_STATUS_CREATED: number; + const HTTP_STATUS_ACCEPTED: number; + const HTTP_STATUS_NON_AUTHORITATIVE_INFORMATION: number; + const HTTP_STATUS_NO_CONTENT: number; + const HTTP_STATUS_RESET_CONTENT: number; + const HTTP_STATUS_PARTIAL_CONTENT: number; + const HTTP_STATUS_MULTI_STATUS: number; + const HTTP_STATUS_ALREADY_REPORTED: number; + const HTTP_STATUS_IM_USED: number; + const HTTP_STATUS_MULTIPLE_CHOICES: number; + const HTTP_STATUS_MOVED_PERMANENTLY: number; + const HTTP_STATUS_FOUND: number; + const HTTP_STATUS_SEE_OTHER: number; + const HTTP_STATUS_NOT_MODIFIED: number; + const HTTP_STATUS_USE_PROXY: number; + const HTTP_STATUS_TEMPORARY_REDIRECT: number; + const HTTP_STATUS_PERMANENT_REDIRECT: number; + const HTTP_STATUS_BAD_REQUEST: number; + const HTTP_STATUS_UNAUTHORIZED: number; + const HTTP_STATUS_PAYMENT_REQUIRED: number; + const HTTP_STATUS_FORBIDDEN: number; + const HTTP_STATUS_NOT_FOUND: number; + const HTTP_STATUS_METHOD_NOT_ALLOWED: number; + const HTTP_STATUS_NOT_ACCEPTABLE: number; + const HTTP_STATUS_PROXY_AUTHENTICATION_REQUIRED: number; + const HTTP_STATUS_REQUEST_TIMEOUT: number; + const HTTP_STATUS_CONFLICT: number; + const HTTP_STATUS_GONE: number; + const HTTP_STATUS_LENGTH_REQUIRED: number; + const HTTP_STATUS_PRECONDITION_FAILED: number; + const HTTP_STATUS_PAYLOAD_TOO_LARGE: number; + const HTTP_STATUS_URI_TOO_LONG: number; + const HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE: number; + const HTTP_STATUS_RANGE_NOT_SATISFIABLE: number; + const HTTP_STATUS_EXPECTATION_FAILED: number; + const HTTP_STATUS_TEAPOT: number; + const HTTP_STATUS_MISDIRECTED_REQUEST: number; + const HTTP_STATUS_UNPROCESSABLE_ENTITY: number; + const HTTP_STATUS_LOCKED: number; + const HTTP_STATUS_FAILED_DEPENDENCY: number; + const HTTP_STATUS_UNORDERED_COLLECTION: number; + const HTTP_STATUS_UPGRADE_REQUIRED: number; + const HTTP_STATUS_PRECONDITION_REQUIRED: number; + const HTTP_STATUS_TOO_MANY_REQUESTS: number; + const HTTP_STATUS_REQUEST_HEADER_FIELDS_TOO_LARGE: number; + const HTTP_STATUS_UNAVAILABLE_FOR_LEGAL_REASONS: number; + const HTTP_STATUS_INTERNAL_SERVER_ERROR: number; + const HTTP_STATUS_NOT_IMPLEMENTED: number; + const HTTP_STATUS_BAD_GATEWAY: number; + const HTTP_STATUS_SERVICE_UNAVAILABLE: number; + const HTTP_STATUS_GATEWAY_TIMEOUT: number; + const HTTP_STATUS_HTTP_VERSION_NOT_SUPPORTED: number; + const HTTP_STATUS_VARIANT_ALSO_NEGOTIATES: number; + const HTTP_STATUS_INSUFFICIENT_STORAGE: number; + const HTTP_STATUS_LOOP_DETECTED: number; + const HTTP_STATUS_BANDWIDTH_LIMIT_EXCEEDED: number; + const HTTP_STATUS_NOT_EXTENDED: number; + const HTTP_STATUS_NETWORK_AUTHENTICATION_REQUIRED: number; + } + /** + * This symbol can be set as a property on the HTTP/2 headers object with + * an array value in order to provide a list of headers considered sensitive. + */ + export const sensitiveHeaders: symbol; + /** + * Returns an object containing the default settings for an `Http2Session`instance. This method returns a new object instance every time it is called + * so instances returned may be safely modified for use. + * @since v8.4.0 + */ + export function getDefaultSettings(): Settings; + /** + * Returns a `Buffer` instance containing serialized representation of the given + * HTTP/2 settings as specified in the [HTTP/2](https://tools.ietf.org/html/rfc7540) specification. This is intended + * for use with the `HTTP2-Settings` header field. + * + * ```js + * const http2 = require('node:http2'); + * + * const packed = http2.getPackedSettings({ enablePush: false }); + * + * console.log(packed.toString('base64')); + * // Prints: AAIAAAAA + * ``` + * @since v8.4.0 + */ + export function getPackedSettings(settings: Settings): Buffer; + /** + * Returns a `HTTP/2 Settings Object` containing the deserialized settings from + * the given `Buffer` as generated by `http2.getPackedSettings()`. + * @since v8.4.0 + * @param buf The packed settings. + */ + export function getUnpackedSettings(buf: Uint8Array): Settings; + /** + * Returns a `net.Server` instance that creates and manages `Http2Session`instances. + * + * Since there are no browsers known that support [unencrypted HTTP/2](https://http2.github.io/faq/#does-http2-require-encryption), the use of {@link createSecureServer} is necessary when + * communicating + * with browser clients. + * + * ```js + * const http2 = require('node:http2'); + * + * // Create an unencrypted HTTP/2 server. + * // Since there are no browsers known that support + * // unencrypted HTTP/2, the use of `http2.createSecureServer()` + * // is necessary when communicating with browser clients. + * const server = http2.createServer(); + * + * server.on('stream', (stream, headers) => { + * stream.respond({ + * 'content-type': 'text/html; charset=utf-8', + * ':status': 200, + * }); + * stream.end('

Hello World

'); + * }); + * + * server.listen(8000); + * ``` + * @since v8.4.0 + * @param onRequestHandler See `Compatibility API` + */ + export function createServer(onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void): Http2Server; + export function createServer(options: ServerOptions, onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void): Http2Server; + /** + * Returns a `tls.Server` instance that creates and manages `Http2Session`instances. + * + * ```js + * const http2 = require('node:http2'); + * const fs = require('node:fs'); + * + * const options = { + * key: fs.readFileSync('server-key.pem'), + * cert: fs.readFileSync('server-cert.pem'), + * }; + * + * // Create a secure HTTP/2 server + * const server = http2.createSecureServer(options); + * + * server.on('stream', (stream, headers) => { + * stream.respond({ + * 'content-type': 'text/html; charset=utf-8', + * ':status': 200, + * }); + * stream.end('

Hello World

'); + * }); + * + * server.listen(8443); + * ``` + * @since v8.4.0 + * @param onRequestHandler See `Compatibility API` + */ + export function createSecureServer(onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void): Http2SecureServer; + export function createSecureServer(options: SecureServerOptions, onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void): Http2SecureServer; + /** + * Returns a `ClientHttp2Session` instance. + * + * ```js + * const http2 = require('node:http2'); + * const client = http2.connect('https://localhost:1234'); + * + * // Use the client + * + * client.close(); + * ``` + * @since v8.4.0 + * @param authority The remote HTTP/2 server to connect to. This must be in the form of a minimal, valid URL with the `http://` or `https://` prefix, host name, and IP port (if a non-default port + * is used). Userinfo (user ID and password), path, querystring, and fragment details in the URL will be ignored. + * @param listener Will be registered as a one-time listener of the {@link 'connect'} event. + */ + export function connect(authority: string | url.URL, listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): ClientHttp2Session; + export function connect( + authority: string | url.URL, + options?: ClientSessionOptions | SecureClientSessionOptions, + listener?: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void + ): ClientHttp2Session; +} +declare module 'http2' { + export * from 'node:http2'; +} diff --git a/node_modules/@types/node/https.d.ts b/node_modules/@types/node/https.d.ts new file mode 100644 index 0000000..375f25e --- /dev/null +++ b/node_modules/@types/node/https.d.ts @@ -0,0 +1,441 @@ +/** + * HTTPS is the HTTP protocol over TLS/SSL. In Node.js this is implemented as a + * separate module. + * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/https.js) + */ +declare module 'node:https' { + import { Duplex } from 'node:stream'; + import * as tls from 'node:tls'; + import * as http from 'node:http'; + import { URL } from 'node:url'; + type ServerOptions< + Request extends typeof http.IncomingMessage = typeof http.IncomingMessage, + Response extends typeof http.ServerResponse = typeof http.ServerResponse, + > = tls.SecureContextOptions & tls.TlsOptions & http.ServerOptions; + type RequestOptions = http.RequestOptions & + tls.SecureContextOptions & { + checkServerIdentity?: typeof tls.checkServerIdentity | undefined; + rejectUnauthorized?: boolean | undefined; // Defaults to true + servername?: string | undefined; // SNI TLS Extension + }; + interface AgentOptions extends http.AgentOptions, tls.ConnectionOptions { + rejectUnauthorized?: boolean | undefined; + maxCachedSessions?: number | undefined; + } + /** + * An `Agent` object for HTTPS similar to `http.Agent`. See {@link request} for more information. + * @since v0.4.5 + */ + class Agent extends http.Agent { + constructor(options?: AgentOptions); + options: AgentOptions; + } + interface Server< + Request extends typeof http.IncomingMessage = typeof http.IncomingMessage, + Response extends typeof http.ServerResponse = typeof http.ServerResponse, + > extends http.Server {} + /** + * See `http.Server` for more information. + * @since v0.3.4 + */ + class Server< + Request extends typeof http.IncomingMessage = typeof http.IncomingMessage, + Response extends typeof http.ServerResponse = typeof http.ServerResponse, + > extends tls.Server { + constructor(requestListener?: http.RequestListener); + constructor( + options: ServerOptions, + requestListener?: http.RequestListener, + ); + /** + * Closes all connections connected to this server. + * @since v18.2.0 + */ + closeAllConnections(): void; + /** + * Closes all connections connected to this server which are not sending a request or waiting for a response. + * @since v18.2.0 + */ + closeIdleConnections(): void; + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: 'keylog', listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this; + addListener(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void): this; + addListener(event: 'OCSPRequest', listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this; + addListener(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void): this; + addListener(event: 'secureConnection', listener: (tlsSocket: tls.TLSSocket) => void): this; + addListener(event: 'tlsClientError', listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this; + addListener(event: 'close', listener: () => void): this; + addListener(event: 'connection', listener: (socket: Duplex) => void): this; + addListener(event: 'error', listener: (err: Error) => void): this; + addListener(event: 'listening', listener: () => void): this; + addListener(event: 'checkContinue', listener: http.RequestListener): this; + addListener(event: 'checkExpectation', listener: http.RequestListener): this; + addListener(event: 'clientError', listener: (err: Error, socket: Duplex) => void): this; + addListener(event: 'connect', listener: (req: InstanceType, socket: Duplex, head: Buffer) => void): this; + addListener(event: 'request', listener: http.RequestListener): this; + addListener(event: 'upgrade', listener: (req: InstanceType, socket: Duplex, head: Buffer) => void): this; + emit(event: string, ...args: any[]): boolean; + emit(event: 'keylog', line: Buffer, tlsSocket: tls.TLSSocket): boolean; + emit(event: 'newSession', sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void): boolean; + emit(event: 'OCSPRequest', certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void): boolean; + emit(event: 'resumeSession', sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void): boolean; + emit(event: 'secureConnection', tlsSocket: tls.TLSSocket): boolean; + emit(event: 'tlsClientError', err: Error, tlsSocket: tls.TLSSocket): boolean; + emit(event: 'close'): boolean; + emit(event: 'connection', socket: Duplex): boolean; + emit(event: 'error', err: Error): boolean; + emit(event: 'listening'): boolean; + emit( + event: 'checkContinue', + req: InstanceType, + res: InstanceType & { + req: InstanceType; + } + ): boolean; + emit( + event: 'checkExpectation', + req: InstanceType, + res: InstanceType & { + req: InstanceType; + } + ): boolean; + emit(event: 'clientError', err: Error, socket: Duplex): boolean; + emit(event: 'connect', req: InstanceType, socket: Duplex, head: Buffer): boolean; + emit( + event: 'request', + req: InstanceType, + res: InstanceType & { + req: InstanceType; + } + ): boolean; + emit(event: 'upgrade', req: InstanceType, socket: Duplex, head: Buffer): boolean; + on(event: string, listener: (...args: any[]) => void): this; + on(event: 'keylog', listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this; + on(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void): this; + on(event: 'OCSPRequest', listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this; + on(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void): this; + on(event: 'secureConnection', listener: (tlsSocket: tls.TLSSocket) => void): this; + on(event: 'tlsClientError', listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this; + on(event: 'close', listener: () => void): this; + on(event: 'connection', listener: (socket: Duplex) => void): this; + on(event: 'error', listener: (err: Error) => void): this; + on(event: 'listening', listener: () => void): this; + on(event: 'checkContinue', listener: http.RequestListener): this; + on(event: 'checkExpectation', listener: http.RequestListener): this; + on(event: 'clientError', listener: (err: Error, socket: Duplex) => void): this; + on(event: 'connect', listener: (req: InstanceType, socket: Duplex, head: Buffer) => void): this; + on(event: 'request', listener: http.RequestListener): this; + on(event: 'upgrade', listener: (req: InstanceType, socket: Duplex, head: Buffer) => void): this; + once(event: string, listener: (...args: any[]) => void): this; + once(event: 'keylog', listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this; + once(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void): this; + once(event: 'OCSPRequest', listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this; + once(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void): this; + once(event: 'secureConnection', listener: (tlsSocket: tls.TLSSocket) => void): this; + once(event: 'tlsClientError', listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this; + once(event: 'close', listener: () => void): this; + once(event: 'connection', listener: (socket: Duplex) => void): this; + once(event: 'error', listener: (err: Error) => void): this; + once(event: 'listening', listener: () => void): this; + once(event: 'checkContinue', listener: http.RequestListener): this; + once(event: 'checkExpectation', listener: http.RequestListener): this; + once(event: 'clientError', listener: (err: Error, socket: Duplex) => void): this; + once(event: 'connect', listener: (req: InstanceType, socket: Duplex, head: Buffer) => void): this; + once(event: 'request', listener: http.RequestListener): this; + once(event: 'upgrade', listener: (req: InstanceType, socket: Duplex, head: Buffer) => void): this; + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: 'keylog', listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this; + prependListener(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void): this; + prependListener(event: 'OCSPRequest', listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this; + prependListener(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void): this; + prependListener(event: 'secureConnection', listener: (tlsSocket: tls.TLSSocket) => void): this; + prependListener(event: 'tlsClientError', listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this; + prependListener(event: 'close', listener: () => void): this; + prependListener(event: 'connection', listener: (socket: Duplex) => void): this; + prependListener(event: 'error', listener: (err: Error) => void): this; + prependListener(event: 'listening', listener: () => void): this; + prependListener(event: 'checkContinue', listener: http.RequestListener): this; + prependListener(event: 'checkExpectation', listener: http.RequestListener): this; + prependListener(event: 'clientError', listener: (err: Error, socket: Duplex) => void): this; + prependListener(event: 'connect', listener: (req: InstanceType, socket: Duplex, head: Buffer) => void): this; + prependListener(event: 'request', listener: http.RequestListener): this; + prependListener(event: 'upgrade', listener: (req: InstanceType, socket: Duplex, head: Buffer) => void): this; + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'keylog', listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this; + prependOnceListener(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void): this; + prependOnceListener(event: 'OCSPRequest', listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this; + prependOnceListener(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void): this; + prependOnceListener(event: 'secureConnection', listener: (tlsSocket: tls.TLSSocket) => void): this; + prependOnceListener(event: 'tlsClientError', listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this; + prependOnceListener(event: 'close', listener: () => void): this; + prependOnceListener(event: 'connection', listener: (socket: Duplex) => void): this; + prependOnceListener(event: 'error', listener: (err: Error) => void): this; + prependOnceListener(event: 'listening', listener: () => void): this; + prependOnceListener(event: 'checkContinue', listener: http.RequestListener): this; + prependOnceListener(event: 'checkExpectation', listener: http.RequestListener): this; + prependOnceListener(event: 'clientError', listener: (err: Error, socket: Duplex) => void): this; + prependOnceListener(event: 'connect', listener: (req: InstanceType, socket: Duplex, head: Buffer) => void): this; + prependOnceListener(event: 'request', listener: http.RequestListener): this; + prependOnceListener(event: 'upgrade', listener: (req: InstanceType, socket: Duplex, head: Buffer) => void): this; + } + /** + * ```js + * // curl -k https://localhost:8000/ + * const https = require('node:https'); + * const fs = require('node:fs'); + * + * const options = { + * key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'), + * cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem'), + * }; + * + * https.createServer(options, (req, res) => { + * res.writeHead(200); + * res.end('hello world\n'); + * }).listen(8000); + * ``` + * + * Or + * + * ```js + * const https = require('node:https'); + * const fs = require('node:fs'); + * + * const options = { + * pfx: fs.readFileSync('test/fixtures/test_cert.pfx'), + * passphrase: 'sample', + * }; + * + * https.createServer(options, (req, res) => { + * res.writeHead(200); + * res.end('hello world\n'); + * }).listen(8000); + * ``` + * @since v0.3.4 + * @param options Accepts `options` from `createServer`, `createSecureContext` and `createServer`. + * @param requestListener A listener to be added to the `'request'` event. + */ + function createServer< + Request extends typeof http.IncomingMessage = typeof http.IncomingMessage, + Response extends typeof http.ServerResponse = typeof http.ServerResponse, + >(requestListener?: http.RequestListener): Server; + function createServer< + Request extends typeof http.IncomingMessage = typeof http.IncomingMessage, + Response extends typeof http.ServerResponse = typeof http.ServerResponse, + >( + options: ServerOptions, + requestListener?: http.RequestListener, + ): Server; + /** + * Makes a request to a secure web server. + * + * The following additional `options` from `tls.connect()` are also accepted:`ca`, `cert`, `ciphers`, `clientCertEngine`, `crl`, `dhparam`, `ecdhCurve`,`honorCipherOrder`, `key`, `passphrase`, + * `pfx`, `rejectUnauthorized`,`secureOptions`, `secureProtocol`, `servername`, `sessionIdContext`,`highWaterMark`. + * + * `options` can be an object, a string, or a `URL` object. If `options` is a + * string, it is automatically parsed with `new URL()`. If it is a `URL` object, it will be automatically converted to an ordinary `options` object. + * + * `https.request()` returns an instance of the `http.ClientRequest` class. The `ClientRequest` instance is a writable stream. If one needs to + * upload a file with a POST request, then write to the `ClientRequest` object. + * + * ```js + * const https = require('node:https'); + * + * const options = { + * hostname: 'encrypted.google.com', + * port: 443, + * path: '/', + * method: 'GET', + * }; + * + * const req = https.request(options, (res) => { + * console.log('statusCode:', res.statusCode); + * console.log('headers:', res.headers); + * + * res.on('data', (d) => { + * process.stdout.write(d); + * }); + * }); + * + * req.on('error', (e) => { + * console.error(e); + * }); + * req.end(); + * ``` + * + * Example using options from `tls.connect()`: + * + * ```js + * const options = { + * hostname: 'encrypted.google.com', + * port: 443, + * path: '/', + * method: 'GET', + * key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'), + * cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem'), + * }; + * options.agent = new https.Agent(options); + * + * const req = https.request(options, (res) => { + * // ... + * }); + * ``` + * + * Alternatively, opt out of connection pooling by not using an `Agent`. + * + * ```js + * const options = { + * hostname: 'encrypted.google.com', + * port: 443, + * path: '/', + * method: 'GET', + * key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'), + * cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem'), + * agent: false, + * }; + * + * const req = https.request(options, (res) => { + * // ... + * }); + * ``` + * + * Example using a `URL` as `options`: + * + * ```js + * const options = new URL('https://abc:xyz@example.com'); + * + * const req = https.request(options, (res) => { + * // ... + * }); + * ``` + * + * Example pinning on certificate fingerprint, or the public key (similar to`pin-sha256`): + * + * ```js + * const tls = require('node:tls'); + * const https = require('node:https'); + * const crypto = require('node:crypto'); + * + * function sha256(s) { + * return crypto.createHash('sha256').update(s).digest('base64'); + * } + * const options = { + * hostname: 'github.com', + * port: 443, + * path: '/', + * method: 'GET', + * checkServerIdentity: function(host, cert) { + * // Make sure the certificate is issued to the host we are connected to + * const err = tls.checkServerIdentity(host, cert); + * if (err) { + * return err; + * } + * + * // Pin the public key, similar to HPKP pin-sha256 pinning + * const pubkey256 = 'pL1+qb9HTMRZJmuC/bB/ZI9d302BYrrqiVuRyW+DGrU='; + * if (sha256(cert.pubkey) !== pubkey256) { + * const msg = 'Certificate verification error: ' + + * `The public key of '${cert.subject.CN}' ` + + * 'does not match our pinned fingerprint'; + * return new Error(msg); + * } + * + * // Pin the exact certificate, rather than the pub key + * const cert256 = '25:FE:39:32:D9:63:8C:8A:FC:A1:9A:29:87:' + + * 'D8:3E:4C:1D:98:DB:71:E4:1A:48:03:98:EA:22:6A:BD:8B:93:16'; + * if (cert.fingerprint256 !== cert256) { + * const msg = 'Certificate verification error: ' + + * `The certificate of '${cert.subject.CN}' ` + + * 'does not match our pinned fingerprint'; + * return new Error(msg); + * } + * + * // This loop is informational only. + * // Print the certificate and public key fingerprints of all certs in the + * // chain. Its common to pin the public key of the issuer on the public + * // internet, while pinning the public key of the service in sensitive + * // environments. + * do { + * console.log('Subject Common Name:', cert.subject.CN); + * console.log(' Certificate SHA256 fingerprint:', cert.fingerprint256); + * + * hash = crypto.createHash('sha256'); + * console.log(' Public key ping-sha256:', sha256(cert.pubkey)); + * + * lastprint256 = cert.fingerprint256; + * cert = cert.issuerCertificate; + * } while (cert.fingerprint256 !== lastprint256); + * + * }, + * }; + * + * options.agent = new https.Agent(options); + * const req = https.request(options, (res) => { + * console.log('All OK. Server matched our pinned cert or public key'); + * console.log('statusCode:', res.statusCode); + * // Print the HPKP values + * console.log('headers:', res.headers['public-key-pins']); + * + * res.on('data', (d) => {}); + * }); + * + * req.on('error', (e) => { + * console.error(e.message); + * }); + * req.end(); + * ``` + * + * Outputs for example: + * + * ```text + * Subject Common Name: github.com + * Certificate SHA256 fingerprint: 25:FE:39:32:D9:63:8C:8A:FC:A1:9A:29:87:D8:3E:4C:1D:98:DB:71:E4:1A:48:03:98:EA:22:6A:BD:8B:93:16 + * Public key ping-sha256: pL1+qb9HTMRZJmuC/bB/ZI9d302BYrrqiVuRyW+DGrU= + * Subject Common Name: DigiCert SHA2 Extended Validation Server CA + * Certificate SHA256 fingerprint: 40:3E:06:2A:26:53:05:91:13:28:5B:AF:80:A0:D4:AE:42:2C:84:8C:9F:78:FA:D0:1F:C9:4B:C5:B8:7F:EF:1A + * Public key ping-sha256: RRM1dGqnDFsCJXBTHky16vi1obOlCgFFn/yOhI/y+ho= + * Subject Common Name: DigiCert High Assurance EV Root CA + * Certificate SHA256 fingerprint: 74:31:E5:F4:C3:C1:CE:46:90:77:4F:0B:61:E0:54:40:88:3B:A9:A0:1E:D0:0B:A6:AB:D7:80:6E:D3:B1:18:CF + * Public key ping-sha256: WoiWRyIOVNa9ihaBciRSC7XHjliYS9VwUGOIud4PB18= + * All OK. Server matched our pinned cert or public key + * statusCode: 200 + * headers: max-age=0; pin-sha256="WoiWRyIOVNa9ihaBciRSC7XHjliYS9VwUGOIud4PB18="; pin-sha256="RRM1dGqnDFsCJXBTHky16vi1obOlCgFFn/yOhI/y+ho="; + * pin-sha256="k2v657xBsOVe1PQRwOsHsw3bsGT2VzIqz5K+59sNQws="; pin-sha256="K87oWBWM9UZfyddvDfoxL+8lpNyoUB2ptGtn0fv6G2Q="; pin-sha256="IQBnNBEiFuhj+8x6X8XLgh01V9Ic5/V3IRQLNFFc7v4="; + * pin-sha256="iie1VXtL7HzAMF+/PVPR9xzT80kQxdZeJ+zduCB3uj0="; pin-sha256="LvRiGEjRqfzurezaWuj8Wie2gyHMrW5Q06LspMnox7A="; includeSubDomains + * ``` + * @since v0.3.6 + * @param options Accepts all `options` from `request`, with some differences in default values: + */ + function request(options: RequestOptions | string | URL, callback?: (res: http.IncomingMessage) => void): http.ClientRequest; + function request(url: string | URL, options: RequestOptions, callback?: (res: http.IncomingMessage) => void): http.ClientRequest; + /** + * Like `http.get()` but for HTTPS. + * + * `options` can be an object, a string, or a `URL` object. If `options` is a + * string, it is automatically parsed with `new URL()`. If it is a `URL` object, it will be automatically converted to an ordinary `options` object. + * + * ```js + * const https = require('node:https'); + * + * https.get('https://encrypted.google.com/', (res) => { + * console.log('statusCode:', res.statusCode); + * console.log('headers:', res.headers); + * + * res.on('data', (d) => { + * process.stdout.write(d); + * }); + * + * }).on('error', (e) => { + * console.error(e); + * }); + * ``` + * @since v0.3.6 + * @param options Accepts the same `options` as {@link request}, with the `method` always set to `GET`. + */ + function get(options: RequestOptions | string | URL, callback?: (res: http.IncomingMessage) => void): http.ClientRequest; + function get(url: string | URL, options: RequestOptions, callback?: (res: http.IncomingMessage) => void): http.ClientRequest; + let globalAgent: Agent; +} +declare module 'https' { + export * from 'node:https'; +} diff --git a/node_modules/@types/node/index.d.ts b/node_modules/@types/node/index.d.ts new file mode 100644 index 0000000..2d719c7 --- /dev/null +++ b/node_modules/@types/node/index.d.ts @@ -0,0 +1,133 @@ +// Type definitions for non-npm package Node.js 20.6 +// Project: https://nodejs.org/ +// Definitions by: Microsoft TypeScript +// DefinitelyTyped +// Alberto Schiabel +// Alvis HT Tang +// Andrew Makarov +// Benjamin Toueg +// Chigozirim C. +// David Junger +// Deividas Bakanas +// Eugene Y. Q. Shen +// Hannes Magnusson +// Huw +// Kelvin Jin +// Klaus Meinhardt +// Lishude +// Mariusz Wiktorczyk +// Mohsen Azimi +// Nicolas Even +// Nikita Galkin +// Parambir Singh +// Sebastian Silbermann +// Thomas den Hollander +// Wilco Bakker +// wwwy3y3 +// Samuel Ainsworth +// Kyle Uehlein +// Thanik Bhongbhibhat +// Marcin Kopacz +// Trivikram Kamat +// Junxiao Shi +// Ilia Baryshnikov +// ExE Boss +// Piotr Błażejewicz +// Anna Henningsen +// Victor Perin +// Yongsheng Zhang +// NodeJS Contributors +// Linus Unnebäck +// wafuwafu13 +// Matteo Collina +// Dmitry Semigradsky +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/** + * License for programmatically and manually incorporated + * documentation aka. `JSDoc` from https://github.com/nodejs/node/tree/master/doc + * + * Copyright Node.js contributors. 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: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +// NOTE: These definitions support NodeJS and TypeScript 4.9+. + +// Reference required types from the default lib: +/// +/// +/// +/// + +// Base definitions for all NodeJS modules that are not specific to any version of TypeScript: +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// + +/// diff --git a/node_modules/@types/node/inspector.d.ts b/node_modules/@types/node/inspector.d.ts new file mode 100644 index 0000000..e9dd9e1 --- /dev/null +++ b/node_modules/@types/node/inspector.d.ts @@ -0,0 +1,2748 @@ +// eslint-disable-next-line @definitelytyped/dt-header +// Type definitions for inspector + +// These definitions are auto-generated. +// Please see https://github.com/DefinitelyTyped/DefinitelyTyped/pull/19330 +// for more information. + + +/** + * The `node:inspector` module provides an API for interacting with the V8 + * inspector. + * + * It can be accessed using: + * + * ```js + * import * as inspector from 'node:inspector/promises'; + * ``` + * + * or + * + * ```js + * import * as inspector from 'node:inspector'; + * ``` + * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/inspector.js) + */ +declare module 'node:inspector' { + import EventEmitter = require('node:events'); + interface InspectorNotification { + method: string; + params: T; + } + namespace Schema { + /** + * Description of the protocol domain. + */ + interface Domain { + /** + * Domain name. + */ + name: string; + /** + * Domain version. + */ + version: string; + } + interface GetDomainsReturnType { + /** + * List of supported domains. + */ + domains: Domain[]; + } + } + namespace Runtime { + /** + * Unique script identifier. + */ + type ScriptId = string; + /** + * Unique object identifier. + */ + type RemoteObjectId = string; + /** + * Primitive value which cannot be JSON-stringified. + */ + type UnserializableValue = string; + /** + * Mirror object referencing original JavaScript object. + */ + interface RemoteObject { + /** + * Object type. + */ + type: string; + /** + * Object subtype hint. Specified for object type values only. + */ + subtype?: string | undefined; + /** + * Object class (constructor) name. Specified for object type values only. + */ + className?: string | undefined; + /** + * Remote object value in case of primitive values or JSON values (if it was requested). + */ + value?: any; + /** + * Primitive value which can not be JSON-stringified does not have value, but gets this property. + */ + unserializableValue?: UnserializableValue | undefined; + /** + * String representation of the object. + */ + description?: string | undefined; + /** + * Unique object identifier (for non-primitive values). + */ + objectId?: RemoteObjectId | undefined; + /** + * Preview containing abbreviated property values. Specified for object type values only. + * @experimental + */ + preview?: ObjectPreview | undefined; + /** + * @experimental + */ + customPreview?: CustomPreview | undefined; + } + /** + * @experimental + */ + interface CustomPreview { + header: string; + hasBody: boolean; + formatterObjectId: RemoteObjectId; + bindRemoteObjectFunctionId: RemoteObjectId; + configObjectId?: RemoteObjectId | undefined; + } + /** + * Object containing abbreviated remote object value. + * @experimental + */ + interface ObjectPreview { + /** + * Object type. + */ + type: string; + /** + * Object subtype hint. Specified for object type values only. + */ + subtype?: string | undefined; + /** + * String representation of the object. + */ + description?: string | undefined; + /** + * True iff some of the properties or entries of the original object did not fit. + */ + overflow: boolean; + /** + * List of the properties. + */ + properties: PropertyPreview[]; + /** + * List of the entries. Specified for map and set subtype values only. + */ + entries?: EntryPreview[] | undefined; + } + /** + * @experimental + */ + interface PropertyPreview { + /** + * Property name. + */ + name: string; + /** + * Object type. Accessor means that the property itself is an accessor property. + */ + type: string; + /** + * User-friendly property value string. + */ + value?: string | undefined; + /** + * Nested value preview. + */ + valuePreview?: ObjectPreview | undefined; + /** + * Object subtype hint. Specified for object type values only. + */ + subtype?: string | undefined; + } + /** + * @experimental + */ + interface EntryPreview { + /** + * Preview of the key. Specified for map-like collection entries. + */ + key?: ObjectPreview | undefined; + /** + * Preview of the value. + */ + value: ObjectPreview; + } + /** + * Object property descriptor. + */ + interface PropertyDescriptor { + /** + * Property name or symbol description. + */ + name: string; + /** + * The value associated with the property. + */ + value?: RemoteObject | undefined; + /** + * True if the value associated with the property may be changed (data descriptors only). + */ + writable?: boolean | undefined; + /** + * A function which serves as a getter for the property, or undefined if there is no getter (accessor descriptors only). + */ + get?: RemoteObject | undefined; + /** + * A function which serves as a setter for the property, or undefined if there is no setter (accessor descriptors only). + */ + set?: RemoteObject | undefined; + /** + * True if the type of this property descriptor may be changed and if the property may be deleted from the corresponding object. + */ + configurable: boolean; + /** + * True if this property shows up during enumeration of the properties on the corresponding object. + */ + enumerable: boolean; + /** + * True if the result was thrown during the evaluation. + */ + wasThrown?: boolean | undefined; + /** + * True if the property is owned for the object. + */ + isOwn?: boolean | undefined; + /** + * Property symbol object, if the property is of the symbol type. + */ + symbol?: RemoteObject | undefined; + } + /** + * Object internal property descriptor. This property isn't normally visible in JavaScript code. + */ + interface InternalPropertyDescriptor { + /** + * Conventional property name. + */ + name: string; + /** + * The value associated with the property. + */ + value?: RemoteObject | undefined; + } + /** + * Represents function call argument. Either remote object id objectId, primitive value, unserializable primitive value or neither of (for undefined) them should be specified. + */ + interface CallArgument { + /** + * Primitive value or serializable javascript object. + */ + value?: any; + /** + * Primitive value which can not be JSON-stringified. + */ + unserializableValue?: UnserializableValue | undefined; + /** + * Remote object handle. + */ + objectId?: RemoteObjectId | undefined; + } + /** + * Id of an execution context. + */ + type ExecutionContextId = number; + /** + * Description of an isolated world. + */ + interface ExecutionContextDescription { + /** + * Unique id of the execution context. It can be used to specify in which execution context script evaluation should be performed. + */ + id: ExecutionContextId; + /** + * Execution context origin. + */ + origin: string; + /** + * Human readable name describing given context. + */ + name: string; + /** + * Embedder-specific auxiliary data. + */ + auxData?: {} | undefined; + } + /** + * Detailed information about exception (or error) that was thrown during script compilation or execution. + */ + interface ExceptionDetails { + /** + * Exception id. + */ + exceptionId: number; + /** + * Exception text, which should be used together with exception object when available. + */ + text: string; + /** + * Line number of the exception location (0-based). + */ + lineNumber: number; + /** + * Column number of the exception location (0-based). + */ + columnNumber: number; + /** + * Script ID of the exception location. + */ + scriptId?: ScriptId | undefined; + /** + * URL of the exception location, to be used when the script was not reported. + */ + url?: string | undefined; + /** + * JavaScript stack trace if available. + */ + stackTrace?: StackTrace | undefined; + /** + * Exception object if available. + */ + exception?: RemoteObject | undefined; + /** + * Identifier of the context where exception happened. + */ + executionContextId?: ExecutionContextId | undefined; + } + /** + * Number of milliseconds since epoch. + */ + type Timestamp = number; + /** + * Stack entry for runtime errors and assertions. + */ + interface CallFrame { + /** + * JavaScript function name. + */ + functionName: string; + /** + * JavaScript script id. + */ + scriptId: ScriptId; + /** + * JavaScript script name or url. + */ + url: string; + /** + * JavaScript script line number (0-based). + */ + lineNumber: number; + /** + * JavaScript script column number (0-based). + */ + columnNumber: number; + } + /** + * Call frames for assertions or error messages. + */ + interface StackTrace { + /** + * String label of this stack trace. For async traces this may be a name of the function that initiated the async call. + */ + description?: string | undefined; + /** + * JavaScript function name. + */ + callFrames: CallFrame[]; + /** + * Asynchronous JavaScript stack trace that preceded this stack, if available. + */ + parent?: StackTrace | undefined; + /** + * Asynchronous JavaScript stack trace that preceded this stack, if available. + * @experimental + */ + parentId?: StackTraceId | undefined; + } + /** + * Unique identifier of current debugger. + * @experimental + */ + type UniqueDebuggerId = string; + /** + * If debuggerId is set stack trace comes from another debugger and can be resolved there. This allows to track cross-debugger calls. See Runtime.StackTrace and Debugger.paused for usages. + * @experimental + */ + interface StackTraceId { + id: string; + debuggerId?: UniqueDebuggerId | undefined; + } + interface EvaluateParameterType { + /** + * Expression to evaluate. + */ + expression: string; + /** + * Symbolic group name that can be used to release multiple objects. + */ + objectGroup?: string | undefined; + /** + * Determines whether Command Line API should be available during the evaluation. + */ + includeCommandLineAPI?: boolean | undefined; + /** + * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. + */ + silent?: boolean | undefined; + /** + * Specifies in which execution context to perform evaluation. If the parameter is omitted the evaluation will be performed in the context of the inspected page. + */ + contextId?: ExecutionContextId | undefined; + /** + * Whether the result is expected to be a JSON object that should be sent by value. + */ + returnByValue?: boolean | undefined; + /** + * Whether preview should be generated for the result. + * @experimental + */ + generatePreview?: boolean | undefined; + /** + * Whether execution should be treated as initiated by user in the UI. + */ + userGesture?: boolean | undefined; + /** + * Whether execution should await for resulting value and return once awaited promise is resolved. + */ + awaitPromise?: boolean | undefined; + } + interface AwaitPromiseParameterType { + /** + * Identifier of the promise. + */ + promiseObjectId: RemoteObjectId; + /** + * Whether the result is expected to be a JSON object that should be sent by value. + */ + returnByValue?: boolean | undefined; + /** + * Whether preview should be generated for the result. + */ + generatePreview?: boolean | undefined; + } + interface CallFunctionOnParameterType { + /** + * Declaration of the function to call. + */ + functionDeclaration: string; + /** + * Identifier of the object to call function on. Either objectId or executionContextId should be specified. + */ + objectId?: RemoteObjectId | undefined; + /** + * Call arguments. All call arguments must belong to the same JavaScript world as the target object. + */ + arguments?: CallArgument[] | undefined; + /** + * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. + */ + silent?: boolean | undefined; + /** + * Whether the result is expected to be a JSON object which should be sent by value. + */ + returnByValue?: boolean | undefined; + /** + * Whether preview should be generated for the result. + * @experimental + */ + generatePreview?: boolean | undefined; + /** + * Whether execution should be treated as initiated by user in the UI. + */ + userGesture?: boolean | undefined; + /** + * Whether execution should await for resulting value and return once awaited promise is resolved. + */ + awaitPromise?: boolean | undefined; + /** + * Specifies execution context which global object will be used to call function on. Either executionContextId or objectId should be specified. + */ + executionContextId?: ExecutionContextId | undefined; + /** + * Symbolic group name that can be used to release multiple objects. If objectGroup is not specified and objectId is, objectGroup will be inherited from object. + */ + objectGroup?: string | undefined; + } + interface GetPropertiesParameterType { + /** + * Identifier of the object to return properties for. + */ + objectId: RemoteObjectId; + /** + * If true, returns properties belonging only to the element itself, not to its prototype chain. + */ + ownProperties?: boolean | undefined; + /** + * If true, returns accessor properties (with getter/setter) only; internal properties are not returned either. + * @experimental + */ + accessorPropertiesOnly?: boolean | undefined; + /** + * Whether preview should be generated for the results. + * @experimental + */ + generatePreview?: boolean | undefined; + } + interface ReleaseObjectParameterType { + /** + * Identifier of the object to release. + */ + objectId: RemoteObjectId; + } + interface ReleaseObjectGroupParameterType { + /** + * Symbolic object group name. + */ + objectGroup: string; + } + interface SetCustomObjectFormatterEnabledParameterType { + enabled: boolean; + } + interface CompileScriptParameterType { + /** + * Expression to compile. + */ + expression: string; + /** + * Source url to be set for the script. + */ + sourceURL: string; + /** + * Specifies whether the compiled script should be persisted. + */ + persistScript: boolean; + /** + * Specifies in which execution context to perform script run. If the parameter is omitted the evaluation will be performed in the context of the inspected page. + */ + executionContextId?: ExecutionContextId | undefined; + } + interface RunScriptParameterType { + /** + * Id of the script to run. + */ + scriptId: ScriptId; + /** + * Specifies in which execution context to perform script run. If the parameter is omitted the evaluation will be performed in the context of the inspected page. + */ + executionContextId?: ExecutionContextId | undefined; + /** + * Symbolic group name that can be used to release multiple objects. + */ + objectGroup?: string | undefined; + /** + * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. + */ + silent?: boolean | undefined; + /** + * Determines whether Command Line API should be available during the evaluation. + */ + includeCommandLineAPI?: boolean | undefined; + /** + * Whether the result is expected to be a JSON object which should be sent by value. + */ + returnByValue?: boolean | undefined; + /** + * Whether preview should be generated for the result. + */ + generatePreview?: boolean | undefined; + /** + * Whether execution should await for resulting value and return once awaited promise is resolved. + */ + awaitPromise?: boolean | undefined; + } + interface QueryObjectsParameterType { + /** + * Identifier of the prototype to return objects for. + */ + prototypeObjectId: RemoteObjectId; + } + interface GlobalLexicalScopeNamesParameterType { + /** + * Specifies in which execution context to lookup global scope variables. + */ + executionContextId?: ExecutionContextId | undefined; + } + interface EvaluateReturnType { + /** + * Evaluation result. + */ + result: RemoteObject; + /** + * Exception details. + */ + exceptionDetails?: ExceptionDetails | undefined; + } + interface AwaitPromiseReturnType { + /** + * Promise result. Will contain rejected value if promise was rejected. + */ + result: RemoteObject; + /** + * Exception details if stack strace is available. + */ + exceptionDetails?: ExceptionDetails | undefined; + } + interface CallFunctionOnReturnType { + /** + * Call result. + */ + result: RemoteObject; + /** + * Exception details. + */ + exceptionDetails?: ExceptionDetails | undefined; + } + interface GetPropertiesReturnType { + /** + * Object properties. + */ + result: PropertyDescriptor[]; + /** + * Internal object properties (only of the element itself). + */ + internalProperties?: InternalPropertyDescriptor[] | undefined; + /** + * Exception details. + */ + exceptionDetails?: ExceptionDetails | undefined; + } + interface CompileScriptReturnType { + /** + * Id of the script. + */ + scriptId?: ScriptId | undefined; + /** + * Exception details. + */ + exceptionDetails?: ExceptionDetails | undefined; + } + interface RunScriptReturnType { + /** + * Run result. + */ + result: RemoteObject; + /** + * Exception details. + */ + exceptionDetails?: ExceptionDetails | undefined; + } + interface QueryObjectsReturnType { + /** + * Array with objects. + */ + objects: RemoteObject; + } + interface GlobalLexicalScopeNamesReturnType { + names: string[]; + } + interface ExecutionContextCreatedEventDataType { + /** + * A newly created execution context. + */ + context: ExecutionContextDescription; + } + interface ExecutionContextDestroyedEventDataType { + /** + * Id of the destroyed context + */ + executionContextId: ExecutionContextId; + } + interface ExceptionThrownEventDataType { + /** + * Timestamp of the exception. + */ + timestamp: Timestamp; + exceptionDetails: ExceptionDetails; + } + interface ExceptionRevokedEventDataType { + /** + * Reason describing why exception was revoked. + */ + reason: string; + /** + * The id of revoked exception, as reported in exceptionThrown. + */ + exceptionId: number; + } + interface ConsoleAPICalledEventDataType { + /** + * Type of the call. + */ + type: string; + /** + * Call arguments. + */ + args: RemoteObject[]; + /** + * Identifier of the context where the call was made. + */ + executionContextId: ExecutionContextId; + /** + * Call timestamp. + */ + timestamp: Timestamp; + /** + * Stack trace captured when the call was made. + */ + stackTrace?: StackTrace | undefined; + /** + * Console context descriptor for calls on non-default console context (not console.*): 'anonymous#unique-logger-id' for call on unnamed context, 'name#unique-logger-id' for call on named context. + * @experimental + */ + context?: string | undefined; + } + interface InspectRequestedEventDataType { + object: RemoteObject; + hints: {}; + } + } + namespace Debugger { + /** + * Breakpoint identifier. + */ + type BreakpointId = string; + /** + * Call frame identifier. + */ + type CallFrameId = string; + /** + * Location in the source code. + */ + interface Location { + /** + * Script identifier as reported in the Debugger.scriptParsed. + */ + scriptId: Runtime.ScriptId; + /** + * Line number in the script (0-based). + */ + lineNumber: number; + /** + * Column number in the script (0-based). + */ + columnNumber?: number | undefined; + } + /** + * Location in the source code. + * @experimental + */ + interface ScriptPosition { + lineNumber: number; + columnNumber: number; + } + /** + * JavaScript call frame. Array of call frames form the call stack. + */ + interface CallFrame { + /** + * Call frame identifier. This identifier is only valid while the virtual machine is paused. + */ + callFrameId: CallFrameId; + /** + * Name of the JavaScript function called on this call frame. + */ + functionName: string; + /** + * Location in the source code. + */ + functionLocation?: Location | undefined; + /** + * Location in the source code. + */ + location: Location; + /** + * JavaScript script name or url. + */ + url: string; + /** + * Scope chain for this call frame. + */ + scopeChain: Scope[]; + /** + * this object for this call frame. + */ + this: Runtime.RemoteObject; + /** + * The value being returned, if the function is at return point. + */ + returnValue?: Runtime.RemoteObject | undefined; + } + /** + * Scope description. + */ + interface Scope { + /** + * Scope type. + */ + type: string; + /** + * Object representing the scope. For global and with scopes it represents the actual object; for the rest of the scopes, it is artificial transient object enumerating scope variables as its properties. + */ + object: Runtime.RemoteObject; + name?: string | undefined; + /** + * Location in the source code where scope starts + */ + startLocation?: Location | undefined; + /** + * Location in the source code where scope ends + */ + endLocation?: Location | undefined; + } + /** + * Search match for resource. + */ + interface SearchMatch { + /** + * Line number in resource content. + */ + lineNumber: number; + /** + * Line with match content. + */ + lineContent: string; + } + interface BreakLocation { + /** + * Script identifier as reported in the Debugger.scriptParsed. + */ + scriptId: Runtime.ScriptId; + /** + * Line number in the script (0-based). + */ + lineNumber: number; + /** + * Column number in the script (0-based). + */ + columnNumber?: number | undefined; + type?: string | undefined; + } + interface SetBreakpointsActiveParameterType { + /** + * New value for breakpoints active state. + */ + active: boolean; + } + interface SetSkipAllPausesParameterType { + /** + * New value for skip pauses state. + */ + skip: boolean; + } + interface SetBreakpointByUrlParameterType { + /** + * Line number to set breakpoint at. + */ + lineNumber: number; + /** + * URL of the resources to set breakpoint on. + */ + url?: string | undefined; + /** + * Regex pattern for the URLs of the resources to set breakpoints on. Either url or urlRegex must be specified. + */ + urlRegex?: string | undefined; + /** + * Script hash of the resources to set breakpoint on. + */ + scriptHash?: string | undefined; + /** + * Offset in the line to set breakpoint at. + */ + columnNumber?: number | undefined; + /** + * Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true. + */ + condition?: string | undefined; + } + interface SetBreakpointParameterType { + /** + * Location to set breakpoint in. + */ + location: Location; + /** + * Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true. + */ + condition?: string | undefined; + } + interface RemoveBreakpointParameterType { + breakpointId: BreakpointId; + } + interface GetPossibleBreakpointsParameterType { + /** + * Start of range to search possible breakpoint locations in. + */ + start: Location; + /** + * End of range to search possible breakpoint locations in (excluding). When not specified, end of scripts is used as end of range. + */ + end?: Location | undefined; + /** + * Only consider locations which are in the same (non-nested) function as start. + */ + restrictToFunction?: boolean | undefined; + } + interface ContinueToLocationParameterType { + /** + * Location to continue to. + */ + location: Location; + targetCallFrames?: string | undefined; + } + interface PauseOnAsyncCallParameterType { + /** + * Debugger will pause when async call with given stack trace is started. + */ + parentStackTraceId: Runtime.StackTraceId; + } + interface StepIntoParameterType { + /** + * Debugger will issue additional Debugger.paused notification if any async task is scheduled before next pause. + * @experimental + */ + breakOnAsyncCall?: boolean | undefined; + } + interface GetStackTraceParameterType { + stackTraceId: Runtime.StackTraceId; + } + interface SearchInContentParameterType { + /** + * Id of the script to search in. + */ + scriptId: Runtime.ScriptId; + /** + * String to search for. + */ + query: string; + /** + * If true, search is case sensitive. + */ + caseSensitive?: boolean | undefined; + /** + * If true, treats string parameter as regex. + */ + isRegex?: boolean | undefined; + } + interface SetScriptSourceParameterType { + /** + * Id of the script to edit. + */ + scriptId: Runtime.ScriptId; + /** + * New content of the script. + */ + scriptSource: string; + /** + * If true the change will not actually be applied. Dry run may be used to get result description without actually modifying the code. + */ + dryRun?: boolean | undefined; + } + interface RestartFrameParameterType { + /** + * Call frame identifier to evaluate on. + */ + callFrameId: CallFrameId; + } + interface GetScriptSourceParameterType { + /** + * Id of the script to get source for. + */ + scriptId: Runtime.ScriptId; + } + interface SetPauseOnExceptionsParameterType { + /** + * Pause on exceptions mode. + */ + state: string; + } + interface EvaluateOnCallFrameParameterType { + /** + * Call frame identifier to evaluate on. + */ + callFrameId: CallFrameId; + /** + * Expression to evaluate. + */ + expression: string; + /** + * String object group name to put result into (allows rapid releasing resulting object handles using releaseObjectGroup). + */ + objectGroup?: string | undefined; + /** + * Specifies whether command line API should be available to the evaluated expression, defaults to false. + */ + includeCommandLineAPI?: boolean | undefined; + /** + * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. + */ + silent?: boolean | undefined; + /** + * Whether the result is expected to be a JSON object that should be sent by value. + */ + returnByValue?: boolean | undefined; + /** + * Whether preview should be generated for the result. + * @experimental + */ + generatePreview?: boolean | undefined; + /** + * Whether to throw an exception if side effect cannot be ruled out during evaluation. + */ + throwOnSideEffect?: boolean | undefined; + } + interface SetVariableValueParameterType { + /** + * 0-based number of scope as was listed in scope chain. Only 'local', 'closure' and 'catch' scope types are allowed. Other scopes could be manipulated manually. + */ + scopeNumber: number; + /** + * Variable name. + */ + variableName: string; + /** + * New variable value. + */ + newValue: Runtime.CallArgument; + /** + * Id of callframe that holds variable. + */ + callFrameId: CallFrameId; + } + interface SetReturnValueParameterType { + /** + * New return value. + */ + newValue: Runtime.CallArgument; + } + interface SetAsyncCallStackDepthParameterType { + /** + * Maximum depth of async call stacks. Setting to 0 will effectively disable collecting async call stacks (default). + */ + maxDepth: number; + } + interface SetBlackboxPatternsParameterType { + /** + * Array of regexps that will be used to check script url for blackbox state. + */ + patterns: string[]; + } + interface SetBlackboxedRangesParameterType { + /** + * Id of the script. + */ + scriptId: Runtime.ScriptId; + positions: ScriptPosition[]; + } + interface EnableReturnType { + /** + * Unique identifier of the debugger. + * @experimental + */ + debuggerId: Runtime.UniqueDebuggerId; + } + interface SetBreakpointByUrlReturnType { + /** + * Id of the created breakpoint for further reference. + */ + breakpointId: BreakpointId; + /** + * List of the locations this breakpoint resolved into upon addition. + */ + locations: Location[]; + } + interface SetBreakpointReturnType { + /** + * Id of the created breakpoint for further reference. + */ + breakpointId: BreakpointId; + /** + * Location this breakpoint resolved into. + */ + actualLocation: Location; + } + interface GetPossibleBreakpointsReturnType { + /** + * List of the possible breakpoint locations. + */ + locations: BreakLocation[]; + } + interface GetStackTraceReturnType { + stackTrace: Runtime.StackTrace; + } + interface SearchInContentReturnType { + /** + * List of search matches. + */ + result: SearchMatch[]; + } + interface SetScriptSourceReturnType { + /** + * New stack trace in case editing has happened while VM was stopped. + */ + callFrames?: CallFrame[] | undefined; + /** + * Whether current call stack was modified after applying the changes. + */ + stackChanged?: boolean | undefined; + /** + * Async stack trace, if any. + */ + asyncStackTrace?: Runtime.StackTrace | undefined; + /** + * Async stack trace, if any. + * @experimental + */ + asyncStackTraceId?: Runtime.StackTraceId | undefined; + /** + * Exception details if any. + */ + exceptionDetails?: Runtime.ExceptionDetails | undefined; + } + interface RestartFrameReturnType { + /** + * New stack trace. + */ + callFrames: CallFrame[]; + /** + * Async stack trace, if any. + */ + asyncStackTrace?: Runtime.StackTrace | undefined; + /** + * Async stack trace, if any. + * @experimental + */ + asyncStackTraceId?: Runtime.StackTraceId | undefined; + } + interface GetScriptSourceReturnType { + /** + * Script source. + */ + scriptSource: string; + } + interface EvaluateOnCallFrameReturnType { + /** + * Object wrapper for the evaluation result. + */ + result: Runtime.RemoteObject; + /** + * Exception details. + */ + exceptionDetails?: Runtime.ExceptionDetails | undefined; + } + interface ScriptParsedEventDataType { + /** + * Identifier of the script parsed. + */ + scriptId: Runtime.ScriptId; + /** + * URL or name of the script parsed (if any). + */ + url: string; + /** + * Line offset of the script within the resource with given URL (for script tags). + */ + startLine: number; + /** + * Column offset of the script within the resource with given URL. + */ + startColumn: number; + /** + * Last line of the script. + */ + endLine: number; + /** + * Length of the last line of the script. + */ + endColumn: number; + /** + * Specifies script creation context. + */ + executionContextId: Runtime.ExecutionContextId; + /** + * Content hash of the script. + */ + hash: string; + /** + * Embedder-specific auxiliary data. + */ + executionContextAuxData?: {} | undefined; + /** + * True, if this script is generated as a result of the live edit operation. + * @experimental + */ + isLiveEdit?: boolean | undefined; + /** + * URL of source map associated with script (if any). + */ + sourceMapURL?: string | undefined; + /** + * True, if this script has sourceURL. + */ + hasSourceURL?: boolean | undefined; + /** + * True, if this script is ES6 module. + */ + isModule?: boolean | undefined; + /** + * This script length. + */ + length?: number | undefined; + /** + * JavaScript top stack frame of where the script parsed event was triggered if available. + * @experimental + */ + stackTrace?: Runtime.StackTrace | undefined; + } + interface ScriptFailedToParseEventDataType { + /** + * Identifier of the script parsed. + */ + scriptId: Runtime.ScriptId; + /** + * URL or name of the script parsed (if any). + */ + url: string; + /** + * Line offset of the script within the resource with given URL (for script tags). + */ + startLine: number; + /** + * Column offset of the script within the resource with given URL. + */ + startColumn: number; + /** + * Last line of the script. + */ + endLine: number; + /** + * Length of the last line of the script. + */ + endColumn: number; + /** + * Specifies script creation context. + */ + executionContextId: Runtime.ExecutionContextId; + /** + * Content hash of the script. + */ + hash: string; + /** + * Embedder-specific auxiliary data. + */ + executionContextAuxData?: {} | undefined; + /** + * URL of source map associated with script (if any). + */ + sourceMapURL?: string | undefined; + /** + * True, if this script has sourceURL. + */ + hasSourceURL?: boolean | undefined; + /** + * True, if this script is ES6 module. + */ + isModule?: boolean | undefined; + /** + * This script length. + */ + length?: number | undefined; + /** + * JavaScript top stack frame of where the script parsed event was triggered if available. + * @experimental + */ + stackTrace?: Runtime.StackTrace | undefined; + } + interface BreakpointResolvedEventDataType { + /** + * Breakpoint unique identifier. + */ + breakpointId: BreakpointId; + /** + * Actual breakpoint location. + */ + location: Location; + } + interface PausedEventDataType { + /** + * Call stack the virtual machine stopped on. + */ + callFrames: CallFrame[]; + /** + * Pause reason. + */ + reason: string; + /** + * Object containing break-specific auxiliary properties. + */ + data?: {} | undefined; + /** + * Hit breakpoints IDs + */ + hitBreakpoints?: string[] | undefined; + /** + * Async stack trace, if any. + */ + asyncStackTrace?: Runtime.StackTrace | undefined; + /** + * Async stack trace, if any. + * @experimental + */ + asyncStackTraceId?: Runtime.StackTraceId | undefined; + /** + * Just scheduled async call will have this stack trace as parent stack during async execution. This field is available only after Debugger.stepInto call with breakOnAsynCall flag. + * @experimental + */ + asyncCallStackTraceId?: Runtime.StackTraceId | undefined; + } + } + namespace Console { + /** + * Console message. + */ + interface ConsoleMessage { + /** + * Message source. + */ + source: string; + /** + * Message severity. + */ + level: string; + /** + * Message text. + */ + text: string; + /** + * URL of the message origin. + */ + url?: string | undefined; + /** + * Line number in the resource that generated this message (1-based). + */ + line?: number | undefined; + /** + * Column number in the resource that generated this message (1-based). + */ + column?: number | undefined; + } + interface MessageAddedEventDataType { + /** + * Console message that has been added. + */ + message: ConsoleMessage; + } + } + namespace Profiler { + /** + * Profile node. Holds callsite information, execution statistics and child nodes. + */ + interface ProfileNode { + /** + * Unique id of the node. + */ + id: number; + /** + * Function location. + */ + callFrame: Runtime.CallFrame; + /** + * Number of samples where this node was on top of the call stack. + */ + hitCount?: number | undefined; + /** + * Child node ids. + */ + children?: number[] | undefined; + /** + * The reason of being not optimized. The function may be deoptimized or marked as don't optimize. + */ + deoptReason?: string | undefined; + /** + * An array of source position ticks. + */ + positionTicks?: PositionTickInfo[] | undefined; + } + /** + * Profile. + */ + interface Profile { + /** + * The list of profile nodes. First item is the root node. + */ + nodes: ProfileNode[]; + /** + * Profiling start timestamp in microseconds. + */ + startTime: number; + /** + * Profiling end timestamp in microseconds. + */ + endTime: number; + /** + * Ids of samples top nodes. + */ + samples?: number[] | undefined; + /** + * Time intervals between adjacent samples in microseconds. The first delta is relative to the profile startTime. + */ + timeDeltas?: number[] | undefined; + } + /** + * Specifies a number of samples attributed to a certain source position. + */ + interface PositionTickInfo { + /** + * Source line number (1-based). + */ + line: number; + /** + * Number of samples attributed to the source line. + */ + ticks: number; + } + /** + * Coverage data for a source range. + */ + interface CoverageRange { + /** + * JavaScript script source offset for the range start. + */ + startOffset: number; + /** + * JavaScript script source offset for the range end. + */ + endOffset: number; + /** + * Collected execution count of the source range. + */ + count: number; + } + /** + * Coverage data for a JavaScript function. + */ + interface FunctionCoverage { + /** + * JavaScript function name. + */ + functionName: string; + /** + * Source ranges inside the function with coverage data. + */ + ranges: CoverageRange[]; + /** + * Whether coverage data for this function has block granularity. + */ + isBlockCoverage: boolean; + } + /** + * Coverage data for a JavaScript script. + */ + interface ScriptCoverage { + /** + * JavaScript script id. + */ + scriptId: Runtime.ScriptId; + /** + * JavaScript script name or url. + */ + url: string; + /** + * Functions contained in the script that has coverage data. + */ + functions: FunctionCoverage[]; + } + /** + * Describes a type collected during runtime. + * @experimental + */ + interface TypeObject { + /** + * Name of a type collected with type profiling. + */ + name: string; + } + /** + * Source offset and types for a parameter or return value. + * @experimental + */ + interface TypeProfileEntry { + /** + * Source offset of the parameter or end of function for return values. + */ + offset: number; + /** + * The types for this parameter or return value. + */ + types: TypeObject[]; + } + /** + * Type profile data collected during runtime for a JavaScript script. + * @experimental + */ + interface ScriptTypeProfile { + /** + * JavaScript script id. + */ + scriptId: Runtime.ScriptId; + /** + * JavaScript script name or url. + */ + url: string; + /** + * Type profile entries for parameters and return values of the functions in the script. + */ + entries: TypeProfileEntry[]; + } + interface SetSamplingIntervalParameterType { + /** + * New sampling interval in microseconds. + */ + interval: number; + } + interface StartPreciseCoverageParameterType { + /** + * Collect accurate call counts beyond simple 'covered' or 'not covered'. + */ + callCount?: boolean | undefined; + /** + * Collect block-based coverage. + */ + detailed?: boolean | undefined; + } + interface StopReturnType { + /** + * Recorded profile. + */ + profile: Profile; + } + interface TakePreciseCoverageReturnType { + /** + * Coverage data for the current isolate. + */ + result: ScriptCoverage[]; + } + interface GetBestEffortCoverageReturnType { + /** + * Coverage data for the current isolate. + */ + result: ScriptCoverage[]; + } + interface TakeTypeProfileReturnType { + /** + * Type profile for all scripts since startTypeProfile() was turned on. + */ + result: ScriptTypeProfile[]; + } + interface ConsoleProfileStartedEventDataType { + id: string; + /** + * Location of console.profile(). + */ + location: Debugger.Location; + /** + * Profile title passed as an argument to console.profile(). + */ + title?: string | undefined; + } + interface ConsoleProfileFinishedEventDataType { + id: string; + /** + * Location of console.profileEnd(). + */ + location: Debugger.Location; + profile: Profile; + /** + * Profile title passed as an argument to console.profile(). + */ + title?: string | undefined; + } + } + namespace HeapProfiler { + /** + * Heap snapshot object id. + */ + type HeapSnapshotObjectId = string; + /** + * Sampling Heap Profile node. Holds callsite information, allocation statistics and child nodes. + */ + interface SamplingHeapProfileNode { + /** + * Function location. + */ + callFrame: Runtime.CallFrame; + /** + * Allocations size in bytes for the node excluding children. + */ + selfSize: number; + /** + * Child nodes. + */ + children: SamplingHeapProfileNode[]; + } + /** + * Profile. + */ + interface SamplingHeapProfile { + head: SamplingHeapProfileNode; + } + interface StartTrackingHeapObjectsParameterType { + trackAllocations?: boolean | undefined; + } + interface StopTrackingHeapObjectsParameterType { + /** + * If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken when the tracking is stopped. + */ + reportProgress?: boolean | undefined; + } + interface TakeHeapSnapshotParameterType { + /** + * If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken. + */ + reportProgress?: boolean | undefined; + } + interface GetObjectByHeapObjectIdParameterType { + objectId: HeapSnapshotObjectId; + /** + * Symbolic group name that can be used to release multiple objects. + */ + objectGroup?: string | undefined; + } + interface AddInspectedHeapObjectParameterType { + /** + * Heap snapshot object id to be accessible by means of $x command line API. + */ + heapObjectId: HeapSnapshotObjectId; + } + interface GetHeapObjectIdParameterType { + /** + * Identifier of the object to get heap object id for. + */ + objectId: Runtime.RemoteObjectId; + } + interface StartSamplingParameterType { + /** + * Average sample interval in bytes. Poisson distribution is used for the intervals. The default value is 32768 bytes. + */ + samplingInterval?: number | undefined; + } + interface GetObjectByHeapObjectIdReturnType { + /** + * Evaluation result. + */ + result: Runtime.RemoteObject; + } + interface GetHeapObjectIdReturnType { + /** + * Id of the heap snapshot object corresponding to the passed remote object id. + */ + heapSnapshotObjectId: HeapSnapshotObjectId; + } + interface StopSamplingReturnType { + /** + * Recorded sampling heap profile. + */ + profile: SamplingHeapProfile; + } + interface GetSamplingProfileReturnType { + /** + * Return the sampling profile being collected. + */ + profile: SamplingHeapProfile; + } + interface AddHeapSnapshotChunkEventDataType { + chunk: string; + } + interface ReportHeapSnapshotProgressEventDataType { + done: number; + total: number; + finished?: boolean | undefined; + } + interface LastSeenObjectIdEventDataType { + lastSeenObjectId: number; + timestamp: number; + } + interface HeapStatsUpdateEventDataType { + /** + * An array of triplets. Each triplet describes a fragment. The first integer is the fragment index, the second integer is a total count of objects for the fragment, the third integer is a total size of the objects for the fragment. + */ + statsUpdate: number[]; + } + } + namespace NodeTracing { + interface TraceConfig { + /** + * Controls how the trace buffer stores data. + */ + recordMode?: string | undefined; + /** + * Included category filters. + */ + includedCategories: string[]; + } + interface StartParameterType { + traceConfig: TraceConfig; + } + interface GetCategoriesReturnType { + /** + * A list of supported tracing categories. + */ + categories: string[]; + } + interface DataCollectedEventDataType { + value: Array<{}>; + } + } + namespace NodeWorker { + type WorkerID = string; + /** + * Unique identifier of attached debugging session. + */ + type SessionID = string; + interface WorkerInfo { + workerId: WorkerID; + type: string; + title: string; + url: string; + } + interface SendMessageToWorkerParameterType { + message: string; + /** + * Identifier of the session. + */ + sessionId: SessionID; + } + interface EnableParameterType { + /** + * Whether to new workers should be paused until the frontend sends `Runtime.runIfWaitingForDebugger` + * message to run them. + */ + waitForDebuggerOnStart: boolean; + } + interface DetachParameterType { + sessionId: SessionID; + } + interface AttachedToWorkerEventDataType { + /** + * Identifier assigned to the session used to send/receive messages. + */ + sessionId: SessionID; + workerInfo: WorkerInfo; + waitingForDebugger: boolean; + } + interface DetachedFromWorkerEventDataType { + /** + * Detached session identifier. + */ + sessionId: SessionID; + } + interface ReceivedMessageFromWorkerEventDataType { + /** + * Identifier of a session which sends a message. + */ + sessionId: SessionID; + message: string; + } + } + namespace NodeRuntime { + interface NotifyWhenWaitingForDisconnectParameterType { + enabled: boolean; + } + } + /** + * The `inspector.Session` is used for dispatching messages to the V8 inspector + * back-end and receiving message responses and notifications. + */ + class Session extends EventEmitter { + /** + * Create a new instance of the inspector.Session class. + * The inspector session needs to be connected through session.connect() before the messages can be dispatched to the inspector backend. + */ + constructor(); + /** + * Connects a session to the inspector back-end. + * @since v8.0.0 + */ + connect(): void; + /** + * Immediately close the session. All pending message callbacks will be called + * with an error. `session.connect()` will need to be called to be able to send + * messages again. Reconnected session will lose all inspector state, such as + * enabled agents or configured breakpoints. + * @since v8.0.0 + */ + disconnect(): void; + /** + * Posts a message to the inspector back-end. `callback` will be notified when + * a response is received. `callback` is a function that accepts two optional + * arguments: error and message-specific result. + * + * ```js + * session.post('Runtime.evaluate', { expression: '2 + 2' }, + * (error, { result }) => console.log(result)); + * // Output: { type: 'number', value: 4, description: '4' } + * ``` + * + * The latest version of the V8 inspector protocol is published on the [Chrome DevTools Protocol Viewer](https://chromedevtools.github.io/devtools-protocol/v8/). + * + * Node.js inspector supports all the Chrome DevTools Protocol domains declared + * by V8\. Chrome DevTools Protocol domain provides an interface for interacting + * with one of the runtime agents used to inspect the application state and listen + * to the run-time events. + * + * ## Example usage + * + * Apart from the debugger, various V8 Profilers are available through the DevTools + * protocol. + * @since v8.0.0 + */ + post(method: string, params?: {}, callback?: (err: Error | null, params?: {}) => void): void; + post(method: string, callback?: (err: Error | null, params?: {}) => void): void; + /** + * Returns supported domains. + */ + post(method: 'Schema.getDomains', callback?: (err: Error | null, params: Schema.GetDomainsReturnType) => void): void; + /** + * Evaluates expression on global object. + */ + post(method: 'Runtime.evaluate', params?: Runtime.EvaluateParameterType, callback?: (err: Error | null, params: Runtime.EvaluateReturnType) => void): void; + post(method: 'Runtime.evaluate', callback?: (err: Error | null, params: Runtime.EvaluateReturnType) => void): void; + /** + * Add handler to promise with given promise object id. + */ + post(method: 'Runtime.awaitPromise', params?: Runtime.AwaitPromiseParameterType, callback?: (err: Error | null, params: Runtime.AwaitPromiseReturnType) => void): void; + post(method: 'Runtime.awaitPromise', callback?: (err: Error | null, params: Runtime.AwaitPromiseReturnType) => void): void; + /** + * Calls function with given declaration on the given object. Object group of the result is inherited from the target object. + */ + post(method: 'Runtime.callFunctionOn', params?: Runtime.CallFunctionOnParameterType, callback?: (err: Error | null, params: Runtime.CallFunctionOnReturnType) => void): void; + post(method: 'Runtime.callFunctionOn', callback?: (err: Error | null, params: Runtime.CallFunctionOnReturnType) => void): void; + /** + * Returns properties of a given object. Object group of the result is inherited from the target object. + */ + post(method: 'Runtime.getProperties', params?: Runtime.GetPropertiesParameterType, callback?: (err: Error | null, params: Runtime.GetPropertiesReturnType) => void): void; + post(method: 'Runtime.getProperties', callback?: (err: Error | null, params: Runtime.GetPropertiesReturnType) => void): void; + /** + * Releases remote object with given id. + */ + post(method: 'Runtime.releaseObject', params?: Runtime.ReleaseObjectParameterType, callback?: (err: Error | null) => void): void; + post(method: 'Runtime.releaseObject', callback?: (err: Error | null) => void): void; + /** + * Releases all remote objects that belong to a given group. + */ + post(method: 'Runtime.releaseObjectGroup', params?: Runtime.ReleaseObjectGroupParameterType, callback?: (err: Error | null) => void): void; + post(method: 'Runtime.releaseObjectGroup', callback?: (err: Error | null) => void): void; + /** + * Tells inspected instance to run if it was waiting for debugger to attach. + */ + post(method: 'Runtime.runIfWaitingForDebugger', callback?: (err: Error | null) => void): void; + /** + * Enables reporting of execution contexts creation by means of executionContextCreated event. When the reporting gets enabled the event will be sent immediately for each existing execution context. + */ + post(method: 'Runtime.enable', callback?: (err: Error | null) => void): void; + /** + * Disables reporting of execution contexts creation. + */ + post(method: 'Runtime.disable', callback?: (err: Error | null) => void): void; + /** + * Discards collected exceptions and console API calls. + */ + post(method: 'Runtime.discardConsoleEntries', callback?: (err: Error | null) => void): void; + /** + * @experimental + */ + post(method: 'Runtime.setCustomObjectFormatterEnabled', params?: Runtime.SetCustomObjectFormatterEnabledParameterType, callback?: (err: Error | null) => void): void; + post(method: 'Runtime.setCustomObjectFormatterEnabled', callback?: (err: Error | null) => void): void; + /** + * Compiles expression. + */ + post(method: 'Runtime.compileScript', params?: Runtime.CompileScriptParameterType, callback?: (err: Error | null, params: Runtime.CompileScriptReturnType) => void): void; + post(method: 'Runtime.compileScript', callback?: (err: Error | null, params: Runtime.CompileScriptReturnType) => void): void; + /** + * Runs script with given id in a given context. + */ + post(method: 'Runtime.runScript', params?: Runtime.RunScriptParameterType, callback?: (err: Error | null, params: Runtime.RunScriptReturnType) => void): void; + post(method: 'Runtime.runScript', callback?: (err: Error | null, params: Runtime.RunScriptReturnType) => void): void; + post(method: 'Runtime.queryObjects', params?: Runtime.QueryObjectsParameterType, callback?: (err: Error | null, params: Runtime.QueryObjectsReturnType) => void): void; + post(method: 'Runtime.queryObjects', callback?: (err: Error | null, params: Runtime.QueryObjectsReturnType) => void): void; + /** + * Returns all let, const and class variables from global scope. + */ + post( + method: 'Runtime.globalLexicalScopeNames', + params?: Runtime.GlobalLexicalScopeNamesParameterType, + callback?: (err: Error | null, params: Runtime.GlobalLexicalScopeNamesReturnType) => void + ): void; + post(method: 'Runtime.globalLexicalScopeNames', callback?: (err: Error | null, params: Runtime.GlobalLexicalScopeNamesReturnType) => void): void; + /** + * Enables debugger for the given page. Clients should not assume that the debugging has been enabled until the result for this command is received. + */ + post(method: 'Debugger.enable', callback?: (err: Error | null, params: Debugger.EnableReturnType) => void): void; + /** + * Disables debugger for given page. + */ + post(method: 'Debugger.disable', callback?: (err: Error | null) => void): void; + /** + * Activates / deactivates all breakpoints on the page. + */ + post(method: 'Debugger.setBreakpointsActive', params?: Debugger.SetBreakpointsActiveParameterType, callback?: (err: Error | null) => void): void; + post(method: 'Debugger.setBreakpointsActive', callback?: (err: Error | null) => void): void; + /** + * Makes page not interrupt on any pauses (breakpoint, exception, dom exception etc). + */ + post(method: 'Debugger.setSkipAllPauses', params?: Debugger.SetSkipAllPausesParameterType, callback?: (err: Error | null) => void): void; + post(method: 'Debugger.setSkipAllPauses', callback?: (err: Error | null) => void): void; + /** + * Sets JavaScript breakpoint at given location specified either by URL or URL regex. Once this command is issued, all existing parsed scripts will have breakpoints resolved and returned in locations property. Further matching script parsing will result in subsequent breakpointResolved events issued. This logical breakpoint will survive page reloads. + */ + post(method: 'Debugger.setBreakpointByUrl', params?: Debugger.SetBreakpointByUrlParameterType, callback?: (err: Error | null, params: Debugger.SetBreakpointByUrlReturnType) => void): void; + post(method: 'Debugger.setBreakpointByUrl', callback?: (err: Error | null, params: Debugger.SetBreakpointByUrlReturnType) => void): void; + /** + * Sets JavaScript breakpoint at a given location. + */ + post(method: 'Debugger.setBreakpoint', params?: Debugger.SetBreakpointParameterType, callback?: (err: Error | null, params: Debugger.SetBreakpointReturnType) => void): void; + post(method: 'Debugger.setBreakpoint', callback?: (err: Error | null, params: Debugger.SetBreakpointReturnType) => void): void; + /** + * Removes JavaScript breakpoint. + */ + post(method: 'Debugger.removeBreakpoint', params?: Debugger.RemoveBreakpointParameterType, callback?: (err: Error | null) => void): void; + post(method: 'Debugger.removeBreakpoint', callback?: (err: Error | null) => void): void; + /** + * Returns possible locations for breakpoint. scriptId in start and end range locations should be the same. + */ + post( + method: 'Debugger.getPossibleBreakpoints', + params?: Debugger.GetPossibleBreakpointsParameterType, + callback?: (err: Error | null, params: Debugger.GetPossibleBreakpointsReturnType) => void + ): void; + post(method: 'Debugger.getPossibleBreakpoints', callback?: (err: Error | null, params: Debugger.GetPossibleBreakpointsReturnType) => void): void; + /** + * Continues execution until specific location is reached. + */ + post(method: 'Debugger.continueToLocation', params?: Debugger.ContinueToLocationParameterType, callback?: (err: Error | null) => void): void; + post(method: 'Debugger.continueToLocation', callback?: (err: Error | null) => void): void; + /** + * @experimental + */ + post(method: 'Debugger.pauseOnAsyncCall', params?: Debugger.PauseOnAsyncCallParameterType, callback?: (err: Error | null) => void): void; + post(method: 'Debugger.pauseOnAsyncCall', callback?: (err: Error | null) => void): void; + /** + * Steps over the statement. + */ + post(method: 'Debugger.stepOver', callback?: (err: Error | null) => void): void; + /** + * Steps into the function call. + */ + post(method: 'Debugger.stepInto', params?: Debugger.StepIntoParameterType, callback?: (err: Error | null) => void): void; + post(method: 'Debugger.stepInto', callback?: (err: Error | null) => void): void; + /** + * Steps out of the function call. + */ + post(method: 'Debugger.stepOut', callback?: (err: Error | null) => void): void; + /** + * Stops on the next JavaScript statement. + */ + post(method: 'Debugger.pause', callback?: (err: Error | null) => void): void; + /** + * This method is deprecated - use Debugger.stepInto with breakOnAsyncCall and Debugger.pauseOnAsyncTask instead. Steps into next scheduled async task if any is scheduled before next pause. Returns success when async task is actually scheduled, returns error if no task were scheduled or another scheduleStepIntoAsync was called. + * @experimental + */ + post(method: 'Debugger.scheduleStepIntoAsync', callback?: (err: Error | null) => void): void; + /** + * Resumes JavaScript execution. + */ + post(method: 'Debugger.resume', callback?: (err: Error | null) => void): void; + /** + * Returns stack trace with given stackTraceId. + * @experimental + */ + post(method: 'Debugger.getStackTrace', params?: Debugger.GetStackTraceParameterType, callback?: (err: Error | null, params: Debugger.GetStackTraceReturnType) => void): void; + post(method: 'Debugger.getStackTrace', callback?: (err: Error | null, params: Debugger.GetStackTraceReturnType) => void): void; + /** + * Searches for given string in script content. + */ + post(method: 'Debugger.searchInContent', params?: Debugger.SearchInContentParameterType, callback?: (err: Error | null, params: Debugger.SearchInContentReturnType) => void): void; + post(method: 'Debugger.searchInContent', callback?: (err: Error | null, params: Debugger.SearchInContentReturnType) => void): void; + /** + * Edits JavaScript source live. + */ + post(method: 'Debugger.setScriptSource', params?: Debugger.SetScriptSourceParameterType, callback?: (err: Error | null, params: Debugger.SetScriptSourceReturnType) => void): void; + post(method: 'Debugger.setScriptSource', callback?: (err: Error | null, params: Debugger.SetScriptSourceReturnType) => void): void; + /** + * Restarts particular call frame from the beginning. + */ + post(method: 'Debugger.restartFrame', params?: Debugger.RestartFrameParameterType, callback?: (err: Error | null, params: Debugger.RestartFrameReturnType) => void): void; + post(method: 'Debugger.restartFrame', callback?: (err: Error | null, params: Debugger.RestartFrameReturnType) => void): void; + /** + * Returns source for the script with given id. + */ + post(method: 'Debugger.getScriptSource', params?: Debugger.GetScriptSourceParameterType, callback?: (err: Error | null, params: Debugger.GetScriptSourceReturnType) => void): void; + post(method: 'Debugger.getScriptSource', callback?: (err: Error | null, params: Debugger.GetScriptSourceReturnType) => void): void; + /** + * Defines pause on exceptions state. Can be set to stop on all exceptions, uncaught exceptions or no exceptions. Initial pause on exceptions state is none. + */ + post(method: 'Debugger.setPauseOnExceptions', params?: Debugger.SetPauseOnExceptionsParameterType, callback?: (err: Error | null) => void): void; + post(method: 'Debugger.setPauseOnExceptions', callback?: (err: Error | null) => void): void; + /** + * Evaluates expression on a given call frame. + */ + post(method: 'Debugger.evaluateOnCallFrame', params?: Debugger.EvaluateOnCallFrameParameterType, callback?: (err: Error | null, params: Debugger.EvaluateOnCallFrameReturnType) => void): void; + post(method: 'Debugger.evaluateOnCallFrame', callback?: (err: Error | null, params: Debugger.EvaluateOnCallFrameReturnType) => void): void; + /** + * Changes value of variable in a callframe. Object-based scopes are not supported and must be mutated manually. + */ + post(method: 'Debugger.setVariableValue', params?: Debugger.SetVariableValueParameterType, callback?: (err: Error | null) => void): void; + post(method: 'Debugger.setVariableValue', callback?: (err: Error | null) => void): void; + /** + * Changes return value in top frame. Available only at return break position. + * @experimental + */ + post(method: 'Debugger.setReturnValue', params?: Debugger.SetReturnValueParameterType, callback?: (err: Error | null) => void): void; + post(method: 'Debugger.setReturnValue', callback?: (err: Error | null) => void): void; + /** + * Enables or disables async call stacks tracking. + */ + post(method: 'Debugger.setAsyncCallStackDepth', params?: Debugger.SetAsyncCallStackDepthParameterType, callback?: (err: Error | null) => void): void; + post(method: 'Debugger.setAsyncCallStackDepth', callback?: (err: Error | null) => void): void; + /** + * Replace previous blackbox patterns with passed ones. Forces backend to skip stepping/pausing in scripts with url matching one of the patterns. VM will try to leave blackboxed script by performing 'step in' several times, finally resorting to 'step out' if unsuccessful. + * @experimental + */ + post(method: 'Debugger.setBlackboxPatterns', params?: Debugger.SetBlackboxPatternsParameterType, callback?: (err: Error | null) => void): void; + post(method: 'Debugger.setBlackboxPatterns', callback?: (err: Error | null) => void): void; + /** + * Makes backend skip steps in the script in blackboxed ranges. VM will try leave blacklisted scripts by performing 'step in' several times, finally resorting to 'step out' if unsuccessful. Positions array contains positions where blackbox state is changed. First interval isn't blackboxed. Array should be sorted. + * @experimental + */ + post(method: 'Debugger.setBlackboxedRanges', params?: Debugger.SetBlackboxedRangesParameterType, callback?: (err: Error | null) => void): void; + post(method: 'Debugger.setBlackboxedRanges', callback?: (err: Error | null) => void): void; + /** + * Enables console domain, sends the messages collected so far to the client by means of the messageAdded notification. + */ + post(method: 'Console.enable', callback?: (err: Error | null) => void): void; + /** + * Disables console domain, prevents further console messages from being reported to the client. + */ + post(method: 'Console.disable', callback?: (err: Error | null) => void): void; + /** + * Does nothing. + */ + post(method: 'Console.clearMessages', callback?: (err: Error | null) => void): void; + post(method: 'Profiler.enable', callback?: (err: Error | null) => void): void; + post(method: 'Profiler.disable', callback?: (err: Error | null) => void): void; + /** + * Changes CPU profiler sampling interval. Must be called before CPU profiles recording started. + */ + post(method: 'Profiler.setSamplingInterval', params?: Profiler.SetSamplingIntervalParameterType, callback?: (err: Error | null) => void): void; + post(method: 'Profiler.setSamplingInterval', callback?: (err: Error | null) => void): void; + post(method: 'Profiler.start', callback?: (err: Error | null) => void): void; + post(method: 'Profiler.stop', callback?: (err: Error | null, params: Profiler.StopReturnType) => void): void; + /** + * Enable precise code coverage. Coverage data for JavaScript executed before enabling precise code coverage may be incomplete. Enabling prevents running optimized code and resets execution counters. + */ + post(method: 'Profiler.startPreciseCoverage', params?: Profiler.StartPreciseCoverageParameterType, callback?: (err: Error | null) => void): void; + post(method: 'Profiler.startPreciseCoverage', callback?: (err: Error | null) => void): void; + /** + * Disable precise code coverage. Disabling releases unnecessary execution count records and allows executing optimized code. + */ + post(method: 'Profiler.stopPreciseCoverage', callback?: (err: Error | null) => void): void; + /** + * Collect coverage data for the current isolate, and resets execution counters. Precise code coverage needs to have started. + */ + post(method: 'Profiler.takePreciseCoverage', callback?: (err: Error | null, params: Profiler.TakePreciseCoverageReturnType) => void): void; + /** + * Collect coverage data for the current isolate. The coverage data may be incomplete due to garbage collection. + */ + post(method: 'Profiler.getBestEffortCoverage', callback?: (err: Error | null, params: Profiler.GetBestEffortCoverageReturnType) => void): void; + /** + * Enable type profile. + * @experimental + */ + post(method: 'Profiler.startTypeProfile', callback?: (err: Error | null) => void): void; + /** + * Disable type profile. Disabling releases type profile data collected so far. + * @experimental + */ + post(method: 'Profiler.stopTypeProfile', callback?: (err: Error | null) => void): void; + /** + * Collect type profile. + * @experimental + */ + post(method: 'Profiler.takeTypeProfile', callback?: (err: Error | null, params: Profiler.TakeTypeProfileReturnType) => void): void; + post(method: 'HeapProfiler.enable', callback?: (err: Error | null) => void): void; + post(method: 'HeapProfiler.disable', callback?: (err: Error | null) => void): void; + post(method: 'HeapProfiler.startTrackingHeapObjects', params?: HeapProfiler.StartTrackingHeapObjectsParameterType, callback?: (err: Error | null) => void): void; + post(method: 'HeapProfiler.startTrackingHeapObjects', callback?: (err: Error | null) => void): void; + post(method: 'HeapProfiler.stopTrackingHeapObjects', params?: HeapProfiler.StopTrackingHeapObjectsParameterType, callback?: (err: Error | null) => void): void; + post(method: 'HeapProfiler.stopTrackingHeapObjects', callback?: (err: Error | null) => void): void; + post(method: 'HeapProfiler.takeHeapSnapshot', params?: HeapProfiler.TakeHeapSnapshotParameterType, callback?: (err: Error | null) => void): void; + post(method: 'HeapProfiler.takeHeapSnapshot', callback?: (err: Error | null) => void): void; + post(method: 'HeapProfiler.collectGarbage', callback?: (err: Error | null) => void): void; + post( + method: 'HeapProfiler.getObjectByHeapObjectId', + params?: HeapProfiler.GetObjectByHeapObjectIdParameterType, + callback?: (err: Error | null, params: HeapProfiler.GetObjectByHeapObjectIdReturnType) => void + ): void; + post(method: 'HeapProfiler.getObjectByHeapObjectId', callback?: (err: Error | null, params: HeapProfiler.GetObjectByHeapObjectIdReturnType) => void): void; + /** + * Enables console to refer to the node with given id via $x (see Command Line API for more details $x functions). + */ + post(method: 'HeapProfiler.addInspectedHeapObject', params?: HeapProfiler.AddInspectedHeapObjectParameterType, callback?: (err: Error | null) => void): void; + post(method: 'HeapProfiler.addInspectedHeapObject', callback?: (err: Error | null) => void): void; + post(method: 'HeapProfiler.getHeapObjectId', params?: HeapProfiler.GetHeapObjectIdParameterType, callback?: (err: Error | null, params: HeapProfiler.GetHeapObjectIdReturnType) => void): void; + post(method: 'HeapProfiler.getHeapObjectId', callback?: (err: Error | null, params: HeapProfiler.GetHeapObjectIdReturnType) => void): void; + post(method: 'HeapProfiler.startSampling', params?: HeapProfiler.StartSamplingParameterType, callback?: (err: Error | null) => void): void; + post(method: 'HeapProfiler.startSampling', callback?: (err: Error | null) => void): void; + post(method: 'HeapProfiler.stopSampling', callback?: (err: Error | null, params: HeapProfiler.StopSamplingReturnType) => void): void; + post(method: 'HeapProfiler.getSamplingProfile', callback?: (err: Error | null, params: HeapProfiler.GetSamplingProfileReturnType) => void): void; + /** + * Gets supported tracing categories. + */ + post(method: 'NodeTracing.getCategories', callback?: (err: Error | null, params: NodeTracing.GetCategoriesReturnType) => void): void; + /** + * Start trace events collection. + */ + post(method: 'NodeTracing.start', params?: NodeTracing.StartParameterType, callback?: (err: Error | null) => void): void; + post(method: 'NodeTracing.start', callback?: (err: Error | null) => void): void; + /** + * Stop trace events collection. Remaining collected events will be sent as a sequence of + * dataCollected events followed by tracingComplete event. + */ + post(method: 'NodeTracing.stop', callback?: (err: Error | null) => void): void; + /** + * Sends protocol message over session with given id. + */ + post(method: 'NodeWorker.sendMessageToWorker', params?: NodeWorker.SendMessageToWorkerParameterType, callback?: (err: Error | null) => void): void; + post(method: 'NodeWorker.sendMessageToWorker', callback?: (err: Error | null) => void): void; + /** + * Instructs the inspector to attach to running workers. Will also attach to new workers + * as they start + */ + post(method: 'NodeWorker.enable', params?: NodeWorker.EnableParameterType, callback?: (err: Error | null) => void): void; + post(method: 'NodeWorker.enable', callback?: (err: Error | null) => void): void; + /** + * Detaches from all running workers and disables attaching to new workers as they are started. + */ + post(method: 'NodeWorker.disable', callback?: (err: Error | null) => void): void; + /** + * Detached from the worker with given sessionId. + */ + post(method: 'NodeWorker.detach', params?: NodeWorker.DetachParameterType, callback?: (err: Error | null) => void): void; + post(method: 'NodeWorker.detach', callback?: (err: Error | null) => void): void; + /** + * Enable the `NodeRuntime.waitingForDisconnect`. + */ + post(method: 'NodeRuntime.notifyWhenWaitingForDisconnect', params?: NodeRuntime.NotifyWhenWaitingForDisconnectParameterType, callback?: (err: Error | null) => void): void; + post(method: 'NodeRuntime.notifyWhenWaitingForDisconnect', callback?: (err: Error | null) => void): void; + // Events + addListener(event: string, listener: (...args: any[]) => void): this; + /** + * Emitted when any notification from the V8 Inspector is received. + */ + addListener(event: 'inspectorNotification', listener: (message: InspectorNotification<{}>) => void): this; + /** + * Issued when new execution context is created. + */ + addListener(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; + /** + * Issued when execution context is destroyed. + */ + addListener(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; + /** + * Issued when all executionContexts were cleared in browser + */ + addListener(event: 'Runtime.executionContextsCleared', listener: () => void): this; + /** + * Issued when exception was thrown and unhandled. + */ + addListener(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; + /** + * Issued when unhandled exception was revoked. + */ + addListener(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; + /** + * Issued when console API was called. + */ + addListener(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; + /** + * Issued when object should be inspected (for example, as a result of inspect() command line API call). + */ + addListener(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; + /** + * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. + */ + addListener(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; + /** + * Fired when virtual machine fails to parse the script. + */ + addListener(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; + /** + * Fired when breakpoint is resolved to an actual script and location. + */ + addListener(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; + /** + * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. + */ + addListener(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; + /** + * Fired when the virtual machine resumed execution. + */ + addListener(event: 'Debugger.resumed', listener: () => void): this; + /** + * Issued when new console message is added. + */ + addListener(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; + /** + * Sent when new profile recording is started using console.profile() call. + */ + addListener(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification) => void): this; + addListener(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification) => void): this; + addListener(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification) => void): this; + addListener(event: 'HeapProfiler.resetProfiles', listener: () => void): this; + addListener(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification) => void): this; + /** + * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. + */ + addListener(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; + /** + * If heap objects tracking has been started then backend may send update for one or more fragments + */ + addListener(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; + /** + * Contains an bucket of collected trace events. + */ + addListener(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; + /** + * Signals that tracing is stopped and there is no trace buffers pending flush, all data were + * delivered via dataCollected events. + */ + addListener(event: 'NodeTracing.tracingComplete', listener: () => void): this; + /** + * Issued when attached to a worker. + */ + addListener(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; + /** + * Issued when detached from the worker. + */ + addListener(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; + /** + * Notifies about a new protocol message received from the session + * (session ID is provided in attachedToWorker notification). + */ + addListener(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; + /** + * This event is fired instead of `Runtime.executionContextDestroyed` when + * enabled. + * It is fired when the Node process finished all code execution and is + * waiting for all frontends to disconnect. + */ + addListener(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this; + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: 'inspectorNotification', message: InspectorNotification<{}>): boolean; + emit(event: 'Runtime.executionContextCreated', message: InspectorNotification): boolean; + emit(event: 'Runtime.executionContextDestroyed', message: InspectorNotification): boolean; + emit(event: 'Runtime.executionContextsCleared'): boolean; + emit(event: 'Runtime.exceptionThrown', message: InspectorNotification): boolean; + emit(event: 'Runtime.exceptionRevoked', message: InspectorNotification): boolean; + emit(event: 'Runtime.consoleAPICalled', message: InspectorNotification): boolean; + emit(event: 'Runtime.inspectRequested', message: InspectorNotification): boolean; + emit(event: 'Debugger.scriptParsed', message: InspectorNotification): boolean; + emit(event: 'Debugger.scriptFailedToParse', message: InspectorNotification): boolean; + emit(event: 'Debugger.breakpointResolved', message: InspectorNotification): boolean; + emit(event: 'Debugger.paused', message: InspectorNotification): boolean; + emit(event: 'Debugger.resumed'): boolean; + emit(event: 'Console.messageAdded', message: InspectorNotification): boolean; + emit(event: 'Profiler.consoleProfileStarted', message: InspectorNotification): boolean; + emit(event: 'Profiler.consoleProfileFinished', message: InspectorNotification): boolean; + emit(event: 'HeapProfiler.addHeapSnapshotChunk', message: InspectorNotification): boolean; + emit(event: 'HeapProfiler.resetProfiles'): boolean; + emit(event: 'HeapProfiler.reportHeapSnapshotProgress', message: InspectorNotification): boolean; + emit(event: 'HeapProfiler.lastSeenObjectId', message: InspectorNotification): boolean; + emit(event: 'HeapProfiler.heapStatsUpdate', message: InspectorNotification): boolean; + emit(event: 'NodeTracing.dataCollected', message: InspectorNotification): boolean; + emit(event: 'NodeTracing.tracingComplete'): boolean; + emit(event: 'NodeWorker.attachedToWorker', message: InspectorNotification): boolean; + emit(event: 'NodeWorker.detachedFromWorker', message: InspectorNotification): boolean; + emit(event: 'NodeWorker.receivedMessageFromWorker', message: InspectorNotification): boolean; + emit(event: 'NodeRuntime.waitingForDisconnect'): boolean; + on(event: string, listener: (...args: any[]) => void): this; + /** + * Emitted when any notification from the V8 Inspector is received. + */ + on(event: 'inspectorNotification', listener: (message: InspectorNotification<{}>) => void): this; + /** + * Issued when new execution context is created. + */ + on(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; + /** + * Issued when execution context is destroyed. + */ + on(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; + /** + * Issued when all executionContexts were cleared in browser + */ + on(event: 'Runtime.executionContextsCleared', listener: () => void): this; + /** + * Issued when exception was thrown and unhandled. + */ + on(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; + /** + * Issued when unhandled exception was revoked. + */ + on(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; + /** + * Issued when console API was called. + */ + on(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; + /** + * Issued when object should be inspected (for example, as a result of inspect() command line API call). + */ + on(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; + /** + * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. + */ + on(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; + /** + * Fired when virtual machine fails to parse the script. + */ + on(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; + /** + * Fired when breakpoint is resolved to an actual script and location. + */ + on(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; + /** + * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. + */ + on(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; + /** + * Fired when the virtual machine resumed execution. + */ + on(event: 'Debugger.resumed', listener: () => void): this; + /** + * Issued when new console message is added. + */ + on(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; + /** + * Sent when new profile recording is started using console.profile() call. + */ + on(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification) => void): this; + on(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification) => void): this; + on(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification) => void): this; + on(event: 'HeapProfiler.resetProfiles', listener: () => void): this; + on(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification) => void): this; + /** + * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. + */ + on(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; + /** + * If heap objects tracking has been started then backend may send update for one or more fragments + */ + on(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; + /** + * Contains an bucket of collected trace events. + */ + on(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; + /** + * Signals that tracing is stopped and there is no trace buffers pending flush, all data were + * delivered via dataCollected events. + */ + on(event: 'NodeTracing.tracingComplete', listener: () => void): this; + /** + * Issued when attached to a worker. + */ + on(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; + /** + * Issued when detached from the worker. + */ + on(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; + /** + * Notifies about a new protocol message received from the session + * (session ID is provided in attachedToWorker notification). + */ + on(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; + /** + * This event is fired instead of `Runtime.executionContextDestroyed` when + * enabled. + * It is fired when the Node process finished all code execution and is + * waiting for all frontends to disconnect. + */ + on(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this; + once(event: string, listener: (...args: any[]) => void): this; + /** + * Emitted when any notification from the V8 Inspector is received. + */ + once(event: 'inspectorNotification', listener: (message: InspectorNotification<{}>) => void): this; + /** + * Issued when new execution context is created. + */ + once(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; + /** + * Issued when execution context is destroyed. + */ + once(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; + /** + * Issued when all executionContexts were cleared in browser + */ + once(event: 'Runtime.executionContextsCleared', listener: () => void): this; + /** + * Issued when exception was thrown and unhandled. + */ + once(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; + /** + * Issued when unhandled exception was revoked. + */ + once(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; + /** + * Issued when console API was called. + */ + once(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; + /** + * Issued when object should be inspected (for example, as a result of inspect() command line API call). + */ + once(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; + /** + * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. + */ + once(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; + /** + * Fired when virtual machine fails to parse the script. + */ + once(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; + /** + * Fired when breakpoint is resolved to an actual script and location. + */ + once(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; + /** + * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. + */ + once(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; + /** + * Fired when the virtual machine resumed execution. + */ + once(event: 'Debugger.resumed', listener: () => void): this; + /** + * Issued when new console message is added. + */ + once(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; + /** + * Sent when new profile recording is started using console.profile() call. + */ + once(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification) => void): this; + once(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification) => void): this; + once(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification) => void): this; + once(event: 'HeapProfiler.resetProfiles', listener: () => void): this; + once(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification) => void): this; + /** + * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. + */ + once(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; + /** + * If heap objects tracking has been started then backend may send update for one or more fragments + */ + once(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; + /** + * Contains an bucket of collected trace events. + */ + once(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; + /** + * Signals that tracing is stopped and there is no trace buffers pending flush, all data were + * delivered via dataCollected events. + */ + once(event: 'NodeTracing.tracingComplete', listener: () => void): this; + /** + * Issued when attached to a worker. + */ + once(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; + /** + * Issued when detached from the worker. + */ + once(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; + /** + * Notifies about a new protocol message received from the session + * (session ID is provided in attachedToWorker notification). + */ + once(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; + /** + * This event is fired instead of `Runtime.executionContextDestroyed` when + * enabled. + * It is fired when the Node process finished all code execution and is + * waiting for all frontends to disconnect. + */ + once(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this; + prependListener(event: string, listener: (...args: any[]) => void): this; + /** + * Emitted when any notification from the V8 Inspector is received. + */ + prependListener(event: 'inspectorNotification', listener: (message: InspectorNotification<{}>) => void): this; + /** + * Issued when new execution context is created. + */ + prependListener(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; + /** + * Issued when execution context is destroyed. + */ + prependListener(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; + /** + * Issued when all executionContexts were cleared in browser + */ + prependListener(event: 'Runtime.executionContextsCleared', listener: () => void): this; + /** + * Issued when exception was thrown and unhandled. + */ + prependListener(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; + /** + * Issued when unhandled exception was revoked. + */ + prependListener(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; + /** + * Issued when console API was called. + */ + prependListener(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; + /** + * Issued when object should be inspected (for example, as a result of inspect() command line API call). + */ + prependListener(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; + /** + * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. + */ + prependListener(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; + /** + * Fired when virtual machine fails to parse the script. + */ + prependListener(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; + /** + * Fired when breakpoint is resolved to an actual script and location. + */ + prependListener(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; + /** + * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. + */ + prependListener(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; + /** + * Fired when the virtual machine resumed execution. + */ + prependListener(event: 'Debugger.resumed', listener: () => void): this; + /** + * Issued when new console message is added. + */ + prependListener(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; + /** + * Sent when new profile recording is started using console.profile() call. + */ + prependListener(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification) => void): this; + prependListener(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification) => void): this; + prependListener(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification) => void): this; + prependListener(event: 'HeapProfiler.resetProfiles', listener: () => void): this; + prependListener(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification) => void): this; + /** + * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. + */ + prependListener(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; + /** + * If heap objects tracking has been started then backend may send update for one or more fragments + */ + prependListener(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; + /** + * Contains an bucket of collected trace events. + */ + prependListener(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; + /** + * Signals that tracing is stopped and there is no trace buffers pending flush, all data were + * delivered via dataCollected events. + */ + prependListener(event: 'NodeTracing.tracingComplete', listener: () => void): this; + /** + * Issued when attached to a worker. + */ + prependListener(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; + /** + * Issued when detached from the worker. + */ + prependListener(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; + /** + * Notifies about a new protocol message received from the session + * (session ID is provided in attachedToWorker notification). + */ + prependListener(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; + /** + * This event is fired instead of `Runtime.executionContextDestroyed` when + * enabled. + * It is fired when the Node process finished all code execution and is + * waiting for all frontends to disconnect. + */ + prependListener(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this; + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + /** + * Emitted when any notification from the V8 Inspector is received. + */ + prependOnceListener(event: 'inspectorNotification', listener: (message: InspectorNotification<{}>) => void): this; + /** + * Issued when new execution context is created. + */ + prependOnceListener(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; + /** + * Issued when execution context is destroyed. + */ + prependOnceListener(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; + /** + * Issued when all executionContexts were cleared in browser + */ + prependOnceListener(event: 'Runtime.executionContextsCleared', listener: () => void): this; + /** + * Issued when exception was thrown and unhandled. + */ + prependOnceListener(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; + /** + * Issued when unhandled exception was revoked. + */ + prependOnceListener(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; + /** + * Issued when console API was called. + */ + prependOnceListener(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; + /** + * Issued when object should be inspected (for example, as a result of inspect() command line API call). + */ + prependOnceListener(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; + /** + * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. + */ + prependOnceListener(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; + /** + * Fired when virtual machine fails to parse the script. + */ + prependOnceListener(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; + /** + * Fired when breakpoint is resolved to an actual script and location. + */ + prependOnceListener(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; + /** + * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. + */ + prependOnceListener(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; + /** + * Fired when the virtual machine resumed execution. + */ + prependOnceListener(event: 'Debugger.resumed', listener: () => void): this; + /** + * Issued when new console message is added. + */ + prependOnceListener(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; + /** + * Sent when new profile recording is started using console.profile() call. + */ + prependOnceListener(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: 'HeapProfiler.resetProfiles', listener: () => void): this; + prependOnceListener(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification) => void): this; + /** + * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. + */ + prependOnceListener(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; + /** + * If heap objects tracking has been started then backend may send update for one or more fragments + */ + prependOnceListener(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; + /** + * Contains an bucket of collected trace events. + */ + prependOnceListener(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; + /** + * Signals that tracing is stopped and there is no trace buffers pending flush, all data were + * delivered via dataCollected events. + */ + prependOnceListener(event: 'NodeTracing.tracingComplete', listener: () => void): this; + /** + * Issued when attached to a worker. + */ + prependOnceListener(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; + /** + * Issued when detached from the worker. + */ + prependOnceListener(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; + /** + * Notifies about a new protocol message received from the session + * (session ID is provided in attachedToWorker notification). + */ + prependOnceListener(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; + /** + * This event is fired instead of `Runtime.executionContextDestroyed` when + * enabled. + * It is fired when the Node process finished all code execution and is + * waiting for all frontends to disconnect. + */ + prependOnceListener(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this; + } + /** + * Activate inspector on host and port. Equivalent to`node --inspect=[[host:]port]`, but can be done programmatically after node has + * started. + * + * If wait is `true`, will block until a client has connected to the inspect port + * and flow control has been passed to the debugger client. + * + * See the `security warning` regarding the `host`parameter usage. + * @param [port='what was specified on the CLI'] Port to listen on for inspector connections. Optional. + * @param [host='what was specified on the CLI'] Host to listen on for inspector connections. Optional. + * @param [wait=false] Block until a client has connected. Optional. + * @returns Disposable that calls `inspector.close()`. + */ + function open(port?: number, host?: string, wait?: boolean): Disposable; + /** + * Deactivate the inspector. Blocks until there are no active connections. + */ + function close(): void; + /** + * Return the URL of the active inspector, or `undefined` if there is none. + * + * ```console + * $ node --inspect -p 'inspector.url()' + * Debugger listening on ws://127.0.0.1:9229/166e272e-7a30-4d09-97ce-f1c012b43c34 + * For help, see: https://nodejs.org/en/docs/inspector + * ws://127.0.0.1:9229/166e272e-7a30-4d09-97ce-f1c012b43c34 + * + * $ node --inspect=localhost:3000 -p 'inspector.url()' + * Debugger listening on ws://localhost:3000/51cf8d0e-3c36-4c59-8efd-54519839e56a + * For help, see: https://nodejs.org/en/docs/inspector + * ws://localhost:3000/51cf8d0e-3c36-4c59-8efd-54519839e56a + * + * $ node -p 'inspector.url()' + * undefined + * ``` + */ + function url(): string | undefined; + /** + * Blocks until a client (existing or connected later) has sent`Runtime.runIfWaitingForDebugger` command. + * + * An exception will be thrown if there is no active inspector. + * @since v12.7.0 + */ + function waitForDebugger(): void; +} +/** + * The inspector module provides an API for interacting with the V8 inspector. + */ +declare module 'inspector' { + import inspector = require('node:inspector'); + export = inspector; +} diff --git a/node_modules/@types/node/module.d.ts b/node_modules/@types/node/module.d.ts new file mode 100644 index 0000000..5331d20 --- /dev/null +++ b/node_modules/@types/node/module.d.ts @@ -0,0 +1,257 @@ +/** + * @since v0.3.7 + */ +declare module 'node:module' { + import { URL } from 'node:url'; + import { MessagePort } from 'node:worker_threads'; + namespace Module { + /** + * The `module.syncBuiltinESMExports()` method updates all the live bindings for + * builtin `ES Modules` to match the properties of the `CommonJS` exports. It + * does not add or remove exported names from the `ES Modules`. + * + * ```js + * const fs = require('node:fs'); + * const assert = require('node:assert'); + * const { syncBuiltinESMExports } = require('node:module'); + * + * fs.readFile = newAPI; + * + * delete fs.readFileSync; + * + * function newAPI() { + * // ... + * } + * + * fs.newAPI = newAPI; + * + * syncBuiltinESMExports(); + * + * import('node:fs').then((esmFS) => { + * // It syncs the existing readFile property with the new value + * assert.strictEqual(esmFS.readFile, newAPI); + * // readFileSync has been deleted from the required fs + * assert.strictEqual('readFileSync' in fs, false); + * // syncBuiltinESMExports() does not remove readFileSync from esmFS + * assert.strictEqual('readFileSync' in esmFS, true); + * // syncBuiltinESMExports() does not add names + * assert.strictEqual(esmFS.newAPI, undefined); + * }); + * ``` + * @since v12.12.0 + */ + function syncBuiltinESMExports(): void; + /** + * `path` is the resolved path for the file for which a corresponding source map + * should be fetched. + * @since v13.7.0, v12.17.0 + * @return Returns `module.SourceMap` if a source map is found, `undefined` otherwise. + */ + function findSourceMap(path: string, error?: Error): SourceMap; + interface SourceMapPayload { + file: string; + version: number; + sources: string[]; + sourcesContent: string[]; + names: string[]; + mappings: string; + sourceRoot: string; + } + interface SourceMapping { + generatedLine: number; + generatedColumn: number; + originalSource: string; + originalLine: number; + originalColumn: number; + } + /** + * @since v13.7.0, v12.17.0 + */ + class SourceMap { + /** + * Getter for the payload used to construct the `SourceMap` instance. + */ + readonly payload: SourceMapPayload; + constructor(payload: SourceMapPayload); + /** + * Given a line offset and column offset in the generated source + * file, returns an object representing the SourceMap range in the + * original file if found, or an empty object if not. + * + * The object returned contains the following keys: + * + * The returned value represents the raw range as it appears in the + * SourceMap, based on zero-indexed offsets, _not_ 1-indexed line and + * column numbers as they appear in Error messages and CallSite + * objects. + * + * To get the corresponding 1-indexed line and column numbers from a + * lineNumber and columnNumber as they are reported by Error stacks + * and CallSite objects, use `sourceMap.findOrigin(lineNumber, columnNumber)` + * @param lineOffset The zero-indexed line number offset in the generated source + * @param columnOffset The zero-indexed column number offset in the generated source + */ + findEntry(lineOffset: number, columnOffset: number): SourceMapping; + } + interface ImportAssertions extends NodeJS.Dict { + type?: string | undefined; + } + type ModuleFormat = 'builtin' | 'commonjs' | 'json' | 'module' | 'wasm'; + type ModuleSource = string | ArrayBuffer | NodeJS.TypedArray; + interface GlobalPreloadContext { + port: MessagePort; + } + /** + * @deprecated This hook will be removed in a future version. + * Use `initialize` instead. When a loader has an `initialize` export, `globalPreload` will be ignored. + * + * Sometimes it might be necessary to run some code inside of the same global scope that the application runs in. + * This hook allows the return of a string that is run as a sloppy-mode script on startup. + * + * @param context Information to assist the preload code + * @return Code to run before application startup + */ + type GlobalPreloadHook = (context: GlobalPreloadContext) => string; + /** + * The `initialize` hook provides a way to define a custom function that runs in the loader's thread + * when the loader is initialized. Initialization happens when the loader is registered via `register` + * or registered via the `--experimental-loader` command line option. + * + * This hook can send and receive data from a `register` invocation, including ports and other transferrable objects. + */ + type InitializeHook = (data: Data) => ReturnType; + interface ResolveHookContext { + /** + * Export conditions of the relevant `package.json` + */ + conditions: string[]; + /** + * An object whose key-value pairs represent the assertions for the module to import + */ + importAssertions: ImportAssertions; + /** + * The module importing this one, or undefined if this is the Node.js entry point + */ + parentURL: string | undefined; + } + interface ResolveFnOutput { + /** + * A hint to the load hook (it might be ignored) + */ + format?: ModuleFormat | null | undefined; + /** + * The import assertions to use when caching the module (optional; if excluded the input will be used) + */ + importAssertions?: ImportAssertions | undefined; + /** + * A signal that this hook intends to terminate the chain of `resolve` hooks. + * @default false + */ + shortCircuit?: boolean | undefined; + /** + * The absolute URL to which this input resolves + */ + url: string; + } + /** + * The `resolve` hook chain is responsible for resolving file URL for a given module specifier and parent URL, and optionally its format (such as `'module'`) as a hint to the `load` hook. + * If a format is specified, the load hook is ultimately responsible for providing the final `format` value (and it is free to ignore the hint provided by `resolve`); + * if `resolve` provides a format, a custom `load` hook is required even if only to pass the value to the Node.js default `load` hook. + * + * @param specifier The specified URL path of the module to be resolved + * @param context + * @param nextResolve The subsequent `resolve` hook in the chain, or the Node.js default `resolve` hook after the last user-supplied resolve hook + */ + type ResolveHook = ( + specifier: string, + context: ResolveHookContext, + nextResolve: (specifier: string, context?: ResolveHookContext) => ResolveFnOutput | Promise + ) => ResolveFnOutput | Promise; + interface LoadHookContext { + /** + * Export conditions of the relevant `package.json` + */ + conditions: string[]; + /** + * The format optionally supplied by the `resolve` hook chain + */ + format: ModuleFormat; + /** + * An object whose key-value pairs represent the assertions for the module to import + */ + importAssertions: ImportAssertions; + } + interface LoadFnOutput { + format: ModuleFormat; + /** + * A signal that this hook intends to terminate the chain of `resolve` hooks. + * @default false + */ + shortCircuit?: boolean | undefined; + /** + * The source for Node.js to evaluate + */ + source?: ModuleSource; + } + /** + * The `load` hook provides a way to define a custom method of determining how a URL should be interpreted, retrieved, and parsed. + * It is also in charge of validating the import assertion. + * + * @param url The URL/path of the module to be loaded + * @param context Metadata about the module + * @param nextLoad The subsequent `load` hook in the chain, or the Node.js default `load` hook after the last user-supplied `load` hook + */ + type LoadHook = ( + url: string, + context: LoadHookContext, + nextLoad: (url: string, context?: LoadHookContext) => LoadFnOutput | Promise + ) => LoadFnOutput | Promise; + } + interface RegisterOptions { + parentURL: string; + data?: Data | undefined; + transferList?: any[] | undefined; + } + interface Module extends NodeModule {} + class Module { + static runMain(): void; + static wrap(code: string): string; + static createRequire(path: string | URL): NodeRequire; + static builtinModules: string[]; + static isBuiltin(moduleName: string): boolean; + static Module: typeof Module; + static register(specifier: string, parentURL?: string, options?: RegisterOptions): ReturnType; + static register(specifier: string, options?: RegisterOptions): ReturnType; + constructor(id: string, parent?: Module); + } + global { + interface ImportMeta { + url: string; + /** + * Provides a module-relative resolution function scoped to each module, returning + * the URL string. + * + * @param specified The module specifier to resolve relative to the current module. + * @returns The absolute (`file:`) URL string for the resolved module. + */ + resolve(specified: string): string; + /** + * This feature is only available with the `--experimental-import-meta-resolve` + * command flag enabled. + * + * Provides a module-relative resolution function scoped to each module, returning + * the URL string. + * + * @param specified The module specifier to resolve relative to `parent`. + * @param parent The absolute parent module URL to resolve from. + * @returns The absolute (`file:`) URL string for the resolved module. + */ + resolve(specified: string, parent: string | URL): string; + } + } + export = Module; +} +declare module 'module' { + import module = require('node:module'); + export = module; +} diff --git a/node_modules/@types/node/net.d.ts b/node_modules/@types/node/net.d.ts new file mode 100644 index 0000000..ddecca1 --- /dev/null +++ b/node_modules/@types/node/net.d.ts @@ -0,0 +1,893 @@ +/** + * > Stability: 2 - Stable + * + * The `node:net` module provides an asynchronous network API for creating stream-based + * TCP or `IPC` servers ({@link createServer}) and clients + * ({@link createConnection}). + * + * It can be accessed using: + * + * ```js + * const net = require('node:net'); + * ``` + * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/net.js) + */ +declare module 'node:net' { + import * as stream from 'node:stream'; + import { Abortable, EventEmitter } from 'node:events'; + import * as dns from 'node:dns'; + type LookupFunction = (hostname: string, options: dns.LookupAllOptions, callback: (err: NodeJS.ErrnoException | null, addresses: dns.LookupAddress[]) => void) => void; + interface AddressInfo { + address: string; + family: string; + port: number; + } + interface SocketConstructorOpts { + fd?: number | undefined; + allowHalfOpen?: boolean | undefined; + readable?: boolean | undefined; + writable?: boolean | undefined; + signal?: AbortSignal; + } + interface OnReadOpts { + buffer: Uint8Array | (() => Uint8Array); + /** + * This function is called for every chunk of incoming data. + * Two arguments are passed to it: the number of bytes written to buffer and a reference to buffer. + * Return false from this function to implicitly pause() the socket. + */ + callback(bytesWritten: number, buf: Uint8Array): boolean; + } + interface ConnectOpts { + /** + * If specified, incoming data is stored in a single buffer and passed to the supplied callback when data arrives on the socket. + * Note: this will cause the streaming functionality to not provide any data, however events like 'error', 'end', and 'close' will + * still be emitted as normal and methods like pause() and resume() will also behave as expected. + */ + onread?: OnReadOpts | undefined; + } + interface TcpSocketConnectOpts extends ConnectOpts { + port: number; + host?: string | undefined; + localAddress?: string | undefined; + localPort?: number | undefined; + hints?: number | undefined; + family?: number | undefined; + lookup?: LookupFunction | undefined; + noDelay?: boolean | undefined; + keepAlive?: boolean | undefined; + keepAliveInitialDelay?: number | undefined; + /** + * @since v18.13.0 + */ + autoSelectFamily?: boolean | undefined; + /** + * @since v18.13.0 + */ + autoSelectFamilyAttemptTimeout?: number | undefined; + } + interface IpcSocketConnectOpts extends ConnectOpts { + path: string; + } + type SocketConnectOpts = TcpSocketConnectOpts | IpcSocketConnectOpts; + type SocketReadyState = 'opening' | 'open' | 'readOnly' | 'writeOnly' | 'closed'; + /** + * This class is an abstraction of a TCP socket or a streaming `IPC` endpoint + * (uses named pipes on Windows, and Unix domain sockets otherwise). It is also + * an `EventEmitter`. + * + * A `net.Socket` can be created by the user and used directly to interact with + * a server. For example, it is returned by {@link createConnection}, + * so the user can use it to talk to the server. + * + * It can also be created by Node.js and passed to the user when a connection + * is received. For example, it is passed to the listeners of a `'connection'` event emitted on a {@link Server}, so the user can use + * it to interact with the client. + * @since v0.3.4 + */ + class Socket extends stream.Duplex { + constructor(options?: SocketConstructorOpts); + /** + * Sends data on the socket. The second parameter specifies the encoding in the + * case of a string. It defaults to UTF8 encoding. + * + * Returns `true` if the entire data was flushed successfully to the kernel + * buffer. Returns `false` if all or part of the data was queued in user memory.`'drain'` will be emitted when the buffer is again free. + * + * The optional `callback` parameter will be executed when the data is finally + * written out, which may not be immediately. + * + * See `Writable` stream `write()` method for more + * information. + * @since v0.1.90 + * @param [encoding='utf8'] Only used when data is `string`. + */ + write(buffer: Uint8Array | string, cb?: (err?: Error) => void): boolean; + write(str: Uint8Array | string, encoding?: BufferEncoding, cb?: (err?: Error) => void): boolean; + /** + * Initiate a connection on a given socket. + * + * Possible signatures: + * + * * `socket.connect(options[, connectListener])` + * * `socket.connect(path[, connectListener])` for `IPC` connections. + * * `socket.connect(port[, host][, connectListener])` for TCP connections. + * * Returns: `net.Socket` The socket itself. + * + * This function is asynchronous. When the connection is established, the `'connect'` event will be emitted. If there is a problem connecting, + * instead of a `'connect'` event, an `'error'` event will be emitted with + * the error passed to the `'error'` listener. + * The last parameter `connectListener`, if supplied, will be added as a listener + * for the `'connect'` event **once**. + * + * This function should only be used for reconnecting a socket after`'close'` has been emitted or otherwise it may lead to undefined + * behavior. + */ + connect(options: SocketConnectOpts, connectionListener?: () => void): this; + connect(port: number, host: string, connectionListener?: () => void): this; + connect(port: number, connectionListener?: () => void): this; + connect(path: string, connectionListener?: () => void): this; + /** + * Set the encoding for the socket as a `Readable Stream`. See `readable.setEncoding()` for more information. + * @since v0.1.90 + * @return The socket itself. + */ + setEncoding(encoding?: BufferEncoding): this; + /** + * Pauses the reading of data. That is, `'data'` events will not be emitted. + * Useful to throttle back an upload. + * @return The socket itself. + */ + pause(): this; + /** + * Close the TCP connection by sending an RST packet and destroy the stream. + * If this TCP socket is in connecting status, it will send an RST packet and destroy this TCP socket once it is connected. + * Otherwise, it will call `socket.destroy` with an `ERR_SOCKET_CLOSED` Error. + * If this is not a TCP socket (for example, a pipe), calling this method will immediately throw an `ERR_INVALID_HANDLE_TYPE` Error. + * @since v18.3.0, v16.17.0 + */ + resetAndDestroy(): this; + /** + * Resumes reading after a call to `socket.pause()`. + * @return The socket itself. + */ + resume(): this; + /** + * Sets the socket to timeout after `timeout` milliseconds of inactivity on + * the socket. By default `net.Socket` do not have a timeout. + * + * When an idle timeout is triggered the socket will receive a `'timeout'` event but the connection will not be severed. The user must manually call `socket.end()` or `socket.destroy()` to + * end the connection. + * + * ```js + * socket.setTimeout(3000); + * socket.on('timeout', () => { + * console.log('socket timeout'); + * socket.end(); + * }); + * ``` + * + * If `timeout` is 0, then the existing idle timeout is disabled. + * + * The optional `callback` parameter will be added as a one-time listener for the `'timeout'` event. + * @since v0.1.90 + * @return The socket itself. + */ + setTimeout(timeout: number, callback?: () => void): this; + /** + * Enable/disable the use of Nagle's algorithm. + * + * When a TCP connection is created, it will have Nagle's algorithm enabled. + * + * Nagle's algorithm delays data before it is sent via the network. It attempts + * to optimize throughput at the expense of latency. + * + * Passing `true` for `noDelay` or not passing an argument will disable Nagle's + * algorithm for the socket. Passing `false` for `noDelay` will enable Nagle's + * algorithm. + * @since v0.1.90 + * @param [noDelay=true] + * @return The socket itself. + */ + setNoDelay(noDelay?: boolean): this; + /** + * Enable/disable keep-alive functionality, and optionally set the initial + * delay before the first keepalive probe is sent on an idle socket. + * + * Set `initialDelay` (in milliseconds) to set the delay between the last + * data packet received and the first keepalive probe. Setting `0` for`initialDelay` will leave the value unchanged from the default + * (or previous) setting. + * + * Enabling the keep-alive functionality will set the following socket options: + * + * * `SO_KEEPALIVE=1` + * * `TCP_KEEPIDLE=initialDelay` + * * `TCP_KEEPCNT=10` + * * `TCP_KEEPINTVL=1` + * @since v0.1.92 + * @param [enable=false] + * @param [initialDelay=0] + * @return The socket itself. + */ + setKeepAlive(enable?: boolean, initialDelay?: number): this; + /** + * Returns the bound `address`, the address `family` name and `port` of the + * socket as reported by the operating system:`{ port: 12346, family: 'IPv4', address: '127.0.0.1' }` + * @since v0.1.90 + */ + address(): AddressInfo | {}; + /** + * Calling `unref()` on a socket will allow the program to exit if this is the only + * active socket in the event system. If the socket is already `unref`ed calling`unref()` again will have no effect. + * @since v0.9.1 + * @return The socket itself. + */ + unref(): this; + /** + * Opposite of `unref()`, calling `ref()` on a previously `unref`ed socket will _not_ let the program exit if it's the only socket left (the default behavior). + * If the socket is `ref`ed calling `ref` again will have no effect. + * @since v0.9.1 + * @return The socket itself. + */ + ref(): this; + /** + * This property shows the number of characters buffered for writing. The buffer + * may contain strings whose length after encoding is not yet known. So this number + * is only an approximation of the number of bytes in the buffer. + * + * `net.Socket` has the property that `socket.write()` always works. This is to + * help users get up and running quickly. The computer cannot always keep up + * with the amount of data that is written to a socket. The network connection + * simply might be too slow. Node.js will internally queue up the data written to a + * socket and send it out over the wire when it is possible. + * + * The consequence of this internal buffering is that memory may grow. + * Users who experience large or growing `bufferSize` should attempt to + * "throttle" the data flows in their program with `socket.pause()` and `socket.resume()`. + * @since v0.3.8 + * @deprecated Since v14.6.0 - Use `writableLength` instead. + */ + readonly bufferSize: number; + /** + * The amount of received bytes. + * @since v0.5.3 + */ + readonly bytesRead: number; + /** + * The amount of bytes sent. + * @since v0.5.3 + */ + readonly bytesWritten: number; + /** + * If `true`,`socket.connect(options[, connectListener])` was + * called and has not yet finished. It will stay `true` until the socket becomes + * connected, then it is set to `false` and the `'connect'` event is emitted. Note + * that the `socket.connect(options[, connectListener])` callback is a listener for the `'connect'` event. + * @since v6.1.0 + */ + readonly connecting: boolean; + /** + * This is `true` if the socket is not connected yet, either because `.connect()`has not yet been called or because it is still in the process of connecting + * (see `socket.connecting`). + * @since v11.2.0, v10.16.0 + */ + readonly pending: boolean; + /** + * See `writable.destroyed` for further details. + */ + readonly destroyed: boolean; + /** + * The string representation of the local IP address the remote client is + * connecting on. For example, in a server listening on `'0.0.0.0'`, if a client + * connects on `'192.168.1.1'`, the value of `socket.localAddress` would be`'192.168.1.1'`. + * @since v0.9.6 + */ + readonly localAddress?: string; + /** + * The numeric representation of the local port. For example, `80` or `21`. + * @since v0.9.6 + */ + readonly localPort?: number; + /** + * The string representation of the local IP family. `'IPv4'` or `'IPv6'`. + * @since v18.8.0, v16.18.0 + */ + readonly localFamily?: string; + /** + * This property represents the state of the connection as a string. + * + * * If the stream is connecting `socket.readyState` is `opening`. + * * If the stream is readable and writable, it is `open`. + * * If the stream is readable and not writable, it is `readOnly`. + * * If the stream is not readable and writable, it is `writeOnly`. + * @since v0.5.0 + */ + readonly readyState: SocketReadyState; + /** + * The string representation of the remote IP address. For example,`'74.125.127.100'` or `'2001:4860:a005::68'`. Value may be `undefined` if + * the socket is destroyed (for example, if the client disconnected). + * @since v0.5.10 + */ + readonly remoteAddress?: string | undefined; + /** + * The string representation of the remote IP family. `'IPv4'` or `'IPv6'`. Value may be `undefined` if + * the socket is destroyed (for example, if the client disconnected). + * @since v0.11.14 + */ + readonly remoteFamily?: string | undefined; + /** + * The numeric representation of the remote port. For example, `80` or `21`. Value may be `undefined` if + * the socket is destroyed (for example, if the client disconnected). + * @since v0.5.10 + */ + readonly remotePort?: number | undefined; + /** + * The socket timeout in milliseconds as set by `socket.setTimeout()`. + * It is `undefined` if a timeout has not been set. + * @since v10.7.0 + */ + readonly timeout?: number | undefined; + /** + * Half-closes the socket. i.e., it sends a FIN packet. It is possible the + * server will still send some data. + * + * See `writable.end()` for further details. + * @since v0.1.90 + * @param [encoding='utf8'] Only used when data is `string`. + * @param callback Optional callback for when the socket is finished. + * @return The socket itself. + */ + end(callback?: () => void): this; + end(buffer: Uint8Array | string, callback?: () => void): this; + end(str: Uint8Array | string, encoding?: BufferEncoding, callback?: () => void): this; + /** + * events.EventEmitter + * 1. close + * 2. connect + * 3. data + * 4. drain + * 5. end + * 6. error + * 7. lookup + * 8. ready + * 9. timeout + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: 'close', listener: (hadError: boolean) => void): this; + addListener(event: 'connect', listener: () => void): this; + addListener(event: 'data', listener: (data: Buffer) => void): this; + addListener(event: 'drain', listener: () => void): this; + addListener(event: 'end', listener: () => void): this; + addListener(event: 'error', listener: (err: Error) => void): this; + addListener(event: 'lookup', listener: (err: Error, address: string, family: string | number, host: string) => void): this; + addListener(event: 'ready', listener: () => void): this; + addListener(event: 'timeout', listener: () => void): this; + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: 'close', hadError: boolean): boolean; + emit(event: 'connect'): boolean; + emit(event: 'data', data: Buffer): boolean; + emit(event: 'drain'): boolean; + emit(event: 'end'): boolean; + emit(event: 'error', err: Error): boolean; + emit(event: 'lookup', err: Error, address: string, family: string | number, host: string): boolean; + emit(event: 'ready'): boolean; + emit(event: 'timeout'): boolean; + on(event: string, listener: (...args: any[]) => void): this; + on(event: 'close', listener: (hadError: boolean) => void): this; + on(event: 'connect', listener: () => void): this; + on(event: 'data', listener: (data: Buffer) => void): this; + on(event: 'drain', listener: () => void): this; + on(event: 'end', listener: () => void): this; + on(event: 'error', listener: (err: Error) => void): this; + on(event: 'lookup', listener: (err: Error, address: string, family: string | number, host: string) => void): this; + on(event: 'ready', listener: () => void): this; + on(event: 'timeout', listener: () => void): this; + once(event: string, listener: (...args: any[]) => void): this; + once(event: 'close', listener: (hadError: boolean) => void): this; + once(event: 'connect', listener: () => void): this; + once(event: 'data', listener: (data: Buffer) => void): this; + once(event: 'drain', listener: () => void): this; + once(event: 'end', listener: () => void): this; + once(event: 'error', listener: (err: Error) => void): this; + once(event: 'lookup', listener: (err: Error, address: string, family: string | number, host: string) => void): this; + once(event: 'ready', listener: () => void): this; + once(event: 'timeout', listener: () => void): this; + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: 'close', listener: (hadError: boolean) => void): this; + prependListener(event: 'connect', listener: () => void): this; + prependListener(event: 'data', listener: (data: Buffer) => void): this; + prependListener(event: 'drain', listener: () => void): this; + prependListener(event: 'end', listener: () => void): this; + prependListener(event: 'error', listener: (err: Error) => void): this; + prependListener(event: 'lookup', listener: (err: Error, address: string, family: string | number, host: string) => void): this; + prependListener(event: 'ready', listener: () => void): this; + prependListener(event: 'timeout', listener: () => void): this; + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'close', listener: (hadError: boolean) => void): this; + prependOnceListener(event: 'connect', listener: () => void): this; + prependOnceListener(event: 'data', listener: (data: Buffer) => void): this; + prependOnceListener(event: 'drain', listener: () => void): this; + prependOnceListener(event: 'end', listener: () => void): this; + prependOnceListener(event: 'error', listener: (err: Error) => void): this; + prependOnceListener(event: 'lookup', listener: (err: Error, address: string, family: string | number, host: string) => void): this; + prependOnceListener(event: 'ready', listener: () => void): this; + prependOnceListener(event: 'timeout', listener: () => void): this; + } + interface ListenOptions extends Abortable { + port?: number | undefined; + host?: string | undefined; + backlog?: number | undefined; + path?: string | undefined; + exclusive?: boolean | undefined; + readableAll?: boolean | undefined; + writableAll?: boolean | undefined; + /** + * @default false + */ + ipv6Only?: boolean | undefined; + } + interface ServerOpts { + /** + * Indicates whether half-opened TCP connections are allowed. + * @default false + */ + allowHalfOpen?: boolean | undefined; + /** + * Indicates whether the socket should be paused on incoming connections. + * @default false + */ + pauseOnConnect?: boolean | undefined; + /** + * If set to `true`, it disables the use of Nagle's algorithm immediately after a new incoming connection is received. + * @default false + * @since v16.5.0 + */ + noDelay?: boolean | undefined; + /** + * If set to `true`, it enables keep-alive functionality on the socket immediately after a new incoming connection is received, + * similarly on what is done in `socket.setKeepAlive([enable][, initialDelay])`. + * @default false + * @since v16.5.0 + */ + keepAlive?: boolean | undefined; + /** + * If set to a positive number, it sets the initial delay before the first keepalive probe is sent on an idle socket. + * @default 0 + * @since v16.5.0 + */ + keepAliveInitialDelay?: number | undefined; + } + interface DropArgument { + localAddress?: string; + localPort?: number; + localFamily?: string; + remoteAddress?: string; + remotePort?: number; + remoteFamily?: string; + } + /** + * This class is used to create a TCP or `IPC` server. + * @since v0.1.90 + */ + class Server extends EventEmitter { + constructor(connectionListener?: (socket: Socket) => void); + constructor(options?: ServerOpts, connectionListener?: (socket: Socket) => void); + /** + * Start a server listening for connections. A `net.Server` can be a TCP or + * an `IPC` server depending on what it listens to. + * + * Possible signatures: + * + * * `server.listen(handle[, backlog][, callback])` + * * `server.listen(options[, callback])` + * * `server.listen(path[, backlog][, callback])` for `IPC` servers + * * `server.listen([port[, host[, backlog]]][, callback])` for TCP servers + * + * This function is asynchronous. When the server starts listening, the `'listening'` event will be emitted. The last parameter `callback`will be added as a listener for the `'listening'` + * event. + * + * All `listen()` methods can take a `backlog` parameter to specify the maximum + * length of the queue of pending connections. The actual length will be determined + * by the OS through sysctl settings such as `tcp_max_syn_backlog` and `somaxconn`on Linux. The default value of this parameter is 511 (not 512). + * + * All {@link Socket} are set to `SO_REUSEADDR` (see [`socket(7)`](https://man7.org/linux/man-pages/man7/socket.7.html) for + * details). + * + * The `server.listen()` method can be called again if and only if there was an + * error during the first `server.listen()` call or `server.close()` has been + * called. Otherwise, an `ERR_SERVER_ALREADY_LISTEN` error will be thrown. + * + * One of the most common errors raised when listening is `EADDRINUSE`. + * This happens when another server is already listening on the requested`port`/`path`/`handle`. One way to handle this would be to retry + * after a certain amount of time: + * + * ```js + * server.on('error', (e) => { + * if (e.code === 'EADDRINUSE') { + * console.error('Address in use, retrying...'); + * setTimeout(() => { + * server.close(); + * server.listen(PORT, HOST); + * }, 1000); + * } + * }); + * ``` + */ + listen(port?: number, hostname?: string, backlog?: number, listeningListener?: () => void): this; + listen(port?: number, hostname?: string, listeningListener?: () => void): this; + listen(port?: number, backlog?: number, listeningListener?: () => void): this; + listen(port?: number, listeningListener?: () => void): this; + listen(path: string, backlog?: number, listeningListener?: () => void): this; + listen(path: string, listeningListener?: () => void): this; + listen(options: ListenOptions, listeningListener?: () => void): this; + listen(handle: any, backlog?: number, listeningListener?: () => void): this; + listen(handle: any, listeningListener?: () => void): this; + /** + * Stops the server from accepting new connections and keeps existing + * connections. This function is asynchronous, the server is finally closed + * when all connections are ended and the server emits a `'close'` event. + * The optional `callback` will be called once the `'close'` event occurs. Unlike + * that event, it will be called with an `Error` as its only argument if the server + * was not open when it was closed. + * @since v0.1.90 + * @param callback Called when the server is closed. + */ + close(callback?: (err?: Error) => void): this; + /** + * Returns the bound `address`, the address `family` name, and `port` of the server + * as reported by the operating system if listening on an IP socket + * (useful to find which port was assigned when getting an OS-assigned address):`{ port: 12346, family: 'IPv4', address: '127.0.0.1' }`. + * + * For a server listening on a pipe or Unix domain socket, the name is returned + * as a string. + * + * ```js + * const server = net.createServer((socket) => { + * socket.end('goodbye\n'); + * }).on('error', (err) => { + * // Handle errors here. + * throw err; + * }); + * + * // Grab an arbitrary unused port. + * server.listen(() => { + * console.log('opened server on', server.address()); + * }); + * ``` + * + * `server.address()` returns `null` before the `'listening'` event has been + * emitted or after calling `server.close()`. + * @since v0.1.90 + */ + address(): AddressInfo | string | null; + /** + * Asynchronously get the number of concurrent connections on the server. Works + * when sockets were sent to forks. + * + * Callback should take two arguments `err` and `count`. + * @since v0.9.7 + */ + getConnections(cb: (error: Error | null, count: number) => void): void; + /** + * Opposite of `unref()`, calling `ref()` on a previously `unref`ed server will _not_ let the program exit if it's the only server left (the default behavior). + * If the server is `ref`ed calling `ref()` again will have no effect. + * @since v0.9.1 + */ + ref(): this; + /** + * Calling `unref()` on a server will allow the program to exit if this is the only + * active server in the event system. If the server is already `unref`ed calling`unref()` again will have no effect. + * @since v0.9.1 + */ + unref(): this; + /** + * Set this property to reject connections when the server's connection count gets + * high. + * + * It is not recommended to use this option once a socket has been sent to a child + * with `child_process.fork()`. + * @since v0.2.0 + */ + maxConnections: number; + connections: number; + /** + * Indicates whether or not the server is listening for connections. + * @since v5.7.0 + */ + listening: boolean; + /** + * events.EventEmitter + * 1. close + * 2. connection + * 3. error + * 4. listening + * 5. drop + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: 'close', listener: () => void): this; + addListener(event: 'connection', listener: (socket: Socket) => void): this; + addListener(event: 'error', listener: (err: Error) => void): this; + addListener(event: 'listening', listener: () => void): this; + addListener(event: 'drop', listener: (data?: DropArgument) => void): this; + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: 'close'): boolean; + emit(event: 'connection', socket: Socket): boolean; + emit(event: 'error', err: Error): boolean; + emit(event: 'listening'): boolean; + emit(event: 'drop', data?: DropArgument): boolean; + on(event: string, listener: (...args: any[]) => void): this; + on(event: 'close', listener: () => void): this; + on(event: 'connection', listener: (socket: Socket) => void): this; + on(event: 'error', listener: (err: Error) => void): this; + on(event: 'listening', listener: () => void): this; + on(event: 'drop', listener: (data?: DropArgument) => void): this; + once(event: string, listener: (...args: any[]) => void): this; + once(event: 'close', listener: () => void): this; + once(event: 'connection', listener: (socket: Socket) => void): this; + once(event: 'error', listener: (err: Error) => void): this; + once(event: 'listening', listener: () => void): this; + once(event: 'drop', listener: (data?: DropArgument) => void): this; + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: 'close', listener: () => void): this; + prependListener(event: 'connection', listener: (socket: Socket) => void): this; + prependListener(event: 'error', listener: (err: Error) => void): this; + prependListener(event: 'listening', listener: () => void): this; + prependListener(event: 'drop', listener: (data?: DropArgument) => void): this; + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'close', listener: () => void): this; + prependOnceListener(event: 'connection', listener: (socket: Socket) => void): this; + prependOnceListener(event: 'error', listener: (err: Error) => void): this; + prependOnceListener(event: 'listening', listener: () => void): this; + prependOnceListener(event: 'drop', listener: (data?: DropArgument) => void): this; + /** + * Calls {@link Server.close()} and returns a promise that fulfills when the server has closed. + * @since v20.5.0 + */ + [Symbol.asyncDispose](): Promise; + } + type IPVersion = 'ipv4' | 'ipv6'; + /** + * The `BlockList` object can be used with some network APIs to specify rules for + * disabling inbound or outbound access to specific IP addresses, IP ranges, or + * IP subnets. + * @since v15.0.0, v14.18.0 + */ + class BlockList { + /** + * Adds a rule to block the given IP address. + * @since v15.0.0, v14.18.0 + * @param address An IPv4 or IPv6 address. + * @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`. + */ + addAddress(address: string, type?: IPVersion): void; + addAddress(address: SocketAddress): void; + /** + * Adds a rule to block a range of IP addresses from `start` (inclusive) to`end` (inclusive). + * @since v15.0.0, v14.18.0 + * @param start The starting IPv4 or IPv6 address in the range. + * @param end The ending IPv4 or IPv6 address in the range. + * @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`. + */ + addRange(start: string, end: string, type?: IPVersion): void; + addRange(start: SocketAddress, end: SocketAddress): void; + /** + * Adds a rule to block a range of IP addresses specified as a subnet mask. + * @since v15.0.0, v14.18.0 + * @param net The network IPv4 or IPv6 address. + * @param prefix The number of CIDR prefix bits. For IPv4, this must be a value between `0` and `32`. For IPv6, this must be between `0` and `128`. + * @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`. + */ + addSubnet(net: SocketAddress, prefix: number): void; + addSubnet(net: string, prefix: number, type?: IPVersion): void; + /** + * Returns `true` if the given IP address matches any of the rules added to the`BlockList`. + * + * ```js + * const blockList = new net.BlockList(); + * blockList.addAddress('123.123.123.123'); + * blockList.addRange('10.0.0.1', '10.0.0.10'); + * blockList.addSubnet('8592:757c:efae:4e45::', 64, 'ipv6'); + * + * console.log(blockList.check('123.123.123.123')); // Prints: true + * console.log(blockList.check('10.0.0.3')); // Prints: true + * console.log(blockList.check('222.111.111.222')); // Prints: false + * + * // IPv6 notation for IPv4 addresses works: + * console.log(blockList.check('::ffff:7b7b:7b7b', 'ipv6')); // Prints: true + * console.log(blockList.check('::ffff:123.123.123.123', 'ipv6')); // Prints: true + * ``` + * @since v15.0.0, v14.18.0 + * @param address The IP address to check + * @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`. + */ + check(address: SocketAddress): boolean; + check(address: string, type?: IPVersion): boolean; + } + interface TcpNetConnectOpts extends TcpSocketConnectOpts, SocketConstructorOpts { + timeout?: number | undefined; + } + interface IpcNetConnectOpts extends IpcSocketConnectOpts, SocketConstructorOpts { + timeout?: number | undefined; + } + type NetConnectOpts = TcpNetConnectOpts | IpcNetConnectOpts; + /** + * Creates a new TCP or `IPC` server. + * + * If `allowHalfOpen` is set to `true`, when the other end of the socket + * signals the end of transmission, the server will only send back the end of + * transmission when `socket.end()` is explicitly called. For example, in the + * context of TCP, when a FIN packed is received, a FIN packed is sent + * back only when `socket.end()` is explicitly called. Until then the + * connection is half-closed (non-readable but still writable). See `'end'` event and [RFC 1122](https://tools.ietf.org/html/rfc1122) (section 4.2.2.13) for more information. + * + * If `pauseOnConnect` is set to `true`, then the socket associated with each + * incoming connection will be paused, and no data will be read from its handle. + * This allows connections to be passed between processes without any data being + * read by the original process. To begin reading data from a paused socket, call `socket.resume()`. + * + * The server can be a TCP server or an `IPC` server, depending on what it `listen()` to. + * + * Here is an example of a TCP echo server which listens for connections + * on port 8124: + * + * ```js + * const net = require('node:net'); + * const server = net.createServer((c) => { + * // 'connection' listener. + * console.log('client connected'); + * c.on('end', () => { + * console.log('client disconnected'); + * }); + * c.write('hello\r\n'); + * c.pipe(c); + * }); + * server.on('error', (err) => { + * throw err; + * }); + * server.listen(8124, () => { + * console.log('server bound'); + * }); + * ``` + * + * Test this by using `telnet`: + * + * ```bash + * telnet localhost 8124 + * ``` + * + * To listen on the socket `/tmp/echo.sock`: + * + * ```js + * server.listen('/tmp/echo.sock', () => { + * console.log('server bound'); + * }); + * ``` + * + * Use `nc` to connect to a Unix domain socket server: + * + * ```bash + * nc -U /tmp/echo.sock + * ``` + * @since v0.5.0 + * @param connectionListener Automatically set as a listener for the {@link 'connection'} event. + */ + function createServer(connectionListener?: (socket: Socket) => void): Server; + function createServer(options?: ServerOpts, connectionListener?: (socket: Socket) => void): Server; + /** + * Aliases to {@link createConnection}. + * + * Possible signatures: + * + * * {@link connect} + * * {@link connect} for `IPC` connections. + * * {@link connect} for TCP connections. + */ + function connect(options: NetConnectOpts, connectionListener?: () => void): Socket; + function connect(port: number, host?: string, connectionListener?: () => void): Socket; + function connect(path: string, connectionListener?: () => void): Socket; + /** + * A factory function, which creates a new {@link Socket}, + * immediately initiates connection with `socket.connect()`, + * then returns the `net.Socket` that starts the connection. + * + * When the connection is established, a `'connect'` event will be emitted + * on the returned socket. The last parameter `connectListener`, if supplied, + * will be added as a listener for the `'connect'` event **once**. + * + * Possible signatures: + * + * * {@link createConnection} + * * {@link createConnection} for `IPC` connections. + * * {@link createConnection} for TCP connections. + * + * The {@link connect} function is an alias to this function. + */ + function createConnection(options: NetConnectOpts, connectionListener?: () => void): Socket; + function createConnection(port: number, host?: string, connectionListener?: () => void): Socket; + function createConnection(path: string, connectionListener?: () => void): Socket; + /** + * Returns `6` if `input` is an IPv6 address. Returns `4` if `input` is an IPv4 + * address in [dot-decimal notation](https://en.wikipedia.org/wiki/Dot-decimal_notation) with no leading zeroes. Otherwise, returns`0`. + * + * ```js + * net.isIP('::1'); // returns 6 + * net.isIP('127.0.0.1'); // returns 4 + * net.isIP('127.000.000.001'); // returns 0 + * net.isIP('127.0.0.1/24'); // returns 0 + * net.isIP('fhqwhgads'); // returns 0 + * ``` + * @since v0.3.0 + */ + function isIP(input: string): number; + /** + * Returns `true` if `input` is an IPv4 address in [dot-decimal notation](https://en.wikipedia.org/wiki/Dot-decimal_notation) with no + * leading zeroes. Otherwise, returns `false`. + * + * ```js + * net.isIPv4('127.0.0.1'); // returns true + * net.isIPv4('127.000.000.001'); // returns false + * net.isIPv4('127.0.0.1/24'); // returns false + * net.isIPv4('fhqwhgads'); // returns false + * ``` + * @since v0.3.0 + */ + function isIPv4(input: string): boolean; + /** + * Returns `true` if `input` is an IPv6 address. Otherwise, returns `false`. + * + * ```js + * net.isIPv6('::1'); // returns true + * net.isIPv6('fhqwhgads'); // returns false + * ``` + * @since v0.3.0 + */ + function isIPv6(input: string): boolean; + interface SocketAddressInitOptions { + /** + * The network address as either an IPv4 or IPv6 string. + * @default 127.0.0.1 + */ + address?: string | undefined; + /** + * @default `'ipv4'` + */ + family?: IPVersion | undefined; + /** + * An IPv6 flow-label used only if `family` is `'ipv6'`. + * @default 0 + */ + flowlabel?: number | undefined; + /** + * An IP port. + * @default 0 + */ + port?: number | undefined; + } + /** + * @since v15.14.0, v14.18.0 + */ + class SocketAddress { + constructor(options: SocketAddressInitOptions); + /** + * Either \`'ipv4'\` or \`'ipv6'\`. + * @since v15.14.0, v14.18.0 + */ + readonly address: string; + /** + * Either \`'ipv4'\` or \`'ipv6'\`. + * @since v15.14.0, v14.18.0 + */ + readonly family: IPVersion; + /** + * @since v15.14.0, v14.18.0 + */ + readonly port: number; + /** + * @since v15.14.0, v14.18.0 + */ + readonly flowlabel: number; + } +} +declare module 'net' { + export * from 'node:net'; +} diff --git a/node_modules/@types/node/os.d.ts b/node_modules/@types/node/os.d.ts new file mode 100644 index 0000000..f7cb6d9 --- /dev/null +++ b/node_modules/@types/node/os.d.ts @@ -0,0 +1,477 @@ +/** + * The `node:os` module provides operating system-related utility methods and + * properties. It can be accessed using: + * + * ```js + * const os = require('node:os'); + * ``` + * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/os.js) + */ +declare module 'node:os' { + interface CpuInfo { + model: string; + speed: number; + times: { + user: number; + nice: number; + sys: number; + idle: number; + irq: number; + }; + } + interface NetworkInterfaceBase { + address: string; + netmask: string; + mac: string; + internal: boolean; + cidr: string | null; + } + interface NetworkInterfaceInfoIPv4 extends NetworkInterfaceBase { + family: 'IPv4'; + scopeid?: undefined; + } + interface NetworkInterfaceInfoIPv6 extends NetworkInterfaceBase { + family: 'IPv6'; + scopeid: number; + } + interface UserInfo { + username: T; + uid: number; + gid: number; + shell: T; + homedir: T; + } + type NetworkInterfaceInfo = NetworkInterfaceInfoIPv4 | NetworkInterfaceInfoIPv6; + /** + * Returns the host name of the operating system as a string. + * @since v0.3.3 + */ + function hostname(): string; + /** + * Returns an array containing the 1, 5, and 15 minute load averages. + * + * The load average is a measure of system activity calculated by the operating + * system and expressed as a fractional number. + * + * The load average is a Unix-specific concept. On Windows, the return value is + * always `[0, 0, 0]`. + * @since v0.3.3 + */ + function loadavg(): number[]; + /** + * Returns the system uptime in number of seconds. + * @since v0.3.3 + */ + function uptime(): number; + /** + * Returns the amount of free system memory in bytes as an integer. + * @since v0.3.3 + */ + function freemem(): number; + /** + * Returns the total amount of system memory in bytes as an integer. + * @since v0.3.3 + */ + function totalmem(): number; + /** + * Returns an array of objects containing information about each logical CPU core. + * The array will be empty if no CPU information is available, such as if the`/proc` file system is unavailable. + * + * The properties included on each object include: + * + * ```js + * [ + * { + * model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', + * speed: 2926, + * times: { + * user: 252020, + * nice: 0, + * sys: 30340, + * idle: 1070356870, + * irq: 0, + * }, + * }, + * { + * model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', + * speed: 2926, + * times: { + * user: 306960, + * nice: 0, + * sys: 26980, + * idle: 1071569080, + * irq: 0, + * }, + * }, + * { + * model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', + * speed: 2926, + * times: { + * user: 248450, + * nice: 0, + * sys: 21750, + * idle: 1070919370, + * irq: 0, + * }, + * }, + * { + * model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', + * speed: 2926, + * times: { + * user: 256880, + * nice: 0, + * sys: 19430, + * idle: 1070905480, + * irq: 20, + * }, + * }, + * ] + * ``` + * + * `nice` values are POSIX-only. On Windows, the `nice` values of all processors + * are always 0. + * + * `os.cpus().length` should not be used to calculate the amount of parallelism + * available to an application. Use {@link availableParallelism} for this purpose. + * @since v0.3.3 + */ + function cpus(): CpuInfo[]; + /** + * Returns an estimate of the default amount of parallelism a program should use. + * Always returns a value greater than zero. + * + * This function is a small wrapper about libuv's [`uv_available_parallelism()`](https://docs.libuv.org/en/v1.x/misc.html#c.uv_available_parallelism). + * @since v19.4.0, v18.14.0 + */ + function availableParallelism(): number; + /** + * Returns the operating system name as returned by [`uname(3)`](https://linux.die.net/man/3/uname). For example, it + * returns `'Linux'` on Linux, `'Darwin'` on macOS, and `'Windows_NT'` on Windows. + * + * See [https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for additional information + * about the output of running [`uname(3)`](https://linux.die.net/man/3/uname) on various operating systems. + * @since v0.3.3 + */ + function type(): string; + /** + * Returns the operating system as a string. + * + * On POSIX systems, the operating system release is determined by calling [`uname(3)`](https://linux.die.net/man/3/uname). On Windows, `GetVersionExW()` is used. See + * [https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for more information. + * @since v0.3.3 + */ + function release(): string; + /** + * Returns an object containing network interfaces that have been assigned a + * network address. + * + * Each key on the returned object identifies a network interface. The associated + * value is an array of objects that each describe an assigned network address. + * + * The properties available on the assigned network address object include: + * + * ```js + * { + * lo: [ + * { + * address: '127.0.0.1', + * netmask: '255.0.0.0', + * family: 'IPv4', + * mac: '00:00:00:00:00:00', + * internal: true, + * cidr: '127.0.0.1/8' + * }, + * { + * address: '::1', + * netmask: 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff', + * family: 'IPv6', + * mac: '00:00:00:00:00:00', + * scopeid: 0, + * internal: true, + * cidr: '::1/128' + * } + * ], + * eth0: [ + * { + * address: '192.168.1.108', + * netmask: '255.255.255.0', + * family: 'IPv4', + * mac: '01:02:03:0a:0b:0c', + * internal: false, + * cidr: '192.168.1.108/24' + * }, + * { + * address: 'fe80::a00:27ff:fe4e:66a1', + * netmask: 'ffff:ffff:ffff:ffff::', + * family: 'IPv6', + * mac: '01:02:03:0a:0b:0c', + * scopeid: 1, + * internal: false, + * cidr: 'fe80::a00:27ff:fe4e:66a1/64' + * } + * ] + * } + * ``` + * @since v0.6.0 + */ + function networkInterfaces(): NodeJS.Dict; + /** + * Returns the string path of the current user's home directory. + * + * On POSIX, it uses the `$HOME` environment variable if defined. Otherwise it + * uses the [effective UID](https://en.wikipedia.org/wiki/User_identifier#Effective_user_ID) to look up the user's home directory. + * + * On Windows, it uses the `USERPROFILE` environment variable if defined. + * Otherwise it uses the path to the profile directory of the current user. + * @since v2.3.0 + */ + function homedir(): string; + /** + * Returns information about the currently effective user. On POSIX platforms, + * this is typically a subset of the password file. The returned object includes + * the `username`, `uid`, `gid`, `shell`, and `homedir`. On Windows, the `uid` and`gid` fields are `-1`, and `shell` is `null`. + * + * The value of `homedir` returned by `os.userInfo()` is provided by the operating + * system. This differs from the result of `os.homedir()`, which queries + * environment variables for the home directory before falling back to the + * operating system response. + * + * Throws a `SystemError` if a user has no `username` or `homedir`. + * @since v6.0.0 + */ + function userInfo(options: { encoding: 'buffer' }): UserInfo; + function userInfo(options?: { encoding: BufferEncoding }): UserInfo; + type SignalConstants = { + [key in NodeJS.Signals]: number; + }; + namespace constants { + const UV_UDP_REUSEADDR: number; + namespace signals {} + const signals: SignalConstants; + namespace errno { + const E2BIG: number; + const EACCES: number; + const EADDRINUSE: number; + const EADDRNOTAVAIL: number; + const EAFNOSUPPORT: number; + const EAGAIN: number; + const EALREADY: number; + const EBADF: number; + const EBADMSG: number; + const EBUSY: number; + const ECANCELED: number; + const ECHILD: number; + const ECONNABORTED: number; + const ECONNREFUSED: number; + const ECONNRESET: number; + const EDEADLK: number; + const EDESTADDRREQ: number; + const EDOM: number; + const EDQUOT: number; + const EEXIST: number; + const EFAULT: number; + const EFBIG: number; + const EHOSTUNREACH: number; + const EIDRM: number; + const EILSEQ: number; + const EINPROGRESS: number; + const EINTR: number; + const EINVAL: number; + const EIO: number; + const EISCONN: number; + const EISDIR: number; + const ELOOP: number; + const EMFILE: number; + const EMLINK: number; + const EMSGSIZE: number; + const EMULTIHOP: number; + const ENAMETOOLONG: number; + const ENETDOWN: number; + const ENETRESET: number; + const ENETUNREACH: number; + const ENFILE: number; + const ENOBUFS: number; + const ENODATA: number; + const ENODEV: number; + const ENOENT: number; + const ENOEXEC: number; + const ENOLCK: number; + const ENOLINK: number; + const ENOMEM: number; + const ENOMSG: number; + const ENOPROTOOPT: number; + const ENOSPC: number; + const ENOSR: number; + const ENOSTR: number; + const ENOSYS: number; + const ENOTCONN: number; + const ENOTDIR: number; + const ENOTEMPTY: number; + const ENOTSOCK: number; + const ENOTSUP: number; + const ENOTTY: number; + const ENXIO: number; + const EOPNOTSUPP: number; + const EOVERFLOW: number; + const EPERM: number; + const EPIPE: number; + const EPROTO: number; + const EPROTONOSUPPORT: number; + const EPROTOTYPE: number; + const ERANGE: number; + const EROFS: number; + const ESPIPE: number; + const ESRCH: number; + const ESTALE: number; + const ETIME: number; + const ETIMEDOUT: number; + const ETXTBSY: number; + const EWOULDBLOCK: number; + const EXDEV: number; + const WSAEINTR: number; + const WSAEBADF: number; + const WSAEACCES: number; + const WSAEFAULT: number; + const WSAEINVAL: number; + const WSAEMFILE: number; + const WSAEWOULDBLOCK: number; + const WSAEINPROGRESS: number; + const WSAEALREADY: number; + const WSAENOTSOCK: number; + const WSAEDESTADDRREQ: number; + const WSAEMSGSIZE: number; + const WSAEPROTOTYPE: number; + const WSAENOPROTOOPT: number; + const WSAEPROTONOSUPPORT: number; + const WSAESOCKTNOSUPPORT: number; + const WSAEOPNOTSUPP: number; + const WSAEPFNOSUPPORT: number; + const WSAEAFNOSUPPORT: number; + const WSAEADDRINUSE: number; + const WSAEADDRNOTAVAIL: number; + const WSAENETDOWN: number; + const WSAENETUNREACH: number; + const WSAENETRESET: number; + const WSAECONNABORTED: number; + const WSAECONNRESET: number; + const WSAENOBUFS: number; + const WSAEISCONN: number; + const WSAENOTCONN: number; + const WSAESHUTDOWN: number; + const WSAETOOMANYREFS: number; + const WSAETIMEDOUT: number; + const WSAECONNREFUSED: number; + const WSAELOOP: number; + const WSAENAMETOOLONG: number; + const WSAEHOSTDOWN: number; + const WSAEHOSTUNREACH: number; + const WSAENOTEMPTY: number; + const WSAEPROCLIM: number; + const WSAEUSERS: number; + const WSAEDQUOT: number; + const WSAESTALE: number; + const WSAEREMOTE: number; + const WSASYSNOTREADY: number; + const WSAVERNOTSUPPORTED: number; + const WSANOTINITIALISED: number; + const WSAEDISCON: number; + const WSAENOMORE: number; + const WSAECANCELLED: number; + const WSAEINVALIDPROCTABLE: number; + const WSAEINVALIDPROVIDER: number; + const WSAEPROVIDERFAILEDINIT: number; + const WSASYSCALLFAILURE: number; + const WSASERVICE_NOT_FOUND: number; + const WSATYPE_NOT_FOUND: number; + const WSA_E_NO_MORE: number; + const WSA_E_CANCELLED: number; + const WSAEREFUSED: number; + } + namespace priority { + const PRIORITY_LOW: number; + const PRIORITY_BELOW_NORMAL: number; + const PRIORITY_NORMAL: number; + const PRIORITY_ABOVE_NORMAL: number; + const PRIORITY_HIGH: number; + const PRIORITY_HIGHEST: number; + } + } + const devNull: string; + const EOL: string; + /** + * Returns the operating system CPU architecture for which the Node.js binary was + * compiled. Possible values are `'arm'`, `'arm64'`, `'ia32'`, `'mips'`,`'mipsel'`, `'ppc'`, `'ppc64'`, `'s390'`, `'s390x'`, and `'x64'`. + * + * The return value is equivalent to `process.arch`. + * @since v0.5.0 + */ + function arch(): string; + /** + * Returns a string identifying the kernel version. + * + * On POSIX systems, the operating system release is determined by calling [`uname(3)`](https://linux.die.net/man/3/uname). On Windows, `RtlGetVersion()` is used, and if it is not + * available, `GetVersionExW()` will be used. See [https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for more information. + * @since v13.11.0, v12.17.0 + */ + function version(): string; + /** + * Returns a string identifying the operating system platform for which + * the Node.js binary was compiled. The value is set at compile time. + * Possible values are `'aix'`, `'darwin'`, `'freebsd'`,`'linux'`,`'openbsd'`, `'sunos'`, and `'win32'`. + * + * The return value is equivalent to `process.platform`. + * + * The value `'android'` may also be returned if Node.js is built on the Android + * operating system. [Android support is experimental](https://github.com/nodejs/node/blob/HEAD/BUILDING.md#androidandroid-based-devices-eg-firefox-os). + * @since v0.5.0 + */ + function platform(): NodeJS.Platform; + /** + * Returns the machine type as a string, such as `arm`, `arm64`, `aarch64`,`mips`, `mips64`, `ppc64`, `ppc64le`, `s390`, `s390x`, `i386`, `i686`, `x86_64`. + * + * On POSIX systems, the machine type is determined by calling [`uname(3)`](https://linux.die.net/man/3/uname). On Windows, `RtlGetVersion()` is used, and if it is not + * available, `GetVersionExW()` will be used. See [https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for more information. + * @since v18.9.0, v16.18.0 + */ + function machine(): string; + /** + * Returns the operating system's default directory for temporary files as a + * string. + * @since v0.9.9 + */ + function tmpdir(): string; + /** + * Returns a string identifying the endianness of the CPU for which the Node.js + * binary was compiled. + * + * Possible values are `'BE'` for big endian and `'LE'` for little endian. + * @since v0.9.4 + */ + function endianness(): 'BE' | 'LE'; + /** + * Returns the scheduling priority for the process specified by `pid`. If `pid` is + * not provided or is `0`, the priority of the current process is returned. + * @since v10.10.0 + * @param [pid=0] The process ID to retrieve scheduling priority for. + */ + function getPriority(pid?: number): number; + /** + * Attempts to set the scheduling priority for the process specified by `pid`. If`pid` is not provided or is `0`, the process ID of the current process is used. + * + * The `priority` input must be an integer between `-20` (high priority) and `19`(low priority). Due to differences between Unix priority levels and Windows + * priority classes, `priority` is mapped to one of six priority constants in`os.constants.priority`. When retrieving a process priority level, this range + * mapping may cause the return value to be slightly different on Windows. To avoid + * confusion, set `priority` to one of the priority constants. + * + * On Windows, setting priority to `PRIORITY_HIGHEST` requires elevated user + * privileges. Otherwise the set priority will be silently reduced to`PRIORITY_HIGH`. + * @since v10.10.0 + * @param [pid=0] The process ID to set scheduling priority for. + * @param priority The scheduling priority to assign to the process. + */ + function setPriority(priority: number): void; + function setPriority(pid: number, priority: number): void; +} +declare module 'os' { + export * from 'node:os'; +} diff --git a/node_modules/@types/node/package.json b/node_modules/@types/node/package.json new file mode 100644 index 0000000..9dd3d99 --- /dev/null +++ b/node_modules/@types/node/package.json @@ -0,0 +1,232 @@ +{ + "name": "@types/node", + "version": "20.6.2", + "description": "TypeScript definitions for Node.js", + "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node", + "license": "MIT", + "contributors": [ + { + "name": "Microsoft TypeScript", + "url": "https://github.com/Microsoft", + "githubUsername": "Microsoft" + }, + { + "name": "DefinitelyTyped", + "url": "https://github.com/DefinitelyTyped", + "githubUsername": "DefinitelyTyped" + }, + { + "name": "Alberto Schiabel", + "url": "https://github.com/jkomyno", + "githubUsername": "jkomyno" + }, + { + "name": "Alvis HT Tang", + "url": "https://github.com/alvis", + "githubUsername": "alvis" + }, + { + "name": "Andrew Makarov", + "url": "https://github.com/r3nya", + "githubUsername": "r3nya" + }, + { + "name": "Benjamin Toueg", + "url": "https://github.com/btoueg", + "githubUsername": "btoueg" + }, + { + "name": "Chigozirim C.", + "url": "https://github.com/smac89", + "githubUsername": "smac89" + }, + { + "name": "David Junger", + "url": "https://github.com/touffy", + "githubUsername": "touffy" + }, + { + "name": "Deividas Bakanas", + "url": "https://github.com/DeividasBakanas", + "githubUsername": "DeividasBakanas" + }, + { + "name": "Eugene Y. Q. Shen", + "url": "https://github.com/eyqs", + "githubUsername": "eyqs" + }, + { + "name": "Hannes Magnusson", + "url": "https://github.com/Hannes-Magnusson-CK", + "githubUsername": "Hannes-Magnusson-CK" + }, + { + "name": "Huw", + "url": "https://github.com/hoo29", + "githubUsername": "hoo29" + }, + { + "name": "Kelvin Jin", + "url": "https://github.com/kjin", + "githubUsername": "kjin" + }, + { + "name": "Klaus Meinhardt", + "url": "https://github.com/ajafff", + "githubUsername": "ajafff" + }, + { + "name": "Lishude", + "url": "https://github.com/islishude", + "githubUsername": "islishude" + }, + { + "name": "Mariusz Wiktorczyk", + "url": "https://github.com/mwiktorczyk", + "githubUsername": "mwiktorczyk" + }, + { + "name": "Mohsen Azimi", + "url": "https://github.com/mohsen1", + "githubUsername": "mohsen1" + }, + { + "name": "Nicolas Even", + "url": "https://github.com/n-e", + "githubUsername": "n-e" + }, + { + "name": "Nikita Galkin", + "url": "https://github.com/galkin", + "githubUsername": "galkin" + }, + { + "name": "Parambir Singh", + "url": "https://github.com/parambirs", + "githubUsername": "parambirs" + }, + { + "name": "Sebastian Silbermann", + "url": "https://github.com/eps1lon", + "githubUsername": "eps1lon" + }, + { + "name": "Thomas den Hollander", + "url": "https://github.com/ThomasdenH", + "githubUsername": "ThomasdenH" + }, + { + "name": "Wilco Bakker", + "url": "https://github.com/WilcoBakker", + "githubUsername": "WilcoBakker" + }, + { + "name": "wwwy3y3", + "url": "https://github.com/wwwy3y3", + "githubUsername": "wwwy3y3" + }, + { + "name": "Samuel Ainsworth", + "url": "https://github.com/samuela", + "githubUsername": "samuela" + }, + { + "name": "Kyle Uehlein", + "url": "https://github.com/kuehlein", + "githubUsername": "kuehlein" + }, + { + "name": "Thanik Bhongbhibhat", + "url": "https://github.com/bhongy", + "githubUsername": "bhongy" + }, + { + "name": "Marcin Kopacz", + "url": "https://github.com/chyzwar", + "githubUsername": "chyzwar" + }, + { + "name": "Trivikram Kamat", + "url": "https://github.com/trivikr", + "githubUsername": "trivikr" + }, + { + "name": "Junxiao Shi", + "url": "https://github.com/yoursunny", + "githubUsername": "yoursunny" + }, + { + "name": "Ilia Baryshnikov", + "url": "https://github.com/qwelias", + "githubUsername": "qwelias" + }, + { + "name": "ExE Boss", + "url": "https://github.com/ExE-Boss", + "githubUsername": "ExE-Boss" + }, + { + "name": "Piotr Błażejewicz", + "url": "https://github.com/peterblazejewicz", + "githubUsername": "peterblazejewicz" + }, + { + "name": "Anna Henningsen", + "url": "https://github.com/addaleax", + "githubUsername": "addaleax" + }, + { + "name": "Victor Perin", + "url": "https://github.com/victorperin", + "githubUsername": "victorperin" + }, + { + "name": "Yongsheng Zhang", + "url": "https://github.com/ZYSzys", + "githubUsername": "ZYSzys" + }, + { + "name": "NodeJS Contributors", + "url": "https://github.com/NodeJS", + "githubUsername": "NodeJS" + }, + { + "name": "Linus Unnebäck", + "url": "https://github.com/LinusU", + "githubUsername": "LinusU" + }, + { + "name": "wafuwafu13", + "url": "https://github.com/wafuwafu13", + "githubUsername": "wafuwafu13" + }, + { + "name": "Matteo Collina", + "url": "https://github.com/mcollina", + "githubUsername": "mcollina" + }, + { + "name": "Dmitry Semigradsky", + "url": "https://github.com/Semigradsky", + "githubUsername": "Semigradsky" + } + ], + "main": "", + "types": "index.d.ts", + "typesVersions": { + "<=4.8": { + "*": [ + "ts4.8/*" + ] + } + }, + "repository": { + "type": "git", + "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", + "directory": "types/node" + }, + "scripts": {}, + "dependencies": {}, + "typesPublisherContentHash": "666d6ac9c6061bdb566c308767b3da161cec6ddb4cee15a88eaa8419321130a9", + "typeScriptVersion": "4.5" +} \ No newline at end of file diff --git a/node_modules/@types/node/path.d.ts b/node_modules/@types/node/path.d.ts new file mode 100644 index 0000000..4f18011 --- /dev/null +++ b/node_modules/@types/node/path.d.ts @@ -0,0 +1,191 @@ +declare module 'path/posix' { + import path = require('node:path'); + export = path; +} +declare module 'path/win32' { + import path = require('node:path'); + export = path; +} +/** + * The `node:path` module provides utilities for working with file and directory + * paths. It can be accessed using: + * + * ```js + * const path = require('node:path'); + * ``` + * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/path.js) + */ +declare module 'node:path' { + namespace path { + /** + * A parsed path object generated by path.parse() or consumed by path.format(). + */ + interface ParsedPath { + /** + * The root of the path such as '/' or 'c:\' + */ + root: string; + /** + * The full directory path such as '/home/user/dir' or 'c:\path\dir' + */ + dir: string; + /** + * The file name including extension (if any) such as 'index.html' + */ + base: string; + /** + * The file extension (if any) such as '.html' + */ + ext: string; + /** + * The file name without extension (if any) such as 'index' + */ + name: string; + } + interface FormatInputPathObject { + /** + * The root of the path such as '/' or 'c:\' + */ + root?: string | undefined; + /** + * The full directory path such as '/home/user/dir' or 'c:\path\dir' + */ + dir?: string | undefined; + /** + * The file name including extension (if any) such as 'index.html' + */ + base?: string | undefined; + /** + * The file extension (if any) such as '.html' + */ + ext?: string | undefined; + /** + * The file name without extension (if any) such as 'index' + */ + name?: string | undefined; + } + interface PlatformPath { + /** + * Normalize a string path, reducing '..' and '.' parts. + * When multiple slashes are found, they're replaced by a single one; when the path contains a trailing slash, it is preserved. On Windows backslashes are used. + * + * @param path string path to normalize. + * @throws {TypeError} if `path` is not a string. + */ + normalize(path: string): string; + /** + * Join all arguments together and normalize the resulting path. + * + * @param paths paths to join. + * @throws {TypeError} if any of the path segments is not a string. + */ + join(...paths: string[]): string; + /** + * The right-most parameter is considered {to}. Other parameters are considered an array of {from}. + * + * Starting from leftmost {from} parameter, resolves {to} to an absolute path. + * + * If {to} isn't already absolute, {from} arguments are prepended in right to left order, + * until an absolute path is found. If after using all {from} paths still no absolute path is found, + * the current working directory is used as well. The resulting path is normalized, + * and trailing slashes are removed unless the path gets resolved to the root directory. + * + * @param paths A sequence of paths or path segments. + * @throws {TypeError} if any of the arguments is not a string. + */ + resolve(...paths: string[]): string; + /** + * Determines whether {path} is an absolute path. An absolute path will always resolve to the same location, regardless of the working directory. + * + * If the given {path} is a zero-length string, `false` will be returned. + * + * @param path path to test. + * @throws {TypeError} if `path` is not a string. + */ + isAbsolute(path: string): boolean; + /** + * Solve the relative path from {from} to {to} based on the current working directory. + * At times we have two absolute paths, and we need to derive the relative path from one to the other. This is actually the reverse transform of path.resolve. + * + * @throws {TypeError} if either `from` or `to` is not a string. + */ + relative(from: string, to: string): string; + /** + * Return the directory name of a path. Similar to the Unix dirname command. + * + * @param path the path to evaluate. + * @throws {TypeError} if `path` is not a string. + */ + dirname(path: string): string; + /** + * Return the last portion of a path. Similar to the Unix basename command. + * Often used to extract the file name from a fully qualified path. + * + * @param path the path to evaluate. + * @param suffix optionally, an extension to remove from the result. + * @throws {TypeError} if `path` is not a string or if `ext` is given and is not a string. + */ + basename(path: string, suffix?: string): string; + /** + * Return the extension of the path, from the last '.' to end of string in the last portion of the path. + * If there is no '.' in the last portion of the path or the first character of it is '.', then it returns an empty string. + * + * @param path the path to evaluate. + * @throws {TypeError} if `path` is not a string. + */ + extname(path: string): string; + /** + * The platform-specific file separator. '\\' or '/'. + */ + readonly sep: '\\' | '/'; + /** + * The platform-specific file delimiter. ';' or ':'. + */ + readonly delimiter: ';' | ':'; + /** + * Returns an object from a path string - the opposite of format(). + * + * @param path path to evaluate. + * @throws {TypeError} if `path` is not a string. + */ + parse(path: string): ParsedPath; + /** + * Returns a path string from an object - the opposite of parse(). + * + * @param pathObject path to evaluate. + */ + format(pathObject: FormatInputPathObject): string; + /** + * On Windows systems only, returns an equivalent namespace-prefixed path for the given path. + * If path is not a string, path will be returned without modifications. + * This method is meaningful only on Windows system. + * On POSIX systems, the method is non-operational and always returns path without modifications. + */ + toNamespacedPath(path: string): string; + /** + * Posix specific pathing. + * Same as parent object on posix. + */ + readonly posix: PlatformPath; + /** + * Windows specific pathing. + * Same as parent object on windows + */ + readonly win32: PlatformPath; + } + } + const path: path.PlatformPath; + export = path; +} +declare module 'path' { + import path = require('node:path'); + export = path; +} +declare module 'node:path/posix' { + import path = require('path/posix'); + export = path; +} +declare module 'node:path/win32' { + import path = require('path/win32'); + export = path; +} diff --git a/node_modules/@types/node/perf_hooks.d.ts b/node_modules/@types/node/perf_hooks.d.ts new file mode 100644 index 0000000..c6e547b --- /dev/null +++ b/node_modules/@types/node/perf_hooks.d.ts @@ -0,0 +1,638 @@ +/** + * This module provides an implementation of a subset of the W3C [Web Performance APIs](https://w3c.github.io/perf-timing-primer/) as well as additional APIs for + * Node.js-specific performance measurements. + * + * Node.js supports the following [Web Performance APIs](https://w3c.github.io/perf-timing-primer/): + * + * * [High Resolution Time](https://www.w3.org/TR/hr-time-2) + * * [Performance Timeline](https://w3c.github.io/performance-timeline/) + * * [User Timing](https://www.w3.org/TR/user-timing/) + * * [Resource Timing](https://www.w3.org/TR/resource-timing-2/) + * + * ```js + * const { PerformanceObserver, performance } = require('node:perf_hooks'); + * + * const obs = new PerformanceObserver((items) => { + * console.log(items.getEntries()[0].duration); + * performance.clearMarks(); + * }); + * obs.observe({ type: 'measure' }); + * performance.measure('Start to Now'); + * + * performance.mark('A'); + * doSomeLongRunningProcess(() => { + * performance.measure('A to Now', 'A'); + * + * performance.mark('B'); + * performance.measure('A to B', 'A', 'B'); + * }); + * ``` + * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/perf_hooks.js) + */ +declare module 'node:perf_hooks' { + import { AsyncResource } from 'node:async_hooks'; + type EntryType = 'node' | 'mark' | 'measure' | 'gc' | 'function' | 'http2' | 'http' | 'dns'; + interface NodeGCPerformanceDetail { + /** + * When `performanceEntry.entryType` is equal to 'gc', `the performance.kind` property identifies + * the type of garbage collection operation that occurred. + * See perf_hooks.constants for valid values. + */ + readonly kind?: number | undefined; + /** + * When `performanceEntry.entryType` is equal to 'gc', the `performance.flags` + * property contains additional information about garbage collection operation. + * See perf_hooks.constants for valid values. + */ + readonly flags?: number | undefined; + } + /** + * The constructor of this class is not exposed to users directly. + * @since v8.5.0 + */ + class PerformanceEntry { + protected constructor(); + /** + * The total number of milliseconds elapsed for this entry. This value will not + * be meaningful for all Performance Entry types. + * @since v8.5.0 + */ + readonly duration: number; + /** + * The name of the performance entry. + * @since v8.5.0 + */ + readonly name: string; + /** + * The high resolution millisecond timestamp marking the starting time of the + * Performance Entry. + * @since v8.5.0 + */ + readonly startTime: number; + /** + * The type of the performance entry. It may be one of: + * + * * `'node'` (Node.js only) + * * `'mark'` (available on the Web) + * * `'measure'` (available on the Web) + * * `'gc'` (Node.js only) + * * `'function'` (Node.js only) + * * `'http2'` (Node.js only) + * * `'http'` (Node.js only) + * @since v8.5.0 + */ + readonly entryType: EntryType; + /** + * Additional detail specific to the `entryType`. + * @since v16.0.0 + */ + readonly detail?: NodeGCPerformanceDetail | unknown | undefined; // TODO: Narrow this based on entry type. + toJSON(): any; + } + /** + * Exposes marks created via the `Performance.mark()` method. + * @since v18.2.0, v16.17.0 + */ + class PerformanceMark extends PerformanceEntry { + readonly duration: 0; + readonly entryType: 'mark'; + } + /** + * Exposes measures created via the `Performance.measure()` method. + * + * The constructor of this class is not exposed to users directly. + * @since v18.2.0, v16.17.0 + */ + class PerformanceMeasure extends PerformanceEntry { + readonly entryType: 'measure'; + } + /** + * _This property is an extension by Node.js. It is not available in Web browsers._ + * + * Provides timing details for Node.js itself. The constructor of this class + * is not exposed to users. + * @since v8.5.0 + */ + class PerformanceNodeTiming extends PerformanceEntry { + /** + * The high resolution millisecond timestamp at which the Node.js process + * completed bootstrapping. If bootstrapping has not yet finished, the property + * has the value of -1. + * @since v8.5.0 + */ + readonly bootstrapComplete: number; + /** + * The high resolution millisecond timestamp at which the Node.js environment was + * initialized. + * @since v8.5.0 + */ + readonly environment: number; + /** + * The high resolution millisecond timestamp of the amount of time the event loop + * has been idle within the event loop's event provider (e.g. `epoll_wait`). This + * does not take CPU usage into consideration. If the event loop has not yet + * started (e.g., in the first tick of the main script), the property has the + * value of 0. + * @since v14.10.0, v12.19.0 + */ + readonly idleTime: number; + /** + * The high resolution millisecond timestamp at which the Node.js event loop + * exited. If the event loop has not yet exited, the property has the value of -1\. + * It can only have a value of not -1 in a handler of the `'exit'` event. + * @since v8.5.0 + */ + readonly loopExit: number; + /** + * The high resolution millisecond timestamp at which the Node.js event loop + * started. If the event loop has not yet started (e.g., in the first tick of the + * main script), the property has the value of -1. + * @since v8.5.0 + */ + readonly loopStart: number; + /** + * The high resolution millisecond timestamp at which the V8 platform was + * initialized. + * @since v8.5.0 + */ + readonly v8Start: number; + } + interface EventLoopUtilization { + idle: number; + active: number; + utilization: number; + } + /** + * @param util1 The result of a previous call to eventLoopUtilization() + * @param util2 The result of a previous call to eventLoopUtilization() prior to util1 + */ + type EventLoopUtilityFunction = (util1?: EventLoopUtilization, util2?: EventLoopUtilization) => EventLoopUtilization; + interface MarkOptions { + /** + * Additional optional detail to include with the mark. + */ + detail?: unknown | undefined; + /** + * An optional timestamp to be used as the mark time. + * @default `performance.now()`. + */ + startTime?: number | undefined; + } + interface MeasureOptions { + /** + * Additional optional detail to include with the mark. + */ + detail?: unknown | undefined; + /** + * Duration between start and end times. + */ + duration?: number | undefined; + /** + * Timestamp to be used as the end time, or a string identifying a previously recorded mark. + */ + end?: number | string | undefined; + /** + * Timestamp to be used as the start time, or a string identifying a previously recorded mark. + */ + start?: number | string | undefined; + } + interface TimerifyOptions { + /** + * A histogram object created using + * `perf_hooks.createHistogram()` that will record runtime durations in + * nanoseconds. + */ + histogram?: RecordableHistogram | undefined; + } + interface Performance { + /** + * If name is not provided, removes all PerformanceMark objects from the Performance Timeline. + * If name is provided, removes only the named mark. + * @param name + */ + clearMarks(name?: string): void; + /** + * If name is not provided, removes all PerformanceMeasure objects from the Performance Timeline. + * If name is provided, removes only the named measure. + * @param name + * @since v16.7.0 + */ + clearMeasures(name?: string): void; + /** + * Returns a list of `PerformanceEntry` objects in chronological order with respect to `performanceEntry.startTime`. + * If you are only interested in performance entries of certain types or that have certain names, see + * `performance.getEntriesByType()` and `performance.getEntriesByName()`. + * @since v16.7.0 + */ + getEntries(): PerformanceEntry[]; + /** + * Returns a list of `PerformanceEntry` objects in chronological order with respect to `performanceEntry.startTime` + * whose `performanceEntry.name` is equal to `name`, and optionally, whose `performanceEntry.entryType` is equal to `type`. + * @param name + * @param type + * @since v16.7.0 + */ + getEntriesByName(name: string, type?: EntryType): PerformanceEntry[]; + /** + * Returns a list of `PerformanceEntry` objects in chronological order with respect to `performanceEntry.startTime` + * whose `performanceEntry.entryType` is equal to `type`. + * @param type + * @since v16.7.0 + */ + getEntriesByType(type: EntryType): PerformanceEntry[]; + /** + * Creates a new PerformanceMark entry in the Performance Timeline. + * A PerformanceMark is a subclass of PerformanceEntry whose performanceEntry.entryType is always 'mark', + * and whose performanceEntry.duration is always 0. + * Performance marks are used to mark specific significant moments in the Performance Timeline. + * @param name + * @return The PerformanceMark entry that was created + */ + mark(name?: string, options?: MarkOptions): PerformanceMark; + /** + * Creates a new PerformanceMeasure entry in the Performance Timeline. + * A PerformanceMeasure is a subclass of PerformanceEntry whose performanceEntry.entryType is always 'measure', + * and whose performanceEntry.duration measures the number of milliseconds elapsed since startMark and endMark. + * + * The startMark argument may identify any existing PerformanceMark in the the Performance Timeline, or may identify + * any of the timestamp properties provided by the PerformanceNodeTiming class. If the named startMark does not exist, + * then startMark is set to timeOrigin by default. + * + * The endMark argument must identify any existing PerformanceMark in the the Performance Timeline or any of the timestamp + * properties provided by the PerformanceNodeTiming class. If the named endMark does not exist, an error will be thrown. + * @param name + * @param startMark + * @param endMark + * @return The PerformanceMeasure entry that was created + */ + measure(name: string, startMark?: string, endMark?: string): PerformanceMeasure; + measure(name: string, options: MeasureOptions): PerformanceMeasure; + /** + * An instance of the PerformanceNodeTiming class that provides performance metrics for specific Node.js operational milestones. + */ + readonly nodeTiming: PerformanceNodeTiming; + /** + * @return the current high resolution millisecond timestamp + */ + now(): number; + /** + * The timeOrigin specifies the high resolution millisecond timestamp from which all performance metric durations are measured. + */ + readonly timeOrigin: number; + /** + * Wraps a function within a new function that measures the running time of the wrapped function. + * A PerformanceObserver must be subscribed to the 'function' event type in order for the timing details to be accessed. + * @param fn + */ + timerify any>(fn: T, options?: TimerifyOptions): T; + /** + * eventLoopUtilization is similar to CPU utilization except that it is calculated using high precision wall-clock time. + * It represents the percentage of time the event loop has spent outside the event loop's event provider (e.g. epoll_wait). + * No other CPU idle time is taken into consideration. + */ + eventLoopUtilization: EventLoopUtilityFunction; + } + interface PerformanceObserverEntryList { + /** + * Returns a list of `PerformanceEntry` objects in chronological order + * with respect to `performanceEntry.startTime`. + * + * ```js + * const { + * performance, + * PerformanceObserver, + * } = require('node:perf_hooks'); + * + * const obs = new PerformanceObserver((perfObserverList, observer) => { + * console.log(perfObserverList.getEntries()); + * + * * [ + * * PerformanceEntry { + * * name: 'test', + * * entryType: 'mark', + * * startTime: 81.465639, + * * duration: 0 + * * }, + * * PerformanceEntry { + * * name: 'meow', + * * entryType: 'mark', + * * startTime: 81.860064, + * * duration: 0 + * * } + * * ] + * + * + * performance.clearMarks(); + * performance.clearMeasures(); + * observer.disconnect(); + * }); + * obs.observe({ type: 'mark' }); + * + * performance.mark('test'); + * performance.mark('meow'); + * ``` + * @since v8.5.0 + */ + getEntries(): PerformanceEntry[]; + /** + * Returns a list of `PerformanceEntry` objects in chronological order + * with respect to `performanceEntry.startTime` whose `performanceEntry.name` is + * equal to `name`, and optionally, whose `performanceEntry.entryType` is equal to`type`. + * + * ```js + * const { + * performance, + * PerformanceObserver, + * } = require('node:perf_hooks'); + * + * const obs = new PerformanceObserver((perfObserverList, observer) => { + * console.log(perfObserverList.getEntriesByName('meow')); + * + * * [ + * * PerformanceEntry { + * * name: 'meow', + * * entryType: 'mark', + * * startTime: 98.545991, + * * duration: 0 + * * } + * * ] + * + * console.log(perfObserverList.getEntriesByName('nope')); // [] + * + * console.log(perfObserverList.getEntriesByName('test', 'mark')); + * + * * [ + * * PerformanceEntry { + * * name: 'test', + * * entryType: 'mark', + * * startTime: 63.518931, + * * duration: 0 + * * } + * * ] + * + * console.log(perfObserverList.getEntriesByName('test', 'measure')); // [] + * + * performance.clearMarks(); + * performance.clearMeasures(); + * observer.disconnect(); + * }); + * obs.observe({ entryTypes: ['mark', 'measure'] }); + * + * performance.mark('test'); + * performance.mark('meow'); + * ``` + * @since v8.5.0 + */ + getEntriesByName(name: string, type?: EntryType): PerformanceEntry[]; + /** + * Returns a list of `PerformanceEntry` objects in chronological order + * with respect to `performanceEntry.startTime` whose `performanceEntry.entryType`is equal to `type`. + * + * ```js + * const { + * performance, + * PerformanceObserver, + * } = require('node:perf_hooks'); + * + * const obs = new PerformanceObserver((perfObserverList, observer) => { + * console.log(perfObserverList.getEntriesByType('mark')); + * + * * [ + * * PerformanceEntry { + * * name: 'test', + * * entryType: 'mark', + * * startTime: 55.897834, + * * duration: 0 + * * }, + * * PerformanceEntry { + * * name: 'meow', + * * entryType: 'mark', + * * startTime: 56.350146, + * * duration: 0 + * * } + * * ] + * + * performance.clearMarks(); + * performance.clearMeasures(); + * observer.disconnect(); + * }); + * obs.observe({ type: 'mark' }); + * + * performance.mark('test'); + * performance.mark('meow'); + * ``` + * @since v8.5.0 + */ + getEntriesByType(type: EntryType): PerformanceEntry[]; + } + type PerformanceObserverCallback = (list: PerformanceObserverEntryList, observer: PerformanceObserver) => void; + /** + * @since v8.5.0 + */ + class PerformanceObserver extends AsyncResource { + constructor(callback: PerformanceObserverCallback); + /** + * Disconnects the `PerformanceObserver` instance from all notifications. + * @since v8.5.0 + */ + disconnect(): void; + /** + * Subscribes the `PerformanceObserver` instance to notifications of new `PerformanceEntry` instances identified either by `options.entryTypes`or `options.type`: + * + * ```js + * const { + * performance, + * PerformanceObserver, + * } = require('node:perf_hooks'); + * + * const obs = new PerformanceObserver((list, observer) => { + * // Called once asynchronously. `list` contains three items. + * }); + * obs.observe({ type: 'mark' }); + * + * for (let n = 0; n < 3; n++) + * performance.mark(`test${n}`); + * ``` + * @since v8.5.0 + */ + observe( + options: + | { + entryTypes: ReadonlyArray; + buffered?: boolean | undefined; + } + | { + type: EntryType; + buffered?: boolean | undefined; + } + ): void; + } + namespace constants { + const NODE_PERFORMANCE_GC_MAJOR: number; + const NODE_PERFORMANCE_GC_MINOR: number; + const NODE_PERFORMANCE_GC_INCREMENTAL: number; + const NODE_PERFORMANCE_GC_WEAKCB: number; + const NODE_PERFORMANCE_GC_FLAGS_NO: number; + const NODE_PERFORMANCE_GC_FLAGS_CONSTRUCT_RETAINED: number; + const NODE_PERFORMANCE_GC_FLAGS_FORCED: number; + const NODE_PERFORMANCE_GC_FLAGS_SYNCHRONOUS_PHANTOM_PROCESSING: number; + const NODE_PERFORMANCE_GC_FLAGS_ALL_AVAILABLE_GARBAGE: number; + const NODE_PERFORMANCE_GC_FLAGS_ALL_EXTERNAL_MEMORY: number; + const NODE_PERFORMANCE_GC_FLAGS_SCHEDULE_IDLE: number; + } + const performance: Performance; + interface EventLoopMonitorOptions { + /** + * The sampling rate in milliseconds. + * Must be greater than zero. + * @default 10 + */ + resolution?: number | undefined; + } + interface Histogram { + /** + * Returns a `Map` object detailing the accumulated percentile distribution. + * @since v11.10.0 + */ + readonly percentiles: Map; + /** + * The number of times the event loop delay exceeded the maximum 1 hour event + * loop delay threshold. + * @since v11.10.0 + */ + readonly exceeds: number; + /** + * The minimum recorded event loop delay. + * @since v11.10.0 + */ + readonly min: number; + /** + * The maximum recorded event loop delay. + * @since v11.10.0 + */ + readonly max: number; + /** + * The mean of the recorded event loop delays. + * @since v11.10.0 + */ + readonly mean: number; + /** + * The standard deviation of the recorded event loop delays. + * @since v11.10.0 + */ + readonly stddev: number; + /** + * Resets the collected histogram data. + * @since v11.10.0 + */ + reset(): void; + /** + * Returns the value at the given percentile. + * @since v11.10.0 + * @param percentile A percentile value in the range (0, 100]. + */ + percentile(percentile: number): number; + } + interface IntervalHistogram extends Histogram { + /** + * Enables the update interval timer. Returns `true` if the timer was + * started, `false` if it was already started. + * @since v11.10.0 + */ + enable(): boolean; + /** + * Disables the update interval timer. Returns `true` if the timer was + * stopped, `false` if it was already stopped. + * @since v11.10.0 + */ + disable(): boolean; + } + interface RecordableHistogram extends Histogram { + /** + * @since v15.9.0, v14.18.0 + * @param val The amount to record in the histogram. + */ + record(val: number | bigint): void; + /** + * Calculates the amount of time (in nanoseconds) that has passed since the + * previous call to `recordDelta()` and records that amount in the histogram. + * + * ## Examples + * @since v15.9.0, v14.18.0 + */ + recordDelta(): void; + /** + * Adds the values from `other` to this histogram. + * @since v17.4.0, v16.14.0 + */ + add(other: RecordableHistogram): void; + } + /** + * _This property is an extension by Node.js. It is not available in Web browsers._ + * + * Creates an `IntervalHistogram` object that samples and reports the event loop + * delay over time. The delays will be reported in nanoseconds. + * + * Using a timer to detect approximate event loop delay works because the + * execution of timers is tied specifically to the lifecycle of the libuv + * event loop. That is, a delay in the loop will cause a delay in the execution + * of the timer, and those delays are specifically what this API is intended to + * detect. + * + * ```js + * const { monitorEventLoopDelay } = require('node:perf_hooks'); + * const h = monitorEventLoopDelay({ resolution: 20 }); + * h.enable(); + * // Do something. + * h.disable(); + * console.log(h.min); + * console.log(h.max); + * console.log(h.mean); + * console.log(h.stddev); + * console.log(h.percentiles); + * console.log(h.percentile(50)); + * console.log(h.percentile(99)); + * ``` + * @since v11.10.0 + */ + function monitorEventLoopDelay(options?: EventLoopMonitorOptions): IntervalHistogram; + interface CreateHistogramOptions { + /** + * The minimum recordable value. Must be an integer value greater than 0. + * @default 1 + */ + min?: number | bigint | undefined; + /** + * The maximum recordable value. Must be an integer value greater than min. + * @default Number.MAX_SAFE_INTEGER + */ + max?: number | bigint | undefined; + /** + * The number of accuracy digits. Must be a number between 1 and 5. + * @default 3 + */ + figures?: number | undefined; + } + /** + * Returns a `RecordableHistogram`. + * @since v15.9.0, v14.18.0 + */ + function createHistogram(options?: CreateHistogramOptions): RecordableHistogram; + import { performance as _performance } from 'perf_hooks'; + global { + /** + * `performance` is a global reference for `require('perf_hooks').performance` + * https://nodejs.org/api/globals.html#performance + * @since v16.0.0 + */ + var performance: typeof globalThis extends { + onmessage: any; + performance: infer T; + } + ? T + : typeof _performance; + } +} +declare module 'perf_hooks' { + export * from 'node:perf_hooks'; +} diff --git a/node_modules/@types/node/process.d.ts b/node_modules/@types/node/process.d.ts new file mode 100644 index 0000000..58dd189 --- /dev/null +++ b/node_modules/@types/node/process.d.ts @@ -0,0 +1,1495 @@ +declare module 'node:process' { + import * as tty from 'node:tty'; + import { Worker } from 'node:worker_threads'; + global { + var process: NodeJS.Process; + namespace NodeJS { + // this namespace merge is here because these are specifically used + // as the type for process.stdin, process.stdout, and process.stderr. + // they can't live in tty.d.ts because we need to disambiguate the imported name. + interface ReadStream extends tty.ReadStream {} + interface WriteStream extends tty.WriteStream {} + interface MemoryUsageFn { + /** + * The `process.memoryUsage()` method iterate over each page to gather informations about memory + * usage which can be slow depending on the program memory allocations. + */ + (): MemoryUsage; + /** + * method returns an integer representing the Resident Set Size (RSS) in bytes. + */ + rss(): number; + } + interface MemoryUsage { + rss: number; + heapTotal: number; + heapUsed: number; + external: number; + arrayBuffers: number; + } + interface CpuUsage { + user: number; + system: number; + } + interface ProcessRelease { + name: string; + sourceUrl?: string | undefined; + headersUrl?: string | undefined; + libUrl?: string | undefined; + lts?: string | undefined; + } + interface ProcessVersions extends Dict { + http_parser: string; + node: string; + v8: string; + ares: string; + uv: string; + zlib: string; + modules: string; + openssl: string; + } + type Platform = 'aix' | 'android' | 'darwin' | 'freebsd' | 'haiku' | 'linux' | 'openbsd' | 'sunos' | 'win32' | 'cygwin' | 'netbsd'; + type Architecture = 'arm' | 'arm64' | 'ia32' | 'mips' | 'mipsel' | 'ppc' | 'ppc64' | 's390' | 's390x' | 'x64'; + type Signals = + | 'SIGABRT' + | 'SIGALRM' + | 'SIGBUS' + | 'SIGCHLD' + | 'SIGCONT' + | 'SIGFPE' + | 'SIGHUP' + | 'SIGILL' + | 'SIGINT' + | 'SIGIO' + | 'SIGIOT' + | 'SIGKILL' + | 'SIGPIPE' + | 'SIGPOLL' + | 'SIGPROF' + | 'SIGPWR' + | 'SIGQUIT' + | 'SIGSEGV' + | 'SIGSTKFLT' + | 'SIGSTOP' + | 'SIGSYS' + | 'SIGTERM' + | 'SIGTRAP' + | 'SIGTSTP' + | 'SIGTTIN' + | 'SIGTTOU' + | 'SIGUNUSED' + | 'SIGURG' + | 'SIGUSR1' + | 'SIGUSR2' + | 'SIGVTALRM' + | 'SIGWINCH' + | 'SIGXCPU' + | 'SIGXFSZ' + | 'SIGBREAK' + | 'SIGLOST' + | 'SIGINFO'; + type UncaughtExceptionOrigin = 'uncaughtException' | 'unhandledRejection'; + type MultipleResolveType = 'resolve' | 'reject'; + type BeforeExitListener = (code: number) => void; + type DisconnectListener = () => void; + type ExitListener = (code: number) => void; + type RejectionHandledListener = (promise: Promise) => void; + type UncaughtExceptionListener = (error: Error, origin: UncaughtExceptionOrigin) => void; + /** + * Most of the time the unhandledRejection will be an Error, but this should not be relied upon + * as *anything* can be thrown/rejected, it is therefore unsafe to assume that the value is an Error. + */ + type UnhandledRejectionListener = (reason: unknown, promise: Promise) => void; + type WarningListener = (warning: Error) => void; + type MessageListener = (message: unknown, sendHandle: unknown) => void; + type SignalsListener = (signal: Signals) => void; + type MultipleResolveListener = (type: MultipleResolveType, promise: Promise, value: unknown) => void; + type WorkerListener = (worker: Worker) => void; + interface Socket extends ReadWriteStream { + isTTY?: true | undefined; + } + // Alias for compatibility + interface ProcessEnv extends Dict { + /** + * Can be used to change the default timezone at runtime + */ + TZ?: string; + } + interface HRTime { + (time?: [number, number]): [number, number]; + bigint(): bigint; + } + interface ProcessReport { + /** + * Directory where the report is written. + * working directory of the Node.js process. + * @default '' indicating that reports are written to the current + */ + directory: string; + /** + * Filename where the report is written. + * The default value is the empty string. + * @default '' the output filename will be comprised of a timestamp, + * PID, and sequence number. + */ + filename: string; + /** + * Returns a JSON-formatted diagnostic report for the running process. + * The report's JavaScript stack trace is taken from err, if present. + */ + getReport(err?: Error): string; + /** + * If true, a diagnostic report is generated on fatal errors, + * such as out of memory errors or failed C++ assertions. + * @default false + */ + reportOnFatalError: boolean; + /** + * If true, a diagnostic report is generated when the process + * receives the signal specified by process.report.signal. + * @default false + */ + reportOnSignal: boolean; + /** + * If true, a diagnostic report is generated on uncaught exception. + * @default false + */ + reportOnUncaughtException: boolean; + /** + * The signal used to trigger the creation of a diagnostic report. + * @default 'SIGUSR2' + */ + signal: Signals; + /** + * Writes a diagnostic report to a file. If filename is not provided, the default filename + * includes the date, time, PID, and a sequence number. + * The report's JavaScript stack trace is taken from err, if present. + * + * @param fileName Name of the file where the report is written. + * This should be a relative path, that will be appended to the directory specified in + * `process.report.directory`, or the current working directory of the Node.js process, + * if unspecified. + * @param error A custom error used for reporting the JavaScript stack. + * @return Filename of the generated report. + */ + writeReport(fileName?: string): string; + writeReport(error?: Error): string; + writeReport(fileName?: string, err?: Error): string; + } + interface ResourceUsage { + fsRead: number; + fsWrite: number; + involuntaryContextSwitches: number; + ipcReceived: number; + ipcSent: number; + majorPageFault: number; + maxRSS: number; + minorPageFault: number; + sharedMemorySize: number; + signalsCount: number; + swappedOut: number; + systemCPUTime: number; + unsharedDataSize: number; + unsharedStackSize: number; + userCPUTime: number; + voluntaryContextSwitches: number; + } + interface EmitWarningOptions { + /** + * When `warning` is a `string`, `type` is the name to use for the _type_ of warning being emitted. + * + * @default 'Warning' + */ + type?: string | undefined; + /** + * A unique identifier for the warning instance being emitted. + */ + code?: string | undefined; + /** + * When `warning` is a `string`, `ctor` is an optional function used to limit the generated stack trace. + * + * @default process.emitWarning + */ + ctor?: Function | undefined; + /** + * Additional text to include with the error. + */ + detail?: string | undefined; + } + interface ProcessConfig { + readonly target_defaults: { + readonly cflags: any[]; + readonly default_configuration: string; + readonly defines: string[]; + readonly include_dirs: string[]; + readonly libraries: string[]; + }; + readonly variables: { + readonly clang: number; + readonly host_arch: string; + readonly node_install_npm: boolean; + readonly node_install_waf: boolean; + readonly node_prefix: string; + readonly node_shared_openssl: boolean; + readonly node_shared_v8: boolean; + readonly node_shared_zlib: boolean; + readonly node_use_dtrace: boolean; + readonly node_use_etw: boolean; + readonly node_use_openssl: boolean; + readonly target_arch: string; + readonly v8_no_strict_aliasing: number; + readonly v8_use_snapshot: boolean; + readonly visibility: string; + }; + } + interface Process extends EventEmitter { + /** + * The `process.stdout` property returns a stream connected to`stdout` (fd `1`). It is a `net.Socket` (which is a `Duplex` stream) unless fd `1` refers to a file, in which case it is + * a `Writable` stream. + * + * For example, to copy `process.stdin` to `process.stdout`: + * + * ```js + * import { stdin, stdout } from 'node:process'; + * + * stdin.pipe(stdout); + * ``` + * + * `process.stdout` differs from other Node.js streams in important ways. See `note on process I/O` for more information. + */ + stdout: WriteStream & { + fd: 1; + }; + /** + * The `process.stderr` property returns a stream connected to`stderr` (fd `2`). It is a `net.Socket` (which is a `Duplex` stream) unless fd `2` refers to a file, in which case it is + * a `Writable` stream. + * + * `process.stderr` differs from other Node.js streams in important ways. See `note on process I/O` for more information. + */ + stderr: WriteStream & { + fd: 2; + }; + /** + * The `process.stdin` property returns a stream connected to`stdin` (fd `0`). It is a `net.Socket` (which is a `Duplex` stream) unless fd `0` refers to a file, in which case it is + * a `Readable` stream. + * + * For details of how to read from `stdin` see `readable.read()`. + * + * As a `Duplex` stream, `process.stdin` can also be used in "old" mode that + * is compatible with scripts written for Node.js prior to v0.10\. + * For more information see `Stream compatibility`. + * + * In "old" streams mode the `stdin` stream is paused by default, so one + * must call `process.stdin.resume()` to read from it. Note also that calling`process.stdin.resume()` itself would switch stream to "old" mode. + */ + stdin: ReadStream & { + fd: 0; + }; + openStdin(): Socket; + /** + * The `process.argv` property returns an array containing the command-line + * arguments passed when the Node.js process was launched. The first element will + * be {@link execPath}. See `process.argv0` if access to the original value + * of `argv[0]` is needed. The second element will be the path to the JavaScript + * file being executed. The remaining elements will be any additional command-line + * arguments. + * + * For example, assuming the following script for `process-args.js`: + * + * ```js + * import { argv } from 'node:process'; + * + * // print process.argv + * argv.forEach((val, index) => { + * console.log(`${index}: ${val}`); + * }); + * ``` + * + * Launching the Node.js process as: + * + * ```bash + * node process-args.js one two=three four + * ``` + * + * Would generate the output: + * + * ```text + * 0: /usr/local/bin/node + * 1: /Users/mjr/work/node/process-args.js + * 2: one + * 3: two=three + * 4: four + * ``` + * @since v0.1.27 + */ + argv: string[]; + /** + * The `process.argv0` property stores a read-only copy of the original value of`argv[0]` passed when Node.js starts. + * + * ```console + * $ bash -c 'exec -a customArgv0 ./node' + * > process.argv[0] + * '/Volumes/code/external/node/out/Release/node' + * > process.argv0 + * 'customArgv0' + * ``` + * @since v6.4.0 + */ + argv0: string; + /** + * The `process.execArgv` property returns the set of Node.js-specific command-line + * options passed when the Node.js process was launched. These options do not + * appear in the array returned by the {@link argv} property, and do not + * include the Node.js executable, the name of the script, or any options following + * the script name. These options are useful in order to spawn child processes with + * the same execution environment as the parent. + * + * ```bash + * node --harmony script.js --version + * ``` + * + * Results in `process.execArgv`: + * + * ```js + * ['--harmony'] + * ``` + * + * And `process.argv`: + * + * ```js + * ['/usr/local/bin/node', 'script.js', '--version'] + * ``` + * + * Refer to `Worker constructor` for the detailed behavior of worker + * threads with this property. + * @since v0.7.7 + */ + execArgv: string[]; + /** + * The `process.execPath` property returns the absolute pathname of the executable + * that started the Node.js process. Symbolic links, if any, are resolved. + * + * ```js + * '/usr/local/bin/node' + * ``` + * @since v0.1.100 + */ + execPath: string; + /** + * The `process.abort()` method causes the Node.js process to exit immediately and + * generate a core file. + * + * This feature is not available in `Worker` threads. + * @since v0.7.0 + */ + abort(): never; + /** + * The `process.chdir()` method changes the current working directory of the + * Node.js process or throws an exception if doing so fails (for instance, if + * the specified `directory` does not exist). + * + * ```js + * import { chdir, cwd } from 'node:process'; + * + * console.log(`Starting directory: ${cwd()}`); + * try { + * chdir('/tmp'); + * console.log(`New directory: ${cwd()}`); + * } catch (err) { + * console.error(`chdir: ${err}`); + * } + * ``` + * + * This feature is not available in `Worker` threads. + * @since v0.1.17 + */ + chdir(directory: string): void; + /** + * The `process.cwd()` method returns the current working directory of the Node.js + * process. + * + * ```js + * import { cwd } from 'node:process'; + * + * console.log(`Current directory: ${cwd()}`); + * ``` + * @since v0.1.8 + */ + cwd(): string; + /** + * The port used by the Node.js debugger when enabled. + * + * ```js + * import process from 'node:process'; + * + * process.debugPort = 5858; + * ``` + * @since v0.7.2 + */ + debugPort: number; + /** + * The `process.emitWarning()` method can be used to emit custom or application + * specific process warnings. These can be listened for by adding a handler to the `'warning'` event. + * + * ```js + * import { emitWarning } from 'node:process'; + * + * // Emit a warning with a code and additional detail. + * emitWarning('Something happened!', { + * code: 'MY_WARNING', + * detail: 'This is some additional information', + * }); + * // Emits: + * // (node:56338) [MY_WARNING] Warning: Something happened! + * // This is some additional information + * ``` + * + * In this example, an `Error` object is generated internally by`process.emitWarning()` and passed through to the `'warning'` handler. + * + * ```js + * import process from 'node:process'; + * + * process.on('warning', (warning) => { + * console.warn(warning.name); // 'Warning' + * console.warn(warning.message); // 'Something happened!' + * console.warn(warning.code); // 'MY_WARNING' + * console.warn(warning.stack); // Stack trace + * console.warn(warning.detail); // 'This is some additional information' + * }); + * ``` + * + * If `warning` is passed as an `Error` object, the `options` argument is ignored. + * @since v8.0.0 + * @param warning The warning to emit. + */ + emitWarning(warning: string | Error, ctor?: Function): void; + emitWarning(warning: string | Error, type?: string, ctor?: Function): void; + emitWarning(warning: string | Error, type?: string, code?: string, ctor?: Function): void; + emitWarning(warning: string | Error, options?: EmitWarningOptions): void; + /** + * The `process.env` property returns an object containing the user environment. + * See [`environ(7)`](http://man7.org/linux/man-pages/man7/environ.7.html). + * + * An example of this object looks like: + * + * ```js + * { + * TERM: 'xterm-256color', + * SHELL: '/usr/local/bin/bash', + * USER: 'maciej', + * PATH: '~/.bin/:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin', + * PWD: '/Users/maciej', + * EDITOR: 'vim', + * SHLVL: '1', + * HOME: '/Users/maciej', + * LOGNAME: 'maciej', + * _: '/usr/local/bin/node' + * } + * ``` + * + * It is possible to modify this object, but such modifications will not be + * reflected outside the Node.js process, or (unless explicitly requested) + * to other `Worker` threads. + * In other words, the following example would not work: + * + * ```bash + * node -e 'process.env.foo = "bar"' && echo $foo + * ``` + * + * While the following will: + * + * ```js + * import { env } from 'node:process'; + * + * env.foo = 'bar'; + * console.log(env.foo); + * ``` + * + * Assigning a property on `process.env` will implicitly convert the value + * to a string. **This behavior is deprecated.** Future versions of Node.js may + * throw an error when the value is not a string, number, or boolean. + * + * ```js + * import { env } from 'node:process'; + * + * env.test = null; + * console.log(env.test); + * // => 'null' + * env.test = undefined; + * console.log(env.test); + * // => 'undefined' + * ``` + * + * Use `delete` to delete a property from `process.env`. + * + * ```js + * import { env } from 'node:process'; + * + * env.TEST = 1; + * delete env.TEST; + * console.log(env.TEST); + * // => undefined + * ``` + * + * On Windows operating systems, environment variables are case-insensitive. + * + * ```js + * import { env } from 'node:process'; + * + * env.TEST = 1; + * console.log(env.test); + * // => 1 + * ``` + * + * Unless explicitly specified when creating a `Worker` instance, + * each `Worker` thread has its own copy of `process.env`, based on its + * parent thread's `process.env`, or whatever was specified as the `env` option + * to the `Worker` constructor. Changes to `process.env` will not be visible + * across `Worker` threads, and only the main thread can make changes that + * are visible to the operating system or to native add-ons. On Windows, a copy of`process.env` on a `Worker` instance operates in a case-sensitive manner + * unlike the main thread. + * @since v0.1.27 + */ + env: ProcessEnv; + /** + * The `process.exit()` method instructs Node.js to terminate the process + * synchronously with an exit status of `code`. If `code` is omitted, exit uses + * either the 'success' code `0` or the value of `process.exitCode` if it has been + * set. Node.js will not terminate until all the `'exit'` event listeners are + * called. + * + * To exit with a 'failure' code: + * + * ```js + * import { exit } from 'node:process'; + * + * exit(1); + * ``` + * + * The shell that executed Node.js should see the exit code as `1`. + * + * Calling `process.exit()` will force the process to exit as quickly as possible + * even if there are still asynchronous operations pending that have not yet + * completed fully, including I/O operations to `process.stdout` and`process.stderr`. + * + * In most situations, it is not actually necessary to call `process.exit()`explicitly. The Node.js process will exit on its own _if there is no additional_ + * _work pending_ in the event loop. The `process.exitCode` property can be set to + * tell the process which exit code to use when the process exits gracefully. + * + * For instance, the following example illustrates a _misuse_ of the`process.exit()` method that could lead to data printed to stdout being + * truncated and lost: + * + * ```js + * import { exit } from 'node:process'; + * + * // This is an example of what *not* to do: + * if (someConditionNotMet()) { + * printUsageToStdout(); + * exit(1); + * } + * ``` + * + * The reason this is problematic is because writes to `process.stdout` in Node.js + * are sometimes _asynchronous_ and may occur over multiple ticks of the Node.js + * event loop. Calling `process.exit()`, however, forces the process to exit _before_ those additional writes to `stdout` can be performed. + * + * Rather than calling `process.exit()` directly, the code _should_ set the`process.exitCode` and allow the process to exit naturally by avoiding + * scheduling any additional work for the event loop: + * + * ```js + * import process from 'node:process'; + * + * // How to properly set the exit code while letting + * // the process exit gracefully. + * if (someConditionNotMet()) { + * printUsageToStdout(); + * process.exitCode = 1; + * } + * ``` + * + * If it is necessary to terminate the Node.js process due to an error condition, + * throwing an _uncaught_ error and allowing the process to terminate accordingly + * is safer than calling `process.exit()`. + * + * In `Worker` threads, this function stops the current thread rather + * than the current process. + * @since v0.1.13 + * @param [code=0] The exit code. For string type, only integer strings (e.g.,'1') are allowed. + */ + exit(code?: number): never; + /** + * A number which will be the process exit code, when the process either + * exits gracefully, or is exited via {@link exit} without specifying + * a code. + * + * Specifying a code to {@link exit} will override any + * previous setting of `process.exitCode`. + * @since v0.11.8 + */ + exitCode?: number | undefined; + /** + * The `process.getgid()` method returns the numerical group identity of the + * process. (See [`getgid(2)`](http://man7.org/linux/man-pages/man2/getgid.2.html).) + * + * ```js + * import process from 'process'; + * + * if (process.getgid) { + * console.log(`Current gid: ${process.getgid()}`); + * } + * ``` + * + * This function is only available on POSIX platforms (i.e. not Windows or + * Android). + * @since v0.1.31 + */ + getgid?: () => number; + /** + * The `process.setgid()` method sets the group identity of the process. (See [`setgid(2)`](http://man7.org/linux/man-pages/man2/setgid.2.html).) The `id` can be passed as either a + * numeric ID or a group name + * string. If a group name is specified, this method blocks while resolving the + * associated numeric ID. + * + * ```js + * import process from 'process'; + * + * if (process.getgid && process.setgid) { + * console.log(`Current gid: ${process.getgid()}`); + * try { + * process.setgid(501); + * console.log(`New gid: ${process.getgid()}`); + * } catch (err) { + * console.log(`Failed to set gid: ${err}`); + * } + * } + * ``` + * + * This function is only available on POSIX platforms (i.e. not Windows or + * Android). + * This feature is not available in `Worker` threads. + * @since v0.1.31 + * @param id The group name or ID + */ + setgid?: (id: number | string) => void; + /** + * The `process.getuid()` method returns the numeric user identity of the process. + * (See [`getuid(2)`](http://man7.org/linux/man-pages/man2/getuid.2.html).) + * + * ```js + * import process from 'process'; + * + * if (process.getuid) { + * console.log(`Current uid: ${process.getuid()}`); + * } + * ``` + * + * This function is only available on POSIX platforms (i.e. not Windows or + * Android). + * @since v0.1.28 + */ + getuid?: () => number; + /** + * The `process.setuid(id)` method sets the user identity of the process. (See [`setuid(2)`](http://man7.org/linux/man-pages/man2/setuid.2.html).) The `id` can be passed as either a + * numeric ID or a username string. + * If a username is specified, the method blocks while resolving the associated + * numeric ID. + * + * ```js + * import process from 'process'; + * + * if (process.getuid && process.setuid) { + * console.log(`Current uid: ${process.getuid()}`); + * try { + * process.setuid(501); + * console.log(`New uid: ${process.getuid()}`); + * } catch (err) { + * console.log(`Failed to set uid: ${err}`); + * } + * } + * ``` + * + * This function is only available on POSIX platforms (i.e. not Windows or + * Android). + * This feature is not available in `Worker` threads. + * @since v0.1.28 + */ + setuid?: (id: number | string) => void; + /** + * The `process.geteuid()` method returns the numerical effective user identity of + * the process. (See [`geteuid(2)`](http://man7.org/linux/man-pages/man2/geteuid.2.html).) + * + * ```js + * import process from 'process'; + * + * if (process.geteuid) { + * console.log(`Current uid: ${process.geteuid()}`); + * } + * ``` + * + * This function is only available on POSIX platforms (i.e. not Windows or + * Android). + * @since v2.0.0 + */ + geteuid?: () => number; + /** + * The `process.seteuid()` method sets the effective user identity of the process. + * (See [`seteuid(2)`](http://man7.org/linux/man-pages/man2/seteuid.2.html).) The `id` can be passed as either a numeric ID or a username + * string. If a username is specified, the method blocks while resolving the + * associated numeric ID. + * + * ```js + * import process from 'process'; + * + * if (process.geteuid && process.seteuid) { + * console.log(`Current uid: ${process.geteuid()}`); + * try { + * process.seteuid(501); + * console.log(`New uid: ${process.geteuid()}`); + * } catch (err) { + * console.log(`Failed to set uid: ${err}`); + * } + * } + * ``` + * + * This function is only available on POSIX platforms (i.e. not Windows or + * Android). + * This feature is not available in `Worker` threads. + * @since v2.0.0 + * @param id A user name or ID + */ + seteuid?: (id: number | string) => void; + /** + * The `process.getegid()` method returns the numerical effective group identity + * of the Node.js process. (See [`getegid(2)`](http://man7.org/linux/man-pages/man2/getegid.2.html).) + * + * ```js + * import process from 'process'; + * + * if (process.getegid) { + * console.log(`Current gid: ${process.getegid()}`); + * } + * ``` + * + * This function is only available on POSIX platforms (i.e. not Windows or + * Android). + * @since v2.0.0 + */ + getegid?: () => number; + /** + * The `process.setegid()` method sets the effective group identity of the process. + * (See [`setegid(2)`](http://man7.org/linux/man-pages/man2/setegid.2.html).) The `id` can be passed as either a numeric ID or a group + * name string. If a group name is specified, this method blocks while resolving + * the associated a numeric ID. + * + * ```js + * import process from 'process'; + * + * if (process.getegid && process.setegid) { + * console.log(`Current gid: ${process.getegid()}`); + * try { + * process.setegid(501); + * console.log(`New gid: ${process.getegid()}`); + * } catch (err) { + * console.log(`Failed to set gid: ${err}`); + * } + * } + * ``` + * + * This function is only available on POSIX platforms (i.e. not Windows or + * Android). + * This feature is not available in `Worker` threads. + * @since v2.0.0 + * @param id A group name or ID + */ + setegid?: (id: number | string) => void; + /** + * The `process.getgroups()` method returns an array with the supplementary group + * IDs. POSIX leaves it unspecified if the effective group ID is included but + * Node.js ensures it always is. + * + * ```js + * import process from 'process'; + * + * if (process.getgroups) { + * console.log(process.getgroups()); // [ 16, 21, 297 ] + * } + * ``` + * + * This function is only available on POSIX platforms (i.e. not Windows or + * Android). + * @since v0.9.4 + */ + getgroups?: () => number[]; + /** + * The `process.setgroups()` method sets the supplementary group IDs for the + * Node.js process. This is a privileged operation that requires the Node.js + * process to have `root` or the `CAP_SETGID` capability. + * + * The `groups` array can contain numeric group IDs, group names, or both. + * + * ```js + * import process from 'process'; + * + * if (process.getgroups && process.setgroups) { + * try { + * process.setgroups([501]); + * console.log(process.getgroups()); // new groups + * } catch (err) { + * console.log(`Failed to set groups: ${err}`); + * } + * } + * ``` + * + * This function is only available on POSIX platforms (i.e. not Windows or + * Android). + * This feature is not available in `Worker` threads. + * @since v0.9.4 + */ + setgroups?: (groups: ReadonlyArray) => void; + /** + * The `process.setUncaughtExceptionCaptureCallback()` function sets a function + * that will be invoked when an uncaught exception occurs, which will receive the + * exception value itself as its first argument. + * + * If such a function is set, the `'uncaughtException'` event will + * not be emitted. If `--abort-on-uncaught-exception` was passed from the + * command line or set through `v8.setFlagsFromString()`, the process will + * not abort. Actions configured to take place on exceptions such as report + * generations will be affected too + * + * To unset the capture function,`process.setUncaughtExceptionCaptureCallback(null)` may be used. Calling this + * method with a non-`null` argument while another capture function is set will + * throw an error. + * + * Using this function is mutually exclusive with using the deprecated `domain` built-in module. + * @since v9.3.0 + */ + setUncaughtExceptionCaptureCallback(cb: ((err: Error) => void) | null): void; + /** + * Indicates whether a callback has been set using {@link setUncaughtExceptionCaptureCallback}. + * @since v9.3.0 + */ + hasUncaughtExceptionCaptureCallback(): boolean; + /** + * The `process.version` property contains the Node.js version string. + * + * ```js + * import { version } from 'node:process'; + * + * console.log(`Version: ${version}`); + * // Version: v14.8.0 + * ``` + * + * To get the version string without the prepended _v_, use`process.versions.node`. + * @since v0.1.3 + */ + readonly version: string; + /** + * The `process.versions` property returns an object listing the version strings of + * Node.js and its dependencies. `process.versions.modules` indicates the current + * ABI version, which is increased whenever a C++ API changes. Node.js will refuse + * to load modules that were compiled against a different module ABI version. + * + * ```js + * import { versions } from 'node:process'; + * + * console.log(versions); + * ``` + * + * Will generate an object similar to: + * + * ```console + * { node: '20.2.0', + * acorn: '8.8.2', + * ada: '2.4.0', + * ares: '1.19.0', + * base64: '0.5.0', + * brotli: '1.0.9', + * cjs_module_lexer: '1.2.2', + * cldr: '43.0', + * icu: '73.1', + * llhttp: '8.1.0', + * modules: '115', + * napi: '8', + * nghttp2: '1.52.0', + * nghttp3: '0.7.0', + * ngtcp2: '0.8.1', + * openssl: '3.0.8+quic', + * simdutf: '3.2.9', + * tz: '2023c', + * undici: '5.22.0', + * unicode: '15.0', + * uv: '1.44.2', + * uvwasi: '0.0.16', + * v8: '11.3.244.8-node.9', + * zlib: '1.2.13' } + * ``` + * @since v0.2.0 + */ + readonly versions: ProcessVersions; + /** + * The `process.config` property returns a frozen `Object` containing the + * JavaScript representation of the configure options used to compile the current + * Node.js executable. This is the same as the `config.gypi` file that was produced + * when running the `./configure` script. + * + * An example of the possible output looks like: + * + * ```js + * { + * target_defaults: + * { cflags: [], + * default_configuration: 'Release', + * defines: [], + * include_dirs: [], + * libraries: [] }, + * variables: + * { + * host_arch: 'x64', + * napi_build_version: 5, + * node_install_npm: 'true', + * node_prefix: '', + * node_shared_cares: 'false', + * node_shared_http_parser: 'false', + * node_shared_libuv: 'false', + * node_shared_zlib: 'false', + * node_use_openssl: 'true', + * node_shared_openssl: 'false', + * strict_aliasing: 'true', + * target_arch: 'x64', + * v8_use_snapshot: 1 + * } + * } + * ``` + * @since v0.7.7 + */ + readonly config: ProcessConfig; + /** + * The `process.kill()` method sends the `signal` to the process identified by`pid`. + * + * Signal names are strings such as `'SIGINT'` or `'SIGHUP'`. See `Signal Events` and [`kill(2)`](http://man7.org/linux/man-pages/man2/kill.2.html) for more information. + * + * This method will throw an error if the target `pid` does not exist. As a special + * case, a signal of `0` can be used to test for the existence of a process. + * Windows platforms will throw an error if the `pid` is used to kill a process + * group. + * + * Even though the name of this function is `process.kill()`, it is really just a + * signal sender, like the `kill` system call. The signal sent may do something + * other than kill the target process. + * + * ```js + * import process, { kill } from 'node:process'; + * + * process.on('SIGHUP', () => { + * console.log('Got SIGHUP signal.'); + * }); + * + * setTimeout(() => { + * console.log('Exiting.'); + * process.exit(0); + * }, 100); + * + * kill(process.pid, 'SIGHUP'); + * ``` + * + * When `SIGUSR1` is received by a Node.js process, Node.js will start the + * debugger. See `Signal Events`. + * @since v0.0.6 + * @param pid A process ID + * @param [signal='SIGTERM'] The signal to send, either as a string or number. + */ + kill(pid: number, signal?: string | number): true; + /** + * The `process.pid` property returns the PID of the process. + * + * ```js + * import { pid } from 'node:process'; + * + * console.log(`This process is pid ${pid}`); + * ``` + * @since v0.1.15 + */ + readonly pid: number; + /** + * The `process.ppid` property returns the PID of the parent of the + * current process. + * + * ```js + * import { ppid } from 'node:process'; + * + * console.log(`The parent process is pid ${ppid}`); + * ``` + * @since v9.2.0, v8.10.0, v6.13.0 + */ + readonly ppid: number; + /** + * The `process.title` property returns the current process title (i.e. returns + * the current value of `ps`). Assigning a new value to `process.title` modifies + * the current value of `ps`. + * + * When a new value is assigned, different platforms will impose different maximum + * length restrictions on the title. Usually such restrictions are quite limited. + * For instance, on Linux and macOS, `process.title` is limited to the size of the + * binary name plus the length of the command-line arguments because setting the`process.title` overwrites the `argv` memory of the process. Node.js v0.8 + * allowed for longer process title strings by also overwriting the `environ`memory but that was potentially insecure and confusing in some (rather obscure) + * cases. + * + * Assigning a value to `process.title` might not result in an accurate label + * within process manager applications such as macOS Activity Monitor or Windows + * Services Manager. + * @since v0.1.104 + */ + title: string; + /** + * The operating system CPU architecture for which the Node.js binary was compiled. + * Possible values are: `'arm'`, `'arm64'`, `'ia32'`, `'mips'`,`'mipsel'`, `'ppc'`,`'ppc64'`, `'s390'`, `'s390x'`, and `'x64'`. + * + * ```js + * import { arch } from 'node:process'; + * + * console.log(`This processor architecture is ${arch}`); + * ``` + * @since v0.5.0 + */ + readonly arch: Architecture; + /** + * The `process.platform` property returns a string identifying the operating + * system platform for which the Node.js binary was compiled. + * + * Currently possible values are: + * + * * `'aix'` + * * `'darwin'` + * * `'freebsd'` + * * `'linux'` + * * `'openbsd'` + * * `'sunos'` + * * `'win32'` + * + * ```js + * import { platform } from 'node:process'; + * + * console.log(`This platform is ${platform}`); + * ``` + * + * The value `'android'` may also be returned if the Node.js is built on the + * Android operating system. However, Android support in Node.js [is experimental](https://github.com/nodejs/node/blob/HEAD/BUILDING.md#androidandroid-based-devices-eg-firefox-os). + * @since v0.1.16 + */ + readonly platform: Platform; + /** + * The `process.mainModule` property provides an alternative way of retrieving `require.main`. The difference is that if the main module changes at + * runtime, `require.main` may still refer to the original main module in + * modules that were required before the change occurred. Generally, it's + * safe to assume that the two refer to the same module. + * + * As with `require.main`, `process.mainModule` will be `undefined` if there + * is no entry script. + * @since v0.1.17 + * @deprecated Since v14.0.0 - Use `main` instead. + */ + mainModule?: Module | undefined; + memoryUsage: MemoryUsageFn; + /** + * Gets the amount of memory available to the process (in bytes) based on + * limits imposed by the OS. If there is no such constraint, or the constraint + * is unknown, `undefined` is returned. + * + * See [`uv_get_constrained_memory`](https://docs.libuv.org/en/v1.x/misc.html#c.uv_get_constrained_memory) for more + * information. + * @since v19.6.0, v18.15.0 + * @experimental + */ + constrainedMemory(): number | undefined; + /** + * The `process.cpuUsage()` method returns the user and system CPU time usage of + * the current process, in an object with properties `user` and `system`, whose + * values are microsecond values (millionth of a second). These values measure time + * spent in user and system code respectively, and may end up being greater than + * actual elapsed time if multiple CPU cores are performing work for this process. + * + * The result of a previous call to `process.cpuUsage()` can be passed as the + * argument to the function, to get a diff reading. + * + * ```js + * import { cpuUsage } from 'node:process'; + * + * const startUsage = cpuUsage(); + * // { user: 38579, system: 6986 } + * + * // spin the CPU for 500 milliseconds + * const now = Date.now(); + * while (Date.now() - now < 500); + * + * console.log(cpuUsage(startUsage)); + * // { user: 514883, system: 11226 } + * ``` + * @since v6.1.0 + * @param previousValue A previous return value from calling `process.cpuUsage()` + */ + cpuUsage(previousValue?: CpuUsage): CpuUsage; + /** + * `process.nextTick()` adds `callback` to the "next tick queue". This queue is + * fully drained after the current operation on the JavaScript stack runs to + * completion and before the event loop is allowed to continue. It's possible to + * create an infinite loop if one were to recursively call `process.nextTick()`. + * See the [Event Loop](https://nodejs.org/en/docs/guides/event-loop-timers-and-nexttick/#process-nexttick) guide for more background. + * + * ```js + * import { nextTick } from 'node:process'; + * + * console.log('start'); + * nextTick(() => { + * console.log('nextTick callback'); + * }); + * console.log('scheduled'); + * // Output: + * // start + * // scheduled + * // nextTick callback + * ``` + * + * This is important when developing APIs in order to give users the opportunity + * to assign event handlers _after_ an object has been constructed but before any + * I/O has occurred: + * + * ```js + * import { nextTick } from 'node:process'; + * + * function MyThing(options) { + * this.setupOptions(options); + * + * nextTick(() => { + * this.startDoingStuff(); + * }); + * } + * + * const thing = new MyThing(); + * thing.getReadyForStuff(); + * + * // thing.startDoingStuff() gets called now, not before. + * ``` + * + * It is very important for APIs to be either 100% synchronous or 100% + * asynchronous. Consider this example: + * + * ```js + * // WARNING! DO NOT USE! BAD UNSAFE HAZARD! + * function maybeSync(arg, cb) { + * if (arg) { + * cb(); + * return; + * } + * + * fs.stat('file', cb); + * } + * ``` + * + * This API is hazardous because in the following case: + * + * ```js + * const maybeTrue = Math.random() > 0.5; + * + * maybeSync(maybeTrue, () => { + * foo(); + * }); + * + * bar(); + * ``` + * + * It is not clear whether `foo()` or `bar()` will be called first. + * + * The following approach is much better: + * + * ```js + * import { nextTick } from 'node:process'; + * + * function definitelyAsync(arg, cb) { + * if (arg) { + * nextTick(cb); + * return; + * } + * + * fs.stat('file', cb); + * } + * ``` + * @since v0.1.26 + * @param args Additional arguments to pass when invoking the `callback` + */ + nextTick(callback: Function, ...args: any[]): void; + /** + * The `process.release` property returns an `Object` containing metadata related + * to the current release, including URLs for the source tarball and headers-only + * tarball. + * + * `process.release` contains the following properties: + * + * ```js + * { + * name: 'node', + * lts: 'Hydrogen', + * sourceUrl: 'https://nodejs.org/download/release/v18.12.0/node-v18.12.0.tar.gz', + * headersUrl: 'https://nodejs.org/download/release/v18.12.0/node-v18.12.0-headers.tar.gz', + * libUrl: 'https://nodejs.org/download/release/v18.12.0/win-x64/node.lib' + * } + * ``` + * + * In custom builds from non-release versions of the source tree, only the`name` property may be present. The additional properties should not be + * relied upon to exist. + * @since v3.0.0 + */ + readonly release: ProcessRelease; + features: { + inspector: boolean; + debug: boolean; + uv: boolean; + ipv6: boolean; + tls_alpn: boolean; + tls_sni: boolean; + tls_ocsp: boolean; + tls: boolean; + }; + /** + * `process.umask()` returns the Node.js process's file mode creation mask. Child + * processes inherit the mask from the parent process. + * @since v0.1.19 + * @deprecated Calling `process.umask()` with no argument causes the process-wide umask to be written twice. This introduces a race condition between threads, and is a potential * + * security vulnerability. There is no safe, cross-platform alternative API. + */ + umask(): number; + /** + * Can only be set if not in worker thread. + */ + umask(mask: string | number): number; + /** + * The `process.uptime()` method returns the number of seconds the current Node.js + * process has been running. + * + * The return value includes fractions of a second. Use `Math.floor()` to get whole + * seconds. + * @since v0.5.0 + */ + uptime(): number; + hrtime: HRTime; + /** + * If Node.js is spawned with an IPC channel, the `process.send()` method can be + * used to send messages to the parent process. Messages will be received as a `'message'` event on the parent's `ChildProcess` object. + * + * If Node.js was not spawned with an IPC channel, `process.send` will be `undefined`. + * + * The message goes through serialization and parsing. The resulting message might + * not be the same as what is originally sent. + * @since v0.5.9 + * @param options used to parameterize the sending of certain types of handles.`options` supports the following properties: + */ + send?( + message: any, + sendHandle?: any, + options?: { + swallowErrors?: boolean | undefined; + }, + callback?: (error: Error | null) => void + ): boolean; + /** + * If the Node.js process is spawned with an IPC channel (see the `Child Process` and `Cluster` documentation), the `process.disconnect()` method will close the + * IPC channel to the parent process, allowing the child process to exit gracefully + * once there are no other connections keeping it alive. + * + * The effect of calling `process.disconnect()` is the same as calling `ChildProcess.disconnect()` from the parent process. + * + * If the Node.js process was not spawned with an IPC channel,`process.disconnect()` will be `undefined`. + * @since v0.7.2 + */ + disconnect(): void; + /** + * If the Node.js process is spawned with an IPC channel (see the `Child Process` and `Cluster` documentation), the `process.connected` property will return`true` so long as the IPC + * channel is connected and will return `false` after`process.disconnect()` is called. + * + * Once `process.connected` is `false`, it is no longer possible to send messages + * over the IPC channel using `process.send()`. + * @since v0.7.2 + */ + connected: boolean; + /** + * The `process.allowedNodeEnvironmentFlags` property is a special, + * read-only `Set` of flags allowable within the `NODE_OPTIONS` environment variable. + * + * `process.allowedNodeEnvironmentFlags` extends `Set`, but overrides`Set.prototype.has` to recognize several different possible flag + * representations. `process.allowedNodeEnvironmentFlags.has()` will + * return `true` in the following cases: + * + * * Flags may omit leading single (`-`) or double (`--`) dashes; e.g.,`inspect-brk` for `--inspect-brk`, or `r` for `-r`. + * * Flags passed through to V8 (as listed in `--v8-options`) may replace + * one or more _non-leading_ dashes for an underscore, or vice-versa; + * e.g., `--perf_basic_prof`, `--perf-basic-prof`, `--perf_basic-prof`, + * etc. + * * Flags may contain one or more equals (`=`) characters; all + * characters after and including the first equals will be ignored; + * e.g., `--stack-trace-limit=100`. + * * Flags _must_ be allowable within `NODE_OPTIONS`. + * + * When iterating over `process.allowedNodeEnvironmentFlags`, flags will + * appear only _once_; each will begin with one or more dashes. Flags + * passed through to V8 will contain underscores instead of non-leading + * dashes: + * + * ```js + * import { allowedNodeEnvironmentFlags } from 'node:process'; + * + * allowedNodeEnvironmentFlags.forEach((flag) => { + * // -r + * // --inspect-brk + * // --abort_on_uncaught_exception + * // ... + * }); + * ``` + * + * The methods `add()`, `clear()`, and `delete()` of`process.allowedNodeEnvironmentFlags` do nothing, and will fail + * silently. + * + * If Node.js was compiled _without_ `NODE_OPTIONS` support (shown in {@link config}), `process.allowedNodeEnvironmentFlags` will + * contain what _would have_ been allowable. + * @since v10.10.0 + */ + allowedNodeEnvironmentFlags: ReadonlySet; + /** + * `process.report` is an object whose methods are used to generate diagnostic + * reports for the current process. Additional documentation is available in the `report documentation`. + * @since v11.8.0 + */ + report?: ProcessReport | undefined; + /** + * ```js + * import { resourceUsage } from 'node:process'; + * + * console.log(resourceUsage()); + * /* + * Will output: + * { + * userCPUTime: 82872, + * systemCPUTime: 4143, + * maxRSS: 33164, + * sharedMemorySize: 0, + * unsharedDataSize: 0, + * unsharedStackSize: 0, + * minorPageFault: 2469, + * majorPageFault: 0, + * swappedOut: 0, + * fsRead: 0, + * fsWrite: 8, + * ipcSent: 0, + * ipcReceived: 0, + * signalsCount: 0, + * voluntaryContextSwitches: 79, + * involuntaryContextSwitches: 1 + * } + * + * ``` + * @since v12.6.0 + * @return the resource usage for the current process. All of these values come from the `uv_getrusage` call which returns a [`uv_rusage_t` struct][uv_rusage_t]. + */ + resourceUsage(): ResourceUsage; + /** + * The `process.traceDeprecation` property indicates whether the`--trace-deprecation` flag is set on the current Node.js process. See the + * documentation for the `'warning' event` and the `emitWarning() method` for more information about this + * flag's behavior. + * @since v0.8.0 + */ + traceDeprecation: boolean; + /* EventEmitter */ + addListener(event: 'beforeExit', listener: BeforeExitListener): this; + addListener(event: 'disconnect', listener: DisconnectListener): this; + addListener(event: 'exit', listener: ExitListener): this; + addListener(event: 'rejectionHandled', listener: RejectionHandledListener): this; + addListener(event: 'uncaughtException', listener: UncaughtExceptionListener): this; + addListener(event: 'uncaughtExceptionMonitor', listener: UncaughtExceptionListener): this; + addListener(event: 'unhandledRejection', listener: UnhandledRejectionListener): this; + addListener(event: 'warning', listener: WarningListener): this; + addListener(event: 'message', listener: MessageListener): this; + addListener(event: Signals, listener: SignalsListener): this; + addListener(event: 'multipleResolves', listener: MultipleResolveListener): this; + addListener(event: 'worker', listener: WorkerListener): this; + emit(event: 'beforeExit', code: number): boolean; + emit(event: 'disconnect'): boolean; + emit(event: 'exit', code: number): boolean; + emit(event: 'rejectionHandled', promise: Promise): boolean; + emit(event: 'uncaughtException', error: Error): boolean; + emit(event: 'uncaughtExceptionMonitor', error: Error): boolean; + emit(event: 'unhandledRejection', reason: unknown, promise: Promise): boolean; + emit(event: 'warning', warning: Error): boolean; + emit(event: 'message', message: unknown, sendHandle: unknown): this; + emit(event: Signals, signal?: Signals): boolean; + emit(event: 'multipleResolves', type: MultipleResolveType, promise: Promise, value: unknown): this; + emit(event: 'worker', listener: WorkerListener): this; + on(event: 'beforeExit', listener: BeforeExitListener): this; + on(event: 'disconnect', listener: DisconnectListener): this; + on(event: 'exit', listener: ExitListener): this; + on(event: 'rejectionHandled', listener: RejectionHandledListener): this; + on(event: 'uncaughtException', listener: UncaughtExceptionListener): this; + on(event: 'uncaughtExceptionMonitor', listener: UncaughtExceptionListener): this; + on(event: 'unhandledRejection', listener: UnhandledRejectionListener): this; + on(event: 'warning', listener: WarningListener): this; + on(event: 'message', listener: MessageListener): this; + on(event: Signals, listener: SignalsListener): this; + on(event: 'multipleResolves', listener: MultipleResolveListener): this; + on(event: 'worker', listener: WorkerListener): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + once(event: 'beforeExit', listener: BeforeExitListener): this; + once(event: 'disconnect', listener: DisconnectListener): this; + once(event: 'exit', listener: ExitListener): this; + once(event: 'rejectionHandled', listener: RejectionHandledListener): this; + once(event: 'uncaughtException', listener: UncaughtExceptionListener): this; + once(event: 'uncaughtExceptionMonitor', listener: UncaughtExceptionListener): this; + once(event: 'unhandledRejection', listener: UnhandledRejectionListener): this; + once(event: 'warning', listener: WarningListener): this; + once(event: 'message', listener: MessageListener): this; + once(event: Signals, listener: SignalsListener): this; + once(event: 'multipleResolves', listener: MultipleResolveListener): this; + once(event: 'worker', listener: WorkerListener): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + prependListener(event: 'beforeExit', listener: BeforeExitListener): this; + prependListener(event: 'disconnect', listener: DisconnectListener): this; + prependListener(event: 'exit', listener: ExitListener): this; + prependListener(event: 'rejectionHandled', listener: RejectionHandledListener): this; + prependListener(event: 'uncaughtException', listener: UncaughtExceptionListener): this; + prependListener(event: 'uncaughtExceptionMonitor', listener: UncaughtExceptionListener): this; + prependListener(event: 'unhandledRejection', listener: UnhandledRejectionListener): this; + prependListener(event: 'warning', listener: WarningListener): this; + prependListener(event: 'message', listener: MessageListener): this; + prependListener(event: Signals, listener: SignalsListener): this; + prependListener(event: 'multipleResolves', listener: MultipleResolveListener): this; + prependListener(event: 'worker', listener: WorkerListener): this; + prependOnceListener(event: 'beforeExit', listener: BeforeExitListener): this; + prependOnceListener(event: 'disconnect', listener: DisconnectListener): this; + prependOnceListener(event: 'exit', listener: ExitListener): this; + prependOnceListener(event: 'rejectionHandled', listener: RejectionHandledListener): this; + prependOnceListener(event: 'uncaughtException', listener: UncaughtExceptionListener): this; + prependOnceListener(event: 'uncaughtExceptionMonitor', listener: UncaughtExceptionListener): this; + prependOnceListener(event: 'unhandledRejection', listener: UnhandledRejectionListener): this; + prependOnceListener(event: 'warning', listener: WarningListener): this; + prependOnceListener(event: 'message', listener: MessageListener): this; + prependOnceListener(event: Signals, listener: SignalsListener): this; + prependOnceListener(event: 'multipleResolves', listener: MultipleResolveListener): this; + prependOnceListener(event: 'worker', listener: WorkerListener): this; + listeners(event: 'beforeExit'): BeforeExitListener[]; + listeners(event: 'disconnect'): DisconnectListener[]; + listeners(event: 'exit'): ExitListener[]; + listeners(event: 'rejectionHandled'): RejectionHandledListener[]; + listeners(event: 'uncaughtException'): UncaughtExceptionListener[]; + listeners(event: 'uncaughtExceptionMonitor'): UncaughtExceptionListener[]; + listeners(event: 'unhandledRejection'): UnhandledRejectionListener[]; + listeners(event: 'warning'): WarningListener[]; + listeners(event: 'message'): MessageListener[]; + listeners(event: Signals): SignalsListener[]; + listeners(event: 'multipleResolves'): MultipleResolveListener[]; + listeners(event: 'worker'): WorkerListener[]; + } + } + } + export = process; +} +declare module 'process' { + import process = require('node:process'); + export = process; +} diff --git a/node_modules/@types/node/punycode.d.ts b/node_modules/@types/node/punycode.d.ts new file mode 100644 index 0000000..60aca0d --- /dev/null +++ b/node_modules/@types/node/punycode.d.ts @@ -0,0 +1,117 @@ +/** + * **The version of the punycode module bundled in Node.js is being deprecated.**In a future major version of Node.js this module will be removed. Users + * currently depending on the `punycode` module should switch to using the + * userland-provided [Punycode.js](https://github.com/bestiejs/punycode.js) module instead. For punycode-based URL + * encoding, see `url.domainToASCII` or, more generally, the `WHATWG URL API`. + * + * The `punycode` module is a bundled version of the [Punycode.js](https://github.com/bestiejs/punycode.js) module. It + * can be accessed using: + * + * ```js + * const punycode = require('punycode'); + * ``` + * + * [Punycode](https://tools.ietf.org/html/rfc3492) is a character encoding scheme defined by RFC 3492 that is + * primarily intended for use in Internationalized Domain Names. Because host + * names in URLs are limited to ASCII characters only, Domain Names that contain + * non-ASCII characters must be converted into ASCII using the Punycode scheme. + * For instance, the Japanese character that translates into the English word,`'example'` is `'例'`. The Internationalized Domain Name, `'例.com'` (equivalent + * to `'example.com'`) is represented by Punycode as the ASCII string`'xn--fsq.com'`. + * + * The `punycode` module provides a simple implementation of the Punycode standard. + * + * The `punycode` module is a third-party dependency used by Node.js and + * made available to developers as a convenience. Fixes or other modifications to + * the module must be directed to the [Punycode.js](https://github.com/bestiejs/punycode.js) project. + * @deprecated Since v7.0.0 - Deprecated + * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/punycode.js) + */ +declare module 'node:punycode' { + /** + * The `punycode.decode()` method converts a [Punycode](https://tools.ietf.org/html/rfc3492) string of ASCII-only + * characters to the equivalent string of Unicode codepoints. + * + * ```js + * punycode.decode('maana-pta'); // 'mañana' + * punycode.decode('--dqo34k'); // '☃-⌘' + * ``` + * @since v0.5.1 + */ + function decode(string: string): string; + /** + * The `punycode.encode()` method converts a string of Unicode codepoints to a [Punycode](https://tools.ietf.org/html/rfc3492) string of ASCII-only characters. + * + * ```js + * punycode.encode('mañana'); // 'maana-pta' + * punycode.encode('☃-⌘'); // '--dqo34k' + * ``` + * @since v0.5.1 + */ + function encode(string: string): string; + /** + * The `punycode.toUnicode()` method converts a string representing a domain name + * containing [Punycode](https://tools.ietf.org/html/rfc3492) encoded characters into Unicode. Only the [Punycode](https://tools.ietf.org/html/rfc3492) encoded parts of the domain name are be + * converted. + * + * ```js + * // decode domain names + * punycode.toUnicode('xn--maana-pta.com'); // 'mañana.com' + * punycode.toUnicode('xn----dqo34k.com'); // '☃-⌘.com' + * punycode.toUnicode('example.com'); // 'example.com' + * ``` + * @since v0.6.1 + */ + function toUnicode(domain: string): string; + /** + * The `punycode.toASCII()` method converts a Unicode string representing an + * Internationalized Domain Name to [Punycode](https://tools.ietf.org/html/rfc3492). Only the non-ASCII parts of the + * domain name will be converted. Calling `punycode.toASCII()` on a string that + * already only contains ASCII characters will have no effect. + * + * ```js + * // encode domain names + * punycode.toASCII('mañana.com'); // 'xn--maana-pta.com' + * punycode.toASCII('☃-⌘.com'); // 'xn----dqo34k.com' + * punycode.toASCII('example.com'); // 'example.com' + * ``` + * @since v0.6.1 + */ + function toASCII(domain: string): string; + /** + * @deprecated since v7.0.0 + * The version of the punycode module bundled in Node.js is being deprecated. + * In a future major version of Node.js this module will be removed. + * Users currently depending on the punycode module should switch to using + * the userland-provided Punycode.js module instead. + */ + const ucs2: ucs2; + interface ucs2 { + /** + * @deprecated since v7.0.0 + * The version of the punycode module bundled in Node.js is being deprecated. + * In a future major version of Node.js this module will be removed. + * Users currently depending on the punycode module should switch to using + * the userland-provided Punycode.js module instead. + */ + decode(string: string): number[]; + /** + * @deprecated since v7.0.0 + * The version of the punycode module bundled in Node.js is being deprecated. + * In a future major version of Node.js this module will be removed. + * Users currently depending on the punycode module should switch to using + * the userland-provided Punycode.js module instead. + */ + encode(codePoints: ReadonlyArray): string; + } + /** + * @deprecated since v7.0.0 + * The version of the punycode module bundled in Node.js is being deprecated. + * In a future major version of Node.js this module will be removed. + * Users currently depending on the punycode module should switch to using + * the userland-provided Punycode.js module instead. + */ + const version: string; +} +declare module 'punycode' { + export * from 'node:punycode'; +} diff --git a/node_modules/@types/node/querystring.d.ts b/node_modules/@types/node/querystring.d.ts new file mode 100644 index 0000000..d9ff201 --- /dev/null +++ b/node_modules/@types/node/querystring.d.ts @@ -0,0 +1,131 @@ +/** + * The `node:querystring` module provides utilities for parsing and formatting URL + * query strings. It can be accessed using: + * + * ```js + * const querystring = require('node:querystring'); + * ``` + * + * `querystring` is more performant than `URLSearchParams` but is not a + * standardized API. Use `URLSearchParams` when performance is not critical or + * when compatibility with browser code is desirable. + * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/querystring.js) + */ +declare module 'node:querystring' { + interface StringifyOptions { + encodeURIComponent?: ((str: string) => string) | undefined; + } + interface ParseOptions { + maxKeys?: number | undefined; + decodeURIComponent?: ((str: string) => string) | undefined; + } + interface ParsedUrlQuery extends NodeJS.Dict {} + interface ParsedUrlQueryInput extends NodeJS.Dict | ReadonlyArray | ReadonlyArray | null> {} + /** + * The `querystring.stringify()` method produces a URL query string from a + * given `obj` by iterating through the object's "own properties". + * + * It serializes the following types of values passed in `obj`:[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type) | + * [number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type) | + * [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) | + * [boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type) | + * [string\[\]](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type) | + * [number\[\]](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type) | + * [bigint\[\]](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) | + * [boolean\[\]](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type) The numeric values must be finite. Any other input values will be coerced to + * empty strings. + * + * ```js + * querystring.stringify({ foo: 'bar', baz: ['qux', 'quux'], corge: '' }); + * // Returns 'foo=bar&baz=qux&baz=quux&corge=' + * + * querystring.stringify({ foo: 'bar', baz: 'qux' }, ';', ':'); + * // Returns 'foo:bar;baz:qux' + * ``` + * + * By default, characters requiring percent-encoding within the query string will + * be encoded as UTF-8\. If an alternative encoding is required, then an alternative`encodeURIComponent` option will need to be specified: + * + * ```js + * // Assuming gbkEncodeURIComponent function already exists, + * + * querystring.stringify({ w: '中文', foo: 'bar' }, null, null, + * { encodeURIComponent: gbkEncodeURIComponent }); + * ``` + * @since v0.1.25 + * @param obj The object to serialize into a URL query string + * @param [sep='&'] The substring used to delimit key and value pairs in the query string. + * @param [eq='='] . The substring used to delimit keys and values in the query string. + */ + function stringify(obj?: ParsedUrlQueryInput, sep?: string, eq?: string, options?: StringifyOptions): string; + /** + * The `querystring.parse()` method parses a URL query string (`str`) into a + * collection of key and value pairs. + * + * For example, the query string `'foo=bar&abc=xyz&abc=123'` is parsed into: + * + * ```js + * { + * foo: 'bar', + * abc: ['xyz', '123'] + * } + * ``` + * + * The object returned by the `querystring.parse()` method _does not_prototypically inherit from the JavaScript `Object`. This means that typical`Object` methods such as `obj.toString()`, + * `obj.hasOwnProperty()`, and others + * are not defined and _will not work_. + * + * By default, percent-encoded characters within the query string will be assumed + * to use UTF-8 encoding. If an alternative character encoding is used, then an + * alternative `decodeURIComponent` option will need to be specified: + * + * ```js + * // Assuming gbkDecodeURIComponent function already exists... + * + * querystring.parse('w=%D6%D0%CE%C4&foo=bar', null, null, + * { decodeURIComponent: gbkDecodeURIComponent }); + * ``` + * @since v0.1.25 + * @param str The URL query string to parse + * @param [sep='&'] The substring used to delimit key and value pairs in the query string. + * @param [eq='='] . The substring used to delimit keys and values in the query string. + */ + function parse(str: string, sep?: string, eq?: string, options?: ParseOptions): ParsedUrlQuery; + /** + * The querystring.encode() function is an alias for querystring.stringify(). + */ + const encode: typeof stringify; + /** + * The querystring.decode() function is an alias for querystring.parse(). + */ + const decode: typeof parse; + /** + * The `querystring.escape()` method performs URL percent-encoding on the given`str` in a manner that is optimized for the specific requirements of URL + * query strings. + * + * The `querystring.escape()` method is used by `querystring.stringify()` and is + * generally not expected to be used directly. It is exported primarily to allow + * application code to provide a replacement percent-encoding implementation if + * necessary by assigning `querystring.escape` to an alternative function. + * @since v0.1.25 + */ + function escape(str: string): string; + /** + * The `querystring.unescape()` method performs decoding of URL percent-encoded + * characters on the given `str`. + * + * The `querystring.unescape()` method is used by `querystring.parse()` and is + * generally not expected to be used directly. It is exported primarily to allow + * application code to provide a replacement decoding implementation if + * necessary by assigning `querystring.unescape` to an alternative function. + * + * By default, the `querystring.unescape()` method will attempt to use the + * JavaScript built-in `decodeURIComponent()` method to decode. If that fails, + * a safer equivalent that does not throw on malformed URLs will be used. + * @since v0.1.25 + */ + function unescape(str: string): string; +} +declare module 'querystring' { + export * from 'node:querystring'; +} diff --git a/node_modules/@types/node/readline.d.ts b/node_modules/@types/node/readline.d.ts new file mode 100644 index 0000000..76d8671 --- /dev/null +++ b/node_modules/@types/node/readline.d.ts @@ -0,0 +1,526 @@ +/** + * The `node:readline` module provides an interface for reading data from a `Readable` stream (such as `process.stdin`) one line at a time. + * + * To use the promise-based APIs: + * + * ```js + * import * as readline from 'node:readline/promises'; + * ``` + * + * To use the callback and sync APIs: + * + * ```js + * import * as readline from 'node:readline'; + * ``` + * + * The following simple example illustrates the basic use of the `node:readline`module. + * + * ```js + * import * as readline from 'node:readline/promises'; + * import { stdin as input, stdout as output } from 'node:process'; + * + * const rl = readline.createInterface({ input, output }); + * + * const answer = await rl.question('What do you think of Node.js? '); + * + * console.log(`Thank you for your valuable feedback: ${answer}`); + * + * rl.close(); + * ``` + * + * Once this code is invoked, the Node.js application will not terminate until the`readline.Interface` is closed because the interface waits for data to be + * received on the `input` stream. + * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/readline.js) + */ +declare module 'node:readline' { + import { Abortable, EventEmitter } from 'node:events'; + import * as promises from 'node:readline/promises'; + export { promises }; + export interface Key { + sequence?: string | undefined; + name?: string | undefined; + ctrl?: boolean | undefined; + meta?: boolean | undefined; + shift?: boolean | undefined; + } + /** + * Instances of the `readline.Interface` class are constructed using the`readline.createInterface()` method. Every instance is associated with a + * single `input` `Readable` stream and a single `output` `Writable` stream. + * The `output` stream is used to print prompts for user input that arrives on, + * and is read from, the `input` stream. + * @since v0.1.104 + */ + export class Interface extends EventEmitter { + readonly terminal: boolean; + /** + * The current input data being processed by node. + * + * This can be used when collecting input from a TTY stream to retrieve the + * current value that has been processed thus far, prior to the `line` event + * being emitted. Once the `line` event has been emitted, this property will + * be an empty string. + * + * Be aware that modifying the value during the instance runtime may have + * unintended consequences if `rl.cursor` is not also controlled. + * + * **If not using a TTY stream for input, use the `'line'` event.** + * + * One possible use case would be as follows: + * + * ```js + * const values = ['lorem ipsum', 'dolor sit amet']; + * const rl = readline.createInterface(process.stdin); + * const showResults = debounce(() => { + * console.log( + * '\n', + * values.filter((val) => val.startsWith(rl.line)).join(' '), + * ); + * }, 300); + * process.stdin.on('keypress', (c, k) => { + * showResults(); + * }); + * ``` + * @since v0.1.98 + */ + readonly line: string; + /** + * The cursor position relative to `rl.line`. + * + * This will track where the current cursor lands in the input string, when + * reading input from a TTY stream. The position of cursor determines the + * portion of the input string that will be modified as input is processed, + * as well as the column where the terminal caret will be rendered. + * @since v0.1.98 + */ + readonly cursor: number; + /** + * NOTE: According to the documentation: + * + * > Instances of the `readline.Interface` class are constructed using the + * > `readline.createInterface()` method. + * + * @see https://nodejs.org/dist/latest-v20.x/docs/api/readline.html#class-interfaceconstructor + */ + protected constructor(input: NodeJS.ReadableStream, output?: NodeJS.WritableStream, completer?: Completer | AsyncCompleter, terminal?: boolean); + /** + * NOTE: According to the documentation: + * + * > Instances of the `readline.Interface` class are constructed using the + * > `readline.createInterface()` method. + * + * @see https://nodejs.org/dist/latest-v20.x/docs/api/readline.html#class-interfaceconstructor + */ + protected constructor(options: ReadLineOptions); + /** + * The `rl.getPrompt()` method returns the current prompt used by `rl.prompt()`. + * @since v15.3.0, v14.17.0 + * @return the current prompt string + */ + getPrompt(): string; + /** + * The `rl.setPrompt()` method sets the prompt that will be written to `output`whenever `rl.prompt()` is called. + * @since v0.1.98 + */ + setPrompt(prompt: string): void; + /** + * The `rl.prompt()` method writes the `Interface` instances configured`prompt` to a new line in `output` in order to provide a user with a new + * location at which to provide input. + * + * When called, `rl.prompt()` will resume the `input` stream if it has been + * paused. + * + * If the `Interface` was created with `output` set to `null` or`undefined` the prompt is not written. + * @since v0.1.98 + * @param preserveCursor If `true`, prevents the cursor placement from being reset to `0`. + */ + prompt(preserveCursor?: boolean): void; + /** + * The `rl.question()` method displays the `query` by writing it to the `output`, + * waits for user input to be provided on `input`, then invokes the `callback`function passing the provided input as the first argument. + * + * When called, `rl.question()` will resume the `input` stream if it has been + * paused. + * + * If the `Interface` was created with `output` set to `null` or`undefined` the `query` is not written. + * + * The `callback` function passed to `rl.question()` does not follow the typical + * pattern of accepting an `Error` object or `null` as the first argument. + * The `callback` is called with the provided answer as the only argument. + * + * An error will be thrown if calling `rl.question()` after `rl.close()`. + * + * Example usage: + * + * ```js + * rl.question('What is your favorite food? ', (answer) => { + * console.log(`Oh, so your favorite food is ${answer}`); + * }); + * ``` + * + * Using an `AbortController` to cancel a question. + * + * ```js + * const ac = new AbortController(); + * const signal = ac.signal; + * + * rl.question('What is your favorite food? ', { signal }, (answer) => { + * console.log(`Oh, so your favorite food is ${answer}`); + * }); + * + * signal.addEventListener('abort', () => { + * console.log('The food question timed out'); + * }, { once: true }); + * + * setTimeout(() => ac.abort(), 10000); + * ``` + * @since v0.3.3 + * @param query A statement or query to write to `output`, prepended to the prompt. + * @param callback A callback function that is invoked with the user's input in response to the `query`. + */ + question(query: string, callback: (answer: string) => void): void; + question(query: string, options: Abortable, callback: (answer: string) => void): void; + /** + * The `rl.pause()` method pauses the `input` stream, allowing it to be resumed + * later if necessary. + * + * Calling `rl.pause()` does not immediately pause other events (including`'line'`) from being emitted by the `Interface` instance. + * @since v0.3.4 + */ + pause(): this; + /** + * The `rl.resume()` method resumes the `input` stream if it has been paused. + * @since v0.3.4 + */ + resume(): this; + /** + * The `rl.close()` method closes the `Interface` instance and + * relinquishes control over the `input` and `output` streams. When called, + * the `'close'` event will be emitted. + * + * Calling `rl.close()` does not immediately stop other events (including `'line'`) + * from being emitted by the `Interface` instance. + * @since v0.1.98 + */ + close(): void; + /** + * The `rl.write()` method will write either `data` or a key sequence identified + * by `key` to the `output`. The `key` argument is supported only if `output` is + * a `TTY` text terminal. See `TTY keybindings` for a list of key + * combinations. + * + * If `key` is specified, `data` is ignored. + * + * When called, `rl.write()` will resume the `input` stream if it has been + * paused. + * + * If the `Interface` was created with `output` set to `null` or`undefined` the `data` and `key` are not written. + * + * ```js + * rl.write('Delete this!'); + * // Simulate Ctrl+U to delete the line written previously + * rl.write(null, { ctrl: true, name: 'u' }); + * ``` + * + * The `rl.write()` method will write the data to the `readline` `Interface`'s`input`_as if it were provided by the user_. + * @since v0.1.98 + */ + write(data: string | Buffer, key?: Key): void; + write(data: undefined | null | string | Buffer, key: Key): void; + /** + * Returns the real position of the cursor in relation to the input + * prompt + string. Long input (wrapping) strings, as well as multiple + * line prompts are included in the calculations. + * @since v13.5.0, v12.16.0 + */ + getCursorPos(): CursorPos; + /** + * events.EventEmitter + * 1. close + * 2. line + * 3. pause + * 4. resume + * 5. SIGCONT + * 6. SIGINT + * 7. SIGTSTP + * 8. history + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: 'close', listener: () => void): this; + addListener(event: 'line', listener: (input: string) => void): this; + addListener(event: 'pause', listener: () => void): this; + addListener(event: 'resume', listener: () => void): this; + addListener(event: 'SIGCONT', listener: () => void): this; + addListener(event: 'SIGINT', listener: () => void): this; + addListener(event: 'SIGTSTP', listener: () => void): this; + addListener(event: 'history', listener: (history: string[]) => void): this; + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: 'close'): boolean; + emit(event: 'line', input: string): boolean; + emit(event: 'pause'): boolean; + emit(event: 'resume'): boolean; + emit(event: 'SIGCONT'): boolean; + emit(event: 'SIGINT'): boolean; + emit(event: 'SIGTSTP'): boolean; + emit(event: 'history', history: string[]): boolean; + on(event: string, listener: (...args: any[]) => void): this; + on(event: 'close', listener: () => void): this; + on(event: 'line', listener: (input: string) => void): this; + on(event: 'pause', listener: () => void): this; + on(event: 'resume', listener: () => void): this; + on(event: 'SIGCONT', listener: () => void): this; + on(event: 'SIGINT', listener: () => void): this; + on(event: 'SIGTSTP', listener: () => void): this; + on(event: 'history', listener: (history: string[]) => void): this; + once(event: string, listener: (...args: any[]) => void): this; + once(event: 'close', listener: () => void): this; + once(event: 'line', listener: (input: string) => void): this; + once(event: 'pause', listener: () => void): this; + once(event: 'resume', listener: () => void): this; + once(event: 'SIGCONT', listener: () => void): this; + once(event: 'SIGINT', listener: () => void): this; + once(event: 'SIGTSTP', listener: () => void): this; + once(event: 'history', listener: (history: string[]) => void): this; + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: 'close', listener: () => void): this; + prependListener(event: 'line', listener: (input: string) => void): this; + prependListener(event: 'pause', listener: () => void): this; + prependListener(event: 'resume', listener: () => void): this; + prependListener(event: 'SIGCONT', listener: () => void): this; + prependListener(event: 'SIGINT', listener: () => void): this; + prependListener(event: 'SIGTSTP', listener: () => void): this; + prependListener(event: 'history', listener: (history: string[]) => void): this; + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'close', listener: () => void): this; + prependOnceListener(event: 'line', listener: (input: string) => void): this; + prependOnceListener(event: 'pause', listener: () => void): this; + prependOnceListener(event: 'resume', listener: () => void): this; + prependOnceListener(event: 'SIGCONT', listener: () => void): this; + prependOnceListener(event: 'SIGINT', listener: () => void): this; + prependOnceListener(event: 'SIGTSTP', listener: () => void): this; + prependOnceListener(event: 'history', listener: (history: string[]) => void): this; + [Symbol.asyncIterator](): AsyncIterableIterator; + } + export type ReadLine = Interface; // type forwarded for backwards compatibility + export type Completer = (line: string) => CompleterResult; + export type AsyncCompleter = (line: string, callback: (err?: null | Error, result?: CompleterResult) => void) => void; + export type CompleterResult = [string[], string]; + export interface ReadLineOptions { + input: NodeJS.ReadableStream; + output?: NodeJS.WritableStream | undefined; + completer?: Completer | AsyncCompleter | undefined; + terminal?: boolean | undefined; + /** + * Initial list of history lines. This option makes sense + * only if `terminal` is set to `true` by the user or by an internal `output` + * check, otherwise the history caching mechanism is not initialized at all. + * @default [] + */ + history?: string[] | undefined; + historySize?: number | undefined; + prompt?: string | undefined; + crlfDelay?: number | undefined; + /** + * If `true`, when a new input line added + * to the history list duplicates an older one, this removes the older line + * from the list. + * @default false + */ + removeHistoryDuplicates?: boolean | undefined; + escapeCodeTimeout?: number | undefined; + tabSize?: number | undefined; + } + /** + * The `readline.createInterface()` method creates a new `readline.Interface`instance. + * + * ```js + * const readline = require('node:readline'); + * const rl = readline.createInterface({ + * input: process.stdin, + * output: process.stdout, + * }); + * ``` + * + * Once the `readline.Interface` instance is created, the most common case is to + * listen for the `'line'` event: + * + * ```js + * rl.on('line', (line) => { + * console.log(`Received: ${line}`); + * }); + * ``` + * + * If `terminal` is `true` for this instance then the `output` stream will get + * the best compatibility if it defines an `output.columns` property and emits + * a `'resize'` event on the `output` if or when the columns ever change + * (`process.stdout` does this automatically when it is a TTY). + * + * When creating a `readline.Interface` using `stdin` as input, the program + * will not terminate until it receives an [EOF character](https://en.wikipedia.org/wiki/End-of-file#EOF_character). To exit without + * waiting for user input, call `process.stdin.unref()`. + * @since v0.1.98 + */ + export function createInterface(input: NodeJS.ReadableStream, output?: NodeJS.WritableStream, completer?: Completer | AsyncCompleter, terminal?: boolean): Interface; + export function createInterface(options: ReadLineOptions): Interface; + /** + * The `readline.emitKeypressEvents()` method causes the given `Readable` stream to begin emitting `'keypress'` events corresponding to received input. + * + * Optionally, `interface` specifies a `readline.Interface` instance for which + * autocompletion is disabled when copy-pasted input is detected. + * + * If the `stream` is a `TTY`, then it must be in raw mode. + * + * This is automatically called by any readline instance on its `input` if the`input` is a terminal. Closing the `readline` instance does not stop + * the `input` from emitting `'keypress'` events. + * + * ```js + * readline.emitKeypressEvents(process.stdin); + * if (process.stdin.isTTY) + * process.stdin.setRawMode(true); + * ``` + * + * ## Example: Tiny CLI + * + * The following example illustrates the use of `readline.Interface` class to + * implement a small command-line interface: + * + * ```js + * const readline = require('node:readline'); + * const rl = readline.createInterface({ + * input: process.stdin, + * output: process.stdout, + * prompt: 'OHAI> ', + * }); + * + * rl.prompt(); + * + * rl.on('line', (line) => { + * switch (line.trim()) { + * case 'hello': + * console.log('world!'); + * break; + * default: + * console.log(`Say what? I might have heard '${line.trim()}'`); + * break; + * } + * rl.prompt(); + * }).on('close', () => { + * console.log('Have a great day!'); + * process.exit(0); + * }); + * ``` + * + * ## Example: Read file stream line-by-Line + * + * A common use case for `readline` is to consume an input file one line at a + * time. The easiest way to do so is leveraging the `fs.ReadStream` API as + * well as a `for await...of` loop: + * + * ```js + * const fs = require('node:fs'); + * const readline = require('node:readline'); + * + * async function processLineByLine() { + * const fileStream = fs.createReadStream('input.txt'); + * + * const rl = readline.createInterface({ + * input: fileStream, + * crlfDelay: Infinity, + * }); + * // Note: we use the crlfDelay option to recognize all instances of CR LF + * // ('\r\n') in input.txt as a single line break. + * + * for await (const line of rl) { + * // Each line in input.txt will be successively available here as `line`. + * console.log(`Line from file: ${line}`); + * } + * } + * + * processLineByLine(); + * ``` + * + * Alternatively, one could use the `'line'` event: + * + * ```js + * const fs = require('node:fs'); + * const readline = require('node:readline'); + * + * const rl = readline.createInterface({ + * input: fs.createReadStream('sample.txt'), + * crlfDelay: Infinity, + * }); + * + * rl.on('line', (line) => { + * console.log(`Line from file: ${line}`); + * }); + * ``` + * + * Currently, `for await...of` loop can be a bit slower. If `async` / `await`flow and speed are both essential, a mixed approach can be applied: + * + * ```js + * const { once } = require('node:events'); + * const { createReadStream } = require('node:fs'); + * const { createInterface } = require('node:readline'); + * + * (async function processLineByLine() { + * try { + * const rl = createInterface({ + * input: createReadStream('big-file.txt'), + * crlfDelay: Infinity, + * }); + * + * rl.on('line', (line) => { + * // Process the line. + * }); + * + * await once(rl, 'close'); + * + * console.log('File processed.'); + * } catch (err) { + * console.error(err); + * } + * })(); + * ``` + * @since v0.7.7 + */ + export function emitKeypressEvents(stream: NodeJS.ReadableStream, readlineInterface?: Interface): void; + export type Direction = -1 | 0 | 1; + export interface CursorPos { + rows: number; + cols: number; + } + /** + * The `readline.clearLine()` method clears current line of given `TTY` stream + * in a specified direction identified by `dir`. + * @since v0.7.7 + * @param callback Invoked once the operation completes. + * @return `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. + */ + export function clearLine(stream: NodeJS.WritableStream, dir: Direction, callback?: () => void): boolean; + /** + * The `readline.clearScreenDown()` method clears the given `TTY` stream from + * the current position of the cursor down. + * @since v0.7.7 + * @param callback Invoked once the operation completes. + * @return `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. + */ + export function clearScreenDown(stream: NodeJS.WritableStream, callback?: () => void): boolean; + /** + * The `readline.cursorTo()` method moves cursor to the specified position in a + * given `TTY` `stream`. + * @since v0.7.7 + * @param callback Invoked once the operation completes. + * @return `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. + */ + export function cursorTo(stream: NodeJS.WritableStream, x: number, y?: number, callback?: () => void): boolean; + /** + * The `readline.moveCursor()` method moves the cursor _relative_ to its current + * position in a given `TTY` `stream`. + * @since v0.7.7 + * @param callback Invoked once the operation completes. + * @return `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. + */ + export function moveCursor(stream: NodeJS.WritableStream, dx: number, dy: number, callback?: () => void): boolean; +} +declare module 'readline' { + export * from 'node:readline'; +} diff --git a/node_modules/@types/node/readline/promises.d.ts b/node_modules/@types/node/readline/promises.d.ts new file mode 100644 index 0000000..f8a78ec --- /dev/null +++ b/node_modules/@types/node/readline/promises.d.ts @@ -0,0 +1,145 @@ +/** + * @since v17.0.0 + * @experimental + */ +declare module 'node:readline/promises' { + import { Interface as _Interface, ReadLineOptions, Completer, AsyncCompleter, Direction } from 'node:readline'; + import { Abortable } from 'node:events'; + /** + * Instances of the `readlinePromises.Interface` class are constructed using the`readlinePromises.createInterface()` method. Every instance is associated with a + * single `input` `Readable` stream and a single `output` `Writable` stream. + * The `output` stream is used to print prompts for user input that arrives on, + * and is read from, the `input` stream. + * @since v17.0.0 + */ + class Interface extends _Interface { + /** + * The `rl.question()` method displays the `query` by writing it to the `output`, + * waits for user input to be provided on `input`, then invokes the `callback`function passing the provided input as the first argument. + * + * When called, `rl.question()` will resume the `input` stream if it has been + * paused. + * + * If the `Interface` was created with `output` set to `null` or`undefined` the `query` is not written. + * + * If the question is called after `rl.close()`, it returns a rejected promise. + * + * Example usage: + * + * ```js + * const answer = await rl.question('What is your favorite food? '); + * console.log(`Oh, so your favorite food is ${answer}`); + * ``` + * + * Using an `AbortSignal` to cancel a question. + * + * ```js + * const signal = AbortSignal.timeout(10_000); + * + * signal.addEventListener('abort', () => { + * console.log('The food question timed out'); + * }, { once: true }); + * + * const answer = await rl.question('What is your favorite food? ', { signal }); + * console.log(`Oh, so your favorite food is ${answer}`); + * ``` + * @since v17.0.0 + * @param query A statement or query to write to `output`, prepended to the prompt. + * @return A promise that is fulfilled with the user's input in response to the `query`. + */ + question(query: string): Promise; + question(query: string, options: Abortable): Promise; + } + /** + * @since v17.0.0 + */ + class Readline { + /** + * @param stream A TTY stream. + */ + constructor( + stream: NodeJS.WritableStream, + options?: { + autoCommit?: boolean; + } + ); + /** + * The `rl.clearLine()` method adds to the internal list of pending action an + * action that clears current line of the associated `stream` in a specified + * direction identified by `dir`. + * Call `rl.commit()` to see the effect of this method, unless `autoCommit: true`was passed to the constructor. + * @since v17.0.0 + * @return this + */ + clearLine(dir: Direction): this; + /** + * The `rl.clearScreenDown()` method adds to the internal list of pending action an + * action that clears the associated stream from the current position of the + * cursor down. + * Call `rl.commit()` to see the effect of this method, unless `autoCommit: true`was passed to the constructor. + * @since v17.0.0 + * @return this + */ + clearScreenDown(): this; + /** + * The `rl.commit()` method sends all the pending actions to the associated`stream` and clears the internal list of pending actions. + * @since v17.0.0 + */ + commit(): Promise; + /** + * The `rl.cursorTo()` method adds to the internal list of pending action an action + * that moves cursor to the specified position in the associated `stream`. + * Call `rl.commit()` to see the effect of this method, unless `autoCommit: true`was passed to the constructor. + * @since v17.0.0 + * @return this + */ + cursorTo(x: number, y?: number): this; + /** + * The `rl.moveCursor()` method adds to the internal list of pending action an + * action that moves the cursor _relative_ to its current position in the + * associated `stream`. + * Call `rl.commit()` to see the effect of this method, unless `autoCommit: true`was passed to the constructor. + * @since v17.0.0 + * @return this + */ + moveCursor(dx: number, dy: number): this; + /** + * The `rl.rollback` methods clears the internal list of pending actions without + * sending it to the associated `stream`. + * @since v17.0.0 + * @return this + */ + rollback(): this; + } + /** + * The `readlinePromises.createInterface()` method creates a new `readlinePromises.Interface`instance. + * + * ```js + * const readlinePromises = require('node:readline/promises'); + * const rl = readlinePromises.createInterface({ + * input: process.stdin, + * output: process.stdout, + * }); + * ``` + * + * Once the `readlinePromises.Interface` instance is created, the most common case + * is to listen for the `'line'` event: + * + * ```js + * rl.on('line', (line) => { + * console.log(`Received: ${line}`); + * }); + * ``` + * + * If `terminal` is `true` for this instance then the `output` stream will get + * the best compatibility if it defines an `output.columns` property and emits + * a `'resize'` event on the `output` if or when the columns ever change + * (`process.stdout` does this automatically when it is a TTY). + * @since v17.0.0 + */ + function createInterface(input: NodeJS.ReadableStream, output?: NodeJS.WritableStream, completer?: Completer | AsyncCompleter, terminal?: boolean): Interface; + function createInterface(options: ReadLineOptions): Interface; +} +declare module 'readline/promises' { + export * from 'node:readline/promises'; +} diff --git a/node_modules/@types/node/repl.d.ts b/node_modules/@types/node/repl.d.ts new file mode 100644 index 0000000..88ce2ed --- /dev/null +++ b/node_modules/@types/node/repl.d.ts @@ -0,0 +1,424 @@ +/** + * The `node:repl` module provides a Read-Eval-Print-Loop (REPL) implementation + * that is available both as a standalone program or includible in other + * applications. It can be accessed using: + * + * ```js + * const repl = require('node:repl'); + * ``` + * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/repl.js) + */ +declare module 'node:repl' { + import { Interface, Completer, AsyncCompleter } from 'node:readline'; + import { Context } from 'node:vm'; + import { InspectOptions } from 'node:util'; + interface ReplOptions { + /** + * The input prompt to display. + * @default "> " + */ + prompt?: string | undefined; + /** + * The `Readable` stream from which REPL input will be read. + * @default process.stdin + */ + input?: NodeJS.ReadableStream | undefined; + /** + * The `Writable` stream to which REPL output will be written. + * @default process.stdout + */ + output?: NodeJS.WritableStream | undefined; + /** + * If `true`, specifies that the output should be treated as a TTY terminal, and have + * ANSI/VT100 escape codes written to it. + * Default: checking the value of the `isTTY` property on the output stream upon + * instantiation. + */ + terminal?: boolean | undefined; + /** + * The function to be used when evaluating each given line of input. + * Default: an async wrapper for the JavaScript `eval()` function. An `eval` function can + * error with `repl.Recoverable` to indicate the input was incomplete and prompt for + * additional lines. + * + * @see https://nodejs.org/dist/latest-v20.x/docs/api/repl.html#repl_default_evaluation + * @see https://nodejs.org/dist/latest-v20.x/docs/api/repl.html#repl_custom_evaluation_functions + */ + eval?: REPLEval | undefined; + /** + * Defines if the repl prints output previews or not. + * @default `true` Always `false` in case `terminal` is falsy. + */ + preview?: boolean | undefined; + /** + * If `true`, specifies that the default `writer` function should include ANSI color + * styling to REPL output. If a custom `writer` function is provided then this has no + * effect. + * Default: the REPL instance's `terminal` value. + */ + useColors?: boolean | undefined; + /** + * If `true`, specifies that the default evaluation function will use the JavaScript + * `global` as the context as opposed to creating a new separate context for the REPL + * instance. The node CLI REPL sets this value to `true`. + * Default: `false`. + */ + useGlobal?: boolean | undefined; + /** + * If `true`, specifies that the default writer will not output the return value of a + * command if it evaluates to `undefined`. + * Default: `false`. + */ + ignoreUndefined?: boolean | undefined; + /** + * The function to invoke to format the output of each command before writing to `output`. + * Default: a wrapper for `util.inspect`. + * + * @see https://nodejs.org/dist/latest-v20.x/docs/api/repl.html#repl_customizing_repl_output + */ + writer?: REPLWriter | undefined; + /** + * An optional function used for custom Tab auto completion. + * + * @see https://nodejs.org/dist/latest-v20.x/docs/api/readline.html#readline_use_of_the_completer_function + */ + completer?: Completer | AsyncCompleter | undefined; + /** + * A flag that specifies whether the default evaluator executes all JavaScript commands in + * strict mode or default (sloppy) mode. + * Accepted values are: + * - `repl.REPL_MODE_SLOPPY` - evaluates expressions in sloppy mode. + * - `repl.REPL_MODE_STRICT` - evaluates expressions in strict mode. This is equivalent to + * prefacing every repl statement with `'use strict'`. + */ + replMode?: typeof REPL_MODE_SLOPPY | typeof REPL_MODE_STRICT | undefined; + /** + * Stop evaluating the current piece of code when `SIGINT` is received, i.e. `Ctrl+C` is + * pressed. This cannot be used together with a custom `eval` function. + * Default: `false`. + */ + breakEvalOnSigint?: boolean | undefined; + } + type REPLEval = (this: REPLServer, evalCmd: string, context: Context, file: string, cb: (err: Error | null, result: any) => void) => void; + type REPLWriter = (this: REPLServer, obj: any) => string; + /** + * This is the default "writer" value, if none is passed in the REPL options, + * and it can be overridden by custom print functions. + */ + const writer: REPLWriter & { + options: InspectOptions; + }; + type REPLCommandAction = (this: REPLServer, text: string) => void; + interface REPLCommand { + /** + * Help text to be displayed when `.help` is entered. + */ + help?: string | undefined; + /** + * The function to execute, optionally accepting a single string argument. + */ + action: REPLCommandAction; + } + /** + * Instances of `repl.REPLServer` are created using the {@link start} method + * or directly using the JavaScript `new` keyword. + * + * ```js + * const repl = require('node:repl'); + * + * const options = { useColors: true }; + * + * const firstInstance = repl.start(options); + * const secondInstance = new repl.REPLServer(options); + * ``` + * @since v0.1.91 + */ + class REPLServer extends Interface { + /** + * The `vm.Context` provided to the `eval` function to be used for JavaScript + * evaluation. + */ + readonly context: Context; + /** + * @deprecated since v14.3.0 - Use `input` instead. + */ + readonly inputStream: NodeJS.ReadableStream; + /** + * @deprecated since v14.3.0 - Use `output` instead. + */ + readonly outputStream: NodeJS.WritableStream; + /** + * The `Readable` stream from which REPL input will be read. + */ + readonly input: NodeJS.ReadableStream; + /** + * The `Writable` stream to which REPL output will be written. + */ + readonly output: NodeJS.WritableStream; + /** + * The commands registered via `replServer.defineCommand()`. + */ + readonly commands: NodeJS.ReadOnlyDict; + /** + * A value indicating whether the REPL is currently in "editor mode". + * + * @see https://nodejs.org/dist/latest-v20.x/docs/api/repl.html#repl_commands_and_special_keys + */ + readonly editorMode: boolean; + /** + * A value indicating whether the `_` variable has been assigned. + * + * @see https://nodejs.org/dist/latest-v20.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable + */ + readonly underscoreAssigned: boolean; + /** + * The last evaluation result from the REPL (assigned to the `_` variable inside of the REPL). + * + * @see https://nodejs.org/dist/latest-v20.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable + */ + readonly last: any; + /** + * A value indicating whether the `_error` variable has been assigned. + * + * @since v9.8.0 + * @see https://nodejs.org/dist/latest-v20.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable + */ + readonly underscoreErrAssigned: boolean; + /** + * The last error raised inside the REPL (assigned to the `_error` variable inside of the REPL). + * + * @since v9.8.0 + * @see https://nodejs.org/dist/latest-v20.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable + */ + readonly lastError: any; + /** + * Specified in the REPL options, this is the function to be used when evaluating each + * given line of input. If not specified in the REPL options, this is an async wrapper + * for the JavaScript `eval()` function. + */ + readonly eval: REPLEval; + /** + * Specified in the REPL options, this is a value indicating whether the default + * `writer` function should include ANSI color styling to REPL output. + */ + readonly useColors: boolean; + /** + * Specified in the REPL options, this is a value indicating whether the default `eval` + * function will use the JavaScript `global` as the context as opposed to creating a new + * separate context for the REPL instance. + */ + readonly useGlobal: boolean; + /** + * Specified in the REPL options, this is a value indicating whether the default `writer` + * function should output the result of a command if it evaluates to `undefined`. + */ + readonly ignoreUndefined: boolean; + /** + * Specified in the REPL options, this is the function to invoke to format the output of + * each command before writing to `outputStream`. If not specified in the REPL options, + * this will be a wrapper for `util.inspect`. + */ + readonly writer: REPLWriter; + /** + * Specified in the REPL options, this is the function to use for custom Tab auto-completion. + */ + readonly completer: Completer | AsyncCompleter; + /** + * Specified in the REPL options, this is a flag that specifies whether the default `eval` + * function should execute all JavaScript commands in strict mode or default (sloppy) mode. + * Possible values are: + * - `repl.REPL_MODE_SLOPPY` - evaluates expressions in sloppy mode. + * - `repl.REPL_MODE_STRICT` - evaluates expressions in strict mode. This is equivalent to + * prefacing every repl statement with `'use strict'`. + */ + readonly replMode: typeof REPL_MODE_SLOPPY | typeof REPL_MODE_STRICT; + /** + * NOTE: According to the documentation: + * + * > Instances of `repl.REPLServer` are created using the `repl.start()` method and + * > _should not_ be created directly using the JavaScript `new` keyword. + * + * `REPLServer` cannot be subclassed due to implementation specifics in NodeJS. + * + * @see https://nodejs.org/dist/latest-v20.x/docs/api/repl.html#repl_class_replserver + */ + private constructor(); + /** + * The `replServer.defineCommand()` method is used to add new `.`\-prefixed commands + * to the REPL instance. Such commands are invoked by typing a `.` followed by the`keyword`. The `cmd` is either a `Function` or an `Object` with the following + * properties: + * + * The following example shows two new commands added to the REPL instance: + * + * ```js + * const repl = require('node:repl'); + * + * const replServer = repl.start({ prompt: '> ' }); + * replServer.defineCommand('sayhello', { + * help: 'Say hello', + * action(name) { + * this.clearBufferedCommand(); + * console.log(`Hello, ${name}!`); + * this.displayPrompt(); + * }, + * }); + * replServer.defineCommand('saybye', function saybye() { + * console.log('Goodbye!'); + * this.close(); + * }); + * ``` + * + * The new commands can then be used from within the REPL instance: + * + * ```console + * > .sayhello Node.js User + * Hello, Node.js User! + * > .saybye + * Goodbye! + * ``` + * @since v0.3.0 + * @param keyword The command keyword (_without_ a leading `.` character). + * @param cmd The function to invoke when the command is processed. + */ + defineCommand(keyword: string, cmd: REPLCommandAction | REPLCommand): void; + /** + * The `replServer.displayPrompt()` method readies the REPL instance for input + * from the user, printing the configured `prompt` to a new line in the `output`and resuming the `input` to accept new input. + * + * When multi-line input is being entered, an ellipsis is printed rather than the + * 'prompt'. + * + * When `preserveCursor` is `true`, the cursor placement will not be reset to `0`. + * + * The `replServer.displayPrompt` method is primarily intended to be called from + * within the action function for commands registered using the`replServer.defineCommand()` method. + * @since v0.1.91 + */ + displayPrompt(preserveCursor?: boolean): void; + /** + * The `replServer.clearBufferedCommand()` method clears any command that has been + * buffered but not yet executed. This method is primarily intended to be + * called from within the action function for commands registered using the`replServer.defineCommand()` method. + * @since v9.0.0 + */ + clearBufferedCommand(): void; + /** + * Initializes a history log file for the REPL instance. When executing the + * Node.js binary and using the command-line REPL, a history file is initialized + * by default. However, this is not the case when creating a REPL + * programmatically. Use this method to initialize a history log file when working + * with REPL instances programmatically. + * @since v11.10.0 + * @param historyPath the path to the history file + * @param callback called when history writes are ready or upon error + */ + setupHistory(path: string, callback: (err: Error | null, repl: this) => void): void; + /** + * events.EventEmitter + * 1. close - inherited from `readline.Interface` + * 2. line - inherited from `readline.Interface` + * 3. pause - inherited from `readline.Interface` + * 4. resume - inherited from `readline.Interface` + * 5. SIGCONT - inherited from `readline.Interface` + * 6. SIGINT - inherited from `readline.Interface` + * 7. SIGTSTP - inherited from `readline.Interface` + * 8. exit + * 9. reset + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: 'close', listener: () => void): this; + addListener(event: 'line', listener: (input: string) => void): this; + addListener(event: 'pause', listener: () => void): this; + addListener(event: 'resume', listener: () => void): this; + addListener(event: 'SIGCONT', listener: () => void): this; + addListener(event: 'SIGINT', listener: () => void): this; + addListener(event: 'SIGTSTP', listener: () => void): this; + addListener(event: 'exit', listener: () => void): this; + addListener(event: 'reset', listener: (context: Context) => void): this; + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: 'close'): boolean; + emit(event: 'line', input: string): boolean; + emit(event: 'pause'): boolean; + emit(event: 'resume'): boolean; + emit(event: 'SIGCONT'): boolean; + emit(event: 'SIGINT'): boolean; + emit(event: 'SIGTSTP'): boolean; + emit(event: 'exit'): boolean; + emit(event: 'reset', context: Context): boolean; + on(event: string, listener: (...args: any[]) => void): this; + on(event: 'close', listener: () => void): this; + on(event: 'line', listener: (input: string) => void): this; + on(event: 'pause', listener: () => void): this; + on(event: 'resume', listener: () => void): this; + on(event: 'SIGCONT', listener: () => void): this; + on(event: 'SIGINT', listener: () => void): this; + on(event: 'SIGTSTP', listener: () => void): this; + on(event: 'exit', listener: () => void): this; + on(event: 'reset', listener: (context: Context) => void): this; + once(event: string, listener: (...args: any[]) => void): this; + once(event: 'close', listener: () => void): this; + once(event: 'line', listener: (input: string) => void): this; + once(event: 'pause', listener: () => void): this; + once(event: 'resume', listener: () => void): this; + once(event: 'SIGCONT', listener: () => void): this; + once(event: 'SIGINT', listener: () => void): this; + once(event: 'SIGTSTP', listener: () => void): this; + once(event: 'exit', listener: () => void): this; + once(event: 'reset', listener: (context: Context) => void): this; + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: 'close', listener: () => void): this; + prependListener(event: 'line', listener: (input: string) => void): this; + prependListener(event: 'pause', listener: () => void): this; + prependListener(event: 'resume', listener: () => void): this; + prependListener(event: 'SIGCONT', listener: () => void): this; + prependListener(event: 'SIGINT', listener: () => void): this; + prependListener(event: 'SIGTSTP', listener: () => void): this; + prependListener(event: 'exit', listener: () => void): this; + prependListener(event: 'reset', listener: (context: Context) => void): this; + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'close', listener: () => void): this; + prependOnceListener(event: 'line', listener: (input: string) => void): this; + prependOnceListener(event: 'pause', listener: () => void): this; + prependOnceListener(event: 'resume', listener: () => void): this; + prependOnceListener(event: 'SIGCONT', listener: () => void): this; + prependOnceListener(event: 'SIGINT', listener: () => void): this; + prependOnceListener(event: 'SIGTSTP', listener: () => void): this; + prependOnceListener(event: 'exit', listener: () => void): this; + prependOnceListener(event: 'reset', listener: (context: Context) => void): this; + } + /** + * A flag passed in the REPL options. Evaluates expressions in sloppy mode. + */ + const REPL_MODE_SLOPPY: unique symbol; + /** + * A flag passed in the REPL options. Evaluates expressions in strict mode. + * This is equivalent to prefacing every repl statement with `'use strict'`. + */ + const REPL_MODE_STRICT: unique symbol; + /** + * The `repl.start()` method creates and starts a {@link REPLServer} instance. + * + * If `options` is a string, then it specifies the input prompt: + * + * ```js + * const repl = require('node:repl'); + * + * // a Unix style prompt + * repl.start('$ '); + * ``` + * @since v0.1.91 + */ + function start(options?: string | ReplOptions): REPLServer; + /** + * Indicates a recoverable error that a `REPLServer` can use to support multi-line input. + * + * @see https://nodejs.org/dist/latest-v20.x/docs/api/repl.html#repl_recoverable_errors + */ + class Recoverable extends SyntaxError { + err: Error; + constructor(err: Error); + } +} +declare module 'repl' { + export * from 'node:repl'; +} diff --git a/node_modules/@types/node/stream.d.ts b/node_modules/@types/node/stream.d.ts new file mode 100644 index 0000000..50127ad --- /dev/null +++ b/node_modules/@types/node/stream.d.ts @@ -0,0 +1,1568 @@ +/** + * A stream is an abstract interface for working with streaming data in Node.js. + * The `node:stream` module provides an API for implementing the stream interface. + * + * There are many stream objects provided by Node.js. For instance, a `request to an HTTP server` and `process.stdout` are both stream instances. + * + * Streams can be readable, writable, or both. All streams are instances of `EventEmitter`. + * + * To access the `node:stream` module: + * + * ```js + * const stream = require('node:stream'); + * ``` + * + * The `node:stream` module is useful for creating new types of stream instances. + * It is usually not necessary to use the `node:stream` module to consume streams. + * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/stream.js) + */ +declare module 'node:stream' { + import { EventEmitter, Abortable } from 'node:events'; + import { Blob as NodeBlob } from 'node:buffer'; + import * as streamPromises from 'node:stream/promises'; + import * as streamConsumers from 'node:stream/consumers'; + import * as streamWeb from 'node:stream/web'; + + type ComposeFnParam = (source: any) => void; + + class internal extends EventEmitter { + pipe( + destination: T, + options?: { + end?: boolean | undefined; + } + ): T; + compose(stream: T | ComposeFnParam | Iterable | AsyncIterable, options?: { signal: AbortSignal }): T; + } + import Stream = internal.Stream; + import Readable = internal.Readable; + import ReadableOptions = internal.ReadableOptions; + interface ArrayOptions { + /** the maximum concurrent invocations of `fn` to call on the stream at once. **Default: 1**. */ + concurrency?: number; + /** allows destroying the stream if the signal is aborted. */ + signal?: AbortSignal; + } + class ReadableBase extends Stream implements NodeJS.ReadableStream { + /** + * A utility method for creating Readable Streams out of iterators. + */ + static from(iterable: Iterable | AsyncIterable, options?: ReadableOptions): Readable; + /** + * Returns whether the stream has been read from or cancelled. + * @since v16.8.0 + */ + static isDisturbed(stream: Readable | NodeJS.ReadableStream): boolean; + /** + * Returns whether the stream was destroyed or errored before emitting `'end'`. + * @since v16.8.0 + * @experimental + */ + readonly readableAborted: boolean; + /** + * Is `true` if it is safe to call `readable.read()`, which means + * the stream has not been destroyed or emitted `'error'` or `'end'`. + * @since v11.4.0 + */ + readable: boolean; + /** + * Returns whether `'data'` has been emitted. + * @since v16.7.0, v14.18.0 + * @experimental + */ + readonly readableDidRead: boolean; + /** + * Getter for the property `encoding` of a given `Readable` stream. The `encoding`property can be set using the `readable.setEncoding()` method. + * @since v12.7.0 + */ + readonly readableEncoding: BufferEncoding | null; + /** + * Becomes `true` when `'end'` event is emitted. + * @since v12.9.0 + */ + readonly readableEnded: boolean; + /** + * This property reflects the current state of a `Readable` stream as described + * in the `Three states` section. + * @since v9.4.0 + */ + readonly readableFlowing: boolean | null; + /** + * Returns the value of `highWaterMark` passed when creating this `Readable`. + * @since v9.3.0 + */ + readonly readableHighWaterMark: number; + /** + * This property contains the number of bytes (or objects) in the queue + * ready to be read. The value provides introspection data regarding + * the status of the `highWaterMark`. + * @since v9.4.0 + */ + readonly readableLength: number; + /** + * Getter for the property `objectMode` of a given `Readable` stream. + * @since v12.3.0 + */ + readonly readableObjectMode: boolean; + /** + * Is `true` after `readable.destroy()` has been called. + * @since v8.0.0 + */ + destroyed: boolean; + /** + * Is `true` after `'close'` has been emitted. + * @since v18.0.0 + */ + readonly closed: boolean; + /** + * Returns error if the stream has been destroyed with an error. + * @since v18.0.0 + */ + readonly errored: Error | null; + constructor(opts?: ReadableOptions); + _construct?(callback: (error?: Error | null) => void): void; + _read(size: number): void; + /** + * The `readable.read()` method reads data out of the internal buffer and + * returns it. If no data is available to be read, `null` is returned. By default, + * the data is returned as a `Buffer` object unless an encoding has been + * specified using the `readable.setEncoding()` method or the stream is operating + * in object mode. + * + * The optional `size` argument specifies a specific number of bytes to read. If`size` bytes are not available to be read, `null` will be returned _unless_the stream has ended, in which + * case all of the data remaining in the internal + * buffer will be returned. + * + * If the `size` argument is not specified, all of the data contained in the + * internal buffer will be returned. + * + * The `size` argument must be less than or equal to 1 GiB. + * + * The `readable.read()` method should only be called on `Readable` streams + * operating in paused mode. In flowing mode, `readable.read()` is called + * automatically until the internal buffer is fully drained. + * + * ```js + * const readable = getReadableStreamSomehow(); + * + * // 'readable' may be triggered multiple times as data is buffered in + * readable.on('readable', () => { + * let chunk; + * console.log('Stream is readable (new data received in buffer)'); + * // Use a loop to make sure we read all currently available data + * while (null !== (chunk = readable.read())) { + * console.log(`Read ${chunk.length} bytes of data...`); + * } + * }); + * + * // 'end' will be triggered once when there is no more data available + * readable.on('end', () => { + * console.log('Reached end of stream.'); + * }); + * ``` + * + * Each call to `readable.read()` returns a chunk of data, or `null`. The chunks + * are not concatenated. A `while` loop is necessary to consume all data + * currently in the buffer. When reading a large file `.read()` may return `null`, + * having consumed all buffered content so far, but there is still more data to + * come not yet buffered. In this case a new `'readable'` event will be emitted + * when there is more data in the buffer. Finally the `'end'` event will be + * emitted when there is no more data to come. + * + * Therefore to read a file's whole contents from a `readable`, it is necessary + * to collect chunks across multiple `'readable'` events: + * + * ```js + * const chunks = []; + * + * readable.on('readable', () => { + * let chunk; + * while (null !== (chunk = readable.read())) { + * chunks.push(chunk); + * } + * }); + * + * readable.on('end', () => { + * const content = chunks.join(''); + * }); + * ``` + * + * A `Readable` stream in object mode will always return a single item from + * a call to `readable.read(size)`, regardless of the value of the`size` argument. + * + * If the `readable.read()` method returns a chunk of data, a `'data'` event will + * also be emitted. + * + * Calling {@link read} after the `'end'` event has + * been emitted will return `null`. No runtime error will be raised. + * @since v0.9.4 + * @param size Optional argument to specify how much data to read. + */ + read(size?: number): any; + /** + * The `readable.setEncoding()` method sets the character encoding for + * data read from the `Readable` stream. + * + * By default, no encoding is assigned and stream data will be returned as`Buffer` objects. Setting an encoding causes the stream data + * to be returned as strings of the specified encoding rather than as `Buffer`objects. For instance, calling `readable.setEncoding('utf8')` will cause the + * output data to be interpreted as UTF-8 data, and passed as strings. Calling`readable.setEncoding('hex')` will cause the data to be encoded in hexadecimal + * string format. + * + * The `Readable` stream will properly handle multi-byte characters delivered + * through the stream that would otherwise become improperly decoded if simply + * pulled from the stream as `Buffer` objects. + * + * ```js + * const readable = getReadableStreamSomehow(); + * readable.setEncoding('utf8'); + * readable.on('data', (chunk) => { + * assert.equal(typeof chunk, 'string'); + * console.log('Got %d characters of string data:', chunk.length); + * }); + * ``` + * @since v0.9.4 + * @param encoding The encoding to use. + */ + setEncoding(encoding: BufferEncoding): this; + /** + * The `readable.pause()` method will cause a stream in flowing mode to stop + * emitting `'data'` events, switching out of flowing mode. Any data that + * becomes available will remain in the internal buffer. + * + * ```js + * const readable = getReadableStreamSomehow(); + * readable.on('data', (chunk) => { + * console.log(`Received ${chunk.length} bytes of data.`); + * readable.pause(); + * console.log('There will be no additional data for 1 second.'); + * setTimeout(() => { + * console.log('Now data will start flowing again.'); + * readable.resume(); + * }, 1000); + * }); + * ``` + * + * The `readable.pause()` method has no effect if there is a `'readable'`event listener. + * @since v0.9.4 + */ + pause(): this; + /** + * The `readable.resume()` method causes an explicitly paused `Readable` stream to + * resume emitting `'data'` events, switching the stream into flowing mode. + * + * The `readable.resume()` method can be used to fully consume the data from a + * stream without actually processing any of that data: + * + * ```js + * getReadableStreamSomehow() + * .resume() + * .on('end', () => { + * console.log('Reached the end, but did not read anything.'); + * }); + * ``` + * + * The `readable.resume()` method has no effect if there is a `'readable'`event listener. + * @since v0.9.4 + */ + resume(): this; + /** + * The `readable.isPaused()` method returns the current operating state of the`Readable`. This is used primarily by the mechanism that underlies the`readable.pipe()` method. In most + * typical cases, there will be no reason to + * use this method directly. + * + * ```js + * const readable = new stream.Readable(); + * + * readable.isPaused(); // === false + * readable.pause(); + * readable.isPaused(); // === true + * readable.resume(); + * readable.isPaused(); // === false + * ``` + * @since v0.11.14 + */ + isPaused(): boolean; + /** + * The `readable.unpipe()` method detaches a `Writable` stream previously attached + * using the {@link pipe} method. + * + * If the `destination` is not specified, then _all_ pipes are detached. + * + * If the `destination` is specified, but no pipe is set up for it, then + * the method does nothing. + * + * ```js + * const fs = require('node:fs'); + * const readable = getReadableStreamSomehow(); + * const writable = fs.createWriteStream('file.txt'); + * // All the data from readable goes into 'file.txt', + * // but only for the first second. + * readable.pipe(writable); + * setTimeout(() => { + * console.log('Stop writing to file.txt.'); + * readable.unpipe(writable); + * console.log('Manually close the file stream.'); + * writable.end(); + * }, 1000); + * ``` + * @since v0.9.4 + * @param destination Optional specific stream to unpipe + */ + unpipe(destination?: NodeJS.WritableStream): this; + /** + * Passing `chunk` as `null` signals the end of the stream (EOF) and behaves the + * same as `readable.push(null)`, after which no more data can be written. The EOF + * signal is put at the end of the buffer and any buffered data will still be + * flushed. + * + * The `readable.unshift()` method pushes a chunk of data back into the internal + * buffer. This is useful in certain situations where a stream is being consumed by + * code that needs to "un-consume" some amount of data that it has optimistically + * pulled out of the source, so that the data can be passed on to some other party. + * + * The `stream.unshift(chunk)` method cannot be called after the `'end'` event + * has been emitted or a runtime error will be thrown. + * + * Developers using `stream.unshift()` often should consider switching to + * use of a `Transform` stream instead. See the `API for stream implementers` section for more information. + * + * ```js + * // Pull off a header delimited by \n\n. + * // Use unshift() if we get too much. + * // Call the callback with (error, header, stream). + * const { StringDecoder } = require('node:string_decoder'); + * function parseHeader(stream, callback) { + * stream.on('error', callback); + * stream.on('readable', onReadable); + * const decoder = new StringDecoder('utf8'); + * let header = ''; + * function onReadable() { + * let chunk; + * while (null !== (chunk = stream.read())) { + * const str = decoder.write(chunk); + * if (str.includes('\n\n')) { + * // Found the header boundary. + * const split = str.split(/\n\n/); + * header += split.shift(); + * const remaining = split.join('\n\n'); + * const buf = Buffer.from(remaining, 'utf8'); + * stream.removeListener('error', callback); + * // Remove the 'readable' listener before unshifting. + * stream.removeListener('readable', onReadable); + * if (buf.length) + * stream.unshift(buf); + * // Now the body of the message can be read from the stream. + * callback(null, header, stream); + * return; + * } + * // Still reading the header. + * header += str; + * } + * } + * } + * ``` + * + * Unlike {@link push}, `stream.unshift(chunk)` will not + * end the reading process by resetting the internal reading state of the stream. + * This can cause unexpected results if `readable.unshift()` is called during a + * read (i.e. from within a {@link _read} implementation on a + * custom stream). Following the call to `readable.unshift()` with an immediate {@link push} will reset the reading state appropriately, + * however it is best to simply avoid calling `readable.unshift()` while in the + * process of performing a read. + * @since v0.9.11 + * @param chunk Chunk of data to unshift onto the read queue. For streams not operating in object mode, `chunk` must be a string, `Buffer`, `Uint8Array`, or `null`. For object mode + * streams, `chunk` may be any JavaScript value. + * @param encoding Encoding of string chunks. Must be a valid `Buffer` encoding, such as `'utf8'` or `'ascii'`. + */ + unshift(chunk: any, encoding?: BufferEncoding): void; + /** + * Prior to Node.js 0.10, streams did not implement the entire `node:stream`module API as it is currently defined. (See `Compatibility` for more + * information.) + * + * When using an older Node.js library that emits `'data'` events and has a {@link pause} method that is advisory only, the`readable.wrap()` method can be used to create a `Readable` + * stream that uses + * the old stream as its data source. + * + * It will rarely be necessary to use `readable.wrap()` but the method has been + * provided as a convenience for interacting with older Node.js applications and + * libraries. + * + * ```js + * const { OldReader } = require('./old-api-module.js'); + * const { Readable } = require('node:stream'); + * const oreader = new OldReader(); + * const myReader = new Readable().wrap(oreader); + * + * myReader.on('readable', () => { + * myReader.read(); // etc. + * }); + * ``` + * @since v0.9.4 + * @param stream An "old style" readable stream + */ + wrap(stream: NodeJS.ReadableStream): this; + push(chunk: any, encoding?: BufferEncoding): boolean; + /** + * The iterator created by this method gives users the option to cancel the destruction + * of the stream if the `for await...of` loop is exited by `return`, `break`, or `throw`, + * or if the iterator should destroy the stream if the stream emitted an error during iteration. + * @since v16.3.0 + * @param options.destroyOnReturn When set to `false`, calling `return` on the async iterator, + * or exiting a `for await...of` iteration using a `break`, `return`, or `throw` will not destroy the stream. + * **Default: `true`**. + */ + iterator(options?: {destroyOnReturn?: boolean}): AsyncIterableIterator; + /** + * This method allows mapping over the stream. The *fn* function will be called for every chunk in the stream. + * If the *fn* function returns a promise - that promise will be `await`ed before being passed to the result stream. + * @since v17.4.0, v16.14.0 + * @param fn a function to map over every chunk in the stream. Async or not. + * @returns a stream mapped with the function *fn*. + */ + map(fn: (data: any, options?: Pick) => any, options?: ArrayOptions): Readable; + /** + * This method allows filtering the stream. For each chunk in the stream the *fn* function will be called + * and if it returns a truthy value, the chunk will be passed to the result stream. + * If the *fn* function returns a promise - that promise will be `await`ed. + * @since v17.4.0, v16.14.0 + * @param fn a function to filter chunks from the stream. Async or not. + * @returns a stream filtered with the predicate *fn*. + */ + filter(fn: (data: any, options?: Pick) => boolean | Promise, options?: ArrayOptions): Readable; + /** + * This method allows iterating a stream. For each chunk in the stream the *fn* function will be called. + * If the *fn* function returns a promise - that promise will be `await`ed. + * + * This method is different from `for await...of` loops in that it can optionally process chunks concurrently. + * In addition, a `forEach` iteration can only be stopped by having passed a `signal` option + * and aborting the related AbortController while `for await...of` can be stopped with `break` or `return`. + * In either case the stream will be destroyed. + * + * This method is different from listening to the `'data'` event in that it uses the `readable` event + * in the underlying machinary and can limit the number of concurrent *fn* calls. + * @since v17.5.0 + * @param fn a function to call on each chunk of the stream. Async or not. + * @returns a promise for when the stream has finished. + */ + forEach(fn: (data: any, options?: Pick) => void | Promise, options?: ArrayOptions): Promise; + /** + * This method allows easily obtaining the contents of a stream. + * + * As this method reads the entire stream into memory, it negates the benefits of streams. It's intended + * for interoperability and convenience, not as the primary way to consume streams. + * @since v17.5.0 + * @returns a promise containing an array with the contents of the stream. + */ + toArray(options?: Pick): Promise; + /** + * This method is similar to `Array.prototype.some` and calls *fn* on each chunk in the stream + * until the awaited return value is `true` (or any truthy value). Once an *fn* call on a chunk + * `await`ed return value is truthy, the stream is destroyed and the promise is fulfilled with `true`. + * If none of the *fn* calls on the chunks return a truthy value, the promise is fulfilled with `false`. + * @since v17.5.0 + * @param fn a function to call on each chunk of the stream. Async or not. + * @returns a promise evaluating to `true` if *fn* returned a truthy value for at least one of the chunks. + */ + some(fn: (data: any, options?: Pick) => boolean | Promise, options?: ArrayOptions): Promise; + /** + * This method is similar to `Array.prototype.find` and calls *fn* on each chunk in the stream + * to find a chunk with a truthy value for *fn*. Once an *fn* call's awaited return value is truthy, + * the stream is destroyed and the promise is fulfilled with value for which *fn* returned a truthy value. + * If all of the *fn* calls on the chunks return a falsy value, the promise is fulfilled with `undefined`. + * @since v17.5.0 + * @param fn a function to call on each chunk of the stream. Async or not. + * @returns a promise evaluating to the first chunk for which *fn* evaluated with a truthy value, + * or `undefined` if no element was found. + */ + find(fn: (data: any, options?: Pick) => data is T, options?: ArrayOptions): Promise; + find(fn: (data: any, options?: Pick) => boolean | Promise, options?: ArrayOptions): Promise; + /** + * This method is similar to `Array.prototype.every` and calls *fn* on each chunk in the stream + * to check if all awaited return values are truthy value for *fn*. Once an *fn* call on a chunk + * `await`ed return value is falsy, the stream is destroyed and the promise is fulfilled with `false`. + * If all of the *fn* calls on the chunks return a truthy value, the promise is fulfilled with `true`. + * @since v17.5.0 + * @param fn a function to call on each chunk of the stream. Async or not. + * @returns a promise evaluating to `true` if *fn* returned a truthy value for every one of the chunks. + */ + every(fn: (data: any, options?: Pick) => boolean | Promise, options?: ArrayOptions): Promise; + /** + * This method returns a new stream by applying the given callback to each chunk of the stream + * and then flattening the result. + * + * It is possible to return a stream or another iterable or async iterable from *fn* and the result streams + * will be merged (flattened) into the returned stream. + * @since v17.5.0 + * @param fn a function to map over every chunk in the stream. May be async. May be a stream or generator. + * @returns a stream flat-mapped with the function *fn*. + */ + flatMap(fn: (data: any, options?: Pick) => any, options?: ArrayOptions): Readable; + /** + * This method returns a new stream with the first *limit* chunks dropped from the start. + * @since v17.5.0 + * @param limit the number of chunks to drop from the readable. + * @returns a stream with *limit* chunks dropped from the start. + */ + drop(limit: number, options?: Pick): Readable; + /** + * This method returns a new stream with the first *limit* chunks. + * @since v17.5.0 + * @param limit the number of chunks to take from the readable. + * @returns a stream with *limit* chunks taken. + */ + take(limit: number, options?: Pick): Readable; + /** + * This method returns a new stream with chunks of the underlying stream paired with a counter + * in the form `[index, chunk]`. The first index value is `0` and it increases by 1 for each chunk produced. + * @since v17.5.0 + * @returns a stream of indexed pairs. + */ + asIndexedPairs(options?: Pick): Readable; + /** + * This method calls *fn* on each chunk of the stream in order, passing it the result from the calculation + * on the previous element. It returns a promise for the final value of the reduction. + * + * If no *initial* value is supplied the first chunk of the stream is used as the initial value. + * If the stream is empty, the promise is rejected with a `TypeError` with the `ERR_INVALID_ARGS` code property. + * + * The reducer function iterates the stream element-by-element which means that there is no *concurrency* parameter + * or parallelism. To perform a reduce concurrently, you can extract the async function to `readable.map` method. + * @since v17.5.0 + * @param fn a reducer function to call over every chunk in the stream. Async or not. + * @param initial the initial value to use in the reduction. + * @returns a promise for the final value of the reduction. + */ + reduce(fn: (previous: any, data: any, options?: Pick) => T, initial?: undefined, options?: Pick): Promise; + reduce(fn: (previous: T, data: any, options?: Pick) => T, initial: T, options?: Pick): Promise; + _destroy(error: Error | null, callback: (error?: Error | null) => void): void; + /** + * Destroy the stream. Optionally emit an `'error'` event, and emit a `'close'`event (unless `emitClose` is set to `false`). After this call, the readable + * stream will release any internal resources and subsequent calls to `push()`will be ignored. + * + * Once `destroy()` has been called any further calls will be a no-op and no + * further errors except from `_destroy()` may be emitted as `'error'`. + * + * Implementors should not override this method, but instead implement `readable._destroy()`. + * @since v8.0.0 + * @param error Error which will be passed as payload in `'error'` event + */ + destroy(error?: Error): this; + /** + * Event emitter + * The defined events on documents including: + * 1. close + * 2. data + * 3. end + * 4. error + * 5. pause + * 6. readable + * 7. resume + */ + addListener(event: 'close', listener: () => void): this; + addListener(event: 'data', listener: (chunk: any) => void): this; + addListener(event: 'end', listener: () => void): this; + addListener(event: 'error', listener: (err: Error) => void): this; + addListener(event: 'pause', listener: () => void): this; + addListener(event: 'readable', listener: () => void): this; + addListener(event: 'resume', listener: () => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + emit(event: 'close'): boolean; + emit(event: 'data', chunk: any): boolean; + emit(event: 'end'): boolean; + emit(event: 'error', err: Error): boolean; + emit(event: 'pause'): boolean; + emit(event: 'readable'): boolean; + emit(event: 'resume'): boolean; + emit(event: string | symbol, ...args: any[]): boolean; + on(event: 'close', listener: () => void): this; + on(event: 'data', listener: (chunk: any) => void): this; + on(event: 'end', listener: () => void): this; + on(event: 'error', listener: (err: Error) => void): this; + on(event: 'pause', listener: () => void): this; + on(event: 'readable', listener: () => void): this; + on(event: 'resume', listener: () => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + once(event: 'close', listener: () => void): this; + once(event: 'data', listener: (chunk: any) => void): this; + once(event: 'end', listener: () => void): this; + once(event: 'error', listener: (err: Error) => void): this; + once(event: 'pause', listener: () => void): this; + once(event: 'readable', listener: () => void): this; + once(event: 'resume', listener: () => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + prependListener(event: 'close', listener: () => void): this; + prependListener(event: 'data', listener: (chunk: any) => void): this; + prependListener(event: 'end', listener: () => void): this; + prependListener(event: 'error', listener: (err: Error) => void): this; + prependListener(event: 'pause', listener: () => void): this; + prependListener(event: 'readable', listener: () => void): this; + prependListener(event: 'resume', listener: () => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'close', listener: () => void): this; + prependOnceListener(event: 'data', listener: (chunk: any) => void): this; + prependOnceListener(event: 'end', listener: () => void): this; + prependOnceListener(event: 'error', listener: (err: Error) => void): this; + prependOnceListener(event: 'pause', listener: () => void): this; + prependOnceListener(event: 'readable', listener: () => void): this; + prependOnceListener(event: 'resume', listener: () => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + removeListener(event: 'close', listener: () => void): this; + removeListener(event: 'data', listener: (chunk: any) => void): this; + removeListener(event: 'end', listener: () => void): this; + removeListener(event: 'error', listener: (err: Error) => void): this; + removeListener(event: 'pause', listener: () => void): this; + removeListener(event: 'readable', listener: () => void): this; + removeListener(event: 'resume', listener: () => void): this; + removeListener(event: string | symbol, listener: (...args: any[]) => void): this; + [Symbol.asyncIterator](): AsyncIterableIterator; + /** + * Calls `readable.destroy()` with an `AbortError` and returns a promise that fulfills when the stream is finished. + * @since v20.4.0 + */ + [Symbol.asyncDispose](): Promise; + } + import WritableOptions = internal.WritableOptions; + class WritableBase extends Stream implements NodeJS.WritableStream { + /** + * Is `true` if it is safe to call `writable.write()`, which means + * the stream has not been destroyed, errored, or ended. + * @since v11.4.0 + */ + readonly writable: boolean; + /** + * Is `true` after `writable.end()` has been called. This property + * does not indicate whether the data has been flushed, for this use `writable.writableFinished` instead. + * @since v12.9.0 + */ + readonly writableEnded: boolean; + /** + * Is set to `true` immediately before the `'finish'` event is emitted. + * @since v12.6.0 + */ + readonly writableFinished: boolean; + /** + * Return the value of `highWaterMark` passed when creating this `Writable`. + * @since v9.3.0 + */ + readonly writableHighWaterMark: number; + /** + * This property contains the number of bytes (or objects) in the queue + * ready to be written. The value provides introspection data regarding + * the status of the `highWaterMark`. + * @since v9.4.0 + */ + readonly writableLength: number; + /** + * Getter for the property `objectMode` of a given `Writable` stream. + * @since v12.3.0 + */ + readonly writableObjectMode: boolean; + /** + * Number of times `writable.uncork()` needs to be + * called in order to fully uncork the stream. + * @since v13.2.0, v12.16.0 + */ + readonly writableCorked: number; + /** + * Is `true` after `writable.destroy()` has been called. + * @since v8.0.0 + */ + destroyed: boolean; + /** + * Is `true` after `'close'` has been emitted. + * @since v18.0.0 + */ + readonly closed: boolean; + /** + * Returns error if the stream has been destroyed with an error. + * @since v18.0.0 + */ + readonly errored: Error | null; + /** + * Is `true` if the stream's buffer has been full and stream will emit `'drain'`. + * @since v15.2.0, v14.17.0 + */ + readonly writableNeedDrain: boolean; + constructor(opts?: WritableOptions); + _write(chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void; + _writev?( + chunks: Array<{ + chunk: any; + encoding: BufferEncoding; + }>, + callback: (error?: Error | null) => void + ): void; + _construct?(callback: (error?: Error | null) => void): void; + _destroy(error: Error | null, callback: (error?: Error | null) => void): void; + _final(callback: (error?: Error | null) => void): void; + /** + * The `writable.write()` method writes some data to the stream, and calls the + * supplied `callback` once the data has been fully handled. If an error + * occurs, the `callback` will be called with the error as its + * first argument. The `callback` is called asynchronously and before `'error'` is + * emitted. + * + * The return value is `true` if the internal buffer is less than the`highWaterMark` configured when the stream was created after admitting `chunk`. + * If `false` is returned, further attempts to write data to the stream should + * stop until the `'drain'` event is emitted. + * + * While a stream is not draining, calls to `write()` will buffer `chunk`, and + * return false. Once all currently buffered chunks are drained (accepted for + * delivery by the operating system), the `'drain'` event will be emitted. + * Once `write()` returns false, do not write more chunks + * until the `'drain'` event is emitted. While calling `write()` on a stream that + * is not draining is allowed, Node.js will buffer all written chunks until + * maximum memory usage occurs, at which point it will abort unconditionally. + * Even before it aborts, high memory usage will cause poor garbage collector + * performance and high RSS (which is not typically released back to the system, + * even after the memory is no longer required). Since TCP sockets may never + * drain if the remote peer does not read the data, writing a socket that is + * not draining may lead to a remotely exploitable vulnerability. + * + * Writing data while the stream is not draining is particularly + * problematic for a `Transform`, because the `Transform` streams are paused + * by default until they are piped or a `'data'` or `'readable'` event handler + * is added. + * + * If the data to be written can be generated or fetched on demand, it is + * recommended to encapsulate the logic into a `Readable` and use {@link pipe}. However, if calling `write()` is preferred, it is + * possible to respect backpressure and avoid memory issues using the `'drain'` event: + * + * ```js + * function write(data, cb) { + * if (!stream.write(data)) { + * stream.once('drain', cb); + * } else { + * process.nextTick(cb); + * } + * } + * + * // Wait for cb to be called before doing any other write. + * write('hello', () => { + * console.log('Write completed, do more writes now.'); + * }); + * ``` + * + * A `Writable` stream in object mode will always ignore the `encoding` argument. + * @since v0.9.4 + * @param chunk Optional data to write. For streams not operating in object mode, `chunk` must be a string, `Buffer` or `Uint8Array`. For object mode streams, `chunk` may be any + * JavaScript value other than `null`. + * @param [encoding='utf8'] The encoding, if `chunk` is a string. + * @param callback Callback for when this chunk of data is flushed. + * @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. + */ + write(chunk: any, callback?: (error: Error | null | undefined) => void): boolean; + write(chunk: any, encoding: BufferEncoding, callback?: (error: Error | null | undefined) => void): boolean; + /** + * The `writable.setDefaultEncoding()` method sets the default `encoding` for a `Writable` stream. + * @since v0.11.15 + * @param encoding The new default encoding + */ + setDefaultEncoding(encoding: BufferEncoding): this; + /** + * Calling the `writable.end()` method signals that no more data will be written + * to the `Writable`. The optional `chunk` and `encoding` arguments allow one + * final additional chunk of data to be written immediately before closing the + * stream. + * + * Calling the {@link write} method after calling {@link end} will raise an error. + * + * ```js + * // Write 'hello, ' and then end with 'world!'. + * const fs = require('node:fs'); + * const file = fs.createWriteStream('example.txt'); + * file.write('hello, '); + * file.end('world!'); + * // Writing more now is not allowed! + * ``` + * @since v0.9.4 + * @param chunk Optional data to write. For streams not operating in object mode, `chunk` must be a string, `Buffer` or `Uint8Array`. For object mode streams, `chunk` may be any + * JavaScript value other than `null`. + * @param encoding The encoding if `chunk` is a string + * @param callback Callback for when the stream is finished. + */ + end(cb?: () => void): this; + end(chunk: any, cb?: () => void): this; + end(chunk: any, encoding: BufferEncoding, cb?: () => void): this; + /** + * The `writable.cork()` method forces all written data to be buffered in memory. + * The buffered data will be flushed when either the {@link uncork} or {@link end} methods are called. + * + * The primary intent of `writable.cork()` is to accommodate a situation in which + * several small chunks are written to the stream in rapid succession. Instead of + * immediately forwarding them to the underlying destination, `writable.cork()`buffers all the chunks until `writable.uncork()` is called, which will pass them + * all to `writable._writev()`, if present. This prevents a head-of-line blocking + * situation where data is being buffered while waiting for the first small chunk + * to be processed. However, use of `writable.cork()` without implementing`writable._writev()` may have an adverse effect on throughput. + * + * See also: `writable.uncork()`, `writable._writev()`. + * @since v0.11.2 + */ + cork(): void; + /** + * The `writable.uncork()` method flushes all data buffered since {@link cork} was called. + * + * When using `writable.cork()` and `writable.uncork()` to manage the buffering + * of writes to a stream, defer calls to `writable.uncork()` using`process.nextTick()`. Doing so allows batching of all`writable.write()` calls that occur within a given Node.js event + * loop phase. + * + * ```js + * stream.cork(); + * stream.write('some '); + * stream.write('data '); + * process.nextTick(() => stream.uncork()); + * ``` + * + * If the `writable.cork()` method is called multiple times on a stream, the + * same number of calls to `writable.uncork()` must be called to flush the buffered + * data. + * + * ```js + * stream.cork(); + * stream.write('some '); + * stream.cork(); + * stream.write('data '); + * process.nextTick(() => { + * stream.uncork(); + * // The data will not be flushed until uncork() is called a second time. + * stream.uncork(); + * }); + * ``` + * + * See also: `writable.cork()`. + * @since v0.11.2 + */ + uncork(): void; + /** + * Destroy the stream. Optionally emit an `'error'` event, and emit a `'close'`event (unless `emitClose` is set to `false`). After this call, the writable + * stream has ended and subsequent calls to `write()` or `end()` will result in + * an `ERR_STREAM_DESTROYED` error. + * This is a destructive and immediate way to destroy a stream. Previous calls to`write()` may not have drained, and may trigger an `ERR_STREAM_DESTROYED` error. + * Use `end()` instead of destroy if data should flush before close, or wait for + * the `'drain'` event before destroying the stream. + * + * Once `destroy()` has been called any further calls will be a no-op and no + * further errors except from `_destroy()` may be emitted as `'error'`. + * + * Implementors should not override this method, + * but instead implement `writable._destroy()`. + * @since v8.0.0 + * @param error Optional, an error to emit with `'error'` event. + */ + destroy(error?: Error): this; + /** + * Event emitter + * The defined events on documents including: + * 1. close + * 2. drain + * 3. error + * 4. finish + * 5. pipe + * 6. unpipe + */ + addListener(event: 'close', listener: () => void): this; + addListener(event: 'drain', listener: () => void): this; + addListener(event: 'error', listener: (err: Error) => void): this; + addListener(event: 'finish', listener: () => void): this; + addListener(event: 'pipe', listener: (src: Readable) => void): this; + addListener(event: 'unpipe', listener: (src: Readable) => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + emit(event: 'close'): boolean; + emit(event: 'drain'): boolean; + emit(event: 'error', err: Error): boolean; + emit(event: 'finish'): boolean; + emit(event: 'pipe', src: Readable): boolean; + emit(event: 'unpipe', src: Readable): boolean; + emit(event: string | symbol, ...args: any[]): boolean; + on(event: 'close', listener: () => void): this; + on(event: 'drain', listener: () => void): this; + on(event: 'error', listener: (err: Error) => void): this; + on(event: 'finish', listener: () => void): this; + on(event: 'pipe', listener: (src: Readable) => void): this; + on(event: 'unpipe', listener: (src: Readable) => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + once(event: 'close', listener: () => void): this; + once(event: 'drain', listener: () => void): this; + once(event: 'error', listener: (err: Error) => void): this; + once(event: 'finish', listener: () => void): this; + once(event: 'pipe', listener: (src: Readable) => void): this; + once(event: 'unpipe', listener: (src: Readable) => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + prependListener(event: 'close', listener: () => void): this; + prependListener(event: 'drain', listener: () => void): this; + prependListener(event: 'error', listener: (err: Error) => void): this; + prependListener(event: 'finish', listener: () => void): this; + prependListener(event: 'pipe', listener: (src: Readable) => void): this; + prependListener(event: 'unpipe', listener: (src: Readable) => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'close', listener: () => void): this; + prependOnceListener(event: 'drain', listener: () => void): this; + prependOnceListener(event: 'error', listener: (err: Error) => void): this; + prependOnceListener(event: 'finish', listener: () => void): this; + prependOnceListener(event: 'pipe', listener: (src: Readable) => void): this; + prependOnceListener(event: 'unpipe', listener: (src: Readable) => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + removeListener(event: 'close', listener: () => void): this; + removeListener(event: 'drain', listener: () => void): this; + removeListener(event: 'error', listener: (err: Error) => void): this; + removeListener(event: 'finish', listener: () => void): this; + removeListener(event: 'pipe', listener: (src: Readable) => void): this; + removeListener(event: 'unpipe', listener: (src: Readable) => void): this; + removeListener(event: string | symbol, listener: (...args: any[]) => void): this; + } + namespace internal { + class Stream extends internal { + constructor(opts?: ReadableOptions); + } + interface StreamOptions extends Abortable { + emitClose?: boolean | undefined; + highWaterMark?: number | undefined; + objectMode?: boolean | undefined; + construct?(this: T, callback: (error?: Error | null) => void): void; + destroy?(this: T, error: Error | null, callback: (error: Error | null) => void): void; + autoDestroy?: boolean | undefined; + } + interface ReadableOptions extends StreamOptions { + encoding?: BufferEncoding | undefined; + read?(this: Readable, size: number): void; + } + /** + * @since v0.9.4 + */ + class Readable extends ReadableBase { + /** + * A utility method for creating a `Readable` from a web `ReadableStream`. + * @since v17.0.0 + * @experimental + */ + static fromWeb(readableStream: streamWeb.ReadableStream, options?: Pick): Readable; + /** + * A utility method for creating a web `ReadableStream` from a `Readable`. + * @since v17.0.0 + * @experimental + */ + static toWeb(streamReadable: Readable): streamWeb.ReadableStream; + } + interface WritableOptions extends StreamOptions { + decodeStrings?: boolean | undefined; + defaultEncoding?: BufferEncoding | undefined; + write?(this: Writable, chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void; + writev?( + this: Writable, + chunks: Array<{ + chunk: any; + encoding: BufferEncoding; + }>, + callback: (error?: Error | null) => void + ): void; + final?(this: Writable, callback: (error?: Error | null) => void): void; + } + /** + * @since v0.9.4 + */ + class Writable extends WritableBase { + /** + * A utility method for creating a `Writable` from a web `WritableStream`. + * @since v17.0.0 + * @experimental + */ + static fromWeb(writableStream: streamWeb.WritableStream, options?: Pick): Writable; + /** + * A utility method for creating a web `WritableStream` from a `Writable`. + * @since v17.0.0 + * @experimental + */ + static toWeb(streamWritable: Writable): streamWeb.WritableStream; + } + interface DuplexOptions extends ReadableOptions, WritableOptions { + allowHalfOpen?: boolean | undefined; + readableObjectMode?: boolean | undefined; + writableObjectMode?: boolean | undefined; + readableHighWaterMark?: number | undefined; + writableHighWaterMark?: number | undefined; + writableCorked?: number | undefined; + construct?(this: Duplex, callback: (error?: Error | null) => void): void; + read?(this: Duplex, size: number): void; + write?(this: Duplex, chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void; + writev?( + this: Duplex, + chunks: Array<{ + chunk: any; + encoding: BufferEncoding; + }>, + callback: (error?: Error | null) => void + ): void; + final?(this: Duplex, callback: (error?: Error | null) => void): void; + destroy?(this: Duplex, error: Error | null, callback: (error: Error | null) => void): void; + } + /** + * Duplex streams are streams that implement both the `Readable` and `Writable` interfaces. + * + * Examples of `Duplex` streams include: + * + * * `TCP sockets` + * * `zlib streams` + * * `crypto streams` + * @since v0.9.4 + */ + class Duplex extends ReadableBase implements WritableBase { + readonly writable: boolean; + readonly writableEnded: boolean; + readonly writableFinished: boolean; + readonly writableHighWaterMark: number; + readonly writableLength: number; + readonly writableObjectMode: boolean; + readonly writableCorked: number; + readonly writableNeedDrain: boolean; + readonly closed: boolean; + readonly errored: Error | null; + /** + * If `false` then the stream will automatically end the writable side when the + * readable side ends. Set initially by the `allowHalfOpen` constructor option, + * which defaults to `true`. + * + * This can be changed manually to change the half-open behavior of an existing`Duplex` stream instance, but must be changed before the `'end'` event is + * emitted. + * @since v0.9.4 + */ + allowHalfOpen: boolean; + constructor(opts?: DuplexOptions); + /** + * A utility method for creating duplex streams. + * + * - `Stream` converts writable stream into writable `Duplex` and readable stream + * to `Duplex`. + * - `Blob` converts into readable `Duplex`. + * - `string` converts into readable `Duplex`. + * - `ArrayBuffer` converts into readable `Duplex`. + * - `AsyncIterable` converts into a readable `Duplex`. Cannot yield `null`. + * - `AsyncGeneratorFunction` converts into a readable/writable transform + * `Duplex`. Must take a source `AsyncIterable` as first parameter. Cannot yield + * `null`. + * - `AsyncFunction` converts into a writable `Duplex`. Must return + * either `null` or `undefined` + * - `Object ({ writable, readable })` converts `readable` and + * `writable` into `Stream` and then combines them into `Duplex` where the + * `Duplex` will write to the `writable` and read from the `readable`. + * - `Promise` converts into readable `Duplex`. Value `null` is ignored. + * + * @since v16.8.0 + */ + static from(src: Stream | NodeBlob | ArrayBuffer | string | Iterable | AsyncIterable | AsyncGeneratorFunction | Promise | Object): Duplex; + _write(chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void; + _writev?( + chunks: Array<{ + chunk: any; + encoding: BufferEncoding; + }>, + callback: (error?: Error | null) => void + ): void; + _destroy(error: Error | null, callback: (error: Error | null) => void): void; + _final(callback: (error?: Error | null) => void): void; + write(chunk: any, encoding?: BufferEncoding, cb?: (error: Error | null | undefined) => void): boolean; + write(chunk: any, cb?: (error: Error | null | undefined) => void): boolean; + setDefaultEncoding(encoding: BufferEncoding): this; + end(cb?: () => void): this; + end(chunk: any, cb?: () => void): this; + end(chunk: any, encoding?: BufferEncoding, cb?: () => void): this; + cork(): void; + uncork(): void; + /** + * A utility method for creating a web `ReadableStream` and `WritableStream` from a `Duplex`. + * @since v17.0.0 + * @experimental + */ + static toWeb(streamDuplex: Duplex): { + readable: streamWeb.ReadableStream; + writable: streamWeb.WritableStream; + }; + /** + * A utility method for creating a `Duplex` from a web `ReadableStream` and `WritableStream`. + * @since v17.0.0 + * @experimental + */ + static fromWeb( + duplexStream: { + readable: streamWeb.ReadableStream; + writable: streamWeb.WritableStream; + }, + options?: Pick + ): Duplex; + /** + * Event emitter + * The defined events on documents including: + * 1. close + * 2. data + * 3. drain + * 4. end + * 5. error + * 6. finish + * 7. pause + * 8. pipe + * 9. readable + * 10. resume + * 11. unpipe + */ + addListener(event: 'close', listener: () => void): this; + addListener(event: 'data', listener: (chunk: any) => void): this; + addListener(event: 'drain', listener: () => void): this; + addListener(event: 'end', listener: () => void): this; + addListener(event: 'error', listener: (err: Error) => void): this; + addListener(event: 'finish', listener: () => void): this; + addListener(event: 'pause', listener: () => void): this; + addListener(event: 'pipe', listener: (src: Readable) => void): this; + addListener(event: 'readable', listener: () => void): this; + addListener(event: 'resume', listener: () => void): this; + addListener(event: 'unpipe', listener: (src: Readable) => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + emit(event: 'close'): boolean; + emit(event: 'data', chunk: any): boolean; + emit(event: 'drain'): boolean; + emit(event: 'end'): boolean; + emit(event: 'error', err: Error): boolean; + emit(event: 'finish'): boolean; + emit(event: 'pause'): boolean; + emit(event: 'pipe', src: Readable): boolean; + emit(event: 'readable'): boolean; + emit(event: 'resume'): boolean; + emit(event: 'unpipe', src: Readable): boolean; + emit(event: string | symbol, ...args: any[]): boolean; + on(event: 'close', listener: () => void): this; + on(event: 'data', listener: (chunk: any) => void): this; + on(event: 'drain', listener: () => void): this; + on(event: 'end', listener: () => void): this; + on(event: 'error', listener: (err: Error) => void): this; + on(event: 'finish', listener: () => void): this; + on(event: 'pause', listener: () => void): this; + on(event: 'pipe', listener: (src: Readable) => void): this; + on(event: 'readable', listener: () => void): this; + on(event: 'resume', listener: () => void): this; + on(event: 'unpipe', listener: (src: Readable) => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + once(event: 'close', listener: () => void): this; + once(event: 'data', listener: (chunk: any) => void): this; + once(event: 'drain', listener: () => void): this; + once(event: 'end', listener: () => void): this; + once(event: 'error', listener: (err: Error) => void): this; + once(event: 'finish', listener: () => void): this; + once(event: 'pause', listener: () => void): this; + once(event: 'pipe', listener: (src: Readable) => void): this; + once(event: 'readable', listener: () => void): this; + once(event: 'resume', listener: () => void): this; + once(event: 'unpipe', listener: (src: Readable) => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + prependListener(event: 'close', listener: () => void): this; + prependListener(event: 'data', listener: (chunk: any) => void): this; + prependListener(event: 'drain', listener: () => void): this; + prependListener(event: 'end', listener: () => void): this; + prependListener(event: 'error', listener: (err: Error) => void): this; + prependListener(event: 'finish', listener: () => void): this; + prependListener(event: 'pause', listener: () => void): this; + prependListener(event: 'pipe', listener: (src: Readable) => void): this; + prependListener(event: 'readable', listener: () => void): this; + prependListener(event: 'resume', listener: () => void): this; + prependListener(event: 'unpipe', listener: (src: Readable) => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'close', listener: () => void): this; + prependOnceListener(event: 'data', listener: (chunk: any) => void): this; + prependOnceListener(event: 'drain', listener: () => void): this; + prependOnceListener(event: 'end', listener: () => void): this; + prependOnceListener(event: 'error', listener: (err: Error) => void): this; + prependOnceListener(event: 'finish', listener: () => void): this; + prependOnceListener(event: 'pause', listener: () => void): this; + prependOnceListener(event: 'pipe', listener: (src: Readable) => void): this; + prependOnceListener(event: 'readable', listener: () => void): this; + prependOnceListener(event: 'resume', listener: () => void): this; + prependOnceListener(event: 'unpipe', listener: (src: Readable) => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + removeListener(event: 'close', listener: () => void): this; + removeListener(event: 'data', listener: (chunk: any) => void): this; + removeListener(event: 'drain', listener: () => void): this; + removeListener(event: 'end', listener: () => void): this; + removeListener(event: 'error', listener: (err: Error) => void): this; + removeListener(event: 'finish', listener: () => void): this; + removeListener(event: 'pause', listener: () => void): this; + removeListener(event: 'pipe', listener: (src: Readable) => void): this; + removeListener(event: 'readable', listener: () => void): this; + removeListener(event: 'resume', listener: () => void): this; + removeListener(event: 'unpipe', listener: (src: Readable) => void): this; + removeListener(event: string | symbol, listener: (...args: any[]) => void): this; + } + type TransformCallback = (error?: Error | null, data?: any) => void; + interface TransformOptions extends DuplexOptions { + construct?(this: Transform, callback: (error?: Error | null) => void): void; + read?(this: Transform, size: number): void; + write?(this: Transform, chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void; + writev?( + this: Transform, + chunks: Array<{ + chunk: any; + encoding: BufferEncoding; + }>, + callback: (error?: Error | null) => void + ): void; + final?(this: Transform, callback: (error?: Error | null) => void): void; + destroy?(this: Transform, error: Error | null, callback: (error: Error | null) => void): void; + transform?(this: Transform, chunk: any, encoding: BufferEncoding, callback: TransformCallback): void; + flush?(this: Transform, callback: TransformCallback): void; + } + /** + * Transform streams are `Duplex` streams where the output is in some way + * related to the input. Like all `Duplex` streams, `Transform` streams + * implement both the `Readable` and `Writable` interfaces. + * + * Examples of `Transform` streams include: + * + * * `zlib streams` + * * `crypto streams` + * @since v0.9.4 + */ + class Transform extends Duplex { + constructor(opts?: TransformOptions); + _transform(chunk: any, encoding: BufferEncoding, callback: TransformCallback): void; + _flush(callback: TransformCallback): void; + } + /** + * The `stream.PassThrough` class is a trivial implementation of a `Transform` stream that simply passes the input bytes across to the output. Its purpose is + * primarily for examples and testing, but there are some use cases where`stream.PassThrough` is useful as a building block for novel sorts of streams. + */ + class PassThrough extends Transform {} + /** + * A stream to attach a signal to. + * + * Attaches an AbortSignal to a readable or writeable stream. This lets code + * control stream destruction using an `AbortController`. + * + * Calling `abort` on the `AbortController` corresponding to the passed`AbortSignal` will behave the same way as calling `.destroy(new AbortError())`on the stream, and `controller.error(new + * AbortError())` for webstreams. + * + * ```js + * const fs = require('node:fs'); + * + * const controller = new AbortController(); + * const read = addAbortSignal( + * controller.signal, + * fs.createReadStream(('object.json')), + * ); + * // Later, abort the operation closing the stream + * controller.abort(); + * ``` + * + * Or using an `AbortSignal` with a readable stream as an async iterable: + * + * ```js + * const controller = new AbortController(); + * setTimeout(() => controller.abort(), 10_000); // set a timeout + * const stream = addAbortSignal( + * controller.signal, + * fs.createReadStream(('object.json')), + * ); + * (async () => { + * try { + * for await (const chunk of stream) { + * await process(chunk); + * } + * } catch (e) { + * if (e.name === 'AbortError') { + * // The operation was cancelled + * } else { + * throw e; + * } + * } + * })(); + * ``` + * + * Or using an `AbortSignal` with a ReadableStream: + * + * ```js + * const controller = new AbortController(); + * const rs = new ReadableStream({ + * start(controller) { + * controller.enqueue('hello'); + * controller.enqueue('world'); + * controller.close(); + * }, + * }); + * + * addAbortSignal(controller.signal, rs); + * + * finished(rs, (err) => { + * if (err) { + * if (err.name === 'AbortError') { + * // The operation was cancelled + * } + * } + * }); + * + * const reader = rs.getReader(); + * + * reader.read().then(({ value, done }) => { + * console.log(value); // hello + * console.log(done); // false + * controller.abort(); + * }); + * ``` + * @since v15.4.0 + * @param signal A signal representing possible cancellation + * @param stream a stream to attach a signal to + */ + function addAbortSignal(signal: AbortSignal, stream: T): T; + /** + * Returns the default highWaterMark used by streams. + * Defaults to `16384` (16 KiB), or `16` for `objectMode`. + * @since v19.9.0 + * @param objectMode + */ + function getDefaultHighWaterMark(objectMode: boolean): number; + /** + * Sets the default highWaterMark used by streams. + * @since v19.9.0 + * @param objectMode + * @param value highWaterMark value + */ + function setDefaultHighWaterMark(objectMode: boolean, value: number): void; + interface FinishedOptions extends Abortable { + error?: boolean | undefined; + readable?: boolean | undefined; + writable?: boolean | undefined; + } + /** + * A readable and/or writable stream/webstream. + * + * A function to get notified when a stream is no longer readable, writable + * or has experienced an error or a premature close event. + * + * ```js + * const { finished } = require('node:stream'); + * const fs = require('node:fs'); + * + * const rs = fs.createReadStream('archive.tar'); + * + * finished(rs, (err) => { + * if (err) { + * console.error('Stream failed.', err); + * } else { + * console.log('Stream is done reading.'); + * } + * }); + * + * rs.resume(); // Drain the stream. + * ``` + * + * Especially useful in error handling scenarios where a stream is destroyed + * prematurely (like an aborted HTTP request), and will not emit `'end'`or `'finish'`. + * + * The `finished` API provides `promise version`. + * + * `stream.finished()` leaves dangling event listeners (in particular`'error'`, `'end'`, `'finish'` and `'close'`) after `callback` has been + * invoked. The reason for this is so that unexpected `'error'` events (due to + * incorrect stream implementations) do not cause unexpected crashes. + * If this is unwanted behavior then the returned cleanup function needs to be + * invoked in the callback: + * + * ```js + * const cleanup = finished(rs, (err) => { + * cleanup(); + * // ... + * }); + * ``` + * @since v10.0.0 + * @param stream A readable and/or writable stream. + * @param callback A callback function that takes an optional error argument. + * @return A cleanup function which removes all registered listeners. + */ + function finished(stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, options: FinishedOptions, callback: (err?: NodeJS.ErrnoException | null) => void): () => void; + function finished(stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, callback: (err?: NodeJS.ErrnoException | null) => void): () => void; + namespace finished { + function __promisify__(stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, options?: FinishedOptions): Promise; + } + type PipelineSourceFunction = () => Iterable | AsyncIterable; + type PipelineSource = Iterable | AsyncIterable | NodeJS.ReadableStream | PipelineSourceFunction; + type PipelineTransform, U> = + | NodeJS.ReadWriteStream + | ((source: S extends (...args: any[]) => Iterable | AsyncIterable ? AsyncIterable : S) => AsyncIterable); + type PipelineTransformSource = PipelineSource | PipelineTransform; + type PipelineDestinationIterableFunction = (source: AsyncIterable) => AsyncIterable; + type PipelineDestinationPromiseFunction = (source: AsyncIterable) => Promise

; + type PipelineDestination, P> = S extends PipelineTransformSource + ? NodeJS.WritableStream | PipelineDestinationIterableFunction | PipelineDestinationPromiseFunction + : never; + type PipelineCallback> = S extends PipelineDestinationPromiseFunction + ? (err: NodeJS.ErrnoException | null, value: P) => void + : (err: NodeJS.ErrnoException | null) => void; + type PipelinePromise> = S extends PipelineDestinationPromiseFunction ? Promise

: Promise; + interface PipelineOptions { + signal?: AbortSignal | undefined; + end?: boolean | undefined; + } + /** + * A module method to pipe between streams and generators forwarding errors and + * properly cleaning up and provide a callback when the pipeline is complete. + * + * ```js + * const { pipeline } = require('node:stream'); + * const fs = require('node:fs'); + * const zlib = require('node:zlib'); + * + * // Use the pipeline API to easily pipe a series of streams + * // together and get notified when the pipeline is fully done. + * + * // A pipeline to gzip a potentially huge tar file efficiently: + * + * pipeline( + * fs.createReadStream('archive.tar'), + * zlib.createGzip(), + * fs.createWriteStream('archive.tar.gz'), + * (err) => { + * if (err) { + * console.error('Pipeline failed.', err); + * } else { + * console.log('Pipeline succeeded.'); + * } + * }, + * ); + * ``` + * + * The `pipeline` API provides a `promise version`. + * + * `stream.pipeline()` will call `stream.destroy(err)` on all streams except: + * + * * `Readable` streams which have emitted `'end'` or `'close'`. + * * `Writable` streams which have emitted `'finish'` or `'close'`. + * + * `stream.pipeline()` leaves dangling event listeners on the streams + * after the `callback` has been invoked. In the case of reuse of streams after + * failure, this can cause event listener leaks and swallowed errors. If the last + * stream is readable, dangling event listeners will be removed so that the last + * stream can be consumed later. + * + * `stream.pipeline()` closes all the streams when an error is raised. + * The `IncomingRequest` usage with `pipeline` could lead to an unexpected behavior + * once it would destroy the socket without sending the expected response. + * See the example below: + * + * ```js + * const fs = require('node:fs'); + * const http = require('node:http'); + * const { pipeline } = require('node:stream'); + * + * const server = http.createServer((req, res) => { + * const fileStream = fs.createReadStream('./fileNotExist.txt'); + * pipeline(fileStream, res, (err) => { + * if (err) { + * console.log(err); // No such file + * // this message can't be sent once `pipeline` already destroyed the socket + * return res.end('error!!!'); + * } + * }); + * }); + * ``` + * @since v10.0.0 + * @param callback Called when the pipeline is fully done. + */ + function pipeline, B extends PipelineDestination>( + source: A, + destination: B, + callback?: PipelineCallback + ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream; + function pipeline, T1 extends PipelineTransform, B extends PipelineDestination>( + source: A, + transform1: T1, + destination: B, + callback?: PipelineCallback + ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream; + function pipeline, T1 extends PipelineTransform, T2 extends PipelineTransform, B extends PipelineDestination>( + source: A, + transform1: T1, + transform2: T2, + destination: B, + callback?: PipelineCallback + ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream; + function pipeline< + A extends PipelineSource, + T1 extends PipelineTransform, + T2 extends PipelineTransform, + T3 extends PipelineTransform, + B extends PipelineDestination + >(source: A, transform1: T1, transform2: T2, transform3: T3, destination: B, callback?: PipelineCallback): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream; + function pipeline< + A extends PipelineSource, + T1 extends PipelineTransform, + T2 extends PipelineTransform, + T3 extends PipelineTransform, + T4 extends PipelineTransform, + B extends PipelineDestination + >(source: A, transform1: T1, transform2: T2, transform3: T3, transform4: T4, destination: B, callback?: PipelineCallback): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream; + function pipeline( + streams: ReadonlyArray, + callback?: (err: NodeJS.ErrnoException | null) => void + ): NodeJS.WritableStream; + function pipeline( + stream1: NodeJS.ReadableStream, + stream2: NodeJS.ReadWriteStream | NodeJS.WritableStream, + ...streams: Array void)> + ): NodeJS.WritableStream; + namespace pipeline { + function __promisify__, B extends PipelineDestination>(source: A, destination: B, options?: PipelineOptions): PipelinePromise; + function __promisify__, T1 extends PipelineTransform, B extends PipelineDestination>( + source: A, + transform1: T1, + destination: B, + options?: PipelineOptions + ): PipelinePromise; + function __promisify__, T1 extends PipelineTransform, T2 extends PipelineTransform, B extends PipelineDestination>( + source: A, + transform1: T1, + transform2: T2, + destination: B, + options?: PipelineOptions + ): PipelinePromise; + function __promisify__< + A extends PipelineSource, + T1 extends PipelineTransform, + T2 extends PipelineTransform, + T3 extends PipelineTransform, + B extends PipelineDestination + >(source: A, transform1: T1, transform2: T2, transform3: T3, destination: B, options?: PipelineOptions): PipelinePromise; + function __promisify__< + A extends PipelineSource, + T1 extends PipelineTransform, + T2 extends PipelineTransform, + T3 extends PipelineTransform, + T4 extends PipelineTransform, + B extends PipelineDestination + >(source: A, transform1: T1, transform2: T2, transform3: T3, transform4: T4, destination: B, options?: PipelineOptions): PipelinePromise; + function __promisify__(streams: ReadonlyArray, options?: PipelineOptions): Promise; + function __promisify__( + stream1: NodeJS.ReadableStream, + stream2: NodeJS.ReadWriteStream | NodeJS.WritableStream, + ...streams: Array + ): Promise; + } + interface Pipe { + close(): void; + hasRef(): boolean; + ref(): void; + unref(): void; + } + /** + * Returns whether the stream has encountered an error. + * @since v17.3.0, v16.14.0 + * @experimental + */ + function isErrored(stream: Readable | Writable | NodeJS.ReadableStream | NodeJS.WritableStream): boolean; + /** + * Returns whether the stream is readable. + * @since v17.4.0, v16.14.0 + * @experimental + */ + function isReadable(stream: Readable | NodeJS.ReadableStream): boolean; + const promises: typeof streamPromises; + const consumers: typeof streamConsumers; + } + export = internal; +} +declare module 'stream' { + import stream = require('node:stream'); + export = stream; +} diff --git a/node_modules/@types/node/stream/consumers.d.ts b/node_modules/@types/node/stream/consumers.d.ts new file mode 100644 index 0000000..7b9ca2e --- /dev/null +++ b/node_modules/@types/node/stream/consumers.d.ts @@ -0,0 +1,12 @@ +declare module 'node:stream/consumers' { + import { Blob as NodeBlob } from 'node:buffer'; + import { Readable } from 'node:stream'; + function buffer(stream: NodeJS.ReadableStream | Readable | AsyncIterator): Promise; + function text(stream: NodeJS.ReadableStream | Readable | AsyncIterator): Promise; + function arrayBuffer(stream: NodeJS.ReadableStream | Readable | AsyncIterator): Promise; + function blob(stream: NodeJS.ReadableStream | Readable | AsyncIterator): Promise; + function json(stream: NodeJS.ReadableStream | Readable | AsyncIterator): Promise; +} +declare module 'stream/consumers' { + export * from 'node:stream/consumers'; +} diff --git a/node_modules/@types/node/stream/promises.d.ts b/node_modules/@types/node/stream/promises.d.ts new file mode 100644 index 0000000..26c8d11 --- /dev/null +++ b/node_modules/@types/node/stream/promises.d.ts @@ -0,0 +1,42 @@ +declare module 'node:stream/promises' { + import { FinishedOptions, PipelineSource, PipelineTransform, PipelineDestination, PipelinePromise, PipelineOptions } from 'node:stream'; + function finished(stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, options?: FinishedOptions): Promise; + function pipeline, B extends PipelineDestination>(source: A, destination: B, options?: PipelineOptions): PipelinePromise; + function pipeline, T1 extends PipelineTransform, B extends PipelineDestination>( + source: A, + transform1: T1, + destination: B, + options?: PipelineOptions + ): PipelinePromise; + function pipeline, T1 extends PipelineTransform, T2 extends PipelineTransform, B extends PipelineDestination>( + source: A, + transform1: T1, + transform2: T2, + destination: B, + options?: PipelineOptions + ): PipelinePromise; + function pipeline< + A extends PipelineSource, + T1 extends PipelineTransform, + T2 extends PipelineTransform, + T3 extends PipelineTransform, + B extends PipelineDestination + >(source: A, transform1: T1, transform2: T2, transform3: T3, destination: B, options?: PipelineOptions): PipelinePromise; + function pipeline< + A extends PipelineSource, + T1 extends PipelineTransform, + T2 extends PipelineTransform, + T3 extends PipelineTransform, + T4 extends PipelineTransform, + B extends PipelineDestination + >(source: A, transform1: T1, transform2: T2, transform3: T3, transform4: T4, destination: B, options?: PipelineOptions): PipelinePromise; + function pipeline(streams: ReadonlyArray, options?: PipelineOptions): Promise; + function pipeline( + stream1: NodeJS.ReadableStream, + stream2: NodeJS.ReadWriteStream | NodeJS.WritableStream, + ...streams: Array + ): Promise; +} +declare module 'stream/promises' { + export * from 'node:stream/promises'; +} diff --git a/node_modules/@types/node/stream/web.d.ts b/node_modules/@types/node/stream/web.d.ts new file mode 100644 index 0000000..8f814f0 --- /dev/null +++ b/node_modules/@types/node/stream/web.d.ts @@ -0,0 +1,330 @@ +declare module 'node:stream/web' { + // stub module, pending copy&paste from .d.ts or manual impl + // copy from lib.dom.d.ts + interface ReadableWritablePair { + readable: ReadableStream; + /** + * Provides a convenient, chainable way of piping this readable stream + * through a transform stream (or any other { writable, readable } + * pair). It simply pipes the stream into the writable side of the + * supplied pair, and returns the readable side for further use. + * + * Piping a stream will lock it for the duration of the pipe, preventing + * any other consumer from acquiring a reader. + */ + writable: WritableStream; + } + interface StreamPipeOptions { + preventAbort?: boolean; + preventCancel?: boolean; + /** + * Pipes this readable stream to a given writable stream destination. + * The way in which the piping process behaves under various error + * conditions can be customized with a number of passed options. It + * returns a promise that fulfills when the piping process completes + * successfully, or rejects if any errors were encountered. + * + * Piping a stream will lock it for the duration of the pipe, preventing + * any other consumer from acquiring a reader. + * + * Errors and closures of the source and destination streams propagate + * as follows: + * + * An error in this source readable stream will abort destination, + * unless preventAbort is truthy. The returned promise will be rejected + * with the source's error, or with any error that occurs during + * aborting the destination. + * + * An error in destination will cancel this source readable stream, + * unless preventCancel is truthy. The returned promise will be rejected + * with the destination's error, or with any error that occurs during + * canceling the source. + * + * When this source readable stream closes, destination will be closed, + * unless preventClose is truthy. The returned promise will be fulfilled + * once this process completes, unless an error is encountered while + * closing the destination, in which case it will be rejected with that + * error. + * + * If destination starts out closed or closing, this source readable + * stream will be canceled, unless preventCancel is true. The returned + * promise will be rejected with an error indicating piping to a closed + * stream failed, or with any error that occurs during canceling the + * source. + * + * The signal option can be set to an AbortSignal to allow aborting an + * ongoing pipe operation via the corresponding AbortController. In this + * case, this source readable stream will be canceled, and destination + * aborted, unless the respective options preventCancel or preventAbort + * are set. + */ + preventClose?: boolean; + signal?: AbortSignal; + } + interface ReadableStreamGenericReader { + readonly closed: Promise; + cancel(reason?: any): Promise; + } + interface ReadableStreamDefaultReadValueResult { + done: false; + value: T; + } + interface ReadableStreamDefaultReadDoneResult { + done: true; + value?: undefined; + } + type ReadableStreamController = ReadableStreamDefaultController; + type ReadableStreamDefaultReadResult = ReadableStreamDefaultReadValueResult | ReadableStreamDefaultReadDoneResult; + interface ReadableByteStreamControllerCallback { + (controller: ReadableByteStreamController): void | PromiseLike; + } + interface UnderlyingSinkAbortCallback { + (reason?: any): void | PromiseLike; + } + interface UnderlyingSinkCloseCallback { + (): void | PromiseLike; + } + interface UnderlyingSinkStartCallback { + (controller: WritableStreamDefaultController): any; + } + interface UnderlyingSinkWriteCallback { + (chunk: W, controller: WritableStreamDefaultController): void | PromiseLike; + } + interface UnderlyingSourceCancelCallback { + (reason?: any): void | PromiseLike; + } + interface UnderlyingSourcePullCallback { + (controller: ReadableStreamController): void | PromiseLike; + } + interface UnderlyingSourceStartCallback { + (controller: ReadableStreamController): any; + } + interface TransformerFlushCallback { + (controller: TransformStreamDefaultController): void | PromiseLike; + } + interface TransformerStartCallback { + (controller: TransformStreamDefaultController): any; + } + interface TransformerTransformCallback { + (chunk: I, controller: TransformStreamDefaultController): void | PromiseLike; + } + interface UnderlyingByteSource { + autoAllocateChunkSize?: number; + cancel?: ReadableStreamErrorCallback; + pull?: ReadableByteStreamControllerCallback; + start?: ReadableByteStreamControllerCallback; + type: 'bytes'; + } + interface UnderlyingSource { + cancel?: UnderlyingSourceCancelCallback; + pull?: UnderlyingSourcePullCallback; + start?: UnderlyingSourceStartCallback; + type?: undefined; + } + interface UnderlyingSink { + abort?: UnderlyingSinkAbortCallback; + close?: UnderlyingSinkCloseCallback; + start?: UnderlyingSinkStartCallback; + type?: undefined; + write?: UnderlyingSinkWriteCallback; + } + interface ReadableStreamErrorCallback { + (reason: any): void | PromiseLike; + } + /** This Streams API interface represents a readable stream of byte data. */ + interface ReadableStream { + readonly locked: boolean; + cancel(reason?: any): Promise; + getReader(): ReadableStreamDefaultReader; + pipeThrough(transform: ReadableWritablePair, options?: StreamPipeOptions): ReadableStream; + pipeTo(destination: WritableStream, options?: StreamPipeOptions): Promise; + tee(): [ReadableStream, ReadableStream]; + values(options?: { preventCancel?: boolean }): AsyncIterableIterator; + [Symbol.asyncIterator](): AsyncIterableIterator; + } + const ReadableStream: { + prototype: ReadableStream; + new (underlyingSource: UnderlyingByteSource, strategy?: QueuingStrategy): ReadableStream; + new (underlyingSource?: UnderlyingSource, strategy?: QueuingStrategy): ReadableStream; + }; + interface ReadableStreamDefaultReader extends ReadableStreamGenericReader { + read(): Promise>; + releaseLock(): void; + } + const ReadableStreamDefaultReader: { + prototype: ReadableStreamDefaultReader; + new (stream: ReadableStream): ReadableStreamDefaultReader; + }; + const ReadableStreamBYOBReader: any; + const ReadableStreamBYOBRequest: any; + interface ReadableByteStreamController { + readonly byobRequest: undefined; + readonly desiredSize: number | null; + close(): void; + enqueue(chunk: ArrayBufferView): void; + error(error?: any): void; + } + const ReadableByteStreamController: { + prototype: ReadableByteStreamController; + new (): ReadableByteStreamController; + }; + interface ReadableStreamDefaultController { + readonly desiredSize: number | null; + close(): void; + enqueue(chunk?: R): void; + error(e?: any): void; + } + const ReadableStreamDefaultController: { + prototype: ReadableStreamDefaultController; + new (): ReadableStreamDefaultController; + }; + interface Transformer { + flush?: TransformerFlushCallback; + readableType?: undefined; + start?: TransformerStartCallback; + transform?: TransformerTransformCallback; + writableType?: undefined; + } + interface TransformStream { + readonly readable: ReadableStream; + readonly writable: WritableStream; + } + const TransformStream: { + prototype: TransformStream; + new (transformer?: Transformer, writableStrategy?: QueuingStrategy, readableStrategy?: QueuingStrategy): TransformStream; + }; + interface TransformStreamDefaultController { + readonly desiredSize: number | null; + enqueue(chunk?: O): void; + error(reason?: any): void; + terminate(): void; + } + const TransformStreamDefaultController: { + prototype: TransformStreamDefaultController; + new (): TransformStreamDefaultController; + }; + /** + * This Streams API interface provides a standard abstraction for writing + * streaming data to a destination, known as a sink. This object comes with + * built-in back pressure and queuing. + */ + interface WritableStream { + readonly locked: boolean; + abort(reason?: any): Promise; + close(): Promise; + getWriter(): WritableStreamDefaultWriter; + } + const WritableStream: { + prototype: WritableStream; + new (underlyingSink?: UnderlyingSink, strategy?: QueuingStrategy): WritableStream; + }; + /** + * This Streams API interface is the object returned by + * WritableStream.getWriter() and once created locks the < writer to the + * WritableStream ensuring that no other streams can write to the underlying + * sink. + */ + interface WritableStreamDefaultWriter { + readonly closed: Promise; + readonly desiredSize: number | null; + readonly ready: Promise; + abort(reason?: any): Promise; + close(): Promise; + releaseLock(): void; + write(chunk?: W): Promise; + } + const WritableStreamDefaultWriter: { + prototype: WritableStreamDefaultWriter; + new (stream: WritableStream): WritableStreamDefaultWriter; + }; + /** + * This Streams API interface represents a controller allowing control of a + * WritableStream's state. When constructing a WritableStream, the + * underlying sink is given a corresponding WritableStreamDefaultController + * instance to manipulate. + */ + interface WritableStreamDefaultController { + error(e?: any): void; + } + const WritableStreamDefaultController: { + prototype: WritableStreamDefaultController; + new (): WritableStreamDefaultController; + }; + interface QueuingStrategy { + highWaterMark?: number; + size?: QueuingStrategySize; + } + interface QueuingStrategySize { + (chunk?: T): number; + } + interface QueuingStrategyInit { + /** + * Creates a new ByteLengthQueuingStrategy with the provided high water + * mark. + * + * Note that the provided high water mark will not be validated ahead of + * time. Instead, if it is negative, NaN, or not a number, the resulting + * ByteLengthQueuingStrategy will cause the corresponding stream + * constructor to throw. + */ + highWaterMark: number; + } + /** + * This Streams API interface provides a built-in byte length queuing + * strategy that can be used when constructing streams. + */ + interface ByteLengthQueuingStrategy extends QueuingStrategy { + readonly highWaterMark: number; + readonly size: QueuingStrategySize; + } + const ByteLengthQueuingStrategy: { + prototype: ByteLengthQueuingStrategy; + new (init: QueuingStrategyInit): ByteLengthQueuingStrategy; + }; + /** + * This Streams API interface provides a built-in byte length queuing + * strategy that can be used when constructing streams. + */ + interface CountQueuingStrategy extends QueuingStrategy { + readonly highWaterMark: number; + readonly size: QueuingStrategySize; + } + const CountQueuingStrategy: { + prototype: CountQueuingStrategy; + new (init: QueuingStrategyInit): CountQueuingStrategy; + }; + interface TextEncoderStream { + /** Returns "utf-8". */ + readonly encoding: 'utf-8'; + readonly readable: ReadableStream; + readonly writable: WritableStream; + readonly [Symbol.toStringTag]: string; + } + const TextEncoderStream: { + prototype: TextEncoderStream; + new (): TextEncoderStream; + }; + interface TextDecoderOptions { + fatal?: boolean; + ignoreBOM?: boolean; + } + type BufferSource = ArrayBufferView | ArrayBuffer; + interface TextDecoderStream { + /** Returns encoding's name, lower cased. */ + readonly encoding: string; + /** Returns `true` if error mode is "fatal", and `false` otherwise. */ + readonly fatal: boolean; + /** Returns `true` if ignore BOM flag is set, and `false` otherwise. */ + readonly ignoreBOM: boolean; + readonly readable: ReadableStream; + readonly writable: WritableStream; + readonly [Symbol.toStringTag]: string; + } + const TextDecoderStream: { + prototype: TextDecoderStream; + new (label?: string, options?: TextDecoderOptions): TextDecoderStream; + }; +} +declare module 'stream/web' { + export * from 'node:stream/web'; +} diff --git a/node_modules/@types/node/string_decoder.d.ts b/node_modules/@types/node/string_decoder.d.ts new file mode 100644 index 0000000..c87e7d5 --- /dev/null +++ b/node_modules/@types/node/string_decoder.d.ts @@ -0,0 +1,67 @@ +/** + * The `node:string_decoder` module provides an API for decoding `Buffer` objects + * into strings in a manner that preserves encoded multi-byte UTF-8 and UTF-16 + * characters. It can be accessed using: + * + * ```js + * const { StringDecoder } = require('node:string_decoder'); + * ``` + * + * The following example shows the basic use of the `StringDecoder` class. + * + * ```js + * const { StringDecoder } = require('node:string_decoder'); + * const decoder = new StringDecoder('utf8'); + * + * const cent = Buffer.from([0xC2, 0xA2]); + * console.log(decoder.write(cent)); + * + * const euro = Buffer.from([0xE2, 0x82, 0xAC]); + * console.log(decoder.write(euro)); + * ``` + * + * When a `Buffer` instance is written to the `StringDecoder` instance, an + * internal buffer is used to ensure that the decoded string does not contain + * any incomplete multibyte characters. These are held in the buffer until the + * next call to `stringDecoder.write()` or until `stringDecoder.end()` is called. + * + * In the following example, the three UTF-8 encoded bytes of the European Euro + * symbol (`€`) are written over three separate operations: + * + * ```js + * const { StringDecoder } = require('node:string_decoder'); + * const decoder = new StringDecoder('utf8'); + * + * decoder.write(Buffer.from([0xE2])); + * decoder.write(Buffer.from([0x82])); + * console.log(decoder.end(Buffer.from([0xAC]))); + * ``` + * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/string_decoder.js) + */ +declare module 'node:string_decoder' { + class StringDecoder { + constructor(encoding?: BufferEncoding); + /** + * Returns a decoded string, ensuring that any incomplete multibyte characters at + * the end of the `Buffer`, or `TypedArray`, or `DataView` are omitted from the + * returned string and stored in an internal buffer for the next call to`stringDecoder.write()` or `stringDecoder.end()`. + * @since v0.1.99 + * @param buffer A `Buffer`, or `TypedArray`, or `DataView` containing the bytes to decode. + */ + write(buffer: Buffer): string; + /** + * Returns any remaining input stored in the internal buffer as a string. Bytes + * representing incomplete UTF-8 and UTF-16 characters will be replaced with + * substitution characters appropriate for the character encoding. + * + * If the `buffer` argument is provided, one final call to `stringDecoder.write()`is performed before returning the remaining input. + * After `end()` is called, the `stringDecoder` object can be reused for new input. + * @since v0.9.3 + * @param buffer A `Buffer`, or `TypedArray`, or `DataView` containing the bytes to decode. + */ + end(buffer?: Buffer): string; + } +} +declare module 'string_decoder' { + export * from 'node:string_decoder'; +} diff --git a/node_modules/@types/node/test.d.ts b/node_modules/@types/node/test.d.ts new file mode 100644 index 0000000..81c73a8 --- /dev/null +++ b/node_modules/@types/node/test.d.ts @@ -0,0 +1,1461 @@ +/** + * The `node:test` module facilitates the creation of JavaScript tests. + * To access it: + * + * ```js + * import test from 'node:test'; + * ``` + * + * This module is only available under the `node:` scheme. The following will not + * work: + * + * ```js + * import test from 'test'; + * ``` + * + * Tests created via the `test` module consist of a single function that is + * processed in one of three ways: + * + * 1. A synchronous function that is considered failing if it throws an exception, + * and is considered passing otherwise. + * 2. A function that returns a `Promise` that is considered failing if the`Promise` rejects, and is considered passing if the `Promise` resolves. + * 3. A function that receives a callback function. If the callback receives any + * truthy value as its first argument, the test is considered failing. If a + * falsy value is passed as the first argument to the callback, the test is + * considered passing. If the test function receives a callback function and + * also returns a `Promise`, the test will fail. + * + * The following example illustrates how tests are written using the`test` module. + * + * ```js + * test('synchronous passing test', (t) => { + * // This test passes because it does not throw an exception. + * assert.strictEqual(1, 1); + * }); + * + * test('synchronous failing test', (t) => { + * // This test fails because it throws an exception. + * assert.strictEqual(1, 2); + * }); + * + * test('asynchronous passing test', async (t) => { + * // This test passes because the Promise returned by the async + * // function is not rejected. + * assert.strictEqual(1, 1); + * }); + * + * test('asynchronous failing test', async (t) => { + * // This test fails because the Promise returned by the async + * // function is rejected. + * assert.strictEqual(1, 2); + * }); + * + * test('failing test using Promises', (t) => { + * // Promises can be used directly as well. + * return new Promise((resolve, reject) => { + * setImmediate(() => { + * reject(new Error('this will cause the test to fail')); + * }); + * }); + * }); + * + * test('callback passing test', (t, done) => { + * // done() is the callback function. When the setImmediate() runs, it invokes + * // done() with no arguments. + * setImmediate(done); + * }); + * + * test('callback failing test', (t, done) => { + * // When the setImmediate() runs, done() is invoked with an Error object and + * // the test fails. + * setImmediate(() => { + * done(new Error('callback failure')); + * }); + * }); + * ``` + * + * If any tests fail, the process exit code is set to `1`. + * @since v18.0.0, v16.17.0 + * @see [source](https://github.com/nodejs/node/blob/v20.4.0/lib/test.js) + */ +declare module 'node:test' { + import { Readable } from 'node:stream'; + import { AsyncResource } from 'node:async_hooks'; + /** + * ```js + * import { tap } from 'node:test/reporters'; + * import process from 'node:process'; + * + * run({ files: [path.resolve('./tests/test.js')] }) + * .compose(tap) + * .pipe(process.stdout); + * ``` + * @since v18.9.0, v16.19.0 + * @param options Configuration options for running tests. The following properties are supported: + */ + function run(options?: RunOptions): TestsStream; + /** + * The `test()` function is the value imported from the `test` module. Each + * invocation of this function results in reporting the test to the `TestsStream`. + * + * The `TestContext` object passed to the `fn` argument can be used to perform + * actions related to the current test. Examples include skipping the test, adding + * additional diagnostic information, or creating subtests. + * + * `test()` returns a `Promise` that resolves once the test completes. + * if `test()` is called within a `describe()` block, it resolve immediately. + * The return value can usually be discarded for top level tests. + * However, the return value from subtests should be used to prevent the parent + * test from finishing first and cancelling the subtest + * as shown in the following example. + * + * ```js + * test('top level test', async (t) => { + * // The setTimeout() in the following subtest would cause it to outlive its + * // parent test if 'await' is removed on the next line. Once the parent test + * // completes, it will cancel any outstanding subtests. + * await t.test('longer running subtest', async (t) => { + * return new Promise((resolve, reject) => { + * setTimeout(resolve, 1000); + * }); + * }); + * }); + * ``` + * + * The `timeout` option can be used to fail the test if it takes longer than`timeout` milliseconds to complete. However, it is not a reliable mechanism for + * canceling tests because a running test might block the application thread and + * thus prevent the scheduled cancellation. + * @since v18.0.0, v16.17.0 + * @param [name='The name'] The name of the test, which is displayed when reporting test results. + * @param options Configuration options for the test. The following properties are supported: + * @param [fn='A no-op function'] The function under test. The first argument to this function is a {@link TestContext} object. If the test uses callbacks, the callback function is passed as the + * second argument. + * @return Resolved with `undefined` once the test completes, or immediately if the test runs within {@link describe}. + */ + function test(name?: string, fn?: TestFn): Promise; + function test(name?: string, options?: TestOptions, fn?: TestFn): Promise; + function test(options?: TestOptions, fn?: TestFn): Promise; + function test(fn?: TestFn): Promise; + namespace test { + export { + after, + afterEach, + before, + beforeEach, + describe, + it, + run, + mock, + test, + skip, + todo, + only + }; + } + /** + * The `describe()` function imported from the `node:test` module. Each + * invocation of this function results in the creation of a Subtest. + * After invocation of top level `describe` functions, + * all top level tests and suites will execute. + * @param [name='The name'] The name of the suite, which is displayed when reporting test results. + * @param options Configuration options for the suite. supports the same options as `test([name][, options][, fn])`. + * @param [fn='A no-op function'] The function under suite declaring all subtests and subsuites. The first argument to this function is a {@link SuiteContext} object. + * @return Immediately fulfilled with `undefined`. + */ + function describe(name?: string, options?: TestOptions, fn?: SuiteFn): Promise; + function describe(name?: string, fn?: SuiteFn): Promise; + function describe(options?: TestOptions, fn?: SuiteFn): Promise; + function describe(fn?: SuiteFn): Promise; + namespace describe { + /** + * Shorthand for skipping a suite, same as `describe([name], { skip: true }[, fn])`. + */ + function skip(name?: string, options?: TestOptions, fn?: SuiteFn): Promise; + function skip(name?: string, fn?: SuiteFn): Promise; + function skip(options?: TestOptions, fn?: SuiteFn): Promise; + function skip(fn?: SuiteFn): Promise; + /** + * Shorthand for marking a suite as `TODO`, same as `describe([name], { todo: true }[, fn])`. + */ + function todo(name?: string, options?: TestOptions, fn?: SuiteFn): Promise; + function todo(name?: string, fn?: SuiteFn): Promise; + function todo(options?: TestOptions, fn?: SuiteFn): Promise; + function todo(fn?: SuiteFn): Promise; + /** + * Shorthand for marking a suite as `only`, same as `describe([name], { only: true }[, fn])`. + * @since v18.15.0 + */ + function only(name?: string, options?: TestOptions, fn?: SuiteFn): Promise; + function only(name?: string, fn?: SuiteFn): Promise; + function only(options?: TestOptions, fn?: SuiteFn): Promise; + function only(fn?: SuiteFn): Promise; + } + /** + * Shorthand for `test()`. + * + * The `it()` function is imported from the `node:test` module. + * @since v18.6.0, v16.17.0 + */ + function it(name?: string, options?: TestOptions, fn?: TestFn): Promise; + function it(name?: string, fn?: TestFn): Promise; + function it(options?: TestOptions, fn?: TestFn): Promise; + function it(fn?: TestFn): Promise; + namespace it { + /** + * Shorthand for skipping a test, same as `it([name], { skip: true }[, fn])`. + */ + function skip(name?: string, options?: TestOptions, fn?: TestFn): Promise; + function skip(name?: string, fn?: TestFn): Promise; + function skip(options?: TestOptions, fn?: TestFn): Promise; + function skip(fn?: TestFn): Promise; + /** + * Shorthand for marking a test as `TODO`, same as `it([name], { todo: true }[, fn])`. + */ + function todo(name?: string, options?: TestOptions, fn?: TestFn): Promise; + function todo(name?: string, fn?: TestFn): Promise; + function todo(options?: TestOptions, fn?: TestFn): Promise; + function todo(fn?: TestFn): Promise; + /** + * Shorthand for marking a test as `only`, same as `it([name], { only: true }[, fn])`. + * @since v18.15.0 + */ + function only(name?: string, options?: TestOptions, fn?: TestFn): Promise; + function only(name?: string, fn?: TestFn): Promise; + function only(options?: TestOptions, fn?: TestFn): Promise; + function only(fn?: TestFn): Promise; + } + /** + * Shorthand for skipping a test, same as `test([name], { skip: true }[, fn])`. + * @since v20.2.0 + */ + function skip(name?: string, options?: TestOptions, fn?: TestFn): Promise; + function skip(name?: string, fn?: TestFn): Promise; + function skip(options?: TestOptions, fn?: TestFn): Promise; + function skip(fn?: TestFn): Promise; + /** + * Shorthand for marking a test as `TODO`, same as `test([name], { todo: true }[, fn])`. + * @since v20.2.0 + */ + function todo(name?: string, options?: TestOptions, fn?: TestFn): Promise; + function todo(name?: string, fn?: TestFn): Promise; + function todo(options?: TestOptions, fn?: TestFn): Promise; + function todo(fn?: TestFn): Promise; + /** + * Shorthand for marking a test as `only`, same as `test([name], { only: true }[, fn])`. + * @since v20.2.0 + */ + function only(name?: string, options?: TestOptions, fn?: TestFn): Promise; + function only(name?: string, fn?: TestFn): Promise; + function only(options?: TestOptions, fn?: TestFn): Promise; + function only(fn?: TestFn): Promise; + /** + * The type of a function under test. The first argument to this function is a + * {@link TestContext} object. If the test uses callbacks, the callback function is passed as + * the second argument. + */ + type TestFn = (t: TestContext, done: (result?: any) => void) => void | Promise; + /** + * The type of a function under Suite. + */ + type SuiteFn = (s: SuiteContext) => void | Promise; + interface TestShard { + /** + * A positive integer between 1 and `` that specifies the index of the shard to run. + */ + index: number; + /** + * A positive integer that specifies the total number of shards to split the test files to. + */ + total: number; + } + interface RunOptions { + /** + * If a number is provided, then that many files would run in parallel. + * If truthy, it would run (number of cpu cores - 1) files in parallel. + * If falsy, it would only run one file at a time. + * If unspecified, subtests inherit this value from their parent. + * @default true + */ + concurrency?: number | boolean | undefined; + /** + * An array containing the list of files to run. + * If unspecified, the test runner execution model will be used. + */ + files?: readonly string[] | undefined; + /** + * Allows aborting an in-progress test execution. + * @default undefined + */ + signal?: AbortSignal | undefined; + /** + * A number of milliseconds the test will fail after. + * If unspecified, subtests inherit this value from their parent. + * @default Infinity + */ + timeout?: number | undefined; + /** + * Sets inspector port of test child process. + * If a nullish value is provided, each process gets its own port, + * incremented from the primary's `process.debugPort`. + */ + inspectPort?: number | (() => number) | undefined; + /** + * That can be used to only run tests whose name matches the provided pattern. + * Test name patterns are interpreted as JavaScript regular expressions. + * For each test that is executed, any corresponding test hooks, such as `beforeEach()`, are also run. + */ + testNamePatterns?: string | RegExp | string[] | RegExp[]; + /** + * A function that accepts the TestsStream instance and can be used to setup listeners before any tests are run. + */ + setup?: (root: Test) => void | Promise; + /** + * Whether to run in watch mode or not. + * @default false + */ + watch?: boolean | undefined; + /** + * Running tests in a specific shard. + * @default undefined + */ + shard?: TestShard | undefined; + } + class Test extends AsyncResource { + concurrency: number; + nesting: number; + only: boolean; + reporter: TestsStream; + runOnlySubtests: boolean; + testNumber: number; + timeout: number | null; + } + /** + * A successful call to `run()` method will return a new `TestsStream` object, streaming a series of events representing the execution of the tests.`TestsStream` will emit events, in the + * order of the tests definition + * @since v18.9.0, v16.19.0 + */ + class TestsStream extends Readable implements NodeJS.ReadableStream { + addListener(event: 'test:diagnostic', listener: (data: DiagnosticData) => void): this; + addListener(event: 'test:fail', listener: (data: TestFail) => void): this; + addListener(event: 'test:pass', listener: (data: TestPass) => void): this; + addListener(event: 'test:plan', listener: (data: TestPlan) => void): this; + addListener(event: 'test:start', listener: (data: TestStart) => void): this; + addListener(event: 'test:stderr', listener: (data: TestStderr) => void): this; + addListener(event: 'test:stdout', listener: (data: TestStdout) => void): this; + addListener(event: string, listener: (...args: any[]) => void): this; + emit(event: 'test:diagnostic', data: DiagnosticData): boolean; + emit(event: 'test:fail', data: TestFail): boolean; + emit(event: 'test:pass', data: TestPass): boolean; + emit(event: 'test:plan', data: TestPlan): boolean; + emit(event: 'test:start', data: TestStart): boolean; + emit(event: 'test:stderr', data: TestStderr): boolean; + emit(event: 'test:stdout', data: TestStdout): boolean; + emit(event: string | symbol, ...args: any[]): boolean; + on(event: 'test:diagnostic', listener: (data: DiagnosticData) => void): this; + on(event: 'test:fail', listener: (data: TestFail) => void): this; + on(event: 'test:pass', listener: (data: TestPass) => void): this; + on(event: 'test:plan', listener: (data: TestPlan) => void): this; + on(event: 'test:start', listener: (data: TestStart) => void): this; + on(event: 'test:stderr', listener: (data: TestStderr) => void): this; + on(event: 'test:stdout', listener: (data: TestStdout) => void): this; + on(event: string, listener: (...args: any[]) => void): this; + once(event: 'test:diagnostic', listener: (data: DiagnosticData) => void): this; + once(event: 'test:fail', listener: (data: TestFail) => void): this; + once(event: 'test:pass', listener: (data: TestPass) => void): this; + once(event: 'test:plan', listener: (data: TestPlan) => void): this; + once(event: 'test:start', listener: (data: TestStart) => void): this; + once(event: 'test:stderr', listener: (data: TestStderr) => void): this; + once(event: 'test:stdout', listener: (data: TestStdout) => void): this; + once(event: string, listener: (...args: any[]) => void): this; + prependListener(event: 'test:diagnostic', listener: (data: DiagnosticData) => void): this; + prependListener(event: 'test:fail', listener: (data: TestFail) => void): this; + prependListener(event: 'test:pass', listener: (data: TestPass) => void): this; + prependListener(event: 'test:plan', listener: (data: TestPlan) => void): this; + prependListener(event: 'test:start', listener: (data: TestStart) => void): this; + prependListener(event: 'test:stderr', listener: (data: TestStderr) => void): this; + prependListener(event: 'test:stdout', listener: (data: TestStdout) => void): this; + prependListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'test:diagnostic', listener: (data: DiagnosticData) => void): this; + prependOnceListener(event: 'test:fail', listener: (data: TestFail) => void): this; + prependOnceListener(event: 'test:pass', listener: (data: TestPass) => void): this; + prependOnceListener(event: 'test:plan', listener: (data: TestPlan) => void): this; + prependOnceListener(event: 'test:start', listener: (data: TestStart) => void): this; + prependOnceListener(event: 'test:stderr', listener: (data: TestStderr) => void): this; + prependOnceListener(event: 'test:stdout', listener: (data: TestStdout) => void): this; + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + } + /** + * An instance of `TestContext` is passed to each test function in order to + * interact with the test runner. However, the `TestContext` constructor is not + * exposed as part of the API. + * @since v18.0.0, v16.17.0 + */ + class TestContext { + /** + * This function is used to create a hook running before subtest of the current test. + * @param fn The hook function. If the hook uses callbacks, the callback function is passed as + * the second argument. Default: A no-op function. + * @param options Configuration options for the hook. + * @since v20.1.0 + */ + before: typeof before; + /** + * This function is used to create a hook running before each subtest of the current test. + * @param fn The hook function. If the hook uses callbacks, the callback function is passed as + * the second argument. Default: A no-op function. + * @param options Configuration options for the hook. + * @since v18.8.0 + */ + beforeEach: typeof beforeEach; + /** + * This function is used to create a hook that runs after the current test finishes. + * @param fn The hook function. If the hook uses callbacks, the callback function is passed as + * the second argument. Default: A no-op function. + * @param options Configuration options for the hook. + * @since v18.13.0 + */ + after: typeof after; + /** + * This function is used to create a hook running after each subtest of the current test. + * @param fn The hook function. If the hook uses callbacks, the callback function is passed as + * the second argument. Default: A no-op function. + * @param options Configuration options for the hook. + * @since v18.8.0 + */ + afterEach: typeof afterEach; + /** + * This function is used to write diagnostics to the output. Any diagnostic + * information is included at the end of the test's results. This function does + * not return a value. + * + * ```js + * test('top level test', (t) => { + * t.diagnostic('A diagnostic message'); + * }); + * ``` + * @since v18.0.0, v16.17.0 + * @param message Message to be reported. + */ + diagnostic(message: string): void; + /** + * The name of the test. + * @since v18.8.0, v16.18.0 + */ + readonly name: string; + /** + * If `shouldRunOnlyTests` is truthy, the test context will only run tests that + * have the `only` option set. Otherwise, all tests are run. If Node.js was not + * started with the `--test-only` command-line option, this function is a + * no-op. + * + * ```js + * test('top level test', (t) => { + * // The test context can be set to run subtests with the 'only' option. + * t.runOnly(true); + * return Promise.all([ + * t.test('this subtest is now skipped'), + * t.test('this subtest is run', { only: true }), + * ]); + * }); + * ``` + * @since v18.0.0, v16.17.0 + * @param shouldRunOnlyTests Whether or not to run `only` tests. + */ + runOnly(shouldRunOnlyTests: boolean): void; + /** + * ```js + * test('top level test', async (t) => { + * await fetch('some/uri', { signal: t.signal }); + * }); + * ``` + * @since v18.7.0, v16.17.0 + */ + readonly signal: AbortSignal; + /** + * This function causes the test's output to indicate the test as skipped. If`message` is provided, it is included in the output. Calling `skip()` does + * not terminate execution of the test function. This function does not return a + * value. + * + * ```js + * test('top level test', (t) => { + * // Make sure to return here as well if the test contains additional logic. + * t.skip('this is skipped'); + * }); + * ``` + * @since v18.0.0, v16.17.0 + * @param message Optional skip message. + */ + skip(message?: string): void; + /** + * This function adds a `TODO` directive to the test's output. If `message` is + * provided, it is included in the output. Calling `todo()` does not terminate + * execution of the test function. This function does not return a value. + * + * ```js + * test('top level test', (t) => { + * // This test is marked as `TODO` + * t.todo('this is a todo'); + * }); + * ``` + * @since v18.0.0, v16.17.0 + * @param message Optional `TODO` message. + */ + todo(message?: string): void; + /** + * This function is used to create subtests under the current test. This function behaves in + * the same fashion as the top level {@link test} function. + * @since v18.0.0 + * @param name The name of the test, which is displayed when reporting test results. + * Default: The `name` property of fn, or `''` if `fn` does not have a name. + * @param options Configuration options for the test + * @param fn The function under test. This first argument to this function is a + * {@link TestContext} object. If the test uses callbacks, the callback function is + * passed as the second argument. Default: A no-op function. + * @returns A {@link Promise} resolved with `undefined` once the test completes. + */ + test: typeof test; + /** + * Each test provides its own MockTracker instance. + */ + readonly mock: MockTracker; + } + /** + * An instance of `SuiteContext` is passed to each suite function in order to + * interact with the test runner. However, the `SuiteContext` constructor is not + * exposed as part of the API. + * @since v18.7.0, v16.17.0 + */ + class SuiteContext { + /** + * The name of the suite. + * @since v18.8.0, v16.18.0 + */ + readonly name: string; + /** + * Can be used to abort test subtasks when the test has been aborted. + * @since v18.7.0, v16.17.0 + */ + readonly signal: AbortSignal; + } + interface TestOptions { + /** + * If a number is provided, then that many tests would run in parallel. + * If truthy, it would run (number of cpu cores - 1) tests in parallel. + * For subtests, it will be `Infinity` tests in parallel. + * If falsy, it would only run one test at a time. + * If unspecified, subtests inherit this value from their parent. + * @default false + */ + concurrency?: number | boolean | undefined; + /** + * If truthy, and the test context is configured to run `only` tests, then this test will be + * run. Otherwise, the test is skipped. + * @default false + */ + only?: boolean | undefined; + /** + * Allows aborting an in-progress test. + * @since v18.8.0 + */ + signal?: AbortSignal | undefined; + /** + * If truthy, the test is skipped. If a string is provided, that string is displayed in the + * test results as the reason for skipping the test. + * @default false + */ + skip?: boolean | string | undefined; + /** + * A number of milliseconds the test will fail after. If unspecified, subtests inherit this + * value from their parent. + * @default Infinity + * @since v18.7.0 + */ + timeout?: number | undefined; + /** + * If truthy, the test marked as `TODO`. If a string is provided, that string is displayed in + * the test results as the reason why the test is `TODO`. + * @default false + */ + todo?: boolean | string | undefined; + } + /** + * This function is used to create a hook running before running a suite. + * + * ```js + * describe('tests', async () => { + * before(() => console.log('about to run some test')); + * it('is a subtest', () => { + * assert.ok('some relevant assertion here'); + * }); + * }); + * ``` + * @since v18.8.0, v16.18.0 + * @param [fn='A no-op function'] The hook function. If the hook uses callbacks, the callback function is passed as the second argument. + * @param options Configuration options for the hook. The following properties are supported: + */ + function before(fn?: HookFn, options?: HookOptions): void; + /** + * This function is used to create a hook running after running a suite. + * + * ```js + * describe('tests', async () => { + * after(() => console.log('finished running tests')); + * it('is a subtest', () => { + * assert.ok('some relevant assertion here'); + * }); + * }); + * ``` + * @since v18.8.0, v16.18.0 + * @param [fn='A no-op function'] The hook function. If the hook uses callbacks, the callback function is passed as the second argument. + * @param options Configuration options for the hook. The following properties are supported: + */ + function after(fn?: HookFn, options?: HookOptions): void; + /** + * This function is used to create a hook running + * before each subtest of the current suite. + * + * ```js + * describe('tests', async () => { + * beforeEach(() => console.log('about to run a test')); + * it('is a subtest', () => { + * assert.ok('some relevant assertion here'); + * }); + * }); + * ``` + * @since v18.8.0, v16.18.0 + * @param [fn='A no-op function'] The hook function. If the hook uses callbacks, the callback function is passed as the second argument. + * @param options Configuration options for the hook. The following properties are supported: + */ + function beforeEach(fn?: HookFn, options?: HookOptions): void; + /** + * This function is used to create a hook running + * after each subtest of the current test. + * + * ```js + * describe('tests', async () => { + * afterEach(() => console.log('finished running a test')); + * it('is a subtest', () => { + * assert.ok('some relevant assertion here'); + * }); + * }); + * ``` + * @since v18.8.0, v16.18.0 + * @param [fn='A no-op function'] The hook function. If the hook uses callbacks, the callback function is passed as the second argument. + * @param options Configuration options for the hook. The following properties are supported: + */ + function afterEach(fn?: HookFn, options?: HookOptions): void; + /** + * The hook function. If the hook uses callbacks, the callback function is passed as the + * second argument. + */ + type HookFn = (s: SuiteContext, done: (result?: any) => void) => any; + /** + * Configuration options for hooks. + * @since v18.8.0 + */ + interface HookOptions { + /** + * Allows aborting an in-progress hook. + */ + signal?: AbortSignal | undefined; + /** + * A number of milliseconds the hook will fail after. If unspecified, subtests inherit this + * value from their parent. + * @default Infinity + */ + timeout?: number | undefined; + } + interface MockFunctionOptions { + /** + * The number of times that the mock will use the behavior of `implementation`. + * Once the mock function has been called `times` times, + * it will automatically restore the behavior of `original`. + * This value must be an integer greater than zero. + * @default Infinity + */ + times?: number | undefined; + } + interface MockMethodOptions extends MockFunctionOptions { + /** + * If `true`, `object[methodName]` is treated as a getter. + * This option cannot be used with the `setter` option. + */ + getter?: boolean | undefined; + /** + * If `true`, `object[methodName]` is treated as a setter. + * This option cannot be used with the `getter` option. + */ + setter?: boolean | undefined; + } + type Mock = F & { + mock: MockFunctionContext; + }; + type NoOpFunction = (...args: any[]) => undefined; + type FunctionPropertyNames = { + [K in keyof T]: T[K] extends Function ? K : never; + }[keyof T]; + /** + * The `MockTracker` class is used to manage mocking functionality. The test runner + * module provides a top level `mock` export which is a `MockTracker` instance. + * Each test also provides its own `MockTracker` instance via the test context's`mock` property. + * @since v19.1.0, v18.13.0 + */ + class MockTracker { + /** + * This function is used to create a mock function. + * + * The following example creates a mock function that increments a counter by one + * on each invocation. The `times` option is used to modify the mock behavior such + * that the first two invocations add two to the counter instead of one. + * + * ```js + * test('mocks a counting function', (t) => { + * let cnt = 0; + * + * function addOne() { + * cnt++; + * return cnt; + * } + * + * function addTwo() { + * cnt += 2; + * return cnt; + * } + * + * const fn = t.mock.fn(addOne, addTwo, { times: 2 }); + * + * assert.strictEqual(fn(), 2); + * assert.strictEqual(fn(), 4); + * assert.strictEqual(fn(), 5); + * assert.strictEqual(fn(), 6); + * }); + * ``` + * @since v19.1.0, v18.13.0 + * @param [original='A no-op function'] An optional function to create a mock on. + * @param implementation An optional function used as the mock implementation for `original`. This is useful for creating mocks that exhibit one behavior for a specified number of calls and + * then restore the behavior of `original`. + * @param options Optional configuration options for the mock function. The following properties are supported: + * @return The mocked function. The mocked function contains a special `mock` property, which is an instance of {@link MockFunctionContext}, and can be used for inspecting and changing the + * behavior of the mocked function. + */ + fn(original?: F, options?: MockFunctionOptions): Mock; + fn(original?: F, implementation?: Implementation, options?: MockFunctionOptions): Mock; + /** + * This function is used to create a mock on an existing object method. The + * following example demonstrates how a mock is created on an existing object + * method. + * + * ```js + * test('spies on an object method', (t) => { + * const number = { + * value: 5, + * subtract(a) { + * return this.value - a; + * }, + * }; + * + * t.mock.method(number, 'subtract'); + * assert.strictEqual(number.subtract.mock.calls.length, 0); + * assert.strictEqual(number.subtract(3), 2); + * assert.strictEqual(number.subtract.mock.calls.length, 1); + * + * const call = number.subtract.mock.calls[0]; + * + * assert.deepStrictEqual(call.arguments, [3]); + * assert.strictEqual(call.result, 2); + * assert.strictEqual(call.error, undefined); + * assert.strictEqual(call.target, undefined); + * assert.strictEqual(call.this, number); + * }); + * ``` + * @since v19.1.0, v18.13.0 + * @param object The object whose method is being mocked. + * @param methodName The identifier of the method on `object` to mock. If `object[methodName]` is not a function, an error is thrown. + * @param implementation An optional function used as the mock implementation for `object[methodName]`. + * @param options Optional configuration options for the mock method. The following properties are supported: + * @return The mocked method. The mocked method contains a special `mock` property, which is an instance of {@link MockFunctionContext}, and can be used for inspecting and changing the + * behavior of the mocked method. + */ + method< + MockedObject extends object, + MethodName extends FunctionPropertyNames, + >( + object: MockedObject, + methodName: MethodName, + options?: MockFunctionOptions, + ): MockedObject[MethodName] extends Function + ? Mock + : never; + method< + MockedObject extends object, + MethodName extends FunctionPropertyNames, + Implementation extends Function, + >( + object: MockedObject, + methodName: MethodName, + implementation: Implementation, + options?: MockFunctionOptions, + ): MockedObject[MethodName] extends Function + ? Mock + : never; + method( + object: MockedObject, + methodName: keyof MockedObject, + options: MockMethodOptions, + ): Mock; + method( + object: MockedObject, + methodName: keyof MockedObject, + implementation: Function, + options: MockMethodOptions, + ): Mock; + + /** + * This function is syntax sugar for `MockTracker.method` with `options.getter`set to `true`. + * @since v19.3.0, v18.13.0 + */ + getter< + MockedObject extends object, + MethodName extends keyof MockedObject, + >( + object: MockedObject, + methodName: MethodName, + options?: MockFunctionOptions, + ): Mock<() => MockedObject[MethodName]>; + getter< + MockedObject extends object, + MethodName extends keyof MockedObject, + Implementation extends Function, + >( + object: MockedObject, + methodName: MethodName, + implementation?: Implementation, + options?: MockFunctionOptions, + ): Mock<(() => MockedObject[MethodName]) | Implementation>; + /** + * This function is syntax sugar for `MockTracker.method` with `options.setter`set to `true`. + * @since v19.3.0, v18.13.0 + */ + setter< + MockedObject extends object, + MethodName extends keyof MockedObject, + >( + object: MockedObject, + methodName: MethodName, + options?: MockFunctionOptions, + ): Mock<(value: MockedObject[MethodName]) => void>; + setter< + MockedObject extends object, + MethodName extends keyof MockedObject, + Implementation extends Function, + >( + object: MockedObject, + methodName: MethodName, + implementation?: Implementation, + options?: MockFunctionOptions, + ): Mock<((value: MockedObject[MethodName]) => void) | Implementation>; + /** + * This function restores the default behavior of all mocks that were previously + * created by this `MockTracker` and disassociates the mocks from the`MockTracker` instance. Once disassociated, the mocks can still be used, but the`MockTracker` instance can no longer be + * used to reset their behavior or + * otherwise interact with them. + * + * After each test completes, this function is called on the test context's`MockTracker`. If the global `MockTracker` is used extensively, calling this + * function manually is recommended. + * @since v19.1.0, v18.13.0 + */ + reset(): void; + /** + * This function restores the default behavior of all mocks that were previously + * created by this `MockTracker`. Unlike `mock.reset()`, `mock.restoreAll()` does + * not disassociate the mocks from the `MockTracker` instance. + * @since v19.1.0, v18.13.0 + */ + restoreAll(): void; + timers: MockTimers; + } + const mock: MockTracker; + interface MockFunctionCall< + F extends Function, + ReturnType = F extends (...args: any) => infer T + ? T + : F extends abstract new (...args: any) => infer T + ? T + : unknown, + Args = F extends (...args: infer Y) => any + ? Y + : F extends abstract new (...args: infer Y) => any + ? Y + : unknown[], + > { + /** + * An array of the arguments passed to the mock function. + */ + arguments: Args; + /** + * If the mocked function threw then this property contains the thrown value. + */ + error: unknown | undefined; + /** + * The value returned by the mocked function. + * + * If the mocked function threw, it will be `undefined`. + */ + result: ReturnType | undefined; + /** + * An `Error` object whose stack can be used to determine the callsite of the mocked function invocation. + */ + stack: Error; + /** + * If the mocked function is a constructor, this field contains the class being constructed. + * Otherwise this will be `undefined`. + */ + target: F extends abstract new (...args: any) => any ? F : undefined; + /** + * The mocked function's `this` value. + */ + this: unknown; + } + /** + * The `MockFunctionContext` class is used to inspect or manipulate the behavior of + * mocks created via the `MockTracker` APIs. + * @since v19.1.0, v18.13.0 + */ + class MockFunctionContext { + /** + * A getter that returns a copy of the internal array used to track calls to the + * mock. Each entry in the array is an object with the following properties. + * @since v19.1.0, v18.13.0 + */ + readonly calls: Array>; + /** + * This function returns the number of times that this mock has been invoked. This + * function is more efficient than checking `ctx.calls.length` because `ctx.calls`is a getter that creates a copy of the internal call tracking array. + * @since v19.1.0, v18.13.0 + * @return The number of times that this mock has been invoked. + */ + callCount(): number; + /** + * This function is used to change the behavior of an existing mock. + * + * The following example creates a mock function using `t.mock.fn()`, calls the + * mock function, and then changes the mock implementation to a different function. + * + * ```js + * test('changes a mock behavior', (t) => { + * let cnt = 0; + * + * function addOne() { + * cnt++; + * return cnt; + * } + * + * function addTwo() { + * cnt += 2; + * return cnt; + * } + * + * const fn = t.mock.fn(addOne); + * + * assert.strictEqual(fn(), 1); + * fn.mock.mockImplementation(addTwo); + * assert.strictEqual(fn(), 3); + * assert.strictEqual(fn(), 5); + * }); + * ``` + * @since v19.1.0, v18.13.0 + * @param implementation The function to be used as the mock's new implementation. + */ + mockImplementation(implementation: Function): void; + /** + * This function is used to change the behavior of an existing mock for a single + * invocation. Once invocation `onCall` has occurred, the mock will revert to + * whatever behavior it would have used had `mockImplementationOnce()` not been + * called. + * + * The following example creates a mock function using `t.mock.fn()`, calls the + * mock function, changes the mock implementation to a different function for the + * next invocation, and then resumes its previous behavior. + * + * ```js + * test('changes a mock behavior once', (t) => { + * let cnt = 0; + * + * function addOne() { + * cnt++; + * return cnt; + * } + * + * function addTwo() { + * cnt += 2; + * return cnt; + * } + * + * const fn = t.mock.fn(addOne); + * + * assert.strictEqual(fn(), 1); + * fn.mock.mockImplementationOnce(addTwo); + * assert.strictEqual(fn(), 3); + * assert.strictEqual(fn(), 4); + * }); + * ``` + * @since v19.1.0, v18.13.0 + * @param implementation The function to be used as the mock's implementation for the invocation number specified by `onCall`. + * @param onCall The invocation number that will use `implementation`. If the specified invocation has already occurred then an exception is thrown. + */ + mockImplementationOnce(implementation: Function, onCall?: number): void; + /** + * Resets the call history of the mock function. + * @since v19.3.0, v18.13.0 + */ + resetCalls(): void; + /** + * Resets the implementation of the mock function to its original behavior. The + * mock can still be used after calling this function. + * @since v19.1.0, v18.13.0 + */ + restore(): void; + } + type Timer = 'setInterval' | 'clearInterval' | 'setTimeout' | 'clearTimeout'; + /** + * Mocking timers is a technique commonly used in software testing to simulate and + * control the behavior of timers, such as `setInterval` and `setTimeout`, + * without actually waiting for the specified time intervals. + * + * The `MockTracker` provides a top-level `timers` export + * which is a `MockTimers` instance. + * @since v20.4.0 + * @experimental + */ + class MockTimers { + /** + * Enables timer mocking for the specified timers. + * + * **Note:** When you enable mocking for a specific timer, its associated + * clear function will also be implicitly mocked. + * + * Example usage: + * + * ```js + * import { mock } from 'node:test'; + * mock.timers.enable(['setInterval']); + * ``` + * + * ```js + * const { mock } = require('node:test'); + * mock.timers.enable(['setInterval']); + * ``` + * + * The above example enables mocking for the `setInterval` timer and + * implicitly mocks the `clearInterval` function. Only the `setInterval`and `clearInterval` functions from `node:timers`,`node:timers/promises`, and`globalThis` will be mocked. + * + * Alternatively, if you call `mock.timers.enable()` without any parameters: + * + * All timers (`'setInterval'`, `'clearInterval'`, `'setTimeout'`, and `'clearTimeout'`) + * will be mocked. The `setInterval`, `clearInterval`, `setTimeout`, and `clearTimeout`functions from `node:timers`, `node:timers/promises`, + * and `globalThis` will be mocked. + * @since v20.4.0 + */ + enable(timers?: Timer[]): void; + /** + * This function restores the default behavior of all mocks that were previously + * created by this `MockTimers` instance and disassociates the mocks + * from the `MockTracker` instance. + * + * **Note:** After each test completes, this function is called on + * the test context's `MockTracker`. + * + * ```js + * import { mock } from 'node:test'; + * mock.timers.reset(); + * ``` + * + * ```js + * const { mock } = require('node:test'); + * mock.timers.reset(); + * ``` + * @since v20.4.0 + */ + reset(): void; + /** + * Advances time for all mocked timers. + * + * **Note:** This diverges from how `setTimeout` in Node.js behaves and accepts + * only positive numbers. In Node.js, `setTimeout` with negative numbers is + * only supported for web compatibility reasons. + * + * The following example mocks a `setTimeout` function and + * by using `.tick` advances in + * time triggering all pending timers. + * + * ```js + * import assert from 'node:assert'; + * import { test } from 'node:test'; + * + * test('mocks setTimeout to be executed synchronously without having to actually wait for it', (context) => { + * const fn = context.mock.fn(); + * + * context.mock.timers.enable(['setTimeout']); + * + * setTimeout(fn, 9999); + * + * assert.strictEqual(fn.mock.callCount(), 0); + * + * // Advance in time + * context.mock.timers.tick(9999); + * + * assert.strictEqual(fn.mock.callCount(), 1); + * }); + * ``` + * + * ```js + * const assert = require('node:assert'); + * const { test } = require('node:test'); + * + * test('mocks setTimeout to be executed synchronously without having to actually wait for it', (context) => { + * const fn = context.mock.fn(); + * context.mock.timers.enable(['setTimeout']); + * + * setTimeout(fn, 9999); + * assert.strictEqual(fn.mock.callCount(), 0); + * + * // Advance in time + * context.mock.timers.tick(9999); + * + * assert.strictEqual(fn.mock.callCount(), 1); + * }); + * ``` + * + * Alternativelly, the `.tick` function can be called many times + * + * ```js + * import assert from 'node:assert'; + * import { test } from 'node:test'; + * + * test('mocks setTimeout to be executed synchronously without having to actually wait for it', (context) => { + * const fn = context.mock.fn(); + * context.mock.timers.enable(['setTimeout']); + * const nineSecs = 9000; + * setTimeout(fn, nineSecs); + * + * const twoSeconds = 3000; + * context.mock.timers.tick(twoSeconds); + * context.mock.timers.tick(twoSeconds); + * context.mock.timers.tick(twoSeconds); + * + * assert.strictEqual(fn.mock.callCount(), 1); + * }); + * ``` + * + * ```js + * const assert = require('node:assert'); + * const { test } = require('node:test'); + * + * test('mocks setTimeout to be executed synchronously without having to actually wait for it', (context) => { + * const fn = context.mock.fn(); + * context.mock.timers.enable(['setTimeout']); + * const nineSecs = 9000; + * setTimeout(fn, nineSecs); + * + * const twoSeconds = 3000; + * context.mock.timers.tick(twoSeconds); + * context.mock.timers.tick(twoSeconds); + * context.mock.timers.tick(twoSeconds); + * + * assert.strictEqual(fn.mock.callCount(), 1); + * }); + * ``` + * @since v20.4.0 + */ + tick(milliseconds: number): void; + /** + * Triggers all pending mocked timers immediately. + * + * The example below triggers all pending timers immediately, + * causing them to execute without any delay. + * + * ```js + * import assert from 'node:assert'; + * import { test } from 'node:test'; + * + * test('runAll functions following the given order', (context) => { + * context.mock.timers.enable(['setTimeout']); + * const results = []; + * setTimeout(() => results.push(1), 9999); + * + * // Notice that if both timers have the same timeout, + * // the order of execution is guaranteed + * setTimeout(() => results.push(3), 8888); + * setTimeout(() => results.push(2), 8888); + * + * assert.deepStrictEqual(results, []); + * + * context.mock.timers.runAll(); + * + * assert.deepStrictEqual(results, [3, 2, 1]); + * }); + * ``` + * + * ```js + * const assert = require('node:assert'); + * const { test } = require('node:test'); + * + * test('runAll functions following the given order', (context) => { + * context.mock.timers.enable(['setTimeout']); + * const results = []; + * setTimeout(() => results.push(1), 9999); + * + * // Notice that if both timers have the same timeout, + * // the order of execution is guaranteed + * setTimeout(() => results.push(3), 8888); + * setTimeout(() => results.push(2), 8888); + * + * assert.deepStrictEqual(results, []); + * + * context.mock.timers.runAll(); + * + * assert.deepStrictEqual(results, [3, 2, 1]); + * }); + * ``` + * + * **Note:** The `runAll()` function is specifically designed for + * triggering timers in the context of timer mocking. + * It does not have any effect on real-time system + * clocks or actual timers outside of the mocking environment. + * @since v20.4.0 + */ + runAll(): void; + /** + * Calls {@link MockTimers.reset()}. + */ + [Symbol.dispose](): void; + } + export { test as default, run, test, describe, it, before, after, beforeEach, afterEach, mock, skip, only, todo }; +} + +interface DiagnosticData { + /** + * The diagnostic message. + */ + message: string; + /** + * The nesting level of the test. + */ + nesting: number; + /** + * The path of the test file, undefined if test is not ran through a file. + */ + file?: string; +} +interface TestFail { + /** + * Additional execution metadata. + */ + details: { + /** + * The duration of the test in milliseconds. + */ + duration_ms: number; + /** + * The error thrown by the test. + */ + error: Error; + /** + * The type of the test, used to denote whether this is a suite. + * @since 20.0.0, 19.9.0, 18.17.0 + */ + type?: 'suite'; + }; + /** + * The test name. + */ + name: string; + /** + * The nesting level of the test. + */ + nesting: number; + /** + * The ordinal number of the test. + */ + testNumber: number; + /** + * Present if `context.todo` is called. + */ + todo?: string | boolean; + /** + * Present if `context.skip` is called. + */ + skip?: string | boolean; + /** + * The path of the test file, undefined if test is not ran through a file. + */ + file?: string; +} +interface TestPass { + /** + * Additional execution metadata. + */ + details: { + /** + * The duration of the test in milliseconds. + */ + duration_ms: number; + /** + * The type of the test, used to denote whether this is a suite. + * @since 20.0.0, 19.9.0, 18.17.0 + */ + type?: 'suite'; + }; + /** + * The test name. + */ + name: string; + /** + * The nesting level of the test. + */ + nesting: number; + /** + * The ordinal number of the test. + */ + testNumber: number; + /** + * Present if `context.todo` is called. + */ + todo?: string | boolean; + /** + * Present if `context.skip` is called. + */ + skip?: string | boolean; + /** + * The path of the test file, undefined if test is not ran through a file. + */ + file?: string; +} +interface TestPlan { + /** + * The nesting level of the test. + */ + nesting: number; + /** + * The number of subtests that have ran. + */ + count: number; + /** + * The path of the test file, undefined if test is not ran through a file. + */ + file?: string; +} +interface TestStart { + /** + * The test name. + */ + name: string; + /** + * The nesting level of the test. + */ + nesting: number; + /** + * The path of the test file, undefined if test is not ran through a file. + */ + file?: string; +} +interface TestStderr { + /** + * The path of the test file, undefined if test is not ran through a file. + */ + file?: string; + /** + * The message written to `stderr` + */ + message: string; +} +interface TestStdout { + /** + * The path of the test file, undefined if test is not ran through a file. + */ + file?: string; + /** + * The message written to `stdout` + */ + message: string; +} +interface TestEnqueue { + /** + * The test name + */ + name: string; + /** + * The path of the test file, undefined if test is not ran through a file. + */ + file?: string; + /** + * The nesting level of the test. + */ + nesting: number; +} +interface TestDequeue { + /** + * The test name + */ + name: string; + /** + * The path of the test file, undefined if test is not ran through a file. + */ + file?: string; + /** + * The nesting level of the test. + */ + nesting: number; +} + +/** + * The `node:test/reporters` module exposes the builtin-reporters for `node:test`. + * To access it: + * + * ```js + * import test from 'node:test/reporters'; + * ``` + * + * This module is only available under the `node:` scheme. The following will not + * work: + * + * ```js + * import test from 'test/reporters'; + * ``` + * @since v19.9.0 + * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/test/reporters.js) + */ +declare module 'node:test/reporters' { + import { Transform } from 'node:stream'; + + type TestEvent = + | { type: 'test:diagnostic', data: DiagnosticData } + | { type: 'test:fail', data: TestFail } + | { type: 'test:pass', data: TestPass } + | { type: 'test:plan', data: TestPlan } + | { type: 'test:start', data: TestStart } + | { type: 'test:stderr', data: TestStderr } + | { type: 'test:stdout', data: TestStdout } + | { type: 'test:enqueue', data: TestEnqueue } + | { type: 'test:dequeue', data: TestDequeue } + | { type: 'test:watch:drained' }; + type TestEventGenerator = AsyncGenerator; + + /** + * The `dot` reporter outputs the test results in a compact format, + * where each passing test is represented by a `.`, + * and each failing test is represented by a `X`. + */ + function dot(source: TestEventGenerator): AsyncGenerator<'\n' | '.' | 'X', void>; + /** + * The `tap` reporter outputs the test results in the [TAP](https://testanything.org/) format. + */ + function tap(source: TestEventGenerator): AsyncGenerator; + /** + * The `spec` reporter outputs the test results in a human-readable format. + */ + class Spec extends Transform { + constructor(); + } + export { dot, tap, Spec as spec, TestEvent }; +} diff --git a/node_modules/@types/node/timers.d.ts b/node_modules/@types/node/timers.d.ts new file mode 100644 index 0000000..7558b9d --- /dev/null +++ b/node_modules/@types/node/timers.d.ts @@ -0,0 +1,225 @@ +/** + * The `timer` module exposes a global API for scheduling functions to + * be called at some future period of time. Because the timer functions are + * globals, there is no need to call `require('node:timers')` to use the API. + * + * The timer functions within Node.js implement a similar API as the timers API + * provided by Web Browsers but use a different internal implementation that is + * built around the Node.js [Event Loop](https://nodejs.org/en/docs/guides/event-loop-timers-and-nexttick/#setimmediate-vs-settimeout). + * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/timers.js) + */ +declare module 'node:timers' { + import { Abortable } from 'node:events'; + import { setTimeout as setTimeoutPromise, setImmediate as setImmediatePromise, setInterval as setIntervalPromise } from 'node:timers/promises'; + interface TimerOptions extends Abortable { + /** + * Set to `false` to indicate that the scheduled `Timeout` + * should not require the Node.js event loop to remain active. + * @default true + */ + ref?: boolean | undefined; + } + let setTimeout: typeof global.setTimeout; + let clearTimeout: typeof global.clearTimeout; + let setInterval: typeof global.setInterval; + let clearInterval: typeof global.clearInterval; + let setImmediate: typeof global.setImmediate; + let clearImmediate: typeof global.clearImmediate; + global { + namespace NodeJS { + // compatibility with older typings + interface Timer extends RefCounted { + hasRef(): boolean; + refresh(): this; + [Symbol.toPrimitive](): number; + } + /** + * This object is created internally and is returned from `setImmediate()`. It + * can be passed to `clearImmediate()` in order to cancel the scheduled + * actions. + * + * By default, when an immediate is scheduled, the Node.js event loop will continue + * running as long as the immediate is active. The `Immediate` object returned by `setImmediate()` exports both `immediate.ref()` and `immediate.unref()`functions that can be used to + * control this default behavior. + */ + class Immediate implements RefCounted { + /** + * When called, requests that the Node.js event loop _not_ exit so long as the`Immediate` is active. Calling `immediate.ref()` multiple times will have no + * effect. + * + * By default, all `Immediate` objects are "ref'ed", making it normally unnecessary + * to call `immediate.ref()` unless `immediate.unref()` had been called previously. + * @since v9.7.0 + * @return a reference to `immediate` + */ + ref(): this; + /** + * When called, the active `Immediate` object will not require the Node.js event + * loop to remain active. If there is no other activity keeping the event loop + * running, the process may exit before the `Immediate` object's callback is + * invoked. Calling `immediate.unref()` multiple times will have no effect. + * @since v9.7.0 + * @return a reference to `immediate` + */ + unref(): this; + /** + * If true, the `Immediate` object will keep the Node.js event loop active. + * @since v11.0.0 + */ + hasRef(): boolean; + _onImmediate: Function; // to distinguish it from the Timeout class + /** + * Cancels the immediate. This is similar to calling `clearImmediate()`. + * @since v20.5.0 + */ + [Symbol.dispose](): void; + } + /** + * This object is created internally and is returned from `setTimeout()` and `setInterval()`. It can be passed to either `clearTimeout()` or `clearInterval()` in order to cancel the + * scheduled actions. + * + * By default, when a timer is scheduled using either `setTimeout()` or `setInterval()`, the Node.js event loop will continue running as long as the + * timer is active. Each of the `Timeout` objects returned by these functions + * export both `timeout.ref()` and `timeout.unref()` functions that can be used to + * control this default behavior. + */ + class Timeout implements Timer { + /** + * When called, requests that the Node.js event loop _not_ exit so long as the`Timeout` is active. Calling `timeout.ref()` multiple times will have no effect. + * + * By default, all `Timeout` objects are "ref'ed", making it normally unnecessary + * to call `timeout.ref()` unless `timeout.unref()` had been called previously. + * @since v0.9.1 + * @return a reference to `timeout` + */ + ref(): this; + /** + * When called, the active `Timeout` object will not require the Node.js event loop + * to remain active. If there is no other activity keeping the event loop running, + * the process may exit before the `Timeout` object's callback is invoked. Calling`timeout.unref()` multiple times will have no effect. + * @since v0.9.1 + * @return a reference to `timeout` + */ + unref(): this; + /** + * If true, the `Timeout` object will keep the Node.js event loop active. + * @since v11.0.0 + */ + hasRef(): boolean; + /** + * Sets the timer's start time to the current time, and reschedules the timer to + * call its callback at the previously specified duration adjusted to the current + * time. This is useful for refreshing a timer without allocating a new + * JavaScript object. + * + * Using this on a timer that has already called its callback will reactivate the + * timer. + * @since v10.2.0 + * @return a reference to `timeout` + */ + refresh(): this; + [Symbol.toPrimitive](): number; + /** + * Cancels the timeout. + * @since v20.5.0 + */ + [Symbol.dispose](): void; + } + } + /** + * Schedules execution of a one-time `callback` after `delay` milliseconds. + * + * The `callback` will likely not be invoked in precisely `delay` milliseconds. + * Node.js makes no guarantees about the exact timing of when callbacks will fire, + * nor of their ordering. The callback will be called as close as possible to the + * time specified. + * + * When `delay` is larger than `2147483647` or less than `1`, the `delay`will be set to `1`. Non-integer delays are truncated to an integer. + * + * If `callback` is not a function, a `TypeError` will be thrown. + * + * This method has a custom variant for promises that is available using `timersPromises.setTimeout()`. + * @since v0.0.1 + * @param callback The function to call when the timer elapses. + * @param [delay=1] The number of milliseconds to wait before calling the `callback`. + * @param args Optional arguments to pass when the `callback` is called. + * @return for use with {@link clearTimeout} + */ + function setTimeout(callback: (...args: TArgs) => void, ms?: number, ...args: TArgs): NodeJS.Timeout; + // util.promisify no rest args compability + // tslint:disable-next-line void-return + function setTimeout(callback: (args: void) => void, ms?: number): NodeJS.Timeout; + namespace setTimeout { + const __promisify__: typeof setTimeoutPromise; + } + /** + * Cancels a `Timeout` object created by `setTimeout()`. + * @since v0.0.1 + * @param timeout A `Timeout` object as returned by {@link setTimeout} or the `primitive` of the `Timeout` object as a string or a number. + */ + function clearTimeout(timeoutId: NodeJS.Timeout | string | number | undefined): void; + /** + * Schedules repeated execution of `callback` every `delay` milliseconds. + * + * When `delay` is larger than `2147483647` or less than `1`, the `delay` will be + * set to `1`. Non-integer delays are truncated to an integer. + * + * If `callback` is not a function, a `TypeError` will be thrown. + * + * This method has a custom variant for promises that is available using `timersPromises.setInterval()`. + * @since v0.0.1 + * @param callback The function to call when the timer elapses. + * @param [delay=1] The number of milliseconds to wait before calling the `callback`. + * @param args Optional arguments to pass when the `callback` is called. + * @return for use with {@link clearInterval} + */ + function setInterval(callback: (...args: TArgs) => void, ms?: number, ...args: TArgs): NodeJS.Timeout; + // util.promisify no rest args compability + // tslint:disable-next-line void-return + function setInterval(callback: (args: void) => void, ms?: number): NodeJS.Timeout; + namespace setInterval { + const __promisify__: typeof setIntervalPromise; + } + /** + * Cancels a `Timeout` object created by `setInterval()`. + * @since v0.0.1 + * @param timeout A `Timeout` object as returned by {@link setInterval} or the `primitive` of the `Timeout` object as a string or a number. + */ + function clearInterval(intervalId: NodeJS.Timeout | string | number | undefined): void; + /** + * Schedules the "immediate" execution of the `callback` after I/O events' + * callbacks. + * + * When multiple calls to `setImmediate()` are made, the `callback` functions are + * queued for execution in the order in which they are created. The entire callback + * queue is processed every event loop iteration. If an immediate timer is queued + * from inside an executing callback, that timer will not be triggered until the + * next event loop iteration. + * + * If `callback` is not a function, a `TypeError` will be thrown. + * + * This method has a custom variant for promises that is available using `timersPromises.setImmediate()`. + * @since v0.9.1 + * @param callback The function to call at the end of this turn of the Node.js `Event Loop` + * @param args Optional arguments to pass when the `callback` is called. + * @return for use with {@link clearImmediate} + */ + function setImmediate(callback: (...args: TArgs) => void, ...args: TArgs): NodeJS.Immediate; + // util.promisify no rest args compability + // tslint:disable-next-line void-return + function setImmediate(callback: (args: void) => void): NodeJS.Immediate; + namespace setImmediate { + const __promisify__: typeof setImmediatePromise; + } + /** + * Cancels an `Immediate` object created by `setImmediate()`. + * @since v0.9.1 + * @param immediate An `Immediate` object as returned by {@link setImmediate}. + */ + function clearImmediate(immediateId: NodeJS.Immediate | undefined): void; + function queueMicrotask(callback: () => void): void; + } +} +declare module 'timers' { + export * from 'node:timers'; +} diff --git a/node_modules/@types/node/timers/promises.d.ts b/node_modules/@types/node/timers/promises.d.ts new file mode 100644 index 0000000..2da1e8d --- /dev/null +++ b/node_modules/@types/node/timers/promises.d.ts @@ -0,0 +1,93 @@ +/** + * The `timers/promises` API provides an alternative set of timer functions + * that return `Promise` objects. The API is accessible via`require('node:timers/promises')`. + * + * ```js + * import { + * setTimeout, + * setImmediate, + * setInterval, + * } from 'timers/promises'; + * ``` + * @since v15.0.0 + */ +declare module 'node:timers/promises' { + import { TimerOptions } from 'node:timers'; + /** + * ```js + * import { + * setTimeout, + * } from 'timers/promises'; + * + * const res = await setTimeout(100, 'result'); + * + * console.log(res); // Prints 'result' + * ``` + * @since v15.0.0 + * @param [delay=1] The number of milliseconds to wait before fulfilling the promise. + * @param value A value with which the promise is fulfilled. + */ + function setTimeout(delay?: number, value?: T, options?: TimerOptions): Promise; + /** + * ```js + * import { + * setImmediate, + * } from 'timers/promises'; + * + * const res = await setImmediate('result'); + * + * console.log(res); // Prints 'result' + * ``` + * @since v15.0.0 + * @param value A value with which the promise is fulfilled. + */ + function setImmediate(value?: T, options?: TimerOptions): Promise; + /** + * Returns an async iterator that generates values in an interval of `delay` ms. + * If `ref` is `true`, you need to call `next()` of async iterator explicitly + * or implicitly to keep the event loop alive. + * + * ```js + * import { + * setInterval, + * } from 'timers/promises'; + * + * const interval = 100; + * for await (const startTime of setInterval(interval, Date.now())) { + * const now = Date.now(); + * console.log(now); + * if ((now - startTime) > 1000) + * break; + * } + * console.log(Date.now()); + * ``` + * @since v15.9.0 + */ + function setInterval(delay?: number, value?: T, options?: TimerOptions): AsyncIterable; + interface Scheduler { + /** + * ```js + * import { scheduler } from 'node:timers/promises'; + * + * await scheduler.wait(1000); // Wait one second before continuing + * ``` + * An experimental API defined by the Scheduling APIs draft specification being developed as a standard Web Platform API. + * Calling timersPromises.scheduler.wait(delay, options) is roughly equivalent to calling timersPromises.setTimeout(delay, undefined, options) except that the ref option is not supported. + * @since v16.14.0 + * @experimental + * @param [delay=1] The number of milliseconds to wait before fulfilling the promise. + */ + wait: (delay?: number, options?: TimerOptions) => Promise; + /** + * An experimental API defined by the Scheduling APIs draft specification being developed as a standard Web Platform API. + * Calling timersPromises.scheduler.yield() is equivalent to calling timersPromises.setImmediate() with no arguments. + * @since v16.14.0 + * @experimental + */ + yield: () => Promise; + } + const scheduler: Scheduler; +} +declare module 'timers/promises' { + export * from 'node:timers/promises'; +} diff --git a/node_modules/@types/node/tls.d.ts b/node_modules/@types/node/tls.d.ts new file mode 100644 index 0000000..dda36d0 --- /dev/null +++ b/node_modules/@types/node/tls.d.ts @@ -0,0 +1,1130 @@ +/** + * The `node:tls` module provides an implementation of the Transport Layer Security + * (TLS) and Secure Socket Layer (SSL) protocols that is built on top of OpenSSL. + * The module can be accessed using: + * + * ```js + * const tls = require('node:tls'); + * ``` + * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/tls.js) + */ +declare module 'node:tls' { + import { X509Certificate } from 'node:crypto'; + import * as net from 'node:net'; + import * as stream from 'stream'; + const CLIENT_RENEG_LIMIT: number; + const CLIENT_RENEG_WINDOW: number; + interface Certificate { + /** + * Country code. + */ + C: string; + /** + * Street. + */ + ST: string; + /** + * Locality. + */ + L: string; + /** + * Organization. + */ + O: string; + /** + * Organizational unit. + */ + OU: string; + /** + * Common name. + */ + CN: string; + } + interface PeerCertificate { + /** + * `true` if a Certificate Authority (CA), `false` otherwise. + * @since v18.13.0 + */ + ca: boolean; + /** + * The DER encoded X.509 certificate data. + */ + raw: Buffer; + /** + * The certificate subject. + */ + subject: Certificate; + /** + * The certificate issuer, described in the same terms as the `subject`. + */ + issuer: Certificate; + /** + * The date-time the certificate is valid from. + */ + valid_from: string; + /** + * The date-time the certificate is valid to. + */ + valid_to: string; + /** + * The certificate serial number, as a hex string. + */ + serialNumber: string; + /** + * The SHA-1 digest of the DER encoded certificate. + * It is returned as a `:` separated hexadecimal string. + */ + fingerprint: string; + /** + * The SHA-256 digest of the DER encoded certificate. + * It is returned as a `:` separated hexadecimal string. + */ + fingerprint256: string; + /** + * The SHA-512 digest of the DER encoded certificate. + * It is returned as a `:` separated hexadecimal string. + */ + fingerprint512: string; + /** + * The extended key usage, a set of OIDs. + */ + ext_key_usage?: string[]; + /** + * A string containing concatenated names for the subject, + * an alternative to the `subject` names. + */ + subjectaltname?: string; + /** + * An array describing the AuthorityInfoAccess, used with OCSP. + */ + infoAccess?: NodeJS.Dict; + /** + * For RSA keys: The RSA bit size. + * + * For EC keys: The key size in bits. + */ + bits?: number; + /** + * The RSA exponent, as a string in hexadecimal number notation. + */ + exponent?: string; + /** + * The RSA modulus, as a hexadecimal string. + */ + modulus?: string; + /** + * The public key. + */ + pubkey?: Buffer; + /** + * The ASN.1 name of the OID of the elliptic curve. + * Well-known curves are identified by an OID. + * While it is unusual, it is possible that the curve + * is identified by its mathematical properties, + * in which case it will not have an OID. + */ + asn1Curve?: string; + /** + * The NIST name for the elliptic curve,if it has one + * (not all well-known curves have been assigned names by NIST). + */ + nistCurve?: string; + } + interface DetailedPeerCertificate extends PeerCertificate { + /** + * The issuer certificate object. + * For self-signed certificates, this may be a circular reference. + */ + issuerCertificate: DetailedPeerCertificate; + } + interface CipherNameAndProtocol { + /** + * The cipher name. + */ + name: string; + /** + * SSL/TLS protocol version. + */ + version: string; + /** + * IETF name for the cipher suite. + */ + standardName: string; + } + interface EphemeralKeyInfo { + /** + * The supported types are 'DH' and 'ECDH'. + */ + type: string; + /** + * The name property is available only when type is 'ECDH'. + */ + name?: string | undefined; + /** + * The size of parameter of an ephemeral key exchange. + */ + size: number; + } + interface KeyObject { + /** + * Private keys in PEM format. + */ + pem: string | Buffer; + /** + * Optional passphrase. + */ + passphrase?: string | undefined; + } + interface PxfObject { + /** + * PFX or PKCS12 encoded private key and certificate chain. + */ + buf: string | Buffer; + /** + * Optional passphrase. + */ + passphrase?: string | undefined; + } + interface TLSSocketOptions extends SecureContextOptions, CommonConnectionOptions { + /** + * If true the TLS socket will be instantiated in server-mode. + * Defaults to false. + */ + isServer?: boolean | undefined; + /** + * An optional net.Server instance. + */ + server?: net.Server | undefined; + /** + * An optional Buffer instance containing a TLS session. + */ + session?: Buffer | undefined; + /** + * If true, specifies that the OCSP status request extension will be + * added to the client hello and an 'OCSPResponse' event will be + * emitted on the socket before establishing a secure communication + */ + requestOCSP?: boolean | undefined; + } + /** + * Performs transparent encryption of written data and all required TLS + * negotiation. + * + * Instances of `tls.TLSSocket` implement the duplex `Stream` interface. + * + * Methods that return TLS connection metadata (e.g.{@link TLSSocket.getPeerCertificate}) will only return data while the + * connection is open. + * @since v0.11.4 + */ + class TLSSocket extends net.Socket { + /** + * Construct a new tls.TLSSocket object from an existing TCP socket. + */ + constructor(socket: net.Socket, options?: TLSSocketOptions); + /** + * This property is `true` if the peer certificate was signed by one of the CAs + * specified when creating the `tls.TLSSocket` instance, otherwise `false`. + * @since v0.11.4 + */ + authorized: boolean; + /** + * Returns the reason why the peer's certificate was not been verified. This + * property is set only when `tlsSocket.authorized === false`. + * @since v0.11.4 + */ + authorizationError: Error; + /** + * Always returns `true`. This may be used to distinguish TLS sockets from regular`net.Socket` instances. + * @since v0.11.4 + */ + encrypted: true; + /** + * String containing the selected ALPN protocol. + * Before a handshake has completed, this value is always null. + * When a handshake is completed but not ALPN protocol was selected, tlsSocket.alpnProtocol equals false. + */ + alpnProtocol: string | false | null; + /** + * Returns an object representing the local certificate. The returned object has + * some properties corresponding to the fields of the certificate. + * + * See {@link TLSSocket.getPeerCertificate} for an example of the certificate + * structure. + * + * If there is no local certificate, an empty object will be returned. If the + * socket has been destroyed, `null` will be returned. + * @since v11.2.0 + */ + getCertificate(): PeerCertificate | object | null; + /** + * Returns an object containing information on the negotiated cipher suite. + * + * For example, a TLSv1.2 protocol with AES256-SHA cipher: + * + * ```json + * { + * "name": "AES256-SHA", + * "standardName": "TLS_RSA_WITH_AES_256_CBC_SHA", + * "version": "SSLv3" + * } + * ``` + * + * See [SSL\_CIPHER\_get\_name](https://www.openssl.org/docs/man1.1.1/man3/SSL_CIPHER_get_name.html) for more information. + * @since v0.11.4 + */ + getCipher(): CipherNameAndProtocol; + /** + * Returns an object representing the type, name, and size of parameter of + * an ephemeral key exchange in `perfect forward secrecy` on a client + * connection. It returns an empty object when the key exchange is not + * ephemeral. As this is only supported on a client socket; `null` is returned + * if called on a server socket. The supported types are `'DH'` and `'ECDH'`. The`name` property is available only when type is `'ECDH'`. + * + * For example: `{ type: 'ECDH', name: 'prime256v1', size: 256 }`. + * @since v5.0.0 + */ + getEphemeralKeyInfo(): EphemeralKeyInfo | object | null; + /** + * As the `Finished` messages are message digests of the complete handshake + * (with a total of 192 bits for TLS 1.0 and more for SSL 3.0), they can + * be used for external authentication procedures when the authentication + * provided by SSL/TLS is not desired or is not enough. + * + * Corresponds to the `SSL_get_finished` routine in OpenSSL and may be used + * to implement the `tls-unique` channel binding from [RFC 5929](https://tools.ietf.org/html/rfc5929). + * @since v9.9.0 + * @return The latest `Finished` message that has been sent to the socket as part of a SSL/TLS handshake, or `undefined` if no `Finished` message has been sent yet. + */ + getFinished(): Buffer | undefined; + /** + * Returns an object representing the peer's certificate. If the peer does not + * provide a certificate, an empty object will be returned. If the socket has been + * destroyed, `null` will be returned. + * + * If the full certificate chain was requested, each certificate will include an`issuerCertificate` property containing an object representing its issuer's + * certificate. + * @since v0.11.4 + * @param detailed Include the full certificate chain if `true`, otherwise include just the peer's certificate. + * @return A certificate object. + */ + getPeerCertificate(detailed: true): DetailedPeerCertificate; + getPeerCertificate(detailed?: false): PeerCertificate; + getPeerCertificate(detailed?: boolean): PeerCertificate | DetailedPeerCertificate; + /** + * As the `Finished` messages are message digests of the complete handshake + * (with a total of 192 bits for TLS 1.0 and more for SSL 3.0), they can + * be used for external authentication procedures when the authentication + * provided by SSL/TLS is not desired or is not enough. + * + * Corresponds to the `SSL_get_peer_finished` routine in OpenSSL and may be used + * to implement the `tls-unique` channel binding from [RFC 5929](https://tools.ietf.org/html/rfc5929). + * @since v9.9.0 + * @return The latest `Finished` message that is expected or has actually been received from the socket as part of a SSL/TLS handshake, or `undefined` if there is no `Finished` message so + * far. + */ + getPeerFinished(): Buffer | undefined; + /** + * Returns a string containing the negotiated SSL/TLS protocol version of the + * current connection. The value `'unknown'` will be returned for connected + * sockets that have not completed the handshaking process. The value `null` will + * be returned for server sockets or disconnected client sockets. + * + * Protocol versions are: + * + * * `'SSLv3'` + * * `'TLSv1'` + * * `'TLSv1.1'` + * * `'TLSv1.2'` + * * `'TLSv1.3'` + * + * See the OpenSSL [`SSL_get_version`](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_version.html) documentation for more information. + * @since v5.7.0 + */ + getProtocol(): string | null; + /** + * Returns the TLS session data or `undefined` if no session was + * negotiated. On the client, the data can be provided to the `session` option of {@link connect} to resume the connection. On the server, it may be useful + * for debugging. + * + * See `Session Resumption` for more information. + * + * Note: `getSession()` works only for TLSv1.2 and below. For TLSv1.3, applications + * must use the `'session'` event (it also works for TLSv1.2 and below). + * @since v0.11.4 + */ + getSession(): Buffer | undefined; + /** + * See [SSL\_get\_shared\_sigalgs](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_shared_sigalgs.html) for more information. + * @since v12.11.0 + * @return List of signature algorithms shared between the server and the client in the order of decreasing preference. + */ + getSharedSigalgs(): string[]; + /** + * For a client, returns the TLS session ticket if one is available, or`undefined`. For a server, always returns `undefined`. + * + * It may be useful for debugging. + * + * See `Session Resumption` for more information. + * @since v0.11.4 + */ + getTLSTicket(): Buffer | undefined; + /** + * See `Session Resumption` for more information. + * @since v0.5.6 + * @return `true` if the session was reused, `false` otherwise. + */ + isSessionReused(): boolean; + /** + * The `tlsSocket.renegotiate()` method initiates a TLS renegotiation process. + * Upon completion, the `callback` function will be passed a single argument + * that is either an `Error` (if the request failed) or `null`. + * + * This method can be used to request a peer's certificate after the secure + * connection has been established. + * + * When running as the server, the socket will be destroyed with an error after`handshakeTimeout` timeout. + * + * For TLSv1.3, renegotiation cannot be initiated, it is not supported by the + * protocol. + * @since v0.11.8 + * @param callback If `renegotiate()` returned `true`, callback is attached once to the `'secure'` event. If `renegotiate()` returned `false`, `callback` will be called in the next tick with + * an error, unless the `tlsSocket` has been destroyed, in which case `callback` will not be called at all. + * @return `true` if renegotiation was initiated, `false` otherwise. + */ + renegotiate( + options: { + rejectUnauthorized?: boolean | undefined; + requestCert?: boolean | undefined; + }, + callback: (err: Error | null) => void + ): undefined | boolean; + /** + * The `tlsSocket.setMaxSendFragment()` method sets the maximum TLS fragment size. + * Returns `true` if setting the limit succeeded; `false` otherwise. + * + * Smaller fragment sizes decrease the buffering latency on the client: larger + * fragments are buffered by the TLS layer until the entire fragment is received + * and its integrity is verified; large fragments can span multiple roundtrips + * and their processing can be delayed due to packet loss or reordering. However, + * smaller fragments add extra TLS framing bytes and CPU overhead, which may + * decrease overall server throughput. + * @since v0.11.11 + * @param [size=16384] The maximum TLS fragment size. The maximum value is `16384`. + */ + setMaxSendFragment(size: number): boolean; + /** + * Disables TLS renegotiation for this `TLSSocket` instance. Once called, attempts + * to renegotiate will trigger an `'error'` event on the `TLSSocket`. + * @since v8.4.0 + */ + disableRenegotiation(): void; + /** + * When enabled, TLS packet trace information is written to `stderr`. This can be + * used to debug TLS connection problems. + * + * The format of the output is identical to the output of`openssl s_client -trace` or `openssl s_server -trace`. While it is produced by + * OpenSSL's `SSL_trace()` function, the format is undocumented, can change + * without notice, and should not be relied on. + * @since v12.2.0 + */ + enableTrace(): void; + /** + * Returns the peer certificate as an `X509Certificate` object. + * + * If there is no peer certificate, or the socket has been destroyed,`undefined` will be returned. + * @since v15.9.0 + */ + getPeerX509Certificate(): X509Certificate | undefined; + /** + * Returns the local certificate as an `X509Certificate` object. + * + * If there is no local certificate, or the socket has been destroyed,`undefined` will be returned. + * @since v15.9.0 + */ + getX509Certificate(): X509Certificate | undefined; + /** + * Keying material is used for validations to prevent different kind of attacks in + * network protocols, for example in the specifications of IEEE 802.1X. + * + * Example + * + * ```js + * const keyingMaterial = tlsSocket.exportKeyingMaterial( + * 128, + * 'client finished'); + * + * /* + * Example return value of keyingMaterial: + * + * + * ``` + * + * See the OpenSSL [`SSL_export_keying_material`](https://www.openssl.org/docs/man1.1.1/man3/SSL_export_keying_material.html) documentation for more + * information. + * @since v13.10.0, v12.17.0 + * @param length number of bytes to retrieve from keying material + * @param label an application specific label, typically this will be a value from the [IANA Exporter Label + * Registry](https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#exporter-labels). + * @param context Optionally provide a context. + * @return requested bytes of the keying material + */ + exportKeyingMaterial(length: number, label: string, context: Buffer): Buffer; + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: 'OCSPResponse', listener: (response: Buffer) => void): this; + addListener(event: 'secureConnect', listener: () => void): this; + addListener(event: 'session', listener: (session: Buffer) => void): this; + addListener(event: 'keylog', listener: (line: Buffer) => void): this; + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: 'OCSPResponse', response: Buffer): boolean; + emit(event: 'secureConnect'): boolean; + emit(event: 'session', session: Buffer): boolean; + emit(event: 'keylog', line: Buffer): boolean; + on(event: string, listener: (...args: any[]) => void): this; + on(event: 'OCSPResponse', listener: (response: Buffer) => void): this; + on(event: 'secureConnect', listener: () => void): this; + on(event: 'session', listener: (session: Buffer) => void): this; + on(event: 'keylog', listener: (line: Buffer) => void): this; + once(event: string, listener: (...args: any[]) => void): this; + once(event: 'OCSPResponse', listener: (response: Buffer) => void): this; + once(event: 'secureConnect', listener: () => void): this; + once(event: 'session', listener: (session: Buffer) => void): this; + once(event: 'keylog', listener: (line: Buffer) => void): this; + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: 'OCSPResponse', listener: (response: Buffer) => void): this; + prependListener(event: 'secureConnect', listener: () => void): this; + prependListener(event: 'session', listener: (session: Buffer) => void): this; + prependListener(event: 'keylog', listener: (line: Buffer) => void): this; + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'OCSPResponse', listener: (response: Buffer) => void): this; + prependOnceListener(event: 'secureConnect', listener: () => void): this; + prependOnceListener(event: 'session', listener: (session: Buffer) => void): this; + prependOnceListener(event: 'keylog', listener: (line: Buffer) => void): this; + } + interface CommonConnectionOptions { + /** + * An optional TLS context object from tls.createSecureContext() + */ + secureContext?: SecureContext | undefined; + /** + * When enabled, TLS packet trace information is written to `stderr`. This can be + * used to debug TLS connection problems. + * @default false + */ + enableTrace?: boolean | undefined; + /** + * If true the server will request a certificate from clients that + * connect and attempt to verify that certificate. Defaults to + * false. + */ + requestCert?: boolean | undefined; + /** + * An array of strings or a Buffer naming possible ALPN protocols. + * (Protocols should be ordered by their priority.) + */ + ALPNProtocols?: string[] | Uint8Array[] | Uint8Array | undefined; + /** + * SNICallback(servername, cb) A function that will be + * called if the client supports SNI TLS extension. Two arguments + * will be passed when called: servername and cb. SNICallback should + * invoke cb(null, ctx), where ctx is a SecureContext instance. + * (tls.createSecureContext(...) can be used to get a proper + * SecureContext.) If SNICallback wasn't provided the default callback + * with high-level API will be used (see below). + */ + SNICallback?: ((servername: string, cb: (err: Error | null, ctx?: SecureContext) => void) => void) | undefined; + /** + * If true the server will reject any connection which is not + * authorized with the list of supplied CAs. This option only has an + * effect if requestCert is true. + * @default true + */ + rejectUnauthorized?: boolean | undefined; + } + interface TlsOptions extends SecureContextOptions, CommonConnectionOptions, net.ServerOpts { + /** + * Abort the connection if the SSL/TLS handshake does not finish in the + * specified number of milliseconds. A 'tlsClientError' is emitted on + * the tls.Server object whenever a handshake times out. Default: + * 120000 (120 seconds). + */ + handshakeTimeout?: number | undefined; + /** + * The number of seconds after which a TLS session created by the + * server will no longer be resumable. See Session Resumption for more + * information. Default: 300. + */ + sessionTimeout?: number | undefined; + /** + * 48-bytes of cryptographically strong pseudo-random data. + */ + ticketKeys?: Buffer | undefined; + /** + * + * @param socket + * @param identity identity parameter sent from the client. + * @return pre-shared key that must either be + * a buffer or `null` to stop the negotiation process. Returned PSK must be + * compatible with the selected cipher's digest. + * + * When negotiating TLS-PSK (pre-shared keys), this function is called + * with the identity provided by the client. + * If the return value is `null` the negotiation process will stop and an + * "unknown_psk_identity" alert message will be sent to the other party. + * If the server wishes to hide the fact that the PSK identity was not known, + * the callback must provide some random data as `psk` to make the connection + * fail with "decrypt_error" before negotiation is finished. + * PSK ciphers are disabled by default, and using TLS-PSK thus + * requires explicitly specifying a cipher suite with the `ciphers` option. + * More information can be found in the RFC 4279. + */ + pskCallback?(socket: TLSSocket, identity: string): DataView | NodeJS.TypedArray | null; + /** + * hint to send to a client to help + * with selecting the identity during TLS-PSK negotiation. Will be ignored + * in TLS 1.3. Upon failing to set pskIdentityHint `tlsClientError` will be + * emitted with `ERR_TLS_PSK_SET_IDENTIY_HINT_FAILED` code. + */ + pskIdentityHint?: string | undefined; + } + interface PSKCallbackNegotation { + psk: DataView | NodeJS.TypedArray; + identity: string; + } + interface ConnectionOptions extends SecureContextOptions, CommonConnectionOptions { + host?: string | undefined; + port?: number | undefined; + path?: string | undefined; // Creates unix socket connection to path. If this option is specified, `host` and `port` are ignored. + socket?: stream.Duplex | undefined; // Establish secure connection on a given socket rather than creating a new socket + checkServerIdentity?: typeof checkServerIdentity | undefined; + servername?: string | undefined; // SNI TLS Extension + session?: Buffer | undefined; + minDHSize?: number | undefined; + lookup?: net.LookupFunction | undefined; + timeout?: number | undefined; + /** + * When negotiating TLS-PSK (pre-shared keys), this function is called + * with optional identity `hint` provided by the server or `null` + * in case of TLS 1.3 where `hint` was removed. + * It will be necessary to provide a custom `tls.checkServerIdentity()` + * for the connection as the default one will try to check hostname/IP + * of the server against the certificate but that's not applicable for PSK + * because there won't be a certificate present. + * More information can be found in the RFC 4279. + * + * @param hint message sent from the server to help client + * decide which identity to use during negotiation. + * Always `null` if TLS 1.3 is used. + * @returns Return `null` to stop the negotiation process. `psk` must be + * compatible with the selected cipher's digest. + * `identity` must use UTF-8 encoding. + */ + pskCallback?(hint: string | null): PSKCallbackNegotation | null; + } + /** + * Accepts encrypted connections using TLS or SSL. + * @since v0.3.2 + */ + class Server extends net.Server { + constructor(secureConnectionListener?: (socket: TLSSocket) => void); + constructor(options: TlsOptions, secureConnectionListener?: (socket: TLSSocket) => void); + /** + * The `server.addContext()` method adds a secure context that will be used if + * the client request's SNI name matches the supplied `hostname` (or wildcard). + * + * When there are multiple matching contexts, the most recently added one is + * used. + * @since v0.5.3 + * @param hostname A SNI host name or wildcard (e.g. `'*'`) + * @param context An object containing any of the possible properties from the {@link createSecureContext} `options` arguments (e.g. `key`, `cert`, `ca`, etc), or a TLS context object created + * with {@link createSecureContext} itself. + */ + addContext(hostname: string, context: SecureContextOptions): void; + /** + * Returns the session ticket keys. + * + * See `Session Resumption` for more information. + * @since v3.0.0 + * @return A 48-byte buffer containing the session ticket keys. + */ + getTicketKeys(): Buffer; + /** + * The `server.setSecureContext()` method replaces the secure context of an + * existing server. Existing connections to the server are not interrupted. + * @since v11.0.0 + * @param options An object containing any of the possible properties from the {@link createSecureContext} `options` arguments (e.g. `key`, `cert`, `ca`, etc). + */ + setSecureContext(options: SecureContextOptions): void; + /** + * Sets the session ticket keys. + * + * Changes to the ticket keys are effective only for future server connections. + * Existing or currently pending server connections will use the previous keys. + * + * See `Session Resumption` for more information. + * @since v3.0.0 + * @param keys A 48-byte buffer containing the session ticket keys. + */ + setTicketKeys(keys: Buffer): void; + /** + * events.EventEmitter + * 1. tlsClientError + * 2. newSession + * 3. OCSPRequest + * 4. resumeSession + * 5. secureConnection + * 6. keylog + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: 'tlsClientError', listener: (err: Error, tlsSocket: TLSSocket) => void): this; + addListener(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void): this; + addListener(event: 'OCSPRequest', listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this; + addListener(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void): this; + addListener(event: 'secureConnection', listener: (tlsSocket: TLSSocket) => void): this; + addListener(event: 'keylog', listener: (line: Buffer, tlsSocket: TLSSocket) => void): this; + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: 'tlsClientError', err: Error, tlsSocket: TLSSocket): boolean; + emit(event: 'newSession', sessionId: Buffer, sessionData: Buffer, callback: () => void): boolean; + emit(event: 'OCSPRequest', certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void): boolean; + emit(event: 'resumeSession', sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void): boolean; + emit(event: 'secureConnection', tlsSocket: TLSSocket): boolean; + emit(event: 'keylog', line: Buffer, tlsSocket: TLSSocket): boolean; + on(event: string, listener: (...args: any[]) => void): this; + on(event: 'tlsClientError', listener: (err: Error, tlsSocket: TLSSocket) => void): this; + on(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void): this; + on(event: 'OCSPRequest', listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this; + on(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void): this; + on(event: 'secureConnection', listener: (tlsSocket: TLSSocket) => void): this; + on(event: 'keylog', listener: (line: Buffer, tlsSocket: TLSSocket) => void): this; + once(event: string, listener: (...args: any[]) => void): this; + once(event: 'tlsClientError', listener: (err: Error, tlsSocket: TLSSocket) => void): this; + once(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void): this; + once(event: 'OCSPRequest', listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this; + once(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void): this; + once(event: 'secureConnection', listener: (tlsSocket: TLSSocket) => void): this; + once(event: 'keylog', listener: (line: Buffer, tlsSocket: TLSSocket) => void): this; + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: 'tlsClientError', listener: (err: Error, tlsSocket: TLSSocket) => void): this; + prependListener(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void): this; + prependListener(event: 'OCSPRequest', listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this; + prependListener(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void): this; + prependListener(event: 'secureConnection', listener: (tlsSocket: TLSSocket) => void): this; + prependListener(event: 'keylog', listener: (line: Buffer, tlsSocket: TLSSocket) => void): this; + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'tlsClientError', listener: (err: Error, tlsSocket: TLSSocket) => void): this; + prependOnceListener(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void): this; + prependOnceListener(event: 'OCSPRequest', listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this; + prependOnceListener(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void): this; + prependOnceListener(event: 'secureConnection', listener: (tlsSocket: TLSSocket) => void): this; + prependOnceListener(event: 'keylog', listener: (line: Buffer, tlsSocket: TLSSocket) => void): this; + } + /** + * @deprecated since v0.11.3 Use `tls.TLSSocket` instead. + */ + interface SecurePair { + encrypted: TLSSocket; + cleartext: TLSSocket; + } + type SecureVersion = 'TLSv1.3' | 'TLSv1.2' | 'TLSv1.1' | 'TLSv1'; + interface SecureContextOptions { + /** + * If set, this will be called when a client opens a connection using the ALPN extension. + * One argument will be passed to the callback: an object containing `servername` and `protocols` fields, + * respectively containing the server name from the SNI extension (if any) and an array of + * ALPN protocol name strings. The callback must return either one of the strings listed in `protocols`, + * which will be returned to the client as the selected ALPN protocol, or `undefined`, + * to reject the connection with a fatal alert. If a string is returned that does not match one of + * the client's ALPN protocols, an error will be thrown. + * This option cannot be used with the `ALPNProtocols` option, and setting both options will throw an error. + */ + ALPNCallback?: ((arg: { servername: string; protocols: string[] }) => string | undefined) | undefined; + /** + * Optionally override the trusted CA certificates. Default is to trust + * the well-known CAs curated by Mozilla. Mozilla's CAs are completely + * replaced when CAs are explicitly specified using this option. + */ + ca?: string | Buffer | Array | undefined; + /** + * Cert chains in PEM format. One cert chain should be provided per + * private key. Each cert chain should consist of the PEM formatted + * certificate for a provided private key, followed by the PEM + * formatted intermediate certificates (if any), in order, and not + * including the root CA (the root CA must be pre-known to the peer, + * see ca). When providing multiple cert chains, they do not have to + * be in the same order as their private keys in key. If the + * intermediate certificates are not provided, the peer will not be + * able to validate the certificate, and the handshake will fail. + */ + cert?: string | Buffer | Array | undefined; + /** + * Colon-separated list of supported signature algorithms. The list + * can contain digest algorithms (SHA256, MD5 etc.), public key + * algorithms (RSA-PSS, ECDSA etc.), combination of both (e.g + * 'RSA+SHA384') or TLS v1.3 scheme names (e.g. rsa_pss_pss_sha512). + */ + sigalgs?: string | undefined; + /** + * Cipher suite specification, replacing the default. For more + * information, see modifying the default cipher suite. Permitted + * ciphers can be obtained via tls.getCiphers(). Cipher names must be + * uppercased in order for OpenSSL to accept them. + */ + ciphers?: string | undefined; + /** + * Name of an OpenSSL engine which can provide the client certificate. + */ + clientCertEngine?: string | undefined; + /** + * PEM formatted CRLs (Certificate Revocation Lists). + */ + crl?: string | Buffer | Array | undefined; + /** + * `'auto'` or custom Diffie-Hellman parameters, required for non-ECDHE perfect forward secrecy. + * If omitted or invalid, the parameters are silently discarded and DHE ciphers will not be available. + * ECDHE-based perfect forward secrecy will still be available. + */ + dhparam?: string | Buffer | undefined; + /** + * A string describing a named curve or a colon separated list of curve + * NIDs or names, for example P-521:P-384:P-256, to use for ECDH key + * agreement. Set to auto to select the curve automatically. Use + * crypto.getCurves() to obtain a list of available curve names. On + * recent releases, openssl ecparam -list_curves will also display the + * name and description of each available elliptic curve. Default: + * tls.DEFAULT_ECDH_CURVE. + */ + ecdhCurve?: string | undefined; + /** + * Attempt to use the server's cipher suite preferences instead of the + * client's. When true, causes SSL_OP_CIPHER_SERVER_PREFERENCE to be + * set in secureOptions + */ + honorCipherOrder?: boolean | undefined; + /** + * Private keys in PEM format. PEM allows the option of private keys + * being encrypted. Encrypted keys will be decrypted with + * options.passphrase. Multiple keys using different algorithms can be + * provided either as an array of unencrypted key strings or buffers, + * or an array of objects in the form {pem: [, + * passphrase: ]}. The object form can only occur in an array. + * object.passphrase is optional. Encrypted keys will be decrypted with + * object.passphrase if provided, or options.passphrase if it is not. + */ + key?: string | Buffer | Array | undefined; + /** + * Name of an OpenSSL engine to get private key from. Should be used + * together with privateKeyIdentifier. + */ + privateKeyEngine?: string | undefined; + /** + * Identifier of a private key managed by an OpenSSL engine. Should be + * used together with privateKeyEngine. Should not be set together with + * key, because both options define a private key in different ways. + */ + privateKeyIdentifier?: string | undefined; + /** + * Optionally set the maximum TLS version to allow. One + * of `'TLSv1.3'`, `'TLSv1.2'`, `'TLSv1.1'`, or `'TLSv1'`. Cannot be specified along with the + * `secureProtocol` option, use one or the other. + * **Default:** `'TLSv1.3'`, unless changed using CLI options. Using + * `--tls-max-v1.2` sets the default to `'TLSv1.2'`. Using `--tls-max-v1.3` sets the default to + * `'TLSv1.3'`. If multiple of the options are provided, the highest maximum is used. + */ + maxVersion?: SecureVersion | undefined; + /** + * Optionally set the minimum TLS version to allow. One + * of `'TLSv1.3'`, `'TLSv1.2'`, `'TLSv1.1'`, or `'TLSv1'`. Cannot be specified along with the + * `secureProtocol` option, use one or the other. It is not recommended to use + * less than TLSv1.2, but it may be required for interoperability. + * **Default:** `'TLSv1.2'`, unless changed using CLI options. Using + * `--tls-v1.0` sets the default to `'TLSv1'`. Using `--tls-v1.1` sets the default to + * `'TLSv1.1'`. Using `--tls-min-v1.3` sets the default to + * 'TLSv1.3'. If multiple of the options are provided, the lowest minimum is used. + */ + minVersion?: SecureVersion | undefined; + /** + * Shared passphrase used for a single private key and/or a PFX. + */ + passphrase?: string | undefined; + /** + * PFX or PKCS12 encoded private key and certificate chain. pfx is an + * alternative to providing key and cert individually. PFX is usually + * encrypted, if it is, passphrase will be used to decrypt it. Multiple + * PFX can be provided either as an array of unencrypted PFX buffers, + * or an array of objects in the form {buf: [, + * passphrase: ]}. The object form can only occur in an array. + * object.passphrase is optional. Encrypted PFX will be decrypted with + * object.passphrase if provided, or options.passphrase if it is not. + */ + pfx?: string | Buffer | Array | undefined; + /** + * Optionally affect the OpenSSL protocol behavior, which is not + * usually necessary. This should be used carefully if at all! Value is + * a numeric bitmask of the SSL_OP_* options from OpenSSL Options + */ + secureOptions?: number | undefined; // Value is a numeric bitmask of the `SSL_OP_*` options + /** + * Legacy mechanism to select the TLS protocol version to use, it does + * not support independent control of the minimum and maximum version, + * and does not support limiting the protocol to TLSv1.3. Use + * minVersion and maxVersion instead. The possible values are listed as + * SSL_METHODS, use the function names as strings. For example, use + * 'TLSv1_1_method' to force TLS version 1.1, or 'TLS_method' to allow + * any TLS protocol version up to TLSv1.3. It is not recommended to use + * TLS versions less than 1.2, but it may be required for + * interoperability. Default: none, see minVersion. + */ + secureProtocol?: string | undefined; + /** + * Opaque identifier used by servers to ensure session state is not + * shared between applications. Unused by clients. + */ + sessionIdContext?: string | undefined; + /** + * 48-bytes of cryptographically strong pseudo-random data. + * See Session Resumption for more information. + */ + ticketKeys?: Buffer | undefined; + /** + * The number of seconds after which a TLS session created by the + * server will no longer be resumable. See Session Resumption for more + * information. Default: 300. + */ + sessionTimeout?: number | undefined; + } + interface SecureContext { + context: any; + } + /** + * Verifies the certificate `cert` is issued to `hostname`. + * + * Returns [Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) object, populating it with `reason`, `host`, and `cert` on + * failure. On success, returns [undefined](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Undefined_type). + * + * This function is intended to be used in combination with the`checkServerIdentity` option that can be passed to {@link connect} and as + * such operates on a `certificate object`. For other purposes, consider using `x509.checkHost()` instead. + * + * This function can be overwritten by providing an alternative function as the`options.checkServerIdentity` option that is passed to `tls.connect()`. The + * overwriting function can call `tls.checkServerIdentity()` of course, to augment + * the checks done with additional verification. + * + * This function is only called if the certificate passed all other checks, such as + * being issued by trusted CA (`options.ca`). + * + * Earlier versions of Node.js incorrectly accepted certificates for a given`hostname` if a matching `uniformResourceIdentifier` subject alternative name + * was present (see [CVE-2021-44531](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-44531)). Applications that wish to accept`uniformResourceIdentifier` subject alternative names can use + * a custom`options.checkServerIdentity` function that implements the desired behavior. + * @since v0.8.4 + * @param hostname The host name or IP address to verify the certificate against. + * @param cert A `certificate object` representing the peer's certificate. + */ + function checkServerIdentity(hostname: string, cert: PeerCertificate): Error | undefined; + /** + * Creates a new {@link Server}. The `secureConnectionListener`, if provided, is + * automatically set as a listener for the `'secureConnection'` event. + * + * The `ticketKeys` options is automatically shared between `node:cluster` module + * workers. + * + * The following illustrates a simple echo server: + * + * ```js + * const tls = require('node:tls'); + * const fs = require('node:fs'); + * + * const options = { + * key: fs.readFileSync('server-key.pem'), + * cert: fs.readFileSync('server-cert.pem'), + * + * // This is necessary only if using client certificate authentication. + * requestCert: true, + * + * // This is necessary only if the client uses a self-signed certificate. + * ca: [ fs.readFileSync('client-cert.pem') ], + * }; + * + * const server = tls.createServer(options, (socket) => { + * console.log('server connected', + * socket.authorized ? 'authorized' : 'unauthorized'); + * socket.write('welcome!\n'); + * socket.setEncoding('utf8'); + * socket.pipe(socket); + * }); + * server.listen(8000, () => { + * console.log('server bound'); + * }); + * ``` + * + * The server can be tested by connecting to it using the example client from {@link connect}. + * @since v0.3.2 + */ + function createServer(secureConnectionListener?: (socket: TLSSocket) => void): Server; + function createServer(options: TlsOptions, secureConnectionListener?: (socket: TLSSocket) => void): Server; + /** + * The `callback` function, if specified, will be added as a listener for the `'secureConnect'` event. + * + * `tls.connect()` returns a {@link TLSSocket} object. + * + * Unlike the `https` API, `tls.connect()` does not enable the + * SNI (Server Name Indication) extension by default, which may cause some + * servers to return an incorrect certificate or reject the connection + * altogether. To enable SNI, set the `servername` option in addition + * to `host`. + * + * The following illustrates a client for the echo server example from {@link createServer}: + * + * ```js + * // Assumes an echo server that is listening on port 8000. + * const tls = require('node:tls'); + * const fs = require('node:fs'); + * + * const options = { + * // Necessary only if the server requires client certificate authentication. + * key: fs.readFileSync('client-key.pem'), + * cert: fs.readFileSync('client-cert.pem'), + * + * // Necessary only if the server uses a self-signed certificate. + * ca: [ fs.readFileSync('server-cert.pem') ], + * + * // Necessary only if the server's cert isn't for "localhost". + * checkServerIdentity: () => { return null; }, + * }; + * + * const socket = tls.connect(8000, options, () => { + * console.log('client connected', + * socket.authorized ? 'authorized' : 'unauthorized'); + * process.stdin.pipe(socket); + * process.stdin.resume(); + * }); + * socket.setEncoding('utf8'); + * socket.on('data', (data) => { + * console.log(data); + * }); + * socket.on('end', () => { + * console.log('server ends connection'); + * }); + * ``` + * @since v0.11.3 + */ + function connect(options: ConnectionOptions, secureConnectListener?: () => void): TLSSocket; + function connect(port: number, host?: string, options?: ConnectionOptions, secureConnectListener?: () => void): TLSSocket; + function connect(port: number, options?: ConnectionOptions, secureConnectListener?: () => void): TLSSocket; + /** + * Creates a new secure pair object with two streams, one of which reads and writes + * the encrypted data and the other of which reads and writes the cleartext data. + * Generally, the encrypted stream is piped to/from an incoming encrypted data + * stream and the cleartext one is used as a replacement for the initial encrypted + * stream. + * + * `tls.createSecurePair()` returns a `tls.SecurePair` object with `cleartext` and`encrypted` stream properties. + * + * Using `cleartext` has the same API as {@link TLSSocket}. + * + * The `tls.createSecurePair()` method is now deprecated in favor of`tls.TLSSocket()`. For example, the code: + * + * ```js + * pair = tls.createSecurePair(// ... ); + * pair.encrypted.pipe(socket); + * socket.pipe(pair.encrypted); + * ``` + * + * can be replaced by: + * + * ```js + * secureSocket = tls.TLSSocket(socket, options); + * ``` + * + * where `secureSocket` has the same API as `pair.cleartext`. + * @since v0.3.2 + * @deprecated Since v0.11.3 - Use {@link TLSSocket} instead. + * @param context A secure context object as returned by `tls.createSecureContext()` + * @param isServer `true` to specify that this TLS connection should be opened as a server. + * @param requestCert `true` to specify whether a server should request a certificate from a connecting client. Only applies when `isServer` is `true`. + * @param rejectUnauthorized If not `false` a server automatically reject clients with invalid certificates. Only applies when `isServer` is `true`. + */ + function createSecurePair(context?: SecureContext, isServer?: boolean, requestCert?: boolean, rejectUnauthorized?: boolean): SecurePair; + /** + * {@link createServer} sets the default value of the `honorCipherOrder` option + * to `true`, other APIs that create secure contexts leave it unset. + * + * {@link createServer} uses a 128 bit truncated SHA1 hash value generated + * from `process.argv` as the default value of the `sessionIdContext` option, other + * APIs that create secure contexts have no default value. + * + * The `tls.createSecureContext()` method creates a `SecureContext` object. It is + * usable as an argument to several `tls` APIs, such as `server.addContext()`, + * but has no public methods. The {@link Server} constructor and the {@link createServer} method do not support the `secureContext` option. + * + * A key is _required_ for ciphers that use certificates. Either `key` or`pfx` can be used to provide it. + * + * If the `ca` option is not given, then Node.js will default to using [Mozilla's publicly trusted list of + * CAs](https://hg.mozilla.org/mozilla-central/raw-file/tip/security/nss/lib/ckfw/builtins/certdata.txt). + * + * Custom DHE parameters are discouraged in favor of the new `dhparam: 'auto'`option. When set to `'auto'`, well-known DHE parameters of sufficient strength + * will be selected automatically. Otherwise, if necessary, `openssl dhparam` can + * be used to create custom parameters. The key length must be greater than or + * equal to 1024 bits or else an error will be thrown. Although 1024 bits is + * permissible, use 2048 bits or larger for stronger security. + * @since v0.11.13 + */ + function createSecureContext(options?: SecureContextOptions): SecureContext; + /** + * Returns an array with the names of the supported TLS ciphers. The names are + * lower-case for historical reasons, but must be uppercased to be used in + * the `ciphers` option of {@link createSecureContext}. + * + * Not all supported ciphers are enabled by default. See `Modifying the default TLS cipher suite`. + * + * Cipher names that start with `'tls_'` are for TLSv1.3, all the others are for + * TLSv1.2 and below. + * + * ```js + * console.log(tls.getCiphers()); // ['aes128-gcm-sha256', 'aes128-sha', ...] + * ``` + * @since v0.10.2 + */ + function getCiphers(): string[]; + /** + * The default curve name to use for ECDH key agreement in a tls server. + * The default value is 'auto'. See tls.createSecureContext() for further + * information. + */ + let DEFAULT_ECDH_CURVE: string; + /** + * The default value of the maxVersion option of + * tls.createSecureContext(). It can be assigned any of the supported TLS + * protocol versions, 'TLSv1.3', 'TLSv1.2', 'TLSv1.1', or 'TLSv1'. Default: + * 'TLSv1.3', unless changed using CLI options. Using --tls-max-v1.2 sets + * the default to 'TLSv1.2'. Using --tls-max-v1.3 sets the default to + * 'TLSv1.3'. If multiple of the options are provided, the highest maximum + * is used. + */ + let DEFAULT_MAX_VERSION: SecureVersion; + /** + * The default value of the minVersion option of tls.createSecureContext(). + * It can be assigned any of the supported TLS protocol versions, + * 'TLSv1.3', 'TLSv1.2', 'TLSv1.1', or 'TLSv1'. Default: 'TLSv1.2', unless + * changed using CLI options. Using --tls-min-v1.0 sets the default to + * 'TLSv1'. Using --tls-min-v1.1 sets the default to 'TLSv1.1'. Using + * --tls-min-v1.3 sets the default to 'TLSv1.3'. If multiple of the options + * are provided, the lowest minimum is used. + */ + let DEFAULT_MIN_VERSION: SecureVersion; + /** + * The default value of the ciphers option of tls.createSecureContext(). + * It can be assigned any of the supported OpenSSL ciphers. + * Defaults to the content of crypto.constants.defaultCoreCipherList, unless + * changed using CLI options using --tls-default-ciphers. + */ + let DEFAULT_CIPHERS: string; + /** + * An immutable array of strings representing the root certificates (in PEM + * format) used for verifying peer certificates. This is the default value + * of the ca option to tls.createSecureContext(). + */ + const rootCertificates: ReadonlyArray; +} +declare module 'tls' { + export * from 'node:tls'; +} diff --git a/node_modules/@types/node/trace_events.d.ts b/node_modules/@types/node/trace_events.d.ts new file mode 100644 index 0000000..bb27b8e --- /dev/null +++ b/node_modules/@types/node/trace_events.d.ts @@ -0,0 +1,182 @@ +/** + * The `node:trace_events` module provides a mechanism to centralize tracing + * information generated by V8, Node.js core, and userspace code. + * + * Tracing can be enabled with the `--trace-event-categories` command-line flag + * or by using the `node:trace_events` module. The `--trace-event-categories` flag + * accepts a list of comma-separated category names. + * + * The available categories are: + * + * * `node`: An empty placeholder. + * * `node.async_hooks`: Enables capture of detailed `async_hooks` trace data. + * The `async_hooks` events have a unique `asyncId` and a special `triggerId` `triggerAsyncId` property. + * * `node.bootstrap`: Enables capture of Node.js bootstrap milestones. + * * `node.console`: Enables capture of `console.time()` and `console.count()`output. + * * `node.threadpoolwork.sync`: Enables capture of trace data for threadpool + * synchronous operations, such as `blob`, `zlib`, `crypto` and `node_api`. + * * `node.threadpoolwork.async`: Enables capture of trace data for threadpool + * asynchronous operations, such as `blob`, `zlib`, `crypto` and `node_api`. + * * `node.dns.native`: Enables capture of trace data for DNS queries. + * * `node.net.native`: Enables capture of trace data for network. + * * `node.environment`: Enables capture of Node.js Environment milestones. + * * `node.fs.sync`: Enables capture of trace data for file system sync methods. + * * `node.fs_dir.sync`: Enables capture of trace data for file system sync + * directory methods. + * * `node.fs.async`: Enables capture of trace data for file system async methods. + * * `node.fs_dir.async`: Enables capture of trace data for file system async + * directory methods. + * * `node.perf`: Enables capture of `Performance API` measurements. + * * `node.perf.usertiming`: Enables capture of only Performance API User Timing + * measures and marks. + * * `node.perf.timerify`: Enables capture of only Performance API timerify + * measurements. + * * `node.promises.rejections`: Enables capture of trace data tracking the number + * of unhandled Promise rejections and handled-after-rejections. + * * `node.vm.script`: Enables capture of trace data for the `node:vm` module's`runInNewContext()`, `runInContext()`, and `runInThisContext()` methods. + * * `v8`: The `V8` events are GC, compiling, and execution related. + * * `node.http`: Enables capture of trace data for http request / response. + * + * By default the `node`, `node.async_hooks`, and `v8` categories are enabled. + * + * ```bash + * node --trace-event-categories v8,node,node.async_hooks server.js + * ``` + * + * Prior versions of Node.js required the use of the `--trace-events-enabled`flag to enable trace events. This requirement has been removed. However, the`--trace-events-enabled` flag _may_ still be + * used and will enable the`node`, `node.async_hooks`, and `v8` trace event categories by default. + * + * ```bash + * node --trace-events-enabled + * + * # is equivalent to + * + * node --trace-event-categories v8,node,node.async_hooks + * ``` + * + * Alternatively, trace events may be enabled using the `node:trace_events` module: + * + * ```js + * const trace_events = require('node:trace_events'); + * const tracing = trace_events.createTracing({ categories: ['node.perf'] }); + * tracing.enable(); // Enable trace event capture for the 'node.perf' category + * + * // do work + * + * tracing.disable(); // Disable trace event capture for the 'node.perf' category + * ``` + * + * Running Node.js with tracing enabled will produce log files that can be opened + * in the [`chrome://tracing`](https://www.chromium.org/developers/how-tos/trace-event-profiling-tool) tab of Chrome. + * + * The logging file is by default called `node_trace.${rotation}.log`, where`${rotation}` is an incrementing log-rotation id. The filepath pattern can + * be specified with `--trace-event-file-pattern` that accepts a template + * string that supports `${rotation}` and `${pid}`: + * + * ```bash + * node --trace-event-categories v8 --trace-event-file-pattern '${pid}-${rotation}.log' server.js + * ``` + * + * To guarantee that the log file is properly generated after signal events like`SIGINT`, `SIGTERM`, or `SIGBREAK`, make sure to have the appropriate handlers + * in your code, such as: + * + * ```js + * process.on('SIGINT', function onSigint() { + * console.info('Received SIGINT.'); + * process.exit(130); // Or applicable exit code depending on OS and signal + * }); + * ``` + * + * The tracing system uses the same time source + * as the one used by `process.hrtime()`. + * However the trace-event timestamps are expressed in microseconds, + * unlike `process.hrtime()` which returns nanoseconds. + * + * The features from this module are not available in `Worker` threads. + * @experimental + * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/trace_events.js) + */ +declare module 'node:trace_events' { + /** + * The `Tracing` object is used to enable or disable tracing for sets of + * categories. Instances are created using the + * `trace_events.createTracing()` method. + * + * When created, the `Tracing` object is disabled. Calling the + * `tracing.enable()` method adds the categories to the set of enabled trace + * event categories. Calling `tracing.disable()` will remove the categories + * from the set of enabled trace event categories. + */ + interface Tracing { + /** + * A comma-separated list of the trace event categories covered by this + * `Tracing` object. + */ + readonly categories: string; + /** + * Disables this `Tracing` object. + * + * Only trace event categories _not_ covered by other enabled `Tracing` + * objects and _not_ specified by the `--trace-event-categories` flag + * will be disabled. + */ + disable(): void; + /** + * Enables this `Tracing` object for the set of categories covered by + * the `Tracing` object. + */ + enable(): void; + /** + * `true` only if the `Tracing` object has been enabled. + */ + readonly enabled: boolean; + } + interface CreateTracingOptions { + /** + * An array of trace category names. Values included in the array are + * coerced to a string when possible. An error will be thrown if the + * value cannot be coerced. + */ + categories: string[]; + } + /** + * Creates and returns a `Tracing` object for the given set of `categories`. + * + * ```js + * const trace_events = require('node:trace_events'); + * const categories = ['node.perf', 'node.async_hooks']; + * const tracing = trace_events.createTracing({ categories }); + * tracing.enable(); + * // do stuff + * tracing.disable(); + * ``` + * @since v10.0.0 + * @return . + */ + function createTracing(options: CreateTracingOptions): Tracing; + /** + * Returns a comma-separated list of all currently-enabled trace event + * categories. The current set of enabled trace event categories is determined + * by the _union_ of all currently-enabled `Tracing` objects and any categories + * enabled using the `--trace-event-categories` flag. + * + * Given the file `test.js` below, the command`node --trace-event-categories node.perf test.js` will print`'node.async_hooks,node.perf'` to the console. + * + * ```js + * const trace_events = require('node:trace_events'); + * const t1 = trace_events.createTracing({ categories: ['node.async_hooks'] }); + * const t2 = trace_events.createTracing({ categories: ['node.perf'] }); + * const t3 = trace_events.createTracing({ categories: ['v8'] }); + * + * t1.enable(); + * t2.enable(); + * + * console.log(trace_events.getEnabledCategories()); + * ``` + * @since v10.0.0 + */ + function getEnabledCategories(): string | undefined; +} +declare module 'trace_events' { + export * from 'node:trace_events'; +} diff --git a/node_modules/@types/node/ts4.8/assert.d.ts b/node_modules/@types/node/ts4.8/assert.d.ts new file mode 100644 index 0000000..c3d8f5d --- /dev/null +++ b/node_modules/@types/node/ts4.8/assert.d.ts @@ -0,0 +1,972 @@ +/** + * The `node:assert` module provides a set of assertion functions for verifying + * invariants. + * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/assert.js) + */ +declare module 'node:assert' { + /** + * An alias of {@link ok}. + * @since v0.5.9 + * @param value The input that is checked for being truthy. + */ + function assert(value: unknown, message?: string | Error): asserts value; + namespace assert { + /** + * Indicates the failure of an assertion. All errors thrown by the `node:assert`module will be instances of the `AssertionError` class. + */ + class AssertionError extends Error { + /** + * Set to the `actual` argument for methods such as {@link assert.strictEqual()}. + */ + actual: unknown; + /** + * Set to the `expected` argument for methods such as {@link assert.strictEqual()}. + */ + expected: unknown; + /** + * Set to the passed in operator value. + */ + operator: string; + /** + * Indicates if the message was auto-generated (`true`) or not. + */ + generatedMessage: boolean; + /** + * Value is always `ERR_ASSERTION` to show that the error is an assertion error. + */ + code: 'ERR_ASSERTION'; + constructor(options?: { + /** If provided, the error message is set to this value. */ + message?: string | undefined; + /** The `actual` property on the error instance. */ + actual?: unknown | undefined; + /** The `expected` property on the error instance. */ + expected?: unknown | undefined; + /** The `operator` property on the error instance. */ + operator?: string | undefined; + /** If provided, the generated stack trace omits frames before this function. */ + // tslint:disable-next-line:ban-types + stackStartFn?: Function | undefined; + }); + } + /** + * This feature is deprecated and will be removed in a future version. + * Please consider using alternatives such as the `mock` helper function. + * @since v14.2.0, v12.19.0 + * @deprecated Deprecated + */ + class CallTracker { + /** + * The wrapper function is expected to be called exactly `exact` times. If the + * function has not been called exactly `exact` times when `tracker.verify()` is called, then `tracker.verify()` will throw an + * error. + * + * ```js + * import assert from 'node:assert'; + * + * // Creates call tracker. + * const tracker = new assert.CallTracker(); + * + * function func() {} + * + * // Returns a function that wraps func() that must be called exact times + * // before tracker.verify(). + * const callsfunc = tracker.calls(func); + * ``` + * @since v14.2.0, v12.19.0 + * @param [fn='A no-op function'] + * @param [exact=1] + * @return that wraps `fn`. + */ + calls(exact?: number): () => void; + calls any>(fn?: Func, exact?: number): Func; + /** + * Example: + * + * ```js + * import assert from 'node:assert'; + * + * const tracker = new assert.CallTracker(); + * + * function func() {} + * const callsfunc = tracker.calls(func); + * callsfunc(1, 2, 3); + * + * assert.deepStrictEqual(tracker.getCalls(callsfunc), + * [{ thisArg: undefined, arguments: [1, 2, 3] }]); + * ``` + * @since v18.8.0, v16.18.0 + * @param fn + * @return An Array with all the calls to a tracked function. + */ + getCalls(fn: Function): CallTrackerCall[]; + /** + * The arrays contains information about the expected and actual number of calls of + * the functions that have not been called the expected number of times. + * + * ```js + * import assert from 'node:assert'; + * + * // Creates call tracker. + * const tracker = new assert.CallTracker(); + * + * function func() {} + * + * // Returns a function that wraps func() that must be called exact times + * // before tracker.verify(). + * const callsfunc = tracker.calls(func, 2); + * + * // Returns an array containing information on callsfunc() + * console.log(tracker.report()); + * // [ + * // { + * // message: 'Expected the func function to be executed 2 time(s) but was + * // executed 0 time(s).', + * // actual: 0, + * // expected: 2, + * // operator: 'func', + * // stack: stack trace + * // } + * // ] + * ``` + * @since v14.2.0, v12.19.0 + * @return An Array of objects containing information about the wrapper functions returned by `calls`. + */ + report(): CallTrackerReportInformation[]; + /** + * Reset calls of the call tracker. + * If a tracked function is passed as an argument, the calls will be reset for it. + * If no arguments are passed, all tracked functions will be reset. + * + * ```js + * import assert from 'node:assert'; + * + * const tracker = new assert.CallTracker(); + * + * function func() {} + * const callsfunc = tracker.calls(func); + * + * callsfunc(); + * // Tracker was called once + * assert.strictEqual(tracker.getCalls(callsfunc).length, 1); + * + * tracker.reset(callsfunc); + * assert.strictEqual(tracker.getCalls(callsfunc).length, 0); + * ``` + * @since v18.8.0, v16.18.0 + * @param fn a tracked function to reset. + */ + reset(fn?: Function): void; + /** + * Iterates through the list of functions passed to `tracker.calls()` and will throw an error for functions that + * have not been called the expected number of times. + * + * ```js + * import assert from 'node:assert'; + * + * // Creates call tracker. + * const tracker = new assert.CallTracker(); + * + * function func() {} + * + * // Returns a function that wraps func() that must be called exact times + * // before tracker.verify(). + * const callsfunc = tracker.calls(func, 2); + * + * callsfunc(); + * + * // Will throw an error since callsfunc() was only called once. + * tracker.verify(); + * ``` + * @since v14.2.0, v12.19.0 + */ + verify(): void; + } + interface CallTrackerCall { + thisArg: object; + arguments: unknown[]; + } + interface CallTrackerReportInformation { + message: string; + /** The actual number of times the function was called. */ + actual: number; + /** The number of times the function was expected to be called. */ + expected: number; + /** The name of the function that is wrapped. */ + operator: string; + /** A stack trace of the function. */ + stack: object; + } + type AssertPredicate = RegExp | (new () => object) | ((thrown: unknown) => boolean) | object | Error; + /** + * Throws an `AssertionError` with the provided error message or a default + * error message. If the `message` parameter is an instance of an `Error` then + * it will be thrown instead of the `AssertionError`. + * + * ```js + * import assert from 'node:assert/strict'; + * + * assert.fail(); + * // AssertionError [ERR_ASSERTION]: Failed + * + * assert.fail('boom'); + * // AssertionError [ERR_ASSERTION]: boom + * + * assert.fail(new TypeError('need array')); + * // TypeError: need array + * ``` + * + * Using `assert.fail()` with more than two arguments is possible but deprecated. + * See below for further details. + * @since v0.1.21 + * @param [message='Failed'] + */ + function fail(message?: string | Error): never; + /** @deprecated since v10.0.0 - use fail([message]) or other assert functions instead. */ + function fail( + actual: unknown, + expected: unknown, + message?: string | Error, + operator?: string, + // tslint:disable-next-line:ban-types + stackStartFn?: Function + ): never; + /** + * Tests if `value` is truthy. It is equivalent to`assert.equal(!!value, true, message)`. + * + * If `value` is not truthy, an `AssertionError` is thrown with a `message`property set equal to the value of the `message` parameter. If the `message`parameter is `undefined`, a default + * error message is assigned. If the `message`parameter is an instance of an `Error` then it will be thrown instead of the`AssertionError`. + * If no arguments are passed in at all `message` will be set to the string:`` 'No value argument passed to `assert.ok()`' ``. + * + * Be aware that in the `repl` the error message will be different to the one + * thrown in a file! See below for further details. + * + * ```js + * import assert from 'node:assert/strict'; + * + * assert.ok(true); + * // OK + * assert.ok(1); + * // OK + * + * assert.ok(); + * // AssertionError: No value argument passed to `assert.ok()` + * + * assert.ok(false, 'it\'s false'); + * // AssertionError: it's false + * + * // In the repl: + * assert.ok(typeof 123 === 'string'); + * // AssertionError: false == true + * + * // In a file (e.g. test.js): + * assert.ok(typeof 123 === 'string'); + * // AssertionError: The expression evaluated to a falsy value: + * // + * // assert.ok(typeof 123 === 'string') + * + * assert.ok(false); + * // AssertionError: The expression evaluated to a falsy value: + * // + * // assert.ok(false) + * + * assert.ok(0); + * // AssertionError: The expression evaluated to a falsy value: + * // + * // assert.ok(0) + * ``` + * + * ```js + * import assert from 'node:assert/strict'; + * + * // Using `assert()` works the same: + * assert(0); + * // AssertionError: The expression evaluated to a falsy value: + * // + * // assert(0) + * ``` + * @since v0.1.21 + */ + function ok(value: unknown, message?: string | Error): asserts value; + /** + * **Strict assertion mode** + * + * An alias of {@link strictEqual}. + * + * **Legacy assertion mode** + * + * > Stability: 3 - Legacy: Use {@link strictEqual} instead. + * + * Tests shallow, coercive equality between the `actual` and `expected` parameters + * using the [`==` operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Equality). `NaN` is specially handled + * and treated as being identical if both sides are `NaN`. + * + * ```js + * import assert from 'node:assert'; + * + * assert.equal(1, 1); + * // OK, 1 == 1 + * assert.equal(1, '1'); + * // OK, 1 == '1' + * assert.equal(NaN, NaN); + * // OK + * + * assert.equal(1, 2); + * // AssertionError: 1 == 2 + * assert.equal({ a: { b: 1 } }, { a: { b: 1 } }); + * // AssertionError: { a: { b: 1 } } == { a: { b: 1 } } + * ``` + * + * If the values are not equal, an `AssertionError` is thrown with a `message`property set equal to the value of the `message` parameter. If the `message`parameter is undefined, a default + * error message is assigned. If the `message`parameter is an instance of an `Error` then it will be thrown instead of the`AssertionError`. + * @since v0.1.21 + */ + function equal(actual: unknown, expected: unknown, message?: string | Error): void; + /** + * **Strict assertion mode** + * + * An alias of {@link notStrictEqual}. + * + * **Legacy assertion mode** + * + * > Stability: 3 - Legacy: Use {@link notStrictEqual} instead. + * + * Tests shallow, coercive inequality with the [`!=` operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Inequality). `NaN` is + * specially handled and treated as being identical if both sides are `NaN`. + * + * ```js + * import assert from 'node:assert'; + * + * assert.notEqual(1, 2); + * // OK + * + * assert.notEqual(1, 1); + * // AssertionError: 1 != 1 + * + * assert.notEqual(1, '1'); + * // AssertionError: 1 != '1' + * ``` + * + * If the values are equal, an `AssertionError` is thrown with a `message`property set equal to the value of the `message` parameter. If the `message`parameter is undefined, a default error + * message is assigned. If the `message`parameter is an instance of an `Error` then it will be thrown instead of the`AssertionError`. + * @since v0.1.21 + */ + function notEqual(actual: unknown, expected: unknown, message?: string | Error): void; + /** + * **Strict assertion mode** + * + * An alias of {@link deepStrictEqual}. + * + * **Legacy assertion mode** + * + * > Stability: 3 - Legacy: Use {@link deepStrictEqual} instead. + * + * Tests for deep equality between the `actual` and `expected` parameters. Consider + * using {@link deepStrictEqual} instead. {@link deepEqual} can have + * surprising results. + * + * _Deep equality_ means that the enumerable "own" properties of child objects + * are also recursively evaluated by the following rules. + * @since v0.1.21 + */ + function deepEqual(actual: unknown, expected: unknown, message?: string | Error): void; + /** + * **Strict assertion mode** + * + * An alias of {@link notDeepStrictEqual}. + * + * **Legacy assertion mode** + * + * > Stability: 3 - Legacy: Use {@link notDeepStrictEqual} instead. + * + * Tests for any deep inequality. Opposite of {@link deepEqual}. + * + * ```js + * import assert from 'node:assert'; + * + * const obj1 = { + * a: { + * b: 1, + * }, + * }; + * const obj2 = { + * a: { + * b: 2, + * }, + * }; + * const obj3 = { + * a: { + * b: 1, + * }, + * }; + * const obj4 = { __proto__: obj1 }; + * + * assert.notDeepEqual(obj1, obj1); + * // AssertionError: { a: { b: 1 } } notDeepEqual { a: { b: 1 } } + * + * assert.notDeepEqual(obj1, obj2); + * // OK + * + * assert.notDeepEqual(obj1, obj3); + * // AssertionError: { a: { b: 1 } } notDeepEqual { a: { b: 1 } } + * + * assert.notDeepEqual(obj1, obj4); + * // OK + * ``` + * + * If the values are deeply equal, an `AssertionError` is thrown with a`message` property set equal to the value of the `message` parameter. If the`message` parameter is undefined, a default + * error message is assigned. If the`message` parameter is an instance of an `Error` then it will be thrown + * instead of the `AssertionError`. + * @since v0.1.21 + */ + function notDeepEqual(actual: unknown, expected: unknown, message?: string | Error): void; + /** + * Tests strict equality between the `actual` and `expected` parameters as + * determined by [`Object.is()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is). + * + * ```js + * import assert from 'node:assert/strict'; + * + * assert.strictEqual(1, 2); + * // AssertionError [ERR_ASSERTION]: Expected inputs to be strictly equal: + * // + * // 1 !== 2 + * + * assert.strictEqual(1, 1); + * // OK + * + * assert.strictEqual('Hello foobar', 'Hello World!'); + * // AssertionError [ERR_ASSERTION]: Expected inputs to be strictly equal: + * // + actual - expected + * // + * // + 'Hello foobar' + * // - 'Hello World!' + * // ^ + * + * const apples = 1; + * const oranges = 2; + * assert.strictEqual(apples, oranges, `apples ${apples} !== oranges ${oranges}`); + * // AssertionError [ERR_ASSERTION]: apples 1 !== oranges 2 + * + * assert.strictEqual(1, '1', new TypeError('Inputs are not identical')); + * // TypeError: Inputs are not identical + * ``` + * + * If the values are not strictly equal, an `AssertionError` is thrown with a`message` property set equal to the value of the `message` parameter. If the`message` parameter is undefined, a + * default error message is assigned. If the`message` parameter is an instance of an `Error` then it will be thrown + * instead of the `AssertionError`. + * @since v0.1.21 + */ + function strictEqual(actual: unknown, expected: T, message?: string | Error): asserts actual is T; + /** + * Tests strict inequality between the `actual` and `expected` parameters as + * determined by [`Object.is()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is). + * + * ```js + * import assert from 'node:assert/strict'; + * + * assert.notStrictEqual(1, 2); + * // OK + * + * assert.notStrictEqual(1, 1); + * // AssertionError [ERR_ASSERTION]: Expected "actual" to be strictly unequal to: + * // + * // 1 + * + * assert.notStrictEqual(1, '1'); + * // OK + * ``` + * + * If the values are strictly equal, an `AssertionError` is thrown with a`message` property set equal to the value of the `message` parameter. If the`message` parameter is undefined, a + * default error message is assigned. If the`message` parameter is an instance of an `Error` then it will be thrown + * instead of the `AssertionError`. + * @since v0.1.21 + */ + function notStrictEqual(actual: unknown, expected: unknown, message?: string | Error): void; + /** + * Tests for deep equality between the `actual` and `expected` parameters. + * "Deep" equality means that the enumerable "own" properties of child objects + * are recursively evaluated also by the following rules. + * @since v1.2.0 + */ + function deepStrictEqual(actual: unknown, expected: T, message?: string | Error): asserts actual is T; + /** + * Tests for deep strict inequality. Opposite of {@link deepStrictEqual}. + * + * ```js + * import assert from 'node:assert/strict'; + * + * assert.notDeepStrictEqual({ a: 1 }, { a: '1' }); + * // OK + * ``` + * + * If the values are deeply and strictly equal, an `AssertionError` is thrown + * with a `message` property set equal to the value of the `message` parameter. If + * the `message` parameter is undefined, a default error message is assigned. If + * the `message` parameter is an instance of an `Error` then it will be thrown + * instead of the `AssertionError`. + * @since v1.2.0 + */ + function notDeepStrictEqual(actual: unknown, expected: unknown, message?: string | Error): void; + /** + * Expects the function `fn` to throw an error. + * + * If specified, `error` can be a [`Class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes), + * [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions), a validation function, + * a validation object where each property will be tested for strict deep equality, + * or an instance of error where each property will be tested for strict deep + * equality including the non-enumerable `message` and `name` properties. When + * using an object, it is also possible to use a regular expression, when + * validating against a string property. See below for examples. + * + * If specified, `message` will be appended to the message provided by the`AssertionError` if the `fn` call fails to throw or in case the error validation + * fails. + * + * Custom validation object/error instance: + * + * ```js + * import assert from 'node:assert/strict'; + * + * const err = new TypeError('Wrong value'); + * err.code = 404; + * err.foo = 'bar'; + * err.info = { + * nested: true, + * baz: 'text', + * }; + * err.reg = /abc/i; + * + * assert.throws( + * () => { + * throw err; + * }, + * { + * name: 'TypeError', + * message: 'Wrong value', + * info: { + * nested: true, + * baz: 'text', + * }, + * // Only properties on the validation object will be tested for. + * // Using nested objects requires all properties to be present. Otherwise + * // the validation is going to fail. + * }, + * ); + * + * // Using regular expressions to validate error properties: + * assert.throws( + * () => { + * throw err; + * }, + * { + * // The `name` and `message` properties are strings and using regular + * // expressions on those will match against the string. If they fail, an + * // error is thrown. + * name: /^TypeError$/, + * message: /Wrong/, + * foo: 'bar', + * info: { + * nested: true, + * // It is not possible to use regular expressions for nested properties! + * baz: 'text', + * }, + * // The `reg` property contains a regular expression and only if the + * // validation object contains an identical regular expression, it is going + * // to pass. + * reg: /abc/i, + * }, + * ); + * + * // Fails due to the different `message` and `name` properties: + * assert.throws( + * () => { + * const otherErr = new Error('Not found'); + * // Copy all enumerable properties from `err` to `otherErr`. + * for (const [key, value] of Object.entries(err)) { + * otherErr[key] = value; + * } + * throw otherErr; + * }, + * // The error's `message` and `name` properties will also be checked when using + * // an error as validation object. + * err, + * ); + * ``` + * + * Validate instanceof using constructor: + * + * ```js + * import assert from 'node:assert/strict'; + * + * assert.throws( + * () => { + * throw new Error('Wrong value'); + * }, + * Error, + * ); + * ``` + * + * Validate error message using [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions): + * + * Using a regular expression runs `.toString` on the error object, and will + * therefore also include the error name. + * + * ```js + * import assert from 'node:assert/strict'; + * + * assert.throws( + * () => { + * throw new Error('Wrong value'); + * }, + * /^Error: Wrong value$/, + * ); + * ``` + * + * Custom error validation: + * + * The function must return `true` to indicate all internal validations passed. + * It will otherwise fail with an `AssertionError`. + * + * ```js + * import assert from 'node:assert/strict'; + * + * assert.throws( + * () => { + * throw new Error('Wrong value'); + * }, + * (err) => { + * assert(err instanceof Error); + * assert(/value/.test(err)); + * // Avoid returning anything from validation functions besides `true`. + * // Otherwise, it's not clear what part of the validation failed. Instead, + * // throw an error about the specific validation that failed (as done in this + * // example) and add as much helpful debugging information to that error as + * // possible. + * return true; + * }, + * 'unexpected error', + * ); + * ``` + * + * `error` cannot be a string. If a string is provided as the second + * argument, then `error` is assumed to be omitted and the string will be used for`message` instead. This can lead to easy-to-miss mistakes. Using the same + * message as the thrown error message is going to result in an`ERR_AMBIGUOUS_ARGUMENT` error. Please read the example below carefully if using + * a string as the second argument gets considered: + * + * ```js + * import assert from 'node:assert/strict'; + * + * function throwingFirst() { + * throw new Error('First'); + * } + * + * function throwingSecond() { + * throw new Error('Second'); + * } + * + * function notThrowing() {} + * + * // The second argument is a string and the input function threw an Error. + * // The first case will not throw as it does not match for the error message + * // thrown by the input function! + * assert.throws(throwingFirst, 'Second'); + * // In the next example the message has no benefit over the message from the + * // error and since it is not clear if the user intended to actually match + * // against the error message, Node.js throws an `ERR_AMBIGUOUS_ARGUMENT` error. + * assert.throws(throwingSecond, 'Second'); + * // TypeError [ERR_AMBIGUOUS_ARGUMENT] + * + * // The string is only used (as message) in case the function does not throw: + * assert.throws(notThrowing, 'Second'); + * // AssertionError [ERR_ASSERTION]: Missing expected exception: Second + * + * // If it was intended to match for the error message do this instead: + * // It does not throw because the error messages match. + * assert.throws(throwingSecond, /Second$/); + * + * // If the error message does not match, an AssertionError is thrown. + * assert.throws(throwingFirst, /Second$/); + * // AssertionError [ERR_ASSERTION] + * ``` + * + * Due to the confusing error-prone notation, avoid a string as the second + * argument. + * @since v0.1.21 + */ + function throws(block: () => unknown, message?: string | Error): void; + function throws(block: () => unknown, error: AssertPredicate, message?: string | Error): void; + /** + * Asserts that the function `fn` does not throw an error. + * + * Using `assert.doesNotThrow()` is actually not useful because there + * is no benefit in catching an error and then rethrowing it. Instead, consider + * adding a comment next to the specific code path that should not throw and keep + * error messages as expressive as possible. + * + * When `assert.doesNotThrow()` is called, it will immediately call the `fn`function. + * + * If an error is thrown and it is the same type as that specified by the `error`parameter, then an `AssertionError` is thrown. If the error is of a + * different type, or if the `error` parameter is undefined, the error is + * propagated back to the caller. + * + * If specified, `error` can be a [`Class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes), + * [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions), or a validation + * function. See {@link throws} for more details. + * + * The following, for instance, will throw the `TypeError` because there is no + * matching error type in the assertion: + * + * ```js + * import assert from 'node:assert/strict'; + * + * assert.doesNotThrow( + * () => { + * throw new TypeError('Wrong value'); + * }, + * SyntaxError, + * ); + * ``` + * + * However, the following will result in an `AssertionError` with the message + * 'Got unwanted exception...': + * + * ```js + * import assert from 'node:assert/strict'; + * + * assert.doesNotThrow( + * () => { + * throw new TypeError('Wrong value'); + * }, + * TypeError, + * ); + * ``` + * + * If an `AssertionError` is thrown and a value is provided for the `message`parameter, the value of `message` will be appended to the `AssertionError` message: + * + * ```js + * import assert from 'node:assert/strict'; + * + * assert.doesNotThrow( + * () => { + * throw new TypeError('Wrong value'); + * }, + * /Wrong value/, + * 'Whoops', + * ); + * // Throws: AssertionError: Got unwanted exception: Whoops + * ``` + * @since v0.1.21 + */ + function doesNotThrow(block: () => unknown, message?: string | Error): void; + function doesNotThrow(block: () => unknown, error: AssertPredicate, message?: string | Error): void; + /** + * Throws `value` if `value` is not `undefined` or `null`. This is useful when + * testing the `error` argument in callbacks. The stack trace contains all frames + * from the error passed to `ifError()` including the potential new frames for`ifError()` itself. + * + * ```js + * import assert from 'node:assert/strict'; + * + * assert.ifError(null); + * // OK + * assert.ifError(0); + * // AssertionError [ERR_ASSERTION]: ifError got unwanted exception: 0 + * assert.ifError('error'); + * // AssertionError [ERR_ASSERTION]: ifError got unwanted exception: 'error' + * assert.ifError(new Error()); + * // AssertionError [ERR_ASSERTION]: ifError got unwanted exception: Error + * + * // Create some random error frames. + * let err; + * (function errorFrame() { + * err = new Error('test error'); + * })(); + * + * (function ifErrorFrame() { + * assert.ifError(err); + * })(); + * // AssertionError [ERR_ASSERTION]: ifError got unwanted exception: test error + * // at ifErrorFrame + * // at errorFrame + * ``` + * @since v0.1.97 + */ + function ifError(value: unknown): asserts value is null | undefined; + /** + * Awaits the `asyncFn` promise or, if `asyncFn` is a function, immediately + * calls the function and awaits the returned promise to complete. It will then + * check that the promise is rejected. + * + * If `asyncFn` is a function and it throws an error synchronously,`assert.rejects()` will return a rejected `Promise` with that error. If the + * function does not return a promise, `assert.rejects()` will return a rejected`Promise` with an `ERR_INVALID_RETURN_VALUE` error. In both cases the error + * handler is skipped. + * + * Besides the async nature to await the completion behaves identically to {@link throws}. + * + * If specified, `error` can be a [`Class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes), + * [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions), a validation function, + * an object where each property will be tested for, or an instance of error where + * each property will be tested for including the non-enumerable `message` and`name` properties. + * + * If specified, `message` will be the message provided by the `AssertionError` if the `asyncFn` fails to reject. + * + * ```js + * import assert from 'node:assert/strict'; + * + * await assert.rejects( + * async () => { + * throw new TypeError('Wrong value'); + * }, + * { + * name: 'TypeError', + * message: 'Wrong value', + * }, + * ); + * ``` + * + * ```js + * import assert from 'node:assert/strict'; + * + * await assert.rejects( + * async () => { + * throw new TypeError('Wrong value'); + * }, + * (err) => { + * assert.strictEqual(err.name, 'TypeError'); + * assert.strictEqual(err.message, 'Wrong value'); + * return true; + * }, + * ); + * ``` + * + * ```js + * import assert from 'node:assert/strict'; + * + * assert.rejects( + * Promise.reject(new Error('Wrong value')), + * Error, + * ).then(() => { + * // ... + * }); + * ``` + * + * `error` cannot be a string. If a string is provided as the second + * argument, then `error` is assumed to be omitted and the string will be used for`message` instead. This can lead to easy-to-miss mistakes. Please read the + * example in {@link throws} carefully if using a string as the second + * argument gets considered. + * @since v10.0.0 + */ + function rejects(block: (() => Promise) | Promise, message?: string | Error): Promise; + function rejects(block: (() => Promise) | Promise, error: AssertPredicate, message?: string | Error): Promise; + /** + * Awaits the `asyncFn` promise or, if `asyncFn` is a function, immediately + * calls the function and awaits the returned promise to complete. It will then + * check that the promise is not rejected. + * + * If `asyncFn` is a function and it throws an error synchronously,`assert.doesNotReject()` will return a rejected `Promise` with that error. If + * the function does not return a promise, `assert.doesNotReject()` will return a + * rejected `Promise` with an `ERR_INVALID_RETURN_VALUE` error. In both cases + * the error handler is skipped. + * + * Using `assert.doesNotReject()` is actually not useful because there is little + * benefit in catching a rejection and then rejecting it again. Instead, consider + * adding a comment next to the specific code path that should not reject and keep + * error messages as expressive as possible. + * + * If specified, `error` can be a [`Class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes), + * [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions), or a validation + * function. See {@link throws} for more details. + * + * Besides the async nature to await the completion behaves identically to {@link doesNotThrow}. + * + * ```js + * import assert from 'node:assert/strict'; + * + * await assert.doesNotReject( + * async () => { + * throw new TypeError('Wrong value'); + * }, + * SyntaxError, + * ); + * ``` + * + * ```js + * import assert from 'node:assert/strict'; + * + * assert.doesNotReject(Promise.reject(new TypeError('Wrong value'))) + * .then(() => { + * // ... + * }); + * ``` + * @since v10.0.0 + */ + function doesNotReject(block: (() => Promise) | Promise, message?: string | Error): Promise; + function doesNotReject(block: (() => Promise) | Promise, error: AssertPredicate, message?: string | Error): Promise; + /** + * Expects the `string` input to match the regular expression. + * + * ```js + * import assert from 'node:assert/strict'; + * + * assert.match('I will fail', /pass/); + * // AssertionError [ERR_ASSERTION]: The input did not match the regular ... + * + * assert.match(123, /pass/); + * // AssertionError [ERR_ASSERTION]: The "string" argument must be of type string. + * + * assert.match('I will pass', /pass/); + * // OK + * ``` + * + * If the values do not match, or if the `string` argument is of another type than`string`, an `AssertionError` is thrown with a `message` property set equal + * to the value of the `message` parameter. If the `message` parameter is + * undefined, a default error message is assigned. If the `message` parameter is an + * instance of an `Error` then it will be thrown instead of the `AssertionError`. + * @since v13.6.0, v12.16.0 + */ + function match(value: string, regExp: RegExp, message?: string | Error): void; + /** + * Expects the `string` input not to match the regular expression. + * + * ```js + * import assert from 'node:assert/strict'; + * + * assert.doesNotMatch('I will fail', /fail/); + * // AssertionError [ERR_ASSERTION]: The input was expected to not match the ... + * + * assert.doesNotMatch(123, /pass/); + * // AssertionError [ERR_ASSERTION]: The "string" argument must be of type string. + * + * assert.doesNotMatch('I will pass', /different/); + * // OK + * ``` + * + * If the values do match, or if the `string` argument is of another type than`string`, an `AssertionError` is thrown with a `message` property set equal + * to the value of the `message` parameter. If the `message` parameter is + * undefined, a default error message is assigned. If the `message` parameter is an + * instance of an `Error` then it will be thrown instead of the `AssertionError`. + * @since v13.6.0, v12.16.0 + */ + function doesNotMatch(value: string, regExp: RegExp, message?: string | Error): void; + const strict: Omit & { + (value: unknown, message?: string | Error): asserts value; + equal: typeof strictEqual; + notEqual: typeof notStrictEqual; + deepEqual: typeof deepStrictEqual; + notDeepEqual: typeof notDeepStrictEqual; + // Mapped types and assertion functions are incompatible? + // TS2775: Assertions require every name in the call target + // to be declared with an explicit type annotation. + ok: typeof ok; + strictEqual: typeof strictEqual; + deepStrictEqual: typeof deepStrictEqual; + ifError: typeof ifError; + strict: typeof strict; + }; + } + export = assert; +} +declare module 'assert' { + import assert = require('node:assert'); + export = assert; +} diff --git a/node_modules/@types/node/ts4.8/assert/strict.d.ts b/node_modules/@types/node/ts4.8/assert/strict.d.ts new file mode 100644 index 0000000..b4319b9 --- /dev/null +++ b/node_modules/@types/node/ts4.8/assert/strict.d.ts @@ -0,0 +1,8 @@ +declare module 'assert/strict' { + import { strict } from 'node:assert'; + export = strict; +} +declare module 'node:assert/strict' { + import { strict } from 'node:assert'; + export = strict; +} diff --git a/node_modules/@types/node/ts4.8/async_hooks.d.ts b/node_modules/@types/node/ts4.8/async_hooks.d.ts new file mode 100644 index 0000000..51da4a4 --- /dev/null +++ b/node_modules/@types/node/ts4.8/async_hooks.d.ts @@ -0,0 +1,532 @@ +/** + * We strongly discourage the use of the `async_hooks` API. + * Other APIs that can cover most of its use cases include: + * + * * `AsyncLocalStorage` tracks async context + * * `process.getActiveResourcesInfo()` tracks active resources + * + * The `node:async_hooks` module provides an API to track asynchronous resources. + * It can be accessed using: + * + * ```js + * import async_hooks from 'node:async_hooks'; + * ``` + * @experimental + * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/async_hooks.js) + */ +declare module 'node:async_hooks' { + /** + * ```js + * import { executionAsyncId } from 'node:async_hooks'; + * import fs from 'node:fs'; + * + * console.log(executionAsyncId()); // 1 - bootstrap + * const path = '.'; + * fs.open(path, 'r', (err, fd) => { + * console.log(executionAsyncId()); // 6 - open() + * }); + * ``` + * + * The ID returned from `executionAsyncId()` is related to execution timing, not + * causality (which is covered by `triggerAsyncId()`): + * + * ```js + * const server = net.createServer((conn) => { + * // Returns the ID of the server, not of the new connection, because the + * // callback runs in the execution scope of the server's MakeCallback(). + * async_hooks.executionAsyncId(); + * + * }).listen(port, () => { + * // Returns the ID of a TickObject (process.nextTick()) because all + * // callbacks passed to .listen() are wrapped in a nextTick(). + * async_hooks.executionAsyncId(); + * }); + * ``` + * + * Promise contexts may not get precise `executionAsyncIds` by default. + * See the section on `promise execution tracking`. + * @since v8.1.0 + * @return The `asyncId` of the current execution context. Useful to track when something calls. + */ + function executionAsyncId(): number; + /** + * Resource objects returned by `executionAsyncResource()` are most often internal + * Node.js handle objects with undocumented APIs. Using any functions or properties + * on the object is likely to crash your application and should be avoided. + * + * Using `executionAsyncResource()` in the top-level execution context will + * return an empty object as there is no handle or request object to use, + * but having an object representing the top-level can be helpful. + * + * ```js + * import { open } from 'node:fs'; + * import { executionAsyncId, executionAsyncResource } from 'node:async_hooks'; + * + * console.log(executionAsyncId(), executionAsyncResource()); // 1 {} + * open(new URL(import.meta.url), 'r', (err, fd) => { + * console.log(executionAsyncId(), executionAsyncResource()); // 7 FSReqWrap + * }); + * ``` + * + * This can be used to implement continuation local storage without the + * use of a tracking `Map` to store the metadata: + * + * ```js + * import { createServer } from 'node:http'; + * import { + * executionAsyncId, + * executionAsyncResource, + * createHook, + * } from 'async_hooks'; + * const sym = Symbol('state'); // Private symbol to avoid pollution + * + * createHook({ + * init(asyncId, type, triggerAsyncId, resource) { + * const cr = executionAsyncResource(); + * if (cr) { + * resource[sym] = cr[sym]; + * } + * }, + * }).enable(); + * + * const server = createServer((req, res) => { + * executionAsyncResource()[sym] = { state: req.url }; + * setTimeout(function() { + * res.end(JSON.stringify(executionAsyncResource()[sym])); + * }, 100); + * }).listen(3000); + * ``` + * @since v13.9.0, v12.17.0 + * @return The resource representing the current execution. Useful to store data within the resource. + */ + function executionAsyncResource(): object; + /** + * ```js + * const server = net.createServer((conn) => { + * // The resource that caused (or triggered) this callback to be called + * // was that of the new connection. Thus the return value of triggerAsyncId() + * // is the asyncId of "conn". + * async_hooks.triggerAsyncId(); + * + * }).listen(port, () => { + * // Even though all callbacks passed to .listen() are wrapped in a nextTick() + * // the callback itself exists because the call to the server's .listen() + * // was made. So the return value would be the ID of the server. + * async_hooks.triggerAsyncId(); + * }); + * ``` + * + * Promise contexts may not get valid `triggerAsyncId`s by default. See + * the section on `promise execution tracking`. + * @return The ID of the resource responsible for calling the callback that is currently being executed. + */ + function triggerAsyncId(): number; + interface HookCallbacks { + /** + * Called when a class is constructed that has the possibility to emit an asynchronous event. + * @param asyncId a unique ID for the async resource + * @param type the type of the async resource + * @param triggerAsyncId the unique ID of the async resource in whose execution context this async resource was created + * @param resource reference to the resource representing the async operation, needs to be released during destroy + */ + init?(asyncId: number, type: string, triggerAsyncId: number, resource: object): void; + /** + * When an asynchronous operation is initiated or completes a callback is called to notify the user. + * The before callback is called just before said callback is executed. + * @param asyncId the unique identifier assigned to the resource about to execute the callback. + */ + before?(asyncId: number): void; + /** + * Called immediately after the callback specified in before is completed. + * @param asyncId the unique identifier assigned to the resource which has executed the callback. + */ + after?(asyncId: number): void; + /** + * Called when a promise has resolve() called. This may not be in the same execution id + * as the promise itself. + * @param asyncId the unique id for the promise that was resolve()d. + */ + promiseResolve?(asyncId: number): void; + /** + * Called after the resource corresponding to asyncId is destroyed + * @param asyncId a unique ID for the async resource + */ + destroy?(asyncId: number): void; + } + interface AsyncHook { + /** + * Enable the callbacks for a given AsyncHook instance. If no callbacks are provided enabling is a noop. + */ + enable(): this; + /** + * Disable the callbacks for a given AsyncHook instance from the global pool of AsyncHook callbacks to be executed. Once a hook has been disabled it will not be called again until enabled. + */ + disable(): this; + } + /** + * Registers functions to be called for different lifetime events of each async + * operation. + * + * The callbacks `init()`/`before()`/`after()`/`destroy()` are called for the + * respective asynchronous event during a resource's lifetime. + * + * All callbacks are optional. For example, if only resource cleanup needs to + * be tracked, then only the `destroy` callback needs to be passed. The + * specifics of all functions that can be passed to `callbacks` is in the `Hook Callbacks` section. + * + * ```js + * import { createHook } from 'node:async_hooks'; + * + * const asyncHook = createHook({ + * init(asyncId, type, triggerAsyncId, resource) { }, + * destroy(asyncId) { }, + * }); + * ``` + * + * The callbacks will be inherited via the prototype chain: + * + * ```js + * class MyAsyncCallbacks { + * init(asyncId, type, triggerAsyncId, resource) { } + * destroy(asyncId) {} + * } + * + * class MyAddedCallbacks extends MyAsyncCallbacks { + * before(asyncId) { } + * after(asyncId) { } + * } + * + * const asyncHook = async_hooks.createHook(new MyAddedCallbacks()); + * ``` + * + * Because promises are asynchronous resources whose lifecycle is tracked + * via the async hooks mechanism, the `init()`, `before()`, `after()`, and`destroy()` callbacks _must not_ be async functions that return promises. + * @since v8.1.0 + * @param callbacks The `Hook Callbacks` to register + * @return Instance used for disabling and enabling hooks + */ + function createHook(callbacks: HookCallbacks): AsyncHook; + interface AsyncResourceOptions { + /** + * The ID of the execution context that created this async event. + * @default executionAsyncId() + */ + triggerAsyncId?: number | undefined; + /** + * Disables automatic `emitDestroy` when the object is garbage collected. + * This usually does not need to be set (even if `emitDestroy` is called + * manually), unless the resource's `asyncId` is retrieved and the + * sensitive API's `emitDestroy` is called with it. + * @default false + */ + requireManualDestroy?: boolean | undefined; + } + /** + * The class `AsyncResource` is designed to be extended by the embedder's async + * resources. Using this, users can easily trigger the lifetime events of their + * own resources. + * + * The `init` hook will trigger when an `AsyncResource` is instantiated. + * + * The following is an overview of the `AsyncResource` API. + * + * ```js + * import { AsyncResource, executionAsyncId } from 'node:async_hooks'; + * + * // AsyncResource() is meant to be extended. Instantiating a + * // new AsyncResource() also triggers init. If triggerAsyncId is omitted then + * // async_hook.executionAsyncId() is used. + * const asyncResource = new AsyncResource( + * type, { triggerAsyncId: executionAsyncId(), requireManualDestroy: false }, + * ); + * + * // Run a function in the execution context of the resource. This will + * // * establish the context of the resource + * // * trigger the AsyncHooks before callbacks + * // * call the provided function `fn` with the supplied arguments + * // * trigger the AsyncHooks after callbacks + * // * restore the original execution context + * asyncResource.runInAsyncScope(fn, thisArg, ...args); + * + * // Call AsyncHooks destroy callbacks. + * asyncResource.emitDestroy(); + * + * // Return the unique ID assigned to the AsyncResource instance. + * asyncResource.asyncId(); + * + * // Return the trigger ID for the AsyncResource instance. + * asyncResource.triggerAsyncId(); + * ``` + */ + class AsyncResource { + /** + * AsyncResource() is meant to be extended. Instantiating a + * new AsyncResource() also triggers init. If triggerAsyncId is omitted then + * async_hook.executionAsyncId() is used. + * @param type The type of async event. + * @param triggerAsyncId The ID of the execution context that created + * this async event (default: `executionAsyncId()`), or an + * AsyncResourceOptions object (since v9.3.0) + */ + constructor(type: string, triggerAsyncId?: number | AsyncResourceOptions); + /** + * Binds the given function to the current execution context. + * @since v14.8.0, v12.19.0 + * @param fn The function to bind to the current execution context. + * @param type An optional name to associate with the underlying `AsyncResource`. + */ + static bind any, ThisArg>(fn: Func, type?: string, thisArg?: ThisArg): Func; + /** + * Binds the given function to execute to this `AsyncResource`'s scope. + * @since v14.8.0, v12.19.0 + * @param fn The function to bind to the current `AsyncResource`. + */ + bind any>(fn: Func): Func; + /** + * Call the provided function with the provided arguments in the execution context + * of the async resource. This will establish the context, trigger the AsyncHooks + * before callbacks, call the function, trigger the AsyncHooks after callbacks, and + * then restore the original execution context. + * @since v9.6.0 + * @param fn The function to call in the execution context of this async resource. + * @param thisArg The receiver to be used for the function call. + * @param args Optional arguments to pass to the function. + */ + runInAsyncScope(fn: (this: This, ...args: any[]) => Result, thisArg?: This, ...args: any[]): Result; + /** + * Call all `destroy` hooks. This should only ever be called once. An error will + * be thrown if it is called more than once. This **must** be manually called. If + * the resource is left to be collected by the GC then the `destroy` hooks will + * never be called. + * @return A reference to `asyncResource`. + */ + emitDestroy(): this; + /** + * @return The unique `asyncId` assigned to the resource. + */ + asyncId(): number; + /** + * + * @return The same `triggerAsyncId` that is passed to the `AsyncResource` constructor. + */ + triggerAsyncId(): number; + } + /** + * This class creates stores that stay coherent through asynchronous operations. + * + * While you can create your own implementation on top of the `node:async_hooks`module, `AsyncLocalStorage` should be preferred as it is a performant and memory + * safe implementation that involves significant optimizations that are non-obvious + * to implement. + * + * The following example uses `AsyncLocalStorage` to build a simple logger + * that assigns IDs to incoming HTTP requests and includes them in messages + * logged within each request. + * + * ```js + * import http from 'node:http'; + * import { AsyncLocalStorage } from 'node:async_hooks'; + * + * const asyncLocalStorage = new AsyncLocalStorage(); + * + * function logWithId(msg) { + * const id = asyncLocalStorage.getStore(); + * console.log(`${id !== undefined ? id : '-'}:`, msg); + * } + * + * let idSeq = 0; + * http.createServer((req, res) => { + * asyncLocalStorage.run(idSeq++, () => { + * logWithId('start'); + * // Imagine any chain of async operations here + * setImmediate(() => { + * logWithId('finish'); + * res.end(); + * }); + * }); + * }).listen(8080); + * + * http.get('http://localhost:8080'); + * http.get('http://localhost:8080'); + * // Prints: + * // 0: start + * // 1: start + * // 0: finish + * // 1: finish + * ``` + * + * Each instance of `AsyncLocalStorage` maintains an independent storage context. + * Multiple instances can safely exist simultaneously without risk of interfering + * with each other's data. + * @since v13.10.0, v12.17.0 + */ + class AsyncLocalStorage { + /** + * Binds the given function to the current execution context. + * @since v19.8.0 + * @experimental + * @param fn The function to bind to the current execution context. + * @return A new function that calls `fn` within the captured execution context. + */ + static bind any>(fn: Func): Func; + /** + * Captures the current execution context and returns a function that accepts a + * function as an argument. Whenever the returned function is called, it + * calls the function passed to it within the captured context. + * + * ```js + * const asyncLocalStorage = new AsyncLocalStorage(); + * const runInAsyncScope = asyncLocalStorage.run(123, () => AsyncLocalStorage.snapshot()); + * const result = asyncLocalStorage.run(321, () => runInAsyncScope(() => asyncLocalStorage.getStore())); + * console.log(result); // returns 123 + * ``` + * + * AsyncLocalStorage.snapshot() can replace the use of AsyncResource for simple + * async context tracking purposes, for example: + * + * ```js + * class Foo { + * #runInAsyncScope = AsyncLocalStorage.snapshot(); + * + * get() { return this.#runInAsyncScope(() => asyncLocalStorage.getStore()); } + * } + * + * const foo = asyncLocalStorage.run(123, () => new Foo()); + * console.log(asyncLocalStorage.run(321, () => foo.get())); // returns 123 + * ``` + * @since v19.8.0 + * @experimental + * @return A new function with the signature `(fn: (...args) : R, ...args) : R`. + */ + static snapshot(): (fn: (...args: TArgs) => R, ...args: TArgs) => R; + /** + * Disables the instance of `AsyncLocalStorage`. All subsequent calls + * to `asyncLocalStorage.getStore()` will return `undefined` until`asyncLocalStorage.run()` or `asyncLocalStorage.enterWith()` is called again. + * + * When calling `asyncLocalStorage.disable()`, all current contexts linked to the + * instance will be exited. + * + * Calling `asyncLocalStorage.disable()` is required before the`asyncLocalStorage` can be garbage collected. This does not apply to stores + * provided by the `asyncLocalStorage`, as those objects are garbage collected + * along with the corresponding async resources. + * + * Use this method when the `asyncLocalStorage` is not in use anymore + * in the current process. + * @since v13.10.0, v12.17.0 + * @experimental + */ + disable(): void; + /** + * Returns the current store. + * If called outside of an asynchronous context initialized by + * calling `asyncLocalStorage.run()` or `asyncLocalStorage.enterWith()`, it + * returns `undefined`. + * @since v13.10.0, v12.17.0 + */ + getStore(): T | undefined; + /** + * Runs a function synchronously within a context and returns its + * return value. The store is not accessible outside of the callback function. + * The store is accessible to any asynchronous operations created within the + * callback. + * + * The optional `args` are passed to the callback function. + * + * If the callback function throws an error, the error is thrown by `run()` too. + * The stacktrace is not impacted by this call and the context is exited. + * + * Example: + * + * ```js + * const store = { id: 2 }; + * try { + * asyncLocalStorage.run(store, () => { + * asyncLocalStorage.getStore(); // Returns the store object + * setTimeout(() => { + * asyncLocalStorage.getStore(); // Returns the store object + * }, 200); + * throw new Error(); + * }); + * } catch (e) { + * asyncLocalStorage.getStore(); // Returns undefined + * // The error will be caught here + * } + * ``` + * @since v13.10.0, v12.17.0 + */ + run(store: T, callback: () => R): R; + run(store: T, callback: (...args: TArgs) => R, ...args: TArgs): R; + /** + * Runs a function synchronously outside of a context and returns its + * return value. The store is not accessible within the callback function or + * the asynchronous operations created within the callback. Any `getStore()`call done within the callback function will always return `undefined`. + * + * The optional `args` are passed to the callback function. + * + * If the callback function throws an error, the error is thrown by `exit()` too. + * The stacktrace is not impacted by this call and the context is re-entered. + * + * Example: + * + * ```js + * // Within a call to run + * try { + * asyncLocalStorage.getStore(); // Returns the store object or value + * asyncLocalStorage.exit(() => { + * asyncLocalStorage.getStore(); // Returns undefined + * throw new Error(); + * }); + * } catch (e) { + * asyncLocalStorage.getStore(); // Returns the same object or value + * // The error will be caught here + * } + * ``` + * @since v13.10.0, v12.17.0 + * @experimental + */ + exit(callback: (...args: TArgs) => R, ...args: TArgs): R; + /** + * Transitions into the context for the remainder of the current + * synchronous execution and then persists the store through any following + * asynchronous calls. + * + * Example: + * + * ```js + * const store = { id: 1 }; + * // Replaces previous store with the given store object + * asyncLocalStorage.enterWith(store); + * asyncLocalStorage.getStore(); // Returns the store object + * someAsyncOperation(() => { + * asyncLocalStorage.getStore(); // Returns the same object + * }); + * ``` + * + * This transition will continue for the _entire_ synchronous execution. + * This means that if, for example, the context is entered within an event + * handler subsequent event handlers will also run within that context unless + * specifically bound to another context with an `AsyncResource`. That is why`run()` should be preferred over `enterWith()` unless there are strong reasons + * to use the latter method. + * + * ```js + * const store = { id: 1 }; + * + * emitter.on('my-event', () => { + * asyncLocalStorage.enterWith(store); + * }); + * emitter.on('my-event', () => { + * asyncLocalStorage.getStore(); // Returns the same object + * }); + * + * asyncLocalStorage.getStore(); // Returns undefined + * emitter.emit('my-event'); + * asyncLocalStorage.getStore(); // Returns the same object + * ``` + * @since v13.11.0, v12.17.0 + * @experimental + */ + enterWith(store: T): void; + } +} +declare module 'async_hooks' { + export * from 'node:async_hooks'; +} diff --git a/node_modules/@types/node/ts4.8/buffer.d.ts b/node_modules/@types/node/ts4.8/buffer.d.ts new file mode 100644 index 0000000..7890a15 --- /dev/null +++ b/node_modules/@types/node/ts4.8/buffer.d.ts @@ -0,0 +1,2354 @@ +/** + * `Buffer` objects are used to represent a fixed-length sequence of bytes. Many + * Node.js APIs support `Buffer`s. + * + * The `Buffer` class is a subclass of JavaScript's [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) class and + * extends it with methods that cover additional use cases. Node.js APIs accept + * plain [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) s wherever `Buffer`s are supported as well. + * + * While the `Buffer` class is available within the global scope, it is still + * recommended to explicitly reference it via an import or require statement. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * // Creates a zero-filled Buffer of length 10. + * const buf1 = Buffer.alloc(10); + * + * // Creates a Buffer of length 10, + * // filled with bytes which all have the value `1`. + * const buf2 = Buffer.alloc(10, 1); + * + * // Creates an uninitialized buffer of length 10. + * // This is faster than calling Buffer.alloc() but the returned + * // Buffer instance might contain old data that needs to be + * // overwritten using fill(), write(), or other functions that fill the Buffer's + * // contents. + * const buf3 = Buffer.allocUnsafe(10); + * + * // Creates a Buffer containing the bytes [1, 2, 3]. + * const buf4 = Buffer.from([1, 2, 3]); + * + * // Creates a Buffer containing the bytes [1, 1, 1, 1] – the entries + * // are all truncated using `(value & 255)` to fit into the range 0–255. + * const buf5 = Buffer.from([257, 257.5, -255, '1']); + * + * // Creates a Buffer containing the UTF-8-encoded bytes for the string 'tést': + * // [0x74, 0xc3, 0xa9, 0x73, 0x74] (in hexadecimal notation) + * // [116, 195, 169, 115, 116] (in decimal notation) + * const buf6 = Buffer.from('tést'); + * + * // Creates a Buffer containing the Latin-1 bytes [0x74, 0xe9, 0x73, 0x74]. + * const buf7 = Buffer.from('tést', 'latin1'); + * ``` + * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/buffer.js) + */ +declare module 'node:buffer' { + import { BinaryLike } from 'node:crypto'; + import { ReadableStream as WebReadableStream } from 'node:stream/web'; + /** + * This function returns `true` if `input` contains only valid UTF-8-encoded data, + * including the case in which `input` is empty. + * + * Throws if the `input` is a detached array buffer. + * @since v19.4.0, v18.14.0 + * @param input The input to validate. + */ + export function isUtf8(input: Buffer | ArrayBuffer | NodeJS.TypedArray): boolean; + /** + * This function returns `true` if `input` contains only valid ASCII-encoded data, + * including the case in which `input` is empty. + * + * Throws if the `input` is a detached array buffer. + * @since v19.6.0, v18.15.0 + * @param input The input to validate. + */ + export function isAscii(input: Buffer | ArrayBuffer | NodeJS.TypedArray): boolean; + export const INSPECT_MAX_BYTES: number; + export const kMaxLength: number; + export const kStringMaxLength: number; + export const constants: { + MAX_LENGTH: number; + MAX_STRING_LENGTH: number; + }; + export type TranscodeEncoding = 'ascii' | 'utf8' | 'utf16le' | 'ucs2' | 'latin1' | 'binary'; + /** + * Re-encodes the given `Buffer` or `Uint8Array` instance from one character + * encoding to another. Returns a new `Buffer` instance. + * + * Throws if the `fromEnc` or `toEnc` specify invalid character encodings or if + * conversion from `fromEnc` to `toEnc` is not permitted. + * + * Encodings supported by `buffer.transcode()` are: `'ascii'`, `'utf8'`,`'utf16le'`, `'ucs2'`, `'latin1'`, and `'binary'`. + * + * The transcoding process will use substitution characters if a given byte + * sequence cannot be adequately represented in the target encoding. For instance: + * + * ```js + * import { Buffer, transcode } from 'node:buffer'; + * + * const newBuf = transcode(Buffer.from('€'), 'utf8', 'ascii'); + * console.log(newBuf.toString('ascii')); + * // Prints: '?' + * ``` + * + * Because the Euro (`€`) sign is not representable in US-ASCII, it is replaced + * with `?` in the transcoded `Buffer`. + * @since v7.1.0 + * @param source A `Buffer` or `Uint8Array` instance. + * @param fromEnc The current encoding. + * @param toEnc To target encoding. + */ + export function transcode(source: Uint8Array, fromEnc: TranscodeEncoding, toEnc: TranscodeEncoding): Buffer; + export const SlowBuffer: { + /** @deprecated since v6.0.0, use `Buffer.allocUnsafeSlow()` */ + new (size: number): Buffer; + prototype: Buffer; + }; + /** + * Resolves a `'blob:nodedata:...'` an associated `Blob` object registered using + * a prior call to `URL.createObjectURL()`. + * @since v16.7.0 + * @experimental + * @param id A `'blob:nodedata:...` URL string returned by a prior call to `URL.createObjectURL()`. + */ + export function resolveObjectURL(id: string): Blob | undefined; + export { Buffer }; + /** + * @experimental + */ + export interface BlobOptions { + /** + * @default 'utf8' + */ + encoding?: BufferEncoding | undefined; + /** + * The Blob content-type. The intent is for `type` to convey + * the MIME media type of the data, however no validation of the type format + * is performed. + */ + type?: string | undefined; + } + /** + * A [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob) encapsulates immutable, raw data that can be safely shared across + * multiple worker threads. + * @since v15.7.0, v14.18.0 + */ + export class Blob { + /** + * The total size of the `Blob` in bytes. + * @since v15.7.0, v14.18.0 + */ + readonly size: number; + /** + * The content-type of the `Blob`. + * @since v15.7.0, v14.18.0 + */ + readonly type: string; + /** + * Creates a new `Blob` object containing a concatenation of the given sources. + * + * {ArrayBuffer}, {TypedArray}, {DataView}, and {Buffer} sources are copied into + * the 'Blob' and can therefore be safely modified after the 'Blob' is created. + * + * String sources are also copied into the `Blob`. + */ + constructor(sources: Array, options?: BlobOptions); + /** + * Returns a promise that fulfills with an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) containing a copy of + * the `Blob` data. + * @since v15.7.0, v14.18.0 + */ + arrayBuffer(): Promise; + /** + * Creates and returns a new `Blob` containing a subset of this `Blob` objects + * data. The original `Blob` is not altered. + * @since v15.7.0, v14.18.0 + * @param start The starting index. + * @param end The ending index. + * @param type The content-type for the new `Blob` + */ + slice(start?: number, end?: number, type?: string): Blob; + /** + * Returns a promise that fulfills with the contents of the `Blob` decoded as a + * UTF-8 string. + * @since v15.7.0, v14.18.0 + */ + text(): Promise; + /** + * Returns a new `ReadableStream` that allows the content of the `Blob` to be read. + * @since v16.7.0 + */ + stream(): WebReadableStream; + } + export interface FileOptions { + /** + * One of either `'transparent'` or `'native'`. When set to `'native'`, line endings in string source parts will be + * converted to the platform native line-ending as specified by `require('node:os').EOL`. + */ + endings?: 'native' | 'transparent'; + /** The File content-type. */ + type?: string; + /** The last modified date of the file. `Default`: Date.now(). */ + lastModified?: number; + } + /** + * A [`File`](https://developer.mozilla.org/en-US/docs/Web/API/File) provides information about files. + * @since v19.2.0, v18.13.0 + */ + export class File extends Blob { + constructor(sources: Array, fileName: string, options?: FileOptions); + /** + * The name of the `File`. + * @since v19.2.0, v18.13.0 + */ + readonly name: string; + /** + * The last modified date of the `File`. + * @since v19.2.0, v18.13.0 + */ + readonly lastModified: number; + } + export import atob = globalThis.atob; + export import btoa = globalThis.btoa; + import { Blob as NodeBlob } from 'buffer'; + // This conditional type will be the existing global Blob in a browser, or + // the copy below in a Node environment. + type __Blob = typeof globalThis extends { onmessage: any; Blob: infer T } ? T : NodeBlob; + global { + namespace NodeJS { + export { BufferEncoding }; + } + // Buffer class + type BufferEncoding = + | 'ascii' + | 'utf8' + | 'utf-8' + | 'utf16le' + | 'ucs2' + | 'ucs-2' + | 'base64' + | 'base64url' + | 'latin1' + | 'binary' + | 'hex'; + type WithImplicitCoercion = + | T + | { + valueOf(): T; + }; + /** + * Raw data is stored in instances of the Buffer class. + * A Buffer is similar to an array of integers but corresponds to a raw memory allocation outside the V8 heap. A Buffer cannot be resized. + * Valid string encodings: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'base64url'|'binary'(deprecated)|'hex' + */ + interface BufferConstructor { + /** + * Allocates a new buffer containing the given {str}. + * + * @param str String to store in buffer. + * @param encoding encoding to use, optional. Default is 'utf8' + * @deprecated since v10.0.0 - Use `Buffer.from(string[, encoding])` instead. + */ + new (str: string, encoding?: BufferEncoding): Buffer; + /** + * Allocates a new buffer of {size} octets. + * + * @param size count of octets to allocate. + * @deprecated since v10.0.0 - Use `Buffer.alloc()` instead (also see `Buffer.allocUnsafe()`). + */ + new (size: number): Buffer; + /** + * Allocates a new buffer containing the given {array} of octets. + * + * @param array The octets to store. + * @deprecated since v10.0.0 - Use `Buffer.from(array)` instead. + */ + new (array: Uint8Array): Buffer; + /** + * Produces a Buffer backed by the same allocated memory as + * the given {ArrayBuffer}/{SharedArrayBuffer}. + * + * + * @param arrayBuffer The ArrayBuffer with which to share memory. + * @deprecated since v10.0.0 - Use `Buffer.from(arrayBuffer[, byteOffset[, length]])` instead. + */ + new (arrayBuffer: ArrayBuffer | SharedArrayBuffer): Buffer; + /** + * Allocates a new buffer containing the given {array} of octets. + * + * @param array The octets to store. + * @deprecated since v10.0.0 - Use `Buffer.from(array)` instead. + */ + new (array: ReadonlyArray): Buffer; + /** + * Copies the passed {buffer} data onto a new {Buffer} instance. + * + * @param buffer The buffer to copy. + * @deprecated since v10.0.0 - Use `Buffer.from(buffer)` instead. + */ + new (buffer: Buffer): Buffer; + /** + * Allocates a new `Buffer` using an `array` of bytes in the range `0` – `255`. + * Array entries outside that range will be truncated to fit into it. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * // Creates a new Buffer containing the UTF-8 bytes of the string 'buffer'. + * const buf = Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]); + * ``` + * + * If `array` is an `Array`\-like object (that is, one with a `length` property of + * type `number`), it is treated as if it is an array, unless it is a `Buffer` or + * a `Uint8Array`. This means all other `TypedArray` variants get treated as an`Array`. To create a `Buffer` from the bytes backing a `TypedArray`, use `Buffer.copyBytesFrom()`. + * + * A `TypeError` will be thrown if `array` is not an `Array` or another type + * appropriate for `Buffer.from()` variants. + * + * `Buffer.from(array)` and `Buffer.from(string)` may also use the internal`Buffer` pool like `Buffer.allocUnsafe()` does. + * @since v5.10.0 + */ + from( + arrayBuffer: WithImplicitCoercion, + byteOffset?: number, + length?: number, + ): Buffer; + /** + * Creates a new Buffer using the passed {data} + * @param data data to create a new Buffer + */ + from(data: Uint8Array | ReadonlyArray): Buffer; + from(data: WithImplicitCoercion | string>): Buffer; + /** + * Creates a new Buffer containing the given JavaScript string {str}. + * If provided, the {encoding} parameter identifies the character encoding. + * If not provided, {encoding} defaults to 'utf8'. + */ + from( + str: + | WithImplicitCoercion + | { + [Symbol.toPrimitive](hint: 'string'): string; + }, + encoding?: BufferEncoding, + ): Buffer; + /** + * Creates a new Buffer using the passed {data} + * @param values to create a new Buffer + */ + of(...items: number[]): Buffer; + /** + * Returns `true` if `obj` is a `Buffer`, `false` otherwise. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * Buffer.isBuffer(Buffer.alloc(10)); // true + * Buffer.isBuffer(Buffer.from('foo')); // true + * Buffer.isBuffer('a string'); // false + * Buffer.isBuffer([]); // false + * Buffer.isBuffer(new Uint8Array(1024)); // false + * ``` + * @since v0.1.101 + */ + isBuffer(obj: any): obj is Buffer; + /** + * Returns `true` if `encoding` is the name of a supported character encoding, + * or `false` otherwise. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * console.log(Buffer.isEncoding('utf8')); + * // Prints: true + * + * console.log(Buffer.isEncoding('hex')); + * // Prints: true + * + * console.log(Buffer.isEncoding('utf/8')); + * // Prints: false + * + * console.log(Buffer.isEncoding('')); + * // Prints: false + * ``` + * @since v0.9.1 + * @param encoding A character encoding name to check. + */ + isEncoding(encoding: string): encoding is BufferEncoding; + /** + * Returns the byte length of a string when encoded using `encoding`. + * This is not the same as [`String.prototype.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length), which does not account + * for the encoding that is used to convert the string into bytes. + * + * For `'base64'`, `'base64url'`, and `'hex'`, this function assumes valid input. + * For strings that contain non-base64/hex-encoded data (e.g. whitespace), the + * return value might be greater than the length of a `Buffer` created from the + * string. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const str = '\u00bd + \u00bc = \u00be'; + * + * console.log(`${str}: ${str.length} characters, ` + + * `${Buffer.byteLength(str, 'utf8')} bytes`); + * // Prints: ½ + ¼ = ¾: 9 characters, 12 bytes + * ``` + * + * When `string` is a + * `Buffer`/[`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView)/[`TypedArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/- + * Reference/Global_Objects/TypedArray)/[`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer)/[`SharedArrayBuffer`](https://develop- + * er.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer), the byte length as reported by `.byteLength`is returned. + * @since v0.1.90 + * @param string A value to calculate the length of. + * @param [encoding='utf8'] If `string` is a string, this is its encoding. + * @return The number of bytes contained within `string`. + */ + byteLength( + string: string | NodeJS.ArrayBufferView | ArrayBuffer | SharedArrayBuffer, + encoding?: BufferEncoding, + ): number; + /** + * Returns a new `Buffer` which is the result of concatenating all the `Buffer`instances in the `list` together. + * + * If the list has no items, or if the `totalLength` is 0, then a new zero-length`Buffer` is returned. + * + * If `totalLength` is not provided, it is calculated from the `Buffer` instances + * in `list` by adding their lengths. + * + * If `totalLength` is provided, it is coerced to an unsigned integer. If the + * combined length of the `Buffer`s in `list` exceeds `totalLength`, the result is + * truncated to `totalLength`. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * // Create a single `Buffer` from a list of three `Buffer` instances. + * + * const buf1 = Buffer.alloc(10); + * const buf2 = Buffer.alloc(14); + * const buf3 = Buffer.alloc(18); + * const totalLength = buf1.length + buf2.length + buf3.length; + * + * console.log(totalLength); + * // Prints: 42 + * + * const bufA = Buffer.concat([buf1, buf2, buf3], totalLength); + * + * console.log(bufA); + * // Prints: + * console.log(bufA.length); + * // Prints: 42 + * ``` + * + * `Buffer.concat()` may also use the internal `Buffer` pool like `Buffer.allocUnsafe()` does. + * @since v0.7.11 + * @param list List of `Buffer` or {@link Uint8Array} instances to concatenate. + * @param totalLength Total length of the `Buffer` instances in `list` when concatenated. + */ + concat(list: ReadonlyArray, totalLength?: number): Buffer; + /** + * Copies the underlying memory of `view` into a new `Buffer`. + * + * ```js + * const u16 = new Uint16Array([0, 0xffff]); + * const buf = Buffer.copyBytesFrom(u16, 1, 1); + * u16[1] = 0; + * console.log(buf.length); // 2 + * console.log(buf[0]); // 255 + * console.log(buf[1]); // 255 + * ``` + * @since v19.8.0 + * @param view The {TypedArray} to copy. + * @param [offset=': 0'] The starting offset within `view`. + * @param [length=view.length - offset] The number of elements from `view` to copy. + */ + copyBytesFrom(view: NodeJS.TypedArray, offset?: number, length?: number): Buffer; + /** + * Compares `buf1` to `buf2`, typically for the purpose of sorting arrays of`Buffer` instances. This is equivalent to calling `buf1.compare(buf2)`. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf1 = Buffer.from('1234'); + * const buf2 = Buffer.from('0123'); + * const arr = [buf1, buf2]; + * + * console.log(arr.sort(Buffer.compare)); + * // Prints: [ , ] + * // (This result is equal to: [buf2, buf1].) + * ``` + * @since v0.11.13 + * @return Either `-1`, `0`, or `1`, depending on the result of the comparison. See `compare` for details. + */ + compare(buf1: Uint8Array, buf2: Uint8Array): -1 | 0 | 1; + /** + * Allocates a new `Buffer` of `size` bytes. If `fill` is `undefined`, the`Buffer` will be zero-filled. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.alloc(5); + * + * console.log(buf); + * // Prints: + * ``` + * + * If `size` is larger than {@link constants.MAX_LENGTH} or smaller than 0, `ERR_OUT_OF_RANGE` is thrown. + * + * If `fill` is specified, the allocated `Buffer` will be initialized by calling `buf.fill(fill)`. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.alloc(5, 'a'); + * + * console.log(buf); + * // Prints: + * ``` + * + * If both `fill` and `encoding` are specified, the allocated `Buffer` will be + * initialized by calling `buf.fill(fill, encoding)`. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.alloc(11, 'aGVsbG8gd29ybGQ=', 'base64'); + * + * console.log(buf); + * // Prints: + * ``` + * + * Calling `Buffer.alloc()` can be measurably slower than the alternative `Buffer.allocUnsafe()` but ensures that the newly created `Buffer` instance + * contents will never contain sensitive data from previous allocations, including + * data that might not have been allocated for `Buffer`s. + * + * A `TypeError` will be thrown if `size` is not a number. + * @since v5.10.0 + * @param size The desired length of the new `Buffer`. + * @param [fill=0] A value to pre-fill the new `Buffer` with. + * @param [encoding='utf8'] If `fill` is a string, this is its encoding. + */ + alloc(size: number, fill?: string | Buffer | number, encoding?: BufferEncoding): Buffer; + /** + * Allocates a new `Buffer` of `size` bytes. If `size` is larger than {@link constants.MAX_LENGTH} or smaller than 0, `ERR_OUT_OF_RANGE` is thrown. + * + * The underlying memory for `Buffer` instances created in this way is _not_ + * _initialized_. The contents of the newly created `Buffer` are unknown and _may contain sensitive data_. Use `Buffer.alloc()` instead to initialize`Buffer` instances with zeroes. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.allocUnsafe(10); + * + * console.log(buf); + * // Prints (contents may vary): + * + * buf.fill(0); + * + * console.log(buf); + * // Prints: + * ``` + * + * A `TypeError` will be thrown if `size` is not a number. + * + * The `Buffer` module pre-allocates an internal `Buffer` instance of + * size `Buffer.poolSize` that is used as a pool for the fast allocation of new`Buffer` instances created using `Buffer.allocUnsafe()`, `Buffer.from(array)`, + * and `Buffer.concat()` only when `size` is less than or equal to`Buffer.poolSize >> 1` (floor of `Buffer.poolSize` divided by two). + * + * Use of this pre-allocated internal memory pool is a key difference between + * calling `Buffer.alloc(size, fill)` vs. `Buffer.allocUnsafe(size).fill(fill)`. + * Specifically, `Buffer.alloc(size, fill)` will _never_ use the internal `Buffer`pool, while `Buffer.allocUnsafe(size).fill(fill)`_will_ use the internal`Buffer` pool if `size` is less + * than or equal to half `Buffer.poolSize`. The + * difference is subtle but can be important when an application requires the + * additional performance that `Buffer.allocUnsafe()` provides. + * @since v5.10.0 + * @param size The desired length of the new `Buffer`. + */ + allocUnsafe(size: number): Buffer; + /** + * Allocates a new `Buffer` of `size` bytes. If `size` is larger than {@link constants.MAX_LENGTH} or smaller than 0, `ERR_OUT_OF_RANGE` is thrown. A zero-length `Buffer` is created if + * `size` is 0. + * + * The underlying memory for `Buffer` instances created in this way is _not_ + * _initialized_. The contents of the newly created `Buffer` are unknown and _may contain sensitive data_. Use `buf.fill(0)` to initialize + * such `Buffer` instances with zeroes. + * + * When using `Buffer.allocUnsafe()` to allocate new `Buffer` instances, + * allocations under 4 KiB are sliced from a single pre-allocated `Buffer`. This + * allows applications to avoid the garbage collection overhead of creating many + * individually allocated `Buffer` instances. This approach improves both + * performance and memory usage by eliminating the need to track and clean up as + * many individual `ArrayBuffer` objects. + * + * However, in the case where a developer may need to retain a small chunk of + * memory from a pool for an indeterminate amount of time, it may be appropriate + * to create an un-pooled `Buffer` instance using `Buffer.allocUnsafeSlow()` and + * then copying out the relevant bits. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * // Need to keep around a few small chunks of memory. + * const store = []; + * + * socket.on('readable', () => { + * let data; + * while (null !== (data = readable.read())) { + * // Allocate for retained data. + * const sb = Buffer.allocUnsafeSlow(10); + * + * // Copy the data into the new allocation. + * data.copy(sb, 0, 0, 10); + * + * store.push(sb); + * } + * }); + * ``` + * + * A `TypeError` will be thrown if `size` is not a number. + * @since v5.12.0 + * @param size The desired length of the new `Buffer`. + */ + allocUnsafeSlow(size: number): Buffer; + /** + * This is the size (in bytes) of pre-allocated internal `Buffer` instances used + * for pooling. This value may be modified. + * @since v0.11.3 + */ + poolSize: number; + } + interface Buffer extends Uint8Array { + /** + * Writes `string` to `buf` at `offset` according to the character encoding in`encoding`. The `length` parameter is the number of bytes to write. If `buf` did + * not contain enough space to fit the entire string, only part of `string` will be + * written. However, partially encoded characters will not be written. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.alloc(256); + * + * const len = buf.write('\u00bd + \u00bc = \u00be', 0); + * + * console.log(`${len} bytes: ${buf.toString('utf8', 0, len)}`); + * // Prints: 12 bytes: ½ + ¼ = ¾ + * + * const buffer = Buffer.alloc(10); + * + * const length = buffer.write('abcd', 8); + * + * console.log(`${length} bytes: ${buffer.toString('utf8', 8, 10)}`); + * // Prints: 2 bytes : ab + * ``` + * @since v0.1.90 + * @param string String to write to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write `string`. + * @param [length=buf.length - offset] Maximum number of bytes to write (written bytes will not exceed `buf.length - offset`). + * @param [encoding='utf8'] The character encoding of `string`. + * @return Number of bytes written. + */ + write(string: string, encoding?: BufferEncoding): number; + write(string: string, offset: number, encoding?: BufferEncoding): number; + write(string: string, offset: number, length: number, encoding?: BufferEncoding): number; + /** + * Decodes `buf` to a string according to the specified character encoding in`encoding`. `start` and `end` may be passed to decode only a subset of `buf`. + * + * If `encoding` is `'utf8'` and a byte sequence in the input is not valid UTF-8, + * then each invalid byte is replaced with the replacement character `U+FFFD`. + * + * The maximum length of a string instance (in UTF-16 code units) is available + * as {@link constants.MAX_STRING_LENGTH}. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf1 = Buffer.allocUnsafe(26); + * + * for (let i = 0; i < 26; i++) { + * // 97 is the decimal ASCII value for 'a'. + * buf1[i] = i + 97; + * } + * + * console.log(buf1.toString('utf8')); + * // Prints: abcdefghijklmnopqrstuvwxyz + * console.log(buf1.toString('utf8', 0, 5)); + * // Prints: abcde + * + * const buf2 = Buffer.from('tést'); + * + * console.log(buf2.toString('hex')); + * // Prints: 74c3a97374 + * console.log(buf2.toString('utf8', 0, 3)); + * // Prints: té + * console.log(buf2.toString(undefined, 0, 3)); + * // Prints: té + * ``` + * @since v0.1.90 + * @param [encoding='utf8'] The character encoding to use. + * @param [start=0] The byte offset to start decoding at. + * @param [end=buf.length] The byte offset to stop decoding at (not inclusive). + */ + toString(encoding?: BufferEncoding, start?: number, end?: number): string; + /** + * Returns a JSON representation of `buf`. [`JSON.stringify()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify) implicitly calls + * this function when stringifying a `Buffer` instance. + * + * `Buffer.from()` accepts objects in the format returned from this method. + * In particular, `Buffer.from(buf.toJSON())` works like `Buffer.from(buf)`. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5]); + * const json = JSON.stringify(buf); + * + * console.log(json); + * // Prints: {"type":"Buffer","data":[1,2,3,4,5]} + * + * const copy = JSON.parse(json, (key, value) => { + * return value && value.type === 'Buffer' ? + * Buffer.from(value) : + * value; + * }); + * + * console.log(copy); + * // Prints: + * ``` + * @since v0.9.2 + */ + toJSON(): { + type: 'Buffer'; + data: number[]; + }; + /** + * Returns `true` if both `buf` and `otherBuffer` have exactly the same bytes,`false` otherwise. Equivalent to `buf.compare(otherBuffer) === 0`. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf1 = Buffer.from('ABC'); + * const buf2 = Buffer.from('414243', 'hex'); + * const buf3 = Buffer.from('ABCD'); + * + * console.log(buf1.equals(buf2)); + * // Prints: true + * console.log(buf1.equals(buf3)); + * // Prints: false + * ``` + * @since v0.11.13 + * @param otherBuffer A `Buffer` or {@link Uint8Array} with which to compare `buf`. + */ + equals(otherBuffer: Uint8Array): boolean; + /** + * Compares `buf` with `target` and returns a number indicating whether `buf`comes before, after, or is the same as `target` in sort order. + * Comparison is based on the actual sequence of bytes in each `Buffer`. + * + * * `0` is returned if `target` is the same as `buf` + * * `1` is returned if `target` should come _before_`buf` when sorted. + * * `-1` is returned if `target` should come _after_`buf` when sorted. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf1 = Buffer.from('ABC'); + * const buf2 = Buffer.from('BCD'); + * const buf3 = Buffer.from('ABCD'); + * + * console.log(buf1.compare(buf1)); + * // Prints: 0 + * console.log(buf1.compare(buf2)); + * // Prints: -1 + * console.log(buf1.compare(buf3)); + * // Prints: -1 + * console.log(buf2.compare(buf1)); + * // Prints: 1 + * console.log(buf2.compare(buf3)); + * // Prints: 1 + * console.log([buf1, buf2, buf3].sort(Buffer.compare)); + * // Prints: [ , , ] + * // (This result is equal to: [buf1, buf3, buf2].) + * ``` + * + * The optional `targetStart`, `targetEnd`, `sourceStart`, and `sourceEnd`arguments can be used to limit the comparison to specific ranges within `target`and `buf` respectively. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf1 = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8, 9]); + * const buf2 = Buffer.from([5, 6, 7, 8, 9, 1, 2, 3, 4]); + * + * console.log(buf1.compare(buf2, 5, 9, 0, 4)); + * // Prints: 0 + * console.log(buf1.compare(buf2, 0, 6, 4)); + * // Prints: -1 + * console.log(buf1.compare(buf2, 5, 6, 5)); + * // Prints: 1 + * ``` + * + * `ERR_OUT_OF_RANGE` is thrown if `targetStart < 0`, `sourceStart < 0`,`targetEnd > target.byteLength`, or `sourceEnd > source.byteLength`. + * @since v0.11.13 + * @param target A `Buffer` or {@link Uint8Array} with which to compare `buf`. + * @param [targetStart=0] The offset within `target` at which to begin comparison. + * @param [targetEnd=target.length] The offset within `target` at which to end comparison (not inclusive). + * @param [sourceStart=0] The offset within `buf` at which to begin comparison. + * @param [sourceEnd=buf.length] The offset within `buf` at which to end comparison (not inclusive). + */ + compare( + target: Uint8Array, + targetStart?: number, + targetEnd?: number, + sourceStart?: number, + sourceEnd?: number, + ): -1 | 0 | 1; + /** + * Copies data from a region of `buf` to a region in `target`, even if the `target`memory region overlaps with `buf`. + * + * [`TypedArray.prototype.set()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) performs the same operation, and is available + * for all TypedArrays, including Node.js `Buffer`s, although it takes + * different function arguments. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * // Create two `Buffer` instances. + * const buf1 = Buffer.allocUnsafe(26); + * const buf2 = Buffer.allocUnsafe(26).fill('!'); + * + * for (let i = 0; i < 26; i++) { + * // 97 is the decimal ASCII value for 'a'. + * buf1[i] = i + 97; + * } + * + * // Copy `buf1` bytes 16 through 19 into `buf2` starting at byte 8 of `buf2`. + * buf1.copy(buf2, 8, 16, 20); + * // This is equivalent to: + * // buf2.set(buf1.subarray(16, 20), 8); + * + * console.log(buf2.toString('ascii', 0, 25)); + * // Prints: !!!!!!!!qrst!!!!!!!!!!!!! + * ``` + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * // Create a `Buffer` and copy data from one region to an overlapping region + * // within the same `Buffer`. + * + * const buf = Buffer.allocUnsafe(26); + * + * for (let i = 0; i < 26; i++) { + * // 97 is the decimal ASCII value for 'a'. + * buf[i] = i + 97; + * } + * + * buf.copy(buf, 0, 4, 10); + * + * console.log(buf.toString()); + * // Prints: efghijghijklmnopqrstuvwxyz + * ``` + * @since v0.1.90 + * @param target A `Buffer` or {@link Uint8Array} to copy into. + * @param [targetStart=0] The offset within `target` at which to begin writing. + * @param [sourceStart=0] The offset within `buf` from which to begin copying. + * @param [sourceEnd=buf.length] The offset within `buf` at which to stop copying (not inclusive). + * @return The number of bytes copied. + */ + copy(target: Uint8Array, targetStart?: number, sourceStart?: number, sourceEnd?: number): number; + /** + * Returns a new `Buffer` that references the same memory as the original, but + * offset and cropped by the `start` and `end` indices. + * + * This method is not compatible with the `Uint8Array.prototype.slice()`, + * which is a superclass of `Buffer`. To copy the slice, use`Uint8Array.prototype.slice()`. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.from('buffer'); + * + * const copiedBuf = Uint8Array.prototype.slice.call(buf); + * copiedBuf[0]++; + * console.log(copiedBuf.toString()); + * // Prints: cuffer + * + * console.log(buf.toString()); + * // Prints: buffer + * + * // With buf.slice(), the original buffer is modified. + * const notReallyCopiedBuf = buf.slice(); + * notReallyCopiedBuf[0]++; + * console.log(notReallyCopiedBuf.toString()); + * // Prints: cuffer + * console.log(buf.toString()); + * // Also prints: cuffer (!) + * ``` + * @since v0.3.0 + * @deprecated Use `subarray` instead. + * @param [start=0] Where the new `Buffer` will start. + * @param [end=buf.length] Where the new `Buffer` will end (not inclusive). + */ + slice(start?: number, end?: number): Buffer; + /** + * Returns a new `Buffer` that references the same memory as the original, but + * offset and cropped by the `start` and `end` indices. + * + * Specifying `end` greater than `buf.length` will return the same result as + * that of `end` equal to `buf.length`. + * + * This method is inherited from [`TypedArray.prototype.subarray()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray). + * + * Modifying the new `Buffer` slice will modify the memory in the original `Buffer`because the allocated memory of the two objects overlap. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * // Create a `Buffer` with the ASCII alphabet, take a slice, and modify one byte + * // from the original `Buffer`. + * + * const buf1 = Buffer.allocUnsafe(26); + * + * for (let i = 0; i < 26; i++) { + * // 97 is the decimal ASCII value for 'a'. + * buf1[i] = i + 97; + * } + * + * const buf2 = buf1.subarray(0, 3); + * + * console.log(buf2.toString('ascii', 0, buf2.length)); + * // Prints: abc + * + * buf1[0] = 33; + * + * console.log(buf2.toString('ascii', 0, buf2.length)); + * // Prints: !bc + * ``` + * + * Specifying negative indexes causes the slice to be generated relative to the + * end of `buf` rather than the beginning. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.from('buffer'); + * + * console.log(buf.subarray(-6, -1).toString()); + * // Prints: buffe + * // (Equivalent to buf.subarray(0, 5).) + * + * console.log(buf.subarray(-6, -2).toString()); + * // Prints: buff + * // (Equivalent to buf.subarray(0, 4).) + * + * console.log(buf.subarray(-5, -2).toString()); + * // Prints: uff + * // (Equivalent to buf.subarray(1, 4).) + * ``` + * @since v3.0.0 + * @param [start=0] Where the new `Buffer` will start. + * @param [end=buf.length] Where the new `Buffer` will end (not inclusive). + */ + subarray(start?: number, end?: number): Buffer; + /** + * Writes `value` to `buf` at the specified `offset` as big-endian. + * + * `value` is interpreted and written as a two's complement signed integer. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.allocUnsafe(8); + * + * buf.writeBigInt64BE(0x0102030405060708n, 0); + * + * console.log(buf); + * // Prints: + * ``` + * @since v12.0.0, v10.20.0 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`. + * @return `offset` plus the number of bytes written. + */ + writeBigInt64BE(value: bigint, offset?: number): number; + /** + * Writes `value` to `buf` at the specified `offset` as little-endian. + * + * `value` is interpreted and written as a two's complement signed integer. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.allocUnsafe(8); + * + * buf.writeBigInt64LE(0x0102030405060708n, 0); + * + * console.log(buf); + * // Prints: + * ``` + * @since v12.0.0, v10.20.0 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`. + * @return `offset` plus the number of bytes written. + */ + writeBigInt64LE(value: bigint, offset?: number): number; + /** + * Writes `value` to `buf` at the specified `offset` as big-endian. + * + * This function is also available under the `writeBigUint64BE` alias. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.allocUnsafe(8); + * + * buf.writeBigUInt64BE(0xdecafafecacefaden, 0); + * + * console.log(buf); + * // Prints: + * ``` + * @since v12.0.0, v10.20.0 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`. + * @return `offset` plus the number of bytes written. + */ + writeBigUInt64BE(value: bigint, offset?: number): number; + /** + * @alias Buffer.writeBigUInt64BE + * @since v14.10.0, v12.19.0 + */ + writeBigUint64BE(value: bigint, offset?: number): number; + /** + * Writes `value` to `buf` at the specified `offset` as little-endian + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.allocUnsafe(8); + * + * buf.writeBigUInt64LE(0xdecafafecacefaden, 0); + * + * console.log(buf); + * // Prints: + * ``` + * + * This function is also available under the `writeBigUint64LE` alias. + * @since v12.0.0, v10.20.0 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`. + * @return `offset` plus the number of bytes written. + */ + writeBigUInt64LE(value: bigint, offset?: number): number; + /** + * @alias Buffer.writeBigUInt64LE + * @since v14.10.0, v12.19.0 + */ + writeBigUint64LE(value: bigint, offset?: number): number; + /** + * Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as little-endian. Supports up to 48 bits of accuracy. Behavior is undefined + * when `value` is anything other than an unsigned integer. + * + * This function is also available under the `writeUintLE` alias. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.allocUnsafe(6); + * + * buf.writeUIntLE(0x1234567890ab, 0, 6); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.5.5 + * @param value Number to be written to `buf`. + * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`. + * @param byteLength Number of bytes to write. Must satisfy `0 < byteLength <= 6`. + * @return `offset` plus the number of bytes written. + */ + writeUIntLE(value: number, offset: number, byteLength: number): number; + /** + * @alias Buffer.writeUIntLE + * @since v14.9.0, v12.19.0 + */ + writeUintLE(value: number, offset: number, byteLength: number): number; + /** + * Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as big-endian. Supports up to 48 bits of accuracy. Behavior is undefined + * when `value` is anything other than an unsigned integer. + * + * This function is also available under the `writeUintBE` alias. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.allocUnsafe(6); + * + * buf.writeUIntBE(0x1234567890ab, 0, 6); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.5.5 + * @param value Number to be written to `buf`. + * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`. + * @param byteLength Number of bytes to write. Must satisfy `0 < byteLength <= 6`. + * @return `offset` plus the number of bytes written. + */ + writeUIntBE(value: number, offset: number, byteLength: number): number; + /** + * @alias Buffer.writeUIntBE + * @since v14.9.0, v12.19.0 + */ + writeUintBE(value: number, offset: number, byteLength: number): number; + /** + * Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as little-endian. Supports up to 48 bits of accuracy. Behavior is undefined + * when `value` is anything other than a signed integer. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.allocUnsafe(6); + * + * buf.writeIntLE(0x1234567890ab, 0, 6); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.11.15 + * @param value Number to be written to `buf`. + * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`. + * @param byteLength Number of bytes to write. Must satisfy `0 < byteLength <= 6`. + * @return `offset` plus the number of bytes written. + */ + writeIntLE(value: number, offset: number, byteLength: number): number; + /** + * Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as big-endian. Supports up to 48 bits of accuracy. Behavior is undefined when`value` is anything other than a + * signed integer. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.allocUnsafe(6); + * + * buf.writeIntBE(0x1234567890ab, 0, 6); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.11.15 + * @param value Number to be written to `buf`. + * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`. + * @param byteLength Number of bytes to write. Must satisfy `0 < byteLength <= 6`. + * @return `offset` plus the number of bytes written. + */ + writeIntBE(value: number, offset: number, byteLength: number): number; + /** + * Reads an unsigned, big-endian 64-bit integer from `buf` at the specified`offset`. + * + * This function is also available under the `readBigUint64BE` alias. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.from([0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff]); + * + * console.log(buf.readBigUInt64BE(0)); + * // Prints: 4294967295n + * ``` + * @since v12.0.0, v10.20.0 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`. + */ + readBigUInt64BE(offset?: number): bigint; + /** + * @alias Buffer.readBigUInt64BE + * @since v14.10.0, v12.19.0 + */ + readBigUint64BE(offset?: number): bigint; + /** + * Reads an unsigned, little-endian 64-bit integer from `buf` at the specified`offset`. + * + * This function is also available under the `readBigUint64LE` alias. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.from([0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff]); + * + * console.log(buf.readBigUInt64LE(0)); + * // Prints: 18446744069414584320n + * ``` + * @since v12.0.0, v10.20.0 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`. + */ + readBigUInt64LE(offset?: number): bigint; + /** + * @alias Buffer.readBigUInt64LE + * @since v14.10.0, v12.19.0 + */ + readBigUint64LE(offset?: number): bigint; + /** + * Reads a signed, big-endian 64-bit integer from `buf` at the specified `offset`. + * + * Integers read from a `Buffer` are interpreted as two's complement signed + * values. + * @since v12.0.0, v10.20.0 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`. + */ + readBigInt64BE(offset?: number): bigint; + /** + * Reads a signed, little-endian 64-bit integer from `buf` at the specified`offset`. + * + * Integers read from a `Buffer` are interpreted as two's complement signed + * values. + * @since v12.0.0, v10.20.0 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`. + */ + readBigInt64LE(offset?: number): bigint; + /** + * Reads `byteLength` number of bytes from `buf` at the specified `offset`and interprets the result as an unsigned, little-endian integer supporting + * up to 48 bits of accuracy. + * + * This function is also available under the `readUintLE` alias. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]); + * + * console.log(buf.readUIntLE(0, 6).toString(16)); + * // Prints: ab9078563412 + * ``` + * @since v0.11.15 + * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`. + * @param byteLength Number of bytes to read. Must satisfy `0 < byteLength <= 6`. + */ + readUIntLE(offset: number, byteLength: number): number; + /** + * @alias Buffer.readUIntLE + * @since v14.9.0, v12.19.0 + */ + readUintLE(offset: number, byteLength: number): number; + /** + * Reads `byteLength` number of bytes from `buf` at the specified `offset`and interprets the result as an unsigned big-endian integer supporting + * up to 48 bits of accuracy. + * + * This function is also available under the `readUintBE` alias. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]); + * + * console.log(buf.readUIntBE(0, 6).toString(16)); + * // Prints: 1234567890ab + * console.log(buf.readUIntBE(1, 6).toString(16)); + * // Throws ERR_OUT_OF_RANGE. + * ``` + * @since v0.11.15 + * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`. + * @param byteLength Number of bytes to read. Must satisfy `0 < byteLength <= 6`. + */ + readUIntBE(offset: number, byteLength: number): number; + /** + * @alias Buffer.readUIntBE + * @since v14.9.0, v12.19.0 + */ + readUintBE(offset: number, byteLength: number): number; + /** + * Reads `byteLength` number of bytes from `buf` at the specified `offset`and interprets the result as a little-endian, two's complement signed value + * supporting up to 48 bits of accuracy. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]); + * + * console.log(buf.readIntLE(0, 6).toString(16)); + * // Prints: -546f87a9cbee + * ``` + * @since v0.11.15 + * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`. + * @param byteLength Number of bytes to read. Must satisfy `0 < byteLength <= 6`. + */ + readIntLE(offset: number, byteLength: number): number; + /** + * Reads `byteLength` number of bytes from `buf` at the specified `offset`and interprets the result as a big-endian, two's complement signed value + * supporting up to 48 bits of accuracy. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]); + * + * console.log(buf.readIntBE(0, 6).toString(16)); + * // Prints: 1234567890ab + * console.log(buf.readIntBE(1, 6).toString(16)); + * // Throws ERR_OUT_OF_RANGE. + * console.log(buf.readIntBE(1, 0).toString(16)); + * // Throws ERR_OUT_OF_RANGE. + * ``` + * @since v0.11.15 + * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`. + * @param byteLength Number of bytes to read. Must satisfy `0 < byteLength <= 6`. + */ + readIntBE(offset: number, byteLength: number): number; + /** + * Reads an unsigned 8-bit integer from `buf` at the specified `offset`. + * + * This function is also available under the `readUint8` alias. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.from([1, -2]); + * + * console.log(buf.readUInt8(0)); + * // Prints: 1 + * console.log(buf.readUInt8(1)); + * // Prints: 254 + * console.log(buf.readUInt8(2)); + * // Throws ERR_OUT_OF_RANGE. + * ``` + * @since v0.5.0 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 1`. + */ + readUInt8(offset?: number): number; + /** + * @alias Buffer.readUInt8 + * @since v14.9.0, v12.19.0 + */ + readUint8(offset?: number): number; + /** + * Reads an unsigned, little-endian 16-bit integer from `buf` at the specified`offset`. + * + * This function is also available under the `readUint16LE` alias. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.from([0x12, 0x34, 0x56]); + * + * console.log(buf.readUInt16LE(0).toString(16)); + * // Prints: 3412 + * console.log(buf.readUInt16LE(1).toString(16)); + * // Prints: 5634 + * console.log(buf.readUInt16LE(2).toString(16)); + * // Throws ERR_OUT_OF_RANGE. + * ``` + * @since v0.5.5 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`. + */ + readUInt16LE(offset?: number): number; + /** + * @alias Buffer.readUInt16LE + * @since v14.9.0, v12.19.0 + */ + readUint16LE(offset?: number): number; + /** + * Reads an unsigned, big-endian 16-bit integer from `buf` at the specified`offset`. + * + * This function is also available under the `readUint16BE` alias. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.from([0x12, 0x34, 0x56]); + * + * console.log(buf.readUInt16BE(0).toString(16)); + * // Prints: 1234 + * console.log(buf.readUInt16BE(1).toString(16)); + * // Prints: 3456 + * ``` + * @since v0.5.5 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`. + */ + readUInt16BE(offset?: number): number; + /** + * @alias Buffer.readUInt16BE + * @since v14.9.0, v12.19.0 + */ + readUint16BE(offset?: number): number; + /** + * Reads an unsigned, little-endian 32-bit integer from `buf` at the specified`offset`. + * + * This function is also available under the `readUint32LE` alias. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78]); + * + * console.log(buf.readUInt32LE(0).toString(16)); + * // Prints: 78563412 + * console.log(buf.readUInt32LE(1).toString(16)); + * // Throws ERR_OUT_OF_RANGE. + * ``` + * @since v0.5.5 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. + */ + readUInt32LE(offset?: number): number; + /** + * @alias Buffer.readUInt32LE + * @since v14.9.0, v12.19.0 + */ + readUint32LE(offset?: number): number; + /** + * Reads an unsigned, big-endian 32-bit integer from `buf` at the specified`offset`. + * + * This function is also available under the `readUint32BE` alias. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78]); + * + * console.log(buf.readUInt32BE(0).toString(16)); + * // Prints: 12345678 + * ``` + * @since v0.5.5 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. + */ + readUInt32BE(offset?: number): number; + /** + * @alias Buffer.readUInt32BE + * @since v14.9.0, v12.19.0 + */ + readUint32BE(offset?: number): number; + /** + * Reads a signed 8-bit integer from `buf` at the specified `offset`. + * + * Integers read from a `Buffer` are interpreted as two's complement signed values. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.from([-1, 5]); + * + * console.log(buf.readInt8(0)); + * // Prints: -1 + * console.log(buf.readInt8(1)); + * // Prints: 5 + * console.log(buf.readInt8(2)); + * // Throws ERR_OUT_OF_RANGE. + * ``` + * @since v0.5.0 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 1`. + */ + readInt8(offset?: number): number; + /** + * Reads a signed, little-endian 16-bit integer from `buf` at the specified`offset`. + * + * Integers read from a `Buffer` are interpreted as two's complement signed values. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.from([0, 5]); + * + * console.log(buf.readInt16LE(0)); + * // Prints: 1280 + * console.log(buf.readInt16LE(1)); + * // Throws ERR_OUT_OF_RANGE. + * ``` + * @since v0.5.5 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`. + */ + readInt16LE(offset?: number): number; + /** + * Reads a signed, big-endian 16-bit integer from `buf` at the specified `offset`. + * + * Integers read from a `Buffer` are interpreted as two's complement signed values. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.from([0, 5]); + * + * console.log(buf.readInt16BE(0)); + * // Prints: 5 + * ``` + * @since v0.5.5 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`. + */ + readInt16BE(offset?: number): number; + /** + * Reads a signed, little-endian 32-bit integer from `buf` at the specified`offset`. + * + * Integers read from a `Buffer` are interpreted as two's complement signed values. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.from([0, 0, 0, 5]); + * + * console.log(buf.readInt32LE(0)); + * // Prints: 83886080 + * console.log(buf.readInt32LE(1)); + * // Throws ERR_OUT_OF_RANGE. + * ``` + * @since v0.5.5 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. + */ + readInt32LE(offset?: number): number; + /** + * Reads a signed, big-endian 32-bit integer from `buf` at the specified `offset`. + * + * Integers read from a `Buffer` are interpreted as two's complement signed values. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.from([0, 0, 0, 5]); + * + * console.log(buf.readInt32BE(0)); + * // Prints: 5 + * ``` + * @since v0.5.5 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. + */ + readInt32BE(offset?: number): number; + /** + * Reads a 32-bit, little-endian float from `buf` at the specified `offset`. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.from([1, 2, 3, 4]); + * + * console.log(buf.readFloatLE(0)); + * // Prints: 1.539989614439558e-36 + * console.log(buf.readFloatLE(1)); + * // Throws ERR_OUT_OF_RANGE. + * ``` + * @since v0.11.15 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. + */ + readFloatLE(offset?: number): number; + /** + * Reads a 32-bit, big-endian float from `buf` at the specified `offset`. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.from([1, 2, 3, 4]); + * + * console.log(buf.readFloatBE(0)); + * // Prints: 2.387939260590663e-38 + * ``` + * @since v0.11.15 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. + */ + readFloatBE(offset?: number): number; + /** + * Reads a 64-bit, little-endian double from `buf` at the specified `offset`. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8]); + * + * console.log(buf.readDoubleLE(0)); + * // Prints: 5.447603722011605e-270 + * console.log(buf.readDoubleLE(1)); + * // Throws ERR_OUT_OF_RANGE. + * ``` + * @since v0.11.15 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 8`. + */ + readDoubleLE(offset?: number): number; + /** + * Reads a 64-bit, big-endian double from `buf` at the specified `offset`. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8]); + * + * console.log(buf.readDoubleBE(0)); + * // Prints: 8.20788039913184e-304 + * ``` + * @since v0.11.15 + * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 8`. + */ + readDoubleBE(offset?: number): number; + reverse(): this; + /** + * Interprets `buf` as an array of unsigned 16-bit integers and swaps the + * byte order _in-place_. Throws `ERR_INVALID_BUFFER_SIZE` if `buf.length` is not a multiple of 2. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]); + * + * console.log(buf1); + * // Prints: + * + * buf1.swap16(); + * + * console.log(buf1); + * // Prints: + * + * const buf2 = Buffer.from([0x1, 0x2, 0x3]); + * + * buf2.swap16(); + * // Throws ERR_INVALID_BUFFER_SIZE. + * ``` + * + * One convenient use of `buf.swap16()` is to perform a fast in-place conversion + * between UTF-16 little-endian and UTF-16 big-endian: + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.from('This is little-endian UTF-16', 'utf16le'); + * buf.swap16(); // Convert to big-endian UTF-16 text. + * ``` + * @since v5.10.0 + * @return A reference to `buf`. + */ + swap16(): Buffer; + /** + * Interprets `buf` as an array of unsigned 32-bit integers and swaps the + * byte order _in-place_. Throws `ERR_INVALID_BUFFER_SIZE` if `buf.length` is not a multiple of 4. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]); + * + * console.log(buf1); + * // Prints: + * + * buf1.swap32(); + * + * console.log(buf1); + * // Prints: + * + * const buf2 = Buffer.from([0x1, 0x2, 0x3]); + * + * buf2.swap32(); + * // Throws ERR_INVALID_BUFFER_SIZE. + * ``` + * @since v5.10.0 + * @return A reference to `buf`. + */ + swap32(): Buffer; + /** + * Interprets `buf` as an array of 64-bit numbers and swaps byte order _in-place_. + * Throws `ERR_INVALID_BUFFER_SIZE` if `buf.length` is not a multiple of 8. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]); + * + * console.log(buf1); + * // Prints: + * + * buf1.swap64(); + * + * console.log(buf1); + * // Prints: + * + * const buf2 = Buffer.from([0x1, 0x2, 0x3]); + * + * buf2.swap64(); + * // Throws ERR_INVALID_BUFFER_SIZE. + * ``` + * @since v6.3.0 + * @return A reference to `buf`. + */ + swap64(): Buffer; + /** + * Writes `value` to `buf` at the specified `offset`. `value` must be a + * valid unsigned 8-bit integer. Behavior is undefined when `value` is anything + * other than an unsigned 8-bit integer. + * + * This function is also available under the `writeUint8` alias. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.allocUnsafe(4); + * + * buf.writeUInt8(0x3, 0); + * buf.writeUInt8(0x4, 1); + * buf.writeUInt8(0x23, 2); + * buf.writeUInt8(0x42, 3); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.5.0 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 1`. + * @return `offset` plus the number of bytes written. + */ + writeUInt8(value: number, offset?: number): number; + /** + * @alias Buffer.writeUInt8 + * @since v14.9.0, v12.19.0 + */ + writeUint8(value: number, offset?: number): number; + /** + * Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a valid unsigned 16-bit integer. Behavior is undefined when `value` is + * anything other than an unsigned 16-bit integer. + * + * This function is also available under the `writeUint16LE` alias. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.allocUnsafe(4); + * + * buf.writeUInt16LE(0xdead, 0); + * buf.writeUInt16LE(0xbeef, 2); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.5.5 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`. + * @return `offset` plus the number of bytes written. + */ + writeUInt16LE(value: number, offset?: number): number; + /** + * @alias Buffer.writeUInt16LE + * @since v14.9.0, v12.19.0 + */ + writeUint16LE(value: number, offset?: number): number; + /** + * Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a valid unsigned 16-bit integer. Behavior is undefined when `value`is anything other than an + * unsigned 16-bit integer. + * + * This function is also available under the `writeUint16BE` alias. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.allocUnsafe(4); + * + * buf.writeUInt16BE(0xdead, 0); + * buf.writeUInt16BE(0xbeef, 2); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.5.5 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`. + * @return `offset` plus the number of bytes written. + */ + writeUInt16BE(value: number, offset?: number): number; + /** + * @alias Buffer.writeUInt16BE + * @since v14.9.0, v12.19.0 + */ + writeUint16BE(value: number, offset?: number): number; + /** + * Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a valid unsigned 32-bit integer. Behavior is undefined when `value` is + * anything other than an unsigned 32-bit integer. + * + * This function is also available under the `writeUint32LE` alias. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.allocUnsafe(4); + * + * buf.writeUInt32LE(0xfeedface, 0); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.5.5 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. + * @return `offset` plus the number of bytes written. + */ + writeUInt32LE(value: number, offset?: number): number; + /** + * @alias Buffer.writeUInt32LE + * @since v14.9.0, v12.19.0 + */ + writeUint32LE(value: number, offset?: number): number; + /** + * Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a valid unsigned 32-bit integer. Behavior is undefined when `value`is anything other than an + * unsigned 32-bit integer. + * + * This function is also available under the `writeUint32BE` alias. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.allocUnsafe(4); + * + * buf.writeUInt32BE(0xfeedface, 0); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.5.5 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. + * @return `offset` plus the number of bytes written. + */ + writeUInt32BE(value: number, offset?: number): number; + /** + * @alias Buffer.writeUInt32BE + * @since v14.9.0, v12.19.0 + */ + writeUint32BE(value: number, offset?: number): number; + /** + * Writes `value` to `buf` at the specified `offset`. `value` must be a valid + * signed 8-bit integer. Behavior is undefined when `value` is anything other than + * a signed 8-bit integer. + * + * `value` is interpreted and written as a two's complement signed integer. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.allocUnsafe(2); + * + * buf.writeInt8(2, 0); + * buf.writeInt8(-2, 1); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.5.0 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 1`. + * @return `offset` plus the number of bytes written. + */ + writeInt8(value: number, offset?: number): number; + /** + * Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a valid signed 16-bit integer. Behavior is undefined when `value` is + * anything other than a signed 16-bit integer. + * + * The `value` is interpreted and written as a two's complement signed integer. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.allocUnsafe(2); + * + * buf.writeInt16LE(0x0304, 0); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.5.5 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`. + * @return `offset` plus the number of bytes written. + */ + writeInt16LE(value: number, offset?: number): number; + /** + * Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a valid signed 16-bit integer. Behavior is undefined when `value` is + * anything other than a signed 16-bit integer. + * + * The `value` is interpreted and written as a two's complement signed integer. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.allocUnsafe(2); + * + * buf.writeInt16BE(0x0102, 0); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.5.5 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`. + * @return `offset` plus the number of bytes written. + */ + writeInt16BE(value: number, offset?: number): number; + /** + * Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a valid signed 32-bit integer. Behavior is undefined when `value` is + * anything other than a signed 32-bit integer. + * + * The `value` is interpreted and written as a two's complement signed integer. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.allocUnsafe(4); + * + * buf.writeInt32LE(0x05060708, 0); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.5.5 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. + * @return `offset` plus the number of bytes written. + */ + writeInt32LE(value: number, offset?: number): number; + /** + * Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a valid signed 32-bit integer. Behavior is undefined when `value` is + * anything other than a signed 32-bit integer. + * + * The `value` is interpreted and written as a two's complement signed integer. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.allocUnsafe(4); + * + * buf.writeInt32BE(0x01020304, 0); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.5.5 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. + * @return `offset` plus the number of bytes written. + */ + writeInt32BE(value: number, offset?: number): number; + /** + * Writes `value` to `buf` at the specified `offset` as little-endian. Behavior is + * undefined when `value` is anything other than a JavaScript number. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.allocUnsafe(4); + * + * buf.writeFloatLE(0xcafebabe, 0); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.11.15 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. + * @return `offset` plus the number of bytes written. + */ + writeFloatLE(value: number, offset?: number): number; + /** + * Writes `value` to `buf` at the specified `offset` as big-endian. Behavior is + * undefined when `value` is anything other than a JavaScript number. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.allocUnsafe(4); + * + * buf.writeFloatBE(0xcafebabe, 0); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.11.15 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. + * @return `offset` plus the number of bytes written. + */ + writeFloatBE(value: number, offset?: number): number; + /** + * Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a JavaScript number. Behavior is undefined when `value` is anything + * other than a JavaScript number. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.allocUnsafe(8); + * + * buf.writeDoubleLE(123.456, 0); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.11.15 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 8`. + * @return `offset` plus the number of bytes written. + */ + writeDoubleLE(value: number, offset?: number): number; + /** + * Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a JavaScript number. Behavior is undefined when `value` is anything + * other than a JavaScript number. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.allocUnsafe(8); + * + * buf.writeDoubleBE(123.456, 0); + * + * console.log(buf); + * // Prints: + * ``` + * @since v0.11.15 + * @param value Number to be written to `buf`. + * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 8`. + * @return `offset` plus the number of bytes written. + */ + writeDoubleBE(value: number, offset?: number): number; + /** + * Fills `buf` with the specified `value`. If the `offset` and `end` are not given, + * the entire `buf` will be filled: + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * // Fill a `Buffer` with the ASCII character 'h'. + * + * const b = Buffer.allocUnsafe(50).fill('h'); + * + * console.log(b.toString()); + * // Prints: hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh + * + * // Fill a buffer with empty string + * const c = Buffer.allocUnsafe(5).fill(''); + * + * console.log(c.fill('')); + * // Prints: + * ``` + * + * `value` is coerced to a `uint32` value if it is not a string, `Buffer`, or + * integer. If the resulting integer is greater than `255` (decimal), `buf` will be + * filled with `value & 255`. + * + * If the final write of a `fill()` operation falls on a multi-byte character, + * then only the bytes of that character that fit into `buf` are written: + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * // Fill a `Buffer` with character that takes up two bytes in UTF-8. + * + * console.log(Buffer.allocUnsafe(5).fill('\u0222')); + * // Prints: + * ``` + * + * If `value` contains invalid characters, it is truncated; if no valid + * fill data remains, an exception is thrown: + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.allocUnsafe(5); + * + * console.log(buf.fill('a')); + * // Prints: + * console.log(buf.fill('aazz', 'hex')); + * // Prints: + * console.log(buf.fill('zz', 'hex')); + * // Throws an exception. + * ``` + * @since v0.5.0 + * @param value The value with which to fill `buf`. Empty value (string, Uint8Array, Buffer) is coerced to `0`. + * @param [offset=0] Number of bytes to skip before starting to fill `buf`. + * @param [end=buf.length] Where to stop filling `buf` (not inclusive). + * @param [encoding='utf8'] The encoding for `value` if `value` is a string. + * @return A reference to `buf`. + */ + fill(value: string | Uint8Array | number, offset?: number, end?: number, encoding?: BufferEncoding): this; + /** + * If `value` is: + * + * * a string, `value` is interpreted according to the character encoding in`encoding`. + * * a `Buffer` or [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array), `value` will be used in its entirety. + * To compare a partial `Buffer`, use `buf.subarray`. + * * a number, `value` will be interpreted as an unsigned 8-bit integer + * value between `0` and `255`. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.from('this is a buffer'); + * + * console.log(buf.indexOf('this')); + * // Prints: 0 + * console.log(buf.indexOf('is')); + * // Prints: 2 + * console.log(buf.indexOf(Buffer.from('a buffer'))); + * // Prints: 8 + * console.log(buf.indexOf(97)); + * // Prints: 8 (97 is the decimal ASCII value for 'a') + * console.log(buf.indexOf(Buffer.from('a buffer example'))); + * // Prints: -1 + * console.log(buf.indexOf(Buffer.from('a buffer example').slice(0, 8))); + * // Prints: 8 + * + * const utf16Buffer = Buffer.from('\u039a\u0391\u03a3\u03a3\u0395', 'utf16le'); + * + * console.log(utf16Buffer.indexOf('\u03a3', 0, 'utf16le')); + * // Prints: 4 + * console.log(utf16Buffer.indexOf('\u03a3', -4, 'utf16le')); + * // Prints: 6 + * ``` + * + * If `value` is not a string, number, or `Buffer`, this method will throw a`TypeError`. If `value` is a number, it will be coerced to a valid byte value, + * an integer between 0 and 255. + * + * If `byteOffset` is not a number, it will be coerced to a number. If the result + * of coercion is `NaN` or `0`, then the entire buffer will be searched. This + * behavior matches [`String.prototype.indexOf()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf). + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const b = Buffer.from('abcdef'); + * + * // Passing a value that's a number, but not a valid byte. + * // Prints: 2, equivalent to searching for 99 or 'c'. + * console.log(b.indexOf(99.9)); + * console.log(b.indexOf(256 + 99)); + * + * // Passing a byteOffset that coerces to NaN or 0. + * // Prints: 1, searching the whole buffer. + * console.log(b.indexOf('b', undefined)); + * console.log(b.indexOf('b', {})); + * console.log(b.indexOf('b', null)); + * console.log(b.indexOf('b', [])); + * ``` + * + * If `value` is an empty string or empty `Buffer` and `byteOffset` is less + * than `buf.length`, `byteOffset` will be returned. If `value` is empty and`byteOffset` is at least `buf.length`, `buf.length` will be returned. + * @since v1.5.0 + * @param value What to search for. + * @param [byteOffset=0] Where to begin searching in `buf`. If negative, then offset is calculated from the end of `buf`. + * @param [encoding='utf8'] If `value` is a string, this is the encoding used to determine the binary representation of the string that will be searched for in `buf`. + * @return The index of the first occurrence of `value` in `buf`, or `-1` if `buf` does not contain `value`. + */ + indexOf(value: string | number | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number; + /** + * Identical to `buf.indexOf()`, except the last occurrence of `value` is found + * rather than the first occurrence. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.from('this buffer is a buffer'); + * + * console.log(buf.lastIndexOf('this')); + * // Prints: 0 + * console.log(buf.lastIndexOf('buffer')); + * // Prints: 17 + * console.log(buf.lastIndexOf(Buffer.from('buffer'))); + * // Prints: 17 + * console.log(buf.lastIndexOf(97)); + * // Prints: 15 (97 is the decimal ASCII value for 'a') + * console.log(buf.lastIndexOf(Buffer.from('yolo'))); + * // Prints: -1 + * console.log(buf.lastIndexOf('buffer', 5)); + * // Prints: 5 + * console.log(buf.lastIndexOf('buffer', 4)); + * // Prints: -1 + * + * const utf16Buffer = Buffer.from('\u039a\u0391\u03a3\u03a3\u0395', 'utf16le'); + * + * console.log(utf16Buffer.lastIndexOf('\u03a3', undefined, 'utf16le')); + * // Prints: 6 + * console.log(utf16Buffer.lastIndexOf('\u03a3', -5, 'utf16le')); + * // Prints: 4 + * ``` + * + * If `value` is not a string, number, or `Buffer`, this method will throw a`TypeError`. If `value` is a number, it will be coerced to a valid byte value, + * an integer between 0 and 255. + * + * If `byteOffset` is not a number, it will be coerced to a number. Any arguments + * that coerce to `NaN`, like `{}` or `undefined`, will search the whole buffer. + * This behavior matches [`String.prototype.lastIndexOf()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/lastIndexOf). + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const b = Buffer.from('abcdef'); + * + * // Passing a value that's a number, but not a valid byte. + * // Prints: 2, equivalent to searching for 99 or 'c'. + * console.log(b.lastIndexOf(99.9)); + * console.log(b.lastIndexOf(256 + 99)); + * + * // Passing a byteOffset that coerces to NaN. + * // Prints: 1, searching the whole buffer. + * console.log(b.lastIndexOf('b', undefined)); + * console.log(b.lastIndexOf('b', {})); + * + * // Passing a byteOffset that coerces to 0. + * // Prints: -1, equivalent to passing 0. + * console.log(b.lastIndexOf('b', null)); + * console.log(b.lastIndexOf('b', [])); + * ``` + * + * If `value` is an empty string or empty `Buffer`, `byteOffset` will be returned. + * @since v6.0.0 + * @param value What to search for. + * @param [byteOffset=buf.length - 1] Where to begin searching in `buf`. If negative, then offset is calculated from the end of `buf`. + * @param [encoding='utf8'] If `value` is a string, this is the encoding used to determine the binary representation of the string that will be searched for in `buf`. + * @return The index of the last occurrence of `value` in `buf`, or `-1` if `buf` does not contain `value`. + */ + lastIndexOf(value: string | number | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number; + /** + * Creates and returns an [iterator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) of `[index, byte]` pairs from the contents + * of `buf`. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * // Log the entire contents of a `Buffer`. + * + * const buf = Buffer.from('buffer'); + * + * for (const pair of buf.entries()) { + * console.log(pair); + * } + * // Prints: + * // [0, 98] + * // [1, 117] + * // [2, 102] + * // [3, 102] + * // [4, 101] + * // [5, 114] + * ``` + * @since v1.1.0 + */ + entries(): IterableIterator<[number, number]>; + /** + * Equivalent to `buf.indexOf() !== -1`. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.from('this is a buffer'); + * + * console.log(buf.includes('this')); + * // Prints: true + * console.log(buf.includes('is')); + * // Prints: true + * console.log(buf.includes(Buffer.from('a buffer'))); + * // Prints: true + * console.log(buf.includes(97)); + * // Prints: true (97 is the decimal ASCII value for 'a') + * console.log(buf.includes(Buffer.from('a buffer example'))); + * // Prints: false + * console.log(buf.includes(Buffer.from('a buffer example').slice(0, 8))); + * // Prints: true + * console.log(buf.includes('this', 4)); + * // Prints: false + * ``` + * @since v5.3.0 + * @param value What to search for. + * @param [byteOffset=0] Where to begin searching in `buf`. If negative, then offset is calculated from the end of `buf`. + * @param [encoding='utf8'] If `value` is a string, this is its encoding. + * @return `true` if `value` was found in `buf`, `false` otherwise. + */ + includes(value: string | number | Buffer, byteOffset?: number, encoding?: BufferEncoding): boolean; + /** + * Creates and returns an [iterator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) of `buf` keys (indices). + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.from('buffer'); + * + * for (const key of buf.keys()) { + * console.log(key); + * } + * // Prints: + * // 0 + * // 1 + * // 2 + * // 3 + * // 4 + * // 5 + * ``` + * @since v1.1.0 + */ + keys(): IterableIterator; + /** + * Creates and returns an [iterator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) for `buf` values (bytes). This function is + * called automatically when a `Buffer` is used in a `for..of` statement. + * + * ```js + * import { Buffer } from 'node:buffer'; + * + * const buf = Buffer.from('buffer'); + * + * for (const value of buf.values()) { + * console.log(value); + * } + * // Prints: + * // 98 + * // 117 + * // 102 + * // 102 + * // 101 + * // 114 + * + * for (const value of buf) { + * console.log(value); + * } + * // Prints: + * // 98 + * // 117 + * // 102 + * // 102 + * // 101 + * // 114 + * ``` + * @since v1.1.0 + */ + values(): IterableIterator; + } + var Buffer: BufferConstructor; + /** + * Decodes a string of Base64-encoded data into bytes, and encodes those bytes + * into a string using Latin-1 (ISO-8859-1). + * + * The `data` may be any JavaScript-value that can be coerced into a string. + * + * **This function is only provided for compatibility with legacy web platform APIs** + * **and should never be used in new code, because they use strings to represent** + * **binary data and predate the introduction of typed arrays in JavaScript.** + * **For code running using Node.js APIs, converting between base64-encoded strings** + * **and binary data should be performed using `Buffer.from(str, 'base64')` and`buf.toString('base64')`.** + * @since v15.13.0, v14.17.0 + * @legacy Use `Buffer.from(data, 'base64')` instead. + * @param data The Base64-encoded input string. + */ + function atob(data: string): string; + /** + * Decodes a string into bytes using Latin-1 (ISO-8859), and encodes those bytes + * into a string using Base64. + * + * The `data` may be any JavaScript-value that can be coerced into a string. + * + * **This function is only provided for compatibility with legacy web platform APIs** + * **and should never be used in new code, because they use strings to represent** + * **binary data and predate the introduction of typed arrays in JavaScript.** + * **For code running using Node.js APIs, converting between base64-encoded strings** + * **and binary data should be performed using `Buffer.from(str, 'base64')` and`buf.toString('base64')`.** + * @since v15.13.0, v14.17.0 + * @legacy Use `buf.toString('base64')` instead. + * @param data An ASCII (Latin1) string. + */ + function btoa(data: string): string; + interface Blob extends __Blob {} + /** + * `Blob` class is a global reference for `require('node:buffer').Blob` + * https://nodejs.org/api/buffer.html#class-blob + * @since v18.0.0 + */ + var Blob: typeof globalThis extends { + onmessage: any; + Blob: infer T; + } + ? T + : typeof NodeBlob; + } +} +declare module 'buffer' { + export * from 'node:buffer'; +} diff --git a/node_modules/@types/node/ts4.8/child_process.d.ts b/node_modules/@types/node/ts4.8/child_process.d.ts new file mode 100644 index 0000000..3cdf09d --- /dev/null +++ b/node_modules/@types/node/ts4.8/child_process.d.ts @@ -0,0 +1,1400 @@ +/** + * The `node:child_process` module provides the ability to spawn subprocesses in + * a manner that is similar, but not identical, to [`popen(3)`](http://man7.org/linux/man-pages/man3/popen.3.html). This capability + * is primarily provided by the {@link spawn} function: + * + * ```js + * const { spawn } = require('node:child_process'); + * const ls = spawn('ls', ['-lh', '/usr']); + * + * ls.stdout.on('data', (data) => { + * console.log(`stdout: ${data}`); + * }); + * + * ls.stderr.on('data', (data) => { + * console.error(`stderr: ${data}`); + * }); + * + * ls.on('close', (code) => { + * console.log(`child process exited with code ${code}`); + * }); + * ``` + * + * By default, pipes for `stdin`, `stdout`, and `stderr` are established between + * the parent Node.js process and the spawned subprocess. These pipes have + * limited (and platform-specific) capacity. If the subprocess writes to + * stdout in excess of that limit without the output being captured, the + * subprocess blocks waiting for the pipe buffer to accept more data. This is + * identical to the behavior of pipes in the shell. Use the `{ stdio: 'ignore' }`option if the output will not be consumed. + * + * The command lookup is performed using the `options.env.PATH` environment + * variable if `env` is in the `options` object. Otherwise, `process.env.PATH` is + * used. If `options.env` is set without `PATH`, lookup on Unix is performed + * on a default search path search of `/usr/bin:/bin` (see your operating system's + * manual for execvpe/execvp), on Windows the current processes environment + * variable `PATH` is used. + * + * On Windows, environment variables are case-insensitive. Node.js + * lexicographically sorts the `env` keys and uses the first one that + * case-insensitively matches. Only first (in lexicographic order) entry will be + * passed to the subprocess. This might lead to issues on Windows when passing + * objects to the `env` option that have multiple variants of the same key, such as`PATH` and `Path`. + * + * The {@link spawn} method spawns the child process asynchronously, + * without blocking the Node.js event loop. The {@link spawnSync} function provides equivalent functionality in a synchronous manner that blocks + * the event loop until the spawned process either exits or is terminated. + * + * For convenience, the `node:child_process` module provides a handful of + * synchronous and asynchronous alternatives to {@link spawn} and {@link spawnSync}. Each of these alternatives are implemented on + * top of {@link spawn} or {@link spawnSync}. + * + * * {@link exec}: spawns a shell and runs a command within that + * shell, passing the `stdout` and `stderr` to a callback function when + * complete. + * * {@link execFile}: similar to {@link exec} except + * that it spawns the command directly without first spawning a shell by + * default. + * * {@link fork}: spawns a new Node.js process and invokes a + * specified module with an IPC communication channel established that allows + * sending messages between parent and child. + * * {@link execSync}: a synchronous version of {@link exec} that will block the Node.js event loop. + * * {@link execFileSync}: a synchronous version of {@link execFile} that will block the Node.js event loop. + * + * For certain use cases, such as automating shell scripts, the `synchronous counterparts` may be more convenient. In many cases, however, + * the synchronous methods can have significant impact on performance due to + * stalling the event loop while spawned processes complete. + * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/child_process.js) + */ +declare module 'node:child_process' { + import { ObjectEncodingOptions } from 'node:fs'; + import { EventEmitter, Abortable } from 'node:events'; + import * as net from 'node:net'; + import { Writable, Readable, Stream, Pipe } from 'node:stream'; + import { URL } from 'node:url'; + type Serializable = string | object | number | boolean | bigint; + type SendHandle = net.Socket | net.Server; + /** + * Instances of the `ChildProcess` represent spawned child processes. + * + * Instances of `ChildProcess` are not intended to be created directly. Rather, + * use the {@link spawn}, {@link exec},{@link execFile}, or {@link fork} methods to create + * instances of `ChildProcess`. + * @since v2.2.0 + */ + class ChildProcess extends EventEmitter { + /** + * A `Writable Stream` that represents the child process's `stdin`. + * + * If a child process waits to read all of its input, the child will not continue + * until this stream has been closed via `end()`. + * + * If the child was spawned with `stdio[0]` set to anything other than `'pipe'`, + * then this will be `null`. + * + * `subprocess.stdin` is an alias for `subprocess.stdio[0]`. Both properties will + * refer to the same value. + * + * The `subprocess.stdin` property can be `null` or `undefined`if the child process could not be successfully spawned. + * @since v0.1.90 + */ + stdin: Writable | null; + /** + * A `Readable Stream` that represents the child process's `stdout`. + * + * If the child was spawned with `stdio[1]` set to anything other than `'pipe'`, + * then this will be `null`. + * + * `subprocess.stdout` is an alias for `subprocess.stdio[1]`. Both properties will + * refer to the same value. + * + * ```js + * const { spawn } = require('node:child_process'); + * + * const subprocess = spawn('ls'); + * + * subprocess.stdout.on('data', (data) => { + * console.log(`Received chunk ${data}`); + * }); + * ``` + * + * The `subprocess.stdout` property can be `null` or `undefined`if the child process could not be successfully spawned. + * @since v0.1.90 + */ + stdout: Readable | null; + /** + * A `Readable Stream` that represents the child process's `stderr`. + * + * If the child was spawned with `stdio[2]` set to anything other than `'pipe'`, + * then this will be `null`. + * + * `subprocess.stderr` is an alias for `subprocess.stdio[2]`. Both properties will + * refer to the same value. + * + * The `subprocess.stderr` property can be `null` or `undefined`if the child process could not be successfully spawned. + * @since v0.1.90 + */ + stderr: Readable | null; + /** + * The `subprocess.channel` property is a reference to the child's IPC channel. If + * no IPC channel exists, this property is `undefined`. + * @since v7.1.0 + */ + readonly channel?: Pipe | null | undefined; + /** + * A sparse array of pipes to the child process, corresponding with positions in + * the `stdio` option passed to {@link spawn} that have been set + * to the value `'pipe'`. `subprocess.stdio[0]`, `subprocess.stdio[1]`, and`subprocess.stdio[2]` are also available as `subprocess.stdin`,`subprocess.stdout`, and `subprocess.stderr`, + * respectively. + * + * In the following example, only the child's fd `1` (stdout) is configured as a + * pipe, so only the parent's `subprocess.stdio[1]` is a stream, all other values + * in the array are `null`. + * + * ```js + * const assert = require('node:assert'); + * const fs = require('node:fs'); + * const child_process = require('node:child_process'); + * + * const subprocess = child_process.spawn('ls', { + * stdio: [ + * 0, // Use parent's stdin for child. + * 'pipe', // Pipe child's stdout to parent. + * fs.openSync('err.out', 'w'), // Direct child's stderr to a file. + * ], + * }); + * + * assert.strictEqual(subprocess.stdio[0], null); + * assert.strictEqual(subprocess.stdio[0], subprocess.stdin); + * + * assert(subprocess.stdout); + * assert.strictEqual(subprocess.stdio[1], subprocess.stdout); + * + * assert.strictEqual(subprocess.stdio[2], null); + * assert.strictEqual(subprocess.stdio[2], subprocess.stderr); + * ``` + * + * The `subprocess.stdio` property can be `undefined` if the child process could + * not be successfully spawned. + * @since v0.7.10 + */ + readonly stdio: [ + Writable | null, + // stdin + Readable | null, + // stdout + Readable | null, + // stderr + Readable | Writable | null | undefined, + // extra + Readable | Writable | null | undefined // extra + ]; + /** + * The `subprocess.killed` property indicates whether the child process + * successfully received a signal from `subprocess.kill()`. The `killed` property + * does not indicate that the child process has been terminated. + * @since v0.5.10 + */ + readonly killed: boolean; + /** + * Returns the process identifier (PID) of the child process. If the child process + * fails to spawn due to errors, then the value is `undefined` and `error` is + * emitted. + * + * ```js + * const { spawn } = require('node:child_process'); + * const grep = spawn('grep', ['ssh']); + * + * console.log(`Spawned child pid: ${grep.pid}`); + * grep.stdin.end(); + * ``` + * @since v0.1.90 + */ + readonly pid?: number | undefined; + /** + * The `subprocess.connected` property indicates whether it is still possible to + * send and receive messages from a child process. When `subprocess.connected` is`false`, it is no longer possible to send or receive messages. + * @since v0.7.2 + */ + readonly connected: boolean; + /** + * The `subprocess.exitCode` property indicates the exit code of the child process. + * If the child process is still running, the field will be `null`. + */ + readonly exitCode: number | null; + /** + * The `subprocess.signalCode` property indicates the signal received by + * the child process if any, else `null`. + */ + readonly signalCode: NodeJS.Signals | null; + /** + * The `subprocess.spawnargs` property represents the full list of command-line + * arguments the child process was launched with. + */ + readonly spawnargs: string[]; + /** + * The `subprocess.spawnfile` property indicates the executable file name of + * the child process that is launched. + * + * For {@link fork}, its value will be equal to `process.execPath`. + * For {@link spawn}, its value will be the name of + * the executable file. + * For {@link exec}, its value will be the name of the shell + * in which the child process is launched. + */ + readonly spawnfile: string; + /** + * The `subprocess.kill()` method sends a signal to the child process. If no + * argument is given, the process will be sent the `'SIGTERM'` signal. See [`signal(7)`](http://man7.org/linux/man-pages/man7/signal.7.html) for a list of available signals. This function + * returns `true` if [`kill(2)`](http://man7.org/linux/man-pages/man2/kill.2.html) succeeds, and `false` otherwise. + * + * ```js + * const { spawn } = require('node:child_process'); + * const grep = spawn('grep', ['ssh']); + * + * grep.on('close', (code, signal) => { + * console.log( + * `child process terminated due to receipt of signal ${signal}`); + * }); + * + * // Send SIGHUP to process. + * grep.kill('SIGHUP'); + * ``` + * + * The `ChildProcess` object may emit an `'error'` event if the signal + * cannot be delivered. Sending a signal to a child process that has already exited + * is not an error but may have unforeseen consequences. Specifically, if the + * process identifier (PID) has been reassigned to another process, the signal will + * be delivered to that process instead which can have unexpected results. + * + * While the function is called `kill`, the signal delivered to the child process + * may not actually terminate the process. + * + * See [`kill(2)`](http://man7.org/linux/man-pages/man2/kill.2.html) for reference. + * + * On Windows, where POSIX signals do not exist, the `signal` argument will be + * ignored, and the process will be killed forcefully and abruptly (similar to`'SIGKILL'`). + * See `Signal Events` for more details. + * + * On Linux, child processes of child processes will not be terminated + * when attempting to kill their parent. This is likely to happen when running a + * new process in a shell or with the use of the `shell` option of `ChildProcess`: + * + * ```js + * 'use strict'; + * const { spawn } = require('node:child_process'); + * + * const subprocess = spawn( + * 'sh', + * [ + * '-c', + * `node -e "setInterval(() => { + * console.log(process.pid, 'is alive') + * }, 500);"`, + * ], { + * stdio: ['inherit', 'inherit', 'inherit'], + * }, + * ); + * + * setTimeout(() => { + * subprocess.kill(); // Does not terminate the Node.js process in the shell. + * }, 2000); + * ``` + * @since v0.1.90 + */ + kill(signal?: NodeJS.Signals | number): boolean; + /** + * Calls {@link ChildProcess.kill} with `'SIGTERM'`. + * @since v20.5.0 + */ + [Symbol.dispose](): void; + /** + * When an IPC channel has been established between the parent and child ( + * i.e. when using {@link fork}), the `subprocess.send()` method can + * be used to send messages to the child process. When the child process is a + * Node.js instance, these messages can be received via the `'message'` event. + * + * The message goes through serialization and parsing. The resulting + * message might not be the same as what is originally sent. + * + * For example, in the parent script: + * + * ```js + * const cp = require('node:child_process'); + * const n = cp.fork(`${__dirname}/sub.js`); + * + * n.on('message', (m) => { + * console.log('PARENT got message:', m); + * }); + * + * // Causes the child to print: CHILD got message: { hello: 'world' } + * n.send({ hello: 'world' }); + * ``` + * + * And then the child script, `'sub.js'` might look like this: + * + * ```js + * process.on('message', (m) => { + * console.log('CHILD got message:', m); + * }); + * + * // Causes the parent to print: PARENT got message: { foo: 'bar', baz: null } + * process.send({ foo: 'bar', baz: NaN }); + * ``` + * + * Child Node.js processes will have a `process.send()` method of their own + * that allows the child to send messages back to the parent. + * + * There is a special case when sending a `{cmd: 'NODE_foo'}` message. Messages + * containing a `NODE_` prefix in the `cmd` property are reserved for use within + * Node.js core and will not be emitted in the child's `'message'` event. Rather, such messages are emitted using the`'internalMessage'` event and are consumed internally by Node.js. + * Applications should avoid using such messages or listening for`'internalMessage'` events as it is subject to change without notice. + * + * The optional `sendHandle` argument that may be passed to `subprocess.send()` is + * for passing a TCP server or socket object to the child process. The child will + * receive the object as the second argument passed to the callback function + * registered on the `'message'` event. Any data that is received + * and buffered in the socket will not be sent to the child. + * + * The optional `callback` is a function that is invoked after the message is + * sent but before the child may have received it. The function is called with a + * single argument: `null` on success, or an `Error` object on failure. + * + * If no `callback` function is provided and the message cannot be sent, an`'error'` event will be emitted by the `ChildProcess` object. This can + * happen, for instance, when the child process has already exited. + * + * `subprocess.send()` will return `false` if the channel has closed or when the + * backlog of unsent messages exceeds a threshold that makes it unwise to send + * more. Otherwise, the method returns `true`. The `callback` function can be + * used to implement flow control. + * + * #### Example: sending a server object + * + * The `sendHandle` argument can be used, for instance, to pass the handle of + * a TCP server object to the child process as illustrated in the example below: + * + * ```js + * const subprocess = require('node:child_process').fork('subprocess.js'); + * + * // Open up the server object and send the handle. + * const server = require('node:net').createServer(); + * server.on('connection', (socket) => { + * socket.end('handled by parent'); + * }); + * server.listen(1337, () => { + * subprocess.send('server', server); + * }); + * ``` + * + * The child would then receive the server object as: + * + * ```js + * process.on('message', (m, server) => { + * if (m === 'server') { + * server.on('connection', (socket) => { + * socket.end('handled by child'); + * }); + * } + * }); + * ``` + * + * Once the server is now shared between the parent and child, some connections + * can be handled by the parent and some by the child. + * + * While the example above uses a server created using the `node:net` module,`node:dgram` module servers use exactly the same workflow with the exceptions of + * listening on a `'message'` event instead of `'connection'` and using`server.bind()` instead of `server.listen()`. This is, however, only + * supported on Unix platforms. + * + * #### Example: sending a socket object + * + * Similarly, the `sendHandler` argument can be used to pass the handle of a + * socket to the child process. The example below spawns two children that each + * handle connections with "normal" or "special" priority: + * + * ```js + * const { fork } = require('node:child_process'); + * const normal = fork('subprocess.js', ['normal']); + * const special = fork('subprocess.js', ['special']); + * + * // Open up the server and send sockets to child. Use pauseOnConnect to prevent + * // the sockets from being read before they are sent to the child process. + * const server = require('node:net').createServer({ pauseOnConnect: true }); + * server.on('connection', (socket) => { + * + * // If this is special priority... + * if (socket.remoteAddress === '74.125.127.100') { + * special.send('socket', socket); + * return; + * } + * // This is normal priority. + * normal.send('socket', socket); + * }); + * server.listen(1337); + * ``` + * + * The `subprocess.js` would receive the socket handle as the second argument + * passed to the event callback function: + * + * ```js + * process.on('message', (m, socket) => { + * if (m === 'socket') { + * if (socket) { + * // Check that the client socket exists. + * // It is possible for the socket to be closed between the time it is + * // sent and the time it is received in the child process. + * socket.end(`Request handled with ${process.argv[2]} priority`); + * } + * } + * }); + * ``` + * + * Do not use `.maxConnections` on a socket that has been passed to a subprocess. + * The parent cannot track when the socket is destroyed. + * + * Any `'message'` handlers in the subprocess should verify that `socket` exists, + * as the connection may have been closed during the time it takes to send the + * connection to the child. + * @since v0.5.9 + * @param options The `options` argument, if present, is an object used to parameterize the sending of certain types of handles. `options` supports the following properties: + */ + send(message: Serializable, callback?: (error: Error | null) => void): boolean; + send(message: Serializable, sendHandle?: SendHandle, callback?: (error: Error | null) => void): boolean; + send(message: Serializable, sendHandle?: SendHandle, options?: MessageOptions, callback?: (error: Error | null) => void): boolean; + /** + * Closes the IPC channel between parent and child, allowing the child to exit + * gracefully once there are no other connections keeping it alive. After calling + * this method the `subprocess.connected` and `process.connected` properties in + * both the parent and child (respectively) will be set to `false`, and it will be + * no longer possible to pass messages between the processes. + * + * The `'disconnect'` event will be emitted when there are no messages in the + * process of being received. This will most often be triggered immediately after + * calling `subprocess.disconnect()`. + * + * When the child process is a Node.js instance (e.g. spawned using {@link fork}), the `process.disconnect()` method can be invoked + * within the child process to close the IPC channel as well. + * @since v0.7.2 + */ + disconnect(): void; + /** + * By default, the parent will wait for the detached child to exit. To prevent the + * parent from waiting for a given `subprocess` to exit, use the`subprocess.unref()` method. Doing so will cause the parent's event loop to not + * include the child in its reference count, allowing the parent to exit + * independently of the child, unless there is an established IPC channel between + * the child and the parent. + * + * ```js + * const { spawn } = require('node:child_process'); + * + * const subprocess = spawn(process.argv[0], ['child_program.js'], { + * detached: true, + * stdio: 'ignore', + * }); + * + * subprocess.unref(); + * ``` + * @since v0.7.10 + */ + unref(): void; + /** + * Calling `subprocess.ref()` after making a call to `subprocess.unref()` will + * restore the removed reference count for the child process, forcing the parent + * to wait for the child to exit before exiting itself. + * + * ```js + * const { spawn } = require('node:child_process'); + * + * const subprocess = spawn(process.argv[0], ['child_program.js'], { + * detached: true, + * stdio: 'ignore', + * }); + * + * subprocess.unref(); + * subprocess.ref(); + * ``` + * @since v0.7.10 + */ + ref(): void; + /** + * events.EventEmitter + * 1. close + * 2. disconnect + * 3. error + * 4. exit + * 5. message + * 6. spawn + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: 'close', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; + addListener(event: 'disconnect', listener: () => void): this; + addListener(event: 'error', listener: (err: Error) => void): this; + addListener(event: 'exit', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; + addListener(event: 'message', listener: (message: Serializable, sendHandle: SendHandle) => void): this; + addListener(event: 'spawn', listener: () => void): this; + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: 'close', code: number | null, signal: NodeJS.Signals | null): boolean; + emit(event: 'disconnect'): boolean; + emit(event: 'error', err: Error): boolean; + emit(event: 'exit', code: number | null, signal: NodeJS.Signals | null): boolean; + emit(event: 'message', message: Serializable, sendHandle: SendHandle): boolean; + emit(event: 'spawn', listener: () => void): boolean; + on(event: string, listener: (...args: any[]) => void): this; + on(event: 'close', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; + on(event: 'disconnect', listener: () => void): this; + on(event: 'error', listener: (err: Error) => void): this; + on(event: 'exit', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; + on(event: 'message', listener: (message: Serializable, sendHandle: SendHandle) => void): this; + on(event: 'spawn', listener: () => void): this; + once(event: string, listener: (...args: any[]) => void): this; + once(event: 'close', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; + once(event: 'disconnect', listener: () => void): this; + once(event: 'error', listener: (err: Error) => void): this; + once(event: 'exit', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; + once(event: 'message', listener: (message: Serializable, sendHandle: SendHandle) => void): this; + once(event: 'spawn', listener: () => void): this; + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: 'close', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; + prependListener(event: 'disconnect', listener: () => void): this; + prependListener(event: 'error', listener: (err: Error) => void): this; + prependListener(event: 'exit', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; + prependListener(event: 'message', listener: (message: Serializable, sendHandle: SendHandle) => void): this; + prependListener(event: 'spawn', listener: () => void): this; + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'close', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; + prependOnceListener(event: 'disconnect', listener: () => void): this; + prependOnceListener(event: 'error', listener: (err: Error) => void): this; + prependOnceListener(event: 'exit', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; + prependOnceListener(event: 'message', listener: (message: Serializable, sendHandle: SendHandle) => void): this; + prependOnceListener(event: 'spawn', listener: () => void): this; + } + // return this object when stdio option is undefined or not specified + interface ChildProcessWithoutNullStreams extends ChildProcess { + stdin: Writable; + stdout: Readable; + stderr: Readable; + readonly stdio: [ + Writable, + Readable, + Readable, + // stderr + Readable | Writable | null | undefined, + // extra, no modification + Readable | Writable | null | undefined // extra, no modification + ]; + } + // return this object when stdio option is a tuple of 3 + interface ChildProcessByStdio extends ChildProcess { + stdin: I; + stdout: O; + stderr: E; + readonly stdio: [ + I, + O, + E, + Readable | Writable | null | undefined, + // extra, no modification + Readable | Writable | null | undefined // extra, no modification + ]; + } + interface MessageOptions { + keepOpen?: boolean | undefined; + } + type IOType = 'overlapped' | 'pipe' | 'ignore' | 'inherit'; + type StdioOptions = IOType | Array; + type SerializationType = 'json' | 'advanced'; + interface MessagingOptions extends Abortable { + /** + * Specify the kind of serialization used for sending messages between processes. + * @default 'json' + */ + serialization?: SerializationType | undefined; + /** + * The signal value to be used when the spawned process will be killed by the abort signal. + * @default 'SIGTERM' + */ + killSignal?: NodeJS.Signals | number | undefined; + /** + * In milliseconds the maximum amount of time the process is allowed to run. + */ + timeout?: number | undefined; + } + interface ProcessEnvOptions { + uid?: number | undefined; + gid?: number | undefined; + cwd?: string | URL | undefined; + env?: NodeJS.ProcessEnv | undefined; + } + interface CommonOptions extends ProcessEnvOptions { + /** + * @default false + */ + windowsHide?: boolean | undefined; + /** + * @default 0 + */ + timeout?: number | undefined; + } + interface CommonSpawnOptions extends CommonOptions, MessagingOptions, Abortable { + argv0?: string | undefined; + /** + * Can be set to 'pipe', 'inherit', 'overlapped', or 'ignore', or an array of these strings. + * If passed as an array, the first element is used for `stdin`, the second for + * `stdout`, and the third for `stderr`. A fourth element can be used to + * specify the `stdio` behavior beyond the standard streams. See + * {@link ChildProcess.stdio} for more information. + * + * @default 'pipe' + */ + stdio?: StdioOptions | undefined; + shell?: boolean | string | undefined; + windowsVerbatimArguments?: boolean | undefined; + } + interface SpawnOptions extends CommonSpawnOptions { + detached?: boolean | undefined; + } + interface SpawnOptionsWithoutStdio extends SpawnOptions { + stdio?: StdioPipeNamed | StdioPipe[] | undefined; + } + type StdioNull = 'inherit' | 'ignore' | Stream; + type StdioPipeNamed = 'pipe' | 'overlapped'; + type StdioPipe = undefined | null | StdioPipeNamed; + interface SpawnOptionsWithStdioTuple extends SpawnOptions { + stdio: [Stdin, Stdout, Stderr]; + } + /** + * The `child_process.spawn()` method spawns a new process using the given`command`, with command-line arguments in `args`. If omitted, `args` defaults + * to an empty array. + * + * **If the `shell` option is enabled, do not pass unsanitized user input to this** + * **function. Any input containing shell metacharacters may be used to trigger** + * **arbitrary command execution.** + * + * A third argument may be used to specify additional options, with these defaults: + * + * ```js + * const defaults = { + * cwd: undefined, + * env: process.env, + * }; + * ``` + * + * Use `cwd` to specify the working directory from which the process is spawned. + * If not given, the default is to inherit the current working directory. If given, + * but the path does not exist, the child process emits an `ENOENT` error + * and exits immediately. `ENOENT` is also emitted when the command + * does not exist. + * + * Use `env` to specify environment variables that will be visible to the new + * process, the default is `process.env`. + * + * `undefined` values in `env` will be ignored. + * + * Example of running `ls -lh /usr`, capturing `stdout`, `stderr`, and the + * exit code: + * + * ```js + * const { spawn } = require('node:child_process'); + * const ls = spawn('ls', ['-lh', '/usr']); + * + * ls.stdout.on('data', (data) => { + * console.log(`stdout: ${data}`); + * }); + * + * ls.stderr.on('data', (data) => { + * console.error(`stderr: ${data}`); + * }); + * + * ls.on('close', (code) => { + * console.log(`child process exited with code ${code}`); + * }); + * ``` + * + * Example: A very elaborate way to run `ps ax | grep ssh` + * + * ```js + * const { spawn } = require('node:child_process'); + * const ps = spawn('ps', ['ax']); + * const grep = spawn('grep', ['ssh']); + * + * ps.stdout.on('data', (data) => { + * grep.stdin.write(data); + * }); + * + * ps.stderr.on('data', (data) => { + * console.error(`ps stderr: ${data}`); + * }); + * + * ps.on('close', (code) => { + * if (code !== 0) { + * console.log(`ps process exited with code ${code}`); + * } + * grep.stdin.end(); + * }); + * + * grep.stdout.on('data', (data) => { + * console.log(data.toString()); + * }); + * + * grep.stderr.on('data', (data) => { + * console.error(`grep stderr: ${data}`); + * }); + * + * grep.on('close', (code) => { + * if (code !== 0) { + * console.log(`grep process exited with code ${code}`); + * } + * }); + * ``` + * + * Example of checking for failed `spawn`: + * + * ```js + * const { spawn } = require('node:child_process'); + * const subprocess = spawn('bad_command'); + * + * subprocess.on('error', (err) => { + * console.error('Failed to start subprocess.'); + * }); + * ``` + * + * Certain platforms (macOS, Linux) will use the value of `argv[0]` for the process + * title while others (Windows, SunOS) will use `command`. + * + * Node.js overwrites `argv[0]` with `process.execPath` on startup, so`process.argv[0]` in a Node.js child process will not match the `argv0`parameter passed to `spawn` from the parent. Retrieve + * it with the`process.argv0` property instead. + * + * If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.kill()` on the child process except + * the error passed to the callback will be an `AbortError`: + * + * ```js + * const { spawn } = require('node:child_process'); + * const controller = new AbortController(); + * const { signal } = controller; + * const grep = spawn('grep', ['ssh'], { signal }); + * grep.on('error', (err) => { + * // This will be called with err being an AbortError if the controller aborts + * }); + * controller.abort(); // Stops the child process + * ``` + * @since v0.1.90 + * @param command The command to run. + * @param args List of string arguments. + */ + function spawn(command: string, options?: SpawnOptionsWithoutStdio): ChildProcessWithoutNullStreams; + function spawn(command: string, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; + function spawn(command: string, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; + function spawn(command: string, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; + function spawn(command: string, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; + function spawn(command: string, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; + function spawn(command: string, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; + function spawn(command: string, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; + function spawn(command: string, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; + function spawn(command: string, options: SpawnOptions): ChildProcess; + // overloads of spawn with 'args' + function spawn(command: string, args?: ReadonlyArray, options?: SpawnOptionsWithoutStdio): ChildProcessWithoutNullStreams; + function spawn(command: string, args: ReadonlyArray, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; + function spawn(command: string, args: ReadonlyArray, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; + function spawn(command: string, args: ReadonlyArray, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; + function spawn(command: string, args: ReadonlyArray, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; + function spawn(command: string, args: ReadonlyArray, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; + function spawn(command: string, args: ReadonlyArray, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; + function spawn(command: string, args: ReadonlyArray, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; + function spawn(command: string, args: ReadonlyArray, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; + function spawn(command: string, args: ReadonlyArray, options: SpawnOptions): ChildProcess; + interface ExecOptions extends CommonOptions { + shell?: string | undefined; + signal?: AbortSignal | undefined; + maxBuffer?: number | undefined; + killSignal?: NodeJS.Signals | number | undefined; + } + interface ExecOptionsWithStringEncoding extends ExecOptions { + encoding: BufferEncoding; + } + interface ExecOptionsWithBufferEncoding extends ExecOptions { + encoding: BufferEncoding | null; // specify `null`. + } + interface ExecException extends Error { + cmd?: string | undefined; + killed?: boolean | undefined; + code?: number | undefined; + signal?: NodeJS.Signals | undefined; + } + /** + * Spawns a shell then executes the `command` within that shell, buffering any + * generated output. The `command` string passed to the exec function is processed + * directly by the shell and special characters (vary based on [shell](https://en.wikipedia.org/wiki/List_of_command-line_interpreters)) + * need to be dealt with accordingly: + * + * ```js + * const { exec } = require('node:child_process'); + * + * exec('"/path/to/test file/test.sh" arg1 arg2'); + * // Double quotes are used so that the space in the path is not interpreted as + * // a delimiter of multiple arguments. + * + * exec('echo "The \\$HOME variable is $HOME"'); + * // The $HOME variable is escaped in the first instance, but not in the second. + * ``` + * + * **Never pass unsanitized user input to this function. Any input containing shell** + * **metacharacters may be used to trigger arbitrary command execution.** + * + * If a `callback` function is provided, it is called with the arguments`(error, stdout, stderr)`. On success, `error` will be `null`. On error,`error` will be an instance of `Error`. The + * `error.code` property will be + * the exit code of the process. By convention, any exit code other than `0`indicates an error. `error.signal` will be the signal that terminated the + * process. + * + * The `stdout` and `stderr` arguments passed to the callback will contain the + * stdout and stderr output of the child process. By default, Node.js will decode + * the output as UTF-8 and pass strings to the callback. The `encoding` option + * can be used to specify the character encoding used to decode the stdout and + * stderr output. If `encoding` is `'buffer'`, or an unrecognized character + * encoding, `Buffer` objects will be passed to the callback instead. + * + * ```js + * const { exec } = require('node:child_process'); + * exec('cat *.js missing_file | wc -l', (error, stdout, stderr) => { + * if (error) { + * console.error(`exec error: ${error}`); + * return; + * } + * console.log(`stdout: ${stdout}`); + * console.error(`stderr: ${stderr}`); + * }); + * ``` + * + * If `timeout` is greater than `0`, the parent will send the signal + * identified by the `killSignal` property (the default is `'SIGTERM'`) if the + * child runs longer than `timeout` milliseconds. + * + * Unlike the [`exec(3)`](http://man7.org/linux/man-pages/man3/exec.3.html) POSIX system call, `child_process.exec()` does not replace + * the existing process and uses a shell to execute the command. + * + * If this method is invoked as its `util.promisify()` ed version, it returns + * a `Promise` for an `Object` with `stdout` and `stderr` properties. The returned`ChildProcess` instance is attached to the `Promise` as a `child` property. In + * case of an error (including any error resulting in an exit code other than 0), a + * rejected promise is returned, with the same `error` object given in the + * callback, but with two additional properties `stdout` and `stderr`. + * + * ```js + * const util = require('node:util'); + * const exec = util.promisify(require('node:child_process').exec); + * + * async function lsExample() { + * const { stdout, stderr } = await exec('ls'); + * console.log('stdout:', stdout); + * console.error('stderr:', stderr); + * } + * lsExample(); + * ``` + * + * If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.kill()` on the child process except + * the error passed to the callback will be an `AbortError`: + * + * ```js + * const { exec } = require('node:child_process'); + * const controller = new AbortController(); + * const { signal } = controller; + * const child = exec('grep ssh', { signal }, (error) => { + * console.error(error); // an AbortError + * }); + * controller.abort(); + * ``` + * @since v0.1.90 + * @param command The command to run, with space-separated arguments. + * @param callback called with the output when process terminates. + */ + function exec(command: string, callback?: (error: ExecException | null, stdout: string, stderr: string) => void): ChildProcess; + // `options` with `"buffer"` or `null` for `encoding` means stdout/stderr are definitely `Buffer`. + function exec( + command: string, + options: { + encoding: 'buffer' | null; + } & ExecOptions, + callback?: (error: ExecException | null, stdout: Buffer, stderr: Buffer) => void + ): ChildProcess; + // `options` with well known `encoding` means stdout/stderr are definitely `string`. + function exec( + command: string, + options: { + encoding: BufferEncoding; + } & ExecOptions, + callback?: (error: ExecException | null, stdout: string, stderr: string) => void + ): ChildProcess; + // `options` with an `encoding` whose type is `string` means stdout/stderr could either be `Buffer` or `string`. + // There is no guarantee the `encoding` is unknown as `string` is a superset of `BufferEncoding`. + function exec( + command: string, + options: { + encoding: BufferEncoding; + } & ExecOptions, + callback?: (error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void + ): ChildProcess; + // `options` without an `encoding` means stdout/stderr are definitely `string`. + function exec(command: string, options: ExecOptions, callback?: (error: ExecException | null, stdout: string, stderr: string) => void): ChildProcess; + // fallback if nothing else matches. Worst case is always `string | Buffer`. + function exec( + command: string, + options: (ObjectEncodingOptions & ExecOptions) | undefined | null, + callback?: (error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void + ): ChildProcess; + interface PromiseWithChild extends Promise { + child: ChildProcess; + } + namespace exec { + function __promisify__(command: string): PromiseWithChild<{ + stdout: string; + stderr: string; + }>; + function __promisify__( + command: string, + options: { + encoding: 'buffer' | null; + } & ExecOptions + ): PromiseWithChild<{ + stdout: Buffer; + stderr: Buffer; + }>; + function __promisify__( + command: string, + options: { + encoding: BufferEncoding; + } & ExecOptions + ): PromiseWithChild<{ + stdout: string; + stderr: string; + }>; + function __promisify__( + command: string, + options: ExecOptions + ): PromiseWithChild<{ + stdout: string; + stderr: string; + }>; + function __promisify__( + command: string, + options?: (ObjectEncodingOptions & ExecOptions) | null + ): PromiseWithChild<{ + stdout: string | Buffer; + stderr: string | Buffer; + }>; + } + interface ExecFileOptions extends CommonOptions, Abortable { + maxBuffer?: number | undefined; + killSignal?: NodeJS.Signals | number | undefined; + windowsVerbatimArguments?: boolean | undefined; + shell?: boolean | string | undefined; + signal?: AbortSignal | undefined; + } + interface ExecFileOptionsWithStringEncoding extends ExecFileOptions { + encoding: BufferEncoding; + } + interface ExecFileOptionsWithBufferEncoding extends ExecFileOptions { + encoding: 'buffer' | null; + } + interface ExecFileOptionsWithOtherEncoding extends ExecFileOptions { + encoding: BufferEncoding; + } + type ExecFileException = + & Omit + & Omit + & { code?: string | number | undefined | null }; + /** + * The `child_process.execFile()` function is similar to {@link exec} except that it does not spawn a shell by default. Rather, the specified + * executable `file` is spawned directly as a new process making it slightly more + * efficient than {@link exec}. + * + * The same options as {@link exec} are supported. Since a shell is + * not spawned, behaviors such as I/O redirection and file globbing are not + * supported. + * + * ```js + * const { execFile } = require('node:child_process'); + * const child = execFile('node', ['--version'], (error, stdout, stderr) => { + * if (error) { + * throw error; + * } + * console.log(stdout); + * }); + * ``` + * + * The `stdout` and `stderr` arguments passed to the callback will contain the + * stdout and stderr output of the child process. By default, Node.js will decode + * the output as UTF-8 and pass strings to the callback. The `encoding` option + * can be used to specify the character encoding used to decode the stdout and + * stderr output. If `encoding` is `'buffer'`, or an unrecognized character + * encoding, `Buffer` objects will be passed to the callback instead. + * + * If this method is invoked as its `util.promisify()` ed version, it returns + * a `Promise` for an `Object` with `stdout` and `stderr` properties. The returned`ChildProcess` instance is attached to the `Promise` as a `child` property. In + * case of an error (including any error resulting in an exit code other than 0), a + * rejected promise is returned, with the same `error` object given in the + * callback, but with two additional properties `stdout` and `stderr`. + * + * ```js + * const util = require('node:util'); + * const execFile = util.promisify(require('node:child_process').execFile); + * async function getVersion() { + * const { stdout } = await execFile('node', ['--version']); + * console.log(stdout); + * } + * getVersion(); + * ``` + * + * **If the `shell` option is enabled, do not pass unsanitized user input to this** + * **function. Any input containing shell metacharacters may be used to trigger** + * **arbitrary command execution.** + * + * If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.kill()` on the child process except + * the error passed to the callback will be an `AbortError`: + * + * ```js + * const { execFile } = require('node:child_process'); + * const controller = new AbortController(); + * const { signal } = controller; + * const child = execFile('node', ['--version'], { signal }, (error) => { + * console.error(error); // an AbortError + * }); + * controller.abort(); + * ``` + * @since v0.1.91 + * @param file The name or path of the executable file to run. + * @param args List of string arguments. + * @param callback Called with the output when process terminates. + */ + function execFile(file: string): ChildProcess; + function execFile(file: string, options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null): ChildProcess; + function execFile(file: string, args?: ReadonlyArray | null): ChildProcess; + function execFile(file: string, args: ReadonlyArray | undefined | null, options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null): ChildProcess; + // no `options` definitely means stdout/stderr are `string`. + function execFile(file: string, callback: (error: ExecFileException | null, stdout: string, stderr: string) => void): ChildProcess; + function execFile(file: string, args: ReadonlyArray | undefined | null, callback: (error: ExecFileException | null, stdout: string, stderr: string) => void): ChildProcess; + // `options` with `"buffer"` or `null` for `encoding` means stdout/stderr are definitely `Buffer`. + function execFile(file: string, options: ExecFileOptionsWithBufferEncoding, callback: (error: ExecFileException | null, stdout: Buffer, stderr: Buffer) => void): ChildProcess; + function execFile( + file: string, + args: ReadonlyArray | undefined | null, + options: ExecFileOptionsWithBufferEncoding, + callback: (error: ExecFileException | null, stdout: Buffer, stderr: Buffer) => void + ): ChildProcess; + // `options` with well known `encoding` means stdout/stderr are definitely `string`. + function execFile(file: string, options: ExecFileOptionsWithStringEncoding, callback: (error: ExecFileException | null, stdout: string, stderr: string) => void): ChildProcess; + function execFile( + file: string, + args: ReadonlyArray | undefined | null, + options: ExecFileOptionsWithStringEncoding, + callback: (error: ExecFileException | null, stdout: string, stderr: string) => void + ): ChildProcess; + // `options` with an `encoding` whose type is `string` means stdout/stderr could either be `Buffer` or `string`. + // There is no guarantee the `encoding` is unknown as `string` is a superset of `BufferEncoding`. + function execFile(file: string, options: ExecFileOptionsWithOtherEncoding, callback: (error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void): ChildProcess; + function execFile( + file: string, + args: ReadonlyArray | undefined | null, + options: ExecFileOptionsWithOtherEncoding, + callback: (error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void + ): ChildProcess; + // `options` without an `encoding` means stdout/stderr are definitely `string`. + function execFile(file: string, options: ExecFileOptions, callback: (error: ExecFileException | null, stdout: string, stderr: string) => void): ChildProcess; + function execFile( + file: string, + args: ReadonlyArray | undefined | null, + options: ExecFileOptions, + callback: (error: ExecFileException | null, stdout: string, stderr: string) => void + ): ChildProcess; + // fallback if nothing else matches. Worst case is always `string | Buffer`. + function execFile( + file: string, + options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null, + callback: ((error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void) | undefined | null + ): ChildProcess; + function execFile( + file: string, + args: ReadonlyArray | undefined | null, + options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null, + callback: ((error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void) | undefined | null + ): ChildProcess; + namespace execFile { + function __promisify__(file: string): PromiseWithChild<{ + stdout: string; + stderr: string; + }>; + function __promisify__( + file: string, + args: ReadonlyArray | undefined | null + ): PromiseWithChild<{ + stdout: string; + stderr: string; + }>; + function __promisify__( + file: string, + options: ExecFileOptionsWithBufferEncoding + ): PromiseWithChild<{ + stdout: Buffer; + stderr: Buffer; + }>; + function __promisify__( + file: string, + args: ReadonlyArray | undefined | null, + options: ExecFileOptionsWithBufferEncoding + ): PromiseWithChild<{ + stdout: Buffer; + stderr: Buffer; + }>; + function __promisify__( + file: string, + options: ExecFileOptionsWithStringEncoding + ): PromiseWithChild<{ + stdout: string; + stderr: string; + }>; + function __promisify__( + file: string, + args: ReadonlyArray | undefined | null, + options: ExecFileOptionsWithStringEncoding + ): PromiseWithChild<{ + stdout: string; + stderr: string; + }>; + function __promisify__( + file: string, + options: ExecFileOptionsWithOtherEncoding + ): PromiseWithChild<{ + stdout: string | Buffer; + stderr: string | Buffer; + }>; + function __promisify__( + file: string, + args: ReadonlyArray | undefined | null, + options: ExecFileOptionsWithOtherEncoding + ): PromiseWithChild<{ + stdout: string | Buffer; + stderr: string | Buffer; + }>; + function __promisify__( + file: string, + options: ExecFileOptions + ): PromiseWithChild<{ + stdout: string; + stderr: string; + }>; + function __promisify__( + file: string, + args: ReadonlyArray | undefined | null, + options: ExecFileOptions + ): PromiseWithChild<{ + stdout: string; + stderr: string; + }>; + function __promisify__( + file: string, + options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null + ): PromiseWithChild<{ + stdout: string | Buffer; + stderr: string | Buffer; + }>; + function __promisify__( + file: string, + args: ReadonlyArray | undefined | null, + options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null + ): PromiseWithChild<{ + stdout: string | Buffer; + stderr: string | Buffer; + }>; + } + interface ForkOptions extends ProcessEnvOptions, MessagingOptions, Abortable { + execPath?: string | undefined; + execArgv?: string[] | undefined; + silent?: boolean | undefined; + /** + * Can be set to 'pipe', 'inherit', 'overlapped', or 'ignore', or an array of these strings. + * If passed as an array, the first element is used for `stdin`, the second for + * `stdout`, and the third for `stderr`. A fourth element can be used to + * specify the `stdio` behavior beyond the standard streams. See + * {@link ChildProcess.stdio} for more information. + * + * @default 'pipe' + */ + stdio?: StdioOptions | undefined; + detached?: boolean | undefined; + windowsVerbatimArguments?: boolean | undefined; + } + /** + * The `child_process.fork()` method is a special case of {@link spawn} used specifically to spawn new Node.js processes. + * Like {@link spawn}, a `ChildProcess` object is returned. The + * returned `ChildProcess` will have an additional communication channel + * built-in that allows messages to be passed back and forth between the parent and + * child. See `subprocess.send()` for details. + * + * Keep in mind that spawned Node.js child processes are + * independent of the parent with exception of the IPC communication channel + * that is established between the two. Each process has its own memory, with + * their own V8 instances. Because of the additional resource allocations + * required, spawning a large number of child Node.js processes is not + * recommended. + * + * By default, `child_process.fork()` will spawn new Node.js instances using the `process.execPath` of the parent process. The `execPath` property in the`options` object allows for an alternative + * execution path to be used. + * + * Node.js processes launched with a custom `execPath` will communicate with the + * parent process using the file descriptor (fd) identified using the + * environment variable `NODE_CHANNEL_FD` on the child process. + * + * Unlike the [`fork(2)`](http://man7.org/linux/man-pages/man2/fork.2.html) POSIX system call, `child_process.fork()` does not clone the + * current process. + * + * The `shell` option available in {@link spawn} is not supported by`child_process.fork()` and will be ignored if set. + * + * If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.kill()` on the child process except + * the error passed to the callback will be an `AbortError`: + * + * ```js + * if (process.argv[2] === 'child') { + * setTimeout(() => { + * console.log(`Hello from ${process.argv[2]}!`); + * }, 1_000); + * } else { + * const { fork } = require('node:child_process'); + * const controller = new AbortController(); + * const { signal } = controller; + * const child = fork(__filename, ['child'], { signal }); + * child.on('error', (err) => { + * // This will be called with err being an AbortError if the controller aborts + * }); + * controller.abort(); // Stops the child process + * } + * ``` + * @since v0.5.0 + * @param modulePath The module to run in the child. + * @param args List of string arguments. + */ + function fork(modulePath: string, options?: ForkOptions): ChildProcess; + function fork(modulePath: string, args?: ReadonlyArray, options?: ForkOptions): ChildProcess; + interface SpawnSyncOptions extends CommonSpawnOptions { + input?: string | NodeJS.ArrayBufferView | undefined; + maxBuffer?: number | undefined; + encoding?: BufferEncoding | 'buffer' | null | undefined; + } + interface SpawnSyncOptionsWithStringEncoding extends SpawnSyncOptions { + encoding: BufferEncoding; + } + interface SpawnSyncOptionsWithBufferEncoding extends SpawnSyncOptions { + encoding?: 'buffer' | null | undefined; + } + interface SpawnSyncReturns { + pid: number; + output: Array; + stdout: T; + stderr: T; + status: number | null; + signal: NodeJS.Signals | null; + error?: Error | undefined; + } + /** + * The `child_process.spawnSync()` method is generally identical to {@link spawn} with the exception that the function will not return + * until the child process has fully closed. When a timeout has been encountered + * and `killSignal` is sent, the method won't return until the process has + * completely exited. If the process intercepts and handles the `SIGTERM` signal + * and doesn't exit, the parent process will wait until the child process has + * exited. + * + * **If the `shell` option is enabled, do not pass unsanitized user input to this** + * **function. Any input containing shell metacharacters may be used to trigger** + * **arbitrary command execution.** + * @since v0.11.12 + * @param command The command to run. + * @param args List of string arguments. + */ + function spawnSync(command: string): SpawnSyncReturns; + function spawnSync(command: string, options: SpawnSyncOptionsWithStringEncoding): SpawnSyncReturns; + function spawnSync(command: string, options: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns; + function spawnSync(command: string, options?: SpawnSyncOptions): SpawnSyncReturns; + function spawnSync(command: string, args: ReadonlyArray): SpawnSyncReturns; + function spawnSync(command: string, args: ReadonlyArray, options: SpawnSyncOptionsWithStringEncoding): SpawnSyncReturns; + function spawnSync(command: string, args: ReadonlyArray, options: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns; + function spawnSync(command: string, args?: ReadonlyArray, options?: SpawnSyncOptions): SpawnSyncReturns; + interface CommonExecOptions extends CommonOptions { + input?: string | NodeJS.ArrayBufferView | undefined; + /** + * Can be set to 'pipe', 'inherit, or 'ignore', or an array of these strings. + * If passed as an array, the first element is used for `stdin`, the second for + * `stdout`, and the third for `stderr`. A fourth element can be used to + * specify the `stdio` behavior beyond the standard streams. See + * {@link ChildProcess.stdio} for more information. + * + * @default 'pipe' + */ + stdio?: StdioOptions | undefined; + killSignal?: NodeJS.Signals | number | undefined; + maxBuffer?: number | undefined; + encoding?: BufferEncoding | 'buffer' | null | undefined; + } + interface ExecSyncOptions extends CommonExecOptions { + shell?: string | undefined; + } + interface ExecSyncOptionsWithStringEncoding extends ExecSyncOptions { + encoding: BufferEncoding; + } + interface ExecSyncOptionsWithBufferEncoding extends ExecSyncOptions { + encoding?: 'buffer' | null | undefined; + } + /** + * The `child_process.execSync()` method is generally identical to {@link exec} with the exception that the method will not return + * until the child process has fully closed. When a timeout has been encountered + * and `killSignal` is sent, the method won't return until the process has + * completely exited. If the child process intercepts and handles the `SIGTERM`signal and doesn't exit, the parent process will wait until the child process + * has exited. + * + * If the process times out or has a non-zero exit code, this method will throw. + * The `Error` object will contain the entire result from {@link spawnSync}. + * + * **Never pass unsanitized user input to this function. Any input containing shell** + * **metacharacters may be used to trigger arbitrary command execution.** + * @since v0.11.12 + * @param command The command to run. + * @return The stdout from the command. + */ + function execSync(command: string): Buffer; + function execSync(command: string, options: ExecSyncOptionsWithStringEncoding): string; + function execSync(command: string, options: ExecSyncOptionsWithBufferEncoding): Buffer; + function execSync(command: string, options?: ExecSyncOptions): string | Buffer; + interface ExecFileSyncOptions extends CommonExecOptions { + shell?: boolean | string | undefined; + } + interface ExecFileSyncOptionsWithStringEncoding extends ExecFileSyncOptions { + encoding: BufferEncoding; + } + interface ExecFileSyncOptionsWithBufferEncoding extends ExecFileSyncOptions { + encoding?: 'buffer' | null; // specify `null`. + } + /** + * The `child_process.execFileSync()` method is generally identical to {@link execFile} with the exception that the method will not + * return until the child process has fully closed. When a timeout has been + * encountered and `killSignal` is sent, the method won't return until the process + * has completely exited. + * + * If the child process intercepts and handles the `SIGTERM` signal and + * does not exit, the parent process will still wait until the child process has + * exited. + * + * If the process times out or has a non-zero exit code, this method will throw an `Error` that will include the full result of the underlying {@link spawnSync}. + * + * **If the `shell` option is enabled, do not pass unsanitized user input to this** + * **function. Any input containing shell metacharacters may be used to trigger** + * **arbitrary command execution.** + * @since v0.11.12 + * @param file The name or path of the executable file to run. + * @param args List of string arguments. + * @return The stdout from the command. + */ + function execFileSync(file: string): Buffer; + function execFileSync(file: string, options: ExecFileSyncOptionsWithStringEncoding): string; + function execFileSync(file: string, options: ExecFileSyncOptionsWithBufferEncoding): Buffer; + function execFileSync(file: string, options?: ExecFileSyncOptions): string | Buffer; + function execFileSync(file: string, args: ReadonlyArray): Buffer; + function execFileSync(file: string, args: ReadonlyArray, options: ExecFileSyncOptionsWithStringEncoding): string; + function execFileSync(file: string, args: ReadonlyArray, options: ExecFileSyncOptionsWithBufferEncoding): Buffer; + function execFileSync(file: string, args?: ReadonlyArray, options?: ExecFileSyncOptions): string | Buffer; +} +declare module 'child_process' { + export * from 'node:child_process'; +} diff --git a/node_modules/@types/node/ts4.8/cluster.d.ts b/node_modules/@types/node/ts4.8/cluster.d.ts new file mode 100644 index 0000000..f5d6942 --- /dev/null +++ b/node_modules/@types/node/ts4.8/cluster.d.ts @@ -0,0 +1,414 @@ +/** + * Clusters of Node.js processes can be used to run multiple instances of Node.js + * that can distribute workloads among their application threads. When process + * isolation is not needed, use the `worker_threads` module instead, which + * allows running multiple application threads within a single Node.js instance. + * + * The cluster module allows easy creation of child processes that all share + * server ports. + * + * ```js + * import cluster from 'node:cluster'; + * import http from 'node:http'; + * import { availableParallelism } from 'node:os'; + * import process from 'node:process'; + * + * const numCPUs = availableParallelism(); + * + * if (cluster.isPrimary) { + * console.log(`Primary ${process.pid} is running`); + * + * // Fork workers. + * for (let i = 0; i < numCPUs; i++) { + * cluster.fork(); + * } + * + * cluster.on('exit', (worker, code, signal) => { + * console.log(`worker ${worker.process.pid} died`); + * }); + * } else { + * // Workers can share any TCP connection + * // In this case it is an HTTP server + * http.createServer((req, res) => { + * res.writeHead(200); + * res.end('hello world\n'); + * }).listen(8000); + * + * console.log(`Worker ${process.pid} started`); + * } + * ``` + * + * Running Node.js will now share port 8000 between the workers: + * + * ```console + * $ node server.js + * Primary 3596 is running + * Worker 4324 started + * Worker 4520 started + * Worker 6056 started + * Worker 5644 started + * ``` + * + * On Windows, it is not yet possible to set up a named pipe server in a worker. + * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/cluster.js) + */ +declare module 'node:cluster' { + import * as child from 'node:child_process'; + import EventEmitter = require('node:events'); + import * as net from 'node:net'; + type SerializationType = 'json' | 'advanced'; + export interface ClusterSettings { + execArgv?: string[] | undefined; // default: process.execArgv + exec?: string | undefined; + args?: string[] | undefined; + silent?: boolean | undefined; + stdio?: any[] | undefined; + uid?: number | undefined; + gid?: number | undefined; + inspectPort?: number | (() => number) | undefined; + serialization?: SerializationType | undefined; + cwd?: string | undefined; + windowsHide?: boolean | undefined; + } + export interface Address { + address: string; + port: number; + addressType: number | 'udp4' | 'udp6'; // 4, 6, -1, "udp4", "udp6" + } + /** + * A `Worker` object contains all public information and method about a worker. + * In the primary it can be obtained using `cluster.workers`. In a worker + * it can be obtained using `cluster.worker`. + * @since v0.7.0 + */ + export class Worker extends EventEmitter { + /** + * Each new worker is given its own unique id, this id is stored in the`id`. + * + * While a worker is alive, this is the key that indexes it in`cluster.workers`. + * @since v0.8.0 + */ + id: number; + /** + * All workers are created using `child_process.fork()`, the returned object + * from this function is stored as `.process`. In a worker, the global `process`is stored. + * + * See: `Child Process module`. + * + * Workers will call `process.exit(0)` if the `'disconnect'` event occurs + * on `process` and `.exitedAfterDisconnect` is not `true`. This protects against + * accidental disconnection. + * @since v0.7.0 + */ + process: child.ChildProcess; + /** + * Send a message to a worker or primary, optionally with a handle. + * + * In the primary, this sends a message to a specific worker. It is identical to `ChildProcess.send()`. + * + * In a worker, this sends a message to the primary. It is identical to`process.send()`. + * + * This example will echo back all messages from the primary: + * + * ```js + * if (cluster.isPrimary) { + * const worker = cluster.fork(); + * worker.send('hi there'); + * + * } else if (cluster.isWorker) { + * process.on('message', (msg) => { + * process.send(msg); + * }); + * } + * ``` + * @since v0.7.0 + * @param options The `options` argument, if present, is an object used to parameterize the sending of certain types of handles. `options` supports the following properties: + */ + send(message: child.Serializable, callback?: (error: Error | null) => void): boolean; + send(message: child.Serializable, sendHandle: child.SendHandle, callback?: (error: Error | null) => void): boolean; + send(message: child.Serializable, sendHandle: child.SendHandle, options?: child.MessageOptions, callback?: (error: Error | null) => void): boolean; + /** + * This function will kill the worker. In the primary worker, it does this by + * disconnecting the `worker.process`, and once disconnected, killing with`signal`. In the worker, it does it by killing the process with `signal`. + * + * The `kill()` function kills the worker process without waiting for a graceful + * disconnect, it has the same behavior as `worker.process.kill()`. + * + * This method is aliased as `worker.destroy()` for backwards compatibility. + * + * In a worker, `process.kill()` exists, but it is not this function; + * it is `kill()`. + * @since v0.9.12 + * @param [signal='SIGTERM'] Name of the kill signal to send to the worker process. + */ + kill(signal?: string): void; + destroy(signal?: string): void; + /** + * In a worker, this function will close all servers, wait for the `'close'` event + * on those servers, and then disconnect the IPC channel. + * + * In the primary, an internal message is sent to the worker causing it to call`.disconnect()` on itself. + * + * Causes `.exitedAfterDisconnect` to be set. + * + * After a server is closed, it will no longer accept new connections, + * but connections may be accepted by any other listening worker. Existing + * connections will be allowed to close as usual. When no more connections exist, + * see `server.close()`, the IPC channel to the worker will close allowing it + * to die gracefully. + * + * The above applies _only_ to server connections, client connections are not + * automatically closed by workers, and disconnect does not wait for them to close + * before exiting. + * + * In a worker, `process.disconnect` exists, but it is not this function; + * it is `disconnect()`. + * + * Because long living server connections may block workers from disconnecting, it + * may be useful to send a message, so application specific actions may be taken to + * close them. It also may be useful to implement a timeout, killing a worker if + * the `'disconnect'` event has not been emitted after some time. + * + * ```js + * if (cluster.isPrimary) { + * const worker = cluster.fork(); + * let timeout; + * + * worker.on('listening', (address) => { + * worker.send('shutdown'); + * worker.disconnect(); + * timeout = setTimeout(() => { + * worker.kill(); + * }, 2000); + * }); + * + * worker.on('disconnect', () => { + * clearTimeout(timeout); + * }); + * + * } else if (cluster.isWorker) { + * const net = require('node:net'); + * const server = net.createServer((socket) => { + * // Connections never end + * }); + * + * server.listen(8000); + * + * process.on('message', (msg) => { + * if (msg === 'shutdown') { + * // Initiate graceful close of any connections to server + * } + * }); + * } + * ``` + * @since v0.7.7 + * @return A reference to `worker`. + */ + disconnect(): void; + /** + * This function returns `true` if the worker is connected to its primary via its + * IPC channel, `false` otherwise. A worker is connected to its primary after it + * has been created. It is disconnected after the `'disconnect'` event is emitted. + * @since v0.11.14 + */ + isConnected(): boolean; + /** + * This function returns `true` if the worker's process has terminated (either + * because of exiting or being signaled). Otherwise, it returns `false`. + * + * ```js + * import cluster from 'node:cluster'; + * import http from 'node:http'; + * import { availableParallelism } from 'node:os'; + * import process from 'node:process'; + * + * const numCPUs = availableParallelism(); + * + * if (cluster.isPrimary) { + * console.log(`Primary ${process.pid} is running`); + * + * // Fork workers. + * for (let i = 0; i < numCPUs; i++) { + * cluster.fork(); + * } + * + * cluster.on('fork', (worker) => { + * console.log('worker is dead:', worker.isDead()); + * }); + * + * cluster.on('exit', (worker, code, signal) => { + * console.log('worker is dead:', worker.isDead()); + * }); + * } else { + * // Workers can share any TCP connection. In this case, it is an HTTP server. + * http.createServer((req, res) => { + * res.writeHead(200); + * res.end(`Current process\n ${process.pid}`); + * process.kill(process.pid); + * }).listen(8000); + * } + * ``` + * @since v0.11.14 + */ + isDead(): boolean; + /** + * This property is `true` if the worker exited due to `.disconnect()`. + * If the worker exited any other way, it is `false`. If the + * worker has not exited, it is `undefined`. + * + * The boolean `worker.exitedAfterDisconnect` allows distinguishing between + * voluntary and accidental exit, the primary may choose not to respawn a worker + * based on this value. + * + * ```js + * cluster.on('exit', (worker, code, signal) => { + * if (worker.exitedAfterDisconnect === true) { + * console.log('Oh, it was just voluntary – no need to worry'); + * } + * }); + * + * // kill worker + * worker.kill(); + * ``` + * @since v6.0.0 + */ + exitedAfterDisconnect: boolean; + /** + * events.EventEmitter + * 1. disconnect + * 2. error + * 3. exit + * 4. listening + * 5. message + * 6. online + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: 'disconnect', listener: () => void): this; + addListener(event: 'error', listener: (error: Error) => void): this; + addListener(event: 'exit', listener: (code: number, signal: string) => void): this; + addListener(event: 'listening', listener: (address: Address) => void): this; + addListener(event: 'message', listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + addListener(event: 'online', listener: () => void): this; + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: 'disconnect'): boolean; + emit(event: 'error', error: Error): boolean; + emit(event: 'exit', code: number, signal: string): boolean; + emit(event: 'listening', address: Address): boolean; + emit(event: 'message', message: any, handle: net.Socket | net.Server): boolean; + emit(event: 'online'): boolean; + on(event: string, listener: (...args: any[]) => void): this; + on(event: 'disconnect', listener: () => void): this; + on(event: 'error', listener: (error: Error) => void): this; + on(event: 'exit', listener: (code: number, signal: string) => void): this; + on(event: 'listening', listener: (address: Address) => void): this; + on(event: 'message', listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + on(event: 'online', listener: () => void): this; + once(event: string, listener: (...args: any[]) => void): this; + once(event: 'disconnect', listener: () => void): this; + once(event: 'error', listener: (error: Error) => void): this; + once(event: 'exit', listener: (code: number, signal: string) => void): this; + once(event: 'listening', listener: (address: Address) => void): this; + once(event: 'message', listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + once(event: 'online', listener: () => void): this; + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: 'disconnect', listener: () => void): this; + prependListener(event: 'error', listener: (error: Error) => void): this; + prependListener(event: 'exit', listener: (code: number, signal: string) => void): this; + prependListener(event: 'listening', listener: (address: Address) => void): this; + prependListener(event: 'message', listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + prependListener(event: 'online', listener: () => void): this; + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'disconnect', listener: () => void): this; + prependOnceListener(event: 'error', listener: (error: Error) => void): this; + prependOnceListener(event: 'exit', listener: (code: number, signal: string) => void): this; + prependOnceListener(event: 'listening', listener: (address: Address) => void): this; + prependOnceListener(event: 'message', listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + prependOnceListener(event: 'online', listener: () => void): this; + } + export interface Cluster extends EventEmitter { + disconnect(callback?: () => void): void; + fork(env?: any): Worker; + /** @deprecated since v16.0.0 - use isPrimary. */ + readonly isMaster: boolean; + readonly isPrimary: boolean; + readonly isWorker: boolean; + schedulingPolicy: number; + readonly settings: ClusterSettings; + /** @deprecated since v16.0.0 - use setupPrimary. */ + setupMaster(settings?: ClusterSettings): void; + /** + * `setupPrimary` is used to change the default 'fork' behavior. Once called, the settings will be present in cluster.settings. + */ + setupPrimary(settings?: ClusterSettings): void; + readonly worker?: Worker | undefined; + readonly workers?: NodeJS.Dict | undefined; + readonly SCHED_NONE: number; + readonly SCHED_RR: number; + /** + * events.EventEmitter + * 1. disconnect + * 2. exit + * 3. fork + * 4. listening + * 5. message + * 6. online + * 7. setup + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: 'disconnect', listener: (worker: Worker) => void): this; + addListener(event: 'exit', listener: (worker: Worker, code: number, signal: string) => void): this; + addListener(event: 'fork', listener: (worker: Worker) => void): this; + addListener(event: 'listening', listener: (worker: Worker, address: Address) => void): this; + addListener(event: 'message', listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + addListener(event: 'online', listener: (worker: Worker) => void): this; + addListener(event: 'setup', listener: (settings: ClusterSettings) => void): this; + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: 'disconnect', worker: Worker): boolean; + emit(event: 'exit', worker: Worker, code: number, signal: string): boolean; + emit(event: 'fork', worker: Worker): boolean; + emit(event: 'listening', worker: Worker, address: Address): boolean; + emit(event: 'message', worker: Worker, message: any, handle: net.Socket | net.Server): boolean; + emit(event: 'online', worker: Worker): boolean; + emit(event: 'setup', settings: ClusterSettings): boolean; + on(event: string, listener: (...args: any[]) => void): this; + on(event: 'disconnect', listener: (worker: Worker) => void): this; + on(event: 'exit', listener: (worker: Worker, code: number, signal: string) => void): this; + on(event: 'fork', listener: (worker: Worker) => void): this; + on(event: 'listening', listener: (worker: Worker, address: Address) => void): this; + on(event: 'message', listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + on(event: 'online', listener: (worker: Worker) => void): this; + on(event: 'setup', listener: (settings: ClusterSettings) => void): this; + once(event: string, listener: (...args: any[]) => void): this; + once(event: 'disconnect', listener: (worker: Worker) => void): this; + once(event: 'exit', listener: (worker: Worker, code: number, signal: string) => void): this; + once(event: 'fork', listener: (worker: Worker) => void): this; + once(event: 'listening', listener: (worker: Worker, address: Address) => void): this; + once(event: 'message', listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + once(event: 'online', listener: (worker: Worker) => void): this; + once(event: 'setup', listener: (settings: ClusterSettings) => void): this; + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: 'disconnect', listener: (worker: Worker) => void): this; + prependListener(event: 'exit', listener: (worker: Worker, code: number, signal: string) => void): this; + prependListener(event: 'fork', listener: (worker: Worker) => void): this; + prependListener(event: 'listening', listener: (worker: Worker, address: Address) => void): this; + // the handle is a net.Socket or net.Server object, or undefined. + prependListener(event: 'message', listener: (worker: Worker, message: any, handle?: net.Socket | net.Server) => void): this; + prependListener(event: 'online', listener: (worker: Worker) => void): this; + prependListener(event: 'setup', listener: (settings: ClusterSettings) => void): this; + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'disconnect', listener: (worker: Worker) => void): this; + prependOnceListener(event: 'exit', listener: (worker: Worker, code: number, signal: string) => void): this; + prependOnceListener(event: 'fork', listener: (worker: Worker) => void): this; + prependOnceListener(event: 'listening', listener: (worker: Worker, address: Address) => void): this; + // the handle is a net.Socket or net.Server object, or undefined. + prependOnceListener(event: 'message', listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; + prependOnceListener(event: 'online', listener: (worker: Worker) => void): this; + prependOnceListener(event: 'setup', listener: (settings: ClusterSettings) => void): this; + } + const cluster: Cluster; + export default cluster; +} +declare module 'cluster' { + export * from 'node:cluster'; + export { default as default } from 'node:cluster'; +} diff --git a/node_modules/@types/node/ts4.8/console.d.ts b/node_modules/@types/node/ts4.8/console.d.ts new file mode 100644 index 0000000..7e35638 --- /dev/null +++ b/node_modules/@types/node/ts4.8/console.d.ts @@ -0,0 +1,412 @@ +/** + * The `node:console` module provides a simple debugging console that is similar to + * the JavaScript console mechanism provided by web browsers. + * + * The module exports two specific components: + * + * * A `Console` class with methods such as `console.log()`, `console.error()`, and`console.warn()` that can be used to write to any Node.js stream. + * * A global `console` instance configured to write to `process.stdout` and `process.stderr`. The global `console` can be used without calling`require('node:console')`. + * + * _**Warning**_: The global console object's methods are neither consistently + * synchronous like the browser APIs they resemble, nor are they consistently + * asynchronous like all other Node.js streams. See the `note on process I/O` for + * more information. + * + * Example using the global `console`: + * + * ```js + * console.log('hello world'); + * // Prints: hello world, to stdout + * console.log('hello %s', 'world'); + * // Prints: hello world, to stdout + * console.error(new Error('Whoops, something bad happened')); + * // Prints error message and stack trace to stderr: + * // Error: Whoops, something bad happened + * // at [eval]:5:15 + * // at Script.runInThisContext (node:vm:132:18) + * // at Object.runInThisContext (node:vm:309:38) + * // at node:internal/process/execution:77:19 + * // at [eval]-wrapper:6:22 + * // at evalScript (node:internal/process/execution:76:60) + * // at node:internal/main/eval_string:23:3 + * + * const name = 'Will Robinson'; + * console.warn(`Danger ${name}! Danger!`); + * // Prints: Danger Will Robinson! Danger!, to stderr + * ``` + * + * Example using the `Console` class: + * + * ```js + * const out = getStreamSomehow(); + * const err = getStreamSomehow(); + * const myConsole = new console.Console(out, err); + * + * myConsole.log('hello world'); + * // Prints: hello world, to out + * myConsole.log('hello %s', 'world'); + * // Prints: hello world, to out + * myConsole.error(new Error('Whoops, something bad happened')); + * // Prints: [Error: Whoops, something bad happened], to err + * + * const name = 'Will Robinson'; + * myConsole.warn(`Danger ${name}! Danger!`); + * // Prints: Danger Will Robinson! Danger!, to err + * ``` + * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/console.js) + */ +declare module 'console' { + import console = require('node:console'); + export = console; +} +declare module 'node:console' { + import { InspectOptions } from 'node:util'; + global { + // This needs to be global to avoid TS2403 in case lib.dom.d.ts is present in the same build + interface Console { + Console: console.ConsoleConstructor; + /** + * `console.assert()` writes a message if `value` is [falsy](https://developer.mozilla.org/en-US/docs/Glossary/Falsy) or omitted. It only + * writes a message and does not otherwise affect execution. The output always + * starts with `"Assertion failed"`. If provided, `message` is formatted using `util.format()`. + * + * If `value` is [truthy](https://developer.mozilla.org/en-US/docs/Glossary/Truthy), nothing happens. + * + * ```js + * console.assert(true, 'does nothing'); + * + * console.assert(false, 'Whoops %s work', 'didn\'t'); + * // Assertion failed: Whoops didn't work + * + * console.assert(); + * // Assertion failed + * ``` + * @since v0.1.101 + * @param value The value tested for being truthy. + * @param message All arguments besides `value` are used as error message. + */ + assert(value: any, message?: string, ...optionalParams: any[]): void; + /** + * When `stdout` is a TTY, calling `console.clear()` will attempt to clear the + * TTY. When `stdout` is not a TTY, this method does nothing. + * + * The specific operation of `console.clear()` can vary across operating systems + * and terminal types. For most Linux operating systems, `console.clear()`operates similarly to the `clear` shell command. On Windows, `console.clear()`will clear only the output in the + * current terminal viewport for the Node.js + * binary. + * @since v8.3.0 + */ + clear(): void; + /** + * Maintains an internal counter specific to `label` and outputs to `stdout` the + * number of times `console.count()` has been called with the given `label`. + * + * ```js + * > console.count() + * default: 1 + * undefined + * > console.count('default') + * default: 2 + * undefined + * > console.count('abc') + * abc: 1 + * undefined + * > console.count('xyz') + * xyz: 1 + * undefined + * > console.count('abc') + * abc: 2 + * undefined + * > console.count() + * default: 3 + * undefined + * > + * ``` + * @since v8.3.0 + * @param label The display label for the counter. + */ + count(label?: string): void; + /** + * Resets the internal counter specific to `label`. + * + * ```js + * > console.count('abc'); + * abc: 1 + * undefined + * > console.countReset('abc'); + * undefined + * > console.count('abc'); + * abc: 1 + * undefined + * > + * ``` + * @since v8.3.0 + * @param label The display label for the counter. + */ + countReset(label?: string): void; + /** + * The `console.debug()` function is an alias for {@link log}. + * @since v8.0.0 + */ + debug(message?: any, ...optionalParams: any[]): void; + /** + * Uses `util.inspect()` on `obj` and prints the resulting string to `stdout`. + * This function bypasses any custom `inspect()` function defined on `obj`. + * @since v0.1.101 + */ + dir(obj: any, options?: InspectOptions): void; + /** + * This method calls `console.log()` passing it the arguments received. + * This method does not produce any XML formatting. + * @since v8.0.0 + */ + dirxml(...data: any[]): void; + /** + * Prints to `stderr` with newline. Multiple arguments can be passed, with the + * first used as the primary message and all additional used as substitution + * values similar to [`printf(3)`](http://man7.org/linux/man-pages/man3/printf.3.html) (the arguments are all passed to `util.format()`). + * + * ```js + * const code = 5; + * console.error('error #%d', code); + * // Prints: error #5, to stderr + * console.error('error', code); + * // Prints: error 5, to stderr + * ``` + * + * If formatting elements (e.g. `%d`) are not found in the first string then `util.inspect()` is called on each argument and the resulting string + * values are concatenated. See `util.format()` for more information. + * @since v0.1.100 + */ + error(message?: any, ...optionalParams: any[]): void; + /** + * Increases indentation of subsequent lines by spaces for `groupIndentation`length. + * + * If one or more `label`s are provided, those are printed first without the + * additional indentation. + * @since v8.5.0 + */ + group(...label: any[]): void; + /** + * An alias for {@link group}. + * @since v8.5.0 + */ + groupCollapsed(...label: any[]): void; + /** + * Decreases indentation of subsequent lines by spaces for `groupIndentation`length. + * @since v8.5.0 + */ + groupEnd(): void; + /** + * The `console.info()` function is an alias for {@link log}. + * @since v0.1.100 + */ + info(message?: any, ...optionalParams: any[]): void; + /** + * Prints to `stdout` with newline. Multiple arguments can be passed, with the + * first used as the primary message and all additional used as substitution + * values similar to [`printf(3)`](http://man7.org/linux/man-pages/man3/printf.3.html) (the arguments are all passed to `util.format()`). + * + * ```js + * const count = 5; + * console.log('count: %d', count); + * // Prints: count: 5, to stdout + * console.log('count:', count); + * // Prints: count: 5, to stdout + * ``` + * + * See `util.format()` for more information. + * @since v0.1.100 + */ + log(message?: any, ...optionalParams: any[]): void; + /** + * Try to construct a table with the columns of the properties of `tabularData`(or use `properties`) and rows of `tabularData` and log it. Falls back to just + * logging the argument if it can’t be parsed as tabular. + * + * ```js + * // These can't be parsed as tabular data + * console.table(Symbol()); + * // Symbol() + * + * console.table(undefined); + * // undefined + * + * console.table([{ a: 1, b: 'Y' }, { a: 'Z', b: 2 }]); + * // ┌─────────┬─────┬─────┐ + * // │ (index) │ a │ b │ + * // ├─────────┼─────┼─────┤ + * // │ 0 │ 1 │ 'Y' │ + * // │ 1 │ 'Z' │ 2 │ + * // └─────────┴─────┴─────┘ + * + * console.table([{ a: 1, b: 'Y' }, { a: 'Z', b: 2 }], ['a']); + * // ┌─────────┬─────┐ + * // │ (index) │ a │ + * // ├─────────┼─────┤ + * // │ 0 │ 1 │ + * // │ 1 │ 'Z' │ + * // └─────────┴─────┘ + * ``` + * @since v10.0.0 + * @param properties Alternate properties for constructing the table. + */ + table(tabularData: any, properties?: ReadonlyArray): void; + /** + * Starts a timer that can be used to compute the duration of an operation. Timers + * are identified by a unique `label`. Use the same `label` when calling {@link timeEnd} to stop the timer and output the elapsed time in + * suitable time units to `stdout`. For example, if the elapsed + * time is 3869ms, `console.timeEnd()` displays "3.869s". + * @since v0.1.104 + */ + time(label?: string): void; + /** + * Stops a timer that was previously started by calling {@link time} and + * prints the result to `stdout`: + * + * ```js + * console.time('100-elements'); + * for (let i = 0; i < 100; i++) {} + * console.timeEnd('100-elements'); + * // prints 100-elements: 225.438ms + * ``` + * @since v0.1.104 + */ + timeEnd(label?: string): void; + /** + * For a timer that was previously started by calling {@link time}, prints + * the elapsed time and other `data` arguments to `stdout`: + * + * ```js + * console.time('process'); + * const value = expensiveProcess1(); // Returns 42 + * console.timeLog('process', value); + * // Prints "process: 365.227ms 42". + * doExpensiveProcess2(value); + * console.timeEnd('process'); + * ``` + * @since v10.7.0 + */ + timeLog(label?: string, ...data: any[]): void; + /** + * Prints to `stderr` the string `'Trace: '`, followed by the `util.format()` formatted message and stack trace to the current position in the code. + * + * ```js + * console.trace('Show me'); + * // Prints: (stack trace will vary based on where trace is called) + * // Trace: Show me + * // at repl:2:9 + * // at REPLServer.defaultEval (repl.js:248:27) + * // at bound (domain.js:287:14) + * // at REPLServer.runBound [as eval] (domain.js:300:12) + * // at REPLServer. (repl.js:412:12) + * // at emitOne (events.js:82:20) + * // at REPLServer.emit (events.js:169:7) + * // at REPLServer.Interface._onLine (readline.js:210:10) + * // at REPLServer.Interface._line (readline.js:549:8) + * // at REPLServer.Interface._ttyWrite (readline.js:826:14) + * ``` + * @since v0.1.104 + */ + trace(message?: any, ...optionalParams: any[]): void; + /** + * The `console.warn()` function is an alias for {@link error}. + * @since v0.1.100 + */ + warn(message?: any, ...optionalParams: any[]): void; + // --- Inspector mode only --- + /** + * This method does not display anything unless used in the inspector. + * Starts a JavaScript CPU profile with an optional label. + */ + profile(label?: string): void; + /** + * This method does not display anything unless used in the inspector. + * Stops the current JavaScript CPU profiling session if one has been started and prints the report to the Profiles panel of the inspector. + */ + profileEnd(label?: string): void; + /** + * This method does not display anything unless used in the inspector. + * Adds an event with the label `label` to the Timeline panel of the inspector. + */ + timeStamp(label?: string): void; + } + /** + * The `console` module provides a simple debugging console that is similar to the + * JavaScript console mechanism provided by web browsers. + * + * The module exports two specific components: + * + * * A `Console` class with methods such as `console.log()`, `console.error()` and`console.warn()` that can be used to write to any Node.js stream. + * * A global `console` instance configured to write to `process.stdout` and `process.stderr`. The global `console` can be used without calling`require('console')`. + * + * _**Warning**_: The global console object's methods are neither consistently + * synchronous like the browser APIs they resemble, nor are they consistently + * asynchronous like all other Node.js streams. See the `note on process I/O` for + * more information. + * + * Example using the global `console`: + * + * ```js + * console.log('hello world'); + * // Prints: hello world, to stdout + * console.log('hello %s', 'world'); + * // Prints: hello world, to stdout + * console.error(new Error('Whoops, something bad happened')); + * // Prints error message and stack trace to stderr: + * // Error: Whoops, something bad happened + * // at [eval]:5:15 + * // at Script.runInThisContext (node:vm:132:18) + * // at Object.runInThisContext (node:vm:309:38) + * // at node:internal/process/execution:77:19 + * // at [eval]-wrapper:6:22 + * // at evalScript (node:internal/process/execution:76:60) + * // at node:internal/main/eval_string:23:3 + * + * const name = 'Will Robinson'; + * console.warn(`Danger ${name}! Danger!`); + * // Prints: Danger Will Robinson! Danger!, to stderr + * ``` + * + * Example using the `Console` class: + * + * ```js + * const out = getStreamSomehow(); + * const err = getStreamSomehow(); + * const myConsole = new console.Console(out, err); + * + * myConsole.log('hello world'); + * // Prints: hello world, to out + * myConsole.log('hello %s', 'world'); + * // Prints: hello world, to out + * myConsole.error(new Error('Whoops, something bad happened')); + * // Prints: [Error: Whoops, something bad happened], to err + * + * const name = 'Will Robinson'; + * myConsole.warn(`Danger ${name}! Danger!`); + * // Prints: Danger Will Robinson! Danger!, to err + * ``` + * @see [source](https://github.com/nodejs/node/blob/v16.4.2/lib/console.js) + */ + namespace console { + interface ConsoleConstructorOptions { + stdout: NodeJS.WritableStream; + stderr?: NodeJS.WritableStream | undefined; + ignoreErrors?: boolean | undefined; + colorMode?: boolean | 'auto' | undefined; + inspectOptions?: InspectOptions | undefined; + /** + * Set group indentation + * @default 2 + */ + groupIndentation?: number | undefined; + } + interface ConsoleConstructor { + prototype: Console; + new (stdout: NodeJS.WritableStream, stderr?: NodeJS.WritableStream, ignoreErrors?: boolean): Console; + new (options: ConsoleConstructorOptions): Console; + } + } + var console: Console; + } + export = globalThis.console; +} diff --git a/node_modules/@types/node/ts4.8/constants.d.ts b/node_modules/@types/node/ts4.8/constants.d.ts new file mode 100644 index 0000000..d70cf3f --- /dev/null +++ b/node_modules/@types/node/ts4.8/constants.d.ts @@ -0,0 +1,18 @@ +/** @deprecated since v6.3.0 - use constants property exposed by the relevant module instead. */ +declare module 'node:constants' { + import { constants as osConstants, SignalConstants } from 'node:os'; + import { constants as cryptoConstants } from 'node:crypto'; + import { constants as fsConstants } from 'node:fs'; + + const exp: typeof osConstants.errno & + typeof osConstants.priority & + SignalConstants & + typeof cryptoConstants & + typeof fsConstants; + export = exp; +} + +declare module 'constants' { + import constants = require('node:constants'); + export = constants; +} diff --git a/node_modules/@types/node/ts4.8/crypto.d.ts b/node_modules/@types/node/ts4.8/crypto.d.ts new file mode 100644 index 0000000..e8d7868 --- /dev/null +++ b/node_modules/@types/node/ts4.8/crypto.d.ts @@ -0,0 +1,3977 @@ +/** + * The `node:crypto` module provides cryptographic functionality that includes a + * set of wrappers for OpenSSL's hash, HMAC, cipher, decipher, sign, and verify + * functions. + * + * ```js + * const { createHmac } = await import('node:crypto'); + * + * const secret = 'abcdefg'; + * const hash = createHmac('sha256', secret) + * .update('I love cupcakes') + * .digest('hex'); + * console.log(hash); + * // Prints: + * // c0fa1bc00531bd78ef38c628449c5102aeabd49b5dc3a2a516ea6ea959d6658e + * ``` + * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/crypto.js) + */ +declare module 'node:crypto' { + import * as stream from 'node:stream'; + import { PeerCertificate } from 'node:tls'; + /** + * SPKAC is a Certificate Signing Request mechanism originally implemented by + * Netscape and was specified formally as part of HTML5's `keygen` element. + * + * `` is deprecated since [HTML 5.2](https://www.w3.org/TR/html52/changes.html#features-removed) and new projects + * should not use this element anymore. + * + * The `node:crypto` module provides the `Certificate` class for working with SPKAC + * data. The most common usage is handling output generated by the HTML5`` element. Node.js uses [OpenSSL's SPKAC + * implementation](https://www.openssl.org/docs/man3.0/man1/openssl-spkac.html) internally. + * @since v0.11.8 + */ + class Certificate { + /** + * ```js + * const { Certificate } = await import('node:crypto'); + * const spkac = getSpkacSomehow(); + * const challenge = Certificate.exportChallenge(spkac); + * console.log(challenge.toString('utf8')); + * // Prints: the challenge as a UTF8 string + * ``` + * @since v9.0.0 + * @param encoding The `encoding` of the `spkac` string. + * @return The challenge component of the `spkac` data structure, which includes a public key and a challenge. + */ + static exportChallenge(spkac: BinaryLike): Buffer; + /** + * ```js + * const { Certificate } = await import('node:crypto'); + * const spkac = getSpkacSomehow(); + * const publicKey = Certificate.exportPublicKey(spkac); + * console.log(publicKey); + * // Prints: the public key as + * ``` + * @since v9.0.0 + * @param encoding The `encoding` of the `spkac` string. + * @return The public key component of the `spkac` data structure, which includes a public key and a challenge. + */ + static exportPublicKey(spkac: BinaryLike, encoding?: string): Buffer; + /** + * ```js + * import { Buffer } from 'node:buffer'; + * const { Certificate } = await import('node:crypto'); + * + * const spkac = getSpkacSomehow(); + * console.log(Certificate.verifySpkac(Buffer.from(spkac))); + * // Prints: true or false + * ``` + * @since v9.0.0 + * @param encoding The `encoding` of the `spkac` string. + * @return `true` if the given `spkac` data structure is valid, `false` otherwise. + */ + static verifySpkac(spkac: NodeJS.ArrayBufferView): boolean; + /** + * @deprecated + * @param spkac + * @returns The challenge component of the `spkac` data structure, + * which includes a public key and a challenge. + */ + exportChallenge(spkac: BinaryLike): Buffer; + /** + * @deprecated + * @param spkac + * @param encoding The encoding of the spkac string. + * @returns The public key component of the `spkac` data structure, + * which includes a public key and a challenge. + */ + exportPublicKey(spkac: BinaryLike, encoding?: string): Buffer; + /** + * @deprecated + * @param spkac + * @returns `true` if the given `spkac` data structure is valid, + * `false` otherwise. + */ + verifySpkac(spkac: NodeJS.ArrayBufferView): boolean; + } + namespace constants { + // https://nodejs.org/dist/latest-v20.x/docs/api/crypto.html#crypto-constants + const OPENSSL_VERSION_NUMBER: number; + /** Applies multiple bug workarounds within OpenSSL. See https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html for detail. */ + const SSL_OP_ALL: number; + /** Allows legacy insecure renegotiation between OpenSSL and unpatched clients or servers. See https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html. */ + const SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION: number; + /** Attempts to use the server's preferences instead of the client's when selecting a cipher. See https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html. */ + const SSL_OP_CIPHER_SERVER_PREFERENCE: number; + /** Instructs OpenSSL to use Cisco's "speshul" version of DTLS_BAD_VER. */ + const SSL_OP_CISCO_ANYCONNECT: number; + /** Instructs OpenSSL to turn on cookie exchange. */ + const SSL_OP_COOKIE_EXCHANGE: number; + /** Instructs OpenSSL to add server-hello extension from an early version of the cryptopro draft. */ + const SSL_OP_CRYPTOPRO_TLSEXT_BUG: number; + /** Instructs OpenSSL to disable a SSL 3.0/TLS 1.0 vulnerability workaround added in OpenSSL 0.9.6d. */ + const SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS: number; + /** Allows initial connection to servers that do not support RI. */ + const SSL_OP_LEGACY_SERVER_CONNECT: number; + /** Instructs OpenSSL to disable support for SSL/TLS compression. */ + const SSL_OP_NO_COMPRESSION: number; + const SSL_OP_NO_QUERY_MTU: number; + /** Instructs OpenSSL to always start a new session when performing renegotiation. */ + const SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION: number; + const SSL_OP_NO_SSLv2: number; + const SSL_OP_NO_SSLv3: number; + const SSL_OP_NO_TICKET: number; + const SSL_OP_NO_TLSv1: number; + const SSL_OP_NO_TLSv1_1: number; + const SSL_OP_NO_TLSv1_2: number; + /** Instructs OpenSSL to disable version rollback attack detection. */ + const SSL_OP_TLS_ROLLBACK_BUG: number; + const ENGINE_METHOD_RSA: number; + const ENGINE_METHOD_DSA: number; + const ENGINE_METHOD_DH: number; + const ENGINE_METHOD_RAND: number; + const ENGINE_METHOD_EC: number; + const ENGINE_METHOD_CIPHERS: number; + const ENGINE_METHOD_DIGESTS: number; + const ENGINE_METHOD_PKEY_METHS: number; + const ENGINE_METHOD_PKEY_ASN1_METHS: number; + const ENGINE_METHOD_ALL: number; + const ENGINE_METHOD_NONE: number; + const DH_CHECK_P_NOT_SAFE_PRIME: number; + const DH_CHECK_P_NOT_PRIME: number; + const DH_UNABLE_TO_CHECK_GENERATOR: number; + const DH_NOT_SUITABLE_GENERATOR: number; + const RSA_PKCS1_PADDING: number; + const RSA_SSLV23_PADDING: number; + const RSA_NO_PADDING: number; + const RSA_PKCS1_OAEP_PADDING: number; + const RSA_X931_PADDING: number; + const RSA_PKCS1_PSS_PADDING: number; + /** Sets the salt length for RSA_PKCS1_PSS_PADDING to the digest size when signing or verifying. */ + const RSA_PSS_SALTLEN_DIGEST: number; + /** Sets the salt length for RSA_PKCS1_PSS_PADDING to the maximum permissible value when signing data. */ + const RSA_PSS_SALTLEN_MAX_SIGN: number; + /** Causes the salt length for RSA_PKCS1_PSS_PADDING to be determined automatically when verifying a signature. */ + const RSA_PSS_SALTLEN_AUTO: number; + const POINT_CONVERSION_COMPRESSED: number; + const POINT_CONVERSION_UNCOMPRESSED: number; + const POINT_CONVERSION_HYBRID: number; + /** Specifies the built-in default cipher list used by Node.js (colon-separated values). */ + const defaultCoreCipherList: string; + /** Specifies the active default cipher list used by the current Node.js process (colon-separated values). */ + const defaultCipherList: string; + } + interface HashOptions extends stream.TransformOptions { + /** + * For XOF hash functions such as `shake256`, the + * outputLength option can be used to specify the desired output length in bytes. + */ + outputLength?: number | undefined; + } + /** @deprecated since v10.0.0 */ + const fips: boolean; + /** + * Creates and returns a `Hash` object that can be used to generate hash digests + * using the given `algorithm`. Optional `options` argument controls stream + * behavior. For XOF hash functions such as `'shake256'`, the `outputLength` option + * can be used to specify the desired output length in bytes. + * + * The `algorithm` is dependent on the available algorithms supported by the + * version of OpenSSL on the platform. Examples are `'sha256'`, `'sha512'`, etc. + * On recent releases of OpenSSL, `openssl list -digest-algorithms` will + * display the available digest algorithms. + * + * Example: generating the sha256 sum of a file + * + * ```js + * import { + * createReadStream, + * } from 'node:fs'; + * import { argv } from 'node:process'; + * const { + * createHash, + * } = await import('node:crypto'); + * + * const filename = argv[2]; + * + * const hash = createHash('sha256'); + * + * const input = createReadStream(filename); + * input.on('readable', () => { + * // Only one element is going to be produced by the + * // hash stream. + * const data = input.read(); + * if (data) + * hash.update(data); + * else { + * console.log(`${hash.digest('hex')} ${filename}`); + * } + * }); + * ``` + * @since v0.1.92 + * @param options `stream.transform` options + */ + function createHash(algorithm: string, options?: HashOptions): Hash; + /** + * Creates and returns an `Hmac` object that uses the given `algorithm` and `key`. + * Optional `options` argument controls stream behavior. + * + * The `algorithm` is dependent on the available algorithms supported by the + * version of OpenSSL on the platform. Examples are `'sha256'`, `'sha512'`, etc. + * On recent releases of OpenSSL, `openssl list -digest-algorithms` will + * display the available digest algorithms. + * + * The `key` is the HMAC key used to generate the cryptographic HMAC hash. If it is + * a `KeyObject`, its type must be `secret`. If it is a string, please consider `caveats when using strings as inputs to cryptographic APIs`. If it was + * obtained from a cryptographically secure source of entropy, such as {@link randomBytes} or {@link generateKey}, its length should not + * exceed the block size of `algorithm` (e.g., 512 bits for SHA-256). + * + * Example: generating the sha256 HMAC of a file + * + * ```js + * import { + * createReadStream, + * } from 'node:fs'; + * import { argv } from 'node:process'; + * const { + * createHmac, + * } = await import('node:crypto'); + * + * const filename = argv[2]; + * + * const hmac = createHmac('sha256', 'a secret'); + * + * const input = createReadStream(filename); + * input.on('readable', () => { + * // Only one element is going to be produced by the + * // hash stream. + * const data = input.read(); + * if (data) + * hmac.update(data); + * else { + * console.log(`${hmac.digest('hex')} ${filename}`); + * } + * }); + * ``` + * @since v0.1.94 + * @param options `stream.transform` options + */ + function createHmac(algorithm: string, key: BinaryLike | KeyObject, options?: stream.TransformOptions): Hmac; + // https://nodejs.org/api/buffer.html#buffer_buffers_and_character_encodings + type BinaryToTextEncoding = 'base64' | 'base64url' | 'hex' | 'binary'; + type CharacterEncoding = 'utf8' | 'utf-8' | 'utf16le' | 'latin1'; + type LegacyCharacterEncoding = 'ascii' | 'binary' | 'ucs2' | 'ucs-2'; + type Encoding = BinaryToTextEncoding | CharacterEncoding | LegacyCharacterEncoding; + type ECDHKeyFormat = 'compressed' | 'uncompressed' | 'hybrid'; + /** + * The `Hash` class is a utility for creating hash digests of data. It can be + * used in one of two ways: + * + * * As a `stream` that is both readable and writable, where data is written + * to produce a computed hash digest on the readable side, or + * * Using the `hash.update()` and `hash.digest()` methods to produce the + * computed hash. + * + * The {@link createHash} method is used to create `Hash` instances. `Hash`objects are not to be created directly using the `new` keyword. + * + * Example: Using `Hash` objects as streams: + * + * ```js + * const { + * createHash, + * } = await import('node:crypto'); + * + * const hash = createHash('sha256'); + * + * hash.on('readable', () => { + * // Only one element is going to be produced by the + * // hash stream. + * const data = hash.read(); + * if (data) { + * console.log(data.toString('hex')); + * // Prints: + * // 6a2da20943931e9834fc12cfe5bb47bbd9ae43489a30726962b576f4e3993e50 + * } + * }); + * + * hash.write('some data to hash'); + * hash.end(); + * ``` + * + * Example: Using `Hash` and piped streams: + * + * ```js + * import { createReadStream } from 'node:fs'; + * import { stdout } from 'node:process'; + * const { createHash } = await import('node:crypto'); + * + * const hash = createHash('sha256'); + * + * const input = createReadStream('test.js'); + * input.pipe(hash).setEncoding('hex').pipe(stdout); + * ``` + * + * Example: Using the `hash.update()` and `hash.digest()` methods: + * + * ```js + * const { + * createHash, + * } = await import('node:crypto'); + * + * const hash = createHash('sha256'); + * + * hash.update('some data to hash'); + * console.log(hash.digest('hex')); + * // Prints: + * // 6a2da20943931e9834fc12cfe5bb47bbd9ae43489a30726962b576f4e3993e50 + * ``` + * @since v0.1.92 + */ + class Hash extends stream.Transform { + private constructor(); + /** + * Creates a new `Hash` object that contains a deep copy of the internal state + * of the current `Hash` object. + * + * The optional `options` argument controls stream behavior. For XOF hash + * functions such as `'shake256'`, the `outputLength` option can be used to + * specify the desired output length in bytes. + * + * An error is thrown when an attempt is made to copy the `Hash` object after + * its `hash.digest()` method has been called. + * + * ```js + * // Calculate a rolling hash. + * const { + * createHash, + * } = await import('node:crypto'); + * + * const hash = createHash('sha256'); + * + * hash.update('one'); + * console.log(hash.copy().digest('hex')); + * + * hash.update('two'); + * console.log(hash.copy().digest('hex')); + * + * hash.update('three'); + * console.log(hash.copy().digest('hex')); + * + * // Etc. + * ``` + * @since v13.1.0 + * @param options `stream.transform` options + */ + copy(options?: stream.TransformOptions): Hash; + /** + * Updates the hash content with the given `data`, the encoding of which + * is given in `inputEncoding`. + * If `encoding` is not provided, and the `data` is a string, an + * encoding of `'utf8'` is enforced. If `data` is a `Buffer`, `TypedArray`, or`DataView`, then `inputEncoding` is ignored. + * + * This can be called many times with new data as it is streamed. + * @since v0.1.92 + * @param inputEncoding The `encoding` of the `data` string. + */ + update(data: BinaryLike): Hash; + update(data: string, inputEncoding: Encoding): Hash; + /** + * Calculates the digest of all of the data passed to be hashed (using the `hash.update()` method). + * If `encoding` is provided a string will be returned; otherwise + * a `Buffer` is returned. + * + * The `Hash` object can not be used again after `hash.digest()` method has been + * called. Multiple calls will cause an error to be thrown. + * @since v0.1.92 + * @param encoding The `encoding` of the return value. + */ + digest(): Buffer; + digest(encoding: BinaryToTextEncoding): string; + } + /** + * The `Hmac` class is a utility for creating cryptographic HMAC digests. It can + * be used in one of two ways: + * + * * As a `stream` that is both readable and writable, where data is written + * to produce a computed HMAC digest on the readable side, or + * * Using the `hmac.update()` and `hmac.digest()` methods to produce the + * computed HMAC digest. + * + * The {@link createHmac} method is used to create `Hmac` instances. `Hmac`objects are not to be created directly using the `new` keyword. + * + * Example: Using `Hmac` objects as streams: + * + * ```js + * const { + * createHmac, + * } = await import('node:crypto'); + * + * const hmac = createHmac('sha256', 'a secret'); + * + * hmac.on('readable', () => { + * // Only one element is going to be produced by the + * // hash stream. + * const data = hmac.read(); + * if (data) { + * console.log(data.toString('hex')); + * // Prints: + * // 7fd04df92f636fd450bc841c9418e5825c17f33ad9c87c518115a45971f7f77e + * } + * }); + * + * hmac.write('some data to hash'); + * hmac.end(); + * ``` + * + * Example: Using `Hmac` and piped streams: + * + * ```js + * import { createReadStream } from 'node:fs'; + * import { stdout } from 'node:process'; + * const { + * createHmac, + * } = await import('node:crypto'); + * + * const hmac = createHmac('sha256', 'a secret'); + * + * const input = createReadStream('test.js'); + * input.pipe(hmac).pipe(stdout); + * ``` + * + * Example: Using the `hmac.update()` and `hmac.digest()` methods: + * + * ```js + * const { + * createHmac, + * } = await import('node:crypto'); + * + * const hmac = createHmac('sha256', 'a secret'); + * + * hmac.update('some data to hash'); + * console.log(hmac.digest('hex')); + * // Prints: + * // 7fd04df92f636fd450bc841c9418e5825c17f33ad9c87c518115a45971f7f77e + * ``` + * @since v0.1.94 + */ + class Hmac extends stream.Transform { + private constructor(); + /** + * Updates the `Hmac` content with the given `data`, the encoding of which + * is given in `inputEncoding`. + * If `encoding` is not provided, and the `data` is a string, an + * encoding of `'utf8'` is enforced. If `data` is a `Buffer`, `TypedArray`, or`DataView`, then `inputEncoding` is ignored. + * + * This can be called many times with new data as it is streamed. + * @since v0.1.94 + * @param inputEncoding The `encoding` of the `data` string. + */ + update(data: BinaryLike): Hmac; + update(data: string, inputEncoding: Encoding): Hmac; + /** + * Calculates the HMAC digest of all of the data passed using `hmac.update()`. + * If `encoding` is + * provided a string is returned; otherwise a `Buffer` is returned; + * + * The `Hmac` object can not be used again after `hmac.digest()` has been + * called. Multiple calls to `hmac.digest()` will result in an error being thrown. + * @since v0.1.94 + * @param encoding The `encoding` of the return value. + */ + digest(): Buffer; + digest(encoding: BinaryToTextEncoding): string; + } + type KeyObjectType = 'secret' | 'public' | 'private'; + interface KeyExportOptions { + type: 'pkcs1' | 'spki' | 'pkcs8' | 'sec1'; + format: T; + cipher?: string | undefined; + passphrase?: string | Buffer | undefined; + } + interface JwkKeyExportOptions { + format: 'jwk'; + } + interface JsonWebKey { + crv?: string | undefined; + d?: string | undefined; + dp?: string | undefined; + dq?: string | undefined; + e?: string | undefined; + k?: string | undefined; + kty?: string | undefined; + n?: string | undefined; + p?: string | undefined; + q?: string | undefined; + qi?: string | undefined; + x?: string | undefined; + y?: string | undefined; + [key: string]: unknown; + } + interface AsymmetricKeyDetails { + /** + * Key size in bits (RSA, DSA). + */ + modulusLength?: number | undefined; + /** + * Public exponent (RSA). + */ + publicExponent?: bigint | undefined; + /** + * Name of the message digest (RSA-PSS). + */ + hashAlgorithm?: string | undefined; + /** + * Name of the message digest used by MGF1 (RSA-PSS). + */ + mgf1HashAlgorithm?: string | undefined; + /** + * Minimal salt length in bytes (RSA-PSS). + */ + saltLength?: number | undefined; + /** + * Size of q in bits (DSA). + */ + divisorLength?: number | undefined; + /** + * Name of the curve (EC). + */ + namedCurve?: string | undefined; + } + /** + * Node.js uses a `KeyObject` class to represent a symmetric or asymmetric key, + * and each kind of key exposes different functions. The {@link createSecretKey}, {@link createPublicKey} and {@link createPrivateKey} methods are used to create `KeyObject`instances. `KeyObject` + * objects are not to be created directly using the `new`keyword. + * + * Most applications should consider using the new `KeyObject` API instead of + * passing keys as strings or `Buffer`s due to improved security features. + * + * `KeyObject` instances can be passed to other threads via `postMessage()`. + * The receiver obtains a cloned `KeyObject`, and the `KeyObject` does not need to + * be listed in the `transferList` argument. + * @since v11.6.0 + */ + class KeyObject { + private constructor(); + /** + * Example: Converting a `CryptoKey` instance to a `KeyObject`: + * + * ```js + * const { KeyObject } = await import('node:crypto'); + * const { subtle } = globalThis.crypto; + * + * const key = await subtle.generateKey({ + * name: 'HMAC', + * hash: 'SHA-256', + * length: 256, + * }, true, ['sign', 'verify']); + * + * const keyObject = KeyObject.from(key); + * console.log(keyObject.symmetricKeySize); + * // Prints: 32 (symmetric key size in bytes) + * ``` + * @since v15.0.0 + */ + static from(key: webcrypto.CryptoKey): KeyObject; + /** + * For asymmetric keys, this property represents the type of the key. Supported key + * types are: + * + * * `'rsa'` (OID 1.2.840.113549.1.1.1) + * * `'rsa-pss'` (OID 1.2.840.113549.1.1.10) + * * `'dsa'` (OID 1.2.840.10040.4.1) + * * `'ec'` (OID 1.2.840.10045.2.1) + * * `'x25519'` (OID 1.3.101.110) + * * `'x448'` (OID 1.3.101.111) + * * `'ed25519'` (OID 1.3.101.112) + * * `'ed448'` (OID 1.3.101.113) + * * `'dh'` (OID 1.2.840.113549.1.3.1) + * + * This property is `undefined` for unrecognized `KeyObject` types and symmetric + * keys. + * @since v11.6.0 + */ + asymmetricKeyType?: KeyType | undefined; + /** + * For asymmetric keys, this property represents the size of the embedded key in + * bytes. This property is `undefined` for symmetric keys. + */ + asymmetricKeySize?: number | undefined; + /** + * This property exists only on asymmetric keys. Depending on the type of the key, + * this object contains information about the key. None of the information obtained + * through this property can be used to uniquely identify a key or to compromise + * the security of the key. + * + * For RSA-PSS keys, if the key material contains a `RSASSA-PSS-params` sequence, + * the `hashAlgorithm`, `mgf1HashAlgorithm`, and `saltLength` properties will be + * set. + * + * Other key details might be exposed via this API using additional attributes. + * @since v15.7.0 + */ + asymmetricKeyDetails?: AsymmetricKeyDetails | undefined; + /** + * For symmetric keys, the following encoding options can be used: + * + * For public keys, the following encoding options can be used: + * + * For private keys, the following encoding options can be used: + * + * The result type depends on the selected encoding format, when PEM the + * result is a string, when DER it will be a buffer containing the data + * encoded as DER, when [JWK](https://tools.ietf.org/html/rfc7517) it will be an object. + * + * When [JWK](https://tools.ietf.org/html/rfc7517) encoding format was selected, all other encoding options are + * ignored. + * + * PKCS#1, SEC1, and PKCS#8 type keys can be encrypted by using a combination of + * the `cipher` and `format` options. The PKCS#8 `type` can be used with any`format` to encrypt any key algorithm (RSA, EC, or DH) by specifying a`cipher`. PKCS#1 and SEC1 can only be + * encrypted by specifying a `cipher`when the PEM `format` is used. For maximum compatibility, use PKCS#8 for + * encrypted private keys. Since PKCS#8 defines its own + * encryption mechanism, PEM-level encryption is not supported when encrypting + * a PKCS#8 key. See [RFC 5208](https://www.rfc-editor.org/rfc/rfc5208.txt) for PKCS#8 encryption and [RFC 1421](https://www.rfc-editor.org/rfc/rfc1421.txt) for + * PKCS#1 and SEC1 encryption. + * @since v11.6.0 + */ + export(options: KeyExportOptions<'pem'>): string | Buffer; + export(options?: KeyExportOptions<'der'>): Buffer; + export(options?: JwkKeyExportOptions): JsonWebKey; + /** + * For secret keys, this property represents the size of the key in bytes. This + * property is `undefined` for asymmetric keys. + * @since v11.6.0 + */ + symmetricKeySize?: number | undefined; + /** + * Depending on the type of this `KeyObject`, this property is either`'secret'` for secret (symmetric) keys, `'public'` for public (asymmetric) keys + * or `'private'` for private (asymmetric) keys. + * @since v11.6.0 + */ + type: KeyObjectType; + } + type CipherCCMTypes = 'aes-128-ccm' | 'aes-192-ccm' | 'aes-256-ccm' | 'chacha20-poly1305'; + type CipherGCMTypes = 'aes-128-gcm' | 'aes-192-gcm' | 'aes-256-gcm'; + type CipherOCBTypes = 'aes-128-ocb' | 'aes-192-ocb' | 'aes-256-ocb'; + type BinaryLike = string | NodeJS.ArrayBufferView; + type CipherKey = BinaryLike | KeyObject; + interface CipherCCMOptions extends stream.TransformOptions { + authTagLength: number; + } + interface CipherGCMOptions extends stream.TransformOptions { + authTagLength?: number | undefined; + } + interface CipherOCBOptions extends stream.TransformOptions { + authTagLength: number; + } + /** + * Creates and returns a `Cipher` object that uses the given `algorithm` and`password`. + * + * The `options` argument controls stream behavior and is optional except when a + * cipher in CCM or OCB mode (e.g. `'aes-128-ccm'`) is used. In that case, the`authTagLength` option is required and specifies the length of the + * authentication tag in bytes, see `CCM mode`. In GCM mode, the `authTagLength`option is not required but can be used to set the length of the authentication + * tag that will be returned by `getAuthTag()` and defaults to 16 bytes. + * For `chacha20-poly1305`, the `authTagLength` option defaults to 16 bytes. + * + * The `algorithm` is dependent on OpenSSL, examples are `'aes192'`, etc. On + * recent OpenSSL releases, `openssl list -cipher-algorithms` will + * display the available cipher algorithms. + * + * The `password` is used to derive the cipher key and initialization vector (IV). + * The value must be either a `'latin1'` encoded string, a `Buffer`, a`TypedArray`, or a `DataView`. + * + * **This function is semantically insecure for all** + * **supported ciphers and fatally flawed for ciphers in counter mode (such as CTR,** + * **GCM, or CCM).** + * + * The implementation of `crypto.createCipher()` derives keys using the OpenSSL + * function [`EVP_BytesToKey`](https://www.openssl.org/docs/man3.0/man3/EVP_BytesToKey.html) with the digest algorithm set to MD5, one + * iteration, and no salt. The lack of salt allows dictionary attacks as the same + * password always creates the same key. The low iteration count and + * non-cryptographically secure hash algorithm allow passwords to be tested very + * rapidly. + * + * In line with OpenSSL's recommendation to use a more modern algorithm instead of [`EVP_BytesToKey`](https://www.openssl.org/docs/man3.0/man3/EVP_BytesToKey.html) it is recommended that + * developers derive a key and IV on + * their own using {@link scrypt} and to use {@link createCipheriv} to create the `Cipher` object. Users should not use ciphers with counter mode + * (e.g. CTR, GCM, or CCM) in `crypto.createCipher()`. A warning is emitted when + * they are used in order to avoid the risk of IV reuse that causes + * vulnerabilities. For the case when IV is reused in GCM, see [Nonce-Disrespecting Adversaries](https://github.com/nonce-disrespect/nonce-disrespect) for details. + * @since v0.1.94 + * @deprecated Since v10.0.0 - Use {@link createCipheriv} instead. + * @param options `stream.transform` options + */ + function createCipher(algorithm: CipherCCMTypes, password: BinaryLike, options: CipherCCMOptions): CipherCCM; + /** @deprecated since v10.0.0 use `createCipheriv()` */ + function createCipher(algorithm: CipherGCMTypes, password: BinaryLike, options?: CipherGCMOptions): CipherGCM; + /** @deprecated since v10.0.0 use `createCipheriv()` */ + function createCipher(algorithm: string, password: BinaryLike, options?: stream.TransformOptions): Cipher; + /** + * Creates and returns a `Cipher` object, with the given `algorithm`, `key` and + * initialization vector (`iv`). + * + * The `options` argument controls stream behavior and is optional except when a + * cipher in CCM or OCB mode (e.g. `'aes-128-ccm'`) is used. In that case, the`authTagLength` option is required and specifies the length of the + * authentication tag in bytes, see `CCM mode`. In GCM mode, the `authTagLength`option is not required but can be used to set the length of the authentication + * tag that will be returned by `getAuthTag()` and defaults to 16 bytes. + * For `chacha20-poly1305`, the `authTagLength` option defaults to 16 bytes. + * + * The `algorithm` is dependent on OpenSSL, examples are `'aes192'`, etc. On + * recent OpenSSL releases, `openssl list -cipher-algorithms` will + * display the available cipher algorithms. + * + * The `key` is the raw key used by the `algorithm` and `iv` is an [initialization vector](https://en.wikipedia.org/wiki/Initialization_vector). Both arguments must be `'utf8'` encoded + * strings,`Buffers`, `TypedArray`, or `DataView`s. The `key` may optionally be + * a `KeyObject` of type `secret`. If the cipher does not need + * an initialization vector, `iv` may be `null`. + * + * When passing strings for `key` or `iv`, please consider `caveats when using strings as inputs to cryptographic APIs`. + * + * Initialization vectors should be unpredictable and unique; ideally, they will be + * cryptographically random. They do not have to be secret: IVs are typically just + * added to ciphertext messages unencrypted. It may sound contradictory that + * something has to be unpredictable and unique, but does not have to be secret; + * remember that an attacker must not be able to predict ahead of time what a + * given IV will be. + * @since v0.1.94 + * @param options `stream.transform` options + */ + function createCipheriv(algorithm: CipherCCMTypes, key: CipherKey, iv: BinaryLike, options: CipherCCMOptions): CipherCCM; + function createCipheriv(algorithm: CipherOCBTypes, key: CipherKey, iv: BinaryLike, options: CipherOCBOptions): CipherOCB; + function createCipheriv(algorithm: CipherGCMTypes, key: CipherKey, iv: BinaryLike, options?: CipherGCMOptions): CipherGCM; + function createCipheriv(algorithm: string, key: CipherKey, iv: BinaryLike | null, options?: stream.TransformOptions): Cipher; + /** + * Instances of the `Cipher` class are used to encrypt data. The class can be + * used in one of two ways: + * + * * As a `stream` that is both readable and writable, where plain unencrypted + * data is written to produce encrypted data on the readable side, or + * * Using the `cipher.update()` and `cipher.final()` methods to produce + * the encrypted data. + * + * The {@link createCipher} or {@link createCipheriv} methods are + * used to create `Cipher` instances. `Cipher` objects are not to be created + * directly using the `new` keyword. + * + * Example: Using `Cipher` objects as streams: + * + * ```js + * const { + * scrypt, + * randomFill, + * createCipheriv, + * } = await import('node:crypto'); + * + * const algorithm = 'aes-192-cbc'; + * const password = 'Password used to generate key'; + * + * // First, we'll generate the key. The key length is dependent on the algorithm. + * // In this case for aes192, it is 24 bytes (192 bits). + * scrypt(password, 'salt', 24, (err, key) => { + * if (err) throw err; + * // Then, we'll generate a random initialization vector + * randomFill(new Uint8Array(16), (err, iv) => { + * if (err) throw err; + * + * // Once we have the key and iv, we can create and use the cipher... + * const cipher = createCipheriv(algorithm, key, iv); + * + * let encrypted = ''; + * cipher.setEncoding('hex'); + * + * cipher.on('data', (chunk) => encrypted += chunk); + * cipher.on('end', () => console.log(encrypted)); + * + * cipher.write('some clear text data'); + * cipher.end(); + * }); + * }); + * ``` + * + * Example: Using `Cipher` and piped streams: + * + * ```js + * import { + * createReadStream, + * createWriteStream, + * } from 'node:fs'; + * + * import { + * pipeline, + * } from 'node:stream'; + * + * const { + * scrypt, + * randomFill, + * createCipheriv, + * } = await import('node:crypto'); + * + * const algorithm = 'aes-192-cbc'; + * const password = 'Password used to generate key'; + * + * // First, we'll generate the key. The key length is dependent on the algorithm. + * // In this case for aes192, it is 24 bytes (192 bits). + * scrypt(password, 'salt', 24, (err, key) => { + * if (err) throw err; + * // Then, we'll generate a random initialization vector + * randomFill(new Uint8Array(16), (err, iv) => { + * if (err) throw err; + * + * const cipher = createCipheriv(algorithm, key, iv); + * + * const input = createReadStream('test.js'); + * const output = createWriteStream('test.enc'); + * + * pipeline(input, cipher, output, (err) => { + * if (err) throw err; + * }); + * }); + * }); + * ``` + * + * Example: Using the `cipher.update()` and `cipher.final()` methods: + * + * ```js + * const { + * scrypt, + * randomFill, + * createCipheriv, + * } = await import('node:crypto'); + * + * const algorithm = 'aes-192-cbc'; + * const password = 'Password used to generate key'; + * + * // First, we'll generate the key. The key length is dependent on the algorithm. + * // In this case for aes192, it is 24 bytes (192 bits). + * scrypt(password, 'salt', 24, (err, key) => { + * if (err) throw err; + * // Then, we'll generate a random initialization vector + * randomFill(new Uint8Array(16), (err, iv) => { + * if (err) throw err; + * + * const cipher = createCipheriv(algorithm, key, iv); + * + * let encrypted = cipher.update('some clear text data', 'utf8', 'hex'); + * encrypted += cipher.final('hex'); + * console.log(encrypted); + * }); + * }); + * ``` + * @since v0.1.94 + */ + class Cipher extends stream.Transform { + private constructor(); + /** + * Updates the cipher with `data`. If the `inputEncoding` argument is given, + * the `data`argument is a string using the specified encoding. If the `inputEncoding`argument is not given, `data` must be a `Buffer`, `TypedArray`, or`DataView`. If `data` is a `Buffer`, + * `TypedArray`, or `DataView`, then`inputEncoding` is ignored. + * + * The `outputEncoding` specifies the output format of the enciphered + * data. If the `outputEncoding`is specified, a string using the specified encoding is returned. If no`outputEncoding` is provided, a `Buffer` is returned. + * + * The `cipher.update()` method can be called multiple times with new data until `cipher.final()` is called. Calling `cipher.update()` after `cipher.final()` will result in an error being + * thrown. + * @since v0.1.94 + * @param inputEncoding The `encoding` of the data. + * @param outputEncoding The `encoding` of the return value. + */ + update(data: BinaryLike): Buffer; + update(data: string, inputEncoding: Encoding): Buffer; + update(data: NodeJS.ArrayBufferView, inputEncoding: undefined, outputEncoding: Encoding): string; + update(data: string, inputEncoding: Encoding | undefined, outputEncoding: Encoding): string; + /** + * Once the `cipher.final()` method has been called, the `Cipher` object can no + * longer be used to encrypt data. Attempts to call `cipher.final()` more than + * once will result in an error being thrown. + * @since v0.1.94 + * @param outputEncoding The `encoding` of the return value. + * @return Any remaining enciphered contents. If `outputEncoding` is specified, a string is returned. If an `outputEncoding` is not provided, a {@link Buffer} is returned. + */ + final(): Buffer; + final(outputEncoding: BufferEncoding): string; + /** + * When using block encryption algorithms, the `Cipher` class will automatically + * add padding to the input data to the appropriate block size. To disable the + * default padding call `cipher.setAutoPadding(false)`. + * + * When `autoPadding` is `false`, the length of the entire input data must be a + * multiple of the cipher's block size or `cipher.final()` will throw an error. + * Disabling automatic padding is useful for non-standard padding, for instance + * using `0x0` instead of PKCS padding. + * + * The `cipher.setAutoPadding()` method must be called before `cipher.final()`. + * @since v0.7.1 + * @param [autoPadding=true] + * @return for method chaining. + */ + setAutoPadding(autoPadding?: boolean): this; + } + interface CipherCCM extends Cipher { + setAAD( + buffer: NodeJS.ArrayBufferView, + options: { + plaintextLength: number; + } + ): this; + getAuthTag(): Buffer; + } + interface CipherGCM extends Cipher { + setAAD( + buffer: NodeJS.ArrayBufferView, + options?: { + plaintextLength: number; + } + ): this; + getAuthTag(): Buffer; + } + interface CipherOCB extends Cipher { + setAAD( + buffer: NodeJS.ArrayBufferView, + options?: { + plaintextLength: number; + } + ): this; + getAuthTag(): Buffer; + } + /** + * Creates and returns a `Decipher` object that uses the given `algorithm` and`password` (key). + * + * The `options` argument controls stream behavior and is optional except when a + * cipher in CCM or OCB mode (e.g. `'aes-128-ccm'`) is used. In that case, the`authTagLength` option is required and specifies the length of the + * authentication tag in bytes, see `CCM mode`. + * For `chacha20-poly1305`, the `authTagLength` option defaults to 16 bytes. + * + * **This function is semantically insecure for all** + * **supported ciphers and fatally flawed for ciphers in counter mode (such as CTR,** + * **GCM, or CCM).** + * + * The implementation of `crypto.createDecipher()` derives keys using the OpenSSL + * function [`EVP_BytesToKey`](https://www.openssl.org/docs/man3.0/man3/EVP_BytesToKey.html) with the digest algorithm set to MD5, one + * iteration, and no salt. The lack of salt allows dictionary attacks as the same + * password always creates the same key. The low iteration count and + * non-cryptographically secure hash algorithm allow passwords to be tested very + * rapidly. + * + * In line with OpenSSL's recommendation to use a more modern algorithm instead of [`EVP_BytesToKey`](https://www.openssl.org/docs/man3.0/man3/EVP_BytesToKey.html) it is recommended that + * developers derive a key and IV on + * their own using {@link scrypt} and to use {@link createDecipheriv} to create the `Decipher` object. + * @since v0.1.94 + * @deprecated Since v10.0.0 - Use {@link createDecipheriv} instead. + * @param options `stream.transform` options + */ + function createDecipher(algorithm: CipherCCMTypes, password: BinaryLike, options: CipherCCMOptions): DecipherCCM; + /** @deprecated since v10.0.0 use `createDecipheriv()` */ + function createDecipher(algorithm: CipherGCMTypes, password: BinaryLike, options?: CipherGCMOptions): DecipherGCM; + /** @deprecated since v10.0.0 use `createDecipheriv()` */ + function createDecipher(algorithm: string, password: BinaryLike, options?: stream.TransformOptions): Decipher; + /** + * Creates and returns a `Decipher` object that uses the given `algorithm`, `key`and initialization vector (`iv`). + * + * The `options` argument controls stream behavior and is optional except when a + * cipher in CCM or OCB mode (e.g. `'aes-128-ccm'`) is used. In that case, the`authTagLength` option is required and specifies the length of the + * authentication tag in bytes, see `CCM mode`. In GCM mode, the `authTagLength`option is not required but can be used to restrict accepted authentication tags + * to those with the specified length. + * For `chacha20-poly1305`, the `authTagLength` option defaults to 16 bytes. + * + * The `algorithm` is dependent on OpenSSL, examples are `'aes192'`, etc. On + * recent OpenSSL releases, `openssl list -cipher-algorithms` will + * display the available cipher algorithms. + * + * The `key` is the raw key used by the `algorithm` and `iv` is an [initialization vector](https://en.wikipedia.org/wiki/Initialization_vector). Both arguments must be `'utf8'` encoded + * strings,`Buffers`, `TypedArray`, or `DataView`s. The `key` may optionally be + * a `KeyObject` of type `secret`. If the cipher does not need + * an initialization vector, `iv` may be `null`. + * + * When passing strings for `key` or `iv`, please consider `caveats when using strings as inputs to cryptographic APIs`. + * + * Initialization vectors should be unpredictable and unique; ideally, they will be + * cryptographically random. They do not have to be secret: IVs are typically just + * added to ciphertext messages unencrypted. It may sound contradictory that + * something has to be unpredictable and unique, but does not have to be secret; + * remember that an attacker must not be able to predict ahead of time what a given + * IV will be. + * @since v0.1.94 + * @param options `stream.transform` options + */ + function createDecipheriv(algorithm: CipherCCMTypes, key: CipherKey, iv: BinaryLike, options: CipherCCMOptions): DecipherCCM; + function createDecipheriv(algorithm: CipherOCBTypes, key: CipherKey, iv: BinaryLike, options: CipherOCBOptions): DecipherOCB; + function createDecipheriv(algorithm: CipherGCMTypes, key: CipherKey, iv: BinaryLike, options?: CipherGCMOptions): DecipherGCM; + function createDecipheriv(algorithm: string, key: CipherKey, iv: BinaryLike | null, options?: stream.TransformOptions): Decipher; + /** + * Instances of the `Decipher` class are used to decrypt data. The class can be + * used in one of two ways: + * + * * As a `stream` that is both readable and writable, where plain encrypted + * data is written to produce unencrypted data on the readable side, or + * * Using the `decipher.update()` and `decipher.final()` methods to + * produce the unencrypted data. + * + * The {@link createDecipher} or {@link createDecipheriv} methods are + * used to create `Decipher` instances. `Decipher` objects are not to be created + * directly using the `new` keyword. + * + * Example: Using `Decipher` objects as streams: + * + * ```js + * import { Buffer } from 'node:buffer'; + * const { + * scryptSync, + * createDecipheriv, + * } = await import('node:crypto'); + * + * const algorithm = 'aes-192-cbc'; + * const password = 'Password used to generate key'; + * // Key length is dependent on the algorithm. In this case for aes192, it is + * // 24 bytes (192 bits). + * // Use the async `crypto.scrypt()` instead. + * const key = scryptSync(password, 'salt', 24); + * // The IV is usually passed along with the ciphertext. + * const iv = Buffer.alloc(16, 0); // Initialization vector. + * + * const decipher = createDecipheriv(algorithm, key, iv); + * + * let decrypted = ''; + * decipher.on('readable', () => { + * let chunk; + * while (null !== (chunk = decipher.read())) { + * decrypted += chunk.toString('utf8'); + * } + * }); + * decipher.on('end', () => { + * console.log(decrypted); + * // Prints: some clear text data + * }); + * + * // Encrypted with same algorithm, key and iv. + * const encrypted = + * 'e5f79c5915c02171eec6b212d5520d44480993d7d622a7c4c2da32f6efda0ffa'; + * decipher.write(encrypted, 'hex'); + * decipher.end(); + * ``` + * + * Example: Using `Decipher` and piped streams: + * + * ```js + * import { + * createReadStream, + * createWriteStream, + * } from 'node:fs'; + * import { Buffer } from 'node:buffer'; + * const { + * scryptSync, + * createDecipheriv, + * } = await import('node:crypto'); + * + * const algorithm = 'aes-192-cbc'; + * const password = 'Password used to generate key'; + * // Use the async `crypto.scrypt()` instead. + * const key = scryptSync(password, 'salt', 24); + * // The IV is usually passed along with the ciphertext. + * const iv = Buffer.alloc(16, 0); // Initialization vector. + * + * const decipher = createDecipheriv(algorithm, key, iv); + * + * const input = createReadStream('test.enc'); + * const output = createWriteStream('test.js'); + * + * input.pipe(decipher).pipe(output); + * ``` + * + * Example: Using the `decipher.update()` and `decipher.final()` methods: + * + * ```js + * import { Buffer } from 'node:buffer'; + * const { + * scryptSync, + * createDecipheriv, + * } = await import('node:crypto'); + * + * const algorithm = 'aes-192-cbc'; + * const password = 'Password used to generate key'; + * // Use the async `crypto.scrypt()` instead. + * const key = scryptSync(password, 'salt', 24); + * // The IV is usually passed along with the ciphertext. + * const iv = Buffer.alloc(16, 0); // Initialization vector. + * + * const decipher = createDecipheriv(algorithm, key, iv); + * + * // Encrypted using same algorithm, key and iv. + * const encrypted = + * 'e5f79c5915c02171eec6b212d5520d44480993d7d622a7c4c2da32f6efda0ffa'; + * let decrypted = decipher.update(encrypted, 'hex', 'utf8'); + * decrypted += decipher.final('utf8'); + * console.log(decrypted); + * // Prints: some clear text data + * ``` + * @since v0.1.94 + */ + class Decipher extends stream.Transform { + private constructor(); + /** + * Updates the decipher with `data`. If the `inputEncoding` argument is given, + * the `data`argument is a string using the specified encoding. If the `inputEncoding`argument is not given, `data` must be a `Buffer`. If `data` is a `Buffer` then `inputEncoding` is + * ignored. + * + * The `outputEncoding` specifies the output format of the enciphered + * data. If the `outputEncoding`is specified, a string using the specified encoding is returned. If no`outputEncoding` is provided, a `Buffer` is returned. + * + * The `decipher.update()` method can be called multiple times with new data until `decipher.final()` is called. Calling `decipher.update()` after `decipher.final()` will result in an error + * being thrown. + * @since v0.1.94 + * @param inputEncoding The `encoding` of the `data` string. + * @param outputEncoding The `encoding` of the return value. + */ + update(data: NodeJS.ArrayBufferView): Buffer; + update(data: string, inputEncoding: Encoding): Buffer; + update(data: NodeJS.ArrayBufferView, inputEncoding: undefined, outputEncoding: Encoding): string; + update(data: string, inputEncoding: Encoding | undefined, outputEncoding: Encoding): string; + /** + * Once the `decipher.final()` method has been called, the `Decipher` object can + * no longer be used to decrypt data. Attempts to call `decipher.final()` more + * than once will result in an error being thrown. + * @since v0.1.94 + * @param outputEncoding The `encoding` of the return value. + * @return Any remaining deciphered contents. If `outputEncoding` is specified, a string is returned. If an `outputEncoding` is not provided, a {@link Buffer} is returned. + */ + final(): Buffer; + final(outputEncoding: BufferEncoding): string; + /** + * When data has been encrypted without standard block padding, calling`decipher.setAutoPadding(false)` will disable automatic padding to prevent `decipher.final()` from checking for and + * removing padding. + * + * Turning auto padding off will only work if the input data's length is a + * multiple of the ciphers block size. + * + * The `decipher.setAutoPadding()` method must be called before `decipher.final()`. + * @since v0.7.1 + * @param [autoPadding=true] + * @return for method chaining. + */ + setAutoPadding(auto_padding?: boolean): this; + } + interface DecipherCCM extends Decipher { + setAuthTag(buffer: NodeJS.ArrayBufferView): this; + setAAD( + buffer: NodeJS.ArrayBufferView, + options: { + plaintextLength: number; + } + ): this; + } + interface DecipherGCM extends Decipher { + setAuthTag(buffer: NodeJS.ArrayBufferView): this; + setAAD( + buffer: NodeJS.ArrayBufferView, + options?: { + plaintextLength: number; + } + ): this; + } + interface DecipherOCB extends Decipher { + setAuthTag(buffer: NodeJS.ArrayBufferView): this; + setAAD( + buffer: NodeJS.ArrayBufferView, + options?: { + plaintextLength: number; + } + ): this; + } + interface PrivateKeyInput { + key: string | Buffer; + format?: KeyFormat | undefined; + type?: 'pkcs1' | 'pkcs8' | 'sec1' | undefined; + passphrase?: string | Buffer | undefined; + encoding?: string | undefined; + } + interface PublicKeyInput { + key: string | Buffer; + format?: KeyFormat | undefined; + type?: 'pkcs1' | 'spki' | undefined; + encoding?: string | undefined; + } + /** + * Asynchronously generates a new random secret key of the given `length`. The`type` will determine which validations will be performed on the `length`. + * + * ```js + * const { + * generateKey, + * } = await import('node:crypto'); + * + * generateKey('hmac', { length: 512 }, (err, key) => { + * if (err) throw err; + * console.log(key.export().toString('hex')); // 46e..........620 + * }); + * ``` + * + * The size of a generated HMAC key should not exceed the block size of the + * underlying hash function. See {@link createHmac} for more information. + * @since v15.0.0 + * @param type The intended use of the generated secret key. Currently accepted values are `'hmac'` and `'aes'`. + */ + function generateKey( + type: 'hmac' | 'aes', + options: { + length: number; + }, + callback: (err: Error | null, key: KeyObject) => void + ): void; + /** + * Synchronously generates a new random secret key of the given `length`. The`type` will determine which validations will be performed on the `length`. + * + * ```js + * const { + * generateKeySync, + * } = await import('node:crypto'); + * + * const key = generateKeySync('hmac', { length: 512 }); + * console.log(key.export().toString('hex')); // e89..........41e + * ``` + * + * The size of a generated HMAC key should not exceed the block size of the + * underlying hash function. See {@link createHmac} for more information. + * @since v15.0.0 + * @param type The intended use of the generated secret key. Currently accepted values are `'hmac'` and `'aes'`. + */ + function generateKeySync( + type: 'hmac' | 'aes', + options: { + length: number; + } + ): KeyObject; + interface JsonWebKeyInput { + key: JsonWebKey; + format: 'jwk'; + } + /** + * Creates and returns a new key object containing a private key. If `key` is a + * string or `Buffer`, `format` is assumed to be `'pem'`; otherwise, `key`must be an object with the properties described above. + * + * If the private key is encrypted, a `passphrase` must be specified. The length + * of the passphrase is limited to 1024 bytes. + * @since v11.6.0 + */ + function createPrivateKey(key: PrivateKeyInput | string | Buffer | JsonWebKeyInput): KeyObject; + /** + * Creates and returns a new key object containing a public key. If `key` is a + * string or `Buffer`, `format` is assumed to be `'pem'`; if `key` is a `KeyObject`with type `'private'`, the public key is derived from the given private key; + * otherwise, `key` must be an object with the properties described above. + * + * If the format is `'pem'`, the `'key'` may also be an X.509 certificate. + * + * Because public keys can be derived from private keys, a private key may be + * passed instead of a public key. In that case, this function behaves as if {@link createPrivateKey} had been called, except that the type of the + * returned `KeyObject` will be `'public'` and that the private key cannot be + * extracted from the returned `KeyObject`. Similarly, if a `KeyObject` with type`'private'` is given, a new `KeyObject` with type `'public'` will be returned + * and it will be impossible to extract the private key from the returned object. + * @since v11.6.0 + */ + function createPublicKey(key: PublicKeyInput | string | Buffer | KeyObject | JsonWebKeyInput): KeyObject; + /** + * Creates and returns a new key object containing a secret key for symmetric + * encryption or `Hmac`. + * @since v11.6.0 + * @param encoding The string encoding when `key` is a string. + */ + function createSecretKey(key: NodeJS.ArrayBufferView): KeyObject; + function createSecretKey(key: string, encoding: BufferEncoding): KeyObject; + /** + * Creates and returns a `Sign` object that uses the given `algorithm`. Use {@link getHashes} to obtain the names of the available digest algorithms. + * Optional `options` argument controls the `stream.Writable` behavior. + * + * In some cases, a `Sign` instance can be created using the name of a signature + * algorithm, such as `'RSA-SHA256'`, instead of a digest algorithm. This will use + * the corresponding digest algorithm. This does not work for all signature + * algorithms, such as `'ecdsa-with-SHA256'`, so it is best to always use digest + * algorithm names. + * @since v0.1.92 + * @param options `stream.Writable` options + */ + function createSign(algorithm: string, options?: stream.WritableOptions): Sign; + type DSAEncoding = 'der' | 'ieee-p1363'; + interface SigningOptions { + /** + * @see crypto.constants.RSA_PKCS1_PADDING + */ + padding?: number | undefined; + saltLength?: number | undefined; + dsaEncoding?: DSAEncoding | undefined; + } + interface SignPrivateKeyInput extends PrivateKeyInput, SigningOptions {} + interface SignKeyObjectInput extends SigningOptions { + key: KeyObject; + } + interface VerifyPublicKeyInput extends PublicKeyInput, SigningOptions {} + interface VerifyKeyObjectInput extends SigningOptions { + key: KeyObject; + } + interface VerifyJsonWebKeyInput extends JsonWebKeyInput, SigningOptions {} + type KeyLike = string | Buffer | KeyObject; + /** + * The `Sign` class is a utility for generating signatures. It can be used in one + * of two ways: + * + * * As a writable `stream`, where data to be signed is written and the `sign.sign()` method is used to generate and return the signature, or + * * Using the `sign.update()` and `sign.sign()` methods to produce the + * signature. + * + * The {@link createSign} method is used to create `Sign` instances. The + * argument is the string name of the hash function to use. `Sign` objects are not + * to be created directly using the `new` keyword. + * + * Example: Using `Sign` and `Verify` objects as streams: + * + * ```js + * const { + * generateKeyPairSync, + * createSign, + * createVerify, + * } = await import('node:crypto'); + * + * const { privateKey, publicKey } = generateKeyPairSync('ec', { + * namedCurve: 'sect239k1', + * }); + * + * const sign = createSign('SHA256'); + * sign.write('some data to sign'); + * sign.end(); + * const signature = sign.sign(privateKey, 'hex'); + * + * const verify = createVerify('SHA256'); + * verify.write('some data to sign'); + * verify.end(); + * console.log(verify.verify(publicKey, signature, 'hex')); + * // Prints: true + * ``` + * + * Example: Using the `sign.update()` and `verify.update()` methods: + * + * ```js + * const { + * generateKeyPairSync, + * createSign, + * createVerify, + * } = await import('node:crypto'); + * + * const { privateKey, publicKey } = generateKeyPairSync('rsa', { + * modulusLength: 2048, + * }); + * + * const sign = createSign('SHA256'); + * sign.update('some data to sign'); + * sign.end(); + * const signature = sign.sign(privateKey); + * + * const verify = createVerify('SHA256'); + * verify.update('some data to sign'); + * verify.end(); + * console.log(verify.verify(publicKey, signature)); + * // Prints: true + * ``` + * @since v0.1.92 + */ + class Sign extends stream.Writable { + private constructor(); + /** + * Updates the `Sign` content with the given `data`, the encoding of which + * is given in `inputEncoding`. + * If `encoding` is not provided, and the `data` is a string, an + * encoding of `'utf8'` is enforced. If `data` is a `Buffer`, `TypedArray`, or`DataView`, then `inputEncoding` is ignored. + * + * This can be called many times with new data as it is streamed. + * @since v0.1.92 + * @param inputEncoding The `encoding` of the `data` string. + */ + update(data: BinaryLike): this; + update(data: string, inputEncoding: Encoding): this; + /** + * Calculates the signature on all the data passed through using either `sign.update()` or `sign.write()`. + * + * If `privateKey` is not a `KeyObject`, this function behaves as if`privateKey` had been passed to {@link createPrivateKey}. If it is an + * object, the following additional properties can be passed: + * + * If `outputEncoding` is provided a string is returned; otherwise a `Buffer` is returned. + * + * The `Sign` object can not be again used after `sign.sign()` method has been + * called. Multiple calls to `sign.sign()` will result in an error being thrown. + * @since v0.1.92 + */ + sign(privateKey: KeyLike | SignKeyObjectInput | SignPrivateKeyInput): Buffer; + sign(privateKey: KeyLike | SignKeyObjectInput | SignPrivateKeyInput, outputFormat: BinaryToTextEncoding): string; + } + /** + * Creates and returns a `Verify` object that uses the given algorithm. + * Use {@link getHashes} to obtain an array of names of the available + * signing algorithms. Optional `options` argument controls the`stream.Writable` behavior. + * + * In some cases, a `Verify` instance can be created using the name of a signature + * algorithm, such as `'RSA-SHA256'`, instead of a digest algorithm. This will use + * the corresponding digest algorithm. This does not work for all signature + * algorithms, such as `'ecdsa-with-SHA256'`, so it is best to always use digest + * algorithm names. + * @since v0.1.92 + * @param options `stream.Writable` options + */ + function createVerify(algorithm: string, options?: stream.WritableOptions): Verify; + /** + * The `Verify` class is a utility for verifying signatures. It can be used in one + * of two ways: + * + * * As a writable `stream` where written data is used to validate against the + * supplied signature, or + * * Using the `verify.update()` and `verify.verify()` methods to verify + * the signature. + * + * The {@link createVerify} method is used to create `Verify` instances.`Verify` objects are not to be created directly using the `new` keyword. + * + * See `Sign` for examples. + * @since v0.1.92 + */ + class Verify extends stream.Writable { + private constructor(); + /** + * Updates the `Verify` content with the given `data`, the encoding of which + * is given in `inputEncoding`. + * If `inputEncoding` is not provided, and the `data` is a string, an + * encoding of `'utf8'` is enforced. If `data` is a `Buffer`, `TypedArray`, or`DataView`, then `inputEncoding` is ignored. + * + * This can be called many times with new data as it is streamed. + * @since v0.1.92 + * @param inputEncoding The `encoding` of the `data` string. + */ + update(data: BinaryLike): Verify; + update(data: string, inputEncoding: Encoding): Verify; + /** + * Verifies the provided data using the given `object` and `signature`. + * + * If `object` is not a `KeyObject`, this function behaves as if`object` had been passed to {@link createPublicKey}. If it is an + * object, the following additional properties can be passed: + * + * The `signature` argument is the previously calculated signature for the data, in + * the `signatureEncoding`. + * If a `signatureEncoding` is specified, the `signature` is expected to be a + * string; otherwise `signature` is expected to be a `Buffer`,`TypedArray`, or `DataView`. + * + * The `verify` object can not be used again after `verify.verify()` has been + * called. Multiple calls to `verify.verify()` will result in an error being + * thrown. + * + * Because public keys can be derived from private keys, a private key may + * be passed instead of a public key. + * @since v0.1.92 + */ + verify(object: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput | VerifyJsonWebKeyInput, signature: NodeJS.ArrayBufferView): boolean; + verify(object: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput | VerifyJsonWebKeyInput, signature: string, signature_format?: BinaryToTextEncoding): boolean; + } + /** + * Creates a `DiffieHellman` key exchange object using the supplied `prime` and an + * optional specific `generator`. + * + * The `generator` argument can be a number, string, or `Buffer`. If`generator` is not specified, the value `2` is used. + * + * If `primeEncoding` is specified, `prime` is expected to be a string; otherwise + * a `Buffer`, `TypedArray`, or `DataView` is expected. + * + * If `generatorEncoding` is specified, `generator` is expected to be a string; + * otherwise a number, `Buffer`, `TypedArray`, or `DataView` is expected. + * @since v0.11.12 + * @param primeEncoding The `encoding` of the `prime` string. + * @param [generator=2] + * @param generatorEncoding The `encoding` of the `generator` string. + */ + function createDiffieHellman(primeLength: number, generator?: number): DiffieHellman; + function createDiffieHellman(prime: ArrayBuffer | NodeJS.ArrayBufferView, generator?: number | ArrayBuffer | NodeJS.ArrayBufferView): DiffieHellman; + function createDiffieHellman(prime: ArrayBuffer | NodeJS.ArrayBufferView, generator: string, generatorEncoding: BinaryToTextEncoding): DiffieHellman; + function createDiffieHellman(prime: string, primeEncoding: BinaryToTextEncoding, generator?: number | ArrayBuffer | NodeJS.ArrayBufferView): DiffieHellman; + function createDiffieHellman(prime: string, primeEncoding: BinaryToTextEncoding, generator: string, generatorEncoding: BinaryToTextEncoding): DiffieHellman; + /** + * The `DiffieHellman` class is a utility for creating Diffie-Hellman key + * exchanges. + * + * Instances of the `DiffieHellman` class can be created using the {@link createDiffieHellman} function. + * + * ```js + * import assert from 'node:assert'; + * + * const { + * createDiffieHellman, + * } = await import('node:crypto'); + * + * // Generate Alice's keys... + * const alice = createDiffieHellman(2048); + * const aliceKey = alice.generateKeys(); + * + * // Generate Bob's keys... + * const bob = createDiffieHellman(alice.getPrime(), alice.getGenerator()); + * const bobKey = bob.generateKeys(); + * + * // Exchange and generate the secret... + * const aliceSecret = alice.computeSecret(bobKey); + * const bobSecret = bob.computeSecret(aliceKey); + * + * // OK + * assert.strictEqual(aliceSecret.toString('hex'), bobSecret.toString('hex')); + * ``` + * @since v0.5.0 + */ + class DiffieHellman { + private constructor(); + /** + * Generates private and public Diffie-Hellman key values unless they have been + * generated or computed already, and returns + * the public key in the specified `encoding`. This key should be + * transferred to the other party. + * If `encoding` is provided a string is returned; otherwise a `Buffer` is returned. + * + * This function is a thin wrapper around [`DH_generate_key()`](https://www.openssl.org/docs/man3.0/man3/DH_generate_key.html). In particular, + * once a private key has been generated or set, calling this function only updates + * the public key but does not generate a new private key. + * @since v0.5.0 + * @param encoding The `encoding` of the return value. + */ + generateKeys(): Buffer; + generateKeys(encoding: BinaryToTextEncoding): string; + /** + * Computes the shared secret using `otherPublicKey` as the other + * party's public key and returns the computed shared secret. The supplied + * key is interpreted using the specified `inputEncoding`, and secret is + * encoded using specified `outputEncoding`. + * If the `inputEncoding` is not + * provided, `otherPublicKey` is expected to be a `Buffer`,`TypedArray`, or `DataView`. + * + * If `outputEncoding` is given a string is returned; otherwise, a `Buffer` is returned. + * @since v0.5.0 + * @param inputEncoding The `encoding` of an `otherPublicKey` string. + * @param outputEncoding The `encoding` of the return value. + */ + computeSecret(otherPublicKey: NodeJS.ArrayBufferView, inputEncoding?: null, outputEncoding?: null): Buffer; + computeSecret(otherPublicKey: string, inputEncoding: BinaryToTextEncoding, outputEncoding?: null): Buffer; + computeSecret(otherPublicKey: NodeJS.ArrayBufferView, inputEncoding: null, outputEncoding: BinaryToTextEncoding): string; + computeSecret(otherPublicKey: string, inputEncoding: BinaryToTextEncoding, outputEncoding: BinaryToTextEncoding): string; + /** + * Returns the Diffie-Hellman prime in the specified `encoding`. + * If `encoding` is provided a string is + * returned; otherwise a `Buffer` is returned. + * @since v0.5.0 + * @param encoding The `encoding` of the return value. + */ + getPrime(): Buffer; + getPrime(encoding: BinaryToTextEncoding): string; + /** + * Returns the Diffie-Hellman generator in the specified `encoding`. + * If `encoding` is provided a string is + * returned; otherwise a `Buffer` is returned. + * @since v0.5.0 + * @param encoding The `encoding` of the return value. + */ + getGenerator(): Buffer; + getGenerator(encoding: BinaryToTextEncoding): string; + /** + * Returns the Diffie-Hellman public key in the specified `encoding`. + * If `encoding` is provided a + * string is returned; otherwise a `Buffer` is returned. + * @since v0.5.0 + * @param encoding The `encoding` of the return value. + */ + getPublicKey(): Buffer; + getPublicKey(encoding: BinaryToTextEncoding): string; + /** + * Returns the Diffie-Hellman private key in the specified `encoding`. + * If `encoding` is provided a + * string is returned; otherwise a `Buffer` is returned. + * @since v0.5.0 + * @param encoding The `encoding` of the return value. + */ + getPrivateKey(): Buffer; + getPrivateKey(encoding: BinaryToTextEncoding): string; + /** + * Sets the Diffie-Hellman public key. If the `encoding` argument is provided,`publicKey` is expected + * to be a string. If no `encoding` is provided, `publicKey` is expected + * to be a `Buffer`, `TypedArray`, or `DataView`. + * @since v0.5.0 + * @param encoding The `encoding` of the `publicKey` string. + */ + setPublicKey(publicKey: NodeJS.ArrayBufferView): void; + setPublicKey(publicKey: string, encoding: BufferEncoding): void; + /** + * Sets the Diffie-Hellman private key. If the `encoding` argument is provided,`privateKey` is expected + * to be a string. If no `encoding` is provided, `privateKey` is expected + * to be a `Buffer`, `TypedArray`, or `DataView`. + * + * This function does not automatically compute the associated public key. Either `diffieHellman.setPublicKey()` or `diffieHellman.generateKeys()` can be + * used to manually provide the public key or to automatically derive it. + * @since v0.5.0 + * @param encoding The `encoding` of the `privateKey` string. + */ + setPrivateKey(privateKey: NodeJS.ArrayBufferView): void; + setPrivateKey(privateKey: string, encoding: BufferEncoding): void; + /** + * A bit field containing any warnings and/or errors resulting from a check + * performed during initialization of the `DiffieHellman` object. + * + * The following values are valid for this property (as defined in `node:constants` module): + * + * * `DH_CHECK_P_NOT_SAFE_PRIME` + * * `DH_CHECK_P_NOT_PRIME` + * * `DH_UNABLE_TO_CHECK_GENERATOR` + * * `DH_NOT_SUITABLE_GENERATOR` + * @since v0.11.12 + */ + verifyError: number; + } + /** + * The `DiffieHellmanGroup` class takes a well-known modp group as its argument. + * It works the same as `DiffieHellman`, except that it does not allow changing its keys after creation. + * In other words, it does not implement `setPublicKey()` or `setPrivateKey()` methods. + * + * ```js + * const { createDiffieHellmanGroup } = await import('node:crypto'); + * const dh = createDiffieHellmanGroup('modp1'); + * ``` + * The name (e.g. `'modp1'`) is taken from [RFC 2412](https://www.rfc-editor.org/rfc/rfc2412.txt) (modp1 and 2) and [RFC 3526](https://www.rfc-editor.org/rfc/rfc3526.txt): + * ```bash + * $ perl -ne 'print "$1\n" if /"(modp\d+)"/' src/node_crypto_groups.h + * modp1 # 768 bits + * modp2 # 1024 bits + * modp5 # 1536 bits + * modp14 # 2048 bits + * modp15 # etc. + * modp16 + * modp17 + * modp18 + * ``` + * @since v0.7.5 + */ + const DiffieHellmanGroup: DiffieHellmanGroupConstructor; + interface DiffieHellmanGroupConstructor { + new (name: string): DiffieHellmanGroup; + (name: string): DiffieHellmanGroup; + readonly prototype: DiffieHellmanGroup; + } + type DiffieHellmanGroup = Omit; + /** + * Creates a predefined `DiffieHellmanGroup` key exchange object. The + * supported groups are listed in the documentation for `DiffieHellmanGroup`. + * + * The returned object mimics the interface of objects created by {@link createDiffieHellman}, but will not allow changing + * the keys (with `diffieHellman.setPublicKey()`, for example). The + * advantage of using this method is that the parties do not have to + * generate nor exchange a group modulus beforehand, saving both processor + * and communication time. + * + * Example (obtaining a shared secret): + * + * ```js + * const { + * getDiffieHellman, + * } = await import('node:crypto'); + * const alice = getDiffieHellman('modp14'); + * const bob = getDiffieHellman('modp14'); + * + * alice.generateKeys(); + * bob.generateKeys(); + * + * const aliceSecret = alice.computeSecret(bob.getPublicKey(), null, 'hex'); + * const bobSecret = bob.computeSecret(alice.getPublicKey(), null, 'hex'); + * + * // aliceSecret and bobSecret should be the same + * console.log(aliceSecret === bobSecret); + * ``` + * @since v0.7.5 + */ + function getDiffieHellman(groupName: string): DiffieHellmanGroup; + /** + * An alias for {@link getDiffieHellman} + * @since v0.9.3 + */ + function createDiffieHellmanGroup(name: string): DiffieHellmanGroup; + /** + * Provides an asynchronous Password-Based Key Derivation Function 2 (PBKDF2) + * implementation. A selected HMAC digest algorithm specified by `digest` is + * applied to derive a key of the requested byte length (`keylen`) from the`password`, `salt` and `iterations`. + * + * The supplied `callback` function is called with two arguments: `err` and`derivedKey`. If an error occurs while deriving the key, `err` will be set; + * otherwise `err` will be `null`. By default, the successfully generated`derivedKey` will be passed to the callback as a `Buffer`. An error will be + * thrown if any of the input arguments specify invalid values or types. + * + * The `iterations` argument must be a number set as high as possible. The + * higher the number of iterations, the more secure the derived key will be, + * but will take a longer amount of time to complete. + * + * The `salt` should be as unique as possible. It is recommended that a salt is + * random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details. + * + * When passing strings for `password` or `salt`, please consider `caveats when using strings as inputs to cryptographic APIs`. + * + * ```js + * const { + * pbkdf2, + * } = await import('node:crypto'); + * + * pbkdf2('secret', 'salt', 100000, 64, 'sha512', (err, derivedKey) => { + * if (err) throw err; + * console.log(derivedKey.toString('hex')); // '3745e48...08d59ae' + * }); + * ``` + * + * An array of supported digest functions can be retrieved using {@link getHashes}. + * + * This API uses libuv's threadpool, which can have surprising and + * negative performance implications for some applications; see the `UV_THREADPOOL_SIZE` documentation for more information. + * @since v0.5.5 + */ + function pbkdf2(password: BinaryLike, salt: BinaryLike, iterations: number, keylen: number, digest: string, callback: (err: Error | null, derivedKey: Buffer) => void): void; + /** + * Provides a synchronous Password-Based Key Derivation Function 2 (PBKDF2) + * implementation. A selected HMAC digest algorithm specified by `digest` is + * applied to derive a key of the requested byte length (`keylen`) from the`password`, `salt` and `iterations`. + * + * If an error occurs an `Error` will be thrown, otherwise the derived key will be + * returned as a `Buffer`. + * + * The `iterations` argument must be a number set as high as possible. The + * higher the number of iterations, the more secure the derived key will be, + * but will take a longer amount of time to complete. + * + * The `salt` should be as unique as possible. It is recommended that a salt is + * random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details. + * + * When passing strings for `password` or `salt`, please consider `caveats when using strings as inputs to cryptographic APIs`. + * + * ```js + * const { + * pbkdf2Sync, + * } = await import('node:crypto'); + * + * const key = pbkdf2Sync('secret', 'salt', 100000, 64, 'sha512'); + * console.log(key.toString('hex')); // '3745e48...08d59ae' + * ``` + * + * An array of supported digest functions can be retrieved using {@link getHashes}. + * @since v0.9.3 + */ + function pbkdf2Sync(password: BinaryLike, salt: BinaryLike, iterations: number, keylen: number, digest: string): Buffer; + /** + * Generates cryptographically strong pseudorandom data. The `size` argument + * is a number indicating the number of bytes to generate. + * + * If a `callback` function is provided, the bytes are generated asynchronously + * and the `callback` function is invoked with two arguments: `err` and `buf`. + * If an error occurs, `err` will be an `Error` object; otherwise it is `null`. The`buf` argument is a `Buffer` containing the generated bytes. + * + * ```js + * // Asynchronous + * const { + * randomBytes, + * } = await import('node:crypto'); + * + * randomBytes(256, (err, buf) => { + * if (err) throw err; + * console.log(`${buf.length} bytes of random data: ${buf.toString('hex')}`); + * }); + * ``` + * + * If the `callback` function is not provided, the random bytes are generated + * synchronously and returned as a `Buffer`. An error will be thrown if + * there is a problem generating the bytes. + * + * ```js + * // Synchronous + * const { + * randomBytes, + * } = await import('node:crypto'); + * + * const buf = randomBytes(256); + * console.log( + * `${buf.length} bytes of random data: ${buf.toString('hex')}`); + * ``` + * + * The `crypto.randomBytes()` method will not complete until there is + * sufficient entropy available. + * This should normally never take longer than a few milliseconds. The only time + * when generating the random bytes may conceivably block for a longer period of + * time is right after boot, when the whole system is still low on entropy. + * + * This API uses libuv's threadpool, which can have surprising and + * negative performance implications for some applications; see the `UV_THREADPOOL_SIZE` documentation for more information. + * + * The asynchronous version of `crypto.randomBytes()` is carried out in a single + * threadpool request. To minimize threadpool task length variation, partition + * large `randomBytes` requests when doing so as part of fulfilling a client + * request. + * @since v0.5.8 + * @param size The number of bytes to generate. The `size` must not be larger than `2**31 - 1`. + * @return if the `callback` function is not provided. + */ + function randomBytes(size: number): Buffer; + function randomBytes(size: number, callback: (err: Error | null, buf: Buffer) => void): void; + function pseudoRandomBytes(size: number): Buffer; + function pseudoRandomBytes(size: number, callback: (err: Error | null, buf: Buffer) => void): void; + /** + * Return a random integer `n` such that `min <= n < max`. This + * implementation avoids [modulo bias](https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle#Modulo_bias). + * + * The range (`max - min`) must be less than 248. `min` and `max` must + * be [safe integers](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isSafeInteger). + * + * If the `callback` function is not provided, the random integer is + * generated synchronously. + * + * ```js + * // Asynchronous + * const { + * randomInt, + * } = await import('node:crypto'); + * + * randomInt(3, (err, n) => { + * if (err) throw err; + * console.log(`Random number chosen from (0, 1, 2): ${n}`); + * }); + * ``` + * + * ```js + * // Synchronous + * const { + * randomInt, + * } = await import('node:crypto'); + * + * const n = randomInt(3); + * console.log(`Random number chosen from (0, 1, 2): ${n}`); + * ``` + * + * ```js + * // With `min` argument + * const { + * randomInt, + * } = await import('node:crypto'); + * + * const n = randomInt(1, 7); + * console.log(`The dice rolled: ${n}`); + * ``` + * @since v14.10.0, v12.19.0 + * @param [min=0] Start of random range (inclusive). + * @param max End of random range (exclusive). + * @param callback `function(err, n) {}`. + */ + function randomInt(max: number): number; + function randomInt(min: number, max: number): number; + function randomInt(max: number, callback: (err: Error | null, value: number) => void): void; + function randomInt(min: number, max: number, callback: (err: Error | null, value: number) => void): void; + /** + * Synchronous version of {@link randomFill}. + * + * ```js + * import { Buffer } from 'node:buffer'; + * const { randomFillSync } = await import('node:crypto'); + * + * const buf = Buffer.alloc(10); + * console.log(randomFillSync(buf).toString('hex')); + * + * randomFillSync(buf, 5); + * console.log(buf.toString('hex')); + * + * // The above is equivalent to the following: + * randomFillSync(buf, 5, 5); + * console.log(buf.toString('hex')); + * ``` + * + * Any `ArrayBuffer`, `TypedArray` or `DataView` instance may be passed as`buffer`. + * + * ```js + * import { Buffer } from 'node:buffer'; + * const { randomFillSync } = await import('node:crypto'); + * + * const a = new Uint32Array(10); + * console.log(Buffer.from(randomFillSync(a).buffer, + * a.byteOffset, a.byteLength).toString('hex')); + * + * const b = new DataView(new ArrayBuffer(10)); + * console.log(Buffer.from(randomFillSync(b).buffer, + * b.byteOffset, b.byteLength).toString('hex')); + * + * const c = new ArrayBuffer(10); + * console.log(Buffer.from(randomFillSync(c)).toString('hex')); + * ``` + * @since v7.10.0, v6.13.0 + * @param buffer Must be supplied. The size of the provided `buffer` must not be larger than `2**31 - 1`. + * @param [offset=0] + * @param [size=buffer.length - offset] + * @return The object passed as `buffer` argument. + */ + function randomFillSync(buffer: T, offset?: number, size?: number): T; + /** + * This function is similar to {@link randomBytes} but requires the first + * argument to be a `Buffer` that will be filled. It also + * requires that a callback is passed in. + * + * If the `callback` function is not provided, an error will be thrown. + * + * ```js + * import { Buffer } from 'node:buffer'; + * const { randomFill } = await import('node:crypto'); + * + * const buf = Buffer.alloc(10); + * randomFill(buf, (err, buf) => { + * if (err) throw err; + * console.log(buf.toString('hex')); + * }); + * + * randomFill(buf, 5, (err, buf) => { + * if (err) throw err; + * console.log(buf.toString('hex')); + * }); + * + * // The above is equivalent to the following: + * randomFill(buf, 5, 5, (err, buf) => { + * if (err) throw err; + * console.log(buf.toString('hex')); + * }); + * ``` + * + * Any `ArrayBuffer`, `TypedArray`, or `DataView` instance may be passed as`buffer`. + * + * While this includes instances of `Float32Array` and `Float64Array`, this + * function should not be used to generate random floating-point numbers. The + * result may contain `+Infinity`, `-Infinity`, and `NaN`, and even if the array + * contains finite numbers only, they are not drawn from a uniform random + * distribution and have no meaningful lower or upper bounds. + * + * ```js + * import { Buffer } from 'node:buffer'; + * const { randomFill } = await import('node:crypto'); + * + * const a = new Uint32Array(10); + * randomFill(a, (err, buf) => { + * if (err) throw err; + * console.log(Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength) + * .toString('hex')); + * }); + * + * const b = new DataView(new ArrayBuffer(10)); + * randomFill(b, (err, buf) => { + * if (err) throw err; + * console.log(Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength) + * .toString('hex')); + * }); + * + * const c = new ArrayBuffer(10); + * randomFill(c, (err, buf) => { + * if (err) throw err; + * console.log(Buffer.from(buf).toString('hex')); + * }); + * ``` + * + * This API uses libuv's threadpool, which can have surprising and + * negative performance implications for some applications; see the `UV_THREADPOOL_SIZE` documentation for more information. + * + * The asynchronous version of `crypto.randomFill()` is carried out in a single + * threadpool request. To minimize threadpool task length variation, partition + * large `randomFill` requests when doing so as part of fulfilling a client + * request. + * @since v7.10.0, v6.13.0 + * @param buffer Must be supplied. The size of the provided `buffer` must not be larger than `2**31 - 1`. + * @param [offset=0] + * @param [size=buffer.length - offset] + * @param callback `function(err, buf) {}`. + */ + function randomFill(buffer: T, callback: (err: Error | null, buf: T) => void): void; + function randomFill(buffer: T, offset: number, callback: (err: Error | null, buf: T) => void): void; + function randomFill(buffer: T, offset: number, size: number, callback: (err: Error | null, buf: T) => void): void; + interface ScryptOptions { + cost?: number | undefined; + blockSize?: number | undefined; + parallelization?: number | undefined; + N?: number | undefined; + r?: number | undefined; + p?: number | undefined; + maxmem?: number | undefined; + } + /** + * Provides an asynchronous [scrypt](https://en.wikipedia.org/wiki/Scrypt) implementation. Scrypt is a password-based + * key derivation function that is designed to be expensive computationally and + * memory-wise in order to make brute-force attacks unrewarding. + * + * The `salt` should be as unique as possible. It is recommended that a salt is + * random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details. + * + * When passing strings for `password` or `salt`, please consider `caveats when using strings as inputs to cryptographic APIs`. + * + * The `callback` function is called with two arguments: `err` and `derivedKey`.`err` is an exception object when key derivation fails, otherwise `err` is`null`. `derivedKey` is passed to the + * callback as a `Buffer`. + * + * An exception is thrown when any of the input arguments specify invalid values + * or types. + * + * ```js + * const { + * scrypt, + * } = await import('node:crypto'); + * + * // Using the factory defaults. + * scrypt('password', 'salt', 64, (err, derivedKey) => { + * if (err) throw err; + * console.log(derivedKey.toString('hex')); // '3745e48...08d59ae' + * }); + * // Using a custom N parameter. Must be a power of two. + * scrypt('password', 'salt', 64, { N: 1024 }, (err, derivedKey) => { + * if (err) throw err; + * console.log(derivedKey.toString('hex')); // '3745e48...aa39b34' + * }); + * ``` + * @since v10.5.0 + */ + function scrypt(password: BinaryLike, salt: BinaryLike, keylen: number, callback: (err: Error | null, derivedKey: Buffer) => void): void; + function scrypt(password: BinaryLike, salt: BinaryLike, keylen: number, options: ScryptOptions, callback: (err: Error | null, derivedKey: Buffer) => void): void; + /** + * Provides a synchronous [scrypt](https://en.wikipedia.org/wiki/Scrypt) implementation. Scrypt is a password-based + * key derivation function that is designed to be expensive computationally and + * memory-wise in order to make brute-force attacks unrewarding. + * + * The `salt` should be as unique as possible. It is recommended that a salt is + * random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details. + * + * When passing strings for `password` or `salt`, please consider `caveats when using strings as inputs to cryptographic APIs`. + * + * An exception is thrown when key derivation fails, otherwise the derived key is + * returned as a `Buffer`. + * + * An exception is thrown when any of the input arguments specify invalid values + * or types. + * + * ```js + * const { + * scryptSync, + * } = await import('node:crypto'); + * // Using the factory defaults. + * + * const key1 = scryptSync('password', 'salt', 64); + * console.log(key1.toString('hex')); // '3745e48...08d59ae' + * // Using a custom N parameter. Must be a power of two. + * const key2 = scryptSync('password', 'salt', 64, { N: 1024 }); + * console.log(key2.toString('hex')); // '3745e48...aa39b34' + * ``` + * @since v10.5.0 + */ + function scryptSync(password: BinaryLike, salt: BinaryLike, keylen: number, options?: ScryptOptions): Buffer; + interface RsaPublicKey { + key: KeyLike; + padding?: number | undefined; + } + interface RsaPrivateKey { + key: KeyLike; + passphrase?: string | undefined; + /** + * @default 'sha1' + */ + oaepHash?: string | undefined; + oaepLabel?: NodeJS.TypedArray | undefined; + padding?: number | undefined; + } + /** + * Encrypts the content of `buffer` with `key` and returns a new `Buffer` with encrypted content. The returned data can be decrypted using + * the corresponding private key, for example using {@link privateDecrypt}. + * + * If `key` is not a `KeyObject`, this function behaves as if`key` had been passed to {@link createPublicKey}. If it is an + * object, the `padding` property can be passed. Otherwise, this function uses`RSA_PKCS1_OAEP_PADDING`. + * + * Because RSA public keys can be derived from private keys, a private key may + * be passed instead of a public key. + * @since v0.11.14 + */ + function publicEncrypt(key: RsaPublicKey | RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer; + /** + * Decrypts `buffer` with `key`.`buffer` was previously encrypted using + * the corresponding private key, for example using {@link privateEncrypt}. + * + * If `key` is not a `KeyObject`, this function behaves as if`key` had been passed to {@link createPublicKey}. If it is an + * object, the `padding` property can be passed. Otherwise, this function uses`RSA_PKCS1_PADDING`. + * + * Because RSA public keys can be derived from private keys, a private key may + * be passed instead of a public key. + * @since v1.1.0 + */ + function publicDecrypt(key: RsaPublicKey | RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer; + /** + * Decrypts `buffer` with `privateKey`. `buffer` was previously encrypted using + * the corresponding public key, for example using {@link publicEncrypt}. + * + * If `privateKey` is not a `KeyObject`, this function behaves as if`privateKey` had been passed to {@link createPrivateKey}. If it is an + * object, the `padding` property can be passed. Otherwise, this function uses`RSA_PKCS1_OAEP_PADDING`. + * @since v0.11.14 + */ + function privateDecrypt(privateKey: RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer; + /** + * Encrypts `buffer` with `privateKey`. The returned data can be decrypted using + * the corresponding public key, for example using {@link publicDecrypt}. + * + * If `privateKey` is not a `KeyObject`, this function behaves as if`privateKey` had been passed to {@link createPrivateKey}. If it is an + * object, the `padding` property can be passed. Otherwise, this function uses`RSA_PKCS1_PADDING`. + * @since v1.1.0 + */ + function privateEncrypt(privateKey: RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer; + /** + * ```js + * const { + * getCiphers, + * } = await import('node:crypto'); + * + * console.log(getCiphers()); // ['aes-128-cbc', 'aes-128-ccm', ...] + * ``` + * @since v0.9.3 + * @return An array with the names of the supported cipher algorithms. + */ + function getCiphers(): string[]; + /** + * ```js + * const { + * getCurves, + * } = await import('node:crypto'); + * + * console.log(getCurves()); // ['Oakley-EC2N-3', 'Oakley-EC2N-4', ...] + * ``` + * @since v2.3.0 + * @return An array with the names of the supported elliptic curves. + */ + function getCurves(): string[]; + /** + * @since v10.0.0 + * @return `1` if and only if a FIPS compliant crypto provider is currently in use, `0` otherwise. A future semver-major release may change the return type of this API to a {boolean}. + */ + function getFips(): 1 | 0; + /** + * Enables the FIPS compliant crypto provider in a FIPS-enabled Node.js build. + * Throws an error if FIPS mode is not available. + * @since v10.0.0 + * @param bool `true` to enable FIPS mode. + */ + function setFips(bool: boolean): void; + /** + * ```js + * const { + * getHashes, + * } = await import('node:crypto'); + * + * console.log(getHashes()); // ['DSA', 'DSA-SHA', 'DSA-SHA1', ...] + * ``` + * @since v0.9.3 + * @return An array of the names of the supported hash algorithms, such as `'RSA-SHA256'`. Hash algorithms are also called "digest" algorithms. + */ + function getHashes(): string[]; + /** + * The `ECDH` class is a utility for creating Elliptic Curve Diffie-Hellman (ECDH) + * key exchanges. + * + * Instances of the `ECDH` class can be created using the {@link createECDH} function. + * + * ```js + * import assert from 'node:assert'; + * + * const { + * createECDH, + * } = await import('node:crypto'); + * + * // Generate Alice's keys... + * const alice = createECDH('secp521r1'); + * const aliceKey = alice.generateKeys(); + * + * // Generate Bob's keys... + * const bob = createECDH('secp521r1'); + * const bobKey = bob.generateKeys(); + * + * // Exchange and generate the secret... + * const aliceSecret = alice.computeSecret(bobKey); + * const bobSecret = bob.computeSecret(aliceKey); + * + * assert.strictEqual(aliceSecret.toString('hex'), bobSecret.toString('hex')); + * // OK + * ``` + * @since v0.11.14 + */ + class ECDH { + private constructor(); + /** + * Converts the EC Diffie-Hellman public key specified by `key` and `curve` to the + * format specified by `format`. The `format` argument specifies point encoding + * and can be `'compressed'`, `'uncompressed'` or `'hybrid'`. The supplied key is + * interpreted using the specified `inputEncoding`, and the returned key is encoded + * using the specified `outputEncoding`. + * + * Use {@link getCurves} to obtain a list of available curve names. + * On recent OpenSSL releases, `openssl ecparam -list_curves` will also display + * the name and description of each available elliptic curve. + * + * If `format` is not specified the point will be returned in `'uncompressed'`format. + * + * If the `inputEncoding` is not provided, `key` is expected to be a `Buffer`,`TypedArray`, or `DataView`. + * + * Example (uncompressing a key): + * + * ```js + * const { + * createECDH, + * ECDH, + * } = await import('node:crypto'); + * + * const ecdh = createECDH('secp256k1'); + * ecdh.generateKeys(); + * + * const compressedKey = ecdh.getPublicKey('hex', 'compressed'); + * + * const uncompressedKey = ECDH.convertKey(compressedKey, + * 'secp256k1', + * 'hex', + * 'hex', + * 'uncompressed'); + * + * // The converted key and the uncompressed public key should be the same + * console.log(uncompressedKey === ecdh.getPublicKey('hex')); + * ``` + * @since v10.0.0 + * @param inputEncoding The `encoding` of the `key` string. + * @param outputEncoding The `encoding` of the return value. + * @param [format='uncompressed'] + */ + static convertKey( + key: BinaryLike, + curve: string, + inputEncoding?: BinaryToTextEncoding, + outputEncoding?: 'latin1' | 'hex' | 'base64' | 'base64url', + format?: 'uncompressed' | 'compressed' | 'hybrid' + ): Buffer | string; + /** + * Generates private and public EC Diffie-Hellman key values, and returns + * the public key in the specified `format` and `encoding`. This key should be + * transferred to the other party. + * + * The `format` argument specifies point encoding and can be `'compressed'` or`'uncompressed'`. If `format` is not specified, the point will be returned in`'uncompressed'` format. + * + * If `encoding` is provided a string is returned; otherwise a `Buffer` is returned. + * @since v0.11.14 + * @param encoding The `encoding` of the return value. + * @param [format='uncompressed'] + */ + generateKeys(): Buffer; + generateKeys(encoding: BinaryToTextEncoding, format?: ECDHKeyFormat): string; + /** + * Computes the shared secret using `otherPublicKey` as the other + * party's public key and returns the computed shared secret. The supplied + * key is interpreted using specified `inputEncoding`, and the returned secret + * is encoded using the specified `outputEncoding`. + * If the `inputEncoding` is not + * provided, `otherPublicKey` is expected to be a `Buffer`, `TypedArray`, or`DataView`. + * + * If `outputEncoding` is given a string will be returned; otherwise a `Buffer` is returned. + * + * `ecdh.computeSecret` will throw an`ERR_CRYPTO_ECDH_INVALID_PUBLIC_KEY` error when `otherPublicKey`lies outside of the elliptic curve. Since `otherPublicKey` is + * usually supplied from a remote user over an insecure network, + * be sure to handle this exception accordingly. + * @since v0.11.14 + * @param inputEncoding The `encoding` of the `otherPublicKey` string. + * @param outputEncoding The `encoding` of the return value. + */ + computeSecret(otherPublicKey: NodeJS.ArrayBufferView): Buffer; + computeSecret(otherPublicKey: string, inputEncoding: BinaryToTextEncoding): Buffer; + computeSecret(otherPublicKey: NodeJS.ArrayBufferView, outputEncoding: BinaryToTextEncoding): string; + computeSecret(otherPublicKey: string, inputEncoding: BinaryToTextEncoding, outputEncoding: BinaryToTextEncoding): string; + /** + * If `encoding` is specified, a string is returned; otherwise a `Buffer` is + * returned. + * @since v0.11.14 + * @param encoding The `encoding` of the return value. + * @return The EC Diffie-Hellman in the specified `encoding`. + */ + getPrivateKey(): Buffer; + getPrivateKey(encoding: BinaryToTextEncoding): string; + /** + * The `format` argument specifies point encoding and can be `'compressed'` or`'uncompressed'`. If `format` is not specified the point will be returned in`'uncompressed'` format. + * + * If `encoding` is specified, a string is returned; otherwise a `Buffer` is + * returned. + * @since v0.11.14 + * @param encoding The `encoding` of the return value. + * @param [format='uncompressed'] + * @return The EC Diffie-Hellman public key in the specified `encoding` and `format`. + */ + getPublicKey(encoding?: null, format?: ECDHKeyFormat): Buffer; + getPublicKey(encoding: BinaryToTextEncoding, format?: ECDHKeyFormat): string; + /** + * Sets the EC Diffie-Hellman private key. + * If `encoding` is provided, `privateKey` is expected + * to be a string; otherwise `privateKey` is expected to be a `Buffer`,`TypedArray`, or `DataView`. + * + * If `privateKey` is not valid for the curve specified when the `ECDH` object was + * created, an error is thrown. Upon setting the private key, the associated + * public point (key) is also generated and set in the `ECDH` object. + * @since v0.11.14 + * @param encoding The `encoding` of the `privateKey` string. + */ + setPrivateKey(privateKey: NodeJS.ArrayBufferView): void; + setPrivateKey(privateKey: string, encoding: BinaryToTextEncoding): void; + } + /** + * Creates an Elliptic Curve Diffie-Hellman (`ECDH`) key exchange object using a + * predefined curve specified by the `curveName` string. Use {@link getCurves} to obtain a list of available curve names. On recent + * OpenSSL releases, `openssl ecparam -list_curves` will also display the name + * and description of each available elliptic curve. + * @since v0.11.14 + */ + function createECDH(curveName: string): ECDH; + /** + * This function compares the underlying bytes that represent the given`ArrayBuffer`, `TypedArray`, or `DataView` instances using a constant-time + * algorithm. + * + * This function does not leak timing information that + * would allow an attacker to guess one of the values. This is suitable for + * comparing HMAC digests or secret values like authentication cookies or [capability urls](https://www.w3.org/TR/capability-urls/). + * + * `a` and `b` must both be `Buffer`s, `TypedArray`s, or `DataView`s, and they + * must have the same byte length. An error is thrown if `a` and `b` have + * different byte lengths. + * + * If at least one of `a` and `b` is a `TypedArray` with more than one byte per + * entry, such as `Uint16Array`, the result will be computed using the platform + * byte order. + * + * **When both of the inputs are `Float32Array`s or`Float64Array`s, this function might return unexpected results due to IEEE 754** + * **encoding of floating-point numbers. In particular, neither `x === y` nor`Object.is(x, y)` implies that the byte representations of two floating-point** + * **numbers `x` and `y` are equal.** + * + * Use of `crypto.timingSafeEqual` does not guarantee that the _surrounding_ code + * is timing-safe. Care should be taken to ensure that the surrounding code does + * not introduce timing vulnerabilities. + * @since v6.6.0 + */ + function timingSafeEqual(a: NodeJS.ArrayBufferView, b: NodeJS.ArrayBufferView): boolean; + type KeyType = 'rsa' | 'rsa-pss' | 'dsa' | 'ec' | 'ed25519' | 'ed448' | 'x25519' | 'x448'; + type KeyFormat = 'pem' | 'der' | 'jwk'; + interface BasePrivateKeyEncodingOptions { + format: T; + cipher?: string | undefined; + passphrase?: string | undefined; + } + interface KeyPairKeyObjectResult { + publicKey: KeyObject; + privateKey: KeyObject; + } + interface ED25519KeyPairKeyObjectOptions {} + interface ED448KeyPairKeyObjectOptions {} + interface X25519KeyPairKeyObjectOptions {} + interface X448KeyPairKeyObjectOptions {} + interface ECKeyPairKeyObjectOptions { + /** + * Name of the curve to use + */ + namedCurve: string; + } + interface RSAKeyPairKeyObjectOptions { + /** + * Key size in bits + */ + modulusLength: number; + /** + * Public exponent + * @default 0x10001 + */ + publicExponent?: number | undefined; + } + interface RSAPSSKeyPairKeyObjectOptions { + /** + * Key size in bits + */ + modulusLength: number; + /** + * Public exponent + * @default 0x10001 + */ + publicExponent?: number | undefined; + /** + * Name of the message digest + */ + hashAlgorithm?: string; + /** + * Name of the message digest used by MGF1 + */ + mgf1HashAlgorithm?: string; + /** + * Minimal salt length in bytes + */ + saltLength?: string; + } + interface DSAKeyPairKeyObjectOptions { + /** + * Key size in bits + */ + modulusLength: number; + /** + * Size of q in bits + */ + divisorLength: number; + } + interface RSAKeyPairOptions { + /** + * Key size in bits + */ + modulusLength: number; + /** + * Public exponent + * @default 0x10001 + */ + publicExponent?: number | undefined; + publicKeyEncoding: { + type: 'pkcs1' | 'spki'; + format: PubF; + }; + privateKeyEncoding: BasePrivateKeyEncodingOptions & { + type: 'pkcs1' | 'pkcs8'; + }; + } + interface RSAPSSKeyPairOptions { + /** + * Key size in bits + */ + modulusLength: number; + /** + * Public exponent + * @default 0x10001 + */ + publicExponent?: number | undefined; + /** + * Name of the message digest + */ + hashAlgorithm?: string; + /** + * Name of the message digest used by MGF1 + */ + mgf1HashAlgorithm?: string; + /** + * Minimal salt length in bytes + */ + saltLength?: string; + publicKeyEncoding: { + type: 'spki'; + format: PubF; + }; + privateKeyEncoding: BasePrivateKeyEncodingOptions & { + type: 'pkcs8'; + }; + } + interface DSAKeyPairOptions { + /** + * Key size in bits + */ + modulusLength: number; + /** + * Size of q in bits + */ + divisorLength: number; + publicKeyEncoding: { + type: 'spki'; + format: PubF; + }; + privateKeyEncoding: BasePrivateKeyEncodingOptions & { + type: 'pkcs8'; + }; + } + interface ECKeyPairOptions { + /** + * Name of the curve to use. + */ + namedCurve: string; + publicKeyEncoding: { + type: 'pkcs1' | 'spki'; + format: PubF; + }; + privateKeyEncoding: BasePrivateKeyEncodingOptions & { + type: 'sec1' | 'pkcs8'; + }; + } + interface ED25519KeyPairOptions { + publicKeyEncoding: { + type: 'spki'; + format: PubF; + }; + privateKeyEncoding: BasePrivateKeyEncodingOptions & { + type: 'pkcs8'; + }; + } + interface ED448KeyPairOptions { + publicKeyEncoding: { + type: 'spki'; + format: PubF; + }; + privateKeyEncoding: BasePrivateKeyEncodingOptions & { + type: 'pkcs8'; + }; + } + interface X25519KeyPairOptions { + publicKeyEncoding: { + type: 'spki'; + format: PubF; + }; + privateKeyEncoding: BasePrivateKeyEncodingOptions & { + type: 'pkcs8'; + }; + } + interface X448KeyPairOptions { + publicKeyEncoding: { + type: 'spki'; + format: PubF; + }; + privateKeyEncoding: BasePrivateKeyEncodingOptions & { + type: 'pkcs8'; + }; + } + interface KeyPairSyncResult { + publicKey: T1; + privateKey: T2; + } + /** + * Generates a new asymmetric key pair of the given `type`. RSA, RSA-PSS, DSA, EC, + * Ed25519, Ed448, X25519, X448, and DH are currently supported. + * + * If a `publicKeyEncoding` or `privateKeyEncoding` was specified, this function + * behaves as if `keyObject.export()` had been called on its result. Otherwise, + * the respective part of the key is returned as a `KeyObject`. + * + * When encoding public keys, it is recommended to use `'spki'`. When encoding + * private keys, it is recommended to use `'pkcs8'` with a strong passphrase, + * and to keep the passphrase confidential. + * + * ```js + * const { + * generateKeyPairSync, + * } = await import('node:crypto'); + * + * const { + * publicKey, + * privateKey, + * } = generateKeyPairSync('rsa', { + * modulusLength: 4096, + * publicKeyEncoding: { + * type: 'spki', + * format: 'pem', + * }, + * privateKeyEncoding: { + * type: 'pkcs8', + * format: 'pem', + * cipher: 'aes-256-cbc', + * passphrase: 'top secret', + * }, + * }); + * ``` + * + * The return value `{ publicKey, privateKey }` represents the generated key pair. + * When PEM encoding was selected, the respective key will be a string, otherwise + * it will be a buffer containing the data encoded as DER. + * @since v10.12.0 + * @param type Must be `'rsa'`, `'rsa-pss'`, `'dsa'`, `'ec'`, `'ed25519'`, `'ed448'`, `'x25519'`, `'x448'`, or `'dh'`. + */ + function generateKeyPairSync(type: 'rsa', options: RSAKeyPairOptions<'pem', 'pem'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'rsa', options: RSAKeyPairOptions<'pem', 'der'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'rsa', options: RSAKeyPairOptions<'der', 'pem'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'rsa', options: RSAKeyPairOptions<'der', 'der'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'rsa', options: RSAKeyPairKeyObjectOptions): KeyPairKeyObjectResult; + function generateKeyPairSync(type: 'rsa-pss', options: RSAPSSKeyPairOptions<'pem', 'pem'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'rsa-pss', options: RSAPSSKeyPairOptions<'pem', 'der'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'rsa-pss', options: RSAPSSKeyPairOptions<'der', 'pem'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'rsa-pss', options: RSAPSSKeyPairOptions<'der', 'der'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'rsa-pss', options: RSAPSSKeyPairKeyObjectOptions): KeyPairKeyObjectResult; + function generateKeyPairSync(type: 'dsa', options: DSAKeyPairOptions<'pem', 'pem'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'dsa', options: DSAKeyPairOptions<'pem', 'der'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'dsa', options: DSAKeyPairOptions<'der', 'pem'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'dsa', options: DSAKeyPairOptions<'der', 'der'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'dsa', options: DSAKeyPairKeyObjectOptions): KeyPairKeyObjectResult; + function generateKeyPairSync(type: 'ec', options: ECKeyPairOptions<'pem', 'pem'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'ec', options: ECKeyPairOptions<'pem', 'der'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'ec', options: ECKeyPairOptions<'der', 'pem'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'ec', options: ECKeyPairOptions<'der', 'der'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'ec', options: ECKeyPairKeyObjectOptions): KeyPairKeyObjectResult; + function generateKeyPairSync(type: 'ed25519', options: ED25519KeyPairOptions<'pem', 'pem'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'ed25519', options: ED25519KeyPairOptions<'pem', 'der'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'ed25519', options: ED25519KeyPairOptions<'der', 'pem'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'ed25519', options: ED25519KeyPairOptions<'der', 'der'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'ed25519', options?: ED25519KeyPairKeyObjectOptions): KeyPairKeyObjectResult; + function generateKeyPairSync(type: 'ed448', options: ED448KeyPairOptions<'pem', 'pem'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'ed448', options: ED448KeyPairOptions<'pem', 'der'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'ed448', options: ED448KeyPairOptions<'der', 'pem'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'ed448', options: ED448KeyPairOptions<'der', 'der'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'ed448', options?: ED448KeyPairKeyObjectOptions): KeyPairKeyObjectResult; + function generateKeyPairSync(type: 'x25519', options: X25519KeyPairOptions<'pem', 'pem'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'x25519', options: X25519KeyPairOptions<'pem', 'der'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'x25519', options: X25519KeyPairOptions<'der', 'pem'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'x25519', options: X25519KeyPairOptions<'der', 'der'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'x25519', options?: X25519KeyPairKeyObjectOptions): KeyPairKeyObjectResult; + function generateKeyPairSync(type: 'x448', options: X448KeyPairOptions<'pem', 'pem'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'x448', options: X448KeyPairOptions<'pem', 'der'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'x448', options: X448KeyPairOptions<'der', 'pem'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'x448', options: X448KeyPairOptions<'der', 'der'>): KeyPairSyncResult; + function generateKeyPairSync(type: 'x448', options?: X448KeyPairKeyObjectOptions): KeyPairKeyObjectResult; + /** + * Generates a new asymmetric key pair of the given `type`. RSA, RSA-PSS, DSA, EC, + * Ed25519, Ed448, X25519, X448, and DH are currently supported. + * + * If a `publicKeyEncoding` or `privateKeyEncoding` was specified, this function + * behaves as if `keyObject.export()` had been called on its result. Otherwise, + * the respective part of the key is returned as a `KeyObject`. + * + * It is recommended to encode public keys as `'spki'` and private keys as`'pkcs8'` with encryption for long-term storage: + * + * ```js + * const { + * generateKeyPair, + * } = await import('node:crypto'); + * + * generateKeyPair('rsa', { + * modulusLength: 4096, + * publicKeyEncoding: { + * type: 'spki', + * format: 'pem', + * }, + * privateKeyEncoding: { + * type: 'pkcs8', + * format: 'pem', + * cipher: 'aes-256-cbc', + * passphrase: 'top secret', + * }, + * }, (err, publicKey, privateKey) => { + * // Handle errors and use the generated key pair. + * }); + * ``` + * + * On completion, `callback` will be called with `err` set to `undefined` and`publicKey` / `privateKey` representing the generated key pair. + * + * If this method is invoked as its `util.promisify()` ed version, it returns + * a `Promise` for an `Object` with `publicKey` and `privateKey` properties. + * @since v10.12.0 + * @param type Must be `'rsa'`, `'rsa-pss'`, `'dsa'`, `'ec'`, `'ed25519'`, `'ed448'`, `'x25519'`, `'x448'`, or `'dh'`. + */ + function generateKeyPair(type: 'rsa', options: RSAKeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void; + function generateKeyPair(type: 'rsa', options: RSAKeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void; + function generateKeyPair(type: 'rsa', options: RSAKeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void; + function generateKeyPair(type: 'rsa', options: RSAKeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void; + function generateKeyPair(type: 'rsa', options: RSAKeyPairKeyObjectOptions, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void; + function generateKeyPair(type: 'rsa-pss', options: RSAPSSKeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void; + function generateKeyPair(type: 'rsa-pss', options: RSAPSSKeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void; + function generateKeyPair(type: 'rsa-pss', options: RSAPSSKeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void; + function generateKeyPair(type: 'rsa-pss', options: RSAPSSKeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void; + function generateKeyPair(type: 'rsa-pss', options: RSAPSSKeyPairKeyObjectOptions, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void; + function generateKeyPair(type: 'dsa', options: DSAKeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void; + function generateKeyPair(type: 'dsa', options: DSAKeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void; + function generateKeyPair(type: 'dsa', options: DSAKeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void; + function generateKeyPair(type: 'dsa', options: DSAKeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void; + function generateKeyPair(type: 'dsa', options: DSAKeyPairKeyObjectOptions, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void; + function generateKeyPair(type: 'ec', options: ECKeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void; + function generateKeyPair(type: 'ec', options: ECKeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void; + function generateKeyPair(type: 'ec', options: ECKeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void; + function generateKeyPair(type: 'ec', options: ECKeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void; + function generateKeyPair(type: 'ec', options: ECKeyPairKeyObjectOptions, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void; + function generateKeyPair(type: 'ed25519', options: ED25519KeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void; + function generateKeyPair(type: 'ed25519', options: ED25519KeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void; + function generateKeyPair(type: 'ed25519', options: ED25519KeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void; + function generateKeyPair(type: 'ed25519', options: ED25519KeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void; + function generateKeyPair(type: 'ed25519', options: ED25519KeyPairKeyObjectOptions | undefined, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void; + function generateKeyPair(type: 'ed448', options: ED448KeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void; + function generateKeyPair(type: 'ed448', options: ED448KeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void; + function generateKeyPair(type: 'ed448', options: ED448KeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void; + function generateKeyPair(type: 'ed448', options: ED448KeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void; + function generateKeyPair(type: 'ed448', options: ED448KeyPairKeyObjectOptions | undefined, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void; + function generateKeyPair(type: 'x25519', options: X25519KeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void; + function generateKeyPair(type: 'x25519', options: X25519KeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void; + function generateKeyPair(type: 'x25519', options: X25519KeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void; + function generateKeyPair(type: 'x25519', options: X25519KeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void; + function generateKeyPair(type: 'x25519', options: X25519KeyPairKeyObjectOptions | undefined, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void; + function generateKeyPair(type: 'x448', options: X448KeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void; + function generateKeyPair(type: 'x448', options: X448KeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void; + function generateKeyPair(type: 'x448', options: X448KeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void; + function generateKeyPair(type: 'x448', options: X448KeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void; + function generateKeyPair(type: 'x448', options: X448KeyPairKeyObjectOptions | undefined, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void; + namespace generateKeyPair { + function __promisify__( + type: 'rsa', + options: RSAKeyPairOptions<'pem', 'pem'> + ): Promise<{ + publicKey: string; + privateKey: string; + }>; + function __promisify__( + type: 'rsa', + options: RSAKeyPairOptions<'pem', 'der'> + ): Promise<{ + publicKey: string; + privateKey: Buffer; + }>; + function __promisify__( + type: 'rsa', + options: RSAKeyPairOptions<'der', 'pem'> + ): Promise<{ + publicKey: Buffer; + privateKey: string; + }>; + function __promisify__( + type: 'rsa', + options: RSAKeyPairOptions<'der', 'der'> + ): Promise<{ + publicKey: Buffer; + privateKey: Buffer; + }>; + function __promisify__(type: 'rsa', options: RSAKeyPairKeyObjectOptions): Promise; + function __promisify__( + type: 'rsa-pss', + options: RSAPSSKeyPairOptions<'pem', 'pem'> + ): Promise<{ + publicKey: string; + privateKey: string; + }>; + function __promisify__( + type: 'rsa-pss', + options: RSAPSSKeyPairOptions<'pem', 'der'> + ): Promise<{ + publicKey: string; + privateKey: Buffer; + }>; + function __promisify__( + type: 'rsa-pss', + options: RSAPSSKeyPairOptions<'der', 'pem'> + ): Promise<{ + publicKey: Buffer; + privateKey: string; + }>; + function __promisify__( + type: 'rsa-pss', + options: RSAPSSKeyPairOptions<'der', 'der'> + ): Promise<{ + publicKey: Buffer; + privateKey: Buffer; + }>; + function __promisify__(type: 'rsa-pss', options: RSAPSSKeyPairKeyObjectOptions): Promise; + function __promisify__( + type: 'dsa', + options: DSAKeyPairOptions<'pem', 'pem'> + ): Promise<{ + publicKey: string; + privateKey: string; + }>; + function __promisify__( + type: 'dsa', + options: DSAKeyPairOptions<'pem', 'der'> + ): Promise<{ + publicKey: string; + privateKey: Buffer; + }>; + function __promisify__( + type: 'dsa', + options: DSAKeyPairOptions<'der', 'pem'> + ): Promise<{ + publicKey: Buffer; + privateKey: string; + }>; + function __promisify__( + type: 'dsa', + options: DSAKeyPairOptions<'der', 'der'> + ): Promise<{ + publicKey: Buffer; + privateKey: Buffer; + }>; + function __promisify__(type: 'dsa', options: DSAKeyPairKeyObjectOptions): Promise; + function __promisify__( + type: 'ec', + options: ECKeyPairOptions<'pem', 'pem'> + ): Promise<{ + publicKey: string; + privateKey: string; + }>; + function __promisify__( + type: 'ec', + options: ECKeyPairOptions<'pem', 'der'> + ): Promise<{ + publicKey: string; + privateKey: Buffer; + }>; + function __promisify__( + type: 'ec', + options: ECKeyPairOptions<'der', 'pem'> + ): Promise<{ + publicKey: Buffer; + privateKey: string; + }>; + function __promisify__( + type: 'ec', + options: ECKeyPairOptions<'der', 'der'> + ): Promise<{ + publicKey: Buffer; + privateKey: Buffer; + }>; + function __promisify__(type: 'ec', options: ECKeyPairKeyObjectOptions): Promise; + function __promisify__( + type: 'ed25519', + options: ED25519KeyPairOptions<'pem', 'pem'> + ): Promise<{ + publicKey: string; + privateKey: string; + }>; + function __promisify__( + type: 'ed25519', + options: ED25519KeyPairOptions<'pem', 'der'> + ): Promise<{ + publicKey: string; + privateKey: Buffer; + }>; + function __promisify__( + type: 'ed25519', + options: ED25519KeyPairOptions<'der', 'pem'> + ): Promise<{ + publicKey: Buffer; + privateKey: string; + }>; + function __promisify__( + type: 'ed25519', + options: ED25519KeyPairOptions<'der', 'der'> + ): Promise<{ + publicKey: Buffer; + privateKey: Buffer; + }>; + function __promisify__(type: 'ed25519', options?: ED25519KeyPairKeyObjectOptions): Promise; + function __promisify__( + type: 'ed448', + options: ED448KeyPairOptions<'pem', 'pem'> + ): Promise<{ + publicKey: string; + privateKey: string; + }>; + function __promisify__( + type: 'ed448', + options: ED448KeyPairOptions<'pem', 'der'> + ): Promise<{ + publicKey: string; + privateKey: Buffer; + }>; + function __promisify__( + type: 'ed448', + options: ED448KeyPairOptions<'der', 'pem'> + ): Promise<{ + publicKey: Buffer; + privateKey: string; + }>; + function __promisify__( + type: 'ed448', + options: ED448KeyPairOptions<'der', 'der'> + ): Promise<{ + publicKey: Buffer; + privateKey: Buffer; + }>; + function __promisify__(type: 'ed448', options?: ED448KeyPairKeyObjectOptions): Promise; + function __promisify__( + type: 'x25519', + options: X25519KeyPairOptions<'pem', 'pem'> + ): Promise<{ + publicKey: string; + privateKey: string; + }>; + function __promisify__( + type: 'x25519', + options: X25519KeyPairOptions<'pem', 'der'> + ): Promise<{ + publicKey: string; + privateKey: Buffer; + }>; + function __promisify__( + type: 'x25519', + options: X25519KeyPairOptions<'der', 'pem'> + ): Promise<{ + publicKey: Buffer; + privateKey: string; + }>; + function __promisify__( + type: 'x25519', + options: X25519KeyPairOptions<'der', 'der'> + ): Promise<{ + publicKey: Buffer; + privateKey: Buffer; + }>; + function __promisify__(type: 'x25519', options?: X25519KeyPairKeyObjectOptions): Promise; + function __promisify__( + type: 'x448', + options: X448KeyPairOptions<'pem', 'pem'> + ): Promise<{ + publicKey: string; + privateKey: string; + }>; + function __promisify__( + type: 'x448', + options: X448KeyPairOptions<'pem', 'der'> + ): Promise<{ + publicKey: string; + privateKey: Buffer; + }>; + function __promisify__( + type: 'x448', + options: X448KeyPairOptions<'der', 'pem'> + ): Promise<{ + publicKey: Buffer; + privateKey: string; + }>; + function __promisify__( + type: 'x448', + options: X448KeyPairOptions<'der', 'der'> + ): Promise<{ + publicKey: Buffer; + privateKey: Buffer; + }>; + function __promisify__(type: 'x448', options?: X448KeyPairKeyObjectOptions): Promise; + } + /** + * Calculates and returns the signature for `data` using the given private key and + * algorithm. If `algorithm` is `null` or `undefined`, then the algorithm is + * dependent upon the key type (especially Ed25519 and Ed448). + * + * If `key` is not a `KeyObject`, this function behaves as if `key` had been + * passed to {@link createPrivateKey}. If it is an object, the following + * additional properties can be passed: + * + * If the `callback` function is provided this function uses libuv's threadpool. + * @since v12.0.0 + */ + function sign(algorithm: string | null | undefined, data: NodeJS.ArrayBufferView, key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput): Buffer; + function sign( + algorithm: string | null | undefined, + data: NodeJS.ArrayBufferView, + key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput, + callback: (error: Error | null, data: Buffer) => void + ): void; + /** + * Verifies the given signature for `data` using the given key and algorithm. If`algorithm` is `null` or `undefined`, then the algorithm is dependent upon the + * key type (especially Ed25519 and Ed448). + * + * If `key` is not a `KeyObject`, this function behaves as if `key` had been + * passed to {@link createPublicKey}. If it is an object, the following + * additional properties can be passed: + * + * The `signature` argument is the previously calculated signature for the `data`. + * + * Because public keys can be derived from private keys, a private key or a public + * key may be passed for `key`. + * + * If the `callback` function is provided this function uses libuv's threadpool. + * @since v12.0.0 + */ + function verify( + algorithm: string | null | undefined, + data: NodeJS.ArrayBufferView, + key: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput | VerifyJsonWebKeyInput, + signature: NodeJS.ArrayBufferView + ): boolean; + function verify( + algorithm: string | null | undefined, + data: NodeJS.ArrayBufferView, + key: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput | VerifyJsonWebKeyInput, + signature: NodeJS.ArrayBufferView, + callback: (error: Error | null, result: boolean) => void + ): void; + /** + * Computes the Diffie-Hellman secret based on a `privateKey` and a `publicKey`. + * Both keys must have the same `asymmetricKeyType`, which must be one of `'dh'`(for Diffie-Hellman), `'ec'` (for ECDH), `'x448'`, or `'x25519'` (for ECDH-ES). + * @since v13.9.0, v12.17.0 + */ + function diffieHellman(options: { privateKey: KeyObject; publicKey: KeyObject }): Buffer; + type CipherMode = 'cbc' | 'ccm' | 'cfb' | 'ctr' | 'ecb' | 'gcm' | 'ocb' | 'ofb' | 'stream' | 'wrap' | 'xts'; + interface CipherInfoOptions { + /** + * A test key length. + */ + keyLength?: number | undefined; + /** + * A test IV length. + */ + ivLength?: number | undefined; + } + interface CipherInfo { + /** + * The name of the cipher. + */ + name: string; + /** + * The nid of the cipher. + */ + nid: number; + /** + * The block size of the cipher in bytes. + * This property is omitted when mode is 'stream'. + */ + blockSize?: number | undefined; + /** + * The expected or default initialization vector length in bytes. + * This property is omitted if the cipher does not use an initialization vector. + */ + ivLength?: number | undefined; + /** + * The expected or default key length in bytes. + */ + keyLength: number; + /** + * The cipher mode. + */ + mode: CipherMode; + } + /** + * Returns information about a given cipher. + * + * Some ciphers accept variable length keys and initialization vectors. By default, + * the `crypto.getCipherInfo()` method will return the default values for these + * ciphers. To test if a given key length or iv length is acceptable for given + * cipher, use the `keyLength` and `ivLength` options. If the given values are + * unacceptable, `undefined` will be returned. + * @since v15.0.0 + * @param nameOrNid The name or nid of the cipher to query. + */ + function getCipherInfo(nameOrNid: string | number, options?: CipherInfoOptions): CipherInfo | undefined; + /** + * HKDF is a simple key derivation function defined in RFC 5869\. The given `ikm`,`salt` and `info` are used with the `digest` to derive a key of `keylen` bytes. + * + * The supplied `callback` function is called with two arguments: `err` and`derivedKey`. If an errors occurs while deriving the key, `err` will be set; + * otherwise `err` will be `null`. The successfully generated `derivedKey` will + * be passed to the callback as an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer). An error will be thrown if any + * of the input arguments specify invalid values or types. + * + * ```js + * import { Buffer } from 'node:buffer'; + * const { + * hkdf, + * } = await import('node:crypto'); + * + * hkdf('sha512', 'key', 'salt', 'info', 64, (err, derivedKey) => { + * if (err) throw err; + * console.log(Buffer.from(derivedKey).toString('hex')); // '24156e2...5391653' + * }); + * ``` + * @since v15.0.0 + * @param digest The digest algorithm to use. + * @param ikm The input keying material. Must be provided but can be zero-length. + * @param salt The salt value. Must be provided but can be zero-length. + * @param info Additional info value. Must be provided but can be zero-length, and cannot be more than 1024 bytes. + * @param keylen The length of the key to generate. Must be greater than 0. The maximum allowable value is `255` times the number of bytes produced by the selected digest function (e.g. `sha512` + * generates 64-byte hashes, making the maximum HKDF output 16320 bytes). + */ + function hkdf(digest: string, irm: BinaryLike | KeyObject, salt: BinaryLike, info: BinaryLike, keylen: number, callback: (err: Error | null, derivedKey: ArrayBuffer) => void): void; + /** + * Provides a synchronous HKDF key derivation function as defined in RFC 5869\. The + * given `ikm`, `salt` and `info` are used with the `digest` to derive a key of`keylen` bytes. + * + * The successfully generated `derivedKey` will be returned as an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer). + * + * An error will be thrown if any of the input arguments specify invalid values or + * types, or if the derived key cannot be generated. + * + * ```js + * import { Buffer } from 'node:buffer'; + * const { + * hkdfSync, + * } = await import('node:crypto'); + * + * const derivedKey = hkdfSync('sha512', 'key', 'salt', 'info', 64); + * console.log(Buffer.from(derivedKey).toString('hex')); // '24156e2...5391653' + * ``` + * @since v15.0.0 + * @param digest The digest algorithm to use. + * @param ikm The input keying material. Must be provided but can be zero-length. + * @param salt The salt value. Must be provided but can be zero-length. + * @param info Additional info value. Must be provided but can be zero-length, and cannot be more than 1024 bytes. + * @param keylen The length of the key to generate. Must be greater than 0. The maximum allowable value is `255` times the number of bytes produced by the selected digest function (e.g. `sha512` + * generates 64-byte hashes, making the maximum HKDF output 16320 bytes). + */ + function hkdfSync(digest: string, ikm: BinaryLike | KeyObject, salt: BinaryLike, info: BinaryLike, keylen: number): ArrayBuffer; + interface SecureHeapUsage { + /** + * The total allocated secure heap size as specified using the `--secure-heap=n` command-line flag. + */ + total: number; + /** + * The minimum allocation from the secure heap as specified using the `--secure-heap-min` command-line flag. + */ + min: number; + /** + * The total number of bytes currently allocated from the secure heap. + */ + used: number; + /** + * The calculated ratio of `used` to `total` allocated bytes. + */ + utilization: number; + } + /** + * @since v15.6.0 + */ + function secureHeapUsed(): SecureHeapUsage; + interface RandomUUIDOptions { + /** + * By default, to improve performance, + * Node.js will pre-emptively generate and persistently cache enough + * random data to generate up to 128 random UUIDs. To generate a UUID + * without using the cache, set `disableEntropyCache` to `true`. + * + * @default `false` + */ + disableEntropyCache?: boolean | undefined; + } + /** + * Generates a random [RFC 4122](https://www.rfc-editor.org/rfc/rfc4122.txt) version 4 UUID. The UUID is generated using a + * cryptographic pseudorandom number generator. + * @since v15.6.0, v14.17.0 + */ + function randomUUID(options?: RandomUUIDOptions): string; + interface X509CheckOptions { + /** + * @default 'always' + */ + subject?: 'always' | 'default' | 'never'; + /** + * @default true + */ + wildcards?: boolean; + /** + * @default true + */ + partialWildcards?: boolean; + /** + * @default false + */ + multiLabelWildcards?: boolean; + /** + * @default false + */ + singleLabelSubdomains?: boolean; + } + /** + * Encapsulates an X509 certificate and provides read-only access to + * its information. + * + * ```js + * const { X509Certificate } = await import('node:crypto'); + * + * const x509 = new X509Certificate('{... pem encoded cert ...}'); + * + * console.log(x509.subject); + * ``` + * @since v15.6.0 + */ + class X509Certificate { + /** + * Will be \`true\` if this is a Certificate Authority (CA) certificate. + * @since v15.6.0 + */ + readonly ca: boolean; + /** + * The SHA-1 fingerprint of this certificate. + * + * Because SHA-1 is cryptographically broken and because the security of SHA-1 is + * significantly worse than that of algorithms that are commonly used to sign + * certificates, consider using `x509.fingerprint256` instead. + * @since v15.6.0 + */ + readonly fingerprint: string; + /** + * The SHA-256 fingerprint of this certificate. + * @since v15.6.0 + */ + readonly fingerprint256: string; + /** + * The SHA-512 fingerprint of this certificate. + * + * Because computing the SHA-256 fingerprint is usually faster and because it is + * only half the size of the SHA-512 fingerprint, `x509.fingerprint256` may be + * a better choice. While SHA-512 presumably provides a higher level of security in + * general, the security of SHA-256 matches that of most algorithms that are + * commonly used to sign certificates. + * @since v17.2.0, v16.14.0 + */ + readonly fingerprint512: string; + /** + * The complete subject of this certificate. + * @since v15.6.0 + */ + readonly subject: string; + /** + * The subject alternative name specified for this certificate. + * + * This is a comma-separated list of subject alternative names. Each entry begins + * with a string identifying the kind of the subject alternative name followed by + * a colon and the value associated with the entry. + * + * Earlier versions of Node.js incorrectly assumed that it is safe to split this + * property at the two-character sequence `', '` (see [CVE-2021-44532](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-44532)). However, + * both malicious and legitimate certificates can contain subject alternative names + * that include this sequence when represented as a string. + * + * After the prefix denoting the type of the entry, the remainder of each entry + * might be enclosed in quotes to indicate that the value is a JSON string literal. + * For backward compatibility, Node.js only uses JSON string literals within this + * property when necessary to avoid ambiguity. Third-party code should be prepared + * to handle both possible entry formats. + * @since v15.6.0 + */ + readonly subjectAltName: string | undefined; + /** + * A textual representation of the certificate's authority information access + * extension. + * + * This is a line feed separated list of access descriptions. Each line begins with + * the access method and the kind of the access location, followed by a colon and + * the value associated with the access location. + * + * After the prefix denoting the access method and the kind of the access location, + * the remainder of each line might be enclosed in quotes to indicate that the + * value is a JSON string literal. For backward compatibility, Node.js only uses + * JSON string literals within this property when necessary to avoid ambiguity. + * Third-party code should be prepared to handle both possible entry formats. + * @since v15.6.0 + */ + readonly infoAccess: string | undefined; + /** + * An array detailing the key usages for this certificate. + * @since v15.6.0 + */ + readonly keyUsage: string[]; + /** + * The issuer identification included in this certificate. + * @since v15.6.0 + */ + readonly issuer: string; + /** + * The issuer certificate or `undefined` if the issuer certificate is not + * available. + * @since v15.9.0 + */ + readonly issuerCertificate?: X509Certificate | undefined; + /** + * The public key `KeyObject` for this certificate. + * @since v15.6.0 + */ + readonly publicKey: KeyObject; + /** + * A `Buffer` containing the DER encoding of this certificate. + * @since v15.6.0 + */ + readonly raw: Buffer; + /** + * The serial number of this certificate. + * + * Serial numbers are assigned by certificate authorities and do not uniquely + * identify certificates. Consider using `x509.fingerprint256` as a unique + * identifier instead. + * @since v15.6.0 + */ + readonly serialNumber: string; + /** + * The date/time from which this certificate is considered valid. + * @since v15.6.0 + */ + readonly validFrom: string; + /** + * The date/time until which this certificate is considered valid. + * @since v15.6.0 + */ + readonly validTo: string; + constructor(buffer: BinaryLike); + /** + * Checks whether the certificate matches the given email address. + * + * If the `'subject'` option is undefined or set to `'default'`, the certificate + * subject is only considered if the subject alternative name extension either does + * not exist or does not contain any email addresses. + * + * If the `'subject'` option is set to `'always'` and if the subject alternative + * name extension either does not exist or does not contain a matching email + * address, the certificate subject is considered. + * + * If the `'subject'` option is set to `'never'`, the certificate subject is never + * considered, even if the certificate contains no subject alternative names. + * @since v15.6.0 + * @return Returns `email` if the certificate matches, `undefined` if it does not. + */ + checkEmail(email: string, options?: Pick): string | undefined; + /** + * Checks whether the certificate matches the given host name. + * + * If the certificate matches the given host name, the matching subject name is + * returned. The returned name might be an exact match (e.g., `foo.example.com`) + * or it might contain wildcards (e.g., `*.example.com`). Because host name + * comparisons are case-insensitive, the returned subject name might also differ + * from the given `name` in capitalization. + * + * If the `'subject'` option is undefined or set to `'default'`, the certificate + * subject is only considered if the subject alternative name extension either does + * not exist or does not contain any DNS names. This behavior is consistent with [RFC 2818](https://www.rfc-editor.org/rfc/rfc2818.txt) ("HTTP Over TLS"). + * + * If the `'subject'` option is set to `'always'` and if the subject alternative + * name extension either does not exist or does not contain a matching DNS name, + * the certificate subject is considered. + * + * If the `'subject'` option is set to `'never'`, the certificate subject is never + * considered, even if the certificate contains no subject alternative names. + * @since v15.6.0 + * @return Returns a subject name that matches `name`, or `undefined` if no subject name matches `name`. + */ + checkHost(name: string, options?: X509CheckOptions): string | undefined; + /** + * Checks whether the certificate matches the given IP address (IPv4 or IPv6). + * + * Only [RFC 5280](https://www.rfc-editor.org/rfc/rfc5280.txt) `iPAddress` subject alternative names are considered, and they + * must match the given `ip` address exactly. Other subject alternative names as + * well as the subject field of the certificate are ignored. + * @since v15.6.0 + * @return Returns `ip` if the certificate matches, `undefined` if it does not. + */ + checkIP(ip: string): string | undefined; + /** + * Checks whether this certificate was issued by the given `otherCert`. + * @since v15.6.0 + */ + checkIssued(otherCert: X509Certificate): boolean; + /** + * Checks whether the public key for this certificate is consistent with + * the given private key. + * @since v15.6.0 + * @param privateKey A private key. + */ + checkPrivateKey(privateKey: KeyObject): boolean; + /** + * There is no standard JSON encoding for X509 certificates. The`toJSON()` method returns a string containing the PEM encoded + * certificate. + * @since v15.6.0 + */ + toJSON(): string; + /** + * Returns information about this certificate using the legacy `certificate object` encoding. + * @since v15.6.0 + */ + toLegacyObject(): PeerCertificate; + /** + * Returns the PEM-encoded certificate. + * @since v15.6.0 + */ + toString(): string; + /** + * Verifies that this certificate was signed by the given public key. + * Does not perform any other validation checks on the certificate. + * @since v15.6.0 + * @param publicKey A public key. + */ + verify(publicKey: KeyObject): boolean; + } + type LargeNumberLike = NodeJS.ArrayBufferView | SharedArrayBuffer | ArrayBuffer | bigint; + interface GeneratePrimeOptions { + add?: LargeNumberLike | undefined; + rem?: LargeNumberLike | undefined; + /** + * @default false + */ + safe?: boolean | undefined; + bigint?: boolean | undefined; + } + interface GeneratePrimeOptionsBigInt extends GeneratePrimeOptions { + bigint: true; + } + interface GeneratePrimeOptionsArrayBuffer extends GeneratePrimeOptions { + bigint?: false | undefined; + } + /** + * Generates a pseudorandom prime of `size` bits. + * + * If `options.safe` is `true`, the prime will be a safe prime -- that is,`(prime - 1) / 2` will also be a prime. + * + * The `options.add` and `options.rem` parameters can be used to enforce additional + * requirements, e.g., for Diffie-Hellman: + * + * * If `options.add` and `options.rem` are both set, the prime will satisfy the + * condition that `prime % add = rem`. + * * If only `options.add` is set and `options.safe` is not `true`, the prime will + * satisfy the condition that `prime % add = 1`. + * * If only `options.add` is set and `options.safe` is set to `true`, the prime + * will instead satisfy the condition that `prime % add = 3`. This is necessary + * because `prime % add = 1` for `options.add > 2` would contradict the condition + * enforced by `options.safe`. + * * `options.rem` is ignored if `options.add` is not given. + * + * Both `options.add` and `options.rem` must be encoded as big-endian sequences + * if given as an `ArrayBuffer`, `SharedArrayBuffer`, `TypedArray`, `Buffer`, or`DataView`. + * + * By default, the prime is encoded as a big-endian sequence of octets + * in an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer). If the `bigint` option is `true`, then a + * [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) is provided. + * @since v15.8.0 + * @param size The size (in bits) of the prime to generate. + */ + function generatePrime(size: number, callback: (err: Error | null, prime: ArrayBuffer) => void): void; + function generatePrime(size: number, options: GeneratePrimeOptionsBigInt, callback: (err: Error | null, prime: bigint) => void): void; + function generatePrime(size: number, options: GeneratePrimeOptionsArrayBuffer, callback: (err: Error | null, prime: ArrayBuffer) => void): void; + function generatePrime(size: number, options: GeneratePrimeOptions, callback: (err: Error | null, prime: ArrayBuffer | bigint) => void): void; + /** + * Generates a pseudorandom prime of `size` bits. + * + * If `options.safe` is `true`, the prime will be a safe prime -- that is,`(prime - 1) / 2` will also be a prime. + * + * The `options.add` and `options.rem` parameters can be used to enforce additional + * requirements, e.g., for Diffie-Hellman: + * + * * If `options.add` and `options.rem` are both set, the prime will satisfy the + * condition that `prime % add = rem`. + * * If only `options.add` is set and `options.safe` is not `true`, the prime will + * satisfy the condition that `prime % add = 1`. + * * If only `options.add` is set and `options.safe` is set to `true`, the prime + * will instead satisfy the condition that `prime % add = 3`. This is necessary + * because `prime % add = 1` for `options.add > 2` would contradict the condition + * enforced by `options.safe`. + * * `options.rem` is ignored if `options.add` is not given. + * + * Both `options.add` and `options.rem` must be encoded as big-endian sequences + * if given as an `ArrayBuffer`, `SharedArrayBuffer`, `TypedArray`, `Buffer`, or`DataView`. + * + * By default, the prime is encoded as a big-endian sequence of octets + * in an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer). If the `bigint` option is `true`, then a + * [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) is provided. + * @since v15.8.0 + * @param size The size (in bits) of the prime to generate. + */ + function generatePrimeSync(size: number): ArrayBuffer; + function generatePrimeSync(size: number, options: GeneratePrimeOptionsBigInt): bigint; + function generatePrimeSync(size: number, options: GeneratePrimeOptionsArrayBuffer): ArrayBuffer; + function generatePrimeSync(size: number, options: GeneratePrimeOptions): ArrayBuffer | bigint; + interface CheckPrimeOptions { + /** + * The number of Miller-Rabin probabilistic primality iterations to perform. + * When the value is 0 (zero), a number of checks is used that yields a false positive rate of at most `2**-64` for random input. + * Care must be used when selecting a number of checks. + * Refer to the OpenSSL documentation for the BN_is_prime_ex function nchecks options for more details. + * + * @default 0 + */ + checks?: number | undefined; + } + /** + * Checks the primality of the `candidate`. + * @since v15.8.0 + * @param candidate A possible prime encoded as a sequence of big endian octets of arbitrary length. + */ + function checkPrime(value: LargeNumberLike, callback: (err: Error | null, result: boolean) => void): void; + function checkPrime(value: LargeNumberLike, options: CheckPrimeOptions, callback: (err: Error | null, result: boolean) => void): void; + /** + * Checks the primality of the `candidate`. + * @since v15.8.0 + * @param candidate A possible prime encoded as a sequence of big endian octets of arbitrary length. + * @return `true` if the candidate is a prime with an error probability less than `0.25 ** options.checks`. + */ + function checkPrimeSync(candidate: LargeNumberLike, options?: CheckPrimeOptions): boolean; + /** + * Load and set the `engine` for some or all OpenSSL functions (selected by flags). + * + * `engine` could be either an id or a path to the engine's shared library. + * + * The optional `flags` argument uses `ENGINE_METHOD_ALL` by default. The `flags`is a bit field taking one of or a mix of the following flags (defined in`crypto.constants`): + * + * * `crypto.constants.ENGINE_METHOD_RSA` + * * `crypto.constants.ENGINE_METHOD_DSA` + * * `crypto.constants.ENGINE_METHOD_DH` + * * `crypto.constants.ENGINE_METHOD_RAND` + * * `crypto.constants.ENGINE_METHOD_EC` + * * `crypto.constants.ENGINE_METHOD_CIPHERS` + * * `crypto.constants.ENGINE_METHOD_DIGESTS` + * * `crypto.constants.ENGINE_METHOD_PKEY_METHS` + * * `crypto.constants.ENGINE_METHOD_PKEY_ASN1_METHS` + * * `crypto.constants.ENGINE_METHOD_ALL` + * * `crypto.constants.ENGINE_METHOD_NONE` + * @since v0.11.11 + * @param flags + */ + function setEngine(engine: string, flags?: number): void; + /** + * A convenient alias for {@link webcrypto.getRandomValues}. This + * implementation is not compliant with the Web Crypto spec, to write + * web-compatible code use {@link webcrypto.getRandomValues} instead. + * @since v17.4.0 + * @return Returns `typedArray`. + */ + function getRandomValues(typedArray: T): T; + /** + * A convenient alias for `crypto.webcrypto.subtle`. + * @since v17.4.0 + */ + const subtle: webcrypto.SubtleCrypto; + /** + * An implementation of the Web Crypto API standard. + * + * See the {@link https://nodejs.org/docs/latest/api/webcrypto.html Web Crypto API documentation} for details. + * @since v15.0.0 + */ + const webcrypto: webcrypto.Crypto; + namespace webcrypto { + type BufferSource = ArrayBufferView | ArrayBuffer; + type KeyFormat = 'jwk' | 'pkcs8' | 'raw' | 'spki'; + type KeyType = 'private' | 'public' | 'secret'; + type KeyUsage = 'decrypt' | 'deriveBits' | 'deriveKey' | 'encrypt' | 'sign' | 'unwrapKey' | 'verify' | 'wrapKey'; + type AlgorithmIdentifier = Algorithm | string; + type HashAlgorithmIdentifier = AlgorithmIdentifier; + type NamedCurve = string; + type BigInteger = Uint8Array; + interface AesCbcParams extends Algorithm { + iv: BufferSource; + } + interface AesCtrParams extends Algorithm { + counter: BufferSource; + length: number; + } + interface AesDerivedKeyParams extends Algorithm { + length: number; + } + interface AesGcmParams extends Algorithm { + additionalData?: BufferSource; + iv: BufferSource; + tagLength?: number; + } + interface AesKeyAlgorithm extends KeyAlgorithm { + length: number; + } + interface AesKeyGenParams extends Algorithm { + length: number; + } + interface Algorithm { + name: string; + } + interface EcKeyAlgorithm extends KeyAlgorithm { + namedCurve: NamedCurve; + } + interface EcKeyGenParams extends Algorithm { + namedCurve: NamedCurve; + } + interface EcKeyImportParams extends Algorithm { + namedCurve: NamedCurve; + } + interface EcdhKeyDeriveParams extends Algorithm { + public: CryptoKey; + } + interface EcdsaParams extends Algorithm { + hash: HashAlgorithmIdentifier; + } + interface Ed448Params extends Algorithm { + context?: BufferSource; + } + interface HkdfParams extends Algorithm { + hash: HashAlgorithmIdentifier; + info: BufferSource; + salt: BufferSource; + } + interface HmacImportParams extends Algorithm { + hash: HashAlgorithmIdentifier; + length?: number; + } + interface HmacKeyAlgorithm extends KeyAlgorithm { + hash: KeyAlgorithm; + length: number; + } + interface HmacKeyGenParams extends Algorithm { + hash: HashAlgorithmIdentifier; + length?: number; + } + interface JsonWebKey { + alg?: string; + crv?: string; + d?: string; + dp?: string; + dq?: string; + e?: string; + ext?: boolean; + k?: string; + key_ops?: string[]; + kty?: string; + n?: string; + oth?: RsaOtherPrimesInfo[]; + p?: string; + q?: string; + qi?: string; + use?: string; + x?: string; + y?: string; + } + interface KeyAlgorithm { + name: string; + } + interface Pbkdf2Params extends Algorithm { + hash: HashAlgorithmIdentifier; + iterations: number; + salt: BufferSource; + } + interface RsaHashedImportParams extends Algorithm { + hash: HashAlgorithmIdentifier; + } + interface RsaHashedKeyAlgorithm extends RsaKeyAlgorithm { + hash: KeyAlgorithm; + } + interface RsaHashedKeyGenParams extends RsaKeyGenParams { + hash: HashAlgorithmIdentifier; + } + interface RsaKeyAlgorithm extends KeyAlgorithm { + modulusLength: number; + publicExponent: BigInteger; + } + interface RsaKeyGenParams extends Algorithm { + modulusLength: number; + publicExponent: BigInteger; + } + interface RsaOaepParams extends Algorithm { + label?: BufferSource; + } + interface RsaOtherPrimesInfo { + d?: string; + r?: string; + t?: string; + } + interface RsaPssParams extends Algorithm { + saltLength: number; + } + /** + * Calling `require('node:crypto').webcrypto` returns an instance of the `Crypto` class. + * `Crypto` is a singleton that provides access to the remainder of the crypto API. + * @since v15.0.0 + */ + interface Crypto { + /** + * Provides access to the `SubtleCrypto` API. + * @since v15.0.0 + */ + readonly subtle: SubtleCrypto; + /** + * Generates cryptographically strong random values. + * The given `typedArray` is filled with random values, and a reference to `typedArray` is returned. + * + * The given `typedArray` must be an integer-based instance of {@link NodeJS.TypedArray}, i.e. `Float32Array` and `Float64Array` are not accepted. + * + * An error will be thrown if the given `typedArray` is larger than 65,536 bytes. + * @since v15.0.0 + */ + getRandomValues>(typedArray: T): T; + /** + * Generates a random {@link https://www.rfc-editor.org/rfc/rfc4122.txt RFC 4122} version 4 UUID. + * The UUID is generated using a cryptographic pseudorandom number generator. + * @since v16.7.0 + */ + randomUUID(): string; + CryptoKey: CryptoKeyConstructor; + } + // This constructor throws ILLEGAL_CONSTRUCTOR so it should not be newable. + interface CryptoKeyConstructor { + /** Illegal constructor */ + (_: { readonly _: unique symbol }): never; // Allows instanceof to work but not be callable by the user. + readonly length: 0; + readonly name: 'CryptoKey'; + readonly prototype: CryptoKey; + } + /** + * @since v15.0.0 + */ + interface CryptoKey { + /** + * An object detailing the algorithm for which the key can be used along with additional algorithm-specific parameters. + * @since v15.0.0 + */ + readonly algorithm: KeyAlgorithm; + /** + * When `true`, the {@link CryptoKey} can be extracted using either `subtleCrypto.exportKey()` or `subtleCrypto.wrapKey()`. + * @since v15.0.0 + */ + readonly extractable: boolean; + /** + * A string identifying whether the key is a symmetric (`'secret'`) or asymmetric (`'private'` or `'public'`) key. + * @since v15.0.0 + */ + readonly type: KeyType; + /** + * An array of strings identifying the operations for which the key may be used. + * + * The possible usages are: + * - `'encrypt'` - The key may be used to encrypt data. + * - `'decrypt'` - The key may be used to decrypt data. + * - `'sign'` - The key may be used to generate digital signatures. + * - `'verify'` - The key may be used to verify digital signatures. + * - `'deriveKey'` - The key may be used to derive a new key. + * - `'deriveBits'` - The key may be used to derive bits. + * - `'wrapKey'` - The key may be used to wrap another key. + * - `'unwrapKey'` - The key may be used to unwrap another key. + * + * Valid key usages depend on the key algorithm (identified by `cryptokey.algorithm.name`). + * @since v15.0.0 + */ + readonly usages: KeyUsage[]; + } + /** + * The `CryptoKeyPair` is a simple dictionary object with `publicKey` and `privateKey` properties, representing an asymmetric key pair. + * @since v15.0.0 + */ + interface CryptoKeyPair { + /** + * A {@link CryptoKey} whose type will be `'private'`. + * @since v15.0.0 + */ + privateKey: CryptoKey; + /** + * A {@link CryptoKey} whose type will be `'public'`. + * @since v15.0.0 + */ + publicKey: CryptoKey; + } + /** + * @since v15.0.0 + */ + interface SubtleCrypto { + /** + * Using the method and parameters specified in `algorithm` and the keying material provided by `key`, + * `subtle.decrypt()` attempts to decipher the provided `data`. If successful, + * the returned promise will be resolved with an `` containing the plaintext result. + * + * The algorithms currently supported include: + * + * - `'RSA-OAEP'` + * - `'AES-CTR'` + * - `'AES-CBC'` + * - `'AES-GCM'` + * @since v15.0.0 + */ + decrypt(algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, key: CryptoKey, data: BufferSource): Promise; + /** + * Using the method and parameters specified in `algorithm` and the keying material provided by `baseKey`, + * `subtle.deriveBits()` attempts to generate `length` bits. + * The Node.js implementation requires that when `length` is a number it must be multiple of `8`. + * When `length` is `null` the maximum number of bits for a given algorithm is generated. This is allowed + * for the `'ECDH'`, `'X25519'`, and `'X448'` algorithms. + * If successful, the returned promise will be resolved with an `` containing the generated data. + * + * The algorithms currently supported include: + * + * - `'ECDH'` + * - `'X25519'` + * - `'X448'` + * - `'HKDF'` + * - `'PBKDF2'` + * @since v15.0.0 + */ + deriveBits(algorithm: EcdhKeyDeriveParams, baseKey: CryptoKey, length: number | null): Promise; + deriveBits(algorithm: AlgorithmIdentifier | HkdfParams | Pbkdf2Params, baseKey: CryptoKey, length: number): Promise; + /** + * Using the method and parameters specified in `algorithm`, and the keying material provided by `baseKey`, + * `subtle.deriveKey()` attempts to generate a new ` based on the method and parameters in `derivedKeyAlgorithm`. + * + * Calling `subtle.deriveKey()` is equivalent to calling `subtle.deriveBits()` to generate raw keying material, + * then passing the result into the `subtle.importKey()` method using the `deriveKeyAlgorithm`, `extractable`, and `keyUsages` parameters as input. + * + * The algorithms currently supported include: + * + * - `'ECDH'` + * - `'X25519'` + * - `'X448'` + * - `'HKDF'` + * - `'PBKDF2'` + * @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}. + * @since v15.0.0 + */ + deriveKey( + algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params, + baseKey: CryptoKey, + derivedKeyAlgorithm: AlgorithmIdentifier | AesDerivedKeyParams | HmacImportParams | HkdfParams | Pbkdf2Params, + extractable: boolean, + keyUsages: ReadonlyArray + ): Promise; + /** + * Using the method identified by `algorithm`, `subtle.digest()` attempts to generate a digest of `data`. + * If successful, the returned promise is resolved with an `` containing the computed digest. + * + * If `algorithm` is provided as a ``, it must be one of: + * + * - `'SHA-1'` + * - `'SHA-256'` + * - `'SHA-384'` + * - `'SHA-512'` + * + * If `algorithm` is provided as an ``, it must have a `name` property whose value is one of the above. + * @since v15.0.0 + */ + digest(algorithm: AlgorithmIdentifier, data: BufferSource): Promise; + /** + * Using the method and parameters specified by `algorithm` and the keying material provided by `key`, + * `subtle.encrypt()` attempts to encipher `data`. If successful, + * the returned promise is resolved with an `` containing the encrypted result. + * + * The algorithms currently supported include: + * + * - `'RSA-OAEP'` + * - `'AES-CTR'` + * - `'AES-CBC'` + * - `'AES-GCM'` + * @since v15.0.0 + */ + encrypt(algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, key: CryptoKey, data: BufferSource): Promise; + /** + * Exports the given key into the specified format, if supported. + * + * If the `` is not extractable, the returned promise will reject. + * + * When `format` is either `'pkcs8'` or `'spki'` and the export is successful, + * the returned promise will be resolved with an `` containing the exported key data. + * + * When `format` is `'jwk'` and the export is successful, the returned promise will be resolved with a + * JavaScript object conforming to the {@link https://tools.ietf.org/html/rfc7517 JSON Web Key} specification. + * @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, or `'jwk'`. + * @returns `` containing ``. + * @since v15.0.0 + */ + exportKey(format: 'jwk', key: CryptoKey): Promise; + exportKey(format: Exclude, key: CryptoKey): Promise; + /** + * Using the method and parameters provided in `algorithm`, + * `subtle.generateKey()` attempts to generate new keying material. + * Depending the method used, the method may generate either a single `` or a ``. + * + * The `` (public and private key) generating algorithms supported include: + * + * - `'RSASSA-PKCS1-v1_5'` + * - `'RSA-PSS'` + * - `'RSA-OAEP'` + * - `'ECDSA'` + * - `'Ed25519'` + * - `'Ed448'` + * - `'ECDH'` + * - `'X25519'` + * - `'X448'` + * The `` (secret key) generating algorithms supported include: + * + * - `'HMAC'` + * - `'AES-CTR'` + * - `'AES-CBC'` + * - `'AES-GCM'` + * - `'AES-KW'` + * @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}. + * @since v15.0.0 + */ + generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams, extractable: boolean, keyUsages: ReadonlyArray): Promise; + generateKey(algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: ReadonlyArray): Promise; + generateKey(algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: KeyUsage[]): Promise; + /** + * The `subtle.importKey()` method attempts to interpret the provided `keyData` as the given `format` + * to create a `` instance using the provided `algorithm`, `extractable`, and `keyUsages` arguments. + * If the import is successful, the returned promise will be resolved with the created ``. + * + * If importing a `'PBKDF2'` key, `extractable` must be `false`. + * @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, or `'jwk'`. + * @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}. + * @since v15.0.0 + */ + importKey( + format: 'jwk', + keyData: JsonWebKey, + algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm, + extractable: boolean, + keyUsages: ReadonlyArray + ): Promise; + importKey( + format: Exclude, + keyData: BufferSource, + algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm, + extractable: boolean, + keyUsages: KeyUsage[] + ): Promise; + /** + * Using the method and parameters given by `algorithm` and the keying material provided by `key`, + * `subtle.sign()` attempts to generate a cryptographic signature of `data`. If successful, + * the returned promise is resolved with an `` containing the generated signature. + * + * The algorithms currently supported include: + * + * - `'RSASSA-PKCS1-v1_5'` + * - `'RSA-PSS'` + * - `'ECDSA'` + * - `'Ed25519'` + * - `'Ed448'` + * - `'HMAC'` + * @since v15.0.0 + */ + sign(algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams | Ed448Params, key: CryptoKey, data: BufferSource): Promise; + /** + * In cryptography, "wrapping a key" refers to exporting and then encrypting the keying material. + * The `subtle.unwrapKey()` method attempts to decrypt a wrapped key and create a `` instance. + * It is equivalent to calling `subtle.decrypt()` first on the encrypted key data (using the `wrappedKey`, `unwrapAlgo`, and `unwrappingKey` arguments as input) + * then passing the results in to the `subtle.importKey()` method using the `unwrappedKeyAlgo`, `extractable`, and `keyUsages` arguments as inputs. + * If successful, the returned promise is resolved with a `` object. + * + * The wrapping algorithms currently supported include: + * + * - `'RSA-OAEP'` + * - `'AES-CTR'` + * - `'AES-CBC'` + * - `'AES-GCM'` + * - `'AES-KW'` + * + * The unwrapped key algorithms supported include: + * + * - `'RSASSA-PKCS1-v1_5'` + * - `'RSA-PSS'` + * - `'RSA-OAEP'` + * - `'ECDSA'` + * - `'Ed25519'` + * - `'Ed448'` + * - `'ECDH'` + * - `'X25519'` + * - `'X448'` + * - `'HMAC'` + * - `'AES-CTR'` + * - `'AES-CBC'` + * - `'AES-GCM'` + * - `'AES-KW'` + * @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, or `'jwk'`. + * @param keyUsages See {@link https://nodejs.org/docs/latest/api/webcrypto.html#cryptokeyusages Key usages}. + * @since v15.0.0 + */ + unwrapKey( + format: KeyFormat, + wrappedKey: BufferSource, + unwrappingKey: CryptoKey, + unwrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, + unwrappedKeyAlgorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm, + extractable: boolean, + keyUsages: KeyUsage[] + ): Promise; + /** + * Using the method and parameters given in `algorithm` and the keying material provided by `key`, + * `subtle.verify()` attempts to verify that `signature` is a valid cryptographic signature of `data`. + * The returned promise is resolved with either `true` or `false`. + * + * The algorithms currently supported include: + * + * - `'RSASSA-PKCS1-v1_5'` + * - `'RSA-PSS'` + * - `'ECDSA'` + * - `'Ed25519'` + * - `'Ed448'` + * - `'HMAC'` + * @since v15.0.0 + */ + verify(algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams | Ed448Params, key: CryptoKey, signature: BufferSource, data: BufferSource): Promise; + /** + * In cryptography, "wrapping a key" refers to exporting and then encrypting the keying material. + * The `subtle.wrapKey()` method exports the keying material into the format identified by `format`, + * then encrypts it using the method and parameters specified by `wrapAlgo` and the keying material provided by `wrappingKey`. + * It is the equivalent to calling `subtle.exportKey()` using `format` and `key` as the arguments, + * then passing the result to the `subtle.encrypt()` method using `wrappingKey` and `wrapAlgo` as inputs. + * If successful, the returned promise will be resolved with an `` containing the encrypted key data. + * + * The wrapping algorithms currently supported include: + * + * - `'RSA-OAEP'` + * - `'AES-CTR'` + * - `'AES-CBC'` + * - `'AES-GCM'` + * - `'AES-KW'` + * @param format Must be one of `'raw'`, `'pkcs8'`, `'spki'`, or `'jwk'`. + * @since v15.0.0 + */ + wrapKey(format: KeyFormat, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams): Promise; + } + } +} +declare module 'crypto' { + export * from 'node:crypto'; +} diff --git a/node_modules/@types/node/ts4.8/dgram.d.ts b/node_modules/@types/node/ts4.8/dgram.d.ts new file mode 100644 index 0000000..b1e95b2 --- /dev/null +++ b/node_modules/@types/node/ts4.8/dgram.d.ts @@ -0,0 +1,550 @@ +/** + * The `node:dgram` module provides an implementation of UDP datagram sockets. + * + * ```js + * import dgram from 'node:dgram'; + * + * const server = dgram.createSocket('udp4'); + * + * server.on('error', (err) => { + * console.error(`server error:\n${err.stack}`); + * server.close(); + * }); + * + * server.on('message', (msg, rinfo) => { + * console.log(`server got: ${msg} from ${rinfo.address}:${rinfo.port}`); + * }); + * + * server.on('listening', () => { + * const address = server.address(); + * console.log(`server listening ${address.address}:${address.port}`); + * }); + * + * server.bind(41234); + * // Prints: server listening 0.0.0.0:41234 + * ``` + * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/dgram.js) + */ +declare module 'node:dgram' { + import { AddressInfo } from 'node:net'; + import * as dns from 'node:dns'; + import { EventEmitter, Abortable } from 'node:events'; + interface RemoteInfo { + address: string; + family: 'IPv4' | 'IPv6'; + port: number; + size: number; + } + interface BindOptions { + port?: number | undefined; + address?: string | undefined; + exclusive?: boolean | undefined; + fd?: number | undefined; + } + type SocketType = 'udp4' | 'udp6'; + interface SocketOptions extends Abortable { + type: SocketType; + reuseAddr?: boolean | undefined; + /** + * @default false + */ + ipv6Only?: boolean | undefined; + recvBufferSize?: number | undefined; + sendBufferSize?: number | undefined; + lookup?: ((hostname: string, options: dns.LookupOneOptions, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void) => void) | undefined; + } + /** + * Creates a `dgram.Socket` object. Once the socket is created, calling `socket.bind()` will instruct the socket to begin listening for datagram + * messages. When `address` and `port` are not passed to `socket.bind()` the + * method will bind the socket to the "all interfaces" address on a random port + * (it does the right thing for both `udp4` and `udp6` sockets). The bound address + * and port can be retrieved using `socket.address().address` and `socket.address().port`. + * + * If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.close()` on the socket: + * + * ```js + * const controller = new AbortController(); + * const { signal } = controller; + * const server = dgram.createSocket({ type: 'udp4', signal }); + * server.on('message', (msg, rinfo) => { + * console.log(`server got: ${msg} from ${rinfo.address}:${rinfo.port}`); + * }); + * // Later, when you want to close the server. + * controller.abort(); + * ``` + * @since v0.11.13 + * @param options Available options are: + * @param callback Attached as a listener for `'message'` events. Optional. + */ + function createSocket(type: SocketType, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket; + function createSocket(options: SocketOptions, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket; + /** + * Encapsulates the datagram functionality. + * + * New instances of `dgram.Socket` are created using {@link createSocket}. + * The `new` keyword is not to be used to create `dgram.Socket` instances. + * @since v0.1.99 + */ + class Socket extends EventEmitter { + /** + * Tells the kernel to join a multicast group at the given `multicastAddress` and`multicastInterface` using the `IP_ADD_MEMBERSHIP` socket option. If the`multicastInterface` argument is not + * specified, the operating system will choose + * one interface and will add membership to it. To add membership to every + * available interface, call `addMembership` multiple times, once per interface. + * + * When called on an unbound socket, this method will implicitly bind to a random + * port, listening on all interfaces. + * + * When sharing a UDP socket across multiple `cluster` workers, the`socket.addMembership()` function must be called only once or an`EADDRINUSE` error will occur: + * + * ```js + * import cluster from 'node:cluster'; + * import dgram from 'node:dgram'; + * + * if (cluster.isPrimary) { + * cluster.fork(); // Works ok. + * cluster.fork(); // Fails with EADDRINUSE. + * } else { + * const s = dgram.createSocket('udp4'); + * s.bind(1234, () => { + * s.addMembership('224.0.0.114'); + * }); + * } + * ``` + * @since v0.6.9 + */ + addMembership(multicastAddress: string, multicastInterface?: string): void; + /** + * Returns an object containing the address information for a socket. + * For UDP sockets, this object will contain `address`, `family`, and `port`properties. + * + * This method throws `EBADF` if called on an unbound socket. + * @since v0.1.99 + */ + address(): AddressInfo; + /** + * For UDP sockets, causes the `dgram.Socket` to listen for datagram + * messages on a named `port` and optional `address`. If `port` is not + * specified or is `0`, the operating system will attempt to bind to a + * random port. If `address` is not specified, the operating system will + * attempt to listen on all addresses. Once binding is complete, a`'listening'` event is emitted and the optional `callback` function is + * called. + * + * Specifying both a `'listening'` event listener and passing a`callback` to the `socket.bind()` method is not harmful but not very + * useful. + * + * A bound datagram socket keeps the Node.js process running to receive + * datagram messages. + * + * If binding fails, an `'error'` event is generated. In rare case (e.g. + * attempting to bind with a closed socket), an `Error` may be thrown. + * + * Example of a UDP server listening on port 41234: + * + * ```js + * import dgram from 'node:dgram'; + * + * const server = dgram.createSocket('udp4'); + * + * server.on('error', (err) => { + * console.error(`server error:\n${err.stack}`); + * server.close(); + * }); + * + * server.on('message', (msg, rinfo) => { + * console.log(`server got: ${msg} from ${rinfo.address}:${rinfo.port}`); + * }); + * + * server.on('listening', () => { + * const address = server.address(); + * console.log(`server listening ${address.address}:${address.port}`); + * }); + * + * server.bind(41234); + * // Prints: server listening 0.0.0.0:41234 + * ``` + * @since v0.1.99 + * @param callback with no parameters. Called when binding is complete. + */ + bind(port?: number, address?: string, callback?: () => void): this; + bind(port?: number, callback?: () => void): this; + bind(callback?: () => void): this; + bind(options: BindOptions, callback?: () => void): this; + /** + * Close the underlying socket and stop listening for data on it. If a callback is + * provided, it is added as a listener for the `'close'` event. + * @since v0.1.99 + * @param callback Called when the socket has been closed. + */ + close(callback?: () => void): this; + /** + * Associates the `dgram.Socket` to a remote address and port. Every + * message sent by this handle is automatically sent to that destination. Also, + * the socket will only receive messages from that remote peer. + * Trying to call `connect()` on an already connected socket will result + * in an `ERR_SOCKET_DGRAM_IS_CONNECTED` exception. If `address` is not + * provided, `'127.0.0.1'` (for `udp4` sockets) or `'::1'` (for `udp6` sockets) + * will be used by default. Once the connection is complete, a `'connect'` event + * is emitted and the optional `callback` function is called. In case of failure, + * the `callback` is called or, failing this, an `'error'` event is emitted. + * @since v12.0.0 + * @param callback Called when the connection is completed or on error. + */ + connect(port: number, address?: string, callback?: () => void): void; + connect(port: number, callback: () => void): void; + /** + * A synchronous function that disassociates a connected `dgram.Socket` from + * its remote address. Trying to call `disconnect()` on an unbound or already + * disconnected socket will result in an `ERR_SOCKET_DGRAM_NOT_CONNECTED` exception. + * @since v12.0.0 + */ + disconnect(): void; + /** + * Instructs the kernel to leave a multicast group at `multicastAddress` using the`IP_DROP_MEMBERSHIP` socket option. This method is automatically called by the + * kernel when the socket is closed or the process terminates, so most apps will + * never have reason to call this. + * + * If `multicastInterface` is not specified, the operating system will attempt to + * drop membership on all valid interfaces. + * @since v0.6.9 + */ + dropMembership(multicastAddress: string, multicastInterface?: string): void; + /** + * This method throws `ERR_SOCKET_BUFFER_SIZE` if called on an unbound socket. + * @since v8.7.0 + * @return the `SO_RCVBUF` socket receive buffer size in bytes. + */ + getRecvBufferSize(): number; + /** + * This method throws `ERR_SOCKET_BUFFER_SIZE` if called on an unbound socket. + * @since v8.7.0 + * @return the `SO_SNDBUF` socket send buffer size in bytes. + */ + getSendBufferSize(): number; + /** + * By default, binding a socket will cause it to block the Node.js process from + * exiting as long as the socket is open. The `socket.unref()` method can be used + * to exclude the socket from the reference counting that keeps the Node.js + * process active. The `socket.ref()` method adds the socket back to the reference + * counting and restores the default behavior. + * + * Calling `socket.ref()` multiples times will have no additional effect. + * + * The `socket.ref()` method returns a reference to the socket so calls can be + * chained. + * @since v0.9.1 + */ + ref(): this; + /** + * Returns an object containing the `address`, `family`, and `port` of the remote + * endpoint. This method throws an `ERR_SOCKET_DGRAM_NOT_CONNECTED` exception + * if the socket is not connected. + * @since v12.0.0 + */ + remoteAddress(): AddressInfo; + /** + * Broadcasts a datagram on the socket. + * For connectionless sockets, the destination `port` and `address` must be + * specified. Connected sockets, on the other hand, will use their associated + * remote endpoint, so the `port` and `address` arguments must not be set. + * + * The `msg` argument contains the message to be sent. + * Depending on its type, different behavior can apply. If `msg` is a `Buffer`, + * any `TypedArray` or a `DataView`, + * the `offset` and `length` specify the offset within the `Buffer` where the + * message begins and the number of bytes in the message, respectively. + * If `msg` is a `String`, then it is automatically converted to a `Buffer`with `'utf8'` encoding. With messages that + * contain multi-byte characters, `offset` and `length` will be calculated with + * respect to `byte length` and not the character position. + * If `msg` is an array, `offset` and `length` must not be specified. + * + * The `address` argument is a string. If the value of `address` is a host name, + * DNS will be used to resolve the address of the host. If `address` is not + * provided or otherwise nullish, `'127.0.0.1'` (for `udp4` sockets) or `'::1'`(for `udp6` sockets) will be used by default. + * + * If the socket has not been previously bound with a call to `bind`, the socket + * is assigned a random port number and is bound to the "all interfaces" address + * (`'0.0.0.0'` for `udp4` sockets, `'::0'` for `udp6` sockets.) + * + * An optional `callback` function may be specified to as a way of reporting + * DNS errors or for determining when it is safe to reuse the `buf` object. + * DNS lookups delay the time to send for at least one tick of the + * Node.js event loop. + * + * The only way to know for sure that the datagram has been sent is by using a`callback`. If an error occurs and a `callback` is given, the error will be + * passed as the first argument to the `callback`. If a `callback` is not given, + * the error is emitted as an `'error'` event on the `socket` object. + * + * Offset and length are optional but both _must_ be set if either are used. + * They are supported only when the first argument is a `Buffer`, a `TypedArray`, + * or a `DataView`. + * + * This method throws `ERR_SOCKET_BAD_PORT` if called on an unbound socket. + * + * Example of sending a UDP packet to a port on `localhost`; + * + * ```js + * import dgram from 'node:dgram'; + * import { Buffer } from 'node:buffer'; + * + * const message = Buffer.from('Some bytes'); + * const client = dgram.createSocket('udp4'); + * client.send(message, 41234, 'localhost', (err) => { + * client.close(); + * }); + * ``` + * + * Example of sending a UDP packet composed of multiple buffers to a port on`127.0.0.1`; + * + * ```js + * import dgram from 'node:dgram'; + * import { Buffer } from 'node:buffer'; + * + * const buf1 = Buffer.from('Some '); + * const buf2 = Buffer.from('bytes'); + * const client = dgram.createSocket('udp4'); + * client.send([buf1, buf2], 41234, (err) => { + * client.close(); + * }); + * ``` + * + * Sending multiple buffers might be faster or slower depending on the + * application and operating system. Run benchmarks to + * determine the optimal strategy on a case-by-case basis. Generally speaking, + * however, sending multiple buffers is faster. + * + * Example of sending a UDP packet using a socket connected to a port on`localhost`: + * + * ```js + * import dgram from 'node:dgram'; + * import { Buffer } from 'node:buffer'; + * + * const message = Buffer.from('Some bytes'); + * const client = dgram.createSocket('udp4'); + * client.connect(41234, 'localhost', (err) => { + * client.send(message, (err) => { + * client.close(); + * }); + * }); + * ``` + * @since v0.1.99 + * @param msg Message to be sent. + * @param offset Offset in the buffer where the message starts. + * @param length Number of bytes in the message. + * @param port Destination port. + * @param address Destination host name or IP address. + * @param callback Called when the message has been sent. + */ + send(msg: string | Uint8Array | ReadonlyArray, port?: number, address?: string, callback?: (error: Error | null, bytes: number) => void): void; + send(msg: string | Uint8Array | ReadonlyArray, port?: number, callback?: (error: Error | null, bytes: number) => void): void; + send(msg: string | Uint8Array | ReadonlyArray, callback?: (error: Error | null, bytes: number) => void): void; + send(msg: string | Uint8Array, offset: number, length: number, port?: number, address?: string, callback?: (error: Error | null, bytes: number) => void): void; + send(msg: string | Uint8Array, offset: number, length: number, port?: number, callback?: (error: Error | null, bytes: number) => void): void; + send(msg: string | Uint8Array, offset: number, length: number, callback?: (error: Error | null, bytes: number) => void): void; + /** + * Sets or clears the `SO_BROADCAST` socket option. When set to `true`, UDP + * packets may be sent to a local interface's broadcast address. + * + * This method throws `EBADF` if called on an unbound socket. + * @since v0.6.9 + */ + setBroadcast(flag: boolean): void; + /** + * _All references to scope in this section are referring to [IPv6 Zone Indices](https://en.wikipedia.org/wiki/IPv6_address#Scoped_literal_IPv6_addresses), which are defined by [RFC + * 4007](https://tools.ietf.org/html/rfc4007). In string form, an IP_ + * _with a scope index is written as `'IP%scope'` where scope is an interface name_ + * _or interface number._ + * + * Sets the default outgoing multicast interface of the socket to a chosen + * interface or back to system interface selection. The `multicastInterface` must + * be a valid string representation of an IP from the socket's family. + * + * For IPv4 sockets, this should be the IP configured for the desired physical + * interface. All packets sent to multicast on the socket will be sent on the + * interface determined by the most recent successful use of this call. + * + * For IPv6 sockets, `multicastInterface` should include a scope to indicate the + * interface as in the examples that follow. In IPv6, individual `send` calls can + * also use explicit scope in addresses, so only packets sent to a multicast + * address without specifying an explicit scope are affected by the most recent + * successful use of this call. + * + * This method throws `EBADF` if called on an unbound socket. + * + * #### Example: IPv6 outgoing multicast interface + * + * On most systems, where scope format uses the interface name: + * + * ```js + * const socket = dgram.createSocket('udp6'); + * + * socket.bind(1234, () => { + * socket.setMulticastInterface('::%eth1'); + * }); + * ``` + * + * On Windows, where scope format uses an interface number: + * + * ```js + * const socket = dgram.createSocket('udp6'); + * + * socket.bind(1234, () => { + * socket.setMulticastInterface('::%2'); + * }); + * ``` + * + * #### Example: IPv4 outgoing multicast interface + * + * All systems use an IP of the host on the desired physical interface: + * + * ```js + * const socket = dgram.createSocket('udp4'); + * + * socket.bind(1234, () => { + * socket.setMulticastInterface('10.0.0.2'); + * }); + * ``` + * @since v8.6.0 + */ + setMulticastInterface(multicastInterface: string): void; + /** + * Sets or clears the `IP_MULTICAST_LOOP` socket option. When set to `true`, + * multicast packets will also be received on the local interface. + * + * This method throws `EBADF` if called on an unbound socket. + * @since v0.3.8 + */ + setMulticastLoopback(flag: boolean): boolean; + /** + * Sets the `IP_MULTICAST_TTL` socket option. While TTL generally stands for + * "Time to Live", in this context it specifies the number of IP hops that a + * packet is allowed to travel through, specifically for multicast traffic. Each + * router or gateway that forwards a packet decrements the TTL. If the TTL is + * decremented to 0 by a router, it will not be forwarded. + * + * The `ttl` argument may be between 0 and 255\. The default on most systems is `1`. + * + * This method throws `EBADF` if called on an unbound socket. + * @since v0.3.8 + */ + setMulticastTTL(ttl: number): number; + /** + * Sets the `SO_RCVBUF` socket option. Sets the maximum socket receive buffer + * in bytes. + * + * This method throws `ERR_SOCKET_BUFFER_SIZE` if called on an unbound socket. + * @since v8.7.0 + */ + setRecvBufferSize(size: number): void; + /** + * Sets the `SO_SNDBUF` socket option. Sets the maximum socket send buffer + * in bytes. + * + * This method throws `ERR_SOCKET_BUFFER_SIZE` if called on an unbound socket. + * @since v8.7.0 + */ + setSendBufferSize(size: number): void; + /** + * Sets the `IP_TTL` socket option. While TTL generally stands for "Time to Live", + * in this context it specifies the number of IP hops that a packet is allowed to + * travel through. Each router or gateway that forwards a packet decrements the + * TTL. If the TTL is decremented to 0 by a router, it will not be forwarded. + * Changing TTL values is typically done for network probes or when multicasting. + * + * The `ttl` argument may be between 1 and 255\. The default on most systems + * is 64. + * + * This method throws `EBADF` if called on an unbound socket. + * @since v0.1.101 + */ + setTTL(ttl: number): number; + /** + * By default, binding a socket will cause it to block the Node.js process from + * exiting as long as the socket is open. The `socket.unref()` method can be used + * to exclude the socket from the reference counting that keeps the Node.js + * process active, allowing the process to exit even if the socket is still + * listening. + * + * Calling `socket.unref()` multiple times will have no addition effect. + * + * The `socket.unref()` method returns a reference to the socket so calls can be + * chained. + * @since v0.9.1 + */ + unref(): this; + /** + * Tells the kernel to join a source-specific multicast channel at the given`sourceAddress` and `groupAddress`, using the `multicastInterface` with the`IP_ADD_SOURCE_MEMBERSHIP` socket + * option. If the `multicastInterface` argument + * is not specified, the operating system will choose one interface and will add + * membership to it. To add membership to every available interface, call`socket.addSourceSpecificMembership()` multiple times, once per interface. + * + * When called on an unbound socket, this method will implicitly bind to a random + * port, listening on all interfaces. + * @since v13.1.0, v12.16.0 + */ + addSourceSpecificMembership(sourceAddress: string, groupAddress: string, multicastInterface?: string): void; + /** + * Instructs the kernel to leave a source-specific multicast channel at the given`sourceAddress` and `groupAddress` using the `IP_DROP_SOURCE_MEMBERSHIP`socket option. This method is + * automatically called by the kernel when the + * socket is closed or the process terminates, so most apps will never have + * reason to call this. + * + * If `multicastInterface` is not specified, the operating system will attempt to + * drop membership on all valid interfaces. + * @since v13.1.0, v12.16.0 + */ + dropSourceSpecificMembership(sourceAddress: string, groupAddress: string, multicastInterface?: string): void; + /** + * events.EventEmitter + * 1. close + * 2. connect + * 3. error + * 4. listening + * 5. message + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: 'close', listener: () => void): this; + addListener(event: 'connect', listener: () => void): this; + addListener(event: 'error', listener: (err: Error) => void): this; + addListener(event: 'listening', listener: () => void): this; + addListener(event: 'message', listener: (msg: Buffer, rinfo: RemoteInfo) => void): this; + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: 'close'): boolean; + emit(event: 'connect'): boolean; + emit(event: 'error', err: Error): boolean; + emit(event: 'listening'): boolean; + emit(event: 'message', msg: Buffer, rinfo: RemoteInfo): boolean; + on(event: string, listener: (...args: any[]) => void): this; + on(event: 'close', listener: () => void): this; + on(event: 'connect', listener: () => void): this; + on(event: 'error', listener: (err: Error) => void): this; + on(event: 'listening', listener: () => void): this; + on(event: 'message', listener: (msg: Buffer, rinfo: RemoteInfo) => void): this; + once(event: string, listener: (...args: any[]) => void): this; + once(event: 'close', listener: () => void): this; + once(event: 'connect', listener: () => void): this; + once(event: 'error', listener: (err: Error) => void): this; + once(event: 'listening', listener: () => void): this; + once(event: 'message', listener: (msg: Buffer, rinfo: RemoteInfo) => void): this; + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: 'close', listener: () => void): this; + prependListener(event: 'connect', listener: () => void): this; + prependListener(event: 'error', listener: (err: Error) => void): this; + prependListener(event: 'listening', listener: () => void): this; + prependListener(event: 'message', listener: (msg: Buffer, rinfo: RemoteInfo) => void): this; + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'close', listener: () => void): this; + prependOnceListener(event: 'connect', listener: () => void): this; + prependOnceListener(event: 'error', listener: (err: Error) => void): this; + prependOnceListener(event: 'listening', listener: () => void): this; + prependOnceListener(event: 'message', listener: (msg: Buffer, rinfo: RemoteInfo) => void): this; + /** + * Calls `socket.close()` and returns a promise that fulfills when the socket has closed. + * @since v20.5.0 + */ + [Symbol.asyncDispose](): Promise; + } +} +declare module 'dgram' { + export * from 'node:dgram'; +} diff --git a/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts b/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts new file mode 100644 index 0000000..41ab138 --- /dev/null +++ b/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts @@ -0,0 +1,191 @@ +/** + * The `node:diagnostics_channel` module provides an API to create named channels + * to report arbitrary message data for diagnostics purposes. + * + * It can be accessed using: + * + * ```js + * import diagnostics_channel from 'node:diagnostics_channel'; + * ``` + * + * It is intended that a module writer wanting to report diagnostics messages + * will create one or many top-level channels to report messages through. + * Channels may also be acquired at runtime but it is not encouraged + * due to the additional overhead of doing so. Channels may be exported for + * convenience, but as long as the name is known it can be acquired anywhere. + * + * If you intend for your module to produce diagnostics data for others to + * consume it is recommended that you include documentation of what named + * channels are used along with the shape of the message data. Channel names + * should generally include the module name to avoid collisions with data from + * other modules. + * @since v15.1.0, v14.17.0 + * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/diagnostics_channel.js) + */ +declare module 'node:diagnostics_channel' { + /** + * Check if there are active subscribers to the named channel. This is helpful if + * the message you want to send might be expensive to prepare. + * + * This API is optional but helpful when trying to publish messages from very + * performance-sensitive code. + * + * ```js + * import diagnostics_channel from 'node:diagnostics_channel'; + * + * if (diagnostics_channel.hasSubscribers('my-channel')) { + * // There are subscribers, prepare and publish message + * } + * ``` + * @since v15.1.0, v14.17.0 + * @param name The channel name + * @return If there are active subscribers + */ + function hasSubscribers(name: string | symbol): boolean; + /** + * This is the primary entry-point for anyone wanting to publish to a named + * channel. It produces a channel object which is optimized to reduce overhead at + * publish time as much as possible. + * + * ```js + * import diagnostics_channel from 'node:diagnostics_channel'; + * + * const channel = diagnostics_channel.channel('my-channel'); + * ``` + * @since v15.1.0, v14.17.0 + * @param name The channel name + * @return The named channel object + */ + function channel(name: string | symbol): Channel; + type ChannelListener = (message: unknown, name: string | symbol) => void; + /** + * Register a message handler to subscribe to this channel. This message handler + * will be run synchronously whenever a message is published to the channel. Any + * errors thrown in the message handler will trigger an `'uncaughtException'`. + * + * ```js + * import diagnostics_channel from 'node:diagnostics_channel'; + * + * diagnostics_channel.subscribe('my-channel', (message, name) => { + * // Received data + * }); + * ``` + * @since v18.7.0, v16.17.0 + * @param name The channel name + * @param onMessage The handler to receive channel messages + */ + function subscribe(name: string | symbol, onMessage: ChannelListener): void; + /** + * Remove a message handler previously registered to this channel with {@link subscribe}. + * + * ```js + * import diagnostics_channel from 'node:diagnostics_channel'; + * + * function onMessage(message, name) { + * // Received data + * } + * + * diagnostics_channel.subscribe('my-channel', onMessage); + * + * diagnostics_channel.unsubscribe('my-channel', onMessage); + * ``` + * @since v18.7.0, v16.17.0 + * @param name The channel name + * @param onMessage The previous subscribed handler to remove + * @return `true` if the handler was found, `false` otherwise. + */ + function unsubscribe(name: string | symbol, onMessage: ChannelListener): boolean; + /** + * The class `Channel` represents an individual named channel within the data + * pipeline. It is used to track subscribers and to publish messages when there + * are subscribers present. It exists as a separate object to avoid channel + * lookups at publish time, enabling very fast publish speeds and allowing + * for heavy use while incurring very minimal cost. Channels are created with {@link channel}, constructing a channel directly + * with `new Channel(name)` is not supported. + * @since v15.1.0, v14.17.0 + */ + class Channel { + readonly name: string | symbol; + /** + * Check if there are active subscribers to this channel. This is helpful if + * the message you want to send might be expensive to prepare. + * + * This API is optional but helpful when trying to publish messages from very + * performance-sensitive code. + * + * ```js + * import diagnostics_channel from 'node:diagnostics_channel'; + * + * const channel = diagnostics_channel.channel('my-channel'); + * + * if (channel.hasSubscribers) { + * // There are subscribers, prepare and publish message + * } + * ``` + * @since v15.1.0, v14.17.0 + */ + readonly hasSubscribers: boolean; + private constructor(name: string | symbol); + /** + * Publish a message to any subscribers to the channel. This will trigger + * message handlers synchronously so they will execute within the same context. + * + * ```js + * import diagnostics_channel from 'node:diagnostics_channel'; + * + * const channel = diagnostics_channel.channel('my-channel'); + * + * channel.publish({ + * some: 'message', + * }); + * ``` + * @since v15.1.0, v14.17.0 + * @param message The message to send to the channel subscribers + */ + publish(message: unknown): void; + /** + * Register a message handler to subscribe to this channel. This message handler + * will be run synchronously whenever a message is published to the channel. Any + * errors thrown in the message handler will trigger an `'uncaughtException'`. + * + * ```js + * import diagnostics_channel from 'node:diagnostics_channel'; + * + * const channel = diagnostics_channel.channel('my-channel'); + * + * channel.subscribe((message, name) => { + * // Received data + * }); + * ``` + * @since v15.1.0, v14.17.0 + * @deprecated Since v18.7.0,v16.17.0 - Use {@link subscribe(name, onMessage)} + * @param onMessage The handler to receive channel messages + */ + subscribe(onMessage: ChannelListener): void; + /** + * Remove a message handler previously registered to this channel with `channel.subscribe(onMessage)`. + * + * ```js + * import diagnostics_channel from 'node:diagnostics_channel'; + * + * const channel = diagnostics_channel.channel('my-channel'); + * + * function onMessage(message, name) { + * // Received data + * } + * + * channel.subscribe(onMessage); + * + * channel.unsubscribe(onMessage); + * ``` + * @since v15.1.0, v14.17.0 + * @deprecated Since v18.7.0,v16.17.0 - Use {@link unsubscribe(name, onMessage)} + * @param onMessage The previous subscribed handler to remove + * @return `true` if the handler was found, `false` otherwise. + */ + unsubscribe(onMessage: ChannelListener): void; + } +} +declare module 'diagnostics_channel' { + export * from 'node:diagnostics_channel'; +} diff --git a/node_modules/@types/node/ts4.8/dns.d.ts b/node_modules/@types/node/ts4.8/dns.d.ts new file mode 100644 index 0000000..8bd086c --- /dev/null +++ b/node_modules/@types/node/ts4.8/dns.d.ts @@ -0,0 +1,668 @@ +/** + * The `node:dns` module enables name resolution. For example, use it to look up IP + * addresses of host names. + * + * Although named for the [Domain Name System (DNS)](https://en.wikipedia.org/wiki/Domain_Name_System), it does not always use the + * DNS protocol for lookups. {@link lookup} uses the operating system + * facilities to perform name resolution. It may not need to perform any network + * communication. To perform name resolution the way other applications on the same + * system do, use {@link lookup}. + * + * ```js + * const dns = require('node:dns'); + * + * dns.lookup('example.org', (err, address, family) => { + * console.log('address: %j family: IPv%s', address, family); + * }); + * // address: "93.184.216.34" family: IPv4 + * ``` + * + * All other functions in the `node:dns` module connect to an actual DNS server to + * perform name resolution. They will always use the network to perform DNS + * queries. These functions do not use the same set of configuration files used by {@link lookup} (e.g. `/etc/hosts`). Use these functions to always perform + * DNS queries, bypassing other name-resolution facilities. + * + * ```js + * const dns = require('node:dns'); + * + * dns.resolve4('archive.org', (err, addresses) => { + * if (err) throw err; + * + * console.log(`addresses: ${JSON.stringify(addresses)}`); + * + * addresses.forEach((a) => { + * dns.reverse(a, (err, hostnames) => { + * if (err) { + * throw err; + * } + * console.log(`reverse for ${a}: ${JSON.stringify(hostnames)}`); + * }); + * }); + * }); + * ``` + * + * See the `Implementation considerations section` for more information. + * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/dns.js) + */ +declare module 'node:dns' { + import * as dnsPromises from 'node:dns/promises'; + // Supported getaddrinfo flags. + export const ADDRCONFIG: number; + export const V4MAPPED: number; + /** + * If `dns.V4MAPPED` is specified, return resolved IPv6 addresses as + * well as IPv4 mapped IPv6 addresses. + */ + export const ALL: number; + export interface LookupOptions { + family?: number | undefined; + hints?: number | undefined; + all?: boolean | undefined; + /** + * @default true + */ + verbatim?: boolean | undefined; + } + export interface LookupOneOptions extends LookupOptions { + all?: false | undefined; + } + export interface LookupAllOptions extends LookupOptions { + all: true; + } + export interface LookupAddress { + address: string; + family: number; + } + /** + * Resolves a host name (e.g. `'nodejs.org'`) into the first found A (IPv4) or + * AAAA (IPv6) record. All `option` properties are optional. If `options` is an + * integer, then it must be `4` or `6` – if `options` is `0` or not provided, then + * IPv4 and IPv6 addresses are both returned if found. + * + * With the `all` option set to `true`, the arguments for `callback` change to`(err, addresses)`, with `addresses` being an array of objects with the + * properties `address` and `family`. + * + * On error, `err` is an `Error` object, where `err.code` is the error code. + * Keep in mind that `err.code` will be set to `'ENOTFOUND'` not only when + * the host name does not exist but also when the lookup fails in other ways + * such as no available file descriptors. + * + * `dns.lookup()` does not necessarily have anything to do with the DNS protocol. + * The implementation uses an operating system facility that can associate names + * with addresses and vice versa. This implementation can have subtle but + * important consequences on the behavior of any Node.js program. Please take some + * time to consult the `Implementation considerations section` before using`dns.lookup()`. + * + * Example usage: + * + * ```js + * const dns = require('node:dns'); + * const options = { + * family: 6, + * hints: dns.ADDRCONFIG | dns.V4MAPPED, + * }; + * dns.lookup('example.com', options, (err, address, family) => + * console.log('address: %j family: IPv%s', address, family)); + * // address: "2606:2800:220:1:248:1893:25c8:1946" family: IPv6 + * + * // When options.all is true, the result will be an Array. + * options.all = true; + * dns.lookup('example.com', options, (err, addresses) => + * console.log('addresses: %j', addresses)); + * // addresses: [{"address":"2606:2800:220:1:248:1893:25c8:1946","family":6}] + * ``` + * + * If this method is invoked as its `util.promisify()` ed version, and `all`is not set to `true`, it returns a `Promise` for an `Object` with `address` and`family` properties. + * @since v0.1.90 + */ + export function lookup(hostname: string, family: number, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void): void; + export function lookup(hostname: string, options: LookupOneOptions, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void): void; + export function lookup(hostname: string, options: LookupAllOptions, callback: (err: NodeJS.ErrnoException | null, addresses: LookupAddress[]) => void): void; + export function lookup(hostname: string, options: LookupOptions, callback: (err: NodeJS.ErrnoException | null, address: string | LookupAddress[], family: number) => void): void; + export function lookup(hostname: string, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void): void; + export namespace lookup { + function __promisify__(hostname: string, options: LookupAllOptions): Promise; + function __promisify__(hostname: string, options?: LookupOneOptions | number): Promise; + function __promisify__(hostname: string, options: LookupOptions): Promise; + } + /** + * Resolves the given `address` and `port` into a host name and service using + * the operating system's underlying `getnameinfo` implementation. + * + * If `address` is not a valid IP address, a `TypeError` will be thrown. + * The `port` will be coerced to a number. If it is not a legal port, a `TypeError`will be thrown. + * + * On an error, `err` is an `Error` object, where `err.code` is the error code. + * + * ```js + * const dns = require('node:dns'); + * dns.lookupService('127.0.0.1', 22, (err, hostname, service) => { + * console.log(hostname, service); + * // Prints: localhost ssh + * }); + * ``` + * + * If this method is invoked as its `util.promisify()` ed version, it returns a`Promise` for an `Object` with `hostname` and `service` properties. + * @since v0.11.14 + */ + export function lookupService(address: string, port: number, callback: (err: NodeJS.ErrnoException | null, hostname: string, service: string) => void): void; + export namespace lookupService { + function __promisify__( + address: string, + port: number + ): Promise<{ + hostname: string; + service: string; + }>; + } + export interface ResolveOptions { + ttl: boolean; + } + export interface ResolveWithTtlOptions extends ResolveOptions { + ttl: true; + } + export interface RecordWithTtl { + address: string; + ttl: number; + } + /** @deprecated Use `AnyARecord` or `AnyAaaaRecord` instead. */ + export type AnyRecordWithTtl = AnyARecord | AnyAaaaRecord; + export interface AnyARecord extends RecordWithTtl { + type: 'A'; + } + export interface AnyAaaaRecord extends RecordWithTtl { + type: 'AAAA'; + } + export interface CaaRecord { + critical: number; + issue?: string | undefined; + issuewild?: string | undefined; + iodef?: string | undefined; + contactemail?: string | undefined; + contactphone?: string | undefined; + } + export interface MxRecord { + priority: number; + exchange: string; + } + export interface AnyMxRecord extends MxRecord { + type: 'MX'; + } + export interface NaptrRecord { + flags: string; + service: string; + regexp: string; + replacement: string; + order: number; + preference: number; + } + export interface AnyNaptrRecord extends NaptrRecord { + type: 'NAPTR'; + } + export interface SoaRecord { + nsname: string; + hostmaster: string; + serial: number; + refresh: number; + retry: number; + expire: number; + minttl: number; + } + export interface AnySoaRecord extends SoaRecord { + type: 'SOA'; + } + export interface SrvRecord { + priority: number; + weight: number; + port: number; + name: string; + } + export interface AnySrvRecord extends SrvRecord { + type: 'SRV'; + } + export interface AnyTxtRecord { + type: 'TXT'; + entries: string[]; + } + export interface AnyNsRecord { + type: 'NS'; + value: string; + } + export interface AnyPtrRecord { + type: 'PTR'; + value: string; + } + export interface AnyCnameRecord { + type: 'CNAME'; + value: string; + } + export type AnyRecord = AnyARecord | AnyAaaaRecord | AnyCnameRecord | AnyMxRecord | AnyNaptrRecord | AnyNsRecord | AnyPtrRecord | AnySoaRecord | AnySrvRecord | AnyTxtRecord; + /** + * Uses the DNS protocol to resolve a host name (e.g. `'nodejs.org'`) into an array + * of the resource records. The `callback` function has arguments`(err, records)`. When successful, `records` will be an array of resource + * records. The type and structure of individual results varies based on `rrtype`: + * + * + * + * On error, `err` is an `Error` object, where `err.code` is one of the `DNS error codes`. + * @since v0.1.27 + * @param hostname Host name to resolve. + * @param [rrtype='A'] Resource record type. + */ + export function resolve(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; + export function resolve(hostname: string, rrtype: 'A', callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; + export function resolve(hostname: string, rrtype: 'AAAA', callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; + export function resolve(hostname: string, rrtype: 'ANY', callback: (err: NodeJS.ErrnoException | null, addresses: AnyRecord[]) => void): void; + export function resolve(hostname: string, rrtype: 'CNAME', callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; + export function resolve(hostname: string, rrtype: 'MX', callback: (err: NodeJS.ErrnoException | null, addresses: MxRecord[]) => void): void; + export function resolve(hostname: string, rrtype: 'NAPTR', callback: (err: NodeJS.ErrnoException | null, addresses: NaptrRecord[]) => void): void; + export function resolve(hostname: string, rrtype: 'NS', callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; + export function resolve(hostname: string, rrtype: 'PTR', callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; + export function resolve(hostname: string, rrtype: 'SOA', callback: (err: NodeJS.ErrnoException | null, addresses: SoaRecord) => void): void; + export function resolve(hostname: string, rrtype: 'SRV', callback: (err: NodeJS.ErrnoException | null, addresses: SrvRecord[]) => void): void; + export function resolve(hostname: string, rrtype: 'TXT', callback: (err: NodeJS.ErrnoException | null, addresses: string[][]) => void): void; + export function resolve( + hostname: string, + rrtype: string, + callback: (err: NodeJS.ErrnoException | null, addresses: string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | string[][] | AnyRecord[]) => void + ): void; + export namespace resolve { + function __promisify__(hostname: string, rrtype?: 'A' | 'AAAA' | 'CNAME' | 'NS' | 'PTR'): Promise; + function __promisify__(hostname: string, rrtype: 'ANY'): Promise; + function __promisify__(hostname: string, rrtype: 'MX'): Promise; + function __promisify__(hostname: string, rrtype: 'NAPTR'): Promise; + function __promisify__(hostname: string, rrtype: 'SOA'): Promise; + function __promisify__(hostname: string, rrtype: 'SRV'): Promise; + function __promisify__(hostname: string, rrtype: 'TXT'): Promise; + function __promisify__(hostname: string, rrtype: string): Promise; + } + /** + * Uses the DNS protocol to resolve a IPv4 addresses (`A` records) for the`hostname`. The `addresses` argument passed to the `callback` function + * will contain an array of IPv4 addresses (e.g.`['74.125.79.104', '74.125.79.105', '74.125.79.106']`). + * @since v0.1.16 + * @param hostname Host name to resolve. + */ + export function resolve4(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; + export function resolve4(hostname: string, options: ResolveWithTtlOptions, callback: (err: NodeJS.ErrnoException | null, addresses: RecordWithTtl[]) => void): void; + export function resolve4(hostname: string, options: ResolveOptions, callback: (err: NodeJS.ErrnoException | null, addresses: string[] | RecordWithTtl[]) => void): void; + export namespace resolve4 { + function __promisify__(hostname: string): Promise; + function __promisify__(hostname: string, options: ResolveWithTtlOptions): Promise; + function __promisify__(hostname: string, options?: ResolveOptions): Promise; + } + /** + * Uses the DNS protocol to resolve IPv6 addresses (`AAAA` records) for the`hostname`. The `addresses` argument passed to the `callback` function + * will contain an array of IPv6 addresses. + * @since v0.1.16 + * @param hostname Host name to resolve. + */ + export function resolve6(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; + export function resolve6(hostname: string, options: ResolveWithTtlOptions, callback: (err: NodeJS.ErrnoException | null, addresses: RecordWithTtl[]) => void): void; + export function resolve6(hostname: string, options: ResolveOptions, callback: (err: NodeJS.ErrnoException | null, addresses: string[] | RecordWithTtl[]) => void): void; + export namespace resolve6 { + function __promisify__(hostname: string): Promise; + function __promisify__(hostname: string, options: ResolveWithTtlOptions): Promise; + function __promisify__(hostname: string, options?: ResolveOptions): Promise; + } + /** + * Uses the DNS protocol to resolve `CNAME` records for the `hostname`. The`addresses` argument passed to the `callback` function + * will contain an array of canonical name records available for the `hostname`(e.g. `['bar.example.com']`). + * @since v0.3.2 + */ + export function resolveCname(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; + export namespace resolveCname { + function __promisify__(hostname: string): Promise; + } + /** + * Uses the DNS protocol to resolve `CAA` records for the `hostname`. The`addresses` argument passed to the `callback` function + * will contain an array of certification authority authorization records + * available for the `hostname` (e.g. `[{critical: 0, iodef: 'mailto:pki@example.com'}, {critical: 128, issue: 'pki.example.com'}]`). + * @since v15.0.0, v14.17.0 + */ + export function resolveCaa(hostname: string, callback: (err: NodeJS.ErrnoException | null, records: CaaRecord[]) => void): void; + export namespace resolveCaa { + function __promisify__(hostname: string): Promise; + } + /** + * Uses the DNS protocol to resolve mail exchange records (`MX` records) for the`hostname`. The `addresses` argument passed to the `callback` function will + * contain an array of objects containing both a `priority` and `exchange`property (e.g. `[{priority: 10, exchange: 'mx.example.com'}, ...]`). + * @since v0.1.27 + */ + export function resolveMx(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: MxRecord[]) => void): void; + export namespace resolveMx { + function __promisify__(hostname: string): Promise; + } + /** + * Uses the DNS protocol to resolve regular expression-based records (`NAPTR`records) for the `hostname`. The `addresses` argument passed to the `callback`function will contain an array of + * objects with the following properties: + * + * * `flags` + * * `service` + * * `regexp` + * * `replacement` + * * `order` + * * `preference` + * + * ```js + * { + * flags: 's', + * service: 'SIP+D2U', + * regexp: '', + * replacement: '_sip._udp.example.com', + * order: 30, + * preference: 100 + * } + * ``` + * @since v0.9.12 + */ + export function resolveNaptr(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: NaptrRecord[]) => void): void; + export namespace resolveNaptr { + function __promisify__(hostname: string): Promise; + } + /** + * Uses the DNS protocol to resolve name server records (`NS` records) for the`hostname`. The `addresses` argument passed to the `callback` function will + * contain an array of name server records available for `hostname`(e.g. `['ns1.example.com', 'ns2.example.com']`). + * @since v0.1.90 + */ + export function resolveNs(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; + export namespace resolveNs { + function __promisify__(hostname: string): Promise; + } + /** + * Uses the DNS protocol to resolve pointer records (`PTR` records) for the`hostname`. The `addresses` argument passed to the `callback` function will + * be an array of strings containing the reply records. + * @since v6.0.0 + */ + export function resolvePtr(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; + export namespace resolvePtr { + function __promisify__(hostname: string): Promise; + } + /** + * Uses the DNS protocol to resolve a start of authority record (`SOA` record) for + * the `hostname`. The `address` argument passed to the `callback` function will + * be an object with the following properties: + * + * * `nsname` + * * `hostmaster` + * * `serial` + * * `refresh` + * * `retry` + * * `expire` + * * `minttl` + * + * ```js + * { + * nsname: 'ns.example.com', + * hostmaster: 'root.example.com', + * serial: 2013101809, + * refresh: 10000, + * retry: 2400, + * expire: 604800, + * minttl: 3600 + * } + * ``` + * @since v0.11.10 + */ + export function resolveSoa(hostname: string, callback: (err: NodeJS.ErrnoException | null, address: SoaRecord) => void): void; + export namespace resolveSoa { + function __promisify__(hostname: string): Promise; + } + /** + * Uses the DNS protocol to resolve service records (`SRV` records) for the`hostname`. The `addresses` argument passed to the `callback` function will + * be an array of objects with the following properties: + * + * * `priority` + * * `weight` + * * `port` + * * `name` + * + * ```js + * { + * priority: 10, + * weight: 5, + * port: 21223, + * name: 'service.example.com' + * } + * ``` + * @since v0.1.27 + */ + export function resolveSrv(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: SrvRecord[]) => void): void; + export namespace resolveSrv { + function __promisify__(hostname: string): Promise; + } + /** + * Uses the DNS protocol to resolve text queries (`TXT` records) for the`hostname`. The `records` argument passed to the `callback` function is a + * two-dimensional array of the text records available for `hostname` (e.g.`[ ['v=spf1 ip4:0.0.0.0 ', '~all' ] ]`). Each sub-array contains TXT chunks of + * one record. Depending on the use case, these could be either joined together or + * treated separately. + * @since v0.1.27 + */ + export function resolveTxt(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[][]) => void): void; + export namespace resolveTxt { + function __promisify__(hostname: string): Promise; + } + /** + * Uses the DNS protocol to resolve all records (also known as `ANY` or `*` query). + * The `ret` argument passed to the `callback` function will be an array containing + * various types of records. Each object has a property `type` that indicates the + * type of the current record. And depending on the `type`, additional properties + * will be present on the object: + * + * + * + * Here is an example of the `ret` object passed to the callback: + * + * ```js + * [ { type: 'A', address: '127.0.0.1', ttl: 299 }, + * { type: 'CNAME', value: 'example.com' }, + * { type: 'MX', exchange: 'alt4.aspmx.l.example.com', priority: 50 }, + * { type: 'NS', value: 'ns1.example.com' }, + * { type: 'TXT', entries: [ 'v=spf1 include:_spf.example.com ~all' ] }, + * { type: 'SOA', + * nsname: 'ns1.example.com', + * hostmaster: 'admin.example.com', + * serial: 156696742, + * refresh: 900, + * retry: 900, + * expire: 1800, + * minttl: 60 } ] + * ``` + * + * DNS server operators may choose not to respond to `ANY`queries. It may be better to call individual methods like {@link resolve4},{@link resolveMx}, and so on. For more details, see [RFC + * 8482](https://tools.ietf.org/html/rfc8482). + */ + export function resolveAny(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: AnyRecord[]) => void): void; + export namespace resolveAny { + function __promisify__(hostname: string): Promise; + } + /** + * Performs a reverse DNS query that resolves an IPv4 or IPv6 address to an + * array of host names. + * + * On error, `err` is an `Error` object, where `err.code` is + * one of the `DNS error codes`. + * @since v0.1.16 + */ + export function reverse(ip: string, callback: (err: NodeJS.ErrnoException | null, hostnames: string[]) => void): void; + /** + * Get the default value for `verbatim` in {@link lookup} and `dnsPromises.lookup()`. The value could be: + * + * * `ipv4first`: for `verbatim` defaulting to `false`. + * * `verbatim`: for `verbatim` defaulting to `true`. + * @since v20.1.0 + */ + export function getDefaultResultOrder(): 'ipv4first' | 'verbatim'; + /** + * Sets the IP address and port of servers to be used when performing DNS + * resolution. The `servers` argument is an array of [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6) formatted + * addresses. If the port is the IANA default DNS port (53) it can be omitted. + * + * ```js + * dns.setServers([ + * '4.4.4.4', + * '[2001:4860:4860::8888]', + * '4.4.4.4:1053', + * '[2001:4860:4860::8888]:1053', + * ]); + * ``` + * + * An error will be thrown if an invalid address is provided. + * + * The `dns.setServers()` method must not be called while a DNS query is in + * progress. + * + * The {@link setServers} method affects only {@link resolve},`dns.resolve*()` and {@link reverse} (and specifically _not_ {@link lookup}). + * + * This method works much like [resolve.conf](https://man7.org/linux/man-pages/man5/resolv.conf.5.html). + * That is, if attempting to resolve with the first server provided results in a`NOTFOUND` error, the `resolve()` method will _not_ attempt to resolve with + * subsequent servers provided. Fallback DNS servers will only be used if the + * earlier ones time out or result in some other error. + * @since v0.11.3 + * @param servers array of `RFC 5952` formatted addresses + */ + export function setServers(servers: ReadonlyArray): void; + /** + * Returns an array of IP address strings, formatted according to [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6), + * that are currently configured for DNS resolution. A string will include a port + * section if a custom port is used. + * + * ```js + * [ + * '4.4.4.4', + * '2001:4860:4860::8888', + * '4.4.4.4:1053', + * '[2001:4860:4860::8888]:1053', + * ] + * ``` + * @since v0.11.3 + */ + export function getServers(): string[]; + /** + * Set the default value of `verbatim` in {@link lookup} and `dnsPromises.lookup()`. The value could be: + * + * * `ipv4first`: sets default `verbatim` `false`. + * * `verbatim`: sets default `verbatim` `true`. + * + * The default is `verbatim` and {@link setDefaultResultOrder} have higher + * priority than `--dns-result-order`. When using `worker threads`,{@link setDefaultResultOrder} from the main thread won't affect the default + * dns orders in workers. + * @since v16.4.0, v14.18.0 + * @param order must be `'ipv4first'` or `'verbatim'`. + */ + export function setDefaultResultOrder(order: 'ipv4first' | 'verbatim'): void; + // Error codes + export const NODATA: string; + export const FORMERR: string; + export const SERVFAIL: string; + export const NOTFOUND: string; + export const NOTIMP: string; + export const REFUSED: string; + export const BADQUERY: string; + export const BADNAME: string; + export const BADFAMILY: string; + export const BADRESP: string; + export const CONNREFUSED: string; + export const TIMEOUT: string; + export const EOF: string; + export const FILE: string; + export const NOMEM: string; + export const DESTRUCTION: string; + export const BADSTR: string; + export const BADFLAGS: string; + export const NONAME: string; + export const BADHINTS: string; + export const NOTINITIALIZED: string; + export const LOADIPHLPAPI: string; + export const ADDRGETNETWORKPARAMS: string; + export const CANCELLED: string; + export interface ResolverOptions { + timeout?: number | undefined; + /** + * @default 4 + */ + tries?: number; + } + /** + * An independent resolver for DNS requests. + * + * Creating a new resolver uses the default server settings. Setting + * the servers used for a resolver using `resolver.setServers()` does not affect + * other resolvers: + * + * ```js + * const { Resolver } = require('node:dns'); + * const resolver = new Resolver(); + * resolver.setServers(['4.4.4.4']); + * + * // This request will use the server at 4.4.4.4, independent of global settings. + * resolver.resolve4('example.org', (err, addresses) => { + * // ... + * }); + * ``` + * + * The following methods from the `node:dns` module are available: + * + * * `resolver.getServers()` + * * `resolver.resolve()` + * * `resolver.resolve4()` + * * `resolver.resolve6()` + * * `resolver.resolveAny()` + * * `resolver.resolveCaa()` + * * `resolver.resolveCname()` + * * `resolver.resolveMx()` + * * `resolver.resolveNaptr()` + * * `resolver.resolveNs()` + * * `resolver.resolvePtr()` + * * `resolver.resolveSoa()` + * * `resolver.resolveSrv()` + * * `resolver.resolveTxt()` + * * `resolver.reverse()` + * * `resolver.setServers()` + * @since v8.3.0 + */ + export class Resolver { + constructor(options?: ResolverOptions); + /** + * Cancel all outstanding DNS queries made by this resolver. The corresponding + * callbacks will be called with an error with code `ECANCELLED`. + * @since v8.3.0 + */ + cancel(): void; + getServers: typeof getServers; + resolve: typeof resolve; + resolve4: typeof resolve4; + resolve6: typeof resolve6; + resolveAny: typeof resolveAny; + resolveCaa: typeof resolveCaa; + resolveCname: typeof resolveCname; + resolveMx: typeof resolveMx; + resolveNaptr: typeof resolveNaptr; + resolveNs: typeof resolveNs; + resolvePtr: typeof resolvePtr; + resolveSoa: typeof resolveSoa; + resolveSrv: typeof resolveSrv; + resolveTxt: typeof resolveTxt; + reverse: typeof reverse; + /** + * The resolver instance will send its requests from the specified IP address. + * This allows programs to specify outbound interfaces when used on multi-homed + * systems. + * + * If a v4 or v6 address is not specified, it is set to the default and the + * operating system will choose a local address automatically. + * + * The resolver will use the v4 local address when making requests to IPv4 DNS + * servers, and the v6 local address when making requests to IPv6 DNS servers. + * The `rrtype` of resolution requests has no impact on the local address used. + * @since v15.1.0, v14.17.0 + * @param [ipv4='0.0.0.0'] A string representation of an IPv4 address. + * @param [ipv6='::0'] A string representation of an IPv6 address. + */ + setLocalAddress(ipv4?: string, ipv6?: string): void; + setServers: typeof setServers; + } + export { dnsPromises as promises }; +} +declare module 'dns' { + export * from 'node:dns'; +} diff --git a/node_modules/@types/node/ts4.8/dns/promises.d.ts b/node_modules/@types/node/ts4.8/dns/promises.d.ts new file mode 100644 index 0000000..e5c7649 --- /dev/null +++ b/node_modules/@types/node/ts4.8/dns/promises.d.ts @@ -0,0 +1,414 @@ +/** + * The `dns.promises` API provides an alternative set of asynchronous DNS methods + * that return `Promise` objects rather than using callbacks. The API is accessible + * via `require('node:dns').promises` or `require('node:dns/promises')`. + * @since v10.6.0 + */ +declare module 'node:dns/promises' { + import { + LookupAddress, + LookupOneOptions, + LookupAllOptions, + LookupOptions, + AnyRecord, + CaaRecord, + MxRecord, + NaptrRecord, + SoaRecord, + SrvRecord, + ResolveWithTtlOptions, + RecordWithTtl, + ResolveOptions, + ResolverOptions, + } from 'node:dns'; + /** + * Returns an array of IP address strings, formatted according to [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6), + * that are currently configured for DNS resolution. A string will include a port + * section if a custom port is used. + * + * ```js + * [ + * '4.4.4.4', + * '2001:4860:4860::8888', + * '4.4.4.4:1053', + * '[2001:4860:4860::8888]:1053', + * ] + * ``` + * @since v10.6.0 + */ + function getServers(): string[]; + /** + * Resolves a host name (e.g. `'nodejs.org'`) into the first found A (IPv4) or + * AAAA (IPv6) record. All `option` properties are optional. If `options` is an + * integer, then it must be `4` or `6` – if `options` is not provided, then IPv4 + * and IPv6 addresses are both returned if found. + * + * With the `all` option set to `true`, the `Promise` is resolved with `addresses`being an array of objects with the properties `address` and `family`. + * + * On error, the `Promise` is rejected with an `Error` object, where `err.code`is the error code. + * Keep in mind that `err.code` will be set to `'ENOTFOUND'` not only when + * the host name does not exist but also when the lookup fails in other ways + * such as no available file descriptors. + * + * `dnsPromises.lookup()` does not necessarily have anything to do with the DNS + * protocol. The implementation uses an operating system facility that can + * associate names with addresses and vice versa. This implementation can have + * subtle but important consequences on the behavior of any Node.js program. Please + * take some time to consult the `Implementation considerations section` before + * using `dnsPromises.lookup()`. + * + * Example usage: + * + * ```js + * const dns = require('node:dns'); + * const dnsPromises = dns.promises; + * const options = { + * family: 6, + * hints: dns.ADDRCONFIG | dns.V4MAPPED, + * }; + * + * dnsPromises.lookup('example.com', options).then((result) => { + * console.log('address: %j family: IPv%s', result.address, result.family); + * // address: "2606:2800:220:1:248:1893:25c8:1946" family: IPv6 + * }); + * + * // When options.all is true, the result will be an Array. + * options.all = true; + * dnsPromises.lookup('example.com', options).then((result) => { + * console.log('addresses: %j', result); + * // addresses: [{"address":"2606:2800:220:1:248:1893:25c8:1946","family":6}] + * }); + * ``` + * @since v10.6.0 + */ + function lookup(hostname: string, family: number): Promise; + function lookup(hostname: string, options: LookupOneOptions): Promise; + function lookup(hostname: string, options: LookupAllOptions): Promise; + function lookup(hostname: string, options: LookupOptions): Promise; + function lookup(hostname: string): Promise; + /** + * Resolves the given `address` and `port` into a host name and service using + * the operating system's underlying `getnameinfo` implementation. + * + * If `address` is not a valid IP address, a `TypeError` will be thrown. + * The `port` will be coerced to a number. If it is not a legal port, a `TypeError`will be thrown. + * + * On error, the `Promise` is rejected with an `Error` object, where `err.code`is the error code. + * + * ```js + * const dnsPromises = require('node:dns').promises; + * dnsPromises.lookupService('127.0.0.1', 22).then((result) => { + * console.log(result.hostname, result.service); + * // Prints: localhost ssh + * }); + * ``` + * @since v10.6.0 + */ + function lookupService( + address: string, + port: number + ): Promise<{ + hostname: string; + service: string; + }>; + /** + * Uses the DNS protocol to resolve a host name (e.g. `'nodejs.org'`) into an array + * of the resource records. When successful, the `Promise` is resolved with an + * array of resource records. The type and structure of individual results vary + * based on `rrtype`: + * + * + * + * On error, the `Promise` is rejected with an `Error` object, where `err.code`is one of the `DNS error codes`. + * @since v10.6.0 + * @param hostname Host name to resolve. + * @param [rrtype='A'] Resource record type. + */ + function resolve(hostname: string): Promise; + function resolve(hostname: string, rrtype: 'A'): Promise; + function resolve(hostname: string, rrtype: 'AAAA'): Promise; + function resolve(hostname: string, rrtype: 'ANY'): Promise; + function resolve(hostname: string, rrtype: 'CAA'): Promise; + function resolve(hostname: string, rrtype: 'CNAME'): Promise; + function resolve(hostname: string, rrtype: 'MX'): Promise; + function resolve(hostname: string, rrtype: 'NAPTR'): Promise; + function resolve(hostname: string, rrtype: 'NS'): Promise; + function resolve(hostname: string, rrtype: 'PTR'): Promise; + function resolve(hostname: string, rrtype: 'SOA'): Promise; + function resolve(hostname: string, rrtype: 'SRV'): Promise; + function resolve(hostname: string, rrtype: 'TXT'): Promise; + function resolve(hostname: string, rrtype: string): Promise; + /** + * Uses the DNS protocol to resolve IPv4 addresses (`A` records) for the`hostname`. On success, the `Promise` is resolved with an array of IPv4 + * addresses (e.g. `['74.125.79.104', '74.125.79.105', '74.125.79.106']`). + * @since v10.6.0 + * @param hostname Host name to resolve. + */ + function resolve4(hostname: string): Promise; + function resolve4(hostname: string, options: ResolveWithTtlOptions): Promise; + function resolve4(hostname: string, options: ResolveOptions): Promise; + /** + * Uses the DNS protocol to resolve IPv6 addresses (`AAAA` records) for the`hostname`. On success, the `Promise` is resolved with an array of IPv6 + * addresses. + * @since v10.6.0 + * @param hostname Host name to resolve. + */ + function resolve6(hostname: string): Promise; + function resolve6(hostname: string, options: ResolveWithTtlOptions): Promise; + function resolve6(hostname: string, options: ResolveOptions): Promise; + /** + * Uses the DNS protocol to resolve all records (also known as `ANY` or `*` query). + * On success, the `Promise` is resolved with an array containing various types of + * records. Each object has a property `type` that indicates the type of the + * current record. And depending on the `type`, additional properties will be + * present on the object: + * + * + * + * Here is an example of the result object: + * + * ```js + * [ { type: 'A', address: '127.0.0.1', ttl: 299 }, + * { type: 'CNAME', value: 'example.com' }, + * { type: 'MX', exchange: 'alt4.aspmx.l.example.com', priority: 50 }, + * { type: 'NS', value: 'ns1.example.com' }, + * { type: 'TXT', entries: [ 'v=spf1 include:_spf.example.com ~all' ] }, + * { type: 'SOA', + * nsname: 'ns1.example.com', + * hostmaster: 'admin.example.com', + * serial: 156696742, + * refresh: 900, + * retry: 900, + * expire: 1800, + * minttl: 60 } ] + * ``` + * @since v10.6.0 + */ + function resolveAny(hostname: string): Promise; + /** + * Uses the DNS protocol to resolve `CAA` records for the `hostname`. On success, + * the `Promise` is resolved with an array of objects containing available + * certification authority authorization records available for the `hostname`(e.g. `[{critical: 0, iodef: 'mailto:pki@example.com'},{critical: 128, issue: 'pki.example.com'}]`). + * @since v15.0.0, v14.17.0 + */ + function resolveCaa(hostname: string): Promise; + /** + * Uses the DNS protocol to resolve `CNAME` records for the `hostname`. On success, + * the `Promise` is resolved with an array of canonical name records available for + * the `hostname` (e.g. `['bar.example.com']`). + * @since v10.6.0 + */ + function resolveCname(hostname: string): Promise; + /** + * Uses the DNS protocol to resolve mail exchange records (`MX` records) for the`hostname`. On success, the `Promise` is resolved with an array of objects + * containing both a `priority` and `exchange` property (e.g.`[{priority: 10, exchange: 'mx.example.com'}, ...]`). + * @since v10.6.0 + */ + function resolveMx(hostname: string): Promise; + /** + * Uses the DNS protocol to resolve regular expression-based records (`NAPTR`records) for the `hostname`. On success, the `Promise` is resolved with an array + * of objects with the following properties: + * + * * `flags` + * * `service` + * * `regexp` + * * `replacement` + * * `order` + * * `preference` + * + * ```js + * { + * flags: 's', + * service: 'SIP+D2U', + * regexp: '', + * replacement: '_sip._udp.example.com', + * order: 30, + * preference: 100 + * } + * ``` + * @since v10.6.0 + */ + function resolveNaptr(hostname: string): Promise; + /** + * Uses the DNS protocol to resolve name server records (`NS` records) for the`hostname`. On success, the `Promise` is resolved with an array of name server + * records available for `hostname` (e.g.`['ns1.example.com', 'ns2.example.com']`). + * @since v10.6.0 + */ + function resolveNs(hostname: string): Promise; + /** + * Uses the DNS protocol to resolve pointer records (`PTR` records) for the`hostname`. On success, the `Promise` is resolved with an array of strings + * containing the reply records. + * @since v10.6.0 + */ + function resolvePtr(hostname: string): Promise; + /** + * Uses the DNS protocol to resolve a start of authority record (`SOA` record) for + * the `hostname`. On success, the `Promise` is resolved with an object with the + * following properties: + * + * * `nsname` + * * `hostmaster` + * * `serial` + * * `refresh` + * * `retry` + * * `expire` + * * `minttl` + * + * ```js + * { + * nsname: 'ns.example.com', + * hostmaster: 'root.example.com', + * serial: 2013101809, + * refresh: 10000, + * retry: 2400, + * expire: 604800, + * minttl: 3600 + * } + * ``` + * @since v10.6.0 + */ + function resolveSoa(hostname: string): Promise; + /** + * Uses the DNS protocol to resolve service records (`SRV` records) for the`hostname`. On success, the `Promise` is resolved with an array of objects with + * the following properties: + * + * * `priority` + * * `weight` + * * `port` + * * `name` + * + * ```js + * { + * priority: 10, + * weight: 5, + * port: 21223, + * name: 'service.example.com' + * } + * ``` + * @since v10.6.0 + */ + function resolveSrv(hostname: string): Promise; + /** + * Uses the DNS protocol to resolve text queries (`TXT` records) for the`hostname`. On success, the `Promise` is resolved with a two-dimensional array + * of the text records available for `hostname` (e.g.`[ ['v=spf1 ip4:0.0.0.0 ', '~all' ] ]`). Each sub-array contains TXT chunks of + * one record. Depending on the use case, these could be either joined together or + * treated separately. + * @since v10.6.0 + */ + function resolveTxt(hostname: string): Promise; + /** + * Performs a reverse DNS query that resolves an IPv4 or IPv6 address to an + * array of host names. + * + * On error, the `Promise` is rejected with an `Error` object, where `err.code`is one of the `DNS error codes`. + * @since v10.6.0 + */ + function reverse(ip: string): Promise; + /** + * Sets the IP address and port of servers to be used when performing DNS + * resolution. The `servers` argument is an array of [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6) formatted + * addresses. If the port is the IANA default DNS port (53) it can be omitted. + * + * ```js + * dnsPromises.setServers([ + * '4.4.4.4', + * '[2001:4860:4860::8888]', + * '4.4.4.4:1053', + * '[2001:4860:4860::8888]:1053', + * ]); + * ``` + * + * An error will be thrown if an invalid address is provided. + * + * The `dnsPromises.setServers()` method must not be called while a DNS query is in + * progress. + * + * This method works much like [resolve.conf](https://man7.org/linux/man-pages/man5/resolv.conf.5.html). + * That is, if attempting to resolve with the first server provided results in a`NOTFOUND` error, the `resolve()` method will _not_ attempt to resolve with + * subsequent servers provided. Fallback DNS servers will only be used if the + * earlier ones time out or result in some other error. + * @since v10.6.0 + * @param servers array of `RFC 5952` formatted addresses + */ + function setServers(servers: ReadonlyArray): void; + /** + * Set the default value of `verbatim` in `dns.lookup()` and `dnsPromises.lookup()`. The value could be: + * + * * `ipv4first`: sets default `verbatim` `false`. + * * `verbatim`: sets default `verbatim` `true`. + * + * The default is `verbatim` and `dnsPromises.setDefaultResultOrder()` have + * higher priority than `--dns-result-order`. When using `worker threads`,`dnsPromises.setDefaultResultOrder()` from the main thread won't affect the + * default dns orders in workers. + * @since v16.4.0, v14.18.0 + * @param order must be `'ipv4first'` or `'verbatim'`. + */ + function setDefaultResultOrder(order: 'ipv4first' | 'verbatim'): void; + /** + * An independent resolver for DNS requests. + * + * Creating a new resolver uses the default server settings. Setting + * the servers used for a resolver using `resolver.setServers()` does not affect + * other resolvers: + * + * ```js + * const { Resolver } = require('node:dns').promises; + * const resolver = new Resolver(); + * resolver.setServers(['4.4.4.4']); + * + * // This request will use the server at 4.4.4.4, independent of global settings. + * resolver.resolve4('example.org').then((addresses) => { + * // ... + * }); + * + * // Alternatively, the same code can be written using async-await style. + * (async function() { + * const addresses = await resolver.resolve4('example.org'); + * })(); + * ``` + * + * The following methods from the `dnsPromises` API are available: + * + * * `resolver.getServers()` + * * `resolver.resolve()` + * * `resolver.resolve4()` + * * `resolver.resolve6()` + * * `resolver.resolveAny()` + * * `resolver.resolveCaa()` + * * `resolver.resolveCname()` + * * `resolver.resolveMx()` + * * `resolver.resolveNaptr()` + * * `resolver.resolveNs()` + * * `resolver.resolvePtr()` + * * `resolver.resolveSoa()` + * * `resolver.resolveSrv()` + * * `resolver.resolveTxt()` + * * `resolver.reverse()` + * * `resolver.setServers()` + * @since v10.6.0 + */ + class Resolver { + constructor(options?: ResolverOptions); + cancel(): void; + getServers: typeof getServers; + resolve: typeof resolve; + resolve4: typeof resolve4; + resolve6: typeof resolve6; + resolveAny: typeof resolveAny; + resolveCaa: typeof resolveCaa; + resolveCname: typeof resolveCname; + resolveMx: typeof resolveMx; + resolveNaptr: typeof resolveNaptr; + resolveNs: typeof resolveNs; + resolvePtr: typeof resolvePtr; + resolveSoa: typeof resolveSoa; + resolveSrv: typeof resolveSrv; + resolveTxt: typeof resolveTxt; + reverse: typeof reverse; + setLocalAddress(ipv4?: string, ipv6?: string): void; + setServers: typeof setServers; + } +} +declare module 'dns/promises' { + export * from 'node:dns/promises'; +} diff --git a/node_modules/@types/node/ts4.8/dom-events.d.ts b/node_modules/@types/node/ts4.8/dom-events.d.ts new file mode 100644 index 0000000..b9c1c3a --- /dev/null +++ b/node_modules/@types/node/ts4.8/dom-events.d.ts @@ -0,0 +1,126 @@ +export {}; // Don't export anything! + +//// DOM-like Events +// NB: The Event / EventTarget / EventListener implementations below were copied +// from lib.dom.d.ts, then edited to reflect Node's documentation at +// https://nodejs.org/api/events.html#class-eventtarget. +// Please read that link to understand important implementation differences. + +// This conditional type will be the existing global Event in a browser, or +// the copy below in a Node environment. +type __Event = typeof globalThis extends { onmessage: any, Event: any } +? {} +: { + /** This is not used in Node.js and is provided purely for completeness. */ + readonly bubbles: boolean; + /** Alias for event.stopPropagation(). This is not used in Node.js and is provided purely for completeness. */ + cancelBubble: () => void; + /** True if the event was created with the cancelable option */ + readonly cancelable: boolean; + /** This is not used in Node.js and is provided purely for completeness. */ + readonly composed: boolean; + /** Returns an array containing the current EventTarget as the only entry or empty if the event is not being dispatched. This is not used in Node.js and is provided purely for completeness. */ + composedPath(): [EventTarget?] + /** Alias for event.target. */ + readonly currentTarget: EventTarget | null; + /** Is true if cancelable is true and event.preventDefault() has been called. */ + readonly defaultPrevented: boolean; + /** This is not used in Node.js and is provided purely for completeness. */ + readonly eventPhase: 0 | 2; + /** The `AbortSignal` "abort" event is emitted with `isTrusted` set to `true`. The value is `false` in all other cases. */ + readonly isTrusted: boolean; + /** Sets the `defaultPrevented` property to `true` if `cancelable` is `true`. */ + preventDefault(): void; + /** This is not used in Node.js and is provided purely for completeness. */ + returnValue: boolean; + /** Alias for event.target. */ + readonly srcElement: EventTarget | null; + /** Stops the invocation of event listeners after the current one completes. */ + stopImmediatePropagation(): void; + /** This is not used in Node.js and is provided purely for completeness. */ + stopPropagation(): void; + /** The `EventTarget` dispatching the event */ + readonly target: EventTarget | null; + /** The millisecond timestamp when the Event object was created. */ + readonly timeStamp: number; + /** Returns the type of event, e.g. "click", "hashchange", or "submit". */ + readonly type: string; +}; + +// See comment above explaining conditional type +type __EventTarget = typeof globalThis extends { onmessage: any, EventTarget: any } +? {} +: { + /** + * Adds a new handler for the `type` event. Any given `listener` is added only once per `type` and per `capture` option value. + * + * If the `once` option is true, the `listener` is removed after the next time a `type` event is dispatched. + * + * The `capture` option is not used by Node.js in any functional way other than tracking registered event listeners per the `EventTarget` specification. + * Specifically, the `capture` option is used as part of the key when registering a `listener`. + * Any individual `listener` may be added once with `capture = false`, and once with `capture = true`. + */ + addEventListener( + type: string, + listener: EventListener | EventListenerObject, + options?: AddEventListenerOptions | boolean, + ): void; + /** Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise. */ + dispatchEvent(event: Event): boolean; + /** Removes the event listener in target's event listener list with the same type, callback, and options. */ + removeEventListener( + type: string, + listener: EventListener | EventListenerObject, + options?: EventListenerOptions | boolean, + ): void; +}; + +interface EventInit { + bubbles?: boolean; + cancelable?: boolean; + composed?: boolean; +} + +interface EventListenerOptions { + /** Not directly used by Node.js. Added for API completeness. Default: `false`. */ + capture?: boolean; +} + +interface AddEventListenerOptions extends EventListenerOptions { + /** When `true`, the listener is automatically removed when it is first invoked. Default: `false`. */ + once?: boolean; + /** When `true`, serves as a hint that the listener will not call the `Event` object's `preventDefault()` method. Default: false. */ + passive?: boolean; +} + +interface EventListener { + (evt: Event): void; +} + +interface EventListenerObject { + handleEvent(object: Event): void; +} + +import {} from 'events'; // Make this an ambient declaration +declare global { + /** An event which takes place in the DOM. */ + interface Event extends __Event {} + var Event: typeof globalThis extends { onmessage: any, Event: infer T } + ? T + : { + prototype: __Event; + new (type: string, eventInitDict?: EventInit): __Event; + }; + + /** + * EventTarget is a DOM interface implemented by objects that can + * receive events and may have listeners for them. + */ + interface EventTarget extends __EventTarget {} + var EventTarget: typeof globalThis extends { onmessage: any, EventTarget: infer T } + ? T + : { + prototype: __EventTarget; + new (): __EventTarget; + }; +} diff --git a/node_modules/@types/node/ts4.8/domain.d.ts b/node_modules/@types/node/ts4.8/domain.d.ts new file mode 100644 index 0000000..546aae7 --- /dev/null +++ b/node_modules/@types/node/ts4.8/domain.d.ts @@ -0,0 +1,170 @@ +/** + * **This module is pending deprecation.** Once a replacement API has been + * finalized, this module will be fully deprecated. Most developers should + * **not** have cause to use this module. Users who absolutely must have + * the functionality that domains provide may rely on it for the time being + * but should expect to have to migrate to a different solution + * in the future. + * + * Domains provide a way to handle multiple different IO operations as a + * single group. If any of the event emitters or callbacks registered to a + * domain emit an `'error'` event, or throw an error, then the domain object + * will be notified, rather than losing the context of the error in the`process.on('uncaughtException')` handler, or causing the program to + * exit immediately with an error code. + * @deprecated Since v1.4.2 - Deprecated + * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/domain.js) + */ +declare module 'node:domain' { + import EventEmitter = require('node:events'); + /** + * The `Domain` class encapsulates the functionality of routing errors and + * uncaught exceptions to the active `Domain` object. + * + * To handle the errors that it catches, listen to its `'error'` event. + */ + class Domain extends EventEmitter { + /** + * An array of timers and event emitters that have been explicitly added + * to the domain. + */ + members: Array; + /** + * The `enter()` method is plumbing used by the `run()`, `bind()`, and`intercept()` methods to set the active domain. It sets `domain.active` and`process.domain` to the domain, and implicitly + * pushes the domain onto the domain + * stack managed by the domain module (see {@link exit} for details on the + * domain stack). The call to `enter()` delimits the beginning of a chain of + * asynchronous calls and I/O operations bound to a domain. + * + * Calling `enter()` changes only the active domain, and does not alter the domain + * itself. `enter()` and `exit()` can be called an arbitrary number of times on a + * single domain. + */ + enter(): void; + /** + * The `exit()` method exits the current domain, popping it off the domain stack. + * Any time execution is going to switch to the context of a different chain of + * asynchronous calls, it's important to ensure that the current domain is exited. + * The call to `exit()` delimits either the end of or an interruption to the chain + * of asynchronous calls and I/O operations bound to a domain. + * + * If there are multiple, nested domains bound to the current execution context,`exit()` will exit any domains nested within this domain. + * + * Calling `exit()` changes only the active domain, and does not alter the domain + * itself. `enter()` and `exit()` can be called an arbitrary number of times on a + * single domain. + */ + exit(): void; + /** + * Run the supplied function in the context of the domain, implicitly + * binding all event emitters, timers, and low-level requests that are + * created in that context. Optionally, arguments can be passed to + * the function. + * + * This is the most basic way to use a domain. + * + * ```js + * const domain = require('node:domain'); + * const fs = require('node:fs'); + * const d = domain.create(); + * d.on('error', (er) => { + * console.error('Caught error!', er); + * }); + * d.run(() => { + * process.nextTick(() => { + * setTimeout(() => { // Simulating some various async stuff + * fs.open('non-existent file', 'r', (er, fd) => { + * if (er) throw er; + * // proceed... + * }); + * }, 100); + * }); + * }); + * ``` + * + * In this example, the `d.on('error')` handler will be triggered, rather + * than crashing the program. + */ + run(fn: (...args: any[]) => T, ...args: any[]): T; + /** + * Explicitly adds an emitter to the domain. If any event handlers called by + * the emitter throw an error, or if the emitter emits an `'error'` event, it + * will be routed to the domain's `'error'` event, just like with implicit + * binding. + * + * This also works with timers that are returned from `setInterval()` and `setTimeout()`. If their callback function throws, it will be caught by + * the domain `'error'` handler. + * + * If the Timer or `EventEmitter` was already bound to a domain, it is removed + * from that one, and bound to this one instead. + * @param emitter emitter or timer to be added to the domain + */ + add(emitter: EventEmitter | NodeJS.Timer): void; + /** + * The opposite of {@link add}. Removes domain handling from the + * specified emitter. + * @param emitter emitter or timer to be removed from the domain + */ + remove(emitter: EventEmitter | NodeJS.Timer): void; + /** + * The returned function will be a wrapper around the supplied callback + * function. When the returned function is called, any errors that are + * thrown will be routed to the domain's `'error'` event. + * + * ```js + * const d = domain.create(); + * + * function readSomeFile(filename, cb) { + * fs.readFile(filename, 'utf8', d.bind((er, data) => { + * // If this throws, it will also be passed to the domain. + * return cb(er, data ? JSON.parse(data) : null); + * })); + * } + * + * d.on('error', (er) => { + * // An error occurred somewhere. If we throw it now, it will crash the program + * // with the normal line number and stack message. + * }); + * ``` + * @param callback The callback function + * @return The bound function + */ + bind(callback: T): T; + /** + * This method is almost identical to {@link bind}. However, in + * addition to catching thrown errors, it will also intercept `Error` objects sent as the first argument to the function. + * + * In this way, the common `if (err) return callback(err);` pattern can be replaced + * with a single error handler in a single place. + * + * ```js + * const d = domain.create(); + * + * function readSomeFile(filename, cb) { + * fs.readFile(filename, 'utf8', d.intercept((data) => { + * // Note, the first argument is never passed to the + * // callback since it is assumed to be the 'Error' argument + * // and thus intercepted by the domain. + * + * // If this throws, it will also be passed to the domain + * // so the error-handling logic can be moved to the 'error' + * // event on the domain instead of being repeated throughout + * // the program. + * return cb(null, JSON.parse(data)); + * })); + * } + * + * d.on('error', (er) => { + * // An error occurred somewhere. If we throw it now, it will crash the program + * // with the normal line number and stack message. + * }); + * ``` + * @param callback The callback function + * @return The intercepted function + */ + intercept(callback: T): T; + } + function create(): Domain; +} +declare module 'domain' { + export * from 'node:domain'; +} diff --git a/node_modules/@types/node/ts4.8/events.d.ts b/node_modules/@types/node/ts4.8/events.d.ts new file mode 100644 index 0000000..59e264b --- /dev/null +++ b/node_modules/@types/node/ts4.8/events.d.ts @@ -0,0 +1,788 @@ +/** + * Much of the Node.js core API is built around an idiomatic asynchronous + * event-driven architecture in which certain kinds of objects (called "emitters") + * emit named events that cause `Function` objects ("listeners") to be called. + * + * For instance: a `net.Server` object emits an event each time a peer + * connects to it; a `fs.ReadStream` emits an event when the file is opened; + * a `stream` emits an event whenever data is available to be read. + * + * All objects that emit events are instances of the `EventEmitter` class. These + * objects expose an `eventEmitter.on()` function that allows one or more + * functions to be attached to named events emitted by the object. Typically, + * event names are camel-cased strings but any valid JavaScript property key + * can be used. + * + * When the `EventEmitter` object emits an event, all of the functions attached + * to that specific event are called _synchronously_. Any values returned by the + * called listeners are _ignored_ and discarded. + * + * The following example shows a simple `EventEmitter` instance with a single + * listener. The `eventEmitter.on()` method is used to register listeners, while + * the `eventEmitter.emit()` method is used to trigger the event. + * + * ```js + * import { EventEmitter } from 'node:events'; + * + * class MyEmitter extends EventEmitter {} + * + * const myEmitter = new MyEmitter(); + * myEmitter.on('event', () => { + * console.log('an event occurred!'); + * }); + * myEmitter.emit('event'); + * ``` + * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/events.js) + */ +declare module 'node:events' { + // NOTE: This class is in the docs but is **not actually exported** by Node. + // If https://github.com/nodejs/node/issues/39903 gets resolved and Node + // actually starts exporting the class, uncomment below. + // import { EventListener, EventListenerObject } from '__dom-events'; + // /** The NodeEventTarget is a Node.js-specific extension to EventTarget that emulates a subset of the EventEmitter API. */ + // interface NodeEventTarget extends EventTarget { + // /** + // * Node.js-specific extension to the `EventTarget` class that emulates the equivalent `EventEmitter` API. + // * The only difference between `addListener()` and `addEventListener()` is that addListener() will return a reference to the EventTarget. + // */ + // addListener(type: string, listener: EventListener | EventListenerObject, options?: { once: boolean }): this; + // /** Node.js-specific extension to the `EventTarget` class that returns an array of event `type` names for which event listeners are registered. */ + // eventNames(): string[]; + // /** Node.js-specific extension to the `EventTarget` class that returns the number of event listeners registered for the `type`. */ + // listenerCount(type: string): number; + // /** Node.js-specific alias for `eventTarget.removeListener()`. */ + // off(type: string, listener: EventListener | EventListenerObject): this; + // /** Node.js-specific alias for `eventTarget.addListener()`. */ + // on(type: string, listener: EventListener | EventListenerObject, options?: { once: boolean }): this; + // /** Node.js-specific extension to the `EventTarget` class that adds a `once` listener for the given event `type`. This is equivalent to calling `on` with the `once` option set to `true`. */ + // once(type: string, listener: EventListener | EventListenerObject): this; + // /** + // * Node.js-specific extension to the `EventTarget` class. + // * If `type` is specified, removes all registered listeners for `type`, + // * otherwise removes all registered listeners. + // */ + // removeAllListeners(type: string): this; + // /** + // * Node.js-specific extension to the `EventTarget` class that removes the listener for the given `type`. + // * The only difference between `removeListener()` and `removeEventListener()` is that `removeListener()` will return a reference to the `EventTarget`. + // */ + // removeListener(type: string, listener: EventListener | EventListenerObject): this; + // } + interface EventEmitterOptions { + /** + * Enables automatic capturing of promise rejection. + */ + captureRejections?: boolean | undefined; + } + // Any EventTarget with a Node-style `once` function + interface _NodeEventTarget { + once(eventName: string | symbol, listener: (...args: any[]) => void): this; + } + // Any EventTarget with a DOM-style `addEventListener` + interface _DOMEventTarget { + addEventListener( + eventName: string, + listener: (...args: any[]) => void, + opts?: { + once: boolean; + } + ): any; + } + interface StaticEventEmitterOptions { + signal?: AbortSignal | undefined; + } + interface EventEmitter extends NodeJS.EventEmitter {} + /** + * The `EventEmitter` class is defined and exposed by the `node:events` module: + * + * ```js + * import { EventEmitter } from 'node:events'; + * ``` + * + * All `EventEmitter`s emit the event `'newListener'` when new listeners are + * added and `'removeListener'` when existing listeners are removed. + * + * It supports the following option: + * @since v0.1.26 + */ + class EventEmitter { + constructor(options?: EventEmitterOptions); + /** + * Creates a `Promise` that is fulfilled when the `EventEmitter` emits the given + * event or that is rejected if the `EventEmitter` emits `'error'` while waiting. + * The `Promise` will resolve with an array of all the arguments emitted to the + * given event. + * + * This method is intentionally generic and works with the web platform [EventTarget](https://dom.spec.whatwg.org/#interface-eventtarget) interface, which has no special`'error'` event + * semantics and does not listen to the `'error'` event. + * + * ```js + * import { once, EventEmitter } from 'node:events'; + * import process from 'node:process'; + * + * const ee = new EventEmitter(); + * + * process.nextTick(() => { + * ee.emit('myevent', 42); + * }); + * + * const [value] = await once(ee, 'myevent'); + * console.log(value); + * + * const err = new Error('kaboom'); + * process.nextTick(() => { + * ee.emit('error', err); + * }); + * + * try { + * await once(ee, 'myevent'); + * } catch (err) { + * console.error('error happened', err); + * } + * ``` + * + * The special handling of the `'error'` event is only used when `events.once()`is used to wait for another event. If `events.once()` is used to wait for the + * '`error'` event itself, then it is treated as any other kind of event without + * special handling: + * + * ```js + * import { EventEmitter, once } from 'node:events'; + * + * const ee = new EventEmitter(); + * + * once(ee, 'error') + * .then(([err]) => console.log('ok', err.message)) + * .catch((err) => console.error('error', err.message)); + * + * ee.emit('error', new Error('boom')); + * + * // Prints: ok boom + * ``` + * + * An `AbortSignal` can be used to cancel waiting for the event: + * + * ```js + * import { EventEmitter, once } from 'node:events'; + * + * const ee = new EventEmitter(); + * const ac = new AbortController(); + * + * async function foo(emitter, event, signal) { + * try { + * await once(emitter, event, { signal }); + * console.log('event emitted!'); + * } catch (error) { + * if (error.name === 'AbortError') { + * console.error('Waiting for the event was canceled!'); + * } else { + * console.error('There was an error', error.message); + * } + * } + * } + * + * foo(ee, 'foo', ac.signal); + * ac.abort(); // Abort waiting for the event + * ee.emit('foo'); // Prints: Waiting for the event was canceled! + * ``` + * @since v11.13.0, v10.16.0 + */ + static once(emitter: _NodeEventTarget, eventName: string | symbol, options?: StaticEventEmitterOptions): Promise; + static once(emitter: _DOMEventTarget, eventName: string, options?: StaticEventEmitterOptions): Promise; + /** + * ```js + * import { on, EventEmitter } from 'node:events'; + * import process from 'node:process'; + * + * const ee = new EventEmitter(); + * + * // Emit later on + * process.nextTick(() => { + * ee.emit('foo', 'bar'); + * ee.emit('foo', 42); + * }); + * + * for await (const event of on(ee, 'foo')) { + * // The execution of this inner block is synchronous and it + * // processes one event at a time (even with await). Do not use + * // if concurrent execution is required. + * console.log(event); // prints ['bar'] [42] + * } + * // Unreachable here + * ``` + * + * Returns an `AsyncIterator` that iterates `eventName` events. It will throw + * if the `EventEmitter` emits `'error'`. It removes all listeners when + * exiting the loop. The `value` returned by each iteration is an array + * composed of the emitted event arguments. + * + * An `AbortSignal` can be used to cancel waiting on events: + * + * ```js + * import { on, EventEmitter } from 'node:events'; + * import process from 'node:process'; + * + * const ac = new AbortController(); + * + * (async () => { + * const ee = new EventEmitter(); + * + * // Emit later on + * process.nextTick(() => { + * ee.emit('foo', 'bar'); + * ee.emit('foo', 42); + * }); + * + * for await (const event of on(ee, 'foo', { signal: ac.signal })) { + * // The execution of this inner block is synchronous and it + * // processes one event at a time (even with await). Do not use + * // if concurrent execution is required. + * console.log(event); // prints ['bar'] [42] + * } + * // Unreachable here + * })(); + * + * process.nextTick(() => ac.abort()); + * ``` + * @since v13.6.0, v12.16.0 + * @param eventName The name of the event being listened for + * @return that iterates `eventName` events emitted by the `emitter` + */ + static on(emitter: NodeJS.EventEmitter, eventName: string, options?: StaticEventEmitterOptions): AsyncIterableIterator; + /** + * A class method that returns the number of listeners for the given `eventName`registered on the given `emitter`. + * + * ```js + * import { EventEmitter, listenerCount } from 'node:events'; + * + * const myEmitter = new EventEmitter(); + * myEmitter.on('event', () => {}); + * myEmitter.on('event', () => {}); + * console.log(listenerCount(myEmitter, 'event')); + * // Prints: 2 + * ``` + * @since v0.9.12 + * @deprecated Since v3.2.0 - Use `listenerCount` instead. + * @param emitter The emitter to query + * @param eventName The event name + */ + static listenerCount(emitter: NodeJS.EventEmitter, eventName: string | symbol): number; + /** + * Returns a copy of the array of listeners for the event named `eventName`. + * + * For `EventEmitter`s this behaves exactly the same as calling `.listeners` on + * the emitter. + * + * For `EventTarget`s this is the only way to get the event listeners for the + * event target. This is useful for debugging and diagnostic purposes. + * + * ```js + * import { getEventListeners, EventEmitter } from 'node:events'; + * + * { + * const ee = new EventEmitter(); + * const listener = () => console.log('Events are fun'); + * ee.on('foo', listener); + * console.log(getEventListeners(ee, 'foo')); // [ [Function: listener] ] + * } + * { + * const et = new EventTarget(); + * const listener = () => console.log('Events are fun'); + * et.addEventListener('foo', listener); + * console.log(getEventListeners(et, 'foo')); // [ [Function: listener] ] + * } + * ``` + * @since v15.2.0, v14.17.0 + */ + static getEventListeners(emitter: _DOMEventTarget | NodeJS.EventEmitter, name: string | symbol): Function[]; + /** + * Returns the currently set max amount of listeners. + * + * For `EventEmitter`s this behaves exactly the same as calling `.getMaxListeners` on + * the emitter. + * + * For `EventTarget`s this is the only way to get the max event listeners for the + * event target. If the number of event handlers on a single EventTarget exceeds + * the max set, the EventTarget will print a warning. + * + * ```js + * import { getMaxListeners, setMaxListeners, EventEmitter } from 'node:events'; + * + * { + * const ee = new EventEmitter(); + * console.log(getMaxListeners(ee)); // 10 + * setMaxListeners(11, ee); + * console.log(getMaxListeners(ee)); // 11 + * } + * { + * const et = new EventTarget(); + * console.log(getMaxListeners(et)); // 10 + * setMaxListeners(11, et); + * console.log(getMaxListeners(et)); // 11 + * } + * ``` + * @since v19.9.0 + */ + static getMaxListeners(emitter: _DOMEventTarget | NodeJS.EventEmitter): number; + /** + * ```js + * import { setMaxListeners, EventEmitter } from 'node:events'; + * + * const target = new EventTarget(); + * const emitter = new EventEmitter(); + * + * setMaxListeners(5, target, emitter); + * ``` + * @since v15.4.0 + * @param n A non-negative number. The maximum number of listeners per `EventTarget` event. + * @param eventsTargets Zero or more {EventTarget} or {EventEmitter} instances. If none are specified, `n` is set as the default max for all newly created {EventTarget} and {EventEmitter} + * objects. + */ + static setMaxListeners(n?: number, ...eventTargets: Array<_DOMEventTarget | NodeJS.EventEmitter>): void; + /** + * Listens once to the `abort` event on the provided `signal`. + * + * Listening to the `abort` event on abort signals is unsafe and may + * lead to resource leaks since another third party with the signal can + * call `e.stopImmediatePropagation()`. Unfortunately Node.js cannot change + * this since it would violate the web standard. Additionally, the original + * API makes it easy to forget to remove listeners. + * + * This API allows safely using `AbortSignal`s in Node.js APIs by solving these + * two issues by listening to the event such that `stopImmediatePropagation` does + * not prevent the listener from running. + * + * Returns a disposable so that it may be unsubscribed from more easily. + * + * ```js + * import { addAbortListener } from 'node:events'; + * + * function example(signal) { + * let disposable; + * try { + * signal.addEventListener('abort', (e) => e.stopImmediatePropagation()); + * disposable = addAbortListener(signal, (e) => { + * // Do something when signal is aborted. + * }); + * } finally { + * disposable?.[Symbol.dispose](); + * } + * } + * ``` + * @since v20.5.0 + * @experimental + * @return that removes the `abort` listener. + */ + static addAbortListener(signal: AbortSignal, resource: (event: Event) => void): Disposable; + /** + * This symbol shall be used to install a listener for only monitoring `'error'`events. Listeners installed using this symbol are called before the regular`'error'` listeners are called. + * + * Installing a listener using this symbol does not change the behavior once an`'error'` event is emitted. Therefore, the process will still crash if no + * regular `'error'` listener is installed. + * @since v13.6.0, v12.17.0 + */ + static readonly errorMonitor: unique symbol; + /** + * Value: `Symbol.for('nodejs.rejection')` + * + * See how to write a custom `rejection handler`. + * @since v13.4.0, v12.16.0 + */ + static readonly captureRejectionSymbol: unique symbol; + /** + * Value: [boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type) + * + * Change the default `captureRejections` option on all new `EventEmitter` objects. + * @since v13.4.0, v12.16.0 + */ + static captureRejections: boolean; + /** + * By default, a maximum of `10` listeners can be registered for any single + * event. This limit can be changed for individual `EventEmitter` instances + * using the `emitter.setMaxListeners(n)` method. To change the default + * for _all_`EventEmitter` instances, the `events.defaultMaxListeners`property can be used. If this value is not a positive number, a `RangeError`is thrown. + * + * Take caution when setting the `events.defaultMaxListeners` because the + * change affects _all_`EventEmitter` instances, including those created before + * the change is made. However, calling `emitter.setMaxListeners(n)` still has + * precedence over `events.defaultMaxListeners`. + * + * This is not a hard limit. The `EventEmitter` instance will allow + * more listeners to be added but will output a trace warning to stderr indicating + * that a "possible EventEmitter memory leak" has been detected. For any single`EventEmitter`, the `emitter.getMaxListeners()` and `emitter.setMaxListeners()`methods can be used to + * temporarily avoid this warning: + * + * ```js + * import { EventEmitter } from 'node:events'; + * const emitter = new EventEmitter(); + * emitter.setMaxListeners(emitter.getMaxListeners() + 1); + * emitter.once('event', () => { + * // do stuff + * emitter.setMaxListeners(Math.max(emitter.getMaxListeners() - 1, 0)); + * }); + * ``` + * + * The `--trace-warnings` command-line flag can be used to display the + * stack trace for such warnings. + * + * The emitted warning can be inspected with `process.on('warning')` and will + * have the additional `emitter`, `type`, and `count` properties, referring to + * the event emitter instance, the event's name and the number of attached + * listeners, respectively. + * Its `name` property is set to `'MaxListenersExceededWarning'`. + * @since v0.11.2 + */ + static defaultMaxListeners: number; + } + import internal = require('node:events'); + namespace EventEmitter { + // Should just be `export { EventEmitter }`, but that doesn't work in TypeScript 3.4 + export { internal as EventEmitter }; + export interface Abortable { + /** + * When provided the corresponding `AbortController` can be used to cancel an asynchronous action. + */ + signal?: AbortSignal | undefined; + } + } + global { + namespace NodeJS { + interface EventEmitter { + /** + * Alias for `emitter.on(eventName, listener)`. + * @since v0.1.26 + */ + addListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + /** + * Adds the `listener` function to the end of the listeners array for the + * event named `eventName`. No checks are made to see if the `listener` has + * already been added. Multiple calls passing the same combination of `eventName`and `listener` will result in the `listener` being added, and called, multiple + * times. + * + * ```js + * server.on('connection', (stream) => { + * console.log('someone connected!'); + * }); + * ``` + * + * Returns a reference to the `EventEmitter`, so that calls can be chained. + * + * By default, event listeners are invoked in the order they are added. The`emitter.prependListener()` method can be used as an alternative to add the + * event listener to the beginning of the listeners array. + * + * ```js + * import { EventEmitter } from 'node:events'; + * const myEE = new EventEmitter(); + * myEE.on('foo', () => console.log('a')); + * myEE.prependListener('foo', () => console.log('b')); + * myEE.emit('foo'); + * // Prints: + * // b + * // a + * ``` + * @since v0.1.101 + * @param eventName The name of the event. + * @param listener The callback function + */ + on(eventName: string | symbol, listener: (...args: any[]) => void): this; + /** + * Adds a **one-time**`listener` function for the event named `eventName`. The + * next time `eventName` is triggered, this listener is removed and then invoked. + * + * ```js + * server.once('connection', (stream) => { + * console.log('Ah, we have our first user!'); + * }); + * ``` + * + * Returns a reference to the `EventEmitter`, so that calls can be chained. + * + * By default, event listeners are invoked in the order they are added. The`emitter.prependOnceListener()` method can be used as an alternative to add the + * event listener to the beginning of the listeners array. + * + * ```js + * import { EventEmitter } from 'node:events'; + * const myEE = new EventEmitter(); + * myEE.once('foo', () => console.log('a')); + * myEE.prependOnceListener('foo', () => console.log('b')); + * myEE.emit('foo'); + * // Prints: + * // b + * // a + * ``` + * @since v0.3.0 + * @param eventName The name of the event. + * @param listener The callback function + */ + once(eventName: string | symbol, listener: (...args: any[]) => void): this; + /** + * Removes the specified `listener` from the listener array for the event named`eventName`. + * + * ```js + * const callback = (stream) => { + * console.log('someone connected!'); + * }; + * server.on('connection', callback); + * // ... + * server.removeListener('connection', callback); + * ``` + * + * `removeListener()` will remove, at most, one instance of a listener from the + * listener array. If any single listener has been added multiple times to the + * listener array for the specified `eventName`, then `removeListener()` must be + * called multiple times to remove each instance. + * + * Once an event is emitted, all listeners attached to it at the + * time of emitting are called in order. This implies that any`removeListener()` or `removeAllListeners()` calls _after_ emitting and _before_ the last listener finishes execution + * will not remove them from`emit()` in progress. Subsequent events behave as expected. + * + * ```js + * import { EventEmitter } from 'node:events'; + * class MyEmitter extends EventEmitter {} + * const myEmitter = new MyEmitter(); + * + * const callbackA = () => { + * console.log('A'); + * myEmitter.removeListener('event', callbackB); + * }; + * + * const callbackB = () => { + * console.log('B'); + * }; + * + * myEmitter.on('event', callbackA); + * + * myEmitter.on('event', callbackB); + * + * // callbackA removes listener callbackB but it will still be called. + * // Internal listener array at time of emit [callbackA, callbackB] + * myEmitter.emit('event'); + * // Prints: + * // A + * // B + * + * // callbackB is now removed. + * // Internal listener array [callbackA] + * myEmitter.emit('event'); + * // Prints: + * // A + * ``` + * + * Because listeners are managed using an internal array, calling this will + * change the position indices of any listener registered _after_ the listener + * being removed. This will not impact the order in which listeners are called, + * but it means that any copies of the listener array as returned by + * the `emitter.listeners()` method will need to be recreated. + * + * When a single function has been added as a handler multiple times for a single + * event (as in the example below), `removeListener()` will remove the most + * recently added instance. In the example the `once('ping')`listener is removed: + * + * ```js + * import { EventEmitter } from 'node:events'; + * const ee = new EventEmitter(); + * + * function pong() { + * console.log('pong'); + * } + * + * ee.on('ping', pong); + * ee.once('ping', pong); + * ee.removeListener('ping', pong); + * + * ee.emit('ping'); + * ee.emit('ping'); + * ``` + * + * Returns a reference to the `EventEmitter`, so that calls can be chained. + * @since v0.1.26 + */ + removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + /** + * Alias for `emitter.removeListener()`. + * @since v10.0.0 + */ + off(eventName: string | symbol, listener: (...args: any[]) => void): this; + /** + * Removes all listeners, or those of the specified `eventName`. + * + * It is bad practice to remove listeners added elsewhere in the code, + * particularly when the `EventEmitter` instance was created by some other + * component or module (e.g. sockets or file streams). + * + * Returns a reference to the `EventEmitter`, so that calls can be chained. + * @since v0.1.26 + */ + removeAllListeners(event?: string | symbol): this; + /** + * By default `EventEmitter`s will print a warning if more than `10` listeners are + * added for a particular event. This is a useful default that helps finding + * memory leaks. The `emitter.setMaxListeners()` method allows the limit to be + * modified for this specific `EventEmitter` instance. The value can be set to`Infinity` (or `0`) to indicate an unlimited number of listeners. + * + * Returns a reference to the `EventEmitter`, so that calls can be chained. + * @since v0.3.5 + */ + setMaxListeners(n: number): this; + /** + * Returns the current max listener value for the `EventEmitter` which is either + * set by `emitter.setMaxListeners(n)` or defaults to {@link defaultMaxListeners}. + * @since v1.0.0 + */ + getMaxListeners(): number; + /** + * Returns a copy of the array of listeners for the event named `eventName`. + * + * ```js + * server.on('connection', (stream) => { + * console.log('someone connected!'); + * }); + * console.log(util.inspect(server.listeners('connection'))); + * // Prints: [ [Function] ] + * ``` + * @since v0.1.26 + */ + listeners(eventName: string | symbol): Function[]; + /** + * Returns a copy of the array of listeners for the event named `eventName`, + * including any wrappers (such as those created by `.once()`). + * + * ```js + * import { EventEmitter } from 'node:events'; + * const emitter = new EventEmitter(); + * emitter.once('log', () => console.log('log once')); + * + * // Returns a new Array with a function `onceWrapper` which has a property + * // `listener` which contains the original listener bound above + * const listeners = emitter.rawListeners('log'); + * const logFnWrapper = listeners[0]; + * + * // Logs "log once" to the console and does not unbind the `once` event + * logFnWrapper.listener(); + * + * // Logs "log once" to the console and removes the listener + * logFnWrapper(); + * + * emitter.on('log', () => console.log('log persistently')); + * // Will return a new Array with a single function bound by `.on()` above + * const newListeners = emitter.rawListeners('log'); + * + * // Logs "log persistently" twice + * newListeners[0](); + * emitter.emit('log'); + * ``` + * @since v9.4.0 + */ + rawListeners(eventName: string | symbol): Function[]; + /** + * Synchronously calls each of the listeners registered for the event named`eventName`, in the order they were registered, passing the supplied arguments + * to each. + * + * Returns `true` if the event had listeners, `false` otherwise. + * + * ```js + * import { EventEmitter } from 'node:events'; + * const myEmitter = new EventEmitter(); + * + * // First listener + * myEmitter.on('event', function firstListener() { + * console.log('Helloooo! first listener'); + * }); + * // Second listener + * myEmitter.on('event', function secondListener(arg1, arg2) { + * console.log(`event with parameters ${arg1}, ${arg2} in second listener`); + * }); + * // Third listener + * myEmitter.on('event', function thirdListener(...args) { + * const parameters = args.join(', '); + * console.log(`event with parameters ${parameters} in third listener`); + * }); + * + * console.log(myEmitter.listeners('event')); + * + * myEmitter.emit('event', 1, 2, 3, 4, 5); + * + * // Prints: + * // [ + * // [Function: firstListener], + * // [Function: secondListener], + * // [Function: thirdListener] + * // ] + * // Helloooo! first listener + * // event with parameters 1, 2 in second listener + * // event with parameters 1, 2, 3, 4, 5 in third listener + * ``` + * @since v0.1.26 + */ + emit(eventName: string | symbol, ...args: any[]): boolean; + /** + * Returns the number of listeners listening for the event named `eventName`. + * If `listener` is provided, it will return how many times the listener is found + * in the list of the listeners of the event. + * @since v3.2.0 + * @param eventName The name of the event being listened for + * @param listener The event handler function + */ + listenerCount(eventName: string | symbol, listener?: Function): number; + /** + * Adds the `listener` function to the _beginning_ of the listeners array for the + * event named `eventName`. No checks are made to see if the `listener` has + * already been added. Multiple calls passing the same combination of `eventName`and `listener` will result in the `listener` being added, and called, multiple + * times. + * + * ```js + * server.prependListener('connection', (stream) => { + * console.log('someone connected!'); + * }); + * ``` + * + * Returns a reference to the `EventEmitter`, so that calls can be chained. + * @since v6.0.0 + * @param eventName The name of the event. + * @param listener The callback function + */ + prependListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + /** + * Adds a **one-time**`listener` function for the event named `eventName` to the _beginning_ of the listeners array. The next time `eventName` is triggered, this + * listener is removed, and then invoked. + * + * ```js + * server.prependOnceListener('connection', (stream) => { + * console.log('Ah, we have our first user!'); + * }); + * ``` + * + * Returns a reference to the `EventEmitter`, so that calls can be chained. + * @since v6.0.0 + * @param eventName The name of the event. + * @param listener The callback function + */ + prependOnceListener(eventName: string | symbol, listener: (...args: any[]) => void): this; + /** + * Returns an array listing the events for which the emitter has registered + * listeners. The values in the array are strings or `Symbol`s. + * + * ```js + * import { EventEmitter } from 'node:events'; + * + * const myEE = new EventEmitter(); + * myEE.on('foo', () => {}); + * myEE.on('bar', () => {}); + * + * const sym = Symbol('symbol'); + * myEE.on(sym, () => {}); + * + * console.log(myEE.eventNames()); + * // Prints: [ 'foo', 'bar', Symbol(symbol) ] + * ``` + * @since v6.0.0 + */ + eventNames(): Array; + } + } + } + export = EventEmitter; +} +declare module 'events' { + import events = require('node:events'); + export = events; +} diff --git a/node_modules/@types/node/ts4.8/fs.d.ts b/node_modules/@types/node/ts4.8/fs.d.ts new file mode 100644 index 0000000..4595874 --- /dev/null +++ b/node_modules/@types/node/ts4.8/fs.d.ts @@ -0,0 +1,4087 @@ +/** + * The `node:fs` module enables interacting with the file system in a + * way modeled on standard POSIX functions. + * + * To use the promise-based APIs: + * + * ```js + * import * as fs from 'node:fs/promises'; + * ``` + * + * To use the callback and sync APIs: + * + * ```js + * import * as fs from 'node:fs'; + * ``` + * + * All file system operations have synchronous, callback, and promise-based + * forms, and are accessible using both CommonJS syntax and ES6 Modules (ESM). + * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/fs.js) + */ +declare module 'node:fs' { + import * as stream from 'node:stream'; + import { Abortable, EventEmitter } from 'node:events'; + import { URL } from 'node:url'; + import * as promises from 'node:fs/promises'; + export { promises }; + /** + * Valid types for path values in "fs". + */ + export type PathLike = string | Buffer | URL; + export type PathOrFileDescriptor = PathLike | number; + export type TimeLike = string | number | Date; + export type NoParamCallback = (err: NodeJS.ErrnoException | null) => void; + export type BufferEncodingOption = + | 'buffer' + | { + encoding: 'buffer'; + }; + export interface ObjectEncodingOptions { + encoding?: BufferEncoding | null | undefined; + } + export type EncodingOption = ObjectEncodingOptions | BufferEncoding | undefined | null; + export type OpenMode = number | string; + export type Mode = number | string; + export interface StatsBase { + isFile(): boolean; + isDirectory(): boolean; + isBlockDevice(): boolean; + isCharacterDevice(): boolean; + isSymbolicLink(): boolean; + isFIFO(): boolean; + isSocket(): boolean; + dev: T; + ino: T; + mode: T; + nlink: T; + uid: T; + gid: T; + rdev: T; + size: T; + blksize: T; + blocks: T; + atimeMs: T; + mtimeMs: T; + ctimeMs: T; + birthtimeMs: T; + atime: Date; + mtime: Date; + ctime: Date; + birthtime: Date; + } + export interface Stats extends StatsBase {} + /** + * A `fs.Stats` object provides information about a file. + * + * Objects returned from {@link stat}, {@link lstat}, {@link fstat}, and + * their synchronous counterparts are of this type. + * If `bigint` in the `options` passed to those methods is true, the numeric values + * will be `bigint` instead of `number`, and the object will contain additional + * nanosecond-precision properties suffixed with `Ns`. + * + * ```console + * Stats { + * dev: 2114, + * ino: 48064969, + * mode: 33188, + * nlink: 1, + * uid: 85, + * gid: 100, + * rdev: 0, + * size: 527, + * blksize: 4096, + * blocks: 8, + * atimeMs: 1318289051000.1, + * mtimeMs: 1318289051000.1, + * ctimeMs: 1318289051000.1, + * birthtimeMs: 1318289051000.1, + * atime: Mon, 10 Oct 2011 23:24:11 GMT, + * mtime: Mon, 10 Oct 2011 23:24:11 GMT, + * ctime: Mon, 10 Oct 2011 23:24:11 GMT, + * birthtime: Mon, 10 Oct 2011 23:24:11 GMT } + * ``` + * + * `bigint` version: + * + * ```console + * BigIntStats { + * dev: 2114n, + * ino: 48064969n, + * mode: 33188n, + * nlink: 1n, + * uid: 85n, + * gid: 100n, + * rdev: 0n, + * size: 527n, + * blksize: 4096n, + * blocks: 8n, + * atimeMs: 1318289051000n, + * mtimeMs: 1318289051000n, + * ctimeMs: 1318289051000n, + * birthtimeMs: 1318289051000n, + * atimeNs: 1318289051000000000n, + * mtimeNs: 1318289051000000000n, + * ctimeNs: 1318289051000000000n, + * birthtimeNs: 1318289051000000000n, + * atime: Mon, 10 Oct 2011 23:24:11 GMT, + * mtime: Mon, 10 Oct 2011 23:24:11 GMT, + * ctime: Mon, 10 Oct 2011 23:24:11 GMT, + * birthtime: Mon, 10 Oct 2011 23:24:11 GMT } + * ``` + * @since v0.1.21 + */ + export class Stats {} + export interface StatsFsBase { + /** Type of file system. */ + type: T; + /** Optimal transfer block size. */ + bsize: T; + /** Total data blocks in file system. */ + blocks: T; + /** Free blocks in file system. */ + bfree: T; + /** Available blocks for unprivileged users */ + bavail: T; + /** Total file nodes in file system. */ + files: T; + /** Free file nodes in file system. */ + ffree: T; + } + export interface StatsFs extends StatsFsBase {} + /** + * Provides information about a mounted file system. + * + * Objects returned from {@link statfs} and its synchronous counterpart are of + * this type. If `bigint` in the `options` passed to those methods is `true`, the + * numeric values will be `bigint` instead of `number`. + * + * ```console + * StatFs { + * type: 1397114950, + * bsize: 4096, + * blocks: 121938943, + * bfree: 61058895, + * bavail: 61058895, + * files: 999, + * ffree: 1000000 + * } + * ``` + * + * `bigint` version: + * + * ```console + * StatFs { + * type: 1397114950n, + * bsize: 4096n, + * blocks: 121938943n, + * bfree: 61058895n, + * bavail: 61058895n, + * files: 999n, + * ffree: 1000000n + * } + * ``` + * @since v19.6.0, v18.15.0 + */ + export class StatsFs {} + export interface BigIntStatsFs extends StatsFsBase {} + export interface StatFsOptions { + bigint?: boolean | undefined; + } + /** + * A representation of a directory entry, which can be a file or a subdirectory + * within the directory, as returned by reading from an `fs.Dir`. The + * directory entry is a combination of the file name and file type pairs. + * + * Additionally, when {@link readdir} or {@link readdirSync} is called with + * the `withFileTypes` option set to `true`, the resulting array is filled with `fs.Dirent` objects, rather than strings or `Buffer` s. + * @since v10.10.0 + */ + export class Dirent { + /** + * Returns `true` if the `fs.Dirent` object describes a regular file. + * @since v10.10.0 + */ + isFile(): boolean; + /** + * Returns `true` if the `fs.Dirent` object describes a file system + * directory. + * @since v10.10.0 + */ + isDirectory(): boolean; + /** + * Returns `true` if the `fs.Dirent` object describes a block device. + * @since v10.10.0 + */ + isBlockDevice(): boolean; + /** + * Returns `true` if the `fs.Dirent` object describes a character device. + * @since v10.10.0 + */ + isCharacterDevice(): boolean; + /** + * Returns `true` if the `fs.Dirent` object describes a symbolic link. + * @since v10.10.0 + */ + isSymbolicLink(): boolean; + /** + * Returns `true` if the `fs.Dirent` object describes a first-in-first-out + * (FIFO) pipe. + * @since v10.10.0 + */ + isFIFO(): boolean; + /** + * Returns `true` if the `fs.Dirent` object describes a socket. + * @since v10.10.0 + */ + isSocket(): boolean; + /** + * The file name that this `fs.Dirent` object refers to. The type of this + * value is determined by the `options.encoding` passed to {@link readdir} or {@link readdirSync}. + * @since v10.10.0 + */ + name: string; + /** + * The base path that this `fs.Dirent` object refers to. + * @since v20.1.0 + */ + path: string; + } + /** + * A class representing a directory stream. + * + * Created by {@link opendir}, {@link opendirSync}, or `fsPromises.opendir()`. + * + * ```js + * import { opendir } from 'node:fs/promises'; + * + * try { + * const dir = await opendir('./'); + * for await (const dirent of dir) + * console.log(dirent.name); + * } catch (err) { + * console.error(err); + * } + * ``` + * + * When using the async iterator, the `fs.Dir` object will be automatically + * closed after the iterator exits. + * @since v12.12.0 + */ + export class Dir implements AsyncIterable { + /** + * The read-only path of this directory as was provided to {@link opendir},{@link opendirSync}, or `fsPromises.opendir()`. + * @since v12.12.0 + */ + readonly path: string; + /** + * Asynchronously iterates over the directory via `readdir(3)` until all entries have been read. + */ + [Symbol.asyncIterator](): AsyncIterableIterator; + /** + * Asynchronously close the directory's underlying resource handle. + * Subsequent reads will result in errors. + * + * A promise is returned that will be resolved after the resource has been + * closed. + * @since v12.12.0 + */ + close(): Promise; + close(cb: NoParamCallback): void; + /** + * Synchronously close the directory's underlying resource handle. + * Subsequent reads will result in errors. + * @since v12.12.0 + */ + closeSync(): void; + /** + * Asynchronously read the next directory entry via [`readdir(3)`](http://man7.org/linux/man-pages/man3/readdir.3.html) as an `fs.Dirent`. + * + * A promise is returned that will be resolved with an `fs.Dirent`, or `null`if there are no more directory entries to read. + * + * Directory entries returned by this function are in no particular order as + * provided by the operating system's underlying directory mechanisms. + * Entries added or removed while iterating over the directory might not be + * included in the iteration results. + * @since v12.12.0 + * @return containing {fs.Dirent|null} + */ + read(): Promise; + read(cb: (err: NodeJS.ErrnoException | null, dirEnt: Dirent | null) => void): void; + /** + * Synchronously read the next directory entry as an `fs.Dirent`. See the + * POSIX [`readdir(3)`](http://man7.org/linux/man-pages/man3/readdir.3.html) documentation for more detail. + * + * If there are no more directory entries to read, `null` will be returned. + * + * Directory entries returned by this function are in no particular order as + * provided by the operating system's underlying directory mechanisms. + * Entries added or removed while iterating over the directory might not be + * included in the iteration results. + * @since v12.12.0 + */ + readSync(): Dirent | null; + } + /** + * Class: fs.StatWatcher + * @since v14.3.0, v12.20.0 + * Extends `EventEmitter` + * A successful call to {@link watchFile} method will return a new fs.StatWatcher object. + */ + export interface StatWatcher extends EventEmitter { + /** + * When called, requests that the Node.js event loop _not_ exit so long as the `fs.StatWatcher` is active. Calling `watcher.ref()` multiple times will have + * no effect. + * + * By default, all `fs.StatWatcher` objects are "ref'ed", making it normally + * unnecessary to call `watcher.ref()` unless `watcher.unref()` had been + * called previously. + * @since v14.3.0, v12.20.0 + */ + ref(): this; + /** + * When called, the active `fs.StatWatcher` object will not require the Node.js + * event loop to remain active. If there is no other activity keeping the + * event loop running, the process may exit before the `fs.StatWatcher` object's + * callback is invoked. Calling `watcher.unref()` multiple times will have + * no effect. + * @since v14.3.0, v12.20.0 + */ + unref(): this; + } + export interface FSWatcher extends EventEmitter { + /** + * Stop watching for changes on the given `fs.FSWatcher`. Once stopped, the `fs.FSWatcher` object is no longer usable. + * @since v0.5.8 + */ + close(): void; + /** + * events.EventEmitter + * 1. change + * 2. error + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: 'change', listener: (eventType: string, filename: string | Buffer) => void): this; + addListener(event: 'error', listener: (error: Error) => void): this; + addListener(event: 'close', listener: () => void): this; + on(event: string, listener: (...args: any[]) => void): this; + on(event: 'change', listener: (eventType: string, filename: string | Buffer) => void): this; + on(event: 'error', listener: (error: Error) => void): this; + on(event: 'close', listener: () => void): this; + once(event: string, listener: (...args: any[]) => void): this; + once(event: 'change', listener: (eventType: string, filename: string | Buffer) => void): this; + once(event: 'error', listener: (error: Error) => void): this; + once(event: 'close', listener: () => void): this; + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: 'change', listener: (eventType: string, filename: string | Buffer) => void): this; + prependListener(event: 'error', listener: (error: Error) => void): this; + prependListener(event: 'close', listener: () => void): this; + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'change', listener: (eventType: string, filename: string | Buffer) => void): this; + prependOnceListener(event: 'error', listener: (error: Error) => void): this; + prependOnceListener(event: 'close', listener: () => void): this; + } + /** + * Instances of `fs.ReadStream` are created and returned using the {@link createReadStream} function. + * @since v0.1.93 + */ + export class ReadStream extends stream.Readable { + close(callback?: (err?: NodeJS.ErrnoException | null) => void): void; + /** + * The number of bytes that have been read so far. + * @since v6.4.0 + */ + bytesRead: number; + /** + * The path to the file the stream is reading from as specified in the first + * argument to `fs.createReadStream()`. If `path` is passed as a string, then`readStream.path` will be a string. If `path` is passed as a `Buffer`, then`readStream.path` will be a + * `Buffer`. If `fd` is specified, then`readStream.path` will be `undefined`. + * @since v0.1.93 + */ + path: string | Buffer; + /** + * This property is `true` if the underlying file has not been opened yet, + * i.e. before the `'ready'` event is emitted. + * @since v11.2.0, v10.16.0 + */ + pending: boolean; + /** + * events.EventEmitter + * 1. open + * 2. close + * 3. ready + */ + addListener(event: 'close', listener: () => void): this; + addListener(event: 'data', listener: (chunk: Buffer | string) => void): this; + addListener(event: 'end', listener: () => void): this; + addListener(event: 'error', listener: (err: Error) => void): this; + addListener(event: 'open', listener: (fd: number) => void): this; + addListener(event: 'pause', listener: () => void): this; + addListener(event: 'readable', listener: () => void): this; + addListener(event: 'ready', listener: () => void): this; + addListener(event: 'resume', listener: () => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + on(event: 'close', listener: () => void): this; + on(event: 'data', listener: (chunk: Buffer | string) => void): this; + on(event: 'end', listener: () => void): this; + on(event: 'error', listener: (err: Error) => void): this; + on(event: 'open', listener: (fd: number) => void): this; + on(event: 'pause', listener: () => void): this; + on(event: 'readable', listener: () => void): this; + on(event: 'ready', listener: () => void): this; + on(event: 'resume', listener: () => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + once(event: 'close', listener: () => void): this; + once(event: 'data', listener: (chunk: Buffer | string) => void): this; + once(event: 'end', listener: () => void): this; + once(event: 'error', listener: (err: Error) => void): this; + once(event: 'open', listener: (fd: number) => void): this; + once(event: 'pause', listener: () => void): this; + once(event: 'readable', listener: () => void): this; + once(event: 'ready', listener: () => void): this; + once(event: 'resume', listener: () => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + prependListener(event: 'close', listener: () => void): this; + prependListener(event: 'data', listener: (chunk: Buffer | string) => void): this; + prependListener(event: 'end', listener: () => void): this; + prependListener(event: 'error', listener: (err: Error) => void): this; + prependListener(event: 'open', listener: (fd: number) => void): this; + prependListener(event: 'pause', listener: () => void): this; + prependListener(event: 'readable', listener: () => void): this; + prependListener(event: 'ready', listener: () => void): this; + prependListener(event: 'resume', listener: () => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'close', listener: () => void): this; + prependOnceListener(event: 'data', listener: (chunk: Buffer | string) => void): this; + prependOnceListener(event: 'end', listener: () => void): this; + prependOnceListener(event: 'error', listener: (err: Error) => void): this; + prependOnceListener(event: 'open', listener: (fd: number) => void): this; + prependOnceListener(event: 'pause', listener: () => void): this; + prependOnceListener(event: 'readable', listener: () => void): this; + prependOnceListener(event: 'ready', listener: () => void): this; + prependOnceListener(event: 'resume', listener: () => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + } + /** + * * Extends `stream.Writable` + * + * Instances of `fs.WriteStream` are created and returned using the {@link createWriteStream} function. + * @since v0.1.93 + */ + export class WriteStream extends stream.Writable { + /** + * Closes `writeStream`. Optionally accepts a + * callback that will be executed once the `writeStream`is closed. + * @since v0.9.4 + */ + close(callback?: (err?: NodeJS.ErrnoException | null) => void): void; + /** + * The number of bytes written so far. Does not include data that is still queued + * for writing. + * @since v0.4.7 + */ + bytesWritten: number; + /** + * The path to the file the stream is writing to as specified in the first + * argument to {@link createWriteStream}. If `path` is passed as a string, then`writeStream.path` will be a string. If `path` is passed as a `Buffer`, then`writeStream.path` will be a + * `Buffer`. + * @since v0.1.93 + */ + path: string | Buffer; + /** + * This property is `true` if the underlying file has not been opened yet, + * i.e. before the `'ready'` event is emitted. + * @since v11.2.0 + */ + pending: boolean; + /** + * events.EventEmitter + * 1. open + * 2. close + * 3. ready + */ + addListener(event: 'close', listener: () => void): this; + addListener(event: 'drain', listener: () => void): this; + addListener(event: 'error', listener: (err: Error) => void): this; + addListener(event: 'finish', listener: () => void): this; + addListener(event: 'open', listener: (fd: number) => void): this; + addListener(event: 'pipe', listener: (src: stream.Readable) => void): this; + addListener(event: 'ready', listener: () => void): this; + addListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + on(event: 'close', listener: () => void): this; + on(event: 'drain', listener: () => void): this; + on(event: 'error', listener: (err: Error) => void): this; + on(event: 'finish', listener: () => void): this; + on(event: 'open', listener: (fd: number) => void): this; + on(event: 'pipe', listener: (src: stream.Readable) => void): this; + on(event: 'ready', listener: () => void): this; + on(event: 'unpipe', listener: (src: stream.Readable) => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + once(event: 'close', listener: () => void): this; + once(event: 'drain', listener: () => void): this; + once(event: 'error', listener: (err: Error) => void): this; + once(event: 'finish', listener: () => void): this; + once(event: 'open', listener: (fd: number) => void): this; + once(event: 'pipe', listener: (src: stream.Readable) => void): this; + once(event: 'ready', listener: () => void): this; + once(event: 'unpipe', listener: (src: stream.Readable) => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + prependListener(event: 'close', listener: () => void): this; + prependListener(event: 'drain', listener: () => void): this; + prependListener(event: 'error', listener: (err: Error) => void): this; + prependListener(event: 'finish', listener: () => void): this; + prependListener(event: 'open', listener: (fd: number) => void): this; + prependListener(event: 'pipe', listener: (src: stream.Readable) => void): this; + prependListener(event: 'ready', listener: () => void): this; + prependListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'close', listener: () => void): this; + prependOnceListener(event: 'drain', listener: () => void): this; + prependOnceListener(event: 'error', listener: (err: Error) => void): this; + prependOnceListener(event: 'finish', listener: () => void): this; + prependOnceListener(event: 'open', listener: (fd: number) => void): this; + prependOnceListener(event: 'pipe', listener: (src: stream.Readable) => void): this; + prependOnceListener(event: 'ready', listener: () => void): this; + prependOnceListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + } + /** + * Asynchronously rename file at `oldPath` to the pathname provided + * as `newPath`. In the case that `newPath` already exists, it will + * be overwritten. If there is a directory at `newPath`, an error will + * be raised instead. No arguments other than a possible exception are + * given to the completion callback. + * + * See also: [`rename(2)`](http://man7.org/linux/man-pages/man2/rename.2.html). + * + * ```js + * import { rename } from 'node:fs'; + * + * rename('oldFile.txt', 'newFile.txt', (err) => { + * if (err) throw err; + * console.log('Rename complete!'); + * }); + * ``` + * @since v0.0.2 + */ + export function rename(oldPath: PathLike, newPath: PathLike, callback: NoParamCallback): void; + export namespace rename { + /** + * Asynchronous rename(2) - Change the name or location of a file or directory. + * @param oldPath A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + function __promisify__(oldPath: PathLike, newPath: PathLike): Promise; + } + /** + * Renames the file from `oldPath` to `newPath`. Returns `undefined`. + * + * See the POSIX [`rename(2)`](http://man7.org/linux/man-pages/man2/rename.2.html) documentation for more details. + * @since v0.1.21 + */ + export function renameSync(oldPath: PathLike, newPath: PathLike): void; + /** + * Truncates the file. No arguments other than a possible exception are + * given to the completion callback. A file descriptor can also be passed as the + * first argument. In this case, `fs.ftruncate()` is called. + * + * ```js + * import { truncate } from 'node:fs'; + * // Assuming that 'path/file.txt' is a regular file. + * truncate('path/file.txt', (err) => { + * if (err) throw err; + * console.log('path/file.txt was truncated'); + * }); + * ``` + * + * Passing a file descriptor is deprecated and may result in an error being thrown + * in the future. + * + * See the POSIX [`truncate(2)`](http://man7.org/linux/man-pages/man2/truncate.2.html) documentation for more details. + * @since v0.8.6 + * @param [len=0] + */ + export function truncate(path: PathLike, len: number | undefined | null, callback: NoParamCallback): void; + /** + * Asynchronous truncate(2) - Truncate a file to a specified length. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function truncate(path: PathLike, callback: NoParamCallback): void; + export namespace truncate { + /** + * Asynchronous truncate(2) - Truncate a file to a specified length. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param len If not specified, defaults to `0`. + */ + function __promisify__(path: PathLike, len?: number | null): Promise; + } + /** + * Truncates the file. Returns `undefined`. A file descriptor can also be + * passed as the first argument. In this case, `fs.ftruncateSync()` is called. + * + * Passing a file descriptor is deprecated and may result in an error being thrown + * in the future. + * @since v0.8.6 + * @param [len=0] + */ + export function truncateSync(path: PathLike, len?: number | null): void; + /** + * Truncates the file descriptor. No arguments other than a possible exception are + * given to the completion callback. + * + * See the POSIX [`ftruncate(2)`](http://man7.org/linux/man-pages/man2/ftruncate.2.html) documentation for more detail. + * + * If the file referred to by the file descriptor was larger than `len` bytes, only + * the first `len` bytes will be retained in the file. + * + * For example, the following program retains only the first four bytes of the + * file: + * + * ```js + * import { open, close, ftruncate } from 'node:fs'; + * + * function closeFd(fd) { + * close(fd, (err) => { + * if (err) throw err; + * }); + * } + * + * open('temp.txt', 'r+', (err, fd) => { + * if (err) throw err; + * + * try { + * ftruncate(fd, 4, (err) => { + * closeFd(fd); + * if (err) throw err; + * }); + * } catch (err) { + * closeFd(fd); + * if (err) throw err; + * } + * }); + * ``` + * + * If the file previously was shorter than `len` bytes, it is extended, and the + * extended part is filled with null bytes (`'\0'`): + * + * If `len` is negative then `0` will be used. + * @since v0.8.6 + * @param [len=0] + */ + export function ftruncate(fd: number, len: number | undefined | null, callback: NoParamCallback): void; + /** + * Asynchronous ftruncate(2) - Truncate a file to a specified length. + * @param fd A file descriptor. + */ + export function ftruncate(fd: number, callback: NoParamCallback): void; + export namespace ftruncate { + /** + * Asynchronous ftruncate(2) - Truncate a file to a specified length. + * @param fd A file descriptor. + * @param len If not specified, defaults to `0`. + */ + function __promisify__(fd: number, len?: number | null): Promise; + } + /** + * Truncates the file descriptor. Returns `undefined`. + * + * For detailed information, see the documentation of the asynchronous version of + * this API: {@link ftruncate}. + * @since v0.8.6 + * @param [len=0] + */ + export function ftruncateSync(fd: number, len?: number | null): void; + /** + * Asynchronously changes owner and group of a file. No arguments other than a + * possible exception are given to the completion callback. + * + * See the POSIX [`chown(2)`](http://man7.org/linux/man-pages/man2/chown.2.html) documentation for more detail. + * @since v0.1.97 + */ + export function chown(path: PathLike, uid: number, gid: number, callback: NoParamCallback): void; + export namespace chown { + /** + * Asynchronous chown(2) - Change ownership of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function __promisify__(path: PathLike, uid: number, gid: number): Promise; + } + /** + * Synchronously changes owner and group of a file. Returns `undefined`. + * This is the synchronous version of {@link chown}. + * + * See the POSIX [`chown(2)`](http://man7.org/linux/man-pages/man2/chown.2.html) documentation for more detail. + * @since v0.1.97 + */ + export function chownSync(path: PathLike, uid: number, gid: number): void; + /** + * Sets the owner of the file. No arguments other than a possible exception are + * given to the completion callback. + * + * See the POSIX [`fchown(2)`](http://man7.org/linux/man-pages/man2/fchown.2.html) documentation for more detail. + * @since v0.4.7 + */ + export function fchown(fd: number, uid: number, gid: number, callback: NoParamCallback): void; + export namespace fchown { + /** + * Asynchronous fchown(2) - Change ownership of a file. + * @param fd A file descriptor. + */ + function __promisify__(fd: number, uid: number, gid: number): Promise; + } + /** + * Sets the owner of the file. Returns `undefined`. + * + * See the POSIX [`fchown(2)`](http://man7.org/linux/man-pages/man2/fchown.2.html) documentation for more detail. + * @since v0.4.7 + * @param uid The file's new owner's user id. + * @param gid The file's new group's group id. + */ + export function fchownSync(fd: number, uid: number, gid: number): void; + /** + * Set the owner of the symbolic link. No arguments other than a possible + * exception are given to the completion callback. + * + * See the POSIX [`lchown(2)`](http://man7.org/linux/man-pages/man2/lchown.2.html) documentation for more detail. + */ + export function lchown(path: PathLike, uid: number, gid: number, callback: NoParamCallback): void; + export namespace lchown { + /** + * Asynchronous lchown(2) - Change ownership of a file. Does not dereference symbolic links. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function __promisify__(path: PathLike, uid: number, gid: number): Promise; + } + /** + * Set the owner for the path. Returns `undefined`. + * + * See the POSIX [`lchown(2)`](http://man7.org/linux/man-pages/man2/lchown.2.html) documentation for more details. + * @param uid The file's new owner's user id. + * @param gid The file's new group's group id. + */ + export function lchownSync(path: PathLike, uid: number, gid: number): void; + /** + * Changes the access and modification times of a file in the same way as {@link utimes}, with the difference that if the path refers to a symbolic + * link, then the link is not dereferenced: instead, the timestamps of the + * symbolic link itself are changed. + * + * No arguments other than a possible exception are given to the completion + * callback. + * @since v14.5.0, v12.19.0 + */ + export function lutimes(path: PathLike, atime: TimeLike, mtime: TimeLike, callback: NoParamCallback): void; + export namespace lutimes { + /** + * Changes the access and modification times of a file in the same way as `fsPromises.utimes()`, + * with the difference that if the path refers to a symbolic link, then the link is not + * dereferenced: instead, the timestamps of the symbolic link itself are changed. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param atime The last access time. If a string is provided, it will be coerced to number. + * @param mtime The last modified time. If a string is provided, it will be coerced to number. + */ + function __promisify__(path: PathLike, atime: TimeLike, mtime: TimeLike): Promise; + } + /** + * Change the file system timestamps of the symbolic link referenced by `path`. + * Returns `undefined`, or throws an exception when parameters are incorrect or + * the operation fails. This is the synchronous version of {@link lutimes}. + * @since v14.5.0, v12.19.0 + */ + export function lutimesSync(path: PathLike, atime: TimeLike, mtime: TimeLike): void; + /** + * Asynchronously changes the permissions of a file. No arguments other than a + * possible exception are given to the completion callback. + * + * See the POSIX [`chmod(2)`](http://man7.org/linux/man-pages/man2/chmod.2.html) documentation for more detail. + * + * ```js + * import { chmod } from 'node:fs'; + * + * chmod('my_file.txt', 0o775, (err) => { + * if (err) throw err; + * console.log('The permissions for file "my_file.txt" have been changed!'); + * }); + * ``` + * @since v0.1.30 + */ + export function chmod(path: PathLike, mode: Mode, callback: NoParamCallback): void; + export namespace chmod { + /** + * Asynchronous chmod(2) - Change permissions of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. + */ + function __promisify__(path: PathLike, mode: Mode): Promise; + } + /** + * For detailed information, see the documentation of the asynchronous version of + * this API: {@link chmod}. + * + * See the POSIX [`chmod(2)`](http://man7.org/linux/man-pages/man2/chmod.2.html) documentation for more detail. + * @since v0.6.7 + */ + export function chmodSync(path: PathLike, mode: Mode): void; + /** + * Sets the permissions on the file. No arguments other than a possible exception + * are given to the completion callback. + * + * See the POSIX [`fchmod(2)`](http://man7.org/linux/man-pages/man2/fchmod.2.html) documentation for more detail. + * @since v0.4.7 + */ + export function fchmod(fd: number, mode: Mode, callback: NoParamCallback): void; + export namespace fchmod { + /** + * Asynchronous fchmod(2) - Change permissions of a file. + * @param fd A file descriptor. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. + */ + function __promisify__(fd: number, mode: Mode): Promise; + } + /** + * Sets the permissions on the file. Returns `undefined`. + * + * See the POSIX [`fchmod(2)`](http://man7.org/linux/man-pages/man2/fchmod.2.html) documentation for more detail. + * @since v0.4.7 + */ + export function fchmodSync(fd: number, mode: Mode): void; + /** + * Changes the permissions on a symbolic link. No arguments other than a possible + * exception are given to the completion callback. + * + * This method is only implemented on macOS. + * + * See the POSIX [`lchmod(2)`](https://www.freebsd.org/cgi/man.cgi?query=lchmod&sektion=2) documentation for more detail. + * @deprecated Since v0.4.7 + */ + export function lchmod(path: PathLike, mode: Mode, callback: NoParamCallback): void; + /** @deprecated */ + export namespace lchmod { + /** + * Asynchronous lchmod(2) - Change permissions of a file. Does not dereference symbolic links. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. + */ + function __promisify__(path: PathLike, mode: Mode): Promise; + } + /** + * Changes the permissions on a symbolic link. Returns `undefined`. + * + * This method is only implemented on macOS. + * + * See the POSIX [`lchmod(2)`](https://www.freebsd.org/cgi/man.cgi?query=lchmod&sektion=2) documentation for more detail. + * @deprecated Since v0.4.7 + */ + export function lchmodSync(path: PathLike, mode: Mode): void; + /** + * Asynchronous [`stat(2)`](http://man7.org/linux/man-pages/man2/stat.2.html). The callback gets two arguments `(err, stats)` where`stats` is an `fs.Stats` object. + * + * In case of an error, the `err.code` will be one of `Common System Errors`. + * + * {@link stat} follows symbolic links. Use {@link lstat} to look at the + * links themselves. + * + * Using `fs.stat()` to check for the existence of a file before calling`fs.open()`, `fs.readFile()`, or `fs.writeFile()` is not recommended. + * Instead, user code should open/read/write the file directly and handle the + * error raised if the file is not available. + * + * To check if a file exists without manipulating it afterwards, {@link access} is recommended. + * + * For example, given the following directory structure: + * + * ```text + * - txtDir + * -- file.txt + * - app.js + * ``` + * + * The next program will check for the stats of the given paths: + * + * ```js + * import { stat } from 'node:fs'; + * + * const pathsToCheck = ['./txtDir', './txtDir/file.txt']; + * + * for (let i = 0; i < pathsToCheck.length; i++) { + * stat(pathsToCheck[i], (err, stats) => { + * console.log(stats.isDirectory()); + * console.log(stats); + * }); + * } + * ``` + * + * The resulting output will resemble: + * + * ```console + * true + * Stats { + * dev: 16777220, + * mode: 16877, + * nlink: 3, + * uid: 501, + * gid: 20, + * rdev: 0, + * blksize: 4096, + * ino: 14214262, + * size: 96, + * blocks: 0, + * atimeMs: 1561174653071.963, + * mtimeMs: 1561174614583.3518, + * ctimeMs: 1561174626623.5366, + * birthtimeMs: 1561174126937.2893, + * atime: 2019-06-22T03:37:33.072Z, + * mtime: 2019-06-22T03:36:54.583Z, + * ctime: 2019-06-22T03:37:06.624Z, + * birthtime: 2019-06-22T03:28:46.937Z + * } + * false + * Stats { + * dev: 16777220, + * mode: 33188, + * nlink: 1, + * uid: 501, + * gid: 20, + * rdev: 0, + * blksize: 4096, + * ino: 14214074, + * size: 8, + * blocks: 8, + * atimeMs: 1561174616618.8555, + * mtimeMs: 1561174614584, + * ctimeMs: 1561174614583.8145, + * birthtimeMs: 1561174007710.7478, + * atime: 2019-06-22T03:36:56.619Z, + * mtime: 2019-06-22T03:36:54.584Z, + * ctime: 2019-06-22T03:36:54.584Z, + * birthtime: 2019-06-22T03:26:47.711Z + * } + * ``` + * @since v0.0.2 + */ + export function stat(path: PathLike, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void; + export function stat( + path: PathLike, + options: + | (StatOptions & { + bigint?: false | undefined; + }) + | undefined, + callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void + ): void; + export function stat( + path: PathLike, + options: StatOptions & { + bigint: true; + }, + callback: (err: NodeJS.ErrnoException | null, stats: BigIntStats) => void + ): void; + export function stat(path: PathLike, options: StatOptions | undefined, callback: (err: NodeJS.ErrnoException | null, stats: Stats | BigIntStats) => void): void; + export namespace stat { + /** + * Asynchronous stat(2) - Get file status. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function __promisify__( + path: PathLike, + options?: StatOptions & { + bigint?: false | undefined; + } + ): Promise; + function __promisify__( + path: PathLike, + options: StatOptions & { + bigint: true; + } + ): Promise; + function __promisify__(path: PathLike, options?: StatOptions): Promise; + } + export interface StatSyncFn extends Function { + (path: PathLike, options?: undefined): Stats; + ( + path: PathLike, + options?: StatSyncOptions & { + bigint?: false | undefined; + throwIfNoEntry: false; + } + ): Stats | undefined; + ( + path: PathLike, + options: StatSyncOptions & { + bigint: true; + throwIfNoEntry: false; + } + ): BigIntStats | undefined; + ( + path: PathLike, + options?: StatSyncOptions & { + bigint?: false | undefined; + } + ): Stats; + ( + path: PathLike, + options: StatSyncOptions & { + bigint: true; + } + ): BigIntStats; + ( + path: PathLike, + options: StatSyncOptions & { + bigint: boolean; + throwIfNoEntry?: false | undefined; + } + ): Stats | BigIntStats; + (path: PathLike, options?: StatSyncOptions): Stats | BigIntStats | undefined; + } + /** + * Synchronous stat(2) - Get file status. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export const statSync: StatSyncFn; + /** + * Invokes the callback with the `fs.Stats` for the file descriptor. + * + * See the POSIX [`fstat(2)`](http://man7.org/linux/man-pages/man2/fstat.2.html) documentation for more detail. + * @since v0.1.95 + */ + export function fstat(fd: number, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void; + export function fstat( + fd: number, + options: + | (StatOptions & { + bigint?: false | undefined; + }) + | undefined, + callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void + ): void; + export function fstat( + fd: number, + options: StatOptions & { + bigint: true; + }, + callback: (err: NodeJS.ErrnoException | null, stats: BigIntStats) => void + ): void; + export function fstat(fd: number, options: StatOptions | undefined, callback: (err: NodeJS.ErrnoException | null, stats: Stats | BigIntStats) => void): void; + export namespace fstat { + /** + * Asynchronous fstat(2) - Get file status. + * @param fd A file descriptor. + */ + function __promisify__( + fd: number, + options?: StatOptions & { + bigint?: false | undefined; + } + ): Promise; + function __promisify__( + fd: number, + options: StatOptions & { + bigint: true; + } + ): Promise; + function __promisify__(fd: number, options?: StatOptions): Promise; + } + /** + * Retrieves the `fs.Stats` for the file descriptor. + * + * See the POSIX [`fstat(2)`](http://man7.org/linux/man-pages/man2/fstat.2.html) documentation for more detail. + * @since v0.1.95 + */ + export function fstatSync( + fd: number, + options?: StatOptions & { + bigint?: false | undefined; + } + ): Stats; + export function fstatSync( + fd: number, + options: StatOptions & { + bigint: true; + } + ): BigIntStats; + export function fstatSync(fd: number, options?: StatOptions): Stats | BigIntStats; + /** + * Retrieves the `fs.Stats` for the symbolic link referred to by the path. + * The callback gets two arguments `(err, stats)` where `stats` is a `fs.Stats` object. `lstat()` is identical to `stat()`, except that if `path` is a symbolic + * link, then the link itself is stat-ed, not the file that it refers to. + * + * See the POSIX [`lstat(2)`](http://man7.org/linux/man-pages/man2/lstat.2.html) documentation for more details. + * @since v0.1.30 + */ + export function lstat(path: PathLike, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void; + export function lstat( + path: PathLike, + options: + | (StatOptions & { + bigint?: false | undefined; + }) + | undefined, + callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void + ): void; + export function lstat( + path: PathLike, + options: StatOptions & { + bigint: true; + }, + callback: (err: NodeJS.ErrnoException | null, stats: BigIntStats) => void + ): void; + export function lstat(path: PathLike, options: StatOptions | undefined, callback: (err: NodeJS.ErrnoException | null, stats: Stats | BigIntStats) => void): void; + export namespace lstat { + /** + * Asynchronous lstat(2) - Get file status. Does not dereference symbolic links. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function __promisify__( + path: PathLike, + options?: StatOptions & { + bigint?: false | undefined; + } + ): Promise; + function __promisify__( + path: PathLike, + options: StatOptions & { + bigint: true; + } + ): Promise; + function __promisify__(path: PathLike, options?: StatOptions): Promise; + } + /** + * Asynchronous [`statfs(2)`](http://man7.org/linux/man-pages/man2/statfs.2.html). Returns information about the mounted file system which + * contains `path`. The callback gets two arguments `(err, stats)` where `stats`is an `fs.StatFs` object. + * + * In case of an error, the `err.code` will be one of `Common System Errors`. + * @since v19.6.0, v18.15.0 + * @param path A path to an existing file or directory on the file system to be queried. + */ + export function statfs(path: PathLike, callback: (err: NodeJS.ErrnoException | null, stats: StatsFs) => void): void; + export function statfs( + path: PathLike, + options: + | (StatFsOptions & { + bigint?: false | undefined; + }) + | undefined, + callback: (err: NodeJS.ErrnoException | null, stats: StatsFs) => void + ): void; + export function statfs( + path: PathLike, + options: StatFsOptions & { + bigint: true; + }, + callback: (err: NodeJS.ErrnoException | null, stats: BigIntStatsFs) => void + ): void; + export function statfs(path: PathLike, options: StatFsOptions | undefined, callback: (err: NodeJS.ErrnoException | null, stats: StatsFs | BigIntStatsFs) => void): void; + export namespace statfs { + /** + * Asynchronous statfs(2) - Returns information about the mounted file system which contains path. The callback gets two arguments (err, stats) where stats is an object. + * @param path A path to an existing file or directory on the file system to be queried. + */ + function __promisify__( + path: PathLike, + options?: StatFsOptions & { + bigint?: false | undefined; + } + ): Promise; + function __promisify__( + path: PathLike, + options: StatFsOptions & { + bigint: true; + } + ): Promise; + function __promisify__(path: PathLike, options?: StatFsOptions): Promise; + } + /** + * Synchronous [`statfs(2)`](http://man7.org/linux/man-pages/man2/statfs.2.html). Returns information about the mounted file system which + * contains `path`. + * + * In case of an error, the `err.code` will be one of `Common System Errors`. + * @since v19.6.0, v18.15.0 + * @param path A path to an existing file or directory on the file system to be queried. + */ + export function statfsSync( + path: PathLike, + options?: StatFsOptions & { + bigint?: false | undefined; + } + ): StatsFs; + export function statfsSync( + path: PathLike, + options: StatFsOptions & { + bigint: true; + } + ): BigIntStatsFs; + export function statfsSync(path: PathLike, options?: StatFsOptions): StatsFs | BigIntStatsFs; + /** + * Synchronous lstat(2) - Get file status. Does not dereference symbolic links. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export const lstatSync: StatSyncFn; + /** + * Creates a new link from the `existingPath` to the `newPath`. See the POSIX [`link(2)`](http://man7.org/linux/man-pages/man2/link.2.html) documentation for more detail. No arguments other than + * a possible + * exception are given to the completion callback. + * @since v0.1.31 + */ + export function link(existingPath: PathLike, newPath: PathLike, callback: NoParamCallback): void; + export namespace link { + /** + * Asynchronous link(2) - Create a new link (also known as a hard link) to an existing file. + * @param existingPath A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function __promisify__(existingPath: PathLike, newPath: PathLike): Promise; + } + /** + * Creates a new link from the `existingPath` to the `newPath`. See the POSIX [`link(2)`](http://man7.org/linux/man-pages/man2/link.2.html) documentation for more detail. Returns `undefined`. + * @since v0.1.31 + */ + export function linkSync(existingPath: PathLike, newPath: PathLike): void; + /** + * Creates the link called `path` pointing to `target`. No arguments other than a + * possible exception are given to the completion callback. + * + * See the POSIX [`symlink(2)`](http://man7.org/linux/man-pages/man2/symlink.2.html) documentation for more details. + * + * The `type` argument is only available on Windows and ignored on other platforms. + * It can be set to `'dir'`, `'file'`, or `'junction'`. If the `type` argument is + * not a string, Node.js will autodetect `target` type and use `'file'` or `'dir'`. + * If the `target` does not exist, `'file'` will be used. Windows junction points + * require the destination path to be absolute. When using `'junction'`, the`target` argument will automatically be normalized to absolute path. Junction + * points on NTFS volumes can only point to directories. + * + * Relative targets are relative to the link's parent directory. + * + * ```js + * import { symlink } from 'node:fs'; + * + * symlink('./mew', './mewtwo', callback); + * ``` + * + * The above example creates a symbolic link `mewtwo` which points to `mew` in the + * same directory: + * + * ```bash + * $ tree . + * . + * ├── mew + * └── mewtwo -> ./mew + * ``` + * @since v0.1.31 + * @param [type='null'] + */ + export function symlink(target: PathLike, path: PathLike, type: symlink.Type | undefined | null, callback: NoParamCallback): void; + /** + * Asynchronous symlink(2) - Create a new symbolic link to an existing file. + * @param target A path to an existing file. If a URL is provided, it must use the `file:` protocol. + * @param path A path to the new symlink. If a URL is provided, it must use the `file:` protocol. + */ + export function symlink(target: PathLike, path: PathLike, callback: NoParamCallback): void; + export namespace symlink { + /** + * Asynchronous symlink(2) - Create a new symbolic link to an existing file. + * @param target A path to an existing file. If a URL is provided, it must use the `file:` protocol. + * @param path A path to the new symlink. If a URL is provided, it must use the `file:` protocol. + * @param type May be set to `'dir'`, `'file'`, or `'junction'` (default is `'file'`) and is only available on Windows (ignored on other platforms). + * When using `'junction'`, the `target` argument will automatically be normalized to an absolute path. + */ + function __promisify__(target: PathLike, path: PathLike, type?: string | null): Promise; + type Type = 'dir' | 'file' | 'junction'; + } + /** + * Returns `undefined`. + * + * For detailed information, see the documentation of the asynchronous version of + * this API: {@link symlink}. + * @since v0.1.31 + * @param [type='null'] + */ + export function symlinkSync(target: PathLike, path: PathLike, type?: symlink.Type | null): void; + /** + * Reads the contents of the symbolic link referred to by `path`. The callback gets + * two arguments `(err, linkString)`. + * + * See the POSIX [`readlink(2)`](http://man7.org/linux/man-pages/man2/readlink.2.html) documentation for more details. + * + * The optional `options` argument can be a string specifying an encoding, or an + * object with an `encoding` property specifying the character encoding to use for + * the link path passed to the callback. If the `encoding` is set to `'buffer'`, + * the link path returned will be passed as a `Buffer` object. + * @since v0.1.31 + */ + export function readlink(path: PathLike, options: EncodingOption, callback: (err: NodeJS.ErrnoException | null, linkString: string) => void): void; + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readlink(path: PathLike, options: BufferEncodingOption, callback: (err: NodeJS.ErrnoException | null, linkString: Buffer) => void): void; + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readlink(path: PathLike, options: EncodingOption, callback: (err: NodeJS.ErrnoException | null, linkString: string | Buffer) => void): void; + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function readlink(path: PathLike, callback: (err: NodeJS.ErrnoException | null, linkString: string) => void): void; + export namespace readlink { + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function __promisify__(path: PathLike, options?: EncodingOption): Promise; + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function __promisify__(path: PathLike, options: BufferEncodingOption): Promise; + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function __promisify__(path: PathLike, options?: EncodingOption): Promise; + } + /** + * Returns the symbolic link's string value. + * + * See the POSIX [`readlink(2)`](http://man7.org/linux/man-pages/man2/readlink.2.html) documentation for more details. + * + * The optional `options` argument can be a string specifying an encoding, or an + * object with an `encoding` property specifying the character encoding to use for + * the link path returned. If the `encoding` is set to `'buffer'`, + * the link path returned will be passed as a `Buffer` object. + * @since v0.1.31 + */ + export function readlinkSync(path: PathLike, options?: EncodingOption): string; + /** + * Synchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readlinkSync(path: PathLike, options: BufferEncodingOption): Buffer; + /** + * Synchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readlinkSync(path: PathLike, options?: EncodingOption): string | Buffer; + /** + * Asynchronously computes the canonical pathname by resolving `.`, `..`, and + * symbolic links. + * + * A canonical pathname is not necessarily unique. Hard links and bind mounts can + * expose a file system entity through many pathnames. + * + * This function behaves like [`realpath(3)`](http://man7.org/linux/man-pages/man3/realpath.3.html), with some exceptions: + * + * 1. No case conversion is performed on case-insensitive file systems. + * 2. The maximum number of symbolic links is platform-independent and generally + * (much) higher than what the native [`realpath(3)`](http://man7.org/linux/man-pages/man3/realpath.3.html) implementation supports. + * + * The `callback` gets two arguments `(err, resolvedPath)`. May use `process.cwd`to resolve relative paths. + * + * Only paths that can be converted to UTF8 strings are supported. + * + * The optional `options` argument can be a string specifying an encoding, or an + * object with an `encoding` property specifying the character encoding to use for + * the path passed to the callback. If the `encoding` is set to `'buffer'`, + * the path returned will be passed as a `Buffer` object. + * + * If `path` resolves to a socket or a pipe, the function will return a system + * dependent name for that object. + * @since v0.1.31 + */ + export function realpath(path: PathLike, options: EncodingOption, callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void): void; + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function realpath(path: PathLike, options: BufferEncodingOption, callback: (err: NodeJS.ErrnoException | null, resolvedPath: Buffer) => void): void; + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function realpath(path: PathLike, options: EncodingOption, callback: (err: NodeJS.ErrnoException | null, resolvedPath: string | Buffer) => void): void; + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function realpath(path: PathLike, callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void): void; + export namespace realpath { + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function __promisify__(path: PathLike, options?: EncodingOption): Promise; + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function __promisify__(path: PathLike, options: BufferEncodingOption): Promise; + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function __promisify__(path: PathLike, options?: EncodingOption): Promise; + /** + * Asynchronous [`realpath(3)`](http://man7.org/linux/man-pages/man3/realpath.3.html). + * + * The `callback` gets two arguments `(err, resolvedPath)`. + * + * Only paths that can be converted to UTF8 strings are supported. + * + * The optional `options` argument can be a string specifying an encoding, or an + * object with an `encoding` property specifying the character encoding to use for + * the path passed to the callback. If the `encoding` is set to `'buffer'`, + * the path returned will be passed as a `Buffer` object. + * + * On Linux, when Node.js is linked against musl libc, the procfs file system must + * be mounted on `/proc` in order for this function to work. Glibc does not have + * this restriction. + * @since v9.2.0 + */ + function native(path: PathLike, options: EncodingOption, callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void): void; + function native(path: PathLike, options: BufferEncodingOption, callback: (err: NodeJS.ErrnoException | null, resolvedPath: Buffer) => void): void; + function native(path: PathLike, options: EncodingOption, callback: (err: NodeJS.ErrnoException | null, resolvedPath: string | Buffer) => void): void; + function native(path: PathLike, callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void): void; + } + /** + * Returns the resolved pathname. + * + * For detailed information, see the documentation of the asynchronous version of + * this API: {@link realpath}. + * @since v0.1.31 + */ + export function realpathSync(path: PathLike, options?: EncodingOption): string; + /** + * Synchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function realpathSync(path: PathLike, options: BufferEncodingOption): Buffer; + /** + * Synchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function realpathSync(path: PathLike, options?: EncodingOption): string | Buffer; + export namespace realpathSync { + function native(path: PathLike, options?: EncodingOption): string; + function native(path: PathLike, options: BufferEncodingOption): Buffer; + function native(path: PathLike, options?: EncodingOption): string | Buffer; + } + /** + * Asynchronously removes a file or symbolic link. No arguments other than a + * possible exception are given to the completion callback. + * + * ```js + * import { unlink } from 'node:fs'; + * // Assuming that 'path/file.txt' is a regular file. + * unlink('path/file.txt', (err) => { + * if (err) throw err; + * console.log('path/file.txt was deleted'); + * }); + * ``` + * + * `fs.unlink()` will not work on a directory, empty or otherwise. To remove a + * directory, use {@link rmdir}. + * + * See the POSIX [`unlink(2)`](http://man7.org/linux/man-pages/man2/unlink.2.html) documentation for more details. + * @since v0.0.2 + */ + export function unlink(path: PathLike, callback: NoParamCallback): void; + export namespace unlink { + /** + * Asynchronous unlink(2) - delete a name and possibly the file it refers to. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function __promisify__(path: PathLike): Promise; + } + /** + * Synchronous [`unlink(2)`](http://man7.org/linux/man-pages/man2/unlink.2.html). Returns `undefined`. + * @since v0.1.21 + */ + export function unlinkSync(path: PathLike): void; + export interface RmDirOptions { + /** + * If an `EBUSY`, `EMFILE`, `ENFILE`, `ENOTEMPTY`, or + * `EPERM` error is encountered, Node.js will retry the operation with a linear + * backoff wait of `retryDelay` ms longer on each try. This option represents the + * number of retries. This option is ignored if the `recursive` option is not + * `true`. + * @default 0 + */ + maxRetries?: number | undefined; + /** + * @deprecated since v14.14.0 In future versions of Node.js and will trigger a warning + * `fs.rmdir(path, { recursive: true })` will throw if `path` does not exist or is a file. + * Use `fs.rm(path, { recursive: true, force: true })` instead. + * + * If `true`, perform a recursive directory removal. In + * recursive mode, operations are retried on failure. + * @default false + */ + recursive?: boolean | undefined; + /** + * The amount of time in milliseconds to wait between retries. + * This option is ignored if the `recursive` option is not `true`. + * @default 100 + */ + retryDelay?: number | undefined; + } + /** + * Asynchronous [`rmdir(2)`](http://man7.org/linux/man-pages/man2/rmdir.2.html). No arguments other than a possible exception are given + * to the completion callback. + * + * Using `fs.rmdir()` on a file (not a directory) results in an `ENOENT` error on + * Windows and an `ENOTDIR` error on POSIX. + * + * To get a behavior similar to the `rm -rf` Unix command, use {@link rm} with options `{ recursive: true, force: true }`. + * @since v0.0.2 + */ + export function rmdir(path: PathLike, callback: NoParamCallback): void; + export function rmdir(path: PathLike, options: RmDirOptions, callback: NoParamCallback): void; + export namespace rmdir { + /** + * Asynchronous rmdir(2) - delete a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function __promisify__(path: PathLike, options?: RmDirOptions): Promise; + } + /** + * Synchronous [`rmdir(2)`](http://man7.org/linux/man-pages/man2/rmdir.2.html). Returns `undefined`. + * + * Using `fs.rmdirSync()` on a file (not a directory) results in an `ENOENT` error + * on Windows and an `ENOTDIR` error on POSIX. + * + * To get a behavior similar to the `rm -rf` Unix command, use {@link rmSync} with options `{ recursive: true, force: true }`. + * @since v0.1.21 + */ + export function rmdirSync(path: PathLike, options?: RmDirOptions): void; + export interface RmOptions { + /** + * When `true`, exceptions will be ignored if `path` does not exist. + * @default false + */ + force?: boolean | undefined; + /** + * If an `EBUSY`, `EMFILE`, `ENFILE`, `ENOTEMPTY`, or + * `EPERM` error is encountered, Node.js will retry the operation with a linear + * backoff wait of `retryDelay` ms longer on each try. This option represents the + * number of retries. This option is ignored if the `recursive` option is not + * `true`. + * @default 0 + */ + maxRetries?: number | undefined; + /** + * If `true`, perform a recursive directory removal. In + * recursive mode, operations are retried on failure. + * @default false + */ + recursive?: boolean | undefined; + /** + * The amount of time in milliseconds to wait between retries. + * This option is ignored if the `recursive` option is not `true`. + * @default 100 + */ + retryDelay?: number | undefined; + } + /** + * Asynchronously removes files and directories (modeled on the standard POSIX `rm`utility). No arguments other than a possible exception are given to the + * completion callback. + * @since v14.14.0 + */ + export function rm(path: PathLike, callback: NoParamCallback): void; + export function rm(path: PathLike, options: RmOptions, callback: NoParamCallback): void; + export namespace rm { + /** + * Asynchronously removes files and directories (modeled on the standard POSIX `rm` utility). + */ + function __promisify__(path: PathLike, options?: RmOptions): Promise; + } + /** + * Synchronously removes files and directories (modeled on the standard POSIX `rm`utility). Returns `undefined`. + * @since v14.14.0 + */ + export function rmSync(path: PathLike, options?: RmOptions): void; + export interface MakeDirectoryOptions { + /** + * Indicates whether parent folders should be created. + * If a folder was created, the path to the first created folder will be returned. + * @default false + */ + recursive?: boolean | undefined; + /** + * A file mode. If a string is passed, it is parsed as an octal integer. If not specified + * @default 0o777 + */ + mode?: Mode | undefined; + } + /** + * Asynchronously creates a directory. + * + * The callback is given a possible exception and, if `recursive` is `true`, the + * first directory path created, `(err[, path])`.`path` can still be `undefined` when `recursive` is `true`, if no directory was + * created (for instance, if it was previously created). + * + * The optional `options` argument can be an integer specifying `mode` (permission + * and sticky bits), or an object with a `mode` property and a `recursive`property indicating whether parent directories should be created. Calling`fs.mkdir()` when `path` is a directory that + * exists results in an error only + * when `recursive` is false. If `recursive` is false and the directory exists, + * an `EEXIST` error occurs. + * + * ```js + * import { mkdir } from 'node:fs'; + * + * // Create ./tmp/a/apple, regardless of whether ./tmp and ./tmp/a exist. + * mkdir('./tmp/a/apple', { recursive: true }, (err) => { + * if (err) throw err; + * }); + * ``` + * + * On Windows, using `fs.mkdir()` on the root directory even with recursion will + * result in an error: + * + * ```js + * import { mkdir } from 'node:fs'; + * + * mkdir('/', { recursive: true }, (err) => { + * // => [Error: EPERM: operation not permitted, mkdir 'C:\'] + * }); + * ``` + * + * See the POSIX [`mkdir(2)`](http://man7.org/linux/man-pages/man2/mkdir.2.html) documentation for more details. + * @since v0.1.8 + */ + export function mkdir( + path: PathLike, + options: MakeDirectoryOptions & { + recursive: true; + }, + callback: (err: NodeJS.ErrnoException | null, path?: string) => void + ): void; + /** + * Asynchronous mkdir(2) - create a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders + * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. + */ + export function mkdir( + path: PathLike, + options: + | Mode + | (MakeDirectoryOptions & { + recursive?: false | undefined; + }) + | null + | undefined, + callback: NoParamCallback + ): void; + /** + * Asynchronous mkdir(2) - create a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders + * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. + */ + export function mkdir(path: PathLike, options: Mode | MakeDirectoryOptions | null | undefined, callback: (err: NodeJS.ErrnoException | null, path?: string) => void): void; + /** + * Asynchronous mkdir(2) - create a directory with a mode of `0o777`. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function mkdir(path: PathLike, callback: NoParamCallback): void; + export namespace mkdir { + /** + * Asynchronous mkdir(2) - create a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders + * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. + */ + function __promisify__( + path: PathLike, + options: MakeDirectoryOptions & { + recursive: true; + } + ): Promise; + /** + * Asynchronous mkdir(2) - create a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders + * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. + */ + function __promisify__( + path: PathLike, + options?: + | Mode + | (MakeDirectoryOptions & { + recursive?: false | undefined; + }) + | null + ): Promise; + /** + * Asynchronous mkdir(2) - create a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders + * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. + */ + function __promisify__(path: PathLike, options?: Mode | MakeDirectoryOptions | null): Promise; + } + /** + * Synchronously creates a directory. Returns `undefined`, or if `recursive` is`true`, the first directory path created. + * This is the synchronous version of {@link mkdir}. + * + * See the POSIX [`mkdir(2)`](http://man7.org/linux/man-pages/man2/mkdir.2.html) documentation for more details. + * @since v0.1.21 + */ + export function mkdirSync( + path: PathLike, + options: MakeDirectoryOptions & { + recursive: true; + } + ): string | undefined; + /** + * Synchronous mkdir(2) - create a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders + * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. + */ + export function mkdirSync( + path: PathLike, + options?: + | Mode + | (MakeDirectoryOptions & { + recursive?: false | undefined; + }) + | null + ): void; + /** + * Synchronous mkdir(2) - create a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders + * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. + */ + export function mkdirSync(path: PathLike, options?: Mode | MakeDirectoryOptions | null): string | undefined; + /** + * Creates a unique temporary directory. + * + * Generates six random characters to be appended behind a required`prefix` to create a unique temporary directory. Due to platform + * inconsistencies, avoid trailing `X` characters in `prefix`. Some platforms, + * notably the BSDs, can return more than six random characters, and replace + * trailing `X` characters in `prefix` with random characters. + * + * The created directory path is passed as a string to the callback's second + * parameter. + * + * The optional `options` argument can be a string specifying an encoding, or an + * object with an `encoding` property specifying the character encoding to use. + * + * ```js + * import { mkdtemp } from 'node:fs'; + * import { join } from 'node:path'; + * import { tmpdir } from 'node:os'; + * + * mkdtemp(join(tmpdir(), 'foo-'), (err, directory) => { + * if (err) throw err; + * console.log(directory); + * // Prints: /tmp/foo-itXde2 or C:\Users\...\AppData\Local\Temp\foo-itXde2 + * }); + * ``` + * + * The `fs.mkdtemp()` method will append the six randomly selected characters + * directly to the `prefix` string. For instance, given a directory `/tmp`, if the + * intention is to create a temporary directory _within_`/tmp`, the `prefix`must end with a trailing platform-specific path separator + * (`require('node:path').sep`). + * + * ```js + * import { tmpdir } from 'node:os'; + * import { mkdtemp } from 'node:fs'; + * + * // The parent directory for the new temporary directory + * const tmpDir = tmpdir(); + * + * // This method is *INCORRECT*: + * mkdtemp(tmpDir, (err, directory) => { + * if (err) throw err; + * console.log(directory); + * // Will print something similar to `/tmpabc123`. + * // A new temporary directory is created at the file system root + * // rather than *within* the /tmp directory. + * }); + * + * // This method is *CORRECT*: + * import { sep } from 'node:path'; + * mkdtemp(`${tmpDir}${sep}`, (err, directory) => { + * if (err) throw err; + * console.log(directory); + * // Will print something similar to `/tmp/abc123`. + * // A new temporary directory is created within + * // the /tmp directory. + * }); + * ``` + * @since v5.10.0 + */ + export function mkdtemp(prefix: string, options: EncodingOption, callback: (err: NodeJS.ErrnoException | null, folder: string) => void): void; + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function mkdtemp( + prefix: string, + options: + | 'buffer' + | { + encoding: 'buffer'; + }, + callback: (err: NodeJS.ErrnoException | null, folder: Buffer) => void + ): void; + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function mkdtemp(prefix: string, options: EncodingOption, callback: (err: NodeJS.ErrnoException | null, folder: string | Buffer) => void): void; + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + */ + export function mkdtemp(prefix: string, callback: (err: NodeJS.ErrnoException | null, folder: string) => void): void; + export namespace mkdtemp { + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function __promisify__(prefix: string, options?: EncodingOption): Promise; + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function __promisify__(prefix: string, options: BufferEncodingOption): Promise; + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function __promisify__(prefix: string, options?: EncodingOption): Promise; + } + /** + * Returns the created directory path. + * + * For detailed information, see the documentation of the asynchronous version of + * this API: {@link mkdtemp}. + * + * The optional `options` argument can be a string specifying an encoding, or an + * object with an `encoding` property specifying the character encoding to use. + * @since v5.10.0 + */ + export function mkdtempSync(prefix: string, options?: EncodingOption): string; + /** + * Synchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function mkdtempSync(prefix: string, options: BufferEncodingOption): Buffer; + /** + * Synchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function mkdtempSync(prefix: string, options?: EncodingOption): string | Buffer; + /** + * Reads the contents of a directory. The callback gets two arguments `(err, files)`where `files` is an array of the names of the files in the directory excluding`'.'` and `'..'`. + * + * See the POSIX [`readdir(3)`](http://man7.org/linux/man-pages/man3/readdir.3.html) documentation for more details. + * + * The optional `options` argument can be a string specifying an encoding, or an + * object with an `encoding` property specifying the character encoding to use for + * the filenames passed to the callback. If the `encoding` is set to `'buffer'`, + * the filenames returned will be passed as `Buffer` objects. + * + * If `options.withFileTypes` is set to `true`, the `files` array will contain `fs.Dirent` objects. + * @since v0.1.8 + */ + export function readdir( + path: PathLike, + options: + | { + encoding: BufferEncoding | null; + withFileTypes?: false | undefined; + recursive?: boolean | undefined; + } + | BufferEncoding + | undefined + | null, + callback: (err: NodeJS.ErrnoException | null, files: string[]) => void + ): void; + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readdir( + path: PathLike, + options: + | { + encoding: 'buffer'; + withFileTypes?: false | undefined; + recursive?: boolean | undefined; + } + | 'buffer', + callback: (err: NodeJS.ErrnoException | null, files: Buffer[]) => void + ): void; + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readdir( + path: PathLike, + options: + | (ObjectEncodingOptions & { + withFileTypes?: false | undefined; + recursive?: boolean | undefined; + }) + | BufferEncoding + | undefined + | null, + callback: (err: NodeJS.ErrnoException | null, files: string[] | Buffer[]) => void + ): void; + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function readdir(path: PathLike, callback: (err: NodeJS.ErrnoException | null, files: string[]) => void): void; + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options If called with `withFileTypes: true` the result data will be an array of Dirent. + */ + export function readdir( + path: PathLike, + options: ObjectEncodingOptions & { + withFileTypes: true; + recursive?: boolean | undefined; + }, + callback: (err: NodeJS.ErrnoException | null, files: Dirent[]) => void + ): void; + export namespace readdir { + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function __promisify__( + path: PathLike, + options?: + | { + encoding: BufferEncoding | null; + withFileTypes?: false | undefined; + recursive?: boolean | undefined; + } + | BufferEncoding + | null + ): Promise; + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function __promisify__( + path: PathLike, + options: + | 'buffer' + | { + encoding: 'buffer'; + withFileTypes?: false | undefined; + recursive?: boolean | undefined; + } + ): Promise; + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function __promisify__( + path: PathLike, + options?: + | (ObjectEncodingOptions & { + withFileTypes?: false | undefined; + recursive?: boolean | undefined; + }) + | BufferEncoding + | null + ): Promise; + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options If called with `withFileTypes: true` the result data will be an array of Dirent + */ + function __promisify__( + path: PathLike, + options: ObjectEncodingOptions & { + withFileTypes: true; + recursive?: boolean | undefined; + } + ): Promise; + } + /** + * Reads the contents of the directory. + * + * See the POSIX [`readdir(3)`](http://man7.org/linux/man-pages/man3/readdir.3.html) documentation for more details. + * + * The optional `options` argument can be a string specifying an encoding, or an + * object with an `encoding` property specifying the character encoding to use for + * the filenames returned. If the `encoding` is set to `'buffer'`, + * the filenames returned will be passed as `Buffer` objects. + * + * If `options.withFileTypes` is set to `true`, the result will contain `fs.Dirent` objects. + * @since v0.1.21 + */ + export function readdirSync( + path: PathLike, + options?: + | { + encoding: BufferEncoding | null; + withFileTypes?: false | undefined; + recursive?: boolean | undefined; + } + | BufferEncoding + | null + ): string[]; + /** + * Synchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readdirSync( + path: PathLike, + options: + | { + encoding: 'buffer'; + withFileTypes?: false | undefined; + recursive?: boolean | undefined; + } + | 'buffer' + ): Buffer[]; + /** + * Synchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readdirSync( + path: PathLike, + options?: + | (ObjectEncodingOptions & { + withFileTypes?: false | undefined; + recursive?: boolean | undefined; + }) + | BufferEncoding + | null + ): string[] | Buffer[]; + /** + * Synchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options If called with `withFileTypes: true` the result data will be an array of Dirent. + */ + export function readdirSync( + path: PathLike, + options: ObjectEncodingOptions & { + withFileTypes: true; + recursive?: boolean | undefined; + } + ): Dirent[]; + /** + * Closes the file descriptor. No arguments other than a possible exception are + * given to the completion callback. + * + * Calling `fs.close()` on any file descriptor (`fd`) that is currently in use + * through any other `fs` operation may lead to undefined behavior. + * + * See the POSIX [`close(2)`](http://man7.org/linux/man-pages/man2/close.2.html) documentation for more detail. + * @since v0.0.2 + */ + export function close(fd: number, callback?: NoParamCallback): void; + export namespace close { + /** + * Asynchronous close(2) - close a file descriptor. + * @param fd A file descriptor. + */ + function __promisify__(fd: number): Promise; + } + /** + * Closes the file descriptor. Returns `undefined`. + * + * Calling `fs.closeSync()` on any file descriptor (`fd`) that is currently in use + * through any other `fs` operation may lead to undefined behavior. + * + * See the POSIX [`close(2)`](http://man7.org/linux/man-pages/man2/close.2.html) documentation for more detail. + * @since v0.1.21 + */ + export function closeSync(fd: number): void; + /** + * Asynchronous file open. See the POSIX [`open(2)`](http://man7.org/linux/man-pages/man2/open.2.html) documentation for more details. + * + * `mode` sets the file mode (permission and sticky bits), but only if the file was + * created. On Windows, only the write permission can be manipulated; see {@link chmod}. + * + * The callback gets two arguments `(err, fd)`. + * + * Some characters (`< > : " / \ | ? *`) are reserved under Windows as documented + * by [Naming Files, Paths, and Namespaces](https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file). Under NTFS, if the filename contains + * a colon, Node.js will open a file system stream, as described by [this MSDN page](https://docs.microsoft.com/en-us/windows/desktop/FileIO/using-streams). + * + * Functions based on `fs.open()` exhibit this behavior as well:`fs.writeFile()`, `fs.readFile()`, etc. + * @since v0.0.2 + * @param [flags='r'] See `support of file system `flags``. + * @param [mode=0o666] + */ + export function open(path: PathLike, flags: OpenMode | undefined, mode: Mode | undefined | null, callback: (err: NodeJS.ErrnoException | null, fd: number) => void): void; + /** + * Asynchronous open(2) - open and possibly create a file. If the file is created, its mode will be `0o666`. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param [flags='r'] See `support of file system `flags``. + */ + export function open(path: PathLike, flags: OpenMode | undefined, callback: (err: NodeJS.ErrnoException | null, fd: number) => void): void; + /** + * Asynchronous open(2) - open and possibly create a file. If the file is created, its mode will be `0o666`. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function open(path: PathLike, callback: (err: NodeJS.ErrnoException | null, fd: number) => void): void; + export namespace open { + /** + * Asynchronous open(2) - open and possibly create a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. If not supplied, defaults to `0o666`. + */ + function __promisify__(path: PathLike, flags: OpenMode, mode?: Mode | null): Promise; + } + /** + * Returns an integer representing the file descriptor. + * + * For detailed information, see the documentation of the asynchronous version of + * this API: {@link open}. + * @since v0.1.21 + * @param [flags='r'] + * @param [mode=0o666] + */ + export function openSync(path: PathLike, flags: OpenMode, mode?: Mode | null): number; + /** + * Change the file system timestamps of the object referenced by `path`. + * + * The `atime` and `mtime` arguments follow these rules: + * + * * Values can be either numbers representing Unix epoch time in seconds,`Date`s, or a numeric string like `'123456789.0'`. + * * If the value can not be converted to a number, or is `NaN`, `Infinity`, or`-Infinity`, an `Error` will be thrown. + * @since v0.4.2 + */ + export function utimes(path: PathLike, atime: TimeLike, mtime: TimeLike, callback: NoParamCallback): void; + export namespace utimes { + /** + * Asynchronously change file timestamps of the file referenced by the supplied path. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param atime The last access time. If a string is provided, it will be coerced to number. + * @param mtime The last modified time. If a string is provided, it will be coerced to number. + */ + function __promisify__(path: PathLike, atime: TimeLike, mtime: TimeLike): Promise; + } + /** + * Returns `undefined`. + * + * For detailed information, see the documentation of the asynchronous version of + * this API: {@link utimes}. + * @since v0.4.2 + */ + export function utimesSync(path: PathLike, atime: TimeLike, mtime: TimeLike): void; + /** + * Change the file system timestamps of the object referenced by the supplied file + * descriptor. See {@link utimes}. + * @since v0.4.2 + */ + export function futimes(fd: number, atime: TimeLike, mtime: TimeLike, callback: NoParamCallback): void; + export namespace futimes { + /** + * Asynchronously change file timestamps of the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param atime The last access time. If a string is provided, it will be coerced to number. + * @param mtime The last modified time. If a string is provided, it will be coerced to number. + */ + function __promisify__(fd: number, atime: TimeLike, mtime: TimeLike): Promise; + } + /** + * Synchronous version of {@link futimes}. Returns `undefined`. + * @since v0.4.2 + */ + export function futimesSync(fd: number, atime: TimeLike, mtime: TimeLike): void; + /** + * Request that all data for the open file descriptor is flushed to the storage + * device. The specific implementation is operating system and device specific. + * Refer to the POSIX [`fsync(2)`](http://man7.org/linux/man-pages/man2/fsync.2.html) documentation for more detail. No arguments other + * than a possible exception are given to the completion callback. + * @since v0.1.96 + */ + export function fsync(fd: number, callback: NoParamCallback): void; + export namespace fsync { + /** + * Asynchronous fsync(2) - synchronize a file's in-core state with the underlying storage device. + * @param fd A file descriptor. + */ + function __promisify__(fd: number): Promise; + } + /** + * Request that all data for the open file descriptor is flushed to the storage + * device. The specific implementation is operating system and device specific. + * Refer to the POSIX [`fsync(2)`](http://man7.org/linux/man-pages/man2/fsync.2.html) documentation for more detail. Returns `undefined`. + * @since v0.1.96 + */ + export function fsyncSync(fd: number): void; + /** + * Write `buffer` to the file specified by `fd`. + * + * `offset` determines the part of the buffer to be written, and `length` is + * an integer specifying the number of bytes to write. + * + * `position` refers to the offset from the beginning of the file where this data + * should be written. If `typeof position !== 'number'`, the data will be written + * at the current position. See [`pwrite(2)`](http://man7.org/linux/man-pages/man2/pwrite.2.html). + * + * The callback will be given three arguments `(err, bytesWritten, buffer)` where`bytesWritten` specifies how many _bytes_ were written from `buffer`. + * + * If this method is invoked as its `util.promisify()` ed version, it returns + * a promise for an `Object` with `bytesWritten` and `buffer` properties. + * + * It is unsafe to use `fs.write()` multiple times on the same file without waiting + * for the callback. For this scenario, {@link createWriteStream} is + * recommended. + * + * On Linux, positional writes don't work when the file is opened in append mode. + * The kernel ignores the position argument and always appends the data to + * the end of the file. + * @since v0.0.2 + * @param [offset=0] + * @param [length=buffer.byteLength - offset] + * @param [position='null'] + */ + export function write( + fd: number, + buffer: TBuffer, + offset: number | undefined | null, + length: number | undefined | null, + position: number | undefined | null, + callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void + ): void; + /** + * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param offset The part of the buffer to be written. If not supplied, defaults to `0`. + * @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`. + */ + export function write( + fd: number, + buffer: TBuffer, + offset: number | undefined | null, + length: number | undefined | null, + callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void + ): void; + /** + * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param offset The part of the buffer to be written. If not supplied, defaults to `0`. + */ + export function write( + fd: number, + buffer: TBuffer, + offset: number | undefined | null, + callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void + ): void; + /** + * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + */ + export function write(fd: number, buffer: TBuffer, callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void): void; + /** + * Asynchronously writes `string` to the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param string A string to write. + * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. + * @param encoding The expected string encoding. + */ + export function write( + fd: number, + string: string, + position: number | undefined | null, + encoding: BufferEncoding | undefined | null, + callback: (err: NodeJS.ErrnoException | null, written: number, str: string) => void + ): void; + /** + * Asynchronously writes `string` to the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param string A string to write. + * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. + */ + export function write(fd: number, string: string, position: number | undefined | null, callback: (err: NodeJS.ErrnoException | null, written: number, str: string) => void): void; + /** + * Asynchronously writes `string` to the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param string A string to write. + */ + export function write(fd: number, string: string, callback: (err: NodeJS.ErrnoException | null, written: number, str: string) => void): void; + export namespace write { + /** + * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param offset The part of the buffer to be written. If not supplied, defaults to `0`. + * @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`. + * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. + */ + function __promisify__( + fd: number, + buffer?: TBuffer, + offset?: number, + length?: number, + position?: number | null + ): Promise<{ + bytesWritten: number; + buffer: TBuffer; + }>; + /** + * Asynchronously writes `string` to the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param string A string to write. + * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. + * @param encoding The expected string encoding. + */ + function __promisify__( + fd: number, + string: string, + position?: number | null, + encoding?: BufferEncoding | null + ): Promise<{ + bytesWritten: number; + buffer: string; + }>; + } + /** + * For detailed information, see the documentation of the asynchronous version of + * this API: {@link write}. + * @since v0.1.21 + * @param [offset=0] + * @param [length=buffer.byteLength - offset] + * @param [position='null'] + * @return The number of bytes written. + */ + export function writeSync(fd: number, buffer: NodeJS.ArrayBufferView, offset?: number | null, length?: number | null, position?: number | null): number; + /** + * Synchronously writes `string` to the file referenced by the supplied file descriptor, returning the number of bytes written. + * @param fd A file descriptor. + * @param string A string to write. + * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. + * @param encoding The expected string encoding. + */ + export function writeSync(fd: number, string: string, position?: number | null, encoding?: BufferEncoding | null): number; + export type ReadPosition = number | bigint; + export interface ReadSyncOptions { + /** + * @default 0 + */ + offset?: number | undefined; + /** + * @default `length of buffer` + */ + length?: number | undefined; + /** + * @default null + */ + position?: ReadPosition | null | undefined; + } + export interface ReadAsyncOptions extends ReadSyncOptions { + buffer?: TBuffer; + } + /** + * Read data from the file specified by `fd`. + * + * The callback is given the three arguments, `(err, bytesRead, buffer)`. + * + * If the file is not modified concurrently, the end-of-file is reached when the + * number of bytes read is zero. + * + * If this method is invoked as its `util.promisify()` ed version, it returns + * a promise for an `Object` with `bytesRead` and `buffer` properties. + * @since v0.0.2 + * @param buffer The buffer that the data will be written to. + * @param offset The position in `buffer` to write the data to. + * @param length The number of bytes to read. + * @param position Specifies where to begin reading from in the file. If `position` is `null` or `-1 `, data will be read from the current file position, and the file position will be updated. If + * `position` is an integer, the file position will be unchanged. + */ + export function read( + fd: number, + buffer: TBuffer, + offset: number, + length: number, + position: ReadPosition | null, + callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: TBuffer) => void + ): void; + /** + * Similar to the above `fs.read` function, this version takes an optional `options` object. + * If not otherwise specified in an `options` object, + * `buffer` defaults to `Buffer.alloc(16384)`, + * `offset` defaults to `0`, + * `length` defaults to `buffer.byteLength`, `- offset` as of Node 17.6.0 + * `position` defaults to `null` + * @since v12.17.0, 13.11.0 + */ + export function read( + fd: number, + options: ReadAsyncOptions, + callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: TBuffer) => void + ): void; + export function read(fd: number, callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: NodeJS.ArrayBufferView) => void): void; + export namespace read { + /** + * @param fd A file descriptor. + * @param buffer The buffer that the data will be written to. + * @param offset The offset in the buffer at which to start writing. + * @param length The number of bytes to read. + * @param position The offset from the beginning of the file from which data should be read. If `null`, data will be read from the current position. + */ + function __promisify__( + fd: number, + buffer: TBuffer, + offset: number, + length: number, + position: number | null + ): Promise<{ + bytesRead: number; + buffer: TBuffer; + }>; + function __promisify__( + fd: number, + options: ReadAsyncOptions + ): Promise<{ + bytesRead: number; + buffer: TBuffer; + }>; + function __promisify__(fd: number): Promise<{ + bytesRead: number; + buffer: NodeJS.ArrayBufferView; + }>; + } + /** + * Returns the number of `bytesRead`. + * + * For detailed information, see the documentation of the asynchronous version of + * this API: {@link read}. + * @since v0.1.21 + * @param [position='null'] + */ + export function readSync(fd: number, buffer: NodeJS.ArrayBufferView, offset: number, length: number, position: ReadPosition | null): number; + /** + * Similar to the above `fs.readSync` function, this version takes an optional `options` object. + * If no `options` object is specified, it will default with the above values. + */ + export function readSync(fd: number, buffer: NodeJS.ArrayBufferView, opts?: ReadSyncOptions): number; + /** + * Asynchronously reads the entire contents of a file. + * + * ```js + * import { readFile } from 'node:fs'; + * + * readFile('/etc/passwd', (err, data) => { + * if (err) throw err; + * console.log(data); + * }); + * ``` + * + * The callback is passed two arguments `(err, data)`, where `data` is the + * contents of the file. + * + * If no encoding is specified, then the raw buffer is returned. + * + * If `options` is a string, then it specifies the encoding: + * + * ```js + * import { readFile } from 'node:fs'; + * + * readFile('/etc/passwd', 'utf8', callback); + * ``` + * + * When the path is a directory, the behavior of `fs.readFile()` and {@link readFileSync} is platform-specific. On macOS, Linux, and Windows, an + * error will be returned. On FreeBSD, a representation of the directory's contents + * will be returned. + * + * ```js + * import { readFile } from 'node:fs'; + * + * // macOS, Linux, and Windows + * readFile('', (err, data) => { + * // => [Error: EISDIR: illegal operation on a directory, read ] + * }); + * + * // FreeBSD + * readFile('', (err, data) => { + * // => null, + * }); + * ``` + * + * It is possible to abort an ongoing request using an `AbortSignal`. If a + * request is aborted the callback is called with an `AbortError`: + * + * ```js + * import { readFile } from 'node:fs'; + * + * const controller = new AbortController(); + * const signal = controller.signal; + * readFile(fileInfo[0].name, { signal }, (err, buf) => { + * // ... + * }); + * // When you want to abort the request + * controller.abort(); + * ``` + * + * The `fs.readFile()` function buffers the entire file. To minimize memory costs, + * when possible prefer streaming via `fs.createReadStream()`. + * + * Aborting an ongoing request does not abort individual operating + * system requests but rather the internal buffering `fs.readFile` performs. + * @since v0.1.29 + * @param path filename or file descriptor + */ + export function readFile( + path: PathOrFileDescriptor, + options: + | ({ + encoding?: null | undefined; + flag?: string | undefined; + } & Abortable) + | undefined + | null, + callback: (err: NodeJS.ErrnoException | null, data: Buffer) => void + ): void; + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + export function readFile( + path: PathOrFileDescriptor, + options: + | ({ + encoding: BufferEncoding; + flag?: string | undefined; + } & Abortable) + | BufferEncoding, + callback: (err: NodeJS.ErrnoException | null, data: string) => void + ): void; + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + export function readFile( + path: PathOrFileDescriptor, + options: + | (ObjectEncodingOptions & { + flag?: string | undefined; + } & Abortable) + | BufferEncoding + | undefined + | null, + callback: (err: NodeJS.ErrnoException | null, data: string | Buffer) => void + ): void; + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + */ + export function readFile(path: PathOrFileDescriptor, callback: (err: NodeJS.ErrnoException | null, data: Buffer) => void): void; + export namespace readFile { + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param options An object that may contain an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + function __promisify__( + path: PathOrFileDescriptor, + options?: { + encoding?: null | undefined; + flag?: string | undefined; + } | null + ): Promise; + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + function __promisify__( + path: PathOrFileDescriptor, + options: + | { + encoding: BufferEncoding; + flag?: string | undefined; + } + | BufferEncoding + ): Promise; + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + function __promisify__( + path: PathOrFileDescriptor, + options?: + | (ObjectEncodingOptions & { + flag?: string | undefined; + }) + | BufferEncoding + | null + ): Promise; + } + /** + * Returns the contents of the `path`. + * + * For detailed information, see the documentation of the asynchronous version of + * this API: {@link readFile}. + * + * If the `encoding` option is specified then this function returns a + * string. Otherwise it returns a buffer. + * + * Similar to {@link readFile}, when the path is a directory, the behavior of`fs.readFileSync()` is platform-specific. + * + * ```js + * import { readFileSync } from 'node:fs'; + * + * // macOS, Linux, and Windows + * readFileSync(''); + * // => [Error: EISDIR: illegal operation on a directory, read ] + * + * // FreeBSD + * readFileSync(''); // => + * ``` + * @since v0.1.8 + * @param path filename or file descriptor + */ + export function readFileSync( + path: PathOrFileDescriptor, + options?: { + encoding?: null | undefined; + flag?: string | undefined; + } | null + ): Buffer; + /** + * Synchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + export function readFileSync( + path: PathOrFileDescriptor, + options: + | { + encoding: BufferEncoding; + flag?: string | undefined; + } + | BufferEncoding + ): string; + /** + * Synchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + export function readFileSync( + path: PathOrFileDescriptor, + options?: + | (ObjectEncodingOptions & { + flag?: string | undefined; + }) + | BufferEncoding + | null + ): string | Buffer; + export type WriteFileOptions = + | (ObjectEncodingOptions & + Abortable & { + mode?: Mode | undefined; + flag?: string | undefined; + }) + | BufferEncoding + | null; + /** + * When `file` is a filename, asynchronously writes data to the file, replacing the + * file if it already exists. `data` can be a string or a buffer. + * + * When `file` is a file descriptor, the behavior is similar to calling`fs.write()` directly (which is recommended). See the notes below on using + * a file descriptor. + * + * The `encoding` option is ignored if `data` is a buffer. + * + * The `mode` option only affects the newly created file. See {@link open} for more details. + * + * ```js + * import { writeFile } from 'node:fs'; + * import { Buffer } from 'node:buffer'; + * + * const data = new Uint8Array(Buffer.from('Hello Node.js')); + * writeFile('message.txt', data, (err) => { + * if (err) throw err; + * console.log('The file has been saved!'); + * }); + * ``` + * + * If `options` is a string, then it specifies the encoding: + * + * ```js + * import { writeFile } from 'node:fs'; + * + * writeFile('message.txt', 'Hello Node.js', 'utf8', callback); + * ``` + * + * It is unsafe to use `fs.writeFile()` multiple times on the same file without + * waiting for the callback. For this scenario, {@link createWriteStream} is + * recommended. + * + * Similarly to `fs.readFile` \- `fs.writeFile` is a convenience method that + * performs multiple `write` calls internally to write the buffer passed to it. + * For performance sensitive code consider using {@link createWriteStream}. + * + * It is possible to use an `AbortSignal` to cancel an `fs.writeFile()`. + * Cancelation is "best effort", and some amount of data is likely still + * to be written. + * + * ```js + * import { writeFile } from 'node:fs'; + * import { Buffer } from 'node:buffer'; + * + * const controller = new AbortController(); + * const { signal } = controller; + * const data = new Uint8Array(Buffer.from('Hello Node.js')); + * writeFile('message.txt', data, { signal }, (err) => { + * // When a request is aborted - the callback is called with an AbortError + * }); + * // When the request should be aborted + * controller.abort(); + * ``` + * + * Aborting an ongoing request does not abort individual operating + * system requests but rather the internal buffering `fs.writeFile` performs. + * @since v0.1.29 + * @param file filename or file descriptor + */ + export function writeFile(file: PathOrFileDescriptor, data: string | NodeJS.ArrayBufferView, options: WriteFileOptions, callback: NoParamCallback): void; + /** + * Asynchronously writes data to a file, replacing the file if it already exists. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. + */ + export function writeFile(path: PathOrFileDescriptor, data: string | NodeJS.ArrayBufferView, callback: NoParamCallback): void; + export namespace writeFile { + /** + * Asynchronously writes data to a file, replacing the file if it already exists. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. + * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `mode` is not supplied, the default of `0o666` is used. + * If `mode` is a string, it is parsed as an octal integer. + * If `flag` is not supplied, the default of `'w'` is used. + */ + function __promisify__(path: PathOrFileDescriptor, data: string | NodeJS.ArrayBufferView, options?: WriteFileOptions): Promise; + } + /** + * Returns `undefined`. + * + * The `mode` option only affects the newly created file. See {@link open} for more details. + * + * For detailed information, see the documentation of the asynchronous version of + * this API: {@link writeFile}. + * @since v0.1.29 + * @param file filename or file descriptor + */ + export function writeFileSync(file: PathOrFileDescriptor, data: string | NodeJS.ArrayBufferView, options?: WriteFileOptions): void; + /** + * Asynchronously append data to a file, creating the file if it does not yet + * exist. `data` can be a string or a `Buffer`. + * + * The `mode` option only affects the newly created file. See {@link open} for more details. + * + * ```js + * import { appendFile } from 'node:fs'; + * + * appendFile('message.txt', 'data to append', (err) => { + * if (err) throw err; + * console.log('The "data to append" was appended to file!'); + * }); + * ``` + * + * If `options` is a string, then it specifies the encoding: + * + * ```js + * import { appendFile } from 'node:fs'; + * + * appendFile('message.txt', 'data to append', 'utf8', callback); + * ``` + * + * The `path` may be specified as a numeric file descriptor that has been opened + * for appending (using `fs.open()` or `fs.openSync()`). The file descriptor will + * not be closed automatically. + * + * ```js + * import { open, close, appendFile } from 'node:fs'; + * + * function closeFd(fd) { + * close(fd, (err) => { + * if (err) throw err; + * }); + * } + * + * open('message.txt', 'a', (err, fd) => { + * if (err) throw err; + * + * try { + * appendFile(fd, 'data to append', 'utf8', (err) => { + * closeFd(fd); + * if (err) throw err; + * }); + * } catch (err) { + * closeFd(fd); + * throw err; + * } + * }); + * ``` + * @since v0.6.7 + * @param path filename or file descriptor + */ + export function appendFile(path: PathOrFileDescriptor, data: string | Uint8Array, options: WriteFileOptions, callback: NoParamCallback): void; + /** + * Asynchronously append data to a file, creating the file if it does not exist. + * @param file A path to a file. If a URL is provided, it must use the `file:` protocol. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. + */ + export function appendFile(file: PathOrFileDescriptor, data: string | Uint8Array, callback: NoParamCallback): void; + export namespace appendFile { + /** + * Asynchronously append data to a file, creating the file if it does not exist. + * @param file A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. + * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `mode` is not supplied, the default of `0o666` is used. + * If `mode` is a string, it is parsed as an octal integer. + * If `flag` is not supplied, the default of `'a'` is used. + */ + function __promisify__(file: PathOrFileDescriptor, data: string | Uint8Array, options?: WriteFileOptions): Promise; + } + /** + * Synchronously append data to a file, creating the file if it does not yet + * exist. `data` can be a string or a `Buffer`. + * + * The `mode` option only affects the newly created file. See {@link open} for more details. + * + * ```js + * import { appendFileSync } from 'node:fs'; + * + * try { + * appendFileSync('message.txt', 'data to append'); + * console.log('The "data to append" was appended to file!'); + * } catch (err) { + * // Handle the error + * } + * ``` + * + * If `options` is a string, then it specifies the encoding: + * + * ```js + * import { appendFileSync } from 'node:fs'; + * + * appendFileSync('message.txt', 'data to append', 'utf8'); + * ``` + * + * The `path` may be specified as a numeric file descriptor that has been opened + * for appending (using `fs.open()` or `fs.openSync()`). The file descriptor will + * not be closed automatically. + * + * ```js + * import { openSync, closeSync, appendFileSync } from 'node:fs'; + * + * let fd; + * + * try { + * fd = openSync('message.txt', 'a'); + * appendFileSync(fd, 'data to append', 'utf8'); + * } catch (err) { + * // Handle the error + * } finally { + * if (fd !== undefined) + * closeSync(fd); + * } + * ``` + * @since v0.6.7 + * @param path filename or file descriptor + */ + export function appendFileSync(path: PathOrFileDescriptor, data: string | Uint8Array, options?: WriteFileOptions): void; + /** + * Watch for changes on `filename`. The callback `listener` will be called each + * time the file is accessed. + * + * The `options` argument may be omitted. If provided, it should be an object. The`options` object may contain a boolean named `persistent` that indicates + * whether the process should continue to run as long as files are being watched. + * The `options` object may specify an `interval` property indicating how often the + * target should be polled in milliseconds. + * + * The `listener` gets two arguments the current stat object and the previous + * stat object: + * + * ```js + * import { watchFile } from 'fs'; + * + * watchFile('message.text', (curr, prev) => { + * console.log(`the current mtime is: ${curr.mtime}`); + * console.log(`the previous mtime was: ${prev.mtime}`); + * }); + * ``` + * + * These stat objects are instances of `fs.Stat`. If the `bigint` option is `true`, + * the numeric values in these objects are specified as `BigInt`s. + * + * To be notified when the file was modified, not just accessed, it is necessary + * to compare `curr.mtimeMs` and `prev.mtimeMs`. + * + * When an `fs.watchFile` operation results in an `ENOENT` error, it + * will invoke the listener once, with all the fields zeroed (or, for dates, the + * Unix Epoch). If the file is created later on, the listener will be called + * again, with the latest stat objects. This is a change in functionality since + * v0.10. + * + * Using {@link watch} is more efficient than `fs.watchFile` and`fs.unwatchFile`. `fs.watch` should be used instead of `fs.watchFile` and`fs.unwatchFile` when possible. + * + * When a file being watched by `fs.watchFile()` disappears and reappears, + * then the contents of `previous` in the second callback event (the file's + * reappearance) will be the same as the contents of `previous` in the first + * callback event (its disappearance). + * + * This happens when: + * + * * the file is deleted, followed by a restore + * * the file is renamed and then renamed a second time back to its original name + * @since v0.1.31 + */ + export interface WatchFileOptions { + bigint?: boolean | undefined; + persistent?: boolean | undefined; + interval?: number | undefined; + } + /** + * Watch for changes on `filename`. The callback `listener` will be called each + * time the file is accessed. + * + * The `options` argument may be omitted. If provided, it should be an object. The`options` object may contain a boolean named `persistent` that indicates + * whether the process should continue to run as long as files are being watched. + * The `options` object may specify an `interval` property indicating how often the + * target should be polled in milliseconds. + * + * The `listener` gets two arguments the current stat object and the previous + * stat object: + * + * ```js + * import { watchFile } from 'node:fs'; + * + * watchFile('message.text', (curr, prev) => { + * console.log(`the current mtime is: ${curr.mtime}`); + * console.log(`the previous mtime was: ${prev.mtime}`); + * }); + * ``` + * + * These stat objects are instances of `fs.Stat`. If the `bigint` option is `true`, + * the numeric values in these objects are specified as `BigInt`s. + * + * To be notified when the file was modified, not just accessed, it is necessary + * to compare `curr.mtimeMs` and `prev.mtimeMs`. + * + * When an `fs.watchFile` operation results in an `ENOENT` error, it + * will invoke the listener once, with all the fields zeroed (or, for dates, the + * Unix Epoch). If the file is created later on, the listener will be called + * again, with the latest stat objects. This is a change in functionality since + * v0.10. + * + * Using {@link watch} is more efficient than `fs.watchFile` and`fs.unwatchFile`. `fs.watch` should be used instead of `fs.watchFile` and`fs.unwatchFile` when possible. + * + * When a file being watched by `fs.watchFile()` disappears and reappears, + * then the contents of `previous` in the second callback event (the file's + * reappearance) will be the same as the contents of `previous` in the first + * callback event (its disappearance). + * + * This happens when: + * + * * the file is deleted, followed by a restore + * * the file is renamed and then renamed a second time back to its original name + * @since v0.1.31 + */ + export function watchFile( + filename: PathLike, + options: + | (WatchFileOptions & { + bigint?: false | undefined; + }) + | undefined, + listener: StatsListener + ): StatWatcher; + export function watchFile( + filename: PathLike, + options: + | (WatchFileOptions & { + bigint: true; + }) + | undefined, + listener: BigIntStatsListener + ): StatWatcher; + /** + * Watch for changes on `filename`. The callback `listener` will be called each time the file is accessed. + * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + */ + export function watchFile(filename: PathLike, listener: StatsListener): StatWatcher; + /** + * Stop watching for changes on `filename`. If `listener` is specified, only that + * particular listener is removed. Otherwise, _all_ listeners are removed, + * effectively stopping watching of `filename`. + * + * Calling `fs.unwatchFile()` with a filename that is not being watched is a + * no-op, not an error. + * + * Using {@link watch} is more efficient than `fs.watchFile()` and`fs.unwatchFile()`. `fs.watch()` should be used instead of `fs.watchFile()`and `fs.unwatchFile()` when possible. + * @since v0.1.31 + * @param listener Optional, a listener previously attached using `fs.watchFile()` + */ + export function unwatchFile(filename: PathLike, listener?: StatsListener): void; + export function unwatchFile(filename: PathLike, listener?: BigIntStatsListener): void; + export interface WatchOptions extends Abortable { + encoding?: BufferEncoding | 'buffer' | undefined; + persistent?: boolean | undefined; + recursive?: boolean | undefined; + } + export type WatchEventType = 'rename' | 'change'; + export type WatchListener = (event: WatchEventType, filename: T | null) => void; + export type StatsListener = (curr: Stats, prev: Stats) => void; + export type BigIntStatsListener = (curr: BigIntStats, prev: BigIntStats) => void; + /** + * Watch for changes on `filename`, where `filename` is either a file or a + * directory. + * + * The second argument is optional. If `options` is provided as a string, it + * specifies the `encoding`. Otherwise `options` should be passed as an object. + * + * The listener callback gets two arguments `(eventType, filename)`. `eventType`is either `'rename'` or `'change'`, and `filename` is the name of the file + * which triggered the event. + * + * On most platforms, `'rename'` is emitted whenever a filename appears or + * disappears in the directory. + * + * The listener callback is attached to the `'change'` event fired by `fs.FSWatcher`, but it is not the same thing as the `'change'` value of`eventType`. + * + * If a `signal` is passed, aborting the corresponding AbortController will close + * the returned `fs.FSWatcher`. + * @since v0.5.10 + * @param listener + */ + export function watch( + filename: PathLike, + options: + | (WatchOptions & { + encoding: 'buffer'; + }) + | 'buffer', + listener?: WatchListener + ): FSWatcher; + /** + * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`. + * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `persistent` is not supplied, the default of `true` is used. + * If `recursive` is not supplied, the default of `false` is used. + */ + export function watch(filename: PathLike, options?: WatchOptions | BufferEncoding | null, listener?: WatchListener): FSWatcher; + /** + * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`. + * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `persistent` is not supplied, the default of `true` is used. + * If `recursive` is not supplied, the default of `false` is used. + */ + export function watch(filename: PathLike, options: WatchOptions | string, listener?: WatchListener): FSWatcher; + /** + * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`. + * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + */ + export function watch(filename: PathLike, listener?: WatchListener): FSWatcher; + /** + * Test whether or not the given path exists by checking with the file system. + * Then call the `callback` argument with either true or false: + * + * ```js + * import { exists } from 'node:fs'; + * + * exists('/etc/passwd', (e) => { + * console.log(e ? 'it exists' : 'no passwd!'); + * }); + * ``` + * + * **The parameters for this callback are not consistent with other Node.js** + * **callbacks.** Normally, the first parameter to a Node.js callback is an `err`parameter, optionally followed by other parameters. The `fs.exists()` callback + * has only one boolean parameter. This is one reason `fs.access()` is recommended + * instead of `fs.exists()`. + * + * Using `fs.exists()` to check for the existence of a file before calling`fs.open()`, `fs.readFile()`, or `fs.writeFile()` is not recommended. Doing + * so introduces a race condition, since other processes may change the file's + * state between the two calls. Instead, user code should open/read/write the + * file directly and handle the error raised if the file does not exist. + * + * **write (NOT RECOMMENDED)** + * + * ```js + * import { exists, open, close } from 'node:fs'; + * + * exists('myfile', (e) => { + * if (e) { + * console.error('myfile already exists'); + * } else { + * open('myfile', 'wx', (err, fd) => { + * if (err) throw err; + * + * try { + * writeMyData(fd); + * } finally { + * close(fd, (err) => { + * if (err) throw err; + * }); + * } + * }); + * } + * }); + * ``` + * + * **write (RECOMMENDED)** + * + * ```js + * import { open, close } from 'node:fs'; + * open('myfile', 'wx', (err, fd) => { + * if (err) { + * if (err.code === 'EEXIST') { + * console.error('myfile already exists'); + * return; + * } + * + * throw err; + * } + * + * try { + * writeMyData(fd); + * } finally { + * close(fd, (err) => { + * if (err) throw err; + * }); + * } + * }); + * ``` + * + * **read (NOT RECOMMENDED)** + * + * ```js + * import { open, close, exists } from 'node:fs'; + * + * exists('myfile', (e) => { + * if (e) { + * open('myfile', 'r', (err, fd) => { + * if (err) throw err; + * + * try { + * readMyData(fd); + * } finally { + * close(fd, (err) => { + * if (err) throw err; + * }); + * } + * }); + * } else { + * console.error('myfile does not exist'); + * } + * }); + * ``` + * + * **read (RECOMMENDED)** + * + * ```js + * import { open, close } from 'node:fs'; + * + * open('myfile', 'r', (err, fd) => { + * if (err) { + * if (err.code === 'ENOENT') { + * console.error('myfile does not exist'); + * return; + * } + * + * throw err; + * } + * + * try { + * readMyData(fd); + * } finally { + * close(fd, (err) => { + * if (err) throw err; + * }); + * } + * }); + * ``` + * + * The "not recommended" examples above check for existence and then use the + * file; the "recommended" examples are better because they use the file directly + * and handle the error, if any. + * + * In general, check for the existence of a file only if the file won't be + * used directly, for example when its existence is a signal from another + * process. + * @since v0.0.2 + * @deprecated Since v1.0.0 - Use {@link stat} or {@link access} instead. + */ + export function exists(path: PathLike, callback: (exists: boolean) => void): void; + /** @deprecated */ + export namespace exists { + /** + * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + function __promisify__(path: PathLike): Promise; + } + /** + * Returns `true` if the path exists, `false` otherwise. + * + * For detailed information, see the documentation of the asynchronous version of + * this API: {@link exists}. + * + * `fs.exists()` is deprecated, but `fs.existsSync()` is not. The `callback`parameter to `fs.exists()` accepts parameters that are inconsistent with other + * Node.js callbacks. `fs.existsSync()` does not use a callback. + * + * ```js + * import { existsSync } from 'node:fs'; + * + * if (existsSync('/etc/passwd')) + * console.log('The path exists.'); + * ``` + * @since v0.1.21 + */ + export function existsSync(path: PathLike): boolean; + export namespace constants { + // File Access Constants + /** Constant for fs.access(). File is visible to the calling process. */ + const F_OK: number; + /** Constant for fs.access(). File can be read by the calling process. */ + const R_OK: number; + /** Constant for fs.access(). File can be written by the calling process. */ + const W_OK: number; + /** Constant for fs.access(). File can be executed by the calling process. */ + const X_OK: number; + // File Copy Constants + /** Constant for fs.copyFile. Flag indicating the destination file should not be overwritten if it already exists. */ + const COPYFILE_EXCL: number; + /** + * Constant for fs.copyFile. copy operation will attempt to create a copy-on-write reflink. + * If the underlying platform does not support copy-on-write, then a fallback copy mechanism is used. + */ + const COPYFILE_FICLONE: number; + /** + * Constant for fs.copyFile. Copy operation will attempt to create a copy-on-write reflink. + * If the underlying platform does not support copy-on-write, then the operation will fail with an error. + */ + const COPYFILE_FICLONE_FORCE: number; + // File Open Constants + /** Constant for fs.open(). Flag indicating to open a file for read-only access. */ + const O_RDONLY: number; + /** Constant for fs.open(). Flag indicating to open a file for write-only access. */ + const O_WRONLY: number; + /** Constant for fs.open(). Flag indicating to open a file for read-write access. */ + const O_RDWR: number; + /** Constant for fs.open(). Flag indicating to create the file if it does not already exist. */ + const O_CREAT: number; + /** Constant for fs.open(). Flag indicating that opening a file should fail if the O_CREAT flag is set and the file already exists. */ + const O_EXCL: number; + /** + * Constant for fs.open(). Flag indicating that if path identifies a terminal device, + * opening the path shall not cause that terminal to become the controlling terminal for the process + * (if the process does not already have one). + */ + const O_NOCTTY: number; + /** Constant for fs.open(). Flag indicating that if the file exists and is a regular file, and the file is opened successfully for write access, its length shall be truncated to zero. */ + const O_TRUNC: number; + /** Constant for fs.open(). Flag indicating that data will be appended to the end of the file. */ + const O_APPEND: number; + /** Constant for fs.open(). Flag indicating that the open should fail if the path is not a directory. */ + const O_DIRECTORY: number; + /** + * constant for fs.open(). + * Flag indicating reading accesses to the file system will no longer result in + * an update to the atime information associated with the file. + * This flag is available on Linux operating systems only. + */ + const O_NOATIME: number; + /** Constant for fs.open(). Flag indicating that the open should fail if the path is a symbolic link. */ + const O_NOFOLLOW: number; + /** Constant for fs.open(). Flag indicating that the file is opened for synchronous I/O. */ + const O_SYNC: number; + /** Constant for fs.open(). Flag indicating that the file is opened for synchronous I/O with write operations waiting for data integrity. */ + const O_DSYNC: number; + /** Constant for fs.open(). Flag indicating to open the symbolic link itself rather than the resource it is pointing to. */ + const O_SYMLINK: number; + /** Constant for fs.open(). When set, an attempt will be made to minimize caching effects of file I/O. */ + const O_DIRECT: number; + /** Constant for fs.open(). Flag indicating to open the file in nonblocking mode when possible. */ + const O_NONBLOCK: number; + // File Type Constants + /** Constant for fs.Stats mode property for determining a file's type. Bit mask used to extract the file type code. */ + const S_IFMT: number; + /** Constant for fs.Stats mode property for determining a file's type. File type constant for a regular file. */ + const S_IFREG: number; + /** Constant for fs.Stats mode property for determining a file's type. File type constant for a directory. */ + const S_IFDIR: number; + /** Constant for fs.Stats mode property for determining a file's type. File type constant for a character-oriented device file. */ + const S_IFCHR: number; + /** Constant for fs.Stats mode property for determining a file's type. File type constant for a block-oriented device file. */ + const S_IFBLK: number; + /** Constant for fs.Stats mode property for determining a file's type. File type constant for a FIFO/pipe. */ + const S_IFIFO: number; + /** Constant for fs.Stats mode property for determining a file's type. File type constant for a symbolic link. */ + const S_IFLNK: number; + /** Constant for fs.Stats mode property for determining a file's type. File type constant for a socket. */ + const S_IFSOCK: number; + // File Mode Constants + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable, writable and executable by owner. */ + const S_IRWXU: number; + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable by owner. */ + const S_IRUSR: number; + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating writable by owner. */ + const S_IWUSR: number; + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating executable by owner. */ + const S_IXUSR: number; + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable, writable and executable by group. */ + const S_IRWXG: number; + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable by group. */ + const S_IRGRP: number; + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating writable by group. */ + const S_IWGRP: number; + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating executable by group. */ + const S_IXGRP: number; + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable, writable and executable by others. */ + const S_IRWXO: number; + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable by others. */ + const S_IROTH: number; + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating writable by others. */ + const S_IWOTH: number; + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating executable by others. */ + const S_IXOTH: number; + /** + * When set, a memory file mapping is used to access the file. This flag + * is available on Windows operating systems only. On other operating systems, + * this flag is ignored. + */ + const UV_FS_O_FILEMAP: number; + } + /** + * Tests a user's permissions for the file or directory specified by `path`. + * The `mode` argument is an optional integer that specifies the accessibility + * checks to be performed. `mode` should be either the value `fs.constants.F_OK`or a mask consisting of the bitwise OR of any of `fs.constants.R_OK`,`fs.constants.W_OK`, and `fs.constants.X_OK` + * (e.g.`fs.constants.W_OK | fs.constants.R_OK`). Check `File access constants` for + * possible values of `mode`. + * + * The final argument, `callback`, is a callback function that is invoked with + * a possible error argument. If any of the accessibility checks fail, the error + * argument will be an `Error` object. The following examples check if`package.json` exists, and if it is readable or writable. + * + * ```js + * import { access, constants } from 'node:fs'; + * + * const file = 'package.json'; + * + * // Check if the file exists in the current directory. + * access(file, constants.F_OK, (err) => { + * console.log(`${file} ${err ? 'does not exist' : 'exists'}`); + * }); + * + * // Check if the file is readable. + * access(file, constants.R_OK, (err) => { + * console.log(`${file} ${err ? 'is not readable' : 'is readable'}`); + * }); + * + * // Check if the file is writable. + * access(file, constants.W_OK, (err) => { + * console.log(`${file} ${err ? 'is not writable' : 'is writable'}`); + * }); + * + * // Check if the file is readable and writable. + * access(file, constants.R_OK | constants.W_OK, (err) => { + * console.log(`${file} ${err ? 'is not' : 'is'} readable and writable`); + * }); + * ``` + * + * Do not use `fs.access()` to check for the accessibility of a file before calling`fs.open()`, `fs.readFile()`, or `fs.writeFile()`. Doing + * so introduces a race condition, since other processes may change the file's + * state between the two calls. Instead, user code should open/read/write the + * file directly and handle the error raised if the file is not accessible. + * + * **write (NOT RECOMMENDED)** + * + * ```js + * import { access, open, close } from 'node:fs'; + * + * access('myfile', (err) => { + * if (!err) { + * console.error('myfile already exists'); + * return; + * } + * + * open('myfile', 'wx', (err, fd) => { + * if (err) throw err; + * + * try { + * writeMyData(fd); + * } finally { + * close(fd, (err) => { + * if (err) throw err; + * }); + * } + * }); + * }); + * ``` + * + * **write (RECOMMENDED)** + * + * ```js + * import { open, close } from 'node:fs'; + * + * open('myfile', 'wx', (err, fd) => { + * if (err) { + * if (err.code === 'EEXIST') { + * console.error('myfile already exists'); + * return; + * } + * + * throw err; + * } + * + * try { + * writeMyData(fd); + * } finally { + * close(fd, (err) => { + * if (err) throw err; + * }); + * } + * }); + * ``` + * + * **read (NOT RECOMMENDED)** + * + * ```js + * import { access, open, close } from 'node:fs'; + * access('myfile', (err) => { + * if (err) { + * if (err.code === 'ENOENT') { + * console.error('myfile does not exist'); + * return; + * } + * + * throw err; + * } + * + * open('myfile', 'r', (err, fd) => { + * if (err) throw err; + * + * try { + * readMyData(fd); + * } finally { + * close(fd, (err) => { + * if (err) throw err; + * }); + * } + * }); + * }); + * ``` + * + * **read (RECOMMENDED)** + * + * ```js + * import { open, close } from 'node:fs'; + * + * open('myfile', 'r', (err, fd) => { + * if (err) { + * if (err.code === 'ENOENT') { + * console.error('myfile does not exist'); + * return; + * } + * + * throw err; + * } + * + * try { + * readMyData(fd); + * } finally { + * close(fd, (err) => { + * if (err) throw err; + * }); + * } + * }); + * ``` + * + * The "not recommended" examples above check for accessibility and then use the + * file; the "recommended" examples are better because they use the file directly + * and handle the error, if any. + * + * In general, check for the accessibility of a file only if the file will not be + * used directly, for example when its accessibility is a signal from another + * process. + * + * On Windows, access-control policies (ACLs) on a directory may limit access to + * a file or directory. The `fs.access()` function, however, does not check the + * ACL and therefore may report that a path is accessible even if the ACL restricts + * the user from reading or writing to it. + * @since v0.11.15 + * @param [mode=fs.constants.F_OK] + */ + export function access(path: PathLike, mode: number | undefined, callback: NoParamCallback): void; + /** + * Asynchronously tests a user's permissions for the file specified by path. + * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + */ + export function access(path: PathLike, callback: NoParamCallback): void; + export namespace access { + /** + * Asynchronously tests a user's permissions for the file specified by path. + * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + function __promisify__(path: PathLike, mode?: number): Promise; + } + /** + * Synchronously tests a user's permissions for the file or directory specified + * by `path`. The `mode` argument is an optional integer that specifies the + * accessibility checks to be performed. `mode` should be either the value`fs.constants.F_OK` or a mask consisting of the bitwise OR of any of`fs.constants.R_OK`, `fs.constants.W_OK`, and + * `fs.constants.X_OK` (e.g.`fs.constants.W_OK | fs.constants.R_OK`). Check `File access constants` for + * possible values of `mode`. + * + * If any of the accessibility checks fail, an `Error` will be thrown. Otherwise, + * the method will return `undefined`. + * + * ```js + * import { accessSync, constants } from 'node:fs'; + * + * try { + * accessSync('etc/passwd', constants.R_OK | constants.W_OK); + * console.log('can read/write'); + * } catch (err) { + * console.error('no access!'); + * } + * ``` + * @since v0.11.15 + * @param [mode=fs.constants.F_OK] + */ + export function accessSync(path: PathLike, mode?: number): void; + interface StreamOptions { + flags?: string | undefined; + encoding?: BufferEncoding | undefined; + fd?: number | promises.FileHandle | undefined; + mode?: number | undefined; + autoClose?: boolean | undefined; + emitClose?: boolean | undefined; + start?: number | undefined; + signal?: AbortSignal | null | undefined; + highWaterMark?: number | undefined; + } + interface FSImplementation { + open?: (...args: any[]) => any; + close?: (...args: any[]) => any; + } + interface CreateReadStreamFSImplementation extends FSImplementation { + read: (...args: any[]) => any; + } + interface CreateWriteStreamFSImplementation extends FSImplementation { + write: (...args: any[]) => any; + writev?: (...args: any[]) => any; + } + interface ReadStreamOptions extends StreamOptions { + fs?: CreateReadStreamFSImplementation | null | undefined; + end?: number | undefined; + } + interface WriteStreamOptions extends StreamOptions { + fs?: CreateWriteStreamFSImplementation | null | undefined; + } + /** + * Unlike the 16 KiB default `highWaterMark` for a `stream.Readable`, the stream + * returned by this method has a default `highWaterMark` of 64 KiB. + * + * `options` can include `start` and `end` values to read a range of bytes from + * the file instead of the entire file. Both `start` and `end` are inclusive and + * start counting at 0, allowed values are in the + * \[0, [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER)\] range. If `fd` is specified and `start` is + * omitted or `undefined`, `fs.createReadStream()` reads sequentially from the + * current file position. The `encoding` can be any one of those accepted by `Buffer`. + * + * If `fd` is specified, `ReadStream` will ignore the `path` argument and will use + * the specified file descriptor. This means that no `'open'` event will be + * emitted. `fd` should be blocking; non-blocking `fd`s should be passed to `net.Socket`. + * + * If `fd` points to a character device that only supports blocking reads + * (such as keyboard or sound card), read operations do not finish until data is + * available. This can prevent the process from exiting and the stream from + * closing naturally. + * + * By default, the stream will emit a `'close'` event after it has been + * destroyed. Set the `emitClose` option to `false` to change this behavior. + * + * By providing the `fs` option, it is possible to override the corresponding `fs`implementations for `open`, `read`, and `close`. When providing the `fs` option, + * an override for `read` is required. If no `fd` is provided, an override for`open` is also required. If `autoClose` is `true`, an override for `close` is + * also required. + * + * ```js + * import { createReadStream } from 'node:fs'; + * + * // Create a stream from some character device. + * const stream = createReadStream('/dev/input/event0'); + * setTimeout(() => { + * stream.close(); // This may not close the stream. + * // Artificially marking end-of-stream, as if the underlying resource had + * // indicated end-of-file by itself, allows the stream to close. + * // This does not cancel pending read operations, and if there is such an + * // operation, the process may still not be able to exit successfully + * // until it finishes. + * stream.push(null); + * stream.read(0); + * }, 100); + * ``` + * + * If `autoClose` is false, then the file descriptor won't be closed, even if + * there's an error. It is the application's responsibility to close it and make + * sure there's no file descriptor leak. If `autoClose` is set to true (default + * behavior), on `'error'` or `'end'` the file descriptor will be closed + * automatically. + * + * `mode` sets the file mode (permission and sticky bits), but only if the + * file was created. + * + * An example to read the last 10 bytes of a file which is 100 bytes long: + * + * ```js + * import { createReadStream } from 'node:fs'; + * + * createReadStream('sample.txt', { start: 90, end: 99 }); + * ``` + * + * If `options` is a string, then it specifies the encoding. + * @since v0.1.31 + */ + export function createReadStream(path: PathLike, options?: BufferEncoding | ReadStreamOptions): ReadStream; + /** + * `options` may also include a `start` option to allow writing data at some + * position past the beginning of the file, allowed values are in the + * \[0, [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER)\] range. Modifying a file rather than + * replacing it may require the `flags` option to be set to `r+` rather than the + * default `w`. The `encoding` can be any one of those accepted by `Buffer`. + * + * If `autoClose` is set to true (default behavior) on `'error'` or `'finish'`the file descriptor will be closed automatically. If `autoClose` is false, + * then the file descriptor won't be closed, even if there's an error. + * It is the application's responsibility to close it and make sure there's no + * file descriptor leak. + * + * By default, the stream will emit a `'close'` event after it has been + * destroyed. Set the `emitClose` option to `false` to change this behavior. + * + * By providing the `fs` option it is possible to override the corresponding `fs`implementations for `open`, `write`, `writev`, and `close`. Overriding `write()`without `writev()` can reduce + * performance as some optimizations (`_writev()`) + * will be disabled. When providing the `fs` option, overrides for at least one of`write` and `writev` are required. If no `fd` option is supplied, an override + * for `open` is also required. If `autoClose` is `true`, an override for `close`is also required. + * + * Like `fs.ReadStream`, if `fd` is specified, `fs.WriteStream` will ignore the`path` argument and will use the specified file descriptor. This means that no`'open'` event will be + * emitted. `fd` should be blocking; non-blocking `fd`s + * should be passed to `net.Socket`. + * + * If `options` is a string, then it specifies the encoding. + * @since v0.1.31 + */ + export function createWriteStream(path: PathLike, options?: BufferEncoding | WriteStreamOptions): WriteStream; + /** + * Forces all currently queued I/O operations associated with the file to the + * operating system's synchronized I/O completion state. Refer to the POSIX [`fdatasync(2)`](http://man7.org/linux/man-pages/man2/fdatasync.2.html) documentation for details. No arguments other + * than a possible + * exception are given to the completion callback. + * @since v0.1.96 + */ + export function fdatasync(fd: number, callback: NoParamCallback): void; + export namespace fdatasync { + /** + * Asynchronous fdatasync(2) - synchronize a file's in-core state with storage device. + * @param fd A file descriptor. + */ + function __promisify__(fd: number): Promise; + } + /** + * Forces all currently queued I/O operations associated with the file to the + * operating system's synchronized I/O completion state. Refer to the POSIX [`fdatasync(2)`](http://man7.org/linux/man-pages/man2/fdatasync.2.html) documentation for details. Returns `undefined`. + * @since v0.1.96 + */ + export function fdatasyncSync(fd: number): void; + /** + * Asynchronously copies `src` to `dest`. By default, `dest` is overwritten if it + * already exists. No arguments other than a possible exception are given to the + * callback function. Node.js makes no guarantees about the atomicity of the copy + * operation. If an error occurs after the destination file has been opened for + * writing, Node.js will attempt to remove the destination. + * + * `mode` is an optional integer that specifies the behavior + * of the copy operation. It is possible to create a mask consisting of the bitwise + * OR of two or more values (e.g.`fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE`). + * + * * `fs.constants.COPYFILE_EXCL`: The copy operation will fail if `dest` already + * exists. + * * `fs.constants.COPYFILE_FICLONE`: The copy operation will attempt to create a + * copy-on-write reflink. If the platform does not support copy-on-write, then a + * fallback copy mechanism is used. + * * `fs.constants.COPYFILE_FICLONE_FORCE`: The copy operation will attempt to + * create a copy-on-write reflink. If the platform does not support + * copy-on-write, then the operation will fail. + * + * ```js + * import { copyFile, constants } from 'node:fs'; + * + * function callback(err) { + * if (err) throw err; + * console.log('source.txt was copied to destination.txt'); + * } + * + * // destination.txt will be created or overwritten by default. + * copyFile('source.txt', 'destination.txt', callback); + * + * // By using COPYFILE_EXCL, the operation will fail if destination.txt exists. + * copyFile('source.txt', 'destination.txt', constants.COPYFILE_EXCL, callback); + * ``` + * @since v8.5.0 + * @param src source filename to copy + * @param dest destination filename of the copy operation + * @param [mode=0] modifiers for copy operation. + */ + export function copyFile(src: PathLike, dest: PathLike, callback: NoParamCallback): void; + export function copyFile(src: PathLike, dest: PathLike, mode: number, callback: NoParamCallback): void; + export namespace copyFile { + function __promisify__(src: PathLike, dst: PathLike, mode?: number): Promise; + } + /** + * Synchronously copies `src` to `dest`. By default, `dest` is overwritten if it + * already exists. Returns `undefined`. Node.js makes no guarantees about the + * atomicity of the copy operation. If an error occurs after the destination file + * has been opened for writing, Node.js will attempt to remove the destination. + * + * `mode` is an optional integer that specifies the behavior + * of the copy operation. It is possible to create a mask consisting of the bitwise + * OR of two or more values (e.g.`fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE`). + * + * * `fs.constants.COPYFILE_EXCL`: The copy operation will fail if `dest` already + * exists. + * * `fs.constants.COPYFILE_FICLONE`: The copy operation will attempt to create a + * copy-on-write reflink. If the platform does not support copy-on-write, then a + * fallback copy mechanism is used. + * * `fs.constants.COPYFILE_FICLONE_FORCE`: The copy operation will attempt to + * create a copy-on-write reflink. If the platform does not support + * copy-on-write, then the operation will fail. + * + * ```js + * import { copyFileSync, constants } from 'node:fs'; + * + * // destination.txt will be created or overwritten by default. + * copyFileSync('source.txt', 'destination.txt'); + * console.log('source.txt was copied to destination.txt'); + * + * // By using COPYFILE_EXCL, the operation will fail if destination.txt exists. + * copyFileSync('source.txt', 'destination.txt', constants.COPYFILE_EXCL); + * ``` + * @since v8.5.0 + * @param src source filename to copy + * @param dest destination filename of the copy operation + * @param [mode=0] modifiers for copy operation. + */ + export function copyFileSync(src: PathLike, dest: PathLike, mode?: number): void; + /** + * Write an array of `ArrayBufferView`s to the file specified by `fd` using`writev()`. + * + * `position` is the offset from the beginning of the file where this data + * should be written. If `typeof position !== 'number'`, the data will be written + * at the current position. + * + * The callback will be given three arguments: `err`, `bytesWritten`, and`buffers`. `bytesWritten` is how many bytes were written from `buffers`. + * + * If this method is `util.promisify()` ed, it returns a promise for an`Object` with `bytesWritten` and `buffers` properties. + * + * It is unsafe to use `fs.writev()` multiple times on the same file without + * waiting for the callback. For this scenario, use {@link createWriteStream}. + * + * On Linux, positional writes don't work when the file is opened in append mode. + * The kernel ignores the position argument and always appends the data to + * the end of the file. + * @since v12.9.0 + * @param [position='null'] + */ + export function writev(fd: number, buffers: ReadonlyArray, cb: (err: NodeJS.ErrnoException | null, bytesWritten: number, buffers: NodeJS.ArrayBufferView[]) => void): void; + export function writev( + fd: number, + buffers: ReadonlyArray, + position: number, + cb: (err: NodeJS.ErrnoException | null, bytesWritten: number, buffers: NodeJS.ArrayBufferView[]) => void + ): void; + export interface WriteVResult { + bytesWritten: number; + buffers: NodeJS.ArrayBufferView[]; + } + export namespace writev { + function __promisify__(fd: number, buffers: ReadonlyArray, position?: number): Promise; + } + /** + * For detailed information, see the documentation of the asynchronous version of + * this API: {@link writev}. + * @since v12.9.0 + * @param [position='null'] + * @return The number of bytes written. + */ + export function writevSync(fd: number, buffers: ReadonlyArray, position?: number): number; + /** + * Read from a file specified by `fd` and write to an array of `ArrayBufferView`s + * using `readv()`. + * + * `position` is the offset from the beginning of the file from where data + * should be read. If `typeof position !== 'number'`, the data will be read + * from the current position. + * + * The callback will be given three arguments: `err`, `bytesRead`, and`buffers`. `bytesRead` is how many bytes were read from the file. + * + * If this method is invoked as its `util.promisify()` ed version, it returns + * a promise for an `Object` with `bytesRead` and `buffers` properties. + * @since v13.13.0, v12.17.0 + * @param [position='null'] + */ + export function readv(fd: number, buffers: ReadonlyArray, cb: (err: NodeJS.ErrnoException | null, bytesRead: number, buffers: NodeJS.ArrayBufferView[]) => void): void; + export function readv( + fd: number, + buffers: ReadonlyArray, + position: number, + cb: (err: NodeJS.ErrnoException | null, bytesRead: number, buffers: NodeJS.ArrayBufferView[]) => void + ): void; + export interface ReadVResult { + bytesRead: number; + buffers: NodeJS.ArrayBufferView[]; + } + export namespace readv { + function __promisify__(fd: number, buffers: ReadonlyArray, position?: number): Promise; + } + /** + * For detailed information, see the documentation of the asynchronous version of + * this API: {@link readv}. + * @since v13.13.0, v12.17.0 + * @param [position='null'] + * @return The number of bytes read. + */ + export function readvSync(fd: number, buffers: ReadonlyArray, position?: number): number; + + export interface OpenAsBlobOptions { + /** + * An optional mime type for the blob. + * + * @default 'undefined' + */ + type?: string | undefined; + } + + /** + * Returns a `Blob` whose data is backed by the given file. + * + * The file must not be modified after the `Blob` is created. Any modifications + * will cause reading the `Blob` data to fail with a `DOMException` error. + * Synchronous stat operations on the file when the `Blob` is created, and before + * each read in order to detect whether the file data has been modified on disk. + * + * ```js + * import { openAsBlob } from 'node:fs'; + * + * const blob = await openAsBlob('the.file.txt'); + * const ab = await blob.arrayBuffer(); + * blob.stream(); + * ``` + * @since v19.8.0 + * @experimental + */ + export function openAsBlob(path: PathLike, options?: OpenAsBlobOptions): Promise; + + export interface OpenDirOptions { + /** + * @default 'utf8' + */ + encoding?: BufferEncoding | undefined; + /** + * Number of directory entries that are buffered + * internally when reading from the directory. Higher values lead to better + * performance but higher memory usage. + * @default 32 + */ + bufferSize?: number | undefined; + /** + * @default false + */ + recursive?: boolean; + } + /** + * Synchronously open a directory. See [`opendir(3)`](http://man7.org/linux/man-pages/man3/opendir.3.html). + * + * Creates an `fs.Dir`, which contains all further functions for reading from + * and cleaning up the directory. + * + * The `encoding` option sets the encoding for the `path` while opening the + * directory and subsequent read operations. + * @since v12.12.0 + */ + export function opendirSync(path: PathLike, options?: OpenDirOptions): Dir; + /** + * Asynchronously open a directory. See the POSIX [`opendir(3)`](http://man7.org/linux/man-pages/man3/opendir.3.html) documentation for + * more details. + * + * Creates an `fs.Dir`, which contains all further functions for reading from + * and cleaning up the directory. + * + * The `encoding` option sets the encoding for the `path` while opening the + * directory and subsequent read operations. + * @since v12.12.0 + */ + export function opendir(path: PathLike, cb: (err: NodeJS.ErrnoException | null, dir: Dir) => void): void; + export function opendir(path: PathLike, options: OpenDirOptions, cb: (err: NodeJS.ErrnoException | null, dir: Dir) => void): void; + export namespace opendir { + function __promisify__(path: PathLike, options?: OpenDirOptions): Promise; + } + export interface BigIntStats extends StatsBase { + atimeNs: bigint; + mtimeNs: bigint; + ctimeNs: bigint; + birthtimeNs: bigint; + } + export interface BigIntOptions { + bigint: true; + } + export interface StatOptions { + bigint?: boolean | undefined; + } + export interface StatSyncOptions extends StatOptions { + throwIfNoEntry?: boolean | undefined; + } + interface CopyOptionsBase { + /** + * Dereference symlinks + * @default false + */ + dereference?: boolean; + /** + * When `force` is `false`, and the destination + * exists, throw an error. + * @default false + */ + errorOnExist?: boolean; + /** + * Overwrite existing file or directory. _The copy + * operation will ignore errors if you set this to false and the destination + * exists. Use the `errorOnExist` option to change this behavior. + * @default true + */ + force?: boolean; + /** + * Modifiers for copy operation. See `mode` flag of {@link copyFileSync()} + */ + mode?: number; + /** + * When `true` timestamps from `src` will + * be preserved. + * @default false + */ + preserveTimestamps?: boolean; + /** + * Copy directories recursively. + * @default false + */ + recursive?: boolean; + /** + * When true, path resolution for symlinks will be skipped + * @default false + */ + verbatimSymlinks?: boolean; + } + export interface CopyOptions extends CopyOptionsBase { + /** + * Function to filter copied files/directories. Return + * `true` to copy the item, `false` to ignore it. + */ + filter?(source: string, destination: string): boolean | Promise; + } + export interface CopySyncOptions extends CopyOptionsBase { + /** + * Function to filter copied files/directories. Return + * `true` to copy the item, `false` to ignore it. + */ + filter?(source: string, destination: string): boolean; + } + /** + * Asynchronously copies the entire directory structure from `src` to `dest`, + * including subdirectories and files. + * + * When copying a directory to another directory, globs are not supported and + * behavior is similar to `cp dir1/ dir2/`. + * @since v16.7.0 + * @experimental + * @param src source path to copy. + * @param dest destination path to copy to. + */ + export function cp(source: string | URL, destination: string | URL, callback: (err: NodeJS.ErrnoException | null) => void): void; + export function cp(source: string | URL, destination: string | URL, opts: CopyOptions, callback: (err: NodeJS.ErrnoException | null) => void): void; + /** + * Synchronously copies the entire directory structure from `src` to `dest`, + * including subdirectories and files. + * + * When copying a directory to another directory, globs are not supported and + * behavior is similar to `cp dir1/ dir2/`. + * @since v16.7.0 + * @experimental + * @param src source path to copy. + * @param dest destination path to copy to. + */ + export function cpSync(source: string | URL, destination: string | URL, opts?: CopySyncOptions): void; +} +declare module 'fs' { + export * from 'node:fs'; +} diff --git a/node_modules/@types/node/ts4.8/fs/promises.d.ts b/node_modules/@types/node/ts4.8/fs/promises.d.ts new file mode 100644 index 0000000..cec8322 --- /dev/null +++ b/node_modules/@types/node/ts4.8/fs/promises.d.ts @@ -0,0 +1,1203 @@ +/** + * The `fs/promises` API provides asynchronous file system methods that return + * promises. + * + * The promise APIs use the underlying Node.js threadpool to perform file + * system operations off the event loop thread. These operations are not + * synchronized or threadsafe. Care must be taken when performing multiple + * concurrent modifications on the same file or data corruption may occur. + * @since v10.0.0 + */ +declare module 'node:fs/promises' { + import { Abortable } from 'node:events'; + import { Stream } from 'node:stream'; + import { ReadableStream } from 'node:stream/web'; + import { + BigIntStats, + BigIntStatsFs, + BufferEncodingOption, + constants as fsConstants, + CopyOptions, + Dir, + Dirent, + MakeDirectoryOptions, + Mode, + ObjectEncodingOptions, + OpenDirOptions, + OpenMode, + PathLike, + ReadStream, + ReadVResult, + RmDirOptions, + RmOptions, + StatOptions, + StatFsOptions, + Stats, + StatsFs, + TimeLike, + WatchEventType, + WatchOptions, + WriteStream, + WriteVResult, + } from 'node:fs'; + import { Interface as ReadlineInterface } from 'node:readline'; + interface FileChangeInfo { + eventType: WatchEventType; + filename: T | null; + } + interface FlagAndOpenMode { + mode?: Mode | undefined; + flag?: OpenMode | undefined; + } + interface FileReadResult { + bytesRead: number; + buffer: T; + } + interface FileReadOptions { + /** + * @default `Buffer.alloc(0xffff)` + */ + buffer?: T; + /** + * @default 0 + */ + offset?: number | null; + /** + * @default `buffer.byteLength` + */ + length?: number | null; + position?: number | null; + } + interface CreateReadStreamOptions { + encoding?: BufferEncoding | null | undefined; + autoClose?: boolean | undefined; + emitClose?: boolean | undefined; + start?: number | undefined; + end?: number | undefined; + highWaterMark?: number | undefined; + } + interface CreateWriteStreamOptions { + encoding?: BufferEncoding | null | undefined; + autoClose?: boolean | undefined; + emitClose?: boolean | undefined; + start?: number | undefined; + highWaterMark?: number | undefined; + } + interface ReadableWebStreamOptions { + /** + * Whether to open a normal or a `'bytes'` stream. + * @since v20.0.0 + */ + type?: 'bytes' | undefined; + } + // TODO: Add `EventEmitter` close + interface FileHandle { + /** + * The numeric file descriptor managed by the {FileHandle} object. + * @since v10.0.0 + */ + readonly fd: number; + /** + * Alias of `filehandle.writeFile()`. + * + * When operating on file handles, the mode cannot be changed from what it was set + * to with `fsPromises.open()`. Therefore, this is equivalent to `filehandle.writeFile()`. + * @since v10.0.0 + * @return Fulfills with `undefined` upon success. + */ + appendFile(data: string | Uint8Array, options?: (ObjectEncodingOptions & FlagAndOpenMode) | BufferEncoding | null): Promise; + /** + * Changes the ownership of the file. A wrapper for [`chown(2)`](http://man7.org/linux/man-pages/man2/chown.2.html). + * @since v10.0.0 + * @param uid The file's new owner's user id. + * @param gid The file's new group's group id. + * @return Fulfills with `undefined` upon success. + */ + chown(uid: number, gid: number): Promise; + /** + * Modifies the permissions on the file. See [`chmod(2)`](http://man7.org/linux/man-pages/man2/chmod.2.html). + * @since v10.0.0 + * @param mode the file mode bit mask. + * @return Fulfills with `undefined` upon success. + */ + chmod(mode: Mode): Promise; + /** + * Unlike the 16 KiB default `highWaterMark` for a `stream.Readable`, the stream + * returned by this method has a default `highWaterMark` of 64 KiB. + * + * `options` can include `start` and `end` values to read a range of bytes from + * the file instead of the entire file. Both `start` and `end` are inclusive and + * start counting at 0, allowed values are in the + * \[0, [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER)\] range. If `start` is + * omitted or `undefined`, `filehandle.createReadStream()` reads sequentially from + * the current file position. The `encoding` can be any one of those accepted by `Buffer`. + * + * If the `FileHandle` points to a character device that only supports blocking + * reads (such as keyboard or sound card), read operations do not finish until data + * is available. This can prevent the process from exiting and the stream from + * closing naturally. + * + * By default, the stream will emit a `'close'` event after it has been + * destroyed. Set the `emitClose` option to `false` to change this behavior. + * + * ```js + * import { open } from 'node:fs/promises'; + * + * const fd = await open('/dev/input/event0'); + * // Create a stream from some character device. + * const stream = fd.createReadStream(); + * setTimeout(() => { + * stream.close(); // This may not close the stream. + * // Artificially marking end-of-stream, as if the underlying resource had + * // indicated end-of-file by itself, allows the stream to close. + * // This does not cancel pending read operations, and if there is such an + * // operation, the process may still not be able to exit successfully + * // until it finishes. + * stream.push(null); + * stream.read(0); + * }, 100); + * ``` + * + * If `autoClose` is false, then the file descriptor won't be closed, even if + * there's an error. It is the application's responsibility to close it and make + * sure there's no file descriptor leak. If `autoClose` is set to true (default + * behavior), on `'error'` or `'end'` the file descriptor will be closed + * automatically. + * + * An example to read the last 10 bytes of a file which is 100 bytes long: + * + * ```js + * import { open } from 'node:fs/promises'; + * + * const fd = await open('sample.txt'); + * fd.createReadStream({ start: 90, end: 99 }); + * ``` + * @since v16.11.0 + */ + createReadStream(options?: CreateReadStreamOptions): ReadStream; + /** + * `options` may also include a `start` option to allow writing data at some + * position past the beginning of the file, allowed values are in the + * \[0, [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER)\] range. Modifying a file rather than + * replacing it may require the `flags` `open` option to be set to `r+` rather than + * the default `r`. The `encoding` can be any one of those accepted by `Buffer`. + * + * If `autoClose` is set to true (default behavior) on `'error'` or `'finish'`the file descriptor will be closed automatically. If `autoClose` is false, + * then the file descriptor won't be closed, even if there's an error. + * It is the application's responsibility to close it and make sure there's no + * file descriptor leak. + * + * By default, the stream will emit a `'close'` event after it has been + * destroyed. Set the `emitClose` option to `false` to change this behavior. + * @since v16.11.0 + */ + createWriteStream(options?: CreateWriteStreamOptions): WriteStream; + /** + * Forces all currently queued I/O operations associated with the file to the + * operating system's synchronized I/O completion state. Refer to the POSIX [`fdatasync(2)`](http://man7.org/linux/man-pages/man2/fdatasync.2.html) documentation for details. + * + * Unlike `filehandle.sync` this method does not flush modified metadata. + * @since v10.0.0 + * @return Fulfills with `undefined` upon success. + */ + datasync(): Promise; + /** + * Request that all data for the open file descriptor is flushed to the storage + * device. The specific implementation is operating system and device specific. + * Refer to the POSIX [`fsync(2)`](http://man7.org/linux/man-pages/man2/fsync.2.html) documentation for more detail. + * @since v10.0.0 + * @return Fulfills with `undefined` upon success. + */ + sync(): Promise; + /** + * Reads data from the file and stores that in the given buffer. + * + * If the file is not modified concurrently, the end-of-file is reached when the + * number of bytes read is zero. + * @since v10.0.0 + * @param buffer A buffer that will be filled with the file data read. + * @param offset The location in the buffer at which to start filling. + * @param length The number of bytes to read. + * @param position The location where to begin reading data from the file. If `null`, data will be read from the current file position, and the position will be updated. If `position` is an + * integer, the current file position will remain unchanged. + * @return Fulfills upon success with an object with two properties: + */ + read(buffer: T, offset?: number | null, length?: number | null, position?: number | null): Promise>; + read(options?: FileReadOptions): Promise>; + /** + * Returns a `ReadableStream` that may be used to read the files data. + * + * An error will be thrown if this method is called more than once or is called + * after the `FileHandle` is closed or closing. + * + * ```js + * import { + * open, + * } from 'node:fs/promises'; + * + * const file = await open('./some/file/to/read'); + * + * for await (const chunk of file.readableWebStream()) + * console.log(chunk); + * + * await file.close(); + * ``` + * + * While the `ReadableStream` will read the file to completion, it will not + * close the `FileHandle` automatically. User code must still call the`fileHandle.close()` method. + * @since v17.0.0 + * @experimental + */ + readableWebStream(options?: ReadableWebStreamOptions): ReadableStream; + /** + * Asynchronously reads the entire contents of a file. + * + * If `options` is a string, then it specifies the `encoding`. + * + * The `FileHandle` has to support reading. + * + * If one or more `filehandle.read()` calls are made on a file handle and then a`filehandle.readFile()` call is made, the data will be read from the current + * position till the end of the file. It doesn't always read from the beginning + * of the file. + * @since v10.0.0 + * @return Fulfills upon a successful read with the contents of the file. If no encoding is specified (using `options.encoding`), the data is returned as a {Buffer} object. Otherwise, the + * data will be a string. + */ + readFile( + options?: { + encoding?: null | undefined; + flag?: OpenMode | undefined; + } | null + ): Promise; + /** + * Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically. + * The `FileHandle` must have been opened for reading. + * @param options An object that may contain an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + readFile( + options: + | { + encoding: BufferEncoding; + flag?: OpenMode | undefined; + } + | BufferEncoding + ): Promise; + /** + * Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically. + * The `FileHandle` must have been opened for reading. + * @param options An object that may contain an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + readFile( + options?: + | (ObjectEncodingOptions & { + flag?: OpenMode | undefined; + }) + | BufferEncoding + | null + ): Promise; + /** + * Convenience method to create a `readline` interface and stream over the file. + * See `filehandle.createReadStream()` for the options. + * + * ```js + * import { open } from 'node:fs/promises'; + * + * const file = await open('./some/file/to/read'); + * + * for await (const line of file.readLines()) { + * console.log(line); + * } + * ``` + * @since v18.11.0 + */ + readLines(options?: CreateReadStreamOptions): ReadlineInterface; + /** + * @since v10.0.0 + * @return Fulfills with an {fs.Stats} for the file. + */ + stat( + opts?: StatOptions & { + bigint?: false | undefined; + } + ): Promise; + stat( + opts: StatOptions & { + bigint: true; + } + ): Promise; + stat(opts?: StatOptions): Promise; + /** + * Truncates the file. + * + * If the file was larger than `len` bytes, only the first `len` bytes will be + * retained in the file. + * + * The following example retains only the first four bytes of the file: + * + * ```js + * import { open } from 'node:fs/promises'; + * + * let filehandle = null; + * try { + * filehandle = await open('temp.txt', 'r+'); + * await filehandle.truncate(4); + * } finally { + * await filehandle?.close(); + * } + * ``` + * + * If the file previously was shorter than `len` bytes, it is extended, and the + * extended part is filled with null bytes (`'\0'`): + * + * If `len` is negative then `0` will be used. + * @since v10.0.0 + * @param [len=0] + * @return Fulfills with `undefined` upon success. + */ + truncate(len?: number): Promise; + /** + * Change the file system timestamps of the object referenced by the `FileHandle` then resolves the promise with no arguments upon success. + * @since v10.0.0 + */ + utimes(atime: TimeLike, mtime: TimeLike): Promise; + /** + * Asynchronously writes data to a file, replacing the file if it already exists.`data` can be a string, a buffer, an + * [AsyncIterable](https://tc39.github.io/ecma262/#sec-asynciterable-interface), or an + * [Iterable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#The_iterable_protocol) object. + * The promise is resolved with no arguments upon success. + * + * If `options` is a string, then it specifies the `encoding`. + * + * The `FileHandle` has to support writing. + * + * It is unsafe to use `filehandle.writeFile()` multiple times on the same file + * without waiting for the promise to be resolved (or rejected). + * + * If one or more `filehandle.write()` calls are made on a file handle and then a`filehandle.writeFile()` call is made, the data will be written from the + * current position till the end of the file. It doesn't always write from the + * beginning of the file. + * @since v10.0.0 + */ + writeFile(data: string | Uint8Array, options?: (ObjectEncodingOptions & FlagAndOpenMode & Abortable) | BufferEncoding | null): Promise; + /** + * Write `buffer` to the file. + * + * The promise is resolved with an object containing two properties: + * + * It is unsafe to use `filehandle.write()` multiple times on the same file + * without waiting for the promise to be resolved (or rejected). For this + * scenario, use `filehandle.createWriteStream()`. + * + * On Linux, positional writes do not work when the file is opened in append mode. + * The kernel ignores the position argument and always appends the data to + * the end of the file. + * @since v10.0.0 + * @param offset The start position from within `buffer` where the data to write begins. + * @param [length=buffer.byteLength - offset] The number of bytes from `buffer` to write. + * @param [position='null'] The offset from the beginning of the file where the data from `buffer` should be written. If `position` is not a `number`, the data will be written at the current + * position. See the POSIX pwrite(2) documentation for more detail. + */ + write( + buffer: TBuffer, + offset?: number | null, + length?: number | null, + position?: number | null + ): Promise<{ + bytesWritten: number; + buffer: TBuffer; + }>; + write( + data: string, + position?: number | null, + encoding?: BufferEncoding | null + ): Promise<{ + bytesWritten: number; + buffer: string; + }>; + /** + * Write an array of [ArrayBufferView](https://developer.mozilla.org/en-US/docs/Web/API/ArrayBufferView) s to the file. + * + * The promise is resolved with an object containing a two properties: + * + * It is unsafe to call `writev()` multiple times on the same file without waiting + * for the promise to be resolved (or rejected). + * + * On Linux, positional writes don't work when the file is opened in append mode. + * The kernel ignores the position argument and always appends the data to + * the end of the file. + * @since v12.9.0 + * @param [position='null'] The offset from the beginning of the file where the data from `buffers` should be written. If `position` is not a `number`, the data will be written at the current + * position. + */ + writev(buffers: ReadonlyArray, position?: number): Promise; + /** + * Read from a file and write to an array of [ArrayBufferView](https://developer.mozilla.org/en-US/docs/Web/API/ArrayBufferView) s + * @since v13.13.0, v12.17.0 + * @param [position='null'] The offset from the beginning of the file where the data should be read from. If `position` is not a `number`, the data will be read from the current position. + * @return Fulfills upon success an object containing two properties: + */ + readv(buffers: ReadonlyArray, position?: number): Promise; + /** + * Closes the file handle after waiting for any pending operation on the handle to + * complete. + * + * ```js + * import { open } from 'node:fs/promises'; + * + * let filehandle; + * try { + * filehandle = await open('thefile.txt', 'r'); + * } finally { + * await filehandle?.close(); + * } + * ``` + * @since v10.0.0 + * @return Fulfills with `undefined` upon success. + */ + close(): Promise; + /** + * An alias for {@link FileHandle.close()}. + * @since v20.4.0 + */ + [Symbol.asyncDispose](): Promise; + } + const constants: typeof fsConstants; + /** + * Tests a user's permissions for the file or directory specified by `path`. + * The `mode` argument is an optional integer that specifies the accessibility + * checks to be performed. `mode` should be either the value `fs.constants.F_OK`or a mask consisting of the bitwise OR of any of `fs.constants.R_OK`,`fs.constants.W_OK`, and `fs.constants.X_OK` + * (e.g.`fs.constants.W_OK | fs.constants.R_OK`). Check `File access constants` for + * possible values of `mode`. + * + * If the accessibility check is successful, the promise is resolved with no + * value. If any of the accessibility checks fail, the promise is rejected + * with an [Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) object. The following example checks if the file`/etc/passwd` can be read and + * written by the current process. + * + * ```js + * import { access, constants } from 'node:fs/promises'; + * + * try { + * await access('/etc/passwd', constants.R_OK | constants.W_OK); + * console.log('can access'); + * } catch { + * console.error('cannot access'); + * } + * ``` + * + * Using `fsPromises.access()` to check for the accessibility of a file before + * calling `fsPromises.open()` is not recommended. Doing so introduces a race + * condition, since other processes may change the file's state between the two + * calls. Instead, user code should open/read/write the file directly and handle + * the error raised if the file is not accessible. + * @since v10.0.0 + * @param [mode=fs.constants.F_OK] + * @return Fulfills with `undefined` upon success. + */ + function access(path: PathLike, mode?: number): Promise; + /** + * Asynchronously copies `src` to `dest`. By default, `dest` is overwritten if it + * already exists. + * + * No guarantees are made about the atomicity of the copy operation. If an + * error occurs after the destination file has been opened for writing, an attempt + * will be made to remove the destination. + * + * ```js + * import { copyFile, constants } from 'node:fs/promises'; + * + * try { + * await copyFile('source.txt', 'destination.txt'); + * console.log('source.txt was copied to destination.txt'); + * } catch { + * console.error('The file could not be copied'); + * } + * + * // By using COPYFILE_EXCL, the operation will fail if destination.txt exists. + * try { + * await copyFile('source.txt', 'destination.txt', constants.COPYFILE_EXCL); + * console.log('source.txt was copied to destination.txt'); + * } catch { + * console.error('The file could not be copied'); + * } + * ``` + * @since v10.0.0 + * @param src source filename to copy + * @param dest destination filename of the copy operation + * @param [mode=0] Optional modifiers that specify the behavior of the copy operation. It is possible to create a mask consisting of the bitwise OR of two or more values (e.g. + * `fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE`) + * @return Fulfills with `undefined` upon success. + */ + function copyFile(src: PathLike, dest: PathLike, mode?: number): Promise; + /** + * Opens a `FileHandle`. + * + * Refer to the POSIX [`open(2)`](http://man7.org/linux/man-pages/man2/open.2.html) documentation for more detail. + * + * Some characters (`< > : " / \ | ? *`) are reserved under Windows as documented + * by [Naming Files, Paths, and Namespaces](https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file). Under NTFS, if the filename contains + * a colon, Node.js will open a file system stream, as described by [this MSDN page](https://docs.microsoft.com/en-us/windows/desktop/FileIO/using-streams). + * @since v10.0.0 + * @param [flags='r'] See `support of file system `flags``. + * @param [mode=0o666] Sets the file mode (permission and sticky bits) if the file is created. + * @return Fulfills with a {FileHandle} object. + */ + function open(path: PathLike, flags?: string | number, mode?: Mode): Promise; + /** + * Renames `oldPath` to `newPath`. + * @since v10.0.0 + * @return Fulfills with `undefined` upon success. + */ + function rename(oldPath: PathLike, newPath: PathLike): Promise; + /** + * Truncates (shortens or extends the length) of the content at `path` to `len`bytes. + * @since v10.0.0 + * @param [len=0] + * @return Fulfills with `undefined` upon success. + */ + function truncate(path: PathLike, len?: number): Promise; + /** + * Removes the directory identified by `path`. + * + * Using `fsPromises.rmdir()` on a file (not a directory) results in the + * promise being rejected with an `ENOENT` error on Windows and an `ENOTDIR`error on POSIX. + * + * To get a behavior similar to the `rm -rf` Unix command, use `fsPromises.rm()` with options `{ recursive: true, force: true }`. + * @since v10.0.0 + * @return Fulfills with `undefined` upon success. + */ + function rmdir(path: PathLike, options?: RmDirOptions): Promise; + /** + * Removes files and directories (modeled on the standard POSIX `rm` utility). + * @since v14.14.0 + * @return Fulfills with `undefined` upon success. + */ + function rm(path: PathLike, options?: RmOptions): Promise; + /** + * Asynchronously creates a directory. + * + * The optional `options` argument can be an integer specifying `mode` (permission + * and sticky bits), or an object with a `mode` property and a `recursive`property indicating whether parent directories should be created. Calling`fsPromises.mkdir()` when `path` is a directory + * that exists results in a + * rejection only when `recursive` is false. + * + * ```js + * import { mkdir } from 'node:fs/promises'; + * + * try { + * const projectFolder = new URL('./test/project/', import.meta.url); + * const createDir = await mkdir(projectFolder, { recursive: true }); + * + * console.log(`created ${createDir}`); + * } catch (err) { + * console.error(err.message); + * } + * ``` + * @since v10.0.0 + * @return Upon success, fulfills with `undefined` if `recursive` is `false`, or the first directory path created if `recursive` is `true`. + */ + function mkdir( + path: PathLike, + options: MakeDirectoryOptions & { + recursive: true; + } + ): Promise; + /** + * Asynchronous mkdir(2) - create a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders + * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. + */ + function mkdir( + path: PathLike, + options?: + | Mode + | (MakeDirectoryOptions & { + recursive?: false | undefined; + }) + | null + ): Promise; + /** + * Asynchronous mkdir(2) - create a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders + * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. + */ + function mkdir(path: PathLike, options?: Mode | MakeDirectoryOptions | null): Promise; + /** + * Reads the contents of a directory. + * + * The optional `options` argument can be a string specifying an encoding, or an + * object with an `encoding` property specifying the character encoding to use for + * the filenames. If the `encoding` is set to `'buffer'`, the filenames returned + * will be passed as `Buffer` objects. + * + * If `options.withFileTypes` is set to `true`, the resolved array will contain `fs.Dirent` objects. + * + * ```js + * import { readdir } from 'node:fs/promises'; + * + * try { + * const files = await readdir(path); + * for (const file of files) + * console.log(file); + * } catch (err) { + * console.error(err); + * } + * ``` + * @since v10.0.0 + * @return Fulfills with an array of the names of the files in the directory excluding `'.'` and `'..'`. + */ + function readdir( + path: PathLike, + options?: + | (ObjectEncodingOptions & { + withFileTypes?: false | undefined; + recursive?: boolean | undefined; + }) + | BufferEncoding + | null + ): Promise; + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function readdir( + path: PathLike, + options: + | { + encoding: 'buffer'; + withFileTypes?: false | undefined; + recursive?: boolean | undefined; + } + | 'buffer' + ): Promise; + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function readdir( + path: PathLike, + options?: + | (ObjectEncodingOptions & { + withFileTypes?: false | undefined; + recursive?: boolean | undefined; + }) + | BufferEncoding + | null + ): Promise; + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options If called with `withFileTypes: true` the result data will be an array of Dirent. + */ + function readdir( + path: PathLike, + options: ObjectEncodingOptions & { + withFileTypes: true; + recursive?: boolean | undefined; + } + ): Promise; + /** + * Reads the contents of the symbolic link referred to by `path`. See the POSIX [`readlink(2)`](http://man7.org/linux/man-pages/man2/readlink.2.html) documentation for more detail. The promise is + * resolved with the`linkString` upon success. + * + * The optional `options` argument can be a string specifying an encoding, or an + * object with an `encoding` property specifying the character encoding to use for + * the link path returned. If the `encoding` is set to `'buffer'`, the link path + * returned will be passed as a `Buffer` object. + * @since v10.0.0 + * @return Fulfills with the `linkString` upon success. + */ + function readlink(path: PathLike, options?: ObjectEncodingOptions | BufferEncoding | null): Promise; + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function readlink(path: PathLike, options: BufferEncodingOption): Promise; + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function readlink(path: PathLike, options?: ObjectEncodingOptions | string | null): Promise; + /** + * Creates a symbolic link. + * + * The `type` argument is only used on Windows platforms and can be one of `'dir'`,`'file'`, or `'junction'`. If the `type` argument is not a string, Node.js will + * autodetect `target` type and use `'file'` or `'dir'`. If the `target` does not + * exist, `'file'` will be used. Windows junction points require the destination + * path to be absolute. When using `'junction'`, the `target` argument will + * automatically be normalized to absolute path. Junction points on NTFS volumes + * can only point to directories. + * @since v10.0.0 + * @param [type='null'] + * @return Fulfills with `undefined` upon success. + */ + function symlink(target: PathLike, path: PathLike, type?: string | null): Promise; + /** + * Equivalent to `fsPromises.stat()` unless `path` refers to a symbolic link, + * in which case the link itself is stat-ed, not the file that it refers to. + * Refer to the POSIX [`lstat(2)`](http://man7.org/linux/man-pages/man2/lstat.2.html) document for more detail. + * @since v10.0.0 + * @return Fulfills with the {fs.Stats} object for the given symbolic link `path`. + */ + function lstat( + path: PathLike, + opts?: StatOptions & { + bigint?: false | undefined; + } + ): Promise; + function lstat( + path: PathLike, + opts: StatOptions & { + bigint: true; + } + ): Promise; + function lstat(path: PathLike, opts?: StatOptions): Promise; + /** + * @since v10.0.0 + * @return Fulfills with the {fs.Stats} object for the given `path`. + */ + function stat( + path: PathLike, + opts?: StatOptions & { + bigint?: false | undefined; + } + ): Promise; + function stat( + path: PathLike, + opts: StatOptions & { + bigint: true; + } + ): Promise; + function stat(path: PathLike, opts?: StatOptions): Promise; + /** + * @since v19.6.0, v18.15.0 + * @return Fulfills with the {fs.StatFs} object for the given `path`. + */ + function statfs( + path: PathLike, + opts?: StatFsOptions & { + bigint?: false | undefined; + } + ): Promise; + function statfs( + path: PathLike, + opts: StatFsOptions & { + bigint: true; + } + ): Promise; + function statfs(path: PathLike, opts?: StatFsOptions): Promise; + /** + * Creates a new link from the `existingPath` to the `newPath`. See the POSIX [`link(2)`](http://man7.org/linux/man-pages/man2/link.2.html) documentation for more detail. + * @since v10.0.0 + * @return Fulfills with `undefined` upon success. + */ + function link(existingPath: PathLike, newPath: PathLike): Promise; + /** + * If `path` refers to a symbolic link, then the link is removed without affecting + * the file or directory to which that link refers. If the `path` refers to a file + * path that is not a symbolic link, the file is deleted. See the POSIX [`unlink(2)`](http://man7.org/linux/man-pages/man2/unlink.2.html) documentation for more detail. + * @since v10.0.0 + * @return Fulfills with `undefined` upon success. + */ + function unlink(path: PathLike): Promise; + /** + * Changes the permissions of a file. + * @since v10.0.0 + * @return Fulfills with `undefined` upon success. + */ + function chmod(path: PathLike, mode: Mode): Promise; + /** + * Changes the permissions on a symbolic link. + * + * This method is only implemented on macOS. + * @deprecated Since v10.0.0 + * @return Fulfills with `undefined` upon success. + */ + function lchmod(path: PathLike, mode: Mode): Promise; + /** + * Changes the ownership on a symbolic link. + * @since v10.0.0 + * @return Fulfills with `undefined` upon success. + */ + function lchown(path: PathLike, uid: number, gid: number): Promise; + /** + * Changes the access and modification times of a file in the same way as `fsPromises.utimes()`, with the difference that if the path refers to a + * symbolic link, then the link is not dereferenced: instead, the timestamps of + * the symbolic link itself are changed. + * @since v14.5.0, v12.19.0 + * @return Fulfills with `undefined` upon success. + */ + function lutimes(path: PathLike, atime: TimeLike, mtime: TimeLike): Promise; + /** + * Changes the ownership of a file. + * @since v10.0.0 + * @return Fulfills with `undefined` upon success. + */ + function chown(path: PathLike, uid: number, gid: number): Promise; + /** + * Change the file system timestamps of the object referenced by `path`. + * + * The `atime` and `mtime` arguments follow these rules: + * + * * Values can be either numbers representing Unix epoch time, `Date`s, or a + * numeric string like `'123456789.0'`. + * * If the value can not be converted to a number, or is `NaN`, `Infinity`, or`-Infinity`, an `Error` will be thrown. + * @since v10.0.0 + * @return Fulfills with `undefined` upon success. + */ + function utimes(path: PathLike, atime: TimeLike, mtime: TimeLike): Promise; + /** + * Determines the actual location of `path` using the same semantics as the`fs.realpath.native()` function. + * + * Only paths that can be converted to UTF8 strings are supported. + * + * The optional `options` argument can be a string specifying an encoding, or an + * object with an `encoding` property specifying the character encoding to use for + * the path. If the `encoding` is set to `'buffer'`, the path returned will be + * passed as a `Buffer` object. + * + * On Linux, when Node.js is linked against musl libc, the procfs file system must + * be mounted on `/proc` in order for this function to work. Glibc does not have + * this restriction. + * @since v10.0.0 + * @return Fulfills with the resolved path upon success. + */ + function realpath(path: PathLike, options?: ObjectEncodingOptions | BufferEncoding | null): Promise; + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function realpath(path: PathLike, options: BufferEncodingOption): Promise; + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function realpath(path: PathLike, options?: ObjectEncodingOptions | BufferEncoding | null): Promise; + /** + * Creates a unique temporary directory. A unique directory name is generated by + * appending six random characters to the end of the provided `prefix`. Due to + * platform inconsistencies, avoid trailing `X` characters in `prefix`. Some + * platforms, notably the BSDs, can return more than six random characters, and + * replace trailing `X` characters in `prefix` with random characters. + * + * The optional `options` argument can be a string specifying an encoding, or an + * object with an `encoding` property specifying the character encoding to use. + * + * ```js + * import { mkdtemp } from 'node:fs/promises'; + * import { join } from 'node:path'; + * import { tmpdir } from 'node:os'; + * + * try { + * await mkdtemp(join(tmpdir(), 'foo-')); + * } catch (err) { + * console.error(err); + * } + * ``` + * + * The `fsPromises.mkdtemp()` method will append the six randomly selected + * characters directly to the `prefix` string. For instance, given a directory`/tmp`, if the intention is to create a temporary directory _within_`/tmp`, the`prefix` must end with a trailing + * platform-specific path separator + * (`require('node:path').sep`). + * @since v10.0.0 + * @return Fulfills with a string containing the file system path of the newly created temporary directory. + */ + function mkdtemp(prefix: string, options?: ObjectEncodingOptions | BufferEncoding | null): Promise; + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required `prefix` to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function mkdtemp(prefix: string, options: BufferEncodingOption): Promise; + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required `prefix` to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function mkdtemp(prefix: string, options?: ObjectEncodingOptions | BufferEncoding | null): Promise; + /** + * Asynchronously writes data to a file, replacing the file if it already exists.`data` can be a string, a buffer, an + * [AsyncIterable](https://tc39.github.io/ecma262/#sec-asynciterable-interface), or an + * [Iterable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#The_iterable_protocol) object. + * + * The `encoding` option is ignored if `data` is a buffer. + * + * If `options` is a string, then it specifies the encoding. + * + * The `mode` option only affects the newly created file. See `fs.open()` for more details. + * + * Any specified `FileHandle` has to support writing. + * + * It is unsafe to use `fsPromises.writeFile()` multiple times on the same file + * without waiting for the promise to be settled. + * + * Similarly to `fsPromises.readFile` \- `fsPromises.writeFile` is a convenience + * method that performs multiple `write` calls internally to write the buffer + * passed to it. For performance sensitive code consider using `fs.createWriteStream()` or `filehandle.createWriteStream()`. + * + * It is possible to use an `AbortSignal` to cancel an `fsPromises.writeFile()`. + * Cancelation is "best effort", and some amount of data is likely still + * to be written. + * + * ```js + * import { writeFile } from 'node:fs/promises'; + * import { Buffer } from 'node:buffer'; + * + * try { + * const controller = new AbortController(); + * const { signal } = controller; + * const data = new Uint8Array(Buffer.from('Hello Node.js')); + * const promise = writeFile('message.txt', data, { signal }); + * + * // Abort the request before the promise settles. + * controller.abort(); + * + * await promise; + * } catch (err) { + * // When a request is aborted - err is an AbortError + * console.error(err); + * } + * ``` + * + * Aborting an ongoing request does not abort individual operating + * system requests but rather the internal buffering `fs.writeFile` performs. + * @since v10.0.0 + * @param file filename or `FileHandle` + * @return Fulfills with `undefined` upon success. + */ + function writeFile( + file: PathLike | FileHandle, + data: string | NodeJS.ArrayBufferView | Iterable | AsyncIterable | Stream, + options?: + | (ObjectEncodingOptions & { + mode?: Mode | undefined; + flag?: OpenMode | undefined; + } & Abortable) + | BufferEncoding + | null + ): Promise; + /** + * Asynchronously append data to a file, creating the file if it does not yet + * exist. `data` can be a string or a `Buffer`. + * + * If `options` is a string, then it specifies the `encoding`. + * + * The `mode` option only affects the newly created file. See `fs.open()` for more details. + * + * The `path` may be specified as a `FileHandle` that has been opened + * for appending (using `fsPromises.open()`). + * @since v10.0.0 + * @param path filename or {FileHandle} + * @return Fulfills with `undefined` upon success. + */ + function appendFile(path: PathLike | FileHandle, data: string | Uint8Array, options?: (ObjectEncodingOptions & FlagAndOpenMode) | BufferEncoding | null): Promise; + /** + * Asynchronously reads the entire contents of a file. + * + * If no encoding is specified (using `options.encoding`), the data is returned + * as a `Buffer` object. Otherwise, the data will be a string. + * + * If `options` is a string, then it specifies the encoding. + * + * When the `path` is a directory, the behavior of `fsPromises.readFile()` is + * platform-specific. On macOS, Linux, and Windows, the promise will be rejected + * with an error. On FreeBSD, a representation of the directory's contents will be + * returned. + * + * An example of reading a `package.json` file located in the same directory of the + * running code: + * + * ```js + * import { readFile } from 'node:fs/promises'; + * try { + * const filePath = new URL('./package.json', import.meta.url); + * const contents = await readFile(filePath, { encoding: 'utf8' }); + * console.log(contents); + * } catch (err) { + * console.error(err.message); + * } + * ``` + * + * It is possible to abort an ongoing `readFile` using an `AbortSignal`. If a + * request is aborted the promise returned is rejected with an `AbortError`: + * + * ```js + * import { readFile } from 'node:fs/promises'; + * + * try { + * const controller = new AbortController(); + * const { signal } = controller; + * const promise = readFile(fileName, { signal }); + * + * // Abort the request before the promise settles. + * controller.abort(); + * + * await promise; + * } catch (err) { + * // When a request is aborted - err is an AbortError + * console.error(err); + * } + * ``` + * + * Aborting an ongoing request does not abort individual operating + * system requests but rather the internal buffering `fs.readFile` performs. + * + * Any specified `FileHandle` has to support reading. + * @since v10.0.0 + * @param path filename or `FileHandle` + * @return Fulfills with the contents of the file. + */ + function readFile( + path: PathLike | FileHandle, + options?: + | ({ + encoding?: null | undefined; + flag?: OpenMode | undefined; + } & Abortable) + | null + ): Promise; + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * If a `FileHandle` is provided, the underlying file will _not_ be closed automatically. + * @param options An object that may contain an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + function readFile( + path: PathLike | FileHandle, + options: + | ({ + encoding: BufferEncoding; + flag?: OpenMode | undefined; + } & Abortable) + | BufferEncoding + ): Promise; + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * If a `FileHandle` is provided, the underlying file will _not_ be closed automatically. + * @param options An object that may contain an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + function readFile( + path: PathLike | FileHandle, + options?: + | (ObjectEncodingOptions & + Abortable & { + flag?: OpenMode | undefined; + }) + | BufferEncoding + | null + ): Promise; + /** + * Asynchronously open a directory for iterative scanning. See the POSIX [`opendir(3)`](http://man7.org/linux/man-pages/man3/opendir.3.html) documentation for more detail. + * + * Creates an `fs.Dir`, which contains all further functions for reading from + * and cleaning up the directory. + * + * The `encoding` option sets the encoding for the `path` while opening the + * directory and subsequent read operations. + * + * Example using async iteration: + * + * ```js + * import { opendir } from 'node:fs/promises'; + * + * try { + * const dir = await opendir('./'); + * for await (const dirent of dir) + * console.log(dirent.name); + * } catch (err) { + * console.error(err); + * } + * ``` + * + * When using the async iterator, the `fs.Dir` object will be automatically + * closed after the iterator exits. + * @since v12.12.0 + * @return Fulfills with an {fs.Dir}. + */ + function opendir(path: PathLike, options?: OpenDirOptions): Promise; + /** + * Returns an async iterator that watches for changes on `filename`, where `filename`is either a file or a directory. + * + * ```js + * const { watch } = require('node:fs/promises'); + * + * const ac = new AbortController(); + * const { signal } = ac; + * setTimeout(() => ac.abort(), 10000); + * + * (async () => { + * try { + * const watcher = watch(__filename, { signal }); + * for await (const event of watcher) + * console.log(event); + * } catch (err) { + * if (err.name === 'AbortError') + * return; + * throw err; + * } + * })(); + * ``` + * + * On most platforms, `'rename'` is emitted whenever a filename appears or + * disappears in the directory. + * + * All the `caveats` for `fs.watch()` also apply to `fsPromises.watch()`. + * @since v15.9.0, v14.18.0 + * @return of objects with the properties: + */ + function watch( + filename: PathLike, + options: + | (WatchOptions & { + encoding: 'buffer'; + }) + | 'buffer' + ): AsyncIterable>; + /** + * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`. + * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `persistent` is not supplied, the default of `true` is used. + * If `recursive` is not supplied, the default of `false` is used. + */ + function watch(filename: PathLike, options?: WatchOptions | BufferEncoding): AsyncIterable>; + /** + * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`. + * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `persistent` is not supplied, the default of `true` is used. + * If `recursive` is not supplied, the default of `false` is used. + */ + function watch(filename: PathLike, options: WatchOptions | string): AsyncIterable> | AsyncIterable>; + /** + * Asynchronously copies the entire directory structure from `src` to `dest`, + * including subdirectories and files. + * + * When copying a directory to another directory, globs are not supported and + * behavior is similar to `cp dir1/ dir2/`. + * @since v16.7.0 + * @experimental + * @param src source path to copy. + * @param dest destination path to copy to. + * @return Fulfills with `undefined` upon success. + */ + function cp(source: string | URL, destination: string | URL, opts?: CopyOptions): Promise; +} +declare module 'fs/promises' { + export * from 'node:fs/promises'; +} diff --git a/node_modules/@types/node/ts4.8/globals.d.ts b/node_modules/@types/node/ts4.8/globals.d.ts new file mode 100644 index 0000000..1336d61 --- /dev/null +++ b/node_modules/@types/node/ts4.8/globals.d.ts @@ -0,0 +1,325 @@ +// Declare "static" methods in Error +interface ErrorConstructor { + /** Create .stack property on a target object */ + captureStackTrace(targetObject: object, constructorOpt?: Function): void; + + /** + * Optional override for formatting stack traces + * + * @see https://v8.dev/docs/stack-trace-api#customizing-stack-traces + */ + prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined; + + stackTraceLimit: number; +} + +/*-----------------------------------------------* + * * + * GLOBAL * + * * + ------------------------------------------------*/ + +// For backwards compability +interface NodeRequire extends NodeJS.Require { } +interface RequireResolve extends NodeJS.RequireResolve { } +interface NodeModule extends NodeJS.Module { } + +declare var process: NodeJS.Process; +declare var console: Console; + +declare var __filename: string; +declare var __dirname: string; + +declare var require: NodeRequire; +declare var module: NodeModule; + +// Same as module.exports +declare var exports: any; + +/** + * Only available if `--expose-gc` is passed to the process. + */ +declare var gc: undefined | (() => void); + +//#region borrowed +// from https://github.com/microsoft/TypeScript/blob/38da7c600c83e7b31193a62495239a0fe478cb67/lib/lib.webworker.d.ts#L633 until moved to separate lib +/** A controller object that allows you to abort one or more DOM requests as and when desired. */ +interface AbortController { + /** + * Returns the AbortSignal object associated with this object. + */ + + readonly signal: AbortSignal; + /** + * Invoking this method will set this object's AbortSignal's aborted flag and signal to any observers that the associated activity is to be aborted. + */ + abort(reason?: any): void; +} + +/** A signal object that allows you to communicate with a DOM request (such as a Fetch) and abort it if required via an AbortController object. */ +interface AbortSignal extends EventTarget { + /** + * Returns true if this AbortSignal's AbortController has signaled to abort, and false otherwise. + */ + readonly aborted: boolean; + readonly reason: any; + onabort: null | ((this: AbortSignal, event: Event) => any); + throwIfAborted(): void; +} + +declare var AbortController: typeof globalThis extends {onmessage: any; AbortController: infer T} + ? T + : { + prototype: AbortController; + new(): AbortController; + }; + +declare var AbortSignal: typeof globalThis extends {onmessage: any; AbortSignal: infer T} + ? T + : { + prototype: AbortSignal; + new(): AbortSignal; + abort(reason?: any): AbortSignal; + timeout(milliseconds: number): AbortSignal; + }; +//#endregion borrowed + +//#region Disposable +interface SymbolConstructor { + /** + * A method that is used to release resources held by an object. Called by the semantics of the `using` statement. + */ + readonly dispose: unique symbol; + + /** + * A method that is used to asynchronously release resources held by an object. Called by the semantics of the `await using` statement. + */ + readonly asyncDispose: unique symbol; +} + +interface Disposable { + [Symbol.dispose](): void; +} + +interface AsyncDisposable { + [Symbol.asyncDispose](): PromiseLike; +} +//#endregion Disposable + +//#region ArrayLike.at() +interface RelativeIndexable { + /** + * Takes an integer value and returns the item at that index, + * allowing for positive and negative integers. + * Negative integers count back from the last item in the array. + */ + at(index: number): T | undefined; +} +interface String extends RelativeIndexable {} +interface Array extends RelativeIndexable {} +interface ReadonlyArray extends RelativeIndexable {} +interface Int8Array extends RelativeIndexable {} +interface Uint8Array extends RelativeIndexable {} +interface Uint8ClampedArray extends RelativeIndexable {} +interface Int16Array extends RelativeIndexable {} +interface Uint16Array extends RelativeIndexable {} +interface Int32Array extends RelativeIndexable {} +interface Uint32Array extends RelativeIndexable {} +interface Float32Array extends RelativeIndexable {} +interface Float64Array extends RelativeIndexable {} +interface BigInt64Array extends RelativeIndexable {} +interface BigUint64Array extends RelativeIndexable {} +//#endregion ArrayLike.at() end + +/** + * @since v17.0.0 + * + * Creates a deep clone of an object. + */ +declare function structuredClone( + value: T, + transfer?: { transfer: ReadonlyArray }, +): T; + +/*----------------------------------------------* +* * +* GLOBAL INTERFACES * +* * +*-----------------------------------------------*/ +declare namespace NodeJS { + interface CallSite { + /** + * Value of "this" + */ + getThis(): unknown; + + /** + * Type of "this" as a string. + * This is the name of the function stored in the constructor field of + * "this", if available. Otherwise the object's [[Class]] internal + * property. + */ + getTypeName(): string | null; + + /** + * Current function + */ + getFunction(): Function | undefined; + + /** + * Name of the current function, typically its name property. + * If a name property is not available an attempt will be made to try + * to infer a name from the function's context. + */ + getFunctionName(): string | null; + + /** + * Name of the property [of "this" or one of its prototypes] that holds + * the current function + */ + getMethodName(): string | null; + + /** + * Name of the script [if this function was defined in a script] + */ + getFileName(): string | undefined; + + /** + * Current line number [if this function was defined in a script] + */ + getLineNumber(): number | null; + + /** + * Current column number [if this function was defined in a script] + */ + getColumnNumber(): number | null; + + /** + * A call site object representing the location where eval was called + * [if this function was created using a call to eval] + */ + getEvalOrigin(): string | undefined; + + /** + * Is this a toplevel invocation, that is, is "this" the global object? + */ + isToplevel(): boolean; + + /** + * Does this call take place in code defined by a call to eval? + */ + isEval(): boolean; + + /** + * Is this call in native V8 code? + */ + isNative(): boolean; + + /** + * Is this a constructor call? + */ + isConstructor(): boolean; + } + + interface ErrnoException extends Error { + errno?: number | undefined; + code?: string | undefined; + path?: string | undefined; + syscall?: string | undefined; + } + + interface ReadableStream extends EventEmitter { + readable: boolean; + read(size?: number): string | Buffer; + setEncoding(encoding: BufferEncoding): this; + pause(): this; + resume(): this; + isPaused(): boolean; + pipe(destination: T, options?: { end?: boolean | undefined; }): T; + unpipe(destination?: WritableStream): this; + unshift(chunk: string | Uint8Array, encoding?: BufferEncoding): void; + wrap(oldStream: ReadableStream): this; + [Symbol.asyncIterator](): AsyncIterableIterator; + } + + interface WritableStream extends EventEmitter { + writable: boolean; + write(buffer: Uint8Array | string, cb?: (err?: Error | null) => void): boolean; + write(str: string, encoding?: BufferEncoding, cb?: (err?: Error | null) => void): boolean; + end(cb?: () => void): this; + end(data: string | Uint8Array, cb?: () => void): this; + end(str: string, encoding?: BufferEncoding, cb?: () => void): this; + } + + interface ReadWriteStream extends ReadableStream, WritableStream { } + + interface RefCounted { + ref(): this; + unref(): this; + } + + type TypedArray = + | Uint8Array + | Uint8ClampedArray + | Uint16Array + | Uint32Array + | Int8Array + | Int16Array + | Int32Array + | BigUint64Array + | BigInt64Array + | Float32Array + | Float64Array; + type ArrayBufferView = TypedArray | DataView; + + interface Require { + (id: string): any; + resolve: RequireResolve; + cache: Dict; + /** + * @deprecated + */ + extensions: RequireExtensions; + main: Module | undefined; + } + + interface RequireResolve { + (id: string, options?: { paths?: string[] | undefined; }): string; + paths(request: string): string[] | null; + } + + interface RequireExtensions extends Dict<(m: Module, filename: string) => any> { + '.js': (m: Module, filename: string) => any; + '.json': (m: Module, filename: string) => any; + '.node': (m: Module, filename: string) => any; + } + interface Module { + /** + * `true` if the module is running during the Node.js preload + */ + isPreloading: boolean; + exports: any; + require: Require; + id: string; + filename: string; + loaded: boolean; + /** @deprecated since v14.6.0 Please use `require.main` and `module.children` instead. */ + parent: Module | null | undefined; + children: Module[]; + /** + * @since v11.14.0 + * + * The directory name of the module. This is usually the same as the path.dirname() of the module.id. + */ + path: string; + paths: string[]; + } + + interface Dict { + [key: string]: T | undefined; + } + + interface ReadOnlyDict { + readonly [key: string]: T | undefined; + } +} diff --git a/node_modules/@types/node/ts4.8/globals.global.d.ts b/node_modules/@types/node/ts4.8/globals.global.d.ts new file mode 100644 index 0000000..ef1198c --- /dev/null +++ b/node_modules/@types/node/ts4.8/globals.global.d.ts @@ -0,0 +1 @@ +declare var global: typeof globalThis; diff --git a/node_modules/@types/node/ts4.8/http.d.ts b/node_modules/@types/node/ts4.8/http.d.ts new file mode 100644 index 0000000..ba0ac3d --- /dev/null +++ b/node_modules/@types/node/ts4.8/http.d.ts @@ -0,0 +1,1756 @@ +/** + * To use the HTTP server and client one must `require('node:http')`. + * + * The HTTP interfaces in Node.js are designed to support many features + * of the protocol which have been traditionally difficult to use. + * In particular, large, possibly chunk-encoded, messages. The interface is + * careful to never buffer entire requests or responses, so the + * user is able to stream data. + * + * HTTP message headers are represented by an object like this: + * + * ```js + * { 'content-length': '123', + * 'content-type': 'text/plain', + * 'connection': 'keep-alive', + * 'host': 'example.com', + * 'accept': '*' } + * ``` + * + * Keys are lowercased. Values are not modified. + * + * In order to support the full spectrum of possible HTTP applications, the Node.js + * HTTP API is very low-level. It deals with stream handling and message + * parsing only. It parses a message into headers and body but it does not + * parse the actual headers or the body. + * + * See `message.headers` for details on how duplicate headers are handled. + * + * The raw headers as they were received are retained in the `rawHeaders`property, which is an array of `[key, value, key2, value2, ...]`. For + * example, the previous message header object might have a `rawHeaders`list like the following: + * + * ```js + * [ 'ConTent-Length', '123456', + * 'content-LENGTH', '123', + * 'content-type', 'text/plain', + * 'CONNECTION', 'keep-alive', + * 'Host', 'example.com', + * 'accepT', '*' ] + * ``` + * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/http.js) + */ +declare module 'node:http' { + import * as stream from 'node:stream'; + import { URL } from 'node:url'; + import { LookupOptions } from 'node:dns'; + import { EventEmitter } from 'node:events'; + import { TcpSocketConnectOpts, Socket, Server as NetServer, LookupFunction } from 'node:net'; + // incoming headers will never contain number + interface IncomingHttpHeaders extends NodeJS.Dict { + accept?: string | undefined; + 'accept-language'?: string | undefined; + 'accept-patch'?: string | undefined; + 'accept-ranges'?: string | undefined; + 'access-control-allow-credentials'?: string | undefined; + 'access-control-allow-headers'?: string | undefined; + 'access-control-allow-methods'?: string | undefined; + 'access-control-allow-origin'?: string | undefined; + 'access-control-expose-headers'?: string | undefined; + 'access-control-max-age'?: string | undefined; + 'access-control-request-headers'?: string | undefined; + 'access-control-request-method'?: string | undefined; + age?: string | undefined; + allow?: string | undefined; + 'alt-svc'?: string | undefined; + authorization?: string | undefined; + 'cache-control'?: string | undefined; + connection?: string | undefined; + 'content-disposition'?: string | undefined; + 'content-encoding'?: string | undefined; + 'content-language'?: string | undefined; + 'content-length'?: string | undefined; + 'content-location'?: string | undefined; + 'content-range'?: string | undefined; + 'content-type'?: string | undefined; + cookie?: string | undefined; + date?: string | undefined; + etag?: string | undefined; + expect?: string | undefined; + expires?: string | undefined; + forwarded?: string | undefined; + from?: string | undefined; + host?: string | undefined; + 'if-match'?: string | undefined; + 'if-modified-since'?: string | undefined; + 'if-none-match'?: string | undefined; + 'if-unmodified-since'?: string | undefined; + 'last-modified'?: string | undefined; + location?: string | undefined; + origin?: string | undefined; + pragma?: string | undefined; + 'proxy-authenticate'?: string | undefined; + 'proxy-authorization'?: string | undefined; + 'public-key-pins'?: string | undefined; + range?: string | undefined; + referer?: string | undefined; + 'retry-after'?: string | undefined; + 'sec-websocket-accept'?: string | undefined; + 'sec-websocket-extensions'?: string | undefined; + 'sec-websocket-key'?: string | undefined; + 'sec-websocket-protocol'?: string | undefined; + 'sec-websocket-version'?: string | undefined; + 'set-cookie'?: string[] | undefined; + 'strict-transport-security'?: string | undefined; + tk?: string | undefined; + trailer?: string | undefined; + 'transfer-encoding'?: string | undefined; + upgrade?: string | undefined; + 'user-agent'?: string | undefined; + vary?: string | undefined; + via?: string | undefined; + warning?: string | undefined; + 'www-authenticate'?: string | undefined; + } + // outgoing headers allows numbers (as they are converted internally to strings) + type OutgoingHttpHeader = number | string | string[]; + interface OutgoingHttpHeaders extends NodeJS.Dict {} + interface ClientRequestArgs { + _defaultAgent?: Agent | undefined; + agent?: Agent | boolean | undefined; + auth?: string | null | undefined; + // https://github.com/nodejs/node/blob/master/lib/_http_client.js#L278 + createConnection?: + | ((options: ClientRequestArgs, oncreate: (err: Error, socket: Socket) => void) => Socket) + | undefined; + defaultPort?: number | string | undefined; + family?: number | undefined; + headers?: OutgoingHttpHeaders | undefined; + hints?: LookupOptions['hints']; + host?: string | null | undefined; + hostname?: string | null | undefined; + insecureHTTPParser?: boolean | undefined; + localAddress?: string | undefined; + localPort?: number | undefined; + lookup?: LookupFunction | undefined; + /** + * @default 16384 + */ + maxHeaderSize?: number | undefined; + method?: string | undefined; + path?: string | null | undefined; + port?: number | string | null | undefined; + protocol?: string | null | undefined; + setHost?: boolean | undefined; + signal?: AbortSignal | undefined; + socketPath?: string | undefined; + timeout?: number | undefined; + uniqueHeaders?: Array | undefined; + joinDuplicateHeaders?: boolean; + } + interface ServerOptions< + Request extends typeof IncomingMessage = typeof IncomingMessage, + Response extends typeof ServerResponse = typeof ServerResponse, + > { + /** + * Specifies the `IncomingMessage` class to be used. Useful for extending the original `IncomingMessage`. + */ + IncomingMessage?: Request | undefined; + /** + * Specifies the `ServerResponse` class to be used. Useful for extending the original `ServerResponse`. + */ + ServerResponse?: Response | undefined; + /** + * Sets the timeout value in milliseconds for receiving the entire request from the client. + * @see Server.requestTimeout for more information. + * @default 300000 + * @since v18.0.0 + */ + requestTimeout?: number | undefined; + /** + * It joins the field line values of multiple headers in a request with `, ` instead of discarding the duplicates. + * @default false + * @since v18.14.0 + */ + joinDuplicateHeaders?: boolean; + /** + * The number of milliseconds of inactivity a server needs to wait for additional incoming data, + * after it has finished writing the last response, before a socket will be destroyed. + * @see Server.keepAliveTimeout for more information. + * @default 5000 + * @since v18.0.0 + */ + keepAliveTimeout?: number | undefined; + /** + * Sets the interval value in milliseconds to check for request and headers timeout in incomplete requests. + * @default 30000 + */ + connectionsCheckingInterval?: number | undefined; + /** + * Optionally overrides all `socket`s' `readableHighWaterMark` and `writableHighWaterMark`. + * This affects `highWaterMark` property of both `IncomingMessage` and `ServerResponse`. + * Default: @see stream.getDefaultHighWaterMark(). + * @since v20.1.0 + */ + highWaterMark?: number | undefined; + /** + * Use an insecure HTTP parser that accepts invalid HTTP headers when `true`. + * Using the insecure parser should be avoided. + * See --insecure-http-parser for more information. + * @default false + */ + insecureHTTPParser?: boolean | undefined; + /** + * Optionally overrides the value of + * `--max-http-header-size` for requests received by this server, i.e. + * the maximum length of request headers in bytes. + * @default 16384 + * @since v13.3.0 + */ + maxHeaderSize?: number | undefined; + /** + * If set to `true`, it disables the use of Nagle's algorithm immediately after a new incoming connection is received. + * @default true + * @since v16.5.0 + */ + noDelay?: boolean | undefined; + /** + * If set to `true`, it enables keep-alive functionality on the socket immediately after a new incoming connection is received, + * similarly on what is done in `socket.setKeepAlive([enable][, initialDelay])`. + * @default false + * @since v16.5.0 + */ + keepAlive?: boolean | undefined; + /** + * If set to a positive number, it sets the initial delay before the first keepalive probe is sent on an idle socket. + * @default 0 + * @since v16.5.0 + */ + keepAliveInitialDelay?: number | undefined; + /** + * A list of response headers that should be sent only once. + * If the header's value is an array, the items will be joined using `; `. + */ + uniqueHeaders?: Array | undefined; + } + type RequestListener< + Request extends typeof IncomingMessage = typeof IncomingMessage, + Response extends typeof ServerResponse = typeof ServerResponse, + > = (req: InstanceType, res: InstanceType & { req: InstanceType }) => void; + /** + * @since v0.1.17 + */ + class Server< + Request extends typeof IncomingMessage = typeof IncomingMessage, + Response extends typeof ServerResponse = typeof ServerResponse, + > extends NetServer { + constructor(requestListener?: RequestListener); + constructor(options: ServerOptions, requestListener?: RequestListener); + /** + * Sets the timeout value for sockets, and emits a `'timeout'` event on + * the Server object, passing the socket as an argument, if a timeout + * occurs. + * + * If there is a `'timeout'` event listener on the Server object, then it + * will be called with the timed-out socket as an argument. + * + * By default, the Server does not timeout sockets. However, if a callback + * is assigned to the Server's `'timeout'` event, timeouts must be handled + * explicitly. + * @since v0.9.12 + * @param [msecs=0 (no timeout)] + */ + setTimeout(msecs?: number, callback?: () => void): this; + setTimeout(callback: () => void): this; + /** + * Limits maximum incoming headers count. If set to 0, no limit will be applied. + * @since v0.7.0 + */ + maxHeadersCount: number | null; + /** + * The maximum number of requests socket can handle + * before closing keep alive connection. + * + * A value of `0` will disable the limit. + * + * When the limit is reached it will set the `Connection` header value to `close`, + * but will not actually close the connection, subsequent requests sent + * after the limit is reached will get `503 Service Unavailable` as a response. + * @since v16.10.0 + */ + maxRequestsPerSocket: number | null; + /** + * The number of milliseconds of inactivity before a socket is presumed + * to have timed out. + * + * A value of `0` will disable the timeout behavior on incoming connections. + * + * The socket timeout logic is set up on connection, so changing this + * value only affects new connections to the server, not any existing connections. + * @since v0.9.12 + */ + timeout: number; + /** + * Limit the amount of time the parser will wait to receive the complete HTTP + * headers. + * + * If the timeout expires, the server responds with status 408 without + * forwarding the request to the request listener and then closes the connection. + * + * It must be set to a non-zero value (e.g. 120 seconds) to protect against + * potential Denial-of-Service attacks in case the server is deployed without a + * reverse proxy in front. + * @since v11.3.0, v10.14.0 + */ + headersTimeout: number; + /** + * The number of milliseconds of inactivity a server needs to wait for additional + * incoming data, after it has finished writing the last response, before a socket + * will be destroyed. If the server receives new data before the keep-alive + * timeout has fired, it will reset the regular inactivity timeout, i.e.,`server.timeout`. + * + * A value of `0` will disable the keep-alive timeout behavior on incoming + * connections. + * A value of `0` makes the http server behave similarly to Node.js versions prior + * to 8.0.0, which did not have a keep-alive timeout. + * + * The socket timeout logic is set up on connection, so changing this value only + * affects new connections to the server, not any existing connections. + * @since v8.0.0 + */ + keepAliveTimeout: number; + /** + * Sets the timeout value in milliseconds for receiving the entire request from + * the client. + * + * If the timeout expires, the server responds with status 408 without + * forwarding the request to the request listener and then closes the connection. + * + * It must be set to a non-zero value (e.g. 120 seconds) to protect against + * potential Denial-of-Service attacks in case the server is deployed without a + * reverse proxy in front. + * @since v14.11.0 + */ + requestTimeout: number; + /** + * Closes all connections connected to this server. + * @since v18.2.0 + */ + closeAllConnections(): void; + /** + * Closes all connections connected to this server which are not sending a request + * or waiting for a response. + * @since v18.2.0 + */ + closeIdleConnections(): void; + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: 'close', listener: () => void): this; + addListener(event: 'connection', listener: (socket: Socket) => void): this; + addListener(event: 'error', listener: (err: Error) => void): this; + addListener(event: 'listening', listener: () => void): this; + addListener(event: 'checkContinue', listener: RequestListener): this; + addListener(event: 'checkExpectation', listener: RequestListener): this; + addListener(event: 'clientError', listener: (err: Error, socket: stream.Duplex) => void): this; + addListener(event: 'connect', listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void): this; + addListener(event: 'dropRequest', listener: (req: InstanceType, socket: stream.Duplex) => void): this; + addListener(event: 'request', listener: RequestListener): this; + addListener(event: 'upgrade', listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void): this; + emit(event: string, ...args: any[]): boolean; + emit(event: 'close'): boolean; + emit(event: 'connection', socket: Socket): boolean; + emit(event: 'error', err: Error): boolean; + emit(event: 'listening'): boolean; + emit( + event: 'checkContinue', + req: InstanceType, + res: InstanceType & { req: InstanceType }, + ): boolean; + emit( + event: 'checkExpectation', + req: InstanceType, + res: InstanceType & { req: InstanceType }, + ): boolean; + emit(event: 'clientError', err: Error, socket: stream.Duplex): boolean; + emit(event: 'connect', req: InstanceType, socket: stream.Duplex, head: Buffer): boolean; + emit(event: 'dropRequest', req: InstanceType, socket: stream.Duplex): boolean; + emit( + event: 'request', + req: InstanceType, + res: InstanceType & { req: InstanceType }, + ): boolean; + emit(event: 'upgrade', req: InstanceType, socket: stream.Duplex, head: Buffer): boolean; + on(event: string, listener: (...args: any[]) => void): this; + on(event: 'close', listener: () => void): this; + on(event: 'connection', listener: (socket: Socket) => void): this; + on(event: 'error', listener: (err: Error) => void): this; + on(event: 'listening', listener: () => void): this; + on(event: 'checkContinue', listener: RequestListener): this; + on(event: 'checkExpectation', listener: RequestListener): this; + on(event: 'clientError', listener: (err: Error, socket: stream.Duplex) => void): this; + on(event: 'connect', listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void): this; + on(event: 'dropRequest', listener: (req: InstanceType, socket: stream.Duplex) => void): this; + on(event: 'request', listener: RequestListener): this; + on(event: 'upgrade', listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void): this; + once(event: string, listener: (...args: any[]) => void): this; + once(event: 'close', listener: () => void): this; + once(event: 'connection', listener: (socket: Socket) => void): this; + once(event: 'error', listener: (err: Error) => void): this; + once(event: 'listening', listener: () => void): this; + once(event: 'checkContinue', listener: RequestListener): this; + once(event: 'checkExpectation', listener: RequestListener): this; + once(event: 'clientError', listener: (err: Error, socket: stream.Duplex) => void): this; + once(event: 'connect', listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void): this; + once(event: 'dropRequest', listener: (req: InstanceType, socket: stream.Duplex) => void): this; + once(event: 'request', listener: RequestListener): this; + once(event: 'upgrade', listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void): this; + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: 'close', listener: () => void): this; + prependListener(event: 'connection', listener: (socket: Socket) => void): this; + prependListener(event: 'error', listener: (err: Error) => void): this; + prependListener(event: 'listening', listener: () => void): this; + prependListener(event: 'checkContinue', listener: RequestListener): this; + prependListener(event: 'checkExpectation', listener: RequestListener): this; + prependListener(event: 'clientError', listener: (err: Error, socket: stream.Duplex) => void): this; + prependListener(event: 'connect', listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void): this; + prependListener(event: 'dropRequest', listener: (req: InstanceType, socket: stream.Duplex) => void): this; + prependListener(event: 'request', listener: RequestListener): this; + prependListener(event: 'upgrade', listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void): this; + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'close', listener: () => void): this; + prependOnceListener(event: 'connection', listener: (socket: Socket) => void): this; + prependOnceListener(event: 'error', listener: (err: Error) => void): this; + prependOnceListener(event: 'listening', listener: () => void): this; + prependOnceListener(event: 'checkContinue', listener: RequestListener): this; + prependOnceListener(event: 'checkExpectation', listener: RequestListener): this; + prependOnceListener(event: 'clientError', listener: (err: Error, socket: stream.Duplex) => void): this; + prependOnceListener(event: 'connect', listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void): this; + prependOnceListener(event: 'dropRequest', listener: (req: InstanceType, socket: stream.Duplex) => void): this; + prependOnceListener(event: 'request', listener: RequestListener): this; + prependOnceListener(event: 'upgrade', listener: (req: InstanceType, socket: stream.Duplex, head: Buffer) => void): this; + } + /** + * This class serves as the parent class of {@link ClientRequest} and {@link ServerResponse}. It is an abstract outgoing message from + * the perspective of the participants of an HTTP transaction. + * @since v0.1.17 + */ + class OutgoingMessage extends stream.Writable { + readonly req: Request; + chunkedEncoding: boolean; + shouldKeepAlive: boolean; + useChunkedEncodingByDefault: boolean; + sendDate: boolean; + /** + * @deprecated Use `writableEnded` instead. + */ + finished: boolean; + /** + * Read-only. `true` if the headers were sent, otherwise `false`. + * @since v0.9.3 + */ + readonly headersSent: boolean; + /** + * Alias of `outgoingMessage.socket`. + * @since v0.3.0 + * @deprecated Since v15.12.0,v14.17.1 - Use `socket` instead. + */ + readonly connection: Socket | null; + /** + * Reference to the underlying socket. Usually, users will not want to access + * this property. + * + * After calling `outgoingMessage.end()`, this property will be nulled. + * @since v0.3.0 + */ + readonly socket: Socket | null; + constructor(); + /** + * Once a socket is associated with the message and is connected,`socket.setTimeout()` will be called with `msecs` as the first parameter. + * @since v0.9.12 + * @param callback Optional function to be called when a timeout occurs. Same as binding to the `timeout` event. + */ + setTimeout(msecs: number, callback?: () => void): this; + /** + * Sets a single header value. If the header already exists in the to-be-sent + * headers, its value will be replaced. Use an array of strings to send multiple + * headers with the same name. + * @since v0.4.0 + * @param name Header name + * @param value Header value + */ + setHeader(name: string, value: number | string | ReadonlyArray): this; + /** + * Append a single header value for the header object. + * + * If the value is an array, this is equivalent of calling this method multiple + * times. + * + * If there were no previous value for the header, this is equivalent of calling `outgoingMessage.setHeader(name, value)`. + * + * Depending of the value of `options.uniqueHeaders` when the client request or the + * server were created, this will end up in the header being sent multiple times or + * a single time with values joined using `; `. + * @since v18.3.0, v16.17.0 + * @param name Header name + * @param value Header value + */ + appendHeader(name: string, value: string | ReadonlyArray): this; + /** + * Gets the value of the HTTP header with the given name. If that header is not + * set, the returned value will be `undefined`. + * @since v0.4.0 + * @param name Name of header + */ + getHeader(name: string): number | string | string[] | undefined; + /** + * Returns a shallow copy of the current outgoing headers. Since a shallow + * copy is used, array values may be mutated without additional calls to + * various header-related HTTP module methods. The keys of the returned + * object are the header names and the values are the respective header + * values. All header names are lowercase. + * + * The object returned by the `outgoingMessage.getHeaders()` method does + * not prototypically inherit from the JavaScript `Object`. This means that + * typical `Object` methods such as `obj.toString()`, `obj.hasOwnProperty()`, + * and others are not defined and will not work. + * + * ```js + * outgoingMessage.setHeader('Foo', 'bar'); + * outgoingMessage.setHeader('Set-Cookie', ['foo=bar', 'bar=baz']); + * + * const headers = outgoingMessage.getHeaders(); + * // headers === { foo: 'bar', 'set-cookie': ['foo=bar', 'bar=baz'] } + * ``` + * @since v7.7.0 + */ + getHeaders(): OutgoingHttpHeaders; + /** + * Returns an array containing the unique names of the current outgoing headers. + * All names are lowercase. + * @since v7.7.0 + */ + getHeaderNames(): string[]; + /** + * Returns `true` if the header identified by `name` is currently set in the + * outgoing headers. The header name is case-insensitive. + * + * ```js + * const hasContentType = outgoingMessage.hasHeader('content-type'); + * ``` + * @since v7.7.0 + */ + hasHeader(name: string): boolean; + /** + * Removes a header that is queued for implicit sending. + * + * ```js + * outgoingMessage.removeHeader('Content-Encoding'); + * ``` + * @since v0.4.0 + * @param name Header name + */ + removeHeader(name: string): void; + /** + * Adds HTTP trailers (headers but at the end of the message) to the message. + * + * Trailers will **only** be emitted if the message is chunked encoded. If not, + * the trailers will be silently discarded. + * + * HTTP requires the `Trailer` header to be sent to emit trailers, + * with a list of header field names in its value, e.g. + * + * ```js + * message.writeHead(200, { 'Content-Type': 'text/plain', + * 'Trailer': 'Content-MD5' }); + * message.write(fileData); + * message.addTrailers({ 'Content-MD5': '7895bf4b8828b55ceaf47747b4bca667' }); + * message.end(); + * ``` + * + * Attempting to set a header field name or value that contains invalid characters + * will result in a `TypeError` being thrown. + * @since v0.3.0 + */ + addTrailers(headers: OutgoingHttpHeaders | ReadonlyArray<[string, string]>): void; + /** + * Flushes the message headers. + * + * For efficiency reason, Node.js normally buffers the message headers + * until `outgoingMessage.end()` is called or the first chunk of message data + * is written. It then tries to pack the headers and data into a single TCP + * packet. + * + * It is usually desired (it saves a TCP round-trip), but not when the first + * data is not sent until possibly much later. `outgoingMessage.flushHeaders()`bypasses the optimization and kickstarts the message. + * @since v1.6.0 + */ + flushHeaders(): void; + } + /** + * This object is created internally by an HTTP server, not by the user. It is + * passed as the second parameter to the `'request'` event. + * @since v0.1.17 + */ + class ServerResponse extends OutgoingMessage { + /** + * When using implicit headers (not calling `response.writeHead()` explicitly), + * this property controls the status code that will be sent to the client when + * the headers get flushed. + * + * ```js + * response.statusCode = 404; + * ``` + * + * After response header was sent to the client, this property indicates the + * status code which was sent out. + * @since v0.4.0 + */ + statusCode: number; + /** + * When using implicit headers (not calling `response.writeHead()` explicitly), + * this property controls the status message that will be sent to the client when + * the headers get flushed. If this is left as `undefined` then the standard + * message for the status code will be used. + * + * ```js + * response.statusMessage = 'Not found'; + * ``` + * + * After response header was sent to the client, this property indicates the + * status message which was sent out. + * @since v0.11.8 + */ + statusMessage: string; + /** + * If set to `true`, Node.js will check whether the `Content-Length`header value and the size of the body, in bytes, are equal. + * Mismatching the `Content-Length` header value will result + * in an `Error` being thrown, identified by `code:``'ERR_HTTP_CONTENT_LENGTH_MISMATCH'`. + * @since v18.10.0, v16.18.0 + */ + strictContentLength: boolean; + constructor(req: Request); + assignSocket(socket: Socket): void; + detachSocket(socket: Socket): void; + /** + * Sends an HTTP/1.1 100 Continue message to the client, indicating that + * the request body should be sent. See the `'checkContinue'` event on`Server`. + * @since v0.3.0 + */ + writeContinue(callback?: () => void): void; + /** + * Sends an HTTP/1.1 103 Early Hints message to the client with a Link header, + * indicating that the user agent can preload/preconnect the linked resources. + * The `hints` is an object containing the values of headers to be sent with + * early hints message. The optional `callback` argument will be called when + * the response message has been written. + * + * **Example** + * + * ```js + * const earlyHintsLink = '; rel=preload; as=style'; + * response.writeEarlyHints({ + * 'link': earlyHintsLink, + * }); + * + * const earlyHintsLinks = [ + * '; rel=preload; as=style', + * '; rel=preload; as=script', + * ]; + * response.writeEarlyHints({ + * 'link': earlyHintsLinks, + * 'x-trace-id': 'id for diagnostics', + * }); + * + * const earlyHintsCallback = () => console.log('early hints message sent'); + * response.writeEarlyHints({ + * 'link': earlyHintsLinks, + * }, earlyHintsCallback); + * ``` + * @since v18.11.0 + * @param hints An object containing the values of headers + * @param callback Will be called when the response message has been written + */ + writeEarlyHints(hints: Record, callback?: () => void): void; + /** + * Sends a response header to the request. The status code is a 3-digit HTTP + * status code, like `404`. The last argument, `headers`, are the response headers. + * Optionally one can give a human-readable `statusMessage` as the second + * argument. + * + * `headers` may be an `Array` where the keys and values are in the same list. + * It is _not_ a list of tuples. So, the even-numbered offsets are key values, + * and the odd-numbered offsets are the associated values. The array is in the same + * format as `request.rawHeaders`. + * + * Returns a reference to the `ServerResponse`, so that calls can be chained. + * + * ```js + * const body = 'hello world'; + * response + * .writeHead(200, { + * 'Content-Length': Buffer.byteLength(body), + * 'Content-Type': 'text/plain', + * }) + * .end(body); + * ``` + * + * This method must only be called once on a message and it must + * be called before `response.end()` is called. + * + * If `response.write()` or `response.end()` are called before calling + * this, the implicit/mutable headers will be calculated and call this function. + * + * When headers have been set with `response.setHeader()`, they will be merged + * with any headers passed to `response.writeHead()`, with the headers passed + * to `response.writeHead()` given precedence. + * + * If this method is called and `response.setHeader()` has not been called, + * it will directly write the supplied header values onto the network channel + * without caching internally, and the `response.getHeader()` on the header + * will not yield the expected result. If progressive population of headers is + * desired with potential future retrieval and modification, use `response.setHeader()` instead. + * + * ```js + * // Returns content-type = text/plain + * const server = http.createServer((req, res) => { + * res.setHeader('Content-Type', 'text/html'); + * res.setHeader('X-Foo', 'bar'); + * res.writeHead(200, { 'Content-Type': 'text/plain' }); + * res.end('ok'); + * }); + * ``` + * + * `Content-Length` is read in bytes, not characters. Use `Buffer.byteLength()` to determine the length of the body in bytes. Node.js + * will check whether `Content-Length` and the length of the body which has + * been transmitted are equal or not. + * + * Attempting to set a header field name or value that contains invalid characters + * will result in a \[`Error`\]\[\] being thrown. + * @since v0.1.30 + */ + writeHead( + statusCode: number, + statusMessage?: string, + headers?: OutgoingHttpHeaders | OutgoingHttpHeader[], + ): this; + writeHead(statusCode: number, headers?: OutgoingHttpHeaders | OutgoingHttpHeader[]): this; + /** + * Sends a HTTP/1.1 102 Processing message to the client, indicating that + * the request body should be sent. + * @since v10.0.0 + */ + writeProcessing(): void; + } + interface InformationEvent { + statusCode: number; + statusMessage: string; + httpVersion: string; + httpVersionMajor: number; + httpVersionMinor: number; + headers: IncomingHttpHeaders; + rawHeaders: string[]; + } + /** + * This object is created internally and returned from {@link request}. It + * represents an _in-progress_ request whose header has already been queued. The + * header is still mutable using the `setHeader(name, value)`,`getHeader(name)`, `removeHeader(name)` API. The actual header will + * be sent along with the first data chunk or when calling `request.end()`. + * + * To get the response, add a listener for `'response'` to the request object.`'response'` will be emitted from the request object when the response + * headers have been received. The `'response'` event is executed with one + * argument which is an instance of {@link IncomingMessage}. + * + * During the `'response'` event, one can add listeners to the + * response object; particularly to listen for the `'data'` event. + * + * If no `'response'` handler is added, then the response will be + * entirely discarded. However, if a `'response'` event handler is added, + * then the data from the response object **must** be consumed, either by + * calling `response.read()` whenever there is a `'readable'` event, or + * by adding a `'data'` handler, or by calling the `.resume()` method. + * Until the data is consumed, the `'end'` event will not fire. Also, until + * the data is read it will consume memory that can eventually lead to a + * 'process out of memory' error. + * + * For backward compatibility, `res` will only emit `'error'` if there is an`'error'` listener registered. + * + * Set `Content-Length` header to limit the response body size. + * If `response.strictContentLength` is set to `true`, mismatching the`Content-Length` header value will result in an `Error` being thrown, + * identified by `code:``'ERR_HTTP_CONTENT_LENGTH_MISMATCH'`. + * + * `Content-Length` value should be in bytes, not characters. Use `Buffer.byteLength()` to determine the length of the body in bytes. + * @since v0.1.17 + */ + class ClientRequest extends OutgoingMessage { + /** + * The `request.aborted` property will be `true` if the request has + * been aborted. + * @since v0.11.14 + * @deprecated Since v17.0.0,v16.12.0 - Check `destroyed` instead. + */ + aborted: boolean; + /** + * The request host. + * @since v14.5.0, v12.19.0 + */ + host: string; + /** + * The request protocol. + * @since v14.5.0, v12.19.0 + */ + protocol: string; + /** + * When sending request through a keep-alive enabled agent, the underlying socket + * might be reused. But if server closes connection at unfortunate time, client + * may run into a 'ECONNRESET' error. + * + * ```js + * import http from 'node:http'; + * + * // Server has a 5 seconds keep-alive timeout by default + * http + * .createServer((req, res) => { + * res.write('hello\n'); + * res.end(); + * }) + * .listen(3000); + * + * setInterval(() => { + * // Adapting a keep-alive agent + * http.get('http://localhost:3000', { agent }, (res) => { + * res.on('data', (data) => { + * // Do nothing + * }); + * }); + * }, 5000); // Sending request on 5s interval so it's easy to hit idle timeout + * ``` + * + * By marking a request whether it reused socket or not, we can do + * automatic error retry base on it. + * + * ```js + * import http from 'node:http'; + * const agent = new http.Agent({ keepAlive: true }); + * + * function retriableRequest() { + * const req = http + * .get('http://localhost:3000', { agent }, (res) => { + * // ... + * }) + * .on('error', (err) => { + * // Check if retry is needed + * if (req.reusedSocket && err.code === 'ECONNRESET') { + * retriableRequest(); + * } + * }); + * } + * + * retriableRequest(); + * ``` + * @since v13.0.0, v12.16.0 + */ + reusedSocket: boolean; + /** + * Limits maximum response headers count. If set to 0, no limit will be applied. + */ + maxHeadersCount: number; + constructor(url: string | URL | ClientRequestArgs, cb?: (res: IncomingMessage) => void); + /** + * The request method. + * @since v0.1.97 + */ + method: string; + /** + * The request path. + * @since v0.4.0 + */ + path: string; + /** + * Marks the request as aborting. Calling this will cause remaining data + * in the response to be dropped and the socket to be destroyed. + * @since v0.3.8 + * @deprecated Since v14.1.0,v13.14.0 - Use `destroy` instead. + */ + abort(): void; + onSocket(socket: Socket): void; + /** + * Once a socket is assigned to this request and is connected `socket.setTimeout()` will be called. + * @since v0.5.9 + * @param timeout Milliseconds before a request times out. + * @param callback Optional function to be called when a timeout occurs. Same as binding to the `'timeout'` event. + */ + setTimeout(timeout: number, callback?: () => void): this; + /** + * Once a socket is assigned to this request and is connected `socket.setNoDelay()` will be called. + * @since v0.5.9 + */ + setNoDelay(noDelay?: boolean): void; + /** + * Once a socket is assigned to this request and is connected `socket.setKeepAlive()` will be called. + * @since v0.5.9 + */ + setSocketKeepAlive(enable?: boolean, initialDelay?: number): void; + /** + * Returns an array containing the unique names of the current outgoing raw + * headers. Header names are returned with their exact casing being set. + * + * ```js + * request.setHeader('Foo', 'bar'); + * request.setHeader('Set-Cookie', ['foo=bar', 'bar=baz']); + * + * const headerNames = request.getRawHeaderNames(); + * // headerNames === ['Foo', 'Set-Cookie'] + * ``` + * @since v15.13.0, v14.17.0 + */ + getRawHeaderNames(): string[]; + /** + * @deprecated + */ + addListener(event: 'abort', listener: () => void): this; + addListener(event: 'connect', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; + addListener(event: 'continue', listener: () => void): this; + addListener(event: 'information', listener: (info: InformationEvent) => void): this; + addListener(event: 'response', listener: (response: IncomingMessage) => void): this; + addListener(event: 'socket', listener: (socket: Socket) => void): this; + addListener(event: 'timeout', listener: () => void): this; + addListener(event: 'upgrade', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; + addListener(event: 'close', listener: () => void): this; + addListener(event: 'drain', listener: () => void): this; + addListener(event: 'error', listener: (err: Error) => void): this; + addListener(event: 'finish', listener: () => void): this; + addListener(event: 'pipe', listener: (src: stream.Readable) => void): this; + addListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + /** + * @deprecated + */ + on(event: 'abort', listener: () => void): this; + on(event: 'connect', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; + on(event: 'continue', listener: () => void): this; + on(event: 'information', listener: (info: InformationEvent) => void): this; + on(event: 'response', listener: (response: IncomingMessage) => void): this; + on(event: 'socket', listener: (socket: Socket) => void): this; + on(event: 'timeout', listener: () => void): this; + on(event: 'upgrade', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; + on(event: 'close', listener: () => void): this; + on(event: 'drain', listener: () => void): this; + on(event: 'error', listener: (err: Error) => void): this; + on(event: 'finish', listener: () => void): this; + on(event: 'pipe', listener: (src: stream.Readable) => void): this; + on(event: 'unpipe', listener: (src: stream.Readable) => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + /** + * @deprecated + */ + once(event: 'abort', listener: () => void): this; + once(event: 'connect', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; + once(event: 'continue', listener: () => void): this; + once(event: 'information', listener: (info: InformationEvent) => void): this; + once(event: 'response', listener: (response: IncomingMessage) => void): this; + once(event: 'socket', listener: (socket: Socket) => void): this; + once(event: 'timeout', listener: () => void): this; + once(event: 'upgrade', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; + once(event: 'close', listener: () => void): this; + once(event: 'drain', listener: () => void): this; + once(event: 'error', listener: (err: Error) => void): this; + once(event: 'finish', listener: () => void): this; + once(event: 'pipe', listener: (src: stream.Readable) => void): this; + once(event: 'unpipe', listener: (src: stream.Readable) => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + /** + * @deprecated + */ + prependListener(event: 'abort', listener: () => void): this; + prependListener(event: 'connect', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; + prependListener(event: 'continue', listener: () => void): this; + prependListener(event: 'information', listener: (info: InformationEvent) => void): this; + prependListener(event: 'response', listener: (response: IncomingMessage) => void): this; + prependListener(event: 'socket', listener: (socket: Socket) => void): this; + prependListener(event: 'timeout', listener: () => void): this; + prependListener(event: 'upgrade', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; + prependListener(event: 'close', listener: () => void): this; + prependListener(event: 'drain', listener: () => void): this; + prependListener(event: 'error', listener: (err: Error) => void): this; + prependListener(event: 'finish', listener: () => void): this; + prependListener(event: 'pipe', listener: (src: stream.Readable) => void): this; + prependListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + /** + * @deprecated + */ + prependOnceListener(event: 'abort', listener: () => void): this; + prependOnceListener(event: 'connect', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; + prependOnceListener(event: 'continue', listener: () => void): this; + prependOnceListener(event: 'information', listener: (info: InformationEvent) => void): this; + prependOnceListener(event: 'response', listener: (response: IncomingMessage) => void): this; + prependOnceListener(event: 'socket', listener: (socket: Socket) => void): this; + prependOnceListener(event: 'timeout', listener: () => void): this; + prependOnceListener(event: 'upgrade', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; + prependOnceListener(event: 'close', listener: () => void): this; + prependOnceListener(event: 'drain', listener: () => void): this; + prependOnceListener(event: 'error', listener: (err: Error) => void): this; + prependOnceListener(event: 'finish', listener: () => void): this; + prependOnceListener(event: 'pipe', listener: (src: stream.Readable) => void): this; + prependOnceListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + } + /** + * An `IncomingMessage` object is created by {@link Server} or {@link ClientRequest} and passed as the first argument to the `'request'` and `'response'` event respectively. It may be used to + * access response + * status, headers, and data. + * + * Different from its `socket` value which is a subclass of `stream.Duplex`, the`IncomingMessage` itself extends `stream.Readable` and is created separately to + * parse and emit the incoming HTTP headers and payload, as the underlying socket + * may be reused multiple times in case of keep-alive. + * @since v0.1.17 + */ + class IncomingMessage extends stream.Readable { + constructor(socket: Socket); + /** + * The `message.aborted` property will be `true` if the request has + * been aborted. + * @since v10.1.0 + * @deprecated Since v17.0.0,v16.12.0 - Check `message.destroyed` from stream.Readable. + */ + aborted: boolean; + /** + * In case of server request, the HTTP version sent by the client. In the case of + * client response, the HTTP version of the connected-to server. + * Probably either `'1.1'` or `'1.0'`. + * + * Also `message.httpVersionMajor` is the first integer and`message.httpVersionMinor` is the second. + * @since v0.1.1 + */ + httpVersion: string; + httpVersionMajor: number; + httpVersionMinor: number; + /** + * The `message.complete` property will be `true` if a complete HTTP message has + * been received and successfully parsed. + * + * This property is particularly useful as a means of determining if a client or + * server fully transmitted a message before a connection was terminated: + * + * ```js + * const req = http.request({ + * host: '127.0.0.1', + * port: 8080, + * method: 'POST', + * }, (res) => { + * res.resume(); + * res.on('end', () => { + * if (!res.complete) + * console.error( + * 'The connection was terminated while the message was still being sent'); + * }); + * }); + * ``` + * @since v0.3.0 + */ + complete: boolean; + /** + * Alias for `message.socket`. + * @since v0.1.90 + * @deprecated Since v16.0.0 - Use `socket`. + */ + connection: Socket; + /** + * The `net.Socket` object associated with the connection. + * + * With HTTPS support, use `request.socket.getPeerCertificate()` to obtain the + * client's authentication details. + * + * This property is guaranteed to be an instance of the `net.Socket` class, + * a subclass of `stream.Duplex`, unless the user specified a socket + * type other than `net.Socket` or internally nulled. + * @since v0.3.0 + */ + socket: Socket; + /** + * The request/response headers object. + * + * Key-value pairs of header names and values. Header names are lower-cased. + * + * ```js + * // Prints something like: + * // + * // { 'user-agent': 'curl/7.22.0', + * // host: '127.0.0.1:8000', + * // accept: '*' } + * console.log(request.headers); + * ``` + * + * Duplicates in raw headers are handled in the following ways, depending on the + * header name: + * + * * Duplicates of `age`, `authorization`, `content-length`, `content-type`,`etag`, `expires`, `from`, `host`, `if-modified-since`, `if-unmodified-since`,`last-modified`, `location`, + * `max-forwards`, `proxy-authorization`, `referer`,`retry-after`, `server`, or `user-agent` are discarded. + * To allow duplicate values of the headers listed above to be joined, + * use the option `joinDuplicateHeaders` in {@link request} and {@link createServer}. See RFC 9110 Section 5.3 for more + * information. + * * `set-cookie` is always an array. Duplicates are added to the array. + * * For duplicate `cookie` headers, the values are joined together with `; `. + * * For all other headers, the values are joined together with `, `. + * @since v0.1.5 + */ + headers: IncomingHttpHeaders; + /** + * Similar to `message.headers`, but there is no join logic and the values are + * always arrays of strings, even for headers received just once. + * + * ```js + * // Prints something like: + * // + * // { 'user-agent': ['curl/7.22.0'], + * // host: ['127.0.0.1:8000'], + * // accept: ['*'] } + * console.log(request.headersDistinct); + * ``` + * @since v18.3.0, v16.17.0 + */ + headersDistinct: NodeJS.Dict; + /** + * The raw request/response headers list exactly as they were received. + * + * The keys and values are in the same list. It is _not_ a + * list of tuples. So, the even-numbered offsets are key values, and the + * odd-numbered offsets are the associated values. + * + * Header names are not lowercased, and duplicates are not merged. + * + * ```js + * // Prints something like: + * // + * // [ 'user-agent', + * // 'this is invalid because there can be only one', + * // 'User-Agent', + * // 'curl/7.22.0', + * // 'Host', + * // '127.0.0.1:8000', + * // 'ACCEPT', + * // '*' ] + * console.log(request.rawHeaders); + * ``` + * @since v0.11.6 + */ + rawHeaders: string[]; + /** + * The request/response trailers object. Only populated at the `'end'` event. + * @since v0.3.0 + */ + trailers: NodeJS.Dict; + /** + * Similar to `message.trailers`, but there is no join logic and the values are + * always arrays of strings, even for headers received just once. + * Only populated at the `'end'` event. + * @since v18.3.0, v16.17.0 + */ + trailersDistinct: NodeJS.Dict; + /** + * The raw request/response trailer keys and values exactly as they were + * received. Only populated at the `'end'` event. + * @since v0.11.6 + */ + rawTrailers: string[]; + /** + * Calls `message.socket.setTimeout(msecs, callback)`. + * @since v0.5.9 + */ + setTimeout(msecs: number, callback?: () => void): this; + /** + * **Only valid for request obtained from {@link Server}.** + * + * The request method as a string. Read only. Examples: `'GET'`, `'DELETE'`. + * @since v0.1.1 + */ + method?: string | undefined; + /** + * **Only valid for request obtained from {@link Server}.** + * + * Request URL string. This contains only the URL that is present in the actual + * HTTP request. Take the following request: + * + * ```http + * GET /status?name=ryan HTTP/1.1 + * Accept: text/plain + * ``` + * + * To parse the URL into its parts: + * + * ```js + * new URL(request.url, `http://${request.headers.host}`); + * ``` + * + * When `request.url` is `'/status?name=ryan'` and `request.headers.host` is`'localhost:3000'`: + * + * ```console + * $ node + * > new URL(request.url, `http://${request.headers.host}`) + * URL { + * href: 'http://localhost:3000/status?name=ryan', + * origin: 'http://localhost:3000', + * protocol: 'http:', + * username: '', + * password: '', + * host: 'localhost:3000', + * hostname: 'localhost', + * port: '3000', + * pathname: '/status', + * search: '?name=ryan', + * searchParams: URLSearchParams { 'name' => 'ryan' }, + * hash: '' + * } + * ``` + * @since v0.1.90 + */ + url?: string | undefined; + /** + * **Only valid for response obtained from {@link ClientRequest}.** + * + * The 3-digit HTTP response status code. E.G. `404`. + * @since v0.1.1 + */ + statusCode?: number | undefined; + /** + * **Only valid for response obtained from {@link ClientRequest}.** + * + * The HTTP response status message (reason phrase). E.G. `OK` or `Internal Server Error`. + * @since v0.11.10 + */ + statusMessage?: string | undefined; + /** + * Calls `destroy()` on the socket that received the `IncomingMessage`. If `error`is provided, an `'error'` event is emitted on the socket and `error` is passed + * as an argument to any listeners on the event. + * @since v0.3.0 + */ + destroy(error?: Error): this; + } + interface AgentOptions extends Partial { + /** + * Keep sockets around in a pool to be used by other requests in the future. Default = false + */ + keepAlive?: boolean | undefined; + /** + * When using HTTP KeepAlive, how often to send TCP KeepAlive packets over sockets being kept alive. Default = 1000. + * Only relevant if keepAlive is set to true. + */ + keepAliveMsecs?: number | undefined; + /** + * Maximum number of sockets to allow per host. Default for Node 0.10 is 5, default for Node 0.12 is Infinity + */ + maxSockets?: number | undefined; + /** + * Maximum number of sockets allowed for all hosts in total. Each request will use a new socket until the maximum is reached. Default: Infinity. + */ + maxTotalSockets?: number | undefined; + /** + * Maximum number of sockets to leave open in a free state. Only relevant if keepAlive is set to true. Default = 256. + */ + maxFreeSockets?: number | undefined; + /** + * Socket timeout in milliseconds. This will set the timeout after the socket is connected. + */ + timeout?: number | undefined; + /** + * Scheduling strategy to apply when picking the next free socket to use. + * @default `lifo` + */ + scheduling?: 'fifo' | 'lifo' | undefined; + } + /** + * An `Agent` is responsible for managing connection persistence + * and reuse for HTTP clients. It maintains a queue of pending requests + * for a given host and port, reusing a single socket connection for each + * until the queue is empty, at which time the socket is either destroyed + * or put into a pool where it is kept to be used again for requests to the + * same host and port. Whether it is destroyed or pooled depends on the`keepAlive` `option`. + * + * Pooled connections have TCP Keep-Alive enabled for them, but servers may + * still close idle connections, in which case they will be removed from the + * pool and a new connection will be made when a new HTTP request is made for + * that host and port. Servers may also refuse to allow multiple requests + * over the same connection, in which case the connection will have to be + * remade for every request and cannot be pooled. The `Agent` will still make + * the requests to that server, but each one will occur over a new connection. + * + * When a connection is closed by the client or the server, it is removed + * from the pool. Any unused sockets in the pool will be unrefed so as not + * to keep the Node.js process running when there are no outstanding requests. + * (see `socket.unref()`). + * + * It is good practice, to `destroy()` an `Agent` instance when it is no + * longer in use, because unused sockets consume OS resources. + * + * Sockets are removed from an agent when the socket emits either + * a `'close'` event or an `'agentRemove'` event. When intending to keep one + * HTTP request open for a long time without keeping it in the agent, something + * like the following may be done: + * + * ```js + * http.get(options, (res) => { + * // Do stuff + * }).on('socket', (socket) => { + * socket.emit('agentRemove'); + * }); + * ``` + * + * An agent may also be used for an individual request. By providing`{agent: false}` as an option to the `http.get()` or `http.request()`functions, a one-time use `Agent` with default options + * will be used + * for the client connection. + * + * `agent:false`: + * + * ```js + * http.get({ + * hostname: 'localhost', + * port: 80, + * path: '/', + * agent: false, // Create a new agent just for this one request + * }, (res) => { + * // Do stuff with response + * }); + * ``` + * @since v0.3.4 + */ + class Agent extends EventEmitter { + /** + * By default set to 256. For agents with `keepAlive` enabled, this + * sets the maximum number of sockets that will be left open in the free + * state. + * @since v0.11.7 + */ + maxFreeSockets: number; + /** + * By default set to `Infinity`. Determines how many concurrent sockets the agent + * can have open per origin. Origin is the returned value of `agent.getName()`. + * @since v0.3.6 + */ + maxSockets: number; + /** + * By default set to `Infinity`. Determines how many concurrent sockets the agent + * can have open. Unlike `maxSockets`, this parameter applies across all origins. + * @since v14.5.0, v12.19.0 + */ + maxTotalSockets: number; + /** + * An object which contains arrays of sockets currently awaiting use by + * the agent when `keepAlive` is enabled. Do not modify. + * + * Sockets in the `freeSockets` list will be automatically destroyed and + * removed from the array on `'timeout'`. + * @since v0.11.4 + */ + readonly freeSockets: NodeJS.ReadOnlyDict; + /** + * An object which contains arrays of sockets currently in use by the + * agent. Do not modify. + * @since v0.3.6 + */ + readonly sockets: NodeJS.ReadOnlyDict; + /** + * An object which contains queues of requests that have not yet been assigned to + * sockets. Do not modify. + * @since v0.5.9 + */ + readonly requests: NodeJS.ReadOnlyDict; + constructor(opts?: AgentOptions); + /** + * Destroy any sockets that are currently in use by the agent. + * + * It is usually not necessary to do this. However, if using an + * agent with `keepAlive` enabled, then it is best to explicitly shut down + * the agent when it is no longer needed. Otherwise, + * sockets might stay open for quite a long time before the server + * terminates them. + * @since v0.11.4 + */ + destroy(): void; + } + const METHODS: string[]; + const STATUS_CODES: { + [errorCode: number]: string | undefined; + [errorCode: string]: string | undefined; + }; + /** + * Returns a new instance of {@link Server}. + * + * The `requestListener` is a function which is automatically + * added to the `'request'` event. + * + * ```js + * import http from 'node:http'; + * + * // Create a local server to receive data from + * const server = http.createServer((req, res) => { + * res.writeHead(200, { 'Content-Type': 'application/json' }); + * res.end(JSON.stringify({ + * data: 'Hello World!', + * })); + * }); + * + * server.listen(8000); + * ``` + * + * ```js + * import http from 'node:http'; + * + * // Create a local server to receive data from + * const server = http.createServer(); + * + * // Listen to the request event + * server.on('request', (request, res) => { + * res.writeHead(200, { 'Content-Type': 'application/json' }); + * res.end(JSON.stringify({ + * data: 'Hello World!', + * })); + * }); + * + * server.listen(8000); + * ``` + * @since v0.1.13 + */ + function createServer< + Request extends typeof IncomingMessage = typeof IncomingMessage, + Response extends typeof ServerResponse = typeof ServerResponse, + >(requestListener?: RequestListener): Server; + function createServer< + Request extends typeof IncomingMessage = typeof IncomingMessage, + Response extends typeof ServerResponse = typeof ServerResponse, + >( + options: ServerOptions, + requestListener?: RequestListener, + ): Server; + // although RequestOptions are passed as ClientRequestArgs to ClientRequest directly, + // create interface RequestOptions would make the naming more clear to developers + interface RequestOptions extends ClientRequestArgs {} + /** + * `options` in `socket.connect()` are also supported. + * + * Node.js maintains several connections per server to make HTTP requests. + * This function allows one to transparently issue requests. + * + * `url` can be a string or a `URL` object. If `url` is a + * string, it is automatically parsed with `new URL()`. If it is a `URL` object, it will be automatically converted to an ordinary `options` object. + * + * If both `url` and `options` are specified, the objects are merged, with the`options` properties taking precedence. + * + * The optional `callback` parameter will be added as a one-time listener for + * the `'response'` event. + * + * `http.request()` returns an instance of the {@link ClientRequest} class. The `ClientRequest` instance is a writable stream. If one needs to + * upload a file with a POST request, then write to the `ClientRequest` object. + * + * ```js + * import http from 'node:http'; + * import { Buffer } from 'node:buffer'; + * + * const postData = JSON.stringify({ + * 'msg': 'Hello World!', + * }); + * + * const options = { + * hostname: 'www.google.com', + * port: 80, + * path: '/upload', + * method: 'POST', + * headers: { + * 'Content-Type': 'application/json', + * 'Content-Length': Buffer.byteLength(postData), + * }, + * }; + * + * const req = http.request(options, (res) => { + * console.log(`STATUS: ${res.statusCode}`); + * console.log(`HEADERS: ${JSON.stringify(res.headers)}`); + * res.setEncoding('utf8'); + * res.on('data', (chunk) => { + * console.log(`BODY: ${chunk}`); + * }); + * res.on('end', () => { + * console.log('No more data in response.'); + * }); + * }); + * + * req.on('error', (e) => { + * console.error(`problem with request: ${e.message}`); + * }); + * + * // Write data to request body + * req.write(postData); + * req.end(); + * ``` + * + * In the example `req.end()` was called. With `http.request()` one + * must always call `req.end()` to signify the end of the request - + * even if there is no data being written to the request body. + * + * If any error is encountered during the request (be that with DNS resolution, + * TCP level errors, or actual HTTP parse errors) an `'error'` event is emitted + * on the returned request object. As with all `'error'` events, if no listeners + * are registered the error will be thrown. + * + * There are a few special headers that should be noted. + * + * * Sending a 'Connection: keep-alive' will notify Node.js that the connection to + * the server should be persisted until the next request. + * * Sending a 'Content-Length' header will disable the default chunked encoding. + * * Sending an 'Expect' header will immediately send the request headers. + * Usually, when sending 'Expect: 100-continue', both a timeout and a listener + * for the `'continue'` event should be set. See RFC 2616 Section 8.2.3 for more + * information. + * * Sending an Authorization header will override using the `auth` option + * to compute basic authentication. + * + * Example using a `URL` as `options`: + * + * ```js + * const options = new URL('http://abc:xyz@example.com'); + * + * const req = http.request(options, (res) => { + * // ... + * }); + * ``` + * + * In a successful request, the following events will be emitted in the following + * order: + * + * * `'socket'` + * * `'response'` + * * `'data'` any number of times, on the `res` object + * (`'data'` will not be emitted at all if the response body is empty, for + * instance, in most redirects) + * * `'end'` on the `res` object + * * `'close'` + * + * In the case of a connection error, the following events will be emitted: + * + * * `'socket'` + * * `'error'` + * * `'close'` + * + * In the case of a premature connection close before the response is received, + * the following events will be emitted in the following order: + * + * * `'socket'` + * * `'error'` with an error with message `'Error: socket hang up'` and code`'ECONNRESET'` + * * `'close'` + * + * In the case of a premature connection close after the response is received, + * the following events will be emitted in the following order: + * + * * `'socket'` + * * `'response'` + * * `'data'` any number of times, on the `res` object + * * (connection closed here) + * * `'aborted'` on the `res` object + * * `'error'` on the `res` object with an error with message`'Error: aborted'` and code `'ECONNRESET'` + * * `'close'` + * * `'close'` on the `res` object + * + * If `req.destroy()` is called before a socket is assigned, the following + * events will be emitted in the following order: + * + * * (`req.destroy()` called here) + * * `'error'` with an error with message `'Error: socket hang up'` and code`'ECONNRESET'`, or the error with which `req.destroy()` was called + * * `'close'` + * + * If `req.destroy()` is called before the connection succeeds, the following + * events will be emitted in the following order: + * + * * `'socket'` + * * (`req.destroy()` called here) + * * `'error'` with an error with message `'Error: socket hang up'` and code`'ECONNRESET'`, or the error with which `req.destroy()` was called + * * `'close'` + * + * If `req.destroy()` is called after the response is received, the following + * events will be emitted in the following order: + * + * * `'socket'` + * * `'response'` + * * `'data'` any number of times, on the `res` object + * * (`req.destroy()` called here) + * * `'aborted'` on the `res` object + * * `'error'` on the `res` object with an error with message `'Error: aborted'`and code `'ECONNRESET'`, or the error with which `req.destroy()` was called + * * `'close'` + * * `'close'` on the `res` object + * + * If `req.abort()` is called before a socket is assigned, the following + * events will be emitted in the following order: + * + * * (`req.abort()` called here) + * * `'abort'` + * * `'close'` + * + * If `req.abort()` is called before the connection succeeds, the following + * events will be emitted in the following order: + * + * * `'socket'` + * * (`req.abort()` called here) + * * `'abort'` + * * `'error'` with an error with message `'Error: socket hang up'` and code`'ECONNRESET'` + * * `'close'` + * + * If `req.abort()` is called after the response is received, the following + * events will be emitted in the following order: + * + * * `'socket'` + * * `'response'` + * * `'data'` any number of times, on the `res` object + * * (`req.abort()` called here) + * * `'abort'` + * * `'aborted'` on the `res` object + * * `'error'` on the `res` object with an error with message`'Error: aborted'` and code `'ECONNRESET'`. + * * `'close'` + * * `'close'` on the `res` object + * + * Setting the `timeout` option or using the `setTimeout()` function will + * not abort the request or do anything besides add a `'timeout'` event. + * + * Passing an `AbortSignal` and then calling `abort()` on the corresponding`AbortController` will behave the same way as calling `.destroy()` on the + * request. Specifically, the `'error'` event will be emitted with an error with + * the message `'AbortError: The operation was aborted'`, the code `'ABORT_ERR'`and the `cause`, if one was provided. + * @since v0.3.6 + */ + function request(options: RequestOptions | string | URL, callback?: (res: IncomingMessage) => void): ClientRequest; + function request(url: string | URL, options: RequestOptions, callback?: (res: IncomingMessage) => void): ClientRequest; + /** + * Since most requests are GET requests without bodies, Node.js provides this + * convenience method. The only difference between this method and {@link request} is that it sets the method to GET by default and calls `req.end()`automatically. The callback must take care to + * consume the response + * data for reasons stated in {@link ClientRequest} section. + * + * The `callback` is invoked with a single argument that is an instance of {@link IncomingMessage}. + * + * JSON fetching example: + * + * ```js + * http.get('http://localhost:8000/', (res) => { + * const { statusCode } = res; + * const contentType = res.headers['content-type']; + * + * let error; + * // Any 2xx status code signals a successful response but + * // here we're only checking for 200. + * if (statusCode !== 200) { + * error = new Error('Request Failed.\n' + + * `Status Code: ${statusCode}`); + * } else if (!/^application\/json/.test(contentType)) { + * error = new Error('Invalid content-type.\n' + + * `Expected application/json but received ${contentType}`); + * } + * if (error) { + * console.error(error.message); + * // Consume response data to free up memory + * res.resume(); + * return; + * } + * + * res.setEncoding('utf8'); + * let rawData = ''; + * res.on('data', (chunk) => { rawData += chunk; }); + * res.on('end', () => { + * try { + * const parsedData = JSON.parse(rawData); + * console.log(parsedData); + * } catch (e) { + * console.error(e.message); + * } + * }); + * }).on('error', (e) => { + * console.error(`Got error: ${e.message}`); + * }); + * + * // Create a local server to receive data from + * const server = http.createServer((req, res) => { + * res.writeHead(200, { 'Content-Type': 'application/json' }); + * res.end(JSON.stringify({ + * data: 'Hello World!', + * })); + * }); + * + * server.listen(8000); + * ``` + * @since v0.3.6 + * @param options Accepts the same `options` as {@link request}, with the method set to GET by default. + */ + function get(options: RequestOptions | string | URL, callback?: (res: IncomingMessage) => void): ClientRequest; + function get(url: string | URL, options: RequestOptions, callback?: (res: IncomingMessage) => void): ClientRequest; + /** + * Performs the low-level validations on the provided `name` that are done when`res.setHeader(name, value)` is called. + * + * Passing illegal value as `name` will result in a `TypeError` being thrown, + * identified by `code: 'ERR_INVALID_HTTP_TOKEN'`. + * + * It is not necessary to use this method before passing headers to an HTTP request + * or response. The HTTP module will automatically validate such headers. + * Examples: + * + * Example: + * + * ```js + * import { validateHeaderName } from 'node:http'; + * + * try { + * validateHeaderName(''); + * } catch (err) { + * console.error(err instanceof TypeError); // --> true + * console.error(err.code); // --> 'ERR_INVALID_HTTP_TOKEN' + * console.error(err.message); // --> 'Header name must be a valid HTTP token [""]' + * } + * ``` + * @since v14.3.0 + * @param [label='Header name'] Label for error message. + */ + function validateHeaderName(name: string): void; + /** + * Performs the low-level validations on the provided `value` that are done when`res.setHeader(name, value)` is called. + * + * Passing illegal value as `value` will result in a `TypeError` being thrown. + * + * * Undefined value error is identified by `code: 'ERR_HTTP_INVALID_HEADER_VALUE'`. + * * Invalid value character error is identified by `code: 'ERR_INVALID_CHAR'`. + * + * It is not necessary to use this method before passing headers to an HTTP request + * or response. The HTTP module will automatically validate such headers. + * + * Examples: + * + * ```js + * import { validateHeaderValue } from 'node:http'; + * + * try { + * validateHeaderValue('x-my-header', undefined); + * } catch (err) { + * console.error(err instanceof TypeError); // --> true + * console.error(err.code === 'ERR_HTTP_INVALID_HEADER_VALUE'); // --> true + * console.error(err.message); // --> 'Invalid value "undefined" for header "x-my-header"' + * } + * + * try { + * validateHeaderValue('x-my-header', 'oʊmɪɡə'); + * } catch (err) { + * console.error(err instanceof TypeError); // --> true + * console.error(err.code === 'ERR_INVALID_CHAR'); // --> true + * console.error(err.message); // --> 'Invalid character in header content ["x-my-header"]' + * } + * ``` + * @since v14.3.0 + * @param name Header name + * @param value Header value + */ + function validateHeaderValue(name: string, value: string): void; + /** + * Set the maximum number of idle HTTP parsers. + * @since v18.8.0, v16.18.0 + * @param [max=1000] + */ + function setMaxIdleHTTPParsers(max: number): void; + let globalAgent: Agent; + /** + * Read-only property specifying the maximum allowed size of HTTP headers in bytes. + * Defaults to 16KB. Configurable using the `--max-http-header-size` CLI option. + */ + const maxHeaderSize: number; +} +declare module 'http' { + export * from 'node:http'; +} diff --git a/node_modules/@types/node/ts4.8/http2.d.ts b/node_modules/@types/node/ts4.8/http2.d.ts new file mode 100644 index 0000000..2f245a9 --- /dev/null +++ b/node_modules/@types/node/ts4.8/http2.d.ts @@ -0,0 +1,2129 @@ +/** + * The `node:http2` module provides an implementation of the [HTTP/2](https://tools.ietf.org/html/rfc7540) protocol. + * It can be accessed using: + * + * ```js + * const http2 = require('node:http2'); + * ``` + * @since v8.4.0 + * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/http2.js) + */ +declare module 'node:http2' { + import EventEmitter = require('node:events'); + import * as fs from 'node:fs'; + import * as net from 'node:net'; + import * as stream from 'node:stream'; + import * as tls from 'node:tls'; + import * as url from 'node:url'; + import { IncomingHttpHeaders as Http1IncomingHttpHeaders, OutgoingHttpHeaders, IncomingMessage, ServerResponse } from 'node:http'; + export { OutgoingHttpHeaders } from 'node:http'; + export interface IncomingHttpStatusHeader { + ':status'?: number | undefined; + } + export interface IncomingHttpHeaders extends Http1IncomingHttpHeaders { + ':path'?: string | undefined; + ':method'?: string | undefined; + ':authority'?: string | undefined; + ':scheme'?: string | undefined; + } + // Http2Stream + export interface StreamPriorityOptions { + exclusive?: boolean | undefined; + parent?: number | undefined; + weight?: number | undefined; + silent?: boolean | undefined; + } + export interface StreamState { + localWindowSize?: number | undefined; + state?: number | undefined; + localClose?: number | undefined; + remoteClose?: number | undefined; + sumDependencyWeight?: number | undefined; + weight?: number | undefined; + } + export interface ServerStreamResponseOptions { + endStream?: boolean | undefined; + waitForTrailers?: boolean | undefined; + } + export interface StatOptions { + offset: number; + length: number; + } + export interface ServerStreamFileResponseOptions { + statCheck?(stats: fs.Stats, headers: OutgoingHttpHeaders, statOptions: StatOptions): void | boolean; + waitForTrailers?: boolean | undefined; + offset?: number | undefined; + length?: number | undefined; + } + export interface ServerStreamFileResponseOptionsWithError extends ServerStreamFileResponseOptions { + onError?(err: NodeJS.ErrnoException): void; + } + export interface Http2Stream extends stream.Duplex { + /** + * Set to `true` if the `Http2Stream` instance was aborted abnormally. When set, + * the `'aborted'` event will have been emitted. + * @since v8.4.0 + */ + readonly aborted: boolean; + /** + * This property shows the number of characters currently buffered to be written. + * See `net.Socket.bufferSize` for details. + * @since v11.2.0, v10.16.0 + */ + readonly bufferSize: number; + /** + * Set to `true` if the `Http2Stream` instance has been closed. + * @since v9.4.0 + */ + readonly closed: boolean; + /** + * Set to `true` if the `Http2Stream` instance has been destroyed and is no longer + * usable. + * @since v8.4.0 + */ + readonly destroyed: boolean; + /** + * Set to `true` if the `END_STREAM` flag was set in the request or response + * HEADERS frame received, indicating that no additional data should be received + * and the readable side of the `Http2Stream` will be closed. + * @since v10.11.0 + */ + readonly endAfterHeaders: boolean; + /** + * The numeric stream identifier of this `Http2Stream` instance. Set to `undefined`if the stream identifier has not yet been assigned. + * @since v8.4.0 + */ + readonly id?: number | undefined; + /** + * Set to `true` if the `Http2Stream` instance has not yet been assigned a + * numeric stream identifier. + * @since v9.4.0 + */ + readonly pending: boolean; + /** + * Set to the `RST_STREAM` `error code` reported when the `Http2Stream` is + * destroyed after either receiving an `RST_STREAM` frame from the connected peer, + * calling `http2stream.close()`, or `http2stream.destroy()`. Will be`undefined` if the `Http2Stream` has not been closed. + * @since v8.4.0 + */ + readonly rstCode: number; + /** + * An object containing the outbound headers sent for this `Http2Stream`. + * @since v9.5.0 + */ + readonly sentHeaders: OutgoingHttpHeaders; + /** + * An array of objects containing the outbound informational (additional) headers + * sent for this `Http2Stream`. + * @since v9.5.0 + */ + readonly sentInfoHeaders?: OutgoingHttpHeaders[] | undefined; + /** + * An object containing the outbound trailers sent for this `HttpStream`. + * @since v9.5.0 + */ + readonly sentTrailers?: OutgoingHttpHeaders | undefined; + /** + * A reference to the `Http2Session` instance that owns this `Http2Stream`. The + * value will be `undefined` after the `Http2Stream` instance is destroyed. + * @since v8.4.0 + */ + readonly session: Http2Session | undefined; + /** + * Provides miscellaneous information about the current state of the`Http2Stream`. + * + * A current state of this `Http2Stream`. + * @since v8.4.0 + */ + readonly state: StreamState; + /** + * Closes the `Http2Stream` instance by sending an `RST_STREAM` frame to the + * connected HTTP/2 peer. + * @since v8.4.0 + * @param [code=http2.constants.NGHTTP2_NO_ERROR] Unsigned 32-bit integer identifying the error code. + * @param callback An optional function registered to listen for the `'close'` event. + */ + close(code?: number, callback?: () => void): void; + /** + * Updates the priority for this `Http2Stream` instance. + * @since v8.4.0 + */ + priority(options: StreamPriorityOptions): void; + /** + * ```js + * const http2 = require('node:http2'); + * const client = http2.connect('http://example.org:8000'); + * const { NGHTTP2_CANCEL } = http2.constants; + * const req = client.request({ ':path': '/' }); + * + * // Cancel the stream if there's no activity after 5 seconds + * req.setTimeout(5000, () => req.close(NGHTTP2_CANCEL)); + * ``` + * @since v8.4.0 + */ + setTimeout(msecs: number, callback?: () => void): void; + /** + * Sends a trailing `HEADERS` frame to the connected HTTP/2 peer. This method + * will cause the `Http2Stream` to be immediately closed and must only be + * called after the `'wantTrailers'` event has been emitted. When sending a + * request or sending a response, the `options.waitForTrailers` option must be set + * in order to keep the `Http2Stream` open after the final `DATA` frame so that + * trailers can be sent. + * + * ```js + * const http2 = require('node:http2'); + * const server = http2.createServer(); + * server.on('stream', (stream) => { + * stream.respond(undefined, { waitForTrailers: true }); + * stream.on('wantTrailers', () => { + * stream.sendTrailers({ xyz: 'abc' }); + * }); + * stream.end('Hello World'); + * }); + * ``` + * + * The HTTP/1 specification forbids trailers from containing HTTP/2 pseudo-header + * fields (e.g. `':method'`, `':path'`, etc). + * @since v10.0.0 + */ + sendTrailers(headers: OutgoingHttpHeaders): void; + addListener(event: 'aborted', listener: () => void): this; + addListener(event: 'close', listener: () => void): this; + addListener(event: 'data', listener: (chunk: Buffer | string) => void): this; + addListener(event: 'drain', listener: () => void): this; + addListener(event: 'end', listener: () => void): this; + addListener(event: 'error', listener: (err: Error) => void): this; + addListener(event: 'finish', listener: () => void): this; + addListener(event: 'frameError', listener: (frameType: number, errorCode: number) => void): this; + addListener(event: 'pipe', listener: (src: stream.Readable) => void): this; + addListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; + addListener(event: 'streamClosed', listener: (code: number) => void): this; + addListener(event: 'timeout', listener: () => void): this; + addListener(event: 'trailers', listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; + addListener(event: 'wantTrailers', listener: () => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + emit(event: 'aborted'): boolean; + emit(event: 'close'): boolean; + emit(event: 'data', chunk: Buffer | string): boolean; + emit(event: 'drain'): boolean; + emit(event: 'end'): boolean; + emit(event: 'error', err: Error): boolean; + emit(event: 'finish'): boolean; + emit(event: 'frameError', frameType: number, errorCode: number): boolean; + emit(event: 'pipe', src: stream.Readable): boolean; + emit(event: 'unpipe', src: stream.Readable): boolean; + emit(event: 'streamClosed', code: number): boolean; + emit(event: 'timeout'): boolean; + emit(event: 'trailers', trailers: IncomingHttpHeaders, flags: number): boolean; + emit(event: 'wantTrailers'): boolean; + emit(event: string | symbol, ...args: any[]): boolean; + on(event: 'aborted', listener: () => void): this; + on(event: 'close', listener: () => void): this; + on(event: 'data', listener: (chunk: Buffer | string) => void): this; + on(event: 'drain', listener: () => void): this; + on(event: 'end', listener: () => void): this; + on(event: 'error', listener: (err: Error) => void): this; + on(event: 'finish', listener: () => void): this; + on(event: 'frameError', listener: (frameType: number, errorCode: number) => void): this; + on(event: 'pipe', listener: (src: stream.Readable) => void): this; + on(event: 'unpipe', listener: (src: stream.Readable) => void): this; + on(event: 'streamClosed', listener: (code: number) => void): this; + on(event: 'timeout', listener: () => void): this; + on(event: 'trailers', listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; + on(event: 'wantTrailers', listener: () => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + once(event: 'aborted', listener: () => void): this; + once(event: 'close', listener: () => void): this; + once(event: 'data', listener: (chunk: Buffer | string) => void): this; + once(event: 'drain', listener: () => void): this; + once(event: 'end', listener: () => void): this; + once(event: 'error', listener: (err: Error) => void): this; + once(event: 'finish', listener: () => void): this; + once(event: 'frameError', listener: (frameType: number, errorCode: number) => void): this; + once(event: 'pipe', listener: (src: stream.Readable) => void): this; + once(event: 'unpipe', listener: (src: stream.Readable) => void): this; + once(event: 'streamClosed', listener: (code: number) => void): this; + once(event: 'timeout', listener: () => void): this; + once(event: 'trailers', listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; + once(event: 'wantTrailers', listener: () => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + prependListener(event: 'aborted', listener: () => void): this; + prependListener(event: 'close', listener: () => void): this; + prependListener(event: 'data', listener: (chunk: Buffer | string) => void): this; + prependListener(event: 'drain', listener: () => void): this; + prependListener(event: 'end', listener: () => void): this; + prependListener(event: 'error', listener: (err: Error) => void): this; + prependListener(event: 'finish', listener: () => void): this; + prependListener(event: 'frameError', listener: (frameType: number, errorCode: number) => void): this; + prependListener(event: 'pipe', listener: (src: stream.Readable) => void): this; + prependListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; + prependListener(event: 'streamClosed', listener: (code: number) => void): this; + prependListener(event: 'timeout', listener: () => void): this; + prependListener(event: 'trailers', listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; + prependListener(event: 'wantTrailers', listener: () => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'aborted', listener: () => void): this; + prependOnceListener(event: 'close', listener: () => void): this; + prependOnceListener(event: 'data', listener: (chunk: Buffer | string) => void): this; + prependOnceListener(event: 'drain', listener: () => void): this; + prependOnceListener(event: 'end', listener: () => void): this; + prependOnceListener(event: 'error', listener: (err: Error) => void): this; + prependOnceListener(event: 'finish', listener: () => void): this; + prependOnceListener(event: 'frameError', listener: (frameType: number, errorCode: number) => void): this; + prependOnceListener(event: 'pipe', listener: (src: stream.Readable) => void): this; + prependOnceListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; + prependOnceListener(event: 'streamClosed', listener: (code: number) => void): this; + prependOnceListener(event: 'timeout', listener: () => void): this; + prependOnceListener(event: 'trailers', listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; + prependOnceListener(event: 'wantTrailers', listener: () => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + } + export interface ClientHttp2Stream extends Http2Stream { + addListener(event: 'continue', listener: () => {}): this; + addListener(event: 'headers', listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + addListener(event: 'push', listener: (headers: IncomingHttpHeaders, flags: number) => void): this; + addListener(event: 'response', listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + emit(event: 'continue'): boolean; + emit(event: 'headers', headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number): boolean; + emit(event: 'push', headers: IncomingHttpHeaders, flags: number): boolean; + emit(event: 'response', headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number): boolean; + emit(event: string | symbol, ...args: any[]): boolean; + on(event: 'continue', listener: () => {}): this; + on(event: 'headers', listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + on(event: 'push', listener: (headers: IncomingHttpHeaders, flags: number) => void): this; + on(event: 'response', listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + once(event: 'continue', listener: () => {}): this; + once(event: 'headers', listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + once(event: 'push', listener: (headers: IncomingHttpHeaders, flags: number) => void): this; + once(event: 'response', listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + prependListener(event: 'continue', listener: () => {}): this; + prependListener(event: 'headers', listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + prependListener(event: 'push', listener: (headers: IncomingHttpHeaders, flags: number) => void): this; + prependListener(event: 'response', listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'continue', listener: () => {}): this; + prependOnceListener(event: 'headers', listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + prependOnceListener(event: 'push', listener: (headers: IncomingHttpHeaders, flags: number) => void): this; + prependOnceListener(event: 'response', listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + } + export interface ServerHttp2Stream extends Http2Stream { + /** + * True if headers were sent, false otherwise (read-only). + * @since v8.4.0 + */ + readonly headersSent: boolean; + /** + * Read-only property mapped to the `SETTINGS_ENABLE_PUSH` flag of the remote + * client's most recent `SETTINGS` frame. Will be `true` if the remote peer + * accepts push streams, `false` otherwise. Settings are the same for every`Http2Stream` in the same `Http2Session`. + * @since v8.4.0 + */ + readonly pushAllowed: boolean; + /** + * Sends an additional informational `HEADERS` frame to the connected HTTP/2 peer. + * @since v8.4.0 + */ + additionalHeaders(headers: OutgoingHttpHeaders): void; + /** + * Initiates a push stream. The callback is invoked with the new `Http2Stream`instance created for the push stream passed as the second argument, or an`Error` passed as the first argument. + * + * ```js + * const http2 = require('node:http2'); + * const server = http2.createServer(); + * server.on('stream', (stream) => { + * stream.respond({ ':status': 200 }); + * stream.pushStream({ ':path': '/' }, (err, pushStream, headers) => { + * if (err) throw err; + * pushStream.respond({ ':status': 200 }); + * pushStream.end('some pushed data'); + * }); + * stream.end('some data'); + * }); + * ``` + * + * Setting the weight of a push stream is not allowed in the `HEADERS` frame. Pass + * a `weight` value to `http2stream.priority` with the `silent` option set to`true` to enable server-side bandwidth balancing between concurrent streams. + * + * Calling `http2stream.pushStream()` from within a pushed stream is not permitted + * and will throw an error. + * @since v8.4.0 + * @param callback Callback that is called once the push stream has been initiated. + */ + pushStream(headers: OutgoingHttpHeaders, callback?: (err: Error | null, pushStream: ServerHttp2Stream, headers: OutgoingHttpHeaders) => void): void; + pushStream(headers: OutgoingHttpHeaders, options?: StreamPriorityOptions, callback?: (err: Error | null, pushStream: ServerHttp2Stream, headers: OutgoingHttpHeaders) => void): void; + /** + * ```js + * const http2 = require('node:http2'); + * const server = http2.createServer(); + * server.on('stream', (stream) => { + * stream.respond({ ':status': 200 }); + * stream.end('some data'); + * }); + * ``` + * + * Initiates a response. When the `options.waitForTrailers` option is set, the`'wantTrailers'` event will be emitted immediately after queuing the last chunk + * of payload data to be sent. The `http2stream.sendTrailers()` method can then be + * used to sent trailing header fields to the peer. + * + * When `options.waitForTrailers` is set, the `Http2Stream` will not automatically + * close when the final `DATA` frame is transmitted. User code must call either`http2stream.sendTrailers()` or `http2stream.close()` to close the`Http2Stream`. + * + * ```js + * const http2 = require('node:http2'); + * const server = http2.createServer(); + * server.on('stream', (stream) => { + * stream.respond({ ':status': 200 }, { waitForTrailers: true }); + * stream.on('wantTrailers', () => { + * stream.sendTrailers({ ABC: 'some value to send' }); + * }); + * stream.end('some data'); + * }); + * ``` + * @since v8.4.0 + */ + respond(headers?: OutgoingHttpHeaders, options?: ServerStreamResponseOptions): void; + /** + * Initiates a response whose data is read from the given file descriptor. No + * validation is performed on the given file descriptor. If an error occurs while + * attempting to read data using the file descriptor, the `Http2Stream` will be + * closed using an `RST_STREAM` frame using the standard `INTERNAL_ERROR` code. + * + * When used, the `Http2Stream` object's `Duplex` interface will be closed + * automatically. + * + * ```js + * const http2 = require('node:http2'); + * const fs = require('node:fs'); + * + * const server = http2.createServer(); + * server.on('stream', (stream) => { + * const fd = fs.openSync('/some/file', 'r'); + * + * const stat = fs.fstatSync(fd); + * const headers = { + * 'content-length': stat.size, + * 'last-modified': stat.mtime.toUTCString(), + * 'content-type': 'text/plain; charset=utf-8', + * }; + * stream.respondWithFD(fd, headers); + * stream.on('close', () => fs.closeSync(fd)); + * }); + * ``` + * + * The optional `options.statCheck` function may be specified to give user code + * an opportunity to set additional content headers based on the `fs.Stat` details + * of the given fd. If the `statCheck` function is provided, the`http2stream.respondWithFD()` method will perform an `fs.fstat()` call to + * collect details on the provided file descriptor. + * + * The `offset` and `length` options may be used to limit the response to a + * specific range subset. This can be used, for instance, to support HTTP Range + * requests. + * + * The file descriptor or `FileHandle` is not closed when the stream is closed, + * so it will need to be closed manually once it is no longer needed. + * Using the same file descriptor concurrently for multiple streams + * is not supported and may result in data loss. Re-using a file descriptor + * after a stream has finished is supported. + * + * When the `options.waitForTrailers` option is set, the `'wantTrailers'` event + * will be emitted immediately after queuing the last chunk of payload data to be + * sent. The `http2stream.sendTrailers()` method can then be used to sent trailing + * header fields to the peer. + * + * When `options.waitForTrailers` is set, the `Http2Stream` will not automatically + * close when the final `DATA` frame is transmitted. User code _must_ call either`http2stream.sendTrailers()` or `http2stream.close()` to close the`Http2Stream`. + * + * ```js + * const http2 = require('node:http2'); + * const fs = require('node:fs'); + * + * const server = http2.createServer(); + * server.on('stream', (stream) => { + * const fd = fs.openSync('/some/file', 'r'); + * + * const stat = fs.fstatSync(fd); + * const headers = { + * 'content-length': stat.size, + * 'last-modified': stat.mtime.toUTCString(), + * 'content-type': 'text/plain; charset=utf-8', + * }; + * stream.respondWithFD(fd, headers, { waitForTrailers: true }); + * stream.on('wantTrailers', () => { + * stream.sendTrailers({ ABC: 'some value to send' }); + * }); + * + * stream.on('close', () => fs.closeSync(fd)); + * }); + * ``` + * @since v8.4.0 + * @param fd A readable file descriptor. + */ + respondWithFD(fd: number | fs.promises.FileHandle, headers?: OutgoingHttpHeaders, options?: ServerStreamFileResponseOptions): void; + /** + * Sends a regular file as the response. The `path` must specify a regular file + * or an `'error'` event will be emitted on the `Http2Stream` object. + * + * When used, the `Http2Stream` object's `Duplex` interface will be closed + * automatically. + * + * The optional `options.statCheck` function may be specified to give user code + * an opportunity to set additional content headers based on the `fs.Stat` details + * of the given file: + * + * If an error occurs while attempting to read the file data, the `Http2Stream`will be closed using an `RST_STREAM` frame using the standard `INTERNAL_ERROR`code. If the `onError` callback is + * defined, then it will be called. Otherwise + * the stream will be destroyed. + * + * Example using a file path: + * + * ```js + * const http2 = require('node:http2'); + * const server = http2.createServer(); + * server.on('stream', (stream) => { + * function statCheck(stat, headers) { + * headers['last-modified'] = stat.mtime.toUTCString(); + * } + * + * function onError(err) { + * // stream.respond() can throw if the stream has been destroyed by + * // the other side. + * try { + * if (err.code === 'ENOENT') { + * stream.respond({ ':status': 404 }); + * } else { + * stream.respond({ ':status': 500 }); + * } + * } catch (err) { + * // Perform actual error handling. + * console.error(err); + * } + * stream.end(); + * } + * + * stream.respondWithFile('/some/file', + * { 'content-type': 'text/plain; charset=utf-8' }, + * { statCheck, onError }); + * }); + * ``` + * + * The `options.statCheck` function may also be used to cancel the send operation + * by returning `false`. For instance, a conditional request may check the stat + * results to determine if the file has been modified to return an appropriate`304` response: + * + * ```js + * const http2 = require('node:http2'); + * const server = http2.createServer(); + * server.on('stream', (stream) => { + * function statCheck(stat, headers) { + * // Check the stat here... + * stream.respond({ ':status': 304 }); + * return false; // Cancel the send operation + * } + * stream.respondWithFile('/some/file', + * { 'content-type': 'text/plain; charset=utf-8' }, + * { statCheck }); + * }); + * ``` + * + * The `content-length` header field will be automatically set. + * + * The `offset` and `length` options may be used to limit the response to a + * specific range subset. This can be used, for instance, to support HTTP Range + * requests. + * + * The `options.onError` function may also be used to handle all the errors + * that could happen before the delivery of the file is initiated. The + * default behavior is to destroy the stream. + * + * When the `options.waitForTrailers` option is set, the `'wantTrailers'` event + * will be emitted immediately after queuing the last chunk of payload data to be + * sent. The `http2stream.sendTrailers()` method can then be used to sent trailing + * header fields to the peer. + * + * When `options.waitForTrailers` is set, the `Http2Stream` will not automatically + * close when the final `DATA` frame is transmitted. User code must call either`http2stream.sendTrailers()` or `http2stream.close()` to close the`Http2Stream`. + * + * ```js + * const http2 = require('node:http2'); + * const server = http2.createServer(); + * server.on('stream', (stream) => { + * stream.respondWithFile('/some/file', + * { 'content-type': 'text/plain; charset=utf-8' }, + * { waitForTrailers: true }); + * stream.on('wantTrailers', () => { + * stream.sendTrailers({ ABC: 'some value to send' }); + * }); + * }); + * ``` + * @since v8.4.0 + */ + respondWithFile(path: string, headers?: OutgoingHttpHeaders, options?: ServerStreamFileResponseOptionsWithError): void; + } + // Http2Session + export interface Settings { + headerTableSize?: number | undefined; + enablePush?: boolean | undefined; + initialWindowSize?: number | undefined; + maxFrameSize?: number | undefined; + maxConcurrentStreams?: number | undefined; + maxHeaderListSize?: number | undefined; + enableConnectProtocol?: boolean | undefined; + } + export interface ClientSessionRequestOptions { + endStream?: boolean | undefined; + exclusive?: boolean | undefined; + parent?: number | undefined; + weight?: number | undefined; + waitForTrailers?: boolean | undefined; + signal?: AbortSignal | undefined; + } + export interface SessionState { + effectiveLocalWindowSize?: number | undefined; + effectiveRecvDataLength?: number | undefined; + nextStreamID?: number | undefined; + localWindowSize?: number | undefined; + lastProcStreamID?: number | undefined; + remoteWindowSize?: number | undefined; + outboundQueueSize?: number | undefined; + deflateDynamicTableSize?: number | undefined; + inflateDynamicTableSize?: number | undefined; + } + export interface Http2Session extends EventEmitter { + /** + * Value will be `undefined` if the `Http2Session` is not yet connected to a + * socket, `h2c` if the `Http2Session` is not connected to a `TLSSocket`, or + * will return the value of the connected `TLSSocket`'s own `alpnProtocol`property. + * @since v9.4.0 + */ + readonly alpnProtocol?: string | undefined; + /** + * Will be `true` if this `Http2Session` instance has been closed, otherwise`false`. + * @since v9.4.0 + */ + readonly closed: boolean; + /** + * Will be `true` if this `Http2Session` instance is still connecting, will be set + * to `false` before emitting `connect` event and/or calling the `http2.connect`callback. + * @since v10.0.0 + */ + readonly connecting: boolean; + /** + * Will be `true` if this `Http2Session` instance has been destroyed and must no + * longer be used, otherwise `false`. + * @since v8.4.0 + */ + readonly destroyed: boolean; + /** + * Value is `undefined` if the `Http2Session` session socket has not yet been + * connected, `true` if the `Http2Session` is connected with a `TLSSocket`, + * and `false` if the `Http2Session` is connected to any other kind of socket + * or stream. + * @since v9.4.0 + */ + readonly encrypted?: boolean | undefined; + /** + * A prototype-less object describing the current local settings of this`Http2Session`. The local settings are local to _this_`Http2Session` instance. + * @since v8.4.0 + */ + readonly localSettings: Settings; + /** + * If the `Http2Session` is connected to a `TLSSocket`, the `originSet` property + * will return an `Array` of origins for which the `Http2Session` may be + * considered authoritative. + * + * The `originSet` property is only available when using a secure TLS connection. + * @since v9.4.0 + */ + readonly originSet?: string[] | undefined; + /** + * Indicates whether the `Http2Session` is currently waiting for acknowledgment of + * a sent `SETTINGS` frame. Will be `true` after calling the`http2session.settings()` method. Will be `false` once all sent `SETTINGS`frames have been acknowledged. + * @since v8.4.0 + */ + readonly pendingSettingsAck: boolean; + /** + * A prototype-less object describing the current remote settings of this`Http2Session`. The remote settings are set by the _connected_ HTTP/2 peer. + * @since v8.4.0 + */ + readonly remoteSettings: Settings; + /** + * Returns a `Proxy` object that acts as a `net.Socket` (or `tls.TLSSocket`) but + * limits available methods to ones safe to use with HTTP/2. + * + * `destroy`, `emit`, `end`, `pause`, `read`, `resume`, and `write` will throw + * an error with code `ERR_HTTP2_NO_SOCKET_MANIPULATION`. See `Http2Session and Sockets` for more information. + * + * `setTimeout` method will be called on this `Http2Session`. + * + * All other interactions will be routed directly to the socket. + * @since v8.4.0 + */ + readonly socket: net.Socket | tls.TLSSocket; + /** + * Provides miscellaneous information about the current state of the`Http2Session`. + * + * An object describing the current status of this `Http2Session`. + * @since v8.4.0 + */ + readonly state: SessionState; + /** + * The `http2session.type` will be equal to`http2.constants.NGHTTP2_SESSION_SERVER` if this `Http2Session` instance is a + * server, and `http2.constants.NGHTTP2_SESSION_CLIENT` if the instance is a + * client. + * @since v8.4.0 + */ + readonly type: number; + /** + * Gracefully closes the `Http2Session`, allowing any existing streams to + * complete on their own and preventing new `Http2Stream` instances from being + * created. Once closed, `http2session.destroy()`_might_ be called if there + * are no open `Http2Stream` instances. + * + * If specified, the `callback` function is registered as a handler for the`'close'` event. + * @since v9.4.0 + */ + close(callback?: () => void): void; + /** + * Immediately terminates the `Http2Session` and the associated `net.Socket` or`tls.TLSSocket`. + * + * Once destroyed, the `Http2Session` will emit the `'close'` event. If `error`is not undefined, an `'error'` event will be emitted immediately before the`'close'` event. + * + * If there are any remaining open `Http2Streams` associated with the`Http2Session`, those will also be destroyed. + * @since v8.4.0 + * @param error An `Error` object if the `Http2Session` is being destroyed due to an error. + * @param code The HTTP/2 error code to send in the final `GOAWAY` frame. If unspecified, and `error` is not undefined, the default is `INTERNAL_ERROR`, otherwise defaults to `NO_ERROR`. + */ + destroy(error?: Error, code?: number): void; + /** + * Transmits a `GOAWAY` frame to the connected peer _without_ shutting down the`Http2Session`. + * @since v9.4.0 + * @param code An HTTP/2 error code + * @param lastStreamID The numeric ID of the last processed `Http2Stream` + * @param opaqueData A `TypedArray` or `DataView` instance containing additional data to be carried within the `GOAWAY` frame. + */ + goaway(code?: number, lastStreamID?: number, opaqueData?: NodeJS.ArrayBufferView): void; + /** + * Sends a `PING` frame to the connected HTTP/2 peer. A `callback` function must + * be provided. The method will return `true` if the `PING` was sent, `false`otherwise. + * + * The maximum number of outstanding (unacknowledged) pings is determined by the`maxOutstandingPings` configuration option. The default maximum is 10. + * + * If provided, the `payload` must be a `Buffer`, `TypedArray`, or `DataView`containing 8 bytes of data that will be transmitted with the `PING` and + * returned with the ping acknowledgment. + * + * The callback will be invoked with three arguments: an error argument that will + * be `null` if the `PING` was successfully acknowledged, a `duration` argument + * that reports the number of milliseconds elapsed since the ping was sent and the + * acknowledgment was received, and a `Buffer` containing the 8-byte `PING`payload. + * + * ```js + * session.ping(Buffer.from('abcdefgh'), (err, duration, payload) => { + * if (!err) { + * console.log(`Ping acknowledged in ${duration} milliseconds`); + * console.log(`With payload '${payload.toString()}'`); + * } + * }); + * ``` + * + * If the `payload` argument is not specified, the default payload will be the + * 64-bit timestamp (little endian) marking the start of the `PING` duration. + * @since v8.9.3 + * @param payload Optional ping payload. + */ + ping(callback: (err: Error | null, duration: number, payload: Buffer) => void): boolean; + ping(payload: NodeJS.ArrayBufferView, callback: (err: Error | null, duration: number, payload: Buffer) => void): boolean; + /** + * Calls `ref()` on this `Http2Session`instance's underlying `net.Socket`. + * @since v9.4.0 + */ + ref(): void; + /** + * Sets the local endpoint's window size. + * The `windowSize` is the total window size to set, not + * the delta. + * + * ```js + * const http2 = require('node:http2'); + * + * const server = http2.createServer(); + * const expectedWindowSize = 2 ** 20; + * server.on('connect', (session) => { + * + * // Set local window size to be 2 ** 20 + * session.setLocalWindowSize(expectedWindowSize); + * }); + * ``` + * @since v15.3.0, v14.18.0 + */ + setLocalWindowSize(windowSize: number): void; + /** + * Used to set a callback function that is called when there is no activity on + * the `Http2Session` after `msecs` milliseconds. The given `callback` is + * registered as a listener on the `'timeout'` event. + * @since v8.4.0 + */ + setTimeout(msecs: number, callback?: () => void): void; + /** + * Updates the current local settings for this `Http2Session` and sends a new`SETTINGS` frame to the connected HTTP/2 peer. + * + * Once called, the `http2session.pendingSettingsAck` property will be `true`while the session is waiting for the remote peer to acknowledge the new + * settings. + * + * The new settings will not become effective until the `SETTINGS` acknowledgment + * is received and the `'localSettings'` event is emitted. It is possible to send + * multiple `SETTINGS` frames while acknowledgment is still pending. + * @since v8.4.0 + * @param callback Callback that is called once the session is connected or right away if the session is already connected. + */ + settings(settings: Settings, callback?: (err: Error | null, settings: Settings, duration: number) => void): void; + /** + * Calls `unref()` on this `Http2Session`instance's underlying `net.Socket`. + * @since v9.4.0 + */ + unref(): void; + addListener(event: 'close', listener: () => void): this; + addListener(event: 'error', listener: (err: Error) => void): this; + addListener(event: 'frameError', listener: (frameType: number, errorCode: number, streamID: number) => void): this; + addListener(event: 'goaway', listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this; + addListener(event: 'localSettings', listener: (settings: Settings) => void): this; + addListener(event: 'ping', listener: () => void): this; + addListener(event: 'remoteSettings', listener: (settings: Settings) => void): this; + addListener(event: 'timeout', listener: () => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + emit(event: 'close'): boolean; + emit(event: 'error', err: Error): boolean; + emit(event: 'frameError', frameType: number, errorCode: number, streamID: number): boolean; + emit(event: 'goaway', errorCode: number, lastStreamID: number, opaqueData: Buffer): boolean; + emit(event: 'localSettings', settings: Settings): boolean; + emit(event: 'ping'): boolean; + emit(event: 'remoteSettings', settings: Settings): boolean; + emit(event: 'timeout'): boolean; + emit(event: string | symbol, ...args: any[]): boolean; + on(event: 'close', listener: () => void): this; + on(event: 'error', listener: (err: Error) => void): this; + on(event: 'frameError', listener: (frameType: number, errorCode: number, streamID: number) => void): this; + on(event: 'goaway', listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this; + on(event: 'localSettings', listener: (settings: Settings) => void): this; + on(event: 'ping', listener: () => void): this; + on(event: 'remoteSettings', listener: (settings: Settings) => void): this; + on(event: 'timeout', listener: () => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + once(event: 'close', listener: () => void): this; + once(event: 'error', listener: (err: Error) => void): this; + once(event: 'frameError', listener: (frameType: number, errorCode: number, streamID: number) => void): this; + once(event: 'goaway', listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this; + once(event: 'localSettings', listener: (settings: Settings) => void): this; + once(event: 'ping', listener: () => void): this; + once(event: 'remoteSettings', listener: (settings: Settings) => void): this; + once(event: 'timeout', listener: () => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + prependListener(event: 'close', listener: () => void): this; + prependListener(event: 'error', listener: (err: Error) => void): this; + prependListener(event: 'frameError', listener: (frameType: number, errorCode: number, streamID: number) => void): this; + prependListener(event: 'goaway', listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this; + prependListener(event: 'localSettings', listener: (settings: Settings) => void): this; + prependListener(event: 'ping', listener: () => void): this; + prependListener(event: 'remoteSettings', listener: (settings: Settings) => void): this; + prependListener(event: 'timeout', listener: () => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'close', listener: () => void): this; + prependOnceListener(event: 'error', listener: (err: Error) => void): this; + prependOnceListener(event: 'frameError', listener: (frameType: number, errorCode: number, streamID: number) => void): this; + prependOnceListener(event: 'goaway', listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this; + prependOnceListener(event: 'localSettings', listener: (settings: Settings) => void): this; + prependOnceListener(event: 'ping', listener: () => void): this; + prependOnceListener(event: 'remoteSettings', listener: (settings: Settings) => void): this; + prependOnceListener(event: 'timeout', listener: () => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + } + export interface ClientHttp2Session extends Http2Session { + /** + * For HTTP/2 Client `Http2Session` instances only, the `http2session.request()`creates and returns an `Http2Stream` instance that can be used to send an + * HTTP/2 request to the connected server. + * + * When a `ClientHttp2Session` is first created, the socket may not yet be + * connected. if `clienthttp2session.request()` is called during this time, the + * actual request will be deferred until the socket is ready to go. + * If the `session` is closed before the actual request be executed, an`ERR_HTTP2_GOAWAY_SESSION` is thrown. + * + * This method is only available if `http2session.type` is equal to`http2.constants.NGHTTP2_SESSION_CLIENT`. + * + * ```js + * const http2 = require('node:http2'); + * const clientSession = http2.connect('https://localhost:1234'); + * const { + * HTTP2_HEADER_PATH, + * HTTP2_HEADER_STATUS, + * } = http2.constants; + * + * const req = clientSession.request({ [HTTP2_HEADER_PATH]: '/' }); + * req.on('response', (headers) => { + * console.log(headers[HTTP2_HEADER_STATUS]); + * req.on('data', (chunk) => { // .. }); + * req.on('end', () => { // .. }); + * }); + * ``` + * + * When the `options.waitForTrailers` option is set, the `'wantTrailers'` event + * is emitted immediately after queuing the last chunk of payload data to be sent. + * The `http2stream.sendTrailers()` method can then be called to send trailing + * headers to the peer. + * + * When `options.waitForTrailers` is set, the `Http2Stream` will not automatically + * close when the final `DATA` frame is transmitted. User code must call either`http2stream.sendTrailers()` or `http2stream.close()` to close the`Http2Stream`. + * + * When `options.signal` is set with an `AbortSignal` and then `abort` on the + * corresponding `AbortController` is called, the request will emit an `'error'`event with an `AbortError` error. + * + * The `:method` and `:path` pseudo-headers are not specified within `headers`, + * they respectively default to: + * + * * `:method` \= `'GET'` + * * `:path` \= `/` + * @since v8.4.0 + */ + request(headers?: OutgoingHttpHeaders, options?: ClientSessionRequestOptions): ClientHttp2Stream; + addListener(event: 'altsvc', listener: (alt: string, origin: string, stream: number) => void): this; + addListener(event: 'origin', listener: (origins: string[]) => void): this; + addListener(event: 'connect', listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + addListener(event: 'stream', listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + emit(event: 'altsvc', alt: string, origin: string, stream: number): boolean; + emit(event: 'origin', origins: ReadonlyArray): boolean; + emit(event: 'connect', session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket): boolean; + emit(event: 'stream', stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number): boolean; + emit(event: string | symbol, ...args: any[]): boolean; + on(event: 'altsvc', listener: (alt: string, origin: string, stream: number) => void): this; + on(event: 'origin', listener: (origins: string[]) => void): this; + on(event: 'connect', listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + on(event: 'stream', listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + once(event: 'altsvc', listener: (alt: string, origin: string, stream: number) => void): this; + once(event: 'origin', listener: (origins: string[]) => void): this; + once(event: 'connect', listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + once(event: 'stream', listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + prependListener(event: 'altsvc', listener: (alt: string, origin: string, stream: number) => void): this; + prependListener(event: 'origin', listener: (origins: string[]) => void): this; + prependListener(event: 'connect', listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + prependListener(event: 'stream', listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'altsvc', listener: (alt: string, origin: string, stream: number) => void): this; + prependOnceListener(event: 'origin', listener: (origins: string[]) => void): this; + prependOnceListener(event: 'connect', listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + prependOnceListener(event: 'stream', listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + } + export interface AlternativeServiceOptions { + origin: number | string | url.URL; + } + export interface ServerHttp2Session extends Http2Session { + readonly server: Http2Server | Http2SecureServer; + /** + * Submits an `ALTSVC` frame (as defined by [RFC 7838](https://tools.ietf.org/html/rfc7838)) to the connected client. + * + * ```js + * const http2 = require('node:http2'); + * + * const server = http2.createServer(); + * server.on('session', (session) => { + * // Set altsvc for origin https://example.org:80 + * session.altsvc('h2=":8000"', 'https://example.org:80'); + * }); + * + * server.on('stream', (stream) => { + * // Set altsvc for a specific stream + * stream.session.altsvc('h2=":8000"', stream.id); + * }); + * ``` + * + * Sending an `ALTSVC` frame with a specific stream ID indicates that the alternate + * service is associated with the origin of the given `Http2Stream`. + * + * The `alt` and origin string _must_ contain only ASCII bytes and are + * strictly interpreted as a sequence of ASCII bytes. The special value `'clear'`may be passed to clear any previously set alternative service for a given + * domain. + * + * When a string is passed for the `originOrStream` argument, it will be parsed as + * a URL and the origin will be derived. For instance, the origin for the + * HTTP URL `'https://example.org/foo/bar'` is the ASCII string`'https://example.org'`. An error will be thrown if either the given string + * cannot be parsed as a URL or if a valid origin cannot be derived. + * + * A `URL` object, or any object with an `origin` property, may be passed as`originOrStream`, in which case the value of the `origin` property will be + * used. The value of the `origin` property _must_ be a properly serialized + * ASCII origin. + * @since v9.4.0 + * @param alt A description of the alternative service configuration as defined by `RFC 7838`. + * @param originOrStream Either a URL string specifying the origin (or an `Object` with an `origin` property) or the numeric identifier of an active `Http2Stream` as given by the + * `http2stream.id` property. + */ + altsvc(alt: string, originOrStream: number | string | url.URL | AlternativeServiceOptions): void; + /** + * Submits an `ORIGIN` frame (as defined by [RFC 8336](https://tools.ietf.org/html/rfc8336)) to the connected client + * to advertise the set of origins for which the server is capable of providing + * authoritative responses. + * + * ```js + * const http2 = require('node:http2'); + * const options = getSecureOptionsSomehow(); + * const server = http2.createSecureServer(options); + * server.on('stream', (stream) => { + * stream.respond(); + * stream.end('ok'); + * }); + * server.on('session', (session) => { + * session.origin('https://example.com', 'https://example.org'); + * }); + * ``` + * + * When a string is passed as an `origin`, it will be parsed as a URL and the + * origin will be derived. For instance, the origin for the HTTP URL`'https://example.org/foo/bar'` is the ASCII string`'https://example.org'`. An error will be thrown if either the given + * string + * cannot be parsed as a URL or if a valid origin cannot be derived. + * + * A `URL` object, or any object with an `origin` property, may be passed as + * an `origin`, in which case the value of the `origin` property will be + * used. The value of the `origin` property _must_ be a properly serialized + * ASCII origin. + * + * Alternatively, the `origins` option may be used when creating a new HTTP/2 + * server using the `http2.createSecureServer()` method: + * + * ```js + * const http2 = require('node:http2'); + * const options = getSecureOptionsSomehow(); + * options.origins = ['https://example.com', 'https://example.org']; + * const server = http2.createSecureServer(options); + * server.on('stream', (stream) => { + * stream.respond(); + * stream.end('ok'); + * }); + * ``` + * @since v10.12.0 + * @param origins One or more URL Strings passed as separate arguments. + */ + origin( + ...origins: Array< + | string + | url.URL + | { + origin: string; + } + > + ): void; + addListener(event: 'connect', listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + addListener(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + emit(event: 'connect', session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket): boolean; + emit(event: 'stream', stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number): boolean; + emit(event: string | symbol, ...args: any[]): boolean; + on(event: 'connect', listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + on(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + once(event: 'connect', listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + once(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + prependListener(event: 'connect', listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + prependListener(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'connect', listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + prependOnceListener(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + } + // Http2Server + export interface SessionOptions { + maxDeflateDynamicTableSize?: number | undefined; + maxSessionMemory?: number | undefined; + maxHeaderListPairs?: number | undefined; + maxOutstandingPings?: number | undefined; + maxSendHeaderBlockLength?: number | undefined; + paddingStrategy?: number | undefined; + peerMaxConcurrentStreams?: number | undefined; + settings?: Settings | undefined; + /** + * Specifies a timeout in milliseconds that + * a server should wait when an [`'unknownProtocol'`][] is emitted. If the + * socket has not been destroyed by that time the server will destroy it. + * @default 100000 + */ + unknownProtocolTimeout?: number | undefined; + selectPadding?(frameLen: number, maxFrameLen: number): number; + } + export interface ClientSessionOptions extends SessionOptions { + maxReservedRemoteStreams?: number | undefined; + createConnection?: ((authority: url.URL, option: SessionOptions) => stream.Duplex) | undefined; + protocol?: 'http:' | 'https:' | undefined; + } + export interface ServerSessionOptions extends SessionOptions { + Http1IncomingMessage?: typeof IncomingMessage | undefined; + Http1ServerResponse?: typeof ServerResponse | undefined; + Http2ServerRequest?: typeof Http2ServerRequest | undefined; + Http2ServerResponse?: typeof Http2ServerResponse | undefined; + } + export interface SecureClientSessionOptions extends ClientSessionOptions, tls.ConnectionOptions {} + export interface SecureServerSessionOptions extends ServerSessionOptions, tls.TlsOptions {} + export interface ServerOptions extends ServerSessionOptions {} + export interface SecureServerOptions extends SecureServerSessionOptions { + allowHTTP1?: boolean | undefined; + origins?: string[] | undefined; + } + interface HTTP2ServerCommon { + setTimeout(msec?: number, callback?: () => void): this; + /** + * Throws ERR_HTTP2_INVALID_SETTING_VALUE for invalid settings values. + * Throws ERR_INVALID_ARG_TYPE for invalid settings argument. + */ + updateSettings(settings: Settings): void; + } + export interface Http2Server extends net.Server, HTTP2ServerCommon { + addListener(event: 'checkContinue', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + addListener(event: 'request', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + addListener(event: 'session', listener: (session: ServerHttp2Session) => void): this; + addListener(event: 'sessionError', listener: (err: Error) => void): this; + addListener(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + addListener(event: 'timeout', listener: () => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + emit(event: 'checkContinue', request: Http2ServerRequest, response: Http2ServerResponse): boolean; + emit(event: 'request', request: Http2ServerRequest, response: Http2ServerResponse): boolean; + emit(event: 'session', session: ServerHttp2Session): boolean; + emit(event: 'sessionError', err: Error): boolean; + emit(event: 'stream', stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number): boolean; + emit(event: 'timeout'): boolean; + emit(event: string | symbol, ...args: any[]): boolean; + on(event: 'checkContinue', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + on(event: 'request', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + on(event: 'session', listener: (session: ServerHttp2Session) => void): this; + on(event: 'sessionError', listener: (err: Error) => void): this; + on(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + on(event: 'timeout', listener: () => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + once(event: 'checkContinue', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + once(event: 'request', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + once(event: 'session', listener: (session: ServerHttp2Session) => void): this; + once(event: 'sessionError', listener: (err: Error) => void): this; + once(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + once(event: 'timeout', listener: () => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + prependListener(event: 'checkContinue', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + prependListener(event: 'request', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + prependListener(event: 'session', listener: (session: ServerHttp2Session) => void): this; + prependListener(event: 'sessionError', listener: (err: Error) => void): this; + prependListener(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + prependListener(event: 'timeout', listener: () => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'checkContinue', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + prependOnceListener(event: 'request', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + prependOnceListener(event: 'session', listener: (session: ServerHttp2Session) => void): this; + prependOnceListener(event: 'sessionError', listener: (err: Error) => void): this; + prependOnceListener(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + prependOnceListener(event: 'timeout', listener: () => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + } + export interface Http2SecureServer extends tls.Server, HTTP2ServerCommon { + addListener(event: 'checkContinue', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + addListener(event: 'request', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + addListener(event: 'session', listener: (session: ServerHttp2Session) => void): this; + addListener(event: 'sessionError', listener: (err: Error) => void): this; + addListener(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + addListener(event: 'timeout', listener: () => void): this; + addListener(event: 'unknownProtocol', listener: (socket: tls.TLSSocket) => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + emit(event: 'checkContinue', request: Http2ServerRequest, response: Http2ServerResponse): boolean; + emit(event: 'request', request: Http2ServerRequest, response: Http2ServerResponse): boolean; + emit(event: 'session', session: ServerHttp2Session): boolean; + emit(event: 'sessionError', err: Error): boolean; + emit(event: 'stream', stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number): boolean; + emit(event: 'timeout'): boolean; + emit(event: 'unknownProtocol', socket: tls.TLSSocket): boolean; + emit(event: string | symbol, ...args: any[]): boolean; + on(event: 'checkContinue', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + on(event: 'request', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + on(event: 'session', listener: (session: ServerHttp2Session) => void): this; + on(event: 'sessionError', listener: (err: Error) => void): this; + on(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + on(event: 'timeout', listener: () => void): this; + on(event: 'unknownProtocol', listener: (socket: tls.TLSSocket) => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + once(event: 'checkContinue', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + once(event: 'request', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + once(event: 'session', listener: (session: ServerHttp2Session) => void): this; + once(event: 'sessionError', listener: (err: Error) => void): this; + once(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + once(event: 'timeout', listener: () => void): this; + once(event: 'unknownProtocol', listener: (socket: tls.TLSSocket) => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + prependListener(event: 'checkContinue', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + prependListener(event: 'request', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + prependListener(event: 'session', listener: (session: ServerHttp2Session) => void): this; + prependListener(event: 'sessionError', listener: (err: Error) => void): this; + prependListener(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + prependListener(event: 'timeout', listener: () => void): this; + prependListener(event: 'unknownProtocol', listener: (socket: tls.TLSSocket) => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'checkContinue', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + prependOnceListener(event: 'request', listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + prependOnceListener(event: 'session', listener: (session: ServerHttp2Session) => void): this; + prependOnceListener(event: 'sessionError', listener: (err: Error) => void): this; + prependOnceListener(event: 'stream', listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + prependOnceListener(event: 'timeout', listener: () => void): this; + prependOnceListener(event: 'unknownProtocol', listener: (socket: tls.TLSSocket) => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + } + /** + * A `Http2ServerRequest` object is created by {@link Server} or {@link SecureServer} and passed as the first argument to the `'request'` event. It may be used to access a request status, + * headers, and + * data. + * @since v8.4.0 + */ + export class Http2ServerRequest extends stream.Readable { + constructor(stream: ServerHttp2Stream, headers: IncomingHttpHeaders, options: stream.ReadableOptions, rawHeaders: ReadonlyArray); + /** + * The `request.aborted` property will be `true` if the request has + * been aborted. + * @since v10.1.0 + */ + readonly aborted: boolean; + /** + * The request authority pseudo header field. Because HTTP/2 allows requests + * to set either `:authority` or `host`, this value is derived from`req.headers[':authority']` if present. Otherwise, it is derived from`req.headers['host']`. + * @since v8.4.0 + */ + readonly authority: string; + /** + * See `request.socket`. + * @since v8.4.0 + * @deprecated Since v13.0.0 - Use `socket`. + */ + readonly connection: net.Socket | tls.TLSSocket; + /** + * The `request.complete` property will be `true` if the request has + * been completed, aborted, or destroyed. + * @since v12.10.0 + */ + readonly complete: boolean; + /** + * The request/response headers object. + * + * Key-value pairs of header names and values. Header names are lower-cased. + * + * ```js + * // Prints something like: + * // + * // { 'user-agent': 'curl/7.22.0', + * // host: '127.0.0.1:8000', + * // accept: '*' } + * console.log(request.headers); + * ``` + * + * See `HTTP/2 Headers Object`. + * + * In HTTP/2, the request path, host name, protocol, and method are represented as + * special headers prefixed with the `:` character (e.g. `':path'`). These special + * headers will be included in the `request.headers` object. Care must be taken not + * to inadvertently modify these special headers or errors may occur. For instance, + * removing all headers from the request will cause errors to occur: + * + * ```js + * removeAllHeaders(request.headers); + * assert(request.url); // Fails because the :path header has been removed + * ``` + * @since v8.4.0 + */ + readonly headers: IncomingHttpHeaders; + /** + * In case of server request, the HTTP version sent by the client. In the case of + * client response, the HTTP version of the connected-to server. Returns`'2.0'`. + * + * Also `message.httpVersionMajor` is the first integer and`message.httpVersionMinor` is the second. + * @since v8.4.0 + */ + readonly httpVersion: string; + readonly httpVersionMinor: number; + readonly httpVersionMajor: number; + /** + * The request method as a string. Read-only. Examples: `'GET'`, `'DELETE'`. + * @since v8.4.0 + */ + readonly method: string; + /** + * The raw request/response headers list exactly as they were received. + * + * The keys and values are in the same list. It is _not_ a + * list of tuples. So, the even-numbered offsets are key values, and the + * odd-numbered offsets are the associated values. + * + * Header names are not lowercased, and duplicates are not merged. + * + * ```js + * // Prints something like: + * // + * // [ 'user-agent', + * // 'this is invalid because there can be only one', + * // 'User-Agent', + * // 'curl/7.22.0', + * // 'Host', + * // '127.0.0.1:8000', + * // 'ACCEPT', + * // '*' ] + * console.log(request.rawHeaders); + * ``` + * @since v8.4.0 + */ + readonly rawHeaders: string[]; + /** + * The raw request/response trailer keys and values exactly as they were + * received. Only populated at the `'end'` event. + * @since v8.4.0 + */ + readonly rawTrailers: string[]; + /** + * The request scheme pseudo header field indicating the scheme + * portion of the target URL. + * @since v8.4.0 + */ + readonly scheme: string; + /** + * Returns a `Proxy` object that acts as a `net.Socket` (or `tls.TLSSocket`) but + * applies getters, setters, and methods based on HTTP/2 logic. + * + * `destroyed`, `readable`, and `writable` properties will be retrieved from and + * set on `request.stream`. + * + * `destroy`, `emit`, `end`, `on` and `once` methods will be called on`request.stream`. + * + * `setTimeout` method will be called on `request.stream.session`. + * + * `pause`, `read`, `resume`, and `write` will throw an error with code`ERR_HTTP2_NO_SOCKET_MANIPULATION`. See `Http2Session and Sockets` for + * more information. + * + * All other interactions will be routed directly to the socket. With TLS support, + * use `request.socket.getPeerCertificate()` to obtain the client's + * authentication details. + * @since v8.4.0 + */ + readonly socket: net.Socket | tls.TLSSocket; + /** + * The `Http2Stream` object backing the request. + * @since v8.4.0 + */ + readonly stream: ServerHttp2Stream; + /** + * The request/response trailers object. Only populated at the `'end'` event. + * @since v8.4.0 + */ + readonly trailers: IncomingHttpHeaders; + /** + * Request URL string. This contains only the URL that is present in the actual + * HTTP request. If the request is: + * + * ```http + * GET /status?name=ryan HTTP/1.1 + * Accept: text/plain + * ``` + * + * Then `request.url` will be: + * + * ```js + * '/status?name=ryan' + * ``` + * + * To parse the url into its parts, `new URL()` can be used: + * + * ```console + * $ node + * > new URL('/status?name=ryan', 'http://example.com') + * URL { + * href: 'http://example.com/status?name=ryan', + * origin: 'http://example.com', + * protocol: 'http:', + * username: '', + * password: '', + * host: 'example.com', + * hostname: 'example.com', + * port: '', + * pathname: '/status', + * search: '?name=ryan', + * searchParams: URLSearchParams { 'name' => 'ryan' }, + * hash: '' + * } + * ``` + * @since v8.4.0 + */ + url: string; + /** + * Sets the `Http2Stream`'s timeout value to `msecs`. If a callback is + * provided, then it is added as a listener on the `'timeout'` event on + * the response object. + * + * If no `'timeout'` listener is added to the request, the response, or + * the server, then `Http2Stream` s are destroyed when they time out. If a + * handler is assigned to the request, the response, or the server's `'timeout'`events, timed out sockets must be handled explicitly. + * @since v8.4.0 + */ + setTimeout(msecs: number, callback?: () => void): void; + read(size?: number): Buffer | string | null; + addListener(event: 'aborted', listener: (hadError: boolean, code: number) => void): this; + addListener(event: 'close', listener: () => void): this; + addListener(event: 'data', listener: (chunk: Buffer | string) => void): this; + addListener(event: 'end', listener: () => void): this; + addListener(event: 'readable', listener: () => void): this; + addListener(event: 'error', listener: (err: Error) => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + emit(event: 'aborted', hadError: boolean, code: number): boolean; + emit(event: 'close'): boolean; + emit(event: 'data', chunk: Buffer | string): boolean; + emit(event: 'end'): boolean; + emit(event: 'readable'): boolean; + emit(event: 'error', err: Error): boolean; + emit(event: string | symbol, ...args: any[]): boolean; + on(event: 'aborted', listener: (hadError: boolean, code: number) => void): this; + on(event: 'close', listener: () => void): this; + on(event: 'data', listener: (chunk: Buffer | string) => void): this; + on(event: 'end', listener: () => void): this; + on(event: 'readable', listener: () => void): this; + on(event: 'error', listener: (err: Error) => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + once(event: 'aborted', listener: (hadError: boolean, code: number) => void): this; + once(event: 'close', listener: () => void): this; + once(event: 'data', listener: (chunk: Buffer | string) => void): this; + once(event: 'end', listener: () => void): this; + once(event: 'readable', listener: () => void): this; + once(event: 'error', listener: (err: Error) => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + prependListener(event: 'aborted', listener: (hadError: boolean, code: number) => void): this; + prependListener(event: 'close', listener: () => void): this; + prependListener(event: 'data', listener: (chunk: Buffer | string) => void): this; + prependListener(event: 'end', listener: () => void): this; + prependListener(event: 'readable', listener: () => void): this; + prependListener(event: 'error', listener: (err: Error) => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'aborted', listener: (hadError: boolean, code: number) => void): this; + prependOnceListener(event: 'close', listener: () => void): this; + prependOnceListener(event: 'data', listener: (chunk: Buffer | string) => void): this; + prependOnceListener(event: 'end', listener: () => void): this; + prependOnceListener(event: 'readable', listener: () => void): this; + prependOnceListener(event: 'error', listener: (err: Error) => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + } + /** + * This object is created internally by an HTTP server, not by the user. It is + * passed as the second parameter to the `'request'` event. + * @since v8.4.0 + */ + export class Http2ServerResponse extends stream.Writable { + constructor(stream: ServerHttp2Stream); + /** + * See `response.socket`. + * @since v8.4.0 + * @deprecated Since v13.0.0 - Use `socket`. + */ + readonly connection: net.Socket | tls.TLSSocket; + /** + * Boolean value that indicates whether the response has completed. Starts + * as `false`. After `response.end()` executes, the value will be `true`. + * @since v8.4.0 + * @deprecated Since v13.4.0,v12.16.0 - Use `writableEnded`. + */ + readonly finished: boolean; + /** + * True if headers were sent, false otherwise (read-only). + * @since v8.4.0 + */ + readonly headersSent: boolean; + /** + * A reference to the original HTTP2 `request` object. + * @since v15.7.0 + */ + readonly req: Http2ServerRequest; + /** + * Returns a `Proxy` object that acts as a `net.Socket` (or `tls.TLSSocket`) but + * applies getters, setters, and methods based on HTTP/2 logic. + * + * `destroyed`, `readable`, and `writable` properties will be retrieved from and + * set on `response.stream`. + * + * `destroy`, `emit`, `end`, `on` and `once` methods will be called on`response.stream`. + * + * `setTimeout` method will be called on `response.stream.session`. + * + * `pause`, `read`, `resume`, and `write` will throw an error with code`ERR_HTTP2_NO_SOCKET_MANIPULATION`. See `Http2Session and Sockets` for + * more information. + * + * All other interactions will be routed directly to the socket. + * + * ```js + * const http2 = require('node:http2'); + * const server = http2.createServer((req, res) => { + * const ip = req.socket.remoteAddress; + * const port = req.socket.remotePort; + * res.end(`Your IP address is ${ip} and your source port is ${port}.`); + * }).listen(3000); + * ``` + * @since v8.4.0 + */ + readonly socket: net.Socket | tls.TLSSocket; + /** + * The `Http2Stream` object backing the response. + * @since v8.4.0 + */ + readonly stream: ServerHttp2Stream; + /** + * When true, the Date header will be automatically generated and sent in + * the response if it is not already present in the headers. Defaults to true. + * + * This should only be disabled for testing; HTTP requires the Date header + * in responses. + * @since v8.4.0 + */ + sendDate: boolean; + /** + * When using implicit headers (not calling `response.writeHead()` explicitly), + * this property controls the status code that will be sent to the client when + * the headers get flushed. + * + * ```js + * response.statusCode = 404; + * ``` + * + * After response header was sent to the client, this property indicates the + * status code which was sent out. + * @since v8.4.0 + */ + statusCode: number; + /** + * Status message is not supported by HTTP/2 (RFC 7540 8.1.2.4). It returns + * an empty string. + * @since v8.4.0 + */ + statusMessage: ''; + /** + * This method adds HTTP trailing headers (a header but at the end of the + * message) to the response. + * + * Attempting to set a header field name or value that contains invalid characters + * will result in a `TypeError` being thrown. + * @since v8.4.0 + */ + addTrailers(trailers: OutgoingHttpHeaders): void; + /** + * This method signals to the server that all of the response headers and body + * have been sent; that server should consider this message complete. + * The method, `response.end()`, MUST be called on each response. + * + * If `data` is specified, it is equivalent to calling `response.write(data, encoding)` followed by `response.end(callback)`. + * + * If `callback` is specified, it will be called when the response stream + * is finished. + * @since v8.4.0 + */ + end(callback?: () => void): this; + end(data: string | Uint8Array, callback?: () => void): this; + end(data: string | Uint8Array, encoding: BufferEncoding, callback?: () => void): this; + /** + * Reads out a header that has already been queued but not sent to the client. + * The name is case-insensitive. + * + * ```js + * const contentType = response.getHeader('content-type'); + * ``` + * @since v8.4.0 + */ + getHeader(name: string): string; + /** + * Returns an array containing the unique names of the current outgoing headers. + * All header names are lowercase. + * + * ```js + * response.setHeader('Foo', 'bar'); + * response.setHeader('Set-Cookie', ['foo=bar', 'bar=baz']); + * + * const headerNames = response.getHeaderNames(); + * // headerNames === ['foo', 'set-cookie'] + * ``` + * @since v8.4.0 + */ + getHeaderNames(): string[]; + /** + * Returns a shallow copy of the current outgoing headers. Since a shallow copy + * is used, array values may be mutated without additional calls to various + * header-related http module methods. The keys of the returned object are the + * header names and the values are the respective header values. All header names + * are lowercase. + * + * The object returned by the `response.getHeaders()` method _does not_prototypically inherit from the JavaScript `Object`. This means that typical`Object` methods such as `obj.toString()`, + * `obj.hasOwnProperty()`, and others + * are not defined and _will not work_. + * + * ```js + * response.setHeader('Foo', 'bar'); + * response.setHeader('Set-Cookie', ['foo=bar', 'bar=baz']); + * + * const headers = response.getHeaders(); + * // headers === { foo: 'bar', 'set-cookie': ['foo=bar', 'bar=baz'] } + * ``` + * @since v8.4.0 + */ + getHeaders(): OutgoingHttpHeaders; + /** + * Returns `true` if the header identified by `name` is currently set in the + * outgoing headers. The header name matching is case-insensitive. + * + * ```js + * const hasContentType = response.hasHeader('content-type'); + * ``` + * @since v8.4.0 + */ + hasHeader(name: string): boolean; + /** + * Removes a header that has been queued for implicit sending. + * + * ```js + * response.removeHeader('Content-Encoding'); + * ``` + * @since v8.4.0 + */ + removeHeader(name: string): void; + /** + * Sets a single header value for implicit headers. If this header already exists + * in the to-be-sent headers, its value will be replaced. Use an array of strings + * here to send multiple headers with the same name. + * + * ```js + * response.setHeader('Content-Type', 'text/html; charset=utf-8'); + * ``` + * + * or + * + * ```js + * response.setHeader('Set-Cookie', ['type=ninja', 'language=javascript']); + * ``` + * + * Attempting to set a header field name or value that contains invalid characters + * will result in a `TypeError` being thrown. + * + * When headers have been set with `response.setHeader()`, they will be merged + * with any headers passed to `response.writeHead()`, with the headers passed + * to `response.writeHead()` given precedence. + * + * ```js + * // Returns content-type = text/plain + * const server = http2.createServer((req, res) => { + * res.setHeader('Content-Type', 'text/html; charset=utf-8'); + * res.setHeader('X-Foo', 'bar'); + * res.writeHead(200, { 'Content-Type': 'text/plain; charset=utf-8' }); + * res.end('ok'); + * }); + * ``` + * @since v8.4.0 + */ + setHeader(name: string, value: number | string | ReadonlyArray): void; + /** + * Sets the `Http2Stream`'s timeout value to `msecs`. If a callback is + * provided, then it is added as a listener on the `'timeout'` event on + * the response object. + * + * If no `'timeout'` listener is added to the request, the response, or + * the server, then `Http2Stream` s are destroyed when they time out. If a + * handler is assigned to the request, the response, or the server's `'timeout'`events, timed out sockets must be handled explicitly. + * @since v8.4.0 + */ + setTimeout(msecs: number, callback?: () => void): void; + /** + * If this method is called and `response.writeHead()` has not been called, + * it will switch to implicit header mode and flush the implicit headers. + * + * This sends a chunk of the response body. This method may + * be called multiple times to provide successive parts of the body. + * + * In the `node:http` module, the response body is omitted when the + * request is a HEAD request. Similarly, the `204` and `304` responses _must not_ include a message body. + * + * `chunk` can be a string or a buffer. If `chunk` is a string, + * the second parameter specifies how to encode it into a byte stream. + * By default the `encoding` is `'utf8'`. `callback` will be called when this chunk + * of data is flushed. + * + * This is the raw HTTP body and has nothing to do with higher-level multi-part + * body encodings that may be used. + * + * The first time `response.write()` is called, it will send the buffered + * header information and the first chunk of the body to the client. The second + * time `response.write()` is called, Node.js assumes data will be streamed, + * and sends the new data separately. That is, the response is buffered up to the + * first chunk of the body. + * + * Returns `true` if the entire data was flushed successfully to the kernel + * buffer. Returns `false` if all or part of the data was queued in user memory.`'drain'` will be emitted when the buffer is free again. + * @since v8.4.0 + */ + write(chunk: string | Uint8Array, callback?: (err: Error) => void): boolean; + write(chunk: string | Uint8Array, encoding: BufferEncoding, callback?: (err: Error) => void): boolean; + /** + * Sends a status `100 Continue` to the client, indicating that the request body + * should be sent. See the `'checkContinue'` event on `Http2Server` and`Http2SecureServer`. + * @since v8.4.0 + */ + writeContinue(): void; + /** + * Sends a status `103 Early Hints` to the client with a Link header, + * indicating that the user agent can preload/preconnect the linked resources. + * The `hints` is an object containing the values of headers to be sent with + * early hints message. + * + * **Example** + * + * ```js + * const earlyHintsLink = '; rel=preload; as=style'; + * response.writeEarlyHints({ + * 'link': earlyHintsLink, + * }); + * + * const earlyHintsLinks = [ + * '; rel=preload; as=style', + * '; rel=preload; as=script', + * ]; + * response.writeEarlyHints({ + * 'link': earlyHintsLinks, + * }); + * ``` + * @since v18.11.0 + */ + writeEarlyHints(hints: Record): void; + /** + * Sends a response header to the request. The status code is a 3-digit HTTP + * status code, like `404`. The last argument, `headers`, are the response headers. + * + * Returns a reference to the `Http2ServerResponse`, so that calls can be chained. + * + * For compatibility with `HTTP/1`, a human-readable `statusMessage` may be + * passed as the second argument. However, because the `statusMessage` has no + * meaning within HTTP/2, the argument will have no effect and a process warning + * will be emitted. + * + * ```js + * const body = 'hello world'; + * response.writeHead(200, { + * 'Content-Length': Buffer.byteLength(body), + * 'Content-Type': 'text/plain; charset=utf-8', + * }); + * ``` + * + * `Content-Length` is given in bytes not characters. The`Buffer.byteLength()` API may be used to determine the number of bytes in a + * given encoding. On outbound messages, Node.js does not check if Content-Length + * and the length of the body being transmitted are equal or not. However, when + * receiving messages, Node.js will automatically reject messages when the`Content-Length` does not match the actual payload size. + * + * This method may be called at most one time on a message before `response.end()` is called. + * + * If `response.write()` or `response.end()` are called before calling + * this, the implicit/mutable headers will be calculated and call this function. + * + * When headers have been set with `response.setHeader()`, they will be merged + * with any headers passed to `response.writeHead()`, with the headers passed + * to `response.writeHead()` given precedence. + * + * ```js + * // Returns content-type = text/plain + * const server = http2.createServer((req, res) => { + * res.setHeader('Content-Type', 'text/html; charset=utf-8'); + * res.setHeader('X-Foo', 'bar'); + * res.writeHead(200, { 'Content-Type': 'text/plain; charset=utf-8' }); + * res.end('ok'); + * }); + * ``` + * + * Attempting to set a header field name or value that contains invalid characters + * will result in a `TypeError` being thrown. + * @since v8.4.0 + */ + writeHead(statusCode: number, headers?: OutgoingHttpHeaders): this; + writeHead(statusCode: number, statusMessage: string, headers?: OutgoingHttpHeaders): this; + /** + * Call `http2stream.pushStream()` with the given headers, and wrap the + * given `Http2Stream` on a newly created `Http2ServerResponse` as the callback + * parameter if successful. When `Http2ServerRequest` is closed, the callback is + * called with an error `ERR_HTTP2_INVALID_STREAM`. + * @since v8.4.0 + * @param headers An object describing the headers + * @param callback Called once `http2stream.pushStream()` is finished, or either when the attempt to create the pushed `Http2Stream` has failed or has been rejected, or the state of + * `Http2ServerRequest` is closed prior to calling the `http2stream.pushStream()` method + */ + createPushResponse(headers: OutgoingHttpHeaders, callback: (err: Error | null, res: Http2ServerResponse) => void): void; + addListener(event: 'close', listener: () => void): this; + addListener(event: 'drain', listener: () => void): this; + addListener(event: 'error', listener: (error: Error) => void): this; + addListener(event: 'finish', listener: () => void): this; + addListener(event: 'pipe', listener: (src: stream.Readable) => void): this; + addListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + emit(event: 'close'): boolean; + emit(event: 'drain'): boolean; + emit(event: 'error', error: Error): boolean; + emit(event: 'finish'): boolean; + emit(event: 'pipe', src: stream.Readable): boolean; + emit(event: 'unpipe', src: stream.Readable): boolean; + emit(event: string | symbol, ...args: any[]): boolean; + on(event: 'close', listener: () => void): this; + on(event: 'drain', listener: () => void): this; + on(event: 'error', listener: (error: Error) => void): this; + on(event: 'finish', listener: () => void): this; + on(event: 'pipe', listener: (src: stream.Readable) => void): this; + on(event: 'unpipe', listener: (src: stream.Readable) => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + once(event: 'close', listener: () => void): this; + once(event: 'drain', listener: () => void): this; + once(event: 'error', listener: (error: Error) => void): this; + once(event: 'finish', listener: () => void): this; + once(event: 'pipe', listener: (src: stream.Readable) => void): this; + once(event: 'unpipe', listener: (src: stream.Readable) => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + prependListener(event: 'close', listener: () => void): this; + prependListener(event: 'drain', listener: () => void): this; + prependListener(event: 'error', listener: (error: Error) => void): this; + prependListener(event: 'finish', listener: () => void): this; + prependListener(event: 'pipe', listener: (src: stream.Readable) => void): this; + prependListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'close', listener: () => void): this; + prependOnceListener(event: 'drain', listener: () => void): this; + prependOnceListener(event: 'error', listener: (error: Error) => void): this; + prependOnceListener(event: 'finish', listener: () => void): this; + prependOnceListener(event: 'pipe', listener: (src: stream.Readable) => void): this; + prependOnceListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + } + export namespace constants { + const NGHTTP2_SESSION_SERVER: number; + const NGHTTP2_SESSION_CLIENT: number; + const NGHTTP2_STREAM_STATE_IDLE: number; + const NGHTTP2_STREAM_STATE_OPEN: number; + const NGHTTP2_STREAM_STATE_RESERVED_LOCAL: number; + const NGHTTP2_STREAM_STATE_RESERVED_REMOTE: number; + const NGHTTP2_STREAM_STATE_HALF_CLOSED_LOCAL: number; + const NGHTTP2_STREAM_STATE_HALF_CLOSED_REMOTE: number; + const NGHTTP2_STREAM_STATE_CLOSED: number; + const NGHTTP2_NO_ERROR: number; + const NGHTTP2_PROTOCOL_ERROR: number; + const NGHTTP2_INTERNAL_ERROR: number; + const NGHTTP2_FLOW_CONTROL_ERROR: number; + const NGHTTP2_SETTINGS_TIMEOUT: number; + const NGHTTP2_STREAM_CLOSED: number; + const NGHTTP2_FRAME_SIZE_ERROR: number; + const NGHTTP2_REFUSED_STREAM: number; + const NGHTTP2_CANCEL: number; + const NGHTTP2_COMPRESSION_ERROR: number; + const NGHTTP2_CONNECT_ERROR: number; + const NGHTTP2_ENHANCE_YOUR_CALM: number; + const NGHTTP2_INADEQUATE_SECURITY: number; + const NGHTTP2_HTTP_1_1_REQUIRED: number; + const NGHTTP2_ERR_FRAME_SIZE_ERROR: number; + const NGHTTP2_FLAG_NONE: number; + const NGHTTP2_FLAG_END_STREAM: number; + const NGHTTP2_FLAG_END_HEADERS: number; + const NGHTTP2_FLAG_ACK: number; + const NGHTTP2_FLAG_PADDED: number; + const NGHTTP2_FLAG_PRIORITY: number; + const DEFAULT_SETTINGS_HEADER_TABLE_SIZE: number; + const DEFAULT_SETTINGS_ENABLE_PUSH: number; + const DEFAULT_SETTINGS_INITIAL_WINDOW_SIZE: number; + const DEFAULT_SETTINGS_MAX_FRAME_SIZE: number; + const MAX_MAX_FRAME_SIZE: number; + const MIN_MAX_FRAME_SIZE: number; + const MAX_INITIAL_WINDOW_SIZE: number; + const NGHTTP2_DEFAULT_WEIGHT: number; + const NGHTTP2_SETTINGS_HEADER_TABLE_SIZE: number; + const NGHTTP2_SETTINGS_ENABLE_PUSH: number; + const NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS: number; + const NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE: number; + const NGHTTP2_SETTINGS_MAX_FRAME_SIZE: number; + const NGHTTP2_SETTINGS_MAX_HEADER_LIST_SIZE: number; + const PADDING_STRATEGY_NONE: number; + const PADDING_STRATEGY_MAX: number; + const PADDING_STRATEGY_CALLBACK: number; + const HTTP2_HEADER_STATUS: string; + const HTTP2_HEADER_METHOD: string; + const HTTP2_HEADER_AUTHORITY: string; + const HTTP2_HEADER_SCHEME: string; + const HTTP2_HEADER_PATH: string; + const HTTP2_HEADER_ACCEPT_CHARSET: string; + const HTTP2_HEADER_ACCEPT_ENCODING: string; + const HTTP2_HEADER_ACCEPT_LANGUAGE: string; + const HTTP2_HEADER_ACCEPT_RANGES: string; + const HTTP2_HEADER_ACCEPT: string; + const HTTP2_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN: string; + const HTTP2_HEADER_AGE: string; + const HTTP2_HEADER_ALLOW: string; + const HTTP2_HEADER_AUTHORIZATION: string; + const HTTP2_HEADER_CACHE_CONTROL: string; + const HTTP2_HEADER_CONNECTION: string; + const HTTP2_HEADER_CONTENT_DISPOSITION: string; + const HTTP2_HEADER_CONTENT_ENCODING: string; + const HTTP2_HEADER_CONTENT_LANGUAGE: string; + const HTTP2_HEADER_CONTENT_LENGTH: string; + const HTTP2_HEADER_CONTENT_LOCATION: string; + const HTTP2_HEADER_CONTENT_MD5: string; + const HTTP2_HEADER_CONTENT_RANGE: string; + const HTTP2_HEADER_CONTENT_TYPE: string; + const HTTP2_HEADER_COOKIE: string; + const HTTP2_HEADER_DATE: string; + const HTTP2_HEADER_ETAG: string; + const HTTP2_HEADER_EXPECT: string; + const HTTP2_HEADER_EXPIRES: string; + const HTTP2_HEADER_FROM: string; + const HTTP2_HEADER_HOST: string; + const HTTP2_HEADER_IF_MATCH: string; + const HTTP2_HEADER_IF_MODIFIED_SINCE: string; + const HTTP2_HEADER_IF_NONE_MATCH: string; + const HTTP2_HEADER_IF_RANGE: string; + const HTTP2_HEADER_IF_UNMODIFIED_SINCE: string; + const HTTP2_HEADER_LAST_MODIFIED: string; + const HTTP2_HEADER_LINK: string; + const HTTP2_HEADER_LOCATION: string; + const HTTP2_HEADER_MAX_FORWARDS: string; + const HTTP2_HEADER_PREFER: string; + const HTTP2_HEADER_PROXY_AUTHENTICATE: string; + const HTTP2_HEADER_PROXY_AUTHORIZATION: string; + const HTTP2_HEADER_RANGE: string; + const HTTP2_HEADER_REFERER: string; + const HTTP2_HEADER_REFRESH: string; + const HTTP2_HEADER_RETRY_AFTER: string; + const HTTP2_HEADER_SERVER: string; + const HTTP2_HEADER_SET_COOKIE: string; + const HTTP2_HEADER_STRICT_TRANSPORT_SECURITY: string; + const HTTP2_HEADER_TRANSFER_ENCODING: string; + const HTTP2_HEADER_TE: string; + const HTTP2_HEADER_UPGRADE: string; + const HTTP2_HEADER_USER_AGENT: string; + const HTTP2_HEADER_VARY: string; + const HTTP2_HEADER_VIA: string; + const HTTP2_HEADER_WWW_AUTHENTICATE: string; + const HTTP2_HEADER_HTTP2_SETTINGS: string; + const HTTP2_HEADER_KEEP_ALIVE: string; + const HTTP2_HEADER_PROXY_CONNECTION: string; + const HTTP2_METHOD_ACL: string; + const HTTP2_METHOD_BASELINE_CONTROL: string; + const HTTP2_METHOD_BIND: string; + const HTTP2_METHOD_CHECKIN: string; + const HTTP2_METHOD_CHECKOUT: string; + const HTTP2_METHOD_CONNECT: string; + const HTTP2_METHOD_COPY: string; + const HTTP2_METHOD_DELETE: string; + const HTTP2_METHOD_GET: string; + const HTTP2_METHOD_HEAD: string; + const HTTP2_METHOD_LABEL: string; + const HTTP2_METHOD_LINK: string; + const HTTP2_METHOD_LOCK: string; + const HTTP2_METHOD_MERGE: string; + const HTTP2_METHOD_MKACTIVITY: string; + const HTTP2_METHOD_MKCALENDAR: string; + const HTTP2_METHOD_MKCOL: string; + const HTTP2_METHOD_MKREDIRECTREF: string; + const HTTP2_METHOD_MKWORKSPACE: string; + const HTTP2_METHOD_MOVE: string; + const HTTP2_METHOD_OPTIONS: string; + const HTTP2_METHOD_ORDERPATCH: string; + const HTTP2_METHOD_PATCH: string; + const HTTP2_METHOD_POST: string; + const HTTP2_METHOD_PRI: string; + const HTTP2_METHOD_PROPFIND: string; + const HTTP2_METHOD_PROPPATCH: string; + const HTTP2_METHOD_PUT: string; + const HTTP2_METHOD_REBIND: string; + const HTTP2_METHOD_REPORT: string; + const HTTP2_METHOD_SEARCH: string; + const HTTP2_METHOD_TRACE: string; + const HTTP2_METHOD_UNBIND: string; + const HTTP2_METHOD_UNCHECKOUT: string; + const HTTP2_METHOD_UNLINK: string; + const HTTP2_METHOD_UNLOCK: string; + const HTTP2_METHOD_UPDATE: string; + const HTTP2_METHOD_UPDATEREDIRECTREF: string; + const HTTP2_METHOD_VERSION_CONTROL: string; + const HTTP_STATUS_CONTINUE: number; + const HTTP_STATUS_SWITCHING_PROTOCOLS: number; + const HTTP_STATUS_PROCESSING: number; + const HTTP_STATUS_OK: number; + const HTTP_STATUS_CREATED: number; + const HTTP_STATUS_ACCEPTED: number; + const HTTP_STATUS_NON_AUTHORITATIVE_INFORMATION: number; + const HTTP_STATUS_NO_CONTENT: number; + const HTTP_STATUS_RESET_CONTENT: number; + const HTTP_STATUS_PARTIAL_CONTENT: number; + const HTTP_STATUS_MULTI_STATUS: number; + const HTTP_STATUS_ALREADY_REPORTED: number; + const HTTP_STATUS_IM_USED: number; + const HTTP_STATUS_MULTIPLE_CHOICES: number; + const HTTP_STATUS_MOVED_PERMANENTLY: number; + const HTTP_STATUS_FOUND: number; + const HTTP_STATUS_SEE_OTHER: number; + const HTTP_STATUS_NOT_MODIFIED: number; + const HTTP_STATUS_USE_PROXY: number; + const HTTP_STATUS_TEMPORARY_REDIRECT: number; + const HTTP_STATUS_PERMANENT_REDIRECT: number; + const HTTP_STATUS_BAD_REQUEST: number; + const HTTP_STATUS_UNAUTHORIZED: number; + const HTTP_STATUS_PAYMENT_REQUIRED: number; + const HTTP_STATUS_FORBIDDEN: number; + const HTTP_STATUS_NOT_FOUND: number; + const HTTP_STATUS_METHOD_NOT_ALLOWED: number; + const HTTP_STATUS_NOT_ACCEPTABLE: number; + const HTTP_STATUS_PROXY_AUTHENTICATION_REQUIRED: number; + const HTTP_STATUS_REQUEST_TIMEOUT: number; + const HTTP_STATUS_CONFLICT: number; + const HTTP_STATUS_GONE: number; + const HTTP_STATUS_LENGTH_REQUIRED: number; + const HTTP_STATUS_PRECONDITION_FAILED: number; + const HTTP_STATUS_PAYLOAD_TOO_LARGE: number; + const HTTP_STATUS_URI_TOO_LONG: number; + const HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE: number; + const HTTP_STATUS_RANGE_NOT_SATISFIABLE: number; + const HTTP_STATUS_EXPECTATION_FAILED: number; + const HTTP_STATUS_TEAPOT: number; + const HTTP_STATUS_MISDIRECTED_REQUEST: number; + const HTTP_STATUS_UNPROCESSABLE_ENTITY: number; + const HTTP_STATUS_LOCKED: number; + const HTTP_STATUS_FAILED_DEPENDENCY: number; + const HTTP_STATUS_UNORDERED_COLLECTION: number; + const HTTP_STATUS_UPGRADE_REQUIRED: number; + const HTTP_STATUS_PRECONDITION_REQUIRED: number; + const HTTP_STATUS_TOO_MANY_REQUESTS: number; + const HTTP_STATUS_REQUEST_HEADER_FIELDS_TOO_LARGE: number; + const HTTP_STATUS_UNAVAILABLE_FOR_LEGAL_REASONS: number; + const HTTP_STATUS_INTERNAL_SERVER_ERROR: number; + const HTTP_STATUS_NOT_IMPLEMENTED: number; + const HTTP_STATUS_BAD_GATEWAY: number; + const HTTP_STATUS_SERVICE_UNAVAILABLE: number; + const HTTP_STATUS_GATEWAY_TIMEOUT: number; + const HTTP_STATUS_HTTP_VERSION_NOT_SUPPORTED: number; + const HTTP_STATUS_VARIANT_ALSO_NEGOTIATES: number; + const HTTP_STATUS_INSUFFICIENT_STORAGE: number; + const HTTP_STATUS_LOOP_DETECTED: number; + const HTTP_STATUS_BANDWIDTH_LIMIT_EXCEEDED: number; + const HTTP_STATUS_NOT_EXTENDED: number; + const HTTP_STATUS_NETWORK_AUTHENTICATION_REQUIRED: number; + } + /** + * This symbol can be set as a property on the HTTP/2 headers object with + * an array value in order to provide a list of headers considered sensitive. + */ + export const sensitiveHeaders: symbol; + /** + * Returns an object containing the default settings for an `Http2Session`instance. This method returns a new object instance every time it is called + * so instances returned may be safely modified for use. + * @since v8.4.0 + */ + export function getDefaultSettings(): Settings; + /** + * Returns a `Buffer` instance containing serialized representation of the given + * HTTP/2 settings as specified in the [HTTP/2](https://tools.ietf.org/html/rfc7540) specification. This is intended + * for use with the `HTTP2-Settings` header field. + * + * ```js + * const http2 = require('node:http2'); + * + * const packed = http2.getPackedSettings({ enablePush: false }); + * + * console.log(packed.toString('base64')); + * // Prints: AAIAAAAA + * ``` + * @since v8.4.0 + */ + export function getPackedSettings(settings: Settings): Buffer; + /** + * Returns a `HTTP/2 Settings Object` containing the deserialized settings from + * the given `Buffer` as generated by `http2.getPackedSettings()`. + * @since v8.4.0 + * @param buf The packed settings. + */ + export function getUnpackedSettings(buf: Uint8Array): Settings; + /** + * Returns a `net.Server` instance that creates and manages `Http2Session`instances. + * + * Since there are no browsers known that support [unencrypted HTTP/2](https://http2.github.io/faq/#does-http2-require-encryption), the use of {@link createSecureServer} is necessary when + * communicating + * with browser clients. + * + * ```js + * const http2 = require('node:http2'); + * + * // Create an unencrypted HTTP/2 server. + * // Since there are no browsers known that support + * // unencrypted HTTP/2, the use of `http2.createSecureServer()` + * // is necessary when communicating with browser clients. + * const server = http2.createServer(); + * + * server.on('stream', (stream, headers) => { + * stream.respond({ + * 'content-type': 'text/html; charset=utf-8', + * ':status': 200, + * }); + * stream.end('

Hello World

'); + * }); + * + * server.listen(8000); + * ``` + * @since v8.4.0 + * @param onRequestHandler See `Compatibility API` + */ + export function createServer(onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void): Http2Server; + export function createServer(options: ServerOptions, onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void): Http2Server; + /** + * Returns a `tls.Server` instance that creates and manages `Http2Session`instances. + * + * ```js + * const http2 = require('node:http2'); + * const fs = require('node:fs'); + * + * const options = { + * key: fs.readFileSync('server-key.pem'), + * cert: fs.readFileSync('server-cert.pem'), + * }; + * + * // Create a secure HTTP/2 server + * const server = http2.createSecureServer(options); + * + * server.on('stream', (stream, headers) => { + * stream.respond({ + * 'content-type': 'text/html; charset=utf-8', + * ':status': 200, + * }); + * stream.end('

Hello World

'); + * }); + * + * server.listen(8443); + * ``` + * @since v8.4.0 + * @param onRequestHandler See `Compatibility API` + */ + export function createSecureServer(onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void): Http2SecureServer; + export function createSecureServer(options: SecureServerOptions, onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void): Http2SecureServer; + /** + * Returns a `ClientHttp2Session` instance. + * + * ```js + * const http2 = require('node:http2'); + * const client = http2.connect('https://localhost:1234'); + * + * // Use the client + * + * client.close(); + * ``` + * @since v8.4.0 + * @param authority The remote HTTP/2 server to connect to. This must be in the form of a minimal, valid URL with the `http://` or `https://` prefix, host name, and IP port (if a non-default port + * is used). Userinfo (user ID and password), path, querystring, and fragment details in the URL will be ignored. + * @param listener Will be registered as a one-time listener of the {@link 'connect'} event. + */ + export function connect(authority: string | url.URL, listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): ClientHttp2Session; + export function connect( + authority: string | url.URL, + options?: ClientSessionOptions | SecureClientSessionOptions, + listener?: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void + ): ClientHttp2Session; +} +declare module 'http2' { + export * from 'node:http2'; +} diff --git a/node_modules/@types/node/ts4.8/https.d.ts b/node_modules/@types/node/ts4.8/https.d.ts new file mode 100644 index 0000000..375f25e --- /dev/null +++ b/node_modules/@types/node/ts4.8/https.d.ts @@ -0,0 +1,441 @@ +/** + * HTTPS is the HTTP protocol over TLS/SSL. In Node.js this is implemented as a + * separate module. + * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/https.js) + */ +declare module 'node:https' { + import { Duplex } from 'node:stream'; + import * as tls from 'node:tls'; + import * as http from 'node:http'; + import { URL } from 'node:url'; + type ServerOptions< + Request extends typeof http.IncomingMessage = typeof http.IncomingMessage, + Response extends typeof http.ServerResponse = typeof http.ServerResponse, + > = tls.SecureContextOptions & tls.TlsOptions & http.ServerOptions; + type RequestOptions = http.RequestOptions & + tls.SecureContextOptions & { + checkServerIdentity?: typeof tls.checkServerIdentity | undefined; + rejectUnauthorized?: boolean | undefined; // Defaults to true + servername?: string | undefined; // SNI TLS Extension + }; + interface AgentOptions extends http.AgentOptions, tls.ConnectionOptions { + rejectUnauthorized?: boolean | undefined; + maxCachedSessions?: number | undefined; + } + /** + * An `Agent` object for HTTPS similar to `http.Agent`. See {@link request} for more information. + * @since v0.4.5 + */ + class Agent extends http.Agent { + constructor(options?: AgentOptions); + options: AgentOptions; + } + interface Server< + Request extends typeof http.IncomingMessage = typeof http.IncomingMessage, + Response extends typeof http.ServerResponse = typeof http.ServerResponse, + > extends http.Server {} + /** + * See `http.Server` for more information. + * @since v0.3.4 + */ + class Server< + Request extends typeof http.IncomingMessage = typeof http.IncomingMessage, + Response extends typeof http.ServerResponse = typeof http.ServerResponse, + > extends tls.Server { + constructor(requestListener?: http.RequestListener); + constructor( + options: ServerOptions, + requestListener?: http.RequestListener, + ); + /** + * Closes all connections connected to this server. + * @since v18.2.0 + */ + closeAllConnections(): void; + /** + * Closes all connections connected to this server which are not sending a request or waiting for a response. + * @since v18.2.0 + */ + closeIdleConnections(): void; + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: 'keylog', listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this; + addListener(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void): this; + addListener(event: 'OCSPRequest', listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this; + addListener(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void): this; + addListener(event: 'secureConnection', listener: (tlsSocket: tls.TLSSocket) => void): this; + addListener(event: 'tlsClientError', listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this; + addListener(event: 'close', listener: () => void): this; + addListener(event: 'connection', listener: (socket: Duplex) => void): this; + addListener(event: 'error', listener: (err: Error) => void): this; + addListener(event: 'listening', listener: () => void): this; + addListener(event: 'checkContinue', listener: http.RequestListener): this; + addListener(event: 'checkExpectation', listener: http.RequestListener): this; + addListener(event: 'clientError', listener: (err: Error, socket: Duplex) => void): this; + addListener(event: 'connect', listener: (req: InstanceType, socket: Duplex, head: Buffer) => void): this; + addListener(event: 'request', listener: http.RequestListener): this; + addListener(event: 'upgrade', listener: (req: InstanceType, socket: Duplex, head: Buffer) => void): this; + emit(event: string, ...args: any[]): boolean; + emit(event: 'keylog', line: Buffer, tlsSocket: tls.TLSSocket): boolean; + emit(event: 'newSession', sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void): boolean; + emit(event: 'OCSPRequest', certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void): boolean; + emit(event: 'resumeSession', sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void): boolean; + emit(event: 'secureConnection', tlsSocket: tls.TLSSocket): boolean; + emit(event: 'tlsClientError', err: Error, tlsSocket: tls.TLSSocket): boolean; + emit(event: 'close'): boolean; + emit(event: 'connection', socket: Duplex): boolean; + emit(event: 'error', err: Error): boolean; + emit(event: 'listening'): boolean; + emit( + event: 'checkContinue', + req: InstanceType, + res: InstanceType & { + req: InstanceType; + } + ): boolean; + emit( + event: 'checkExpectation', + req: InstanceType, + res: InstanceType & { + req: InstanceType; + } + ): boolean; + emit(event: 'clientError', err: Error, socket: Duplex): boolean; + emit(event: 'connect', req: InstanceType, socket: Duplex, head: Buffer): boolean; + emit( + event: 'request', + req: InstanceType, + res: InstanceType & { + req: InstanceType; + } + ): boolean; + emit(event: 'upgrade', req: InstanceType, socket: Duplex, head: Buffer): boolean; + on(event: string, listener: (...args: any[]) => void): this; + on(event: 'keylog', listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this; + on(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void): this; + on(event: 'OCSPRequest', listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this; + on(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void): this; + on(event: 'secureConnection', listener: (tlsSocket: tls.TLSSocket) => void): this; + on(event: 'tlsClientError', listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this; + on(event: 'close', listener: () => void): this; + on(event: 'connection', listener: (socket: Duplex) => void): this; + on(event: 'error', listener: (err: Error) => void): this; + on(event: 'listening', listener: () => void): this; + on(event: 'checkContinue', listener: http.RequestListener): this; + on(event: 'checkExpectation', listener: http.RequestListener): this; + on(event: 'clientError', listener: (err: Error, socket: Duplex) => void): this; + on(event: 'connect', listener: (req: InstanceType, socket: Duplex, head: Buffer) => void): this; + on(event: 'request', listener: http.RequestListener): this; + on(event: 'upgrade', listener: (req: InstanceType, socket: Duplex, head: Buffer) => void): this; + once(event: string, listener: (...args: any[]) => void): this; + once(event: 'keylog', listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this; + once(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void): this; + once(event: 'OCSPRequest', listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this; + once(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void): this; + once(event: 'secureConnection', listener: (tlsSocket: tls.TLSSocket) => void): this; + once(event: 'tlsClientError', listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this; + once(event: 'close', listener: () => void): this; + once(event: 'connection', listener: (socket: Duplex) => void): this; + once(event: 'error', listener: (err: Error) => void): this; + once(event: 'listening', listener: () => void): this; + once(event: 'checkContinue', listener: http.RequestListener): this; + once(event: 'checkExpectation', listener: http.RequestListener): this; + once(event: 'clientError', listener: (err: Error, socket: Duplex) => void): this; + once(event: 'connect', listener: (req: InstanceType, socket: Duplex, head: Buffer) => void): this; + once(event: 'request', listener: http.RequestListener): this; + once(event: 'upgrade', listener: (req: InstanceType, socket: Duplex, head: Buffer) => void): this; + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: 'keylog', listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this; + prependListener(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void): this; + prependListener(event: 'OCSPRequest', listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this; + prependListener(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void): this; + prependListener(event: 'secureConnection', listener: (tlsSocket: tls.TLSSocket) => void): this; + prependListener(event: 'tlsClientError', listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this; + prependListener(event: 'close', listener: () => void): this; + prependListener(event: 'connection', listener: (socket: Duplex) => void): this; + prependListener(event: 'error', listener: (err: Error) => void): this; + prependListener(event: 'listening', listener: () => void): this; + prependListener(event: 'checkContinue', listener: http.RequestListener): this; + prependListener(event: 'checkExpectation', listener: http.RequestListener): this; + prependListener(event: 'clientError', listener: (err: Error, socket: Duplex) => void): this; + prependListener(event: 'connect', listener: (req: InstanceType, socket: Duplex, head: Buffer) => void): this; + prependListener(event: 'request', listener: http.RequestListener): this; + prependListener(event: 'upgrade', listener: (req: InstanceType, socket: Duplex, head: Buffer) => void): this; + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'keylog', listener: (line: Buffer, tlsSocket: tls.TLSSocket) => void): this; + prependOnceListener(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void): this; + prependOnceListener(event: 'OCSPRequest', listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this; + prependOnceListener(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void): this; + prependOnceListener(event: 'secureConnection', listener: (tlsSocket: tls.TLSSocket) => void): this; + prependOnceListener(event: 'tlsClientError', listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this; + prependOnceListener(event: 'close', listener: () => void): this; + prependOnceListener(event: 'connection', listener: (socket: Duplex) => void): this; + prependOnceListener(event: 'error', listener: (err: Error) => void): this; + prependOnceListener(event: 'listening', listener: () => void): this; + prependOnceListener(event: 'checkContinue', listener: http.RequestListener): this; + prependOnceListener(event: 'checkExpectation', listener: http.RequestListener): this; + prependOnceListener(event: 'clientError', listener: (err: Error, socket: Duplex) => void): this; + prependOnceListener(event: 'connect', listener: (req: InstanceType, socket: Duplex, head: Buffer) => void): this; + prependOnceListener(event: 'request', listener: http.RequestListener): this; + prependOnceListener(event: 'upgrade', listener: (req: InstanceType, socket: Duplex, head: Buffer) => void): this; + } + /** + * ```js + * // curl -k https://localhost:8000/ + * const https = require('node:https'); + * const fs = require('node:fs'); + * + * const options = { + * key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'), + * cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem'), + * }; + * + * https.createServer(options, (req, res) => { + * res.writeHead(200); + * res.end('hello world\n'); + * }).listen(8000); + * ``` + * + * Or + * + * ```js + * const https = require('node:https'); + * const fs = require('node:fs'); + * + * const options = { + * pfx: fs.readFileSync('test/fixtures/test_cert.pfx'), + * passphrase: 'sample', + * }; + * + * https.createServer(options, (req, res) => { + * res.writeHead(200); + * res.end('hello world\n'); + * }).listen(8000); + * ``` + * @since v0.3.4 + * @param options Accepts `options` from `createServer`, `createSecureContext` and `createServer`. + * @param requestListener A listener to be added to the `'request'` event. + */ + function createServer< + Request extends typeof http.IncomingMessage = typeof http.IncomingMessage, + Response extends typeof http.ServerResponse = typeof http.ServerResponse, + >(requestListener?: http.RequestListener): Server; + function createServer< + Request extends typeof http.IncomingMessage = typeof http.IncomingMessage, + Response extends typeof http.ServerResponse = typeof http.ServerResponse, + >( + options: ServerOptions, + requestListener?: http.RequestListener, + ): Server; + /** + * Makes a request to a secure web server. + * + * The following additional `options` from `tls.connect()` are also accepted:`ca`, `cert`, `ciphers`, `clientCertEngine`, `crl`, `dhparam`, `ecdhCurve`,`honorCipherOrder`, `key`, `passphrase`, + * `pfx`, `rejectUnauthorized`,`secureOptions`, `secureProtocol`, `servername`, `sessionIdContext`,`highWaterMark`. + * + * `options` can be an object, a string, or a `URL` object. If `options` is a + * string, it is automatically parsed with `new URL()`. If it is a `URL` object, it will be automatically converted to an ordinary `options` object. + * + * `https.request()` returns an instance of the `http.ClientRequest` class. The `ClientRequest` instance is a writable stream. If one needs to + * upload a file with a POST request, then write to the `ClientRequest` object. + * + * ```js + * const https = require('node:https'); + * + * const options = { + * hostname: 'encrypted.google.com', + * port: 443, + * path: '/', + * method: 'GET', + * }; + * + * const req = https.request(options, (res) => { + * console.log('statusCode:', res.statusCode); + * console.log('headers:', res.headers); + * + * res.on('data', (d) => { + * process.stdout.write(d); + * }); + * }); + * + * req.on('error', (e) => { + * console.error(e); + * }); + * req.end(); + * ``` + * + * Example using options from `tls.connect()`: + * + * ```js + * const options = { + * hostname: 'encrypted.google.com', + * port: 443, + * path: '/', + * method: 'GET', + * key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'), + * cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem'), + * }; + * options.agent = new https.Agent(options); + * + * const req = https.request(options, (res) => { + * // ... + * }); + * ``` + * + * Alternatively, opt out of connection pooling by not using an `Agent`. + * + * ```js + * const options = { + * hostname: 'encrypted.google.com', + * port: 443, + * path: '/', + * method: 'GET', + * key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'), + * cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem'), + * agent: false, + * }; + * + * const req = https.request(options, (res) => { + * // ... + * }); + * ``` + * + * Example using a `URL` as `options`: + * + * ```js + * const options = new URL('https://abc:xyz@example.com'); + * + * const req = https.request(options, (res) => { + * // ... + * }); + * ``` + * + * Example pinning on certificate fingerprint, or the public key (similar to`pin-sha256`): + * + * ```js + * const tls = require('node:tls'); + * const https = require('node:https'); + * const crypto = require('node:crypto'); + * + * function sha256(s) { + * return crypto.createHash('sha256').update(s).digest('base64'); + * } + * const options = { + * hostname: 'github.com', + * port: 443, + * path: '/', + * method: 'GET', + * checkServerIdentity: function(host, cert) { + * // Make sure the certificate is issued to the host we are connected to + * const err = tls.checkServerIdentity(host, cert); + * if (err) { + * return err; + * } + * + * // Pin the public key, similar to HPKP pin-sha256 pinning + * const pubkey256 = 'pL1+qb9HTMRZJmuC/bB/ZI9d302BYrrqiVuRyW+DGrU='; + * if (sha256(cert.pubkey) !== pubkey256) { + * const msg = 'Certificate verification error: ' + + * `The public key of '${cert.subject.CN}' ` + + * 'does not match our pinned fingerprint'; + * return new Error(msg); + * } + * + * // Pin the exact certificate, rather than the pub key + * const cert256 = '25:FE:39:32:D9:63:8C:8A:FC:A1:9A:29:87:' + + * 'D8:3E:4C:1D:98:DB:71:E4:1A:48:03:98:EA:22:6A:BD:8B:93:16'; + * if (cert.fingerprint256 !== cert256) { + * const msg = 'Certificate verification error: ' + + * `The certificate of '${cert.subject.CN}' ` + + * 'does not match our pinned fingerprint'; + * return new Error(msg); + * } + * + * // This loop is informational only. + * // Print the certificate and public key fingerprints of all certs in the + * // chain. Its common to pin the public key of the issuer on the public + * // internet, while pinning the public key of the service in sensitive + * // environments. + * do { + * console.log('Subject Common Name:', cert.subject.CN); + * console.log(' Certificate SHA256 fingerprint:', cert.fingerprint256); + * + * hash = crypto.createHash('sha256'); + * console.log(' Public key ping-sha256:', sha256(cert.pubkey)); + * + * lastprint256 = cert.fingerprint256; + * cert = cert.issuerCertificate; + * } while (cert.fingerprint256 !== lastprint256); + * + * }, + * }; + * + * options.agent = new https.Agent(options); + * const req = https.request(options, (res) => { + * console.log('All OK. Server matched our pinned cert or public key'); + * console.log('statusCode:', res.statusCode); + * // Print the HPKP values + * console.log('headers:', res.headers['public-key-pins']); + * + * res.on('data', (d) => {}); + * }); + * + * req.on('error', (e) => { + * console.error(e.message); + * }); + * req.end(); + * ``` + * + * Outputs for example: + * + * ```text + * Subject Common Name: github.com + * Certificate SHA256 fingerprint: 25:FE:39:32:D9:63:8C:8A:FC:A1:9A:29:87:D8:3E:4C:1D:98:DB:71:E4:1A:48:03:98:EA:22:6A:BD:8B:93:16 + * Public key ping-sha256: pL1+qb9HTMRZJmuC/bB/ZI9d302BYrrqiVuRyW+DGrU= + * Subject Common Name: DigiCert SHA2 Extended Validation Server CA + * Certificate SHA256 fingerprint: 40:3E:06:2A:26:53:05:91:13:28:5B:AF:80:A0:D4:AE:42:2C:84:8C:9F:78:FA:D0:1F:C9:4B:C5:B8:7F:EF:1A + * Public key ping-sha256: RRM1dGqnDFsCJXBTHky16vi1obOlCgFFn/yOhI/y+ho= + * Subject Common Name: DigiCert High Assurance EV Root CA + * Certificate SHA256 fingerprint: 74:31:E5:F4:C3:C1:CE:46:90:77:4F:0B:61:E0:54:40:88:3B:A9:A0:1E:D0:0B:A6:AB:D7:80:6E:D3:B1:18:CF + * Public key ping-sha256: WoiWRyIOVNa9ihaBciRSC7XHjliYS9VwUGOIud4PB18= + * All OK. Server matched our pinned cert or public key + * statusCode: 200 + * headers: max-age=0; pin-sha256="WoiWRyIOVNa9ihaBciRSC7XHjliYS9VwUGOIud4PB18="; pin-sha256="RRM1dGqnDFsCJXBTHky16vi1obOlCgFFn/yOhI/y+ho="; + * pin-sha256="k2v657xBsOVe1PQRwOsHsw3bsGT2VzIqz5K+59sNQws="; pin-sha256="K87oWBWM9UZfyddvDfoxL+8lpNyoUB2ptGtn0fv6G2Q="; pin-sha256="IQBnNBEiFuhj+8x6X8XLgh01V9Ic5/V3IRQLNFFc7v4="; + * pin-sha256="iie1VXtL7HzAMF+/PVPR9xzT80kQxdZeJ+zduCB3uj0="; pin-sha256="LvRiGEjRqfzurezaWuj8Wie2gyHMrW5Q06LspMnox7A="; includeSubDomains + * ``` + * @since v0.3.6 + * @param options Accepts all `options` from `request`, with some differences in default values: + */ + function request(options: RequestOptions | string | URL, callback?: (res: http.IncomingMessage) => void): http.ClientRequest; + function request(url: string | URL, options: RequestOptions, callback?: (res: http.IncomingMessage) => void): http.ClientRequest; + /** + * Like `http.get()` but for HTTPS. + * + * `options` can be an object, a string, or a `URL` object. If `options` is a + * string, it is automatically parsed with `new URL()`. If it is a `URL` object, it will be automatically converted to an ordinary `options` object. + * + * ```js + * const https = require('node:https'); + * + * https.get('https://encrypted.google.com/', (res) => { + * console.log('statusCode:', res.statusCode); + * console.log('headers:', res.headers); + * + * res.on('data', (d) => { + * process.stdout.write(d); + * }); + * + * }).on('error', (e) => { + * console.error(e); + * }); + * ``` + * @since v0.3.6 + * @param options Accepts the same `options` as {@link request}, with the `method` always set to `GET`. + */ + function get(options: RequestOptions | string | URL, callback?: (res: http.IncomingMessage) => void): http.ClientRequest; + function get(url: string | URL, options: RequestOptions, callback?: (res: http.IncomingMessage) => void): http.ClientRequest; + let globalAgent: Agent; +} +declare module 'https' { + export * from 'node:https'; +} diff --git a/node_modules/@types/node/ts4.8/index.d.ts b/node_modules/@types/node/ts4.8/index.d.ts new file mode 100644 index 0000000..7c8b38c --- /dev/null +++ b/node_modules/@types/node/ts4.8/index.d.ts @@ -0,0 +1,88 @@ +/** + * License for programmatically and manually incorporated + * documentation aka. `JSDoc` from https://github.com/nodejs/node/tree/master/doc + * + * Copyright Node.js contributors. 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: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +// NOTE: These definitions support NodeJS and TypeScript 4.8 and earlier. + +// Reference required types from the default lib: +/// +/// +/// +/// + +// Base definitions for all NodeJS modules that are not specific to any version of TypeScript: +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// + +/// diff --git a/node_modules/@types/node/ts4.8/inspector.d.ts b/node_modules/@types/node/ts4.8/inspector.d.ts new file mode 100644 index 0000000..e9dd9e1 --- /dev/null +++ b/node_modules/@types/node/ts4.8/inspector.d.ts @@ -0,0 +1,2748 @@ +// eslint-disable-next-line @definitelytyped/dt-header +// Type definitions for inspector + +// These definitions are auto-generated. +// Please see https://github.com/DefinitelyTyped/DefinitelyTyped/pull/19330 +// for more information. + + +/** + * The `node:inspector` module provides an API for interacting with the V8 + * inspector. + * + * It can be accessed using: + * + * ```js + * import * as inspector from 'node:inspector/promises'; + * ``` + * + * or + * + * ```js + * import * as inspector from 'node:inspector'; + * ``` + * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/inspector.js) + */ +declare module 'node:inspector' { + import EventEmitter = require('node:events'); + interface InspectorNotification { + method: string; + params: T; + } + namespace Schema { + /** + * Description of the protocol domain. + */ + interface Domain { + /** + * Domain name. + */ + name: string; + /** + * Domain version. + */ + version: string; + } + interface GetDomainsReturnType { + /** + * List of supported domains. + */ + domains: Domain[]; + } + } + namespace Runtime { + /** + * Unique script identifier. + */ + type ScriptId = string; + /** + * Unique object identifier. + */ + type RemoteObjectId = string; + /** + * Primitive value which cannot be JSON-stringified. + */ + type UnserializableValue = string; + /** + * Mirror object referencing original JavaScript object. + */ + interface RemoteObject { + /** + * Object type. + */ + type: string; + /** + * Object subtype hint. Specified for object type values only. + */ + subtype?: string | undefined; + /** + * Object class (constructor) name. Specified for object type values only. + */ + className?: string | undefined; + /** + * Remote object value in case of primitive values or JSON values (if it was requested). + */ + value?: any; + /** + * Primitive value which can not be JSON-stringified does not have value, but gets this property. + */ + unserializableValue?: UnserializableValue | undefined; + /** + * String representation of the object. + */ + description?: string | undefined; + /** + * Unique object identifier (for non-primitive values). + */ + objectId?: RemoteObjectId | undefined; + /** + * Preview containing abbreviated property values. Specified for object type values only. + * @experimental + */ + preview?: ObjectPreview | undefined; + /** + * @experimental + */ + customPreview?: CustomPreview | undefined; + } + /** + * @experimental + */ + interface CustomPreview { + header: string; + hasBody: boolean; + formatterObjectId: RemoteObjectId; + bindRemoteObjectFunctionId: RemoteObjectId; + configObjectId?: RemoteObjectId | undefined; + } + /** + * Object containing abbreviated remote object value. + * @experimental + */ + interface ObjectPreview { + /** + * Object type. + */ + type: string; + /** + * Object subtype hint. Specified for object type values only. + */ + subtype?: string | undefined; + /** + * String representation of the object. + */ + description?: string | undefined; + /** + * True iff some of the properties or entries of the original object did not fit. + */ + overflow: boolean; + /** + * List of the properties. + */ + properties: PropertyPreview[]; + /** + * List of the entries. Specified for map and set subtype values only. + */ + entries?: EntryPreview[] | undefined; + } + /** + * @experimental + */ + interface PropertyPreview { + /** + * Property name. + */ + name: string; + /** + * Object type. Accessor means that the property itself is an accessor property. + */ + type: string; + /** + * User-friendly property value string. + */ + value?: string | undefined; + /** + * Nested value preview. + */ + valuePreview?: ObjectPreview | undefined; + /** + * Object subtype hint. Specified for object type values only. + */ + subtype?: string | undefined; + } + /** + * @experimental + */ + interface EntryPreview { + /** + * Preview of the key. Specified for map-like collection entries. + */ + key?: ObjectPreview | undefined; + /** + * Preview of the value. + */ + value: ObjectPreview; + } + /** + * Object property descriptor. + */ + interface PropertyDescriptor { + /** + * Property name or symbol description. + */ + name: string; + /** + * The value associated with the property. + */ + value?: RemoteObject | undefined; + /** + * True if the value associated with the property may be changed (data descriptors only). + */ + writable?: boolean | undefined; + /** + * A function which serves as a getter for the property, or undefined if there is no getter (accessor descriptors only). + */ + get?: RemoteObject | undefined; + /** + * A function which serves as a setter for the property, or undefined if there is no setter (accessor descriptors only). + */ + set?: RemoteObject | undefined; + /** + * True if the type of this property descriptor may be changed and if the property may be deleted from the corresponding object. + */ + configurable: boolean; + /** + * True if this property shows up during enumeration of the properties on the corresponding object. + */ + enumerable: boolean; + /** + * True if the result was thrown during the evaluation. + */ + wasThrown?: boolean | undefined; + /** + * True if the property is owned for the object. + */ + isOwn?: boolean | undefined; + /** + * Property symbol object, if the property is of the symbol type. + */ + symbol?: RemoteObject | undefined; + } + /** + * Object internal property descriptor. This property isn't normally visible in JavaScript code. + */ + interface InternalPropertyDescriptor { + /** + * Conventional property name. + */ + name: string; + /** + * The value associated with the property. + */ + value?: RemoteObject | undefined; + } + /** + * Represents function call argument. Either remote object id objectId, primitive value, unserializable primitive value or neither of (for undefined) them should be specified. + */ + interface CallArgument { + /** + * Primitive value or serializable javascript object. + */ + value?: any; + /** + * Primitive value which can not be JSON-stringified. + */ + unserializableValue?: UnserializableValue | undefined; + /** + * Remote object handle. + */ + objectId?: RemoteObjectId | undefined; + } + /** + * Id of an execution context. + */ + type ExecutionContextId = number; + /** + * Description of an isolated world. + */ + interface ExecutionContextDescription { + /** + * Unique id of the execution context. It can be used to specify in which execution context script evaluation should be performed. + */ + id: ExecutionContextId; + /** + * Execution context origin. + */ + origin: string; + /** + * Human readable name describing given context. + */ + name: string; + /** + * Embedder-specific auxiliary data. + */ + auxData?: {} | undefined; + } + /** + * Detailed information about exception (or error) that was thrown during script compilation or execution. + */ + interface ExceptionDetails { + /** + * Exception id. + */ + exceptionId: number; + /** + * Exception text, which should be used together with exception object when available. + */ + text: string; + /** + * Line number of the exception location (0-based). + */ + lineNumber: number; + /** + * Column number of the exception location (0-based). + */ + columnNumber: number; + /** + * Script ID of the exception location. + */ + scriptId?: ScriptId | undefined; + /** + * URL of the exception location, to be used when the script was not reported. + */ + url?: string | undefined; + /** + * JavaScript stack trace if available. + */ + stackTrace?: StackTrace | undefined; + /** + * Exception object if available. + */ + exception?: RemoteObject | undefined; + /** + * Identifier of the context where exception happened. + */ + executionContextId?: ExecutionContextId | undefined; + } + /** + * Number of milliseconds since epoch. + */ + type Timestamp = number; + /** + * Stack entry for runtime errors and assertions. + */ + interface CallFrame { + /** + * JavaScript function name. + */ + functionName: string; + /** + * JavaScript script id. + */ + scriptId: ScriptId; + /** + * JavaScript script name or url. + */ + url: string; + /** + * JavaScript script line number (0-based). + */ + lineNumber: number; + /** + * JavaScript script column number (0-based). + */ + columnNumber: number; + } + /** + * Call frames for assertions or error messages. + */ + interface StackTrace { + /** + * String label of this stack trace. For async traces this may be a name of the function that initiated the async call. + */ + description?: string | undefined; + /** + * JavaScript function name. + */ + callFrames: CallFrame[]; + /** + * Asynchronous JavaScript stack trace that preceded this stack, if available. + */ + parent?: StackTrace | undefined; + /** + * Asynchronous JavaScript stack trace that preceded this stack, if available. + * @experimental + */ + parentId?: StackTraceId | undefined; + } + /** + * Unique identifier of current debugger. + * @experimental + */ + type UniqueDebuggerId = string; + /** + * If debuggerId is set stack trace comes from another debugger and can be resolved there. This allows to track cross-debugger calls. See Runtime.StackTrace and Debugger.paused for usages. + * @experimental + */ + interface StackTraceId { + id: string; + debuggerId?: UniqueDebuggerId | undefined; + } + interface EvaluateParameterType { + /** + * Expression to evaluate. + */ + expression: string; + /** + * Symbolic group name that can be used to release multiple objects. + */ + objectGroup?: string | undefined; + /** + * Determines whether Command Line API should be available during the evaluation. + */ + includeCommandLineAPI?: boolean | undefined; + /** + * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. + */ + silent?: boolean | undefined; + /** + * Specifies in which execution context to perform evaluation. If the parameter is omitted the evaluation will be performed in the context of the inspected page. + */ + contextId?: ExecutionContextId | undefined; + /** + * Whether the result is expected to be a JSON object that should be sent by value. + */ + returnByValue?: boolean | undefined; + /** + * Whether preview should be generated for the result. + * @experimental + */ + generatePreview?: boolean | undefined; + /** + * Whether execution should be treated as initiated by user in the UI. + */ + userGesture?: boolean | undefined; + /** + * Whether execution should await for resulting value and return once awaited promise is resolved. + */ + awaitPromise?: boolean | undefined; + } + interface AwaitPromiseParameterType { + /** + * Identifier of the promise. + */ + promiseObjectId: RemoteObjectId; + /** + * Whether the result is expected to be a JSON object that should be sent by value. + */ + returnByValue?: boolean | undefined; + /** + * Whether preview should be generated for the result. + */ + generatePreview?: boolean | undefined; + } + interface CallFunctionOnParameterType { + /** + * Declaration of the function to call. + */ + functionDeclaration: string; + /** + * Identifier of the object to call function on. Either objectId or executionContextId should be specified. + */ + objectId?: RemoteObjectId | undefined; + /** + * Call arguments. All call arguments must belong to the same JavaScript world as the target object. + */ + arguments?: CallArgument[] | undefined; + /** + * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. + */ + silent?: boolean | undefined; + /** + * Whether the result is expected to be a JSON object which should be sent by value. + */ + returnByValue?: boolean | undefined; + /** + * Whether preview should be generated for the result. + * @experimental + */ + generatePreview?: boolean | undefined; + /** + * Whether execution should be treated as initiated by user in the UI. + */ + userGesture?: boolean | undefined; + /** + * Whether execution should await for resulting value and return once awaited promise is resolved. + */ + awaitPromise?: boolean | undefined; + /** + * Specifies execution context which global object will be used to call function on. Either executionContextId or objectId should be specified. + */ + executionContextId?: ExecutionContextId | undefined; + /** + * Symbolic group name that can be used to release multiple objects. If objectGroup is not specified and objectId is, objectGroup will be inherited from object. + */ + objectGroup?: string | undefined; + } + interface GetPropertiesParameterType { + /** + * Identifier of the object to return properties for. + */ + objectId: RemoteObjectId; + /** + * If true, returns properties belonging only to the element itself, not to its prototype chain. + */ + ownProperties?: boolean | undefined; + /** + * If true, returns accessor properties (with getter/setter) only; internal properties are not returned either. + * @experimental + */ + accessorPropertiesOnly?: boolean | undefined; + /** + * Whether preview should be generated for the results. + * @experimental + */ + generatePreview?: boolean | undefined; + } + interface ReleaseObjectParameterType { + /** + * Identifier of the object to release. + */ + objectId: RemoteObjectId; + } + interface ReleaseObjectGroupParameterType { + /** + * Symbolic object group name. + */ + objectGroup: string; + } + interface SetCustomObjectFormatterEnabledParameterType { + enabled: boolean; + } + interface CompileScriptParameterType { + /** + * Expression to compile. + */ + expression: string; + /** + * Source url to be set for the script. + */ + sourceURL: string; + /** + * Specifies whether the compiled script should be persisted. + */ + persistScript: boolean; + /** + * Specifies in which execution context to perform script run. If the parameter is omitted the evaluation will be performed in the context of the inspected page. + */ + executionContextId?: ExecutionContextId | undefined; + } + interface RunScriptParameterType { + /** + * Id of the script to run. + */ + scriptId: ScriptId; + /** + * Specifies in which execution context to perform script run. If the parameter is omitted the evaluation will be performed in the context of the inspected page. + */ + executionContextId?: ExecutionContextId | undefined; + /** + * Symbolic group name that can be used to release multiple objects. + */ + objectGroup?: string | undefined; + /** + * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. + */ + silent?: boolean | undefined; + /** + * Determines whether Command Line API should be available during the evaluation. + */ + includeCommandLineAPI?: boolean | undefined; + /** + * Whether the result is expected to be a JSON object which should be sent by value. + */ + returnByValue?: boolean | undefined; + /** + * Whether preview should be generated for the result. + */ + generatePreview?: boolean | undefined; + /** + * Whether execution should await for resulting value and return once awaited promise is resolved. + */ + awaitPromise?: boolean | undefined; + } + interface QueryObjectsParameterType { + /** + * Identifier of the prototype to return objects for. + */ + prototypeObjectId: RemoteObjectId; + } + interface GlobalLexicalScopeNamesParameterType { + /** + * Specifies in which execution context to lookup global scope variables. + */ + executionContextId?: ExecutionContextId | undefined; + } + interface EvaluateReturnType { + /** + * Evaluation result. + */ + result: RemoteObject; + /** + * Exception details. + */ + exceptionDetails?: ExceptionDetails | undefined; + } + interface AwaitPromiseReturnType { + /** + * Promise result. Will contain rejected value if promise was rejected. + */ + result: RemoteObject; + /** + * Exception details if stack strace is available. + */ + exceptionDetails?: ExceptionDetails | undefined; + } + interface CallFunctionOnReturnType { + /** + * Call result. + */ + result: RemoteObject; + /** + * Exception details. + */ + exceptionDetails?: ExceptionDetails | undefined; + } + interface GetPropertiesReturnType { + /** + * Object properties. + */ + result: PropertyDescriptor[]; + /** + * Internal object properties (only of the element itself). + */ + internalProperties?: InternalPropertyDescriptor[] | undefined; + /** + * Exception details. + */ + exceptionDetails?: ExceptionDetails | undefined; + } + interface CompileScriptReturnType { + /** + * Id of the script. + */ + scriptId?: ScriptId | undefined; + /** + * Exception details. + */ + exceptionDetails?: ExceptionDetails | undefined; + } + interface RunScriptReturnType { + /** + * Run result. + */ + result: RemoteObject; + /** + * Exception details. + */ + exceptionDetails?: ExceptionDetails | undefined; + } + interface QueryObjectsReturnType { + /** + * Array with objects. + */ + objects: RemoteObject; + } + interface GlobalLexicalScopeNamesReturnType { + names: string[]; + } + interface ExecutionContextCreatedEventDataType { + /** + * A newly created execution context. + */ + context: ExecutionContextDescription; + } + interface ExecutionContextDestroyedEventDataType { + /** + * Id of the destroyed context + */ + executionContextId: ExecutionContextId; + } + interface ExceptionThrownEventDataType { + /** + * Timestamp of the exception. + */ + timestamp: Timestamp; + exceptionDetails: ExceptionDetails; + } + interface ExceptionRevokedEventDataType { + /** + * Reason describing why exception was revoked. + */ + reason: string; + /** + * The id of revoked exception, as reported in exceptionThrown. + */ + exceptionId: number; + } + interface ConsoleAPICalledEventDataType { + /** + * Type of the call. + */ + type: string; + /** + * Call arguments. + */ + args: RemoteObject[]; + /** + * Identifier of the context where the call was made. + */ + executionContextId: ExecutionContextId; + /** + * Call timestamp. + */ + timestamp: Timestamp; + /** + * Stack trace captured when the call was made. + */ + stackTrace?: StackTrace | undefined; + /** + * Console context descriptor for calls on non-default console context (not console.*): 'anonymous#unique-logger-id' for call on unnamed context, 'name#unique-logger-id' for call on named context. + * @experimental + */ + context?: string | undefined; + } + interface InspectRequestedEventDataType { + object: RemoteObject; + hints: {}; + } + } + namespace Debugger { + /** + * Breakpoint identifier. + */ + type BreakpointId = string; + /** + * Call frame identifier. + */ + type CallFrameId = string; + /** + * Location in the source code. + */ + interface Location { + /** + * Script identifier as reported in the Debugger.scriptParsed. + */ + scriptId: Runtime.ScriptId; + /** + * Line number in the script (0-based). + */ + lineNumber: number; + /** + * Column number in the script (0-based). + */ + columnNumber?: number | undefined; + } + /** + * Location in the source code. + * @experimental + */ + interface ScriptPosition { + lineNumber: number; + columnNumber: number; + } + /** + * JavaScript call frame. Array of call frames form the call stack. + */ + interface CallFrame { + /** + * Call frame identifier. This identifier is only valid while the virtual machine is paused. + */ + callFrameId: CallFrameId; + /** + * Name of the JavaScript function called on this call frame. + */ + functionName: string; + /** + * Location in the source code. + */ + functionLocation?: Location | undefined; + /** + * Location in the source code. + */ + location: Location; + /** + * JavaScript script name or url. + */ + url: string; + /** + * Scope chain for this call frame. + */ + scopeChain: Scope[]; + /** + * this object for this call frame. + */ + this: Runtime.RemoteObject; + /** + * The value being returned, if the function is at return point. + */ + returnValue?: Runtime.RemoteObject | undefined; + } + /** + * Scope description. + */ + interface Scope { + /** + * Scope type. + */ + type: string; + /** + * Object representing the scope. For global and with scopes it represents the actual object; for the rest of the scopes, it is artificial transient object enumerating scope variables as its properties. + */ + object: Runtime.RemoteObject; + name?: string | undefined; + /** + * Location in the source code where scope starts + */ + startLocation?: Location | undefined; + /** + * Location in the source code where scope ends + */ + endLocation?: Location | undefined; + } + /** + * Search match for resource. + */ + interface SearchMatch { + /** + * Line number in resource content. + */ + lineNumber: number; + /** + * Line with match content. + */ + lineContent: string; + } + interface BreakLocation { + /** + * Script identifier as reported in the Debugger.scriptParsed. + */ + scriptId: Runtime.ScriptId; + /** + * Line number in the script (0-based). + */ + lineNumber: number; + /** + * Column number in the script (0-based). + */ + columnNumber?: number | undefined; + type?: string | undefined; + } + interface SetBreakpointsActiveParameterType { + /** + * New value for breakpoints active state. + */ + active: boolean; + } + interface SetSkipAllPausesParameterType { + /** + * New value for skip pauses state. + */ + skip: boolean; + } + interface SetBreakpointByUrlParameterType { + /** + * Line number to set breakpoint at. + */ + lineNumber: number; + /** + * URL of the resources to set breakpoint on. + */ + url?: string | undefined; + /** + * Regex pattern for the URLs of the resources to set breakpoints on. Either url or urlRegex must be specified. + */ + urlRegex?: string | undefined; + /** + * Script hash of the resources to set breakpoint on. + */ + scriptHash?: string | undefined; + /** + * Offset in the line to set breakpoint at. + */ + columnNumber?: number | undefined; + /** + * Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true. + */ + condition?: string | undefined; + } + interface SetBreakpointParameterType { + /** + * Location to set breakpoint in. + */ + location: Location; + /** + * Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true. + */ + condition?: string | undefined; + } + interface RemoveBreakpointParameterType { + breakpointId: BreakpointId; + } + interface GetPossibleBreakpointsParameterType { + /** + * Start of range to search possible breakpoint locations in. + */ + start: Location; + /** + * End of range to search possible breakpoint locations in (excluding). When not specified, end of scripts is used as end of range. + */ + end?: Location | undefined; + /** + * Only consider locations which are in the same (non-nested) function as start. + */ + restrictToFunction?: boolean | undefined; + } + interface ContinueToLocationParameterType { + /** + * Location to continue to. + */ + location: Location; + targetCallFrames?: string | undefined; + } + interface PauseOnAsyncCallParameterType { + /** + * Debugger will pause when async call with given stack trace is started. + */ + parentStackTraceId: Runtime.StackTraceId; + } + interface StepIntoParameterType { + /** + * Debugger will issue additional Debugger.paused notification if any async task is scheduled before next pause. + * @experimental + */ + breakOnAsyncCall?: boolean | undefined; + } + interface GetStackTraceParameterType { + stackTraceId: Runtime.StackTraceId; + } + interface SearchInContentParameterType { + /** + * Id of the script to search in. + */ + scriptId: Runtime.ScriptId; + /** + * String to search for. + */ + query: string; + /** + * If true, search is case sensitive. + */ + caseSensitive?: boolean | undefined; + /** + * If true, treats string parameter as regex. + */ + isRegex?: boolean | undefined; + } + interface SetScriptSourceParameterType { + /** + * Id of the script to edit. + */ + scriptId: Runtime.ScriptId; + /** + * New content of the script. + */ + scriptSource: string; + /** + * If true the change will not actually be applied. Dry run may be used to get result description without actually modifying the code. + */ + dryRun?: boolean | undefined; + } + interface RestartFrameParameterType { + /** + * Call frame identifier to evaluate on. + */ + callFrameId: CallFrameId; + } + interface GetScriptSourceParameterType { + /** + * Id of the script to get source for. + */ + scriptId: Runtime.ScriptId; + } + interface SetPauseOnExceptionsParameterType { + /** + * Pause on exceptions mode. + */ + state: string; + } + interface EvaluateOnCallFrameParameterType { + /** + * Call frame identifier to evaluate on. + */ + callFrameId: CallFrameId; + /** + * Expression to evaluate. + */ + expression: string; + /** + * String object group name to put result into (allows rapid releasing resulting object handles using releaseObjectGroup). + */ + objectGroup?: string | undefined; + /** + * Specifies whether command line API should be available to the evaluated expression, defaults to false. + */ + includeCommandLineAPI?: boolean | undefined; + /** + * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. + */ + silent?: boolean | undefined; + /** + * Whether the result is expected to be a JSON object that should be sent by value. + */ + returnByValue?: boolean | undefined; + /** + * Whether preview should be generated for the result. + * @experimental + */ + generatePreview?: boolean | undefined; + /** + * Whether to throw an exception if side effect cannot be ruled out during evaluation. + */ + throwOnSideEffect?: boolean | undefined; + } + interface SetVariableValueParameterType { + /** + * 0-based number of scope as was listed in scope chain. Only 'local', 'closure' and 'catch' scope types are allowed. Other scopes could be manipulated manually. + */ + scopeNumber: number; + /** + * Variable name. + */ + variableName: string; + /** + * New variable value. + */ + newValue: Runtime.CallArgument; + /** + * Id of callframe that holds variable. + */ + callFrameId: CallFrameId; + } + interface SetReturnValueParameterType { + /** + * New return value. + */ + newValue: Runtime.CallArgument; + } + interface SetAsyncCallStackDepthParameterType { + /** + * Maximum depth of async call stacks. Setting to 0 will effectively disable collecting async call stacks (default). + */ + maxDepth: number; + } + interface SetBlackboxPatternsParameterType { + /** + * Array of regexps that will be used to check script url for blackbox state. + */ + patterns: string[]; + } + interface SetBlackboxedRangesParameterType { + /** + * Id of the script. + */ + scriptId: Runtime.ScriptId; + positions: ScriptPosition[]; + } + interface EnableReturnType { + /** + * Unique identifier of the debugger. + * @experimental + */ + debuggerId: Runtime.UniqueDebuggerId; + } + interface SetBreakpointByUrlReturnType { + /** + * Id of the created breakpoint for further reference. + */ + breakpointId: BreakpointId; + /** + * List of the locations this breakpoint resolved into upon addition. + */ + locations: Location[]; + } + interface SetBreakpointReturnType { + /** + * Id of the created breakpoint for further reference. + */ + breakpointId: BreakpointId; + /** + * Location this breakpoint resolved into. + */ + actualLocation: Location; + } + interface GetPossibleBreakpointsReturnType { + /** + * List of the possible breakpoint locations. + */ + locations: BreakLocation[]; + } + interface GetStackTraceReturnType { + stackTrace: Runtime.StackTrace; + } + interface SearchInContentReturnType { + /** + * List of search matches. + */ + result: SearchMatch[]; + } + interface SetScriptSourceReturnType { + /** + * New stack trace in case editing has happened while VM was stopped. + */ + callFrames?: CallFrame[] | undefined; + /** + * Whether current call stack was modified after applying the changes. + */ + stackChanged?: boolean | undefined; + /** + * Async stack trace, if any. + */ + asyncStackTrace?: Runtime.StackTrace | undefined; + /** + * Async stack trace, if any. + * @experimental + */ + asyncStackTraceId?: Runtime.StackTraceId | undefined; + /** + * Exception details if any. + */ + exceptionDetails?: Runtime.ExceptionDetails | undefined; + } + interface RestartFrameReturnType { + /** + * New stack trace. + */ + callFrames: CallFrame[]; + /** + * Async stack trace, if any. + */ + asyncStackTrace?: Runtime.StackTrace | undefined; + /** + * Async stack trace, if any. + * @experimental + */ + asyncStackTraceId?: Runtime.StackTraceId | undefined; + } + interface GetScriptSourceReturnType { + /** + * Script source. + */ + scriptSource: string; + } + interface EvaluateOnCallFrameReturnType { + /** + * Object wrapper for the evaluation result. + */ + result: Runtime.RemoteObject; + /** + * Exception details. + */ + exceptionDetails?: Runtime.ExceptionDetails | undefined; + } + interface ScriptParsedEventDataType { + /** + * Identifier of the script parsed. + */ + scriptId: Runtime.ScriptId; + /** + * URL or name of the script parsed (if any). + */ + url: string; + /** + * Line offset of the script within the resource with given URL (for script tags). + */ + startLine: number; + /** + * Column offset of the script within the resource with given URL. + */ + startColumn: number; + /** + * Last line of the script. + */ + endLine: number; + /** + * Length of the last line of the script. + */ + endColumn: number; + /** + * Specifies script creation context. + */ + executionContextId: Runtime.ExecutionContextId; + /** + * Content hash of the script. + */ + hash: string; + /** + * Embedder-specific auxiliary data. + */ + executionContextAuxData?: {} | undefined; + /** + * True, if this script is generated as a result of the live edit operation. + * @experimental + */ + isLiveEdit?: boolean | undefined; + /** + * URL of source map associated with script (if any). + */ + sourceMapURL?: string | undefined; + /** + * True, if this script has sourceURL. + */ + hasSourceURL?: boolean | undefined; + /** + * True, if this script is ES6 module. + */ + isModule?: boolean | undefined; + /** + * This script length. + */ + length?: number | undefined; + /** + * JavaScript top stack frame of where the script parsed event was triggered if available. + * @experimental + */ + stackTrace?: Runtime.StackTrace | undefined; + } + interface ScriptFailedToParseEventDataType { + /** + * Identifier of the script parsed. + */ + scriptId: Runtime.ScriptId; + /** + * URL or name of the script parsed (if any). + */ + url: string; + /** + * Line offset of the script within the resource with given URL (for script tags). + */ + startLine: number; + /** + * Column offset of the script within the resource with given URL. + */ + startColumn: number; + /** + * Last line of the script. + */ + endLine: number; + /** + * Length of the last line of the script. + */ + endColumn: number; + /** + * Specifies script creation context. + */ + executionContextId: Runtime.ExecutionContextId; + /** + * Content hash of the script. + */ + hash: string; + /** + * Embedder-specific auxiliary data. + */ + executionContextAuxData?: {} | undefined; + /** + * URL of source map associated with script (if any). + */ + sourceMapURL?: string | undefined; + /** + * True, if this script has sourceURL. + */ + hasSourceURL?: boolean | undefined; + /** + * True, if this script is ES6 module. + */ + isModule?: boolean | undefined; + /** + * This script length. + */ + length?: number | undefined; + /** + * JavaScript top stack frame of where the script parsed event was triggered if available. + * @experimental + */ + stackTrace?: Runtime.StackTrace | undefined; + } + interface BreakpointResolvedEventDataType { + /** + * Breakpoint unique identifier. + */ + breakpointId: BreakpointId; + /** + * Actual breakpoint location. + */ + location: Location; + } + interface PausedEventDataType { + /** + * Call stack the virtual machine stopped on. + */ + callFrames: CallFrame[]; + /** + * Pause reason. + */ + reason: string; + /** + * Object containing break-specific auxiliary properties. + */ + data?: {} | undefined; + /** + * Hit breakpoints IDs + */ + hitBreakpoints?: string[] | undefined; + /** + * Async stack trace, if any. + */ + asyncStackTrace?: Runtime.StackTrace | undefined; + /** + * Async stack trace, if any. + * @experimental + */ + asyncStackTraceId?: Runtime.StackTraceId | undefined; + /** + * Just scheduled async call will have this stack trace as parent stack during async execution. This field is available only after Debugger.stepInto call with breakOnAsynCall flag. + * @experimental + */ + asyncCallStackTraceId?: Runtime.StackTraceId | undefined; + } + } + namespace Console { + /** + * Console message. + */ + interface ConsoleMessage { + /** + * Message source. + */ + source: string; + /** + * Message severity. + */ + level: string; + /** + * Message text. + */ + text: string; + /** + * URL of the message origin. + */ + url?: string | undefined; + /** + * Line number in the resource that generated this message (1-based). + */ + line?: number | undefined; + /** + * Column number in the resource that generated this message (1-based). + */ + column?: number | undefined; + } + interface MessageAddedEventDataType { + /** + * Console message that has been added. + */ + message: ConsoleMessage; + } + } + namespace Profiler { + /** + * Profile node. Holds callsite information, execution statistics and child nodes. + */ + interface ProfileNode { + /** + * Unique id of the node. + */ + id: number; + /** + * Function location. + */ + callFrame: Runtime.CallFrame; + /** + * Number of samples where this node was on top of the call stack. + */ + hitCount?: number | undefined; + /** + * Child node ids. + */ + children?: number[] | undefined; + /** + * The reason of being not optimized. The function may be deoptimized or marked as don't optimize. + */ + deoptReason?: string | undefined; + /** + * An array of source position ticks. + */ + positionTicks?: PositionTickInfo[] | undefined; + } + /** + * Profile. + */ + interface Profile { + /** + * The list of profile nodes. First item is the root node. + */ + nodes: ProfileNode[]; + /** + * Profiling start timestamp in microseconds. + */ + startTime: number; + /** + * Profiling end timestamp in microseconds. + */ + endTime: number; + /** + * Ids of samples top nodes. + */ + samples?: number[] | undefined; + /** + * Time intervals between adjacent samples in microseconds. The first delta is relative to the profile startTime. + */ + timeDeltas?: number[] | undefined; + } + /** + * Specifies a number of samples attributed to a certain source position. + */ + interface PositionTickInfo { + /** + * Source line number (1-based). + */ + line: number; + /** + * Number of samples attributed to the source line. + */ + ticks: number; + } + /** + * Coverage data for a source range. + */ + interface CoverageRange { + /** + * JavaScript script source offset for the range start. + */ + startOffset: number; + /** + * JavaScript script source offset for the range end. + */ + endOffset: number; + /** + * Collected execution count of the source range. + */ + count: number; + } + /** + * Coverage data for a JavaScript function. + */ + interface FunctionCoverage { + /** + * JavaScript function name. + */ + functionName: string; + /** + * Source ranges inside the function with coverage data. + */ + ranges: CoverageRange[]; + /** + * Whether coverage data for this function has block granularity. + */ + isBlockCoverage: boolean; + } + /** + * Coverage data for a JavaScript script. + */ + interface ScriptCoverage { + /** + * JavaScript script id. + */ + scriptId: Runtime.ScriptId; + /** + * JavaScript script name or url. + */ + url: string; + /** + * Functions contained in the script that has coverage data. + */ + functions: FunctionCoverage[]; + } + /** + * Describes a type collected during runtime. + * @experimental + */ + interface TypeObject { + /** + * Name of a type collected with type profiling. + */ + name: string; + } + /** + * Source offset and types for a parameter or return value. + * @experimental + */ + interface TypeProfileEntry { + /** + * Source offset of the parameter or end of function for return values. + */ + offset: number; + /** + * The types for this parameter or return value. + */ + types: TypeObject[]; + } + /** + * Type profile data collected during runtime for a JavaScript script. + * @experimental + */ + interface ScriptTypeProfile { + /** + * JavaScript script id. + */ + scriptId: Runtime.ScriptId; + /** + * JavaScript script name or url. + */ + url: string; + /** + * Type profile entries for parameters and return values of the functions in the script. + */ + entries: TypeProfileEntry[]; + } + interface SetSamplingIntervalParameterType { + /** + * New sampling interval in microseconds. + */ + interval: number; + } + interface StartPreciseCoverageParameterType { + /** + * Collect accurate call counts beyond simple 'covered' or 'not covered'. + */ + callCount?: boolean | undefined; + /** + * Collect block-based coverage. + */ + detailed?: boolean | undefined; + } + interface StopReturnType { + /** + * Recorded profile. + */ + profile: Profile; + } + interface TakePreciseCoverageReturnType { + /** + * Coverage data for the current isolate. + */ + result: ScriptCoverage[]; + } + interface GetBestEffortCoverageReturnType { + /** + * Coverage data for the current isolate. + */ + result: ScriptCoverage[]; + } + interface TakeTypeProfileReturnType { + /** + * Type profile for all scripts since startTypeProfile() was turned on. + */ + result: ScriptTypeProfile[]; + } + interface ConsoleProfileStartedEventDataType { + id: string; + /** + * Location of console.profile(). + */ + location: Debugger.Location; + /** + * Profile title passed as an argument to console.profile(). + */ + title?: string | undefined; + } + interface ConsoleProfileFinishedEventDataType { + id: string; + /** + * Location of console.profileEnd(). + */ + location: Debugger.Location; + profile: Profile; + /** + * Profile title passed as an argument to console.profile(). + */ + title?: string | undefined; + } + } + namespace HeapProfiler { + /** + * Heap snapshot object id. + */ + type HeapSnapshotObjectId = string; + /** + * Sampling Heap Profile node. Holds callsite information, allocation statistics and child nodes. + */ + interface SamplingHeapProfileNode { + /** + * Function location. + */ + callFrame: Runtime.CallFrame; + /** + * Allocations size in bytes for the node excluding children. + */ + selfSize: number; + /** + * Child nodes. + */ + children: SamplingHeapProfileNode[]; + } + /** + * Profile. + */ + interface SamplingHeapProfile { + head: SamplingHeapProfileNode; + } + interface StartTrackingHeapObjectsParameterType { + trackAllocations?: boolean | undefined; + } + interface StopTrackingHeapObjectsParameterType { + /** + * If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken when the tracking is stopped. + */ + reportProgress?: boolean | undefined; + } + interface TakeHeapSnapshotParameterType { + /** + * If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken. + */ + reportProgress?: boolean | undefined; + } + interface GetObjectByHeapObjectIdParameterType { + objectId: HeapSnapshotObjectId; + /** + * Symbolic group name that can be used to release multiple objects. + */ + objectGroup?: string | undefined; + } + interface AddInspectedHeapObjectParameterType { + /** + * Heap snapshot object id to be accessible by means of $x command line API. + */ + heapObjectId: HeapSnapshotObjectId; + } + interface GetHeapObjectIdParameterType { + /** + * Identifier of the object to get heap object id for. + */ + objectId: Runtime.RemoteObjectId; + } + interface StartSamplingParameterType { + /** + * Average sample interval in bytes. Poisson distribution is used for the intervals. The default value is 32768 bytes. + */ + samplingInterval?: number | undefined; + } + interface GetObjectByHeapObjectIdReturnType { + /** + * Evaluation result. + */ + result: Runtime.RemoteObject; + } + interface GetHeapObjectIdReturnType { + /** + * Id of the heap snapshot object corresponding to the passed remote object id. + */ + heapSnapshotObjectId: HeapSnapshotObjectId; + } + interface StopSamplingReturnType { + /** + * Recorded sampling heap profile. + */ + profile: SamplingHeapProfile; + } + interface GetSamplingProfileReturnType { + /** + * Return the sampling profile being collected. + */ + profile: SamplingHeapProfile; + } + interface AddHeapSnapshotChunkEventDataType { + chunk: string; + } + interface ReportHeapSnapshotProgressEventDataType { + done: number; + total: number; + finished?: boolean | undefined; + } + interface LastSeenObjectIdEventDataType { + lastSeenObjectId: number; + timestamp: number; + } + interface HeapStatsUpdateEventDataType { + /** + * An array of triplets. Each triplet describes a fragment. The first integer is the fragment index, the second integer is a total count of objects for the fragment, the third integer is a total size of the objects for the fragment. + */ + statsUpdate: number[]; + } + } + namespace NodeTracing { + interface TraceConfig { + /** + * Controls how the trace buffer stores data. + */ + recordMode?: string | undefined; + /** + * Included category filters. + */ + includedCategories: string[]; + } + interface StartParameterType { + traceConfig: TraceConfig; + } + interface GetCategoriesReturnType { + /** + * A list of supported tracing categories. + */ + categories: string[]; + } + interface DataCollectedEventDataType { + value: Array<{}>; + } + } + namespace NodeWorker { + type WorkerID = string; + /** + * Unique identifier of attached debugging session. + */ + type SessionID = string; + interface WorkerInfo { + workerId: WorkerID; + type: string; + title: string; + url: string; + } + interface SendMessageToWorkerParameterType { + message: string; + /** + * Identifier of the session. + */ + sessionId: SessionID; + } + interface EnableParameterType { + /** + * Whether to new workers should be paused until the frontend sends `Runtime.runIfWaitingForDebugger` + * message to run them. + */ + waitForDebuggerOnStart: boolean; + } + interface DetachParameterType { + sessionId: SessionID; + } + interface AttachedToWorkerEventDataType { + /** + * Identifier assigned to the session used to send/receive messages. + */ + sessionId: SessionID; + workerInfo: WorkerInfo; + waitingForDebugger: boolean; + } + interface DetachedFromWorkerEventDataType { + /** + * Detached session identifier. + */ + sessionId: SessionID; + } + interface ReceivedMessageFromWorkerEventDataType { + /** + * Identifier of a session which sends a message. + */ + sessionId: SessionID; + message: string; + } + } + namespace NodeRuntime { + interface NotifyWhenWaitingForDisconnectParameterType { + enabled: boolean; + } + } + /** + * The `inspector.Session` is used for dispatching messages to the V8 inspector + * back-end and receiving message responses and notifications. + */ + class Session extends EventEmitter { + /** + * Create a new instance of the inspector.Session class. + * The inspector session needs to be connected through session.connect() before the messages can be dispatched to the inspector backend. + */ + constructor(); + /** + * Connects a session to the inspector back-end. + * @since v8.0.0 + */ + connect(): void; + /** + * Immediately close the session. All pending message callbacks will be called + * with an error. `session.connect()` will need to be called to be able to send + * messages again. Reconnected session will lose all inspector state, such as + * enabled agents or configured breakpoints. + * @since v8.0.0 + */ + disconnect(): void; + /** + * Posts a message to the inspector back-end. `callback` will be notified when + * a response is received. `callback` is a function that accepts two optional + * arguments: error and message-specific result. + * + * ```js + * session.post('Runtime.evaluate', { expression: '2 + 2' }, + * (error, { result }) => console.log(result)); + * // Output: { type: 'number', value: 4, description: '4' } + * ``` + * + * The latest version of the V8 inspector protocol is published on the [Chrome DevTools Protocol Viewer](https://chromedevtools.github.io/devtools-protocol/v8/). + * + * Node.js inspector supports all the Chrome DevTools Protocol domains declared + * by V8\. Chrome DevTools Protocol domain provides an interface for interacting + * with one of the runtime agents used to inspect the application state and listen + * to the run-time events. + * + * ## Example usage + * + * Apart from the debugger, various V8 Profilers are available through the DevTools + * protocol. + * @since v8.0.0 + */ + post(method: string, params?: {}, callback?: (err: Error | null, params?: {}) => void): void; + post(method: string, callback?: (err: Error | null, params?: {}) => void): void; + /** + * Returns supported domains. + */ + post(method: 'Schema.getDomains', callback?: (err: Error | null, params: Schema.GetDomainsReturnType) => void): void; + /** + * Evaluates expression on global object. + */ + post(method: 'Runtime.evaluate', params?: Runtime.EvaluateParameterType, callback?: (err: Error | null, params: Runtime.EvaluateReturnType) => void): void; + post(method: 'Runtime.evaluate', callback?: (err: Error | null, params: Runtime.EvaluateReturnType) => void): void; + /** + * Add handler to promise with given promise object id. + */ + post(method: 'Runtime.awaitPromise', params?: Runtime.AwaitPromiseParameterType, callback?: (err: Error | null, params: Runtime.AwaitPromiseReturnType) => void): void; + post(method: 'Runtime.awaitPromise', callback?: (err: Error | null, params: Runtime.AwaitPromiseReturnType) => void): void; + /** + * Calls function with given declaration on the given object. Object group of the result is inherited from the target object. + */ + post(method: 'Runtime.callFunctionOn', params?: Runtime.CallFunctionOnParameterType, callback?: (err: Error | null, params: Runtime.CallFunctionOnReturnType) => void): void; + post(method: 'Runtime.callFunctionOn', callback?: (err: Error | null, params: Runtime.CallFunctionOnReturnType) => void): void; + /** + * Returns properties of a given object. Object group of the result is inherited from the target object. + */ + post(method: 'Runtime.getProperties', params?: Runtime.GetPropertiesParameterType, callback?: (err: Error | null, params: Runtime.GetPropertiesReturnType) => void): void; + post(method: 'Runtime.getProperties', callback?: (err: Error | null, params: Runtime.GetPropertiesReturnType) => void): void; + /** + * Releases remote object with given id. + */ + post(method: 'Runtime.releaseObject', params?: Runtime.ReleaseObjectParameterType, callback?: (err: Error | null) => void): void; + post(method: 'Runtime.releaseObject', callback?: (err: Error | null) => void): void; + /** + * Releases all remote objects that belong to a given group. + */ + post(method: 'Runtime.releaseObjectGroup', params?: Runtime.ReleaseObjectGroupParameterType, callback?: (err: Error | null) => void): void; + post(method: 'Runtime.releaseObjectGroup', callback?: (err: Error | null) => void): void; + /** + * Tells inspected instance to run if it was waiting for debugger to attach. + */ + post(method: 'Runtime.runIfWaitingForDebugger', callback?: (err: Error | null) => void): void; + /** + * Enables reporting of execution contexts creation by means of executionContextCreated event. When the reporting gets enabled the event will be sent immediately for each existing execution context. + */ + post(method: 'Runtime.enable', callback?: (err: Error | null) => void): void; + /** + * Disables reporting of execution contexts creation. + */ + post(method: 'Runtime.disable', callback?: (err: Error | null) => void): void; + /** + * Discards collected exceptions and console API calls. + */ + post(method: 'Runtime.discardConsoleEntries', callback?: (err: Error | null) => void): void; + /** + * @experimental + */ + post(method: 'Runtime.setCustomObjectFormatterEnabled', params?: Runtime.SetCustomObjectFormatterEnabledParameterType, callback?: (err: Error | null) => void): void; + post(method: 'Runtime.setCustomObjectFormatterEnabled', callback?: (err: Error | null) => void): void; + /** + * Compiles expression. + */ + post(method: 'Runtime.compileScript', params?: Runtime.CompileScriptParameterType, callback?: (err: Error | null, params: Runtime.CompileScriptReturnType) => void): void; + post(method: 'Runtime.compileScript', callback?: (err: Error | null, params: Runtime.CompileScriptReturnType) => void): void; + /** + * Runs script with given id in a given context. + */ + post(method: 'Runtime.runScript', params?: Runtime.RunScriptParameterType, callback?: (err: Error | null, params: Runtime.RunScriptReturnType) => void): void; + post(method: 'Runtime.runScript', callback?: (err: Error | null, params: Runtime.RunScriptReturnType) => void): void; + post(method: 'Runtime.queryObjects', params?: Runtime.QueryObjectsParameterType, callback?: (err: Error | null, params: Runtime.QueryObjectsReturnType) => void): void; + post(method: 'Runtime.queryObjects', callback?: (err: Error | null, params: Runtime.QueryObjectsReturnType) => void): void; + /** + * Returns all let, const and class variables from global scope. + */ + post( + method: 'Runtime.globalLexicalScopeNames', + params?: Runtime.GlobalLexicalScopeNamesParameterType, + callback?: (err: Error | null, params: Runtime.GlobalLexicalScopeNamesReturnType) => void + ): void; + post(method: 'Runtime.globalLexicalScopeNames', callback?: (err: Error | null, params: Runtime.GlobalLexicalScopeNamesReturnType) => void): void; + /** + * Enables debugger for the given page. Clients should not assume that the debugging has been enabled until the result for this command is received. + */ + post(method: 'Debugger.enable', callback?: (err: Error | null, params: Debugger.EnableReturnType) => void): void; + /** + * Disables debugger for given page. + */ + post(method: 'Debugger.disable', callback?: (err: Error | null) => void): void; + /** + * Activates / deactivates all breakpoints on the page. + */ + post(method: 'Debugger.setBreakpointsActive', params?: Debugger.SetBreakpointsActiveParameterType, callback?: (err: Error | null) => void): void; + post(method: 'Debugger.setBreakpointsActive', callback?: (err: Error | null) => void): void; + /** + * Makes page not interrupt on any pauses (breakpoint, exception, dom exception etc). + */ + post(method: 'Debugger.setSkipAllPauses', params?: Debugger.SetSkipAllPausesParameterType, callback?: (err: Error | null) => void): void; + post(method: 'Debugger.setSkipAllPauses', callback?: (err: Error | null) => void): void; + /** + * Sets JavaScript breakpoint at given location specified either by URL or URL regex. Once this command is issued, all existing parsed scripts will have breakpoints resolved and returned in locations property. Further matching script parsing will result in subsequent breakpointResolved events issued. This logical breakpoint will survive page reloads. + */ + post(method: 'Debugger.setBreakpointByUrl', params?: Debugger.SetBreakpointByUrlParameterType, callback?: (err: Error | null, params: Debugger.SetBreakpointByUrlReturnType) => void): void; + post(method: 'Debugger.setBreakpointByUrl', callback?: (err: Error | null, params: Debugger.SetBreakpointByUrlReturnType) => void): void; + /** + * Sets JavaScript breakpoint at a given location. + */ + post(method: 'Debugger.setBreakpoint', params?: Debugger.SetBreakpointParameterType, callback?: (err: Error | null, params: Debugger.SetBreakpointReturnType) => void): void; + post(method: 'Debugger.setBreakpoint', callback?: (err: Error | null, params: Debugger.SetBreakpointReturnType) => void): void; + /** + * Removes JavaScript breakpoint. + */ + post(method: 'Debugger.removeBreakpoint', params?: Debugger.RemoveBreakpointParameterType, callback?: (err: Error | null) => void): void; + post(method: 'Debugger.removeBreakpoint', callback?: (err: Error | null) => void): void; + /** + * Returns possible locations for breakpoint. scriptId in start and end range locations should be the same. + */ + post( + method: 'Debugger.getPossibleBreakpoints', + params?: Debugger.GetPossibleBreakpointsParameterType, + callback?: (err: Error | null, params: Debugger.GetPossibleBreakpointsReturnType) => void + ): void; + post(method: 'Debugger.getPossibleBreakpoints', callback?: (err: Error | null, params: Debugger.GetPossibleBreakpointsReturnType) => void): void; + /** + * Continues execution until specific location is reached. + */ + post(method: 'Debugger.continueToLocation', params?: Debugger.ContinueToLocationParameterType, callback?: (err: Error | null) => void): void; + post(method: 'Debugger.continueToLocation', callback?: (err: Error | null) => void): void; + /** + * @experimental + */ + post(method: 'Debugger.pauseOnAsyncCall', params?: Debugger.PauseOnAsyncCallParameterType, callback?: (err: Error | null) => void): void; + post(method: 'Debugger.pauseOnAsyncCall', callback?: (err: Error | null) => void): void; + /** + * Steps over the statement. + */ + post(method: 'Debugger.stepOver', callback?: (err: Error | null) => void): void; + /** + * Steps into the function call. + */ + post(method: 'Debugger.stepInto', params?: Debugger.StepIntoParameterType, callback?: (err: Error | null) => void): void; + post(method: 'Debugger.stepInto', callback?: (err: Error | null) => void): void; + /** + * Steps out of the function call. + */ + post(method: 'Debugger.stepOut', callback?: (err: Error | null) => void): void; + /** + * Stops on the next JavaScript statement. + */ + post(method: 'Debugger.pause', callback?: (err: Error | null) => void): void; + /** + * This method is deprecated - use Debugger.stepInto with breakOnAsyncCall and Debugger.pauseOnAsyncTask instead. Steps into next scheduled async task if any is scheduled before next pause. Returns success when async task is actually scheduled, returns error if no task were scheduled or another scheduleStepIntoAsync was called. + * @experimental + */ + post(method: 'Debugger.scheduleStepIntoAsync', callback?: (err: Error | null) => void): void; + /** + * Resumes JavaScript execution. + */ + post(method: 'Debugger.resume', callback?: (err: Error | null) => void): void; + /** + * Returns stack trace with given stackTraceId. + * @experimental + */ + post(method: 'Debugger.getStackTrace', params?: Debugger.GetStackTraceParameterType, callback?: (err: Error | null, params: Debugger.GetStackTraceReturnType) => void): void; + post(method: 'Debugger.getStackTrace', callback?: (err: Error | null, params: Debugger.GetStackTraceReturnType) => void): void; + /** + * Searches for given string in script content. + */ + post(method: 'Debugger.searchInContent', params?: Debugger.SearchInContentParameterType, callback?: (err: Error | null, params: Debugger.SearchInContentReturnType) => void): void; + post(method: 'Debugger.searchInContent', callback?: (err: Error | null, params: Debugger.SearchInContentReturnType) => void): void; + /** + * Edits JavaScript source live. + */ + post(method: 'Debugger.setScriptSource', params?: Debugger.SetScriptSourceParameterType, callback?: (err: Error | null, params: Debugger.SetScriptSourceReturnType) => void): void; + post(method: 'Debugger.setScriptSource', callback?: (err: Error | null, params: Debugger.SetScriptSourceReturnType) => void): void; + /** + * Restarts particular call frame from the beginning. + */ + post(method: 'Debugger.restartFrame', params?: Debugger.RestartFrameParameterType, callback?: (err: Error | null, params: Debugger.RestartFrameReturnType) => void): void; + post(method: 'Debugger.restartFrame', callback?: (err: Error | null, params: Debugger.RestartFrameReturnType) => void): void; + /** + * Returns source for the script with given id. + */ + post(method: 'Debugger.getScriptSource', params?: Debugger.GetScriptSourceParameterType, callback?: (err: Error | null, params: Debugger.GetScriptSourceReturnType) => void): void; + post(method: 'Debugger.getScriptSource', callback?: (err: Error | null, params: Debugger.GetScriptSourceReturnType) => void): void; + /** + * Defines pause on exceptions state. Can be set to stop on all exceptions, uncaught exceptions or no exceptions. Initial pause on exceptions state is none. + */ + post(method: 'Debugger.setPauseOnExceptions', params?: Debugger.SetPauseOnExceptionsParameterType, callback?: (err: Error | null) => void): void; + post(method: 'Debugger.setPauseOnExceptions', callback?: (err: Error | null) => void): void; + /** + * Evaluates expression on a given call frame. + */ + post(method: 'Debugger.evaluateOnCallFrame', params?: Debugger.EvaluateOnCallFrameParameterType, callback?: (err: Error | null, params: Debugger.EvaluateOnCallFrameReturnType) => void): void; + post(method: 'Debugger.evaluateOnCallFrame', callback?: (err: Error | null, params: Debugger.EvaluateOnCallFrameReturnType) => void): void; + /** + * Changes value of variable in a callframe. Object-based scopes are not supported and must be mutated manually. + */ + post(method: 'Debugger.setVariableValue', params?: Debugger.SetVariableValueParameterType, callback?: (err: Error | null) => void): void; + post(method: 'Debugger.setVariableValue', callback?: (err: Error | null) => void): void; + /** + * Changes return value in top frame. Available only at return break position. + * @experimental + */ + post(method: 'Debugger.setReturnValue', params?: Debugger.SetReturnValueParameterType, callback?: (err: Error | null) => void): void; + post(method: 'Debugger.setReturnValue', callback?: (err: Error | null) => void): void; + /** + * Enables or disables async call stacks tracking. + */ + post(method: 'Debugger.setAsyncCallStackDepth', params?: Debugger.SetAsyncCallStackDepthParameterType, callback?: (err: Error | null) => void): void; + post(method: 'Debugger.setAsyncCallStackDepth', callback?: (err: Error | null) => void): void; + /** + * Replace previous blackbox patterns with passed ones. Forces backend to skip stepping/pausing in scripts with url matching one of the patterns. VM will try to leave blackboxed script by performing 'step in' several times, finally resorting to 'step out' if unsuccessful. + * @experimental + */ + post(method: 'Debugger.setBlackboxPatterns', params?: Debugger.SetBlackboxPatternsParameterType, callback?: (err: Error | null) => void): void; + post(method: 'Debugger.setBlackboxPatterns', callback?: (err: Error | null) => void): void; + /** + * Makes backend skip steps in the script in blackboxed ranges. VM will try leave blacklisted scripts by performing 'step in' several times, finally resorting to 'step out' if unsuccessful. Positions array contains positions where blackbox state is changed. First interval isn't blackboxed. Array should be sorted. + * @experimental + */ + post(method: 'Debugger.setBlackboxedRanges', params?: Debugger.SetBlackboxedRangesParameterType, callback?: (err: Error | null) => void): void; + post(method: 'Debugger.setBlackboxedRanges', callback?: (err: Error | null) => void): void; + /** + * Enables console domain, sends the messages collected so far to the client by means of the messageAdded notification. + */ + post(method: 'Console.enable', callback?: (err: Error | null) => void): void; + /** + * Disables console domain, prevents further console messages from being reported to the client. + */ + post(method: 'Console.disable', callback?: (err: Error | null) => void): void; + /** + * Does nothing. + */ + post(method: 'Console.clearMessages', callback?: (err: Error | null) => void): void; + post(method: 'Profiler.enable', callback?: (err: Error | null) => void): void; + post(method: 'Profiler.disable', callback?: (err: Error | null) => void): void; + /** + * Changes CPU profiler sampling interval. Must be called before CPU profiles recording started. + */ + post(method: 'Profiler.setSamplingInterval', params?: Profiler.SetSamplingIntervalParameterType, callback?: (err: Error | null) => void): void; + post(method: 'Profiler.setSamplingInterval', callback?: (err: Error | null) => void): void; + post(method: 'Profiler.start', callback?: (err: Error | null) => void): void; + post(method: 'Profiler.stop', callback?: (err: Error | null, params: Profiler.StopReturnType) => void): void; + /** + * Enable precise code coverage. Coverage data for JavaScript executed before enabling precise code coverage may be incomplete. Enabling prevents running optimized code and resets execution counters. + */ + post(method: 'Profiler.startPreciseCoverage', params?: Profiler.StartPreciseCoverageParameterType, callback?: (err: Error | null) => void): void; + post(method: 'Profiler.startPreciseCoverage', callback?: (err: Error | null) => void): void; + /** + * Disable precise code coverage. Disabling releases unnecessary execution count records and allows executing optimized code. + */ + post(method: 'Profiler.stopPreciseCoverage', callback?: (err: Error | null) => void): void; + /** + * Collect coverage data for the current isolate, and resets execution counters. Precise code coverage needs to have started. + */ + post(method: 'Profiler.takePreciseCoverage', callback?: (err: Error | null, params: Profiler.TakePreciseCoverageReturnType) => void): void; + /** + * Collect coverage data for the current isolate. The coverage data may be incomplete due to garbage collection. + */ + post(method: 'Profiler.getBestEffortCoverage', callback?: (err: Error | null, params: Profiler.GetBestEffortCoverageReturnType) => void): void; + /** + * Enable type profile. + * @experimental + */ + post(method: 'Profiler.startTypeProfile', callback?: (err: Error | null) => void): void; + /** + * Disable type profile. Disabling releases type profile data collected so far. + * @experimental + */ + post(method: 'Profiler.stopTypeProfile', callback?: (err: Error | null) => void): void; + /** + * Collect type profile. + * @experimental + */ + post(method: 'Profiler.takeTypeProfile', callback?: (err: Error | null, params: Profiler.TakeTypeProfileReturnType) => void): void; + post(method: 'HeapProfiler.enable', callback?: (err: Error | null) => void): void; + post(method: 'HeapProfiler.disable', callback?: (err: Error | null) => void): void; + post(method: 'HeapProfiler.startTrackingHeapObjects', params?: HeapProfiler.StartTrackingHeapObjectsParameterType, callback?: (err: Error | null) => void): void; + post(method: 'HeapProfiler.startTrackingHeapObjects', callback?: (err: Error | null) => void): void; + post(method: 'HeapProfiler.stopTrackingHeapObjects', params?: HeapProfiler.StopTrackingHeapObjectsParameterType, callback?: (err: Error | null) => void): void; + post(method: 'HeapProfiler.stopTrackingHeapObjects', callback?: (err: Error | null) => void): void; + post(method: 'HeapProfiler.takeHeapSnapshot', params?: HeapProfiler.TakeHeapSnapshotParameterType, callback?: (err: Error | null) => void): void; + post(method: 'HeapProfiler.takeHeapSnapshot', callback?: (err: Error | null) => void): void; + post(method: 'HeapProfiler.collectGarbage', callback?: (err: Error | null) => void): void; + post( + method: 'HeapProfiler.getObjectByHeapObjectId', + params?: HeapProfiler.GetObjectByHeapObjectIdParameterType, + callback?: (err: Error | null, params: HeapProfiler.GetObjectByHeapObjectIdReturnType) => void + ): void; + post(method: 'HeapProfiler.getObjectByHeapObjectId', callback?: (err: Error | null, params: HeapProfiler.GetObjectByHeapObjectIdReturnType) => void): void; + /** + * Enables console to refer to the node with given id via $x (see Command Line API for more details $x functions). + */ + post(method: 'HeapProfiler.addInspectedHeapObject', params?: HeapProfiler.AddInspectedHeapObjectParameterType, callback?: (err: Error | null) => void): void; + post(method: 'HeapProfiler.addInspectedHeapObject', callback?: (err: Error | null) => void): void; + post(method: 'HeapProfiler.getHeapObjectId', params?: HeapProfiler.GetHeapObjectIdParameterType, callback?: (err: Error | null, params: HeapProfiler.GetHeapObjectIdReturnType) => void): void; + post(method: 'HeapProfiler.getHeapObjectId', callback?: (err: Error | null, params: HeapProfiler.GetHeapObjectIdReturnType) => void): void; + post(method: 'HeapProfiler.startSampling', params?: HeapProfiler.StartSamplingParameterType, callback?: (err: Error | null) => void): void; + post(method: 'HeapProfiler.startSampling', callback?: (err: Error | null) => void): void; + post(method: 'HeapProfiler.stopSampling', callback?: (err: Error | null, params: HeapProfiler.StopSamplingReturnType) => void): void; + post(method: 'HeapProfiler.getSamplingProfile', callback?: (err: Error | null, params: HeapProfiler.GetSamplingProfileReturnType) => void): void; + /** + * Gets supported tracing categories. + */ + post(method: 'NodeTracing.getCategories', callback?: (err: Error | null, params: NodeTracing.GetCategoriesReturnType) => void): void; + /** + * Start trace events collection. + */ + post(method: 'NodeTracing.start', params?: NodeTracing.StartParameterType, callback?: (err: Error | null) => void): void; + post(method: 'NodeTracing.start', callback?: (err: Error | null) => void): void; + /** + * Stop trace events collection. Remaining collected events will be sent as a sequence of + * dataCollected events followed by tracingComplete event. + */ + post(method: 'NodeTracing.stop', callback?: (err: Error | null) => void): void; + /** + * Sends protocol message over session with given id. + */ + post(method: 'NodeWorker.sendMessageToWorker', params?: NodeWorker.SendMessageToWorkerParameterType, callback?: (err: Error | null) => void): void; + post(method: 'NodeWorker.sendMessageToWorker', callback?: (err: Error | null) => void): void; + /** + * Instructs the inspector to attach to running workers. Will also attach to new workers + * as they start + */ + post(method: 'NodeWorker.enable', params?: NodeWorker.EnableParameterType, callback?: (err: Error | null) => void): void; + post(method: 'NodeWorker.enable', callback?: (err: Error | null) => void): void; + /** + * Detaches from all running workers and disables attaching to new workers as they are started. + */ + post(method: 'NodeWorker.disable', callback?: (err: Error | null) => void): void; + /** + * Detached from the worker with given sessionId. + */ + post(method: 'NodeWorker.detach', params?: NodeWorker.DetachParameterType, callback?: (err: Error | null) => void): void; + post(method: 'NodeWorker.detach', callback?: (err: Error | null) => void): void; + /** + * Enable the `NodeRuntime.waitingForDisconnect`. + */ + post(method: 'NodeRuntime.notifyWhenWaitingForDisconnect', params?: NodeRuntime.NotifyWhenWaitingForDisconnectParameterType, callback?: (err: Error | null) => void): void; + post(method: 'NodeRuntime.notifyWhenWaitingForDisconnect', callback?: (err: Error | null) => void): void; + // Events + addListener(event: string, listener: (...args: any[]) => void): this; + /** + * Emitted when any notification from the V8 Inspector is received. + */ + addListener(event: 'inspectorNotification', listener: (message: InspectorNotification<{}>) => void): this; + /** + * Issued when new execution context is created. + */ + addListener(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; + /** + * Issued when execution context is destroyed. + */ + addListener(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; + /** + * Issued when all executionContexts were cleared in browser + */ + addListener(event: 'Runtime.executionContextsCleared', listener: () => void): this; + /** + * Issued when exception was thrown and unhandled. + */ + addListener(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; + /** + * Issued when unhandled exception was revoked. + */ + addListener(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; + /** + * Issued when console API was called. + */ + addListener(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; + /** + * Issued when object should be inspected (for example, as a result of inspect() command line API call). + */ + addListener(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; + /** + * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. + */ + addListener(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; + /** + * Fired when virtual machine fails to parse the script. + */ + addListener(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; + /** + * Fired when breakpoint is resolved to an actual script and location. + */ + addListener(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; + /** + * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. + */ + addListener(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; + /** + * Fired when the virtual machine resumed execution. + */ + addListener(event: 'Debugger.resumed', listener: () => void): this; + /** + * Issued when new console message is added. + */ + addListener(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; + /** + * Sent when new profile recording is started using console.profile() call. + */ + addListener(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification) => void): this; + addListener(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification) => void): this; + addListener(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification) => void): this; + addListener(event: 'HeapProfiler.resetProfiles', listener: () => void): this; + addListener(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification) => void): this; + /** + * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. + */ + addListener(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; + /** + * If heap objects tracking has been started then backend may send update for one or more fragments + */ + addListener(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; + /** + * Contains an bucket of collected trace events. + */ + addListener(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; + /** + * Signals that tracing is stopped and there is no trace buffers pending flush, all data were + * delivered via dataCollected events. + */ + addListener(event: 'NodeTracing.tracingComplete', listener: () => void): this; + /** + * Issued when attached to a worker. + */ + addListener(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; + /** + * Issued when detached from the worker. + */ + addListener(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; + /** + * Notifies about a new protocol message received from the session + * (session ID is provided in attachedToWorker notification). + */ + addListener(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; + /** + * This event is fired instead of `Runtime.executionContextDestroyed` when + * enabled. + * It is fired when the Node process finished all code execution and is + * waiting for all frontends to disconnect. + */ + addListener(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this; + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: 'inspectorNotification', message: InspectorNotification<{}>): boolean; + emit(event: 'Runtime.executionContextCreated', message: InspectorNotification): boolean; + emit(event: 'Runtime.executionContextDestroyed', message: InspectorNotification): boolean; + emit(event: 'Runtime.executionContextsCleared'): boolean; + emit(event: 'Runtime.exceptionThrown', message: InspectorNotification): boolean; + emit(event: 'Runtime.exceptionRevoked', message: InspectorNotification): boolean; + emit(event: 'Runtime.consoleAPICalled', message: InspectorNotification): boolean; + emit(event: 'Runtime.inspectRequested', message: InspectorNotification): boolean; + emit(event: 'Debugger.scriptParsed', message: InspectorNotification): boolean; + emit(event: 'Debugger.scriptFailedToParse', message: InspectorNotification): boolean; + emit(event: 'Debugger.breakpointResolved', message: InspectorNotification): boolean; + emit(event: 'Debugger.paused', message: InspectorNotification): boolean; + emit(event: 'Debugger.resumed'): boolean; + emit(event: 'Console.messageAdded', message: InspectorNotification): boolean; + emit(event: 'Profiler.consoleProfileStarted', message: InspectorNotification): boolean; + emit(event: 'Profiler.consoleProfileFinished', message: InspectorNotification): boolean; + emit(event: 'HeapProfiler.addHeapSnapshotChunk', message: InspectorNotification): boolean; + emit(event: 'HeapProfiler.resetProfiles'): boolean; + emit(event: 'HeapProfiler.reportHeapSnapshotProgress', message: InspectorNotification): boolean; + emit(event: 'HeapProfiler.lastSeenObjectId', message: InspectorNotification): boolean; + emit(event: 'HeapProfiler.heapStatsUpdate', message: InspectorNotification): boolean; + emit(event: 'NodeTracing.dataCollected', message: InspectorNotification): boolean; + emit(event: 'NodeTracing.tracingComplete'): boolean; + emit(event: 'NodeWorker.attachedToWorker', message: InspectorNotification): boolean; + emit(event: 'NodeWorker.detachedFromWorker', message: InspectorNotification): boolean; + emit(event: 'NodeWorker.receivedMessageFromWorker', message: InspectorNotification): boolean; + emit(event: 'NodeRuntime.waitingForDisconnect'): boolean; + on(event: string, listener: (...args: any[]) => void): this; + /** + * Emitted when any notification from the V8 Inspector is received. + */ + on(event: 'inspectorNotification', listener: (message: InspectorNotification<{}>) => void): this; + /** + * Issued when new execution context is created. + */ + on(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; + /** + * Issued when execution context is destroyed. + */ + on(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; + /** + * Issued when all executionContexts were cleared in browser + */ + on(event: 'Runtime.executionContextsCleared', listener: () => void): this; + /** + * Issued when exception was thrown and unhandled. + */ + on(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; + /** + * Issued when unhandled exception was revoked. + */ + on(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; + /** + * Issued when console API was called. + */ + on(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; + /** + * Issued when object should be inspected (for example, as a result of inspect() command line API call). + */ + on(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; + /** + * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. + */ + on(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; + /** + * Fired when virtual machine fails to parse the script. + */ + on(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; + /** + * Fired when breakpoint is resolved to an actual script and location. + */ + on(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; + /** + * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. + */ + on(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; + /** + * Fired when the virtual machine resumed execution. + */ + on(event: 'Debugger.resumed', listener: () => void): this; + /** + * Issued when new console message is added. + */ + on(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; + /** + * Sent when new profile recording is started using console.profile() call. + */ + on(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification) => void): this; + on(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification) => void): this; + on(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification) => void): this; + on(event: 'HeapProfiler.resetProfiles', listener: () => void): this; + on(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification) => void): this; + /** + * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. + */ + on(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; + /** + * If heap objects tracking has been started then backend may send update for one or more fragments + */ + on(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; + /** + * Contains an bucket of collected trace events. + */ + on(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; + /** + * Signals that tracing is stopped and there is no trace buffers pending flush, all data were + * delivered via dataCollected events. + */ + on(event: 'NodeTracing.tracingComplete', listener: () => void): this; + /** + * Issued when attached to a worker. + */ + on(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; + /** + * Issued when detached from the worker. + */ + on(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; + /** + * Notifies about a new protocol message received from the session + * (session ID is provided in attachedToWorker notification). + */ + on(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; + /** + * This event is fired instead of `Runtime.executionContextDestroyed` when + * enabled. + * It is fired when the Node process finished all code execution and is + * waiting for all frontends to disconnect. + */ + on(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this; + once(event: string, listener: (...args: any[]) => void): this; + /** + * Emitted when any notification from the V8 Inspector is received. + */ + once(event: 'inspectorNotification', listener: (message: InspectorNotification<{}>) => void): this; + /** + * Issued when new execution context is created. + */ + once(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; + /** + * Issued when execution context is destroyed. + */ + once(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; + /** + * Issued when all executionContexts were cleared in browser + */ + once(event: 'Runtime.executionContextsCleared', listener: () => void): this; + /** + * Issued when exception was thrown and unhandled. + */ + once(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; + /** + * Issued when unhandled exception was revoked. + */ + once(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; + /** + * Issued when console API was called. + */ + once(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; + /** + * Issued when object should be inspected (for example, as a result of inspect() command line API call). + */ + once(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; + /** + * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. + */ + once(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; + /** + * Fired when virtual machine fails to parse the script. + */ + once(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; + /** + * Fired when breakpoint is resolved to an actual script and location. + */ + once(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; + /** + * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. + */ + once(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; + /** + * Fired when the virtual machine resumed execution. + */ + once(event: 'Debugger.resumed', listener: () => void): this; + /** + * Issued when new console message is added. + */ + once(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; + /** + * Sent when new profile recording is started using console.profile() call. + */ + once(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification) => void): this; + once(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification) => void): this; + once(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification) => void): this; + once(event: 'HeapProfiler.resetProfiles', listener: () => void): this; + once(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification) => void): this; + /** + * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. + */ + once(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; + /** + * If heap objects tracking has been started then backend may send update for one or more fragments + */ + once(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; + /** + * Contains an bucket of collected trace events. + */ + once(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; + /** + * Signals that tracing is stopped and there is no trace buffers pending flush, all data were + * delivered via dataCollected events. + */ + once(event: 'NodeTracing.tracingComplete', listener: () => void): this; + /** + * Issued when attached to a worker. + */ + once(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; + /** + * Issued when detached from the worker. + */ + once(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; + /** + * Notifies about a new protocol message received from the session + * (session ID is provided in attachedToWorker notification). + */ + once(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; + /** + * This event is fired instead of `Runtime.executionContextDestroyed` when + * enabled. + * It is fired when the Node process finished all code execution and is + * waiting for all frontends to disconnect. + */ + once(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this; + prependListener(event: string, listener: (...args: any[]) => void): this; + /** + * Emitted when any notification from the V8 Inspector is received. + */ + prependListener(event: 'inspectorNotification', listener: (message: InspectorNotification<{}>) => void): this; + /** + * Issued when new execution context is created. + */ + prependListener(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; + /** + * Issued when execution context is destroyed. + */ + prependListener(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; + /** + * Issued when all executionContexts were cleared in browser + */ + prependListener(event: 'Runtime.executionContextsCleared', listener: () => void): this; + /** + * Issued when exception was thrown and unhandled. + */ + prependListener(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; + /** + * Issued when unhandled exception was revoked. + */ + prependListener(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; + /** + * Issued when console API was called. + */ + prependListener(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; + /** + * Issued when object should be inspected (for example, as a result of inspect() command line API call). + */ + prependListener(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; + /** + * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. + */ + prependListener(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; + /** + * Fired when virtual machine fails to parse the script. + */ + prependListener(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; + /** + * Fired when breakpoint is resolved to an actual script and location. + */ + prependListener(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; + /** + * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. + */ + prependListener(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; + /** + * Fired when the virtual machine resumed execution. + */ + prependListener(event: 'Debugger.resumed', listener: () => void): this; + /** + * Issued when new console message is added. + */ + prependListener(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; + /** + * Sent when new profile recording is started using console.profile() call. + */ + prependListener(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification) => void): this; + prependListener(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification) => void): this; + prependListener(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification) => void): this; + prependListener(event: 'HeapProfiler.resetProfiles', listener: () => void): this; + prependListener(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification) => void): this; + /** + * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. + */ + prependListener(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; + /** + * If heap objects tracking has been started then backend may send update for one or more fragments + */ + prependListener(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; + /** + * Contains an bucket of collected trace events. + */ + prependListener(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; + /** + * Signals that tracing is stopped and there is no trace buffers pending flush, all data were + * delivered via dataCollected events. + */ + prependListener(event: 'NodeTracing.tracingComplete', listener: () => void): this; + /** + * Issued when attached to a worker. + */ + prependListener(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; + /** + * Issued when detached from the worker. + */ + prependListener(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; + /** + * Notifies about a new protocol message received from the session + * (session ID is provided in attachedToWorker notification). + */ + prependListener(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; + /** + * This event is fired instead of `Runtime.executionContextDestroyed` when + * enabled. + * It is fired when the Node process finished all code execution and is + * waiting for all frontends to disconnect. + */ + prependListener(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this; + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + /** + * Emitted when any notification from the V8 Inspector is received. + */ + prependOnceListener(event: 'inspectorNotification', listener: (message: InspectorNotification<{}>) => void): this; + /** + * Issued when new execution context is created. + */ + prependOnceListener(event: 'Runtime.executionContextCreated', listener: (message: InspectorNotification) => void): this; + /** + * Issued when execution context is destroyed. + */ + prependOnceListener(event: 'Runtime.executionContextDestroyed', listener: (message: InspectorNotification) => void): this; + /** + * Issued when all executionContexts were cleared in browser + */ + prependOnceListener(event: 'Runtime.executionContextsCleared', listener: () => void): this; + /** + * Issued when exception was thrown and unhandled. + */ + prependOnceListener(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; + /** + * Issued when unhandled exception was revoked. + */ + prependOnceListener(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; + /** + * Issued when console API was called. + */ + prependOnceListener(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => void): this; + /** + * Issued when object should be inspected (for example, as a result of inspect() command line API call). + */ + prependOnceListener(event: 'Runtime.inspectRequested', listener: (message: InspectorNotification) => void): this; + /** + * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. + */ + prependOnceListener(event: 'Debugger.scriptParsed', listener: (message: InspectorNotification) => void): this; + /** + * Fired when virtual machine fails to parse the script. + */ + prependOnceListener(event: 'Debugger.scriptFailedToParse', listener: (message: InspectorNotification) => void): this; + /** + * Fired when breakpoint is resolved to an actual script and location. + */ + prependOnceListener(event: 'Debugger.breakpointResolved', listener: (message: InspectorNotification) => void): this; + /** + * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. + */ + prependOnceListener(event: 'Debugger.paused', listener: (message: InspectorNotification) => void): this; + /** + * Fired when the virtual machine resumed execution. + */ + prependOnceListener(event: 'Debugger.resumed', listener: () => void): this; + /** + * Issued when new console message is added. + */ + prependOnceListener(event: 'Console.messageAdded', listener: (message: InspectorNotification) => void): this; + /** + * Sent when new profile recording is started using console.profile() call. + */ + prependOnceListener(event: 'Profiler.consoleProfileStarted', listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: 'HeapProfiler.resetProfiles', listener: () => void): this; + prependOnceListener(event: 'HeapProfiler.reportHeapSnapshotProgress', listener: (message: InspectorNotification) => void): this; + /** + * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. + */ + prependOnceListener(event: 'HeapProfiler.lastSeenObjectId', listener: (message: InspectorNotification) => void): this; + /** + * If heap objects tracking has been started then backend may send update for one or more fragments + */ + prependOnceListener(event: 'HeapProfiler.heapStatsUpdate', listener: (message: InspectorNotification) => void): this; + /** + * Contains an bucket of collected trace events. + */ + prependOnceListener(event: 'NodeTracing.dataCollected', listener: (message: InspectorNotification) => void): this; + /** + * Signals that tracing is stopped and there is no trace buffers pending flush, all data were + * delivered via dataCollected events. + */ + prependOnceListener(event: 'NodeTracing.tracingComplete', listener: () => void): this; + /** + * Issued when attached to a worker. + */ + prependOnceListener(event: 'NodeWorker.attachedToWorker', listener: (message: InspectorNotification) => void): this; + /** + * Issued when detached from the worker. + */ + prependOnceListener(event: 'NodeWorker.detachedFromWorker', listener: (message: InspectorNotification) => void): this; + /** + * Notifies about a new protocol message received from the session + * (session ID is provided in attachedToWorker notification). + */ + prependOnceListener(event: 'NodeWorker.receivedMessageFromWorker', listener: (message: InspectorNotification) => void): this; + /** + * This event is fired instead of `Runtime.executionContextDestroyed` when + * enabled. + * It is fired when the Node process finished all code execution and is + * waiting for all frontends to disconnect. + */ + prependOnceListener(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this; + } + /** + * Activate inspector on host and port. Equivalent to`node --inspect=[[host:]port]`, but can be done programmatically after node has + * started. + * + * If wait is `true`, will block until a client has connected to the inspect port + * and flow control has been passed to the debugger client. + * + * See the `security warning` regarding the `host`parameter usage. + * @param [port='what was specified on the CLI'] Port to listen on for inspector connections. Optional. + * @param [host='what was specified on the CLI'] Host to listen on for inspector connections. Optional. + * @param [wait=false] Block until a client has connected. Optional. + * @returns Disposable that calls `inspector.close()`. + */ + function open(port?: number, host?: string, wait?: boolean): Disposable; + /** + * Deactivate the inspector. Blocks until there are no active connections. + */ + function close(): void; + /** + * Return the URL of the active inspector, or `undefined` if there is none. + * + * ```console + * $ node --inspect -p 'inspector.url()' + * Debugger listening on ws://127.0.0.1:9229/166e272e-7a30-4d09-97ce-f1c012b43c34 + * For help, see: https://nodejs.org/en/docs/inspector + * ws://127.0.0.1:9229/166e272e-7a30-4d09-97ce-f1c012b43c34 + * + * $ node --inspect=localhost:3000 -p 'inspector.url()' + * Debugger listening on ws://localhost:3000/51cf8d0e-3c36-4c59-8efd-54519839e56a + * For help, see: https://nodejs.org/en/docs/inspector + * ws://localhost:3000/51cf8d0e-3c36-4c59-8efd-54519839e56a + * + * $ node -p 'inspector.url()' + * undefined + * ``` + */ + function url(): string | undefined; + /** + * Blocks until a client (existing or connected later) has sent`Runtime.runIfWaitingForDebugger` command. + * + * An exception will be thrown if there is no active inspector. + * @since v12.7.0 + */ + function waitForDebugger(): void; +} +/** + * The inspector module provides an API for interacting with the V8 inspector. + */ +declare module 'inspector' { + import inspector = require('node:inspector'); + export = inspector; +} diff --git a/node_modules/@types/node/ts4.8/module.d.ts b/node_modules/@types/node/ts4.8/module.d.ts new file mode 100644 index 0000000..5331d20 --- /dev/null +++ b/node_modules/@types/node/ts4.8/module.d.ts @@ -0,0 +1,257 @@ +/** + * @since v0.3.7 + */ +declare module 'node:module' { + import { URL } from 'node:url'; + import { MessagePort } from 'node:worker_threads'; + namespace Module { + /** + * The `module.syncBuiltinESMExports()` method updates all the live bindings for + * builtin `ES Modules` to match the properties of the `CommonJS` exports. It + * does not add or remove exported names from the `ES Modules`. + * + * ```js + * const fs = require('node:fs'); + * const assert = require('node:assert'); + * const { syncBuiltinESMExports } = require('node:module'); + * + * fs.readFile = newAPI; + * + * delete fs.readFileSync; + * + * function newAPI() { + * // ... + * } + * + * fs.newAPI = newAPI; + * + * syncBuiltinESMExports(); + * + * import('node:fs').then((esmFS) => { + * // It syncs the existing readFile property with the new value + * assert.strictEqual(esmFS.readFile, newAPI); + * // readFileSync has been deleted from the required fs + * assert.strictEqual('readFileSync' in fs, false); + * // syncBuiltinESMExports() does not remove readFileSync from esmFS + * assert.strictEqual('readFileSync' in esmFS, true); + * // syncBuiltinESMExports() does not add names + * assert.strictEqual(esmFS.newAPI, undefined); + * }); + * ``` + * @since v12.12.0 + */ + function syncBuiltinESMExports(): void; + /** + * `path` is the resolved path for the file for which a corresponding source map + * should be fetched. + * @since v13.7.0, v12.17.0 + * @return Returns `module.SourceMap` if a source map is found, `undefined` otherwise. + */ + function findSourceMap(path: string, error?: Error): SourceMap; + interface SourceMapPayload { + file: string; + version: number; + sources: string[]; + sourcesContent: string[]; + names: string[]; + mappings: string; + sourceRoot: string; + } + interface SourceMapping { + generatedLine: number; + generatedColumn: number; + originalSource: string; + originalLine: number; + originalColumn: number; + } + /** + * @since v13.7.0, v12.17.0 + */ + class SourceMap { + /** + * Getter for the payload used to construct the `SourceMap` instance. + */ + readonly payload: SourceMapPayload; + constructor(payload: SourceMapPayload); + /** + * Given a line offset and column offset in the generated source + * file, returns an object representing the SourceMap range in the + * original file if found, or an empty object if not. + * + * The object returned contains the following keys: + * + * The returned value represents the raw range as it appears in the + * SourceMap, based on zero-indexed offsets, _not_ 1-indexed line and + * column numbers as they appear in Error messages and CallSite + * objects. + * + * To get the corresponding 1-indexed line and column numbers from a + * lineNumber and columnNumber as they are reported by Error stacks + * and CallSite objects, use `sourceMap.findOrigin(lineNumber, columnNumber)` + * @param lineOffset The zero-indexed line number offset in the generated source + * @param columnOffset The zero-indexed column number offset in the generated source + */ + findEntry(lineOffset: number, columnOffset: number): SourceMapping; + } + interface ImportAssertions extends NodeJS.Dict { + type?: string | undefined; + } + type ModuleFormat = 'builtin' | 'commonjs' | 'json' | 'module' | 'wasm'; + type ModuleSource = string | ArrayBuffer | NodeJS.TypedArray; + interface GlobalPreloadContext { + port: MessagePort; + } + /** + * @deprecated This hook will be removed in a future version. + * Use `initialize` instead. When a loader has an `initialize` export, `globalPreload` will be ignored. + * + * Sometimes it might be necessary to run some code inside of the same global scope that the application runs in. + * This hook allows the return of a string that is run as a sloppy-mode script on startup. + * + * @param context Information to assist the preload code + * @return Code to run before application startup + */ + type GlobalPreloadHook = (context: GlobalPreloadContext) => string; + /** + * The `initialize` hook provides a way to define a custom function that runs in the loader's thread + * when the loader is initialized. Initialization happens when the loader is registered via `register` + * or registered via the `--experimental-loader` command line option. + * + * This hook can send and receive data from a `register` invocation, including ports and other transferrable objects. + */ + type InitializeHook = (data: Data) => ReturnType; + interface ResolveHookContext { + /** + * Export conditions of the relevant `package.json` + */ + conditions: string[]; + /** + * An object whose key-value pairs represent the assertions for the module to import + */ + importAssertions: ImportAssertions; + /** + * The module importing this one, or undefined if this is the Node.js entry point + */ + parentURL: string | undefined; + } + interface ResolveFnOutput { + /** + * A hint to the load hook (it might be ignored) + */ + format?: ModuleFormat | null | undefined; + /** + * The import assertions to use when caching the module (optional; if excluded the input will be used) + */ + importAssertions?: ImportAssertions | undefined; + /** + * A signal that this hook intends to terminate the chain of `resolve` hooks. + * @default false + */ + shortCircuit?: boolean | undefined; + /** + * The absolute URL to which this input resolves + */ + url: string; + } + /** + * The `resolve` hook chain is responsible for resolving file URL for a given module specifier and parent URL, and optionally its format (such as `'module'`) as a hint to the `load` hook. + * If a format is specified, the load hook is ultimately responsible for providing the final `format` value (and it is free to ignore the hint provided by `resolve`); + * if `resolve` provides a format, a custom `load` hook is required even if only to pass the value to the Node.js default `load` hook. + * + * @param specifier The specified URL path of the module to be resolved + * @param context + * @param nextResolve The subsequent `resolve` hook in the chain, or the Node.js default `resolve` hook after the last user-supplied resolve hook + */ + type ResolveHook = ( + specifier: string, + context: ResolveHookContext, + nextResolve: (specifier: string, context?: ResolveHookContext) => ResolveFnOutput | Promise + ) => ResolveFnOutput | Promise; + interface LoadHookContext { + /** + * Export conditions of the relevant `package.json` + */ + conditions: string[]; + /** + * The format optionally supplied by the `resolve` hook chain + */ + format: ModuleFormat; + /** + * An object whose key-value pairs represent the assertions for the module to import + */ + importAssertions: ImportAssertions; + } + interface LoadFnOutput { + format: ModuleFormat; + /** + * A signal that this hook intends to terminate the chain of `resolve` hooks. + * @default false + */ + shortCircuit?: boolean | undefined; + /** + * The source for Node.js to evaluate + */ + source?: ModuleSource; + } + /** + * The `load` hook provides a way to define a custom method of determining how a URL should be interpreted, retrieved, and parsed. + * It is also in charge of validating the import assertion. + * + * @param url The URL/path of the module to be loaded + * @param context Metadata about the module + * @param nextLoad The subsequent `load` hook in the chain, or the Node.js default `load` hook after the last user-supplied `load` hook + */ + type LoadHook = ( + url: string, + context: LoadHookContext, + nextLoad: (url: string, context?: LoadHookContext) => LoadFnOutput | Promise + ) => LoadFnOutput | Promise; + } + interface RegisterOptions { + parentURL: string; + data?: Data | undefined; + transferList?: any[] | undefined; + } + interface Module extends NodeModule {} + class Module { + static runMain(): void; + static wrap(code: string): string; + static createRequire(path: string | URL): NodeRequire; + static builtinModules: string[]; + static isBuiltin(moduleName: string): boolean; + static Module: typeof Module; + static register(specifier: string, parentURL?: string, options?: RegisterOptions): ReturnType; + static register(specifier: string, options?: RegisterOptions): ReturnType; + constructor(id: string, parent?: Module); + } + global { + interface ImportMeta { + url: string; + /** + * Provides a module-relative resolution function scoped to each module, returning + * the URL string. + * + * @param specified The module specifier to resolve relative to the current module. + * @returns The absolute (`file:`) URL string for the resolved module. + */ + resolve(specified: string): string; + /** + * This feature is only available with the `--experimental-import-meta-resolve` + * command flag enabled. + * + * Provides a module-relative resolution function scoped to each module, returning + * the URL string. + * + * @param specified The module specifier to resolve relative to `parent`. + * @param parent The absolute parent module URL to resolve from. + * @returns The absolute (`file:`) URL string for the resolved module. + */ + resolve(specified: string, parent: string | URL): string; + } + } + export = Module; +} +declare module 'module' { + import module = require('node:module'); + export = module; +} diff --git a/node_modules/@types/node/ts4.8/net.d.ts b/node_modules/@types/node/ts4.8/net.d.ts new file mode 100644 index 0000000..ddecca1 --- /dev/null +++ b/node_modules/@types/node/ts4.8/net.d.ts @@ -0,0 +1,893 @@ +/** + * > Stability: 2 - Stable + * + * The `node:net` module provides an asynchronous network API for creating stream-based + * TCP or `IPC` servers ({@link createServer}) and clients + * ({@link createConnection}). + * + * It can be accessed using: + * + * ```js + * const net = require('node:net'); + * ``` + * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/net.js) + */ +declare module 'node:net' { + import * as stream from 'node:stream'; + import { Abortable, EventEmitter } from 'node:events'; + import * as dns from 'node:dns'; + type LookupFunction = (hostname: string, options: dns.LookupAllOptions, callback: (err: NodeJS.ErrnoException | null, addresses: dns.LookupAddress[]) => void) => void; + interface AddressInfo { + address: string; + family: string; + port: number; + } + interface SocketConstructorOpts { + fd?: number | undefined; + allowHalfOpen?: boolean | undefined; + readable?: boolean | undefined; + writable?: boolean | undefined; + signal?: AbortSignal; + } + interface OnReadOpts { + buffer: Uint8Array | (() => Uint8Array); + /** + * This function is called for every chunk of incoming data. + * Two arguments are passed to it: the number of bytes written to buffer and a reference to buffer. + * Return false from this function to implicitly pause() the socket. + */ + callback(bytesWritten: number, buf: Uint8Array): boolean; + } + interface ConnectOpts { + /** + * If specified, incoming data is stored in a single buffer and passed to the supplied callback when data arrives on the socket. + * Note: this will cause the streaming functionality to not provide any data, however events like 'error', 'end', and 'close' will + * still be emitted as normal and methods like pause() and resume() will also behave as expected. + */ + onread?: OnReadOpts | undefined; + } + interface TcpSocketConnectOpts extends ConnectOpts { + port: number; + host?: string | undefined; + localAddress?: string | undefined; + localPort?: number | undefined; + hints?: number | undefined; + family?: number | undefined; + lookup?: LookupFunction | undefined; + noDelay?: boolean | undefined; + keepAlive?: boolean | undefined; + keepAliveInitialDelay?: number | undefined; + /** + * @since v18.13.0 + */ + autoSelectFamily?: boolean | undefined; + /** + * @since v18.13.0 + */ + autoSelectFamilyAttemptTimeout?: number | undefined; + } + interface IpcSocketConnectOpts extends ConnectOpts { + path: string; + } + type SocketConnectOpts = TcpSocketConnectOpts | IpcSocketConnectOpts; + type SocketReadyState = 'opening' | 'open' | 'readOnly' | 'writeOnly' | 'closed'; + /** + * This class is an abstraction of a TCP socket or a streaming `IPC` endpoint + * (uses named pipes on Windows, and Unix domain sockets otherwise). It is also + * an `EventEmitter`. + * + * A `net.Socket` can be created by the user and used directly to interact with + * a server. For example, it is returned by {@link createConnection}, + * so the user can use it to talk to the server. + * + * It can also be created by Node.js and passed to the user when a connection + * is received. For example, it is passed to the listeners of a `'connection'` event emitted on a {@link Server}, so the user can use + * it to interact with the client. + * @since v0.3.4 + */ + class Socket extends stream.Duplex { + constructor(options?: SocketConstructorOpts); + /** + * Sends data on the socket. The second parameter specifies the encoding in the + * case of a string. It defaults to UTF8 encoding. + * + * Returns `true` if the entire data was flushed successfully to the kernel + * buffer. Returns `false` if all or part of the data was queued in user memory.`'drain'` will be emitted when the buffer is again free. + * + * The optional `callback` parameter will be executed when the data is finally + * written out, which may not be immediately. + * + * See `Writable` stream `write()` method for more + * information. + * @since v0.1.90 + * @param [encoding='utf8'] Only used when data is `string`. + */ + write(buffer: Uint8Array | string, cb?: (err?: Error) => void): boolean; + write(str: Uint8Array | string, encoding?: BufferEncoding, cb?: (err?: Error) => void): boolean; + /** + * Initiate a connection on a given socket. + * + * Possible signatures: + * + * * `socket.connect(options[, connectListener])` + * * `socket.connect(path[, connectListener])` for `IPC` connections. + * * `socket.connect(port[, host][, connectListener])` for TCP connections. + * * Returns: `net.Socket` The socket itself. + * + * This function is asynchronous. When the connection is established, the `'connect'` event will be emitted. If there is a problem connecting, + * instead of a `'connect'` event, an `'error'` event will be emitted with + * the error passed to the `'error'` listener. + * The last parameter `connectListener`, if supplied, will be added as a listener + * for the `'connect'` event **once**. + * + * This function should only be used for reconnecting a socket after`'close'` has been emitted or otherwise it may lead to undefined + * behavior. + */ + connect(options: SocketConnectOpts, connectionListener?: () => void): this; + connect(port: number, host: string, connectionListener?: () => void): this; + connect(port: number, connectionListener?: () => void): this; + connect(path: string, connectionListener?: () => void): this; + /** + * Set the encoding for the socket as a `Readable Stream`. See `readable.setEncoding()` for more information. + * @since v0.1.90 + * @return The socket itself. + */ + setEncoding(encoding?: BufferEncoding): this; + /** + * Pauses the reading of data. That is, `'data'` events will not be emitted. + * Useful to throttle back an upload. + * @return The socket itself. + */ + pause(): this; + /** + * Close the TCP connection by sending an RST packet and destroy the stream. + * If this TCP socket is in connecting status, it will send an RST packet and destroy this TCP socket once it is connected. + * Otherwise, it will call `socket.destroy` with an `ERR_SOCKET_CLOSED` Error. + * If this is not a TCP socket (for example, a pipe), calling this method will immediately throw an `ERR_INVALID_HANDLE_TYPE` Error. + * @since v18.3.0, v16.17.0 + */ + resetAndDestroy(): this; + /** + * Resumes reading after a call to `socket.pause()`. + * @return The socket itself. + */ + resume(): this; + /** + * Sets the socket to timeout after `timeout` milliseconds of inactivity on + * the socket. By default `net.Socket` do not have a timeout. + * + * When an idle timeout is triggered the socket will receive a `'timeout'` event but the connection will not be severed. The user must manually call `socket.end()` or `socket.destroy()` to + * end the connection. + * + * ```js + * socket.setTimeout(3000); + * socket.on('timeout', () => { + * console.log('socket timeout'); + * socket.end(); + * }); + * ``` + * + * If `timeout` is 0, then the existing idle timeout is disabled. + * + * The optional `callback` parameter will be added as a one-time listener for the `'timeout'` event. + * @since v0.1.90 + * @return The socket itself. + */ + setTimeout(timeout: number, callback?: () => void): this; + /** + * Enable/disable the use of Nagle's algorithm. + * + * When a TCP connection is created, it will have Nagle's algorithm enabled. + * + * Nagle's algorithm delays data before it is sent via the network. It attempts + * to optimize throughput at the expense of latency. + * + * Passing `true` for `noDelay` or not passing an argument will disable Nagle's + * algorithm for the socket. Passing `false` for `noDelay` will enable Nagle's + * algorithm. + * @since v0.1.90 + * @param [noDelay=true] + * @return The socket itself. + */ + setNoDelay(noDelay?: boolean): this; + /** + * Enable/disable keep-alive functionality, and optionally set the initial + * delay before the first keepalive probe is sent on an idle socket. + * + * Set `initialDelay` (in milliseconds) to set the delay between the last + * data packet received and the first keepalive probe. Setting `0` for`initialDelay` will leave the value unchanged from the default + * (or previous) setting. + * + * Enabling the keep-alive functionality will set the following socket options: + * + * * `SO_KEEPALIVE=1` + * * `TCP_KEEPIDLE=initialDelay` + * * `TCP_KEEPCNT=10` + * * `TCP_KEEPINTVL=1` + * @since v0.1.92 + * @param [enable=false] + * @param [initialDelay=0] + * @return The socket itself. + */ + setKeepAlive(enable?: boolean, initialDelay?: number): this; + /** + * Returns the bound `address`, the address `family` name and `port` of the + * socket as reported by the operating system:`{ port: 12346, family: 'IPv4', address: '127.0.0.1' }` + * @since v0.1.90 + */ + address(): AddressInfo | {}; + /** + * Calling `unref()` on a socket will allow the program to exit if this is the only + * active socket in the event system. If the socket is already `unref`ed calling`unref()` again will have no effect. + * @since v0.9.1 + * @return The socket itself. + */ + unref(): this; + /** + * Opposite of `unref()`, calling `ref()` on a previously `unref`ed socket will _not_ let the program exit if it's the only socket left (the default behavior). + * If the socket is `ref`ed calling `ref` again will have no effect. + * @since v0.9.1 + * @return The socket itself. + */ + ref(): this; + /** + * This property shows the number of characters buffered for writing. The buffer + * may contain strings whose length after encoding is not yet known. So this number + * is only an approximation of the number of bytes in the buffer. + * + * `net.Socket` has the property that `socket.write()` always works. This is to + * help users get up and running quickly. The computer cannot always keep up + * with the amount of data that is written to a socket. The network connection + * simply might be too slow. Node.js will internally queue up the data written to a + * socket and send it out over the wire when it is possible. + * + * The consequence of this internal buffering is that memory may grow. + * Users who experience large or growing `bufferSize` should attempt to + * "throttle" the data flows in their program with `socket.pause()` and `socket.resume()`. + * @since v0.3.8 + * @deprecated Since v14.6.0 - Use `writableLength` instead. + */ + readonly bufferSize: number; + /** + * The amount of received bytes. + * @since v0.5.3 + */ + readonly bytesRead: number; + /** + * The amount of bytes sent. + * @since v0.5.3 + */ + readonly bytesWritten: number; + /** + * If `true`,`socket.connect(options[, connectListener])` was + * called and has not yet finished. It will stay `true` until the socket becomes + * connected, then it is set to `false` and the `'connect'` event is emitted. Note + * that the `socket.connect(options[, connectListener])` callback is a listener for the `'connect'` event. + * @since v6.1.0 + */ + readonly connecting: boolean; + /** + * This is `true` if the socket is not connected yet, either because `.connect()`has not yet been called or because it is still in the process of connecting + * (see `socket.connecting`). + * @since v11.2.0, v10.16.0 + */ + readonly pending: boolean; + /** + * See `writable.destroyed` for further details. + */ + readonly destroyed: boolean; + /** + * The string representation of the local IP address the remote client is + * connecting on. For example, in a server listening on `'0.0.0.0'`, if a client + * connects on `'192.168.1.1'`, the value of `socket.localAddress` would be`'192.168.1.1'`. + * @since v0.9.6 + */ + readonly localAddress?: string; + /** + * The numeric representation of the local port. For example, `80` or `21`. + * @since v0.9.6 + */ + readonly localPort?: number; + /** + * The string representation of the local IP family. `'IPv4'` or `'IPv6'`. + * @since v18.8.0, v16.18.0 + */ + readonly localFamily?: string; + /** + * This property represents the state of the connection as a string. + * + * * If the stream is connecting `socket.readyState` is `opening`. + * * If the stream is readable and writable, it is `open`. + * * If the stream is readable and not writable, it is `readOnly`. + * * If the stream is not readable and writable, it is `writeOnly`. + * @since v0.5.0 + */ + readonly readyState: SocketReadyState; + /** + * The string representation of the remote IP address. For example,`'74.125.127.100'` or `'2001:4860:a005::68'`. Value may be `undefined` if + * the socket is destroyed (for example, if the client disconnected). + * @since v0.5.10 + */ + readonly remoteAddress?: string | undefined; + /** + * The string representation of the remote IP family. `'IPv4'` or `'IPv6'`. Value may be `undefined` if + * the socket is destroyed (for example, if the client disconnected). + * @since v0.11.14 + */ + readonly remoteFamily?: string | undefined; + /** + * The numeric representation of the remote port. For example, `80` or `21`. Value may be `undefined` if + * the socket is destroyed (for example, if the client disconnected). + * @since v0.5.10 + */ + readonly remotePort?: number | undefined; + /** + * The socket timeout in milliseconds as set by `socket.setTimeout()`. + * It is `undefined` if a timeout has not been set. + * @since v10.7.0 + */ + readonly timeout?: number | undefined; + /** + * Half-closes the socket. i.e., it sends a FIN packet. It is possible the + * server will still send some data. + * + * See `writable.end()` for further details. + * @since v0.1.90 + * @param [encoding='utf8'] Only used when data is `string`. + * @param callback Optional callback for when the socket is finished. + * @return The socket itself. + */ + end(callback?: () => void): this; + end(buffer: Uint8Array | string, callback?: () => void): this; + end(str: Uint8Array | string, encoding?: BufferEncoding, callback?: () => void): this; + /** + * events.EventEmitter + * 1. close + * 2. connect + * 3. data + * 4. drain + * 5. end + * 6. error + * 7. lookup + * 8. ready + * 9. timeout + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: 'close', listener: (hadError: boolean) => void): this; + addListener(event: 'connect', listener: () => void): this; + addListener(event: 'data', listener: (data: Buffer) => void): this; + addListener(event: 'drain', listener: () => void): this; + addListener(event: 'end', listener: () => void): this; + addListener(event: 'error', listener: (err: Error) => void): this; + addListener(event: 'lookup', listener: (err: Error, address: string, family: string | number, host: string) => void): this; + addListener(event: 'ready', listener: () => void): this; + addListener(event: 'timeout', listener: () => void): this; + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: 'close', hadError: boolean): boolean; + emit(event: 'connect'): boolean; + emit(event: 'data', data: Buffer): boolean; + emit(event: 'drain'): boolean; + emit(event: 'end'): boolean; + emit(event: 'error', err: Error): boolean; + emit(event: 'lookup', err: Error, address: string, family: string | number, host: string): boolean; + emit(event: 'ready'): boolean; + emit(event: 'timeout'): boolean; + on(event: string, listener: (...args: any[]) => void): this; + on(event: 'close', listener: (hadError: boolean) => void): this; + on(event: 'connect', listener: () => void): this; + on(event: 'data', listener: (data: Buffer) => void): this; + on(event: 'drain', listener: () => void): this; + on(event: 'end', listener: () => void): this; + on(event: 'error', listener: (err: Error) => void): this; + on(event: 'lookup', listener: (err: Error, address: string, family: string | number, host: string) => void): this; + on(event: 'ready', listener: () => void): this; + on(event: 'timeout', listener: () => void): this; + once(event: string, listener: (...args: any[]) => void): this; + once(event: 'close', listener: (hadError: boolean) => void): this; + once(event: 'connect', listener: () => void): this; + once(event: 'data', listener: (data: Buffer) => void): this; + once(event: 'drain', listener: () => void): this; + once(event: 'end', listener: () => void): this; + once(event: 'error', listener: (err: Error) => void): this; + once(event: 'lookup', listener: (err: Error, address: string, family: string | number, host: string) => void): this; + once(event: 'ready', listener: () => void): this; + once(event: 'timeout', listener: () => void): this; + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: 'close', listener: (hadError: boolean) => void): this; + prependListener(event: 'connect', listener: () => void): this; + prependListener(event: 'data', listener: (data: Buffer) => void): this; + prependListener(event: 'drain', listener: () => void): this; + prependListener(event: 'end', listener: () => void): this; + prependListener(event: 'error', listener: (err: Error) => void): this; + prependListener(event: 'lookup', listener: (err: Error, address: string, family: string | number, host: string) => void): this; + prependListener(event: 'ready', listener: () => void): this; + prependListener(event: 'timeout', listener: () => void): this; + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'close', listener: (hadError: boolean) => void): this; + prependOnceListener(event: 'connect', listener: () => void): this; + prependOnceListener(event: 'data', listener: (data: Buffer) => void): this; + prependOnceListener(event: 'drain', listener: () => void): this; + prependOnceListener(event: 'end', listener: () => void): this; + prependOnceListener(event: 'error', listener: (err: Error) => void): this; + prependOnceListener(event: 'lookup', listener: (err: Error, address: string, family: string | number, host: string) => void): this; + prependOnceListener(event: 'ready', listener: () => void): this; + prependOnceListener(event: 'timeout', listener: () => void): this; + } + interface ListenOptions extends Abortable { + port?: number | undefined; + host?: string | undefined; + backlog?: number | undefined; + path?: string | undefined; + exclusive?: boolean | undefined; + readableAll?: boolean | undefined; + writableAll?: boolean | undefined; + /** + * @default false + */ + ipv6Only?: boolean | undefined; + } + interface ServerOpts { + /** + * Indicates whether half-opened TCP connections are allowed. + * @default false + */ + allowHalfOpen?: boolean | undefined; + /** + * Indicates whether the socket should be paused on incoming connections. + * @default false + */ + pauseOnConnect?: boolean | undefined; + /** + * If set to `true`, it disables the use of Nagle's algorithm immediately after a new incoming connection is received. + * @default false + * @since v16.5.0 + */ + noDelay?: boolean | undefined; + /** + * If set to `true`, it enables keep-alive functionality on the socket immediately after a new incoming connection is received, + * similarly on what is done in `socket.setKeepAlive([enable][, initialDelay])`. + * @default false + * @since v16.5.0 + */ + keepAlive?: boolean | undefined; + /** + * If set to a positive number, it sets the initial delay before the first keepalive probe is sent on an idle socket. + * @default 0 + * @since v16.5.0 + */ + keepAliveInitialDelay?: number | undefined; + } + interface DropArgument { + localAddress?: string; + localPort?: number; + localFamily?: string; + remoteAddress?: string; + remotePort?: number; + remoteFamily?: string; + } + /** + * This class is used to create a TCP or `IPC` server. + * @since v0.1.90 + */ + class Server extends EventEmitter { + constructor(connectionListener?: (socket: Socket) => void); + constructor(options?: ServerOpts, connectionListener?: (socket: Socket) => void); + /** + * Start a server listening for connections. A `net.Server` can be a TCP or + * an `IPC` server depending on what it listens to. + * + * Possible signatures: + * + * * `server.listen(handle[, backlog][, callback])` + * * `server.listen(options[, callback])` + * * `server.listen(path[, backlog][, callback])` for `IPC` servers + * * `server.listen([port[, host[, backlog]]][, callback])` for TCP servers + * + * This function is asynchronous. When the server starts listening, the `'listening'` event will be emitted. The last parameter `callback`will be added as a listener for the `'listening'` + * event. + * + * All `listen()` methods can take a `backlog` parameter to specify the maximum + * length of the queue of pending connections. The actual length will be determined + * by the OS through sysctl settings such as `tcp_max_syn_backlog` and `somaxconn`on Linux. The default value of this parameter is 511 (not 512). + * + * All {@link Socket} are set to `SO_REUSEADDR` (see [`socket(7)`](https://man7.org/linux/man-pages/man7/socket.7.html) for + * details). + * + * The `server.listen()` method can be called again if and only if there was an + * error during the first `server.listen()` call or `server.close()` has been + * called. Otherwise, an `ERR_SERVER_ALREADY_LISTEN` error will be thrown. + * + * One of the most common errors raised when listening is `EADDRINUSE`. + * This happens when another server is already listening on the requested`port`/`path`/`handle`. One way to handle this would be to retry + * after a certain amount of time: + * + * ```js + * server.on('error', (e) => { + * if (e.code === 'EADDRINUSE') { + * console.error('Address in use, retrying...'); + * setTimeout(() => { + * server.close(); + * server.listen(PORT, HOST); + * }, 1000); + * } + * }); + * ``` + */ + listen(port?: number, hostname?: string, backlog?: number, listeningListener?: () => void): this; + listen(port?: number, hostname?: string, listeningListener?: () => void): this; + listen(port?: number, backlog?: number, listeningListener?: () => void): this; + listen(port?: number, listeningListener?: () => void): this; + listen(path: string, backlog?: number, listeningListener?: () => void): this; + listen(path: string, listeningListener?: () => void): this; + listen(options: ListenOptions, listeningListener?: () => void): this; + listen(handle: any, backlog?: number, listeningListener?: () => void): this; + listen(handle: any, listeningListener?: () => void): this; + /** + * Stops the server from accepting new connections and keeps existing + * connections. This function is asynchronous, the server is finally closed + * when all connections are ended and the server emits a `'close'` event. + * The optional `callback` will be called once the `'close'` event occurs. Unlike + * that event, it will be called with an `Error` as its only argument if the server + * was not open when it was closed. + * @since v0.1.90 + * @param callback Called when the server is closed. + */ + close(callback?: (err?: Error) => void): this; + /** + * Returns the bound `address`, the address `family` name, and `port` of the server + * as reported by the operating system if listening on an IP socket + * (useful to find which port was assigned when getting an OS-assigned address):`{ port: 12346, family: 'IPv4', address: '127.0.0.1' }`. + * + * For a server listening on a pipe or Unix domain socket, the name is returned + * as a string. + * + * ```js + * const server = net.createServer((socket) => { + * socket.end('goodbye\n'); + * }).on('error', (err) => { + * // Handle errors here. + * throw err; + * }); + * + * // Grab an arbitrary unused port. + * server.listen(() => { + * console.log('opened server on', server.address()); + * }); + * ``` + * + * `server.address()` returns `null` before the `'listening'` event has been + * emitted or after calling `server.close()`. + * @since v0.1.90 + */ + address(): AddressInfo | string | null; + /** + * Asynchronously get the number of concurrent connections on the server. Works + * when sockets were sent to forks. + * + * Callback should take two arguments `err` and `count`. + * @since v0.9.7 + */ + getConnections(cb: (error: Error | null, count: number) => void): void; + /** + * Opposite of `unref()`, calling `ref()` on a previously `unref`ed server will _not_ let the program exit if it's the only server left (the default behavior). + * If the server is `ref`ed calling `ref()` again will have no effect. + * @since v0.9.1 + */ + ref(): this; + /** + * Calling `unref()` on a server will allow the program to exit if this is the only + * active server in the event system. If the server is already `unref`ed calling`unref()` again will have no effect. + * @since v0.9.1 + */ + unref(): this; + /** + * Set this property to reject connections when the server's connection count gets + * high. + * + * It is not recommended to use this option once a socket has been sent to a child + * with `child_process.fork()`. + * @since v0.2.0 + */ + maxConnections: number; + connections: number; + /** + * Indicates whether or not the server is listening for connections. + * @since v5.7.0 + */ + listening: boolean; + /** + * events.EventEmitter + * 1. close + * 2. connection + * 3. error + * 4. listening + * 5. drop + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: 'close', listener: () => void): this; + addListener(event: 'connection', listener: (socket: Socket) => void): this; + addListener(event: 'error', listener: (err: Error) => void): this; + addListener(event: 'listening', listener: () => void): this; + addListener(event: 'drop', listener: (data?: DropArgument) => void): this; + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: 'close'): boolean; + emit(event: 'connection', socket: Socket): boolean; + emit(event: 'error', err: Error): boolean; + emit(event: 'listening'): boolean; + emit(event: 'drop', data?: DropArgument): boolean; + on(event: string, listener: (...args: any[]) => void): this; + on(event: 'close', listener: () => void): this; + on(event: 'connection', listener: (socket: Socket) => void): this; + on(event: 'error', listener: (err: Error) => void): this; + on(event: 'listening', listener: () => void): this; + on(event: 'drop', listener: (data?: DropArgument) => void): this; + once(event: string, listener: (...args: any[]) => void): this; + once(event: 'close', listener: () => void): this; + once(event: 'connection', listener: (socket: Socket) => void): this; + once(event: 'error', listener: (err: Error) => void): this; + once(event: 'listening', listener: () => void): this; + once(event: 'drop', listener: (data?: DropArgument) => void): this; + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: 'close', listener: () => void): this; + prependListener(event: 'connection', listener: (socket: Socket) => void): this; + prependListener(event: 'error', listener: (err: Error) => void): this; + prependListener(event: 'listening', listener: () => void): this; + prependListener(event: 'drop', listener: (data?: DropArgument) => void): this; + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'close', listener: () => void): this; + prependOnceListener(event: 'connection', listener: (socket: Socket) => void): this; + prependOnceListener(event: 'error', listener: (err: Error) => void): this; + prependOnceListener(event: 'listening', listener: () => void): this; + prependOnceListener(event: 'drop', listener: (data?: DropArgument) => void): this; + /** + * Calls {@link Server.close()} and returns a promise that fulfills when the server has closed. + * @since v20.5.0 + */ + [Symbol.asyncDispose](): Promise; + } + type IPVersion = 'ipv4' | 'ipv6'; + /** + * The `BlockList` object can be used with some network APIs to specify rules for + * disabling inbound or outbound access to specific IP addresses, IP ranges, or + * IP subnets. + * @since v15.0.0, v14.18.0 + */ + class BlockList { + /** + * Adds a rule to block the given IP address. + * @since v15.0.0, v14.18.0 + * @param address An IPv4 or IPv6 address. + * @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`. + */ + addAddress(address: string, type?: IPVersion): void; + addAddress(address: SocketAddress): void; + /** + * Adds a rule to block a range of IP addresses from `start` (inclusive) to`end` (inclusive). + * @since v15.0.0, v14.18.0 + * @param start The starting IPv4 or IPv6 address in the range. + * @param end The ending IPv4 or IPv6 address in the range. + * @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`. + */ + addRange(start: string, end: string, type?: IPVersion): void; + addRange(start: SocketAddress, end: SocketAddress): void; + /** + * Adds a rule to block a range of IP addresses specified as a subnet mask. + * @since v15.0.0, v14.18.0 + * @param net The network IPv4 or IPv6 address. + * @param prefix The number of CIDR prefix bits. For IPv4, this must be a value between `0` and `32`. For IPv6, this must be between `0` and `128`. + * @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`. + */ + addSubnet(net: SocketAddress, prefix: number): void; + addSubnet(net: string, prefix: number, type?: IPVersion): void; + /** + * Returns `true` if the given IP address matches any of the rules added to the`BlockList`. + * + * ```js + * const blockList = new net.BlockList(); + * blockList.addAddress('123.123.123.123'); + * blockList.addRange('10.0.0.1', '10.0.0.10'); + * blockList.addSubnet('8592:757c:efae:4e45::', 64, 'ipv6'); + * + * console.log(blockList.check('123.123.123.123')); // Prints: true + * console.log(blockList.check('10.0.0.3')); // Prints: true + * console.log(blockList.check('222.111.111.222')); // Prints: false + * + * // IPv6 notation for IPv4 addresses works: + * console.log(blockList.check('::ffff:7b7b:7b7b', 'ipv6')); // Prints: true + * console.log(blockList.check('::ffff:123.123.123.123', 'ipv6')); // Prints: true + * ``` + * @since v15.0.0, v14.18.0 + * @param address The IP address to check + * @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`. + */ + check(address: SocketAddress): boolean; + check(address: string, type?: IPVersion): boolean; + } + interface TcpNetConnectOpts extends TcpSocketConnectOpts, SocketConstructorOpts { + timeout?: number | undefined; + } + interface IpcNetConnectOpts extends IpcSocketConnectOpts, SocketConstructorOpts { + timeout?: number | undefined; + } + type NetConnectOpts = TcpNetConnectOpts | IpcNetConnectOpts; + /** + * Creates a new TCP or `IPC` server. + * + * If `allowHalfOpen` is set to `true`, when the other end of the socket + * signals the end of transmission, the server will only send back the end of + * transmission when `socket.end()` is explicitly called. For example, in the + * context of TCP, when a FIN packed is received, a FIN packed is sent + * back only when `socket.end()` is explicitly called. Until then the + * connection is half-closed (non-readable but still writable). See `'end'` event and [RFC 1122](https://tools.ietf.org/html/rfc1122) (section 4.2.2.13) for more information. + * + * If `pauseOnConnect` is set to `true`, then the socket associated with each + * incoming connection will be paused, and no data will be read from its handle. + * This allows connections to be passed between processes without any data being + * read by the original process. To begin reading data from a paused socket, call `socket.resume()`. + * + * The server can be a TCP server or an `IPC` server, depending on what it `listen()` to. + * + * Here is an example of a TCP echo server which listens for connections + * on port 8124: + * + * ```js + * const net = require('node:net'); + * const server = net.createServer((c) => { + * // 'connection' listener. + * console.log('client connected'); + * c.on('end', () => { + * console.log('client disconnected'); + * }); + * c.write('hello\r\n'); + * c.pipe(c); + * }); + * server.on('error', (err) => { + * throw err; + * }); + * server.listen(8124, () => { + * console.log('server bound'); + * }); + * ``` + * + * Test this by using `telnet`: + * + * ```bash + * telnet localhost 8124 + * ``` + * + * To listen on the socket `/tmp/echo.sock`: + * + * ```js + * server.listen('/tmp/echo.sock', () => { + * console.log('server bound'); + * }); + * ``` + * + * Use `nc` to connect to a Unix domain socket server: + * + * ```bash + * nc -U /tmp/echo.sock + * ``` + * @since v0.5.0 + * @param connectionListener Automatically set as a listener for the {@link 'connection'} event. + */ + function createServer(connectionListener?: (socket: Socket) => void): Server; + function createServer(options?: ServerOpts, connectionListener?: (socket: Socket) => void): Server; + /** + * Aliases to {@link createConnection}. + * + * Possible signatures: + * + * * {@link connect} + * * {@link connect} for `IPC` connections. + * * {@link connect} for TCP connections. + */ + function connect(options: NetConnectOpts, connectionListener?: () => void): Socket; + function connect(port: number, host?: string, connectionListener?: () => void): Socket; + function connect(path: string, connectionListener?: () => void): Socket; + /** + * A factory function, which creates a new {@link Socket}, + * immediately initiates connection with `socket.connect()`, + * then returns the `net.Socket` that starts the connection. + * + * When the connection is established, a `'connect'` event will be emitted + * on the returned socket. The last parameter `connectListener`, if supplied, + * will be added as a listener for the `'connect'` event **once**. + * + * Possible signatures: + * + * * {@link createConnection} + * * {@link createConnection} for `IPC` connections. + * * {@link createConnection} for TCP connections. + * + * The {@link connect} function is an alias to this function. + */ + function createConnection(options: NetConnectOpts, connectionListener?: () => void): Socket; + function createConnection(port: number, host?: string, connectionListener?: () => void): Socket; + function createConnection(path: string, connectionListener?: () => void): Socket; + /** + * Returns `6` if `input` is an IPv6 address. Returns `4` if `input` is an IPv4 + * address in [dot-decimal notation](https://en.wikipedia.org/wiki/Dot-decimal_notation) with no leading zeroes. Otherwise, returns`0`. + * + * ```js + * net.isIP('::1'); // returns 6 + * net.isIP('127.0.0.1'); // returns 4 + * net.isIP('127.000.000.001'); // returns 0 + * net.isIP('127.0.0.1/24'); // returns 0 + * net.isIP('fhqwhgads'); // returns 0 + * ``` + * @since v0.3.0 + */ + function isIP(input: string): number; + /** + * Returns `true` if `input` is an IPv4 address in [dot-decimal notation](https://en.wikipedia.org/wiki/Dot-decimal_notation) with no + * leading zeroes. Otherwise, returns `false`. + * + * ```js + * net.isIPv4('127.0.0.1'); // returns true + * net.isIPv4('127.000.000.001'); // returns false + * net.isIPv4('127.0.0.1/24'); // returns false + * net.isIPv4('fhqwhgads'); // returns false + * ``` + * @since v0.3.0 + */ + function isIPv4(input: string): boolean; + /** + * Returns `true` if `input` is an IPv6 address. Otherwise, returns `false`. + * + * ```js + * net.isIPv6('::1'); // returns true + * net.isIPv6('fhqwhgads'); // returns false + * ``` + * @since v0.3.0 + */ + function isIPv6(input: string): boolean; + interface SocketAddressInitOptions { + /** + * The network address as either an IPv4 or IPv6 string. + * @default 127.0.0.1 + */ + address?: string | undefined; + /** + * @default `'ipv4'` + */ + family?: IPVersion | undefined; + /** + * An IPv6 flow-label used only if `family` is `'ipv6'`. + * @default 0 + */ + flowlabel?: number | undefined; + /** + * An IP port. + * @default 0 + */ + port?: number | undefined; + } + /** + * @since v15.14.0, v14.18.0 + */ + class SocketAddress { + constructor(options: SocketAddressInitOptions); + /** + * Either \`'ipv4'\` or \`'ipv6'\`. + * @since v15.14.0, v14.18.0 + */ + readonly address: string; + /** + * Either \`'ipv4'\` or \`'ipv6'\`. + * @since v15.14.0, v14.18.0 + */ + readonly family: IPVersion; + /** + * @since v15.14.0, v14.18.0 + */ + readonly port: number; + /** + * @since v15.14.0, v14.18.0 + */ + readonly flowlabel: number; + } +} +declare module 'net' { + export * from 'node:net'; +} diff --git a/node_modules/@types/node/ts4.8/os.d.ts b/node_modules/@types/node/ts4.8/os.d.ts new file mode 100644 index 0000000..f7cb6d9 --- /dev/null +++ b/node_modules/@types/node/ts4.8/os.d.ts @@ -0,0 +1,477 @@ +/** + * The `node:os` module provides operating system-related utility methods and + * properties. It can be accessed using: + * + * ```js + * const os = require('node:os'); + * ``` + * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/os.js) + */ +declare module 'node:os' { + interface CpuInfo { + model: string; + speed: number; + times: { + user: number; + nice: number; + sys: number; + idle: number; + irq: number; + }; + } + interface NetworkInterfaceBase { + address: string; + netmask: string; + mac: string; + internal: boolean; + cidr: string | null; + } + interface NetworkInterfaceInfoIPv4 extends NetworkInterfaceBase { + family: 'IPv4'; + scopeid?: undefined; + } + interface NetworkInterfaceInfoIPv6 extends NetworkInterfaceBase { + family: 'IPv6'; + scopeid: number; + } + interface UserInfo { + username: T; + uid: number; + gid: number; + shell: T; + homedir: T; + } + type NetworkInterfaceInfo = NetworkInterfaceInfoIPv4 | NetworkInterfaceInfoIPv6; + /** + * Returns the host name of the operating system as a string. + * @since v0.3.3 + */ + function hostname(): string; + /** + * Returns an array containing the 1, 5, and 15 minute load averages. + * + * The load average is a measure of system activity calculated by the operating + * system and expressed as a fractional number. + * + * The load average is a Unix-specific concept. On Windows, the return value is + * always `[0, 0, 0]`. + * @since v0.3.3 + */ + function loadavg(): number[]; + /** + * Returns the system uptime in number of seconds. + * @since v0.3.3 + */ + function uptime(): number; + /** + * Returns the amount of free system memory in bytes as an integer. + * @since v0.3.3 + */ + function freemem(): number; + /** + * Returns the total amount of system memory in bytes as an integer. + * @since v0.3.3 + */ + function totalmem(): number; + /** + * Returns an array of objects containing information about each logical CPU core. + * The array will be empty if no CPU information is available, such as if the`/proc` file system is unavailable. + * + * The properties included on each object include: + * + * ```js + * [ + * { + * model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', + * speed: 2926, + * times: { + * user: 252020, + * nice: 0, + * sys: 30340, + * idle: 1070356870, + * irq: 0, + * }, + * }, + * { + * model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', + * speed: 2926, + * times: { + * user: 306960, + * nice: 0, + * sys: 26980, + * idle: 1071569080, + * irq: 0, + * }, + * }, + * { + * model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', + * speed: 2926, + * times: { + * user: 248450, + * nice: 0, + * sys: 21750, + * idle: 1070919370, + * irq: 0, + * }, + * }, + * { + * model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', + * speed: 2926, + * times: { + * user: 256880, + * nice: 0, + * sys: 19430, + * idle: 1070905480, + * irq: 20, + * }, + * }, + * ] + * ``` + * + * `nice` values are POSIX-only. On Windows, the `nice` values of all processors + * are always 0. + * + * `os.cpus().length` should not be used to calculate the amount of parallelism + * available to an application. Use {@link availableParallelism} for this purpose. + * @since v0.3.3 + */ + function cpus(): CpuInfo[]; + /** + * Returns an estimate of the default amount of parallelism a program should use. + * Always returns a value greater than zero. + * + * This function is a small wrapper about libuv's [`uv_available_parallelism()`](https://docs.libuv.org/en/v1.x/misc.html#c.uv_available_parallelism). + * @since v19.4.0, v18.14.0 + */ + function availableParallelism(): number; + /** + * Returns the operating system name as returned by [`uname(3)`](https://linux.die.net/man/3/uname). For example, it + * returns `'Linux'` on Linux, `'Darwin'` on macOS, and `'Windows_NT'` on Windows. + * + * See [https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for additional information + * about the output of running [`uname(3)`](https://linux.die.net/man/3/uname) on various operating systems. + * @since v0.3.3 + */ + function type(): string; + /** + * Returns the operating system as a string. + * + * On POSIX systems, the operating system release is determined by calling [`uname(3)`](https://linux.die.net/man/3/uname). On Windows, `GetVersionExW()` is used. See + * [https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for more information. + * @since v0.3.3 + */ + function release(): string; + /** + * Returns an object containing network interfaces that have been assigned a + * network address. + * + * Each key on the returned object identifies a network interface. The associated + * value is an array of objects that each describe an assigned network address. + * + * The properties available on the assigned network address object include: + * + * ```js + * { + * lo: [ + * { + * address: '127.0.0.1', + * netmask: '255.0.0.0', + * family: 'IPv4', + * mac: '00:00:00:00:00:00', + * internal: true, + * cidr: '127.0.0.1/8' + * }, + * { + * address: '::1', + * netmask: 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff', + * family: 'IPv6', + * mac: '00:00:00:00:00:00', + * scopeid: 0, + * internal: true, + * cidr: '::1/128' + * } + * ], + * eth0: [ + * { + * address: '192.168.1.108', + * netmask: '255.255.255.0', + * family: 'IPv4', + * mac: '01:02:03:0a:0b:0c', + * internal: false, + * cidr: '192.168.1.108/24' + * }, + * { + * address: 'fe80::a00:27ff:fe4e:66a1', + * netmask: 'ffff:ffff:ffff:ffff::', + * family: 'IPv6', + * mac: '01:02:03:0a:0b:0c', + * scopeid: 1, + * internal: false, + * cidr: 'fe80::a00:27ff:fe4e:66a1/64' + * } + * ] + * } + * ``` + * @since v0.6.0 + */ + function networkInterfaces(): NodeJS.Dict; + /** + * Returns the string path of the current user's home directory. + * + * On POSIX, it uses the `$HOME` environment variable if defined. Otherwise it + * uses the [effective UID](https://en.wikipedia.org/wiki/User_identifier#Effective_user_ID) to look up the user's home directory. + * + * On Windows, it uses the `USERPROFILE` environment variable if defined. + * Otherwise it uses the path to the profile directory of the current user. + * @since v2.3.0 + */ + function homedir(): string; + /** + * Returns information about the currently effective user. On POSIX platforms, + * this is typically a subset of the password file. The returned object includes + * the `username`, `uid`, `gid`, `shell`, and `homedir`. On Windows, the `uid` and`gid` fields are `-1`, and `shell` is `null`. + * + * The value of `homedir` returned by `os.userInfo()` is provided by the operating + * system. This differs from the result of `os.homedir()`, which queries + * environment variables for the home directory before falling back to the + * operating system response. + * + * Throws a `SystemError` if a user has no `username` or `homedir`. + * @since v6.0.0 + */ + function userInfo(options: { encoding: 'buffer' }): UserInfo; + function userInfo(options?: { encoding: BufferEncoding }): UserInfo; + type SignalConstants = { + [key in NodeJS.Signals]: number; + }; + namespace constants { + const UV_UDP_REUSEADDR: number; + namespace signals {} + const signals: SignalConstants; + namespace errno { + const E2BIG: number; + const EACCES: number; + const EADDRINUSE: number; + const EADDRNOTAVAIL: number; + const EAFNOSUPPORT: number; + const EAGAIN: number; + const EALREADY: number; + const EBADF: number; + const EBADMSG: number; + const EBUSY: number; + const ECANCELED: number; + const ECHILD: number; + const ECONNABORTED: number; + const ECONNREFUSED: number; + const ECONNRESET: number; + const EDEADLK: number; + const EDESTADDRREQ: number; + const EDOM: number; + const EDQUOT: number; + const EEXIST: number; + const EFAULT: number; + const EFBIG: number; + const EHOSTUNREACH: number; + const EIDRM: number; + const EILSEQ: number; + const EINPROGRESS: number; + const EINTR: number; + const EINVAL: number; + const EIO: number; + const EISCONN: number; + const EISDIR: number; + const ELOOP: number; + const EMFILE: number; + const EMLINK: number; + const EMSGSIZE: number; + const EMULTIHOP: number; + const ENAMETOOLONG: number; + const ENETDOWN: number; + const ENETRESET: number; + const ENETUNREACH: number; + const ENFILE: number; + const ENOBUFS: number; + const ENODATA: number; + const ENODEV: number; + const ENOENT: number; + const ENOEXEC: number; + const ENOLCK: number; + const ENOLINK: number; + const ENOMEM: number; + const ENOMSG: number; + const ENOPROTOOPT: number; + const ENOSPC: number; + const ENOSR: number; + const ENOSTR: number; + const ENOSYS: number; + const ENOTCONN: number; + const ENOTDIR: number; + const ENOTEMPTY: number; + const ENOTSOCK: number; + const ENOTSUP: number; + const ENOTTY: number; + const ENXIO: number; + const EOPNOTSUPP: number; + const EOVERFLOW: number; + const EPERM: number; + const EPIPE: number; + const EPROTO: number; + const EPROTONOSUPPORT: number; + const EPROTOTYPE: number; + const ERANGE: number; + const EROFS: number; + const ESPIPE: number; + const ESRCH: number; + const ESTALE: number; + const ETIME: number; + const ETIMEDOUT: number; + const ETXTBSY: number; + const EWOULDBLOCK: number; + const EXDEV: number; + const WSAEINTR: number; + const WSAEBADF: number; + const WSAEACCES: number; + const WSAEFAULT: number; + const WSAEINVAL: number; + const WSAEMFILE: number; + const WSAEWOULDBLOCK: number; + const WSAEINPROGRESS: number; + const WSAEALREADY: number; + const WSAENOTSOCK: number; + const WSAEDESTADDRREQ: number; + const WSAEMSGSIZE: number; + const WSAEPROTOTYPE: number; + const WSAENOPROTOOPT: number; + const WSAEPROTONOSUPPORT: number; + const WSAESOCKTNOSUPPORT: number; + const WSAEOPNOTSUPP: number; + const WSAEPFNOSUPPORT: number; + const WSAEAFNOSUPPORT: number; + const WSAEADDRINUSE: number; + const WSAEADDRNOTAVAIL: number; + const WSAENETDOWN: number; + const WSAENETUNREACH: number; + const WSAENETRESET: number; + const WSAECONNABORTED: number; + const WSAECONNRESET: number; + const WSAENOBUFS: number; + const WSAEISCONN: number; + const WSAENOTCONN: number; + const WSAESHUTDOWN: number; + const WSAETOOMANYREFS: number; + const WSAETIMEDOUT: number; + const WSAECONNREFUSED: number; + const WSAELOOP: number; + const WSAENAMETOOLONG: number; + const WSAEHOSTDOWN: number; + const WSAEHOSTUNREACH: number; + const WSAENOTEMPTY: number; + const WSAEPROCLIM: number; + const WSAEUSERS: number; + const WSAEDQUOT: number; + const WSAESTALE: number; + const WSAEREMOTE: number; + const WSASYSNOTREADY: number; + const WSAVERNOTSUPPORTED: number; + const WSANOTINITIALISED: number; + const WSAEDISCON: number; + const WSAENOMORE: number; + const WSAECANCELLED: number; + const WSAEINVALIDPROCTABLE: number; + const WSAEINVALIDPROVIDER: number; + const WSAEPROVIDERFAILEDINIT: number; + const WSASYSCALLFAILURE: number; + const WSASERVICE_NOT_FOUND: number; + const WSATYPE_NOT_FOUND: number; + const WSA_E_NO_MORE: number; + const WSA_E_CANCELLED: number; + const WSAEREFUSED: number; + } + namespace priority { + const PRIORITY_LOW: number; + const PRIORITY_BELOW_NORMAL: number; + const PRIORITY_NORMAL: number; + const PRIORITY_ABOVE_NORMAL: number; + const PRIORITY_HIGH: number; + const PRIORITY_HIGHEST: number; + } + } + const devNull: string; + const EOL: string; + /** + * Returns the operating system CPU architecture for which the Node.js binary was + * compiled. Possible values are `'arm'`, `'arm64'`, `'ia32'`, `'mips'`,`'mipsel'`, `'ppc'`, `'ppc64'`, `'s390'`, `'s390x'`, and `'x64'`. + * + * The return value is equivalent to `process.arch`. + * @since v0.5.0 + */ + function arch(): string; + /** + * Returns a string identifying the kernel version. + * + * On POSIX systems, the operating system release is determined by calling [`uname(3)`](https://linux.die.net/man/3/uname). On Windows, `RtlGetVersion()` is used, and if it is not + * available, `GetVersionExW()` will be used. See [https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for more information. + * @since v13.11.0, v12.17.0 + */ + function version(): string; + /** + * Returns a string identifying the operating system platform for which + * the Node.js binary was compiled. The value is set at compile time. + * Possible values are `'aix'`, `'darwin'`, `'freebsd'`,`'linux'`,`'openbsd'`, `'sunos'`, and `'win32'`. + * + * The return value is equivalent to `process.platform`. + * + * The value `'android'` may also be returned if Node.js is built on the Android + * operating system. [Android support is experimental](https://github.com/nodejs/node/blob/HEAD/BUILDING.md#androidandroid-based-devices-eg-firefox-os). + * @since v0.5.0 + */ + function platform(): NodeJS.Platform; + /** + * Returns the machine type as a string, such as `arm`, `arm64`, `aarch64`,`mips`, `mips64`, `ppc64`, `ppc64le`, `s390`, `s390x`, `i386`, `i686`, `x86_64`. + * + * On POSIX systems, the machine type is determined by calling [`uname(3)`](https://linux.die.net/man/3/uname). On Windows, `RtlGetVersion()` is used, and if it is not + * available, `GetVersionExW()` will be used. See [https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for more information. + * @since v18.9.0, v16.18.0 + */ + function machine(): string; + /** + * Returns the operating system's default directory for temporary files as a + * string. + * @since v0.9.9 + */ + function tmpdir(): string; + /** + * Returns a string identifying the endianness of the CPU for which the Node.js + * binary was compiled. + * + * Possible values are `'BE'` for big endian and `'LE'` for little endian. + * @since v0.9.4 + */ + function endianness(): 'BE' | 'LE'; + /** + * Returns the scheduling priority for the process specified by `pid`. If `pid` is + * not provided or is `0`, the priority of the current process is returned. + * @since v10.10.0 + * @param [pid=0] The process ID to retrieve scheduling priority for. + */ + function getPriority(pid?: number): number; + /** + * Attempts to set the scheduling priority for the process specified by `pid`. If`pid` is not provided or is `0`, the process ID of the current process is used. + * + * The `priority` input must be an integer between `-20` (high priority) and `19`(low priority). Due to differences between Unix priority levels and Windows + * priority classes, `priority` is mapped to one of six priority constants in`os.constants.priority`. When retrieving a process priority level, this range + * mapping may cause the return value to be slightly different on Windows. To avoid + * confusion, set `priority` to one of the priority constants. + * + * On Windows, setting priority to `PRIORITY_HIGHEST` requires elevated user + * privileges. Otherwise the set priority will be silently reduced to`PRIORITY_HIGH`. + * @since v10.10.0 + * @param [pid=0] The process ID to set scheduling priority for. + * @param priority The scheduling priority to assign to the process. + */ + function setPriority(priority: number): void; + function setPriority(pid: number, priority: number): void; +} +declare module 'os' { + export * from 'node:os'; +} diff --git a/node_modules/@types/node/ts4.8/path.d.ts b/node_modules/@types/node/ts4.8/path.d.ts new file mode 100644 index 0000000..4f18011 --- /dev/null +++ b/node_modules/@types/node/ts4.8/path.d.ts @@ -0,0 +1,191 @@ +declare module 'path/posix' { + import path = require('node:path'); + export = path; +} +declare module 'path/win32' { + import path = require('node:path'); + export = path; +} +/** + * The `node:path` module provides utilities for working with file and directory + * paths. It can be accessed using: + * + * ```js + * const path = require('node:path'); + * ``` + * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/path.js) + */ +declare module 'node:path' { + namespace path { + /** + * A parsed path object generated by path.parse() or consumed by path.format(). + */ + interface ParsedPath { + /** + * The root of the path such as '/' or 'c:\' + */ + root: string; + /** + * The full directory path such as '/home/user/dir' or 'c:\path\dir' + */ + dir: string; + /** + * The file name including extension (if any) such as 'index.html' + */ + base: string; + /** + * The file extension (if any) such as '.html' + */ + ext: string; + /** + * The file name without extension (if any) such as 'index' + */ + name: string; + } + interface FormatInputPathObject { + /** + * The root of the path such as '/' or 'c:\' + */ + root?: string | undefined; + /** + * The full directory path such as '/home/user/dir' or 'c:\path\dir' + */ + dir?: string | undefined; + /** + * The file name including extension (if any) such as 'index.html' + */ + base?: string | undefined; + /** + * The file extension (if any) such as '.html' + */ + ext?: string | undefined; + /** + * The file name without extension (if any) such as 'index' + */ + name?: string | undefined; + } + interface PlatformPath { + /** + * Normalize a string path, reducing '..' and '.' parts. + * When multiple slashes are found, they're replaced by a single one; when the path contains a trailing slash, it is preserved. On Windows backslashes are used. + * + * @param path string path to normalize. + * @throws {TypeError} if `path` is not a string. + */ + normalize(path: string): string; + /** + * Join all arguments together and normalize the resulting path. + * + * @param paths paths to join. + * @throws {TypeError} if any of the path segments is not a string. + */ + join(...paths: string[]): string; + /** + * The right-most parameter is considered {to}. Other parameters are considered an array of {from}. + * + * Starting from leftmost {from} parameter, resolves {to} to an absolute path. + * + * If {to} isn't already absolute, {from} arguments are prepended in right to left order, + * until an absolute path is found. If after using all {from} paths still no absolute path is found, + * the current working directory is used as well. The resulting path is normalized, + * and trailing slashes are removed unless the path gets resolved to the root directory. + * + * @param paths A sequence of paths or path segments. + * @throws {TypeError} if any of the arguments is not a string. + */ + resolve(...paths: string[]): string; + /** + * Determines whether {path} is an absolute path. An absolute path will always resolve to the same location, regardless of the working directory. + * + * If the given {path} is a zero-length string, `false` will be returned. + * + * @param path path to test. + * @throws {TypeError} if `path` is not a string. + */ + isAbsolute(path: string): boolean; + /** + * Solve the relative path from {from} to {to} based on the current working directory. + * At times we have two absolute paths, and we need to derive the relative path from one to the other. This is actually the reverse transform of path.resolve. + * + * @throws {TypeError} if either `from` or `to` is not a string. + */ + relative(from: string, to: string): string; + /** + * Return the directory name of a path. Similar to the Unix dirname command. + * + * @param path the path to evaluate. + * @throws {TypeError} if `path` is not a string. + */ + dirname(path: string): string; + /** + * Return the last portion of a path. Similar to the Unix basename command. + * Often used to extract the file name from a fully qualified path. + * + * @param path the path to evaluate. + * @param suffix optionally, an extension to remove from the result. + * @throws {TypeError} if `path` is not a string or if `ext` is given and is not a string. + */ + basename(path: string, suffix?: string): string; + /** + * Return the extension of the path, from the last '.' to end of string in the last portion of the path. + * If there is no '.' in the last portion of the path or the first character of it is '.', then it returns an empty string. + * + * @param path the path to evaluate. + * @throws {TypeError} if `path` is not a string. + */ + extname(path: string): string; + /** + * The platform-specific file separator. '\\' or '/'. + */ + readonly sep: '\\' | '/'; + /** + * The platform-specific file delimiter. ';' or ':'. + */ + readonly delimiter: ';' | ':'; + /** + * Returns an object from a path string - the opposite of format(). + * + * @param path path to evaluate. + * @throws {TypeError} if `path` is not a string. + */ + parse(path: string): ParsedPath; + /** + * Returns a path string from an object - the opposite of parse(). + * + * @param pathObject path to evaluate. + */ + format(pathObject: FormatInputPathObject): string; + /** + * On Windows systems only, returns an equivalent namespace-prefixed path for the given path. + * If path is not a string, path will be returned without modifications. + * This method is meaningful only on Windows system. + * On POSIX systems, the method is non-operational and always returns path without modifications. + */ + toNamespacedPath(path: string): string; + /** + * Posix specific pathing. + * Same as parent object on posix. + */ + readonly posix: PlatformPath; + /** + * Windows specific pathing. + * Same as parent object on windows + */ + readonly win32: PlatformPath; + } + } + const path: path.PlatformPath; + export = path; +} +declare module 'path' { + import path = require('node:path'); + export = path; +} +declare module 'node:path/posix' { + import path = require('path/posix'); + export = path; +} +declare module 'node:path/win32' { + import path = require('path/win32'); + export = path; +} diff --git a/node_modules/@types/node/ts4.8/perf_hooks.d.ts b/node_modules/@types/node/ts4.8/perf_hooks.d.ts new file mode 100644 index 0000000..0d4d137 --- /dev/null +++ b/node_modules/@types/node/ts4.8/perf_hooks.d.ts @@ -0,0 +1,638 @@ +/** + * This module provides an implementation of a subset of the W3C [Web Performance APIs](https://w3c.github.io/perf-timing-primer/) as well as additional APIs for + * Node.js-specific performance measurements. + * + * Node.js supports the following [Web Performance APIs](https://w3c.github.io/perf-timing-primer/): + * + * * [High Resolution Time](https://www.w3.org/TR/hr-time-2) + * * [Performance Timeline](https://w3c.github.io/performance-timeline/) + * * [User Timing](https://www.w3.org/TR/user-timing/) + * * [Resource Timing](https://www.w3.org/TR/resource-timing-2/) + * + * ```js + * const { PerformanceObserver, performance } = require('node:perf_hooks'); + * + * const obs = new PerformanceObserver((items) => { + * console.log(items.getEntries()[0].duration); + * performance.clearMarks(); + * }); + * obs.observe({ type: 'measure' }); + * performance.measure('Start to Now'); + * + * performance.mark('A'); + * doSomeLongRunningProcess(() => { + * performance.measure('A to Now', 'A'); + * + * performance.mark('B'); + * performance.measure('A to B', 'A', 'B'); + * }); + * ``` + * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/perf_hooks.js) + */ +declare module 'node:perf_hooks' { + import { AsyncResource } from 'node:async_hooks'; + type EntryType = 'node' | 'mark' | 'measure' | 'gc' | 'function' | 'http2' | 'http'; + interface NodeGCPerformanceDetail { + /** + * When `performanceEntry.entryType` is equal to 'gc', `the performance.kind` property identifies + * the type of garbage collection operation that occurred. + * See perf_hooks.constants for valid values. + */ + readonly kind?: number | undefined; + /** + * When `performanceEntry.entryType` is equal to 'gc', the `performance.flags` + * property contains additional information about garbage collection operation. + * See perf_hooks.constants for valid values. + */ + readonly flags?: number | undefined; + } + /** + * The constructor of this class is not exposed to users directly. + * @since v8.5.0 + */ + class PerformanceEntry { + protected constructor(); + /** + * The total number of milliseconds elapsed for this entry. This value will not + * be meaningful for all Performance Entry types. + * @since v8.5.0 + */ + readonly duration: number; + /** + * The name of the performance entry. + * @since v8.5.0 + */ + readonly name: string; + /** + * The high resolution millisecond timestamp marking the starting time of the + * Performance Entry. + * @since v8.5.0 + */ + readonly startTime: number; + /** + * The type of the performance entry. It may be one of: + * + * * `'node'` (Node.js only) + * * `'mark'` (available on the Web) + * * `'measure'` (available on the Web) + * * `'gc'` (Node.js only) + * * `'function'` (Node.js only) + * * `'http2'` (Node.js only) + * * `'http'` (Node.js only) + * @since v8.5.0 + */ + readonly entryType: EntryType; + /** + * Additional detail specific to the `entryType`. + * @since v16.0.0 + */ + readonly detail?: NodeGCPerformanceDetail | unknown | undefined; // TODO: Narrow this based on entry type. + toJSON(): any; + } + /** + * Exposes marks created via the `Performance.mark()` method. + * @since v18.2.0, v16.17.0 + */ + class PerformanceMark extends PerformanceEntry { + readonly duration: 0; + readonly entryType: 'mark'; + } + /** + * Exposes measures created via the `Performance.measure()` method. + * + * The constructor of this class is not exposed to users directly. + * @since v18.2.0, v16.17.0 + */ + class PerformanceMeasure extends PerformanceEntry { + readonly entryType: 'measure'; + } + /** + * _This property is an extension by Node.js. It is not available in Web browsers._ + * + * Provides timing details for Node.js itself. The constructor of this class + * is not exposed to users. + * @since v8.5.0 + */ + class PerformanceNodeTiming extends PerformanceEntry { + /** + * The high resolution millisecond timestamp at which the Node.js process + * completed bootstrapping. If bootstrapping has not yet finished, the property + * has the value of -1. + * @since v8.5.0 + */ + readonly bootstrapComplete: number; + /** + * The high resolution millisecond timestamp at which the Node.js environment was + * initialized. + * @since v8.5.0 + */ + readonly environment: number; + /** + * The high resolution millisecond timestamp of the amount of time the event loop + * has been idle within the event loop's event provider (e.g. `epoll_wait`). This + * does not take CPU usage into consideration. If the event loop has not yet + * started (e.g., in the first tick of the main script), the property has the + * value of 0. + * @since v14.10.0, v12.19.0 + */ + readonly idleTime: number; + /** + * The high resolution millisecond timestamp at which the Node.js event loop + * exited. If the event loop has not yet exited, the property has the value of -1\. + * It can only have a value of not -1 in a handler of the `'exit'` event. + * @since v8.5.0 + */ + readonly loopExit: number; + /** + * The high resolution millisecond timestamp at which the Node.js event loop + * started. If the event loop has not yet started (e.g., in the first tick of the + * main script), the property has the value of -1. + * @since v8.5.0 + */ + readonly loopStart: number; + /** + * The high resolution millisecond timestamp at which the V8 platform was + * initialized. + * @since v8.5.0 + */ + readonly v8Start: number; + } + interface EventLoopUtilization { + idle: number; + active: number; + utilization: number; + } + /** + * @param util1 The result of a previous call to eventLoopUtilization() + * @param util2 The result of a previous call to eventLoopUtilization() prior to util1 + */ + type EventLoopUtilityFunction = (util1?: EventLoopUtilization, util2?: EventLoopUtilization) => EventLoopUtilization; + interface MarkOptions { + /** + * Additional optional detail to include with the mark. + */ + detail?: unknown | undefined; + /** + * An optional timestamp to be used as the mark time. + * @default `performance.now()`. + */ + startTime?: number | undefined; + } + interface MeasureOptions { + /** + * Additional optional detail to include with the mark. + */ + detail?: unknown | undefined; + /** + * Duration between start and end times. + */ + duration?: number | undefined; + /** + * Timestamp to be used as the end time, or a string identifying a previously recorded mark. + */ + end?: number | string | undefined; + /** + * Timestamp to be used as the start time, or a string identifying a previously recorded mark. + */ + start?: number | string | undefined; + } + interface TimerifyOptions { + /** + * A histogram object created using + * `perf_hooks.createHistogram()` that will record runtime durations in + * nanoseconds. + */ + histogram?: RecordableHistogram | undefined; + } + interface Performance { + /** + * If name is not provided, removes all PerformanceMark objects from the Performance Timeline. + * If name is provided, removes only the named mark. + * @param name + */ + clearMarks(name?: string): void; + /** + * If name is not provided, removes all PerformanceMeasure objects from the Performance Timeline. + * If name is provided, removes only the named measure. + * @param name + * @since v16.7.0 + */ + clearMeasures(name?: string): void; + /** + * Returns a list of `PerformanceEntry` objects in chronological order with respect to `performanceEntry.startTime`. + * If you are only interested in performance entries of certain types or that have certain names, see + * `performance.getEntriesByType()` and `performance.getEntriesByName()`. + * @since v16.7.0 + */ + getEntries(): PerformanceEntry[]; + /** + * Returns a list of `PerformanceEntry` objects in chronological order with respect to `performanceEntry.startTime` + * whose `performanceEntry.name` is equal to `name`, and optionally, whose `performanceEntry.entryType` is equal to `type`. + * @param name + * @param type + * @since v16.7.0 + */ + getEntriesByName(name: string, type?: EntryType): PerformanceEntry[]; + /** + * Returns a list of `PerformanceEntry` objects in chronological order with respect to `performanceEntry.startTime` + * whose `performanceEntry.entryType` is equal to `type`. + * @param type + * @since v16.7.0 + */ + getEntriesByType(type: EntryType): PerformanceEntry[]; + /** + * Creates a new PerformanceMark entry in the Performance Timeline. + * A PerformanceMark is a subclass of PerformanceEntry whose performanceEntry.entryType is always 'mark', + * and whose performanceEntry.duration is always 0. + * Performance marks are used to mark specific significant moments in the Performance Timeline. + * @param name + * @return The PerformanceMark entry that was created + */ + mark(name?: string, options?: MarkOptions): PerformanceMark; + /** + * Creates a new PerformanceMeasure entry in the Performance Timeline. + * A PerformanceMeasure is a subclass of PerformanceEntry whose performanceEntry.entryType is always 'measure', + * and whose performanceEntry.duration measures the number of milliseconds elapsed since startMark and endMark. + * + * The startMark argument may identify any existing PerformanceMark in the the Performance Timeline, or may identify + * any of the timestamp properties provided by the PerformanceNodeTiming class. If the named startMark does not exist, + * then startMark is set to timeOrigin by default. + * + * The endMark argument must identify any existing PerformanceMark in the the Performance Timeline or any of the timestamp + * properties provided by the PerformanceNodeTiming class. If the named endMark does not exist, an error will be thrown. + * @param name + * @param startMark + * @param endMark + * @return The PerformanceMeasure entry that was created + */ + measure(name: string, startMark?: string, endMark?: string): PerformanceMeasure; + measure(name: string, options: MeasureOptions): PerformanceMeasure; + /** + * An instance of the PerformanceNodeTiming class that provides performance metrics for specific Node.js operational milestones. + */ + readonly nodeTiming: PerformanceNodeTiming; + /** + * @return the current high resolution millisecond timestamp + */ + now(): number; + /** + * The timeOrigin specifies the high resolution millisecond timestamp from which all performance metric durations are measured. + */ + readonly timeOrigin: number; + /** + * Wraps a function within a new function that measures the running time of the wrapped function. + * A PerformanceObserver must be subscribed to the 'function' event type in order for the timing details to be accessed. + * @param fn + */ + timerify any>(fn: T, options?: TimerifyOptions): T; + /** + * eventLoopUtilization is similar to CPU utilization except that it is calculated using high precision wall-clock time. + * It represents the percentage of time the event loop has spent outside the event loop's event provider (e.g. epoll_wait). + * No other CPU idle time is taken into consideration. + */ + eventLoopUtilization: EventLoopUtilityFunction; + } + interface PerformanceObserverEntryList { + /** + * Returns a list of `PerformanceEntry` objects in chronological order + * with respect to `performanceEntry.startTime`. + * + * ```js + * const { + * performance, + * PerformanceObserver, + * } = require('node:perf_hooks'); + * + * const obs = new PerformanceObserver((perfObserverList, observer) => { + * console.log(perfObserverList.getEntries()); + * + * * [ + * * PerformanceEntry { + * * name: 'test', + * * entryType: 'mark', + * * startTime: 81.465639, + * * duration: 0 + * * }, + * * PerformanceEntry { + * * name: 'meow', + * * entryType: 'mark', + * * startTime: 81.860064, + * * duration: 0 + * * } + * * ] + * + * + * performance.clearMarks(); + * performance.clearMeasures(); + * observer.disconnect(); + * }); + * obs.observe({ type: 'mark' }); + * + * performance.mark('test'); + * performance.mark('meow'); + * ``` + * @since v8.5.0 + */ + getEntries(): PerformanceEntry[]; + /** + * Returns a list of `PerformanceEntry` objects in chronological order + * with respect to `performanceEntry.startTime` whose `performanceEntry.name` is + * equal to `name`, and optionally, whose `performanceEntry.entryType` is equal to`type`. + * + * ```js + * const { + * performance, + * PerformanceObserver, + * } = require('node:perf_hooks'); + * + * const obs = new PerformanceObserver((perfObserverList, observer) => { + * console.log(perfObserverList.getEntriesByName('meow')); + * + * * [ + * * PerformanceEntry { + * * name: 'meow', + * * entryType: 'mark', + * * startTime: 98.545991, + * * duration: 0 + * * } + * * ] + * + * console.log(perfObserverList.getEntriesByName('nope')); // [] + * + * console.log(perfObserverList.getEntriesByName('test', 'mark')); + * + * * [ + * * PerformanceEntry { + * * name: 'test', + * * entryType: 'mark', + * * startTime: 63.518931, + * * duration: 0 + * * } + * * ] + * + * console.log(perfObserverList.getEntriesByName('test', 'measure')); // [] + * + * performance.clearMarks(); + * performance.clearMeasures(); + * observer.disconnect(); + * }); + * obs.observe({ entryTypes: ['mark', 'measure'] }); + * + * performance.mark('test'); + * performance.mark('meow'); + * ``` + * @since v8.5.0 + */ + getEntriesByName(name: string, type?: EntryType): PerformanceEntry[]; + /** + * Returns a list of `PerformanceEntry` objects in chronological order + * with respect to `performanceEntry.startTime` whose `performanceEntry.entryType`is equal to `type`. + * + * ```js + * const { + * performance, + * PerformanceObserver, + * } = require('node:perf_hooks'); + * + * const obs = new PerformanceObserver((perfObserverList, observer) => { + * console.log(perfObserverList.getEntriesByType('mark')); + * + * * [ + * * PerformanceEntry { + * * name: 'test', + * * entryType: 'mark', + * * startTime: 55.897834, + * * duration: 0 + * * }, + * * PerformanceEntry { + * * name: 'meow', + * * entryType: 'mark', + * * startTime: 56.350146, + * * duration: 0 + * * } + * * ] + * + * performance.clearMarks(); + * performance.clearMeasures(); + * observer.disconnect(); + * }); + * obs.observe({ type: 'mark' }); + * + * performance.mark('test'); + * performance.mark('meow'); + * ``` + * @since v8.5.0 + */ + getEntriesByType(type: EntryType): PerformanceEntry[]; + } + type PerformanceObserverCallback = (list: PerformanceObserverEntryList, observer: PerformanceObserver) => void; + /** + * @since v8.5.0 + */ + class PerformanceObserver extends AsyncResource { + constructor(callback: PerformanceObserverCallback); + /** + * Disconnects the `PerformanceObserver` instance from all notifications. + * @since v8.5.0 + */ + disconnect(): void; + /** + * Subscribes the `PerformanceObserver` instance to notifications of new `PerformanceEntry` instances identified either by `options.entryTypes`or `options.type`: + * + * ```js + * const { + * performance, + * PerformanceObserver, + * } = require('node:perf_hooks'); + * + * const obs = new PerformanceObserver((list, observer) => { + * // Called once asynchronously. `list` contains three items. + * }); + * obs.observe({ type: 'mark' }); + * + * for (let n = 0; n < 3; n++) + * performance.mark(`test${n}`); + * ``` + * @since v8.5.0 + */ + observe( + options: + | { + entryTypes: ReadonlyArray; + buffered?: boolean | undefined; + } + | { + type: EntryType; + buffered?: boolean | undefined; + } + ): void; + } + namespace constants { + const NODE_PERFORMANCE_GC_MAJOR: number; + const NODE_PERFORMANCE_GC_MINOR: number; + const NODE_PERFORMANCE_GC_INCREMENTAL: number; + const NODE_PERFORMANCE_GC_WEAKCB: number; + const NODE_PERFORMANCE_GC_FLAGS_NO: number; + const NODE_PERFORMANCE_GC_FLAGS_CONSTRUCT_RETAINED: number; + const NODE_PERFORMANCE_GC_FLAGS_FORCED: number; + const NODE_PERFORMANCE_GC_FLAGS_SYNCHRONOUS_PHANTOM_PROCESSING: number; + const NODE_PERFORMANCE_GC_FLAGS_ALL_AVAILABLE_GARBAGE: number; + const NODE_PERFORMANCE_GC_FLAGS_ALL_EXTERNAL_MEMORY: number; + const NODE_PERFORMANCE_GC_FLAGS_SCHEDULE_IDLE: number; + } + const performance: Performance; + interface EventLoopMonitorOptions { + /** + * The sampling rate in milliseconds. + * Must be greater than zero. + * @default 10 + */ + resolution?: number | undefined; + } + interface Histogram { + /** + * Returns a `Map` object detailing the accumulated percentile distribution. + * @since v11.10.0 + */ + readonly percentiles: Map; + /** + * The number of times the event loop delay exceeded the maximum 1 hour event + * loop delay threshold. + * @since v11.10.0 + */ + readonly exceeds: number; + /** + * The minimum recorded event loop delay. + * @since v11.10.0 + */ + readonly min: number; + /** + * The maximum recorded event loop delay. + * @since v11.10.0 + */ + readonly max: number; + /** + * The mean of the recorded event loop delays. + * @since v11.10.0 + */ + readonly mean: number; + /** + * The standard deviation of the recorded event loop delays. + * @since v11.10.0 + */ + readonly stddev: number; + /** + * Resets the collected histogram data. + * @since v11.10.0 + */ + reset(): void; + /** + * Returns the value at the given percentile. + * @since v11.10.0 + * @param percentile A percentile value in the range (0, 100]. + */ + percentile(percentile: number): number; + } + interface IntervalHistogram extends Histogram { + /** + * Enables the update interval timer. Returns `true` if the timer was + * started, `false` if it was already started. + * @since v11.10.0 + */ + enable(): boolean; + /** + * Disables the update interval timer. Returns `true` if the timer was + * stopped, `false` if it was already stopped. + * @since v11.10.0 + */ + disable(): boolean; + } + interface RecordableHistogram extends Histogram { + /** + * @since v15.9.0, v14.18.0 + * @param val The amount to record in the histogram. + */ + record(val: number | bigint): void; + /** + * Calculates the amount of time (in nanoseconds) that has passed since the + * previous call to `recordDelta()` and records that amount in the histogram. + * + * ## Examples + * @since v15.9.0, v14.18.0 + */ + recordDelta(): void; + /** + * Adds the values from `other` to this histogram. + * @since v17.4.0, v16.14.0 + */ + add(other: RecordableHistogram): void; + } + /** + * _This property is an extension by Node.js. It is not available in Web browsers._ + * + * Creates an `IntervalHistogram` object that samples and reports the event loop + * delay over time. The delays will be reported in nanoseconds. + * + * Using a timer to detect approximate event loop delay works because the + * execution of timers is tied specifically to the lifecycle of the libuv + * event loop. That is, a delay in the loop will cause a delay in the execution + * of the timer, and those delays are specifically what this API is intended to + * detect. + * + * ```js + * const { monitorEventLoopDelay } = require('node:perf_hooks'); + * const h = monitorEventLoopDelay({ resolution: 20 }); + * h.enable(); + * // Do something. + * h.disable(); + * console.log(h.min); + * console.log(h.max); + * console.log(h.mean); + * console.log(h.stddev); + * console.log(h.percentiles); + * console.log(h.percentile(50)); + * console.log(h.percentile(99)); + * ``` + * @since v11.10.0 + */ + function monitorEventLoopDelay(options?: EventLoopMonitorOptions): IntervalHistogram; + interface CreateHistogramOptions { + /** + * The minimum recordable value. Must be an integer value greater than 0. + * @default 1 + */ + min?: number | bigint | undefined; + /** + * The maximum recordable value. Must be an integer value greater than min. + * @default Number.MAX_SAFE_INTEGER + */ + max?: number | bigint | undefined; + /** + * The number of accuracy digits. Must be a number between 1 and 5. + * @default 3 + */ + figures?: number | undefined; + } + /** + * Returns a `RecordableHistogram`. + * @since v15.9.0, v14.18.0 + */ + function createHistogram(options?: CreateHistogramOptions): RecordableHistogram; + import { performance as _performance } from 'perf_hooks'; + global { + /** + * `performance` is a global reference for `require('perf_hooks').performance` + * https://nodejs.org/api/globals.html#performance + * @since v16.0.0 + */ + var performance: typeof globalThis extends { + onmessage: any; + performance: infer T; + } + ? T + : typeof _performance; + } +} +declare module 'perf_hooks' { + export * from 'node:perf_hooks'; +} diff --git a/node_modules/@types/node/ts4.8/process.d.ts b/node_modules/@types/node/ts4.8/process.d.ts new file mode 100644 index 0000000..58dd189 --- /dev/null +++ b/node_modules/@types/node/ts4.8/process.d.ts @@ -0,0 +1,1495 @@ +declare module 'node:process' { + import * as tty from 'node:tty'; + import { Worker } from 'node:worker_threads'; + global { + var process: NodeJS.Process; + namespace NodeJS { + // this namespace merge is here because these are specifically used + // as the type for process.stdin, process.stdout, and process.stderr. + // they can't live in tty.d.ts because we need to disambiguate the imported name. + interface ReadStream extends tty.ReadStream {} + interface WriteStream extends tty.WriteStream {} + interface MemoryUsageFn { + /** + * The `process.memoryUsage()` method iterate over each page to gather informations about memory + * usage which can be slow depending on the program memory allocations. + */ + (): MemoryUsage; + /** + * method returns an integer representing the Resident Set Size (RSS) in bytes. + */ + rss(): number; + } + interface MemoryUsage { + rss: number; + heapTotal: number; + heapUsed: number; + external: number; + arrayBuffers: number; + } + interface CpuUsage { + user: number; + system: number; + } + interface ProcessRelease { + name: string; + sourceUrl?: string | undefined; + headersUrl?: string | undefined; + libUrl?: string | undefined; + lts?: string | undefined; + } + interface ProcessVersions extends Dict { + http_parser: string; + node: string; + v8: string; + ares: string; + uv: string; + zlib: string; + modules: string; + openssl: string; + } + type Platform = 'aix' | 'android' | 'darwin' | 'freebsd' | 'haiku' | 'linux' | 'openbsd' | 'sunos' | 'win32' | 'cygwin' | 'netbsd'; + type Architecture = 'arm' | 'arm64' | 'ia32' | 'mips' | 'mipsel' | 'ppc' | 'ppc64' | 's390' | 's390x' | 'x64'; + type Signals = + | 'SIGABRT' + | 'SIGALRM' + | 'SIGBUS' + | 'SIGCHLD' + | 'SIGCONT' + | 'SIGFPE' + | 'SIGHUP' + | 'SIGILL' + | 'SIGINT' + | 'SIGIO' + | 'SIGIOT' + | 'SIGKILL' + | 'SIGPIPE' + | 'SIGPOLL' + | 'SIGPROF' + | 'SIGPWR' + | 'SIGQUIT' + | 'SIGSEGV' + | 'SIGSTKFLT' + | 'SIGSTOP' + | 'SIGSYS' + | 'SIGTERM' + | 'SIGTRAP' + | 'SIGTSTP' + | 'SIGTTIN' + | 'SIGTTOU' + | 'SIGUNUSED' + | 'SIGURG' + | 'SIGUSR1' + | 'SIGUSR2' + | 'SIGVTALRM' + | 'SIGWINCH' + | 'SIGXCPU' + | 'SIGXFSZ' + | 'SIGBREAK' + | 'SIGLOST' + | 'SIGINFO'; + type UncaughtExceptionOrigin = 'uncaughtException' | 'unhandledRejection'; + type MultipleResolveType = 'resolve' | 'reject'; + type BeforeExitListener = (code: number) => void; + type DisconnectListener = () => void; + type ExitListener = (code: number) => void; + type RejectionHandledListener = (promise: Promise) => void; + type UncaughtExceptionListener = (error: Error, origin: UncaughtExceptionOrigin) => void; + /** + * Most of the time the unhandledRejection will be an Error, but this should not be relied upon + * as *anything* can be thrown/rejected, it is therefore unsafe to assume that the value is an Error. + */ + type UnhandledRejectionListener = (reason: unknown, promise: Promise) => void; + type WarningListener = (warning: Error) => void; + type MessageListener = (message: unknown, sendHandle: unknown) => void; + type SignalsListener = (signal: Signals) => void; + type MultipleResolveListener = (type: MultipleResolveType, promise: Promise, value: unknown) => void; + type WorkerListener = (worker: Worker) => void; + interface Socket extends ReadWriteStream { + isTTY?: true | undefined; + } + // Alias for compatibility + interface ProcessEnv extends Dict { + /** + * Can be used to change the default timezone at runtime + */ + TZ?: string; + } + interface HRTime { + (time?: [number, number]): [number, number]; + bigint(): bigint; + } + interface ProcessReport { + /** + * Directory where the report is written. + * working directory of the Node.js process. + * @default '' indicating that reports are written to the current + */ + directory: string; + /** + * Filename where the report is written. + * The default value is the empty string. + * @default '' the output filename will be comprised of a timestamp, + * PID, and sequence number. + */ + filename: string; + /** + * Returns a JSON-formatted diagnostic report for the running process. + * The report's JavaScript stack trace is taken from err, if present. + */ + getReport(err?: Error): string; + /** + * If true, a diagnostic report is generated on fatal errors, + * such as out of memory errors or failed C++ assertions. + * @default false + */ + reportOnFatalError: boolean; + /** + * If true, a diagnostic report is generated when the process + * receives the signal specified by process.report.signal. + * @default false + */ + reportOnSignal: boolean; + /** + * If true, a diagnostic report is generated on uncaught exception. + * @default false + */ + reportOnUncaughtException: boolean; + /** + * The signal used to trigger the creation of a diagnostic report. + * @default 'SIGUSR2' + */ + signal: Signals; + /** + * Writes a diagnostic report to a file. If filename is not provided, the default filename + * includes the date, time, PID, and a sequence number. + * The report's JavaScript stack trace is taken from err, if present. + * + * @param fileName Name of the file where the report is written. + * This should be a relative path, that will be appended to the directory specified in + * `process.report.directory`, or the current working directory of the Node.js process, + * if unspecified. + * @param error A custom error used for reporting the JavaScript stack. + * @return Filename of the generated report. + */ + writeReport(fileName?: string): string; + writeReport(error?: Error): string; + writeReport(fileName?: string, err?: Error): string; + } + interface ResourceUsage { + fsRead: number; + fsWrite: number; + involuntaryContextSwitches: number; + ipcReceived: number; + ipcSent: number; + majorPageFault: number; + maxRSS: number; + minorPageFault: number; + sharedMemorySize: number; + signalsCount: number; + swappedOut: number; + systemCPUTime: number; + unsharedDataSize: number; + unsharedStackSize: number; + userCPUTime: number; + voluntaryContextSwitches: number; + } + interface EmitWarningOptions { + /** + * When `warning` is a `string`, `type` is the name to use for the _type_ of warning being emitted. + * + * @default 'Warning' + */ + type?: string | undefined; + /** + * A unique identifier for the warning instance being emitted. + */ + code?: string | undefined; + /** + * When `warning` is a `string`, `ctor` is an optional function used to limit the generated stack trace. + * + * @default process.emitWarning + */ + ctor?: Function | undefined; + /** + * Additional text to include with the error. + */ + detail?: string | undefined; + } + interface ProcessConfig { + readonly target_defaults: { + readonly cflags: any[]; + readonly default_configuration: string; + readonly defines: string[]; + readonly include_dirs: string[]; + readonly libraries: string[]; + }; + readonly variables: { + readonly clang: number; + readonly host_arch: string; + readonly node_install_npm: boolean; + readonly node_install_waf: boolean; + readonly node_prefix: string; + readonly node_shared_openssl: boolean; + readonly node_shared_v8: boolean; + readonly node_shared_zlib: boolean; + readonly node_use_dtrace: boolean; + readonly node_use_etw: boolean; + readonly node_use_openssl: boolean; + readonly target_arch: string; + readonly v8_no_strict_aliasing: number; + readonly v8_use_snapshot: boolean; + readonly visibility: string; + }; + } + interface Process extends EventEmitter { + /** + * The `process.stdout` property returns a stream connected to`stdout` (fd `1`). It is a `net.Socket` (which is a `Duplex` stream) unless fd `1` refers to a file, in which case it is + * a `Writable` stream. + * + * For example, to copy `process.stdin` to `process.stdout`: + * + * ```js + * import { stdin, stdout } from 'node:process'; + * + * stdin.pipe(stdout); + * ``` + * + * `process.stdout` differs from other Node.js streams in important ways. See `note on process I/O` for more information. + */ + stdout: WriteStream & { + fd: 1; + }; + /** + * The `process.stderr` property returns a stream connected to`stderr` (fd `2`). It is a `net.Socket` (which is a `Duplex` stream) unless fd `2` refers to a file, in which case it is + * a `Writable` stream. + * + * `process.stderr` differs from other Node.js streams in important ways. See `note on process I/O` for more information. + */ + stderr: WriteStream & { + fd: 2; + }; + /** + * The `process.stdin` property returns a stream connected to`stdin` (fd `0`). It is a `net.Socket` (which is a `Duplex` stream) unless fd `0` refers to a file, in which case it is + * a `Readable` stream. + * + * For details of how to read from `stdin` see `readable.read()`. + * + * As a `Duplex` stream, `process.stdin` can also be used in "old" mode that + * is compatible with scripts written for Node.js prior to v0.10\. + * For more information see `Stream compatibility`. + * + * In "old" streams mode the `stdin` stream is paused by default, so one + * must call `process.stdin.resume()` to read from it. Note also that calling`process.stdin.resume()` itself would switch stream to "old" mode. + */ + stdin: ReadStream & { + fd: 0; + }; + openStdin(): Socket; + /** + * The `process.argv` property returns an array containing the command-line + * arguments passed when the Node.js process was launched. The first element will + * be {@link execPath}. See `process.argv0` if access to the original value + * of `argv[0]` is needed. The second element will be the path to the JavaScript + * file being executed. The remaining elements will be any additional command-line + * arguments. + * + * For example, assuming the following script for `process-args.js`: + * + * ```js + * import { argv } from 'node:process'; + * + * // print process.argv + * argv.forEach((val, index) => { + * console.log(`${index}: ${val}`); + * }); + * ``` + * + * Launching the Node.js process as: + * + * ```bash + * node process-args.js one two=three four + * ``` + * + * Would generate the output: + * + * ```text + * 0: /usr/local/bin/node + * 1: /Users/mjr/work/node/process-args.js + * 2: one + * 3: two=three + * 4: four + * ``` + * @since v0.1.27 + */ + argv: string[]; + /** + * The `process.argv0` property stores a read-only copy of the original value of`argv[0]` passed when Node.js starts. + * + * ```console + * $ bash -c 'exec -a customArgv0 ./node' + * > process.argv[0] + * '/Volumes/code/external/node/out/Release/node' + * > process.argv0 + * 'customArgv0' + * ``` + * @since v6.4.0 + */ + argv0: string; + /** + * The `process.execArgv` property returns the set of Node.js-specific command-line + * options passed when the Node.js process was launched. These options do not + * appear in the array returned by the {@link argv} property, and do not + * include the Node.js executable, the name of the script, or any options following + * the script name. These options are useful in order to spawn child processes with + * the same execution environment as the parent. + * + * ```bash + * node --harmony script.js --version + * ``` + * + * Results in `process.execArgv`: + * + * ```js + * ['--harmony'] + * ``` + * + * And `process.argv`: + * + * ```js + * ['/usr/local/bin/node', 'script.js', '--version'] + * ``` + * + * Refer to `Worker constructor` for the detailed behavior of worker + * threads with this property. + * @since v0.7.7 + */ + execArgv: string[]; + /** + * The `process.execPath` property returns the absolute pathname of the executable + * that started the Node.js process. Symbolic links, if any, are resolved. + * + * ```js + * '/usr/local/bin/node' + * ``` + * @since v0.1.100 + */ + execPath: string; + /** + * The `process.abort()` method causes the Node.js process to exit immediately and + * generate a core file. + * + * This feature is not available in `Worker` threads. + * @since v0.7.0 + */ + abort(): never; + /** + * The `process.chdir()` method changes the current working directory of the + * Node.js process or throws an exception if doing so fails (for instance, if + * the specified `directory` does not exist). + * + * ```js + * import { chdir, cwd } from 'node:process'; + * + * console.log(`Starting directory: ${cwd()}`); + * try { + * chdir('/tmp'); + * console.log(`New directory: ${cwd()}`); + * } catch (err) { + * console.error(`chdir: ${err}`); + * } + * ``` + * + * This feature is not available in `Worker` threads. + * @since v0.1.17 + */ + chdir(directory: string): void; + /** + * The `process.cwd()` method returns the current working directory of the Node.js + * process. + * + * ```js + * import { cwd } from 'node:process'; + * + * console.log(`Current directory: ${cwd()}`); + * ``` + * @since v0.1.8 + */ + cwd(): string; + /** + * The port used by the Node.js debugger when enabled. + * + * ```js + * import process from 'node:process'; + * + * process.debugPort = 5858; + * ``` + * @since v0.7.2 + */ + debugPort: number; + /** + * The `process.emitWarning()` method can be used to emit custom or application + * specific process warnings. These can be listened for by adding a handler to the `'warning'` event. + * + * ```js + * import { emitWarning } from 'node:process'; + * + * // Emit a warning with a code and additional detail. + * emitWarning('Something happened!', { + * code: 'MY_WARNING', + * detail: 'This is some additional information', + * }); + * // Emits: + * // (node:56338) [MY_WARNING] Warning: Something happened! + * // This is some additional information + * ``` + * + * In this example, an `Error` object is generated internally by`process.emitWarning()` and passed through to the `'warning'` handler. + * + * ```js + * import process from 'node:process'; + * + * process.on('warning', (warning) => { + * console.warn(warning.name); // 'Warning' + * console.warn(warning.message); // 'Something happened!' + * console.warn(warning.code); // 'MY_WARNING' + * console.warn(warning.stack); // Stack trace + * console.warn(warning.detail); // 'This is some additional information' + * }); + * ``` + * + * If `warning` is passed as an `Error` object, the `options` argument is ignored. + * @since v8.0.0 + * @param warning The warning to emit. + */ + emitWarning(warning: string | Error, ctor?: Function): void; + emitWarning(warning: string | Error, type?: string, ctor?: Function): void; + emitWarning(warning: string | Error, type?: string, code?: string, ctor?: Function): void; + emitWarning(warning: string | Error, options?: EmitWarningOptions): void; + /** + * The `process.env` property returns an object containing the user environment. + * See [`environ(7)`](http://man7.org/linux/man-pages/man7/environ.7.html). + * + * An example of this object looks like: + * + * ```js + * { + * TERM: 'xterm-256color', + * SHELL: '/usr/local/bin/bash', + * USER: 'maciej', + * PATH: '~/.bin/:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin', + * PWD: '/Users/maciej', + * EDITOR: 'vim', + * SHLVL: '1', + * HOME: '/Users/maciej', + * LOGNAME: 'maciej', + * _: '/usr/local/bin/node' + * } + * ``` + * + * It is possible to modify this object, but such modifications will not be + * reflected outside the Node.js process, or (unless explicitly requested) + * to other `Worker` threads. + * In other words, the following example would not work: + * + * ```bash + * node -e 'process.env.foo = "bar"' && echo $foo + * ``` + * + * While the following will: + * + * ```js + * import { env } from 'node:process'; + * + * env.foo = 'bar'; + * console.log(env.foo); + * ``` + * + * Assigning a property on `process.env` will implicitly convert the value + * to a string. **This behavior is deprecated.** Future versions of Node.js may + * throw an error when the value is not a string, number, or boolean. + * + * ```js + * import { env } from 'node:process'; + * + * env.test = null; + * console.log(env.test); + * // => 'null' + * env.test = undefined; + * console.log(env.test); + * // => 'undefined' + * ``` + * + * Use `delete` to delete a property from `process.env`. + * + * ```js + * import { env } from 'node:process'; + * + * env.TEST = 1; + * delete env.TEST; + * console.log(env.TEST); + * // => undefined + * ``` + * + * On Windows operating systems, environment variables are case-insensitive. + * + * ```js + * import { env } from 'node:process'; + * + * env.TEST = 1; + * console.log(env.test); + * // => 1 + * ``` + * + * Unless explicitly specified when creating a `Worker` instance, + * each `Worker` thread has its own copy of `process.env`, based on its + * parent thread's `process.env`, or whatever was specified as the `env` option + * to the `Worker` constructor. Changes to `process.env` will not be visible + * across `Worker` threads, and only the main thread can make changes that + * are visible to the operating system or to native add-ons. On Windows, a copy of`process.env` on a `Worker` instance operates in a case-sensitive manner + * unlike the main thread. + * @since v0.1.27 + */ + env: ProcessEnv; + /** + * The `process.exit()` method instructs Node.js to terminate the process + * synchronously with an exit status of `code`. If `code` is omitted, exit uses + * either the 'success' code `0` or the value of `process.exitCode` if it has been + * set. Node.js will not terminate until all the `'exit'` event listeners are + * called. + * + * To exit with a 'failure' code: + * + * ```js + * import { exit } from 'node:process'; + * + * exit(1); + * ``` + * + * The shell that executed Node.js should see the exit code as `1`. + * + * Calling `process.exit()` will force the process to exit as quickly as possible + * even if there are still asynchronous operations pending that have not yet + * completed fully, including I/O operations to `process.stdout` and`process.stderr`. + * + * In most situations, it is not actually necessary to call `process.exit()`explicitly. The Node.js process will exit on its own _if there is no additional_ + * _work pending_ in the event loop. The `process.exitCode` property can be set to + * tell the process which exit code to use when the process exits gracefully. + * + * For instance, the following example illustrates a _misuse_ of the`process.exit()` method that could lead to data printed to stdout being + * truncated and lost: + * + * ```js + * import { exit } from 'node:process'; + * + * // This is an example of what *not* to do: + * if (someConditionNotMet()) { + * printUsageToStdout(); + * exit(1); + * } + * ``` + * + * The reason this is problematic is because writes to `process.stdout` in Node.js + * are sometimes _asynchronous_ and may occur over multiple ticks of the Node.js + * event loop. Calling `process.exit()`, however, forces the process to exit _before_ those additional writes to `stdout` can be performed. + * + * Rather than calling `process.exit()` directly, the code _should_ set the`process.exitCode` and allow the process to exit naturally by avoiding + * scheduling any additional work for the event loop: + * + * ```js + * import process from 'node:process'; + * + * // How to properly set the exit code while letting + * // the process exit gracefully. + * if (someConditionNotMet()) { + * printUsageToStdout(); + * process.exitCode = 1; + * } + * ``` + * + * If it is necessary to terminate the Node.js process due to an error condition, + * throwing an _uncaught_ error and allowing the process to terminate accordingly + * is safer than calling `process.exit()`. + * + * In `Worker` threads, this function stops the current thread rather + * than the current process. + * @since v0.1.13 + * @param [code=0] The exit code. For string type, only integer strings (e.g.,'1') are allowed. + */ + exit(code?: number): never; + /** + * A number which will be the process exit code, when the process either + * exits gracefully, or is exited via {@link exit} without specifying + * a code. + * + * Specifying a code to {@link exit} will override any + * previous setting of `process.exitCode`. + * @since v0.11.8 + */ + exitCode?: number | undefined; + /** + * The `process.getgid()` method returns the numerical group identity of the + * process. (See [`getgid(2)`](http://man7.org/linux/man-pages/man2/getgid.2.html).) + * + * ```js + * import process from 'process'; + * + * if (process.getgid) { + * console.log(`Current gid: ${process.getgid()}`); + * } + * ``` + * + * This function is only available on POSIX platforms (i.e. not Windows or + * Android). + * @since v0.1.31 + */ + getgid?: () => number; + /** + * The `process.setgid()` method sets the group identity of the process. (See [`setgid(2)`](http://man7.org/linux/man-pages/man2/setgid.2.html).) The `id` can be passed as either a + * numeric ID or a group name + * string. If a group name is specified, this method blocks while resolving the + * associated numeric ID. + * + * ```js + * import process from 'process'; + * + * if (process.getgid && process.setgid) { + * console.log(`Current gid: ${process.getgid()}`); + * try { + * process.setgid(501); + * console.log(`New gid: ${process.getgid()}`); + * } catch (err) { + * console.log(`Failed to set gid: ${err}`); + * } + * } + * ``` + * + * This function is only available on POSIX platforms (i.e. not Windows or + * Android). + * This feature is not available in `Worker` threads. + * @since v0.1.31 + * @param id The group name or ID + */ + setgid?: (id: number | string) => void; + /** + * The `process.getuid()` method returns the numeric user identity of the process. + * (See [`getuid(2)`](http://man7.org/linux/man-pages/man2/getuid.2.html).) + * + * ```js + * import process from 'process'; + * + * if (process.getuid) { + * console.log(`Current uid: ${process.getuid()}`); + * } + * ``` + * + * This function is only available on POSIX platforms (i.e. not Windows or + * Android). + * @since v0.1.28 + */ + getuid?: () => number; + /** + * The `process.setuid(id)` method sets the user identity of the process. (See [`setuid(2)`](http://man7.org/linux/man-pages/man2/setuid.2.html).) The `id` can be passed as either a + * numeric ID or a username string. + * If a username is specified, the method blocks while resolving the associated + * numeric ID. + * + * ```js + * import process from 'process'; + * + * if (process.getuid && process.setuid) { + * console.log(`Current uid: ${process.getuid()}`); + * try { + * process.setuid(501); + * console.log(`New uid: ${process.getuid()}`); + * } catch (err) { + * console.log(`Failed to set uid: ${err}`); + * } + * } + * ``` + * + * This function is only available on POSIX platforms (i.e. not Windows or + * Android). + * This feature is not available in `Worker` threads. + * @since v0.1.28 + */ + setuid?: (id: number | string) => void; + /** + * The `process.geteuid()` method returns the numerical effective user identity of + * the process. (See [`geteuid(2)`](http://man7.org/linux/man-pages/man2/geteuid.2.html).) + * + * ```js + * import process from 'process'; + * + * if (process.geteuid) { + * console.log(`Current uid: ${process.geteuid()}`); + * } + * ``` + * + * This function is only available on POSIX platforms (i.e. not Windows or + * Android). + * @since v2.0.0 + */ + geteuid?: () => number; + /** + * The `process.seteuid()` method sets the effective user identity of the process. + * (See [`seteuid(2)`](http://man7.org/linux/man-pages/man2/seteuid.2.html).) The `id` can be passed as either a numeric ID or a username + * string. If a username is specified, the method blocks while resolving the + * associated numeric ID. + * + * ```js + * import process from 'process'; + * + * if (process.geteuid && process.seteuid) { + * console.log(`Current uid: ${process.geteuid()}`); + * try { + * process.seteuid(501); + * console.log(`New uid: ${process.geteuid()}`); + * } catch (err) { + * console.log(`Failed to set uid: ${err}`); + * } + * } + * ``` + * + * This function is only available on POSIX platforms (i.e. not Windows or + * Android). + * This feature is not available in `Worker` threads. + * @since v2.0.0 + * @param id A user name or ID + */ + seteuid?: (id: number | string) => void; + /** + * The `process.getegid()` method returns the numerical effective group identity + * of the Node.js process. (See [`getegid(2)`](http://man7.org/linux/man-pages/man2/getegid.2.html).) + * + * ```js + * import process from 'process'; + * + * if (process.getegid) { + * console.log(`Current gid: ${process.getegid()}`); + * } + * ``` + * + * This function is only available on POSIX platforms (i.e. not Windows or + * Android). + * @since v2.0.0 + */ + getegid?: () => number; + /** + * The `process.setegid()` method sets the effective group identity of the process. + * (See [`setegid(2)`](http://man7.org/linux/man-pages/man2/setegid.2.html).) The `id` can be passed as either a numeric ID or a group + * name string. If a group name is specified, this method blocks while resolving + * the associated a numeric ID. + * + * ```js + * import process from 'process'; + * + * if (process.getegid && process.setegid) { + * console.log(`Current gid: ${process.getegid()}`); + * try { + * process.setegid(501); + * console.log(`New gid: ${process.getegid()}`); + * } catch (err) { + * console.log(`Failed to set gid: ${err}`); + * } + * } + * ``` + * + * This function is only available on POSIX platforms (i.e. not Windows or + * Android). + * This feature is not available in `Worker` threads. + * @since v2.0.0 + * @param id A group name or ID + */ + setegid?: (id: number | string) => void; + /** + * The `process.getgroups()` method returns an array with the supplementary group + * IDs. POSIX leaves it unspecified if the effective group ID is included but + * Node.js ensures it always is. + * + * ```js + * import process from 'process'; + * + * if (process.getgroups) { + * console.log(process.getgroups()); // [ 16, 21, 297 ] + * } + * ``` + * + * This function is only available on POSIX platforms (i.e. not Windows or + * Android). + * @since v0.9.4 + */ + getgroups?: () => number[]; + /** + * The `process.setgroups()` method sets the supplementary group IDs for the + * Node.js process. This is a privileged operation that requires the Node.js + * process to have `root` or the `CAP_SETGID` capability. + * + * The `groups` array can contain numeric group IDs, group names, or both. + * + * ```js + * import process from 'process'; + * + * if (process.getgroups && process.setgroups) { + * try { + * process.setgroups([501]); + * console.log(process.getgroups()); // new groups + * } catch (err) { + * console.log(`Failed to set groups: ${err}`); + * } + * } + * ``` + * + * This function is only available on POSIX platforms (i.e. not Windows or + * Android). + * This feature is not available in `Worker` threads. + * @since v0.9.4 + */ + setgroups?: (groups: ReadonlyArray) => void; + /** + * The `process.setUncaughtExceptionCaptureCallback()` function sets a function + * that will be invoked when an uncaught exception occurs, which will receive the + * exception value itself as its first argument. + * + * If such a function is set, the `'uncaughtException'` event will + * not be emitted. If `--abort-on-uncaught-exception` was passed from the + * command line or set through `v8.setFlagsFromString()`, the process will + * not abort. Actions configured to take place on exceptions such as report + * generations will be affected too + * + * To unset the capture function,`process.setUncaughtExceptionCaptureCallback(null)` may be used. Calling this + * method with a non-`null` argument while another capture function is set will + * throw an error. + * + * Using this function is mutually exclusive with using the deprecated `domain` built-in module. + * @since v9.3.0 + */ + setUncaughtExceptionCaptureCallback(cb: ((err: Error) => void) | null): void; + /** + * Indicates whether a callback has been set using {@link setUncaughtExceptionCaptureCallback}. + * @since v9.3.0 + */ + hasUncaughtExceptionCaptureCallback(): boolean; + /** + * The `process.version` property contains the Node.js version string. + * + * ```js + * import { version } from 'node:process'; + * + * console.log(`Version: ${version}`); + * // Version: v14.8.0 + * ``` + * + * To get the version string without the prepended _v_, use`process.versions.node`. + * @since v0.1.3 + */ + readonly version: string; + /** + * The `process.versions` property returns an object listing the version strings of + * Node.js and its dependencies. `process.versions.modules` indicates the current + * ABI version, which is increased whenever a C++ API changes. Node.js will refuse + * to load modules that were compiled against a different module ABI version. + * + * ```js + * import { versions } from 'node:process'; + * + * console.log(versions); + * ``` + * + * Will generate an object similar to: + * + * ```console + * { node: '20.2.0', + * acorn: '8.8.2', + * ada: '2.4.0', + * ares: '1.19.0', + * base64: '0.5.0', + * brotli: '1.0.9', + * cjs_module_lexer: '1.2.2', + * cldr: '43.0', + * icu: '73.1', + * llhttp: '8.1.0', + * modules: '115', + * napi: '8', + * nghttp2: '1.52.0', + * nghttp3: '0.7.0', + * ngtcp2: '0.8.1', + * openssl: '3.0.8+quic', + * simdutf: '3.2.9', + * tz: '2023c', + * undici: '5.22.0', + * unicode: '15.0', + * uv: '1.44.2', + * uvwasi: '0.0.16', + * v8: '11.3.244.8-node.9', + * zlib: '1.2.13' } + * ``` + * @since v0.2.0 + */ + readonly versions: ProcessVersions; + /** + * The `process.config` property returns a frozen `Object` containing the + * JavaScript representation of the configure options used to compile the current + * Node.js executable. This is the same as the `config.gypi` file that was produced + * when running the `./configure` script. + * + * An example of the possible output looks like: + * + * ```js + * { + * target_defaults: + * { cflags: [], + * default_configuration: 'Release', + * defines: [], + * include_dirs: [], + * libraries: [] }, + * variables: + * { + * host_arch: 'x64', + * napi_build_version: 5, + * node_install_npm: 'true', + * node_prefix: '', + * node_shared_cares: 'false', + * node_shared_http_parser: 'false', + * node_shared_libuv: 'false', + * node_shared_zlib: 'false', + * node_use_openssl: 'true', + * node_shared_openssl: 'false', + * strict_aliasing: 'true', + * target_arch: 'x64', + * v8_use_snapshot: 1 + * } + * } + * ``` + * @since v0.7.7 + */ + readonly config: ProcessConfig; + /** + * The `process.kill()` method sends the `signal` to the process identified by`pid`. + * + * Signal names are strings such as `'SIGINT'` or `'SIGHUP'`. See `Signal Events` and [`kill(2)`](http://man7.org/linux/man-pages/man2/kill.2.html) for more information. + * + * This method will throw an error if the target `pid` does not exist. As a special + * case, a signal of `0` can be used to test for the existence of a process. + * Windows platforms will throw an error if the `pid` is used to kill a process + * group. + * + * Even though the name of this function is `process.kill()`, it is really just a + * signal sender, like the `kill` system call. The signal sent may do something + * other than kill the target process. + * + * ```js + * import process, { kill } from 'node:process'; + * + * process.on('SIGHUP', () => { + * console.log('Got SIGHUP signal.'); + * }); + * + * setTimeout(() => { + * console.log('Exiting.'); + * process.exit(0); + * }, 100); + * + * kill(process.pid, 'SIGHUP'); + * ``` + * + * When `SIGUSR1` is received by a Node.js process, Node.js will start the + * debugger. See `Signal Events`. + * @since v0.0.6 + * @param pid A process ID + * @param [signal='SIGTERM'] The signal to send, either as a string or number. + */ + kill(pid: number, signal?: string | number): true; + /** + * The `process.pid` property returns the PID of the process. + * + * ```js + * import { pid } from 'node:process'; + * + * console.log(`This process is pid ${pid}`); + * ``` + * @since v0.1.15 + */ + readonly pid: number; + /** + * The `process.ppid` property returns the PID of the parent of the + * current process. + * + * ```js + * import { ppid } from 'node:process'; + * + * console.log(`The parent process is pid ${ppid}`); + * ``` + * @since v9.2.0, v8.10.0, v6.13.0 + */ + readonly ppid: number; + /** + * The `process.title` property returns the current process title (i.e. returns + * the current value of `ps`). Assigning a new value to `process.title` modifies + * the current value of `ps`. + * + * When a new value is assigned, different platforms will impose different maximum + * length restrictions on the title. Usually such restrictions are quite limited. + * For instance, on Linux and macOS, `process.title` is limited to the size of the + * binary name plus the length of the command-line arguments because setting the`process.title` overwrites the `argv` memory of the process. Node.js v0.8 + * allowed for longer process title strings by also overwriting the `environ`memory but that was potentially insecure and confusing in some (rather obscure) + * cases. + * + * Assigning a value to `process.title` might not result in an accurate label + * within process manager applications such as macOS Activity Monitor or Windows + * Services Manager. + * @since v0.1.104 + */ + title: string; + /** + * The operating system CPU architecture for which the Node.js binary was compiled. + * Possible values are: `'arm'`, `'arm64'`, `'ia32'`, `'mips'`,`'mipsel'`, `'ppc'`,`'ppc64'`, `'s390'`, `'s390x'`, and `'x64'`. + * + * ```js + * import { arch } from 'node:process'; + * + * console.log(`This processor architecture is ${arch}`); + * ``` + * @since v0.5.0 + */ + readonly arch: Architecture; + /** + * The `process.platform` property returns a string identifying the operating + * system platform for which the Node.js binary was compiled. + * + * Currently possible values are: + * + * * `'aix'` + * * `'darwin'` + * * `'freebsd'` + * * `'linux'` + * * `'openbsd'` + * * `'sunos'` + * * `'win32'` + * + * ```js + * import { platform } from 'node:process'; + * + * console.log(`This platform is ${platform}`); + * ``` + * + * The value `'android'` may also be returned if the Node.js is built on the + * Android operating system. However, Android support in Node.js [is experimental](https://github.com/nodejs/node/blob/HEAD/BUILDING.md#androidandroid-based-devices-eg-firefox-os). + * @since v0.1.16 + */ + readonly platform: Platform; + /** + * The `process.mainModule` property provides an alternative way of retrieving `require.main`. The difference is that if the main module changes at + * runtime, `require.main` may still refer to the original main module in + * modules that were required before the change occurred. Generally, it's + * safe to assume that the two refer to the same module. + * + * As with `require.main`, `process.mainModule` will be `undefined` if there + * is no entry script. + * @since v0.1.17 + * @deprecated Since v14.0.0 - Use `main` instead. + */ + mainModule?: Module | undefined; + memoryUsage: MemoryUsageFn; + /** + * Gets the amount of memory available to the process (in bytes) based on + * limits imposed by the OS. If there is no such constraint, or the constraint + * is unknown, `undefined` is returned. + * + * See [`uv_get_constrained_memory`](https://docs.libuv.org/en/v1.x/misc.html#c.uv_get_constrained_memory) for more + * information. + * @since v19.6.0, v18.15.0 + * @experimental + */ + constrainedMemory(): number | undefined; + /** + * The `process.cpuUsage()` method returns the user and system CPU time usage of + * the current process, in an object with properties `user` and `system`, whose + * values are microsecond values (millionth of a second). These values measure time + * spent in user and system code respectively, and may end up being greater than + * actual elapsed time if multiple CPU cores are performing work for this process. + * + * The result of a previous call to `process.cpuUsage()` can be passed as the + * argument to the function, to get a diff reading. + * + * ```js + * import { cpuUsage } from 'node:process'; + * + * const startUsage = cpuUsage(); + * // { user: 38579, system: 6986 } + * + * // spin the CPU for 500 milliseconds + * const now = Date.now(); + * while (Date.now() - now < 500); + * + * console.log(cpuUsage(startUsage)); + * // { user: 514883, system: 11226 } + * ``` + * @since v6.1.0 + * @param previousValue A previous return value from calling `process.cpuUsage()` + */ + cpuUsage(previousValue?: CpuUsage): CpuUsage; + /** + * `process.nextTick()` adds `callback` to the "next tick queue". This queue is + * fully drained after the current operation on the JavaScript stack runs to + * completion and before the event loop is allowed to continue. It's possible to + * create an infinite loop if one were to recursively call `process.nextTick()`. + * See the [Event Loop](https://nodejs.org/en/docs/guides/event-loop-timers-and-nexttick/#process-nexttick) guide for more background. + * + * ```js + * import { nextTick } from 'node:process'; + * + * console.log('start'); + * nextTick(() => { + * console.log('nextTick callback'); + * }); + * console.log('scheduled'); + * // Output: + * // start + * // scheduled + * // nextTick callback + * ``` + * + * This is important when developing APIs in order to give users the opportunity + * to assign event handlers _after_ an object has been constructed but before any + * I/O has occurred: + * + * ```js + * import { nextTick } from 'node:process'; + * + * function MyThing(options) { + * this.setupOptions(options); + * + * nextTick(() => { + * this.startDoingStuff(); + * }); + * } + * + * const thing = new MyThing(); + * thing.getReadyForStuff(); + * + * // thing.startDoingStuff() gets called now, not before. + * ``` + * + * It is very important for APIs to be either 100% synchronous or 100% + * asynchronous. Consider this example: + * + * ```js + * // WARNING! DO NOT USE! BAD UNSAFE HAZARD! + * function maybeSync(arg, cb) { + * if (arg) { + * cb(); + * return; + * } + * + * fs.stat('file', cb); + * } + * ``` + * + * This API is hazardous because in the following case: + * + * ```js + * const maybeTrue = Math.random() > 0.5; + * + * maybeSync(maybeTrue, () => { + * foo(); + * }); + * + * bar(); + * ``` + * + * It is not clear whether `foo()` or `bar()` will be called first. + * + * The following approach is much better: + * + * ```js + * import { nextTick } from 'node:process'; + * + * function definitelyAsync(arg, cb) { + * if (arg) { + * nextTick(cb); + * return; + * } + * + * fs.stat('file', cb); + * } + * ``` + * @since v0.1.26 + * @param args Additional arguments to pass when invoking the `callback` + */ + nextTick(callback: Function, ...args: any[]): void; + /** + * The `process.release` property returns an `Object` containing metadata related + * to the current release, including URLs for the source tarball and headers-only + * tarball. + * + * `process.release` contains the following properties: + * + * ```js + * { + * name: 'node', + * lts: 'Hydrogen', + * sourceUrl: 'https://nodejs.org/download/release/v18.12.0/node-v18.12.0.tar.gz', + * headersUrl: 'https://nodejs.org/download/release/v18.12.0/node-v18.12.0-headers.tar.gz', + * libUrl: 'https://nodejs.org/download/release/v18.12.0/win-x64/node.lib' + * } + * ``` + * + * In custom builds from non-release versions of the source tree, only the`name` property may be present. The additional properties should not be + * relied upon to exist. + * @since v3.0.0 + */ + readonly release: ProcessRelease; + features: { + inspector: boolean; + debug: boolean; + uv: boolean; + ipv6: boolean; + tls_alpn: boolean; + tls_sni: boolean; + tls_ocsp: boolean; + tls: boolean; + }; + /** + * `process.umask()` returns the Node.js process's file mode creation mask. Child + * processes inherit the mask from the parent process. + * @since v0.1.19 + * @deprecated Calling `process.umask()` with no argument causes the process-wide umask to be written twice. This introduces a race condition between threads, and is a potential * + * security vulnerability. There is no safe, cross-platform alternative API. + */ + umask(): number; + /** + * Can only be set if not in worker thread. + */ + umask(mask: string | number): number; + /** + * The `process.uptime()` method returns the number of seconds the current Node.js + * process has been running. + * + * The return value includes fractions of a second. Use `Math.floor()` to get whole + * seconds. + * @since v0.5.0 + */ + uptime(): number; + hrtime: HRTime; + /** + * If Node.js is spawned with an IPC channel, the `process.send()` method can be + * used to send messages to the parent process. Messages will be received as a `'message'` event on the parent's `ChildProcess` object. + * + * If Node.js was not spawned with an IPC channel, `process.send` will be `undefined`. + * + * The message goes through serialization and parsing. The resulting message might + * not be the same as what is originally sent. + * @since v0.5.9 + * @param options used to parameterize the sending of certain types of handles.`options` supports the following properties: + */ + send?( + message: any, + sendHandle?: any, + options?: { + swallowErrors?: boolean | undefined; + }, + callback?: (error: Error | null) => void + ): boolean; + /** + * If the Node.js process is spawned with an IPC channel (see the `Child Process` and `Cluster` documentation), the `process.disconnect()` method will close the + * IPC channel to the parent process, allowing the child process to exit gracefully + * once there are no other connections keeping it alive. + * + * The effect of calling `process.disconnect()` is the same as calling `ChildProcess.disconnect()` from the parent process. + * + * If the Node.js process was not spawned with an IPC channel,`process.disconnect()` will be `undefined`. + * @since v0.7.2 + */ + disconnect(): void; + /** + * If the Node.js process is spawned with an IPC channel (see the `Child Process` and `Cluster` documentation), the `process.connected` property will return`true` so long as the IPC + * channel is connected and will return `false` after`process.disconnect()` is called. + * + * Once `process.connected` is `false`, it is no longer possible to send messages + * over the IPC channel using `process.send()`. + * @since v0.7.2 + */ + connected: boolean; + /** + * The `process.allowedNodeEnvironmentFlags` property is a special, + * read-only `Set` of flags allowable within the `NODE_OPTIONS` environment variable. + * + * `process.allowedNodeEnvironmentFlags` extends `Set`, but overrides`Set.prototype.has` to recognize several different possible flag + * representations. `process.allowedNodeEnvironmentFlags.has()` will + * return `true` in the following cases: + * + * * Flags may omit leading single (`-`) or double (`--`) dashes; e.g.,`inspect-brk` for `--inspect-brk`, or `r` for `-r`. + * * Flags passed through to V8 (as listed in `--v8-options`) may replace + * one or more _non-leading_ dashes for an underscore, or vice-versa; + * e.g., `--perf_basic_prof`, `--perf-basic-prof`, `--perf_basic-prof`, + * etc. + * * Flags may contain one or more equals (`=`) characters; all + * characters after and including the first equals will be ignored; + * e.g., `--stack-trace-limit=100`. + * * Flags _must_ be allowable within `NODE_OPTIONS`. + * + * When iterating over `process.allowedNodeEnvironmentFlags`, flags will + * appear only _once_; each will begin with one or more dashes. Flags + * passed through to V8 will contain underscores instead of non-leading + * dashes: + * + * ```js + * import { allowedNodeEnvironmentFlags } from 'node:process'; + * + * allowedNodeEnvironmentFlags.forEach((flag) => { + * // -r + * // --inspect-brk + * // --abort_on_uncaught_exception + * // ... + * }); + * ``` + * + * The methods `add()`, `clear()`, and `delete()` of`process.allowedNodeEnvironmentFlags` do nothing, and will fail + * silently. + * + * If Node.js was compiled _without_ `NODE_OPTIONS` support (shown in {@link config}), `process.allowedNodeEnvironmentFlags` will + * contain what _would have_ been allowable. + * @since v10.10.0 + */ + allowedNodeEnvironmentFlags: ReadonlySet; + /** + * `process.report` is an object whose methods are used to generate diagnostic + * reports for the current process. Additional documentation is available in the `report documentation`. + * @since v11.8.0 + */ + report?: ProcessReport | undefined; + /** + * ```js + * import { resourceUsage } from 'node:process'; + * + * console.log(resourceUsage()); + * /* + * Will output: + * { + * userCPUTime: 82872, + * systemCPUTime: 4143, + * maxRSS: 33164, + * sharedMemorySize: 0, + * unsharedDataSize: 0, + * unsharedStackSize: 0, + * minorPageFault: 2469, + * majorPageFault: 0, + * swappedOut: 0, + * fsRead: 0, + * fsWrite: 8, + * ipcSent: 0, + * ipcReceived: 0, + * signalsCount: 0, + * voluntaryContextSwitches: 79, + * involuntaryContextSwitches: 1 + * } + * + * ``` + * @since v12.6.0 + * @return the resource usage for the current process. All of these values come from the `uv_getrusage` call which returns a [`uv_rusage_t` struct][uv_rusage_t]. + */ + resourceUsage(): ResourceUsage; + /** + * The `process.traceDeprecation` property indicates whether the`--trace-deprecation` flag is set on the current Node.js process. See the + * documentation for the `'warning' event` and the `emitWarning() method` for more information about this + * flag's behavior. + * @since v0.8.0 + */ + traceDeprecation: boolean; + /* EventEmitter */ + addListener(event: 'beforeExit', listener: BeforeExitListener): this; + addListener(event: 'disconnect', listener: DisconnectListener): this; + addListener(event: 'exit', listener: ExitListener): this; + addListener(event: 'rejectionHandled', listener: RejectionHandledListener): this; + addListener(event: 'uncaughtException', listener: UncaughtExceptionListener): this; + addListener(event: 'uncaughtExceptionMonitor', listener: UncaughtExceptionListener): this; + addListener(event: 'unhandledRejection', listener: UnhandledRejectionListener): this; + addListener(event: 'warning', listener: WarningListener): this; + addListener(event: 'message', listener: MessageListener): this; + addListener(event: Signals, listener: SignalsListener): this; + addListener(event: 'multipleResolves', listener: MultipleResolveListener): this; + addListener(event: 'worker', listener: WorkerListener): this; + emit(event: 'beforeExit', code: number): boolean; + emit(event: 'disconnect'): boolean; + emit(event: 'exit', code: number): boolean; + emit(event: 'rejectionHandled', promise: Promise): boolean; + emit(event: 'uncaughtException', error: Error): boolean; + emit(event: 'uncaughtExceptionMonitor', error: Error): boolean; + emit(event: 'unhandledRejection', reason: unknown, promise: Promise): boolean; + emit(event: 'warning', warning: Error): boolean; + emit(event: 'message', message: unknown, sendHandle: unknown): this; + emit(event: Signals, signal?: Signals): boolean; + emit(event: 'multipleResolves', type: MultipleResolveType, promise: Promise, value: unknown): this; + emit(event: 'worker', listener: WorkerListener): this; + on(event: 'beforeExit', listener: BeforeExitListener): this; + on(event: 'disconnect', listener: DisconnectListener): this; + on(event: 'exit', listener: ExitListener): this; + on(event: 'rejectionHandled', listener: RejectionHandledListener): this; + on(event: 'uncaughtException', listener: UncaughtExceptionListener): this; + on(event: 'uncaughtExceptionMonitor', listener: UncaughtExceptionListener): this; + on(event: 'unhandledRejection', listener: UnhandledRejectionListener): this; + on(event: 'warning', listener: WarningListener): this; + on(event: 'message', listener: MessageListener): this; + on(event: Signals, listener: SignalsListener): this; + on(event: 'multipleResolves', listener: MultipleResolveListener): this; + on(event: 'worker', listener: WorkerListener): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + once(event: 'beforeExit', listener: BeforeExitListener): this; + once(event: 'disconnect', listener: DisconnectListener): this; + once(event: 'exit', listener: ExitListener): this; + once(event: 'rejectionHandled', listener: RejectionHandledListener): this; + once(event: 'uncaughtException', listener: UncaughtExceptionListener): this; + once(event: 'uncaughtExceptionMonitor', listener: UncaughtExceptionListener): this; + once(event: 'unhandledRejection', listener: UnhandledRejectionListener): this; + once(event: 'warning', listener: WarningListener): this; + once(event: 'message', listener: MessageListener): this; + once(event: Signals, listener: SignalsListener): this; + once(event: 'multipleResolves', listener: MultipleResolveListener): this; + once(event: 'worker', listener: WorkerListener): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + prependListener(event: 'beforeExit', listener: BeforeExitListener): this; + prependListener(event: 'disconnect', listener: DisconnectListener): this; + prependListener(event: 'exit', listener: ExitListener): this; + prependListener(event: 'rejectionHandled', listener: RejectionHandledListener): this; + prependListener(event: 'uncaughtException', listener: UncaughtExceptionListener): this; + prependListener(event: 'uncaughtExceptionMonitor', listener: UncaughtExceptionListener): this; + prependListener(event: 'unhandledRejection', listener: UnhandledRejectionListener): this; + prependListener(event: 'warning', listener: WarningListener): this; + prependListener(event: 'message', listener: MessageListener): this; + prependListener(event: Signals, listener: SignalsListener): this; + prependListener(event: 'multipleResolves', listener: MultipleResolveListener): this; + prependListener(event: 'worker', listener: WorkerListener): this; + prependOnceListener(event: 'beforeExit', listener: BeforeExitListener): this; + prependOnceListener(event: 'disconnect', listener: DisconnectListener): this; + prependOnceListener(event: 'exit', listener: ExitListener): this; + prependOnceListener(event: 'rejectionHandled', listener: RejectionHandledListener): this; + prependOnceListener(event: 'uncaughtException', listener: UncaughtExceptionListener): this; + prependOnceListener(event: 'uncaughtExceptionMonitor', listener: UncaughtExceptionListener): this; + prependOnceListener(event: 'unhandledRejection', listener: UnhandledRejectionListener): this; + prependOnceListener(event: 'warning', listener: WarningListener): this; + prependOnceListener(event: 'message', listener: MessageListener): this; + prependOnceListener(event: Signals, listener: SignalsListener): this; + prependOnceListener(event: 'multipleResolves', listener: MultipleResolveListener): this; + prependOnceListener(event: 'worker', listener: WorkerListener): this; + listeners(event: 'beforeExit'): BeforeExitListener[]; + listeners(event: 'disconnect'): DisconnectListener[]; + listeners(event: 'exit'): ExitListener[]; + listeners(event: 'rejectionHandled'): RejectionHandledListener[]; + listeners(event: 'uncaughtException'): UncaughtExceptionListener[]; + listeners(event: 'uncaughtExceptionMonitor'): UncaughtExceptionListener[]; + listeners(event: 'unhandledRejection'): UnhandledRejectionListener[]; + listeners(event: 'warning'): WarningListener[]; + listeners(event: 'message'): MessageListener[]; + listeners(event: Signals): SignalsListener[]; + listeners(event: 'multipleResolves'): MultipleResolveListener[]; + listeners(event: 'worker'): WorkerListener[]; + } + } + } + export = process; +} +declare module 'process' { + import process = require('node:process'); + export = process; +} diff --git a/node_modules/@types/node/ts4.8/punycode.d.ts b/node_modules/@types/node/ts4.8/punycode.d.ts new file mode 100644 index 0000000..60aca0d --- /dev/null +++ b/node_modules/@types/node/ts4.8/punycode.d.ts @@ -0,0 +1,117 @@ +/** + * **The version of the punycode module bundled in Node.js is being deprecated.**In a future major version of Node.js this module will be removed. Users + * currently depending on the `punycode` module should switch to using the + * userland-provided [Punycode.js](https://github.com/bestiejs/punycode.js) module instead. For punycode-based URL + * encoding, see `url.domainToASCII` or, more generally, the `WHATWG URL API`. + * + * The `punycode` module is a bundled version of the [Punycode.js](https://github.com/bestiejs/punycode.js) module. It + * can be accessed using: + * + * ```js + * const punycode = require('punycode'); + * ``` + * + * [Punycode](https://tools.ietf.org/html/rfc3492) is a character encoding scheme defined by RFC 3492 that is + * primarily intended for use in Internationalized Domain Names. Because host + * names in URLs are limited to ASCII characters only, Domain Names that contain + * non-ASCII characters must be converted into ASCII using the Punycode scheme. + * For instance, the Japanese character that translates into the English word,`'example'` is `'例'`. The Internationalized Domain Name, `'例.com'` (equivalent + * to `'example.com'`) is represented by Punycode as the ASCII string`'xn--fsq.com'`. + * + * The `punycode` module provides a simple implementation of the Punycode standard. + * + * The `punycode` module is a third-party dependency used by Node.js and + * made available to developers as a convenience. Fixes or other modifications to + * the module must be directed to the [Punycode.js](https://github.com/bestiejs/punycode.js) project. + * @deprecated Since v7.0.0 - Deprecated + * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/punycode.js) + */ +declare module 'node:punycode' { + /** + * The `punycode.decode()` method converts a [Punycode](https://tools.ietf.org/html/rfc3492) string of ASCII-only + * characters to the equivalent string of Unicode codepoints. + * + * ```js + * punycode.decode('maana-pta'); // 'mañana' + * punycode.decode('--dqo34k'); // '☃-⌘' + * ``` + * @since v0.5.1 + */ + function decode(string: string): string; + /** + * The `punycode.encode()` method converts a string of Unicode codepoints to a [Punycode](https://tools.ietf.org/html/rfc3492) string of ASCII-only characters. + * + * ```js + * punycode.encode('mañana'); // 'maana-pta' + * punycode.encode('☃-⌘'); // '--dqo34k' + * ``` + * @since v0.5.1 + */ + function encode(string: string): string; + /** + * The `punycode.toUnicode()` method converts a string representing a domain name + * containing [Punycode](https://tools.ietf.org/html/rfc3492) encoded characters into Unicode. Only the [Punycode](https://tools.ietf.org/html/rfc3492) encoded parts of the domain name are be + * converted. + * + * ```js + * // decode domain names + * punycode.toUnicode('xn--maana-pta.com'); // 'mañana.com' + * punycode.toUnicode('xn----dqo34k.com'); // '☃-⌘.com' + * punycode.toUnicode('example.com'); // 'example.com' + * ``` + * @since v0.6.1 + */ + function toUnicode(domain: string): string; + /** + * The `punycode.toASCII()` method converts a Unicode string representing an + * Internationalized Domain Name to [Punycode](https://tools.ietf.org/html/rfc3492). Only the non-ASCII parts of the + * domain name will be converted. Calling `punycode.toASCII()` on a string that + * already only contains ASCII characters will have no effect. + * + * ```js + * // encode domain names + * punycode.toASCII('mañana.com'); // 'xn--maana-pta.com' + * punycode.toASCII('☃-⌘.com'); // 'xn----dqo34k.com' + * punycode.toASCII('example.com'); // 'example.com' + * ``` + * @since v0.6.1 + */ + function toASCII(domain: string): string; + /** + * @deprecated since v7.0.0 + * The version of the punycode module bundled in Node.js is being deprecated. + * In a future major version of Node.js this module will be removed. + * Users currently depending on the punycode module should switch to using + * the userland-provided Punycode.js module instead. + */ + const ucs2: ucs2; + interface ucs2 { + /** + * @deprecated since v7.0.0 + * The version of the punycode module bundled in Node.js is being deprecated. + * In a future major version of Node.js this module will be removed. + * Users currently depending on the punycode module should switch to using + * the userland-provided Punycode.js module instead. + */ + decode(string: string): number[]; + /** + * @deprecated since v7.0.0 + * The version of the punycode module bundled in Node.js is being deprecated. + * In a future major version of Node.js this module will be removed. + * Users currently depending on the punycode module should switch to using + * the userland-provided Punycode.js module instead. + */ + encode(codePoints: ReadonlyArray): string; + } + /** + * @deprecated since v7.0.0 + * The version of the punycode module bundled in Node.js is being deprecated. + * In a future major version of Node.js this module will be removed. + * Users currently depending on the punycode module should switch to using + * the userland-provided Punycode.js module instead. + */ + const version: string; +} +declare module 'punycode' { + export * from 'node:punycode'; +} diff --git a/node_modules/@types/node/ts4.8/querystring.d.ts b/node_modules/@types/node/ts4.8/querystring.d.ts new file mode 100644 index 0000000..d9ff201 --- /dev/null +++ b/node_modules/@types/node/ts4.8/querystring.d.ts @@ -0,0 +1,131 @@ +/** + * The `node:querystring` module provides utilities for parsing and formatting URL + * query strings. It can be accessed using: + * + * ```js + * const querystring = require('node:querystring'); + * ``` + * + * `querystring` is more performant than `URLSearchParams` but is not a + * standardized API. Use `URLSearchParams` when performance is not critical or + * when compatibility with browser code is desirable. + * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/querystring.js) + */ +declare module 'node:querystring' { + interface StringifyOptions { + encodeURIComponent?: ((str: string) => string) | undefined; + } + interface ParseOptions { + maxKeys?: number | undefined; + decodeURIComponent?: ((str: string) => string) | undefined; + } + interface ParsedUrlQuery extends NodeJS.Dict {} + interface ParsedUrlQueryInput extends NodeJS.Dict | ReadonlyArray | ReadonlyArray | null> {} + /** + * The `querystring.stringify()` method produces a URL query string from a + * given `obj` by iterating through the object's "own properties". + * + * It serializes the following types of values passed in `obj`:[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type) | + * [number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type) | + * [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) | + * [boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type) | + * [string\[\]](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type) | + * [number\[\]](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type) | + * [bigint\[\]](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) | + * [boolean\[\]](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type) The numeric values must be finite. Any other input values will be coerced to + * empty strings. + * + * ```js + * querystring.stringify({ foo: 'bar', baz: ['qux', 'quux'], corge: '' }); + * // Returns 'foo=bar&baz=qux&baz=quux&corge=' + * + * querystring.stringify({ foo: 'bar', baz: 'qux' }, ';', ':'); + * // Returns 'foo:bar;baz:qux' + * ``` + * + * By default, characters requiring percent-encoding within the query string will + * be encoded as UTF-8\. If an alternative encoding is required, then an alternative`encodeURIComponent` option will need to be specified: + * + * ```js + * // Assuming gbkEncodeURIComponent function already exists, + * + * querystring.stringify({ w: '中文', foo: 'bar' }, null, null, + * { encodeURIComponent: gbkEncodeURIComponent }); + * ``` + * @since v0.1.25 + * @param obj The object to serialize into a URL query string + * @param [sep='&'] The substring used to delimit key and value pairs in the query string. + * @param [eq='='] . The substring used to delimit keys and values in the query string. + */ + function stringify(obj?: ParsedUrlQueryInput, sep?: string, eq?: string, options?: StringifyOptions): string; + /** + * The `querystring.parse()` method parses a URL query string (`str`) into a + * collection of key and value pairs. + * + * For example, the query string `'foo=bar&abc=xyz&abc=123'` is parsed into: + * + * ```js + * { + * foo: 'bar', + * abc: ['xyz', '123'] + * } + * ``` + * + * The object returned by the `querystring.parse()` method _does not_prototypically inherit from the JavaScript `Object`. This means that typical`Object` methods such as `obj.toString()`, + * `obj.hasOwnProperty()`, and others + * are not defined and _will not work_. + * + * By default, percent-encoded characters within the query string will be assumed + * to use UTF-8 encoding. If an alternative character encoding is used, then an + * alternative `decodeURIComponent` option will need to be specified: + * + * ```js + * // Assuming gbkDecodeURIComponent function already exists... + * + * querystring.parse('w=%D6%D0%CE%C4&foo=bar', null, null, + * { decodeURIComponent: gbkDecodeURIComponent }); + * ``` + * @since v0.1.25 + * @param str The URL query string to parse + * @param [sep='&'] The substring used to delimit key and value pairs in the query string. + * @param [eq='='] . The substring used to delimit keys and values in the query string. + */ + function parse(str: string, sep?: string, eq?: string, options?: ParseOptions): ParsedUrlQuery; + /** + * The querystring.encode() function is an alias for querystring.stringify(). + */ + const encode: typeof stringify; + /** + * The querystring.decode() function is an alias for querystring.parse(). + */ + const decode: typeof parse; + /** + * The `querystring.escape()` method performs URL percent-encoding on the given`str` in a manner that is optimized for the specific requirements of URL + * query strings. + * + * The `querystring.escape()` method is used by `querystring.stringify()` and is + * generally not expected to be used directly. It is exported primarily to allow + * application code to provide a replacement percent-encoding implementation if + * necessary by assigning `querystring.escape` to an alternative function. + * @since v0.1.25 + */ + function escape(str: string): string; + /** + * The `querystring.unescape()` method performs decoding of URL percent-encoded + * characters on the given `str`. + * + * The `querystring.unescape()` method is used by `querystring.parse()` and is + * generally not expected to be used directly. It is exported primarily to allow + * application code to provide a replacement decoding implementation if + * necessary by assigning `querystring.unescape` to an alternative function. + * + * By default, the `querystring.unescape()` method will attempt to use the + * JavaScript built-in `decodeURIComponent()` method to decode. If that fails, + * a safer equivalent that does not throw on malformed URLs will be used. + * @since v0.1.25 + */ + function unescape(str: string): string; +} +declare module 'querystring' { + export * from 'node:querystring'; +} diff --git a/node_modules/@types/node/ts4.8/readline.d.ts b/node_modules/@types/node/ts4.8/readline.d.ts new file mode 100644 index 0000000..76d8671 --- /dev/null +++ b/node_modules/@types/node/ts4.8/readline.d.ts @@ -0,0 +1,526 @@ +/** + * The `node:readline` module provides an interface for reading data from a `Readable` stream (such as `process.stdin`) one line at a time. + * + * To use the promise-based APIs: + * + * ```js + * import * as readline from 'node:readline/promises'; + * ``` + * + * To use the callback and sync APIs: + * + * ```js + * import * as readline from 'node:readline'; + * ``` + * + * The following simple example illustrates the basic use of the `node:readline`module. + * + * ```js + * import * as readline from 'node:readline/promises'; + * import { stdin as input, stdout as output } from 'node:process'; + * + * const rl = readline.createInterface({ input, output }); + * + * const answer = await rl.question('What do you think of Node.js? '); + * + * console.log(`Thank you for your valuable feedback: ${answer}`); + * + * rl.close(); + * ``` + * + * Once this code is invoked, the Node.js application will not terminate until the`readline.Interface` is closed because the interface waits for data to be + * received on the `input` stream. + * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/readline.js) + */ +declare module 'node:readline' { + import { Abortable, EventEmitter } from 'node:events'; + import * as promises from 'node:readline/promises'; + export { promises }; + export interface Key { + sequence?: string | undefined; + name?: string | undefined; + ctrl?: boolean | undefined; + meta?: boolean | undefined; + shift?: boolean | undefined; + } + /** + * Instances of the `readline.Interface` class are constructed using the`readline.createInterface()` method. Every instance is associated with a + * single `input` `Readable` stream and a single `output` `Writable` stream. + * The `output` stream is used to print prompts for user input that arrives on, + * and is read from, the `input` stream. + * @since v0.1.104 + */ + export class Interface extends EventEmitter { + readonly terminal: boolean; + /** + * The current input data being processed by node. + * + * This can be used when collecting input from a TTY stream to retrieve the + * current value that has been processed thus far, prior to the `line` event + * being emitted. Once the `line` event has been emitted, this property will + * be an empty string. + * + * Be aware that modifying the value during the instance runtime may have + * unintended consequences if `rl.cursor` is not also controlled. + * + * **If not using a TTY stream for input, use the `'line'` event.** + * + * One possible use case would be as follows: + * + * ```js + * const values = ['lorem ipsum', 'dolor sit amet']; + * const rl = readline.createInterface(process.stdin); + * const showResults = debounce(() => { + * console.log( + * '\n', + * values.filter((val) => val.startsWith(rl.line)).join(' '), + * ); + * }, 300); + * process.stdin.on('keypress', (c, k) => { + * showResults(); + * }); + * ``` + * @since v0.1.98 + */ + readonly line: string; + /** + * The cursor position relative to `rl.line`. + * + * This will track where the current cursor lands in the input string, when + * reading input from a TTY stream. The position of cursor determines the + * portion of the input string that will be modified as input is processed, + * as well as the column where the terminal caret will be rendered. + * @since v0.1.98 + */ + readonly cursor: number; + /** + * NOTE: According to the documentation: + * + * > Instances of the `readline.Interface` class are constructed using the + * > `readline.createInterface()` method. + * + * @see https://nodejs.org/dist/latest-v20.x/docs/api/readline.html#class-interfaceconstructor + */ + protected constructor(input: NodeJS.ReadableStream, output?: NodeJS.WritableStream, completer?: Completer | AsyncCompleter, terminal?: boolean); + /** + * NOTE: According to the documentation: + * + * > Instances of the `readline.Interface` class are constructed using the + * > `readline.createInterface()` method. + * + * @see https://nodejs.org/dist/latest-v20.x/docs/api/readline.html#class-interfaceconstructor + */ + protected constructor(options: ReadLineOptions); + /** + * The `rl.getPrompt()` method returns the current prompt used by `rl.prompt()`. + * @since v15.3.0, v14.17.0 + * @return the current prompt string + */ + getPrompt(): string; + /** + * The `rl.setPrompt()` method sets the prompt that will be written to `output`whenever `rl.prompt()` is called. + * @since v0.1.98 + */ + setPrompt(prompt: string): void; + /** + * The `rl.prompt()` method writes the `Interface` instances configured`prompt` to a new line in `output` in order to provide a user with a new + * location at which to provide input. + * + * When called, `rl.prompt()` will resume the `input` stream if it has been + * paused. + * + * If the `Interface` was created with `output` set to `null` or`undefined` the prompt is not written. + * @since v0.1.98 + * @param preserveCursor If `true`, prevents the cursor placement from being reset to `0`. + */ + prompt(preserveCursor?: boolean): void; + /** + * The `rl.question()` method displays the `query` by writing it to the `output`, + * waits for user input to be provided on `input`, then invokes the `callback`function passing the provided input as the first argument. + * + * When called, `rl.question()` will resume the `input` stream if it has been + * paused. + * + * If the `Interface` was created with `output` set to `null` or`undefined` the `query` is not written. + * + * The `callback` function passed to `rl.question()` does not follow the typical + * pattern of accepting an `Error` object or `null` as the first argument. + * The `callback` is called with the provided answer as the only argument. + * + * An error will be thrown if calling `rl.question()` after `rl.close()`. + * + * Example usage: + * + * ```js + * rl.question('What is your favorite food? ', (answer) => { + * console.log(`Oh, so your favorite food is ${answer}`); + * }); + * ``` + * + * Using an `AbortController` to cancel a question. + * + * ```js + * const ac = new AbortController(); + * const signal = ac.signal; + * + * rl.question('What is your favorite food? ', { signal }, (answer) => { + * console.log(`Oh, so your favorite food is ${answer}`); + * }); + * + * signal.addEventListener('abort', () => { + * console.log('The food question timed out'); + * }, { once: true }); + * + * setTimeout(() => ac.abort(), 10000); + * ``` + * @since v0.3.3 + * @param query A statement or query to write to `output`, prepended to the prompt. + * @param callback A callback function that is invoked with the user's input in response to the `query`. + */ + question(query: string, callback: (answer: string) => void): void; + question(query: string, options: Abortable, callback: (answer: string) => void): void; + /** + * The `rl.pause()` method pauses the `input` stream, allowing it to be resumed + * later if necessary. + * + * Calling `rl.pause()` does not immediately pause other events (including`'line'`) from being emitted by the `Interface` instance. + * @since v0.3.4 + */ + pause(): this; + /** + * The `rl.resume()` method resumes the `input` stream if it has been paused. + * @since v0.3.4 + */ + resume(): this; + /** + * The `rl.close()` method closes the `Interface` instance and + * relinquishes control over the `input` and `output` streams. When called, + * the `'close'` event will be emitted. + * + * Calling `rl.close()` does not immediately stop other events (including `'line'`) + * from being emitted by the `Interface` instance. + * @since v0.1.98 + */ + close(): void; + /** + * The `rl.write()` method will write either `data` or a key sequence identified + * by `key` to the `output`. The `key` argument is supported only if `output` is + * a `TTY` text terminal. See `TTY keybindings` for a list of key + * combinations. + * + * If `key` is specified, `data` is ignored. + * + * When called, `rl.write()` will resume the `input` stream if it has been + * paused. + * + * If the `Interface` was created with `output` set to `null` or`undefined` the `data` and `key` are not written. + * + * ```js + * rl.write('Delete this!'); + * // Simulate Ctrl+U to delete the line written previously + * rl.write(null, { ctrl: true, name: 'u' }); + * ``` + * + * The `rl.write()` method will write the data to the `readline` `Interface`'s`input`_as if it were provided by the user_. + * @since v0.1.98 + */ + write(data: string | Buffer, key?: Key): void; + write(data: undefined | null | string | Buffer, key: Key): void; + /** + * Returns the real position of the cursor in relation to the input + * prompt + string. Long input (wrapping) strings, as well as multiple + * line prompts are included in the calculations. + * @since v13.5.0, v12.16.0 + */ + getCursorPos(): CursorPos; + /** + * events.EventEmitter + * 1. close + * 2. line + * 3. pause + * 4. resume + * 5. SIGCONT + * 6. SIGINT + * 7. SIGTSTP + * 8. history + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: 'close', listener: () => void): this; + addListener(event: 'line', listener: (input: string) => void): this; + addListener(event: 'pause', listener: () => void): this; + addListener(event: 'resume', listener: () => void): this; + addListener(event: 'SIGCONT', listener: () => void): this; + addListener(event: 'SIGINT', listener: () => void): this; + addListener(event: 'SIGTSTP', listener: () => void): this; + addListener(event: 'history', listener: (history: string[]) => void): this; + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: 'close'): boolean; + emit(event: 'line', input: string): boolean; + emit(event: 'pause'): boolean; + emit(event: 'resume'): boolean; + emit(event: 'SIGCONT'): boolean; + emit(event: 'SIGINT'): boolean; + emit(event: 'SIGTSTP'): boolean; + emit(event: 'history', history: string[]): boolean; + on(event: string, listener: (...args: any[]) => void): this; + on(event: 'close', listener: () => void): this; + on(event: 'line', listener: (input: string) => void): this; + on(event: 'pause', listener: () => void): this; + on(event: 'resume', listener: () => void): this; + on(event: 'SIGCONT', listener: () => void): this; + on(event: 'SIGINT', listener: () => void): this; + on(event: 'SIGTSTP', listener: () => void): this; + on(event: 'history', listener: (history: string[]) => void): this; + once(event: string, listener: (...args: any[]) => void): this; + once(event: 'close', listener: () => void): this; + once(event: 'line', listener: (input: string) => void): this; + once(event: 'pause', listener: () => void): this; + once(event: 'resume', listener: () => void): this; + once(event: 'SIGCONT', listener: () => void): this; + once(event: 'SIGINT', listener: () => void): this; + once(event: 'SIGTSTP', listener: () => void): this; + once(event: 'history', listener: (history: string[]) => void): this; + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: 'close', listener: () => void): this; + prependListener(event: 'line', listener: (input: string) => void): this; + prependListener(event: 'pause', listener: () => void): this; + prependListener(event: 'resume', listener: () => void): this; + prependListener(event: 'SIGCONT', listener: () => void): this; + prependListener(event: 'SIGINT', listener: () => void): this; + prependListener(event: 'SIGTSTP', listener: () => void): this; + prependListener(event: 'history', listener: (history: string[]) => void): this; + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'close', listener: () => void): this; + prependOnceListener(event: 'line', listener: (input: string) => void): this; + prependOnceListener(event: 'pause', listener: () => void): this; + prependOnceListener(event: 'resume', listener: () => void): this; + prependOnceListener(event: 'SIGCONT', listener: () => void): this; + prependOnceListener(event: 'SIGINT', listener: () => void): this; + prependOnceListener(event: 'SIGTSTP', listener: () => void): this; + prependOnceListener(event: 'history', listener: (history: string[]) => void): this; + [Symbol.asyncIterator](): AsyncIterableIterator; + } + export type ReadLine = Interface; // type forwarded for backwards compatibility + export type Completer = (line: string) => CompleterResult; + export type AsyncCompleter = (line: string, callback: (err?: null | Error, result?: CompleterResult) => void) => void; + export type CompleterResult = [string[], string]; + export interface ReadLineOptions { + input: NodeJS.ReadableStream; + output?: NodeJS.WritableStream | undefined; + completer?: Completer | AsyncCompleter | undefined; + terminal?: boolean | undefined; + /** + * Initial list of history lines. This option makes sense + * only if `terminal` is set to `true` by the user or by an internal `output` + * check, otherwise the history caching mechanism is not initialized at all. + * @default [] + */ + history?: string[] | undefined; + historySize?: number | undefined; + prompt?: string | undefined; + crlfDelay?: number | undefined; + /** + * If `true`, when a new input line added + * to the history list duplicates an older one, this removes the older line + * from the list. + * @default false + */ + removeHistoryDuplicates?: boolean | undefined; + escapeCodeTimeout?: number | undefined; + tabSize?: number | undefined; + } + /** + * The `readline.createInterface()` method creates a new `readline.Interface`instance. + * + * ```js + * const readline = require('node:readline'); + * const rl = readline.createInterface({ + * input: process.stdin, + * output: process.stdout, + * }); + * ``` + * + * Once the `readline.Interface` instance is created, the most common case is to + * listen for the `'line'` event: + * + * ```js + * rl.on('line', (line) => { + * console.log(`Received: ${line}`); + * }); + * ``` + * + * If `terminal` is `true` for this instance then the `output` stream will get + * the best compatibility if it defines an `output.columns` property and emits + * a `'resize'` event on the `output` if or when the columns ever change + * (`process.stdout` does this automatically when it is a TTY). + * + * When creating a `readline.Interface` using `stdin` as input, the program + * will not terminate until it receives an [EOF character](https://en.wikipedia.org/wiki/End-of-file#EOF_character). To exit without + * waiting for user input, call `process.stdin.unref()`. + * @since v0.1.98 + */ + export function createInterface(input: NodeJS.ReadableStream, output?: NodeJS.WritableStream, completer?: Completer | AsyncCompleter, terminal?: boolean): Interface; + export function createInterface(options: ReadLineOptions): Interface; + /** + * The `readline.emitKeypressEvents()` method causes the given `Readable` stream to begin emitting `'keypress'` events corresponding to received input. + * + * Optionally, `interface` specifies a `readline.Interface` instance for which + * autocompletion is disabled when copy-pasted input is detected. + * + * If the `stream` is a `TTY`, then it must be in raw mode. + * + * This is automatically called by any readline instance on its `input` if the`input` is a terminal. Closing the `readline` instance does not stop + * the `input` from emitting `'keypress'` events. + * + * ```js + * readline.emitKeypressEvents(process.stdin); + * if (process.stdin.isTTY) + * process.stdin.setRawMode(true); + * ``` + * + * ## Example: Tiny CLI + * + * The following example illustrates the use of `readline.Interface` class to + * implement a small command-line interface: + * + * ```js + * const readline = require('node:readline'); + * const rl = readline.createInterface({ + * input: process.stdin, + * output: process.stdout, + * prompt: 'OHAI> ', + * }); + * + * rl.prompt(); + * + * rl.on('line', (line) => { + * switch (line.trim()) { + * case 'hello': + * console.log('world!'); + * break; + * default: + * console.log(`Say what? I might have heard '${line.trim()}'`); + * break; + * } + * rl.prompt(); + * }).on('close', () => { + * console.log('Have a great day!'); + * process.exit(0); + * }); + * ``` + * + * ## Example: Read file stream line-by-Line + * + * A common use case for `readline` is to consume an input file one line at a + * time. The easiest way to do so is leveraging the `fs.ReadStream` API as + * well as a `for await...of` loop: + * + * ```js + * const fs = require('node:fs'); + * const readline = require('node:readline'); + * + * async function processLineByLine() { + * const fileStream = fs.createReadStream('input.txt'); + * + * const rl = readline.createInterface({ + * input: fileStream, + * crlfDelay: Infinity, + * }); + * // Note: we use the crlfDelay option to recognize all instances of CR LF + * // ('\r\n') in input.txt as a single line break. + * + * for await (const line of rl) { + * // Each line in input.txt will be successively available here as `line`. + * console.log(`Line from file: ${line}`); + * } + * } + * + * processLineByLine(); + * ``` + * + * Alternatively, one could use the `'line'` event: + * + * ```js + * const fs = require('node:fs'); + * const readline = require('node:readline'); + * + * const rl = readline.createInterface({ + * input: fs.createReadStream('sample.txt'), + * crlfDelay: Infinity, + * }); + * + * rl.on('line', (line) => { + * console.log(`Line from file: ${line}`); + * }); + * ``` + * + * Currently, `for await...of` loop can be a bit slower. If `async` / `await`flow and speed are both essential, a mixed approach can be applied: + * + * ```js + * const { once } = require('node:events'); + * const { createReadStream } = require('node:fs'); + * const { createInterface } = require('node:readline'); + * + * (async function processLineByLine() { + * try { + * const rl = createInterface({ + * input: createReadStream('big-file.txt'), + * crlfDelay: Infinity, + * }); + * + * rl.on('line', (line) => { + * // Process the line. + * }); + * + * await once(rl, 'close'); + * + * console.log('File processed.'); + * } catch (err) { + * console.error(err); + * } + * })(); + * ``` + * @since v0.7.7 + */ + export function emitKeypressEvents(stream: NodeJS.ReadableStream, readlineInterface?: Interface): void; + export type Direction = -1 | 0 | 1; + export interface CursorPos { + rows: number; + cols: number; + } + /** + * The `readline.clearLine()` method clears current line of given `TTY` stream + * in a specified direction identified by `dir`. + * @since v0.7.7 + * @param callback Invoked once the operation completes. + * @return `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. + */ + export function clearLine(stream: NodeJS.WritableStream, dir: Direction, callback?: () => void): boolean; + /** + * The `readline.clearScreenDown()` method clears the given `TTY` stream from + * the current position of the cursor down. + * @since v0.7.7 + * @param callback Invoked once the operation completes. + * @return `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. + */ + export function clearScreenDown(stream: NodeJS.WritableStream, callback?: () => void): boolean; + /** + * The `readline.cursorTo()` method moves cursor to the specified position in a + * given `TTY` `stream`. + * @since v0.7.7 + * @param callback Invoked once the operation completes. + * @return `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. + */ + export function cursorTo(stream: NodeJS.WritableStream, x: number, y?: number, callback?: () => void): boolean; + /** + * The `readline.moveCursor()` method moves the cursor _relative_ to its current + * position in a given `TTY` `stream`. + * @since v0.7.7 + * @param callback Invoked once the operation completes. + * @return `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. + */ + export function moveCursor(stream: NodeJS.WritableStream, dx: number, dy: number, callback?: () => void): boolean; +} +declare module 'readline' { + export * from 'node:readline'; +} diff --git a/node_modules/@types/node/ts4.8/readline/promises.d.ts b/node_modules/@types/node/ts4.8/readline/promises.d.ts new file mode 100644 index 0000000..f8a78ec --- /dev/null +++ b/node_modules/@types/node/ts4.8/readline/promises.d.ts @@ -0,0 +1,145 @@ +/** + * @since v17.0.0 + * @experimental + */ +declare module 'node:readline/promises' { + import { Interface as _Interface, ReadLineOptions, Completer, AsyncCompleter, Direction } from 'node:readline'; + import { Abortable } from 'node:events'; + /** + * Instances of the `readlinePromises.Interface` class are constructed using the`readlinePromises.createInterface()` method. Every instance is associated with a + * single `input` `Readable` stream and a single `output` `Writable` stream. + * The `output` stream is used to print prompts for user input that arrives on, + * and is read from, the `input` stream. + * @since v17.0.0 + */ + class Interface extends _Interface { + /** + * The `rl.question()` method displays the `query` by writing it to the `output`, + * waits for user input to be provided on `input`, then invokes the `callback`function passing the provided input as the first argument. + * + * When called, `rl.question()` will resume the `input` stream if it has been + * paused. + * + * If the `Interface` was created with `output` set to `null` or`undefined` the `query` is not written. + * + * If the question is called after `rl.close()`, it returns a rejected promise. + * + * Example usage: + * + * ```js + * const answer = await rl.question('What is your favorite food? '); + * console.log(`Oh, so your favorite food is ${answer}`); + * ``` + * + * Using an `AbortSignal` to cancel a question. + * + * ```js + * const signal = AbortSignal.timeout(10_000); + * + * signal.addEventListener('abort', () => { + * console.log('The food question timed out'); + * }, { once: true }); + * + * const answer = await rl.question('What is your favorite food? ', { signal }); + * console.log(`Oh, so your favorite food is ${answer}`); + * ``` + * @since v17.0.0 + * @param query A statement or query to write to `output`, prepended to the prompt. + * @return A promise that is fulfilled with the user's input in response to the `query`. + */ + question(query: string): Promise; + question(query: string, options: Abortable): Promise; + } + /** + * @since v17.0.0 + */ + class Readline { + /** + * @param stream A TTY stream. + */ + constructor( + stream: NodeJS.WritableStream, + options?: { + autoCommit?: boolean; + } + ); + /** + * The `rl.clearLine()` method adds to the internal list of pending action an + * action that clears current line of the associated `stream` in a specified + * direction identified by `dir`. + * Call `rl.commit()` to see the effect of this method, unless `autoCommit: true`was passed to the constructor. + * @since v17.0.0 + * @return this + */ + clearLine(dir: Direction): this; + /** + * The `rl.clearScreenDown()` method adds to the internal list of pending action an + * action that clears the associated stream from the current position of the + * cursor down. + * Call `rl.commit()` to see the effect of this method, unless `autoCommit: true`was passed to the constructor. + * @since v17.0.0 + * @return this + */ + clearScreenDown(): this; + /** + * The `rl.commit()` method sends all the pending actions to the associated`stream` and clears the internal list of pending actions. + * @since v17.0.0 + */ + commit(): Promise; + /** + * The `rl.cursorTo()` method adds to the internal list of pending action an action + * that moves cursor to the specified position in the associated `stream`. + * Call `rl.commit()` to see the effect of this method, unless `autoCommit: true`was passed to the constructor. + * @since v17.0.0 + * @return this + */ + cursorTo(x: number, y?: number): this; + /** + * The `rl.moveCursor()` method adds to the internal list of pending action an + * action that moves the cursor _relative_ to its current position in the + * associated `stream`. + * Call `rl.commit()` to see the effect of this method, unless `autoCommit: true`was passed to the constructor. + * @since v17.0.0 + * @return this + */ + moveCursor(dx: number, dy: number): this; + /** + * The `rl.rollback` methods clears the internal list of pending actions without + * sending it to the associated `stream`. + * @since v17.0.0 + * @return this + */ + rollback(): this; + } + /** + * The `readlinePromises.createInterface()` method creates a new `readlinePromises.Interface`instance. + * + * ```js + * const readlinePromises = require('node:readline/promises'); + * const rl = readlinePromises.createInterface({ + * input: process.stdin, + * output: process.stdout, + * }); + * ``` + * + * Once the `readlinePromises.Interface` instance is created, the most common case + * is to listen for the `'line'` event: + * + * ```js + * rl.on('line', (line) => { + * console.log(`Received: ${line}`); + * }); + * ``` + * + * If `terminal` is `true` for this instance then the `output` stream will get + * the best compatibility if it defines an `output.columns` property and emits + * a `'resize'` event on the `output` if or when the columns ever change + * (`process.stdout` does this automatically when it is a TTY). + * @since v17.0.0 + */ + function createInterface(input: NodeJS.ReadableStream, output?: NodeJS.WritableStream, completer?: Completer | AsyncCompleter, terminal?: boolean): Interface; + function createInterface(options: ReadLineOptions): Interface; +} +declare module 'readline/promises' { + export * from 'node:readline/promises'; +} diff --git a/node_modules/@types/node/ts4.8/repl.d.ts b/node_modules/@types/node/ts4.8/repl.d.ts new file mode 100644 index 0000000..88ce2ed --- /dev/null +++ b/node_modules/@types/node/ts4.8/repl.d.ts @@ -0,0 +1,424 @@ +/** + * The `node:repl` module provides a Read-Eval-Print-Loop (REPL) implementation + * that is available both as a standalone program or includible in other + * applications. It can be accessed using: + * + * ```js + * const repl = require('node:repl'); + * ``` + * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/repl.js) + */ +declare module 'node:repl' { + import { Interface, Completer, AsyncCompleter } from 'node:readline'; + import { Context } from 'node:vm'; + import { InspectOptions } from 'node:util'; + interface ReplOptions { + /** + * The input prompt to display. + * @default "> " + */ + prompt?: string | undefined; + /** + * The `Readable` stream from which REPL input will be read. + * @default process.stdin + */ + input?: NodeJS.ReadableStream | undefined; + /** + * The `Writable` stream to which REPL output will be written. + * @default process.stdout + */ + output?: NodeJS.WritableStream | undefined; + /** + * If `true`, specifies that the output should be treated as a TTY terminal, and have + * ANSI/VT100 escape codes written to it. + * Default: checking the value of the `isTTY` property on the output stream upon + * instantiation. + */ + terminal?: boolean | undefined; + /** + * The function to be used when evaluating each given line of input. + * Default: an async wrapper for the JavaScript `eval()` function. An `eval` function can + * error with `repl.Recoverable` to indicate the input was incomplete and prompt for + * additional lines. + * + * @see https://nodejs.org/dist/latest-v20.x/docs/api/repl.html#repl_default_evaluation + * @see https://nodejs.org/dist/latest-v20.x/docs/api/repl.html#repl_custom_evaluation_functions + */ + eval?: REPLEval | undefined; + /** + * Defines if the repl prints output previews or not. + * @default `true` Always `false` in case `terminal` is falsy. + */ + preview?: boolean | undefined; + /** + * If `true`, specifies that the default `writer` function should include ANSI color + * styling to REPL output. If a custom `writer` function is provided then this has no + * effect. + * Default: the REPL instance's `terminal` value. + */ + useColors?: boolean | undefined; + /** + * If `true`, specifies that the default evaluation function will use the JavaScript + * `global` as the context as opposed to creating a new separate context for the REPL + * instance. The node CLI REPL sets this value to `true`. + * Default: `false`. + */ + useGlobal?: boolean | undefined; + /** + * If `true`, specifies that the default writer will not output the return value of a + * command if it evaluates to `undefined`. + * Default: `false`. + */ + ignoreUndefined?: boolean | undefined; + /** + * The function to invoke to format the output of each command before writing to `output`. + * Default: a wrapper for `util.inspect`. + * + * @see https://nodejs.org/dist/latest-v20.x/docs/api/repl.html#repl_customizing_repl_output + */ + writer?: REPLWriter | undefined; + /** + * An optional function used for custom Tab auto completion. + * + * @see https://nodejs.org/dist/latest-v20.x/docs/api/readline.html#readline_use_of_the_completer_function + */ + completer?: Completer | AsyncCompleter | undefined; + /** + * A flag that specifies whether the default evaluator executes all JavaScript commands in + * strict mode or default (sloppy) mode. + * Accepted values are: + * - `repl.REPL_MODE_SLOPPY` - evaluates expressions in sloppy mode. + * - `repl.REPL_MODE_STRICT` - evaluates expressions in strict mode. This is equivalent to + * prefacing every repl statement with `'use strict'`. + */ + replMode?: typeof REPL_MODE_SLOPPY | typeof REPL_MODE_STRICT | undefined; + /** + * Stop evaluating the current piece of code when `SIGINT` is received, i.e. `Ctrl+C` is + * pressed. This cannot be used together with a custom `eval` function. + * Default: `false`. + */ + breakEvalOnSigint?: boolean | undefined; + } + type REPLEval = (this: REPLServer, evalCmd: string, context: Context, file: string, cb: (err: Error | null, result: any) => void) => void; + type REPLWriter = (this: REPLServer, obj: any) => string; + /** + * This is the default "writer" value, if none is passed in the REPL options, + * and it can be overridden by custom print functions. + */ + const writer: REPLWriter & { + options: InspectOptions; + }; + type REPLCommandAction = (this: REPLServer, text: string) => void; + interface REPLCommand { + /** + * Help text to be displayed when `.help` is entered. + */ + help?: string | undefined; + /** + * The function to execute, optionally accepting a single string argument. + */ + action: REPLCommandAction; + } + /** + * Instances of `repl.REPLServer` are created using the {@link start} method + * or directly using the JavaScript `new` keyword. + * + * ```js + * const repl = require('node:repl'); + * + * const options = { useColors: true }; + * + * const firstInstance = repl.start(options); + * const secondInstance = new repl.REPLServer(options); + * ``` + * @since v0.1.91 + */ + class REPLServer extends Interface { + /** + * The `vm.Context` provided to the `eval` function to be used for JavaScript + * evaluation. + */ + readonly context: Context; + /** + * @deprecated since v14.3.0 - Use `input` instead. + */ + readonly inputStream: NodeJS.ReadableStream; + /** + * @deprecated since v14.3.0 - Use `output` instead. + */ + readonly outputStream: NodeJS.WritableStream; + /** + * The `Readable` stream from which REPL input will be read. + */ + readonly input: NodeJS.ReadableStream; + /** + * The `Writable` stream to which REPL output will be written. + */ + readonly output: NodeJS.WritableStream; + /** + * The commands registered via `replServer.defineCommand()`. + */ + readonly commands: NodeJS.ReadOnlyDict; + /** + * A value indicating whether the REPL is currently in "editor mode". + * + * @see https://nodejs.org/dist/latest-v20.x/docs/api/repl.html#repl_commands_and_special_keys + */ + readonly editorMode: boolean; + /** + * A value indicating whether the `_` variable has been assigned. + * + * @see https://nodejs.org/dist/latest-v20.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable + */ + readonly underscoreAssigned: boolean; + /** + * The last evaluation result from the REPL (assigned to the `_` variable inside of the REPL). + * + * @see https://nodejs.org/dist/latest-v20.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable + */ + readonly last: any; + /** + * A value indicating whether the `_error` variable has been assigned. + * + * @since v9.8.0 + * @see https://nodejs.org/dist/latest-v20.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable + */ + readonly underscoreErrAssigned: boolean; + /** + * The last error raised inside the REPL (assigned to the `_error` variable inside of the REPL). + * + * @since v9.8.0 + * @see https://nodejs.org/dist/latest-v20.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable + */ + readonly lastError: any; + /** + * Specified in the REPL options, this is the function to be used when evaluating each + * given line of input. If not specified in the REPL options, this is an async wrapper + * for the JavaScript `eval()` function. + */ + readonly eval: REPLEval; + /** + * Specified in the REPL options, this is a value indicating whether the default + * `writer` function should include ANSI color styling to REPL output. + */ + readonly useColors: boolean; + /** + * Specified in the REPL options, this is a value indicating whether the default `eval` + * function will use the JavaScript `global` as the context as opposed to creating a new + * separate context for the REPL instance. + */ + readonly useGlobal: boolean; + /** + * Specified in the REPL options, this is a value indicating whether the default `writer` + * function should output the result of a command if it evaluates to `undefined`. + */ + readonly ignoreUndefined: boolean; + /** + * Specified in the REPL options, this is the function to invoke to format the output of + * each command before writing to `outputStream`. If not specified in the REPL options, + * this will be a wrapper for `util.inspect`. + */ + readonly writer: REPLWriter; + /** + * Specified in the REPL options, this is the function to use for custom Tab auto-completion. + */ + readonly completer: Completer | AsyncCompleter; + /** + * Specified in the REPL options, this is a flag that specifies whether the default `eval` + * function should execute all JavaScript commands in strict mode or default (sloppy) mode. + * Possible values are: + * - `repl.REPL_MODE_SLOPPY` - evaluates expressions in sloppy mode. + * - `repl.REPL_MODE_STRICT` - evaluates expressions in strict mode. This is equivalent to + * prefacing every repl statement with `'use strict'`. + */ + readonly replMode: typeof REPL_MODE_SLOPPY | typeof REPL_MODE_STRICT; + /** + * NOTE: According to the documentation: + * + * > Instances of `repl.REPLServer` are created using the `repl.start()` method and + * > _should not_ be created directly using the JavaScript `new` keyword. + * + * `REPLServer` cannot be subclassed due to implementation specifics in NodeJS. + * + * @see https://nodejs.org/dist/latest-v20.x/docs/api/repl.html#repl_class_replserver + */ + private constructor(); + /** + * The `replServer.defineCommand()` method is used to add new `.`\-prefixed commands + * to the REPL instance. Such commands are invoked by typing a `.` followed by the`keyword`. The `cmd` is either a `Function` or an `Object` with the following + * properties: + * + * The following example shows two new commands added to the REPL instance: + * + * ```js + * const repl = require('node:repl'); + * + * const replServer = repl.start({ prompt: '> ' }); + * replServer.defineCommand('sayhello', { + * help: 'Say hello', + * action(name) { + * this.clearBufferedCommand(); + * console.log(`Hello, ${name}!`); + * this.displayPrompt(); + * }, + * }); + * replServer.defineCommand('saybye', function saybye() { + * console.log('Goodbye!'); + * this.close(); + * }); + * ``` + * + * The new commands can then be used from within the REPL instance: + * + * ```console + * > .sayhello Node.js User + * Hello, Node.js User! + * > .saybye + * Goodbye! + * ``` + * @since v0.3.0 + * @param keyword The command keyword (_without_ a leading `.` character). + * @param cmd The function to invoke when the command is processed. + */ + defineCommand(keyword: string, cmd: REPLCommandAction | REPLCommand): void; + /** + * The `replServer.displayPrompt()` method readies the REPL instance for input + * from the user, printing the configured `prompt` to a new line in the `output`and resuming the `input` to accept new input. + * + * When multi-line input is being entered, an ellipsis is printed rather than the + * 'prompt'. + * + * When `preserveCursor` is `true`, the cursor placement will not be reset to `0`. + * + * The `replServer.displayPrompt` method is primarily intended to be called from + * within the action function for commands registered using the`replServer.defineCommand()` method. + * @since v0.1.91 + */ + displayPrompt(preserveCursor?: boolean): void; + /** + * The `replServer.clearBufferedCommand()` method clears any command that has been + * buffered but not yet executed. This method is primarily intended to be + * called from within the action function for commands registered using the`replServer.defineCommand()` method. + * @since v9.0.0 + */ + clearBufferedCommand(): void; + /** + * Initializes a history log file for the REPL instance. When executing the + * Node.js binary and using the command-line REPL, a history file is initialized + * by default. However, this is not the case when creating a REPL + * programmatically. Use this method to initialize a history log file when working + * with REPL instances programmatically. + * @since v11.10.0 + * @param historyPath the path to the history file + * @param callback called when history writes are ready or upon error + */ + setupHistory(path: string, callback: (err: Error | null, repl: this) => void): void; + /** + * events.EventEmitter + * 1. close - inherited from `readline.Interface` + * 2. line - inherited from `readline.Interface` + * 3. pause - inherited from `readline.Interface` + * 4. resume - inherited from `readline.Interface` + * 5. SIGCONT - inherited from `readline.Interface` + * 6. SIGINT - inherited from `readline.Interface` + * 7. SIGTSTP - inherited from `readline.Interface` + * 8. exit + * 9. reset + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: 'close', listener: () => void): this; + addListener(event: 'line', listener: (input: string) => void): this; + addListener(event: 'pause', listener: () => void): this; + addListener(event: 'resume', listener: () => void): this; + addListener(event: 'SIGCONT', listener: () => void): this; + addListener(event: 'SIGINT', listener: () => void): this; + addListener(event: 'SIGTSTP', listener: () => void): this; + addListener(event: 'exit', listener: () => void): this; + addListener(event: 'reset', listener: (context: Context) => void): this; + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: 'close'): boolean; + emit(event: 'line', input: string): boolean; + emit(event: 'pause'): boolean; + emit(event: 'resume'): boolean; + emit(event: 'SIGCONT'): boolean; + emit(event: 'SIGINT'): boolean; + emit(event: 'SIGTSTP'): boolean; + emit(event: 'exit'): boolean; + emit(event: 'reset', context: Context): boolean; + on(event: string, listener: (...args: any[]) => void): this; + on(event: 'close', listener: () => void): this; + on(event: 'line', listener: (input: string) => void): this; + on(event: 'pause', listener: () => void): this; + on(event: 'resume', listener: () => void): this; + on(event: 'SIGCONT', listener: () => void): this; + on(event: 'SIGINT', listener: () => void): this; + on(event: 'SIGTSTP', listener: () => void): this; + on(event: 'exit', listener: () => void): this; + on(event: 'reset', listener: (context: Context) => void): this; + once(event: string, listener: (...args: any[]) => void): this; + once(event: 'close', listener: () => void): this; + once(event: 'line', listener: (input: string) => void): this; + once(event: 'pause', listener: () => void): this; + once(event: 'resume', listener: () => void): this; + once(event: 'SIGCONT', listener: () => void): this; + once(event: 'SIGINT', listener: () => void): this; + once(event: 'SIGTSTP', listener: () => void): this; + once(event: 'exit', listener: () => void): this; + once(event: 'reset', listener: (context: Context) => void): this; + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: 'close', listener: () => void): this; + prependListener(event: 'line', listener: (input: string) => void): this; + prependListener(event: 'pause', listener: () => void): this; + prependListener(event: 'resume', listener: () => void): this; + prependListener(event: 'SIGCONT', listener: () => void): this; + prependListener(event: 'SIGINT', listener: () => void): this; + prependListener(event: 'SIGTSTP', listener: () => void): this; + prependListener(event: 'exit', listener: () => void): this; + prependListener(event: 'reset', listener: (context: Context) => void): this; + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'close', listener: () => void): this; + prependOnceListener(event: 'line', listener: (input: string) => void): this; + prependOnceListener(event: 'pause', listener: () => void): this; + prependOnceListener(event: 'resume', listener: () => void): this; + prependOnceListener(event: 'SIGCONT', listener: () => void): this; + prependOnceListener(event: 'SIGINT', listener: () => void): this; + prependOnceListener(event: 'SIGTSTP', listener: () => void): this; + prependOnceListener(event: 'exit', listener: () => void): this; + prependOnceListener(event: 'reset', listener: (context: Context) => void): this; + } + /** + * A flag passed in the REPL options. Evaluates expressions in sloppy mode. + */ + const REPL_MODE_SLOPPY: unique symbol; + /** + * A flag passed in the REPL options. Evaluates expressions in strict mode. + * This is equivalent to prefacing every repl statement with `'use strict'`. + */ + const REPL_MODE_STRICT: unique symbol; + /** + * The `repl.start()` method creates and starts a {@link REPLServer} instance. + * + * If `options` is a string, then it specifies the input prompt: + * + * ```js + * const repl = require('node:repl'); + * + * // a Unix style prompt + * repl.start('$ '); + * ``` + * @since v0.1.91 + */ + function start(options?: string | ReplOptions): REPLServer; + /** + * Indicates a recoverable error that a `REPLServer` can use to support multi-line input. + * + * @see https://nodejs.org/dist/latest-v20.x/docs/api/repl.html#repl_recoverable_errors + */ + class Recoverable extends SyntaxError { + err: Error; + constructor(err: Error); + } +} +declare module 'repl' { + export * from 'node:repl'; +} diff --git a/node_modules/@types/node/ts4.8/stream.d.ts b/node_modules/@types/node/ts4.8/stream.d.ts new file mode 100644 index 0000000..f85f02e --- /dev/null +++ b/node_modules/@types/node/ts4.8/stream.d.ts @@ -0,0 +1,1430 @@ +/** + * A stream is an abstract interface for working with streaming data in Node.js. + * The `node:stream` module provides an API for implementing the stream interface. + * + * There are many stream objects provided by Node.js. For instance, a `request to an HTTP server` and `process.stdout` are both stream instances. + * + * Streams can be readable, writable, or both. All streams are instances of `EventEmitter`. + * + * To access the `node:stream` module: + * + * ```js + * const stream = require('node:stream'); + * ``` + * + * The `node:stream` module is useful for creating new types of stream instances. + * It is usually not necessary to use the `node:stream` module to consume streams. + * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/stream.js) + */ +declare module 'node:stream' { + import { EventEmitter, Abortable } from 'node:events'; + import { Blob as NodeBlob } from 'node:buffer'; + import * as streamPromises from 'node:stream/promises'; + import * as streamConsumers from 'node:stream/consumers'; + import * as streamWeb from 'node:stream/web'; + + type ComposeFnParam = (source: any) => void; + + class internal extends EventEmitter { + pipe( + destination: T, + options?: { + end?: boolean | undefined; + } + ): T; + compose(stream: T | ComposeFnParam | Iterable | AsyncIterable, options?: { signal: AbortSignal }): T; + } + import Stream = internal.Stream; + import Readable = internal.Readable; + import ReadableOptions = internal.ReadableOptions; + class ReadableBase extends Stream implements NodeJS.ReadableStream { + /** + * A utility method for creating Readable Streams out of iterators. + */ + static from(iterable: Iterable | AsyncIterable, options?: ReadableOptions): Readable; + /** + * Returns whether the stream has been read from or cancelled. + * @since v16.8.0 + */ + static isDisturbed(stream: Readable | NodeJS.ReadableStream): boolean; + /** + * Returns whether the stream was destroyed or errored before emitting `'end'`. + * @since v16.8.0 + * @experimental + */ + readonly readableAborted: boolean; + /** + * Is `true` if it is safe to call `readable.read()`, which means + * the stream has not been destroyed or emitted `'error'` or `'end'`. + * @since v11.4.0 + */ + readable: boolean; + /** + * Returns whether `'data'` has been emitted. + * @since v16.7.0, v14.18.0 + * @experimental + */ + readonly readableDidRead: boolean; + /** + * Getter for the property `encoding` of a given `Readable` stream. The `encoding`property can be set using the `readable.setEncoding()` method. + * @since v12.7.0 + */ + readonly readableEncoding: BufferEncoding | null; + /** + * Becomes `true` when `'end'` event is emitted. + * @since v12.9.0 + */ + readonly readableEnded: boolean; + /** + * This property reflects the current state of a `Readable` stream as described + * in the `Three states` section. + * @since v9.4.0 + */ + readonly readableFlowing: boolean | null; + /** + * Returns the value of `highWaterMark` passed when creating this `Readable`. + * @since v9.3.0 + */ + readonly readableHighWaterMark: number; + /** + * This property contains the number of bytes (or objects) in the queue + * ready to be read. The value provides introspection data regarding + * the status of the `highWaterMark`. + * @since v9.4.0 + */ + readonly readableLength: number; + /** + * Getter for the property `objectMode` of a given `Readable` stream. + * @since v12.3.0 + */ + readonly readableObjectMode: boolean; + /** + * Is `true` after `readable.destroy()` has been called. + * @since v8.0.0 + */ + destroyed: boolean; + /** + * Is `true` after `'close'` has been emitted. + * @since v18.0.0 + */ + readonly closed: boolean; + /** + * Returns error if the stream has been destroyed with an error. + * @since v18.0.0 + */ + readonly errored: Error | null; + constructor(opts?: ReadableOptions); + _construct?(callback: (error?: Error | null) => void): void; + _read(size: number): void; + /** + * The `readable.read()` method reads data out of the internal buffer and + * returns it. If no data is available to be read, `null` is returned. By default, + * the data is returned as a `Buffer` object unless an encoding has been + * specified using the `readable.setEncoding()` method or the stream is operating + * in object mode. + * + * The optional `size` argument specifies a specific number of bytes to read. If`size` bytes are not available to be read, `null` will be returned _unless_the stream has ended, in which + * case all of the data remaining in the internal + * buffer will be returned. + * + * If the `size` argument is not specified, all of the data contained in the + * internal buffer will be returned. + * + * The `size` argument must be less than or equal to 1 GiB. + * + * The `readable.read()` method should only be called on `Readable` streams + * operating in paused mode. In flowing mode, `readable.read()` is called + * automatically until the internal buffer is fully drained. + * + * ```js + * const readable = getReadableStreamSomehow(); + * + * // 'readable' may be triggered multiple times as data is buffered in + * readable.on('readable', () => { + * let chunk; + * console.log('Stream is readable (new data received in buffer)'); + * // Use a loop to make sure we read all currently available data + * while (null !== (chunk = readable.read())) { + * console.log(`Read ${chunk.length} bytes of data...`); + * } + * }); + * + * // 'end' will be triggered once when there is no more data available + * readable.on('end', () => { + * console.log('Reached end of stream.'); + * }); + * ``` + * + * Each call to `readable.read()` returns a chunk of data, or `null`. The chunks + * are not concatenated. A `while` loop is necessary to consume all data + * currently in the buffer. When reading a large file `.read()` may return `null`, + * having consumed all buffered content so far, but there is still more data to + * come not yet buffered. In this case a new `'readable'` event will be emitted + * when there is more data in the buffer. Finally the `'end'` event will be + * emitted when there is no more data to come. + * + * Therefore to read a file's whole contents from a `readable`, it is necessary + * to collect chunks across multiple `'readable'` events: + * + * ```js + * const chunks = []; + * + * readable.on('readable', () => { + * let chunk; + * while (null !== (chunk = readable.read())) { + * chunks.push(chunk); + * } + * }); + * + * readable.on('end', () => { + * const content = chunks.join(''); + * }); + * ``` + * + * A `Readable` stream in object mode will always return a single item from + * a call to `readable.read(size)`, regardless of the value of the`size` argument. + * + * If the `readable.read()` method returns a chunk of data, a `'data'` event will + * also be emitted. + * + * Calling {@link read} after the `'end'` event has + * been emitted will return `null`. No runtime error will be raised. + * @since v0.9.4 + * @param size Optional argument to specify how much data to read. + */ + read(size?: number): any; + /** + * The `readable.setEncoding()` method sets the character encoding for + * data read from the `Readable` stream. + * + * By default, no encoding is assigned and stream data will be returned as`Buffer` objects. Setting an encoding causes the stream data + * to be returned as strings of the specified encoding rather than as `Buffer`objects. For instance, calling `readable.setEncoding('utf8')` will cause the + * output data to be interpreted as UTF-8 data, and passed as strings. Calling`readable.setEncoding('hex')` will cause the data to be encoded in hexadecimal + * string format. + * + * The `Readable` stream will properly handle multi-byte characters delivered + * through the stream that would otherwise become improperly decoded if simply + * pulled from the stream as `Buffer` objects. + * + * ```js + * const readable = getReadableStreamSomehow(); + * readable.setEncoding('utf8'); + * readable.on('data', (chunk) => { + * assert.equal(typeof chunk, 'string'); + * console.log('Got %d characters of string data:', chunk.length); + * }); + * ``` + * @since v0.9.4 + * @param encoding The encoding to use. + */ + setEncoding(encoding: BufferEncoding): this; + /** + * The `readable.pause()` method will cause a stream in flowing mode to stop + * emitting `'data'` events, switching out of flowing mode. Any data that + * becomes available will remain in the internal buffer. + * + * ```js + * const readable = getReadableStreamSomehow(); + * readable.on('data', (chunk) => { + * console.log(`Received ${chunk.length} bytes of data.`); + * readable.pause(); + * console.log('There will be no additional data for 1 second.'); + * setTimeout(() => { + * console.log('Now data will start flowing again.'); + * readable.resume(); + * }, 1000); + * }); + * ``` + * + * The `readable.pause()` method has no effect if there is a `'readable'`event listener. + * @since v0.9.4 + */ + pause(): this; + /** + * The `readable.resume()` method causes an explicitly paused `Readable` stream to + * resume emitting `'data'` events, switching the stream into flowing mode. + * + * The `readable.resume()` method can be used to fully consume the data from a + * stream without actually processing any of that data: + * + * ```js + * getReadableStreamSomehow() + * .resume() + * .on('end', () => { + * console.log('Reached the end, but did not read anything.'); + * }); + * ``` + * + * The `readable.resume()` method has no effect if there is a `'readable'`event listener. + * @since v0.9.4 + */ + resume(): this; + /** + * The `readable.isPaused()` method returns the current operating state of the`Readable`. This is used primarily by the mechanism that underlies the`readable.pipe()` method. In most + * typical cases, there will be no reason to + * use this method directly. + * + * ```js + * const readable = new stream.Readable(); + * + * readable.isPaused(); // === false + * readable.pause(); + * readable.isPaused(); // === true + * readable.resume(); + * readable.isPaused(); // === false + * ``` + * @since v0.11.14 + */ + isPaused(): boolean; + /** + * The `readable.unpipe()` method detaches a `Writable` stream previously attached + * using the {@link pipe} method. + * + * If the `destination` is not specified, then _all_ pipes are detached. + * + * If the `destination` is specified, but no pipe is set up for it, then + * the method does nothing. + * + * ```js + * const fs = require('node:fs'); + * const readable = getReadableStreamSomehow(); + * const writable = fs.createWriteStream('file.txt'); + * // All the data from readable goes into 'file.txt', + * // but only for the first second. + * readable.pipe(writable); + * setTimeout(() => { + * console.log('Stop writing to file.txt.'); + * readable.unpipe(writable); + * console.log('Manually close the file stream.'); + * writable.end(); + * }, 1000); + * ``` + * @since v0.9.4 + * @param destination Optional specific stream to unpipe + */ + unpipe(destination?: NodeJS.WritableStream): this; + /** + * Passing `chunk` as `null` signals the end of the stream (EOF) and behaves the + * same as `readable.push(null)`, after which no more data can be written. The EOF + * signal is put at the end of the buffer and any buffered data will still be + * flushed. + * + * The `readable.unshift()` method pushes a chunk of data back into the internal + * buffer. This is useful in certain situations where a stream is being consumed by + * code that needs to "un-consume" some amount of data that it has optimistically + * pulled out of the source, so that the data can be passed on to some other party. + * + * The `stream.unshift(chunk)` method cannot be called after the `'end'` event + * has been emitted or a runtime error will be thrown. + * + * Developers using `stream.unshift()` often should consider switching to + * use of a `Transform` stream instead. See the `API for stream implementers` section for more information. + * + * ```js + * // Pull off a header delimited by \n\n. + * // Use unshift() if we get too much. + * // Call the callback with (error, header, stream). + * const { StringDecoder } = require('node:string_decoder'); + * function parseHeader(stream, callback) { + * stream.on('error', callback); + * stream.on('readable', onReadable); + * const decoder = new StringDecoder('utf8'); + * let header = ''; + * function onReadable() { + * let chunk; + * while (null !== (chunk = stream.read())) { + * const str = decoder.write(chunk); + * if (str.includes('\n\n')) { + * // Found the header boundary. + * const split = str.split(/\n\n/); + * header += split.shift(); + * const remaining = split.join('\n\n'); + * const buf = Buffer.from(remaining, 'utf8'); + * stream.removeListener('error', callback); + * // Remove the 'readable' listener before unshifting. + * stream.removeListener('readable', onReadable); + * if (buf.length) + * stream.unshift(buf); + * // Now the body of the message can be read from the stream. + * callback(null, header, stream); + * return; + * } + * // Still reading the header. + * header += str; + * } + * } + * } + * ``` + * + * Unlike {@link push}, `stream.unshift(chunk)` will not + * end the reading process by resetting the internal reading state of the stream. + * This can cause unexpected results if `readable.unshift()` is called during a + * read (i.e. from within a {@link _read} implementation on a + * custom stream). Following the call to `readable.unshift()` with an immediate {@link push} will reset the reading state appropriately, + * however it is best to simply avoid calling `readable.unshift()` while in the + * process of performing a read. + * @since v0.9.11 + * @param chunk Chunk of data to unshift onto the read queue. For streams not operating in object mode, `chunk` must be a string, `Buffer`, `Uint8Array`, or `null`. For object mode + * streams, `chunk` may be any JavaScript value. + * @param encoding Encoding of string chunks. Must be a valid `Buffer` encoding, such as `'utf8'` or `'ascii'`. + */ + unshift(chunk: any, encoding?: BufferEncoding): void; + /** + * Prior to Node.js 0.10, streams did not implement the entire `node:stream`module API as it is currently defined. (See `Compatibility` for more + * information.) + * + * When using an older Node.js library that emits `'data'` events and has a {@link pause} method that is advisory only, the`readable.wrap()` method can be used to create a `Readable` + * stream that uses + * the old stream as its data source. + * + * It will rarely be necessary to use `readable.wrap()` but the method has been + * provided as a convenience for interacting with older Node.js applications and + * libraries. + * + * ```js + * const { OldReader } = require('./old-api-module.js'); + * const { Readable } = require('node:stream'); + * const oreader = new OldReader(); + * const myReader = new Readable().wrap(oreader); + * + * myReader.on('readable', () => { + * myReader.read(); // etc. + * }); + * ``` + * @since v0.9.4 + * @param stream An "old style" readable stream + */ + wrap(stream: NodeJS.ReadableStream): this; + push(chunk: any, encoding?: BufferEncoding): boolean; + _destroy(error: Error | null, callback: (error?: Error | null) => void): void; + /** + * Destroy the stream. Optionally emit an `'error'` event, and emit a `'close'`event (unless `emitClose` is set to `false`). After this call, the readable + * stream will release any internal resources and subsequent calls to `push()`will be ignored. + * + * Once `destroy()` has been called any further calls will be a no-op and no + * further errors except from `_destroy()` may be emitted as `'error'`. + * + * Implementors should not override this method, but instead implement `readable._destroy()`. + * @since v8.0.0 + * @param error Error which will be passed as payload in `'error'` event + */ + destroy(error?: Error): this; + /** + * Event emitter + * The defined events on documents including: + * 1. close + * 2. data + * 3. end + * 4. error + * 5. pause + * 6. readable + * 7. resume + */ + addListener(event: 'close', listener: () => void): this; + addListener(event: 'data', listener: (chunk: any) => void): this; + addListener(event: 'end', listener: () => void): this; + addListener(event: 'error', listener: (err: Error) => void): this; + addListener(event: 'pause', listener: () => void): this; + addListener(event: 'readable', listener: () => void): this; + addListener(event: 'resume', listener: () => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + emit(event: 'close'): boolean; + emit(event: 'data', chunk: any): boolean; + emit(event: 'end'): boolean; + emit(event: 'error', err: Error): boolean; + emit(event: 'pause'): boolean; + emit(event: 'readable'): boolean; + emit(event: 'resume'): boolean; + emit(event: string | symbol, ...args: any[]): boolean; + on(event: 'close', listener: () => void): this; + on(event: 'data', listener: (chunk: any) => void): this; + on(event: 'end', listener: () => void): this; + on(event: 'error', listener: (err: Error) => void): this; + on(event: 'pause', listener: () => void): this; + on(event: 'readable', listener: () => void): this; + on(event: 'resume', listener: () => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + once(event: 'close', listener: () => void): this; + once(event: 'data', listener: (chunk: any) => void): this; + once(event: 'end', listener: () => void): this; + once(event: 'error', listener: (err: Error) => void): this; + once(event: 'pause', listener: () => void): this; + once(event: 'readable', listener: () => void): this; + once(event: 'resume', listener: () => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + prependListener(event: 'close', listener: () => void): this; + prependListener(event: 'data', listener: (chunk: any) => void): this; + prependListener(event: 'end', listener: () => void): this; + prependListener(event: 'error', listener: (err: Error) => void): this; + prependListener(event: 'pause', listener: () => void): this; + prependListener(event: 'readable', listener: () => void): this; + prependListener(event: 'resume', listener: () => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'close', listener: () => void): this; + prependOnceListener(event: 'data', listener: (chunk: any) => void): this; + prependOnceListener(event: 'end', listener: () => void): this; + prependOnceListener(event: 'error', listener: (err: Error) => void): this; + prependOnceListener(event: 'pause', listener: () => void): this; + prependOnceListener(event: 'readable', listener: () => void): this; + prependOnceListener(event: 'resume', listener: () => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + removeListener(event: 'close', listener: () => void): this; + removeListener(event: 'data', listener: (chunk: any) => void): this; + removeListener(event: 'end', listener: () => void): this; + removeListener(event: 'error', listener: (err: Error) => void): this; + removeListener(event: 'pause', listener: () => void): this; + removeListener(event: 'readable', listener: () => void): this; + removeListener(event: 'resume', listener: () => void): this; + removeListener(event: string | symbol, listener: (...args: any[]) => void): this; + [Symbol.asyncIterator](): AsyncIterableIterator; + /** + * Calls `readable.destroy()` with an `AbortError` and returns a promise that fulfills when the stream is finished. + * @since v20.4.0 + */ + [Symbol.asyncDispose](): Promise; + } + import WritableOptions = internal.WritableOptions; + class WritableBase extends Stream implements NodeJS.WritableStream { + /** + * Is `true` if it is safe to call `writable.write()`, which means + * the stream has not been destroyed, errored, or ended. + * @since v11.4.0 + */ + readonly writable: boolean; + /** + * Is `true` after `writable.end()` has been called. This property + * does not indicate whether the data has been flushed, for this use `writable.writableFinished` instead. + * @since v12.9.0 + */ + readonly writableEnded: boolean; + /** + * Is set to `true` immediately before the `'finish'` event is emitted. + * @since v12.6.0 + */ + readonly writableFinished: boolean; + /** + * Return the value of `highWaterMark` passed when creating this `Writable`. + * @since v9.3.0 + */ + readonly writableHighWaterMark: number; + /** + * This property contains the number of bytes (or objects) in the queue + * ready to be written. The value provides introspection data regarding + * the status of the `highWaterMark`. + * @since v9.4.0 + */ + readonly writableLength: number; + /** + * Getter for the property `objectMode` of a given `Writable` stream. + * @since v12.3.0 + */ + readonly writableObjectMode: boolean; + /** + * Number of times `writable.uncork()` needs to be + * called in order to fully uncork the stream. + * @since v13.2.0, v12.16.0 + */ + readonly writableCorked: number; + /** + * Is `true` after `writable.destroy()` has been called. + * @since v8.0.0 + */ + destroyed: boolean; + /** + * Is `true` after `'close'` has been emitted. + * @since v18.0.0 + */ + readonly closed: boolean; + /** + * Returns error if the stream has been destroyed with an error. + * @since v18.0.0 + */ + readonly errored: Error | null; + /** + * Is `true` if the stream's buffer has been full and stream will emit `'drain'`. + * @since v15.2.0, v14.17.0 + */ + readonly writableNeedDrain: boolean; + constructor(opts?: WritableOptions); + _write(chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void; + _writev?( + chunks: Array<{ + chunk: any; + encoding: BufferEncoding; + }>, + callback: (error?: Error | null) => void + ): void; + _construct?(callback: (error?: Error | null) => void): void; + _destroy(error: Error | null, callback: (error?: Error | null) => void): void; + _final(callback: (error?: Error | null) => void): void; + /** + * The `writable.write()` method writes some data to the stream, and calls the + * supplied `callback` once the data has been fully handled. If an error + * occurs, the `callback` will be called with the error as its + * first argument. The `callback` is called asynchronously and before `'error'` is + * emitted. + * + * The return value is `true` if the internal buffer is less than the`highWaterMark` configured when the stream was created after admitting `chunk`. + * If `false` is returned, further attempts to write data to the stream should + * stop until the `'drain'` event is emitted. + * + * While a stream is not draining, calls to `write()` will buffer `chunk`, and + * return false. Once all currently buffered chunks are drained (accepted for + * delivery by the operating system), the `'drain'` event will be emitted. + * Once `write()` returns false, do not write more chunks + * until the `'drain'` event is emitted. While calling `write()` on a stream that + * is not draining is allowed, Node.js will buffer all written chunks until + * maximum memory usage occurs, at which point it will abort unconditionally. + * Even before it aborts, high memory usage will cause poor garbage collector + * performance and high RSS (which is not typically released back to the system, + * even after the memory is no longer required). Since TCP sockets may never + * drain if the remote peer does not read the data, writing a socket that is + * not draining may lead to a remotely exploitable vulnerability. + * + * Writing data while the stream is not draining is particularly + * problematic for a `Transform`, because the `Transform` streams are paused + * by default until they are piped or a `'data'` or `'readable'` event handler + * is added. + * + * If the data to be written can be generated or fetched on demand, it is + * recommended to encapsulate the logic into a `Readable` and use {@link pipe}. However, if calling `write()` is preferred, it is + * possible to respect backpressure and avoid memory issues using the `'drain'` event: + * + * ```js + * function write(data, cb) { + * if (!stream.write(data)) { + * stream.once('drain', cb); + * } else { + * process.nextTick(cb); + * } + * } + * + * // Wait for cb to be called before doing any other write. + * write('hello', () => { + * console.log('Write completed, do more writes now.'); + * }); + * ``` + * + * A `Writable` stream in object mode will always ignore the `encoding` argument. + * @since v0.9.4 + * @param chunk Optional data to write. For streams not operating in object mode, `chunk` must be a string, `Buffer` or `Uint8Array`. For object mode streams, `chunk` may be any + * JavaScript value other than `null`. + * @param [encoding='utf8'] The encoding, if `chunk` is a string. + * @param callback Callback for when this chunk of data is flushed. + * @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. + */ + write(chunk: any, callback?: (error: Error | null | undefined) => void): boolean; + write(chunk: any, encoding: BufferEncoding, callback?: (error: Error | null | undefined) => void): boolean; + /** + * The `writable.setDefaultEncoding()` method sets the default `encoding` for a `Writable` stream. + * @since v0.11.15 + * @param encoding The new default encoding + */ + setDefaultEncoding(encoding: BufferEncoding): this; + /** + * Calling the `writable.end()` method signals that no more data will be written + * to the `Writable`. The optional `chunk` and `encoding` arguments allow one + * final additional chunk of data to be written immediately before closing the + * stream. + * + * Calling the {@link write} method after calling {@link end} will raise an error. + * + * ```js + * // Write 'hello, ' and then end with 'world!'. + * const fs = require('node:fs'); + * const file = fs.createWriteStream('example.txt'); + * file.write('hello, '); + * file.end('world!'); + * // Writing more now is not allowed! + * ``` + * @since v0.9.4 + * @param chunk Optional data to write. For streams not operating in object mode, `chunk` must be a string, `Buffer` or `Uint8Array`. For object mode streams, `chunk` may be any + * JavaScript value other than `null`. + * @param encoding The encoding if `chunk` is a string + * @param callback Callback for when the stream is finished. + */ + end(cb?: () => void): this; + end(chunk: any, cb?: () => void): this; + end(chunk: any, encoding: BufferEncoding, cb?: () => void): this; + /** + * The `writable.cork()` method forces all written data to be buffered in memory. + * The buffered data will be flushed when either the {@link uncork} or {@link end} methods are called. + * + * The primary intent of `writable.cork()` is to accommodate a situation in which + * several small chunks are written to the stream in rapid succession. Instead of + * immediately forwarding them to the underlying destination, `writable.cork()`buffers all the chunks until `writable.uncork()` is called, which will pass them + * all to `writable._writev()`, if present. This prevents a head-of-line blocking + * situation where data is being buffered while waiting for the first small chunk + * to be processed. However, use of `writable.cork()` without implementing`writable._writev()` may have an adverse effect on throughput. + * + * See also: `writable.uncork()`, `writable._writev()`. + * @since v0.11.2 + */ + cork(): void; + /** + * The `writable.uncork()` method flushes all data buffered since {@link cork} was called. + * + * When using `writable.cork()` and `writable.uncork()` to manage the buffering + * of writes to a stream, defer calls to `writable.uncork()` using`process.nextTick()`. Doing so allows batching of all`writable.write()` calls that occur within a given Node.js event + * loop phase. + * + * ```js + * stream.cork(); + * stream.write('some '); + * stream.write('data '); + * process.nextTick(() => stream.uncork()); + * ``` + * + * If the `writable.cork()` method is called multiple times on a stream, the + * same number of calls to `writable.uncork()` must be called to flush the buffered + * data. + * + * ```js + * stream.cork(); + * stream.write('some '); + * stream.cork(); + * stream.write('data '); + * process.nextTick(() => { + * stream.uncork(); + * // The data will not be flushed until uncork() is called a second time. + * stream.uncork(); + * }); + * ``` + * + * See also: `writable.cork()`. + * @since v0.11.2 + */ + uncork(): void; + /** + * Destroy the stream. Optionally emit an `'error'` event, and emit a `'close'`event (unless `emitClose` is set to `false`). After this call, the writable + * stream has ended and subsequent calls to `write()` or `end()` will result in + * an `ERR_STREAM_DESTROYED` error. + * This is a destructive and immediate way to destroy a stream. Previous calls to`write()` may not have drained, and may trigger an `ERR_STREAM_DESTROYED` error. + * Use `end()` instead of destroy if data should flush before close, or wait for + * the `'drain'` event before destroying the stream. + * + * Once `destroy()` has been called any further calls will be a no-op and no + * further errors except from `_destroy()` may be emitted as `'error'`. + * + * Implementors should not override this method, + * but instead implement `writable._destroy()`. + * @since v8.0.0 + * @param error Optional, an error to emit with `'error'` event. + */ + destroy(error?: Error): this; + /** + * Event emitter + * The defined events on documents including: + * 1. close + * 2. drain + * 3. error + * 4. finish + * 5. pipe + * 6. unpipe + */ + addListener(event: 'close', listener: () => void): this; + addListener(event: 'drain', listener: () => void): this; + addListener(event: 'error', listener: (err: Error) => void): this; + addListener(event: 'finish', listener: () => void): this; + addListener(event: 'pipe', listener: (src: Readable) => void): this; + addListener(event: 'unpipe', listener: (src: Readable) => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + emit(event: 'close'): boolean; + emit(event: 'drain'): boolean; + emit(event: 'error', err: Error): boolean; + emit(event: 'finish'): boolean; + emit(event: 'pipe', src: Readable): boolean; + emit(event: 'unpipe', src: Readable): boolean; + emit(event: string | symbol, ...args: any[]): boolean; + on(event: 'close', listener: () => void): this; + on(event: 'drain', listener: () => void): this; + on(event: 'error', listener: (err: Error) => void): this; + on(event: 'finish', listener: () => void): this; + on(event: 'pipe', listener: (src: Readable) => void): this; + on(event: 'unpipe', listener: (src: Readable) => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + once(event: 'close', listener: () => void): this; + once(event: 'drain', listener: () => void): this; + once(event: 'error', listener: (err: Error) => void): this; + once(event: 'finish', listener: () => void): this; + once(event: 'pipe', listener: (src: Readable) => void): this; + once(event: 'unpipe', listener: (src: Readable) => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + prependListener(event: 'close', listener: () => void): this; + prependListener(event: 'drain', listener: () => void): this; + prependListener(event: 'error', listener: (err: Error) => void): this; + prependListener(event: 'finish', listener: () => void): this; + prependListener(event: 'pipe', listener: (src: Readable) => void): this; + prependListener(event: 'unpipe', listener: (src: Readable) => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'close', listener: () => void): this; + prependOnceListener(event: 'drain', listener: () => void): this; + prependOnceListener(event: 'error', listener: (err: Error) => void): this; + prependOnceListener(event: 'finish', listener: () => void): this; + prependOnceListener(event: 'pipe', listener: (src: Readable) => void): this; + prependOnceListener(event: 'unpipe', listener: (src: Readable) => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + removeListener(event: 'close', listener: () => void): this; + removeListener(event: 'drain', listener: () => void): this; + removeListener(event: 'error', listener: (err: Error) => void): this; + removeListener(event: 'finish', listener: () => void): this; + removeListener(event: 'pipe', listener: (src: Readable) => void): this; + removeListener(event: 'unpipe', listener: (src: Readable) => void): this; + removeListener(event: string | symbol, listener: (...args: any[]) => void): this; + } + namespace internal { + class Stream extends internal { + constructor(opts?: ReadableOptions); + } + interface StreamOptions extends Abortable { + emitClose?: boolean | undefined; + highWaterMark?: number | undefined; + objectMode?: boolean | undefined; + construct?(this: T, callback: (error?: Error | null) => void): void; + destroy?(this: T, error: Error | null, callback: (error: Error | null) => void): void; + autoDestroy?: boolean | undefined; + } + interface ReadableOptions extends StreamOptions { + encoding?: BufferEncoding | undefined; + read?(this: Readable, size: number): void; + } + /** + * @since v0.9.4 + */ + class Readable extends ReadableBase { + /** + * A utility method for creating a `Readable` from a web `ReadableStream`. + * @since v17.0.0 + * @experimental + */ + static fromWeb(readableStream: streamWeb.ReadableStream, options?: Pick): Readable; + /** + * A utility method for creating a web `ReadableStream` from a `Readable`. + * @since v17.0.0 + * @experimental + */ + static toWeb(streamReadable: Readable): streamWeb.ReadableStream; + } + interface WritableOptions extends StreamOptions { + decodeStrings?: boolean | undefined; + defaultEncoding?: BufferEncoding | undefined; + write?(this: Writable, chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void; + writev?( + this: Writable, + chunks: Array<{ + chunk: any; + encoding: BufferEncoding; + }>, + callback: (error?: Error | null) => void + ): void; + final?(this: Writable, callback: (error?: Error | null) => void): void; + } + /** + * @since v0.9.4 + */ + class Writable extends WritableBase { + /** + * A utility method for creating a `Writable` from a web `WritableStream`. + * @since v17.0.0 + * @experimental + */ + static fromWeb(writableStream: streamWeb.WritableStream, options?: Pick): Writable; + /** + * A utility method for creating a web `WritableStream` from a `Writable`. + * @since v17.0.0 + * @experimental + */ + static toWeb(streamWritable: Writable): streamWeb.WritableStream; + } + interface DuplexOptions extends ReadableOptions, WritableOptions { + allowHalfOpen?: boolean | undefined; + readableObjectMode?: boolean | undefined; + writableObjectMode?: boolean | undefined; + readableHighWaterMark?: number | undefined; + writableHighWaterMark?: number | undefined; + writableCorked?: number | undefined; + construct?(this: Duplex, callback: (error?: Error | null) => void): void; + read?(this: Duplex, size: number): void; + write?(this: Duplex, chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void; + writev?( + this: Duplex, + chunks: Array<{ + chunk: any; + encoding: BufferEncoding; + }>, + callback: (error?: Error | null) => void + ): void; + final?(this: Duplex, callback: (error?: Error | null) => void): void; + destroy?(this: Duplex, error: Error | null, callback: (error: Error | null) => void): void; + } + /** + * Duplex streams are streams that implement both the `Readable` and `Writable` interfaces. + * + * Examples of `Duplex` streams include: + * + * * `TCP sockets` + * * `zlib streams` + * * `crypto streams` + * @since v0.9.4 + */ + class Duplex extends ReadableBase implements WritableBase { + readonly writable: boolean; + readonly writableEnded: boolean; + readonly writableFinished: boolean; + readonly writableHighWaterMark: number; + readonly writableLength: number; + readonly writableObjectMode: boolean; + readonly writableCorked: number; + readonly writableNeedDrain: boolean; + readonly closed: boolean; + readonly errored: Error | null; + /** + * If `false` then the stream will automatically end the writable side when the + * readable side ends. Set initially by the `allowHalfOpen` constructor option, + * which defaults to `true`. + * + * This can be changed manually to change the half-open behavior of an existing`Duplex` stream instance, but must be changed before the `'end'` event is + * emitted. + * @since v0.9.4 + */ + allowHalfOpen: boolean; + constructor(opts?: DuplexOptions); + /** + * A utility method for creating duplex streams. + * + * - `Stream` converts writable stream into writable `Duplex` and readable stream + * to `Duplex`. + * - `Blob` converts into readable `Duplex`. + * - `string` converts into readable `Duplex`. + * - `ArrayBuffer` converts into readable `Duplex`. + * - `AsyncIterable` converts into a readable `Duplex`. Cannot yield `null`. + * - `AsyncGeneratorFunction` converts into a readable/writable transform + * `Duplex`. Must take a source `AsyncIterable` as first parameter. Cannot yield + * `null`. + * - `AsyncFunction` converts into a writable `Duplex`. Must return + * either `null` or `undefined` + * - `Object ({ writable, readable })` converts `readable` and + * `writable` into `Stream` and then combines them into `Duplex` where the + * `Duplex` will write to the `writable` and read from the `readable`. + * - `Promise` converts into readable `Duplex`. Value `null` is ignored. + * + * @since v16.8.0 + */ + static from(src: Stream | NodeBlob | ArrayBuffer | string | Iterable | AsyncIterable | AsyncGeneratorFunction | Promise | Object): Duplex; + _write(chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void; + _writev?( + chunks: Array<{ + chunk: any; + encoding: BufferEncoding; + }>, + callback: (error?: Error | null) => void + ): void; + _destroy(error: Error | null, callback: (error: Error | null) => void): void; + _final(callback: (error?: Error | null) => void): void; + write(chunk: any, encoding?: BufferEncoding, cb?: (error: Error | null | undefined) => void): boolean; + write(chunk: any, cb?: (error: Error | null | undefined) => void): boolean; + setDefaultEncoding(encoding: BufferEncoding): this; + end(cb?: () => void): this; + end(chunk: any, cb?: () => void): this; + end(chunk: any, encoding?: BufferEncoding, cb?: () => void): this; + cork(): void; + uncork(): void; + /** + * A utility method for creating a web `ReadableStream` and `WritableStream` from a `Duplex`. + * @since v17.0.0 + * @experimental + */ + static toWeb(streamDuplex: Duplex): { + readable: streamWeb.ReadableStream; + writable: streamWeb.WritableStream; + }; + /** + * A utility method for creating a `Duplex` from a web `ReadableStream` and `WritableStream`. + * @since v17.0.0 + * @experimental + */ + static fromWeb( + duplexStream: { + readable: streamWeb.ReadableStream; + writable: streamWeb.WritableStream; + }, + options?: Pick + ): Duplex; + /** + * Event emitter + * The defined events on documents including: + * 1. close + * 2. data + * 3. drain + * 4. end + * 5. error + * 6. finish + * 7. pause + * 8. pipe + * 9. readable + * 10. resume + * 11. unpipe + */ + addListener(event: 'close', listener: () => void): this; + addListener(event: 'data', listener: (chunk: any) => void): this; + addListener(event: 'drain', listener: () => void): this; + addListener(event: 'end', listener: () => void): this; + addListener(event: 'error', listener: (err: Error) => void): this; + addListener(event: 'finish', listener: () => void): this; + addListener(event: 'pause', listener: () => void): this; + addListener(event: 'pipe', listener: (src: Readable) => void): this; + addListener(event: 'readable', listener: () => void): this; + addListener(event: 'resume', listener: () => void): this; + addListener(event: 'unpipe', listener: (src: Readable) => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + emit(event: 'close'): boolean; + emit(event: 'data', chunk: any): boolean; + emit(event: 'drain'): boolean; + emit(event: 'end'): boolean; + emit(event: 'error', err: Error): boolean; + emit(event: 'finish'): boolean; + emit(event: 'pause'): boolean; + emit(event: 'pipe', src: Readable): boolean; + emit(event: 'readable'): boolean; + emit(event: 'resume'): boolean; + emit(event: 'unpipe', src: Readable): boolean; + emit(event: string | symbol, ...args: any[]): boolean; + on(event: 'close', listener: () => void): this; + on(event: 'data', listener: (chunk: any) => void): this; + on(event: 'drain', listener: () => void): this; + on(event: 'end', listener: () => void): this; + on(event: 'error', listener: (err: Error) => void): this; + on(event: 'finish', listener: () => void): this; + on(event: 'pause', listener: () => void): this; + on(event: 'pipe', listener: (src: Readable) => void): this; + on(event: 'readable', listener: () => void): this; + on(event: 'resume', listener: () => void): this; + on(event: 'unpipe', listener: (src: Readable) => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + once(event: 'close', listener: () => void): this; + once(event: 'data', listener: (chunk: any) => void): this; + once(event: 'drain', listener: () => void): this; + once(event: 'end', listener: () => void): this; + once(event: 'error', listener: (err: Error) => void): this; + once(event: 'finish', listener: () => void): this; + once(event: 'pause', listener: () => void): this; + once(event: 'pipe', listener: (src: Readable) => void): this; + once(event: 'readable', listener: () => void): this; + once(event: 'resume', listener: () => void): this; + once(event: 'unpipe', listener: (src: Readable) => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + prependListener(event: 'close', listener: () => void): this; + prependListener(event: 'data', listener: (chunk: any) => void): this; + prependListener(event: 'drain', listener: () => void): this; + prependListener(event: 'end', listener: () => void): this; + prependListener(event: 'error', listener: (err: Error) => void): this; + prependListener(event: 'finish', listener: () => void): this; + prependListener(event: 'pause', listener: () => void): this; + prependListener(event: 'pipe', listener: (src: Readable) => void): this; + prependListener(event: 'readable', listener: () => void): this; + prependListener(event: 'resume', listener: () => void): this; + prependListener(event: 'unpipe', listener: (src: Readable) => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'close', listener: () => void): this; + prependOnceListener(event: 'data', listener: (chunk: any) => void): this; + prependOnceListener(event: 'drain', listener: () => void): this; + prependOnceListener(event: 'end', listener: () => void): this; + prependOnceListener(event: 'error', listener: (err: Error) => void): this; + prependOnceListener(event: 'finish', listener: () => void): this; + prependOnceListener(event: 'pause', listener: () => void): this; + prependOnceListener(event: 'pipe', listener: (src: Readable) => void): this; + prependOnceListener(event: 'readable', listener: () => void): this; + prependOnceListener(event: 'resume', listener: () => void): this; + prependOnceListener(event: 'unpipe', listener: (src: Readable) => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + removeListener(event: 'close', listener: () => void): this; + removeListener(event: 'data', listener: (chunk: any) => void): this; + removeListener(event: 'drain', listener: () => void): this; + removeListener(event: 'end', listener: () => void): this; + removeListener(event: 'error', listener: (err: Error) => void): this; + removeListener(event: 'finish', listener: () => void): this; + removeListener(event: 'pause', listener: () => void): this; + removeListener(event: 'pipe', listener: (src: Readable) => void): this; + removeListener(event: 'readable', listener: () => void): this; + removeListener(event: 'resume', listener: () => void): this; + removeListener(event: 'unpipe', listener: (src: Readable) => void): this; + removeListener(event: string | symbol, listener: (...args: any[]) => void): this; + } + type TransformCallback = (error?: Error | null, data?: any) => void; + interface TransformOptions extends DuplexOptions { + construct?(this: Transform, callback: (error?: Error | null) => void): void; + read?(this: Transform, size: number): void; + write?(this: Transform, chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void; + writev?( + this: Transform, + chunks: Array<{ + chunk: any; + encoding: BufferEncoding; + }>, + callback: (error?: Error | null) => void + ): void; + final?(this: Transform, callback: (error?: Error | null) => void): void; + destroy?(this: Transform, error: Error | null, callback: (error: Error | null) => void): void; + transform?(this: Transform, chunk: any, encoding: BufferEncoding, callback: TransformCallback): void; + flush?(this: Transform, callback: TransformCallback): void; + } + /** + * Transform streams are `Duplex` streams where the output is in some way + * related to the input. Like all `Duplex` streams, `Transform` streams + * implement both the `Readable` and `Writable` interfaces. + * + * Examples of `Transform` streams include: + * + * * `zlib streams` + * * `crypto streams` + * @since v0.9.4 + */ + class Transform extends Duplex { + constructor(opts?: TransformOptions); + _transform(chunk: any, encoding: BufferEncoding, callback: TransformCallback): void; + _flush(callback: TransformCallback): void; + } + /** + * The `stream.PassThrough` class is a trivial implementation of a `Transform` stream that simply passes the input bytes across to the output. Its purpose is + * primarily for examples and testing, but there are some use cases where`stream.PassThrough` is useful as a building block for novel sorts of streams. + */ + class PassThrough extends Transform {} + /** + * A stream to attach a signal to. + * + * Attaches an AbortSignal to a readable or writeable stream. This lets code + * control stream destruction using an `AbortController`. + * + * Calling `abort` on the `AbortController` corresponding to the passed`AbortSignal` will behave the same way as calling `.destroy(new AbortError())`on the stream, and `controller.error(new + * AbortError())` for webstreams. + * + * ```js + * const fs = require('node:fs'); + * + * const controller = new AbortController(); + * const read = addAbortSignal( + * controller.signal, + * fs.createReadStream(('object.json')), + * ); + * // Later, abort the operation closing the stream + * controller.abort(); + * ``` + * + * Or using an `AbortSignal` with a readable stream as an async iterable: + * + * ```js + * const controller = new AbortController(); + * setTimeout(() => controller.abort(), 10_000); // set a timeout + * const stream = addAbortSignal( + * controller.signal, + * fs.createReadStream(('object.json')), + * ); + * (async () => { + * try { + * for await (const chunk of stream) { + * await process(chunk); + * } + * } catch (e) { + * if (e.name === 'AbortError') { + * // The operation was cancelled + * } else { + * throw e; + * } + * } + * })(); + * ``` + * + * Or using an `AbortSignal` with a ReadableStream: + * + * ```js + * const controller = new AbortController(); + * const rs = new ReadableStream({ + * start(controller) { + * controller.enqueue('hello'); + * controller.enqueue('world'); + * controller.close(); + * }, + * }); + * + * addAbortSignal(controller.signal, rs); + * + * finished(rs, (err) => { + * if (err) { + * if (err.name === 'AbortError') { + * // The operation was cancelled + * } + * } + * }); + * + * const reader = rs.getReader(); + * + * reader.read().then(({ value, done }) => { + * console.log(value); // hello + * console.log(done); // false + * controller.abort(); + * }); + * ``` + * @since v15.4.0 + * @param signal A signal representing possible cancellation + * @param stream a stream to attach a signal to + */ + function addAbortSignal(signal: AbortSignal, stream: T): T; + /** + * Returns the default highWaterMark used by streams. + * Defaults to `16384` (16 KiB), or `16` for `objectMode`. + * @since v19.9.0 + * @param objectMode + */ + function getDefaultHighWaterMark(objectMode: boolean): number; + /** + * Sets the default highWaterMark used by streams. + * @since v19.9.0 + * @param objectMode + * @param value highWaterMark value + */ + function setDefaultHighWaterMark(objectMode: boolean, value: number): void; + interface FinishedOptions extends Abortable { + error?: boolean | undefined; + readable?: boolean | undefined; + writable?: boolean | undefined; + } + /** + * A readable and/or writable stream/webstream. + * + * A function to get notified when a stream is no longer readable, writable + * or has experienced an error or a premature close event. + * + * ```js + * const { finished } = require('node:stream'); + * const fs = require('node:fs'); + * + * const rs = fs.createReadStream('archive.tar'); + * + * finished(rs, (err) => { + * if (err) { + * console.error('Stream failed.', err); + * } else { + * console.log('Stream is done reading.'); + * } + * }); + * + * rs.resume(); // Drain the stream. + * ``` + * + * Especially useful in error handling scenarios where a stream is destroyed + * prematurely (like an aborted HTTP request), and will not emit `'end'`or `'finish'`. + * + * The `finished` API provides `promise version`. + * + * `stream.finished()` leaves dangling event listeners (in particular`'error'`, `'end'`, `'finish'` and `'close'`) after `callback` has been + * invoked. The reason for this is so that unexpected `'error'` events (due to + * incorrect stream implementations) do not cause unexpected crashes. + * If this is unwanted behavior then the returned cleanup function needs to be + * invoked in the callback: + * + * ```js + * const cleanup = finished(rs, (err) => { + * cleanup(); + * // ... + * }); + * ``` + * @since v10.0.0 + * @param stream A readable and/or writable stream. + * @param callback A callback function that takes an optional error argument. + * @return A cleanup function which removes all registered listeners. + */ + function finished(stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, options: FinishedOptions, callback: (err?: NodeJS.ErrnoException | null) => void): () => void; + function finished(stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, callback: (err?: NodeJS.ErrnoException | null) => void): () => void; + namespace finished { + function __promisify__(stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, options?: FinishedOptions): Promise; + } + type PipelineSourceFunction = () => Iterable | AsyncIterable; + type PipelineSource = Iterable | AsyncIterable | NodeJS.ReadableStream | PipelineSourceFunction; + type PipelineTransform, U> = + | NodeJS.ReadWriteStream + | ((source: S extends (...args: any[]) => Iterable | AsyncIterable ? AsyncIterable : S) => AsyncIterable); + type PipelineTransformSource = PipelineSource | PipelineTransform; + type PipelineDestinationIterableFunction = (source: AsyncIterable) => AsyncIterable; + type PipelineDestinationPromiseFunction = (source: AsyncIterable) => Promise

; + type PipelineDestination, P> = S extends PipelineTransformSource + ? NodeJS.WritableStream | PipelineDestinationIterableFunction | PipelineDestinationPromiseFunction + : never; + type PipelineCallback> = S extends PipelineDestinationPromiseFunction + ? (err: NodeJS.ErrnoException | null, value: P) => void + : (err: NodeJS.ErrnoException | null) => void; + type PipelinePromise> = S extends PipelineDestinationPromiseFunction ? Promise

: Promise; + interface PipelineOptions { + signal?: AbortSignal | undefined; + end?: boolean | undefined; + } + /** + * A module method to pipe between streams and generators forwarding errors and + * properly cleaning up and provide a callback when the pipeline is complete. + * + * ```js + * const { pipeline } = require('node:stream'); + * const fs = require('node:fs'); + * const zlib = require('node:zlib'); + * + * // Use the pipeline API to easily pipe a series of streams + * // together and get notified when the pipeline is fully done. + * + * // A pipeline to gzip a potentially huge tar file efficiently: + * + * pipeline( + * fs.createReadStream('archive.tar'), + * zlib.createGzip(), + * fs.createWriteStream('archive.tar.gz'), + * (err) => { + * if (err) { + * console.error('Pipeline failed.', err); + * } else { + * console.log('Pipeline succeeded.'); + * } + * }, + * ); + * ``` + * + * The `pipeline` API provides a `promise version`. + * + * `stream.pipeline()` will call `stream.destroy(err)` on all streams except: + * + * * `Readable` streams which have emitted `'end'` or `'close'`. + * * `Writable` streams which have emitted `'finish'` or `'close'`. + * + * `stream.pipeline()` leaves dangling event listeners on the streams + * after the `callback` has been invoked. In the case of reuse of streams after + * failure, this can cause event listener leaks and swallowed errors. If the last + * stream is readable, dangling event listeners will be removed so that the last + * stream can be consumed later. + * + * `stream.pipeline()` closes all the streams when an error is raised. + * The `IncomingRequest` usage with `pipeline` could lead to an unexpected behavior + * once it would destroy the socket without sending the expected response. + * See the example below: + * + * ```js + * const fs = require('node:fs'); + * const http = require('node:http'); + * const { pipeline } = require('node:stream'); + * + * const server = http.createServer((req, res) => { + * const fileStream = fs.createReadStream('./fileNotExist.txt'); + * pipeline(fileStream, res, (err) => { + * if (err) { + * console.log(err); // No such file + * // this message can't be sent once `pipeline` already destroyed the socket + * return res.end('error!!!'); + * } + * }); + * }); + * ``` + * @since v10.0.0 + * @param callback Called when the pipeline is fully done. + */ + function pipeline, B extends PipelineDestination>( + source: A, + destination: B, + callback?: PipelineCallback + ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream; + function pipeline, T1 extends PipelineTransform, B extends PipelineDestination>( + source: A, + transform1: T1, + destination: B, + callback?: PipelineCallback + ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream; + function pipeline, T1 extends PipelineTransform, T2 extends PipelineTransform, B extends PipelineDestination>( + source: A, + transform1: T1, + transform2: T2, + destination: B, + callback?: PipelineCallback + ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream; + function pipeline< + A extends PipelineSource, + T1 extends PipelineTransform, + T2 extends PipelineTransform, + T3 extends PipelineTransform, + B extends PipelineDestination + >(source: A, transform1: T1, transform2: T2, transform3: T3, destination: B, callback?: PipelineCallback): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream; + function pipeline< + A extends PipelineSource, + T1 extends PipelineTransform, + T2 extends PipelineTransform, + T3 extends PipelineTransform, + T4 extends PipelineTransform, + B extends PipelineDestination + >(source: A, transform1: T1, transform2: T2, transform3: T3, transform4: T4, destination: B, callback?: PipelineCallback): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream; + function pipeline( + streams: ReadonlyArray, + callback?: (err: NodeJS.ErrnoException | null) => void + ): NodeJS.WritableStream; + function pipeline( + stream1: NodeJS.ReadableStream, + stream2: NodeJS.ReadWriteStream | NodeJS.WritableStream, + ...streams: Array void)> + ): NodeJS.WritableStream; + namespace pipeline { + function __promisify__, B extends PipelineDestination>(source: A, destination: B, options?: PipelineOptions): PipelinePromise; + function __promisify__, T1 extends PipelineTransform, B extends PipelineDestination>( + source: A, + transform1: T1, + destination: B, + options?: PipelineOptions + ): PipelinePromise; + function __promisify__, T1 extends PipelineTransform, T2 extends PipelineTransform, B extends PipelineDestination>( + source: A, + transform1: T1, + transform2: T2, + destination: B, + options?: PipelineOptions + ): PipelinePromise; + function __promisify__< + A extends PipelineSource, + T1 extends PipelineTransform, + T2 extends PipelineTransform, + T3 extends PipelineTransform, + B extends PipelineDestination + >(source: A, transform1: T1, transform2: T2, transform3: T3, destination: B, options?: PipelineOptions): PipelinePromise; + function __promisify__< + A extends PipelineSource, + T1 extends PipelineTransform, + T2 extends PipelineTransform, + T3 extends PipelineTransform, + T4 extends PipelineTransform, + B extends PipelineDestination + >(source: A, transform1: T1, transform2: T2, transform3: T3, transform4: T4, destination: B, options?: PipelineOptions): PipelinePromise; + function __promisify__(streams: ReadonlyArray, options?: PipelineOptions): Promise; + function __promisify__( + stream1: NodeJS.ReadableStream, + stream2: NodeJS.ReadWriteStream | NodeJS.WritableStream, + ...streams: Array + ): Promise; + } + interface Pipe { + close(): void; + hasRef(): boolean; + ref(): void; + unref(): void; + } + /** + * Returns whether the stream has encountered an error. + * @since v17.3.0, v16.14.0 + * @experimental + */ + function isErrored(stream: Readable | Writable | NodeJS.ReadableStream | NodeJS.WritableStream): boolean; + /** + * Returns whether the stream is readable. + * @since v17.4.0, v16.14.0 + * @experimental + */ + function isReadable(stream: Readable | NodeJS.ReadableStream): boolean; + const promises: typeof streamPromises; + const consumers: typeof streamConsumers; + } + export = internal; +} +declare module 'stream' { + import stream = require('node:stream'); + export = stream; +} diff --git a/node_modules/@types/node/ts4.8/stream/consumers.d.ts b/node_modules/@types/node/ts4.8/stream/consumers.d.ts new file mode 100644 index 0000000..7b9ca2e --- /dev/null +++ b/node_modules/@types/node/ts4.8/stream/consumers.d.ts @@ -0,0 +1,12 @@ +declare module 'node:stream/consumers' { + import { Blob as NodeBlob } from 'node:buffer'; + import { Readable } from 'node:stream'; + function buffer(stream: NodeJS.ReadableStream | Readable | AsyncIterator): Promise; + function text(stream: NodeJS.ReadableStream | Readable | AsyncIterator): Promise; + function arrayBuffer(stream: NodeJS.ReadableStream | Readable | AsyncIterator): Promise; + function blob(stream: NodeJS.ReadableStream | Readable | AsyncIterator): Promise; + function json(stream: NodeJS.ReadableStream | Readable | AsyncIterator): Promise; +} +declare module 'stream/consumers' { + export * from 'node:stream/consumers'; +} diff --git a/node_modules/@types/node/ts4.8/stream/promises.d.ts b/node_modules/@types/node/ts4.8/stream/promises.d.ts new file mode 100644 index 0000000..26c8d11 --- /dev/null +++ b/node_modules/@types/node/ts4.8/stream/promises.d.ts @@ -0,0 +1,42 @@ +declare module 'node:stream/promises' { + import { FinishedOptions, PipelineSource, PipelineTransform, PipelineDestination, PipelinePromise, PipelineOptions } from 'node:stream'; + function finished(stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, options?: FinishedOptions): Promise; + function pipeline, B extends PipelineDestination>(source: A, destination: B, options?: PipelineOptions): PipelinePromise; + function pipeline, T1 extends PipelineTransform, B extends PipelineDestination>( + source: A, + transform1: T1, + destination: B, + options?: PipelineOptions + ): PipelinePromise; + function pipeline, T1 extends PipelineTransform, T2 extends PipelineTransform, B extends PipelineDestination>( + source: A, + transform1: T1, + transform2: T2, + destination: B, + options?: PipelineOptions + ): PipelinePromise; + function pipeline< + A extends PipelineSource, + T1 extends PipelineTransform, + T2 extends PipelineTransform, + T3 extends PipelineTransform, + B extends PipelineDestination + >(source: A, transform1: T1, transform2: T2, transform3: T3, destination: B, options?: PipelineOptions): PipelinePromise; + function pipeline< + A extends PipelineSource, + T1 extends PipelineTransform, + T2 extends PipelineTransform, + T3 extends PipelineTransform, + T4 extends PipelineTransform, + B extends PipelineDestination + >(source: A, transform1: T1, transform2: T2, transform3: T3, transform4: T4, destination: B, options?: PipelineOptions): PipelinePromise; + function pipeline(streams: ReadonlyArray, options?: PipelineOptions): Promise; + function pipeline( + stream1: NodeJS.ReadableStream, + stream2: NodeJS.ReadWriteStream | NodeJS.WritableStream, + ...streams: Array + ): Promise; +} +declare module 'stream/promises' { + export * from 'node:stream/promises'; +} diff --git a/node_modules/@types/node/ts4.8/stream/web.d.ts b/node_modules/@types/node/ts4.8/stream/web.d.ts new file mode 100644 index 0000000..8f814f0 --- /dev/null +++ b/node_modules/@types/node/ts4.8/stream/web.d.ts @@ -0,0 +1,330 @@ +declare module 'node:stream/web' { + // stub module, pending copy&paste from .d.ts or manual impl + // copy from lib.dom.d.ts + interface ReadableWritablePair { + readable: ReadableStream; + /** + * Provides a convenient, chainable way of piping this readable stream + * through a transform stream (or any other { writable, readable } + * pair). It simply pipes the stream into the writable side of the + * supplied pair, and returns the readable side for further use. + * + * Piping a stream will lock it for the duration of the pipe, preventing + * any other consumer from acquiring a reader. + */ + writable: WritableStream; + } + interface StreamPipeOptions { + preventAbort?: boolean; + preventCancel?: boolean; + /** + * Pipes this readable stream to a given writable stream destination. + * The way in which the piping process behaves under various error + * conditions can be customized with a number of passed options. It + * returns a promise that fulfills when the piping process completes + * successfully, or rejects if any errors were encountered. + * + * Piping a stream will lock it for the duration of the pipe, preventing + * any other consumer from acquiring a reader. + * + * Errors and closures of the source and destination streams propagate + * as follows: + * + * An error in this source readable stream will abort destination, + * unless preventAbort is truthy. The returned promise will be rejected + * with the source's error, or with any error that occurs during + * aborting the destination. + * + * An error in destination will cancel this source readable stream, + * unless preventCancel is truthy. The returned promise will be rejected + * with the destination's error, or with any error that occurs during + * canceling the source. + * + * When this source readable stream closes, destination will be closed, + * unless preventClose is truthy. The returned promise will be fulfilled + * once this process completes, unless an error is encountered while + * closing the destination, in which case it will be rejected with that + * error. + * + * If destination starts out closed or closing, this source readable + * stream will be canceled, unless preventCancel is true. The returned + * promise will be rejected with an error indicating piping to a closed + * stream failed, or with any error that occurs during canceling the + * source. + * + * The signal option can be set to an AbortSignal to allow aborting an + * ongoing pipe operation via the corresponding AbortController. In this + * case, this source readable stream will be canceled, and destination + * aborted, unless the respective options preventCancel or preventAbort + * are set. + */ + preventClose?: boolean; + signal?: AbortSignal; + } + interface ReadableStreamGenericReader { + readonly closed: Promise; + cancel(reason?: any): Promise; + } + interface ReadableStreamDefaultReadValueResult { + done: false; + value: T; + } + interface ReadableStreamDefaultReadDoneResult { + done: true; + value?: undefined; + } + type ReadableStreamController = ReadableStreamDefaultController; + type ReadableStreamDefaultReadResult = ReadableStreamDefaultReadValueResult | ReadableStreamDefaultReadDoneResult; + interface ReadableByteStreamControllerCallback { + (controller: ReadableByteStreamController): void | PromiseLike; + } + interface UnderlyingSinkAbortCallback { + (reason?: any): void | PromiseLike; + } + interface UnderlyingSinkCloseCallback { + (): void | PromiseLike; + } + interface UnderlyingSinkStartCallback { + (controller: WritableStreamDefaultController): any; + } + interface UnderlyingSinkWriteCallback { + (chunk: W, controller: WritableStreamDefaultController): void | PromiseLike; + } + interface UnderlyingSourceCancelCallback { + (reason?: any): void | PromiseLike; + } + interface UnderlyingSourcePullCallback { + (controller: ReadableStreamController): void | PromiseLike; + } + interface UnderlyingSourceStartCallback { + (controller: ReadableStreamController): any; + } + interface TransformerFlushCallback { + (controller: TransformStreamDefaultController): void | PromiseLike; + } + interface TransformerStartCallback { + (controller: TransformStreamDefaultController): any; + } + interface TransformerTransformCallback { + (chunk: I, controller: TransformStreamDefaultController): void | PromiseLike; + } + interface UnderlyingByteSource { + autoAllocateChunkSize?: number; + cancel?: ReadableStreamErrorCallback; + pull?: ReadableByteStreamControllerCallback; + start?: ReadableByteStreamControllerCallback; + type: 'bytes'; + } + interface UnderlyingSource { + cancel?: UnderlyingSourceCancelCallback; + pull?: UnderlyingSourcePullCallback; + start?: UnderlyingSourceStartCallback; + type?: undefined; + } + interface UnderlyingSink { + abort?: UnderlyingSinkAbortCallback; + close?: UnderlyingSinkCloseCallback; + start?: UnderlyingSinkStartCallback; + type?: undefined; + write?: UnderlyingSinkWriteCallback; + } + interface ReadableStreamErrorCallback { + (reason: any): void | PromiseLike; + } + /** This Streams API interface represents a readable stream of byte data. */ + interface ReadableStream { + readonly locked: boolean; + cancel(reason?: any): Promise; + getReader(): ReadableStreamDefaultReader; + pipeThrough(transform: ReadableWritablePair, options?: StreamPipeOptions): ReadableStream; + pipeTo(destination: WritableStream, options?: StreamPipeOptions): Promise; + tee(): [ReadableStream, ReadableStream]; + values(options?: { preventCancel?: boolean }): AsyncIterableIterator; + [Symbol.asyncIterator](): AsyncIterableIterator; + } + const ReadableStream: { + prototype: ReadableStream; + new (underlyingSource: UnderlyingByteSource, strategy?: QueuingStrategy): ReadableStream; + new (underlyingSource?: UnderlyingSource, strategy?: QueuingStrategy): ReadableStream; + }; + interface ReadableStreamDefaultReader extends ReadableStreamGenericReader { + read(): Promise>; + releaseLock(): void; + } + const ReadableStreamDefaultReader: { + prototype: ReadableStreamDefaultReader; + new (stream: ReadableStream): ReadableStreamDefaultReader; + }; + const ReadableStreamBYOBReader: any; + const ReadableStreamBYOBRequest: any; + interface ReadableByteStreamController { + readonly byobRequest: undefined; + readonly desiredSize: number | null; + close(): void; + enqueue(chunk: ArrayBufferView): void; + error(error?: any): void; + } + const ReadableByteStreamController: { + prototype: ReadableByteStreamController; + new (): ReadableByteStreamController; + }; + interface ReadableStreamDefaultController { + readonly desiredSize: number | null; + close(): void; + enqueue(chunk?: R): void; + error(e?: any): void; + } + const ReadableStreamDefaultController: { + prototype: ReadableStreamDefaultController; + new (): ReadableStreamDefaultController; + }; + interface Transformer { + flush?: TransformerFlushCallback; + readableType?: undefined; + start?: TransformerStartCallback; + transform?: TransformerTransformCallback; + writableType?: undefined; + } + interface TransformStream { + readonly readable: ReadableStream; + readonly writable: WritableStream; + } + const TransformStream: { + prototype: TransformStream; + new (transformer?: Transformer, writableStrategy?: QueuingStrategy, readableStrategy?: QueuingStrategy): TransformStream; + }; + interface TransformStreamDefaultController { + readonly desiredSize: number | null; + enqueue(chunk?: O): void; + error(reason?: any): void; + terminate(): void; + } + const TransformStreamDefaultController: { + prototype: TransformStreamDefaultController; + new (): TransformStreamDefaultController; + }; + /** + * This Streams API interface provides a standard abstraction for writing + * streaming data to a destination, known as a sink. This object comes with + * built-in back pressure and queuing. + */ + interface WritableStream { + readonly locked: boolean; + abort(reason?: any): Promise; + close(): Promise; + getWriter(): WritableStreamDefaultWriter; + } + const WritableStream: { + prototype: WritableStream; + new (underlyingSink?: UnderlyingSink, strategy?: QueuingStrategy): WritableStream; + }; + /** + * This Streams API interface is the object returned by + * WritableStream.getWriter() and once created locks the < writer to the + * WritableStream ensuring that no other streams can write to the underlying + * sink. + */ + interface WritableStreamDefaultWriter { + readonly closed: Promise; + readonly desiredSize: number | null; + readonly ready: Promise; + abort(reason?: any): Promise; + close(): Promise; + releaseLock(): void; + write(chunk?: W): Promise; + } + const WritableStreamDefaultWriter: { + prototype: WritableStreamDefaultWriter; + new (stream: WritableStream): WritableStreamDefaultWriter; + }; + /** + * This Streams API interface represents a controller allowing control of a + * WritableStream's state. When constructing a WritableStream, the + * underlying sink is given a corresponding WritableStreamDefaultController + * instance to manipulate. + */ + interface WritableStreamDefaultController { + error(e?: any): void; + } + const WritableStreamDefaultController: { + prototype: WritableStreamDefaultController; + new (): WritableStreamDefaultController; + }; + interface QueuingStrategy { + highWaterMark?: number; + size?: QueuingStrategySize; + } + interface QueuingStrategySize { + (chunk?: T): number; + } + interface QueuingStrategyInit { + /** + * Creates a new ByteLengthQueuingStrategy with the provided high water + * mark. + * + * Note that the provided high water mark will not be validated ahead of + * time. Instead, if it is negative, NaN, or not a number, the resulting + * ByteLengthQueuingStrategy will cause the corresponding stream + * constructor to throw. + */ + highWaterMark: number; + } + /** + * This Streams API interface provides a built-in byte length queuing + * strategy that can be used when constructing streams. + */ + interface ByteLengthQueuingStrategy extends QueuingStrategy { + readonly highWaterMark: number; + readonly size: QueuingStrategySize; + } + const ByteLengthQueuingStrategy: { + prototype: ByteLengthQueuingStrategy; + new (init: QueuingStrategyInit): ByteLengthQueuingStrategy; + }; + /** + * This Streams API interface provides a built-in byte length queuing + * strategy that can be used when constructing streams. + */ + interface CountQueuingStrategy extends QueuingStrategy { + readonly highWaterMark: number; + readonly size: QueuingStrategySize; + } + const CountQueuingStrategy: { + prototype: CountQueuingStrategy; + new (init: QueuingStrategyInit): CountQueuingStrategy; + }; + interface TextEncoderStream { + /** Returns "utf-8". */ + readonly encoding: 'utf-8'; + readonly readable: ReadableStream; + readonly writable: WritableStream; + readonly [Symbol.toStringTag]: string; + } + const TextEncoderStream: { + prototype: TextEncoderStream; + new (): TextEncoderStream; + }; + interface TextDecoderOptions { + fatal?: boolean; + ignoreBOM?: boolean; + } + type BufferSource = ArrayBufferView | ArrayBuffer; + interface TextDecoderStream { + /** Returns encoding's name, lower cased. */ + readonly encoding: string; + /** Returns `true` if error mode is "fatal", and `false` otherwise. */ + readonly fatal: boolean; + /** Returns `true` if ignore BOM flag is set, and `false` otherwise. */ + readonly ignoreBOM: boolean; + readonly readable: ReadableStream; + readonly writable: WritableStream; + readonly [Symbol.toStringTag]: string; + } + const TextDecoderStream: { + prototype: TextDecoderStream; + new (label?: string, options?: TextDecoderOptions): TextDecoderStream; + }; +} +declare module 'stream/web' { + export * from 'node:stream/web'; +} diff --git a/node_modules/@types/node/ts4.8/string_decoder.d.ts b/node_modules/@types/node/ts4.8/string_decoder.d.ts new file mode 100644 index 0000000..c87e7d5 --- /dev/null +++ b/node_modules/@types/node/ts4.8/string_decoder.d.ts @@ -0,0 +1,67 @@ +/** + * The `node:string_decoder` module provides an API for decoding `Buffer` objects + * into strings in a manner that preserves encoded multi-byte UTF-8 and UTF-16 + * characters. It can be accessed using: + * + * ```js + * const { StringDecoder } = require('node:string_decoder'); + * ``` + * + * The following example shows the basic use of the `StringDecoder` class. + * + * ```js + * const { StringDecoder } = require('node:string_decoder'); + * const decoder = new StringDecoder('utf8'); + * + * const cent = Buffer.from([0xC2, 0xA2]); + * console.log(decoder.write(cent)); + * + * const euro = Buffer.from([0xE2, 0x82, 0xAC]); + * console.log(decoder.write(euro)); + * ``` + * + * When a `Buffer` instance is written to the `StringDecoder` instance, an + * internal buffer is used to ensure that the decoded string does not contain + * any incomplete multibyte characters. These are held in the buffer until the + * next call to `stringDecoder.write()` or until `stringDecoder.end()` is called. + * + * In the following example, the three UTF-8 encoded bytes of the European Euro + * symbol (`€`) are written over three separate operations: + * + * ```js + * const { StringDecoder } = require('node:string_decoder'); + * const decoder = new StringDecoder('utf8'); + * + * decoder.write(Buffer.from([0xE2])); + * decoder.write(Buffer.from([0x82])); + * console.log(decoder.end(Buffer.from([0xAC]))); + * ``` + * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/string_decoder.js) + */ +declare module 'node:string_decoder' { + class StringDecoder { + constructor(encoding?: BufferEncoding); + /** + * Returns a decoded string, ensuring that any incomplete multibyte characters at + * the end of the `Buffer`, or `TypedArray`, or `DataView` are omitted from the + * returned string and stored in an internal buffer for the next call to`stringDecoder.write()` or `stringDecoder.end()`. + * @since v0.1.99 + * @param buffer A `Buffer`, or `TypedArray`, or `DataView` containing the bytes to decode. + */ + write(buffer: Buffer): string; + /** + * Returns any remaining input stored in the internal buffer as a string. Bytes + * representing incomplete UTF-8 and UTF-16 characters will be replaced with + * substitution characters appropriate for the character encoding. + * + * If the `buffer` argument is provided, one final call to `stringDecoder.write()`is performed before returning the remaining input. + * After `end()` is called, the `stringDecoder` object can be reused for new input. + * @since v0.9.3 + * @param buffer A `Buffer`, or `TypedArray`, or `DataView` containing the bytes to decode. + */ + end(buffer?: Buffer): string; + } +} +declare module 'string_decoder' { + export * from 'node:string_decoder'; +} diff --git a/node_modules/@types/node/ts4.8/test.d.ts b/node_modules/@types/node/ts4.8/test.d.ts new file mode 100644 index 0000000..6d8c91f --- /dev/null +++ b/node_modules/@types/node/ts4.8/test.d.ts @@ -0,0 +1,1461 @@ +/** + * The `node:test` module facilitates the creation of JavaScript tests. + * To access it: + * + * ```js + * import test from 'node:test'; + * ``` + * + * This module is only available under the `node:` scheme. The following will not + * work: + * + * ```js + * import test from 'test'; + * ``` + * + * Tests created via the `test` module consist of a single function that is + * processed in one of three ways: + * + * 1. A synchronous function that is considered failing if it throws an exception, + * and is considered passing otherwise. + * 2. A function that returns a `Promise` that is considered failing if the`Promise` rejects, and is considered passing if the `Promise` resolves. + * 3. A function that receives a callback function. If the callback receives any + * truthy value as its first argument, the test is considered failing. If a + * falsy value is passed as the first argument to the callback, the test is + * considered passing. If the test function receives a callback function and + * also returns a `Promise`, the test will fail. + * + * The following example illustrates how tests are written using the`test` module. + * + * ```js + * test('synchronous passing test', (t) => { + * // This test passes because it does not throw an exception. + * assert.strictEqual(1, 1); + * }); + * + * test('synchronous failing test', (t) => { + * // This test fails because it throws an exception. + * assert.strictEqual(1, 2); + * }); + * + * test('asynchronous passing test', async (t) => { + * // This test passes because the Promise returned by the async + * // function is not rejected. + * assert.strictEqual(1, 1); + * }); + * + * test('asynchronous failing test', async (t) => { + * // This test fails because the Promise returned by the async + * // function is rejected. + * assert.strictEqual(1, 2); + * }); + * + * test('failing test using Promises', (t) => { + * // Promises can be used directly as well. + * return new Promise((resolve, reject) => { + * setImmediate(() => { + * reject(new Error('this will cause the test to fail')); + * }); + * }); + * }); + * + * test('callback passing test', (t, done) => { + * // done() is the callback function. When the setImmediate() runs, it invokes + * // done() with no arguments. + * setImmediate(done); + * }); + * + * test('callback failing test', (t, done) => { + * // When the setImmediate() runs, done() is invoked with an Error object and + * // the test fails. + * setImmediate(() => { + * done(new Error('callback failure')); + * }); + * }); + * ``` + * + * If any tests fail, the process exit code is set to `1`. + * @since v18.0.0, v16.17.0 + * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/test.js) + */ +declare module 'node:test' { + import { Readable } from 'node:stream'; + import { AsyncResource } from 'node:async_hooks'; + /** + * ```js + * import { tap } from 'node:test/reporters'; + * import process from 'node:process'; + * + * run({ files: [path.resolve('./tests/test.js')] }) + * .compose(tap) + * .pipe(process.stdout); + * ``` + * @since v18.9.0, v16.19.0 + * @param options Configuration options for running tests. The following properties are supported: + */ + function run(options?: RunOptions): TestsStream; + /** + * The `test()` function is the value imported from the `test` module. Each + * invocation of this function results in reporting the test to the `TestsStream`. + * + * The `TestContext` object passed to the `fn` argument can be used to perform + * actions related to the current test. Examples include skipping the test, adding + * additional diagnostic information, or creating subtests. + * + * `test()` returns a `Promise` that resolves once the test completes. + * if `test()` is called within a `describe()` block, it resolve immediately. + * The return value can usually be discarded for top level tests. + * However, the return value from subtests should be used to prevent the parent + * test from finishing first and cancelling the subtest + * as shown in the following example. + * + * ```js + * test('top level test', async (t) => { + * // The setTimeout() in the following subtest would cause it to outlive its + * // parent test if 'await' is removed on the next line. Once the parent test + * // completes, it will cancel any outstanding subtests. + * await t.test('longer running subtest', async (t) => { + * return new Promise((resolve, reject) => { + * setTimeout(resolve, 1000); + * }); + * }); + * }); + * ``` + * + * The `timeout` option can be used to fail the test if it takes longer than`timeout` milliseconds to complete. However, it is not a reliable mechanism for + * canceling tests because a running test might block the application thread and + * thus prevent the scheduled cancellation. + * @since v18.0.0, v16.17.0 + * @param [name='The name'] The name of the test, which is displayed when reporting test results. + * @param options Configuration options for the test. The following properties are supported: + * @param [fn='A no-op function'] The function under test. The first argument to this function is a {@link TestContext} object. If the test uses callbacks, the callback function is passed as the + * second argument. + * @return Resolved with `undefined` once the test completes, or immediately if the test runs within {@link describe}. + */ + function test(name?: string, fn?: TestFn): Promise; + function test(name?: string, options?: TestOptions, fn?: TestFn): Promise; + function test(options?: TestOptions, fn?: TestFn): Promise; + function test(fn?: TestFn): Promise; + namespace test { + export { + after, + afterEach, + before, + beforeEach, + describe, + it, + run, + mock, + test, + skip, + todo, + only + }; + } + /** + * The `describe()` function imported from the `node:test` module. Each + * invocation of this function results in the creation of a Subtest. + * After invocation of top level `describe` functions, + * all top level tests and suites will execute. + * @param [name='The name'] The name of the suite, which is displayed when reporting test results. + * @param options Configuration options for the suite. supports the same options as `test([name][, options][, fn])`. + * @param [fn='A no-op function'] The function under suite declaring all subtests and subsuites. The first argument to this function is a {@link SuiteContext} object. + * @return Immediately fulfilled with `undefined`. + */ + function describe(name?: string, options?: TestOptions, fn?: SuiteFn): Promise; + function describe(name?: string, fn?: SuiteFn): Promise; + function describe(options?: TestOptions, fn?: SuiteFn): Promise; + function describe(fn?: SuiteFn): Promise; + namespace describe { + /** + * Shorthand for skipping a suite, same as `describe([name], { skip: true }[, fn])`. + */ + function skip(name?: string, options?: TestOptions, fn?: SuiteFn): Promise; + function skip(name?: string, fn?: SuiteFn): Promise; + function skip(options?: TestOptions, fn?: SuiteFn): Promise; + function skip(fn?: SuiteFn): Promise; + /** + * Shorthand for marking a suite as `TODO`, same as `describe([name], { todo: true }[, fn])`. + */ + function todo(name?: string, options?: TestOptions, fn?: SuiteFn): Promise; + function todo(name?: string, fn?: SuiteFn): Promise; + function todo(options?: TestOptions, fn?: SuiteFn): Promise; + function todo(fn?: SuiteFn): Promise; + /** + * Shorthand for marking a suite as `only`, same as `describe([name], { only: true }[, fn])`. + * @since v18.15.0 + */ + function only(name?: string, options?: TestOptions, fn?: SuiteFn): Promise; + function only(name?: string, fn?: SuiteFn): Promise; + function only(options?: TestOptions, fn?: SuiteFn): Promise; + function only(fn?: SuiteFn): Promise; + } + /** + * Shorthand for `test()`. + * + * The `it()` function is imported from the `node:test` module. + * @since v18.6.0, v16.17.0 + */ + function it(name?: string, options?: TestOptions, fn?: TestFn): Promise; + function it(name?: string, fn?: TestFn): Promise; + function it(options?: TestOptions, fn?: TestFn): Promise; + function it(fn?: TestFn): Promise; + namespace it { + /** + * Shorthand for skipping a test, same as `it([name], { skip: true }[, fn])`. + */ + function skip(name?: string, options?: TestOptions, fn?: TestFn): Promise; + function skip(name?: string, fn?: TestFn): Promise; + function skip(options?: TestOptions, fn?: TestFn): Promise; + function skip(fn?: TestFn): Promise; + /** + * Shorthand for marking a test as `TODO`, same as `it([name], { todo: true }[, fn])`. + */ + function todo(name?: string, options?: TestOptions, fn?: TestFn): Promise; + function todo(name?: string, fn?: TestFn): Promise; + function todo(options?: TestOptions, fn?: TestFn): Promise; + function todo(fn?: TestFn): Promise; + /** + * Shorthand for marking a test as `only`, same as `it([name], { only: true }[, fn])`. + * @since v18.15.0 + */ + function only(name?: string, options?: TestOptions, fn?: TestFn): Promise; + function only(name?: string, fn?: TestFn): Promise; + function only(options?: TestOptions, fn?: TestFn): Promise; + function only(fn?: TestFn): Promise; + } + /** + * Shorthand for skipping a test, same as `test([name], { skip: true }[, fn])`. + * @since v20.2.0 + */ + function skip(name?: string, options?: TestOptions, fn?: TestFn): Promise; + function skip(name?: string, fn?: TestFn): Promise; + function skip(options?: TestOptions, fn?: TestFn): Promise; + function skip(fn?: TestFn): Promise; + /** + * Shorthand for marking a test as `TODO`, same as `test([name], { todo: true }[, fn])`. + * @since v20.2.0 + */ + function todo(name?: string, options?: TestOptions, fn?: TestFn): Promise; + function todo(name?: string, fn?: TestFn): Promise; + function todo(options?: TestOptions, fn?: TestFn): Promise; + function todo(fn?: TestFn): Promise; + /** + * Shorthand for marking a test as `only`, same as `test([name], { only: true }[, fn])`. + * @since v20.2.0 + */ + function only(name?: string, options?: TestOptions, fn?: TestFn): Promise; + function only(name?: string, fn?: TestFn): Promise; + function only(options?: TestOptions, fn?: TestFn): Promise; + function only(fn?: TestFn): Promise; + /** + * The type of a function under test. The first argument to this function is a + * {@link TestContext} object. If the test uses callbacks, the callback function is passed as + * the second argument. + */ + type TestFn = (t: TestContext, done: (result?: any) => void) => void | Promise; + /** + * The type of a function under Suite. + */ + type SuiteFn = (s: SuiteContext) => void | Promise; + interface TestShard { + /** + * A positive integer between 1 and `` that specifies the index of the shard to run. + */ + index: number; + /** + * A positive integer that specifies the total number of shards to split the test files to. + */ + total: number; + } + interface RunOptions { + /** + * If a number is provided, then that many files would run in parallel. + * If truthy, it would run (number of cpu cores - 1) files in parallel. + * If falsy, it would only run one file at a time. + * If unspecified, subtests inherit this value from their parent. + * @default true + */ + concurrency?: number | boolean | undefined; + /** + * An array containing the list of files to run. + * If unspecified, the test runner execution model will be used. + */ + files?: readonly string[] | undefined; + /** + * Allows aborting an in-progress test execution. + * @default undefined + */ + signal?: AbortSignal | undefined; + /** + * A number of milliseconds the test will fail after. + * If unspecified, subtests inherit this value from their parent. + * @default Infinity + */ + timeout?: number | undefined; + /** + * Sets inspector port of test child process. + * If a nullish value is provided, each process gets its own port, + * incremented from the primary's `process.debugPort`. + */ + inspectPort?: number | (() => number) | undefined; + /** + * That can be used to only run tests whose name matches the provided pattern. + * Test name patterns are interpreted as JavaScript regular expressions. + * For each test that is executed, any corresponding test hooks, such as `beforeEach()`, are also run. + */ + testNamePatterns?: string | RegExp | string[] | RegExp[]; + /** + * A function that accepts the TestsStream instance and can be used to setup listeners before any tests are run. + */ + setup?: (root: unknown) => void | Promise; + /** + * Whether to run in watch mode or not. + * @default false + */ + watch?: boolean | undefined; + /** + * Running tests in a specific shard. + * @default undefined + */ + shard?: TestShard | undefined; + } + class Test extends AsyncResource { + concurrency: number; + nesting: number; + only: boolean; + reporter: TestsStream; + runOnlySubtests: boolean; + testNumber: number; + timeout: number | null; + } + /** + * A successful call to `run()` method will return a new `TestsStream` object, streaming a series of events representing the execution of the tests.`TestsStream` will emit events, in the + * order of the tests definition + * @since v18.9.0, v16.19.0 + */ + class TestsStream extends Readable implements NodeJS.ReadableStream { + addListener(event: 'test:diagnostic', listener: (data: DiagnosticData) => void): this; + addListener(event: 'test:fail', listener: (data: TestFail) => void): this; + addListener(event: 'test:pass', listener: (data: TestPass) => void): this; + addListener(event: 'test:plan', listener: (data: TestPlan) => void): this; + addListener(event: 'test:start', listener: (data: TestStart) => void): this; + addListener(event: 'test:stderr', listener: (data: TestStderr) => void): this; + addListener(event: 'test:stdout', listener: (data: TestStdout) => void): this; + addListener(event: string, listener: (...args: any[]) => void): this; + emit(event: 'test:diagnostic', data: DiagnosticData): boolean; + emit(event: 'test:fail', data: TestFail): boolean; + emit(event: 'test:pass', data: TestPass): boolean; + emit(event: 'test:plan', data: TestPlan): boolean; + emit(event: 'test:start', data: TestStart): boolean; + emit(event: 'test:stderr', data: TestStderr): boolean; + emit(event: 'test:stdout', data: TestStdout): boolean; + emit(event: string | symbol, ...args: any[]): boolean; + on(event: 'test:diagnostic', listener: (data: DiagnosticData) => void): this; + on(event: 'test:fail', listener: (data: TestFail) => void): this; + on(event: 'test:pass', listener: (data: TestPass) => void): this; + on(event: 'test:plan', listener: (data: TestPlan) => void): this; + on(event: 'test:start', listener: (data: TestStart) => void): this; + on(event: 'test:stderr', listener: (data: TestStderr) => void): this; + on(event: 'test:stdout', listener: (data: TestStdout) => void): this; + on(event: string, listener: (...args: any[]) => void): this; + once(event: 'test:diagnostic', listener: (data: DiagnosticData) => void): this; + once(event: 'test:fail', listener: (data: TestFail) => void): this; + once(event: 'test:pass', listener: (data: TestPass) => void): this; + once(event: 'test:plan', listener: (data: TestPlan) => void): this; + once(event: 'test:start', listener: (data: TestStart) => void): this; + once(event: 'test:stderr', listener: (data: TestStderr) => void): this; + once(event: 'test:stdout', listener: (data: TestStdout) => void): this; + once(event: string, listener: (...args: any[]) => void): this; + prependListener(event: 'test:diagnostic', listener: (data: DiagnosticData) => void): this; + prependListener(event: 'test:fail', listener: (data: TestFail) => void): this; + prependListener(event: 'test:pass', listener: (data: TestPass) => void): this; + prependListener(event: 'test:plan', listener: (data: TestPlan) => void): this; + prependListener(event: 'test:start', listener: (data: TestStart) => void): this; + prependListener(event: 'test:stderr', listener: (data: TestStderr) => void): this; + prependListener(event: 'test:stdout', listener: (data: TestStdout) => void): this; + prependListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'test:diagnostic', listener: (data: DiagnosticData) => void): this; + prependOnceListener(event: 'test:fail', listener: (data: TestFail) => void): this; + prependOnceListener(event: 'test:pass', listener: (data: TestPass) => void): this; + prependOnceListener(event: 'test:plan', listener: (data: TestPlan) => void): this; + prependOnceListener(event: 'test:start', listener: (data: TestStart) => void): this; + prependOnceListener(event: 'test:stderr', listener: (data: TestStderr) => void): this; + prependOnceListener(event: 'test:stdout', listener: (data: TestStdout) => void): this; + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + } + /** + * An instance of `TestContext` is passed to each test function in order to + * interact with the test runner. However, the `TestContext` constructor is not + * exposed as part of the API. + * @since v18.0.0, v16.17.0 + */ + class TestContext { + /** + * This function is used to create a hook running before subtest of the current test. + * @param fn The hook function. If the hook uses callbacks, the callback function is passed as + * the second argument. Default: A no-op function. + * @param options Configuration options for the hook. + * @since v20.1.0 + */ + before: typeof before; + /** + * This function is used to create a hook running before each subtest of the current test. + * @param fn The hook function. If the hook uses callbacks, the callback function is passed as + * the second argument. Default: A no-op function. + * @param options Configuration options for the hook. + * @since v18.8.0 + */ + beforeEach: typeof beforeEach; + /** + * This function is used to create a hook that runs after the current test finishes. + * @param fn The hook function. If the hook uses callbacks, the callback function is passed as + * the second argument. Default: A no-op function. + * @param options Configuration options for the hook. + * @since v18.13.0 + */ + after: typeof after; + /** + * This function is used to create a hook running after each subtest of the current test. + * @param fn The hook function. If the hook uses callbacks, the callback function is passed as + * the second argument. Default: A no-op function. + * @param options Configuration options for the hook. + * @since v18.8.0 + */ + afterEach: typeof afterEach; + /** + * This function is used to write diagnostics to the output. Any diagnostic + * information is included at the end of the test's results. This function does + * not return a value. + * + * ```js + * test('top level test', (t) => { + * t.diagnostic('A diagnostic message'); + * }); + * ``` + * @since v18.0.0, v16.17.0 + * @param message Message to be reported. + */ + diagnostic(message: string): void; + /** + * The name of the test. + * @since v18.8.0, v16.18.0 + */ + readonly name: string; + /** + * If `shouldRunOnlyTests` is truthy, the test context will only run tests that + * have the `only` option set. Otherwise, all tests are run. If Node.js was not + * started with the `--test-only` command-line option, this function is a + * no-op. + * + * ```js + * test('top level test', (t) => { + * // The test context can be set to run subtests with the 'only' option. + * t.runOnly(true); + * return Promise.all([ + * t.test('this subtest is now skipped'), + * t.test('this subtest is run', { only: true }), + * ]); + * }); + * ``` + * @since v18.0.0, v16.17.0 + * @param shouldRunOnlyTests Whether or not to run `only` tests. + */ + runOnly(shouldRunOnlyTests: boolean): void; + /** + * ```js + * test('top level test', async (t) => { + * await fetch('some/uri', { signal: t.signal }); + * }); + * ``` + * @since v18.7.0, v16.17.0 + */ + readonly signal: AbortSignal; + /** + * This function causes the test's output to indicate the test as skipped. If`message` is provided, it is included in the output. Calling `skip()` does + * not terminate execution of the test function. This function does not return a + * value. + * + * ```js + * test('top level test', (t) => { + * // Make sure to return here as well if the test contains additional logic. + * t.skip('this is skipped'); + * }); + * ``` + * @since v18.0.0, v16.17.0 + * @param message Optional skip message. + */ + skip(message?: string): void; + /** + * This function adds a `TODO` directive to the test's output. If `message` is + * provided, it is included in the output. Calling `todo()` does not terminate + * execution of the test function. This function does not return a value. + * + * ```js + * test('top level test', (t) => { + * // This test is marked as `TODO` + * t.todo('this is a todo'); + * }); + * ``` + * @since v18.0.0, v16.17.0 + * @param message Optional `TODO` message. + */ + todo(message?: string): void; + /** + * This function is used to create subtests under the current test. This function behaves in + * the same fashion as the top level {@link test} function. + * @since v18.0.0 + * @param name The name of the test, which is displayed when reporting test results. + * Default: The `name` property of fn, or `''` if `fn` does not have a name. + * @param options Configuration options for the test + * @param fn The function under test. This first argument to this function is a + * {@link TestContext} object. If the test uses callbacks, the callback function is + * passed as the second argument. Default: A no-op function. + * @returns A {@link Promise} resolved with `undefined` once the test completes. + */ + test: typeof test; + /** + * Each test provides its own MockTracker instance. + */ + readonly mock: MockTracker; + } + /** + * An instance of `SuiteContext` is passed to each suite function in order to + * interact with the test runner. However, the `SuiteContext` constructor is not + * exposed as part of the API. + * @since v18.7.0, v16.17.0 + */ + class SuiteContext { + /** + * The name of the suite. + * @since v18.8.0, v16.18.0 + */ + readonly name: string; + /** + * Can be used to abort test subtasks when the test has been aborted. + * @since v18.7.0, v16.17.0 + */ + readonly signal: AbortSignal; + } + interface TestOptions { + /** + * If a number is provided, then that many tests would run in parallel. + * If truthy, it would run (number of cpu cores - 1) tests in parallel. + * For subtests, it will be `Infinity` tests in parallel. + * If falsy, it would only run one test at a time. + * If unspecified, subtests inherit this value from their parent. + * @default false + */ + concurrency?: number | boolean | undefined; + /** + * If truthy, and the test context is configured to run `only` tests, then this test will be + * run. Otherwise, the test is skipped. + * @default false + */ + only?: boolean | undefined; + /** + * Allows aborting an in-progress test. + * @since v18.8.0 + */ + signal?: AbortSignal | undefined; + /** + * If truthy, the test is skipped. If a string is provided, that string is displayed in the + * test results as the reason for skipping the test. + * @default false + */ + skip?: boolean | string | undefined; + /** + * A number of milliseconds the test will fail after. If unspecified, subtests inherit this + * value from their parent. + * @default Infinity + * @since v18.7.0 + */ + timeout?: number | undefined; + /** + * If truthy, the test marked as `TODO`. If a string is provided, that string is displayed in + * the test results as the reason why the test is `TODO`. + * @default false + */ + todo?: boolean | string | undefined; + } + /** + * This function is used to create a hook running before running a suite. + * + * ```js + * describe('tests', async () => { + * before(() => console.log('about to run some test')); + * it('is a subtest', () => { + * assert.ok('some relevant assertion here'); + * }); + * }); + * ``` + * @since v18.8.0, v16.18.0 + * @param [fn='A no-op function'] The hook function. If the hook uses callbacks, the callback function is passed as the second argument. + * @param options Configuration options for the hook. The following properties are supported: + */ + function before(fn?: HookFn, options?: HookOptions): void; + /** + * This function is used to create a hook running after running a suite. + * + * ```js + * describe('tests', async () => { + * after(() => console.log('finished running tests')); + * it('is a subtest', () => { + * assert.ok('some relevant assertion here'); + * }); + * }); + * ``` + * @since v18.8.0, v16.18.0 + * @param [fn='A no-op function'] The hook function. If the hook uses callbacks, the callback function is passed as the second argument. + * @param options Configuration options for the hook. The following properties are supported: + */ + function after(fn?: HookFn, options?: HookOptions): void; + /** + * This function is used to create a hook running + * before each subtest of the current suite. + * + * ```js + * describe('tests', async () => { + * beforeEach(() => console.log('about to run a test')); + * it('is a subtest', () => { + * assert.ok('some relevant assertion here'); + * }); + * }); + * ``` + * @since v18.8.0, v16.18.0 + * @param [fn='A no-op function'] The hook function. If the hook uses callbacks, the callback function is passed as the second argument. + * @param options Configuration options for the hook. The following properties are supported: + */ + function beforeEach(fn?: HookFn, options?: HookOptions): void; + /** + * This function is used to create a hook running + * after each subtest of the current test. + * + * ```js + * describe('tests', async () => { + * afterEach(() => console.log('finished running a test')); + * it('is a subtest', () => { + * assert.ok('some relevant assertion here'); + * }); + * }); + * ``` + * @since v18.8.0, v16.18.0 + * @param [fn='A no-op function'] The hook function. If the hook uses callbacks, the callback function is passed as the second argument. + * @param options Configuration options for the hook. The following properties are supported: + */ + function afterEach(fn?: HookFn, options?: HookOptions): void; + /** + * The hook function. If the hook uses callbacks, the callback function is passed as the + * second argument. + */ + type HookFn = (s: SuiteContext, done: (result?: any) => void) => any; + /** + * Configuration options for hooks. + * @since v18.8.0 + */ + interface HookOptions { + /** + * Allows aborting an in-progress hook. + */ + signal?: AbortSignal | undefined; + /** + * A number of milliseconds the hook will fail after. If unspecified, subtests inherit this + * value from their parent. + * @default Infinity + */ + timeout?: number | undefined; + } + interface MockFunctionOptions { + /** + * The number of times that the mock will use the behavior of `implementation`. + * Once the mock function has been called `times` times, + * it will automatically restore the behavior of `original`. + * This value must be an integer greater than zero. + * @default Infinity + */ + times?: number | undefined; + } + interface MockMethodOptions extends MockFunctionOptions { + /** + * If `true`, `object[methodName]` is treated as a getter. + * This option cannot be used with the `setter` option. + */ + getter?: boolean | undefined; + /** + * If `true`, `object[methodName]` is treated as a setter. + * This option cannot be used with the `getter` option. + */ + setter?: boolean | undefined; + } + type Mock = F & { + mock: MockFunctionContext; + }; + type NoOpFunction = (...args: any[]) => undefined; + type FunctionPropertyNames = { + [K in keyof T]: T[K] extends Function ? K : never; + }[keyof T]; + /** + * The `MockTracker` class is used to manage mocking functionality. The test runner + * module provides a top level `mock` export which is a `MockTracker` instance. + * Each test also provides its own `MockTracker` instance via the test context's`mock` property. + * @since v19.1.0, v18.13.0 + */ + class MockTracker { + /** + * This function is used to create a mock function. + * + * The following example creates a mock function that increments a counter by one + * on each invocation. The `times` option is used to modify the mock behavior such + * that the first two invocations add two to the counter instead of one. + * + * ```js + * test('mocks a counting function', (t) => { + * let cnt = 0; + * + * function addOne() { + * cnt++; + * return cnt; + * } + * + * function addTwo() { + * cnt += 2; + * return cnt; + * } + * + * const fn = t.mock.fn(addOne, addTwo, { times: 2 }); + * + * assert.strictEqual(fn(), 2); + * assert.strictEqual(fn(), 4); + * assert.strictEqual(fn(), 5); + * assert.strictEqual(fn(), 6); + * }); + * ``` + * @since v19.1.0, v18.13.0 + * @param [original='A no-op function'] An optional function to create a mock on. + * @param implementation An optional function used as the mock implementation for `original`. This is useful for creating mocks that exhibit one behavior for a specified number of calls and + * then restore the behavior of `original`. + * @param options Optional configuration options for the mock function. The following properties are supported: + * @return The mocked function. The mocked function contains a special `mock` property, which is an instance of {@link MockFunctionContext}, and can be used for inspecting and changing the + * behavior of the mocked function. + */ + fn(original?: F, options?: MockFunctionOptions): Mock; + fn(original?: F, implementation?: Implementation, options?: MockFunctionOptions): Mock; + /** + * This function is used to create a mock on an existing object method. The + * following example demonstrates how a mock is created on an existing object + * method. + * + * ```js + * test('spies on an object method', (t) => { + * const number = { + * value: 5, + * subtract(a) { + * return this.value - a; + * }, + * }; + * + * t.mock.method(number, 'subtract'); + * assert.strictEqual(number.subtract.mock.calls.length, 0); + * assert.strictEqual(number.subtract(3), 2); + * assert.strictEqual(number.subtract.mock.calls.length, 1); + * + * const call = number.subtract.mock.calls[0]; + * + * assert.deepStrictEqual(call.arguments, [3]); + * assert.strictEqual(call.result, 2); + * assert.strictEqual(call.error, undefined); + * assert.strictEqual(call.target, undefined); + * assert.strictEqual(call.this, number); + * }); + * ``` + * @since v19.1.0, v18.13.0 + * @param object The object whose method is being mocked. + * @param methodName The identifier of the method on `object` to mock. If `object[methodName]` is not a function, an error is thrown. + * @param implementation An optional function used as the mock implementation for `object[methodName]`. + * @param options Optional configuration options for the mock method. The following properties are supported: + * @return The mocked method. The mocked method contains a special `mock` property, which is an instance of {@link MockFunctionContext}, and can be used for inspecting and changing the + * behavior of the mocked method. + */ + method< + MockedObject extends object, + MethodName extends FunctionPropertyNames, + >( + object: MockedObject, + methodName: MethodName, + options?: MockFunctionOptions, + ): MockedObject[MethodName] extends Function + ? Mock + : never; + method< + MockedObject extends object, + MethodName extends FunctionPropertyNames, + Implementation extends Function, + >( + object: MockedObject, + methodName: MethodName, + implementation: Implementation, + options?: MockFunctionOptions, + ): MockedObject[MethodName] extends Function + ? Mock + : never; + method( + object: MockedObject, + methodName: keyof MockedObject, + options: MockMethodOptions, + ): Mock; + method( + object: MockedObject, + methodName: keyof MockedObject, + implementation: Function, + options: MockMethodOptions, + ): Mock; + + /** + * This function is syntax sugar for `MockTracker.method` with `options.getter`set to `true`. + * @since v19.3.0, v18.13.0 + */ + getter< + MockedObject extends object, + MethodName extends keyof MockedObject, + >( + object: MockedObject, + methodName: MethodName, + options?: MockFunctionOptions, + ): Mock<() => MockedObject[MethodName]>; + getter< + MockedObject extends object, + MethodName extends keyof MockedObject, + Implementation extends Function, + >( + object: MockedObject, + methodName: MethodName, + implementation?: Implementation, + options?: MockFunctionOptions, + ): Mock<(() => MockedObject[MethodName]) | Implementation>; + /** + * This function is syntax sugar for `MockTracker.method` with `options.setter`set to `true`. + * @since v19.3.0, v18.13.0 + */ + setter< + MockedObject extends object, + MethodName extends keyof MockedObject, + >( + object: MockedObject, + methodName: MethodName, + options?: MockFunctionOptions, + ): Mock<(value: MockedObject[MethodName]) => void>; + setter< + MockedObject extends object, + MethodName extends keyof MockedObject, + Implementation extends Function, + >( + object: MockedObject, + methodName: MethodName, + implementation?: Implementation, + options?: MockFunctionOptions, + ): Mock<((value: MockedObject[MethodName]) => void) | Implementation>; + /** + * This function restores the default behavior of all mocks that were previously + * created by this `MockTracker` and disassociates the mocks from the`MockTracker` instance. Once disassociated, the mocks can still be used, but the`MockTracker` instance can no longer be + * used to reset their behavior or + * otherwise interact with them. + * + * After each test completes, this function is called on the test context's`MockTracker`. If the global `MockTracker` is used extensively, calling this + * function manually is recommended. + * @since v19.1.0, v18.13.0 + */ + reset(): void; + /** + * This function restores the default behavior of all mocks that were previously + * created by this `MockTracker`. Unlike `mock.reset()`, `mock.restoreAll()` does + * not disassociate the mocks from the `MockTracker` instance. + * @since v19.1.0, v18.13.0 + */ + restoreAll(): void; + timers: MockTimers; + } + const mock: MockTracker; + interface MockFunctionCall< + F extends Function, + ReturnType = F extends (...args: any) => infer T + ? T + : F extends abstract new (...args: any) => infer T + ? T + : unknown, + Args = F extends (...args: infer Y) => any + ? Y + : F extends abstract new (...args: infer Y) => any + ? Y + : unknown[], + > { + /** + * An array of the arguments passed to the mock function. + */ + arguments: Args; + /** + * If the mocked function threw then this property contains the thrown value. + */ + error: unknown | undefined; + /** + * The value returned by the mocked function. + * + * If the mocked function threw, it will be `undefined`. + */ + result: ReturnType | undefined; + /** + * An `Error` object whose stack can be used to determine the callsite of the mocked function invocation. + */ + stack: Error; + /** + * If the mocked function is a constructor, this field contains the class being constructed. + * Otherwise this will be `undefined`. + */ + target: F extends abstract new (...args: any) => any ? F : undefined; + /** + * The mocked function's `this` value. + */ + this: unknown; + } + /** + * The `MockFunctionContext` class is used to inspect or manipulate the behavior of + * mocks created via the `MockTracker` APIs. + * @since v19.1.0, v18.13.0 + */ + class MockFunctionContext { + /** + * A getter that returns a copy of the internal array used to track calls to the + * mock. Each entry in the array is an object with the following properties. + * @since v19.1.0, v18.13.0 + */ + readonly calls: Array>; + /** + * This function returns the number of times that this mock has been invoked. This + * function is more efficient than checking `ctx.calls.length` because `ctx.calls`is a getter that creates a copy of the internal call tracking array. + * @since v19.1.0, v18.13.0 + * @return The number of times that this mock has been invoked. + */ + callCount(): number; + /** + * This function is used to change the behavior of an existing mock. + * + * The following example creates a mock function using `t.mock.fn()`, calls the + * mock function, and then changes the mock implementation to a different function. + * + * ```js + * test('changes a mock behavior', (t) => { + * let cnt = 0; + * + * function addOne() { + * cnt++; + * return cnt; + * } + * + * function addTwo() { + * cnt += 2; + * return cnt; + * } + * + * const fn = t.mock.fn(addOne); + * + * assert.strictEqual(fn(), 1); + * fn.mock.mockImplementation(addTwo); + * assert.strictEqual(fn(), 3); + * assert.strictEqual(fn(), 5); + * }); + * ``` + * @since v19.1.0, v18.13.0 + * @param implementation The function to be used as the mock's new implementation. + */ + mockImplementation(implementation: Function): void; + /** + * This function is used to change the behavior of an existing mock for a single + * invocation. Once invocation `onCall` has occurred, the mock will revert to + * whatever behavior it would have used had `mockImplementationOnce()` not been + * called. + * + * The following example creates a mock function using `t.mock.fn()`, calls the + * mock function, changes the mock implementation to a different function for the + * next invocation, and then resumes its previous behavior. + * + * ```js + * test('changes a mock behavior once', (t) => { + * let cnt = 0; + * + * function addOne() { + * cnt++; + * return cnt; + * } + * + * function addTwo() { + * cnt += 2; + * return cnt; + * } + * + * const fn = t.mock.fn(addOne); + * + * assert.strictEqual(fn(), 1); + * fn.mock.mockImplementationOnce(addTwo); + * assert.strictEqual(fn(), 3); + * assert.strictEqual(fn(), 4); + * }); + * ``` + * @since v19.1.0, v18.13.0 + * @param implementation The function to be used as the mock's implementation for the invocation number specified by `onCall`. + * @param onCall The invocation number that will use `implementation`. If the specified invocation has already occurred then an exception is thrown. + */ + mockImplementationOnce(implementation: Function, onCall?: number): void; + /** + * Resets the call history of the mock function. + * @since v19.3.0, v18.13.0 + */ + resetCalls(): void; + /** + * Resets the implementation of the mock function to its original behavior. The + * mock can still be used after calling this function. + * @since v19.1.0, v18.13.0 + */ + restore(): void; + } + type Timer = 'setInterval' | 'clearInterval' | 'setTimeout' | 'clearTimeout'; + /** + * Mocking timers is a technique commonly used in software testing to simulate and + * control the behavior of timers, such as `setInterval` and `setTimeout`, + * without actually waiting for the specified time intervals. + * + * The `MockTracker` provides a top-level `timers` export + * which is a `MockTimers` instance. + * @since v20.4.0 + * @experimental + */ + class MockTimers { + /** + * Enables timer mocking for the specified timers. + * + * **Note:** When you enable mocking for a specific timer, its associated + * clear function will also be implicitly mocked. + * + * Example usage: + * + * ```js + * import { mock } from 'node:test'; + * mock.timers.enable(['setInterval']); + * ``` + * + * ```js + * const { mock } = require('node:test'); + * mock.timers.enable(['setInterval']); + * ``` + * + * The above example enables mocking for the `setInterval` timer and + * implicitly mocks the `clearInterval` function. Only the `setInterval`and `clearInterval` functions from `node:timers`,`node:timers/promises`, and`globalThis` will be mocked. + * + * Alternatively, if you call `mock.timers.enable()` without any parameters: + * + * All timers (`'setInterval'`, `'clearInterval'`, `'setTimeout'`, and `'clearTimeout'`) + * will be mocked. The `setInterval`, `clearInterval`, `setTimeout`, and `clearTimeout`functions from `node:timers`, `node:timers/promises`, + * and `globalThis` will be mocked. + * @since v20.4.0 + */ + enable(timers?: Timer[]): void; + /** + * This function restores the default behavior of all mocks that were previously + * created by this `MockTimers` instance and disassociates the mocks + * from the `MockTracker` instance. + * + * **Note:** After each test completes, this function is called on + * the test context's `MockTracker`. + * + * ```js + * import { mock } from 'node:test'; + * mock.timers.reset(); + * ``` + * + * ```js + * const { mock } = require('node:test'); + * mock.timers.reset(); + * ``` + * @since v20.4.0 + */ + reset(): void; + /** + * Advances time for all mocked timers. + * + * **Note:** This diverges from how `setTimeout` in Node.js behaves and accepts + * only positive numbers. In Node.js, `setTimeout` with negative numbers is + * only supported for web compatibility reasons. + * + * The following example mocks a `setTimeout` function and + * by using `.tick` advances in + * time triggering all pending timers. + * + * ```js + * import assert from 'node:assert'; + * import { test } from 'node:test'; + * + * test('mocks setTimeout to be executed synchronously without having to actually wait for it', (context) => { + * const fn = context.mock.fn(); + * + * context.mock.timers.enable(['setTimeout']); + * + * setTimeout(fn, 9999); + * + * assert.strictEqual(fn.mock.callCount(), 0); + * + * // Advance in time + * context.mock.timers.tick(9999); + * + * assert.strictEqual(fn.mock.callCount(), 1); + * }); + * ``` + * + * ```js + * const assert = require('node:assert'); + * const { test } = require('node:test'); + * + * test('mocks setTimeout to be executed synchronously without having to actually wait for it', (context) => { + * const fn = context.mock.fn(); + * context.mock.timers.enable(['setTimeout']); + * + * setTimeout(fn, 9999); + * assert.strictEqual(fn.mock.callCount(), 0); + * + * // Advance in time + * context.mock.timers.tick(9999); + * + * assert.strictEqual(fn.mock.callCount(), 1); + * }); + * ``` + * + * Alternativelly, the `.tick` function can be called many times + * + * ```js + * import assert from 'node:assert'; + * import { test } from 'node:test'; + * + * test('mocks setTimeout to be executed synchronously without having to actually wait for it', (context) => { + * const fn = context.mock.fn(); + * context.mock.timers.enable(['setTimeout']); + * const nineSecs = 9000; + * setTimeout(fn, nineSecs); + * + * const twoSeconds = 3000; + * context.mock.timers.tick(twoSeconds); + * context.mock.timers.tick(twoSeconds); + * context.mock.timers.tick(twoSeconds); + * + * assert.strictEqual(fn.mock.callCount(), 1); + * }); + * ``` + * + * ```js + * const assert = require('node:assert'); + * const { test } = require('node:test'); + * + * test('mocks setTimeout to be executed synchronously without having to actually wait for it', (context) => { + * const fn = context.mock.fn(); + * context.mock.timers.enable(['setTimeout']); + * const nineSecs = 9000; + * setTimeout(fn, nineSecs); + * + * const twoSeconds = 3000; + * context.mock.timers.tick(twoSeconds); + * context.mock.timers.tick(twoSeconds); + * context.mock.timers.tick(twoSeconds); + * + * assert.strictEqual(fn.mock.callCount(), 1); + * }); + * ``` + * @since v20.4.0 + */ + tick(milliseconds: number): void; + /** + * Triggers all pending mocked timers immediately. + * + * The example below triggers all pending timers immediately, + * causing them to execute without any delay. + * + * ```js + * import assert from 'node:assert'; + * import { test } from 'node:test'; + * + * test('runAll functions following the given order', (context) => { + * context.mock.timers.enable(['setTimeout']); + * const results = []; + * setTimeout(() => results.push(1), 9999); + * + * // Notice that if both timers have the same timeout, + * // the order of execution is guaranteed + * setTimeout(() => results.push(3), 8888); + * setTimeout(() => results.push(2), 8888); + * + * assert.deepStrictEqual(results, []); + * + * context.mock.timers.runAll(); + * + * assert.deepStrictEqual(results, [3, 2, 1]); + * }); + * ``` + * + * ```js + * const assert = require('node:assert'); + * const { test } = require('node:test'); + * + * test('runAll functions following the given order', (context) => { + * context.mock.timers.enable(['setTimeout']); + * const results = []; + * setTimeout(() => results.push(1), 9999); + * + * // Notice that if both timers have the same timeout, + * // the order of execution is guaranteed + * setTimeout(() => results.push(3), 8888); + * setTimeout(() => results.push(2), 8888); + * + * assert.deepStrictEqual(results, []); + * + * context.mock.timers.runAll(); + * + * assert.deepStrictEqual(results, [3, 2, 1]); + * }); + * ``` + * + * **Note:** The `runAll()` function is specifically designed for + * triggering timers in the context of timer mocking. + * It does not have any effect on real-time system + * clocks or actual timers outside of the mocking environment. + * @since v20.4.0 + */ + runAll(): void; + /** + * Calls {@link MockTimers.reset()}. + */ + [Symbol.dispose](): void; + } + export { test as default, run, test, describe, it, before, after, beforeEach, afterEach, mock, skip, only, todo }; +} + +interface DiagnosticData { + /** + * The diagnostic message. + */ + message: string; + /** + * The nesting level of the test. + */ + nesting: number; + /** + * The path of the test file, undefined if test is not ran through a file. + */ + file?: string; +} +interface TestFail { + /** + * Additional execution metadata. + */ + details: { + /** + * The duration of the test in milliseconds. + */ + duration_ms: number; + /** + * The error thrown by the test. + */ + error: Error; + /** + * The type of the test, used to denote whether this is a suite. + * @since 20.0.0, 19.9.0, 18.17.0 + */ + type?: 'suite'; + }; + /** + * The test name. + */ + name: string; + /** + * The nesting level of the test. + */ + nesting: number; + /** + * The ordinal number of the test. + */ + testNumber: number; + /** + * Present if `context.todo` is called. + */ + todo?: string | boolean; + /** + * Present if `context.skip` is called. + */ + skip?: string | boolean; + /** + * The path of the test file, undefined if test is not ran through a file. + */ + file?: string; +} +interface TestPass { + /** + * Additional execution metadata. + */ + details: { + /** + * The duration of the test in milliseconds. + */ + duration_ms: number; + /** + * The type of the test, used to denote whether this is a suite. + * @since 20.0.0, 19.9.0, 18.17.0 + */ + type?: 'suite'; + }; + /** + * The test name. + */ + name: string; + /** + * The nesting level of the test. + */ + nesting: number; + /** + * The ordinal number of the test. + */ + testNumber: number; + /** + * Present if `context.todo` is called. + */ + todo?: string | boolean; + /** + * Present if `context.skip` is called. + */ + skip?: string | boolean; + /** + * The path of the test file, undefined if test is not ran through a file. + */ + file?: string; +} +interface TestPlan { + /** + * The nesting level of the test. + */ + nesting: number; + /** + * The number of subtests that have ran. + */ + count: number; + /** + * The path of the test file, undefined if test is not ran through a file. + */ + file?: string; +} +interface TestStart { + /** + * The test name. + */ + name: string; + /** + * The nesting level of the test. + */ + nesting: number; + /** + * The path of the test file, undefined if test is not ran through a file. + */ + file?: string; +} +interface TestStderr { + /** + * The path of the test file, undefined if test is not ran through a file. + */ + file?: string; + /** + * The message written to `stderr` + */ + message: string; +} +interface TestStdout { + /** + * The path of the test file, undefined if test is not ran through a file. + */ + file?: string; + /** + * The message written to `stdout` + */ + message: string; +} +interface TestEnqueue { + /** + * The test name + */ + name: string; + /** + * The path of the test file, undefined if test is not ran through a file. + */ + file?: string; + /** + * The nesting level of the test. + */ + nesting: number; +} +interface TestDequeue { + /** + * The test name + */ + name: string; + /** + * The path of the test file, undefined if test is not ran through a file. + */ + file?: string; + /** + * The nesting level of the test. + */ + nesting: number; +} + +/** + * The `node:test/reporters` module exposes the builtin-reporters for `node:test`. + * To access it: + * + * ```js + * import test from 'node:test/reporters'; + * ``` + * + * This module is only available under the `node:` scheme. The following will not + * work: + * + * ```js + * import test from 'test/reporters'; + * ``` + * @since v19.9.0 + * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/test/reporters.js) + */ +declare module 'node:test/reporters' { + import { Transform } from 'node:stream'; + + type TestEvent = + | { type: 'test:diagnostic', data: DiagnosticData } + | { type: 'test:fail', data: TestFail } + | { type: 'test:pass', data: TestPass } + | { type: 'test:plan', data: TestPlan } + | { type: 'test:start', data: TestStart } + | { type: 'test:stderr', data: TestStderr } + | { type: 'test:stdout', data: TestStdout } + | { type: 'test:enqueue', data: TestEnqueue } + | { type: 'test:dequeue', data: TestDequeue } + | { type: 'test:watch:drained' }; + type TestEventGenerator = AsyncGenerator; + + /** + * The `dot` reporter outputs the test results in a compact format, + * where each passing test is represented by a `.`, + * and each failing test is represented by a `X`. + */ + function dot(source: TestEventGenerator): AsyncGenerator<'\n' | '.' | 'X', void>; + /** + * The `tap` reporter outputs the test results in the [TAP](https://testanything.org/) format. + */ + function tap(source: TestEventGenerator): AsyncGenerator; + /** + * The `spec` reporter outputs the test results in a human-readable format. + */ + class Spec extends Transform { + constructor(); + } + export { dot, tap, Spec as spec, TestEvent }; +} diff --git a/node_modules/@types/node/ts4.8/timers.d.ts b/node_modules/@types/node/ts4.8/timers.d.ts new file mode 100644 index 0000000..7558b9d --- /dev/null +++ b/node_modules/@types/node/ts4.8/timers.d.ts @@ -0,0 +1,225 @@ +/** + * The `timer` module exposes a global API for scheduling functions to + * be called at some future period of time. Because the timer functions are + * globals, there is no need to call `require('node:timers')` to use the API. + * + * The timer functions within Node.js implement a similar API as the timers API + * provided by Web Browsers but use a different internal implementation that is + * built around the Node.js [Event Loop](https://nodejs.org/en/docs/guides/event-loop-timers-and-nexttick/#setimmediate-vs-settimeout). + * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/timers.js) + */ +declare module 'node:timers' { + import { Abortable } from 'node:events'; + import { setTimeout as setTimeoutPromise, setImmediate as setImmediatePromise, setInterval as setIntervalPromise } from 'node:timers/promises'; + interface TimerOptions extends Abortable { + /** + * Set to `false` to indicate that the scheduled `Timeout` + * should not require the Node.js event loop to remain active. + * @default true + */ + ref?: boolean | undefined; + } + let setTimeout: typeof global.setTimeout; + let clearTimeout: typeof global.clearTimeout; + let setInterval: typeof global.setInterval; + let clearInterval: typeof global.clearInterval; + let setImmediate: typeof global.setImmediate; + let clearImmediate: typeof global.clearImmediate; + global { + namespace NodeJS { + // compatibility with older typings + interface Timer extends RefCounted { + hasRef(): boolean; + refresh(): this; + [Symbol.toPrimitive](): number; + } + /** + * This object is created internally and is returned from `setImmediate()`. It + * can be passed to `clearImmediate()` in order to cancel the scheduled + * actions. + * + * By default, when an immediate is scheduled, the Node.js event loop will continue + * running as long as the immediate is active. The `Immediate` object returned by `setImmediate()` exports both `immediate.ref()` and `immediate.unref()`functions that can be used to + * control this default behavior. + */ + class Immediate implements RefCounted { + /** + * When called, requests that the Node.js event loop _not_ exit so long as the`Immediate` is active. Calling `immediate.ref()` multiple times will have no + * effect. + * + * By default, all `Immediate` objects are "ref'ed", making it normally unnecessary + * to call `immediate.ref()` unless `immediate.unref()` had been called previously. + * @since v9.7.0 + * @return a reference to `immediate` + */ + ref(): this; + /** + * When called, the active `Immediate` object will not require the Node.js event + * loop to remain active. If there is no other activity keeping the event loop + * running, the process may exit before the `Immediate` object's callback is + * invoked. Calling `immediate.unref()` multiple times will have no effect. + * @since v9.7.0 + * @return a reference to `immediate` + */ + unref(): this; + /** + * If true, the `Immediate` object will keep the Node.js event loop active. + * @since v11.0.0 + */ + hasRef(): boolean; + _onImmediate: Function; // to distinguish it from the Timeout class + /** + * Cancels the immediate. This is similar to calling `clearImmediate()`. + * @since v20.5.0 + */ + [Symbol.dispose](): void; + } + /** + * This object is created internally and is returned from `setTimeout()` and `setInterval()`. It can be passed to either `clearTimeout()` or `clearInterval()` in order to cancel the + * scheduled actions. + * + * By default, when a timer is scheduled using either `setTimeout()` or `setInterval()`, the Node.js event loop will continue running as long as the + * timer is active. Each of the `Timeout` objects returned by these functions + * export both `timeout.ref()` and `timeout.unref()` functions that can be used to + * control this default behavior. + */ + class Timeout implements Timer { + /** + * When called, requests that the Node.js event loop _not_ exit so long as the`Timeout` is active. Calling `timeout.ref()` multiple times will have no effect. + * + * By default, all `Timeout` objects are "ref'ed", making it normally unnecessary + * to call `timeout.ref()` unless `timeout.unref()` had been called previously. + * @since v0.9.1 + * @return a reference to `timeout` + */ + ref(): this; + /** + * When called, the active `Timeout` object will not require the Node.js event loop + * to remain active. If there is no other activity keeping the event loop running, + * the process may exit before the `Timeout` object's callback is invoked. Calling`timeout.unref()` multiple times will have no effect. + * @since v0.9.1 + * @return a reference to `timeout` + */ + unref(): this; + /** + * If true, the `Timeout` object will keep the Node.js event loop active. + * @since v11.0.0 + */ + hasRef(): boolean; + /** + * Sets the timer's start time to the current time, and reschedules the timer to + * call its callback at the previously specified duration adjusted to the current + * time. This is useful for refreshing a timer without allocating a new + * JavaScript object. + * + * Using this on a timer that has already called its callback will reactivate the + * timer. + * @since v10.2.0 + * @return a reference to `timeout` + */ + refresh(): this; + [Symbol.toPrimitive](): number; + /** + * Cancels the timeout. + * @since v20.5.0 + */ + [Symbol.dispose](): void; + } + } + /** + * Schedules execution of a one-time `callback` after `delay` milliseconds. + * + * The `callback` will likely not be invoked in precisely `delay` milliseconds. + * Node.js makes no guarantees about the exact timing of when callbacks will fire, + * nor of their ordering. The callback will be called as close as possible to the + * time specified. + * + * When `delay` is larger than `2147483647` or less than `1`, the `delay`will be set to `1`. Non-integer delays are truncated to an integer. + * + * If `callback` is not a function, a `TypeError` will be thrown. + * + * This method has a custom variant for promises that is available using `timersPromises.setTimeout()`. + * @since v0.0.1 + * @param callback The function to call when the timer elapses. + * @param [delay=1] The number of milliseconds to wait before calling the `callback`. + * @param args Optional arguments to pass when the `callback` is called. + * @return for use with {@link clearTimeout} + */ + function setTimeout(callback: (...args: TArgs) => void, ms?: number, ...args: TArgs): NodeJS.Timeout; + // util.promisify no rest args compability + // tslint:disable-next-line void-return + function setTimeout(callback: (args: void) => void, ms?: number): NodeJS.Timeout; + namespace setTimeout { + const __promisify__: typeof setTimeoutPromise; + } + /** + * Cancels a `Timeout` object created by `setTimeout()`. + * @since v0.0.1 + * @param timeout A `Timeout` object as returned by {@link setTimeout} or the `primitive` of the `Timeout` object as a string or a number. + */ + function clearTimeout(timeoutId: NodeJS.Timeout | string | number | undefined): void; + /** + * Schedules repeated execution of `callback` every `delay` milliseconds. + * + * When `delay` is larger than `2147483647` or less than `1`, the `delay` will be + * set to `1`. Non-integer delays are truncated to an integer. + * + * If `callback` is not a function, a `TypeError` will be thrown. + * + * This method has a custom variant for promises that is available using `timersPromises.setInterval()`. + * @since v0.0.1 + * @param callback The function to call when the timer elapses. + * @param [delay=1] The number of milliseconds to wait before calling the `callback`. + * @param args Optional arguments to pass when the `callback` is called. + * @return for use with {@link clearInterval} + */ + function setInterval(callback: (...args: TArgs) => void, ms?: number, ...args: TArgs): NodeJS.Timeout; + // util.promisify no rest args compability + // tslint:disable-next-line void-return + function setInterval(callback: (args: void) => void, ms?: number): NodeJS.Timeout; + namespace setInterval { + const __promisify__: typeof setIntervalPromise; + } + /** + * Cancels a `Timeout` object created by `setInterval()`. + * @since v0.0.1 + * @param timeout A `Timeout` object as returned by {@link setInterval} or the `primitive` of the `Timeout` object as a string or a number. + */ + function clearInterval(intervalId: NodeJS.Timeout | string | number | undefined): void; + /** + * Schedules the "immediate" execution of the `callback` after I/O events' + * callbacks. + * + * When multiple calls to `setImmediate()` are made, the `callback` functions are + * queued for execution in the order in which they are created. The entire callback + * queue is processed every event loop iteration. If an immediate timer is queued + * from inside an executing callback, that timer will not be triggered until the + * next event loop iteration. + * + * If `callback` is not a function, a `TypeError` will be thrown. + * + * This method has a custom variant for promises that is available using `timersPromises.setImmediate()`. + * @since v0.9.1 + * @param callback The function to call at the end of this turn of the Node.js `Event Loop` + * @param args Optional arguments to pass when the `callback` is called. + * @return for use with {@link clearImmediate} + */ + function setImmediate(callback: (...args: TArgs) => void, ...args: TArgs): NodeJS.Immediate; + // util.promisify no rest args compability + // tslint:disable-next-line void-return + function setImmediate(callback: (args: void) => void): NodeJS.Immediate; + namespace setImmediate { + const __promisify__: typeof setImmediatePromise; + } + /** + * Cancels an `Immediate` object created by `setImmediate()`. + * @since v0.9.1 + * @param immediate An `Immediate` object as returned by {@link setImmediate}. + */ + function clearImmediate(immediateId: NodeJS.Immediate | undefined): void; + function queueMicrotask(callback: () => void): void; + } +} +declare module 'timers' { + export * from 'node:timers'; +} diff --git a/node_modules/@types/node/ts4.8/timers/promises.d.ts b/node_modules/@types/node/ts4.8/timers/promises.d.ts new file mode 100644 index 0000000..2da1e8d --- /dev/null +++ b/node_modules/@types/node/ts4.8/timers/promises.d.ts @@ -0,0 +1,93 @@ +/** + * The `timers/promises` API provides an alternative set of timer functions + * that return `Promise` objects. The API is accessible via`require('node:timers/promises')`. + * + * ```js + * import { + * setTimeout, + * setImmediate, + * setInterval, + * } from 'timers/promises'; + * ``` + * @since v15.0.0 + */ +declare module 'node:timers/promises' { + import { TimerOptions } from 'node:timers'; + /** + * ```js + * import { + * setTimeout, + * } from 'timers/promises'; + * + * const res = await setTimeout(100, 'result'); + * + * console.log(res); // Prints 'result' + * ``` + * @since v15.0.0 + * @param [delay=1] The number of milliseconds to wait before fulfilling the promise. + * @param value A value with which the promise is fulfilled. + */ + function setTimeout(delay?: number, value?: T, options?: TimerOptions): Promise; + /** + * ```js + * import { + * setImmediate, + * } from 'timers/promises'; + * + * const res = await setImmediate('result'); + * + * console.log(res); // Prints 'result' + * ``` + * @since v15.0.0 + * @param value A value with which the promise is fulfilled. + */ + function setImmediate(value?: T, options?: TimerOptions): Promise; + /** + * Returns an async iterator that generates values in an interval of `delay` ms. + * If `ref` is `true`, you need to call `next()` of async iterator explicitly + * or implicitly to keep the event loop alive. + * + * ```js + * import { + * setInterval, + * } from 'timers/promises'; + * + * const interval = 100; + * for await (const startTime of setInterval(interval, Date.now())) { + * const now = Date.now(); + * console.log(now); + * if ((now - startTime) > 1000) + * break; + * } + * console.log(Date.now()); + * ``` + * @since v15.9.0 + */ + function setInterval(delay?: number, value?: T, options?: TimerOptions): AsyncIterable; + interface Scheduler { + /** + * ```js + * import { scheduler } from 'node:timers/promises'; + * + * await scheduler.wait(1000); // Wait one second before continuing + * ``` + * An experimental API defined by the Scheduling APIs draft specification being developed as a standard Web Platform API. + * Calling timersPromises.scheduler.wait(delay, options) is roughly equivalent to calling timersPromises.setTimeout(delay, undefined, options) except that the ref option is not supported. + * @since v16.14.0 + * @experimental + * @param [delay=1] The number of milliseconds to wait before fulfilling the promise. + */ + wait: (delay?: number, options?: TimerOptions) => Promise; + /** + * An experimental API defined by the Scheduling APIs draft specification being developed as a standard Web Platform API. + * Calling timersPromises.scheduler.yield() is equivalent to calling timersPromises.setImmediate() with no arguments. + * @since v16.14.0 + * @experimental + */ + yield: () => Promise; + } + const scheduler: Scheduler; +} +declare module 'timers/promises' { + export * from 'node:timers/promises'; +} diff --git a/node_modules/@types/node/ts4.8/tls.d.ts b/node_modules/@types/node/ts4.8/tls.d.ts new file mode 100644 index 0000000..dda36d0 --- /dev/null +++ b/node_modules/@types/node/ts4.8/tls.d.ts @@ -0,0 +1,1130 @@ +/** + * The `node:tls` module provides an implementation of the Transport Layer Security + * (TLS) and Secure Socket Layer (SSL) protocols that is built on top of OpenSSL. + * The module can be accessed using: + * + * ```js + * const tls = require('node:tls'); + * ``` + * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/tls.js) + */ +declare module 'node:tls' { + import { X509Certificate } from 'node:crypto'; + import * as net from 'node:net'; + import * as stream from 'stream'; + const CLIENT_RENEG_LIMIT: number; + const CLIENT_RENEG_WINDOW: number; + interface Certificate { + /** + * Country code. + */ + C: string; + /** + * Street. + */ + ST: string; + /** + * Locality. + */ + L: string; + /** + * Organization. + */ + O: string; + /** + * Organizational unit. + */ + OU: string; + /** + * Common name. + */ + CN: string; + } + interface PeerCertificate { + /** + * `true` if a Certificate Authority (CA), `false` otherwise. + * @since v18.13.0 + */ + ca: boolean; + /** + * The DER encoded X.509 certificate data. + */ + raw: Buffer; + /** + * The certificate subject. + */ + subject: Certificate; + /** + * The certificate issuer, described in the same terms as the `subject`. + */ + issuer: Certificate; + /** + * The date-time the certificate is valid from. + */ + valid_from: string; + /** + * The date-time the certificate is valid to. + */ + valid_to: string; + /** + * The certificate serial number, as a hex string. + */ + serialNumber: string; + /** + * The SHA-1 digest of the DER encoded certificate. + * It is returned as a `:` separated hexadecimal string. + */ + fingerprint: string; + /** + * The SHA-256 digest of the DER encoded certificate. + * It is returned as a `:` separated hexadecimal string. + */ + fingerprint256: string; + /** + * The SHA-512 digest of the DER encoded certificate. + * It is returned as a `:` separated hexadecimal string. + */ + fingerprint512: string; + /** + * The extended key usage, a set of OIDs. + */ + ext_key_usage?: string[]; + /** + * A string containing concatenated names for the subject, + * an alternative to the `subject` names. + */ + subjectaltname?: string; + /** + * An array describing the AuthorityInfoAccess, used with OCSP. + */ + infoAccess?: NodeJS.Dict; + /** + * For RSA keys: The RSA bit size. + * + * For EC keys: The key size in bits. + */ + bits?: number; + /** + * The RSA exponent, as a string in hexadecimal number notation. + */ + exponent?: string; + /** + * The RSA modulus, as a hexadecimal string. + */ + modulus?: string; + /** + * The public key. + */ + pubkey?: Buffer; + /** + * The ASN.1 name of the OID of the elliptic curve. + * Well-known curves are identified by an OID. + * While it is unusual, it is possible that the curve + * is identified by its mathematical properties, + * in which case it will not have an OID. + */ + asn1Curve?: string; + /** + * The NIST name for the elliptic curve,if it has one + * (not all well-known curves have been assigned names by NIST). + */ + nistCurve?: string; + } + interface DetailedPeerCertificate extends PeerCertificate { + /** + * The issuer certificate object. + * For self-signed certificates, this may be a circular reference. + */ + issuerCertificate: DetailedPeerCertificate; + } + interface CipherNameAndProtocol { + /** + * The cipher name. + */ + name: string; + /** + * SSL/TLS protocol version. + */ + version: string; + /** + * IETF name for the cipher suite. + */ + standardName: string; + } + interface EphemeralKeyInfo { + /** + * The supported types are 'DH' and 'ECDH'. + */ + type: string; + /** + * The name property is available only when type is 'ECDH'. + */ + name?: string | undefined; + /** + * The size of parameter of an ephemeral key exchange. + */ + size: number; + } + interface KeyObject { + /** + * Private keys in PEM format. + */ + pem: string | Buffer; + /** + * Optional passphrase. + */ + passphrase?: string | undefined; + } + interface PxfObject { + /** + * PFX or PKCS12 encoded private key and certificate chain. + */ + buf: string | Buffer; + /** + * Optional passphrase. + */ + passphrase?: string | undefined; + } + interface TLSSocketOptions extends SecureContextOptions, CommonConnectionOptions { + /** + * If true the TLS socket will be instantiated in server-mode. + * Defaults to false. + */ + isServer?: boolean | undefined; + /** + * An optional net.Server instance. + */ + server?: net.Server | undefined; + /** + * An optional Buffer instance containing a TLS session. + */ + session?: Buffer | undefined; + /** + * If true, specifies that the OCSP status request extension will be + * added to the client hello and an 'OCSPResponse' event will be + * emitted on the socket before establishing a secure communication + */ + requestOCSP?: boolean | undefined; + } + /** + * Performs transparent encryption of written data and all required TLS + * negotiation. + * + * Instances of `tls.TLSSocket` implement the duplex `Stream` interface. + * + * Methods that return TLS connection metadata (e.g.{@link TLSSocket.getPeerCertificate}) will only return data while the + * connection is open. + * @since v0.11.4 + */ + class TLSSocket extends net.Socket { + /** + * Construct a new tls.TLSSocket object from an existing TCP socket. + */ + constructor(socket: net.Socket, options?: TLSSocketOptions); + /** + * This property is `true` if the peer certificate was signed by one of the CAs + * specified when creating the `tls.TLSSocket` instance, otherwise `false`. + * @since v0.11.4 + */ + authorized: boolean; + /** + * Returns the reason why the peer's certificate was not been verified. This + * property is set only when `tlsSocket.authorized === false`. + * @since v0.11.4 + */ + authorizationError: Error; + /** + * Always returns `true`. This may be used to distinguish TLS sockets from regular`net.Socket` instances. + * @since v0.11.4 + */ + encrypted: true; + /** + * String containing the selected ALPN protocol. + * Before a handshake has completed, this value is always null. + * When a handshake is completed but not ALPN protocol was selected, tlsSocket.alpnProtocol equals false. + */ + alpnProtocol: string | false | null; + /** + * Returns an object representing the local certificate. The returned object has + * some properties corresponding to the fields of the certificate. + * + * See {@link TLSSocket.getPeerCertificate} for an example of the certificate + * structure. + * + * If there is no local certificate, an empty object will be returned. If the + * socket has been destroyed, `null` will be returned. + * @since v11.2.0 + */ + getCertificate(): PeerCertificate | object | null; + /** + * Returns an object containing information on the negotiated cipher suite. + * + * For example, a TLSv1.2 protocol with AES256-SHA cipher: + * + * ```json + * { + * "name": "AES256-SHA", + * "standardName": "TLS_RSA_WITH_AES_256_CBC_SHA", + * "version": "SSLv3" + * } + * ``` + * + * See [SSL\_CIPHER\_get\_name](https://www.openssl.org/docs/man1.1.1/man3/SSL_CIPHER_get_name.html) for more information. + * @since v0.11.4 + */ + getCipher(): CipherNameAndProtocol; + /** + * Returns an object representing the type, name, and size of parameter of + * an ephemeral key exchange in `perfect forward secrecy` on a client + * connection. It returns an empty object when the key exchange is not + * ephemeral. As this is only supported on a client socket; `null` is returned + * if called on a server socket. The supported types are `'DH'` and `'ECDH'`. The`name` property is available only when type is `'ECDH'`. + * + * For example: `{ type: 'ECDH', name: 'prime256v1', size: 256 }`. + * @since v5.0.0 + */ + getEphemeralKeyInfo(): EphemeralKeyInfo | object | null; + /** + * As the `Finished` messages are message digests of the complete handshake + * (with a total of 192 bits for TLS 1.0 and more for SSL 3.0), they can + * be used for external authentication procedures when the authentication + * provided by SSL/TLS is not desired or is not enough. + * + * Corresponds to the `SSL_get_finished` routine in OpenSSL and may be used + * to implement the `tls-unique` channel binding from [RFC 5929](https://tools.ietf.org/html/rfc5929). + * @since v9.9.0 + * @return The latest `Finished` message that has been sent to the socket as part of a SSL/TLS handshake, or `undefined` if no `Finished` message has been sent yet. + */ + getFinished(): Buffer | undefined; + /** + * Returns an object representing the peer's certificate. If the peer does not + * provide a certificate, an empty object will be returned. If the socket has been + * destroyed, `null` will be returned. + * + * If the full certificate chain was requested, each certificate will include an`issuerCertificate` property containing an object representing its issuer's + * certificate. + * @since v0.11.4 + * @param detailed Include the full certificate chain if `true`, otherwise include just the peer's certificate. + * @return A certificate object. + */ + getPeerCertificate(detailed: true): DetailedPeerCertificate; + getPeerCertificate(detailed?: false): PeerCertificate; + getPeerCertificate(detailed?: boolean): PeerCertificate | DetailedPeerCertificate; + /** + * As the `Finished` messages are message digests of the complete handshake + * (with a total of 192 bits for TLS 1.0 and more for SSL 3.0), they can + * be used for external authentication procedures when the authentication + * provided by SSL/TLS is not desired or is not enough. + * + * Corresponds to the `SSL_get_peer_finished` routine in OpenSSL and may be used + * to implement the `tls-unique` channel binding from [RFC 5929](https://tools.ietf.org/html/rfc5929). + * @since v9.9.0 + * @return The latest `Finished` message that is expected or has actually been received from the socket as part of a SSL/TLS handshake, or `undefined` if there is no `Finished` message so + * far. + */ + getPeerFinished(): Buffer | undefined; + /** + * Returns a string containing the negotiated SSL/TLS protocol version of the + * current connection. The value `'unknown'` will be returned for connected + * sockets that have not completed the handshaking process. The value `null` will + * be returned for server sockets or disconnected client sockets. + * + * Protocol versions are: + * + * * `'SSLv3'` + * * `'TLSv1'` + * * `'TLSv1.1'` + * * `'TLSv1.2'` + * * `'TLSv1.3'` + * + * See the OpenSSL [`SSL_get_version`](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_version.html) documentation for more information. + * @since v5.7.0 + */ + getProtocol(): string | null; + /** + * Returns the TLS session data or `undefined` if no session was + * negotiated. On the client, the data can be provided to the `session` option of {@link connect} to resume the connection. On the server, it may be useful + * for debugging. + * + * See `Session Resumption` for more information. + * + * Note: `getSession()` works only for TLSv1.2 and below. For TLSv1.3, applications + * must use the `'session'` event (it also works for TLSv1.2 and below). + * @since v0.11.4 + */ + getSession(): Buffer | undefined; + /** + * See [SSL\_get\_shared\_sigalgs](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_shared_sigalgs.html) for more information. + * @since v12.11.0 + * @return List of signature algorithms shared between the server and the client in the order of decreasing preference. + */ + getSharedSigalgs(): string[]; + /** + * For a client, returns the TLS session ticket if one is available, or`undefined`. For a server, always returns `undefined`. + * + * It may be useful for debugging. + * + * See `Session Resumption` for more information. + * @since v0.11.4 + */ + getTLSTicket(): Buffer | undefined; + /** + * See `Session Resumption` for more information. + * @since v0.5.6 + * @return `true` if the session was reused, `false` otherwise. + */ + isSessionReused(): boolean; + /** + * The `tlsSocket.renegotiate()` method initiates a TLS renegotiation process. + * Upon completion, the `callback` function will be passed a single argument + * that is either an `Error` (if the request failed) or `null`. + * + * This method can be used to request a peer's certificate after the secure + * connection has been established. + * + * When running as the server, the socket will be destroyed with an error after`handshakeTimeout` timeout. + * + * For TLSv1.3, renegotiation cannot be initiated, it is not supported by the + * protocol. + * @since v0.11.8 + * @param callback If `renegotiate()` returned `true`, callback is attached once to the `'secure'` event. If `renegotiate()` returned `false`, `callback` will be called in the next tick with + * an error, unless the `tlsSocket` has been destroyed, in which case `callback` will not be called at all. + * @return `true` if renegotiation was initiated, `false` otherwise. + */ + renegotiate( + options: { + rejectUnauthorized?: boolean | undefined; + requestCert?: boolean | undefined; + }, + callback: (err: Error | null) => void + ): undefined | boolean; + /** + * The `tlsSocket.setMaxSendFragment()` method sets the maximum TLS fragment size. + * Returns `true` if setting the limit succeeded; `false` otherwise. + * + * Smaller fragment sizes decrease the buffering latency on the client: larger + * fragments are buffered by the TLS layer until the entire fragment is received + * and its integrity is verified; large fragments can span multiple roundtrips + * and their processing can be delayed due to packet loss or reordering. However, + * smaller fragments add extra TLS framing bytes and CPU overhead, which may + * decrease overall server throughput. + * @since v0.11.11 + * @param [size=16384] The maximum TLS fragment size. The maximum value is `16384`. + */ + setMaxSendFragment(size: number): boolean; + /** + * Disables TLS renegotiation for this `TLSSocket` instance. Once called, attempts + * to renegotiate will trigger an `'error'` event on the `TLSSocket`. + * @since v8.4.0 + */ + disableRenegotiation(): void; + /** + * When enabled, TLS packet trace information is written to `stderr`. This can be + * used to debug TLS connection problems. + * + * The format of the output is identical to the output of`openssl s_client -trace` or `openssl s_server -trace`. While it is produced by + * OpenSSL's `SSL_trace()` function, the format is undocumented, can change + * without notice, and should not be relied on. + * @since v12.2.0 + */ + enableTrace(): void; + /** + * Returns the peer certificate as an `X509Certificate` object. + * + * If there is no peer certificate, or the socket has been destroyed,`undefined` will be returned. + * @since v15.9.0 + */ + getPeerX509Certificate(): X509Certificate | undefined; + /** + * Returns the local certificate as an `X509Certificate` object. + * + * If there is no local certificate, or the socket has been destroyed,`undefined` will be returned. + * @since v15.9.0 + */ + getX509Certificate(): X509Certificate | undefined; + /** + * Keying material is used for validations to prevent different kind of attacks in + * network protocols, for example in the specifications of IEEE 802.1X. + * + * Example + * + * ```js + * const keyingMaterial = tlsSocket.exportKeyingMaterial( + * 128, + * 'client finished'); + * + * /* + * Example return value of keyingMaterial: + * + * + * ``` + * + * See the OpenSSL [`SSL_export_keying_material`](https://www.openssl.org/docs/man1.1.1/man3/SSL_export_keying_material.html) documentation for more + * information. + * @since v13.10.0, v12.17.0 + * @param length number of bytes to retrieve from keying material + * @param label an application specific label, typically this will be a value from the [IANA Exporter Label + * Registry](https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#exporter-labels). + * @param context Optionally provide a context. + * @return requested bytes of the keying material + */ + exportKeyingMaterial(length: number, label: string, context: Buffer): Buffer; + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: 'OCSPResponse', listener: (response: Buffer) => void): this; + addListener(event: 'secureConnect', listener: () => void): this; + addListener(event: 'session', listener: (session: Buffer) => void): this; + addListener(event: 'keylog', listener: (line: Buffer) => void): this; + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: 'OCSPResponse', response: Buffer): boolean; + emit(event: 'secureConnect'): boolean; + emit(event: 'session', session: Buffer): boolean; + emit(event: 'keylog', line: Buffer): boolean; + on(event: string, listener: (...args: any[]) => void): this; + on(event: 'OCSPResponse', listener: (response: Buffer) => void): this; + on(event: 'secureConnect', listener: () => void): this; + on(event: 'session', listener: (session: Buffer) => void): this; + on(event: 'keylog', listener: (line: Buffer) => void): this; + once(event: string, listener: (...args: any[]) => void): this; + once(event: 'OCSPResponse', listener: (response: Buffer) => void): this; + once(event: 'secureConnect', listener: () => void): this; + once(event: 'session', listener: (session: Buffer) => void): this; + once(event: 'keylog', listener: (line: Buffer) => void): this; + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: 'OCSPResponse', listener: (response: Buffer) => void): this; + prependListener(event: 'secureConnect', listener: () => void): this; + prependListener(event: 'session', listener: (session: Buffer) => void): this; + prependListener(event: 'keylog', listener: (line: Buffer) => void): this; + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'OCSPResponse', listener: (response: Buffer) => void): this; + prependOnceListener(event: 'secureConnect', listener: () => void): this; + prependOnceListener(event: 'session', listener: (session: Buffer) => void): this; + prependOnceListener(event: 'keylog', listener: (line: Buffer) => void): this; + } + interface CommonConnectionOptions { + /** + * An optional TLS context object from tls.createSecureContext() + */ + secureContext?: SecureContext | undefined; + /** + * When enabled, TLS packet trace information is written to `stderr`. This can be + * used to debug TLS connection problems. + * @default false + */ + enableTrace?: boolean | undefined; + /** + * If true the server will request a certificate from clients that + * connect and attempt to verify that certificate. Defaults to + * false. + */ + requestCert?: boolean | undefined; + /** + * An array of strings or a Buffer naming possible ALPN protocols. + * (Protocols should be ordered by their priority.) + */ + ALPNProtocols?: string[] | Uint8Array[] | Uint8Array | undefined; + /** + * SNICallback(servername, cb) A function that will be + * called if the client supports SNI TLS extension. Two arguments + * will be passed when called: servername and cb. SNICallback should + * invoke cb(null, ctx), where ctx is a SecureContext instance. + * (tls.createSecureContext(...) can be used to get a proper + * SecureContext.) If SNICallback wasn't provided the default callback + * with high-level API will be used (see below). + */ + SNICallback?: ((servername: string, cb: (err: Error | null, ctx?: SecureContext) => void) => void) | undefined; + /** + * If true the server will reject any connection which is not + * authorized with the list of supplied CAs. This option only has an + * effect if requestCert is true. + * @default true + */ + rejectUnauthorized?: boolean | undefined; + } + interface TlsOptions extends SecureContextOptions, CommonConnectionOptions, net.ServerOpts { + /** + * Abort the connection if the SSL/TLS handshake does not finish in the + * specified number of milliseconds. A 'tlsClientError' is emitted on + * the tls.Server object whenever a handshake times out. Default: + * 120000 (120 seconds). + */ + handshakeTimeout?: number | undefined; + /** + * The number of seconds after which a TLS session created by the + * server will no longer be resumable. See Session Resumption for more + * information. Default: 300. + */ + sessionTimeout?: number | undefined; + /** + * 48-bytes of cryptographically strong pseudo-random data. + */ + ticketKeys?: Buffer | undefined; + /** + * + * @param socket + * @param identity identity parameter sent from the client. + * @return pre-shared key that must either be + * a buffer or `null` to stop the negotiation process. Returned PSK must be + * compatible with the selected cipher's digest. + * + * When negotiating TLS-PSK (pre-shared keys), this function is called + * with the identity provided by the client. + * If the return value is `null` the negotiation process will stop and an + * "unknown_psk_identity" alert message will be sent to the other party. + * If the server wishes to hide the fact that the PSK identity was not known, + * the callback must provide some random data as `psk` to make the connection + * fail with "decrypt_error" before negotiation is finished. + * PSK ciphers are disabled by default, and using TLS-PSK thus + * requires explicitly specifying a cipher suite with the `ciphers` option. + * More information can be found in the RFC 4279. + */ + pskCallback?(socket: TLSSocket, identity: string): DataView | NodeJS.TypedArray | null; + /** + * hint to send to a client to help + * with selecting the identity during TLS-PSK negotiation. Will be ignored + * in TLS 1.3. Upon failing to set pskIdentityHint `tlsClientError` will be + * emitted with `ERR_TLS_PSK_SET_IDENTIY_HINT_FAILED` code. + */ + pskIdentityHint?: string | undefined; + } + interface PSKCallbackNegotation { + psk: DataView | NodeJS.TypedArray; + identity: string; + } + interface ConnectionOptions extends SecureContextOptions, CommonConnectionOptions { + host?: string | undefined; + port?: number | undefined; + path?: string | undefined; // Creates unix socket connection to path. If this option is specified, `host` and `port` are ignored. + socket?: stream.Duplex | undefined; // Establish secure connection on a given socket rather than creating a new socket + checkServerIdentity?: typeof checkServerIdentity | undefined; + servername?: string | undefined; // SNI TLS Extension + session?: Buffer | undefined; + minDHSize?: number | undefined; + lookup?: net.LookupFunction | undefined; + timeout?: number | undefined; + /** + * When negotiating TLS-PSK (pre-shared keys), this function is called + * with optional identity `hint` provided by the server or `null` + * in case of TLS 1.3 where `hint` was removed. + * It will be necessary to provide a custom `tls.checkServerIdentity()` + * for the connection as the default one will try to check hostname/IP + * of the server against the certificate but that's not applicable for PSK + * because there won't be a certificate present. + * More information can be found in the RFC 4279. + * + * @param hint message sent from the server to help client + * decide which identity to use during negotiation. + * Always `null` if TLS 1.3 is used. + * @returns Return `null` to stop the negotiation process. `psk` must be + * compatible with the selected cipher's digest. + * `identity` must use UTF-8 encoding. + */ + pskCallback?(hint: string | null): PSKCallbackNegotation | null; + } + /** + * Accepts encrypted connections using TLS or SSL. + * @since v0.3.2 + */ + class Server extends net.Server { + constructor(secureConnectionListener?: (socket: TLSSocket) => void); + constructor(options: TlsOptions, secureConnectionListener?: (socket: TLSSocket) => void); + /** + * The `server.addContext()` method adds a secure context that will be used if + * the client request's SNI name matches the supplied `hostname` (or wildcard). + * + * When there are multiple matching contexts, the most recently added one is + * used. + * @since v0.5.3 + * @param hostname A SNI host name or wildcard (e.g. `'*'`) + * @param context An object containing any of the possible properties from the {@link createSecureContext} `options` arguments (e.g. `key`, `cert`, `ca`, etc), or a TLS context object created + * with {@link createSecureContext} itself. + */ + addContext(hostname: string, context: SecureContextOptions): void; + /** + * Returns the session ticket keys. + * + * See `Session Resumption` for more information. + * @since v3.0.0 + * @return A 48-byte buffer containing the session ticket keys. + */ + getTicketKeys(): Buffer; + /** + * The `server.setSecureContext()` method replaces the secure context of an + * existing server. Existing connections to the server are not interrupted. + * @since v11.0.0 + * @param options An object containing any of the possible properties from the {@link createSecureContext} `options` arguments (e.g. `key`, `cert`, `ca`, etc). + */ + setSecureContext(options: SecureContextOptions): void; + /** + * Sets the session ticket keys. + * + * Changes to the ticket keys are effective only for future server connections. + * Existing or currently pending server connections will use the previous keys. + * + * See `Session Resumption` for more information. + * @since v3.0.0 + * @param keys A 48-byte buffer containing the session ticket keys. + */ + setTicketKeys(keys: Buffer): void; + /** + * events.EventEmitter + * 1. tlsClientError + * 2. newSession + * 3. OCSPRequest + * 4. resumeSession + * 5. secureConnection + * 6. keylog + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: 'tlsClientError', listener: (err: Error, tlsSocket: TLSSocket) => void): this; + addListener(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void): this; + addListener(event: 'OCSPRequest', listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this; + addListener(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void): this; + addListener(event: 'secureConnection', listener: (tlsSocket: TLSSocket) => void): this; + addListener(event: 'keylog', listener: (line: Buffer, tlsSocket: TLSSocket) => void): this; + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: 'tlsClientError', err: Error, tlsSocket: TLSSocket): boolean; + emit(event: 'newSession', sessionId: Buffer, sessionData: Buffer, callback: () => void): boolean; + emit(event: 'OCSPRequest', certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void): boolean; + emit(event: 'resumeSession', sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void): boolean; + emit(event: 'secureConnection', tlsSocket: TLSSocket): boolean; + emit(event: 'keylog', line: Buffer, tlsSocket: TLSSocket): boolean; + on(event: string, listener: (...args: any[]) => void): this; + on(event: 'tlsClientError', listener: (err: Error, tlsSocket: TLSSocket) => void): this; + on(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void): this; + on(event: 'OCSPRequest', listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this; + on(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void): this; + on(event: 'secureConnection', listener: (tlsSocket: TLSSocket) => void): this; + on(event: 'keylog', listener: (line: Buffer, tlsSocket: TLSSocket) => void): this; + once(event: string, listener: (...args: any[]) => void): this; + once(event: 'tlsClientError', listener: (err: Error, tlsSocket: TLSSocket) => void): this; + once(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void): this; + once(event: 'OCSPRequest', listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this; + once(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void): this; + once(event: 'secureConnection', listener: (tlsSocket: TLSSocket) => void): this; + once(event: 'keylog', listener: (line: Buffer, tlsSocket: TLSSocket) => void): this; + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: 'tlsClientError', listener: (err: Error, tlsSocket: TLSSocket) => void): this; + prependListener(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void): this; + prependListener(event: 'OCSPRequest', listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this; + prependListener(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void): this; + prependListener(event: 'secureConnection', listener: (tlsSocket: TLSSocket) => void): this; + prependListener(event: 'keylog', listener: (line: Buffer, tlsSocket: TLSSocket) => void): this; + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'tlsClientError', listener: (err: Error, tlsSocket: TLSSocket) => void): this; + prependOnceListener(event: 'newSession', listener: (sessionId: Buffer, sessionData: Buffer, callback: () => void) => void): this; + prependOnceListener(event: 'OCSPRequest', listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this; + prependOnceListener(event: 'resumeSession', listener: (sessionId: Buffer, callback: (err: Error | null, sessionData: Buffer | null) => void) => void): this; + prependOnceListener(event: 'secureConnection', listener: (tlsSocket: TLSSocket) => void): this; + prependOnceListener(event: 'keylog', listener: (line: Buffer, tlsSocket: TLSSocket) => void): this; + } + /** + * @deprecated since v0.11.3 Use `tls.TLSSocket` instead. + */ + interface SecurePair { + encrypted: TLSSocket; + cleartext: TLSSocket; + } + type SecureVersion = 'TLSv1.3' | 'TLSv1.2' | 'TLSv1.1' | 'TLSv1'; + interface SecureContextOptions { + /** + * If set, this will be called when a client opens a connection using the ALPN extension. + * One argument will be passed to the callback: an object containing `servername` and `protocols` fields, + * respectively containing the server name from the SNI extension (if any) and an array of + * ALPN protocol name strings. The callback must return either one of the strings listed in `protocols`, + * which will be returned to the client as the selected ALPN protocol, or `undefined`, + * to reject the connection with a fatal alert. If a string is returned that does not match one of + * the client's ALPN protocols, an error will be thrown. + * This option cannot be used with the `ALPNProtocols` option, and setting both options will throw an error. + */ + ALPNCallback?: ((arg: { servername: string; protocols: string[] }) => string | undefined) | undefined; + /** + * Optionally override the trusted CA certificates. Default is to trust + * the well-known CAs curated by Mozilla. Mozilla's CAs are completely + * replaced when CAs are explicitly specified using this option. + */ + ca?: string | Buffer | Array | undefined; + /** + * Cert chains in PEM format. One cert chain should be provided per + * private key. Each cert chain should consist of the PEM formatted + * certificate for a provided private key, followed by the PEM + * formatted intermediate certificates (if any), in order, and not + * including the root CA (the root CA must be pre-known to the peer, + * see ca). When providing multiple cert chains, they do not have to + * be in the same order as their private keys in key. If the + * intermediate certificates are not provided, the peer will not be + * able to validate the certificate, and the handshake will fail. + */ + cert?: string | Buffer | Array | undefined; + /** + * Colon-separated list of supported signature algorithms. The list + * can contain digest algorithms (SHA256, MD5 etc.), public key + * algorithms (RSA-PSS, ECDSA etc.), combination of both (e.g + * 'RSA+SHA384') or TLS v1.3 scheme names (e.g. rsa_pss_pss_sha512). + */ + sigalgs?: string | undefined; + /** + * Cipher suite specification, replacing the default. For more + * information, see modifying the default cipher suite. Permitted + * ciphers can be obtained via tls.getCiphers(). Cipher names must be + * uppercased in order for OpenSSL to accept them. + */ + ciphers?: string | undefined; + /** + * Name of an OpenSSL engine which can provide the client certificate. + */ + clientCertEngine?: string | undefined; + /** + * PEM formatted CRLs (Certificate Revocation Lists). + */ + crl?: string | Buffer | Array | undefined; + /** + * `'auto'` or custom Diffie-Hellman parameters, required for non-ECDHE perfect forward secrecy. + * If omitted or invalid, the parameters are silently discarded and DHE ciphers will not be available. + * ECDHE-based perfect forward secrecy will still be available. + */ + dhparam?: string | Buffer | undefined; + /** + * A string describing a named curve or a colon separated list of curve + * NIDs or names, for example P-521:P-384:P-256, to use for ECDH key + * agreement. Set to auto to select the curve automatically. Use + * crypto.getCurves() to obtain a list of available curve names. On + * recent releases, openssl ecparam -list_curves will also display the + * name and description of each available elliptic curve. Default: + * tls.DEFAULT_ECDH_CURVE. + */ + ecdhCurve?: string | undefined; + /** + * Attempt to use the server's cipher suite preferences instead of the + * client's. When true, causes SSL_OP_CIPHER_SERVER_PREFERENCE to be + * set in secureOptions + */ + honorCipherOrder?: boolean | undefined; + /** + * Private keys in PEM format. PEM allows the option of private keys + * being encrypted. Encrypted keys will be decrypted with + * options.passphrase. Multiple keys using different algorithms can be + * provided either as an array of unencrypted key strings or buffers, + * or an array of objects in the form {pem: [, + * passphrase: ]}. The object form can only occur in an array. + * object.passphrase is optional. Encrypted keys will be decrypted with + * object.passphrase if provided, or options.passphrase if it is not. + */ + key?: string | Buffer | Array | undefined; + /** + * Name of an OpenSSL engine to get private key from. Should be used + * together with privateKeyIdentifier. + */ + privateKeyEngine?: string | undefined; + /** + * Identifier of a private key managed by an OpenSSL engine. Should be + * used together with privateKeyEngine. Should not be set together with + * key, because both options define a private key in different ways. + */ + privateKeyIdentifier?: string | undefined; + /** + * Optionally set the maximum TLS version to allow. One + * of `'TLSv1.3'`, `'TLSv1.2'`, `'TLSv1.1'`, or `'TLSv1'`. Cannot be specified along with the + * `secureProtocol` option, use one or the other. + * **Default:** `'TLSv1.3'`, unless changed using CLI options. Using + * `--tls-max-v1.2` sets the default to `'TLSv1.2'`. Using `--tls-max-v1.3` sets the default to + * `'TLSv1.3'`. If multiple of the options are provided, the highest maximum is used. + */ + maxVersion?: SecureVersion | undefined; + /** + * Optionally set the minimum TLS version to allow. One + * of `'TLSv1.3'`, `'TLSv1.2'`, `'TLSv1.1'`, or `'TLSv1'`. Cannot be specified along with the + * `secureProtocol` option, use one or the other. It is not recommended to use + * less than TLSv1.2, but it may be required for interoperability. + * **Default:** `'TLSv1.2'`, unless changed using CLI options. Using + * `--tls-v1.0` sets the default to `'TLSv1'`. Using `--tls-v1.1` sets the default to + * `'TLSv1.1'`. Using `--tls-min-v1.3` sets the default to + * 'TLSv1.3'. If multiple of the options are provided, the lowest minimum is used. + */ + minVersion?: SecureVersion | undefined; + /** + * Shared passphrase used for a single private key and/or a PFX. + */ + passphrase?: string | undefined; + /** + * PFX or PKCS12 encoded private key and certificate chain. pfx is an + * alternative to providing key and cert individually. PFX is usually + * encrypted, if it is, passphrase will be used to decrypt it. Multiple + * PFX can be provided either as an array of unencrypted PFX buffers, + * or an array of objects in the form {buf: [, + * passphrase: ]}. The object form can only occur in an array. + * object.passphrase is optional. Encrypted PFX will be decrypted with + * object.passphrase if provided, or options.passphrase if it is not. + */ + pfx?: string | Buffer | Array | undefined; + /** + * Optionally affect the OpenSSL protocol behavior, which is not + * usually necessary. This should be used carefully if at all! Value is + * a numeric bitmask of the SSL_OP_* options from OpenSSL Options + */ + secureOptions?: number | undefined; // Value is a numeric bitmask of the `SSL_OP_*` options + /** + * Legacy mechanism to select the TLS protocol version to use, it does + * not support independent control of the minimum and maximum version, + * and does not support limiting the protocol to TLSv1.3. Use + * minVersion and maxVersion instead. The possible values are listed as + * SSL_METHODS, use the function names as strings. For example, use + * 'TLSv1_1_method' to force TLS version 1.1, or 'TLS_method' to allow + * any TLS protocol version up to TLSv1.3. It is not recommended to use + * TLS versions less than 1.2, but it may be required for + * interoperability. Default: none, see minVersion. + */ + secureProtocol?: string | undefined; + /** + * Opaque identifier used by servers to ensure session state is not + * shared between applications. Unused by clients. + */ + sessionIdContext?: string | undefined; + /** + * 48-bytes of cryptographically strong pseudo-random data. + * See Session Resumption for more information. + */ + ticketKeys?: Buffer | undefined; + /** + * The number of seconds after which a TLS session created by the + * server will no longer be resumable. See Session Resumption for more + * information. Default: 300. + */ + sessionTimeout?: number | undefined; + } + interface SecureContext { + context: any; + } + /** + * Verifies the certificate `cert` is issued to `hostname`. + * + * Returns [Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) object, populating it with `reason`, `host`, and `cert` on + * failure. On success, returns [undefined](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Undefined_type). + * + * This function is intended to be used in combination with the`checkServerIdentity` option that can be passed to {@link connect} and as + * such operates on a `certificate object`. For other purposes, consider using `x509.checkHost()` instead. + * + * This function can be overwritten by providing an alternative function as the`options.checkServerIdentity` option that is passed to `tls.connect()`. The + * overwriting function can call `tls.checkServerIdentity()` of course, to augment + * the checks done with additional verification. + * + * This function is only called if the certificate passed all other checks, such as + * being issued by trusted CA (`options.ca`). + * + * Earlier versions of Node.js incorrectly accepted certificates for a given`hostname` if a matching `uniformResourceIdentifier` subject alternative name + * was present (see [CVE-2021-44531](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-44531)). Applications that wish to accept`uniformResourceIdentifier` subject alternative names can use + * a custom`options.checkServerIdentity` function that implements the desired behavior. + * @since v0.8.4 + * @param hostname The host name or IP address to verify the certificate against. + * @param cert A `certificate object` representing the peer's certificate. + */ + function checkServerIdentity(hostname: string, cert: PeerCertificate): Error | undefined; + /** + * Creates a new {@link Server}. The `secureConnectionListener`, if provided, is + * automatically set as a listener for the `'secureConnection'` event. + * + * The `ticketKeys` options is automatically shared between `node:cluster` module + * workers. + * + * The following illustrates a simple echo server: + * + * ```js + * const tls = require('node:tls'); + * const fs = require('node:fs'); + * + * const options = { + * key: fs.readFileSync('server-key.pem'), + * cert: fs.readFileSync('server-cert.pem'), + * + * // This is necessary only if using client certificate authentication. + * requestCert: true, + * + * // This is necessary only if the client uses a self-signed certificate. + * ca: [ fs.readFileSync('client-cert.pem') ], + * }; + * + * const server = tls.createServer(options, (socket) => { + * console.log('server connected', + * socket.authorized ? 'authorized' : 'unauthorized'); + * socket.write('welcome!\n'); + * socket.setEncoding('utf8'); + * socket.pipe(socket); + * }); + * server.listen(8000, () => { + * console.log('server bound'); + * }); + * ``` + * + * The server can be tested by connecting to it using the example client from {@link connect}. + * @since v0.3.2 + */ + function createServer(secureConnectionListener?: (socket: TLSSocket) => void): Server; + function createServer(options: TlsOptions, secureConnectionListener?: (socket: TLSSocket) => void): Server; + /** + * The `callback` function, if specified, will be added as a listener for the `'secureConnect'` event. + * + * `tls.connect()` returns a {@link TLSSocket} object. + * + * Unlike the `https` API, `tls.connect()` does not enable the + * SNI (Server Name Indication) extension by default, which may cause some + * servers to return an incorrect certificate or reject the connection + * altogether. To enable SNI, set the `servername` option in addition + * to `host`. + * + * The following illustrates a client for the echo server example from {@link createServer}: + * + * ```js + * // Assumes an echo server that is listening on port 8000. + * const tls = require('node:tls'); + * const fs = require('node:fs'); + * + * const options = { + * // Necessary only if the server requires client certificate authentication. + * key: fs.readFileSync('client-key.pem'), + * cert: fs.readFileSync('client-cert.pem'), + * + * // Necessary only if the server uses a self-signed certificate. + * ca: [ fs.readFileSync('server-cert.pem') ], + * + * // Necessary only if the server's cert isn't for "localhost". + * checkServerIdentity: () => { return null; }, + * }; + * + * const socket = tls.connect(8000, options, () => { + * console.log('client connected', + * socket.authorized ? 'authorized' : 'unauthorized'); + * process.stdin.pipe(socket); + * process.stdin.resume(); + * }); + * socket.setEncoding('utf8'); + * socket.on('data', (data) => { + * console.log(data); + * }); + * socket.on('end', () => { + * console.log('server ends connection'); + * }); + * ``` + * @since v0.11.3 + */ + function connect(options: ConnectionOptions, secureConnectListener?: () => void): TLSSocket; + function connect(port: number, host?: string, options?: ConnectionOptions, secureConnectListener?: () => void): TLSSocket; + function connect(port: number, options?: ConnectionOptions, secureConnectListener?: () => void): TLSSocket; + /** + * Creates a new secure pair object with two streams, one of which reads and writes + * the encrypted data and the other of which reads and writes the cleartext data. + * Generally, the encrypted stream is piped to/from an incoming encrypted data + * stream and the cleartext one is used as a replacement for the initial encrypted + * stream. + * + * `tls.createSecurePair()` returns a `tls.SecurePair` object with `cleartext` and`encrypted` stream properties. + * + * Using `cleartext` has the same API as {@link TLSSocket}. + * + * The `tls.createSecurePair()` method is now deprecated in favor of`tls.TLSSocket()`. For example, the code: + * + * ```js + * pair = tls.createSecurePair(// ... ); + * pair.encrypted.pipe(socket); + * socket.pipe(pair.encrypted); + * ``` + * + * can be replaced by: + * + * ```js + * secureSocket = tls.TLSSocket(socket, options); + * ``` + * + * where `secureSocket` has the same API as `pair.cleartext`. + * @since v0.3.2 + * @deprecated Since v0.11.3 - Use {@link TLSSocket} instead. + * @param context A secure context object as returned by `tls.createSecureContext()` + * @param isServer `true` to specify that this TLS connection should be opened as a server. + * @param requestCert `true` to specify whether a server should request a certificate from a connecting client. Only applies when `isServer` is `true`. + * @param rejectUnauthorized If not `false` a server automatically reject clients with invalid certificates. Only applies when `isServer` is `true`. + */ + function createSecurePair(context?: SecureContext, isServer?: boolean, requestCert?: boolean, rejectUnauthorized?: boolean): SecurePair; + /** + * {@link createServer} sets the default value of the `honorCipherOrder` option + * to `true`, other APIs that create secure contexts leave it unset. + * + * {@link createServer} uses a 128 bit truncated SHA1 hash value generated + * from `process.argv` as the default value of the `sessionIdContext` option, other + * APIs that create secure contexts have no default value. + * + * The `tls.createSecureContext()` method creates a `SecureContext` object. It is + * usable as an argument to several `tls` APIs, such as `server.addContext()`, + * but has no public methods. The {@link Server} constructor and the {@link createServer} method do not support the `secureContext` option. + * + * A key is _required_ for ciphers that use certificates. Either `key` or`pfx` can be used to provide it. + * + * If the `ca` option is not given, then Node.js will default to using [Mozilla's publicly trusted list of + * CAs](https://hg.mozilla.org/mozilla-central/raw-file/tip/security/nss/lib/ckfw/builtins/certdata.txt). + * + * Custom DHE parameters are discouraged in favor of the new `dhparam: 'auto'`option. When set to `'auto'`, well-known DHE parameters of sufficient strength + * will be selected automatically. Otherwise, if necessary, `openssl dhparam` can + * be used to create custom parameters. The key length must be greater than or + * equal to 1024 bits or else an error will be thrown. Although 1024 bits is + * permissible, use 2048 bits or larger for stronger security. + * @since v0.11.13 + */ + function createSecureContext(options?: SecureContextOptions): SecureContext; + /** + * Returns an array with the names of the supported TLS ciphers. The names are + * lower-case for historical reasons, but must be uppercased to be used in + * the `ciphers` option of {@link createSecureContext}. + * + * Not all supported ciphers are enabled by default. See `Modifying the default TLS cipher suite`. + * + * Cipher names that start with `'tls_'` are for TLSv1.3, all the others are for + * TLSv1.2 and below. + * + * ```js + * console.log(tls.getCiphers()); // ['aes128-gcm-sha256', 'aes128-sha', ...] + * ``` + * @since v0.10.2 + */ + function getCiphers(): string[]; + /** + * The default curve name to use for ECDH key agreement in a tls server. + * The default value is 'auto'. See tls.createSecureContext() for further + * information. + */ + let DEFAULT_ECDH_CURVE: string; + /** + * The default value of the maxVersion option of + * tls.createSecureContext(). It can be assigned any of the supported TLS + * protocol versions, 'TLSv1.3', 'TLSv1.2', 'TLSv1.1', or 'TLSv1'. Default: + * 'TLSv1.3', unless changed using CLI options. Using --tls-max-v1.2 sets + * the default to 'TLSv1.2'. Using --tls-max-v1.3 sets the default to + * 'TLSv1.3'. If multiple of the options are provided, the highest maximum + * is used. + */ + let DEFAULT_MAX_VERSION: SecureVersion; + /** + * The default value of the minVersion option of tls.createSecureContext(). + * It can be assigned any of the supported TLS protocol versions, + * 'TLSv1.3', 'TLSv1.2', 'TLSv1.1', or 'TLSv1'. Default: 'TLSv1.2', unless + * changed using CLI options. Using --tls-min-v1.0 sets the default to + * 'TLSv1'. Using --tls-min-v1.1 sets the default to 'TLSv1.1'. Using + * --tls-min-v1.3 sets the default to 'TLSv1.3'. If multiple of the options + * are provided, the lowest minimum is used. + */ + let DEFAULT_MIN_VERSION: SecureVersion; + /** + * The default value of the ciphers option of tls.createSecureContext(). + * It can be assigned any of the supported OpenSSL ciphers. + * Defaults to the content of crypto.constants.defaultCoreCipherList, unless + * changed using CLI options using --tls-default-ciphers. + */ + let DEFAULT_CIPHERS: string; + /** + * An immutable array of strings representing the root certificates (in PEM + * format) used for verifying peer certificates. This is the default value + * of the ca option to tls.createSecureContext(). + */ + const rootCertificates: ReadonlyArray; +} +declare module 'tls' { + export * from 'node:tls'; +} diff --git a/node_modules/@types/node/ts4.8/trace_events.d.ts b/node_modules/@types/node/ts4.8/trace_events.d.ts new file mode 100644 index 0000000..bb27b8e --- /dev/null +++ b/node_modules/@types/node/ts4.8/trace_events.d.ts @@ -0,0 +1,182 @@ +/** + * The `node:trace_events` module provides a mechanism to centralize tracing + * information generated by V8, Node.js core, and userspace code. + * + * Tracing can be enabled with the `--trace-event-categories` command-line flag + * or by using the `node:trace_events` module. The `--trace-event-categories` flag + * accepts a list of comma-separated category names. + * + * The available categories are: + * + * * `node`: An empty placeholder. + * * `node.async_hooks`: Enables capture of detailed `async_hooks` trace data. + * The `async_hooks` events have a unique `asyncId` and a special `triggerId` `triggerAsyncId` property. + * * `node.bootstrap`: Enables capture of Node.js bootstrap milestones. + * * `node.console`: Enables capture of `console.time()` and `console.count()`output. + * * `node.threadpoolwork.sync`: Enables capture of trace data for threadpool + * synchronous operations, such as `blob`, `zlib`, `crypto` and `node_api`. + * * `node.threadpoolwork.async`: Enables capture of trace data for threadpool + * asynchronous operations, such as `blob`, `zlib`, `crypto` and `node_api`. + * * `node.dns.native`: Enables capture of trace data for DNS queries. + * * `node.net.native`: Enables capture of trace data for network. + * * `node.environment`: Enables capture of Node.js Environment milestones. + * * `node.fs.sync`: Enables capture of trace data for file system sync methods. + * * `node.fs_dir.sync`: Enables capture of trace data for file system sync + * directory methods. + * * `node.fs.async`: Enables capture of trace data for file system async methods. + * * `node.fs_dir.async`: Enables capture of trace data for file system async + * directory methods. + * * `node.perf`: Enables capture of `Performance API` measurements. + * * `node.perf.usertiming`: Enables capture of only Performance API User Timing + * measures and marks. + * * `node.perf.timerify`: Enables capture of only Performance API timerify + * measurements. + * * `node.promises.rejections`: Enables capture of trace data tracking the number + * of unhandled Promise rejections and handled-after-rejections. + * * `node.vm.script`: Enables capture of trace data for the `node:vm` module's`runInNewContext()`, `runInContext()`, and `runInThisContext()` methods. + * * `v8`: The `V8` events are GC, compiling, and execution related. + * * `node.http`: Enables capture of trace data for http request / response. + * + * By default the `node`, `node.async_hooks`, and `v8` categories are enabled. + * + * ```bash + * node --trace-event-categories v8,node,node.async_hooks server.js + * ``` + * + * Prior versions of Node.js required the use of the `--trace-events-enabled`flag to enable trace events. This requirement has been removed. However, the`--trace-events-enabled` flag _may_ still be + * used and will enable the`node`, `node.async_hooks`, and `v8` trace event categories by default. + * + * ```bash + * node --trace-events-enabled + * + * # is equivalent to + * + * node --trace-event-categories v8,node,node.async_hooks + * ``` + * + * Alternatively, trace events may be enabled using the `node:trace_events` module: + * + * ```js + * const trace_events = require('node:trace_events'); + * const tracing = trace_events.createTracing({ categories: ['node.perf'] }); + * tracing.enable(); // Enable trace event capture for the 'node.perf' category + * + * // do work + * + * tracing.disable(); // Disable trace event capture for the 'node.perf' category + * ``` + * + * Running Node.js with tracing enabled will produce log files that can be opened + * in the [`chrome://tracing`](https://www.chromium.org/developers/how-tos/trace-event-profiling-tool) tab of Chrome. + * + * The logging file is by default called `node_trace.${rotation}.log`, where`${rotation}` is an incrementing log-rotation id. The filepath pattern can + * be specified with `--trace-event-file-pattern` that accepts a template + * string that supports `${rotation}` and `${pid}`: + * + * ```bash + * node --trace-event-categories v8 --trace-event-file-pattern '${pid}-${rotation}.log' server.js + * ``` + * + * To guarantee that the log file is properly generated after signal events like`SIGINT`, `SIGTERM`, or `SIGBREAK`, make sure to have the appropriate handlers + * in your code, such as: + * + * ```js + * process.on('SIGINT', function onSigint() { + * console.info('Received SIGINT.'); + * process.exit(130); // Or applicable exit code depending on OS and signal + * }); + * ``` + * + * The tracing system uses the same time source + * as the one used by `process.hrtime()`. + * However the trace-event timestamps are expressed in microseconds, + * unlike `process.hrtime()` which returns nanoseconds. + * + * The features from this module are not available in `Worker` threads. + * @experimental + * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/trace_events.js) + */ +declare module 'node:trace_events' { + /** + * The `Tracing` object is used to enable or disable tracing for sets of + * categories. Instances are created using the + * `trace_events.createTracing()` method. + * + * When created, the `Tracing` object is disabled. Calling the + * `tracing.enable()` method adds the categories to the set of enabled trace + * event categories. Calling `tracing.disable()` will remove the categories + * from the set of enabled trace event categories. + */ + interface Tracing { + /** + * A comma-separated list of the trace event categories covered by this + * `Tracing` object. + */ + readonly categories: string; + /** + * Disables this `Tracing` object. + * + * Only trace event categories _not_ covered by other enabled `Tracing` + * objects and _not_ specified by the `--trace-event-categories` flag + * will be disabled. + */ + disable(): void; + /** + * Enables this `Tracing` object for the set of categories covered by + * the `Tracing` object. + */ + enable(): void; + /** + * `true` only if the `Tracing` object has been enabled. + */ + readonly enabled: boolean; + } + interface CreateTracingOptions { + /** + * An array of trace category names. Values included in the array are + * coerced to a string when possible. An error will be thrown if the + * value cannot be coerced. + */ + categories: string[]; + } + /** + * Creates and returns a `Tracing` object for the given set of `categories`. + * + * ```js + * const trace_events = require('node:trace_events'); + * const categories = ['node.perf', 'node.async_hooks']; + * const tracing = trace_events.createTracing({ categories }); + * tracing.enable(); + * // do stuff + * tracing.disable(); + * ``` + * @since v10.0.0 + * @return . + */ + function createTracing(options: CreateTracingOptions): Tracing; + /** + * Returns a comma-separated list of all currently-enabled trace event + * categories. The current set of enabled trace event categories is determined + * by the _union_ of all currently-enabled `Tracing` objects and any categories + * enabled using the `--trace-event-categories` flag. + * + * Given the file `test.js` below, the command`node --trace-event-categories node.perf test.js` will print`'node.async_hooks,node.perf'` to the console. + * + * ```js + * const trace_events = require('node:trace_events'); + * const t1 = trace_events.createTracing({ categories: ['node.async_hooks'] }); + * const t2 = trace_events.createTracing({ categories: ['node.perf'] }); + * const t3 = trace_events.createTracing({ categories: ['v8'] }); + * + * t1.enable(); + * t2.enable(); + * + * console.log(trace_events.getEnabledCategories()); + * ``` + * @since v10.0.0 + */ + function getEnabledCategories(): string | undefined; +} +declare module 'trace_events' { + export * from 'node:trace_events'; +} diff --git a/node_modules/@types/node/ts4.8/tty.d.ts b/node_modules/@types/node/ts4.8/tty.d.ts new file mode 100644 index 0000000..3294bde --- /dev/null +++ b/node_modules/@types/node/ts4.8/tty.d.ts @@ -0,0 +1,208 @@ +/** + * The `node:tty` module provides the `tty.ReadStream` and `tty.WriteStream`classes. In most cases, it will not be necessary or possible to use this module + * directly. However, it can be accessed using: + * + * ```js + * const tty = require('node:tty'); + * ``` + * + * When Node.js detects that it is being run with a text terminal ("TTY") + * attached, `process.stdin` will, by default, be initialized as an instance of`tty.ReadStream` and both `process.stdout` and `process.stderr` will, by + * default, be instances of `tty.WriteStream`. The preferred method of determining + * whether Node.js is being run within a TTY context is to check that the value of + * the `process.stdout.isTTY` property is `true`: + * + * ```console + * $ node -p -e "Boolean(process.stdout.isTTY)" + * true + * $ node -p -e "Boolean(process.stdout.isTTY)" | cat + * false + * ``` + * + * In most cases, there should be little to no reason for an application to + * manually create instances of the `tty.ReadStream` and `tty.WriteStream`classes. + * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/tty.js) + */ +declare module 'node:tty' { + import * as net from 'node:net'; + /** + * The `tty.isatty()` method returns `true` if the given `fd` is associated with + * a TTY and `false` if it is not, including whenever `fd` is not a non-negative + * integer. + * @since v0.5.8 + * @param fd A numeric file descriptor + */ + function isatty(fd: number): boolean; + /** + * Represents the readable side of a TTY. In normal circumstances `process.stdin` will be the only `tty.ReadStream` instance in a Node.js + * process and there should be no reason to create additional instances. + * @since v0.5.8 + */ + class ReadStream extends net.Socket { + constructor(fd: number, options?: net.SocketConstructorOpts); + /** + * A `boolean` that is `true` if the TTY is currently configured to operate as a + * raw device. + * + * This flag is always `false` when a process starts, even if the terminal is + * operating in raw mode. Its value will change with subsequent calls to`setRawMode`. + * @since v0.7.7 + */ + isRaw: boolean; + /** + * Allows configuration of `tty.ReadStream` so that it operates as a raw device. + * + * When in raw mode, input is always available character-by-character, not + * including modifiers. Additionally, all special processing of characters by the + * terminal is disabled, including echoing input + * characters. Ctrl+C will no longer cause a `SIGINT` when + * in this mode. + * @since v0.7.7 + * @param mode If `true`, configures the `tty.ReadStream` to operate as a raw device. If `false`, configures the `tty.ReadStream` to operate in its default mode. The `readStream.isRaw` + * property will be set to the resulting mode. + * @return The read stream instance. + */ + setRawMode(mode: boolean): this; + /** + * A `boolean` that is always `true` for `tty.ReadStream` instances. + * @since v0.5.8 + */ + isTTY: boolean; + } + /** + * -1 - to the left from cursor + * 0 - the entire line + * 1 - to the right from cursor + */ + type Direction = -1 | 0 | 1; + /** + * Represents the writable side of a TTY. In normal circumstances,`process.stdout` and `process.stderr` will be the only`tty.WriteStream` instances created for a Node.js process and there + * should be no reason to create additional instances. + * @since v0.5.8 + */ + class WriteStream extends net.Socket { + constructor(fd: number); + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: 'resize', listener: () => void): this; + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: 'resize'): boolean; + on(event: string, listener: (...args: any[]) => void): this; + on(event: 'resize', listener: () => void): this; + once(event: string, listener: (...args: any[]) => void): this; + once(event: 'resize', listener: () => void): this; + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: 'resize', listener: () => void): this; + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: 'resize', listener: () => void): this; + /** + * `writeStream.clearLine()` clears the current line of this `WriteStream` in a + * direction identified by `dir`. + * @since v0.7.7 + * @param callback Invoked once the operation completes. + * @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. + */ + clearLine(dir: Direction, callback?: () => void): boolean; + /** + * `writeStream.clearScreenDown()` clears this `WriteStream` from the current + * cursor down. + * @since v0.7.7 + * @param callback Invoked once the operation completes. + * @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. + */ + clearScreenDown(callback?: () => void): boolean; + /** + * `writeStream.cursorTo()` moves this `WriteStream`'s cursor to the specified + * position. + * @since v0.7.7 + * @param callback Invoked once the operation completes. + * @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. + */ + cursorTo(x: number, y?: number, callback?: () => void): boolean; + cursorTo(x: number, callback: () => void): boolean; + /** + * `writeStream.moveCursor()` moves this `WriteStream`'s cursor _relative_ to its + * current position. + * @since v0.7.7 + * @param callback Invoked once the operation completes. + * @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. + */ + moveCursor(dx: number, dy: number, callback?: () => void): boolean; + /** + * Returns: + * + * * `1` for 2, + * * `4` for 16, + * * `8` for 256, + * * `24` for 16,777,216 colors supported. + * + * Use this to determine what colors the terminal supports. Due to the nature of + * colors in terminals it is possible to either have false positives or false + * negatives. It depends on process information and the environment variables that + * may lie about what terminal is used. + * It is possible to pass in an `env` object to simulate the usage of a specific + * terminal. This can be useful to check how specific environment settings behave. + * + * To enforce a specific color support, use one of the below environment settings. + * + * * 2 colors: `FORCE_COLOR = 0` (Disables colors) + * * 16 colors: `FORCE_COLOR = 1` + * * 256 colors: `FORCE_COLOR = 2` + * * 16,777,216 colors: `FORCE_COLOR = 3` + * + * Disabling color support is also possible by using the `NO_COLOR` and`NODE_DISABLE_COLORS` environment variables. + * @since v9.9.0 + * @param [env=process.env] An object containing the environment variables to check. This enables simulating the usage of a specific terminal. + */ + getColorDepth(env?: object): number; + /** + * Returns `true` if the `writeStream` supports at least as many colors as provided + * in `count`. Minimum support is 2 (black and white). + * + * This has the same false positives and negatives as described in `writeStream.getColorDepth()`. + * + * ```js + * process.stdout.hasColors(); + * // Returns true or false depending on if `stdout` supports at least 16 colors. + * process.stdout.hasColors(256); + * // Returns true or false depending on if `stdout` supports at least 256 colors. + * process.stdout.hasColors({ TMUX: '1' }); + * // Returns true. + * process.stdout.hasColors(2 ** 24, { TMUX: '1' }); + * // Returns false (the environment setting pretends to support 2 ** 8 colors). + * ``` + * @since v11.13.0, v10.16.0 + * @param [count=16] The number of colors that are requested (minimum 2). + * @param [env=process.env] An object containing the environment variables to check. This enables simulating the usage of a specific terminal. + */ + hasColors(count?: number): boolean; + hasColors(env?: object): boolean; + hasColors(count: number, env?: object): boolean; + /** + * `writeStream.getWindowSize()` returns the size of the TTY + * corresponding to this `WriteStream`. The array is of the type`[numColumns, numRows]` where `numColumns` and `numRows` represent the number + * of columns and rows in the corresponding TTY. + * @since v0.7.7 + */ + getWindowSize(): [number, number]; + /** + * A `number` specifying the number of columns the TTY currently has. This property + * is updated whenever the `'resize'` event is emitted. + * @since v0.7.7 + */ + columns: number; + /** + * A `number` specifying the number of rows the TTY currently has. This property + * is updated whenever the `'resize'` event is emitted. + * @since v0.7.7 + */ + rows: number; + /** + * A `boolean` that is always `true`. + * @since v0.5.8 + */ + isTTY: boolean; + } +} +declare module 'tty' { + export * from 'node:tty'; +} diff --git a/node_modules/@types/node/ts4.8/url.d.ts b/node_modules/@types/node/ts4.8/url.d.ts new file mode 100644 index 0000000..a674816 --- /dev/null +++ b/node_modules/@types/node/ts4.8/url.d.ts @@ -0,0 +1,915 @@ +/** + * The `node:url` module provides utilities for URL resolution and parsing. It can + * be accessed using: + * + * ```js + * import url from 'node:url'; + * ``` + * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/url.js) + */ +declare module 'node:url' { + import { Blob as NodeBlob } from 'node:buffer'; + import { ClientRequestArgs } from 'node:http'; + import { ParsedUrlQuery, ParsedUrlQueryInput } from 'node:querystring'; + // Input to `url.format` + interface UrlObject { + auth?: string | null | undefined; + hash?: string | null | undefined; + host?: string | null | undefined; + hostname?: string | null | undefined; + href?: string | null | undefined; + pathname?: string | null | undefined; + protocol?: string | null | undefined; + search?: string | null | undefined; + slashes?: boolean | null | undefined; + port?: string | number | null | undefined; + query?: string | null | ParsedUrlQueryInput | undefined; + } + // Output of `url.parse` + interface Url { + auth: string | null; + hash: string | null; + host: string | null; + hostname: string | null; + href: string; + path: string | null; + pathname: string | null; + protocol: string | null; + search: string | null; + slashes: boolean | null; + port: string | null; + query: string | null | ParsedUrlQuery; + } + interface UrlWithParsedQuery extends Url { + query: ParsedUrlQuery; + } + interface UrlWithStringQuery extends Url { + query: string | null; + } + /** + * The `url.parse()` method takes a URL string, parses it, and returns a URL + * object. + * + * A `TypeError` is thrown if `urlString` is not a string. + * + * A `URIError` is thrown if the `auth` property is present but cannot be decoded. + * + * `url.parse()` uses a lenient, non-standard algorithm for parsing URL + * strings. It is prone to security issues such as [host name spoofing](https://hackerone.com/reports/678487) and incorrect handling of usernames and passwords. Do not use with untrusted + * input. CVEs are not issued for `url.parse()` vulnerabilities. Use the `WHATWG URL` API instead. + * @since v0.1.25 + * @deprecated Use the WHATWG URL API instead. + * @param urlString The URL string to parse. + * @param [parseQueryString=false] If `true`, the `query` property will always be set to an object returned by the {@link querystring} module's `parse()` method. If `false`, the `query` property + * on the returned URL object will be an unparsed, undecoded string. + * @param [slashesDenoteHost=false] If `true`, the first token after the literal string `//` and preceding the next `/` will be interpreted as the `host`. For instance, given `//foo/bar`, the + * result would be `{host: 'foo', pathname: '/bar'}` rather than `{pathname: '//foo/bar'}`. + */ + function parse(urlString: string): UrlWithStringQuery; + function parse(urlString: string, parseQueryString: false | undefined, slashesDenoteHost?: boolean): UrlWithStringQuery; + function parse(urlString: string, parseQueryString: true, slashesDenoteHost?: boolean): UrlWithParsedQuery; + function parse(urlString: string, parseQueryString: boolean, slashesDenoteHost?: boolean): Url; + /** + * The `url.format()` method returns a formatted URL string derived from`urlObject`. + * + * ```js + * const url = require('node:url'); + * url.format({ + * protocol: 'https', + * hostname: 'example.com', + * pathname: '/some/path', + * query: { + * page: 1, + * format: 'json', + * }, + * }); + * + * // => 'https://example.com/some/path?page=1&format=json' + * ``` + * + * If `urlObject` is not an object or a string, `url.format()` will throw a `TypeError`. + * + * The formatting process operates as follows: + * + * * A new empty string `result` is created. + * * If `urlObject.protocol` is a string, it is appended as-is to `result`. + * * Otherwise, if `urlObject.protocol` is not `undefined` and is not a string, an `Error` is thrown. + * * For all string values of `urlObject.protocol` that _do not end_ with an ASCII + * colon (`:`) character, the literal string `:` will be appended to `result`. + * * If either of the following conditions is true, then the literal string `//`will be appended to `result`: + * * `urlObject.slashes` property is true; + * * `urlObject.protocol` begins with `http`, `https`, `ftp`, `gopher`, or`file`; + * * If the value of the `urlObject.auth` property is truthy, and either`urlObject.host` or `urlObject.hostname` are not `undefined`, the value of`urlObject.auth` will be coerced into a string + * and appended to `result`followed by the literal string `@`. + * * If the `urlObject.host` property is `undefined` then: + * * If the `urlObject.hostname` is a string, it is appended to `result`. + * * Otherwise, if `urlObject.hostname` is not `undefined` and is not a string, + * an `Error` is thrown. + * * If the `urlObject.port` property value is truthy, and `urlObject.hostname`is not `undefined`: + * * The literal string `:` is appended to `result`, and + * * The value of `urlObject.port` is coerced to a string and appended to`result`. + * * Otherwise, if the `urlObject.host` property value is truthy, the value of`urlObject.host` is coerced to a string and appended to `result`. + * * If the `urlObject.pathname` property is a string that is not an empty string: + * * If the `urlObject.pathname`_does not start_ with an ASCII forward slash + * (`/`), then the literal string `'/'` is appended to `result`. + * * The value of `urlObject.pathname` is appended to `result`. + * * Otherwise, if `urlObject.pathname` is not `undefined` and is not a string, an `Error` is thrown. + * * If the `urlObject.search` property is `undefined` and if the `urlObject.query`property is an `Object`, the literal string `?` is appended to `result`followed by the output of calling the + * `querystring` module's `stringify()`method passing the value of `urlObject.query`. + * * Otherwise, if `urlObject.search` is a string: + * * If the value of `urlObject.search`_does not start_ with the ASCII question + * mark (`?`) character, the literal string `?` is appended to `result`. + * * The value of `urlObject.search` is appended to `result`. + * * Otherwise, if `urlObject.search` is not `undefined` and is not a string, an `Error` is thrown. + * * If the `urlObject.hash` property is a string: + * * If the value of `urlObject.hash`_does not start_ with the ASCII hash (`#`) + * character, the literal string `#` is appended to `result`. + * * The value of `urlObject.hash` is appended to `result`. + * * Otherwise, if the `urlObject.hash` property is not `undefined` and is not a + * string, an `Error` is thrown. + * * `result` is returned. + * @since v0.1.25 + * @legacy Use the WHATWG URL API instead. + * @param urlObject A URL object (as returned by `url.parse()` or constructed otherwise). If a string, it is converted to an object by passing it to `url.parse()`. + */ + function format(urlObject: URL, options?: URLFormatOptions): string; + /** + * The `url.format()` method returns a formatted URL string derived from`urlObject`. + * + * ```js + * const url = require('url'); + * url.format({ + * protocol: 'https', + * hostname: 'example.com', + * pathname: '/some/path', + * query: { + * page: 1, + * format: 'json' + * } + * }); + * + * // => 'https://example.com/some/path?page=1&format=json' + * ``` + * + * If `urlObject` is not an object or a string, `url.format()` will throw a `TypeError`. + * + * The formatting process operates as follows: + * + * * A new empty string `result` is created. + * * If `urlObject.protocol` is a string, it is appended as-is to `result`. + * * Otherwise, if `urlObject.protocol` is not `undefined` and is not a string, an `Error` is thrown. + * * For all string values of `urlObject.protocol` that _do not end_ with an ASCII + * colon (`:`) character, the literal string `:` will be appended to `result`. + * * If either of the following conditions is true, then the literal string `//`will be appended to `result`: + * * `urlObject.slashes` property is true; + * * `urlObject.protocol` begins with `http`, `https`, `ftp`, `gopher`, or`file`; + * * If the value of the `urlObject.auth` property is truthy, and either`urlObject.host` or `urlObject.hostname` are not `undefined`, the value of`urlObject.auth` will be coerced into a string + * and appended to `result`followed by the literal string `@`. + * * If the `urlObject.host` property is `undefined` then: + * * If the `urlObject.hostname` is a string, it is appended to `result`. + * * Otherwise, if `urlObject.hostname` is not `undefined` and is not a string, + * an `Error` is thrown. + * * If the `urlObject.port` property value is truthy, and `urlObject.hostname`is not `undefined`: + * * The literal string `:` is appended to `result`, and + * * The value of `urlObject.port` is coerced to a string and appended to`result`. + * * Otherwise, if the `urlObject.host` property value is truthy, the value of`urlObject.host` is coerced to a string and appended to `result`. + * * If the `urlObject.pathname` property is a string that is not an empty string: + * * If the `urlObject.pathname`_does not start_ with an ASCII forward slash + * (`/`), then the literal string `'/'` is appended to `result`. + * * The value of `urlObject.pathname` is appended to `result`. + * * Otherwise, if `urlObject.pathname` is not `undefined` and is not a string, an `Error` is thrown. + * * If the `urlObject.search` property is `undefined` and if the `urlObject.query`property is an `Object`, the literal string `?` is appended to `result`followed by the output of calling the + * `querystring` module's `stringify()`method passing the value of `urlObject.query`. + * * Otherwise, if `urlObject.search` is a string: + * * If the value of `urlObject.search`_does not start_ with the ASCII question + * mark (`?`) character, the literal string `?` is appended to `result`. + * * The value of `urlObject.search` is appended to `result`. + * * Otherwise, if `urlObject.search` is not `undefined` and is not a string, an `Error` is thrown. + * * If the `urlObject.hash` property is a string: + * * If the value of `urlObject.hash`_does not start_ with the ASCII hash (`#`) + * character, the literal string `#` is appended to `result`. + * * The value of `urlObject.hash` is appended to `result`. + * * Otherwise, if the `urlObject.hash` property is not `undefined` and is not a + * string, an `Error` is thrown. + * * `result` is returned. + * @since v0.1.25 + * @legacy Use the WHATWG URL API instead. + * @param urlObject A URL object (as returned by `url.parse()` or constructed otherwise). If a string, it is converted to an object by passing it to `url.parse()`. + */ + function format(urlObject: UrlObject | string): string; + /** + * The `url.resolve()` method resolves a target URL relative to a base URL in a + * manner similar to that of a web browser resolving an anchor tag. + * + * ```js + * const url = require('node:url'); + * url.resolve('/one/two/three', 'four'); // '/one/two/four' + * url.resolve('http://example.com/', '/one'); // 'http://example.com/one' + * url.resolve('http://example.com/one', '/two'); // 'http://example.com/two' + * ``` + * + * To achieve the same result using the WHATWG URL API: + * + * ```js + * function resolve(from, to) { + * const resolvedUrl = new URL(to, new URL(from, 'resolve://')); + * if (resolvedUrl.protocol === 'resolve:') { + * // `from` is a relative URL. + * const { pathname, search, hash } = resolvedUrl; + * return pathname + search + hash; + * } + * return resolvedUrl.toString(); + * } + * + * resolve('/one/two/three', 'four'); // '/one/two/four' + * resolve('http://example.com/', '/one'); // 'http://example.com/one' + * resolve('http://example.com/one', '/two'); // 'http://example.com/two' + * ``` + * @since v0.1.25 + * @legacy Use the WHATWG URL API instead. + * @param from The base URL to use if `to` is a relative URL. + * @param to The target URL to resolve. + */ + function resolve(from: string, to: string): string; + /** + * Returns the [Punycode](https://tools.ietf.org/html/rfc5891#section-4.4) ASCII serialization of the `domain`. If `domain` is an + * invalid domain, the empty string is returned. + * + * It performs the inverse operation to {@link domainToUnicode}. + * + * ```js + * import url from 'node:url'; + * + * console.log(url.domainToASCII('español.com')); + * // Prints xn--espaol-zwa.com + * console.log(url.domainToASCII('中文.com')); + * // Prints xn--fiq228c.com + * console.log(url.domainToASCII('xn--iñvalid.com')); + * // Prints an empty string + * ``` + * @since v7.4.0, v6.13.0 + */ + function domainToASCII(domain: string): string; + /** + * Returns the Unicode serialization of the `domain`. If `domain` is an invalid + * domain, the empty string is returned. + * + * It performs the inverse operation to {@link domainToASCII}. + * + * ```js + * import url from 'node:url'; + * + * console.log(url.domainToUnicode('xn--espaol-zwa.com')); + * // Prints español.com + * console.log(url.domainToUnicode('xn--fiq228c.com')); + * // Prints 中文.com + * console.log(url.domainToUnicode('xn--iñvalid.com')); + * // Prints an empty string + * ``` + * @since v7.4.0, v6.13.0 + */ + function domainToUnicode(domain: string): string; + /** + * This function ensures the correct decodings of percent-encoded characters as + * well as ensuring a cross-platform valid absolute path string. + * + * ```js + * import { fileURLToPath } from 'node:url'; + * + * const __filename = fileURLToPath(import.meta.url); + * + * new URL('file:///C:/path/').pathname; // Incorrect: /C:/path/ + * fileURLToPath('file:///C:/path/'); // Correct: C:\path\ (Windows) + * + * new URL('file://nas/foo.txt').pathname; // Incorrect: /foo.txt + * fileURLToPath('file://nas/foo.txt'); // Correct: \\nas\foo.txt (Windows) + * + * new URL('file:///你好.txt').pathname; // Incorrect: /%E4%BD%A0%E5%A5%BD.txt + * fileURLToPath('file:///你好.txt'); // Correct: /你好.txt (POSIX) + * + * new URL('file:///hello world').pathname; // Incorrect: /hello%20world + * fileURLToPath('file:///hello world'); // Correct: /hello world (POSIX) + * ``` + * @since v10.12.0 + * @param url The file URL string or URL object to convert to a path. + * @return The fully-resolved platform-specific Node.js file path. + */ + function fileURLToPath(url: string | URL): string; + /** + * This function ensures that `path` is resolved absolutely, and that the URL + * control characters are correctly encoded when converting into a File URL. + * + * ```js + * import { pathToFileURL } from 'node:url'; + * + * new URL('/foo#1', 'file:'); // Incorrect: file:///foo#1 + * pathToFileURL('/foo#1'); // Correct: file:///foo%231 (POSIX) + * + * new URL('/some/path%.c', 'file:'); // Incorrect: file:///some/path%.c + * pathToFileURL('/some/path%.c'); // Correct: file:///some/path%25.c (POSIX) + * ``` + * @since v10.12.0 + * @param path The path to convert to a File URL. + * @return The file URL object. + */ + function pathToFileURL(path: string): URL; + /** + * This utility function converts a URL object into an ordinary options object as + * expected by the `http.request()` and `https.request()` APIs. + * + * ```js + * import { urlToHttpOptions } from 'node:url'; + * const myURL = new URL('https://a:b@測試?abc#foo'); + * + * console.log(urlToHttpOptions(myURL)); + * /* + * { + * protocol: 'https:', + * hostname: 'xn--g6w251d', + * hash: '#foo', + * search: '?abc', + * pathname: '/', + * path: '/?abc', + * href: 'https://a:b@xn--g6w251d/?abc#foo', + * auth: 'a:b' + * } + * + * ``` + * @since v15.7.0, v14.18.0 + * @param url The `WHATWG URL` object to convert to an options object. + * @return Options object + */ + function urlToHttpOptions(url: URL): ClientRequestArgs; + interface URLFormatOptions { + auth?: boolean | undefined; + fragment?: boolean | undefined; + search?: boolean | undefined; + unicode?: boolean | undefined; + } + /** + * Browser-compatible `URL` class, implemented by following the WHATWG URL + * Standard. [Examples of parsed URLs](https://url.spec.whatwg.org/#example-url-parsing) may be found in the Standard itself. + * The `URL` class is also available on the global object. + * + * In accordance with browser conventions, all properties of `URL` objects + * are implemented as getters and setters on the class prototype, rather than as + * data properties on the object itself. Thus, unlike `legacy urlObject` s, + * using the `delete` keyword on any properties of `URL` objects (e.g. `delete myURL.protocol`, `delete myURL.pathname`, etc) has no effect but will still + * return `true`. + * @since v7.0.0, v6.13.0 + */ + class URL { + /** + * Creates a `'blob:nodedata:...'` URL string that represents the given `Blob` object and can be used to retrieve the `Blob` later. + * + * ```js + * const { + * Blob, + * resolveObjectURL, + * } = require('node:buffer'); + * + * const blob = new Blob(['hello']); + * const id = URL.createObjectURL(blob); + * + * // later... + * + * const otherBlob = resolveObjectURL(id); + * console.log(otherBlob.size); + * ``` + * + * The data stored by the registered `Blob` will be retained in memory until`URL.revokeObjectURL()` is called to remove it. + * + * `Blob` objects are registered within the current thread. If using Worker + * Threads, `Blob` objects registered within one Worker will not be available + * to other workers or the main thread. + * @since v16.7.0 + * @experimental + */ + static createObjectURL(blob: NodeBlob): string; + /** + * Removes the stored `Blob` identified by the given ID. Attempting to revoke a + * ID that isn't registered will silently fail. + * @since v16.7.0 + * @experimental + * @param id A `'blob:nodedata:...` URL string returned by a prior call to `URL.createObjectURL()`. + */ + static revokeObjectURL(objectUrl: string): void; + /** + * Checks if an `input` relative to the `base` can be parsed to a `URL`. + * + * ```js + * const isValid = URL.canParse('/foo', 'https://example.org/'); // true + * + * const isNotValid = URL.canParse('/foo'); // false + * ``` + * @since v19.9.0 + * @param input The absolute or relative input URL to parse. If `input` is relative, then `base` is required. If `input` is absolute, the `base` is ignored. If `input` is not a string, it is + * `converted to a string` first. + * @param base The base URL to resolve against if the `input` is not absolute. If `base` is not a string, it is `converted to a string` first. + */ + static canParse(input: string, base?: string): boolean; + constructor(input: string, base?: string | URL); + /** + * Gets and sets the fragment portion of the URL. + * + * ```js + * const myURL = new URL('https://example.org/foo#bar'); + * console.log(myURL.hash); + * // Prints #bar + * + * myURL.hash = 'baz'; + * console.log(myURL.href); + * // Prints https://example.org/foo#baz + * ``` + * + * Invalid URL characters included in the value assigned to the `hash` property + * are `percent-encoded`. The selection of which characters to + * percent-encode may vary somewhat from what the {@link parse} and {@link format} methods would produce. + */ + hash: string; + /** + * Gets and sets the host portion of the URL. + * + * ```js + * const myURL = new URL('https://example.org:81/foo'); + * console.log(myURL.host); + * // Prints example.org:81 + * + * myURL.host = 'example.com:82'; + * console.log(myURL.href); + * // Prints https://example.com:82/foo + * ``` + * + * Invalid host values assigned to the `host` property are ignored. + */ + host: string; + /** + * Gets and sets the host name portion of the URL. The key difference between`url.host` and `url.hostname` is that `url.hostname` does _not_ include the + * port. + * + * ```js + * const myURL = new URL('https://example.org:81/foo'); + * console.log(myURL.hostname); + * // Prints example.org + * + * // Setting the hostname does not change the port + * myURL.hostname = 'example.com'; + * console.log(myURL.href); + * // Prints https://example.com:81/foo + * + * // Use myURL.host to change the hostname and port + * myURL.host = 'example.org:82'; + * console.log(myURL.href); + * // Prints https://example.org:82/foo + * ``` + * + * Invalid host name values assigned to the `hostname` property are ignored. + */ + hostname: string; + /** + * Gets and sets the serialized URL. + * + * ```js + * const myURL = new URL('https://example.org/foo'); + * console.log(myURL.href); + * // Prints https://example.org/foo + * + * myURL.href = 'https://example.com/bar'; + * console.log(myURL.href); + * // Prints https://example.com/bar + * ``` + * + * Getting the value of the `href` property is equivalent to calling {@link toString}. + * + * Setting the value of this property to a new value is equivalent to creating a + * new `URL` object using `new URL(value)`. Each of the `URL`object's properties will be modified. + * + * If the value assigned to the `href` property is not a valid URL, a `TypeError`will be thrown. + */ + href: string; + /** + * Gets the read-only serialization of the URL's origin. + * + * ```js + * const myURL = new URL('https://example.org/foo/bar?baz'); + * console.log(myURL.origin); + * // Prints https://example.org + * ``` + * + * ```js + * const idnURL = new URL('https://測試'); + * console.log(idnURL.origin); + * // Prints https://xn--g6w251d + * + * console.log(idnURL.hostname); + * // Prints xn--g6w251d + * ``` + */ + readonly origin: string; + /** + * Gets and sets the password portion of the URL. + * + * ```js + * const myURL = new URL('https://abc:xyz@example.com'); + * console.log(myURL.password); + * // Prints xyz + * + * myURL.password = '123'; + * console.log(myURL.href); + * // Prints https://abc:123@example.com/ + * ``` + * + * Invalid URL characters included in the value assigned to the `password` property + * are `percent-encoded`. The selection of which characters to + * percent-encode may vary somewhat from what the {@link parse} and {@link format} methods would produce. + */ + password: string; + /** + * Gets and sets the path portion of the URL. + * + * ```js + * const myURL = new URL('https://example.org/abc/xyz?123'); + * console.log(myURL.pathname); + * // Prints /abc/xyz + * + * myURL.pathname = '/abcdef'; + * console.log(myURL.href); + * // Prints https://example.org/abcdef?123 + * ``` + * + * Invalid URL characters included in the value assigned to the `pathname`property are `percent-encoded`. The selection of which characters + * to percent-encode may vary somewhat from what the {@link parse} and {@link format} methods would produce. + */ + pathname: string; + /** + * Gets and sets the port portion of the URL. + * + * The port value may be a number or a string containing a number in the range`0` to `65535` (inclusive). Setting the value to the default port of the`URL` objects given `protocol` will + * result in the `port` value becoming + * the empty string (`''`). + * + * The port value can be an empty string in which case the port depends on + * the protocol/scheme: + * + * + * + * Upon assigning a value to the port, the value will first be converted to a + * string using `.toString()`. + * + * If that string is invalid but it begins with a number, the leading number is + * assigned to `port`. + * If the number lies outside the range denoted above, it is ignored. + * + * ```js + * const myURL = new URL('https://example.org:8888'); + * console.log(myURL.port); + * // Prints 8888 + * + * // Default ports are automatically transformed to the empty string + * // (HTTPS protocol's default port is 443) + * myURL.port = '443'; + * console.log(myURL.port); + * // Prints the empty string + * console.log(myURL.href); + * // Prints https://example.org/ + * + * myURL.port = 1234; + * console.log(myURL.port); + * // Prints 1234 + * console.log(myURL.href); + * // Prints https://example.org:1234/ + * + * // Completely invalid port strings are ignored + * myURL.port = 'abcd'; + * console.log(myURL.port); + * // Prints 1234 + * + * // Leading numbers are treated as a port number + * myURL.port = '5678abcd'; + * console.log(myURL.port); + * // Prints 5678 + * + * // Non-integers are truncated + * myURL.port = 1234.5678; + * console.log(myURL.port); + * // Prints 1234 + * + * // Out-of-range numbers which are not represented in scientific notation + * // will be ignored. + * myURL.port = 1e10; // 10000000000, will be range-checked as described below + * console.log(myURL.port); + * // Prints 1234 + * ``` + * + * Numbers which contain a decimal point, + * such as floating-point numbers or numbers in scientific notation, + * are not an exception to this rule. + * Leading numbers up to the decimal point will be set as the URL's port, + * assuming they are valid: + * + * ```js + * myURL.port = 4.567e21; + * console.log(myURL.port); + * // Prints 4 (because it is the leading number in the string '4.567e21') + * ``` + */ + port: string; + /** + * Gets and sets the protocol portion of the URL. + * + * ```js + * const myURL = new URL('https://example.org'); + * console.log(myURL.protocol); + * // Prints https: + * + * myURL.protocol = 'ftp'; + * console.log(myURL.href); + * // Prints ftp://example.org/ + * ``` + * + * Invalid URL protocol values assigned to the `protocol` property are ignored. + */ + protocol: string; + /** + * Gets and sets the serialized query portion of the URL. + * + * ```js + * const myURL = new URL('https://example.org/abc?123'); + * console.log(myURL.search); + * // Prints ?123 + * + * myURL.search = 'abc=xyz'; + * console.log(myURL.href); + * // Prints https://example.org/abc?abc=xyz + * ``` + * + * Any invalid URL characters appearing in the value assigned the `search`property will be `percent-encoded`. The selection of which + * characters to percent-encode may vary somewhat from what the {@link parse} and {@link format} methods would produce. + */ + search: string; + /** + * Gets the `URLSearchParams` object representing the query parameters of the + * URL. This property is read-only but the `URLSearchParams` object it provides + * can be used to mutate the URL instance; to replace the entirety of query + * parameters of the URL, use the {@link search} setter. See `URLSearchParams` documentation for details. + * + * Use care when using `.searchParams` to modify the `URL` because, + * per the WHATWG specification, the `URLSearchParams` object uses + * different rules to determine which characters to percent-encode. For + * instance, the `URL` object will not percent encode the ASCII tilde (`~`) + * character, while `URLSearchParams` will always encode it: + * + * ```js + * const myURL = new URL('https://example.org/abc?foo=~bar'); + * + * console.log(myURL.search); // prints ?foo=~bar + * + * // Modify the URL via searchParams... + * myURL.searchParams.sort(); + * + * console.log(myURL.search); // prints ?foo=%7Ebar + * ``` + */ + readonly searchParams: URLSearchParams; + /** + * Gets and sets the username portion of the URL. + * + * ```js + * const myURL = new URL('https://abc:xyz@example.com'); + * console.log(myURL.username); + * // Prints abc + * + * myURL.username = '123'; + * console.log(myURL.href); + * // Prints https://123:xyz@example.com/ + * ``` + * + * Any invalid URL characters appearing in the value assigned the `username`property will be `percent-encoded`. The selection of which + * characters to percent-encode may vary somewhat from what the {@link parse} and {@link format} methods would produce. + */ + username: string; + /** + * The `toString()` method on the `URL` object returns the serialized URL. The + * value returned is equivalent to that of {@link href} and {@link toJSON}. + */ + toString(): string; + /** + * The `toJSON()` method on the `URL` object returns the serialized URL. The + * value returned is equivalent to that of {@link href} and {@link toString}. + * + * This method is automatically called when an `URL` object is serialized + * with [`JSON.stringify()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify). + * + * ```js + * const myURLs = [ + * new URL('https://www.example.com'), + * new URL('https://test.example.org'), + * ]; + * console.log(JSON.stringify(myURLs)); + * // Prints ["https://www.example.com/","https://test.example.org/"] + * ``` + */ + toJSON(): string; + } + /** + * The `URLSearchParams` API provides read and write access to the query of a`URL`. The `URLSearchParams` class can also be used standalone with one of the + * four following constructors. + * The `URLSearchParams` class is also available on the global object. + * + * The WHATWG `URLSearchParams` interface and the `querystring` module have + * similar purpose, but the purpose of the `querystring` module is more + * general, as it allows the customization of delimiter characters (`&` and `=`). + * On the other hand, this API is designed purely for URL query strings. + * + * ```js + * const myURL = new URL('https://example.org/?abc=123'); + * console.log(myURL.searchParams.get('abc')); + * // Prints 123 + * + * myURL.searchParams.append('abc', 'xyz'); + * console.log(myURL.href); + * // Prints https://example.org/?abc=123&abc=xyz + * + * myURL.searchParams.delete('abc'); + * myURL.searchParams.set('a', 'b'); + * console.log(myURL.href); + * // Prints https://example.org/?a=b + * + * const newSearchParams = new URLSearchParams(myURL.searchParams); + * // The above is equivalent to + * // const newSearchParams = new URLSearchParams(myURL.search); + * + * newSearchParams.append('a', 'c'); + * console.log(myURL.href); + * // Prints https://example.org/?a=b + * console.log(newSearchParams.toString()); + * // Prints a=b&a=c + * + * // newSearchParams.toString() is implicitly called + * myURL.search = newSearchParams; + * console.log(myURL.href); + * // Prints https://example.org/?a=b&a=c + * newSearchParams.delete('a'); + * console.log(myURL.href); + * // Prints https://example.org/?a=b&a=c + * ``` + * @since v7.5.0, v6.13.0 + */ + class URLSearchParams implements Iterable<[string, string]> { + constructor(init?: URLSearchParams | string | Record> | Iterable<[string, string]> | ReadonlyArray<[string, string]>); + /** + * Append a new name-value pair to the query string. + */ + append(name: string, value: string): void; + /** + * If `value` is provided, removes all name-value pairs + * where name is `name` and value is `value`.. + * + * If `value` is not provided, removes all name-value pairs whose name is `name`. + */ + delete(name: string, value?: string): void; + /** + * Returns an ES6 `Iterator` over each of the name-value pairs in the query. + * Each item of the iterator is a JavaScript `Array`. The first item of the `Array`is the `name`, the second item of the `Array` is the `value`. + * + * Alias for `urlSearchParams[@@iterator]()`. + */ + entries(): IterableIterator<[string, string]>; + /** + * Iterates over each name-value pair in the query and invokes the given function. + * + * ```js + * const myURL = new URL('https://example.org/?a=b&c=d'); + * myURL.searchParams.forEach((value, name, searchParams) => { + * console.log(name, value, myURL.searchParams === searchParams); + * }); + * // Prints: + * // a b true + * // c d true + * ``` + * @param fn Invoked for each name-value pair in the query + * @param thisArg To be used as `this` value for when `fn` is called + */ + forEach(callback: (this: TThis, value: string, name: string, searchParams: URLSearchParams) => void, thisArg?: TThis): void; + /** + * Returns the value of the first name-value pair whose name is `name`. If there + * are no such pairs, `null` is returned. + * @return or `null` if there is no name-value pair with the given `name`. + */ + get(name: string): string | null; + /** + * Returns the values of all name-value pairs whose name is `name`. If there are + * no such pairs, an empty array is returned. + */ + getAll(name: string): string[]; + /** + * Checks if the `URLSearchParams` object contains key-value pair(s) based on`name` and an optional `value` argument. + * + * If `value` is provided, returns `true` when name-value pair with + * same `name` and `value` exists. + * + * If `value` is not provided, returns `true` if there is at least one name-value + * pair whose name is `name`. + */ + has(name: string, value?: string): boolean; + /** + * Returns an ES6 `Iterator` over the names of each name-value pair. + * + * ```js + * const params = new URLSearchParams('foo=bar&foo=baz'); + * for (const name of params.keys()) { + * console.log(name); + * } + * // Prints: + * // foo + * // foo + * ``` + */ + keys(): IterableIterator; + /** + * Sets the value in the `URLSearchParams` object associated with `name` to`value`. If there are any pre-existing name-value pairs whose names are `name`, + * set the first such pair's value to `value` and remove all others. If not, + * append the name-value pair to the query string. + * + * ```js + * const params = new URLSearchParams(); + * params.append('foo', 'bar'); + * params.append('foo', 'baz'); + * params.append('abc', 'def'); + * console.log(params.toString()); + * // Prints foo=bar&foo=baz&abc=def + * + * params.set('foo', 'def'); + * params.set('xyz', 'opq'); + * console.log(params.toString()); + * // Prints foo=def&abc=def&xyz=opq + * ``` + */ + set(name: string, value: string): void; + /** + * The total number of parameter entries. + * @since v19.8.0 + */ + readonly size: number; + /** + * Sort all existing name-value pairs in-place by their names. Sorting is done + * with a [stable sorting algorithm](https://en.wikipedia.org/wiki/Sorting_algorithm#Stability), so relative order between name-value pairs + * with the same name is preserved. + * + * This method can be used, in particular, to increase cache hits. + * + * ```js + * const params = new URLSearchParams('query[]=abc&type=search&query[]=123'); + * params.sort(); + * console.log(params.toString()); + * // Prints query%5B%5D=abc&query%5B%5D=123&type=search + * ``` + * @since v7.7.0, v6.13.0 + */ + sort(): void; + /** + * Returns the search parameters serialized as a string, with characters + * percent-encoded where necessary. + */ + toString(): string; + /** + * Returns an ES6 `Iterator` over the values of each name-value pair. + */ + values(): IterableIterator; + [Symbol.iterator](): IterableIterator<[string, string]>; + } + import { URL as _URL, URLSearchParams as _URLSearchParams } from 'url'; + global { + interface URLSearchParams extends _URLSearchParams {} + interface URL extends _URL {} + interface Global { + URL: typeof _URL; + URLSearchParams: typeof _URLSearchParams; + } + /** + * `URL` class is a global reference for `require('url').URL` + * https://nodejs.org/api/url.html#the-whatwg-url-api + * @since v10.0.0 + */ + var URL: typeof globalThis extends { + onmessage: any; + URL: infer T; + } + ? T + : typeof _URL; + /** + * `URLSearchParams` class is a global reference for `require('url').URLSearchParams` + * https://nodejs.org/api/url.html#class-urlsearchparams + * @since v10.0.0 + */ + var URLSearchParams: typeof globalThis extends { + onmessage: any; + URLSearchParams: infer T; + } + ? T + : typeof _URLSearchParams; + } +} +declare module 'url' { + export * from 'node:url'; +} diff --git a/node_modules/@types/node/ts4.8/util.d.ts b/node_modules/@types/node/ts4.8/util.d.ts new file mode 100644 index 0000000..54fea92 --- /dev/null +++ b/node_modules/@types/node/ts4.8/util.d.ts @@ -0,0 +1,2116 @@ +/** + * The `node:util` module supports the needs of Node.js internal APIs. Many of the + * utilities are useful for application and module developers as well. To access + * it: + * + * ```js + * const util = require('node:util'); + * ``` + * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/util.js) + */ +declare module 'node:util' { + import * as types from 'node:util/types'; + export interface InspectOptions { + /** + * If `true`, object's non-enumerable symbols and properties are included in the formatted result. + * `WeakMap` and `WeakSet` entries are also included as well as user defined prototype properties (excluding method properties). + * @default false + */ + showHidden?: boolean | undefined; + /** + * Specifies the number of times to recurse while formatting object. + * This is useful for inspecting large objects. + * To recurse up to the maximum call stack size pass `Infinity` or `null`. + * @default 2 + */ + depth?: number | null | undefined; + /** + * If `true`, the output is styled with ANSI color codes. Colors are customizable. + */ + colors?: boolean | undefined; + /** + * If `false`, `[util.inspect.custom](depth, opts, inspect)` functions are not invoked. + * @default true + */ + customInspect?: boolean | undefined; + /** + * If `true`, `Proxy` inspection includes the target and handler objects. + * @default false + */ + showProxy?: boolean | undefined; + /** + * Specifies the maximum number of `Array`, `TypedArray`, `WeakMap`, and `WeakSet` elements + * to include when formatting. Set to `null` or `Infinity` to show all elements. + * Set to `0` or negative to show no elements. + * @default 100 + */ + maxArrayLength?: number | null | undefined; + /** + * Specifies the maximum number of characters to + * include when formatting. Set to `null` or `Infinity` to show all elements. + * Set to `0` or negative to show no characters. + * @default 10000 + */ + maxStringLength?: number | null | undefined; + /** + * The length at which input values are split across multiple lines. + * Set to `Infinity` to format the input as a single line + * (in combination with `compact` set to `true` or any number >= `1`). + * @default 80 + */ + breakLength?: number | undefined; + /** + * Setting this to `false` causes each object key + * to be displayed on a new line. It will also add new lines to text that is + * longer than `breakLength`. If set to a number, the most `n` inner elements + * are united on a single line as long as all properties fit into + * `breakLength`. Short array elements are also grouped together. Note that no + * text will be reduced below 16 characters, no matter the `breakLength` size. + * For more information, see the example below. + * @default true + */ + compact?: boolean | number | undefined; + /** + * If set to `true` or a function, all properties of an object, and `Set` and `Map` + * entries are sorted in the resulting string. + * If set to `true` the default sort is used. + * If set to a function, it is used as a compare function. + */ + sorted?: boolean | ((a: string, b: string) => number) | undefined; + /** + * If set to `true`, getters are going to be + * inspected as well. If set to `'get'` only getters without setter are going + * to be inspected. If set to `'set'` only getters having a corresponding + * setter are going to be inspected. This might cause side effects depending on + * the getter function. + * @default false + */ + getters?: 'get' | 'set' | boolean | undefined; + /** + * If set to `true`, an underscore is used to separate every three digits in all bigints and numbers. + * @default false + */ + numericSeparator?: boolean | undefined; + } + export type Style = 'special' | 'number' | 'bigint' | 'boolean' | 'undefined' | 'null' | 'string' | 'symbol' | 'date' | 'regexp' | 'module'; + export type CustomInspectFunction = (depth: number, options: InspectOptionsStylized) => any; // TODO: , inspect: inspect + export interface InspectOptionsStylized extends InspectOptions { + stylize(text: string, styleType: Style): string; + } + /** + * The `util.format()` method returns a formatted string using the first argument + * as a `printf`\-like format string which can contain zero or more format + * specifiers. Each specifier is replaced with the converted value from the + * corresponding argument. Supported specifiers are: + * + * If a specifier does not have a corresponding argument, it is not replaced: + * + * ```js + * util.format('%s:%s', 'foo'); + * // Returns: 'foo:%s' + * ``` + * + * Values that are not part of the format string are formatted using`util.inspect()` if their type is not `string`. + * + * If there are more arguments passed to the `util.format()` method than the + * number of specifiers, the extra arguments are concatenated to the returned + * string, separated by spaces: + * + * ```js + * util.format('%s:%s', 'foo', 'bar', 'baz'); + * // Returns: 'foo:bar baz' + * ``` + * + * If the first argument does not contain a valid format specifier, `util.format()`returns a string that is the concatenation of all arguments separated by spaces: + * + * ```js + * util.format(1, 2, 3); + * // Returns: '1 2 3' + * ``` + * + * If only one argument is passed to `util.format()`, it is returned as it is + * without any formatting: + * + * ```js + * util.format('%% %s'); + * // Returns: '%% %s' + * ``` + * + * `util.format()` is a synchronous method that is intended as a debugging tool. + * Some input values can have a significant performance overhead that can block the + * event loop. Use this function with care and never in a hot code path. + * @since v0.5.3 + * @param format A `printf`-like format string. + */ + export function format(format?: any, ...param: any[]): string; + /** + * This function is identical to {@link format}, except in that it takes + * an `inspectOptions` argument which specifies options that are passed along to {@link inspect}. + * + * ```js + * util.formatWithOptions({ colors: true }, 'See object %O', { foo: 42 }); + * // Returns 'See object { foo: 42 }', where `42` is colored as a number + * // when printed to a terminal. + * ``` + * @since v10.0.0 + */ + export function formatWithOptions(inspectOptions: InspectOptions, format?: any, ...param: any[]): string; + /** + * Returns the string name for a numeric error code that comes from a Node.js API. + * The mapping between error codes and error names is platform-dependent. + * See `Common System Errors` for the names of common errors. + * + * ```js + * fs.access('file/that/does/not/exist', (err) => { + * const name = util.getSystemErrorName(err.errno); + * console.error(name); // ENOENT + * }); + * ``` + * @since v9.7.0 + */ + export function getSystemErrorName(err: number): string; + /** + * Returns a Map of all system error codes available from the Node.js API. + * The mapping between error codes and error names is platform-dependent. + * See `Common System Errors` for the names of common errors. + * + * ```js + * fs.access('file/that/does/not/exist', (err) => { + * const errorMap = util.getSystemErrorMap(); + * const name = errorMap.get(err.errno); + * console.error(name); // ENOENT + * }); + * ``` + * @since v16.0.0, v14.17.0 + */ + export function getSystemErrorMap(): Map; + /** + * The `util.log()` method prints the given `string` to `stdout` with an included + * timestamp. + * + * ```js + * const util = require('node:util'); + * + * util.log('Timestamped message.'); + * ``` + * @since v0.3.0 + * @deprecated Since v6.0.0 - Use a third party module instead. + */ + export function log(string: string): void; + /** + * Returns the `string` after replacing any surrogate code points + * (or equivalently, any unpaired surrogate code units) with the + * Unicode "replacement character" U+FFFD. + * @since v16.8.0, v14.18.0 + */ + export function toUSVString(string: string): string; + /** + * Creates and returns an `AbortController` instance whose `AbortSignal` is marked + * as transferable and can be used with `structuredClone()` or `postMessage()`. + * @since v18.11.0 + * @experimental + * @returns A transferable AbortController + */ + export function transferableAbortController(): AbortController; + /** + * Marks the given `AbortSignal` as transferable so that it can be used with`structuredClone()` and `postMessage()`. + * + * ```js + * const signal = transferableAbortSignal(AbortSignal.timeout(100)); + * const channel = new MessageChannel(); + * channel.port2.postMessage(signal, [signal]); + * ``` + * @since v18.11.0 + * @experimental + * @param signal The AbortSignal + * @returns The same AbortSignal + */ + export function transferableAbortSignal(signal: AbortSignal): AbortSignal; + /** + * Listens to abort event on the provided `signal` and + * returns a promise that is fulfilled when the `signal` is + * aborted. If the passed `resource` is garbage collected before the `signal` is + * aborted, the returned promise shall remain pending indefinitely. + * + * ```js + * import { aborted } from 'node:util'; + * + * const dependent = obtainSomethingAbortable(); + * + * aborted(dependent.signal, dependent).then(() => { + * // Do something when dependent is aborted. + * }); + * + * dependent.on('event', () => { + * dependent.abort(); + * }); + * ``` + * @since v19.7.0 + * @experimental + * @param resource Any non-null entity, reference to which is held weakly. + */ + export function aborted(signal: AbortSignal, resource: any): Promise; + /** + * The `util.inspect()` method returns a string representation of `object` that is + * intended for debugging. The output of `util.inspect` may change at any time + * and should not be depended upon programmatically. Additional `options` may be + * passed that alter the result.`util.inspect()` will use the constructor's name and/or `@@toStringTag` to make + * an identifiable tag for an inspected value. + * + * ```js + * class Foo { + * get [Symbol.toStringTag]() { + * return 'bar'; + * } + * } + * + * class Bar {} + * + * const baz = Object.create(null, { [Symbol.toStringTag]: { value: 'foo' } }); + * + * util.inspect(new Foo()); // 'Foo [bar] {}' + * util.inspect(new Bar()); // 'Bar {}' + * util.inspect(baz); // '[foo] {}' + * ``` + * + * Circular references point to their anchor by using a reference index: + * + * ```js + * const { inspect } = require('node:util'); + * + * const obj = {}; + * obj.a = [obj]; + * obj.b = {}; + * obj.b.inner = obj.b; + * obj.b.obj = obj; + * + * console.log(inspect(obj)); + * // { + * // a: [ [Circular *1] ], + * // b: { inner: [Circular *2], obj: [Circular *1] } + * // } + * ``` + * + * The following example inspects all properties of the `util` object: + * + * ```js + * const util = require('node:util'); + * + * console.log(util.inspect(util, { showHidden: true, depth: null })); + * ``` + * + * The following example highlights the effect of the `compact` option: + * + * ```js + * const util = require('node:util'); + * + * const o = { + * a: [1, 2, [[ + * 'Lorem ipsum dolor sit amet,\nconsectetur adipiscing elit, sed do ' + + * 'eiusmod \ntempor incididunt ut labore et dolore magna aliqua.', + * 'test', + * 'foo']], 4], + * b: new Map([['za', 1], ['zb', 'test']]), + * }; + * console.log(util.inspect(o, { compact: true, depth: 5, breakLength: 80 })); + * + * // { a: + * // [ 1, + * // 2, + * // [ [ 'Lorem ipsum dolor sit amet,\nconsectetur [...]', // A long line + * // 'test', + * // 'foo' ] ], + * // 4 ], + * // b: Map(2) { 'za' => 1, 'zb' => 'test' } } + * + * // Setting `compact` to false or an integer creates more reader friendly output. + * console.log(util.inspect(o, { compact: false, depth: 5, breakLength: 80 })); + * + * // { + * // a: [ + * // 1, + * // 2, + * // [ + * // [ + * // 'Lorem ipsum dolor sit amet,\n' + + * // 'consectetur adipiscing elit, sed do eiusmod \n' + + * // 'tempor incididunt ut labore et dolore magna aliqua.', + * // 'test', + * // 'foo' + * // ] + * // ], + * // 4 + * // ], + * // b: Map(2) { + * // 'za' => 1, + * // 'zb' => 'test' + * // } + * // } + * + * // Setting `breakLength` to e.g. 150 will print the "Lorem ipsum" text in a + * // single line. + * ``` + * + * The `showHidden` option allows [`WeakMap`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap) and + * [`WeakSet`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet) entries to be + * inspected. If there are more entries than `maxArrayLength`, there is no + * guarantee which entries are displayed. That means retrieving the same [`WeakSet`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet) entries twice may + * result in different output. Furthermore, entries + * with no remaining strong references may be garbage collected at any time. + * + * ```js + * const { inspect } = require('node:util'); + * + * const obj = { a: 1 }; + * const obj2 = { b: 2 }; + * const weakSet = new WeakSet([obj, obj2]); + * + * console.log(inspect(weakSet, { showHidden: true })); + * // WeakSet { { a: 1 }, { b: 2 } } + * ``` + * + * The `sorted` option ensures that an object's property insertion order does not + * impact the result of `util.inspect()`. + * + * ```js + * const { inspect } = require('node:util'); + * const assert = require('node:assert'); + * + * const o1 = { + * b: [2, 3, 1], + * a: '`a` comes before `b`', + * c: new Set([2, 3, 1]), + * }; + * console.log(inspect(o1, { sorted: true })); + * // { a: '`a` comes before `b`', b: [ 2, 3, 1 ], c: Set(3) { 1, 2, 3 } } + * console.log(inspect(o1, { sorted: (a, b) => b.localeCompare(a) })); + * // { c: Set(3) { 3, 2, 1 }, b: [ 2, 3, 1 ], a: '`a` comes before `b`' } + * + * const o2 = { + * c: new Set([2, 1, 3]), + * a: '`a` comes before `b`', + * b: [2, 3, 1], + * }; + * assert.strict.equal( + * inspect(o1, { sorted: true }), + * inspect(o2, { sorted: true }), + * ); + * ``` + * + * The `numericSeparator` option adds an underscore every three digits to all + * numbers. + * + * ```js + * const { inspect } = require('node:util'); + * + * const thousand = 1_000; + * const million = 1_000_000; + * const bigNumber = 123_456_789n; + * const bigDecimal = 1_234.123_45; + * + * console.log(thousand, million, bigNumber, bigDecimal); + * // 1_000 1_000_000 123_456_789n 1_234.123_45 + * ``` + * + * `util.inspect()` is a synchronous method intended for debugging. Its maximum + * output length is approximately 128 MiB. Inputs that result in longer output will + * be truncated. + * @since v0.3.0 + * @param object Any JavaScript primitive or `Object`. + * @return The representation of `object`. + */ + export function inspect(object: any, showHidden?: boolean, depth?: number | null, color?: boolean): string; + export function inspect(object: any, options?: InspectOptions): string; + export namespace inspect { + let colors: NodeJS.Dict<[number, number]>; + let styles: { + [K in Style]: string; + }; + let defaultOptions: InspectOptions; + /** + * Allows changing inspect settings from the repl. + */ + let replDefaults: InspectOptions; + /** + * That can be used to declare custom inspect functions. + */ + const custom: unique symbol; + } + /** + * Alias for [`Array.isArray()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray). + * + * Returns `true` if the given `object` is an `Array`. Otherwise, returns `false`. + * + * ```js + * const util = require('node:util'); + * + * util.isArray([]); + * // Returns: true + * util.isArray(new Array()); + * // Returns: true + * util.isArray({}); + * // Returns: false + * ``` + * @since v0.6.0 + * @deprecated Since v4.0.0 - Use `isArray` instead. + */ + export function isArray(object: unknown): object is unknown[]; + /** + * Returns `true` if the given `object` is a `RegExp`. Otherwise, returns `false`. + * + * ```js + * const util = require('node:util'); + * + * util.isRegExp(/some regexp/); + * // Returns: true + * util.isRegExp(new RegExp('another regexp')); + * // Returns: true + * util.isRegExp({}); + * // Returns: false + * ``` + * @since v0.6.0 + * @deprecated Since v4.0.0 - Deprecated + */ + export function isRegExp(object: unknown): object is RegExp; + /** + * Returns `true` if the given `object` is a `Date`. Otherwise, returns `false`. + * + * ```js + * const util = require('node:util'); + * + * util.isDate(new Date()); + * // Returns: true + * util.isDate(Date()); + * // false (without 'new' returns a String) + * util.isDate({}); + * // Returns: false + * ``` + * @since v0.6.0 + * @deprecated Since v4.0.0 - Use {@link types.isDate} instead. + */ + export function isDate(object: unknown): object is Date; + /** + * Returns `true` if the given `object` is an `Error`. Otherwise, returns`false`. + * + * ```js + * const util = require('node:util'); + * + * util.isError(new Error()); + * // Returns: true + * util.isError(new TypeError()); + * // Returns: true + * util.isError({ name: 'Error', message: 'an error occurred' }); + * // Returns: false + * ``` + * + * This method relies on `Object.prototype.toString()` behavior. It is + * possible to obtain an incorrect result when the `object` argument manipulates`@@toStringTag`. + * + * ```js + * const util = require('node:util'); + * const obj = { name: 'Error', message: 'an error occurred' }; + * + * util.isError(obj); + * // Returns: false + * obj[Symbol.toStringTag] = 'Error'; + * util.isError(obj); + * // Returns: true + * ``` + * @since v0.6.0 + * @deprecated Since v4.0.0 - Use {@link types.isNativeError} instead. + */ + export function isError(object: unknown): object is Error; + /** + * Usage of `util.inherits()` is discouraged. Please use the ES6 `class` and`extends` keywords to get language level inheritance support. Also note + * that the two styles are [semantically incompatible](https://github.com/nodejs/node/issues/4179). + * + * Inherit the prototype methods from one [constructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/constructor) into another. The + * prototype of `constructor` will be set to a new object created from`superConstructor`. + * + * This mainly adds some input validation on top of`Object.setPrototypeOf(constructor.prototype, superConstructor.prototype)`. + * As an additional convenience, `superConstructor` will be accessible + * through the `constructor.super_` property. + * + * ```js + * const util = require('node:util'); + * const EventEmitter = require('node:events'); + * + * function MyStream() { + * EventEmitter.call(this); + * } + * + * util.inherits(MyStream, EventEmitter); + * + * MyStream.prototype.write = function(data) { + * this.emit('data', data); + * }; + * + * const stream = new MyStream(); + * + * console.log(stream instanceof EventEmitter); // true + * console.log(MyStream.super_ === EventEmitter); // true + * + * stream.on('data', (data) => { + * console.log(`Received data: "${data}"`); + * }); + * stream.write('It works!'); // Received data: "It works!" + * ``` + * + * ES6 example using `class` and `extends`: + * + * ```js + * const EventEmitter = require('node:events'); + * + * class MyStream extends EventEmitter { + * write(data) { + * this.emit('data', data); + * } + * } + * + * const stream = new MyStream(); + * + * stream.on('data', (data) => { + * console.log(`Received data: "${data}"`); + * }); + * stream.write('With ES6'); + * ``` + * @since v0.3.0 + * @legacy Use ES2015 class syntax and `extends` keyword instead. + */ + export function inherits(constructor: unknown, superConstructor: unknown): void; + export type DebugLoggerFunction = (msg: string, ...param: unknown[]) => void; + export interface DebugLogger extends DebugLoggerFunction { + enabled: boolean; + } + /** + * The `util.debuglog()` method is used to create a function that conditionally + * writes debug messages to `stderr` based on the existence of the `NODE_DEBUG`environment variable. If the `section` name appears within the value of that + * environment variable, then the returned function operates similar to `console.error()`. If not, then the returned function is a no-op. + * + * ```js + * const util = require('node:util'); + * const debuglog = util.debuglog('foo'); + * + * debuglog('hello from foo [%d]', 123); + * ``` + * + * If this program is run with `NODE_DEBUG=foo` in the environment, then + * it will output something like: + * + * ```console + * FOO 3245: hello from foo [123] + * ``` + * + * where `3245` is the process id. If it is not run with that + * environment variable set, then it will not print anything. + * + * The `section` supports wildcard also: + * + * ```js + * const util = require('node:util'); + * const debuglog = util.debuglog('foo-bar'); + * + * debuglog('hi there, it\'s foo-bar [%d]', 2333); + * ``` + * + * if it is run with `NODE_DEBUG=foo*` in the environment, then it will output + * something like: + * + * ```console + * FOO-BAR 3257: hi there, it's foo-bar [2333] + * ``` + * + * Multiple comma-separated `section` names may be specified in the `NODE_DEBUG`environment variable: `NODE_DEBUG=fs,net,tls`. + * + * The optional `callback` argument can be used to replace the logging function + * with a different function that doesn't have any initialization or + * unnecessary wrapping. + * + * ```js + * const util = require('node:util'); + * let debuglog = util.debuglog('internals', (debug) => { + * // Replace with a logging function that optimizes out + * // testing if the section is enabled + * debuglog = debug; + * }); + * ``` + * @since v0.11.3 + * @param section A string identifying the portion of the application for which the `debuglog` function is being created. + * @param callback A callback invoked the first time the logging function is called with a function argument that is a more optimized logging function. + * @return The logging function + */ + export function debuglog(section: string, callback?: (fn: DebugLoggerFunction) => void): DebugLogger; + export const debug: typeof debuglog; + /** + * Returns `true` if the given `object` is a `Boolean`. Otherwise, returns `false`. + * + * ```js + * const util = require('node:util'); + * + * util.isBoolean(1); + * // Returns: false + * util.isBoolean(0); + * // Returns: false + * util.isBoolean(false); + * // Returns: true + * ``` + * @since v0.11.5 + * @deprecated Since v4.0.0 - Use `typeof value === 'boolean'` instead. + */ + export function isBoolean(object: unknown): object is boolean; + /** + * Returns `true` if the given `object` is a `Buffer`. Otherwise, returns `false`. + * + * ```js + * const util = require('node:util'); + * + * util.isBuffer({ length: 0 }); + * // Returns: false + * util.isBuffer([]); + * // Returns: false + * util.isBuffer(Buffer.from('hello world')); + * // Returns: true + * ``` + * @since v0.11.5 + * @deprecated Since v4.0.0 - Use `isBuffer` instead. + */ + export function isBuffer(object: unknown): object is Buffer; + /** + * Returns `true` if the given `object` is a `Function`. Otherwise, returns`false`. + * + * ```js + * const util = require('node:util'); + * + * function Foo() {} + * const Bar = () => {}; + * + * util.isFunction({}); + * // Returns: false + * util.isFunction(Foo); + * // Returns: true + * util.isFunction(Bar); + * // Returns: true + * ``` + * @since v0.11.5 + * @deprecated Since v4.0.0 - Use `typeof value === 'function'` instead. + */ + export function isFunction(object: unknown): boolean; + /** + * Returns `true` if the given `object` is strictly `null`. Otherwise, returns`false`. + * + * ```js + * const util = require('node:util'); + * + * util.isNull(0); + * // Returns: false + * util.isNull(undefined); + * // Returns: false + * util.isNull(null); + * // Returns: true + * ``` + * @since v0.11.5 + * @deprecated Since v4.0.0 - Use `value === null` instead. + */ + export function isNull(object: unknown): object is null; + /** + * Returns `true` if the given `object` is `null` or `undefined`. Otherwise, + * returns `false`. + * + * ```js + * const util = require('node:util'); + * + * util.isNullOrUndefined(0); + * // Returns: false + * util.isNullOrUndefined(undefined); + * // Returns: true + * util.isNullOrUndefined(null); + * // Returns: true + * ``` + * @since v0.11.5 + * @deprecated Since v4.0.0 - Use `value === undefined || value === null` instead. + */ + export function isNullOrUndefined(object: unknown): object is null | undefined; + /** + * Returns `true` if the given `object` is a `Number`. Otherwise, returns `false`. + * + * ```js + * const util = require('node:util'); + * + * util.isNumber(false); + * // Returns: false + * util.isNumber(Infinity); + * // Returns: true + * util.isNumber(0); + * // Returns: true + * util.isNumber(NaN); + * // Returns: true + * ``` + * @since v0.11.5 + * @deprecated Since v4.0.0 - Use `typeof value === 'number'` instead. + */ + export function isNumber(object: unknown): object is number; + /** + * Returns `true` if the given `object` is strictly an `Object`**and** not a`Function` (even though functions are objects in JavaScript). + * Otherwise, returns `false`. + * + * ```js + * const util = require('node:util'); + * + * util.isObject(5); + * // Returns: false + * util.isObject(null); + * // Returns: false + * util.isObject({}); + * // Returns: true + * util.isObject(() => {}); + * // Returns: false + * ``` + * @since v0.11.5 + * @deprecated Since v4.0.0 - Use `value !== null && typeof value === 'object'` instead. + */ + export function isObject(object: unknown): boolean; + /** + * Returns `true` if the given `object` is a primitive type. Otherwise, returns`false`. + * + * ```js + * const util = require('node:util'); + * + * util.isPrimitive(5); + * // Returns: true + * util.isPrimitive('foo'); + * // Returns: true + * util.isPrimitive(false); + * // Returns: true + * util.isPrimitive(null); + * // Returns: true + * util.isPrimitive(undefined); + * // Returns: true + * util.isPrimitive({}); + * // Returns: false + * util.isPrimitive(() => {}); + * // Returns: false + * util.isPrimitive(/^$/); + * // Returns: false + * util.isPrimitive(new Date()); + * // Returns: false + * ``` + * @since v0.11.5 + * @deprecated Since v4.0.0 - Use `(typeof value !== 'object' && typeof value !== 'function') || value === null` instead. + */ + export function isPrimitive(object: unknown): boolean; + /** + * Returns `true` if the given `object` is a `string`. Otherwise, returns `false`. + * + * ```js + * const util = require('node:util'); + * + * util.isString(''); + * // Returns: true + * util.isString('foo'); + * // Returns: true + * util.isString(String('foo')); + * // Returns: true + * util.isString(5); + * // Returns: false + * ``` + * @since v0.11.5 + * @deprecated Since v4.0.0 - Use `typeof value === 'string'` instead. + */ + export function isString(object: unknown): object is string; + /** + * Returns `true` if the given `object` is a `Symbol`. Otherwise, returns `false`. + * + * ```js + * const util = require('node:util'); + * + * util.isSymbol(5); + * // Returns: false + * util.isSymbol('foo'); + * // Returns: false + * util.isSymbol(Symbol('foo')); + * // Returns: true + * ``` + * @since v0.11.5 + * @deprecated Since v4.0.0 - Use `typeof value === 'symbol'` instead. + */ + export function isSymbol(object: unknown): object is symbol; + /** + * Returns `true` if the given `object` is `undefined`. Otherwise, returns `false`. + * + * ```js + * const util = require('node:util'); + * + * const foo = undefined; + * util.isUndefined(5); + * // Returns: false + * util.isUndefined(foo); + * // Returns: true + * util.isUndefined(null); + * // Returns: false + * ``` + * @since v0.11.5 + * @deprecated Since v4.0.0 - Use `value === undefined` instead. + */ + export function isUndefined(object: unknown): object is undefined; + /** + * The `util.deprecate()` method wraps `fn` (which may be a function or class) in + * such a way that it is marked as deprecated. + * + * ```js + * const util = require('node:util'); + * + * exports.obsoleteFunction = util.deprecate(() => { + * // Do something here. + * }, 'obsoleteFunction() is deprecated. Use newShinyFunction() instead.'); + * ``` + * + * When called, `util.deprecate()` will return a function that will emit a`DeprecationWarning` using the `'warning'` event. The warning will + * be emitted and printed to `stderr` the first time the returned function is + * called. After the warning is emitted, the wrapped function is called without + * emitting a warning. + * + * If the same optional `code` is supplied in multiple calls to `util.deprecate()`, + * the warning will be emitted only once for that `code`. + * + * ```js + * const util = require('node:util'); + * + * const fn1 = util.deprecate(someFunction, someMessage, 'DEP0001'); + * const fn2 = util.deprecate(someOtherFunction, someOtherMessage, 'DEP0001'); + * fn1(); // Emits a deprecation warning with code DEP0001 + * fn2(); // Does not emit a deprecation warning because it has the same code + * ``` + * + * If either the `--no-deprecation` or `--no-warnings` command-line flags are + * used, or if the `process.noDeprecation` property is set to `true`_prior_ to + * the first deprecation warning, the `util.deprecate()` method does nothing. + * + * If the `--trace-deprecation` or `--trace-warnings` command-line flags are set, + * or the `process.traceDeprecation` property is set to `true`, a warning and a + * stack trace are printed to `stderr` the first time the deprecated function is + * called. + * + * If the `--throw-deprecation` command-line flag is set, or the`process.throwDeprecation` property is set to `true`, then an exception will be + * thrown when the deprecated function is called. + * + * The `--throw-deprecation` command-line flag and `process.throwDeprecation`property take precedence over `--trace-deprecation` and`process.traceDeprecation`. + * @since v0.8.0 + * @param fn The function that is being deprecated. + * @param msg A warning message to display when the deprecated function is invoked. + * @param code A deprecation code. See the `list of deprecated APIs` for a list of codes. + * @return The deprecated function wrapped to emit a warning. + */ + export function deprecate(fn: T, msg: string, code?: string): T; + /** + * Returns `true` if there is deep strict equality between `val1` and `val2`. + * Otherwise, returns `false`. + * + * See `assert.deepStrictEqual()` for more information about deep strict + * equality. + * @since v9.0.0 + */ + export function isDeepStrictEqual(val1: unknown, val2: unknown): boolean; + /** + * Returns `str` with any ANSI escape codes removed. + * + * ```js + * console.log(util.stripVTControlCharacters('\u001B[4mvalue\u001B[0m')); + * // Prints "value" + * ``` + * @since v16.11.0 + */ + export function stripVTControlCharacters(str: string): string; + /** + * Takes an `async` function (or a function that returns a `Promise`) and returns a + * function following the error-first callback style, i.e. taking + * an `(err, value) => ...` callback as the last argument. In the callback, the + * first argument will be the rejection reason (or `null` if the `Promise`resolved), and the second argument will be the resolved value. + * + * ```js + * const util = require('node:util'); + * + * async function fn() { + * return 'hello world'; + * } + * const callbackFunction = util.callbackify(fn); + * + * callbackFunction((err, ret) => { + * if (err) throw err; + * console.log(ret); + * }); + * ``` + * + * Will print: + * + * ```text + * hello world + * ``` + * + * The callback is executed asynchronously, and will have a limited stack trace. + * If the callback throws, the process will emit an `'uncaughtException'` event, and if not handled will exit. + * + * Since `null` has a special meaning as the first argument to a callback, if a + * wrapped function rejects a `Promise` with a falsy value as a reason, the value + * is wrapped in an `Error` with the original value stored in a field named`reason`. + * + * ```js + * function fn() { + * return Promise.reject(null); + * } + * const callbackFunction = util.callbackify(fn); + * + * callbackFunction((err, ret) => { + * // When the Promise was rejected with `null` it is wrapped with an Error and + * // the original value is stored in `reason`. + * err && Object.hasOwn(err, 'reason') && err.reason === null; // true + * }); + * ``` + * @since v8.2.0 + * @param fn An `async` function + * @return a callback style function + */ + export function callbackify(fn: () => Promise): (callback: (err: NodeJS.ErrnoException) => void) => void; + export function callbackify(fn: () => Promise): (callback: (err: NodeJS.ErrnoException, result: TResult) => void) => void; + export function callbackify(fn: (arg1: T1) => Promise): (arg1: T1, callback: (err: NodeJS.ErrnoException) => void) => void; + export function callbackify(fn: (arg1: T1) => Promise): (arg1: T1, callback: (err: NodeJS.ErrnoException, result: TResult) => void) => void; + export function callbackify(fn: (arg1: T1, arg2: T2) => Promise): (arg1: T1, arg2: T2, callback: (err: NodeJS.ErrnoException) => void) => void; + export function callbackify(fn: (arg1: T1, arg2: T2) => Promise): (arg1: T1, arg2: T2, callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void; + export function callbackify(fn: (arg1: T1, arg2: T2, arg3: T3) => Promise): (arg1: T1, arg2: T2, arg3: T3, callback: (err: NodeJS.ErrnoException) => void) => void; + export function callbackify( + fn: (arg1: T1, arg2: T2, arg3: T3) => Promise + ): (arg1: T1, arg2: T2, arg3: T3, callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void; + export function callbackify( + fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise + ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: NodeJS.ErrnoException) => void) => void; + export function callbackify( + fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise + ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void; + export function callbackify( + fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise + ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: NodeJS.ErrnoException) => void) => void; + export function callbackify( + fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise + ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void; + export function callbackify( + fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6) => Promise + ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, callback: (err: NodeJS.ErrnoException) => void) => void; + export function callbackify( + fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6) => Promise + ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void; + export interface CustomPromisifyLegacy extends Function { + __promisify__: TCustom; + } + export interface CustomPromisifySymbol extends Function { + [promisify.custom]: TCustom; + } + export type CustomPromisify = CustomPromisifySymbol | CustomPromisifyLegacy; + /** + * Takes a function following the common error-first callback style, i.e. taking + * an `(err, value) => ...` callback as the last argument, and returns a version + * that returns promises. + * + * ```js + * const util = require('node:util'); + * const fs = require('node:fs'); + * + * const stat = util.promisify(fs.stat); + * stat('.').then((stats) => { + * // Do something with `stats` + * }).catch((error) => { + * // Handle the error. + * }); + * ``` + * + * Or, equivalently using `async function`s: + * + * ```js + * const util = require('node:util'); + * const fs = require('node:fs'); + * + * const stat = util.promisify(fs.stat); + * + * async function callStat() { + * const stats = await stat('.'); + * console.log(`This directory is owned by ${stats.uid}`); + * } + * ``` + * + * If there is an `original[util.promisify.custom]` property present, `promisify`will return its value, see `Custom promisified functions`. + * + * `promisify()` assumes that `original` is a function taking a callback as its + * final argument in all cases. If `original` is not a function, `promisify()`will throw an error. If `original` is a function but its last argument is not + * an error-first callback, it will still be passed an error-first + * callback as its last argument. + * + * Using `promisify()` on class methods or other methods that use `this` may not + * work as expected unless handled specially: + * + * ```js + * const util = require('node:util'); + * + * class Foo { + * constructor() { + * this.a = 42; + * } + * + * bar(callback) { + * callback(null, this.a); + * } + * } + * + * const foo = new Foo(); + * + * const naiveBar = util.promisify(foo.bar); + * // TypeError: Cannot read property 'a' of undefined + * // naiveBar().then(a => console.log(a)); + * + * naiveBar.call(foo).then((a) => console.log(a)); // '42' + * + * const bindBar = naiveBar.bind(foo); + * bindBar().then((a) => console.log(a)); // '42' + * ``` + * @since v8.0.0 + */ + export function promisify(fn: CustomPromisify): TCustom; + export function promisify(fn: (callback: (err: any, result: TResult) => void) => void): () => Promise; + export function promisify(fn: (callback: (err?: any) => void) => void): () => Promise; + export function promisify(fn: (arg1: T1, callback: (err: any, result: TResult) => void) => void): (arg1: T1) => Promise; + export function promisify(fn: (arg1: T1, callback: (err?: any) => void) => void): (arg1: T1) => Promise; + export function promisify(fn: (arg1: T1, arg2: T2, callback: (err: any, result: TResult) => void) => void): (arg1: T1, arg2: T2) => Promise; + export function promisify(fn: (arg1: T1, arg2: T2, callback: (err?: any) => void) => void): (arg1: T1, arg2: T2) => Promise; + export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err: any, result: TResult) => void) => void): (arg1: T1, arg2: T2, arg3: T3) => Promise; + export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err?: any) => void) => void): (arg1: T1, arg2: T2, arg3: T3) => Promise; + export function promisify( + fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: any, result: TResult) => void) => void + ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise; + export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err?: any) => void) => void): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise; + export function promisify( + fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: any, result: TResult) => void) => void + ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise; + export function promisify( + fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err?: any) => void) => void + ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise; + export function promisify(fn: Function): Function; + export namespace promisify { + /** + * That can be used to declare custom promisified variants of functions. + */ + const custom: unique symbol; + } + /** + * An implementation of the [WHATWG Encoding Standard](https://encoding.spec.whatwg.org/) `TextDecoder` API. + * + * ```js + * const decoder = new TextDecoder(); + * const u8arr = new Uint8Array([72, 101, 108, 108, 111]); + * console.log(decoder.decode(u8arr)); // Hello + * ``` + * @since v8.3.0 + */ + export class TextDecoder { + /** + * The encoding supported by the `TextDecoder` instance. + */ + readonly encoding: string; + /** + * The value will be `true` if decoding errors result in a `TypeError` being + * thrown. + */ + readonly fatal: boolean; + /** + * The value will be `true` if the decoding result will include the byte order + * mark. + */ + readonly ignoreBOM: boolean; + constructor( + encoding?: string, + options?: { + fatal?: boolean | undefined; + ignoreBOM?: boolean | undefined; + } + ); + /** + * Decodes the `input` and returns a string. If `options.stream` is `true`, any + * incomplete byte sequences occurring at the end of the `input` are buffered + * internally and emitted after the next call to `textDecoder.decode()`. + * + * If `textDecoder.fatal` is `true`, decoding errors that occur will result in a`TypeError` being thrown. + * @param input An `ArrayBuffer`, `DataView`, or `TypedArray` instance containing the encoded data. + */ + decode( + input?: NodeJS.ArrayBufferView | ArrayBuffer | null, + options?: { + stream?: boolean | undefined; + } + ): string; + } + export interface EncodeIntoResult { + /** + * The read Unicode code units of input. + */ + read: number; + /** + * The written UTF-8 bytes of output. + */ + written: number; + } + export { types }; + + //// TextEncoder/Decoder + /** + * An implementation of the [WHATWG Encoding Standard](https://encoding.spec.whatwg.org/) `TextEncoder` API. All + * instances of `TextEncoder` only support UTF-8 encoding. + * + * ```js + * const encoder = new TextEncoder(); + * const uint8array = encoder.encode('this is some data'); + * ``` + * + * The `TextEncoder` class is also available on the global object. + * @since v8.3.0 + */ + export class TextEncoder { + /** + * The encoding supported by the `TextEncoder` instance. Always set to `'utf-8'`. + */ + readonly encoding: string; + /** + * UTF-8 encodes the `input` string and returns a `Uint8Array` containing the + * encoded bytes. + * @param [input='an empty string'] The text to encode. + */ + encode(input?: string): Uint8Array; + /** + * UTF-8 encodes the `src` string to the `dest` Uint8Array and returns an object + * containing the read Unicode code units and written UTF-8 bytes. + * + * ```js + * const encoder = new TextEncoder(); + * const src = 'this is some data'; + * const dest = new Uint8Array(10); + * const { read, written } = encoder.encodeInto(src, dest); + * ``` + * @param src The text to encode. + * @param dest The array to hold the encode result. + */ + encodeInto(src: string, dest: Uint8Array): EncodeIntoResult; + } + import { TextDecoder as _TextDecoder, TextEncoder as _TextEncoder } from 'util'; + global { + /** + * `TextDecoder` class is a global reference for `require('util').TextDecoder` + * https://nodejs.org/api/globals.html#textdecoder + * @since v11.0.0 + */ + var TextDecoder: typeof globalThis extends { + onmessage: any; + TextDecoder: infer TextDecoder; + } + ? TextDecoder + : typeof _TextDecoder; + /** + * `TextEncoder` class is a global reference for `require('util').TextEncoder` + * https://nodejs.org/api/globals.html#textencoder + * @since v11.0.0 + */ + var TextEncoder: typeof globalThis extends { + onmessage: any; + TextEncoder: infer TextEncoder; + } + ? TextEncoder + : typeof _TextEncoder; + } + + //// parseArgs + /** + * Provides a higher level API for command-line argument parsing than interacting + * with `process.argv` directly. Takes a specification for the expected arguments + * and returns a structured object with the parsed options and positionals. + * + * ```js + * import { parseArgs } from 'node:util'; + * const args = ['-f', '--bar', 'b']; + * const options = { + * foo: { + * type: 'boolean', + * short: 'f', + * }, + * bar: { + * type: 'string', + * }, + * }; + * const { + * values, + * positionals, + * } = parseArgs({ args, options }); + * console.log(values, positionals); + * // Prints: [Object: null prototype] { foo: true, bar: 'b' } [] + * ``` + * @since v18.3.0, v16.17.0 + * @param config Used to provide arguments for parsing and to configure the parser. `config` supports the following properties: + * @return The parsed command line arguments: + */ + export function parseArgs(config?: T): ParsedResults; + interface ParseArgsOptionConfig { + /** + * Type of argument. + */ + type: 'string' | 'boolean'; + /** + * Whether this option can be provided multiple times. + * If `true`, all values will be collected in an array. + * If `false`, values for the option are last-wins. + * @default false. + */ + multiple?: boolean | undefined; + /** + * A single character alias for the option. + */ + short?: string | undefined; + /** + * The default option value when it is not set by args. + * It must be of the same type as the the `type` property. + * When `multiple` is `true`, it must be an array. + * @since v18.11.0 + */ + default?: string | boolean | string[] | boolean[] | undefined; + } + interface ParseArgsOptionsConfig { + [longOption: string]: ParseArgsOptionConfig; + } + export interface ParseArgsConfig { + /** + * Array of argument strings. + */ + args?: string[] | undefined; + /** + * Used to describe arguments known to the parser. + */ + options?: ParseArgsOptionsConfig | undefined; + /** + * Should an error be thrown when unknown arguments are encountered, + * or when arguments are passed that do not match the `type` configured in `options`. + * @default true + */ + strict?: boolean | undefined; + /** + * Whether this command accepts positional arguments. + */ + allowPositionals?: boolean | undefined; + /** + * Return the parsed tokens. This is useful for extending the built-in behavior, + * from adding additional checks through to reprocessing the tokens in different ways. + * @default false + */ + tokens?: boolean | undefined; + } + /* + IfDefaultsTrue and IfDefaultsFalse are helpers to handle default values for missing boolean properties. + TypeScript does not have exact types for objects: https://github.com/microsoft/TypeScript/issues/12936 + This means it is impossible to distinguish between "field X is definitely not present" and "field X may or may not be present". + But we expect users to generally provide their config inline or `as const`, which means TS will always know whether a given field is present. + So this helper treats "not definitely present" (i.e., not `extends boolean`) as being "definitely not present", i.e. it should have its default value. + This is technically incorrect but is a much nicer UX for the common case. + The IfDefaultsTrue version is for things which default to true; the IfDefaultsFalse version is for things which default to false. + */ + type IfDefaultsTrue = T extends true + ? IfTrue + : T extends false + ? IfFalse + : IfTrue; + + // we put the `extends false` condition first here because `undefined` compares like `any` when `strictNullChecks: false` + type IfDefaultsFalse = T extends false + ? IfFalse + : T extends true + ? IfTrue + : IfFalse; + + type ExtractOptionValue = IfDefaultsTrue< + T['strict'], + O['type'] extends 'string' ? string : O['type'] extends 'boolean' ? boolean : string | boolean, + string | boolean + >; + + type ParsedValues = + & IfDefaultsTrue + & (T['options'] extends ParseArgsOptionsConfig + ? { + -readonly [LongOption in keyof T['options']]: IfDefaultsFalse< + T['options'][LongOption]['multiple'], + undefined | Array>, + undefined | ExtractOptionValue + >; + } + : {}); + + type ParsedPositionals = IfDefaultsTrue< + T['strict'], + IfDefaultsFalse, + IfDefaultsTrue + >; + + type PreciseTokenForOptions< + K extends string, + O extends ParseArgsOptionConfig, + > = O['type'] extends 'string' + ? { + kind: 'option'; + index: number; + name: K; + rawName: string; + value: string; + inlineValue: boolean; + } + : O['type'] extends 'boolean' + ? { + kind: 'option'; + index: number; + name: K; + rawName: string; + value: undefined; + inlineValue: undefined; + } + : OptionToken & { name: K }; + + type TokenForOptions< + T extends ParseArgsConfig, + K extends keyof T['options'] = keyof T['options'], + > = K extends unknown + ? T['options'] extends ParseArgsOptionsConfig + ? PreciseTokenForOptions + : OptionToken + : never; + + type ParsedOptionToken = IfDefaultsTrue, OptionToken>; + + type ParsedPositionalToken = IfDefaultsTrue< + T['strict'], + IfDefaultsFalse, + IfDefaultsTrue + >; + + type ParsedTokens = Array< + ParsedOptionToken | ParsedPositionalToken | { kind: 'option-terminator'; index: number } + >; + + type PreciseParsedResults = IfDefaultsFalse< + T['tokens'], + { + values: ParsedValues; + positionals: ParsedPositionals; + tokens: ParsedTokens; + }, + { + values: ParsedValues; + positionals: ParsedPositionals; + } + >; + + type OptionToken = + | { kind: 'option'; index: number; name: string; rawName: string; value: string; inlineValue: boolean } + | { + kind: 'option'; + index: number; + name: string; + rawName: string; + value: undefined; + inlineValue: undefined; + }; + + type Token = + | OptionToken + | { kind: 'positional'; index: number; value: string } + | { kind: 'option-terminator'; index: number }; + + // If ParseArgsConfig extends T, then the user passed config constructed elsewhere. + // So we can't rely on the `"not definitely present" implies "definitely not present"` assumption mentioned above. + type ParsedResults = ParseArgsConfig extends T + ? { + values: { + [longOption: string]: undefined | string | boolean | Array; + }; + positionals: string[]; + tokens?: Token[]; + } + : PreciseParsedResults; + + /** + * An implementation of [the MIMEType class](https://bmeck.github.io/node-proposal-mime-api/). + * + * In accordance with browser conventions, all properties of `MIMEType` objects + * are implemented as getters and setters on the class prototype, rather than as + * data properties on the object itself. + * + * A MIME string is a structured string containing multiple meaningful + * components. When parsed, a `MIMEType` object is returned containing + * properties for each of these components. + * @since v19.1.0, v18.13.0 + * @experimental + */ + export class MIMEType { + /** + * Creates a new MIMEType object by parsing the input. + * + * A `TypeError` will be thrown if the `input` is not a valid MIME. + * Note that an effort will be made to coerce the given values into strings. + * @param input The input MIME to parse. + */ + constructor(input: string | { toString: () => string }); + + /** + * Gets and sets the type portion of the MIME. + * + * ```js + * import { MIMEType } from 'node:util'; + * + * const myMIME = new MIMEType('text/javascript'); + * console.log(myMIME.type); + * // Prints: text + * myMIME.type = 'application'; + * console.log(myMIME.type); + * // Prints: application + * console.log(String(myMIME)); + * // Prints: application/javascript + * ``` + */ + type: string; + /** + * Gets and sets the subtype portion of the MIME. + * + * ```js + * import { MIMEType } from 'node:util'; + * + * const myMIME = new MIMEType('text/ecmascript'); + * console.log(myMIME.subtype); + * // Prints: ecmascript + * myMIME.subtype = 'javascript'; + * console.log(myMIME.subtype); + * // Prints: javascript + * console.log(String(myMIME)); + * // Prints: text/javascript + * ``` + */ + subtype: string; + /** + * Gets the essence of the MIME. This property is read only. + * Use `mime.type` or `mime.subtype` to alter the MIME. + * + * ```js + * import { MIMEType } from 'node:util'; + * + * const myMIME = new MIMEType('text/javascript;key=value'); + * console.log(myMIME.essence); + * // Prints: text/javascript + * myMIME.type = 'application'; + * console.log(myMIME.essence); + * // Prints: application/javascript + * console.log(String(myMIME)); + * // Prints: application/javascript;key=value + * ``` + */ + readonly essence: string; + /** + * Gets the `MIMEParams` object representing the + * parameters of the MIME. This property is read-only. See `MIMEParams` documentation for details. + */ + readonly params: MIMEParams; + /** + * The `toString()` method on the `MIMEType` object returns the serialized MIME. + * + * Because of the need for standard compliance, this method does not allow users + * to customize the serialization process of the MIME. + */ + toString(): string; + } + /** + * The `MIMEParams` API provides read and write access to the parameters of a`MIMEType`. + * @since v19.1.0, v18.13.0 + */ + export class MIMEParams { + /** + * Remove all name-value pairs whose name is `name`. + */ + delete(name: string): void; + /** + * Returns an iterator over each of the name-value pairs in the parameters. + * Each item of the iterator is a JavaScript `Array`. The first item of the array + * is the `name`, the second item of the array is the `value`. + */ + entries(): IterableIterator<[string, string]>; + /** + * Returns the value of the first name-value pair whose name is `name`. If there + * are no such pairs, `null` is returned. + * @return or `null` if there is no name-value pair with the given `name`. + */ + get(name: string): string | null; + /** + * Returns `true` if there is at least one name-value pair whose name is `name`. + */ + has(name: string): boolean; + /** + * Returns an iterator over the names of each name-value pair. + * + * ```js + * import { MIMEType } from 'node:util'; + * + * const { params } = new MIMEType('text/plain;foo=0;bar=1'); + * for (const name of params.keys()) { + * console.log(name); + * } + * // Prints: + * // foo + * // bar + * ``` + */ + keys(): IterableIterator; + /** + * Sets the value in the `MIMEParams` object associated with `name` to`value`. If there are any pre-existing name-value pairs whose names are `name`, + * set the first such pair's value to `value`. + * + * ```js + * import { MIMEType } from 'node:util'; + * + * const { params } = new MIMEType('text/plain;foo=0;bar=1'); + * params.set('foo', 'def'); + * params.set('baz', 'xyz'); + * console.log(params.toString()); + * // Prints: foo=def&bar=1&baz=xyz + * ``` + */ + set(name: string, value: string): void; + /** + * Returns an iterator over the values of each name-value pair. + */ + values(): IterableIterator; + /** + * Returns an iterator over each of the name-value pairs in the parameters. + */ + [Symbol.iterator]: typeof MIMEParams.prototype.entries; + } +} +declare module 'util/types' { + export * from 'util/types'; +} +declare module 'util/types' { + import { KeyObject, webcrypto } from 'node:crypto'; + /** + * Returns `true` if the value is a built-in [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) or + * [`SharedArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer) instance. + * + * See also `util.types.isArrayBuffer()` and `util.types.isSharedArrayBuffer()`. + * + * ```js + * util.types.isAnyArrayBuffer(new ArrayBuffer()); // Returns true + * util.types.isAnyArrayBuffer(new SharedArrayBuffer()); // Returns true + * ``` + * @since v10.0.0 + */ + function isAnyArrayBuffer(object: unknown): object is ArrayBufferLike; + /** + * Returns `true` if the value is an `arguments` object. + * + * ```js + * function foo() { + * util.types.isArgumentsObject(arguments); // Returns true + * } + * ``` + * @since v10.0.0 + */ + function isArgumentsObject(object: unknown): object is IArguments; + /** + * Returns `true` if the value is a built-in [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) instance. + * This does _not_ include [`SharedArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer) instances. Usually, it is + * desirable to test for both; See `util.types.isAnyArrayBuffer()` for that. + * + * ```js + * util.types.isArrayBuffer(new ArrayBuffer()); // Returns true + * util.types.isArrayBuffer(new SharedArrayBuffer()); // Returns false + * ``` + * @since v10.0.0 + */ + function isArrayBuffer(object: unknown): object is ArrayBuffer; + /** + * Returns `true` if the value is an instance of one of the [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) views, such as typed + * array objects or [`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView). Equivalent to + * [`ArrayBuffer.isView()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/isView). + * + * ```js + * util.types.isArrayBufferView(new Int8Array()); // true + * util.types.isArrayBufferView(Buffer.from('hello world')); // true + * util.types.isArrayBufferView(new DataView(new ArrayBuffer(16))); // true + * util.types.isArrayBufferView(new ArrayBuffer()); // false + * ``` + * @since v10.0.0 + */ + function isArrayBufferView(object: unknown): object is NodeJS.ArrayBufferView; + /** + * Returns `true` if the value is an [async function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function). + * This only reports back what the JavaScript engine is seeing; + * in particular, the return value may not match the original source code if + * a transpilation tool was used. + * + * ```js + * util.types.isAsyncFunction(function foo() {}); // Returns false + * util.types.isAsyncFunction(async function foo() {}); // Returns true + * ``` + * @since v10.0.0 + */ + function isAsyncFunction(object: unknown): boolean; + /** + * Returns `true` if the value is a `BigInt64Array` instance. + * + * ```js + * util.types.isBigInt64Array(new BigInt64Array()); // Returns true + * util.types.isBigInt64Array(new BigUint64Array()); // Returns false + * ``` + * @since v10.0.0 + */ + function isBigInt64Array(value: unknown): value is BigInt64Array; + /** + * Returns `true` if the value is a `BigUint64Array` instance. + * + * ```js + * util.types.isBigUint64Array(new BigInt64Array()); // Returns false + * util.types.isBigUint64Array(new BigUint64Array()); // Returns true + * ``` + * @since v10.0.0 + */ + function isBigUint64Array(value: unknown): value is BigUint64Array; + /** + * Returns `true` if the value is a boolean object, e.g. created + * by `new Boolean()`. + * + * ```js + * util.types.isBooleanObject(false); // Returns false + * util.types.isBooleanObject(true); // Returns false + * util.types.isBooleanObject(new Boolean(false)); // Returns true + * util.types.isBooleanObject(new Boolean(true)); // Returns true + * util.types.isBooleanObject(Boolean(false)); // Returns false + * util.types.isBooleanObject(Boolean(true)); // Returns false + * ``` + * @since v10.0.0 + */ + function isBooleanObject(object: unknown): object is Boolean; + /** + * Returns `true` if the value is any boxed primitive object, e.g. created + * by `new Boolean()`, `new String()` or `Object(Symbol())`. + * + * For example: + * + * ```js + * util.types.isBoxedPrimitive(false); // Returns false + * util.types.isBoxedPrimitive(new Boolean(false)); // Returns true + * util.types.isBoxedPrimitive(Symbol('foo')); // Returns false + * util.types.isBoxedPrimitive(Object(Symbol('foo'))); // Returns true + * util.types.isBoxedPrimitive(Object(BigInt(5))); // Returns true + * ``` + * @since v10.11.0 + */ + function isBoxedPrimitive(object: unknown): object is String | Number | BigInt | Boolean | Symbol; + /** + * Returns `true` if the value is a built-in [`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView) instance. + * + * ```js + * const ab = new ArrayBuffer(20); + * util.types.isDataView(new DataView(ab)); // Returns true + * util.types.isDataView(new Float64Array()); // Returns false + * ``` + * + * See also [`ArrayBuffer.isView()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/isView). + * @since v10.0.0 + */ + function isDataView(object: unknown): object is DataView; + /** + * Returns `true` if the value is a built-in [`Date`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) instance. + * + * ```js + * util.types.isDate(new Date()); // Returns true + * ``` + * @since v10.0.0 + */ + function isDate(object: unknown): object is Date; + /** + * Returns `true` if the value is a native `External` value. + * + * A native `External` value is a special type of object that contains a + * raw C++ pointer (`void*`) for access from native code, and has no other + * properties. Such objects are created either by Node.js internals or native + * addons. In JavaScript, they are [frozen](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze) objects with a`null` prototype. + * + * ```c + * #include + * #include + * napi_value result; + * static napi_value MyNapi(napi_env env, napi_callback_info info) { + * int* raw = (int*) malloc(1024); + * napi_status status = napi_create_external(env, (void*) raw, NULL, NULL, &result); + * if (status != napi_ok) { + * napi_throw_error(env, NULL, "napi_create_external failed"); + * return NULL; + * } + * return result; + * } + * ... + * DECLARE_NAPI_PROPERTY("myNapi", MyNapi) + * ... + * ``` + * + * ```js + * const native = require('napi_addon.node'); + * const data = native.myNapi(); + * util.types.isExternal(data); // returns true + * util.types.isExternal(0); // returns false + * util.types.isExternal(new String('foo')); // returns false + * ``` + * + * For further information on `napi_create_external`, refer to `napi_create_external()`. + * @since v10.0.0 + */ + function isExternal(object: unknown): boolean; + /** + * Returns `true` if the value is a built-in [`Float32Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array) instance. + * + * ```js + * util.types.isFloat32Array(new ArrayBuffer()); // Returns false + * util.types.isFloat32Array(new Float32Array()); // Returns true + * util.types.isFloat32Array(new Float64Array()); // Returns false + * ``` + * @since v10.0.0 + */ + function isFloat32Array(object: unknown): object is Float32Array; + /** + * Returns `true` if the value is a built-in [`Float64Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array) instance. + * + * ```js + * util.types.isFloat64Array(new ArrayBuffer()); // Returns false + * util.types.isFloat64Array(new Uint8Array()); // Returns false + * util.types.isFloat64Array(new Float64Array()); // Returns true + * ``` + * @since v10.0.0 + */ + function isFloat64Array(object: unknown): object is Float64Array; + /** + * Returns `true` if the value is a generator function. + * This only reports back what the JavaScript engine is seeing; + * in particular, the return value may not match the original source code if + * a transpilation tool was used. + * + * ```js + * util.types.isGeneratorFunction(function foo() {}); // Returns false + * util.types.isGeneratorFunction(function* foo() {}); // Returns true + * ``` + * @since v10.0.0 + */ + function isGeneratorFunction(object: unknown): object is GeneratorFunction; + /** + * Returns `true` if the value is a generator object as returned from a + * built-in generator function. + * This only reports back what the JavaScript engine is seeing; + * in particular, the return value may not match the original source code if + * a transpilation tool was used. + * + * ```js + * function* foo() {} + * const generator = foo(); + * util.types.isGeneratorObject(generator); // Returns true + * ``` + * @since v10.0.0 + */ + function isGeneratorObject(object: unknown): object is Generator; + /** + * Returns `true` if the value is a built-in [`Int8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array) instance. + * + * ```js + * util.types.isInt8Array(new ArrayBuffer()); // Returns false + * util.types.isInt8Array(new Int8Array()); // Returns true + * util.types.isInt8Array(new Float64Array()); // Returns false + * ``` + * @since v10.0.0 + */ + function isInt8Array(object: unknown): object is Int8Array; + /** + * Returns `true` if the value is a built-in [`Int16Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array) instance. + * + * ```js + * util.types.isInt16Array(new ArrayBuffer()); // Returns false + * util.types.isInt16Array(new Int16Array()); // Returns true + * util.types.isInt16Array(new Float64Array()); // Returns false + * ``` + * @since v10.0.0 + */ + function isInt16Array(object: unknown): object is Int16Array; + /** + * Returns `true` if the value is a built-in [`Int32Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array) instance. + * + * ```js + * util.types.isInt32Array(new ArrayBuffer()); // Returns false + * util.types.isInt32Array(new Int32Array()); // Returns true + * util.types.isInt32Array(new Float64Array()); // Returns false + * ``` + * @since v10.0.0 + */ + function isInt32Array(object: unknown): object is Int32Array; + /** + * Returns `true` if the value is a built-in [`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) instance. + * + * ```js + * util.types.isMap(new Map()); // Returns true + * ``` + * @since v10.0.0 + */ + function isMap(object: T | {}): object is T extends ReadonlyMap ? (unknown extends T ? never : ReadonlyMap) : Map; + /** + * Returns `true` if the value is an iterator returned for a built-in [`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) instance. + * + * ```js + * const map = new Map(); + * util.types.isMapIterator(map.keys()); // Returns true + * util.types.isMapIterator(map.values()); // Returns true + * util.types.isMapIterator(map.entries()); // Returns true + * util.types.isMapIterator(map[Symbol.iterator]()); // Returns true + * ``` + * @since v10.0.0 + */ + function isMapIterator(object: unknown): boolean; + /** + * Returns `true` if the value is an instance of a [Module Namespace Object](https://tc39.github.io/ecma262/#sec-module-namespace-exotic-objects). + * + * ```js + * import * as ns from './a.js'; + * + * util.types.isModuleNamespaceObject(ns); // Returns true + * ``` + * @since v10.0.0 + */ + function isModuleNamespaceObject(value: unknown): boolean; + /** + * Returns `true` if the value was returned by the constructor of a [built-in `Error` type](https://tc39.es/ecma262/#sec-error-objects). + * + * ```js + * console.log(util.types.isNativeError(new Error())); // true + * console.log(util.types.isNativeError(new TypeError())); // true + * console.log(util.types.isNativeError(new RangeError())); // true + * ``` + * + * Subclasses of the native error types are also native errors: + * + * ```js + * class MyError extends Error {} + * console.log(util.types.isNativeError(new MyError())); // true + * ``` + * + * A value being `instanceof` a native error class is not equivalent to `isNativeError()`returning `true` for that value. `isNativeError()` returns `true` for errors + * which come from a different [realm](https://tc39.es/ecma262/#realm) while `instanceof Error` returns `false`for these errors: + * + * ```js + * const vm = require('node:vm'); + * const context = vm.createContext({}); + * const myError = vm.runInContext('new Error()', context); + * console.log(util.types.isNativeError(myError)); // true + * console.log(myError instanceof Error); // false + * ``` + * + * Conversely, `isNativeError()` returns `false` for all objects which were not + * returned by the constructor of a native error. That includes values + * which are `instanceof` native errors: + * + * ```js + * const myError = { __proto__: Error.prototype }; + * console.log(util.types.isNativeError(myError)); // false + * console.log(myError instanceof Error); // true + * ``` + * @since v10.0.0 + */ + function isNativeError(object: unknown): object is Error; + /** + * Returns `true` if the value is a number object, e.g. created + * by `new Number()`. + * + * ```js + * util.types.isNumberObject(0); // Returns false + * util.types.isNumberObject(new Number(0)); // Returns true + * ``` + * @since v10.0.0 + */ + function isNumberObject(object: unknown): object is Number; + /** + * Returns `true` if the value is a built-in [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise). + * + * ```js + * util.types.isPromise(Promise.resolve(42)); // Returns true + * ``` + * @since v10.0.0 + */ + function isPromise(object: unknown): object is Promise; + /** + * Returns `true` if the value is a [`Proxy`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy) instance. + * + * ```js + * const target = {}; + * const proxy = new Proxy(target, {}); + * util.types.isProxy(target); // Returns false + * util.types.isProxy(proxy); // Returns true + * ``` + * @since v10.0.0 + */ + function isProxy(object: unknown): boolean; + /** + * Returns `true` if the value is a regular expression object. + * + * ```js + * util.types.isRegExp(/abc/); // Returns true + * util.types.isRegExp(new RegExp('abc')); // Returns true + * ``` + * @since v10.0.0 + */ + function isRegExp(object: unknown): object is RegExp; + /** + * Returns `true` if the value is a built-in [`Set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) instance. + * + * ```js + * util.types.isSet(new Set()); // Returns true + * ``` + * @since v10.0.0 + */ + function isSet(object: T | {}): object is T extends ReadonlySet ? (unknown extends T ? never : ReadonlySet) : Set; + /** + * Returns `true` if the value is an iterator returned for a built-in [`Set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) instance. + * + * ```js + * const set = new Set(); + * util.types.isSetIterator(set.keys()); // Returns true + * util.types.isSetIterator(set.values()); // Returns true + * util.types.isSetIterator(set.entries()); // Returns true + * util.types.isSetIterator(set[Symbol.iterator]()); // Returns true + * ``` + * @since v10.0.0 + */ + function isSetIterator(object: unknown): boolean; + /** + * Returns `true` if the value is a built-in [`SharedArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer) instance. + * This does _not_ include [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) instances. Usually, it is + * desirable to test for both; See `util.types.isAnyArrayBuffer()` for that. + * + * ```js + * util.types.isSharedArrayBuffer(new ArrayBuffer()); // Returns false + * util.types.isSharedArrayBuffer(new SharedArrayBuffer()); // Returns true + * ``` + * @since v10.0.0 + */ + function isSharedArrayBuffer(object: unknown): object is SharedArrayBuffer; + /** + * Returns `true` if the value is a string object, e.g. created + * by `new String()`. + * + * ```js + * util.types.isStringObject('foo'); // Returns false + * util.types.isStringObject(new String('foo')); // Returns true + * ``` + * @since v10.0.0 + */ + function isStringObject(object: unknown): object is String; + /** + * Returns `true` if the value is a symbol object, created + * by calling `Object()` on a `Symbol` primitive. + * + * ```js + * const symbol = Symbol('foo'); + * util.types.isSymbolObject(symbol); // Returns false + * util.types.isSymbolObject(Object(symbol)); // Returns true + * ``` + * @since v10.0.0 + */ + function isSymbolObject(object: unknown): object is Symbol; + /** + * Returns `true` if the value is a built-in [`TypedArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray) instance. + * + * ```js + * util.types.isTypedArray(new ArrayBuffer()); // Returns false + * util.types.isTypedArray(new Uint8Array()); // Returns true + * util.types.isTypedArray(new Float64Array()); // Returns true + * ``` + * + * See also [`ArrayBuffer.isView()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/isView). + * @since v10.0.0 + */ + function isTypedArray(object: unknown): object is NodeJS.TypedArray; + /** + * Returns `true` if the value is a built-in [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) instance. + * + * ```js + * util.types.isUint8Array(new ArrayBuffer()); // Returns false + * util.types.isUint8Array(new Uint8Array()); // Returns true + * util.types.isUint8Array(new Float64Array()); // Returns false + * ``` + * @since v10.0.0 + */ + function isUint8Array(object: unknown): object is Uint8Array; + /** + * Returns `true` if the value is a built-in [`Uint8ClampedArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray) instance. + * + * ```js + * util.types.isUint8ClampedArray(new ArrayBuffer()); // Returns false + * util.types.isUint8ClampedArray(new Uint8ClampedArray()); // Returns true + * util.types.isUint8ClampedArray(new Float64Array()); // Returns false + * ``` + * @since v10.0.0 + */ + function isUint8ClampedArray(object: unknown): object is Uint8ClampedArray; + /** + * Returns `true` if the value is a built-in [`Uint16Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array) instance. + * + * ```js + * util.types.isUint16Array(new ArrayBuffer()); // Returns false + * util.types.isUint16Array(new Uint16Array()); // Returns true + * util.types.isUint16Array(new Float64Array()); // Returns false + * ``` + * @since v10.0.0 + */ + function isUint16Array(object: unknown): object is Uint16Array; + /** + * Returns `true` if the value is a built-in [`Uint32Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array) instance. + * + * ```js + * util.types.isUint32Array(new ArrayBuffer()); // Returns false + * util.types.isUint32Array(new Uint32Array()); // Returns true + * util.types.isUint32Array(new Float64Array()); // Returns false + * ``` + * @since v10.0.0 + */ + function isUint32Array(object: unknown): object is Uint32Array; + /** + * Returns `true` if the value is a built-in [`WeakMap`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap) instance. + * + * ```js + * util.types.isWeakMap(new WeakMap()); // Returns true + * ``` + * @since v10.0.0 + */ + function isWeakMap(object: unknown): object is WeakMap; + /** + * Returns `true` if the value is a built-in [`WeakSet`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet) instance. + * + * ```js + * util.types.isWeakSet(new WeakSet()); // Returns true + * ``` + * @since v10.0.0 + */ + function isWeakSet(object: unknown): object is WeakSet; + /** + * Returns `true` if `value` is a `KeyObject`, `false` otherwise. + * @since v16.2.0 + */ + function isKeyObject(object: unknown): object is KeyObject; + /** + * Returns `true` if `value` is a `CryptoKey`, `false` otherwise. + * @since v16.2.0 + */ + function isCryptoKey(object: unknown): object is webcrypto.CryptoKey; +} +declare module 'util' { + export * from 'node:util'; +} +declare module 'node:util/types' { + export * from 'util/types'; +} diff --git a/node_modules/@types/node/ts4.8/v8.d.ts b/node_modules/@types/node/ts4.8/v8.d.ts new file mode 100644 index 0000000..295bf87 --- /dev/null +++ b/node_modules/@types/node/ts4.8/v8.d.ts @@ -0,0 +1,635 @@ +/** + * The `node:v8` module exposes APIs that are specific to the version of [V8](https://developers.google.com/v8/) built into the Node.js binary. It can be accessed using: + * + * ```js + * const v8 = require('node:v8'); + * ``` + * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/v8.js) + */ +declare module 'node:v8' { + import { Readable } from 'node:stream'; + interface HeapSpaceInfo { + space_name: string; + space_size: number; + space_used_size: number; + space_available_size: number; + physical_space_size: number; + } + // ** Signifies if the --zap_code_space option is enabled or not. 1 == enabled, 0 == disabled. */ + type DoesZapCodeSpaceFlag = 0 | 1; + interface HeapInfo { + total_heap_size: number; + total_heap_size_executable: number; + total_physical_size: number; + total_available_size: number; + used_heap_size: number; + heap_size_limit: number; + malloced_memory: number; + peak_malloced_memory: number; + does_zap_garbage: DoesZapCodeSpaceFlag; + number_of_native_contexts: number; + number_of_detached_contexts: number; + total_global_handles_size: number; + used_global_handles_size: number; + external_memory: number; + } + interface HeapCodeStatistics { + code_and_metadata_size: number; + bytecode_and_metadata_size: number; + external_script_source_size: number; + } + /** + * Returns an integer representing a version tag derived from the V8 version, + * command-line flags, and detected CPU features. This is useful for determining + * whether a `vm.Script` `cachedData` buffer is compatible with this instance + * of V8. + * + * ```js + * console.log(v8.cachedDataVersionTag()); // 3947234607 + * // The value returned by v8.cachedDataVersionTag() is derived from the V8 + * // version, command-line flags, and detected CPU features. Test that the value + * // does indeed update when flags are toggled. + * v8.setFlagsFromString('--allow_natives_syntax'); + * console.log(v8.cachedDataVersionTag()); // 183726201 + * ``` + * @since v8.0.0 + */ + function cachedDataVersionTag(): number; + /** + * Returns an object with the following properties: + * + * `does_zap_garbage` is a 0/1 boolean, which signifies whether the`--zap_code_space` option is enabled or not. This makes V8 overwrite heap + * garbage with a bit pattern. The RSS footprint (resident set size) gets bigger + * because it continuously touches all heap pages and that makes them less likely + * to get swapped out by the operating system. + * + * `number_of_native_contexts` The value of native\_context is the number of the + * top-level contexts currently active. Increase of this number over time indicates + * a memory leak. + * + * `number_of_detached_contexts` The value of detached\_context is the number + * of contexts that were detached and not yet garbage collected. This number + * being non-zero indicates a potential memory leak. + * + * `total_global_handles_size` The value of total\_global\_handles\_size is the + * total memory size of V8 global handles. + * + * `used_global_handles_size` The value of used\_global\_handles\_size is the + * used memory size of V8 global handles. + * + * `external_memory` The value of external\_memory is the memory size of array + * buffers and external strings. + * + * ```js + * { + * total_heap_size: 7326976, + * total_heap_size_executable: 4194304, + * total_physical_size: 7326976, + * total_available_size: 1152656, + * used_heap_size: 3476208, + * heap_size_limit: 1535115264, + * malloced_memory: 16384, + * peak_malloced_memory: 1127496, + * does_zap_garbage: 0, + * number_of_native_contexts: 1, + * number_of_detached_contexts: 0, + * total_global_handles_size: 8192, + * used_global_handles_size: 3296, + * external_memory: 318824 + * } + * ``` + * @since v1.0.0 + */ + function getHeapStatistics(): HeapInfo; + /** + * Returns statistics about the V8 heap spaces, i.e. the segments which make up + * the V8 heap. Neither the ordering of heap spaces, nor the availability of a + * heap space can be guaranteed as the statistics are provided via the + * V8[`GetHeapSpaceStatistics`](https://v8docs.nodesource.com/node-13.2/d5/dda/classv8_1_1_isolate.html#ac673576f24fdc7a33378f8f57e1d13a4) function and may change from one V8 version to the + * next. + * + * The value returned is an array of objects containing the following properties: + * + * ```json + * [ + * { + * "space_name": "new_space", + * "space_size": 2063872, + * "space_used_size": 951112, + * "space_available_size": 80824, + * "physical_space_size": 2063872 + * }, + * { + * "space_name": "old_space", + * "space_size": 3090560, + * "space_used_size": 2493792, + * "space_available_size": 0, + * "physical_space_size": 3090560 + * }, + * { + * "space_name": "code_space", + * "space_size": 1260160, + * "space_used_size": 644256, + * "space_available_size": 960, + * "physical_space_size": 1260160 + * }, + * { + * "space_name": "map_space", + * "space_size": 1094160, + * "space_used_size": 201608, + * "space_available_size": 0, + * "physical_space_size": 1094160 + * }, + * { + * "space_name": "large_object_space", + * "space_size": 0, + * "space_used_size": 0, + * "space_available_size": 1490980608, + * "physical_space_size": 0 + * } + * ] + * ``` + * @since v6.0.0 + */ + function getHeapSpaceStatistics(): HeapSpaceInfo[]; + /** + * The `v8.setFlagsFromString()` method can be used to programmatically set + * V8 command-line flags. This method should be used with care. Changing settings + * after the VM has started may result in unpredictable behavior, including + * crashes and data loss; or it may simply do nothing. + * + * The V8 options available for a version of Node.js may be determined by running`node --v8-options`. + * + * Usage: + * + * ```js + * // Print GC events to stdout for one minute. + * const v8 = require('node:v8'); + * v8.setFlagsFromString('--trace_gc'); + * setTimeout(() => { v8.setFlagsFromString('--notrace_gc'); }, 60e3); + * ``` + * @since v1.0.0 + */ + function setFlagsFromString(flags: string): void; + /** + * Generates a snapshot of the current V8 heap and returns a Readable + * Stream that may be used to read the JSON serialized representation. + * This JSON stream format is intended to be used with tools such as + * Chrome DevTools. The JSON schema is undocumented and specific to the + * V8 engine. Therefore, the schema may change from one version of V8 to the next. + * + * Creating a heap snapshot requires memory about twice the size of the heap at + * the time the snapshot is created. This results in the risk of OOM killers + * terminating the process. + * + * Generating a snapshot is a synchronous operation which blocks the event loop + * for a duration depending on the heap size. + * + * ```js + * // Print heap snapshot to the console + * const v8 = require('node:v8'); + * const stream = v8.getHeapSnapshot(); + * stream.pipe(process.stdout); + * ``` + * @since v11.13.0 + * @return A Readable containing the V8 heap snapshot. + */ + function getHeapSnapshot(): Readable; + /** + * Generates a snapshot of the current V8 heap and writes it to a JSON + * file. This file is intended to be used with tools such as Chrome + * DevTools. The JSON schema is undocumented and specific to the V8 + * engine, and may change from one version of V8 to the next. + * + * A heap snapshot is specific to a single V8 isolate. When using `worker threads`, a heap snapshot generated from the main thread will + * not contain any information about the workers, and vice versa. + * + * Creating a heap snapshot requires memory about twice the size of the heap at + * the time the snapshot is created. This results in the risk of OOM killers + * terminating the process. + * + * Generating a snapshot is a synchronous operation which blocks the event loop + * for a duration depending on the heap size. + * + * ```js + * const { writeHeapSnapshot } = require('node:v8'); + * const { + * Worker, + * isMainThread, + * parentPort, + * } = require('node:worker_threads'); + * + * if (isMainThread) { + * const worker = new Worker(__filename); + * + * worker.once('message', (filename) => { + * console.log(`worker heapdump: ${filename}`); + * // Now get a heapdump for the main thread. + * console.log(`main thread heapdump: ${writeHeapSnapshot()}`); + * }); + * + * // Tell the worker to create a heapdump. + * worker.postMessage('heapdump'); + * } else { + * parentPort.once('message', (message) => { + * if (message === 'heapdump') { + * // Generate a heapdump for the worker + * // and return the filename to the parent. + * parentPort.postMessage(writeHeapSnapshot()); + * } + * }); + * } + * ``` + * @since v11.13.0 + * @param filename The file path where the V8 heap snapshot is to be saved. If not specified, a file name with the pattern `'Heap-${yyyymmdd}-${hhmmss}-${pid}-${thread_id}.heapsnapshot'` will be + * generated, where `{pid}` will be the PID of the Node.js process, `{thread_id}` will be `0` when `writeHeapSnapshot()` is called from the main Node.js thread or the id of a + * worker thread. + * @return The filename where the snapshot was saved. + */ + function writeHeapSnapshot(filename?: string): string; + /** + * Get statistics about code and its metadata in the heap, see + * V8[`GetHeapCodeAndMetadataStatistics`](https://v8docs.nodesource.com/node-13.2/d5/dda/classv8_1_1_isolate.html#a6079122af17612ef54ef3348ce170866) API. Returns an object with the + * following properties: + * + * ```js + * { + * code_and_metadata_size: 212208, + * bytecode_and_metadata_size: 161368, + * external_script_source_size: 1410794, + * cpu_profiler_metadata_size: 0, + * } + * ``` + * @since v12.8.0 + */ + function getHeapCodeStatistics(): HeapCodeStatistics; + /** + * @since v8.0.0 + */ + class Serializer { + /** + * Writes out a header, which includes the serialization format version. + */ + writeHeader(): void; + /** + * Serializes a JavaScript value and adds the serialized representation to the + * internal buffer. + * + * This throws an error if `value` cannot be serialized. + */ + writeValue(val: any): boolean; + /** + * Returns the stored internal buffer. This serializer should not be used once + * the buffer is released. Calling this method results in undefined behavior + * if a previous write has failed. + */ + releaseBuffer(): Buffer; + /** + * Marks an `ArrayBuffer` as having its contents transferred out of band. + * Pass the corresponding `ArrayBuffer` in the deserializing context to `deserializer.transferArrayBuffer()`. + * @param id A 32-bit unsigned integer. + * @param arrayBuffer An `ArrayBuffer` instance. + */ + transferArrayBuffer(id: number, arrayBuffer: ArrayBuffer): void; + /** + * Write a raw 32-bit unsigned integer. + * For use inside of a custom `serializer._writeHostObject()`. + */ + writeUint32(value: number): void; + /** + * Write a raw 64-bit unsigned integer, split into high and low 32-bit parts. + * For use inside of a custom `serializer._writeHostObject()`. + */ + writeUint64(hi: number, lo: number): void; + /** + * Write a JS `number` value. + * For use inside of a custom `serializer._writeHostObject()`. + */ + writeDouble(value: number): void; + /** + * Write raw bytes into the serializer's internal buffer. The deserializer + * will require a way to compute the length of the buffer. + * For use inside of a custom `serializer._writeHostObject()`. + */ + writeRawBytes(buffer: NodeJS.TypedArray): void; + } + /** + * A subclass of `Serializer` that serializes `TypedArray`(in particular `Buffer`) and `DataView` objects as host objects, and only + * stores the part of their underlying `ArrayBuffer`s that they are referring to. + * @since v8.0.0 + */ + class DefaultSerializer extends Serializer {} + /** + * @since v8.0.0 + */ + class Deserializer { + constructor(data: NodeJS.TypedArray); + /** + * Reads and validates a header (including the format version). + * May, for example, reject an invalid or unsupported wire format. In that case, + * an `Error` is thrown. + */ + readHeader(): boolean; + /** + * Deserializes a JavaScript value from the buffer and returns it. + */ + readValue(): any; + /** + * Marks an `ArrayBuffer` as having its contents transferred out of band. + * Pass the corresponding `ArrayBuffer` in the serializing context to `serializer.transferArrayBuffer()` (or return the `id` from `serializer._getSharedArrayBufferId()` in the case of + * `SharedArrayBuffer`s). + * @param id A 32-bit unsigned integer. + * @param arrayBuffer An `ArrayBuffer` instance. + */ + transferArrayBuffer(id: number, arrayBuffer: ArrayBuffer): void; + /** + * Reads the underlying wire format version. Likely mostly to be useful to + * legacy code reading old wire format versions. May not be called before`.readHeader()`. + */ + getWireFormatVersion(): number; + /** + * Read a raw 32-bit unsigned integer and return it. + * For use inside of a custom `deserializer._readHostObject()`. + */ + readUint32(): number; + /** + * Read a raw 64-bit unsigned integer and return it as an array `[hi, lo]`with two 32-bit unsigned integer entries. + * For use inside of a custom `deserializer._readHostObject()`. + */ + readUint64(): [number, number]; + /** + * Read a JS `number` value. + * For use inside of a custom `deserializer._readHostObject()`. + */ + readDouble(): number; + /** + * Read raw bytes from the deserializer's internal buffer. The `length` parameter + * must correspond to the length of the buffer that was passed to `serializer.writeRawBytes()`. + * For use inside of a custom `deserializer._readHostObject()`. + */ + readRawBytes(length: number): Buffer; + } + /** + * A subclass of `Deserializer` corresponding to the format written by `DefaultSerializer`. + * @since v8.0.0 + */ + class DefaultDeserializer extends Deserializer {} + /** + * Uses a `DefaultSerializer` to serialize `value` into a buffer. + * + * `ERR_BUFFER_TOO_LARGE` will be thrown when trying to + * serialize a huge object which requires buffer + * larger than `buffer.constants.MAX_LENGTH`. + * @since v8.0.0 + */ + function serialize(value: any): Buffer; + /** + * Uses a `DefaultDeserializer` with default options to read a JS value + * from a buffer. + * @since v8.0.0 + * @param buffer A buffer returned by {@link serialize}. + */ + function deserialize(buffer: NodeJS.TypedArray): any; + /** + * The `v8.takeCoverage()` method allows the user to write the coverage started by `NODE_V8_COVERAGE` to disk on demand. This method can be invoked multiple + * times during the lifetime of the process. Each time the execution counter will + * be reset and a new coverage report will be written to the directory specified + * by `NODE_V8_COVERAGE`. + * + * When the process is about to exit, one last coverage will still be written to + * disk unless {@link stopCoverage} is invoked before the process exits. + * @since v15.1.0, v14.18.0, v12.22.0 + */ + function takeCoverage(): void; + /** + * The `v8.stopCoverage()` method allows the user to stop the coverage collection + * started by `NODE_V8_COVERAGE`, so that V8 can release the execution count + * records and optimize code. This can be used in conjunction with {@link takeCoverage} if the user wants to collect the coverage on demand. + * @since v15.1.0, v14.18.0, v12.22.0 + */ + function stopCoverage(): void; + /** + * This API collects GC data in current thread. + * @since v19.6.0, v18.15.0 + */ + class GCProfiler { + /** + * Start collecting GC data. + * @since v19.6.0, v18.15.0 + */ + start(): void; + /** + * Stop collecting GC data and return an object.The content of object + * is as follows. + * + * ```json + * { + * "version": 1, + * "startTime": 1674059033862, + * "statistics": [ + * { + * "gcType": "Scavenge", + * "beforeGC": { + * "heapStatistics": { + * "totalHeapSize": 5005312, + * "totalHeapSizeExecutable": 524288, + * "totalPhysicalSize": 5226496, + * "totalAvailableSize": 4341325216, + * "totalGlobalHandlesSize": 8192, + * "usedGlobalHandlesSize": 2112, + * "usedHeapSize": 4883840, + * "heapSizeLimit": 4345298944, + * "mallocedMemory": 254128, + * "externalMemory": 225138, + * "peakMallocedMemory": 181760 + * }, + * "heapSpaceStatistics": [ + * { + * "spaceName": "read_only_space", + * "spaceSize": 0, + * "spaceUsedSize": 0, + * "spaceAvailableSize": 0, + * "physicalSpaceSize": 0 + * } + * ] + * }, + * "cost": 1574.14, + * "afterGC": { + * "heapStatistics": { + * "totalHeapSize": 6053888, + * "totalHeapSizeExecutable": 524288, + * "totalPhysicalSize": 5500928, + * "totalAvailableSize": 4341101384, + * "totalGlobalHandlesSize": 8192, + * "usedGlobalHandlesSize": 2112, + * "usedHeapSize": 4059096, + * "heapSizeLimit": 4345298944, + * "mallocedMemory": 254128, + * "externalMemory": 225138, + * "peakMallocedMemory": 181760 + * }, + * "heapSpaceStatistics": [ + * { + * "spaceName": "read_only_space", + * "spaceSize": 0, + * "spaceUsedSize": 0, + * "spaceAvailableSize": 0, + * "physicalSpaceSize": 0 + * } + * ] + * } + * } + * ], + * "endTime": 1674059036865 + * } + * ``` + * + * Here's an example. + * + * ```js + * const { GCProfiler } = require('v8'); + * const profiler = new GCProfiler(); + * profiler.start(); + * setTimeout(() => { + * console.log(profiler.stop()); + * }, 1000); + * ``` + * @since v19.6.0, v18.15.0 + */ + stop(): GCProfilerResult; + } + interface GCProfilerResult { + version: number; + startTime: number; + endTime: number; + statistics: Array<{ + gcType: string; + cost: number; + beforeGC: { + heapStatistics: HeapStatistics; + heapSpaceStatistics: HeapSpaceStatistics[]; + }; + afterGC: { + heapStatistics: HeapStatistics; + heapSpaceStatistics: HeapSpaceStatistics[]; + }; + }>; + } + interface HeapStatistics { + totalHeapSize: number; + totalHeapSizeExecutable: number; + totalPhysicalSize: number; + totalAvailableSize: number; + totalGlobalHandlesSize: number; + usedGlobalHandlesSize: number; + usedHeapSize: number; + heapSizeLimit: number; + mallocedMemory: number; + externalMemory: number; + peakMallocedMemory: number; + } + interface HeapSpaceStatistics { + spaceName: string; + spaceSize: number; + spaceUsedSize: number; + spaceAvailableSize: number; + physicalSpaceSize: number; + } + /** + * Called when a promise is constructed. This does not mean that corresponding before/after events will occur, only that the possibility exists. This will + * happen if a promise is created without ever getting a continuation. + * @since v17.1.0, v16.14.0 + * @param promise The promise being created. + * @param parent The promise continued from, if applicable. + */ + interface Init { + (promise: Promise, parent: Promise): void; + } + /** + * Called before a promise continuation executes. This can be in the form of `then()`, `catch()`, or `finally()` handlers or an await resuming. + * + * The before callback will be called 0 to N times. The before callback will typically be called 0 times if no continuation was ever made for the promise. + * The before callback may be called many times in the case where many continuations have been made from the same promise. + * @since v17.1.0, v16.14.0 + */ + interface Before { + (promise: Promise): void; + } + /** + * Called immediately after a promise continuation executes. This may be after a `then()`, `catch()`, or `finally()` handler or before an await after another await. + * @since v17.1.0, v16.14.0 + */ + interface After { + (promise: Promise): void; + } + /** + * Called when the promise receives a resolution or rejection value. This may occur synchronously in the case of {@link Promise.resolve()} or + * {@link Promise.reject()}. + * @since v17.1.0, v16.14.0 + */ + interface Settled { + (promise: Promise): void; + } + /** + * Key events in the lifetime of a promise have been categorized into four areas: creation of a promise, before/after a continuation handler is called or + * around an await, and when the promise resolves or rejects. + * + * Because promises are asynchronous resources whose lifecycle is tracked via the promise hooks mechanism, the `init()`, `before()`, `after()`, and + * `settled()` callbacks must not be async functions as they create more promises which would produce an infinite loop. + * @since v17.1.0, v16.14.0 + */ + interface HookCallbacks { + init?: Init; + before?: Before; + after?: After; + settled?: Settled; + } + interface PromiseHooks { + /** + * The `init` hook must be a plain function. Providing an async function will throw as it would produce an infinite microtask loop. + * @since v17.1.0, v16.14.0 + * @param init The {@link Init | `init` callback} to call when a promise is created. + * @return Call to stop the hook. + */ + onInit: (init: Init) => Function; + /** + * The `settled` hook must be a plain function. Providing an async function will throw as it would produce an infinite microtask loop. + * @since v17.1.0, v16.14.0 + * @param settled The {@link Settled | `settled` callback} to call when a promise is created. + * @return Call to stop the hook. + */ + onSettled: (settled: Settled) => Function; + /** + * The `before` hook must be a plain function. Providing an async function will throw as it would produce an infinite microtask loop. + * @since v17.1.0, v16.14.0 + * @param before The {@link Before | `before` callback} to call before a promise continuation executes. + * @return Call to stop the hook. + */ + onBefore: (before: Before) => Function; + /** + * The `after` hook must be a plain function. Providing an async function will throw as it would produce an infinite microtask loop. + * @since v17.1.0, v16.14.0 + * @param after The {@link After | `after` callback} to call after a promise continuation executes. + * @return Call to stop the hook. + */ + onAfter: (after: After) => Function; + /** + * Registers functions to be called for different lifetime events of each promise. + * The callbacks `init()`/`before()`/`after()`/`settled()` are called for the respective events during a promise's lifetime. + * All callbacks are optional. For example, if only promise creation needs to be tracked, then only the init callback needs to be passed. + * The hook callbacks must be plain functions. Providing async functions will throw as it would produce an infinite microtask loop. + * @since v17.1.0, v16.14.0 + * @param callbacks The {@link HookCallbacks | Hook Callbacks} to register + * @return Used for disabling hooks + */ + createHook: (callbacks: HookCallbacks) => Function; + } + /** + * The `promiseHooks` interface can be used to track promise lifecycle events. + * @since v17.1.0, v16.14.0 + */ + const promiseHooks: PromiseHooks; +} +declare module 'v8' { + export * from 'node:v8'; +} diff --git a/node_modules/@types/node/ts4.8/vm.d.ts b/node_modules/@types/node/ts4.8/vm.d.ts new file mode 100644 index 0000000..82ab865 --- /dev/null +++ b/node_modules/@types/node/ts4.8/vm.d.ts @@ -0,0 +1,895 @@ +/** + * The `node:vm` module enables compiling and running code within V8 Virtual + * Machine contexts. + * + * **The `node:vm` module is not a security** + * **mechanism. Do not use it to run untrusted code.** + * + * JavaScript code can be compiled and run immediately or + * compiled, saved, and run later. + * + * A common use case is to run the code in a different V8 Context. This means + * invoked code has a different global object than the invoking code. + * + * One can provide the context by `contextifying` an + * object. The invoked code treats any property in the context like a + * global variable. Any changes to global variables caused by the invoked + * code are reflected in the context object. + * + * ```js + * const vm = require('node:vm'); + * + * const x = 1; + * + * const context = { x: 2 }; + * vm.createContext(context); // Contextify the object. + * + * const code = 'x += 40; var y = 17;'; + * // `x` and `y` are global variables in the context. + * // Initially, x has the value 2 because that is the value of context.x. + * vm.runInContext(code, context); + * + * console.log(context.x); // 42 + * console.log(context.y); // 17 + * + * console.log(x); // 1; y is not defined. + * ``` + * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/vm.js) + */ +declare module 'node:vm' { + import { ImportAssertions } from 'node:module'; + interface Context extends NodeJS.Dict {} + interface BaseOptions { + /** + * Specifies the filename used in stack traces produced by this script. + * Default: `''`. + */ + filename?: string | undefined; + /** + * Specifies the line number offset that is displayed in stack traces produced by this script. + * Default: `0`. + */ + lineOffset?: number | undefined; + /** + * Specifies the column number offset that is displayed in stack traces produced by this script. + * @default 0 + */ + columnOffset?: number | undefined; + } + interface ScriptOptions extends BaseOptions { + /** + * V8's code cache data for the supplied source. + */ + cachedData?: Buffer | NodeJS.ArrayBufferView | undefined; + /** @deprecated in favor of `script.createCachedData()` */ + produceCachedData?: boolean | undefined; + /** + * Called during evaluation of this module when `import()` is called. + * If this option is not specified, calls to `import()` will reject with `ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING`. + */ + importModuleDynamically?: ((specifier: string, script: Script, importAssertions: ImportAssertions) => Module) | undefined; + } + interface RunningScriptOptions extends BaseOptions { + /** + * When `true`, if an `Error` occurs while compiling the `code`, the line of code causing the error is attached to the stack trace. + * Default: `true`. + */ + displayErrors?: boolean | undefined; + /** + * Specifies the number of milliseconds to execute code before terminating execution. + * If execution is terminated, an `Error` will be thrown. This value must be a strictly positive integer. + */ + timeout?: number | undefined; + /** + * If `true`, the execution will be terminated when `SIGINT` (Ctrl+C) is received. + * Existing handlers for the event that have been attached via `process.on('SIGINT')` will be disabled during script execution, but will continue to work after that. + * If execution is terminated, an `Error` will be thrown. + * Default: `false`. + */ + breakOnSigint?: boolean | undefined; + } + interface RunningScriptInNewContextOptions extends RunningScriptOptions { + /** + * Human-readable name of the newly created context. + */ + contextName?: CreateContextOptions['name']; + /** + * Origin corresponding to the newly created context for display purposes. The origin should be formatted like a URL, + * but with only the scheme, host, and port (if necessary), like the value of the `url.origin` property of a `URL` object. + * Most notably, this string should omit the trailing slash, as that denotes a path. + */ + contextOrigin?: CreateContextOptions['origin']; + contextCodeGeneration?: CreateContextOptions['codeGeneration']; + /** + * If set to `afterEvaluate`, microtasks will be run immediately after the script has run. + */ + microtaskMode?: CreateContextOptions['microtaskMode']; + } + interface RunningCodeOptions extends RunningScriptOptions { + cachedData?: ScriptOptions['cachedData']; + importModuleDynamically?: ScriptOptions['importModuleDynamically']; + } + interface RunningCodeInNewContextOptions extends RunningScriptInNewContextOptions { + cachedData?: ScriptOptions['cachedData']; + importModuleDynamically?: ScriptOptions['importModuleDynamically']; + } + interface CompileFunctionOptions extends BaseOptions { + /** + * Provides an optional data with V8's code cache data for the supplied source. + */ + cachedData?: Buffer | undefined; + /** + * Specifies whether to produce new cache data. + * Default: `false`, + */ + produceCachedData?: boolean | undefined; + /** + * The sandbox/context in which the said function should be compiled in. + */ + parsingContext?: Context | undefined; + /** + * An array containing a collection of context extensions (objects wrapping the current scope) to be applied while compiling + */ + contextExtensions?: Object[] | undefined; + } + interface CreateContextOptions { + /** + * Human-readable name of the newly created context. + * @default 'VM Context i' Where i is an ascending numerical index of the created context. + */ + name?: string | undefined; + /** + * Corresponds to the newly created context for display purposes. + * The origin should be formatted like a `URL`, but with only the scheme, host, and port (if necessary), + * like the value of the `url.origin` property of a URL object. + * Most notably, this string should omit the trailing slash, as that denotes a path. + * @default '' + */ + origin?: string | undefined; + codeGeneration?: + | { + /** + * If set to false any calls to eval or function constructors (Function, GeneratorFunction, etc) + * will throw an EvalError. + * @default true + */ + strings?: boolean | undefined; + /** + * If set to false any attempt to compile a WebAssembly module will throw a WebAssembly.CompileError. + * @default true + */ + wasm?: boolean | undefined; + } + | undefined; + /** + * If set to `afterEvaluate`, microtasks will be run immediately after the script has run. + */ + microtaskMode?: 'afterEvaluate' | undefined; + } + type MeasureMemoryMode = 'summary' | 'detailed'; + interface MeasureMemoryOptions { + /** + * @default 'summary' + */ + mode?: MeasureMemoryMode | undefined; + /** + * @default 'default' + */ + execution?: 'default' | 'eager' | undefined; + } + interface MemoryMeasurement { + total: { + jsMemoryEstimate: number; + jsMemoryRange: [number, number]; + }; + } + /** + * Instances of the `vm.Script` class contain precompiled scripts that can be + * executed in specific contexts. + * @since v0.3.1 + */ + class Script { + constructor(code: string, options?: ScriptOptions | string); + /** + * Runs the compiled code contained by the `vm.Script` object within the given`contextifiedObject` and returns the result. Running code does not have access + * to local scope. + * + * The following example compiles code that increments a global variable, sets + * the value of another global variable, then execute the code multiple times. + * The globals are contained in the `context` object. + * + * ```js + * const vm = require('node:vm'); + * + * const context = { + * animal: 'cat', + * count: 2, + * }; + * + * const script = new vm.Script('count += 1; name = "kitty";'); + * + * vm.createContext(context); + * for (let i = 0; i < 10; ++i) { + * script.runInContext(context); + * } + * + * console.log(context); + * // Prints: { animal: 'cat', count: 12, name: 'kitty' } + * ``` + * + * Using the `timeout` or `breakOnSigint` options will result in new event loops + * and corresponding threads being started, which have a non-zero performance + * overhead. + * @since v0.3.1 + * @param contextifiedObject A `contextified` object as returned by the `vm.createContext()` method. + * @return the result of the very last statement executed in the script. + */ + runInContext(contextifiedObject: Context, options?: RunningScriptOptions): any; + /** + * First contextifies the given `contextObject`, runs the compiled code contained + * by the `vm.Script` object within the created context, and returns the result. + * Running code does not have access to local scope. + * + * The following example compiles code that sets a global variable, then executes + * the code multiple times in different contexts. The globals are set on and + * contained within each individual `context`. + * + * ```js + * const vm = require('node:vm'); + * + * const script = new vm.Script('globalVar = "set"'); + * + * const contexts = [{}, {}, {}]; + * contexts.forEach((context) => { + * script.runInNewContext(context); + * }); + * + * console.log(contexts); + * // Prints: [{ globalVar: 'set' }, { globalVar: 'set' }, { globalVar: 'set' }] + * ``` + * @since v0.3.1 + * @param contextObject An object that will be `contextified`. If `undefined`, a new object will be created. + * @return the result of the very last statement executed in the script. + */ + runInNewContext(contextObject?: Context, options?: RunningScriptInNewContextOptions): any; + /** + * Runs the compiled code contained by the `vm.Script` within the context of the + * current `global` object. Running code does not have access to local scope, but _does_ have access to the current `global` object. + * + * The following example compiles code that increments a `global` variable then + * executes that code multiple times: + * + * ```js + * const vm = require('node:vm'); + * + * global.globalVar = 0; + * + * const script = new vm.Script('globalVar += 1', { filename: 'myfile.vm' }); + * + * for (let i = 0; i < 1000; ++i) { + * script.runInThisContext(); + * } + * + * console.log(globalVar); + * + * // 1000 + * ``` + * @since v0.3.1 + * @return the result of the very last statement executed in the script. + */ + runInThisContext(options?: RunningScriptOptions): any; + /** + * Creates a code cache that can be used with the `Script` constructor's`cachedData` option. Returns a `Buffer`. This method may be called at any + * time and any number of times. + * + * The code cache of the `Script` doesn't contain any JavaScript observable + * states. The code cache is safe to be saved along side the script source and + * used to construct new `Script` instances multiple times. + * + * Functions in the `Script` source can be marked as lazily compiled and they are + * not compiled at construction of the `Script`. These functions are going to be + * compiled when they are invoked the first time. The code cache serializes the + * metadata that V8 currently knows about the `Script` that it can use to speed up + * future compilations. + * + * ```js + * const script = new vm.Script(` + * function add(a, b) { + * return a + b; + * } + * + * const x = add(1, 2); + * `); + * + * const cacheWithoutAdd = script.createCachedData(); + * // In `cacheWithoutAdd` the function `add()` is marked for full compilation + * // upon invocation. + * + * script.runInThisContext(); + * + * const cacheWithAdd = script.createCachedData(); + * // `cacheWithAdd` contains fully compiled function `add()`. + * ``` + * @since v10.6.0 + */ + createCachedData(): Buffer; + /** @deprecated in favor of `script.createCachedData()` */ + cachedDataProduced?: boolean | undefined; + /** + * When `cachedData` is supplied to create the `vm.Script`, this value will be set + * to either `true` or `false` depending on acceptance of the data by V8\. + * Otherwise the value is `undefined`. + * @since v5.7.0 + */ + cachedDataRejected?: boolean | undefined; + cachedData?: Buffer | undefined; + /** + * When the script is compiled from a source that contains a source map magic + * comment, this property will be set to the URL of the source map. + * + * ```js + * import vm from 'node:vm'; + * + * const script = new vm.Script(` + * function myFunc() {} + * //# sourceMappingURL=sourcemap.json + * `); + * + * console.log(script.sourceMapURL); + * // Prints: sourcemap.json + * ``` + * @since v19.1.0, v18.13.0 + */ + sourceMapURL?: string | undefined; + } + /** + * If given a `contextObject`, the `vm.createContext()` method will `prepare + * that object` so that it can be used in calls to {@link runInContext} or `script.runInContext()`. Inside such scripts, + * the `contextObject` will be the global object, retaining all of its existing + * properties but also having the built-in objects and functions any standard [global object](https://es5.github.io/#x15.1) has. Outside of scripts run by the vm module, global variables + * will remain unchanged. + * + * ```js + * const vm = require('node:vm'); + * + * global.globalVar = 3; + * + * const context = { globalVar: 1 }; + * vm.createContext(context); + * + * vm.runInContext('globalVar *= 2;', context); + * + * console.log(context); + * // Prints: { globalVar: 2 } + * + * console.log(global.globalVar); + * // Prints: 3 + * ``` + * + * If `contextObject` is omitted (or passed explicitly as `undefined`), a new, + * empty `contextified` object will be returned. + * + * The `vm.createContext()` method is primarily useful for creating a single + * context that can be used to run multiple scripts. For instance, if emulating a + * web browser, the method can be used to create a single context representing a + * window's global object, then run all ` + +``` + +Or use an AMD-style loader (such as [RequireJS](https://requirejs.org/)): + +```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 +}); +``` + +### Flow & TypeScript + +Use these Immutable collections and sequences as you would use native +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. + +Installing `immutable` via npm brings with it type definitions for Flow (v0.55.0 or higher) +and TypeScript (v2.1.0 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. + +```js +/// +import Immutable from 'immutable'; +var map1: Immutable.Map; +map1 = Immutable.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 + +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 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, +subscribing to changes throughout the model is a dead-end and new data can only +ever be passed from above. + +This model of data flow aligns well with the architecture of [React][] +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 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 +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). + + + +```js +const { Map } = require('immutable'); +const map = Map({ a: 1, b: 2, c: 3 }); +const mapCopy = map; // Look, "copies" are free! +``` + +[React]: https://reactjs.org/ +[Flux]: https://facebook.github.io/flux/docs/in-depth-overview/ + + +## JavaScript-first API + +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 [ES2015][] [Array][], [Map][], and [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`, +instead return new immutable collections. + + + +```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 +`Immutable.List`, those of [Map][] found on `Immutable.Map`, and those of [Set][] +found on `Immutable.Set`, including collection operations like `forEach()` +and `map()`. + + + +```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' +``` + +### Convert from raw JavaScript objects and arrays. + +Designed to inter-operate with your existing JavaScript, Immutable.js +accepts plain JavaScript Arrays and Objects anywhere a method expects a +`Collection`. + + + +```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.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. + + + +```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.js Collections can be converted to plain JavaScript Arrays and +Objects shallowly with `toArray()` and `toObject()` or deeply with `toJS()`. +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 ES2015 + +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 in the Documentation are presented in ES2015. To run in all +browsers, they need to be translated to ES5. + +```js +// 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]: https://wiki.ecmascript.org/doku.php?id=strawman:maximally_minimal_classes +[Modules]: https://www.2ality.com/2014/09/es6-modules-final.html + + +## Nested Structures + +The collections in Immutable.js are intended to be nested, allowing for deep +trees of data, similar to JSON. + + + +```js +const { fromJS } = require('immutable'); +const nested = fromJS({ a: { b: { c: [3, 4, 5] } } }); +// Map { a: Map { b: Map { c: List [ 3, 4, 5 ] } } } +``` + +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`. + + + +```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 } } } + +console.log(nested2.getIn(['a', 'b', 'd'])); // 6 + +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 } } } + +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 + +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. + +Consider the example below where two identical `Map` instances are not +_reference equal_ but are _value equal_. + + + +```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 +``` + +Value equality allows Immutable.js collections to be used as keys in Maps or +values in Sets, and retrieved with different but equivalent collections: + + + +```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 +``` + +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. + +[object.is]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is + +#### Performance tradeoffs + +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. + +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 + +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. + + + +```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. +``` + +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: + + + +```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 + +> If a tree falls in the woods, does it make a sound? +> +> If a pure function mutates some local data in order to produce an immutable +> return value, is that ok? +> +> — Rich Hickey, Clojure + +Applying a mutation to create a new immutable object results in some overhead, +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.js applies complex mutations itself. + +As an example, building `list2` results in the creation of 1, not 3, new +immutable Lists. + + + +```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.equal(list1.size, 3); +assert.equal(list2.size, 6); +``` + +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. + +## Lazy Seq + +`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, 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: + +```js +lazySeq + .flip() + .map(key => key.toUpperCase()) + .flip(); +// Seq { A: 1, B: 2, C: 3 } +``` + +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 +``` + +## 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. + +- [React-Immutable-PropTypes](https://github.com/HurricaneJames/react-immutable-proptypes) + - PropType validators that work with Immutable.js. + +- [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/node_modules/immutable/dist/immutable.d.ts b/node_modules/immutable/dist/immutable.d.ts new file mode 100644 index 0000000..dc2b245 --- /dev/null +++ b/node_modules/immutable/dist/immutable.d.ts @@ -0,0 +1,5912 @@ +/** + * 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 Collection.Keyed + ? // convert KeyedCollection to DeepCopy plain JS object + { + [key in KeyedKey extends string | number | symbol + ? KeyedKey + : string]: V extends object ? unknown : V; + } + : // convert IndexedCollection or Immutable.Set to DeepCopy plain JS array + 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 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; + + /** + * 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; + } + + /** + * 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 Map from alternating keys and values + * + * + * ```js + * const { Map } = require('immutable') + * Map.of( + * 'key', 'value', + * 'numerical value', 3, + * 0, 'numerical key' + * ) + * // Map { 0: "numerical key", "key": "value", "numerical value": 3 } + * ``` + * + * @deprecated Use Map([ [ 'k', 'v' ] ]) or Map({ k: 'v' }) + */ + function of(...keyValues: Array): 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: { [key: string]: V }): Map; + function Map(obj: { [P in K]?: V }): Map; + + 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; + merge( + ...collections: Array<{ [key: string]: C }> + ): Map; + concat( + ...collections: Array> + ): Map; + concat( + ...collections: Array<{ [key: string]: C }> + ): Map; + + /** + * 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: V, key: K) => V, + ...collections: Array | { [key: string]: V }> + ): this; + + /** + * 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 | { [key: string]: V }> + ): this; + + /** + * 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; + } + + /** + * 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 { + /** + * 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; + merge( + ...collections: Array<{ [key: string]: C }> + ): OrderedMap; + concat( + ...collections: Array> + ): OrderedMap; + concat( + ...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; + // tslint:disable-next-line unified-signatures + 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]; + } + + /** + * 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; + // tslint:disable-next-line unified-signatures + 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 { + /** + * 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: Record): 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]>): Record & + Readonly; + new ( + values?: Partial | Iterable<[string, unknown]> + ): Record & Readonly; + + /** + * The name provided to `Record(values, name)` can be accessed with + * `displayName`. + */ + displayName: string; + } + + function Factory( + values?: Partial | Iterable<[string, unknown]> + ): Record & Readonly; + } + + /** + * 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 string | number | symbol]: DeepCopy }; + + /** + * Shallowly converts this Keyed Seq to equivalent native JavaScript Object. + * + * Converts keys to Strings. + */ + toJSON(): { [key in string | number | symbol]: 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]; + } + + /** + * 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 { + /** + * @deprecated use `const { isKeyed } = require('immutable')` + */ + function isKeyed( + maybeKeyed: unknown + ): maybeKeyed is Collection.Keyed; + + /** + * @deprecated use `const { isIndexed } = require('immutable')` + */ + function isIndexed( + maybeIndexed: unknown + ): maybeIndexed is Collection.Indexed; + + /** + * @deprecated use `const { isAssociative } = require('immutable')` + */ + function isAssociative( + maybeAssociative: unknown + ): maybeAssociative is + | Collection.Keyed + | Collection.Indexed; + + /** + * @deprecated use `const { isOrdered } = require('immutable')` + */ + function isOrdered(maybeOrdered: unknown): boolean; + + /** + * 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 string | number | symbol]: DeepCopy }; + + /** + * Shallowly converts this Keyed collection to equivalent native JavaScript Object. + * + * Converts keys to Strings. + */ + toJSON(): { [key in string | number | symbol]: 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 { + /** + * 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; + + /** + * 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; + + // 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 string | number | symbol]: 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 string | number | symbol]: 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; + // tslint:disable-next-line unified-signatures + 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; + } + + /** + * 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 {} + ? FromJSObject + : any; + + type FromJSNoTransform = + | Collection + | number + | string + | null + | undefined; + + type FromJSArray = JSValue extends Array + ? List> + : never; + + type FromJSObject = JSValue extends {} + ? 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: unknown): boolean; + + /** + * 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: string]: V }, key: string): V | undefined; + function get( + collection: { [key: string]: 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 }; + + /** + * 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( + collection: unknown, + keyPath: Iterable, + notSetValue?: unknown + ): 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: unknown, keyPath: Iterable): 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: Iterable, + updater: (value: unknown) => unknown + ): C; + function updateIn( + collection: C, + keyPath: Iterable, + notSetValue: unknown, + updater: (value: unknown) => unknown + ): C; + + /** + * 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/node_modules/immutable/dist/immutable.es.js b/node_modules/immutable/dist/immutable.es.js new file mode 100644 index 0000000..cc36709 --- /dev/null +++ b/node_modules/immutable/dist/immutable.es.js @@ -0,0 +1,5965 @@ +/** + * MIT License + * + * Copyright (c) 2014-present, Lee Byron and other contributors. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +var 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 &`. +function MakeRef() { + return { value: false }; +} + +function SetRef(ref) { + 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. +function OwnerID() {} + +function ensureSize(iter) { + if (iter.size === undefined) { + iter.size = iter.__iterate(returnTrue); + } + return iter.size; +} + +function wrapIndex(iter, index) { + // 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') { + var 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; +} + +function returnTrue() { + return true; +} + +function wholeSlice(begin, end, size) { + return ( + ((begin === 0 && !isNeg(begin)) || + (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) { + // 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) { + // Account for -0 which is negative, but not less than 0. + return value < 0 || (value === 0 && 1 / value === -Infinity); +} + +var IS_COLLECTION_SYMBOL = '@@__IMMUTABLE_ITERABLE__@@'; + +function isCollection(maybeCollection) { + return Boolean(maybeCollection && maybeCollection[IS_COLLECTION_SYMBOL]); +} + +var IS_KEYED_SYMBOL = '@@__IMMUTABLE_KEYED__@@'; + +function isKeyed(maybeKeyed) { + return Boolean(maybeKeyed && maybeKeyed[IS_KEYED_SYMBOL]); +} + +var IS_INDEXED_SYMBOL = '@@__IMMUTABLE_INDEXED__@@'; + +function isIndexed(maybeIndexed) { + return Boolean(maybeIndexed && maybeIndexed[IS_INDEXED_SYMBOL]); +} + +function isAssociative(maybeAssociative) { + return isKeyed(maybeAssociative) || isIndexed(maybeAssociative); +} + +var Collection = function Collection(value) { + return isCollection(value) ? value : Seq(value); +}; + +var KeyedCollection = /*@__PURE__*/(function (Collection) { + function KeyedCollection(value) { + return isKeyed(value) ? value : KeyedSeq(value); + } + + if ( Collection ) KeyedCollection.__proto__ = Collection; + KeyedCollection.prototype = Object.create( Collection && Collection.prototype ); + KeyedCollection.prototype.constructor = KeyedCollection; + + return KeyedCollection; +}(Collection)); + +var IndexedCollection = /*@__PURE__*/(function (Collection) { + function IndexedCollection(value) { + return isIndexed(value) ? value : IndexedSeq(value); + } + + if ( Collection ) IndexedCollection.__proto__ = Collection; + IndexedCollection.prototype = Object.create( Collection && Collection.prototype ); + IndexedCollection.prototype.constructor = IndexedCollection; + + return IndexedCollection; +}(Collection)); + +var SetCollection = /*@__PURE__*/(function (Collection) { + function SetCollection(value) { + return isCollection(value) && !isAssociative(value) ? value : SetSeq(value); + } + + if ( Collection ) SetCollection.__proto__ = Collection; + SetCollection.prototype = Object.create( Collection && Collection.prototype ); + SetCollection.prototype.constructor = SetCollection; + + return SetCollection; +}(Collection)); + +Collection.Keyed = KeyedCollection; +Collection.Indexed = IndexedCollection; +Collection.Set = SetCollection; + +var IS_SEQ_SYMBOL = '@@__IMMUTABLE_SEQ__@@'; + +function isSeq(maybeSeq) { + return Boolean(maybeSeq && maybeSeq[IS_SEQ_SYMBOL]); +} + +var IS_RECORD_SYMBOL = '@@__IMMUTABLE_RECORD__@@'; + +function isRecord(maybeRecord) { + return Boolean(maybeRecord && maybeRecord[IS_RECORD_SYMBOL]); +} + +function isImmutable(maybeImmutable) { + return isCollection(maybeImmutable) || isRecord(maybeImmutable); +} + +var IS_ORDERED_SYMBOL = '@@__IMMUTABLE_ORDERED__@@'; + +function isOrdered(maybeOrdered) { + return Boolean(maybeOrdered && maybeOrdered[IS_ORDERED_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; + +var Iterator = function Iterator(next) { + this.next = next; +}; + +Iterator.prototype.toString = function toString () { + return '[Iterator]'; +}; + +Iterator.KEYS = ITERATE_KEYS; +Iterator.VALUES = ITERATE_VALUES; +Iterator.ENTRIES = ITERATE_ENTRIES; + +Iterator.prototype.inspect = Iterator.prototype.toSource = function () { + return this.toString(); +}; +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) { + if (Array.isArray(maybeIterable)) { + // IE11 trick as it does not support `Symbol.iterator` + return true; + } + + 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 isEntriesIterable(maybeIterable) { + var iteratorFn = getIteratorFn(maybeIterable); + return iteratorFn && iteratorFn === maybeIterable.entries; +} + +function isKeysIterable(maybeIterable) { + var iteratorFn = getIteratorFn(maybeIterable); + return iteratorFn && iteratorFn === maybeIterable.keys; +} + +var hasOwnProperty = Object.prototype.hasOwnProperty; + +function isArrayLike(value) { + if (Array.isArray(value) || typeof value === 'string') { + return true; + } + + return ( + value && + typeof value === 'object' && + Number.isInteger(value.length) && + value.length >= 0 && + (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). + value.hasOwnProperty(value.length - 1)) + ); +} + +var Seq = /*@__PURE__*/(function (Collection) { + function Seq(value) { + return value === undefined || value === null + ? emptySequence() + : isImmutable(value) + ? value.toSeq() + : seqFromValue(value); + } + + if ( Collection ) Seq.__proto__ = Collection; + Seq.prototype = Object.create( Collection && Collection.prototype ); + Seq.prototype.constructor = Seq; + + Seq.prototype.toSeq = function toSeq () { + return this; + }; + + Seq.prototype.toString = function toString () { + return this.__toString('Seq {', '}'); + }; + + Seq.prototype.cacheResult = function cacheResult () { + 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 __iterate (fn, reverse) { + var cache = this._cache; + if (cache) { + var size = cache.length; + var i = 0; + while (i !== size) { + var 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) + + Seq.prototype.__iterator = function __iterator (type, reverse) { + var cache = this._cache; + if (cache) { + var size = cache.length; + var i = 0; + return new Iterator(function () { + if (i === size) { + return iteratorDone(); + } + var entry = cache[reverse ? size - ++i : i++]; + return iteratorValue(type, entry[0], entry[1]); + }); + } + return this.__iteratorUncached(type, reverse); + }; + + return Seq; +}(Collection)); + +var KeyedSeq = /*@__PURE__*/(function (Seq) { + function KeyedSeq(value) { + return value === undefined || value === null + ? emptySequence().toKeyedSeq() + : isCollection(value) + ? isKeyed(value) + ? value.toSeq() + : value.fromEntrySeq() + : isRecord(value) + ? value.toSeq() + : keyedSeqFromValue(value); + } + + if ( Seq ) KeyedSeq.__proto__ = Seq; + KeyedSeq.prototype = Object.create( Seq && Seq.prototype ); + KeyedSeq.prototype.constructor = KeyedSeq; + + KeyedSeq.prototype.toKeyedSeq = function toKeyedSeq () { + return this; + }; + + return KeyedSeq; +}(Seq)); + +var IndexedSeq = /*@__PURE__*/(function (Seq) { + function IndexedSeq(value) { + return value === undefined || value === null + ? emptySequence() + : isCollection(value) + ? isKeyed(value) + ? value.entrySeq() + : value.toIndexedSeq() + : isRecord(value) + ? value.toSeq().entrySeq() + : indexedSeqFromValue(value); + } + + if ( Seq ) IndexedSeq.__proto__ = Seq; + IndexedSeq.prototype = Object.create( Seq && Seq.prototype ); + IndexedSeq.prototype.constructor = IndexedSeq; + + IndexedSeq.of = function of (/*...values*/) { + return IndexedSeq(arguments); + }; + + IndexedSeq.prototype.toIndexedSeq = function toIndexedSeq () { + return this; + }; + + IndexedSeq.prototype.toString = function toString () { + return this.__toString('Seq [', ']'); + }; + + return IndexedSeq; +}(Seq)); + +var SetSeq = /*@__PURE__*/(function (Seq) { + function SetSeq(value) { + return ( + isCollection(value) && !isAssociative(value) ? value : IndexedSeq(value) + ).toSetSeq(); + } + + if ( Seq ) SetSeq.__proto__ = Seq; + SetSeq.prototype = Object.create( Seq && Seq.prototype ); + SetSeq.prototype.constructor = SetSeq; + + SetSeq.of = function of (/*...values*/) { + return SetSeq(arguments); + }; + + SetSeq.prototype.toSetSeq = function toSetSeq () { + return this; + }; + + return SetSeq; +}(Seq)); + +Seq.isSeq = isSeq; +Seq.Keyed = KeyedSeq; +Seq.Set = SetSeq; +Seq.Indexed = IndexedSeq; + +Seq.prototype[IS_SEQ_SYMBOL] = true; + +// #pragma Root Sequences + +var ArraySeq = /*@__PURE__*/(function (IndexedSeq) { + function ArraySeq(array) { + this._array = array; + this.size = array.length; + } + + if ( IndexedSeq ) ArraySeq.__proto__ = IndexedSeq; + ArraySeq.prototype = Object.create( IndexedSeq && IndexedSeq.prototype ); + ArraySeq.prototype.constructor = ArraySeq; + + ArraySeq.prototype.get = function get (index, notSetValue) { + return this.has(index) ? this._array[wrapIndex(this, index)] : notSetValue; + }; + + ArraySeq.prototype.__iterate = function __iterate (fn, reverse) { + var array = this._array; + var size = array.length; + var i = 0; + while (i !== size) { + var ii = reverse ? size - ++i : i++; + if (fn(array[ii], ii, this) === false) { + break; + } + } + return i; + }; + + ArraySeq.prototype.__iterator = function __iterator (type, reverse) { + var array = this._array; + var size = array.length; + var i = 0; + return new Iterator(function () { + if (i === size) { + return iteratorDone(); + } + var ii = reverse ? size - ++i : i++; + return iteratorValue(type, ii, array[ii]); + }); + }; + + return ArraySeq; +}(IndexedSeq)); + +var ObjectSeq = /*@__PURE__*/(function (KeyedSeq) { + function ObjectSeq(object) { + var keys = Object.keys(object).concat( + Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(object) : [] + ); + this._object = object; + this._keys = keys; + this.size = keys.length; + } + + if ( KeyedSeq ) ObjectSeq.__proto__ = KeyedSeq; + ObjectSeq.prototype = Object.create( KeyedSeq && KeyedSeq.prototype ); + ObjectSeq.prototype.constructor = ObjectSeq; + + ObjectSeq.prototype.get = function get (key, notSetValue) { + if (notSetValue !== undefined && !this.has(key)) { + return notSetValue; + } + return this._object[key]; + }; + + ObjectSeq.prototype.has = function has (key) { + return hasOwnProperty.call(this._object, key); + }; + + ObjectSeq.prototype.__iterate = function __iterate (fn, reverse) { + var object = this._object; + var keys = this._keys; + var size = keys.length; + var i = 0; + while (i !== size) { + var key = keys[reverse ? size - ++i : i++]; + if (fn(object[key], key, this) === false) { + break; + } + } + return i; + }; + + ObjectSeq.prototype.__iterator = function __iterator (type, reverse) { + var object = this._object; + var keys = this._keys; + var size = keys.length; + var i = 0; + return new Iterator(function () { + if (i === size) { + return iteratorDone(); + } + var key = keys[reverse ? size - ++i : i++]; + return iteratorValue(type, key, object[key]); + }); + }; + + return ObjectSeq; +}(KeyedSeq)); +ObjectSeq.prototype[IS_ORDERED_SYMBOL] = true; + +var CollectionSeq = /*@__PURE__*/(function (IndexedSeq) { + function CollectionSeq(collection) { + this._collection = collection; + this.size = collection.length || collection.size; + } + + if ( IndexedSeq ) CollectionSeq.__proto__ = IndexedSeq; + CollectionSeq.prototype = Object.create( IndexedSeq && IndexedSeq.prototype ); + CollectionSeq.prototype.constructor = CollectionSeq; + + CollectionSeq.prototype.__iterateUncached = function __iterateUncached (fn, reverse) { + if (reverse) { + return this.cacheResult().__iterate(fn, reverse); + } + var collection = this._collection; + var iterator = getIterator(collection); + var iterations = 0; + if (isIterator(iterator)) { + var step; + while (!(step = iterator.next()).done) { + if (fn(step.value, iterations++, this) === false) { + break; + } + } + } + return iterations; + }; + + CollectionSeq.prototype.__iteratorUncached = function __iteratorUncached (type, reverse) { + if (reverse) { + return this.cacheResult().__iterator(type, reverse); + } + var collection = this._collection; + var iterator = getIterator(collection); + if (!isIterator(iterator)) { + return new Iterator(iteratorDone); + } + var iterations = 0; + return new Iterator(function () { + var step = iterator.next(); + return step.done ? step : iteratorValue(type, iterations++, step.value); + }); + }; + + return CollectionSeq; +}(IndexedSeq)); + +// # pragma Helper functions + +var EMPTY_SEQ; + +function emptySequence() { + return EMPTY_SEQ || (EMPTY_SEQ = new ArraySeq([])); +} + +function keyedSeqFromValue(value) { + var seq = maybeIndexedSeqFromValue(value); + if (seq) { + return seq.fromEntrySeq(); + } + if (typeof value === 'object') { + return new ObjectSeq(value); + } + throw new TypeError( + 'Expected Array or collection object of [k, v] entries, or keyed object: ' + + value + ); +} + +function indexedSeqFromValue(value) { + var seq = maybeIndexedSeqFromValue(value); + if (seq) { + return seq; + } + throw new TypeError( + 'Expected Array or collection object of values: ' + value + ); +} + +function seqFromValue(value) { + var 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 maybeIndexedSeqFromValue(value) { + return isArrayLike(value) + ? new ArraySeq(value) + : hasIterator(value) + ? new CollectionSeq(value) + : undefined; +} + +var IS_MAP_SYMBOL = '@@__IMMUTABLE_MAP__@@'; + +function isMap(maybeMap) { + return Boolean(maybeMap && maybeMap[IS_MAP_SYMBOL]); +} + +function isOrderedMap(maybeOrderedMap) { + return isMap(maybeOrderedMap) && isOrdered(maybeOrderedMap); +} + +function isValueObject(maybeValue) { + return Boolean( + maybeValue && + typeof maybeValue.equals === 'function' && + typeof maybeValue.hashCode === 'function' + ); +} + +/** + * 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 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 are Value Objects: they 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; + } + } + return !!( + isValueObject(valueA) && + isValueObject(valueB) && + valueA.equals(valueB) + ); +} + +var imul = + typeof Math.imul === 'function' && Math.imul(0xffffffff, 2) === -2 + ? Math.imul + : function imul(a, b) { + a |= 0; // int + 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); +} + +var defaultValueOf = Object.prototype.valueOf; + +function hash(o) { + if (o == null) { + return hashNullish(o); + } + + if (typeof o.hashCode === 'function') { + // Drop any high bits from accidentally long hash codes. + return smi(o.hashCode(o)); + } + + var v = valueOf(o); + + if (v == null) { + return hashNullish(v); + } + + 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; + } + var hash = n | 0; + if (hash !== n) { + hash ^= n * 0xffffffff; + } + while (n > 0xffffffff) { + n /= 0xffffffff; + hash ^= n; + } + return smi(hash); +} + +function cachedHashString(string) { + var 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] = hashed; + } + return hashed; +} + +// 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 hashed = 0; + for (var ii = 0; ii < string.length; ii++) { + hashed = (31 * hashed + string.charCodeAt(ii)) | 0; + } + return smi(hashed); +} + +function hashSymbol(sym) { + var hashed = symbolMap[sym]; + if (hashed !== undefined) { + return hashed; + } + + hashed = nextHash(); + + symbolMap[sym] = hashed; + + return hashed; +} + +function hashJSObj(obj) { + var hashed; + if (usingWeakMap) { + hashed = weakMap.get(obj); + if (hashed !== undefined) { + return hashed; + } + } + + hashed = obj[UID_HASH_KEY]; + if (hashed !== undefined) { + return hashed; + } + + if (!canDefineProperty) { + hashed = obj.propertyIsEnumerable && obj.propertyIsEnumerable[UID_HASH_KEY]; + if (hashed !== undefined) { + return hashed; + } + + hashed = getIENodeHash(obj); + if (hashed !== undefined) { + return hashed; + } + } + + hashed = nextHash(); + + if (usingWeakMap) { + 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: hashed, + }); + } 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] = 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] = hashed; + } else { + throw new Error('Unable to set a non-enumerable property on object.'); + } + + return hashed; +} + +// 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; + } + } +} + +function valueOf(obj) { + return obj.valueOf !== defaultValueOf && typeof obj.valueOf === 'function' + ? obj.valueOf(obj) + : obj; +} + +function nextHash() { + var nextHash = ++_objHashUID; + if (_objHashUID & 0x40000000) { + _objHashUID = 0; + } + return nextHash; +} + +// If possible, use a WeakMap. +var usingWeakMap = typeof WeakMap === 'function'; +var weakMap; +if (usingWeakMap) { + weakMap = new WeakMap(); +} + +var symbolMap = Object.create(null); + +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 = {}; + +var ToKeyedSequence = /*@__PURE__*/(function (KeyedSeq) { + function ToKeyedSequence(indexed, useKeys) { + this._iter = indexed; + this._useKeys = useKeys; + this.size = indexed.size; + } + + if ( KeyedSeq ) ToKeyedSequence.__proto__ = KeyedSeq; + ToKeyedSequence.prototype = Object.create( KeyedSeq && KeyedSeq.prototype ); + ToKeyedSequence.prototype.constructor = ToKeyedSequence; + + ToKeyedSequence.prototype.get = function get (key, notSetValue) { + return this._iter.get(key, notSetValue); + }; + + ToKeyedSequence.prototype.has = function has (key) { + return this._iter.has(key); + }; + + ToKeyedSequence.prototype.valueSeq = function valueSeq () { + return this._iter.valueSeq(); + }; + + ToKeyedSequence.prototype.reverse = function reverse () { + var this$1$1 = this; + + var reversedSequence = reverseFactory(this, true); + if (!this._useKeys) { + reversedSequence.valueSeq = function () { return this$1$1._iter.toSeq().reverse(); }; + } + return reversedSequence; + }; + + ToKeyedSequence.prototype.map = function map (mapper, context) { + var this$1$1 = this; + + var mappedSequence = mapFactory(this, mapper, context); + if (!this._useKeys) { + mappedSequence.valueSeq = function () { return this$1$1._iter.toSeq().map(mapper, context); }; + } + return mappedSequence; + }; + + ToKeyedSequence.prototype.__iterate = function __iterate (fn, reverse) { + var this$1$1 = this; + + return this._iter.__iterate(function (v, k) { return fn(v, k, this$1$1); }, reverse); + }; + + ToKeyedSequence.prototype.__iterator = function __iterator (type, reverse) { + return this._iter.__iterator(type, reverse); + }; + + return ToKeyedSequence; +}(KeyedSeq)); +ToKeyedSequence.prototype[IS_ORDERED_SYMBOL] = true; + +var ToIndexedSequence = /*@__PURE__*/(function (IndexedSeq) { + function ToIndexedSequence(iter) { + this._iter = iter; + this.size = iter.size; + } + + if ( IndexedSeq ) ToIndexedSequence.__proto__ = IndexedSeq; + ToIndexedSequence.prototype = Object.create( IndexedSeq && IndexedSeq.prototype ); + ToIndexedSequence.prototype.constructor = ToIndexedSequence; + + ToIndexedSequence.prototype.includes = function includes (value) { + return this._iter.includes(value); + }; + + ToIndexedSequence.prototype.__iterate = function __iterate (fn, reverse) { + var this$1$1 = this; + + var i = 0; + reverse && ensureSize(this); + return this._iter.__iterate( + function (v) { return fn(v, reverse ? this$1$1.size - ++i : i++, this$1$1); }, + reverse + ); + }; + + ToIndexedSequence.prototype.__iterator = function __iterator (type, reverse) { + var this$1$1 = this; + + var iterator = this._iter.__iterator(ITERATE_VALUES, reverse); + var i = 0; + reverse && ensureSize(this); + return new Iterator(function () { + var step = iterator.next(); + return step.done + ? step + : iteratorValue( + type, + reverse ? this$1$1.size - ++i : i++, + step.value, + step + ); + }); + }; + + return ToIndexedSequence; +}(IndexedSeq)); + +var ToSetSequence = /*@__PURE__*/(function (SetSeq) { + function ToSetSequence(iter) { + this._iter = iter; + this.size = iter.size; + } + + if ( SetSeq ) ToSetSequence.__proto__ = SetSeq; + ToSetSequence.prototype = Object.create( SetSeq && SetSeq.prototype ); + ToSetSequence.prototype.constructor = ToSetSequence; + + ToSetSequence.prototype.has = function has (key) { + return this._iter.includes(key); + }; + + ToSetSequence.prototype.__iterate = function __iterate (fn, reverse) { + var this$1$1 = this; + + return this._iter.__iterate(function (v) { return fn(v, v, this$1$1); }, reverse); + }; + + ToSetSequence.prototype.__iterator = function __iterator (type, reverse) { + var iterator = this._iter.__iterator(ITERATE_VALUES, reverse); + return new Iterator(function () { + var step = iterator.next(); + return step.done + ? step + : iteratorValue(type, step.value, step.value, step); + }); + }; + + return ToSetSequence; +}(SetSeq)); + +var FromEntriesSequence = /*@__PURE__*/(function (KeyedSeq) { + function FromEntriesSequence(entries) { + this._iter = entries; + this.size = entries.size; + } + + if ( KeyedSeq ) FromEntriesSequence.__proto__ = KeyedSeq; + FromEntriesSequence.prototype = Object.create( KeyedSeq && KeyedSeq.prototype ); + FromEntriesSequence.prototype.constructor = FromEntriesSequence; + + FromEntriesSequence.prototype.entrySeq = function entrySeq () { + return this._iter.toSeq(); + }; + + FromEntriesSequence.prototype.__iterate = function __iterate (fn, reverse) { + var this$1$1 = 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 indexedCollection = isCollection(entry); + return fn( + indexedCollection ? entry.get(1) : entry[1], + indexedCollection ? entry.get(0) : entry[0], + this$1$1 + ); + } + }, reverse); + }; + + FromEntriesSequence.prototype.__iterator = function __iterator (type, reverse) { + var iterator = this._iter.__iterator(ITERATE_VALUES, reverse); + return new 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 indexedCollection = isCollection(entry); + return iteratorValue( + type, + indexedCollection ? entry.get(0) : entry[0], + indexedCollection ? entry.get(1) : entry[1], + step + ); + } + } + }); + }; + + return FromEntriesSequence; +}(KeyedSeq)); + +ToIndexedSequence.prototype.cacheResult = + ToKeyedSequence.prototype.cacheResult = + ToSetSequence.prototype.cacheResult = + FromEntriesSequence.prototype.cacheResult = + cacheResultThrough; + +function flipFactory(collection) { + var flipSequence = makeSequence(collection); + flipSequence._iter = collection; + flipSequence.size = collection.size; + flipSequence.flip = function () { return collection; }; + flipSequence.reverse = function () { + var reversedSequence = collection.reverse.apply(this); // super.reverse() + reversedSequence.flip = function () { return collection.reverse(); }; + return reversedSequence; + }; + flipSequence.has = function (key) { return collection.includes(key); }; + flipSequence.includes = function (key) { return collection.has(key); }; + flipSequence.cacheResult = cacheResultThrough; + flipSequence.__iterateUncached = function (fn, reverse) { + var this$1$1 = this; + + return collection.__iterate(function (v, k) { return fn(k, v, this$1$1) !== false; }, reverse); + }; + flipSequence.__iteratorUncached = function (type, reverse) { + if (type === ITERATE_ENTRIES) { + var iterator = collection.__iterator(type, reverse); + return new 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 collection.__iterator( + type === ITERATE_VALUES ? ITERATE_KEYS : ITERATE_VALUES, + reverse + ); + }; + return flipSequence; +} + +function mapFactory(collection, mapper, context) { + var mappedSequence = makeSequence(collection); + mappedSequence.size = collection.size; + mappedSequence.has = function (key) { return collection.has(key); }; + mappedSequence.get = function (key, notSetValue) { + var v = collection.get(key, NOT_SET); + return v === NOT_SET + ? notSetValue + : mapper.call(context, v, key, collection); + }; + mappedSequence.__iterateUncached = function (fn, reverse) { + var this$1$1 = this; + + return collection.__iterate( + function (v, k, c) { return fn(mapper.call(context, v, k, c), k, this$1$1) !== false; }, + reverse + ); + }; + mappedSequence.__iteratorUncached = function (type, reverse) { + var iterator = collection.__iterator(ITERATE_ENTRIES, reverse); + return new 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, collection), + step + ); + }); + }; + return mappedSequence; +} + +function reverseFactory(collection, useKeys) { + var this$1$1 = this; + + var reversedSequence = makeSequence(collection); + reversedSequence._iter = collection; + reversedSequence.size = collection.size; + reversedSequence.reverse = function () { return collection; }; + if (collection.flip) { + reversedSequence.flip = function () { + var flipSequence = flipFactory(collection); + flipSequence.reverse = function () { return collection.flip(); }; + return flipSequence; + }; + } + reversedSequence.get = function (key, notSetValue) { return collection.get(useKeys ? key : -1 - key, notSetValue); }; + reversedSequence.has = function (key) { return collection.has(useKeys ? key : -1 - key); }; + reversedSequence.includes = function (value) { return collection.includes(value); }; + reversedSequence.cacheResult = cacheResultThrough; + reversedSequence.__iterate = function (fn, reverse) { + var this$1$1 = this; + + var i = 0; + reverse && ensureSize(collection); + return collection.__iterate( + function (v, k) { return fn(v, useKeys ? k : reverse ? this$1$1.size - ++i : i++, this$1$1); }, + !reverse + ); + }; + reversedSequence.__iterator = function (type, reverse) { + var i = 0; + reverse && ensureSize(collection); + var iterator = collection.__iterator(ITERATE_ENTRIES, !reverse); + return new Iterator(function () { + var step = iterator.next(); + if (step.done) { + return step; + } + var entry = step.value; + return iteratorValue( + type, + useKeys ? entry[0] : reverse ? this$1$1.size - ++i : i++, + entry[1], + step + ); + }); + }; + return reversedSequence; +} + +function filterFactory(collection, predicate, context, useKeys) { + var filterSequence = makeSequence(collection); + if (useKeys) { + filterSequence.has = function (key) { + var v = collection.get(key, NOT_SET); + return v !== NOT_SET && !!predicate.call(context, v, key, collection); + }; + filterSequence.get = function (key, notSetValue) { + var v = collection.get(key, NOT_SET); + return v !== NOT_SET && predicate.call(context, v, key, collection) + ? v + : notSetValue; + }; + } + filterSequence.__iterateUncached = function (fn, reverse) { + var this$1$1 = this; + + var iterations = 0; + collection.__iterate(function (v, k, c) { + if (predicate.call(context, v, k, c)) { + iterations++; + return fn(v, useKeys ? k : iterations - 1, this$1$1); + } + }, reverse); + return iterations; + }; + filterSequence.__iteratorUncached = function (type, reverse) { + var iterator = collection.__iterator(ITERATE_ENTRIES, reverse); + var iterations = 0; + return new 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, collection)) { + return iteratorValue(type, useKeys ? key : iterations++, value, step); + } + } + }); + }; + return filterSequence; +} + +function countByFactory(collection, grouper, context) { + var groups = Map().asMutable(); + collection.__iterate(function (v, k) { + groups.update(grouper.call(context, v, k, collection), 0, function (a) { return a + 1; }); + }); + return groups.asImmutable(); +} + +function groupByFactory(collection, grouper, context) { + var isKeyedIter = isKeyed(collection); + var groups = (isOrdered(collection) ? OrderedMap() : Map()).asMutable(); + collection.__iterate(function (v, k) { + groups.update( + grouper.call(context, v, k, collection), + function (a) { return ((a = a || []), a.push(isKeyedIter ? [k, v] : v), a); } + ); + }); + var coerce = collectionClass(collection); + return groups.map(function (arr) { return reify(collection, coerce(arr)); }).asImmutable(); +} + +function partitionFactory(collection, predicate, context) { + var isKeyedIter = isKeyed(collection); + var groups = [[], []]; + collection.__iterate(function (v, k) { + groups[predicate.call(context, v, k, collection) ? 1 : 0].push( + isKeyedIter ? [k, v] : v + ); + }); + var coerce = collectionClass(collection); + return groups.map(function (arr) { return reify(collection, coerce(arr)); }); +} + +function sliceFactory(collection, begin, end, useKeys) { + var originalSize = collection.size; + + if (wholeSlice(begin, end, originalSize)) { + 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 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(collection.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(collection); + + // 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(collection) && sliceSize >= 0) { + sliceSeq.get = function (index, notSetValue) { + index = wrapIndex(this, index); + return index >= 0 && index < sliceSize + ? collection.get(index + resolvedBegin, notSetValue) + : notSetValue; + }; + } + + sliceSeq.__iterateUncached = function (fn, reverse) { + var this$1$1 = this; + + if (sliceSize === 0) { + return 0; + } + if (reverse) { + return this.cacheResult().__iterate(fn, reverse); + } + var skipped = 0; + var isSkipping = true; + var iterations = 0; + collection.__iterate(function (v, k) { + if (!(isSkipping && (isSkipping = skipped++ < resolvedBegin))) { + iterations++; + return ( + fn(v, useKeys ? k : iterations - 1, this$1$1) !== 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. + if (sliceSize === 0) { + return new Iterator(iteratorDone); + } + var iterator = collection.__iterator(type, reverse); + var skipped = 0; + var iterations = 0; + return new Iterator(function () { + while (skipped++ < resolvedBegin) { + iterator.next(); + } + if (++iterations > sliceSize) { + return iteratorDone(); + } + var step = iterator.next(); + if (useKeys || type === ITERATE_VALUES || step.done) { + return step; + } + if (type === ITERATE_KEYS) { + return iteratorValue(type, iterations - 1, undefined, step); + } + return iteratorValue(type, iterations - 1, step.value[1], step); + }); + }; + + return sliceSeq; +} + +function takeWhileFactory(collection, predicate, context) { + var takeSequence = makeSequence(collection); + takeSequence.__iterateUncached = function (fn, reverse) { + var this$1$1 = this; + + if (reverse) { + return this.cacheResult().__iterate(fn, reverse); + } + var iterations = 0; + collection.__iterate( + function (v, k, c) { return predicate.call(context, v, k, c) && ++iterations && fn(v, k, this$1$1); } + ); + return iterations; + }; + takeSequence.__iteratorUncached = function (type, reverse) { + var this$1$1 = this; + + if (reverse) { + return this.cacheResult().__iterator(type, reverse); + } + var iterator = collection.__iterator(ITERATE_ENTRIES, reverse); + var iterating = true; + return new 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$1$1)) { + iterating = false; + return iteratorDone(); + } + return type === ITERATE_ENTRIES ? step : iteratorValue(type, k, v, step); + }); + }; + return takeSequence; +} + +function skipWhileFactory(collection, predicate, context, useKeys) { + var skipSequence = makeSequence(collection); + skipSequence.__iterateUncached = function (fn, reverse) { + var this$1$1 = this; + + if (reverse) { + return this.cacheResult().__iterate(fn, reverse); + } + var isSkipping = true; + var iterations = 0; + collection.__iterate(function (v, k, c) { + if (!(isSkipping && (isSkipping = predicate.call(context, v, k, c)))) { + iterations++; + return fn(v, useKeys ? k : iterations - 1, this$1$1); + } + }); + return iterations; + }; + skipSequence.__iteratorUncached = function (type, reverse) { + var this$1$1 = this; + + if (reverse) { + return this.cacheResult().__iterator(type, reverse); + } + var iterator = collection.__iterator(ITERATE_ENTRIES, reverse); + var skipping = true; + var iterations = 0; + return new Iterator(function () { + var step; + var k; + var v; + do { + step = iterator.next(); + if (step.done) { + if (useKeys || type === ITERATE_VALUES) { + return step; + } + if (type === ITERATE_KEYS) { + return iteratorValue(type, iterations++, undefined, step); + } + 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$1$1)); + } while (skipping); + return type === ITERATE_ENTRIES ? step : iteratorValue(type, k, v, step); + }); + }; + return skipSequence; +} + +function concatFactory(collection, values) { + var isKeyedCollection = isKeyed(collection); + var iters = [collection] + .concat(values) + .map(function (v) { + if (!isCollection(v)) { + v = isKeyedCollection + ? keyedSeqFromValue(v) + : indexedSeqFromValue(Array.isArray(v) ? v : [v]); + } else if (isKeyedCollection) { + v = KeyedCollection(v); + } + return v; + }) + .filter(function (v) { return v.size !== 0; }); + + if (iters.length === 0) { + return collection; + } + + if (iters.length === 1) { + var singleton = iters[0]; + if ( + singleton === collection || + (isKeyedCollection && isKeyed(singleton)) || + (isIndexed(collection) && isIndexed(singleton)) + ) { + return singleton; + } + } + + var concatSeq = new ArraySeq(iters); + if (isKeyedCollection) { + concatSeq = concatSeq.toKeyedSeq(); + } else if (!isIndexed(collection)) { + 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(collection, depth, useKeys) { + var flatSequence = makeSequence(collection); + flatSequence.__iterateUncached = function (fn, reverse) { + if (reverse) { + return this.cacheResult().__iterate(fn, reverse); + } + var iterations = 0; + var stopped = false; + function flatDeep(iter, currentDepth) { + iter.__iterate(function (v, k) { + if ((!depth || currentDepth < depth) && isCollection(v)) { + flatDeep(v, currentDepth + 1); + } else { + iterations++; + if (fn(v, useKeys ? k : iterations - 1, flatSequence) === false) { + stopped = true; + } + } + return !stopped; + }, reverse); + } + flatDeep(collection, 0); + return iterations; + }; + flatSequence.__iteratorUncached = function (type, reverse) { + if (reverse) { + return this.cacheResult().__iterator(type, reverse); + } + var iterator = collection.__iterator(type, reverse); + var stack = []; + var iterations = 0; + return new 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) && isCollection(v)) { + stack.push(iterator); + iterator = v.__iterator(type, reverse); + } else { + return useKeys ? step : iteratorValue(type, iterations++, v, step); + } + } + return iteratorDone(); + }); + }; + return flatSequence; +} + +function flatMapFactory(collection, mapper, context) { + var coerce = collectionClass(collection); + return collection + .toSeq() + .map(function (v, k) { return coerce(mapper.call(context, v, k, collection)); }) + .flatten(true); +} + +function interposeFactory(collection, separator) { + var interposedSequence = makeSequence(collection); + interposedSequence.size = collection.size && collection.size * 2 - 1; + interposedSequence.__iterateUncached = function (fn, reverse) { + var this$1$1 = this; + + var iterations = 0; + collection.__iterate( + function (v) { return (!iterations || fn(separator, iterations++, this$1$1) !== false) && + fn(v, iterations++, this$1$1) !== false; }, + reverse + ); + return iterations; + }; + interposedSequence.__iteratorUncached = function (type, reverse) { + var iterator = collection.__iterator(ITERATE_VALUES, reverse); + var iterations = 0; + var step; + return new 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(collection, comparator, mapper) { + if (!comparator) { + comparator = defaultComparator; + } + var isKeyedCollection = isKeyed(collection); + var index = 0; + var entries = collection + .toSeq() + .map(function (v, k) { return [k, v, index++, mapper ? mapper(v, k, collection) : v]; }) + .valueSeq() + .toArray(); + entries + .sort(function (a, b) { return comparator(a[3], b[3]) || a[2] - b[2]; }) + .forEach( + isKeyedCollection + ? function (v, i) { + entries[i].length = 2; + } + : function (v, i) { + entries[i] = v[1]; + } + ); + return isKeyedCollection + ? KeyedSeq(entries) + : isIndexed(collection) + ? IndexedSeq(entries) + : SetSeq(entries); +} + +function maxFactory(collection, comparator, mapper) { + if (!comparator) { + comparator = defaultComparator; + } + if (mapper) { + var entry = collection + .toSeq() + .map(function (v, k) { return [v, mapper(v, k, collection)]; }) + .reduce(function (a, b) { return (maxCompare(comparator, a[1], b[1]) ? b : a); }); + return entry && entry[0]; + } + return collection.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, zipAll) { + var zipSequence = makeSequence(keyIter); + var sizes = new ArraySeq(iters).map(function (i) { return 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) { + /* 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 = Collection(i)), getIterator(reverse ? i.reverse() : i)); } + ); + var iterations = 0; + var isDone = false; + return new Iterator(function () { + var steps; + if (!isDone) { + steps = iterators.map(function (i) { return i.next(); }); + isDone = zipAll ? steps.every(function (s) { return s.done; }) : 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 iter === seq ? iter : isSeq(iter) ? seq : iter.constructor(seq); +} + +function validateEntry(entry) { + if (entry !== Object(entry)) { + throw new TypeError('Expected [K, V] tuple: ' + entry); + } +} + +function collectionClass(collection) { + return isKeyed(collection) + ? KeyedCollection + : isIndexed(collection) + ? IndexedCollection + : SetCollection; +} + +function makeSequence(collection) { + return Object.create( + (isKeyed(collection) + ? KeyedSeq + : isIndexed(collection) + ? IndexedSeq + : SetSeq + ).prototype + ); +} + +function cacheResultThrough() { + if (this._iter.cacheResult) { + this._iter.cacheResult(); + this.size = this._iter.size; + return 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; +} + +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 invariant(condition, error) { + if (!condition) { throw new Error(error); } +} + +function assertNotInfinite(size) { + invariant( + size !== Infinity, + 'Cannot perform this action with an infinite size.' + ); +} + +function coerceKeyPath(keyPath) { + 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 + ); +} + +var toString = Object.prototype.toString; + +function isPlainObject(value) { + // 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; + } + + var 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) + var parentProto = proto; + var nextProto = Object.getPrototypeOf(proto); + while (nextProto !== null) { + parentProto = nextProto; + nextProto = Object.getPrototypeOf(parentProto); + } + return parentProto === proto; +} + +/** + * Returns true if the value is a potentially-persistent data structure, either + * provided by Immutable.js or a plain Array or Object. + */ +function isDataStructure(value) { + return ( + typeof value === 'object' && + (isImmutable(value) || Array.isArray(value) || isPlainObject(value)) + ); +} + +function quoteString(value) { + try { + return typeof value === 'string' ? JSON.stringify(value) : String(value); + } catch (_ignoreError) { + return JSON.stringify(value); + } +} + +function has(collection, key) { + return isImmutable(collection) + ? collection.has(key) + : isDataStructure(collection) && hasOwnProperty.call(collection, key); +} + +function get(collection, key, notSetValue) { + return isImmutable(collection) + ? collection.get(key, notSetValue) + : !has(collection, key) + ? notSetValue + : typeof collection.get === 'function' + ? collection.get(key) + : collection[key]; +} + +function shallowCopy(from) { + if (Array.isArray(from)) { + return arrCopy(from); + } + var to = {}; + for (var key in from) { + if (hasOwnProperty.call(from, key)) { + to[key] = from[key]; + } + } + return to; +} + +function remove(collection, key) { + if (!isDataStructure(collection)) { + throw new TypeError( + 'Cannot update non-data-structure value: ' + collection + ); + } + if (isImmutable(collection)) { + if (!collection.remove) { + throw new TypeError( + 'Cannot update immutable value without .remove() method: ' + collection + ); + } + return collection.remove(key); + } + if (!hasOwnProperty.call(collection, key)) { + return collection; + } + var collectionCopy = shallowCopy(collection); + if (Array.isArray(collectionCopy)) { + collectionCopy.splice(key, 1); + } else { + delete collectionCopy[key]; + } + return collectionCopy; +} + +function set(collection, key, value) { + if (!isDataStructure(collection)) { + throw new TypeError( + 'Cannot update non-data-structure value: ' + collection + ); + } + if (isImmutable(collection)) { + if (!collection.set) { + throw new TypeError( + 'Cannot update immutable value without .set() method: ' + collection + ); + } + return collection.set(key, value); + } + if (hasOwnProperty.call(collection, key) && value === collection[key]) { + return collection; + } + var collectionCopy = shallowCopy(collection); + collectionCopy[key] = value; + return collectionCopy; +} + +function updateIn$1(collection, keyPath, notSetValue, updater) { + if (!updater) { + updater = notSetValue; + notSetValue = undefined; + } + var updatedValue = updateInDeeply( + isImmutable(collection), + collection, + coerceKeyPath(keyPath), + 0, + notSetValue, + updater + ); + return updatedValue === NOT_SET ? notSetValue : updatedValue; +} + +function updateInDeeply( + inImmutable, + existing, + keyPath, + i, + notSetValue, + updater +) { + var wasNotSet = existing === NOT_SET; + if (i === keyPath.length) { + var existingValue = wasNotSet ? notSetValue : existing; + var newValue = updater(existingValue); + return newValue === existingValue ? existing : newValue; + } + if (!wasNotSet && !isDataStructure(existing)) { + throw new TypeError( + 'Cannot update within non-data-structure value in path [' + + keyPath.slice(0, i).map(quoteString) + + ']: ' + + existing + ); + } + var key = keyPath[i]; + var nextExisting = wasNotSet ? NOT_SET : get(existing, key, NOT_SET); + var nextUpdated = updateInDeeply( + nextExisting === NOT_SET ? inImmutable : isImmutable(nextExisting), + nextExisting, + keyPath, + i + 1, + notSetValue, + updater + ); + return nextUpdated === nextExisting + ? existing + : nextUpdated === NOT_SET + ? remove(existing, key) + : set( + wasNotSet ? (inImmutable ? emptyMap() : {}) : existing, + key, + nextUpdated + ); +} + +function setIn$1(collection, keyPath, value) { + return updateIn$1(collection, keyPath, NOT_SET, function () { return value; }); +} + +function setIn(keyPath, v) { + return setIn$1(this, keyPath, v); +} + +function removeIn(collection, keyPath) { + return updateIn$1(collection, keyPath, function () { return NOT_SET; }); +} + +function deleteIn(keyPath) { + return removeIn(this, keyPath); +} + +function update$1(collection, key, notSetValue, updater) { + return updateIn$1(collection, [key], notSetValue, updater); +} + +function update(key, notSetValue, updater) { + return arguments.length === 1 + ? key(this) + : update$1(this, key, notSetValue, updater); +} + +function updateIn(keyPath, notSetValue, updater) { + return updateIn$1(this, keyPath, notSetValue, updater); +} + +function merge$1() { + var iters = [], len = arguments.length; + while ( len-- ) iters[ len ] = arguments[ len ]; + + return mergeIntoKeyedWith(this, iters); +} + +function mergeWith$1(merger) { + var iters = [], len = arguments.length - 1; + while ( len-- > 0 ) iters[ len ] = arguments[ len + 1 ]; + + if (typeof merger !== 'function') { + throw new TypeError('Invalid merger function: ' + merger); + } + return mergeIntoKeyedWith(this, iters, merger); +} + +function mergeIntoKeyedWith(collection, collections, merger) { + var iters = []; + for (var ii = 0; ii < collections.length; ii++) { + var collection$1 = KeyedCollection(collections[ii]); + if (collection$1.size !== 0) { + iters.push(collection$1); + } + } + if (iters.length === 0) { + return collection; + } + if ( + collection.toSeq().size === 0 && + !collection.__ownerID && + iters.length === 1 + ) { + return collection.constructor(iters[0]); + } + return collection.withMutations(function (collection) { + var mergeIntoCollection = merger + ? function (value, key) { + update$1(collection, key, NOT_SET, function (oldVal) { return oldVal === NOT_SET ? value : merger(oldVal, value, key); } + ); + } + : function (value, key) { + collection.set(key, value); + }; + for (var ii = 0; ii < iters.length; ii++) { + iters[ii].forEach(mergeIntoCollection); + } + }); +} + +function merge(collection) { + var sources = [], len = arguments.length - 1; + while ( len-- > 0 ) sources[ len ] = arguments[ len + 1 ]; + + return mergeWithSources(collection, sources); +} + +function mergeWith(merger, collection) { + var sources = [], len = arguments.length - 2; + while ( len-- > 0 ) sources[ len ] = arguments[ len + 2 ]; + + return mergeWithSources(collection, sources, merger); +} + +function mergeDeep$1(collection) { + var sources = [], len = arguments.length - 1; + while ( len-- > 0 ) sources[ len ] = arguments[ len + 1 ]; + + return mergeDeepWithSources(collection, sources); +} + +function mergeDeepWith$1(merger, collection) { + var sources = [], len = arguments.length - 2; + while ( len-- > 0 ) sources[ len ] = arguments[ len + 2 ]; + + return mergeDeepWithSources(collection, sources, merger); +} + +function mergeDeepWithSources(collection, sources, merger) { + return mergeWithSources(collection, sources, deepMergerWith(merger)); +} + +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.apply(collection, [ merger ].concat( sources )) + : collection.merge + ? collection.merge.apply(collection, sources) + : collection.concat.apply(collection, sources); + } + var isArray = Array.isArray(collection); + var merged = collection; + var Collection = isArray ? IndexedCollection : KeyedCollection; + var mergeItem = isArray + ? function (value) { + // Copy on write + if (merged === collection) { + merged = shallowCopy(merged); + } + merged.push(value); + } + : function (value, key) { + var hasVal = hasOwnProperty.call(merged, key); + var 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 (var 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) { + var oldSeq = Seq(oldDataStructure); + var 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) + ); +} + +function mergeDeep() { + var iters = [], len = arguments.length; + while ( len-- ) iters[ len ] = arguments[ len ]; + + return mergeDeepWithSources(this, iters); +} + +function mergeDeepWith(merger) { + var iters = [], len = arguments.length - 1; + while ( len-- > 0 ) iters[ len ] = arguments[ len + 1 ]; + + return mergeDeepWithSources(this, iters, merger); +} + +function mergeIn(keyPath) { + var iters = [], len = arguments.length - 1; + while ( len-- > 0 ) iters[ len ] = arguments[ len + 1 ]; + + return updateIn$1(this, keyPath, emptyMap(), function (m) { return mergeWithSources(m, iters); }); +} + +function mergeDeepIn(keyPath) { + var iters = [], len = arguments.length - 1; + while ( len-- > 0 ) iters[ len ] = arguments[ len + 1 ]; + + return updateIn$1(this, keyPath, emptyMap(), function (m) { return mergeDeepWithSources(m, iters); } + ); +} + +function withMutations(fn) { + var mutable = this.asMutable(); + fn(mutable); + return mutable.wasAltered() ? mutable.__ensureOwner(this.__ownerID) : this; +} + +function asMutable() { + return this.__ownerID ? this : this.__ensureOwner(new OwnerID()); +} + +function asImmutable() { + return this.__ensureOwner(); +} + +function wasAltered() { + return this.__altered; +} + +var Map = /*@__PURE__*/(function (KeyedCollection) { + function Map(value) { + return value === undefined || value === null + ? emptyMap() + : isMap(value) && !isOrdered(value) + ? value + : emptyMap().withMutations(function (map) { + var iter = KeyedCollection(value); + assertNotInfinite(iter.size); + iter.forEach(function (v, k) { return map.set(k, v); }); + }); + } + + if ( KeyedCollection ) Map.__proto__ = KeyedCollection; + Map.prototype = Object.create( KeyedCollection && KeyedCollection.prototype ); + Map.prototype.constructor = Map; + + Map.of = function of () { + var keyValues = [], len = arguments.length; + while ( len-- ) keyValues[ len ] = arguments[ len ]; + + return emptyMap().withMutations(function (map) { + for (var i = 0; i < keyValues.length; i += 2) { + if (i + 1 >= keyValues.length) { + throw new Error('Missing value for key: ' + keyValues[i]); + } + map.set(keyValues[i], keyValues[i + 1]); + } + }); + }; + + Map.prototype.toString = function toString () { + return this.__toString('Map {', '}'); + }; + + // @pragma Access + + Map.prototype.get = function get (k, notSetValue) { + return this._root + ? this._root.get(0, undefined, k, notSetValue) + : notSetValue; + }; + + // @pragma Modification + + Map.prototype.set = function set (k, v) { + return updateMap(this, k, v); + }; + + Map.prototype.remove = function remove (k) { + return updateMap(this, k, NOT_SET); + }; + + Map.prototype.deleteAll = function deleteAll (keys) { + var collection = Collection(keys); + + if (collection.size === 0) { + return this; + } + + return this.withMutations(function (map) { + collection.forEach(function (key) { return map.remove(key); }); + }); + }; + + Map.prototype.clear = function clear () { + 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 + + Map.prototype.sort = function sort (comparator) { + // Late binding + return OrderedMap(sortFactory(this, comparator)); + }; + + Map.prototype.sortBy = function sortBy (mapper, comparator) { + // Late binding + return OrderedMap(sortFactory(this, comparator, mapper)); + }; + + Map.prototype.map = function map (mapper, context) { + var this$1$1 = this; + + return this.withMutations(function (map) { + map.forEach(function (value, key) { + map.set(key, mapper.call(context, value, key, this$1$1)); + }); + }); + }; + + // @pragma Mutability + + Map.prototype.__iterator = function __iterator (type, reverse) { + return new MapIterator(this, type, reverse); + }; + + Map.prototype.__iterate = function __iterate (fn, reverse) { + var this$1$1 = this; + + var iterations = 0; + this._root && + this._root.iterate(function (entry) { + iterations++; + return fn(entry[1], entry[0], this$1$1); + }, reverse); + return iterations; + }; + + Map.prototype.__ensureOwner = function __ensureOwner (ownerID) { + if (ownerID === this.__ownerID) { + return this; + } + if (!ownerID) { + if (this.size === 0) { + return emptyMap(); + } + this.__ownerID = ownerID; + this.__altered = false; + return this; + } + return makeMap(this.size, this._root, ownerID, this.__hash); + }; + + return Map; +}(KeyedCollection)); + +Map.isMap = isMap; + +var MapPrototype = Map.prototype; +MapPrototype[IS_MAP_SYMBOL] = true; +MapPrototype[DELETE] = MapPrototype.remove; +MapPrototype.removeAll = MapPrototype.deleteAll; +MapPrototype.setIn = setIn; +MapPrototype.removeIn = MapPrototype.deleteIn = deleteIn; +MapPrototype.update = update; +MapPrototype.updateIn = updateIn; +MapPrototype.merge = MapPrototype.concat = merge$1; +MapPrototype.mergeWith = mergeWith$1; +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 + +var ArrayMapNode = function ArrayMapNode(ownerID, entries) { + this.ownerID = ownerID; + this.entries = entries; +}; + +ArrayMapNode.prototype.get = function get (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 update (ownerID, shift, keyHash, key, value, didChangeSize, didAlter) { + var removed = value === NOT_SET; + + var entries = this.entries; + var idx = 0; + var len = entries.length; + for (; 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); +}; + +var BitmapIndexedNode = function BitmapIndexedNode(ownerID, bitmap, nodes) { + this.ownerID = ownerID; + this.bitmap = bitmap; + this.nodes = nodes; +}; + +BitmapIndexedNode.prototype.get = function get (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 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; + + 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 + ? setAt(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); +}; + +var HashArrayMapNode = function HashArrayMapNode(ownerID, count, nodes) { + this.ownerID = ownerID; + this.count = count; + this.nodes = nodes; +}; + +HashArrayMapNode.prototype.get = function get (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 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]; + + 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 = setAt(nodes, idx, newNode, isEditable); + + if (isEditable) { + this.count = newCount; + this.nodes = newNodes; + return this; + } + + return new HashArrayMapNode(ownerID, newCount, newNodes); +}; + +var HashCollisionNode = function HashCollisionNode(ownerID, keyHash, entries) { + this.ownerID = ownerID; + this.keyHash = keyHash; + this.entries = entries; +}; + +HashCollisionNode.prototype.get = function get (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 update (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; + var len = entries.length; + for (; 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); +}; + +var ValueNode = function ValueNode(ownerID, keyHash, entry) { + this.ownerID = ownerID; + this.keyHash = keyHash; + this.entry = entry; +}; + +ValueNode.prototype.get = function get (shift, keyHash, key, notSetValue) { + return is(key, this.entry[0]) ? this.entry[1] : notSetValue; +}; + +ValueNode.prototype.update = function update (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; + } + } + }; + +// eslint-disable-next-line no-unused-vars +ValueNode.prototype.iterate = function (fn, reverse) { + return fn(this.entry); +}; + +var MapIterator = /*@__PURE__*/(function (Iterator) { + function MapIterator(map, type, reverse) { + this._type = type; + this._reverse = reverse; + this._stack = map._root && mapIteratorFrame(map._root); + } + + if ( Iterator ) MapIterator.__proto__ = Iterator; + MapIterator.prototype = Object.create( Iterator && Iterator.prototype ); + MapIterator.prototype.constructor = MapIterator; + + MapIterator.prototype.next = function next () { + var type = this._type; + var stack = this._stack; + while (stack) { + var node = stack.node; + var index = stack.index++; + var maxIndex = (void 0); + 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(); + }; + + return MapIterator; +}(Iterator)); + +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(); + var 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); + } + 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 popCount(x) { + x -= (x >> 1) & 0x55555555; + x = (x & 0x33333333) + ((x >> 2) & 0x33333333); + x = (x + (x >> 4)) & 0x0f0f0f0f; + x += x >> 8; + x += x >> 16; + return x & 0x7f; +} + +function setAt(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; + +var IS_LIST_SYMBOL = '@@__IMMUTABLE_LIST__@@'; + +function isList(maybeList) { + return Boolean(maybeList && maybeList[IS_LIST_SYMBOL]); +} + +var List = /*@__PURE__*/(function (IndexedCollection) { + function List(value) { + var empty = emptyList(); + if (value === undefined || value === null) { + return empty; + } + if (isList(value)) { + return value; + } + var iter = IndexedCollection(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); }); + }); + } + + if ( IndexedCollection ) List.__proto__ = IndexedCollection; + List.prototype = Object.create( IndexedCollection && IndexedCollection.prototype ); + List.prototype.constructor = List; + + List.of = function of (/*...values*/) { + return this(arguments); + }; + + List.prototype.toString = function toString () { + return this.__toString('List [', ']'); + }; + + // @pragma Access + + List.prototype.get = function get (index, notSetValue) { + index = wrapIndex(this, index); + if (index >= 0 && index < this.size) { + index += this._origin; + var node = listNodeFor(this, index); + return node && node.array[index & MASK]; + } + return notSetValue; + }; + + // @pragma Modification + + List.prototype.set = function set (index, value) { + return updateList(this, index, value); + }; + + List.prototype.remove = function remove (index) { + return !this.has(index) + ? this + : index === 0 + ? this.shift() + : index === this.size - 1 + ? this.pop() + : this.splice(index, 1); + }; + + List.prototype.insert = function insert (index, value) { + return this.splice(index, 0, value); + }; + + List.prototype.clear = function clear () { + if (this.size === 0) { + return this; + } + if (this.__ownerID) { + this.size = this._origin = this._capacity = 0; + this._level = SHIFT; + this._root = this._tail = this.__hash = undefined; + this.__altered = true; + return this; + } + return emptyList(); + }; + + List.prototype.push = function push (/*...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 pop () { + return setListBounds(this, 0, -1); + }; + + List.prototype.unshift = function unshift (/*...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 shift () { + return setListBounds(this, 1); + }; + + // @pragma Composition + + List.prototype.concat = function concat (/*...collections*/) { + var arguments$1 = arguments; + + var seqs = []; + for (var i = 0; i < arguments.length; i++) { + var argument = arguments$1[i]; + var 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(function (list) { + seqs.forEach(function (seq) { return seq.forEach(function (value) { return list.push(value); }); }); + }); + }; + + List.prototype.setSize = function setSize (size) { + return setListBounds(this, 0, size); + }; + + List.prototype.map = function map (mapper, context) { + var this$1$1 = this; + + return this.withMutations(function (list) { + for (var i = 0; i < this$1$1.size; i++) { + list.set(i, mapper.call(context, list.get(i), i, this$1$1)); + } + }); + }; + + // @pragma Iteration + + List.prototype.slice = function slice (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 __iterator (type, reverse) { + var index = reverse ? this.size : 0; + var values = iterateList(this, reverse); + return new Iterator(function () { + var value = values(); + return value === DONE + ? iteratorDone() + : iteratorValue(type, reverse ? --index : index++, value); + }); + }; + + List.prototype.__iterate = function __iterate (fn, reverse) { + var index = reverse ? this.size : 0; + var values = iterateList(this, reverse); + var value; + while ((value = values()) !== DONE) { + if (fn(value, reverse ? --index : index++, this) === false) { + break; + } + } + return index; + }; + + List.prototype.__ensureOwner = function __ensureOwner (ownerID) { + if (ownerID === this.__ownerID) { + 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 List; +}(IndexedCollection)); + +List.isList = isList; + +var ListPrototype = List.prototype; +ListPrototype[IS_LIST_SYMBOL] = true; +ListPrototype[DELETE] = ListPrototype.remove; +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(); +}; + +var VNode = function VNode(array, ownerID) { + this.array = array; + this.ownerID = ownerID; +}; + +// TODO: seems like these methods are very similar + +VNode.prototype.removeBefore = function removeBefore (ownerID, level, index) { + if (index === level ? 1 << level : 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 removeAfter (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 newChild; + if (level > 0) { + var oldChild = this.array[sizeIndex]; + newChild = + oldChild && oldChild.removeAfter(ownerID, level - SHIFT, index); + if (newChild === oldChild && sizeIndex === this.array.length - 1) { + return this; + } + } + + var editable = editableVNode(this, ownerID); + editable.array.splice(sizeIndex + 1); + 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 () { + while (true) { + 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) + ); + } + }; + } +} + +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 !== index) { + return list; + } + + 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(); + 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; + } + + if (didAlter) { + 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) { + // 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; + } + 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 need 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 need 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 getTailOffset(size) { + return size < SIZE ? 0 : ((size - 1) >>> SHIFT) << SHIFT; +} + +var OrderedMap = /*@__PURE__*/(function (Map) { + function OrderedMap(value) { + return value === undefined || value === null + ? emptyOrderedMap() + : isOrderedMap(value) + ? value + : emptyOrderedMap().withMutations(function (map) { + var iter = KeyedCollection(value); + assertNotInfinite(iter.size); + iter.forEach(function (v, k) { return map.set(k, v); }); + }); + } + + if ( Map ) OrderedMap.__proto__ = Map; + OrderedMap.prototype = Object.create( Map && Map.prototype ); + OrderedMap.prototype.constructor = OrderedMap; + + OrderedMap.of = function of (/*...values*/) { + return this(arguments); + }; + + OrderedMap.prototype.toString = function toString () { + return this.__toString('OrderedMap {', '}'); + }; + + // @pragma Access + + OrderedMap.prototype.get = function get (k, notSetValue) { + var index = this._map.get(k); + return index !== undefined ? this._list.get(index)[1] : notSetValue; + }; + + // @pragma Modification + + OrderedMap.prototype.clear = function clear () { + if (this.size === 0) { + return this; + } + if (this.__ownerID) { + this.size = 0; + this._map.clear(); + this._list.clear(); + this.__altered = true; + return this; + } + return emptyOrderedMap(); + }; + + OrderedMap.prototype.set = function set (k, v) { + return updateOrderedMap(this, k, v); + }; + + OrderedMap.prototype.remove = function remove (k) { + return updateOrderedMap(this, k, NOT_SET); + }; + + OrderedMap.prototype.__iterate = function __iterate (fn, reverse) { + var this$1$1 = this; + + return this._list.__iterate( + function (entry) { return entry && fn(entry[1], entry[0], this$1$1); }, + reverse + ); + }; + + OrderedMap.prototype.__iterator = function __iterator (type, reverse) { + return this._list.fromEntrySeq().__iterator(type, reverse); + }; + + OrderedMap.prototype.__ensureOwner = function __ensureOwner (ownerID) { + if (ownerID === this.__ownerID) { + return this; + } + var newMap = this._map.__ensureOwner(ownerID); + var 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; + } + return makeOrderedMap(newMap, newList, ownerID, this.__hash); + }; + + return OrderedMap; +}(Map)); + +OrderedMap.isOrderedMap = isOrderedMap; + +OrderedMap.prototype[IS_ORDERED_SYMBOL] = 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; + omap.__altered = false; + 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; + omap.__altered = true; + return omap; + } + return makeOrderedMap(newMap, newList); +} + +var IS_STACK_SYMBOL = '@@__IMMUTABLE_STACK__@@'; + +function isStack(maybeStack) { + return Boolean(maybeStack && maybeStack[IS_STACK_SYMBOL]); +} + +var Stack = /*@__PURE__*/(function (IndexedCollection) { + function Stack(value) { + return value === undefined || value === null + ? emptyStack() + : isStack(value) + ? value + : emptyStack().pushAll(value); + } + + if ( IndexedCollection ) Stack.__proto__ = IndexedCollection; + Stack.prototype = Object.create( IndexedCollection && IndexedCollection.prototype ); + Stack.prototype.constructor = Stack; + + Stack.of = function of (/*...values*/) { + return this(arguments); + }; + + Stack.prototype.toString = function toString () { + return this.__toString('Stack [', ']'); + }; + + // @pragma Access + + Stack.prototype.get = function get (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 peek () { + return this._head && this._head.value; + }; + + // @pragma Modification + + Stack.prototype.push = function push (/*...values*/) { + var arguments$1 = arguments; + + 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$1[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 pushAll (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.__iterate(function (value) { + newSize++; + head = { + value: value, + next: head, + }; + }, /* reverse */ true); + 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 pop () { + return this.slice(1); + }; + + Stack.prototype.clear = function clear () { + 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 slice (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 __ensureOwner (ownerID) { + if (ownerID === this.__ownerID) { + return this; + } + if (!ownerID) { + if (this.size === 0) { + return emptyStack(); + } + this.__ownerID = ownerID; + this.__altered = false; + return this; + } + return makeStack(this.size, this._head, ownerID, this.__hash); + }; + + // @pragma Iteration + + Stack.prototype.__iterate = function __iterate (fn, reverse) { + var this$1$1 = this; + + if (reverse) { + return new ArraySeq(this.toArray()).__iterate( + function (v, k) { return fn(v, k, this$1$1); }, + reverse + ); + } + 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 __iterator (type, reverse) { + if (reverse) { + return new ArraySeq(this.toArray()).__iterator(type, reverse); + } + var iterations = 0; + var node = this._head; + return new Iterator(function () { + if (node) { + var value = node.value; + node = node.next; + return iteratorValue(type, iterations++, value); + } + return iteratorDone(); + }); + }; + + return Stack; +}(IndexedCollection)); + +Stack.isStack = isStack; + +var 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); + 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)); +} + +var IS_SET_SYMBOL = '@@__IMMUTABLE_SET__@@'; + +function isSet(maybeSet) { + return Boolean(maybeSet && maybeSet[IS_SET_SYMBOL]); +} + +function isOrderedSet(maybeOrderedSet) { + return isSet(maybeOrderedSet) && isOrdered(maybeOrderedSet); +} + +function deepEqual(a, b) { + if (a === b) { + return true; + } + + if ( + !isCollection(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; +} + +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; +} + +function toJS(value) { + if (!value || typeof value !== 'object') { + return value; + } + if (!isCollection(value)) { + if (!isDataStructure(value)) { + return value; + } + value = Seq(value); + } + if (isKeyed(value)) { + var result$1 = {}; + value.__iterate(function (v, k) { + result$1[k] = toJS(v); + }); + return result$1; + } + var result = []; + value.__iterate(function (v) { + result.push(toJS(v)); + }); + return result; +} + +var Set = /*@__PURE__*/(function (SetCollection) { + function Set(value) { + return value === undefined || value === null + ? emptySet() + : isSet(value) && !isOrdered(value) + ? value + : emptySet().withMutations(function (set) { + var iter = SetCollection(value); + assertNotInfinite(iter.size); + iter.forEach(function (v) { return set.add(v); }); + }); + } + + if ( SetCollection ) Set.__proto__ = SetCollection; + Set.prototype = Object.create( SetCollection && SetCollection.prototype ); + Set.prototype.constructor = Set; + + Set.of = function of (/*...values*/) { + return this(arguments); + }; + + Set.fromKeys = function fromKeys (value) { + return this(KeyedCollection(value).keySeq()); + }; + + Set.intersect = function intersect (sets) { + sets = Collection(sets).toArray(); + return sets.length + ? SetPrototype.intersect.apply(Set(sets.pop()), sets) + : emptySet(); + }; + + Set.union = function union (sets) { + sets = Collection(sets).toArray(); + return sets.length + ? SetPrototype.union.apply(Set(sets.pop()), sets) + : emptySet(); + }; + + Set.prototype.toString = function toString () { + return this.__toString('Set {', '}'); + }; + + // @pragma Access + + Set.prototype.has = function has (value) { + return this._map.has(value); + }; + + // @pragma Modification + + Set.prototype.add = function add (value) { + return updateSet(this, this._map.set(value, value)); + }; + + Set.prototype.remove = function remove (value) { + return updateSet(this, this._map.remove(value)); + }; + + Set.prototype.clear = function clear () { + return updateSet(this, this._map.clear()); + }; + + // @pragma Composition + + Set.prototype.map = function map (mapper, context) { + var this$1$1 = this; + + // keep track if the set is altered by the map function + var didChanges = false; + + var newMap = updateSet( + this, + this._map.mapEntries(function (ref) { + var v = ref[1]; + + var mapped = mapper.call(context, v, v, this$1$1); + + if (mapped !== v) { + didChanges = true; + } + + return [mapped, mapped]; + }, context) + ); + + return didChanges ? newMap : this; + }; + + Set.prototype.union = function union () { + var iters = [], len = arguments.length; + while ( len-- ) iters[ len ] = arguments[ len ]; + + 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++) { + if (typeof iters[ii] === 'string') { + set.add(iters[ii]); + } else { + SetCollection(iters[ii]).forEach(function (value) { return set.add(value); }); + } + } + }); + }; + + Set.prototype.intersect = function intersect () { + var iters = [], len = arguments.length; + while ( len-- ) iters[ len ] = arguments[ len ]; + + if (iters.length === 0) { + return this; + } + iters = iters.map(function (iter) { return SetCollection(iter); }); + var toRemove = []; + this.forEach(function (value) { + if (!iters.every(function (iter) { return iter.includes(value); })) { + toRemove.push(value); + } + }); + return this.withMutations(function (set) { + toRemove.forEach(function (value) { + set.remove(value); + }); + }); + }; + + Set.prototype.subtract = function subtract () { + var iters = [], len = arguments.length; + while ( len-- ) iters[ len ] = arguments[ len ]; + + if (iters.length === 0) { + return this; + } + iters = iters.map(function (iter) { return SetCollection(iter); }); + var toRemove = []; + this.forEach(function (value) { + if (iters.some(function (iter) { return iter.includes(value); })) { + toRemove.push(value); + } + }); + return this.withMutations(function (set) { + toRemove.forEach(function (value) { + set.remove(value); + }); + }); + }; + + Set.prototype.sort = function sort (comparator) { + // Late binding + return OrderedSet(sortFactory(this, comparator)); + }; + + Set.prototype.sortBy = function sortBy (mapper, comparator) { + // Late binding + return OrderedSet(sortFactory(this, comparator, mapper)); + }; + + Set.prototype.wasAltered = function wasAltered () { + return this._map.wasAltered(); + }; + + Set.prototype.__iterate = function __iterate (fn, reverse) { + var this$1$1 = this; + + return this._map.__iterate(function (k) { return fn(k, k, this$1$1); }, reverse); + }; + + Set.prototype.__iterator = function __iterator (type, reverse) { + return this._map.__iterator(type, reverse); + }; + + Set.prototype.__ensureOwner = function __ensureOwner (ownerID) { + if (ownerID === this.__ownerID) { + return this; + } + var newMap = this._map.__ensureOwner(ownerID); + if (!ownerID) { + if (this.size === 0) { + return this.__empty(); + } + this.__ownerID = ownerID; + this._map = newMap; + return this; + } + return this.__make(newMap, ownerID); + }; + + return Set; +}(SetCollection)); + +Set.isSet = isSet; + +var SetPrototype = Set.prototype; +SetPrototype[IS_SET_SYMBOL] = true; +SetPrototype[DELETE] = SetPrototype.remove; +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; + +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())); +} + +/** + * Returns a lazy seq of nums 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 list. + */ +var Range = /*@__PURE__*/(function (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; + } + } + + if ( IndexedSeq ) Range.__proto__ = IndexedSeq; + Range.prototype = Object.create( IndexedSeq && IndexedSeq.prototype ); + Range.prototype.constructor = Range; + + Range.prototype.toString = function toString () { + if (this.size === 0) { + return 'Range []'; + } + return ( + 'Range [ ' + + this._start + + '...' + + this._end + + (this._step !== 1 ? ' by ' + this._step : '') + + ' ]' + ); + }; + + Range.prototype.get = function get (index, notSetValue) { + return this.has(index) + ? this._start + wrapIndex(this, index) * this._step + : notSetValue; + }; + + Range.prototype.includes = function includes (searchValue) { + var possibleIndex = (searchValue - this._start) / this._step; + return ( + possibleIndex >= 0 && + possibleIndex < this.size && + possibleIndex === Math.floor(possibleIndex) + ); + }; + + Range.prototype.slice = function slice (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 indexOf (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 lastIndexOf (searchValue) { + return this.indexOf(searchValue); + }; + + Range.prototype.__iterate = function __iterate (fn, reverse) { + var size = this.size; + var step = this._step; + var value = reverse ? this._start + (size - 1) * step : this._start; + var i = 0; + while (i !== size) { + if (fn(value, reverse ? size - ++i : i++, this) === false) { + break; + } + value += reverse ? -step : step; + } + return i; + }; + + Range.prototype.__iterator = function __iterator (type, reverse) { + var size = this.size; + var step = this._step; + var value = reverse ? this._start + (size - 1) * step : this._start; + var i = 0; + return new Iterator(function () { + if (i === size) { + return iteratorDone(); + } + var v = value; + value += reverse ? -step : step; + return iteratorValue(type, reverse ? size - ++i : i++, v); + }); + }; + + Range.prototype.equals = function equals (other) { + return other instanceof Range + ? this._start === other._start && + this._end === other._end && + this._step === other._step + : deepEqual(this, other); + }; + + return Range; +}(IndexedSeq)); + +var EMPTY_RANGE; + +function getIn$1(collection, searchKeyPath, notSetValue) { + var keyPath = coerceKeyPath(searchKeyPath); + var i = 0; + while (i !== keyPath.length) { + collection = get(collection, keyPath[i++], NOT_SET); + if (collection === NOT_SET) { + return notSetValue; + } + } + return collection; +} + +function getIn(searchKeyPath, notSetValue) { + return getIn$1(this, searchKeyPath, notSetValue); +} + +function hasIn$1(collection, keyPath) { + return getIn$1(collection, keyPath, NOT_SET) !== NOT_SET; +} + +function hasIn(searchKeyPath) { + return hasIn$1(this, searchKeyPath); +} + +function toObject() { + assertNotInfinite(this.size); + var object = {}; + this.__iterate(function (v, k) { + object[k] = v; + }); + return object; +} + +// Note: all of these methods are deprecated. +Collection.isIterable = isCollection; +Collection.isKeyed = isKeyed; +Collection.isIndexed = isIndexed; +Collection.isAssociative = isAssociative; +Collection.isOrdered = isOrdered; + +Collection.Iterator = Iterator; + +mixin(Collection, { + // ### Conversion to other types + + toArray: function toArray() { + assertNotInfinite(this.size); + var array = new Array(this.size || 0); + var useTuples = isKeyed(this); + var i = 0; + this.__iterate(function (v, k) { + // Keyed collections produce an array of tuples. + array[i++] = useTuples ? [k, v] : v; + }); + return array; + }, + + toIndexedSeq: function toIndexedSeq() { + return new ToIndexedSequence(this); + }, + + toJS: function toJS$1() { + return toJS(this); + }, + + toKeyedSeq: function toKeyedSeq() { + return new ToKeyedSequence(this, true); + }, + + toMap: function toMap() { + // Use Late Binding here to solve the circular dependency. + return Map(this.toKeyedSeq()); + }, + + toObject: toObject, + + toOrderedMap: function toOrderedMap() { + // Use Late Binding here to solve the circular dependency. + return OrderedMap(this.toKeyedSeq()); + }, + + toOrderedSet: function toOrderedSet() { + // Use Late Binding here to solve the circular dependency. + return OrderedSet(isKeyed(this) ? this.valueSeq() : this); + }, + + toSet: function toSet() { + // Use Late Binding here to solve the circular dependency. + return Set(isKeyed(this) ? this.valueSeq() : this); + }, + + toSetSeq: function toSetSeq() { + return new ToSetSequence(this); + }, + + toSeq: function toSeq() { + return isIndexed(this) + ? this.toIndexedSeq() + : isKeyed(this) + ? this.toKeyedSeq() + : this.toSetSeq(); + }, + + toStack: function toStack() { + // Use Late Binding here to solve the circular dependency. + return Stack(isKeyed(this) ? this.valueSeq() : this); + }, + + toList: function toList() { + // Use Late Binding here to solve the circular dependency. + return List(isKeyed(this) ? this.valueSeq() : this); + }, + + // ### Common JavaScript methods and properties + + toString: function toString() { + return '[Collection]'; + }, + + __toString: function __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: function concat() { + var values = [], len = arguments.length; + while ( len-- ) values[ len ] = arguments[ len ]; + + return reify(this, concatFactory(this, values)); + }, + + includes: function includes(searchValue) { + return this.some(function (value) { return is(value, searchValue); }); + }, + + entries: function entries() { + return this.__iterator(ITERATE_ENTRIES); + }, + + every: function every(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 filter(predicate, context) { + return reify(this, filterFactory(this, predicate, context, true)); + }, + + partition: function partition(predicate, context) { + return partitionFactory(this, predicate, context); + }, + + find: function find(predicate, context, notSetValue) { + var entry = this.findEntry(predicate, context); + return entry ? entry[1] : notSetValue; + }, + + forEach: function forEach(sideEffect, context) { + assertNotInfinite(this.size); + return this.__iterate(context ? sideEffect.bind(context) : sideEffect); + }, + + join: function join(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 keys() { + return this.__iterator(ITERATE_KEYS); + }, + + map: function map(mapper, context) { + return reify(this, mapFactory(this, mapper, context)); + }, + + reduce: function reduce$1(reducer, initialReduction, context) { + return reduce( + this, + reducer, + initialReduction, + context, + arguments.length < 2, + false + ); + }, + + reduceRight: function reduceRight(reducer, initialReduction, context) { + return reduce( + this, + reducer, + initialReduction, + context, + arguments.length < 2, + true + ); + }, + + reverse: function reverse() { + return reify(this, reverseFactory(this, true)); + }, + + slice: function slice(begin, end) { + return reify(this, sliceFactory(this, begin, end, true)); + }, + + some: function some(predicate, context) { + assertNotInfinite(this.size); + var returnValue = false; + this.__iterate(function (v, k, c) { + if (predicate.call(context, v, k, c)) { + returnValue = true; + return false; + } + }); + return returnValue; + }, + + sort: function sort(comparator) { + return reify(this, sortFactory(this, comparator)); + }, + + values: function values() { + return this.__iterator(ITERATE_VALUES); + }, + + // ### More sequential methods + + butLast: function butLast() { + return this.slice(0, -1); + }, + + isEmpty: function isEmpty() { + return this.size !== undefined ? this.size === 0 : !this.some(function () { return true; }); + }, + + count: function count(predicate, context) { + return ensureSize( + predicate ? this.toSeq().filter(predicate, context) : this + ); + }, + + countBy: function countBy(grouper, context) { + return countByFactory(this, grouper, context); + }, + + equals: function equals(other) { + return deepEqual(this, other); + }, + + entrySeq: function entrySeq() { + var collection = this; + if (collection._cache) { + // We cache as an entries array, so we can just return the cache! + return new ArraySeq(collection._cache); + } + var entriesSequence = collection.toSeq().map(entryMapper).toIndexedSeq(); + entriesSequence.fromEntrySeq = function () { return collection.toSeq(); }; + return entriesSequence; + }, + + filterNot: function filterNot(predicate, context) { + return this.filter(not(predicate), context); + }, + + findEntry: function findEntry(predicate, context, notSetValue) { + var found = notSetValue; + this.__iterate(function (v, k, c) { + if (predicate.call(context, v, k, c)) { + found = [k, v]; + return false; + } + }); + return found; + }, + + findKey: function findKey(predicate, context) { + var entry = this.findEntry(predicate, context); + return entry && entry[0]; + }, + + findLast: function findLast(predicate, context, notSetValue) { + return this.toKeyedSeq().reverse().find(predicate, context, notSetValue); + }, + + findLastEntry: function findLastEntry(predicate, context, notSetValue) { + return this.toKeyedSeq() + .reverse() + .findEntry(predicate, context, notSetValue); + }, + + findLastKey: function findLastKey(predicate, context) { + return this.toKeyedSeq().reverse().findKey(predicate, context); + }, + + first: function first(notSetValue) { + return this.find(returnTrue, null, notSetValue); + }, + + flatMap: function flatMap(mapper, context) { + return reify(this, flatMapFactory(this, mapper, context)); + }, + + flatten: function flatten(depth) { + return reify(this, flattenFactory(this, depth, true)); + }, + + fromEntrySeq: function fromEntrySeq() { + return new FromEntriesSequence(this); + }, + + get: function get(searchKey, notSetValue) { + return this.find(function (_, key) { return is(key, searchKey); }, undefined, notSetValue); + }, + + getIn: getIn, + + groupBy: function groupBy(grouper, context) { + return groupByFactory(this, grouper, context); + }, + + has: function has(searchKey) { + return this.get(searchKey, NOT_SET) !== NOT_SET; + }, + + hasIn: hasIn, + + isSubset: function isSubset(iter) { + iter = typeof iter.includes === 'function' ? iter : Collection(iter); + return this.every(function (value) { return iter.includes(value); }); + }, + + isSuperset: function isSuperset(iter) { + iter = typeof iter.isSubset === 'function' ? iter : Collection(iter); + return iter.isSubset(this); + }, + + keyOf: function keyOf(searchValue) { + return this.findKey(function (value) { return is(value, searchValue); }); + }, + + keySeq: function keySeq() { + return this.toSeq().map(keyMapper).toIndexedSeq(); + }, + + last: function last(notSetValue) { + return this.toSeq().reverse().first(notSetValue); + }, + + lastKeyOf: function lastKeyOf(searchValue) { + return this.toKeyedSeq().reverse().keyOf(searchValue); + }, + + max: function max(comparator) { + return maxFactory(this, comparator); + }, + + maxBy: function maxBy(mapper, comparator) { + return maxFactory(this, comparator, mapper); + }, + + min: function min(comparator) { + return maxFactory( + this, + comparator ? neg(comparator) : defaultNegComparator + ); + }, + + minBy: function minBy(mapper, comparator) { + return maxFactory( + this, + comparator ? neg(comparator) : defaultNegComparator, + mapper + ); + }, + + rest: function rest() { + return this.slice(1); + }, + + skip: function skip(amount) { + return amount === 0 ? this : this.slice(Math.max(0, amount)); + }, + + skipLast: function skipLast(amount) { + return amount === 0 ? this : this.slice(0, -Math.max(0, amount)); + }, + + skipWhile: function skipWhile(predicate, context) { + return reify(this, skipWhileFactory(this, predicate, context, true)); + }, + + skipUntil: function skipUntil(predicate, context) { + return this.skipWhile(not(predicate), context); + }, + + sortBy: function sortBy(mapper, comparator) { + return reify(this, sortFactory(this, comparator, mapper)); + }, + + take: function take(amount) { + return this.slice(0, Math.max(0, amount)); + }, + + takeLast: function takeLast(amount) { + return this.slice(-Math.max(0, amount)); + }, + + takeWhile: function takeWhile(predicate, context) { + return reify(this, takeWhileFactory(this, predicate, context)); + }, + + takeUntil: function takeUntil(predicate, context) { + return this.takeWhile(not(predicate), context); + }, + + update: function update(fn) { + return fn(this); + }, + + valueSeq: function valueSeq() { + return this.toIndexedSeq(); + }, + + // ### Hashable Object + + hashCode: function hashCode() { + return this.__hash || (this.__hash = hashCollection(this)); + }, + + // ### Internal + + // abstract __iterate(fn, reverse) + + // abstract __iterator(type, reverse) +}); + +var 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: function flip() { + return reify(this, flipFactory(this)); + }, + + mapEntries: function mapEntries(mapper, context) { + var this$1$1 = this; + + var iterations = 0; + return reify( + this, + this.toSeq() + .map(function (v, k) { return mapper.call(context, [k, v], iterations++, this$1$1); }) + .fromEntrySeq() + ); + }, + + mapKeys: function mapKeys(mapper, context) { + var this$1$1 = this; + + return reify( + this, + this.toSeq() + .flip() + .map(function (k, v) { return mapper.call(context, k, v, this$1$1); }) + .flip() + ); + }, +}); + +var KeyedCollectionPrototype = KeyedCollection.prototype; +KeyedCollectionPrototype[IS_KEYED_SYMBOL] = true; +KeyedCollectionPrototype[ITERATOR_SYMBOL] = CollectionPrototype.entries; +KeyedCollectionPrototype.toJSON = toObject; +KeyedCollectionPrototype.__toStringMapper = function (v, k) { return quoteString(k) + ': ' + quoteString(v); }; + +mixin(IndexedCollection, { + // ### Conversion to other types + + toKeyedSeq: function toKeyedSeq() { + return new ToKeyedSequence(this, false); + }, + + // ### ES6 Collection methods (ES6 Array and Map) + + filter: function filter(predicate, context) { + return reify(this, filterFactory(this, predicate, context, false)); + }, + + findIndex: function findIndex(predicate, context) { + var entry = this.findEntry(predicate, context); + return entry ? entry[0] : -1; + }, + + indexOf: function indexOf(searchValue) { + var key = this.keyOf(searchValue); + return key === undefined ? -1 : key; + }, + + lastIndexOf: function lastIndexOf(searchValue) { + var key = this.lastKeyOf(searchValue); + return key === undefined ? -1 : key; + }, + + reverse: function reverse() { + return reify(this, reverseFactory(this, false)); + }, + + slice: function slice(begin, end) { + return reify(this, sliceFactory(this, begin, end, false)); + }, + + splice: function splice(index, removeNum /*, ...values*/) { + var 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); + 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 findLastIndex(predicate, context) { + var entry = this.findLastEntry(predicate, context); + return entry ? entry[0] : -1; + }, + + first: function first(notSetValue) { + return this.get(0, notSetValue); + }, + + flatten: function flatten(depth) { + return reify(this, flattenFactory(this, depth, false)); + }, + + get: function get(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 has(index) { + index = wrapIndex(this, index); + return ( + index >= 0 && + (this.size !== undefined + ? this.size === Infinity || index < this.size + : this.indexOf(index) !== -1) + ); + }, + + interpose: function interpose(separator) { + return reify(this, interposeFactory(this, separator)); + }, + + interleave: function interleave(/*...collections*/) { + var collections = [this].concat(arrCopy(arguments)); + var zipped = zipWithFactory(this.toSeq(), IndexedSeq.of, collections); + var interleaved = zipped.flatten(true); + if (zipped.size) { + interleaved.size = zipped.size * collections.length; + } + return reify(this, interleaved); + }, + + keySeq: function keySeq() { + return Range(0, this.size); + }, + + last: function last(notSetValue) { + return this.get(-1, notSetValue); + }, + + skipWhile: function skipWhile(predicate, context) { + return reify(this, skipWhileFactory(this, predicate, context, false)); + }, + + zip: function zip(/*, ...collections */) { + var collections = [this].concat(arrCopy(arguments)); + return reify(this, zipWithFactory(this, defaultZipper, collections)); + }, + + zipAll: function zipAll(/*, ...collections */) { + var collections = [this].concat(arrCopy(arguments)); + return reify(this, zipWithFactory(this, defaultZipper, collections, true)); + }, + + zipWith: function zipWith(zipper /*, ...collections */) { + var collections = arrCopy(arguments); + collections[0] = this; + return reify(this, zipWithFactory(this, zipper, collections)); + }, +}); + +var IndexedCollectionPrototype = IndexedCollection.prototype; +IndexedCollectionPrototype[IS_INDEXED_SYMBOL] = true; +IndexedCollectionPrototype[IS_ORDERED_SYMBOL] = true; + +mixin(SetCollection, { + // ### ES6 Collection methods (ES6 Array and Map) + + get: function get(value, notSetValue) { + return this.has(value) ? value : notSetValue; + }, + + includes: function includes(value) { + return this.has(value); + }, + + // ### More sequential methods + + keySeq: function keySeq() { + return this.valueSeq(); + }, +}); + +var 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(function (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; + } + var ordered = isOrdered(collection); + var keyed = isKeyed(collection); + var h = ordered ? 1 : 0; + var size = collection.__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 = 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 +} + +var OrderedSet = /*@__PURE__*/(function (Set) { + function OrderedSet(value) { + return value === undefined || value === null + ? emptyOrderedSet() + : isOrderedSet(value) + ? value + : emptyOrderedSet().withMutations(function (set) { + var iter = SetCollection(value); + assertNotInfinite(iter.size); + iter.forEach(function (v) { return set.add(v); }); + }); + } + + if ( Set ) OrderedSet.__proto__ = Set; + OrderedSet.prototype = Object.create( Set && Set.prototype ); + OrderedSet.prototype.constructor = OrderedSet; + + OrderedSet.of = function of (/*...values*/) { + return this(arguments); + }; + + OrderedSet.fromKeys = function fromKeys (value) { + return this(KeyedCollection(value).keySeq()); + }; + + OrderedSet.prototype.toString = function toString () { + return this.__toString('OrderedSet {', '}'); + }; + + return OrderedSet; +}(Set)); + +OrderedSet.isOrderedSet = isOrderedSet; + +var 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); + 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())) + ); +} + +var PairSorting = { + LeftThenRight: -1, + RightThenLeft: +1, +}; + +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.' + ); + } + + 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.' + ); + } +} + +var Record = function Record(defaultValues, name) { + var hasInitialized; + + throwOnInvalidDefaultValues(defaultValues); + + var RecordType = function Record(values) { + var this$1$1 = this; + + if (values instanceof RecordType) { + return values; + } + if (!(this instanceof RecordType)) { + return new RecordType(values); + } + if (!hasInitialized) { + hasInitialized = true; + var keys = Object.keys(defaultValues); + var 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 (var i = 0; i < keys.length; i++) { + var propName = keys[i]; + indices[propName] = i; + if (RecordTypePrototype[propName]) { + /* eslint-disable no-console */ + 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.__ownerID = undefined; + this._values = List().withMutations(function (l) { + l.setSize(this$1$1._keys.length); + KeyedCollection(values).forEach(function (v, k) { + l.set(this$1$1._indices[k], v === this$1$1._defaultValues[k] ? undefined : v); + }); + }); + return this; + }; + + var RecordTypePrototype = (RecordType.prototype = + Object.create(RecordPrototype)); + RecordTypePrototype.constructor = RecordType; + + if (name) { + RecordType.displayName = name; + } + + return RecordType; +}; + +Record.prototype.toString = function toString () { + var str = recordName(this) + ' { '; + var keys = this._keys; + var k; + for (var i = 0, l = keys.length; i !== l; i++) { + k = keys[i]; + str += (i ? ', ' : '') + k + ': ' + quoteString(this.get(k)); + } + return str + ' }'; +}; + +Record.prototype.equals = function equals (other) { + return ( + this === other || + (isRecord(other) && recordSeq(this).equals(recordSeq(other))) + ); +}; + +Record.prototype.hashCode = function hashCode () { + return recordSeq(this).hashCode(); +}; + +// @pragma Access + +Record.prototype.has = function has (k) { + return this._indices.hasOwnProperty(k); +}; + +Record.prototype.get = function get (k, notSetValue) { + if (!this.has(k)) { + return notSetValue; + } + var index = this._indices[k]; + var value = this._values.get(index); + return value === undefined ? this._defaultValues[k] : value; +}; + +// @pragma Modification + +Record.prototype.set = function set (k, v) { + if (this.has(k)) { + var newValues = this._values.set( + this._indices[k], + v === this._defaultValues[k] ? undefined : v + ); + if (newValues !== this._values && !this.__ownerID) { + return makeRecord(this, newValues); + } + } + return this; +}; + +Record.prototype.remove = function remove (k) { + return this.set(k); +}; + +Record.prototype.clear = function clear () { + var newValues = this._values.clear().setSize(this._keys.length); + + return this.__ownerID ? this : makeRecord(this, newValues); +}; + +Record.prototype.wasAltered = function wasAltered () { + return this._values.wasAltered(); +}; + +Record.prototype.toSeq = function toSeq () { + return recordSeq(this); +}; + +Record.prototype.toJS = function toJS$1 () { + return toJS(this); +}; + +Record.prototype.entries = function entries () { + return this.__iterator(ITERATE_ENTRIES); +}; + +Record.prototype.__iterator = function __iterator (type, reverse) { + return recordSeq(this).__iterator(type, reverse); +}; + +Record.prototype.__iterate = function __iterate (fn, reverse) { + return recordSeq(this).__iterate(fn, reverse); +}; + +Record.prototype.__ensureOwner = function __ensureOwner (ownerID) { + if (ownerID === this.__ownerID) { + return this; + } + var newValues = this._values.__ensureOwner(ownerID); + if (!ownerID) { + this.__ownerID = ownerID; + this._values = newValues; + return this; + } + return makeRecord(this, newValues, ownerID); +}; + +Record.isRecord = isRecord; +Record.getDescriptiveName = recordName; +var RecordPrototype = Record.prototype; +RecordPrototype[IS_RECORD_SYMBOL] = true; +RecordPrototype[DELETE] = RecordPrototype.remove; +RecordPrototype.deleteIn = RecordPrototype.removeIn = deleteIn; +RecordPrototype.getIn = getIn; +RecordPrototype.hasIn = CollectionPrototype.hasIn; +RecordPrototype.merge = merge$1; +RecordPrototype.mergeWith = mergeWith$1; +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) { + var record = Object.create(Object.getPrototypeOf(likeRecord)); + record._values = values; + record.__ownerID = ownerID; + return record; +} + +function recordName(record) { + return record.constructor.displayName || record.constructor.name || 'Record'; +} + +function recordSeq(record) { + return keyedSeqFromValue(record._keys.map(function (k) { return [k, record.get(k)]; })); +} + +function setProp(prototype, name) { + try { + 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); + }, + }); + } catch (error) { + // Object.defineProperty failed. Probably IE8. + } +} + +/** + * Returns a lazy Seq of `value` repeated `times` times. When `times` is + * undefined, returns an infinite sequence of `value`. + */ +var Repeat = /*@__PURE__*/(function (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; + } + } + + if ( IndexedSeq ) Repeat.__proto__ = IndexedSeq; + Repeat.prototype = Object.create( IndexedSeq && IndexedSeq.prototype ); + Repeat.prototype.constructor = Repeat; + + Repeat.prototype.toString = function toString () { + if (this.size === 0) { + return 'Repeat []'; + } + return 'Repeat [ ' + this._value + ' ' + this.size + ' times ]'; + }; + + Repeat.prototype.get = function get (index, notSetValue) { + return this.has(index) ? this._value : notSetValue; + }; + + Repeat.prototype.includes = function includes (searchValue) { + return is(this._value, searchValue); + }; + + Repeat.prototype.slice = function slice (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 reverse () { + return this; + }; + + Repeat.prototype.indexOf = function indexOf (searchValue) { + if (is(this._value, searchValue)) { + return 0; + } + return -1; + }; + + Repeat.prototype.lastIndexOf = function lastIndexOf (searchValue) { + if (is(this._value, searchValue)) { + return this.size; + } + return -1; + }; + + Repeat.prototype.__iterate = function __iterate (fn, reverse) { + var size = this.size; + var i = 0; + while (i !== size) { + if (fn(this._value, reverse ? size - ++i : i++, this) === false) { + break; + } + } + return i; + }; + + Repeat.prototype.__iterator = function __iterator (type, reverse) { + var this$1$1 = this; + + var size = this.size; + var i = 0; + return new Iterator(function () { return i === size + ? iteratorDone() + : iteratorValue(type, reverse ? size - ++i : i++, this$1$1._value); } + ); + }; + + Repeat.prototype.equals = function equals (other) { + return other instanceof Repeat + ? is(this._value, other._value) + : deepEqual(other); + }; + + return Repeat; +}(IndexedSeq)); + +var EMPTY_REPEAT; + +function fromJS(value, converter) { + return fromJSWith( + [], + converter || defaultConverter, + value, + '', + converter && converter.length > 2 ? [] : undefined, + { '': value } + ); +} + +function fromJSWith(stack, converter, value, key, keyPath, parentValue) { + if ( + typeof value !== 'string' && + !isImmutable(value) && + (isArrayLike(value) || hasIterator(value) || isPlainObject(value)) + ) { + if (~stack.indexOf(value)) { + throw new TypeError('Cannot convert circular structure to Immutable'); + } + stack.push(value); + keyPath && key !== '' && keyPath.push(key); + var converted = converter.call( + parentValue, + key, + Seq(value).map(function (v, k) { return fromJSWith(stack, converter, v, k, keyPath, value); } + ), + keyPath && keyPath.slice() + ); + stack.pop(); + keyPath && keyPath.pop(); + return converted; + } + return value; +} + +function defaultConverter(k, v) { + // Effectively the opposite of "Collection.toSeq()" + return isIndexed(v) ? v.toList() : isKeyed(v) ? v.toMap() : v.toSet(); +} + +var version = "4.3.5"; + +var Immutable = { + version: version, + + Collection: Collection, + // Note: Iterable is deprecated + Iterable: Collection, + + Seq: Seq, + Map: Map, + OrderedMap: OrderedMap, + List: List, + Stack: Stack, + Set: Set, + OrderedSet: OrderedSet, + PairSorting: PairSorting, + + Record: Record, + Range: Range, + Repeat: Repeat, + + is: is, + fromJS: fromJS, + hash: hash, + + isImmutable: isImmutable, + isCollection: isCollection, + isKeyed: isKeyed, + isIndexed: isIndexed, + isAssociative: isAssociative, + isOrdered: isOrdered, + isValueObject: isValueObject, + isPlainObject: isPlainObject, + isSeq: isSeq, + isList: isList, + isMap: isMap, + isOrderedMap: isOrderedMap, + isStack: isStack, + isSet: isSet, + isOrderedSet: isOrderedSet, + isRecord: isRecord, + + get: get, + getIn: getIn$1, + has: has, + hasIn: hasIn$1, + merge: merge, + mergeDeep: mergeDeep$1, + mergeWith: mergeWith, + mergeDeepWith: mergeDeepWith$1, + remove: remove, + removeIn: removeIn, + set: set, + setIn: setIn$1, + update: update$1, + updateIn: updateIn$1, +}; + +// Note: Iterable is deprecated +var Iterable = Collection; + +export default Immutable; +export { Collection, Iterable, List, Map, OrderedMap, OrderedSet, PairSorting, Range, Record, Repeat, Seq, Set, Stack, fromJS, get, getIn$1 as getIn, has, hasIn$1 as hasIn, hash, is, isAssociative, isCollection, isImmutable, isIndexed, isKeyed, isList, isMap, isOrdered, isOrderedMap, isOrderedSet, isPlainObject, isRecord, isSeq, isSet, isStack, isValueObject, merge, mergeDeep$1 as mergeDeep, mergeDeepWith$1 as mergeDeepWith, mergeWith, remove, removeIn, set, setIn$1 as setIn, update$1 as update, updateIn$1 as updateIn, version }; diff --git a/node_modules/immutable/dist/immutable.js b/node_modules/immutable/dist/immutable.js new file mode 100644 index 0000000..cd1dd8e --- /dev/null +++ b/node_modules/immutable/dist/immutable.js @@ -0,0 +1,6021 @@ +/** + * MIT License + * + * Copyright (c) 2014-present, Lee Byron and other contributors. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : + typeof define === 'function' && define.amd ? define(['exports'], factory) : + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Immutable = {})); +}(this, (function (exports) { 'use strict'; + + 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 &`. + function MakeRef() { + return { value: false }; + } + + function SetRef(ref) { + 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. + function OwnerID() {} + + function ensureSize(iter) { + if (iter.size === undefined) { + iter.size = iter.__iterate(returnTrue); + } + return iter.size; + } + + function wrapIndex(iter, index) { + // 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') { + var 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; + } + + function returnTrue() { + return true; + } + + function wholeSlice(begin, end, size) { + return ( + ((begin === 0 && !isNeg(begin)) || + (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) { + // 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) { + // Account for -0 which is negative, but not less than 0. + return value < 0 || (value === 0 && 1 / value === -Infinity); + } + + var IS_COLLECTION_SYMBOL = '@@__IMMUTABLE_ITERABLE__@@'; + + function isCollection(maybeCollection) { + return Boolean(maybeCollection && maybeCollection[IS_COLLECTION_SYMBOL]); + } + + var IS_KEYED_SYMBOL = '@@__IMMUTABLE_KEYED__@@'; + + function isKeyed(maybeKeyed) { + return Boolean(maybeKeyed && maybeKeyed[IS_KEYED_SYMBOL]); + } + + var IS_INDEXED_SYMBOL = '@@__IMMUTABLE_INDEXED__@@'; + + function isIndexed(maybeIndexed) { + return Boolean(maybeIndexed && maybeIndexed[IS_INDEXED_SYMBOL]); + } + + function isAssociative(maybeAssociative) { + return isKeyed(maybeAssociative) || isIndexed(maybeAssociative); + } + + var Collection = function Collection(value) { + return isCollection(value) ? value : Seq(value); + }; + + var KeyedCollection = /*@__PURE__*/(function (Collection) { + function KeyedCollection(value) { + return isKeyed(value) ? value : KeyedSeq(value); + } + + if ( Collection ) KeyedCollection.__proto__ = Collection; + KeyedCollection.prototype = Object.create( Collection && Collection.prototype ); + KeyedCollection.prototype.constructor = KeyedCollection; + + return KeyedCollection; + }(Collection)); + + var IndexedCollection = /*@__PURE__*/(function (Collection) { + function IndexedCollection(value) { + return isIndexed(value) ? value : IndexedSeq(value); + } + + if ( Collection ) IndexedCollection.__proto__ = Collection; + IndexedCollection.prototype = Object.create( Collection && Collection.prototype ); + IndexedCollection.prototype.constructor = IndexedCollection; + + return IndexedCollection; + }(Collection)); + + var SetCollection = /*@__PURE__*/(function (Collection) { + function SetCollection(value) { + return isCollection(value) && !isAssociative(value) ? value : SetSeq(value); + } + + if ( Collection ) SetCollection.__proto__ = Collection; + SetCollection.prototype = Object.create( Collection && Collection.prototype ); + SetCollection.prototype.constructor = SetCollection; + + return SetCollection; + }(Collection)); + + Collection.Keyed = KeyedCollection; + Collection.Indexed = IndexedCollection; + Collection.Set = SetCollection; + + var IS_SEQ_SYMBOL = '@@__IMMUTABLE_SEQ__@@'; + + function isSeq(maybeSeq) { + return Boolean(maybeSeq && maybeSeq[IS_SEQ_SYMBOL]); + } + + var IS_RECORD_SYMBOL = '@@__IMMUTABLE_RECORD__@@'; + + function isRecord(maybeRecord) { + return Boolean(maybeRecord && maybeRecord[IS_RECORD_SYMBOL]); + } + + function isImmutable(maybeImmutable) { + return isCollection(maybeImmutable) || isRecord(maybeImmutable); + } + + var IS_ORDERED_SYMBOL = '@@__IMMUTABLE_ORDERED__@@'; + + function isOrdered(maybeOrdered) { + return Boolean(maybeOrdered && maybeOrdered[IS_ORDERED_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; + + var Iterator = function Iterator(next) { + this.next = next; + }; + + Iterator.prototype.toString = function toString () { + return '[Iterator]'; + }; + + Iterator.KEYS = ITERATE_KEYS; + Iterator.VALUES = ITERATE_VALUES; + Iterator.ENTRIES = ITERATE_ENTRIES; + + Iterator.prototype.inspect = Iterator.prototype.toSource = function () { + return this.toString(); + }; + 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) { + if (Array.isArray(maybeIterable)) { + // IE11 trick as it does not support `Symbol.iterator` + return true; + } + + 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 isEntriesIterable(maybeIterable) { + var iteratorFn = getIteratorFn(maybeIterable); + return iteratorFn && iteratorFn === maybeIterable.entries; + } + + function isKeysIterable(maybeIterable) { + var iteratorFn = getIteratorFn(maybeIterable); + return iteratorFn && iteratorFn === maybeIterable.keys; + } + + var hasOwnProperty = Object.prototype.hasOwnProperty; + + function isArrayLike(value) { + if (Array.isArray(value) || typeof value === 'string') { + return true; + } + + return ( + value && + typeof value === 'object' && + Number.isInteger(value.length) && + value.length >= 0 && + (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). + value.hasOwnProperty(value.length - 1)) + ); + } + + var Seq = /*@__PURE__*/(function (Collection) { + function Seq(value) { + return value === undefined || value === null + ? emptySequence() + : isImmutable(value) + ? value.toSeq() + : seqFromValue(value); + } + + if ( Collection ) Seq.__proto__ = Collection; + Seq.prototype = Object.create( Collection && Collection.prototype ); + Seq.prototype.constructor = Seq; + + Seq.prototype.toSeq = function toSeq () { + return this; + }; + + Seq.prototype.toString = function toString () { + return this.__toString('Seq {', '}'); + }; + + Seq.prototype.cacheResult = function cacheResult () { + 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 __iterate (fn, reverse) { + var cache = this._cache; + if (cache) { + var size = cache.length; + var i = 0; + while (i !== size) { + var 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) + + Seq.prototype.__iterator = function __iterator (type, reverse) { + var cache = this._cache; + if (cache) { + var size = cache.length; + var i = 0; + return new Iterator(function () { + if (i === size) { + return iteratorDone(); + } + var entry = cache[reverse ? size - ++i : i++]; + return iteratorValue(type, entry[0], entry[1]); + }); + } + return this.__iteratorUncached(type, reverse); + }; + + return Seq; + }(Collection)); + + var KeyedSeq = /*@__PURE__*/(function (Seq) { + function KeyedSeq(value) { + return value === undefined || value === null + ? emptySequence().toKeyedSeq() + : isCollection(value) + ? isKeyed(value) + ? value.toSeq() + : value.fromEntrySeq() + : isRecord(value) + ? value.toSeq() + : keyedSeqFromValue(value); + } + + if ( Seq ) KeyedSeq.__proto__ = Seq; + KeyedSeq.prototype = Object.create( Seq && Seq.prototype ); + KeyedSeq.prototype.constructor = KeyedSeq; + + KeyedSeq.prototype.toKeyedSeq = function toKeyedSeq () { + return this; + }; + + return KeyedSeq; + }(Seq)); + + var IndexedSeq = /*@__PURE__*/(function (Seq) { + function IndexedSeq(value) { + return value === undefined || value === null + ? emptySequence() + : isCollection(value) + ? isKeyed(value) + ? value.entrySeq() + : value.toIndexedSeq() + : isRecord(value) + ? value.toSeq().entrySeq() + : indexedSeqFromValue(value); + } + + if ( Seq ) IndexedSeq.__proto__ = Seq; + IndexedSeq.prototype = Object.create( Seq && Seq.prototype ); + IndexedSeq.prototype.constructor = IndexedSeq; + + IndexedSeq.of = function of (/*...values*/) { + return IndexedSeq(arguments); + }; + + IndexedSeq.prototype.toIndexedSeq = function toIndexedSeq () { + return this; + }; + + IndexedSeq.prototype.toString = function toString () { + return this.__toString('Seq [', ']'); + }; + + return IndexedSeq; + }(Seq)); + + var SetSeq = /*@__PURE__*/(function (Seq) { + function SetSeq(value) { + return ( + isCollection(value) && !isAssociative(value) ? value : IndexedSeq(value) + ).toSetSeq(); + } + + if ( Seq ) SetSeq.__proto__ = Seq; + SetSeq.prototype = Object.create( Seq && Seq.prototype ); + SetSeq.prototype.constructor = SetSeq; + + SetSeq.of = function of (/*...values*/) { + return SetSeq(arguments); + }; + + SetSeq.prototype.toSetSeq = function toSetSeq () { + return this; + }; + + return SetSeq; + }(Seq)); + + Seq.isSeq = isSeq; + Seq.Keyed = KeyedSeq; + Seq.Set = SetSeq; + Seq.Indexed = IndexedSeq; + + Seq.prototype[IS_SEQ_SYMBOL] = true; + + // #pragma Root Sequences + + var ArraySeq = /*@__PURE__*/(function (IndexedSeq) { + function ArraySeq(array) { + this._array = array; + this.size = array.length; + } + + if ( IndexedSeq ) ArraySeq.__proto__ = IndexedSeq; + ArraySeq.prototype = Object.create( IndexedSeq && IndexedSeq.prototype ); + ArraySeq.prototype.constructor = ArraySeq; + + ArraySeq.prototype.get = function get (index, notSetValue) { + return this.has(index) ? this._array[wrapIndex(this, index)] : notSetValue; + }; + + ArraySeq.prototype.__iterate = function __iterate (fn, reverse) { + var array = this._array; + var size = array.length; + var i = 0; + while (i !== size) { + var ii = reverse ? size - ++i : i++; + if (fn(array[ii], ii, this) === false) { + break; + } + } + return i; + }; + + ArraySeq.prototype.__iterator = function __iterator (type, reverse) { + var array = this._array; + var size = array.length; + var i = 0; + return new Iterator(function () { + if (i === size) { + return iteratorDone(); + } + var ii = reverse ? size - ++i : i++; + return iteratorValue(type, ii, array[ii]); + }); + }; + + return ArraySeq; + }(IndexedSeq)); + + var ObjectSeq = /*@__PURE__*/(function (KeyedSeq) { + function ObjectSeq(object) { + var keys = Object.keys(object).concat( + Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(object) : [] + ); + this._object = object; + this._keys = keys; + this.size = keys.length; + } + + if ( KeyedSeq ) ObjectSeq.__proto__ = KeyedSeq; + ObjectSeq.prototype = Object.create( KeyedSeq && KeyedSeq.prototype ); + ObjectSeq.prototype.constructor = ObjectSeq; + + ObjectSeq.prototype.get = function get (key, notSetValue) { + if (notSetValue !== undefined && !this.has(key)) { + return notSetValue; + } + return this._object[key]; + }; + + ObjectSeq.prototype.has = function has (key) { + return hasOwnProperty.call(this._object, key); + }; + + ObjectSeq.prototype.__iterate = function __iterate (fn, reverse) { + var object = this._object; + var keys = this._keys; + var size = keys.length; + var i = 0; + while (i !== size) { + var key = keys[reverse ? size - ++i : i++]; + if (fn(object[key], key, this) === false) { + break; + } + } + return i; + }; + + ObjectSeq.prototype.__iterator = function __iterator (type, reverse) { + var object = this._object; + var keys = this._keys; + var size = keys.length; + var i = 0; + return new Iterator(function () { + if (i === size) { + return iteratorDone(); + } + var key = keys[reverse ? size - ++i : i++]; + return iteratorValue(type, key, object[key]); + }); + }; + + return ObjectSeq; + }(KeyedSeq)); + ObjectSeq.prototype[IS_ORDERED_SYMBOL] = true; + + var CollectionSeq = /*@__PURE__*/(function (IndexedSeq) { + function CollectionSeq(collection) { + this._collection = collection; + this.size = collection.length || collection.size; + } + + if ( IndexedSeq ) CollectionSeq.__proto__ = IndexedSeq; + CollectionSeq.prototype = Object.create( IndexedSeq && IndexedSeq.prototype ); + CollectionSeq.prototype.constructor = CollectionSeq; + + CollectionSeq.prototype.__iterateUncached = function __iterateUncached (fn, reverse) { + if (reverse) { + return this.cacheResult().__iterate(fn, reverse); + } + var collection = this._collection; + var iterator = getIterator(collection); + var iterations = 0; + if (isIterator(iterator)) { + var step; + while (!(step = iterator.next()).done) { + if (fn(step.value, iterations++, this) === false) { + break; + } + } + } + return iterations; + }; + + CollectionSeq.prototype.__iteratorUncached = function __iteratorUncached (type, reverse) { + if (reverse) { + return this.cacheResult().__iterator(type, reverse); + } + var collection = this._collection; + var iterator = getIterator(collection); + if (!isIterator(iterator)) { + return new Iterator(iteratorDone); + } + var iterations = 0; + return new Iterator(function () { + var step = iterator.next(); + return step.done ? step : iteratorValue(type, iterations++, step.value); + }); + }; + + return CollectionSeq; + }(IndexedSeq)); + + // # pragma Helper functions + + var EMPTY_SEQ; + + function emptySequence() { + return EMPTY_SEQ || (EMPTY_SEQ = new ArraySeq([])); + } + + function keyedSeqFromValue(value) { + var seq = maybeIndexedSeqFromValue(value); + if (seq) { + return seq.fromEntrySeq(); + } + if (typeof value === 'object') { + return new ObjectSeq(value); + } + throw new TypeError( + 'Expected Array or collection object of [k, v] entries, or keyed object: ' + + value + ); + } + + function indexedSeqFromValue(value) { + var seq = maybeIndexedSeqFromValue(value); + if (seq) { + return seq; + } + throw new TypeError( + 'Expected Array or collection object of values: ' + value + ); + } + + function seqFromValue(value) { + var 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 maybeIndexedSeqFromValue(value) { + return isArrayLike(value) + ? new ArraySeq(value) + : hasIterator(value) + ? new CollectionSeq(value) + : undefined; + } + + var IS_MAP_SYMBOL = '@@__IMMUTABLE_MAP__@@'; + + function isMap(maybeMap) { + return Boolean(maybeMap && maybeMap[IS_MAP_SYMBOL]); + } + + function isOrderedMap(maybeOrderedMap) { + return isMap(maybeOrderedMap) && isOrdered(maybeOrderedMap); + } + + function isValueObject(maybeValue) { + return Boolean( + maybeValue && + typeof maybeValue.equals === 'function' && + typeof maybeValue.hashCode === 'function' + ); + } + + /** + * 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 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 are Value Objects: they 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; + } + } + return !!( + isValueObject(valueA) && + isValueObject(valueB) && + valueA.equals(valueB) + ); + } + + var imul = + typeof Math.imul === 'function' && Math.imul(0xffffffff, 2) === -2 + ? Math.imul + : function imul(a, b) { + a |= 0; // int + 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); + } + + var defaultValueOf = Object.prototype.valueOf; + + function hash(o) { + if (o == null) { + return hashNullish(o); + } + + if (typeof o.hashCode === 'function') { + // Drop any high bits from accidentally long hash codes. + return smi(o.hashCode(o)); + } + + var v = valueOf(o); + + if (v == null) { + return hashNullish(v); + } + + 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; + } + var hash = n | 0; + if (hash !== n) { + hash ^= n * 0xffffffff; + } + while (n > 0xffffffff) { + n /= 0xffffffff; + hash ^= n; + } + return smi(hash); + } + + function cachedHashString(string) { + var 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] = hashed; + } + return hashed; + } + + // 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 hashed = 0; + for (var ii = 0; ii < string.length; ii++) { + hashed = (31 * hashed + string.charCodeAt(ii)) | 0; + } + return smi(hashed); + } + + function hashSymbol(sym) { + var hashed = symbolMap[sym]; + if (hashed !== undefined) { + return hashed; + } + + hashed = nextHash(); + + symbolMap[sym] = hashed; + + return hashed; + } + + function hashJSObj(obj) { + var hashed; + if (usingWeakMap) { + hashed = weakMap.get(obj); + if (hashed !== undefined) { + return hashed; + } + } + + hashed = obj[UID_HASH_KEY]; + if (hashed !== undefined) { + return hashed; + } + + if (!canDefineProperty) { + hashed = obj.propertyIsEnumerable && obj.propertyIsEnumerable[UID_HASH_KEY]; + if (hashed !== undefined) { + return hashed; + } + + hashed = getIENodeHash(obj); + if (hashed !== undefined) { + return hashed; + } + } + + hashed = nextHash(); + + if (usingWeakMap) { + 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: hashed, + }); + } 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] = 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] = hashed; + } else { + throw new Error('Unable to set a non-enumerable property on object.'); + } + + return hashed; + } + + // 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; + } + } + } + + function valueOf(obj) { + return obj.valueOf !== defaultValueOf && typeof obj.valueOf === 'function' + ? obj.valueOf(obj) + : obj; + } + + function nextHash() { + var nextHash = ++_objHashUID; + if (_objHashUID & 0x40000000) { + _objHashUID = 0; + } + return nextHash; + } + + // If possible, use a WeakMap. + var usingWeakMap = typeof WeakMap === 'function'; + var weakMap; + if (usingWeakMap) { + weakMap = new WeakMap(); + } + + var symbolMap = Object.create(null); + + 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 = {}; + + var ToKeyedSequence = /*@__PURE__*/(function (KeyedSeq) { + function ToKeyedSequence(indexed, useKeys) { + this._iter = indexed; + this._useKeys = useKeys; + this.size = indexed.size; + } + + if ( KeyedSeq ) ToKeyedSequence.__proto__ = KeyedSeq; + ToKeyedSequence.prototype = Object.create( KeyedSeq && KeyedSeq.prototype ); + ToKeyedSequence.prototype.constructor = ToKeyedSequence; + + ToKeyedSequence.prototype.get = function get (key, notSetValue) { + return this._iter.get(key, notSetValue); + }; + + ToKeyedSequence.prototype.has = function has (key) { + return this._iter.has(key); + }; + + ToKeyedSequence.prototype.valueSeq = function valueSeq () { + return this._iter.valueSeq(); + }; + + ToKeyedSequence.prototype.reverse = function reverse () { + var this$1$1 = this; + + var reversedSequence = reverseFactory(this, true); + if (!this._useKeys) { + reversedSequence.valueSeq = function () { return this$1$1._iter.toSeq().reverse(); }; + } + return reversedSequence; + }; + + ToKeyedSequence.prototype.map = function map (mapper, context) { + var this$1$1 = this; + + var mappedSequence = mapFactory(this, mapper, context); + if (!this._useKeys) { + mappedSequence.valueSeq = function () { return this$1$1._iter.toSeq().map(mapper, context); }; + } + return mappedSequence; + }; + + ToKeyedSequence.prototype.__iterate = function __iterate (fn, reverse) { + var this$1$1 = this; + + return this._iter.__iterate(function (v, k) { return fn(v, k, this$1$1); }, reverse); + }; + + ToKeyedSequence.prototype.__iterator = function __iterator (type, reverse) { + return this._iter.__iterator(type, reverse); + }; + + return ToKeyedSequence; + }(KeyedSeq)); + ToKeyedSequence.prototype[IS_ORDERED_SYMBOL] = true; + + var ToIndexedSequence = /*@__PURE__*/(function (IndexedSeq) { + function ToIndexedSequence(iter) { + this._iter = iter; + this.size = iter.size; + } + + if ( IndexedSeq ) ToIndexedSequence.__proto__ = IndexedSeq; + ToIndexedSequence.prototype = Object.create( IndexedSeq && IndexedSeq.prototype ); + ToIndexedSequence.prototype.constructor = ToIndexedSequence; + + ToIndexedSequence.prototype.includes = function includes (value) { + return this._iter.includes(value); + }; + + ToIndexedSequence.prototype.__iterate = function __iterate (fn, reverse) { + var this$1$1 = this; + + var i = 0; + reverse && ensureSize(this); + return this._iter.__iterate( + function (v) { return fn(v, reverse ? this$1$1.size - ++i : i++, this$1$1); }, + reverse + ); + }; + + ToIndexedSequence.prototype.__iterator = function __iterator (type, reverse) { + var this$1$1 = this; + + var iterator = this._iter.__iterator(ITERATE_VALUES, reverse); + var i = 0; + reverse && ensureSize(this); + return new Iterator(function () { + var step = iterator.next(); + return step.done + ? step + : iteratorValue( + type, + reverse ? this$1$1.size - ++i : i++, + step.value, + step + ); + }); + }; + + return ToIndexedSequence; + }(IndexedSeq)); + + var ToSetSequence = /*@__PURE__*/(function (SetSeq) { + function ToSetSequence(iter) { + this._iter = iter; + this.size = iter.size; + } + + if ( SetSeq ) ToSetSequence.__proto__ = SetSeq; + ToSetSequence.prototype = Object.create( SetSeq && SetSeq.prototype ); + ToSetSequence.prototype.constructor = ToSetSequence; + + ToSetSequence.prototype.has = function has (key) { + return this._iter.includes(key); + }; + + ToSetSequence.prototype.__iterate = function __iterate (fn, reverse) { + var this$1$1 = this; + + return this._iter.__iterate(function (v) { return fn(v, v, this$1$1); }, reverse); + }; + + ToSetSequence.prototype.__iterator = function __iterator (type, reverse) { + var iterator = this._iter.__iterator(ITERATE_VALUES, reverse); + return new Iterator(function () { + var step = iterator.next(); + return step.done + ? step + : iteratorValue(type, step.value, step.value, step); + }); + }; + + return ToSetSequence; + }(SetSeq)); + + var FromEntriesSequence = /*@__PURE__*/(function (KeyedSeq) { + function FromEntriesSequence(entries) { + this._iter = entries; + this.size = entries.size; + } + + if ( KeyedSeq ) FromEntriesSequence.__proto__ = KeyedSeq; + FromEntriesSequence.prototype = Object.create( KeyedSeq && KeyedSeq.prototype ); + FromEntriesSequence.prototype.constructor = FromEntriesSequence; + + FromEntriesSequence.prototype.entrySeq = function entrySeq () { + return this._iter.toSeq(); + }; + + FromEntriesSequence.prototype.__iterate = function __iterate (fn, reverse) { + var this$1$1 = 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 indexedCollection = isCollection(entry); + return fn( + indexedCollection ? entry.get(1) : entry[1], + indexedCollection ? entry.get(0) : entry[0], + this$1$1 + ); + } + }, reverse); + }; + + FromEntriesSequence.prototype.__iterator = function __iterator (type, reverse) { + var iterator = this._iter.__iterator(ITERATE_VALUES, reverse); + return new 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 indexedCollection = isCollection(entry); + return iteratorValue( + type, + indexedCollection ? entry.get(0) : entry[0], + indexedCollection ? entry.get(1) : entry[1], + step + ); + } + } + }); + }; + + return FromEntriesSequence; + }(KeyedSeq)); + + ToIndexedSequence.prototype.cacheResult = + ToKeyedSequence.prototype.cacheResult = + ToSetSequence.prototype.cacheResult = + FromEntriesSequence.prototype.cacheResult = + cacheResultThrough; + + function flipFactory(collection) { + var flipSequence = makeSequence(collection); + flipSequence._iter = collection; + flipSequence.size = collection.size; + flipSequence.flip = function () { return collection; }; + flipSequence.reverse = function () { + var reversedSequence = collection.reverse.apply(this); // super.reverse() + reversedSequence.flip = function () { return collection.reverse(); }; + return reversedSequence; + }; + flipSequence.has = function (key) { return collection.includes(key); }; + flipSequence.includes = function (key) { return collection.has(key); }; + flipSequence.cacheResult = cacheResultThrough; + flipSequence.__iterateUncached = function (fn, reverse) { + var this$1$1 = this; + + return collection.__iterate(function (v, k) { return fn(k, v, this$1$1) !== false; }, reverse); + }; + flipSequence.__iteratorUncached = function (type, reverse) { + if (type === ITERATE_ENTRIES) { + var iterator = collection.__iterator(type, reverse); + return new 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 collection.__iterator( + type === ITERATE_VALUES ? ITERATE_KEYS : ITERATE_VALUES, + reverse + ); + }; + return flipSequence; + } + + function mapFactory(collection, mapper, context) { + var mappedSequence = makeSequence(collection); + mappedSequence.size = collection.size; + mappedSequence.has = function (key) { return collection.has(key); }; + mappedSequence.get = function (key, notSetValue) { + var v = collection.get(key, NOT_SET); + return v === NOT_SET + ? notSetValue + : mapper.call(context, v, key, collection); + }; + mappedSequence.__iterateUncached = function (fn, reverse) { + var this$1$1 = this; + + return collection.__iterate( + function (v, k, c) { return fn(mapper.call(context, v, k, c), k, this$1$1) !== false; }, + reverse + ); + }; + mappedSequence.__iteratorUncached = function (type, reverse) { + var iterator = collection.__iterator(ITERATE_ENTRIES, reverse); + return new 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, collection), + step + ); + }); + }; + return mappedSequence; + } + + function reverseFactory(collection, useKeys) { + var this$1$1 = this; + + var reversedSequence = makeSequence(collection); + reversedSequence._iter = collection; + reversedSequence.size = collection.size; + reversedSequence.reverse = function () { return collection; }; + if (collection.flip) { + reversedSequence.flip = function () { + var flipSequence = flipFactory(collection); + flipSequence.reverse = function () { return collection.flip(); }; + return flipSequence; + }; + } + reversedSequence.get = function (key, notSetValue) { return collection.get(useKeys ? key : -1 - key, notSetValue); }; + reversedSequence.has = function (key) { return collection.has(useKeys ? key : -1 - key); }; + reversedSequence.includes = function (value) { return collection.includes(value); }; + reversedSequence.cacheResult = cacheResultThrough; + reversedSequence.__iterate = function (fn, reverse) { + var this$1$1 = this; + + var i = 0; + reverse && ensureSize(collection); + return collection.__iterate( + function (v, k) { return fn(v, useKeys ? k : reverse ? this$1$1.size - ++i : i++, this$1$1); }, + !reverse + ); + }; + reversedSequence.__iterator = function (type, reverse) { + var i = 0; + reverse && ensureSize(collection); + var iterator = collection.__iterator(ITERATE_ENTRIES, !reverse); + return new Iterator(function () { + var step = iterator.next(); + if (step.done) { + return step; + } + var entry = step.value; + return iteratorValue( + type, + useKeys ? entry[0] : reverse ? this$1$1.size - ++i : i++, + entry[1], + step + ); + }); + }; + return reversedSequence; + } + + function filterFactory(collection, predicate, context, useKeys) { + var filterSequence = makeSequence(collection); + if (useKeys) { + filterSequence.has = function (key) { + var v = collection.get(key, NOT_SET); + return v !== NOT_SET && !!predicate.call(context, v, key, collection); + }; + filterSequence.get = function (key, notSetValue) { + var v = collection.get(key, NOT_SET); + return v !== NOT_SET && predicate.call(context, v, key, collection) + ? v + : notSetValue; + }; + } + filterSequence.__iterateUncached = function (fn, reverse) { + var this$1$1 = this; + + var iterations = 0; + collection.__iterate(function (v, k, c) { + if (predicate.call(context, v, k, c)) { + iterations++; + return fn(v, useKeys ? k : iterations - 1, this$1$1); + } + }, reverse); + return iterations; + }; + filterSequence.__iteratorUncached = function (type, reverse) { + var iterator = collection.__iterator(ITERATE_ENTRIES, reverse); + var iterations = 0; + return new 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, collection)) { + return iteratorValue(type, useKeys ? key : iterations++, value, step); + } + } + }); + }; + return filterSequence; + } + + function countByFactory(collection, grouper, context) { + var groups = Map().asMutable(); + collection.__iterate(function (v, k) { + groups.update(grouper.call(context, v, k, collection), 0, function (a) { return a + 1; }); + }); + return groups.asImmutable(); + } + + function groupByFactory(collection, grouper, context) { + var isKeyedIter = isKeyed(collection); + var groups = (isOrdered(collection) ? OrderedMap() : Map()).asMutable(); + collection.__iterate(function (v, k) { + groups.update( + grouper.call(context, v, k, collection), + function (a) { return ((a = a || []), a.push(isKeyedIter ? [k, v] : v), a); } + ); + }); + var coerce = collectionClass(collection); + return groups.map(function (arr) { return reify(collection, coerce(arr)); }).asImmutable(); + } + + function partitionFactory(collection, predicate, context) { + var isKeyedIter = isKeyed(collection); + var groups = [[], []]; + collection.__iterate(function (v, k) { + groups[predicate.call(context, v, k, collection) ? 1 : 0].push( + isKeyedIter ? [k, v] : v + ); + }); + var coerce = collectionClass(collection); + return groups.map(function (arr) { return reify(collection, coerce(arr)); }); + } + + function sliceFactory(collection, begin, end, useKeys) { + var originalSize = collection.size; + + if (wholeSlice(begin, end, originalSize)) { + 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 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(collection.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(collection); + + // 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(collection) && sliceSize >= 0) { + sliceSeq.get = function (index, notSetValue) { + index = wrapIndex(this, index); + return index >= 0 && index < sliceSize + ? collection.get(index + resolvedBegin, notSetValue) + : notSetValue; + }; + } + + sliceSeq.__iterateUncached = function (fn, reverse) { + var this$1$1 = this; + + if (sliceSize === 0) { + return 0; + } + if (reverse) { + return this.cacheResult().__iterate(fn, reverse); + } + var skipped = 0; + var isSkipping = true; + var iterations = 0; + collection.__iterate(function (v, k) { + if (!(isSkipping && (isSkipping = skipped++ < resolvedBegin))) { + iterations++; + return ( + fn(v, useKeys ? k : iterations - 1, this$1$1) !== 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. + if (sliceSize === 0) { + return new Iterator(iteratorDone); + } + var iterator = collection.__iterator(type, reverse); + var skipped = 0; + var iterations = 0; + return new Iterator(function () { + while (skipped++ < resolvedBegin) { + iterator.next(); + } + if (++iterations > sliceSize) { + return iteratorDone(); + } + var step = iterator.next(); + if (useKeys || type === ITERATE_VALUES || step.done) { + return step; + } + if (type === ITERATE_KEYS) { + return iteratorValue(type, iterations - 1, undefined, step); + } + return iteratorValue(type, iterations - 1, step.value[1], step); + }); + }; + + return sliceSeq; + } + + function takeWhileFactory(collection, predicate, context) { + var takeSequence = makeSequence(collection); + takeSequence.__iterateUncached = function (fn, reverse) { + var this$1$1 = this; + + if (reverse) { + return this.cacheResult().__iterate(fn, reverse); + } + var iterations = 0; + collection.__iterate( + function (v, k, c) { return predicate.call(context, v, k, c) && ++iterations && fn(v, k, this$1$1); } + ); + return iterations; + }; + takeSequence.__iteratorUncached = function (type, reverse) { + var this$1$1 = this; + + if (reverse) { + return this.cacheResult().__iterator(type, reverse); + } + var iterator = collection.__iterator(ITERATE_ENTRIES, reverse); + var iterating = true; + return new 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$1$1)) { + iterating = false; + return iteratorDone(); + } + return type === ITERATE_ENTRIES ? step : iteratorValue(type, k, v, step); + }); + }; + return takeSequence; + } + + function skipWhileFactory(collection, predicate, context, useKeys) { + var skipSequence = makeSequence(collection); + skipSequence.__iterateUncached = function (fn, reverse) { + var this$1$1 = this; + + if (reverse) { + return this.cacheResult().__iterate(fn, reverse); + } + var isSkipping = true; + var iterations = 0; + collection.__iterate(function (v, k, c) { + if (!(isSkipping && (isSkipping = predicate.call(context, v, k, c)))) { + iterations++; + return fn(v, useKeys ? k : iterations - 1, this$1$1); + } + }); + return iterations; + }; + skipSequence.__iteratorUncached = function (type, reverse) { + var this$1$1 = this; + + if (reverse) { + return this.cacheResult().__iterator(type, reverse); + } + var iterator = collection.__iterator(ITERATE_ENTRIES, reverse); + var skipping = true; + var iterations = 0; + return new Iterator(function () { + var step; + var k; + var v; + do { + step = iterator.next(); + if (step.done) { + if (useKeys || type === ITERATE_VALUES) { + return step; + } + if (type === ITERATE_KEYS) { + return iteratorValue(type, iterations++, undefined, step); + } + 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$1$1)); + } while (skipping); + return type === ITERATE_ENTRIES ? step : iteratorValue(type, k, v, step); + }); + }; + return skipSequence; + } + + function concatFactory(collection, values) { + var isKeyedCollection = isKeyed(collection); + var iters = [collection] + .concat(values) + .map(function (v) { + if (!isCollection(v)) { + v = isKeyedCollection + ? keyedSeqFromValue(v) + : indexedSeqFromValue(Array.isArray(v) ? v : [v]); + } else if (isKeyedCollection) { + v = KeyedCollection(v); + } + return v; + }) + .filter(function (v) { return v.size !== 0; }); + + if (iters.length === 0) { + return collection; + } + + if (iters.length === 1) { + var singleton = iters[0]; + if ( + singleton === collection || + (isKeyedCollection && isKeyed(singleton)) || + (isIndexed(collection) && isIndexed(singleton)) + ) { + return singleton; + } + } + + var concatSeq = new ArraySeq(iters); + if (isKeyedCollection) { + concatSeq = concatSeq.toKeyedSeq(); + } else if (!isIndexed(collection)) { + 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(collection, depth, useKeys) { + var flatSequence = makeSequence(collection); + flatSequence.__iterateUncached = function (fn, reverse) { + if (reverse) { + return this.cacheResult().__iterate(fn, reverse); + } + var iterations = 0; + var stopped = false; + function flatDeep(iter, currentDepth) { + iter.__iterate(function (v, k) { + if ((!depth || currentDepth < depth) && isCollection(v)) { + flatDeep(v, currentDepth + 1); + } else { + iterations++; + if (fn(v, useKeys ? k : iterations - 1, flatSequence) === false) { + stopped = true; + } + } + return !stopped; + }, reverse); + } + flatDeep(collection, 0); + return iterations; + }; + flatSequence.__iteratorUncached = function (type, reverse) { + if (reverse) { + return this.cacheResult().__iterator(type, reverse); + } + var iterator = collection.__iterator(type, reverse); + var stack = []; + var iterations = 0; + return new 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) && isCollection(v)) { + stack.push(iterator); + iterator = v.__iterator(type, reverse); + } else { + return useKeys ? step : iteratorValue(type, iterations++, v, step); + } + } + return iteratorDone(); + }); + }; + return flatSequence; + } + + function flatMapFactory(collection, mapper, context) { + var coerce = collectionClass(collection); + return collection + .toSeq() + .map(function (v, k) { return coerce(mapper.call(context, v, k, collection)); }) + .flatten(true); + } + + function interposeFactory(collection, separator) { + var interposedSequence = makeSequence(collection); + interposedSequence.size = collection.size && collection.size * 2 - 1; + interposedSequence.__iterateUncached = function (fn, reverse) { + var this$1$1 = this; + + var iterations = 0; + collection.__iterate( + function (v) { return (!iterations || fn(separator, iterations++, this$1$1) !== false) && + fn(v, iterations++, this$1$1) !== false; }, + reverse + ); + return iterations; + }; + interposedSequence.__iteratorUncached = function (type, reverse) { + var iterator = collection.__iterator(ITERATE_VALUES, reverse); + var iterations = 0; + var step; + return new 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(collection, comparator, mapper) { + if (!comparator) { + comparator = defaultComparator; + } + var isKeyedCollection = isKeyed(collection); + var index = 0; + var entries = collection + .toSeq() + .map(function (v, k) { return [k, v, index++, mapper ? mapper(v, k, collection) : v]; }) + .valueSeq() + .toArray(); + entries + .sort(function (a, b) { return comparator(a[3], b[3]) || a[2] - b[2]; }) + .forEach( + isKeyedCollection + ? function (v, i) { + entries[i].length = 2; + } + : function (v, i) { + entries[i] = v[1]; + } + ); + return isKeyedCollection + ? KeyedSeq(entries) + : isIndexed(collection) + ? IndexedSeq(entries) + : SetSeq(entries); + } + + function maxFactory(collection, comparator, mapper) { + if (!comparator) { + comparator = defaultComparator; + } + if (mapper) { + var entry = collection + .toSeq() + .map(function (v, k) { return [v, mapper(v, k, collection)]; }) + .reduce(function (a, b) { return (maxCompare(comparator, a[1], b[1]) ? b : a); }); + return entry && entry[0]; + } + return collection.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, zipAll) { + var zipSequence = makeSequence(keyIter); + var sizes = new ArraySeq(iters).map(function (i) { return 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) { + /* 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 = Collection(i)), getIterator(reverse ? i.reverse() : i)); } + ); + var iterations = 0; + var isDone = false; + return new Iterator(function () { + var steps; + if (!isDone) { + steps = iterators.map(function (i) { return i.next(); }); + isDone = zipAll ? steps.every(function (s) { return s.done; }) : 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 iter === seq ? iter : isSeq(iter) ? seq : iter.constructor(seq); + } + + function validateEntry(entry) { + if (entry !== Object(entry)) { + throw new TypeError('Expected [K, V] tuple: ' + entry); + } + } + + function collectionClass(collection) { + return isKeyed(collection) + ? KeyedCollection + : isIndexed(collection) + ? IndexedCollection + : SetCollection; + } + + function makeSequence(collection) { + return Object.create( + (isKeyed(collection) + ? KeyedSeq + : isIndexed(collection) + ? IndexedSeq + : SetSeq + ).prototype + ); + } + + function cacheResultThrough() { + if (this._iter.cacheResult) { + this._iter.cacheResult(); + this.size = this._iter.size; + return 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; + } + + 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 invariant(condition, error) { + if (!condition) { throw new Error(error); } + } + + function assertNotInfinite(size) { + invariant( + size !== Infinity, + 'Cannot perform this action with an infinite size.' + ); + } + + function coerceKeyPath(keyPath) { + 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 + ); + } + + var toString = Object.prototype.toString; + + function isPlainObject(value) { + // 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; + } + + var 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) + var parentProto = proto; + var nextProto = Object.getPrototypeOf(proto); + while (nextProto !== null) { + parentProto = nextProto; + nextProto = Object.getPrototypeOf(parentProto); + } + return parentProto === proto; + } + + /** + * Returns true if the value is a potentially-persistent data structure, either + * provided by Immutable.js or a plain Array or Object. + */ + function isDataStructure(value) { + return ( + typeof value === 'object' && + (isImmutable(value) || Array.isArray(value) || isPlainObject(value)) + ); + } + + function quoteString(value) { + try { + return typeof value === 'string' ? JSON.stringify(value) : String(value); + } catch (_ignoreError) { + return JSON.stringify(value); + } + } + + function has(collection, key) { + return isImmutable(collection) + ? collection.has(key) + : isDataStructure(collection) && hasOwnProperty.call(collection, key); + } + + function get(collection, key, notSetValue) { + return isImmutable(collection) + ? collection.get(key, notSetValue) + : !has(collection, key) + ? notSetValue + : typeof collection.get === 'function' + ? collection.get(key) + : collection[key]; + } + + function shallowCopy(from) { + if (Array.isArray(from)) { + return arrCopy(from); + } + var to = {}; + for (var key in from) { + if (hasOwnProperty.call(from, key)) { + to[key] = from[key]; + } + } + return to; + } + + function remove(collection, key) { + if (!isDataStructure(collection)) { + throw new TypeError( + 'Cannot update non-data-structure value: ' + collection + ); + } + if (isImmutable(collection)) { + if (!collection.remove) { + throw new TypeError( + 'Cannot update immutable value without .remove() method: ' + collection + ); + } + return collection.remove(key); + } + if (!hasOwnProperty.call(collection, key)) { + return collection; + } + var collectionCopy = shallowCopy(collection); + if (Array.isArray(collectionCopy)) { + collectionCopy.splice(key, 1); + } else { + delete collectionCopy[key]; + } + return collectionCopy; + } + + function set(collection, key, value) { + if (!isDataStructure(collection)) { + throw new TypeError( + 'Cannot update non-data-structure value: ' + collection + ); + } + if (isImmutable(collection)) { + if (!collection.set) { + throw new TypeError( + 'Cannot update immutable value without .set() method: ' + collection + ); + } + return collection.set(key, value); + } + if (hasOwnProperty.call(collection, key) && value === collection[key]) { + return collection; + } + var collectionCopy = shallowCopy(collection); + collectionCopy[key] = value; + return collectionCopy; + } + + function updateIn$1(collection, keyPath, notSetValue, updater) { + if (!updater) { + updater = notSetValue; + notSetValue = undefined; + } + var updatedValue = updateInDeeply( + isImmutable(collection), + collection, + coerceKeyPath(keyPath), + 0, + notSetValue, + updater + ); + return updatedValue === NOT_SET ? notSetValue : updatedValue; + } + + function updateInDeeply( + inImmutable, + existing, + keyPath, + i, + notSetValue, + updater + ) { + var wasNotSet = existing === NOT_SET; + if (i === keyPath.length) { + var existingValue = wasNotSet ? notSetValue : existing; + var newValue = updater(existingValue); + return newValue === existingValue ? existing : newValue; + } + if (!wasNotSet && !isDataStructure(existing)) { + throw new TypeError( + 'Cannot update within non-data-structure value in path [' + + keyPath.slice(0, i).map(quoteString) + + ']: ' + + existing + ); + } + var key = keyPath[i]; + var nextExisting = wasNotSet ? NOT_SET : get(existing, key, NOT_SET); + var nextUpdated = updateInDeeply( + nextExisting === NOT_SET ? inImmutable : isImmutable(nextExisting), + nextExisting, + keyPath, + i + 1, + notSetValue, + updater + ); + return nextUpdated === nextExisting + ? existing + : nextUpdated === NOT_SET + ? remove(existing, key) + : set( + wasNotSet ? (inImmutable ? emptyMap() : {}) : existing, + key, + nextUpdated + ); + } + + function setIn$1(collection, keyPath, value) { + return updateIn$1(collection, keyPath, NOT_SET, function () { return value; }); + } + + function setIn(keyPath, v) { + return setIn$1(this, keyPath, v); + } + + function removeIn(collection, keyPath) { + return updateIn$1(collection, keyPath, function () { return NOT_SET; }); + } + + function deleteIn(keyPath) { + return removeIn(this, keyPath); + } + + function update$1(collection, key, notSetValue, updater) { + return updateIn$1(collection, [key], notSetValue, updater); + } + + function update(key, notSetValue, updater) { + return arguments.length === 1 + ? key(this) + : update$1(this, key, notSetValue, updater); + } + + function updateIn(keyPath, notSetValue, updater) { + return updateIn$1(this, keyPath, notSetValue, updater); + } + + function merge$1() { + var iters = [], len = arguments.length; + while ( len-- ) iters[ len ] = arguments[ len ]; + + return mergeIntoKeyedWith(this, iters); + } + + function mergeWith$1(merger) { + var iters = [], len = arguments.length - 1; + while ( len-- > 0 ) iters[ len ] = arguments[ len + 1 ]; + + if (typeof merger !== 'function') { + throw new TypeError('Invalid merger function: ' + merger); + } + return mergeIntoKeyedWith(this, iters, merger); + } + + function mergeIntoKeyedWith(collection, collections, merger) { + var iters = []; + for (var ii = 0; ii < collections.length; ii++) { + var collection$1 = KeyedCollection(collections[ii]); + if (collection$1.size !== 0) { + iters.push(collection$1); + } + } + if (iters.length === 0) { + return collection; + } + if ( + collection.toSeq().size === 0 && + !collection.__ownerID && + iters.length === 1 + ) { + return collection.constructor(iters[0]); + } + return collection.withMutations(function (collection) { + var mergeIntoCollection = merger + ? function (value, key) { + update$1(collection, key, NOT_SET, function (oldVal) { return oldVal === NOT_SET ? value : merger(oldVal, value, key); } + ); + } + : function (value, key) { + collection.set(key, value); + }; + for (var ii = 0; ii < iters.length; ii++) { + iters[ii].forEach(mergeIntoCollection); + } + }); + } + + function merge(collection) { + var sources = [], len = arguments.length - 1; + while ( len-- > 0 ) sources[ len ] = arguments[ len + 1 ]; + + return mergeWithSources(collection, sources); + } + + function mergeWith(merger, collection) { + var sources = [], len = arguments.length - 2; + while ( len-- > 0 ) sources[ len ] = arguments[ len + 2 ]; + + return mergeWithSources(collection, sources, merger); + } + + function mergeDeep$1(collection) { + var sources = [], len = arguments.length - 1; + while ( len-- > 0 ) sources[ len ] = arguments[ len + 1 ]; + + return mergeDeepWithSources(collection, sources); + } + + function mergeDeepWith$1(merger, collection) { + var sources = [], len = arguments.length - 2; + while ( len-- > 0 ) sources[ len ] = arguments[ len + 2 ]; + + return mergeDeepWithSources(collection, sources, merger); + } + + function mergeDeepWithSources(collection, sources, merger) { + return mergeWithSources(collection, sources, deepMergerWith(merger)); + } + + 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.apply(collection, [ merger ].concat( sources )) + : collection.merge + ? collection.merge.apply(collection, sources) + : collection.concat.apply(collection, sources); + } + var isArray = Array.isArray(collection); + var merged = collection; + var Collection = isArray ? IndexedCollection : KeyedCollection; + var mergeItem = isArray + ? function (value) { + // Copy on write + if (merged === collection) { + merged = shallowCopy(merged); + } + merged.push(value); + } + : function (value, key) { + var hasVal = hasOwnProperty.call(merged, key); + var 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 (var 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) { + var oldSeq = Seq(oldDataStructure); + var 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) + ); + } + + function mergeDeep() { + var iters = [], len = arguments.length; + while ( len-- ) iters[ len ] = arguments[ len ]; + + return mergeDeepWithSources(this, iters); + } + + function mergeDeepWith(merger) { + var iters = [], len = arguments.length - 1; + while ( len-- > 0 ) iters[ len ] = arguments[ len + 1 ]; + + return mergeDeepWithSources(this, iters, merger); + } + + function mergeIn(keyPath) { + var iters = [], len = arguments.length - 1; + while ( len-- > 0 ) iters[ len ] = arguments[ len + 1 ]; + + return updateIn$1(this, keyPath, emptyMap(), function (m) { return mergeWithSources(m, iters); }); + } + + function mergeDeepIn(keyPath) { + var iters = [], len = arguments.length - 1; + while ( len-- > 0 ) iters[ len ] = arguments[ len + 1 ]; + + return updateIn$1(this, keyPath, emptyMap(), function (m) { return mergeDeepWithSources(m, iters); } + ); + } + + function withMutations(fn) { + var mutable = this.asMutable(); + fn(mutable); + return mutable.wasAltered() ? mutable.__ensureOwner(this.__ownerID) : this; + } + + function asMutable() { + return this.__ownerID ? this : this.__ensureOwner(new OwnerID()); + } + + function asImmutable() { + return this.__ensureOwner(); + } + + function wasAltered() { + return this.__altered; + } + + var Map = /*@__PURE__*/(function (KeyedCollection) { + function Map(value) { + return value === undefined || value === null + ? emptyMap() + : isMap(value) && !isOrdered(value) + ? value + : emptyMap().withMutations(function (map) { + var iter = KeyedCollection(value); + assertNotInfinite(iter.size); + iter.forEach(function (v, k) { return map.set(k, v); }); + }); + } + + if ( KeyedCollection ) Map.__proto__ = KeyedCollection; + Map.prototype = Object.create( KeyedCollection && KeyedCollection.prototype ); + Map.prototype.constructor = Map; + + Map.of = function of () { + var keyValues = [], len = arguments.length; + while ( len-- ) keyValues[ len ] = arguments[ len ]; + + return emptyMap().withMutations(function (map) { + for (var i = 0; i < keyValues.length; i += 2) { + if (i + 1 >= keyValues.length) { + throw new Error('Missing value for key: ' + keyValues[i]); + } + map.set(keyValues[i], keyValues[i + 1]); + } + }); + }; + + Map.prototype.toString = function toString () { + return this.__toString('Map {', '}'); + }; + + // @pragma Access + + Map.prototype.get = function get (k, notSetValue) { + return this._root + ? this._root.get(0, undefined, k, notSetValue) + : notSetValue; + }; + + // @pragma Modification + + Map.prototype.set = function set (k, v) { + return updateMap(this, k, v); + }; + + Map.prototype.remove = function remove (k) { + return updateMap(this, k, NOT_SET); + }; + + Map.prototype.deleteAll = function deleteAll (keys) { + var collection = Collection(keys); + + if (collection.size === 0) { + return this; + } + + return this.withMutations(function (map) { + collection.forEach(function (key) { return map.remove(key); }); + }); + }; + + Map.prototype.clear = function clear () { + 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 + + Map.prototype.sort = function sort (comparator) { + // Late binding + return OrderedMap(sortFactory(this, comparator)); + }; + + Map.prototype.sortBy = function sortBy (mapper, comparator) { + // Late binding + return OrderedMap(sortFactory(this, comparator, mapper)); + }; + + Map.prototype.map = function map (mapper, context) { + var this$1$1 = this; + + return this.withMutations(function (map) { + map.forEach(function (value, key) { + map.set(key, mapper.call(context, value, key, this$1$1)); + }); + }); + }; + + // @pragma Mutability + + Map.prototype.__iterator = function __iterator (type, reverse) { + return new MapIterator(this, type, reverse); + }; + + Map.prototype.__iterate = function __iterate (fn, reverse) { + var this$1$1 = this; + + var iterations = 0; + this._root && + this._root.iterate(function (entry) { + iterations++; + return fn(entry[1], entry[0], this$1$1); + }, reverse); + return iterations; + }; + + Map.prototype.__ensureOwner = function __ensureOwner (ownerID) { + if (ownerID === this.__ownerID) { + return this; + } + if (!ownerID) { + if (this.size === 0) { + return emptyMap(); + } + this.__ownerID = ownerID; + this.__altered = false; + return this; + } + return makeMap(this.size, this._root, ownerID, this.__hash); + }; + + return Map; + }(KeyedCollection)); + + Map.isMap = isMap; + + var MapPrototype = Map.prototype; + MapPrototype[IS_MAP_SYMBOL] = true; + MapPrototype[DELETE] = MapPrototype.remove; + MapPrototype.removeAll = MapPrototype.deleteAll; + MapPrototype.setIn = setIn; + MapPrototype.removeIn = MapPrototype.deleteIn = deleteIn; + MapPrototype.update = update; + MapPrototype.updateIn = updateIn; + MapPrototype.merge = MapPrototype.concat = merge$1; + MapPrototype.mergeWith = mergeWith$1; + 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 + + var ArrayMapNode = function ArrayMapNode(ownerID, entries) { + this.ownerID = ownerID; + this.entries = entries; + }; + + ArrayMapNode.prototype.get = function get (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 update (ownerID, shift, keyHash, key, value, didChangeSize, didAlter) { + var removed = value === NOT_SET; + + var entries = this.entries; + var idx = 0; + var len = entries.length; + for (; 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); + }; + + var BitmapIndexedNode = function BitmapIndexedNode(ownerID, bitmap, nodes) { + this.ownerID = ownerID; + this.bitmap = bitmap; + this.nodes = nodes; + }; + + BitmapIndexedNode.prototype.get = function get (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 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; + + 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 + ? setAt(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); + }; + + var HashArrayMapNode = function HashArrayMapNode(ownerID, count, nodes) { + this.ownerID = ownerID; + this.count = count; + this.nodes = nodes; + }; + + HashArrayMapNode.prototype.get = function get (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 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]; + + 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 = setAt(nodes, idx, newNode, isEditable); + + if (isEditable) { + this.count = newCount; + this.nodes = newNodes; + return this; + } + + return new HashArrayMapNode(ownerID, newCount, newNodes); + }; + + var HashCollisionNode = function HashCollisionNode(ownerID, keyHash, entries) { + this.ownerID = ownerID; + this.keyHash = keyHash; + this.entries = entries; + }; + + HashCollisionNode.prototype.get = function get (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 update (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; + var len = entries.length; + for (; 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); + }; + + var ValueNode = function ValueNode(ownerID, keyHash, entry) { + this.ownerID = ownerID; + this.keyHash = keyHash; + this.entry = entry; + }; + + ValueNode.prototype.get = function get (shift, keyHash, key, notSetValue) { + return is(key, this.entry[0]) ? this.entry[1] : notSetValue; + }; + + ValueNode.prototype.update = function update (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; + } + } + }; + + // eslint-disable-next-line no-unused-vars + ValueNode.prototype.iterate = function (fn, reverse) { + return fn(this.entry); + }; + + var MapIterator = /*@__PURE__*/(function (Iterator) { + function MapIterator(map, type, reverse) { + this._type = type; + this._reverse = reverse; + this._stack = map._root && mapIteratorFrame(map._root); + } + + if ( Iterator ) MapIterator.__proto__ = Iterator; + MapIterator.prototype = Object.create( Iterator && Iterator.prototype ); + MapIterator.prototype.constructor = MapIterator; + + MapIterator.prototype.next = function next () { + var type = this._type; + var stack = this._stack; + while (stack) { + var node = stack.node; + var index = stack.index++; + var maxIndex = (void 0); + 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(); + }; + + return MapIterator; + }(Iterator)); + + 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(); + var 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); + } + 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 popCount(x) { + x -= (x >> 1) & 0x55555555; + x = (x & 0x33333333) + ((x >> 2) & 0x33333333); + x = (x + (x >> 4)) & 0x0f0f0f0f; + x += x >> 8; + x += x >> 16; + return x & 0x7f; + } + + function setAt(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; + + var IS_LIST_SYMBOL = '@@__IMMUTABLE_LIST__@@'; + + function isList(maybeList) { + return Boolean(maybeList && maybeList[IS_LIST_SYMBOL]); + } + + var List = /*@__PURE__*/(function (IndexedCollection) { + function List(value) { + var empty = emptyList(); + if (value === undefined || value === null) { + return empty; + } + if (isList(value)) { + return value; + } + var iter = IndexedCollection(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); }); + }); + } + + if ( IndexedCollection ) List.__proto__ = IndexedCollection; + List.prototype = Object.create( IndexedCollection && IndexedCollection.prototype ); + List.prototype.constructor = List; + + List.of = function of (/*...values*/) { + return this(arguments); + }; + + List.prototype.toString = function toString () { + return this.__toString('List [', ']'); + }; + + // @pragma Access + + List.prototype.get = function get (index, notSetValue) { + index = wrapIndex(this, index); + if (index >= 0 && index < this.size) { + index += this._origin; + var node = listNodeFor(this, index); + return node && node.array[index & MASK]; + } + return notSetValue; + }; + + // @pragma Modification + + List.prototype.set = function set (index, value) { + return updateList(this, index, value); + }; + + List.prototype.remove = function remove (index) { + return !this.has(index) + ? this + : index === 0 + ? this.shift() + : index === this.size - 1 + ? this.pop() + : this.splice(index, 1); + }; + + List.prototype.insert = function insert (index, value) { + return this.splice(index, 0, value); + }; + + List.prototype.clear = function clear () { + if (this.size === 0) { + return this; + } + if (this.__ownerID) { + this.size = this._origin = this._capacity = 0; + this._level = SHIFT; + this._root = this._tail = this.__hash = undefined; + this.__altered = true; + return this; + } + return emptyList(); + }; + + List.prototype.push = function push (/*...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 pop () { + return setListBounds(this, 0, -1); + }; + + List.prototype.unshift = function unshift (/*...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 shift () { + return setListBounds(this, 1); + }; + + // @pragma Composition + + List.prototype.concat = function concat (/*...collections*/) { + var arguments$1 = arguments; + + var seqs = []; + for (var i = 0; i < arguments.length; i++) { + var argument = arguments$1[i]; + var 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(function (list) { + seqs.forEach(function (seq) { return seq.forEach(function (value) { return list.push(value); }); }); + }); + }; + + List.prototype.setSize = function setSize (size) { + return setListBounds(this, 0, size); + }; + + List.prototype.map = function map (mapper, context) { + var this$1$1 = this; + + return this.withMutations(function (list) { + for (var i = 0; i < this$1$1.size; i++) { + list.set(i, mapper.call(context, list.get(i), i, this$1$1)); + } + }); + }; + + // @pragma Iteration + + List.prototype.slice = function slice (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 __iterator (type, reverse) { + var index = reverse ? this.size : 0; + var values = iterateList(this, reverse); + return new Iterator(function () { + var value = values(); + return value === DONE + ? iteratorDone() + : iteratorValue(type, reverse ? --index : index++, value); + }); + }; + + List.prototype.__iterate = function __iterate (fn, reverse) { + var index = reverse ? this.size : 0; + var values = iterateList(this, reverse); + var value; + while ((value = values()) !== DONE) { + if (fn(value, reverse ? --index : index++, this) === false) { + break; + } + } + return index; + }; + + List.prototype.__ensureOwner = function __ensureOwner (ownerID) { + if (ownerID === this.__ownerID) { + 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 List; + }(IndexedCollection)); + + List.isList = isList; + + var ListPrototype = List.prototype; + ListPrototype[IS_LIST_SYMBOL] = true; + ListPrototype[DELETE] = ListPrototype.remove; + 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(); + }; + + var VNode = function VNode(array, ownerID) { + this.array = array; + this.ownerID = ownerID; + }; + + // TODO: seems like these methods are very similar + + VNode.prototype.removeBefore = function removeBefore (ownerID, level, index) { + if (index === level ? 1 << level : 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 removeAfter (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 newChild; + if (level > 0) { + var oldChild = this.array[sizeIndex]; + newChild = + oldChild && oldChild.removeAfter(ownerID, level - SHIFT, index); + if (newChild === oldChild && sizeIndex === this.array.length - 1) { + return this; + } + } + + var editable = editableVNode(this, ownerID); + editable.array.splice(sizeIndex + 1); + 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 () { + while (true) { + 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) + ); + } + }; + } + } + + 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 !== index) { + return list; + } + + 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(); + 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; + } + + if (didAlter) { + 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) { + // 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; + } + 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 need 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 need 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 getTailOffset(size) { + return size < SIZE ? 0 : ((size - 1) >>> SHIFT) << SHIFT; + } + + var OrderedMap = /*@__PURE__*/(function (Map) { + function OrderedMap(value) { + return value === undefined || value === null + ? emptyOrderedMap() + : isOrderedMap(value) + ? value + : emptyOrderedMap().withMutations(function (map) { + var iter = KeyedCollection(value); + assertNotInfinite(iter.size); + iter.forEach(function (v, k) { return map.set(k, v); }); + }); + } + + if ( Map ) OrderedMap.__proto__ = Map; + OrderedMap.prototype = Object.create( Map && Map.prototype ); + OrderedMap.prototype.constructor = OrderedMap; + + OrderedMap.of = function of (/*...values*/) { + return this(arguments); + }; + + OrderedMap.prototype.toString = function toString () { + return this.__toString('OrderedMap {', '}'); + }; + + // @pragma Access + + OrderedMap.prototype.get = function get (k, notSetValue) { + var index = this._map.get(k); + return index !== undefined ? this._list.get(index)[1] : notSetValue; + }; + + // @pragma Modification + + OrderedMap.prototype.clear = function clear () { + if (this.size === 0) { + return this; + } + if (this.__ownerID) { + this.size = 0; + this._map.clear(); + this._list.clear(); + this.__altered = true; + return this; + } + return emptyOrderedMap(); + }; + + OrderedMap.prototype.set = function set (k, v) { + return updateOrderedMap(this, k, v); + }; + + OrderedMap.prototype.remove = function remove (k) { + return updateOrderedMap(this, k, NOT_SET); + }; + + OrderedMap.prototype.__iterate = function __iterate (fn, reverse) { + var this$1$1 = this; + + return this._list.__iterate( + function (entry) { return entry && fn(entry[1], entry[0], this$1$1); }, + reverse + ); + }; + + OrderedMap.prototype.__iterator = function __iterator (type, reverse) { + return this._list.fromEntrySeq().__iterator(type, reverse); + }; + + OrderedMap.prototype.__ensureOwner = function __ensureOwner (ownerID) { + if (ownerID === this.__ownerID) { + return this; + } + var newMap = this._map.__ensureOwner(ownerID); + var 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; + } + return makeOrderedMap(newMap, newList, ownerID, this.__hash); + }; + + return OrderedMap; + }(Map)); + + OrderedMap.isOrderedMap = isOrderedMap; + + OrderedMap.prototype[IS_ORDERED_SYMBOL] = 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; + omap.__altered = false; + 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; + omap.__altered = true; + return omap; + } + return makeOrderedMap(newMap, newList); + } + + var IS_STACK_SYMBOL = '@@__IMMUTABLE_STACK__@@'; + + function isStack(maybeStack) { + return Boolean(maybeStack && maybeStack[IS_STACK_SYMBOL]); + } + + var Stack = /*@__PURE__*/(function (IndexedCollection) { + function Stack(value) { + return value === undefined || value === null + ? emptyStack() + : isStack(value) + ? value + : emptyStack().pushAll(value); + } + + if ( IndexedCollection ) Stack.__proto__ = IndexedCollection; + Stack.prototype = Object.create( IndexedCollection && IndexedCollection.prototype ); + Stack.prototype.constructor = Stack; + + Stack.of = function of (/*...values*/) { + return this(arguments); + }; + + Stack.prototype.toString = function toString () { + return this.__toString('Stack [', ']'); + }; + + // @pragma Access + + Stack.prototype.get = function get (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 peek () { + return this._head && this._head.value; + }; + + // @pragma Modification + + Stack.prototype.push = function push (/*...values*/) { + var arguments$1 = arguments; + + 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$1[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 pushAll (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.__iterate(function (value) { + newSize++; + head = { + value: value, + next: head, + }; + }, /* reverse */ true); + 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 pop () { + return this.slice(1); + }; + + Stack.prototype.clear = function clear () { + 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 slice (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 __ensureOwner (ownerID) { + if (ownerID === this.__ownerID) { + return this; + } + if (!ownerID) { + if (this.size === 0) { + return emptyStack(); + } + this.__ownerID = ownerID; + this.__altered = false; + return this; + } + return makeStack(this.size, this._head, ownerID, this.__hash); + }; + + // @pragma Iteration + + Stack.prototype.__iterate = function __iterate (fn, reverse) { + var this$1$1 = this; + + if (reverse) { + return new ArraySeq(this.toArray()).__iterate( + function (v, k) { return fn(v, k, this$1$1); }, + reverse + ); + } + 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 __iterator (type, reverse) { + if (reverse) { + return new ArraySeq(this.toArray()).__iterator(type, reverse); + } + var iterations = 0; + var node = this._head; + return new Iterator(function () { + if (node) { + var value = node.value; + node = node.next; + return iteratorValue(type, iterations++, value); + } + return iteratorDone(); + }); + }; + + return Stack; + }(IndexedCollection)); + + Stack.isStack = isStack; + + var 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); + 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)); + } + + var IS_SET_SYMBOL = '@@__IMMUTABLE_SET__@@'; + + function isSet(maybeSet) { + return Boolean(maybeSet && maybeSet[IS_SET_SYMBOL]); + } + + function isOrderedSet(maybeOrderedSet) { + return isSet(maybeOrderedSet) && isOrdered(maybeOrderedSet); + } + + function deepEqual(a, b) { + if (a === b) { + return true; + } + + if ( + !isCollection(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; + } + + 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; + } + + function toJS(value) { + if (!value || typeof value !== 'object') { + return value; + } + if (!isCollection(value)) { + if (!isDataStructure(value)) { + return value; + } + value = Seq(value); + } + if (isKeyed(value)) { + var result$1 = {}; + value.__iterate(function (v, k) { + result$1[k] = toJS(v); + }); + return result$1; + } + var result = []; + value.__iterate(function (v) { + result.push(toJS(v)); + }); + return result; + } + + var Set = /*@__PURE__*/(function (SetCollection) { + function Set(value) { + return value === undefined || value === null + ? emptySet() + : isSet(value) && !isOrdered(value) + ? value + : emptySet().withMutations(function (set) { + var iter = SetCollection(value); + assertNotInfinite(iter.size); + iter.forEach(function (v) { return set.add(v); }); + }); + } + + if ( SetCollection ) Set.__proto__ = SetCollection; + Set.prototype = Object.create( SetCollection && SetCollection.prototype ); + Set.prototype.constructor = Set; + + Set.of = function of (/*...values*/) { + return this(arguments); + }; + + Set.fromKeys = function fromKeys (value) { + return this(KeyedCollection(value).keySeq()); + }; + + Set.intersect = function intersect (sets) { + sets = Collection(sets).toArray(); + return sets.length + ? SetPrototype.intersect.apply(Set(sets.pop()), sets) + : emptySet(); + }; + + Set.union = function union (sets) { + sets = Collection(sets).toArray(); + return sets.length + ? SetPrototype.union.apply(Set(sets.pop()), sets) + : emptySet(); + }; + + Set.prototype.toString = function toString () { + return this.__toString('Set {', '}'); + }; + + // @pragma Access + + Set.prototype.has = function has (value) { + return this._map.has(value); + }; + + // @pragma Modification + + Set.prototype.add = function add (value) { + return updateSet(this, this._map.set(value, value)); + }; + + Set.prototype.remove = function remove (value) { + return updateSet(this, this._map.remove(value)); + }; + + Set.prototype.clear = function clear () { + return updateSet(this, this._map.clear()); + }; + + // @pragma Composition + + Set.prototype.map = function map (mapper, context) { + var this$1$1 = this; + + // keep track if the set is altered by the map function + var didChanges = false; + + var newMap = updateSet( + this, + this._map.mapEntries(function (ref) { + var v = ref[1]; + + var mapped = mapper.call(context, v, v, this$1$1); + + if (mapped !== v) { + didChanges = true; + } + + return [mapped, mapped]; + }, context) + ); + + return didChanges ? newMap : this; + }; + + Set.prototype.union = function union () { + var iters = [], len = arguments.length; + while ( len-- ) iters[ len ] = arguments[ len ]; + + 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++) { + if (typeof iters[ii] === 'string') { + set.add(iters[ii]); + } else { + SetCollection(iters[ii]).forEach(function (value) { return set.add(value); }); + } + } + }); + }; + + Set.prototype.intersect = function intersect () { + var iters = [], len = arguments.length; + while ( len-- ) iters[ len ] = arguments[ len ]; + + if (iters.length === 0) { + return this; + } + iters = iters.map(function (iter) { return SetCollection(iter); }); + var toRemove = []; + this.forEach(function (value) { + if (!iters.every(function (iter) { return iter.includes(value); })) { + toRemove.push(value); + } + }); + return this.withMutations(function (set) { + toRemove.forEach(function (value) { + set.remove(value); + }); + }); + }; + + Set.prototype.subtract = function subtract () { + var iters = [], len = arguments.length; + while ( len-- ) iters[ len ] = arguments[ len ]; + + if (iters.length === 0) { + return this; + } + iters = iters.map(function (iter) { return SetCollection(iter); }); + var toRemove = []; + this.forEach(function (value) { + if (iters.some(function (iter) { return iter.includes(value); })) { + toRemove.push(value); + } + }); + return this.withMutations(function (set) { + toRemove.forEach(function (value) { + set.remove(value); + }); + }); + }; + + Set.prototype.sort = function sort (comparator) { + // Late binding + return OrderedSet(sortFactory(this, comparator)); + }; + + Set.prototype.sortBy = function sortBy (mapper, comparator) { + // Late binding + return OrderedSet(sortFactory(this, comparator, mapper)); + }; + + Set.prototype.wasAltered = function wasAltered () { + return this._map.wasAltered(); + }; + + Set.prototype.__iterate = function __iterate (fn, reverse) { + var this$1$1 = this; + + return this._map.__iterate(function (k) { return fn(k, k, this$1$1); }, reverse); + }; + + Set.prototype.__iterator = function __iterator (type, reverse) { + return this._map.__iterator(type, reverse); + }; + + Set.prototype.__ensureOwner = function __ensureOwner (ownerID) { + if (ownerID === this.__ownerID) { + return this; + } + var newMap = this._map.__ensureOwner(ownerID); + if (!ownerID) { + if (this.size === 0) { + return this.__empty(); + } + this.__ownerID = ownerID; + this._map = newMap; + return this; + } + return this.__make(newMap, ownerID); + }; + + return Set; + }(SetCollection)); + + Set.isSet = isSet; + + var SetPrototype = Set.prototype; + SetPrototype[IS_SET_SYMBOL] = true; + SetPrototype[DELETE] = SetPrototype.remove; + 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; + + 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())); + } + + /** + * Returns a lazy seq of nums 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 list. + */ + var Range = /*@__PURE__*/(function (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; + } + } + + if ( IndexedSeq ) Range.__proto__ = IndexedSeq; + Range.prototype = Object.create( IndexedSeq && IndexedSeq.prototype ); + Range.prototype.constructor = Range; + + Range.prototype.toString = function toString () { + if (this.size === 0) { + return 'Range []'; + } + return ( + 'Range [ ' + + this._start + + '...' + + this._end + + (this._step !== 1 ? ' by ' + this._step : '') + + ' ]' + ); + }; + + Range.prototype.get = function get (index, notSetValue) { + return this.has(index) + ? this._start + wrapIndex(this, index) * this._step + : notSetValue; + }; + + Range.prototype.includes = function includes (searchValue) { + var possibleIndex = (searchValue - this._start) / this._step; + return ( + possibleIndex >= 0 && + possibleIndex < this.size && + possibleIndex === Math.floor(possibleIndex) + ); + }; + + Range.prototype.slice = function slice (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 indexOf (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 lastIndexOf (searchValue) { + return this.indexOf(searchValue); + }; + + Range.prototype.__iterate = function __iterate (fn, reverse) { + var size = this.size; + var step = this._step; + var value = reverse ? this._start + (size - 1) * step : this._start; + var i = 0; + while (i !== size) { + if (fn(value, reverse ? size - ++i : i++, this) === false) { + break; + } + value += reverse ? -step : step; + } + return i; + }; + + Range.prototype.__iterator = function __iterator (type, reverse) { + var size = this.size; + var step = this._step; + var value = reverse ? this._start + (size - 1) * step : this._start; + var i = 0; + return new Iterator(function () { + if (i === size) { + return iteratorDone(); + } + var v = value; + value += reverse ? -step : step; + return iteratorValue(type, reverse ? size - ++i : i++, v); + }); + }; + + Range.prototype.equals = function equals (other) { + return other instanceof Range + ? this._start === other._start && + this._end === other._end && + this._step === other._step + : deepEqual(this, other); + }; + + return Range; + }(IndexedSeq)); + + var EMPTY_RANGE; + + function getIn$1(collection, searchKeyPath, notSetValue) { + var keyPath = coerceKeyPath(searchKeyPath); + var i = 0; + while (i !== keyPath.length) { + collection = get(collection, keyPath[i++], NOT_SET); + if (collection === NOT_SET) { + return notSetValue; + } + } + return collection; + } + + function getIn(searchKeyPath, notSetValue) { + return getIn$1(this, searchKeyPath, notSetValue); + } + + function hasIn$1(collection, keyPath) { + return getIn$1(collection, keyPath, NOT_SET) !== NOT_SET; + } + + function hasIn(searchKeyPath) { + return hasIn$1(this, searchKeyPath); + } + + function toObject() { + assertNotInfinite(this.size); + var object = {}; + this.__iterate(function (v, k) { + object[k] = v; + }); + return object; + } + + // Note: all of these methods are deprecated. + Collection.isIterable = isCollection; + Collection.isKeyed = isKeyed; + Collection.isIndexed = isIndexed; + Collection.isAssociative = isAssociative; + Collection.isOrdered = isOrdered; + + Collection.Iterator = Iterator; + + mixin(Collection, { + // ### Conversion to other types + + toArray: function toArray() { + assertNotInfinite(this.size); + var array = new Array(this.size || 0); + var useTuples = isKeyed(this); + var i = 0; + this.__iterate(function (v, k) { + // Keyed collections produce an array of tuples. + array[i++] = useTuples ? [k, v] : v; + }); + return array; + }, + + toIndexedSeq: function toIndexedSeq() { + return new ToIndexedSequence(this); + }, + + toJS: function toJS$1() { + return toJS(this); + }, + + toKeyedSeq: function toKeyedSeq() { + return new ToKeyedSequence(this, true); + }, + + toMap: function toMap() { + // Use Late Binding here to solve the circular dependency. + return Map(this.toKeyedSeq()); + }, + + toObject: toObject, + + toOrderedMap: function toOrderedMap() { + // Use Late Binding here to solve the circular dependency. + return OrderedMap(this.toKeyedSeq()); + }, + + toOrderedSet: function toOrderedSet() { + // Use Late Binding here to solve the circular dependency. + return OrderedSet(isKeyed(this) ? this.valueSeq() : this); + }, + + toSet: function toSet() { + // Use Late Binding here to solve the circular dependency. + return Set(isKeyed(this) ? this.valueSeq() : this); + }, + + toSetSeq: function toSetSeq() { + return new ToSetSequence(this); + }, + + toSeq: function toSeq() { + return isIndexed(this) + ? this.toIndexedSeq() + : isKeyed(this) + ? this.toKeyedSeq() + : this.toSetSeq(); + }, + + toStack: function toStack() { + // Use Late Binding here to solve the circular dependency. + return Stack(isKeyed(this) ? this.valueSeq() : this); + }, + + toList: function toList() { + // Use Late Binding here to solve the circular dependency. + return List(isKeyed(this) ? this.valueSeq() : this); + }, + + // ### Common JavaScript methods and properties + + toString: function toString() { + return '[Collection]'; + }, + + __toString: function __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: function concat() { + var values = [], len = arguments.length; + while ( len-- ) values[ len ] = arguments[ len ]; + + return reify(this, concatFactory(this, values)); + }, + + includes: function includes(searchValue) { + return this.some(function (value) { return is(value, searchValue); }); + }, + + entries: function entries() { + return this.__iterator(ITERATE_ENTRIES); + }, + + every: function every(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 filter(predicate, context) { + return reify(this, filterFactory(this, predicate, context, true)); + }, + + partition: function partition(predicate, context) { + return partitionFactory(this, predicate, context); + }, + + find: function find(predicate, context, notSetValue) { + var entry = this.findEntry(predicate, context); + return entry ? entry[1] : notSetValue; + }, + + forEach: function forEach(sideEffect, context) { + assertNotInfinite(this.size); + return this.__iterate(context ? sideEffect.bind(context) : sideEffect); + }, + + join: function join(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 keys() { + return this.__iterator(ITERATE_KEYS); + }, + + map: function map(mapper, context) { + return reify(this, mapFactory(this, mapper, context)); + }, + + reduce: function reduce$1(reducer, initialReduction, context) { + return reduce( + this, + reducer, + initialReduction, + context, + arguments.length < 2, + false + ); + }, + + reduceRight: function reduceRight(reducer, initialReduction, context) { + return reduce( + this, + reducer, + initialReduction, + context, + arguments.length < 2, + true + ); + }, + + reverse: function reverse() { + return reify(this, reverseFactory(this, true)); + }, + + slice: function slice(begin, end) { + return reify(this, sliceFactory(this, begin, end, true)); + }, + + some: function some(predicate, context) { + assertNotInfinite(this.size); + var returnValue = false; + this.__iterate(function (v, k, c) { + if (predicate.call(context, v, k, c)) { + returnValue = true; + return false; + } + }); + return returnValue; + }, + + sort: function sort(comparator) { + return reify(this, sortFactory(this, comparator)); + }, + + values: function values() { + return this.__iterator(ITERATE_VALUES); + }, + + // ### More sequential methods + + butLast: function butLast() { + return this.slice(0, -1); + }, + + isEmpty: function isEmpty() { + return this.size !== undefined ? this.size === 0 : !this.some(function () { return true; }); + }, + + count: function count(predicate, context) { + return ensureSize( + predicate ? this.toSeq().filter(predicate, context) : this + ); + }, + + countBy: function countBy(grouper, context) { + return countByFactory(this, grouper, context); + }, + + equals: function equals(other) { + return deepEqual(this, other); + }, + + entrySeq: function entrySeq() { + var collection = this; + if (collection._cache) { + // We cache as an entries array, so we can just return the cache! + return new ArraySeq(collection._cache); + } + var entriesSequence = collection.toSeq().map(entryMapper).toIndexedSeq(); + entriesSequence.fromEntrySeq = function () { return collection.toSeq(); }; + return entriesSequence; + }, + + filterNot: function filterNot(predicate, context) { + return this.filter(not(predicate), context); + }, + + findEntry: function findEntry(predicate, context, notSetValue) { + var found = notSetValue; + this.__iterate(function (v, k, c) { + if (predicate.call(context, v, k, c)) { + found = [k, v]; + return false; + } + }); + return found; + }, + + findKey: function findKey(predicate, context) { + var entry = this.findEntry(predicate, context); + return entry && entry[0]; + }, + + findLast: function findLast(predicate, context, notSetValue) { + return this.toKeyedSeq().reverse().find(predicate, context, notSetValue); + }, + + findLastEntry: function findLastEntry(predicate, context, notSetValue) { + return this.toKeyedSeq() + .reverse() + .findEntry(predicate, context, notSetValue); + }, + + findLastKey: function findLastKey(predicate, context) { + return this.toKeyedSeq().reverse().findKey(predicate, context); + }, + + first: function first(notSetValue) { + return this.find(returnTrue, null, notSetValue); + }, + + flatMap: function flatMap(mapper, context) { + return reify(this, flatMapFactory(this, mapper, context)); + }, + + flatten: function flatten(depth) { + return reify(this, flattenFactory(this, depth, true)); + }, + + fromEntrySeq: function fromEntrySeq() { + return new FromEntriesSequence(this); + }, + + get: function get(searchKey, notSetValue) { + return this.find(function (_, key) { return is(key, searchKey); }, undefined, notSetValue); + }, + + getIn: getIn, + + groupBy: function groupBy(grouper, context) { + return groupByFactory(this, grouper, context); + }, + + has: function has(searchKey) { + return this.get(searchKey, NOT_SET) !== NOT_SET; + }, + + hasIn: hasIn, + + isSubset: function isSubset(iter) { + iter = typeof iter.includes === 'function' ? iter : Collection(iter); + return this.every(function (value) { return iter.includes(value); }); + }, + + isSuperset: function isSuperset(iter) { + iter = typeof iter.isSubset === 'function' ? iter : Collection(iter); + return iter.isSubset(this); + }, + + keyOf: function keyOf(searchValue) { + return this.findKey(function (value) { return is(value, searchValue); }); + }, + + keySeq: function keySeq() { + return this.toSeq().map(keyMapper).toIndexedSeq(); + }, + + last: function last(notSetValue) { + return this.toSeq().reverse().first(notSetValue); + }, + + lastKeyOf: function lastKeyOf(searchValue) { + return this.toKeyedSeq().reverse().keyOf(searchValue); + }, + + max: function max(comparator) { + return maxFactory(this, comparator); + }, + + maxBy: function maxBy(mapper, comparator) { + return maxFactory(this, comparator, mapper); + }, + + min: function min(comparator) { + return maxFactory( + this, + comparator ? neg(comparator) : defaultNegComparator + ); + }, + + minBy: function minBy(mapper, comparator) { + return maxFactory( + this, + comparator ? neg(comparator) : defaultNegComparator, + mapper + ); + }, + + rest: function rest() { + return this.slice(1); + }, + + skip: function skip(amount) { + return amount === 0 ? this : this.slice(Math.max(0, amount)); + }, + + skipLast: function skipLast(amount) { + return amount === 0 ? this : this.slice(0, -Math.max(0, amount)); + }, + + skipWhile: function skipWhile(predicate, context) { + return reify(this, skipWhileFactory(this, predicate, context, true)); + }, + + skipUntil: function skipUntil(predicate, context) { + return this.skipWhile(not(predicate), context); + }, + + sortBy: function sortBy(mapper, comparator) { + return reify(this, sortFactory(this, comparator, mapper)); + }, + + take: function take(amount) { + return this.slice(0, Math.max(0, amount)); + }, + + takeLast: function takeLast(amount) { + return this.slice(-Math.max(0, amount)); + }, + + takeWhile: function takeWhile(predicate, context) { + return reify(this, takeWhileFactory(this, predicate, context)); + }, + + takeUntil: function takeUntil(predicate, context) { + return this.takeWhile(not(predicate), context); + }, + + update: function update(fn) { + return fn(this); + }, + + valueSeq: function valueSeq() { + return this.toIndexedSeq(); + }, + + // ### Hashable Object + + hashCode: function hashCode() { + return this.__hash || (this.__hash = hashCollection(this)); + }, + + // ### Internal + + // abstract __iterate(fn, reverse) + + // abstract __iterator(type, reverse) + }); + + var 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: function flip() { + return reify(this, flipFactory(this)); + }, + + mapEntries: function mapEntries(mapper, context) { + var this$1$1 = this; + + var iterations = 0; + return reify( + this, + this.toSeq() + .map(function (v, k) { return mapper.call(context, [k, v], iterations++, this$1$1); }) + .fromEntrySeq() + ); + }, + + mapKeys: function mapKeys(mapper, context) { + var this$1$1 = this; + + return reify( + this, + this.toSeq() + .flip() + .map(function (k, v) { return mapper.call(context, k, v, this$1$1); }) + .flip() + ); + }, + }); + + var KeyedCollectionPrototype = KeyedCollection.prototype; + KeyedCollectionPrototype[IS_KEYED_SYMBOL] = true; + KeyedCollectionPrototype[ITERATOR_SYMBOL] = CollectionPrototype.entries; + KeyedCollectionPrototype.toJSON = toObject; + KeyedCollectionPrototype.__toStringMapper = function (v, k) { return quoteString(k) + ': ' + quoteString(v); }; + + mixin(IndexedCollection, { + // ### Conversion to other types + + toKeyedSeq: function toKeyedSeq() { + return new ToKeyedSequence(this, false); + }, + + // ### ES6 Collection methods (ES6 Array and Map) + + filter: function filter(predicate, context) { + return reify(this, filterFactory(this, predicate, context, false)); + }, + + findIndex: function findIndex(predicate, context) { + var entry = this.findEntry(predicate, context); + return entry ? entry[0] : -1; + }, + + indexOf: function indexOf(searchValue) { + var key = this.keyOf(searchValue); + return key === undefined ? -1 : key; + }, + + lastIndexOf: function lastIndexOf(searchValue) { + var key = this.lastKeyOf(searchValue); + return key === undefined ? -1 : key; + }, + + reverse: function reverse() { + return reify(this, reverseFactory(this, false)); + }, + + slice: function slice(begin, end) { + return reify(this, sliceFactory(this, begin, end, false)); + }, + + splice: function splice(index, removeNum /*, ...values*/) { + var 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); + 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 findLastIndex(predicate, context) { + var entry = this.findLastEntry(predicate, context); + return entry ? entry[0] : -1; + }, + + first: function first(notSetValue) { + return this.get(0, notSetValue); + }, + + flatten: function flatten(depth) { + return reify(this, flattenFactory(this, depth, false)); + }, + + get: function get(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 has(index) { + index = wrapIndex(this, index); + return ( + index >= 0 && + (this.size !== undefined + ? this.size === Infinity || index < this.size + : this.indexOf(index) !== -1) + ); + }, + + interpose: function interpose(separator) { + return reify(this, interposeFactory(this, separator)); + }, + + interleave: function interleave(/*...collections*/) { + var collections = [this].concat(arrCopy(arguments)); + var zipped = zipWithFactory(this.toSeq(), IndexedSeq.of, collections); + var interleaved = zipped.flatten(true); + if (zipped.size) { + interleaved.size = zipped.size * collections.length; + } + return reify(this, interleaved); + }, + + keySeq: function keySeq() { + return Range(0, this.size); + }, + + last: function last(notSetValue) { + return this.get(-1, notSetValue); + }, + + skipWhile: function skipWhile(predicate, context) { + return reify(this, skipWhileFactory(this, predicate, context, false)); + }, + + zip: function zip(/*, ...collections */) { + var collections = [this].concat(arrCopy(arguments)); + return reify(this, zipWithFactory(this, defaultZipper, collections)); + }, + + zipAll: function zipAll(/*, ...collections */) { + var collections = [this].concat(arrCopy(arguments)); + return reify(this, zipWithFactory(this, defaultZipper, collections, true)); + }, + + zipWith: function zipWith(zipper /*, ...collections */) { + var collections = arrCopy(arguments); + collections[0] = this; + return reify(this, zipWithFactory(this, zipper, collections)); + }, + }); + + var IndexedCollectionPrototype = IndexedCollection.prototype; + IndexedCollectionPrototype[IS_INDEXED_SYMBOL] = true; + IndexedCollectionPrototype[IS_ORDERED_SYMBOL] = true; + + mixin(SetCollection, { + // ### ES6 Collection methods (ES6 Array and Map) + + get: function get(value, notSetValue) { + return this.has(value) ? value : notSetValue; + }, + + includes: function includes(value) { + return this.has(value); + }, + + // ### More sequential methods + + keySeq: function keySeq() { + return this.valueSeq(); + }, + }); + + var 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(function (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; + } + var ordered = isOrdered(collection); + var keyed = isKeyed(collection); + var h = ordered ? 1 : 0; + var size = collection.__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 = 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 + } + + var OrderedSet = /*@__PURE__*/(function (Set) { + function OrderedSet(value) { + return value === undefined || value === null + ? emptyOrderedSet() + : isOrderedSet(value) + ? value + : emptyOrderedSet().withMutations(function (set) { + var iter = SetCollection(value); + assertNotInfinite(iter.size); + iter.forEach(function (v) { return set.add(v); }); + }); + } + + if ( Set ) OrderedSet.__proto__ = Set; + OrderedSet.prototype = Object.create( Set && Set.prototype ); + OrderedSet.prototype.constructor = OrderedSet; + + OrderedSet.of = function of (/*...values*/) { + return this(arguments); + }; + + OrderedSet.fromKeys = function fromKeys (value) { + return this(KeyedCollection(value).keySeq()); + }; + + OrderedSet.prototype.toString = function toString () { + return this.__toString('OrderedSet {', '}'); + }; + + return OrderedSet; + }(Set)); + + OrderedSet.isOrderedSet = isOrderedSet; + + var 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); + 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())) + ); + } + + var PairSorting = { + LeftThenRight: -1, + RightThenLeft: +1, + }; + + 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.' + ); + } + + 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.' + ); + } + } + + var Record = function Record(defaultValues, name) { + var hasInitialized; + + throwOnInvalidDefaultValues(defaultValues); + + var RecordType = function Record(values) { + var this$1$1 = this; + + if (values instanceof RecordType) { + return values; + } + if (!(this instanceof RecordType)) { + return new RecordType(values); + } + if (!hasInitialized) { + hasInitialized = true; + var keys = Object.keys(defaultValues); + var 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 (var i = 0; i < keys.length; i++) { + var propName = keys[i]; + indices[propName] = i; + if (RecordTypePrototype[propName]) { + /* eslint-disable no-console */ + 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.__ownerID = undefined; + this._values = List().withMutations(function (l) { + l.setSize(this$1$1._keys.length); + KeyedCollection(values).forEach(function (v, k) { + l.set(this$1$1._indices[k], v === this$1$1._defaultValues[k] ? undefined : v); + }); + }); + return this; + }; + + var RecordTypePrototype = (RecordType.prototype = + Object.create(RecordPrototype)); + RecordTypePrototype.constructor = RecordType; + + if (name) { + RecordType.displayName = name; + } + + return RecordType; + }; + + Record.prototype.toString = function toString () { + var str = recordName(this) + ' { '; + var keys = this._keys; + var k; + for (var i = 0, l = keys.length; i !== l; i++) { + k = keys[i]; + str += (i ? ', ' : '') + k + ': ' + quoteString(this.get(k)); + } + return str + ' }'; + }; + + Record.prototype.equals = function equals (other) { + return ( + this === other || + (isRecord(other) && recordSeq(this).equals(recordSeq(other))) + ); + }; + + Record.prototype.hashCode = function hashCode () { + return recordSeq(this).hashCode(); + }; + + // @pragma Access + + Record.prototype.has = function has (k) { + return this._indices.hasOwnProperty(k); + }; + + Record.prototype.get = function get (k, notSetValue) { + if (!this.has(k)) { + return notSetValue; + } + var index = this._indices[k]; + var value = this._values.get(index); + return value === undefined ? this._defaultValues[k] : value; + }; + + // @pragma Modification + + Record.prototype.set = function set (k, v) { + if (this.has(k)) { + var newValues = this._values.set( + this._indices[k], + v === this._defaultValues[k] ? undefined : v + ); + if (newValues !== this._values && !this.__ownerID) { + return makeRecord(this, newValues); + } + } + return this; + }; + + Record.prototype.remove = function remove (k) { + return this.set(k); + }; + + Record.prototype.clear = function clear () { + var newValues = this._values.clear().setSize(this._keys.length); + + return this.__ownerID ? this : makeRecord(this, newValues); + }; + + Record.prototype.wasAltered = function wasAltered () { + return this._values.wasAltered(); + }; + + Record.prototype.toSeq = function toSeq () { + return recordSeq(this); + }; + + Record.prototype.toJS = function toJS$1 () { + return toJS(this); + }; + + Record.prototype.entries = function entries () { + return this.__iterator(ITERATE_ENTRIES); + }; + + Record.prototype.__iterator = function __iterator (type, reverse) { + return recordSeq(this).__iterator(type, reverse); + }; + + Record.prototype.__iterate = function __iterate (fn, reverse) { + return recordSeq(this).__iterate(fn, reverse); + }; + + Record.prototype.__ensureOwner = function __ensureOwner (ownerID) { + if (ownerID === this.__ownerID) { + return this; + } + var newValues = this._values.__ensureOwner(ownerID); + if (!ownerID) { + this.__ownerID = ownerID; + this._values = newValues; + return this; + } + return makeRecord(this, newValues, ownerID); + }; + + Record.isRecord = isRecord; + Record.getDescriptiveName = recordName; + var RecordPrototype = Record.prototype; + RecordPrototype[IS_RECORD_SYMBOL] = true; + RecordPrototype[DELETE] = RecordPrototype.remove; + RecordPrototype.deleteIn = RecordPrototype.removeIn = deleteIn; + RecordPrototype.getIn = getIn; + RecordPrototype.hasIn = CollectionPrototype.hasIn; + RecordPrototype.merge = merge$1; + RecordPrototype.mergeWith = mergeWith$1; + 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) { + var record = Object.create(Object.getPrototypeOf(likeRecord)); + record._values = values; + record.__ownerID = ownerID; + return record; + } + + function recordName(record) { + return record.constructor.displayName || record.constructor.name || 'Record'; + } + + function recordSeq(record) { + return keyedSeqFromValue(record._keys.map(function (k) { return [k, record.get(k)]; })); + } + + function setProp(prototype, name) { + try { + 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); + }, + }); + } catch (error) { + // Object.defineProperty failed. Probably IE8. + } + } + + /** + * Returns a lazy Seq of `value` repeated `times` times. When `times` is + * undefined, returns an infinite sequence of `value`. + */ + var Repeat = /*@__PURE__*/(function (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; + } + } + + if ( IndexedSeq ) Repeat.__proto__ = IndexedSeq; + Repeat.prototype = Object.create( IndexedSeq && IndexedSeq.prototype ); + Repeat.prototype.constructor = Repeat; + + Repeat.prototype.toString = function toString () { + if (this.size === 0) { + return 'Repeat []'; + } + return 'Repeat [ ' + this._value + ' ' + this.size + ' times ]'; + }; + + Repeat.prototype.get = function get (index, notSetValue) { + return this.has(index) ? this._value : notSetValue; + }; + + Repeat.prototype.includes = function includes (searchValue) { + return is(this._value, searchValue); + }; + + Repeat.prototype.slice = function slice (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 reverse () { + return this; + }; + + Repeat.prototype.indexOf = function indexOf (searchValue) { + if (is(this._value, searchValue)) { + return 0; + } + return -1; + }; + + Repeat.prototype.lastIndexOf = function lastIndexOf (searchValue) { + if (is(this._value, searchValue)) { + return this.size; + } + return -1; + }; + + Repeat.prototype.__iterate = function __iterate (fn, reverse) { + var size = this.size; + var i = 0; + while (i !== size) { + if (fn(this._value, reverse ? size - ++i : i++, this) === false) { + break; + } + } + return i; + }; + + Repeat.prototype.__iterator = function __iterator (type, reverse) { + var this$1$1 = this; + + var size = this.size; + var i = 0; + return new Iterator(function () { return i === size + ? iteratorDone() + : iteratorValue(type, reverse ? size - ++i : i++, this$1$1._value); } + ); + }; + + Repeat.prototype.equals = function equals (other) { + return other instanceof Repeat + ? is(this._value, other._value) + : deepEqual(other); + }; + + return Repeat; + }(IndexedSeq)); + + var EMPTY_REPEAT; + + function fromJS(value, converter) { + return fromJSWith( + [], + converter || defaultConverter, + value, + '', + converter && converter.length > 2 ? [] : undefined, + { '': value } + ); + } + + function fromJSWith(stack, converter, value, key, keyPath, parentValue) { + if ( + typeof value !== 'string' && + !isImmutable(value) && + (isArrayLike(value) || hasIterator(value) || isPlainObject(value)) + ) { + if (~stack.indexOf(value)) { + throw new TypeError('Cannot convert circular structure to Immutable'); + } + stack.push(value); + keyPath && key !== '' && keyPath.push(key); + var converted = converter.call( + parentValue, + key, + Seq(value).map(function (v, k) { return fromJSWith(stack, converter, v, k, keyPath, value); } + ), + keyPath && keyPath.slice() + ); + stack.pop(); + keyPath && keyPath.pop(); + return converted; + } + return value; + } + + function defaultConverter(k, v) { + // Effectively the opposite of "Collection.toSeq()" + return isIndexed(v) ? v.toList() : isKeyed(v) ? v.toMap() : v.toSet(); + } + + var version = "4.3.5"; + + var Immutable = { + version: version, + + Collection: Collection, + // Note: Iterable is deprecated + Iterable: Collection, + + Seq: Seq, + Map: Map, + OrderedMap: OrderedMap, + List: List, + Stack: Stack, + Set: Set, + OrderedSet: OrderedSet, + PairSorting: PairSorting, + + Record: Record, + Range: Range, + Repeat: Repeat, + + is: is, + fromJS: fromJS, + hash: hash, + + isImmutable: isImmutable, + isCollection: isCollection, + isKeyed: isKeyed, + isIndexed: isIndexed, + isAssociative: isAssociative, + isOrdered: isOrdered, + isValueObject: isValueObject, + isPlainObject: isPlainObject, + isSeq: isSeq, + isList: isList, + isMap: isMap, + isOrderedMap: isOrderedMap, + isStack: isStack, + isSet: isSet, + isOrderedSet: isOrderedSet, + isRecord: isRecord, + + get: get, + getIn: getIn$1, + has: has, + hasIn: hasIn$1, + merge: merge, + mergeDeep: mergeDeep$1, + mergeWith: mergeWith, + mergeDeepWith: mergeDeepWith$1, + remove: remove, + removeIn: removeIn, + set: set, + setIn: setIn$1, + update: update$1, + updateIn: updateIn$1, + }; + + // Note: Iterable is deprecated + var Iterable = Collection; + + exports.Collection = Collection; + exports.Iterable = Iterable; + exports.List = List; + exports.Map = Map; + exports.OrderedMap = OrderedMap; + exports.OrderedSet = OrderedSet; + exports.PairSorting = PairSorting; + exports.Range = Range; + exports.Record = Record; + exports.Repeat = Repeat; + exports.Seq = Seq; + exports.Set = Set; + exports.Stack = Stack; + exports.default = Immutable; + exports.fromJS = fromJS; + exports.get = get; + exports.getIn = getIn$1; + exports.has = has; + exports.hasIn = hasIn$1; + exports.hash = hash; + exports.is = is; + exports.isAssociative = isAssociative; + exports.isCollection = isCollection; + exports.isImmutable = isImmutable; + exports.isIndexed = isIndexed; + exports.isKeyed = isKeyed; + exports.isList = isList; + exports.isMap = isMap; + exports.isOrdered = isOrdered; + exports.isOrderedMap = isOrderedMap; + exports.isOrderedSet = isOrderedSet; + exports.isPlainObject = isPlainObject; + exports.isRecord = isRecord; + exports.isSeq = isSeq; + exports.isSet = isSet; + exports.isStack = isStack; + exports.isValueObject = isValueObject; + exports.merge = merge; + exports.mergeDeep = mergeDeep$1; + exports.mergeDeepWith = mergeDeepWith$1; + exports.mergeWith = mergeWith; + exports.remove = remove; + exports.removeIn = removeIn; + exports.set = set; + exports.setIn = setIn$1; + exports.update = update$1; + exports.updateIn = updateIn$1; + exports.version = version; + + Object.defineProperty(exports, '__esModule', { value: true }); + +}))); diff --git a/node_modules/immutable/dist/immutable.js.flow b/node_modules/immutable/dist/immutable.js.flow new file mode 100644 index 0000000..67a496f --- /dev/null +++ b/node_modules/immutable/dist/immutable.js.flow @@ -0,0 +1,2412 @@ +/** + * 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(notSetValue?: NSV): V | NSV; + 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?: NSV + ): V | NSV; + findLast( + predicate: (value: V, key: K, iter: this) => mixed, + context?: mixed, + notSetValue?: NSV + ): V | NSV; + + 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/node_modules/immutable/dist/immutable.min.js b/node_modules/immutable/dist/immutable.min.js new file mode 100644 index 0000000..e40a66b --- /dev/null +++ b/node_modules/immutable/dist/immutable.min.js @@ -0,0 +1,55 @@ +/** + * MIT License + * + * Copyright (c) 2014-present, Lee Byron and other contributors. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Immutable={})}(this,function(t){"use strict";var e="delete",d=5,l=1<>>0;if(""+r!==e||4294967295==r)return NaN;e=r}return e<0?c(t)+e:e}function r(){return!0}function p(t,e,r){return(0===t&&!i(t)||void 0!==r&&t<=-r)&&(void 0===e||void 0!==r&&r<=e)}function y(t,e){return n(t,e,0)}function w(t,e){return n(t,e,e)}function n(t,e,r){return void 0===t?r:i(t)?e===1/0?e:0|Math.max(0,e+t):void 0===e||e===t?t:0|Math.min(e,t)}function i(t){return t<0||0===t&&1/t==-1/0}var o="@@__IMMUTABLE_ITERABLE__@@";function f(t){return!(!t||!t[o])}var s="@@__IMMUTABLE_KEYED__@@";function a(t){return!(!t||!t[s])}var S="@@__IMMUTABLE_INDEXED__@@";function z(t){return!(!t||!t[S])}function b(t){return a(t)||z(t)}function I(t){return f(t)?t:F(t)}var O=function(t){function e(t){return a(t)?t:G(t)}return e.__proto__=t,(e.prototype=Object.create(t.prototype)).constructor=e}(I),E=function(t){function e(t){return z(t)?t:Z(t)}return e.__proto__=t,(e.prototype=Object.create(t.prototype)).constructor=e}(I),j=function(t){function e(t){return f(t)&&!b(t)?t:$(t)}return e.__proto__=t,(e.prototype=Object.create(t.prototype)).constructor=e}(I);I.Keyed=O,I.Indexed=E,I.Set=j;var q="@@__IMMUTABLE_SEQ__@@";function M(t){return!(!t||!t[q])}var D="@@__IMMUTABLE_RECORD__@@";function x(t){return!(!t||!t[D])}function A(t){return f(t)||x(t)}var k="@@__IMMUTABLE_ORDERED__@@";function R(t){return!(!t||!t[k])}var U=0,T=1,K=2,L="function"==typeof Symbol&&Symbol.iterator,C="@@iterator",B=L||C,P=function(t){this.next=t};function W(t,e,r,n){r=0===t?e:1===t?r:[e,r];return n?n.value=r:n={value:r,done:!1},n}function N(){return{value:void 0,done:!0}}function H(t){return Array.isArray(t +)||Y(t)}function J(t){return t&&"function"==typeof t.next}function V(t){var e=Y(t);return e&&e.call(t)}function Y(t){t=t&&(L&&t[L]||t[C]);if("function"==typeof t)return t}P.prototype.toString=function(){return"[Iterator]"},P.KEYS=U,P.VALUES=T,P.ENTRIES=K,P.prototype.inspect=P.prototype.toSource=function(){return""+this},P.prototype[B]=function(){return this};var Q=Object.prototype.hasOwnProperty;function X(t){return Array.isArray(t)||"string"==typeof t||t&&"object"==typeof t&&Number.isInteger(t.length)&&0<=t.length&&(0===t.length?1===Object.keys(t).length:t.hasOwnProperty(t.length-1))}var F=function(t){function e(t){return null==t?it():A(t)?t.toSeq():function(t){var e=st(t);if(e)return function(t){var e=Y(t);return e&&e===t.entries}(t)?e.fromEntrySeq():function(t){var e=Y(t);return e&&e===t.keys}(t)?e.toSetSeq():e;if("object"!=typeof t)throw new TypeError("Expected Array or collection object of values, or keyed object: "+t);return new et(t)}(t)}return e.__proto__=t,((e.prototype=Object.create(t.prototype)).constructor=e).prototype.toSeq=function(){return this},e.prototype.toString=function(){return this.__toString("Seq {","}")},e.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},e.prototype.__iterate=function(t,e){var r=this._cache;if(r){for(var n=r.length,i=0;i!==n;){var o=r[e?n-++i:i++];if(!1===t(o[1],o[0],this))break}return i}return this.__iterateUncached(t,e)},e.prototype.__iterator=function(e,r){var n=this._cache;if(n){var i=n.length,o=0;return new P(function(){if(o===i)return N();var t=n[r?i-++o:o++];return W(e,t[0],t[1])})}return this.__iteratorUncached(e,r)},e}(I),G=function(t){function e(t){return null==t?it().toKeyedSeq():f(t)?a(t)?t.toSeq():t.fromEntrySeq():x(t)?t.toSeq():ot(t)}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.toKeyedSeq=function(){return this},e}(F),Z=function(t){function e(t){return null==t?it():f(t)?a(t)?t.entrySeq():t.toIndexedSeq():x(t +)?t.toSeq().entrySeq():ut(t)}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).of=function(){return e(arguments)},e.prototype.toIndexedSeq=function(){return this},e.prototype.toString=function(){return this.__toString("Seq [","]")},e}(F),$=function(t){function e(t){return(f(t)&&!b(t)?t:Z(t)).toSetSeq()}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).of=function(){return e(arguments)},e.prototype.toSetSeq=function(){return this},e}(F);F.isSeq=M,F.Keyed=G,F.Set=$,F.Indexed=Z,F.prototype[q]=!0;var tt=function(t){function e(t){this._array=t,this.size=t.length}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.get=function(t,e){return this.has(t)?this._array[h(this,t)]:e},e.prototype.__iterate=function(t,e){for(var r=this._array,n=r.length,i=0;i!==n;){var o=e?n-++i:i++;if(!1===t(r[o],o,this))break}return i},e.prototype.__iterator=function(e,r){var n=this._array,i=n.length,o=0;return new P(function(){if(o===i)return N();var t=r?i-++o:o++;return W(e,t,n[t])})},e}(Z),et=function(t){function e(t){var e=Object.keys(t).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t):[]);this._object=t,this._keys=e,this.size=e.length}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.get=function(t,e){return void 0===e||this.has(t)?this._object[t]:e},e.prototype.has=function(t){return Q.call(this._object,t)},e.prototype.__iterate=function(t,e){for(var r=this._object,n=this._keys,i=n.length,o=0;o!==i;){var u=n[e?i-++o:o++];if(!1===t(r[u],u,this))break}return o},e.prototype.__iterator=function(e,r){var n=this._object,i=this._keys,o=i.length,u=0;return new P(function(){if(u===o)return N();var t=i[r?o-++u:u++];return W(e,t,n[t])})},e}(G);et.prototype[k]=!0;var rt,nt=function(t){function e(t){this._collection=t,this.size=t.length||t.size}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.__iterateUncached=function(t,e){ +if(e)return this.cacheResult().__iterate(t,e);var r,n=V(this._collection),i=0;if(J(n))for(;!(r=n.next()).done&&!1!==t(r.value,i++,this););return i},e.prototype.__iteratorUncached=function(e,t){if(t)return this.cacheResult().__iterator(e,t);var r=V(this._collection);if(!J(r))return new P(N);var n=0;return new P(function(){var t=r.next();return t.done?t:W(e,n++,t.value)})},e}(Z);function it(){return rt=rt||new tt([])}function ot(t){var e=st(t);if(e)return e.fromEntrySeq();if("object"==typeof t)return new et(t);throw new TypeError("Expected Array or collection object of [k, v] entries, or keyed object: "+t)}function ut(t){var e=st(t);if(e)return e;throw new TypeError("Expected Array or collection object of values: "+t)}function st(t){return X(t)?new tt(t):H(t)?new nt(t):void 0}var at="@@__IMMUTABLE_MAP__@@";function ct(t){return!(!t||!t[at])}function ft(t){return ct(t)&&R(t)}function ht(t){return!(!t||"function"!=typeof t.equals||"function"!=typeof t.hashCode)}function _t(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!=t&&e!=e)return!0;if(!t||!e)return!1}return!!(ht(t)&&ht(e)&&t.equals(e))}var pt="function"==typeof Math.imul&&-2==Math.imul(4294967295,2)?Math.imul:function(t,e){var r=65535&(t|=0),n=65535&(e|=0);return r*n+((t>>>16)*n+r*(e>>>16)<<16>>>0)|0};function lt(t){return t>>>1&1073741824|3221225471&t}var vt=Object.prototype.valueOf;function yt(t){if(null==t)return dt(t);if("function"==typeof t.hashCode)return lt(t.hashCode(t));var e,r=(e=t).valueOf!==vt&&"function"==typeof e.valueOf?e.valueOf(e):e;if(null==r)return dt(r);switch(typeof r){case"boolean":return r?1108378657:1108378656;case"number":return function(t){if(t!=t||t===1/0)return 0;var e=0|t;e!==t&&(e^=4294967295*t);for(;4294967295f)return N();var t=r.next();return a||e===T||t.done?t:W(e,i-1,e===U?void 0:t.value[1],t)})},r}function Bt(e,c,f,h){var t=Xt(e);return t.__iterateUncached=function(n,t){var i=this;if(t)return this.cacheResult().__iterate(n,t);var o=!0,u=0;return e.__iterate(function(t,e,r){if(!(o=o&&c.call(f,t,e,r)))return u++,n(t,h?e:u-1,i)}),u},t.__iteratorUncached=function(i,t){var o=this;if(t)return this.cacheResult().__iterator(i,t);var u=e.__iterator(K,t),s=!0,a=0;return new P(function(){var t;do{if((t=u.next()).done)return h||i===T?t:W(i,a++,i===U?void 0:t.value[1],t);var e=t.value,r=e[0],n=e[1];s=s&&c.call(f,n,r,o)}while(s);return i===K?t:W(i,r,n,t)})},t}function Pt(t,s,a){var c=Xt(t);return c.__iterateUncached=function(i,e){if(e)return this.cacheResult().__iterate(i,e);var o=0,u=!1;return function r(t,n){t.__iterate(function(t,e){return(!s||n>>t)&g),o=this.bitmap;return 0==(o&i)?n:this.nodes[$e(o&i-1)].get(t+d,e,r,n)},Ce.prototype.update=function(t,e,r,n,i,o,u){void 0===r&&(r=yt(n));var s=(0===e?r:r>>>e)&g,a=1<>>=1)u[s]=1&r?e[o++]:void 0;return u[n]=i,new Be(t,o+1,u)}(t,_,c,s,u);if(f&&!u&&2===_.length&&Ge(_[1^h]))return _[1^h];if(f&&u&&1===_.length&&Ge(u))return u;s=t&&t===this.ownerID,a=f?u?c:c^a:c|a,u=f?u?tr(_,h,u,s):function(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;u>>t)&g];return i?i.get(t+d,e,r,n):n},Be.prototype.update=function(t,e,r,n,i,o,u){void 0===r&&(r=yt(n));var s=(0===e?r:r>>>e)&g,a=this.nodes,c=a[s];if(i===v&&!c)return this;o=Fe(c,t,e+d,r,n,i,o,u);if(o===c)return this;u=this.count;if(c){if(!o&&--u>>r)&g,u=(0===r?n:n>>>r)&g,t=o==u?[Ze(t,e,r+d,n,i)]:(i=new We(e,n,i),o>1&1431655765))+(t>>2&858993459))+(t>>4)&252645135,t+=t>>8,127&(t+=t>>16)}function tr(t,e,r,n){t=n?t:Zt(t);return t[e]=r,t}var er=l/4,rr=l/2,nr=l/4,ir="@@__IMMUTABLE_LIST__@@";function or(t){return!(!t||!t[ir])}var ur=function(o){function t(t){var e=pr();if(null==t)return e;if(or(t))return t;var n=o(t),i=n.size;return 0===i?e:(te(i),0=gr(t._capacity)?n=lr(n,t.__ownerID,0,e,r,o):i=lr(i,t.__ownerID,t._level,e,r,o);if(!o.value)return t;if(t.__ownerID)return t._root=i,t._tail=n,t.__hash=void 0,t.__altered=!0,t;return _r(t._origin,t._capacity,t._level,i,n)}(this,t,e)},t.prototype.remove=function(t){return this.has(t)?0===t?this.shift():t===this.size-1?this.pop():this.splice(t,1):this},t.prototype.insert=function(t,e){return this.splice(t,0,e)},t.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=d,this._root=this._tail=this.__hash=void 0,this.__altered=!0,this):pr()},t.prototype.push=function(){var r=arguments,n=this.size;return this.withMutations(function(t){dr(t,0,n+r.length);for(var e=0;e>>e&g;if(this.array.length<=n)return new ar([],t);var i=0==n;if(0>>e&g;if(this.array.length<=n)return this;if(0>e,u=1+(c-r>>e);l>>r&g,a=t&&s=gr(t._capacity))return t._tail;if(e<1<>>n&g],n-=d;return r}}function dr(t,e,r){void 0!==e&&(e|=0),void 0!==r&&(r|=0);var n=t.__ownerID||new m,i=t._origin,o=t._capacity,u=i+e,s=void 0===r?o:r<0?o+r:i+r;if(u===i&&s===o)return t;if(s<=u)return t.clear();for(var a=t._level,c=t._root,f=0;u+f<0;)c=new ar(c&&c.array.length?[void 0,c]:[],n),f+=1<<(a+=d);f&&(u+=f,i+=f,s+=f,o+=f);for(var h=gr(o),_=gr(s);1<>>l&g,p=p.array[v]=vr(p.array[v],n);p.array[h>>>d&g]=e}if(s>>a&g;if(y!=_>>>a&g)break;y&&(f+=(1<>>d<>>-15,461845907),e=pt(e<<13|e>>>-13,5),e=pt((e=(e+3864292196|0)^t)^e>>>16,2246822507),e=lt((e=pt(e^e>>>13,3266489909))^e>>>16)}(t.__iterate(r?e?function(t,e){n=31*n+sn(yt(t),yt(e))|0}:function(t,e){n=n+sn(yt(t),yt(e))|0}:e?function(t){n=31*n+yt(t)|0}:function(t){n=n+yt(t)|0}),n)}(this))}});var Xr=I.prototype;Xr[o]=!0,Xr[B]=Xr.values,Xr.toJSON=Xr.toArray,Xr.__toStringMapper=oe,Xr.inspect=Xr.toSource=function(){return""+this},Xr.chain=Xr.flatMap,Xr.contains=Xr.includes,Ur(O,{flip:function(){return Vt(this,Ut(this))},mapEntries:function(r,n){var i=this,o=0;return Vt(this,this.toSeq().map(function(t,e){return r.call(n,[e,t],o++,i)}).fromEntrySeq())},mapKeys:function(r,n){var i=this;return Vt(this,this.toSeq().flip().map(function(t,e){return r.call(n,t,e,i)}).flip())}});var Fr=O.prototype;Fr[s]=!0,Fr[B]=Xr.entries,Fr.toJSON=Qr,Fr.__toStringMapper=function(t,e){return oe(e)+": "+oe(t)},Ur(E,{toKeyedSeq:function(){return new xt(this,!1)},filter:function(t,e){return Vt(this,Lt(this,t,e,!1))},findIndex:function(t,e){e=this.findEntry(t,e);return e?e[0]:-1},indexOf:function(t){t=this.keyOf(t);return void 0===t?-1:t},lastIndexOf:function(t){t=this.lastKeyOf(t);return void 0===t?-1:t},reverse:function(){return Vt(this,Kt(this,!1))},slice:function(t,e){return Vt(this,Ct(this,t,e,!1))},splice:function(t,e){ +var r=arguments.length;if(e=Math.max(e||0,0),0===r||2===r&&!e)return this;t=y(t,t<0?this.count():this.size);var n=this.slice(0,t);return Vt(this,1===r?n:n.concat(Zt(arguments,2),this.slice(t+e)))},findLastIndex:function(t,e){e=this.findLastEntry(t,e);return e?e[0]:-1},first:function(t){return this.get(0,t)},flatten:function(t){return Vt(this,Pt(this,t,!1))},get:function(r,t){return(r=h(this,r))<0||this.size===1/0||void 0!==this.size&&this.size>2)|0}Zr.has=Xr.includes,Zr.contains=Zr.includes,Zr.keys=Zr.values,Ur(G,Fr),Ur(Z,Gr),Ur($,Zr);var an=function(t){function e(r){return null==r?_n():kr(r)?r:_n().withMutations(function(e){var t=j(r);te(t.size),t.forEach(function(t){return e.add(t)})})}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).of=function(){return this(arguments)},e.fromKeys=function(t){return this(O(t).keySeq())},e.prototype.toString=function(){return this.__toString("OrderedSet {","}")},e}(Kr);an.isOrderedSet=kr;var cn,fn=an.prototype;function hn(t,e){var r=Object.create(fn);return r.size=t?t.size:0,r._map=t,r.__ownerID=e,r}function _n(){return cn=cn||hn(zr())}fn[k]=!0,fn.zip=Gr.zip,fn.zipWith=Gr.zipWith,fn.zipAll=Gr.zipAll,fn.__empty=_n,fn.__make=hn;Zr={LeftThenRight:-1,RightThenLeft:1};Gr=function(u,s){var a;!function(t){if(x(t))throw Error("Can not call `Record` with an immutable Record as default values. Use a plain javascript object instead.");if(A(t))throw Error("Can not call `Record` with an immutable Collection as default values. Use a plain javascript object instead.");if(null===t||"object"!=typeof t)throw Error("Can not call `Record` with a non-object as default values. Use a plain javascript object instead.")}(u);var c=function(t){var n=this;if(t instanceof c)return t;if(!(this instanceof c))return new c(t);if(!a){a=!0;var e=Object.keys(u),r=f._indices={};f._name=s,f._keys=e,f._defaultValues=u;for(var i=0;i true + +isBinaryPath('source/unicorn.txt'); +//=> false +``` +*/ +declare function isBinaryPath(filePath: string): boolean; + +export = isBinaryPath; diff --git a/node_modules/is-binary-path/index.js b/node_modules/is-binary-path/index.js new file mode 100644 index 0000000..ef7548c --- /dev/null +++ b/node_modules/is-binary-path/index.js @@ -0,0 +1,7 @@ +'use strict'; +const path = require('path'); +const binaryExtensions = require('binary-extensions'); + +const extensions = new Set(binaryExtensions); + +module.exports = filePath => extensions.has(path.extname(filePath).slice(1).toLowerCase()); diff --git a/node_modules/is-binary-path/license b/node_modules/is-binary-path/license new file mode 100644 index 0000000..401b1c7 --- /dev/null +++ b/node_modules/is-binary-path/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) 2019 Sindre Sorhus (https://sindresorhus.com), Paul Miller (https://paulmillr.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS 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/node_modules/is-binary-path/package.json b/node_modules/is-binary-path/package.json new file mode 100644 index 0000000..a8d005a --- /dev/null +++ b/node_modules/is-binary-path/package.json @@ -0,0 +1,40 @@ +{ + "name": "is-binary-path", + "version": "2.1.0", + "description": "Check if a file path is a binary file", + "license": "MIT", + "repository": "sindresorhus/is-binary-path", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "binary", + "extensions", + "extension", + "file", + "path", + "check", + "detect", + "is" + ], + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "devDependencies": { + "ava": "^1.4.1", + "tsd": "^0.7.2", + "xo": "^0.24.0" + } +} diff --git a/node_modules/is-binary-path/readme.md b/node_modules/is-binary-path/readme.md new file mode 100644 index 0000000..b4ab025 --- /dev/null +++ b/node_modules/is-binary-path/readme.md @@ -0,0 +1,34 @@ +# is-binary-path [![Build Status](https://travis-ci.org/sindresorhus/is-binary-path.svg?branch=master)](https://travis-ci.org/sindresorhus/is-binary-path) + +> Check if a file path is a binary file + + +## Install + +``` +$ npm install is-binary-path +``` + + +## Usage + +```js +const isBinaryPath = require('is-binary-path'); + +isBinaryPath('source/unicorn.png'); +//=> true + +isBinaryPath('source/unicorn.txt'); +//=> false +``` + + +## Related + +- [binary-extensions](https://github.com/sindresorhus/binary-extensions) - List of binary file extensions +- [is-text-path](https://github.com/sindresorhus/is-text-path) - Check if a filepath is a text file + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com), [Paul Miller](https://paulmillr.com) diff --git a/node_modules/is-extglob/LICENSE b/node_modules/is-extglob/LICENSE new file mode 100644 index 0000000..842218c --- /dev/null +++ b/node_modules/is-extglob/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2016, Jon Schlinkert + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/is-extglob/README.md b/node_modules/is-extglob/README.md new file mode 100644 index 0000000..0416af5 --- /dev/null +++ b/node_modules/is-extglob/README.md @@ -0,0 +1,107 @@ +# is-extglob [![NPM version](https://img.shields.io/npm/v/is-extglob.svg?style=flat)](https://www.npmjs.com/package/is-extglob) [![NPM downloads](https://img.shields.io/npm/dm/is-extglob.svg?style=flat)](https://npmjs.org/package/is-extglob) [![Build Status](https://img.shields.io/travis/jonschlinkert/is-extglob.svg?style=flat)](https://travis-ci.org/jonschlinkert/is-extglob) + +> Returns true if a string has an extglob. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save is-extglob +``` + +## Usage + +```js +var isExtglob = require('is-extglob'); +``` + +**True** + +```js +isExtglob('?(abc)'); +isExtglob('@(abc)'); +isExtglob('!(abc)'); +isExtglob('*(abc)'); +isExtglob('+(abc)'); +``` + +**False** + +Escaped extglobs: + +```js +isExtglob('\\?(abc)'); +isExtglob('\\@(abc)'); +isExtglob('\\!(abc)'); +isExtglob('\\*(abc)'); +isExtglob('\\+(abc)'); +``` + +Everything else... + +```js +isExtglob('foo.js'); +isExtglob('!foo.js'); +isExtglob('*.js'); +isExtglob('**/abc.js'); +isExtglob('abc/*.js'); +isExtglob('abc/(aaa|bbb).js'); +isExtglob('abc/[a-z].js'); +isExtglob('abc/{a,b}.js'); +isExtglob('abc/?.js'); +isExtglob('abc.js'); +isExtglob('abc/def/ghi.js'); +``` + +## History + +**v2.0** + +Adds support for escaping. Escaped exglobs no longer return true. + +## About + +### Related projects + +* [has-glob](https://www.npmjs.com/package/has-glob): Returns `true` if an array has a glob pattern. | [homepage](https://github.com/jonschlinkert/has-glob "Returns `true` if an array has a glob pattern.") +* [is-glob](https://www.npmjs.com/package/is-glob): Returns `true` if the given string looks like a glob pattern or an extglob pattern… [more](https://github.com/jonschlinkert/is-glob) | [homepage](https://github.com/jonschlinkert/is-glob "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a bet") +* [micromatch](https://www.npmjs.com/package/micromatch): Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch. | [homepage](https://github.com/jonschlinkert/micromatch "Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch.") + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Building docs + +_(This document was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme) (a [verb](https://github.com/verbose/verb) generator), please don't edit the readme directly. Any changes to the readme must be made in [.verb.md](.verb.md).)_ + +To generate the readme and API documentation with [verb](https://github.com/verbose/verb): + +```sh +$ npm install -g verb verb-generate-readme && verb +``` + +### Running tests + +Install dev dependencies: + +```sh +$ npm install -d && npm test +``` + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +### License + +Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT license](https://github.com/jonschlinkert/is-extglob/blob/master/LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.1.31, on October 12, 2016._ \ No newline at end of file diff --git a/node_modules/is-extglob/index.js b/node_modules/is-extglob/index.js new file mode 100644 index 0000000..c1d986f --- /dev/null +++ b/node_modules/is-extglob/index.js @@ -0,0 +1,20 @@ +/*! + * is-extglob + * + * Copyright (c) 2014-2016, Jon Schlinkert. + * Licensed under the MIT License. + */ + +module.exports = function isExtglob(str) { + if (typeof str !== 'string' || str === '') { + return false; + } + + var match; + while ((match = /(\\).|([@?!+*]\(.*\))/g.exec(str))) { + if (match[2]) return true; + str = str.slice(match.index + match[0].length); + } + + return false; +}; diff --git a/node_modules/is-extglob/package.json b/node_modules/is-extglob/package.json new file mode 100644 index 0000000..7a90836 --- /dev/null +++ b/node_modules/is-extglob/package.json @@ -0,0 +1,69 @@ +{ + "name": "is-extglob", + "description": "Returns true if a string has an extglob.", + "version": "2.1.1", + "homepage": "https://github.com/jonschlinkert/is-extglob", + "author": "Jon Schlinkert (https://github.com/jonschlinkert)", + "repository": "jonschlinkert/is-extglob", + "bugs": { + "url": "https://github.com/jonschlinkert/is-extglob/issues" + }, + "license": "MIT", + "files": [ + "index.js" + ], + "main": "index.js", + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "mocha" + }, + "devDependencies": { + "gulp-format-md": "^0.1.10", + "mocha": "^3.0.2" + }, + "keywords": [ + "bash", + "braces", + "check", + "exec", + "expression", + "extglob", + "glob", + "globbing", + "globstar", + "is", + "match", + "matches", + "pattern", + "regex", + "regular", + "string", + "test" + ], + "verb": { + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "related": { + "list": [ + "has-glob", + "is-glob", + "micromatch" + ] + }, + "reflinks": [ + "verb", + "verb-generate-readme" + ], + "lint": { + "reflinks": true + } + } +} diff --git a/node_modules/is-glob/LICENSE b/node_modules/is-glob/LICENSE new file mode 100644 index 0000000..3f2eca1 --- /dev/null +++ b/node_modules/is-glob/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2017, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/is-glob/README.md b/node_modules/is-glob/README.md new file mode 100644 index 0000000..740724b --- /dev/null +++ b/node_modules/is-glob/README.md @@ -0,0 +1,206 @@ +# is-glob [![NPM version](https://img.shields.io/npm/v/is-glob.svg?style=flat)](https://www.npmjs.com/package/is-glob) [![NPM monthly downloads](https://img.shields.io/npm/dm/is-glob.svg?style=flat)](https://npmjs.org/package/is-glob) [![NPM total downloads](https://img.shields.io/npm/dt/is-glob.svg?style=flat)](https://npmjs.org/package/is-glob) [![Build Status](https://img.shields.io/github/workflow/status/micromatch/is-glob/dev)](https://github.com/micromatch/is-glob/actions) + +> Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a better user experience. + +Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save is-glob +``` + +You might also be interested in [is-valid-glob](https://github.com/jonschlinkert/is-valid-glob) and [has-glob](https://github.com/jonschlinkert/has-glob). + +## Usage + +```js +var isGlob = require('is-glob'); +``` + +### Default behavior + +**True** + +Patterns that have glob characters or regex patterns will return `true`: + +```js +isGlob('!foo.js'); +isGlob('*.js'); +isGlob('**/abc.js'); +isGlob('abc/*.js'); +isGlob('abc/(aaa|bbb).js'); +isGlob('abc/[a-z].js'); +isGlob('abc/{a,b}.js'); +//=> true +``` + +Extglobs + +```js +isGlob('abc/@(a).js'); +isGlob('abc/!(a).js'); +isGlob('abc/+(a).js'); +isGlob('abc/*(a).js'); +isGlob('abc/?(a).js'); +//=> true +``` + +**False** + +Escaped globs or extglobs return `false`: + +```js +isGlob('abc/\\@(a).js'); +isGlob('abc/\\!(a).js'); +isGlob('abc/\\+(a).js'); +isGlob('abc/\\*(a).js'); +isGlob('abc/\\?(a).js'); +isGlob('\\!foo.js'); +isGlob('\\*.js'); +isGlob('\\*\\*/abc.js'); +isGlob('abc/\\*.js'); +isGlob('abc/\\(aaa|bbb).js'); +isGlob('abc/\\[a-z].js'); +isGlob('abc/\\{a,b}.js'); +//=> false +``` + +Patterns that do not have glob patterns return `false`: + +```js +isGlob('abc.js'); +isGlob('abc/def/ghi.js'); +isGlob('foo.js'); +isGlob('abc/@.js'); +isGlob('abc/+.js'); +isGlob('abc/?.js'); +isGlob(); +isGlob(null); +//=> false +``` + +Arrays are also `false` (If you want to check if an array has a glob pattern, use [has-glob](https://github.com/jonschlinkert/has-glob)): + +```js +isGlob(['**/*.js']); +isGlob(['foo.js']); +//=> false +``` + +### Option strict + +When `options.strict === false` the behavior is less strict in determining if a pattern is a glob. Meaning that +some patterns that would return `false` may return `true`. This is done so that matching libraries like [micromatch](https://github.com/micromatch/micromatch) have a chance at determining if the pattern is a glob or not. + +**True** + +Patterns that have glob characters or regex patterns will return `true`: + +```js +isGlob('!foo.js', {strict: false}); +isGlob('*.js', {strict: false}); +isGlob('**/abc.js', {strict: false}); +isGlob('abc/*.js', {strict: false}); +isGlob('abc/(aaa|bbb).js', {strict: false}); +isGlob('abc/[a-z].js', {strict: false}); +isGlob('abc/{a,b}.js', {strict: false}); +//=> true +``` + +Extglobs + +```js +isGlob('abc/@(a).js', {strict: false}); +isGlob('abc/!(a).js', {strict: false}); +isGlob('abc/+(a).js', {strict: false}); +isGlob('abc/*(a).js', {strict: false}); +isGlob('abc/?(a).js', {strict: false}); +//=> true +``` + +**False** + +Escaped globs or extglobs return `false`: + +```js +isGlob('\\!foo.js', {strict: false}); +isGlob('\\*.js', {strict: false}); +isGlob('\\*\\*/abc.js', {strict: false}); +isGlob('abc/\\*.js', {strict: false}); +isGlob('abc/\\(aaa|bbb).js', {strict: false}); +isGlob('abc/\\[a-z].js', {strict: false}); +isGlob('abc/\\{a,b}.js', {strict: false}); +//=> false +``` + +## About + +
+Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +
+ +
+Running Tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +
+ +
+Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +
+ +### Related projects + +You might also be interested in these projects: + +* [assemble](https://www.npmjs.com/package/assemble): Get the rocks out of your socks! Assemble makes you fast at creating web projects… [more](https://github.com/assemble/assemble) | [homepage](https://github.com/assemble/assemble "Get the rocks out of your socks! Assemble makes you fast at creating web projects. Assemble is used by thousands of projects for rapid prototyping, creating themes, scaffolds, boilerplates, e-books, UI components, API documentation, blogs, building websit") +* [base](https://www.npmjs.com/package/base): Framework for rapidly creating high quality, server-side node.js applications, using plugins like building blocks | [homepage](https://github.com/node-base/base "Framework for rapidly creating high quality, server-side node.js applications, using plugins like building blocks") +* [update](https://www.npmjs.com/package/update): Be scalable! Update is a new, open source developer framework and CLI for automating updates… [more](https://github.com/update/update) | [homepage](https://github.com/update/update "Be scalable! Update is a new, open source developer framework and CLI for automating updates of any kind in code projects.") +* [verb](https://www.npmjs.com/package/verb): Documentation generator for GitHub projects. Verb is extremely powerful, easy to use, and is used… [more](https://github.com/verbose/verb) | [homepage](https://github.com/verbose/verb "Documentation generator for GitHub projects. Verb is extremely powerful, easy to use, and is used on hundreds of projects of all sizes to generate everything from API docs to readmes.") + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 47 | [jonschlinkert](https://github.com/jonschlinkert) | +| 5 | [doowb](https://github.com/doowb) | +| 1 | [phated](https://github.com/phated) | +| 1 | [danhper](https://github.com/danhper) | +| 1 | [paulmillr](https://github.com/paulmillr) | + +### Author + +**Jon Schlinkert** + +* [GitHub Profile](https://github.com/jonschlinkert) +* [Twitter Profile](https://twitter.com/jonschlinkert) +* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert) + +### License + +Copyright © 2019, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on March 27, 2019._ \ No newline at end of file diff --git a/node_modules/is-glob/index.js b/node_modules/is-glob/index.js new file mode 100644 index 0000000..620f563 --- /dev/null +++ b/node_modules/is-glob/index.js @@ -0,0 +1,150 @@ +/*! + * is-glob + * + * Copyright (c) 2014-2017, Jon Schlinkert. + * Released under the MIT License. + */ + +var isExtglob = require('is-extglob'); +var chars = { '{': '}', '(': ')', '[': ']'}; +var strictCheck = function(str) { + if (str[0] === '!') { + return true; + } + var index = 0; + var pipeIndex = -2; + var closeSquareIndex = -2; + var closeCurlyIndex = -2; + var closeParenIndex = -2; + var backSlashIndex = -2; + while (index < str.length) { + if (str[index] === '*') { + return true; + } + + if (str[index + 1] === '?' && /[\].+)]/.test(str[index])) { + return true; + } + + if (closeSquareIndex !== -1 && str[index] === '[' && str[index + 1] !== ']') { + if (closeSquareIndex < index) { + closeSquareIndex = str.indexOf(']', index); + } + if (closeSquareIndex > index) { + if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) { + return true; + } + backSlashIndex = str.indexOf('\\', index); + if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) { + return true; + } + } + } + + if (closeCurlyIndex !== -1 && str[index] === '{' && str[index + 1] !== '}') { + closeCurlyIndex = str.indexOf('}', index); + if (closeCurlyIndex > index) { + backSlashIndex = str.indexOf('\\', index); + if (backSlashIndex === -1 || backSlashIndex > closeCurlyIndex) { + return true; + } + } + } + + if (closeParenIndex !== -1 && str[index] === '(' && str[index + 1] === '?' && /[:!=]/.test(str[index + 2]) && str[index + 3] !== ')') { + closeParenIndex = str.indexOf(')', index); + if (closeParenIndex > index) { + backSlashIndex = str.indexOf('\\', index); + if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) { + return true; + } + } + } + + if (pipeIndex !== -1 && str[index] === '(' && str[index + 1] !== '|') { + if (pipeIndex < index) { + pipeIndex = str.indexOf('|', index); + } + if (pipeIndex !== -1 && str[pipeIndex + 1] !== ')') { + closeParenIndex = str.indexOf(')', pipeIndex); + if (closeParenIndex > pipeIndex) { + backSlashIndex = str.indexOf('\\', pipeIndex); + if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) { + return true; + } + } + } + } + + if (str[index] === '\\') { + var open = str[index + 1]; + index += 2; + var close = chars[open]; + + if (close) { + var n = str.indexOf(close, index); + if (n !== -1) { + index = n + 1; + } + } + + if (str[index] === '!') { + return true; + } + } else { + index++; + } + } + return false; +}; + +var relaxedCheck = function(str) { + if (str[0] === '!') { + return true; + } + var index = 0; + while (index < str.length) { + if (/[*?{}()[\]]/.test(str[index])) { + return true; + } + + if (str[index] === '\\') { + var open = str[index + 1]; + index += 2; + var close = chars[open]; + + if (close) { + var n = str.indexOf(close, index); + if (n !== -1) { + index = n + 1; + } + } + + if (str[index] === '!') { + return true; + } + } else { + index++; + } + } + return false; +}; + +module.exports = function isGlob(str, options) { + if (typeof str !== 'string' || str === '') { + return false; + } + + if (isExtglob(str)) { + return true; + } + + var check = strictCheck; + + // optionally relax check + if (options && options.strict === false) { + check = relaxedCheck; + } + + return check(str); +}; diff --git a/node_modules/is-glob/package.json b/node_modules/is-glob/package.json new file mode 100644 index 0000000..858af03 --- /dev/null +++ b/node_modules/is-glob/package.json @@ -0,0 +1,81 @@ +{ + "name": "is-glob", + "description": "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a better user experience.", + "version": "4.0.3", + "homepage": "https://github.com/micromatch/is-glob", + "author": "Jon Schlinkert (https://github.com/jonschlinkert)", + "contributors": [ + "Brian Woodward (https://twitter.com/doowb)", + "Daniel Perez (https://tuvistavie.com)", + "Jon Schlinkert (http://twitter.com/jonschlinkert)" + ], + "repository": "micromatch/is-glob", + "bugs": { + "url": "https://github.com/micromatch/is-glob/issues" + }, + "license": "MIT", + "files": [ + "index.js" + ], + "main": "index.js", + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "mocha && node benchmark.js" + }, + "dependencies": { + "is-extglob": "^2.1.1" + }, + "devDependencies": { + "gulp-format-md": "^0.1.10", + "mocha": "^3.0.2" + }, + "keywords": [ + "bash", + "braces", + "check", + "exec", + "expression", + "extglob", + "glob", + "globbing", + "globstar", + "is", + "match", + "matches", + "pattern", + "regex", + "regular", + "string", + "test" + ], + "verb": { + "layout": "default", + "plugins": [ + "gulp-format-md" + ], + "related": { + "list": [ + "assemble", + "base", + "update", + "verb" + ] + }, + "reflinks": [ + "assemble", + "bach", + "base", + "composer", + "gulp", + "has-glob", + "is-valid-glob", + "micromatch", + "npm", + "scaffold", + "verb", + "vinyl" + ] + } +} diff --git a/node_modules/is-number/LICENSE b/node_modules/is-number/LICENSE new file mode 100644 index 0000000..9af4a67 --- /dev/null +++ b/node_modules/is-number/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-present, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/is-number/README.md b/node_modules/is-number/README.md new file mode 100644 index 0000000..eb8149e --- /dev/null +++ b/node_modules/is-number/README.md @@ -0,0 +1,187 @@ +# is-number [![NPM version](https://img.shields.io/npm/v/is-number.svg?style=flat)](https://www.npmjs.com/package/is-number) [![NPM monthly downloads](https://img.shields.io/npm/dm/is-number.svg?style=flat)](https://npmjs.org/package/is-number) [![NPM total downloads](https://img.shields.io/npm/dt/is-number.svg?style=flat)](https://npmjs.org/package/is-number) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/is-number.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/is-number) + +> Returns true if the value is a finite number. + +Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save is-number +``` + +## Why is this needed? + +In JavaScript, it's not always as straightforward as it should be to reliably check if a value is a number. It's common for devs to use `+`, `-`, or `Number()` to cast a string value to a number (for example, when values are returned from user input, regex matches, parsers, etc). But there are many non-intuitive edge cases that yield unexpected results: + +```js +console.log(+[]); //=> 0 +console.log(+''); //=> 0 +console.log(+' '); //=> 0 +console.log(typeof NaN); //=> 'number' +``` + +This library offers a performant way to smooth out edge cases like these. + +## Usage + +```js +const isNumber = require('is-number'); +``` + +See the [tests](./test.js) for more examples. + +### true + +```js +isNumber(5e3); // true +isNumber(0xff); // true +isNumber(-1.1); // true +isNumber(0); // true +isNumber(1); // true +isNumber(1.1); // true +isNumber(10); // true +isNumber(10.10); // true +isNumber(100); // true +isNumber('-1.1'); // true +isNumber('0'); // true +isNumber('012'); // true +isNumber('0xff'); // true +isNumber('1'); // true +isNumber('1.1'); // true +isNumber('10'); // true +isNumber('10.10'); // true +isNumber('100'); // true +isNumber('5e3'); // true +isNumber(parseInt('012')); // true +isNumber(parseFloat('012')); // true +``` + +### False + +Everything else is false, as you would expect: + +```js +isNumber(Infinity); // false +isNumber(NaN); // false +isNumber(null); // false +isNumber(undefined); // false +isNumber(''); // false +isNumber(' '); // false +isNumber('foo'); // false +isNumber([1]); // false +isNumber([]); // false +isNumber(function () {}); // false +isNumber({}); // false +``` + +## Release history + +### 7.0.0 + +* Refactor. Now uses `.isFinite` if it exists. +* Performance is about the same as v6.0 when the value is a string or number. But it's now 3x-4x faster when the value is not a string or number. + +### 6.0.0 + +* Optimizations, thanks to @benaadams. + +### 5.0.0 + +**Breaking changes** + +* removed support for `instanceof Number` and `instanceof String` + +## Benchmarks + +As with all benchmarks, take these with a grain of salt. See the [benchmarks](./benchmark/index.js) for more detail. + +``` +# all +v7.0 x 413,222 ops/sec ±2.02% (86 runs sampled) +v6.0 x 111,061 ops/sec ±1.29% (85 runs sampled) +parseFloat x 317,596 ops/sec ±1.36% (86 runs sampled) +fastest is 'v7.0' + +# string +v7.0 x 3,054,496 ops/sec ±1.05% (89 runs sampled) +v6.0 x 2,957,781 ops/sec ±0.98% (88 runs sampled) +parseFloat x 3,071,060 ops/sec ±1.13% (88 runs sampled) +fastest is 'parseFloat,v7.0' + +# number +v7.0 x 3,146,895 ops/sec ±0.89% (89 runs sampled) +v6.0 x 3,214,038 ops/sec ±1.07% (89 runs sampled) +parseFloat x 3,077,588 ops/sec ±1.07% (87 runs sampled) +fastest is 'v6.0' +``` + +## About + +
+Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +
+ +
+Running Tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +
+ +
+Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +
+ +### Related projects + +You might also be interested in these projects: + +* [is-plain-object](https://www.npmjs.com/package/is-plain-object): Returns true if an object was created by the `Object` constructor. | [homepage](https://github.com/jonschlinkert/is-plain-object "Returns true if an object was created by the `Object` constructor.") +* [is-primitive](https://www.npmjs.com/package/is-primitive): Returns `true` if the value is a primitive. | [homepage](https://github.com/jonschlinkert/is-primitive "Returns `true` if the value is a primitive. ") +* [isobject](https://www.npmjs.com/package/isobject): Returns true if the value is an object and not an array or null. | [homepage](https://github.com/jonschlinkert/isobject "Returns true if the value is an object and not an array or null.") +* [kind-of](https://www.npmjs.com/package/kind-of): Get the native type of a value. | [homepage](https://github.com/jonschlinkert/kind-of "Get the native type of a value.") + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 49 | [jonschlinkert](https://github.com/jonschlinkert) | +| 5 | [charlike-old](https://github.com/charlike-old) | +| 1 | [benaadams](https://github.com/benaadams) | +| 1 | [realityking](https://github.com/realityking) | + +### Author + +**Jon Schlinkert** + +* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert) +* [GitHub Profile](https://github.com/jonschlinkert) +* [Twitter Profile](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2018, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on June 15, 2018._ \ No newline at end of file diff --git a/node_modules/is-number/index.js b/node_modules/is-number/index.js new file mode 100644 index 0000000..27f19b7 --- /dev/null +++ b/node_modules/is-number/index.js @@ -0,0 +1,18 @@ +/*! + * is-number + * + * Copyright (c) 2014-present, Jon Schlinkert. + * Released under the MIT License. + */ + +'use strict'; + +module.exports = function(num) { + if (typeof num === 'number') { + return num - num === 0; + } + if (typeof num === 'string' && num.trim() !== '') { + return Number.isFinite ? Number.isFinite(+num) : isFinite(+num); + } + return false; +}; diff --git a/node_modules/is-number/package.json b/node_modules/is-number/package.json new file mode 100644 index 0000000..3715072 --- /dev/null +++ b/node_modules/is-number/package.json @@ -0,0 +1,82 @@ +{ + "name": "is-number", + "description": "Returns true if a number or string value is a finite number. Useful for regex matches, parsing, user input, etc.", + "version": "7.0.0", + "homepage": "https://github.com/jonschlinkert/is-number", + "author": "Jon Schlinkert (https://github.com/jonschlinkert)", + "contributors": [ + "Jon Schlinkert (http://twitter.com/jonschlinkert)", + "Olsten Larck (https://i.am.charlike.online)", + "Rouven Weßling (www.rouvenwessling.de)" + ], + "repository": "jonschlinkert/is-number", + "bugs": { + "url": "https://github.com/jonschlinkert/is-number/issues" + }, + "license": "MIT", + "files": [ + "index.js" + ], + "main": "index.js", + "engines": { + "node": ">=0.12.0" + }, + "scripts": { + "test": "mocha" + }, + "devDependencies": { + "ansi": "^0.3.1", + "benchmark": "^2.1.4", + "gulp-format-md": "^1.0.0", + "mocha": "^3.5.3" + }, + "keywords": [ + "cast", + "check", + "coerce", + "coercion", + "finite", + "integer", + "is", + "isnan", + "is-nan", + "is-num", + "is-number", + "isnumber", + "isfinite", + "istype", + "kind", + "math", + "nan", + "num", + "number", + "numeric", + "parseFloat", + "parseInt", + "test", + "type", + "typeof", + "value" + ], + "verb": { + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "related": { + "list": [ + "is-plain-object", + "is-primitive", + "isobject", + "kind-of" + ] + }, + "plugins": [ + "gulp-format-md" + ], + "lint": { + "reflinks": true + } + } +} diff --git a/node_modules/is-plain-object/LICENSE b/node_modules/is-plain-object/LICENSE new file mode 100644 index 0000000..3f2eca1 --- /dev/null +++ b/node_modules/is-plain-object/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2017, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/is-plain-object/README.md b/node_modules/is-plain-object/README.md new file mode 100644 index 0000000..1f9d0c8 --- /dev/null +++ b/node_modules/is-plain-object/README.md @@ -0,0 +1,104 @@ +# is-plain-object [![NPM version](https://img.shields.io/npm/v/is-plain-object.svg?style=flat)](https://www.npmjs.com/package/is-plain-object) [![NPM monthly downloads](https://img.shields.io/npm/dm/is-plain-object.svg?style=flat)](https://npmjs.org/package/is-plain-object) [![NPM total downloads](https://img.shields.io/npm/dt/is-plain-object.svg?style=flat)](https://npmjs.org/package/is-plain-object) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/is-plain-object.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/is-plain-object) + +> Returns true if an object was created by the `Object` constructor. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save is-plain-object +``` + +Use [isobject](https://github.com/jonschlinkert/isobject) if you only want to check if the value is an object and not an array or null. + +## Usage + +```js +var isPlainObject = require('is-plain-object'); +``` + +**true** when created by the `Object` constructor. + +```js +isPlainObject(Object.create({})); +//=> true +isPlainObject(Object.create(Object.prototype)); +//=> true +isPlainObject({foo: 'bar'}); +//=> true +isPlainObject({}); +//=> true +``` + +**false** when not created by the `Object` constructor. + +```js +isPlainObject(1); +//=> false +isPlainObject(['foo', 'bar']); +//=> false +isPlainObject([]); +//=> false +isPlainObject(new Foo); +//=> false +isPlainObject(null); +//=> false +isPlainObject(Object.create(null)); +//=> false +``` + +## About + +### Related projects + +* [is-number](https://www.npmjs.com/package/is-number): Returns true if the value is a number. comprehensive tests. | [homepage](https://github.com/jonschlinkert/is-number "Returns true if the value is a number. comprehensive tests.") +* [isobject](https://www.npmjs.com/package/isobject): Returns true if the value is an object and not an array or null. | [homepage](https://github.com/jonschlinkert/isobject "Returns true if the value is an object and not an array or null.") +* [kind-of](https://www.npmjs.com/package/kind-of): Get the native type of a value. | [homepage](https://github.com/jonschlinkert/kind-of "Get the native type of a value.") + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 17 | [jonschlinkert](https://github.com/jonschlinkert) | +| 6 | [stevenvachon](https://github.com/stevenvachon) | +| 3 | [onokumus](https://github.com/onokumus) | +| 1 | [wtgtybhertgeghgtwtg](https://github.com/wtgtybhertgeghgtwtg) | + +### Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +### Running tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on July 11, 2017._ \ No newline at end of file diff --git a/node_modules/is-plain-object/index.d.ts b/node_modules/is-plain-object/index.d.ts new file mode 100644 index 0000000..74a44e9 --- /dev/null +++ b/node_modules/is-plain-object/index.d.ts @@ -0,0 +1,5 @@ +export = isPlainObject; + +declare function isPlainObject(o: any): boolean; + +declare namespace isPlainObject {} diff --git a/node_modules/is-plain-object/index.js b/node_modules/is-plain-object/index.js new file mode 100644 index 0000000..c328484 --- /dev/null +++ b/node_modules/is-plain-object/index.js @@ -0,0 +1,37 @@ +/*! + * is-plain-object + * + * Copyright (c) 2014-2017, Jon Schlinkert. + * Released under the MIT License. + */ + +'use strict'; + +var isObject = require('isobject'); + +function isObjectObject(o) { + return isObject(o) === true + && Object.prototype.toString.call(o) === '[object Object]'; +} + +module.exports = function isPlainObject(o) { + var ctor,prot; + + if (isObjectObject(o) === false) return false; + + // If has modified constructor + ctor = o.constructor; + if (typeof ctor !== 'function') return false; + + // If has modified prototype + prot = ctor.prototype; + if (isObjectObject(prot) === false) return false; + + // If constructor does not have an Object-specific method + if (prot.hasOwnProperty('isPrototypeOf') === false) { + return false; + } + + // Most likely a plain Object + return true; +}; diff --git a/node_modules/is-plain-object/package.json b/node_modules/is-plain-object/package.json new file mode 100644 index 0000000..dd60498 --- /dev/null +++ b/node_modules/is-plain-object/package.json @@ -0,0 +1,79 @@ +{ + "name": "is-plain-object", + "description": "Returns true if an object was created by the `Object` constructor.", + "version": "2.0.4", + "homepage": "https://github.com/jonschlinkert/is-plain-object", + "author": "Jon Schlinkert (https://github.com/jonschlinkert)", + "contributors": [ + "Jon Schlinkert (http://twitter.com/jonschlinkert)", + "Osman Nuri Okumuş (http://onokumus.com)", + "Steven Vachon (https://svachon.com)", + "(https://github.com/wtgtybhertgeghgtwtg)" + ], + "repository": "jonschlinkert/is-plain-object", + "bugs": { + "url": "https://github.com/jonschlinkert/is-plain-object/issues" + }, + "license": "MIT", + "files": [ + "index.d.ts", + "index.js" + ], + "main": "index.js", + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "browserify": "browserify index.js --standalone isPlainObject | uglifyjs --compress --mangle -o browser/is-plain-object.js", + "test_browser": "mocha-phantomjs test/browser.html", + "test_node": "mocha", + "test": "npm run test_node && npm run browserify && npm run test_browser" + }, + "dependencies": { + "isobject": "^3.0.1" + }, + "devDependencies": { + "browserify": "^14.4.0", + "chai": "^4.0.2", + "gulp-format-md": "^1.0.0", + "mocha": "^3.4.2", + "mocha-phantomjs": "^4.1.0", + "phantomjs": "^2.1.7", + "uglify-js": "^3.0.24" + }, + "keywords": [ + "check", + "is", + "is-object", + "isobject", + "javascript", + "kind", + "kind-of", + "object", + "plain", + "type", + "typeof", + "value" + ], + "types": "index.d.ts", + "verb": { + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "related": { + "list": [ + "is-number", + "isobject", + "kind-of" + ] + }, + "lint": { + "reflinks": true + } + } +} diff --git a/node_modules/isobject/LICENSE b/node_modules/isobject/LICENSE new file mode 100644 index 0000000..943e71d --- /dev/null +++ b/node_modules/isobject/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2017, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/node_modules/isobject/README.md b/node_modules/isobject/README.md new file mode 100644 index 0000000..d01feaa --- /dev/null +++ b/node_modules/isobject/README.md @@ -0,0 +1,122 @@ +# isobject [![NPM version](https://img.shields.io/npm/v/isobject.svg?style=flat)](https://www.npmjs.com/package/isobject) [![NPM monthly downloads](https://img.shields.io/npm/dm/isobject.svg?style=flat)](https://npmjs.org/package/isobject) [![NPM total downloads](https://img.shields.io/npm/dt/isobject.svg?style=flat)](https://npmjs.org/package/isobject) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/isobject.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/isobject) + +> Returns true if the value is an object and not an array or null. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save isobject +``` + +Install with [yarn](https://yarnpkg.com): + +```sh +$ yarn add isobject +``` + +Use [is-plain-object](https://github.com/jonschlinkert/is-plain-object) if you want only objects that are created by the `Object` constructor. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install isobject +``` +Install with [bower](https://bower.io/) + +```sh +$ bower install isobject +``` + +## Usage + +```js +var isObject = require('isobject'); +``` + +**True** + +All of the following return `true`: + +```js +isObject({}); +isObject(Object.create({})); +isObject(Object.create(Object.prototype)); +isObject(Object.create(null)); +isObject({}); +isObject(new Foo); +isObject(/foo/); +``` + +**False** + +All of the following return `false`: + +```js +isObject(); +isObject(function () {}); +isObject(1); +isObject([]); +isObject(undefined); +isObject(null); +``` + +## About + +### Related projects + +* [extend-shallow](https://www.npmjs.com/package/extend-shallow): Extend an object with the properties of additional objects. node.js/javascript util. | [homepage](https://github.com/jonschlinkert/extend-shallow "Extend an object with the properties of additional objects. node.js/javascript util.") +* [is-plain-object](https://www.npmjs.com/package/is-plain-object): Returns true if an object was created by the `Object` constructor. | [homepage](https://github.com/jonschlinkert/is-plain-object "Returns true if an object was created by the `Object` constructor.") +* [kind-of](https://www.npmjs.com/package/kind-of): Get the native type of a value. | [homepage](https://github.com/jonschlinkert/kind-of "Get the native type of a value.") +* [merge-deep](https://www.npmjs.com/package/merge-deep): Recursively merge values in a javascript object. | [homepage](https://github.com/jonschlinkert/merge-deep "Recursively merge values in a javascript object.") + +### Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 29 | [jonschlinkert](https://github.com/jonschlinkert) | +| 4 | [doowb](https://github.com/doowb) | +| 1 | [magnudae](https://github.com/magnudae) | +| 1 | [LeSuisse](https://github.com/LeSuisse) | +| 1 | [tmcw](https://github.com/tmcw) | + +### Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +### Running tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +### Author + +**Jon Schlinkert** + +* [github/jonschlinkert](https://github.com/jonschlinkert) +* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on June 30, 2017._ \ No newline at end of file diff --git a/node_modules/isobject/index.d.ts b/node_modules/isobject/index.d.ts new file mode 100644 index 0000000..55f81c2 --- /dev/null +++ b/node_modules/isobject/index.d.ts @@ -0,0 +1,5 @@ +export = isObject; + +declare function isObject(val: any): boolean; + +declare namespace isObject {} diff --git a/node_modules/isobject/index.js b/node_modules/isobject/index.js new file mode 100644 index 0000000..2d59958 --- /dev/null +++ b/node_modules/isobject/index.js @@ -0,0 +1,12 @@ +/*! + * isobject + * + * Copyright (c) 2014-2017, Jon Schlinkert. + * Released under the MIT License. + */ + +'use strict'; + +module.exports = function isObject(val) { + return val != null && typeof val === 'object' && Array.isArray(val) === false; +}; diff --git a/node_modules/isobject/package.json b/node_modules/isobject/package.json new file mode 100644 index 0000000..62aa8c1 --- /dev/null +++ b/node_modules/isobject/package.json @@ -0,0 +1,74 @@ +{ + "name": "isobject", + "description": "Returns true if the value is an object and not an array or null.", + "version": "3.0.1", + "homepage": "https://github.com/jonschlinkert/isobject", + "author": "Jon Schlinkert (https://github.com/jonschlinkert)", + "contributors": [ + "(https://github.com/LeSuisse)", + "Brian Woodward (https://twitter.com/doowb)", + "Jon Schlinkert (http://twitter.com/jonschlinkert)", + "Magnús Dæhlen (https://github.com/magnudae)", + "Tom MacWright (https://macwright.org)" + ], + "repository": "jonschlinkert/isobject", + "bugs": { + "url": "https://github.com/jonschlinkert/isobject/issues" + }, + "license": "MIT", + "files": [ + "index.d.ts", + "index.js" + ], + "main": "index.js", + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "mocha" + }, + "dependencies": {}, + "devDependencies": { + "gulp-format-md": "^0.1.9", + "mocha": "^2.4.5" + }, + "keywords": [ + "check", + "is", + "is-object", + "isobject", + "kind", + "kind-of", + "kindof", + "native", + "object", + "type", + "typeof", + "value" + ], + "types": "index.d.ts", + "verb": { + "related": { + "list": [ + "extend-shallow", + "is-plain-object", + "kind-of", + "merge-deep" + ] + }, + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "lint": { + "reflinks": true + }, + "reflinks": [ + "verb" + ] + } +} diff --git a/node_modules/jest-worker/LICENSE b/node_modules/jest-worker/LICENSE new file mode 100644 index 0000000..b96dcb0 --- /dev/null +++ b/node_modules/jest-worker/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Facebook, Inc. and its affiliates. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/jest-worker/README.md b/node_modules/jest-worker/README.md new file mode 100644 index 0000000..0727a04 --- /dev/null +++ b/node_modules/jest-worker/README.md @@ -0,0 +1,247 @@ +# jest-worker + +Module for executing heavy tasks under forked processes in parallel, by providing a `Promise` based interface, minimum overhead, and bound workers. + +The module works by providing an absolute path of the module to be loaded in all forked processes. Files relative to a node module are also accepted. All methods are exposed on the parent process as promises, so they can be `await`'ed. Child (worker) methods can either be synchronous or asynchronous. + +The module also implements support for bound workers. Binding a worker means that, based on certain parameters, the same task will always be executed by the same worker. The way bound workers work is by using the returned string of the `computeWorkerKey` method. If the string was used before for a task, the call will be queued to the related worker that processed the task earlier; if not, it will be executed by the first available worker, then sticked to the worker that executed it; so the next time it will be processed by the same worker. If you have no preference on the worker executing the task, but you have defined a `computeWorkerKey` method because you want _some_ of the tasks to be sticked, you can return `null` from it. + +The list of exposed methods can be explicitly provided via the `exposedMethods` option. If it is not provided, it will be obtained by requiring the child module into the main process, and analyzed via reflection. Check the "minimal example" section for a valid one. + +## Install + +```sh +$ yarn add jest-worker +``` + +## Example + +This example covers the minimal usage: + +### File `parent.js` + +```javascript +import {Worker as JestWorker} from 'jest-worker'; + +async function main() { + const worker = new JestWorker(require.resolve('./Worker')); + const result = await worker.hello('Alice'); // "Hello, Alice" +} + +main(); +``` + +### File `worker.js` + +```javascript +export function hello(param) { + return 'Hello, ' + param; +} +``` + +## Experimental worker + +Node 10 shipped with [worker-threads](https://nodejs.org/api/worker_threads.html), a "threading API" that uses SharedArrayBuffers to communicate between the main process and its child threads. This experimental Node feature can significantly improve the communication time between parent and child processes in `jest-worker`. + +Since `worker_threads` are considered experimental in Node, you have to opt-in to this behavior by passing `enableWorkerThreads: true` when instantiating the worker. While the feature was unflagged in Node 11.7.0, you'll need to run the Node process with the `--experimental-worker` flag for Node 10. + +## API + +The `Worker` export is a constructor that is initialized by passing the worker path, plus an options object. + +### `workerPath: string` (required) + +Node module name or absolute path of the file to be loaded in the child processes. Use `require.resolve` to transform a relative path into an absolute one. + +### `options: Object` (optional) + +#### `exposedMethods: $ReadOnlyArray` (optional) + +List of method names that can be called on the child processes from the parent process. You cannot expose any method named like a public `Worker` method, or starting with `_`. If you use method auto-discovery, then these methods will not be exposed, even if they exist. + +#### `numWorkers: number` (optional) + +Amount of workers to spawn. Defaults to the number of CPUs minus 1. + +#### `maxRetries: number` (optional) + +Maximum amount of times that a dead child can be re-spawned, per call. Defaults to `3`, pass `Infinity` to allow endless retries. + +#### `forkOptions: Object` (optional) + +Allow customizing all options passed to `childProcess.fork`. By default, some values are set (`cwd`, `env` and `execArgv`), but you can override them and customize the rest. For a list of valid values, check [the Node documentation](https://nodejs.org/api/child_process.html#child_process_child_process_fork_modulepath_args_options). + +#### `computeWorkerKey: (method: string, ...args: Array) => ?string` (optional) + +Every time a method exposed via the API is called, `computeWorkerKey` is also called in order to bound the call to a worker. This is useful for workers that are able to cache the result or part of it. You bound calls to a worker by making `computeWorkerKey` return the same identifier for all different calls. If you do not want to bind the call to any worker, return `null`. + +The callback you provide is called with the method name, plus all the rest of the arguments of the call. Thus, you have full control to decide what to return. Check a practical example on bound workers under the "bound worker usage" section. + +By default, no process is bound to any worker. + +#### `setupArgs: Array` (optional) + +The arguments that will be passed to the `setup` method during initialization. + +#### `WorkerPool: (workerPath: string, options?: WorkerPoolOptions) => WorkerPoolInterface` (optional) + +Provide a custom worker pool to be used for spawning child processes. By default, Jest will use a node thread pool if available and fall back to child process threads. + +#### `enableWorkerThreads: boolean` (optional) + +`jest-worker` will automatically detect if `worker_threads` are available, but will not use them unless passed `enableWorkerThreads: true`. + +### `workerSchedulingPolicy: 'round-robin' | 'in-order'` (optional) + +Specifies the policy how tasks are assigned to workers if multiple workers are _idle_: + +- `round-robin` (default): The task will be sequentially distributed onto the workers. The first task is assigned to the worker 1, the second to the worker 2, to ensure that the work is distributed across workers. +- `in-order`: The task will be assigned to the first free worker starting with worker 1 and only assign the work to worker 2 if the worker 1 is busy. + +Tasks are always assigned to the first free worker as soon as tasks start to queue up. The scheduling policy does not define the task scheduling which is always first-in, first-out. + +### `taskQueue`: TaskQueue` (optional) + +The task queue defines in which order tasks (method calls) are processed by the workers. `jest-worker` ships with a `FifoQueue` and `PriorityQueue`: + +- `FifoQueue` (default): Processes the method calls (tasks) in the call order. +- `PriorityQueue`: Processes the method calls by a computed priority in natural ordering (lower priorities first). Tasks with the same priority are processed in any order (FIFO not guaranteed). The constructor accepts a single argument, the function that is passed the name of the called function and the arguments and returns a numerical value for the priority: `new require('jest-worker').PriorityQueue((method, filename) => filename.length)`. + +## JestWorker + +### Methods + +The returned `JestWorker` instance has all the exposed methods, plus some additional ones to interact with the workers itself: + +#### `getStdout(): Readable` + +Returns a `ReadableStream` where the standard output of all workers is piped. Note that the `silent` option of the child workers must be set to `true` to make it work. This is the default set by `jest-worker`, but keep it in mind when overriding options through `forkOptions`. + +#### `getStderr(): Readable` + +Returns a `ReadableStream` where the standard error of all workers is piped. Note that the `silent` option of the child workers must be set to `true` to make it work. This is the default set by `jest-worker`, but keep it in mind when overriding options through `forkOptions`. + +#### `end()` + +Finishes the workers by killing all workers. No further calls can be done to the `Worker` instance. + +Returns a Promise that resolves with `{ forceExited: boolean }` once all workers are dead. If `forceExited` is `true`, at least one of the workers did not exit gracefully, which likely happened because it executed a leaky task that left handles open. This should be avoided, force exiting workers is a last resort to prevent creating lots of orphans. + +**Note:** + +`await`ing the `end()` Promise immediately after the workers are no longer needed before proceeding to do other useful things in your program may not be a good idea. If workers have to be force exited, `jest-worker` may go through multiple stages of force exiting (e.g. SIGTERM, later SIGKILL) and give the worker overall around 1 second time to exit on its own. During this time, your program will wait, even though it may not be necessary that all workers are dead before continuing execution. + +Consider deliberately leaving this Promise floating (unhandled resolution). After your program has done the rest of its work and is about to exit, the Node process will wait for the Promise to resolve after all workers are dead as the last event loop task. That way you parallelized computation time of your program and waiting time and you didn't delay the outputs of your program unnecessarily. + +### Worker IDs + +Each worker has a unique id (index that starts with `1`), which is available inside the worker as `process.env.JEST_WORKER_ID`. + +## Setting up and tearing down the child process + +The child process can define two special methods (both of them can be asynchronous): + +- `setup()`: If defined, it's executed before the first call to any method in the child. +- `teardown()`: If defined, it's executed when the farm ends. + +# More examples + +## Standard usage + +This example covers the standard usage: + +### File `parent.js` + +```javascript +import {Worker as JestWorker} from 'jest-worker'; + +async function main() { + const myWorker = new JestWorker(require.resolve('./Worker'), { + exposedMethods: ['foo', 'bar', 'getWorkerId'], + numWorkers: 4, + }); + + console.log(await myWorker.foo('Alice')); // "Hello from foo: Alice" + console.log(await myWorker.bar('Bob')); // "Hello from bar: Bob" + console.log(await myWorker.getWorkerId()); // "3" -> this message has sent from the 3rd worker + + const {forceExited} = await myWorker.end(); + if (forceExited) { + console.error('Workers failed to exit gracefully'); + } +} + +main(); +``` + +### File `worker.js` + +```javascript +export function foo(param) { + return 'Hello from foo: ' + param; +} + +export function bar(param) { + return 'Hello from bar: ' + param; +} + +export function getWorkerId() { + return process.env.JEST_WORKER_ID; +} +``` + +## Bound worker usage: + +This example covers the usage with a `computeWorkerKey` method: + +### File `parent.js` + +```javascript +import {Worker as JestWorker} from 'jest-worker'; + +async function main() { + const myWorker = new JestWorker(require.resolve('./Worker'), { + computeWorkerKey: (method, filename) => filename, + }); + + // Transform the given file, within the first available worker. + console.log(await myWorker.transform('/tmp/foo.js')); + + // Wait a bit. + await sleep(10000); + + // Transform the same file again. Will immediately return because the + // transformed file is cached in the worker, and `computeWorkerKey` ensures + // the same worker that processed the file the first time will process it now. + console.log(await myWorker.transform('/tmp/foo.js')); + + const {forceExited} = await myWorker.end(); + if (forceExited) { + console.error('Workers failed to exit gracefully'); + } +} + +main(); +``` + +### File `worker.js` + +```javascript +import babel from '@babel/core'; + +const cache = Object.create(null); + +export function transform(filename) { + if (cache[filename]) { + return cache[filename]; + } + + // jest-worker can handle both immediate results and thenables. If a + // thenable is returned, it will be await'ed until it resolves. + return babel.transformFileAsync(filename).then(result => { + cache[filename] = result; + + return result; + }); +} +``` diff --git a/node_modules/jest-worker/build/Farm.d.ts b/node_modules/jest-worker/build/Farm.d.ts new file mode 100644 index 0000000..3fe79d0 --- /dev/null +++ b/node_modules/jest-worker/build/Farm.d.ts @@ -0,0 +1,29 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { FarmOptions, PromiseWithCustomMessage, TaskQueue } from './types'; +export default class Farm { + private _numOfWorkers; + private _callback; + private readonly _computeWorkerKey; + private readonly _workerSchedulingPolicy; + private readonly _cacheKeys; + private readonly _locks; + private _offset; + private readonly _taskQueue; + constructor(_numOfWorkers: number, _callback: Function, options?: { + computeWorkerKey?: FarmOptions['computeWorkerKey']; + workerSchedulingPolicy?: FarmOptions['workerSchedulingPolicy']; + taskQueue?: TaskQueue; + }); + doWork(method: string, ...args: Array): PromiseWithCustomMessage; + private _process; + private _push; + private _getNextWorkerOffset; + private _lock; + private _unlock; + private _isLocked; +} diff --git a/node_modules/jest-worker/build/Farm.js b/node_modules/jest-worker/build/Farm.js new file mode 100644 index 0000000..e29daf5 --- /dev/null +++ b/node_modules/jest-worker/build/Farm.js @@ -0,0 +1,206 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = void 0; + +var _FifoQueue = _interopRequireDefault(require('./FifoQueue')); + +var _types = require('./types'); + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {default: obj}; +} + +function _defineProperty(obj, key, value) { + if (key in obj) { + Object.defineProperty(obj, key, { + value: value, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key] = value; + } + return obj; +} + +class Farm { + constructor(_numOfWorkers, _callback, options = {}) { + var _options$workerSchedu, _options$taskQueue; + + _defineProperty(this, '_computeWorkerKey', void 0); + + _defineProperty(this, '_workerSchedulingPolicy', void 0); + + _defineProperty(this, '_cacheKeys', Object.create(null)); + + _defineProperty(this, '_locks', []); + + _defineProperty(this, '_offset', 0); + + _defineProperty(this, '_taskQueue', void 0); + + this._numOfWorkers = _numOfWorkers; + this._callback = _callback; + this._computeWorkerKey = options.computeWorkerKey; + this._workerSchedulingPolicy = + (_options$workerSchedu = options.workerSchedulingPolicy) !== null && + _options$workerSchedu !== void 0 + ? _options$workerSchedu + : 'round-robin'; + this._taskQueue = + (_options$taskQueue = options.taskQueue) !== null && + _options$taskQueue !== void 0 + ? _options$taskQueue + : new _FifoQueue.default(); + } + + doWork(method, ...args) { + const customMessageListeners = new Set(); + + const addCustomMessageListener = listener => { + customMessageListeners.add(listener); + return () => { + customMessageListeners.delete(listener); + }; + }; + + const onCustomMessage = message => { + customMessageListeners.forEach(listener => listener(message)); + }; + + const promise = new Promise( // Bind args to this function so it won't reference to the parent scope. + // This prevents a memory leak in v8, because otherwise the function will + // retaine args for the closure. + ((args, resolve, reject) => { + const computeWorkerKey = this._computeWorkerKey; + const request = [_types.CHILD_MESSAGE_CALL, false, method, args]; + let worker = null; + let hash = null; + + if (computeWorkerKey) { + hash = computeWorkerKey.call(this, method, ...args); + worker = hash == null ? null : this._cacheKeys[hash]; + } + + const onStart = worker => { + if (hash != null) { + this._cacheKeys[hash] = worker; + } + }; + + const onEnd = (error, result) => { + customMessageListeners.clear(); + + if (error) { + reject(error); + } else { + resolve(result); + } + }; + + const task = { + onCustomMessage, + onEnd, + onStart, + request + }; + + if (worker) { + this._taskQueue.enqueue(task, worker.getWorkerId()); + + this._process(worker.getWorkerId()); + } else { + this._push(task); + } + }).bind(null, args) + ); + promise.UNSTABLE_onCustomMessage = addCustomMessageListener; + return promise; + } + + _process(workerId) { + if (this._isLocked(workerId)) { + return this; + } + + const task = this._taskQueue.dequeue(workerId); + + if (!task) { + return this; + } + + if (task.request[1]) { + throw new Error('Queue implementation returned processed task'); + } // Reference the task object outside so it won't be retained by onEnd, + // and other properties of the task object, such as task.request can be + // garbage collected. + + const taskOnEnd = task.onEnd; + + const onEnd = (error, result) => { + taskOnEnd(error, result); + + this._unlock(workerId); + + this._process(workerId); + }; + + task.request[1] = true; + + this._lock(workerId); + + this._callback( + workerId, + task.request, + task.onStart, + onEnd, + task.onCustomMessage + ); + + return this; + } + + _push(task) { + this._taskQueue.enqueue(task); + + const offset = this._getNextWorkerOffset(); + + for (let i = 0; i < this._numOfWorkers; i++) { + this._process((offset + i) % this._numOfWorkers); + + if (task.request[1]) { + break; + } + } + + return this; + } + + _getNextWorkerOffset() { + switch (this._workerSchedulingPolicy) { + case 'in-order': + return 0; + + case 'round-robin': + return this._offset++; + } + } + + _lock(workerId) { + this._locks[workerId] = true; + } + + _unlock(workerId) { + this._locks[workerId] = false; + } + + _isLocked(workerId) { + return this._locks[workerId]; + } +} + +exports.default = Farm; diff --git a/node_modules/jest-worker/build/FifoQueue.d.ts b/node_modules/jest-worker/build/FifoQueue.d.ts new file mode 100644 index 0000000..d78e9e2 --- /dev/null +++ b/node_modules/jest-worker/build/FifoQueue.d.ts @@ -0,0 +1,18 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import type { QueueChildMessage, TaskQueue } from './types'; +/** + * First-in, First-out task queue that manages a dedicated pool + * for each worker as well as a shared queue. The FIFO ordering is guaranteed + * across the worker specific and shared queue. + */ +export default class FifoQueue implements TaskQueue { + private _workerQueues; + private _sharedQueue; + enqueue(task: QueueChildMessage, workerId?: number): void; + dequeue(workerId: number): QueueChildMessage | null; +} diff --git a/node_modules/jest-worker/build/FifoQueue.js b/node_modules/jest-worker/build/FifoQueue.js new file mode 100644 index 0000000..bb52e07 --- /dev/null +++ b/node_modules/jest-worker/build/FifoQueue.js @@ -0,0 +1,171 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = void 0; + +function _defineProperty(obj, key, value) { + if (key in obj) { + Object.defineProperty(obj, key, { + value: value, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key] = value; + } + return obj; +} + +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +/** + * First-in, First-out task queue that manages a dedicated pool + * for each worker as well as a shared queue. The FIFO ordering is guaranteed + * across the worker specific and shared queue. + */ +class FifoQueue { + constructor() { + _defineProperty(this, '_workerQueues', []); + + _defineProperty(this, '_sharedQueue', new InternalQueue()); + } + + enqueue(task, workerId) { + if (workerId == null) { + this._sharedQueue.enqueue(task); + + return; + } + + let workerQueue = this._workerQueues[workerId]; + + if (workerQueue == null) { + workerQueue = this._workerQueues[workerId] = new InternalQueue(); + } + + const sharedTop = this._sharedQueue.peekLast(); + + const item = { + previousSharedTask: sharedTop, + task + }; + workerQueue.enqueue(item); + } + + dequeue(workerId) { + var _this$_workerQueues$w, _workerTop$previousSh, _workerTop$previousSh2; + + const workerTop = + (_this$_workerQueues$w = this._workerQueues[workerId]) === null || + _this$_workerQueues$w === void 0 + ? void 0 + : _this$_workerQueues$w.peek(); + const sharedTaskIsProcessed = + (_workerTop$previousSh = + workerTop === null || workerTop === void 0 + ? void 0 + : (_workerTop$previousSh2 = workerTop.previousSharedTask) === null || + _workerTop$previousSh2 === void 0 + ? void 0 + : _workerTop$previousSh2.request[1]) !== null && + _workerTop$previousSh !== void 0 + ? _workerTop$previousSh + : true; // Process the top task from the shared queue if + // - there's no task in the worker specific queue or + // - if the non-worker-specific task after which this worker specifif task + // hasn been queued wasn't processed yet + + if (workerTop != null && sharedTaskIsProcessed) { + var _this$_workerQueues$w2, + _this$_workerQueues$w3, + _this$_workerQueues$w4; + + return (_this$_workerQueues$w2 = + (_this$_workerQueues$w3 = this._workerQueues[workerId]) === null || + _this$_workerQueues$w3 === void 0 + ? void 0 + : (_this$_workerQueues$w4 = _this$_workerQueues$w3.dequeue()) === + null || _this$_workerQueues$w4 === void 0 + ? void 0 + : _this$_workerQueues$w4.task) !== null && + _this$_workerQueues$w2 !== void 0 + ? _this$_workerQueues$w2 + : null; + } + + return this._sharedQueue.dequeue(); + } +} + +exports.default = FifoQueue; + +/** + * FIFO queue for a single worker / shared queue. + */ +class InternalQueue { + constructor() { + _defineProperty(this, '_head', null); + + _defineProperty(this, '_last', null); + } + + enqueue(value) { + const item = { + next: null, + value + }; + + if (this._last == null) { + this._head = item; + } else { + this._last.next = item; + } + + this._last = item; + } + + dequeue() { + if (this._head == null) { + return null; + } + + const item = this._head; + this._head = item.next; + + if (this._head == null) { + this._last = null; + } + + return item.value; + } + + peek() { + var _this$_head$value, _this$_head; + + return (_this$_head$value = + (_this$_head = this._head) === null || _this$_head === void 0 + ? void 0 + : _this$_head.value) !== null && _this$_head$value !== void 0 + ? _this$_head$value + : null; + } + + peekLast() { + var _this$_last$value, _this$_last; + + return (_this$_last$value = + (_this$_last = this._last) === null || _this$_last === void 0 + ? void 0 + : _this$_last.value) !== null && _this$_last$value !== void 0 + ? _this$_last$value + : null; + } +} diff --git a/node_modules/jest-worker/build/PriorityQueue.d.ts b/node_modules/jest-worker/build/PriorityQueue.d.ts new file mode 100644 index 0000000..d6bcf4c --- /dev/null +++ b/node_modules/jest-worker/build/PriorityQueue.d.ts @@ -0,0 +1,41 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import type { QueueChildMessage, TaskQueue } from './types'; +export declare type ComputeTaskPriorityCallback = (method: string, ...args: Array) => number; +declare type QueueItem = { + task: QueueChildMessage; + priority: number; +}; +/** + * Priority queue that processes tasks in natural ordering (lower priority first) + * accoridng to the priority computed by the function passed in the constructor. + * + * FIFO ordering isn't guaranteed for tasks with the same priority. + * + * Worker specific tasks with the same priority as a non-worker specific task + * are always processed first. + */ +export default class PriorityQueue implements TaskQueue { + private _computePriority; + private _queue; + private _sharedQueue; + constructor(_computePriority: ComputeTaskPriorityCallback); + enqueue(task: QueueChildMessage, workerId?: number): void; + _enqueue(task: QueueChildMessage, queue: MinHeap): void; + dequeue(workerId: number): QueueChildMessage | null; + _getWorkerQueue(workerId: number): MinHeap; +} +declare type HeapItem = { + priority: number; +}; +declare class MinHeap { + private _heap; + peek(): TItem | null; + add(item: TItem): void; + poll(): TItem | null; +} +export {}; diff --git a/node_modules/jest-worker/build/PriorityQueue.js b/node_modules/jest-worker/build/PriorityQueue.js new file mode 100644 index 0000000..6a55b59 --- /dev/null +++ b/node_modules/jest-worker/build/PriorityQueue.js @@ -0,0 +1,188 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = void 0; + +function _defineProperty(obj, key, value) { + if (key in obj) { + Object.defineProperty(obj, key, { + value: value, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key] = value; + } + return obj; +} + +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +/** + * Priority queue that processes tasks in natural ordering (lower priority first) + * accoridng to the priority computed by the function passed in the constructor. + * + * FIFO ordering isn't guaranteed for tasks with the same priority. + * + * Worker specific tasks with the same priority as a non-worker specific task + * are always processed first. + */ +class PriorityQueue { + constructor(_computePriority) { + _defineProperty(this, '_queue', []); + + _defineProperty(this, '_sharedQueue', new MinHeap()); + + this._computePriority = _computePriority; + } + + enqueue(task, workerId) { + if (workerId == null) { + this._enqueue(task, this._sharedQueue); + } else { + const queue = this._getWorkerQueue(workerId); + + this._enqueue(task, queue); + } + } + + _enqueue(task, queue) { + const item = { + priority: this._computePriority(task.request[2], ...task.request[3]), + task + }; + queue.add(item); + } + + dequeue(workerId) { + const workerQueue = this._getWorkerQueue(workerId); + + const workerTop = workerQueue.peek(); + + const sharedTop = this._sharedQueue.peek(); // use the task from the worker queue if there's no task in the shared queue + // or if the priority of the worker queue is smaller or equal to the + // priority of the top task in the shared queue. The tasks of the + // worker specific queue are preferred because no other worker can pick this + // specific task up. + + if ( + sharedTop == null || + (workerTop != null && workerTop.priority <= sharedTop.priority) + ) { + var _workerQueue$poll$tas, _workerQueue$poll; + + return (_workerQueue$poll$tas = + (_workerQueue$poll = workerQueue.poll()) === null || + _workerQueue$poll === void 0 + ? void 0 + : _workerQueue$poll.task) !== null && _workerQueue$poll$tas !== void 0 + ? _workerQueue$poll$tas + : null; + } + + return this._sharedQueue.poll().task; + } + + _getWorkerQueue(workerId) { + let queue = this._queue[workerId]; + + if (queue == null) { + queue = this._queue[workerId] = new MinHeap(); + } + + return queue; + } +} + +exports.default = PriorityQueue; + +class MinHeap { + constructor() { + _defineProperty(this, '_heap', []); + } + + peek() { + var _this$_heap$; + + return (_this$_heap$ = this._heap[0]) !== null && _this$_heap$ !== void 0 + ? _this$_heap$ + : null; + } + + add(item) { + const nodes = this._heap; + nodes.push(item); + + if (nodes.length === 1) { + return; + } + + let currentIndex = nodes.length - 1; // Bubble up the added node as long as the parent is bigger + + while (currentIndex > 0) { + const parentIndex = Math.floor((currentIndex + 1) / 2) - 1; + const parent = nodes[parentIndex]; + + if (parent.priority <= item.priority) { + break; + } + + nodes[currentIndex] = parent; + nodes[parentIndex] = item; + currentIndex = parentIndex; + } + } + + poll() { + const nodes = this._heap; + const result = nodes[0]; + const lastElement = nodes.pop(); // heap was empty or removed the last element + + if (result == null || nodes.length === 0) { + return result !== null && result !== void 0 ? result : null; + } + + let index = 0; + nodes[0] = + lastElement !== null && lastElement !== void 0 ? lastElement : null; + const element = nodes[0]; + + while (true) { + let swapIndex = null; + const rightChildIndex = (index + 1) * 2; + const leftChildIndex = rightChildIndex - 1; + const rightChild = nodes[rightChildIndex]; + const leftChild = nodes[leftChildIndex]; // if the left child is smaller, swap with the left + + if (leftChild != null && leftChild.priority < element.priority) { + swapIndex = leftChildIndex; + } // If the right child is smaller or the right child is smaller than the left + // then swap with the right child + + if ( + rightChild != null && + rightChild.priority < (swapIndex == null ? element : leftChild).priority + ) { + swapIndex = rightChildIndex; + } + + if (swapIndex == null) { + break; + } + + nodes[index] = nodes[swapIndex]; + nodes[swapIndex] = element; + index = swapIndex; + } + + return result; + } +} diff --git a/node_modules/jest-worker/build/WorkerPool.d.ts b/node_modules/jest-worker/build/WorkerPool.d.ts new file mode 100644 index 0000000..9f13ff7 --- /dev/null +++ b/node_modules/jest-worker/build/WorkerPool.d.ts @@ -0,0 +1,13 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import BaseWorkerPool from './base/BaseWorkerPool'; +import type { ChildMessage, OnCustomMessage, OnEnd, OnStart, WorkerInterface, WorkerOptions, WorkerPoolInterface } from './types'; +declare class WorkerPool extends BaseWorkerPool implements WorkerPoolInterface { + send(workerId: number, request: ChildMessage, onStart: OnStart, onEnd: OnEnd, onCustomMessage: OnCustomMessage): void; + createWorker(workerOptions: WorkerOptions): WorkerInterface; +} +export default WorkerPool; diff --git a/node_modules/jest-worker/build/WorkerPool.js b/node_modules/jest-worker/build/WorkerPool.js new file mode 100644 index 0000000..b19a679 --- /dev/null +++ b/node_modules/jest-worker/build/WorkerPool.js @@ -0,0 +1,49 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = void 0; + +var _BaseWorkerPool = _interopRequireDefault(require('./base/BaseWorkerPool')); + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {default: obj}; +} + +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +const canUseWorkerThreads = () => { + try { + require('worker_threads'); + + return true; + } catch { + return false; + } +}; + +class WorkerPool extends _BaseWorkerPool.default { + send(workerId, request, onStart, onEnd, onCustomMessage) { + this.getWorkerById(workerId).send(request, onStart, onEnd, onCustomMessage); + } + + createWorker(workerOptions) { + let Worker; + + if (this._options.enableWorkerThreads && canUseWorkerThreads()) { + Worker = require('./workers/NodeThreadsWorker').default; + } else { + Worker = require('./workers/ChildProcessWorker').default; + } + + return new Worker(workerOptions); + } +} + +var _default = WorkerPool; +exports.default = _default; diff --git a/node_modules/jest-worker/build/base/BaseWorkerPool.d.ts b/node_modules/jest-worker/build/base/BaseWorkerPool.d.ts new file mode 100644 index 0000000..311309e --- /dev/null +++ b/node_modules/jest-worker/build/base/BaseWorkerPool.d.ts @@ -0,0 +1,21 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +/// +import { PoolExitResult, WorkerInterface, WorkerOptions, WorkerPoolOptions } from '../types'; +export default class BaseWorkerPool { + private readonly _stderr; + private readonly _stdout; + protected readonly _options: WorkerPoolOptions; + private readonly _workers; + constructor(workerPath: string, options: WorkerPoolOptions); + getStderr(): NodeJS.ReadableStream; + getStdout(): NodeJS.ReadableStream; + getWorkers(): Array; + getWorkerById(workerId: number): WorkerInterface; + createWorker(_workerOptions: WorkerOptions): WorkerInterface; + end(): Promise; +} diff --git a/node_modules/jest-worker/build/base/BaseWorkerPool.js b/node_modules/jest-worker/build/base/BaseWorkerPool.js new file mode 100644 index 0000000..491deb8 --- /dev/null +++ b/node_modules/jest-worker/build/base/BaseWorkerPool.js @@ -0,0 +1,201 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = void 0; + +function path() { + const data = _interopRequireWildcard(require('path')); + + path = function () { + return data; + }; + + return data; +} + +function _mergeStream() { + const data = _interopRequireDefault(require('merge-stream')); + + _mergeStream = function () { + return data; + }; + + return data; +} + +var _types = require('../types'); + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {default: obj}; +} + +function _getRequireWildcardCache(nodeInterop) { + if (typeof WeakMap !== 'function') return null; + var cacheBabelInterop = new WeakMap(); + var cacheNodeInterop = new WeakMap(); + return (_getRequireWildcardCache = function (nodeInterop) { + return nodeInterop ? cacheNodeInterop : cacheBabelInterop; + })(nodeInterop); +} + +function _interopRequireWildcard(obj, nodeInterop) { + if (!nodeInterop && obj && obj.__esModule) { + return obj; + } + if (obj === null || (typeof obj !== 'object' && typeof obj !== 'function')) { + return {default: obj}; + } + var cache = _getRequireWildcardCache(nodeInterop); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = + Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (key !== 'default' && Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor + ? Object.getOwnPropertyDescriptor(obj, key) + : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; +} + +function _defineProperty(obj, key, value) { + if (key in obj) { + Object.defineProperty(obj, key, { + value: value, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key] = value; + } + return obj; +} + +// How long to wait for the child process to terminate +// after CHILD_MESSAGE_END before sending force exiting. +const FORCE_EXIT_DELAY = 500; +/* istanbul ignore next */ + +const emptyMethod = () => {}; + +class BaseWorkerPool { + constructor(workerPath, options) { + _defineProperty(this, '_stderr', void 0); + + _defineProperty(this, '_stdout', void 0); + + _defineProperty(this, '_options', void 0); + + _defineProperty(this, '_workers', void 0); + + this._options = options; + this._workers = new Array(options.numWorkers); + + if (!path().isAbsolute(workerPath)) { + workerPath = require.resolve(workerPath); + } + + const stdout = (0, _mergeStream().default)(); + const stderr = (0, _mergeStream().default)(); + const {forkOptions, maxRetries, resourceLimits, setupArgs} = options; + + for (let i = 0; i < options.numWorkers; i++) { + const workerOptions = { + forkOptions, + maxRetries, + resourceLimits, + setupArgs, + workerId: i, + workerPath + }; + const worker = this.createWorker(workerOptions); + const workerStdout = worker.getStdout(); + const workerStderr = worker.getStderr(); + + if (workerStdout) { + stdout.add(workerStdout); + } + + if (workerStderr) { + stderr.add(workerStderr); + } + + this._workers[i] = worker; + } + + this._stdout = stdout; + this._stderr = stderr; + } + + getStderr() { + return this._stderr; + } + + getStdout() { + return this._stdout; + } + + getWorkers() { + return this._workers; + } + + getWorkerById(workerId) { + return this._workers[workerId]; + } + + createWorker(_workerOptions) { + throw Error('Missing method createWorker in WorkerPool'); + } + + async end() { + // We do not cache the request object here. If so, it would only be only + // processed by one of the workers, and we want them all to close. + const workerExitPromises = this._workers.map(async worker => { + worker.send( + [_types.CHILD_MESSAGE_END, false], + emptyMethod, + emptyMethod, + emptyMethod + ); // Schedule a force exit in case worker fails to exit gracefully so + // await worker.waitForExit() never takes longer than FORCE_EXIT_DELAY + + let forceExited = false; + const forceExitTimeout = setTimeout(() => { + worker.forceExit(); + forceExited = true; + }, FORCE_EXIT_DELAY); + await worker.waitForExit(); // Worker ideally exited gracefully, don't send force exit then + + clearTimeout(forceExitTimeout); + return forceExited; + }); + + const workerExits = await Promise.all(workerExitPromises); + return workerExits.reduce( + (result, forceExited) => ({ + forceExited: result.forceExited || forceExited + }), + { + forceExited: false + } + ); + } +} + +exports.default = BaseWorkerPool; diff --git a/node_modules/jest-worker/build/index.d.ts b/node_modules/jest-worker/build/index.d.ts new file mode 100644 index 0000000..5908dbb --- /dev/null +++ b/node_modules/jest-worker/build/index.d.ts @@ -0,0 +1,49 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +/// +import type { FarmOptions, PoolExitResult, PromiseWithCustomMessage, TaskQueue } from './types'; +export { default as PriorityQueue } from './PriorityQueue'; +export { default as FifoQueue } from './FifoQueue'; +export { default as messageParent } from './workers/messageParent'; +/** + * The Jest farm (publicly called "Worker") is a class that allows you to queue + * methods across multiple child processes, in order to parallelize work. This + * is done by providing an absolute path to a module that will be loaded on each + * of the child processes, and bridged to the main process. + * + * Bridged methods are specified by using the "exposedMethods" property of the + * "options" object. This is an array of strings, where each of them corresponds + * to the exported name in the loaded module. + * + * You can also control the amount of workers by using the "numWorkers" property + * of the "options" object, and the settings passed to fork the process through + * the "forkOptions" property. The amount of workers defaults to the amount of + * CPUS minus one. + * + * Queueing calls can be done in two ways: + * - Standard method: calls will be redirected to the first available worker, + * so they will get executed as soon as they can. + * + * - Sticky method: if a "computeWorkerKey" method is provided within the + * config, the resulting string of this method will be used as a key. + * Every time this key is returned, it is guaranteed that your job will be + * processed by the same worker. This is specially useful if your workers + * are caching results. + */ +export declare class Worker { + private _ending; + private _farm; + private _options; + private _workerPool; + constructor(workerPath: string, options?: FarmOptions); + private _bindExposedWorkerMethods; + private _callFunctionWithArgs; + getStderr(): NodeJS.ReadableStream; + getStdout(): NodeJS.ReadableStream; + end(): Promise; +} +export type { PromiseWithCustomMessage, TaskQueue }; diff --git a/node_modules/jest-worker/build/index.js b/node_modules/jest-worker/build/index.js new file mode 100644 index 0000000..5dac183 --- /dev/null +++ b/node_modules/jest-worker/build/index.js @@ -0,0 +1,223 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +Object.defineProperty(exports, 'FifoQueue', { + enumerable: true, + get: function () { + return _FifoQueue.default; + } +}); +Object.defineProperty(exports, 'PriorityQueue', { + enumerable: true, + get: function () { + return _PriorityQueue.default; + } +}); +exports.Worker = void 0; +Object.defineProperty(exports, 'messageParent', { + enumerable: true, + get: function () { + return _messageParent.default; + } +}); + +function _os() { + const data = require('os'); + + _os = function () { + return data; + }; + + return data; +} + +var _Farm = _interopRequireDefault(require('./Farm')); + +var _WorkerPool = _interopRequireDefault(require('./WorkerPool')); + +var _PriorityQueue = _interopRequireDefault(require('./PriorityQueue')); + +var _FifoQueue = _interopRequireDefault(require('./FifoQueue')); + +var _messageParent = _interopRequireDefault(require('./workers/messageParent')); + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {default: obj}; +} + +function _defineProperty(obj, key, value) { + if (key in obj) { + Object.defineProperty(obj, key, { + value: value, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key] = value; + } + return obj; +} + +function getExposedMethods(workerPath, options) { + let exposedMethods = options.exposedMethods; // If no methods list is given, try getting it by auto-requiring the module. + + if (!exposedMethods) { + const module = require(workerPath); + + exposedMethods = Object.keys(module).filter( + // @ts-expect-error: no index + name => typeof module[name] === 'function' + ); + + if (typeof module === 'function') { + exposedMethods = [...exposedMethods, 'default']; + } + } + + return exposedMethods; +} +/** + * The Jest farm (publicly called "Worker") is a class that allows you to queue + * methods across multiple child processes, in order to parallelize work. This + * is done by providing an absolute path to a module that will be loaded on each + * of the child processes, and bridged to the main process. + * + * Bridged methods are specified by using the "exposedMethods" property of the + * "options" object. This is an array of strings, where each of them corresponds + * to the exported name in the loaded module. + * + * You can also control the amount of workers by using the "numWorkers" property + * of the "options" object, and the settings passed to fork the process through + * the "forkOptions" property. The amount of workers defaults to the amount of + * CPUS minus one. + * + * Queueing calls can be done in two ways: + * - Standard method: calls will be redirected to the first available worker, + * so they will get executed as soon as they can. + * + * - Sticky method: if a "computeWorkerKey" method is provided within the + * config, the resulting string of this method will be used as a key. + * Every time this key is returned, it is guaranteed that your job will be + * processed by the same worker. This is specially useful if your workers + * are caching results. + */ + +class Worker { + constructor(workerPath, options) { + var _this$_options$enable, + _this$_options$forkOp, + _this$_options$maxRet, + _this$_options$numWor, + _this$_options$resour, + _this$_options$setupA; + + _defineProperty(this, '_ending', void 0); + + _defineProperty(this, '_farm', void 0); + + _defineProperty(this, '_options', void 0); + + _defineProperty(this, '_workerPool', void 0); + + this._options = {...options}; + this._ending = false; + const workerPoolOptions = { + enableWorkerThreads: + (_this$_options$enable = this._options.enableWorkerThreads) !== null && + _this$_options$enable !== void 0 + ? _this$_options$enable + : false, + forkOptions: + (_this$_options$forkOp = this._options.forkOptions) !== null && + _this$_options$forkOp !== void 0 + ? _this$_options$forkOp + : {}, + maxRetries: + (_this$_options$maxRet = this._options.maxRetries) !== null && + _this$_options$maxRet !== void 0 + ? _this$_options$maxRet + : 3, + numWorkers: + (_this$_options$numWor = this._options.numWorkers) !== null && + _this$_options$numWor !== void 0 + ? _this$_options$numWor + : Math.max((0, _os().cpus)().length - 1, 1), + resourceLimits: + (_this$_options$resour = this._options.resourceLimits) !== null && + _this$_options$resour !== void 0 + ? _this$_options$resour + : {}, + setupArgs: + (_this$_options$setupA = this._options.setupArgs) !== null && + _this$_options$setupA !== void 0 + ? _this$_options$setupA + : [] + }; + + if (this._options.WorkerPool) { + // @ts-expect-error: constructor target any? + this._workerPool = new this._options.WorkerPool( + workerPath, + workerPoolOptions + ); + } else { + this._workerPool = new _WorkerPool.default(workerPath, workerPoolOptions); + } + + this._farm = new _Farm.default( + workerPoolOptions.numWorkers, + this._workerPool.send.bind(this._workerPool), + { + computeWorkerKey: this._options.computeWorkerKey, + taskQueue: this._options.taskQueue, + workerSchedulingPolicy: this._options.workerSchedulingPolicy + } + ); + + this._bindExposedWorkerMethods(workerPath, this._options); + } + + _bindExposedWorkerMethods(workerPath, options) { + getExposedMethods(workerPath, options).forEach(name => { + if (name.startsWith('_')) { + return; + } + + if (this.constructor.prototype.hasOwnProperty(name)) { + throw new TypeError('Cannot define a method called ' + name); + } // @ts-expect-error: dynamic extension of the class instance is expected. + + this[name] = this._callFunctionWithArgs.bind(this, name); + }); + } + + _callFunctionWithArgs(method, ...args) { + if (this._ending) { + throw new Error('Farm is ended, no more calls can be done to it'); + } + + return this._farm.doWork(method, ...args); + } + + getStderr() { + return this._workerPool.getStderr(); + } + + getStdout() { + return this._workerPool.getStdout(); + } + + async end() { + if (this._ending) { + throw new Error('Farm is ended, no more calls can be done to it'); + } + + this._ending = true; + return this._workerPool.end(); + } +} + +exports.Worker = Worker; diff --git a/node_modules/jest-worker/build/types.d.ts b/node_modules/jest-worker/build/types.d.ts new file mode 100644 index 0000000..be160f6 --- /dev/null +++ b/node_modules/jest-worker/build/types.d.ts @@ -0,0 +1,143 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +/// +import type { ForkOptions } from 'child_process'; +import type { EventEmitter } from 'events'; +export interface ResourceLimits { + maxYoungGenerationSizeMb?: number; + maxOldGenerationSizeMb?: number; + codeRangeSizeMb?: number; + stackSizeMb?: number; +} +export declare const CHILD_MESSAGE_INITIALIZE: 0; +export declare const CHILD_MESSAGE_CALL: 1; +export declare const CHILD_MESSAGE_END: 2; +export declare const PARENT_MESSAGE_OK: 0; +export declare const PARENT_MESSAGE_CLIENT_ERROR: 1; +export declare const PARENT_MESSAGE_SETUP_ERROR: 2; +export declare const PARENT_MESSAGE_CUSTOM: 3; +export declare type PARENT_MESSAGE_ERROR = typeof PARENT_MESSAGE_CLIENT_ERROR | typeof PARENT_MESSAGE_SETUP_ERROR; +export interface WorkerPoolInterface { + getStderr(): NodeJS.ReadableStream; + getStdout(): NodeJS.ReadableStream; + getWorkers(): Array; + createWorker(options: WorkerOptions): WorkerInterface; + send(workerId: number, request: ChildMessage, onStart: OnStart, onEnd: OnEnd, onCustomMessage: OnCustomMessage): void; + end(): Promise; +} +export interface WorkerInterface { + send(request: ChildMessage, onProcessStart: OnStart, onProcessEnd: OnEnd, onCustomMessage: OnCustomMessage): void; + waitForExit(): Promise; + forceExit(): void; + getWorkerId(): number; + getStderr(): NodeJS.ReadableStream | null; + getStdout(): NodeJS.ReadableStream | null; +} +export declare type PoolExitResult = { + forceExited: boolean; +}; +export interface PromiseWithCustomMessage extends Promise { + UNSTABLE_onCustomMessage?: (listener: OnCustomMessage) => () => void; +} +export type { ForkOptions }; +export interface TaskQueue { + /** + * Enqueues the task in the queue for the specified worker or adds it to the + * queue shared by all workers + * @param task the task to queue + * @param workerId the id of the worker that should process this task or undefined + * if there's no preference. + */ + enqueue(task: QueueChildMessage, workerId?: number): void; + /** + * Dequeues the next item from the queue for the speified worker + * @param workerId the id of the worker for which the next task should be retrieved + */ + dequeue(workerId: number): QueueChildMessage | null; +} +export declare type FarmOptions = { + computeWorkerKey?: (method: string, ...args: Array) => string | null; + exposedMethods?: ReadonlyArray; + forkOptions?: ForkOptions; + workerSchedulingPolicy?: 'round-robin' | 'in-order'; + resourceLimits?: ResourceLimits; + setupArgs?: Array; + maxRetries?: number; + numWorkers?: number; + taskQueue?: TaskQueue; + WorkerPool?: (workerPath: string, options?: WorkerPoolOptions) => WorkerPoolInterface; + enableWorkerThreads?: boolean; +}; +export declare type WorkerPoolOptions = { + setupArgs: Array; + forkOptions: ForkOptions; + resourceLimits: ResourceLimits; + maxRetries: number; + numWorkers: number; + enableWorkerThreads: boolean; +}; +export declare type WorkerOptions = { + forkOptions: ForkOptions; + resourceLimits: ResourceLimits; + setupArgs: Array; + maxRetries: number; + workerId: number; + workerData?: unknown; + workerPath: string; +}; +export declare type MessagePort = typeof EventEmitter & { + postMessage(message: unknown): void; +}; +export declare type MessageChannel = { + port1: MessagePort; + port2: MessagePort; +}; +export declare type ChildMessageInitialize = [ + typeof CHILD_MESSAGE_INITIALIZE, + boolean, + string, + // file + Array | undefined, + // setupArgs + MessagePort | undefined +]; +export declare type ChildMessageCall = [ + typeof CHILD_MESSAGE_CALL, + boolean, + string, + Array +]; +export declare type ChildMessageEnd = [ + typeof CHILD_MESSAGE_END, + boolean +]; +export declare type ChildMessage = ChildMessageInitialize | ChildMessageCall | ChildMessageEnd; +export declare type ParentMessageCustom = [ + typeof PARENT_MESSAGE_CUSTOM, + unknown +]; +export declare type ParentMessageOk = [ + typeof PARENT_MESSAGE_OK, + unknown +]; +export declare type ParentMessageError = [ + PARENT_MESSAGE_ERROR, + string, + string, + string, + unknown +]; +export declare type ParentMessage = ParentMessageOk | ParentMessageError | ParentMessageCustom; +export declare type OnStart = (worker: WorkerInterface) => void; +export declare type OnEnd = (err: Error | null, result: unknown) => void; +export declare type OnCustomMessage = (message: Array | unknown) => void; +export declare type QueueChildMessage = { + request: ChildMessageCall; + onStart: OnStart; + onEnd: OnEnd; + onCustomMessage: OnCustomMessage; +}; diff --git a/node_modules/jest-worker/build/types.js b/node_modules/jest-worker/build/types.js new file mode 100644 index 0000000..92b358b --- /dev/null +++ b/node_modules/jest-worker/build/types.js @@ -0,0 +1,39 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.PARENT_MESSAGE_SETUP_ERROR = + exports.PARENT_MESSAGE_OK = + exports.PARENT_MESSAGE_CUSTOM = + exports.PARENT_MESSAGE_CLIENT_ERROR = + exports.CHILD_MESSAGE_INITIALIZE = + exports.CHILD_MESSAGE_END = + exports.CHILD_MESSAGE_CALL = + void 0; + +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +// import type {ResourceLimits} from 'worker_threads'; +// This is not present in the Node 12 typings +// Because of the dynamic nature of a worker communication process, all messages +// coming from any of the other processes cannot be typed. Thus, many types +// include "unknown" as a TS type, which is (unfortunately) correct here. +const CHILD_MESSAGE_INITIALIZE = 0; +exports.CHILD_MESSAGE_INITIALIZE = CHILD_MESSAGE_INITIALIZE; +const CHILD_MESSAGE_CALL = 1; +exports.CHILD_MESSAGE_CALL = CHILD_MESSAGE_CALL; +const CHILD_MESSAGE_END = 2; +exports.CHILD_MESSAGE_END = CHILD_MESSAGE_END; +const PARENT_MESSAGE_OK = 0; +exports.PARENT_MESSAGE_OK = PARENT_MESSAGE_OK; +const PARENT_MESSAGE_CLIENT_ERROR = 1; +exports.PARENT_MESSAGE_CLIENT_ERROR = PARENT_MESSAGE_CLIENT_ERROR; +const PARENT_MESSAGE_SETUP_ERROR = 2; +exports.PARENT_MESSAGE_SETUP_ERROR = PARENT_MESSAGE_SETUP_ERROR; +const PARENT_MESSAGE_CUSTOM = 3; +exports.PARENT_MESSAGE_CUSTOM = PARENT_MESSAGE_CUSTOM; diff --git a/node_modules/jest-worker/build/workers/ChildProcessWorker.d.ts b/node_modules/jest-worker/build/workers/ChildProcessWorker.d.ts new file mode 100644 index 0000000..4a8dcf1 --- /dev/null +++ b/node_modules/jest-worker/build/workers/ChildProcessWorker.d.ts @@ -0,0 +1,51 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +/// +import { ChildMessage, OnCustomMessage, OnEnd, OnStart, WorkerInterface, WorkerOptions } from '../types'; +/** + * This class wraps the child process and provides a nice interface to + * communicate with. It takes care of: + * + * - Re-spawning the process if it dies. + * - Queues calls while the worker is busy. + * - Re-sends the requests if the worker blew up. + * + * The reason for queueing them here (since childProcess.send also has an + * internal queue) is because the worker could be doing asynchronous work, and + * this would lead to the child process to read its receiving buffer and start a + * second call. By queueing calls here, we don't send the next call to the + * children until we receive the result of the previous one. + * + * As soon as a request starts to be processed by a worker, its "processed" + * field is changed to "true", so that other workers which might encounter the + * same call skip it. + */ +export default class ChildProcessWorker implements WorkerInterface { + private _child; + private _options; + private _request; + private _retries; + private _onProcessEnd; + private _onCustomMessage; + private _fakeStream; + private _stdout; + private _stderr; + private _exitPromise; + private _resolveExitPromise; + constructor(options: WorkerOptions); + initialize(): void; + private _shutdown; + private _onMessage; + private _onExit; + send(request: ChildMessage, onProcessStart: OnStart, onProcessEnd: OnEnd, onCustomMessage: OnCustomMessage): void; + waitForExit(): Promise; + forceExit(): void; + getWorkerId(): number; + getStdout(): NodeJS.ReadableStream | null; + getStderr(): NodeJS.ReadableStream | null; + private _getFakeStream; +} diff --git a/node_modules/jest-worker/build/workers/ChildProcessWorker.js b/node_modules/jest-worker/build/workers/ChildProcessWorker.js new file mode 100644 index 0000000..f8a42c9 --- /dev/null +++ b/node_modules/jest-worker/build/workers/ChildProcessWorker.js @@ -0,0 +1,333 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = void 0; + +function _child_process() { + const data = require('child_process'); + + _child_process = function () { + return data; + }; + + return data; +} + +function _stream() { + const data = require('stream'); + + _stream = function () { + return data; + }; + + return data; +} + +function _mergeStream() { + const data = _interopRequireDefault(require('merge-stream')); + + _mergeStream = function () { + return data; + }; + + return data; +} + +function _supportsColor() { + const data = require('supports-color'); + + _supportsColor = function () { + return data; + }; + + return data; +} + +var _types = require('../types'); + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {default: obj}; +} + +function _defineProperty(obj, key, value) { + if (key in obj) { + Object.defineProperty(obj, key, { + value: value, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key] = value; + } + return obj; +} + +const SIGNAL_BASE_EXIT_CODE = 128; +const SIGKILL_EXIT_CODE = SIGNAL_BASE_EXIT_CODE + 9; +const SIGTERM_EXIT_CODE = SIGNAL_BASE_EXIT_CODE + 15; // How long to wait after SIGTERM before sending SIGKILL + +const SIGKILL_DELAY = 500; +/** + * This class wraps the child process and provides a nice interface to + * communicate with. It takes care of: + * + * - Re-spawning the process if it dies. + * - Queues calls while the worker is busy. + * - Re-sends the requests if the worker blew up. + * + * The reason for queueing them here (since childProcess.send also has an + * internal queue) is because the worker could be doing asynchronous work, and + * this would lead to the child process to read its receiving buffer and start a + * second call. By queueing calls here, we don't send the next call to the + * children until we receive the result of the previous one. + * + * As soon as a request starts to be processed by a worker, its "processed" + * field is changed to "true", so that other workers which might encounter the + * same call skip it. + */ + +class ChildProcessWorker { + constructor(options) { + _defineProperty(this, '_child', void 0); + + _defineProperty(this, '_options', void 0); + + _defineProperty(this, '_request', void 0); + + _defineProperty(this, '_retries', void 0); + + _defineProperty(this, '_onProcessEnd', void 0); + + _defineProperty(this, '_onCustomMessage', void 0); + + _defineProperty(this, '_fakeStream', void 0); + + _defineProperty(this, '_stdout', void 0); + + _defineProperty(this, '_stderr', void 0); + + _defineProperty(this, '_exitPromise', void 0); + + _defineProperty(this, '_resolveExitPromise', void 0); + + this._options = options; + this._request = null; + this._fakeStream = null; + this._stdout = null; + this._stderr = null; + this._exitPromise = new Promise(resolve => { + this._resolveExitPromise = resolve; + }); + this.initialize(); + } + + initialize() { + const forceColor = _supportsColor().stdout + ? { + FORCE_COLOR: '1' + } + : {}; + const child = (0, _child_process().fork)( + require.resolve('./processChild'), + [], + { + cwd: process.cwd(), + env: { + ...process.env, + JEST_WORKER_ID: String(this._options.workerId + 1), + // 0-indexed workerId, 1-indexed JEST_WORKER_ID + ...forceColor + }, + // Suppress --debug / --inspect flags while preserving others (like --harmony). + execArgv: process.execArgv.filter(v => !/^--(debug|inspect)/.test(v)), + silent: true, + ...this._options.forkOptions + } + ); + + if (child.stdout) { + if (!this._stdout) { + // We need to add a permanent stream to the merged stream to prevent it + // from ending when the subprocess stream ends + this._stdout = (0, _mergeStream().default)(this._getFakeStream()); + } + + this._stdout.add(child.stdout); + } + + if (child.stderr) { + if (!this._stderr) { + // We need to add a permanent stream to the merged stream to prevent it + // from ending when the subprocess stream ends + this._stderr = (0, _mergeStream().default)(this._getFakeStream()); + } + + this._stderr.add(child.stderr); + } + + child.on('message', this._onMessage.bind(this)); + child.on('exit', this._onExit.bind(this)); + child.send([ + _types.CHILD_MESSAGE_INITIALIZE, + false, + this._options.workerPath, + this._options.setupArgs + ]); + this._child = child; + this._retries++; // If we exceeded the amount of retries, we will emulate an error reply + // coming from the child. This avoids code duplication related with cleaning + // the queue, and scheduling the next call. + + if (this._retries > this._options.maxRetries) { + const error = new Error( + `Jest worker encountered ${this._retries} child process exceptions, exceeding retry limit` + ); + + this._onMessage([ + _types.PARENT_MESSAGE_CLIENT_ERROR, + error.name, + error.message, + error.stack, + { + type: 'WorkerError' + } + ]); + } + } + + _shutdown() { + // End the temporary streams so the merged streams end too + if (this._fakeStream) { + this._fakeStream.end(); + + this._fakeStream = null; + } + + this._resolveExitPromise(); + } + + _onMessage(response) { + // TODO: Add appropriate type check + let error; + + switch (response[0]) { + case _types.PARENT_MESSAGE_OK: + this._onProcessEnd(null, response[1]); + + break; + + case _types.PARENT_MESSAGE_CLIENT_ERROR: + error = response[4]; + + if (error != null && typeof error === 'object') { + const extra = error; // @ts-expect-error: no index + + const NativeCtor = global[response[1]]; + const Ctor = typeof NativeCtor === 'function' ? NativeCtor : Error; + error = new Ctor(response[2]); + error.type = response[1]; + error.stack = response[3]; + + for (const key in extra) { + error[key] = extra[key]; + } + } + + this._onProcessEnd(error, null); + + break; + + case _types.PARENT_MESSAGE_SETUP_ERROR: + error = new Error('Error when calling setup: ' + response[2]); + error.type = response[1]; + error.stack = response[3]; + + this._onProcessEnd(error, null); + + break; + + case _types.PARENT_MESSAGE_CUSTOM: + this._onCustomMessage(response[1]); + + break; + + default: + throw new TypeError('Unexpected response from worker: ' + response[0]); + } + } + + _onExit(exitCode) { + if ( + exitCode !== 0 && + exitCode !== null && + exitCode !== SIGTERM_EXIT_CODE && + exitCode !== SIGKILL_EXIT_CODE + ) { + this.initialize(); + + if (this._request) { + this._child.send(this._request); + } + } else { + this._shutdown(); + } + } + + send(request, onProcessStart, onProcessEnd, onCustomMessage) { + onProcessStart(this); + + this._onProcessEnd = (...args) => { + // Clean the request to avoid sending past requests to workers that fail + // while waiting for a new request (timers, unhandled rejections...) + this._request = null; + return onProcessEnd(...args); + }; + + this._onCustomMessage = (...arg) => onCustomMessage(...arg); + + this._request = request; + this._retries = 0; + + this._child.send(request, () => {}); + } + + waitForExit() { + return this._exitPromise; + } + + forceExit() { + this._child.kill('SIGTERM'); + + const sigkillTimeout = setTimeout( + () => this._child.kill('SIGKILL'), + SIGKILL_DELAY + ); + + this._exitPromise.then(() => clearTimeout(sigkillTimeout)); + } + + getWorkerId() { + return this._options.workerId; + } + + getStdout() { + return this._stdout; + } + + getStderr() { + return this._stderr; + } + + _getFakeStream() { + if (!this._fakeStream) { + this._fakeStream = new (_stream().PassThrough)(); + } + + return this._fakeStream; + } +} + +exports.default = ChildProcessWorker; diff --git a/node_modules/jest-worker/build/workers/NodeThreadsWorker.d.ts b/node_modules/jest-worker/build/workers/NodeThreadsWorker.d.ts new file mode 100644 index 0000000..4696ecc --- /dev/null +++ b/node_modules/jest-worker/build/workers/NodeThreadsWorker.d.ts @@ -0,0 +1,34 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +/// +import { ChildMessage, OnCustomMessage, OnEnd, OnStart, WorkerInterface, WorkerOptions } from '../types'; +export default class ExperimentalWorker implements WorkerInterface { + private _worker; + private _options; + private _request; + private _retries; + private _onProcessEnd; + private _onCustomMessage; + private _fakeStream; + private _stdout; + private _stderr; + private _exitPromise; + private _resolveExitPromise; + private _forceExited; + constructor(options: WorkerOptions); + initialize(): void; + private _shutdown; + private _onMessage; + private _onExit; + waitForExit(): Promise; + forceExit(): void; + send(request: ChildMessage, onProcessStart: OnStart, onProcessEnd: OnEnd | null, onCustomMessage: OnCustomMessage): void; + getWorkerId(): number; + getStdout(): NodeJS.ReadableStream | null; + getStderr(): NodeJS.ReadableStream | null; + private _getFakeStream; +} diff --git a/node_modules/jest-worker/build/workers/NodeThreadsWorker.js b/node_modules/jest-worker/build/workers/NodeThreadsWorker.js new file mode 100644 index 0000000..21b7dd2 --- /dev/null +++ b/node_modules/jest-worker/build/workers/NodeThreadsWorker.js @@ -0,0 +1,344 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = void 0; + +function path() { + const data = _interopRequireWildcard(require('path')); + + path = function () { + return data; + }; + + return data; +} + +function _stream() { + const data = require('stream'); + + _stream = function () { + return data; + }; + + return data; +} + +function _worker_threads() { + const data = require('worker_threads'); + + _worker_threads = function () { + return data; + }; + + return data; +} + +function _mergeStream() { + const data = _interopRequireDefault(require('merge-stream')); + + _mergeStream = function () { + return data; + }; + + return data; +} + +var _types = require('../types'); + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {default: obj}; +} + +function _getRequireWildcardCache(nodeInterop) { + if (typeof WeakMap !== 'function') return null; + var cacheBabelInterop = new WeakMap(); + var cacheNodeInterop = new WeakMap(); + return (_getRequireWildcardCache = function (nodeInterop) { + return nodeInterop ? cacheNodeInterop : cacheBabelInterop; + })(nodeInterop); +} + +function _interopRequireWildcard(obj, nodeInterop) { + if (!nodeInterop && obj && obj.__esModule) { + return obj; + } + if (obj === null || (typeof obj !== 'object' && typeof obj !== 'function')) { + return {default: obj}; + } + var cache = _getRequireWildcardCache(nodeInterop); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = + Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (key !== 'default' && Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor + ? Object.getOwnPropertyDescriptor(obj, key) + : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; +} + +function _defineProperty(obj, key, value) { + if (key in obj) { + Object.defineProperty(obj, key, { + value: value, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key] = value; + } + return obj; +} + +class ExperimentalWorker { + constructor(options) { + _defineProperty(this, '_worker', void 0); + + _defineProperty(this, '_options', void 0); + + _defineProperty(this, '_request', void 0); + + _defineProperty(this, '_retries', void 0); + + _defineProperty(this, '_onProcessEnd', void 0); + + _defineProperty(this, '_onCustomMessage', void 0); + + _defineProperty(this, '_fakeStream', void 0); + + _defineProperty(this, '_stdout', void 0); + + _defineProperty(this, '_stderr', void 0); + + _defineProperty(this, '_exitPromise', void 0); + + _defineProperty(this, '_resolveExitPromise', void 0); + + _defineProperty(this, '_forceExited', void 0); + + this._options = options; + this._request = null; + this._fakeStream = null; + this._stdout = null; + this._stderr = null; + this._exitPromise = new Promise(resolve => { + this._resolveExitPromise = resolve; + }); + this._forceExited = false; + this.initialize(); + } + + initialize() { + this._worker = new (_worker_threads().Worker)( + path().resolve(__dirname, './threadChild.js'), + { + eval: false, + // @ts-expect-error: added in newer versions + resourceLimits: this._options.resourceLimits, + stderr: true, + stdout: true, + workerData: this._options.workerData, + ...this._options.forkOptions + } + ); + + if (this._worker.stdout) { + if (!this._stdout) { + // We need to add a permanent stream to the merged stream to prevent it + // from ending when the subprocess stream ends + this._stdout = (0, _mergeStream().default)(this._getFakeStream()); + } + + this._stdout.add(this._worker.stdout); + } + + if (this._worker.stderr) { + if (!this._stderr) { + // We need to add a permanent stream to the merged stream to prevent it + // from ending when the subprocess stream ends + this._stderr = (0, _mergeStream().default)(this._getFakeStream()); + } + + this._stderr.add(this._worker.stderr); + } + + this._worker.on('message', this._onMessage.bind(this)); + + this._worker.on('exit', this._onExit.bind(this)); + + this._worker.postMessage([ + _types.CHILD_MESSAGE_INITIALIZE, + false, + this._options.workerPath, + this._options.setupArgs, + String(this._options.workerId + 1) // 0-indexed workerId, 1-indexed JEST_WORKER_ID + ]); + + this._retries++; // If we exceeded the amount of retries, we will emulate an error reply + // coming from the child. This avoids code duplication related with cleaning + // the queue, and scheduling the next call. + + if (this._retries > this._options.maxRetries) { + const error = new Error('Call retries were exceeded'); + + this._onMessage([ + _types.PARENT_MESSAGE_CLIENT_ERROR, + error.name, + error.message, + error.stack, + { + type: 'WorkerError' + } + ]); + } + } + + _shutdown() { + // End the permanent stream so the merged stream end too + if (this._fakeStream) { + this._fakeStream.end(); + + this._fakeStream = null; + } + + this._resolveExitPromise(); + } + + _onMessage(response) { + let error; + + switch (response[0]) { + case _types.PARENT_MESSAGE_OK: + this._onProcessEnd(null, response[1]); + + break; + + case _types.PARENT_MESSAGE_CLIENT_ERROR: + error = response[4]; + + if (error != null && typeof error === 'object') { + const extra = error; // @ts-expect-error: no index + + const NativeCtor = global[response[1]]; + const Ctor = typeof NativeCtor === 'function' ? NativeCtor : Error; + error = new Ctor(response[2]); + error.type = response[1]; + error.stack = response[3]; + + for (const key in extra) { + // @ts-expect-error: no index + error[key] = extra[key]; + } + } + + this._onProcessEnd(error, null); + + break; + + case _types.PARENT_MESSAGE_SETUP_ERROR: + error = new Error('Error when calling setup: ' + response[2]); // @ts-expect-error: adding custom properties to errors. + + error.type = response[1]; + error.stack = response[3]; + + this._onProcessEnd(error, null); + + break; + + case _types.PARENT_MESSAGE_CUSTOM: + this._onCustomMessage(response[1]); + + break; + + default: + throw new TypeError('Unexpected response from worker: ' + response[0]); + } + } + + _onExit(exitCode) { + if (exitCode !== 0 && !this._forceExited) { + this.initialize(); + + if (this._request) { + this._worker.postMessage(this._request); + } + } else { + this._shutdown(); + } + } + + waitForExit() { + return this._exitPromise; + } + + forceExit() { + this._forceExited = true; + + this._worker.terminate(); + } + + send(request, onProcessStart, onProcessEnd, onCustomMessage) { + onProcessStart(this); + + this._onProcessEnd = (...args) => { + var _onProcessEnd; + + // Clean the request to avoid sending past requests to workers that fail + // while waiting for a new request (timers, unhandled rejections...) + this._request = null; + const res = + (_onProcessEnd = onProcessEnd) === null || _onProcessEnd === void 0 + ? void 0 + : _onProcessEnd(...args); // Clean up the reference so related closures can be garbage collected. + + onProcessEnd = null; + return res; + }; + + this._onCustomMessage = (...arg) => onCustomMessage(...arg); + + this._request = request; + this._retries = 0; + + this._worker.postMessage(request); + } + + getWorkerId() { + return this._options.workerId; + } + + getStdout() { + return this._stdout; + } + + getStderr() { + return this._stderr; + } + + _getFakeStream() { + if (!this._fakeStream) { + this._fakeStream = new (_stream().PassThrough)(); + } + + return this._fakeStream; + } +} + +exports.default = ExperimentalWorker; diff --git a/node_modules/jest-worker/build/workers/messageParent.d.ts b/node_modules/jest-worker/build/workers/messageParent.d.ts new file mode 100644 index 0000000..795bb35 --- /dev/null +++ b/node_modules/jest-worker/build/workers/messageParent.d.ts @@ -0,0 +1,8 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +/// +export default function messageParent(message: unknown, parentProcess?: NodeJS.Process): void; diff --git a/node_modules/jest-worker/build/workers/messageParent.js b/node_modules/jest-worker/build/workers/messageParent.js new file mode 100644 index 0000000..51765ff --- /dev/null +++ b/node_modules/jest-worker/build/workers/messageParent.js @@ -0,0 +1,38 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = messageParent; + +var _types = require('../types'); + +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +const isWorkerThread = (() => { + try { + // `Require` here to support Node v10 + const {isMainThread, parentPort} = require('worker_threads'); + + return !isMainThread && parentPort != null; + } catch { + return false; + } +})(); + +function messageParent(message, parentProcess = process) { + if (isWorkerThread) { + // `Require` here to support Node v10 + const {parentPort} = require('worker_threads'); // ! is safe due to `null` check in `isWorkerThread` + + parentPort.postMessage([_types.PARENT_MESSAGE_CUSTOM, message]); + } else if (typeof parentProcess.send === 'function') { + parentProcess.send([_types.PARENT_MESSAGE_CUSTOM, message]); + } else { + throw new Error('"messageParent" can only be used inside a worker'); + } +} diff --git a/node_modules/jest-worker/build/workers/processChild.d.ts b/node_modules/jest-worker/build/workers/processChild.d.ts new file mode 100644 index 0000000..fac0c7e --- /dev/null +++ b/node_modules/jest-worker/build/workers/processChild.d.ts @@ -0,0 +1,7 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +export {}; diff --git a/node_modules/jest-worker/build/workers/processChild.js b/node_modules/jest-worker/build/workers/processChild.js new file mode 100644 index 0000000..fdf766e --- /dev/null +++ b/node_modules/jest-worker/build/workers/processChild.js @@ -0,0 +1,148 @@ +'use strict'; + +var _types = require('../types'); + +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +let file = null; +let setupArgs = []; +let initialized = false; +/** + * This file is a small bootstrapper for workers. It sets up the communication + * between the worker and the parent process, interpreting parent messages and + * sending results back. + * + * The file loaded will be lazily initialized the first time any of the workers + * is called. This is done for optimal performance: if the farm is initialized, + * but no call is made to it, child Node processes will be consuming the least + * possible amount of memory. + * + * If an invalid message is detected, the child will exit (by throwing) with a + * non-zero exit code. + */ + +const messageListener = request => { + switch (request[0]) { + case _types.CHILD_MESSAGE_INITIALIZE: + const init = request; + file = init[2]; + setupArgs = request[3]; + break; + + case _types.CHILD_MESSAGE_CALL: + const call = request; + execMethod(call[2], call[3]); + break; + + case _types.CHILD_MESSAGE_END: + end(); + break; + + default: + throw new TypeError( + 'Unexpected request from parent process: ' + request[0] + ); + } +}; + +process.on('message', messageListener); + +function reportSuccess(result) { + if (!process || !process.send) { + throw new Error('Child can only be used on a forked process'); + } + + process.send([_types.PARENT_MESSAGE_OK, result]); +} + +function reportClientError(error) { + return reportError(error, _types.PARENT_MESSAGE_CLIENT_ERROR); +} + +function reportInitializeError(error) { + return reportError(error, _types.PARENT_MESSAGE_SETUP_ERROR); +} + +function reportError(error, type) { + if (!process || !process.send) { + throw new Error('Child can only be used on a forked process'); + } + + if (error == null) { + error = new Error('"null" or "undefined" thrown'); + } + + process.send([ + type, + error.constructor && error.constructor.name, + error.message, + error.stack, + typeof error === 'object' ? {...error} : error + ]); +} + +function end() { + const main = require(file); + + if (!main.teardown) { + exitProcess(); + return; + } + + execFunction(main.teardown, main, [], exitProcess, exitProcess); +} + +function exitProcess() { + // Clean up open handles so the process ideally exits gracefully + process.removeListener('message', messageListener); +} + +function execMethod(method, args) { + const main = require(file); + + let fn; + + if (method === 'default') { + fn = main.__esModule ? main['default'] : main; + } else { + fn = main[method]; + } + + function execHelper() { + execFunction(fn, main, args, reportSuccess, reportClientError); + } + + if (initialized || !main.setup) { + execHelper(); + return; + } + + initialized = true; + execFunction(main.setup, main, setupArgs, execHelper, reportInitializeError); +} + +const isPromise = obj => + !!obj && + (typeof obj === 'object' || typeof obj === 'function') && + typeof obj.then === 'function'; + +function execFunction(fn, ctx, args, onResult, onError) { + let result; + + try { + result = fn.apply(ctx, args); + } catch (err) { + onError(err); + return; + } + + if (isPromise(result)) { + result.then(onResult, onError); + } else { + onResult(result); + } +} diff --git a/node_modules/jest-worker/build/workers/threadChild.d.ts b/node_modules/jest-worker/build/workers/threadChild.d.ts new file mode 100644 index 0000000..fac0c7e --- /dev/null +++ b/node_modules/jest-worker/build/workers/threadChild.d.ts @@ -0,0 +1,7 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +export {}; diff --git a/node_modules/jest-worker/build/workers/threadChild.js b/node_modules/jest-worker/build/workers/threadChild.js new file mode 100644 index 0000000..dae1e64 --- /dev/null +++ b/node_modules/jest-worker/build/workers/threadChild.js @@ -0,0 +1,159 @@ +'use strict'; + +function _worker_threads() { + const data = require('worker_threads'); + + _worker_threads = function () { + return data; + }; + + return data; +} + +var _types = require('../types'); + +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +let file = null; +let setupArgs = []; +let initialized = false; +/** + * This file is a small bootstrapper for workers. It sets up the communication + * between the worker and the parent process, interpreting parent messages and + * sending results back. + * + * The file loaded will be lazily initialized the first time any of the workers + * is called. This is done for optimal performance: if the farm is initialized, + * but no call is made to it, child Node processes will be consuming the least + * possible amount of memory. + * + * If an invalid message is detected, the child will exit (by throwing) with a + * non-zero exit code. + */ + +const messageListener = request => { + switch (request[0]) { + case _types.CHILD_MESSAGE_INITIALIZE: + const init = request; + file = init[2]; + setupArgs = request[3]; + process.env.JEST_WORKER_ID = request[4]; + break; + + case _types.CHILD_MESSAGE_CALL: + const call = request; + execMethod(call[2], call[3]); + break; + + case _types.CHILD_MESSAGE_END: + end(); + break; + + default: + throw new TypeError( + 'Unexpected request from parent process: ' + request[0] + ); + } +}; + +_worker_threads().parentPort.on('message', messageListener); + +function reportSuccess(result) { + if (_worker_threads().isMainThread) { + throw new Error('Child can only be used on a forked process'); + } + + _worker_threads().parentPort.postMessage([_types.PARENT_MESSAGE_OK, result]); +} + +function reportClientError(error) { + return reportError(error, _types.PARENT_MESSAGE_CLIENT_ERROR); +} + +function reportInitializeError(error) { + return reportError(error, _types.PARENT_MESSAGE_SETUP_ERROR); +} + +function reportError(error, type) { + if (_worker_threads().isMainThread) { + throw new Error('Child can only be used on a forked process'); + } + + if (error == null) { + error = new Error('"null" or "undefined" thrown'); + } + + _worker_threads().parentPort.postMessage([ + type, + error.constructor && error.constructor.name, + error.message, + error.stack, + typeof error === 'object' ? {...error} : error + ]); +} + +function end() { + const main = require(file); + + if (!main.teardown) { + exitProcess(); + return; + } + + execFunction(main.teardown, main, [], exitProcess, exitProcess); +} + +function exitProcess() { + // Clean up open handles so the worker ideally exits gracefully + _worker_threads().parentPort.removeListener('message', messageListener); +} + +function execMethod(method, args) { + const main = require(file); + + let fn; + + if (method === 'default') { + fn = main.__esModule ? main['default'] : main; + } else { + fn = main[method]; + } + + function execHelper() { + execFunction(fn, main, args, reportSuccess, reportClientError); + } + + if (initialized || !main.setup) { + execHelper(); + return; + } + + initialized = true; + execFunction(main.setup, main, setupArgs, execHelper, reportInitializeError); +} + +const isPromise = obj => + !!obj && + (typeof obj === 'object' || typeof obj === 'function') && + typeof obj.then === 'function'; + +function execFunction(fn, ctx, args, onResult, onError) { + let result; + + try { + result = fn.apply(ctx, args); + } catch (err) { + onError(err); + return; + } + + if (isPromise(result)) { + result.then(onResult, onError); + } else { + onResult(result); + } +} diff --git a/node_modules/jest-worker/package.json b/node_modules/jest-worker/package.json new file mode 100644 index 0000000..06280d1 --- /dev/null +++ b/node_modules/jest-worker/package.json @@ -0,0 +1,38 @@ +{ + "name": "jest-worker", + "version": "27.5.1", + "repository": { + "type": "git", + "url": "https://github.com/facebook/jest.git", + "directory": "packages/jest-worker" + }, + "license": "MIT", + "main": "./build/index.js", + "types": "./build/index.d.ts", + "exports": { + ".": { + "types": "./build/index.d.ts", + "default": "./build/index.js" + }, + "./package.json": "./package.json" + }, + "dependencies": { + "@types/node": "*", + "merge-stream": "^2.0.0", + "supports-color": "^8.0.0" + }, + "devDependencies": { + "@types/merge-stream": "^1.1.2", + "@types/supports-color": "^8.1.0", + "get-stream": "^6.0.0", + "jest-leak-detector": "^27.5.1", + "worker-farm": "^1.6.0" + }, + "engines": { + "node": ">= 10.13.0" + }, + "publishConfig": { + "access": "public" + }, + "gitHead": "67c1aa20c5fec31366d733e901fee2b981cb1850" +} diff --git a/node_modules/json-parse-even-better-errors/CHANGELOG.md b/node_modules/json-parse-even-better-errors/CHANGELOG.md new file mode 100644 index 0000000..dfd6733 --- /dev/null +++ b/node_modules/json-parse-even-better-errors/CHANGELOG.md @@ -0,0 +1,50 @@ +# Change Log + +All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + +## 2.0.0 + +* Add custom error classes + +
+## [1.0.2](https://github.com/npm/json-parse-even-better-errors/compare/v1.0.1...v1.0.2) (2018-03-30) + + +### Bug Fixes + +* **messages:** More friendly messages for non-string ([#1](https://github.com/npm/json-parse-even-better-errors/issues/1)) ([a476d42](https://github.com/npm/json-parse-even-better-errors/commit/a476d42)) + + + + +## [1.0.1](https://github.com/npm/json-parse-even-better-errors/compare/v1.0.0...v1.0.1) (2017-08-16) + + +### Bug Fixes + +* **license:** oops. Forgot to update license.md ([efe2958](https://github.com/npm/json-parse-even-better-errors/commit/efe2958)) + + + + +# 1.0.0 (2017-08-15) + + +### Features + +* **init:** Initial Commit ([562c977](https://github.com/npm/json-parse-even-better-errors/commit/562c977)) + + +### BREAKING CHANGES + +* **init:** This is the first commit! + + + + +# 0.1.0 (2017-08-15) + + +### Features + +* **init:** Initial Commit ([9dd1a19](https://github.com/npm/json-parse-even-better-errors/commit/9dd1a19)) diff --git a/node_modules/json-parse-even-better-errors/LICENSE.md b/node_modules/json-parse-even-better-errors/LICENSE.md new file mode 100644 index 0000000..6991b7c --- /dev/null +++ b/node_modules/json-parse-even-better-errors/LICENSE.md @@ -0,0 +1,25 @@ +Copyright 2017 Kat Marchán +Copyright npm, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. + +--- + +This library is a fork of 'better-json-errors' by Kat Marchán, extended and +distributed under the terms of the MIT license above. diff --git a/node_modules/json-parse-even-better-errors/README.md b/node_modules/json-parse-even-better-errors/README.md new file mode 100644 index 0000000..2799efe --- /dev/null +++ b/node_modules/json-parse-even-better-errors/README.md @@ -0,0 +1,96 @@ +# json-parse-even-better-errors + +[`json-parse-even-better-errors`](https://github.com/npm/json-parse-even-better-errors) +is a Node.js library for getting nicer errors out of `JSON.parse()`, +including context and position of the parse errors. + +It also preserves the newline and indentation styles of the JSON data, by +putting them in the object or array in the `Symbol.for('indent')` and +`Symbol.for('newline')` properties. + +## Install + +`$ npm install --save json-parse-even-better-errors` + +## Table of Contents + +* [Example](#example) +* [Features](#features) +* [Contributing](#contributing) +* [API](#api) + * [`parse`](#parse) + +### Example + +```javascript +const parseJson = require('json-parse-even-better-errors') + +parseJson('"foo"') // returns the string 'foo' +parseJson('garbage') // more useful error message +parseJson.noExceptions('garbage') // returns undefined +``` + +### Features + +* Like JSON.parse, but the errors are better. +* Strips a leading byte-order-mark that you sometimes get reading files. +* Has a `noExceptions` method that returns undefined rather than throwing. +* Attaches the newline character(s) used to the `Symbol.for('newline')` + property on objects and arrays. +* Attaches the indentation character(s) used to the `Symbol.for('indent')` + property on objects and arrays. + +## Indentation + +To preserve indentation when the file is saved back to disk, use +`data[Symbol.for('indent')]` as the third argument to `JSON.stringify`, and +if you want to preserve windows `\r\n` newlines, replace the `\n` chars in +the string with `data[Symbol.for('newline')]`. + +For example: + +```js +const txt = await readFile('./package.json', 'utf8') +const data = parseJsonEvenBetterErrors(txt) +const indent = Symbol.for('indent') +const newline = Symbol.for('newline') +// .. do some stuff to the data .. +const string = JSON.stringify(data, null, data[indent]) + '\n' +const eolFixed = data[newline] === '\n' ? string + : string.replace(/\n/g, data[newline]) +await writeFile('./package.json', eolFixed) +``` + +Indentation is determined by looking at the whitespace between the initial +`{` and `[` and the character that follows it. If you have lots of weird +inconsistent indentation, then it won't track that or give you any way to +preserve it. Whether this is a bug or a feature is debatable ;) + +### API + +#### `parse(txt, reviver = null, context = 20)` + +Works just like `JSON.parse`, but will include a bit more information when +an error happens, and attaches a `Symbol.for('indent')` and +`Symbol.for('newline')` on objects and arrays. This throws a +`JSONParseError`. + +#### `parse.noExceptions(txt, reviver = null)` + +Works just like `JSON.parse`, but will return `undefined` rather than +throwing an error. + +#### `class JSONParseError(er, text, context = 20, caller = null)` + +Extends the JavaScript `SyntaxError` class to parse the message and provide +better metadata. + +Pass in the error thrown by the built-in `JSON.parse`, and the text being +parsed, and it'll parse out the bits needed to be helpful. + +`context` defaults to 20. + +Set a `caller` function to trim internal implementation details out of the +stack trace. When calling `parseJson`, this is set to the `parseJson` +function. If not set, then the constructor defaults to itself, so the +stack trace will point to the spot where you call `new JSONParseError`. diff --git a/node_modules/json-parse-even-better-errors/index.js b/node_modules/json-parse-even-better-errors/index.js new file mode 100644 index 0000000..86a1fdc --- /dev/null +++ b/node_modules/json-parse-even-better-errors/index.js @@ -0,0 +1,121 @@ +'use strict' + +const hexify = char => { + const h = char.charCodeAt(0).toString(16).toUpperCase() + return '0x' + (h.length % 2 ? '0' : '') + h +} + +const parseError = (e, txt, context) => { + if (!txt) { + return { + message: e.message + ' while parsing empty string', + position: 0, + } + } + const badToken = e.message.match(/^Unexpected token (.) .*position\s+(\d+)/i) + const errIdx = badToken ? +badToken[2] + : e.message.match(/^Unexpected end of JSON.*/i) ? txt.length - 1 + : null + + const msg = badToken ? e.message.replace(/^Unexpected token ./, `Unexpected token ${ + JSON.stringify(badToken[1]) + } (${hexify(badToken[1])})`) + : e.message + + if (errIdx !== null && errIdx !== undefined) { + const start = errIdx <= context ? 0 + : errIdx - context + + const end = errIdx + context >= txt.length ? txt.length + : errIdx + context + + const slice = (start === 0 ? '' : '...') + + txt.slice(start, end) + + (end === txt.length ? '' : '...') + + const near = txt === slice ? '' : 'near ' + + return { + message: msg + ` while parsing ${near}${JSON.stringify(slice)}`, + position: errIdx, + } + } else { + return { + message: msg + ` while parsing '${txt.slice(0, context * 2)}'`, + position: 0, + } + } +} + +class JSONParseError extends SyntaxError { + constructor (er, txt, context, caller) { + context = context || 20 + const metadata = parseError(er, txt, context) + super(metadata.message) + Object.assign(this, metadata) + this.code = 'EJSONPARSE' + this.systemError = er + Error.captureStackTrace(this, caller || this.constructor) + } + get name () { return this.constructor.name } + set name (n) {} + get [Symbol.toStringTag] () { return this.constructor.name } +} + +const kIndent = Symbol.for('indent') +const kNewline = Symbol.for('newline') +// only respect indentation if we got a line break, otherwise squash it +// things other than objects and arrays aren't indented, so ignore those +// Important: in both of these regexps, the $1 capture group is the newline +// or undefined, and the $2 capture group is the indent, or undefined. +const formatRE = /^\s*[{\[]((?:\r?\n)+)([\s\t]*)/ +const emptyRE = /^(?:\{\}|\[\])((?:\r?\n)+)?$/ + +const parseJson = (txt, reviver, context) => { + const parseText = stripBOM(txt) + context = context || 20 + try { + // get the indentation so that we can save it back nicely + // if the file starts with {" then we have an indent of '', ie, none + // otherwise, pick the indentation of the next line after the first \n + // If the pattern doesn't match, then it means no indentation. + // JSON.stringify ignores symbols, so this is reasonably safe. + // if the string is '{}' or '[]', then use the default 2-space indent. + const [, newline = '\n', indent = ' '] = parseText.match(emptyRE) || + parseText.match(formatRE) || + [, '', ''] + + const result = JSON.parse(parseText, reviver) + if (result && typeof result === 'object') { + result[kNewline] = newline + result[kIndent] = indent + } + return result + } catch (e) { + if (typeof txt !== 'string' && !Buffer.isBuffer(txt)) { + const isEmptyArray = Array.isArray(txt) && txt.length === 0 + throw Object.assign(new TypeError( + `Cannot parse ${isEmptyArray ? 'an empty array' : String(txt)}` + ), { + code: 'EJSONPARSE', + systemError: e, + }) + } + + throw new JSONParseError(e, parseText, context, parseJson) + } +} + +// Remove byte order marker. This catches EF BB BF (the UTF-8 BOM) +// because the buffer-to-string conversion in `fs.readFileSync()` +// translates it to FEFF, the UTF-16 BOM. +const stripBOM = txt => String(txt).replace(/^\uFEFF/, '') + +module.exports = parseJson +parseJson.JSONParseError = JSONParseError + +parseJson.noExceptions = (txt, reviver) => { + try { + return JSON.parse(stripBOM(txt), reviver) + } catch (e) {} +} diff --git a/node_modules/json-parse-even-better-errors/package.json b/node_modules/json-parse-even-better-errors/package.json new file mode 100644 index 0000000..ed0fdaf --- /dev/null +++ b/node_modules/json-parse-even-better-errors/package.json @@ -0,0 +1,33 @@ +{ + "name": "json-parse-even-better-errors", + "version": "2.3.1", + "description": "JSON.parse with context information on error", + "main": "index.js", + "files": [ + "*.js" + ], + "scripts": { + "preversion": "npm t", + "postversion": "npm publish", + "prepublishOnly": "git push --follow-tags", + "test": "tap", + "snap": "tap" + }, + "repository": "https://github.com/npm/json-parse-even-better-errors", + "keywords": [ + "JSON", + "parser" + ], + "author": { + "name": "Kat Marchán", + "email": "kzm@zkat.tech", + "twitter": "maybekatz" + }, + "license": "MIT", + "devDependencies": { + "tap": "^14.6.5" + }, + "tap": { + "check-coverage": true + } +} diff --git a/node_modules/json-schema-traverse/.eslintrc.yml b/node_modules/json-schema-traverse/.eslintrc.yml new file mode 100644 index 0000000..ab1762d --- /dev/null +++ b/node_modules/json-schema-traverse/.eslintrc.yml @@ -0,0 +1,27 @@ +extends: eslint:recommended +env: + node: true + browser: true +rules: + block-scoped-var: 2 + complexity: [2, 13] + curly: [2, multi-or-nest, consistent] + dot-location: [2, property] + dot-notation: 2 + indent: [2, 2, SwitchCase: 1] + linebreak-style: [2, unix] + new-cap: 2 + no-console: [2, allow: [warn, error]] + no-else-return: 2 + no-eq-null: 2 + no-fallthrough: 2 + no-invalid-this: 2 + no-return-assign: 2 + no-shadow: 1 + no-trailing-spaces: 2 + no-use-before-define: [2, nofunc] + quotes: [2, single, avoid-escape] + semi: [2, always] + strict: [2, global] + valid-jsdoc: [2, requireReturn: false] + no-control-regex: 0 diff --git a/node_modules/json-schema-traverse/.travis.yml b/node_modules/json-schema-traverse/.travis.yml new file mode 100644 index 0000000..7ddce74 --- /dev/null +++ b/node_modules/json-schema-traverse/.travis.yml @@ -0,0 +1,8 @@ +language: node_js +node_js: + - "4" + - "6" + - "7" + - "8" +after_script: + - coveralls < coverage/lcov.info diff --git a/node_modules/json-schema-traverse/LICENSE b/node_modules/json-schema-traverse/LICENSE new file mode 100644 index 0000000..7f15435 --- /dev/null +++ b/node_modules/json-schema-traverse/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017 Evgeny Poberezkin + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/json-schema-traverse/README.md b/node_modules/json-schema-traverse/README.md new file mode 100644 index 0000000..d5ccaf4 --- /dev/null +++ b/node_modules/json-schema-traverse/README.md @@ -0,0 +1,83 @@ +# json-schema-traverse +Traverse JSON Schema passing each schema object to callback + +[![Build Status](https://travis-ci.org/epoberezkin/json-schema-traverse.svg?branch=master)](https://travis-ci.org/epoberezkin/json-schema-traverse) +[![npm version](https://badge.fury.io/js/json-schema-traverse.svg)](https://www.npmjs.com/package/json-schema-traverse) +[![Coverage Status](https://coveralls.io/repos/github/epoberezkin/json-schema-traverse/badge.svg?branch=master)](https://coveralls.io/github/epoberezkin/json-schema-traverse?branch=master) + + +## Install + +``` +npm install json-schema-traverse +``` + + +## Usage + +```javascript +const traverse = require('json-schema-traverse'); +const schema = { + properties: { + foo: {type: 'string'}, + bar: {type: 'integer'} + } +}; + +traverse(schema, {cb}); +// cb is called 3 times with: +// 1. root schema +// 2. {type: 'string'} +// 3. {type: 'integer'} + +// Or: + +traverse(schema, {cb: {pre, post}}); +// pre is called 3 times with: +// 1. root schema +// 2. {type: 'string'} +// 3. {type: 'integer'} +// +// post is called 3 times with: +// 1. {type: 'string'} +// 2. {type: 'integer'} +// 3. root schema + +``` + +Callback function `cb` is called for each schema object (not including draft-06 boolean schemas), including the root schema, in pre-order traversal. Schema references ($ref) are not resolved, they are passed as is. Alternatively, you can pass a `{pre, post}` object as `cb`, and then `pre` will be called before traversing child elements, and `post` will be called after all child elements have been traversed. + +Callback is passed these parameters: + +- _schema_: the current schema object +- _JSON pointer_: from the root schema to the current schema object +- _root schema_: the schema passed to `traverse` object +- _parent JSON pointer_: from the root schema to the parent schema object (see below) +- _parent keyword_: the keyword inside which this schema appears (e.g. `properties`, `anyOf`, etc.) +- _parent schema_: not necessarily parent object/array; in the example above the parent schema for `{type: 'string'}` is the root schema +- _index/property_: index or property name in the array/object containing multiple schemas; in the example above for `{type: 'string'}` the property name is `'foo'` + + +## Traverse objects in all unknown keywords + +```javascript +const traverse = require('json-schema-traverse'); +const schema = { + mySchema: { + minimum: 1, + maximum: 2 + } +}; + +traverse(schema, {allKeys: true, cb}); +// cb is called 2 times with: +// 1. root schema +// 2. mySchema +``` + +Without option `allKeys: true` callback will be called only with root schema. + + +## License + +[MIT](https://github.com/epoberezkin/json-schema-traverse/blob/master/LICENSE) diff --git a/node_modules/json-schema-traverse/index.js b/node_modules/json-schema-traverse/index.js new file mode 100644 index 0000000..d4a18df --- /dev/null +++ b/node_modules/json-schema-traverse/index.js @@ -0,0 +1,89 @@ +'use strict'; + +var traverse = module.exports = function (schema, opts, cb) { + // Legacy support for v0.3.1 and earlier. + if (typeof opts == 'function') { + cb = opts; + opts = {}; + } + + cb = opts.cb || cb; + var pre = (typeof cb == 'function') ? cb : cb.pre || function() {}; + var post = cb.post || function() {}; + + _traverse(opts, pre, post, schema, '', schema); +}; + + +traverse.keywords = { + additionalItems: true, + items: true, + contains: true, + additionalProperties: true, + propertyNames: true, + not: true +}; + +traverse.arrayKeywords = { + items: true, + allOf: true, + anyOf: true, + oneOf: true +}; + +traverse.propsKeywords = { + definitions: true, + properties: true, + patternProperties: true, + dependencies: true +}; + +traverse.skipKeywords = { + default: true, + enum: true, + const: true, + required: true, + maximum: true, + minimum: true, + exclusiveMaximum: true, + exclusiveMinimum: true, + multipleOf: true, + maxLength: true, + minLength: true, + pattern: true, + format: true, + maxItems: true, + minItems: true, + uniqueItems: true, + maxProperties: true, + minProperties: true +}; + + +function _traverse(opts, pre, post, schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex) { + if (schema && typeof schema == 'object' && !Array.isArray(schema)) { + pre(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex); + for (var key in schema) { + var sch = schema[key]; + if (Array.isArray(sch)) { + if (key in traverse.arrayKeywords) { + for (var i=0; i +``` + +This will create a global `JSON5` variable. + +## API +The JSON5 API is compatible with the [JSON API]. + +[JSON API]: +https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON + +### JSON5.parse() +Parses a JSON5 string, constructing the JavaScript value or object described by +the string. An optional reviver function can be provided to perform a +transformation on the resulting object before it is returned. + +#### Syntax + JSON5.parse(text[, reviver]) + +#### Parameters +- `text`: The string to parse as JSON5. +- `reviver`: If a function, this prescribes how the value originally produced by + parsing is transformed, before being returned. + +#### Return value +The object corresponding to the given JSON5 text. + +### JSON5.stringify() +Converts a JavaScript value to a JSON5 string, optionally replacing values if a +replacer function is specified, or optionally including only the specified +properties if a replacer array is specified. + +#### Syntax + JSON5.stringify(value[, replacer[, space]]) + JSON5.stringify(value[, options]) + +#### Parameters +- `value`: The value to convert to a JSON5 string. +- `replacer`: A function that alters the behavior of the stringification + process, or an array of String and Number objects that serve as a whitelist + for selecting/filtering the properties of the value object to be included in + the JSON5 string. If this value is null or not provided, all properties of the + object are included in the resulting JSON5 string. +- `space`: A String or Number object that's used to insert white space into the + output JSON5 string for readability purposes. If this is a Number, it + indicates the number of space characters to use as white space; this number is + capped at 10 (if it is greater, the value is just 10). Values less than 1 + indicate that no space should be used. If this is a String, the string (or the + first 10 characters of the string, if it's longer than that) is used as white + space. If this parameter is not provided (or is null), no white space is used. + If white space is used, trailing commas will be used in objects and arrays. +- `options`: An object with the following properties: + - `replacer`: Same as the `replacer` parameter. + - `space`: Same as the `space` parameter. + - `quote`: A String representing the quote character to use when serializing + strings. + +#### Return value +A JSON5 string representing the value. + +### Node.js `require()` JSON5 files +When using Node.js, you can `require()` JSON5 files by adding the following +statement. + +```js +require('json5/lib/register') +``` + +Then you can load a JSON5 file with a Node.js `require()` statement. For +example: + +```js +const config = require('./config.json5') +``` + +## CLI +Since JSON is more widely used than JSON5, this package includes a CLI for +converting JSON5 to JSON and for validating the syntax of JSON5 documents. + +### Installation +```sh +npm install --global json5 +``` + +### Usage +```sh +json5 [options] +``` + +If `` is not provided, then STDIN is used. + +#### Options: +- `-s`, `--space`: The number of spaces to indent or `t` for tabs +- `-o`, `--out-file [file]`: Output to the specified file, otherwise STDOUT +- `-v`, `--validate`: Validate JSON5 but do not output JSON +- `-V`, `--version`: Output the version number +- `-h`, `--help`: Output usage information + +## Contibuting +### Development +```sh +git clone https://github.com/json5/json5 +cd json5 +npm install +``` + +When contributing code, please write relevant tests and run `npm test` and `npm +run lint` before submitting pull requests. Please use an editor that supports +[EditorConfig](http://editorconfig.org/). + +### Issues +To report bugs or request features regarding the JSON5 data format, please +submit an issue to the [official specification +repository](https://github.com/json5/json5-spec). + +To report bugs or request features regarding the JavaScript implentation of +JSON5, please submit an issue to this repository. + +## License +MIT. See [LICENSE.md](./LICENSE.md) for details. + +## Credits +[Assem Kishore](https://github.com/aseemk) founded this project. + +[Michael Bolin](http://bolinfest.com/) independently arrived at and published +some of these same ideas with awesome explanations and detail. Recommended +reading: [Suggested Improvements to JSON](http://bolinfest.com/essays/json.html) + +[Douglas Crockford](http://www.crockford.com/) of course designed and built +JSON, but his state machine diagrams on the [JSON website](http://json.org/), as +cheesy as it may sound, gave us motivation and confidence that building a new +parser to implement these ideas was within reach! The original +implementation of JSON5 was also modeled directly off of Doug’s open-source +[json_parse.js] parser. We’re grateful for that clean and well-documented +code. + +[json_parse.js]: +https://github.com/douglascrockford/JSON-js/blob/master/json_parse.js + +[Max Nanasy](https://github.com/MaxNanasy) has been an early and prolific +supporter, contributing multiple patches and ideas. + +[Andrew Eisenberg](https://github.com/aeisenberg) contributed the original +`stringify` method. + +[Jordan Tucker](https://github.com/jordanbtucker) has aligned JSON5 more closely +with ES5, wrote the official JSON5 specification, completely rewrote the +codebase from the ground up, and is actively maintaining this project. diff --git a/node_modules/json5/dist/index.js b/node_modules/json5/dist/index.js new file mode 100644 index 0000000..b6504bc --- /dev/null +++ b/node_modules/json5/dist/index.js @@ -0,0 +1 @@ +!function(u,D){"object"==typeof exports&&"undefined"!=typeof module?module.exports=D():"function"==typeof define&&define.amd?define(D):u.JSON5=D()}(this,function(){"use strict";var u,D,e=(function(u,D){Object.defineProperty(D,"__esModule",{value:!0});D.Space_Separator=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,D.ID_Start=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\u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uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]/,D.ID_Continue=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFF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F30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/}(u={exports:{}},u.exports),u.exports);(D=e)&&D.__esModule&&Object.prototype.hasOwnProperty.call(D,"default")&&D.default;var F=e.Space_Separator,C=e.ID_Start,A=e.ID_Continue;function r(u){return u>="a"&&u<="z"||u>="A"&&u<="Z"||"$"===u||"_"===u||C.test(u)}function t(u){return u>="a"&&u<="z"||u>="A"&&u<="Z"||u>="0"&&u<="9"||"$"===u||"_"===u||"‌"===u||"‍"===u||A.test(u)}function n(u){return/[0-9]/.test(u)}function E(u){return/[0-9A-Fa-f]/.test(u)}var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(u){return typeof u}:function(u){return u&&"function"==typeof Symbol&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},a=void 0,o=void 0,B=void 0,c=void 0,s=void 0,f=void 0,l=void 0,d=void 0,v=void 0;var m=void 0,p=void 0,y=void 0,h=void 0,b=void 0;function w(){for(m="default",p="",y=!1,h=1;;){b=g();var u=x[m]();if(u)return u}}function g(){if(a[c])return String.fromCodePoint(a.codePointAt(c))}function S(){var u=g();return"\n"===u?(s++,f=0):u?f+=u.length:f++,u&&(c+=u.length),u}var x={default:function(){switch(b){case"\t":case"\v":case"\f":case" ":case" ":case"\ufeff":case"\n":case"\r":case"\u2028":case"\u2029":return void S();case"/":return S(),void(m="comment");case void 0:return S(),N("eof")}if(!function(u){return F.test(u)}(b))return x[o]();S()},comment:function(){switch(b){case"*":return S(),void(m="multiLineComment");case"/":return S(),void(m="singleLineComment")}throw V(S())},multiLineComment:function(){switch(b){case"*":return S(),void(m="multiLineCommentAsterisk");case void 0:throw V(S())}S()},multiLineCommentAsterisk:function(){switch(b){case"*":return void S();case"/":return S(),void(m="default");case void 0:throw V(S())}S(),m="multiLineComment"},singleLineComment:function(){switch(b){case"\n":case"\r":case"\u2028":case"\u2029":return S(),void(m="default");case void 0:return S(),N("eof")}S()},value:function(){switch(b){case"{":case"[":return N("punctuator",S());case"n":return S(),P("ull"),N("null",null);case"t":return S(),P("rue"),N("boolean",!0);case"f":return S(),P("alse"),N("boolean",!1);case"-":case"+":return"-"===S()&&(h=-1),void(m="sign");case".":return p=S(),void(m="decimalPointLeading");case"0":return p=S(),void(m="zero");case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return p=S(),void(m="decimalInteger");case"I":return S(),P("nfinity"),N("numeric",1/0);case"N":return S(),P("aN"),N("numeric",NaN);case'"':case"'":return y='"'===S(),p="",void(m="string")}throw V(S())},identifierNameStartEscape:function(){if("u"!==b)throw V(S());S();var u=O();switch(u){case"$":case"_":break;default:if(!r(u))throw L()}p+=u,m="identifierName"},identifierName:function(){switch(b){case"$":case"_":case"‌":case"‍":return void(p+=S());case"\\":return S(),void(m="identifierNameEscape")}if(!t(b))return N("identifier",p);p+=S()},identifierNameEscape:function(){if("u"!==b)throw V(S());S();var u=O();switch(u){case"$":case"_":case"‌":case"‍":break;default:if(!t(u))throw L()}p+=u,m="identifierName"},sign:function(){switch(b){case".":return p=S(),void(m="decimalPointLeading");case"0":return p=S(),void(m="zero");case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return p=S(),void(m="decimalInteger");case"I":return S(),P("nfinity"),N("numeric",h*(1/0));case"N":return S(),P("aN"),N("numeric",NaN)}throw V(S())},zero:function(){switch(b){case".":return p+=S(),void(m="decimalPoint");case"e":case"E":return p+=S(),void(m="decimalExponent");case"x":case"X":return p+=S(),void(m="hexadecimal")}return N("numeric",0*h)},decimalInteger:function(){switch(b){case".":return p+=S(),void(m="decimalPoint");case"e":case"E":return p+=S(),void(m="decimalExponent")}if(!n(b))return N("numeric",h*Number(p));p+=S()},decimalPointLeading:function(){if(n(b))return p+=S(),void(m="decimalFraction");throw V(S())},decimalPoint:function(){switch(b){case"e":case"E":return p+=S(),void(m="decimalExponent")}return n(b)?(p+=S(),void(m="decimalFraction")):N("numeric",h*Number(p))},decimalFraction:function(){switch(b){case"e":case"E":return p+=S(),void(m="decimalExponent")}if(!n(b))return N("numeric",h*Number(p));p+=S()},decimalExponent:function(){switch(b){case"+":case"-":return p+=S(),void(m="decimalExponentSign")}if(n(b))return p+=S(),void(m="decimalExponentInteger");throw V(S())},decimalExponentSign:function(){if(n(b))return p+=S(),void(m="decimalExponentInteger");throw V(S())},decimalExponentInteger:function(){if(!n(b))return N("numeric",h*Number(p));p+=S()},hexadecimal:function(){if(E(b))return p+=S(),void(m="hexadecimalInteger");throw V(S())},hexadecimalInteger:function(){if(!E(b))return N("numeric",h*Number(p));p+=S()},string:function(){switch(b){case"\\":return S(),void(p+=function(){switch(g()){case"b":return S(),"\b";case"f":return S(),"\f";case"n":return S(),"\n";case"r":return S(),"\r";case"t":return S(),"\t";case"v":return S(),"\v";case"0":if(S(),n(g()))throw V(S());return"\0";case"x":return S(),function(){var u="",D=g();if(!E(D))throw V(S());if(u+=S(),!E(D=g()))throw V(S());return u+=S(),String.fromCodePoint(parseInt(u,16))}();case"u":return S(),O();case"\n":case"\u2028":case"\u2029":return S(),"";case"\r":return S(),"\n"===g()&&S(),"";case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case void 0:throw V(S())}return S()}());case'"':return y?(S(),N("string",p)):void(p+=S());case"'":return y?void(p+=S()):(S(),N("string",p));case"\n":case"\r":throw V(S());case"\u2028":case"\u2029":!function(u){console.warn("JSON5: '"+u+"' is not valid ECMAScript; consider escaping")}(b);break;case void 0:throw V(S())}p+=S()},start:function(){switch(b){case"{":case"[":return N("punctuator",S())}m="value"},beforePropertyName:function(){switch(b){case"$":case"_":return p=S(),void(m="identifierName");case"\\":return S(),void(m="identifierNameStartEscape");case"}":return N("punctuator",S());case'"':case"'":return y='"'===S(),void(m="string")}if(r(b))return p+=S(),void(m="identifierName");throw V(S())},afterPropertyName:function(){if(":"===b)return N("punctuator",S());throw V(S())},beforePropertyValue:function(){m="value"},afterPropertyValue:function(){switch(b){case",":case"}":return N("punctuator",S())}throw V(S())},beforeArrayValue:function(){if("]"===b)return N("punctuator",S());m="value"},afterArrayValue:function(){switch(b){case",":case"]":return N("punctuator",S())}throw V(S())},end:function(){throw V(S())}};function N(u,D){return{type:u,value:D,line:s,column:f}}function P(u){var D=!0,e=!1,F=void 0;try{for(var C,A=u[Symbol.iterator]();!(D=(C=A.next()).done);D=!0){var r=C.value;if(g()!==r)throw V(S());S()}}catch(u){e=!0,F=u}finally{try{!D&&A.return&&A.return()}finally{if(e)throw F}}}function O(){for(var u="",D=4;D-- >0;){if(!E(g()))throw V(S());u+=S()}return String.fromCodePoint(parseInt(u,16))}var j={start:function(){if("eof"===l.type)throw J();I()},beforePropertyName:function(){switch(l.type){case"identifier":case"string":return d=l.value,void(o="afterPropertyName");case"punctuator":return void _();case"eof":throw J()}},afterPropertyName:function(){if("eof"===l.type)throw J();o="beforePropertyValue"},beforePropertyValue:function(){if("eof"===l.type)throw J();I()},beforeArrayValue:function(){if("eof"===l.type)throw J();"punctuator"!==l.type||"]"!==l.value?I():_()},afterPropertyValue:function(){if("eof"===l.type)throw J();switch(l.value){case",":return void(o="beforePropertyName");case"}":_()}},afterArrayValue:function(){if("eof"===l.type)throw J();switch(l.value){case",":return void(o="beforeArrayValue");case"]":_()}},end:function(){}};function I(){var u=void 0;switch(l.type){case"punctuator":switch(l.value){case"{":u={};break;case"[":u=[]}break;case"null":case"boolean":case"numeric":case"string":u=l.value}if(void 0===v)v=u;else{var D=B[B.length-1];Array.isArray(D)?D.push(u):Object.defineProperty(D,d,{value:u,writable:!0,enumerable:!0,configurable:!0})}if(null!==u&&"object"===(void 0===u?"undefined":i(u)))B.push(u),o=Array.isArray(u)?"beforeArrayValue":"beforePropertyName";else{var e=B[B.length-1];o=null==e?"end":Array.isArray(e)?"afterArrayValue":"afterPropertyValue"}}function _(){B.pop();var u=B[B.length-1];o=null==u?"end":Array.isArray(u)?"afterArrayValue":"afterPropertyValue"}function V(u){return k(void 0===u?"JSON5: invalid end of input at "+s+":"+f:"JSON5: invalid character '"+function(u){var D={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(D[u])return D[u];if(u<" "){var e=u.charCodeAt(0).toString(16);return"\\x"+("00"+e).substring(e.length)}return u}(u)+"' at "+s+":"+f)}function J(){return k("JSON5: invalid end of input at "+s+":"+f)}function L(){return k("JSON5: invalid identifier character at "+s+":"+(f-=5))}function k(u){var D=new SyntaxError(u);return D.lineNumber=s,D.columnNumber=f,D}return{parse:function(u,D){a=String(u),o="start",B=[],c=0,s=1,f=0,l=void 0,d=void 0,v=void 0;do{l=w(),j[o]()}while("eof"!==l.type);return"function"==typeof D?function u(D,e,F){var C=D[e];if(null!=C&&"object"===(void 0===C?"undefined":i(C)))if(Array.isArray(C))for(var A=0;A0&&(e=Math.min(10,Math.floor(e)),E=" ".substr(0,e)):"string"==typeof e&&(E=e.substr(0,10)),v("",{"":u});function v(u,D){var e=D[u];switch(null!=e&&("function"==typeof e.toJSON5?e=e.toJSON5(u):"function"==typeof e.toJSON&&(e=e.toJSON(u))),n&&(e=n.call(D,u,e)),e instanceof Number?e=Number(e):e instanceof String?e=String(e):e instanceof Boolean&&(e=e.valueOf()),e){case null:return"null";case!0:return"true";case!1:return"false"}return"string"==typeof e?m(e):"number"==typeof e?String(e):"object"===(void 0===e?"undefined":i(e))?Array.isArray(e)?function(u){if(F.indexOf(u)>=0)throw TypeError("Converting circular structure to JSON5");F.push(u);var D=C;C+=E;for(var e=[],A=0;A=0)throw TypeError("Converting circular structure to JSON5");F.push(u);var D=C;C+=E;var e=A||Object.keys(u),r=[],t=!0,n=!1,i=void 0;try{for(var a,o=e[Symbol.iterator]();!(t=(a=o.next()).done);t=!0){var B=a.value,c=v(B,u);if(void 0!==c){var s=p(B)+":";""!==E&&(s+=" "),s+=c,r.push(s)}}}catch(u){n=!0,i=u}finally{try{!t&&o.return&&o.return()}finally{if(n)throw i}}var f=void 0;if(0===r.length)f="{}";else{var l=void 0;if(""===E)l=r.join(","),f="{"+l+"}";else{var d=",\n"+C;l=r.join(d),f="{\n"+C+l+",\n"+D+"}"}}return F.pop(),C=D,f}(e):void 0}function m(u){var D={"'":.1,'"':.2},e={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"},F="",C=!0,A=!1,r=void 0;try{for(var t,n=u[Symbol.iterator]();!(C=(t=n.next()).done);C=!0){var E=t.value;switch(E){case"'":case'"':D[E]++,F+=E;continue}if(e[E])F+=e[E];else if(E<" "){var i=E.charCodeAt(0).toString(16);F+="\\x"+("00"+i).substring(i.length)}else F+=E}}catch(u){A=!0,r=u}finally{try{!C&&n.return&&n.return()}finally{if(A)throw r}}var o=a||Object.keys(D).reduce(function(u,e){return D[u]\n\n If is not provided, then STDIN is used.\n\n Options:\n\n -s, --space The number of spaces to indent or \'t\' for tabs\n -o, --out-file [file] Output to the specified file, otherwise STDOUT\n -v, --validate Validate JSON5 but do not output JSON\n -V, --version Output the version number\n -h, --help Output usage information')} \ No newline at end of file diff --git a/node_modules/json5/lib/index.js b/node_modules/json5/lib/index.js new file mode 100644 index 0000000..c943e65 --- /dev/null +++ b/node_modules/json5/lib/index.js @@ -0,0 +1 @@ +'use strict';Object.defineProperty(exports,'__esModule',{value:true});var _parse=require('./parse');var _parse2=_interopRequireDefault(_parse);var _stringify=require('./stringify');var _stringify2=_interopRequireDefault(_stringify);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}exports.default={parse:_parse2.default,stringify:_stringify2.default};module.exports=exports['default']; \ No newline at end of file diff --git a/node_modules/json5/lib/parse.js b/node_modules/json5/lib/parse.js new file mode 100644 index 0000000..f368930 --- /dev/null +++ b/node_modules/json5/lib/parse.js @@ -0,0 +1 @@ +'use strict';Object.defineProperty(exports,'__esModule',{value:true});var _typeof=typeof Symbol==='function'&&typeof Symbol.iterator==='symbol'?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==='function'&&obj.constructor===Symbol&&obj!==Symbol.prototype?'symbol':typeof obj};exports.default=parse;var _util=require('./util');var util=_interopRequireWildcard(_util);function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj.default=obj;return newObj}}var source=void 0;var parseState=void 0;var stack=void 0;var pos=void 0;var line=void 0;var column=void 0;var token=void 0;var key=void 0;var root=void 0;function parse(text,reviver){source=String(text);parseState='start';stack=[];pos=0;line=1;column=0;token=undefined;key=undefined;root=undefined;do{token=lex();parseStates[parseState]()}while(token.type!=='eof');if(typeof reviver==='function'){return internalize({'':root},'',reviver)}return root}function internalize(holder,name,reviver){var value=holder[name];if(value!=null&&(typeof value==='undefined'?'undefined':_typeof(value))==='object'){if(Array.isArray(value)){for(var i=0;i0){var _c2=peek();if(!util.isHexDigit(_c2)){throw invalidChar(read())}buffer+=read()}return String.fromCodePoint(parseInt(buffer,16))}var parseStates={start:function start(){if(token.type==='eof'){throw invalidEOF()}push()},beforePropertyName:function beforePropertyName(){switch(token.type){case'identifier':case'string':key=token.value;parseState='afterPropertyName';return;case'punctuator':pop();return;case'eof':throw invalidEOF();}},afterPropertyName:function afterPropertyName(){if(token.type==='eof'){throw invalidEOF()}parseState='beforePropertyValue'},beforePropertyValue:function beforePropertyValue(){if(token.type==='eof'){throw invalidEOF()}push()},beforeArrayValue:function beforeArrayValue(){if(token.type==='eof'){throw invalidEOF()}if(token.type==='punctuator'&&token.value===']'){pop();return}push()},afterPropertyValue:function afterPropertyValue(){if(token.type==='eof'){throw invalidEOF()}switch(token.value){case',':parseState='beforePropertyName';return;case'}':pop();}},afterArrayValue:function afterArrayValue(){if(token.type==='eof'){throw invalidEOF()}switch(token.value){case',':parseState='beforeArrayValue';return;case']':pop();}},end:function end(){}};function push(){var value=void 0;switch(token.type){case'punctuator':switch(token.value){case'{':value={};break;case'[':value=[];break;}break;case'null':case'boolean':case'numeric':case'string':value=token.value;break;}if(root===undefined){root=value}else{var parent=stack[stack.length-1];if(Array.isArray(parent)){parent.push(value)}else{Object.defineProperty(parent,key,{value:value,writable:true,enumerable:true,configurable:true})}}if(value!==null&&(typeof value==='undefined'?'undefined':_typeof(value))==='object'){stack.push(value);if(Array.isArray(value)){parseState='beforeArrayValue'}else{parseState='beforePropertyName'}}else{var current=stack[stack.length-1];if(current==null){parseState='end'}else if(Array.isArray(current)){parseState='afterArrayValue'}else{parseState='afterPropertyValue'}}}function pop(){stack.pop();var current=stack[stack.length-1];if(current==null){parseState='end'}else if(Array.isArray(current)){parseState='afterArrayValue'}else{parseState='afterPropertyValue'}}function invalidChar(c){if(c===undefined){return syntaxError('JSON5: invalid end of input at '+line+':'+column)}return syntaxError('JSON5: invalid character \''+formatChar(c)+'\' at '+line+':'+column)}function invalidEOF(){return syntaxError('JSON5: invalid end of input at '+line+':'+column)}function invalidIdentifier(){column-=5;return syntaxError('JSON5: invalid identifier character at '+line+':'+column)}function separatorChar(c){console.warn('JSON5: \''+c+'\' is not valid ECMAScript; consider escaping')}function formatChar(c){var replacements={'\'':'\\\'','"':'\\"','\\':'\\\\','\b':'\\b','\f':'\\f','\n':'\\n','\r':'\\r','\t':'\\t','\x0B':'\\v','\0':'\\0','\u2028':'\\u2028','\u2029':'\\u2029'};if(replacements[c]){return replacements[c]}if(c<' '){var hexString=c.charCodeAt(0).toString(16);return'\\x'+('00'+hexString).substring(hexString.length)}return c}function syntaxError(message){var err=new SyntaxError(message);err.lineNumber=line;err.columnNumber=column;return err}module.exports=exports['default']; \ No newline at end of file diff --git a/node_modules/json5/lib/register.js b/node_modules/json5/lib/register.js new file mode 100644 index 0000000..aa16e96 --- /dev/null +++ b/node_modules/json5/lib/register.js @@ -0,0 +1 @@ +'use strict';var _fs=require('fs');var _fs2=_interopRequireDefault(_fs);var _=require('./');var _2=_interopRequireDefault(_);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}require.extensions['.json5']=function(module,filename){var content=_fs2.default.readFileSync(filename,'utf8');try{module.exports=_2.default.parse(content)}catch(err){err.message=filename+': '+err.message;throw err}}; \ No newline at end of file diff --git a/node_modules/json5/lib/require.js b/node_modules/json5/lib/require.js new file mode 100644 index 0000000..dfdc039 --- /dev/null +++ b/node_modules/json5/lib/require.js @@ -0,0 +1 @@ +"use strict";require("./register");console.warn("'json5/require' is deprecated. Please use 'json5/register' instead."); \ No newline at end of file diff --git a/node_modules/json5/lib/stringify.js b/node_modules/json5/lib/stringify.js new file mode 100644 index 0000000..ce6917e --- /dev/null +++ b/node_modules/json5/lib/stringify.js @@ -0,0 +1 @@ +'use strict';Object.defineProperty(exports,'__esModule',{value:true});var _typeof=typeof Symbol==='function'&&typeof Symbol.iterator==='symbol'?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==='function'&&obj.constructor===Symbol&&obj!==Symbol.prototype?'symbol':typeof obj};exports.default=stringify;var _util=require('./util');var util=_interopRequireWildcard(_util);function _interopRequireWildcard(obj){if(obj&&obj.__esModule){return obj}else{var newObj={};if(obj!=null){for(var key in obj){if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key]}}newObj.default=obj;return newObj}}function stringify(value,replacer,space){var stack=[];var indent='';var propertyList=void 0;var replacerFunc=void 0;var gap='';var quote=void 0;if(replacer!=null&&(typeof replacer==='undefined'?'undefined':_typeof(replacer))==='object'&&!Array.isArray(replacer)){space=replacer.space;quote=replacer.quote;replacer=replacer.replacer}if(typeof replacer==='function'){replacerFunc=replacer}else if(Array.isArray(replacer)){propertyList=[];var _iteratorNormalCompletion=true;var _didIteratorError=false;var _iteratorError=undefined;try{for(var _iterator=replacer[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var v=_step.value;var item=void 0;if(typeof v==='string'){item=v}else if(typeof v==='number'||v instanceof String||v instanceof Number){item=String(v)}if(item!==undefined&&propertyList.indexOf(item)<0){propertyList.push(item)}}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}}if(space instanceof Number){space=Number(space)}else if(space instanceof String){space=String(space)}if(typeof space==='number'){if(space>0){space=Math.min(10,Math.floor(space));gap=' '.substr(0,space)}}else if(typeof space==='string'){gap=space.substr(0,10)}return serializeProperty('',{'':value});function serializeProperty(key,holder){var value=holder[key];if(value!=null){if(typeof value.toJSON5==='function'){value=value.toJSON5(key)}else if(typeof value.toJSON==='function'){value=value.toJSON(key)}}if(replacerFunc){value=replacerFunc.call(holder,key,value)}if(value instanceof Number){value=Number(value)}else if(value instanceof String){value=String(value)}else if(value instanceof Boolean){value=value.valueOf()}switch(value){case null:return'null';case true:return'true';case false:return'false';}if(typeof value==='string'){return quoteString(value,false)}if(typeof value==='number'){return String(value)}if((typeof value==='undefined'?'undefined':_typeof(value))==='object'){return Array.isArray(value)?serializeArray(value):serializeObject(value)}return undefined}function quoteString(value){var quotes={'\'':0.1,'"':0.2};var replacements={'\'':'\\\'','"':'\\"','\\':'\\\\','\b':'\\b','\f':'\\f','\n':'\\n','\r':'\\r','\t':'\\t','\x0B':'\\v','\0':'\\0','\u2028':'\\u2028','\u2029':'\\u2029'};var product='';var _iteratorNormalCompletion2=true;var _didIteratorError2=false;var _iteratorError2=undefined;try{for(var _iterator2=value[Symbol.iterator](),_step2;!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){var c=_step2.value;switch(c){case'\'':case'"':quotes[c]++;product+=c;continue;}if(replacements[c]){product+=replacements[c];continue}if(c<' '){var hexString=c.charCodeAt(0).toString(16);product+='\\x'+('00'+hexString).substring(hexString.length);continue}product+=c}}catch(err){_didIteratorError2=true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator2.return){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}}var quoteChar=quote||Object.keys(quotes).reduce(function(a,b){return quotes[a]=0){throw TypeError('Converting circular structure to JSON5')}stack.push(value);var stepback=indent;indent=indent+gap;var keys=propertyList||Object.keys(value);var partial=[];var _iteratorNormalCompletion3=true;var _didIteratorError3=false;var _iteratorError3=undefined;try{for(var _iterator3=keys[Symbol.iterator](),_step3;!(_iteratorNormalCompletion3=(_step3=_iterator3.next()).done);_iteratorNormalCompletion3=true){var key=_step3.value;var propertyString=serializeProperty(key,value);if(propertyString!==undefined){var member=serializeKey(key)+':';if(gap!==''){member+=' '}member+=propertyString;partial.push(member)}}}catch(err){_didIteratorError3=true;_iteratorError3=err}finally{try{if(!_iteratorNormalCompletion3&&_iterator3.return){_iterator3.return()}}finally{if(_didIteratorError3){throw _iteratorError3}}}var final=void 0;if(partial.length===0){final='{}'}else{var properties=void 0;if(gap===''){properties=partial.join(',');final='{'+properties+'}'}else{var separator=',\n'+indent;properties=partial.join(separator);final='{\n'+indent+properties+',\n'+stepback+'}'}}stack.pop();indent=stepback;return final}function serializeKey(key){if(key.length===0){return quoteString(key,true)}var firstChar=String.fromCodePoint(key.codePointAt(0));if(!util.isIdStartChar(firstChar)){return quoteString(key,true)}for(var i=firstChar.length;i=0){throw TypeError('Converting circular structure to JSON5')}stack.push(value);var stepback=indent;indent=indent+gap;var partial=[];for(var i=0;i='a'&&c<='z'||c>='A'&&c<='Z'||c==='$'||c==='_'||unicode.ID_Start.test(c)}function isIdContinueChar(c){return c>='a'&&c<='z'||c>='A'&&c<='Z'||c>='0'&&c<='9'||c==='$'||c==='_'||c==='\u200C'||c==='\u200D'||unicode.ID_Continue.test(c)}function isDigit(c){return /[0-9]/.test(c)}function isHexDigit(c){return /[0-9A-Fa-f]/.test(c)} \ No newline at end of file diff --git a/node_modules/json5/package.json b/node_modules/json5/package.json new file mode 100644 index 0000000..87f84a0 --- /dev/null +++ b/node_modules/json5/package.json @@ -0,0 +1,76 @@ +{ + "name": "json5", + "version": "1.0.2", + "description": "JSON for humans.", + "main": "lib/index.js", + "bin": "lib/cli.js", + "browser": "dist/index.js", + "files": [ + "lib/", + "dist/" + ], + "scripts": { + "build": "babel-node build/build.js && babel src -d lib && rollup -c", + "coverage": "nyc report --reporter=text-lcov | coveralls", + "lint": "eslint --fix build src", + "prepublishOnly": "npm run lint && npm test && npm run production", + "pretest": "cross-env NODE_ENV=test npm run build", + "preversion": "npm run lint && npm test && npm run production", + "production": "cross-env NODE_ENV=production npm run build", + "test": "nyc --reporter=html --reporter=text mocha" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/json5/json5.git" + }, + "keywords": [ + "json", + "json5", + "es5", + "es2015", + "ecmascript" + ], + "author": "Aseem Kishore ", + "contributors": [ + "Max Nanasy ", + "Andrew Eisenberg ", + "Jordan Tucker " + ], + "license": "MIT", + "bugs": { + "url": "https://github.com/json5/json5/issues" + }, + "homepage": "http://json5.org/", + "dependencies": { + "minimist": "^1.2.0" + }, + "devDependencies": { + "babel-cli": "^6.26.0", + "babel-core": "^6.26.0", + "babel-plugin-add-module-exports": "^0.2.1", + "babel-plugin-external-helpers": "^6.22.0", + "babel-plugin-istanbul": "^4.1.5", + "babel-preset-env": "^1.6.1", + "babel-register": "^6.26.0", + "babelrc-rollup": "^3.0.0", + "coveralls": "^3.0.0", + "cross-env": "^5.1.4", + "del": "^3.0.0", + "eslint": "^4.18.2", + "eslint-config-standard": "^11.0.0", + "eslint-plugin-import": "^2.9.0", + "eslint-plugin-node": "^6.0.1", + "eslint-plugin-promise": "^3.7.0", + "eslint-plugin-standard": "^3.0.1", + "mocha": "^5.0.4", + "nyc": "^11.4.1", + "regenerate": "^1.3.3", + "rollup": "^0.56.5", + "rollup-plugin-babel": "^3.0.3", + "rollup-plugin-commonjs": "^9.0.0", + "rollup-plugin-node-resolve": "^3.2.0", + "rollup-plugin-uglify": "^3.0.0", + "sinon": "^4.4.2", + "unicode-9.0.0": "^0.7.5" + } +} diff --git a/node_modules/kind-of/CHANGELOG.md b/node_modules/kind-of/CHANGELOG.md new file mode 100644 index 0000000..01687d5 --- /dev/null +++ b/node_modules/kind-of/CHANGELOG.md @@ -0,0 +1,160 @@ +# Release history + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). + +
+ Guiding Principles + +- Changelogs are for humans, not machines. +- There should be an entry for every single version. +- The same types of changes should be grouped. +- Versions and sections should be linkable. +- The latest version comes first. +- The release date of each versions is displayed. +- Mention whether you follow Semantic Versioning. + +
+ +
+ Types of changes + +Changelog entries are classified using the following labels _(from [keep-a-changelog](http://keepachangelog.com/)_): + +- `Added` for new features. +- `Changed` for changes in existing functionality. +- `Deprecated` for soon-to-be removed features. +- `Removed` for now removed features. +- `Fixed` for any bug fixes. +- `Security` in case of vulnerabilities. + +
+ +## [6.0.3] - 2020-01-16 + +- Merge pull request #31 for issue #30 + +## [6.0.0] - 2017-10-13 + +- refactor code to be more performant +- refactor benchmarks + +## [5.1.0] - 2017-10-13 + +**Added** + +- Merge pull request #15 from aretecode/patch-1 +- adds support and tests for string & array iterators + +**Changed** + +- updates benchmarks + +## [5.0.2] - 2017-08-02 + +- Merge pull request #14 from struct78/master +- Added `undefined` check + +## [5.0.0] - 2017-06-21 + +- Merge pull request #12 from aretecode/iterator +- Set Iterator + Map Iterator +- streamline `isbuffer`, minor edits + +## [4.0.0] - 2017-05-19 + +- Merge pull request #8 from tunnckoCore/master +- update deps + +## [3.2.2] - 2017-05-16 + +- fix version + +## [3.2.1] - 2017-05-16 + +- add browserify + +## [3.2.0] - 2017-04-25 + +- Merge pull request #10 from ksheedlo/unrequire-buffer +- add `promise` support and tests +- Remove unnecessary `Buffer` check + +## [3.1.0] - 2016-12-07 + +- Merge pull request #7 from laggingreflex/err +- add support for `error` and tests +- run update + +## [3.0.4] - 2016-07-29 + +- move tests +- run update + +## [3.0.3] - 2016-05-03 + +- fix prepublish script +- remove unused dep + +## [3.0.0] - 2015-11-17 + +- add typed array support +- Merge pull request #5 from miguelmota/typed-arrays +- adds new tests + +## [2.0.1] - 2015-08-21 + +- use `is-buffer` module + +## [2.0.0] - 2015-05-31 + +- Create fallback for `Array.isArray` if used as a browser package +- Merge pull request #2 from dtothefp/patch-1 +- Merge pull request #3 from pdehaan/patch-1 +- Merge branch 'master' of https://github.com/chorks/kind-of into chorks-master +- optimizations, mostly date and regex + +## [1.1.0] - 2015-02-09 + +- adds `buffer` support +- adds tests for `buffer` + +## [1.0.0] - 2015-01-19 + +- update benchmarks +- optimizations based on benchmarks + +## [0.1.2] - 2014-10-26 + +- return `typeof` value if it's not an object. very slight speed improvement +- use `.slice` +- adds benchmarks + +## [0.1.0] - 2014-9-26 + +- first commit + +[6.0.0]: https://github.com/jonschlinkert/kind-of/compare/5.1.0...6.0.0 +[5.1.0]: https://github.com/jonschlinkert/kind-of/compare/5.0.2...5.1.0 +[5.0.2]: https://github.com/jonschlinkert/kind-of/compare/5.0.1...5.0.2 +[5.0.1]: https://github.com/jonschlinkert/kind-of/compare/5.0.0...5.0.1 +[5.0.0]: https://github.com/jonschlinkert/kind-of/compare/4.0.0...5.0.0 +[4.0.0]: https://github.com/jonschlinkert/kind-of/compare/3.2.2...4.0.0 +[3.2.2]: https://github.com/jonschlinkert/kind-of/compare/3.2.1...3.2.2 +[3.2.1]: https://github.com/jonschlinkert/kind-of/compare/3.2.0...3.2.1 +[3.2.0]: https://github.com/jonschlinkert/kind-of/compare/3.1.0...3.2.0 +[3.1.0]: https://github.com/jonschlinkert/kind-of/compare/3.0.4...3.1.0 +[3.0.4]: https://github.com/jonschlinkert/kind-of/compare/3.0.3...3.0.4 +[3.0.3]: https://github.com/jonschlinkert/kind-of/compare/3.0.0...3.0.3 +[3.0.0]: https://github.com/jonschlinkert/kind-of/compare/2.0.1...3.0.0 +[2.0.1]: https://github.com/jonschlinkert/kind-of/compare/2.0.0...2.0.1 +[2.0.0]: https://github.com/jonschlinkert/kind-of/compare/1.1.0...2.0.0 +[1.1.0]: https://github.com/jonschlinkert/kind-of/compare/1.0.0...1.1.0 +[1.0.0]: https://github.com/jonschlinkert/kind-of/compare/0.1.2...1.0.0 +[0.1.2]: https://github.com/jonschlinkert/kind-of/compare/0.1.0...0.1.2 +[0.1.0]: https://github.com/jonschlinkert/kind-of/commit/2fae09b0b19b1aadb558e9be39f0c3ef6034eb87 + +[Unreleased]: https://github.com/jonschlinkert/kind-of/compare/0.1.2...HEAD +[keep-a-changelog]: https://github.com/olivierlacan/keep-a-changelog \ No newline at end of file diff --git a/node_modules/kind-of/LICENSE b/node_modules/kind-of/LICENSE new file mode 100644 index 0000000..3f2eca1 --- /dev/null +++ b/node_modules/kind-of/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2017, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/kind-of/README.md b/node_modules/kind-of/README.md new file mode 100644 index 0000000..0411dc5 --- /dev/null +++ b/node_modules/kind-of/README.md @@ -0,0 +1,367 @@ +# kind-of [![NPM version](https://img.shields.io/npm/v/kind-of.svg?style=flat)](https://www.npmjs.com/package/kind-of) [![NPM monthly downloads](https://img.shields.io/npm/dm/kind-of.svg?style=flat)](https://npmjs.org/package/kind-of) [![NPM total downloads](https://img.shields.io/npm/dt/kind-of.svg?style=flat)](https://npmjs.org/package/kind-of) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/kind-of.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/kind-of) + +> Get the native type of a value. + +Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save kind-of +``` + +Install with [bower](https://bower.io/) + +```sh +$ bower install kind-of --save +``` + +## Why use this? + +1. [it's fast](#benchmarks) | [optimizations](#optimizations) +2. [better type checking](#better-type-checking) + +## Usage + +> es5, es6, and browser ready + +```js +var kindOf = require('kind-of'); + +kindOf(undefined); +//=> 'undefined' + +kindOf(null); +//=> 'null' + +kindOf(true); +//=> 'boolean' + +kindOf(false); +//=> 'boolean' + +kindOf(new Buffer('')); +//=> 'buffer' + +kindOf(42); +//=> 'number' + +kindOf('str'); +//=> 'string' + +kindOf(arguments); +//=> 'arguments' + +kindOf({}); +//=> 'object' + +kindOf(Object.create(null)); +//=> 'object' + +kindOf(new Test()); +//=> 'object' + +kindOf(new Date()); +//=> 'date' + +kindOf([1, 2, 3]); +//=> 'array' + +kindOf(/foo/); +//=> 'regexp' + +kindOf(new RegExp('foo')); +//=> 'regexp' + +kindOf(new Error('error')); +//=> 'error' + +kindOf(function () {}); +//=> 'function' + +kindOf(function * () {}); +//=> 'generatorfunction' + +kindOf(Symbol('str')); +//=> 'symbol' + +kindOf(new Map()); +//=> 'map' + +kindOf(new WeakMap()); +//=> 'weakmap' + +kindOf(new Set()); +//=> 'set' + +kindOf(new WeakSet()); +//=> 'weakset' + +kindOf(new Int8Array()); +//=> 'int8array' + +kindOf(new Uint8Array()); +//=> 'uint8array' + +kindOf(new Uint8ClampedArray()); +//=> 'uint8clampedarray' + +kindOf(new Int16Array()); +//=> 'int16array' + +kindOf(new Uint16Array()); +//=> 'uint16array' + +kindOf(new Int32Array()); +//=> 'int32array' + +kindOf(new Uint32Array()); +//=> 'uint32array' + +kindOf(new Float32Array()); +//=> 'float32array' + +kindOf(new Float64Array()); +//=> 'float64array' +``` + +## Benchmarks + +Benchmarked against [typeof](http://github.com/CodingFu/typeof) and [type-of](https://github.com/ForbesLindesay/type-of). + +```bash +# arguments (32 bytes) + kind-of x 17,024,098 ops/sec ±1.90% (86 runs sampled) + lib-type-of x 11,926,235 ops/sec ±1.34% (83 runs sampled) + lib-typeof x 9,245,257 ops/sec ±1.22% (87 runs sampled) + + fastest is kind-of (by 161% avg) + +# array (22 bytes) + kind-of x 17,196,492 ops/sec ±1.07% (88 runs sampled) + lib-type-of x 8,838,283 ops/sec ±1.02% (87 runs sampled) + lib-typeof x 8,677,848 ops/sec ±0.87% (87 runs sampled) + + fastest is kind-of (by 196% avg) + +# boolean (24 bytes) + kind-of x 16,841,600 ops/sec ±1.10% (86 runs sampled) + lib-type-of x 8,096,787 ops/sec ±0.95% (87 runs sampled) + lib-typeof x 8,423,345 ops/sec ±1.15% (86 runs sampled) + + fastest is kind-of (by 204% avg) + +# buffer (38 bytes) + kind-of x 14,848,060 ops/sec ±1.05% (86 runs sampled) + lib-type-of x 3,671,577 ops/sec ±1.49% (87 runs sampled) + lib-typeof x 8,360,236 ops/sec ±1.24% (86 runs sampled) + + fastest is kind-of (by 247% avg) + +# date (30 bytes) + kind-of x 16,067,761 ops/sec ±1.58% (86 runs sampled) + lib-type-of x 8,954,436 ops/sec ±1.40% (87 runs sampled) + lib-typeof x 8,488,307 ops/sec ±1.51% (84 runs sampled) + + fastest is kind-of (by 184% avg) + +# error (36 bytes) + kind-of x 9,634,090 ops/sec ±1.12% (89 runs sampled) + lib-type-of x 7,735,624 ops/sec ±1.32% (86 runs sampled) + lib-typeof x 7,442,160 ops/sec ±1.11% (90 runs sampled) + + fastest is kind-of (by 127% avg) + +# function (34 bytes) + kind-of x 10,031,494 ops/sec ±1.27% (86 runs sampled) + lib-type-of x 9,502,757 ops/sec ±1.17% (89 runs sampled) + lib-typeof x 8,278,985 ops/sec ±1.08% (88 runs sampled) + + fastest is kind-of (by 113% avg) + +# null (24 bytes) + kind-of x 18,159,808 ops/sec ±1.92% (86 runs sampled) + lib-type-of x 12,927,635 ops/sec ±1.01% (88 runs sampled) + lib-typeof x 7,958,234 ops/sec ±1.21% (89 runs sampled) + + fastest is kind-of (by 174% avg) + +# number (22 bytes) + kind-of x 17,846,779 ops/sec ±0.91% (85 runs sampled) + lib-type-of x 3,316,636 ops/sec ±1.19% (86 runs sampled) + lib-typeof x 2,329,477 ops/sec ±2.21% (85 runs sampled) + + fastest is kind-of (by 632% avg) + +# object-plain (47 bytes) + kind-of x 7,085,155 ops/sec ±1.05% (88 runs sampled) + lib-type-of x 8,870,930 ops/sec ±1.06% (83 runs sampled) + lib-typeof x 8,716,024 ops/sec ±1.05% (87 runs sampled) + + fastest is lib-type-of (by 112% avg) + +# regex (25 bytes) + kind-of x 14,196,052 ops/sec ±1.65% (84 runs sampled) + lib-type-of x 9,554,164 ops/sec ±1.25% (88 runs sampled) + lib-typeof x 8,359,691 ops/sec ±1.07% (87 runs sampled) + + fastest is kind-of (by 158% avg) + +# string (33 bytes) + kind-of x 16,131,428 ops/sec ±1.41% (85 runs sampled) + lib-type-of x 7,273,172 ops/sec ±1.05% (87 runs sampled) + lib-typeof x 7,382,635 ops/sec ±1.17% (85 runs sampled) + + fastest is kind-of (by 220% avg) + +# symbol (34 bytes) + kind-of x 17,011,537 ops/sec ±1.24% (86 runs sampled) + lib-type-of x 3,492,454 ops/sec ±1.23% (89 runs sampled) + lib-typeof x 7,471,235 ops/sec ±2.48% (87 runs sampled) + + fastest is kind-of (by 310% avg) + +# template-strings (36 bytes) + kind-of x 15,434,250 ops/sec ±1.46% (83 runs sampled) + lib-type-of x 7,157,907 ops/sec ±0.97% (87 runs sampled) + lib-typeof x 7,517,986 ops/sec ±0.92% (86 runs sampled) + + fastest is kind-of (by 210% avg) + +# undefined (29 bytes) + kind-of x 19,167,115 ops/sec ±1.71% (87 runs sampled) + lib-type-of x 15,477,740 ops/sec ±1.63% (85 runs sampled) + lib-typeof x 19,075,495 ops/sec ±1.17% (83 runs sampled) + + fastest is lib-typeof,kind-of + +``` + +## Optimizations + +In 7 out of 8 cases, this library is 2x-10x faster than other top libraries included in the benchmarks. There are a few things that lead to this performance advantage, none of them hard and fast rules, but all of them simple and repeatable in almost any code library: + +1. Optimize around the fastest and most common use cases first. Of course, this will change from project-to-project, but I took some time to understand how and why `typeof` checks were being used in my own libraries and other libraries I use a lot. +2. Optimize around bottlenecks - In other words, the order in which conditionals are implemented is significant, because each check is only as fast as the failing checks that came before it. Here, the biggest bottleneck by far is checking for plain objects (an object that was created by the `Object` constructor). I opted to make this check happen by process of elimination rather than brute force up front (e.g. by using something like `val.constructor.name`), so that every other type check would not be penalized it. +3. Don't do uneccessary processing - why do `.slice(8, -1).toLowerCase();` just to get the word `regex`? It's much faster to do `if (type === '[object RegExp]') return 'regex'` +4. There is no reason to make the code in a microlib as terse as possible, just to win points for making it shorter. It's always better to favor performant code over terse code. You will always only be using a single `require()` statement to use the library anyway, regardless of how the code is written. + +## Better type checking + +kind-of seems to be more consistently "correct" than other type checking libs I've looked at. For example, here are some differing results from other popular libs: + +### [typeof](https://github.com/CodingFu/typeof) lib + +Incorrectly identifies instances of custom constructors (pretty common): + +```js +var typeOf = require('typeof'); +function Test() {} +console.log(typeOf(new Test())); +//=> 'test' +``` + +Returns `object` instead of `arguments`: + +```js +function foo() { + console.log(typeOf(arguments)) //=> 'object' +} +foo(); +``` + +### [type-of](https://github.com/ForbesLindesay/type-of) lib + +Incorrectly returns `object` for generator functions, buffers, `Map`, `Set`, `WeakMap` and `WeakSet`: + +```js +function * foo() {} +console.log(typeOf(foo)); +//=> 'object' +console.log(typeOf(new Buffer(''))); +//=> 'object' +console.log(typeOf(new Map())); +//=> 'object' +console.log(typeOf(new Set())); +//=> 'object' +console.log(typeOf(new WeakMap())); +//=> 'object' +console.log(typeOf(new WeakSet())); +//=> 'object' +``` + +## About + +
+Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +
+ +
+Running Tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +
+ +
+Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +
+ +### Related projects + +You might also be interested in these projects: + +* [is-glob](https://www.npmjs.com/package/is-glob): Returns `true` if the given string looks like a glob pattern or an extglob pattern… [more](https://github.com/micromatch/is-glob) | [homepage](https://github.com/micromatch/is-glob "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a bet") +* [is-number](https://www.npmjs.com/package/is-number): Returns true if a number or string value is a finite number. Useful for regex… [more](https://github.com/jonschlinkert/is-number) | [homepage](https://github.com/jonschlinkert/is-number "Returns true if a number or string value is a finite number. Useful for regex matches, parsing, user input, etc.") +* [is-primitive](https://www.npmjs.com/package/is-primitive): Returns `true` if the value is a primitive. | [homepage](https://github.com/jonschlinkert/is-primitive "Returns `true` if the value is a primitive. ") + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 102 | [jonschlinkert](https://github.com/jonschlinkert) | +| 3 | [aretecode](https://github.com/aretecode) | +| 2 | [miguelmota](https://github.com/miguelmota) | +| 1 | [doowb](https://github.com/doowb) | +| 1 | [dtothefp](https://github.com/dtothefp) | +| 1 | [ianstormtaylor](https://github.com/ianstormtaylor) | +| 1 | [ksheedlo](https://github.com/ksheedlo) | +| 1 | [pdehaan](https://github.com/pdehaan) | +| 1 | [laggingreflex](https://github.com/laggingreflex) | +| 1 | [tunnckoCore](https://github.com/tunnckoCore) | +| 1 | [xiaofen9](https://github.com/xiaofen9) | + +### Author + +**Jon Schlinkert** + +* [GitHub Profile](https://github.com/jonschlinkert) +* [Twitter Profile](https://twitter.com/jonschlinkert) +* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert) + +### License + +Copyright © 2020, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on January 16, 2020._ \ No newline at end of file diff --git a/node_modules/kind-of/index.js b/node_modules/kind-of/index.js new file mode 100644 index 0000000..dfa799b --- /dev/null +++ b/node_modules/kind-of/index.js @@ -0,0 +1,129 @@ +var toString = Object.prototype.toString; + +module.exports = function kindOf(val) { + if (val === void 0) return 'undefined'; + if (val === null) return 'null'; + + var type = typeof val; + if (type === 'boolean') return 'boolean'; + if (type === 'string') return 'string'; + if (type === 'number') return 'number'; + if (type === 'symbol') return 'symbol'; + if (type === 'function') { + return isGeneratorFn(val) ? 'generatorfunction' : 'function'; + } + + if (isArray(val)) return 'array'; + if (isBuffer(val)) return 'buffer'; + if (isArguments(val)) return 'arguments'; + if (isDate(val)) return 'date'; + if (isError(val)) return 'error'; + if (isRegexp(val)) return 'regexp'; + + switch (ctorName(val)) { + case 'Symbol': return 'symbol'; + case 'Promise': return 'promise'; + + // Set, Map, WeakSet, WeakMap + case 'WeakMap': return 'weakmap'; + case 'WeakSet': return 'weakset'; + case 'Map': return 'map'; + case 'Set': return 'set'; + + // 8-bit typed arrays + case 'Int8Array': return 'int8array'; + case 'Uint8Array': return 'uint8array'; + case 'Uint8ClampedArray': return 'uint8clampedarray'; + + // 16-bit typed arrays + case 'Int16Array': return 'int16array'; + case 'Uint16Array': return 'uint16array'; + + // 32-bit typed arrays + case 'Int32Array': return 'int32array'; + case 'Uint32Array': return 'uint32array'; + case 'Float32Array': return 'float32array'; + case 'Float64Array': return 'float64array'; + } + + if (isGeneratorObj(val)) { + return 'generator'; + } + + // Non-plain objects + type = toString.call(val); + switch (type) { + case '[object Object]': return 'object'; + // iterators + case '[object Map Iterator]': return 'mapiterator'; + case '[object Set Iterator]': return 'setiterator'; + case '[object String Iterator]': return 'stringiterator'; + case '[object Array Iterator]': return 'arrayiterator'; + } + + // other + return type.slice(8, -1).toLowerCase().replace(/\s/g, ''); +}; + +function ctorName(val) { + return typeof val.constructor === 'function' ? val.constructor.name : null; +} + +function isArray(val) { + if (Array.isArray) return Array.isArray(val); + return val instanceof Array; +} + +function isError(val) { + return val instanceof Error || (typeof val.message === 'string' && val.constructor && typeof val.constructor.stackTraceLimit === 'number'); +} + +function isDate(val) { + if (val instanceof Date) return true; + return typeof val.toDateString === 'function' + && typeof val.getDate === 'function' + && typeof val.setDate === 'function'; +} + +function isRegexp(val) { + if (val instanceof RegExp) return true; + return typeof val.flags === 'string' + && typeof val.ignoreCase === 'boolean' + && typeof val.multiline === 'boolean' + && typeof val.global === 'boolean'; +} + +function isGeneratorFn(name, val) { + return ctorName(name) === 'GeneratorFunction'; +} + +function isGeneratorObj(val) { + return typeof val.throw === 'function' + && typeof val.return === 'function' + && typeof val.next === 'function'; +} + +function isArguments(val) { + try { + if (typeof val.length === 'number' && typeof val.callee === 'function') { + return true; + } + } catch (err) { + if (err.message.indexOf('callee') !== -1) { + return true; + } + } + return false; +} + +/** + * If you need to support Safari 5-7 (8-10 yr-old browser), + * take a look at https://github.com/feross/is-buffer + */ + +function isBuffer(val) { + if (val.constructor && typeof val.constructor.isBuffer === 'function') { + return val.constructor.isBuffer(val); + } + return false; +} diff --git a/node_modules/kind-of/package.json b/node_modules/kind-of/package.json new file mode 100644 index 0000000..5820cad --- /dev/null +++ b/node_modules/kind-of/package.json @@ -0,0 +1,88 @@ +{ + "name": "kind-of", + "description": "Get the native type of a value.", + "version": "6.0.3", + "homepage": "https://github.com/jonschlinkert/kind-of", + "author": "Jon Schlinkert (https://github.com/jonschlinkert)", + "contributors": [ + "David Fox-Powell (https://dtothefp.github.io/me)", + "James (https://twitter.com/aretecode)", + "Jon Schlinkert (http://twitter.com/jonschlinkert)", + "Ken Sheedlo (kensheedlo.com)", + "laggingreflex (https://github.com/laggingreflex)", + "Miguel Mota (https://miguelmota.com)", + "Peter deHaan (http://about.me/peterdehaan)", + "tunnckoCore (https://i.am.charlike.online)" + ], + "repository": "jonschlinkert/kind-of", + "bugs": { + "url": "https://github.com/jonschlinkert/kind-of/issues" + }, + "license": "MIT", + "files": [ + "index.js" + ], + "main": "index.js", + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "mocha", + "prepublish": "browserify -o browser.js -e index.js -s index --bare" + }, + "devDependencies": { + "benchmarked": "^2.0.0", + "browserify": "^14.4.0", + "gulp-format-md": "^1.0.0", + "mocha": "^4.0.1", + "write": "^1.0.3" + }, + "keywords": [ + "arguments", + "array", + "boolean", + "check", + "date", + "function", + "is", + "is-type", + "is-type-of", + "kind", + "kind-of", + "number", + "object", + "of", + "regexp", + "string", + "test", + "type", + "type-of", + "typeof", + "types" + ], + "verb": { + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "lint": { + "reflinks": true + }, + "related": { + "list": [ + "is-glob", + "is-number", + "is-primitive" + ] + }, + "reflinks": [ + "type-of", + "typeof", + "verb" + ] + } +} diff --git a/node_modules/loader-runner/LICENSE b/node_modules/loader-runner/LICENSE new file mode 100644 index 0000000..084338a --- /dev/null +++ b/node_modules/loader-runner/LICENSE @@ -0,0 +1,21 @@ +The MIT License + +Copyright (c) Tobias Koppers @sokra + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/loader-runner/README.md b/node_modules/loader-runner/README.md new file mode 100644 index 0000000..f052dd3 --- /dev/null +++ b/node_modules/loader-runner/README.md @@ -0,0 +1,53 @@ +# loader-runner + +``` js +import { runLoaders } from "loader-runner"; + +runLoaders({ + resource: "/abs/path/to/file.txt?query", + // String: Absolute path to the resource (optionally including query string) + + loaders: ["/abs/path/to/loader.js?query"], + // String[]: Absolute paths to the loaders (optionally including query string) + // {loader, options}[]: Absolute paths to the loaders with options object + + context: { minimize: true }, + // Additional loader context which is used as base context + + processResource: (loaderContext, resourcePath, callback) => { ... }, + // Optional: A function to process the resource + // Must have signature function(context, path, function(err, buffer)) + // By default readResource is used and the resource is added a fileDependency + + readResource: fs.readFile.bind(fs) + // Optional: A function to read the resource + // Only used when 'processResource' is not provided + // Must have signature function(path, function(err, buffer)) + // By default fs.readFile is used +}, function(err, result) { + // err: Error? + + // result.result: Buffer | String + // The result + // only available when no error occured + + // result.resourceBuffer: Buffer + // The raw resource as Buffer (useful for SourceMaps) + // only available when no error occured + + // result.cacheable: Bool + // Is the result cacheable or do it require reexecution? + + // result.fileDependencies: String[] + // An array of paths (existing files) on which the result depends on + + // result.missingDependencies: String[] + // An array of paths (not existing files) on which the result depends on + + // result.contextDependencies: String[] + // An array of paths (directories) on which the result depends on +}) +``` + +More documentation following... + diff --git a/node_modules/loader-runner/lib/LoaderLoadingError.js b/node_modules/loader-runner/lib/LoaderLoadingError.js new file mode 100644 index 0000000..fa1e54d --- /dev/null +++ b/node_modules/loader-runner/lib/LoaderLoadingError.js @@ -0,0 +1,11 @@ +"use strict"; + +class LoadingLoaderError extends Error { + constructor(message) { + super(message); + this.name = "LoaderRunnerError"; + Error.captureStackTrace(this, this.constructor); + } +} + +module.exports = LoadingLoaderError; diff --git a/node_modules/loader-runner/lib/LoaderRunner.js b/node_modules/loader-runner/lib/LoaderRunner.js new file mode 100644 index 0000000..5909261 --- /dev/null +++ b/node_modules/loader-runner/lib/LoaderRunner.js @@ -0,0 +1,416 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +var fs = require("fs"); +var readFile = fs.readFile.bind(fs); +var loadLoader = require("./loadLoader"); + +function utf8BufferToString(buf) { + var str = buf.toString("utf-8"); + if(str.charCodeAt(0) === 0xFEFF) { + return str.substr(1); + } else { + return str; + } +} + +const PATH_QUERY_FRAGMENT_REGEXP = /^((?:\0.|[^?#\0])*)(\?(?:\0.|[^#\0])*)?(#.*)?$/; + +/** + * @param {string} str the path with query and fragment + * @returns {{ path: string, query: string, fragment: string }} parsed parts + */ +function parsePathQueryFragment(str) { + var match = PATH_QUERY_FRAGMENT_REGEXP.exec(str); + return { + path: match[1].replace(/\0(.)/g, "$1"), + query: match[2] ? match[2].replace(/\0(.)/g, "$1") : "", + fragment: match[3] || "" + }; +} + +function dirname(path) { + if(path === "/") return "/"; + var i = path.lastIndexOf("/"); + var j = path.lastIndexOf("\\"); + var i2 = path.indexOf("/"); + var j2 = path.indexOf("\\"); + var idx = i > j ? i : j; + var idx2 = i > j ? i2 : j2; + if(idx < 0) return path; + if(idx === idx2) return path.substr(0, idx + 1); + return path.substr(0, idx); +} + +function createLoaderObject(loader) { + var obj = { + path: null, + query: null, + fragment: null, + options: null, + ident: null, + normal: null, + pitch: null, + raw: null, + data: null, + pitchExecuted: false, + normalExecuted: false + }; + Object.defineProperty(obj, "request", { + enumerable: true, + get: function() { + return obj.path.replace(/#/g, "\0#") + obj.query.replace(/#/g, "\0#") + obj.fragment; + }, + set: function(value) { + if(typeof value === "string") { + var splittedRequest = parsePathQueryFragment(value); + obj.path = splittedRequest.path; + obj.query = splittedRequest.query; + obj.fragment = splittedRequest.fragment; + obj.options = undefined; + obj.ident = undefined; + } else { + if(!value.loader) + throw new Error("request should be a string or object with loader and options (" + JSON.stringify(value) + ")"); + obj.path = value.loader; + obj.fragment = value.fragment || ""; + obj.type = value.type; + obj.options = value.options; + obj.ident = value.ident; + if(obj.options === null) + obj.query = ""; + else if(obj.options === undefined) + obj.query = ""; + else if(typeof obj.options === "string") + obj.query = "?" + obj.options; + else if(obj.ident) + obj.query = "??" + obj.ident; + else if(typeof obj.options === "object" && obj.options.ident) + obj.query = "??" + obj.options.ident; + else + obj.query = "?" + JSON.stringify(obj.options); + } + } + }); + obj.request = loader; + if(Object.preventExtensions) { + Object.preventExtensions(obj); + } + return obj; +} + +function runSyncOrAsync(fn, context, args, callback) { + var isSync = true; + var isDone = false; + var isError = false; // internal error + var reportedError = false; + context.async = function async() { + if(isDone) { + if(reportedError) return; // ignore + throw new Error("async(): The callback was already called."); + } + isSync = false; + return innerCallback; + }; + var innerCallback = context.callback = function() { + if(isDone) { + if(reportedError) return; // ignore + throw new Error("callback(): The callback was already called."); + } + isDone = true; + isSync = false; + try { + callback.apply(null, arguments); + } catch(e) { + isError = true; + throw e; + } + }; + try { + var result = (function LOADER_EXECUTION() { + return fn.apply(context, args); + }()); + if(isSync) { + isDone = true; + if(result === undefined) + return callback(); + if(result && typeof result === "object" && typeof result.then === "function") { + return result.then(function(r) { + callback(null, r); + }, callback); + } + return callback(null, result); + } + } catch(e) { + if(isError) throw e; + if(isDone) { + // loader is already "done", so we cannot use the callback function + // for better debugging we print the error on the console + if(typeof e === "object" && e.stack) console.error(e.stack); + else console.error(e); + return; + } + isDone = true; + reportedError = true; + callback(e); + } + +} + +function convertArgs(args, raw) { + if(!raw && Buffer.isBuffer(args[0])) + args[0] = utf8BufferToString(args[0]); + else if(raw && typeof args[0] === "string") + args[0] = Buffer.from(args[0], "utf-8"); +} + +function iteratePitchingLoaders(options, loaderContext, callback) { + // abort after last loader + if(loaderContext.loaderIndex >= loaderContext.loaders.length) + return processResource(options, loaderContext, callback); + + var currentLoaderObject = loaderContext.loaders[loaderContext.loaderIndex]; + + // iterate + if(currentLoaderObject.pitchExecuted) { + loaderContext.loaderIndex++; + return iteratePitchingLoaders(options, loaderContext, callback); + } + + // load loader module + loadLoader(currentLoaderObject, function(err) { + if(err) { + loaderContext.cacheable(false); + return callback(err); + } + var fn = currentLoaderObject.pitch; + currentLoaderObject.pitchExecuted = true; + if(!fn) return iteratePitchingLoaders(options, loaderContext, callback); + + runSyncOrAsync( + fn, + loaderContext, [loaderContext.remainingRequest, loaderContext.previousRequest, currentLoaderObject.data = {}], + function(err) { + if(err) return callback(err); + var args = Array.prototype.slice.call(arguments, 1); + // Determine whether to continue the pitching process based on + // argument values (as opposed to argument presence) in order + // to support synchronous and asynchronous usages. + var hasArg = args.some(function(value) { + return value !== undefined; + }); + if(hasArg) { + loaderContext.loaderIndex--; + iterateNormalLoaders(options, loaderContext, args, callback); + } else { + iteratePitchingLoaders(options, loaderContext, callback); + } + } + ); + }); +} + +function processResource(options, loaderContext, callback) { + // set loader index to last loader + loaderContext.loaderIndex = loaderContext.loaders.length - 1; + + var resourcePath = loaderContext.resourcePath; + if(resourcePath) { + options.processResource(loaderContext, resourcePath, function(err) { + if(err) return callback(err); + var args = Array.prototype.slice.call(arguments, 1); + options.resourceBuffer = args[0]; + iterateNormalLoaders(options, loaderContext, args, callback); + }); + } else { + iterateNormalLoaders(options, loaderContext, [null], callback); + } +} + +function iterateNormalLoaders(options, loaderContext, args, callback) { + if(loaderContext.loaderIndex < 0) + return callback(null, args); + + var currentLoaderObject = loaderContext.loaders[loaderContext.loaderIndex]; + + // iterate + if(currentLoaderObject.normalExecuted) { + loaderContext.loaderIndex--; + return iterateNormalLoaders(options, loaderContext, args, callback); + } + + var fn = currentLoaderObject.normal; + currentLoaderObject.normalExecuted = true; + if(!fn) { + return iterateNormalLoaders(options, loaderContext, args, callback); + } + + convertArgs(args, currentLoaderObject.raw); + + runSyncOrAsync(fn, loaderContext, args, function(err) { + if(err) return callback(err); + + var args = Array.prototype.slice.call(arguments, 1); + iterateNormalLoaders(options, loaderContext, args, callback); + }); +} + +exports.getContext = function getContext(resource) { + var path = parsePathQueryFragment(resource).path; + return dirname(path); +}; + +exports.runLoaders = function runLoaders(options, callback) { + // read options + var resource = options.resource || ""; + var loaders = options.loaders || []; + var loaderContext = options.context || {}; + var processResource = options.processResource || ((readResource, context, resource, callback) => { + context.addDependency(resource); + readResource(resource, callback); + }).bind(null, options.readResource || readFile); + + // + var splittedResource = resource && parsePathQueryFragment(resource); + var resourcePath = splittedResource ? splittedResource.path : undefined; + var resourceQuery = splittedResource ? splittedResource.query : undefined; + var resourceFragment = splittedResource ? splittedResource.fragment : undefined; + var contextDirectory = resourcePath ? dirname(resourcePath) : null; + + // execution state + var requestCacheable = true; + var fileDependencies = []; + var contextDependencies = []; + var missingDependencies = []; + + // prepare loader objects + loaders = loaders.map(createLoaderObject); + + loaderContext.context = contextDirectory; + loaderContext.loaderIndex = 0; + loaderContext.loaders = loaders; + loaderContext.resourcePath = resourcePath; + loaderContext.resourceQuery = resourceQuery; + loaderContext.resourceFragment = resourceFragment; + loaderContext.async = null; + loaderContext.callback = null; + loaderContext.cacheable = function cacheable(flag) { + if(flag === false) { + requestCacheable = false; + } + }; + loaderContext.dependency = loaderContext.addDependency = function addDependency(file) { + fileDependencies.push(file); + }; + loaderContext.addContextDependency = function addContextDependency(context) { + contextDependencies.push(context); + }; + loaderContext.addMissingDependency = function addMissingDependency(context) { + missingDependencies.push(context); + }; + loaderContext.getDependencies = function getDependencies() { + return fileDependencies.slice(); + }; + loaderContext.getContextDependencies = function getContextDependencies() { + return contextDependencies.slice(); + }; + loaderContext.getMissingDependencies = function getMissingDependencies() { + return missingDependencies.slice(); + }; + loaderContext.clearDependencies = function clearDependencies() { + fileDependencies.length = 0; + contextDependencies.length = 0; + missingDependencies.length = 0; + requestCacheable = true; + }; + Object.defineProperty(loaderContext, "resource", { + enumerable: true, + get: function() { + if(loaderContext.resourcePath === undefined) + return undefined; + return loaderContext.resourcePath.replace(/#/g, "\0#") + loaderContext.resourceQuery.replace(/#/g, "\0#") + loaderContext.resourceFragment; + }, + set: function(value) { + var splittedResource = value && parsePathQueryFragment(value); + loaderContext.resourcePath = splittedResource ? splittedResource.path : undefined; + loaderContext.resourceQuery = splittedResource ? splittedResource.query : undefined; + loaderContext.resourceFragment = splittedResource ? splittedResource.fragment : undefined; + } + }); + Object.defineProperty(loaderContext, "request", { + enumerable: true, + get: function() { + return loaderContext.loaders.map(function(o) { + return o.request; + }).concat(loaderContext.resource || "").join("!"); + } + }); + Object.defineProperty(loaderContext, "remainingRequest", { + enumerable: true, + get: function() { + if(loaderContext.loaderIndex >= loaderContext.loaders.length - 1 && !loaderContext.resource) + return ""; + return loaderContext.loaders.slice(loaderContext.loaderIndex + 1).map(function(o) { + return o.request; + }).concat(loaderContext.resource || "").join("!"); + } + }); + Object.defineProperty(loaderContext, "currentRequest", { + enumerable: true, + get: function() { + return loaderContext.loaders.slice(loaderContext.loaderIndex).map(function(o) { + return o.request; + }).concat(loaderContext.resource || "").join("!"); + } + }); + Object.defineProperty(loaderContext, "previousRequest", { + enumerable: true, + get: function() { + return loaderContext.loaders.slice(0, loaderContext.loaderIndex).map(function(o) { + return o.request; + }).join("!"); + } + }); + Object.defineProperty(loaderContext, "query", { + enumerable: true, + get: function() { + var entry = loaderContext.loaders[loaderContext.loaderIndex]; + return entry.options && typeof entry.options === "object" ? entry.options : entry.query; + } + }); + Object.defineProperty(loaderContext, "data", { + enumerable: true, + get: function() { + return loaderContext.loaders[loaderContext.loaderIndex].data; + } + }); + + // finish loader context + if(Object.preventExtensions) { + Object.preventExtensions(loaderContext); + } + + var processOptions = { + resourceBuffer: null, + processResource: processResource + }; + iteratePitchingLoaders(processOptions, loaderContext, function(err, result) { + if(err) { + return callback(err, { + cacheable: requestCacheable, + fileDependencies: fileDependencies, + contextDependencies: contextDependencies, + missingDependencies: missingDependencies + }); + } + callback(null, { + result: result, + resourceBuffer: processOptions.resourceBuffer, + cacheable: requestCacheable, + fileDependencies: fileDependencies, + contextDependencies: contextDependencies, + missingDependencies: missingDependencies + }); + }); +}; diff --git a/node_modules/loader-runner/lib/loadLoader.js b/node_modules/loader-runner/lib/loadLoader.js new file mode 100644 index 0000000..1210353 --- /dev/null +++ b/node_modules/loader-runner/lib/loadLoader.js @@ -0,0 +1,54 @@ +var LoaderLoadingError = require("./LoaderLoadingError"); +var url; + +module.exports = function loadLoader(loader, callback) { + if(loader.type === "module") { + try { + if(url === undefined) url = require("url"); + var loaderUrl = url.pathToFileURL(loader.path); + var modulePromise = eval("import(" + JSON.stringify(loaderUrl.toString()) + ")"); + modulePromise.then(function(module) { + handleResult(loader, module, callback); + }, callback); + return; + } catch(e) { + callback(e); + } + } else { + try { + var module = require(loader.path); + } catch(e) { + // it is possible for node to choke on a require if the FD descriptor + // limit has been reached. give it a chance to recover. + if(e instanceof Error && e.code === "EMFILE") { + var retry = loadLoader.bind(null, loader, callback); + if(typeof setImmediate === "function") { + // node >= 0.9.0 + return setImmediate(retry); + } else { + // node < 0.9.0 + return process.nextTick(retry); + } + } + return callback(e); + } + return handleResult(loader, module, callback); + } +}; + +function handleResult(loader, module, callback) { + if(typeof module !== "function" && typeof module !== "object") { + return callback(new LoaderLoadingError( + "Module '" + loader.path + "' is not a loader (export function or es6 module)" + )); + } + loader.normal = typeof module === "function" ? module : module.default; + loader.pitch = module.pitch; + loader.raw = module.raw; + if(typeof loader.normal !== "function" && typeof loader.pitch !== "function") { + return callback(new LoaderLoadingError( + "Module '" + loader.path + "' is not a loader (must have normal or pitch function)" + )); + } + callback(); +} diff --git a/node_modules/loader-runner/package.json b/node_modules/loader-runner/package.json new file mode 100644 index 0000000..f8db868 --- /dev/null +++ b/node_modules/loader-runner/package.json @@ -0,0 +1,45 @@ +{ + "name": "loader-runner", + "version": "4.3.0", + "description": "Runs (webpack) loaders", + "main": "lib/LoaderRunner.js", + "scripts": { + "lint": "eslint lib test", + "pretest": "npm run lint", + "test": "mocha --reporter spec", + "precover": "npm run lint", + "cover": "istanbul cover node_modules/mocha/bin/_mocha" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/webpack/loader-runner.git" + }, + "keywords": [ + "webpack", + "loader" + ], + "author": "Tobias Koppers @sokra", + "license": "MIT", + "bugs": { + "url": "https://github.com/webpack/loader-runner/issues" + }, + "homepage": "https://github.com/webpack/loader-runner#readme", + "engines": { + "node": ">=6.11.5" + }, + "files": [ + "lib/", + "bin/", + "hot/", + "web_modules/", + "schemas/" + ], + "devDependencies": { + "eslint": "^3.12.2", + "eslint-plugin-node": "^3.0.5", + "eslint-plugin-nodeca": "^1.0.3", + "istanbul": "^0.4.1", + "mocha": "^3.2.0", + "should": "^8.0.2" + } +} diff --git a/node_modules/loader-utils/LICENSE b/node_modules/loader-utils/LICENSE new file mode 100644 index 0000000..8c11fc7 --- /dev/null +++ b/node_modules/loader-utils/LICENSE @@ -0,0 +1,20 @@ +Copyright JS Foundation and other contributors + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/loader-utils/README.md b/node_modules/loader-utils/README.md new file mode 100644 index 0000000..37fb15d --- /dev/null +++ b/node_modules/loader-utils/README.md @@ -0,0 +1,275 @@ +# loader-utils + +## Methods + +### `getOptions` + +Recommended way to retrieve the options of a loader invocation: + +```javascript +// inside your loader +const options = loaderUtils.getOptions(this); +``` + +1. If `this.query` is a string: + - Tries to parse the query string and returns a new object + - Throws if it's not a valid query string +2. If `this.query` is object-like, it just returns `this.query` +3. In any other case, it just returns `null` + +**Please note:** The returned `options` object is *read-only*. It may be re-used across multiple invocations. +If you pass it on to another library, make sure to make a *deep copy* of it: + +```javascript +const options = Object.assign( + {}, + defaultOptions, + loaderUtils.getOptions(this) // it is safe to pass null to Object.assign() +); +// don't forget nested objects or arrays +options.obj = Object.assign({}, options.obj); +options.arr = options.arr.slice(); +someLibrary(options); +``` + +[clone](https://www.npmjs.com/package/clone) is a good library to make a deep copy of the options. + +#### Options as query strings + +If the loader options have been passed as loader query string (`loader?some¶ms`), the string is parsed by using [`parseQuery`](#parsequery). + +### `parseQuery` + +Parses a passed string (e.g. `loaderContext.resourceQuery`) as a query string, and returns an object. + +``` javascript +const params = loaderUtils.parseQuery(this.resourceQuery); // resource: `file?param1=foo` +if (params.param1 === "foo") { + // do something +} +``` + +The string is parsed like this: + +``` text + -> Error +? -> {} +?flag -> { flag: true } +?+flag -> { flag: true } +?-flag -> { flag: false } +?xyz=test -> { xyz: "test" } +?xyz=1 -> { xyz: "1" } // numbers are NOT parsed +?xyz[]=a -> { xyz: ["a"] } +?flag1&flag2 -> { flag1: true, flag2: true } +?+flag1,-flag2 -> { flag1: true, flag2: false } +?xyz[]=a,xyz[]=b -> { xyz: ["a", "b"] } +?a%2C%26b=c%2C%26d -> { "a,&b": "c,&d" } +?{data:{a:1},isJSON5:true} -> { data: { a: 1 }, isJSON5: true } +``` + +### `stringifyRequest` + +Turns a request into a string that can be used inside `require()` or `import` while avoiding absolute paths. +Use it instead of `JSON.stringify(...)` if you're generating code inside a loader. + +**Why is this necessary?** Since webpack calculates the hash before module paths are translated into module ids, we must avoid absolute paths to ensure +consistent hashes across different compilations. + +This function: + +- resolves absolute requests into relative requests if the request and the module are on the same hard drive +- replaces `\` with `/` if the request and the module are on the same hard drive +- won't change the path at all if the request and the module are on different hard drives +- applies `JSON.stringify` to the result + +```javascript +loaderUtils.stringifyRequest(this, "./test.js"); +// "\"./test.js\"" + +loaderUtils.stringifyRequest(this, ".\\test.js"); +// "\"./test.js\"" + +loaderUtils.stringifyRequest(this, "test"); +// "\"test\"" + +loaderUtils.stringifyRequest(this, "test/lib/index.js"); +// "\"test/lib/index.js\"" + +loaderUtils.stringifyRequest(this, "otherLoader?andConfig!test?someConfig"); +// "\"otherLoader?andConfig!test?someConfig\"" + +loaderUtils.stringifyRequest(this, require.resolve("test")); +// "\"../node_modules/some-loader/lib/test.js\"" + +loaderUtils.stringifyRequest(this, "C:\\module\\test.js"); +// "\"../../test.js\"" (on Windows, in case the module and the request are on the same drive) + +loaderUtils.stringifyRequest(this, "C:\\module\\test.js"); +// "\"C:\\module\\test.js\"" (on Windows, in case the module and the request are on different drives) + +loaderUtils.stringifyRequest(this, "\\\\network-drive\\test.js"); +// "\"\\\\network-drive\\\\test.js\"" (on Windows, in case the module and the request are on different drives) +``` + +### `urlToRequest` + +Converts some resource URL to a webpack module request. + +> i Before call `urlToRequest` you need call `isUrlRequest` to ensure it is requestable url + +```javascript +const url = "path/to/module.js"; + +if (loaderUtils.isUrlRequest(url)) { + // Logic for requestable url + const request = loaderUtils.urlToRequest(url); +} else { + // Logic for not requestable url +} +``` + +Simple example: + +```javascript +const url = "path/to/module.js"; +const request = loaderUtils.urlToRequest(url); // "./path/to/module.js" +``` + +#### Module URLs + +Any URL containing a `~` will be interpreted as a module request. Anything after the `~` will be considered the request path. + +```javascript +const url = "~path/to/module.js"; +const request = loaderUtils.urlToRequest(url); // "path/to/module.js" +``` + +#### Root-relative URLs + +URLs that are root-relative (start with `/`) can be resolved relative to some arbitrary path by using the `root` parameter: + +```javascript +const url = "/path/to/module.js"; +const root = "./root"; +const request = loaderUtils.urlToRequest(url, root); // "./root/path/to/module.js" +``` + +To convert a root-relative URL into a module URL, specify a `root` value that starts with `~`: + +```javascript +const url = "/path/to/module.js"; +const root = "~"; +const request = loaderUtils.urlToRequest(url, root); // "path/to/module.js" +``` + +### `interpolateName` + +Interpolates a filename template using multiple placeholders and/or a regular expression. +The template and regular expression are set as query params called `name` and `regExp` on the current loader's context. + +```javascript +const interpolatedName = loaderUtils.interpolateName(loaderContext, name, options); +``` + +The following tokens are replaced in the `name` parameter: + +* `[ext]` the extension of the resource +* `[name]` the basename of the resource +* `[path]` the path of the resource relative to the `context` query parameter or option. +* `[folder]` the folder the resource is in +* `[query]` the queryof the resource, i.e. `?foo=bar` +* `[emoji]` a random emoji representation of `options.content` +* `[emoji:]` same as above, but with a customizable number of emojis +* `[contenthash]` the hash of `options.content` (Buffer) (by default it's the hex digest of the md5 hash) +* `[:contenthash::]` optionally one can configure + * other `hashType`s, i. e. `sha1`, `md5`, `sha256`, `sha512` + * other `digestType`s, i. e. `hex`, `base26`, `base32`, `base36`, `base49`, `base52`, `base58`, `base62`, `base64` + * and `length` the length in chars +* `[hash]` the hash of `options.content` (Buffer) (by default it's the hex digest of the md5 hash) +* `[:hash::]` optionally one can configure + * other `hashType`s, i. e. `sha1`, `md5`, `sha256`, `sha512` + * other `digestType`s, i. e. `hex`, `base26`, `base32`, `base36`, `base49`, `base52`, `base58`, `base62`, `base64` + * and `length` the length in chars +* `[N]` the N-th match obtained from matching the current file name against `options.regExp` + +In loader context `[hash]` and `[contenthash]` are the same, but we recommend using `[contenthash]` for avoid misleading. + +Examples + +``` javascript +// loaderContext.resourcePath = "/absolute/path/to/app/js/javascript.js" +loaderUtils.interpolateName(loaderContext, "js/[hash].script.[ext]", { content: ... }); +// => js/9473fdd0d880a43c21b7778d34872157.script.js + +// loaderContext.resourcePath = "/absolute/path/to/app/js/javascript.js" +// loaderContext.resourceQuery = "?foo=bar" +loaderUtils.interpolateName(loaderContext, "js/[hash].script.[ext][query]", { content: ... }); +// => js/9473fdd0d880a43c21b7778d34872157.script.js?foo=bar + +// loaderContext.resourcePath = "/absolute/path/to/app/js/javascript.js" +loaderUtils.interpolateName(loaderContext, "js/[contenthash].script.[ext]", { content: ... }); +// => js/9473fdd0d880a43c21b7778d34872157.script.js + +// loaderContext.resourcePath = "/absolute/path/to/app/page.html" +loaderUtils.interpolateName(loaderContext, "html-[hash:6].html", { content: ... }); +// => html-9473fd.html + +// loaderContext.resourcePath = "/absolute/path/to/app/flash.txt" +loaderUtils.interpolateName(loaderContext, "[hash]", { content: ... }); +// => c31e9820c001c9c4a86bce33ce43b679 + +// loaderContext.resourcePath = "/absolute/path/to/app/img/image.gif" +loaderUtils.interpolateName(loaderContext, "[emoji]", { content: ... }); +// => 👍 + +// loaderContext.resourcePath = "/absolute/path/to/app/img/image.gif" +loaderUtils.interpolateName(loaderContext, "[emoji:4]", { content: ... }); +// => 🙍🏢📤🐝 + +// loaderContext.resourcePath = "/absolute/path/to/app/img/image.png" +loaderUtils.interpolateName(loaderContext, "[sha512:hash:base64:7].[ext]", { content: ... }); +// => 2BKDTjl.png +// use sha512 hash instead of md5 and with only 7 chars of base64 + +// loaderContext.resourcePath = "/absolute/path/to/app/img/myself.png" +// loaderContext.query.name = +loaderUtils.interpolateName(loaderContext, "picture.png"); +// => picture.png + +// loaderContext.resourcePath = "/absolute/path/to/app/dir/file.png" +loaderUtils.interpolateName(loaderContext, "[path][name].[ext]?[hash]", { content: ... }); +// => /app/dir/file.png?9473fdd0d880a43c21b7778d34872157 + +// loaderContext.resourcePath = "/absolute/path/to/app/js/page-home.js" +loaderUtils.interpolateName(loaderContext, "script-[1].[ext]", { regExp: "page-(.*)\\.js", content: ... }); +// => script-home.js + +// loaderContext.resourcePath = "/absolute/path/to/app/js/javascript.js" +// loaderContext.resourceQuery = "?foo=bar" +loaderUtils.interpolateName( + loaderContext, + (resourcePath, resourceQuery) => { + // resourcePath - `/app/js/javascript.js` + // resourceQuery - `?foo=bar` + + return "js/[hash].script.[ext]"; + }, + { content: ... } +); +// => js/9473fdd0d880a43c21b7778d34872157.script.js +``` + +### `getHashDigest` + +``` javascript +const digestString = loaderUtils.getHashDigest(buffer, hashType, digestType, maxLength); +``` + +* `buffer` the content that should be hashed +* `hashType` one of `sha1`, `md5`, `sha256`, `sha512` or any other node.js supported hash type +* `digestType` one of `hex`, `base26`, `base32`, `base36`, `base49`, `base52`, `base58`, `base62`, `base64` +* `maxLength` the maximum length in chars + +## License + +MIT (http://www.opensource.org/licenses/mit-license.php) diff --git a/node_modules/loader-utils/lib/getCurrentRequest.js b/node_modules/loader-utils/lib/getCurrentRequest.js new file mode 100644 index 0000000..4818563 --- /dev/null +++ b/node_modules/loader-utils/lib/getCurrentRequest.js @@ -0,0 +1,16 @@ +'use strict'; + +function getCurrentRequest(loaderContext) { + if (loaderContext.currentRequest) { + return loaderContext.currentRequest; + } + + const request = loaderContext.loaders + .slice(loaderContext.loaderIndex) + .map((obj) => obj.request) + .concat([loaderContext.resource]); + + return request.join('!'); +} + +module.exports = getCurrentRequest; diff --git a/node_modules/loader-utils/lib/getHashDigest.js b/node_modules/loader-utils/lib/getHashDigest.js new file mode 100644 index 0000000..bbc4e03 --- /dev/null +++ b/node_modules/loader-utils/lib/getHashDigest.js @@ -0,0 +1,69 @@ +'use strict'; + +const baseEncodeTables = { + 26: 'abcdefghijklmnopqrstuvwxyz', + 32: '123456789abcdefghjkmnpqrstuvwxyz', // no 0lio + 36: '0123456789abcdefghijklmnopqrstuvwxyz', + 49: 'abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ', // no lIO + 52: 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', + 58: '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ', // no 0lIO + 62: '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', + 64: '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_', +}; + +function encodeBufferToBase(buffer, base) { + const encodeTable = baseEncodeTables[base]; + if (!encodeTable) { + throw new Error('Unknown encoding base' + base); + } + + const readLength = buffer.length; + const Big = require('big.js'); + + Big.RM = Big.DP = 0; + let b = new Big(0); + + for (let i = readLength - 1; i >= 0; i--) { + b = b.times(256).plus(buffer[i]); + } + + let output = ''; + while (b.gt(0)) { + output = encodeTable[b.mod(base)] + output; + b = b.div(base); + } + + Big.DP = 20; + Big.RM = 1; + + return output; +} + +function getHashDigest(buffer, hashType, digestType, maxLength) { + hashType = hashType || 'md5'; + maxLength = maxLength || 9999; + + const hash = require('crypto').createHash(hashType); + + hash.update(buffer); + + if ( + digestType === 'base26' || + digestType === 'base32' || + digestType === 'base36' || + digestType === 'base49' || + digestType === 'base52' || + digestType === 'base58' || + digestType === 'base62' || + digestType === 'base64' + ) { + return encodeBufferToBase(hash.digest(), digestType.substr(4)).substr( + 0, + maxLength + ); + } else { + return hash.digest(digestType || 'hex').substr(0, maxLength); + } +} + +module.exports = getHashDigest; diff --git a/node_modules/loader-utils/lib/getOptions.js b/node_modules/loader-utils/lib/getOptions.js new file mode 100644 index 0000000..9cbbed4 --- /dev/null +++ b/node_modules/loader-utils/lib/getOptions.js @@ -0,0 +1,20 @@ +'use strict'; + +const parseQuery = require('./parseQuery'); + +function getOptions(loaderContext) { + const query = loaderContext.query; + + if (typeof query === 'string' && query !== '') { + return parseQuery(loaderContext.query); + } + + if (!query || typeof query !== 'object') { + // Not object-like queries are not supported. + return null; + } + + return query; +} + +module.exports = getOptions; diff --git a/node_modules/loader-utils/lib/getRemainingRequest.js b/node_modules/loader-utils/lib/getRemainingRequest.js new file mode 100644 index 0000000..5839b2f --- /dev/null +++ b/node_modules/loader-utils/lib/getRemainingRequest.js @@ -0,0 +1,16 @@ +'use strict'; + +function getRemainingRequest(loaderContext) { + if (loaderContext.remainingRequest) { + return loaderContext.remainingRequest; + } + + const request = loaderContext.loaders + .slice(loaderContext.loaderIndex + 1) + .map((obj) => obj.request) + .concat([loaderContext.resource]); + + return request.join('!'); +} + +module.exports = getRemainingRequest; diff --git a/node_modules/loader-utils/lib/index.js b/node_modules/loader-utils/lib/index.js new file mode 100644 index 0000000..2591310 --- /dev/null +++ b/node_modules/loader-utils/lib/index.js @@ -0,0 +1,23 @@ +'use strict'; + +const getOptions = require('./getOptions'); +const parseQuery = require('./parseQuery'); +const stringifyRequest = require('./stringifyRequest'); +const getRemainingRequest = require('./getRemainingRequest'); +const getCurrentRequest = require('./getCurrentRequest'); +const isUrlRequest = require('./isUrlRequest'); +const urlToRequest = require('./urlToRequest'); +const parseString = require('./parseString'); +const getHashDigest = require('./getHashDigest'); +const interpolateName = require('./interpolateName'); + +exports.getOptions = getOptions; +exports.parseQuery = parseQuery; +exports.stringifyRequest = stringifyRequest; +exports.getRemainingRequest = getRemainingRequest; +exports.getCurrentRequest = getCurrentRequest; +exports.isUrlRequest = isUrlRequest; +exports.urlToRequest = urlToRequest; +exports.parseString = parseString; +exports.getHashDigest = getHashDigest; +exports.interpolateName = interpolateName; diff --git a/node_modules/loader-utils/lib/interpolateName.js b/node_modules/loader-utils/lib/interpolateName.js new file mode 100644 index 0000000..0cd3932 --- /dev/null +++ b/node_modules/loader-utils/lib/interpolateName.js @@ -0,0 +1,151 @@ +'use strict'; + +const path = require('path'); +const emojisList = require('emojis-list'); +const getHashDigest = require('./getHashDigest'); + +const emojiRegex = /[\uD800-\uDFFF]./; +const emojiList = emojisList.filter((emoji) => emojiRegex.test(emoji)); +const emojiCache = {}; + +function encodeStringToEmoji(content, length) { + if (emojiCache[content]) { + return emojiCache[content]; + } + + length = length || 1; + + const emojis = []; + + do { + if (!emojiList.length) { + throw new Error('Ran out of emoji'); + } + + const index = Math.floor(Math.random() * emojiList.length); + + emojis.push(emojiList[index]); + emojiList.splice(index, 1); + } while (--length > 0); + + const emojiEncoding = emojis.join(''); + + emojiCache[content] = emojiEncoding; + + return emojiEncoding; +} + +function interpolateName(loaderContext, name, options) { + let filename; + + const hasQuery = + loaderContext.resourceQuery && loaderContext.resourceQuery.length > 1; + + if (typeof name === 'function') { + filename = name( + loaderContext.resourcePath, + hasQuery ? loaderContext.resourceQuery : undefined + ); + } else { + filename = name || '[hash].[ext]'; + } + + const context = options.context; + const content = options.content; + const regExp = options.regExp; + + let ext = 'bin'; + let basename = 'file'; + let directory = ''; + let folder = ''; + let query = ''; + + if (loaderContext.resourcePath) { + const parsed = path.parse(loaderContext.resourcePath); + let resourcePath = loaderContext.resourcePath; + + if (parsed.ext) { + ext = parsed.ext.substr(1); + } + + if (parsed.dir) { + basename = parsed.name; + resourcePath = parsed.dir + path.sep; + } + + if (typeof context !== 'undefined') { + directory = path + .relative(context, resourcePath + '_') + .replace(/\\/g, '/') + .replace(/\.\.(\/)?/g, '_$1'); + directory = directory.substr(0, directory.length - 1); + } else { + directory = resourcePath.replace(/\\/g, '/').replace(/\.\.(\/)?/g, '_$1'); + } + + if (directory.length === 1) { + directory = ''; + } else if (directory.length > 1) { + folder = path.basename(directory); + } + } + + if (loaderContext.resourceQuery && loaderContext.resourceQuery.length > 1) { + query = loaderContext.resourceQuery; + + const hashIdx = query.indexOf('#'); + + if (hashIdx >= 0) { + query = query.substr(0, hashIdx); + } + } + + let url = filename; + + if (content) { + // Match hash template + url = url + // `hash` and `contenthash` are same in `loader-utils` context + // let's keep `hash` for backward compatibility + .replace( + /\[(?:([^[:\]]+):)?(?:hash|contenthash)(?::([a-z]+\d*))?(?::(\d+))?\]/gi, + (all, hashType, digestType, maxLength) => + getHashDigest(content, hashType, digestType, parseInt(maxLength, 10)) + ) + .replace(/\[emoji(?::(\d+))?\]/gi, (all, length) => + encodeStringToEmoji(content, parseInt(length, 10)) + ); + } + + url = url + .replace(/\[ext\]/gi, () => ext) + .replace(/\[name\]/gi, () => basename) + .replace(/\[path\]/gi, () => directory) + .replace(/\[folder\]/gi, () => folder) + .replace(/\[query\]/gi, () => query); + + if (regExp && loaderContext.resourcePath) { + const match = loaderContext.resourcePath.match(new RegExp(regExp)); + + match && + match.forEach((matched, i) => { + url = url.replace(new RegExp('\\[' + i + '\\]', 'ig'), matched); + }); + } + + if ( + typeof loaderContext.options === 'object' && + typeof loaderContext.options.customInterpolateName === 'function' + ) { + url = loaderContext.options.customInterpolateName.call( + loaderContext, + url, + name, + options + ); + } + + return url; +} + +module.exports = interpolateName; diff --git a/node_modules/loader-utils/lib/isUrlRequest.js b/node_modules/loader-utils/lib/isUrlRequest.js new file mode 100644 index 0000000..4592cb1 --- /dev/null +++ b/node_modules/loader-utils/lib/isUrlRequest.js @@ -0,0 +1,31 @@ +'use strict'; + +const path = require('path'); + +function isUrlRequest(url, root) { + // An URL is not an request if + + // 1. It's an absolute url and it is not `windows` path like `C:\dir\file` + if (/^[a-z][a-z0-9+.-]*:/i.test(url) && !path.win32.isAbsolute(url)) { + return false; + } + + // 2. It's a protocol-relative + if (/^\/\//.test(url)) { + return false; + } + + // 3. It's some kind of url for a template + if (/^[{}[\]#*;,'§$%&(=?`´^°<>]/.test(url)) { + return false; + } + + // 4. It's also not an request if root isn't set and it's a root-relative url + if ((root === undefined || root === false) && /^\//.test(url)) { + return false; + } + + return true; +} + +module.exports = isUrlRequest; diff --git a/node_modules/loader-utils/lib/parseQuery.js b/node_modules/loader-utils/lib/parseQuery.js new file mode 100644 index 0000000..3dd7cb9 --- /dev/null +++ b/node_modules/loader-utils/lib/parseQuery.js @@ -0,0 +1,68 @@ +'use strict'; + +const JSON5 = require('json5'); + +const specialValues = { + null: null, + true: true, + false: false, +}; + +function parseQuery(query) { + if (query.substr(0, 1) !== '?') { + throw new Error( + "A valid query string passed to parseQuery should begin with '?'" + ); + } + + query = query.substr(1); + + if (!query) { + return {}; + } + + if (query.substr(0, 1) === '{' && query.substr(-1) === '}') { + return JSON5.parse(query); + } + + const queryArgs = query.split(/[,&]/g); + const result = Object.create(null); + + queryArgs.forEach((arg) => { + const idx = arg.indexOf('='); + + if (idx >= 0) { + let name = arg.substr(0, idx); + let value = decodeURIComponent(arg.substr(idx + 1)); + + if (specialValues.hasOwnProperty(value)) { + value = specialValues[value]; + } + + if (name.substr(-2) === '[]') { + name = decodeURIComponent(name.substr(0, name.length - 2)); + + if (!Array.isArray(result[name])) { + result[name] = []; + } + + result[name].push(value); + } else { + name = decodeURIComponent(name); + result[name] = value; + } + } else { + if (arg.substr(0, 1) === '-') { + result[decodeURIComponent(arg.substr(1))] = false; + } else if (arg.substr(0, 1) === '+') { + result[decodeURIComponent(arg.substr(1))] = true; + } else { + result[decodeURIComponent(arg)] = true; + } + } + }); + + return result; +} + +module.exports = parseQuery; diff --git a/node_modules/loader-utils/lib/parseString.js b/node_modules/loader-utils/lib/parseString.js new file mode 100644 index 0000000..6e36f29 --- /dev/null +++ b/node_modules/loader-utils/lib/parseString.js @@ -0,0 +1,23 @@ +'use strict'; + +function parseString(str) { + try { + if (str[0] === '"') { + return JSON.parse(str); + } + + if (str[0] === "'" && str.substr(str.length - 1) === "'") { + return parseString( + str + .replace(/\\.|"/g, (x) => (x === '"' ? '\\"' : x)) + .replace(/^'|'$/g, '"') + ); + } + + return JSON.parse('"' + str + '"'); + } catch (e) { + return str; + } +} + +module.exports = parseString; diff --git a/node_modules/loader-utils/lib/stringifyRequest.js b/node_modules/loader-utils/lib/stringifyRequest.js new file mode 100644 index 0000000..9bd5593 --- /dev/null +++ b/node_modules/loader-utils/lib/stringifyRequest.js @@ -0,0 +1,51 @@ +'use strict'; + +const path = require('path'); + +const matchRelativePath = /^\.\.?[/\\]/; + +function isAbsolutePath(str) { + return path.posix.isAbsolute(str) || path.win32.isAbsolute(str); +} + +function isRelativePath(str) { + return matchRelativePath.test(str); +} + +function stringifyRequest(loaderContext, request) { + const splitted = request.split('!'); + const context = + loaderContext.context || + (loaderContext.options && loaderContext.options.context); + + return JSON.stringify( + splitted + .map((part) => { + // First, separate singlePath from query, because the query might contain paths again + const splittedPart = part.match(/^(.*?)(\?.*)/); + const query = splittedPart ? splittedPart[2] : ''; + let singlePath = splittedPart ? splittedPart[1] : part; + + if (isAbsolutePath(singlePath) && context) { + singlePath = path.relative(context, singlePath); + + if (isAbsolutePath(singlePath)) { + // If singlePath still matches an absolute path, singlePath was on a different drive than context. + // In this case, we leave the path platform-specific without replacing any separators. + // @see https://github.com/webpack/loader-utils/pull/14 + return singlePath + query; + } + + if (isRelativePath(singlePath) === false) { + // Ensure that the relative path starts at least with ./ otherwise it would be a request into the modules directory (like node_modules). + singlePath = './' + singlePath; + } + } + + return singlePath.replace(/\\/g, '/') + query; + }) + .join('!') + ); +} + +module.exports = stringifyRequest; diff --git a/node_modules/loader-utils/lib/urlToRequest.js b/node_modules/loader-utils/lib/urlToRequest.js new file mode 100644 index 0000000..e2b60d3 --- /dev/null +++ b/node_modules/loader-utils/lib/urlToRequest.js @@ -0,0 +1,60 @@ +'use strict'; + +// we can't use path.win32.isAbsolute because it also matches paths starting with a forward slash +const matchNativeWin32Path = /^[A-Z]:[/\\]|^\\\\/i; + +function urlToRequest(url, root) { + // Do not rewrite an empty url + if (url === '') { + return ''; + } + + const moduleRequestRegex = /^[^?]*~/; + let request; + + if (matchNativeWin32Path.test(url)) { + // absolute windows path, keep it + request = url; + } else if (root !== undefined && root !== false && /^\//.test(url)) { + // if root is set and the url is root-relative + switch (typeof root) { + // 1. root is a string: root is prefixed to the url + case 'string': + // special case: `~` roots convert to module request + if (moduleRequestRegex.test(root)) { + request = root.replace(/([^~/])$/, '$1/') + url.slice(1); + } else { + request = root + url; + } + break; + // 2. root is `true`: absolute paths are allowed + // *nix only, windows-style absolute paths are always allowed as they doesn't start with a `/` + case 'boolean': + request = url; + break; + default: + throw new Error( + "Unexpected parameters to loader-utils 'urlToRequest': url = " + + url + + ', root = ' + + root + + '.' + ); + } + } else if (/^\.\.?\//.test(url)) { + // A relative url stays + request = url; + } else { + // every other url is threaded like a relative url + request = './' + url; + } + + // A `~` makes the url an module + if (moduleRequestRegex.test(request)) { + request = request.replace(moduleRequestRegex, ''); + } + + return request; +} + +module.exports = urlToRequest; diff --git a/node_modules/loader-utils/package.json b/node_modules/loader-utils/package.json new file mode 100644 index 0000000..84c905d --- /dev/null +++ b/node_modules/loader-utils/package.json @@ -0,0 +1,39 @@ +{ + "name": "loader-utils", + "version": "1.4.2", + "author": "Tobias Koppers @sokra", + "description": "utils for webpack loaders", + "dependencies": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^1.0.1" + }, + "scripts": { + "lint": "eslint lib test", + "pretest": "yarn lint", + "test": "jest", + "test:ci": "jest --coverage", + "release": "yarn test && standard-version" + }, + "license": "MIT", + "repository": { + "type": "git", + "url": "https://github.com/webpack/loader-utils.git" + }, + "engines": { + "node": ">=4.0.0" + }, + "devDependencies": { + "coveralls": "^3.0.2", + "eslint": "^5.11.0", + "eslint-plugin-node": "^8.0.0", + "eslint-plugin-prettier": "^3.0.0", + "jest": "^21.2.1", + "prettier": "^1.19.1", + "standard-version": "^4.0.0" + }, + "main": "lib/index.js", + "files": [ + "lib" + ] +} diff --git a/node_modules/lodash/LICENSE b/node_modules/lodash/LICENSE new file mode 100644 index 0000000..77c42f1 --- /dev/null +++ b/node_modules/lodash/LICENSE @@ -0,0 +1,47 @@ +Copyright OpenJS Foundation and other contributors + +Based on Underscore.js, copyright Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +This software consists of voluntary contributions made by many +individuals. For exact contribution history, see the revision history +available at https://github.com/lodash/lodash + +The following license applies to all parts of this software except as +documented below: + +==== + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +==== + +Copyright and related rights for sample code are waived via CC0. Sample +code is defined as all source code displayed within the prose of the +documentation. + +CC0: http://creativecommons.org/publicdomain/zero/1.0/ + +==== + +Files located in the node_modules and vendor directories are externally +maintained libraries used by this software which have their own +licenses; we recommend you read them, as their terms may differ from the +terms above. diff --git a/node_modules/lodash/README.md b/node_modules/lodash/README.md new file mode 100644 index 0000000..3ab1a05 --- /dev/null +++ b/node_modules/lodash/README.md @@ -0,0 +1,39 @@ +# lodash v4.17.21 + +The [Lodash](https://lodash.com/) library exported as [Node.js](https://nodejs.org/) modules. + +## Installation + +Using npm: +```shell +$ npm i -g npm +$ npm i --save lodash +``` + +In Node.js: +```js +// Load the full build. +var _ = require('lodash'); +// Load the core build. +var _ = require('lodash/core'); +// Load the FP build for immutable auto-curried iteratee-first data-last methods. +var fp = require('lodash/fp'); + +// Load method categories. +var array = require('lodash/array'); +var object = require('lodash/fp/object'); + +// Cherry-pick methods for smaller browserify/rollup/webpack bundles. +var at = require('lodash/at'); +var curryN = require('lodash/fp/curryN'); +``` + +See the [package source](https://github.com/lodash/lodash/tree/4.17.21-npm) for more details. + +**Note:**
+Install [n_](https://www.npmjs.com/package/n_) for Lodash use in the Node.js < 6 REPL. + +## Support + +Tested in Chrome 74-75, Firefox 66-67, IE 11, Edge 18, Safari 11-12, & Node.js 8-12.
+Automated [browser](https://saucelabs.com/u/lodash) & [CI](https://travis-ci.org/lodash/lodash/) test runs are available. diff --git a/node_modules/lodash/_DataView.js b/node_modules/lodash/_DataView.js new file mode 100644 index 0000000..ac2d57c --- /dev/null +++ b/node_modules/lodash/_DataView.js @@ -0,0 +1,7 @@ +var getNative = require('./_getNative'), + root = require('./_root'); + +/* Built-in method references that are verified to be native. */ +var DataView = getNative(root, 'DataView'); + +module.exports = DataView; diff --git a/node_modules/lodash/_Hash.js b/node_modules/lodash/_Hash.js new file mode 100644 index 0000000..b504fe3 --- /dev/null +++ b/node_modules/lodash/_Hash.js @@ -0,0 +1,32 @@ +var hashClear = require('./_hashClear'), + hashDelete = require('./_hashDelete'), + hashGet = require('./_hashGet'), + hashHas = require('./_hashHas'), + hashSet = require('./_hashSet'); + +/** + * Creates a hash object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function Hash(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +// Add methods to `Hash`. +Hash.prototype.clear = hashClear; +Hash.prototype['delete'] = hashDelete; +Hash.prototype.get = hashGet; +Hash.prototype.has = hashHas; +Hash.prototype.set = hashSet; + +module.exports = Hash; diff --git a/node_modules/lodash/_LazyWrapper.js b/node_modules/lodash/_LazyWrapper.js new file mode 100644 index 0000000..81786c7 --- /dev/null +++ b/node_modules/lodash/_LazyWrapper.js @@ -0,0 +1,28 @@ +var baseCreate = require('./_baseCreate'), + baseLodash = require('./_baseLodash'); + +/** Used as references for the maximum length and index of an array. */ +var MAX_ARRAY_LENGTH = 4294967295; + +/** + * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation. + * + * @private + * @constructor + * @param {*} value The value to wrap. + */ +function LazyWrapper(value) { + this.__wrapped__ = value; + this.__actions__ = []; + this.__dir__ = 1; + this.__filtered__ = false; + this.__iteratees__ = []; + this.__takeCount__ = MAX_ARRAY_LENGTH; + this.__views__ = []; +} + +// Ensure `LazyWrapper` is an instance of `baseLodash`. +LazyWrapper.prototype = baseCreate(baseLodash.prototype); +LazyWrapper.prototype.constructor = LazyWrapper; + +module.exports = LazyWrapper; diff --git a/node_modules/lodash/_ListCache.js b/node_modules/lodash/_ListCache.js new file mode 100644 index 0000000..26895c3 --- /dev/null +++ b/node_modules/lodash/_ListCache.js @@ -0,0 +1,32 @@ +var listCacheClear = require('./_listCacheClear'), + listCacheDelete = require('./_listCacheDelete'), + listCacheGet = require('./_listCacheGet'), + listCacheHas = require('./_listCacheHas'), + listCacheSet = require('./_listCacheSet'); + +/** + * Creates an list cache object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function ListCache(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +// Add methods to `ListCache`. +ListCache.prototype.clear = listCacheClear; +ListCache.prototype['delete'] = listCacheDelete; +ListCache.prototype.get = listCacheGet; +ListCache.prototype.has = listCacheHas; +ListCache.prototype.set = listCacheSet; + +module.exports = ListCache; diff --git a/node_modules/lodash/_LodashWrapper.js b/node_modules/lodash/_LodashWrapper.js new file mode 100644 index 0000000..c1e4d9d --- /dev/null +++ b/node_modules/lodash/_LodashWrapper.js @@ -0,0 +1,22 @@ +var baseCreate = require('./_baseCreate'), + baseLodash = require('./_baseLodash'); + +/** + * The base constructor for creating `lodash` wrapper objects. + * + * @private + * @param {*} value The value to wrap. + * @param {boolean} [chainAll] Enable explicit method chain sequences. + */ +function LodashWrapper(value, chainAll) { + this.__wrapped__ = value; + this.__actions__ = []; + this.__chain__ = !!chainAll; + this.__index__ = 0; + this.__values__ = undefined; +} + +LodashWrapper.prototype = baseCreate(baseLodash.prototype); +LodashWrapper.prototype.constructor = LodashWrapper; + +module.exports = LodashWrapper; diff --git a/node_modules/lodash/_Map.js b/node_modules/lodash/_Map.js new file mode 100644 index 0000000..b73f29a --- /dev/null +++ b/node_modules/lodash/_Map.js @@ -0,0 +1,7 @@ +var getNative = require('./_getNative'), + root = require('./_root'); + +/* Built-in method references that are verified to be native. */ +var Map = getNative(root, 'Map'); + +module.exports = Map; diff --git a/node_modules/lodash/_MapCache.js b/node_modules/lodash/_MapCache.js new file mode 100644 index 0000000..4a4eea7 --- /dev/null +++ b/node_modules/lodash/_MapCache.js @@ -0,0 +1,32 @@ +var mapCacheClear = require('./_mapCacheClear'), + mapCacheDelete = require('./_mapCacheDelete'), + mapCacheGet = require('./_mapCacheGet'), + mapCacheHas = require('./_mapCacheHas'), + mapCacheSet = require('./_mapCacheSet'); + +/** + * Creates a map cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function MapCache(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +// Add methods to `MapCache`. +MapCache.prototype.clear = mapCacheClear; +MapCache.prototype['delete'] = mapCacheDelete; +MapCache.prototype.get = mapCacheGet; +MapCache.prototype.has = mapCacheHas; +MapCache.prototype.set = mapCacheSet; + +module.exports = MapCache; diff --git a/node_modules/lodash/_Promise.js b/node_modules/lodash/_Promise.js new file mode 100644 index 0000000..247b9e1 --- /dev/null +++ b/node_modules/lodash/_Promise.js @@ -0,0 +1,7 @@ +var getNative = require('./_getNative'), + root = require('./_root'); + +/* Built-in method references that are verified to be native. */ +var Promise = getNative(root, 'Promise'); + +module.exports = Promise; diff --git a/node_modules/lodash/_Set.js b/node_modules/lodash/_Set.js new file mode 100644 index 0000000..b3c8dcb --- /dev/null +++ b/node_modules/lodash/_Set.js @@ -0,0 +1,7 @@ +var getNative = require('./_getNative'), + root = require('./_root'); + +/* Built-in method references that are verified to be native. */ +var Set = getNative(root, 'Set'); + +module.exports = Set; diff --git a/node_modules/lodash/_SetCache.js b/node_modules/lodash/_SetCache.js new file mode 100644 index 0000000..6468b06 --- /dev/null +++ b/node_modules/lodash/_SetCache.js @@ -0,0 +1,27 @@ +var MapCache = require('./_MapCache'), + setCacheAdd = require('./_setCacheAdd'), + setCacheHas = require('./_setCacheHas'); + +/** + * + * Creates an array cache object to store unique values. + * + * @private + * @constructor + * @param {Array} [values] The values to cache. + */ +function SetCache(values) { + var index = -1, + length = values == null ? 0 : values.length; + + this.__data__ = new MapCache; + while (++index < length) { + this.add(values[index]); + } +} + +// Add methods to `SetCache`. +SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; +SetCache.prototype.has = setCacheHas; + +module.exports = SetCache; diff --git a/node_modules/lodash/_Stack.js b/node_modules/lodash/_Stack.js new file mode 100644 index 0000000..80b2cf1 --- /dev/null +++ b/node_modules/lodash/_Stack.js @@ -0,0 +1,27 @@ +var ListCache = require('./_ListCache'), + stackClear = require('./_stackClear'), + stackDelete = require('./_stackDelete'), + stackGet = require('./_stackGet'), + stackHas = require('./_stackHas'), + stackSet = require('./_stackSet'); + +/** + * Creates a stack cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function Stack(entries) { + var data = this.__data__ = new ListCache(entries); + this.size = data.size; +} + +// Add methods to `Stack`. +Stack.prototype.clear = stackClear; +Stack.prototype['delete'] = stackDelete; +Stack.prototype.get = stackGet; +Stack.prototype.has = stackHas; +Stack.prototype.set = stackSet; + +module.exports = Stack; diff --git a/node_modules/lodash/_Symbol.js b/node_modules/lodash/_Symbol.js new file mode 100644 index 0000000..a013f7c --- /dev/null +++ b/node_modules/lodash/_Symbol.js @@ -0,0 +1,6 @@ +var root = require('./_root'); + +/** Built-in value references. */ +var Symbol = root.Symbol; + +module.exports = Symbol; diff --git a/node_modules/lodash/_Uint8Array.js b/node_modules/lodash/_Uint8Array.js new file mode 100644 index 0000000..2fb30e1 --- /dev/null +++ b/node_modules/lodash/_Uint8Array.js @@ -0,0 +1,6 @@ +var root = require('./_root'); + +/** Built-in value references. */ +var Uint8Array = root.Uint8Array; + +module.exports = Uint8Array; diff --git a/node_modules/lodash/_WeakMap.js b/node_modules/lodash/_WeakMap.js new file mode 100644 index 0000000..567f86c --- /dev/null +++ b/node_modules/lodash/_WeakMap.js @@ -0,0 +1,7 @@ +var getNative = require('./_getNative'), + root = require('./_root'); + +/* Built-in method references that are verified to be native. */ +var WeakMap = getNative(root, 'WeakMap'); + +module.exports = WeakMap; diff --git a/node_modules/lodash/_apply.js b/node_modules/lodash/_apply.js new file mode 100644 index 0000000..36436dd --- /dev/null +++ b/node_modules/lodash/_apply.js @@ -0,0 +1,21 @@ +/** + * A faster alternative to `Function#apply`, this function invokes `func` + * with the `this` binding of `thisArg` and the arguments of `args`. + * + * @private + * @param {Function} func The function to invoke. + * @param {*} thisArg The `this` binding of `func`. + * @param {Array} args The arguments to invoke `func` with. + * @returns {*} Returns the result of `func`. + */ +function apply(func, thisArg, args) { + switch (args.length) { + case 0: return func.call(thisArg); + case 1: return func.call(thisArg, args[0]); + case 2: return func.call(thisArg, args[0], args[1]); + case 3: return func.call(thisArg, args[0], args[1], args[2]); + } + return func.apply(thisArg, args); +} + +module.exports = apply; diff --git a/node_modules/lodash/_arrayAggregator.js b/node_modules/lodash/_arrayAggregator.js new file mode 100644 index 0000000..d96c3ca --- /dev/null +++ b/node_modules/lodash/_arrayAggregator.js @@ -0,0 +1,22 @@ +/** + * A specialized version of `baseAggregator` for arrays. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} setter The function to set `accumulator` values. + * @param {Function} iteratee The iteratee to transform keys. + * @param {Object} accumulator The initial aggregated object. + * @returns {Function} Returns `accumulator`. + */ +function arrayAggregator(array, setter, iteratee, accumulator) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + var value = array[index]; + setter(accumulator, value, iteratee(value), array); + } + return accumulator; +} + +module.exports = arrayAggregator; diff --git a/node_modules/lodash/_arrayEach.js b/node_modules/lodash/_arrayEach.js new file mode 100644 index 0000000..2c5f579 --- /dev/null +++ b/node_modules/lodash/_arrayEach.js @@ -0,0 +1,22 @@ +/** + * A specialized version of `_.forEach` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns `array`. + */ +function arrayEach(array, iteratee) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (iteratee(array[index], index, array) === false) { + break; + } + } + return array; +} + +module.exports = arrayEach; diff --git a/node_modules/lodash/_arrayEachRight.js b/node_modules/lodash/_arrayEachRight.js new file mode 100644 index 0000000..976ca5c --- /dev/null +++ b/node_modules/lodash/_arrayEachRight.js @@ -0,0 +1,21 @@ +/** + * A specialized version of `_.forEachRight` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns `array`. + */ +function arrayEachRight(array, iteratee) { + var length = array == null ? 0 : array.length; + + while (length--) { + if (iteratee(array[length], length, array) === false) { + break; + } + } + return array; +} + +module.exports = arrayEachRight; diff --git a/node_modules/lodash/_arrayEvery.js b/node_modules/lodash/_arrayEvery.js new file mode 100644 index 0000000..e26a918 --- /dev/null +++ b/node_modules/lodash/_arrayEvery.js @@ -0,0 +1,23 @@ +/** + * A specialized version of `_.every` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false`. + */ +function arrayEvery(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (!predicate(array[index], index, array)) { + return false; + } + } + return true; +} + +module.exports = arrayEvery; diff --git a/node_modules/lodash/_arrayFilter.js b/node_modules/lodash/_arrayFilter.js new file mode 100644 index 0000000..75ea254 --- /dev/null +++ b/node_modules/lodash/_arrayFilter.js @@ -0,0 +1,25 @@ +/** + * A specialized version of `_.filter` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + */ +function arrayFilter(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (predicate(value, index, array)) { + result[resIndex++] = value; + } + } + return result; +} + +module.exports = arrayFilter; diff --git a/node_modules/lodash/_arrayIncludes.js b/node_modules/lodash/_arrayIncludes.js new file mode 100644 index 0000000..3737a6d --- /dev/null +++ b/node_modules/lodash/_arrayIncludes.js @@ -0,0 +1,17 @@ +var baseIndexOf = require('./_baseIndexOf'); + +/** + * A specialized version of `_.includes` for arrays without support for + * specifying an index to search from. + * + * @private + * @param {Array} [array] The array to inspect. + * @param {*} target The value to search for. + * @returns {boolean} Returns `true` if `target` is found, else `false`. + */ +function arrayIncludes(array, value) { + var length = array == null ? 0 : array.length; + return !!length && baseIndexOf(array, value, 0) > -1; +} + +module.exports = arrayIncludes; diff --git a/node_modules/lodash/_arrayIncludesWith.js b/node_modules/lodash/_arrayIncludesWith.js new file mode 100644 index 0000000..235fd97 --- /dev/null +++ b/node_modules/lodash/_arrayIncludesWith.js @@ -0,0 +1,22 @@ +/** + * This function is like `arrayIncludes` except that it accepts a comparator. + * + * @private + * @param {Array} [array] The array to inspect. + * @param {*} target The value to search for. + * @param {Function} comparator The comparator invoked per element. + * @returns {boolean} Returns `true` if `target` is found, else `false`. + */ +function arrayIncludesWith(array, value, comparator) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (comparator(value, array[index])) { + return true; + } + } + return false; +} + +module.exports = arrayIncludesWith; diff --git a/node_modules/lodash/_arrayLikeKeys.js b/node_modules/lodash/_arrayLikeKeys.js new file mode 100644 index 0000000..b2ec9ce --- /dev/null +++ b/node_modules/lodash/_arrayLikeKeys.js @@ -0,0 +1,49 @@ +var baseTimes = require('./_baseTimes'), + isArguments = require('./isArguments'), + isArray = require('./isArray'), + isBuffer = require('./isBuffer'), + isIndex = require('./_isIndex'), + isTypedArray = require('./isTypedArray'); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Creates an array of the enumerable property names of the array-like `value`. + * + * @private + * @param {*} value The value to query. + * @param {boolean} inherited Specify returning inherited property names. + * @returns {Array} Returns the array of property names. + */ +function arrayLikeKeys(value, inherited) { + var isArr = isArray(value), + isArg = !isArr && isArguments(value), + isBuff = !isArr && !isArg && isBuffer(value), + isType = !isArr && !isArg && !isBuff && isTypedArray(value), + skipIndexes = isArr || isArg || isBuff || isType, + result = skipIndexes ? baseTimes(value.length, String) : [], + length = result.length; + + for (var key in value) { + if ((inherited || hasOwnProperty.call(value, key)) && + !(skipIndexes && ( + // Safari 9 has enumerable `arguments.length` in strict mode. + key == 'length' || + // Node.js 0.10 has enumerable non-index properties on buffers. + (isBuff && (key == 'offset' || key == 'parent')) || + // PhantomJS 2 has enumerable non-index properties on typed arrays. + (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || + // Skip index properties. + isIndex(key, length) + ))) { + result.push(key); + } + } + return result; +} + +module.exports = arrayLikeKeys; diff --git a/node_modules/lodash/_arrayMap.js b/node_modules/lodash/_arrayMap.js new file mode 100644 index 0000000..22b2246 --- /dev/null +++ b/node_modules/lodash/_arrayMap.js @@ -0,0 +1,21 @@ +/** + * A specialized version of `_.map` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ +function arrayMap(array, iteratee) { + var index = -1, + length = array == null ? 0 : array.length, + result = Array(length); + + while (++index < length) { + result[index] = iteratee(array[index], index, array); + } + return result; +} + +module.exports = arrayMap; diff --git a/node_modules/lodash/_arrayPush.js b/node_modules/lodash/_arrayPush.js new file mode 100644 index 0000000..7d742b3 --- /dev/null +++ b/node_modules/lodash/_arrayPush.js @@ -0,0 +1,20 @@ +/** + * Appends the elements of `values` to `array`. + * + * @private + * @param {Array} array The array to modify. + * @param {Array} values The values to append. + * @returns {Array} Returns `array`. + */ +function arrayPush(array, values) { + var index = -1, + length = values.length, + offset = array.length; + + while (++index < length) { + array[offset + index] = values[index]; + } + return array; +} + +module.exports = arrayPush; diff --git a/node_modules/lodash/_arrayReduce.js b/node_modules/lodash/_arrayReduce.js new file mode 100644 index 0000000..de8b79b --- /dev/null +++ b/node_modules/lodash/_arrayReduce.js @@ -0,0 +1,26 @@ +/** + * A specialized version of `_.reduce` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @param {boolean} [initAccum] Specify using the first element of `array` as + * the initial value. + * @returns {*} Returns the accumulated value. + */ +function arrayReduce(array, iteratee, accumulator, initAccum) { + var index = -1, + length = array == null ? 0 : array.length; + + if (initAccum && length) { + accumulator = array[++index]; + } + while (++index < length) { + accumulator = iteratee(accumulator, array[index], index, array); + } + return accumulator; +} + +module.exports = arrayReduce; diff --git a/node_modules/lodash/_arrayReduceRight.js b/node_modules/lodash/_arrayReduceRight.js new file mode 100644 index 0000000..22d8976 --- /dev/null +++ b/node_modules/lodash/_arrayReduceRight.js @@ -0,0 +1,24 @@ +/** + * A specialized version of `_.reduceRight` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @param {boolean} [initAccum] Specify using the last element of `array` as + * the initial value. + * @returns {*} Returns the accumulated value. + */ +function arrayReduceRight(array, iteratee, accumulator, initAccum) { + var length = array == null ? 0 : array.length; + if (initAccum && length) { + accumulator = array[--length]; + } + while (length--) { + accumulator = iteratee(accumulator, array[length], length, array); + } + return accumulator; +} + +module.exports = arrayReduceRight; diff --git a/node_modules/lodash/_arraySample.js b/node_modules/lodash/_arraySample.js new file mode 100644 index 0000000..fcab010 --- /dev/null +++ b/node_modules/lodash/_arraySample.js @@ -0,0 +1,15 @@ +var baseRandom = require('./_baseRandom'); + +/** + * A specialized version of `_.sample` for arrays. + * + * @private + * @param {Array} array The array to sample. + * @returns {*} Returns the random element. + */ +function arraySample(array) { + var length = array.length; + return length ? array[baseRandom(0, length - 1)] : undefined; +} + +module.exports = arraySample; diff --git a/node_modules/lodash/_arraySampleSize.js b/node_modules/lodash/_arraySampleSize.js new file mode 100644 index 0000000..8c7e364 --- /dev/null +++ b/node_modules/lodash/_arraySampleSize.js @@ -0,0 +1,17 @@ +var baseClamp = require('./_baseClamp'), + copyArray = require('./_copyArray'), + shuffleSelf = require('./_shuffleSelf'); + +/** + * A specialized version of `_.sampleSize` for arrays. + * + * @private + * @param {Array} array The array to sample. + * @param {number} n The number of elements to sample. + * @returns {Array} Returns the random elements. + */ +function arraySampleSize(array, n) { + return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length)); +} + +module.exports = arraySampleSize; diff --git a/node_modules/lodash/_arrayShuffle.js b/node_modules/lodash/_arrayShuffle.js new file mode 100644 index 0000000..46313a3 --- /dev/null +++ b/node_modules/lodash/_arrayShuffle.js @@ -0,0 +1,15 @@ +var copyArray = require('./_copyArray'), + shuffleSelf = require('./_shuffleSelf'); + +/** + * A specialized version of `_.shuffle` for arrays. + * + * @private + * @param {Array} array The array to shuffle. + * @returns {Array} Returns the new shuffled array. + */ +function arrayShuffle(array) { + return shuffleSelf(copyArray(array)); +} + +module.exports = arrayShuffle; diff --git a/node_modules/lodash/_arraySome.js b/node_modules/lodash/_arraySome.js new file mode 100644 index 0000000..6fd02fd --- /dev/null +++ b/node_modules/lodash/_arraySome.js @@ -0,0 +1,23 @@ +/** + * A specialized version of `_.some` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + */ +function arraySome(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (predicate(array[index], index, array)) { + return true; + } + } + return false; +} + +module.exports = arraySome; diff --git a/node_modules/lodash/_asciiSize.js b/node_modules/lodash/_asciiSize.js new file mode 100644 index 0000000..11d29c3 --- /dev/null +++ b/node_modules/lodash/_asciiSize.js @@ -0,0 +1,12 @@ +var baseProperty = require('./_baseProperty'); + +/** + * Gets the size of an ASCII `string`. + * + * @private + * @param {string} string The string inspect. + * @returns {number} Returns the string size. + */ +var asciiSize = baseProperty('length'); + +module.exports = asciiSize; diff --git a/node_modules/lodash/_asciiToArray.js b/node_modules/lodash/_asciiToArray.js new file mode 100644 index 0000000..8e3dd5b --- /dev/null +++ b/node_modules/lodash/_asciiToArray.js @@ -0,0 +1,12 @@ +/** + * Converts an ASCII `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ +function asciiToArray(string) { + return string.split(''); +} + +module.exports = asciiToArray; diff --git a/node_modules/lodash/_asciiWords.js b/node_modules/lodash/_asciiWords.js new file mode 100644 index 0000000..d765f0f --- /dev/null +++ b/node_modules/lodash/_asciiWords.js @@ -0,0 +1,15 @@ +/** Used to match words composed of alphanumeric characters. */ +var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g; + +/** + * Splits an ASCII `string` into an array of its words. + * + * @private + * @param {string} The string to inspect. + * @returns {Array} Returns the words of `string`. + */ +function asciiWords(string) { + return string.match(reAsciiWord) || []; +} + +module.exports = asciiWords; diff --git a/node_modules/lodash/_assignMergeValue.js b/node_modules/lodash/_assignMergeValue.js new file mode 100644 index 0000000..cb1185e --- /dev/null +++ b/node_modules/lodash/_assignMergeValue.js @@ -0,0 +1,20 @@ +var baseAssignValue = require('./_baseAssignValue'), + eq = require('./eq'); + +/** + * This function is like `assignValue` except that it doesn't assign + * `undefined` values. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ +function assignMergeValue(object, key, value) { + if ((value !== undefined && !eq(object[key], value)) || + (value === undefined && !(key in object))) { + baseAssignValue(object, key, value); + } +} + +module.exports = assignMergeValue; diff --git a/node_modules/lodash/_assignValue.js b/node_modules/lodash/_assignValue.js new file mode 100644 index 0000000..4083957 --- /dev/null +++ b/node_modules/lodash/_assignValue.js @@ -0,0 +1,28 @@ +var baseAssignValue = require('./_baseAssignValue'), + eq = require('./eq'); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Assigns `value` to `key` of `object` if the existing value is not equivalent + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ +function assignValue(object, key, value) { + var objValue = object[key]; + if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || + (value === undefined && !(key in object))) { + baseAssignValue(object, key, value); + } +} + +module.exports = assignValue; diff --git a/node_modules/lodash/_assocIndexOf.js b/node_modules/lodash/_assocIndexOf.js new file mode 100644 index 0000000..5b77a2b --- /dev/null +++ b/node_modules/lodash/_assocIndexOf.js @@ -0,0 +1,21 @@ +var eq = require('./eq'); + +/** + * Gets the index at which the `key` is found in `array` of key-value pairs. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} key The key to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function assocIndexOf(array, key) { + var length = array.length; + while (length--) { + if (eq(array[length][0], key)) { + return length; + } + } + return -1; +} + +module.exports = assocIndexOf; diff --git a/node_modules/lodash/_baseAggregator.js b/node_modules/lodash/_baseAggregator.js new file mode 100644 index 0000000..4bc9e91 --- /dev/null +++ b/node_modules/lodash/_baseAggregator.js @@ -0,0 +1,21 @@ +var baseEach = require('./_baseEach'); + +/** + * Aggregates elements of `collection` on `accumulator` with keys transformed + * by `iteratee` and values set by `setter`. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} setter The function to set `accumulator` values. + * @param {Function} iteratee The iteratee to transform keys. + * @param {Object} accumulator The initial aggregated object. + * @returns {Function} Returns `accumulator`. + */ +function baseAggregator(collection, setter, iteratee, accumulator) { + baseEach(collection, function(value, key, collection) { + setter(accumulator, value, iteratee(value), collection); + }); + return accumulator; +} + +module.exports = baseAggregator; diff --git a/node_modules/lodash/_baseAssign.js b/node_modules/lodash/_baseAssign.js new file mode 100644 index 0000000..e5c4a1a --- /dev/null +++ b/node_modules/lodash/_baseAssign.js @@ -0,0 +1,17 @@ +var copyObject = require('./_copyObject'), + keys = require('./keys'); + +/** + * The base implementation of `_.assign` without support for multiple sources + * or `customizer` functions. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @returns {Object} Returns `object`. + */ +function baseAssign(object, source) { + return object && copyObject(source, keys(source), object); +} + +module.exports = baseAssign; diff --git a/node_modules/lodash/_baseAssignIn.js b/node_modules/lodash/_baseAssignIn.js new file mode 100644 index 0000000..6624f90 --- /dev/null +++ b/node_modules/lodash/_baseAssignIn.js @@ -0,0 +1,17 @@ +var copyObject = require('./_copyObject'), + keysIn = require('./keysIn'); + +/** + * The base implementation of `_.assignIn` without support for multiple sources + * or `customizer` functions. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @returns {Object} Returns `object`. + */ +function baseAssignIn(object, source) { + return object && copyObject(source, keysIn(source), object); +} + +module.exports = baseAssignIn; diff --git a/node_modules/lodash/_baseAssignValue.js b/node_modules/lodash/_baseAssignValue.js new file mode 100644 index 0000000..d6f66ef --- /dev/null +++ b/node_modules/lodash/_baseAssignValue.js @@ -0,0 +1,25 @@ +var defineProperty = require('./_defineProperty'); + +/** + * The base implementation of `assignValue` and `assignMergeValue` without + * value checks. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ +function baseAssignValue(object, key, value) { + if (key == '__proto__' && defineProperty) { + defineProperty(object, key, { + 'configurable': true, + 'enumerable': true, + 'value': value, + 'writable': true + }); + } else { + object[key] = value; + } +} + +module.exports = baseAssignValue; diff --git a/node_modules/lodash/_baseAt.js b/node_modules/lodash/_baseAt.js new file mode 100644 index 0000000..90e4237 --- /dev/null +++ b/node_modules/lodash/_baseAt.js @@ -0,0 +1,23 @@ +var get = require('./get'); + +/** + * The base implementation of `_.at` without support for individual paths. + * + * @private + * @param {Object} object The object to iterate over. + * @param {string[]} paths The property paths to pick. + * @returns {Array} Returns the picked elements. + */ +function baseAt(object, paths) { + var index = -1, + length = paths.length, + result = Array(length), + skip = object == null; + + while (++index < length) { + result[index] = skip ? undefined : get(object, paths[index]); + } + return result; +} + +module.exports = baseAt; diff --git a/node_modules/lodash/_baseClamp.js b/node_modules/lodash/_baseClamp.js new file mode 100644 index 0000000..a1c5692 --- /dev/null +++ b/node_modules/lodash/_baseClamp.js @@ -0,0 +1,22 @@ +/** + * The base implementation of `_.clamp` which doesn't coerce arguments. + * + * @private + * @param {number} number The number to clamp. + * @param {number} [lower] The lower bound. + * @param {number} upper The upper bound. + * @returns {number} Returns the clamped number. + */ +function baseClamp(number, lower, upper) { + if (number === number) { + if (upper !== undefined) { + number = number <= upper ? number : upper; + } + if (lower !== undefined) { + number = number >= lower ? number : lower; + } + } + return number; +} + +module.exports = baseClamp; diff --git a/node_modules/lodash/_baseClone.js b/node_modules/lodash/_baseClone.js new file mode 100644 index 0000000..69f8705 --- /dev/null +++ b/node_modules/lodash/_baseClone.js @@ -0,0 +1,166 @@ +var Stack = require('./_Stack'), + arrayEach = require('./_arrayEach'), + assignValue = require('./_assignValue'), + baseAssign = require('./_baseAssign'), + baseAssignIn = require('./_baseAssignIn'), + cloneBuffer = require('./_cloneBuffer'), + copyArray = require('./_copyArray'), + copySymbols = require('./_copySymbols'), + copySymbolsIn = require('./_copySymbolsIn'), + getAllKeys = require('./_getAllKeys'), + getAllKeysIn = require('./_getAllKeysIn'), + getTag = require('./_getTag'), + initCloneArray = require('./_initCloneArray'), + initCloneByTag = require('./_initCloneByTag'), + initCloneObject = require('./_initCloneObject'), + isArray = require('./isArray'), + isBuffer = require('./isBuffer'), + isMap = require('./isMap'), + isObject = require('./isObject'), + isSet = require('./isSet'), + keys = require('./keys'), + keysIn = require('./keysIn'); + +/** Used to compose bitmasks for cloning. */ +var CLONE_DEEP_FLAG = 1, + CLONE_FLAT_FLAG = 2, + CLONE_SYMBOLS_FLAG = 4; + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + mapTag = '[object Map]', + numberTag = '[object Number]', + objectTag = '[object Object]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + symbolTag = '[object Symbol]', + weakMapTag = '[object WeakMap]'; + +var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; + +/** Used to identify `toStringTag` values supported by `_.clone`. */ +var cloneableTags = {}; +cloneableTags[argsTag] = cloneableTags[arrayTag] = +cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = +cloneableTags[boolTag] = cloneableTags[dateTag] = +cloneableTags[float32Tag] = cloneableTags[float64Tag] = +cloneableTags[int8Tag] = cloneableTags[int16Tag] = +cloneableTags[int32Tag] = cloneableTags[mapTag] = +cloneableTags[numberTag] = cloneableTags[objectTag] = +cloneableTags[regexpTag] = cloneableTags[setTag] = +cloneableTags[stringTag] = cloneableTags[symbolTag] = +cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = +cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; +cloneableTags[errorTag] = cloneableTags[funcTag] = +cloneableTags[weakMapTag] = false; + +/** + * The base implementation of `_.clone` and `_.cloneDeep` which tracks + * traversed objects. + * + * @private + * @param {*} value The value to clone. + * @param {boolean} bitmask The bitmask flags. + * 1 - Deep clone + * 2 - Flatten inherited properties + * 4 - Clone symbols + * @param {Function} [customizer] The function to customize cloning. + * @param {string} [key] The key of `value`. + * @param {Object} [object] The parent object of `value`. + * @param {Object} [stack] Tracks traversed objects and their clone counterparts. + * @returns {*} Returns the cloned value. + */ +function baseClone(value, bitmask, customizer, key, object, stack) { + var result, + isDeep = bitmask & CLONE_DEEP_FLAG, + isFlat = bitmask & CLONE_FLAT_FLAG, + isFull = bitmask & CLONE_SYMBOLS_FLAG; + + if (customizer) { + result = object ? customizer(value, key, object, stack) : customizer(value); + } + if (result !== undefined) { + return result; + } + if (!isObject(value)) { + return value; + } + var isArr = isArray(value); + if (isArr) { + result = initCloneArray(value); + if (!isDeep) { + return copyArray(value, result); + } + } else { + var tag = getTag(value), + isFunc = tag == funcTag || tag == genTag; + + if (isBuffer(value)) { + return cloneBuffer(value, isDeep); + } + if (tag == objectTag || tag == argsTag || (isFunc && !object)) { + result = (isFlat || isFunc) ? {} : initCloneObject(value); + if (!isDeep) { + return isFlat + ? copySymbolsIn(value, baseAssignIn(result, value)) + : copySymbols(value, baseAssign(result, value)); + } + } else { + if (!cloneableTags[tag]) { + return object ? value : {}; + } + result = initCloneByTag(value, tag, isDeep); + } + } + // Check for circular references and return its corresponding clone. + stack || (stack = new Stack); + var stacked = stack.get(value); + if (stacked) { + return stacked; + } + stack.set(value, result); + + if (isSet(value)) { + value.forEach(function(subValue) { + result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack)); + }); + } else if (isMap(value)) { + value.forEach(function(subValue, key) { + result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack)); + }); + } + + var keysFunc = isFull + ? (isFlat ? getAllKeysIn : getAllKeys) + : (isFlat ? keysIn : keys); + + var props = isArr ? undefined : keysFunc(value); + arrayEach(props || value, function(subValue, key) { + if (props) { + key = subValue; + subValue = value[key]; + } + // Recursively populate clone (susceptible to call stack limits). + assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack)); + }); + return result; +} + +module.exports = baseClone; diff --git a/node_modules/lodash/_baseConforms.js b/node_modules/lodash/_baseConforms.js new file mode 100644 index 0000000..947e20d --- /dev/null +++ b/node_modules/lodash/_baseConforms.js @@ -0,0 +1,18 @@ +var baseConformsTo = require('./_baseConformsTo'), + keys = require('./keys'); + +/** + * The base implementation of `_.conforms` which doesn't clone `source`. + * + * @private + * @param {Object} source The object of property predicates to conform to. + * @returns {Function} Returns the new spec function. + */ +function baseConforms(source) { + var props = keys(source); + return function(object) { + return baseConformsTo(object, source, props); + }; +} + +module.exports = baseConforms; diff --git a/node_modules/lodash/_baseConformsTo.js b/node_modules/lodash/_baseConformsTo.js new file mode 100644 index 0000000..e449cb8 --- /dev/null +++ b/node_modules/lodash/_baseConformsTo.js @@ -0,0 +1,27 @@ +/** + * The base implementation of `_.conformsTo` which accepts `props` to check. + * + * @private + * @param {Object} object The object to inspect. + * @param {Object} source The object of property predicates to conform to. + * @returns {boolean} Returns `true` if `object` conforms, else `false`. + */ +function baseConformsTo(object, source, props) { + var length = props.length; + if (object == null) { + return !length; + } + object = Object(object); + while (length--) { + var key = props[length], + predicate = source[key], + value = object[key]; + + if ((value === undefined && !(key in object)) || !predicate(value)) { + return false; + } + } + return true; +} + +module.exports = baseConformsTo; diff --git a/node_modules/lodash/_baseCreate.js b/node_modules/lodash/_baseCreate.js new file mode 100644 index 0000000..ffa6a52 --- /dev/null +++ b/node_modules/lodash/_baseCreate.js @@ -0,0 +1,30 @@ +var isObject = require('./isObject'); + +/** Built-in value references. */ +var objectCreate = Object.create; + +/** + * The base implementation of `_.create` without support for assigning + * properties to the created object. + * + * @private + * @param {Object} proto The object to inherit from. + * @returns {Object} Returns the new object. + */ +var baseCreate = (function() { + function object() {} + return function(proto) { + if (!isObject(proto)) { + return {}; + } + if (objectCreate) { + return objectCreate(proto); + } + object.prototype = proto; + var result = new object; + object.prototype = undefined; + return result; + }; +}()); + +module.exports = baseCreate; diff --git a/node_modules/lodash/_baseDelay.js b/node_modules/lodash/_baseDelay.js new file mode 100644 index 0000000..1486d69 --- /dev/null +++ b/node_modules/lodash/_baseDelay.js @@ -0,0 +1,21 @@ +/** Error message constants. */ +var FUNC_ERROR_TEXT = 'Expected a function'; + +/** + * The base implementation of `_.delay` and `_.defer` which accepts `args` + * to provide to `func`. + * + * @private + * @param {Function} func The function to delay. + * @param {number} wait The number of milliseconds to delay invocation. + * @param {Array} args The arguments to provide to `func`. + * @returns {number|Object} Returns the timer id or timeout object. + */ +function baseDelay(func, wait, args) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + return setTimeout(function() { func.apply(undefined, args); }, wait); +} + +module.exports = baseDelay; diff --git a/node_modules/lodash/_baseDifference.js b/node_modules/lodash/_baseDifference.js new file mode 100644 index 0000000..343ac19 --- /dev/null +++ b/node_modules/lodash/_baseDifference.js @@ -0,0 +1,67 @@ +var SetCache = require('./_SetCache'), + arrayIncludes = require('./_arrayIncludes'), + arrayIncludesWith = require('./_arrayIncludesWith'), + arrayMap = require('./_arrayMap'), + baseUnary = require('./_baseUnary'), + cacheHas = require('./_cacheHas'); + +/** Used as the size to enable large array optimizations. */ +var LARGE_ARRAY_SIZE = 200; + +/** + * The base implementation of methods like `_.difference` without support + * for excluding multiple arrays or iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Array} values The values to exclude. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of filtered values. + */ +function baseDifference(array, values, iteratee, comparator) { + var index = -1, + includes = arrayIncludes, + isCommon = true, + length = array.length, + result = [], + valuesLength = values.length; + + if (!length) { + return result; + } + if (iteratee) { + values = arrayMap(values, baseUnary(iteratee)); + } + if (comparator) { + includes = arrayIncludesWith; + isCommon = false; + } + else if (values.length >= LARGE_ARRAY_SIZE) { + includes = cacheHas; + isCommon = false; + values = new SetCache(values); + } + outer: + while (++index < length) { + var value = array[index], + computed = iteratee == null ? value : iteratee(value); + + value = (comparator || value !== 0) ? value : 0; + if (isCommon && computed === computed) { + var valuesIndex = valuesLength; + while (valuesIndex--) { + if (values[valuesIndex] === computed) { + continue outer; + } + } + result.push(value); + } + else if (!includes(values, computed, comparator)) { + result.push(value); + } + } + return result; +} + +module.exports = baseDifference; diff --git a/node_modules/lodash/_baseEach.js b/node_modules/lodash/_baseEach.js new file mode 100644 index 0000000..512c067 --- /dev/null +++ b/node_modules/lodash/_baseEach.js @@ -0,0 +1,14 @@ +var baseForOwn = require('./_baseForOwn'), + createBaseEach = require('./_createBaseEach'); + +/** + * The base implementation of `_.forEach` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + */ +var baseEach = createBaseEach(baseForOwn); + +module.exports = baseEach; diff --git a/node_modules/lodash/_baseEachRight.js b/node_modules/lodash/_baseEachRight.js new file mode 100644 index 0000000..0a8feec --- /dev/null +++ b/node_modules/lodash/_baseEachRight.js @@ -0,0 +1,14 @@ +var baseForOwnRight = require('./_baseForOwnRight'), + createBaseEach = require('./_createBaseEach'); + +/** + * The base implementation of `_.forEachRight` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + */ +var baseEachRight = createBaseEach(baseForOwnRight, true); + +module.exports = baseEachRight; diff --git a/node_modules/lodash/_baseEvery.js b/node_modules/lodash/_baseEvery.js new file mode 100644 index 0000000..fa52f7b --- /dev/null +++ b/node_modules/lodash/_baseEvery.js @@ -0,0 +1,21 @@ +var baseEach = require('./_baseEach'); + +/** + * The base implementation of `_.every` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false` + */ +function baseEvery(collection, predicate) { + var result = true; + baseEach(collection, function(value, index, collection) { + result = !!predicate(value, index, collection); + return result; + }); + return result; +} + +module.exports = baseEvery; diff --git a/node_modules/lodash/_baseExtremum.js b/node_modules/lodash/_baseExtremum.js new file mode 100644 index 0000000..9d6aa77 --- /dev/null +++ b/node_modules/lodash/_baseExtremum.js @@ -0,0 +1,32 @@ +var isSymbol = require('./isSymbol'); + +/** + * The base implementation of methods like `_.max` and `_.min` which accepts a + * `comparator` to determine the extremum value. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The iteratee invoked per iteration. + * @param {Function} comparator The comparator used to compare values. + * @returns {*} Returns the extremum value. + */ +function baseExtremum(array, iteratee, comparator) { + var index = -1, + length = array.length; + + while (++index < length) { + var value = array[index], + current = iteratee(value); + + if (current != null && (computed === undefined + ? (current === current && !isSymbol(current)) + : comparator(current, computed) + )) { + var computed = current, + result = value; + } + } + return result; +} + +module.exports = baseExtremum; diff --git a/node_modules/lodash/_baseFill.js b/node_modules/lodash/_baseFill.js new file mode 100644 index 0000000..46ef9c7 --- /dev/null +++ b/node_modules/lodash/_baseFill.js @@ -0,0 +1,32 @@ +var toInteger = require('./toInteger'), + toLength = require('./toLength'); + +/** + * The base implementation of `_.fill` without an iteratee call guard. + * + * @private + * @param {Array} array The array to fill. + * @param {*} value The value to fill `array` with. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns `array`. + */ +function baseFill(array, value, start, end) { + var length = array.length; + + start = toInteger(start); + if (start < 0) { + start = -start > length ? 0 : (length + start); + } + end = (end === undefined || end > length) ? length : toInteger(end); + if (end < 0) { + end += length; + } + end = start > end ? 0 : toLength(end); + while (start < end) { + array[start++] = value; + } + return array; +} + +module.exports = baseFill; diff --git a/node_modules/lodash/_baseFilter.js b/node_modules/lodash/_baseFilter.js new file mode 100644 index 0000000..4678477 --- /dev/null +++ b/node_modules/lodash/_baseFilter.js @@ -0,0 +1,21 @@ +var baseEach = require('./_baseEach'); + +/** + * The base implementation of `_.filter` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + */ +function baseFilter(collection, predicate) { + var result = []; + baseEach(collection, function(value, index, collection) { + if (predicate(value, index, collection)) { + result.push(value); + } + }); + return result; +} + +module.exports = baseFilter; diff --git a/node_modules/lodash/_baseFindIndex.js b/node_modules/lodash/_baseFindIndex.js new file mode 100644 index 0000000..e3f5d8a --- /dev/null +++ b/node_modules/lodash/_baseFindIndex.js @@ -0,0 +1,24 @@ +/** + * The base implementation of `_.findIndex` and `_.findLastIndex` without + * support for iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} predicate The function invoked per iteration. + * @param {number} fromIndex The index to search from. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function baseFindIndex(array, predicate, fromIndex, fromRight) { + var length = array.length, + index = fromIndex + (fromRight ? 1 : -1); + + while ((fromRight ? index-- : ++index < length)) { + if (predicate(array[index], index, array)) { + return index; + } + } + return -1; +} + +module.exports = baseFindIndex; diff --git a/node_modules/lodash/_baseFindKey.js b/node_modules/lodash/_baseFindKey.js new file mode 100644 index 0000000..2e430f3 --- /dev/null +++ b/node_modules/lodash/_baseFindKey.js @@ -0,0 +1,23 @@ +/** + * The base implementation of methods like `_.findKey` and `_.findLastKey`, + * without support for iteratee shorthands, which iterates over `collection` + * using `eachFunc`. + * + * @private + * @param {Array|Object} collection The collection to inspect. + * @param {Function} predicate The function invoked per iteration. + * @param {Function} eachFunc The function to iterate over `collection`. + * @returns {*} Returns the found element or its key, else `undefined`. + */ +function baseFindKey(collection, predicate, eachFunc) { + var result; + eachFunc(collection, function(value, key, collection) { + if (predicate(value, key, collection)) { + result = key; + return false; + } + }); + return result; +} + +module.exports = baseFindKey; diff --git a/node_modules/lodash/_baseFlatten.js b/node_modules/lodash/_baseFlatten.js new file mode 100644 index 0000000..4b1e009 --- /dev/null +++ b/node_modules/lodash/_baseFlatten.js @@ -0,0 +1,38 @@ +var arrayPush = require('./_arrayPush'), + isFlattenable = require('./_isFlattenable'); + +/** + * The base implementation of `_.flatten` with support for restricting flattening. + * + * @private + * @param {Array} array The array to flatten. + * @param {number} depth The maximum recursion depth. + * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. + * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. + * @param {Array} [result=[]] The initial result value. + * @returns {Array} Returns the new flattened array. + */ +function baseFlatten(array, depth, predicate, isStrict, result) { + var index = -1, + length = array.length; + + predicate || (predicate = isFlattenable); + result || (result = []); + + while (++index < length) { + var value = array[index]; + if (depth > 0 && predicate(value)) { + if (depth > 1) { + // Recursively flatten arrays (susceptible to call stack limits). + baseFlatten(value, depth - 1, predicate, isStrict, result); + } else { + arrayPush(result, value); + } + } else if (!isStrict) { + result[result.length] = value; + } + } + return result; +} + +module.exports = baseFlatten; diff --git a/node_modules/lodash/_baseFor.js b/node_modules/lodash/_baseFor.js new file mode 100644 index 0000000..d946590 --- /dev/null +++ b/node_modules/lodash/_baseFor.js @@ -0,0 +1,16 @@ +var createBaseFor = require('./_createBaseFor'); + +/** + * The base implementation of `baseForOwn` which iterates over `object` + * properties returned by `keysFunc` and invokes `iteratee` for each property. + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {Function} keysFunc The function to get the keys of `object`. + * @returns {Object} Returns `object`. + */ +var baseFor = createBaseFor(); + +module.exports = baseFor; diff --git a/node_modules/lodash/_baseForOwn.js b/node_modules/lodash/_baseForOwn.js new file mode 100644 index 0000000..503d523 --- /dev/null +++ b/node_modules/lodash/_baseForOwn.js @@ -0,0 +1,16 @@ +var baseFor = require('./_baseFor'), + keys = require('./keys'); + +/** + * The base implementation of `_.forOwn` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Object} Returns `object`. + */ +function baseForOwn(object, iteratee) { + return object && baseFor(object, iteratee, keys); +} + +module.exports = baseForOwn; diff --git a/node_modules/lodash/_baseForOwnRight.js b/node_modules/lodash/_baseForOwnRight.js new file mode 100644 index 0000000..a4b10e6 --- /dev/null +++ b/node_modules/lodash/_baseForOwnRight.js @@ -0,0 +1,16 @@ +var baseForRight = require('./_baseForRight'), + keys = require('./keys'); + +/** + * The base implementation of `_.forOwnRight` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Object} Returns `object`. + */ +function baseForOwnRight(object, iteratee) { + return object && baseForRight(object, iteratee, keys); +} + +module.exports = baseForOwnRight; diff --git a/node_modules/lodash/_baseForRight.js b/node_modules/lodash/_baseForRight.js new file mode 100644 index 0000000..32842cd --- /dev/null +++ b/node_modules/lodash/_baseForRight.js @@ -0,0 +1,15 @@ +var createBaseFor = require('./_createBaseFor'); + +/** + * This function is like `baseFor` except that it iterates over properties + * in the opposite order. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {Function} keysFunc The function to get the keys of `object`. + * @returns {Object} Returns `object`. + */ +var baseForRight = createBaseFor(true); + +module.exports = baseForRight; diff --git a/node_modules/lodash/_baseFunctions.js b/node_modules/lodash/_baseFunctions.js new file mode 100644 index 0000000..d23bc9b --- /dev/null +++ b/node_modules/lodash/_baseFunctions.js @@ -0,0 +1,19 @@ +var arrayFilter = require('./_arrayFilter'), + isFunction = require('./isFunction'); + +/** + * The base implementation of `_.functions` which creates an array of + * `object` function property names filtered from `props`. + * + * @private + * @param {Object} object The object to inspect. + * @param {Array} props The property names to filter. + * @returns {Array} Returns the function names. + */ +function baseFunctions(object, props) { + return arrayFilter(props, function(key) { + return isFunction(object[key]); + }); +} + +module.exports = baseFunctions; diff --git a/node_modules/lodash/_baseGet.js b/node_modules/lodash/_baseGet.js new file mode 100644 index 0000000..a194913 --- /dev/null +++ b/node_modules/lodash/_baseGet.js @@ -0,0 +1,24 @@ +var castPath = require('./_castPath'), + toKey = require('./_toKey'); + +/** + * The base implementation of `_.get` without support for default values. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @returns {*} Returns the resolved value. + */ +function baseGet(object, path) { + path = castPath(path, object); + + var index = 0, + length = path.length; + + while (object != null && index < length) { + object = object[toKey(path[index++])]; + } + return (index && index == length) ? object : undefined; +} + +module.exports = baseGet; diff --git a/node_modules/lodash/_baseGetAllKeys.js b/node_modules/lodash/_baseGetAllKeys.js new file mode 100644 index 0000000..8ad204e --- /dev/null +++ b/node_modules/lodash/_baseGetAllKeys.js @@ -0,0 +1,20 @@ +var arrayPush = require('./_arrayPush'), + isArray = require('./isArray'); + +/** + * The base implementation of `getAllKeys` and `getAllKeysIn` which uses + * `keysFunc` and `symbolsFunc` to get the enumerable property names and + * symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Function} keysFunc The function to get the keys of `object`. + * @param {Function} symbolsFunc The function to get the symbols of `object`. + * @returns {Array} Returns the array of property names and symbols. + */ +function baseGetAllKeys(object, keysFunc, symbolsFunc) { + var result = keysFunc(object); + return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); +} + +module.exports = baseGetAllKeys; diff --git a/node_modules/lodash/_baseGetTag.js b/node_modules/lodash/_baseGetTag.js new file mode 100644 index 0000000..b927ccc --- /dev/null +++ b/node_modules/lodash/_baseGetTag.js @@ -0,0 +1,28 @@ +var Symbol = require('./_Symbol'), + getRawTag = require('./_getRawTag'), + objectToString = require('./_objectToString'); + +/** `Object#toString` result references. */ +var nullTag = '[object Null]', + undefinedTag = '[object Undefined]'; + +/** Built-in value references. */ +var symToStringTag = Symbol ? Symbol.toStringTag : undefined; + +/** + * The base implementation of `getTag` without fallbacks for buggy environments. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +function baseGetTag(value) { + if (value == null) { + return value === undefined ? undefinedTag : nullTag; + } + return (symToStringTag && symToStringTag in Object(value)) + ? getRawTag(value) + : objectToString(value); +} + +module.exports = baseGetTag; diff --git a/node_modules/lodash/_baseGt.js b/node_modules/lodash/_baseGt.js new file mode 100644 index 0000000..502d273 --- /dev/null +++ b/node_modules/lodash/_baseGt.js @@ -0,0 +1,14 @@ +/** + * The base implementation of `_.gt` which doesn't coerce arguments. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is greater than `other`, + * else `false`. + */ +function baseGt(value, other) { + return value > other; +} + +module.exports = baseGt; diff --git a/node_modules/lodash/_baseHas.js b/node_modules/lodash/_baseHas.js new file mode 100644 index 0000000..1b73032 --- /dev/null +++ b/node_modules/lodash/_baseHas.js @@ -0,0 +1,19 @@ +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * The base implementation of `_.has` without support for deep paths. + * + * @private + * @param {Object} [object] The object to query. + * @param {Array|string} key The key to check. + * @returns {boolean} Returns `true` if `key` exists, else `false`. + */ +function baseHas(object, key) { + return object != null && hasOwnProperty.call(object, key); +} + +module.exports = baseHas; diff --git a/node_modules/lodash/_baseHasIn.js b/node_modules/lodash/_baseHasIn.js new file mode 100644 index 0000000..2e0d042 --- /dev/null +++ b/node_modules/lodash/_baseHasIn.js @@ -0,0 +1,13 @@ +/** + * The base implementation of `_.hasIn` without support for deep paths. + * + * @private + * @param {Object} [object] The object to query. + * @param {Array|string} key The key to check. + * @returns {boolean} Returns `true` if `key` exists, else `false`. + */ +function baseHasIn(object, key) { + return object != null && key in Object(object); +} + +module.exports = baseHasIn; diff --git a/node_modules/lodash/_baseInRange.js b/node_modules/lodash/_baseInRange.js new file mode 100644 index 0000000..ec95666 --- /dev/null +++ b/node_modules/lodash/_baseInRange.js @@ -0,0 +1,18 @@ +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max, + nativeMin = Math.min; + +/** + * The base implementation of `_.inRange` which doesn't coerce arguments. + * + * @private + * @param {number} number The number to check. + * @param {number} start The start of the range. + * @param {number} end The end of the range. + * @returns {boolean} Returns `true` if `number` is in the range, else `false`. + */ +function baseInRange(number, start, end) { + return number >= nativeMin(start, end) && number < nativeMax(start, end); +} + +module.exports = baseInRange; diff --git a/node_modules/lodash/_baseIndexOf.js b/node_modules/lodash/_baseIndexOf.js new file mode 100644 index 0000000..167e706 --- /dev/null +++ b/node_modules/lodash/_baseIndexOf.js @@ -0,0 +1,20 @@ +var baseFindIndex = require('./_baseFindIndex'), + baseIsNaN = require('./_baseIsNaN'), + strictIndexOf = require('./_strictIndexOf'); + +/** + * The base implementation of `_.indexOf` without `fromIndex` bounds checks. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function baseIndexOf(array, value, fromIndex) { + return value === value + ? strictIndexOf(array, value, fromIndex) + : baseFindIndex(array, baseIsNaN, fromIndex); +} + +module.exports = baseIndexOf; diff --git a/node_modules/lodash/_baseIndexOfWith.js b/node_modules/lodash/_baseIndexOfWith.js new file mode 100644 index 0000000..f815fe0 --- /dev/null +++ b/node_modules/lodash/_baseIndexOfWith.js @@ -0,0 +1,23 @@ +/** + * This function is like `baseIndexOf` except that it accepts a comparator. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @param {Function} comparator The comparator invoked per element. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function baseIndexOfWith(array, value, fromIndex, comparator) { + var index = fromIndex - 1, + length = array.length; + + while (++index < length) { + if (comparator(array[index], value)) { + return index; + } + } + return -1; +} + +module.exports = baseIndexOfWith; diff --git a/node_modules/lodash/_baseIntersection.js b/node_modules/lodash/_baseIntersection.js new file mode 100644 index 0000000..c1d250c --- /dev/null +++ b/node_modules/lodash/_baseIntersection.js @@ -0,0 +1,74 @@ +var SetCache = require('./_SetCache'), + arrayIncludes = require('./_arrayIncludes'), + arrayIncludesWith = require('./_arrayIncludesWith'), + arrayMap = require('./_arrayMap'), + baseUnary = require('./_baseUnary'), + cacheHas = require('./_cacheHas'); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMin = Math.min; + +/** + * The base implementation of methods like `_.intersection`, without support + * for iteratee shorthands, that accepts an array of arrays to inspect. + * + * @private + * @param {Array} arrays The arrays to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of shared values. + */ +function baseIntersection(arrays, iteratee, comparator) { + var includes = comparator ? arrayIncludesWith : arrayIncludes, + length = arrays[0].length, + othLength = arrays.length, + othIndex = othLength, + caches = Array(othLength), + maxLength = Infinity, + result = []; + + while (othIndex--) { + var array = arrays[othIndex]; + if (othIndex && iteratee) { + array = arrayMap(array, baseUnary(iteratee)); + } + maxLength = nativeMin(array.length, maxLength); + caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120)) + ? new SetCache(othIndex && array) + : undefined; + } + array = arrays[0]; + + var index = -1, + seen = caches[0]; + + outer: + while (++index < length && result.length < maxLength) { + var value = array[index], + computed = iteratee ? iteratee(value) : value; + + value = (comparator || value !== 0) ? value : 0; + if (!(seen + ? cacheHas(seen, computed) + : includes(result, computed, comparator) + )) { + othIndex = othLength; + while (--othIndex) { + var cache = caches[othIndex]; + if (!(cache + ? cacheHas(cache, computed) + : includes(arrays[othIndex], computed, comparator)) + ) { + continue outer; + } + } + if (seen) { + seen.push(computed); + } + result.push(value); + } + } + return result; +} + +module.exports = baseIntersection; diff --git a/node_modules/lodash/_baseInverter.js b/node_modules/lodash/_baseInverter.js new file mode 100644 index 0000000..fbc337f --- /dev/null +++ b/node_modules/lodash/_baseInverter.js @@ -0,0 +1,21 @@ +var baseForOwn = require('./_baseForOwn'); + +/** + * The base implementation of `_.invert` and `_.invertBy` which inverts + * `object` with values transformed by `iteratee` and set by `setter`. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} setter The function to set `accumulator` values. + * @param {Function} iteratee The iteratee to transform values. + * @param {Object} accumulator The initial inverted object. + * @returns {Function} Returns `accumulator`. + */ +function baseInverter(object, setter, iteratee, accumulator) { + baseForOwn(object, function(value, key, object) { + setter(accumulator, iteratee(value), key, object); + }); + return accumulator; +} + +module.exports = baseInverter; diff --git a/node_modules/lodash/_baseInvoke.js b/node_modules/lodash/_baseInvoke.js new file mode 100644 index 0000000..49bcf3c --- /dev/null +++ b/node_modules/lodash/_baseInvoke.js @@ -0,0 +1,24 @@ +var apply = require('./_apply'), + castPath = require('./_castPath'), + last = require('./last'), + parent = require('./_parent'), + toKey = require('./_toKey'); + +/** + * The base implementation of `_.invoke` without support for individual + * method arguments. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path of the method to invoke. + * @param {Array} args The arguments to invoke the method with. + * @returns {*} Returns the result of the invoked method. + */ +function baseInvoke(object, path, args) { + path = castPath(path, object); + object = parent(object, path); + var func = object == null ? object : object[toKey(last(path))]; + return func == null ? undefined : apply(func, object, args); +} + +module.exports = baseInvoke; diff --git a/node_modules/lodash/_baseIsArguments.js b/node_modules/lodash/_baseIsArguments.js new file mode 100644 index 0000000..b3562cc --- /dev/null +++ b/node_modules/lodash/_baseIsArguments.js @@ -0,0 +1,18 @@ +var baseGetTag = require('./_baseGetTag'), + isObjectLike = require('./isObjectLike'); + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]'; + +/** + * The base implementation of `_.isArguments`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + */ +function baseIsArguments(value) { + return isObjectLike(value) && baseGetTag(value) == argsTag; +} + +module.exports = baseIsArguments; diff --git a/node_modules/lodash/_baseIsArrayBuffer.js b/node_modules/lodash/_baseIsArrayBuffer.js new file mode 100644 index 0000000..a2c4f30 --- /dev/null +++ b/node_modules/lodash/_baseIsArrayBuffer.js @@ -0,0 +1,17 @@ +var baseGetTag = require('./_baseGetTag'), + isObjectLike = require('./isObjectLike'); + +var arrayBufferTag = '[object ArrayBuffer]'; + +/** + * The base implementation of `_.isArrayBuffer` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`. + */ +function baseIsArrayBuffer(value) { + return isObjectLike(value) && baseGetTag(value) == arrayBufferTag; +} + +module.exports = baseIsArrayBuffer; diff --git a/node_modules/lodash/_baseIsDate.js b/node_modules/lodash/_baseIsDate.js new file mode 100644 index 0000000..ba67c78 --- /dev/null +++ b/node_modules/lodash/_baseIsDate.js @@ -0,0 +1,18 @@ +var baseGetTag = require('./_baseGetTag'), + isObjectLike = require('./isObjectLike'); + +/** `Object#toString` result references. */ +var dateTag = '[object Date]'; + +/** + * The base implementation of `_.isDate` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a date object, else `false`. + */ +function baseIsDate(value) { + return isObjectLike(value) && baseGetTag(value) == dateTag; +} + +module.exports = baseIsDate; diff --git a/node_modules/lodash/_baseIsEqual.js b/node_modules/lodash/_baseIsEqual.js new file mode 100644 index 0000000..00a68a4 --- /dev/null +++ b/node_modules/lodash/_baseIsEqual.js @@ -0,0 +1,28 @@ +var baseIsEqualDeep = require('./_baseIsEqualDeep'), + isObjectLike = require('./isObjectLike'); + +/** + * The base implementation of `_.isEqual` which supports partial comparisons + * and tracks traversed objects. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @param {boolean} bitmask The bitmask flags. + * 1 - Unordered comparison + * 2 - Partial comparison + * @param {Function} [customizer] The function to customize comparisons. + * @param {Object} [stack] Tracks traversed `value` and `other` objects. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + */ +function baseIsEqual(value, other, bitmask, customizer, stack) { + if (value === other) { + return true; + } + if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) { + return value !== value && other !== other; + } + return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack); +} + +module.exports = baseIsEqual; diff --git a/node_modules/lodash/_baseIsEqualDeep.js b/node_modules/lodash/_baseIsEqualDeep.js new file mode 100644 index 0000000..e3cfd6a --- /dev/null +++ b/node_modules/lodash/_baseIsEqualDeep.js @@ -0,0 +1,83 @@ +var Stack = require('./_Stack'), + equalArrays = require('./_equalArrays'), + equalByTag = require('./_equalByTag'), + equalObjects = require('./_equalObjects'), + getTag = require('./_getTag'), + isArray = require('./isArray'), + isBuffer = require('./isBuffer'), + isTypedArray = require('./isTypedArray'); + +/** Used to compose bitmasks for value comparisons. */ +var COMPARE_PARTIAL_FLAG = 1; + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + objectTag = '[object Object]'; + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * A specialized version of `baseIsEqual` for arrays and objects which performs + * deep comparisons and tracks traversed objects enabling objects with circular + * references to be compared. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} [stack] Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ +function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) { + var objIsArr = isArray(object), + othIsArr = isArray(other), + objTag = objIsArr ? arrayTag : getTag(object), + othTag = othIsArr ? arrayTag : getTag(other); + + objTag = objTag == argsTag ? objectTag : objTag; + othTag = othTag == argsTag ? objectTag : othTag; + + var objIsObj = objTag == objectTag, + othIsObj = othTag == objectTag, + isSameTag = objTag == othTag; + + if (isSameTag && isBuffer(object)) { + if (!isBuffer(other)) { + return false; + } + objIsArr = true; + objIsObj = false; + } + if (isSameTag && !objIsObj) { + stack || (stack = new Stack); + return (objIsArr || isTypedArray(object)) + ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) + : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack); + } + if (!(bitmask & COMPARE_PARTIAL_FLAG)) { + var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), + othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); + + if (objIsWrapped || othIsWrapped) { + var objUnwrapped = objIsWrapped ? object.value() : object, + othUnwrapped = othIsWrapped ? other.value() : other; + + stack || (stack = new Stack); + return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); + } + } + if (!isSameTag) { + return false; + } + stack || (stack = new Stack); + return equalObjects(object, other, bitmask, customizer, equalFunc, stack); +} + +module.exports = baseIsEqualDeep; diff --git a/node_modules/lodash/_baseIsMap.js b/node_modules/lodash/_baseIsMap.js new file mode 100644 index 0000000..02a4021 --- /dev/null +++ b/node_modules/lodash/_baseIsMap.js @@ -0,0 +1,18 @@ +var getTag = require('./_getTag'), + isObjectLike = require('./isObjectLike'); + +/** `Object#toString` result references. */ +var mapTag = '[object Map]'; + +/** + * The base implementation of `_.isMap` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a map, else `false`. + */ +function baseIsMap(value) { + return isObjectLike(value) && getTag(value) == mapTag; +} + +module.exports = baseIsMap; diff --git a/node_modules/lodash/_baseIsMatch.js b/node_modules/lodash/_baseIsMatch.js new file mode 100644 index 0000000..72494be --- /dev/null +++ b/node_modules/lodash/_baseIsMatch.js @@ -0,0 +1,62 @@ +var Stack = require('./_Stack'), + baseIsEqual = require('./_baseIsEqual'); + +/** Used to compose bitmasks for value comparisons. */ +var COMPARE_PARTIAL_FLAG = 1, + COMPARE_UNORDERED_FLAG = 2; + +/** + * The base implementation of `_.isMatch` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to inspect. + * @param {Object} source The object of property values to match. + * @param {Array} matchData The property names, values, and compare flags to match. + * @param {Function} [customizer] The function to customize comparisons. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. + */ +function baseIsMatch(object, source, matchData, customizer) { + var index = matchData.length, + length = index, + noCustomizer = !customizer; + + if (object == null) { + return !length; + } + object = Object(object); + while (index--) { + var data = matchData[index]; + if ((noCustomizer && data[2]) + ? data[1] !== object[data[0]] + : !(data[0] in object) + ) { + return false; + } + } + while (++index < length) { + data = matchData[index]; + var key = data[0], + objValue = object[key], + srcValue = data[1]; + + if (noCustomizer && data[2]) { + if (objValue === undefined && !(key in object)) { + return false; + } + } else { + var stack = new Stack; + if (customizer) { + var result = customizer(objValue, srcValue, key, object, source, stack); + } + if (!(result === undefined + ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack) + : result + )) { + return false; + } + } + } + return true; +} + +module.exports = baseIsMatch; diff --git a/node_modules/lodash/_baseIsNaN.js b/node_modules/lodash/_baseIsNaN.js new file mode 100644 index 0000000..316f1eb --- /dev/null +++ b/node_modules/lodash/_baseIsNaN.js @@ -0,0 +1,12 @@ +/** + * The base implementation of `_.isNaN` without support for number objects. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. + */ +function baseIsNaN(value) { + return value !== value; +} + +module.exports = baseIsNaN; diff --git a/node_modules/lodash/_baseIsNative.js b/node_modules/lodash/_baseIsNative.js new file mode 100644 index 0000000..8702330 --- /dev/null +++ b/node_modules/lodash/_baseIsNative.js @@ -0,0 +1,47 @@ +var isFunction = require('./isFunction'), + isMasked = require('./_isMasked'), + isObject = require('./isObject'), + toSource = require('./_toSource'); + +/** + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). + */ +var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; + +/** Used to detect host constructors (Safari). */ +var reIsHostCtor = /^\[object .+?Constructor\]$/; + +/** Used for built-in method references. */ +var funcProto = Function.prototype, + objectProto = Object.prototype; + +/** Used to resolve the decompiled source of functions. */ +var funcToString = funcProto.toString; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** Used to detect if a method is native. */ +var reIsNative = RegExp('^' + + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' +); + +/** + * The base implementation of `_.isNative` without bad shim checks. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. + */ +function baseIsNative(value) { + if (!isObject(value) || isMasked(value)) { + return false; + } + var pattern = isFunction(value) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); +} + +module.exports = baseIsNative; diff --git a/node_modules/lodash/_baseIsRegExp.js b/node_modules/lodash/_baseIsRegExp.js new file mode 100644 index 0000000..6cd7c1a --- /dev/null +++ b/node_modules/lodash/_baseIsRegExp.js @@ -0,0 +1,18 @@ +var baseGetTag = require('./_baseGetTag'), + isObjectLike = require('./isObjectLike'); + +/** `Object#toString` result references. */ +var regexpTag = '[object RegExp]'; + +/** + * The base implementation of `_.isRegExp` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. + */ +function baseIsRegExp(value) { + return isObjectLike(value) && baseGetTag(value) == regexpTag; +} + +module.exports = baseIsRegExp; diff --git a/node_modules/lodash/_baseIsSet.js b/node_modules/lodash/_baseIsSet.js new file mode 100644 index 0000000..6dee367 --- /dev/null +++ b/node_modules/lodash/_baseIsSet.js @@ -0,0 +1,18 @@ +var getTag = require('./_getTag'), + isObjectLike = require('./isObjectLike'); + +/** `Object#toString` result references. */ +var setTag = '[object Set]'; + +/** + * The base implementation of `_.isSet` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a set, else `false`. + */ +function baseIsSet(value) { + return isObjectLike(value) && getTag(value) == setTag; +} + +module.exports = baseIsSet; diff --git a/node_modules/lodash/_baseIsTypedArray.js b/node_modules/lodash/_baseIsTypedArray.js new file mode 100644 index 0000000..1edb32f --- /dev/null +++ b/node_modules/lodash/_baseIsTypedArray.js @@ -0,0 +1,60 @@ +var baseGetTag = require('./_baseGetTag'), + isLength = require('./isLength'), + isObjectLike = require('./isObjectLike'); + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + funcTag = '[object Function]', + mapTag = '[object Map]', + numberTag = '[object Number]', + objectTag = '[object Object]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + weakMapTag = '[object WeakMap]'; + +var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; + +/** Used to identify `toStringTag` values of typed arrays. */ +var typedArrayTags = {}; +typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = +typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = +typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = +typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = +typedArrayTags[uint32Tag] = true; +typedArrayTags[argsTag] = typedArrayTags[arrayTag] = +typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = +typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = +typedArrayTags[errorTag] = typedArrayTags[funcTag] = +typedArrayTags[mapTag] = typedArrayTags[numberTag] = +typedArrayTags[objectTag] = typedArrayTags[regexpTag] = +typedArrayTags[setTag] = typedArrayTags[stringTag] = +typedArrayTags[weakMapTag] = false; + +/** + * The base implementation of `_.isTypedArray` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + */ +function baseIsTypedArray(value) { + return isObjectLike(value) && + isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; +} + +module.exports = baseIsTypedArray; diff --git a/node_modules/lodash/_baseIteratee.js b/node_modules/lodash/_baseIteratee.js new file mode 100644 index 0000000..995c257 --- /dev/null +++ b/node_modules/lodash/_baseIteratee.js @@ -0,0 +1,31 @@ +var baseMatches = require('./_baseMatches'), + baseMatchesProperty = require('./_baseMatchesProperty'), + identity = require('./identity'), + isArray = require('./isArray'), + property = require('./property'); + +/** + * The base implementation of `_.iteratee`. + * + * @private + * @param {*} [value=_.identity] The value to convert to an iteratee. + * @returns {Function} Returns the iteratee. + */ +function baseIteratee(value) { + // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9. + // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details. + if (typeof value == 'function') { + return value; + } + if (value == null) { + return identity; + } + if (typeof value == 'object') { + return isArray(value) + ? baseMatchesProperty(value[0], value[1]) + : baseMatches(value); + } + return property(value); +} + +module.exports = baseIteratee; diff --git a/node_modules/lodash/_baseKeys.js b/node_modules/lodash/_baseKeys.js new file mode 100644 index 0000000..45e9e6f --- /dev/null +++ b/node_modules/lodash/_baseKeys.js @@ -0,0 +1,30 @@ +var isPrototype = require('./_isPrototype'), + nativeKeys = require('./_nativeKeys'); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ +function baseKeys(object) { + if (!isPrototype(object)) { + return nativeKeys(object); + } + var result = []; + for (var key in Object(object)) { + if (hasOwnProperty.call(object, key) && key != 'constructor') { + result.push(key); + } + } + return result; +} + +module.exports = baseKeys; diff --git a/node_modules/lodash/_baseKeysIn.js b/node_modules/lodash/_baseKeysIn.js new file mode 100644 index 0000000..ea8a0a1 --- /dev/null +++ b/node_modules/lodash/_baseKeysIn.js @@ -0,0 +1,33 @@ +var isObject = require('./isObject'), + isPrototype = require('./_isPrototype'), + nativeKeysIn = require('./_nativeKeysIn'); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ +function baseKeysIn(object) { + if (!isObject(object)) { + return nativeKeysIn(object); + } + var isProto = isPrototype(object), + result = []; + + for (var key in object) { + if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { + result.push(key); + } + } + return result; +} + +module.exports = baseKeysIn; diff --git a/node_modules/lodash/_baseLodash.js b/node_modules/lodash/_baseLodash.js new file mode 100644 index 0000000..f76c790 --- /dev/null +++ b/node_modules/lodash/_baseLodash.js @@ -0,0 +1,10 @@ +/** + * The function whose prototype chain sequence wrappers inherit from. + * + * @private + */ +function baseLodash() { + // No operation performed. +} + +module.exports = baseLodash; diff --git a/node_modules/lodash/_baseLt.js b/node_modules/lodash/_baseLt.js new file mode 100644 index 0000000..8674d29 --- /dev/null +++ b/node_modules/lodash/_baseLt.js @@ -0,0 +1,14 @@ +/** + * The base implementation of `_.lt` which doesn't coerce arguments. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is less than `other`, + * else `false`. + */ +function baseLt(value, other) { + return value < other; +} + +module.exports = baseLt; diff --git a/node_modules/lodash/_baseMap.js b/node_modules/lodash/_baseMap.js new file mode 100644 index 0000000..0bf5cea --- /dev/null +++ b/node_modules/lodash/_baseMap.js @@ -0,0 +1,22 @@ +var baseEach = require('./_baseEach'), + isArrayLike = require('./isArrayLike'); + +/** + * The base implementation of `_.map` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ +function baseMap(collection, iteratee) { + var index = -1, + result = isArrayLike(collection) ? Array(collection.length) : []; + + baseEach(collection, function(value, key, collection) { + result[++index] = iteratee(value, key, collection); + }); + return result; +} + +module.exports = baseMap; diff --git a/node_modules/lodash/_baseMatches.js b/node_modules/lodash/_baseMatches.js new file mode 100644 index 0000000..e56582a --- /dev/null +++ b/node_modules/lodash/_baseMatches.js @@ -0,0 +1,22 @@ +var baseIsMatch = require('./_baseIsMatch'), + getMatchData = require('./_getMatchData'), + matchesStrictComparable = require('./_matchesStrictComparable'); + +/** + * The base implementation of `_.matches` which doesn't clone `source`. + * + * @private + * @param {Object} source The object of property values to match. + * @returns {Function} Returns the new spec function. + */ +function baseMatches(source) { + var matchData = getMatchData(source); + if (matchData.length == 1 && matchData[0][2]) { + return matchesStrictComparable(matchData[0][0], matchData[0][1]); + } + return function(object) { + return object === source || baseIsMatch(object, source, matchData); + }; +} + +module.exports = baseMatches; diff --git a/node_modules/lodash/_baseMatchesProperty.js b/node_modules/lodash/_baseMatchesProperty.js new file mode 100644 index 0000000..24afd89 --- /dev/null +++ b/node_modules/lodash/_baseMatchesProperty.js @@ -0,0 +1,33 @@ +var baseIsEqual = require('./_baseIsEqual'), + get = require('./get'), + hasIn = require('./hasIn'), + isKey = require('./_isKey'), + isStrictComparable = require('./_isStrictComparable'), + matchesStrictComparable = require('./_matchesStrictComparable'), + toKey = require('./_toKey'); + +/** Used to compose bitmasks for value comparisons. */ +var COMPARE_PARTIAL_FLAG = 1, + COMPARE_UNORDERED_FLAG = 2; + +/** + * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`. + * + * @private + * @param {string} path The path of the property to get. + * @param {*} srcValue The value to match. + * @returns {Function} Returns the new spec function. + */ +function baseMatchesProperty(path, srcValue) { + if (isKey(path) && isStrictComparable(srcValue)) { + return matchesStrictComparable(toKey(path), srcValue); + } + return function(object) { + var objValue = get(object, path); + return (objValue === undefined && objValue === srcValue) + ? hasIn(object, path) + : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG); + }; +} + +module.exports = baseMatchesProperty; diff --git a/node_modules/lodash/_baseMean.js b/node_modules/lodash/_baseMean.js new file mode 100644 index 0000000..fa9e00a --- /dev/null +++ b/node_modules/lodash/_baseMean.js @@ -0,0 +1,20 @@ +var baseSum = require('./_baseSum'); + +/** Used as references for various `Number` constants. */ +var NAN = 0 / 0; + +/** + * The base implementation of `_.mean` and `_.meanBy` without support for + * iteratee shorthands. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {number} Returns the mean. + */ +function baseMean(array, iteratee) { + var length = array == null ? 0 : array.length; + return length ? (baseSum(array, iteratee) / length) : NAN; +} + +module.exports = baseMean; diff --git a/node_modules/lodash/_baseMerge.js b/node_modules/lodash/_baseMerge.js new file mode 100644 index 0000000..c98b5eb --- /dev/null +++ b/node_modules/lodash/_baseMerge.js @@ -0,0 +1,42 @@ +var Stack = require('./_Stack'), + assignMergeValue = require('./_assignMergeValue'), + baseFor = require('./_baseFor'), + baseMergeDeep = require('./_baseMergeDeep'), + isObject = require('./isObject'), + keysIn = require('./keysIn'), + safeGet = require('./_safeGet'); + +/** + * The base implementation of `_.merge` without support for multiple sources. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @param {number} srcIndex The index of `source`. + * @param {Function} [customizer] The function to customize merged values. + * @param {Object} [stack] Tracks traversed source values and their merged + * counterparts. + */ +function baseMerge(object, source, srcIndex, customizer, stack) { + if (object === source) { + return; + } + baseFor(source, function(srcValue, key) { + stack || (stack = new Stack); + if (isObject(srcValue)) { + baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack); + } + else { + var newValue = customizer + ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack) + : undefined; + + if (newValue === undefined) { + newValue = srcValue; + } + assignMergeValue(object, key, newValue); + } + }, keysIn); +} + +module.exports = baseMerge; diff --git a/node_modules/lodash/_baseMergeDeep.js b/node_modules/lodash/_baseMergeDeep.js new file mode 100644 index 0000000..4679e8d --- /dev/null +++ b/node_modules/lodash/_baseMergeDeep.js @@ -0,0 +1,94 @@ +var assignMergeValue = require('./_assignMergeValue'), + cloneBuffer = require('./_cloneBuffer'), + cloneTypedArray = require('./_cloneTypedArray'), + copyArray = require('./_copyArray'), + initCloneObject = require('./_initCloneObject'), + isArguments = require('./isArguments'), + isArray = require('./isArray'), + isArrayLikeObject = require('./isArrayLikeObject'), + isBuffer = require('./isBuffer'), + isFunction = require('./isFunction'), + isObject = require('./isObject'), + isPlainObject = require('./isPlainObject'), + isTypedArray = require('./isTypedArray'), + safeGet = require('./_safeGet'), + toPlainObject = require('./toPlainObject'); + +/** + * A specialized version of `baseMerge` for arrays and objects which performs + * deep merges and tracks traversed objects enabling objects with circular + * references to be merged. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @param {string} key The key of the value to merge. + * @param {number} srcIndex The index of `source`. + * @param {Function} mergeFunc The function to merge values. + * @param {Function} [customizer] The function to customize assigned values. + * @param {Object} [stack] Tracks traversed source values and their merged + * counterparts. + */ +function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) { + var objValue = safeGet(object, key), + srcValue = safeGet(source, key), + stacked = stack.get(srcValue); + + if (stacked) { + assignMergeValue(object, key, stacked); + return; + } + var newValue = customizer + ? customizer(objValue, srcValue, (key + ''), object, source, stack) + : undefined; + + var isCommon = newValue === undefined; + + if (isCommon) { + var isArr = isArray(srcValue), + isBuff = !isArr && isBuffer(srcValue), + isTyped = !isArr && !isBuff && isTypedArray(srcValue); + + newValue = srcValue; + if (isArr || isBuff || isTyped) { + if (isArray(objValue)) { + newValue = objValue; + } + else if (isArrayLikeObject(objValue)) { + newValue = copyArray(objValue); + } + else if (isBuff) { + isCommon = false; + newValue = cloneBuffer(srcValue, true); + } + else if (isTyped) { + isCommon = false; + newValue = cloneTypedArray(srcValue, true); + } + else { + newValue = []; + } + } + else if (isPlainObject(srcValue) || isArguments(srcValue)) { + newValue = objValue; + if (isArguments(objValue)) { + newValue = toPlainObject(objValue); + } + else if (!isObject(objValue) || isFunction(objValue)) { + newValue = initCloneObject(srcValue); + } + } + else { + isCommon = false; + } + } + if (isCommon) { + // Recursively merge objects and arrays (susceptible to call stack limits). + stack.set(srcValue, newValue); + mergeFunc(newValue, srcValue, srcIndex, customizer, stack); + stack['delete'](srcValue); + } + assignMergeValue(object, key, newValue); +} + +module.exports = baseMergeDeep; diff --git a/node_modules/lodash/_baseNth.js b/node_modules/lodash/_baseNth.js new file mode 100644 index 0000000..0403c2a --- /dev/null +++ b/node_modules/lodash/_baseNth.js @@ -0,0 +1,20 @@ +var isIndex = require('./_isIndex'); + +/** + * The base implementation of `_.nth` which doesn't coerce arguments. + * + * @private + * @param {Array} array The array to query. + * @param {number} n The index of the element to return. + * @returns {*} Returns the nth element of `array`. + */ +function baseNth(array, n) { + var length = array.length; + if (!length) { + return; + } + n += n < 0 ? length : 0; + return isIndex(n, length) ? array[n] : undefined; +} + +module.exports = baseNth; diff --git a/node_modules/lodash/_baseOrderBy.js b/node_modules/lodash/_baseOrderBy.js new file mode 100644 index 0000000..775a017 --- /dev/null +++ b/node_modules/lodash/_baseOrderBy.js @@ -0,0 +1,49 @@ +var arrayMap = require('./_arrayMap'), + baseGet = require('./_baseGet'), + baseIteratee = require('./_baseIteratee'), + baseMap = require('./_baseMap'), + baseSortBy = require('./_baseSortBy'), + baseUnary = require('./_baseUnary'), + compareMultiple = require('./_compareMultiple'), + identity = require('./identity'), + isArray = require('./isArray'); + +/** + * The base implementation of `_.orderBy` without param guards. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by. + * @param {string[]} orders The sort orders of `iteratees`. + * @returns {Array} Returns the new sorted array. + */ +function baseOrderBy(collection, iteratees, orders) { + if (iteratees.length) { + iteratees = arrayMap(iteratees, function(iteratee) { + if (isArray(iteratee)) { + return function(value) { + return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee); + } + } + return iteratee; + }); + } else { + iteratees = [identity]; + } + + var index = -1; + iteratees = arrayMap(iteratees, baseUnary(baseIteratee)); + + var result = baseMap(collection, function(value, key, collection) { + var criteria = arrayMap(iteratees, function(iteratee) { + return iteratee(value); + }); + return { 'criteria': criteria, 'index': ++index, 'value': value }; + }); + + return baseSortBy(result, function(object, other) { + return compareMultiple(object, other, orders); + }); +} + +module.exports = baseOrderBy; diff --git a/node_modules/lodash/_basePick.js b/node_modules/lodash/_basePick.js new file mode 100644 index 0000000..09b458a --- /dev/null +++ b/node_modules/lodash/_basePick.js @@ -0,0 +1,19 @@ +var basePickBy = require('./_basePickBy'), + hasIn = require('./hasIn'); + +/** + * The base implementation of `_.pick` without support for individual + * property identifiers. + * + * @private + * @param {Object} object The source object. + * @param {string[]} paths The property paths to pick. + * @returns {Object} Returns the new object. + */ +function basePick(object, paths) { + return basePickBy(object, paths, function(value, path) { + return hasIn(object, path); + }); +} + +module.exports = basePick; diff --git a/node_modules/lodash/_basePickBy.js b/node_modules/lodash/_basePickBy.js new file mode 100644 index 0000000..85be68c --- /dev/null +++ b/node_modules/lodash/_basePickBy.js @@ -0,0 +1,30 @@ +var baseGet = require('./_baseGet'), + baseSet = require('./_baseSet'), + castPath = require('./_castPath'); + +/** + * The base implementation of `_.pickBy` without support for iteratee shorthands. + * + * @private + * @param {Object} object The source object. + * @param {string[]} paths The property paths to pick. + * @param {Function} predicate The function invoked per property. + * @returns {Object} Returns the new object. + */ +function basePickBy(object, paths, predicate) { + var index = -1, + length = paths.length, + result = {}; + + while (++index < length) { + var path = paths[index], + value = baseGet(object, path); + + if (predicate(value, path)) { + baseSet(result, castPath(path, object), value); + } + } + return result; +} + +module.exports = basePickBy; diff --git a/node_modules/lodash/_baseProperty.js b/node_modules/lodash/_baseProperty.js new file mode 100644 index 0000000..496281e --- /dev/null +++ b/node_modules/lodash/_baseProperty.js @@ -0,0 +1,14 @@ +/** + * The base implementation of `_.property` without support for deep paths. + * + * @private + * @param {string} key The key of the property to get. + * @returns {Function} Returns the new accessor function. + */ +function baseProperty(key) { + return function(object) { + return object == null ? undefined : object[key]; + }; +} + +module.exports = baseProperty; diff --git a/node_modules/lodash/_basePropertyDeep.js b/node_modules/lodash/_basePropertyDeep.js new file mode 100644 index 0000000..1e5aae5 --- /dev/null +++ b/node_modules/lodash/_basePropertyDeep.js @@ -0,0 +1,16 @@ +var baseGet = require('./_baseGet'); + +/** + * A specialized version of `baseProperty` which supports deep paths. + * + * @private + * @param {Array|string} path The path of the property to get. + * @returns {Function} Returns the new accessor function. + */ +function basePropertyDeep(path) { + return function(object) { + return baseGet(object, path); + }; +} + +module.exports = basePropertyDeep; diff --git a/node_modules/lodash/_basePropertyOf.js b/node_modules/lodash/_basePropertyOf.js new file mode 100644 index 0000000..4617399 --- /dev/null +++ b/node_modules/lodash/_basePropertyOf.js @@ -0,0 +1,14 @@ +/** + * The base implementation of `_.propertyOf` without support for deep paths. + * + * @private + * @param {Object} object The object to query. + * @returns {Function} Returns the new accessor function. + */ +function basePropertyOf(object) { + return function(key) { + return object == null ? undefined : object[key]; + }; +} + +module.exports = basePropertyOf; diff --git a/node_modules/lodash/_basePullAll.js b/node_modules/lodash/_basePullAll.js new file mode 100644 index 0000000..305720e --- /dev/null +++ b/node_modules/lodash/_basePullAll.js @@ -0,0 +1,51 @@ +var arrayMap = require('./_arrayMap'), + baseIndexOf = require('./_baseIndexOf'), + baseIndexOfWith = require('./_baseIndexOfWith'), + baseUnary = require('./_baseUnary'), + copyArray = require('./_copyArray'); + +/** Used for built-in method references. */ +var arrayProto = Array.prototype; + +/** Built-in value references. */ +var splice = arrayProto.splice; + +/** + * The base implementation of `_.pullAllBy` without support for iteratee + * shorthands. + * + * @private + * @param {Array} array The array to modify. + * @param {Array} values The values to remove. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns `array`. + */ +function basePullAll(array, values, iteratee, comparator) { + var indexOf = comparator ? baseIndexOfWith : baseIndexOf, + index = -1, + length = values.length, + seen = array; + + if (array === values) { + values = copyArray(values); + } + if (iteratee) { + seen = arrayMap(array, baseUnary(iteratee)); + } + while (++index < length) { + var fromIndex = 0, + value = values[index], + computed = iteratee ? iteratee(value) : value; + + while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) { + if (seen !== array) { + splice.call(seen, fromIndex, 1); + } + splice.call(array, fromIndex, 1); + } + } + return array; +} + +module.exports = basePullAll; diff --git a/node_modules/lodash/_basePullAt.js b/node_modules/lodash/_basePullAt.js new file mode 100644 index 0000000..c3e9e71 --- /dev/null +++ b/node_modules/lodash/_basePullAt.js @@ -0,0 +1,37 @@ +var baseUnset = require('./_baseUnset'), + isIndex = require('./_isIndex'); + +/** Used for built-in method references. */ +var arrayProto = Array.prototype; + +/** Built-in value references. */ +var splice = arrayProto.splice; + +/** + * The base implementation of `_.pullAt` without support for individual + * indexes or capturing the removed elements. + * + * @private + * @param {Array} array The array to modify. + * @param {number[]} indexes The indexes of elements to remove. + * @returns {Array} Returns `array`. + */ +function basePullAt(array, indexes) { + var length = array ? indexes.length : 0, + lastIndex = length - 1; + + while (length--) { + var index = indexes[length]; + if (length == lastIndex || index !== previous) { + var previous = index; + if (isIndex(index)) { + splice.call(array, index, 1); + } else { + baseUnset(array, index); + } + } + } + return array; +} + +module.exports = basePullAt; diff --git a/node_modules/lodash/_baseRandom.js b/node_modules/lodash/_baseRandom.js new file mode 100644 index 0000000..94f76a7 --- /dev/null +++ b/node_modules/lodash/_baseRandom.js @@ -0,0 +1,18 @@ +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeFloor = Math.floor, + nativeRandom = Math.random; + +/** + * The base implementation of `_.random` without support for returning + * floating-point numbers. + * + * @private + * @param {number} lower The lower bound. + * @param {number} upper The upper bound. + * @returns {number} Returns the random number. + */ +function baseRandom(lower, upper) { + return lower + nativeFloor(nativeRandom() * (upper - lower + 1)); +} + +module.exports = baseRandom; diff --git a/node_modules/lodash/_baseRange.js b/node_modules/lodash/_baseRange.js new file mode 100644 index 0000000..0fb8e41 --- /dev/null +++ b/node_modules/lodash/_baseRange.js @@ -0,0 +1,28 @@ +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeCeil = Math.ceil, + nativeMax = Math.max; + +/** + * The base implementation of `_.range` and `_.rangeRight` which doesn't + * coerce arguments. + * + * @private + * @param {number} start The start of the range. + * @param {number} end The end of the range. + * @param {number} step The value to increment or decrement by. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Array} Returns the range of numbers. + */ +function baseRange(start, end, step, fromRight) { + var index = -1, + length = nativeMax(nativeCeil((end - start) / (step || 1)), 0), + result = Array(length); + + while (length--) { + result[fromRight ? length : ++index] = start; + start += step; + } + return result; +} + +module.exports = baseRange; diff --git a/node_modules/lodash/_baseReduce.js b/node_modules/lodash/_baseReduce.js new file mode 100644 index 0000000..5a1f8b5 --- /dev/null +++ b/node_modules/lodash/_baseReduce.js @@ -0,0 +1,23 @@ +/** + * The base implementation of `_.reduce` and `_.reduceRight`, without support + * for iteratee shorthands, which iterates over `collection` using `eachFunc`. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} accumulator The initial value. + * @param {boolean} initAccum Specify using the first or last element of + * `collection` as the initial value. + * @param {Function} eachFunc The function to iterate over `collection`. + * @returns {*} Returns the accumulated value. + */ +function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) { + eachFunc(collection, function(value, index, collection) { + accumulator = initAccum + ? (initAccum = false, value) + : iteratee(accumulator, value, index, collection); + }); + return accumulator; +} + +module.exports = baseReduce; diff --git a/node_modules/lodash/_baseRepeat.js b/node_modules/lodash/_baseRepeat.js new file mode 100644 index 0000000..ee44c31 --- /dev/null +++ b/node_modules/lodash/_baseRepeat.js @@ -0,0 +1,35 @@ +/** Used as references for various `Number` constants. */ +var MAX_SAFE_INTEGER = 9007199254740991; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeFloor = Math.floor; + +/** + * The base implementation of `_.repeat` which doesn't coerce arguments. + * + * @private + * @param {string} string The string to repeat. + * @param {number} n The number of times to repeat the string. + * @returns {string} Returns the repeated string. + */ +function baseRepeat(string, n) { + var result = ''; + if (!string || n < 1 || n > MAX_SAFE_INTEGER) { + return result; + } + // Leverage the exponentiation by squaring algorithm for a faster repeat. + // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details. + do { + if (n % 2) { + result += string; + } + n = nativeFloor(n / 2); + if (n) { + string += string; + } + } while (n); + + return result; +} + +module.exports = baseRepeat; diff --git a/node_modules/lodash/_baseRest.js b/node_modules/lodash/_baseRest.js new file mode 100644 index 0000000..d0dc4bd --- /dev/null +++ b/node_modules/lodash/_baseRest.js @@ -0,0 +1,17 @@ +var identity = require('./identity'), + overRest = require('./_overRest'), + setToString = require('./_setToString'); + +/** + * The base implementation of `_.rest` which doesn't validate or coerce arguments. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @returns {Function} Returns the new function. + */ +function baseRest(func, start) { + return setToString(overRest(func, start, identity), func + ''); +} + +module.exports = baseRest; diff --git a/node_modules/lodash/_baseSample.js b/node_modules/lodash/_baseSample.js new file mode 100644 index 0000000..58582b9 --- /dev/null +++ b/node_modules/lodash/_baseSample.js @@ -0,0 +1,15 @@ +var arraySample = require('./_arraySample'), + values = require('./values'); + +/** + * The base implementation of `_.sample`. + * + * @private + * @param {Array|Object} collection The collection to sample. + * @returns {*} Returns the random element. + */ +function baseSample(collection) { + return arraySample(values(collection)); +} + +module.exports = baseSample; diff --git a/node_modules/lodash/_baseSampleSize.js b/node_modules/lodash/_baseSampleSize.js new file mode 100644 index 0000000..5c90ec5 --- /dev/null +++ b/node_modules/lodash/_baseSampleSize.js @@ -0,0 +1,18 @@ +var baseClamp = require('./_baseClamp'), + shuffleSelf = require('./_shuffleSelf'), + values = require('./values'); + +/** + * The base implementation of `_.sampleSize` without param guards. + * + * @private + * @param {Array|Object} collection The collection to sample. + * @param {number} n The number of elements to sample. + * @returns {Array} Returns the random elements. + */ +function baseSampleSize(collection, n) { + var array = values(collection); + return shuffleSelf(array, baseClamp(n, 0, array.length)); +} + +module.exports = baseSampleSize; diff --git a/node_modules/lodash/_baseSet.js b/node_modules/lodash/_baseSet.js new file mode 100644 index 0000000..99f4fbf --- /dev/null +++ b/node_modules/lodash/_baseSet.js @@ -0,0 +1,51 @@ +var assignValue = require('./_assignValue'), + castPath = require('./_castPath'), + isIndex = require('./_isIndex'), + isObject = require('./isObject'), + toKey = require('./_toKey'); + +/** + * The base implementation of `_.set`. + * + * @private + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {*} value The value to set. + * @param {Function} [customizer] The function to customize path creation. + * @returns {Object} Returns `object`. + */ +function baseSet(object, path, value, customizer) { + if (!isObject(object)) { + return object; + } + path = castPath(path, object); + + var index = -1, + length = path.length, + lastIndex = length - 1, + nested = object; + + while (nested != null && ++index < length) { + var key = toKey(path[index]), + newValue = value; + + if (key === '__proto__' || key === 'constructor' || key === 'prototype') { + return object; + } + + if (index != lastIndex) { + var objValue = nested[key]; + newValue = customizer ? customizer(objValue, key, nested) : undefined; + if (newValue === undefined) { + newValue = isObject(objValue) + ? objValue + : (isIndex(path[index + 1]) ? [] : {}); + } + } + assignValue(nested, key, newValue); + nested = nested[key]; + } + return object; +} + +module.exports = baseSet; diff --git a/node_modules/lodash/_baseSetData.js b/node_modules/lodash/_baseSetData.js new file mode 100644 index 0000000..c409947 --- /dev/null +++ b/node_modules/lodash/_baseSetData.js @@ -0,0 +1,17 @@ +var identity = require('./identity'), + metaMap = require('./_metaMap'); + +/** + * The base implementation of `setData` without support for hot loop shorting. + * + * @private + * @param {Function} func The function to associate metadata with. + * @param {*} data The metadata. + * @returns {Function} Returns `func`. + */ +var baseSetData = !metaMap ? identity : function(func, data) { + metaMap.set(func, data); + return func; +}; + +module.exports = baseSetData; diff --git a/node_modules/lodash/_baseSetToString.js b/node_modules/lodash/_baseSetToString.js new file mode 100644 index 0000000..89eaca3 --- /dev/null +++ b/node_modules/lodash/_baseSetToString.js @@ -0,0 +1,22 @@ +var constant = require('./constant'), + defineProperty = require('./_defineProperty'), + identity = require('./identity'); + +/** + * The base implementation of `setToString` without support for hot loop shorting. + * + * @private + * @param {Function} func The function to modify. + * @param {Function} string The `toString` result. + * @returns {Function} Returns `func`. + */ +var baseSetToString = !defineProperty ? identity : function(func, string) { + return defineProperty(func, 'toString', { + 'configurable': true, + 'enumerable': false, + 'value': constant(string), + 'writable': true + }); +}; + +module.exports = baseSetToString; diff --git a/node_modules/lodash/_baseShuffle.js b/node_modules/lodash/_baseShuffle.js new file mode 100644 index 0000000..023077a --- /dev/null +++ b/node_modules/lodash/_baseShuffle.js @@ -0,0 +1,15 @@ +var shuffleSelf = require('./_shuffleSelf'), + values = require('./values'); + +/** + * The base implementation of `_.shuffle`. + * + * @private + * @param {Array|Object} collection The collection to shuffle. + * @returns {Array} Returns the new shuffled array. + */ +function baseShuffle(collection) { + return shuffleSelf(values(collection)); +} + +module.exports = baseShuffle; diff --git a/node_modules/lodash/_baseSlice.js b/node_modules/lodash/_baseSlice.js new file mode 100644 index 0000000..786f6c9 --- /dev/null +++ b/node_modules/lodash/_baseSlice.js @@ -0,0 +1,31 @@ +/** + * The base implementation of `_.slice` without an iteratee call guard. + * + * @private + * @param {Array} array The array to slice. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the slice of `array`. + */ +function baseSlice(array, start, end) { + var index = -1, + length = array.length; + + if (start < 0) { + start = -start > length ? 0 : (length + start); + } + end = end > length ? length : end; + if (end < 0) { + end += length; + } + length = start > end ? 0 : ((end - start) >>> 0); + start >>>= 0; + + var result = Array(length); + while (++index < length) { + result[index] = array[index + start]; + } + return result; +} + +module.exports = baseSlice; diff --git a/node_modules/lodash/_baseSome.js b/node_modules/lodash/_baseSome.js new file mode 100644 index 0000000..58f3f44 --- /dev/null +++ b/node_modules/lodash/_baseSome.js @@ -0,0 +1,22 @@ +var baseEach = require('./_baseEach'); + +/** + * The base implementation of `_.some` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + */ +function baseSome(collection, predicate) { + var result; + + baseEach(collection, function(value, index, collection) { + result = predicate(value, index, collection); + return !result; + }); + return !!result; +} + +module.exports = baseSome; diff --git a/node_modules/lodash/_baseSortBy.js b/node_modules/lodash/_baseSortBy.js new file mode 100644 index 0000000..a25c92e --- /dev/null +++ b/node_modules/lodash/_baseSortBy.js @@ -0,0 +1,21 @@ +/** + * The base implementation of `_.sortBy` which uses `comparer` to define the + * sort order of `array` and replaces criteria objects with their corresponding + * values. + * + * @private + * @param {Array} array The array to sort. + * @param {Function} comparer The function to define sort order. + * @returns {Array} Returns `array`. + */ +function baseSortBy(array, comparer) { + var length = array.length; + + array.sort(comparer); + while (length--) { + array[length] = array[length].value; + } + return array; +} + +module.exports = baseSortBy; diff --git a/node_modules/lodash/_baseSortedIndex.js b/node_modules/lodash/_baseSortedIndex.js new file mode 100644 index 0000000..638c366 --- /dev/null +++ b/node_modules/lodash/_baseSortedIndex.js @@ -0,0 +1,42 @@ +var baseSortedIndexBy = require('./_baseSortedIndexBy'), + identity = require('./identity'), + isSymbol = require('./isSymbol'); + +/** Used as references for the maximum length and index of an array. */ +var MAX_ARRAY_LENGTH = 4294967295, + HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1; + +/** + * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which + * performs a binary search of `array` to determine the index at which `value` + * should be inserted into `array` in order to maintain its sort order. + * + * @private + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @param {boolean} [retHighest] Specify returning the highest qualified index. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + */ +function baseSortedIndex(array, value, retHighest) { + var low = 0, + high = array == null ? low : array.length; + + if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) { + while (low < high) { + var mid = (low + high) >>> 1, + computed = array[mid]; + + if (computed !== null && !isSymbol(computed) && + (retHighest ? (computed <= value) : (computed < value))) { + low = mid + 1; + } else { + high = mid; + } + } + return high; + } + return baseSortedIndexBy(array, value, identity, retHighest); +} + +module.exports = baseSortedIndex; diff --git a/node_modules/lodash/_baseSortedIndexBy.js b/node_modules/lodash/_baseSortedIndexBy.js new file mode 100644 index 0000000..c247b37 --- /dev/null +++ b/node_modules/lodash/_baseSortedIndexBy.js @@ -0,0 +1,67 @@ +var isSymbol = require('./isSymbol'); + +/** Used as references for the maximum length and index of an array. */ +var MAX_ARRAY_LENGTH = 4294967295, + MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeFloor = Math.floor, + nativeMin = Math.min; + +/** + * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy` + * which invokes `iteratee` for `value` and each element of `array` to compute + * their sort ranking. The iteratee is invoked with one argument; (value). + * + * @private + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @param {Function} iteratee The iteratee invoked per element. + * @param {boolean} [retHighest] Specify returning the highest qualified index. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + */ +function baseSortedIndexBy(array, value, iteratee, retHighest) { + var low = 0, + high = array == null ? 0 : array.length; + if (high === 0) { + return 0; + } + + value = iteratee(value); + var valIsNaN = value !== value, + valIsNull = value === null, + valIsSymbol = isSymbol(value), + valIsUndefined = value === undefined; + + while (low < high) { + var mid = nativeFloor((low + high) / 2), + computed = iteratee(array[mid]), + othIsDefined = computed !== undefined, + othIsNull = computed === null, + othIsReflexive = computed === computed, + othIsSymbol = isSymbol(computed); + + if (valIsNaN) { + var setLow = retHighest || othIsReflexive; + } else if (valIsUndefined) { + setLow = othIsReflexive && (retHighest || othIsDefined); + } else if (valIsNull) { + setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull); + } else if (valIsSymbol) { + setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol); + } else if (othIsNull || othIsSymbol) { + setLow = false; + } else { + setLow = retHighest ? (computed <= value) : (computed < value); + } + if (setLow) { + low = mid + 1; + } else { + high = mid; + } + } + return nativeMin(high, MAX_ARRAY_INDEX); +} + +module.exports = baseSortedIndexBy; diff --git a/node_modules/lodash/_baseSortedUniq.js b/node_modules/lodash/_baseSortedUniq.js new file mode 100644 index 0000000..802159a --- /dev/null +++ b/node_modules/lodash/_baseSortedUniq.js @@ -0,0 +1,30 @@ +var eq = require('./eq'); + +/** + * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without + * support for iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @returns {Array} Returns the new duplicate free array. + */ +function baseSortedUniq(array, iteratee) { + var index = -1, + length = array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index], + computed = iteratee ? iteratee(value) : value; + + if (!index || !eq(computed, seen)) { + var seen = computed; + result[resIndex++] = value === 0 ? 0 : value; + } + } + return result; +} + +module.exports = baseSortedUniq; diff --git a/node_modules/lodash/_baseSum.js b/node_modules/lodash/_baseSum.js new file mode 100644 index 0000000..a9e84c1 --- /dev/null +++ b/node_modules/lodash/_baseSum.js @@ -0,0 +1,24 @@ +/** + * The base implementation of `_.sum` and `_.sumBy` without support for + * iteratee shorthands. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {number} Returns the sum. + */ +function baseSum(array, iteratee) { + var result, + index = -1, + length = array.length; + + while (++index < length) { + var current = iteratee(array[index]); + if (current !== undefined) { + result = result === undefined ? current : (result + current); + } + } + return result; +} + +module.exports = baseSum; diff --git a/node_modules/lodash/_baseTimes.js b/node_modules/lodash/_baseTimes.js new file mode 100644 index 0000000..0603fc3 --- /dev/null +++ b/node_modules/lodash/_baseTimes.js @@ -0,0 +1,20 @@ +/** + * The base implementation of `_.times` without support for iteratee shorthands + * or max array length checks. + * + * @private + * @param {number} n The number of times to invoke `iteratee`. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the array of results. + */ +function baseTimes(n, iteratee) { + var index = -1, + result = Array(n); + + while (++index < n) { + result[index] = iteratee(index); + } + return result; +} + +module.exports = baseTimes; diff --git a/node_modules/lodash/_baseToNumber.js b/node_modules/lodash/_baseToNumber.js new file mode 100644 index 0000000..04859f3 --- /dev/null +++ b/node_modules/lodash/_baseToNumber.js @@ -0,0 +1,24 @@ +var isSymbol = require('./isSymbol'); + +/** Used as references for various `Number` constants. */ +var NAN = 0 / 0; + +/** + * The base implementation of `_.toNumber` which doesn't ensure correct + * conversions of binary, hexadecimal, or octal string values. + * + * @private + * @param {*} value The value to process. + * @returns {number} Returns the number. + */ +function baseToNumber(value) { + if (typeof value == 'number') { + return value; + } + if (isSymbol(value)) { + return NAN; + } + return +value; +} + +module.exports = baseToNumber; diff --git a/node_modules/lodash/_baseToPairs.js b/node_modules/lodash/_baseToPairs.js new file mode 100644 index 0000000..bff1991 --- /dev/null +++ b/node_modules/lodash/_baseToPairs.js @@ -0,0 +1,18 @@ +var arrayMap = require('./_arrayMap'); + +/** + * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array + * of key-value pairs for `object` corresponding to the property names of `props`. + * + * @private + * @param {Object} object The object to query. + * @param {Array} props The property names to get values for. + * @returns {Object} Returns the key-value pairs. + */ +function baseToPairs(object, props) { + return arrayMap(props, function(key) { + return [key, object[key]]; + }); +} + +module.exports = baseToPairs; diff --git a/node_modules/lodash/_baseToString.js b/node_modules/lodash/_baseToString.js new file mode 100644 index 0000000..ada6ad2 --- /dev/null +++ b/node_modules/lodash/_baseToString.js @@ -0,0 +1,37 @@ +var Symbol = require('./_Symbol'), + arrayMap = require('./_arrayMap'), + isArray = require('./isArray'), + isSymbol = require('./isSymbol'); + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0; + +/** Used to convert symbols to primitives and strings. */ +var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolToString = symbolProto ? symbolProto.toString : undefined; + +/** + * The base implementation of `_.toString` which doesn't convert nullish + * values to empty strings. + * + * @private + * @param {*} value The value to process. + * @returns {string} Returns the string. + */ +function baseToString(value) { + // Exit early for strings to avoid a performance hit in some environments. + if (typeof value == 'string') { + return value; + } + if (isArray(value)) { + // Recursively convert values (susceptible to call stack limits). + return arrayMap(value, baseToString) + ''; + } + if (isSymbol(value)) { + return symbolToString ? symbolToString.call(value) : ''; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; +} + +module.exports = baseToString; diff --git a/node_modules/lodash/_baseTrim.js b/node_modules/lodash/_baseTrim.js new file mode 100644 index 0000000..3e2797d --- /dev/null +++ b/node_modules/lodash/_baseTrim.js @@ -0,0 +1,19 @@ +var trimmedEndIndex = require('./_trimmedEndIndex'); + +/** Used to match leading whitespace. */ +var reTrimStart = /^\s+/; + +/** + * The base implementation of `_.trim`. + * + * @private + * @param {string} string The string to trim. + * @returns {string} Returns the trimmed string. + */ +function baseTrim(string) { + return string + ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '') + : string; +} + +module.exports = baseTrim; diff --git a/node_modules/lodash/_baseUnary.js b/node_modules/lodash/_baseUnary.js new file mode 100644 index 0000000..98639e9 --- /dev/null +++ b/node_modules/lodash/_baseUnary.js @@ -0,0 +1,14 @@ +/** + * The base implementation of `_.unary` without support for storing metadata. + * + * @private + * @param {Function} func The function to cap arguments for. + * @returns {Function} Returns the new capped function. + */ +function baseUnary(func) { + return function(value) { + return func(value); + }; +} + +module.exports = baseUnary; diff --git a/node_modules/lodash/_baseUniq.js b/node_modules/lodash/_baseUniq.js new file mode 100644 index 0000000..aea459d --- /dev/null +++ b/node_modules/lodash/_baseUniq.js @@ -0,0 +1,72 @@ +var SetCache = require('./_SetCache'), + arrayIncludes = require('./_arrayIncludes'), + arrayIncludesWith = require('./_arrayIncludesWith'), + cacheHas = require('./_cacheHas'), + createSet = require('./_createSet'), + setToArray = require('./_setToArray'); + +/** Used as the size to enable large array optimizations. */ +var LARGE_ARRAY_SIZE = 200; + +/** + * The base implementation of `_.uniqBy` without support for iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new duplicate free array. + */ +function baseUniq(array, iteratee, comparator) { + var index = -1, + includes = arrayIncludes, + length = array.length, + isCommon = true, + result = [], + seen = result; + + if (comparator) { + isCommon = false; + includes = arrayIncludesWith; + } + else if (length >= LARGE_ARRAY_SIZE) { + var set = iteratee ? null : createSet(array); + if (set) { + return setToArray(set); + } + isCommon = false; + includes = cacheHas; + seen = new SetCache; + } + else { + seen = iteratee ? [] : result; + } + outer: + while (++index < length) { + var value = array[index], + computed = iteratee ? iteratee(value) : value; + + value = (comparator || value !== 0) ? value : 0; + if (isCommon && computed === computed) { + var seenIndex = seen.length; + while (seenIndex--) { + if (seen[seenIndex] === computed) { + continue outer; + } + } + if (iteratee) { + seen.push(computed); + } + result.push(value); + } + else if (!includes(seen, computed, comparator)) { + if (seen !== result) { + seen.push(computed); + } + result.push(value); + } + } + return result; +} + +module.exports = baseUniq; diff --git a/node_modules/lodash/_baseUnset.js b/node_modules/lodash/_baseUnset.js new file mode 100644 index 0000000..eefc6e3 --- /dev/null +++ b/node_modules/lodash/_baseUnset.js @@ -0,0 +1,20 @@ +var castPath = require('./_castPath'), + last = require('./last'), + parent = require('./_parent'), + toKey = require('./_toKey'); + +/** + * The base implementation of `_.unset`. + * + * @private + * @param {Object} object The object to modify. + * @param {Array|string} path The property path to unset. + * @returns {boolean} Returns `true` if the property is deleted, else `false`. + */ +function baseUnset(object, path) { + path = castPath(path, object); + object = parent(object, path); + return object == null || delete object[toKey(last(path))]; +} + +module.exports = baseUnset; diff --git a/node_modules/lodash/_baseUpdate.js b/node_modules/lodash/_baseUpdate.js new file mode 100644 index 0000000..92a6237 --- /dev/null +++ b/node_modules/lodash/_baseUpdate.js @@ -0,0 +1,18 @@ +var baseGet = require('./_baseGet'), + baseSet = require('./_baseSet'); + +/** + * The base implementation of `_.update`. + * + * @private + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to update. + * @param {Function} updater The function to produce the updated value. + * @param {Function} [customizer] The function to customize path creation. + * @returns {Object} Returns `object`. + */ +function baseUpdate(object, path, updater, customizer) { + return baseSet(object, path, updater(baseGet(object, path)), customizer); +} + +module.exports = baseUpdate; diff --git a/node_modules/lodash/_baseValues.js b/node_modules/lodash/_baseValues.js new file mode 100644 index 0000000..b95faad --- /dev/null +++ b/node_modules/lodash/_baseValues.js @@ -0,0 +1,19 @@ +var arrayMap = require('./_arrayMap'); + +/** + * The base implementation of `_.values` and `_.valuesIn` which creates an + * array of `object` property values corresponding to the property names + * of `props`. + * + * @private + * @param {Object} object The object to query. + * @param {Array} props The property names to get values for. + * @returns {Object} Returns the array of property values. + */ +function baseValues(object, props) { + return arrayMap(props, function(key) { + return object[key]; + }); +} + +module.exports = baseValues; diff --git a/node_modules/lodash/_baseWhile.js b/node_modules/lodash/_baseWhile.js new file mode 100644 index 0000000..07eac61 --- /dev/null +++ b/node_modules/lodash/_baseWhile.js @@ -0,0 +1,26 @@ +var baseSlice = require('./_baseSlice'); + +/** + * The base implementation of methods like `_.dropWhile` and `_.takeWhile` + * without support for iteratee shorthands. + * + * @private + * @param {Array} array The array to query. + * @param {Function} predicate The function invoked per iteration. + * @param {boolean} [isDrop] Specify dropping elements instead of taking them. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Array} Returns the slice of `array`. + */ +function baseWhile(array, predicate, isDrop, fromRight) { + var length = array.length, + index = fromRight ? length : -1; + + while ((fromRight ? index-- : ++index < length) && + predicate(array[index], index, array)) {} + + return isDrop + ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length)) + : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index)); +} + +module.exports = baseWhile; diff --git a/node_modules/lodash/_baseWrapperValue.js b/node_modules/lodash/_baseWrapperValue.js new file mode 100644 index 0000000..443e0df --- /dev/null +++ b/node_modules/lodash/_baseWrapperValue.js @@ -0,0 +1,25 @@ +var LazyWrapper = require('./_LazyWrapper'), + arrayPush = require('./_arrayPush'), + arrayReduce = require('./_arrayReduce'); + +/** + * The base implementation of `wrapperValue` which returns the result of + * performing a sequence of actions on the unwrapped `value`, where each + * successive action is supplied the return value of the previous. + * + * @private + * @param {*} value The unwrapped value. + * @param {Array} actions Actions to perform to resolve the unwrapped value. + * @returns {*} Returns the resolved value. + */ +function baseWrapperValue(value, actions) { + var result = value; + if (result instanceof LazyWrapper) { + result = result.value(); + } + return arrayReduce(actions, function(result, action) { + return action.func.apply(action.thisArg, arrayPush([result], action.args)); + }, result); +} + +module.exports = baseWrapperValue; diff --git a/node_modules/lodash/_baseXor.js b/node_modules/lodash/_baseXor.js new file mode 100644 index 0000000..8e69338 --- /dev/null +++ b/node_modules/lodash/_baseXor.js @@ -0,0 +1,36 @@ +var baseDifference = require('./_baseDifference'), + baseFlatten = require('./_baseFlatten'), + baseUniq = require('./_baseUniq'); + +/** + * The base implementation of methods like `_.xor`, without support for + * iteratee shorthands, that accepts an array of arrays to inspect. + * + * @private + * @param {Array} arrays The arrays to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of values. + */ +function baseXor(arrays, iteratee, comparator) { + var length = arrays.length; + if (length < 2) { + return length ? baseUniq(arrays[0]) : []; + } + var index = -1, + result = Array(length); + + while (++index < length) { + var array = arrays[index], + othIndex = -1; + + while (++othIndex < length) { + if (othIndex != index) { + result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator); + } + } + } + return baseUniq(baseFlatten(result, 1), iteratee, comparator); +} + +module.exports = baseXor; diff --git a/node_modules/lodash/_baseZipObject.js b/node_modules/lodash/_baseZipObject.js new file mode 100644 index 0000000..401f85b --- /dev/null +++ b/node_modules/lodash/_baseZipObject.js @@ -0,0 +1,23 @@ +/** + * This base implementation of `_.zipObject` which assigns values using `assignFunc`. + * + * @private + * @param {Array} props The property identifiers. + * @param {Array} values The property values. + * @param {Function} assignFunc The function to assign values. + * @returns {Object} Returns the new object. + */ +function baseZipObject(props, values, assignFunc) { + var index = -1, + length = props.length, + valsLength = values.length, + result = {}; + + while (++index < length) { + var value = index < valsLength ? values[index] : undefined; + assignFunc(result, props[index], value); + } + return result; +} + +module.exports = baseZipObject; diff --git a/node_modules/lodash/_cacheHas.js b/node_modules/lodash/_cacheHas.js new file mode 100644 index 0000000..2dec892 --- /dev/null +++ b/node_modules/lodash/_cacheHas.js @@ -0,0 +1,13 @@ +/** + * Checks if a `cache` value for `key` exists. + * + * @private + * @param {Object} cache The cache to query. + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function cacheHas(cache, key) { + return cache.has(key); +} + +module.exports = cacheHas; diff --git a/node_modules/lodash/_castArrayLikeObject.js b/node_modules/lodash/_castArrayLikeObject.js new file mode 100644 index 0000000..92c75fa --- /dev/null +++ b/node_modules/lodash/_castArrayLikeObject.js @@ -0,0 +1,14 @@ +var isArrayLikeObject = require('./isArrayLikeObject'); + +/** + * Casts `value` to an empty array if it's not an array like object. + * + * @private + * @param {*} value The value to inspect. + * @returns {Array|Object} Returns the cast array-like object. + */ +function castArrayLikeObject(value) { + return isArrayLikeObject(value) ? value : []; +} + +module.exports = castArrayLikeObject; diff --git a/node_modules/lodash/_castFunction.js b/node_modules/lodash/_castFunction.js new file mode 100644 index 0000000..98c91ae --- /dev/null +++ b/node_modules/lodash/_castFunction.js @@ -0,0 +1,14 @@ +var identity = require('./identity'); + +/** + * Casts `value` to `identity` if it's not a function. + * + * @private + * @param {*} value The value to inspect. + * @returns {Function} Returns cast function. + */ +function castFunction(value) { + return typeof value == 'function' ? value : identity; +} + +module.exports = castFunction; diff --git a/node_modules/lodash/_castPath.js b/node_modules/lodash/_castPath.js new file mode 100644 index 0000000..017e4c1 --- /dev/null +++ b/node_modules/lodash/_castPath.js @@ -0,0 +1,21 @@ +var isArray = require('./isArray'), + isKey = require('./_isKey'), + stringToPath = require('./_stringToPath'), + toString = require('./toString'); + +/** + * Casts `value` to a path array if it's not one. + * + * @private + * @param {*} value The value to inspect. + * @param {Object} [object] The object to query keys on. + * @returns {Array} Returns the cast property path array. + */ +function castPath(value, object) { + if (isArray(value)) { + return value; + } + return isKey(value, object) ? [value] : stringToPath(toString(value)); +} + +module.exports = castPath; diff --git a/node_modules/lodash/_castRest.js b/node_modules/lodash/_castRest.js new file mode 100644 index 0000000..213c66f --- /dev/null +++ b/node_modules/lodash/_castRest.js @@ -0,0 +1,14 @@ +var baseRest = require('./_baseRest'); + +/** + * A `baseRest` alias which can be replaced with `identity` by module + * replacement plugins. + * + * @private + * @type {Function} + * @param {Function} func The function to apply a rest parameter to. + * @returns {Function} Returns the new function. + */ +var castRest = baseRest; + +module.exports = castRest; diff --git a/node_modules/lodash/_castSlice.js b/node_modules/lodash/_castSlice.js new file mode 100644 index 0000000..071faeb --- /dev/null +++ b/node_modules/lodash/_castSlice.js @@ -0,0 +1,18 @@ +var baseSlice = require('./_baseSlice'); + +/** + * Casts `array` to a slice if it's needed. + * + * @private + * @param {Array} array The array to inspect. + * @param {number} start The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the cast slice. + */ +function castSlice(array, start, end) { + var length = array.length; + end = end === undefined ? length : end; + return (!start && end >= length) ? array : baseSlice(array, start, end); +} + +module.exports = castSlice; diff --git a/node_modules/lodash/_charsEndIndex.js b/node_modules/lodash/_charsEndIndex.js new file mode 100644 index 0000000..07908ff --- /dev/null +++ b/node_modules/lodash/_charsEndIndex.js @@ -0,0 +1,19 @@ +var baseIndexOf = require('./_baseIndexOf'); + +/** + * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol + * that is not found in the character symbols. + * + * @private + * @param {Array} strSymbols The string symbols to inspect. + * @param {Array} chrSymbols The character symbols to find. + * @returns {number} Returns the index of the last unmatched string symbol. + */ +function charsEndIndex(strSymbols, chrSymbols) { + var index = strSymbols.length; + + while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} + return index; +} + +module.exports = charsEndIndex; diff --git a/node_modules/lodash/_charsStartIndex.js b/node_modules/lodash/_charsStartIndex.js new file mode 100644 index 0000000..b17afd2 --- /dev/null +++ b/node_modules/lodash/_charsStartIndex.js @@ -0,0 +1,20 @@ +var baseIndexOf = require('./_baseIndexOf'); + +/** + * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol + * that is not found in the character symbols. + * + * @private + * @param {Array} strSymbols The string symbols to inspect. + * @param {Array} chrSymbols The character symbols to find. + * @returns {number} Returns the index of the first unmatched string symbol. + */ +function charsStartIndex(strSymbols, chrSymbols) { + var index = -1, + length = strSymbols.length; + + while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} + return index; +} + +module.exports = charsStartIndex; diff --git a/node_modules/lodash/_cloneArrayBuffer.js b/node_modules/lodash/_cloneArrayBuffer.js new file mode 100644 index 0000000..c3d8f6e --- /dev/null +++ b/node_modules/lodash/_cloneArrayBuffer.js @@ -0,0 +1,16 @@ +var Uint8Array = require('./_Uint8Array'); + +/** + * Creates a clone of `arrayBuffer`. + * + * @private + * @param {ArrayBuffer} arrayBuffer The array buffer to clone. + * @returns {ArrayBuffer} Returns the cloned array buffer. + */ +function cloneArrayBuffer(arrayBuffer) { + var result = new arrayBuffer.constructor(arrayBuffer.byteLength); + new Uint8Array(result).set(new Uint8Array(arrayBuffer)); + return result; +} + +module.exports = cloneArrayBuffer; diff --git a/node_modules/lodash/_cloneBuffer.js b/node_modules/lodash/_cloneBuffer.js new file mode 100644 index 0000000..27c4810 --- /dev/null +++ b/node_modules/lodash/_cloneBuffer.js @@ -0,0 +1,35 @@ +var root = require('./_root'); + +/** Detect free variable `exports`. */ +var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; + +/** Detect free variable `module`. */ +var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; + +/** Detect the popular CommonJS extension `module.exports`. */ +var moduleExports = freeModule && freeModule.exports === freeExports; + +/** Built-in value references. */ +var Buffer = moduleExports ? root.Buffer : undefined, + allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined; + +/** + * Creates a clone of `buffer`. + * + * @private + * @param {Buffer} buffer The buffer to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Buffer} Returns the cloned buffer. + */ +function cloneBuffer(buffer, isDeep) { + if (isDeep) { + return buffer.slice(); + } + var length = buffer.length, + result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); + + buffer.copy(result); + return result; +} + +module.exports = cloneBuffer; diff --git a/node_modules/lodash/_cloneDataView.js b/node_modules/lodash/_cloneDataView.js new file mode 100644 index 0000000..9c9b7b0 --- /dev/null +++ b/node_modules/lodash/_cloneDataView.js @@ -0,0 +1,16 @@ +var cloneArrayBuffer = require('./_cloneArrayBuffer'); + +/** + * Creates a clone of `dataView`. + * + * @private + * @param {Object} dataView The data view to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned data view. + */ +function cloneDataView(dataView, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; + return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); +} + +module.exports = cloneDataView; diff --git a/node_modules/lodash/_cloneRegExp.js b/node_modules/lodash/_cloneRegExp.js new file mode 100644 index 0000000..64a30df --- /dev/null +++ b/node_modules/lodash/_cloneRegExp.js @@ -0,0 +1,17 @@ +/** Used to match `RegExp` flags from their coerced string values. */ +var reFlags = /\w*$/; + +/** + * Creates a clone of `regexp`. + * + * @private + * @param {Object} regexp The regexp to clone. + * @returns {Object} Returns the cloned regexp. + */ +function cloneRegExp(regexp) { + var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); + result.lastIndex = regexp.lastIndex; + return result; +} + +module.exports = cloneRegExp; diff --git a/node_modules/lodash/_cloneSymbol.js b/node_modules/lodash/_cloneSymbol.js new file mode 100644 index 0000000..bede39f --- /dev/null +++ b/node_modules/lodash/_cloneSymbol.js @@ -0,0 +1,18 @@ +var Symbol = require('./_Symbol'); + +/** Used to convert symbols to primitives and strings. */ +var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolValueOf = symbolProto ? symbolProto.valueOf : undefined; + +/** + * Creates a clone of the `symbol` object. + * + * @private + * @param {Object} symbol The symbol object to clone. + * @returns {Object} Returns the cloned symbol object. + */ +function cloneSymbol(symbol) { + return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; +} + +module.exports = cloneSymbol; diff --git a/node_modules/lodash/_cloneTypedArray.js b/node_modules/lodash/_cloneTypedArray.js new file mode 100644 index 0000000..7aad84d --- /dev/null +++ b/node_modules/lodash/_cloneTypedArray.js @@ -0,0 +1,16 @@ +var cloneArrayBuffer = require('./_cloneArrayBuffer'); + +/** + * Creates a clone of `typedArray`. + * + * @private + * @param {Object} typedArray The typed array to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned typed array. + */ +function cloneTypedArray(typedArray, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; + return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); +} + +module.exports = cloneTypedArray; diff --git a/node_modules/lodash/_compareAscending.js b/node_modules/lodash/_compareAscending.js new file mode 100644 index 0000000..8dc2791 --- /dev/null +++ b/node_modules/lodash/_compareAscending.js @@ -0,0 +1,41 @@ +var isSymbol = require('./isSymbol'); + +/** + * Compares values to sort them in ascending order. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {number} Returns the sort order indicator for `value`. + */ +function compareAscending(value, other) { + if (value !== other) { + var valIsDefined = value !== undefined, + valIsNull = value === null, + valIsReflexive = value === value, + valIsSymbol = isSymbol(value); + + var othIsDefined = other !== undefined, + othIsNull = other === null, + othIsReflexive = other === other, + othIsSymbol = isSymbol(other); + + if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) || + (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) || + (valIsNull && othIsDefined && othIsReflexive) || + (!valIsDefined && othIsReflexive) || + !valIsReflexive) { + return 1; + } + if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) || + (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) || + (othIsNull && valIsDefined && valIsReflexive) || + (!othIsDefined && valIsReflexive) || + !othIsReflexive) { + return -1; + } + } + return 0; +} + +module.exports = compareAscending; diff --git a/node_modules/lodash/_compareMultiple.js b/node_modules/lodash/_compareMultiple.js new file mode 100644 index 0000000..ad61f0f --- /dev/null +++ b/node_modules/lodash/_compareMultiple.js @@ -0,0 +1,44 @@ +var compareAscending = require('./_compareAscending'); + +/** + * Used by `_.orderBy` to compare multiple properties of a value to another + * and stable sort them. + * + * If `orders` is unspecified, all values are sorted in ascending order. Otherwise, + * specify an order of "desc" for descending or "asc" for ascending sort order + * of corresponding values. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {boolean[]|string[]} orders The order to sort by for each property. + * @returns {number} Returns the sort order indicator for `object`. + */ +function compareMultiple(object, other, orders) { + var index = -1, + objCriteria = object.criteria, + othCriteria = other.criteria, + length = objCriteria.length, + ordersLength = orders.length; + + while (++index < length) { + var result = compareAscending(objCriteria[index], othCriteria[index]); + if (result) { + if (index >= ordersLength) { + return result; + } + var order = orders[index]; + return result * (order == 'desc' ? -1 : 1); + } + } + // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications + // that causes it, under certain circumstances, to provide the same value for + // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247 + // for more details. + // + // This also ensures a stable sort in V8 and other engines. + // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details. + return object.index - other.index; +} + +module.exports = compareMultiple; diff --git a/node_modules/lodash/_composeArgs.js b/node_modules/lodash/_composeArgs.js new file mode 100644 index 0000000..1ce40f4 --- /dev/null +++ b/node_modules/lodash/_composeArgs.js @@ -0,0 +1,39 @@ +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max; + +/** + * Creates an array that is the composition of partially applied arguments, + * placeholders, and provided arguments into a single array of arguments. + * + * @private + * @param {Array} args The provided arguments. + * @param {Array} partials The arguments to prepend to those provided. + * @param {Array} holders The `partials` placeholder indexes. + * @params {boolean} [isCurried] Specify composing for a curried function. + * @returns {Array} Returns the new array of composed arguments. + */ +function composeArgs(args, partials, holders, isCurried) { + var argsIndex = -1, + argsLength = args.length, + holdersLength = holders.length, + leftIndex = -1, + leftLength = partials.length, + rangeLength = nativeMax(argsLength - holdersLength, 0), + result = Array(leftLength + rangeLength), + isUncurried = !isCurried; + + while (++leftIndex < leftLength) { + result[leftIndex] = partials[leftIndex]; + } + while (++argsIndex < holdersLength) { + if (isUncurried || argsIndex < argsLength) { + result[holders[argsIndex]] = args[argsIndex]; + } + } + while (rangeLength--) { + result[leftIndex++] = args[argsIndex++]; + } + return result; +} + +module.exports = composeArgs; diff --git a/node_modules/lodash/_composeArgsRight.js b/node_modules/lodash/_composeArgsRight.js new file mode 100644 index 0000000..8dc588d --- /dev/null +++ b/node_modules/lodash/_composeArgsRight.js @@ -0,0 +1,41 @@ +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max; + +/** + * This function is like `composeArgs` except that the arguments composition + * is tailored for `_.partialRight`. + * + * @private + * @param {Array} args The provided arguments. + * @param {Array} partials The arguments to append to those provided. + * @param {Array} holders The `partials` placeholder indexes. + * @params {boolean} [isCurried] Specify composing for a curried function. + * @returns {Array} Returns the new array of composed arguments. + */ +function composeArgsRight(args, partials, holders, isCurried) { + var argsIndex = -1, + argsLength = args.length, + holdersIndex = -1, + holdersLength = holders.length, + rightIndex = -1, + rightLength = partials.length, + rangeLength = nativeMax(argsLength - holdersLength, 0), + result = Array(rangeLength + rightLength), + isUncurried = !isCurried; + + while (++argsIndex < rangeLength) { + result[argsIndex] = args[argsIndex]; + } + var offset = argsIndex; + while (++rightIndex < rightLength) { + result[offset + rightIndex] = partials[rightIndex]; + } + while (++holdersIndex < holdersLength) { + if (isUncurried || argsIndex < argsLength) { + result[offset + holders[holdersIndex]] = args[argsIndex++]; + } + } + return result; +} + +module.exports = composeArgsRight; diff --git a/node_modules/lodash/_copyArray.js b/node_modules/lodash/_copyArray.js new file mode 100644 index 0000000..cd94d5d --- /dev/null +++ b/node_modules/lodash/_copyArray.js @@ -0,0 +1,20 @@ +/** + * Copies the values of `source` to `array`. + * + * @private + * @param {Array} source The array to copy values from. + * @param {Array} [array=[]] The array to copy values to. + * @returns {Array} Returns `array`. + */ +function copyArray(source, array) { + var index = -1, + length = source.length; + + array || (array = Array(length)); + while (++index < length) { + array[index] = source[index]; + } + return array; +} + +module.exports = copyArray; diff --git a/node_modules/lodash/_copyObject.js b/node_modules/lodash/_copyObject.js new file mode 100644 index 0000000..2f2a5c2 --- /dev/null +++ b/node_modules/lodash/_copyObject.js @@ -0,0 +1,40 @@ +var assignValue = require('./_assignValue'), + baseAssignValue = require('./_baseAssignValue'); + +/** + * Copies properties of `source` to `object`. + * + * @private + * @param {Object} source The object to copy properties from. + * @param {Array} props The property identifiers to copy. + * @param {Object} [object={}] The object to copy properties to. + * @param {Function} [customizer] The function to customize copied values. + * @returns {Object} Returns `object`. + */ +function copyObject(source, props, object, customizer) { + var isNew = !object; + object || (object = {}); + + var index = -1, + length = props.length; + + while (++index < length) { + var key = props[index]; + + var newValue = customizer + ? customizer(object[key], source[key], key, object, source) + : undefined; + + if (newValue === undefined) { + newValue = source[key]; + } + if (isNew) { + baseAssignValue(object, key, newValue); + } else { + assignValue(object, key, newValue); + } + } + return object; +} + +module.exports = copyObject; diff --git a/node_modules/lodash/_copySymbols.js b/node_modules/lodash/_copySymbols.js new file mode 100644 index 0000000..c35944a --- /dev/null +++ b/node_modules/lodash/_copySymbols.js @@ -0,0 +1,16 @@ +var copyObject = require('./_copyObject'), + getSymbols = require('./_getSymbols'); + +/** + * Copies own symbols of `source` to `object`. + * + * @private + * @param {Object} source The object to copy symbols from. + * @param {Object} [object={}] The object to copy symbols to. + * @returns {Object} Returns `object`. + */ +function copySymbols(source, object) { + return copyObject(source, getSymbols(source), object); +} + +module.exports = copySymbols; diff --git a/node_modules/lodash/_copySymbolsIn.js b/node_modules/lodash/_copySymbolsIn.js new file mode 100644 index 0000000..fdf20a7 --- /dev/null +++ b/node_modules/lodash/_copySymbolsIn.js @@ -0,0 +1,16 @@ +var copyObject = require('./_copyObject'), + getSymbolsIn = require('./_getSymbolsIn'); + +/** + * Copies own and inherited symbols of `source` to `object`. + * + * @private + * @param {Object} source The object to copy symbols from. + * @param {Object} [object={}] The object to copy symbols to. + * @returns {Object} Returns `object`. + */ +function copySymbolsIn(source, object) { + return copyObject(source, getSymbolsIn(source), object); +} + +module.exports = copySymbolsIn; diff --git a/node_modules/lodash/_coreJsData.js b/node_modules/lodash/_coreJsData.js new file mode 100644 index 0000000..f8e5b4e --- /dev/null +++ b/node_modules/lodash/_coreJsData.js @@ -0,0 +1,6 @@ +var root = require('./_root'); + +/** Used to detect overreaching core-js shims. */ +var coreJsData = root['__core-js_shared__']; + +module.exports = coreJsData; diff --git a/node_modules/lodash/_countHolders.js b/node_modules/lodash/_countHolders.js new file mode 100644 index 0000000..718fcda --- /dev/null +++ b/node_modules/lodash/_countHolders.js @@ -0,0 +1,21 @@ +/** + * Gets the number of `placeholder` occurrences in `array`. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} placeholder The placeholder to search for. + * @returns {number} Returns the placeholder count. + */ +function countHolders(array, placeholder) { + var length = array.length, + result = 0; + + while (length--) { + if (array[length] === placeholder) { + ++result; + } + } + return result; +} + +module.exports = countHolders; diff --git a/node_modules/lodash/_createAggregator.js b/node_modules/lodash/_createAggregator.js new file mode 100644 index 0000000..0be42c4 --- /dev/null +++ b/node_modules/lodash/_createAggregator.js @@ -0,0 +1,23 @@ +var arrayAggregator = require('./_arrayAggregator'), + baseAggregator = require('./_baseAggregator'), + baseIteratee = require('./_baseIteratee'), + isArray = require('./isArray'); + +/** + * Creates a function like `_.groupBy`. + * + * @private + * @param {Function} setter The function to set accumulator values. + * @param {Function} [initializer] The accumulator object initializer. + * @returns {Function} Returns the new aggregator function. + */ +function createAggregator(setter, initializer) { + return function(collection, iteratee) { + var func = isArray(collection) ? arrayAggregator : baseAggregator, + accumulator = initializer ? initializer() : {}; + + return func(collection, setter, baseIteratee(iteratee, 2), accumulator); + }; +} + +module.exports = createAggregator; diff --git a/node_modules/lodash/_createAssigner.js b/node_modules/lodash/_createAssigner.js new file mode 100644 index 0000000..1f904c5 --- /dev/null +++ b/node_modules/lodash/_createAssigner.js @@ -0,0 +1,37 @@ +var baseRest = require('./_baseRest'), + isIterateeCall = require('./_isIterateeCall'); + +/** + * Creates a function like `_.assign`. + * + * @private + * @param {Function} assigner The function to assign values. + * @returns {Function} Returns the new assigner function. + */ +function createAssigner(assigner) { + return baseRest(function(object, sources) { + var index = -1, + length = sources.length, + customizer = length > 1 ? sources[length - 1] : undefined, + guard = length > 2 ? sources[2] : undefined; + + customizer = (assigner.length > 3 && typeof customizer == 'function') + ? (length--, customizer) + : undefined; + + if (guard && isIterateeCall(sources[0], sources[1], guard)) { + customizer = length < 3 ? undefined : customizer; + length = 1; + } + object = Object(object); + while (++index < length) { + var source = sources[index]; + if (source) { + assigner(object, source, index, customizer); + } + } + return object; + }); +} + +module.exports = createAssigner; diff --git a/node_modules/lodash/_createBaseEach.js b/node_modules/lodash/_createBaseEach.js new file mode 100644 index 0000000..d24fdd1 --- /dev/null +++ b/node_modules/lodash/_createBaseEach.js @@ -0,0 +1,32 @@ +var isArrayLike = require('./isArrayLike'); + +/** + * Creates a `baseEach` or `baseEachRight` function. + * + * @private + * @param {Function} eachFunc The function to iterate over a collection. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ +function createBaseEach(eachFunc, fromRight) { + return function(collection, iteratee) { + if (collection == null) { + return collection; + } + if (!isArrayLike(collection)) { + return eachFunc(collection, iteratee); + } + var length = collection.length, + index = fromRight ? length : -1, + iterable = Object(collection); + + while ((fromRight ? index-- : ++index < length)) { + if (iteratee(iterable[index], index, iterable) === false) { + break; + } + } + return collection; + }; +} + +module.exports = createBaseEach; diff --git a/node_modules/lodash/_createBaseFor.js b/node_modules/lodash/_createBaseFor.js new file mode 100644 index 0000000..94cbf29 --- /dev/null +++ b/node_modules/lodash/_createBaseFor.js @@ -0,0 +1,25 @@ +/** + * Creates a base function for methods like `_.forIn` and `_.forOwn`. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ +function createBaseFor(fromRight) { + return function(object, iteratee, keysFunc) { + var index = -1, + iterable = Object(object), + props = keysFunc(object), + length = props.length; + + while (length--) { + var key = props[fromRight ? length : ++index]; + if (iteratee(iterable[key], key, iterable) === false) { + break; + } + } + return object; + }; +} + +module.exports = createBaseFor; diff --git a/node_modules/lodash/_createBind.js b/node_modules/lodash/_createBind.js new file mode 100644 index 0000000..07cb99f --- /dev/null +++ b/node_modules/lodash/_createBind.js @@ -0,0 +1,28 @@ +var createCtor = require('./_createCtor'), + root = require('./_root'); + +/** Used to compose bitmasks for function metadata. */ +var WRAP_BIND_FLAG = 1; + +/** + * Creates a function that wraps `func` to invoke it with the optional `this` + * binding of `thisArg`. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {*} [thisArg] The `this` binding of `func`. + * @returns {Function} Returns the new wrapped function. + */ +function createBind(func, bitmask, thisArg) { + var isBind = bitmask & WRAP_BIND_FLAG, + Ctor = createCtor(func); + + function wrapper() { + var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; + return fn.apply(isBind ? thisArg : this, arguments); + } + return wrapper; +} + +module.exports = createBind; diff --git a/node_modules/lodash/_createCaseFirst.js b/node_modules/lodash/_createCaseFirst.js new file mode 100644 index 0000000..fe8ea48 --- /dev/null +++ b/node_modules/lodash/_createCaseFirst.js @@ -0,0 +1,33 @@ +var castSlice = require('./_castSlice'), + hasUnicode = require('./_hasUnicode'), + stringToArray = require('./_stringToArray'), + toString = require('./toString'); + +/** + * Creates a function like `_.lowerFirst`. + * + * @private + * @param {string} methodName The name of the `String` case method to use. + * @returns {Function} Returns the new case function. + */ +function createCaseFirst(methodName) { + return function(string) { + string = toString(string); + + var strSymbols = hasUnicode(string) + ? stringToArray(string) + : undefined; + + var chr = strSymbols + ? strSymbols[0] + : string.charAt(0); + + var trailing = strSymbols + ? castSlice(strSymbols, 1).join('') + : string.slice(1); + + return chr[methodName]() + trailing; + }; +} + +module.exports = createCaseFirst; diff --git a/node_modules/lodash/_createCompounder.js b/node_modules/lodash/_createCompounder.js new file mode 100644 index 0000000..8d4cee2 --- /dev/null +++ b/node_modules/lodash/_createCompounder.js @@ -0,0 +1,24 @@ +var arrayReduce = require('./_arrayReduce'), + deburr = require('./deburr'), + words = require('./words'); + +/** Used to compose unicode capture groups. */ +var rsApos = "['\u2019]"; + +/** Used to match apostrophes. */ +var reApos = RegExp(rsApos, 'g'); + +/** + * Creates a function like `_.camelCase`. + * + * @private + * @param {Function} callback The function to combine each word. + * @returns {Function} Returns the new compounder function. + */ +function createCompounder(callback) { + return function(string) { + return arrayReduce(words(deburr(string).replace(reApos, '')), callback, ''); + }; +} + +module.exports = createCompounder; diff --git a/node_modules/lodash/_createCtor.js b/node_modules/lodash/_createCtor.js new file mode 100644 index 0000000..9047aa5 --- /dev/null +++ b/node_modules/lodash/_createCtor.js @@ -0,0 +1,37 @@ +var baseCreate = require('./_baseCreate'), + isObject = require('./isObject'); + +/** + * Creates a function that produces an instance of `Ctor` regardless of + * whether it was invoked as part of a `new` expression or by `call` or `apply`. + * + * @private + * @param {Function} Ctor The constructor to wrap. + * @returns {Function} Returns the new wrapped function. + */ +function createCtor(Ctor) { + return function() { + // Use a `switch` statement to work with class constructors. See + // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist + // for more details. + var args = arguments; + switch (args.length) { + case 0: return new Ctor; + case 1: return new Ctor(args[0]); + case 2: return new Ctor(args[0], args[1]); + case 3: return new Ctor(args[0], args[1], args[2]); + case 4: return new Ctor(args[0], args[1], args[2], args[3]); + case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]); + case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]); + case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]); + } + var thisBinding = baseCreate(Ctor.prototype), + result = Ctor.apply(thisBinding, args); + + // Mimic the constructor's `return` behavior. + // See https://es5.github.io/#x13.2.2 for more details. + return isObject(result) ? result : thisBinding; + }; +} + +module.exports = createCtor; diff --git a/node_modules/lodash/_createCurry.js b/node_modules/lodash/_createCurry.js new file mode 100644 index 0000000..f06c2cd --- /dev/null +++ b/node_modules/lodash/_createCurry.js @@ -0,0 +1,46 @@ +var apply = require('./_apply'), + createCtor = require('./_createCtor'), + createHybrid = require('./_createHybrid'), + createRecurry = require('./_createRecurry'), + getHolder = require('./_getHolder'), + replaceHolders = require('./_replaceHolders'), + root = require('./_root'); + +/** + * Creates a function that wraps `func` to enable currying. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {number} arity The arity of `func`. + * @returns {Function} Returns the new wrapped function. + */ +function createCurry(func, bitmask, arity) { + var Ctor = createCtor(func); + + function wrapper() { + var length = arguments.length, + args = Array(length), + index = length, + placeholder = getHolder(wrapper); + + while (index--) { + args[index] = arguments[index]; + } + var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder) + ? [] + : replaceHolders(args, placeholder); + + length -= holders.length; + if (length < arity) { + return createRecurry( + func, bitmask, createHybrid, wrapper.placeholder, undefined, + args, holders, undefined, undefined, arity - length); + } + var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; + return apply(fn, this, args); + } + return wrapper; +} + +module.exports = createCurry; diff --git a/node_modules/lodash/_createFind.js b/node_modules/lodash/_createFind.js new file mode 100644 index 0000000..8859ff8 --- /dev/null +++ b/node_modules/lodash/_createFind.js @@ -0,0 +1,25 @@ +var baseIteratee = require('./_baseIteratee'), + isArrayLike = require('./isArrayLike'), + keys = require('./keys'); + +/** + * Creates a `_.find` or `_.findLast` function. + * + * @private + * @param {Function} findIndexFunc The function to find the collection index. + * @returns {Function} Returns the new find function. + */ +function createFind(findIndexFunc) { + return function(collection, predicate, fromIndex) { + var iterable = Object(collection); + if (!isArrayLike(collection)) { + var iteratee = baseIteratee(predicate, 3); + collection = keys(collection); + predicate = function(key) { return iteratee(iterable[key], key, iterable); }; + } + var index = findIndexFunc(collection, predicate, fromIndex); + return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined; + }; +} + +module.exports = createFind; diff --git a/node_modules/lodash/_createFlow.js b/node_modules/lodash/_createFlow.js new file mode 100644 index 0000000..baaddbf --- /dev/null +++ b/node_modules/lodash/_createFlow.js @@ -0,0 +1,78 @@ +var LodashWrapper = require('./_LodashWrapper'), + flatRest = require('./_flatRest'), + getData = require('./_getData'), + getFuncName = require('./_getFuncName'), + isArray = require('./isArray'), + isLaziable = require('./_isLaziable'); + +/** Error message constants. */ +var FUNC_ERROR_TEXT = 'Expected a function'; + +/** Used to compose bitmasks for function metadata. */ +var WRAP_CURRY_FLAG = 8, + WRAP_PARTIAL_FLAG = 32, + WRAP_ARY_FLAG = 128, + WRAP_REARG_FLAG = 256; + +/** + * Creates a `_.flow` or `_.flowRight` function. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new flow function. + */ +function createFlow(fromRight) { + return flatRest(function(funcs) { + var length = funcs.length, + index = length, + prereq = LodashWrapper.prototype.thru; + + if (fromRight) { + funcs.reverse(); + } + while (index--) { + var func = funcs[index]; + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + if (prereq && !wrapper && getFuncName(func) == 'wrapper') { + var wrapper = new LodashWrapper([], true); + } + } + index = wrapper ? index : length; + while (++index < length) { + func = funcs[index]; + + var funcName = getFuncName(func), + data = funcName == 'wrapper' ? getData(func) : undefined; + + if (data && isLaziable(data[0]) && + data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) && + !data[4].length && data[9] == 1 + ) { + wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]); + } else { + wrapper = (func.length == 1 && isLaziable(func)) + ? wrapper[funcName]() + : wrapper.thru(func); + } + } + return function() { + var args = arguments, + value = args[0]; + + if (wrapper && args.length == 1 && isArray(value)) { + return wrapper.plant(value).value(); + } + var index = 0, + result = length ? funcs[index].apply(this, args) : value; + + while (++index < length) { + result = funcs[index].call(this, result); + } + return result; + }; + }); +} + +module.exports = createFlow; diff --git a/node_modules/lodash/_createHybrid.js b/node_modules/lodash/_createHybrid.js new file mode 100644 index 0000000..b671bd1 --- /dev/null +++ b/node_modules/lodash/_createHybrid.js @@ -0,0 +1,92 @@ +var composeArgs = require('./_composeArgs'), + composeArgsRight = require('./_composeArgsRight'), + countHolders = require('./_countHolders'), + createCtor = require('./_createCtor'), + createRecurry = require('./_createRecurry'), + getHolder = require('./_getHolder'), + reorder = require('./_reorder'), + replaceHolders = require('./_replaceHolders'), + root = require('./_root'); + +/** Used to compose bitmasks for function metadata. */ +var WRAP_BIND_FLAG = 1, + WRAP_BIND_KEY_FLAG = 2, + WRAP_CURRY_FLAG = 8, + WRAP_CURRY_RIGHT_FLAG = 16, + WRAP_ARY_FLAG = 128, + WRAP_FLIP_FLAG = 512; + +/** + * Creates a function that wraps `func` to invoke it with optional `this` + * binding of `thisArg`, partial application, and currying. + * + * @private + * @param {Function|string} func The function or method name to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {*} [thisArg] The `this` binding of `func`. + * @param {Array} [partials] The arguments to prepend to those provided to + * the new function. + * @param {Array} [holders] The `partials` placeholder indexes. + * @param {Array} [partialsRight] The arguments to append to those provided + * to the new function. + * @param {Array} [holdersRight] The `partialsRight` placeholder indexes. + * @param {Array} [argPos] The argument positions of the new function. + * @param {number} [ary] The arity cap of `func`. + * @param {number} [arity] The arity of `func`. + * @returns {Function} Returns the new wrapped function. + */ +function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) { + var isAry = bitmask & WRAP_ARY_FLAG, + isBind = bitmask & WRAP_BIND_FLAG, + isBindKey = bitmask & WRAP_BIND_KEY_FLAG, + isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG), + isFlip = bitmask & WRAP_FLIP_FLAG, + Ctor = isBindKey ? undefined : createCtor(func); + + function wrapper() { + var length = arguments.length, + args = Array(length), + index = length; + + while (index--) { + args[index] = arguments[index]; + } + if (isCurried) { + var placeholder = getHolder(wrapper), + holdersCount = countHolders(args, placeholder); + } + if (partials) { + args = composeArgs(args, partials, holders, isCurried); + } + if (partialsRight) { + args = composeArgsRight(args, partialsRight, holdersRight, isCurried); + } + length -= holdersCount; + if (isCurried && length < arity) { + var newHolders = replaceHolders(args, placeholder); + return createRecurry( + func, bitmask, createHybrid, wrapper.placeholder, thisArg, + args, newHolders, argPos, ary, arity - length + ); + } + var thisBinding = isBind ? thisArg : this, + fn = isBindKey ? thisBinding[func] : func; + + length = args.length; + if (argPos) { + args = reorder(args, argPos); + } else if (isFlip && length > 1) { + args.reverse(); + } + if (isAry && ary < length) { + args.length = ary; + } + if (this && this !== root && this instanceof wrapper) { + fn = Ctor || createCtor(fn); + } + return fn.apply(thisBinding, args); + } + return wrapper; +} + +module.exports = createHybrid; diff --git a/node_modules/lodash/_createInverter.js b/node_modules/lodash/_createInverter.js new file mode 100644 index 0000000..6c0c562 --- /dev/null +++ b/node_modules/lodash/_createInverter.js @@ -0,0 +1,17 @@ +var baseInverter = require('./_baseInverter'); + +/** + * Creates a function like `_.invertBy`. + * + * @private + * @param {Function} setter The function to set accumulator values. + * @param {Function} toIteratee The function to resolve iteratees. + * @returns {Function} Returns the new inverter function. + */ +function createInverter(setter, toIteratee) { + return function(object, iteratee) { + return baseInverter(object, setter, toIteratee(iteratee), {}); + }; +} + +module.exports = createInverter; diff --git a/node_modules/lodash/_createMathOperation.js b/node_modules/lodash/_createMathOperation.js new file mode 100644 index 0000000..f1e238a --- /dev/null +++ b/node_modules/lodash/_createMathOperation.js @@ -0,0 +1,38 @@ +var baseToNumber = require('./_baseToNumber'), + baseToString = require('./_baseToString'); + +/** + * Creates a function that performs a mathematical operation on two values. + * + * @private + * @param {Function} operator The function to perform the operation. + * @param {number} [defaultValue] The value used for `undefined` arguments. + * @returns {Function} Returns the new mathematical operation function. + */ +function createMathOperation(operator, defaultValue) { + return function(value, other) { + var result; + if (value === undefined && other === undefined) { + return defaultValue; + } + if (value !== undefined) { + result = value; + } + if (other !== undefined) { + if (result === undefined) { + return other; + } + if (typeof value == 'string' || typeof other == 'string') { + value = baseToString(value); + other = baseToString(other); + } else { + value = baseToNumber(value); + other = baseToNumber(other); + } + result = operator(value, other); + } + return result; + }; +} + +module.exports = createMathOperation; diff --git a/node_modules/lodash/_createOver.js b/node_modules/lodash/_createOver.js new file mode 100644 index 0000000..3b94551 --- /dev/null +++ b/node_modules/lodash/_createOver.js @@ -0,0 +1,27 @@ +var apply = require('./_apply'), + arrayMap = require('./_arrayMap'), + baseIteratee = require('./_baseIteratee'), + baseRest = require('./_baseRest'), + baseUnary = require('./_baseUnary'), + flatRest = require('./_flatRest'); + +/** + * Creates a function like `_.over`. + * + * @private + * @param {Function} arrayFunc The function to iterate over iteratees. + * @returns {Function} Returns the new over function. + */ +function createOver(arrayFunc) { + return flatRest(function(iteratees) { + iteratees = arrayMap(iteratees, baseUnary(baseIteratee)); + return baseRest(function(args) { + var thisArg = this; + return arrayFunc(iteratees, function(iteratee) { + return apply(iteratee, thisArg, args); + }); + }); + }); +} + +module.exports = createOver; diff --git a/node_modules/lodash/_createPadding.js b/node_modules/lodash/_createPadding.js new file mode 100644 index 0000000..2124612 --- /dev/null +++ b/node_modules/lodash/_createPadding.js @@ -0,0 +1,33 @@ +var baseRepeat = require('./_baseRepeat'), + baseToString = require('./_baseToString'), + castSlice = require('./_castSlice'), + hasUnicode = require('./_hasUnicode'), + stringSize = require('./_stringSize'), + stringToArray = require('./_stringToArray'); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeCeil = Math.ceil; + +/** + * Creates the padding for `string` based on `length`. The `chars` string + * is truncated if the number of characters exceeds `length`. + * + * @private + * @param {number} length The padding length. + * @param {string} [chars=' '] The string used as padding. + * @returns {string} Returns the padding for `string`. + */ +function createPadding(length, chars) { + chars = chars === undefined ? ' ' : baseToString(chars); + + var charsLength = chars.length; + if (charsLength < 2) { + return charsLength ? baseRepeat(chars, length) : chars; + } + var result = baseRepeat(chars, nativeCeil(length / stringSize(chars))); + return hasUnicode(chars) + ? castSlice(stringToArray(result), 0, length).join('') + : result.slice(0, length); +} + +module.exports = createPadding; diff --git a/node_modules/lodash/_createPartial.js b/node_modules/lodash/_createPartial.js new file mode 100644 index 0000000..e16c248 --- /dev/null +++ b/node_modules/lodash/_createPartial.js @@ -0,0 +1,43 @@ +var apply = require('./_apply'), + createCtor = require('./_createCtor'), + root = require('./_root'); + +/** Used to compose bitmasks for function metadata. */ +var WRAP_BIND_FLAG = 1; + +/** + * Creates a function that wraps `func` to invoke it with the `this` binding + * of `thisArg` and `partials` prepended to the arguments it receives. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {*} thisArg The `this` binding of `func`. + * @param {Array} partials The arguments to prepend to those provided to + * the new function. + * @returns {Function} Returns the new wrapped function. + */ +function createPartial(func, bitmask, thisArg, partials) { + var isBind = bitmask & WRAP_BIND_FLAG, + Ctor = createCtor(func); + + function wrapper() { + var argsIndex = -1, + argsLength = arguments.length, + leftIndex = -1, + leftLength = partials.length, + args = Array(leftLength + argsLength), + fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; + + while (++leftIndex < leftLength) { + args[leftIndex] = partials[leftIndex]; + } + while (argsLength--) { + args[leftIndex++] = arguments[++argsIndex]; + } + return apply(fn, isBind ? thisArg : this, args); + } + return wrapper; +} + +module.exports = createPartial; diff --git a/node_modules/lodash/_createRange.js b/node_modules/lodash/_createRange.js new file mode 100644 index 0000000..9f52c77 --- /dev/null +++ b/node_modules/lodash/_createRange.js @@ -0,0 +1,30 @@ +var baseRange = require('./_baseRange'), + isIterateeCall = require('./_isIterateeCall'), + toFinite = require('./toFinite'); + +/** + * Creates a `_.range` or `_.rangeRight` function. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new range function. + */ +function createRange(fromRight) { + return function(start, end, step) { + if (step && typeof step != 'number' && isIterateeCall(start, end, step)) { + end = step = undefined; + } + // Ensure the sign of `-0` is preserved. + start = toFinite(start); + if (end === undefined) { + end = start; + start = 0; + } else { + end = toFinite(end); + } + step = step === undefined ? (start < end ? 1 : -1) : toFinite(step); + return baseRange(start, end, step, fromRight); + }; +} + +module.exports = createRange; diff --git a/node_modules/lodash/_createRecurry.js b/node_modules/lodash/_createRecurry.js new file mode 100644 index 0000000..eb29fb2 --- /dev/null +++ b/node_modules/lodash/_createRecurry.js @@ -0,0 +1,56 @@ +var isLaziable = require('./_isLaziable'), + setData = require('./_setData'), + setWrapToString = require('./_setWrapToString'); + +/** Used to compose bitmasks for function metadata. */ +var WRAP_BIND_FLAG = 1, + WRAP_BIND_KEY_FLAG = 2, + WRAP_CURRY_BOUND_FLAG = 4, + WRAP_CURRY_FLAG = 8, + WRAP_PARTIAL_FLAG = 32, + WRAP_PARTIAL_RIGHT_FLAG = 64; + +/** + * Creates a function that wraps `func` to continue currying. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {Function} wrapFunc The function to create the `func` wrapper. + * @param {*} placeholder The placeholder value. + * @param {*} [thisArg] The `this` binding of `func`. + * @param {Array} [partials] The arguments to prepend to those provided to + * the new function. + * @param {Array} [holders] The `partials` placeholder indexes. + * @param {Array} [argPos] The argument positions of the new function. + * @param {number} [ary] The arity cap of `func`. + * @param {number} [arity] The arity of `func`. + * @returns {Function} Returns the new wrapped function. + */ +function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) { + var isCurry = bitmask & WRAP_CURRY_FLAG, + newHolders = isCurry ? holders : undefined, + newHoldersRight = isCurry ? undefined : holders, + newPartials = isCurry ? partials : undefined, + newPartialsRight = isCurry ? undefined : partials; + + bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG); + bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG); + + if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) { + bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG); + } + var newData = [ + func, bitmask, thisArg, newPartials, newHolders, newPartialsRight, + newHoldersRight, argPos, ary, arity + ]; + + var result = wrapFunc.apply(undefined, newData); + if (isLaziable(func)) { + setData(result, newData); + } + result.placeholder = placeholder; + return setWrapToString(result, func, bitmask); +} + +module.exports = createRecurry; diff --git a/node_modules/lodash/_createRelationalOperation.js b/node_modules/lodash/_createRelationalOperation.js new file mode 100644 index 0000000..a17c6b5 --- /dev/null +++ b/node_modules/lodash/_createRelationalOperation.js @@ -0,0 +1,20 @@ +var toNumber = require('./toNumber'); + +/** + * Creates a function that performs a relational operation on two values. + * + * @private + * @param {Function} operator The function to perform the operation. + * @returns {Function} Returns the new relational operation function. + */ +function createRelationalOperation(operator) { + return function(value, other) { + if (!(typeof value == 'string' && typeof other == 'string')) { + value = toNumber(value); + other = toNumber(other); + } + return operator(value, other); + }; +} + +module.exports = createRelationalOperation; diff --git a/node_modules/lodash/_createRound.js b/node_modules/lodash/_createRound.js new file mode 100644 index 0000000..88be5df --- /dev/null +++ b/node_modules/lodash/_createRound.js @@ -0,0 +1,35 @@ +var root = require('./_root'), + toInteger = require('./toInteger'), + toNumber = require('./toNumber'), + toString = require('./toString'); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeIsFinite = root.isFinite, + nativeMin = Math.min; + +/** + * Creates a function like `_.round`. + * + * @private + * @param {string} methodName The name of the `Math` method to use when rounding. + * @returns {Function} Returns the new round function. + */ +function createRound(methodName) { + var func = Math[methodName]; + return function(number, precision) { + number = toNumber(number); + precision = precision == null ? 0 : nativeMin(toInteger(precision), 292); + if (precision && nativeIsFinite(number)) { + // Shift with exponential notation to avoid floating-point issues. + // See [MDN](https://mdn.io/round#Examples) for more details. + var pair = (toString(number) + 'e').split('e'), + value = func(pair[0] + 'e' + (+pair[1] + precision)); + + pair = (toString(value) + 'e').split('e'); + return +(pair[0] + 'e' + (+pair[1] - precision)); + } + return func(number); + }; +} + +module.exports = createRound; diff --git a/node_modules/lodash/_createSet.js b/node_modules/lodash/_createSet.js new file mode 100644 index 0000000..0f644ee --- /dev/null +++ b/node_modules/lodash/_createSet.js @@ -0,0 +1,19 @@ +var Set = require('./_Set'), + noop = require('./noop'), + setToArray = require('./_setToArray'); + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0; + +/** + * Creates a set object of `values`. + * + * @private + * @param {Array} values The values to add to the set. + * @returns {Object} Returns the new set. + */ +var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) { + return new Set(values); +}; + +module.exports = createSet; diff --git a/node_modules/lodash/_createToPairs.js b/node_modules/lodash/_createToPairs.js new file mode 100644 index 0000000..568417a --- /dev/null +++ b/node_modules/lodash/_createToPairs.js @@ -0,0 +1,30 @@ +var baseToPairs = require('./_baseToPairs'), + getTag = require('./_getTag'), + mapToArray = require('./_mapToArray'), + setToPairs = require('./_setToPairs'); + +/** `Object#toString` result references. */ +var mapTag = '[object Map]', + setTag = '[object Set]'; + +/** + * Creates a `_.toPairs` or `_.toPairsIn` function. + * + * @private + * @param {Function} keysFunc The function to get the keys of a given object. + * @returns {Function} Returns the new pairs function. + */ +function createToPairs(keysFunc) { + return function(object) { + var tag = getTag(object); + if (tag == mapTag) { + return mapToArray(object); + } + if (tag == setTag) { + return setToPairs(object); + } + return baseToPairs(object, keysFunc(object)); + }; +} + +module.exports = createToPairs; diff --git a/node_modules/lodash/_createWrap.js b/node_modules/lodash/_createWrap.js new file mode 100644 index 0000000..33f0633 --- /dev/null +++ b/node_modules/lodash/_createWrap.js @@ -0,0 +1,106 @@ +var baseSetData = require('./_baseSetData'), + createBind = require('./_createBind'), + createCurry = require('./_createCurry'), + createHybrid = require('./_createHybrid'), + createPartial = require('./_createPartial'), + getData = require('./_getData'), + mergeData = require('./_mergeData'), + setData = require('./_setData'), + setWrapToString = require('./_setWrapToString'), + toInteger = require('./toInteger'); + +/** Error message constants. */ +var FUNC_ERROR_TEXT = 'Expected a function'; + +/** Used to compose bitmasks for function metadata. */ +var WRAP_BIND_FLAG = 1, + WRAP_BIND_KEY_FLAG = 2, + WRAP_CURRY_FLAG = 8, + WRAP_CURRY_RIGHT_FLAG = 16, + WRAP_PARTIAL_FLAG = 32, + WRAP_PARTIAL_RIGHT_FLAG = 64; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max; + +/** + * Creates a function that either curries or invokes `func` with optional + * `this` binding and partially applied arguments. + * + * @private + * @param {Function|string} func The function or method name to wrap. + * @param {number} bitmask The bitmask flags. + * 1 - `_.bind` + * 2 - `_.bindKey` + * 4 - `_.curry` or `_.curryRight` of a bound function + * 8 - `_.curry` + * 16 - `_.curryRight` + * 32 - `_.partial` + * 64 - `_.partialRight` + * 128 - `_.rearg` + * 256 - `_.ary` + * 512 - `_.flip` + * @param {*} [thisArg] The `this` binding of `func`. + * @param {Array} [partials] The arguments to be partially applied. + * @param {Array} [holders] The `partials` placeholder indexes. + * @param {Array} [argPos] The argument positions of the new function. + * @param {number} [ary] The arity cap of `func`. + * @param {number} [arity] The arity of `func`. + * @returns {Function} Returns the new wrapped function. + */ +function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) { + var isBindKey = bitmask & WRAP_BIND_KEY_FLAG; + if (!isBindKey && typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + var length = partials ? partials.length : 0; + if (!length) { + bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG); + partials = holders = undefined; + } + ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0); + arity = arity === undefined ? arity : toInteger(arity); + length -= holders ? holders.length : 0; + + if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) { + var partialsRight = partials, + holdersRight = holders; + + partials = holders = undefined; + } + var data = isBindKey ? undefined : getData(func); + + var newData = [ + func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, + argPos, ary, arity + ]; + + if (data) { + mergeData(newData, data); + } + func = newData[0]; + bitmask = newData[1]; + thisArg = newData[2]; + partials = newData[3]; + holders = newData[4]; + arity = newData[9] = newData[9] === undefined + ? (isBindKey ? 0 : func.length) + : nativeMax(newData[9] - length, 0); + + if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) { + bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG); + } + if (!bitmask || bitmask == WRAP_BIND_FLAG) { + var result = createBind(func, bitmask, thisArg); + } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) { + result = createCurry(func, bitmask, arity); + } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) { + result = createPartial(func, bitmask, thisArg, partials); + } else { + result = createHybrid.apply(undefined, newData); + } + var setter = data ? baseSetData : setData; + return setWrapToString(setter(result, newData), func, bitmask); +} + +module.exports = createWrap; diff --git a/node_modules/lodash/_customDefaultsAssignIn.js b/node_modules/lodash/_customDefaultsAssignIn.js new file mode 100644 index 0000000..1f49e6f --- /dev/null +++ b/node_modules/lodash/_customDefaultsAssignIn.js @@ -0,0 +1,29 @@ +var eq = require('./eq'); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Used by `_.defaults` to customize its `_.assignIn` use to assign properties + * of source objects to the destination object for all destination properties + * that resolve to `undefined`. + * + * @private + * @param {*} objValue The destination value. + * @param {*} srcValue The source value. + * @param {string} key The key of the property to assign. + * @param {Object} object The parent object of `objValue`. + * @returns {*} Returns the value to assign. + */ +function customDefaultsAssignIn(objValue, srcValue, key, object) { + if (objValue === undefined || + (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) { + return srcValue; + } + return objValue; +} + +module.exports = customDefaultsAssignIn; diff --git a/node_modules/lodash/_customDefaultsMerge.js b/node_modules/lodash/_customDefaultsMerge.js new file mode 100644 index 0000000..4cab317 --- /dev/null +++ b/node_modules/lodash/_customDefaultsMerge.js @@ -0,0 +1,28 @@ +var baseMerge = require('./_baseMerge'), + isObject = require('./isObject'); + +/** + * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source + * objects into destination objects that are passed thru. + * + * @private + * @param {*} objValue The destination value. + * @param {*} srcValue The source value. + * @param {string} key The key of the property to merge. + * @param {Object} object The parent object of `objValue`. + * @param {Object} source The parent object of `srcValue`. + * @param {Object} [stack] Tracks traversed source values and their merged + * counterparts. + * @returns {*} Returns the value to assign. + */ +function customDefaultsMerge(objValue, srcValue, key, object, source, stack) { + if (isObject(objValue) && isObject(srcValue)) { + // Recursively merge objects and arrays (susceptible to call stack limits). + stack.set(srcValue, objValue); + baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack); + stack['delete'](srcValue); + } + return objValue; +} + +module.exports = customDefaultsMerge; diff --git a/node_modules/lodash/_customOmitClone.js b/node_modules/lodash/_customOmitClone.js new file mode 100644 index 0000000..968db2e --- /dev/null +++ b/node_modules/lodash/_customOmitClone.js @@ -0,0 +1,16 @@ +var isPlainObject = require('./isPlainObject'); + +/** + * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain + * objects. + * + * @private + * @param {*} value The value to inspect. + * @param {string} key The key of the property to inspect. + * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`. + */ +function customOmitClone(value) { + return isPlainObject(value) ? undefined : value; +} + +module.exports = customOmitClone; diff --git a/node_modules/lodash/_deburrLetter.js b/node_modules/lodash/_deburrLetter.js new file mode 100644 index 0000000..3e531ed --- /dev/null +++ b/node_modules/lodash/_deburrLetter.js @@ -0,0 +1,71 @@ +var basePropertyOf = require('./_basePropertyOf'); + +/** Used to map Latin Unicode letters to basic Latin letters. */ +var deburredLetters = { + // Latin-1 Supplement block. + '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A', + '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a', + '\xc7': 'C', '\xe7': 'c', + '\xd0': 'D', '\xf0': 'd', + '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E', + '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e', + '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I', + '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i', + '\xd1': 'N', '\xf1': 'n', + '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O', + '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o', + '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U', + '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u', + '\xdd': 'Y', '\xfd': 'y', '\xff': 'y', + '\xc6': 'Ae', '\xe6': 'ae', + '\xde': 'Th', '\xfe': 'th', + '\xdf': 'ss', + // Latin Extended-A block. + '\u0100': 'A', '\u0102': 'A', '\u0104': 'A', + '\u0101': 'a', '\u0103': 'a', '\u0105': 'a', + '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C', + '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c', + '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd', + '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E', + '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e', + '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G', + '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g', + '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h', + '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I', + '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i', + '\u0134': 'J', '\u0135': 'j', + '\u0136': 'K', '\u0137': 'k', '\u0138': 'k', + '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L', + '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l', + '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N', + '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n', + '\u014c': 'O', '\u014e': 'O', '\u0150': 'O', + '\u014d': 'o', '\u014f': 'o', '\u0151': 'o', + '\u0154': 'R', '\u0156': 'R', '\u0158': 'R', + '\u0155': 'r', '\u0157': 'r', '\u0159': 'r', + '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S', + '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's', + '\u0162': 'T', '\u0164': 'T', '\u0166': 'T', + '\u0163': 't', '\u0165': 't', '\u0167': 't', + '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U', + '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u', + '\u0174': 'W', '\u0175': 'w', + '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y', + '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z', + '\u017a': 'z', '\u017c': 'z', '\u017e': 'z', + '\u0132': 'IJ', '\u0133': 'ij', + '\u0152': 'Oe', '\u0153': 'oe', + '\u0149': "'n", '\u017f': 's' +}; + +/** + * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A + * letters to basic Latin letters. + * + * @private + * @param {string} letter The matched letter to deburr. + * @returns {string} Returns the deburred letter. + */ +var deburrLetter = basePropertyOf(deburredLetters); + +module.exports = deburrLetter; diff --git a/node_modules/lodash/_defineProperty.js b/node_modules/lodash/_defineProperty.js new file mode 100644 index 0000000..b6116d9 --- /dev/null +++ b/node_modules/lodash/_defineProperty.js @@ -0,0 +1,11 @@ +var getNative = require('./_getNative'); + +var defineProperty = (function() { + try { + var func = getNative(Object, 'defineProperty'); + func({}, '', {}); + return func; + } catch (e) {} +}()); + +module.exports = defineProperty; diff --git a/node_modules/lodash/_equalArrays.js b/node_modules/lodash/_equalArrays.js new file mode 100644 index 0000000..824228c --- /dev/null +++ b/node_modules/lodash/_equalArrays.js @@ -0,0 +1,84 @@ +var SetCache = require('./_SetCache'), + arraySome = require('./_arraySome'), + cacheHas = require('./_cacheHas'); + +/** Used to compose bitmasks for value comparisons. */ +var COMPARE_PARTIAL_FLAG = 1, + COMPARE_UNORDERED_FLAG = 2; + +/** + * A specialized version of `baseIsEqualDeep` for arrays with support for + * partial deep comparisons. + * + * @private + * @param {Array} array The array to compare. + * @param {Array} other The other array to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `array` and `other` objects. + * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. + */ +function equalArrays(array, other, bitmask, customizer, equalFunc, stack) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG, + arrLength = array.length, + othLength = other.length; + + if (arrLength != othLength && !(isPartial && othLength > arrLength)) { + return false; + } + // Check that cyclic values are equal. + var arrStacked = stack.get(array); + var othStacked = stack.get(other); + if (arrStacked && othStacked) { + return arrStacked == other && othStacked == array; + } + var index = -1, + result = true, + seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined; + + stack.set(array, other); + stack.set(other, array); + + // Ignore non-index properties. + while (++index < arrLength) { + var arrValue = array[index], + othValue = other[index]; + + if (customizer) { + var compared = isPartial + ? customizer(othValue, arrValue, index, other, array, stack) + : customizer(arrValue, othValue, index, array, other, stack); + } + if (compared !== undefined) { + if (compared) { + continue; + } + result = false; + break; + } + // Recursively compare arrays (susceptible to call stack limits). + if (seen) { + if (!arraySome(other, function(othValue, othIndex) { + if (!cacheHas(seen, othIndex) && + (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { + return seen.push(othIndex); + } + })) { + result = false; + break; + } + } else if (!( + arrValue === othValue || + equalFunc(arrValue, othValue, bitmask, customizer, stack) + )) { + result = false; + break; + } + } + stack['delete'](array); + stack['delete'](other); + return result; +} + +module.exports = equalArrays; diff --git a/node_modules/lodash/_equalByTag.js b/node_modules/lodash/_equalByTag.js new file mode 100644 index 0000000..71919e8 --- /dev/null +++ b/node_modules/lodash/_equalByTag.js @@ -0,0 +1,112 @@ +var Symbol = require('./_Symbol'), + Uint8Array = require('./_Uint8Array'), + eq = require('./eq'), + equalArrays = require('./_equalArrays'), + mapToArray = require('./_mapToArray'), + setToArray = require('./_setToArray'); + +/** Used to compose bitmasks for value comparisons. */ +var COMPARE_PARTIAL_FLAG = 1, + COMPARE_UNORDERED_FLAG = 2; + +/** `Object#toString` result references. */ +var boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + mapTag = '[object Map]', + numberTag = '[object Number]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + symbolTag = '[object Symbol]'; + +var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]'; + +/** Used to convert symbols to primitives and strings. */ +var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolValueOf = symbolProto ? symbolProto.valueOf : undefined; + +/** + * A specialized version of `baseIsEqualDeep` for comparing objects of + * the same `toStringTag`. + * + * **Note:** This function only supports comparing values with tags of + * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {string} tag The `toStringTag` of the objects to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ +function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) { + switch (tag) { + case dataViewTag: + if ((object.byteLength != other.byteLength) || + (object.byteOffset != other.byteOffset)) { + return false; + } + object = object.buffer; + other = other.buffer; + + case arrayBufferTag: + if ((object.byteLength != other.byteLength) || + !equalFunc(new Uint8Array(object), new Uint8Array(other))) { + return false; + } + return true; + + case boolTag: + case dateTag: + case numberTag: + // Coerce booleans to `1` or `0` and dates to milliseconds. + // Invalid dates are coerced to `NaN`. + return eq(+object, +other); + + case errorTag: + return object.name == other.name && object.message == other.message; + + case regexpTag: + case stringTag: + // Coerce regexes to strings and treat strings, primitives and objects, + // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring + // for more details. + return object == (other + ''); + + case mapTag: + var convert = mapToArray; + + case setTag: + var isPartial = bitmask & COMPARE_PARTIAL_FLAG; + convert || (convert = setToArray); + + if (object.size != other.size && !isPartial) { + return false; + } + // Assume cyclic values are equal. + var stacked = stack.get(object); + if (stacked) { + return stacked == other; + } + bitmask |= COMPARE_UNORDERED_FLAG; + + // Recursively compare objects (susceptible to call stack limits). + stack.set(object, other); + var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack); + stack['delete'](object); + return result; + + case symbolTag: + if (symbolValueOf) { + return symbolValueOf.call(object) == symbolValueOf.call(other); + } + } + return false; +} + +module.exports = equalByTag; diff --git a/node_modules/lodash/_equalObjects.js b/node_modules/lodash/_equalObjects.js new file mode 100644 index 0000000..cdaacd2 --- /dev/null +++ b/node_modules/lodash/_equalObjects.js @@ -0,0 +1,90 @@ +var getAllKeys = require('./_getAllKeys'); + +/** Used to compose bitmasks for value comparisons. */ +var COMPARE_PARTIAL_FLAG = 1; + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * A specialized version of `baseIsEqualDeep` for objects with support for + * partial deep comparisons. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ +function equalObjects(object, other, bitmask, customizer, equalFunc, stack) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG, + objProps = getAllKeys(object), + objLength = objProps.length, + othProps = getAllKeys(other), + othLength = othProps.length; + + if (objLength != othLength && !isPartial) { + return false; + } + var index = objLength; + while (index--) { + var key = objProps[index]; + if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { + return false; + } + } + // Check that cyclic values are equal. + var objStacked = stack.get(object); + var othStacked = stack.get(other); + if (objStacked && othStacked) { + return objStacked == other && othStacked == object; + } + var result = true; + stack.set(object, other); + stack.set(other, object); + + var skipCtor = isPartial; + while (++index < objLength) { + key = objProps[index]; + var objValue = object[key], + othValue = other[key]; + + if (customizer) { + var compared = isPartial + ? customizer(othValue, objValue, key, other, object, stack) + : customizer(objValue, othValue, key, object, other, stack); + } + // Recursively compare objects (susceptible to call stack limits). + if (!(compared === undefined + ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack)) + : compared + )) { + result = false; + break; + } + skipCtor || (skipCtor = key == 'constructor'); + } + if (result && !skipCtor) { + var objCtor = object.constructor, + othCtor = other.constructor; + + // Non `Object` object instances with different constructors are not equal. + if (objCtor != othCtor && + ('constructor' in object && 'constructor' in other) && + !(typeof objCtor == 'function' && objCtor instanceof objCtor && + typeof othCtor == 'function' && othCtor instanceof othCtor)) { + result = false; + } + } + stack['delete'](object); + stack['delete'](other); + return result; +} + +module.exports = equalObjects; diff --git a/node_modules/lodash/_escapeHtmlChar.js b/node_modules/lodash/_escapeHtmlChar.js new file mode 100644 index 0000000..7ca68ee --- /dev/null +++ b/node_modules/lodash/_escapeHtmlChar.js @@ -0,0 +1,21 @@ +var basePropertyOf = require('./_basePropertyOf'); + +/** Used to map characters to HTML entities. */ +var htmlEscapes = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''' +}; + +/** + * Used by `_.escape` to convert characters to HTML entities. + * + * @private + * @param {string} chr The matched character to escape. + * @returns {string} Returns the escaped character. + */ +var escapeHtmlChar = basePropertyOf(htmlEscapes); + +module.exports = escapeHtmlChar; diff --git a/node_modules/lodash/_escapeStringChar.js b/node_modules/lodash/_escapeStringChar.js new file mode 100644 index 0000000..44eca96 --- /dev/null +++ b/node_modules/lodash/_escapeStringChar.js @@ -0,0 +1,22 @@ +/** Used to escape characters for inclusion in compiled string literals. */ +var stringEscapes = { + '\\': '\\', + "'": "'", + '\n': 'n', + '\r': 'r', + '\u2028': 'u2028', + '\u2029': 'u2029' +}; + +/** + * Used by `_.template` to escape characters for inclusion in compiled string literals. + * + * @private + * @param {string} chr The matched character to escape. + * @returns {string} Returns the escaped character. + */ +function escapeStringChar(chr) { + return '\\' + stringEscapes[chr]; +} + +module.exports = escapeStringChar; diff --git a/node_modules/lodash/_flatRest.js b/node_modules/lodash/_flatRest.js new file mode 100644 index 0000000..94ab6cc --- /dev/null +++ b/node_modules/lodash/_flatRest.js @@ -0,0 +1,16 @@ +var flatten = require('./flatten'), + overRest = require('./_overRest'), + setToString = require('./_setToString'); + +/** + * A specialized version of `baseRest` which flattens the rest array. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @returns {Function} Returns the new function. + */ +function flatRest(func) { + return setToString(overRest(func, undefined, flatten), func + ''); +} + +module.exports = flatRest; diff --git a/node_modules/lodash/_freeGlobal.js b/node_modules/lodash/_freeGlobal.js new file mode 100644 index 0000000..bbec998 --- /dev/null +++ b/node_modules/lodash/_freeGlobal.js @@ -0,0 +1,4 @@ +/** Detect free variable `global` from Node.js. */ +var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; + +module.exports = freeGlobal; diff --git a/node_modules/lodash/_getAllKeys.js b/node_modules/lodash/_getAllKeys.js new file mode 100644 index 0000000..a9ce699 --- /dev/null +++ b/node_modules/lodash/_getAllKeys.js @@ -0,0 +1,16 @@ +var baseGetAllKeys = require('./_baseGetAllKeys'), + getSymbols = require('./_getSymbols'), + keys = require('./keys'); + +/** + * Creates an array of own enumerable property names and symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names and symbols. + */ +function getAllKeys(object) { + return baseGetAllKeys(object, keys, getSymbols); +} + +module.exports = getAllKeys; diff --git a/node_modules/lodash/_getAllKeysIn.js b/node_modules/lodash/_getAllKeysIn.js new file mode 100644 index 0000000..1b46678 --- /dev/null +++ b/node_modules/lodash/_getAllKeysIn.js @@ -0,0 +1,17 @@ +var baseGetAllKeys = require('./_baseGetAllKeys'), + getSymbolsIn = require('./_getSymbolsIn'), + keysIn = require('./keysIn'); + +/** + * Creates an array of own and inherited enumerable property names and + * symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names and symbols. + */ +function getAllKeysIn(object) { + return baseGetAllKeys(object, keysIn, getSymbolsIn); +} + +module.exports = getAllKeysIn; diff --git a/node_modules/lodash/_getData.js b/node_modules/lodash/_getData.js new file mode 100644 index 0000000..a1fe7b7 --- /dev/null +++ b/node_modules/lodash/_getData.js @@ -0,0 +1,15 @@ +var metaMap = require('./_metaMap'), + noop = require('./noop'); + +/** + * Gets metadata for `func`. + * + * @private + * @param {Function} func The function to query. + * @returns {*} Returns the metadata for `func`. + */ +var getData = !metaMap ? noop : function(func) { + return metaMap.get(func); +}; + +module.exports = getData; diff --git a/node_modules/lodash/_getFuncName.js b/node_modules/lodash/_getFuncName.js new file mode 100644 index 0000000..21e15b3 --- /dev/null +++ b/node_modules/lodash/_getFuncName.js @@ -0,0 +1,31 @@ +var realNames = require('./_realNames'); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Gets the name of `func`. + * + * @private + * @param {Function} func The function to query. + * @returns {string} Returns the function name. + */ +function getFuncName(func) { + var result = (func.name + ''), + array = realNames[result], + length = hasOwnProperty.call(realNames, result) ? array.length : 0; + + while (length--) { + var data = array[length], + otherFunc = data.func; + if (otherFunc == null || otherFunc == func) { + return data.name; + } + } + return result; +} + +module.exports = getFuncName; diff --git a/node_modules/lodash/_getHolder.js b/node_modules/lodash/_getHolder.js new file mode 100644 index 0000000..65e94b5 --- /dev/null +++ b/node_modules/lodash/_getHolder.js @@ -0,0 +1,13 @@ +/** + * Gets the argument placeholder value for `func`. + * + * @private + * @param {Function} func The function to inspect. + * @returns {*} Returns the placeholder value. + */ +function getHolder(func) { + var object = func; + return object.placeholder; +} + +module.exports = getHolder; diff --git a/node_modules/lodash/_getMapData.js b/node_modules/lodash/_getMapData.js new file mode 100644 index 0000000..17f6303 --- /dev/null +++ b/node_modules/lodash/_getMapData.js @@ -0,0 +1,18 @@ +var isKeyable = require('./_isKeyable'); + +/** + * Gets the data for `map`. + * + * @private + * @param {Object} map The map to query. + * @param {string} key The reference key. + * @returns {*} Returns the map data. + */ +function getMapData(map, key) { + var data = map.__data__; + return isKeyable(key) + ? data[typeof key == 'string' ? 'string' : 'hash'] + : data.map; +} + +module.exports = getMapData; diff --git a/node_modules/lodash/_getMatchData.js b/node_modules/lodash/_getMatchData.js new file mode 100644 index 0000000..2cc70f9 --- /dev/null +++ b/node_modules/lodash/_getMatchData.js @@ -0,0 +1,24 @@ +var isStrictComparable = require('./_isStrictComparable'), + keys = require('./keys'); + +/** + * Gets the property names, values, and compare flags of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the match data of `object`. + */ +function getMatchData(object) { + var result = keys(object), + length = result.length; + + while (length--) { + var key = result[length], + value = object[key]; + + result[length] = [key, value, isStrictComparable(value)]; + } + return result; +} + +module.exports = getMatchData; diff --git a/node_modules/lodash/_getNative.js b/node_modules/lodash/_getNative.js new file mode 100644 index 0000000..97a622b --- /dev/null +++ b/node_modules/lodash/_getNative.js @@ -0,0 +1,17 @@ +var baseIsNative = require('./_baseIsNative'), + getValue = require('./_getValue'); + +/** + * Gets the native function at `key` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. + */ +function getNative(object, key) { + var value = getValue(object, key); + return baseIsNative(value) ? value : undefined; +} + +module.exports = getNative; diff --git a/node_modules/lodash/_getPrototype.js b/node_modules/lodash/_getPrototype.js new file mode 100644 index 0000000..e808612 --- /dev/null +++ b/node_modules/lodash/_getPrototype.js @@ -0,0 +1,6 @@ +var overArg = require('./_overArg'); + +/** Built-in value references. */ +var getPrototype = overArg(Object.getPrototypeOf, Object); + +module.exports = getPrototype; diff --git a/node_modules/lodash/_getRawTag.js b/node_modules/lodash/_getRawTag.js new file mode 100644 index 0000000..49a95c9 --- /dev/null +++ b/node_modules/lodash/_getRawTag.js @@ -0,0 +1,46 @@ +var Symbol = require('./_Symbol'); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var nativeObjectToString = objectProto.toString; + +/** Built-in value references. */ +var symToStringTag = Symbol ? Symbol.toStringTag : undefined; + +/** + * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the raw `toStringTag`. + */ +function getRawTag(value) { + var isOwn = hasOwnProperty.call(value, symToStringTag), + tag = value[symToStringTag]; + + try { + value[symToStringTag] = undefined; + var unmasked = true; + } catch (e) {} + + var result = nativeObjectToString.call(value); + if (unmasked) { + if (isOwn) { + value[symToStringTag] = tag; + } else { + delete value[symToStringTag]; + } + } + return result; +} + +module.exports = getRawTag; diff --git a/node_modules/lodash/_getSymbols.js b/node_modules/lodash/_getSymbols.js new file mode 100644 index 0000000..7d6eafe --- /dev/null +++ b/node_modules/lodash/_getSymbols.js @@ -0,0 +1,30 @@ +var arrayFilter = require('./_arrayFilter'), + stubArray = require('./stubArray'); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Built-in value references. */ +var propertyIsEnumerable = objectProto.propertyIsEnumerable; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeGetSymbols = Object.getOwnPropertySymbols; + +/** + * Creates an array of the own enumerable symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of symbols. + */ +var getSymbols = !nativeGetSymbols ? stubArray : function(object) { + if (object == null) { + return []; + } + object = Object(object); + return arrayFilter(nativeGetSymbols(object), function(symbol) { + return propertyIsEnumerable.call(object, symbol); + }); +}; + +module.exports = getSymbols; diff --git a/node_modules/lodash/_getSymbolsIn.js b/node_modules/lodash/_getSymbolsIn.js new file mode 100644 index 0000000..cec0855 --- /dev/null +++ b/node_modules/lodash/_getSymbolsIn.js @@ -0,0 +1,25 @@ +var arrayPush = require('./_arrayPush'), + getPrototype = require('./_getPrototype'), + getSymbols = require('./_getSymbols'), + stubArray = require('./stubArray'); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeGetSymbols = Object.getOwnPropertySymbols; + +/** + * Creates an array of the own and inherited enumerable symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of symbols. + */ +var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) { + var result = []; + while (object) { + arrayPush(result, getSymbols(object)); + object = getPrototype(object); + } + return result; +}; + +module.exports = getSymbolsIn; diff --git a/node_modules/lodash/_getTag.js b/node_modules/lodash/_getTag.js new file mode 100644 index 0000000..deaf89d --- /dev/null +++ b/node_modules/lodash/_getTag.js @@ -0,0 +1,58 @@ +var DataView = require('./_DataView'), + Map = require('./_Map'), + Promise = require('./_Promise'), + Set = require('./_Set'), + WeakMap = require('./_WeakMap'), + baseGetTag = require('./_baseGetTag'), + toSource = require('./_toSource'); + +/** `Object#toString` result references. */ +var mapTag = '[object Map]', + objectTag = '[object Object]', + promiseTag = '[object Promise]', + setTag = '[object Set]', + weakMapTag = '[object WeakMap]'; + +var dataViewTag = '[object DataView]'; + +/** Used to detect maps, sets, and weakmaps. */ +var dataViewCtorString = toSource(DataView), + mapCtorString = toSource(Map), + promiseCtorString = toSource(Promise), + setCtorString = toSource(Set), + weakMapCtorString = toSource(WeakMap); + +/** + * Gets the `toStringTag` of `value`. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +var getTag = baseGetTag; + +// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6. +if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || + (Map && getTag(new Map) != mapTag) || + (Promise && getTag(Promise.resolve()) != promiseTag) || + (Set && getTag(new Set) != setTag) || + (WeakMap && getTag(new WeakMap) != weakMapTag)) { + getTag = function(value) { + var result = baseGetTag(value), + Ctor = result == objectTag ? value.constructor : undefined, + ctorString = Ctor ? toSource(Ctor) : ''; + + if (ctorString) { + switch (ctorString) { + case dataViewCtorString: return dataViewTag; + case mapCtorString: return mapTag; + case promiseCtorString: return promiseTag; + case setCtorString: return setTag; + case weakMapCtorString: return weakMapTag; + } + } + return result; + }; +} + +module.exports = getTag; diff --git a/node_modules/lodash/_getValue.js b/node_modules/lodash/_getValue.js new file mode 100644 index 0000000..5f7d773 --- /dev/null +++ b/node_modules/lodash/_getValue.js @@ -0,0 +1,13 @@ +/** + * Gets the value at `key` of `object`. + * + * @private + * @param {Object} [object] The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ +function getValue(object, key) { + return object == null ? undefined : object[key]; +} + +module.exports = getValue; diff --git a/node_modules/lodash/_getView.js b/node_modules/lodash/_getView.js new file mode 100644 index 0000000..df1e5d4 --- /dev/null +++ b/node_modules/lodash/_getView.js @@ -0,0 +1,33 @@ +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max, + nativeMin = Math.min; + +/** + * Gets the view, applying any `transforms` to the `start` and `end` positions. + * + * @private + * @param {number} start The start of the view. + * @param {number} end The end of the view. + * @param {Array} transforms The transformations to apply to the view. + * @returns {Object} Returns an object containing the `start` and `end` + * positions of the view. + */ +function getView(start, end, transforms) { + var index = -1, + length = transforms.length; + + while (++index < length) { + var data = transforms[index], + size = data.size; + + switch (data.type) { + case 'drop': start += size; break; + case 'dropRight': end -= size; break; + case 'take': end = nativeMin(end, start + size); break; + case 'takeRight': start = nativeMax(start, end - size); break; + } + } + return { 'start': start, 'end': end }; +} + +module.exports = getView; diff --git a/node_modules/lodash/_getWrapDetails.js b/node_modules/lodash/_getWrapDetails.js new file mode 100644 index 0000000..3bcc6e4 --- /dev/null +++ b/node_modules/lodash/_getWrapDetails.js @@ -0,0 +1,17 @@ +/** Used to match wrap detail comments. */ +var reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/, + reSplitDetails = /,? & /; + +/** + * Extracts wrapper details from the `source` body comment. + * + * @private + * @param {string} source The source to inspect. + * @returns {Array} Returns the wrapper details. + */ +function getWrapDetails(source) { + var match = source.match(reWrapDetails); + return match ? match[1].split(reSplitDetails) : []; +} + +module.exports = getWrapDetails; diff --git a/node_modules/lodash/_hasPath.js b/node_modules/lodash/_hasPath.js new file mode 100644 index 0000000..93dbde1 --- /dev/null +++ b/node_modules/lodash/_hasPath.js @@ -0,0 +1,39 @@ +var castPath = require('./_castPath'), + isArguments = require('./isArguments'), + isArray = require('./isArray'), + isIndex = require('./_isIndex'), + isLength = require('./isLength'), + toKey = require('./_toKey'); + +/** + * Checks if `path` exists on `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @param {Function} hasFunc The function to check properties. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + */ +function hasPath(object, path, hasFunc) { + path = castPath(path, object); + + var index = -1, + length = path.length, + result = false; + + while (++index < length) { + var key = toKey(path[index]); + if (!(result = object != null && hasFunc(object, key))) { + break; + } + object = object[key]; + } + if (result || ++index != length) { + return result; + } + length = object == null ? 0 : object.length; + return !!length && isLength(length) && isIndex(key, length) && + (isArray(object) || isArguments(object)); +} + +module.exports = hasPath; diff --git a/node_modules/lodash/_hasUnicode.js b/node_modules/lodash/_hasUnicode.js new file mode 100644 index 0000000..cb6ca15 --- /dev/null +++ b/node_modules/lodash/_hasUnicode.js @@ -0,0 +1,26 @@ +/** Used to compose unicode character classes. */ +var rsAstralRange = '\\ud800-\\udfff', + rsComboMarksRange = '\\u0300-\\u036f', + reComboHalfMarksRange = '\\ufe20-\\ufe2f', + rsComboSymbolsRange = '\\u20d0-\\u20ff', + rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, + rsVarRange = '\\ufe0e\\ufe0f'; + +/** Used to compose unicode capture groups. */ +var rsZWJ = '\\u200d'; + +/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ +var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']'); + +/** + * Checks if `string` contains Unicode symbols. + * + * @private + * @param {string} string The string to inspect. + * @returns {boolean} Returns `true` if a symbol is found, else `false`. + */ +function hasUnicode(string) { + return reHasUnicode.test(string); +} + +module.exports = hasUnicode; diff --git a/node_modules/lodash/_hasUnicodeWord.js b/node_modules/lodash/_hasUnicodeWord.js new file mode 100644 index 0000000..95d52c4 --- /dev/null +++ b/node_modules/lodash/_hasUnicodeWord.js @@ -0,0 +1,15 @@ +/** Used to detect strings that need a more robust regexp to match words. */ +var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/; + +/** + * Checks if `string` contains a word composed of Unicode symbols. + * + * @private + * @param {string} string The string to inspect. + * @returns {boolean} Returns `true` if a word is found, else `false`. + */ +function hasUnicodeWord(string) { + return reHasUnicodeWord.test(string); +} + +module.exports = hasUnicodeWord; diff --git a/node_modules/lodash/_hashClear.js b/node_modules/lodash/_hashClear.js new file mode 100644 index 0000000..5d4b70c --- /dev/null +++ b/node_modules/lodash/_hashClear.js @@ -0,0 +1,15 @@ +var nativeCreate = require('./_nativeCreate'); + +/** + * Removes all key-value entries from the hash. + * + * @private + * @name clear + * @memberOf Hash + */ +function hashClear() { + this.__data__ = nativeCreate ? nativeCreate(null) : {}; + this.size = 0; +} + +module.exports = hashClear; diff --git a/node_modules/lodash/_hashDelete.js b/node_modules/lodash/_hashDelete.js new file mode 100644 index 0000000..ea9dabf --- /dev/null +++ b/node_modules/lodash/_hashDelete.js @@ -0,0 +1,17 @@ +/** + * Removes `key` and its value from the hash. + * + * @private + * @name delete + * @memberOf Hash + * @param {Object} hash The hash to modify. + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function hashDelete(key) { + var result = this.has(key) && delete this.__data__[key]; + this.size -= result ? 1 : 0; + return result; +} + +module.exports = hashDelete; diff --git a/node_modules/lodash/_hashGet.js b/node_modules/lodash/_hashGet.js new file mode 100644 index 0000000..1fc2f34 --- /dev/null +++ b/node_modules/lodash/_hashGet.js @@ -0,0 +1,30 @@ +var nativeCreate = require('./_nativeCreate'); + +/** Used to stand-in for `undefined` hash values. */ +var HASH_UNDEFINED = '__lodash_hash_undefined__'; + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Gets the hash value for `key`. + * + * @private + * @name get + * @memberOf Hash + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function hashGet(key) { + var data = this.__data__; + if (nativeCreate) { + var result = data[key]; + return result === HASH_UNDEFINED ? undefined : result; + } + return hasOwnProperty.call(data, key) ? data[key] : undefined; +} + +module.exports = hashGet; diff --git a/node_modules/lodash/_hashHas.js b/node_modules/lodash/_hashHas.js new file mode 100644 index 0000000..281a551 --- /dev/null +++ b/node_modules/lodash/_hashHas.js @@ -0,0 +1,23 @@ +var nativeCreate = require('./_nativeCreate'); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Checks if a hash value for `key` exists. + * + * @private + * @name has + * @memberOf Hash + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function hashHas(key) { + var data = this.__data__; + return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key); +} + +module.exports = hashHas; diff --git a/node_modules/lodash/_hashSet.js b/node_modules/lodash/_hashSet.js new file mode 100644 index 0000000..e105528 --- /dev/null +++ b/node_modules/lodash/_hashSet.js @@ -0,0 +1,23 @@ +var nativeCreate = require('./_nativeCreate'); + +/** Used to stand-in for `undefined` hash values. */ +var HASH_UNDEFINED = '__lodash_hash_undefined__'; + +/** + * Sets the hash `key` to `value`. + * + * @private + * @name set + * @memberOf Hash + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the hash instance. + */ +function hashSet(key, value) { + var data = this.__data__; + this.size += this.has(key) ? 0 : 1; + data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; + return this; +} + +module.exports = hashSet; diff --git a/node_modules/lodash/_initCloneArray.js b/node_modules/lodash/_initCloneArray.js new file mode 100644 index 0000000..078c15a --- /dev/null +++ b/node_modules/lodash/_initCloneArray.js @@ -0,0 +1,26 @@ +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Initializes an array clone. + * + * @private + * @param {Array} array The array to clone. + * @returns {Array} Returns the initialized clone. + */ +function initCloneArray(array) { + var length = array.length, + result = new array.constructor(length); + + // Add properties assigned by `RegExp#exec`. + if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { + result.index = array.index; + result.input = array.input; + } + return result; +} + +module.exports = initCloneArray; diff --git a/node_modules/lodash/_initCloneByTag.js b/node_modules/lodash/_initCloneByTag.js new file mode 100644 index 0000000..f69a008 --- /dev/null +++ b/node_modules/lodash/_initCloneByTag.js @@ -0,0 +1,77 @@ +var cloneArrayBuffer = require('./_cloneArrayBuffer'), + cloneDataView = require('./_cloneDataView'), + cloneRegExp = require('./_cloneRegExp'), + cloneSymbol = require('./_cloneSymbol'), + cloneTypedArray = require('./_cloneTypedArray'); + +/** `Object#toString` result references. */ +var boolTag = '[object Boolean]', + dateTag = '[object Date]', + mapTag = '[object Map]', + numberTag = '[object Number]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + symbolTag = '[object Symbol]'; + +var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; + +/** + * Initializes an object clone based on its `toStringTag`. + * + * **Note:** This function only supports cloning values with tags of + * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`. + * + * @private + * @param {Object} object The object to clone. + * @param {string} tag The `toStringTag` of the object to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the initialized clone. + */ +function initCloneByTag(object, tag, isDeep) { + var Ctor = object.constructor; + switch (tag) { + case arrayBufferTag: + return cloneArrayBuffer(object); + + case boolTag: + case dateTag: + return new Ctor(+object); + + case dataViewTag: + return cloneDataView(object, isDeep); + + case float32Tag: case float64Tag: + case int8Tag: case int16Tag: case int32Tag: + case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: + return cloneTypedArray(object, isDeep); + + case mapTag: + return new Ctor; + + case numberTag: + case stringTag: + return new Ctor(object); + + case regexpTag: + return cloneRegExp(object); + + case setTag: + return new Ctor; + + case symbolTag: + return cloneSymbol(object); + } +} + +module.exports = initCloneByTag; diff --git a/node_modules/lodash/_initCloneObject.js b/node_modules/lodash/_initCloneObject.js new file mode 100644 index 0000000..5a13e64 --- /dev/null +++ b/node_modules/lodash/_initCloneObject.js @@ -0,0 +1,18 @@ +var baseCreate = require('./_baseCreate'), + getPrototype = require('./_getPrototype'), + isPrototype = require('./_isPrototype'); + +/** + * Initializes an object clone. + * + * @private + * @param {Object} object The object to clone. + * @returns {Object} Returns the initialized clone. + */ +function initCloneObject(object) { + return (typeof object.constructor == 'function' && !isPrototype(object)) + ? baseCreate(getPrototype(object)) + : {}; +} + +module.exports = initCloneObject; diff --git a/node_modules/lodash/_insertWrapDetails.js b/node_modules/lodash/_insertWrapDetails.js new file mode 100644 index 0000000..e790808 --- /dev/null +++ b/node_modules/lodash/_insertWrapDetails.js @@ -0,0 +1,23 @@ +/** Used to match wrap detail comments. */ +var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/; + +/** + * Inserts wrapper `details` in a comment at the top of the `source` body. + * + * @private + * @param {string} source The source to modify. + * @returns {Array} details The details to insert. + * @returns {string} Returns the modified source. + */ +function insertWrapDetails(source, details) { + var length = details.length; + if (!length) { + return source; + } + var lastIndex = length - 1; + details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex]; + details = details.join(length > 2 ? ', ' : ' '); + return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n'); +} + +module.exports = insertWrapDetails; diff --git a/node_modules/lodash/_isFlattenable.js b/node_modules/lodash/_isFlattenable.js new file mode 100644 index 0000000..4cc2c24 --- /dev/null +++ b/node_modules/lodash/_isFlattenable.js @@ -0,0 +1,20 @@ +var Symbol = require('./_Symbol'), + isArguments = require('./isArguments'), + isArray = require('./isArray'); + +/** Built-in value references. */ +var spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined; + +/** + * Checks if `value` is a flattenable `arguments` object or array. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. + */ +function isFlattenable(value) { + return isArray(value) || isArguments(value) || + !!(spreadableSymbol && value && value[spreadableSymbol]); +} + +module.exports = isFlattenable; diff --git a/node_modules/lodash/_isIndex.js b/node_modules/lodash/_isIndex.js new file mode 100644 index 0000000..061cd39 --- /dev/null +++ b/node_modules/lodash/_isIndex.js @@ -0,0 +1,25 @@ +/** Used as references for various `Number` constants. */ +var MAX_SAFE_INTEGER = 9007199254740991; + +/** Used to detect unsigned integer values. */ +var reIsUint = /^(?:0|[1-9]\d*)$/; + +/** + * Checks if `value` is a valid array-like index. + * + * @private + * @param {*} value The value to check. + * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. + * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + */ +function isIndex(value, length) { + var type = typeof value; + length = length == null ? MAX_SAFE_INTEGER : length; + + return !!length && + (type == 'number' || + (type != 'symbol' && reIsUint.test(value))) && + (value > -1 && value % 1 == 0 && value < length); +} + +module.exports = isIndex; diff --git a/node_modules/lodash/_isIterateeCall.js b/node_modules/lodash/_isIterateeCall.js new file mode 100644 index 0000000..a0bb5a9 --- /dev/null +++ b/node_modules/lodash/_isIterateeCall.js @@ -0,0 +1,30 @@ +var eq = require('./eq'), + isArrayLike = require('./isArrayLike'), + isIndex = require('./_isIndex'), + isObject = require('./isObject'); + +/** + * Checks if the given arguments are from an iteratee call. + * + * @private + * @param {*} value The potential iteratee value argument. + * @param {*} index The potential iteratee index or key argument. + * @param {*} object The potential iteratee object argument. + * @returns {boolean} Returns `true` if the arguments are from an iteratee call, + * else `false`. + */ +function isIterateeCall(value, index, object) { + if (!isObject(object)) { + return false; + } + var type = typeof index; + if (type == 'number' + ? (isArrayLike(object) && isIndex(index, object.length)) + : (type == 'string' && index in object) + ) { + return eq(object[index], value); + } + return false; +} + +module.exports = isIterateeCall; diff --git a/node_modules/lodash/_isKey.js b/node_modules/lodash/_isKey.js new file mode 100644 index 0000000..ff08b06 --- /dev/null +++ b/node_modules/lodash/_isKey.js @@ -0,0 +1,29 @@ +var isArray = require('./isArray'), + isSymbol = require('./isSymbol'); + +/** Used to match property names within property paths. */ +var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, + reIsPlainProp = /^\w*$/; + +/** + * Checks if `value` is a property name and not a property path. + * + * @private + * @param {*} value The value to check. + * @param {Object} [object] The object to query keys on. + * @returns {boolean} Returns `true` if `value` is a property name, else `false`. + */ +function isKey(value, object) { + if (isArray(value)) { + return false; + } + var type = typeof value; + if (type == 'number' || type == 'symbol' || type == 'boolean' || + value == null || isSymbol(value)) { + return true; + } + return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || + (object != null && value in Object(object)); +} + +module.exports = isKey; diff --git a/node_modules/lodash/_isKeyable.js b/node_modules/lodash/_isKeyable.js new file mode 100644 index 0000000..39f1828 --- /dev/null +++ b/node_modules/lodash/_isKeyable.js @@ -0,0 +1,15 @@ +/** + * Checks if `value` is suitable for use as unique object key. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is suitable, else `false`. + */ +function isKeyable(value) { + var type = typeof value; + return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') + ? (value !== '__proto__') + : (value === null); +} + +module.exports = isKeyable; diff --git a/node_modules/lodash/_isLaziable.js b/node_modules/lodash/_isLaziable.js new file mode 100644 index 0000000..a57c4f2 --- /dev/null +++ b/node_modules/lodash/_isLaziable.js @@ -0,0 +1,28 @@ +var LazyWrapper = require('./_LazyWrapper'), + getData = require('./_getData'), + getFuncName = require('./_getFuncName'), + lodash = require('./wrapperLodash'); + +/** + * Checks if `func` has a lazy counterpart. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` has a lazy counterpart, + * else `false`. + */ +function isLaziable(func) { + var funcName = getFuncName(func), + other = lodash[funcName]; + + if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) { + return false; + } + if (func === other) { + return true; + } + var data = getData(other); + return !!data && func === data[0]; +} + +module.exports = isLaziable; diff --git a/node_modules/lodash/_isMaskable.js b/node_modules/lodash/_isMaskable.js new file mode 100644 index 0000000..eb98d09 --- /dev/null +++ b/node_modules/lodash/_isMaskable.js @@ -0,0 +1,14 @@ +var coreJsData = require('./_coreJsData'), + isFunction = require('./isFunction'), + stubFalse = require('./stubFalse'); + +/** + * Checks if `func` is capable of being masked. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `func` is maskable, else `false`. + */ +var isMaskable = coreJsData ? isFunction : stubFalse; + +module.exports = isMaskable; diff --git a/node_modules/lodash/_isMasked.js b/node_modules/lodash/_isMasked.js new file mode 100644 index 0000000..4b0f21b --- /dev/null +++ b/node_modules/lodash/_isMasked.js @@ -0,0 +1,20 @@ +var coreJsData = require('./_coreJsData'); + +/** Used to detect methods masquerading as native. */ +var maskSrcKey = (function() { + var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); + return uid ? ('Symbol(src)_1.' + uid) : ''; +}()); + +/** + * Checks if `func` has its source masked. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` is masked, else `false`. + */ +function isMasked(func) { + return !!maskSrcKey && (maskSrcKey in func); +} + +module.exports = isMasked; diff --git a/node_modules/lodash/_isPrototype.js b/node_modules/lodash/_isPrototype.js new file mode 100644 index 0000000..0f29498 --- /dev/null +++ b/node_modules/lodash/_isPrototype.js @@ -0,0 +1,18 @@ +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** + * Checks if `value` is likely a prototype object. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. + */ +function isPrototype(value) { + var Ctor = value && value.constructor, + proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; + + return value === proto; +} + +module.exports = isPrototype; diff --git a/node_modules/lodash/_isStrictComparable.js b/node_modules/lodash/_isStrictComparable.js new file mode 100644 index 0000000..b59f40b --- /dev/null +++ b/node_modules/lodash/_isStrictComparable.js @@ -0,0 +1,15 @@ +var isObject = require('./isObject'); + +/** + * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` if suitable for strict + * equality comparisons, else `false`. + */ +function isStrictComparable(value) { + return value === value && !isObject(value); +} + +module.exports = isStrictComparable; diff --git a/node_modules/lodash/_iteratorToArray.js b/node_modules/lodash/_iteratorToArray.js new file mode 100644 index 0000000..4768566 --- /dev/null +++ b/node_modules/lodash/_iteratorToArray.js @@ -0,0 +1,18 @@ +/** + * Converts `iterator` to an array. + * + * @private + * @param {Object} iterator The iterator to convert. + * @returns {Array} Returns the converted array. + */ +function iteratorToArray(iterator) { + var data, + result = []; + + while (!(data = iterator.next()).done) { + result.push(data.value); + } + return result; +} + +module.exports = iteratorToArray; diff --git a/node_modules/lodash/_lazyClone.js b/node_modules/lodash/_lazyClone.js new file mode 100644 index 0000000..d8a51f8 --- /dev/null +++ b/node_modules/lodash/_lazyClone.js @@ -0,0 +1,23 @@ +var LazyWrapper = require('./_LazyWrapper'), + copyArray = require('./_copyArray'); + +/** + * Creates a clone of the lazy wrapper object. + * + * @private + * @name clone + * @memberOf LazyWrapper + * @returns {Object} Returns the cloned `LazyWrapper` object. + */ +function lazyClone() { + var result = new LazyWrapper(this.__wrapped__); + result.__actions__ = copyArray(this.__actions__); + result.__dir__ = this.__dir__; + result.__filtered__ = this.__filtered__; + result.__iteratees__ = copyArray(this.__iteratees__); + result.__takeCount__ = this.__takeCount__; + result.__views__ = copyArray(this.__views__); + return result; +} + +module.exports = lazyClone; diff --git a/node_modules/lodash/_lazyReverse.js b/node_modules/lodash/_lazyReverse.js new file mode 100644 index 0000000..c5b5219 --- /dev/null +++ b/node_modules/lodash/_lazyReverse.js @@ -0,0 +1,23 @@ +var LazyWrapper = require('./_LazyWrapper'); + +/** + * Reverses the direction of lazy iteration. + * + * @private + * @name reverse + * @memberOf LazyWrapper + * @returns {Object} Returns the new reversed `LazyWrapper` object. + */ +function lazyReverse() { + if (this.__filtered__) { + var result = new LazyWrapper(this); + result.__dir__ = -1; + result.__filtered__ = true; + } else { + result = this.clone(); + result.__dir__ *= -1; + } + return result; +} + +module.exports = lazyReverse; diff --git a/node_modules/lodash/_lazyValue.js b/node_modules/lodash/_lazyValue.js new file mode 100644 index 0000000..371ca8d --- /dev/null +++ b/node_modules/lodash/_lazyValue.js @@ -0,0 +1,69 @@ +var baseWrapperValue = require('./_baseWrapperValue'), + getView = require('./_getView'), + isArray = require('./isArray'); + +/** Used to indicate the type of lazy iteratees. */ +var LAZY_FILTER_FLAG = 1, + LAZY_MAP_FLAG = 2; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMin = Math.min; + +/** + * Extracts the unwrapped value from its lazy wrapper. + * + * @private + * @name value + * @memberOf LazyWrapper + * @returns {*} Returns the unwrapped value. + */ +function lazyValue() { + var array = this.__wrapped__.value(), + dir = this.__dir__, + isArr = isArray(array), + isRight = dir < 0, + arrLength = isArr ? array.length : 0, + view = getView(0, arrLength, this.__views__), + start = view.start, + end = view.end, + length = end - start, + index = isRight ? end : (start - 1), + iteratees = this.__iteratees__, + iterLength = iteratees.length, + resIndex = 0, + takeCount = nativeMin(length, this.__takeCount__); + + if (!isArr || (!isRight && arrLength == length && takeCount == length)) { + return baseWrapperValue(array, this.__actions__); + } + var result = []; + + outer: + while (length-- && resIndex < takeCount) { + index += dir; + + var iterIndex = -1, + value = array[index]; + + while (++iterIndex < iterLength) { + var data = iteratees[iterIndex], + iteratee = data.iteratee, + type = data.type, + computed = iteratee(value); + + if (type == LAZY_MAP_FLAG) { + value = computed; + } else if (!computed) { + if (type == LAZY_FILTER_FLAG) { + continue outer; + } else { + break outer; + } + } + } + result[resIndex++] = value; + } + return result; +} + +module.exports = lazyValue; diff --git a/node_modules/lodash/_listCacheClear.js b/node_modules/lodash/_listCacheClear.js new file mode 100644 index 0000000..acbe39a --- /dev/null +++ b/node_modules/lodash/_listCacheClear.js @@ -0,0 +1,13 @@ +/** + * Removes all key-value entries from the list cache. + * + * @private + * @name clear + * @memberOf ListCache + */ +function listCacheClear() { + this.__data__ = []; + this.size = 0; +} + +module.exports = listCacheClear; diff --git a/node_modules/lodash/_listCacheDelete.js b/node_modules/lodash/_listCacheDelete.js new file mode 100644 index 0000000..b1384ad --- /dev/null +++ b/node_modules/lodash/_listCacheDelete.js @@ -0,0 +1,35 @@ +var assocIndexOf = require('./_assocIndexOf'); + +/** Used for built-in method references. */ +var arrayProto = Array.prototype; + +/** Built-in value references. */ +var splice = arrayProto.splice; + +/** + * Removes `key` and its value from the list cache. + * + * @private + * @name delete + * @memberOf ListCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function listCacheDelete(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + return false; + } + var lastIndex = data.length - 1; + if (index == lastIndex) { + data.pop(); + } else { + splice.call(data, index, 1); + } + --this.size; + return true; +} + +module.exports = listCacheDelete; diff --git a/node_modules/lodash/_listCacheGet.js b/node_modules/lodash/_listCacheGet.js new file mode 100644 index 0000000..f8192fc --- /dev/null +++ b/node_modules/lodash/_listCacheGet.js @@ -0,0 +1,19 @@ +var assocIndexOf = require('./_assocIndexOf'); + +/** + * Gets the list cache value for `key`. + * + * @private + * @name get + * @memberOf ListCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function listCacheGet(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + return index < 0 ? undefined : data[index][1]; +} + +module.exports = listCacheGet; diff --git a/node_modules/lodash/_listCacheHas.js b/node_modules/lodash/_listCacheHas.js new file mode 100644 index 0000000..2adf671 --- /dev/null +++ b/node_modules/lodash/_listCacheHas.js @@ -0,0 +1,16 @@ +var assocIndexOf = require('./_assocIndexOf'); + +/** + * Checks if a list cache value for `key` exists. + * + * @private + * @name has + * @memberOf ListCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function listCacheHas(key) { + return assocIndexOf(this.__data__, key) > -1; +} + +module.exports = listCacheHas; diff --git a/node_modules/lodash/_listCacheSet.js b/node_modules/lodash/_listCacheSet.js new file mode 100644 index 0000000..5855c95 --- /dev/null +++ b/node_modules/lodash/_listCacheSet.js @@ -0,0 +1,26 @@ +var assocIndexOf = require('./_assocIndexOf'); + +/** + * Sets the list cache `key` to `value`. + * + * @private + * @name set + * @memberOf ListCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the list cache instance. + */ +function listCacheSet(key, value) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + ++this.size; + data.push([key, value]); + } else { + data[index][1] = value; + } + return this; +} + +module.exports = listCacheSet; diff --git a/node_modules/lodash/_mapCacheClear.js b/node_modules/lodash/_mapCacheClear.js new file mode 100644 index 0000000..bc9ca20 --- /dev/null +++ b/node_modules/lodash/_mapCacheClear.js @@ -0,0 +1,21 @@ +var Hash = require('./_Hash'), + ListCache = require('./_ListCache'), + Map = require('./_Map'); + +/** + * Removes all key-value entries from the map. + * + * @private + * @name clear + * @memberOf MapCache + */ +function mapCacheClear() { + this.size = 0; + this.__data__ = { + 'hash': new Hash, + 'map': new (Map || ListCache), + 'string': new Hash + }; +} + +module.exports = mapCacheClear; diff --git a/node_modules/lodash/_mapCacheDelete.js b/node_modules/lodash/_mapCacheDelete.js new file mode 100644 index 0000000..946ca3c --- /dev/null +++ b/node_modules/lodash/_mapCacheDelete.js @@ -0,0 +1,18 @@ +var getMapData = require('./_getMapData'); + +/** + * Removes `key` and its value from the map. + * + * @private + * @name delete + * @memberOf MapCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function mapCacheDelete(key) { + var result = getMapData(this, key)['delete'](key); + this.size -= result ? 1 : 0; + return result; +} + +module.exports = mapCacheDelete; diff --git a/node_modules/lodash/_mapCacheGet.js b/node_modules/lodash/_mapCacheGet.js new file mode 100644 index 0000000..f29f55c --- /dev/null +++ b/node_modules/lodash/_mapCacheGet.js @@ -0,0 +1,16 @@ +var getMapData = require('./_getMapData'); + +/** + * Gets the map value for `key`. + * + * @private + * @name get + * @memberOf MapCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function mapCacheGet(key) { + return getMapData(this, key).get(key); +} + +module.exports = mapCacheGet; diff --git a/node_modules/lodash/_mapCacheHas.js b/node_modules/lodash/_mapCacheHas.js new file mode 100644 index 0000000..a1214c0 --- /dev/null +++ b/node_modules/lodash/_mapCacheHas.js @@ -0,0 +1,16 @@ +var getMapData = require('./_getMapData'); + +/** + * Checks if a map value for `key` exists. + * + * @private + * @name has + * @memberOf MapCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function mapCacheHas(key) { + return getMapData(this, key).has(key); +} + +module.exports = mapCacheHas; diff --git a/node_modules/lodash/_mapCacheSet.js b/node_modules/lodash/_mapCacheSet.js new file mode 100644 index 0000000..7346849 --- /dev/null +++ b/node_modules/lodash/_mapCacheSet.js @@ -0,0 +1,22 @@ +var getMapData = require('./_getMapData'); + +/** + * Sets the map `key` to `value`. + * + * @private + * @name set + * @memberOf MapCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the map cache instance. + */ +function mapCacheSet(key, value) { + var data = getMapData(this, key), + size = data.size; + + data.set(key, value); + this.size += data.size == size ? 0 : 1; + return this; +} + +module.exports = mapCacheSet; diff --git a/node_modules/lodash/_mapToArray.js b/node_modules/lodash/_mapToArray.js new file mode 100644 index 0000000..fe3dd53 --- /dev/null +++ b/node_modules/lodash/_mapToArray.js @@ -0,0 +1,18 @@ +/** + * Converts `map` to its key-value pairs. + * + * @private + * @param {Object} map The map to convert. + * @returns {Array} Returns the key-value pairs. + */ +function mapToArray(map) { + var index = -1, + result = Array(map.size); + + map.forEach(function(value, key) { + result[++index] = [key, value]; + }); + return result; +} + +module.exports = mapToArray; diff --git a/node_modules/lodash/_matchesStrictComparable.js b/node_modules/lodash/_matchesStrictComparable.js new file mode 100644 index 0000000..f608af9 --- /dev/null +++ b/node_modules/lodash/_matchesStrictComparable.js @@ -0,0 +1,20 @@ +/** + * A specialized version of `matchesProperty` for source values suitable + * for strict equality comparisons, i.e. `===`. + * + * @private + * @param {string} key The key of the property to get. + * @param {*} srcValue The value to match. + * @returns {Function} Returns the new spec function. + */ +function matchesStrictComparable(key, srcValue) { + return function(object) { + if (object == null) { + return false; + } + return object[key] === srcValue && + (srcValue !== undefined || (key in Object(object))); + }; +} + +module.exports = matchesStrictComparable; diff --git a/node_modules/lodash/_memoizeCapped.js b/node_modules/lodash/_memoizeCapped.js new file mode 100644 index 0000000..7f71c8f --- /dev/null +++ b/node_modules/lodash/_memoizeCapped.js @@ -0,0 +1,26 @@ +var memoize = require('./memoize'); + +/** Used as the maximum memoize cache size. */ +var MAX_MEMOIZE_SIZE = 500; + +/** + * A specialized version of `_.memoize` which clears the memoized function's + * cache when it exceeds `MAX_MEMOIZE_SIZE`. + * + * @private + * @param {Function} func The function to have its output memoized. + * @returns {Function} Returns the new memoized function. + */ +function memoizeCapped(func) { + var result = memoize(func, function(key) { + if (cache.size === MAX_MEMOIZE_SIZE) { + cache.clear(); + } + return key; + }); + + var cache = result.cache; + return result; +} + +module.exports = memoizeCapped; diff --git a/node_modules/lodash/_mergeData.js b/node_modules/lodash/_mergeData.js new file mode 100644 index 0000000..cb570f9 --- /dev/null +++ b/node_modules/lodash/_mergeData.js @@ -0,0 +1,90 @@ +var composeArgs = require('./_composeArgs'), + composeArgsRight = require('./_composeArgsRight'), + replaceHolders = require('./_replaceHolders'); + +/** Used as the internal argument placeholder. */ +var PLACEHOLDER = '__lodash_placeholder__'; + +/** Used to compose bitmasks for function metadata. */ +var WRAP_BIND_FLAG = 1, + WRAP_BIND_KEY_FLAG = 2, + WRAP_CURRY_BOUND_FLAG = 4, + WRAP_CURRY_FLAG = 8, + WRAP_ARY_FLAG = 128, + WRAP_REARG_FLAG = 256; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMin = Math.min; + +/** + * Merges the function metadata of `source` into `data`. + * + * Merging metadata reduces the number of wrappers used to invoke a function. + * This is possible because methods like `_.bind`, `_.curry`, and `_.partial` + * may be applied regardless of execution order. Methods like `_.ary` and + * `_.rearg` modify function arguments, making the order in which they are + * executed important, preventing the merging of metadata. However, we make + * an exception for a safe combined case where curried functions have `_.ary` + * and or `_.rearg` applied. + * + * @private + * @param {Array} data The destination metadata. + * @param {Array} source The source metadata. + * @returns {Array} Returns `data`. + */ +function mergeData(data, source) { + var bitmask = data[1], + srcBitmask = source[1], + newBitmask = bitmask | srcBitmask, + isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG); + + var isCombo = + ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) || + ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) || + ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG)); + + // Exit early if metadata can't be merged. + if (!(isCommon || isCombo)) { + return data; + } + // Use source `thisArg` if available. + if (srcBitmask & WRAP_BIND_FLAG) { + data[2] = source[2]; + // Set when currying a bound function. + newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG; + } + // Compose partial arguments. + var value = source[3]; + if (value) { + var partials = data[3]; + data[3] = partials ? composeArgs(partials, value, source[4]) : value; + data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4]; + } + // Compose partial right arguments. + value = source[5]; + if (value) { + partials = data[5]; + data[5] = partials ? composeArgsRight(partials, value, source[6]) : value; + data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6]; + } + // Use source `argPos` if available. + value = source[7]; + if (value) { + data[7] = value; + } + // Use source `ary` if it's smaller. + if (srcBitmask & WRAP_ARY_FLAG) { + data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]); + } + // Use source `arity` if one is not provided. + if (data[9] == null) { + data[9] = source[9]; + } + // Use source `func` and merge bitmasks. + data[0] = source[0]; + data[1] = newBitmask; + + return data; +} + +module.exports = mergeData; diff --git a/node_modules/lodash/_metaMap.js b/node_modules/lodash/_metaMap.js new file mode 100644 index 0000000..0157a0b --- /dev/null +++ b/node_modules/lodash/_metaMap.js @@ -0,0 +1,6 @@ +var WeakMap = require('./_WeakMap'); + +/** Used to store function metadata. */ +var metaMap = WeakMap && new WeakMap; + +module.exports = metaMap; diff --git a/node_modules/lodash/_nativeCreate.js b/node_modules/lodash/_nativeCreate.js new file mode 100644 index 0000000..c7aede8 --- /dev/null +++ b/node_modules/lodash/_nativeCreate.js @@ -0,0 +1,6 @@ +var getNative = require('./_getNative'); + +/* Built-in method references that are verified to be native. */ +var nativeCreate = getNative(Object, 'create'); + +module.exports = nativeCreate; diff --git a/node_modules/lodash/_nativeKeys.js b/node_modules/lodash/_nativeKeys.js new file mode 100644 index 0000000..479a104 --- /dev/null +++ b/node_modules/lodash/_nativeKeys.js @@ -0,0 +1,6 @@ +var overArg = require('./_overArg'); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeKeys = overArg(Object.keys, Object); + +module.exports = nativeKeys; diff --git a/node_modules/lodash/_nativeKeysIn.js b/node_modules/lodash/_nativeKeysIn.js new file mode 100644 index 0000000..00ee505 --- /dev/null +++ b/node_modules/lodash/_nativeKeysIn.js @@ -0,0 +1,20 @@ +/** + * This function is like + * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * except that it includes inherited enumerable properties. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ +function nativeKeysIn(object) { + var result = []; + if (object != null) { + for (var key in Object(object)) { + result.push(key); + } + } + return result; +} + +module.exports = nativeKeysIn; diff --git a/node_modules/lodash/_nodeUtil.js b/node_modules/lodash/_nodeUtil.js new file mode 100644 index 0000000..983d78f --- /dev/null +++ b/node_modules/lodash/_nodeUtil.js @@ -0,0 +1,30 @@ +var freeGlobal = require('./_freeGlobal'); + +/** Detect free variable `exports`. */ +var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; + +/** Detect free variable `module`. */ +var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; + +/** Detect the popular CommonJS extension `module.exports`. */ +var moduleExports = freeModule && freeModule.exports === freeExports; + +/** Detect free variable `process` from Node.js. */ +var freeProcess = moduleExports && freeGlobal.process; + +/** Used to access faster Node.js helpers. */ +var nodeUtil = (function() { + try { + // Use `util.types` for Node.js 10+. + var types = freeModule && freeModule.require && freeModule.require('util').types; + + if (types) { + return types; + } + + // Legacy `process.binding('util')` for Node.js < 10. + return freeProcess && freeProcess.binding && freeProcess.binding('util'); + } catch (e) {} +}()); + +module.exports = nodeUtil; diff --git a/node_modules/lodash/_objectToString.js b/node_modules/lodash/_objectToString.js new file mode 100644 index 0000000..c614ec0 --- /dev/null +++ b/node_modules/lodash/_objectToString.js @@ -0,0 +1,22 @@ +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var nativeObjectToString = objectProto.toString; + +/** + * Converts `value` to a string using `Object.prototype.toString`. + * + * @private + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + */ +function objectToString(value) { + return nativeObjectToString.call(value); +} + +module.exports = objectToString; diff --git a/node_modules/lodash/_overArg.js b/node_modules/lodash/_overArg.js new file mode 100644 index 0000000..651c5c5 --- /dev/null +++ b/node_modules/lodash/_overArg.js @@ -0,0 +1,15 @@ +/** + * Creates a unary function that invokes `func` with its argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ +function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; +} + +module.exports = overArg; diff --git a/node_modules/lodash/_overRest.js b/node_modules/lodash/_overRest.js new file mode 100644 index 0000000..c7cdef3 --- /dev/null +++ b/node_modules/lodash/_overRest.js @@ -0,0 +1,36 @@ +var apply = require('./_apply'); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max; + +/** + * A specialized version of `baseRest` which transforms the rest array. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @param {Function} transform The rest array transform. + * @returns {Function} Returns the new function. + */ +function overRest(func, start, transform) { + start = nativeMax(start === undefined ? (func.length - 1) : start, 0); + return function() { + var args = arguments, + index = -1, + length = nativeMax(args.length - start, 0), + array = Array(length); + + while (++index < length) { + array[index] = args[start + index]; + } + index = -1; + var otherArgs = Array(start + 1); + while (++index < start) { + otherArgs[index] = args[index]; + } + otherArgs[start] = transform(array); + return apply(func, this, otherArgs); + }; +} + +module.exports = overRest; diff --git a/node_modules/lodash/_parent.js b/node_modules/lodash/_parent.js new file mode 100644 index 0000000..f174328 --- /dev/null +++ b/node_modules/lodash/_parent.js @@ -0,0 +1,16 @@ +var baseGet = require('./_baseGet'), + baseSlice = require('./_baseSlice'); + +/** + * Gets the parent value at `path` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Array} path The path to get the parent value of. + * @returns {*} Returns the parent value. + */ +function parent(object, path) { + return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1)); +} + +module.exports = parent; diff --git a/node_modules/lodash/_reEscape.js b/node_modules/lodash/_reEscape.js new file mode 100644 index 0000000..7f47eda --- /dev/null +++ b/node_modules/lodash/_reEscape.js @@ -0,0 +1,4 @@ +/** Used to match template delimiters. */ +var reEscape = /<%-([\s\S]+?)%>/g; + +module.exports = reEscape; diff --git a/node_modules/lodash/_reEvaluate.js b/node_modules/lodash/_reEvaluate.js new file mode 100644 index 0000000..6adfc31 --- /dev/null +++ b/node_modules/lodash/_reEvaluate.js @@ -0,0 +1,4 @@ +/** Used to match template delimiters. */ +var reEvaluate = /<%([\s\S]+?)%>/g; + +module.exports = reEvaluate; diff --git a/node_modules/lodash/_reInterpolate.js b/node_modules/lodash/_reInterpolate.js new file mode 100644 index 0000000..d02ff0b --- /dev/null +++ b/node_modules/lodash/_reInterpolate.js @@ -0,0 +1,4 @@ +/** Used to match template delimiters. */ +var reInterpolate = /<%=([\s\S]+?)%>/g; + +module.exports = reInterpolate; diff --git a/node_modules/lodash/_realNames.js b/node_modules/lodash/_realNames.js new file mode 100644 index 0000000..aa0d529 --- /dev/null +++ b/node_modules/lodash/_realNames.js @@ -0,0 +1,4 @@ +/** Used to lookup unminified function names. */ +var realNames = {}; + +module.exports = realNames; diff --git a/node_modules/lodash/_reorder.js b/node_modules/lodash/_reorder.js new file mode 100644 index 0000000..a3502b0 --- /dev/null +++ b/node_modules/lodash/_reorder.js @@ -0,0 +1,29 @@ +var copyArray = require('./_copyArray'), + isIndex = require('./_isIndex'); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMin = Math.min; + +/** + * Reorder `array` according to the specified indexes where the element at + * the first index is assigned as the first element, the element at + * the second index is assigned as the second element, and so on. + * + * @private + * @param {Array} array The array to reorder. + * @param {Array} indexes The arranged array indexes. + * @returns {Array} Returns `array`. + */ +function reorder(array, indexes) { + var arrLength = array.length, + length = nativeMin(indexes.length, arrLength), + oldArray = copyArray(array); + + while (length--) { + var index = indexes[length]; + array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined; + } + return array; +} + +module.exports = reorder; diff --git a/node_modules/lodash/_replaceHolders.js b/node_modules/lodash/_replaceHolders.js new file mode 100644 index 0000000..74360ec --- /dev/null +++ b/node_modules/lodash/_replaceHolders.js @@ -0,0 +1,29 @@ +/** Used as the internal argument placeholder. */ +var PLACEHOLDER = '__lodash_placeholder__'; + +/** + * Replaces all `placeholder` elements in `array` with an internal placeholder + * and returns an array of their indexes. + * + * @private + * @param {Array} array The array to modify. + * @param {*} placeholder The placeholder to replace. + * @returns {Array} Returns the new array of placeholder indexes. + */ +function replaceHolders(array, placeholder) { + var index = -1, + length = array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (value === placeholder || value === PLACEHOLDER) { + array[index] = PLACEHOLDER; + result[resIndex++] = index; + } + } + return result; +} + +module.exports = replaceHolders; diff --git a/node_modules/lodash/_root.js b/node_modules/lodash/_root.js new file mode 100644 index 0000000..d2852be --- /dev/null +++ b/node_modules/lodash/_root.js @@ -0,0 +1,9 @@ +var freeGlobal = require('./_freeGlobal'); + +/** Detect free variable `self`. */ +var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + +/** Used as a reference to the global object. */ +var root = freeGlobal || freeSelf || Function('return this')(); + +module.exports = root; diff --git a/node_modules/lodash/_safeGet.js b/node_modules/lodash/_safeGet.js new file mode 100644 index 0000000..b070897 --- /dev/null +++ b/node_modules/lodash/_safeGet.js @@ -0,0 +1,21 @@ +/** + * Gets the value at `key`, unless `key` is "__proto__" or "constructor". + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ +function safeGet(object, key) { + if (key === 'constructor' && typeof object[key] === 'function') { + return; + } + + if (key == '__proto__') { + return; + } + + return object[key]; +} + +module.exports = safeGet; diff --git a/node_modules/lodash/_setCacheAdd.js b/node_modules/lodash/_setCacheAdd.js new file mode 100644 index 0000000..1081a74 --- /dev/null +++ b/node_modules/lodash/_setCacheAdd.js @@ -0,0 +1,19 @@ +/** Used to stand-in for `undefined` hash values. */ +var HASH_UNDEFINED = '__lodash_hash_undefined__'; + +/** + * Adds `value` to the array cache. + * + * @private + * @name add + * @memberOf SetCache + * @alias push + * @param {*} value The value to cache. + * @returns {Object} Returns the cache instance. + */ +function setCacheAdd(value) { + this.__data__.set(value, HASH_UNDEFINED); + return this; +} + +module.exports = setCacheAdd; diff --git a/node_modules/lodash/_setCacheHas.js b/node_modules/lodash/_setCacheHas.js new file mode 100644 index 0000000..9a49255 --- /dev/null +++ b/node_modules/lodash/_setCacheHas.js @@ -0,0 +1,14 @@ +/** + * Checks if `value` is in the array cache. + * + * @private + * @name has + * @memberOf SetCache + * @param {*} value The value to search for. + * @returns {number} Returns `true` if `value` is found, else `false`. + */ +function setCacheHas(value) { + return this.__data__.has(value); +} + +module.exports = setCacheHas; diff --git a/node_modules/lodash/_setData.js b/node_modules/lodash/_setData.js new file mode 100644 index 0000000..e5cf3eb --- /dev/null +++ b/node_modules/lodash/_setData.js @@ -0,0 +1,20 @@ +var baseSetData = require('./_baseSetData'), + shortOut = require('./_shortOut'); + +/** + * Sets metadata for `func`. + * + * **Note:** If this function becomes hot, i.e. is invoked a lot in a short + * period of time, it will trip its breaker and transition to an identity + * function to avoid garbage collection pauses in V8. See + * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070) + * for more details. + * + * @private + * @param {Function} func The function to associate metadata with. + * @param {*} data The metadata. + * @returns {Function} Returns `func`. + */ +var setData = shortOut(baseSetData); + +module.exports = setData; diff --git a/node_modules/lodash/_setToArray.js b/node_modules/lodash/_setToArray.js new file mode 100644 index 0000000..b87f074 --- /dev/null +++ b/node_modules/lodash/_setToArray.js @@ -0,0 +1,18 @@ +/** + * Converts `set` to an array of its values. + * + * @private + * @param {Object} set The set to convert. + * @returns {Array} Returns the values. + */ +function setToArray(set) { + var index = -1, + result = Array(set.size); + + set.forEach(function(value) { + result[++index] = value; + }); + return result; +} + +module.exports = setToArray; diff --git a/node_modules/lodash/_setToPairs.js b/node_modules/lodash/_setToPairs.js new file mode 100644 index 0000000..36ad37a --- /dev/null +++ b/node_modules/lodash/_setToPairs.js @@ -0,0 +1,18 @@ +/** + * Converts `set` to its value-value pairs. + * + * @private + * @param {Object} set The set to convert. + * @returns {Array} Returns the value-value pairs. + */ +function setToPairs(set) { + var index = -1, + result = Array(set.size); + + set.forEach(function(value) { + result[++index] = [value, value]; + }); + return result; +} + +module.exports = setToPairs; diff --git a/node_modules/lodash/_setToString.js b/node_modules/lodash/_setToString.js new file mode 100644 index 0000000..6ca8419 --- /dev/null +++ b/node_modules/lodash/_setToString.js @@ -0,0 +1,14 @@ +var baseSetToString = require('./_baseSetToString'), + shortOut = require('./_shortOut'); + +/** + * Sets the `toString` method of `func` to return `string`. + * + * @private + * @param {Function} func The function to modify. + * @param {Function} string The `toString` result. + * @returns {Function} Returns `func`. + */ +var setToString = shortOut(baseSetToString); + +module.exports = setToString; diff --git a/node_modules/lodash/_setWrapToString.js b/node_modules/lodash/_setWrapToString.js new file mode 100644 index 0000000..decdc44 --- /dev/null +++ b/node_modules/lodash/_setWrapToString.js @@ -0,0 +1,21 @@ +var getWrapDetails = require('./_getWrapDetails'), + insertWrapDetails = require('./_insertWrapDetails'), + setToString = require('./_setToString'), + updateWrapDetails = require('./_updateWrapDetails'); + +/** + * Sets the `toString` method of `wrapper` to mimic the source of `reference` + * with wrapper details in a comment at the top of the source body. + * + * @private + * @param {Function} wrapper The function to modify. + * @param {Function} reference The reference function. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @returns {Function} Returns `wrapper`. + */ +function setWrapToString(wrapper, reference, bitmask) { + var source = (reference + ''); + return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask))); +} + +module.exports = setWrapToString; diff --git a/node_modules/lodash/_shortOut.js b/node_modules/lodash/_shortOut.js new file mode 100644 index 0000000..3300a07 --- /dev/null +++ b/node_modules/lodash/_shortOut.js @@ -0,0 +1,37 @@ +/** Used to detect hot functions by number of calls within a span of milliseconds. */ +var HOT_COUNT = 800, + HOT_SPAN = 16; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeNow = Date.now; + +/** + * Creates a function that'll short out and invoke `identity` instead + * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN` + * milliseconds. + * + * @private + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new shortable function. + */ +function shortOut(func) { + var count = 0, + lastCalled = 0; + + return function() { + var stamp = nativeNow(), + remaining = HOT_SPAN - (stamp - lastCalled); + + lastCalled = stamp; + if (remaining > 0) { + if (++count >= HOT_COUNT) { + return arguments[0]; + } + } else { + count = 0; + } + return func.apply(undefined, arguments); + }; +} + +module.exports = shortOut; diff --git a/node_modules/lodash/_shuffleSelf.js b/node_modules/lodash/_shuffleSelf.js new file mode 100644 index 0000000..8bcc4f5 --- /dev/null +++ b/node_modules/lodash/_shuffleSelf.js @@ -0,0 +1,28 @@ +var baseRandom = require('./_baseRandom'); + +/** + * A specialized version of `_.shuffle` which mutates and sets the size of `array`. + * + * @private + * @param {Array} array The array to shuffle. + * @param {number} [size=array.length] The size of `array`. + * @returns {Array} Returns `array`. + */ +function shuffleSelf(array, size) { + var index = -1, + length = array.length, + lastIndex = length - 1; + + size = size === undefined ? length : size; + while (++index < size) { + var rand = baseRandom(index, lastIndex), + value = array[rand]; + + array[rand] = array[index]; + array[index] = value; + } + array.length = size; + return array; +} + +module.exports = shuffleSelf; diff --git a/node_modules/lodash/_stackClear.js b/node_modules/lodash/_stackClear.js new file mode 100644 index 0000000..ce8e5a9 --- /dev/null +++ b/node_modules/lodash/_stackClear.js @@ -0,0 +1,15 @@ +var ListCache = require('./_ListCache'); + +/** + * Removes all key-value entries from the stack. + * + * @private + * @name clear + * @memberOf Stack + */ +function stackClear() { + this.__data__ = new ListCache; + this.size = 0; +} + +module.exports = stackClear; diff --git a/node_modules/lodash/_stackDelete.js b/node_modules/lodash/_stackDelete.js new file mode 100644 index 0000000..ff9887a --- /dev/null +++ b/node_modules/lodash/_stackDelete.js @@ -0,0 +1,18 @@ +/** + * Removes `key` and its value from the stack. + * + * @private + * @name delete + * @memberOf Stack + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function stackDelete(key) { + var data = this.__data__, + result = data['delete'](key); + + this.size = data.size; + return result; +} + +module.exports = stackDelete; diff --git a/node_modules/lodash/_stackGet.js b/node_modules/lodash/_stackGet.js new file mode 100644 index 0000000..1cdf004 --- /dev/null +++ b/node_modules/lodash/_stackGet.js @@ -0,0 +1,14 @@ +/** + * Gets the stack value for `key`. + * + * @private + * @name get + * @memberOf Stack + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function stackGet(key) { + return this.__data__.get(key); +} + +module.exports = stackGet; diff --git a/node_modules/lodash/_stackHas.js b/node_modules/lodash/_stackHas.js new file mode 100644 index 0000000..16a3ad1 --- /dev/null +++ b/node_modules/lodash/_stackHas.js @@ -0,0 +1,14 @@ +/** + * Checks if a stack value for `key` exists. + * + * @private + * @name has + * @memberOf Stack + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function stackHas(key) { + return this.__data__.has(key); +} + +module.exports = stackHas; diff --git a/node_modules/lodash/_stackSet.js b/node_modules/lodash/_stackSet.js new file mode 100644 index 0000000..b790ac5 --- /dev/null +++ b/node_modules/lodash/_stackSet.js @@ -0,0 +1,34 @@ +var ListCache = require('./_ListCache'), + Map = require('./_Map'), + MapCache = require('./_MapCache'); + +/** Used as the size to enable large array optimizations. */ +var LARGE_ARRAY_SIZE = 200; + +/** + * Sets the stack `key` to `value`. + * + * @private + * @name set + * @memberOf Stack + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the stack cache instance. + */ +function stackSet(key, value) { + var data = this.__data__; + if (data instanceof ListCache) { + var pairs = data.__data__; + if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { + pairs.push([key, value]); + this.size = ++data.size; + return this; + } + data = this.__data__ = new MapCache(pairs); + } + data.set(key, value); + this.size = data.size; + return this; +} + +module.exports = stackSet; diff --git a/node_modules/lodash/_strictIndexOf.js b/node_modules/lodash/_strictIndexOf.js new file mode 100644 index 0000000..0486a49 --- /dev/null +++ b/node_modules/lodash/_strictIndexOf.js @@ -0,0 +1,23 @@ +/** + * A specialized version of `_.indexOf` which performs strict equality + * comparisons of values, i.e. `===`. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function strictIndexOf(array, value, fromIndex) { + var index = fromIndex - 1, + length = array.length; + + while (++index < length) { + if (array[index] === value) { + return index; + } + } + return -1; +} + +module.exports = strictIndexOf; diff --git a/node_modules/lodash/_strictLastIndexOf.js b/node_modules/lodash/_strictLastIndexOf.js new file mode 100644 index 0000000..d7310dc --- /dev/null +++ b/node_modules/lodash/_strictLastIndexOf.js @@ -0,0 +1,21 @@ +/** + * A specialized version of `_.lastIndexOf` which performs strict equality + * comparisons of values, i.e. `===`. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function strictLastIndexOf(array, value, fromIndex) { + var index = fromIndex + 1; + while (index--) { + if (array[index] === value) { + return index; + } + } + return index; +} + +module.exports = strictLastIndexOf; diff --git a/node_modules/lodash/_stringSize.js b/node_modules/lodash/_stringSize.js new file mode 100644 index 0000000..17ef462 --- /dev/null +++ b/node_modules/lodash/_stringSize.js @@ -0,0 +1,18 @@ +var asciiSize = require('./_asciiSize'), + hasUnicode = require('./_hasUnicode'), + unicodeSize = require('./_unicodeSize'); + +/** + * Gets the number of symbols in `string`. + * + * @private + * @param {string} string The string to inspect. + * @returns {number} Returns the string size. + */ +function stringSize(string) { + return hasUnicode(string) + ? unicodeSize(string) + : asciiSize(string); +} + +module.exports = stringSize; diff --git a/node_modules/lodash/_stringToArray.js b/node_modules/lodash/_stringToArray.js new file mode 100644 index 0000000..d161158 --- /dev/null +++ b/node_modules/lodash/_stringToArray.js @@ -0,0 +1,18 @@ +var asciiToArray = require('./_asciiToArray'), + hasUnicode = require('./_hasUnicode'), + unicodeToArray = require('./_unicodeToArray'); + +/** + * Converts `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ +function stringToArray(string) { + return hasUnicode(string) + ? unicodeToArray(string) + : asciiToArray(string); +} + +module.exports = stringToArray; diff --git a/node_modules/lodash/_stringToPath.js b/node_modules/lodash/_stringToPath.js new file mode 100644 index 0000000..8f39f8a --- /dev/null +++ b/node_modules/lodash/_stringToPath.js @@ -0,0 +1,27 @@ +var memoizeCapped = require('./_memoizeCapped'); + +/** Used to match property names within property paths. */ +var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; + +/** Used to match backslashes in property paths. */ +var reEscapeChar = /\\(\\)?/g; + +/** + * Converts `string` to a property path array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the property path array. + */ +var stringToPath = memoizeCapped(function(string) { + var result = []; + if (string.charCodeAt(0) === 46 /* . */) { + result.push(''); + } + string.replace(rePropName, function(match, number, quote, subString) { + result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match)); + }); + return result; +}); + +module.exports = stringToPath; diff --git a/node_modules/lodash/_toKey.js b/node_modules/lodash/_toKey.js new file mode 100644 index 0000000..c6d645c --- /dev/null +++ b/node_modules/lodash/_toKey.js @@ -0,0 +1,21 @@ +var isSymbol = require('./isSymbol'); + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0; + +/** + * Converts `value` to a string key if it's not a string or symbol. + * + * @private + * @param {*} value The value to inspect. + * @returns {string|symbol} Returns the key. + */ +function toKey(value) { + if (typeof value == 'string' || isSymbol(value)) { + return value; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; +} + +module.exports = toKey; diff --git a/node_modules/lodash/_toSource.js b/node_modules/lodash/_toSource.js new file mode 100644 index 0000000..a020b38 --- /dev/null +++ b/node_modules/lodash/_toSource.js @@ -0,0 +1,26 @@ +/** Used for built-in method references. */ +var funcProto = Function.prototype; + +/** Used to resolve the decompiled source of functions. */ +var funcToString = funcProto.toString; + +/** + * Converts `func` to its source code. + * + * @private + * @param {Function} func The function to convert. + * @returns {string} Returns the source code. + */ +function toSource(func) { + if (func != null) { + try { + return funcToString.call(func); + } catch (e) {} + try { + return (func + ''); + } catch (e) {} + } + return ''; +} + +module.exports = toSource; diff --git a/node_modules/lodash/_trimmedEndIndex.js b/node_modules/lodash/_trimmedEndIndex.js new file mode 100644 index 0000000..139439a --- /dev/null +++ b/node_modules/lodash/_trimmedEndIndex.js @@ -0,0 +1,19 @@ +/** Used to match a single whitespace character. */ +var reWhitespace = /\s/; + +/** + * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace + * character of `string`. + * + * @private + * @param {string} string The string to inspect. + * @returns {number} Returns the index of the last non-whitespace character. + */ +function trimmedEndIndex(string) { + var index = string.length; + + while (index-- && reWhitespace.test(string.charAt(index))) {} + return index; +} + +module.exports = trimmedEndIndex; diff --git a/node_modules/lodash/_unescapeHtmlChar.js b/node_modules/lodash/_unescapeHtmlChar.js new file mode 100644 index 0000000..a71fecb --- /dev/null +++ b/node_modules/lodash/_unescapeHtmlChar.js @@ -0,0 +1,21 @@ +var basePropertyOf = require('./_basePropertyOf'); + +/** Used to map HTML entities to characters. */ +var htmlUnescapes = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + ''': "'" +}; + +/** + * Used by `_.unescape` to convert HTML entities to characters. + * + * @private + * @param {string} chr The matched character to unescape. + * @returns {string} Returns the unescaped character. + */ +var unescapeHtmlChar = basePropertyOf(htmlUnescapes); + +module.exports = unescapeHtmlChar; diff --git a/node_modules/lodash/_unicodeSize.js b/node_modules/lodash/_unicodeSize.js new file mode 100644 index 0000000..68137ec --- /dev/null +++ b/node_modules/lodash/_unicodeSize.js @@ -0,0 +1,44 @@ +/** Used to compose unicode character classes. */ +var rsAstralRange = '\\ud800-\\udfff', + rsComboMarksRange = '\\u0300-\\u036f', + reComboHalfMarksRange = '\\ufe20-\\ufe2f', + rsComboSymbolsRange = '\\u20d0-\\u20ff', + rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, + rsVarRange = '\\ufe0e\\ufe0f'; + +/** Used to compose unicode capture groups. */ +var rsAstral = '[' + rsAstralRange + ']', + rsCombo = '[' + rsComboRange + ']', + rsFitz = '\\ud83c[\\udffb-\\udfff]', + rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', + rsNonAstral = '[^' + rsAstralRange + ']', + rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', + rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', + rsZWJ = '\\u200d'; + +/** Used to compose unicode regexes. */ +var reOptMod = rsModifier + '?', + rsOptVar = '[' + rsVarRange + ']?', + rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', + rsSeq = rsOptVar + reOptMod + rsOptJoin, + rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; + +/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ +var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); + +/** + * Gets the size of a Unicode `string`. + * + * @private + * @param {string} string The string inspect. + * @returns {number} Returns the string size. + */ +function unicodeSize(string) { + var result = reUnicode.lastIndex = 0; + while (reUnicode.test(string)) { + ++result; + } + return result; +} + +module.exports = unicodeSize; diff --git a/node_modules/lodash/_unicodeToArray.js b/node_modules/lodash/_unicodeToArray.js new file mode 100644 index 0000000..2a725c0 --- /dev/null +++ b/node_modules/lodash/_unicodeToArray.js @@ -0,0 +1,40 @@ +/** Used to compose unicode character classes. */ +var rsAstralRange = '\\ud800-\\udfff', + rsComboMarksRange = '\\u0300-\\u036f', + reComboHalfMarksRange = '\\ufe20-\\ufe2f', + rsComboSymbolsRange = '\\u20d0-\\u20ff', + rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, + rsVarRange = '\\ufe0e\\ufe0f'; + +/** Used to compose unicode capture groups. */ +var rsAstral = '[' + rsAstralRange + ']', + rsCombo = '[' + rsComboRange + ']', + rsFitz = '\\ud83c[\\udffb-\\udfff]', + rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', + rsNonAstral = '[^' + rsAstralRange + ']', + rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', + rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', + rsZWJ = '\\u200d'; + +/** Used to compose unicode regexes. */ +var reOptMod = rsModifier + '?', + rsOptVar = '[' + rsVarRange + ']?', + rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', + rsSeq = rsOptVar + reOptMod + rsOptJoin, + rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; + +/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ +var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); + +/** + * Converts a Unicode `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ +function unicodeToArray(string) { + return string.match(reUnicode) || []; +} + +module.exports = unicodeToArray; diff --git a/node_modules/lodash/_unicodeWords.js b/node_modules/lodash/_unicodeWords.js new file mode 100644 index 0000000..e72e6e0 --- /dev/null +++ b/node_modules/lodash/_unicodeWords.js @@ -0,0 +1,69 @@ +/** Used to compose unicode character classes. */ +var rsAstralRange = '\\ud800-\\udfff', + rsComboMarksRange = '\\u0300-\\u036f', + reComboHalfMarksRange = '\\ufe20-\\ufe2f', + rsComboSymbolsRange = '\\u20d0-\\u20ff', + rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, + rsDingbatRange = '\\u2700-\\u27bf', + rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff', + rsMathOpRange = '\\xac\\xb1\\xd7\\xf7', + rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf', + rsPunctuationRange = '\\u2000-\\u206f', + rsSpaceRange = ' \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000', + rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde', + rsVarRange = '\\ufe0e\\ufe0f', + rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange; + +/** Used to compose unicode capture groups. */ +var rsApos = "['\u2019]", + rsBreak = '[' + rsBreakRange + ']', + rsCombo = '[' + rsComboRange + ']', + rsDigits = '\\d+', + rsDingbat = '[' + rsDingbatRange + ']', + rsLower = '[' + rsLowerRange + ']', + rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']', + rsFitz = '\\ud83c[\\udffb-\\udfff]', + rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', + rsNonAstral = '[^' + rsAstralRange + ']', + rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', + rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', + rsUpper = '[' + rsUpperRange + ']', + rsZWJ = '\\u200d'; + +/** Used to compose unicode regexes. */ +var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')', + rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')', + rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?', + rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?', + reOptMod = rsModifier + '?', + rsOptVar = '[' + rsVarRange + ']?', + rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', + rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])', + rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])', + rsSeq = rsOptVar + reOptMod + rsOptJoin, + rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq; + +/** Used to match complex or compound words. */ +var reUnicodeWord = RegExp([ + rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')', + rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')', + rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower, + rsUpper + '+' + rsOptContrUpper, + rsOrdUpper, + rsOrdLower, + rsDigits, + rsEmoji +].join('|'), 'g'); + +/** + * Splits a Unicode `string` into an array of its words. + * + * @private + * @param {string} The string to inspect. + * @returns {Array} Returns the words of `string`. + */ +function unicodeWords(string) { + return string.match(reUnicodeWord) || []; +} + +module.exports = unicodeWords; diff --git a/node_modules/lodash/_updateWrapDetails.js b/node_modules/lodash/_updateWrapDetails.js new file mode 100644 index 0000000..8759fbd --- /dev/null +++ b/node_modules/lodash/_updateWrapDetails.js @@ -0,0 +1,46 @@ +var arrayEach = require('./_arrayEach'), + arrayIncludes = require('./_arrayIncludes'); + +/** Used to compose bitmasks for function metadata. */ +var WRAP_BIND_FLAG = 1, + WRAP_BIND_KEY_FLAG = 2, + WRAP_CURRY_FLAG = 8, + WRAP_CURRY_RIGHT_FLAG = 16, + WRAP_PARTIAL_FLAG = 32, + WRAP_PARTIAL_RIGHT_FLAG = 64, + WRAP_ARY_FLAG = 128, + WRAP_REARG_FLAG = 256, + WRAP_FLIP_FLAG = 512; + +/** Used to associate wrap methods with their bit flags. */ +var wrapFlags = [ + ['ary', WRAP_ARY_FLAG], + ['bind', WRAP_BIND_FLAG], + ['bindKey', WRAP_BIND_KEY_FLAG], + ['curry', WRAP_CURRY_FLAG], + ['curryRight', WRAP_CURRY_RIGHT_FLAG], + ['flip', WRAP_FLIP_FLAG], + ['partial', WRAP_PARTIAL_FLAG], + ['partialRight', WRAP_PARTIAL_RIGHT_FLAG], + ['rearg', WRAP_REARG_FLAG] +]; + +/** + * Updates wrapper `details` based on `bitmask` flags. + * + * @private + * @returns {Array} details The details to modify. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @returns {Array} Returns `details`. + */ +function updateWrapDetails(details, bitmask) { + arrayEach(wrapFlags, function(pair) { + var value = '_.' + pair[0]; + if ((bitmask & pair[1]) && !arrayIncludes(details, value)) { + details.push(value); + } + }); + return details.sort(); +} + +module.exports = updateWrapDetails; diff --git a/node_modules/lodash/_wrapperClone.js b/node_modules/lodash/_wrapperClone.js new file mode 100644 index 0000000..7bb58a2 --- /dev/null +++ b/node_modules/lodash/_wrapperClone.js @@ -0,0 +1,23 @@ +var LazyWrapper = require('./_LazyWrapper'), + LodashWrapper = require('./_LodashWrapper'), + copyArray = require('./_copyArray'); + +/** + * Creates a clone of `wrapper`. + * + * @private + * @param {Object} wrapper The wrapper to clone. + * @returns {Object} Returns the cloned wrapper. + */ +function wrapperClone(wrapper) { + if (wrapper instanceof LazyWrapper) { + return wrapper.clone(); + } + var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__); + result.__actions__ = copyArray(wrapper.__actions__); + result.__index__ = wrapper.__index__; + result.__values__ = wrapper.__values__; + return result; +} + +module.exports = wrapperClone; diff --git a/node_modules/lodash/add.js b/node_modules/lodash/add.js new file mode 100644 index 0000000..f069515 --- /dev/null +++ b/node_modules/lodash/add.js @@ -0,0 +1,22 @@ +var createMathOperation = require('./_createMathOperation'); + +/** + * Adds two numbers. + * + * @static + * @memberOf _ + * @since 3.4.0 + * @category Math + * @param {number} augend The first number in an addition. + * @param {number} addend The second number in an addition. + * @returns {number} Returns the total. + * @example + * + * _.add(6, 4); + * // => 10 + */ +var add = createMathOperation(function(augend, addend) { + return augend + addend; +}, 0); + +module.exports = add; diff --git a/node_modules/lodash/after.js b/node_modules/lodash/after.js new file mode 100644 index 0000000..3900c97 --- /dev/null +++ b/node_modules/lodash/after.js @@ -0,0 +1,42 @@ +var toInteger = require('./toInteger'); + +/** Error message constants. */ +var FUNC_ERROR_TEXT = 'Expected a function'; + +/** + * The opposite of `_.before`; this method creates a function that invokes + * `func` once it's called `n` or more times. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {number} n The number of calls before `func` is invoked. + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * var saves = ['profile', 'settings']; + * + * var done = _.after(saves.length, function() { + * console.log('done saving!'); + * }); + * + * _.forEach(saves, function(type) { + * asyncSave({ 'type': type, 'complete': done }); + * }); + * // => Logs 'done saving!' after the two async saves have completed. + */ +function after(n, func) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + n = toInteger(n); + return function() { + if (--n < 1) { + return func.apply(this, arguments); + } + }; +} + +module.exports = after; diff --git a/node_modules/lodash/array.js b/node_modules/lodash/array.js new file mode 100644 index 0000000..af688d3 --- /dev/null +++ b/node_modules/lodash/array.js @@ -0,0 +1,67 @@ +module.exports = { + 'chunk': require('./chunk'), + 'compact': require('./compact'), + 'concat': require('./concat'), + 'difference': require('./difference'), + 'differenceBy': require('./differenceBy'), + 'differenceWith': require('./differenceWith'), + 'drop': require('./drop'), + 'dropRight': require('./dropRight'), + 'dropRightWhile': require('./dropRightWhile'), + 'dropWhile': require('./dropWhile'), + 'fill': require('./fill'), + 'findIndex': require('./findIndex'), + 'findLastIndex': require('./findLastIndex'), + 'first': require('./first'), + 'flatten': require('./flatten'), + 'flattenDeep': require('./flattenDeep'), + 'flattenDepth': require('./flattenDepth'), + 'fromPairs': require('./fromPairs'), + 'head': require('./head'), + 'indexOf': require('./indexOf'), + 'initial': require('./initial'), + 'intersection': require('./intersection'), + 'intersectionBy': require('./intersectionBy'), + 'intersectionWith': require('./intersectionWith'), + 'join': require('./join'), + 'last': require('./last'), + 'lastIndexOf': require('./lastIndexOf'), + 'nth': require('./nth'), + 'pull': require('./pull'), + 'pullAll': require('./pullAll'), + 'pullAllBy': require('./pullAllBy'), + 'pullAllWith': require('./pullAllWith'), + 'pullAt': require('./pullAt'), + 'remove': require('./remove'), + 'reverse': require('./reverse'), + 'slice': require('./slice'), + 'sortedIndex': require('./sortedIndex'), + 'sortedIndexBy': require('./sortedIndexBy'), + 'sortedIndexOf': require('./sortedIndexOf'), + 'sortedLastIndex': require('./sortedLastIndex'), + 'sortedLastIndexBy': require('./sortedLastIndexBy'), + 'sortedLastIndexOf': require('./sortedLastIndexOf'), + 'sortedUniq': require('./sortedUniq'), + 'sortedUniqBy': require('./sortedUniqBy'), + 'tail': require('./tail'), + 'take': require('./take'), + 'takeRight': require('./takeRight'), + 'takeRightWhile': require('./takeRightWhile'), + 'takeWhile': require('./takeWhile'), + 'union': require('./union'), + 'unionBy': require('./unionBy'), + 'unionWith': require('./unionWith'), + 'uniq': require('./uniq'), + 'uniqBy': require('./uniqBy'), + 'uniqWith': require('./uniqWith'), + 'unzip': require('./unzip'), + 'unzipWith': require('./unzipWith'), + 'without': require('./without'), + 'xor': require('./xor'), + 'xorBy': require('./xorBy'), + 'xorWith': require('./xorWith'), + 'zip': require('./zip'), + 'zipObject': require('./zipObject'), + 'zipObjectDeep': require('./zipObjectDeep'), + 'zipWith': require('./zipWith') +}; diff --git a/node_modules/lodash/ary.js b/node_modules/lodash/ary.js new file mode 100644 index 0000000..70c87d0 --- /dev/null +++ b/node_modules/lodash/ary.js @@ -0,0 +1,29 @@ +var createWrap = require('./_createWrap'); + +/** Used to compose bitmasks for function metadata. */ +var WRAP_ARY_FLAG = 128; + +/** + * Creates a function that invokes `func`, with up to `n` arguments, + * ignoring any additional arguments. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {Function} func The function to cap arguments for. + * @param {number} [n=func.length] The arity cap. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Function} Returns the new capped function. + * @example + * + * _.map(['6', '8', '10'], _.ary(parseInt, 1)); + * // => [6, 8, 10] + */ +function ary(func, n, guard) { + n = guard ? undefined : n; + n = (func && n == null) ? func.length : n; + return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n); +} + +module.exports = ary; diff --git a/node_modules/lodash/assign.js b/node_modules/lodash/assign.js new file mode 100644 index 0000000..909db26 --- /dev/null +++ b/node_modules/lodash/assign.js @@ -0,0 +1,58 @@ +var assignValue = require('./_assignValue'), + copyObject = require('./_copyObject'), + createAssigner = require('./_createAssigner'), + isArrayLike = require('./isArrayLike'), + isPrototype = require('./_isPrototype'), + keys = require('./keys'); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Assigns own enumerable string keyed properties of source objects to the + * destination object. Source objects are applied from left to right. + * Subsequent sources overwrite property assignments of previous sources. + * + * **Note:** This method mutates `object` and is loosely based on + * [`Object.assign`](https://mdn.io/Object/assign). + * + * @static + * @memberOf _ + * @since 0.10.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.assignIn + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * function Bar() { + * this.c = 3; + * } + * + * Foo.prototype.b = 2; + * Bar.prototype.d = 4; + * + * _.assign({ 'a': 0 }, new Foo, new Bar); + * // => { 'a': 1, 'c': 3 } + */ +var assign = createAssigner(function(object, source) { + if (isPrototype(source) || isArrayLike(source)) { + copyObject(source, keys(source), object); + return; + } + for (var key in source) { + if (hasOwnProperty.call(source, key)) { + assignValue(object, key, source[key]); + } + } +}); + +module.exports = assign; diff --git a/node_modules/lodash/assignIn.js b/node_modules/lodash/assignIn.js new file mode 100644 index 0000000..e663473 --- /dev/null +++ b/node_modules/lodash/assignIn.js @@ -0,0 +1,40 @@ +var copyObject = require('./_copyObject'), + createAssigner = require('./_createAssigner'), + keysIn = require('./keysIn'); + +/** + * This method is like `_.assign` except that it iterates over own and + * inherited source properties. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @alias extend + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.assign + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * function Bar() { + * this.c = 3; + * } + * + * Foo.prototype.b = 2; + * Bar.prototype.d = 4; + * + * _.assignIn({ 'a': 0 }, new Foo, new Bar); + * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 } + */ +var assignIn = createAssigner(function(object, source) { + copyObject(source, keysIn(source), object); +}); + +module.exports = assignIn; diff --git a/node_modules/lodash/assignInWith.js b/node_modules/lodash/assignInWith.js new file mode 100644 index 0000000..68fcc0b --- /dev/null +++ b/node_modules/lodash/assignInWith.js @@ -0,0 +1,38 @@ +var copyObject = require('./_copyObject'), + createAssigner = require('./_createAssigner'), + keysIn = require('./keysIn'); + +/** + * This method is like `_.assignIn` except that it accepts `customizer` + * which is invoked to produce the assigned values. If `customizer` returns + * `undefined`, assignment is handled by the method instead. The `customizer` + * is invoked with five arguments: (objValue, srcValue, key, object, source). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @alias extendWith + * @category Object + * @param {Object} object The destination object. + * @param {...Object} sources The source objects. + * @param {Function} [customizer] The function to customize assigned values. + * @returns {Object} Returns `object`. + * @see _.assignWith + * @example + * + * function customizer(objValue, srcValue) { + * return _.isUndefined(objValue) ? srcValue : objValue; + * } + * + * var defaults = _.partialRight(_.assignInWith, customizer); + * + * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); + * // => { 'a': 1, 'b': 2 } + */ +var assignInWith = createAssigner(function(object, source, srcIndex, customizer) { + copyObject(source, keysIn(source), object, customizer); +}); + +module.exports = assignInWith; diff --git a/node_modules/lodash/assignWith.js b/node_modules/lodash/assignWith.js new file mode 100644 index 0000000..7dc6c76 --- /dev/null +++ b/node_modules/lodash/assignWith.js @@ -0,0 +1,37 @@ +var copyObject = require('./_copyObject'), + createAssigner = require('./_createAssigner'), + keys = require('./keys'); + +/** + * This method is like `_.assign` except that it accepts `customizer` + * which is invoked to produce the assigned values. If `customizer` returns + * `undefined`, assignment is handled by the method instead. The `customizer` + * is invoked with five arguments: (objValue, srcValue, key, object, source). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} sources The source objects. + * @param {Function} [customizer] The function to customize assigned values. + * @returns {Object} Returns `object`. + * @see _.assignInWith + * @example + * + * function customizer(objValue, srcValue) { + * return _.isUndefined(objValue) ? srcValue : objValue; + * } + * + * var defaults = _.partialRight(_.assignWith, customizer); + * + * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); + * // => { 'a': 1, 'b': 2 } + */ +var assignWith = createAssigner(function(object, source, srcIndex, customizer) { + copyObject(source, keys(source), object, customizer); +}); + +module.exports = assignWith; diff --git a/node_modules/lodash/at.js b/node_modules/lodash/at.js new file mode 100644 index 0000000..781ee9e --- /dev/null +++ b/node_modules/lodash/at.js @@ -0,0 +1,23 @@ +var baseAt = require('./_baseAt'), + flatRest = require('./_flatRest'); + +/** + * Creates an array of values corresponding to `paths` of `object`. + * + * @static + * @memberOf _ + * @since 1.0.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {...(string|string[])} [paths] The property paths to pick. + * @returns {Array} Returns the picked values. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; + * + * _.at(object, ['a[0].b.c', 'a[1]']); + * // => [3, 4] + */ +var at = flatRest(baseAt); + +module.exports = at; diff --git a/node_modules/lodash/attempt.js b/node_modules/lodash/attempt.js new file mode 100644 index 0000000..624d015 --- /dev/null +++ b/node_modules/lodash/attempt.js @@ -0,0 +1,35 @@ +var apply = require('./_apply'), + baseRest = require('./_baseRest'), + isError = require('./isError'); + +/** + * Attempts to invoke `func`, returning either the result or the caught error + * object. Any additional arguments are provided to `func` when it's invoked. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Util + * @param {Function} func The function to attempt. + * @param {...*} [args] The arguments to invoke `func` with. + * @returns {*} Returns the `func` result or error object. + * @example + * + * // Avoid throwing errors for invalid selectors. + * var elements = _.attempt(function(selector) { + * return document.querySelectorAll(selector); + * }, '>_>'); + * + * if (_.isError(elements)) { + * elements = []; + * } + */ +var attempt = baseRest(function(func, args) { + try { + return apply(func, undefined, args); + } catch (e) { + return isError(e) ? e : new Error(e); + } +}); + +module.exports = attempt; diff --git a/node_modules/lodash/before.js b/node_modules/lodash/before.js new file mode 100644 index 0000000..a3e0a16 --- /dev/null +++ b/node_modules/lodash/before.js @@ -0,0 +1,40 @@ +var toInteger = require('./toInteger'); + +/** Error message constants. */ +var FUNC_ERROR_TEXT = 'Expected a function'; + +/** + * Creates a function that invokes `func`, with the `this` binding and arguments + * of the created function, while it's called less than `n` times. Subsequent + * calls to the created function return the result of the last `func` invocation. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {number} n The number of calls at which `func` is no longer invoked. + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * jQuery(element).on('click', _.before(5, addContactToList)); + * // => Allows adding up to 4 contacts to the list. + */ +function before(n, func) { + var result; + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + n = toInteger(n); + return function() { + if (--n > 0) { + result = func.apply(this, arguments); + } + if (n <= 1) { + func = undefined; + } + return result; + }; +} + +module.exports = before; diff --git a/node_modules/lodash/bind.js b/node_modules/lodash/bind.js new file mode 100644 index 0000000..b1076e9 --- /dev/null +++ b/node_modules/lodash/bind.js @@ -0,0 +1,57 @@ +var baseRest = require('./_baseRest'), + createWrap = require('./_createWrap'), + getHolder = require('./_getHolder'), + replaceHolders = require('./_replaceHolders'); + +/** Used to compose bitmasks for function metadata. */ +var WRAP_BIND_FLAG = 1, + WRAP_PARTIAL_FLAG = 32; + +/** + * Creates a function that invokes `func` with the `this` binding of `thisArg` + * and `partials` prepended to the arguments it receives. + * + * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds, + * may be used as a placeholder for partially applied arguments. + * + * **Note:** Unlike native `Function#bind`, this method doesn't set the "length" + * property of bound functions. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to bind. + * @param {*} thisArg The `this` binding of `func`. + * @param {...*} [partials] The arguments to be partially applied. + * @returns {Function} Returns the new bound function. + * @example + * + * function greet(greeting, punctuation) { + * return greeting + ' ' + this.user + punctuation; + * } + * + * var object = { 'user': 'fred' }; + * + * var bound = _.bind(greet, object, 'hi'); + * bound('!'); + * // => 'hi fred!' + * + * // Bound with placeholders. + * var bound = _.bind(greet, object, _, '!'); + * bound('hi'); + * // => 'hi fred!' + */ +var bind = baseRest(function(func, thisArg, partials) { + var bitmask = WRAP_BIND_FLAG; + if (partials.length) { + var holders = replaceHolders(partials, getHolder(bind)); + bitmask |= WRAP_PARTIAL_FLAG; + } + return createWrap(func, bitmask, thisArg, partials, holders); +}); + +// Assign default placeholders. +bind.placeholder = {}; + +module.exports = bind; diff --git a/node_modules/lodash/bindAll.js b/node_modules/lodash/bindAll.js new file mode 100644 index 0000000..a35706d --- /dev/null +++ b/node_modules/lodash/bindAll.js @@ -0,0 +1,41 @@ +var arrayEach = require('./_arrayEach'), + baseAssignValue = require('./_baseAssignValue'), + bind = require('./bind'), + flatRest = require('./_flatRest'), + toKey = require('./_toKey'); + +/** + * Binds methods of an object to the object itself, overwriting the existing + * method. + * + * **Note:** This method doesn't set the "length" property of bound functions. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @param {Object} object The object to bind and assign the bound methods to. + * @param {...(string|string[])} methodNames The object method names to bind. + * @returns {Object} Returns `object`. + * @example + * + * var view = { + * 'label': 'docs', + * 'click': function() { + * console.log('clicked ' + this.label); + * } + * }; + * + * _.bindAll(view, ['click']); + * jQuery(element).on('click', view.click); + * // => Logs 'clicked docs' when clicked. + */ +var bindAll = flatRest(function(object, methodNames) { + arrayEach(methodNames, function(key) { + key = toKey(key); + baseAssignValue(object, key, bind(object[key], object)); + }); + return object; +}); + +module.exports = bindAll; diff --git a/node_modules/lodash/bindKey.js b/node_modules/lodash/bindKey.js new file mode 100644 index 0000000..f7fd64c --- /dev/null +++ b/node_modules/lodash/bindKey.js @@ -0,0 +1,68 @@ +var baseRest = require('./_baseRest'), + createWrap = require('./_createWrap'), + getHolder = require('./_getHolder'), + replaceHolders = require('./_replaceHolders'); + +/** Used to compose bitmasks for function metadata. */ +var WRAP_BIND_FLAG = 1, + WRAP_BIND_KEY_FLAG = 2, + WRAP_PARTIAL_FLAG = 32; + +/** + * Creates a function that invokes the method at `object[key]` with `partials` + * prepended to the arguments it receives. + * + * This method differs from `_.bind` by allowing bound functions to reference + * methods that may be redefined or don't yet exist. See + * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern) + * for more details. + * + * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic + * builds, may be used as a placeholder for partially applied arguments. + * + * @static + * @memberOf _ + * @since 0.10.0 + * @category Function + * @param {Object} object The object to invoke the method on. + * @param {string} key The key of the method. + * @param {...*} [partials] The arguments to be partially applied. + * @returns {Function} Returns the new bound function. + * @example + * + * var object = { + * 'user': 'fred', + * 'greet': function(greeting, punctuation) { + * return greeting + ' ' + this.user + punctuation; + * } + * }; + * + * var bound = _.bindKey(object, 'greet', 'hi'); + * bound('!'); + * // => 'hi fred!' + * + * object.greet = function(greeting, punctuation) { + * return greeting + 'ya ' + this.user + punctuation; + * }; + * + * bound('!'); + * // => 'hiya fred!' + * + * // Bound with placeholders. + * var bound = _.bindKey(object, 'greet', _, '!'); + * bound('hi'); + * // => 'hiya fred!' + */ +var bindKey = baseRest(function(object, key, partials) { + var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG; + if (partials.length) { + var holders = replaceHolders(partials, getHolder(bindKey)); + bitmask |= WRAP_PARTIAL_FLAG; + } + return createWrap(key, bitmask, object, partials, holders); +}); + +// Assign default placeholders. +bindKey.placeholder = {}; + +module.exports = bindKey; diff --git a/node_modules/lodash/camelCase.js b/node_modules/lodash/camelCase.js new file mode 100644 index 0000000..d7390de --- /dev/null +++ b/node_modules/lodash/camelCase.js @@ -0,0 +1,29 @@ +var capitalize = require('./capitalize'), + createCompounder = require('./_createCompounder'); + +/** + * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the camel cased string. + * @example + * + * _.camelCase('Foo Bar'); + * // => 'fooBar' + * + * _.camelCase('--foo-bar--'); + * // => 'fooBar' + * + * _.camelCase('__FOO_BAR__'); + * // => 'fooBar' + */ +var camelCase = createCompounder(function(result, word, index) { + word = word.toLowerCase(); + return result + (index ? capitalize(word) : word); +}); + +module.exports = camelCase; diff --git a/node_modules/lodash/capitalize.js b/node_modules/lodash/capitalize.js new file mode 100644 index 0000000..3e1600e --- /dev/null +++ b/node_modules/lodash/capitalize.js @@ -0,0 +1,23 @@ +var toString = require('./toString'), + upperFirst = require('./upperFirst'); + +/** + * Converts the first character of `string` to upper case and the remaining + * to lower case. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to capitalize. + * @returns {string} Returns the capitalized string. + * @example + * + * _.capitalize('FRED'); + * // => 'Fred' + */ +function capitalize(string) { + return upperFirst(toString(string).toLowerCase()); +} + +module.exports = capitalize; diff --git a/node_modules/lodash/castArray.js b/node_modules/lodash/castArray.js new file mode 100644 index 0000000..e470bdb --- /dev/null +++ b/node_modules/lodash/castArray.js @@ -0,0 +1,44 @@ +var isArray = require('./isArray'); + +/** + * Casts `value` as an array if it's not one. + * + * @static + * @memberOf _ + * @since 4.4.0 + * @category Lang + * @param {*} value The value to inspect. + * @returns {Array} Returns the cast array. + * @example + * + * _.castArray(1); + * // => [1] + * + * _.castArray({ 'a': 1 }); + * // => [{ 'a': 1 }] + * + * _.castArray('abc'); + * // => ['abc'] + * + * _.castArray(null); + * // => [null] + * + * _.castArray(undefined); + * // => [undefined] + * + * _.castArray(); + * // => [] + * + * var array = [1, 2, 3]; + * console.log(_.castArray(array) === array); + * // => true + */ +function castArray() { + if (!arguments.length) { + return []; + } + var value = arguments[0]; + return isArray(value) ? value : [value]; +} + +module.exports = castArray; diff --git a/node_modules/lodash/ceil.js b/node_modules/lodash/ceil.js new file mode 100644 index 0000000..56c8722 --- /dev/null +++ b/node_modules/lodash/ceil.js @@ -0,0 +1,26 @@ +var createRound = require('./_createRound'); + +/** + * Computes `number` rounded up to `precision`. + * + * @static + * @memberOf _ + * @since 3.10.0 + * @category Math + * @param {number} number The number to round up. + * @param {number} [precision=0] The precision to round up to. + * @returns {number} Returns the rounded up number. + * @example + * + * _.ceil(4.006); + * // => 5 + * + * _.ceil(6.004, 2); + * // => 6.01 + * + * _.ceil(6040, -2); + * // => 6100 + */ +var ceil = createRound('ceil'); + +module.exports = ceil; diff --git a/node_modules/lodash/chain.js b/node_modules/lodash/chain.js new file mode 100644 index 0000000..f6cd647 --- /dev/null +++ b/node_modules/lodash/chain.js @@ -0,0 +1,38 @@ +var lodash = require('./wrapperLodash'); + +/** + * Creates a `lodash` wrapper instance that wraps `value` with explicit method + * chain sequences enabled. The result of such sequences must be unwrapped + * with `_#value`. + * + * @static + * @memberOf _ + * @since 1.3.0 + * @category Seq + * @param {*} value The value to wrap. + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 40 }, + * { 'user': 'pebbles', 'age': 1 } + * ]; + * + * var youngest = _ + * .chain(users) + * .sortBy('age') + * .map(function(o) { + * return o.user + ' is ' + o.age; + * }) + * .head() + * .value(); + * // => 'pebbles is 1' + */ +function chain(value) { + var result = lodash(value); + result.__chain__ = true; + return result; +} + +module.exports = chain; diff --git a/node_modules/lodash/chunk.js b/node_modules/lodash/chunk.js new file mode 100644 index 0000000..5b562fe --- /dev/null +++ b/node_modules/lodash/chunk.js @@ -0,0 +1,50 @@ +var baseSlice = require('./_baseSlice'), + isIterateeCall = require('./_isIterateeCall'), + toInteger = require('./toInteger'); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeCeil = Math.ceil, + nativeMax = Math.max; + +/** + * Creates an array of elements split into groups the length of `size`. + * If `array` can't be split evenly, the final chunk will be the remaining + * elements. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to process. + * @param {number} [size=1] The length of each chunk + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the new array of chunks. + * @example + * + * _.chunk(['a', 'b', 'c', 'd'], 2); + * // => [['a', 'b'], ['c', 'd']] + * + * _.chunk(['a', 'b', 'c', 'd'], 3); + * // => [['a', 'b', 'c'], ['d']] + */ +function chunk(array, size, guard) { + if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) { + size = 1; + } else { + size = nativeMax(toInteger(size), 0); + } + var length = array == null ? 0 : array.length; + if (!length || size < 1) { + return []; + } + var index = 0, + resIndex = 0, + result = Array(nativeCeil(length / size)); + + while (index < length) { + result[resIndex++] = baseSlice(array, index, (index += size)); + } + return result; +} + +module.exports = chunk; diff --git a/node_modules/lodash/clamp.js b/node_modules/lodash/clamp.js new file mode 100644 index 0000000..91a72c9 --- /dev/null +++ b/node_modules/lodash/clamp.js @@ -0,0 +1,39 @@ +var baseClamp = require('./_baseClamp'), + toNumber = require('./toNumber'); + +/** + * Clamps `number` within the inclusive `lower` and `upper` bounds. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Number + * @param {number} number The number to clamp. + * @param {number} [lower] The lower bound. + * @param {number} upper The upper bound. + * @returns {number} Returns the clamped number. + * @example + * + * _.clamp(-10, -5, 5); + * // => -5 + * + * _.clamp(10, -5, 5); + * // => 5 + */ +function clamp(number, lower, upper) { + if (upper === undefined) { + upper = lower; + lower = undefined; + } + if (upper !== undefined) { + upper = toNumber(upper); + upper = upper === upper ? upper : 0; + } + if (lower !== undefined) { + lower = toNumber(lower); + lower = lower === lower ? lower : 0; + } + return baseClamp(toNumber(number), lower, upper); +} + +module.exports = clamp; diff --git a/node_modules/lodash/clone.js b/node_modules/lodash/clone.js new file mode 100644 index 0000000..dd439d6 --- /dev/null +++ b/node_modules/lodash/clone.js @@ -0,0 +1,36 @@ +var baseClone = require('./_baseClone'); + +/** Used to compose bitmasks for cloning. */ +var CLONE_SYMBOLS_FLAG = 4; + +/** + * Creates a shallow clone of `value`. + * + * **Note:** This method is loosely based on the + * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm) + * and supports cloning arrays, array buffers, booleans, date objects, maps, + * numbers, `Object` objects, regexes, sets, strings, symbols, and typed + * arrays. The own enumerable properties of `arguments` objects are cloned + * as plain objects. An empty object is returned for uncloneable values such + * as error objects, functions, DOM nodes, and WeakMaps. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to clone. + * @returns {*} Returns the cloned value. + * @see _.cloneDeep + * @example + * + * var objects = [{ 'a': 1 }, { 'b': 2 }]; + * + * var shallow = _.clone(objects); + * console.log(shallow[0] === objects[0]); + * // => true + */ +function clone(value) { + return baseClone(value, CLONE_SYMBOLS_FLAG); +} + +module.exports = clone; diff --git a/node_modules/lodash/cloneDeep.js b/node_modules/lodash/cloneDeep.js new file mode 100644 index 0000000..4425fbe --- /dev/null +++ b/node_modules/lodash/cloneDeep.js @@ -0,0 +1,29 @@ +var baseClone = require('./_baseClone'); + +/** Used to compose bitmasks for cloning. */ +var CLONE_DEEP_FLAG = 1, + CLONE_SYMBOLS_FLAG = 4; + +/** + * This method is like `_.clone` except that it recursively clones `value`. + * + * @static + * @memberOf _ + * @since 1.0.0 + * @category Lang + * @param {*} value The value to recursively clone. + * @returns {*} Returns the deep cloned value. + * @see _.clone + * @example + * + * var objects = [{ 'a': 1 }, { 'b': 2 }]; + * + * var deep = _.cloneDeep(objects); + * console.log(deep[0] === objects[0]); + * // => false + */ +function cloneDeep(value) { + return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG); +} + +module.exports = cloneDeep; diff --git a/node_modules/lodash/cloneDeepWith.js b/node_modules/lodash/cloneDeepWith.js new file mode 100644 index 0000000..fd9c6c0 --- /dev/null +++ b/node_modules/lodash/cloneDeepWith.js @@ -0,0 +1,40 @@ +var baseClone = require('./_baseClone'); + +/** Used to compose bitmasks for cloning. */ +var CLONE_DEEP_FLAG = 1, + CLONE_SYMBOLS_FLAG = 4; + +/** + * This method is like `_.cloneWith` except that it recursively clones `value`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to recursively clone. + * @param {Function} [customizer] The function to customize cloning. + * @returns {*} Returns the deep cloned value. + * @see _.cloneWith + * @example + * + * function customizer(value) { + * if (_.isElement(value)) { + * return value.cloneNode(true); + * } + * } + * + * var el = _.cloneDeepWith(document.body, customizer); + * + * console.log(el === document.body); + * // => false + * console.log(el.nodeName); + * // => 'BODY' + * console.log(el.childNodes.length); + * // => 20 + */ +function cloneDeepWith(value, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer); +} + +module.exports = cloneDeepWith; diff --git a/node_modules/lodash/cloneWith.js b/node_modules/lodash/cloneWith.js new file mode 100644 index 0000000..d2f4e75 --- /dev/null +++ b/node_modules/lodash/cloneWith.js @@ -0,0 +1,42 @@ +var baseClone = require('./_baseClone'); + +/** Used to compose bitmasks for cloning. */ +var CLONE_SYMBOLS_FLAG = 4; + +/** + * This method is like `_.clone` except that it accepts `customizer` which + * is invoked to produce the cloned value. If `customizer` returns `undefined`, + * cloning is handled by the method instead. The `customizer` is invoked with + * up to four arguments; (value [, index|key, object, stack]). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to clone. + * @param {Function} [customizer] The function to customize cloning. + * @returns {*} Returns the cloned value. + * @see _.cloneDeepWith + * @example + * + * function customizer(value) { + * if (_.isElement(value)) { + * return value.cloneNode(false); + * } + * } + * + * var el = _.cloneWith(document.body, customizer); + * + * console.log(el === document.body); + * // => false + * console.log(el.nodeName); + * // => 'BODY' + * console.log(el.childNodes.length); + * // => 0 + */ +function cloneWith(value, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return baseClone(value, CLONE_SYMBOLS_FLAG, customizer); +} + +module.exports = cloneWith; diff --git a/node_modules/lodash/collection.js b/node_modules/lodash/collection.js new file mode 100644 index 0000000..77fe837 --- /dev/null +++ b/node_modules/lodash/collection.js @@ -0,0 +1,30 @@ +module.exports = { + 'countBy': require('./countBy'), + 'each': require('./each'), + 'eachRight': require('./eachRight'), + 'every': require('./every'), + 'filter': require('./filter'), + 'find': require('./find'), + 'findLast': require('./findLast'), + 'flatMap': require('./flatMap'), + 'flatMapDeep': require('./flatMapDeep'), + 'flatMapDepth': require('./flatMapDepth'), + 'forEach': require('./forEach'), + 'forEachRight': require('./forEachRight'), + 'groupBy': require('./groupBy'), + 'includes': require('./includes'), + 'invokeMap': require('./invokeMap'), + 'keyBy': require('./keyBy'), + 'map': require('./map'), + 'orderBy': require('./orderBy'), + 'partition': require('./partition'), + 'reduce': require('./reduce'), + 'reduceRight': require('./reduceRight'), + 'reject': require('./reject'), + 'sample': require('./sample'), + 'sampleSize': require('./sampleSize'), + 'shuffle': require('./shuffle'), + 'size': require('./size'), + 'some': require('./some'), + 'sortBy': require('./sortBy') +}; diff --git a/node_modules/lodash/commit.js b/node_modules/lodash/commit.js new file mode 100644 index 0000000..fe4db71 --- /dev/null +++ b/node_modules/lodash/commit.js @@ -0,0 +1,33 @@ +var LodashWrapper = require('./_LodashWrapper'); + +/** + * Executes the chain sequence and returns the wrapped result. + * + * @name commit + * @memberOf _ + * @since 3.2.0 + * @category Seq + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var array = [1, 2]; + * var wrapped = _(array).push(3); + * + * console.log(array); + * // => [1, 2] + * + * wrapped = wrapped.commit(); + * console.log(array); + * // => [1, 2, 3] + * + * wrapped.last(); + * // => 3 + * + * console.log(array); + * // => [1, 2, 3] + */ +function wrapperCommit() { + return new LodashWrapper(this.value(), this.__chain__); +} + +module.exports = wrapperCommit; diff --git a/node_modules/lodash/compact.js b/node_modules/lodash/compact.js new file mode 100644 index 0000000..031fab4 --- /dev/null +++ b/node_modules/lodash/compact.js @@ -0,0 +1,31 @@ +/** + * Creates an array with all falsey values removed. The values `false`, `null`, + * `0`, `""`, `undefined`, and `NaN` are falsey. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to compact. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * _.compact([0, 1, false, 2, '', 3]); + * // => [1, 2, 3] + */ +function compact(array) { + var index = -1, + length = array == null ? 0 : array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (value) { + result[resIndex++] = value; + } + } + return result; +} + +module.exports = compact; diff --git a/node_modules/lodash/concat.js b/node_modules/lodash/concat.js new file mode 100644 index 0000000..1da48a4 --- /dev/null +++ b/node_modules/lodash/concat.js @@ -0,0 +1,43 @@ +var arrayPush = require('./_arrayPush'), + baseFlatten = require('./_baseFlatten'), + copyArray = require('./_copyArray'), + isArray = require('./isArray'); + +/** + * Creates a new array concatenating `array` with any additional arrays + * and/or values. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to concatenate. + * @param {...*} [values] The values to concatenate. + * @returns {Array} Returns the new concatenated array. + * @example + * + * var array = [1]; + * var other = _.concat(array, 2, [3], [[4]]); + * + * console.log(other); + * // => [1, 2, 3, [4]] + * + * console.log(array); + * // => [1] + */ +function concat() { + var length = arguments.length; + if (!length) { + return []; + } + var args = Array(length - 1), + array = arguments[0], + index = length; + + while (index--) { + args[index - 1] = arguments[index]; + } + return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1)); +} + +module.exports = concat; diff --git a/node_modules/lodash/cond.js b/node_modules/lodash/cond.js new file mode 100644 index 0000000..6455598 --- /dev/null +++ b/node_modules/lodash/cond.js @@ -0,0 +1,60 @@ +var apply = require('./_apply'), + arrayMap = require('./_arrayMap'), + baseIteratee = require('./_baseIteratee'), + baseRest = require('./_baseRest'); + +/** Error message constants. */ +var FUNC_ERROR_TEXT = 'Expected a function'; + +/** + * Creates a function that iterates over `pairs` and invokes the corresponding + * function of the first predicate to return truthy. The predicate-function + * pairs are invoked with the `this` binding and arguments of the created + * function. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Util + * @param {Array} pairs The predicate-function pairs. + * @returns {Function} Returns the new composite function. + * @example + * + * var func = _.cond([ + * [_.matches({ 'a': 1 }), _.constant('matches A')], + * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')], + * [_.stubTrue, _.constant('no match')] + * ]); + * + * func({ 'a': 1, 'b': 2 }); + * // => 'matches A' + * + * func({ 'a': 0, 'b': 1 }); + * // => 'matches B' + * + * func({ 'a': '1', 'b': '2' }); + * // => 'no match' + */ +function cond(pairs) { + var length = pairs == null ? 0 : pairs.length, + toIteratee = baseIteratee; + + pairs = !length ? [] : arrayMap(pairs, function(pair) { + if (typeof pair[1] != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + return [toIteratee(pair[0]), pair[1]]; + }); + + return baseRest(function(args) { + var index = -1; + while (++index < length) { + var pair = pairs[index]; + if (apply(pair[0], this, args)) { + return apply(pair[1], this, args); + } + } + }); +} + +module.exports = cond; diff --git a/node_modules/lodash/conforms.js b/node_modules/lodash/conforms.js new file mode 100644 index 0000000..5501a94 --- /dev/null +++ b/node_modules/lodash/conforms.js @@ -0,0 +1,35 @@ +var baseClone = require('./_baseClone'), + baseConforms = require('./_baseConforms'); + +/** Used to compose bitmasks for cloning. */ +var CLONE_DEEP_FLAG = 1; + +/** + * Creates a function that invokes the predicate properties of `source` with + * the corresponding property values of a given object, returning `true` if + * all predicates return truthy, else `false`. + * + * **Note:** The created function is equivalent to `_.conformsTo` with + * `source` partially applied. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Util + * @param {Object} source The object of property predicates to conform to. + * @returns {Function} Returns the new spec function. + * @example + * + * var objects = [ + * { 'a': 2, 'b': 1 }, + * { 'a': 1, 'b': 2 } + * ]; + * + * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } })); + * // => [{ 'a': 1, 'b': 2 }] + */ +function conforms(source) { + return baseConforms(baseClone(source, CLONE_DEEP_FLAG)); +} + +module.exports = conforms; diff --git a/node_modules/lodash/conformsTo.js b/node_modules/lodash/conformsTo.js new file mode 100644 index 0000000..b8a93eb --- /dev/null +++ b/node_modules/lodash/conformsTo.js @@ -0,0 +1,32 @@ +var baseConformsTo = require('./_baseConformsTo'), + keys = require('./keys'); + +/** + * Checks if `object` conforms to `source` by invoking the predicate + * properties of `source` with the corresponding property values of `object`. + * + * **Note:** This method is equivalent to `_.conforms` when `source` is + * partially applied. + * + * @static + * @memberOf _ + * @since 4.14.0 + * @category Lang + * @param {Object} object The object to inspect. + * @param {Object} source The object of property predicates to conform to. + * @returns {boolean} Returns `true` if `object` conforms, else `false`. + * @example + * + * var object = { 'a': 1, 'b': 2 }; + * + * _.conformsTo(object, { 'b': function(n) { return n > 1; } }); + * // => true + * + * _.conformsTo(object, { 'b': function(n) { return n > 2; } }); + * // => false + */ +function conformsTo(object, source) { + return source == null || baseConformsTo(object, source, keys(source)); +} + +module.exports = conformsTo; diff --git a/node_modules/lodash/constant.js b/node_modules/lodash/constant.js new file mode 100644 index 0000000..655ece3 --- /dev/null +++ b/node_modules/lodash/constant.js @@ -0,0 +1,26 @@ +/** + * Creates a function that returns `value`. + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Util + * @param {*} value The value to return from the new function. + * @returns {Function} Returns the new constant function. + * @example + * + * var objects = _.times(2, _.constant({ 'a': 1 })); + * + * console.log(objects); + * // => [{ 'a': 1 }, { 'a': 1 }] + * + * console.log(objects[0] === objects[1]); + * // => true + */ +function constant(value) { + return function() { + return value; + }; +} + +module.exports = constant; diff --git a/node_modules/lodash/core.js b/node_modules/lodash/core.js new file mode 100644 index 0000000..be1d567 --- /dev/null +++ b/node_modules/lodash/core.js @@ -0,0 +1,3877 @@ +/** + * @license + * Lodash (Custom Build) + * Build: `lodash core -o ./dist/lodash.core.js` + * Copyright OpenJS Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ +;(function() { + + /** Used as a safe reference for `undefined` in pre-ES5 environments. */ + var undefined; + + /** Used as the semantic version number. */ + var VERSION = '4.17.21'; + + /** Error message constants. */ + var FUNC_ERROR_TEXT = 'Expected a function'; + + /** Used to compose bitmasks for value comparisons. */ + var COMPARE_PARTIAL_FLAG = 1, + COMPARE_UNORDERED_FLAG = 2; + + /** Used to compose bitmasks for function metadata. */ + var WRAP_BIND_FLAG = 1, + WRAP_PARTIAL_FLAG = 32; + + /** Used as references for various `Number` constants. */ + var INFINITY = 1 / 0, + MAX_SAFE_INTEGER = 9007199254740991; + + /** `Object#toString` result references. */ + var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + asyncTag = '[object AsyncFunction]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + numberTag = '[object Number]', + objectTag = '[object Object]', + proxyTag = '[object Proxy]', + regexpTag = '[object RegExp]', + stringTag = '[object String]'; + + /** Used to match HTML entities and HTML characters. */ + var reUnescapedHtml = /[&<>"']/g, + reHasUnescapedHtml = RegExp(reUnescapedHtml.source); + + /** Used to detect unsigned integer values. */ + var reIsUint = /^(?:0|[1-9]\d*)$/; + + /** Used to map characters to HTML entities. */ + var htmlEscapes = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''' + }; + + /** Detect free variable `global` from Node.js. */ + var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; + + /** Detect free variable `self`. */ + var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + + /** Used as a reference to the global object. */ + var root = freeGlobal || freeSelf || Function('return this')(); + + /** Detect free variable `exports`. */ + var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; + + /** Detect free variable `module`. */ + var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; + + /*--------------------------------------------------------------------------*/ + + /** + * Appends the elements of `values` to `array`. + * + * @private + * @param {Array} array The array to modify. + * @param {Array} values The values to append. + * @returns {Array} Returns `array`. + */ + function arrayPush(array, values) { + array.push.apply(array, values); + return array; + } + + /** + * The base implementation of `_.findIndex` and `_.findLastIndex` without + * support for iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} predicate The function invoked per iteration. + * @param {number} fromIndex The index to search from. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function baseFindIndex(array, predicate, fromIndex, fromRight) { + var length = array.length, + index = fromIndex + (fromRight ? 1 : -1); + + while ((fromRight ? index-- : ++index < length)) { + if (predicate(array[index], index, array)) { + return index; + } + } + return -1; + } + + /** + * The base implementation of `_.property` without support for deep paths. + * + * @private + * @param {string} key The key of the property to get. + * @returns {Function} Returns the new accessor function. + */ + function baseProperty(key) { + return function(object) { + return object == null ? undefined : object[key]; + }; + } + + /** + * The base implementation of `_.propertyOf` without support for deep paths. + * + * @private + * @param {Object} object The object to query. + * @returns {Function} Returns the new accessor function. + */ + function basePropertyOf(object) { + return function(key) { + return object == null ? undefined : object[key]; + }; + } + + /** + * The base implementation of `_.reduce` and `_.reduceRight`, without support + * for iteratee shorthands, which iterates over `collection` using `eachFunc`. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} accumulator The initial value. + * @param {boolean} initAccum Specify using the first or last element of + * `collection` as the initial value. + * @param {Function} eachFunc The function to iterate over `collection`. + * @returns {*} Returns the accumulated value. + */ + function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) { + eachFunc(collection, function(value, index, collection) { + accumulator = initAccum + ? (initAccum = false, value) + : iteratee(accumulator, value, index, collection); + }); + return accumulator; + } + + /** + * The base implementation of `_.values` and `_.valuesIn` which creates an + * array of `object` property values corresponding to the property names + * of `props`. + * + * @private + * @param {Object} object The object to query. + * @param {Array} props The property names to get values for. + * @returns {Object} Returns the array of property values. + */ + function baseValues(object, props) { + return baseMap(props, function(key) { + return object[key]; + }); + } + + /** + * Used by `_.escape` to convert characters to HTML entities. + * + * @private + * @param {string} chr The matched character to escape. + * @returns {string} Returns the escaped character. + */ + var escapeHtmlChar = basePropertyOf(htmlEscapes); + + /** + * Creates a unary function that invokes `func` with its argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ + function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; + } + + /*--------------------------------------------------------------------------*/ + + /** Used for built-in method references. */ + var arrayProto = Array.prototype, + objectProto = Object.prototype; + + /** Used to check objects for own properties. */ + var hasOwnProperty = objectProto.hasOwnProperty; + + /** Used to generate unique IDs. */ + var idCounter = 0; + + /** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ + var nativeObjectToString = objectProto.toString; + + /** Used to restore the original `_` reference in `_.noConflict`. */ + var oldDash = root._; + + /** Built-in value references. */ + var objectCreate = Object.create, + propertyIsEnumerable = objectProto.propertyIsEnumerable; + + /* Built-in method references for those with the same name as other `lodash` methods. */ + var nativeIsFinite = root.isFinite, + nativeKeys = overArg(Object.keys, Object), + nativeMax = Math.max; + + /*------------------------------------------------------------------------*/ + + /** + * Creates a `lodash` object which wraps `value` to enable implicit method + * chain sequences. Methods that operate on and return arrays, collections, + * and functions can be chained together. Methods that retrieve a single value + * or may return a primitive value will automatically end the chain sequence + * and return the unwrapped value. Otherwise, the value must be unwrapped + * with `_#value`. + * + * Explicit chain sequences, which must be unwrapped with `_#value`, may be + * enabled using `_.chain`. + * + * The execution of chained methods is lazy, that is, it's deferred until + * `_#value` is implicitly or explicitly called. + * + * Lazy evaluation allows several methods to support shortcut fusion. + * Shortcut fusion is an optimization to merge iteratee calls; this avoids + * the creation of intermediate arrays and can greatly reduce the number of + * iteratee executions. Sections of a chain sequence qualify for shortcut + * fusion if the section is applied to an array and iteratees accept only + * one argument. The heuristic for whether a section qualifies for shortcut + * fusion is subject to change. + * + * Chaining is supported in custom builds as long as the `_#value` method is + * directly or indirectly included in the build. + * + * In addition to lodash methods, wrappers have `Array` and `String` methods. + * + * The wrapper `Array` methods are: + * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift` + * + * The wrapper `String` methods are: + * `replace` and `split` + * + * The wrapper methods that support shortcut fusion are: + * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`, + * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`, + * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray` + * + * The chainable wrapper methods are: + * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`, + * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`, + * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`, + * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`, + * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`, + * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`, + * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`, + * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`, + * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`, + * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`, + * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`, + * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`, + * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`, + * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`, + * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`, + * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`, + * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`, + * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`, + * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`, + * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`, + * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`, + * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`, + * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`, + * `zipObject`, `zipObjectDeep`, and `zipWith` + * + * The wrapper methods that are **not** chainable by default are: + * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`, + * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`, + * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`, + * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`, + * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`, + * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`, + * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`, + * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`, + * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`, + * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`, + * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`, + * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`, + * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`, + * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`, + * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`, + * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`, + * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`, + * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`, + * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`, + * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`, + * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`, + * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`, + * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`, + * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`, + * `upperFirst`, `value`, and `words` + * + * @name _ + * @constructor + * @category Seq + * @param {*} value The value to wrap in a `lodash` instance. + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * function square(n) { + * return n * n; + * } + * + * var wrapped = _([1, 2, 3]); + * + * // Returns an unwrapped value. + * wrapped.reduce(_.add); + * // => 6 + * + * // Returns a wrapped value. + * var squares = wrapped.map(square); + * + * _.isArray(squares); + * // => false + * + * _.isArray(squares.value()); + * // => true + */ + function lodash(value) { + return value instanceof LodashWrapper + ? value + : new LodashWrapper(value); + } + + /** + * The base implementation of `_.create` without support for assigning + * properties to the created object. + * + * @private + * @param {Object} proto The object to inherit from. + * @returns {Object} Returns the new object. + */ + var baseCreate = (function() { + function object() {} + return function(proto) { + if (!isObject(proto)) { + return {}; + } + if (objectCreate) { + return objectCreate(proto); + } + object.prototype = proto; + var result = new object; + object.prototype = undefined; + return result; + }; + }()); + + /** + * The base constructor for creating `lodash` wrapper objects. + * + * @private + * @param {*} value The value to wrap. + * @param {boolean} [chainAll] Enable explicit method chain sequences. + */ + function LodashWrapper(value, chainAll) { + this.__wrapped__ = value; + this.__actions__ = []; + this.__chain__ = !!chainAll; + } + + LodashWrapper.prototype = baseCreate(lodash.prototype); + LodashWrapper.prototype.constructor = LodashWrapper; + + /*------------------------------------------------------------------------*/ + + /** + * Assigns `value` to `key` of `object` if the existing value is not equivalent + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ + function assignValue(object, key, value) { + var objValue = object[key]; + if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || + (value === undefined && !(key in object))) { + baseAssignValue(object, key, value); + } + } + + /** + * The base implementation of `assignValue` and `assignMergeValue` without + * value checks. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ + function baseAssignValue(object, key, value) { + object[key] = value; + } + + /** + * The base implementation of `_.delay` and `_.defer` which accepts `args` + * to provide to `func`. + * + * @private + * @param {Function} func The function to delay. + * @param {number} wait The number of milliseconds to delay invocation. + * @param {Array} args The arguments to provide to `func`. + * @returns {number|Object} Returns the timer id or timeout object. + */ + function baseDelay(func, wait, args) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + return setTimeout(function() { func.apply(undefined, args); }, wait); + } + + /** + * The base implementation of `_.forEach` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + */ + var baseEach = createBaseEach(baseForOwn); + + /** + * The base implementation of `_.every` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false` + */ + function baseEvery(collection, predicate) { + var result = true; + baseEach(collection, function(value, index, collection) { + result = !!predicate(value, index, collection); + return result; + }); + return result; + } + + /** + * The base implementation of methods like `_.max` and `_.min` which accepts a + * `comparator` to determine the extremum value. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The iteratee invoked per iteration. + * @param {Function} comparator The comparator used to compare values. + * @returns {*} Returns the extremum value. + */ + function baseExtremum(array, iteratee, comparator) { + var index = -1, + length = array.length; + + while (++index < length) { + var value = array[index], + current = iteratee(value); + + if (current != null && (computed === undefined + ? (current === current && !false) + : comparator(current, computed) + )) { + var computed = current, + result = value; + } + } + return result; + } + + /** + * The base implementation of `_.filter` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + */ + function baseFilter(collection, predicate) { + var result = []; + baseEach(collection, function(value, index, collection) { + if (predicate(value, index, collection)) { + result.push(value); + } + }); + return result; + } + + /** + * The base implementation of `_.flatten` with support for restricting flattening. + * + * @private + * @param {Array} array The array to flatten. + * @param {number} depth The maximum recursion depth. + * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. + * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. + * @param {Array} [result=[]] The initial result value. + * @returns {Array} Returns the new flattened array. + */ + function baseFlatten(array, depth, predicate, isStrict, result) { + var index = -1, + length = array.length; + + predicate || (predicate = isFlattenable); + result || (result = []); + + while (++index < length) { + var value = array[index]; + if (depth > 0 && predicate(value)) { + if (depth > 1) { + // Recursively flatten arrays (susceptible to call stack limits). + baseFlatten(value, depth - 1, predicate, isStrict, result); + } else { + arrayPush(result, value); + } + } else if (!isStrict) { + result[result.length] = value; + } + } + return result; + } + + /** + * The base implementation of `baseForOwn` which iterates over `object` + * properties returned by `keysFunc` and invokes `iteratee` for each property. + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {Function} keysFunc The function to get the keys of `object`. + * @returns {Object} Returns `object`. + */ + var baseFor = createBaseFor(); + + /** + * The base implementation of `_.forOwn` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Object} Returns `object`. + */ + function baseForOwn(object, iteratee) { + return object && baseFor(object, iteratee, keys); + } + + /** + * The base implementation of `_.functions` which creates an array of + * `object` function property names filtered from `props`. + * + * @private + * @param {Object} object The object to inspect. + * @param {Array} props The property names to filter. + * @returns {Array} Returns the function names. + */ + function baseFunctions(object, props) { + return baseFilter(props, function(key) { + return isFunction(object[key]); + }); + } + + /** + * The base implementation of `getTag` without fallbacks for buggy environments. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ + function baseGetTag(value) { + return objectToString(value); + } + + /** + * The base implementation of `_.gt` which doesn't coerce arguments. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is greater than `other`, + * else `false`. + */ + function baseGt(value, other) { + return value > other; + } + + /** + * The base implementation of `_.isArguments`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + */ + var baseIsArguments = noop; + + /** + * The base implementation of `_.isDate` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a date object, else `false`. + */ + function baseIsDate(value) { + return isObjectLike(value) && baseGetTag(value) == dateTag; + } + + /** + * The base implementation of `_.isEqual` which supports partial comparisons + * and tracks traversed objects. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @param {boolean} bitmask The bitmask flags. + * 1 - Unordered comparison + * 2 - Partial comparison + * @param {Function} [customizer] The function to customize comparisons. + * @param {Object} [stack] Tracks traversed `value` and `other` objects. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + */ + function baseIsEqual(value, other, bitmask, customizer, stack) { + if (value === other) { + return true; + } + if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) { + return value !== value && other !== other; + } + return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack); + } + + /** + * A specialized version of `baseIsEqual` for arrays and objects which performs + * deep comparisons and tracks traversed objects enabling objects with circular + * references to be compared. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} [stack] Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ + function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) { + var objIsArr = isArray(object), + othIsArr = isArray(other), + objTag = objIsArr ? arrayTag : baseGetTag(object), + othTag = othIsArr ? arrayTag : baseGetTag(other); + + objTag = objTag == argsTag ? objectTag : objTag; + othTag = othTag == argsTag ? objectTag : othTag; + + var objIsObj = objTag == objectTag, + othIsObj = othTag == objectTag, + isSameTag = objTag == othTag; + + stack || (stack = []); + var objStack = find(stack, function(entry) { + return entry[0] == object; + }); + var othStack = find(stack, function(entry) { + return entry[0] == other; + }); + if (objStack && othStack) { + return objStack[1] == other; + } + stack.push([object, other]); + stack.push([other, object]); + if (isSameTag && !objIsObj) { + var result = (objIsArr) + ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) + : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack); + stack.pop(); + return result; + } + if (!(bitmask & COMPARE_PARTIAL_FLAG)) { + var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), + othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); + + if (objIsWrapped || othIsWrapped) { + var objUnwrapped = objIsWrapped ? object.value() : object, + othUnwrapped = othIsWrapped ? other.value() : other; + + var result = equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); + stack.pop(); + return result; + } + } + if (!isSameTag) { + return false; + } + var result = equalObjects(object, other, bitmask, customizer, equalFunc, stack); + stack.pop(); + return result; + } + + /** + * The base implementation of `_.isRegExp` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. + */ + function baseIsRegExp(value) { + return isObjectLike(value) && baseGetTag(value) == regexpTag; + } + + /** + * The base implementation of `_.iteratee`. + * + * @private + * @param {*} [value=_.identity] The value to convert to an iteratee. + * @returns {Function} Returns the iteratee. + */ + function baseIteratee(func) { + if (typeof func == 'function') { + return func; + } + if (func == null) { + return identity; + } + return (typeof func == 'object' ? baseMatches : baseProperty)(func); + } + + /** + * The base implementation of `_.lt` which doesn't coerce arguments. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is less than `other`, + * else `false`. + */ + function baseLt(value, other) { + return value < other; + } + + /** + * The base implementation of `_.map` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ + function baseMap(collection, iteratee) { + var index = -1, + result = isArrayLike(collection) ? Array(collection.length) : []; + + baseEach(collection, function(value, key, collection) { + result[++index] = iteratee(value, key, collection); + }); + return result; + } + + /** + * The base implementation of `_.matches` which doesn't clone `source`. + * + * @private + * @param {Object} source The object of property values to match. + * @returns {Function} Returns the new spec function. + */ + function baseMatches(source) { + var props = nativeKeys(source); + return function(object) { + var length = props.length; + if (object == null) { + return !length; + } + object = Object(object); + while (length--) { + var key = props[length]; + if (!(key in object && + baseIsEqual(source[key], object[key], COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG) + )) { + return false; + } + } + return true; + }; + } + + /** + * The base implementation of `_.pick` without support for individual + * property identifiers. + * + * @private + * @param {Object} object The source object. + * @param {string[]} paths The property paths to pick. + * @returns {Object} Returns the new object. + */ + function basePick(object, props) { + object = Object(object); + return reduce(props, function(result, key) { + if (key in object) { + result[key] = object[key]; + } + return result; + }, {}); + } + + /** + * The base implementation of `_.rest` which doesn't validate or coerce arguments. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @returns {Function} Returns the new function. + */ + function baseRest(func, start) { + return setToString(overRest(func, start, identity), func + ''); + } + + /** + * The base implementation of `_.slice` without an iteratee call guard. + * + * @private + * @param {Array} array The array to slice. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the slice of `array`. + */ + function baseSlice(array, start, end) { + var index = -1, + length = array.length; + + if (start < 0) { + start = -start > length ? 0 : (length + start); + } + end = end > length ? length : end; + if (end < 0) { + end += length; + } + length = start > end ? 0 : ((end - start) >>> 0); + start >>>= 0; + + var result = Array(length); + while (++index < length) { + result[index] = array[index + start]; + } + return result; + } + + /** + * Copies the values of `source` to `array`. + * + * @private + * @param {Array} source The array to copy values from. + * @param {Array} [array=[]] The array to copy values to. + * @returns {Array} Returns `array`. + */ + function copyArray(source) { + return baseSlice(source, 0, source.length); + } + + /** + * The base implementation of `_.some` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + */ + function baseSome(collection, predicate) { + var result; + + baseEach(collection, function(value, index, collection) { + result = predicate(value, index, collection); + return !result; + }); + return !!result; + } + + /** + * The base implementation of `wrapperValue` which returns the result of + * performing a sequence of actions on the unwrapped `value`, where each + * successive action is supplied the return value of the previous. + * + * @private + * @param {*} value The unwrapped value. + * @param {Array} actions Actions to perform to resolve the unwrapped value. + * @returns {*} Returns the resolved value. + */ + function baseWrapperValue(value, actions) { + var result = value; + return reduce(actions, function(result, action) { + return action.func.apply(action.thisArg, arrayPush([result], action.args)); + }, result); + } + + /** + * Compares values to sort them in ascending order. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {number} Returns the sort order indicator for `value`. + */ + function compareAscending(value, other) { + if (value !== other) { + var valIsDefined = value !== undefined, + valIsNull = value === null, + valIsReflexive = value === value, + valIsSymbol = false; + + var othIsDefined = other !== undefined, + othIsNull = other === null, + othIsReflexive = other === other, + othIsSymbol = false; + + if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) || + (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) || + (valIsNull && othIsDefined && othIsReflexive) || + (!valIsDefined && othIsReflexive) || + !valIsReflexive) { + return 1; + } + if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) || + (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) || + (othIsNull && valIsDefined && valIsReflexive) || + (!othIsDefined && valIsReflexive) || + !othIsReflexive) { + return -1; + } + } + return 0; + } + + /** + * Copies properties of `source` to `object`. + * + * @private + * @param {Object} source The object to copy properties from. + * @param {Array} props The property identifiers to copy. + * @param {Object} [object={}] The object to copy properties to. + * @param {Function} [customizer] The function to customize copied values. + * @returns {Object} Returns `object`. + */ + function copyObject(source, props, object, customizer) { + var isNew = !object; + object || (object = {}); + + var index = -1, + length = props.length; + + while (++index < length) { + var key = props[index]; + + var newValue = customizer + ? customizer(object[key], source[key], key, object, source) + : undefined; + + if (newValue === undefined) { + newValue = source[key]; + } + if (isNew) { + baseAssignValue(object, key, newValue); + } else { + assignValue(object, key, newValue); + } + } + return object; + } + + /** + * Creates a function like `_.assign`. + * + * @private + * @param {Function} assigner The function to assign values. + * @returns {Function} Returns the new assigner function. + */ + function createAssigner(assigner) { + return baseRest(function(object, sources) { + var index = -1, + length = sources.length, + customizer = length > 1 ? sources[length - 1] : undefined; + + customizer = (assigner.length > 3 && typeof customizer == 'function') + ? (length--, customizer) + : undefined; + + object = Object(object); + while (++index < length) { + var source = sources[index]; + if (source) { + assigner(object, source, index, customizer); + } + } + return object; + }); + } + + /** + * Creates a `baseEach` or `baseEachRight` function. + * + * @private + * @param {Function} eachFunc The function to iterate over a collection. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ + function createBaseEach(eachFunc, fromRight) { + return function(collection, iteratee) { + if (collection == null) { + return collection; + } + if (!isArrayLike(collection)) { + return eachFunc(collection, iteratee); + } + var length = collection.length, + index = fromRight ? length : -1, + iterable = Object(collection); + + while ((fromRight ? index-- : ++index < length)) { + if (iteratee(iterable[index], index, iterable) === false) { + break; + } + } + return collection; + }; + } + + /** + * Creates a base function for methods like `_.forIn` and `_.forOwn`. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ + function createBaseFor(fromRight) { + return function(object, iteratee, keysFunc) { + var index = -1, + iterable = Object(object), + props = keysFunc(object), + length = props.length; + + while (length--) { + var key = props[fromRight ? length : ++index]; + if (iteratee(iterable[key], key, iterable) === false) { + break; + } + } + return object; + }; + } + + /** + * Creates a function that produces an instance of `Ctor` regardless of + * whether it was invoked as part of a `new` expression or by `call` or `apply`. + * + * @private + * @param {Function} Ctor The constructor to wrap. + * @returns {Function} Returns the new wrapped function. + */ + function createCtor(Ctor) { + return function() { + // Use a `switch` statement to work with class constructors. See + // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist + // for more details. + var args = arguments; + var thisBinding = baseCreate(Ctor.prototype), + result = Ctor.apply(thisBinding, args); + + // Mimic the constructor's `return` behavior. + // See https://es5.github.io/#x13.2.2 for more details. + return isObject(result) ? result : thisBinding; + }; + } + + /** + * Creates a `_.find` or `_.findLast` function. + * + * @private + * @param {Function} findIndexFunc The function to find the collection index. + * @returns {Function} Returns the new find function. + */ + function createFind(findIndexFunc) { + return function(collection, predicate, fromIndex) { + var iterable = Object(collection); + if (!isArrayLike(collection)) { + var iteratee = baseIteratee(predicate, 3); + collection = keys(collection); + predicate = function(key) { return iteratee(iterable[key], key, iterable); }; + } + var index = findIndexFunc(collection, predicate, fromIndex); + return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined; + }; + } + + /** + * Creates a function that wraps `func` to invoke it with the `this` binding + * of `thisArg` and `partials` prepended to the arguments it receives. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {*} thisArg The `this` binding of `func`. + * @param {Array} partials The arguments to prepend to those provided to + * the new function. + * @returns {Function} Returns the new wrapped function. + */ + function createPartial(func, bitmask, thisArg, partials) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + var isBind = bitmask & WRAP_BIND_FLAG, + Ctor = createCtor(func); + + function wrapper() { + var argsIndex = -1, + argsLength = arguments.length, + leftIndex = -1, + leftLength = partials.length, + args = Array(leftLength + argsLength), + fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; + + while (++leftIndex < leftLength) { + args[leftIndex] = partials[leftIndex]; + } + while (argsLength--) { + args[leftIndex++] = arguments[++argsIndex]; + } + return fn.apply(isBind ? thisArg : this, args); + } + return wrapper; + } + + /** + * A specialized version of `baseIsEqualDeep` for arrays with support for + * partial deep comparisons. + * + * @private + * @param {Array} array The array to compare. + * @param {Array} other The other array to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `array` and `other` objects. + * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. + */ + function equalArrays(array, other, bitmask, customizer, equalFunc, stack) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG, + arrLength = array.length, + othLength = other.length; + + if (arrLength != othLength && !(isPartial && othLength > arrLength)) { + return false; + } + // Check that cyclic values are equal. + var arrStacked = stack.get(array); + var othStacked = stack.get(other); + if (arrStacked && othStacked) { + return arrStacked == other && othStacked == array; + } + var index = -1, + result = true, + seen = (bitmask & COMPARE_UNORDERED_FLAG) ? [] : undefined; + + // Ignore non-index properties. + while (++index < arrLength) { + var arrValue = array[index], + othValue = other[index]; + + var compared; + if (compared !== undefined) { + if (compared) { + continue; + } + result = false; + break; + } + // Recursively compare arrays (susceptible to call stack limits). + if (seen) { + if (!baseSome(other, function(othValue, othIndex) { + if (!indexOf(seen, othIndex) && + (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { + return seen.push(othIndex); + } + })) { + result = false; + break; + } + } else if (!( + arrValue === othValue || + equalFunc(arrValue, othValue, bitmask, customizer, stack) + )) { + result = false; + break; + } + } + return result; + } + + /** + * A specialized version of `baseIsEqualDeep` for comparing objects of + * the same `toStringTag`. + * + * **Note:** This function only supports comparing values with tags of + * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {string} tag The `toStringTag` of the objects to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ + function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) { + switch (tag) { + + case boolTag: + case dateTag: + case numberTag: + // Coerce booleans to `1` or `0` and dates to milliseconds. + // Invalid dates are coerced to `NaN`. + return eq(+object, +other); + + case errorTag: + return object.name == other.name && object.message == other.message; + + case regexpTag: + case stringTag: + // Coerce regexes to strings and treat strings, primitives and objects, + // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring + // for more details. + return object == (other + ''); + + } + return false; + } + + /** + * A specialized version of `baseIsEqualDeep` for objects with support for + * partial deep comparisons. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ + function equalObjects(object, other, bitmask, customizer, equalFunc, stack) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG, + objProps = keys(object), + objLength = objProps.length, + othProps = keys(other), + othLength = othProps.length; + + if (objLength != othLength && !isPartial) { + return false; + } + var index = objLength; + while (index--) { + var key = objProps[index]; + if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { + return false; + } + } + // Check that cyclic values are equal. + var objStacked = stack.get(object); + var othStacked = stack.get(other); + if (objStacked && othStacked) { + return objStacked == other && othStacked == object; + } + var result = true; + + var skipCtor = isPartial; + while (++index < objLength) { + key = objProps[index]; + var objValue = object[key], + othValue = other[key]; + + var compared; + // Recursively compare objects (susceptible to call stack limits). + if (!(compared === undefined + ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack)) + : compared + )) { + result = false; + break; + } + skipCtor || (skipCtor = key == 'constructor'); + } + if (result && !skipCtor) { + var objCtor = object.constructor, + othCtor = other.constructor; + + // Non `Object` object instances with different constructors are not equal. + if (objCtor != othCtor && + ('constructor' in object && 'constructor' in other) && + !(typeof objCtor == 'function' && objCtor instanceof objCtor && + typeof othCtor == 'function' && othCtor instanceof othCtor)) { + result = false; + } + } + return result; + } + + /** + * A specialized version of `baseRest` which flattens the rest array. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @returns {Function} Returns the new function. + */ + function flatRest(func) { + return setToString(overRest(func, undefined, flatten), func + ''); + } + + /** + * Checks if `value` is a flattenable `arguments` object or array. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. + */ + function isFlattenable(value) { + return isArray(value) || isArguments(value); + } + + /** + * Checks if `value` is a valid array-like index. + * + * @private + * @param {*} value The value to check. + * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. + * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + */ + function isIndex(value, length) { + var type = typeof value; + length = length == null ? MAX_SAFE_INTEGER : length; + + return !!length && + (type == 'number' || + (type != 'symbol' && reIsUint.test(value))) && + (value > -1 && value % 1 == 0 && value < length); + } + + /** + * Checks if the given arguments are from an iteratee call. + * + * @private + * @param {*} value The potential iteratee value argument. + * @param {*} index The potential iteratee index or key argument. + * @param {*} object The potential iteratee object argument. + * @returns {boolean} Returns `true` if the arguments are from an iteratee call, + * else `false`. + */ + function isIterateeCall(value, index, object) { + if (!isObject(object)) { + return false; + } + var type = typeof index; + if (type == 'number' + ? (isArrayLike(object) && isIndex(index, object.length)) + : (type == 'string' && index in object) + ) { + return eq(object[index], value); + } + return false; + } + + /** + * This function is like + * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * except that it includes inherited enumerable properties. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ + function nativeKeysIn(object) { + var result = []; + if (object != null) { + for (var key in Object(object)) { + result.push(key); + } + } + return result; + } + + /** + * Converts `value` to a string using `Object.prototype.toString`. + * + * @private + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + */ + function objectToString(value) { + return nativeObjectToString.call(value); + } + + /** + * A specialized version of `baseRest` which transforms the rest array. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @param {Function} transform The rest array transform. + * @returns {Function} Returns the new function. + */ + function overRest(func, start, transform) { + start = nativeMax(start === undefined ? (func.length - 1) : start, 0); + return function() { + var args = arguments, + index = -1, + length = nativeMax(args.length - start, 0), + array = Array(length); + + while (++index < length) { + array[index] = args[start + index]; + } + index = -1; + var otherArgs = Array(start + 1); + while (++index < start) { + otherArgs[index] = args[index]; + } + otherArgs[start] = transform(array); + return func.apply(this, otherArgs); + }; + } + + /** + * Sets the `toString` method of `func` to return `string`. + * + * @private + * @param {Function} func The function to modify. + * @param {Function} string The `toString` result. + * @returns {Function} Returns `func`. + */ + var setToString = identity; + + /*------------------------------------------------------------------------*/ + + /** + * Creates an array with all falsey values removed. The values `false`, `null`, + * `0`, `""`, `undefined`, and `NaN` are falsey. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to compact. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * _.compact([0, 1, false, 2, '', 3]); + * // => [1, 2, 3] + */ + function compact(array) { + return baseFilter(array, Boolean); + } + + /** + * Creates a new array concatenating `array` with any additional arrays + * and/or values. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to concatenate. + * @param {...*} [values] The values to concatenate. + * @returns {Array} Returns the new concatenated array. + * @example + * + * var array = [1]; + * var other = _.concat(array, 2, [3], [[4]]); + * + * console.log(other); + * // => [1, 2, 3, [4]] + * + * console.log(array); + * // => [1] + */ + function concat() { + var length = arguments.length; + if (!length) { + return []; + } + var args = Array(length - 1), + array = arguments[0], + index = length; + + while (index--) { + args[index - 1] = arguments[index]; + } + return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1)); + } + + /** + * This method is like `_.find` except that it returns the index of the first + * element `predicate` returns truthy for instead of the element itself. + * + * @static + * @memberOf _ + * @since 1.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=0] The index to search from. + * @returns {number} Returns the index of the found element, else `-1`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': false }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': true } + * ]; + * + * _.findIndex(users, function(o) { return o.user == 'barney'; }); + * // => 0 + * + * // The `_.matches` iteratee shorthand. + * _.findIndex(users, { 'user': 'fred', 'active': false }); + * // => 1 + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findIndex(users, ['active', false]); + * // => 0 + * + * // The `_.property` iteratee shorthand. + * _.findIndex(users, 'active'); + * // => 2 + */ + function findIndex(array, predicate, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index = fromIndex == null ? 0 : toInteger(fromIndex); + if (index < 0) { + index = nativeMax(length + index, 0); + } + return baseFindIndex(array, baseIteratee(predicate, 3), index); + } + + /** + * Flattens `array` a single level deep. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to flatten. + * @returns {Array} Returns the new flattened array. + * @example + * + * _.flatten([1, [2, [3, [4]], 5]]); + * // => [1, 2, [3, [4]], 5] + */ + function flatten(array) { + var length = array == null ? 0 : array.length; + return length ? baseFlatten(array, 1) : []; + } + + /** + * Recursively flattens `array`. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to flatten. + * @returns {Array} Returns the new flattened array. + * @example + * + * _.flattenDeep([1, [2, [3, [4]], 5]]); + * // => [1, 2, 3, 4, 5] + */ + function flattenDeep(array) { + var length = array == null ? 0 : array.length; + return length ? baseFlatten(array, INFINITY) : []; + } + + /** + * Gets the first element of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @alias first + * @category Array + * @param {Array} array The array to query. + * @returns {*} Returns the first element of `array`. + * @example + * + * _.head([1, 2, 3]); + * // => 1 + * + * _.head([]); + * // => undefined + */ + function head(array) { + return (array && array.length) ? array[0] : undefined; + } + + /** + * Gets the index at which the first occurrence of `value` is found in `array` + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. If `fromIndex` is negative, it's used as the + * offset from the end of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} [fromIndex=0] The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.indexOf([1, 2, 1, 2], 2); + * // => 1 + * + * // Search from the `fromIndex`. + * _.indexOf([1, 2, 1, 2], 2, 2); + * // => 3 + */ + function indexOf(array, value, fromIndex) { + var length = array == null ? 0 : array.length; + if (typeof fromIndex == 'number') { + fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : fromIndex; + } else { + fromIndex = 0; + } + var index = (fromIndex || 0) - 1, + isReflexive = value === value; + + while (++index < length) { + var other = array[index]; + if ((isReflexive ? other === value : other !== other)) { + return index; + } + } + return -1; + } + + /** + * Gets the last element of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to query. + * @returns {*} Returns the last element of `array`. + * @example + * + * _.last([1, 2, 3]); + * // => 3 + */ + function last(array) { + var length = array == null ? 0 : array.length; + return length ? array[length - 1] : undefined; + } + + /** + * Creates a slice of `array` from `start` up to, but not including, `end`. + * + * **Note:** This method is used instead of + * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are + * returned. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to slice. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the slice of `array`. + */ + function slice(array, start, end) { + var length = array == null ? 0 : array.length; + start = start == null ? 0 : +start; + end = end === undefined ? length : +end; + return length ? baseSlice(array, start, end) : []; + } + + /*------------------------------------------------------------------------*/ + + /** + * Creates a `lodash` wrapper instance that wraps `value` with explicit method + * chain sequences enabled. The result of such sequences must be unwrapped + * with `_#value`. + * + * @static + * @memberOf _ + * @since 1.3.0 + * @category Seq + * @param {*} value The value to wrap. + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 40 }, + * { 'user': 'pebbles', 'age': 1 } + * ]; + * + * var youngest = _ + * .chain(users) + * .sortBy('age') + * .map(function(o) { + * return o.user + ' is ' + o.age; + * }) + * .head() + * .value(); + * // => 'pebbles is 1' + */ + function chain(value) { + var result = lodash(value); + result.__chain__ = true; + return result; + } + + /** + * This method invokes `interceptor` and returns `value`. The interceptor + * is invoked with one argument; (value). The purpose of this method is to + * "tap into" a method chain sequence in order to modify intermediate results. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Seq + * @param {*} value The value to provide to `interceptor`. + * @param {Function} interceptor The function to invoke. + * @returns {*} Returns `value`. + * @example + * + * _([1, 2, 3]) + * .tap(function(array) { + * // Mutate input array. + * array.pop(); + * }) + * .reverse() + * .value(); + * // => [2, 1] + */ + function tap(value, interceptor) { + interceptor(value); + return value; + } + + /** + * This method is like `_.tap` except that it returns the result of `interceptor`. + * The purpose of this method is to "pass thru" values replacing intermediate + * results in a method chain sequence. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Seq + * @param {*} value The value to provide to `interceptor`. + * @param {Function} interceptor The function to invoke. + * @returns {*} Returns the result of `interceptor`. + * @example + * + * _(' abc ') + * .chain() + * .trim() + * .thru(function(value) { + * return [value]; + * }) + * .value(); + * // => ['abc'] + */ + function thru(value, interceptor) { + return interceptor(value); + } + + /** + * Creates a `lodash` wrapper instance with explicit method chain sequences enabled. + * + * @name chain + * @memberOf _ + * @since 0.1.0 + * @category Seq + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 40 } + * ]; + * + * // A sequence without explicit chaining. + * _(users).head(); + * // => { 'user': 'barney', 'age': 36 } + * + * // A sequence with explicit chaining. + * _(users) + * .chain() + * .head() + * .pick('user') + * .value(); + * // => { 'user': 'barney' } + */ + function wrapperChain() { + return chain(this); + } + + /** + * Executes the chain sequence to resolve the unwrapped value. + * + * @name value + * @memberOf _ + * @since 0.1.0 + * @alias toJSON, valueOf + * @category Seq + * @returns {*} Returns the resolved unwrapped value. + * @example + * + * _([1, 2, 3]).value(); + * // => [1, 2, 3] + */ + function wrapperValue() { + return baseWrapperValue(this.__wrapped__, this.__actions__); + } + + /*------------------------------------------------------------------------*/ + + /** + * Checks if `predicate` returns truthy for **all** elements of `collection`. + * Iteration is stopped once `predicate` returns falsey. The predicate is + * invoked with three arguments: (value, index|key, collection). + * + * **Note:** This method returns `true` for + * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because + * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of + * elements of empty collections. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false`. + * @example + * + * _.every([true, 1, null, 'yes'], Boolean); + * // => false + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': false }, + * { 'user': 'fred', 'age': 40, 'active': false } + * ]; + * + * // The `_.matches` iteratee shorthand. + * _.every(users, { 'user': 'barney', 'active': false }); + * // => false + * + * // The `_.matchesProperty` iteratee shorthand. + * _.every(users, ['active', false]); + * // => true + * + * // The `_.property` iteratee shorthand. + * _.every(users, 'active'); + * // => false + */ + function every(collection, predicate, guard) { + predicate = guard ? undefined : predicate; + return baseEvery(collection, baseIteratee(predicate)); + } + + /** + * Iterates over elements of `collection`, returning an array of all elements + * `predicate` returns truthy for. The predicate is invoked with three + * arguments: (value, index|key, collection). + * + * **Note:** Unlike `_.remove`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + * @see _.reject + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false } + * ]; + * + * _.filter(users, function(o) { return !o.active; }); + * // => objects for ['fred'] + * + * // The `_.matches` iteratee shorthand. + * _.filter(users, { 'age': 36, 'active': true }); + * // => objects for ['barney'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.filter(users, ['active', false]); + * // => objects for ['fred'] + * + * // The `_.property` iteratee shorthand. + * _.filter(users, 'active'); + * // => objects for ['barney'] + * + * // Combining several predicates using `_.overEvery` or `_.overSome`. + * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]])); + * // => objects for ['fred', 'barney'] + */ + function filter(collection, predicate) { + return baseFilter(collection, baseIteratee(predicate)); + } + + /** + * Iterates over elements of `collection`, returning the first element + * `predicate` returns truthy for. The predicate is invoked with three + * arguments: (value, index|key, collection). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=0] The index to search from. + * @returns {*} Returns the matched element, else `undefined`. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false }, + * { 'user': 'pebbles', 'age': 1, 'active': true } + * ]; + * + * _.find(users, function(o) { return o.age < 40; }); + * // => object for 'barney' + * + * // The `_.matches` iteratee shorthand. + * _.find(users, { 'age': 1, 'active': true }); + * // => object for 'pebbles' + * + * // The `_.matchesProperty` iteratee shorthand. + * _.find(users, ['active', false]); + * // => object for 'fred' + * + * // The `_.property` iteratee shorthand. + * _.find(users, 'active'); + * // => object for 'barney' + */ + var find = createFind(findIndex); + + /** + * Iterates over elements of `collection` and invokes `iteratee` for each element. + * The iteratee is invoked with three arguments: (value, index|key, collection). + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * **Note:** As with other "Collections" methods, objects with a "length" + * property are iterated like arrays. To avoid this behavior use `_.forIn` + * or `_.forOwn` for object iteration. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @alias each + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + * @see _.forEachRight + * @example + * + * _.forEach([1, 2], function(value) { + * console.log(value); + * }); + * // => Logs `1` then `2`. + * + * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) { + * console.log(key); + * }); + * // => Logs 'a' then 'b' (iteration order is not guaranteed). + */ + function forEach(collection, iteratee) { + return baseEach(collection, baseIteratee(iteratee)); + } + + /** + * Creates an array of values by running each element in `collection` thru + * `iteratee`. The iteratee is invoked with three arguments: + * (value, index|key, collection). + * + * Many lodash methods are guarded to work as iteratees for methods like + * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`. + * + * The guarded methods are: + * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`, + * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`, + * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`, + * `template`, `trim`, `trimEnd`, `trimStart`, and `words` + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + * @example + * + * function square(n) { + * return n * n; + * } + * + * _.map([4, 8], square); + * // => [16, 64] + * + * _.map({ 'a': 4, 'b': 8 }, square); + * // => [16, 64] (iteration order is not guaranteed) + * + * var users = [ + * { 'user': 'barney' }, + * { 'user': 'fred' } + * ]; + * + * // The `_.property` iteratee shorthand. + * _.map(users, 'user'); + * // => ['barney', 'fred'] + */ + function map(collection, iteratee) { + return baseMap(collection, baseIteratee(iteratee)); + } + + /** + * Reduces `collection` to a value which is the accumulated result of running + * each element in `collection` thru `iteratee`, where each successive + * invocation is supplied the return value of the previous. If `accumulator` + * is not given, the first element of `collection` is used as the initial + * value. The iteratee is invoked with four arguments: + * (accumulator, value, index|key, collection). + * + * Many lodash methods are guarded to work as iteratees for methods like + * `_.reduce`, `_.reduceRight`, and `_.transform`. + * + * The guarded methods are: + * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`, + * and `sortBy` + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @returns {*} Returns the accumulated value. + * @see _.reduceRight + * @example + * + * _.reduce([1, 2], function(sum, n) { + * return sum + n; + * }, 0); + * // => 3 + * + * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { + * (result[value] || (result[value] = [])).push(key); + * return result; + * }, {}); + * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed) + */ + function reduce(collection, iteratee, accumulator) { + return baseReduce(collection, baseIteratee(iteratee), accumulator, arguments.length < 3, baseEach); + } + + /** + * Gets the size of `collection` by returning its length for array-like + * values or the number of own enumerable string keyed properties for objects. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object|string} collection The collection to inspect. + * @returns {number} Returns the collection size. + * @example + * + * _.size([1, 2, 3]); + * // => 3 + * + * _.size({ 'a': 1, 'b': 2 }); + * // => 2 + * + * _.size('pebbles'); + * // => 7 + */ + function size(collection) { + if (collection == null) { + return 0; + } + collection = isArrayLike(collection) ? collection : nativeKeys(collection); + return collection.length; + } + + /** + * Checks if `predicate` returns truthy for **any** element of `collection`. + * Iteration is stopped once `predicate` returns truthy. The predicate is + * invoked with three arguments: (value, index|key, collection). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + * @example + * + * _.some([null, 0, 'yes', false], Boolean); + * // => true + * + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false } + * ]; + * + * // The `_.matches` iteratee shorthand. + * _.some(users, { 'user': 'barney', 'active': false }); + * // => false + * + * // The `_.matchesProperty` iteratee shorthand. + * _.some(users, ['active', false]); + * // => true + * + * // The `_.property` iteratee shorthand. + * _.some(users, 'active'); + * // => true + */ + function some(collection, predicate, guard) { + predicate = guard ? undefined : predicate; + return baseSome(collection, baseIteratee(predicate)); + } + + /** + * Creates an array of elements, sorted in ascending order by the results of + * running each element in a collection thru each iteratee. This method + * performs a stable sort, that is, it preserves the original sort order of + * equal elements. The iteratees are invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {...(Function|Function[])} [iteratees=[_.identity]] + * The iteratees to sort by. + * @returns {Array} Returns the new sorted array. + * @example + * + * var users = [ + * { 'user': 'fred', 'age': 48 }, + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 30 }, + * { 'user': 'barney', 'age': 34 } + * ]; + * + * _.sortBy(users, [function(o) { return o.user; }]); + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]] + * + * _.sortBy(users, ['user', 'age']); + * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]] + */ + function sortBy(collection, iteratee) { + var index = 0; + iteratee = baseIteratee(iteratee); + + return baseMap(baseMap(collection, function(value, key, collection) { + return { 'value': value, 'index': index++, 'criteria': iteratee(value, key, collection) }; + }).sort(function(object, other) { + return compareAscending(object.criteria, other.criteria) || (object.index - other.index); + }), baseProperty('value')); + } + + /*------------------------------------------------------------------------*/ + + /** + * Creates a function that invokes `func`, with the `this` binding and arguments + * of the created function, while it's called less than `n` times. Subsequent + * calls to the created function return the result of the last `func` invocation. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {number} n The number of calls at which `func` is no longer invoked. + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * jQuery(element).on('click', _.before(5, addContactToList)); + * // => Allows adding up to 4 contacts to the list. + */ + function before(n, func) { + var result; + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + n = toInteger(n); + return function() { + if (--n > 0) { + result = func.apply(this, arguments); + } + if (n <= 1) { + func = undefined; + } + return result; + }; + } + + /** + * Creates a function that invokes `func` with the `this` binding of `thisArg` + * and `partials` prepended to the arguments it receives. + * + * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds, + * may be used as a placeholder for partially applied arguments. + * + * **Note:** Unlike native `Function#bind`, this method doesn't set the "length" + * property of bound functions. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to bind. + * @param {*} thisArg The `this` binding of `func`. + * @param {...*} [partials] The arguments to be partially applied. + * @returns {Function} Returns the new bound function. + * @example + * + * function greet(greeting, punctuation) { + * return greeting + ' ' + this.user + punctuation; + * } + * + * var object = { 'user': 'fred' }; + * + * var bound = _.bind(greet, object, 'hi'); + * bound('!'); + * // => 'hi fred!' + * + * // Bound with placeholders. + * var bound = _.bind(greet, object, _, '!'); + * bound('hi'); + * // => 'hi fred!' + */ + var bind = baseRest(function(func, thisArg, partials) { + return createPartial(func, WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG, thisArg, partials); + }); + + /** + * Defers invoking the `func` until the current call stack has cleared. Any + * additional arguments are provided to `func` when it's invoked. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to defer. + * @param {...*} [args] The arguments to invoke `func` with. + * @returns {number} Returns the timer id. + * @example + * + * _.defer(function(text) { + * console.log(text); + * }, 'deferred'); + * // => Logs 'deferred' after one millisecond. + */ + var defer = baseRest(function(func, args) { + return baseDelay(func, 1, args); + }); + + /** + * Invokes `func` after `wait` milliseconds. Any additional arguments are + * provided to `func` when it's invoked. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to delay. + * @param {number} wait The number of milliseconds to delay invocation. + * @param {...*} [args] The arguments to invoke `func` with. + * @returns {number} Returns the timer id. + * @example + * + * _.delay(function(text) { + * console.log(text); + * }, 1000, 'later'); + * // => Logs 'later' after one second. + */ + var delay = baseRest(function(func, wait, args) { + return baseDelay(func, toNumber(wait) || 0, args); + }); + + /** + * Creates a function that negates the result of the predicate `func`. The + * `func` predicate is invoked with the `this` binding and arguments of the + * created function. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {Function} predicate The predicate to negate. + * @returns {Function} Returns the new negated function. + * @example + * + * function isEven(n) { + * return n % 2 == 0; + * } + * + * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven)); + * // => [1, 3, 5] + */ + function negate(predicate) { + if (typeof predicate != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + return function() { + var args = arguments; + return !predicate.apply(this, args); + }; + } + + /** + * Creates a function that is restricted to invoking `func` once. Repeat calls + * to the function return the value of the first invocation. The `func` is + * invoked with the `this` binding and arguments of the created function. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * var initialize = _.once(createApplication); + * initialize(); + * initialize(); + * // => `createApplication` is invoked once + */ + function once(func) { + return before(2, func); + } + + /*------------------------------------------------------------------------*/ + + /** + * Creates a shallow clone of `value`. + * + * **Note:** This method is loosely based on the + * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm) + * and supports cloning arrays, array buffers, booleans, date objects, maps, + * numbers, `Object` objects, regexes, sets, strings, symbols, and typed + * arrays. The own enumerable properties of `arguments` objects are cloned + * as plain objects. An empty object is returned for uncloneable values such + * as error objects, functions, DOM nodes, and WeakMaps. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to clone. + * @returns {*} Returns the cloned value. + * @see _.cloneDeep + * @example + * + * var objects = [{ 'a': 1 }, { 'b': 2 }]; + * + * var shallow = _.clone(objects); + * console.log(shallow[0] === objects[0]); + * // => true + */ + function clone(value) { + if (!isObject(value)) { + return value; + } + return isArray(value) ? copyArray(value) : copyObject(value, nativeKeys(value)); + } + + /** + * Performs a + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * comparison between two values to determine if they are equivalent. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.eq(object, object); + * // => true + * + * _.eq(object, other); + * // => false + * + * _.eq('a', 'a'); + * // => true + * + * _.eq('a', Object('a')); + * // => false + * + * _.eq(NaN, NaN); + * // => true + */ + function eq(value, other) { + return value === other || (value !== value && other !== other); + } + + /** + * Checks if `value` is likely an `arguments` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + * else `false`. + * @example + * + * _.isArguments(function() { return arguments; }()); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ + var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { + return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && + !propertyIsEnumerable.call(value, 'callee'); + }; + + /** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(document.body.children); + * // => false + * + * _.isArray('abc'); + * // => false + * + * _.isArray(_.noop); + * // => false + */ + var isArray = Array.isArray; + + /** + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @example + * + * _.isArrayLike([1, 2, 3]); + * // => true + * + * _.isArrayLike(document.body.children); + * // => true + * + * _.isArrayLike('abc'); + * // => true + * + * _.isArrayLike(_.noop); + * // => false + */ + function isArrayLike(value) { + return value != null && isLength(value.length) && !isFunction(value); + } + + /** + * Checks if `value` is classified as a boolean primitive or object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a boolean, else `false`. + * @example + * + * _.isBoolean(false); + * // => true + * + * _.isBoolean(null); + * // => false + */ + function isBoolean(value) { + return value === true || value === false || + (isObjectLike(value) && baseGetTag(value) == boolTag); + } + + /** + * Checks if `value` is classified as a `Date` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a date object, else `false`. + * @example + * + * _.isDate(new Date); + * // => true + * + * _.isDate('Mon April 23 2012'); + * // => false + */ + var isDate = baseIsDate; + + /** + * Checks if `value` is an empty object, collection, map, or set. + * + * Objects are considered empty if they have no own enumerable string keyed + * properties. + * + * Array-like values such as `arguments` objects, arrays, buffers, strings, or + * jQuery-like collections are considered empty if they have a `length` of `0`. + * Similarly, maps and sets are considered empty if they have a `size` of `0`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is empty, else `false`. + * @example + * + * _.isEmpty(null); + * // => true + * + * _.isEmpty(true); + * // => true + * + * _.isEmpty(1); + * // => true + * + * _.isEmpty([1, 2, 3]); + * // => false + * + * _.isEmpty({ 'a': 1 }); + * // => false + */ + function isEmpty(value) { + if (isArrayLike(value) && + (isArray(value) || isString(value) || + isFunction(value.splice) || isArguments(value))) { + return !value.length; + } + return !nativeKeys(value).length; + } + + /** + * Performs a deep comparison between two values to determine if they are + * equivalent. + * + * **Note:** This method supports comparing arrays, array buffers, booleans, + * date objects, error objects, maps, numbers, `Object` objects, regexes, + * sets, strings, symbols, and typed arrays. `Object` objects are compared + * by their own, not inherited, enumerable properties. Functions and DOM + * nodes are compared by strict equality, i.e. `===`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.isEqual(object, other); + * // => true + * + * object === other; + * // => false + */ + function isEqual(value, other) { + return baseIsEqual(value, other); + } + + /** + * Checks if `value` is a finite primitive number. + * + * **Note:** This method is based on + * [`Number.isFinite`](https://mdn.io/Number/isFinite). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a finite number, else `false`. + * @example + * + * _.isFinite(3); + * // => true + * + * _.isFinite(Number.MIN_VALUE); + * // => true + * + * _.isFinite(Infinity); + * // => false + * + * _.isFinite('3'); + * // => false + */ + function isFinite(value) { + return typeof value == 'number' && nativeIsFinite(value); + } + + /** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a function, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ + function isFunction(value) { + if (!isObject(value)) { + return false; + } + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 9 which returns 'object' for typed arrays and other constructors. + var tag = baseGetTag(value); + return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; + } + + /** + * Checks if `value` is a valid array-like length. + * + * **Note:** This method is loosely based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + * @example + * + * _.isLength(3); + * // => true + * + * _.isLength(Number.MIN_VALUE); + * // => false + * + * _.isLength(Infinity); + * // => false + * + * _.isLength('3'); + * // => false + */ + function isLength(value) { + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; + } + + /** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ + function isObject(value) { + var type = typeof value; + return value != null && (type == 'object' || type == 'function'); + } + + /** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ + function isObjectLike(value) { + return value != null && typeof value == 'object'; + } + + /** + * Checks if `value` is `NaN`. + * + * **Note:** This method is based on + * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as + * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for + * `undefined` and other non-number values. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. + * @example + * + * _.isNaN(NaN); + * // => true + * + * _.isNaN(new Number(NaN)); + * // => true + * + * isNaN(undefined); + * // => true + * + * _.isNaN(undefined); + * // => false + */ + function isNaN(value) { + // An `NaN` primitive is the only value that is not equal to itself. + // Perform the `toStringTag` check first to avoid errors with some + // ActiveX objects in IE. + return isNumber(value) && value != +value; + } + + /** + * Checks if `value` is `null`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `null`, else `false`. + * @example + * + * _.isNull(null); + * // => true + * + * _.isNull(void 0); + * // => false + */ + function isNull(value) { + return value === null; + } + + /** + * Checks if `value` is classified as a `Number` primitive or object. + * + * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are + * classified as numbers, use the `_.isFinite` method. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a number, else `false`. + * @example + * + * _.isNumber(3); + * // => true + * + * _.isNumber(Number.MIN_VALUE); + * // => true + * + * _.isNumber(Infinity); + * // => true + * + * _.isNumber('3'); + * // => false + */ + function isNumber(value) { + return typeof value == 'number' || + (isObjectLike(value) && baseGetTag(value) == numberTag); + } + + /** + * Checks if `value` is classified as a `RegExp` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. + * @example + * + * _.isRegExp(/abc/); + * // => true + * + * _.isRegExp('/abc/'); + * // => false + */ + var isRegExp = baseIsRegExp; + + /** + * Checks if `value` is classified as a `String` primitive or object. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a string, else `false`. + * @example + * + * _.isString('abc'); + * // => true + * + * _.isString(1); + * // => false + */ + function isString(value) { + return typeof value == 'string' || + (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag); + } + + /** + * Checks if `value` is `undefined`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`. + * @example + * + * _.isUndefined(void 0); + * // => true + * + * _.isUndefined(null); + * // => false + */ + function isUndefined(value) { + return value === undefined; + } + + /** + * Converts `value` to an array. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Lang + * @param {*} value The value to convert. + * @returns {Array} Returns the converted array. + * @example + * + * _.toArray({ 'a': 1, 'b': 2 }); + * // => [1, 2] + * + * _.toArray('abc'); + * // => ['a', 'b', 'c'] + * + * _.toArray(1); + * // => [] + * + * _.toArray(null); + * // => [] + */ + function toArray(value) { + if (!isArrayLike(value)) { + return values(value); + } + return value.length ? copyArray(value) : []; + } + + /** + * Converts `value` to an integer. + * + * **Note:** This method is loosely based on + * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted integer. + * @example + * + * _.toInteger(3.2); + * // => 3 + * + * _.toInteger(Number.MIN_VALUE); + * // => 0 + * + * _.toInteger(Infinity); + * // => 1.7976931348623157e+308 + * + * _.toInteger('3.2'); + * // => 3 + */ + var toInteger = Number; + + /** + * Converts `value` to a number. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to process. + * @returns {number} Returns the number. + * @example + * + * _.toNumber(3.2); + * // => 3.2 + * + * _.toNumber(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toNumber(Infinity); + * // => Infinity + * + * _.toNumber('3.2'); + * // => 3.2 + */ + var toNumber = Number; + + /** + * Converts `value` to a string. An empty string is returned for `null` + * and `undefined` values. The sign of `-0` is preserved. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + * @example + * + * _.toString(null); + * // => '' + * + * _.toString(-0); + * // => '-0' + * + * _.toString([1, 2, 3]); + * // => '1,2,3' + */ + function toString(value) { + if (typeof value == 'string') { + return value; + } + return value == null ? '' : (value + ''); + } + + /*------------------------------------------------------------------------*/ + + /** + * Assigns own enumerable string keyed properties of source objects to the + * destination object. Source objects are applied from left to right. + * Subsequent sources overwrite property assignments of previous sources. + * + * **Note:** This method mutates `object` and is loosely based on + * [`Object.assign`](https://mdn.io/Object/assign). + * + * @static + * @memberOf _ + * @since 0.10.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.assignIn + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * function Bar() { + * this.c = 3; + * } + * + * Foo.prototype.b = 2; + * Bar.prototype.d = 4; + * + * _.assign({ 'a': 0 }, new Foo, new Bar); + * // => { 'a': 1, 'c': 3 } + */ + var assign = createAssigner(function(object, source) { + copyObject(source, nativeKeys(source), object); + }); + + /** + * This method is like `_.assign` except that it iterates over own and + * inherited source properties. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @alias extend + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.assign + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * function Bar() { + * this.c = 3; + * } + * + * Foo.prototype.b = 2; + * Bar.prototype.d = 4; + * + * _.assignIn({ 'a': 0 }, new Foo, new Bar); + * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 } + */ + var assignIn = createAssigner(function(object, source) { + copyObject(source, nativeKeysIn(source), object); + }); + + /** + * Creates an object that inherits from the `prototype` object. If a + * `properties` object is given, its own enumerable string keyed properties + * are assigned to the created object. + * + * @static + * @memberOf _ + * @since 2.3.0 + * @category Object + * @param {Object} prototype The object to inherit from. + * @param {Object} [properties] The properties to assign to the object. + * @returns {Object} Returns the new object. + * @example + * + * function Shape() { + * this.x = 0; + * this.y = 0; + * } + * + * function Circle() { + * Shape.call(this); + * } + * + * Circle.prototype = _.create(Shape.prototype, { + * 'constructor': Circle + * }); + * + * var circle = new Circle; + * circle instanceof Circle; + * // => true + * + * circle instanceof Shape; + * // => true + */ + function create(prototype, properties) { + var result = baseCreate(prototype); + return properties == null ? result : assign(result, properties); + } + + /** + * Assigns own and inherited enumerable string keyed properties of source + * objects to the destination object for all destination properties that + * resolve to `undefined`. Source objects are applied from left to right. + * Once a property is set, additional values of the same property are ignored. + * + * **Note:** This method mutates `object`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.defaultsDeep + * @example + * + * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); + * // => { 'a': 1, 'b': 2 } + */ + var defaults = baseRest(function(object, sources) { + object = Object(object); + + var index = -1; + var length = sources.length; + var guard = length > 2 ? sources[2] : undefined; + + if (guard && isIterateeCall(sources[0], sources[1], guard)) { + length = 1; + } + + while (++index < length) { + var source = sources[index]; + var props = keysIn(source); + var propsIndex = -1; + var propsLength = props.length; + + while (++propsIndex < propsLength) { + var key = props[propsIndex]; + var value = object[key]; + + if (value === undefined || + (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) { + object[key] = source[key]; + } + } + } + + return object; + }); + + /** + * Checks if `path` is a direct property of `object`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + * @example + * + * var object = { 'a': { 'b': 2 } }; + * var other = _.create({ 'a': _.create({ 'b': 2 }) }); + * + * _.has(object, 'a'); + * // => true + * + * _.has(object, 'a.b'); + * // => true + * + * _.has(object, ['a', 'b']); + * // => true + * + * _.has(other, 'a'); + * // => false + */ + function has(object, path) { + return object != null && hasOwnProperty.call(object, path); + } + + /** + * Creates an array of the own enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. See the + * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * for more details. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keys(new Foo); + * // => ['a', 'b'] (iteration order is not guaranteed) + * + * _.keys('hi'); + * // => ['0', '1'] + */ + var keys = nativeKeys; + + /** + * Creates an array of the own and inherited enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keysIn(new Foo); + * // => ['a', 'b', 'c'] (iteration order is not guaranteed) + */ + var keysIn = nativeKeysIn; + + /** + * Creates an object composed of the picked `object` properties. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The source object. + * @param {...(string|string[])} [paths] The property paths to pick. + * @returns {Object} Returns the new object. + * @example + * + * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * + * _.pick(object, ['a', 'c']); + * // => { 'a': 1, 'c': 3 } + */ + var pick = flatRest(function(object, paths) { + return object == null ? {} : basePick(object, paths); + }); + + /** + * This method is like `_.get` except that if the resolved value is a + * function it's invoked with the `this` binding of its parent object and + * its result is returned. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to resolve. + * @param {*} [defaultValue] The value returned for `undefined` resolved values. + * @returns {*} Returns the resolved value. + * @example + * + * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] }; + * + * _.result(object, 'a[0].b.c1'); + * // => 3 + * + * _.result(object, 'a[0].b.c2'); + * // => 4 + * + * _.result(object, 'a[0].b.c3', 'default'); + * // => 'default' + * + * _.result(object, 'a[0].b.c3', _.constant('default')); + * // => 'default' + */ + function result(object, path, defaultValue) { + var value = object == null ? undefined : object[path]; + if (value === undefined) { + value = defaultValue; + } + return isFunction(value) ? value.call(object) : value; + } + + /** + * Creates an array of the own enumerable string keyed property values of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property values. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.values(new Foo); + * // => [1, 2] (iteration order is not guaranteed) + * + * _.values('hi'); + * // => ['h', 'i'] + */ + function values(object) { + return object == null ? [] : baseValues(object, keys(object)); + } + + /*------------------------------------------------------------------------*/ + + /** + * Converts the characters "&", "<", ">", '"', and "'" in `string` to their + * corresponding HTML entities. + * + * **Note:** No other characters are escaped. To escape additional + * characters use a third-party library like [_he_](https://mths.be/he). + * + * Though the ">" character is escaped for symmetry, characters like + * ">" and "/" don't need escaping in HTML and have no special meaning + * unless they're part of a tag or unquoted attribute value. See + * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands) + * (under "semi-related fun fact") for more details. + * + * When working with HTML you should always + * [quote attribute values](http://wonko.com/post/html-escaping) to reduce + * XSS vectors. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category String + * @param {string} [string=''] The string to escape. + * @returns {string} Returns the escaped string. + * @example + * + * _.escape('fred, barney, & pebbles'); + * // => 'fred, barney, & pebbles' + */ + function escape(string) { + string = toString(string); + return (string && reHasUnescapedHtml.test(string)) + ? string.replace(reUnescapedHtml, escapeHtmlChar) + : string; + } + + /*------------------------------------------------------------------------*/ + + /** + * This method returns the first argument it receives. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @param {*} value Any value. + * @returns {*} Returns `value`. + * @example + * + * var object = { 'a': 1 }; + * + * console.log(_.identity(object) === object); + * // => true + */ + function identity(value) { + return value; + } + + /** + * Creates a function that invokes `func` with the arguments of the created + * function. If `func` is a property name, the created function returns the + * property value for a given element. If `func` is an array or object, the + * created function returns `true` for elements that contain the equivalent + * source properties, otherwise it returns `false`. + * + * @static + * @since 4.0.0 + * @memberOf _ + * @category Util + * @param {*} [func=_.identity] The value to convert to a callback. + * @returns {Function} Returns the callback. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false } + * ]; + * + * // The `_.matches` iteratee shorthand. + * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true })); + * // => [{ 'user': 'barney', 'age': 36, 'active': true }] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.filter(users, _.iteratee(['user', 'fred'])); + * // => [{ 'user': 'fred', 'age': 40 }] + * + * // The `_.property` iteratee shorthand. + * _.map(users, _.iteratee('user')); + * // => ['barney', 'fred'] + * + * // Create custom iteratee shorthands. + * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) { + * return !_.isRegExp(func) ? iteratee(func) : function(string) { + * return func.test(string); + * }; + * }); + * + * _.filter(['abc', 'def'], /ef/); + * // => ['def'] + */ + var iteratee = baseIteratee; + + /** + * Creates a function that performs a partial deep comparison between a given + * object and `source`, returning `true` if the given object has equivalent + * property values, else `false`. + * + * **Note:** The created function is equivalent to `_.isMatch` with `source` + * partially applied. + * + * Partial comparisons will match empty array and empty object `source` + * values against any array or object value, respectively. See `_.isEqual` + * for a list of supported value comparisons. + * + * **Note:** Multiple values can be checked by combining several matchers + * using `_.overSome` + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Util + * @param {Object} source The object of property values to match. + * @returns {Function} Returns the new spec function. + * @example + * + * var objects = [ + * { 'a': 1, 'b': 2, 'c': 3 }, + * { 'a': 4, 'b': 5, 'c': 6 } + * ]; + * + * _.filter(objects, _.matches({ 'a': 4, 'c': 6 })); + * // => [{ 'a': 4, 'b': 5, 'c': 6 }] + * + * // Checking for several possible values + * _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })])); + * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }] + */ + function matches(source) { + return baseMatches(assign({}, source)); + } + + /** + * Adds all own enumerable string keyed function properties of a source + * object to the destination object. If `object` is a function, then methods + * are added to its prototype as well. + * + * **Note:** Use `_.runInContext` to create a pristine `lodash` function to + * avoid conflicts caused by modifying the original. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @param {Function|Object} [object=lodash] The destination object. + * @param {Object} source The object of functions to add. + * @param {Object} [options={}] The options object. + * @param {boolean} [options.chain=true] Specify whether mixins are chainable. + * @returns {Function|Object} Returns `object`. + * @example + * + * function vowels(string) { + * return _.filter(string, function(v) { + * return /[aeiou]/i.test(v); + * }); + * } + * + * _.mixin({ 'vowels': vowels }); + * _.vowels('fred'); + * // => ['e'] + * + * _('fred').vowels().value(); + * // => ['e'] + * + * _.mixin({ 'vowels': vowels }, { 'chain': false }); + * _('fred').vowels(); + * // => ['e'] + */ + function mixin(object, source, options) { + var props = keys(source), + methodNames = baseFunctions(source, props); + + if (options == null && + !(isObject(source) && (methodNames.length || !props.length))) { + options = source; + source = object; + object = this; + methodNames = baseFunctions(source, keys(source)); + } + var chain = !(isObject(options) && 'chain' in options) || !!options.chain, + isFunc = isFunction(object); + + baseEach(methodNames, function(methodName) { + var func = source[methodName]; + object[methodName] = func; + if (isFunc) { + object.prototype[methodName] = function() { + var chainAll = this.__chain__; + if (chain || chainAll) { + var result = object(this.__wrapped__), + actions = result.__actions__ = copyArray(this.__actions__); + + actions.push({ 'func': func, 'args': arguments, 'thisArg': object }); + result.__chain__ = chainAll; + return result; + } + return func.apply(object, arrayPush([this.value()], arguments)); + }; + } + }); + + return object; + } + + /** + * Reverts the `_` variable to its previous value and returns a reference to + * the `lodash` function. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @returns {Function} Returns the `lodash` function. + * @example + * + * var lodash = _.noConflict(); + */ + function noConflict() { + if (root._ === this) { + root._ = oldDash; + } + return this; + } + + /** + * This method returns `undefined`. + * + * @static + * @memberOf _ + * @since 2.3.0 + * @category Util + * @example + * + * _.times(2, _.noop); + * // => [undefined, undefined] + */ + function noop() { + // No operation performed. + } + + /** + * Generates a unique ID. If `prefix` is given, the ID is appended to it. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @param {string} [prefix=''] The value to prefix the ID with. + * @returns {string} Returns the unique ID. + * @example + * + * _.uniqueId('contact_'); + * // => 'contact_104' + * + * _.uniqueId(); + * // => '105' + */ + function uniqueId(prefix) { + var id = ++idCounter; + return toString(prefix) + id; + } + + /*------------------------------------------------------------------------*/ + + /** + * Computes the maximum value of `array`. If `array` is empty or falsey, + * `undefined` is returned. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Math + * @param {Array} array The array to iterate over. + * @returns {*} Returns the maximum value. + * @example + * + * _.max([4, 2, 8, 6]); + * // => 8 + * + * _.max([]); + * // => undefined + */ + function max(array) { + return (array && array.length) + ? baseExtremum(array, identity, baseGt) + : undefined; + } + + /** + * Computes the minimum value of `array`. If `array` is empty or falsey, + * `undefined` is returned. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Math + * @param {Array} array The array to iterate over. + * @returns {*} Returns the minimum value. + * @example + * + * _.min([4, 2, 8, 6]); + * // => 2 + * + * _.min([]); + * // => undefined + */ + function min(array) { + return (array && array.length) + ? baseExtremum(array, identity, baseLt) + : undefined; + } + + /*------------------------------------------------------------------------*/ + + // Add methods that return wrapped values in chain sequences. + lodash.assignIn = assignIn; + lodash.before = before; + lodash.bind = bind; + lodash.chain = chain; + lodash.compact = compact; + lodash.concat = concat; + lodash.create = create; + lodash.defaults = defaults; + lodash.defer = defer; + lodash.delay = delay; + lodash.filter = filter; + lodash.flatten = flatten; + lodash.flattenDeep = flattenDeep; + lodash.iteratee = iteratee; + lodash.keys = keys; + lodash.map = map; + lodash.matches = matches; + lodash.mixin = mixin; + lodash.negate = negate; + lodash.once = once; + lodash.pick = pick; + lodash.slice = slice; + lodash.sortBy = sortBy; + lodash.tap = tap; + lodash.thru = thru; + lodash.toArray = toArray; + lodash.values = values; + + // Add aliases. + lodash.extend = assignIn; + + // Add methods to `lodash.prototype`. + mixin(lodash, lodash); + + /*------------------------------------------------------------------------*/ + + // Add methods that return unwrapped values in chain sequences. + lodash.clone = clone; + lodash.escape = escape; + lodash.every = every; + lodash.find = find; + lodash.forEach = forEach; + lodash.has = has; + lodash.head = head; + lodash.identity = identity; + lodash.indexOf = indexOf; + lodash.isArguments = isArguments; + lodash.isArray = isArray; + lodash.isBoolean = isBoolean; + lodash.isDate = isDate; + lodash.isEmpty = isEmpty; + lodash.isEqual = isEqual; + lodash.isFinite = isFinite; + lodash.isFunction = isFunction; + lodash.isNaN = isNaN; + lodash.isNull = isNull; + lodash.isNumber = isNumber; + lodash.isObject = isObject; + lodash.isRegExp = isRegExp; + lodash.isString = isString; + lodash.isUndefined = isUndefined; + lodash.last = last; + lodash.max = max; + lodash.min = min; + lodash.noConflict = noConflict; + lodash.noop = noop; + lodash.reduce = reduce; + lodash.result = result; + lodash.size = size; + lodash.some = some; + lodash.uniqueId = uniqueId; + + // Add aliases. + lodash.each = forEach; + lodash.first = head; + + mixin(lodash, (function() { + var source = {}; + baseForOwn(lodash, function(func, methodName) { + if (!hasOwnProperty.call(lodash.prototype, methodName)) { + source[methodName] = func; + } + }); + return source; + }()), { 'chain': false }); + + /*------------------------------------------------------------------------*/ + + /** + * The semantic version number. + * + * @static + * @memberOf _ + * @type {string} + */ + lodash.VERSION = VERSION; + + // Add `Array` methods to `lodash.prototype`. + baseEach(['pop', 'join', 'replace', 'reverse', 'split', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) { + var func = (/^(?:replace|split)$/.test(methodName) ? String.prototype : arrayProto)[methodName], + chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru', + retUnwrapped = /^(?:pop|join|replace|shift)$/.test(methodName); + + lodash.prototype[methodName] = function() { + var args = arguments; + if (retUnwrapped && !this.__chain__) { + var value = this.value(); + return func.apply(isArray(value) ? value : [], args); + } + return this[chainName](function(value) { + return func.apply(isArray(value) ? value : [], args); + }); + }; + }); + + // Add chain sequence methods to the `lodash` wrapper. + lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue; + + /*--------------------------------------------------------------------------*/ + + // Some AMD build optimizers, like r.js, check for condition patterns like: + if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) { + // Expose Lodash on the global object to prevent errors when Lodash is + // loaded by a script tag in the presence of an AMD loader. + // See http://requirejs.org/docs/errors.html#mismatch for more details. + // Use `_.noConflict` to remove Lodash from the global object. + root._ = lodash; + + // Define as an anonymous module so, through path mapping, it can be + // referenced as the "underscore" module. + define(function() { + return lodash; + }); + } + // Check for `exports` after `define` in case a build optimizer adds it. + else if (freeModule) { + // Export for Node.js. + (freeModule.exports = lodash)._ = lodash; + // Export for CommonJS support. + freeExports._ = lodash; + } + else { + // Export to the global object. + root._ = lodash; + } +}.call(this)); diff --git a/node_modules/lodash/core.min.js b/node_modules/lodash/core.min.js new file mode 100644 index 0000000..e425e4d --- /dev/null +++ b/node_modules/lodash/core.min.js @@ -0,0 +1,29 @@ +/** + * @license + * Lodash (Custom Build) lodash.com/license | Underscore.js 1.8.3 underscorejs.org/LICENSE + * Build: `lodash core -o ./dist/lodash.core.js` + */ +;(function(){function n(n){return H(n)&&pn.call(n,"callee")&&!yn.call(n,"callee")}function t(n,t){return n.push.apply(n,t),n}function r(n){return function(t){return null==t?Z:t[n]}}function e(n,t,r,e,u){return u(n,function(n,u,o){r=e?(e=false,n):t(r,n,u,o)}),r}function u(n,t){return j(t,function(t){return n[t]})}function o(n){return n instanceof i?n:new i(n)}function i(n,t){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!t}function c(n,t,r){if(typeof n!="function")throw new TypeError("Expected a function"); +return setTimeout(function(){n.apply(Z,r)},t)}function f(n,t){var r=true;return mn(n,function(n,e,u){return r=!!t(n,e,u)}),r}function a(n,t,r){for(var e=-1,u=n.length;++et}function b(n,t,r,e,u){return n===t||(null==n||null==t||!H(n)&&!H(t)?n!==n&&t!==t:y(n,t,r,e,b,u))}function y(n,t,r,e,u,o){var i=Nn(n),c=Nn(t),f=i?"[object Array]":hn.call(n),a=c?"[object Array]":hn.call(t),f="[object Arguments]"==f?"[object Object]":f,a="[object Arguments]"==a?"[object Object]":a,l="[object Object]"==f,c="[object Object]"==a,a=f==a;o||(o=[]);var p=An(o,function(t){return t[0]==n}),s=An(o,function(n){ +return n[0]==t});if(p&&s)return p[1]==t;if(o.push([n,t]),o.push([t,n]),a&&!l){if(i)r=T(n,t,r,e,u,o);else n:{switch(f){case"[object Boolean]":case"[object Date]":case"[object Number]":r=J(+n,+t);break n;case"[object Error]":r=n.name==t.name&&n.message==t.message;break n;case"[object RegExp]":case"[object String]":r=n==t+"";break n}r=false}return o.pop(),r}return 1&r||(i=l&&pn.call(n,"__wrapped__"),f=c&&pn.call(t,"__wrapped__"),!i&&!f)?!!a&&(r=B(n,t,r,e,u,o),o.pop(),r):(i=i?n.value():n,f=f?t.value():t, +r=u(i,f,r,e,o),o.pop(),r)}function g(n){return typeof n=="function"?n:null==n?X:(typeof n=="object"?d:r)(n)}function _(n,t){return nt&&(t=-t>u?0:u+t),r=r>u?u:r,0>r&&(r+=u),u=t>r?0:r-t>>>0,t>>>=0,r=Array(u);++ei))return false;var c=o.get(n),f=o.get(t);if(c&&f)return c==t&&f==n;for(var c=-1,f=true,a=2&r?[]:Z;++cr?jn(e+r,0):r:0,r=(r||0)-1;for(var u=t===t;++rarguments.length,mn); +}function G(n,t){var r;if(typeof t!="function")throw new TypeError("Expected a function");return n=Fn(n),function(){return 0<--n&&(r=t.apply(this,arguments)),1>=n&&(t=Z),r}}function J(n,t){return n===t||n!==n&&t!==t}function M(n){var t;return(t=null!=n)&&(t=n.length,t=typeof t=="number"&&-1=t),t&&!U(n)}function U(n){return!!V(n)&&(n=hn.call(n),"[object Function]"==n||"[object GeneratorFunction]"==n||"[object AsyncFunction]"==n||"[object Proxy]"==n)}function V(n){var t=typeof n; +return null!=n&&("object"==t||"function"==t)}function H(n){return null!=n&&typeof n=="object"}function K(n){return typeof n=="number"||H(n)&&"[object Number]"==hn.call(n)}function L(n){return typeof n=="string"||!Nn(n)&&H(n)&&"[object String]"==hn.call(n)}function Q(n){return typeof n=="string"?n:null==n?"":n+""}function W(n){return null==n?[]:u(n,Dn(n))}function X(n){return n}function Y(n,r,e){var u=Dn(r),o=h(r,u);null!=e||V(r)&&(o.length||!u.length)||(e=r,r=n,n=this,o=h(r,Dn(r)));var i=!(V(e)&&"chain"in e&&!e.chain),c=U(n); +return mn(o,function(e){var u=r[e];n[e]=u,c&&(n.prototype[e]=function(){var r=this.__chain__;if(i||r){var e=n(this.__wrapped__);return(e.__actions__=A(this.__actions__)).push({func:u,args:arguments,thisArg:n}),e.__chain__=r,e}return u.apply(n,t([this.value()],arguments))})}),n}var Z,nn=1/0,tn=/[&<>"']/g,rn=RegExp(tn.source),en=/^(?:0|[1-9]\d*)$/,un=typeof self=="object"&&self&&self.Object===Object&&self,on=typeof global=="object"&&global&&global.Object===Object&&global||un||Function("return this")(),cn=(un=typeof exports=="object"&&exports&&!exports.nodeType&&exports)&&typeof module=="object"&&module&&!module.nodeType&&module,fn=function(n){ +return function(t){return null==n?Z:n[t]}}({"&":"&","<":"<",">":">",'"':""","'":"'"}),an=Array.prototype,ln=Object.prototype,pn=ln.hasOwnProperty,sn=0,hn=ln.toString,vn=on._,bn=Object.create,yn=ln.propertyIsEnumerable,gn=on.isFinite,_n=function(n,t){return function(r){return n(t(r))}}(Object.keys,Object),jn=Math.max,dn=function(){function n(){}return function(t){return V(t)?bn?bn(t):(n.prototype=t,t=new n,n.prototype=Z,t):{}}}();i.prototype=dn(o.prototype),i.prototype.constructor=i; +var mn=function(n,t){return function(r,e){if(null==r)return r;if(!M(r))return n(r,e);for(var u=r.length,o=t?u:-1,i=Object(r);(t?o--:++or&&(r=jn(e+r,0));n:{for(t=g(t),e=n.length,r+=-1;++re||o&&c&&a||!u&&a||!i){r=1;break n}if(!o&&r { '4': 1, '6': 2 } + * + * // The `_.property` iteratee shorthand. + * _.countBy(['one', 'two', 'three'], 'length'); + * // => { '3': 2, '5': 1 } + */ +var countBy = createAggregator(function(result, value, key) { + if (hasOwnProperty.call(result, key)) { + ++result[key]; + } else { + baseAssignValue(result, key, 1); + } +}); + +module.exports = countBy; diff --git a/node_modules/lodash/create.js b/node_modules/lodash/create.js new file mode 100644 index 0000000..919edb8 --- /dev/null +++ b/node_modules/lodash/create.js @@ -0,0 +1,43 @@ +var baseAssign = require('./_baseAssign'), + baseCreate = require('./_baseCreate'); + +/** + * Creates an object that inherits from the `prototype` object. If a + * `properties` object is given, its own enumerable string keyed properties + * are assigned to the created object. + * + * @static + * @memberOf _ + * @since 2.3.0 + * @category Object + * @param {Object} prototype The object to inherit from. + * @param {Object} [properties] The properties to assign to the object. + * @returns {Object} Returns the new object. + * @example + * + * function Shape() { + * this.x = 0; + * this.y = 0; + * } + * + * function Circle() { + * Shape.call(this); + * } + * + * Circle.prototype = _.create(Shape.prototype, { + * 'constructor': Circle + * }); + * + * var circle = new Circle; + * circle instanceof Circle; + * // => true + * + * circle instanceof Shape; + * // => true + */ +function create(prototype, properties) { + var result = baseCreate(prototype); + return properties == null ? result : baseAssign(result, properties); +} + +module.exports = create; diff --git a/node_modules/lodash/curry.js b/node_modules/lodash/curry.js new file mode 100644 index 0000000..918db1a --- /dev/null +++ b/node_modules/lodash/curry.js @@ -0,0 +1,57 @@ +var createWrap = require('./_createWrap'); + +/** Used to compose bitmasks for function metadata. */ +var WRAP_CURRY_FLAG = 8; + +/** + * Creates a function that accepts arguments of `func` and either invokes + * `func` returning its result, if at least `arity` number of arguments have + * been provided, or returns a function that accepts the remaining `func` + * arguments, and so on. The arity of `func` may be specified if `func.length` + * is not sufficient. + * + * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds, + * may be used as a placeholder for provided arguments. + * + * **Note:** This method doesn't set the "length" property of curried functions. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Function + * @param {Function} func The function to curry. + * @param {number} [arity=func.length] The arity of `func`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Function} Returns the new curried function. + * @example + * + * var abc = function(a, b, c) { + * return [a, b, c]; + * }; + * + * var curried = _.curry(abc); + * + * curried(1)(2)(3); + * // => [1, 2, 3] + * + * curried(1, 2)(3); + * // => [1, 2, 3] + * + * curried(1, 2, 3); + * // => [1, 2, 3] + * + * // Curried with placeholders. + * curried(1)(_, 3)(2); + * // => [1, 2, 3] + */ +function curry(func, arity, guard) { + arity = guard ? undefined : arity; + var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity); + result.placeholder = curry.placeholder; + return result; +} + +// Assign default placeholders. +curry.placeholder = {}; + +module.exports = curry; diff --git a/node_modules/lodash/curryRight.js b/node_modules/lodash/curryRight.js new file mode 100644 index 0000000..c85b6f3 --- /dev/null +++ b/node_modules/lodash/curryRight.js @@ -0,0 +1,54 @@ +var createWrap = require('./_createWrap'); + +/** Used to compose bitmasks for function metadata. */ +var WRAP_CURRY_RIGHT_FLAG = 16; + +/** + * This method is like `_.curry` except that arguments are applied to `func` + * in the manner of `_.partialRight` instead of `_.partial`. + * + * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic + * builds, may be used as a placeholder for provided arguments. + * + * **Note:** This method doesn't set the "length" property of curried functions. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {Function} func The function to curry. + * @param {number} [arity=func.length] The arity of `func`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Function} Returns the new curried function. + * @example + * + * var abc = function(a, b, c) { + * return [a, b, c]; + * }; + * + * var curried = _.curryRight(abc); + * + * curried(3)(2)(1); + * // => [1, 2, 3] + * + * curried(2, 3)(1); + * // => [1, 2, 3] + * + * curried(1, 2, 3); + * // => [1, 2, 3] + * + * // Curried with placeholders. + * curried(3)(1, _)(2); + * // => [1, 2, 3] + */ +function curryRight(func, arity, guard) { + arity = guard ? undefined : arity; + var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity); + result.placeholder = curryRight.placeholder; + return result; +} + +// Assign default placeholders. +curryRight.placeholder = {}; + +module.exports = curryRight; diff --git a/node_modules/lodash/date.js b/node_modules/lodash/date.js new file mode 100644 index 0000000..cbf5b41 --- /dev/null +++ b/node_modules/lodash/date.js @@ -0,0 +1,3 @@ +module.exports = { + 'now': require('./now') +}; diff --git a/node_modules/lodash/debounce.js b/node_modules/lodash/debounce.js new file mode 100644 index 0000000..8f751d5 --- /dev/null +++ b/node_modules/lodash/debounce.js @@ -0,0 +1,191 @@ +var isObject = require('./isObject'), + now = require('./now'), + toNumber = require('./toNumber'); + +/** Error message constants. */ +var FUNC_ERROR_TEXT = 'Expected a function'; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max, + nativeMin = Math.min; + +/** + * Creates a debounced function that delays invoking `func` until after `wait` + * milliseconds have elapsed since the last time the debounced function was + * invoked. The debounced function comes with a `cancel` method to cancel + * delayed `func` invocations and a `flush` method to immediately invoke them. + * Provide `options` to indicate whether `func` should be invoked on the + * leading and/or trailing edge of the `wait` timeout. The `func` is invoked + * with the last arguments provided to the debounced function. Subsequent + * calls to the debounced function return the result of the last `func` + * invocation. + * + * **Note:** If `leading` and `trailing` options are `true`, `func` is + * invoked on the trailing edge of the timeout only if the debounced function + * is invoked more than once during the `wait` timeout. + * + * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred + * until to the next tick, similar to `setTimeout` with a timeout of `0`. + * + * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) + * for details over the differences between `_.debounce` and `_.throttle`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to debounce. + * @param {number} [wait=0] The number of milliseconds to delay. + * @param {Object} [options={}] The options object. + * @param {boolean} [options.leading=false] + * Specify invoking on the leading edge of the timeout. + * @param {number} [options.maxWait] + * The maximum time `func` is allowed to be delayed before it's invoked. + * @param {boolean} [options.trailing=true] + * Specify invoking on the trailing edge of the timeout. + * @returns {Function} Returns the new debounced function. + * @example + * + * // Avoid costly calculations while the window size is in flux. + * jQuery(window).on('resize', _.debounce(calculateLayout, 150)); + * + * // Invoke `sendMail` when clicked, debouncing subsequent calls. + * jQuery(element).on('click', _.debounce(sendMail, 300, { + * 'leading': true, + * 'trailing': false + * })); + * + * // Ensure `batchLog` is invoked once after 1 second of debounced calls. + * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 }); + * var source = new EventSource('/stream'); + * jQuery(source).on('message', debounced); + * + * // Cancel the trailing debounced invocation. + * jQuery(window).on('popstate', debounced.cancel); + */ +function debounce(func, wait, options) { + var lastArgs, + lastThis, + maxWait, + result, + timerId, + lastCallTime, + lastInvokeTime = 0, + leading = false, + maxing = false, + trailing = true; + + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + wait = toNumber(wait) || 0; + if (isObject(options)) { + leading = !!options.leading; + maxing = 'maxWait' in options; + maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait; + trailing = 'trailing' in options ? !!options.trailing : trailing; + } + + function invokeFunc(time) { + var args = lastArgs, + thisArg = lastThis; + + lastArgs = lastThis = undefined; + lastInvokeTime = time; + result = func.apply(thisArg, args); + return result; + } + + function leadingEdge(time) { + // Reset any `maxWait` timer. + lastInvokeTime = time; + // Start the timer for the trailing edge. + timerId = setTimeout(timerExpired, wait); + // Invoke the leading edge. + return leading ? invokeFunc(time) : result; + } + + function remainingWait(time) { + var timeSinceLastCall = time - lastCallTime, + timeSinceLastInvoke = time - lastInvokeTime, + timeWaiting = wait - timeSinceLastCall; + + return maxing + ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) + : timeWaiting; + } + + function shouldInvoke(time) { + var timeSinceLastCall = time - lastCallTime, + timeSinceLastInvoke = time - lastInvokeTime; + + // Either this is the first call, activity has stopped and we're at the + // trailing edge, the system time has gone backwards and we're treating + // it as the trailing edge, or we've hit the `maxWait` limit. + return (lastCallTime === undefined || (timeSinceLastCall >= wait) || + (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait)); + } + + function timerExpired() { + var time = now(); + if (shouldInvoke(time)) { + return trailingEdge(time); + } + // Restart the timer. + timerId = setTimeout(timerExpired, remainingWait(time)); + } + + function trailingEdge(time) { + timerId = undefined; + + // Only invoke if we have `lastArgs` which means `func` has been + // debounced at least once. + if (trailing && lastArgs) { + return invokeFunc(time); + } + lastArgs = lastThis = undefined; + return result; + } + + function cancel() { + if (timerId !== undefined) { + clearTimeout(timerId); + } + lastInvokeTime = 0; + lastArgs = lastCallTime = lastThis = timerId = undefined; + } + + function flush() { + return timerId === undefined ? result : trailingEdge(now()); + } + + function debounced() { + var time = now(), + isInvoking = shouldInvoke(time); + + lastArgs = arguments; + lastThis = this; + lastCallTime = time; + + if (isInvoking) { + if (timerId === undefined) { + return leadingEdge(lastCallTime); + } + if (maxing) { + // Handle invocations in a tight loop. + clearTimeout(timerId); + timerId = setTimeout(timerExpired, wait); + return invokeFunc(lastCallTime); + } + } + if (timerId === undefined) { + timerId = setTimeout(timerExpired, wait); + } + return result; + } + debounced.cancel = cancel; + debounced.flush = flush; + return debounced; +} + +module.exports = debounce; diff --git a/node_modules/lodash/deburr.js b/node_modules/lodash/deburr.js new file mode 100644 index 0000000..f85e314 --- /dev/null +++ b/node_modules/lodash/deburr.js @@ -0,0 +1,45 @@ +var deburrLetter = require('./_deburrLetter'), + toString = require('./toString'); + +/** Used to match Latin Unicode letters (excluding mathematical operators). */ +var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g; + +/** Used to compose unicode character classes. */ +var rsComboMarksRange = '\\u0300-\\u036f', + reComboHalfMarksRange = '\\ufe20-\\ufe2f', + rsComboSymbolsRange = '\\u20d0-\\u20ff', + rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange; + +/** Used to compose unicode capture groups. */ +var rsCombo = '[' + rsComboRange + ']'; + +/** + * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and + * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols). + */ +var reComboMark = RegExp(rsCombo, 'g'); + +/** + * Deburrs `string` by converting + * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table) + * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A) + * letters to basic Latin letters and removing + * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to deburr. + * @returns {string} Returns the deburred string. + * @example + * + * _.deburr('déjà vu'); + * // => 'deja vu' + */ +function deburr(string) { + string = toString(string); + return string && string.replace(reLatin, deburrLetter).replace(reComboMark, ''); +} + +module.exports = deburr; diff --git a/node_modules/lodash/defaultTo.js b/node_modules/lodash/defaultTo.js new file mode 100644 index 0000000..5b33359 --- /dev/null +++ b/node_modules/lodash/defaultTo.js @@ -0,0 +1,25 @@ +/** + * Checks `value` to determine whether a default value should be returned in + * its place. The `defaultValue` is returned if `value` is `NaN`, `null`, + * or `undefined`. + * + * @static + * @memberOf _ + * @since 4.14.0 + * @category Util + * @param {*} value The value to check. + * @param {*} defaultValue The default value. + * @returns {*} Returns the resolved value. + * @example + * + * _.defaultTo(1, 10); + * // => 1 + * + * _.defaultTo(undefined, 10); + * // => 10 + */ +function defaultTo(value, defaultValue) { + return (value == null || value !== value) ? defaultValue : value; +} + +module.exports = defaultTo; diff --git a/node_modules/lodash/defaults.js b/node_modules/lodash/defaults.js new file mode 100644 index 0000000..c74df04 --- /dev/null +++ b/node_modules/lodash/defaults.js @@ -0,0 +1,64 @@ +var baseRest = require('./_baseRest'), + eq = require('./eq'), + isIterateeCall = require('./_isIterateeCall'), + keysIn = require('./keysIn'); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Assigns own and inherited enumerable string keyed properties of source + * objects to the destination object for all destination properties that + * resolve to `undefined`. Source objects are applied from left to right. + * Once a property is set, additional values of the same property are ignored. + * + * **Note:** This method mutates `object`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.defaultsDeep + * @example + * + * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); + * // => { 'a': 1, 'b': 2 } + */ +var defaults = baseRest(function(object, sources) { + object = Object(object); + + var index = -1; + var length = sources.length; + var guard = length > 2 ? sources[2] : undefined; + + if (guard && isIterateeCall(sources[0], sources[1], guard)) { + length = 1; + } + + while (++index < length) { + var source = sources[index]; + var props = keysIn(source); + var propsIndex = -1; + var propsLength = props.length; + + while (++propsIndex < propsLength) { + var key = props[propsIndex]; + var value = object[key]; + + if (value === undefined || + (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) { + object[key] = source[key]; + } + } + } + + return object; +}); + +module.exports = defaults; diff --git a/node_modules/lodash/defaultsDeep.js b/node_modules/lodash/defaultsDeep.js new file mode 100644 index 0000000..9b5fa3e --- /dev/null +++ b/node_modules/lodash/defaultsDeep.js @@ -0,0 +1,30 @@ +var apply = require('./_apply'), + baseRest = require('./_baseRest'), + customDefaultsMerge = require('./_customDefaultsMerge'), + mergeWith = require('./mergeWith'); + +/** + * This method is like `_.defaults` except that it recursively assigns + * default properties. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 3.10.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.defaults + * @example + * + * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } }); + * // => { 'a': { 'b': 2, 'c': 3 } } + */ +var defaultsDeep = baseRest(function(args) { + args.push(undefined, customDefaultsMerge); + return apply(mergeWith, undefined, args); +}); + +module.exports = defaultsDeep; diff --git a/node_modules/lodash/defer.js b/node_modules/lodash/defer.js new file mode 100644 index 0000000..f6d6c6f --- /dev/null +++ b/node_modules/lodash/defer.js @@ -0,0 +1,26 @@ +var baseDelay = require('./_baseDelay'), + baseRest = require('./_baseRest'); + +/** + * Defers invoking the `func` until the current call stack has cleared. Any + * additional arguments are provided to `func` when it's invoked. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to defer. + * @param {...*} [args] The arguments to invoke `func` with. + * @returns {number} Returns the timer id. + * @example + * + * _.defer(function(text) { + * console.log(text); + * }, 'deferred'); + * // => Logs 'deferred' after one millisecond. + */ +var defer = baseRest(function(func, args) { + return baseDelay(func, 1, args); +}); + +module.exports = defer; diff --git a/node_modules/lodash/delay.js b/node_modules/lodash/delay.js new file mode 100644 index 0000000..bd55479 --- /dev/null +++ b/node_modules/lodash/delay.js @@ -0,0 +1,28 @@ +var baseDelay = require('./_baseDelay'), + baseRest = require('./_baseRest'), + toNumber = require('./toNumber'); + +/** + * Invokes `func` after `wait` milliseconds. Any additional arguments are + * provided to `func` when it's invoked. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to delay. + * @param {number} wait The number of milliseconds to delay invocation. + * @param {...*} [args] The arguments to invoke `func` with. + * @returns {number} Returns the timer id. + * @example + * + * _.delay(function(text) { + * console.log(text); + * }, 1000, 'later'); + * // => Logs 'later' after one second. + */ +var delay = baseRest(function(func, wait, args) { + return baseDelay(func, toNumber(wait) || 0, args); +}); + +module.exports = delay; diff --git a/node_modules/lodash/difference.js b/node_modules/lodash/difference.js new file mode 100644 index 0000000..fa28bb3 --- /dev/null +++ b/node_modules/lodash/difference.js @@ -0,0 +1,33 @@ +var baseDifference = require('./_baseDifference'), + baseFlatten = require('./_baseFlatten'), + baseRest = require('./_baseRest'), + isArrayLikeObject = require('./isArrayLikeObject'); + +/** + * Creates an array of `array` values not included in the other given arrays + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. The order and references of result values are + * determined by the first array. + * + * **Note:** Unlike `_.pullAll`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {...Array} [values] The values to exclude. + * @returns {Array} Returns the new array of filtered values. + * @see _.without, _.xor + * @example + * + * _.difference([2, 1], [2, 3]); + * // => [1] + */ +var difference = baseRest(function(array, values) { + return isArrayLikeObject(array) + ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true)) + : []; +}); + +module.exports = difference; diff --git a/node_modules/lodash/differenceBy.js b/node_modules/lodash/differenceBy.js new file mode 100644 index 0000000..2cd63e7 --- /dev/null +++ b/node_modules/lodash/differenceBy.js @@ -0,0 +1,44 @@ +var baseDifference = require('./_baseDifference'), + baseFlatten = require('./_baseFlatten'), + baseIteratee = require('./_baseIteratee'), + baseRest = require('./_baseRest'), + isArrayLikeObject = require('./isArrayLikeObject'), + last = require('./last'); + +/** + * This method is like `_.difference` except that it accepts `iteratee` which + * is invoked for each element of `array` and `values` to generate the criterion + * by which they're compared. The order and references of result values are + * determined by the first array. The iteratee is invoked with one argument: + * (value). + * + * **Note:** Unlike `_.pullAllBy`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {...Array} [values] The values to exclude. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor); + * // => [1.2] + * + * // The `_.property` iteratee shorthand. + * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x'); + * // => [{ 'x': 2 }] + */ +var differenceBy = baseRest(function(array, values) { + var iteratee = last(values); + if (isArrayLikeObject(iteratee)) { + iteratee = undefined; + } + return isArrayLikeObject(array) + ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), baseIteratee(iteratee, 2)) + : []; +}); + +module.exports = differenceBy; diff --git a/node_modules/lodash/differenceWith.js b/node_modules/lodash/differenceWith.js new file mode 100644 index 0000000..c0233f4 --- /dev/null +++ b/node_modules/lodash/differenceWith.js @@ -0,0 +1,40 @@ +var baseDifference = require('./_baseDifference'), + baseFlatten = require('./_baseFlatten'), + baseRest = require('./_baseRest'), + isArrayLikeObject = require('./isArrayLikeObject'), + last = require('./last'); + +/** + * This method is like `_.difference` except that it accepts `comparator` + * which is invoked to compare elements of `array` to `values`. The order and + * references of result values are determined by the first array. The comparator + * is invoked with two arguments: (arrVal, othVal). + * + * **Note:** Unlike `_.pullAllWith`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {...Array} [values] The values to exclude. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * + * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual); + * // => [{ 'x': 2, 'y': 1 }] + */ +var differenceWith = baseRest(function(array, values) { + var comparator = last(values); + if (isArrayLikeObject(comparator)) { + comparator = undefined; + } + return isArrayLikeObject(array) + ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator) + : []; +}); + +module.exports = differenceWith; diff --git a/node_modules/lodash/divide.js b/node_modules/lodash/divide.js new file mode 100644 index 0000000..8cae0cd --- /dev/null +++ b/node_modules/lodash/divide.js @@ -0,0 +1,22 @@ +var createMathOperation = require('./_createMathOperation'); + +/** + * Divide two numbers. + * + * @static + * @memberOf _ + * @since 4.7.0 + * @category Math + * @param {number} dividend The first number in a division. + * @param {number} divisor The second number in a division. + * @returns {number} Returns the quotient. + * @example + * + * _.divide(6, 4); + * // => 1.5 + */ +var divide = createMathOperation(function(dividend, divisor) { + return dividend / divisor; +}, 1); + +module.exports = divide; diff --git a/node_modules/lodash/drop.js b/node_modules/lodash/drop.js new file mode 100644 index 0000000..d5c3cba --- /dev/null +++ b/node_modules/lodash/drop.js @@ -0,0 +1,38 @@ +var baseSlice = require('./_baseSlice'), + toInteger = require('./toInteger'); + +/** + * Creates a slice of `array` with `n` elements dropped from the beginning. + * + * @static + * @memberOf _ + * @since 0.5.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to drop. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.drop([1, 2, 3]); + * // => [2, 3] + * + * _.drop([1, 2, 3], 2); + * // => [3] + * + * _.drop([1, 2, 3], 5); + * // => [] + * + * _.drop([1, 2, 3], 0); + * // => [1, 2, 3] + */ +function drop(array, n, guard) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + n = (guard || n === undefined) ? 1 : toInteger(n); + return baseSlice(array, n < 0 ? 0 : n, length); +} + +module.exports = drop; diff --git a/node_modules/lodash/dropRight.js b/node_modules/lodash/dropRight.js new file mode 100644 index 0000000..441fe99 --- /dev/null +++ b/node_modules/lodash/dropRight.js @@ -0,0 +1,39 @@ +var baseSlice = require('./_baseSlice'), + toInteger = require('./toInteger'); + +/** + * Creates a slice of `array` with `n` elements dropped from the end. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to drop. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.dropRight([1, 2, 3]); + * // => [1, 2] + * + * _.dropRight([1, 2, 3], 2); + * // => [1] + * + * _.dropRight([1, 2, 3], 5); + * // => [] + * + * _.dropRight([1, 2, 3], 0); + * // => [1, 2, 3] + */ +function dropRight(array, n, guard) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + n = (guard || n === undefined) ? 1 : toInteger(n); + n = length - n; + return baseSlice(array, 0, n < 0 ? 0 : n); +} + +module.exports = dropRight; diff --git a/node_modules/lodash/dropRightWhile.js b/node_modules/lodash/dropRightWhile.js new file mode 100644 index 0000000..9ad36a0 --- /dev/null +++ b/node_modules/lodash/dropRightWhile.js @@ -0,0 +1,45 @@ +var baseIteratee = require('./_baseIteratee'), + baseWhile = require('./_baseWhile'); + +/** + * Creates a slice of `array` excluding elements dropped from the end. + * Elements are dropped until `predicate` returns falsey. The predicate is + * invoked with three arguments: (value, index, array). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the slice of `array`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': false } + * ]; + * + * _.dropRightWhile(users, function(o) { return !o.active; }); + * // => objects for ['barney'] + * + * // The `_.matches` iteratee shorthand. + * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false }); + * // => objects for ['barney', 'fred'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.dropRightWhile(users, ['active', false]); + * // => objects for ['barney'] + * + * // The `_.property` iteratee shorthand. + * _.dropRightWhile(users, 'active'); + * // => objects for ['barney', 'fred', 'pebbles'] + */ +function dropRightWhile(array, predicate) { + return (array && array.length) + ? baseWhile(array, baseIteratee(predicate, 3), true, true) + : []; +} + +module.exports = dropRightWhile; diff --git a/node_modules/lodash/dropWhile.js b/node_modules/lodash/dropWhile.js new file mode 100644 index 0000000..903ef56 --- /dev/null +++ b/node_modules/lodash/dropWhile.js @@ -0,0 +1,45 @@ +var baseIteratee = require('./_baseIteratee'), + baseWhile = require('./_baseWhile'); + +/** + * Creates a slice of `array` excluding elements dropped from the beginning. + * Elements are dropped until `predicate` returns falsey. The predicate is + * invoked with three arguments: (value, index, array). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the slice of `array`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': false }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': true } + * ]; + * + * _.dropWhile(users, function(o) { return !o.active; }); + * // => objects for ['pebbles'] + * + * // The `_.matches` iteratee shorthand. + * _.dropWhile(users, { 'user': 'barney', 'active': false }); + * // => objects for ['fred', 'pebbles'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.dropWhile(users, ['active', false]); + * // => objects for ['pebbles'] + * + * // The `_.property` iteratee shorthand. + * _.dropWhile(users, 'active'); + * // => objects for ['barney', 'fred', 'pebbles'] + */ +function dropWhile(array, predicate) { + return (array && array.length) + ? baseWhile(array, baseIteratee(predicate, 3), true) + : []; +} + +module.exports = dropWhile; diff --git a/node_modules/lodash/each.js b/node_modules/lodash/each.js new file mode 100644 index 0000000..8800f42 --- /dev/null +++ b/node_modules/lodash/each.js @@ -0,0 +1 @@ +module.exports = require('./forEach'); diff --git a/node_modules/lodash/eachRight.js b/node_modules/lodash/eachRight.js new file mode 100644 index 0000000..3252b2a --- /dev/null +++ b/node_modules/lodash/eachRight.js @@ -0,0 +1 @@ +module.exports = require('./forEachRight'); diff --git a/node_modules/lodash/endsWith.js b/node_modules/lodash/endsWith.js new file mode 100644 index 0000000..76fc866 --- /dev/null +++ b/node_modules/lodash/endsWith.js @@ -0,0 +1,43 @@ +var baseClamp = require('./_baseClamp'), + baseToString = require('./_baseToString'), + toInteger = require('./toInteger'), + toString = require('./toString'); + +/** + * Checks if `string` ends with the given target string. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to inspect. + * @param {string} [target] The string to search for. + * @param {number} [position=string.length] The position to search up to. + * @returns {boolean} Returns `true` if `string` ends with `target`, + * else `false`. + * @example + * + * _.endsWith('abc', 'c'); + * // => true + * + * _.endsWith('abc', 'b'); + * // => false + * + * _.endsWith('abc', 'b', 2); + * // => true + */ +function endsWith(string, target, position) { + string = toString(string); + target = baseToString(target); + + var length = string.length; + position = position === undefined + ? length + : baseClamp(toInteger(position), 0, length); + + var end = position; + position -= target.length; + return position >= 0 && string.slice(position, end) == target; +} + +module.exports = endsWith; diff --git a/node_modules/lodash/entries.js b/node_modules/lodash/entries.js new file mode 100644 index 0000000..7a88df2 --- /dev/null +++ b/node_modules/lodash/entries.js @@ -0,0 +1 @@ +module.exports = require('./toPairs'); diff --git a/node_modules/lodash/entriesIn.js b/node_modules/lodash/entriesIn.js new file mode 100644 index 0000000..f6c6331 --- /dev/null +++ b/node_modules/lodash/entriesIn.js @@ -0,0 +1 @@ +module.exports = require('./toPairsIn'); diff --git a/node_modules/lodash/eq.js b/node_modules/lodash/eq.js new file mode 100644 index 0000000..a940688 --- /dev/null +++ b/node_modules/lodash/eq.js @@ -0,0 +1,37 @@ +/** + * Performs a + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * comparison between two values to determine if they are equivalent. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.eq(object, object); + * // => true + * + * _.eq(object, other); + * // => false + * + * _.eq('a', 'a'); + * // => true + * + * _.eq('a', Object('a')); + * // => false + * + * _.eq(NaN, NaN); + * // => true + */ +function eq(value, other) { + return value === other || (value !== value && other !== other); +} + +module.exports = eq; diff --git a/node_modules/lodash/escape.js b/node_modules/lodash/escape.js new file mode 100644 index 0000000..9247e00 --- /dev/null +++ b/node_modules/lodash/escape.js @@ -0,0 +1,43 @@ +var escapeHtmlChar = require('./_escapeHtmlChar'), + toString = require('./toString'); + +/** Used to match HTML entities and HTML characters. */ +var reUnescapedHtml = /[&<>"']/g, + reHasUnescapedHtml = RegExp(reUnescapedHtml.source); + +/** + * Converts the characters "&", "<", ">", '"', and "'" in `string` to their + * corresponding HTML entities. + * + * **Note:** No other characters are escaped. To escape additional + * characters use a third-party library like [_he_](https://mths.be/he). + * + * Though the ">" character is escaped for symmetry, characters like + * ">" and "/" don't need escaping in HTML and have no special meaning + * unless they're part of a tag or unquoted attribute value. See + * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands) + * (under "semi-related fun fact") for more details. + * + * When working with HTML you should always + * [quote attribute values](http://wonko.com/post/html-escaping) to reduce + * XSS vectors. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category String + * @param {string} [string=''] The string to escape. + * @returns {string} Returns the escaped string. + * @example + * + * _.escape('fred, barney, & pebbles'); + * // => 'fred, barney, & pebbles' + */ +function escape(string) { + string = toString(string); + return (string && reHasUnescapedHtml.test(string)) + ? string.replace(reUnescapedHtml, escapeHtmlChar) + : string; +} + +module.exports = escape; diff --git a/node_modules/lodash/escapeRegExp.js b/node_modules/lodash/escapeRegExp.js new file mode 100644 index 0000000..0a58c69 --- /dev/null +++ b/node_modules/lodash/escapeRegExp.js @@ -0,0 +1,32 @@ +var toString = require('./toString'); + +/** + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). + */ +var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, + reHasRegExpChar = RegExp(reRegExpChar.source); + +/** + * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+", + * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to escape. + * @returns {string} Returns the escaped string. + * @example + * + * _.escapeRegExp('[lodash](https://lodash.com/)'); + * // => '\[lodash\]\(https://lodash\.com/\)' + */ +function escapeRegExp(string) { + string = toString(string); + return (string && reHasRegExpChar.test(string)) + ? string.replace(reRegExpChar, '\\$&') + : string; +} + +module.exports = escapeRegExp; diff --git a/node_modules/lodash/every.js b/node_modules/lodash/every.js new file mode 100644 index 0000000..25080da --- /dev/null +++ b/node_modules/lodash/every.js @@ -0,0 +1,56 @@ +var arrayEvery = require('./_arrayEvery'), + baseEvery = require('./_baseEvery'), + baseIteratee = require('./_baseIteratee'), + isArray = require('./isArray'), + isIterateeCall = require('./_isIterateeCall'); + +/** + * Checks if `predicate` returns truthy for **all** elements of `collection`. + * Iteration is stopped once `predicate` returns falsey. The predicate is + * invoked with three arguments: (value, index|key, collection). + * + * **Note:** This method returns `true` for + * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because + * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of + * elements of empty collections. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false`. + * @example + * + * _.every([true, 1, null, 'yes'], Boolean); + * // => false + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': false }, + * { 'user': 'fred', 'age': 40, 'active': false } + * ]; + * + * // The `_.matches` iteratee shorthand. + * _.every(users, { 'user': 'barney', 'active': false }); + * // => false + * + * // The `_.matchesProperty` iteratee shorthand. + * _.every(users, ['active', false]); + * // => true + * + * // The `_.property` iteratee shorthand. + * _.every(users, 'active'); + * // => false + */ +function every(collection, predicate, guard) { + var func = isArray(collection) ? arrayEvery : baseEvery; + if (guard && isIterateeCall(collection, predicate, guard)) { + predicate = undefined; + } + return func(collection, baseIteratee(predicate, 3)); +} + +module.exports = every; diff --git a/node_modules/lodash/extend.js b/node_modules/lodash/extend.js new file mode 100644 index 0000000..e00166c --- /dev/null +++ b/node_modules/lodash/extend.js @@ -0,0 +1 @@ +module.exports = require('./assignIn'); diff --git a/node_modules/lodash/extendWith.js b/node_modules/lodash/extendWith.js new file mode 100644 index 0000000..dbdcb3b --- /dev/null +++ b/node_modules/lodash/extendWith.js @@ -0,0 +1 @@ +module.exports = require('./assignInWith'); diff --git a/node_modules/lodash/fill.js b/node_modules/lodash/fill.js new file mode 100644 index 0000000..ae13aa1 --- /dev/null +++ b/node_modules/lodash/fill.js @@ -0,0 +1,45 @@ +var baseFill = require('./_baseFill'), + isIterateeCall = require('./_isIterateeCall'); + +/** + * Fills elements of `array` with `value` from `start` up to, but not + * including, `end`. + * + * **Note:** This method mutates `array`. + * + * @static + * @memberOf _ + * @since 3.2.0 + * @category Array + * @param {Array} array The array to fill. + * @param {*} value The value to fill `array` with. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns `array`. + * @example + * + * var array = [1, 2, 3]; + * + * _.fill(array, 'a'); + * console.log(array); + * // => ['a', 'a', 'a'] + * + * _.fill(Array(3), 2); + * // => [2, 2, 2] + * + * _.fill([4, 6, 8, 10], '*', 1, 3); + * // => [4, '*', '*', 10] + */ +function fill(array, value, start, end) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + if (start && typeof start != 'number' && isIterateeCall(array, value, start)) { + start = 0; + end = length; + } + return baseFill(array, value, start, end); +} + +module.exports = fill; diff --git a/node_modules/lodash/filter.js b/node_modules/lodash/filter.js new file mode 100644 index 0000000..89e0c8c --- /dev/null +++ b/node_modules/lodash/filter.js @@ -0,0 +1,52 @@ +var arrayFilter = require('./_arrayFilter'), + baseFilter = require('./_baseFilter'), + baseIteratee = require('./_baseIteratee'), + isArray = require('./isArray'); + +/** + * Iterates over elements of `collection`, returning an array of all elements + * `predicate` returns truthy for. The predicate is invoked with three + * arguments: (value, index|key, collection). + * + * **Note:** Unlike `_.remove`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + * @see _.reject + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false } + * ]; + * + * _.filter(users, function(o) { return !o.active; }); + * // => objects for ['fred'] + * + * // The `_.matches` iteratee shorthand. + * _.filter(users, { 'age': 36, 'active': true }); + * // => objects for ['barney'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.filter(users, ['active', false]); + * // => objects for ['fred'] + * + * // The `_.property` iteratee shorthand. + * _.filter(users, 'active'); + * // => objects for ['barney'] + * + * // Combining several predicates using `_.overEvery` or `_.overSome`. + * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]])); + * // => objects for ['fred', 'barney'] + */ +function filter(collection, predicate) { + var func = isArray(collection) ? arrayFilter : baseFilter; + return func(collection, baseIteratee(predicate, 3)); +} + +module.exports = filter; diff --git a/node_modules/lodash/find.js b/node_modules/lodash/find.js new file mode 100644 index 0000000..de732cc --- /dev/null +++ b/node_modules/lodash/find.js @@ -0,0 +1,42 @@ +var createFind = require('./_createFind'), + findIndex = require('./findIndex'); + +/** + * Iterates over elements of `collection`, returning the first element + * `predicate` returns truthy for. The predicate is invoked with three + * arguments: (value, index|key, collection). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=0] The index to search from. + * @returns {*} Returns the matched element, else `undefined`. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false }, + * { 'user': 'pebbles', 'age': 1, 'active': true } + * ]; + * + * _.find(users, function(o) { return o.age < 40; }); + * // => object for 'barney' + * + * // The `_.matches` iteratee shorthand. + * _.find(users, { 'age': 1, 'active': true }); + * // => object for 'pebbles' + * + * // The `_.matchesProperty` iteratee shorthand. + * _.find(users, ['active', false]); + * // => object for 'fred' + * + * // The `_.property` iteratee shorthand. + * _.find(users, 'active'); + * // => object for 'barney' + */ +var find = createFind(findIndex); + +module.exports = find; diff --git a/node_modules/lodash/findIndex.js b/node_modules/lodash/findIndex.js new file mode 100644 index 0000000..4689069 --- /dev/null +++ b/node_modules/lodash/findIndex.js @@ -0,0 +1,55 @@ +var baseFindIndex = require('./_baseFindIndex'), + baseIteratee = require('./_baseIteratee'), + toInteger = require('./toInteger'); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max; + +/** + * This method is like `_.find` except that it returns the index of the first + * element `predicate` returns truthy for instead of the element itself. + * + * @static + * @memberOf _ + * @since 1.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=0] The index to search from. + * @returns {number} Returns the index of the found element, else `-1`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': false }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': true } + * ]; + * + * _.findIndex(users, function(o) { return o.user == 'barney'; }); + * // => 0 + * + * // The `_.matches` iteratee shorthand. + * _.findIndex(users, { 'user': 'fred', 'active': false }); + * // => 1 + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findIndex(users, ['active', false]); + * // => 0 + * + * // The `_.property` iteratee shorthand. + * _.findIndex(users, 'active'); + * // => 2 + */ +function findIndex(array, predicate, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index = fromIndex == null ? 0 : toInteger(fromIndex); + if (index < 0) { + index = nativeMax(length + index, 0); + } + return baseFindIndex(array, baseIteratee(predicate, 3), index); +} + +module.exports = findIndex; diff --git a/node_modules/lodash/findKey.js b/node_modules/lodash/findKey.js new file mode 100644 index 0000000..cac0248 --- /dev/null +++ b/node_modules/lodash/findKey.js @@ -0,0 +1,44 @@ +var baseFindKey = require('./_baseFindKey'), + baseForOwn = require('./_baseForOwn'), + baseIteratee = require('./_baseIteratee'); + +/** + * This method is like `_.find` except that it returns the key of the first + * element `predicate` returns truthy for instead of the element itself. + * + * @static + * @memberOf _ + * @since 1.1.0 + * @category Object + * @param {Object} object The object to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {string|undefined} Returns the key of the matched element, + * else `undefined`. + * @example + * + * var users = { + * 'barney': { 'age': 36, 'active': true }, + * 'fred': { 'age': 40, 'active': false }, + * 'pebbles': { 'age': 1, 'active': true } + * }; + * + * _.findKey(users, function(o) { return o.age < 40; }); + * // => 'barney' (iteration order is not guaranteed) + * + * // The `_.matches` iteratee shorthand. + * _.findKey(users, { 'age': 1, 'active': true }); + * // => 'pebbles' + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findKey(users, ['active', false]); + * // => 'fred' + * + * // The `_.property` iteratee shorthand. + * _.findKey(users, 'active'); + * // => 'barney' + */ +function findKey(object, predicate) { + return baseFindKey(object, baseIteratee(predicate, 3), baseForOwn); +} + +module.exports = findKey; diff --git a/node_modules/lodash/findLast.js b/node_modules/lodash/findLast.js new file mode 100644 index 0000000..70b4271 --- /dev/null +++ b/node_modules/lodash/findLast.js @@ -0,0 +1,25 @@ +var createFind = require('./_createFind'), + findLastIndex = require('./findLastIndex'); + +/** + * This method is like `_.find` except that it iterates over elements of + * `collection` from right to left. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Collection + * @param {Array|Object} collection The collection to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=collection.length-1] The index to search from. + * @returns {*} Returns the matched element, else `undefined`. + * @example + * + * _.findLast([1, 2, 3, 4], function(n) { + * return n % 2 == 1; + * }); + * // => 3 + */ +var findLast = createFind(findLastIndex); + +module.exports = findLast; diff --git a/node_modules/lodash/findLastIndex.js b/node_modules/lodash/findLastIndex.js new file mode 100644 index 0000000..7da3431 --- /dev/null +++ b/node_modules/lodash/findLastIndex.js @@ -0,0 +1,59 @@ +var baseFindIndex = require('./_baseFindIndex'), + baseIteratee = require('./_baseIteratee'), + toInteger = require('./toInteger'); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max, + nativeMin = Math.min; + +/** + * This method is like `_.findIndex` except that it iterates over elements + * of `collection` from right to left. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=array.length-1] The index to search from. + * @returns {number} Returns the index of the found element, else `-1`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': false } + * ]; + * + * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; }); + * // => 2 + * + * // The `_.matches` iteratee shorthand. + * _.findLastIndex(users, { 'user': 'barney', 'active': true }); + * // => 0 + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findLastIndex(users, ['active', false]); + * // => 2 + * + * // The `_.property` iteratee shorthand. + * _.findLastIndex(users, 'active'); + * // => 0 + */ +function findLastIndex(array, predicate, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index = length - 1; + if (fromIndex !== undefined) { + index = toInteger(fromIndex); + index = fromIndex < 0 + ? nativeMax(length + index, 0) + : nativeMin(index, length - 1); + } + return baseFindIndex(array, baseIteratee(predicate, 3), index, true); +} + +module.exports = findLastIndex; diff --git a/node_modules/lodash/findLastKey.js b/node_modules/lodash/findLastKey.js new file mode 100644 index 0000000..66fb9fb --- /dev/null +++ b/node_modules/lodash/findLastKey.js @@ -0,0 +1,44 @@ +var baseFindKey = require('./_baseFindKey'), + baseForOwnRight = require('./_baseForOwnRight'), + baseIteratee = require('./_baseIteratee'); + +/** + * This method is like `_.findKey` except that it iterates over elements of + * a collection in the opposite order. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Object + * @param {Object} object The object to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {string|undefined} Returns the key of the matched element, + * else `undefined`. + * @example + * + * var users = { + * 'barney': { 'age': 36, 'active': true }, + * 'fred': { 'age': 40, 'active': false }, + * 'pebbles': { 'age': 1, 'active': true } + * }; + * + * _.findLastKey(users, function(o) { return o.age < 40; }); + * // => returns 'pebbles' assuming `_.findKey` returns 'barney' + * + * // The `_.matches` iteratee shorthand. + * _.findLastKey(users, { 'age': 36, 'active': true }); + * // => 'barney' + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findLastKey(users, ['active', false]); + * // => 'fred' + * + * // The `_.property` iteratee shorthand. + * _.findLastKey(users, 'active'); + * // => 'pebbles' + */ +function findLastKey(object, predicate) { + return baseFindKey(object, baseIteratee(predicate, 3), baseForOwnRight); +} + +module.exports = findLastKey; diff --git a/node_modules/lodash/first.js b/node_modules/lodash/first.js new file mode 100644 index 0000000..53f4ad1 --- /dev/null +++ b/node_modules/lodash/first.js @@ -0,0 +1 @@ +module.exports = require('./head'); diff --git a/node_modules/lodash/flake.lock b/node_modules/lodash/flake.lock new file mode 100644 index 0000000..dd03252 --- /dev/null +++ b/node_modules/lodash/flake.lock @@ -0,0 +1,40 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1613582597, + "narHash": "sha256-6LvipIvFuhyorHpUqK3HjySC5Y6gshXHFBhU9EJ4DoM=", + "path": "/nix/store/srvplqq673sqd9vyfhyc5w1p88y1gfm4-source", + "rev": "6b1057b452c55bb3b463f0d7055bc4ec3fd1f381", + "type": "path" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs", + "utils": "utils" + } + }, + "utils": { + "locked": { + "lastModified": 1610051610, + "narHash": "sha256-U9rPz/usA1/Aohhk7Cmc2gBrEEKRzcW4nwPWMPwja4Y=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "3982c9903e93927c2164caa727cd3f6a0e6d14cc", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/node_modules/lodash/flake.nix b/node_modules/lodash/flake.nix new file mode 100644 index 0000000..15a451c --- /dev/null +++ b/node_modules/lodash/flake.nix @@ -0,0 +1,20 @@ +{ + inputs = { + utils.url = "github:numtide/flake-utils"; + }; + + outputs = { self, nixpkgs, utils }: + utils.lib.eachDefaultSystem (system: + let + pkgs = nixpkgs.legacyPackages."${system}"; + in rec { + devShell = pkgs.mkShell { + nativeBuildInputs = with pkgs; [ + yarn + nodejs-14_x + nodePackages.typescript-language-server + nodePackages.eslint + ]; + }; + }); +} diff --git a/node_modules/lodash/flatMap.js b/node_modules/lodash/flatMap.js new file mode 100644 index 0000000..e668506 --- /dev/null +++ b/node_modules/lodash/flatMap.js @@ -0,0 +1,29 @@ +var baseFlatten = require('./_baseFlatten'), + map = require('./map'); + +/** + * Creates a flattened array of values by running each element in `collection` + * thru `iteratee` and flattening the mapped results. The iteratee is invoked + * with three arguments: (value, index|key, collection). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new flattened array. + * @example + * + * function duplicate(n) { + * return [n, n]; + * } + * + * _.flatMap([1, 2], duplicate); + * // => [1, 1, 2, 2] + */ +function flatMap(collection, iteratee) { + return baseFlatten(map(collection, iteratee), 1); +} + +module.exports = flatMap; diff --git a/node_modules/lodash/flatMapDeep.js b/node_modules/lodash/flatMapDeep.js new file mode 100644 index 0000000..4653d60 --- /dev/null +++ b/node_modules/lodash/flatMapDeep.js @@ -0,0 +1,31 @@ +var baseFlatten = require('./_baseFlatten'), + map = require('./map'); + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0; + +/** + * This method is like `_.flatMap` except that it recursively flattens the + * mapped results. + * + * @static + * @memberOf _ + * @since 4.7.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new flattened array. + * @example + * + * function duplicate(n) { + * return [[[n, n]]]; + * } + * + * _.flatMapDeep([1, 2], duplicate); + * // => [1, 1, 2, 2] + */ +function flatMapDeep(collection, iteratee) { + return baseFlatten(map(collection, iteratee), INFINITY); +} + +module.exports = flatMapDeep; diff --git a/node_modules/lodash/flatMapDepth.js b/node_modules/lodash/flatMapDepth.js new file mode 100644 index 0000000..6d72005 --- /dev/null +++ b/node_modules/lodash/flatMapDepth.js @@ -0,0 +1,31 @@ +var baseFlatten = require('./_baseFlatten'), + map = require('./map'), + toInteger = require('./toInteger'); + +/** + * This method is like `_.flatMap` except that it recursively flattens the + * mapped results up to `depth` times. + * + * @static + * @memberOf _ + * @since 4.7.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {number} [depth=1] The maximum recursion depth. + * @returns {Array} Returns the new flattened array. + * @example + * + * function duplicate(n) { + * return [[[n, n]]]; + * } + * + * _.flatMapDepth([1, 2], duplicate, 2); + * // => [[1, 1], [2, 2]] + */ +function flatMapDepth(collection, iteratee, depth) { + depth = depth === undefined ? 1 : toInteger(depth); + return baseFlatten(map(collection, iteratee), depth); +} + +module.exports = flatMapDepth; diff --git a/node_modules/lodash/flatten.js b/node_modules/lodash/flatten.js new file mode 100644 index 0000000..3f09f7f --- /dev/null +++ b/node_modules/lodash/flatten.js @@ -0,0 +1,22 @@ +var baseFlatten = require('./_baseFlatten'); + +/** + * Flattens `array` a single level deep. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to flatten. + * @returns {Array} Returns the new flattened array. + * @example + * + * _.flatten([1, [2, [3, [4]], 5]]); + * // => [1, 2, [3, [4]], 5] + */ +function flatten(array) { + var length = array == null ? 0 : array.length; + return length ? baseFlatten(array, 1) : []; +} + +module.exports = flatten; diff --git a/node_modules/lodash/flattenDeep.js b/node_modules/lodash/flattenDeep.js new file mode 100644 index 0000000..8ad585c --- /dev/null +++ b/node_modules/lodash/flattenDeep.js @@ -0,0 +1,25 @@ +var baseFlatten = require('./_baseFlatten'); + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0; + +/** + * Recursively flattens `array`. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to flatten. + * @returns {Array} Returns the new flattened array. + * @example + * + * _.flattenDeep([1, [2, [3, [4]], 5]]); + * // => [1, 2, 3, 4, 5] + */ +function flattenDeep(array) { + var length = array == null ? 0 : array.length; + return length ? baseFlatten(array, INFINITY) : []; +} + +module.exports = flattenDeep; diff --git a/node_modules/lodash/flattenDepth.js b/node_modules/lodash/flattenDepth.js new file mode 100644 index 0000000..441fdcc --- /dev/null +++ b/node_modules/lodash/flattenDepth.js @@ -0,0 +1,33 @@ +var baseFlatten = require('./_baseFlatten'), + toInteger = require('./toInteger'); + +/** + * Recursively flatten `array` up to `depth` times. + * + * @static + * @memberOf _ + * @since 4.4.0 + * @category Array + * @param {Array} array The array to flatten. + * @param {number} [depth=1] The maximum recursion depth. + * @returns {Array} Returns the new flattened array. + * @example + * + * var array = [1, [2, [3, [4]], 5]]; + * + * _.flattenDepth(array, 1); + * // => [1, 2, [3, [4]], 5] + * + * _.flattenDepth(array, 2); + * // => [1, 2, 3, [4], 5] + */ +function flattenDepth(array, depth) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + depth = depth === undefined ? 1 : toInteger(depth); + return baseFlatten(array, depth); +} + +module.exports = flattenDepth; diff --git a/node_modules/lodash/flip.js b/node_modules/lodash/flip.js new file mode 100644 index 0000000..c28dd78 --- /dev/null +++ b/node_modules/lodash/flip.js @@ -0,0 +1,28 @@ +var createWrap = require('./_createWrap'); + +/** Used to compose bitmasks for function metadata. */ +var WRAP_FLIP_FLAG = 512; + +/** + * Creates a function that invokes `func` with arguments reversed. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Function + * @param {Function} func The function to flip arguments for. + * @returns {Function} Returns the new flipped function. + * @example + * + * var flipped = _.flip(function() { + * return _.toArray(arguments); + * }); + * + * flipped('a', 'b', 'c', 'd'); + * // => ['d', 'c', 'b', 'a'] + */ +function flip(func) { + return createWrap(func, WRAP_FLIP_FLAG); +} + +module.exports = flip; diff --git a/node_modules/lodash/floor.js b/node_modules/lodash/floor.js new file mode 100644 index 0000000..ab6dfa2 --- /dev/null +++ b/node_modules/lodash/floor.js @@ -0,0 +1,26 @@ +var createRound = require('./_createRound'); + +/** + * Computes `number` rounded down to `precision`. + * + * @static + * @memberOf _ + * @since 3.10.0 + * @category Math + * @param {number} number The number to round down. + * @param {number} [precision=0] The precision to round down to. + * @returns {number} Returns the rounded down number. + * @example + * + * _.floor(4.006); + * // => 4 + * + * _.floor(0.046, 2); + * // => 0.04 + * + * _.floor(4060, -2); + * // => 4000 + */ +var floor = createRound('floor'); + +module.exports = floor; diff --git a/node_modules/lodash/flow.js b/node_modules/lodash/flow.js new file mode 100644 index 0000000..74b6b62 --- /dev/null +++ b/node_modules/lodash/flow.js @@ -0,0 +1,27 @@ +var createFlow = require('./_createFlow'); + +/** + * Creates a function that returns the result of invoking the given functions + * with the `this` binding of the created function, where each successive + * invocation is supplied the return value of the previous. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Util + * @param {...(Function|Function[])} [funcs] The functions to invoke. + * @returns {Function} Returns the new composite function. + * @see _.flowRight + * @example + * + * function square(n) { + * return n * n; + * } + * + * var addSquare = _.flow([_.add, square]); + * addSquare(1, 2); + * // => 9 + */ +var flow = createFlow(); + +module.exports = flow; diff --git a/node_modules/lodash/flowRight.js b/node_modules/lodash/flowRight.js new file mode 100644 index 0000000..1146141 --- /dev/null +++ b/node_modules/lodash/flowRight.js @@ -0,0 +1,26 @@ +var createFlow = require('./_createFlow'); + +/** + * This method is like `_.flow` except that it creates a function that + * invokes the given functions from right to left. + * + * @static + * @since 3.0.0 + * @memberOf _ + * @category Util + * @param {...(Function|Function[])} [funcs] The functions to invoke. + * @returns {Function} Returns the new composite function. + * @see _.flow + * @example + * + * function square(n) { + * return n * n; + * } + * + * var addSquare = _.flowRight([square, _.add]); + * addSquare(1, 2); + * // => 9 + */ +var flowRight = createFlow(true); + +module.exports = flowRight; diff --git a/node_modules/lodash/forEach.js b/node_modules/lodash/forEach.js new file mode 100644 index 0000000..c64eaa7 --- /dev/null +++ b/node_modules/lodash/forEach.js @@ -0,0 +1,41 @@ +var arrayEach = require('./_arrayEach'), + baseEach = require('./_baseEach'), + castFunction = require('./_castFunction'), + isArray = require('./isArray'); + +/** + * Iterates over elements of `collection` and invokes `iteratee` for each element. + * The iteratee is invoked with three arguments: (value, index|key, collection). + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * **Note:** As with other "Collections" methods, objects with a "length" + * property are iterated like arrays. To avoid this behavior use `_.forIn` + * or `_.forOwn` for object iteration. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @alias each + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + * @see _.forEachRight + * @example + * + * _.forEach([1, 2], function(value) { + * console.log(value); + * }); + * // => Logs `1` then `2`. + * + * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) { + * console.log(key); + * }); + * // => Logs 'a' then 'b' (iteration order is not guaranteed). + */ +function forEach(collection, iteratee) { + var func = isArray(collection) ? arrayEach : baseEach; + return func(collection, castFunction(iteratee)); +} + +module.exports = forEach; diff --git a/node_modules/lodash/forEachRight.js b/node_modules/lodash/forEachRight.js new file mode 100644 index 0000000..7390eba --- /dev/null +++ b/node_modules/lodash/forEachRight.js @@ -0,0 +1,31 @@ +var arrayEachRight = require('./_arrayEachRight'), + baseEachRight = require('./_baseEachRight'), + castFunction = require('./_castFunction'), + isArray = require('./isArray'); + +/** + * This method is like `_.forEach` except that it iterates over elements of + * `collection` from right to left. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @alias eachRight + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + * @see _.forEach + * @example + * + * _.forEachRight([1, 2], function(value) { + * console.log(value); + * }); + * // => Logs `2` then `1`. + */ +function forEachRight(collection, iteratee) { + var func = isArray(collection) ? arrayEachRight : baseEachRight; + return func(collection, castFunction(iteratee)); +} + +module.exports = forEachRight; diff --git a/node_modules/lodash/forIn.js b/node_modules/lodash/forIn.js new file mode 100644 index 0000000..583a596 --- /dev/null +++ b/node_modules/lodash/forIn.js @@ -0,0 +1,39 @@ +var baseFor = require('./_baseFor'), + castFunction = require('./_castFunction'), + keysIn = require('./keysIn'); + +/** + * Iterates over own and inherited enumerable string keyed properties of an + * object and invokes `iteratee` for each property. The iteratee is invoked + * with three arguments: (value, key, object). Iteratee functions may exit + * iteration early by explicitly returning `false`. + * + * @static + * @memberOf _ + * @since 0.3.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns `object`. + * @see _.forInRight + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forIn(new Foo, function(value, key) { + * console.log(key); + * }); + * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed). + */ +function forIn(object, iteratee) { + return object == null + ? object + : baseFor(object, castFunction(iteratee), keysIn); +} + +module.exports = forIn; diff --git a/node_modules/lodash/forInRight.js b/node_modules/lodash/forInRight.js new file mode 100644 index 0000000..4aedf58 --- /dev/null +++ b/node_modules/lodash/forInRight.js @@ -0,0 +1,37 @@ +var baseForRight = require('./_baseForRight'), + castFunction = require('./_castFunction'), + keysIn = require('./keysIn'); + +/** + * This method is like `_.forIn` except that it iterates over properties of + * `object` in the opposite order. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns `object`. + * @see _.forIn + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forInRight(new Foo, function(value, key) { + * console.log(key); + * }); + * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'. + */ +function forInRight(object, iteratee) { + return object == null + ? object + : baseForRight(object, castFunction(iteratee), keysIn); +} + +module.exports = forInRight; diff --git a/node_modules/lodash/forOwn.js b/node_modules/lodash/forOwn.js new file mode 100644 index 0000000..94eed84 --- /dev/null +++ b/node_modules/lodash/forOwn.js @@ -0,0 +1,36 @@ +var baseForOwn = require('./_baseForOwn'), + castFunction = require('./_castFunction'); + +/** + * Iterates over own enumerable string keyed properties of an object and + * invokes `iteratee` for each property. The iteratee is invoked with three + * arguments: (value, key, object). Iteratee functions may exit iteration + * early by explicitly returning `false`. + * + * @static + * @memberOf _ + * @since 0.3.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns `object`. + * @see _.forOwnRight + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forOwn(new Foo, function(value, key) { + * console.log(key); + * }); + * // => Logs 'a' then 'b' (iteration order is not guaranteed). + */ +function forOwn(object, iteratee) { + return object && baseForOwn(object, castFunction(iteratee)); +} + +module.exports = forOwn; diff --git a/node_modules/lodash/forOwnRight.js b/node_modules/lodash/forOwnRight.js new file mode 100644 index 0000000..86f338f --- /dev/null +++ b/node_modules/lodash/forOwnRight.js @@ -0,0 +1,34 @@ +var baseForOwnRight = require('./_baseForOwnRight'), + castFunction = require('./_castFunction'); + +/** + * This method is like `_.forOwn` except that it iterates over properties of + * `object` in the opposite order. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns `object`. + * @see _.forOwn + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forOwnRight(new Foo, function(value, key) { + * console.log(key); + * }); + * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'. + */ +function forOwnRight(object, iteratee) { + return object && baseForOwnRight(object, castFunction(iteratee)); +} + +module.exports = forOwnRight; diff --git a/node_modules/lodash/fp.js b/node_modules/lodash/fp.js new file mode 100644 index 0000000..e372dbb --- /dev/null +++ b/node_modules/lodash/fp.js @@ -0,0 +1,2 @@ +var _ = require('./lodash.min').runInContext(); +module.exports = require('./fp/_baseConvert')(_, _); diff --git a/node_modules/lodash/fp/F.js b/node_modules/lodash/fp/F.js new file mode 100644 index 0000000..a05a63a --- /dev/null +++ b/node_modules/lodash/fp/F.js @@ -0,0 +1 @@ +module.exports = require('./stubFalse'); diff --git a/node_modules/lodash/fp/T.js b/node_modules/lodash/fp/T.js new file mode 100644 index 0000000..e2ba8ea --- /dev/null +++ b/node_modules/lodash/fp/T.js @@ -0,0 +1 @@ +module.exports = require('./stubTrue'); diff --git a/node_modules/lodash/fp/__.js b/node_modules/lodash/fp/__.js new file mode 100644 index 0000000..4af98de --- /dev/null +++ b/node_modules/lodash/fp/__.js @@ -0,0 +1 @@ +module.exports = require('./placeholder'); diff --git a/node_modules/lodash/fp/_baseConvert.js b/node_modules/lodash/fp/_baseConvert.js new file mode 100644 index 0000000..9baf8e1 --- /dev/null +++ b/node_modules/lodash/fp/_baseConvert.js @@ -0,0 +1,569 @@ +var mapping = require('./_mapping'), + fallbackHolder = require('./placeholder'); + +/** Built-in value reference. */ +var push = Array.prototype.push; + +/** + * Creates a function, with an arity of `n`, that invokes `func` with the + * arguments it receives. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} n The arity of the new function. + * @returns {Function} Returns the new function. + */ +function baseArity(func, n) { + return n == 2 + ? function(a, b) { return func.apply(undefined, arguments); } + : function(a) { return func.apply(undefined, arguments); }; +} + +/** + * Creates a function that invokes `func`, with up to `n` arguments, ignoring + * any additional arguments. + * + * @private + * @param {Function} func The function to cap arguments for. + * @param {number} n The arity cap. + * @returns {Function} Returns the new function. + */ +function baseAry(func, n) { + return n == 2 + ? function(a, b) { return func(a, b); } + : function(a) { return func(a); }; +} + +/** + * Creates a clone of `array`. + * + * @private + * @param {Array} array The array to clone. + * @returns {Array} Returns the cloned array. + */ +function cloneArray(array) { + var length = array ? array.length : 0, + result = Array(length); + + while (length--) { + result[length] = array[length]; + } + return result; +} + +/** + * Creates a function that clones a given object using the assignment `func`. + * + * @private + * @param {Function} func The assignment function. + * @returns {Function} Returns the new cloner function. + */ +function createCloner(func) { + return function(object) { + return func({}, object); + }; +} + +/** + * A specialized version of `_.spread` which flattens the spread array into + * the arguments of the invoked `func`. + * + * @private + * @param {Function} func The function to spread arguments over. + * @param {number} start The start position of the spread. + * @returns {Function} Returns the new function. + */ +function flatSpread(func, start) { + return function() { + var length = arguments.length, + lastIndex = length - 1, + args = Array(length); + + while (length--) { + args[length] = arguments[length]; + } + var array = args[start], + otherArgs = args.slice(0, start); + + if (array) { + push.apply(otherArgs, array); + } + if (start != lastIndex) { + push.apply(otherArgs, args.slice(start + 1)); + } + return func.apply(this, otherArgs); + }; +} + +/** + * Creates a function that wraps `func` and uses `cloner` to clone the first + * argument it receives. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} cloner The function to clone arguments. + * @returns {Function} Returns the new immutable function. + */ +function wrapImmutable(func, cloner) { + return function() { + var length = arguments.length; + if (!length) { + return; + } + var args = Array(length); + while (length--) { + args[length] = arguments[length]; + } + var result = args[0] = cloner.apply(undefined, args); + func.apply(undefined, args); + return result; + }; +} + +/** + * The base implementation of `convert` which accepts a `util` object of methods + * required to perform conversions. + * + * @param {Object} util The util object. + * @param {string} name The name of the function to convert. + * @param {Function} func The function to convert. + * @param {Object} [options] The options object. + * @param {boolean} [options.cap=true] Specify capping iteratee arguments. + * @param {boolean} [options.curry=true] Specify currying. + * @param {boolean} [options.fixed=true] Specify fixed arity. + * @param {boolean} [options.immutable=true] Specify immutable operations. + * @param {boolean} [options.rearg=true] Specify rearranging arguments. + * @returns {Function|Object} Returns the converted function or object. + */ +function baseConvert(util, name, func, options) { + var isLib = typeof name == 'function', + isObj = name === Object(name); + + if (isObj) { + options = func; + func = name; + name = undefined; + } + if (func == null) { + throw new TypeError; + } + options || (options = {}); + + var config = { + 'cap': 'cap' in options ? options.cap : true, + 'curry': 'curry' in options ? options.curry : true, + 'fixed': 'fixed' in options ? options.fixed : true, + 'immutable': 'immutable' in options ? options.immutable : true, + 'rearg': 'rearg' in options ? options.rearg : true + }; + + var defaultHolder = isLib ? func : fallbackHolder, + forceCurry = ('curry' in options) && options.curry, + forceFixed = ('fixed' in options) && options.fixed, + forceRearg = ('rearg' in options) && options.rearg, + pristine = isLib ? func.runInContext() : undefined; + + var helpers = isLib ? func : { + 'ary': util.ary, + 'assign': util.assign, + 'clone': util.clone, + 'curry': util.curry, + 'forEach': util.forEach, + 'isArray': util.isArray, + 'isError': util.isError, + 'isFunction': util.isFunction, + 'isWeakMap': util.isWeakMap, + 'iteratee': util.iteratee, + 'keys': util.keys, + 'rearg': util.rearg, + 'toInteger': util.toInteger, + 'toPath': util.toPath + }; + + var ary = helpers.ary, + assign = helpers.assign, + clone = helpers.clone, + curry = helpers.curry, + each = helpers.forEach, + isArray = helpers.isArray, + isError = helpers.isError, + isFunction = helpers.isFunction, + isWeakMap = helpers.isWeakMap, + keys = helpers.keys, + rearg = helpers.rearg, + toInteger = helpers.toInteger, + toPath = helpers.toPath; + + var aryMethodKeys = keys(mapping.aryMethod); + + var wrappers = { + 'castArray': function(castArray) { + return function() { + var value = arguments[0]; + return isArray(value) + ? castArray(cloneArray(value)) + : castArray.apply(undefined, arguments); + }; + }, + 'iteratee': function(iteratee) { + return function() { + var func = arguments[0], + arity = arguments[1], + result = iteratee(func, arity), + length = result.length; + + if (config.cap && typeof arity == 'number') { + arity = arity > 2 ? (arity - 2) : 1; + return (length && length <= arity) ? result : baseAry(result, arity); + } + return result; + }; + }, + 'mixin': function(mixin) { + return function(source) { + var func = this; + if (!isFunction(func)) { + return mixin(func, Object(source)); + } + var pairs = []; + each(keys(source), function(key) { + if (isFunction(source[key])) { + pairs.push([key, func.prototype[key]]); + } + }); + + mixin(func, Object(source)); + + each(pairs, function(pair) { + var value = pair[1]; + if (isFunction(value)) { + func.prototype[pair[0]] = value; + } else { + delete func.prototype[pair[0]]; + } + }); + return func; + }; + }, + 'nthArg': function(nthArg) { + return function(n) { + var arity = n < 0 ? 1 : (toInteger(n) + 1); + return curry(nthArg(n), arity); + }; + }, + 'rearg': function(rearg) { + return function(func, indexes) { + var arity = indexes ? indexes.length : 0; + return curry(rearg(func, indexes), arity); + }; + }, + 'runInContext': function(runInContext) { + return function(context) { + return baseConvert(util, runInContext(context), options); + }; + } + }; + + /*--------------------------------------------------------------------------*/ + + /** + * Casts `func` to a function with an arity capped iteratee if needed. + * + * @private + * @param {string} name The name of the function to inspect. + * @param {Function} func The function to inspect. + * @returns {Function} Returns the cast function. + */ + function castCap(name, func) { + if (config.cap) { + var indexes = mapping.iterateeRearg[name]; + if (indexes) { + return iterateeRearg(func, indexes); + } + var n = !isLib && mapping.iterateeAry[name]; + if (n) { + return iterateeAry(func, n); + } + } + return func; + } + + /** + * Casts `func` to a curried function if needed. + * + * @private + * @param {string} name The name of the function to inspect. + * @param {Function} func The function to inspect. + * @param {number} n The arity of `func`. + * @returns {Function} Returns the cast function. + */ + function castCurry(name, func, n) { + return (forceCurry || (config.curry && n > 1)) + ? curry(func, n) + : func; + } + + /** + * Casts `func` to a fixed arity function if needed. + * + * @private + * @param {string} name The name of the function to inspect. + * @param {Function} func The function to inspect. + * @param {number} n The arity cap. + * @returns {Function} Returns the cast function. + */ + function castFixed(name, func, n) { + if (config.fixed && (forceFixed || !mapping.skipFixed[name])) { + var data = mapping.methodSpread[name], + start = data && data.start; + + return start === undefined ? ary(func, n) : flatSpread(func, start); + } + return func; + } + + /** + * Casts `func` to an rearged function if needed. + * + * @private + * @param {string} name The name of the function to inspect. + * @param {Function} func The function to inspect. + * @param {number} n The arity of `func`. + * @returns {Function} Returns the cast function. + */ + function castRearg(name, func, n) { + return (config.rearg && n > 1 && (forceRearg || !mapping.skipRearg[name])) + ? rearg(func, mapping.methodRearg[name] || mapping.aryRearg[n]) + : func; + } + + /** + * Creates a clone of `object` by `path`. + * + * @private + * @param {Object} object The object to clone. + * @param {Array|string} path The path to clone by. + * @returns {Object} Returns the cloned object. + */ + function cloneByPath(object, path) { + path = toPath(path); + + var index = -1, + length = path.length, + lastIndex = length - 1, + result = clone(Object(object)), + nested = result; + + while (nested != null && ++index < length) { + var key = path[index], + value = nested[key]; + + if (value != null && + !(isFunction(value) || isError(value) || isWeakMap(value))) { + nested[key] = clone(index == lastIndex ? value : Object(value)); + } + nested = nested[key]; + } + return result; + } + + /** + * Converts `lodash` to an immutable auto-curried iteratee-first data-last + * version with conversion `options` applied. + * + * @param {Object} [options] The options object. See `baseConvert` for more details. + * @returns {Function} Returns the converted `lodash`. + */ + function convertLib(options) { + return _.runInContext.convert(options)(undefined); + } + + /** + * Create a converter function for `func` of `name`. + * + * @param {string} name The name of the function to convert. + * @param {Function} func The function to convert. + * @returns {Function} Returns the new converter function. + */ + function createConverter(name, func) { + var realName = mapping.aliasToReal[name] || name, + methodName = mapping.remap[realName] || realName, + oldOptions = options; + + return function(options) { + var newUtil = isLib ? pristine : helpers, + newFunc = isLib ? pristine[methodName] : func, + newOptions = assign(assign({}, oldOptions), options); + + return baseConvert(newUtil, realName, newFunc, newOptions); + }; + } + + /** + * Creates a function that wraps `func` to invoke its iteratee, with up to `n` + * arguments, ignoring any additional arguments. + * + * @private + * @param {Function} func The function to cap iteratee arguments for. + * @param {number} n The arity cap. + * @returns {Function} Returns the new function. + */ + function iterateeAry(func, n) { + return overArg(func, function(func) { + return typeof func == 'function' ? baseAry(func, n) : func; + }); + } + + /** + * Creates a function that wraps `func` to invoke its iteratee with arguments + * arranged according to the specified `indexes` where the argument value at + * the first index is provided as the first argument, the argument value at + * the second index is provided as the second argument, and so on. + * + * @private + * @param {Function} func The function to rearrange iteratee arguments for. + * @param {number[]} indexes The arranged argument indexes. + * @returns {Function} Returns the new function. + */ + function iterateeRearg(func, indexes) { + return overArg(func, function(func) { + var n = indexes.length; + return baseArity(rearg(baseAry(func, n), indexes), n); + }); + } + + /** + * Creates a function that invokes `func` with its first argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ + function overArg(func, transform) { + return function() { + var length = arguments.length; + if (!length) { + return func(); + } + var args = Array(length); + while (length--) { + args[length] = arguments[length]; + } + var index = config.rearg ? 0 : (length - 1); + args[index] = transform(args[index]); + return func.apply(undefined, args); + }; + } + + /** + * Creates a function that wraps `func` and applys the conversions + * rules by `name`. + * + * @private + * @param {string} name The name of the function to wrap. + * @param {Function} func The function to wrap. + * @returns {Function} Returns the converted function. + */ + function wrap(name, func, placeholder) { + var result, + realName = mapping.aliasToReal[name] || name, + wrapped = func, + wrapper = wrappers[realName]; + + if (wrapper) { + wrapped = wrapper(func); + } + else if (config.immutable) { + if (mapping.mutate.array[realName]) { + wrapped = wrapImmutable(func, cloneArray); + } + else if (mapping.mutate.object[realName]) { + wrapped = wrapImmutable(func, createCloner(func)); + } + else if (mapping.mutate.set[realName]) { + wrapped = wrapImmutable(func, cloneByPath); + } + } + each(aryMethodKeys, function(aryKey) { + each(mapping.aryMethod[aryKey], function(otherName) { + if (realName == otherName) { + var data = mapping.methodSpread[realName], + afterRearg = data && data.afterRearg; + + result = afterRearg + ? castFixed(realName, castRearg(realName, wrapped, aryKey), aryKey) + : castRearg(realName, castFixed(realName, wrapped, aryKey), aryKey); + + result = castCap(realName, result); + result = castCurry(realName, result, aryKey); + return false; + } + }); + return !result; + }); + + result || (result = wrapped); + if (result == func) { + result = forceCurry ? curry(result, 1) : function() { + return func.apply(this, arguments); + }; + } + result.convert = createConverter(realName, func); + result.placeholder = func.placeholder = placeholder; + + return result; + } + + /*--------------------------------------------------------------------------*/ + + if (!isObj) { + return wrap(name, func, defaultHolder); + } + var _ = func; + + // Convert methods by ary cap. + var pairs = []; + each(aryMethodKeys, function(aryKey) { + each(mapping.aryMethod[aryKey], function(key) { + var func = _[mapping.remap[key] || key]; + if (func) { + pairs.push([key, wrap(key, func, _)]); + } + }); + }); + + // Convert remaining methods. + each(keys(_), function(key) { + var func = _[key]; + if (typeof func == 'function') { + var length = pairs.length; + while (length--) { + if (pairs[length][0] == key) { + return; + } + } + func.convert = createConverter(key, func); + pairs.push([key, func]); + } + }); + + // Assign to `_` leaving `_.prototype` unchanged to allow chaining. + each(pairs, function(pair) { + _[pair[0]] = pair[1]; + }); + + _.convert = convertLib; + _.placeholder = _; + + // Assign aliases. + each(keys(_), function(key) { + each(mapping.realToAlias[key] || [], function(alias) { + _[alias] = _[key]; + }); + }); + + return _; +} + +module.exports = baseConvert; diff --git a/node_modules/lodash/fp/_convertBrowser.js b/node_modules/lodash/fp/_convertBrowser.js new file mode 100644 index 0000000..bde030d --- /dev/null +++ b/node_modules/lodash/fp/_convertBrowser.js @@ -0,0 +1,18 @@ +var baseConvert = require('./_baseConvert'); + +/** + * Converts `lodash` to an immutable auto-curried iteratee-first data-last + * version with conversion `options` applied. + * + * @param {Function} lodash The lodash function to convert. + * @param {Object} [options] The options object. See `baseConvert` for more details. + * @returns {Function} Returns the converted `lodash`. + */ +function browserConvert(lodash, options) { + return baseConvert(lodash, lodash, options); +} + +if (typeof _ == 'function' && typeof _.runInContext == 'function') { + _ = browserConvert(_.runInContext()); +} +module.exports = browserConvert; diff --git a/node_modules/lodash/fp/_falseOptions.js b/node_modules/lodash/fp/_falseOptions.js new file mode 100644 index 0000000..773235e --- /dev/null +++ b/node_modules/lodash/fp/_falseOptions.js @@ -0,0 +1,7 @@ +module.exports = { + 'cap': false, + 'curry': false, + 'fixed': false, + 'immutable': false, + 'rearg': false +}; diff --git a/node_modules/lodash/fp/_mapping.js b/node_modules/lodash/fp/_mapping.js new file mode 100644 index 0000000..a642ec0 --- /dev/null +++ b/node_modules/lodash/fp/_mapping.js @@ -0,0 +1,358 @@ +/** Used to map aliases to their real names. */ +exports.aliasToReal = { + + // Lodash aliases. + 'each': 'forEach', + 'eachRight': 'forEachRight', + 'entries': 'toPairs', + 'entriesIn': 'toPairsIn', + 'extend': 'assignIn', + 'extendAll': 'assignInAll', + 'extendAllWith': 'assignInAllWith', + 'extendWith': 'assignInWith', + 'first': 'head', + + // Methods that are curried variants of others. + 'conforms': 'conformsTo', + 'matches': 'isMatch', + 'property': 'get', + + // Ramda aliases. + '__': 'placeholder', + 'F': 'stubFalse', + 'T': 'stubTrue', + 'all': 'every', + 'allPass': 'overEvery', + 'always': 'constant', + 'any': 'some', + 'anyPass': 'overSome', + 'apply': 'spread', + 'assoc': 'set', + 'assocPath': 'set', + 'complement': 'negate', + 'compose': 'flowRight', + 'contains': 'includes', + 'dissoc': 'unset', + 'dissocPath': 'unset', + 'dropLast': 'dropRight', + 'dropLastWhile': 'dropRightWhile', + 'equals': 'isEqual', + 'identical': 'eq', + 'indexBy': 'keyBy', + 'init': 'initial', + 'invertObj': 'invert', + 'juxt': 'over', + 'omitAll': 'omit', + 'nAry': 'ary', + 'path': 'get', + 'pathEq': 'matchesProperty', + 'pathOr': 'getOr', + 'paths': 'at', + 'pickAll': 'pick', + 'pipe': 'flow', + 'pluck': 'map', + 'prop': 'get', + 'propEq': 'matchesProperty', + 'propOr': 'getOr', + 'props': 'at', + 'symmetricDifference': 'xor', + 'symmetricDifferenceBy': 'xorBy', + 'symmetricDifferenceWith': 'xorWith', + 'takeLast': 'takeRight', + 'takeLastWhile': 'takeRightWhile', + 'unapply': 'rest', + 'unnest': 'flatten', + 'useWith': 'overArgs', + 'where': 'conformsTo', + 'whereEq': 'isMatch', + 'zipObj': 'zipObject' +}; + +/** Used to map ary to method names. */ +exports.aryMethod = { + '1': [ + 'assignAll', 'assignInAll', 'attempt', 'castArray', 'ceil', 'create', + 'curry', 'curryRight', 'defaultsAll', 'defaultsDeepAll', 'floor', 'flow', + 'flowRight', 'fromPairs', 'invert', 'iteratee', 'memoize', 'method', 'mergeAll', + 'methodOf', 'mixin', 'nthArg', 'over', 'overEvery', 'overSome','rest', 'reverse', + 'round', 'runInContext', 'spread', 'template', 'trim', 'trimEnd', 'trimStart', + 'uniqueId', 'words', 'zipAll' + ], + '2': [ + 'add', 'after', 'ary', 'assign', 'assignAllWith', 'assignIn', 'assignInAllWith', + 'at', 'before', 'bind', 'bindAll', 'bindKey', 'chunk', 'cloneDeepWith', + 'cloneWith', 'concat', 'conformsTo', 'countBy', 'curryN', 'curryRightN', + 'debounce', 'defaults', 'defaultsDeep', 'defaultTo', 'delay', 'difference', + 'divide', 'drop', 'dropRight', 'dropRightWhile', 'dropWhile', 'endsWith', 'eq', + 'every', 'filter', 'find', 'findIndex', 'findKey', 'findLast', 'findLastIndex', + 'findLastKey', 'flatMap', 'flatMapDeep', 'flattenDepth', 'forEach', + 'forEachRight', 'forIn', 'forInRight', 'forOwn', 'forOwnRight', 'get', + 'groupBy', 'gt', 'gte', 'has', 'hasIn', 'includes', 'indexOf', 'intersection', + 'invertBy', 'invoke', 'invokeMap', 'isEqual', 'isMatch', 'join', 'keyBy', + 'lastIndexOf', 'lt', 'lte', 'map', 'mapKeys', 'mapValues', 'matchesProperty', + 'maxBy', 'meanBy', 'merge', 'mergeAllWith', 'minBy', 'multiply', 'nth', 'omit', + 'omitBy', 'overArgs', 'pad', 'padEnd', 'padStart', 'parseInt', 'partial', + 'partialRight', 'partition', 'pick', 'pickBy', 'propertyOf', 'pull', 'pullAll', + 'pullAt', 'random', 'range', 'rangeRight', 'rearg', 'reject', 'remove', + 'repeat', 'restFrom', 'result', 'sampleSize', 'some', 'sortBy', 'sortedIndex', + 'sortedIndexOf', 'sortedLastIndex', 'sortedLastIndexOf', 'sortedUniqBy', + 'split', 'spreadFrom', 'startsWith', 'subtract', 'sumBy', 'take', 'takeRight', + 'takeRightWhile', 'takeWhile', 'tap', 'throttle', 'thru', 'times', 'trimChars', + 'trimCharsEnd', 'trimCharsStart', 'truncate', 'union', 'uniqBy', 'uniqWith', + 'unset', 'unzipWith', 'without', 'wrap', 'xor', 'zip', 'zipObject', + 'zipObjectDeep' + ], + '3': [ + 'assignInWith', 'assignWith', 'clamp', 'differenceBy', 'differenceWith', + 'findFrom', 'findIndexFrom', 'findLastFrom', 'findLastIndexFrom', 'getOr', + 'includesFrom', 'indexOfFrom', 'inRange', 'intersectionBy', 'intersectionWith', + 'invokeArgs', 'invokeArgsMap', 'isEqualWith', 'isMatchWith', 'flatMapDepth', + 'lastIndexOfFrom', 'mergeWith', 'orderBy', 'padChars', 'padCharsEnd', + 'padCharsStart', 'pullAllBy', 'pullAllWith', 'rangeStep', 'rangeStepRight', + 'reduce', 'reduceRight', 'replace', 'set', 'slice', 'sortedIndexBy', + 'sortedLastIndexBy', 'transform', 'unionBy', 'unionWith', 'update', 'xorBy', + 'xorWith', 'zipWith' + ], + '4': [ + 'fill', 'setWith', 'updateWith' + ] +}; + +/** Used to map ary to rearg configs. */ +exports.aryRearg = { + '2': [1, 0], + '3': [2, 0, 1], + '4': [3, 2, 0, 1] +}; + +/** Used to map method names to their iteratee ary. */ +exports.iterateeAry = { + 'dropRightWhile': 1, + 'dropWhile': 1, + 'every': 1, + 'filter': 1, + 'find': 1, + 'findFrom': 1, + 'findIndex': 1, + 'findIndexFrom': 1, + 'findKey': 1, + 'findLast': 1, + 'findLastFrom': 1, + 'findLastIndex': 1, + 'findLastIndexFrom': 1, + 'findLastKey': 1, + 'flatMap': 1, + 'flatMapDeep': 1, + 'flatMapDepth': 1, + 'forEach': 1, + 'forEachRight': 1, + 'forIn': 1, + 'forInRight': 1, + 'forOwn': 1, + 'forOwnRight': 1, + 'map': 1, + 'mapKeys': 1, + 'mapValues': 1, + 'partition': 1, + 'reduce': 2, + 'reduceRight': 2, + 'reject': 1, + 'remove': 1, + 'some': 1, + 'takeRightWhile': 1, + 'takeWhile': 1, + 'times': 1, + 'transform': 2 +}; + +/** Used to map method names to iteratee rearg configs. */ +exports.iterateeRearg = { + 'mapKeys': [1], + 'reduceRight': [1, 0] +}; + +/** Used to map method names to rearg configs. */ +exports.methodRearg = { + 'assignInAllWith': [1, 0], + 'assignInWith': [1, 2, 0], + 'assignAllWith': [1, 0], + 'assignWith': [1, 2, 0], + 'differenceBy': [1, 2, 0], + 'differenceWith': [1, 2, 0], + 'getOr': [2, 1, 0], + 'intersectionBy': [1, 2, 0], + 'intersectionWith': [1, 2, 0], + 'isEqualWith': [1, 2, 0], + 'isMatchWith': [2, 1, 0], + 'mergeAllWith': [1, 0], + 'mergeWith': [1, 2, 0], + 'padChars': [2, 1, 0], + 'padCharsEnd': [2, 1, 0], + 'padCharsStart': [2, 1, 0], + 'pullAllBy': [2, 1, 0], + 'pullAllWith': [2, 1, 0], + 'rangeStep': [1, 2, 0], + 'rangeStepRight': [1, 2, 0], + 'setWith': [3, 1, 2, 0], + 'sortedIndexBy': [2, 1, 0], + 'sortedLastIndexBy': [2, 1, 0], + 'unionBy': [1, 2, 0], + 'unionWith': [1, 2, 0], + 'updateWith': [3, 1, 2, 0], + 'xorBy': [1, 2, 0], + 'xorWith': [1, 2, 0], + 'zipWith': [1, 2, 0] +}; + +/** Used to map method names to spread configs. */ +exports.methodSpread = { + 'assignAll': { 'start': 0 }, + 'assignAllWith': { 'start': 0 }, + 'assignInAll': { 'start': 0 }, + 'assignInAllWith': { 'start': 0 }, + 'defaultsAll': { 'start': 0 }, + 'defaultsDeepAll': { 'start': 0 }, + 'invokeArgs': { 'start': 2 }, + 'invokeArgsMap': { 'start': 2 }, + 'mergeAll': { 'start': 0 }, + 'mergeAllWith': { 'start': 0 }, + 'partial': { 'start': 1 }, + 'partialRight': { 'start': 1 }, + 'without': { 'start': 1 }, + 'zipAll': { 'start': 0 } +}; + +/** Used to identify methods which mutate arrays or objects. */ +exports.mutate = { + 'array': { + 'fill': true, + 'pull': true, + 'pullAll': true, + 'pullAllBy': true, + 'pullAllWith': true, + 'pullAt': true, + 'remove': true, + 'reverse': true + }, + 'object': { + 'assign': true, + 'assignAll': true, + 'assignAllWith': true, + 'assignIn': true, + 'assignInAll': true, + 'assignInAllWith': true, + 'assignInWith': true, + 'assignWith': true, + 'defaults': true, + 'defaultsAll': true, + 'defaultsDeep': true, + 'defaultsDeepAll': true, + 'merge': true, + 'mergeAll': true, + 'mergeAllWith': true, + 'mergeWith': true, + }, + 'set': { + 'set': true, + 'setWith': true, + 'unset': true, + 'update': true, + 'updateWith': true + } +}; + +/** Used to map real names to their aliases. */ +exports.realToAlias = (function() { + var hasOwnProperty = Object.prototype.hasOwnProperty, + object = exports.aliasToReal, + result = {}; + + for (var key in object) { + var value = object[key]; + if (hasOwnProperty.call(result, value)) { + result[value].push(key); + } else { + result[value] = [key]; + } + } + return result; +}()); + +/** Used to map method names to other names. */ +exports.remap = { + 'assignAll': 'assign', + 'assignAllWith': 'assignWith', + 'assignInAll': 'assignIn', + 'assignInAllWith': 'assignInWith', + 'curryN': 'curry', + 'curryRightN': 'curryRight', + 'defaultsAll': 'defaults', + 'defaultsDeepAll': 'defaultsDeep', + 'findFrom': 'find', + 'findIndexFrom': 'findIndex', + 'findLastFrom': 'findLast', + 'findLastIndexFrom': 'findLastIndex', + 'getOr': 'get', + 'includesFrom': 'includes', + 'indexOfFrom': 'indexOf', + 'invokeArgs': 'invoke', + 'invokeArgsMap': 'invokeMap', + 'lastIndexOfFrom': 'lastIndexOf', + 'mergeAll': 'merge', + 'mergeAllWith': 'mergeWith', + 'padChars': 'pad', + 'padCharsEnd': 'padEnd', + 'padCharsStart': 'padStart', + 'propertyOf': 'get', + 'rangeStep': 'range', + 'rangeStepRight': 'rangeRight', + 'restFrom': 'rest', + 'spreadFrom': 'spread', + 'trimChars': 'trim', + 'trimCharsEnd': 'trimEnd', + 'trimCharsStart': 'trimStart', + 'zipAll': 'zip' +}; + +/** Used to track methods that skip fixing their arity. */ +exports.skipFixed = { + 'castArray': true, + 'flow': true, + 'flowRight': true, + 'iteratee': true, + 'mixin': true, + 'rearg': true, + 'runInContext': true +}; + +/** Used to track methods that skip rearranging arguments. */ +exports.skipRearg = { + 'add': true, + 'assign': true, + 'assignIn': true, + 'bind': true, + 'bindKey': true, + 'concat': true, + 'difference': true, + 'divide': true, + 'eq': true, + 'gt': true, + 'gte': true, + 'isEqual': true, + 'lt': true, + 'lte': true, + 'matchesProperty': true, + 'merge': true, + 'multiply': true, + 'overArgs': true, + 'partial': true, + 'partialRight': true, + 'propertyOf': true, + 'random': true, + 'range': true, + 'rangeRight': true, + 'subtract': true, + 'zip': true, + 'zipObject': true, + 'zipObjectDeep': true +}; diff --git a/node_modules/lodash/fp/_util.js b/node_modules/lodash/fp/_util.js new file mode 100644 index 0000000..1dbf36f --- /dev/null +++ b/node_modules/lodash/fp/_util.js @@ -0,0 +1,16 @@ +module.exports = { + 'ary': require('../ary'), + 'assign': require('../_baseAssign'), + 'clone': require('../clone'), + 'curry': require('../curry'), + 'forEach': require('../_arrayEach'), + 'isArray': require('../isArray'), + 'isError': require('../isError'), + 'isFunction': require('../isFunction'), + 'isWeakMap': require('../isWeakMap'), + 'iteratee': require('../iteratee'), + 'keys': require('../_baseKeys'), + 'rearg': require('../rearg'), + 'toInteger': require('../toInteger'), + 'toPath': require('../toPath') +}; diff --git a/node_modules/lodash/fp/add.js b/node_modules/lodash/fp/add.js new file mode 100644 index 0000000..816eeec --- /dev/null +++ b/node_modules/lodash/fp/add.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('add', require('../add')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/after.js b/node_modules/lodash/fp/after.js new file mode 100644 index 0000000..21a0167 --- /dev/null +++ b/node_modules/lodash/fp/after.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('after', require('../after')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/all.js b/node_modules/lodash/fp/all.js new file mode 100644 index 0000000..d0839f7 --- /dev/null +++ b/node_modules/lodash/fp/all.js @@ -0,0 +1 @@ +module.exports = require('./every'); diff --git a/node_modules/lodash/fp/allPass.js b/node_modules/lodash/fp/allPass.js new file mode 100644 index 0000000..79b73ef --- /dev/null +++ b/node_modules/lodash/fp/allPass.js @@ -0,0 +1 @@ +module.exports = require('./overEvery'); diff --git a/node_modules/lodash/fp/always.js b/node_modules/lodash/fp/always.js new file mode 100644 index 0000000..9887703 --- /dev/null +++ b/node_modules/lodash/fp/always.js @@ -0,0 +1 @@ +module.exports = require('./constant'); diff --git a/node_modules/lodash/fp/any.js b/node_modules/lodash/fp/any.js new file mode 100644 index 0000000..900ac25 --- /dev/null +++ b/node_modules/lodash/fp/any.js @@ -0,0 +1 @@ +module.exports = require('./some'); diff --git a/node_modules/lodash/fp/anyPass.js b/node_modules/lodash/fp/anyPass.js new file mode 100644 index 0000000..2774ab3 --- /dev/null +++ b/node_modules/lodash/fp/anyPass.js @@ -0,0 +1 @@ +module.exports = require('./overSome'); diff --git a/node_modules/lodash/fp/apply.js b/node_modules/lodash/fp/apply.js new file mode 100644 index 0000000..2b75712 --- /dev/null +++ b/node_modules/lodash/fp/apply.js @@ -0,0 +1 @@ +module.exports = require('./spread'); diff --git a/node_modules/lodash/fp/array.js b/node_modules/lodash/fp/array.js new file mode 100644 index 0000000..fe939c2 --- /dev/null +++ b/node_modules/lodash/fp/array.js @@ -0,0 +1,2 @@ +var convert = require('./convert'); +module.exports = convert(require('../array')); diff --git a/node_modules/lodash/fp/ary.js b/node_modules/lodash/fp/ary.js new file mode 100644 index 0000000..8edf187 --- /dev/null +++ b/node_modules/lodash/fp/ary.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('ary', require('../ary')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/assign.js b/node_modules/lodash/fp/assign.js new file mode 100644 index 0000000..23f47af --- /dev/null +++ b/node_modules/lodash/fp/assign.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('assign', require('../assign')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/assignAll.js b/node_modules/lodash/fp/assignAll.js new file mode 100644 index 0000000..b1d36c7 --- /dev/null +++ b/node_modules/lodash/fp/assignAll.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('assignAll', require('../assign')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/assignAllWith.js b/node_modules/lodash/fp/assignAllWith.js new file mode 100644 index 0000000..21e836e --- /dev/null +++ b/node_modules/lodash/fp/assignAllWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('assignAllWith', require('../assignWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/assignIn.js b/node_modules/lodash/fp/assignIn.js new file mode 100644 index 0000000..6e7c65f --- /dev/null +++ b/node_modules/lodash/fp/assignIn.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('assignIn', require('../assignIn')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/assignInAll.js b/node_modules/lodash/fp/assignInAll.js new file mode 100644 index 0000000..7ba75db --- /dev/null +++ b/node_modules/lodash/fp/assignInAll.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('assignInAll', require('../assignIn')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/assignInAllWith.js b/node_modules/lodash/fp/assignInAllWith.js new file mode 100644 index 0000000..e766903 --- /dev/null +++ b/node_modules/lodash/fp/assignInAllWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('assignInAllWith', require('../assignInWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/assignInWith.js b/node_modules/lodash/fp/assignInWith.js new file mode 100644 index 0000000..acb5923 --- /dev/null +++ b/node_modules/lodash/fp/assignInWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('assignInWith', require('../assignInWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/assignWith.js b/node_modules/lodash/fp/assignWith.js new file mode 100644 index 0000000..eb92521 --- /dev/null +++ b/node_modules/lodash/fp/assignWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('assignWith', require('../assignWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/assoc.js b/node_modules/lodash/fp/assoc.js new file mode 100644 index 0000000..7648820 --- /dev/null +++ b/node_modules/lodash/fp/assoc.js @@ -0,0 +1 @@ +module.exports = require('./set'); diff --git a/node_modules/lodash/fp/assocPath.js b/node_modules/lodash/fp/assocPath.js new file mode 100644 index 0000000..7648820 --- /dev/null +++ b/node_modules/lodash/fp/assocPath.js @@ -0,0 +1 @@ +module.exports = require('./set'); diff --git a/node_modules/lodash/fp/at.js b/node_modules/lodash/fp/at.js new file mode 100644 index 0000000..cc39d25 --- /dev/null +++ b/node_modules/lodash/fp/at.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('at', require('../at')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/attempt.js b/node_modules/lodash/fp/attempt.js new file mode 100644 index 0000000..26ca42e --- /dev/null +++ b/node_modules/lodash/fp/attempt.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('attempt', require('../attempt')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/before.js b/node_modules/lodash/fp/before.js new file mode 100644 index 0000000..7a2de65 --- /dev/null +++ b/node_modules/lodash/fp/before.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('before', require('../before')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/bind.js b/node_modules/lodash/fp/bind.js new file mode 100644 index 0000000..5cbe4f3 --- /dev/null +++ b/node_modules/lodash/fp/bind.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('bind', require('../bind')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/bindAll.js b/node_modules/lodash/fp/bindAll.js new file mode 100644 index 0000000..6b4a4a0 --- /dev/null +++ b/node_modules/lodash/fp/bindAll.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('bindAll', require('../bindAll')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/bindKey.js b/node_modules/lodash/fp/bindKey.js new file mode 100644 index 0000000..6a46c6b --- /dev/null +++ b/node_modules/lodash/fp/bindKey.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('bindKey', require('../bindKey')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/camelCase.js b/node_modules/lodash/fp/camelCase.js new file mode 100644 index 0000000..87b77b4 --- /dev/null +++ b/node_modules/lodash/fp/camelCase.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('camelCase', require('../camelCase'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/capitalize.js b/node_modules/lodash/fp/capitalize.js new file mode 100644 index 0000000..cac74e1 --- /dev/null +++ b/node_modules/lodash/fp/capitalize.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('capitalize', require('../capitalize'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/castArray.js b/node_modules/lodash/fp/castArray.js new file mode 100644 index 0000000..8681c09 --- /dev/null +++ b/node_modules/lodash/fp/castArray.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('castArray', require('../castArray')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/ceil.js b/node_modules/lodash/fp/ceil.js new file mode 100644 index 0000000..f416b72 --- /dev/null +++ b/node_modules/lodash/fp/ceil.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('ceil', require('../ceil')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/chain.js b/node_modules/lodash/fp/chain.js new file mode 100644 index 0000000..604fe39 --- /dev/null +++ b/node_modules/lodash/fp/chain.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('chain', require('../chain'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/chunk.js b/node_modules/lodash/fp/chunk.js new file mode 100644 index 0000000..871ab08 --- /dev/null +++ b/node_modules/lodash/fp/chunk.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('chunk', require('../chunk')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/clamp.js b/node_modules/lodash/fp/clamp.js new file mode 100644 index 0000000..3b06c01 --- /dev/null +++ b/node_modules/lodash/fp/clamp.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('clamp', require('../clamp')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/clone.js b/node_modules/lodash/fp/clone.js new file mode 100644 index 0000000..cadb59c --- /dev/null +++ b/node_modules/lodash/fp/clone.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('clone', require('../clone'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/cloneDeep.js b/node_modules/lodash/fp/cloneDeep.js new file mode 100644 index 0000000..a6107aa --- /dev/null +++ b/node_modules/lodash/fp/cloneDeep.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('cloneDeep', require('../cloneDeep'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/cloneDeepWith.js b/node_modules/lodash/fp/cloneDeepWith.js new file mode 100644 index 0000000..6f01e44 --- /dev/null +++ b/node_modules/lodash/fp/cloneDeepWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('cloneDeepWith', require('../cloneDeepWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/cloneWith.js b/node_modules/lodash/fp/cloneWith.js new file mode 100644 index 0000000..aa88578 --- /dev/null +++ b/node_modules/lodash/fp/cloneWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('cloneWith', require('../cloneWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/collection.js b/node_modules/lodash/fp/collection.js new file mode 100644 index 0000000..fc8b328 --- /dev/null +++ b/node_modules/lodash/fp/collection.js @@ -0,0 +1,2 @@ +var convert = require('./convert'); +module.exports = convert(require('../collection')); diff --git a/node_modules/lodash/fp/commit.js b/node_modules/lodash/fp/commit.js new file mode 100644 index 0000000..130a894 --- /dev/null +++ b/node_modules/lodash/fp/commit.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('commit', require('../commit'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/compact.js b/node_modules/lodash/fp/compact.js new file mode 100644 index 0000000..ce8f7a1 --- /dev/null +++ b/node_modules/lodash/fp/compact.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('compact', require('../compact'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/complement.js b/node_modules/lodash/fp/complement.js new file mode 100644 index 0000000..93eb462 --- /dev/null +++ b/node_modules/lodash/fp/complement.js @@ -0,0 +1 @@ +module.exports = require('./negate'); diff --git a/node_modules/lodash/fp/compose.js b/node_modules/lodash/fp/compose.js new file mode 100644 index 0000000..1954e94 --- /dev/null +++ b/node_modules/lodash/fp/compose.js @@ -0,0 +1 @@ +module.exports = require('./flowRight'); diff --git a/node_modules/lodash/fp/concat.js b/node_modules/lodash/fp/concat.js new file mode 100644 index 0000000..e59346a --- /dev/null +++ b/node_modules/lodash/fp/concat.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('concat', require('../concat')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/cond.js b/node_modules/lodash/fp/cond.js new file mode 100644 index 0000000..6a0120e --- /dev/null +++ b/node_modules/lodash/fp/cond.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('cond', require('../cond'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/conforms.js b/node_modules/lodash/fp/conforms.js new file mode 100644 index 0000000..3247f64 --- /dev/null +++ b/node_modules/lodash/fp/conforms.js @@ -0,0 +1 @@ +module.exports = require('./conformsTo'); diff --git a/node_modules/lodash/fp/conformsTo.js b/node_modules/lodash/fp/conformsTo.js new file mode 100644 index 0000000..aa7f41e --- /dev/null +++ b/node_modules/lodash/fp/conformsTo.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('conformsTo', require('../conformsTo')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/constant.js b/node_modules/lodash/fp/constant.js new file mode 100644 index 0000000..9e406fc --- /dev/null +++ b/node_modules/lodash/fp/constant.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('constant', require('../constant'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/contains.js b/node_modules/lodash/fp/contains.js new file mode 100644 index 0000000..594722a --- /dev/null +++ b/node_modules/lodash/fp/contains.js @@ -0,0 +1 @@ +module.exports = require('./includes'); diff --git a/node_modules/lodash/fp/convert.js b/node_modules/lodash/fp/convert.js new file mode 100644 index 0000000..4795dc4 --- /dev/null +++ b/node_modules/lodash/fp/convert.js @@ -0,0 +1,18 @@ +var baseConvert = require('./_baseConvert'), + util = require('./_util'); + +/** + * Converts `func` of `name` to an immutable auto-curried iteratee-first data-last + * version with conversion `options` applied. If `name` is an object its methods + * will be converted. + * + * @param {string} name The name of the function to wrap. + * @param {Function} [func] The function to wrap. + * @param {Object} [options] The options object. See `baseConvert` for more details. + * @returns {Function|Object} Returns the converted function or object. + */ +function convert(name, func, options) { + return baseConvert(util, name, func, options); +} + +module.exports = convert; diff --git a/node_modules/lodash/fp/countBy.js b/node_modules/lodash/fp/countBy.js new file mode 100644 index 0000000..dfa4643 --- /dev/null +++ b/node_modules/lodash/fp/countBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('countBy', require('../countBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/create.js b/node_modules/lodash/fp/create.js new file mode 100644 index 0000000..752025f --- /dev/null +++ b/node_modules/lodash/fp/create.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('create', require('../create')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/curry.js b/node_modules/lodash/fp/curry.js new file mode 100644 index 0000000..b0b4168 --- /dev/null +++ b/node_modules/lodash/fp/curry.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('curry', require('../curry')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/curryN.js b/node_modules/lodash/fp/curryN.js new file mode 100644 index 0000000..2ae7d00 --- /dev/null +++ b/node_modules/lodash/fp/curryN.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('curryN', require('../curry')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/curryRight.js b/node_modules/lodash/fp/curryRight.js new file mode 100644 index 0000000..cb619eb --- /dev/null +++ b/node_modules/lodash/fp/curryRight.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('curryRight', require('../curryRight')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/curryRightN.js b/node_modules/lodash/fp/curryRightN.js new file mode 100644 index 0000000..2495afc --- /dev/null +++ b/node_modules/lodash/fp/curryRightN.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('curryRightN', require('../curryRight')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/date.js b/node_modules/lodash/fp/date.js new file mode 100644 index 0000000..82cb952 --- /dev/null +++ b/node_modules/lodash/fp/date.js @@ -0,0 +1,2 @@ +var convert = require('./convert'); +module.exports = convert(require('../date')); diff --git a/node_modules/lodash/fp/debounce.js b/node_modules/lodash/fp/debounce.js new file mode 100644 index 0000000..2612229 --- /dev/null +++ b/node_modules/lodash/fp/debounce.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('debounce', require('../debounce')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/deburr.js b/node_modules/lodash/fp/deburr.js new file mode 100644 index 0000000..96463ab --- /dev/null +++ b/node_modules/lodash/fp/deburr.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('deburr', require('../deburr'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/defaultTo.js b/node_modules/lodash/fp/defaultTo.js new file mode 100644 index 0000000..d6b52a4 --- /dev/null +++ b/node_modules/lodash/fp/defaultTo.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('defaultTo', require('../defaultTo')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/defaults.js b/node_modules/lodash/fp/defaults.js new file mode 100644 index 0000000..e1a8e6e --- /dev/null +++ b/node_modules/lodash/fp/defaults.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('defaults', require('../defaults')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/defaultsAll.js b/node_modules/lodash/fp/defaultsAll.js new file mode 100644 index 0000000..238fcc3 --- /dev/null +++ b/node_modules/lodash/fp/defaultsAll.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('defaultsAll', require('../defaults')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/defaultsDeep.js b/node_modules/lodash/fp/defaultsDeep.js new file mode 100644 index 0000000..1f172ff --- /dev/null +++ b/node_modules/lodash/fp/defaultsDeep.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('defaultsDeep', require('../defaultsDeep')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/defaultsDeepAll.js b/node_modules/lodash/fp/defaultsDeepAll.js new file mode 100644 index 0000000..6835f2f --- /dev/null +++ b/node_modules/lodash/fp/defaultsDeepAll.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('defaultsDeepAll', require('../defaultsDeep')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/defer.js b/node_modules/lodash/fp/defer.js new file mode 100644 index 0000000..ec7990f --- /dev/null +++ b/node_modules/lodash/fp/defer.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('defer', require('../defer'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/delay.js b/node_modules/lodash/fp/delay.js new file mode 100644 index 0000000..556dbd5 --- /dev/null +++ b/node_modules/lodash/fp/delay.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('delay', require('../delay')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/difference.js b/node_modules/lodash/fp/difference.js new file mode 100644 index 0000000..2d03765 --- /dev/null +++ b/node_modules/lodash/fp/difference.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('difference', require('../difference')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/differenceBy.js b/node_modules/lodash/fp/differenceBy.js new file mode 100644 index 0000000..2f91491 --- /dev/null +++ b/node_modules/lodash/fp/differenceBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('differenceBy', require('../differenceBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/differenceWith.js b/node_modules/lodash/fp/differenceWith.js new file mode 100644 index 0000000..bcf5ad2 --- /dev/null +++ b/node_modules/lodash/fp/differenceWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('differenceWith', require('../differenceWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/dissoc.js b/node_modules/lodash/fp/dissoc.js new file mode 100644 index 0000000..7ec7be1 --- /dev/null +++ b/node_modules/lodash/fp/dissoc.js @@ -0,0 +1 @@ +module.exports = require('./unset'); diff --git a/node_modules/lodash/fp/dissocPath.js b/node_modules/lodash/fp/dissocPath.js new file mode 100644 index 0000000..7ec7be1 --- /dev/null +++ b/node_modules/lodash/fp/dissocPath.js @@ -0,0 +1 @@ +module.exports = require('./unset'); diff --git a/node_modules/lodash/fp/divide.js b/node_modules/lodash/fp/divide.js new file mode 100644 index 0000000..82048c5 --- /dev/null +++ b/node_modules/lodash/fp/divide.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('divide', require('../divide')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/drop.js b/node_modules/lodash/fp/drop.js new file mode 100644 index 0000000..2fa9b4f --- /dev/null +++ b/node_modules/lodash/fp/drop.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('drop', require('../drop')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/dropLast.js b/node_modules/lodash/fp/dropLast.js new file mode 100644 index 0000000..174e525 --- /dev/null +++ b/node_modules/lodash/fp/dropLast.js @@ -0,0 +1 @@ +module.exports = require('./dropRight'); diff --git a/node_modules/lodash/fp/dropLastWhile.js b/node_modules/lodash/fp/dropLastWhile.js new file mode 100644 index 0000000..be2a9d2 --- /dev/null +++ b/node_modules/lodash/fp/dropLastWhile.js @@ -0,0 +1 @@ +module.exports = require('./dropRightWhile'); diff --git a/node_modules/lodash/fp/dropRight.js b/node_modules/lodash/fp/dropRight.js new file mode 100644 index 0000000..e98881f --- /dev/null +++ b/node_modules/lodash/fp/dropRight.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('dropRight', require('../dropRight')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/dropRightWhile.js b/node_modules/lodash/fp/dropRightWhile.js new file mode 100644 index 0000000..cacaa70 --- /dev/null +++ b/node_modules/lodash/fp/dropRightWhile.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('dropRightWhile', require('../dropRightWhile')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/dropWhile.js b/node_modules/lodash/fp/dropWhile.js new file mode 100644 index 0000000..285f864 --- /dev/null +++ b/node_modules/lodash/fp/dropWhile.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('dropWhile', require('../dropWhile')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/each.js b/node_modules/lodash/fp/each.js new file mode 100644 index 0000000..8800f42 --- /dev/null +++ b/node_modules/lodash/fp/each.js @@ -0,0 +1 @@ +module.exports = require('./forEach'); diff --git a/node_modules/lodash/fp/eachRight.js b/node_modules/lodash/fp/eachRight.js new file mode 100644 index 0000000..3252b2a --- /dev/null +++ b/node_modules/lodash/fp/eachRight.js @@ -0,0 +1 @@ +module.exports = require('./forEachRight'); diff --git a/node_modules/lodash/fp/endsWith.js b/node_modules/lodash/fp/endsWith.js new file mode 100644 index 0000000..17dc2a4 --- /dev/null +++ b/node_modules/lodash/fp/endsWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('endsWith', require('../endsWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/entries.js b/node_modules/lodash/fp/entries.js new file mode 100644 index 0000000..7a88df2 --- /dev/null +++ b/node_modules/lodash/fp/entries.js @@ -0,0 +1 @@ +module.exports = require('./toPairs'); diff --git a/node_modules/lodash/fp/entriesIn.js b/node_modules/lodash/fp/entriesIn.js new file mode 100644 index 0000000..f6c6331 --- /dev/null +++ b/node_modules/lodash/fp/entriesIn.js @@ -0,0 +1 @@ +module.exports = require('./toPairsIn'); diff --git a/node_modules/lodash/fp/eq.js b/node_modules/lodash/fp/eq.js new file mode 100644 index 0000000..9a3d21b --- /dev/null +++ b/node_modules/lodash/fp/eq.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('eq', require('../eq')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/equals.js b/node_modules/lodash/fp/equals.js new file mode 100644 index 0000000..e6a5ce0 --- /dev/null +++ b/node_modules/lodash/fp/equals.js @@ -0,0 +1 @@ +module.exports = require('./isEqual'); diff --git a/node_modules/lodash/fp/escape.js b/node_modules/lodash/fp/escape.js new file mode 100644 index 0000000..52c1fbb --- /dev/null +++ b/node_modules/lodash/fp/escape.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('escape', require('../escape'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/escapeRegExp.js b/node_modules/lodash/fp/escapeRegExp.js new file mode 100644 index 0000000..369b2ef --- /dev/null +++ b/node_modules/lodash/fp/escapeRegExp.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('escapeRegExp', require('../escapeRegExp'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/every.js b/node_modules/lodash/fp/every.js new file mode 100644 index 0000000..95c2776 --- /dev/null +++ b/node_modules/lodash/fp/every.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('every', require('../every')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/extend.js b/node_modules/lodash/fp/extend.js new file mode 100644 index 0000000..e00166c --- /dev/null +++ b/node_modules/lodash/fp/extend.js @@ -0,0 +1 @@ +module.exports = require('./assignIn'); diff --git a/node_modules/lodash/fp/extendAll.js b/node_modules/lodash/fp/extendAll.js new file mode 100644 index 0000000..cc55b64 --- /dev/null +++ b/node_modules/lodash/fp/extendAll.js @@ -0,0 +1 @@ +module.exports = require('./assignInAll'); diff --git a/node_modules/lodash/fp/extendAllWith.js b/node_modules/lodash/fp/extendAllWith.js new file mode 100644 index 0000000..6679d20 --- /dev/null +++ b/node_modules/lodash/fp/extendAllWith.js @@ -0,0 +1 @@ +module.exports = require('./assignInAllWith'); diff --git a/node_modules/lodash/fp/extendWith.js b/node_modules/lodash/fp/extendWith.js new file mode 100644 index 0000000..dbdcb3b --- /dev/null +++ b/node_modules/lodash/fp/extendWith.js @@ -0,0 +1 @@ +module.exports = require('./assignInWith'); diff --git a/node_modules/lodash/fp/fill.js b/node_modules/lodash/fp/fill.js new file mode 100644 index 0000000..b2d47e8 --- /dev/null +++ b/node_modules/lodash/fp/fill.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('fill', require('../fill')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/filter.js b/node_modules/lodash/fp/filter.js new file mode 100644 index 0000000..796d501 --- /dev/null +++ b/node_modules/lodash/fp/filter.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('filter', require('../filter')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/find.js b/node_modules/lodash/fp/find.js new file mode 100644 index 0000000..f805d33 --- /dev/null +++ b/node_modules/lodash/fp/find.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('find', require('../find')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/findFrom.js b/node_modules/lodash/fp/findFrom.js new file mode 100644 index 0000000..da8275e --- /dev/null +++ b/node_modules/lodash/fp/findFrom.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('findFrom', require('../find')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/findIndex.js b/node_modules/lodash/fp/findIndex.js new file mode 100644 index 0000000..8c15fd1 --- /dev/null +++ b/node_modules/lodash/fp/findIndex.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('findIndex', require('../findIndex')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/findIndexFrom.js b/node_modules/lodash/fp/findIndexFrom.js new file mode 100644 index 0000000..32e98cb --- /dev/null +++ b/node_modules/lodash/fp/findIndexFrom.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('findIndexFrom', require('../findIndex')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/findKey.js b/node_modules/lodash/fp/findKey.js new file mode 100644 index 0000000..475bcfa --- /dev/null +++ b/node_modules/lodash/fp/findKey.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('findKey', require('../findKey')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/findLast.js b/node_modules/lodash/fp/findLast.js new file mode 100644 index 0000000..093fe94 --- /dev/null +++ b/node_modules/lodash/fp/findLast.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('findLast', require('../findLast')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/findLastFrom.js b/node_modules/lodash/fp/findLastFrom.js new file mode 100644 index 0000000..76c38fb --- /dev/null +++ b/node_modules/lodash/fp/findLastFrom.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('findLastFrom', require('../findLast')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/findLastIndex.js b/node_modules/lodash/fp/findLastIndex.js new file mode 100644 index 0000000..36986df --- /dev/null +++ b/node_modules/lodash/fp/findLastIndex.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('findLastIndex', require('../findLastIndex')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/findLastIndexFrom.js b/node_modules/lodash/fp/findLastIndexFrom.js new file mode 100644 index 0000000..34c8176 --- /dev/null +++ b/node_modules/lodash/fp/findLastIndexFrom.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('findLastIndexFrom', require('../findLastIndex')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/findLastKey.js b/node_modules/lodash/fp/findLastKey.js new file mode 100644 index 0000000..5f81b60 --- /dev/null +++ b/node_modules/lodash/fp/findLastKey.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('findLastKey', require('../findLastKey')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/first.js b/node_modules/lodash/fp/first.js new file mode 100644 index 0000000..53f4ad1 --- /dev/null +++ b/node_modules/lodash/fp/first.js @@ -0,0 +1 @@ +module.exports = require('./head'); diff --git a/node_modules/lodash/fp/flatMap.js b/node_modules/lodash/fp/flatMap.js new file mode 100644 index 0000000..d01dc4d --- /dev/null +++ b/node_modules/lodash/fp/flatMap.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('flatMap', require('../flatMap')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/flatMapDeep.js b/node_modules/lodash/fp/flatMapDeep.js new file mode 100644 index 0000000..569c42e --- /dev/null +++ b/node_modules/lodash/fp/flatMapDeep.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('flatMapDeep', require('../flatMapDeep')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/flatMapDepth.js b/node_modules/lodash/fp/flatMapDepth.js new file mode 100644 index 0000000..6eb68fd --- /dev/null +++ b/node_modules/lodash/fp/flatMapDepth.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('flatMapDepth', require('../flatMapDepth')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/flatten.js b/node_modules/lodash/fp/flatten.js new file mode 100644 index 0000000..30425d8 --- /dev/null +++ b/node_modules/lodash/fp/flatten.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('flatten', require('../flatten'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/flattenDeep.js b/node_modules/lodash/fp/flattenDeep.js new file mode 100644 index 0000000..aed5db2 --- /dev/null +++ b/node_modules/lodash/fp/flattenDeep.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('flattenDeep', require('../flattenDeep'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/flattenDepth.js b/node_modules/lodash/fp/flattenDepth.js new file mode 100644 index 0000000..ad65e37 --- /dev/null +++ b/node_modules/lodash/fp/flattenDepth.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('flattenDepth', require('../flattenDepth')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/flip.js b/node_modules/lodash/fp/flip.js new file mode 100644 index 0000000..0547e7b --- /dev/null +++ b/node_modules/lodash/fp/flip.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('flip', require('../flip'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/floor.js b/node_modules/lodash/fp/floor.js new file mode 100644 index 0000000..a6cf335 --- /dev/null +++ b/node_modules/lodash/fp/floor.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('floor', require('../floor')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/flow.js b/node_modules/lodash/fp/flow.js new file mode 100644 index 0000000..cd83677 --- /dev/null +++ b/node_modules/lodash/fp/flow.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('flow', require('../flow')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/flowRight.js b/node_modules/lodash/fp/flowRight.js new file mode 100644 index 0000000..972a5b9 --- /dev/null +++ b/node_modules/lodash/fp/flowRight.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('flowRight', require('../flowRight')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/forEach.js b/node_modules/lodash/fp/forEach.js new file mode 100644 index 0000000..2f49452 --- /dev/null +++ b/node_modules/lodash/fp/forEach.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('forEach', require('../forEach')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/forEachRight.js b/node_modules/lodash/fp/forEachRight.js new file mode 100644 index 0000000..3ff9733 --- /dev/null +++ b/node_modules/lodash/fp/forEachRight.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('forEachRight', require('../forEachRight')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/forIn.js b/node_modules/lodash/fp/forIn.js new file mode 100644 index 0000000..9341749 --- /dev/null +++ b/node_modules/lodash/fp/forIn.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('forIn', require('../forIn')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/forInRight.js b/node_modules/lodash/fp/forInRight.js new file mode 100644 index 0000000..cecf8bb --- /dev/null +++ b/node_modules/lodash/fp/forInRight.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('forInRight', require('../forInRight')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/forOwn.js b/node_modules/lodash/fp/forOwn.js new file mode 100644 index 0000000..246449e --- /dev/null +++ b/node_modules/lodash/fp/forOwn.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('forOwn', require('../forOwn')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/forOwnRight.js b/node_modules/lodash/fp/forOwnRight.js new file mode 100644 index 0000000..c5e826e --- /dev/null +++ b/node_modules/lodash/fp/forOwnRight.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('forOwnRight', require('../forOwnRight')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/fromPairs.js b/node_modules/lodash/fp/fromPairs.js new file mode 100644 index 0000000..f8cc596 --- /dev/null +++ b/node_modules/lodash/fp/fromPairs.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('fromPairs', require('../fromPairs')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/function.js b/node_modules/lodash/fp/function.js new file mode 100644 index 0000000..dfe69b1 --- /dev/null +++ b/node_modules/lodash/fp/function.js @@ -0,0 +1,2 @@ +var convert = require('./convert'); +module.exports = convert(require('../function')); diff --git a/node_modules/lodash/fp/functions.js b/node_modules/lodash/fp/functions.js new file mode 100644 index 0000000..09d1bb1 --- /dev/null +++ b/node_modules/lodash/fp/functions.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('functions', require('../functions'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/functionsIn.js b/node_modules/lodash/fp/functionsIn.js new file mode 100644 index 0000000..2cfeb83 --- /dev/null +++ b/node_modules/lodash/fp/functionsIn.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('functionsIn', require('../functionsIn'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/get.js b/node_modules/lodash/fp/get.js new file mode 100644 index 0000000..6d3a328 --- /dev/null +++ b/node_modules/lodash/fp/get.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('get', require('../get')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/getOr.js b/node_modules/lodash/fp/getOr.js new file mode 100644 index 0000000..7dbf771 --- /dev/null +++ b/node_modules/lodash/fp/getOr.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('getOr', require('../get')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/groupBy.js b/node_modules/lodash/fp/groupBy.js new file mode 100644 index 0000000..fc0bc78 --- /dev/null +++ b/node_modules/lodash/fp/groupBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('groupBy', require('../groupBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/gt.js b/node_modules/lodash/fp/gt.js new file mode 100644 index 0000000..9e57c80 --- /dev/null +++ b/node_modules/lodash/fp/gt.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('gt', require('../gt')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/gte.js b/node_modules/lodash/fp/gte.js new file mode 100644 index 0000000..4584786 --- /dev/null +++ b/node_modules/lodash/fp/gte.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('gte', require('../gte')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/has.js b/node_modules/lodash/fp/has.js new file mode 100644 index 0000000..b901298 --- /dev/null +++ b/node_modules/lodash/fp/has.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('has', require('../has')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/hasIn.js b/node_modules/lodash/fp/hasIn.js new file mode 100644 index 0000000..b3c3d1a --- /dev/null +++ b/node_modules/lodash/fp/hasIn.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('hasIn', require('../hasIn')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/head.js b/node_modules/lodash/fp/head.js new file mode 100644 index 0000000..2694f0a --- /dev/null +++ b/node_modules/lodash/fp/head.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('head', require('../head'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/identical.js b/node_modules/lodash/fp/identical.js new file mode 100644 index 0000000..85563f4 --- /dev/null +++ b/node_modules/lodash/fp/identical.js @@ -0,0 +1 @@ +module.exports = require('./eq'); diff --git a/node_modules/lodash/fp/identity.js b/node_modules/lodash/fp/identity.js new file mode 100644 index 0000000..096415a --- /dev/null +++ b/node_modules/lodash/fp/identity.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('identity', require('../identity'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/inRange.js b/node_modules/lodash/fp/inRange.js new file mode 100644 index 0000000..202d940 --- /dev/null +++ b/node_modules/lodash/fp/inRange.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('inRange', require('../inRange')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/includes.js b/node_modules/lodash/fp/includes.js new file mode 100644 index 0000000..1146780 --- /dev/null +++ b/node_modules/lodash/fp/includes.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('includes', require('../includes')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/includesFrom.js b/node_modules/lodash/fp/includesFrom.js new file mode 100644 index 0000000..683afdb --- /dev/null +++ b/node_modules/lodash/fp/includesFrom.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('includesFrom', require('../includes')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/indexBy.js b/node_modules/lodash/fp/indexBy.js new file mode 100644 index 0000000..7e64bc0 --- /dev/null +++ b/node_modules/lodash/fp/indexBy.js @@ -0,0 +1 @@ +module.exports = require('./keyBy'); diff --git a/node_modules/lodash/fp/indexOf.js b/node_modules/lodash/fp/indexOf.js new file mode 100644 index 0000000..524658e --- /dev/null +++ b/node_modules/lodash/fp/indexOf.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('indexOf', require('../indexOf')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/indexOfFrom.js b/node_modules/lodash/fp/indexOfFrom.js new file mode 100644 index 0000000..d99c822 --- /dev/null +++ b/node_modules/lodash/fp/indexOfFrom.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('indexOfFrom', require('../indexOf')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/init.js b/node_modules/lodash/fp/init.js new file mode 100644 index 0000000..2f88d8b --- /dev/null +++ b/node_modules/lodash/fp/init.js @@ -0,0 +1 @@ +module.exports = require('./initial'); diff --git a/node_modules/lodash/fp/initial.js b/node_modules/lodash/fp/initial.js new file mode 100644 index 0000000..b732ba0 --- /dev/null +++ b/node_modules/lodash/fp/initial.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('initial', require('../initial'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/intersection.js b/node_modules/lodash/fp/intersection.js new file mode 100644 index 0000000..52936d5 --- /dev/null +++ b/node_modules/lodash/fp/intersection.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('intersection', require('../intersection')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/intersectionBy.js b/node_modules/lodash/fp/intersectionBy.js new file mode 100644 index 0000000..72629f2 --- /dev/null +++ b/node_modules/lodash/fp/intersectionBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('intersectionBy', require('../intersectionBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/intersectionWith.js b/node_modules/lodash/fp/intersectionWith.js new file mode 100644 index 0000000..e064f40 --- /dev/null +++ b/node_modules/lodash/fp/intersectionWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('intersectionWith', require('../intersectionWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/invert.js b/node_modules/lodash/fp/invert.js new file mode 100644 index 0000000..2d5d1f0 --- /dev/null +++ b/node_modules/lodash/fp/invert.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('invert', require('../invert')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/invertBy.js b/node_modules/lodash/fp/invertBy.js new file mode 100644 index 0000000..63ca97e --- /dev/null +++ b/node_modules/lodash/fp/invertBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('invertBy', require('../invertBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/invertObj.js b/node_modules/lodash/fp/invertObj.js new file mode 100644 index 0000000..f1d842e --- /dev/null +++ b/node_modules/lodash/fp/invertObj.js @@ -0,0 +1 @@ +module.exports = require('./invert'); diff --git a/node_modules/lodash/fp/invoke.js b/node_modules/lodash/fp/invoke.js new file mode 100644 index 0000000..fcf17f0 --- /dev/null +++ b/node_modules/lodash/fp/invoke.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('invoke', require('../invoke')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/invokeArgs.js b/node_modules/lodash/fp/invokeArgs.js new file mode 100644 index 0000000..d3f2953 --- /dev/null +++ b/node_modules/lodash/fp/invokeArgs.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('invokeArgs', require('../invoke')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/invokeArgsMap.js b/node_modules/lodash/fp/invokeArgsMap.js new file mode 100644 index 0000000..eaa9f84 --- /dev/null +++ b/node_modules/lodash/fp/invokeArgsMap.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('invokeArgsMap', require('../invokeMap')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/invokeMap.js b/node_modules/lodash/fp/invokeMap.js new file mode 100644 index 0000000..6515fd7 --- /dev/null +++ b/node_modules/lodash/fp/invokeMap.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('invokeMap', require('../invokeMap')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isArguments.js b/node_modules/lodash/fp/isArguments.js new file mode 100644 index 0000000..1d93c9e --- /dev/null +++ b/node_modules/lodash/fp/isArguments.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isArguments', require('../isArguments'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isArray.js b/node_modules/lodash/fp/isArray.js new file mode 100644 index 0000000..ba7ade8 --- /dev/null +++ b/node_modules/lodash/fp/isArray.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isArray', require('../isArray'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isArrayBuffer.js b/node_modules/lodash/fp/isArrayBuffer.js new file mode 100644 index 0000000..5088513 --- /dev/null +++ b/node_modules/lodash/fp/isArrayBuffer.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isArrayBuffer', require('../isArrayBuffer'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isArrayLike.js b/node_modules/lodash/fp/isArrayLike.js new file mode 100644 index 0000000..8f1856b --- /dev/null +++ b/node_modules/lodash/fp/isArrayLike.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isArrayLike', require('../isArrayLike'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isArrayLikeObject.js b/node_modules/lodash/fp/isArrayLikeObject.js new file mode 100644 index 0000000..2108498 --- /dev/null +++ b/node_modules/lodash/fp/isArrayLikeObject.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isArrayLikeObject', require('../isArrayLikeObject'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isBoolean.js b/node_modules/lodash/fp/isBoolean.js new file mode 100644 index 0000000..9339f75 --- /dev/null +++ b/node_modules/lodash/fp/isBoolean.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isBoolean', require('../isBoolean'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isBuffer.js b/node_modules/lodash/fp/isBuffer.js new file mode 100644 index 0000000..e60b123 --- /dev/null +++ b/node_modules/lodash/fp/isBuffer.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isBuffer', require('../isBuffer'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isDate.js b/node_modules/lodash/fp/isDate.js new file mode 100644 index 0000000..dc41d08 --- /dev/null +++ b/node_modules/lodash/fp/isDate.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isDate', require('../isDate'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isElement.js b/node_modules/lodash/fp/isElement.js new file mode 100644 index 0000000..18ee039 --- /dev/null +++ b/node_modules/lodash/fp/isElement.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isElement', require('../isElement'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isEmpty.js b/node_modules/lodash/fp/isEmpty.js new file mode 100644 index 0000000..0f4ae84 --- /dev/null +++ b/node_modules/lodash/fp/isEmpty.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isEmpty', require('../isEmpty'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isEqual.js b/node_modules/lodash/fp/isEqual.js new file mode 100644 index 0000000..4138386 --- /dev/null +++ b/node_modules/lodash/fp/isEqual.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isEqual', require('../isEqual')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isEqualWith.js b/node_modules/lodash/fp/isEqualWith.js new file mode 100644 index 0000000..029ff5c --- /dev/null +++ b/node_modules/lodash/fp/isEqualWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isEqualWith', require('../isEqualWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isError.js b/node_modules/lodash/fp/isError.js new file mode 100644 index 0000000..3dfd81c --- /dev/null +++ b/node_modules/lodash/fp/isError.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isError', require('../isError'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isFinite.js b/node_modules/lodash/fp/isFinite.js new file mode 100644 index 0000000..0b647b8 --- /dev/null +++ b/node_modules/lodash/fp/isFinite.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isFinite', require('../isFinite'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isFunction.js b/node_modules/lodash/fp/isFunction.js new file mode 100644 index 0000000..ff8e5c4 --- /dev/null +++ b/node_modules/lodash/fp/isFunction.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isFunction', require('../isFunction'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isInteger.js b/node_modules/lodash/fp/isInteger.js new file mode 100644 index 0000000..67af4ff --- /dev/null +++ b/node_modules/lodash/fp/isInteger.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isInteger', require('../isInteger'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isLength.js b/node_modules/lodash/fp/isLength.js new file mode 100644 index 0000000..fc101c5 --- /dev/null +++ b/node_modules/lodash/fp/isLength.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isLength', require('../isLength'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isMap.js b/node_modules/lodash/fp/isMap.js new file mode 100644 index 0000000..a209aa6 --- /dev/null +++ b/node_modules/lodash/fp/isMap.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isMap', require('../isMap'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isMatch.js b/node_modules/lodash/fp/isMatch.js new file mode 100644 index 0000000..6264ca1 --- /dev/null +++ b/node_modules/lodash/fp/isMatch.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isMatch', require('../isMatch')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isMatchWith.js b/node_modules/lodash/fp/isMatchWith.js new file mode 100644 index 0000000..d95f319 --- /dev/null +++ b/node_modules/lodash/fp/isMatchWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isMatchWith', require('../isMatchWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isNaN.js b/node_modules/lodash/fp/isNaN.js new file mode 100644 index 0000000..66a978f --- /dev/null +++ b/node_modules/lodash/fp/isNaN.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isNaN', require('../isNaN'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isNative.js b/node_modules/lodash/fp/isNative.js new file mode 100644 index 0000000..3d775ba --- /dev/null +++ b/node_modules/lodash/fp/isNative.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isNative', require('../isNative'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isNil.js b/node_modules/lodash/fp/isNil.js new file mode 100644 index 0000000..5952c02 --- /dev/null +++ b/node_modules/lodash/fp/isNil.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isNil', require('../isNil'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isNull.js b/node_modules/lodash/fp/isNull.js new file mode 100644 index 0000000..f201a35 --- /dev/null +++ b/node_modules/lodash/fp/isNull.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isNull', require('../isNull'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isNumber.js b/node_modules/lodash/fp/isNumber.js new file mode 100644 index 0000000..a2b5fa0 --- /dev/null +++ b/node_modules/lodash/fp/isNumber.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isNumber', require('../isNumber'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isObject.js b/node_modules/lodash/fp/isObject.js new file mode 100644 index 0000000..231ace0 --- /dev/null +++ b/node_modules/lodash/fp/isObject.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isObject', require('../isObject'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isObjectLike.js b/node_modules/lodash/fp/isObjectLike.js new file mode 100644 index 0000000..f16082e --- /dev/null +++ b/node_modules/lodash/fp/isObjectLike.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isObjectLike', require('../isObjectLike'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isPlainObject.js b/node_modules/lodash/fp/isPlainObject.js new file mode 100644 index 0000000..b5bea90 --- /dev/null +++ b/node_modules/lodash/fp/isPlainObject.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isPlainObject', require('../isPlainObject'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isRegExp.js b/node_modules/lodash/fp/isRegExp.js new file mode 100644 index 0000000..12a1a3d --- /dev/null +++ b/node_modules/lodash/fp/isRegExp.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isRegExp', require('../isRegExp'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isSafeInteger.js b/node_modules/lodash/fp/isSafeInteger.js new file mode 100644 index 0000000..7230f55 --- /dev/null +++ b/node_modules/lodash/fp/isSafeInteger.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isSafeInteger', require('../isSafeInteger'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isSet.js b/node_modules/lodash/fp/isSet.js new file mode 100644 index 0000000..35c01f6 --- /dev/null +++ b/node_modules/lodash/fp/isSet.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isSet', require('../isSet'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isString.js b/node_modules/lodash/fp/isString.js new file mode 100644 index 0000000..1fd0679 --- /dev/null +++ b/node_modules/lodash/fp/isString.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isString', require('../isString'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isSymbol.js b/node_modules/lodash/fp/isSymbol.js new file mode 100644 index 0000000..3867695 --- /dev/null +++ b/node_modules/lodash/fp/isSymbol.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isSymbol', require('../isSymbol'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isTypedArray.js b/node_modules/lodash/fp/isTypedArray.js new file mode 100644 index 0000000..8567953 --- /dev/null +++ b/node_modules/lodash/fp/isTypedArray.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isTypedArray', require('../isTypedArray'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isUndefined.js b/node_modules/lodash/fp/isUndefined.js new file mode 100644 index 0000000..ddbca31 --- /dev/null +++ b/node_modules/lodash/fp/isUndefined.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isUndefined', require('../isUndefined'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isWeakMap.js b/node_modules/lodash/fp/isWeakMap.js new file mode 100644 index 0000000..ef60c61 --- /dev/null +++ b/node_modules/lodash/fp/isWeakMap.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isWeakMap', require('../isWeakMap'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/isWeakSet.js b/node_modules/lodash/fp/isWeakSet.js new file mode 100644 index 0000000..c99bfaa --- /dev/null +++ b/node_modules/lodash/fp/isWeakSet.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isWeakSet', require('../isWeakSet'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/iteratee.js b/node_modules/lodash/fp/iteratee.js new file mode 100644 index 0000000..9f0f717 --- /dev/null +++ b/node_modules/lodash/fp/iteratee.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('iteratee', require('../iteratee')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/join.js b/node_modules/lodash/fp/join.js new file mode 100644 index 0000000..a220e00 --- /dev/null +++ b/node_modules/lodash/fp/join.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('join', require('../join')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/juxt.js b/node_modules/lodash/fp/juxt.js new file mode 100644 index 0000000..f71e04e --- /dev/null +++ b/node_modules/lodash/fp/juxt.js @@ -0,0 +1 @@ +module.exports = require('./over'); diff --git a/node_modules/lodash/fp/kebabCase.js b/node_modules/lodash/fp/kebabCase.js new file mode 100644 index 0000000..60737f1 --- /dev/null +++ b/node_modules/lodash/fp/kebabCase.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('kebabCase', require('../kebabCase'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/keyBy.js b/node_modules/lodash/fp/keyBy.js new file mode 100644 index 0000000..9a6a85d --- /dev/null +++ b/node_modules/lodash/fp/keyBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('keyBy', require('../keyBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/keys.js b/node_modules/lodash/fp/keys.js new file mode 100644 index 0000000..e12bb07 --- /dev/null +++ b/node_modules/lodash/fp/keys.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('keys', require('../keys'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/keysIn.js b/node_modules/lodash/fp/keysIn.js new file mode 100644 index 0000000..f3eb36a --- /dev/null +++ b/node_modules/lodash/fp/keysIn.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('keysIn', require('../keysIn'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/lang.js b/node_modules/lodash/fp/lang.js new file mode 100644 index 0000000..08cc9c1 --- /dev/null +++ b/node_modules/lodash/fp/lang.js @@ -0,0 +1,2 @@ +var convert = require('./convert'); +module.exports = convert(require('../lang')); diff --git a/node_modules/lodash/fp/last.js b/node_modules/lodash/fp/last.js new file mode 100644 index 0000000..0f71699 --- /dev/null +++ b/node_modules/lodash/fp/last.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('last', require('../last'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/lastIndexOf.js b/node_modules/lodash/fp/lastIndexOf.js new file mode 100644 index 0000000..ddf39c3 --- /dev/null +++ b/node_modules/lodash/fp/lastIndexOf.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('lastIndexOf', require('../lastIndexOf')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/lastIndexOfFrom.js b/node_modules/lodash/fp/lastIndexOfFrom.js new file mode 100644 index 0000000..1ff6a0b --- /dev/null +++ b/node_modules/lodash/fp/lastIndexOfFrom.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('lastIndexOfFrom', require('../lastIndexOf')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/lowerCase.js b/node_modules/lodash/fp/lowerCase.js new file mode 100644 index 0000000..ea64bc1 --- /dev/null +++ b/node_modules/lodash/fp/lowerCase.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('lowerCase', require('../lowerCase'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/lowerFirst.js b/node_modules/lodash/fp/lowerFirst.js new file mode 100644 index 0000000..539720a --- /dev/null +++ b/node_modules/lodash/fp/lowerFirst.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('lowerFirst', require('../lowerFirst'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/lt.js b/node_modules/lodash/fp/lt.js new file mode 100644 index 0000000..a31d21e --- /dev/null +++ b/node_modules/lodash/fp/lt.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('lt', require('../lt')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/lte.js b/node_modules/lodash/fp/lte.js new file mode 100644 index 0000000..d795d10 --- /dev/null +++ b/node_modules/lodash/fp/lte.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('lte', require('../lte')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/map.js b/node_modules/lodash/fp/map.js new file mode 100644 index 0000000..cf98794 --- /dev/null +++ b/node_modules/lodash/fp/map.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('map', require('../map')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/mapKeys.js b/node_modules/lodash/fp/mapKeys.js new file mode 100644 index 0000000..1684587 --- /dev/null +++ b/node_modules/lodash/fp/mapKeys.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('mapKeys', require('../mapKeys')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/mapValues.js b/node_modules/lodash/fp/mapValues.js new file mode 100644 index 0000000..4004972 --- /dev/null +++ b/node_modules/lodash/fp/mapValues.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('mapValues', require('../mapValues')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/matches.js b/node_modules/lodash/fp/matches.js new file mode 100644 index 0000000..29d1e1e --- /dev/null +++ b/node_modules/lodash/fp/matches.js @@ -0,0 +1 @@ +module.exports = require('./isMatch'); diff --git a/node_modules/lodash/fp/matchesProperty.js b/node_modules/lodash/fp/matchesProperty.js new file mode 100644 index 0000000..4575bd2 --- /dev/null +++ b/node_modules/lodash/fp/matchesProperty.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('matchesProperty', require('../matchesProperty')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/math.js b/node_modules/lodash/fp/math.js new file mode 100644 index 0000000..e8f50f7 --- /dev/null +++ b/node_modules/lodash/fp/math.js @@ -0,0 +1,2 @@ +var convert = require('./convert'); +module.exports = convert(require('../math')); diff --git a/node_modules/lodash/fp/max.js b/node_modules/lodash/fp/max.js new file mode 100644 index 0000000..a66acac --- /dev/null +++ b/node_modules/lodash/fp/max.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('max', require('../max'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/maxBy.js b/node_modules/lodash/fp/maxBy.js new file mode 100644 index 0000000..d083fd6 --- /dev/null +++ b/node_modules/lodash/fp/maxBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('maxBy', require('../maxBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/mean.js b/node_modules/lodash/fp/mean.js new file mode 100644 index 0000000..3117246 --- /dev/null +++ b/node_modules/lodash/fp/mean.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('mean', require('../mean'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/meanBy.js b/node_modules/lodash/fp/meanBy.js new file mode 100644 index 0000000..556f25e --- /dev/null +++ b/node_modules/lodash/fp/meanBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('meanBy', require('../meanBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/memoize.js b/node_modules/lodash/fp/memoize.js new file mode 100644 index 0000000..638eec6 --- /dev/null +++ b/node_modules/lodash/fp/memoize.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('memoize', require('../memoize')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/merge.js b/node_modules/lodash/fp/merge.js new file mode 100644 index 0000000..ac66add --- /dev/null +++ b/node_modules/lodash/fp/merge.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('merge', require('../merge')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/mergeAll.js b/node_modules/lodash/fp/mergeAll.js new file mode 100644 index 0000000..a3674d6 --- /dev/null +++ b/node_modules/lodash/fp/mergeAll.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('mergeAll', require('../merge')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/mergeAllWith.js b/node_modules/lodash/fp/mergeAllWith.js new file mode 100644 index 0000000..4bd4206 --- /dev/null +++ b/node_modules/lodash/fp/mergeAllWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('mergeAllWith', require('../mergeWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/mergeWith.js b/node_modules/lodash/fp/mergeWith.js new file mode 100644 index 0000000..00d44d5 --- /dev/null +++ b/node_modules/lodash/fp/mergeWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('mergeWith', require('../mergeWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/method.js b/node_modules/lodash/fp/method.js new file mode 100644 index 0000000..f4060c6 --- /dev/null +++ b/node_modules/lodash/fp/method.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('method', require('../method')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/methodOf.js b/node_modules/lodash/fp/methodOf.js new file mode 100644 index 0000000..6139905 --- /dev/null +++ b/node_modules/lodash/fp/methodOf.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('methodOf', require('../methodOf')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/min.js b/node_modules/lodash/fp/min.js new file mode 100644 index 0000000..d12c6b4 --- /dev/null +++ b/node_modules/lodash/fp/min.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('min', require('../min'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/minBy.js b/node_modules/lodash/fp/minBy.js new file mode 100644 index 0000000..fdb9e24 --- /dev/null +++ b/node_modules/lodash/fp/minBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('minBy', require('../minBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/mixin.js b/node_modules/lodash/fp/mixin.js new file mode 100644 index 0000000..332e6fb --- /dev/null +++ b/node_modules/lodash/fp/mixin.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('mixin', require('../mixin')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/multiply.js b/node_modules/lodash/fp/multiply.js new file mode 100644 index 0000000..4dcf0b0 --- /dev/null +++ b/node_modules/lodash/fp/multiply.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('multiply', require('../multiply')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/nAry.js b/node_modules/lodash/fp/nAry.js new file mode 100644 index 0000000..f262a76 --- /dev/null +++ b/node_modules/lodash/fp/nAry.js @@ -0,0 +1 @@ +module.exports = require('./ary'); diff --git a/node_modules/lodash/fp/negate.js b/node_modules/lodash/fp/negate.js new file mode 100644 index 0000000..8b6dc7c --- /dev/null +++ b/node_modules/lodash/fp/negate.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('negate', require('../negate'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/next.js b/node_modules/lodash/fp/next.js new file mode 100644 index 0000000..140155e --- /dev/null +++ b/node_modules/lodash/fp/next.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('next', require('../next'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/noop.js b/node_modules/lodash/fp/noop.js new file mode 100644 index 0000000..b9e32cc --- /dev/null +++ b/node_modules/lodash/fp/noop.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('noop', require('../noop'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/now.js b/node_modules/lodash/fp/now.js new file mode 100644 index 0000000..6de2068 --- /dev/null +++ b/node_modules/lodash/fp/now.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('now', require('../now'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/nth.js b/node_modules/lodash/fp/nth.js new file mode 100644 index 0000000..da4fda7 --- /dev/null +++ b/node_modules/lodash/fp/nth.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('nth', require('../nth')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/nthArg.js b/node_modules/lodash/fp/nthArg.js new file mode 100644 index 0000000..fce3165 --- /dev/null +++ b/node_modules/lodash/fp/nthArg.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('nthArg', require('../nthArg')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/number.js b/node_modules/lodash/fp/number.js new file mode 100644 index 0000000..5c10b88 --- /dev/null +++ b/node_modules/lodash/fp/number.js @@ -0,0 +1,2 @@ +var convert = require('./convert'); +module.exports = convert(require('../number')); diff --git a/node_modules/lodash/fp/object.js b/node_modules/lodash/fp/object.js new file mode 100644 index 0000000..ae39a13 --- /dev/null +++ b/node_modules/lodash/fp/object.js @@ -0,0 +1,2 @@ +var convert = require('./convert'); +module.exports = convert(require('../object')); diff --git a/node_modules/lodash/fp/omit.js b/node_modules/lodash/fp/omit.js new file mode 100644 index 0000000..fd68529 --- /dev/null +++ b/node_modules/lodash/fp/omit.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('omit', require('../omit')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/omitAll.js b/node_modules/lodash/fp/omitAll.js new file mode 100644 index 0000000..144cf4b --- /dev/null +++ b/node_modules/lodash/fp/omitAll.js @@ -0,0 +1 @@ +module.exports = require('./omit'); diff --git a/node_modules/lodash/fp/omitBy.js b/node_modules/lodash/fp/omitBy.js new file mode 100644 index 0000000..90df738 --- /dev/null +++ b/node_modules/lodash/fp/omitBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('omitBy', require('../omitBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/once.js b/node_modules/lodash/fp/once.js new file mode 100644 index 0000000..f8f0a5c --- /dev/null +++ b/node_modules/lodash/fp/once.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('once', require('../once'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/orderBy.js b/node_modules/lodash/fp/orderBy.js new file mode 100644 index 0000000..848e210 --- /dev/null +++ b/node_modules/lodash/fp/orderBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('orderBy', require('../orderBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/over.js b/node_modules/lodash/fp/over.js new file mode 100644 index 0000000..01eba7b --- /dev/null +++ b/node_modules/lodash/fp/over.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('over', require('../over')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/overArgs.js b/node_modules/lodash/fp/overArgs.js new file mode 100644 index 0000000..738556f --- /dev/null +++ b/node_modules/lodash/fp/overArgs.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('overArgs', require('../overArgs')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/overEvery.js b/node_modules/lodash/fp/overEvery.js new file mode 100644 index 0000000..9f5a032 --- /dev/null +++ b/node_modules/lodash/fp/overEvery.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('overEvery', require('../overEvery')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/overSome.js b/node_modules/lodash/fp/overSome.js new file mode 100644 index 0000000..15939d5 --- /dev/null +++ b/node_modules/lodash/fp/overSome.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('overSome', require('../overSome')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/pad.js b/node_modules/lodash/fp/pad.js new file mode 100644 index 0000000..f1dea4a --- /dev/null +++ b/node_modules/lodash/fp/pad.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('pad', require('../pad')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/padChars.js b/node_modules/lodash/fp/padChars.js new file mode 100644 index 0000000..d6e0804 --- /dev/null +++ b/node_modules/lodash/fp/padChars.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('padChars', require('../pad')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/padCharsEnd.js b/node_modules/lodash/fp/padCharsEnd.js new file mode 100644 index 0000000..d4ab79a --- /dev/null +++ b/node_modules/lodash/fp/padCharsEnd.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('padCharsEnd', require('../padEnd')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/padCharsStart.js b/node_modules/lodash/fp/padCharsStart.js new file mode 100644 index 0000000..a08a300 --- /dev/null +++ b/node_modules/lodash/fp/padCharsStart.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('padCharsStart', require('../padStart')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/padEnd.js b/node_modules/lodash/fp/padEnd.js new file mode 100644 index 0000000..a8522ec --- /dev/null +++ b/node_modules/lodash/fp/padEnd.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('padEnd', require('../padEnd')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/padStart.js b/node_modules/lodash/fp/padStart.js new file mode 100644 index 0000000..f4ca79d --- /dev/null +++ b/node_modules/lodash/fp/padStart.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('padStart', require('../padStart')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/parseInt.js b/node_modules/lodash/fp/parseInt.js new file mode 100644 index 0000000..27314cc --- /dev/null +++ b/node_modules/lodash/fp/parseInt.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('parseInt', require('../parseInt')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/partial.js b/node_modules/lodash/fp/partial.js new file mode 100644 index 0000000..5d46015 --- /dev/null +++ b/node_modules/lodash/fp/partial.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('partial', require('../partial')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/partialRight.js b/node_modules/lodash/fp/partialRight.js new file mode 100644 index 0000000..7f05fed --- /dev/null +++ b/node_modules/lodash/fp/partialRight.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('partialRight', require('../partialRight')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/partition.js b/node_modules/lodash/fp/partition.js new file mode 100644 index 0000000..2ebcacc --- /dev/null +++ b/node_modules/lodash/fp/partition.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('partition', require('../partition')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/path.js b/node_modules/lodash/fp/path.js new file mode 100644 index 0000000..b29cfb2 --- /dev/null +++ b/node_modules/lodash/fp/path.js @@ -0,0 +1 @@ +module.exports = require('./get'); diff --git a/node_modules/lodash/fp/pathEq.js b/node_modules/lodash/fp/pathEq.js new file mode 100644 index 0000000..36c027a --- /dev/null +++ b/node_modules/lodash/fp/pathEq.js @@ -0,0 +1 @@ +module.exports = require('./matchesProperty'); diff --git a/node_modules/lodash/fp/pathOr.js b/node_modules/lodash/fp/pathOr.js new file mode 100644 index 0000000..4ab5820 --- /dev/null +++ b/node_modules/lodash/fp/pathOr.js @@ -0,0 +1 @@ +module.exports = require('./getOr'); diff --git a/node_modules/lodash/fp/paths.js b/node_modules/lodash/fp/paths.js new file mode 100644 index 0000000..1eb7950 --- /dev/null +++ b/node_modules/lodash/fp/paths.js @@ -0,0 +1 @@ +module.exports = require('./at'); diff --git a/node_modules/lodash/fp/pick.js b/node_modules/lodash/fp/pick.js new file mode 100644 index 0000000..197393d --- /dev/null +++ b/node_modules/lodash/fp/pick.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('pick', require('../pick')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/pickAll.js b/node_modules/lodash/fp/pickAll.js new file mode 100644 index 0000000..a8ecd46 --- /dev/null +++ b/node_modules/lodash/fp/pickAll.js @@ -0,0 +1 @@ +module.exports = require('./pick'); diff --git a/node_modules/lodash/fp/pickBy.js b/node_modules/lodash/fp/pickBy.js new file mode 100644 index 0000000..d832d16 --- /dev/null +++ b/node_modules/lodash/fp/pickBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('pickBy', require('../pickBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/pipe.js b/node_modules/lodash/fp/pipe.js new file mode 100644 index 0000000..b2e1e2c --- /dev/null +++ b/node_modules/lodash/fp/pipe.js @@ -0,0 +1 @@ +module.exports = require('./flow'); diff --git a/node_modules/lodash/fp/placeholder.js b/node_modules/lodash/fp/placeholder.js new file mode 100644 index 0000000..1ce1739 --- /dev/null +++ b/node_modules/lodash/fp/placeholder.js @@ -0,0 +1,6 @@ +/** + * The default argument placeholder value for methods. + * + * @type {Object} + */ +module.exports = {}; diff --git a/node_modules/lodash/fp/plant.js b/node_modules/lodash/fp/plant.js new file mode 100644 index 0000000..eca8f32 --- /dev/null +++ b/node_modules/lodash/fp/plant.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('plant', require('../plant'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/pluck.js b/node_modules/lodash/fp/pluck.js new file mode 100644 index 0000000..0d1e1ab --- /dev/null +++ b/node_modules/lodash/fp/pluck.js @@ -0,0 +1 @@ +module.exports = require('./map'); diff --git a/node_modules/lodash/fp/prop.js b/node_modules/lodash/fp/prop.js new file mode 100644 index 0000000..b29cfb2 --- /dev/null +++ b/node_modules/lodash/fp/prop.js @@ -0,0 +1 @@ +module.exports = require('./get'); diff --git a/node_modules/lodash/fp/propEq.js b/node_modules/lodash/fp/propEq.js new file mode 100644 index 0000000..36c027a --- /dev/null +++ b/node_modules/lodash/fp/propEq.js @@ -0,0 +1 @@ +module.exports = require('./matchesProperty'); diff --git a/node_modules/lodash/fp/propOr.js b/node_modules/lodash/fp/propOr.js new file mode 100644 index 0000000..4ab5820 --- /dev/null +++ b/node_modules/lodash/fp/propOr.js @@ -0,0 +1 @@ +module.exports = require('./getOr'); diff --git a/node_modules/lodash/fp/property.js b/node_modules/lodash/fp/property.js new file mode 100644 index 0000000..b29cfb2 --- /dev/null +++ b/node_modules/lodash/fp/property.js @@ -0,0 +1 @@ +module.exports = require('./get'); diff --git a/node_modules/lodash/fp/propertyOf.js b/node_modules/lodash/fp/propertyOf.js new file mode 100644 index 0000000..f6273ee --- /dev/null +++ b/node_modules/lodash/fp/propertyOf.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('propertyOf', require('../get')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/props.js b/node_modules/lodash/fp/props.js new file mode 100644 index 0000000..1eb7950 --- /dev/null +++ b/node_modules/lodash/fp/props.js @@ -0,0 +1 @@ +module.exports = require('./at'); diff --git a/node_modules/lodash/fp/pull.js b/node_modules/lodash/fp/pull.js new file mode 100644 index 0000000..8d7084f --- /dev/null +++ b/node_modules/lodash/fp/pull.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('pull', require('../pull')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/pullAll.js b/node_modules/lodash/fp/pullAll.js new file mode 100644 index 0000000..98d5c9a --- /dev/null +++ b/node_modules/lodash/fp/pullAll.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('pullAll', require('../pullAll')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/pullAllBy.js b/node_modules/lodash/fp/pullAllBy.js new file mode 100644 index 0000000..876bc3b --- /dev/null +++ b/node_modules/lodash/fp/pullAllBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('pullAllBy', require('../pullAllBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/pullAllWith.js b/node_modules/lodash/fp/pullAllWith.js new file mode 100644 index 0000000..f71ba4d --- /dev/null +++ b/node_modules/lodash/fp/pullAllWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('pullAllWith', require('../pullAllWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/pullAt.js b/node_modules/lodash/fp/pullAt.js new file mode 100644 index 0000000..e8b3bb6 --- /dev/null +++ b/node_modules/lodash/fp/pullAt.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('pullAt', require('../pullAt')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/random.js b/node_modules/lodash/fp/random.js new file mode 100644 index 0000000..99d852e --- /dev/null +++ b/node_modules/lodash/fp/random.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('random', require('../random')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/range.js b/node_modules/lodash/fp/range.js new file mode 100644 index 0000000..a6bb591 --- /dev/null +++ b/node_modules/lodash/fp/range.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('range', require('../range')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/rangeRight.js b/node_modules/lodash/fp/rangeRight.js new file mode 100644 index 0000000..fdb712f --- /dev/null +++ b/node_modules/lodash/fp/rangeRight.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('rangeRight', require('../rangeRight')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/rangeStep.js b/node_modules/lodash/fp/rangeStep.js new file mode 100644 index 0000000..d72dfc2 --- /dev/null +++ b/node_modules/lodash/fp/rangeStep.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('rangeStep', require('../range')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/rangeStepRight.js b/node_modules/lodash/fp/rangeStepRight.js new file mode 100644 index 0000000..8b2a67b --- /dev/null +++ b/node_modules/lodash/fp/rangeStepRight.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('rangeStepRight', require('../rangeRight')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/rearg.js b/node_modules/lodash/fp/rearg.js new file mode 100644 index 0000000..678e02a --- /dev/null +++ b/node_modules/lodash/fp/rearg.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('rearg', require('../rearg')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/reduce.js b/node_modules/lodash/fp/reduce.js new file mode 100644 index 0000000..4cef0a0 --- /dev/null +++ b/node_modules/lodash/fp/reduce.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('reduce', require('../reduce')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/reduceRight.js b/node_modules/lodash/fp/reduceRight.js new file mode 100644 index 0000000..caf5bb5 --- /dev/null +++ b/node_modules/lodash/fp/reduceRight.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('reduceRight', require('../reduceRight')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/reject.js b/node_modules/lodash/fp/reject.js new file mode 100644 index 0000000..c163273 --- /dev/null +++ b/node_modules/lodash/fp/reject.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('reject', require('../reject')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/remove.js b/node_modules/lodash/fp/remove.js new file mode 100644 index 0000000..e9d1327 --- /dev/null +++ b/node_modules/lodash/fp/remove.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('remove', require('../remove')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/repeat.js b/node_modules/lodash/fp/repeat.js new file mode 100644 index 0000000..08470f2 --- /dev/null +++ b/node_modules/lodash/fp/repeat.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('repeat', require('../repeat')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/replace.js b/node_modules/lodash/fp/replace.js new file mode 100644 index 0000000..2227db6 --- /dev/null +++ b/node_modules/lodash/fp/replace.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('replace', require('../replace')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/rest.js b/node_modules/lodash/fp/rest.js new file mode 100644 index 0000000..c1f3d64 --- /dev/null +++ b/node_modules/lodash/fp/rest.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('rest', require('../rest')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/restFrom.js b/node_modules/lodash/fp/restFrom.js new file mode 100644 index 0000000..714e42b --- /dev/null +++ b/node_modules/lodash/fp/restFrom.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('restFrom', require('../rest')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/result.js b/node_modules/lodash/fp/result.js new file mode 100644 index 0000000..f86ce07 --- /dev/null +++ b/node_modules/lodash/fp/result.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('result', require('../result')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/reverse.js b/node_modules/lodash/fp/reverse.js new file mode 100644 index 0000000..07c9f5e --- /dev/null +++ b/node_modules/lodash/fp/reverse.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('reverse', require('../reverse')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/round.js b/node_modules/lodash/fp/round.js new file mode 100644 index 0000000..4c0e5c8 --- /dev/null +++ b/node_modules/lodash/fp/round.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('round', require('../round')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/sample.js b/node_modules/lodash/fp/sample.js new file mode 100644 index 0000000..6bea125 --- /dev/null +++ b/node_modules/lodash/fp/sample.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('sample', require('../sample'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/sampleSize.js b/node_modules/lodash/fp/sampleSize.js new file mode 100644 index 0000000..359ed6f --- /dev/null +++ b/node_modules/lodash/fp/sampleSize.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('sampleSize', require('../sampleSize')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/seq.js b/node_modules/lodash/fp/seq.js new file mode 100644 index 0000000..d8f42b0 --- /dev/null +++ b/node_modules/lodash/fp/seq.js @@ -0,0 +1,2 @@ +var convert = require('./convert'); +module.exports = convert(require('../seq')); diff --git a/node_modules/lodash/fp/set.js b/node_modules/lodash/fp/set.js new file mode 100644 index 0000000..0b56a56 --- /dev/null +++ b/node_modules/lodash/fp/set.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('set', require('../set')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/setWith.js b/node_modules/lodash/fp/setWith.js new file mode 100644 index 0000000..0b58495 --- /dev/null +++ b/node_modules/lodash/fp/setWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('setWith', require('../setWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/shuffle.js b/node_modules/lodash/fp/shuffle.js new file mode 100644 index 0000000..aa3a1ca --- /dev/null +++ b/node_modules/lodash/fp/shuffle.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('shuffle', require('../shuffle'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/size.js b/node_modules/lodash/fp/size.js new file mode 100644 index 0000000..7490136 --- /dev/null +++ b/node_modules/lodash/fp/size.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('size', require('../size'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/slice.js b/node_modules/lodash/fp/slice.js new file mode 100644 index 0000000..15945d3 --- /dev/null +++ b/node_modules/lodash/fp/slice.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('slice', require('../slice')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/snakeCase.js b/node_modules/lodash/fp/snakeCase.js new file mode 100644 index 0000000..a0ff780 --- /dev/null +++ b/node_modules/lodash/fp/snakeCase.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('snakeCase', require('../snakeCase'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/some.js b/node_modules/lodash/fp/some.js new file mode 100644 index 0000000..a4fa2d0 --- /dev/null +++ b/node_modules/lodash/fp/some.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('some', require('../some')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/sortBy.js b/node_modules/lodash/fp/sortBy.js new file mode 100644 index 0000000..e0790ad --- /dev/null +++ b/node_modules/lodash/fp/sortBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('sortBy', require('../sortBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/sortedIndex.js b/node_modules/lodash/fp/sortedIndex.js new file mode 100644 index 0000000..364a054 --- /dev/null +++ b/node_modules/lodash/fp/sortedIndex.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('sortedIndex', require('../sortedIndex')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/sortedIndexBy.js b/node_modules/lodash/fp/sortedIndexBy.js new file mode 100644 index 0000000..9593dbd --- /dev/null +++ b/node_modules/lodash/fp/sortedIndexBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('sortedIndexBy', require('../sortedIndexBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/sortedIndexOf.js b/node_modules/lodash/fp/sortedIndexOf.js new file mode 100644 index 0000000..c9084ca --- /dev/null +++ b/node_modules/lodash/fp/sortedIndexOf.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('sortedIndexOf', require('../sortedIndexOf')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/sortedLastIndex.js b/node_modules/lodash/fp/sortedLastIndex.js new file mode 100644 index 0000000..47fe241 --- /dev/null +++ b/node_modules/lodash/fp/sortedLastIndex.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('sortedLastIndex', require('../sortedLastIndex')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/sortedLastIndexBy.js b/node_modules/lodash/fp/sortedLastIndexBy.js new file mode 100644 index 0000000..0f9a347 --- /dev/null +++ b/node_modules/lodash/fp/sortedLastIndexBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('sortedLastIndexBy', require('../sortedLastIndexBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/sortedLastIndexOf.js b/node_modules/lodash/fp/sortedLastIndexOf.js new file mode 100644 index 0000000..0d4d932 --- /dev/null +++ b/node_modules/lodash/fp/sortedLastIndexOf.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('sortedLastIndexOf', require('../sortedLastIndexOf')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/sortedUniq.js b/node_modules/lodash/fp/sortedUniq.js new file mode 100644 index 0000000..882d283 --- /dev/null +++ b/node_modules/lodash/fp/sortedUniq.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('sortedUniq', require('../sortedUniq'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/sortedUniqBy.js b/node_modules/lodash/fp/sortedUniqBy.js new file mode 100644 index 0000000..033db91 --- /dev/null +++ b/node_modules/lodash/fp/sortedUniqBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('sortedUniqBy', require('../sortedUniqBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/split.js b/node_modules/lodash/fp/split.js new file mode 100644 index 0000000..14de1a7 --- /dev/null +++ b/node_modules/lodash/fp/split.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('split', require('../split')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/spread.js b/node_modules/lodash/fp/spread.js new file mode 100644 index 0000000..2d11b70 --- /dev/null +++ b/node_modules/lodash/fp/spread.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('spread', require('../spread')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/spreadFrom.js b/node_modules/lodash/fp/spreadFrom.js new file mode 100644 index 0000000..0b630df --- /dev/null +++ b/node_modules/lodash/fp/spreadFrom.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('spreadFrom', require('../spread')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/startCase.js b/node_modules/lodash/fp/startCase.js new file mode 100644 index 0000000..ada98c9 --- /dev/null +++ b/node_modules/lodash/fp/startCase.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('startCase', require('../startCase'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/startsWith.js b/node_modules/lodash/fp/startsWith.js new file mode 100644 index 0000000..985e2f2 --- /dev/null +++ b/node_modules/lodash/fp/startsWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('startsWith', require('../startsWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/string.js b/node_modules/lodash/fp/string.js new file mode 100644 index 0000000..773b037 --- /dev/null +++ b/node_modules/lodash/fp/string.js @@ -0,0 +1,2 @@ +var convert = require('./convert'); +module.exports = convert(require('../string')); diff --git a/node_modules/lodash/fp/stubArray.js b/node_modules/lodash/fp/stubArray.js new file mode 100644 index 0000000..cd604cb --- /dev/null +++ b/node_modules/lodash/fp/stubArray.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('stubArray', require('../stubArray'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/stubFalse.js b/node_modules/lodash/fp/stubFalse.js new file mode 100644 index 0000000..3296664 --- /dev/null +++ b/node_modules/lodash/fp/stubFalse.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('stubFalse', require('../stubFalse'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/stubObject.js b/node_modules/lodash/fp/stubObject.js new file mode 100644 index 0000000..c6c8ec4 --- /dev/null +++ b/node_modules/lodash/fp/stubObject.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('stubObject', require('../stubObject'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/stubString.js b/node_modules/lodash/fp/stubString.js new file mode 100644 index 0000000..701051e --- /dev/null +++ b/node_modules/lodash/fp/stubString.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('stubString', require('../stubString'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/stubTrue.js b/node_modules/lodash/fp/stubTrue.js new file mode 100644 index 0000000..9249082 --- /dev/null +++ b/node_modules/lodash/fp/stubTrue.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('stubTrue', require('../stubTrue'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/subtract.js b/node_modules/lodash/fp/subtract.js new file mode 100644 index 0000000..d32b16d --- /dev/null +++ b/node_modules/lodash/fp/subtract.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('subtract', require('../subtract')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/sum.js b/node_modules/lodash/fp/sum.js new file mode 100644 index 0000000..5cce12b --- /dev/null +++ b/node_modules/lodash/fp/sum.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('sum', require('../sum'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/sumBy.js b/node_modules/lodash/fp/sumBy.js new file mode 100644 index 0000000..c882656 --- /dev/null +++ b/node_modules/lodash/fp/sumBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('sumBy', require('../sumBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/symmetricDifference.js b/node_modules/lodash/fp/symmetricDifference.js new file mode 100644 index 0000000..78c16ad --- /dev/null +++ b/node_modules/lodash/fp/symmetricDifference.js @@ -0,0 +1 @@ +module.exports = require('./xor'); diff --git a/node_modules/lodash/fp/symmetricDifferenceBy.js b/node_modules/lodash/fp/symmetricDifferenceBy.js new file mode 100644 index 0000000..298fc7f --- /dev/null +++ b/node_modules/lodash/fp/symmetricDifferenceBy.js @@ -0,0 +1 @@ +module.exports = require('./xorBy'); diff --git a/node_modules/lodash/fp/symmetricDifferenceWith.js b/node_modules/lodash/fp/symmetricDifferenceWith.js new file mode 100644 index 0000000..70bc6fa --- /dev/null +++ b/node_modules/lodash/fp/symmetricDifferenceWith.js @@ -0,0 +1 @@ +module.exports = require('./xorWith'); diff --git a/node_modules/lodash/fp/tail.js b/node_modules/lodash/fp/tail.js new file mode 100644 index 0000000..f122f0a --- /dev/null +++ b/node_modules/lodash/fp/tail.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('tail', require('../tail'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/take.js b/node_modules/lodash/fp/take.js new file mode 100644 index 0000000..9af98a7 --- /dev/null +++ b/node_modules/lodash/fp/take.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('take', require('../take')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/takeLast.js b/node_modules/lodash/fp/takeLast.js new file mode 100644 index 0000000..e98c84a --- /dev/null +++ b/node_modules/lodash/fp/takeLast.js @@ -0,0 +1 @@ +module.exports = require('./takeRight'); diff --git a/node_modules/lodash/fp/takeLastWhile.js b/node_modules/lodash/fp/takeLastWhile.js new file mode 100644 index 0000000..5367968 --- /dev/null +++ b/node_modules/lodash/fp/takeLastWhile.js @@ -0,0 +1 @@ +module.exports = require('./takeRightWhile'); diff --git a/node_modules/lodash/fp/takeRight.js b/node_modules/lodash/fp/takeRight.js new file mode 100644 index 0000000..b82950a --- /dev/null +++ b/node_modules/lodash/fp/takeRight.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('takeRight', require('../takeRight')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/takeRightWhile.js b/node_modules/lodash/fp/takeRightWhile.js new file mode 100644 index 0000000..8ffb0a2 --- /dev/null +++ b/node_modules/lodash/fp/takeRightWhile.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('takeRightWhile', require('../takeRightWhile')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/takeWhile.js b/node_modules/lodash/fp/takeWhile.js new file mode 100644 index 0000000..2813664 --- /dev/null +++ b/node_modules/lodash/fp/takeWhile.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('takeWhile', require('../takeWhile')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/tap.js b/node_modules/lodash/fp/tap.js new file mode 100644 index 0000000..d33ad6e --- /dev/null +++ b/node_modules/lodash/fp/tap.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('tap', require('../tap')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/template.js b/node_modules/lodash/fp/template.js new file mode 100644 index 0000000..74857e1 --- /dev/null +++ b/node_modules/lodash/fp/template.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('template', require('../template')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/templateSettings.js b/node_modules/lodash/fp/templateSettings.js new file mode 100644 index 0000000..7bcc0a8 --- /dev/null +++ b/node_modules/lodash/fp/templateSettings.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('templateSettings', require('../templateSettings'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/throttle.js b/node_modules/lodash/fp/throttle.js new file mode 100644 index 0000000..77fff14 --- /dev/null +++ b/node_modules/lodash/fp/throttle.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('throttle', require('../throttle')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/thru.js b/node_modules/lodash/fp/thru.js new file mode 100644 index 0000000..d42b3b1 --- /dev/null +++ b/node_modules/lodash/fp/thru.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('thru', require('../thru')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/times.js b/node_modules/lodash/fp/times.js new file mode 100644 index 0000000..0dab06d --- /dev/null +++ b/node_modules/lodash/fp/times.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('times', require('../times')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/toArray.js b/node_modules/lodash/fp/toArray.js new file mode 100644 index 0000000..f0c360a --- /dev/null +++ b/node_modules/lodash/fp/toArray.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('toArray', require('../toArray'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/toFinite.js b/node_modules/lodash/fp/toFinite.js new file mode 100644 index 0000000..3a47687 --- /dev/null +++ b/node_modules/lodash/fp/toFinite.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('toFinite', require('../toFinite'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/toInteger.js b/node_modules/lodash/fp/toInteger.js new file mode 100644 index 0000000..e0af6a7 --- /dev/null +++ b/node_modules/lodash/fp/toInteger.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('toInteger', require('../toInteger'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/toIterator.js b/node_modules/lodash/fp/toIterator.js new file mode 100644 index 0000000..65e6baa --- /dev/null +++ b/node_modules/lodash/fp/toIterator.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('toIterator', require('../toIterator'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/toJSON.js b/node_modules/lodash/fp/toJSON.js new file mode 100644 index 0000000..2d718d0 --- /dev/null +++ b/node_modules/lodash/fp/toJSON.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('toJSON', require('../toJSON'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/toLength.js b/node_modules/lodash/fp/toLength.js new file mode 100644 index 0000000..b97cdd9 --- /dev/null +++ b/node_modules/lodash/fp/toLength.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('toLength', require('../toLength'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/toLower.js b/node_modules/lodash/fp/toLower.js new file mode 100644 index 0000000..616ef36 --- /dev/null +++ b/node_modules/lodash/fp/toLower.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('toLower', require('../toLower'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/toNumber.js b/node_modules/lodash/fp/toNumber.js new file mode 100644 index 0000000..d0c6f4d --- /dev/null +++ b/node_modules/lodash/fp/toNumber.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('toNumber', require('../toNumber'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/toPairs.js b/node_modules/lodash/fp/toPairs.js new file mode 100644 index 0000000..af78378 --- /dev/null +++ b/node_modules/lodash/fp/toPairs.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('toPairs', require('../toPairs'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/toPairsIn.js b/node_modules/lodash/fp/toPairsIn.js new file mode 100644 index 0000000..66504ab --- /dev/null +++ b/node_modules/lodash/fp/toPairsIn.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('toPairsIn', require('../toPairsIn'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/toPath.js b/node_modules/lodash/fp/toPath.js new file mode 100644 index 0000000..b4d5e50 --- /dev/null +++ b/node_modules/lodash/fp/toPath.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('toPath', require('../toPath'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/toPlainObject.js b/node_modules/lodash/fp/toPlainObject.js new file mode 100644 index 0000000..278bb86 --- /dev/null +++ b/node_modules/lodash/fp/toPlainObject.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('toPlainObject', require('../toPlainObject'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/toSafeInteger.js b/node_modules/lodash/fp/toSafeInteger.js new file mode 100644 index 0000000..367a26f --- /dev/null +++ b/node_modules/lodash/fp/toSafeInteger.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('toSafeInteger', require('../toSafeInteger'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/toString.js b/node_modules/lodash/fp/toString.js new file mode 100644 index 0000000..cec4f8e --- /dev/null +++ b/node_modules/lodash/fp/toString.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('toString', require('../toString'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/toUpper.js b/node_modules/lodash/fp/toUpper.js new file mode 100644 index 0000000..54f9a56 --- /dev/null +++ b/node_modules/lodash/fp/toUpper.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('toUpper', require('../toUpper'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/transform.js b/node_modules/lodash/fp/transform.js new file mode 100644 index 0000000..759d088 --- /dev/null +++ b/node_modules/lodash/fp/transform.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('transform', require('../transform')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/trim.js b/node_modules/lodash/fp/trim.js new file mode 100644 index 0000000..e6319a7 --- /dev/null +++ b/node_modules/lodash/fp/trim.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('trim', require('../trim')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/trimChars.js b/node_modules/lodash/fp/trimChars.js new file mode 100644 index 0000000..c9294de --- /dev/null +++ b/node_modules/lodash/fp/trimChars.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('trimChars', require('../trim')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/trimCharsEnd.js b/node_modules/lodash/fp/trimCharsEnd.js new file mode 100644 index 0000000..284bc2f --- /dev/null +++ b/node_modules/lodash/fp/trimCharsEnd.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('trimCharsEnd', require('../trimEnd')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/trimCharsStart.js b/node_modules/lodash/fp/trimCharsStart.js new file mode 100644 index 0000000..ff0ee65 --- /dev/null +++ b/node_modules/lodash/fp/trimCharsStart.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('trimCharsStart', require('../trimStart')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/trimEnd.js b/node_modules/lodash/fp/trimEnd.js new file mode 100644 index 0000000..7190880 --- /dev/null +++ b/node_modules/lodash/fp/trimEnd.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('trimEnd', require('../trimEnd')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/trimStart.js b/node_modules/lodash/fp/trimStart.js new file mode 100644 index 0000000..fda902c --- /dev/null +++ b/node_modules/lodash/fp/trimStart.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('trimStart', require('../trimStart')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/truncate.js b/node_modules/lodash/fp/truncate.js new file mode 100644 index 0000000..d265c1d --- /dev/null +++ b/node_modules/lodash/fp/truncate.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('truncate', require('../truncate')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/unapply.js b/node_modules/lodash/fp/unapply.js new file mode 100644 index 0000000..c5dfe77 --- /dev/null +++ b/node_modules/lodash/fp/unapply.js @@ -0,0 +1 @@ +module.exports = require('./rest'); diff --git a/node_modules/lodash/fp/unary.js b/node_modules/lodash/fp/unary.js new file mode 100644 index 0000000..286c945 --- /dev/null +++ b/node_modules/lodash/fp/unary.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('unary', require('../unary'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/unescape.js b/node_modules/lodash/fp/unescape.js new file mode 100644 index 0000000..fddcb46 --- /dev/null +++ b/node_modules/lodash/fp/unescape.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('unescape', require('../unescape'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/union.js b/node_modules/lodash/fp/union.js new file mode 100644 index 0000000..ef8228d --- /dev/null +++ b/node_modules/lodash/fp/union.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('union', require('../union')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/unionBy.js b/node_modules/lodash/fp/unionBy.js new file mode 100644 index 0000000..603687a --- /dev/null +++ b/node_modules/lodash/fp/unionBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('unionBy', require('../unionBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/unionWith.js b/node_modules/lodash/fp/unionWith.js new file mode 100644 index 0000000..65bb3a7 --- /dev/null +++ b/node_modules/lodash/fp/unionWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('unionWith', require('../unionWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/uniq.js b/node_modules/lodash/fp/uniq.js new file mode 100644 index 0000000..bc18524 --- /dev/null +++ b/node_modules/lodash/fp/uniq.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('uniq', require('../uniq'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/uniqBy.js b/node_modules/lodash/fp/uniqBy.js new file mode 100644 index 0000000..634c6a8 --- /dev/null +++ b/node_modules/lodash/fp/uniqBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('uniqBy', require('../uniqBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/uniqWith.js b/node_modules/lodash/fp/uniqWith.js new file mode 100644 index 0000000..0ec601a --- /dev/null +++ b/node_modules/lodash/fp/uniqWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('uniqWith', require('../uniqWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/uniqueId.js b/node_modules/lodash/fp/uniqueId.js new file mode 100644 index 0000000..aa8fc2f --- /dev/null +++ b/node_modules/lodash/fp/uniqueId.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('uniqueId', require('../uniqueId')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/unnest.js b/node_modules/lodash/fp/unnest.js new file mode 100644 index 0000000..5d34060 --- /dev/null +++ b/node_modules/lodash/fp/unnest.js @@ -0,0 +1 @@ +module.exports = require('./flatten'); diff --git a/node_modules/lodash/fp/unset.js b/node_modules/lodash/fp/unset.js new file mode 100644 index 0000000..ea203a0 --- /dev/null +++ b/node_modules/lodash/fp/unset.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('unset', require('../unset')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/unzip.js b/node_modules/lodash/fp/unzip.js new file mode 100644 index 0000000..cc364b3 --- /dev/null +++ b/node_modules/lodash/fp/unzip.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('unzip', require('../unzip'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/unzipWith.js b/node_modules/lodash/fp/unzipWith.js new file mode 100644 index 0000000..182eaa1 --- /dev/null +++ b/node_modules/lodash/fp/unzipWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('unzipWith', require('../unzipWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/update.js b/node_modules/lodash/fp/update.js new file mode 100644 index 0000000..b8ce2cc --- /dev/null +++ b/node_modules/lodash/fp/update.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('update', require('../update')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/updateWith.js b/node_modules/lodash/fp/updateWith.js new file mode 100644 index 0000000..d5e8282 --- /dev/null +++ b/node_modules/lodash/fp/updateWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('updateWith', require('../updateWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/upperCase.js b/node_modules/lodash/fp/upperCase.js new file mode 100644 index 0000000..c886f20 --- /dev/null +++ b/node_modules/lodash/fp/upperCase.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('upperCase', require('../upperCase'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/upperFirst.js b/node_modules/lodash/fp/upperFirst.js new file mode 100644 index 0000000..d8c04df --- /dev/null +++ b/node_modules/lodash/fp/upperFirst.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('upperFirst', require('../upperFirst'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/useWith.js b/node_modules/lodash/fp/useWith.js new file mode 100644 index 0000000..d8b3df5 --- /dev/null +++ b/node_modules/lodash/fp/useWith.js @@ -0,0 +1 @@ +module.exports = require('./overArgs'); diff --git a/node_modules/lodash/fp/util.js b/node_modules/lodash/fp/util.js new file mode 100644 index 0000000..18c00ba --- /dev/null +++ b/node_modules/lodash/fp/util.js @@ -0,0 +1,2 @@ +var convert = require('./convert'); +module.exports = convert(require('../util')); diff --git a/node_modules/lodash/fp/value.js b/node_modules/lodash/fp/value.js new file mode 100644 index 0000000..555eec7 --- /dev/null +++ b/node_modules/lodash/fp/value.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('value', require('../value'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/valueOf.js b/node_modules/lodash/fp/valueOf.js new file mode 100644 index 0000000..f968807 --- /dev/null +++ b/node_modules/lodash/fp/valueOf.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('valueOf', require('../valueOf'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/values.js b/node_modules/lodash/fp/values.js new file mode 100644 index 0000000..2dfc561 --- /dev/null +++ b/node_modules/lodash/fp/values.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('values', require('../values'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/valuesIn.js b/node_modules/lodash/fp/valuesIn.js new file mode 100644 index 0000000..a1b2bb8 --- /dev/null +++ b/node_modules/lodash/fp/valuesIn.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('valuesIn', require('../valuesIn'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/where.js b/node_modules/lodash/fp/where.js new file mode 100644 index 0000000..3247f64 --- /dev/null +++ b/node_modules/lodash/fp/where.js @@ -0,0 +1 @@ +module.exports = require('./conformsTo'); diff --git a/node_modules/lodash/fp/whereEq.js b/node_modules/lodash/fp/whereEq.js new file mode 100644 index 0000000..29d1e1e --- /dev/null +++ b/node_modules/lodash/fp/whereEq.js @@ -0,0 +1 @@ +module.exports = require('./isMatch'); diff --git a/node_modules/lodash/fp/without.js b/node_modules/lodash/fp/without.js new file mode 100644 index 0000000..bad9e12 --- /dev/null +++ b/node_modules/lodash/fp/without.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('without', require('../without')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/words.js b/node_modules/lodash/fp/words.js new file mode 100644 index 0000000..4a90141 --- /dev/null +++ b/node_modules/lodash/fp/words.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('words', require('../words')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/wrap.js b/node_modules/lodash/fp/wrap.js new file mode 100644 index 0000000..e93bd8a --- /dev/null +++ b/node_modules/lodash/fp/wrap.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('wrap', require('../wrap')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/wrapperAt.js b/node_modules/lodash/fp/wrapperAt.js new file mode 100644 index 0000000..8f0a310 --- /dev/null +++ b/node_modules/lodash/fp/wrapperAt.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('wrapperAt', require('../wrapperAt'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/wrapperChain.js b/node_modules/lodash/fp/wrapperChain.js new file mode 100644 index 0000000..2a48ea2 --- /dev/null +++ b/node_modules/lodash/fp/wrapperChain.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('wrapperChain', require('../wrapperChain'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/wrapperLodash.js b/node_modules/lodash/fp/wrapperLodash.js new file mode 100644 index 0000000..a7162d0 --- /dev/null +++ b/node_modules/lodash/fp/wrapperLodash.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('wrapperLodash', require('../wrapperLodash'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/wrapperReverse.js b/node_modules/lodash/fp/wrapperReverse.js new file mode 100644 index 0000000..e1481aa --- /dev/null +++ b/node_modules/lodash/fp/wrapperReverse.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('wrapperReverse', require('../wrapperReverse'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/wrapperValue.js b/node_modules/lodash/fp/wrapperValue.js new file mode 100644 index 0000000..8eb9112 --- /dev/null +++ b/node_modules/lodash/fp/wrapperValue.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('wrapperValue', require('../wrapperValue'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/xor.js b/node_modules/lodash/fp/xor.js new file mode 100644 index 0000000..29e2819 --- /dev/null +++ b/node_modules/lodash/fp/xor.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('xor', require('../xor')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/xorBy.js b/node_modules/lodash/fp/xorBy.js new file mode 100644 index 0000000..b355686 --- /dev/null +++ b/node_modules/lodash/fp/xorBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('xorBy', require('../xorBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/xorWith.js b/node_modules/lodash/fp/xorWith.js new file mode 100644 index 0000000..8e05739 --- /dev/null +++ b/node_modules/lodash/fp/xorWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('xorWith', require('../xorWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/zip.js b/node_modules/lodash/fp/zip.js new file mode 100644 index 0000000..69e147a --- /dev/null +++ b/node_modules/lodash/fp/zip.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('zip', require('../zip')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/zipAll.js b/node_modules/lodash/fp/zipAll.js new file mode 100644 index 0000000..efa8ccb --- /dev/null +++ b/node_modules/lodash/fp/zipAll.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('zipAll', require('../zip')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/zipObj.js b/node_modules/lodash/fp/zipObj.js new file mode 100644 index 0000000..f4a3453 --- /dev/null +++ b/node_modules/lodash/fp/zipObj.js @@ -0,0 +1 @@ +module.exports = require('./zipObject'); diff --git a/node_modules/lodash/fp/zipObject.js b/node_modules/lodash/fp/zipObject.js new file mode 100644 index 0000000..462dbb6 --- /dev/null +++ b/node_modules/lodash/fp/zipObject.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('zipObject', require('../zipObject')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/zipObjectDeep.js b/node_modules/lodash/fp/zipObjectDeep.js new file mode 100644 index 0000000..53a5d33 --- /dev/null +++ b/node_modules/lodash/fp/zipObjectDeep.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('zipObjectDeep', require('../zipObjectDeep')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fp/zipWith.js b/node_modules/lodash/fp/zipWith.js new file mode 100644 index 0000000..c5cf9e2 --- /dev/null +++ b/node_modules/lodash/fp/zipWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('zipWith', require('../zipWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/node_modules/lodash/fromPairs.js b/node_modules/lodash/fromPairs.js new file mode 100644 index 0000000..ee7940d --- /dev/null +++ b/node_modules/lodash/fromPairs.js @@ -0,0 +1,28 @@ +/** + * The inverse of `_.toPairs`; this method returns an object composed + * from key-value `pairs`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} pairs The key-value pairs. + * @returns {Object} Returns the new object. + * @example + * + * _.fromPairs([['a', 1], ['b', 2]]); + * // => { 'a': 1, 'b': 2 } + */ +function fromPairs(pairs) { + var index = -1, + length = pairs == null ? 0 : pairs.length, + result = {}; + + while (++index < length) { + var pair = pairs[index]; + result[pair[0]] = pair[1]; + } + return result; +} + +module.exports = fromPairs; diff --git a/node_modules/lodash/function.js b/node_modules/lodash/function.js new file mode 100644 index 0000000..b0fc6d9 --- /dev/null +++ b/node_modules/lodash/function.js @@ -0,0 +1,25 @@ +module.exports = { + 'after': require('./after'), + 'ary': require('./ary'), + 'before': require('./before'), + 'bind': require('./bind'), + 'bindKey': require('./bindKey'), + 'curry': require('./curry'), + 'curryRight': require('./curryRight'), + 'debounce': require('./debounce'), + 'defer': require('./defer'), + 'delay': require('./delay'), + 'flip': require('./flip'), + 'memoize': require('./memoize'), + 'negate': require('./negate'), + 'once': require('./once'), + 'overArgs': require('./overArgs'), + 'partial': require('./partial'), + 'partialRight': require('./partialRight'), + 'rearg': require('./rearg'), + 'rest': require('./rest'), + 'spread': require('./spread'), + 'throttle': require('./throttle'), + 'unary': require('./unary'), + 'wrap': require('./wrap') +}; diff --git a/node_modules/lodash/functions.js b/node_modules/lodash/functions.js new file mode 100644 index 0000000..9722928 --- /dev/null +++ b/node_modules/lodash/functions.js @@ -0,0 +1,31 @@ +var baseFunctions = require('./_baseFunctions'), + keys = require('./keys'); + +/** + * Creates an array of function property names from own enumerable properties + * of `object`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to inspect. + * @returns {Array} Returns the function names. + * @see _.functionsIn + * @example + * + * function Foo() { + * this.a = _.constant('a'); + * this.b = _.constant('b'); + * } + * + * Foo.prototype.c = _.constant('c'); + * + * _.functions(new Foo); + * // => ['a', 'b'] + */ +function functions(object) { + return object == null ? [] : baseFunctions(object, keys(object)); +} + +module.exports = functions; diff --git a/node_modules/lodash/functionsIn.js b/node_modules/lodash/functionsIn.js new file mode 100644 index 0000000..f00345d --- /dev/null +++ b/node_modules/lodash/functionsIn.js @@ -0,0 +1,31 @@ +var baseFunctions = require('./_baseFunctions'), + keysIn = require('./keysIn'); + +/** + * Creates an array of function property names from own and inherited + * enumerable properties of `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to inspect. + * @returns {Array} Returns the function names. + * @see _.functions + * @example + * + * function Foo() { + * this.a = _.constant('a'); + * this.b = _.constant('b'); + * } + * + * Foo.prototype.c = _.constant('c'); + * + * _.functionsIn(new Foo); + * // => ['a', 'b', 'c'] + */ +function functionsIn(object) { + return object == null ? [] : baseFunctions(object, keysIn(object)); +} + +module.exports = functionsIn; diff --git a/node_modules/lodash/get.js b/node_modules/lodash/get.js new file mode 100644 index 0000000..8805ff9 --- /dev/null +++ b/node_modules/lodash/get.js @@ -0,0 +1,33 @@ +var baseGet = require('./_baseGet'); + +/** + * Gets the value at `path` of `object`. If the resolved value is + * `undefined`, the `defaultValue` is returned in its place. + * + * @static + * @memberOf _ + * @since 3.7.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @param {*} [defaultValue] The value returned for `undefined` resolved values. + * @returns {*} Returns the resolved value. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }] }; + * + * _.get(object, 'a[0].b.c'); + * // => 3 + * + * _.get(object, ['a', '0', 'b', 'c']); + * // => 3 + * + * _.get(object, 'a.b.c', 'default'); + * // => 'default' + */ +function get(object, path, defaultValue) { + var result = object == null ? undefined : baseGet(object, path); + return result === undefined ? defaultValue : result; +} + +module.exports = get; diff --git a/node_modules/lodash/groupBy.js b/node_modules/lodash/groupBy.js new file mode 100644 index 0000000..babf4f6 --- /dev/null +++ b/node_modules/lodash/groupBy.js @@ -0,0 +1,41 @@ +var baseAssignValue = require('./_baseAssignValue'), + createAggregator = require('./_createAggregator'); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Creates an object composed of keys generated from the results of running + * each element of `collection` thru `iteratee`. The order of grouped values + * is determined by the order they occur in `collection`. The corresponding + * value of each key is an array of elements responsible for generating the + * key. The iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The iteratee to transform keys. + * @returns {Object} Returns the composed aggregate object. + * @example + * + * _.groupBy([6.1, 4.2, 6.3], Math.floor); + * // => { '4': [4.2], '6': [6.1, 6.3] } + * + * // The `_.property` iteratee shorthand. + * _.groupBy(['one', 'two', 'three'], 'length'); + * // => { '3': ['one', 'two'], '5': ['three'] } + */ +var groupBy = createAggregator(function(result, value, key) { + if (hasOwnProperty.call(result, key)) { + result[key].push(value); + } else { + baseAssignValue(result, key, [value]); + } +}); + +module.exports = groupBy; diff --git a/node_modules/lodash/gt.js b/node_modules/lodash/gt.js new file mode 100644 index 0000000..3a66282 --- /dev/null +++ b/node_modules/lodash/gt.js @@ -0,0 +1,29 @@ +var baseGt = require('./_baseGt'), + createRelationalOperation = require('./_createRelationalOperation'); + +/** + * Checks if `value` is greater than `other`. + * + * @static + * @memberOf _ + * @since 3.9.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is greater than `other`, + * else `false`. + * @see _.lt + * @example + * + * _.gt(3, 1); + * // => true + * + * _.gt(3, 3); + * // => false + * + * _.gt(1, 3); + * // => false + */ +var gt = createRelationalOperation(baseGt); + +module.exports = gt; diff --git a/node_modules/lodash/gte.js b/node_modules/lodash/gte.js new file mode 100644 index 0000000..4180a68 --- /dev/null +++ b/node_modules/lodash/gte.js @@ -0,0 +1,30 @@ +var createRelationalOperation = require('./_createRelationalOperation'); + +/** + * Checks if `value` is greater than or equal to `other`. + * + * @static + * @memberOf _ + * @since 3.9.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is greater than or equal to + * `other`, else `false`. + * @see _.lte + * @example + * + * _.gte(3, 1); + * // => true + * + * _.gte(3, 3); + * // => true + * + * _.gte(1, 3); + * // => false + */ +var gte = createRelationalOperation(function(value, other) { + return value >= other; +}); + +module.exports = gte; diff --git a/node_modules/lodash/has.js b/node_modules/lodash/has.js new file mode 100644 index 0000000..34df55e --- /dev/null +++ b/node_modules/lodash/has.js @@ -0,0 +1,35 @@ +var baseHas = require('./_baseHas'), + hasPath = require('./_hasPath'); + +/** + * Checks if `path` is a direct property of `object`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + * @example + * + * var object = { 'a': { 'b': 2 } }; + * var other = _.create({ 'a': _.create({ 'b': 2 }) }); + * + * _.has(object, 'a'); + * // => true + * + * _.has(object, 'a.b'); + * // => true + * + * _.has(object, ['a', 'b']); + * // => true + * + * _.has(other, 'a'); + * // => false + */ +function has(object, path) { + return object != null && hasPath(object, path, baseHas); +} + +module.exports = has; diff --git a/node_modules/lodash/hasIn.js b/node_modules/lodash/hasIn.js new file mode 100644 index 0000000..06a3686 --- /dev/null +++ b/node_modules/lodash/hasIn.js @@ -0,0 +1,34 @@ +var baseHasIn = require('./_baseHasIn'), + hasPath = require('./_hasPath'); + +/** + * Checks if `path` is a direct or inherited property of `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + * @example + * + * var object = _.create({ 'a': _.create({ 'b': 2 }) }); + * + * _.hasIn(object, 'a'); + * // => true + * + * _.hasIn(object, 'a.b'); + * // => true + * + * _.hasIn(object, ['a', 'b']); + * // => true + * + * _.hasIn(object, 'b'); + * // => false + */ +function hasIn(object, path) { + return object != null && hasPath(object, path, baseHasIn); +} + +module.exports = hasIn; diff --git a/node_modules/lodash/head.js b/node_modules/lodash/head.js new file mode 100644 index 0000000..dee9d1f --- /dev/null +++ b/node_modules/lodash/head.js @@ -0,0 +1,23 @@ +/** + * Gets the first element of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @alias first + * @category Array + * @param {Array} array The array to query. + * @returns {*} Returns the first element of `array`. + * @example + * + * _.head([1, 2, 3]); + * // => 1 + * + * _.head([]); + * // => undefined + */ +function head(array) { + return (array && array.length) ? array[0] : undefined; +} + +module.exports = head; diff --git a/node_modules/lodash/identity.js b/node_modules/lodash/identity.js new file mode 100644 index 0000000..2d5d963 --- /dev/null +++ b/node_modules/lodash/identity.js @@ -0,0 +1,21 @@ +/** + * This method returns the first argument it receives. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @param {*} value Any value. + * @returns {*} Returns `value`. + * @example + * + * var object = { 'a': 1 }; + * + * console.log(_.identity(object) === object); + * // => true + */ +function identity(value) { + return value; +} + +module.exports = identity; diff --git a/node_modules/lodash/inRange.js b/node_modules/lodash/inRange.js new file mode 100644 index 0000000..f20728d --- /dev/null +++ b/node_modules/lodash/inRange.js @@ -0,0 +1,55 @@ +var baseInRange = require('./_baseInRange'), + toFinite = require('./toFinite'), + toNumber = require('./toNumber'); + +/** + * Checks if `n` is between `start` and up to, but not including, `end`. If + * `end` is not specified, it's set to `start` with `start` then set to `0`. + * If `start` is greater than `end` the params are swapped to support + * negative ranges. + * + * @static + * @memberOf _ + * @since 3.3.0 + * @category Number + * @param {number} number The number to check. + * @param {number} [start=0] The start of the range. + * @param {number} end The end of the range. + * @returns {boolean} Returns `true` if `number` is in the range, else `false`. + * @see _.range, _.rangeRight + * @example + * + * _.inRange(3, 2, 4); + * // => true + * + * _.inRange(4, 8); + * // => true + * + * _.inRange(4, 2); + * // => false + * + * _.inRange(2, 2); + * // => false + * + * _.inRange(1.2, 2); + * // => true + * + * _.inRange(5.2, 4); + * // => false + * + * _.inRange(-3, -2, -6); + * // => true + */ +function inRange(number, start, end) { + start = toFinite(start); + if (end === undefined) { + end = start; + start = 0; + } else { + end = toFinite(end); + } + number = toNumber(number); + return baseInRange(number, start, end); +} + +module.exports = inRange; diff --git a/node_modules/lodash/includes.js b/node_modules/lodash/includes.js new file mode 100644 index 0000000..ae0deed --- /dev/null +++ b/node_modules/lodash/includes.js @@ -0,0 +1,53 @@ +var baseIndexOf = require('./_baseIndexOf'), + isArrayLike = require('./isArrayLike'), + isString = require('./isString'), + toInteger = require('./toInteger'), + values = require('./values'); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max; + +/** + * Checks if `value` is in `collection`. If `collection` is a string, it's + * checked for a substring of `value`, otherwise + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * is used for equality comparisons. If `fromIndex` is negative, it's used as + * the offset from the end of `collection`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object|string} collection The collection to inspect. + * @param {*} value The value to search for. + * @param {number} [fromIndex=0] The index to search from. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. + * @returns {boolean} Returns `true` if `value` is found, else `false`. + * @example + * + * _.includes([1, 2, 3], 1); + * // => true + * + * _.includes([1, 2, 3], 1, 2); + * // => false + * + * _.includes({ 'a': 1, 'b': 2 }, 1); + * // => true + * + * _.includes('abcd', 'bc'); + * // => true + */ +function includes(collection, value, fromIndex, guard) { + collection = isArrayLike(collection) ? collection : values(collection); + fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0; + + var length = collection.length; + if (fromIndex < 0) { + fromIndex = nativeMax(length + fromIndex, 0); + } + return isString(collection) + ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1) + : (!!length && baseIndexOf(collection, value, fromIndex) > -1); +} + +module.exports = includes; diff --git a/node_modules/lodash/index.js b/node_modules/lodash/index.js new file mode 100644 index 0000000..5d063e2 --- /dev/null +++ b/node_modules/lodash/index.js @@ -0,0 +1 @@ +module.exports = require('./lodash'); \ No newline at end of file diff --git a/node_modules/lodash/indexOf.js b/node_modules/lodash/indexOf.js new file mode 100644 index 0000000..3c644af --- /dev/null +++ b/node_modules/lodash/indexOf.js @@ -0,0 +1,42 @@ +var baseIndexOf = require('./_baseIndexOf'), + toInteger = require('./toInteger'); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max; + +/** + * Gets the index at which the first occurrence of `value` is found in `array` + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. If `fromIndex` is negative, it's used as the + * offset from the end of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} [fromIndex=0] The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.indexOf([1, 2, 1, 2], 2); + * // => 1 + * + * // Search from the `fromIndex`. + * _.indexOf([1, 2, 1, 2], 2, 2); + * // => 3 + */ +function indexOf(array, value, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index = fromIndex == null ? 0 : toInteger(fromIndex); + if (index < 0) { + index = nativeMax(length + index, 0); + } + return baseIndexOf(array, value, index); +} + +module.exports = indexOf; diff --git a/node_modules/lodash/initial.js b/node_modules/lodash/initial.js new file mode 100644 index 0000000..f47fc50 --- /dev/null +++ b/node_modules/lodash/initial.js @@ -0,0 +1,22 @@ +var baseSlice = require('./_baseSlice'); + +/** + * Gets all but the last element of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to query. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.initial([1, 2, 3]); + * // => [1, 2] + */ +function initial(array) { + var length = array == null ? 0 : array.length; + return length ? baseSlice(array, 0, -1) : []; +} + +module.exports = initial; diff --git a/node_modules/lodash/intersection.js b/node_modules/lodash/intersection.js new file mode 100644 index 0000000..a94c135 --- /dev/null +++ b/node_modules/lodash/intersection.js @@ -0,0 +1,30 @@ +var arrayMap = require('./_arrayMap'), + baseIntersection = require('./_baseIntersection'), + baseRest = require('./_baseRest'), + castArrayLikeObject = require('./_castArrayLikeObject'); + +/** + * Creates an array of unique values that are included in all given arrays + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. The order and references of result values are + * determined by the first array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @returns {Array} Returns the new array of intersecting values. + * @example + * + * _.intersection([2, 1], [2, 3]); + * // => [2] + */ +var intersection = baseRest(function(arrays) { + var mapped = arrayMap(arrays, castArrayLikeObject); + return (mapped.length && mapped[0] === arrays[0]) + ? baseIntersection(mapped) + : []; +}); + +module.exports = intersection; diff --git a/node_modules/lodash/intersectionBy.js b/node_modules/lodash/intersectionBy.js new file mode 100644 index 0000000..31461aa --- /dev/null +++ b/node_modules/lodash/intersectionBy.js @@ -0,0 +1,45 @@ +var arrayMap = require('./_arrayMap'), + baseIntersection = require('./_baseIntersection'), + baseIteratee = require('./_baseIteratee'), + baseRest = require('./_baseRest'), + castArrayLikeObject = require('./_castArrayLikeObject'), + last = require('./last'); + +/** + * This method is like `_.intersection` except that it accepts `iteratee` + * which is invoked for each element of each `arrays` to generate the criterion + * by which they're compared. The order and references of result values are + * determined by the first array. The iteratee is invoked with one argument: + * (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new array of intersecting values. + * @example + * + * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor); + * // => [2.1] + * + * // The `_.property` iteratee shorthand. + * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 1 }] + */ +var intersectionBy = baseRest(function(arrays) { + var iteratee = last(arrays), + mapped = arrayMap(arrays, castArrayLikeObject); + + if (iteratee === last(mapped)) { + iteratee = undefined; + } else { + mapped.pop(); + } + return (mapped.length && mapped[0] === arrays[0]) + ? baseIntersection(mapped, baseIteratee(iteratee, 2)) + : []; +}); + +module.exports = intersectionBy; diff --git a/node_modules/lodash/intersectionWith.js b/node_modules/lodash/intersectionWith.js new file mode 100644 index 0000000..63cabfa --- /dev/null +++ b/node_modules/lodash/intersectionWith.js @@ -0,0 +1,41 @@ +var arrayMap = require('./_arrayMap'), + baseIntersection = require('./_baseIntersection'), + baseRest = require('./_baseRest'), + castArrayLikeObject = require('./_castArrayLikeObject'), + last = require('./last'); + +/** + * This method is like `_.intersection` except that it accepts `comparator` + * which is invoked to compare elements of `arrays`. The order and references + * of result values are determined by the first array. The comparator is + * invoked with two arguments: (arrVal, othVal). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of intersecting values. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * + * _.intersectionWith(objects, others, _.isEqual); + * // => [{ 'x': 1, 'y': 2 }] + */ +var intersectionWith = baseRest(function(arrays) { + var comparator = last(arrays), + mapped = arrayMap(arrays, castArrayLikeObject); + + comparator = typeof comparator == 'function' ? comparator : undefined; + if (comparator) { + mapped.pop(); + } + return (mapped.length && mapped[0] === arrays[0]) + ? baseIntersection(mapped, undefined, comparator) + : []; +}); + +module.exports = intersectionWith; diff --git a/node_modules/lodash/invert.js b/node_modules/lodash/invert.js new file mode 100644 index 0000000..8c47950 --- /dev/null +++ b/node_modules/lodash/invert.js @@ -0,0 +1,42 @@ +var constant = require('./constant'), + createInverter = require('./_createInverter'), + identity = require('./identity'); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var nativeObjectToString = objectProto.toString; + +/** + * Creates an object composed of the inverted keys and values of `object`. + * If `object` contains duplicate values, subsequent values overwrite + * property assignments of previous values. + * + * @static + * @memberOf _ + * @since 0.7.0 + * @category Object + * @param {Object} object The object to invert. + * @returns {Object} Returns the new inverted object. + * @example + * + * var object = { 'a': 1, 'b': 2, 'c': 1 }; + * + * _.invert(object); + * // => { '1': 'c', '2': 'b' } + */ +var invert = createInverter(function(result, value, key) { + if (value != null && + typeof value.toString != 'function') { + value = nativeObjectToString.call(value); + } + + result[value] = key; +}, constant(identity)); + +module.exports = invert; diff --git a/node_modules/lodash/invertBy.js b/node_modules/lodash/invertBy.js new file mode 100644 index 0000000..3f4f7e5 --- /dev/null +++ b/node_modules/lodash/invertBy.js @@ -0,0 +1,56 @@ +var baseIteratee = require('./_baseIteratee'), + createInverter = require('./_createInverter'); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var nativeObjectToString = objectProto.toString; + +/** + * This method is like `_.invert` except that the inverted object is generated + * from the results of running each element of `object` thru `iteratee`. The + * corresponding inverted value of each inverted key is an array of keys + * responsible for generating the inverted value. The iteratee is invoked + * with one argument: (value). + * + * @static + * @memberOf _ + * @since 4.1.0 + * @category Object + * @param {Object} object The object to invert. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Object} Returns the new inverted object. + * @example + * + * var object = { 'a': 1, 'b': 2, 'c': 1 }; + * + * _.invertBy(object); + * // => { '1': ['a', 'c'], '2': ['b'] } + * + * _.invertBy(object, function(value) { + * return 'group' + value; + * }); + * // => { 'group1': ['a', 'c'], 'group2': ['b'] } + */ +var invertBy = createInverter(function(result, value, key) { + if (value != null && + typeof value.toString != 'function') { + value = nativeObjectToString.call(value); + } + + if (hasOwnProperty.call(result, value)) { + result[value].push(key); + } else { + result[value] = [key]; + } +}, baseIteratee); + +module.exports = invertBy; diff --git a/node_modules/lodash/invoke.js b/node_modules/lodash/invoke.js new file mode 100644 index 0000000..97d51eb --- /dev/null +++ b/node_modules/lodash/invoke.js @@ -0,0 +1,24 @@ +var baseInvoke = require('./_baseInvoke'), + baseRest = require('./_baseRest'); + +/** + * Invokes the method at `path` of `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path of the method to invoke. + * @param {...*} [args] The arguments to invoke the method with. + * @returns {*} Returns the result of the invoked method. + * @example + * + * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] }; + * + * _.invoke(object, 'a[0].b.c.slice', 1, 3); + * // => [2, 3] + */ +var invoke = baseRest(baseInvoke); + +module.exports = invoke; diff --git a/node_modules/lodash/invokeMap.js b/node_modules/lodash/invokeMap.js new file mode 100644 index 0000000..8da5126 --- /dev/null +++ b/node_modules/lodash/invokeMap.js @@ -0,0 +1,41 @@ +var apply = require('./_apply'), + baseEach = require('./_baseEach'), + baseInvoke = require('./_baseInvoke'), + baseRest = require('./_baseRest'), + isArrayLike = require('./isArrayLike'); + +/** + * Invokes the method at `path` of each element in `collection`, returning + * an array of the results of each invoked method. Any additional arguments + * are provided to each invoked method. If `path` is a function, it's invoked + * for, and `this` bound to, each element in `collection`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Array|Function|string} path The path of the method to invoke or + * the function invoked per iteration. + * @param {...*} [args] The arguments to invoke each method with. + * @returns {Array} Returns the array of results. + * @example + * + * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort'); + * // => [[1, 5, 7], [1, 2, 3]] + * + * _.invokeMap([123, 456], String.prototype.split, ''); + * // => [['1', '2', '3'], ['4', '5', '6']] + */ +var invokeMap = baseRest(function(collection, path, args) { + var index = -1, + isFunc = typeof path == 'function', + result = isArrayLike(collection) ? Array(collection.length) : []; + + baseEach(collection, function(value) { + result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args); + }); + return result; +}); + +module.exports = invokeMap; diff --git a/node_modules/lodash/isArguments.js b/node_modules/lodash/isArguments.js new file mode 100644 index 0000000..8b9ed66 --- /dev/null +++ b/node_modules/lodash/isArguments.js @@ -0,0 +1,36 @@ +var baseIsArguments = require('./_baseIsArguments'), + isObjectLike = require('./isObjectLike'); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** Built-in value references. */ +var propertyIsEnumerable = objectProto.propertyIsEnumerable; + +/** + * Checks if `value` is likely an `arguments` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + * else `false`. + * @example + * + * _.isArguments(function() { return arguments; }()); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ +var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { + return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && + !propertyIsEnumerable.call(value, 'callee'); +}; + +module.exports = isArguments; diff --git a/node_modules/lodash/isArray.js b/node_modules/lodash/isArray.js new file mode 100644 index 0000000..88ab55f --- /dev/null +++ b/node_modules/lodash/isArray.js @@ -0,0 +1,26 @@ +/** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(document.body.children); + * // => false + * + * _.isArray('abc'); + * // => false + * + * _.isArray(_.noop); + * // => false + */ +var isArray = Array.isArray; + +module.exports = isArray; diff --git a/node_modules/lodash/isArrayBuffer.js b/node_modules/lodash/isArrayBuffer.js new file mode 100644 index 0000000..12904a6 --- /dev/null +++ b/node_modules/lodash/isArrayBuffer.js @@ -0,0 +1,27 @@ +var baseIsArrayBuffer = require('./_baseIsArrayBuffer'), + baseUnary = require('./_baseUnary'), + nodeUtil = require('./_nodeUtil'); + +/* Node.js helper references. */ +var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer; + +/** + * Checks if `value` is classified as an `ArrayBuffer` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`. + * @example + * + * _.isArrayBuffer(new ArrayBuffer(2)); + * // => true + * + * _.isArrayBuffer(new Array(2)); + * // => false + */ +var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer; + +module.exports = isArrayBuffer; diff --git a/node_modules/lodash/isArrayLike.js b/node_modules/lodash/isArrayLike.js new file mode 100644 index 0000000..0f96680 --- /dev/null +++ b/node_modules/lodash/isArrayLike.js @@ -0,0 +1,33 @@ +var isFunction = require('./isFunction'), + isLength = require('./isLength'); + +/** + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @example + * + * _.isArrayLike([1, 2, 3]); + * // => true + * + * _.isArrayLike(document.body.children); + * // => true + * + * _.isArrayLike('abc'); + * // => true + * + * _.isArrayLike(_.noop); + * // => false + */ +function isArrayLike(value) { + return value != null && isLength(value.length) && !isFunction(value); +} + +module.exports = isArrayLike; diff --git a/node_modules/lodash/isArrayLikeObject.js b/node_modules/lodash/isArrayLikeObject.js new file mode 100644 index 0000000..6c4812a --- /dev/null +++ b/node_modules/lodash/isArrayLikeObject.js @@ -0,0 +1,33 @@ +var isArrayLike = require('./isArrayLike'), + isObjectLike = require('./isObjectLike'); + +/** + * This method is like `_.isArrayLike` except that it also checks if `value` + * is an object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array-like object, + * else `false`. + * @example + * + * _.isArrayLikeObject([1, 2, 3]); + * // => true + * + * _.isArrayLikeObject(document.body.children); + * // => true + * + * _.isArrayLikeObject('abc'); + * // => false + * + * _.isArrayLikeObject(_.noop); + * // => false + */ +function isArrayLikeObject(value) { + return isObjectLike(value) && isArrayLike(value); +} + +module.exports = isArrayLikeObject; diff --git a/node_modules/lodash/isBoolean.js b/node_modules/lodash/isBoolean.js new file mode 100644 index 0000000..a43ed4b --- /dev/null +++ b/node_modules/lodash/isBoolean.js @@ -0,0 +1,29 @@ +var baseGetTag = require('./_baseGetTag'), + isObjectLike = require('./isObjectLike'); + +/** `Object#toString` result references. */ +var boolTag = '[object Boolean]'; + +/** + * Checks if `value` is classified as a boolean primitive or object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a boolean, else `false`. + * @example + * + * _.isBoolean(false); + * // => true + * + * _.isBoolean(null); + * // => false + */ +function isBoolean(value) { + return value === true || value === false || + (isObjectLike(value) && baseGetTag(value) == boolTag); +} + +module.exports = isBoolean; diff --git a/node_modules/lodash/isBuffer.js b/node_modules/lodash/isBuffer.js new file mode 100644 index 0000000..c103cc7 --- /dev/null +++ b/node_modules/lodash/isBuffer.js @@ -0,0 +1,38 @@ +var root = require('./_root'), + stubFalse = require('./stubFalse'); + +/** Detect free variable `exports`. */ +var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; + +/** Detect free variable `module`. */ +var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; + +/** Detect the popular CommonJS extension `module.exports`. */ +var moduleExports = freeModule && freeModule.exports === freeExports; + +/** Built-in value references. */ +var Buffer = moduleExports ? root.Buffer : undefined; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined; + +/** + * Checks if `value` is a buffer. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. + * @example + * + * _.isBuffer(new Buffer(2)); + * // => true + * + * _.isBuffer(new Uint8Array(2)); + * // => false + */ +var isBuffer = nativeIsBuffer || stubFalse; + +module.exports = isBuffer; diff --git a/node_modules/lodash/isDate.js b/node_modules/lodash/isDate.js new file mode 100644 index 0000000..7f0209f --- /dev/null +++ b/node_modules/lodash/isDate.js @@ -0,0 +1,27 @@ +var baseIsDate = require('./_baseIsDate'), + baseUnary = require('./_baseUnary'), + nodeUtil = require('./_nodeUtil'); + +/* Node.js helper references. */ +var nodeIsDate = nodeUtil && nodeUtil.isDate; + +/** + * Checks if `value` is classified as a `Date` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a date object, else `false`. + * @example + * + * _.isDate(new Date); + * // => true + * + * _.isDate('Mon April 23 2012'); + * // => false + */ +var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate; + +module.exports = isDate; diff --git a/node_modules/lodash/isElement.js b/node_modules/lodash/isElement.js new file mode 100644 index 0000000..76ae29c --- /dev/null +++ b/node_modules/lodash/isElement.js @@ -0,0 +1,25 @@ +var isObjectLike = require('./isObjectLike'), + isPlainObject = require('./isPlainObject'); + +/** + * Checks if `value` is likely a DOM element. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`. + * @example + * + * _.isElement(document.body); + * // => true + * + * _.isElement(''); + * // => false + */ +function isElement(value) { + return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value); +} + +module.exports = isElement; diff --git a/node_modules/lodash/isEmpty.js b/node_modules/lodash/isEmpty.js new file mode 100644 index 0000000..3597294 --- /dev/null +++ b/node_modules/lodash/isEmpty.js @@ -0,0 +1,77 @@ +var baseKeys = require('./_baseKeys'), + getTag = require('./_getTag'), + isArguments = require('./isArguments'), + isArray = require('./isArray'), + isArrayLike = require('./isArrayLike'), + isBuffer = require('./isBuffer'), + isPrototype = require('./_isPrototype'), + isTypedArray = require('./isTypedArray'); + +/** `Object#toString` result references. */ +var mapTag = '[object Map]', + setTag = '[object Set]'; + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Checks if `value` is an empty object, collection, map, or set. + * + * Objects are considered empty if they have no own enumerable string keyed + * properties. + * + * Array-like values such as `arguments` objects, arrays, buffers, strings, or + * jQuery-like collections are considered empty if they have a `length` of `0`. + * Similarly, maps and sets are considered empty if they have a `size` of `0`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is empty, else `false`. + * @example + * + * _.isEmpty(null); + * // => true + * + * _.isEmpty(true); + * // => true + * + * _.isEmpty(1); + * // => true + * + * _.isEmpty([1, 2, 3]); + * // => false + * + * _.isEmpty({ 'a': 1 }); + * // => false + */ +function isEmpty(value) { + if (value == null) { + return true; + } + if (isArrayLike(value) && + (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' || + isBuffer(value) || isTypedArray(value) || isArguments(value))) { + return !value.length; + } + var tag = getTag(value); + if (tag == mapTag || tag == setTag) { + return !value.size; + } + if (isPrototype(value)) { + return !baseKeys(value).length; + } + for (var key in value) { + if (hasOwnProperty.call(value, key)) { + return false; + } + } + return true; +} + +module.exports = isEmpty; diff --git a/node_modules/lodash/isEqual.js b/node_modules/lodash/isEqual.js new file mode 100644 index 0000000..5e23e76 --- /dev/null +++ b/node_modules/lodash/isEqual.js @@ -0,0 +1,35 @@ +var baseIsEqual = require('./_baseIsEqual'); + +/** + * Performs a deep comparison between two values to determine if they are + * equivalent. + * + * **Note:** This method supports comparing arrays, array buffers, booleans, + * date objects, error objects, maps, numbers, `Object` objects, regexes, + * sets, strings, symbols, and typed arrays. `Object` objects are compared + * by their own, not inherited, enumerable properties. Functions and DOM + * nodes are compared by strict equality, i.e. `===`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.isEqual(object, other); + * // => true + * + * object === other; + * // => false + */ +function isEqual(value, other) { + return baseIsEqual(value, other); +} + +module.exports = isEqual; diff --git a/node_modules/lodash/isEqualWith.js b/node_modules/lodash/isEqualWith.js new file mode 100644 index 0000000..21bdc7f --- /dev/null +++ b/node_modules/lodash/isEqualWith.js @@ -0,0 +1,41 @@ +var baseIsEqual = require('./_baseIsEqual'); + +/** + * This method is like `_.isEqual` except that it accepts `customizer` which + * is invoked to compare values. If `customizer` returns `undefined`, comparisons + * are handled by the method instead. The `customizer` is invoked with up to + * six arguments: (objValue, othValue [, index|key, object, other, stack]). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @param {Function} [customizer] The function to customize comparisons. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * function isGreeting(value) { + * return /^h(?:i|ello)$/.test(value); + * } + * + * function customizer(objValue, othValue) { + * if (isGreeting(objValue) && isGreeting(othValue)) { + * return true; + * } + * } + * + * var array = ['hello', 'goodbye']; + * var other = ['hi', 'goodbye']; + * + * _.isEqualWith(array, other, customizer); + * // => true + */ +function isEqualWith(value, other, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + var result = customizer ? customizer(value, other) : undefined; + return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result; +} + +module.exports = isEqualWith; diff --git a/node_modules/lodash/isError.js b/node_modules/lodash/isError.js new file mode 100644 index 0000000..b4f41e0 --- /dev/null +++ b/node_modules/lodash/isError.js @@ -0,0 +1,36 @@ +var baseGetTag = require('./_baseGetTag'), + isObjectLike = require('./isObjectLike'), + isPlainObject = require('./isPlainObject'); + +/** `Object#toString` result references. */ +var domExcTag = '[object DOMException]', + errorTag = '[object Error]'; + +/** + * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`, + * `SyntaxError`, `TypeError`, or `URIError` object. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an error object, else `false`. + * @example + * + * _.isError(new Error); + * // => true + * + * _.isError(Error); + * // => false + */ +function isError(value) { + if (!isObjectLike(value)) { + return false; + } + var tag = baseGetTag(value); + return tag == errorTag || tag == domExcTag || + (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value)); +} + +module.exports = isError; diff --git a/node_modules/lodash/isFinite.js b/node_modules/lodash/isFinite.js new file mode 100644 index 0000000..601842b --- /dev/null +++ b/node_modules/lodash/isFinite.js @@ -0,0 +1,36 @@ +var root = require('./_root'); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeIsFinite = root.isFinite; + +/** + * Checks if `value` is a finite primitive number. + * + * **Note:** This method is based on + * [`Number.isFinite`](https://mdn.io/Number/isFinite). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a finite number, else `false`. + * @example + * + * _.isFinite(3); + * // => true + * + * _.isFinite(Number.MIN_VALUE); + * // => true + * + * _.isFinite(Infinity); + * // => false + * + * _.isFinite('3'); + * // => false + */ +function isFinite(value) { + return typeof value == 'number' && nativeIsFinite(value); +} + +module.exports = isFinite; diff --git a/node_modules/lodash/isFunction.js b/node_modules/lodash/isFunction.js new file mode 100644 index 0000000..907a8cd --- /dev/null +++ b/node_modules/lodash/isFunction.js @@ -0,0 +1,37 @@ +var baseGetTag = require('./_baseGetTag'), + isObject = require('./isObject'); + +/** `Object#toString` result references. */ +var asyncTag = '[object AsyncFunction]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + proxyTag = '[object Proxy]'; + +/** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a function, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ +function isFunction(value) { + if (!isObject(value)) { + return false; + } + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 9 which returns 'object' for typed arrays and other constructors. + var tag = baseGetTag(value); + return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; +} + +module.exports = isFunction; diff --git a/node_modules/lodash/isInteger.js b/node_modules/lodash/isInteger.js new file mode 100644 index 0000000..66aa87d --- /dev/null +++ b/node_modules/lodash/isInteger.js @@ -0,0 +1,33 @@ +var toInteger = require('./toInteger'); + +/** + * Checks if `value` is an integer. + * + * **Note:** This method is based on + * [`Number.isInteger`](https://mdn.io/Number/isInteger). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an integer, else `false`. + * @example + * + * _.isInteger(3); + * // => true + * + * _.isInteger(Number.MIN_VALUE); + * // => false + * + * _.isInteger(Infinity); + * // => false + * + * _.isInteger('3'); + * // => false + */ +function isInteger(value) { + return typeof value == 'number' && value == toInteger(value); +} + +module.exports = isInteger; diff --git a/node_modules/lodash/isLength.js b/node_modules/lodash/isLength.js new file mode 100644 index 0000000..3a95caa --- /dev/null +++ b/node_modules/lodash/isLength.js @@ -0,0 +1,35 @@ +/** Used as references for various `Number` constants. */ +var MAX_SAFE_INTEGER = 9007199254740991; + +/** + * Checks if `value` is a valid array-like length. + * + * **Note:** This method is loosely based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + * @example + * + * _.isLength(3); + * // => true + * + * _.isLength(Number.MIN_VALUE); + * // => false + * + * _.isLength(Infinity); + * // => false + * + * _.isLength('3'); + * // => false + */ +function isLength(value) { + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; +} + +module.exports = isLength; diff --git a/node_modules/lodash/isMap.js b/node_modules/lodash/isMap.js new file mode 100644 index 0000000..44f8517 --- /dev/null +++ b/node_modules/lodash/isMap.js @@ -0,0 +1,27 @@ +var baseIsMap = require('./_baseIsMap'), + baseUnary = require('./_baseUnary'), + nodeUtil = require('./_nodeUtil'); + +/* Node.js helper references. */ +var nodeIsMap = nodeUtil && nodeUtil.isMap; + +/** + * Checks if `value` is classified as a `Map` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a map, else `false`. + * @example + * + * _.isMap(new Map); + * // => true + * + * _.isMap(new WeakMap); + * // => false + */ +var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap; + +module.exports = isMap; diff --git a/node_modules/lodash/isMatch.js b/node_modules/lodash/isMatch.js new file mode 100644 index 0000000..9773a18 --- /dev/null +++ b/node_modules/lodash/isMatch.js @@ -0,0 +1,36 @@ +var baseIsMatch = require('./_baseIsMatch'), + getMatchData = require('./_getMatchData'); + +/** + * Performs a partial deep comparison between `object` and `source` to + * determine if `object` contains equivalent property values. + * + * **Note:** This method is equivalent to `_.matches` when `source` is + * partially applied. + * + * Partial comparisons will match empty array and empty object `source` + * values against any array or object value, respectively. See `_.isEqual` + * for a list of supported value comparisons. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {Object} object The object to inspect. + * @param {Object} source The object of property values to match. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. + * @example + * + * var object = { 'a': 1, 'b': 2 }; + * + * _.isMatch(object, { 'b': 2 }); + * // => true + * + * _.isMatch(object, { 'b': 1 }); + * // => false + */ +function isMatch(object, source) { + return object === source || baseIsMatch(object, source, getMatchData(source)); +} + +module.exports = isMatch; diff --git a/node_modules/lodash/isMatchWith.js b/node_modules/lodash/isMatchWith.js new file mode 100644 index 0000000..187b6a6 --- /dev/null +++ b/node_modules/lodash/isMatchWith.js @@ -0,0 +1,41 @@ +var baseIsMatch = require('./_baseIsMatch'), + getMatchData = require('./_getMatchData'); + +/** + * This method is like `_.isMatch` except that it accepts `customizer` which + * is invoked to compare values. If `customizer` returns `undefined`, comparisons + * are handled by the method instead. The `customizer` is invoked with five + * arguments: (objValue, srcValue, index|key, object, source). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {Object} object The object to inspect. + * @param {Object} source The object of property values to match. + * @param {Function} [customizer] The function to customize comparisons. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. + * @example + * + * function isGreeting(value) { + * return /^h(?:i|ello)$/.test(value); + * } + * + * function customizer(objValue, srcValue) { + * if (isGreeting(objValue) && isGreeting(srcValue)) { + * return true; + * } + * } + * + * var object = { 'greeting': 'hello' }; + * var source = { 'greeting': 'hi' }; + * + * _.isMatchWith(object, source, customizer); + * // => true + */ +function isMatchWith(object, source, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return baseIsMatch(object, source, getMatchData(source), customizer); +} + +module.exports = isMatchWith; diff --git a/node_modules/lodash/isNaN.js b/node_modules/lodash/isNaN.js new file mode 100644 index 0000000..7d0d783 --- /dev/null +++ b/node_modules/lodash/isNaN.js @@ -0,0 +1,38 @@ +var isNumber = require('./isNumber'); + +/** + * Checks if `value` is `NaN`. + * + * **Note:** This method is based on + * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as + * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for + * `undefined` and other non-number values. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. + * @example + * + * _.isNaN(NaN); + * // => true + * + * _.isNaN(new Number(NaN)); + * // => true + * + * isNaN(undefined); + * // => true + * + * _.isNaN(undefined); + * // => false + */ +function isNaN(value) { + // An `NaN` primitive is the only value that is not equal to itself. + // Perform the `toStringTag` check first to avoid errors with some + // ActiveX objects in IE. + return isNumber(value) && value != +value; +} + +module.exports = isNaN; diff --git a/node_modules/lodash/isNative.js b/node_modules/lodash/isNative.js new file mode 100644 index 0000000..f0cb8d5 --- /dev/null +++ b/node_modules/lodash/isNative.js @@ -0,0 +1,40 @@ +var baseIsNative = require('./_baseIsNative'), + isMaskable = require('./_isMaskable'); + +/** Error message constants. */ +var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.'; + +/** + * Checks if `value` is a pristine native function. + * + * **Note:** This method can't reliably detect native functions in the presence + * of the core-js package because core-js circumvents this kind of detection. + * Despite multiple requests, the core-js maintainer has made it clear: any + * attempt to fix the detection will be obstructed. As a result, we're left + * with little choice but to throw an error. Unfortunately, this also affects + * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill), + * which rely on core-js. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. + * @example + * + * _.isNative(Array.prototype.push); + * // => true + * + * _.isNative(_); + * // => false + */ +function isNative(value) { + if (isMaskable(value)) { + throw new Error(CORE_ERROR_TEXT); + } + return baseIsNative(value); +} + +module.exports = isNative; diff --git a/node_modules/lodash/isNil.js b/node_modules/lodash/isNil.js new file mode 100644 index 0000000..79f0505 --- /dev/null +++ b/node_modules/lodash/isNil.js @@ -0,0 +1,25 @@ +/** + * Checks if `value` is `null` or `undefined`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is nullish, else `false`. + * @example + * + * _.isNil(null); + * // => true + * + * _.isNil(void 0); + * // => true + * + * _.isNil(NaN); + * // => false + */ +function isNil(value) { + return value == null; +} + +module.exports = isNil; diff --git a/node_modules/lodash/isNull.js b/node_modules/lodash/isNull.js new file mode 100644 index 0000000..c0a374d --- /dev/null +++ b/node_modules/lodash/isNull.js @@ -0,0 +1,22 @@ +/** + * Checks if `value` is `null`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `null`, else `false`. + * @example + * + * _.isNull(null); + * // => true + * + * _.isNull(void 0); + * // => false + */ +function isNull(value) { + return value === null; +} + +module.exports = isNull; diff --git a/node_modules/lodash/isNumber.js b/node_modules/lodash/isNumber.js new file mode 100644 index 0000000..cd34ee4 --- /dev/null +++ b/node_modules/lodash/isNumber.js @@ -0,0 +1,38 @@ +var baseGetTag = require('./_baseGetTag'), + isObjectLike = require('./isObjectLike'); + +/** `Object#toString` result references. */ +var numberTag = '[object Number]'; + +/** + * Checks if `value` is classified as a `Number` primitive or object. + * + * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are + * classified as numbers, use the `_.isFinite` method. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a number, else `false`. + * @example + * + * _.isNumber(3); + * // => true + * + * _.isNumber(Number.MIN_VALUE); + * // => true + * + * _.isNumber(Infinity); + * // => true + * + * _.isNumber('3'); + * // => false + */ +function isNumber(value) { + return typeof value == 'number' || + (isObjectLike(value) && baseGetTag(value) == numberTag); +} + +module.exports = isNumber; diff --git a/node_modules/lodash/isObject.js b/node_modules/lodash/isObject.js new file mode 100644 index 0000000..1dc8939 --- /dev/null +++ b/node_modules/lodash/isObject.js @@ -0,0 +1,31 @@ +/** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ +function isObject(value) { + var type = typeof value; + return value != null && (type == 'object' || type == 'function'); +} + +module.exports = isObject; diff --git a/node_modules/lodash/isObjectLike.js b/node_modules/lodash/isObjectLike.js new file mode 100644 index 0000000..301716b --- /dev/null +++ b/node_modules/lodash/isObjectLike.js @@ -0,0 +1,29 @@ +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return value != null && typeof value == 'object'; +} + +module.exports = isObjectLike; diff --git a/node_modules/lodash/isPlainObject.js b/node_modules/lodash/isPlainObject.js new file mode 100644 index 0000000..2387373 --- /dev/null +++ b/node_modules/lodash/isPlainObject.js @@ -0,0 +1,62 @@ +var baseGetTag = require('./_baseGetTag'), + getPrototype = require('./_getPrototype'), + isObjectLike = require('./isObjectLike'); + +/** `Object#toString` result references. */ +var objectTag = '[object Object]'; + +/** Used for built-in method references. */ +var funcProto = Function.prototype, + objectProto = Object.prototype; + +/** Used to resolve the decompiled source of functions. */ +var funcToString = funcProto.toString; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** Used to infer the `Object` constructor. */ +var objectCtorString = funcToString.call(Object); + +/** + * Checks if `value` is a plain object, that is, an object created by the + * `Object` constructor or one with a `[[Prototype]]` of `null`. + * + * @static + * @memberOf _ + * @since 0.8.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * _.isPlainObject(new Foo); + * // => false + * + * _.isPlainObject([1, 2, 3]); + * // => false + * + * _.isPlainObject({ 'x': 0, 'y': 0 }); + * // => true + * + * _.isPlainObject(Object.create(null)); + * // => true + */ +function isPlainObject(value) { + if (!isObjectLike(value) || baseGetTag(value) != objectTag) { + return false; + } + var proto = getPrototype(value); + if (proto === null) { + return true; + } + var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; + return typeof Ctor == 'function' && Ctor instanceof Ctor && + funcToString.call(Ctor) == objectCtorString; +} + +module.exports = isPlainObject; diff --git a/node_modules/lodash/isRegExp.js b/node_modules/lodash/isRegExp.js new file mode 100644 index 0000000..76c9b6e --- /dev/null +++ b/node_modules/lodash/isRegExp.js @@ -0,0 +1,27 @@ +var baseIsRegExp = require('./_baseIsRegExp'), + baseUnary = require('./_baseUnary'), + nodeUtil = require('./_nodeUtil'); + +/* Node.js helper references. */ +var nodeIsRegExp = nodeUtil && nodeUtil.isRegExp; + +/** + * Checks if `value` is classified as a `RegExp` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. + * @example + * + * _.isRegExp(/abc/); + * // => true + * + * _.isRegExp('/abc/'); + * // => false + */ +var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp; + +module.exports = isRegExp; diff --git a/node_modules/lodash/isSafeInteger.js b/node_modules/lodash/isSafeInteger.js new file mode 100644 index 0000000..2a48526 --- /dev/null +++ b/node_modules/lodash/isSafeInteger.js @@ -0,0 +1,37 @@ +var isInteger = require('./isInteger'); + +/** Used as references for various `Number` constants. */ +var MAX_SAFE_INTEGER = 9007199254740991; + +/** + * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754 + * double precision number which isn't the result of a rounded unsafe integer. + * + * **Note:** This method is based on + * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`. + * @example + * + * _.isSafeInteger(3); + * // => true + * + * _.isSafeInteger(Number.MIN_VALUE); + * // => false + * + * _.isSafeInteger(Infinity); + * // => false + * + * _.isSafeInteger('3'); + * // => false + */ +function isSafeInteger(value) { + return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER; +} + +module.exports = isSafeInteger; diff --git a/node_modules/lodash/isSet.js b/node_modules/lodash/isSet.js new file mode 100644 index 0000000..ab88bdf --- /dev/null +++ b/node_modules/lodash/isSet.js @@ -0,0 +1,27 @@ +var baseIsSet = require('./_baseIsSet'), + baseUnary = require('./_baseUnary'), + nodeUtil = require('./_nodeUtil'); + +/* Node.js helper references. */ +var nodeIsSet = nodeUtil && nodeUtil.isSet; + +/** + * Checks if `value` is classified as a `Set` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a set, else `false`. + * @example + * + * _.isSet(new Set); + * // => true + * + * _.isSet(new WeakSet); + * // => false + */ +var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet; + +module.exports = isSet; diff --git a/node_modules/lodash/isString.js b/node_modules/lodash/isString.js new file mode 100644 index 0000000..627eb9c --- /dev/null +++ b/node_modules/lodash/isString.js @@ -0,0 +1,30 @@ +var baseGetTag = require('./_baseGetTag'), + isArray = require('./isArray'), + isObjectLike = require('./isObjectLike'); + +/** `Object#toString` result references. */ +var stringTag = '[object String]'; + +/** + * Checks if `value` is classified as a `String` primitive or object. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a string, else `false`. + * @example + * + * _.isString('abc'); + * // => true + * + * _.isString(1); + * // => false + */ +function isString(value) { + return typeof value == 'string' || + (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag); +} + +module.exports = isString; diff --git a/node_modules/lodash/isSymbol.js b/node_modules/lodash/isSymbol.js new file mode 100644 index 0000000..dfb60b9 --- /dev/null +++ b/node_modules/lodash/isSymbol.js @@ -0,0 +1,29 @@ +var baseGetTag = require('./_baseGetTag'), + isObjectLike = require('./isObjectLike'); + +/** `Object#toString` result references. */ +var symbolTag = '[object Symbol]'; + +/** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ +function isSymbol(value) { + return typeof value == 'symbol' || + (isObjectLike(value) && baseGetTag(value) == symbolTag); +} + +module.exports = isSymbol; diff --git a/node_modules/lodash/isTypedArray.js b/node_modules/lodash/isTypedArray.js new file mode 100644 index 0000000..da3f8dd --- /dev/null +++ b/node_modules/lodash/isTypedArray.js @@ -0,0 +1,27 @@ +var baseIsTypedArray = require('./_baseIsTypedArray'), + baseUnary = require('./_baseUnary'), + nodeUtil = require('./_nodeUtil'); + +/* Node.js helper references. */ +var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; + +/** + * Checks if `value` is classified as a typed array. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + * @example + * + * _.isTypedArray(new Uint8Array); + * // => true + * + * _.isTypedArray([]); + * // => false + */ +var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; + +module.exports = isTypedArray; diff --git a/node_modules/lodash/isUndefined.js b/node_modules/lodash/isUndefined.js new file mode 100644 index 0000000..377d121 --- /dev/null +++ b/node_modules/lodash/isUndefined.js @@ -0,0 +1,22 @@ +/** + * Checks if `value` is `undefined`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`. + * @example + * + * _.isUndefined(void 0); + * // => true + * + * _.isUndefined(null); + * // => false + */ +function isUndefined(value) { + return value === undefined; +} + +module.exports = isUndefined; diff --git a/node_modules/lodash/isWeakMap.js b/node_modules/lodash/isWeakMap.js new file mode 100644 index 0000000..8d36f66 --- /dev/null +++ b/node_modules/lodash/isWeakMap.js @@ -0,0 +1,28 @@ +var getTag = require('./_getTag'), + isObjectLike = require('./isObjectLike'); + +/** `Object#toString` result references. */ +var weakMapTag = '[object WeakMap]'; + +/** + * Checks if `value` is classified as a `WeakMap` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a weak map, else `false`. + * @example + * + * _.isWeakMap(new WeakMap); + * // => true + * + * _.isWeakMap(new Map); + * // => false + */ +function isWeakMap(value) { + return isObjectLike(value) && getTag(value) == weakMapTag; +} + +module.exports = isWeakMap; diff --git a/node_modules/lodash/isWeakSet.js b/node_modules/lodash/isWeakSet.js new file mode 100644 index 0000000..e628b26 --- /dev/null +++ b/node_modules/lodash/isWeakSet.js @@ -0,0 +1,28 @@ +var baseGetTag = require('./_baseGetTag'), + isObjectLike = require('./isObjectLike'); + +/** `Object#toString` result references. */ +var weakSetTag = '[object WeakSet]'; + +/** + * Checks if `value` is classified as a `WeakSet` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a weak set, else `false`. + * @example + * + * _.isWeakSet(new WeakSet); + * // => true + * + * _.isWeakSet(new Set); + * // => false + */ +function isWeakSet(value) { + return isObjectLike(value) && baseGetTag(value) == weakSetTag; +} + +module.exports = isWeakSet; diff --git a/node_modules/lodash/iteratee.js b/node_modules/lodash/iteratee.js new file mode 100644 index 0000000..61b73a8 --- /dev/null +++ b/node_modules/lodash/iteratee.js @@ -0,0 +1,53 @@ +var baseClone = require('./_baseClone'), + baseIteratee = require('./_baseIteratee'); + +/** Used to compose bitmasks for cloning. */ +var CLONE_DEEP_FLAG = 1; + +/** + * Creates a function that invokes `func` with the arguments of the created + * function. If `func` is a property name, the created function returns the + * property value for a given element. If `func` is an array or object, the + * created function returns `true` for elements that contain the equivalent + * source properties, otherwise it returns `false`. + * + * @static + * @since 4.0.0 + * @memberOf _ + * @category Util + * @param {*} [func=_.identity] The value to convert to a callback. + * @returns {Function} Returns the callback. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false } + * ]; + * + * // The `_.matches` iteratee shorthand. + * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true })); + * // => [{ 'user': 'barney', 'age': 36, 'active': true }] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.filter(users, _.iteratee(['user', 'fred'])); + * // => [{ 'user': 'fred', 'age': 40 }] + * + * // The `_.property` iteratee shorthand. + * _.map(users, _.iteratee('user')); + * // => ['barney', 'fred'] + * + * // Create custom iteratee shorthands. + * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) { + * return !_.isRegExp(func) ? iteratee(func) : function(string) { + * return func.test(string); + * }; + * }); + * + * _.filter(['abc', 'def'], /ef/); + * // => ['def'] + */ +function iteratee(func) { + return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG)); +} + +module.exports = iteratee; diff --git a/node_modules/lodash/join.js b/node_modules/lodash/join.js new file mode 100644 index 0000000..45de079 --- /dev/null +++ b/node_modules/lodash/join.js @@ -0,0 +1,26 @@ +/** Used for built-in method references. */ +var arrayProto = Array.prototype; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeJoin = arrayProto.join; + +/** + * Converts all elements in `array` into a string separated by `separator`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to convert. + * @param {string} [separator=','] The element separator. + * @returns {string} Returns the joined string. + * @example + * + * _.join(['a', 'b', 'c'], '~'); + * // => 'a~b~c' + */ +function join(array, separator) { + return array == null ? '' : nativeJoin.call(array, separator); +} + +module.exports = join; diff --git a/node_modules/lodash/kebabCase.js b/node_modules/lodash/kebabCase.js new file mode 100644 index 0000000..8a52be6 --- /dev/null +++ b/node_modules/lodash/kebabCase.js @@ -0,0 +1,28 @@ +var createCompounder = require('./_createCompounder'); + +/** + * Converts `string` to + * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the kebab cased string. + * @example + * + * _.kebabCase('Foo Bar'); + * // => 'foo-bar' + * + * _.kebabCase('fooBar'); + * // => 'foo-bar' + * + * _.kebabCase('__FOO_BAR__'); + * // => 'foo-bar' + */ +var kebabCase = createCompounder(function(result, word, index) { + return result + (index ? '-' : '') + word.toLowerCase(); +}); + +module.exports = kebabCase; diff --git a/node_modules/lodash/keyBy.js b/node_modules/lodash/keyBy.js new file mode 100644 index 0000000..acc007a --- /dev/null +++ b/node_modules/lodash/keyBy.js @@ -0,0 +1,36 @@ +var baseAssignValue = require('./_baseAssignValue'), + createAggregator = require('./_createAggregator'); + +/** + * Creates an object composed of keys generated from the results of running + * each element of `collection` thru `iteratee`. The corresponding value of + * each key is the last element responsible for generating the key. The + * iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The iteratee to transform keys. + * @returns {Object} Returns the composed aggregate object. + * @example + * + * var array = [ + * { 'dir': 'left', 'code': 97 }, + * { 'dir': 'right', 'code': 100 } + * ]; + * + * _.keyBy(array, function(o) { + * return String.fromCharCode(o.code); + * }); + * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } } + * + * _.keyBy(array, 'dir'); + * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } } + */ +var keyBy = createAggregator(function(result, value, key) { + baseAssignValue(result, key, value); +}); + +module.exports = keyBy; diff --git a/node_modules/lodash/keys.js b/node_modules/lodash/keys.js new file mode 100644 index 0000000..d143c71 --- /dev/null +++ b/node_modules/lodash/keys.js @@ -0,0 +1,37 @@ +var arrayLikeKeys = require('./_arrayLikeKeys'), + baseKeys = require('./_baseKeys'), + isArrayLike = require('./isArrayLike'); + +/** + * Creates an array of the own enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. See the + * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * for more details. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keys(new Foo); + * // => ['a', 'b'] (iteration order is not guaranteed) + * + * _.keys('hi'); + * // => ['0', '1'] + */ +function keys(object) { + return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); +} + +module.exports = keys; diff --git a/node_modules/lodash/keysIn.js b/node_modules/lodash/keysIn.js new file mode 100644 index 0000000..a62308f --- /dev/null +++ b/node_modules/lodash/keysIn.js @@ -0,0 +1,32 @@ +var arrayLikeKeys = require('./_arrayLikeKeys'), + baseKeysIn = require('./_baseKeysIn'), + isArrayLike = require('./isArrayLike'); + +/** + * Creates an array of the own and inherited enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keysIn(new Foo); + * // => ['a', 'b', 'c'] (iteration order is not guaranteed) + */ +function keysIn(object) { + return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); +} + +module.exports = keysIn; diff --git a/node_modules/lodash/lang.js b/node_modules/lodash/lang.js new file mode 100644 index 0000000..a396216 --- /dev/null +++ b/node_modules/lodash/lang.js @@ -0,0 +1,58 @@ +module.exports = { + 'castArray': require('./castArray'), + 'clone': require('./clone'), + 'cloneDeep': require('./cloneDeep'), + 'cloneDeepWith': require('./cloneDeepWith'), + 'cloneWith': require('./cloneWith'), + 'conformsTo': require('./conformsTo'), + 'eq': require('./eq'), + 'gt': require('./gt'), + 'gte': require('./gte'), + 'isArguments': require('./isArguments'), + 'isArray': require('./isArray'), + 'isArrayBuffer': require('./isArrayBuffer'), + 'isArrayLike': require('./isArrayLike'), + 'isArrayLikeObject': require('./isArrayLikeObject'), + 'isBoolean': require('./isBoolean'), + 'isBuffer': require('./isBuffer'), + 'isDate': require('./isDate'), + 'isElement': require('./isElement'), + 'isEmpty': require('./isEmpty'), + 'isEqual': require('./isEqual'), + 'isEqualWith': require('./isEqualWith'), + 'isError': require('./isError'), + 'isFinite': require('./isFinite'), + 'isFunction': require('./isFunction'), + 'isInteger': require('./isInteger'), + 'isLength': require('./isLength'), + 'isMap': require('./isMap'), + 'isMatch': require('./isMatch'), + 'isMatchWith': require('./isMatchWith'), + 'isNaN': require('./isNaN'), + 'isNative': require('./isNative'), + 'isNil': require('./isNil'), + 'isNull': require('./isNull'), + 'isNumber': require('./isNumber'), + 'isObject': require('./isObject'), + 'isObjectLike': require('./isObjectLike'), + 'isPlainObject': require('./isPlainObject'), + 'isRegExp': require('./isRegExp'), + 'isSafeInteger': require('./isSafeInteger'), + 'isSet': require('./isSet'), + 'isString': require('./isString'), + 'isSymbol': require('./isSymbol'), + 'isTypedArray': require('./isTypedArray'), + 'isUndefined': require('./isUndefined'), + 'isWeakMap': require('./isWeakMap'), + 'isWeakSet': require('./isWeakSet'), + 'lt': require('./lt'), + 'lte': require('./lte'), + 'toArray': require('./toArray'), + 'toFinite': require('./toFinite'), + 'toInteger': require('./toInteger'), + 'toLength': require('./toLength'), + 'toNumber': require('./toNumber'), + 'toPlainObject': require('./toPlainObject'), + 'toSafeInteger': require('./toSafeInteger'), + 'toString': require('./toString') +}; diff --git a/node_modules/lodash/last.js b/node_modules/lodash/last.js new file mode 100644 index 0000000..cad1eaf --- /dev/null +++ b/node_modules/lodash/last.js @@ -0,0 +1,20 @@ +/** + * Gets the last element of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to query. + * @returns {*} Returns the last element of `array`. + * @example + * + * _.last([1, 2, 3]); + * // => 3 + */ +function last(array) { + var length = array == null ? 0 : array.length; + return length ? array[length - 1] : undefined; +} + +module.exports = last; diff --git a/node_modules/lodash/lastIndexOf.js b/node_modules/lodash/lastIndexOf.js new file mode 100644 index 0000000..dabfb61 --- /dev/null +++ b/node_modules/lodash/lastIndexOf.js @@ -0,0 +1,46 @@ +var baseFindIndex = require('./_baseFindIndex'), + baseIsNaN = require('./_baseIsNaN'), + strictLastIndexOf = require('./_strictLastIndexOf'), + toInteger = require('./toInteger'); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max, + nativeMin = Math.min; + +/** + * This method is like `_.indexOf` except that it iterates over elements of + * `array` from right to left. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} [fromIndex=array.length-1] The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.lastIndexOf([1, 2, 1, 2], 2); + * // => 3 + * + * // Search from the `fromIndex`. + * _.lastIndexOf([1, 2, 1, 2], 2, 2); + * // => 1 + */ +function lastIndexOf(array, value, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index = length; + if (fromIndex !== undefined) { + index = toInteger(fromIndex); + index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1); + } + return value === value + ? strictLastIndexOf(array, value, index) + : baseFindIndex(array, baseIsNaN, index, true); +} + +module.exports = lastIndexOf; diff --git a/node_modules/lodash/lodash.js b/node_modules/lodash/lodash.js new file mode 100644 index 0000000..4131e93 --- /dev/null +++ b/node_modules/lodash/lodash.js @@ -0,0 +1,17209 @@ +/** + * @license + * Lodash + * Copyright OpenJS Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ +;(function() { + + /** Used as a safe reference for `undefined` in pre-ES5 environments. */ + var undefined; + + /** Used as the semantic version number. */ + var VERSION = '4.17.21'; + + /** Used as the size to enable large array optimizations. */ + var LARGE_ARRAY_SIZE = 200; + + /** Error message constants. */ + var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.', + FUNC_ERROR_TEXT = 'Expected a function', + INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`'; + + /** Used to stand-in for `undefined` hash values. */ + var HASH_UNDEFINED = '__lodash_hash_undefined__'; + + /** Used as the maximum memoize cache size. */ + var MAX_MEMOIZE_SIZE = 500; + + /** Used as the internal argument placeholder. */ + var PLACEHOLDER = '__lodash_placeholder__'; + + /** Used to compose bitmasks for cloning. */ + var CLONE_DEEP_FLAG = 1, + CLONE_FLAT_FLAG = 2, + CLONE_SYMBOLS_FLAG = 4; + + /** Used to compose bitmasks for value comparisons. */ + var COMPARE_PARTIAL_FLAG = 1, + COMPARE_UNORDERED_FLAG = 2; + + /** Used to compose bitmasks for function metadata. */ + var WRAP_BIND_FLAG = 1, + WRAP_BIND_KEY_FLAG = 2, + WRAP_CURRY_BOUND_FLAG = 4, + WRAP_CURRY_FLAG = 8, + WRAP_CURRY_RIGHT_FLAG = 16, + WRAP_PARTIAL_FLAG = 32, + WRAP_PARTIAL_RIGHT_FLAG = 64, + WRAP_ARY_FLAG = 128, + WRAP_REARG_FLAG = 256, + WRAP_FLIP_FLAG = 512; + + /** Used as default options for `_.truncate`. */ + var DEFAULT_TRUNC_LENGTH = 30, + DEFAULT_TRUNC_OMISSION = '...'; + + /** Used to detect hot functions by number of calls within a span of milliseconds. */ + var HOT_COUNT = 800, + HOT_SPAN = 16; + + /** Used to indicate the type of lazy iteratees. */ + var LAZY_FILTER_FLAG = 1, + LAZY_MAP_FLAG = 2, + LAZY_WHILE_FLAG = 3; + + /** Used as references for various `Number` constants. */ + var INFINITY = 1 / 0, + MAX_SAFE_INTEGER = 9007199254740991, + MAX_INTEGER = 1.7976931348623157e+308, + NAN = 0 / 0; + + /** Used as references for the maximum length and index of an array. */ + var MAX_ARRAY_LENGTH = 4294967295, + MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1, + HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1; + + /** Used to associate wrap methods with their bit flags. */ + var wrapFlags = [ + ['ary', WRAP_ARY_FLAG], + ['bind', WRAP_BIND_FLAG], + ['bindKey', WRAP_BIND_KEY_FLAG], + ['curry', WRAP_CURRY_FLAG], + ['curryRight', WRAP_CURRY_RIGHT_FLAG], + ['flip', WRAP_FLIP_FLAG], + ['partial', WRAP_PARTIAL_FLAG], + ['partialRight', WRAP_PARTIAL_RIGHT_FLAG], + ['rearg', WRAP_REARG_FLAG] + ]; + + /** `Object#toString` result references. */ + var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + asyncTag = '[object AsyncFunction]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + domExcTag = '[object DOMException]', + errorTag = '[object Error]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + mapTag = '[object Map]', + numberTag = '[object Number]', + nullTag = '[object Null]', + objectTag = '[object Object]', + promiseTag = '[object Promise]', + proxyTag = '[object Proxy]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + symbolTag = '[object Symbol]', + undefinedTag = '[object Undefined]', + weakMapTag = '[object WeakMap]', + weakSetTag = '[object WeakSet]'; + + var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; + + /** Used to match empty string literals in compiled template source. */ + var reEmptyStringLeading = /\b__p \+= '';/g, + reEmptyStringMiddle = /\b(__p \+=) '' \+/g, + reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g; + + /** Used to match HTML entities and HTML characters. */ + var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g, + reUnescapedHtml = /[&<>"']/g, + reHasEscapedHtml = RegExp(reEscapedHtml.source), + reHasUnescapedHtml = RegExp(reUnescapedHtml.source); + + /** Used to match template delimiters. */ + var reEscape = /<%-([\s\S]+?)%>/g, + reEvaluate = /<%([\s\S]+?)%>/g, + reInterpolate = /<%=([\s\S]+?)%>/g; + + /** Used to match property names within property paths. */ + var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, + reIsPlainProp = /^\w*$/, + rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; + + /** + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). + */ + var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, + reHasRegExpChar = RegExp(reRegExpChar.source); + + /** Used to match leading whitespace. */ + var reTrimStart = /^\s+/; + + /** Used to match a single whitespace character. */ + var reWhitespace = /\s/; + + /** Used to match wrap detail comments. */ + var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, + reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/, + reSplitDetails = /,? & /; + + /** Used to match words composed of alphanumeric characters. */ + var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g; + + /** + * Used to validate the `validate` option in `_.template` variable. + * + * Forbids characters which could potentially change the meaning of the function argument definition: + * - "()," (modification of function parameters) + * - "=" (default value) + * - "[]{}" (destructuring of function parameters) + * - "/" (beginning of a comment) + * - whitespace + */ + var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/; + + /** Used to match backslashes in property paths. */ + var reEscapeChar = /\\(\\)?/g; + + /** + * Used to match + * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components). + */ + var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g; + + /** Used to match `RegExp` flags from their coerced string values. */ + var reFlags = /\w*$/; + + /** Used to detect bad signed hexadecimal string values. */ + var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; + + /** Used to detect binary string values. */ + var reIsBinary = /^0b[01]+$/i; + + /** Used to detect host constructors (Safari). */ + var reIsHostCtor = /^\[object .+?Constructor\]$/; + + /** Used to detect octal string values. */ + var reIsOctal = /^0o[0-7]+$/i; + + /** Used to detect unsigned integer values. */ + var reIsUint = /^(?:0|[1-9]\d*)$/; + + /** Used to match Latin Unicode letters (excluding mathematical operators). */ + var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g; + + /** Used to ensure capturing order of template delimiters. */ + var reNoMatch = /($^)/; + + /** Used to match unescaped characters in compiled string literals. */ + var reUnescapedString = /['\n\r\u2028\u2029\\]/g; + + /** Used to compose unicode character classes. */ + var rsAstralRange = '\\ud800-\\udfff', + rsComboMarksRange = '\\u0300-\\u036f', + reComboHalfMarksRange = '\\ufe20-\\ufe2f', + rsComboSymbolsRange = '\\u20d0-\\u20ff', + rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, + rsDingbatRange = '\\u2700-\\u27bf', + rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff', + rsMathOpRange = '\\xac\\xb1\\xd7\\xf7', + rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf', + rsPunctuationRange = '\\u2000-\\u206f', + rsSpaceRange = ' \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000', + rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde', + rsVarRange = '\\ufe0e\\ufe0f', + rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange; + + /** Used to compose unicode capture groups. */ + var rsApos = "['\u2019]", + rsAstral = '[' + rsAstralRange + ']', + rsBreak = '[' + rsBreakRange + ']', + rsCombo = '[' + rsComboRange + ']', + rsDigits = '\\d+', + rsDingbat = '[' + rsDingbatRange + ']', + rsLower = '[' + rsLowerRange + ']', + rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']', + rsFitz = '\\ud83c[\\udffb-\\udfff]', + rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', + rsNonAstral = '[^' + rsAstralRange + ']', + rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', + rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', + rsUpper = '[' + rsUpperRange + ']', + rsZWJ = '\\u200d'; + + /** Used to compose unicode regexes. */ + var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')', + rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')', + rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?', + rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?', + reOptMod = rsModifier + '?', + rsOptVar = '[' + rsVarRange + ']?', + rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', + rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])', + rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])', + rsSeq = rsOptVar + reOptMod + rsOptJoin, + rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq, + rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; + + /** Used to match apostrophes. */ + var reApos = RegExp(rsApos, 'g'); + + /** + * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and + * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols). + */ + var reComboMark = RegExp(rsCombo, 'g'); + + /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ + var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); + + /** Used to match complex or compound words. */ + var reUnicodeWord = RegExp([ + rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')', + rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')', + rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower, + rsUpper + '+' + rsOptContrUpper, + rsOrdUpper, + rsOrdLower, + rsDigits, + rsEmoji + ].join('|'), 'g'); + + /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ + var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']'); + + /** Used to detect strings that need a more robust regexp to match words. */ + var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/; + + /** Used to assign default `context` object properties. */ + var contextProps = [ + 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array', + 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object', + 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array', + 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap', + '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout' + ]; + + /** Used to make template sourceURLs easier to identify. */ + var templateCounter = -1; + + /** Used to identify `toStringTag` values of typed arrays. */ + var typedArrayTags = {}; + typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = + typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = + typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = + typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = + typedArrayTags[uint32Tag] = true; + typedArrayTags[argsTag] = typedArrayTags[arrayTag] = + typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = + typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = + typedArrayTags[errorTag] = typedArrayTags[funcTag] = + typedArrayTags[mapTag] = typedArrayTags[numberTag] = + typedArrayTags[objectTag] = typedArrayTags[regexpTag] = + typedArrayTags[setTag] = typedArrayTags[stringTag] = + typedArrayTags[weakMapTag] = false; + + /** Used to identify `toStringTag` values supported by `_.clone`. */ + var cloneableTags = {}; + cloneableTags[argsTag] = cloneableTags[arrayTag] = + cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = + cloneableTags[boolTag] = cloneableTags[dateTag] = + cloneableTags[float32Tag] = cloneableTags[float64Tag] = + cloneableTags[int8Tag] = cloneableTags[int16Tag] = + cloneableTags[int32Tag] = cloneableTags[mapTag] = + cloneableTags[numberTag] = cloneableTags[objectTag] = + cloneableTags[regexpTag] = cloneableTags[setTag] = + cloneableTags[stringTag] = cloneableTags[symbolTag] = + cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = + cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; + cloneableTags[errorTag] = cloneableTags[funcTag] = + cloneableTags[weakMapTag] = false; + + /** Used to map Latin Unicode letters to basic Latin letters. */ + var deburredLetters = { + // Latin-1 Supplement block. + '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A', + '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a', + '\xc7': 'C', '\xe7': 'c', + '\xd0': 'D', '\xf0': 'd', + '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E', + '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e', + '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I', + '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i', + '\xd1': 'N', '\xf1': 'n', + '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O', + '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o', + '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U', + '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u', + '\xdd': 'Y', '\xfd': 'y', '\xff': 'y', + '\xc6': 'Ae', '\xe6': 'ae', + '\xde': 'Th', '\xfe': 'th', + '\xdf': 'ss', + // Latin Extended-A block. + '\u0100': 'A', '\u0102': 'A', '\u0104': 'A', + '\u0101': 'a', '\u0103': 'a', '\u0105': 'a', + '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C', + '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c', + '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd', + '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E', + '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e', + '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G', + '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g', + '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h', + '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I', + '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i', + '\u0134': 'J', '\u0135': 'j', + '\u0136': 'K', '\u0137': 'k', '\u0138': 'k', + '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L', + '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l', + '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N', + '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n', + '\u014c': 'O', '\u014e': 'O', '\u0150': 'O', + '\u014d': 'o', '\u014f': 'o', '\u0151': 'o', + '\u0154': 'R', '\u0156': 'R', '\u0158': 'R', + '\u0155': 'r', '\u0157': 'r', '\u0159': 'r', + '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S', + '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's', + '\u0162': 'T', '\u0164': 'T', '\u0166': 'T', + '\u0163': 't', '\u0165': 't', '\u0167': 't', + '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U', + '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u', + '\u0174': 'W', '\u0175': 'w', + '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y', + '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z', + '\u017a': 'z', '\u017c': 'z', '\u017e': 'z', + '\u0132': 'IJ', '\u0133': 'ij', + '\u0152': 'Oe', '\u0153': 'oe', + '\u0149': "'n", '\u017f': 's' + }; + + /** Used to map characters to HTML entities. */ + var htmlEscapes = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''' + }; + + /** Used to map HTML entities to characters. */ + var htmlUnescapes = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + ''': "'" + }; + + /** Used to escape characters for inclusion in compiled string literals. */ + var stringEscapes = { + '\\': '\\', + "'": "'", + '\n': 'n', + '\r': 'r', + '\u2028': 'u2028', + '\u2029': 'u2029' + }; + + /** Built-in method references without a dependency on `root`. */ + var freeParseFloat = parseFloat, + freeParseInt = parseInt; + + /** Detect free variable `global` from Node.js. */ + var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; + + /** Detect free variable `self`. */ + var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + + /** Used as a reference to the global object. */ + var root = freeGlobal || freeSelf || Function('return this')(); + + /** Detect free variable `exports`. */ + var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; + + /** Detect free variable `module`. */ + var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; + + /** Detect the popular CommonJS extension `module.exports`. */ + var moduleExports = freeModule && freeModule.exports === freeExports; + + /** Detect free variable `process` from Node.js. */ + var freeProcess = moduleExports && freeGlobal.process; + + /** Used to access faster Node.js helpers. */ + var nodeUtil = (function() { + try { + // Use `util.types` for Node.js 10+. + var types = freeModule && freeModule.require && freeModule.require('util').types; + + if (types) { + return types; + } + + // Legacy `process.binding('util')` for Node.js < 10. + return freeProcess && freeProcess.binding && freeProcess.binding('util'); + } catch (e) {} + }()); + + /* Node.js helper references. */ + var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer, + nodeIsDate = nodeUtil && nodeUtil.isDate, + nodeIsMap = nodeUtil && nodeUtil.isMap, + nodeIsRegExp = nodeUtil && nodeUtil.isRegExp, + nodeIsSet = nodeUtil && nodeUtil.isSet, + nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; + + /*--------------------------------------------------------------------------*/ + + /** + * A faster alternative to `Function#apply`, this function invokes `func` + * with the `this` binding of `thisArg` and the arguments of `args`. + * + * @private + * @param {Function} func The function to invoke. + * @param {*} thisArg The `this` binding of `func`. + * @param {Array} args The arguments to invoke `func` with. + * @returns {*} Returns the result of `func`. + */ + function apply(func, thisArg, args) { + switch (args.length) { + case 0: return func.call(thisArg); + case 1: return func.call(thisArg, args[0]); + case 2: return func.call(thisArg, args[0], args[1]); + case 3: return func.call(thisArg, args[0], args[1], args[2]); + } + return func.apply(thisArg, args); + } + + /** + * A specialized version of `baseAggregator` for arrays. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} setter The function to set `accumulator` values. + * @param {Function} iteratee The iteratee to transform keys. + * @param {Object} accumulator The initial aggregated object. + * @returns {Function} Returns `accumulator`. + */ + function arrayAggregator(array, setter, iteratee, accumulator) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + var value = array[index]; + setter(accumulator, value, iteratee(value), array); + } + return accumulator; + } + + /** + * A specialized version of `_.forEach` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns `array`. + */ + function arrayEach(array, iteratee) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (iteratee(array[index], index, array) === false) { + break; + } + } + return array; + } + + /** + * A specialized version of `_.forEachRight` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns `array`. + */ + function arrayEachRight(array, iteratee) { + var length = array == null ? 0 : array.length; + + while (length--) { + if (iteratee(array[length], length, array) === false) { + break; + } + } + return array; + } + + /** + * A specialized version of `_.every` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false`. + */ + function arrayEvery(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (!predicate(array[index], index, array)) { + return false; + } + } + return true; + } + + /** + * A specialized version of `_.filter` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + */ + function arrayFilter(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (predicate(value, index, array)) { + result[resIndex++] = value; + } + } + return result; + } + + /** + * A specialized version of `_.includes` for arrays without support for + * specifying an index to search from. + * + * @private + * @param {Array} [array] The array to inspect. + * @param {*} target The value to search for. + * @returns {boolean} Returns `true` if `target` is found, else `false`. + */ + function arrayIncludes(array, value) { + var length = array == null ? 0 : array.length; + return !!length && baseIndexOf(array, value, 0) > -1; + } + + /** + * This function is like `arrayIncludes` except that it accepts a comparator. + * + * @private + * @param {Array} [array] The array to inspect. + * @param {*} target The value to search for. + * @param {Function} comparator The comparator invoked per element. + * @returns {boolean} Returns `true` if `target` is found, else `false`. + */ + function arrayIncludesWith(array, value, comparator) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (comparator(value, array[index])) { + return true; + } + } + return false; + } + + /** + * A specialized version of `_.map` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ + function arrayMap(array, iteratee) { + var index = -1, + length = array == null ? 0 : array.length, + result = Array(length); + + while (++index < length) { + result[index] = iteratee(array[index], index, array); + } + return result; + } + + /** + * Appends the elements of `values` to `array`. + * + * @private + * @param {Array} array The array to modify. + * @param {Array} values The values to append. + * @returns {Array} Returns `array`. + */ + function arrayPush(array, values) { + var index = -1, + length = values.length, + offset = array.length; + + while (++index < length) { + array[offset + index] = values[index]; + } + return array; + } + + /** + * A specialized version of `_.reduce` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @param {boolean} [initAccum] Specify using the first element of `array` as + * the initial value. + * @returns {*} Returns the accumulated value. + */ + function arrayReduce(array, iteratee, accumulator, initAccum) { + var index = -1, + length = array == null ? 0 : array.length; + + if (initAccum && length) { + accumulator = array[++index]; + } + while (++index < length) { + accumulator = iteratee(accumulator, array[index], index, array); + } + return accumulator; + } + + /** + * A specialized version of `_.reduceRight` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @param {boolean} [initAccum] Specify using the last element of `array` as + * the initial value. + * @returns {*} Returns the accumulated value. + */ + function arrayReduceRight(array, iteratee, accumulator, initAccum) { + var length = array == null ? 0 : array.length; + if (initAccum && length) { + accumulator = array[--length]; + } + while (length--) { + accumulator = iteratee(accumulator, array[length], length, array); + } + return accumulator; + } + + /** + * A specialized version of `_.some` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + */ + function arraySome(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (predicate(array[index], index, array)) { + return true; + } + } + return false; + } + + /** + * Gets the size of an ASCII `string`. + * + * @private + * @param {string} string The string inspect. + * @returns {number} Returns the string size. + */ + var asciiSize = baseProperty('length'); + + /** + * Converts an ASCII `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ + function asciiToArray(string) { + return string.split(''); + } + + /** + * Splits an ASCII `string` into an array of its words. + * + * @private + * @param {string} The string to inspect. + * @returns {Array} Returns the words of `string`. + */ + function asciiWords(string) { + return string.match(reAsciiWord) || []; + } + + /** + * The base implementation of methods like `_.findKey` and `_.findLastKey`, + * without support for iteratee shorthands, which iterates over `collection` + * using `eachFunc`. + * + * @private + * @param {Array|Object} collection The collection to inspect. + * @param {Function} predicate The function invoked per iteration. + * @param {Function} eachFunc The function to iterate over `collection`. + * @returns {*} Returns the found element or its key, else `undefined`. + */ + function baseFindKey(collection, predicate, eachFunc) { + var result; + eachFunc(collection, function(value, key, collection) { + if (predicate(value, key, collection)) { + result = key; + return false; + } + }); + return result; + } + + /** + * The base implementation of `_.findIndex` and `_.findLastIndex` without + * support for iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} predicate The function invoked per iteration. + * @param {number} fromIndex The index to search from. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function baseFindIndex(array, predicate, fromIndex, fromRight) { + var length = array.length, + index = fromIndex + (fromRight ? 1 : -1); + + while ((fromRight ? index-- : ++index < length)) { + if (predicate(array[index], index, array)) { + return index; + } + } + return -1; + } + + /** + * The base implementation of `_.indexOf` without `fromIndex` bounds checks. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function baseIndexOf(array, value, fromIndex) { + return value === value + ? strictIndexOf(array, value, fromIndex) + : baseFindIndex(array, baseIsNaN, fromIndex); + } + + /** + * This function is like `baseIndexOf` except that it accepts a comparator. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @param {Function} comparator The comparator invoked per element. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function baseIndexOfWith(array, value, fromIndex, comparator) { + var index = fromIndex - 1, + length = array.length; + + while (++index < length) { + if (comparator(array[index], value)) { + return index; + } + } + return -1; + } + + /** + * The base implementation of `_.isNaN` without support for number objects. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. + */ + function baseIsNaN(value) { + return value !== value; + } + + /** + * The base implementation of `_.mean` and `_.meanBy` without support for + * iteratee shorthands. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {number} Returns the mean. + */ + function baseMean(array, iteratee) { + var length = array == null ? 0 : array.length; + return length ? (baseSum(array, iteratee) / length) : NAN; + } + + /** + * The base implementation of `_.property` without support for deep paths. + * + * @private + * @param {string} key The key of the property to get. + * @returns {Function} Returns the new accessor function. + */ + function baseProperty(key) { + return function(object) { + return object == null ? undefined : object[key]; + }; + } + + /** + * The base implementation of `_.propertyOf` without support for deep paths. + * + * @private + * @param {Object} object The object to query. + * @returns {Function} Returns the new accessor function. + */ + function basePropertyOf(object) { + return function(key) { + return object == null ? undefined : object[key]; + }; + } + + /** + * The base implementation of `_.reduce` and `_.reduceRight`, without support + * for iteratee shorthands, which iterates over `collection` using `eachFunc`. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} accumulator The initial value. + * @param {boolean} initAccum Specify using the first or last element of + * `collection` as the initial value. + * @param {Function} eachFunc The function to iterate over `collection`. + * @returns {*} Returns the accumulated value. + */ + function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) { + eachFunc(collection, function(value, index, collection) { + accumulator = initAccum + ? (initAccum = false, value) + : iteratee(accumulator, value, index, collection); + }); + return accumulator; + } + + /** + * The base implementation of `_.sortBy` which uses `comparer` to define the + * sort order of `array` and replaces criteria objects with their corresponding + * values. + * + * @private + * @param {Array} array The array to sort. + * @param {Function} comparer The function to define sort order. + * @returns {Array} Returns `array`. + */ + function baseSortBy(array, comparer) { + var length = array.length; + + array.sort(comparer); + while (length--) { + array[length] = array[length].value; + } + return array; + } + + /** + * The base implementation of `_.sum` and `_.sumBy` without support for + * iteratee shorthands. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {number} Returns the sum. + */ + function baseSum(array, iteratee) { + var result, + index = -1, + length = array.length; + + while (++index < length) { + var current = iteratee(array[index]); + if (current !== undefined) { + result = result === undefined ? current : (result + current); + } + } + return result; + } + + /** + * The base implementation of `_.times` without support for iteratee shorthands + * or max array length checks. + * + * @private + * @param {number} n The number of times to invoke `iteratee`. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the array of results. + */ + function baseTimes(n, iteratee) { + var index = -1, + result = Array(n); + + while (++index < n) { + result[index] = iteratee(index); + } + return result; + } + + /** + * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array + * of key-value pairs for `object` corresponding to the property names of `props`. + * + * @private + * @param {Object} object The object to query. + * @param {Array} props The property names to get values for. + * @returns {Object} Returns the key-value pairs. + */ + function baseToPairs(object, props) { + return arrayMap(props, function(key) { + return [key, object[key]]; + }); + } + + /** + * The base implementation of `_.trim`. + * + * @private + * @param {string} string The string to trim. + * @returns {string} Returns the trimmed string. + */ + function baseTrim(string) { + return string + ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '') + : string; + } + + /** + * The base implementation of `_.unary` without support for storing metadata. + * + * @private + * @param {Function} func The function to cap arguments for. + * @returns {Function} Returns the new capped function. + */ + function baseUnary(func) { + return function(value) { + return func(value); + }; + } + + /** + * The base implementation of `_.values` and `_.valuesIn` which creates an + * array of `object` property values corresponding to the property names + * of `props`. + * + * @private + * @param {Object} object The object to query. + * @param {Array} props The property names to get values for. + * @returns {Object} Returns the array of property values. + */ + function baseValues(object, props) { + return arrayMap(props, function(key) { + return object[key]; + }); + } + + /** + * Checks if a `cache` value for `key` exists. + * + * @private + * @param {Object} cache The cache to query. + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function cacheHas(cache, key) { + return cache.has(key); + } + + /** + * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol + * that is not found in the character symbols. + * + * @private + * @param {Array} strSymbols The string symbols to inspect. + * @param {Array} chrSymbols The character symbols to find. + * @returns {number} Returns the index of the first unmatched string symbol. + */ + function charsStartIndex(strSymbols, chrSymbols) { + var index = -1, + length = strSymbols.length; + + while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} + return index; + } + + /** + * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol + * that is not found in the character symbols. + * + * @private + * @param {Array} strSymbols The string symbols to inspect. + * @param {Array} chrSymbols The character symbols to find. + * @returns {number} Returns the index of the last unmatched string symbol. + */ + function charsEndIndex(strSymbols, chrSymbols) { + var index = strSymbols.length; + + while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} + return index; + } + + /** + * Gets the number of `placeholder` occurrences in `array`. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} placeholder The placeholder to search for. + * @returns {number} Returns the placeholder count. + */ + function countHolders(array, placeholder) { + var length = array.length, + result = 0; + + while (length--) { + if (array[length] === placeholder) { + ++result; + } + } + return result; + } + + /** + * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A + * letters to basic Latin letters. + * + * @private + * @param {string} letter The matched letter to deburr. + * @returns {string} Returns the deburred letter. + */ + var deburrLetter = basePropertyOf(deburredLetters); + + /** + * Used by `_.escape` to convert characters to HTML entities. + * + * @private + * @param {string} chr The matched character to escape. + * @returns {string} Returns the escaped character. + */ + var escapeHtmlChar = basePropertyOf(htmlEscapes); + + /** + * Used by `_.template` to escape characters for inclusion in compiled string literals. + * + * @private + * @param {string} chr The matched character to escape. + * @returns {string} Returns the escaped character. + */ + function escapeStringChar(chr) { + return '\\' + stringEscapes[chr]; + } + + /** + * Gets the value at `key` of `object`. + * + * @private + * @param {Object} [object] The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ + function getValue(object, key) { + return object == null ? undefined : object[key]; + } + + /** + * Checks if `string` contains Unicode symbols. + * + * @private + * @param {string} string The string to inspect. + * @returns {boolean} Returns `true` if a symbol is found, else `false`. + */ + function hasUnicode(string) { + return reHasUnicode.test(string); + } + + /** + * Checks if `string` contains a word composed of Unicode symbols. + * + * @private + * @param {string} string The string to inspect. + * @returns {boolean} Returns `true` if a word is found, else `false`. + */ + function hasUnicodeWord(string) { + return reHasUnicodeWord.test(string); + } + + /** + * Converts `iterator` to an array. + * + * @private + * @param {Object} iterator The iterator to convert. + * @returns {Array} Returns the converted array. + */ + function iteratorToArray(iterator) { + var data, + result = []; + + while (!(data = iterator.next()).done) { + result.push(data.value); + } + return result; + } + + /** + * Converts `map` to its key-value pairs. + * + * @private + * @param {Object} map The map to convert. + * @returns {Array} Returns the key-value pairs. + */ + function mapToArray(map) { + var index = -1, + result = Array(map.size); + + map.forEach(function(value, key) { + result[++index] = [key, value]; + }); + return result; + } + + /** + * Creates a unary function that invokes `func` with its argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ + function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; + } + + /** + * Replaces all `placeholder` elements in `array` with an internal placeholder + * and returns an array of their indexes. + * + * @private + * @param {Array} array The array to modify. + * @param {*} placeholder The placeholder to replace. + * @returns {Array} Returns the new array of placeholder indexes. + */ + function replaceHolders(array, placeholder) { + var index = -1, + length = array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (value === placeholder || value === PLACEHOLDER) { + array[index] = PLACEHOLDER; + result[resIndex++] = index; + } + } + return result; + } + + /** + * Converts `set` to an array of its values. + * + * @private + * @param {Object} set The set to convert. + * @returns {Array} Returns the values. + */ + function setToArray(set) { + var index = -1, + result = Array(set.size); + + set.forEach(function(value) { + result[++index] = value; + }); + return result; + } + + /** + * Converts `set` to its value-value pairs. + * + * @private + * @param {Object} set The set to convert. + * @returns {Array} Returns the value-value pairs. + */ + function setToPairs(set) { + var index = -1, + result = Array(set.size); + + set.forEach(function(value) { + result[++index] = [value, value]; + }); + return result; + } + + /** + * A specialized version of `_.indexOf` which performs strict equality + * comparisons of values, i.e. `===`. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function strictIndexOf(array, value, fromIndex) { + var index = fromIndex - 1, + length = array.length; + + while (++index < length) { + if (array[index] === value) { + return index; + } + } + return -1; + } + + /** + * A specialized version of `_.lastIndexOf` which performs strict equality + * comparisons of values, i.e. `===`. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function strictLastIndexOf(array, value, fromIndex) { + var index = fromIndex + 1; + while (index--) { + if (array[index] === value) { + return index; + } + } + return index; + } + + /** + * Gets the number of symbols in `string`. + * + * @private + * @param {string} string The string to inspect. + * @returns {number} Returns the string size. + */ + function stringSize(string) { + return hasUnicode(string) + ? unicodeSize(string) + : asciiSize(string); + } + + /** + * Converts `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ + function stringToArray(string) { + return hasUnicode(string) + ? unicodeToArray(string) + : asciiToArray(string); + } + + /** + * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace + * character of `string`. + * + * @private + * @param {string} string The string to inspect. + * @returns {number} Returns the index of the last non-whitespace character. + */ + function trimmedEndIndex(string) { + var index = string.length; + + while (index-- && reWhitespace.test(string.charAt(index))) {} + return index; + } + + /** + * Used by `_.unescape` to convert HTML entities to characters. + * + * @private + * @param {string} chr The matched character to unescape. + * @returns {string} Returns the unescaped character. + */ + var unescapeHtmlChar = basePropertyOf(htmlUnescapes); + + /** + * Gets the size of a Unicode `string`. + * + * @private + * @param {string} string The string inspect. + * @returns {number} Returns the string size. + */ + function unicodeSize(string) { + var result = reUnicode.lastIndex = 0; + while (reUnicode.test(string)) { + ++result; + } + return result; + } + + /** + * Converts a Unicode `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ + function unicodeToArray(string) { + return string.match(reUnicode) || []; + } + + /** + * Splits a Unicode `string` into an array of its words. + * + * @private + * @param {string} The string to inspect. + * @returns {Array} Returns the words of `string`. + */ + function unicodeWords(string) { + return string.match(reUnicodeWord) || []; + } + + /*--------------------------------------------------------------------------*/ + + /** + * Create a new pristine `lodash` function using the `context` object. + * + * @static + * @memberOf _ + * @since 1.1.0 + * @category Util + * @param {Object} [context=root] The context object. + * @returns {Function} Returns a new `lodash` function. + * @example + * + * _.mixin({ 'foo': _.constant('foo') }); + * + * var lodash = _.runInContext(); + * lodash.mixin({ 'bar': lodash.constant('bar') }); + * + * _.isFunction(_.foo); + * // => true + * _.isFunction(_.bar); + * // => false + * + * lodash.isFunction(lodash.foo); + * // => false + * lodash.isFunction(lodash.bar); + * // => true + * + * // Create a suped-up `defer` in Node.js. + * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer; + */ + var runInContext = (function runInContext(context) { + context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps)); + + /** Built-in constructor references. */ + var Array = context.Array, + Date = context.Date, + Error = context.Error, + Function = context.Function, + Math = context.Math, + Object = context.Object, + RegExp = context.RegExp, + String = context.String, + TypeError = context.TypeError; + + /** Used for built-in method references. */ + var arrayProto = Array.prototype, + funcProto = Function.prototype, + objectProto = Object.prototype; + + /** Used to detect overreaching core-js shims. */ + var coreJsData = context['__core-js_shared__']; + + /** Used to resolve the decompiled source of functions. */ + var funcToString = funcProto.toString; + + /** Used to check objects for own properties. */ + var hasOwnProperty = objectProto.hasOwnProperty; + + /** Used to generate unique IDs. */ + var idCounter = 0; + + /** Used to detect methods masquerading as native. */ + var maskSrcKey = (function() { + var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); + return uid ? ('Symbol(src)_1.' + uid) : ''; + }()); + + /** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ + var nativeObjectToString = objectProto.toString; + + /** Used to infer the `Object` constructor. */ + var objectCtorString = funcToString.call(Object); + + /** Used to restore the original `_` reference in `_.noConflict`. */ + var oldDash = root._; + + /** Used to detect if a method is native. */ + var reIsNative = RegExp('^' + + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' + ); + + /** Built-in value references. */ + var Buffer = moduleExports ? context.Buffer : undefined, + Symbol = context.Symbol, + Uint8Array = context.Uint8Array, + allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined, + getPrototype = overArg(Object.getPrototypeOf, Object), + objectCreate = Object.create, + propertyIsEnumerable = objectProto.propertyIsEnumerable, + splice = arrayProto.splice, + spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined, + symIterator = Symbol ? Symbol.iterator : undefined, + symToStringTag = Symbol ? Symbol.toStringTag : undefined; + + var defineProperty = (function() { + try { + var func = getNative(Object, 'defineProperty'); + func({}, '', {}); + return func; + } catch (e) {} + }()); + + /** Mocked built-ins. */ + var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout, + ctxNow = Date && Date.now !== root.Date.now && Date.now, + ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout; + + /* Built-in method references for those with the same name as other `lodash` methods. */ + var nativeCeil = Math.ceil, + nativeFloor = Math.floor, + nativeGetSymbols = Object.getOwnPropertySymbols, + nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined, + nativeIsFinite = context.isFinite, + nativeJoin = arrayProto.join, + nativeKeys = overArg(Object.keys, Object), + nativeMax = Math.max, + nativeMin = Math.min, + nativeNow = Date.now, + nativeParseInt = context.parseInt, + nativeRandom = Math.random, + nativeReverse = arrayProto.reverse; + + /* Built-in method references that are verified to be native. */ + var DataView = getNative(context, 'DataView'), + Map = getNative(context, 'Map'), + Promise = getNative(context, 'Promise'), + Set = getNative(context, 'Set'), + WeakMap = getNative(context, 'WeakMap'), + nativeCreate = getNative(Object, 'create'); + + /** Used to store function metadata. */ + var metaMap = WeakMap && new WeakMap; + + /** Used to lookup unminified function names. */ + var realNames = {}; + + /** Used to detect maps, sets, and weakmaps. */ + var dataViewCtorString = toSource(DataView), + mapCtorString = toSource(Map), + promiseCtorString = toSource(Promise), + setCtorString = toSource(Set), + weakMapCtorString = toSource(WeakMap); + + /** Used to convert symbols to primitives and strings. */ + var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolValueOf = symbolProto ? symbolProto.valueOf : undefined, + symbolToString = symbolProto ? symbolProto.toString : undefined; + + /*------------------------------------------------------------------------*/ + + /** + * Creates a `lodash` object which wraps `value` to enable implicit method + * chain sequences. Methods that operate on and return arrays, collections, + * and functions can be chained together. Methods that retrieve a single value + * or may return a primitive value will automatically end the chain sequence + * and return the unwrapped value. Otherwise, the value must be unwrapped + * with `_#value`. + * + * Explicit chain sequences, which must be unwrapped with `_#value`, may be + * enabled using `_.chain`. + * + * The execution of chained methods is lazy, that is, it's deferred until + * `_#value` is implicitly or explicitly called. + * + * Lazy evaluation allows several methods to support shortcut fusion. + * Shortcut fusion is an optimization to merge iteratee calls; this avoids + * the creation of intermediate arrays and can greatly reduce the number of + * iteratee executions. Sections of a chain sequence qualify for shortcut + * fusion if the section is applied to an array and iteratees accept only + * one argument. The heuristic for whether a section qualifies for shortcut + * fusion is subject to change. + * + * Chaining is supported in custom builds as long as the `_#value` method is + * directly or indirectly included in the build. + * + * In addition to lodash methods, wrappers have `Array` and `String` methods. + * + * The wrapper `Array` methods are: + * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift` + * + * The wrapper `String` methods are: + * `replace` and `split` + * + * The wrapper methods that support shortcut fusion are: + * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`, + * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`, + * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray` + * + * The chainable wrapper methods are: + * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`, + * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`, + * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`, + * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`, + * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`, + * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`, + * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`, + * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`, + * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`, + * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`, + * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`, + * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`, + * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`, + * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`, + * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`, + * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`, + * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`, + * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`, + * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`, + * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`, + * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`, + * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`, + * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`, + * `zipObject`, `zipObjectDeep`, and `zipWith` + * + * The wrapper methods that are **not** chainable by default are: + * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`, + * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`, + * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`, + * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`, + * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`, + * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`, + * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`, + * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`, + * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`, + * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`, + * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`, + * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`, + * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`, + * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`, + * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`, + * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`, + * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`, + * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`, + * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`, + * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`, + * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`, + * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`, + * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`, + * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`, + * `upperFirst`, `value`, and `words` + * + * @name _ + * @constructor + * @category Seq + * @param {*} value The value to wrap in a `lodash` instance. + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * function square(n) { + * return n * n; + * } + * + * var wrapped = _([1, 2, 3]); + * + * // Returns an unwrapped value. + * wrapped.reduce(_.add); + * // => 6 + * + * // Returns a wrapped value. + * var squares = wrapped.map(square); + * + * _.isArray(squares); + * // => false + * + * _.isArray(squares.value()); + * // => true + */ + function lodash(value) { + if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) { + if (value instanceof LodashWrapper) { + return value; + } + if (hasOwnProperty.call(value, '__wrapped__')) { + return wrapperClone(value); + } + } + return new LodashWrapper(value); + } + + /** + * The base implementation of `_.create` without support for assigning + * properties to the created object. + * + * @private + * @param {Object} proto The object to inherit from. + * @returns {Object} Returns the new object. + */ + var baseCreate = (function() { + function object() {} + return function(proto) { + if (!isObject(proto)) { + return {}; + } + if (objectCreate) { + return objectCreate(proto); + } + object.prototype = proto; + var result = new object; + object.prototype = undefined; + return result; + }; + }()); + + /** + * The function whose prototype chain sequence wrappers inherit from. + * + * @private + */ + function baseLodash() { + // No operation performed. + } + + /** + * The base constructor for creating `lodash` wrapper objects. + * + * @private + * @param {*} value The value to wrap. + * @param {boolean} [chainAll] Enable explicit method chain sequences. + */ + function LodashWrapper(value, chainAll) { + this.__wrapped__ = value; + this.__actions__ = []; + this.__chain__ = !!chainAll; + this.__index__ = 0; + this.__values__ = undefined; + } + + /** + * By default, the template delimiters used by lodash are like those in + * embedded Ruby (ERB) as well as ES2015 template strings. Change the + * following template settings to use alternative delimiters. + * + * @static + * @memberOf _ + * @type {Object} + */ + lodash.templateSettings = { + + /** + * Used to detect `data` property values to be HTML-escaped. + * + * @memberOf _.templateSettings + * @type {RegExp} + */ + 'escape': reEscape, + + /** + * Used to detect code to be evaluated. + * + * @memberOf _.templateSettings + * @type {RegExp} + */ + 'evaluate': reEvaluate, + + /** + * Used to detect `data` property values to inject. + * + * @memberOf _.templateSettings + * @type {RegExp} + */ + 'interpolate': reInterpolate, + + /** + * Used to reference the data object in the template text. + * + * @memberOf _.templateSettings + * @type {string} + */ + 'variable': '', + + /** + * Used to import variables into the compiled template. + * + * @memberOf _.templateSettings + * @type {Object} + */ + 'imports': { + + /** + * A reference to the `lodash` function. + * + * @memberOf _.templateSettings.imports + * @type {Function} + */ + '_': lodash + } + }; + + // Ensure wrappers are instances of `baseLodash`. + lodash.prototype = baseLodash.prototype; + lodash.prototype.constructor = lodash; + + LodashWrapper.prototype = baseCreate(baseLodash.prototype); + LodashWrapper.prototype.constructor = LodashWrapper; + + /*------------------------------------------------------------------------*/ + + /** + * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation. + * + * @private + * @constructor + * @param {*} value The value to wrap. + */ + function LazyWrapper(value) { + this.__wrapped__ = value; + this.__actions__ = []; + this.__dir__ = 1; + this.__filtered__ = false; + this.__iteratees__ = []; + this.__takeCount__ = MAX_ARRAY_LENGTH; + this.__views__ = []; + } + + /** + * Creates a clone of the lazy wrapper object. + * + * @private + * @name clone + * @memberOf LazyWrapper + * @returns {Object} Returns the cloned `LazyWrapper` object. + */ + function lazyClone() { + var result = new LazyWrapper(this.__wrapped__); + result.__actions__ = copyArray(this.__actions__); + result.__dir__ = this.__dir__; + result.__filtered__ = this.__filtered__; + result.__iteratees__ = copyArray(this.__iteratees__); + result.__takeCount__ = this.__takeCount__; + result.__views__ = copyArray(this.__views__); + return result; + } + + /** + * Reverses the direction of lazy iteration. + * + * @private + * @name reverse + * @memberOf LazyWrapper + * @returns {Object} Returns the new reversed `LazyWrapper` object. + */ + function lazyReverse() { + if (this.__filtered__) { + var result = new LazyWrapper(this); + result.__dir__ = -1; + result.__filtered__ = true; + } else { + result = this.clone(); + result.__dir__ *= -1; + } + return result; + } + + /** + * Extracts the unwrapped value from its lazy wrapper. + * + * @private + * @name value + * @memberOf LazyWrapper + * @returns {*} Returns the unwrapped value. + */ + function lazyValue() { + var array = this.__wrapped__.value(), + dir = this.__dir__, + isArr = isArray(array), + isRight = dir < 0, + arrLength = isArr ? array.length : 0, + view = getView(0, arrLength, this.__views__), + start = view.start, + end = view.end, + length = end - start, + index = isRight ? end : (start - 1), + iteratees = this.__iteratees__, + iterLength = iteratees.length, + resIndex = 0, + takeCount = nativeMin(length, this.__takeCount__); + + if (!isArr || (!isRight && arrLength == length && takeCount == length)) { + return baseWrapperValue(array, this.__actions__); + } + var result = []; + + outer: + while (length-- && resIndex < takeCount) { + index += dir; + + var iterIndex = -1, + value = array[index]; + + while (++iterIndex < iterLength) { + var data = iteratees[iterIndex], + iteratee = data.iteratee, + type = data.type, + computed = iteratee(value); + + if (type == LAZY_MAP_FLAG) { + value = computed; + } else if (!computed) { + if (type == LAZY_FILTER_FLAG) { + continue outer; + } else { + break outer; + } + } + } + result[resIndex++] = value; + } + return result; + } + + // Ensure `LazyWrapper` is an instance of `baseLodash`. + LazyWrapper.prototype = baseCreate(baseLodash.prototype); + LazyWrapper.prototype.constructor = LazyWrapper; + + /*------------------------------------------------------------------------*/ + + /** + * Creates a hash object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ + function Hash(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } + } + + /** + * Removes all key-value entries from the hash. + * + * @private + * @name clear + * @memberOf Hash + */ + function hashClear() { + this.__data__ = nativeCreate ? nativeCreate(null) : {}; + this.size = 0; + } + + /** + * Removes `key` and its value from the hash. + * + * @private + * @name delete + * @memberOf Hash + * @param {Object} hash The hash to modify. + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ + function hashDelete(key) { + var result = this.has(key) && delete this.__data__[key]; + this.size -= result ? 1 : 0; + return result; + } + + /** + * Gets the hash value for `key`. + * + * @private + * @name get + * @memberOf Hash + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ + function hashGet(key) { + var data = this.__data__; + if (nativeCreate) { + var result = data[key]; + return result === HASH_UNDEFINED ? undefined : result; + } + return hasOwnProperty.call(data, key) ? data[key] : undefined; + } + + /** + * Checks if a hash value for `key` exists. + * + * @private + * @name has + * @memberOf Hash + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function hashHas(key) { + var data = this.__data__; + return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key); + } + + /** + * Sets the hash `key` to `value`. + * + * @private + * @name set + * @memberOf Hash + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the hash instance. + */ + function hashSet(key, value) { + var data = this.__data__; + this.size += this.has(key) ? 0 : 1; + data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; + return this; + } + + // Add methods to `Hash`. + Hash.prototype.clear = hashClear; + Hash.prototype['delete'] = hashDelete; + Hash.prototype.get = hashGet; + Hash.prototype.has = hashHas; + Hash.prototype.set = hashSet; + + /*------------------------------------------------------------------------*/ + + /** + * Creates an list cache object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ + function ListCache(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } + } + + /** + * Removes all key-value entries from the list cache. + * + * @private + * @name clear + * @memberOf ListCache + */ + function listCacheClear() { + this.__data__ = []; + this.size = 0; + } + + /** + * Removes `key` and its value from the list cache. + * + * @private + * @name delete + * @memberOf ListCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ + function listCacheDelete(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + return false; + } + var lastIndex = data.length - 1; + if (index == lastIndex) { + data.pop(); + } else { + splice.call(data, index, 1); + } + --this.size; + return true; + } + + /** + * Gets the list cache value for `key`. + * + * @private + * @name get + * @memberOf ListCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ + function listCacheGet(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + return index < 0 ? undefined : data[index][1]; + } + + /** + * Checks if a list cache value for `key` exists. + * + * @private + * @name has + * @memberOf ListCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function listCacheHas(key) { + return assocIndexOf(this.__data__, key) > -1; + } + + /** + * Sets the list cache `key` to `value`. + * + * @private + * @name set + * @memberOf ListCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the list cache instance. + */ + function listCacheSet(key, value) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + ++this.size; + data.push([key, value]); + } else { + data[index][1] = value; + } + return this; + } + + // Add methods to `ListCache`. + ListCache.prototype.clear = listCacheClear; + ListCache.prototype['delete'] = listCacheDelete; + ListCache.prototype.get = listCacheGet; + ListCache.prototype.has = listCacheHas; + ListCache.prototype.set = listCacheSet; + + /*------------------------------------------------------------------------*/ + + /** + * Creates a map cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ + function MapCache(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } + } + + /** + * Removes all key-value entries from the map. + * + * @private + * @name clear + * @memberOf MapCache + */ + function mapCacheClear() { + this.size = 0; + this.__data__ = { + 'hash': new Hash, + 'map': new (Map || ListCache), + 'string': new Hash + }; + } + + /** + * Removes `key` and its value from the map. + * + * @private + * @name delete + * @memberOf MapCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ + function mapCacheDelete(key) { + var result = getMapData(this, key)['delete'](key); + this.size -= result ? 1 : 0; + return result; + } + + /** + * Gets the map value for `key`. + * + * @private + * @name get + * @memberOf MapCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ + function mapCacheGet(key) { + return getMapData(this, key).get(key); + } + + /** + * Checks if a map value for `key` exists. + * + * @private + * @name has + * @memberOf MapCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function mapCacheHas(key) { + return getMapData(this, key).has(key); + } + + /** + * Sets the map `key` to `value`. + * + * @private + * @name set + * @memberOf MapCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the map cache instance. + */ + function mapCacheSet(key, value) { + var data = getMapData(this, key), + size = data.size; + + data.set(key, value); + this.size += data.size == size ? 0 : 1; + return this; + } + + // Add methods to `MapCache`. + MapCache.prototype.clear = mapCacheClear; + MapCache.prototype['delete'] = mapCacheDelete; + MapCache.prototype.get = mapCacheGet; + MapCache.prototype.has = mapCacheHas; + MapCache.prototype.set = mapCacheSet; + + /*------------------------------------------------------------------------*/ + + /** + * + * Creates an array cache object to store unique values. + * + * @private + * @constructor + * @param {Array} [values] The values to cache. + */ + function SetCache(values) { + var index = -1, + length = values == null ? 0 : values.length; + + this.__data__ = new MapCache; + while (++index < length) { + this.add(values[index]); + } + } + + /** + * Adds `value` to the array cache. + * + * @private + * @name add + * @memberOf SetCache + * @alias push + * @param {*} value The value to cache. + * @returns {Object} Returns the cache instance. + */ + function setCacheAdd(value) { + this.__data__.set(value, HASH_UNDEFINED); + return this; + } + + /** + * Checks if `value` is in the array cache. + * + * @private + * @name has + * @memberOf SetCache + * @param {*} value The value to search for. + * @returns {number} Returns `true` if `value` is found, else `false`. + */ + function setCacheHas(value) { + return this.__data__.has(value); + } + + // Add methods to `SetCache`. + SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; + SetCache.prototype.has = setCacheHas; + + /*------------------------------------------------------------------------*/ + + /** + * Creates a stack cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ + function Stack(entries) { + var data = this.__data__ = new ListCache(entries); + this.size = data.size; + } + + /** + * Removes all key-value entries from the stack. + * + * @private + * @name clear + * @memberOf Stack + */ + function stackClear() { + this.__data__ = new ListCache; + this.size = 0; + } + + /** + * Removes `key` and its value from the stack. + * + * @private + * @name delete + * @memberOf Stack + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ + function stackDelete(key) { + var data = this.__data__, + result = data['delete'](key); + + this.size = data.size; + return result; + } + + /** + * Gets the stack value for `key`. + * + * @private + * @name get + * @memberOf Stack + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ + function stackGet(key) { + return this.__data__.get(key); + } + + /** + * Checks if a stack value for `key` exists. + * + * @private + * @name has + * @memberOf Stack + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function stackHas(key) { + return this.__data__.has(key); + } + + /** + * Sets the stack `key` to `value`. + * + * @private + * @name set + * @memberOf Stack + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the stack cache instance. + */ + function stackSet(key, value) { + var data = this.__data__; + if (data instanceof ListCache) { + var pairs = data.__data__; + if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { + pairs.push([key, value]); + this.size = ++data.size; + return this; + } + data = this.__data__ = new MapCache(pairs); + } + data.set(key, value); + this.size = data.size; + return this; + } + + // Add methods to `Stack`. + Stack.prototype.clear = stackClear; + Stack.prototype['delete'] = stackDelete; + Stack.prototype.get = stackGet; + Stack.prototype.has = stackHas; + Stack.prototype.set = stackSet; + + /*------------------------------------------------------------------------*/ + + /** + * Creates an array of the enumerable property names of the array-like `value`. + * + * @private + * @param {*} value The value to query. + * @param {boolean} inherited Specify returning inherited property names. + * @returns {Array} Returns the array of property names. + */ + function arrayLikeKeys(value, inherited) { + var isArr = isArray(value), + isArg = !isArr && isArguments(value), + isBuff = !isArr && !isArg && isBuffer(value), + isType = !isArr && !isArg && !isBuff && isTypedArray(value), + skipIndexes = isArr || isArg || isBuff || isType, + result = skipIndexes ? baseTimes(value.length, String) : [], + length = result.length; + + for (var key in value) { + if ((inherited || hasOwnProperty.call(value, key)) && + !(skipIndexes && ( + // Safari 9 has enumerable `arguments.length` in strict mode. + key == 'length' || + // Node.js 0.10 has enumerable non-index properties on buffers. + (isBuff && (key == 'offset' || key == 'parent')) || + // PhantomJS 2 has enumerable non-index properties on typed arrays. + (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || + // Skip index properties. + isIndex(key, length) + ))) { + result.push(key); + } + } + return result; + } + + /** + * A specialized version of `_.sample` for arrays. + * + * @private + * @param {Array} array The array to sample. + * @returns {*} Returns the random element. + */ + function arraySample(array) { + var length = array.length; + return length ? array[baseRandom(0, length - 1)] : undefined; + } + + /** + * A specialized version of `_.sampleSize` for arrays. + * + * @private + * @param {Array} array The array to sample. + * @param {number} n The number of elements to sample. + * @returns {Array} Returns the random elements. + */ + function arraySampleSize(array, n) { + return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length)); + } + + /** + * A specialized version of `_.shuffle` for arrays. + * + * @private + * @param {Array} array The array to shuffle. + * @returns {Array} Returns the new shuffled array. + */ + function arrayShuffle(array) { + return shuffleSelf(copyArray(array)); + } + + /** + * This function is like `assignValue` except that it doesn't assign + * `undefined` values. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ + function assignMergeValue(object, key, value) { + if ((value !== undefined && !eq(object[key], value)) || + (value === undefined && !(key in object))) { + baseAssignValue(object, key, value); + } + } + + /** + * Assigns `value` to `key` of `object` if the existing value is not equivalent + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ + function assignValue(object, key, value) { + var objValue = object[key]; + if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || + (value === undefined && !(key in object))) { + baseAssignValue(object, key, value); + } + } + + /** + * Gets the index at which the `key` is found in `array` of key-value pairs. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} key The key to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function assocIndexOf(array, key) { + var length = array.length; + while (length--) { + if (eq(array[length][0], key)) { + return length; + } + } + return -1; + } + + /** + * Aggregates elements of `collection` on `accumulator` with keys transformed + * by `iteratee` and values set by `setter`. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} setter The function to set `accumulator` values. + * @param {Function} iteratee The iteratee to transform keys. + * @param {Object} accumulator The initial aggregated object. + * @returns {Function} Returns `accumulator`. + */ + function baseAggregator(collection, setter, iteratee, accumulator) { + baseEach(collection, function(value, key, collection) { + setter(accumulator, value, iteratee(value), collection); + }); + return accumulator; + } + + /** + * The base implementation of `_.assign` without support for multiple sources + * or `customizer` functions. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @returns {Object} Returns `object`. + */ + function baseAssign(object, source) { + return object && copyObject(source, keys(source), object); + } + + /** + * The base implementation of `_.assignIn` without support for multiple sources + * or `customizer` functions. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @returns {Object} Returns `object`. + */ + function baseAssignIn(object, source) { + return object && copyObject(source, keysIn(source), object); + } + + /** + * The base implementation of `assignValue` and `assignMergeValue` without + * value checks. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ + function baseAssignValue(object, key, value) { + if (key == '__proto__' && defineProperty) { + defineProperty(object, key, { + 'configurable': true, + 'enumerable': true, + 'value': value, + 'writable': true + }); + } else { + object[key] = value; + } + } + + /** + * The base implementation of `_.at` without support for individual paths. + * + * @private + * @param {Object} object The object to iterate over. + * @param {string[]} paths The property paths to pick. + * @returns {Array} Returns the picked elements. + */ + function baseAt(object, paths) { + var index = -1, + length = paths.length, + result = Array(length), + skip = object == null; + + while (++index < length) { + result[index] = skip ? undefined : get(object, paths[index]); + } + return result; + } + + /** + * The base implementation of `_.clamp` which doesn't coerce arguments. + * + * @private + * @param {number} number The number to clamp. + * @param {number} [lower] The lower bound. + * @param {number} upper The upper bound. + * @returns {number} Returns the clamped number. + */ + function baseClamp(number, lower, upper) { + if (number === number) { + if (upper !== undefined) { + number = number <= upper ? number : upper; + } + if (lower !== undefined) { + number = number >= lower ? number : lower; + } + } + return number; + } + + /** + * The base implementation of `_.clone` and `_.cloneDeep` which tracks + * traversed objects. + * + * @private + * @param {*} value The value to clone. + * @param {boolean} bitmask The bitmask flags. + * 1 - Deep clone + * 2 - Flatten inherited properties + * 4 - Clone symbols + * @param {Function} [customizer] The function to customize cloning. + * @param {string} [key] The key of `value`. + * @param {Object} [object] The parent object of `value`. + * @param {Object} [stack] Tracks traversed objects and their clone counterparts. + * @returns {*} Returns the cloned value. + */ + function baseClone(value, bitmask, customizer, key, object, stack) { + var result, + isDeep = bitmask & CLONE_DEEP_FLAG, + isFlat = bitmask & CLONE_FLAT_FLAG, + isFull = bitmask & CLONE_SYMBOLS_FLAG; + + if (customizer) { + result = object ? customizer(value, key, object, stack) : customizer(value); + } + if (result !== undefined) { + return result; + } + if (!isObject(value)) { + return value; + } + var isArr = isArray(value); + if (isArr) { + result = initCloneArray(value); + if (!isDeep) { + return copyArray(value, result); + } + } else { + var tag = getTag(value), + isFunc = tag == funcTag || tag == genTag; + + if (isBuffer(value)) { + return cloneBuffer(value, isDeep); + } + if (tag == objectTag || tag == argsTag || (isFunc && !object)) { + result = (isFlat || isFunc) ? {} : initCloneObject(value); + if (!isDeep) { + return isFlat + ? copySymbolsIn(value, baseAssignIn(result, value)) + : copySymbols(value, baseAssign(result, value)); + } + } else { + if (!cloneableTags[tag]) { + return object ? value : {}; + } + result = initCloneByTag(value, tag, isDeep); + } + } + // Check for circular references and return its corresponding clone. + stack || (stack = new Stack); + var stacked = stack.get(value); + if (stacked) { + return stacked; + } + stack.set(value, result); + + if (isSet(value)) { + value.forEach(function(subValue) { + result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack)); + }); + } else if (isMap(value)) { + value.forEach(function(subValue, key) { + result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack)); + }); + } + + var keysFunc = isFull + ? (isFlat ? getAllKeysIn : getAllKeys) + : (isFlat ? keysIn : keys); + + var props = isArr ? undefined : keysFunc(value); + arrayEach(props || value, function(subValue, key) { + if (props) { + key = subValue; + subValue = value[key]; + } + // Recursively populate clone (susceptible to call stack limits). + assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack)); + }); + return result; + } + + /** + * The base implementation of `_.conforms` which doesn't clone `source`. + * + * @private + * @param {Object} source The object of property predicates to conform to. + * @returns {Function} Returns the new spec function. + */ + function baseConforms(source) { + var props = keys(source); + return function(object) { + return baseConformsTo(object, source, props); + }; + } + + /** + * The base implementation of `_.conformsTo` which accepts `props` to check. + * + * @private + * @param {Object} object The object to inspect. + * @param {Object} source The object of property predicates to conform to. + * @returns {boolean} Returns `true` if `object` conforms, else `false`. + */ + function baseConformsTo(object, source, props) { + var length = props.length; + if (object == null) { + return !length; + } + object = Object(object); + while (length--) { + var key = props[length], + predicate = source[key], + value = object[key]; + + if ((value === undefined && !(key in object)) || !predicate(value)) { + return false; + } + } + return true; + } + + /** + * The base implementation of `_.delay` and `_.defer` which accepts `args` + * to provide to `func`. + * + * @private + * @param {Function} func The function to delay. + * @param {number} wait The number of milliseconds to delay invocation. + * @param {Array} args The arguments to provide to `func`. + * @returns {number|Object} Returns the timer id or timeout object. + */ + function baseDelay(func, wait, args) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + return setTimeout(function() { func.apply(undefined, args); }, wait); + } + + /** + * The base implementation of methods like `_.difference` without support + * for excluding multiple arrays or iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Array} values The values to exclude. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of filtered values. + */ + function baseDifference(array, values, iteratee, comparator) { + var index = -1, + includes = arrayIncludes, + isCommon = true, + length = array.length, + result = [], + valuesLength = values.length; + + if (!length) { + return result; + } + if (iteratee) { + values = arrayMap(values, baseUnary(iteratee)); + } + if (comparator) { + includes = arrayIncludesWith; + isCommon = false; + } + else if (values.length >= LARGE_ARRAY_SIZE) { + includes = cacheHas; + isCommon = false; + values = new SetCache(values); + } + outer: + while (++index < length) { + var value = array[index], + computed = iteratee == null ? value : iteratee(value); + + value = (comparator || value !== 0) ? value : 0; + if (isCommon && computed === computed) { + var valuesIndex = valuesLength; + while (valuesIndex--) { + if (values[valuesIndex] === computed) { + continue outer; + } + } + result.push(value); + } + else if (!includes(values, computed, comparator)) { + result.push(value); + } + } + return result; + } + + /** + * The base implementation of `_.forEach` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + */ + var baseEach = createBaseEach(baseForOwn); + + /** + * The base implementation of `_.forEachRight` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + */ + var baseEachRight = createBaseEach(baseForOwnRight, true); + + /** + * The base implementation of `_.every` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false` + */ + function baseEvery(collection, predicate) { + var result = true; + baseEach(collection, function(value, index, collection) { + result = !!predicate(value, index, collection); + return result; + }); + return result; + } + + /** + * The base implementation of methods like `_.max` and `_.min` which accepts a + * `comparator` to determine the extremum value. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The iteratee invoked per iteration. + * @param {Function} comparator The comparator used to compare values. + * @returns {*} Returns the extremum value. + */ + function baseExtremum(array, iteratee, comparator) { + var index = -1, + length = array.length; + + while (++index < length) { + var value = array[index], + current = iteratee(value); + + if (current != null && (computed === undefined + ? (current === current && !isSymbol(current)) + : comparator(current, computed) + )) { + var computed = current, + result = value; + } + } + return result; + } + + /** + * The base implementation of `_.fill` without an iteratee call guard. + * + * @private + * @param {Array} array The array to fill. + * @param {*} value The value to fill `array` with. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns `array`. + */ + function baseFill(array, value, start, end) { + var length = array.length; + + start = toInteger(start); + if (start < 0) { + start = -start > length ? 0 : (length + start); + } + end = (end === undefined || end > length) ? length : toInteger(end); + if (end < 0) { + end += length; + } + end = start > end ? 0 : toLength(end); + while (start < end) { + array[start++] = value; + } + return array; + } + + /** + * The base implementation of `_.filter` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + */ + function baseFilter(collection, predicate) { + var result = []; + baseEach(collection, function(value, index, collection) { + if (predicate(value, index, collection)) { + result.push(value); + } + }); + return result; + } + + /** + * The base implementation of `_.flatten` with support for restricting flattening. + * + * @private + * @param {Array} array The array to flatten. + * @param {number} depth The maximum recursion depth. + * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. + * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. + * @param {Array} [result=[]] The initial result value. + * @returns {Array} Returns the new flattened array. + */ + function baseFlatten(array, depth, predicate, isStrict, result) { + var index = -1, + length = array.length; + + predicate || (predicate = isFlattenable); + result || (result = []); + + while (++index < length) { + var value = array[index]; + if (depth > 0 && predicate(value)) { + if (depth > 1) { + // Recursively flatten arrays (susceptible to call stack limits). + baseFlatten(value, depth - 1, predicate, isStrict, result); + } else { + arrayPush(result, value); + } + } else if (!isStrict) { + result[result.length] = value; + } + } + return result; + } + + /** + * The base implementation of `baseForOwn` which iterates over `object` + * properties returned by `keysFunc` and invokes `iteratee` for each property. + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {Function} keysFunc The function to get the keys of `object`. + * @returns {Object} Returns `object`. + */ + var baseFor = createBaseFor(); + + /** + * This function is like `baseFor` except that it iterates over properties + * in the opposite order. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {Function} keysFunc The function to get the keys of `object`. + * @returns {Object} Returns `object`. + */ + var baseForRight = createBaseFor(true); + + /** + * The base implementation of `_.forOwn` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Object} Returns `object`. + */ + function baseForOwn(object, iteratee) { + return object && baseFor(object, iteratee, keys); + } + + /** + * The base implementation of `_.forOwnRight` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Object} Returns `object`. + */ + function baseForOwnRight(object, iteratee) { + return object && baseForRight(object, iteratee, keys); + } + + /** + * The base implementation of `_.functions` which creates an array of + * `object` function property names filtered from `props`. + * + * @private + * @param {Object} object The object to inspect. + * @param {Array} props The property names to filter. + * @returns {Array} Returns the function names. + */ + function baseFunctions(object, props) { + return arrayFilter(props, function(key) { + return isFunction(object[key]); + }); + } + + /** + * The base implementation of `_.get` without support for default values. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @returns {*} Returns the resolved value. + */ + function baseGet(object, path) { + path = castPath(path, object); + + var index = 0, + length = path.length; + + while (object != null && index < length) { + object = object[toKey(path[index++])]; + } + return (index && index == length) ? object : undefined; + } + + /** + * The base implementation of `getAllKeys` and `getAllKeysIn` which uses + * `keysFunc` and `symbolsFunc` to get the enumerable property names and + * symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Function} keysFunc The function to get the keys of `object`. + * @param {Function} symbolsFunc The function to get the symbols of `object`. + * @returns {Array} Returns the array of property names and symbols. + */ + function baseGetAllKeys(object, keysFunc, symbolsFunc) { + var result = keysFunc(object); + return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); + } + + /** + * The base implementation of `getTag` without fallbacks for buggy environments. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ + function baseGetTag(value) { + if (value == null) { + return value === undefined ? undefinedTag : nullTag; + } + return (symToStringTag && symToStringTag in Object(value)) + ? getRawTag(value) + : objectToString(value); + } + + /** + * The base implementation of `_.gt` which doesn't coerce arguments. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is greater than `other`, + * else `false`. + */ + function baseGt(value, other) { + return value > other; + } + + /** + * The base implementation of `_.has` without support for deep paths. + * + * @private + * @param {Object} [object] The object to query. + * @param {Array|string} key The key to check. + * @returns {boolean} Returns `true` if `key` exists, else `false`. + */ + function baseHas(object, key) { + return object != null && hasOwnProperty.call(object, key); + } + + /** + * The base implementation of `_.hasIn` without support for deep paths. + * + * @private + * @param {Object} [object] The object to query. + * @param {Array|string} key The key to check. + * @returns {boolean} Returns `true` if `key` exists, else `false`. + */ + function baseHasIn(object, key) { + return object != null && key in Object(object); + } + + /** + * The base implementation of `_.inRange` which doesn't coerce arguments. + * + * @private + * @param {number} number The number to check. + * @param {number} start The start of the range. + * @param {number} end The end of the range. + * @returns {boolean} Returns `true` if `number` is in the range, else `false`. + */ + function baseInRange(number, start, end) { + return number >= nativeMin(start, end) && number < nativeMax(start, end); + } + + /** + * The base implementation of methods like `_.intersection`, without support + * for iteratee shorthands, that accepts an array of arrays to inspect. + * + * @private + * @param {Array} arrays The arrays to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of shared values. + */ + function baseIntersection(arrays, iteratee, comparator) { + var includes = comparator ? arrayIncludesWith : arrayIncludes, + length = arrays[0].length, + othLength = arrays.length, + othIndex = othLength, + caches = Array(othLength), + maxLength = Infinity, + result = []; + + while (othIndex--) { + var array = arrays[othIndex]; + if (othIndex && iteratee) { + array = arrayMap(array, baseUnary(iteratee)); + } + maxLength = nativeMin(array.length, maxLength); + caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120)) + ? new SetCache(othIndex && array) + : undefined; + } + array = arrays[0]; + + var index = -1, + seen = caches[0]; + + outer: + while (++index < length && result.length < maxLength) { + var value = array[index], + computed = iteratee ? iteratee(value) : value; + + value = (comparator || value !== 0) ? value : 0; + if (!(seen + ? cacheHas(seen, computed) + : includes(result, computed, comparator) + )) { + othIndex = othLength; + while (--othIndex) { + var cache = caches[othIndex]; + if (!(cache + ? cacheHas(cache, computed) + : includes(arrays[othIndex], computed, comparator)) + ) { + continue outer; + } + } + if (seen) { + seen.push(computed); + } + result.push(value); + } + } + return result; + } + + /** + * The base implementation of `_.invert` and `_.invertBy` which inverts + * `object` with values transformed by `iteratee` and set by `setter`. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} setter The function to set `accumulator` values. + * @param {Function} iteratee The iteratee to transform values. + * @param {Object} accumulator The initial inverted object. + * @returns {Function} Returns `accumulator`. + */ + function baseInverter(object, setter, iteratee, accumulator) { + baseForOwn(object, function(value, key, object) { + setter(accumulator, iteratee(value), key, object); + }); + return accumulator; + } + + /** + * The base implementation of `_.invoke` without support for individual + * method arguments. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path of the method to invoke. + * @param {Array} args The arguments to invoke the method with. + * @returns {*} Returns the result of the invoked method. + */ + function baseInvoke(object, path, args) { + path = castPath(path, object); + object = parent(object, path); + var func = object == null ? object : object[toKey(last(path))]; + return func == null ? undefined : apply(func, object, args); + } + + /** + * The base implementation of `_.isArguments`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + */ + function baseIsArguments(value) { + return isObjectLike(value) && baseGetTag(value) == argsTag; + } + + /** + * The base implementation of `_.isArrayBuffer` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`. + */ + function baseIsArrayBuffer(value) { + return isObjectLike(value) && baseGetTag(value) == arrayBufferTag; + } + + /** + * The base implementation of `_.isDate` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a date object, else `false`. + */ + function baseIsDate(value) { + return isObjectLike(value) && baseGetTag(value) == dateTag; + } + + /** + * The base implementation of `_.isEqual` which supports partial comparisons + * and tracks traversed objects. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @param {boolean} bitmask The bitmask flags. + * 1 - Unordered comparison + * 2 - Partial comparison + * @param {Function} [customizer] The function to customize comparisons. + * @param {Object} [stack] Tracks traversed `value` and `other` objects. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + */ + function baseIsEqual(value, other, bitmask, customizer, stack) { + if (value === other) { + return true; + } + if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) { + return value !== value && other !== other; + } + return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack); + } + + /** + * A specialized version of `baseIsEqual` for arrays and objects which performs + * deep comparisons and tracks traversed objects enabling objects with circular + * references to be compared. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} [stack] Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ + function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) { + var objIsArr = isArray(object), + othIsArr = isArray(other), + objTag = objIsArr ? arrayTag : getTag(object), + othTag = othIsArr ? arrayTag : getTag(other); + + objTag = objTag == argsTag ? objectTag : objTag; + othTag = othTag == argsTag ? objectTag : othTag; + + var objIsObj = objTag == objectTag, + othIsObj = othTag == objectTag, + isSameTag = objTag == othTag; + + if (isSameTag && isBuffer(object)) { + if (!isBuffer(other)) { + return false; + } + objIsArr = true; + objIsObj = false; + } + if (isSameTag && !objIsObj) { + stack || (stack = new Stack); + return (objIsArr || isTypedArray(object)) + ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) + : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack); + } + if (!(bitmask & COMPARE_PARTIAL_FLAG)) { + var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), + othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); + + if (objIsWrapped || othIsWrapped) { + var objUnwrapped = objIsWrapped ? object.value() : object, + othUnwrapped = othIsWrapped ? other.value() : other; + + stack || (stack = new Stack); + return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); + } + } + if (!isSameTag) { + return false; + } + stack || (stack = new Stack); + return equalObjects(object, other, bitmask, customizer, equalFunc, stack); + } + + /** + * The base implementation of `_.isMap` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a map, else `false`. + */ + function baseIsMap(value) { + return isObjectLike(value) && getTag(value) == mapTag; + } + + /** + * The base implementation of `_.isMatch` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to inspect. + * @param {Object} source The object of property values to match. + * @param {Array} matchData The property names, values, and compare flags to match. + * @param {Function} [customizer] The function to customize comparisons. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. + */ + function baseIsMatch(object, source, matchData, customizer) { + var index = matchData.length, + length = index, + noCustomizer = !customizer; + + if (object == null) { + return !length; + } + object = Object(object); + while (index--) { + var data = matchData[index]; + if ((noCustomizer && data[2]) + ? data[1] !== object[data[0]] + : !(data[0] in object) + ) { + return false; + } + } + while (++index < length) { + data = matchData[index]; + var key = data[0], + objValue = object[key], + srcValue = data[1]; + + if (noCustomizer && data[2]) { + if (objValue === undefined && !(key in object)) { + return false; + } + } else { + var stack = new Stack; + if (customizer) { + var result = customizer(objValue, srcValue, key, object, source, stack); + } + if (!(result === undefined + ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack) + : result + )) { + return false; + } + } + } + return true; + } + + /** + * The base implementation of `_.isNative` without bad shim checks. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. + */ + function baseIsNative(value) { + if (!isObject(value) || isMasked(value)) { + return false; + } + var pattern = isFunction(value) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); + } + + /** + * The base implementation of `_.isRegExp` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. + */ + function baseIsRegExp(value) { + return isObjectLike(value) && baseGetTag(value) == regexpTag; + } + + /** + * The base implementation of `_.isSet` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a set, else `false`. + */ + function baseIsSet(value) { + return isObjectLike(value) && getTag(value) == setTag; + } + + /** + * The base implementation of `_.isTypedArray` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + */ + function baseIsTypedArray(value) { + return isObjectLike(value) && + isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; + } + + /** + * The base implementation of `_.iteratee`. + * + * @private + * @param {*} [value=_.identity] The value to convert to an iteratee. + * @returns {Function} Returns the iteratee. + */ + function baseIteratee(value) { + // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9. + // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details. + if (typeof value == 'function') { + return value; + } + if (value == null) { + return identity; + } + if (typeof value == 'object') { + return isArray(value) + ? baseMatchesProperty(value[0], value[1]) + : baseMatches(value); + } + return property(value); + } + + /** + * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ + function baseKeys(object) { + if (!isPrototype(object)) { + return nativeKeys(object); + } + var result = []; + for (var key in Object(object)) { + if (hasOwnProperty.call(object, key) && key != 'constructor') { + result.push(key); + } + } + return result; + } + + /** + * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ + function baseKeysIn(object) { + if (!isObject(object)) { + return nativeKeysIn(object); + } + var isProto = isPrototype(object), + result = []; + + for (var key in object) { + if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { + result.push(key); + } + } + return result; + } + + /** + * The base implementation of `_.lt` which doesn't coerce arguments. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is less than `other`, + * else `false`. + */ + function baseLt(value, other) { + return value < other; + } + + /** + * The base implementation of `_.map` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ + function baseMap(collection, iteratee) { + var index = -1, + result = isArrayLike(collection) ? Array(collection.length) : []; + + baseEach(collection, function(value, key, collection) { + result[++index] = iteratee(value, key, collection); + }); + return result; + } + + /** + * The base implementation of `_.matches` which doesn't clone `source`. + * + * @private + * @param {Object} source The object of property values to match. + * @returns {Function} Returns the new spec function. + */ + function baseMatches(source) { + var matchData = getMatchData(source); + if (matchData.length == 1 && matchData[0][2]) { + return matchesStrictComparable(matchData[0][0], matchData[0][1]); + } + return function(object) { + return object === source || baseIsMatch(object, source, matchData); + }; + } + + /** + * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`. + * + * @private + * @param {string} path The path of the property to get. + * @param {*} srcValue The value to match. + * @returns {Function} Returns the new spec function. + */ + function baseMatchesProperty(path, srcValue) { + if (isKey(path) && isStrictComparable(srcValue)) { + return matchesStrictComparable(toKey(path), srcValue); + } + return function(object) { + var objValue = get(object, path); + return (objValue === undefined && objValue === srcValue) + ? hasIn(object, path) + : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG); + }; + } + + /** + * The base implementation of `_.merge` without support for multiple sources. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @param {number} srcIndex The index of `source`. + * @param {Function} [customizer] The function to customize merged values. + * @param {Object} [stack] Tracks traversed source values and their merged + * counterparts. + */ + function baseMerge(object, source, srcIndex, customizer, stack) { + if (object === source) { + return; + } + baseFor(source, function(srcValue, key) { + stack || (stack = new Stack); + if (isObject(srcValue)) { + baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack); + } + else { + var newValue = customizer + ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack) + : undefined; + + if (newValue === undefined) { + newValue = srcValue; + } + assignMergeValue(object, key, newValue); + } + }, keysIn); + } + + /** + * A specialized version of `baseMerge` for arrays and objects which performs + * deep merges and tracks traversed objects enabling objects with circular + * references to be merged. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @param {string} key The key of the value to merge. + * @param {number} srcIndex The index of `source`. + * @param {Function} mergeFunc The function to merge values. + * @param {Function} [customizer] The function to customize assigned values. + * @param {Object} [stack] Tracks traversed source values and their merged + * counterparts. + */ + function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) { + var objValue = safeGet(object, key), + srcValue = safeGet(source, key), + stacked = stack.get(srcValue); + + if (stacked) { + assignMergeValue(object, key, stacked); + return; + } + var newValue = customizer + ? customizer(objValue, srcValue, (key + ''), object, source, stack) + : undefined; + + var isCommon = newValue === undefined; + + if (isCommon) { + var isArr = isArray(srcValue), + isBuff = !isArr && isBuffer(srcValue), + isTyped = !isArr && !isBuff && isTypedArray(srcValue); + + newValue = srcValue; + if (isArr || isBuff || isTyped) { + if (isArray(objValue)) { + newValue = objValue; + } + else if (isArrayLikeObject(objValue)) { + newValue = copyArray(objValue); + } + else if (isBuff) { + isCommon = false; + newValue = cloneBuffer(srcValue, true); + } + else if (isTyped) { + isCommon = false; + newValue = cloneTypedArray(srcValue, true); + } + else { + newValue = []; + } + } + else if (isPlainObject(srcValue) || isArguments(srcValue)) { + newValue = objValue; + if (isArguments(objValue)) { + newValue = toPlainObject(objValue); + } + else if (!isObject(objValue) || isFunction(objValue)) { + newValue = initCloneObject(srcValue); + } + } + else { + isCommon = false; + } + } + if (isCommon) { + // Recursively merge objects and arrays (susceptible to call stack limits). + stack.set(srcValue, newValue); + mergeFunc(newValue, srcValue, srcIndex, customizer, stack); + stack['delete'](srcValue); + } + assignMergeValue(object, key, newValue); + } + + /** + * The base implementation of `_.nth` which doesn't coerce arguments. + * + * @private + * @param {Array} array The array to query. + * @param {number} n The index of the element to return. + * @returns {*} Returns the nth element of `array`. + */ + function baseNth(array, n) { + var length = array.length; + if (!length) { + return; + } + n += n < 0 ? length : 0; + return isIndex(n, length) ? array[n] : undefined; + } + + /** + * The base implementation of `_.orderBy` without param guards. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by. + * @param {string[]} orders The sort orders of `iteratees`. + * @returns {Array} Returns the new sorted array. + */ + function baseOrderBy(collection, iteratees, orders) { + if (iteratees.length) { + iteratees = arrayMap(iteratees, function(iteratee) { + if (isArray(iteratee)) { + return function(value) { + return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee); + } + } + return iteratee; + }); + } else { + iteratees = [identity]; + } + + var index = -1; + iteratees = arrayMap(iteratees, baseUnary(getIteratee())); + + var result = baseMap(collection, function(value, key, collection) { + var criteria = arrayMap(iteratees, function(iteratee) { + return iteratee(value); + }); + return { 'criteria': criteria, 'index': ++index, 'value': value }; + }); + + return baseSortBy(result, function(object, other) { + return compareMultiple(object, other, orders); + }); + } + + /** + * The base implementation of `_.pick` without support for individual + * property identifiers. + * + * @private + * @param {Object} object The source object. + * @param {string[]} paths The property paths to pick. + * @returns {Object} Returns the new object. + */ + function basePick(object, paths) { + return basePickBy(object, paths, function(value, path) { + return hasIn(object, path); + }); + } + + /** + * The base implementation of `_.pickBy` without support for iteratee shorthands. + * + * @private + * @param {Object} object The source object. + * @param {string[]} paths The property paths to pick. + * @param {Function} predicate The function invoked per property. + * @returns {Object} Returns the new object. + */ + function basePickBy(object, paths, predicate) { + var index = -1, + length = paths.length, + result = {}; + + while (++index < length) { + var path = paths[index], + value = baseGet(object, path); + + if (predicate(value, path)) { + baseSet(result, castPath(path, object), value); + } + } + return result; + } + + /** + * A specialized version of `baseProperty` which supports deep paths. + * + * @private + * @param {Array|string} path The path of the property to get. + * @returns {Function} Returns the new accessor function. + */ + function basePropertyDeep(path) { + return function(object) { + return baseGet(object, path); + }; + } + + /** + * The base implementation of `_.pullAllBy` without support for iteratee + * shorthands. + * + * @private + * @param {Array} array The array to modify. + * @param {Array} values The values to remove. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns `array`. + */ + function basePullAll(array, values, iteratee, comparator) { + var indexOf = comparator ? baseIndexOfWith : baseIndexOf, + index = -1, + length = values.length, + seen = array; + + if (array === values) { + values = copyArray(values); + } + if (iteratee) { + seen = arrayMap(array, baseUnary(iteratee)); + } + while (++index < length) { + var fromIndex = 0, + value = values[index], + computed = iteratee ? iteratee(value) : value; + + while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) { + if (seen !== array) { + splice.call(seen, fromIndex, 1); + } + splice.call(array, fromIndex, 1); + } + } + return array; + } + + /** + * The base implementation of `_.pullAt` without support for individual + * indexes or capturing the removed elements. + * + * @private + * @param {Array} array The array to modify. + * @param {number[]} indexes The indexes of elements to remove. + * @returns {Array} Returns `array`. + */ + function basePullAt(array, indexes) { + var length = array ? indexes.length : 0, + lastIndex = length - 1; + + while (length--) { + var index = indexes[length]; + if (length == lastIndex || index !== previous) { + var previous = index; + if (isIndex(index)) { + splice.call(array, index, 1); + } else { + baseUnset(array, index); + } + } + } + return array; + } + + /** + * The base implementation of `_.random` without support for returning + * floating-point numbers. + * + * @private + * @param {number} lower The lower bound. + * @param {number} upper The upper bound. + * @returns {number} Returns the random number. + */ + function baseRandom(lower, upper) { + return lower + nativeFloor(nativeRandom() * (upper - lower + 1)); + } + + /** + * The base implementation of `_.range` and `_.rangeRight` which doesn't + * coerce arguments. + * + * @private + * @param {number} start The start of the range. + * @param {number} end The end of the range. + * @param {number} step The value to increment or decrement by. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Array} Returns the range of numbers. + */ + function baseRange(start, end, step, fromRight) { + var index = -1, + length = nativeMax(nativeCeil((end - start) / (step || 1)), 0), + result = Array(length); + + while (length--) { + result[fromRight ? length : ++index] = start; + start += step; + } + return result; + } + + /** + * The base implementation of `_.repeat` which doesn't coerce arguments. + * + * @private + * @param {string} string The string to repeat. + * @param {number} n The number of times to repeat the string. + * @returns {string} Returns the repeated string. + */ + function baseRepeat(string, n) { + var result = ''; + if (!string || n < 1 || n > MAX_SAFE_INTEGER) { + return result; + } + // Leverage the exponentiation by squaring algorithm for a faster repeat. + // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details. + do { + if (n % 2) { + result += string; + } + n = nativeFloor(n / 2); + if (n) { + string += string; + } + } while (n); + + return result; + } + + /** + * The base implementation of `_.rest` which doesn't validate or coerce arguments. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @returns {Function} Returns the new function. + */ + function baseRest(func, start) { + return setToString(overRest(func, start, identity), func + ''); + } + + /** + * The base implementation of `_.sample`. + * + * @private + * @param {Array|Object} collection The collection to sample. + * @returns {*} Returns the random element. + */ + function baseSample(collection) { + return arraySample(values(collection)); + } + + /** + * The base implementation of `_.sampleSize` without param guards. + * + * @private + * @param {Array|Object} collection The collection to sample. + * @param {number} n The number of elements to sample. + * @returns {Array} Returns the random elements. + */ + function baseSampleSize(collection, n) { + var array = values(collection); + return shuffleSelf(array, baseClamp(n, 0, array.length)); + } + + /** + * The base implementation of `_.set`. + * + * @private + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {*} value The value to set. + * @param {Function} [customizer] The function to customize path creation. + * @returns {Object} Returns `object`. + */ + function baseSet(object, path, value, customizer) { + if (!isObject(object)) { + return object; + } + path = castPath(path, object); + + var index = -1, + length = path.length, + lastIndex = length - 1, + nested = object; + + while (nested != null && ++index < length) { + var key = toKey(path[index]), + newValue = value; + + if (key === '__proto__' || key === 'constructor' || key === 'prototype') { + return object; + } + + if (index != lastIndex) { + var objValue = nested[key]; + newValue = customizer ? customizer(objValue, key, nested) : undefined; + if (newValue === undefined) { + newValue = isObject(objValue) + ? objValue + : (isIndex(path[index + 1]) ? [] : {}); + } + } + assignValue(nested, key, newValue); + nested = nested[key]; + } + return object; + } + + /** + * The base implementation of `setData` without support for hot loop shorting. + * + * @private + * @param {Function} func The function to associate metadata with. + * @param {*} data The metadata. + * @returns {Function} Returns `func`. + */ + var baseSetData = !metaMap ? identity : function(func, data) { + metaMap.set(func, data); + return func; + }; + + /** + * The base implementation of `setToString` without support for hot loop shorting. + * + * @private + * @param {Function} func The function to modify. + * @param {Function} string The `toString` result. + * @returns {Function} Returns `func`. + */ + var baseSetToString = !defineProperty ? identity : function(func, string) { + return defineProperty(func, 'toString', { + 'configurable': true, + 'enumerable': false, + 'value': constant(string), + 'writable': true + }); + }; + + /** + * The base implementation of `_.shuffle`. + * + * @private + * @param {Array|Object} collection The collection to shuffle. + * @returns {Array} Returns the new shuffled array. + */ + function baseShuffle(collection) { + return shuffleSelf(values(collection)); + } + + /** + * The base implementation of `_.slice` without an iteratee call guard. + * + * @private + * @param {Array} array The array to slice. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the slice of `array`. + */ + function baseSlice(array, start, end) { + var index = -1, + length = array.length; + + if (start < 0) { + start = -start > length ? 0 : (length + start); + } + end = end > length ? length : end; + if (end < 0) { + end += length; + } + length = start > end ? 0 : ((end - start) >>> 0); + start >>>= 0; + + var result = Array(length); + while (++index < length) { + result[index] = array[index + start]; + } + return result; + } + + /** + * The base implementation of `_.some` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + */ + function baseSome(collection, predicate) { + var result; + + baseEach(collection, function(value, index, collection) { + result = predicate(value, index, collection); + return !result; + }); + return !!result; + } + + /** + * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which + * performs a binary search of `array` to determine the index at which `value` + * should be inserted into `array` in order to maintain its sort order. + * + * @private + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @param {boolean} [retHighest] Specify returning the highest qualified index. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + */ + function baseSortedIndex(array, value, retHighest) { + var low = 0, + high = array == null ? low : array.length; + + if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) { + while (low < high) { + var mid = (low + high) >>> 1, + computed = array[mid]; + + if (computed !== null && !isSymbol(computed) && + (retHighest ? (computed <= value) : (computed < value))) { + low = mid + 1; + } else { + high = mid; + } + } + return high; + } + return baseSortedIndexBy(array, value, identity, retHighest); + } + + /** + * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy` + * which invokes `iteratee` for `value` and each element of `array` to compute + * their sort ranking. The iteratee is invoked with one argument; (value). + * + * @private + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @param {Function} iteratee The iteratee invoked per element. + * @param {boolean} [retHighest] Specify returning the highest qualified index. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + */ + function baseSortedIndexBy(array, value, iteratee, retHighest) { + var low = 0, + high = array == null ? 0 : array.length; + if (high === 0) { + return 0; + } + + value = iteratee(value); + var valIsNaN = value !== value, + valIsNull = value === null, + valIsSymbol = isSymbol(value), + valIsUndefined = value === undefined; + + while (low < high) { + var mid = nativeFloor((low + high) / 2), + computed = iteratee(array[mid]), + othIsDefined = computed !== undefined, + othIsNull = computed === null, + othIsReflexive = computed === computed, + othIsSymbol = isSymbol(computed); + + if (valIsNaN) { + var setLow = retHighest || othIsReflexive; + } else if (valIsUndefined) { + setLow = othIsReflexive && (retHighest || othIsDefined); + } else if (valIsNull) { + setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull); + } else if (valIsSymbol) { + setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol); + } else if (othIsNull || othIsSymbol) { + setLow = false; + } else { + setLow = retHighest ? (computed <= value) : (computed < value); + } + if (setLow) { + low = mid + 1; + } else { + high = mid; + } + } + return nativeMin(high, MAX_ARRAY_INDEX); + } + + /** + * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without + * support for iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @returns {Array} Returns the new duplicate free array. + */ + function baseSortedUniq(array, iteratee) { + var index = -1, + length = array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index], + computed = iteratee ? iteratee(value) : value; + + if (!index || !eq(computed, seen)) { + var seen = computed; + result[resIndex++] = value === 0 ? 0 : value; + } + } + return result; + } + + /** + * The base implementation of `_.toNumber` which doesn't ensure correct + * conversions of binary, hexadecimal, or octal string values. + * + * @private + * @param {*} value The value to process. + * @returns {number} Returns the number. + */ + function baseToNumber(value) { + if (typeof value == 'number') { + return value; + } + if (isSymbol(value)) { + return NAN; + } + return +value; + } + + /** + * The base implementation of `_.toString` which doesn't convert nullish + * values to empty strings. + * + * @private + * @param {*} value The value to process. + * @returns {string} Returns the string. + */ + function baseToString(value) { + // Exit early for strings to avoid a performance hit in some environments. + if (typeof value == 'string') { + return value; + } + if (isArray(value)) { + // Recursively convert values (susceptible to call stack limits). + return arrayMap(value, baseToString) + ''; + } + if (isSymbol(value)) { + return symbolToString ? symbolToString.call(value) : ''; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; + } + + /** + * The base implementation of `_.uniqBy` without support for iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new duplicate free array. + */ + function baseUniq(array, iteratee, comparator) { + var index = -1, + includes = arrayIncludes, + length = array.length, + isCommon = true, + result = [], + seen = result; + + if (comparator) { + isCommon = false; + includes = arrayIncludesWith; + } + else if (length >= LARGE_ARRAY_SIZE) { + var set = iteratee ? null : createSet(array); + if (set) { + return setToArray(set); + } + isCommon = false; + includes = cacheHas; + seen = new SetCache; + } + else { + seen = iteratee ? [] : result; + } + outer: + while (++index < length) { + var value = array[index], + computed = iteratee ? iteratee(value) : value; + + value = (comparator || value !== 0) ? value : 0; + if (isCommon && computed === computed) { + var seenIndex = seen.length; + while (seenIndex--) { + if (seen[seenIndex] === computed) { + continue outer; + } + } + if (iteratee) { + seen.push(computed); + } + result.push(value); + } + else if (!includes(seen, computed, comparator)) { + if (seen !== result) { + seen.push(computed); + } + result.push(value); + } + } + return result; + } + + /** + * The base implementation of `_.unset`. + * + * @private + * @param {Object} object The object to modify. + * @param {Array|string} path The property path to unset. + * @returns {boolean} Returns `true` if the property is deleted, else `false`. + */ + function baseUnset(object, path) { + path = castPath(path, object); + object = parent(object, path); + return object == null || delete object[toKey(last(path))]; + } + + /** + * The base implementation of `_.update`. + * + * @private + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to update. + * @param {Function} updater The function to produce the updated value. + * @param {Function} [customizer] The function to customize path creation. + * @returns {Object} Returns `object`. + */ + function baseUpdate(object, path, updater, customizer) { + return baseSet(object, path, updater(baseGet(object, path)), customizer); + } + + /** + * The base implementation of methods like `_.dropWhile` and `_.takeWhile` + * without support for iteratee shorthands. + * + * @private + * @param {Array} array The array to query. + * @param {Function} predicate The function invoked per iteration. + * @param {boolean} [isDrop] Specify dropping elements instead of taking them. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Array} Returns the slice of `array`. + */ + function baseWhile(array, predicate, isDrop, fromRight) { + var length = array.length, + index = fromRight ? length : -1; + + while ((fromRight ? index-- : ++index < length) && + predicate(array[index], index, array)) {} + + return isDrop + ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length)) + : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index)); + } + + /** + * The base implementation of `wrapperValue` which returns the result of + * performing a sequence of actions on the unwrapped `value`, where each + * successive action is supplied the return value of the previous. + * + * @private + * @param {*} value The unwrapped value. + * @param {Array} actions Actions to perform to resolve the unwrapped value. + * @returns {*} Returns the resolved value. + */ + function baseWrapperValue(value, actions) { + var result = value; + if (result instanceof LazyWrapper) { + result = result.value(); + } + return arrayReduce(actions, function(result, action) { + return action.func.apply(action.thisArg, arrayPush([result], action.args)); + }, result); + } + + /** + * The base implementation of methods like `_.xor`, without support for + * iteratee shorthands, that accepts an array of arrays to inspect. + * + * @private + * @param {Array} arrays The arrays to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of values. + */ + function baseXor(arrays, iteratee, comparator) { + var length = arrays.length; + if (length < 2) { + return length ? baseUniq(arrays[0]) : []; + } + var index = -1, + result = Array(length); + + while (++index < length) { + var array = arrays[index], + othIndex = -1; + + while (++othIndex < length) { + if (othIndex != index) { + result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator); + } + } + } + return baseUniq(baseFlatten(result, 1), iteratee, comparator); + } + + /** + * This base implementation of `_.zipObject` which assigns values using `assignFunc`. + * + * @private + * @param {Array} props The property identifiers. + * @param {Array} values The property values. + * @param {Function} assignFunc The function to assign values. + * @returns {Object} Returns the new object. + */ + function baseZipObject(props, values, assignFunc) { + var index = -1, + length = props.length, + valsLength = values.length, + result = {}; + + while (++index < length) { + var value = index < valsLength ? values[index] : undefined; + assignFunc(result, props[index], value); + } + return result; + } + + /** + * Casts `value` to an empty array if it's not an array like object. + * + * @private + * @param {*} value The value to inspect. + * @returns {Array|Object} Returns the cast array-like object. + */ + function castArrayLikeObject(value) { + return isArrayLikeObject(value) ? value : []; + } + + /** + * Casts `value` to `identity` if it's not a function. + * + * @private + * @param {*} value The value to inspect. + * @returns {Function} Returns cast function. + */ + function castFunction(value) { + return typeof value == 'function' ? value : identity; + } + + /** + * Casts `value` to a path array if it's not one. + * + * @private + * @param {*} value The value to inspect. + * @param {Object} [object] The object to query keys on. + * @returns {Array} Returns the cast property path array. + */ + function castPath(value, object) { + if (isArray(value)) { + return value; + } + return isKey(value, object) ? [value] : stringToPath(toString(value)); + } + + /** + * A `baseRest` alias which can be replaced with `identity` by module + * replacement plugins. + * + * @private + * @type {Function} + * @param {Function} func The function to apply a rest parameter to. + * @returns {Function} Returns the new function. + */ + var castRest = baseRest; + + /** + * Casts `array` to a slice if it's needed. + * + * @private + * @param {Array} array The array to inspect. + * @param {number} start The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the cast slice. + */ + function castSlice(array, start, end) { + var length = array.length; + end = end === undefined ? length : end; + return (!start && end >= length) ? array : baseSlice(array, start, end); + } + + /** + * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout). + * + * @private + * @param {number|Object} id The timer id or timeout object of the timer to clear. + */ + var clearTimeout = ctxClearTimeout || function(id) { + return root.clearTimeout(id); + }; + + /** + * Creates a clone of `buffer`. + * + * @private + * @param {Buffer} buffer The buffer to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Buffer} Returns the cloned buffer. + */ + function cloneBuffer(buffer, isDeep) { + if (isDeep) { + return buffer.slice(); + } + var length = buffer.length, + result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); + + buffer.copy(result); + return result; + } + + /** + * Creates a clone of `arrayBuffer`. + * + * @private + * @param {ArrayBuffer} arrayBuffer The array buffer to clone. + * @returns {ArrayBuffer} Returns the cloned array buffer. + */ + function cloneArrayBuffer(arrayBuffer) { + var result = new arrayBuffer.constructor(arrayBuffer.byteLength); + new Uint8Array(result).set(new Uint8Array(arrayBuffer)); + return result; + } + + /** + * Creates a clone of `dataView`. + * + * @private + * @param {Object} dataView The data view to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned data view. + */ + function cloneDataView(dataView, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; + return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); + } + + /** + * Creates a clone of `regexp`. + * + * @private + * @param {Object} regexp The regexp to clone. + * @returns {Object} Returns the cloned regexp. + */ + function cloneRegExp(regexp) { + var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); + result.lastIndex = regexp.lastIndex; + return result; + } + + /** + * Creates a clone of the `symbol` object. + * + * @private + * @param {Object} symbol The symbol object to clone. + * @returns {Object} Returns the cloned symbol object. + */ + function cloneSymbol(symbol) { + return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; + } + + /** + * Creates a clone of `typedArray`. + * + * @private + * @param {Object} typedArray The typed array to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned typed array. + */ + function cloneTypedArray(typedArray, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; + return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); + } + + /** + * Compares values to sort them in ascending order. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {number} Returns the sort order indicator for `value`. + */ + function compareAscending(value, other) { + if (value !== other) { + var valIsDefined = value !== undefined, + valIsNull = value === null, + valIsReflexive = value === value, + valIsSymbol = isSymbol(value); + + var othIsDefined = other !== undefined, + othIsNull = other === null, + othIsReflexive = other === other, + othIsSymbol = isSymbol(other); + + if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) || + (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) || + (valIsNull && othIsDefined && othIsReflexive) || + (!valIsDefined && othIsReflexive) || + !valIsReflexive) { + return 1; + } + if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) || + (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) || + (othIsNull && valIsDefined && valIsReflexive) || + (!othIsDefined && valIsReflexive) || + !othIsReflexive) { + return -1; + } + } + return 0; + } + + /** + * Used by `_.orderBy` to compare multiple properties of a value to another + * and stable sort them. + * + * If `orders` is unspecified, all values are sorted in ascending order. Otherwise, + * specify an order of "desc" for descending or "asc" for ascending sort order + * of corresponding values. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {boolean[]|string[]} orders The order to sort by for each property. + * @returns {number} Returns the sort order indicator for `object`. + */ + function compareMultiple(object, other, orders) { + var index = -1, + objCriteria = object.criteria, + othCriteria = other.criteria, + length = objCriteria.length, + ordersLength = orders.length; + + while (++index < length) { + var result = compareAscending(objCriteria[index], othCriteria[index]); + if (result) { + if (index >= ordersLength) { + return result; + } + var order = orders[index]; + return result * (order == 'desc' ? -1 : 1); + } + } + // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications + // that causes it, under certain circumstances, to provide the same value for + // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247 + // for more details. + // + // This also ensures a stable sort in V8 and other engines. + // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details. + return object.index - other.index; + } + + /** + * Creates an array that is the composition of partially applied arguments, + * placeholders, and provided arguments into a single array of arguments. + * + * @private + * @param {Array} args The provided arguments. + * @param {Array} partials The arguments to prepend to those provided. + * @param {Array} holders The `partials` placeholder indexes. + * @params {boolean} [isCurried] Specify composing for a curried function. + * @returns {Array} Returns the new array of composed arguments. + */ + function composeArgs(args, partials, holders, isCurried) { + var argsIndex = -1, + argsLength = args.length, + holdersLength = holders.length, + leftIndex = -1, + leftLength = partials.length, + rangeLength = nativeMax(argsLength - holdersLength, 0), + result = Array(leftLength + rangeLength), + isUncurried = !isCurried; + + while (++leftIndex < leftLength) { + result[leftIndex] = partials[leftIndex]; + } + while (++argsIndex < holdersLength) { + if (isUncurried || argsIndex < argsLength) { + result[holders[argsIndex]] = args[argsIndex]; + } + } + while (rangeLength--) { + result[leftIndex++] = args[argsIndex++]; + } + return result; + } + + /** + * This function is like `composeArgs` except that the arguments composition + * is tailored for `_.partialRight`. + * + * @private + * @param {Array} args The provided arguments. + * @param {Array} partials The arguments to append to those provided. + * @param {Array} holders The `partials` placeholder indexes. + * @params {boolean} [isCurried] Specify composing for a curried function. + * @returns {Array} Returns the new array of composed arguments. + */ + function composeArgsRight(args, partials, holders, isCurried) { + var argsIndex = -1, + argsLength = args.length, + holdersIndex = -1, + holdersLength = holders.length, + rightIndex = -1, + rightLength = partials.length, + rangeLength = nativeMax(argsLength - holdersLength, 0), + result = Array(rangeLength + rightLength), + isUncurried = !isCurried; + + while (++argsIndex < rangeLength) { + result[argsIndex] = args[argsIndex]; + } + var offset = argsIndex; + while (++rightIndex < rightLength) { + result[offset + rightIndex] = partials[rightIndex]; + } + while (++holdersIndex < holdersLength) { + if (isUncurried || argsIndex < argsLength) { + result[offset + holders[holdersIndex]] = args[argsIndex++]; + } + } + return result; + } + + /** + * Copies the values of `source` to `array`. + * + * @private + * @param {Array} source The array to copy values from. + * @param {Array} [array=[]] The array to copy values to. + * @returns {Array} Returns `array`. + */ + function copyArray(source, array) { + var index = -1, + length = source.length; + + array || (array = Array(length)); + while (++index < length) { + array[index] = source[index]; + } + return array; + } + + /** + * Copies properties of `source` to `object`. + * + * @private + * @param {Object} source The object to copy properties from. + * @param {Array} props The property identifiers to copy. + * @param {Object} [object={}] The object to copy properties to. + * @param {Function} [customizer] The function to customize copied values. + * @returns {Object} Returns `object`. + */ + function copyObject(source, props, object, customizer) { + var isNew = !object; + object || (object = {}); + + var index = -1, + length = props.length; + + while (++index < length) { + var key = props[index]; + + var newValue = customizer + ? customizer(object[key], source[key], key, object, source) + : undefined; + + if (newValue === undefined) { + newValue = source[key]; + } + if (isNew) { + baseAssignValue(object, key, newValue); + } else { + assignValue(object, key, newValue); + } + } + return object; + } + + /** + * Copies own symbols of `source` to `object`. + * + * @private + * @param {Object} source The object to copy symbols from. + * @param {Object} [object={}] The object to copy symbols to. + * @returns {Object} Returns `object`. + */ + function copySymbols(source, object) { + return copyObject(source, getSymbols(source), object); + } + + /** + * Copies own and inherited symbols of `source` to `object`. + * + * @private + * @param {Object} source The object to copy symbols from. + * @param {Object} [object={}] The object to copy symbols to. + * @returns {Object} Returns `object`. + */ + function copySymbolsIn(source, object) { + return copyObject(source, getSymbolsIn(source), object); + } + + /** + * Creates a function like `_.groupBy`. + * + * @private + * @param {Function} setter The function to set accumulator values. + * @param {Function} [initializer] The accumulator object initializer. + * @returns {Function} Returns the new aggregator function. + */ + function createAggregator(setter, initializer) { + return function(collection, iteratee) { + var func = isArray(collection) ? arrayAggregator : baseAggregator, + accumulator = initializer ? initializer() : {}; + + return func(collection, setter, getIteratee(iteratee, 2), accumulator); + }; + } + + /** + * Creates a function like `_.assign`. + * + * @private + * @param {Function} assigner The function to assign values. + * @returns {Function} Returns the new assigner function. + */ + function createAssigner(assigner) { + return baseRest(function(object, sources) { + var index = -1, + length = sources.length, + customizer = length > 1 ? sources[length - 1] : undefined, + guard = length > 2 ? sources[2] : undefined; + + customizer = (assigner.length > 3 && typeof customizer == 'function') + ? (length--, customizer) + : undefined; + + if (guard && isIterateeCall(sources[0], sources[1], guard)) { + customizer = length < 3 ? undefined : customizer; + length = 1; + } + object = Object(object); + while (++index < length) { + var source = sources[index]; + if (source) { + assigner(object, source, index, customizer); + } + } + return object; + }); + } + + /** + * Creates a `baseEach` or `baseEachRight` function. + * + * @private + * @param {Function} eachFunc The function to iterate over a collection. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ + function createBaseEach(eachFunc, fromRight) { + return function(collection, iteratee) { + if (collection == null) { + return collection; + } + if (!isArrayLike(collection)) { + return eachFunc(collection, iteratee); + } + var length = collection.length, + index = fromRight ? length : -1, + iterable = Object(collection); + + while ((fromRight ? index-- : ++index < length)) { + if (iteratee(iterable[index], index, iterable) === false) { + break; + } + } + return collection; + }; + } + + /** + * Creates a base function for methods like `_.forIn` and `_.forOwn`. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ + function createBaseFor(fromRight) { + return function(object, iteratee, keysFunc) { + var index = -1, + iterable = Object(object), + props = keysFunc(object), + length = props.length; + + while (length--) { + var key = props[fromRight ? length : ++index]; + if (iteratee(iterable[key], key, iterable) === false) { + break; + } + } + return object; + }; + } + + /** + * Creates a function that wraps `func` to invoke it with the optional `this` + * binding of `thisArg`. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {*} [thisArg] The `this` binding of `func`. + * @returns {Function} Returns the new wrapped function. + */ + function createBind(func, bitmask, thisArg) { + var isBind = bitmask & WRAP_BIND_FLAG, + Ctor = createCtor(func); + + function wrapper() { + var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; + return fn.apply(isBind ? thisArg : this, arguments); + } + return wrapper; + } + + /** + * Creates a function like `_.lowerFirst`. + * + * @private + * @param {string} methodName The name of the `String` case method to use. + * @returns {Function} Returns the new case function. + */ + function createCaseFirst(methodName) { + return function(string) { + string = toString(string); + + var strSymbols = hasUnicode(string) + ? stringToArray(string) + : undefined; + + var chr = strSymbols + ? strSymbols[0] + : string.charAt(0); + + var trailing = strSymbols + ? castSlice(strSymbols, 1).join('') + : string.slice(1); + + return chr[methodName]() + trailing; + }; + } + + /** + * Creates a function like `_.camelCase`. + * + * @private + * @param {Function} callback The function to combine each word. + * @returns {Function} Returns the new compounder function. + */ + function createCompounder(callback) { + return function(string) { + return arrayReduce(words(deburr(string).replace(reApos, '')), callback, ''); + }; + } + + /** + * Creates a function that produces an instance of `Ctor` regardless of + * whether it was invoked as part of a `new` expression or by `call` or `apply`. + * + * @private + * @param {Function} Ctor The constructor to wrap. + * @returns {Function} Returns the new wrapped function. + */ + function createCtor(Ctor) { + return function() { + // Use a `switch` statement to work with class constructors. See + // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist + // for more details. + var args = arguments; + switch (args.length) { + case 0: return new Ctor; + case 1: return new Ctor(args[0]); + case 2: return new Ctor(args[0], args[1]); + case 3: return new Ctor(args[0], args[1], args[2]); + case 4: return new Ctor(args[0], args[1], args[2], args[3]); + case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]); + case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]); + case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]); + } + var thisBinding = baseCreate(Ctor.prototype), + result = Ctor.apply(thisBinding, args); + + // Mimic the constructor's `return` behavior. + // See https://es5.github.io/#x13.2.2 for more details. + return isObject(result) ? result : thisBinding; + }; + } + + /** + * Creates a function that wraps `func` to enable currying. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {number} arity The arity of `func`. + * @returns {Function} Returns the new wrapped function. + */ + function createCurry(func, bitmask, arity) { + var Ctor = createCtor(func); + + function wrapper() { + var length = arguments.length, + args = Array(length), + index = length, + placeholder = getHolder(wrapper); + + while (index--) { + args[index] = arguments[index]; + } + var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder) + ? [] + : replaceHolders(args, placeholder); + + length -= holders.length; + if (length < arity) { + return createRecurry( + func, bitmask, createHybrid, wrapper.placeholder, undefined, + args, holders, undefined, undefined, arity - length); + } + var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; + return apply(fn, this, args); + } + return wrapper; + } + + /** + * Creates a `_.find` or `_.findLast` function. + * + * @private + * @param {Function} findIndexFunc The function to find the collection index. + * @returns {Function} Returns the new find function. + */ + function createFind(findIndexFunc) { + return function(collection, predicate, fromIndex) { + var iterable = Object(collection); + if (!isArrayLike(collection)) { + var iteratee = getIteratee(predicate, 3); + collection = keys(collection); + predicate = function(key) { return iteratee(iterable[key], key, iterable); }; + } + var index = findIndexFunc(collection, predicate, fromIndex); + return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined; + }; + } + + /** + * Creates a `_.flow` or `_.flowRight` function. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new flow function. + */ + function createFlow(fromRight) { + return flatRest(function(funcs) { + var length = funcs.length, + index = length, + prereq = LodashWrapper.prototype.thru; + + if (fromRight) { + funcs.reverse(); + } + while (index--) { + var func = funcs[index]; + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + if (prereq && !wrapper && getFuncName(func) == 'wrapper') { + var wrapper = new LodashWrapper([], true); + } + } + index = wrapper ? index : length; + while (++index < length) { + func = funcs[index]; + + var funcName = getFuncName(func), + data = funcName == 'wrapper' ? getData(func) : undefined; + + if (data && isLaziable(data[0]) && + data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) && + !data[4].length && data[9] == 1 + ) { + wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]); + } else { + wrapper = (func.length == 1 && isLaziable(func)) + ? wrapper[funcName]() + : wrapper.thru(func); + } + } + return function() { + var args = arguments, + value = args[0]; + + if (wrapper && args.length == 1 && isArray(value)) { + return wrapper.plant(value).value(); + } + var index = 0, + result = length ? funcs[index].apply(this, args) : value; + + while (++index < length) { + result = funcs[index].call(this, result); + } + return result; + }; + }); + } + + /** + * Creates a function that wraps `func` to invoke it with optional `this` + * binding of `thisArg`, partial application, and currying. + * + * @private + * @param {Function|string} func The function or method name to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {*} [thisArg] The `this` binding of `func`. + * @param {Array} [partials] The arguments to prepend to those provided to + * the new function. + * @param {Array} [holders] The `partials` placeholder indexes. + * @param {Array} [partialsRight] The arguments to append to those provided + * to the new function. + * @param {Array} [holdersRight] The `partialsRight` placeholder indexes. + * @param {Array} [argPos] The argument positions of the new function. + * @param {number} [ary] The arity cap of `func`. + * @param {number} [arity] The arity of `func`. + * @returns {Function} Returns the new wrapped function. + */ + function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) { + var isAry = bitmask & WRAP_ARY_FLAG, + isBind = bitmask & WRAP_BIND_FLAG, + isBindKey = bitmask & WRAP_BIND_KEY_FLAG, + isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG), + isFlip = bitmask & WRAP_FLIP_FLAG, + Ctor = isBindKey ? undefined : createCtor(func); + + function wrapper() { + var length = arguments.length, + args = Array(length), + index = length; + + while (index--) { + args[index] = arguments[index]; + } + if (isCurried) { + var placeholder = getHolder(wrapper), + holdersCount = countHolders(args, placeholder); + } + if (partials) { + args = composeArgs(args, partials, holders, isCurried); + } + if (partialsRight) { + args = composeArgsRight(args, partialsRight, holdersRight, isCurried); + } + length -= holdersCount; + if (isCurried && length < arity) { + var newHolders = replaceHolders(args, placeholder); + return createRecurry( + func, bitmask, createHybrid, wrapper.placeholder, thisArg, + args, newHolders, argPos, ary, arity - length + ); + } + var thisBinding = isBind ? thisArg : this, + fn = isBindKey ? thisBinding[func] : func; + + length = args.length; + if (argPos) { + args = reorder(args, argPos); + } else if (isFlip && length > 1) { + args.reverse(); + } + if (isAry && ary < length) { + args.length = ary; + } + if (this && this !== root && this instanceof wrapper) { + fn = Ctor || createCtor(fn); + } + return fn.apply(thisBinding, args); + } + return wrapper; + } + + /** + * Creates a function like `_.invertBy`. + * + * @private + * @param {Function} setter The function to set accumulator values. + * @param {Function} toIteratee The function to resolve iteratees. + * @returns {Function} Returns the new inverter function. + */ + function createInverter(setter, toIteratee) { + return function(object, iteratee) { + return baseInverter(object, setter, toIteratee(iteratee), {}); + }; + } + + /** + * Creates a function that performs a mathematical operation on two values. + * + * @private + * @param {Function} operator The function to perform the operation. + * @param {number} [defaultValue] The value used for `undefined` arguments. + * @returns {Function} Returns the new mathematical operation function. + */ + function createMathOperation(operator, defaultValue) { + return function(value, other) { + var result; + if (value === undefined && other === undefined) { + return defaultValue; + } + if (value !== undefined) { + result = value; + } + if (other !== undefined) { + if (result === undefined) { + return other; + } + if (typeof value == 'string' || typeof other == 'string') { + value = baseToString(value); + other = baseToString(other); + } else { + value = baseToNumber(value); + other = baseToNumber(other); + } + result = operator(value, other); + } + return result; + }; + } + + /** + * Creates a function like `_.over`. + * + * @private + * @param {Function} arrayFunc The function to iterate over iteratees. + * @returns {Function} Returns the new over function. + */ + function createOver(arrayFunc) { + return flatRest(function(iteratees) { + iteratees = arrayMap(iteratees, baseUnary(getIteratee())); + return baseRest(function(args) { + var thisArg = this; + return arrayFunc(iteratees, function(iteratee) { + return apply(iteratee, thisArg, args); + }); + }); + }); + } + + /** + * Creates the padding for `string` based on `length`. The `chars` string + * is truncated if the number of characters exceeds `length`. + * + * @private + * @param {number} length The padding length. + * @param {string} [chars=' '] The string used as padding. + * @returns {string} Returns the padding for `string`. + */ + function createPadding(length, chars) { + chars = chars === undefined ? ' ' : baseToString(chars); + + var charsLength = chars.length; + if (charsLength < 2) { + return charsLength ? baseRepeat(chars, length) : chars; + } + var result = baseRepeat(chars, nativeCeil(length / stringSize(chars))); + return hasUnicode(chars) + ? castSlice(stringToArray(result), 0, length).join('') + : result.slice(0, length); + } + + /** + * Creates a function that wraps `func` to invoke it with the `this` binding + * of `thisArg` and `partials` prepended to the arguments it receives. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {*} thisArg The `this` binding of `func`. + * @param {Array} partials The arguments to prepend to those provided to + * the new function. + * @returns {Function} Returns the new wrapped function. + */ + function createPartial(func, bitmask, thisArg, partials) { + var isBind = bitmask & WRAP_BIND_FLAG, + Ctor = createCtor(func); + + function wrapper() { + var argsIndex = -1, + argsLength = arguments.length, + leftIndex = -1, + leftLength = partials.length, + args = Array(leftLength + argsLength), + fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; + + while (++leftIndex < leftLength) { + args[leftIndex] = partials[leftIndex]; + } + while (argsLength--) { + args[leftIndex++] = arguments[++argsIndex]; + } + return apply(fn, isBind ? thisArg : this, args); + } + return wrapper; + } + + /** + * Creates a `_.range` or `_.rangeRight` function. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new range function. + */ + function createRange(fromRight) { + return function(start, end, step) { + if (step && typeof step != 'number' && isIterateeCall(start, end, step)) { + end = step = undefined; + } + // Ensure the sign of `-0` is preserved. + start = toFinite(start); + if (end === undefined) { + end = start; + start = 0; + } else { + end = toFinite(end); + } + step = step === undefined ? (start < end ? 1 : -1) : toFinite(step); + return baseRange(start, end, step, fromRight); + }; + } + + /** + * Creates a function that performs a relational operation on two values. + * + * @private + * @param {Function} operator The function to perform the operation. + * @returns {Function} Returns the new relational operation function. + */ + function createRelationalOperation(operator) { + return function(value, other) { + if (!(typeof value == 'string' && typeof other == 'string')) { + value = toNumber(value); + other = toNumber(other); + } + return operator(value, other); + }; + } + + /** + * Creates a function that wraps `func` to continue currying. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @param {Function} wrapFunc The function to create the `func` wrapper. + * @param {*} placeholder The placeholder value. + * @param {*} [thisArg] The `this` binding of `func`. + * @param {Array} [partials] The arguments to prepend to those provided to + * the new function. + * @param {Array} [holders] The `partials` placeholder indexes. + * @param {Array} [argPos] The argument positions of the new function. + * @param {number} [ary] The arity cap of `func`. + * @param {number} [arity] The arity of `func`. + * @returns {Function} Returns the new wrapped function. + */ + function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) { + var isCurry = bitmask & WRAP_CURRY_FLAG, + newHolders = isCurry ? holders : undefined, + newHoldersRight = isCurry ? undefined : holders, + newPartials = isCurry ? partials : undefined, + newPartialsRight = isCurry ? undefined : partials; + + bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG); + bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG); + + if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) { + bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG); + } + var newData = [ + func, bitmask, thisArg, newPartials, newHolders, newPartialsRight, + newHoldersRight, argPos, ary, arity + ]; + + var result = wrapFunc.apply(undefined, newData); + if (isLaziable(func)) { + setData(result, newData); + } + result.placeholder = placeholder; + return setWrapToString(result, func, bitmask); + } + + /** + * Creates a function like `_.round`. + * + * @private + * @param {string} methodName The name of the `Math` method to use when rounding. + * @returns {Function} Returns the new round function. + */ + function createRound(methodName) { + var func = Math[methodName]; + return function(number, precision) { + number = toNumber(number); + precision = precision == null ? 0 : nativeMin(toInteger(precision), 292); + if (precision && nativeIsFinite(number)) { + // Shift with exponential notation to avoid floating-point issues. + // See [MDN](https://mdn.io/round#Examples) for more details. + var pair = (toString(number) + 'e').split('e'), + value = func(pair[0] + 'e' + (+pair[1] + precision)); + + pair = (toString(value) + 'e').split('e'); + return +(pair[0] + 'e' + (+pair[1] - precision)); + } + return func(number); + }; + } + + /** + * Creates a set object of `values`. + * + * @private + * @param {Array} values The values to add to the set. + * @returns {Object} Returns the new set. + */ + var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) { + return new Set(values); + }; + + /** + * Creates a `_.toPairs` or `_.toPairsIn` function. + * + * @private + * @param {Function} keysFunc The function to get the keys of a given object. + * @returns {Function} Returns the new pairs function. + */ + function createToPairs(keysFunc) { + return function(object) { + var tag = getTag(object); + if (tag == mapTag) { + return mapToArray(object); + } + if (tag == setTag) { + return setToPairs(object); + } + return baseToPairs(object, keysFunc(object)); + }; + } + + /** + * Creates a function that either curries or invokes `func` with optional + * `this` binding and partially applied arguments. + * + * @private + * @param {Function|string} func The function or method name to wrap. + * @param {number} bitmask The bitmask flags. + * 1 - `_.bind` + * 2 - `_.bindKey` + * 4 - `_.curry` or `_.curryRight` of a bound function + * 8 - `_.curry` + * 16 - `_.curryRight` + * 32 - `_.partial` + * 64 - `_.partialRight` + * 128 - `_.rearg` + * 256 - `_.ary` + * 512 - `_.flip` + * @param {*} [thisArg] The `this` binding of `func`. + * @param {Array} [partials] The arguments to be partially applied. + * @param {Array} [holders] The `partials` placeholder indexes. + * @param {Array} [argPos] The argument positions of the new function. + * @param {number} [ary] The arity cap of `func`. + * @param {number} [arity] The arity of `func`. + * @returns {Function} Returns the new wrapped function. + */ + function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) { + var isBindKey = bitmask & WRAP_BIND_KEY_FLAG; + if (!isBindKey && typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + var length = partials ? partials.length : 0; + if (!length) { + bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG); + partials = holders = undefined; + } + ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0); + arity = arity === undefined ? arity : toInteger(arity); + length -= holders ? holders.length : 0; + + if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) { + var partialsRight = partials, + holdersRight = holders; + + partials = holders = undefined; + } + var data = isBindKey ? undefined : getData(func); + + var newData = [ + func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, + argPos, ary, arity + ]; + + if (data) { + mergeData(newData, data); + } + func = newData[0]; + bitmask = newData[1]; + thisArg = newData[2]; + partials = newData[3]; + holders = newData[4]; + arity = newData[9] = newData[9] === undefined + ? (isBindKey ? 0 : func.length) + : nativeMax(newData[9] - length, 0); + + if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) { + bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG); + } + if (!bitmask || bitmask == WRAP_BIND_FLAG) { + var result = createBind(func, bitmask, thisArg); + } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) { + result = createCurry(func, bitmask, arity); + } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) { + result = createPartial(func, bitmask, thisArg, partials); + } else { + result = createHybrid.apply(undefined, newData); + } + var setter = data ? baseSetData : setData; + return setWrapToString(setter(result, newData), func, bitmask); + } + + /** + * Used by `_.defaults` to customize its `_.assignIn` use to assign properties + * of source objects to the destination object for all destination properties + * that resolve to `undefined`. + * + * @private + * @param {*} objValue The destination value. + * @param {*} srcValue The source value. + * @param {string} key The key of the property to assign. + * @param {Object} object The parent object of `objValue`. + * @returns {*} Returns the value to assign. + */ + function customDefaultsAssignIn(objValue, srcValue, key, object) { + if (objValue === undefined || + (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) { + return srcValue; + } + return objValue; + } + + /** + * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source + * objects into destination objects that are passed thru. + * + * @private + * @param {*} objValue The destination value. + * @param {*} srcValue The source value. + * @param {string} key The key of the property to merge. + * @param {Object} object The parent object of `objValue`. + * @param {Object} source The parent object of `srcValue`. + * @param {Object} [stack] Tracks traversed source values and their merged + * counterparts. + * @returns {*} Returns the value to assign. + */ + function customDefaultsMerge(objValue, srcValue, key, object, source, stack) { + if (isObject(objValue) && isObject(srcValue)) { + // Recursively merge objects and arrays (susceptible to call stack limits). + stack.set(srcValue, objValue); + baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack); + stack['delete'](srcValue); + } + return objValue; + } + + /** + * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain + * objects. + * + * @private + * @param {*} value The value to inspect. + * @param {string} key The key of the property to inspect. + * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`. + */ + function customOmitClone(value) { + return isPlainObject(value) ? undefined : value; + } + + /** + * A specialized version of `baseIsEqualDeep` for arrays with support for + * partial deep comparisons. + * + * @private + * @param {Array} array The array to compare. + * @param {Array} other The other array to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `array` and `other` objects. + * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. + */ + function equalArrays(array, other, bitmask, customizer, equalFunc, stack) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG, + arrLength = array.length, + othLength = other.length; + + if (arrLength != othLength && !(isPartial && othLength > arrLength)) { + return false; + } + // Check that cyclic values are equal. + var arrStacked = stack.get(array); + var othStacked = stack.get(other); + if (arrStacked && othStacked) { + return arrStacked == other && othStacked == array; + } + var index = -1, + result = true, + seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined; + + stack.set(array, other); + stack.set(other, array); + + // Ignore non-index properties. + while (++index < arrLength) { + var arrValue = array[index], + othValue = other[index]; + + if (customizer) { + var compared = isPartial + ? customizer(othValue, arrValue, index, other, array, stack) + : customizer(arrValue, othValue, index, array, other, stack); + } + if (compared !== undefined) { + if (compared) { + continue; + } + result = false; + break; + } + // Recursively compare arrays (susceptible to call stack limits). + if (seen) { + if (!arraySome(other, function(othValue, othIndex) { + if (!cacheHas(seen, othIndex) && + (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { + return seen.push(othIndex); + } + })) { + result = false; + break; + } + } else if (!( + arrValue === othValue || + equalFunc(arrValue, othValue, bitmask, customizer, stack) + )) { + result = false; + break; + } + } + stack['delete'](array); + stack['delete'](other); + return result; + } + + /** + * A specialized version of `baseIsEqualDeep` for comparing objects of + * the same `toStringTag`. + * + * **Note:** This function only supports comparing values with tags of + * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {string} tag The `toStringTag` of the objects to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ + function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) { + switch (tag) { + case dataViewTag: + if ((object.byteLength != other.byteLength) || + (object.byteOffset != other.byteOffset)) { + return false; + } + object = object.buffer; + other = other.buffer; + + case arrayBufferTag: + if ((object.byteLength != other.byteLength) || + !equalFunc(new Uint8Array(object), new Uint8Array(other))) { + return false; + } + return true; + + case boolTag: + case dateTag: + case numberTag: + // Coerce booleans to `1` or `0` and dates to milliseconds. + // Invalid dates are coerced to `NaN`. + return eq(+object, +other); + + case errorTag: + return object.name == other.name && object.message == other.message; + + case regexpTag: + case stringTag: + // Coerce regexes to strings and treat strings, primitives and objects, + // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring + // for more details. + return object == (other + ''); + + case mapTag: + var convert = mapToArray; + + case setTag: + var isPartial = bitmask & COMPARE_PARTIAL_FLAG; + convert || (convert = setToArray); + + if (object.size != other.size && !isPartial) { + return false; + } + // Assume cyclic values are equal. + var stacked = stack.get(object); + if (stacked) { + return stacked == other; + } + bitmask |= COMPARE_UNORDERED_FLAG; + + // Recursively compare objects (susceptible to call stack limits). + stack.set(object, other); + var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack); + stack['delete'](object); + return result; + + case symbolTag: + if (symbolValueOf) { + return symbolValueOf.call(object) == symbolValueOf.call(other); + } + } + return false; + } + + /** + * A specialized version of `baseIsEqualDeep` for objects with support for + * partial deep comparisons. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. + * @param {Function} customizer The function to customize comparisons. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ + function equalObjects(object, other, bitmask, customizer, equalFunc, stack) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG, + objProps = getAllKeys(object), + objLength = objProps.length, + othProps = getAllKeys(other), + othLength = othProps.length; + + if (objLength != othLength && !isPartial) { + return false; + } + var index = objLength; + while (index--) { + var key = objProps[index]; + if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { + return false; + } + } + // Check that cyclic values are equal. + var objStacked = stack.get(object); + var othStacked = stack.get(other); + if (objStacked && othStacked) { + return objStacked == other && othStacked == object; + } + var result = true; + stack.set(object, other); + stack.set(other, object); + + var skipCtor = isPartial; + while (++index < objLength) { + key = objProps[index]; + var objValue = object[key], + othValue = other[key]; + + if (customizer) { + var compared = isPartial + ? customizer(othValue, objValue, key, other, object, stack) + : customizer(objValue, othValue, key, object, other, stack); + } + // Recursively compare objects (susceptible to call stack limits). + if (!(compared === undefined + ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack)) + : compared + )) { + result = false; + break; + } + skipCtor || (skipCtor = key == 'constructor'); + } + if (result && !skipCtor) { + var objCtor = object.constructor, + othCtor = other.constructor; + + // Non `Object` object instances with different constructors are not equal. + if (objCtor != othCtor && + ('constructor' in object && 'constructor' in other) && + !(typeof objCtor == 'function' && objCtor instanceof objCtor && + typeof othCtor == 'function' && othCtor instanceof othCtor)) { + result = false; + } + } + stack['delete'](object); + stack['delete'](other); + return result; + } + + /** + * A specialized version of `baseRest` which flattens the rest array. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @returns {Function} Returns the new function. + */ + function flatRest(func) { + return setToString(overRest(func, undefined, flatten), func + ''); + } + + /** + * Creates an array of own enumerable property names and symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names and symbols. + */ + function getAllKeys(object) { + return baseGetAllKeys(object, keys, getSymbols); + } + + /** + * Creates an array of own and inherited enumerable property names and + * symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names and symbols. + */ + function getAllKeysIn(object) { + return baseGetAllKeys(object, keysIn, getSymbolsIn); + } + + /** + * Gets metadata for `func`. + * + * @private + * @param {Function} func The function to query. + * @returns {*} Returns the metadata for `func`. + */ + var getData = !metaMap ? noop : function(func) { + return metaMap.get(func); + }; + + /** + * Gets the name of `func`. + * + * @private + * @param {Function} func The function to query. + * @returns {string} Returns the function name. + */ + function getFuncName(func) { + var result = (func.name + ''), + array = realNames[result], + length = hasOwnProperty.call(realNames, result) ? array.length : 0; + + while (length--) { + var data = array[length], + otherFunc = data.func; + if (otherFunc == null || otherFunc == func) { + return data.name; + } + } + return result; + } + + /** + * Gets the argument placeholder value for `func`. + * + * @private + * @param {Function} func The function to inspect. + * @returns {*} Returns the placeholder value. + */ + function getHolder(func) { + var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func; + return object.placeholder; + } + + /** + * Gets the appropriate "iteratee" function. If `_.iteratee` is customized, + * this function returns the custom method, otherwise it returns `baseIteratee`. + * If arguments are provided, the chosen function is invoked with them and + * its result is returned. + * + * @private + * @param {*} [value] The value to convert to an iteratee. + * @param {number} [arity] The arity of the created iteratee. + * @returns {Function} Returns the chosen function or its result. + */ + function getIteratee() { + var result = lodash.iteratee || iteratee; + result = result === iteratee ? baseIteratee : result; + return arguments.length ? result(arguments[0], arguments[1]) : result; + } + + /** + * Gets the data for `map`. + * + * @private + * @param {Object} map The map to query. + * @param {string} key The reference key. + * @returns {*} Returns the map data. + */ + function getMapData(map, key) { + var data = map.__data__; + return isKeyable(key) + ? data[typeof key == 'string' ? 'string' : 'hash'] + : data.map; + } + + /** + * Gets the property names, values, and compare flags of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the match data of `object`. + */ + function getMatchData(object) { + var result = keys(object), + length = result.length; + + while (length--) { + var key = result[length], + value = object[key]; + + result[length] = [key, value, isStrictComparable(value)]; + } + return result; + } + + /** + * Gets the native function at `key` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. + */ + function getNative(object, key) { + var value = getValue(object, key); + return baseIsNative(value) ? value : undefined; + } + + /** + * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the raw `toStringTag`. + */ + function getRawTag(value) { + var isOwn = hasOwnProperty.call(value, symToStringTag), + tag = value[symToStringTag]; + + try { + value[symToStringTag] = undefined; + var unmasked = true; + } catch (e) {} + + var result = nativeObjectToString.call(value); + if (unmasked) { + if (isOwn) { + value[symToStringTag] = tag; + } else { + delete value[symToStringTag]; + } + } + return result; + } + + /** + * Creates an array of the own enumerable symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of symbols. + */ + var getSymbols = !nativeGetSymbols ? stubArray : function(object) { + if (object == null) { + return []; + } + object = Object(object); + return arrayFilter(nativeGetSymbols(object), function(symbol) { + return propertyIsEnumerable.call(object, symbol); + }); + }; + + /** + * Creates an array of the own and inherited enumerable symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of symbols. + */ + var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) { + var result = []; + while (object) { + arrayPush(result, getSymbols(object)); + object = getPrototype(object); + } + return result; + }; + + /** + * Gets the `toStringTag` of `value`. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ + var getTag = baseGetTag; + + // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6. + if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || + (Map && getTag(new Map) != mapTag) || + (Promise && getTag(Promise.resolve()) != promiseTag) || + (Set && getTag(new Set) != setTag) || + (WeakMap && getTag(new WeakMap) != weakMapTag)) { + getTag = function(value) { + var result = baseGetTag(value), + Ctor = result == objectTag ? value.constructor : undefined, + ctorString = Ctor ? toSource(Ctor) : ''; + + if (ctorString) { + switch (ctorString) { + case dataViewCtorString: return dataViewTag; + case mapCtorString: return mapTag; + case promiseCtorString: return promiseTag; + case setCtorString: return setTag; + case weakMapCtorString: return weakMapTag; + } + } + return result; + }; + } + + /** + * Gets the view, applying any `transforms` to the `start` and `end` positions. + * + * @private + * @param {number} start The start of the view. + * @param {number} end The end of the view. + * @param {Array} transforms The transformations to apply to the view. + * @returns {Object} Returns an object containing the `start` and `end` + * positions of the view. + */ + function getView(start, end, transforms) { + var index = -1, + length = transforms.length; + + while (++index < length) { + var data = transforms[index], + size = data.size; + + switch (data.type) { + case 'drop': start += size; break; + case 'dropRight': end -= size; break; + case 'take': end = nativeMin(end, start + size); break; + case 'takeRight': start = nativeMax(start, end - size); break; + } + } + return { 'start': start, 'end': end }; + } + + /** + * Extracts wrapper details from the `source` body comment. + * + * @private + * @param {string} source The source to inspect. + * @returns {Array} Returns the wrapper details. + */ + function getWrapDetails(source) { + var match = source.match(reWrapDetails); + return match ? match[1].split(reSplitDetails) : []; + } + + /** + * Checks if `path` exists on `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @param {Function} hasFunc The function to check properties. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + */ + function hasPath(object, path, hasFunc) { + path = castPath(path, object); + + var index = -1, + length = path.length, + result = false; + + while (++index < length) { + var key = toKey(path[index]); + if (!(result = object != null && hasFunc(object, key))) { + break; + } + object = object[key]; + } + if (result || ++index != length) { + return result; + } + length = object == null ? 0 : object.length; + return !!length && isLength(length) && isIndex(key, length) && + (isArray(object) || isArguments(object)); + } + + /** + * Initializes an array clone. + * + * @private + * @param {Array} array The array to clone. + * @returns {Array} Returns the initialized clone. + */ + function initCloneArray(array) { + var length = array.length, + result = new array.constructor(length); + + // Add properties assigned by `RegExp#exec`. + if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { + result.index = array.index; + result.input = array.input; + } + return result; + } + + /** + * Initializes an object clone. + * + * @private + * @param {Object} object The object to clone. + * @returns {Object} Returns the initialized clone. + */ + function initCloneObject(object) { + return (typeof object.constructor == 'function' && !isPrototype(object)) + ? baseCreate(getPrototype(object)) + : {}; + } + + /** + * Initializes an object clone based on its `toStringTag`. + * + * **Note:** This function only supports cloning values with tags of + * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`. + * + * @private + * @param {Object} object The object to clone. + * @param {string} tag The `toStringTag` of the object to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the initialized clone. + */ + function initCloneByTag(object, tag, isDeep) { + var Ctor = object.constructor; + switch (tag) { + case arrayBufferTag: + return cloneArrayBuffer(object); + + case boolTag: + case dateTag: + return new Ctor(+object); + + case dataViewTag: + return cloneDataView(object, isDeep); + + case float32Tag: case float64Tag: + case int8Tag: case int16Tag: case int32Tag: + case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: + return cloneTypedArray(object, isDeep); + + case mapTag: + return new Ctor; + + case numberTag: + case stringTag: + return new Ctor(object); + + case regexpTag: + return cloneRegExp(object); + + case setTag: + return new Ctor; + + case symbolTag: + return cloneSymbol(object); + } + } + + /** + * Inserts wrapper `details` in a comment at the top of the `source` body. + * + * @private + * @param {string} source The source to modify. + * @returns {Array} details The details to insert. + * @returns {string} Returns the modified source. + */ + function insertWrapDetails(source, details) { + var length = details.length; + if (!length) { + return source; + } + var lastIndex = length - 1; + details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex]; + details = details.join(length > 2 ? ', ' : ' '); + return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n'); + } + + /** + * Checks if `value` is a flattenable `arguments` object or array. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. + */ + function isFlattenable(value) { + return isArray(value) || isArguments(value) || + !!(spreadableSymbol && value && value[spreadableSymbol]); + } + + /** + * Checks if `value` is a valid array-like index. + * + * @private + * @param {*} value The value to check. + * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. + * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + */ + function isIndex(value, length) { + var type = typeof value; + length = length == null ? MAX_SAFE_INTEGER : length; + + return !!length && + (type == 'number' || + (type != 'symbol' && reIsUint.test(value))) && + (value > -1 && value % 1 == 0 && value < length); + } + + /** + * Checks if the given arguments are from an iteratee call. + * + * @private + * @param {*} value The potential iteratee value argument. + * @param {*} index The potential iteratee index or key argument. + * @param {*} object The potential iteratee object argument. + * @returns {boolean} Returns `true` if the arguments are from an iteratee call, + * else `false`. + */ + function isIterateeCall(value, index, object) { + if (!isObject(object)) { + return false; + } + var type = typeof index; + if (type == 'number' + ? (isArrayLike(object) && isIndex(index, object.length)) + : (type == 'string' && index in object) + ) { + return eq(object[index], value); + } + return false; + } + + /** + * Checks if `value` is a property name and not a property path. + * + * @private + * @param {*} value The value to check. + * @param {Object} [object] The object to query keys on. + * @returns {boolean} Returns `true` if `value` is a property name, else `false`. + */ + function isKey(value, object) { + if (isArray(value)) { + return false; + } + var type = typeof value; + if (type == 'number' || type == 'symbol' || type == 'boolean' || + value == null || isSymbol(value)) { + return true; + } + return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || + (object != null && value in Object(object)); + } + + /** + * Checks if `value` is suitable for use as unique object key. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is suitable, else `false`. + */ + function isKeyable(value) { + var type = typeof value; + return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') + ? (value !== '__proto__') + : (value === null); + } + + /** + * Checks if `func` has a lazy counterpart. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` has a lazy counterpart, + * else `false`. + */ + function isLaziable(func) { + var funcName = getFuncName(func), + other = lodash[funcName]; + + if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) { + return false; + } + if (func === other) { + return true; + } + var data = getData(other); + return !!data && func === data[0]; + } + + /** + * Checks if `func` has its source masked. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` is masked, else `false`. + */ + function isMasked(func) { + return !!maskSrcKey && (maskSrcKey in func); + } + + /** + * Checks if `func` is capable of being masked. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `func` is maskable, else `false`. + */ + var isMaskable = coreJsData ? isFunction : stubFalse; + + /** + * Checks if `value` is likely a prototype object. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. + */ + function isPrototype(value) { + var Ctor = value && value.constructor, + proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; + + return value === proto; + } + + /** + * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` if suitable for strict + * equality comparisons, else `false`. + */ + function isStrictComparable(value) { + return value === value && !isObject(value); + } + + /** + * A specialized version of `matchesProperty` for source values suitable + * for strict equality comparisons, i.e. `===`. + * + * @private + * @param {string} key The key of the property to get. + * @param {*} srcValue The value to match. + * @returns {Function} Returns the new spec function. + */ + function matchesStrictComparable(key, srcValue) { + return function(object) { + if (object == null) { + return false; + } + return object[key] === srcValue && + (srcValue !== undefined || (key in Object(object))); + }; + } + + /** + * A specialized version of `_.memoize` which clears the memoized function's + * cache when it exceeds `MAX_MEMOIZE_SIZE`. + * + * @private + * @param {Function} func The function to have its output memoized. + * @returns {Function} Returns the new memoized function. + */ + function memoizeCapped(func) { + var result = memoize(func, function(key) { + if (cache.size === MAX_MEMOIZE_SIZE) { + cache.clear(); + } + return key; + }); + + var cache = result.cache; + return result; + } + + /** + * Merges the function metadata of `source` into `data`. + * + * Merging metadata reduces the number of wrappers used to invoke a function. + * This is possible because methods like `_.bind`, `_.curry`, and `_.partial` + * may be applied regardless of execution order. Methods like `_.ary` and + * `_.rearg` modify function arguments, making the order in which they are + * executed important, preventing the merging of metadata. However, we make + * an exception for a safe combined case where curried functions have `_.ary` + * and or `_.rearg` applied. + * + * @private + * @param {Array} data The destination metadata. + * @param {Array} source The source metadata. + * @returns {Array} Returns `data`. + */ + function mergeData(data, source) { + var bitmask = data[1], + srcBitmask = source[1], + newBitmask = bitmask | srcBitmask, + isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG); + + var isCombo = + ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) || + ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) || + ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG)); + + // Exit early if metadata can't be merged. + if (!(isCommon || isCombo)) { + return data; + } + // Use source `thisArg` if available. + if (srcBitmask & WRAP_BIND_FLAG) { + data[2] = source[2]; + // Set when currying a bound function. + newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG; + } + // Compose partial arguments. + var value = source[3]; + if (value) { + var partials = data[3]; + data[3] = partials ? composeArgs(partials, value, source[4]) : value; + data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4]; + } + // Compose partial right arguments. + value = source[5]; + if (value) { + partials = data[5]; + data[5] = partials ? composeArgsRight(partials, value, source[6]) : value; + data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6]; + } + // Use source `argPos` if available. + value = source[7]; + if (value) { + data[7] = value; + } + // Use source `ary` if it's smaller. + if (srcBitmask & WRAP_ARY_FLAG) { + data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]); + } + // Use source `arity` if one is not provided. + if (data[9] == null) { + data[9] = source[9]; + } + // Use source `func` and merge bitmasks. + data[0] = source[0]; + data[1] = newBitmask; + + return data; + } + + /** + * This function is like + * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * except that it includes inherited enumerable properties. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ + function nativeKeysIn(object) { + var result = []; + if (object != null) { + for (var key in Object(object)) { + result.push(key); + } + } + return result; + } + + /** + * Converts `value` to a string using `Object.prototype.toString`. + * + * @private + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + */ + function objectToString(value) { + return nativeObjectToString.call(value); + } + + /** + * A specialized version of `baseRest` which transforms the rest array. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @param {Function} transform The rest array transform. + * @returns {Function} Returns the new function. + */ + function overRest(func, start, transform) { + start = nativeMax(start === undefined ? (func.length - 1) : start, 0); + return function() { + var args = arguments, + index = -1, + length = nativeMax(args.length - start, 0), + array = Array(length); + + while (++index < length) { + array[index] = args[start + index]; + } + index = -1; + var otherArgs = Array(start + 1); + while (++index < start) { + otherArgs[index] = args[index]; + } + otherArgs[start] = transform(array); + return apply(func, this, otherArgs); + }; + } + + /** + * Gets the parent value at `path` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Array} path The path to get the parent value of. + * @returns {*} Returns the parent value. + */ + function parent(object, path) { + return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1)); + } + + /** + * Reorder `array` according to the specified indexes where the element at + * the first index is assigned as the first element, the element at + * the second index is assigned as the second element, and so on. + * + * @private + * @param {Array} array The array to reorder. + * @param {Array} indexes The arranged array indexes. + * @returns {Array} Returns `array`. + */ + function reorder(array, indexes) { + var arrLength = array.length, + length = nativeMin(indexes.length, arrLength), + oldArray = copyArray(array); + + while (length--) { + var index = indexes[length]; + array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined; + } + return array; + } + + /** + * Gets the value at `key`, unless `key` is "__proto__" or "constructor". + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ + function safeGet(object, key) { + if (key === 'constructor' && typeof object[key] === 'function') { + return; + } + + if (key == '__proto__') { + return; + } + + return object[key]; + } + + /** + * Sets metadata for `func`. + * + * **Note:** If this function becomes hot, i.e. is invoked a lot in a short + * period of time, it will trip its breaker and transition to an identity + * function to avoid garbage collection pauses in V8. See + * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070) + * for more details. + * + * @private + * @param {Function} func The function to associate metadata with. + * @param {*} data The metadata. + * @returns {Function} Returns `func`. + */ + var setData = shortOut(baseSetData); + + /** + * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout). + * + * @private + * @param {Function} func The function to delay. + * @param {number} wait The number of milliseconds to delay invocation. + * @returns {number|Object} Returns the timer id or timeout object. + */ + var setTimeout = ctxSetTimeout || function(func, wait) { + return root.setTimeout(func, wait); + }; + + /** + * Sets the `toString` method of `func` to return `string`. + * + * @private + * @param {Function} func The function to modify. + * @param {Function} string The `toString` result. + * @returns {Function} Returns `func`. + */ + var setToString = shortOut(baseSetToString); + + /** + * Sets the `toString` method of `wrapper` to mimic the source of `reference` + * with wrapper details in a comment at the top of the source body. + * + * @private + * @param {Function} wrapper The function to modify. + * @param {Function} reference The reference function. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @returns {Function} Returns `wrapper`. + */ + function setWrapToString(wrapper, reference, bitmask) { + var source = (reference + ''); + return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask))); + } + + /** + * Creates a function that'll short out and invoke `identity` instead + * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN` + * milliseconds. + * + * @private + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new shortable function. + */ + function shortOut(func) { + var count = 0, + lastCalled = 0; + + return function() { + var stamp = nativeNow(), + remaining = HOT_SPAN - (stamp - lastCalled); + + lastCalled = stamp; + if (remaining > 0) { + if (++count >= HOT_COUNT) { + return arguments[0]; + } + } else { + count = 0; + } + return func.apply(undefined, arguments); + }; + } + + /** + * A specialized version of `_.shuffle` which mutates and sets the size of `array`. + * + * @private + * @param {Array} array The array to shuffle. + * @param {number} [size=array.length] The size of `array`. + * @returns {Array} Returns `array`. + */ + function shuffleSelf(array, size) { + var index = -1, + length = array.length, + lastIndex = length - 1; + + size = size === undefined ? length : size; + while (++index < size) { + var rand = baseRandom(index, lastIndex), + value = array[rand]; + + array[rand] = array[index]; + array[index] = value; + } + array.length = size; + return array; + } + + /** + * Converts `string` to a property path array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the property path array. + */ + var stringToPath = memoizeCapped(function(string) { + var result = []; + if (string.charCodeAt(0) === 46 /* . */) { + result.push(''); + } + string.replace(rePropName, function(match, number, quote, subString) { + result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match)); + }); + return result; + }); + + /** + * Converts `value` to a string key if it's not a string or symbol. + * + * @private + * @param {*} value The value to inspect. + * @returns {string|symbol} Returns the key. + */ + function toKey(value) { + if (typeof value == 'string' || isSymbol(value)) { + return value; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; + } + + /** + * Converts `func` to its source code. + * + * @private + * @param {Function} func The function to convert. + * @returns {string} Returns the source code. + */ + function toSource(func) { + if (func != null) { + try { + return funcToString.call(func); + } catch (e) {} + try { + return (func + ''); + } catch (e) {} + } + return ''; + } + + /** + * Updates wrapper `details` based on `bitmask` flags. + * + * @private + * @returns {Array} details The details to modify. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @returns {Array} Returns `details`. + */ + function updateWrapDetails(details, bitmask) { + arrayEach(wrapFlags, function(pair) { + var value = '_.' + pair[0]; + if ((bitmask & pair[1]) && !arrayIncludes(details, value)) { + details.push(value); + } + }); + return details.sort(); + } + + /** + * Creates a clone of `wrapper`. + * + * @private + * @param {Object} wrapper The wrapper to clone. + * @returns {Object} Returns the cloned wrapper. + */ + function wrapperClone(wrapper) { + if (wrapper instanceof LazyWrapper) { + return wrapper.clone(); + } + var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__); + result.__actions__ = copyArray(wrapper.__actions__); + result.__index__ = wrapper.__index__; + result.__values__ = wrapper.__values__; + return result; + } + + /*------------------------------------------------------------------------*/ + + /** + * Creates an array of elements split into groups the length of `size`. + * If `array` can't be split evenly, the final chunk will be the remaining + * elements. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to process. + * @param {number} [size=1] The length of each chunk + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the new array of chunks. + * @example + * + * _.chunk(['a', 'b', 'c', 'd'], 2); + * // => [['a', 'b'], ['c', 'd']] + * + * _.chunk(['a', 'b', 'c', 'd'], 3); + * // => [['a', 'b', 'c'], ['d']] + */ + function chunk(array, size, guard) { + if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) { + size = 1; + } else { + size = nativeMax(toInteger(size), 0); + } + var length = array == null ? 0 : array.length; + if (!length || size < 1) { + return []; + } + var index = 0, + resIndex = 0, + result = Array(nativeCeil(length / size)); + + while (index < length) { + result[resIndex++] = baseSlice(array, index, (index += size)); + } + return result; + } + + /** + * Creates an array with all falsey values removed. The values `false`, `null`, + * `0`, `""`, `undefined`, and `NaN` are falsey. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to compact. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * _.compact([0, 1, false, 2, '', 3]); + * // => [1, 2, 3] + */ + function compact(array) { + var index = -1, + length = array == null ? 0 : array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (value) { + result[resIndex++] = value; + } + } + return result; + } + + /** + * Creates a new array concatenating `array` with any additional arrays + * and/or values. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to concatenate. + * @param {...*} [values] The values to concatenate. + * @returns {Array} Returns the new concatenated array. + * @example + * + * var array = [1]; + * var other = _.concat(array, 2, [3], [[4]]); + * + * console.log(other); + * // => [1, 2, 3, [4]] + * + * console.log(array); + * // => [1] + */ + function concat() { + var length = arguments.length; + if (!length) { + return []; + } + var args = Array(length - 1), + array = arguments[0], + index = length; + + while (index--) { + args[index - 1] = arguments[index]; + } + return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1)); + } + + /** + * Creates an array of `array` values not included in the other given arrays + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. The order and references of result values are + * determined by the first array. + * + * **Note:** Unlike `_.pullAll`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {...Array} [values] The values to exclude. + * @returns {Array} Returns the new array of filtered values. + * @see _.without, _.xor + * @example + * + * _.difference([2, 1], [2, 3]); + * // => [1] + */ + var difference = baseRest(function(array, values) { + return isArrayLikeObject(array) + ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true)) + : []; + }); + + /** + * This method is like `_.difference` except that it accepts `iteratee` which + * is invoked for each element of `array` and `values` to generate the criterion + * by which they're compared. The order and references of result values are + * determined by the first array. The iteratee is invoked with one argument: + * (value). + * + * **Note:** Unlike `_.pullAllBy`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {...Array} [values] The values to exclude. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor); + * // => [1.2] + * + * // The `_.property` iteratee shorthand. + * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x'); + * // => [{ 'x': 2 }] + */ + var differenceBy = baseRest(function(array, values) { + var iteratee = last(values); + if (isArrayLikeObject(iteratee)) { + iteratee = undefined; + } + return isArrayLikeObject(array) + ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2)) + : []; + }); + + /** + * This method is like `_.difference` except that it accepts `comparator` + * which is invoked to compare elements of `array` to `values`. The order and + * references of result values are determined by the first array. The comparator + * is invoked with two arguments: (arrVal, othVal). + * + * **Note:** Unlike `_.pullAllWith`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {...Array} [values] The values to exclude. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * + * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual); + * // => [{ 'x': 2, 'y': 1 }] + */ + var differenceWith = baseRest(function(array, values) { + var comparator = last(values); + if (isArrayLikeObject(comparator)) { + comparator = undefined; + } + return isArrayLikeObject(array) + ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator) + : []; + }); + + /** + * Creates a slice of `array` with `n` elements dropped from the beginning. + * + * @static + * @memberOf _ + * @since 0.5.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to drop. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.drop([1, 2, 3]); + * // => [2, 3] + * + * _.drop([1, 2, 3], 2); + * // => [3] + * + * _.drop([1, 2, 3], 5); + * // => [] + * + * _.drop([1, 2, 3], 0); + * // => [1, 2, 3] + */ + function drop(array, n, guard) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + n = (guard || n === undefined) ? 1 : toInteger(n); + return baseSlice(array, n < 0 ? 0 : n, length); + } + + /** + * Creates a slice of `array` with `n` elements dropped from the end. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to drop. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.dropRight([1, 2, 3]); + * // => [1, 2] + * + * _.dropRight([1, 2, 3], 2); + * // => [1] + * + * _.dropRight([1, 2, 3], 5); + * // => [] + * + * _.dropRight([1, 2, 3], 0); + * // => [1, 2, 3] + */ + function dropRight(array, n, guard) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + n = (guard || n === undefined) ? 1 : toInteger(n); + n = length - n; + return baseSlice(array, 0, n < 0 ? 0 : n); + } + + /** + * Creates a slice of `array` excluding elements dropped from the end. + * Elements are dropped until `predicate` returns falsey. The predicate is + * invoked with three arguments: (value, index, array). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the slice of `array`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': false } + * ]; + * + * _.dropRightWhile(users, function(o) { return !o.active; }); + * // => objects for ['barney'] + * + * // The `_.matches` iteratee shorthand. + * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false }); + * // => objects for ['barney', 'fred'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.dropRightWhile(users, ['active', false]); + * // => objects for ['barney'] + * + * // The `_.property` iteratee shorthand. + * _.dropRightWhile(users, 'active'); + * // => objects for ['barney', 'fred', 'pebbles'] + */ + function dropRightWhile(array, predicate) { + return (array && array.length) + ? baseWhile(array, getIteratee(predicate, 3), true, true) + : []; + } + + /** + * Creates a slice of `array` excluding elements dropped from the beginning. + * Elements are dropped until `predicate` returns falsey. The predicate is + * invoked with three arguments: (value, index, array). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the slice of `array`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': false }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': true } + * ]; + * + * _.dropWhile(users, function(o) { return !o.active; }); + * // => objects for ['pebbles'] + * + * // The `_.matches` iteratee shorthand. + * _.dropWhile(users, { 'user': 'barney', 'active': false }); + * // => objects for ['fred', 'pebbles'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.dropWhile(users, ['active', false]); + * // => objects for ['pebbles'] + * + * // The `_.property` iteratee shorthand. + * _.dropWhile(users, 'active'); + * // => objects for ['barney', 'fred', 'pebbles'] + */ + function dropWhile(array, predicate) { + return (array && array.length) + ? baseWhile(array, getIteratee(predicate, 3), true) + : []; + } + + /** + * Fills elements of `array` with `value` from `start` up to, but not + * including, `end`. + * + * **Note:** This method mutates `array`. + * + * @static + * @memberOf _ + * @since 3.2.0 + * @category Array + * @param {Array} array The array to fill. + * @param {*} value The value to fill `array` with. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns `array`. + * @example + * + * var array = [1, 2, 3]; + * + * _.fill(array, 'a'); + * console.log(array); + * // => ['a', 'a', 'a'] + * + * _.fill(Array(3), 2); + * // => [2, 2, 2] + * + * _.fill([4, 6, 8, 10], '*', 1, 3); + * // => [4, '*', '*', 10] + */ + function fill(array, value, start, end) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + if (start && typeof start != 'number' && isIterateeCall(array, value, start)) { + start = 0; + end = length; + } + return baseFill(array, value, start, end); + } + + /** + * This method is like `_.find` except that it returns the index of the first + * element `predicate` returns truthy for instead of the element itself. + * + * @static + * @memberOf _ + * @since 1.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=0] The index to search from. + * @returns {number} Returns the index of the found element, else `-1`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': false }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': true } + * ]; + * + * _.findIndex(users, function(o) { return o.user == 'barney'; }); + * // => 0 + * + * // The `_.matches` iteratee shorthand. + * _.findIndex(users, { 'user': 'fred', 'active': false }); + * // => 1 + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findIndex(users, ['active', false]); + * // => 0 + * + * // The `_.property` iteratee shorthand. + * _.findIndex(users, 'active'); + * // => 2 + */ + function findIndex(array, predicate, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index = fromIndex == null ? 0 : toInteger(fromIndex); + if (index < 0) { + index = nativeMax(length + index, 0); + } + return baseFindIndex(array, getIteratee(predicate, 3), index); + } + + /** + * This method is like `_.findIndex` except that it iterates over elements + * of `collection` from right to left. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=array.length-1] The index to search from. + * @returns {number} Returns the index of the found element, else `-1`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': false } + * ]; + * + * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; }); + * // => 2 + * + * // The `_.matches` iteratee shorthand. + * _.findLastIndex(users, { 'user': 'barney', 'active': true }); + * // => 0 + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findLastIndex(users, ['active', false]); + * // => 2 + * + * // The `_.property` iteratee shorthand. + * _.findLastIndex(users, 'active'); + * // => 0 + */ + function findLastIndex(array, predicate, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index = length - 1; + if (fromIndex !== undefined) { + index = toInteger(fromIndex); + index = fromIndex < 0 + ? nativeMax(length + index, 0) + : nativeMin(index, length - 1); + } + return baseFindIndex(array, getIteratee(predicate, 3), index, true); + } + + /** + * Flattens `array` a single level deep. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to flatten. + * @returns {Array} Returns the new flattened array. + * @example + * + * _.flatten([1, [2, [3, [4]], 5]]); + * // => [1, 2, [3, [4]], 5] + */ + function flatten(array) { + var length = array == null ? 0 : array.length; + return length ? baseFlatten(array, 1) : []; + } + + /** + * Recursively flattens `array`. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to flatten. + * @returns {Array} Returns the new flattened array. + * @example + * + * _.flattenDeep([1, [2, [3, [4]], 5]]); + * // => [1, 2, 3, 4, 5] + */ + function flattenDeep(array) { + var length = array == null ? 0 : array.length; + return length ? baseFlatten(array, INFINITY) : []; + } + + /** + * Recursively flatten `array` up to `depth` times. + * + * @static + * @memberOf _ + * @since 4.4.0 + * @category Array + * @param {Array} array The array to flatten. + * @param {number} [depth=1] The maximum recursion depth. + * @returns {Array} Returns the new flattened array. + * @example + * + * var array = [1, [2, [3, [4]], 5]]; + * + * _.flattenDepth(array, 1); + * // => [1, 2, [3, [4]], 5] + * + * _.flattenDepth(array, 2); + * // => [1, 2, 3, [4], 5] + */ + function flattenDepth(array, depth) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + depth = depth === undefined ? 1 : toInteger(depth); + return baseFlatten(array, depth); + } + + /** + * The inverse of `_.toPairs`; this method returns an object composed + * from key-value `pairs`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} pairs The key-value pairs. + * @returns {Object} Returns the new object. + * @example + * + * _.fromPairs([['a', 1], ['b', 2]]); + * // => { 'a': 1, 'b': 2 } + */ + function fromPairs(pairs) { + var index = -1, + length = pairs == null ? 0 : pairs.length, + result = {}; + + while (++index < length) { + var pair = pairs[index]; + result[pair[0]] = pair[1]; + } + return result; + } + + /** + * Gets the first element of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @alias first + * @category Array + * @param {Array} array The array to query. + * @returns {*} Returns the first element of `array`. + * @example + * + * _.head([1, 2, 3]); + * // => 1 + * + * _.head([]); + * // => undefined + */ + function head(array) { + return (array && array.length) ? array[0] : undefined; + } + + /** + * Gets the index at which the first occurrence of `value` is found in `array` + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. If `fromIndex` is negative, it's used as the + * offset from the end of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} [fromIndex=0] The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.indexOf([1, 2, 1, 2], 2); + * // => 1 + * + * // Search from the `fromIndex`. + * _.indexOf([1, 2, 1, 2], 2, 2); + * // => 3 + */ + function indexOf(array, value, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index = fromIndex == null ? 0 : toInteger(fromIndex); + if (index < 0) { + index = nativeMax(length + index, 0); + } + return baseIndexOf(array, value, index); + } + + /** + * Gets all but the last element of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to query. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.initial([1, 2, 3]); + * // => [1, 2] + */ + function initial(array) { + var length = array == null ? 0 : array.length; + return length ? baseSlice(array, 0, -1) : []; + } + + /** + * Creates an array of unique values that are included in all given arrays + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. The order and references of result values are + * determined by the first array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @returns {Array} Returns the new array of intersecting values. + * @example + * + * _.intersection([2, 1], [2, 3]); + * // => [2] + */ + var intersection = baseRest(function(arrays) { + var mapped = arrayMap(arrays, castArrayLikeObject); + return (mapped.length && mapped[0] === arrays[0]) + ? baseIntersection(mapped) + : []; + }); + + /** + * This method is like `_.intersection` except that it accepts `iteratee` + * which is invoked for each element of each `arrays` to generate the criterion + * by which they're compared. The order and references of result values are + * determined by the first array. The iteratee is invoked with one argument: + * (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new array of intersecting values. + * @example + * + * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor); + * // => [2.1] + * + * // The `_.property` iteratee shorthand. + * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 1 }] + */ + var intersectionBy = baseRest(function(arrays) { + var iteratee = last(arrays), + mapped = arrayMap(arrays, castArrayLikeObject); + + if (iteratee === last(mapped)) { + iteratee = undefined; + } else { + mapped.pop(); + } + return (mapped.length && mapped[0] === arrays[0]) + ? baseIntersection(mapped, getIteratee(iteratee, 2)) + : []; + }); + + /** + * This method is like `_.intersection` except that it accepts `comparator` + * which is invoked to compare elements of `arrays`. The order and references + * of result values are determined by the first array. The comparator is + * invoked with two arguments: (arrVal, othVal). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of intersecting values. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * + * _.intersectionWith(objects, others, _.isEqual); + * // => [{ 'x': 1, 'y': 2 }] + */ + var intersectionWith = baseRest(function(arrays) { + var comparator = last(arrays), + mapped = arrayMap(arrays, castArrayLikeObject); + + comparator = typeof comparator == 'function' ? comparator : undefined; + if (comparator) { + mapped.pop(); + } + return (mapped.length && mapped[0] === arrays[0]) + ? baseIntersection(mapped, undefined, comparator) + : []; + }); + + /** + * Converts all elements in `array` into a string separated by `separator`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to convert. + * @param {string} [separator=','] The element separator. + * @returns {string} Returns the joined string. + * @example + * + * _.join(['a', 'b', 'c'], '~'); + * // => 'a~b~c' + */ + function join(array, separator) { + return array == null ? '' : nativeJoin.call(array, separator); + } + + /** + * Gets the last element of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to query. + * @returns {*} Returns the last element of `array`. + * @example + * + * _.last([1, 2, 3]); + * // => 3 + */ + function last(array) { + var length = array == null ? 0 : array.length; + return length ? array[length - 1] : undefined; + } + + /** + * This method is like `_.indexOf` except that it iterates over elements of + * `array` from right to left. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} [fromIndex=array.length-1] The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.lastIndexOf([1, 2, 1, 2], 2); + * // => 3 + * + * // Search from the `fromIndex`. + * _.lastIndexOf([1, 2, 1, 2], 2, 2); + * // => 1 + */ + function lastIndexOf(array, value, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index = length; + if (fromIndex !== undefined) { + index = toInteger(fromIndex); + index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1); + } + return value === value + ? strictLastIndexOf(array, value, index) + : baseFindIndex(array, baseIsNaN, index, true); + } + + /** + * Gets the element at index `n` of `array`. If `n` is negative, the nth + * element from the end is returned. + * + * @static + * @memberOf _ + * @since 4.11.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=0] The index of the element to return. + * @returns {*} Returns the nth element of `array`. + * @example + * + * var array = ['a', 'b', 'c', 'd']; + * + * _.nth(array, 1); + * // => 'b' + * + * _.nth(array, -2); + * // => 'c'; + */ + function nth(array, n) { + return (array && array.length) ? baseNth(array, toInteger(n)) : undefined; + } + + /** + * Removes all given values from `array` using + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove` + * to remove elements from an array by predicate. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Array + * @param {Array} array The array to modify. + * @param {...*} [values] The values to remove. + * @returns {Array} Returns `array`. + * @example + * + * var array = ['a', 'b', 'c', 'a', 'b', 'c']; + * + * _.pull(array, 'a', 'c'); + * console.log(array); + * // => ['b', 'b'] + */ + var pull = baseRest(pullAll); + + /** + * This method is like `_.pull` except that it accepts an array of values to remove. + * + * **Note:** Unlike `_.difference`, this method mutates `array`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to modify. + * @param {Array} values The values to remove. + * @returns {Array} Returns `array`. + * @example + * + * var array = ['a', 'b', 'c', 'a', 'b', 'c']; + * + * _.pullAll(array, ['a', 'c']); + * console.log(array); + * // => ['b', 'b'] + */ + function pullAll(array, values) { + return (array && array.length && values && values.length) + ? basePullAll(array, values) + : array; + } + + /** + * This method is like `_.pullAll` except that it accepts `iteratee` which is + * invoked for each element of `array` and `values` to generate the criterion + * by which they're compared. The iteratee is invoked with one argument: (value). + * + * **Note:** Unlike `_.differenceBy`, this method mutates `array`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to modify. + * @param {Array} values The values to remove. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns `array`. + * @example + * + * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; + * + * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); + * console.log(array); + * // => [{ 'x': 2 }] + */ + function pullAllBy(array, values, iteratee) { + return (array && array.length && values && values.length) + ? basePullAll(array, values, getIteratee(iteratee, 2)) + : array; + } + + /** + * This method is like `_.pullAll` except that it accepts `comparator` which + * is invoked to compare elements of `array` to `values`. The comparator is + * invoked with two arguments: (arrVal, othVal). + * + * **Note:** Unlike `_.differenceWith`, this method mutates `array`. + * + * @static + * @memberOf _ + * @since 4.6.0 + * @category Array + * @param {Array} array The array to modify. + * @param {Array} values The values to remove. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns `array`. + * @example + * + * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; + * + * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); + * console.log(array); + * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] + */ + function pullAllWith(array, values, comparator) { + return (array && array.length && values && values.length) + ? basePullAll(array, values, undefined, comparator) + : array; + } + + /** + * Removes elements from `array` corresponding to `indexes` and returns an + * array of removed elements. + * + * **Note:** Unlike `_.at`, this method mutates `array`. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to modify. + * @param {...(number|number[])} [indexes] The indexes of elements to remove. + * @returns {Array} Returns the new array of removed elements. + * @example + * + * var array = ['a', 'b', 'c', 'd']; + * var pulled = _.pullAt(array, [1, 3]); + * + * console.log(array); + * // => ['a', 'c'] + * + * console.log(pulled); + * // => ['b', 'd'] + */ + var pullAt = flatRest(function(array, indexes) { + var length = array == null ? 0 : array.length, + result = baseAt(array, indexes); + + basePullAt(array, arrayMap(indexes, function(index) { + return isIndex(index, length) ? +index : index; + }).sort(compareAscending)); + + return result; + }); + + /** + * Removes all elements from `array` that `predicate` returns truthy for + * and returns an array of the removed elements. The predicate is invoked + * with three arguments: (value, index, array). + * + * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull` + * to pull elements from an array by value. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Array + * @param {Array} array The array to modify. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new array of removed elements. + * @example + * + * var array = [1, 2, 3, 4]; + * var evens = _.remove(array, function(n) { + * return n % 2 == 0; + * }); + * + * console.log(array); + * // => [1, 3] + * + * console.log(evens); + * // => [2, 4] + */ + function remove(array, predicate) { + var result = []; + if (!(array && array.length)) { + return result; + } + var index = -1, + indexes = [], + length = array.length; + + predicate = getIteratee(predicate, 3); + while (++index < length) { + var value = array[index]; + if (predicate(value, index, array)) { + result.push(value); + indexes.push(index); + } + } + basePullAt(array, indexes); + return result; + } + + /** + * Reverses `array` so that the first element becomes the last, the second + * element becomes the second to last, and so on. + * + * **Note:** This method mutates `array` and is based on + * [`Array#reverse`](https://mdn.io/Array/reverse). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to modify. + * @returns {Array} Returns `array`. + * @example + * + * var array = [1, 2, 3]; + * + * _.reverse(array); + * // => [3, 2, 1] + * + * console.log(array); + * // => [3, 2, 1] + */ + function reverse(array) { + return array == null ? array : nativeReverse.call(array); + } + + /** + * Creates a slice of `array` from `start` up to, but not including, `end`. + * + * **Note:** This method is used instead of + * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are + * returned. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to slice. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the slice of `array`. + */ + function slice(array, start, end) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + if (end && typeof end != 'number' && isIterateeCall(array, start, end)) { + start = 0; + end = length; + } + else { + start = start == null ? 0 : toInteger(start); + end = end === undefined ? length : toInteger(end); + } + return baseSlice(array, start, end); + } + + /** + * Uses a binary search to determine the lowest index at which `value` + * should be inserted into `array` in order to maintain its sort order. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + * @example + * + * _.sortedIndex([30, 50], 40); + * // => 1 + */ + function sortedIndex(array, value) { + return baseSortedIndex(array, value); + } + + /** + * This method is like `_.sortedIndex` except that it accepts `iteratee` + * which is invoked for `value` and each element of `array` to compute their + * sort ranking. The iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + * @example + * + * var objects = [{ 'x': 4 }, { 'x': 5 }]; + * + * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; }); + * // => 0 + * + * // The `_.property` iteratee shorthand. + * _.sortedIndexBy(objects, { 'x': 4 }, 'x'); + * // => 0 + */ + function sortedIndexBy(array, value, iteratee) { + return baseSortedIndexBy(array, value, getIteratee(iteratee, 2)); + } + + /** + * This method is like `_.indexOf` except that it performs a binary + * search on a sorted `array`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.sortedIndexOf([4, 5, 5, 5, 6], 5); + * // => 1 + */ + function sortedIndexOf(array, value) { + var length = array == null ? 0 : array.length; + if (length) { + var index = baseSortedIndex(array, value); + if (index < length && eq(array[index], value)) { + return index; + } + } + return -1; + } + + /** + * This method is like `_.sortedIndex` except that it returns the highest + * index at which `value` should be inserted into `array` in order to + * maintain its sort order. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + * @example + * + * _.sortedLastIndex([4, 5, 5, 5, 6], 5); + * // => 4 + */ + function sortedLastIndex(array, value) { + return baseSortedIndex(array, value, true); + } + + /** + * This method is like `_.sortedLastIndex` except that it accepts `iteratee` + * which is invoked for `value` and each element of `array` to compute their + * sort ranking. The iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + * @example + * + * var objects = [{ 'x': 4 }, { 'x': 5 }]; + * + * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; }); + * // => 1 + * + * // The `_.property` iteratee shorthand. + * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x'); + * // => 1 + */ + function sortedLastIndexBy(array, value, iteratee) { + return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true); + } + + /** + * This method is like `_.lastIndexOf` except that it performs a binary + * search on a sorted `array`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5); + * // => 3 + */ + function sortedLastIndexOf(array, value) { + var length = array == null ? 0 : array.length; + if (length) { + var index = baseSortedIndex(array, value, true) - 1; + if (eq(array[index], value)) { + return index; + } + } + return -1; + } + + /** + * This method is like `_.uniq` except that it's designed and optimized + * for sorted arrays. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * _.sortedUniq([1, 1, 2]); + * // => [1, 2] + */ + function sortedUniq(array) { + return (array && array.length) + ? baseSortedUniq(array) + : []; + } + + /** + * This method is like `_.uniqBy` except that it's designed and optimized + * for sorted arrays. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor); + * // => [1.1, 2.3] + */ + function sortedUniqBy(array, iteratee) { + return (array && array.length) + ? baseSortedUniq(array, getIteratee(iteratee, 2)) + : []; + } + + /** + * Gets all but the first element of `array`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to query. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.tail([1, 2, 3]); + * // => [2, 3] + */ + function tail(array) { + var length = array == null ? 0 : array.length; + return length ? baseSlice(array, 1, length) : []; + } + + /** + * Creates a slice of `array` with `n` elements taken from the beginning. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to take. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.take([1, 2, 3]); + * // => [1] + * + * _.take([1, 2, 3], 2); + * // => [1, 2] + * + * _.take([1, 2, 3], 5); + * // => [1, 2, 3] + * + * _.take([1, 2, 3], 0); + * // => [] + */ + function take(array, n, guard) { + if (!(array && array.length)) { + return []; + } + n = (guard || n === undefined) ? 1 : toInteger(n); + return baseSlice(array, 0, n < 0 ? 0 : n); + } + + /** + * Creates a slice of `array` with `n` elements taken from the end. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to take. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.takeRight([1, 2, 3]); + * // => [3] + * + * _.takeRight([1, 2, 3], 2); + * // => [2, 3] + * + * _.takeRight([1, 2, 3], 5); + * // => [1, 2, 3] + * + * _.takeRight([1, 2, 3], 0); + * // => [] + */ + function takeRight(array, n, guard) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + n = (guard || n === undefined) ? 1 : toInteger(n); + n = length - n; + return baseSlice(array, n < 0 ? 0 : n, length); + } + + /** + * Creates a slice of `array` with elements taken from the end. Elements are + * taken until `predicate` returns falsey. The predicate is invoked with + * three arguments: (value, index, array). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the slice of `array`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': false } + * ]; + * + * _.takeRightWhile(users, function(o) { return !o.active; }); + * // => objects for ['fred', 'pebbles'] + * + * // The `_.matches` iteratee shorthand. + * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false }); + * // => objects for ['pebbles'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.takeRightWhile(users, ['active', false]); + * // => objects for ['fred', 'pebbles'] + * + * // The `_.property` iteratee shorthand. + * _.takeRightWhile(users, 'active'); + * // => [] + */ + function takeRightWhile(array, predicate) { + return (array && array.length) + ? baseWhile(array, getIteratee(predicate, 3), false, true) + : []; + } + + /** + * Creates a slice of `array` with elements taken from the beginning. Elements + * are taken until `predicate` returns falsey. The predicate is invoked with + * three arguments: (value, index, array). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the slice of `array`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': false }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': true } + * ]; + * + * _.takeWhile(users, function(o) { return !o.active; }); + * // => objects for ['barney', 'fred'] + * + * // The `_.matches` iteratee shorthand. + * _.takeWhile(users, { 'user': 'barney', 'active': false }); + * // => objects for ['barney'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.takeWhile(users, ['active', false]); + * // => objects for ['barney', 'fred'] + * + * // The `_.property` iteratee shorthand. + * _.takeWhile(users, 'active'); + * // => [] + */ + function takeWhile(array, predicate) { + return (array && array.length) + ? baseWhile(array, getIteratee(predicate, 3)) + : []; + } + + /** + * Creates an array of unique values, in order, from all given arrays using + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @returns {Array} Returns the new array of combined values. + * @example + * + * _.union([2], [1, 2]); + * // => [2, 1] + */ + var union = baseRest(function(arrays) { + return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true)); + }); + + /** + * This method is like `_.union` except that it accepts `iteratee` which is + * invoked for each element of each `arrays` to generate the criterion by + * which uniqueness is computed. Result values are chosen from the first + * array in which the value occurs. The iteratee is invoked with one argument: + * (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new array of combined values. + * @example + * + * _.unionBy([2.1], [1.2, 2.3], Math.floor); + * // => [2.1, 1.2] + * + * // The `_.property` iteratee shorthand. + * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 1 }, { 'x': 2 }] + */ + var unionBy = baseRest(function(arrays) { + var iteratee = last(arrays); + if (isArrayLikeObject(iteratee)) { + iteratee = undefined; + } + return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2)); + }); + + /** + * This method is like `_.union` except that it accepts `comparator` which + * is invoked to compare elements of `arrays`. Result values are chosen from + * the first array in which the value occurs. The comparator is invoked + * with two arguments: (arrVal, othVal). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of combined values. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * + * _.unionWith(objects, others, _.isEqual); + * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] + */ + var unionWith = baseRest(function(arrays) { + var comparator = last(arrays); + comparator = typeof comparator == 'function' ? comparator : undefined; + return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator); + }); + + /** + * Creates a duplicate-free version of an array, using + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons, in which only the first occurrence of each element + * is kept. The order of result values is determined by the order they occur + * in the array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * _.uniq([2, 1, 2]); + * // => [2, 1] + */ + function uniq(array) { + return (array && array.length) ? baseUniq(array) : []; + } + + /** + * This method is like `_.uniq` except that it accepts `iteratee` which is + * invoked for each element in `array` to generate the criterion by which + * uniqueness is computed. The order of result values is determined by the + * order they occur in the array. The iteratee is invoked with one argument: + * (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * _.uniqBy([2.1, 1.2, 2.3], Math.floor); + * // => [2.1, 1.2] + * + * // The `_.property` iteratee shorthand. + * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 1 }, { 'x': 2 }] + */ + function uniqBy(array, iteratee) { + return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : []; + } + + /** + * This method is like `_.uniq` except that it accepts `comparator` which + * is invoked to compare elements of `array`. The order of result values is + * determined by the order they occur in the array.The comparator is invoked + * with two arguments: (arrVal, othVal). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * + * _.uniqWith(objects, _.isEqual); + * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }] + */ + function uniqWith(array, comparator) { + comparator = typeof comparator == 'function' ? comparator : undefined; + return (array && array.length) ? baseUniq(array, undefined, comparator) : []; + } + + /** + * This method is like `_.zip` except that it accepts an array of grouped + * elements and creates an array regrouping the elements to their pre-zip + * configuration. + * + * @static + * @memberOf _ + * @since 1.2.0 + * @category Array + * @param {Array} array The array of grouped elements to process. + * @returns {Array} Returns the new array of regrouped elements. + * @example + * + * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]); + * // => [['a', 1, true], ['b', 2, false]] + * + * _.unzip(zipped); + * // => [['a', 'b'], [1, 2], [true, false]] + */ + function unzip(array) { + if (!(array && array.length)) { + return []; + } + var length = 0; + array = arrayFilter(array, function(group) { + if (isArrayLikeObject(group)) { + length = nativeMax(group.length, length); + return true; + } + }); + return baseTimes(length, function(index) { + return arrayMap(array, baseProperty(index)); + }); + } + + /** + * This method is like `_.unzip` except that it accepts `iteratee` to specify + * how regrouped values should be combined. The iteratee is invoked with the + * elements of each group: (...group). + * + * @static + * @memberOf _ + * @since 3.8.0 + * @category Array + * @param {Array} array The array of grouped elements to process. + * @param {Function} [iteratee=_.identity] The function to combine + * regrouped values. + * @returns {Array} Returns the new array of regrouped elements. + * @example + * + * var zipped = _.zip([1, 2], [10, 20], [100, 200]); + * // => [[1, 10, 100], [2, 20, 200]] + * + * _.unzipWith(zipped, _.add); + * // => [3, 30, 300] + */ + function unzipWith(array, iteratee) { + if (!(array && array.length)) { + return []; + } + var result = unzip(array); + if (iteratee == null) { + return result; + } + return arrayMap(result, function(group) { + return apply(iteratee, undefined, group); + }); + } + + /** + * Creates an array excluding all given values using + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * **Note:** Unlike `_.pull`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {...*} [values] The values to exclude. + * @returns {Array} Returns the new array of filtered values. + * @see _.difference, _.xor + * @example + * + * _.without([2, 1, 2, 3], 1, 2); + * // => [3] + */ + var without = baseRest(function(array, values) { + return isArrayLikeObject(array) + ? baseDifference(array, values) + : []; + }); + + /** + * Creates an array of unique values that is the + * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference) + * of the given arrays. The order of result values is determined by the order + * they occur in the arrays. + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @returns {Array} Returns the new array of filtered values. + * @see _.difference, _.without + * @example + * + * _.xor([2, 1], [2, 3]); + * // => [1, 3] + */ + var xor = baseRest(function(arrays) { + return baseXor(arrayFilter(arrays, isArrayLikeObject)); + }); + + /** + * This method is like `_.xor` except that it accepts `iteratee` which is + * invoked for each element of each `arrays` to generate the criterion by + * which by which they're compared. The order of result values is determined + * by the order they occur in the arrays. The iteratee is invoked with one + * argument: (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor); + * // => [1.2, 3.4] + * + * // The `_.property` iteratee shorthand. + * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 2 }] + */ + var xorBy = baseRest(function(arrays) { + var iteratee = last(arrays); + if (isArrayLikeObject(iteratee)) { + iteratee = undefined; + } + return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2)); + }); + + /** + * This method is like `_.xor` except that it accepts `comparator` which is + * invoked to compare elements of `arrays`. The order of result values is + * determined by the order they occur in the arrays. The comparator is invoked + * with two arguments: (arrVal, othVal). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * + * _.xorWith(objects, others, _.isEqual); + * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] + */ + var xorWith = baseRest(function(arrays) { + var comparator = last(arrays); + comparator = typeof comparator == 'function' ? comparator : undefined; + return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator); + }); + + /** + * Creates an array of grouped elements, the first of which contains the + * first elements of the given arrays, the second of which contains the + * second elements of the given arrays, and so on. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {...Array} [arrays] The arrays to process. + * @returns {Array} Returns the new array of grouped elements. + * @example + * + * _.zip(['a', 'b'], [1, 2], [true, false]); + * // => [['a', 1, true], ['b', 2, false]] + */ + var zip = baseRest(unzip); + + /** + * This method is like `_.fromPairs` except that it accepts two arrays, + * one of property identifiers and one of corresponding values. + * + * @static + * @memberOf _ + * @since 0.4.0 + * @category Array + * @param {Array} [props=[]] The property identifiers. + * @param {Array} [values=[]] The property values. + * @returns {Object} Returns the new object. + * @example + * + * _.zipObject(['a', 'b'], [1, 2]); + * // => { 'a': 1, 'b': 2 } + */ + function zipObject(props, values) { + return baseZipObject(props || [], values || [], assignValue); + } + + /** + * This method is like `_.zipObject` except that it supports property paths. + * + * @static + * @memberOf _ + * @since 4.1.0 + * @category Array + * @param {Array} [props=[]] The property identifiers. + * @param {Array} [values=[]] The property values. + * @returns {Object} Returns the new object. + * @example + * + * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]); + * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } } + */ + function zipObjectDeep(props, values) { + return baseZipObject(props || [], values || [], baseSet); + } + + /** + * This method is like `_.zip` except that it accepts `iteratee` to specify + * how grouped values should be combined. The iteratee is invoked with the + * elements of each group: (...group). + * + * @static + * @memberOf _ + * @since 3.8.0 + * @category Array + * @param {...Array} [arrays] The arrays to process. + * @param {Function} [iteratee=_.identity] The function to combine + * grouped values. + * @returns {Array} Returns the new array of grouped elements. + * @example + * + * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) { + * return a + b + c; + * }); + * // => [111, 222] + */ + var zipWith = baseRest(function(arrays) { + var length = arrays.length, + iteratee = length > 1 ? arrays[length - 1] : undefined; + + iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined; + return unzipWith(arrays, iteratee); + }); + + /*------------------------------------------------------------------------*/ + + /** + * Creates a `lodash` wrapper instance that wraps `value` with explicit method + * chain sequences enabled. The result of such sequences must be unwrapped + * with `_#value`. + * + * @static + * @memberOf _ + * @since 1.3.0 + * @category Seq + * @param {*} value The value to wrap. + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 40 }, + * { 'user': 'pebbles', 'age': 1 } + * ]; + * + * var youngest = _ + * .chain(users) + * .sortBy('age') + * .map(function(o) { + * return o.user + ' is ' + o.age; + * }) + * .head() + * .value(); + * // => 'pebbles is 1' + */ + function chain(value) { + var result = lodash(value); + result.__chain__ = true; + return result; + } + + /** + * This method invokes `interceptor` and returns `value`. The interceptor + * is invoked with one argument; (value). The purpose of this method is to + * "tap into" a method chain sequence in order to modify intermediate results. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Seq + * @param {*} value The value to provide to `interceptor`. + * @param {Function} interceptor The function to invoke. + * @returns {*} Returns `value`. + * @example + * + * _([1, 2, 3]) + * .tap(function(array) { + * // Mutate input array. + * array.pop(); + * }) + * .reverse() + * .value(); + * // => [2, 1] + */ + function tap(value, interceptor) { + interceptor(value); + return value; + } + + /** + * This method is like `_.tap` except that it returns the result of `interceptor`. + * The purpose of this method is to "pass thru" values replacing intermediate + * results in a method chain sequence. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Seq + * @param {*} value The value to provide to `interceptor`. + * @param {Function} interceptor The function to invoke. + * @returns {*} Returns the result of `interceptor`. + * @example + * + * _(' abc ') + * .chain() + * .trim() + * .thru(function(value) { + * return [value]; + * }) + * .value(); + * // => ['abc'] + */ + function thru(value, interceptor) { + return interceptor(value); + } + + /** + * This method is the wrapper version of `_.at`. + * + * @name at + * @memberOf _ + * @since 1.0.0 + * @category Seq + * @param {...(string|string[])} [paths] The property paths to pick. + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; + * + * _(object).at(['a[0].b.c', 'a[1]']).value(); + * // => [3, 4] + */ + var wrapperAt = flatRest(function(paths) { + var length = paths.length, + start = length ? paths[0] : 0, + value = this.__wrapped__, + interceptor = function(object) { return baseAt(object, paths); }; + + if (length > 1 || this.__actions__.length || + !(value instanceof LazyWrapper) || !isIndex(start)) { + return this.thru(interceptor); + } + value = value.slice(start, +start + (length ? 1 : 0)); + value.__actions__.push({ + 'func': thru, + 'args': [interceptor], + 'thisArg': undefined + }); + return new LodashWrapper(value, this.__chain__).thru(function(array) { + if (length && !array.length) { + array.push(undefined); + } + return array; + }); + }); + + /** + * Creates a `lodash` wrapper instance with explicit method chain sequences enabled. + * + * @name chain + * @memberOf _ + * @since 0.1.0 + * @category Seq + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 40 } + * ]; + * + * // A sequence without explicit chaining. + * _(users).head(); + * // => { 'user': 'barney', 'age': 36 } + * + * // A sequence with explicit chaining. + * _(users) + * .chain() + * .head() + * .pick('user') + * .value(); + * // => { 'user': 'barney' } + */ + function wrapperChain() { + return chain(this); + } + + /** + * Executes the chain sequence and returns the wrapped result. + * + * @name commit + * @memberOf _ + * @since 3.2.0 + * @category Seq + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var array = [1, 2]; + * var wrapped = _(array).push(3); + * + * console.log(array); + * // => [1, 2] + * + * wrapped = wrapped.commit(); + * console.log(array); + * // => [1, 2, 3] + * + * wrapped.last(); + * // => 3 + * + * console.log(array); + * // => [1, 2, 3] + */ + function wrapperCommit() { + return new LodashWrapper(this.value(), this.__chain__); + } + + /** + * Gets the next value on a wrapped object following the + * [iterator protocol](https://mdn.io/iteration_protocols#iterator). + * + * @name next + * @memberOf _ + * @since 4.0.0 + * @category Seq + * @returns {Object} Returns the next iterator value. + * @example + * + * var wrapped = _([1, 2]); + * + * wrapped.next(); + * // => { 'done': false, 'value': 1 } + * + * wrapped.next(); + * // => { 'done': false, 'value': 2 } + * + * wrapped.next(); + * // => { 'done': true, 'value': undefined } + */ + function wrapperNext() { + if (this.__values__ === undefined) { + this.__values__ = toArray(this.value()); + } + var done = this.__index__ >= this.__values__.length, + value = done ? undefined : this.__values__[this.__index__++]; + + return { 'done': done, 'value': value }; + } + + /** + * Enables the wrapper to be iterable. + * + * @name Symbol.iterator + * @memberOf _ + * @since 4.0.0 + * @category Seq + * @returns {Object} Returns the wrapper object. + * @example + * + * var wrapped = _([1, 2]); + * + * wrapped[Symbol.iterator]() === wrapped; + * // => true + * + * Array.from(wrapped); + * // => [1, 2] + */ + function wrapperToIterator() { + return this; + } + + /** + * Creates a clone of the chain sequence planting `value` as the wrapped value. + * + * @name plant + * @memberOf _ + * @since 3.2.0 + * @category Seq + * @param {*} value The value to plant. + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * function square(n) { + * return n * n; + * } + * + * var wrapped = _([1, 2]).map(square); + * var other = wrapped.plant([3, 4]); + * + * other.value(); + * // => [9, 16] + * + * wrapped.value(); + * // => [1, 4] + */ + function wrapperPlant(value) { + var result, + parent = this; + + while (parent instanceof baseLodash) { + var clone = wrapperClone(parent); + clone.__index__ = 0; + clone.__values__ = undefined; + if (result) { + previous.__wrapped__ = clone; + } else { + result = clone; + } + var previous = clone; + parent = parent.__wrapped__; + } + previous.__wrapped__ = value; + return result; + } + + /** + * This method is the wrapper version of `_.reverse`. + * + * **Note:** This method mutates the wrapped array. + * + * @name reverse + * @memberOf _ + * @since 0.1.0 + * @category Seq + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var array = [1, 2, 3]; + * + * _(array).reverse().value() + * // => [3, 2, 1] + * + * console.log(array); + * // => [3, 2, 1] + */ + function wrapperReverse() { + var value = this.__wrapped__; + if (value instanceof LazyWrapper) { + var wrapped = value; + if (this.__actions__.length) { + wrapped = new LazyWrapper(this); + } + wrapped = wrapped.reverse(); + wrapped.__actions__.push({ + 'func': thru, + 'args': [reverse], + 'thisArg': undefined + }); + return new LodashWrapper(wrapped, this.__chain__); + } + return this.thru(reverse); + } + + /** + * Executes the chain sequence to resolve the unwrapped value. + * + * @name value + * @memberOf _ + * @since 0.1.0 + * @alias toJSON, valueOf + * @category Seq + * @returns {*} Returns the resolved unwrapped value. + * @example + * + * _([1, 2, 3]).value(); + * // => [1, 2, 3] + */ + function wrapperValue() { + return baseWrapperValue(this.__wrapped__, this.__actions__); + } + + /*------------------------------------------------------------------------*/ + + /** + * Creates an object composed of keys generated from the results of running + * each element of `collection` thru `iteratee`. The corresponding value of + * each key is the number of times the key was returned by `iteratee`. The + * iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 0.5.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The iteratee to transform keys. + * @returns {Object} Returns the composed aggregate object. + * @example + * + * _.countBy([6.1, 4.2, 6.3], Math.floor); + * // => { '4': 1, '6': 2 } + * + * // The `_.property` iteratee shorthand. + * _.countBy(['one', 'two', 'three'], 'length'); + * // => { '3': 2, '5': 1 } + */ + var countBy = createAggregator(function(result, value, key) { + if (hasOwnProperty.call(result, key)) { + ++result[key]; + } else { + baseAssignValue(result, key, 1); + } + }); + + /** + * Checks if `predicate` returns truthy for **all** elements of `collection`. + * Iteration is stopped once `predicate` returns falsey. The predicate is + * invoked with three arguments: (value, index|key, collection). + * + * **Note:** This method returns `true` for + * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because + * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of + * elements of empty collections. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false`. + * @example + * + * _.every([true, 1, null, 'yes'], Boolean); + * // => false + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': false }, + * { 'user': 'fred', 'age': 40, 'active': false } + * ]; + * + * // The `_.matches` iteratee shorthand. + * _.every(users, { 'user': 'barney', 'active': false }); + * // => false + * + * // The `_.matchesProperty` iteratee shorthand. + * _.every(users, ['active', false]); + * // => true + * + * // The `_.property` iteratee shorthand. + * _.every(users, 'active'); + * // => false + */ + function every(collection, predicate, guard) { + var func = isArray(collection) ? arrayEvery : baseEvery; + if (guard && isIterateeCall(collection, predicate, guard)) { + predicate = undefined; + } + return func(collection, getIteratee(predicate, 3)); + } + + /** + * Iterates over elements of `collection`, returning an array of all elements + * `predicate` returns truthy for. The predicate is invoked with three + * arguments: (value, index|key, collection). + * + * **Note:** Unlike `_.remove`, this method returns a new array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + * @see _.reject + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false } + * ]; + * + * _.filter(users, function(o) { return !o.active; }); + * // => objects for ['fred'] + * + * // The `_.matches` iteratee shorthand. + * _.filter(users, { 'age': 36, 'active': true }); + * // => objects for ['barney'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.filter(users, ['active', false]); + * // => objects for ['fred'] + * + * // The `_.property` iteratee shorthand. + * _.filter(users, 'active'); + * // => objects for ['barney'] + * + * // Combining several predicates using `_.overEvery` or `_.overSome`. + * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]])); + * // => objects for ['fred', 'barney'] + */ + function filter(collection, predicate) { + var func = isArray(collection) ? arrayFilter : baseFilter; + return func(collection, getIteratee(predicate, 3)); + } + + /** + * Iterates over elements of `collection`, returning the first element + * `predicate` returns truthy for. The predicate is invoked with three + * arguments: (value, index|key, collection). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=0] The index to search from. + * @returns {*} Returns the matched element, else `undefined`. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false }, + * { 'user': 'pebbles', 'age': 1, 'active': true } + * ]; + * + * _.find(users, function(o) { return o.age < 40; }); + * // => object for 'barney' + * + * // The `_.matches` iteratee shorthand. + * _.find(users, { 'age': 1, 'active': true }); + * // => object for 'pebbles' + * + * // The `_.matchesProperty` iteratee shorthand. + * _.find(users, ['active', false]); + * // => object for 'fred' + * + * // The `_.property` iteratee shorthand. + * _.find(users, 'active'); + * // => object for 'barney' + */ + var find = createFind(findIndex); + + /** + * This method is like `_.find` except that it iterates over elements of + * `collection` from right to left. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Collection + * @param {Array|Object} collection The collection to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=collection.length-1] The index to search from. + * @returns {*} Returns the matched element, else `undefined`. + * @example + * + * _.findLast([1, 2, 3, 4], function(n) { + * return n % 2 == 1; + * }); + * // => 3 + */ + var findLast = createFind(findLastIndex); + + /** + * Creates a flattened array of values by running each element in `collection` + * thru `iteratee` and flattening the mapped results. The iteratee is invoked + * with three arguments: (value, index|key, collection). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new flattened array. + * @example + * + * function duplicate(n) { + * return [n, n]; + * } + * + * _.flatMap([1, 2], duplicate); + * // => [1, 1, 2, 2] + */ + function flatMap(collection, iteratee) { + return baseFlatten(map(collection, iteratee), 1); + } + + /** + * This method is like `_.flatMap` except that it recursively flattens the + * mapped results. + * + * @static + * @memberOf _ + * @since 4.7.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new flattened array. + * @example + * + * function duplicate(n) { + * return [[[n, n]]]; + * } + * + * _.flatMapDeep([1, 2], duplicate); + * // => [1, 1, 2, 2] + */ + function flatMapDeep(collection, iteratee) { + return baseFlatten(map(collection, iteratee), INFINITY); + } + + /** + * This method is like `_.flatMap` except that it recursively flattens the + * mapped results up to `depth` times. + * + * @static + * @memberOf _ + * @since 4.7.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {number} [depth=1] The maximum recursion depth. + * @returns {Array} Returns the new flattened array. + * @example + * + * function duplicate(n) { + * return [[[n, n]]]; + * } + * + * _.flatMapDepth([1, 2], duplicate, 2); + * // => [[1, 1], [2, 2]] + */ + function flatMapDepth(collection, iteratee, depth) { + depth = depth === undefined ? 1 : toInteger(depth); + return baseFlatten(map(collection, iteratee), depth); + } + + /** + * Iterates over elements of `collection` and invokes `iteratee` for each element. + * The iteratee is invoked with three arguments: (value, index|key, collection). + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * **Note:** As with other "Collections" methods, objects with a "length" + * property are iterated like arrays. To avoid this behavior use `_.forIn` + * or `_.forOwn` for object iteration. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @alias each + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + * @see _.forEachRight + * @example + * + * _.forEach([1, 2], function(value) { + * console.log(value); + * }); + * // => Logs `1` then `2`. + * + * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) { + * console.log(key); + * }); + * // => Logs 'a' then 'b' (iteration order is not guaranteed). + */ + function forEach(collection, iteratee) { + var func = isArray(collection) ? arrayEach : baseEach; + return func(collection, getIteratee(iteratee, 3)); + } + + /** + * This method is like `_.forEach` except that it iterates over elements of + * `collection` from right to left. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @alias eachRight + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + * @see _.forEach + * @example + * + * _.forEachRight([1, 2], function(value) { + * console.log(value); + * }); + * // => Logs `2` then `1`. + */ + function forEachRight(collection, iteratee) { + var func = isArray(collection) ? arrayEachRight : baseEachRight; + return func(collection, getIteratee(iteratee, 3)); + } + + /** + * Creates an object composed of keys generated from the results of running + * each element of `collection` thru `iteratee`. The order of grouped values + * is determined by the order they occur in `collection`. The corresponding + * value of each key is an array of elements responsible for generating the + * key. The iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The iteratee to transform keys. + * @returns {Object} Returns the composed aggregate object. + * @example + * + * _.groupBy([6.1, 4.2, 6.3], Math.floor); + * // => { '4': [4.2], '6': [6.1, 6.3] } + * + * // The `_.property` iteratee shorthand. + * _.groupBy(['one', 'two', 'three'], 'length'); + * // => { '3': ['one', 'two'], '5': ['three'] } + */ + var groupBy = createAggregator(function(result, value, key) { + if (hasOwnProperty.call(result, key)) { + result[key].push(value); + } else { + baseAssignValue(result, key, [value]); + } + }); + + /** + * Checks if `value` is in `collection`. If `collection` is a string, it's + * checked for a substring of `value`, otherwise + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * is used for equality comparisons. If `fromIndex` is negative, it's used as + * the offset from the end of `collection`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object|string} collection The collection to inspect. + * @param {*} value The value to search for. + * @param {number} [fromIndex=0] The index to search from. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. + * @returns {boolean} Returns `true` if `value` is found, else `false`. + * @example + * + * _.includes([1, 2, 3], 1); + * // => true + * + * _.includes([1, 2, 3], 1, 2); + * // => false + * + * _.includes({ 'a': 1, 'b': 2 }, 1); + * // => true + * + * _.includes('abcd', 'bc'); + * // => true + */ + function includes(collection, value, fromIndex, guard) { + collection = isArrayLike(collection) ? collection : values(collection); + fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0; + + var length = collection.length; + if (fromIndex < 0) { + fromIndex = nativeMax(length + fromIndex, 0); + } + return isString(collection) + ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1) + : (!!length && baseIndexOf(collection, value, fromIndex) > -1); + } + + /** + * Invokes the method at `path` of each element in `collection`, returning + * an array of the results of each invoked method. Any additional arguments + * are provided to each invoked method. If `path` is a function, it's invoked + * for, and `this` bound to, each element in `collection`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Array|Function|string} path The path of the method to invoke or + * the function invoked per iteration. + * @param {...*} [args] The arguments to invoke each method with. + * @returns {Array} Returns the array of results. + * @example + * + * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort'); + * // => [[1, 5, 7], [1, 2, 3]] + * + * _.invokeMap([123, 456], String.prototype.split, ''); + * // => [['1', '2', '3'], ['4', '5', '6']] + */ + var invokeMap = baseRest(function(collection, path, args) { + var index = -1, + isFunc = typeof path == 'function', + result = isArrayLike(collection) ? Array(collection.length) : []; + + baseEach(collection, function(value) { + result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args); + }); + return result; + }); + + /** + * Creates an object composed of keys generated from the results of running + * each element of `collection` thru `iteratee`. The corresponding value of + * each key is the last element responsible for generating the key. The + * iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The iteratee to transform keys. + * @returns {Object} Returns the composed aggregate object. + * @example + * + * var array = [ + * { 'dir': 'left', 'code': 97 }, + * { 'dir': 'right', 'code': 100 } + * ]; + * + * _.keyBy(array, function(o) { + * return String.fromCharCode(o.code); + * }); + * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } } + * + * _.keyBy(array, 'dir'); + * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } } + */ + var keyBy = createAggregator(function(result, value, key) { + baseAssignValue(result, key, value); + }); + + /** + * Creates an array of values by running each element in `collection` thru + * `iteratee`. The iteratee is invoked with three arguments: + * (value, index|key, collection). + * + * Many lodash methods are guarded to work as iteratees for methods like + * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`. + * + * The guarded methods are: + * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`, + * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`, + * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`, + * `template`, `trim`, `trimEnd`, `trimStart`, and `words` + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + * @example + * + * function square(n) { + * return n * n; + * } + * + * _.map([4, 8], square); + * // => [16, 64] + * + * _.map({ 'a': 4, 'b': 8 }, square); + * // => [16, 64] (iteration order is not guaranteed) + * + * var users = [ + * { 'user': 'barney' }, + * { 'user': 'fred' } + * ]; + * + * // The `_.property` iteratee shorthand. + * _.map(users, 'user'); + * // => ['barney', 'fred'] + */ + function map(collection, iteratee) { + var func = isArray(collection) ? arrayMap : baseMap; + return func(collection, getIteratee(iteratee, 3)); + } + + /** + * This method is like `_.sortBy` except that it allows specifying the sort + * orders of the iteratees to sort by. If `orders` is unspecified, all values + * are sorted in ascending order. Otherwise, specify an order of "desc" for + * descending or "asc" for ascending sort order of corresponding values. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]] + * The iteratees to sort by. + * @param {string[]} [orders] The sort orders of `iteratees`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. + * @returns {Array} Returns the new sorted array. + * @example + * + * var users = [ + * { 'user': 'fred', 'age': 48 }, + * { 'user': 'barney', 'age': 34 }, + * { 'user': 'fred', 'age': 40 }, + * { 'user': 'barney', 'age': 36 } + * ]; + * + * // Sort by `user` in ascending order and by `age` in descending order. + * _.orderBy(users, ['user', 'age'], ['asc', 'desc']); + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] + */ + function orderBy(collection, iteratees, orders, guard) { + if (collection == null) { + return []; + } + if (!isArray(iteratees)) { + iteratees = iteratees == null ? [] : [iteratees]; + } + orders = guard ? undefined : orders; + if (!isArray(orders)) { + orders = orders == null ? [] : [orders]; + } + return baseOrderBy(collection, iteratees, orders); + } + + /** + * Creates an array of elements split into two groups, the first of which + * contains elements `predicate` returns truthy for, the second of which + * contains elements `predicate` returns falsey for. The predicate is + * invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the array of grouped elements. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': false }, + * { 'user': 'fred', 'age': 40, 'active': true }, + * { 'user': 'pebbles', 'age': 1, 'active': false } + * ]; + * + * _.partition(users, function(o) { return o.active; }); + * // => objects for [['fred'], ['barney', 'pebbles']] + * + * // The `_.matches` iteratee shorthand. + * _.partition(users, { 'age': 1, 'active': false }); + * // => objects for [['pebbles'], ['barney', 'fred']] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.partition(users, ['active', false]); + * // => objects for [['barney', 'pebbles'], ['fred']] + * + * // The `_.property` iteratee shorthand. + * _.partition(users, 'active'); + * // => objects for [['fred'], ['barney', 'pebbles']] + */ + var partition = createAggregator(function(result, value, key) { + result[key ? 0 : 1].push(value); + }, function() { return [[], []]; }); + + /** + * Reduces `collection` to a value which is the accumulated result of running + * each element in `collection` thru `iteratee`, where each successive + * invocation is supplied the return value of the previous. If `accumulator` + * is not given, the first element of `collection` is used as the initial + * value. The iteratee is invoked with four arguments: + * (accumulator, value, index|key, collection). + * + * Many lodash methods are guarded to work as iteratees for methods like + * `_.reduce`, `_.reduceRight`, and `_.transform`. + * + * The guarded methods are: + * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`, + * and `sortBy` + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @returns {*} Returns the accumulated value. + * @see _.reduceRight + * @example + * + * _.reduce([1, 2], function(sum, n) { + * return sum + n; + * }, 0); + * // => 3 + * + * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { + * (result[value] || (result[value] = [])).push(key); + * return result; + * }, {}); + * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed) + */ + function reduce(collection, iteratee, accumulator) { + var func = isArray(collection) ? arrayReduce : baseReduce, + initAccum = arguments.length < 3; + + return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach); + } + + /** + * This method is like `_.reduce` except that it iterates over elements of + * `collection` from right to left. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @returns {*} Returns the accumulated value. + * @see _.reduce + * @example + * + * var array = [[0, 1], [2, 3], [4, 5]]; + * + * _.reduceRight(array, function(flattened, other) { + * return flattened.concat(other); + * }, []); + * // => [4, 5, 2, 3, 0, 1] + */ + function reduceRight(collection, iteratee, accumulator) { + var func = isArray(collection) ? arrayReduceRight : baseReduce, + initAccum = arguments.length < 3; + + return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight); + } + + /** + * The opposite of `_.filter`; this method returns the elements of `collection` + * that `predicate` does **not** return truthy for. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + * @see _.filter + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': false }, + * { 'user': 'fred', 'age': 40, 'active': true } + * ]; + * + * _.reject(users, function(o) { return !o.active; }); + * // => objects for ['fred'] + * + * // The `_.matches` iteratee shorthand. + * _.reject(users, { 'age': 40, 'active': true }); + * // => objects for ['barney'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.reject(users, ['active', false]); + * // => objects for ['fred'] + * + * // The `_.property` iteratee shorthand. + * _.reject(users, 'active'); + * // => objects for ['barney'] + */ + function reject(collection, predicate) { + var func = isArray(collection) ? arrayFilter : baseFilter; + return func(collection, negate(getIteratee(predicate, 3))); + } + + /** + * Gets a random element from `collection`. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Collection + * @param {Array|Object} collection The collection to sample. + * @returns {*} Returns the random element. + * @example + * + * _.sample([1, 2, 3, 4]); + * // => 2 + */ + function sample(collection) { + var func = isArray(collection) ? arraySample : baseSample; + return func(collection); + } + + /** + * Gets `n` random elements at unique keys from `collection` up to the + * size of `collection`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to sample. + * @param {number} [n=1] The number of elements to sample. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the random elements. + * @example + * + * _.sampleSize([1, 2, 3], 2); + * // => [3, 1] + * + * _.sampleSize([1, 2, 3], 4); + * // => [2, 3, 1] + */ + function sampleSize(collection, n, guard) { + if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) { + n = 1; + } else { + n = toInteger(n); + } + var func = isArray(collection) ? arraySampleSize : baseSampleSize; + return func(collection, n); + } + + /** + * Creates an array of shuffled values, using a version of the + * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to shuffle. + * @returns {Array} Returns the new shuffled array. + * @example + * + * _.shuffle([1, 2, 3, 4]); + * // => [4, 1, 3, 2] + */ + function shuffle(collection) { + var func = isArray(collection) ? arrayShuffle : baseShuffle; + return func(collection); + } + + /** + * Gets the size of `collection` by returning its length for array-like + * values or the number of own enumerable string keyed properties for objects. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object|string} collection The collection to inspect. + * @returns {number} Returns the collection size. + * @example + * + * _.size([1, 2, 3]); + * // => 3 + * + * _.size({ 'a': 1, 'b': 2 }); + * // => 2 + * + * _.size('pebbles'); + * // => 7 + */ + function size(collection) { + if (collection == null) { + return 0; + } + if (isArrayLike(collection)) { + return isString(collection) ? stringSize(collection) : collection.length; + } + var tag = getTag(collection); + if (tag == mapTag || tag == setTag) { + return collection.size; + } + return baseKeys(collection).length; + } + + /** + * Checks if `predicate` returns truthy for **any** element of `collection`. + * Iteration is stopped once `predicate` returns truthy. The predicate is + * invoked with three arguments: (value, index|key, collection). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + * @example + * + * _.some([null, 0, 'yes', false], Boolean); + * // => true + * + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false } + * ]; + * + * // The `_.matches` iteratee shorthand. + * _.some(users, { 'user': 'barney', 'active': false }); + * // => false + * + * // The `_.matchesProperty` iteratee shorthand. + * _.some(users, ['active', false]); + * // => true + * + * // The `_.property` iteratee shorthand. + * _.some(users, 'active'); + * // => true + */ + function some(collection, predicate, guard) { + var func = isArray(collection) ? arraySome : baseSome; + if (guard && isIterateeCall(collection, predicate, guard)) { + predicate = undefined; + } + return func(collection, getIteratee(predicate, 3)); + } + + /** + * Creates an array of elements, sorted in ascending order by the results of + * running each element in a collection thru each iteratee. This method + * performs a stable sort, that is, it preserves the original sort order of + * equal elements. The iteratees are invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {...(Function|Function[])} [iteratees=[_.identity]] + * The iteratees to sort by. + * @returns {Array} Returns the new sorted array. + * @example + * + * var users = [ + * { 'user': 'fred', 'age': 48 }, + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 30 }, + * { 'user': 'barney', 'age': 34 } + * ]; + * + * _.sortBy(users, [function(o) { return o.user; }]); + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]] + * + * _.sortBy(users, ['user', 'age']); + * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]] + */ + var sortBy = baseRest(function(collection, iteratees) { + if (collection == null) { + return []; + } + var length = iteratees.length; + if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) { + iteratees = []; + } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) { + iteratees = [iteratees[0]]; + } + return baseOrderBy(collection, baseFlatten(iteratees, 1), []); + }); + + /*------------------------------------------------------------------------*/ + + /** + * Gets the timestamp of the number of milliseconds that have elapsed since + * the Unix epoch (1 January 1970 00:00:00 UTC). + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Date + * @returns {number} Returns the timestamp. + * @example + * + * _.defer(function(stamp) { + * console.log(_.now() - stamp); + * }, _.now()); + * // => Logs the number of milliseconds it took for the deferred invocation. + */ + var now = ctxNow || function() { + return root.Date.now(); + }; + + /*------------------------------------------------------------------------*/ + + /** + * The opposite of `_.before`; this method creates a function that invokes + * `func` once it's called `n` or more times. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {number} n The number of calls before `func` is invoked. + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * var saves = ['profile', 'settings']; + * + * var done = _.after(saves.length, function() { + * console.log('done saving!'); + * }); + * + * _.forEach(saves, function(type) { + * asyncSave({ 'type': type, 'complete': done }); + * }); + * // => Logs 'done saving!' after the two async saves have completed. + */ + function after(n, func) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + n = toInteger(n); + return function() { + if (--n < 1) { + return func.apply(this, arguments); + } + }; + } + + /** + * Creates a function that invokes `func`, with up to `n` arguments, + * ignoring any additional arguments. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {Function} func The function to cap arguments for. + * @param {number} [n=func.length] The arity cap. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Function} Returns the new capped function. + * @example + * + * _.map(['6', '8', '10'], _.ary(parseInt, 1)); + * // => [6, 8, 10] + */ + function ary(func, n, guard) { + n = guard ? undefined : n; + n = (func && n == null) ? func.length : n; + return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n); + } + + /** + * Creates a function that invokes `func`, with the `this` binding and arguments + * of the created function, while it's called less than `n` times. Subsequent + * calls to the created function return the result of the last `func` invocation. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {number} n The number of calls at which `func` is no longer invoked. + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * jQuery(element).on('click', _.before(5, addContactToList)); + * // => Allows adding up to 4 contacts to the list. + */ + function before(n, func) { + var result; + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + n = toInteger(n); + return function() { + if (--n > 0) { + result = func.apply(this, arguments); + } + if (n <= 1) { + func = undefined; + } + return result; + }; + } + + /** + * Creates a function that invokes `func` with the `this` binding of `thisArg` + * and `partials` prepended to the arguments it receives. + * + * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds, + * may be used as a placeholder for partially applied arguments. + * + * **Note:** Unlike native `Function#bind`, this method doesn't set the "length" + * property of bound functions. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to bind. + * @param {*} thisArg The `this` binding of `func`. + * @param {...*} [partials] The arguments to be partially applied. + * @returns {Function} Returns the new bound function. + * @example + * + * function greet(greeting, punctuation) { + * return greeting + ' ' + this.user + punctuation; + * } + * + * var object = { 'user': 'fred' }; + * + * var bound = _.bind(greet, object, 'hi'); + * bound('!'); + * // => 'hi fred!' + * + * // Bound with placeholders. + * var bound = _.bind(greet, object, _, '!'); + * bound('hi'); + * // => 'hi fred!' + */ + var bind = baseRest(function(func, thisArg, partials) { + var bitmask = WRAP_BIND_FLAG; + if (partials.length) { + var holders = replaceHolders(partials, getHolder(bind)); + bitmask |= WRAP_PARTIAL_FLAG; + } + return createWrap(func, bitmask, thisArg, partials, holders); + }); + + /** + * Creates a function that invokes the method at `object[key]` with `partials` + * prepended to the arguments it receives. + * + * This method differs from `_.bind` by allowing bound functions to reference + * methods that may be redefined or don't yet exist. See + * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern) + * for more details. + * + * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic + * builds, may be used as a placeholder for partially applied arguments. + * + * @static + * @memberOf _ + * @since 0.10.0 + * @category Function + * @param {Object} object The object to invoke the method on. + * @param {string} key The key of the method. + * @param {...*} [partials] The arguments to be partially applied. + * @returns {Function} Returns the new bound function. + * @example + * + * var object = { + * 'user': 'fred', + * 'greet': function(greeting, punctuation) { + * return greeting + ' ' + this.user + punctuation; + * } + * }; + * + * var bound = _.bindKey(object, 'greet', 'hi'); + * bound('!'); + * // => 'hi fred!' + * + * object.greet = function(greeting, punctuation) { + * return greeting + 'ya ' + this.user + punctuation; + * }; + * + * bound('!'); + * // => 'hiya fred!' + * + * // Bound with placeholders. + * var bound = _.bindKey(object, 'greet', _, '!'); + * bound('hi'); + * // => 'hiya fred!' + */ + var bindKey = baseRest(function(object, key, partials) { + var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG; + if (partials.length) { + var holders = replaceHolders(partials, getHolder(bindKey)); + bitmask |= WRAP_PARTIAL_FLAG; + } + return createWrap(key, bitmask, object, partials, holders); + }); + + /** + * Creates a function that accepts arguments of `func` and either invokes + * `func` returning its result, if at least `arity` number of arguments have + * been provided, or returns a function that accepts the remaining `func` + * arguments, and so on. The arity of `func` may be specified if `func.length` + * is not sufficient. + * + * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds, + * may be used as a placeholder for provided arguments. + * + * **Note:** This method doesn't set the "length" property of curried functions. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Function + * @param {Function} func The function to curry. + * @param {number} [arity=func.length] The arity of `func`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Function} Returns the new curried function. + * @example + * + * var abc = function(a, b, c) { + * return [a, b, c]; + * }; + * + * var curried = _.curry(abc); + * + * curried(1)(2)(3); + * // => [1, 2, 3] + * + * curried(1, 2)(3); + * // => [1, 2, 3] + * + * curried(1, 2, 3); + * // => [1, 2, 3] + * + * // Curried with placeholders. + * curried(1)(_, 3)(2); + * // => [1, 2, 3] + */ + function curry(func, arity, guard) { + arity = guard ? undefined : arity; + var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity); + result.placeholder = curry.placeholder; + return result; + } + + /** + * This method is like `_.curry` except that arguments are applied to `func` + * in the manner of `_.partialRight` instead of `_.partial`. + * + * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic + * builds, may be used as a placeholder for provided arguments. + * + * **Note:** This method doesn't set the "length" property of curried functions. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {Function} func The function to curry. + * @param {number} [arity=func.length] The arity of `func`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Function} Returns the new curried function. + * @example + * + * var abc = function(a, b, c) { + * return [a, b, c]; + * }; + * + * var curried = _.curryRight(abc); + * + * curried(3)(2)(1); + * // => [1, 2, 3] + * + * curried(2, 3)(1); + * // => [1, 2, 3] + * + * curried(1, 2, 3); + * // => [1, 2, 3] + * + * // Curried with placeholders. + * curried(3)(1, _)(2); + * // => [1, 2, 3] + */ + function curryRight(func, arity, guard) { + arity = guard ? undefined : arity; + var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity); + result.placeholder = curryRight.placeholder; + return result; + } + + /** + * Creates a debounced function that delays invoking `func` until after `wait` + * milliseconds have elapsed since the last time the debounced function was + * invoked. The debounced function comes with a `cancel` method to cancel + * delayed `func` invocations and a `flush` method to immediately invoke them. + * Provide `options` to indicate whether `func` should be invoked on the + * leading and/or trailing edge of the `wait` timeout. The `func` is invoked + * with the last arguments provided to the debounced function. Subsequent + * calls to the debounced function return the result of the last `func` + * invocation. + * + * **Note:** If `leading` and `trailing` options are `true`, `func` is + * invoked on the trailing edge of the timeout only if the debounced function + * is invoked more than once during the `wait` timeout. + * + * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred + * until to the next tick, similar to `setTimeout` with a timeout of `0`. + * + * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) + * for details over the differences between `_.debounce` and `_.throttle`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to debounce. + * @param {number} [wait=0] The number of milliseconds to delay. + * @param {Object} [options={}] The options object. + * @param {boolean} [options.leading=false] + * Specify invoking on the leading edge of the timeout. + * @param {number} [options.maxWait] + * The maximum time `func` is allowed to be delayed before it's invoked. + * @param {boolean} [options.trailing=true] + * Specify invoking on the trailing edge of the timeout. + * @returns {Function} Returns the new debounced function. + * @example + * + * // Avoid costly calculations while the window size is in flux. + * jQuery(window).on('resize', _.debounce(calculateLayout, 150)); + * + * // Invoke `sendMail` when clicked, debouncing subsequent calls. + * jQuery(element).on('click', _.debounce(sendMail, 300, { + * 'leading': true, + * 'trailing': false + * })); + * + * // Ensure `batchLog` is invoked once after 1 second of debounced calls. + * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 }); + * var source = new EventSource('/stream'); + * jQuery(source).on('message', debounced); + * + * // Cancel the trailing debounced invocation. + * jQuery(window).on('popstate', debounced.cancel); + */ + function debounce(func, wait, options) { + var lastArgs, + lastThis, + maxWait, + result, + timerId, + lastCallTime, + lastInvokeTime = 0, + leading = false, + maxing = false, + trailing = true; + + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + wait = toNumber(wait) || 0; + if (isObject(options)) { + leading = !!options.leading; + maxing = 'maxWait' in options; + maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait; + trailing = 'trailing' in options ? !!options.trailing : trailing; + } + + function invokeFunc(time) { + var args = lastArgs, + thisArg = lastThis; + + lastArgs = lastThis = undefined; + lastInvokeTime = time; + result = func.apply(thisArg, args); + return result; + } + + function leadingEdge(time) { + // Reset any `maxWait` timer. + lastInvokeTime = time; + // Start the timer for the trailing edge. + timerId = setTimeout(timerExpired, wait); + // Invoke the leading edge. + return leading ? invokeFunc(time) : result; + } + + function remainingWait(time) { + var timeSinceLastCall = time - lastCallTime, + timeSinceLastInvoke = time - lastInvokeTime, + timeWaiting = wait - timeSinceLastCall; + + return maxing + ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) + : timeWaiting; + } + + function shouldInvoke(time) { + var timeSinceLastCall = time - lastCallTime, + timeSinceLastInvoke = time - lastInvokeTime; + + // Either this is the first call, activity has stopped and we're at the + // trailing edge, the system time has gone backwards and we're treating + // it as the trailing edge, or we've hit the `maxWait` limit. + return (lastCallTime === undefined || (timeSinceLastCall >= wait) || + (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait)); + } + + function timerExpired() { + var time = now(); + if (shouldInvoke(time)) { + return trailingEdge(time); + } + // Restart the timer. + timerId = setTimeout(timerExpired, remainingWait(time)); + } + + function trailingEdge(time) { + timerId = undefined; + + // Only invoke if we have `lastArgs` which means `func` has been + // debounced at least once. + if (trailing && lastArgs) { + return invokeFunc(time); + } + lastArgs = lastThis = undefined; + return result; + } + + function cancel() { + if (timerId !== undefined) { + clearTimeout(timerId); + } + lastInvokeTime = 0; + lastArgs = lastCallTime = lastThis = timerId = undefined; + } + + function flush() { + return timerId === undefined ? result : trailingEdge(now()); + } + + function debounced() { + var time = now(), + isInvoking = shouldInvoke(time); + + lastArgs = arguments; + lastThis = this; + lastCallTime = time; + + if (isInvoking) { + if (timerId === undefined) { + return leadingEdge(lastCallTime); + } + if (maxing) { + // Handle invocations in a tight loop. + clearTimeout(timerId); + timerId = setTimeout(timerExpired, wait); + return invokeFunc(lastCallTime); + } + } + if (timerId === undefined) { + timerId = setTimeout(timerExpired, wait); + } + return result; + } + debounced.cancel = cancel; + debounced.flush = flush; + return debounced; + } + + /** + * Defers invoking the `func` until the current call stack has cleared. Any + * additional arguments are provided to `func` when it's invoked. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to defer. + * @param {...*} [args] The arguments to invoke `func` with. + * @returns {number} Returns the timer id. + * @example + * + * _.defer(function(text) { + * console.log(text); + * }, 'deferred'); + * // => Logs 'deferred' after one millisecond. + */ + var defer = baseRest(function(func, args) { + return baseDelay(func, 1, args); + }); + + /** + * Invokes `func` after `wait` milliseconds. Any additional arguments are + * provided to `func` when it's invoked. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to delay. + * @param {number} wait The number of milliseconds to delay invocation. + * @param {...*} [args] The arguments to invoke `func` with. + * @returns {number} Returns the timer id. + * @example + * + * _.delay(function(text) { + * console.log(text); + * }, 1000, 'later'); + * // => Logs 'later' after one second. + */ + var delay = baseRest(function(func, wait, args) { + return baseDelay(func, toNumber(wait) || 0, args); + }); + + /** + * Creates a function that invokes `func` with arguments reversed. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Function + * @param {Function} func The function to flip arguments for. + * @returns {Function} Returns the new flipped function. + * @example + * + * var flipped = _.flip(function() { + * return _.toArray(arguments); + * }); + * + * flipped('a', 'b', 'c', 'd'); + * // => ['d', 'c', 'b', 'a'] + */ + function flip(func) { + return createWrap(func, WRAP_FLIP_FLAG); + } + + /** + * Creates a function that memoizes the result of `func`. If `resolver` is + * provided, it determines the cache key for storing the result based on the + * arguments provided to the memoized function. By default, the first argument + * provided to the memoized function is used as the map cache key. The `func` + * is invoked with the `this` binding of the memoized function. + * + * **Note:** The cache is exposed as the `cache` property on the memoized + * function. Its creation may be customized by replacing the `_.memoize.Cache` + * constructor with one whose instances implement the + * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) + * method interface of `clear`, `delete`, `get`, `has`, and `set`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to have its output memoized. + * @param {Function} [resolver] The function to resolve the cache key. + * @returns {Function} Returns the new memoized function. + * @example + * + * var object = { 'a': 1, 'b': 2 }; + * var other = { 'c': 3, 'd': 4 }; + * + * var values = _.memoize(_.values); + * values(object); + * // => [1, 2] + * + * values(other); + * // => [3, 4] + * + * object.a = 2; + * values(object); + * // => [1, 2] + * + * // Modify the result cache. + * values.cache.set(object, ['a', 'b']); + * values(object); + * // => ['a', 'b'] + * + * // Replace `_.memoize.Cache`. + * _.memoize.Cache = WeakMap; + */ + function memoize(func, resolver) { + if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) { + throw new TypeError(FUNC_ERROR_TEXT); + } + var memoized = function() { + var args = arguments, + key = resolver ? resolver.apply(this, args) : args[0], + cache = memoized.cache; + + if (cache.has(key)) { + return cache.get(key); + } + var result = func.apply(this, args); + memoized.cache = cache.set(key, result) || cache; + return result; + }; + memoized.cache = new (memoize.Cache || MapCache); + return memoized; + } + + // Expose `MapCache`. + memoize.Cache = MapCache; + + /** + * Creates a function that negates the result of the predicate `func`. The + * `func` predicate is invoked with the `this` binding and arguments of the + * created function. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {Function} predicate The predicate to negate. + * @returns {Function} Returns the new negated function. + * @example + * + * function isEven(n) { + * return n % 2 == 0; + * } + * + * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven)); + * // => [1, 3, 5] + */ + function negate(predicate) { + if (typeof predicate != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + return function() { + var args = arguments; + switch (args.length) { + case 0: return !predicate.call(this); + case 1: return !predicate.call(this, args[0]); + case 2: return !predicate.call(this, args[0], args[1]); + case 3: return !predicate.call(this, args[0], args[1], args[2]); + } + return !predicate.apply(this, args); + }; + } + + /** + * Creates a function that is restricted to invoking `func` once. Repeat calls + * to the function return the value of the first invocation. The `func` is + * invoked with the `this` binding and arguments of the created function. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * var initialize = _.once(createApplication); + * initialize(); + * initialize(); + * // => `createApplication` is invoked once + */ + function once(func) { + return before(2, func); + } + + /** + * Creates a function that invokes `func` with its arguments transformed. + * + * @static + * @since 4.0.0 + * @memberOf _ + * @category Function + * @param {Function} func The function to wrap. + * @param {...(Function|Function[])} [transforms=[_.identity]] + * The argument transforms. + * @returns {Function} Returns the new function. + * @example + * + * function doubled(n) { + * return n * 2; + * } + * + * function square(n) { + * return n * n; + * } + * + * var func = _.overArgs(function(x, y) { + * return [x, y]; + * }, [square, doubled]); + * + * func(9, 3); + * // => [81, 6] + * + * func(10, 5); + * // => [100, 10] + */ + var overArgs = castRest(function(func, transforms) { + transforms = (transforms.length == 1 && isArray(transforms[0])) + ? arrayMap(transforms[0], baseUnary(getIteratee())) + : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee())); + + var funcsLength = transforms.length; + return baseRest(function(args) { + var index = -1, + length = nativeMin(args.length, funcsLength); + + while (++index < length) { + args[index] = transforms[index].call(this, args[index]); + } + return apply(func, this, args); + }); + }); + + /** + * Creates a function that invokes `func` with `partials` prepended to the + * arguments it receives. This method is like `_.bind` except it does **not** + * alter the `this` binding. + * + * The `_.partial.placeholder` value, which defaults to `_` in monolithic + * builds, may be used as a placeholder for partially applied arguments. + * + * **Note:** This method doesn't set the "length" property of partially + * applied functions. + * + * @static + * @memberOf _ + * @since 0.2.0 + * @category Function + * @param {Function} func The function to partially apply arguments to. + * @param {...*} [partials] The arguments to be partially applied. + * @returns {Function} Returns the new partially applied function. + * @example + * + * function greet(greeting, name) { + * return greeting + ' ' + name; + * } + * + * var sayHelloTo = _.partial(greet, 'hello'); + * sayHelloTo('fred'); + * // => 'hello fred' + * + * // Partially applied with placeholders. + * var greetFred = _.partial(greet, _, 'fred'); + * greetFred('hi'); + * // => 'hi fred' + */ + var partial = baseRest(function(func, partials) { + var holders = replaceHolders(partials, getHolder(partial)); + return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders); + }); + + /** + * This method is like `_.partial` except that partially applied arguments + * are appended to the arguments it receives. + * + * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic + * builds, may be used as a placeholder for partially applied arguments. + * + * **Note:** This method doesn't set the "length" property of partially + * applied functions. + * + * @static + * @memberOf _ + * @since 1.0.0 + * @category Function + * @param {Function} func The function to partially apply arguments to. + * @param {...*} [partials] The arguments to be partially applied. + * @returns {Function} Returns the new partially applied function. + * @example + * + * function greet(greeting, name) { + * return greeting + ' ' + name; + * } + * + * var greetFred = _.partialRight(greet, 'fred'); + * greetFred('hi'); + * // => 'hi fred' + * + * // Partially applied with placeholders. + * var sayHelloTo = _.partialRight(greet, 'hello', _); + * sayHelloTo('fred'); + * // => 'hello fred' + */ + var partialRight = baseRest(function(func, partials) { + var holders = replaceHolders(partials, getHolder(partialRight)); + return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders); + }); + + /** + * Creates a function that invokes `func` with arguments arranged according + * to the specified `indexes` where the argument value at the first index is + * provided as the first argument, the argument value at the second index is + * provided as the second argument, and so on. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {Function} func The function to rearrange arguments for. + * @param {...(number|number[])} indexes The arranged argument indexes. + * @returns {Function} Returns the new function. + * @example + * + * var rearged = _.rearg(function(a, b, c) { + * return [a, b, c]; + * }, [2, 0, 1]); + * + * rearged('b', 'c', 'a') + * // => ['a', 'b', 'c'] + */ + var rearg = flatRest(function(func, indexes) { + return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes); + }); + + /** + * Creates a function that invokes `func` with the `this` binding of the + * created function and arguments from `start` and beyond provided as + * an array. + * + * **Note:** This method is based on the + * [rest parameter](https://mdn.io/rest_parameters). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Function + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @returns {Function} Returns the new function. + * @example + * + * var say = _.rest(function(what, names) { + * return what + ' ' + _.initial(names).join(', ') + + * (_.size(names) > 1 ? ', & ' : '') + _.last(names); + * }); + * + * say('hello', 'fred', 'barney', 'pebbles'); + * // => 'hello fred, barney, & pebbles' + */ + function rest(func, start) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + start = start === undefined ? start : toInteger(start); + return baseRest(func, start); + } + + /** + * Creates a function that invokes `func` with the `this` binding of the + * create function and an array of arguments much like + * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply). + * + * **Note:** This method is based on the + * [spread operator](https://mdn.io/spread_operator). + * + * @static + * @memberOf _ + * @since 3.2.0 + * @category Function + * @param {Function} func The function to spread arguments over. + * @param {number} [start=0] The start position of the spread. + * @returns {Function} Returns the new function. + * @example + * + * var say = _.spread(function(who, what) { + * return who + ' says ' + what; + * }); + * + * say(['fred', 'hello']); + * // => 'fred says hello' + * + * var numbers = Promise.all([ + * Promise.resolve(40), + * Promise.resolve(36) + * ]); + * + * numbers.then(_.spread(function(x, y) { + * return x + y; + * })); + * // => a Promise of 76 + */ + function spread(func, start) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + start = start == null ? 0 : nativeMax(toInteger(start), 0); + return baseRest(function(args) { + var array = args[start], + otherArgs = castSlice(args, 0, start); + + if (array) { + arrayPush(otherArgs, array); + } + return apply(func, this, otherArgs); + }); + } + + /** + * Creates a throttled function that only invokes `func` at most once per + * every `wait` milliseconds. The throttled function comes with a `cancel` + * method to cancel delayed `func` invocations and a `flush` method to + * immediately invoke them. Provide `options` to indicate whether `func` + * should be invoked on the leading and/or trailing edge of the `wait` + * timeout. The `func` is invoked with the last arguments provided to the + * throttled function. Subsequent calls to the throttled function return the + * result of the last `func` invocation. + * + * **Note:** If `leading` and `trailing` options are `true`, `func` is + * invoked on the trailing edge of the timeout only if the throttled function + * is invoked more than once during the `wait` timeout. + * + * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred + * until to the next tick, similar to `setTimeout` with a timeout of `0`. + * + * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) + * for details over the differences between `_.throttle` and `_.debounce`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to throttle. + * @param {number} [wait=0] The number of milliseconds to throttle invocations to. + * @param {Object} [options={}] The options object. + * @param {boolean} [options.leading=true] + * Specify invoking on the leading edge of the timeout. + * @param {boolean} [options.trailing=true] + * Specify invoking on the trailing edge of the timeout. + * @returns {Function} Returns the new throttled function. + * @example + * + * // Avoid excessively updating the position while scrolling. + * jQuery(window).on('scroll', _.throttle(updatePosition, 100)); + * + * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes. + * var throttled = _.throttle(renewToken, 300000, { 'trailing': false }); + * jQuery(element).on('click', throttled); + * + * // Cancel the trailing throttled invocation. + * jQuery(window).on('popstate', throttled.cancel); + */ + function throttle(func, wait, options) { + var leading = true, + trailing = true; + + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + if (isObject(options)) { + leading = 'leading' in options ? !!options.leading : leading; + trailing = 'trailing' in options ? !!options.trailing : trailing; + } + return debounce(func, wait, { + 'leading': leading, + 'maxWait': wait, + 'trailing': trailing + }); + } + + /** + * Creates a function that accepts up to one argument, ignoring any + * additional arguments. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Function + * @param {Function} func The function to cap arguments for. + * @returns {Function} Returns the new capped function. + * @example + * + * _.map(['6', '8', '10'], _.unary(parseInt)); + * // => [6, 8, 10] + */ + function unary(func) { + return ary(func, 1); + } + + /** + * Creates a function that provides `value` to `wrapper` as its first + * argument. Any additional arguments provided to the function are appended + * to those provided to the `wrapper`. The wrapper is invoked with the `this` + * binding of the created function. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {*} value The value to wrap. + * @param {Function} [wrapper=identity] The wrapper function. + * @returns {Function} Returns the new function. + * @example + * + * var p = _.wrap(_.escape, function(func, text) { + * return '

' + func(text) + '

'; + * }); + * + * p('fred, barney, & pebbles'); + * // => '

fred, barney, & pebbles

' + */ + function wrap(value, wrapper) { + return partial(castFunction(wrapper), value); + } + + /*------------------------------------------------------------------------*/ + + /** + * Casts `value` as an array if it's not one. + * + * @static + * @memberOf _ + * @since 4.4.0 + * @category Lang + * @param {*} value The value to inspect. + * @returns {Array} Returns the cast array. + * @example + * + * _.castArray(1); + * // => [1] + * + * _.castArray({ 'a': 1 }); + * // => [{ 'a': 1 }] + * + * _.castArray('abc'); + * // => ['abc'] + * + * _.castArray(null); + * // => [null] + * + * _.castArray(undefined); + * // => [undefined] + * + * _.castArray(); + * // => [] + * + * var array = [1, 2, 3]; + * console.log(_.castArray(array) === array); + * // => true + */ + function castArray() { + if (!arguments.length) { + return []; + } + var value = arguments[0]; + return isArray(value) ? value : [value]; + } + + /** + * Creates a shallow clone of `value`. + * + * **Note:** This method is loosely based on the + * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm) + * and supports cloning arrays, array buffers, booleans, date objects, maps, + * numbers, `Object` objects, regexes, sets, strings, symbols, and typed + * arrays. The own enumerable properties of `arguments` objects are cloned + * as plain objects. An empty object is returned for uncloneable values such + * as error objects, functions, DOM nodes, and WeakMaps. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to clone. + * @returns {*} Returns the cloned value. + * @see _.cloneDeep + * @example + * + * var objects = [{ 'a': 1 }, { 'b': 2 }]; + * + * var shallow = _.clone(objects); + * console.log(shallow[0] === objects[0]); + * // => true + */ + function clone(value) { + return baseClone(value, CLONE_SYMBOLS_FLAG); + } + + /** + * This method is like `_.clone` except that it accepts `customizer` which + * is invoked to produce the cloned value. If `customizer` returns `undefined`, + * cloning is handled by the method instead. The `customizer` is invoked with + * up to four arguments; (value [, index|key, object, stack]). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to clone. + * @param {Function} [customizer] The function to customize cloning. + * @returns {*} Returns the cloned value. + * @see _.cloneDeepWith + * @example + * + * function customizer(value) { + * if (_.isElement(value)) { + * return value.cloneNode(false); + * } + * } + * + * var el = _.cloneWith(document.body, customizer); + * + * console.log(el === document.body); + * // => false + * console.log(el.nodeName); + * // => 'BODY' + * console.log(el.childNodes.length); + * // => 0 + */ + function cloneWith(value, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return baseClone(value, CLONE_SYMBOLS_FLAG, customizer); + } + + /** + * This method is like `_.clone` except that it recursively clones `value`. + * + * @static + * @memberOf _ + * @since 1.0.0 + * @category Lang + * @param {*} value The value to recursively clone. + * @returns {*} Returns the deep cloned value. + * @see _.clone + * @example + * + * var objects = [{ 'a': 1 }, { 'b': 2 }]; + * + * var deep = _.cloneDeep(objects); + * console.log(deep[0] === objects[0]); + * // => false + */ + function cloneDeep(value) { + return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG); + } + + /** + * This method is like `_.cloneWith` except that it recursively clones `value`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to recursively clone. + * @param {Function} [customizer] The function to customize cloning. + * @returns {*} Returns the deep cloned value. + * @see _.cloneWith + * @example + * + * function customizer(value) { + * if (_.isElement(value)) { + * return value.cloneNode(true); + * } + * } + * + * var el = _.cloneDeepWith(document.body, customizer); + * + * console.log(el === document.body); + * // => false + * console.log(el.nodeName); + * // => 'BODY' + * console.log(el.childNodes.length); + * // => 20 + */ + function cloneDeepWith(value, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer); + } + + /** + * Checks if `object` conforms to `source` by invoking the predicate + * properties of `source` with the corresponding property values of `object`. + * + * **Note:** This method is equivalent to `_.conforms` when `source` is + * partially applied. + * + * @static + * @memberOf _ + * @since 4.14.0 + * @category Lang + * @param {Object} object The object to inspect. + * @param {Object} source The object of property predicates to conform to. + * @returns {boolean} Returns `true` if `object` conforms, else `false`. + * @example + * + * var object = { 'a': 1, 'b': 2 }; + * + * _.conformsTo(object, { 'b': function(n) { return n > 1; } }); + * // => true + * + * _.conformsTo(object, { 'b': function(n) { return n > 2; } }); + * // => false + */ + function conformsTo(object, source) { + return source == null || baseConformsTo(object, source, keys(source)); + } + + /** + * Performs a + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * comparison between two values to determine if they are equivalent. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.eq(object, object); + * // => true + * + * _.eq(object, other); + * // => false + * + * _.eq('a', 'a'); + * // => true + * + * _.eq('a', Object('a')); + * // => false + * + * _.eq(NaN, NaN); + * // => true + */ + function eq(value, other) { + return value === other || (value !== value && other !== other); + } + + /** + * Checks if `value` is greater than `other`. + * + * @static + * @memberOf _ + * @since 3.9.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is greater than `other`, + * else `false`. + * @see _.lt + * @example + * + * _.gt(3, 1); + * // => true + * + * _.gt(3, 3); + * // => false + * + * _.gt(1, 3); + * // => false + */ + var gt = createRelationalOperation(baseGt); + + /** + * Checks if `value` is greater than or equal to `other`. + * + * @static + * @memberOf _ + * @since 3.9.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is greater than or equal to + * `other`, else `false`. + * @see _.lte + * @example + * + * _.gte(3, 1); + * // => true + * + * _.gte(3, 3); + * // => true + * + * _.gte(1, 3); + * // => false + */ + var gte = createRelationalOperation(function(value, other) { + return value >= other; + }); + + /** + * Checks if `value` is likely an `arguments` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + * else `false`. + * @example + * + * _.isArguments(function() { return arguments; }()); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ + var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { + return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && + !propertyIsEnumerable.call(value, 'callee'); + }; + + /** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(document.body.children); + * // => false + * + * _.isArray('abc'); + * // => false + * + * _.isArray(_.noop); + * // => false + */ + var isArray = Array.isArray; + + /** + * Checks if `value` is classified as an `ArrayBuffer` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`. + * @example + * + * _.isArrayBuffer(new ArrayBuffer(2)); + * // => true + * + * _.isArrayBuffer(new Array(2)); + * // => false + */ + var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer; + + /** + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @example + * + * _.isArrayLike([1, 2, 3]); + * // => true + * + * _.isArrayLike(document.body.children); + * // => true + * + * _.isArrayLike('abc'); + * // => true + * + * _.isArrayLike(_.noop); + * // => false + */ + function isArrayLike(value) { + return value != null && isLength(value.length) && !isFunction(value); + } + + /** + * This method is like `_.isArrayLike` except that it also checks if `value` + * is an object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array-like object, + * else `false`. + * @example + * + * _.isArrayLikeObject([1, 2, 3]); + * // => true + * + * _.isArrayLikeObject(document.body.children); + * // => true + * + * _.isArrayLikeObject('abc'); + * // => false + * + * _.isArrayLikeObject(_.noop); + * // => false + */ + function isArrayLikeObject(value) { + return isObjectLike(value) && isArrayLike(value); + } + + /** + * Checks if `value` is classified as a boolean primitive or object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a boolean, else `false`. + * @example + * + * _.isBoolean(false); + * // => true + * + * _.isBoolean(null); + * // => false + */ + function isBoolean(value) { + return value === true || value === false || + (isObjectLike(value) && baseGetTag(value) == boolTag); + } + + /** + * Checks if `value` is a buffer. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. + * @example + * + * _.isBuffer(new Buffer(2)); + * // => true + * + * _.isBuffer(new Uint8Array(2)); + * // => false + */ + var isBuffer = nativeIsBuffer || stubFalse; + + /** + * Checks if `value` is classified as a `Date` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a date object, else `false`. + * @example + * + * _.isDate(new Date); + * // => true + * + * _.isDate('Mon April 23 2012'); + * // => false + */ + var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate; + + /** + * Checks if `value` is likely a DOM element. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`. + * @example + * + * _.isElement(document.body); + * // => true + * + * _.isElement(''); + * // => false + */ + function isElement(value) { + return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value); + } + + /** + * Checks if `value` is an empty object, collection, map, or set. + * + * Objects are considered empty if they have no own enumerable string keyed + * properties. + * + * Array-like values such as `arguments` objects, arrays, buffers, strings, or + * jQuery-like collections are considered empty if they have a `length` of `0`. + * Similarly, maps and sets are considered empty if they have a `size` of `0`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is empty, else `false`. + * @example + * + * _.isEmpty(null); + * // => true + * + * _.isEmpty(true); + * // => true + * + * _.isEmpty(1); + * // => true + * + * _.isEmpty([1, 2, 3]); + * // => false + * + * _.isEmpty({ 'a': 1 }); + * // => false + */ + function isEmpty(value) { + if (value == null) { + return true; + } + if (isArrayLike(value) && + (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' || + isBuffer(value) || isTypedArray(value) || isArguments(value))) { + return !value.length; + } + var tag = getTag(value); + if (tag == mapTag || tag == setTag) { + return !value.size; + } + if (isPrototype(value)) { + return !baseKeys(value).length; + } + for (var key in value) { + if (hasOwnProperty.call(value, key)) { + return false; + } + } + return true; + } + + /** + * Performs a deep comparison between two values to determine if they are + * equivalent. + * + * **Note:** This method supports comparing arrays, array buffers, booleans, + * date objects, error objects, maps, numbers, `Object` objects, regexes, + * sets, strings, symbols, and typed arrays. `Object` objects are compared + * by their own, not inherited, enumerable properties. Functions and DOM + * nodes are compared by strict equality, i.e. `===`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.isEqual(object, other); + * // => true + * + * object === other; + * // => false + */ + function isEqual(value, other) { + return baseIsEqual(value, other); + } + + /** + * This method is like `_.isEqual` except that it accepts `customizer` which + * is invoked to compare values. If `customizer` returns `undefined`, comparisons + * are handled by the method instead. The `customizer` is invoked with up to + * six arguments: (objValue, othValue [, index|key, object, other, stack]). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @param {Function} [customizer] The function to customize comparisons. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * function isGreeting(value) { + * return /^h(?:i|ello)$/.test(value); + * } + * + * function customizer(objValue, othValue) { + * if (isGreeting(objValue) && isGreeting(othValue)) { + * return true; + * } + * } + * + * var array = ['hello', 'goodbye']; + * var other = ['hi', 'goodbye']; + * + * _.isEqualWith(array, other, customizer); + * // => true + */ + function isEqualWith(value, other, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + var result = customizer ? customizer(value, other) : undefined; + return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result; + } + + /** + * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`, + * `SyntaxError`, `TypeError`, or `URIError` object. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an error object, else `false`. + * @example + * + * _.isError(new Error); + * // => true + * + * _.isError(Error); + * // => false + */ + function isError(value) { + if (!isObjectLike(value)) { + return false; + } + var tag = baseGetTag(value); + return tag == errorTag || tag == domExcTag || + (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value)); + } + + /** + * Checks if `value` is a finite primitive number. + * + * **Note:** This method is based on + * [`Number.isFinite`](https://mdn.io/Number/isFinite). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a finite number, else `false`. + * @example + * + * _.isFinite(3); + * // => true + * + * _.isFinite(Number.MIN_VALUE); + * // => true + * + * _.isFinite(Infinity); + * // => false + * + * _.isFinite('3'); + * // => false + */ + function isFinite(value) { + return typeof value == 'number' && nativeIsFinite(value); + } + + /** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a function, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ + function isFunction(value) { + if (!isObject(value)) { + return false; + } + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 9 which returns 'object' for typed arrays and other constructors. + var tag = baseGetTag(value); + return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; + } + + /** + * Checks if `value` is an integer. + * + * **Note:** This method is based on + * [`Number.isInteger`](https://mdn.io/Number/isInteger). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an integer, else `false`. + * @example + * + * _.isInteger(3); + * // => true + * + * _.isInteger(Number.MIN_VALUE); + * // => false + * + * _.isInteger(Infinity); + * // => false + * + * _.isInteger('3'); + * // => false + */ + function isInteger(value) { + return typeof value == 'number' && value == toInteger(value); + } + + /** + * Checks if `value` is a valid array-like length. + * + * **Note:** This method is loosely based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + * @example + * + * _.isLength(3); + * // => true + * + * _.isLength(Number.MIN_VALUE); + * // => false + * + * _.isLength(Infinity); + * // => false + * + * _.isLength('3'); + * // => false + */ + function isLength(value) { + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; + } + + /** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ + function isObject(value) { + var type = typeof value; + return value != null && (type == 'object' || type == 'function'); + } + + /** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ + function isObjectLike(value) { + return value != null && typeof value == 'object'; + } + + /** + * Checks if `value` is classified as a `Map` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a map, else `false`. + * @example + * + * _.isMap(new Map); + * // => true + * + * _.isMap(new WeakMap); + * // => false + */ + var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap; + + /** + * Performs a partial deep comparison between `object` and `source` to + * determine if `object` contains equivalent property values. + * + * **Note:** This method is equivalent to `_.matches` when `source` is + * partially applied. + * + * Partial comparisons will match empty array and empty object `source` + * values against any array or object value, respectively. See `_.isEqual` + * for a list of supported value comparisons. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {Object} object The object to inspect. + * @param {Object} source The object of property values to match. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. + * @example + * + * var object = { 'a': 1, 'b': 2 }; + * + * _.isMatch(object, { 'b': 2 }); + * // => true + * + * _.isMatch(object, { 'b': 1 }); + * // => false + */ + function isMatch(object, source) { + return object === source || baseIsMatch(object, source, getMatchData(source)); + } + + /** + * This method is like `_.isMatch` except that it accepts `customizer` which + * is invoked to compare values. If `customizer` returns `undefined`, comparisons + * are handled by the method instead. The `customizer` is invoked with five + * arguments: (objValue, srcValue, index|key, object, source). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {Object} object The object to inspect. + * @param {Object} source The object of property values to match. + * @param {Function} [customizer] The function to customize comparisons. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. + * @example + * + * function isGreeting(value) { + * return /^h(?:i|ello)$/.test(value); + * } + * + * function customizer(objValue, srcValue) { + * if (isGreeting(objValue) && isGreeting(srcValue)) { + * return true; + * } + * } + * + * var object = { 'greeting': 'hello' }; + * var source = { 'greeting': 'hi' }; + * + * _.isMatchWith(object, source, customizer); + * // => true + */ + function isMatchWith(object, source, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return baseIsMatch(object, source, getMatchData(source), customizer); + } + + /** + * Checks if `value` is `NaN`. + * + * **Note:** This method is based on + * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as + * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for + * `undefined` and other non-number values. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. + * @example + * + * _.isNaN(NaN); + * // => true + * + * _.isNaN(new Number(NaN)); + * // => true + * + * isNaN(undefined); + * // => true + * + * _.isNaN(undefined); + * // => false + */ + function isNaN(value) { + // An `NaN` primitive is the only value that is not equal to itself. + // Perform the `toStringTag` check first to avoid errors with some + // ActiveX objects in IE. + return isNumber(value) && value != +value; + } + + /** + * Checks if `value` is a pristine native function. + * + * **Note:** This method can't reliably detect native functions in the presence + * of the core-js package because core-js circumvents this kind of detection. + * Despite multiple requests, the core-js maintainer has made it clear: any + * attempt to fix the detection will be obstructed. As a result, we're left + * with little choice but to throw an error. Unfortunately, this also affects + * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill), + * which rely on core-js. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. + * @example + * + * _.isNative(Array.prototype.push); + * // => true + * + * _.isNative(_); + * // => false + */ + function isNative(value) { + if (isMaskable(value)) { + throw new Error(CORE_ERROR_TEXT); + } + return baseIsNative(value); + } + + /** + * Checks if `value` is `null`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `null`, else `false`. + * @example + * + * _.isNull(null); + * // => true + * + * _.isNull(void 0); + * // => false + */ + function isNull(value) { + return value === null; + } + + /** + * Checks if `value` is `null` or `undefined`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is nullish, else `false`. + * @example + * + * _.isNil(null); + * // => true + * + * _.isNil(void 0); + * // => true + * + * _.isNil(NaN); + * // => false + */ + function isNil(value) { + return value == null; + } + + /** + * Checks if `value` is classified as a `Number` primitive or object. + * + * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are + * classified as numbers, use the `_.isFinite` method. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a number, else `false`. + * @example + * + * _.isNumber(3); + * // => true + * + * _.isNumber(Number.MIN_VALUE); + * // => true + * + * _.isNumber(Infinity); + * // => true + * + * _.isNumber('3'); + * // => false + */ + function isNumber(value) { + return typeof value == 'number' || + (isObjectLike(value) && baseGetTag(value) == numberTag); + } + + /** + * Checks if `value` is a plain object, that is, an object created by the + * `Object` constructor or one with a `[[Prototype]]` of `null`. + * + * @static + * @memberOf _ + * @since 0.8.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * _.isPlainObject(new Foo); + * // => false + * + * _.isPlainObject([1, 2, 3]); + * // => false + * + * _.isPlainObject({ 'x': 0, 'y': 0 }); + * // => true + * + * _.isPlainObject(Object.create(null)); + * // => true + */ + function isPlainObject(value) { + if (!isObjectLike(value) || baseGetTag(value) != objectTag) { + return false; + } + var proto = getPrototype(value); + if (proto === null) { + return true; + } + var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; + return typeof Ctor == 'function' && Ctor instanceof Ctor && + funcToString.call(Ctor) == objectCtorString; + } + + /** + * Checks if `value` is classified as a `RegExp` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. + * @example + * + * _.isRegExp(/abc/); + * // => true + * + * _.isRegExp('/abc/'); + * // => false + */ + var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp; + + /** + * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754 + * double precision number which isn't the result of a rounded unsafe integer. + * + * **Note:** This method is based on + * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`. + * @example + * + * _.isSafeInteger(3); + * // => true + * + * _.isSafeInteger(Number.MIN_VALUE); + * // => false + * + * _.isSafeInteger(Infinity); + * // => false + * + * _.isSafeInteger('3'); + * // => false + */ + function isSafeInteger(value) { + return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER; + } + + /** + * Checks if `value` is classified as a `Set` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a set, else `false`. + * @example + * + * _.isSet(new Set); + * // => true + * + * _.isSet(new WeakSet); + * // => false + */ + var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet; + + /** + * Checks if `value` is classified as a `String` primitive or object. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a string, else `false`. + * @example + * + * _.isString('abc'); + * // => true + * + * _.isString(1); + * // => false + */ + function isString(value) { + return typeof value == 'string' || + (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag); + } + + /** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ + function isSymbol(value) { + return typeof value == 'symbol' || + (isObjectLike(value) && baseGetTag(value) == symbolTag); + } + + /** + * Checks if `value` is classified as a typed array. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + * @example + * + * _.isTypedArray(new Uint8Array); + * // => true + * + * _.isTypedArray([]); + * // => false + */ + var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; + + /** + * Checks if `value` is `undefined`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`. + * @example + * + * _.isUndefined(void 0); + * // => true + * + * _.isUndefined(null); + * // => false + */ + function isUndefined(value) { + return value === undefined; + } + + /** + * Checks if `value` is classified as a `WeakMap` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a weak map, else `false`. + * @example + * + * _.isWeakMap(new WeakMap); + * // => true + * + * _.isWeakMap(new Map); + * // => false + */ + function isWeakMap(value) { + return isObjectLike(value) && getTag(value) == weakMapTag; + } + + /** + * Checks if `value` is classified as a `WeakSet` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a weak set, else `false`. + * @example + * + * _.isWeakSet(new WeakSet); + * // => true + * + * _.isWeakSet(new Set); + * // => false + */ + function isWeakSet(value) { + return isObjectLike(value) && baseGetTag(value) == weakSetTag; + } + + /** + * Checks if `value` is less than `other`. + * + * @static + * @memberOf _ + * @since 3.9.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is less than `other`, + * else `false`. + * @see _.gt + * @example + * + * _.lt(1, 3); + * // => true + * + * _.lt(3, 3); + * // => false + * + * _.lt(3, 1); + * // => false + */ + var lt = createRelationalOperation(baseLt); + + /** + * Checks if `value` is less than or equal to `other`. + * + * @static + * @memberOf _ + * @since 3.9.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is less than or equal to + * `other`, else `false`. + * @see _.gte + * @example + * + * _.lte(1, 3); + * // => true + * + * _.lte(3, 3); + * // => true + * + * _.lte(3, 1); + * // => false + */ + var lte = createRelationalOperation(function(value, other) { + return value <= other; + }); + + /** + * Converts `value` to an array. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Lang + * @param {*} value The value to convert. + * @returns {Array} Returns the converted array. + * @example + * + * _.toArray({ 'a': 1, 'b': 2 }); + * // => [1, 2] + * + * _.toArray('abc'); + * // => ['a', 'b', 'c'] + * + * _.toArray(1); + * // => [] + * + * _.toArray(null); + * // => [] + */ + function toArray(value) { + if (!value) { + return []; + } + if (isArrayLike(value)) { + return isString(value) ? stringToArray(value) : copyArray(value); + } + if (symIterator && value[symIterator]) { + return iteratorToArray(value[symIterator]()); + } + var tag = getTag(value), + func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values); + + return func(value); + } + + /** + * Converts `value` to a finite number. + * + * @static + * @memberOf _ + * @since 4.12.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted number. + * @example + * + * _.toFinite(3.2); + * // => 3.2 + * + * _.toFinite(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toFinite(Infinity); + * // => 1.7976931348623157e+308 + * + * _.toFinite('3.2'); + * // => 3.2 + */ + function toFinite(value) { + if (!value) { + return value === 0 ? value : 0; + } + value = toNumber(value); + if (value === INFINITY || value === -INFINITY) { + var sign = (value < 0 ? -1 : 1); + return sign * MAX_INTEGER; + } + return value === value ? value : 0; + } + + /** + * Converts `value` to an integer. + * + * **Note:** This method is loosely based on + * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted integer. + * @example + * + * _.toInteger(3.2); + * // => 3 + * + * _.toInteger(Number.MIN_VALUE); + * // => 0 + * + * _.toInteger(Infinity); + * // => 1.7976931348623157e+308 + * + * _.toInteger('3.2'); + * // => 3 + */ + function toInteger(value) { + var result = toFinite(value), + remainder = result % 1; + + return result === result ? (remainder ? result - remainder : result) : 0; + } + + /** + * Converts `value` to an integer suitable for use as the length of an + * array-like object. + * + * **Note:** This method is based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted integer. + * @example + * + * _.toLength(3.2); + * // => 3 + * + * _.toLength(Number.MIN_VALUE); + * // => 0 + * + * _.toLength(Infinity); + * // => 4294967295 + * + * _.toLength('3.2'); + * // => 3 + */ + function toLength(value) { + return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0; + } + + /** + * Converts `value` to a number. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to process. + * @returns {number} Returns the number. + * @example + * + * _.toNumber(3.2); + * // => 3.2 + * + * _.toNumber(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toNumber(Infinity); + * // => Infinity + * + * _.toNumber('3.2'); + * // => 3.2 + */ + function toNumber(value) { + if (typeof value == 'number') { + return value; + } + if (isSymbol(value)) { + return NAN; + } + if (isObject(value)) { + var other = typeof value.valueOf == 'function' ? value.valueOf() : value; + value = isObject(other) ? (other + '') : other; + } + if (typeof value != 'string') { + return value === 0 ? value : +value; + } + value = baseTrim(value); + var isBinary = reIsBinary.test(value); + return (isBinary || reIsOctal.test(value)) + ? freeParseInt(value.slice(2), isBinary ? 2 : 8) + : (reIsBadHex.test(value) ? NAN : +value); + } + + /** + * Converts `value` to a plain object flattening inherited enumerable string + * keyed properties of `value` to own properties of the plain object. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {Object} Returns the converted plain object. + * @example + * + * function Foo() { + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.assign({ 'a': 1 }, new Foo); + * // => { 'a': 1, 'b': 2 } + * + * _.assign({ 'a': 1 }, _.toPlainObject(new Foo)); + * // => { 'a': 1, 'b': 2, 'c': 3 } + */ + function toPlainObject(value) { + return copyObject(value, keysIn(value)); + } + + /** + * Converts `value` to a safe integer. A safe integer can be compared and + * represented correctly. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted integer. + * @example + * + * _.toSafeInteger(3.2); + * // => 3 + * + * _.toSafeInteger(Number.MIN_VALUE); + * // => 0 + * + * _.toSafeInteger(Infinity); + * // => 9007199254740991 + * + * _.toSafeInteger('3.2'); + * // => 3 + */ + function toSafeInteger(value) { + return value + ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER) + : (value === 0 ? value : 0); + } + + /** + * Converts `value` to a string. An empty string is returned for `null` + * and `undefined` values. The sign of `-0` is preserved. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + * @example + * + * _.toString(null); + * // => '' + * + * _.toString(-0); + * // => '-0' + * + * _.toString([1, 2, 3]); + * // => '1,2,3' + */ + function toString(value) { + return value == null ? '' : baseToString(value); + } + + /*------------------------------------------------------------------------*/ + + /** + * Assigns own enumerable string keyed properties of source objects to the + * destination object. Source objects are applied from left to right. + * Subsequent sources overwrite property assignments of previous sources. + * + * **Note:** This method mutates `object` and is loosely based on + * [`Object.assign`](https://mdn.io/Object/assign). + * + * @static + * @memberOf _ + * @since 0.10.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.assignIn + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * function Bar() { + * this.c = 3; + * } + * + * Foo.prototype.b = 2; + * Bar.prototype.d = 4; + * + * _.assign({ 'a': 0 }, new Foo, new Bar); + * // => { 'a': 1, 'c': 3 } + */ + var assign = createAssigner(function(object, source) { + if (isPrototype(source) || isArrayLike(source)) { + copyObject(source, keys(source), object); + return; + } + for (var key in source) { + if (hasOwnProperty.call(source, key)) { + assignValue(object, key, source[key]); + } + } + }); + + /** + * This method is like `_.assign` except that it iterates over own and + * inherited source properties. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @alias extend + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.assign + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * function Bar() { + * this.c = 3; + * } + * + * Foo.prototype.b = 2; + * Bar.prototype.d = 4; + * + * _.assignIn({ 'a': 0 }, new Foo, new Bar); + * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 } + */ + var assignIn = createAssigner(function(object, source) { + copyObject(source, keysIn(source), object); + }); + + /** + * This method is like `_.assignIn` except that it accepts `customizer` + * which is invoked to produce the assigned values. If `customizer` returns + * `undefined`, assignment is handled by the method instead. The `customizer` + * is invoked with five arguments: (objValue, srcValue, key, object, source). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @alias extendWith + * @category Object + * @param {Object} object The destination object. + * @param {...Object} sources The source objects. + * @param {Function} [customizer] The function to customize assigned values. + * @returns {Object} Returns `object`. + * @see _.assignWith + * @example + * + * function customizer(objValue, srcValue) { + * return _.isUndefined(objValue) ? srcValue : objValue; + * } + * + * var defaults = _.partialRight(_.assignInWith, customizer); + * + * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); + * // => { 'a': 1, 'b': 2 } + */ + var assignInWith = createAssigner(function(object, source, srcIndex, customizer) { + copyObject(source, keysIn(source), object, customizer); + }); + + /** + * This method is like `_.assign` except that it accepts `customizer` + * which is invoked to produce the assigned values. If `customizer` returns + * `undefined`, assignment is handled by the method instead. The `customizer` + * is invoked with five arguments: (objValue, srcValue, key, object, source). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} sources The source objects. + * @param {Function} [customizer] The function to customize assigned values. + * @returns {Object} Returns `object`. + * @see _.assignInWith + * @example + * + * function customizer(objValue, srcValue) { + * return _.isUndefined(objValue) ? srcValue : objValue; + * } + * + * var defaults = _.partialRight(_.assignWith, customizer); + * + * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); + * // => { 'a': 1, 'b': 2 } + */ + var assignWith = createAssigner(function(object, source, srcIndex, customizer) { + copyObject(source, keys(source), object, customizer); + }); + + /** + * Creates an array of values corresponding to `paths` of `object`. + * + * @static + * @memberOf _ + * @since 1.0.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {...(string|string[])} [paths] The property paths to pick. + * @returns {Array} Returns the picked values. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; + * + * _.at(object, ['a[0].b.c', 'a[1]']); + * // => [3, 4] + */ + var at = flatRest(baseAt); + + /** + * Creates an object that inherits from the `prototype` object. If a + * `properties` object is given, its own enumerable string keyed properties + * are assigned to the created object. + * + * @static + * @memberOf _ + * @since 2.3.0 + * @category Object + * @param {Object} prototype The object to inherit from. + * @param {Object} [properties] The properties to assign to the object. + * @returns {Object} Returns the new object. + * @example + * + * function Shape() { + * this.x = 0; + * this.y = 0; + * } + * + * function Circle() { + * Shape.call(this); + * } + * + * Circle.prototype = _.create(Shape.prototype, { + * 'constructor': Circle + * }); + * + * var circle = new Circle; + * circle instanceof Circle; + * // => true + * + * circle instanceof Shape; + * // => true + */ + function create(prototype, properties) { + var result = baseCreate(prototype); + return properties == null ? result : baseAssign(result, properties); + } + + /** + * Assigns own and inherited enumerable string keyed properties of source + * objects to the destination object for all destination properties that + * resolve to `undefined`. Source objects are applied from left to right. + * Once a property is set, additional values of the same property are ignored. + * + * **Note:** This method mutates `object`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.defaultsDeep + * @example + * + * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); + * // => { 'a': 1, 'b': 2 } + */ + var defaults = baseRest(function(object, sources) { + object = Object(object); + + var index = -1; + var length = sources.length; + var guard = length > 2 ? sources[2] : undefined; + + if (guard && isIterateeCall(sources[0], sources[1], guard)) { + length = 1; + } + + while (++index < length) { + var source = sources[index]; + var props = keysIn(source); + var propsIndex = -1; + var propsLength = props.length; + + while (++propsIndex < propsLength) { + var key = props[propsIndex]; + var value = object[key]; + + if (value === undefined || + (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) { + object[key] = source[key]; + } + } + } + + return object; + }); + + /** + * This method is like `_.defaults` except that it recursively assigns + * default properties. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 3.10.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.defaults + * @example + * + * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } }); + * // => { 'a': { 'b': 2, 'c': 3 } } + */ + var defaultsDeep = baseRest(function(args) { + args.push(undefined, customDefaultsMerge); + return apply(mergeWith, undefined, args); + }); + + /** + * This method is like `_.find` except that it returns the key of the first + * element `predicate` returns truthy for instead of the element itself. + * + * @static + * @memberOf _ + * @since 1.1.0 + * @category Object + * @param {Object} object The object to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {string|undefined} Returns the key of the matched element, + * else `undefined`. + * @example + * + * var users = { + * 'barney': { 'age': 36, 'active': true }, + * 'fred': { 'age': 40, 'active': false }, + * 'pebbles': { 'age': 1, 'active': true } + * }; + * + * _.findKey(users, function(o) { return o.age < 40; }); + * // => 'barney' (iteration order is not guaranteed) + * + * // The `_.matches` iteratee shorthand. + * _.findKey(users, { 'age': 1, 'active': true }); + * // => 'pebbles' + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findKey(users, ['active', false]); + * // => 'fred' + * + * // The `_.property` iteratee shorthand. + * _.findKey(users, 'active'); + * // => 'barney' + */ + function findKey(object, predicate) { + return baseFindKey(object, getIteratee(predicate, 3), baseForOwn); + } + + /** + * This method is like `_.findKey` except that it iterates over elements of + * a collection in the opposite order. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Object + * @param {Object} object The object to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @returns {string|undefined} Returns the key of the matched element, + * else `undefined`. + * @example + * + * var users = { + * 'barney': { 'age': 36, 'active': true }, + * 'fred': { 'age': 40, 'active': false }, + * 'pebbles': { 'age': 1, 'active': true } + * }; + * + * _.findLastKey(users, function(o) { return o.age < 40; }); + * // => returns 'pebbles' assuming `_.findKey` returns 'barney' + * + * // The `_.matches` iteratee shorthand. + * _.findLastKey(users, { 'age': 36, 'active': true }); + * // => 'barney' + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findLastKey(users, ['active', false]); + * // => 'fred' + * + * // The `_.property` iteratee shorthand. + * _.findLastKey(users, 'active'); + * // => 'pebbles' + */ + function findLastKey(object, predicate) { + return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight); + } + + /** + * Iterates over own and inherited enumerable string keyed properties of an + * object and invokes `iteratee` for each property. The iteratee is invoked + * with three arguments: (value, key, object). Iteratee functions may exit + * iteration early by explicitly returning `false`. + * + * @static + * @memberOf _ + * @since 0.3.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns `object`. + * @see _.forInRight + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forIn(new Foo, function(value, key) { + * console.log(key); + * }); + * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed). + */ + function forIn(object, iteratee) { + return object == null + ? object + : baseFor(object, getIteratee(iteratee, 3), keysIn); + } + + /** + * This method is like `_.forIn` except that it iterates over properties of + * `object` in the opposite order. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns `object`. + * @see _.forIn + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forInRight(new Foo, function(value, key) { + * console.log(key); + * }); + * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'. + */ + function forInRight(object, iteratee) { + return object == null + ? object + : baseForRight(object, getIteratee(iteratee, 3), keysIn); + } + + /** + * Iterates over own enumerable string keyed properties of an object and + * invokes `iteratee` for each property. The iteratee is invoked with three + * arguments: (value, key, object). Iteratee functions may exit iteration + * early by explicitly returning `false`. + * + * @static + * @memberOf _ + * @since 0.3.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns `object`. + * @see _.forOwnRight + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forOwn(new Foo, function(value, key) { + * console.log(key); + * }); + * // => Logs 'a' then 'b' (iteration order is not guaranteed). + */ + function forOwn(object, iteratee) { + return object && baseForOwn(object, getIteratee(iteratee, 3)); + } + + /** + * This method is like `_.forOwn` except that it iterates over properties of + * `object` in the opposite order. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns `object`. + * @see _.forOwn + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forOwnRight(new Foo, function(value, key) { + * console.log(key); + * }); + * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'. + */ + function forOwnRight(object, iteratee) { + return object && baseForOwnRight(object, getIteratee(iteratee, 3)); + } + + /** + * Creates an array of function property names from own enumerable properties + * of `object`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to inspect. + * @returns {Array} Returns the function names. + * @see _.functionsIn + * @example + * + * function Foo() { + * this.a = _.constant('a'); + * this.b = _.constant('b'); + * } + * + * Foo.prototype.c = _.constant('c'); + * + * _.functions(new Foo); + * // => ['a', 'b'] + */ + function functions(object) { + return object == null ? [] : baseFunctions(object, keys(object)); + } + + /** + * Creates an array of function property names from own and inherited + * enumerable properties of `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to inspect. + * @returns {Array} Returns the function names. + * @see _.functions + * @example + * + * function Foo() { + * this.a = _.constant('a'); + * this.b = _.constant('b'); + * } + * + * Foo.prototype.c = _.constant('c'); + * + * _.functionsIn(new Foo); + * // => ['a', 'b', 'c'] + */ + function functionsIn(object) { + return object == null ? [] : baseFunctions(object, keysIn(object)); + } + + /** + * Gets the value at `path` of `object`. If the resolved value is + * `undefined`, the `defaultValue` is returned in its place. + * + * @static + * @memberOf _ + * @since 3.7.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @param {*} [defaultValue] The value returned for `undefined` resolved values. + * @returns {*} Returns the resolved value. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }] }; + * + * _.get(object, 'a[0].b.c'); + * // => 3 + * + * _.get(object, ['a', '0', 'b', 'c']); + * // => 3 + * + * _.get(object, 'a.b.c', 'default'); + * // => 'default' + */ + function get(object, path, defaultValue) { + var result = object == null ? undefined : baseGet(object, path); + return result === undefined ? defaultValue : result; + } + + /** + * Checks if `path` is a direct property of `object`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + * @example + * + * var object = { 'a': { 'b': 2 } }; + * var other = _.create({ 'a': _.create({ 'b': 2 }) }); + * + * _.has(object, 'a'); + * // => true + * + * _.has(object, 'a.b'); + * // => true + * + * _.has(object, ['a', 'b']); + * // => true + * + * _.has(other, 'a'); + * // => false + */ + function has(object, path) { + return object != null && hasPath(object, path, baseHas); + } + + /** + * Checks if `path` is a direct or inherited property of `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + * @example + * + * var object = _.create({ 'a': _.create({ 'b': 2 }) }); + * + * _.hasIn(object, 'a'); + * // => true + * + * _.hasIn(object, 'a.b'); + * // => true + * + * _.hasIn(object, ['a', 'b']); + * // => true + * + * _.hasIn(object, 'b'); + * // => false + */ + function hasIn(object, path) { + return object != null && hasPath(object, path, baseHasIn); + } + + /** + * Creates an object composed of the inverted keys and values of `object`. + * If `object` contains duplicate values, subsequent values overwrite + * property assignments of previous values. + * + * @static + * @memberOf _ + * @since 0.7.0 + * @category Object + * @param {Object} object The object to invert. + * @returns {Object} Returns the new inverted object. + * @example + * + * var object = { 'a': 1, 'b': 2, 'c': 1 }; + * + * _.invert(object); + * // => { '1': 'c', '2': 'b' } + */ + var invert = createInverter(function(result, value, key) { + if (value != null && + typeof value.toString != 'function') { + value = nativeObjectToString.call(value); + } + + result[value] = key; + }, constant(identity)); + + /** + * This method is like `_.invert` except that the inverted object is generated + * from the results of running each element of `object` thru `iteratee`. The + * corresponding inverted value of each inverted key is an array of keys + * responsible for generating the inverted value. The iteratee is invoked + * with one argument: (value). + * + * @static + * @memberOf _ + * @since 4.1.0 + * @category Object + * @param {Object} object The object to invert. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. + * @returns {Object} Returns the new inverted object. + * @example + * + * var object = { 'a': 1, 'b': 2, 'c': 1 }; + * + * _.invertBy(object); + * // => { '1': ['a', 'c'], '2': ['b'] } + * + * _.invertBy(object, function(value) { + * return 'group' + value; + * }); + * // => { 'group1': ['a', 'c'], 'group2': ['b'] } + */ + var invertBy = createInverter(function(result, value, key) { + if (value != null && + typeof value.toString != 'function') { + value = nativeObjectToString.call(value); + } + + if (hasOwnProperty.call(result, value)) { + result[value].push(key); + } else { + result[value] = [key]; + } + }, getIteratee); + + /** + * Invokes the method at `path` of `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path of the method to invoke. + * @param {...*} [args] The arguments to invoke the method with. + * @returns {*} Returns the result of the invoked method. + * @example + * + * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] }; + * + * _.invoke(object, 'a[0].b.c.slice', 1, 3); + * // => [2, 3] + */ + var invoke = baseRest(baseInvoke); + + /** + * Creates an array of the own enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. See the + * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * for more details. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keys(new Foo); + * // => ['a', 'b'] (iteration order is not guaranteed) + * + * _.keys('hi'); + * // => ['0', '1'] + */ + function keys(object) { + return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); + } + + /** + * Creates an array of the own and inherited enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keysIn(new Foo); + * // => ['a', 'b', 'c'] (iteration order is not guaranteed) + */ + function keysIn(object) { + return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); + } + + /** + * The opposite of `_.mapValues`; this method creates an object with the + * same values as `object` and keys generated by running each own enumerable + * string keyed property of `object` thru `iteratee`. The iteratee is invoked + * with three arguments: (value, key, object). + * + * @static + * @memberOf _ + * @since 3.8.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns the new mapped object. + * @see _.mapValues + * @example + * + * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) { + * return key + value; + * }); + * // => { 'a1': 1, 'b2': 2 } + */ + function mapKeys(object, iteratee) { + var result = {}; + iteratee = getIteratee(iteratee, 3); + + baseForOwn(object, function(value, key, object) { + baseAssignValue(result, iteratee(value, key, object), value); + }); + return result; + } + + /** + * Creates an object with the same keys as `object` and values generated + * by running each own enumerable string keyed property of `object` thru + * `iteratee`. The iteratee is invoked with three arguments: + * (value, key, object). + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns the new mapped object. + * @see _.mapKeys + * @example + * + * var users = { + * 'fred': { 'user': 'fred', 'age': 40 }, + * 'pebbles': { 'user': 'pebbles', 'age': 1 } + * }; + * + * _.mapValues(users, function(o) { return o.age; }); + * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) + * + * // The `_.property` iteratee shorthand. + * _.mapValues(users, 'age'); + * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) + */ + function mapValues(object, iteratee) { + var result = {}; + iteratee = getIteratee(iteratee, 3); + + baseForOwn(object, function(value, key, object) { + baseAssignValue(result, key, iteratee(value, key, object)); + }); + return result; + } + + /** + * This method is like `_.assign` except that it recursively merges own and + * inherited enumerable string keyed properties of source objects into the + * destination object. Source properties that resolve to `undefined` are + * skipped if a destination value exists. Array and plain object properties + * are merged recursively. Other objects and value types are overridden by + * assignment. Source objects are applied from left to right. Subsequent + * sources overwrite property assignments of previous sources. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 0.5.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @example + * + * var object = { + * 'a': [{ 'b': 2 }, { 'd': 4 }] + * }; + * + * var other = { + * 'a': [{ 'c': 3 }, { 'e': 5 }] + * }; + * + * _.merge(object, other); + * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] } + */ + var merge = createAssigner(function(object, source, srcIndex) { + baseMerge(object, source, srcIndex); + }); + + /** + * This method is like `_.merge` except that it accepts `customizer` which + * is invoked to produce the merged values of the destination and source + * properties. If `customizer` returns `undefined`, merging is handled by the + * method instead. The `customizer` is invoked with six arguments: + * (objValue, srcValue, key, object, source, stack). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} sources The source objects. + * @param {Function} customizer The function to customize assigned values. + * @returns {Object} Returns `object`. + * @example + * + * function customizer(objValue, srcValue) { + * if (_.isArray(objValue)) { + * return objValue.concat(srcValue); + * } + * } + * + * var object = { 'a': [1], 'b': [2] }; + * var other = { 'a': [3], 'b': [4] }; + * + * _.mergeWith(object, other, customizer); + * // => { 'a': [1, 3], 'b': [2, 4] } + */ + var mergeWith = createAssigner(function(object, source, srcIndex, customizer) { + baseMerge(object, source, srcIndex, customizer); + }); + + /** + * The opposite of `_.pick`; this method creates an object composed of the + * own and inherited enumerable property paths of `object` that are not omitted. + * + * **Note:** This method is considerably slower than `_.pick`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The source object. + * @param {...(string|string[])} [paths] The property paths to omit. + * @returns {Object} Returns the new object. + * @example + * + * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * + * _.omit(object, ['a', 'c']); + * // => { 'b': '2' } + */ + var omit = flatRest(function(object, paths) { + var result = {}; + if (object == null) { + return result; + } + var isDeep = false; + paths = arrayMap(paths, function(path) { + path = castPath(path, object); + isDeep || (isDeep = path.length > 1); + return path; + }); + copyObject(object, getAllKeysIn(object), result); + if (isDeep) { + result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone); + } + var length = paths.length; + while (length--) { + baseUnset(result, paths[length]); + } + return result; + }); + + /** + * The opposite of `_.pickBy`; this method creates an object composed of + * the own and inherited enumerable string keyed properties of `object` that + * `predicate` doesn't return truthy for. The predicate is invoked with two + * arguments: (value, key). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The source object. + * @param {Function} [predicate=_.identity] The function invoked per property. + * @returns {Object} Returns the new object. + * @example + * + * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * + * _.omitBy(object, _.isNumber); + * // => { 'b': '2' } + */ + function omitBy(object, predicate) { + return pickBy(object, negate(getIteratee(predicate))); + } + + /** + * Creates an object composed of the picked `object` properties. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The source object. + * @param {...(string|string[])} [paths] The property paths to pick. + * @returns {Object} Returns the new object. + * @example + * + * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * + * _.pick(object, ['a', 'c']); + * // => { 'a': 1, 'c': 3 } + */ + var pick = flatRest(function(object, paths) { + return object == null ? {} : basePick(object, paths); + }); + + /** + * Creates an object composed of the `object` properties `predicate` returns + * truthy for. The predicate is invoked with two arguments: (value, key). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The source object. + * @param {Function} [predicate=_.identity] The function invoked per property. + * @returns {Object} Returns the new object. + * @example + * + * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * + * _.pickBy(object, _.isNumber); + * // => { 'a': 1, 'c': 3 } + */ + function pickBy(object, predicate) { + if (object == null) { + return {}; + } + var props = arrayMap(getAllKeysIn(object), function(prop) { + return [prop]; + }); + predicate = getIteratee(predicate); + return basePickBy(object, props, function(value, path) { + return predicate(value, path[0]); + }); + } + + /** + * This method is like `_.get` except that if the resolved value is a + * function it's invoked with the `this` binding of its parent object and + * its result is returned. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to resolve. + * @param {*} [defaultValue] The value returned for `undefined` resolved values. + * @returns {*} Returns the resolved value. + * @example + * + * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] }; + * + * _.result(object, 'a[0].b.c1'); + * // => 3 + * + * _.result(object, 'a[0].b.c2'); + * // => 4 + * + * _.result(object, 'a[0].b.c3', 'default'); + * // => 'default' + * + * _.result(object, 'a[0].b.c3', _.constant('default')); + * // => 'default' + */ + function result(object, path, defaultValue) { + path = castPath(path, object); + + var index = -1, + length = path.length; + + // Ensure the loop is entered when path is empty. + if (!length) { + length = 1; + object = undefined; + } + while (++index < length) { + var value = object == null ? undefined : object[toKey(path[index])]; + if (value === undefined) { + index = length; + value = defaultValue; + } + object = isFunction(value) ? value.call(object) : value; + } + return object; + } + + /** + * Sets the value at `path` of `object`. If a portion of `path` doesn't exist, + * it's created. Arrays are created for missing index properties while objects + * are created for all other missing properties. Use `_.setWith` to customize + * `path` creation. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 3.7.0 + * @category Object + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {*} value The value to set. + * @returns {Object} Returns `object`. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }] }; + * + * _.set(object, 'a[0].b.c', 4); + * console.log(object.a[0].b.c); + * // => 4 + * + * _.set(object, ['x', '0', 'y', 'z'], 5); + * console.log(object.x[0].y.z); + * // => 5 + */ + function set(object, path, value) { + return object == null ? object : baseSet(object, path, value); + } + + /** + * This method is like `_.set` except that it accepts `customizer` which is + * invoked to produce the objects of `path`. If `customizer` returns `undefined` + * path creation is handled by the method instead. The `customizer` is invoked + * with three arguments: (nsValue, key, nsObject). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {*} value The value to set. + * @param {Function} [customizer] The function to customize assigned values. + * @returns {Object} Returns `object`. + * @example + * + * var object = {}; + * + * _.setWith(object, '[0][1]', 'a', Object); + * // => { '0': { '1': 'a' } } + */ + function setWith(object, path, value, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return object == null ? object : baseSet(object, path, value, customizer); + } + + /** + * Creates an array of own enumerable string keyed-value pairs for `object` + * which can be consumed by `_.fromPairs`. If `object` is a map or set, its + * entries are returned. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @alias entries + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the key-value pairs. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.toPairs(new Foo); + * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed) + */ + var toPairs = createToPairs(keys); + + /** + * Creates an array of own and inherited enumerable string keyed-value pairs + * for `object` which can be consumed by `_.fromPairs`. If `object` is a map + * or set, its entries are returned. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @alias entriesIn + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the key-value pairs. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.toPairsIn(new Foo); + * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed) + */ + var toPairsIn = createToPairs(keysIn); + + /** + * An alternative to `_.reduce`; this method transforms `object` to a new + * `accumulator` object which is the result of running each of its own + * enumerable string keyed properties thru `iteratee`, with each invocation + * potentially mutating the `accumulator` object. If `accumulator` is not + * provided, a new object with the same `[[Prototype]]` will be used. The + * iteratee is invoked with four arguments: (accumulator, value, key, object). + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * @static + * @memberOf _ + * @since 1.3.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {*} [accumulator] The custom accumulator value. + * @returns {*} Returns the accumulated value. + * @example + * + * _.transform([2, 3, 4], function(result, n) { + * result.push(n *= n); + * return n % 2 == 0; + * }, []); + * // => [4, 9] + * + * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { + * (result[value] || (result[value] = [])).push(key); + * }, {}); + * // => { '1': ['a', 'c'], '2': ['b'] } + */ + function transform(object, iteratee, accumulator) { + var isArr = isArray(object), + isArrLike = isArr || isBuffer(object) || isTypedArray(object); + + iteratee = getIteratee(iteratee, 4); + if (accumulator == null) { + var Ctor = object && object.constructor; + if (isArrLike) { + accumulator = isArr ? new Ctor : []; + } + else if (isObject(object)) { + accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {}; + } + else { + accumulator = {}; + } + } + (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) { + return iteratee(accumulator, value, index, object); + }); + return accumulator; + } + + /** + * Removes the property at `path` of `object`. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to unset. + * @returns {boolean} Returns `true` if the property is deleted, else `false`. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 7 } }] }; + * _.unset(object, 'a[0].b.c'); + * // => true + * + * console.log(object); + * // => { 'a': [{ 'b': {} }] }; + * + * _.unset(object, ['a', '0', 'b', 'c']); + * // => true + * + * console.log(object); + * // => { 'a': [{ 'b': {} }] }; + */ + function unset(object, path) { + return object == null ? true : baseUnset(object, path); + } + + /** + * This method is like `_.set` except that accepts `updater` to produce the + * value to set. Use `_.updateWith` to customize `path` creation. The `updater` + * is invoked with one argument: (value). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.6.0 + * @category Object + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {Function} updater The function to produce the updated value. + * @returns {Object} Returns `object`. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }] }; + * + * _.update(object, 'a[0].b.c', function(n) { return n * n; }); + * console.log(object.a[0].b.c); + * // => 9 + * + * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; }); + * console.log(object.x[0].y.z); + * // => 0 + */ + function update(object, path, updater) { + return object == null ? object : baseUpdate(object, path, castFunction(updater)); + } + + /** + * This method is like `_.update` except that it accepts `customizer` which is + * invoked to produce the objects of `path`. If `customizer` returns `undefined` + * path creation is handled by the method instead. The `customizer` is invoked + * with three arguments: (nsValue, key, nsObject). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.6.0 + * @category Object + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {Function} updater The function to produce the updated value. + * @param {Function} [customizer] The function to customize assigned values. + * @returns {Object} Returns `object`. + * @example + * + * var object = {}; + * + * _.updateWith(object, '[0][1]', _.constant('a'), Object); + * // => { '0': { '1': 'a' } } + */ + function updateWith(object, path, updater, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer); + } + + /** + * Creates an array of the own enumerable string keyed property values of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property values. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.values(new Foo); + * // => [1, 2] (iteration order is not guaranteed) + * + * _.values('hi'); + * // => ['h', 'i'] + */ + function values(object) { + return object == null ? [] : baseValues(object, keys(object)); + } + + /** + * Creates an array of the own and inherited enumerable string keyed property + * values of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property values. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.valuesIn(new Foo); + * // => [1, 2, 3] (iteration order is not guaranteed) + */ + function valuesIn(object) { + return object == null ? [] : baseValues(object, keysIn(object)); + } + + /*------------------------------------------------------------------------*/ + + /** + * Clamps `number` within the inclusive `lower` and `upper` bounds. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Number + * @param {number} number The number to clamp. + * @param {number} [lower] The lower bound. + * @param {number} upper The upper bound. + * @returns {number} Returns the clamped number. + * @example + * + * _.clamp(-10, -5, 5); + * // => -5 + * + * _.clamp(10, -5, 5); + * // => 5 + */ + function clamp(number, lower, upper) { + if (upper === undefined) { + upper = lower; + lower = undefined; + } + if (upper !== undefined) { + upper = toNumber(upper); + upper = upper === upper ? upper : 0; + } + if (lower !== undefined) { + lower = toNumber(lower); + lower = lower === lower ? lower : 0; + } + return baseClamp(toNumber(number), lower, upper); + } + + /** + * Checks if `n` is between `start` and up to, but not including, `end`. If + * `end` is not specified, it's set to `start` with `start` then set to `0`. + * If `start` is greater than `end` the params are swapped to support + * negative ranges. + * + * @static + * @memberOf _ + * @since 3.3.0 + * @category Number + * @param {number} number The number to check. + * @param {number} [start=0] The start of the range. + * @param {number} end The end of the range. + * @returns {boolean} Returns `true` if `number` is in the range, else `false`. + * @see _.range, _.rangeRight + * @example + * + * _.inRange(3, 2, 4); + * // => true + * + * _.inRange(4, 8); + * // => true + * + * _.inRange(4, 2); + * // => false + * + * _.inRange(2, 2); + * // => false + * + * _.inRange(1.2, 2); + * // => true + * + * _.inRange(5.2, 4); + * // => false + * + * _.inRange(-3, -2, -6); + * // => true + */ + function inRange(number, start, end) { + start = toFinite(start); + if (end === undefined) { + end = start; + start = 0; + } else { + end = toFinite(end); + } + number = toNumber(number); + return baseInRange(number, start, end); + } + + /** + * Produces a random number between the inclusive `lower` and `upper` bounds. + * If only one argument is provided a number between `0` and the given number + * is returned. If `floating` is `true`, or either `lower` or `upper` are + * floats, a floating-point number is returned instead of an integer. + * + * **Note:** JavaScript follows the IEEE-754 standard for resolving + * floating-point values which can produce unexpected results. + * + * @static + * @memberOf _ + * @since 0.7.0 + * @category Number + * @param {number} [lower=0] The lower bound. + * @param {number} [upper=1] The upper bound. + * @param {boolean} [floating] Specify returning a floating-point number. + * @returns {number} Returns the random number. + * @example + * + * _.random(0, 5); + * // => an integer between 0 and 5 + * + * _.random(5); + * // => also an integer between 0 and 5 + * + * _.random(5, true); + * // => a floating-point number between 0 and 5 + * + * _.random(1.2, 5.2); + * // => a floating-point number between 1.2 and 5.2 + */ + function random(lower, upper, floating) { + if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) { + upper = floating = undefined; + } + if (floating === undefined) { + if (typeof upper == 'boolean') { + floating = upper; + upper = undefined; + } + else if (typeof lower == 'boolean') { + floating = lower; + lower = undefined; + } + } + if (lower === undefined && upper === undefined) { + lower = 0; + upper = 1; + } + else { + lower = toFinite(lower); + if (upper === undefined) { + upper = lower; + lower = 0; + } else { + upper = toFinite(upper); + } + } + if (lower > upper) { + var temp = lower; + lower = upper; + upper = temp; + } + if (floating || lower % 1 || upper % 1) { + var rand = nativeRandom(); + return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper); + } + return baseRandom(lower, upper); + } + + /*------------------------------------------------------------------------*/ + + /** + * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the camel cased string. + * @example + * + * _.camelCase('Foo Bar'); + * // => 'fooBar' + * + * _.camelCase('--foo-bar--'); + * // => 'fooBar' + * + * _.camelCase('__FOO_BAR__'); + * // => 'fooBar' + */ + var camelCase = createCompounder(function(result, word, index) { + word = word.toLowerCase(); + return result + (index ? capitalize(word) : word); + }); + + /** + * Converts the first character of `string` to upper case and the remaining + * to lower case. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to capitalize. + * @returns {string} Returns the capitalized string. + * @example + * + * _.capitalize('FRED'); + * // => 'Fred' + */ + function capitalize(string) { + return upperFirst(toString(string).toLowerCase()); + } + + /** + * Deburrs `string` by converting + * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table) + * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A) + * letters to basic Latin letters and removing + * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to deburr. + * @returns {string} Returns the deburred string. + * @example + * + * _.deburr('déjà vu'); + * // => 'deja vu' + */ + function deburr(string) { + string = toString(string); + return string && string.replace(reLatin, deburrLetter).replace(reComboMark, ''); + } + + /** + * Checks if `string` ends with the given target string. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to inspect. + * @param {string} [target] The string to search for. + * @param {number} [position=string.length] The position to search up to. + * @returns {boolean} Returns `true` if `string` ends with `target`, + * else `false`. + * @example + * + * _.endsWith('abc', 'c'); + * // => true + * + * _.endsWith('abc', 'b'); + * // => false + * + * _.endsWith('abc', 'b', 2); + * // => true + */ + function endsWith(string, target, position) { + string = toString(string); + target = baseToString(target); + + var length = string.length; + position = position === undefined + ? length + : baseClamp(toInteger(position), 0, length); + + var end = position; + position -= target.length; + return position >= 0 && string.slice(position, end) == target; + } + + /** + * Converts the characters "&", "<", ">", '"', and "'" in `string` to their + * corresponding HTML entities. + * + * **Note:** No other characters are escaped. To escape additional + * characters use a third-party library like [_he_](https://mths.be/he). + * + * Though the ">" character is escaped for symmetry, characters like + * ">" and "/" don't need escaping in HTML and have no special meaning + * unless they're part of a tag or unquoted attribute value. See + * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands) + * (under "semi-related fun fact") for more details. + * + * When working with HTML you should always + * [quote attribute values](http://wonko.com/post/html-escaping) to reduce + * XSS vectors. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category String + * @param {string} [string=''] The string to escape. + * @returns {string} Returns the escaped string. + * @example + * + * _.escape('fred, barney, & pebbles'); + * // => 'fred, barney, & pebbles' + */ + function escape(string) { + string = toString(string); + return (string && reHasUnescapedHtml.test(string)) + ? string.replace(reUnescapedHtml, escapeHtmlChar) + : string; + } + + /** + * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+", + * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to escape. + * @returns {string} Returns the escaped string. + * @example + * + * _.escapeRegExp('[lodash](https://lodash.com/)'); + * // => '\[lodash\]\(https://lodash\.com/\)' + */ + function escapeRegExp(string) { + string = toString(string); + return (string && reHasRegExpChar.test(string)) + ? string.replace(reRegExpChar, '\\$&') + : string; + } + + /** + * Converts `string` to + * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the kebab cased string. + * @example + * + * _.kebabCase('Foo Bar'); + * // => 'foo-bar' + * + * _.kebabCase('fooBar'); + * // => 'foo-bar' + * + * _.kebabCase('__FOO_BAR__'); + * // => 'foo-bar' + */ + var kebabCase = createCompounder(function(result, word, index) { + return result + (index ? '-' : '') + word.toLowerCase(); + }); + + /** + * Converts `string`, as space separated words, to lower case. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the lower cased string. + * @example + * + * _.lowerCase('--Foo-Bar--'); + * // => 'foo bar' + * + * _.lowerCase('fooBar'); + * // => 'foo bar' + * + * _.lowerCase('__FOO_BAR__'); + * // => 'foo bar' + */ + var lowerCase = createCompounder(function(result, word, index) { + return result + (index ? ' ' : '') + word.toLowerCase(); + }); + + /** + * Converts the first character of `string` to lower case. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the converted string. + * @example + * + * _.lowerFirst('Fred'); + * // => 'fred' + * + * _.lowerFirst('FRED'); + * // => 'fRED' + */ + var lowerFirst = createCaseFirst('toLowerCase'); + + /** + * Pads `string` on the left and right sides if it's shorter than `length`. + * Padding characters are truncated if they can't be evenly divided by `length`. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to pad. + * @param {number} [length=0] The padding length. + * @param {string} [chars=' '] The string used as padding. + * @returns {string} Returns the padded string. + * @example + * + * _.pad('abc', 8); + * // => ' abc ' + * + * _.pad('abc', 8, '_-'); + * // => '_-abc_-_' + * + * _.pad('abc', 3); + * // => 'abc' + */ + function pad(string, length, chars) { + string = toString(string); + length = toInteger(length); + + var strLength = length ? stringSize(string) : 0; + if (!length || strLength >= length) { + return string; + } + var mid = (length - strLength) / 2; + return ( + createPadding(nativeFloor(mid), chars) + + string + + createPadding(nativeCeil(mid), chars) + ); + } + + /** + * Pads `string` on the right side if it's shorter than `length`. Padding + * characters are truncated if they exceed `length`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to pad. + * @param {number} [length=0] The padding length. + * @param {string} [chars=' '] The string used as padding. + * @returns {string} Returns the padded string. + * @example + * + * _.padEnd('abc', 6); + * // => 'abc ' + * + * _.padEnd('abc', 6, '_-'); + * // => 'abc_-_' + * + * _.padEnd('abc', 3); + * // => 'abc' + */ + function padEnd(string, length, chars) { + string = toString(string); + length = toInteger(length); + + var strLength = length ? stringSize(string) : 0; + return (length && strLength < length) + ? (string + createPadding(length - strLength, chars)) + : string; + } + + /** + * Pads `string` on the left side if it's shorter than `length`. Padding + * characters are truncated if they exceed `length`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to pad. + * @param {number} [length=0] The padding length. + * @param {string} [chars=' '] The string used as padding. + * @returns {string} Returns the padded string. + * @example + * + * _.padStart('abc', 6); + * // => ' abc' + * + * _.padStart('abc', 6, '_-'); + * // => '_-_abc' + * + * _.padStart('abc', 3); + * // => 'abc' + */ + function padStart(string, length, chars) { + string = toString(string); + length = toInteger(length); + + var strLength = length ? stringSize(string) : 0; + return (length && strLength < length) + ? (createPadding(length - strLength, chars) + string) + : string; + } + + /** + * Converts `string` to an integer of the specified radix. If `radix` is + * `undefined` or `0`, a `radix` of `10` is used unless `value` is a + * hexadecimal, in which case a `radix` of `16` is used. + * + * **Note:** This method aligns with the + * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`. + * + * @static + * @memberOf _ + * @since 1.1.0 + * @category String + * @param {string} string The string to convert. + * @param {number} [radix=10] The radix to interpret `value` by. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {number} Returns the converted integer. + * @example + * + * _.parseInt('08'); + * // => 8 + * + * _.map(['6', '08', '10'], _.parseInt); + * // => [6, 8, 10] + */ + function parseInt(string, radix, guard) { + if (guard || radix == null) { + radix = 0; + } else if (radix) { + radix = +radix; + } + return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0); + } + + /** + * Repeats the given string `n` times. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to repeat. + * @param {number} [n=1] The number of times to repeat the string. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {string} Returns the repeated string. + * @example + * + * _.repeat('*', 3); + * // => '***' + * + * _.repeat('abc', 2); + * // => 'abcabc' + * + * _.repeat('abc', 0); + * // => '' + */ + function repeat(string, n, guard) { + if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) { + n = 1; + } else { + n = toInteger(n); + } + return baseRepeat(toString(string), n); + } + + /** + * Replaces matches for `pattern` in `string` with `replacement`. + * + * **Note:** This method is based on + * [`String#replace`](https://mdn.io/String/replace). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to modify. + * @param {RegExp|string} pattern The pattern to replace. + * @param {Function|string} replacement The match replacement. + * @returns {string} Returns the modified string. + * @example + * + * _.replace('Hi Fred', 'Fred', 'Barney'); + * // => 'Hi Barney' + */ + function replace() { + var args = arguments, + string = toString(args[0]); + + return args.length < 3 ? string : string.replace(args[1], args[2]); + } + + /** + * Converts `string` to + * [snake case](https://en.wikipedia.org/wiki/Snake_case). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the snake cased string. + * @example + * + * _.snakeCase('Foo Bar'); + * // => 'foo_bar' + * + * _.snakeCase('fooBar'); + * // => 'foo_bar' + * + * _.snakeCase('--FOO-BAR--'); + * // => 'foo_bar' + */ + var snakeCase = createCompounder(function(result, word, index) { + return result + (index ? '_' : '') + word.toLowerCase(); + }); + + /** + * Splits `string` by `separator`. + * + * **Note:** This method is based on + * [`String#split`](https://mdn.io/String/split). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to split. + * @param {RegExp|string} separator The separator pattern to split by. + * @param {number} [limit] The length to truncate results to. + * @returns {Array} Returns the string segments. + * @example + * + * _.split('a-b-c', '-', 2); + * // => ['a', 'b'] + */ + function split(string, separator, limit) { + if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) { + separator = limit = undefined; + } + limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0; + if (!limit) { + return []; + } + string = toString(string); + if (string && ( + typeof separator == 'string' || + (separator != null && !isRegExp(separator)) + )) { + separator = baseToString(separator); + if (!separator && hasUnicode(string)) { + return castSlice(stringToArray(string), 0, limit); + } + } + return string.split(separator, limit); + } + + /** + * Converts `string` to + * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage). + * + * @static + * @memberOf _ + * @since 3.1.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the start cased string. + * @example + * + * _.startCase('--foo-bar--'); + * // => 'Foo Bar' + * + * _.startCase('fooBar'); + * // => 'Foo Bar' + * + * _.startCase('__FOO_BAR__'); + * // => 'FOO BAR' + */ + var startCase = createCompounder(function(result, word, index) { + return result + (index ? ' ' : '') + upperFirst(word); + }); + + /** + * Checks if `string` starts with the given target string. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to inspect. + * @param {string} [target] The string to search for. + * @param {number} [position=0] The position to search from. + * @returns {boolean} Returns `true` if `string` starts with `target`, + * else `false`. + * @example + * + * _.startsWith('abc', 'a'); + * // => true + * + * _.startsWith('abc', 'b'); + * // => false + * + * _.startsWith('abc', 'b', 1); + * // => true + */ + function startsWith(string, target, position) { + string = toString(string); + position = position == null + ? 0 + : baseClamp(toInteger(position), 0, string.length); + + target = baseToString(target); + return string.slice(position, position + target.length) == target; + } + + /** + * Creates a compiled template function that can interpolate data properties + * in "interpolate" delimiters, HTML-escape interpolated data properties in + * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data + * properties may be accessed as free variables in the template. If a setting + * object is given, it takes precedence over `_.templateSettings` values. + * + * **Note:** In the development build `_.template` utilizes + * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl) + * for easier debugging. + * + * For more information on precompiling templates see + * [lodash's custom builds documentation](https://lodash.com/custom-builds). + * + * For more information on Chrome extension sandboxes see + * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval). + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category String + * @param {string} [string=''] The template string. + * @param {Object} [options={}] The options object. + * @param {RegExp} [options.escape=_.templateSettings.escape] + * The HTML "escape" delimiter. + * @param {RegExp} [options.evaluate=_.templateSettings.evaluate] + * The "evaluate" delimiter. + * @param {Object} [options.imports=_.templateSettings.imports] + * An object to import into the template as free variables. + * @param {RegExp} [options.interpolate=_.templateSettings.interpolate] + * The "interpolate" delimiter. + * @param {string} [options.sourceURL='lodash.templateSources[n]'] + * The sourceURL of the compiled template. + * @param {string} [options.variable='obj'] + * The data object variable name. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Function} Returns the compiled template function. + * @example + * + * // Use the "interpolate" delimiter to create a compiled template. + * var compiled = _.template('hello <%= user %>!'); + * compiled({ 'user': 'fred' }); + * // => 'hello fred!' + * + * // Use the HTML "escape" delimiter to escape data property values. + * var compiled = _.template('<%- value %>'); + * compiled({ 'value': ' +``` + +### In an AMD loader +```js +require(['async'], function(async) {}); +``` + +### Promise and async/await + +I recommend to use [`Aigle`](https://github.com/suguru03/aigle). + +It is optimized for Promise handling and has almost the same functionality as `neo-async`. + +### Node.js + +#### standard + +```bash +$ npm install neo-async +``` +```js +var async = require('neo-async'); +``` + +#### replacement +```bash +$ npm install neo-async +$ ln -s ./node_modules/neo-async ./node_modules/async +``` +```js +var async = require('async'); +``` + +### Bower + +```bash +bower install neo-async +``` + +## Feature + +[JSDoc](http://suguru03.github.io/neo-async/doc/async.html) + +\* not in Async + +### Collections + +- [`each`](http://suguru03.github.io/neo-async/doc/async.each.html) +- [`eachSeries`](http://suguru03.github.io/neo-async/doc/async.eachSeries.html) +- [`eachLimit`](http://suguru03.github.io/neo-async/doc/async.eachLimit.html) +- [`forEach`](http://suguru03.github.io/neo-async/doc/async.each.html) -> [`each`](http://suguru03.github.io/neo-async/doc/async.each.html) +- [`forEachSeries`](http://suguru03.github.io/neo-async/doc/async.eachSeries.html) -> [`eachSeries`](http://suguru03.github.io/neo-async/doc/async.eachSeries.html) +- [`forEachLimit`](http://suguru03.github.io/neo-async/doc/async.eachLimit.html) -> [`eachLimit`](http://suguru03.github.io/neo-async/doc/async.eachLimit.html) +- [`eachOf`](http://suguru03.github.io/neo-async/doc/async.each.html) -> [`each`](http://suguru03.github.io/neo-async/doc/async.each.html) +- [`eachOfSeries`](http://suguru03.github.io/neo-async/doc/async.eachSeries.html) -> [`eachSeries`](http://suguru03.github.io/neo-async/doc/async.eachSeries.html) +- [`eachOfLimit`](http://suguru03.github.io/neo-async/doc/async.eachLimit.html) -> [`eachLimit`](http://suguru03.github.io/neo-async/doc/async.eachLimit.html) +- [`forEachOf`](http://suguru03.github.io/neo-async/doc/async.each.html) -> [`each`](http://suguru03.github.io/neo-async/doc/async.each.html) +- [`forEachOfSeries`](http://suguru03.github.io/neo-async/doc/async.eachSeries.html) -> [`eachSeries`](http://suguru03.github.io/neo-async/doc/async.eachSeries.html) +- [`eachOfLimit`](http://suguru03.github.io/neo-async/doc/async.eachLimit.html) -> [`forEachLimit`](http://suguru03.github.io/neo-async/doc/async.eachLimit.html) +- [`map`](http://suguru03.github.io/neo-async/doc/async.map.html) +- [`mapSeries`](http://suguru03.github.io/neo-async/doc/async.mapSeries.html) +- [`mapLimit`](http://suguru03.github.io/neo-async/doc/async.mapLimit.html) +- [`mapValues`](http://suguru03.github.io/neo-async/doc/async.mapValues.html) +- [`mapValuesSeries`](http://suguru03.github.io/neo-async/doc/async.mapValuesSeries.html) +- [`mapValuesLimit`](http://suguru03.github.io/neo-async/doc/async.mapValuesLimit.html) +- [`filter`](http://suguru03.github.io/neo-async/doc/async.filter.html) +- [`filterSeries`](http://suguru03.github.io/neo-async/doc/async.filterSeries.html) +- [`filterLimit`](http://suguru03.github.io/neo-async/doc/async.filterLimit.html) +- [`select`](http://suguru03.github.io/neo-async/doc/async.filter.html) -> [`filter`](http://suguru03.github.io/neo-async/doc/async.filter.html) +- [`selectSeries`](http://suguru03.github.io/neo-async/doc/async.filterSeries.html) -> [`filterSeries`](http://suguru03.github.io/neo-async/doc/async.filterSeries.html) +- [`selectLimit`](http://suguru03.github.io/neo-async/doc/async.filterLimit.html) -> [`filterLimit`](http://suguru03.github.io/neo-async/doc/async.filterLimit.html) +- [`reject`](http://suguru03.github.io/neo-async/doc/async.reject.html) +- [`rejectSeries`](http://suguru03.github.io/neo-async/doc/async.rejectSeries.html) +- [`rejectLimit`](http://suguru03.github.io/neo-async/doc/async.rejectLimit.html) +- [`detect`](http://suguru03.github.io/neo-async/doc/async.detect.html) +- [`detectSeries`](http://suguru03.github.io/neo-async/doc/async.detectSeries.html) +- [`detectLimit`](http://suguru03.github.io/neo-async/doc/async.detectLimit.html) +- [`find`](http://suguru03.github.io/neo-async/doc/async.detect.html) -> [`detect`](http://suguru03.github.io/neo-async/doc/async.detect.html) +- [`findSeries`](http://suguru03.github.io/neo-async/doc/async.detectSeries.html) -> [`detectSeries`](http://suguru03.github.io/neo-async/doc/async.detectSeries.html) +- [`findLimit`](http://suguru03.github.io/neo-async/doc/async.detectLimit.html) -> [`detectLimit`](http://suguru03.github.io/neo-async/doc/async.detectLimit.html) +- [`pick`](http://suguru03.github.io/neo-async/doc/async.pick.html) * +- [`pickSeries`](http://suguru03.github.io/neo-async/doc/async.pickSeries.html) * +- [`pickLimit`](http://suguru03.github.io/neo-async/doc/async.pickLimit.html) * +- [`omit`](http://suguru03.github.io/neo-async/doc/async.omit.html) * +- [`omitSeries`](http://suguru03.github.io/neo-async/doc/async.omitSeries.html) * +- [`omitLimit`](http://suguru03.github.io/neo-async/doc/async.omitLimit.html) * +- [`reduce`](http://suguru03.github.io/neo-async/doc/async.reduce.html) +- [`inject`](http://suguru03.github.io/neo-async/doc/async.reduce.html) -> [`reduce`](http://suguru03.github.io/neo-async/doc/async.reduce.html) +- [`foldl`](http://suguru03.github.io/neo-async/doc/async.reduce.html) -> [`reduce`](http://suguru03.github.io/neo-async/doc/async.reduce.html) +- [`reduceRight`](http://suguru03.github.io/neo-async/doc/async.reduceRight.html) +- [`foldr`](http://suguru03.github.io/neo-async/doc/async.reduceRight.html) -> [`reduceRight`](http://suguru03.github.io/neo-async/doc/async.reduceRight.html) +- [`transform`](http://suguru03.github.io/neo-async/doc/async.transform.html) +- [`transformSeries`](http://suguru03.github.io/neo-async/doc/async.transformSeries.html) * +- [`transformLimit`](http://suguru03.github.io/neo-async/doc/async.transformLimit.html) * +- [`sortBy`](http://suguru03.github.io/neo-async/doc/async.sortBy.html) +- [`sortBySeries`](http://suguru03.github.io/neo-async/doc/async.sortBySeries.html) * +- [`sortByLimit`](http://suguru03.github.io/neo-async/doc/async.sortByLimit.html) * +- [`some`](http://suguru03.github.io/neo-async/doc/async.some.html) +- [`someSeries`](http://suguru03.github.io/neo-async/doc/async.someSeries.html) +- [`someLimit`](http://suguru03.github.io/neo-async/doc/async.someLimit.html) +- [`any`](http://suguru03.github.io/neo-async/doc/async.some.html) -> [`some`](http://suguru03.github.io/neo-async/doc/async.some.html) +- [`anySeries`](http://suguru03.github.io/neo-async/doc/async.someSeries.html) -> [`someSeries`](http://suguru03.github.io/neo-async/doc/async.someSeries.html) +- [`anyLimit`](http://suguru03.github.io/neo-async/doc/async.someLimit.html) -> [`someLimit`](http://suguru03.github.io/neo-async/doc/async.someLimit.html) +- [`every`](http://suguru03.github.io/neo-async/doc/async.every.html) +- [`everySeries`](http://suguru03.github.io/neo-async/doc/async.everySeries.html) +- [`everyLimit`](http://suguru03.github.io/neo-async/doc/async.everyLimit.html) +- [`all`](http://suguru03.github.io/neo-async/doc/async.every.html) -> [`every`](http://suguru03.github.io/neo-async/doc/async.every.html) +- [`allSeries`](http://suguru03.github.io/neo-async/doc/async.everySeries.html) -> [`every`](http://suguru03.github.io/neo-async/doc/async.everySeries.html) +- [`allLimit`](http://suguru03.github.io/neo-async/doc/async.everyLimit.html) -> [`every`](http://suguru03.github.io/neo-async/doc/async.everyLimit.html) +- [`concat`](http://suguru03.github.io/neo-async/doc/async.concat.html) +- [`concatSeries`](http://suguru03.github.io/neo-async/doc/async.concatSeries.html) +- [`concatLimit`](http://suguru03.github.io/neo-async/doc/async.concatLimit.html) * + +### Control Flow + +- [`parallel`](http://suguru03.github.io/neo-async/doc/async.parallel.html) +- [`series`](http://suguru03.github.io/neo-async/doc/async.series.html) +- [`parallelLimit`](http://suguru03.github.io/neo-async/doc/async.series.html) +- [`tryEach`](http://suguru03.github.io/neo-async/doc/async.tryEach.html) +- [`waterfall`](http://suguru03.github.io/neo-async/doc/async.waterfall.html) +- [`angelFall`](http://suguru03.github.io/neo-async/doc/async.angelFall.html) * +- [`angelfall`](http://suguru03.github.io/neo-async/doc/async.angelFall.html) -> [`angelFall`](http://suguru03.github.io/neo-async/doc/async.angelFall.html) * +- [`whilst`](#whilst) +- [`doWhilst`](#doWhilst) +- [`until`](#until) +- [`doUntil`](#doUntil) +- [`during`](#during) +- [`doDuring`](#doDuring) +- [`forever`](#forever) +- [`compose`](#compose) +- [`seq`](#seq) +- [`applyEach`](#applyEach) +- [`applyEachSeries`](#applyEachSeries) +- [`queue`](#queue) +- [`priorityQueue`](#priorityQueue) +- [`cargo`](#cargo) +- [`auto`](#auto) +- [`autoInject`](#autoInject) +- [`retry`](#retry) +- [`retryable`](#retryable) +- [`iterator`](#iterator) +- [`times`](http://suguru03.github.io/neo-async/doc/async.times.html) +- [`timesSeries`](http://suguru03.github.io/neo-async/doc/async.timesSeries.html) +- [`timesLimit`](http://suguru03.github.io/neo-async/doc/async.timesLimit.html) +- [`race`](#race) + +### Utils +- [`apply`](#apply) +- [`setImmediate`](#setImmediate) +- [`nextTick`](#nextTick) +- [`memoize`](#memoize) +- [`unmemoize`](#unmemoize) +- [`ensureAsync`](#ensureAsync) +- [`constant`](#constant) +- [`asyncify`](#asyncify) +- [`wrapSync`](#asyncify) -> [`asyncify`](#asyncify) +- [`log`](#log) +- [`dir`](#dir) +- [`timeout`](http://suguru03.github.io/neo-async/doc/async.timeout.html) +- [`reflect`](#reflect) +- [`reflectAll`](#reflectAll) +- [`createLogger`](#createLogger) + +## Mode +- [`safe`](#safe) * +- [`fast`](#fast) * + +## Benchmark + +[Benchmark: Async vs Neo-Async](http://suguru03.hatenablog.com/entry/2016/06/10/135559) + +### How to check + +```bash +$ node perf +``` + +### Environment + +* Darwin 17.3.0 x64 +* Node.js v8.9.4 +* async v2.6.0 +* neo-async v2.5.0 +* benchmark v2.1.4 + +### Result + +The value is the ratio (Neo-Async/Async) of the average speed. + +#### Collections +|function|benchmark| +|---|--:| +|each/forEach|2.43| +|eachSeries/forEachSeries|1.75| +|eachLimit/forEachLimit|1.68| +|eachOf|3.29| +|eachOfSeries|1.50| +|eachOfLimit|1.59| +|map|3.95| +|mapSeries|1.81| +|mapLimit|1.27| +|mapValues|2.73| +|mapValuesSeries|1.59| +|mapValuesLimit|1.23| +|filter|3.00| +|filterSeries|1.74| +|filterLimit|1.17| +|reject|4.59| +|rejectSeries|2.31| +|rejectLimit|1.58| +|detect|4.30| +|detectSeries|1.86| +|detectLimit|1.32| +|reduce|1.82| +|transform|2.46| +|sortBy|4.08| +|some|2.19| +|someSeries|1.83| +|someLimit|1.32| +|every|2.09| +|everySeries|1.84| +|everyLimit|1.35| +|concat|3.79| +|concatSeries|4.45| + +#### Control Flow +|funciton|benchmark| +|---|--:| +|parallel|2.93| +|series|1.96| +|waterfall|1.29| +|whilst|1.00| +|doWhilst|1.12| +|until|1.12| +|doUntil|1.12| +|during|1.18| +|doDuring|2.42| +|times|4.25| +|auto|1.97| + + +## License +[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fsuguru03%2Fneo-async.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fsuguru03%2Fneo-async?ref=badge_large) diff --git a/node_modules/neo-async/all.js b/node_modules/neo-async/all.js new file mode 100644 index 0000000..dad54e7 --- /dev/null +++ b/node_modules/neo-async/all.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./async').all; diff --git a/node_modules/neo-async/allLimit.js b/node_modules/neo-async/allLimit.js new file mode 100644 index 0000000..d9d7aaa --- /dev/null +++ b/node_modules/neo-async/allLimit.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./async').allLimit; diff --git a/node_modules/neo-async/allSeries.js b/node_modules/neo-async/allSeries.js new file mode 100644 index 0000000..2a7a8ba --- /dev/null +++ b/node_modules/neo-async/allSeries.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./async').allSeries; diff --git a/node_modules/neo-async/angelFall.js b/node_modules/neo-async/angelFall.js new file mode 100644 index 0000000..476c23e --- /dev/null +++ b/node_modules/neo-async/angelFall.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./async').angelfall; diff --git a/node_modules/neo-async/any.js b/node_modules/neo-async/any.js new file mode 100644 index 0000000..d6b07bb --- /dev/null +++ b/node_modules/neo-async/any.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./async').any; diff --git a/node_modules/neo-async/anyLimit.js b/node_modules/neo-async/anyLimit.js new file mode 100644 index 0000000..34114f8 --- /dev/null +++ b/node_modules/neo-async/anyLimit.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./async').anyLimit; diff --git a/node_modules/neo-async/anySeries.js b/node_modules/neo-async/anySeries.js new file mode 100644 index 0000000..bb3781f --- /dev/null +++ b/node_modules/neo-async/anySeries.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./async').anySeries; diff --git a/node_modules/neo-async/apply.js b/node_modules/neo-async/apply.js new file mode 100644 index 0000000..41135e2 --- /dev/null +++ b/node_modules/neo-async/apply.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./async').apply; diff --git a/node_modules/neo-async/applyEach.js b/node_modules/neo-async/applyEach.js new file mode 100644 index 0000000..292bd1c --- /dev/null +++ b/node_modules/neo-async/applyEach.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./async').applyEach; diff --git a/node_modules/neo-async/applyEachSeries.js b/node_modules/neo-async/applyEachSeries.js new file mode 100644 index 0000000..0aece7c --- /dev/null +++ b/node_modules/neo-async/applyEachSeries.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./async').applyEachSeries; diff --git a/node_modules/neo-async/async.js b/node_modules/neo-async/async.js new file mode 100644 index 0000000..e78eb16 --- /dev/null +++ b/node_modules/neo-async/async.js @@ -0,0 +1,9184 @@ +(function(global, factory) { + /*jshint -W030 */ + 'use strict'; + typeof exports === 'object' && typeof module !== 'undefined' + ? factory(exports) + : typeof define === 'function' && define.amd + ? define(['exports'], factory) + : global.async + ? factory((global.neo_async = global.neo_async || {})) + : factory((global.async = global.async || {})); +})(this, function(exports) { + 'use strict'; + + var noop = function noop() {}; + var throwError = function throwError() { + throw new Error('Callback was already called.'); + }; + + var DEFAULT_TIMES = 5; + var DEFAULT_INTERVAL = 0; + + var obj = 'object'; + var func = 'function'; + var isArray = Array.isArray; + var nativeKeys = Object.keys; + var nativePush = Array.prototype.push; + var iteratorSymbol = typeof Symbol === func && Symbol.iterator; + + var nextTick, asyncNextTick, asyncSetImmediate; + createImmediate(); + + /** + * @memberof async + * @namespace each + * @param {Array|Object} collection + * @param {Function} iterator + * @param {Function} callback + * @example + * + * // array + * var order = []; + * var array = [1, 3, 2]; + * var iterator = function(num, done) { + * setTimeout(function() { + * order.push(num); + * done(); + * }, num * 10); + * }; + * async.each(array, iterator, function(err, res) { + * console.log(res); // undefined + * console.log(order); // [1, 2, 3] + * }); + * + * @example + * + * // array with index + * var order = []; + * var array = [1, 3, 2]; + * var iterator = function(num, index, done) { + * setTimeout(function() { + * order.push([num, index]); + * done(); + * }, num * 10); + * }; + * async.each(array, iterator, function(err, res) { + * console.log(res); // undefined + * console.log(order); // [[1, 0], [2, 2], [3, 1]] + * }); + * + * @example + * + * // object + * var order = []; + * var object = { a: 1, b: 3, c: 2 }; + * var iterator = function(num, done) { + * setTimeout(function() { + * order.push(num); + * done(); + * }, num * 10); + * }; + * async.each(object, iterator, function(err, res) { + * console.log(res); // undefined + * console.log(order); // [1, 2, 3] + * }); + * + * @example + * + * // object with key + * var order = []; + * var object = { a: 1, b: 3, c: 2 }; + * var iterator = function(num, key, done) { + * setTimeout(function() { + * order.push([num, key]); + * done(); + * }, num * 10); + * }; + * async.each(object, iterator, function(err, res) { + * console.log(res); // undefined + * console.log(order); // [[1, 'a'], [2, 'c'], [3, 'b']] + * }); + * + * @example + * + * // break + * var order = []; + * var array = [1, 3, 2]; + * var iterator = function(num, done) { + * setTimeout(function() { + * order.push(num); + * done(null, num !== 2); + * }, num * 10); + * }; + * async.each(array, iterator, function(err, res) { + * console.log(res); // undefined + * console.log(order); // [1, 2] + * }); + * + */ + var each = createEach(arrayEach, baseEach, symbolEach); + + /** + * @memberof async + * @namespace map + * @param {Array|Object} collection + * @param {Function} iterator + * @param {Function} callback + * @example + * + * // array + * var order = []; + * var array = [1, 3, 2]; + * var iterator = function(num, done) { + * setTimeout(function() { + * order.push(num); + * done(null, num); + * }, num * 10); + * }; + * async.map(array, iterator, function(err, res) { + * console.log(res); // [1, 3, 2]; + * console.log(order); // [1, 2, 3] + * }); + * + * @example + * + * // array with index + * var order = []; + * var array = [1, 3, 2]; + * var iterator = function(num, index, done) { + * setTimeout(function() { + * order.push([num, index]); + * done(null, num); + * }, num * 10); + * }; + * async.map(array, iterator, function(err, res) { + * console.log(res); // [1, 3, 2] + * console.log(order); // [[1, 0], [2, 2], [3, 1]] + * }); + * + * @example + * + * // object + * var order = []; + * var object = { a: 1, b: 3, c: 2 }; + * var iterator = function(num, done) { + * setTimeout(function() { + * order.push(num); + * done(null, num); + * }, num * 10); + * }; + * async.map(object, iterator, function(err, res) { + * console.log(res); // [1, 3, 2] + * console.log(order); // [1, 2, 3] + * }); + * + * @example + * + * // object with key + * var order = []; + * var object = { a: 1, b: 3, c: 2 }; + * var iterator = function(num, key, done) { + * setTimeout(function() { + * order.push([num, key]); + * done(null, num); + * }, num * 10); + * }; + * async.map(object, iterator, function(err, res) { + * console.log(res); // [1, 3, 2] + * console.log(order); // [[1, 'a'], [2, 'c'], [3, 'b']] + * }); + * + */ + var map = createMap(arrayEachIndex, baseEachIndex, symbolEachIndex, true); + + /** + * @memberof async + * @namespace mapValues + * @param {Array|Object} collection + * @param {Function} iterator + * @param {Function} callback + * @example + * + * // array + * var order = []; + * var array = [1, 3, 2]; + * var iterator = function(num, done) { + * setTimeout(function() { + * order.push(num); + * done(null, num); + * }, num * 10); + * }; + * async.mapValues(array, iterator, function(err, res) { + * console.log(res); // { '0': 1, '1': 3, '2': 2 } + * console.log(order); // [1, 2, 3] + * }); + * + * @example + * + * // array with index + * var order = []; + * var array = [1, 3, 2]; + * var iterator = function(num, index, done) { + * setTimeout(function() { + * order.push([num, index]); + * done(null, num); + * }, num * 10); + * }; + * async.mapValues(array, iterator, function(err, res) { + * console.log(res); // { '0': 1, '1': 3, '2': 2 } + * console.log(order); // [[1, 0], [2, 2], [3, 1]] + * }); + * + * @example + * + * // object + * var order = []; + * var object = { a: 1, b: 3, c: 2 }; + * var iterator = function(num, done) { + * setTimeout(function() { + * order.push(num); + * done(null, num); + * }, num * 10); + * }; + * async.mapValues(object, iterator, function(err, res) { + * console.log(res); // { a: 1, b: 3, c: 2 } + * console.log(order); // [1, 2, 3] + * }); + * + * @example + * + * // object with key + * var order = []; + * var object = { a: 1, b: 3, c: 2 }; + * var iterator = function(num, key, done) { + * setTimeout(function() { + * order.push([num, key]); + * done(null, num); + * }, num * 10); + * }; + * async.mapValues(object, iterator, function(err, res) { + * console.log(res); // { a: 1, b: 3, c: 2 } + * console.log(order); // [[1, 'a'], [2, 'c'], [3, 'b']] + * }); + * + */ + var mapValues = createMap(arrayEachIndex, baseEachKey, symbolEachKey, false); + + /** + * @memberof async + * @namespace filter + * @param {Array|Object} collection + * @param {Function} iterator + * @param {Function} callback + * @example + * + * // array + * var order = []; + * var array = [1, 3, 2]; + * var iterator = function(num, done) { + * setTimeout(function() { + * order.push(num); + * done(null, num % 2); + * }, num * 10); + * }; + * async.filter(array, iterator, function(err, res) { + * console.log(res); // [1, 3]; + * console.log(order); // [1, 2, 3] + * }); + * + * @example + * + * // array with index + * var order = []; + * var array = [1, 3, 2]; + * var iterator = function(num, index, done) { + * setTimeout(function() { + * order.push([num, index]); + * done(null, num % 2); + * }, num * 10); + * }; + * async.filter(array, iterator, function(err, res) { + * console.log(res); // [1, 3]; + * console.log(order); // [[1, 0], [2, 2], [3, 1]] + * }); + * + * @example + * + * // object + * var order = []; + * var object = { a: 1, b: 3, c: 2 }; + * var iterator = function(num, done) { + * setTimeout(function() { + * order.push(num); + * done(null, num % 2); + * }, num * 10); + * }; + * async.filter(object, iterator, function(err, res) { + * console.log(res); // [1, 3]; + * console.log(order); // [1, 2, 3] + * }); + * + * @example + * + * // object with key + * var order = []; + * var object = { a: 1, b: 3, c: 2 }; + * var iterator = function(num, key, done) { + * setTimeout(function() { + * order.push([num, key]); + * done(null, num % 2); + * }, num * 10); + * }; + * async.filter(object, iterator, function(err, res) { + * console.log(res); // [1, 3]; + * console.log(order); // [[1, 'a'], [2, 'c'], [3, 'b']] + * }); + * + */ + var filter = createFilter(arrayEachIndexValue, baseEachIndexValue, symbolEachIndexValue, true); + + /** + * @memberof async + * @namespace filterSeries + * @param {Array|Object} collection + * @param {Function} iterator + * @param {Function} callback + * @example + * + * // array + * var order = []; + * var array = [1, 3, 2]; + * var iterator = function(num, done) { + * setTimeout(function() { + * order.push(num); + * done(null, num % 2); + * }, num * 10); + * }; + * async.filterSeries(array, iterator, function(err, res) { + * console.log(res); // [1, 3]; + * console.log(order); // [1, 3, 2] + * }); + * + * @example + * + * // array with index + * var order = []; + * var array = [1, 3, 2]; + * var iterator = function(num, index, done) { + * setTimeout(function() { + * order.push([num, index]); + * done(null, num % 2); + * }, num * 10); + * }; + * async.filterSeries(array, iterator, function(err, res) { + * console.log(res); // [1, 3] + * console.log(order); // [[1, 0], [3, 1], [2, 2]] + * }); + * + * @example + * + * // object + * var order = []; + * var object = { a: 1, b: 3, c: 2 }; + * var iterator = function(num, done) { + * setTimeout(function() { + * order.push(num); + * done(null, num % 2); + * }, num * 10); + * }; + * async.filterSeries(object, iterator, function(err, res) { + * console.log(res); // [1, 3] + * console.log(order); // [1, 3, 2] + * }); + * + * @example + * + * // object with key + * var order = []; + * var object = { a: 1, b: 3, c: 2 }; + * var iterator = function(num, key, done) { + * setTimeout(function() { + * order.push([num, key]); + * done(null, num % 2); + * }, num * 10); + * }; + * async.filterSeries(object, iterator, function(err, res) { + * console.log(res); // [1, 3] + * console.log(order); // [[1, 'a'], [3, 'b'], [2, 'c']] + * }); + * + */ + var filterSeries = createFilterSeries(true); + + /** + * @memberof async + * @namespace filterLimit + * @param {Array|Object} collection + * @param {number} limit - limit >= 1 + * @param {Function} iterator + * @param {Function} callback + * @example + * + * // array + * var order = []; + * var array = [1, 5, 3, 4, 2]; + * var iterator = function(num, done) { + * setTimeout(function() { + * order.push(num); + * done(null, num % 2); + * }, num * 10); + * }; + * async.filterLimit(array, 2, iterator, function(err, res) { + * console.log(res); // [1, 5, 3] + * console.log(order); // [1, 3, 5, 2, 4] + * }); + * + * @example + * + * // array with index + * var order = []; + * var array = [1, 5, 3, 4, 2]; + * var iterator = function(num, index, done) { + * setTimeout(function() { + * order.push([num, index]); + * done(null, num % 2); + * }, num * 10); + * }; + * async.filterLimit(array, 2, iterator, function(err, res) { + * console.log(res); // [1, 5, 3] + * console.log(order); // [[1, 0], [3, 2], [5, 1], [2, 4], [4, 3]] + * }); + * + * @example + * + * // object + * var order = []; + * var object = { a: 1, b: 5, c: 3, d: 4, e: 2 }; + * var iterator = function(num, done) { + * setTimeout(function() { + * order.push(num); + * done(null, num % 2); + * }, num * 10); + * }; + * async.filterLimit(object, 2, iterator, function(err, res) { + * console.log(res); // [1, 5, 3] + * console.log(order); // [1, 3, 5, 2, 4] + * }); + * + * @example + * + * // object with key + * var order = []; + * var object = { a: 1, b: 5, c: 3, d: 4, e: 2 }; + * var iterator = function(num, key, done) { + * setTimeout(function() { + * order.push([num, key]); + * done(null, num % 2); + * }, num * 10); + * }; + * async.filterLimit(object, 2, iterator, function(err, res) { + * console.log(res); // [1, 5, 3] + * console.log(order); // [[1, 'a'], [3, 'c'], [5, 'b'], [2, 'e'], [4, 'd']] + * }); + * + */ + var filterLimit = createFilterLimit(true); + + /** + * @memberof async + * @namespace reject + * @param {Array|Object} collection + * @param {Function} iterator + * @param {Function} callback + * @example + * + * // array + * var order = []; + * var array = [1, 3, 2]; + * var iterator = function(num, done) { + * setTimeout(function() { + * order.push(num); + * done(null, num % 2); + * }, num * 10); + * }; + * async.reject(array, iterator, function(err, res) { + * console.log(res); // [2]; + * console.log(order); // [1, 2, 3] + * }); + * + * @example + * + * // array with index + * var order = []; + * var array = [1, 3, 2]; + * var iterator = function(num, index, done) { + * setTimeout(function() { + * order.push([num, index]); + * done(null, num % 2); + * }, num * 10); + * }; + * async.reject(array, iterator, function(err, res) { + * console.log(res); // [2]; + * console.log(order); // [[1, 0], [2, 2], [3, 1]] + * }); + * + * @example + * + * // object + * var order = []; + * var object = { a: 1, b: 3, c: 2 }; + * var iterator = function(num, done) { + * setTimeout(function() { + * order.push(num); + * done(null, num % 2); + * }, num * 10); + * }; + * async.reject(object, iterator, function(err, res) { + * console.log(res); // [2]; + * console.log(order); // [1, 2, 3] + * }); + * + * @example + * + * // object with key + * var order = []; + * var object = { a: 1, b: 3, c: 2 }; + * var iterator = function(num, key, done) { + * setTimeout(function() { + * order.push([num, key]); + * done(null, num % 2); + * }, num * 10); + * }; + * async.reject(object, iterator, function(err, res) { + * console.log(res); // [2]; + * console.log(order); // [[1, 'a'], [2, 'c'], [3, 'b']] + * }); + * + */ + var reject = createFilter(arrayEachIndexValue, baseEachIndexValue, symbolEachIndexValue, false); + + /** + * @memberof async + * @namespace rejectSeries + * @param {Array|Object} collection + * @param {Function} iterator + * @param {Function} callback + * @example + * + * // array + * var order = []; + * var array = [1, 3, 2]; + * var iterator = function(num, done) { + * setTimeout(function() { + * order.push(num); + * done(null, num % 2); + * }, num * 10); + * }; + * async.rejectSeries(array, iterator, function(err, res) { + * console.log(res); // [2]; + * console.log(order); // [1, 3, 2] + * }); + * + * @example + * + * // object + * var order = []; + * var object = { a: 1, b: 3, c: 2 }; + * var iterator = function(num, done) { + * setTimeout(function() { + * order.push(num); + * done(null, num % 2); + * }, num * 10); + * }; + * async.rejectSeries(object, iterator, function(err, res) { + * console.log(res); // [2]; + * console.log(order); // [1, 3, 2] + * }); + * + * @example + * + * // object with key + * var order = []; + * var object = { a: 1, b: 3, c: 2 }; + * var iterator = function(num, key, done) { + * setTimeout(function() { + * order.push([num, key]); + * done(null, num % 2); + * }, num * 10); + * }; + * async.rejectSeries(object, iterator, function(err, res) { + * console.log(res); // [2]; + * console.log(order); // [[1, 'a'], [3, 'b'], [2, 'c']] + * }); + * + */ + var rejectSeries = createFilterSeries(false); + + /** + * @memberof async + * @namespace rejectLimit + * @param {Array|Object} collection + * @param {number} limit - limit >= 1 + * @param {Function} iterator + * @param {Function} callback + * @example + * + * // array + * var order = []; + * var array = [1, 5, 3, 4, 2]; + * var iterator = function(num, done) { + * setTimeout(function() { + * order.push(num); + * done(null, num % 2); + * }, num * 10); + * }; + * async.rejectLimit(array, 2, iterator, function(err, res) { + * console.log(res); // [4, 2] + * console.log(order); // [1, 3, 5, 2, 4] + * }); + * + * @example + * + * // array with index + * var order = []; + * var array = [1, 5, 3, 4, 2]; + * var iterator = function(num, index, done) { + * setTimeout(function() { + * order.push([num, index]); + * done(null, num % 2); + * }, num * 10); + * }; + * async.rejectLimit(array, 2, iterator, function(err, res) { + * console.log(res); // [4, 2] + * console.log(order); // [[1, 0], [3, 2], [5, 1], [2, 4], [4, 3]] + * }); + * + * @example + * + * // object + * var order = []; + * var object = { a: 1, b: 5, c: 3, d: 4, e: 2 }; + * var iterator = function(num, done) { + * setTimeout(function() { + * order.push(num); + * done(null, num % 2); + * }, num * 10); + * }; + * async.rejectLimit(object, 2, iterator, function(err, res) { + * console.log(res); // [4, 2] + * console.log(order); // [1, 3, 5, 2, 4] + * }); + * + * @example + * + * // object with key + * var order = []; + * var object = { a: 1, b: 5, c: 3, d: 4, e: 2 }; + * var iterator = function(num, key, done) { + * setTimeout(function() { + * order.push([num, key]); + * done(null, num % 2); + * }, num * 10); + * }; + * async.rejectLimit(object, 2, iterator, function(err, res) { + * console.log(res); // [4, 2] + * console.log(order); // [[1, 'a'], [3, 'c'], [5, 'b'], [2, 'e'], [4, 'd']] + * }); + * + */ + var rejectLimit = createFilterLimit(false); + + /** + * @memberof async + * @namespace detect + * @param {Array|Object} collection + * @param {Function} iterator + * @param {Function} callback + * @example + * + * // array + * var order = []; + * var array = [1, 3, 2]; + * var iterator = function(num, done) { + * setTimeout(function() { + * order.push(num); + * done(null, num % 2); + * }, num * 10); + * }; + * async.detect(array, iterator, function(err, res) { + * console.log(res); // 1 + * console.log(order); // [1] + * }); + * + * @example + * + * // array with index + * var order = []; + * var array = [1, 3, 2]; + * var iterator = function(num, index, done) { + * setTimeout(function() { + * order.push([num, index]); + * done(null, num % 2); + * }, num * 10); + * }; + * async.detect(array, iterator, function(err, res) { + * console.log(res); // 1 + * console.log(order); // [[1, 0]] + * }); + * + * @example + * + * // object + * var order = []; + * var object = { a: 1, b: 3, c: 2 }; + * var iterator = function(num, done) { + * setTimeout(function() { + * order.push(num); + * done(null, num % 2); + * }, num * 10); + * }; + * async.detect(object, iterator, function(err, res) { + * console.log(res); // 1 + * console.log(order); // [1] + * }); + * + * @example + * + * // object with key + * var order = []; + * var object = { a: 1, b: 3, c: 2 }; + * var iterator = function(num, key, done) { + * setTimeout(function() { + * order.push([num, key]); + * done(null, num % 2); + * }, num * 10); + * }; + * async.detect(object, iterator, function(err, res) { + * console.log(res); // 1 + * console.log(order); // [[1, 'a']] + * }); + * + */ + var detect = createDetect(arrayEachValue, baseEachValue, symbolEachValue, true); + + /** + * @memberof async + * @namespace detectSeries + * @param {Array|Object} collection + * @param {Function} iterator + * @param {Function} callback + * @example + * + * // array + * var order = []; + * var array = [1, 3, 2]; + * var iterator = function(num, done) { + * setTimeout(function() { + * order.push(num); + * done(null, num % 2); + * }, num * 10); + * }; + * async.detectSeries(array, iterator, function(err, res) { + * console.log(res); // 1 + * console.log(order); // [1] + * }); + * + * @example + * + * // array with index + * var order = []; + * var array = [1, 3, 2]; + * var iterator = function(num, index, done) { + * setTimeout(function() { + * order.push([num, index]); + * done(null, num % 2); + * }, num * 10); + * }; + * async.detectSeries(array, iterator, function(err, res) { + * console.log(res); // 1 + * console.log(order); // [[1, 0]] + * }); + * + * @example + * + * // object + * var order = []; + * var object = { a: 1, b: 3, c: 2 }; + * var iterator = function(num, done) { + * setTimeout(function() { + * order.push(num); + * done(null, num % 2); + * }, num * 10); + * }; + * async.detectSeries(object, iterator, function(err, res) { + * console.log(res); // 1 + * console.log(order); // [1] + * }); + * + * @example + * + * // object with key + * var order = []; + * var object = { a: 1, b: 3, c: 2 }; + * var iterator = function(num, key, done) { + * setTimeout(function() { + * order.push([num, key]); + * done(null, num % 2); + * }, num * 10); + * }; + * async.detectSeries(object, iterator, function(err, res) { + * console.log(res); // 1 + * console.log(order); // [[1, 'a']] + * }); + * + */ + var detectSeries = createDetectSeries(true); + + /** + * @memberof async + * @namespace detectLimit + * @param {Array|Object} collection + * @param {number} limit - limit >= 1 + * @param {Function} iterator + * @param {Function} callback + * @example + * + * // array + * var order = []; + * var array = [1, 5, 3, 4, 2]; + * var iterator = function(num, done) { + * setTimeout(function() { + * order.push(num); + * done(null, num % 2); + * }, num * 10); + * }; + * async.detectLimit(array, 2, iterator, function(err, res) { + * console.log(res); // 1 + * console.log(order); // [1] + * }); + * + * @example + * + * // array with index + * var order = []; + * var array = [1, 5, 3, 4, 2]; + * var iterator = function(num, index, done) { + * setTimeout(function() { + * order.push([num, index]); + * done(null, num % 2); + * }, num * 10); + * }; + * async.detectLimit(array, 2, iterator, function(err, res) { + * console.log(res); // 1 + * console.log(order); // [[1, 0]] + * }); + * + * @example + * + * // object + * var order = []; + * var object = { a: 1, b: 5, c: 3, d: 4, e: 2 }; + * var iterator = function(num, done) { + * setTimeout(function() { + * order.push(num); + * done(null, num % 2); + * }, num * 10); + * }; + * async.detectLimit(object, 2, iterator, function(err, res) { + * console.log(res); // 1 + * console.log(order); // [1] + * }); + * + * @example + * + * // object with key + * var order = []; + * var object = { a: 1, b: 5, c: 3, d: 4, e: 2 }; + * var iterator = function(num, key, done) { + * setTimeout(function() { + * order.push([num, key]); + * done(null, num % 2); + * }, num * 10); + * }; + * async.detectLimit(object, 2, iterator, function(err, res) { + * console.log(res); // 1 + * console.log(order); // [[1, 'a']] + * }); + * + */ + var detectLimit = createDetectLimit(true); + + /** + * @memberof async + * @namespace every + * @param {Array|Object} collection + * @param {Function} iterator + * @param {Function} callback + * @example + * + * // array + * var order = []; + * var array = [1, 3, 2]; + * var iterator = function(num, done) { + * setTimeout(function() { + * order.push(num); + * done(null, num % 2); + * }, num * 10); + * }; + * async.every(array, iterator, function(err, res) { + * console.log(res); // false + * console.log(order); // [1, 2] + * }); + * + * @example + * + * // array with index + * var order = []; + * var array = [1, 3, 2]; + * var iterator = function(num, index, done) { + * setTimeout(function() { + * order.push([num, index]); + * done(null, num % 2); + * }, num * 10); + * }; + * async.every(array, iterator, function(err, res) { + * console.log(res); // false + * console.log(order); // [[1, 0], [2, 2]] + * }); + * + * @example + * + * // object + * var order = []; + * var object = { a: 1, b: 3, c: 2 }; + * var iterator = function(num, done) { + * setTimeout(function() { + * order.push(num); + * done(null, num % 2); + * }, num * 10); + * }; + * async.every(object, iterator, function(err, res) { + * console.log(res); // false + * console.log(order); // [1, 2] + * }); + * + * @example + * + * // object with key + * var order = []; + * var object = { a: 1, b: 3, c: 2 }; + * var iterator = function(num, key, done) { + * setTimeout(function() { + * order.push([num, key]); + * done(null, num % 2); + * }, num * 10); + * }; + * async.every(object, iterator, function(err, res) { + * console.log(res); // false + * console.log(order); // [[1, 'a'], [2, 'c']] + * }); + * + */ + var every = createEvery(arrayEachValue, baseEachValue, symbolEachValue); + + /** + * @memberof async + * @namespace everySeries + * @param {Array|Object} collection + * @param {Function} iterator + * @param {Function} callback + * @example + * + * // array + * var order = []; + * var array = [1, 3, 2]; + * var iterator = function(num, done) { + * setTimeout(function() { + * order.push(num); + * done(null, num % 2); + * }, num * 10); + * }; + * async.everySeries(array, iterator, function(err, res) { + * console.log(res); // false + * console.log(order); // [1, 3, 2] + * }); + * + * @example + * + * // array with index + * var order = []; + * var array = [1, 3, 2]; + * var iterator = function(num, index, done) { + * setTimeout(function() { + * order.push([num, index]); + * done(null, num % 2); + * }, num * 10); + * }; + * async.everySeries(array, iterator, function(err, res) { + * console.log(res); // false + * console.log(order); // [[1, 0], [3, 1], [2, 2]] + * }); + * + * @example + * + * // object + * var order = []; + * var object = { a: 1, b: 3, c: 2 }; + * var iterator = function(num, done) { + * setTimeout(function() { + * order.push(num); + * done(null, num % 2); + * }, num * 10); + * }; + * async.everySeries(object, iterator, function(err, res) { + * console.log(res); // false + * console.log(order); // [1, 3, 2] + * }); + * + * @example + * + * // object with key + * var order = []; + * var object = { a: 1, b: 3, c: 2 }; + * var iterator = function(num, key, done) { + * setTimeout(function() { + * order.push([num, key]); + * done(null, num % 2); + * }, num * 10); + * }; + * async.everySeries(object, iterator, function(err, res) { + * console.log(res); // false + * console.log(order); // [[1, 'a'], [3, 'b'] [2, 'c']] + * }); + * + */ + var everySeries = createEverySeries(); + + /** + * @memberof async + * @namespace everyLimit + * @param {Array|Object} collection + * @param {number} limit - limit >= 1 + * @param {Function} iterator + * @param {Function} callback + * @example + * + * // array + * var order = []; + * var array = [1, 5, 3, 4, 2]; + * var iterator = function(num, done) { + * setTimeout(function() { + * order.push(num); + * done(null, num % 2); + * }, num * 10); + * }; + * async.everyLimit(array, 2, iterator, function(err, res) { + * console.log(res); // false + * console.log(order); // [1, 3, 5, 2] + * }); + * + * @example + * + * // array with index + * var order = []; + * var array = [1, 5, 3, 4, 2]; + * var iterator = function(num, index, done) { + * setTimeout(function() { + * order.push([num, index]); + * done(null, num % 2); + * }, num * 10); + * }; + * async.everyLimit(array, 2, iterator, function(err, res) { + * console.log(res); // false + * console.log(order); // [[1, 0], [3, 2], [5, 1], [2, 4]] + * }); + * + * @example + * + * // object + * var order = []; + * var object = { a: 1, b: 5, c: 3, d: 4, e: 2 }; + * var iterator = function(num, done) { + * setTimeout(function() { + * order.push(num); + * done(null, num % 2); + * }, num * 10); + * }; + * async.everyLimit(object, 2, iterator, function(err, res) { + * console.log(res); // false + * console.log(order); // [1, 3, 5, 2] + * }); + * + * @example + * + * // object with key + * var order = []; + * var object = { a: 1, b: 5, c: 3, d: 4, e: 2 }; + * var iterator = function(num, key, done) { + * setTimeout(function() { + * order.push([num, key]); + * done(null, num % 2); + * }, num * 10); + * }; + * async.everyLimit(object, 2, iterator, function(err, res) { + * console.log(res); // false + * console.log(order); // [[1, 'a'], [3, 'c'], [5, 'b'], [2, 'e']] + * }); + * + */ + var everyLimit = createEveryLimit(); + + /** + * @memberof async + * @namespace pick + * @param {Array|Object} collection + * @param {Function} iterator + * @param {Function} callback + * @example + * + * // array + * var order = []; + * var array = [1, 3, 2, 4]; + * var iterator = function(num, done) { + * setTimeout(function() { + * order.push(num); + * done(null, num % 2); + * }, num * 10); + * }; + * async.pick(array, iterator, function(err, res) { + * console.log(res); // { '0': 1, '1': 3 } + * console.log(order); // [1, 2, 3, 4] + * }); + * + * @example + * + * // array with index + * var order = []; + * var array = [1, 3, 2, 4]; + * var iterator = function(num, index, done) { + * setTimeout(function() { + * order.push([num, index]); + * done(null, num % 2); + * }, num * 10); + * }; + * async.pick(array, iterator, function(err, res) { + * console.log(res); // { '0': 1, '1': 3 } + * console.log(order); // [[0, 1], [2, 2], [3, 1], [4, 3]] + * }); + * + * @example + * + * // object + * var order = []; + * var object = { a: 1, b: 3, c: 2, d: 4 }; + * var iterator = function(num, done) { + * setTimeout(function() { + * order.push(num); + * done(null, num % 2); + * }, num * 10); + * }; + * async.pick(object, iterator, function(err, res) { + * console.log(res); // { a: 1, b: 3 } + * console.log(order); // [1, 2, 3, 4] + * }); + * + * @example + * + * // object with key + * var order = []; + * var object = { a: 1, b: 3, c: 2, d: 4 }; + * var iterator = function(num, key, done) { + * setTimeout(function() { + * order.push([num, key]); + * done(null, num % 2); + * }, num * 10); + * }; + * async.pick(object, iterator, function(err, res) { + * console.log(res); // { a: 1, b: 3 } + * console.log(order); // [[1, 'a'], [2, 'c'], [3, 'b'], [4, 'd']] + * }); + * + */ + var pick = createPick(arrayEachIndexValue, baseEachKeyValue, symbolEachKeyValue, true); + + /** + * @memberof async + * @namespace pickSeries + * @param {Array|Object} collection + * @param {Function} iterator + * @param {Function} callback + * @example + * + * // array + * var order = []; + * var array = [1, 3, 2, 4]; + * var iterator = function(num, done) { + * setTimeout(function() { + * order.push(num); + * done(null, num % 2); + * }, num * 10); + * }; + * async.pickSeries(array, iterator, function(err, res) { + * console.log(res); // { '0': 1, '1': 3 } + * console.log(order); // [1, 3, 2, 4] + * }); + * + * @example + * + * // array with index + * var order = []; + * var array = [1, 3, 2, 4]; + * var iterator = function(num, index, done) { + * setTimeout(function() { + * order.push([num, index]); + * done(null, num % 2); + * }, num * 10); + * }; + * async.pickSeries(array, iterator, function(err, res) { + * console.log(res); // { '0': 1, '1': 3 } + * console.log(order); // [[0, 1], [3, 1], [2, 2], [4, 3]] + * }); + * + * @example + * + * // object + * var order = []; + * var object = { a: 1, b: 3, c: 2, d: 4 }; + * var iterator = function(num, done) { + * setTimeout(function() { + * order.push(num); + * done(null, num % 2); + * }, num * 10); + * }; + * async.pickSeries(object, iterator, function(err, res) { + * console.log(res); // { a: 1, b: 3 } + * console.log(order); // [1, 3, 2, 4] + * }); + * + * @example + * + * // object with key + * var order = []; + * var object = { a: 1, b: 3, c: 2, d: 4 }; + * var iterator = function(num, key, done) { + * setTimeout(function() { + * order.push([num, key]); + * done(null, num % 2); + * }, num * 10); + * }; + * async.pickSeries(object, iterator, function(err, res) { + * console.log(res); // { a: 1, b: 3 } + * console.log(order); // [[1, 'a'], [3, 'b'], [2, 'c'], [4, 'd']] + * }); + * + */ + var pickSeries = createPickSeries(true); + + /** + * @memberof async + * @namespace pickLimit + * @param {Array|Object} collection + * @param {number} limit - limit >= 1 + * @param {Function} iterator + * @param {Function} callback + * @example + * + * // array + * var order = []; + * var array = [1, 5, 3, 4, 2]; + * var iterator = function(num, done) { + * setTimeout(function() { + * order.push(num); + * done(null, num % 2); + * }, num * 10); + * }; + * async.pickLimit(array, 2, iterator, function(err, res) { + * console.log(res); // { '0': 1, '1': 5, '2': 3 } + * console.log(order); // [1, 3, 5, 2, 4] + * }); + * + * @example + * + * // array with index + * var order = []; + * var array = [1, 5, 3, 4, 2]; + * var iterator = function(num, index, done) { + * setTimeout(function() { + * order.push([num, index]); + * done(null, num % 2); + * }, num * 10); + * }; + * async.pickLimit(array, 2, iterator, function(err, res) { + * console.log(res); // { '0': 1, '1': 5, '2': 3 } + * console.log(order); // [[1, 0], [3, 2], [5, 1], [2, 4], [4, 3]] + * }); + * + * @example + * + * // object + * var order = []; + * var object = { a: 1, b: 5, c: 3, d: 4, e: 2 }; + * var iterator = function(num, done) { + * setTimeout(function() { + * order.push(num); + * done(null, num % 2); + * }, num * 10); + * }; + * async.pickLimit(object, 2, iterator, function(err, res) { + * console.log(res); // { a: 1, b: 5, c: 3 } + * console.log(order); // [1, 3, 5, 2, 4] + * }); + * + * @example + * + * // object with key + * var order = []; + * var object = { a: 1, b: 5, c: 3, d: 4, e: 2 }; + * var iterator = function(num, key, done) { + * setTimeout(function() { + * order.push([num, key]); + * done(null, num % 2); + * }, num * 10); + * }; + * async.pickLimit(object, 2, iterator, function(err, res) { + * console.log(res); // { a: 1, b: 5, c: 3 } + * console.log(order); // [[1, 'a'], [3, 'c'], [5, 'b'], [2, 'e'], [4, 'd']] + * }); + * + */ + var pickLimit = createPickLimit(true); + + /** + * @memberof async + * @namespace omit + * @param {Array|Object} collection + * @param {Function} iterator + * @param {Function} callback + * @example + * + * // array + * var order = []; + * var array = [1, 3, 2, 4]; + * var iterator = function(num, done) { + * setTimeout(function() { + * order.push(num); + * done(null, num % 2); + * }, num * 10); + * }; + * async.omit(array, iterator, function(err, res) { + * console.log(res); // { '2': 2, '3': 4 } + * console.log(order); // [1, 2, 3, 4] + * }); + * + * @example + * + * // array with index + * var order = []; + * var array = [1, 3, 2, 4]; + * var iterator = function(num, index, done) { + * setTimeout(function() { + * order.push([num, index]); + * done(null, num % 2); + * }, num * 10); + * }; + * async.omit(array, iterator, function(err, res) { + * console.log(res); // { '2': 2, '3': 4 } + * console.log(order); // [[0, 1], [2, 2], [3, 1], [4, 3]] + * }); + * + * @example + * + * // object + * var order = []; + * var object = { a: 1, b: 3, c: 2, d: 4 }; + * var iterator = function(num, done) { + * setTimeout(function() { + * order.push(num); + * done(null, num % 2); + * }, num * 10); + * }; + * async.omit(object, iterator, function(err, res) { + * console.log(res); // { c: 2, d: 4 } + * console.log(order); // [1, 2, 3, 4] + * }); + * + * @example + * + * // object with key + * var order = []; + * var object = { a: 1, b: 3, c: 2, d: 4 }; + * var iterator = function(num, key, done) { + * setTimeout(function() { + * order.push([num, key]); + * done(null, num % 2); + * }, num * 10); + * }; + * async.omit(object, iterator, function(err, res) { + * console.log(res); // { c: 2, d: 4 } + * console.log(order); // [[1, 'a'], [2, 'c'], [3, 'b'], [4, 'd']] + * }); + * + */ + var omit = createPick(arrayEachIndexValue, baseEachKeyValue, symbolEachKeyValue, false); + + /** + * @memberof async + * @namespace omitSeries + * @param {Array|Object} collection + * @param {Function} iterator + * @param {Function} callback + * @example + * + * // array + * var order = []; + * var array = [1, 3, 2, 4]; + * var iterator = function(num, done) { + * setTimeout(function() { + * order.push(num); + * done(null, num % 2); + * }, num * 10); + * }; + * async.omitSeries(array, iterator, function(err, res) { + * console.log(res); // { '2': 2, '3': 4 } + * console.log(order); // [1, 3, 2, 4] + * }); + * + * @example + * + * // array with index + * var order = []; + * var array = [1, 3, 2, 4]; + * var iterator = function(num, index, done) { + * setTimeout(function() { + * order.push([num, index]); + * done(null, num % 2); + * }, num * 10); + * }; + * async.omitSeries(array, iterator, function(err, res) { + * console.log(res); // { '2': 2, '3': 4 } + * console.log(order); // [[0, 1], [3, 1], [2, 2], [4, 3]] + * }); + * + * @example + * + * // object + * var order = []; + * var object = { a: 1, b: 3, c: 2, d: 4 }; + * var iterator = function(num, done) { + * setTimeout(function() { + * order.push(num); + * done(null, num % 2); + * }, num * 10); + * }; + * async.omitSeries(object, iterator, function(err, res) { + * console.log(res); // { c: 2, d: 4 } + * console.log(order); // [1, 3, 2, 4] + * }); + * + * @example + * + * // object with key + * var order = []; + * var object = { a: 1, b: 3, c: 2, d: 4 }; + * var iterator = function(num, key, done) { + * setTimeout(function() { + * order.push([num, key]); + * done(null, num % 2); + * }, num * 10); + * }; + * async.omitSeries(object, iterator, function(err, res) { + * console.log(res); // { c: 2, d: 4 } + * console.log(order); // [[1, 'a'], [3, 'b'], [2, 'c'], [4, 'd']] + * }); + * + */ + var omitSeries = createPickSeries(false); + + /** + * @memberof async + * @namespace omitLimit + * @param {Array|Object} collection + * @param {number} limit - limit >= 1 + * @param {Function} iterator + * @param {Function} callback + * @example + * + * // array + * var order = []; + * var array = [1, 5, 3, 4, 2]; + * var iterator = function(num, done) { + * setTimeout(function() { + * order.push(num); + * done(null, num % 2); + * }, num * 10); + * }; + * async.omitLimit(array, 2, iterator, function(err, res) { + * console.log(res); // { '3': 4, '4': 2 } + * console.log(order); // [1, 3, 5, 2, 4] + * }); + * + * @example + * + * // array with index + * var order = []; + * var array = [1, 5, 3, 4, 2]; + * var iterator = function(num, index, done) { + * setTimeout(function() { + * order.push([num, index]); + * done(null, num % 2); + * }, num * 10); + * }; + * async.omitLimit(array, 2, iterator, function(err, res) { + * console.log(res); // { '3': 4, '4': 2 } + * console.log(order); // [[1, 0], [3, 2], [5, 1], [2, 4], [4, 3]] + * }); + * + * @example + * + * // object + * var order = []; + * var object = { a: 1, b: 5, c: 3, d: 4, e: 2 }; + * var iterator = function(num, done) { + * setTimeout(function() { + * order.push(num); + * done(null, num % 2); + * }, num * 10); + * }; + * async.omitLimit(object, 2, iterator, function(err, res) { + * console.log(res); // { d: 4, e: 2 } + * console.log(order); // [1, 3, 5, 2, 4] + * }); + * + * @example + * + * // object with key + * var order = []; + * var object = { a: 1, b: 5, c: 3, d: 4, e: 2 }; + * var iterator = function(num, key, done) { + * setTimeout(function() { + * order.push([num, key]); + * done(null, num % 2); + * }, num * 10); + * }; + * async.omitLimit(object, 2, iterator, function(err, res) { + * console.log(res); // { d: 4, e: 2 } + * console.log(order); // [[1, 'a'], [3, 'c'], [5, 'b'], [2, 'e'], [4, 'd']] + * }); + * + */ + var omitLimit = createPickLimit(false); + + /** + * @memberof async + * @namespace transform + * @param {Array|Object} collection + * @param {Array|Object|Function} [accumulator] + * @param {Function} [iterator] + * @param {Function} [callback] + * @example + * + * // array + * var order = []; + * var collection = [1, 3, 2, 4]; + * var iterator = function(result, num, done) { + * setTimeout(function() { + * order.push(num); + * result.push(num) + * done(); + * }, num * 10); + * }; + * async.transform(collection, iterator, function(err, res) { + * console.log(res); // [1, 2, 3, 4] + * console.log(order); // [1, 2, 3, 4] + * }); + * + * @example + * + * // array with index and accumulator + * var order = []; + * var collection = [1, 3, 2, 4]; + * var iterator = function(result, num, index, done) { + * setTimeout(function() { + * order.push([num, index]); + * result[index] = num; + * done(); + * }, num * 10); + * }; + * async.transform(collection, {}, iterator, function(err, res) { + * console.log(res); // { '0': 1, '1': 3, '2': 2, '3': 4 } + * console.log(order); // [[1, 0], [2, 2], [3, 1], [4, 3]] + * }); + * + * @example + * + * // object with accumulator + * var order = []; + * var object = { a: 1, b: 3, c: 2, d: 4 }; + * var iterator = function(result, num, done) { + * setTimeout(function() { + * order.push(num); + * result.push(num); + * done(); + * }, num * 10); + * }; + * async.transform(collection, [], iterator, function(err, res) { + * console.log(res); // [1, 2, 3, 4] + * console.log(order); // [1, 2, 3, 4] + * }); + * + * @example + * + * // object with key + * var order = []; + * var object = { a: 1, b: 3, c: 2, d: 4 }; + * var iterator = function(result, num, key, done) { + * setTimeout(function() { + * order.push([num, key]); + * result[key] = num; + * done(); + * }, num * 10); + * }; + * async.transform(collection, iterator, function(err, res) { + * console.log(res); // { a: 1, b: 3, c: 2, d: 4 } + * console.log(order); // [[1, 'a'], [2, 'c'], [3, 'b'], [4, 'd']] + * }); + * + */ + var transform = createTransform(arrayEachResult, baseEachResult, symbolEachResult); + + /** + * @memberof async + * @namespace sortBy + * @param {Array|Object} collection + * @param {Function} iterator + * @param {Function} callback + * @example + * + * // array + * var order = []; + * var array = [1, 3, 2]; + * var iterator = function(num, done) { + * setTimeout(function() { + * order.push(num); + * done(null, num); + * }, num * 10); + * }; + * async.sortBy(array, iterator, function(err, res) { + * console.log(res); // [1, 2, 3]; + * console.log(order); // [1, 2, 3] + * }); + * + * @example + * + * // array with index + * var order = []; + * var array = [1, 3, 2]; + * var iterator = function(num, index, done) { + * setTimeout(function() { + * order.push([num, index]); + * done(null, num); + * }, num * 10); + * }; + * async.sortBy(array, iterator, function(err, res) { + * console.log(res); // [1, 2, 3] + * console.log(order); // [[1, 0], [2, 2], [3, 1]] + * }); + * + * @example + * + * // object + * var order = []; + * var object = { a: 1, b: 3, c: 2 }; + * var iterator = function(num, done) { + * setTimeout(function() { + * order.push(num); + * done(null, num); + * }, num * 10); + * }; + * async.sortBy(object, iterator, function(err, res) { + * console.log(res); // [1, 2, 3] + * console.log(order); // [1, 2, 3] + * }); + * + * @example + * + * // object with key + * var order = []; + * var object = { a: 1, b: 3, c: 2 }; + * var iterator = function(num, key, done) { + * setTimeout(function() { + * order.push([num, key]); + * done(null, num); + * }, num * 10); + * }; + * async.sortBy(object, iterator, function(err, res) { + * console.log(res); // [1, 2, 3] + * console.log(order); // [[1, 'a'], [2, 'c'], [3, 'b']] + * }); + * + */ + var sortBy = createSortBy(arrayEachIndexValue, baseEachIndexValue, symbolEachIndexValue); + + /** + * @memberof async + * @namespace concat + * @param {Array|Object} collection + * @param {Function} iterator + * @param {Function} callback + * @example + * + * // array + * var order = []; + * var array = [1, 3, 2]; + * var iterator = function(num, done) { + * setTimeout(function() { + * order.push(num); + * done(null, [num]); + * }, num * 10); + * }; + * async.concat(array, iterator, function(err, res) { + * console.log(res); // [1, 2, 3]; + * console.log(order); // [1, 2, 3] + * }); + * + * @example + * + * // array with index + * var order = []; + * var array = [1, 3, 2]; + * var iterator = function(num, index, done) { + * setTimeout(function() { + * order.push([num, index]); + * done(null, [num]); + * }, num * 10); + * }; + * async.concat(array, iterator, function(err, res) { + * console.log(res); // [1, 2, 3] + * console.log(order); // [[1, 0], [2, 2], [3, 1]] + * }); + * + * @example + * + * // object + * var order = []; + * var object = { a: 1, b: 3, c: 2 }; + * var iterator = function(num, done) { + * setTimeout(function() { + * order.push(num); + * done(null, [num]); + * }, num * 10); + * }; + * async.concat(object, iterator, function(err, res) { + * console.log(res); // [1, 2, 3] + * console.log(order); // [1, 2, 3] + * }); + * + * @example + * + * // object with key + * var order = []; + * var object = { a: 1, b: 3, c: 2 }; + * var iterator = function(num, key, done) { + * setTimeout(function() { + * order.push([num, key]); + * done(null, [num]); + * }, num * 10); + * }; + * async.concat(object, iterator, function(err, res) { + * console.log(res); // [1, 2, 3] + * console.log(order); // [[1, 'a'], [2, 'c'], [3, 'b']] + * }); + * + */ + var concat = createConcat(arrayEachIndex, baseEachIndex, symbolEachIndex); + + /** + * @memberof async + * @namespace groupBy + * @param {Array|Object} collection + * @param {Function} iterator + * @param {Function} callback + * @example + * + * // array + * var order = []; + * var array = [4.2, 6.4, 6.1]; + * var iterator = function(num, done) { + * setTimeout(function() { + * order.push(num); + * done(null, Math.floor(num)); + * }, num * 10); + * }; + * async.groupBy(array, iterator, function(err, res) { + * console.log(res); // { '4': [4.2], '6': [6.1, 6.4] } + * console.log(order); // [4.2, 6.1, 6.4] + * }); + * + * @example + * + * // array with index + * var order = []; + * var array = [4.2, 6.4, 6.1]; + * var iterator = function(num, index, done) { + * setTimeout(function() { + * order.push([num, index]); + * done(null, Math.floor(num)); + * }, num * 10); + * }; + * async.groupBy(array, iterator, function(err, res) { + * console.log(res); // { '4': [4.2], '6': [6.1, 6.4] } + * console.log(order); // [[4.2, 0], [6.1, 2], [6.4, 1]] + * }); + * + * @example + * + * // object + * var order = []; + * var object = { a: 4.2, b: 6.4, c: 6.1 }; + * var iterator = function(num, done) { + * setTimeout(function() { + * order.push(num); + * done(null, Math.floor(num)); + * }, num * 10); + * }; + * async.groupBy(object, iterator, function(err, res) { + * console.log(res); // { '4': [4.2], '6': [6.1, 6.4] } + * console.log(order); // [4.2, 6.1, 6.4] + * }); + * + * @example + * + * // object with key + * var order = []; + * var object = { a: 4.2, b: 6.4, c: 6.1 }; + * var iterator = function(num, key, done) { + * setTimeout(function() { + * order.push([num, key]); + * done(null, Math.floor(num)); + * }, num * 10); + * }; + * async.groupBy(object, iterator, function(err, res) { + * console.log(res); // { '4': [4.2], '6': [6.1, 6.4] } + * console.log(order); // [[4.2, 'a'], [6.1, 'c'], [6.4, 'b']] + * }); + * + */ + var groupBy = createGroupBy(arrayEachValue, baseEachValue, symbolEachValue); + + /** + * @memberof async + * @namespace parallel + * @param {Array|Object} tasks - functions + * @param {Function} callback + * @example + * + * var order = []; + * var tasks = [ + * function(done) { + * setTimeout(function() { + * order.push(1); + * done(null, 1); + * }, 10); + * }, + * function(done) { + * setTimeout(function() { + * order.push(2); + * done(null, 2); + * }, 30); + * }, + * function(done) { + * setTimeout(function() { + * order.push(3); + * done(null, 3); + * }, 40); + * }, + * function(done) { + * setTimeout(function() { + * order.push(4); + * done(null, 4); + * }, 20); + * } + * ]; + * async.parallel(tasks, function(err, res) { + * console.log(res); // [1, 2, 3, 4]; + * console.log(order); // [1, 4, 2, 3] + * }); + * + * @example + * + * var order = []; + * var tasks = { + * 'a': function(done) { + * setTimeout(function() { + * order.push(1); + * done(null, 1); + * }, 10); + * }, + * 'b': function(done) { + * setTimeout(function() { + * order.push(2); + * done(null, 2); + * }, 30); + * }, + * 'c': function(done) { + * setTimeout(function() { + * order.push(3); + * done(null, 3); + * }, 40); + * }, + * 'd': function(done) { + * setTimeout(function() { + * order.push(4); + * done(null, 4); + * }, 20); + * } + * }; + * async.parallel(tasks, function(err, res) { + * console.log(res); // { a: 1, b: 2, c: 3, d:4 } + * console.log(order); // [1, 4, 2, 3] + * }); + * + */ + var parallel = createParallel(arrayEachFunc, baseEachFunc); + + /** + * @memberof async + * @namespace applyEach + */ + var applyEach = createApplyEach(map); + + /** + * @memberof async + * @namespace applyEachSeries + */ + var applyEachSeries = createApplyEach(mapSeries); + + /** + * @memberof async + * @namespace log + */ + var log = createLogger('log'); + + /** + * @memberof async + * @namespace dir + */ + var dir = createLogger('dir'); + + /** + * @version 2.6.2 + * @namespace async + */ + var index = { + VERSION: '2.6.2', + + // Collections + each: each, + eachSeries: eachSeries, + eachLimit: eachLimit, + forEach: each, + forEachSeries: eachSeries, + forEachLimit: eachLimit, + eachOf: each, + eachOfSeries: eachSeries, + eachOfLimit: eachLimit, + forEachOf: each, + forEachOfSeries: eachSeries, + forEachOfLimit: eachLimit, + map: map, + mapSeries: mapSeries, + mapLimit: mapLimit, + mapValues: mapValues, + mapValuesSeries: mapValuesSeries, + mapValuesLimit: mapValuesLimit, + filter: filter, + filterSeries: filterSeries, + filterLimit: filterLimit, + select: filter, + selectSeries: filterSeries, + selectLimit: filterLimit, + reject: reject, + rejectSeries: rejectSeries, + rejectLimit: rejectLimit, + detect: detect, + detectSeries: detectSeries, + detectLimit: detectLimit, + find: detect, + findSeries: detectSeries, + findLimit: detectLimit, + pick: pick, + pickSeries: pickSeries, + pickLimit: pickLimit, + omit: omit, + omitSeries: omitSeries, + omitLimit: omitLimit, + reduce: reduce, + inject: reduce, + foldl: reduce, + reduceRight: reduceRight, + foldr: reduceRight, + transform: transform, + transformSeries: transformSeries, + transformLimit: transformLimit, + sortBy: sortBy, + sortBySeries: sortBySeries, + sortByLimit: sortByLimit, + some: some, + someSeries: someSeries, + someLimit: someLimit, + any: some, + anySeries: someSeries, + anyLimit: someLimit, + every: every, + everySeries: everySeries, + everyLimit: everyLimit, + all: every, + allSeries: everySeries, + allLimit: everyLimit, + concat: concat, + concatSeries: concatSeries, + concatLimit: concatLimit, + groupBy: groupBy, + groupBySeries: groupBySeries, + groupByLimit: groupByLimit, + + // Control Flow + parallel: parallel, + series: series, + parallelLimit: parallelLimit, + tryEach: tryEach, + waterfall: waterfall, + angelFall: angelFall, + angelfall: angelFall, + whilst: whilst, + doWhilst: doWhilst, + until: until, + doUntil: doUntil, + during: during, + doDuring: doDuring, + forever: forever, + compose: compose, + seq: seq, + applyEach: applyEach, + applyEachSeries: applyEachSeries, + queue: queue, + priorityQueue: priorityQueue, + cargo: cargo, + auto: auto, + autoInject: autoInject, + retry: retry, + retryable: retryable, + iterator: iterator, + times: times, + timesSeries: timesSeries, + timesLimit: timesLimit, + race: race, + + // Utils + apply: apply, + nextTick: asyncNextTick, + setImmediate: asyncSetImmediate, + memoize: memoize, + unmemoize: unmemoize, + ensureAsync: ensureAsync, + constant: constant, + asyncify: asyncify, + wrapSync: asyncify, + log: log, + dir: dir, + reflect: reflect, + reflectAll: reflectAll, + timeout: timeout, + createLogger: createLogger, + + // Mode + safe: safe, + fast: fast + }; + + exports['default'] = index; + baseEachSync( + index, + function(func, key) { + exports[key] = func; + }, + nativeKeys(index) + ); + + /** + * @private + */ + function createImmediate(safeMode) { + var delay = function delay(fn) { + var args = slice(arguments, 1); + setTimeout(function() { + fn.apply(null, args); + }); + }; + asyncSetImmediate = typeof setImmediate === func ? setImmediate : delay; + if (typeof process === obj && typeof process.nextTick === func) { + nextTick = /^v0.10/.test(process.version) ? asyncSetImmediate : process.nextTick; + asyncNextTick = /^v0/.test(process.version) ? asyncSetImmediate : process.nextTick; + } else { + asyncNextTick = nextTick = asyncSetImmediate; + } + if (safeMode === false) { + nextTick = function(cb) { + cb(); + }; + } + } + + /* sync functions based on lodash */ + + /** + * Converts `arguments` to an array. + * + * @private + * @param {Array} array = The array to slice. + */ + function createArray(array) { + var index = -1; + var size = array.length; + var result = Array(size); + + while (++index < size) { + result[index] = array[index]; + } + return result; + } + + /** + * Create an array from `start` + * + * @private + * @param {Array} array - The array to slice. + * @param {number} start - The start position. + */ + function slice(array, start) { + var end = array.length; + var index = -1; + var size = end - start; + if (size <= 0) { + return []; + } + var result = Array(size); + + while (++index < size) { + result[index] = array[index + start]; + } + return result; + } + + /** + * @private + * @param {Object} object + */ + function objectClone(object) { + var keys = nativeKeys(object); + var size = keys.length; + var index = -1; + var result = {}; + + while (++index < size) { + var key = keys[index]; + result[key] = object[key]; + } + return result; + } + + /** + * Create an array with all falsey values removed. + * + * @private + * @param {Array} array - The array to compact. + */ + function compact(array) { + var index = -1; + var size = array.length; + var result = []; + + while (++index < size) { + var value = array[index]; + if (value) { + result[result.length] = value; + } + } + return result; + } + + /** + * Create an array of reverse sequence. + * + * @private + * @param {Array} array - The array to reverse. + */ + function reverse(array) { + var index = -1; + var size = array.length; + var result = Array(size); + var resIndex = size; + + while (++index < size) { + result[--resIndex] = array[index]; + } + return result; + } + + /** + * Checks if key exists in object property. + * + * @private + * @param {Object} object - The object to inspect. + * @param {string} key - The key to check. + */ + function has(object, key) { + return object.hasOwnProperty(key); + } + + /** + * Check if target exists in array. + * @private + * @param {Array} array + * @param {*} target + */ + function notInclude(array, target) { + var index = -1; + var size = array.length; + + while (++index < size) { + if (array[index] === target) { + return false; + } + } + return true; + } + + /** + * @private + * @param {Array} array - The array to iterate over. + * @param {Function} iterator - The function invoked per iteration. + */ + function arrayEachSync(array, iterator) { + var index = -1; + var size = array.length; + + while (++index < size) { + iterator(array[index], index); + } + return array; + } + + /** + * @private + * @param {Object} object - The object to iterate over. + * @param {Function} iterator - The function invoked per iteration. + * @param {Array} keys + */ + function baseEachSync(object, iterator, keys) { + var index = -1; + var size = keys.length; + + while (++index < size) { + var key = keys[index]; + iterator(object[key], key); + } + return object; + } + + /** + * @private + * @param {number} n + * @param {Function} iterator + */ + function timesSync(n, iterator) { + var index = -1; + while (++index < n) { + iterator(index); + } + } + + /** + * @private + * @param {Array} array + * @param {number[]} criteria + */ + function sortByCriteria(array, criteria) { + var l = array.length; + var indices = Array(l); + var i; + for (i = 0; i < l; i++) { + indices[i] = i; + } + quickSort(criteria, 0, l - 1, indices); + var result = Array(l); + for (var n = 0; n < l; n++) { + i = indices[n]; + result[n] = i === undefined ? array[n] : array[i]; + } + return result; + } + + function partition(array, i, j, mid, indices) { + var l = i; + var r = j; + while (l <= r) { + i = l; + while (l < r && array[l] < mid) { + l++; + } + while (r >= i && array[r] >= mid) { + r--; + } + if (l > r) { + break; + } + swap(array, indices, l++, r--); + } + return l; + } + + function swap(array, indices, l, r) { + var n = array[l]; + array[l] = array[r]; + array[r] = n; + var i = indices[l]; + indices[l] = indices[r]; + indices[r] = i; + } + + function quickSort(array, i, j, indices) { + if (i === j) { + return; + } + var k = i; + while (++k <= j && array[i] === array[k]) { + var l = k - 1; + if (indices[l] > indices[k]) { + var index = indices[l]; + indices[l] = indices[k]; + indices[k] = index; + } + } + if (k > j) { + return; + } + var p = array[i] > array[k] ? i : k; + k = partition(array, i, j, array[p], indices); + quickSort(array, i, k - 1, indices); + quickSort(array, k, j, indices); + } + + /** + * @Private + */ + function makeConcatResult(array) { + var result = []; + arrayEachSync(array, function(value) { + if (value === noop) { + return; + } + if (isArray(value)) { + nativePush.apply(result, value); + } else { + result.push(value); + } + }); + return result; + } + + /* async functions */ + + /** + * @private + */ + function arrayEach(array, iterator, callback) { + var index = -1; + var size = array.length; + + if (iterator.length === 3) { + while (++index < size) { + iterator(array[index], index, onlyOnce(callback)); + } + } else { + while (++index < size) { + iterator(array[index], onlyOnce(callback)); + } + } + } + + /** + * @private + */ + function baseEach(object, iterator, callback, keys) { + var key; + var index = -1; + var size = keys.length; + + if (iterator.length === 3) { + while (++index < size) { + key = keys[index]; + iterator(object[key], key, onlyOnce(callback)); + } + } else { + while (++index < size) { + iterator(object[keys[index]], onlyOnce(callback)); + } + } + } + + /** + * @private + */ + function symbolEach(collection, iterator, callback) { + var iter = collection[iteratorSymbol](); + var index = 0; + var item; + if (iterator.length === 3) { + while ((item = iter.next()).done === false) { + iterator(item.value, index++, onlyOnce(callback)); + } + } else { + while ((item = iter.next()).done === false) { + index++; + iterator(item.value, onlyOnce(callback)); + } + } + return index; + } + + /** + * @private + */ + function arrayEachResult(array, result, iterator, callback) { + var index = -1; + var size = array.length; + + if (iterator.length === 4) { + while (++index < size) { + iterator(result, array[index], index, onlyOnce(callback)); + } + } else { + while (++index < size) { + iterator(result, array[index], onlyOnce(callback)); + } + } + } + + /** + * @private + */ + function baseEachResult(object, result, iterator, callback, keys) { + var key; + var index = -1; + var size = keys.length; + + if (iterator.length === 4) { + while (++index < size) { + key = keys[index]; + iterator(result, object[key], key, onlyOnce(callback)); + } + } else { + while (++index < size) { + iterator(result, object[keys[index]], onlyOnce(callback)); + } + } + } + + /** + * @private + */ + function symbolEachResult(collection, result, iterator, callback) { + var item; + var index = 0; + var iter = collection[iteratorSymbol](); + + if (iterator.length === 4) { + while ((item = iter.next()).done === false) { + iterator(result, item.value, index++, onlyOnce(callback)); + } + } else { + while ((item = iter.next()).done === false) { + index++; + iterator(result, item.value, onlyOnce(callback)); + } + } + return index; + } + + /** + * @private + */ + function arrayEachFunc(array, createCallback) { + var index = -1; + var size = array.length; + + while (++index < size) { + array[index](createCallback(index)); + } + } + + /** + * @private + */ + function baseEachFunc(object, createCallback, keys) { + var key; + var index = -1; + var size = keys.length; + + while (++index < size) { + key = keys[index]; + object[key](createCallback(key)); + } + } + + /** + * @private + */ + function arrayEachIndex(array, iterator, createCallback) { + var index = -1; + var size = array.length; + + if (iterator.length === 3) { + while (++index < size) { + iterator(array[index], index, createCallback(index)); + } + } else { + while (++index < size) { + iterator(array[index], createCallback(index)); + } + } + } + + /** + * @private + */ + function baseEachIndex(object, iterator, createCallback, keys) { + var key; + var index = -1; + var size = keys.length; + + if (iterator.length === 3) { + while (++index < size) { + key = keys[index]; + iterator(object[key], key, createCallback(index)); + } + } else { + while (++index < size) { + iterator(object[keys[index]], createCallback(index)); + } + } + } + + /** + * @private + */ + function symbolEachIndex(collection, iterator, createCallback) { + var item; + var index = 0; + var iter = collection[iteratorSymbol](); + + if (iterator.length === 3) { + while ((item = iter.next()).done === false) { + iterator(item.value, index, createCallback(index++)); + } + } else { + while ((item = iter.next()).done === false) { + iterator(item.value, createCallback(index++)); + } + } + return index; + } + + /** + * @private + */ + function baseEachKey(object, iterator, createCallback, keys) { + var key; + var index = -1; + var size = keys.length; + + if (iterator.length === 3) { + while (++index < size) { + key = keys[index]; + iterator(object[key], key, createCallback(key)); + } + } else { + while (++index < size) { + key = keys[index]; + iterator(object[key], createCallback(key)); + } + } + } + + /** + * @private + */ + function symbolEachKey(collection, iterator, createCallback) { + var item; + var index = 0; + var iter = collection[iteratorSymbol](); + + if (iterator.length === 3) { + while ((item = iter.next()).done === false) { + iterator(item.value, index, createCallback(index++)); + } + } else { + while ((item = iter.next()).done === false) { + iterator(item.value, createCallback(index++)); + } + } + return index; + } + + /** + * @private + */ + function arrayEachValue(array, iterator, createCallback) { + var value; + var index = -1; + var size = array.length; + + if (iterator.length === 3) { + while (++index < size) { + value = array[index]; + iterator(value, index, createCallback(value)); + } + } else { + while (++index < size) { + value = array[index]; + iterator(value, createCallback(value)); + } + } + } + + /** + * @private + */ + function baseEachValue(object, iterator, createCallback, keys) { + var key, value; + var index = -1; + var size = keys.length; + + if (iterator.length === 3) { + while (++index < size) { + key = keys[index]; + value = object[key]; + iterator(value, key, createCallback(value)); + } + } else { + while (++index < size) { + value = object[keys[index]]; + iterator(value, createCallback(value)); + } + } + } + + /** + * @private + */ + function symbolEachValue(collection, iterator, createCallback) { + var value, item; + var index = 0; + var iter = collection[iteratorSymbol](); + + if (iterator.length === 3) { + while ((item = iter.next()).done === false) { + value = item.value; + iterator(value, index++, createCallback(value)); + } + } else { + while ((item = iter.next()).done === false) { + index++; + value = item.value; + iterator(value, createCallback(value)); + } + } + return index; + } + + /** + * @private + */ + function arrayEachIndexValue(array, iterator, createCallback) { + var value; + var index = -1; + var size = array.length; + + if (iterator.length === 3) { + while (++index < size) { + value = array[index]; + iterator(value, index, createCallback(index, value)); + } + } else { + while (++index < size) { + value = array[index]; + iterator(value, createCallback(index, value)); + } + } + } + + /** + * @private + */ + function baseEachIndexValue(object, iterator, createCallback, keys) { + var key, value; + var index = -1; + var size = keys.length; + + if (iterator.length === 3) { + while (++index < size) { + key = keys[index]; + value = object[key]; + iterator(value, key, createCallback(index, value)); + } + } else { + while (++index < size) { + value = object[keys[index]]; + iterator(value, createCallback(index, value)); + } + } + } + + /** + * @private + */ + function symbolEachIndexValue(collection, iterator, createCallback) { + var value, item; + var index = 0; + var iter = collection[iteratorSymbol](); + + if (iterator.length === 3) { + while ((item = iter.next()).done === false) { + value = item.value; + iterator(value, index, createCallback(index++, value)); + } + } else { + while ((item = iter.next()).done === false) { + value = item.value; + iterator(value, createCallback(index++, value)); + } + } + return index; + } + + /** + * @private + */ + function baseEachKeyValue(object, iterator, createCallback, keys) { + var key, value; + var index = -1; + var size = keys.length; + + if (iterator.length === 3) { + while (++index < size) { + key = keys[index]; + value = object[key]; + iterator(value, key, createCallback(key, value)); + } + } else { + while (++index < size) { + key = keys[index]; + value = object[key]; + iterator(value, createCallback(key, value)); + } + } + } + + /** + * @private + */ + function symbolEachKeyValue(collection, iterator, createCallback) { + var value, item; + var index = 0; + var iter = collection[iteratorSymbol](); + + if (iterator.length === 3) { + while ((item = iter.next()).done === false) { + value = item.value; + iterator(value, index, createCallback(index++, value)); + } + } else { + while ((item = iter.next()).done === false) { + value = item.value; + iterator(value, createCallback(index++, value)); + } + } + return index; + } + + /** + * @private + * @param {Function} func + */ + function onlyOnce(func) { + return function(err, res) { + var fn = func; + func = throwError; + fn(err, res); + }; + } + + /** + * @private + * @param {Function} func + */ + function once(func) { + return function(err, res) { + var fn = func; + func = noop; + fn(err, res); + }; + } + + /** + * @private + * @param {Function} arrayEach + * @param {Function} baseEach + */ + function createEach(arrayEach, baseEach, symbolEach) { + return function each(collection, iterator, callback) { + callback = once(callback || noop); + var size, keys; + var completed = 0; + if (isArray(collection)) { + size = collection.length; + arrayEach(collection, iterator, done); + } else if (!collection) { + } else if (iteratorSymbol && collection[iteratorSymbol]) { + size = symbolEach(collection, iterator, done); + size && size === completed && callback(null); + } else if (typeof collection === obj) { + keys = nativeKeys(collection); + size = keys.length; + baseEach(collection, iterator, done, keys); + } + if (!size) { + callback(null); + } + + function done(err, bool) { + if (err) { + callback = once(callback); + callback(err); + } else if (++completed === size) { + callback(null); + } else if (bool === false) { + callback = once(callback); + callback(null); + } + } + }; + } + + /** + * @private + * @param {Function} arrayEach + * @param {Function} baseEach + * @param {Function} symbolEach + */ + function createMap(arrayEach, baseEach, symbolEach, useArray) { + var init, clone; + if (useArray) { + init = Array; + clone = createArray; + } else { + init = function() { + return {}; + }; + clone = objectClone; + } + + return function(collection, iterator, callback) { + callback = callback || noop; + var size, keys, result; + var completed = 0; + + if (isArray(collection)) { + size = collection.length; + result = init(size); + arrayEach(collection, iterator, createCallback); + } else if (!collection) { + } else if (iteratorSymbol && collection[iteratorSymbol]) { + // TODO: size could be changed + result = init(0); + size = symbolEach(collection, iterator, createCallback); + size && size === completed && callback(null, result); + } else if (typeof collection === obj) { + keys = nativeKeys(collection); + size = keys.length; + result = init(size); + baseEach(collection, iterator, createCallback, keys); + } + if (!size) { + callback(null, init()); + } + + function createCallback(key) { + return function done(err, res) { + if (key === null) { + throwError(); + } + if (err) { + key = null; + callback = once(callback); + callback(err, clone(result)); + return; + } + result[key] = res; + key = null; + if (++completed === size) { + callback(null, result); + } + }; + } + }; + } + + /** + * @private + * @param {Function} arrayEach + * @param {Function} baseEach + * @param {Function} symbolEach + * @param {boolean} bool + */ + function createFilter(arrayEach, baseEach, symbolEach, bool) { + return function(collection, iterator, callback) { + callback = callback || noop; + var size, keys, result; + var completed = 0; + + if (isArray(collection)) { + size = collection.length; + result = Array(size); + arrayEach(collection, iterator, createCallback); + } else if (!collection) { + } else if (iteratorSymbol && collection[iteratorSymbol]) { + result = []; + size = symbolEach(collection, iterator, createCallback); + size && size === completed && callback(null, compact(result)); + } else if (typeof collection === obj) { + keys = nativeKeys(collection); + size = keys.length; + result = Array(size); + baseEach(collection, iterator, createCallback, keys); + } + if (!size) { + return callback(null, []); + } + + function createCallback(index, value) { + return function done(err, res) { + if (index === null) { + throwError(); + } + if (err) { + index = null; + callback = once(callback); + callback(err); + return; + } + if (!!res === bool) { + result[index] = value; + } + index = null; + if (++completed === size) { + callback(null, compact(result)); + } + }; + } + }; + } + + /** + * @private + * @param {boolean} bool + */ + function createFilterSeries(bool) { + return function(collection, iterator, callback) { + callback = onlyOnce(callback || noop); + var size, key, value, keys, iter, item, iterate; + var sync = false; + var completed = 0; + var result = []; + + if (isArray(collection)) { + size = collection.length; + iterate = iterator.length === 3 ? arrayIteratorWithIndex : arrayIterator; + } else if (!collection) { + } else if (iteratorSymbol && collection[iteratorSymbol]) { + size = Infinity; + iter = collection[iteratorSymbol](); + iterate = iterator.length === 3 ? symbolIteratorWithKey : symbolIterator; + } else if (typeof collection === obj) { + keys = nativeKeys(collection); + size = keys.length; + iterate = iterator.length === 3 ? objectIteratorWithKey : objectIterator; + } + if (!size) { + return callback(null, []); + } + iterate(); + + function arrayIterator() { + value = collection[completed]; + iterator(value, done); + } + + function arrayIteratorWithIndex() { + value = collection[completed]; + iterator(value, completed, done); + } + + function symbolIterator() { + item = iter.next(); + value = item.value; + item.done ? callback(null, result) : iterator(value, done); + } + + function symbolIteratorWithKey() { + item = iter.next(); + value = item.value; + item.done ? callback(null, result) : iterator(value, completed, done); + } + + function objectIterator() { + key = keys[completed]; + value = collection[key]; + iterator(value, done); + } + + function objectIteratorWithKey() { + key = keys[completed]; + value = collection[key]; + iterator(value, key, done); + } + + function done(err, res) { + if (err) { + callback(err); + return; + } + if (!!res === bool) { + result[result.length] = value; + } + if (++completed === size) { + iterate = throwError; + callback(null, result); + } else if (sync) { + nextTick(iterate); + } else { + sync = true; + iterate(); + } + sync = false; + } + }; + } + + /** + * @private + * @param {boolean} bool + */ + function createFilterLimit(bool) { + return function(collection, limit, iterator, callback) { + callback = callback || noop; + var size, index, key, value, keys, iter, item, iterate, result; + var sync = false; + var started = 0; + var completed = 0; + + if (isArray(collection)) { + size = collection.length; + iterate = iterator.length === 3 ? arrayIteratorWithIndex : arrayIterator; + } else if (!collection) { + } else if (iteratorSymbol && collection[iteratorSymbol]) { + size = Infinity; + result = []; + iter = collection[iteratorSymbol](); + iterate = iterator.length === 3 ? symbolIteratorWithKey : symbolIterator; + } else if (typeof collection === obj) { + keys = nativeKeys(collection); + size = keys.length; + iterate = iterator.length === 3 ? objectIteratorWithKey : objectIterator; + } + if (!size || isNaN(limit) || limit < 1) { + return callback(null, []); + } + result = result || Array(size); + timesSync(limit > size ? size : limit, iterate); + + function arrayIterator() { + index = started++; + if (index < size) { + value = collection[index]; + iterator(value, createCallback(value, index)); + } + } + + function arrayIteratorWithIndex() { + index = started++; + if (index < size) { + value = collection[index]; + iterator(value, index, createCallback(value, index)); + } + } + + function symbolIterator() { + item = iter.next(); + if (item.done === false) { + value = item.value; + iterator(value, createCallback(value, started++)); + } else if (completed === started && iterator !== noop) { + iterator = noop; + callback(null, compact(result)); + } + } + + function symbolIteratorWithKey() { + item = iter.next(); + if (item.done === false) { + value = item.value; + iterator(value, started, createCallback(value, started++)); + } else if (completed === started && iterator !== noop) { + iterator = noop; + callback(null, compact(result)); + } + } + + function objectIterator() { + index = started++; + if (index < size) { + value = collection[keys[index]]; + iterator(value, createCallback(value, index)); + } + } + + function objectIteratorWithKey() { + index = started++; + if (index < size) { + key = keys[index]; + value = collection[key]; + iterator(value, key, createCallback(value, index)); + } + } + + function createCallback(value, index) { + return function(err, res) { + if (index === null) { + throwError(); + } + if (err) { + index = null; + iterate = noop; + callback = once(callback); + callback(err); + return; + } + if (!!res === bool) { + result[index] = value; + } + index = null; + if (++completed === size) { + callback = onlyOnce(callback); + callback(null, compact(result)); + } else if (sync) { + nextTick(iterate); + } else { + sync = true; + iterate(); + } + sync = false; + }; + } + }; + } + + /** + * @memberof async + * @namespace eachSeries + * @param {Array|Object} collection + * @param {Function} iterator + * @param {Function} callback + * @example + * + * // array + * var order = []; + * var array = [1, 3, 2]; + * var iterator = function(num, done) { + * setTimeout(function() { + * order.push(num); + * done(); + * }, num * 10); + * }; + * async.eachSeries(array, iterator, function(err, res) { + * console.log(res); // undefined + * console.log(order); // [1, 3, 2] + * }); + * + * @example + * + * // array with index + * var order = []; + * var array = [1, 3, 2]; + * var iterator = function(num, index, done) { + * setTimeout(function() { + * order.push([num, index]); + * done(); + * }, num * 10); + * }; + * async.eachSeries(array, iterator, function(err, res) { + * console.log(res); // undefined + * console.log(order); // [[1, 0], [3, 1], [2, 2]] + * }); + * + * @example + * + * // object + * var order = []; + * var object = { a: 1, b: 3, c: 2 }; + * var iterator = function(num, done) { + * setTimeout(function() { + * order.push(num); + * done(); + * }, num * 10); + * }; + * async.eachSeries(object, iterator, function(err, res) { + * console.log(res); // undefined + * console.log(order); // [1, 3, 2] + * }); + * + * @example + * + * // object with key + * var order = []; + * var object = { a: 1, b: 3, c: 2 }; + * var iterator = function(num, key, done) { + * setTimeout(function() { + * order.push([num, key]); + * done(); + * }, num * 10); + * }; + * async.eachSeries(object, iterator, function(err, res) { + * console.log(res); // undefined + * console.log(order); // [[1, 'a'], [3, 'b'], [2, 'b']] + * }); + * + * @example + * + * // break + * var order = []; + * var array = [1, 3, 2]; + * var iterator = function(num, done) { + * setTimeout(function() { + * order.push(num); + * done(null, num !== 3); + * }, num * 10); + * }; + * async.eachSeries(array, iterator, function(err, res) { + * console.log(res); // undefined + * console.log(order); // [1, 3] + * }); + */ + function eachSeries(collection, iterator, callback) { + callback = onlyOnce(callback || noop); + var size, key, keys, iter, item, iterate; + var sync = false; + var completed = 0; + + if (isArray(collection)) { + size = collection.length; + iterate = iterator.length === 3 ? arrayIteratorWithIndex : arrayIterator; + } else if (!collection) { + } else if (iteratorSymbol && collection[iteratorSymbol]) { + size = Infinity; + iter = collection[iteratorSymbol](); + iterate = iterator.length === 3 ? symbolIteratorWithKey : symbolIterator; + } else if (typeof collection === obj) { + keys = nativeKeys(collection); + size = keys.length; + iterate = iterator.length === 3 ? objectIteratorWithKey : objectIterator; + } + if (!size) { + return callback(null); + } + iterate(); + + function arrayIterator() { + iterator(collection[completed], done); + } + + function arrayIteratorWithIndex() { + iterator(collection[completed], completed, done); + } + + function symbolIterator() { + item = iter.next(); + item.done ? callback(null) : iterator(item.value, done); + } + + function symbolIteratorWithKey() { + item = iter.next(); + item.done ? callback(null) : iterator(item.value, completed, done); + } + + function objectIterator() { + iterator(collection[keys[completed]], done); + } + + function objectIteratorWithKey() { + key = keys[completed]; + iterator(collection[key], key, done); + } + + function done(err, bool) { + if (err) { + callback(err); + } else if (++completed === size || bool === false) { + iterate = throwError; + callback(null); + } else if (sync) { + nextTick(iterate); + } else { + sync = true; + iterate(); + } + sync = false; + } + } + + /** + * @memberof async + * @namespace eachLimit + * @param {Array|Object} collection + * @param {number} limit - limit >= 1 + * @param {Function} iterator + * @param {Function} callback + * @example + * + * // array + * var order = []; + * var array = [1, 5, 3, 4, 2]; + * var iterator = function(num, done) { + * setTimeout(function() { + * order.push(num); + * done(); + * }, num * 10); + * }; + * async.eachLimit(array, 2, iterator, function(err, res) { + * console.log(res); // undefined + * console.log(order); // [1, 3, 5, 2, 4] + * }); + * + * @example + * + * // array with index + * var order = []; + * var array = [1, 5, 3, 4, 2]; + * var iterator = function(num, index, done) { + * setTimeout(function() { + * order.push([num, index]); + * done(); + * }, num * 10); + * }; + * async.eachLimit(array, 2, iterator, function(err, res) { + * console.log(res); // undefined + * console.log(order); // [[1, 0], [3, 2], [5, 1], [2, 4], [4, 3]] + * }); + * + * @example + * + * // object + * var order = []; + * var object = { a: 1, b: 5, c: 3, d: 4, e: 2 }; + * var iterator = function(num, done) { + * setTimeout(function() { + * order.push(num); + * done(); + * }, num * 10); + * }; + * async.eachLimit(object, 2, iterator, function(err, res) { + * console.log(res); // undefined + * console.log(order); // [1, 3, 5, 2, 4] + * }); + * + * @example + * + * // object with key + * var order = []; + * var object = { a: 1, b: 5, c: 3, d: 4, e: 2 }; + * var iterator = function(num, key, done) { + * setTimeout(function() { + * order.push([num, key]); + * done(); + * }, num * 10); + * }; + * async.eachLimit(object, 2, iterator, function(err, res) { + * console.log(res); // undefined + * console.log(order); // [[1, 'a'], [3, 'c'], [5, 'b'], [2, 'e'], [4, 'd']] + * }); + * + * @example + * + * // break + * var order = []; + * var array = [1, 5, 3, 4, 2]; + * var iterator = function(num, done) { + * setTimeout(function() { + * order.push(num); + * done(null, num !== 5); + * }, num * 10); + * }; + * async.eachLimit(array, 2, iterator, function(err, res) { + * console.log(res); // undefined + * console.log(order); // [1, 3, 5] + * }); + * + */ + function eachLimit(collection, limit, iterator, callback) { + callback = callback || noop; + var size, index, key, keys, iter, item, iterate; + var sync = false; + var started = 0; + var completed = 0; + + if (isArray(collection)) { + size = collection.length; + iterate = iterator.length === 3 ? arrayIteratorWithIndex : arrayIterator; + } else if (!collection) { + } else if (iteratorSymbol && collection[iteratorSymbol]) { + size = Infinity; + iter = collection[iteratorSymbol](); + iterate = iterator.length === 3 ? symbolIteratorWithKey : symbolIterator; + } else if (typeof collection === obj) { + keys = nativeKeys(collection); + size = keys.length; + iterate = iterator.length === 3 ? objectIteratorWithKey : objectIterator; + } else { + return callback(null); + } + if (!size || isNaN(limit) || limit < 1) { + return callback(null); + } + timesSync(limit > size ? size : limit, iterate); + + function arrayIterator() { + if (started < size) { + iterator(collection[started++], done); + } + } + + function arrayIteratorWithIndex() { + index = started++; + if (index < size) { + iterator(collection[index], index, done); + } + } + + function symbolIterator() { + item = iter.next(); + if (item.done === false) { + started++; + iterator(item.value, done); + } else if (completed === started && iterator !== noop) { + iterator = noop; + callback(null); + } + } + + function symbolIteratorWithKey() { + item = iter.next(); + if (item.done === false) { + iterator(item.value, started++, done); + } else if (completed === started && iterator !== noop) { + iterator = noop; + callback(null); + } + } + + function objectIterator() { + if (started < size) { + iterator(collection[keys[started++]], done); + } + } + + function objectIteratorWithKey() { + index = started++; + if (index < size) { + key = keys[index]; + iterator(collection[key], key, done); + } + } + + function done(err, bool) { + if (err || bool === false) { + iterate = noop; + callback = once(callback); + callback(err); + } else if (++completed === size) { + iterator = noop; + iterate = throwError; + callback = onlyOnce(callback); + callback(null); + } else if (sync) { + nextTick(iterate); + } else { + sync = true; + iterate(); + } + sync = false; + } + } + + /** + * @memberof async + * @namespace mapSeries + * @param {Array|Object} collection + * @param {Function} iterator + * @param {Function} callback + * @example + * + * // array + * var order = []; + * var array = [1, 3, 2]; + * var iterator = function(num, done) { + * setTimeout(function() { + * order.push(num); + * done(null, num); + * }, num * 10); + * }; + * async.mapSeries(array, iterator, function(err, res) { + * console.log(res); // [1, 3, 2]; + * console.log(order); // [1, 3, 2] + * }); + * + * @example + * + * // array with index + * var order = []; + * var array = [1, 3, 2]; + * var iterator = function(num, index, done) { + * setTimeout(function() { + * order.push([num, index]); + * done(null, num); + * }, num * 10); + * }; + * async.mapSeries(array, iterator, function(err, res) { + * console.log(res); // [1, 3, 2] + * console.log(order); // [[1, 0], [3, 1], [2, 2]] + * }); + * + * @example + * + * // object + * var order = []; + * var object = { a: 1, b: 3, c: 2 }; + * var iterator = function(num, done) { + * setTimeout(function() { + * order.push(num); + * done(null, num); + * }, num * 10); + * }; + * async.mapSeries(object, iterator, function(err, res) { + * console.log(res); // [1, 3, 2] + * console.log(order); // [1, 3, 2] + * }); + * + * @example + * + * // object with key + * var order = []; + * var object = { a: 1, b: 3, c: 2 }; + * var iterator = function(num, key, done) { + * setTimeout(function() { + * order.push([num, key]); + * done(null, num); + * }, num * 10); + * }; + * async.mapSeries(object, iterator, function(err, res) { + * console.log(res); // [1, 3, 2] + * console.log(order); // [[1, 'a'], [3, 'b'], [2, 'c']] + * }); + * + */ + function mapSeries(collection, iterator, callback) { + callback = callback || noop; + var size, key, keys, iter, item, result, iterate; + var sync = false; + var completed = 0; + + if (isArray(collection)) { + size = collection.length; + iterate = iterator.length === 3 ? arrayIteratorWithIndex : arrayIterator; + } else if (!collection) { + } else if (iteratorSymbol && collection[iteratorSymbol]) { + size = Infinity; + result = []; + iter = collection[iteratorSymbol](); + iterate = iterator.length === 3 ? symbolIteratorWithKey : symbolIterator; + } else if (typeof collection === obj) { + keys = nativeKeys(collection); + size = keys.length; + iterate = iterator.length === 3 ? objectIteratorWithKey : objectIterator; + } + if (!size) { + return callback(null, []); + } + result = result || Array(size); + iterate(); + + function arrayIterator() { + iterator(collection[completed], done); + } + + function arrayIteratorWithIndex() { + iterator(collection[completed], completed, done); + } + + function symbolIterator() { + item = iter.next(); + item.done ? callback(null, result) : iterator(item.value, done); + } + + function symbolIteratorWithKey() { + item = iter.next(); + item.done ? callback(null, result) : iterator(item.value, completed, done); + } + + function objectIterator() { + iterator(collection[keys[completed]], done); + } + + function objectIteratorWithKey() { + key = keys[completed]; + iterator(collection[key], key, done); + } + + function done(err, res) { + if (err) { + iterate = throwError; + callback = onlyOnce(callback); + callback(err, createArray(result)); + return; + } + result[completed] = res; + if (++completed === size) { + iterate = throwError; + callback(null, result); + callback = throwError; + } else if (sync) { + nextTick(iterate); + } else { + sync = true; + iterate(); + } + sync = false; + } + } + + /** + * @memberof async + * @namespace mapLimit + * @param {Array|Object} collection + * @param {number} limit - limit >= 1 + * @param {Function} iterator + * @param {Function} callback + * @example + * + * // array + * var order = []; + * var array = [1, 5, 3, 4, 2]; + * var iterator = function(num, done) { + * setTimeout(function() { + * order.push(num); + * done(null, num); + * }, num * 10); + * }; + * async.mapLimit(array, 2, iterator, function(err, res) { + * console.log(res); // [1, 5, 3, 4, 2] + * console.log(order); // [1, 3, 5, 2, 4] + * }); + * + * @example + * + * // array with index + * var order = []; + * var array = [1, 5, 3, 4, 2]; + * var iterator = function(num, index, done) { + * setTimeout(function() { + * order.push([num, index]); + * done(null, num); + * }, num * 10); + * }; + * async.mapLimit(array, 2, iterator, function(err, res) { + * console.log(res); // [1, 5, 3, 4, 2] + * console.log(order); // [[1, 0], [3, 2], [5, 1], [2, 4], [4, 3]] + * }); + * + * @example + * + * // object + * var order = []; + * var object = { a: 1, b: 5, c: 3, d: 4, e: 2 }; + * var iterator = function(num, done) { + * setTimeout(function() { + * order.push(num); + * done(null, num); + * }, num * 10); + * }; + * async.mapLimit(object, 2, iterator, function(err, res) { + * console.log(res); // [1, 5, 3, 4, 2] + * console.log(order); // [1, 3, 5, 2, 4] + * }); + * + * @example + * + * // object with key + * var order = []; + * var object = { a: 1, b: 5, c: 3, d: 4, e: 2 }; + * var iterator = function(num, key, done) { + * setTimeout(function() { + * order.push([num, key]); + * done(null, num); + * }, num * 10); + * }; + * async.mapLimit(object, 2, iterator, function(err, res) { + * console.log(res); // [1, 5, 3, 4, 2] + * console.log(order); // [[1, 'a'], [3, 'c'], [5, 'b'], [2, 'e'], [4, 'd']] + * }); + * + */ + function mapLimit(collection, limit, iterator, callback) { + callback = callback || noop; + var size, index, key, keys, iter, item, result, iterate; + var sync = false; + var started = 0; + var completed = 0; + + if (isArray(collection)) { + size = collection.length; + iterate = iterator.length === 3 ? arrayIteratorWithIndex : arrayIterator; + } else if (!collection) { + } else if (iteratorSymbol && collection[iteratorSymbol]) { + size = Infinity; + result = []; + iter = collection[iteratorSymbol](); + iterate = iterator.length === 3 ? symbolIteratorWithKey : symbolIterator; + } else if (typeof collection === obj) { + keys = nativeKeys(collection); + size = keys.length; + iterate = iterator.length === 3 ? objectIteratorWithKey : objectIterator; + } + if (!size || isNaN(limit) || limit < 1) { + return callback(null, []); + } + result = result || Array(size); + timesSync(limit > size ? size : limit, iterate); + + function arrayIterator() { + index = started++; + if (index < size) { + iterator(collection[index], createCallback(index)); + } + } + + function arrayIteratorWithIndex() { + index = started++; + if (index < size) { + iterator(collection[index], index, createCallback(index)); + } + } + + function symbolIterator() { + item = iter.next(); + if (item.done === false) { + iterator(item.value, createCallback(started++)); + } else if (completed === started && iterator !== noop) { + iterator = noop; + callback(null, result); + } + } + + function symbolIteratorWithKey() { + item = iter.next(); + if (item.done === false) { + iterator(item.value, started, createCallback(started++)); + } else if (completed === started && iterator !== noop) { + iterator = noop; + callback(null, result); + } + } + + function objectIterator() { + index = started++; + if (index < size) { + iterator(collection[keys[index]], createCallback(index)); + } + } + + function objectIteratorWithKey() { + index = started++; + if (index < size) { + key = keys[index]; + iterator(collection[key], key, createCallback(index)); + } + } + + function createCallback(index) { + return function(err, res) { + if (index === null) { + throwError(); + } + if (err) { + index = null; + iterate = noop; + callback = once(callback); + callback(err, createArray(result)); + return; + } + result[index] = res; + index = null; + if (++completed === size) { + iterate = throwError; + callback(null, result); + callback = throwError; + } else if (sync) { + nextTick(iterate); + } else { + sync = true; + iterate(); + } + sync = false; + }; + } + } + + /** + * @memberof async + * @namespace mapValuesSeries + * @param {Array|Object} collection + * @param {Function} iterator + * @param {Function} callback + * @example + * + * // array + * var order = []; + * var array = [1, 3, 2]; + * var iterator = function(num, done) { + * setTimeout(function() { + * order.push(num); + * done(null, num); + * }, num * 10); + * }; + * async.mapValuesSeries(array, iterator, function(err, res) { + * console.log(res); // { '0': 1, '1': 3, '2': 2 } + * console.log(order); // [1, 3, 2] + * }); + * + * @example + * + * // array with index + * var order = []; + * var array = [1, 3, 2]; + * var iterator = function(num, index, done) { + * setTimeout(function() { + * order.push([num, index]); + * done(null, num); + * }, num * 10); + * }; + * async.mapValuesSeries(array, iterator, function(err, res) { + * console.log(res); // { '0': 1, '1': 3, '2': 2 } + * console.log(order); // [[1, 0], [3, 1], [2, 2]] + * }); + * + * @example + * + * // object + * var order = []; + * var object = { a: 1, b: 3, c: 2 }; + * var iterator = function(num, done) { + * setTimeout(function() { + * order.push(num); + * done(null, num); + * }, num * 10); + * }; + * async.mapValuesSeries(object, iterator, function(err, res) { + * console.log(res); // { a: 1, b: 3, c: 2 } + * console.log(order); // [1, 3, 2] + * }); + * + * @example + * + * // object with key + * var order = []; + * var object = { a: 1, b: 3, c: 2 }; + * var iterator = function(num, key, done) { + * setTimeout(function() { + * order.push([num, key]); + * done(null, num); + * }, num * 10); + * }; + * async.mapValuesSeries(object, iterator, function(err, res) { + * console.log(res); // { a: 1, b: 3, c: 2 } + * console.log(order); // [[1, 'a'], [3, 'b'], [2, 'c']] + * }); + * + */ + function mapValuesSeries(collection, iterator, callback) { + callback = callback || noop; + var size, key, keys, iter, item, iterate; + var sync = false; + var result = {}; + var completed = 0; + + if (isArray(collection)) { + size = collection.length; + iterate = iterator.length === 3 ? arrayIteratorWithIndex : arrayIterator; + } else if (!collection) { + } else if (iteratorSymbol && collection[iteratorSymbol]) { + size = Infinity; + iter = collection[iteratorSymbol](); + iterate = iterator.length === 3 ? symbolIteratorWithKey : symbolIterator; + } else if (typeof collection === obj) { + keys = nativeKeys(collection); + size = keys.length; + iterate = iterator.length === 3 ? objectIteratorWithKey : objectIterator; + } + if (!size) { + return callback(null, result); + } + iterate(); + + function arrayIterator() { + key = completed; + iterator(collection[completed], done); + } + + function arrayIteratorWithIndex() { + key = completed; + iterator(collection[completed], completed, done); + } + + function symbolIterator() { + key = completed; + item = iter.next(); + item.done ? callback(null, result) : iterator(item.value, done); + } + + function symbolIteratorWithKey() { + key = completed; + item = iter.next(); + item.done ? callback(null, result) : iterator(item.value, completed, done); + } + + function objectIterator() { + key = keys[completed]; + iterator(collection[key], done); + } + + function objectIteratorWithKey() { + key = keys[completed]; + iterator(collection[key], key, done); + } + + function done(err, res) { + if (err) { + iterate = throwError; + callback = onlyOnce(callback); + callback(err, objectClone(result)); + return; + } + result[key] = res; + if (++completed === size) { + iterate = throwError; + callback(null, result); + callback = throwError; + } else if (sync) { + nextTick(iterate); + } else { + sync = true; + iterate(); + } + sync = false; + } + } + + /** + * @memberof async + * @namespace mapValuesLimit + * @param {Array|Object} collection + * @param {number} limit - limit >= 1 + * @param {Function} iterator + * @param {Function} callback + * @example + * + * // array + * var order = []; + * var array = [1, 5, 3, 4, 2]; + * var iterator = function(num, done) { + * setTimeout(function() { + * order.push(num); + * done(null, num); + * }, num * 10); + * }; + * async.mapValuesLimit(array, 2, iterator, function(err, res) { + * console.log(res); // { '0': 1, '1': 5, '2': 3, '3': 4, '4': 2 } + * console.log(order); // [1, 3, 5, 2, 4] + * }); + * + * @example + * + * // array with index + * var order = []; + * var array = [1, 5, 3, 4, 2]; + * var iterator = function(num, index, done) { + * setTimeout(function() { + * order.push([num, index]); + * done(null, num); + * }, num * 10); + * }; + * async.mapValuesLimit(array, 2, iterator, function(err, res) { + * console.log(res); // { '0': 1, '1': 5, '2': 3, '3': 4, '4': 2 } + * console.log(order); // [[1, 0], [3, 2], [5, 1], [2, 4], [4, 3]] + * }); + * + * @example + * + * // object + * var order = []; + * var object = { a: 1, b: 5, c: 3, d: 4, e: 2 }; + * var iterator = function(num, done) { + * setTimeout(function() { + * order.push(num); + * done(null, num); + * }, num * 10); + * }; + * async.mapValuesLimit(object, 2, iterator, function(err, res) { + * console.log(res); // { a: 1, b: 5, c: 3, d: 4, e: 2 } + * console.log(order); // [1, 3, 5, 2, 4] + * }); + * + * @example + * + * // object with key + * var order = []; + * var object = { a: 1, b: 5, c: 3, d: 4, e: 2 }; + * var iterator = function(num, key, done) { + * setTimeout(function() { + * order.push([num, key]); + * done(null, num); + * }, num * 10); + * }; + * async.mapValuesLimit(object, 2, iterator, function(err, res) { + * console.log(res); // { a: 1, b: 5, c: 3, d: 4, e: 2 } + * console.log(order); // [[1, 'a'], [3, 'c'], [5, 'b'], [2, 'e'], [4, 'd']] + * }); + * + */ + function mapValuesLimit(collection, limit, iterator, callback) { + callback = callback || noop; + var size, index, key, keys, iter, item, iterate; + var sync = false; + var result = {}; + var started = 0; + var completed = 0; + + if (isArray(collection)) { + size = collection.length; + iterate = iterator.length === 3 ? arrayIteratorWithIndex : arrayIterator; + } else if (!collection) { + } else if (iteratorSymbol && collection[iteratorSymbol]) { + size = Infinity; + iter = collection[iteratorSymbol](); + iterate = iterator.length === 3 ? symbolIteratorWithKey : symbolIterator; + } else if (typeof collection === obj) { + keys = nativeKeys(collection); + size = keys.length; + iterate = iterator.length === 3 ? objectIteratorWithKey : objectIterator; + } + if (!size || isNaN(limit) || limit < 1) { + return callback(null, result); + } + timesSync(limit > size ? size : limit, iterate); + + function arrayIterator() { + index = started++; + if (index < size) { + iterator(collection[index], createCallback(index)); + } + } + + function arrayIteratorWithIndex() { + index = started++; + if (index < size) { + iterator(collection[index], index, createCallback(index)); + } + } + + function symbolIterator() { + item = iter.next(); + if (item.done === false) { + iterator(item.value, createCallback(started++)); + } else if (completed === started && iterator !== noop) { + iterator = noop; + callback(null, result); + } + } + + function symbolIteratorWithKey() { + item = iter.next(); + if (item.done === false) { + iterator(item.value, started, createCallback(started++)); + } else if (completed === started && iterator !== noop) { + iterator = noop; + callback(null, result); + } + } + + function objectIterator() { + index = started++; + if (index < size) { + key = keys[index]; + iterator(collection[key], createCallback(key)); + } + } + + function objectIteratorWithKey() { + index = started++; + if (index < size) { + key = keys[index]; + iterator(collection[key], key, createCallback(key)); + } + } + + function createCallback(key) { + return function(err, res) { + if (key === null) { + throwError(); + } + if (err) { + key = null; + iterate = noop; + callback = once(callback); + callback(err, objectClone(result)); + return; + } + result[key] = res; + key = null; + if (++completed === size) { + callback(null, result); + } else if (sync) { + nextTick(iterate); + } else { + sync = true; + iterate(); + } + sync = false; + }; + } + } + + /** + * @private + * @param {Function} arrayEach + * @param {Function} baseEach + * @param {Function} symbolEach + * @param {boolean} bool + */ + function createDetect(arrayEach, baseEach, symbolEach, bool) { + return function(collection, iterator, callback) { + callback = callback || noop; + var size, keys; + var completed = 0; + + if (isArray(collection)) { + size = collection.length; + arrayEach(collection, iterator, createCallback); + } else if (!collection) { + } else if (iteratorSymbol && collection[iteratorSymbol]) { + size = symbolEach(collection, iterator, createCallback); + size && size === completed && callback(null); + } else if (typeof collection === obj) { + keys = nativeKeys(collection); + size = keys.length; + baseEach(collection, iterator, createCallback, keys); + } + if (!size) { + callback(null); + } + + function createCallback(value) { + var called = false; + return function done(err, res) { + if (called) { + throwError(); + } + called = true; + if (err) { + callback = once(callback); + callback(err); + } else if (!!res === bool) { + callback = once(callback); + callback(null, value); + } else if (++completed === size) { + callback(null); + } + }; + } + }; + } + + /** + * @private + * @param {boolean} bool + */ + function createDetectSeries(bool) { + return function(collection, iterator, callback) { + callback = onlyOnce(callback || noop); + var size, key, value, keys, iter, item, iterate; + var sync = false; + var completed = 0; + + if (isArray(collection)) { + size = collection.length; + iterate = iterator.length === 3 ? arrayIteratorWithIndex : arrayIterator; + } else if (!collection) { + } else if (iteratorSymbol && collection[iteratorSymbol]) { + size = Infinity; + iter = collection[iteratorSymbol](); + iterate = iterator.length === 3 ? symbolIteratorWithKey : symbolIterator; + } else if (typeof collection === obj) { + keys = nativeKeys(collection); + size = keys.length; + iterate = iterator.length === 3 ? objectIteratorWithKey : objectIterator; + } + if (!size) { + return callback(null); + } + iterate(); + + function arrayIterator() { + value = collection[completed]; + iterator(value, done); + } + + function arrayIteratorWithIndex() { + value = collection[completed]; + iterator(value, completed, done); + } + + function symbolIterator() { + item = iter.next(); + value = item.value; + item.done ? callback(null) : iterator(value, done); + } + + function symbolIteratorWithKey() { + item = iter.next(); + value = item.value; + item.done ? callback(null) : iterator(value, completed, done); + } + + function objectIterator() { + value = collection[keys[completed]]; + iterator(value, done); + } + + function objectIteratorWithKey() { + key = keys[completed]; + value = collection[key]; + iterator(value, key, done); + } + + function done(err, res) { + if (err) { + callback(err); + } else if (!!res === bool) { + iterate = throwError; + callback(null, value); + } else if (++completed === size) { + iterate = throwError; + callback(null); + } else if (sync) { + nextTick(iterate); + } else { + sync = true; + iterate(); + } + sync = false; + } + }; + } + + /** + * @private + * @param {boolean} bool + */ + function createDetectLimit(bool) { + return function(collection, limit, iterator, callback) { + callback = callback || noop; + var size, index, key, value, keys, iter, item, iterate; + var sync = false; + var started = 0; + var completed = 0; + + if (isArray(collection)) { + size = collection.length; + iterate = iterator.length === 3 ? arrayIteratorWithIndex : arrayIterator; + } else if (!collection) { + } else if (iteratorSymbol && collection[iteratorSymbol]) { + size = Infinity; + iter = collection[iteratorSymbol](); + iterate = iterator.length === 3 ? symbolIteratorWithKey : symbolIterator; + } else if (typeof collection === obj) { + keys = nativeKeys(collection); + size = keys.length; + iterate = iterator.length === 3 ? objectIteratorWithKey : objectIterator; + } + if (!size || isNaN(limit) || limit < 1) { + return callback(null); + } + timesSync(limit > size ? size : limit, iterate); + + function arrayIterator() { + index = started++; + if (index < size) { + value = collection[index]; + iterator(value, createCallback(value)); + } + } + + function arrayIteratorWithIndex() { + index = started++; + if (index < size) { + value = collection[index]; + iterator(value, index, createCallback(value)); + } + } + + function symbolIterator() { + item = iter.next(); + if (item.done === false) { + started++; + value = item.value; + iterator(value, createCallback(value)); + } else if (completed === started && iterator !== noop) { + iterator = noop; + callback(null); + } + } + + function symbolIteratorWithKey() { + item = iter.next(); + if (item.done === false) { + value = item.value; + iterator(value, started++, createCallback(value)); + } else if (completed === started && iterator !== noop) { + iterator = noop; + callback(null); + } + } + + function objectIterator() { + index = started++; + if (index < size) { + value = collection[keys[index]]; + iterator(value, createCallback(value)); + } + } + + function objectIteratorWithKey() { + if (started < size) { + key = keys[started++]; + value = collection[key]; + iterator(value, key, createCallback(value)); + } + } + + function createCallback(value) { + var called = false; + return function(err, res) { + if (called) { + throwError(); + } + called = true; + if (err) { + iterate = noop; + callback = once(callback); + callback(err); + } else if (!!res === bool) { + iterate = noop; + callback = once(callback); + callback(null, value); + } else if (++completed === size) { + callback(null); + } else if (sync) { + nextTick(iterate); + } else { + sync = true; + iterate(); + } + sync = false; + }; + } + }; + } + + /** + * @private + * @param {Function} arrayEach + * @param {Function} baseEach + * @param {Function} symbolEach + * @param {boolean} bool + */ + function createPick(arrayEach, baseEach, symbolEach, bool) { + return function(collection, iterator, callback) { + callback = callback || noop; + var size, keys; + var completed = 0; + var result = {}; + + if (isArray(collection)) { + size = collection.length; + arrayEach(collection, iterator, createCallback); + } else if (!collection) { + } else if (iteratorSymbol && collection[iteratorSymbol]) { + size = symbolEach(collection, iterator, createCallback); + size && size === completed && callback(null, result); + } else if (typeof collection === obj) { + keys = nativeKeys(collection); + size = keys.length; + baseEach(collection, iterator, createCallback, keys); + } + if (!size) { + return callback(null, {}); + } + + function createCallback(key, value) { + return function done(err, res) { + if (key === null) { + throwError(); + } + if (err) { + key = null; + callback = once(callback); + callback(err, objectClone(result)); + return; + } + if (!!res === bool) { + result[key] = value; + } + key = null; + if (++completed === size) { + callback(null, result); + } + }; + } + }; + } + + /** + * @private + * @param {boolean} bool + */ + function createPickSeries(bool) { + return function(collection, iterator, callback) { + callback = onlyOnce(callback || noop); + var size, key, value, keys, iter, item, iterate; + var sync = false; + var result = {}; + var completed = 0; + + if (isArray(collection)) { + size = collection.length; + iterate = iterator.length === 3 ? arrayIteratorWithIndex : arrayIterator; + } else if (!collection) { + } else if (iteratorSymbol && collection[iteratorSymbol]) { + size = Infinity; + iter = collection[iteratorSymbol](); + iterate = iterator.length === 3 ? symbolIteratorWithKey : symbolIterator; + } else if (typeof collection === obj) { + keys = nativeKeys(collection); + size = keys.length; + iterate = iterator.length === 3 ? objectIteratorWithKey : objectIterator; + } + if (!size) { + return callback(null, {}); + } + iterate(); + + function arrayIterator() { + key = completed; + value = collection[completed]; + iterator(value, done); + } + + function arrayIteratorWithIndex() { + key = completed; + value = collection[completed]; + iterator(value, completed, done); + } + + function symbolIterator() { + key = completed; + item = iter.next(); + value = item.value; + item.done ? callback(null, result) : iterator(value, done); + } + + function symbolIteratorWithKey() { + key = completed; + item = iter.next(); + value = item.value; + item.done ? callback(null, result) : iterator(value, key, done); + } + + function objectIterator() { + key = keys[completed]; + value = collection[key]; + iterator(value, done); + } + + function objectIteratorWithKey() { + key = keys[completed]; + value = collection[key]; + iterator(value, key, done); + } + + function done(err, res) { + if (err) { + callback(err, result); + return; + } + if (!!res === bool) { + result[key] = value; + } + if (++completed === size) { + iterate = throwError; + callback(null, result); + } else if (sync) { + nextTick(iterate); + } else { + sync = true; + iterate(); + } + sync = false; + } + }; + } + + /** + * @private + * @param {boolean} bool + */ + function createPickLimit(bool) { + return function(collection, limit, iterator, callback) { + callback = callback || noop; + var size, index, key, value, keys, iter, item, iterate; + var sync = false; + var result = {}; + var started = 0; + var completed = 0; + + if (isArray(collection)) { + size = collection.length; + iterate = iterator.length === 3 ? arrayIteratorWithIndex : arrayIterator; + } else if (!collection) { + } else if (iteratorSymbol && collection[iteratorSymbol]) { + size = Infinity; + iter = collection[iteratorSymbol](); + iterate = iterator.length === 3 ? symbolIteratorWithKey : symbolIterator; + } else if (typeof collection === obj) { + keys = nativeKeys(collection); + size = keys.length; + iterate = iterator.length === 3 ? objectIteratorWithKey : objectIterator; + } + if (!size || isNaN(limit) || limit < 1) { + return callback(null, {}); + } + timesSync(limit > size ? size : limit, iterate); + + function arrayIterator() { + index = started++; + if (index < size) { + value = collection[index]; + iterator(value, createCallback(value, index)); + } + } + + function arrayIteratorWithIndex() { + index = started++; + if (index < size) { + value = collection[index]; + iterator(value, index, createCallback(value, index)); + } + } + + function symbolIterator() { + item = iter.next(); + if (item.done === false) { + value = item.value; + iterator(value, createCallback(value, started++)); + } else if (completed === started && iterator !== noop) { + iterator = noop; + callback(null, result); + } + } + + function symbolIteratorWithKey() { + item = iter.next(); + if (item.done === false) { + value = item.value; + iterator(value, started, createCallback(value, started++)); + } else if (completed === started && iterator !== noop) { + iterator = noop; + callback(null, result); + } + } + + function objectIterator() { + if (started < size) { + key = keys[started++]; + value = collection[key]; + iterator(value, createCallback(value, key)); + } + } + + function objectIteratorWithKey() { + if (started < size) { + key = keys[started++]; + value = collection[key]; + iterator(value, key, createCallback(value, key)); + } + } + + function createCallback(value, key) { + return function(err, res) { + if (key === null) { + throwError(); + } + if (err) { + key = null; + iterate = noop; + callback = once(callback); + callback(err, objectClone(result)); + return; + } + if (!!res === bool) { + result[key] = value; + } + key = null; + if (++completed === size) { + iterate = throwError; + callback = onlyOnce(callback); + callback(null, result); + } else if (sync) { + nextTick(iterate); + } else { + sync = true; + iterate(); + } + sync = false; + }; + } + }; + } + + /** + * @memberof async + * @namespace reduce + * @param {Array|Object} collection + * @param {*} result + * @param {Function} iterator + * @param {Function} callback + * @example + * + * // array + * var order = []; + * var collection = [1, 3, 2, 4]; + * var iterator = function(result, num, done) { + * setTimeout(function() { + * order.push(num); + * done(null, result + num); + * }, num * 10); + * }; + * async.reduce(collection, 0, iterator, function(err, res) { + * console.log(res); // 10 + * console.log(order); // [1, 3, 2, 4] + * }); + * + * @example + * + * // array with index + * var order = []; + * var collection = [1, 3, 2, 4]; + * var iterator = function(result, num, index, done) { + * setTimeout(function() { + * order.push([num, index]); + * done(null, result + num); + * }, num * 10); + * }; + * async.reduce(collection, '', iterator, function(err, res) { + * console.log(res); // '1324' + * console.log(order); // [[1, 0], [3, 1], [2, 2], [4, 3]] + * }); + * + * @example + * + * // object + * var order = []; + * var object = { a: 1, b: 3, c: 2, d: 4 }; + * var iterator = function(result, num, done) { + * setTimeout(function() { + * order.push(num); + * done(null, result + num); + * }, num * 10); + * }; + * async.reduce(collection, '', iterator, function(err, res) { + * console.log(res); // '1324' + * console.log(order); // [1, 3, 2, 4] + * }); + * + * @example + * + * // object with key + * var order = []; + * var object = { a: 1, b: 3, c: 2, d: 4 }; + * var iterator = function(result, num, key, done) { + * setTimeout(function() { + * order.push([num, key]); + * done(null, result + num); + * }, num * 10); + * }; + * async.reduce(collection, 0, iterator, function(err, res) { + * console.log(res); // 10 + * console.log(order); // [[1, 'a'], [3, 'b'], [2, 'b'], [4, 'd']] + * }); + * + */ + function reduce(collection, result, iterator, callback) { + callback = onlyOnce(callback || noop); + var size, key, keys, iter, item, iterate; + var sync = false; + var completed = 0; + + if (isArray(collection)) { + size = collection.length; + iterate = iterator.length === 4 ? arrayIteratorWithIndex : arrayIterator; + } else if (!collection) { + } else if (iteratorSymbol && collection[iteratorSymbol]) { + size = Infinity; + iter = collection[iteratorSymbol](); + iterate = iterator.length === 4 ? symbolIteratorWithKey : symbolIterator; + } else if (typeof collection === obj) { + keys = nativeKeys(collection); + size = keys.length; + iterate = iterator.length === 4 ? objectIteratorWithKey : objectIterator; + } + if (!size) { + return callback(null, result); + } + iterate(result); + + function arrayIterator(result) { + iterator(result, collection[completed], done); + } + + function arrayIteratorWithIndex(result) { + iterator(result, collection[completed], completed, done); + } + + function symbolIterator(result) { + item = iter.next(); + item.done ? callback(null, result) : iterator(result, item.value, done); + } + + function symbolIteratorWithKey(result) { + item = iter.next(); + item.done ? callback(null, result) : iterator(result, item.value, completed, done); + } + + function objectIterator(result) { + iterator(result, collection[keys[completed]], done); + } + + function objectIteratorWithKey(result) { + key = keys[completed]; + iterator(result, collection[key], key, done); + } + + function done(err, result) { + if (err) { + callback(err, result); + } else if (++completed === size) { + iterator = throwError; + callback(null, result); + } else if (sync) { + nextTick(function() { + iterate(result); + }); + } else { + sync = true; + iterate(result); + } + sync = false; + } + } + + /** + * @memberof async + * @namespace reduceRight + * @param {Array|Object} collection + * @param {*} result + * @param {Function} iterator + * @param {Function} callback + * @example + * + * // array + * var order = []; + * var collection = [1, 3, 2, 4]; + * var iterator = function(result, num, done) { + * setTimeout(function() { + * order.push(num); + * done(null, result + num); + * }, num * 10); + * }; + * async.reduceRight(collection, 0, iterator, function(err, res) { + * console.log(res); // 10 + * console.log(order); // [4, 2, 3, 1] + * }); + * + * @example + * + * // array with index + * var order = []; + * var collection = [1, 3, 2, 4]; + * var iterator = function(result, num, index, done) { + * setTimeout(function() { + * order.push([num, index]); + * done(null, result + num); + * }, num * 10); + * }; + * async.reduceRight(collection, '', iterator, function(err, res) { + * console.log(res); // '4231' + * console.log(order); // [[4, 3], [2, 2], [3, 1], [1, 0]] + * }); + * + * @example + * + * // object + * var order = []; + * var object = { a: 1, b: 3, c: 2, d: 4 }; + * var iterator = function(result, num, done) { + * setTimeout(function() { + * order.push(num); + * done(null, result + num); + * }, num * 10); + * }; + * async.reduceRight(collection, '', iterator, function(err, res) { + * console.log(res); // '4231' + * console.log(order); // [4, 2, 3, 1] + * }); + * + * @example + * + * // object with key + * var order = []; + * var object = { a: 1, b: 3, c: 2, d: 4 }; + * var iterator = function(result, num, key, done) { + * setTimeout(function() { + * order.push([num, key]); + * done(null, result + num); + * }, num * 10); + * }; + * async.reduceRight(collection, 0, iterator, function(err, res) { + * console.log(res); // 10 + * console.log(order); // [[4, 3], [2, 2], [3, 1], [1, 0]] + * }); + * + */ + function reduceRight(collection, result, iterator, callback) { + callback = onlyOnce(callback || noop); + var resIndex, index, key, keys, iter, item, col, iterate; + var sync = false; + + if (isArray(collection)) { + resIndex = collection.length; + iterate = iterator.length === 4 ? arrayIteratorWithIndex : arrayIterator; + } else if (!collection) { + } else if (iteratorSymbol && collection[iteratorSymbol]) { + col = []; + iter = collection[iteratorSymbol](); + index = -1; + while ((item = iter.next()).done === false) { + col[++index] = item.value; + } + collection = col; + resIndex = col.length; + iterate = iterator.length === 4 ? arrayIteratorWithIndex : arrayIterator; + } else if (typeof collection === obj) { + keys = nativeKeys(collection); + resIndex = keys.length; + iterate = iterator.length === 4 ? objectIteratorWithKey : objectIterator; + } + if (!resIndex) { + return callback(null, result); + } + iterate(result); + + function arrayIterator(result) { + iterator(result, collection[--resIndex], done); + } + + function arrayIteratorWithIndex(result) { + iterator(result, collection[--resIndex], resIndex, done); + } + + function objectIterator(result) { + iterator(result, collection[keys[--resIndex]], done); + } + + function objectIteratorWithKey(result) { + key = keys[--resIndex]; + iterator(result, collection[key], key, done); + } + + function done(err, result) { + if (err) { + callback(err, result); + } else if (resIndex === 0) { + iterate = throwError; + callback(null, result); + } else if (sync) { + nextTick(function() { + iterate(result); + }); + } else { + sync = true; + iterate(result); + } + sync = false; + } + } + + /** + * @private + * @param {Function} arrayEach + * @param {Function} baseEach + * @param {Function} symbolEach + */ + function createTransform(arrayEach, baseEach, symbolEach) { + return function transform(collection, accumulator, iterator, callback) { + if (arguments.length === 3) { + callback = iterator; + iterator = accumulator; + accumulator = undefined; + } + callback = callback || noop; + var size, keys, result; + var completed = 0; + + if (isArray(collection)) { + size = collection.length; + result = accumulator !== undefined ? accumulator : []; + arrayEach(collection, result, iterator, done); + } else if (!collection) { + } else if (iteratorSymbol && collection[iteratorSymbol]) { + result = accumulator !== undefined ? accumulator : {}; + size = symbolEach(collection, result, iterator, done); + size && size === completed && callback(null, result); + } else if (typeof collection === obj) { + keys = nativeKeys(collection); + size = keys.length; + result = accumulator !== undefined ? accumulator : {}; + baseEach(collection, result, iterator, done, keys); + } + if (!size) { + callback(null, accumulator !== undefined ? accumulator : result || {}); + } + + function done(err, bool) { + if (err) { + callback = once(callback); + callback(err, isArray(result) ? createArray(result) : objectClone(result)); + } else if (++completed === size) { + callback(null, result); + } else if (bool === false) { + callback = once(callback); + callback(null, isArray(result) ? createArray(result) : objectClone(result)); + } + } + }; + } + + /** + * @memberof async + * @namespace transformSeries + * @param {Array|Object} collection + * @param {Array|Object|Function} [accumulator] + * @param {Function} [iterator] + * @param {Function} [callback] + * @example + * + * // array + * var order = []; + * var collection = [1, 3, 2, 4]; + * var iterator = function(result, num, done) { + * setTimeout(function() { + * order.push(num); + * result.push(num) + * done(); + * }, num * 10); + * }; + * async.transformSeries(collection, iterator, function(err, res) { + * console.log(res); // [1, 3, 2, 4] + * console.log(order); // [1, 3, 2, 4] + * }); + * + * @example + * + * // array with index and accumulator + * var order = []; + * var collection = [1, 3, 2, 4]; + * var iterator = function(result, num, index, done) { + * setTimeout(function() { + * order.push([num, index]); + * result[index] = num; + * done(); + * }, num * 10); + * }; + * async.transformSeries(collection, {}, iterator, function(err, res) { + * console.log(res); // { '0': 1, '1': 3, '2': 2, '3': 4 } + * console.log(order); // [[1, 0], [3, 1], [2, 2], [4, 3]] + * }); + * + * @example + * + * // object with accumulator + * var order = []; + * var object = { a: 1, b: 3, c: 2, d: 4 }; + * var iterator = function(result, num, done) { + * setTimeout(function() { + * order.push(num); + * result.push(num); + * done(); + * }, num * 10); + * }; + * async.transformSeries(collection, [], iterator, function(err, res) { + * console.log(res); // [1, 3, 2, 4] + * console.log(order); // [1, 3, 2, 4] + * }); + * + * @example + * + * // object with key + * var order = []; + * var object = { a: 1, b: 3, c: 2, d: 4 }; + * var iterator = function(result, num, key, done) { + * setTimeout(function() { + * order.push([num, key]); + * result[key] = num; + * done(); + * }, num * 10); + * }; + * async.transformSeries(collection, iterator, function(err, res) { + * console.log(res); // { a: 1, b: 3, c: 2, d: 4 } + * console.log(order); // [[1, 'a'], [3, 'b'], [2, 'b'], [4, 'd']] + * }); + * + */ + function transformSeries(collection, accumulator, iterator, callback) { + if (arguments.length === 3) { + callback = iterator; + iterator = accumulator; + accumulator = undefined; + } + callback = onlyOnce(callback || noop); + var size, key, keys, iter, item, iterate, result; + var sync = false; + var completed = 0; + + if (isArray(collection)) { + size = collection.length; + result = accumulator !== undefined ? accumulator : []; + iterate = iterator.length === 4 ? arrayIteratorWithIndex : arrayIterator; + } else if (!collection) { + } else if (iteratorSymbol && collection[iteratorSymbol]) { + size = Infinity; + iter = collection[iteratorSymbol](); + result = accumulator !== undefined ? accumulator : {}; + iterate = iterator.length === 4 ? symbolIteratorWithKey : symbolIterator; + } else if (typeof collection === obj) { + keys = nativeKeys(collection); + size = keys.length; + result = accumulator !== undefined ? accumulator : {}; + iterate = iterator.length === 4 ? objectIteratorWithKey : objectIterator; + } + if (!size) { + return callback(null, accumulator !== undefined ? accumulator : result || {}); + } + iterate(); + + function arrayIterator() { + iterator(result, collection[completed], done); + } + + function arrayIteratorWithIndex() { + iterator(result, collection[completed], completed, done); + } + + function symbolIterator() { + item = iter.next(); + item.done ? callback(null, result) : iterator(result, item.value, done); + } + + function symbolIteratorWithKey() { + item = iter.next(); + item.done ? callback(null, result) : iterator(result, item.value, completed, done); + } + + function objectIterator() { + iterator(result, collection[keys[completed]], done); + } + + function objectIteratorWithKey() { + key = keys[completed]; + iterator(result, collection[key], key, done); + } + + function done(err, bool) { + if (err) { + callback(err, result); + } else if (++completed === size || bool === false) { + iterate = throwError; + callback(null, result); + } else if (sync) { + nextTick(iterate); + } else { + sync = true; + iterate(); + } + sync = false; + } + } + + /** + * @memberof async + * @namespace transformLimit + * @param {Array|Object} collection + * @param {number} limit - limit >= 1 + * @param {Array|Object|Function} [accumulator] + * @param {Function} [iterator] + * @param {Function} [callback] + * @example + * + * // array + * var order = []; + * var array = [1, 5, 3, 4, 2]; + * var iterator = function(result, num, done) { + * setTimeout(function() { + * order.push(num); + * result.push(num); + * done(); + * }, num * 10); + * }; + * async.transformLimit(array, 2, iterator, function(err, res) { + * console.log(res); // [1, 3, 5, 2, 4] + * console.log(order); // [1, 3, 5, 2, 4] + * }); + * + * @example + * + * // array with index and accumulator + * var order = []; + * var array = [1, 5, 3, 4, 2]; + * var iterator = function(result, num, index, done) { + * setTimeout(function() { + * order.push([num, index]); + * result[index] = key; + * done(); + * }, num * 10); + * }; + * async.transformLimit(array, 2, {}, iterator, function(err, res) { + * console.log(res); // { '0': 1, '1': 5, '2': 3, '3': 4, '4': 2 } + * console.log(order); // [[1, 0], [3, 2], [5, 1], [2, 4], [4, 3]] + * }); + * + * @example + * + * // object with accumulator + * var order = []; + * var object = { a: 1, b: 5, c: 3, d: 4, e: 2 }; + * var iterator = function(result, num, done) { + * setTimeout(function() { + * order.push(num); + * result.push(num); + * done(); + * }, num * 10); + * }; + * async.transformLimit(object, 2, [], iterator, function(err, res) { + * console.log(res); // [1, 3, 5, 2, 4] + * console.log(order); // [1, 3, 5, 2, 4] + * }); + * + * @example + * + * // object with key + * var order = []; + * var object = { a: 1, b: 5, c: 3, d: 4, e: 2 }; + * var iterator = function(result, num, key, done) { + * setTimeout(function() { + * order.push([num, key]); + * result[key] = num; + * done(); + * }, num * 10); + * }; + * async.transformLimit(object, 2, iterator, function(err, res) { + * console.log(res); // { a: 1, b: 5, c: 3, d: 4, e: 2 }; + * console.log(order); // [[1, 'a'], [3, 'c'], [5, 'b'], [2, 'e'], [4, 'd']] + * }); + * + */ + function transformLimit(collection, limit, accumulator, iterator, callback) { + if (arguments.length === 4) { + callback = iterator; + iterator = accumulator; + accumulator = undefined; + } + callback = callback || noop; + var size, index, key, keys, iter, item, iterate, result; + var sync = false; + var started = 0; + var completed = 0; + + if (isArray(collection)) { + size = collection.length; + result = accumulator !== undefined ? accumulator : []; + iterate = iterator.length === 4 ? arrayIteratorWithIndex : arrayIterator; + } else if (!collection) { + } else if (iteratorSymbol && collection[iteratorSymbol]) { + size = Infinity; + iter = collection[iteratorSymbol](); + result = accumulator !== undefined ? accumulator : {}; + iterate = iterator.length === 4 ? symbolIteratorWithKey : symbolIterator; + } else if (typeof collection === obj) { + keys = nativeKeys(collection); + size = keys.length; + result = accumulator !== undefined ? accumulator : {}; + iterate = iterator.length === 4 ? objectIteratorWithKey : objectIterator; + } + if (!size || isNaN(limit) || limit < 1) { + return callback(null, accumulator !== undefined ? accumulator : result || {}); + } + timesSync(limit > size ? size : limit, iterate); + + function arrayIterator() { + index = started++; + if (index < size) { + iterator(result, collection[index], onlyOnce(done)); + } + } + + function arrayIteratorWithIndex() { + index = started++; + if (index < size) { + iterator(result, collection[index], index, onlyOnce(done)); + } + } + + function symbolIterator() { + item = iter.next(); + if (item.done === false) { + started++; + iterator(result, item.value, onlyOnce(done)); + } else if (completed === started && iterator !== noop) { + iterator = noop; + callback(null, result); + } + } + + function symbolIteratorWithKey() { + item = iter.next(); + if (item.done === false) { + iterator(result, item.value, started++, onlyOnce(done)); + } else if (completed === started && iterator !== noop) { + iterator = noop; + callback(null, result); + } + } + + function objectIterator() { + index = started++; + if (index < size) { + iterator(result, collection[keys[index]], onlyOnce(done)); + } + } + + function objectIteratorWithKey() { + index = started++; + if (index < size) { + key = keys[index]; + iterator(result, collection[key], key, onlyOnce(done)); + } + } + + function done(err, bool) { + if (err || bool === false) { + iterate = noop; + callback(err || null, isArray(result) ? createArray(result) : objectClone(result)); + callback = noop; + } else if (++completed === size) { + iterator = noop; + callback(null, result); + } else if (sync) { + nextTick(iterate); + } else { + sync = true; + iterate(); + } + sync = false; + } + } + + /** + * @private + * @param {function} arrayEach + * @param {function} baseEach + * @param {function} symbolEach + */ + function createSortBy(arrayEach, baseEach, symbolEach) { + return function sortBy(collection, iterator, callback) { + callback = callback || noop; + var size, array, criteria; + var completed = 0; + + if (isArray(collection)) { + size = collection.length; + array = Array(size); + criteria = Array(size); + arrayEach(collection, iterator, createCallback); + } else if (!collection) { + } else if (iteratorSymbol && collection[iteratorSymbol]) { + array = []; + criteria = []; + size = symbolEach(collection, iterator, createCallback); + size && size === completed && callback(null, sortByCriteria(array, criteria)); + } else if (typeof collection === obj) { + var keys = nativeKeys(collection); + size = keys.length; + array = Array(size); + criteria = Array(size); + baseEach(collection, iterator, createCallback, keys); + } + if (!size) { + callback(null, []); + } + + function createCallback(index, value) { + var called = false; + array[index] = value; + return function done(err, criterion) { + if (called) { + throwError(); + } + called = true; + criteria[index] = criterion; + if (err) { + callback = once(callback); + callback(err); + } else if (++completed === size) { + callback(null, sortByCriteria(array, criteria)); + } + }; + } + }; + } + + /** + * @memberof async + * @namespace sortBySeries + * @param {Array|Object} collection + * @param {Function} iterator + * @param {Function} callback + * @example + * + * // array + * var order = []; + * var array = [1, 3, 2]; + * var iterator = function(num, done) { + * setTimeout(function() { + * order.push(num); + * done(null, num); + * }, num * 10); + * }; + * async.sortBySeries(array, iterator, function(err, res) { + * console.log(res); // [1, 2, 3]; + * console.log(order); // [1, 3, 2] + * }); + * + * @example + * + * // array with index + * var order = []; + * var array = [1, 3, 2]; + * var iterator = function(num, index, done) { + * setTimeout(function() { + * order.push([num, index]); + * done(null, num); + * }, num * 10); + * }; + * async.sortBySeries(array, iterator, function(err, res) { + * console.log(res); // [1, 2, 3] + * console.log(order); // [[1, 0], [3, 1], [2, 2]] + * }); + * + * @example + * + * // object + * var order = []; + * var object = { a: 1, b: 3, c: 2 }; + * var iterator = function(num, done) { + * setTimeout(function() { + * order.push(num); + * done(null, num); + * }, num * 10); + * }; + * async.sortBySeries(object, iterator, function(err, res) { + * console.log(res); // [1, 2, 3] + * console.log(order); // [1, 3, 2] + * }); + * + * @example + * + * // object with key + * var order = []; + * var object = { a: 1, b: 3, c: 2 }; + * var iterator = function(num, key, done) { + * setTimeout(function() { + * order.push([num, key]); + * done(null, num); + * }, num * 10); + * }; + * async.sortBySeries(object, iterator, function(err, res) { + * console.log(res); // [1, 2, 3] + * console.log(order); // [[1, 'a'], [3, 'b'], [2, 'c']] + * }); + * + */ + function sortBySeries(collection, iterator, callback) { + callback = onlyOnce(callback || noop); + var size, key, value, keys, iter, item, array, criteria, iterate; + var sync = false; + var completed = 0; + + if (isArray(collection)) { + size = collection.length; + array = collection; + criteria = Array(size); + iterate = iterator.length === 3 ? arrayIteratorWithIndex : arrayIterator; + } else if (!collection) { + } else if (iteratorSymbol && collection[iteratorSymbol]) { + size = Infinity; + array = []; + criteria = []; + iter = collection[iteratorSymbol](); + iterate = iterator.length === 3 ? symbolIteratorWithKey : symbolIterator; + } else if (typeof collection === obj) { + keys = nativeKeys(collection); + size = keys.length; + array = Array(size); + criteria = Array(size); + iterate = iterator.length === 3 ? objectIteratorWithKey : objectIterator; + } + if (!size) { + return callback(null, []); + } + iterate(); + + function arrayIterator() { + value = collection[completed]; + iterator(value, done); + } + + function arrayIteratorWithIndex() { + value = collection[completed]; + iterator(value, completed, done); + } + + function symbolIterator() { + item = iter.next(); + if (item.done) { + return callback(null, sortByCriteria(array, criteria)); + } + value = item.value; + array[completed] = value; + iterator(value, done); + } + + function symbolIteratorWithKey() { + item = iter.next(); + if (item.done) { + return callback(null, sortByCriteria(array, criteria)); + } + value = item.value; + array[completed] = value; + iterator(value, completed, done); + } + + function objectIterator() { + value = collection[keys[completed]]; + array[completed] = value; + iterator(value, done); + } + + function objectIteratorWithKey() { + key = keys[completed]; + value = collection[key]; + array[completed] = value; + iterator(value, key, done); + } + + function done(err, criterion) { + criteria[completed] = criterion; + if (err) { + callback(err); + } else if (++completed === size) { + iterate = throwError; + callback(null, sortByCriteria(array, criteria)); + } else if (sync) { + nextTick(iterate); + } else { + sync = true; + iterate(); + } + sync = false; + } + } + + /** + * @memberof async + * @namespace sortByLimit + * @param {Array|Object} collection + * @param {number} limit - limit >= 1 + * @param {Function} iterator + * @param {Function} callback + * @example + * + * // array + * var order = []; + * var array = [1, 5, 3, 4, 2]; + * var iterator = function(num, done) { + * setTimeout(function() { + * order.push(num); + * done(null, num); + * }, num * 10); + * }; + * async.sortByLimit(array, 2, iterator, function(err, res) { + * console.log(res); // [1, 2, 3, 4, 5] + * console.log(order); // [1, 3, 5, 2, 4] + * }); + * + * @example + * + * // array with index + * var order = []; + * var array = [1, 5, 3, 4, 2]; + * var iterator = function(num, index, done) { + * setTimeout(function() { + * order.push([num, index]); + * done(null, num); + * }, num * 10); + * }; + * async.sortByLimit(array, 2, iterator, function(err, res) { + * console.log(res); // [1, 2, 3, 4, 5] + * console.log(order); // [[1, 0], [3, 2], [5, 1], [2, 4], [4, 3]] + * }); + * + * @example + * + * // object + * var order = []; + * var object = { a: 1, b: 5, c: 3, d: 4, e: 2 }; + * var iterator = function(num, done) { + * setTimeout(function() { + * order.push(num); + * done(null, num); + * }, num * 10); + * }; + * async.sortByLimit(object, 2, iterator, function(err, res) { + * console.log(res); // [1, 2, 3, 4, 5] + * console.log(order); // [1, 3, 5, 2, 4] + * }); + * + * @example + * + * // object with key + * var order = []; + * var object = { a: 1, b: 5, c: 3, d: 4, e: 2 }; + * var iterator = function(num, key, done) { + * setTimeout(function() { + * order.push([num, key]); + * done(null, num); + * }, num * 10); + * }; + * async.sortByLimit(object, 2, iterator, function(err, res) { + * console.log(res); // [1, 2, 3, 4, 5] + * console.log(order); // [[1, 'a'], [3, 'c'], [5, 'b'], [2, 'e'], [4, 'd']] + * }); + * + */ + function sortByLimit(collection, limit, iterator, callback) { + callback = callback || noop; + var size, index, key, value, array, keys, iter, item, criteria, iterate; + var sync = false; + var started = 0; + var completed = 0; + + if (isArray(collection)) { + size = collection.length; + array = collection; + iterate = iterator.length === 3 ? arrayIteratorWithIndex : arrayIterator; + } else if (!collection) { + } else if (iteratorSymbol && collection[iteratorSymbol]) { + size = Infinity; + iter = collection[iteratorSymbol](); + array = []; + criteria = []; + iterate = iterator.length === 3 ? symbolIteratorWithKey : symbolIterator; + } else if (typeof collection === obj) { + keys = nativeKeys(collection); + size = keys.length; + array = Array(size); + iterate = iterator.length === 3 ? objectIteratorWithKey : objectIterator; + } + if (!size || isNaN(limit) || limit < 1) { + return callback(null, []); + } + criteria = criteria || Array(size); + timesSync(limit > size ? size : limit, iterate); + + function arrayIterator() { + if (started < size) { + value = collection[started]; + iterator(value, createCallback(value, started++)); + } + } + + function arrayIteratorWithIndex() { + index = started++; + if (index < size) { + value = collection[index]; + iterator(value, index, createCallback(value, index)); + } + } + + function symbolIterator() { + item = iter.next(); + if (item.done === false) { + value = item.value; + array[started] = value; + iterator(value, createCallback(value, started++)); + } else if (completed === started && iterator !== noop) { + iterator = noop; + callback(null, sortByCriteria(array, criteria)); + } + } + + function symbolIteratorWithKey() { + item = iter.next(); + if (item.done === false) { + value = item.value; + array[started] = value; + iterator(value, started, createCallback(value, started++)); + } else if (completed === started && iterator !== noop) { + iterator = noop; + callback(null, sortByCriteria(array, criteria)); + } + } + + function objectIterator() { + if (started < size) { + value = collection[keys[started]]; + array[started] = value; + iterator(value, createCallback(value, started++)); + } + } + + function objectIteratorWithKey() { + if (started < size) { + key = keys[started]; + value = collection[key]; + array[started] = value; + iterator(value, key, createCallback(value, started++)); + } + } + + function createCallback(value, index) { + var called = false; + return function(err, criterion) { + if (called) { + throwError(); + } + called = true; + criteria[index] = criterion; + if (err) { + iterate = noop; + callback(err); + callback = noop; + } else if (++completed === size) { + callback(null, sortByCriteria(array, criteria)); + } else if (sync) { + nextTick(iterate); + } else { + sync = true; + iterate(); + } + sync = false; + }; + } + } + + /** + * @memberof async + * @namespace some + * @param {Array|Object} collection + * @param {Function} iterator + * @param {Function} callback + * @example + * + * // array + * var order = []; + * var array = [1, 3, 2]; + * var iterator = function(num, done) { + * setTimeout(function() { + * order.push(num); + * done(null, num % 2); + * }, num * 10); + * }; + * async.some(array, iterator, function(err, res) { + * console.log(res); // true + * console.log(order); // [1] + * }); + * + * @example + * + * // array with index + * var order = []; + * var array = [1, 3, 2]; + * var iterator = function(num, index, done) { + * setTimeout(function() { + * order.push([num, index]); + * done(null, num % 2); + * }, num * 10); + * }; + * async.some(array, iterator, function(err, res) { + * console.log(res); // true + * console.log(order); // [[1, 0]] + * }); + * + * @example + * + * // object + * var order = []; + * var object = { a: 1, b: 3, c: 2 }; + * var iterator = function(num, done) { + * setTimeout(function() { + * order.push(num); + * done(null, num % 2); + * }, num * 10); + * }; + * async.some(object, iterator, function(err, res) { + * console.log(res); // true + * console.log(order); // [1] + * }); + * + * @example + * + * // object with key + * var order = []; + * var object = { a: 1, b: 3, c: 2 }; + * var iterator = function(num, key, done) { + * setTimeout(function() { + * order.push([num, key]); + * done(null, num % 2); + * }, num * 10); + * }; + * async.some(object, iterator, function(err, res) { + * console.log(res); // true + * console.log(order); // [[1, 'a']] + * }); + * + */ + function some(collection, iterator, callback) { + callback = callback || noop; + detect(collection, iterator, done); + + function done(err, res) { + if (err) { + return callback(err); + } + callback(null, !!res); + } + } + + /** + * @memberof async + * @namespace someSeries + * @param {Array|Object} collection + * @param {Function} iterator + * @param {Function} callback + * @example + * + * // array + * var order = []; + * var array = [1, 3, 2]; + * var iterator = function(num, done) { + * setTimeout(function() { + * order.push(num); + * done(null, num % 2); + * }, num * 10); + * }; + * async.someSeries(array, iterator, function(err, res) { + * console.log(res); // true + * console.log(order); // [1] + * }); + * + * @example + * + * // array with index + * var order = []; + * var array = [1, 3, 2]; + * var iterator = function(num, index, done) { + * setTimeout(function() { + * order.push([num, index]); + * done(null, num % 2); + * }, num * 10); + * }; + * async.someSeries(array, iterator, function(err, res) { + * console.log(res); // true + * console.log(order); // [[1, 0]] + * }); + * + * @example + * + * // object + * var order = []; + * var object = { a: 1, b: 3, c: 2 }; + * var iterator = function(num, done) { + * setTimeout(function() { + * order.push(num); + * done(null, num % 2); + * }, num * 10); + * }; + * async.someSeries(object, iterator, function(err, res) { + * console.log(res); // true + * console.log(order); // [1] + * }); + * + * @example + * + * // object with key + * var order = []; + * var object = { a: 1, b: 3, c: 2 }; + * var iterator = function(num, key, done) { + * setTimeout(function() { + * order.push([num, key]); + * done(null, num % 2); + * }, num * 10); + * }; + * async.someSeries(object, iterator, function(err, res) { + * console.log(res); // true + * console.log(order); // [[1, 'a']] + * }); + * + */ + function someSeries(collection, iterator, callback) { + callback = callback || noop; + detectSeries(collection, iterator, done); + + function done(err, res) { + if (err) { + return callback(err); + } + callback(null, !!res); + } + } + + /** + * @memberof async + * @namespace someLimit + * @param {Array|Object} collection + * @param {number} limit - limit >= 1 + * @param {Function} iterator + * @param {Function} callback + * @example + * + * // array + * var order = []; + * var array = [1, 5, 3, 4, 2]; + * var iterator = function(num, done) { + * setTimeout(function() { + * order.push(num); + * done(null, num % 2); + * }, num * 10); + * }; + * async.someLimit(array, 2, iterator, function(err, res) { + * console.log(res); // true + * console.log(order); // [1] + * }); + * + * @example + * + * // array with index + * var order = []; + * var array = [1, 5, 3, 4, 2]; + * var iterator = function(num, index, done) { + * setTimeout(function() { + * order.push([num, index]); + * done(null, num % 2); + * }, num * 10); + * }; + * async.someLimit(array, 2, iterator, function(err, res) { + * console.log(res); // true + * console.log(order); // [[1, 0]] + * }); + * + * @example + * + * // object + * var order = []; + * var object = { a: 1, b: 5, c: 3, d: 4, e: 2 }; + * var iterator = function(num, done) { + * setTimeout(function() { + * order.push(num); + * done(null, num % 2); + * }, num * 10); + * }; + * async.someLimit(object, 2, iterator, function(err, res) { + * console.log(res); // true + * console.log(order); // [1] + * }); + * + * @example + * + * // object with key + * var order = []; + * var object = { a: 1, b: 5, c: 3, d: 4, e: 2 }; + * var iterator = function(num, key, done) { + * setTimeout(function() { + * order.push([num, key]); + * done(null, num % 2); + * }, num * 10); + * }; + * async.someLimit(object, 2, iterator, function(err, res) { + * console.log(res); // true + * console.log(order); // [[1, 'a']] + * }); + * + */ + function someLimit(collection, limit, iterator, callback) { + callback = callback || noop; + detectLimit(collection, limit, iterator, done); + + function done(err, res) { + if (err) { + return callback(err); + } + callback(null, !!res); + } + } + + /** + * @private + * @param {Function} arrayEach + * @param {Function} baseEach + * @param {Function} symbolEach + */ + function createEvery(arrayEach, baseEach, symbolEach) { + var deny = createDetect(arrayEach, baseEach, symbolEach, false); + + return function every(collection, iterator, callback) { + callback = callback || noop; + deny(collection, iterator, done); + + function done(err, res) { + if (err) { + return callback(err); + } + callback(null, !res); + } + }; + } + + /** + * @private + */ + function createEverySeries() { + var denySeries = createDetectSeries(false); + + return function everySeries(collection, iterator, callback) { + callback = callback || noop; + denySeries(collection, iterator, done); + + function done(err, res) { + if (err) { + return callback(err); + } + callback(null, !res); + } + }; + } + + /** + * @private + */ + function createEveryLimit() { + var denyLimit = createDetectLimit(false); + + return function everyLimit(collection, limit, iterator, callback) { + callback = callback || noop; + denyLimit(collection, limit, iterator, done); + + function done(err, res) { + if (err) { + return callback(err); + } + callback(null, !res); + } + }; + } + + /** + * @private + * @param {Function} arrayEach + * @param {Function} baseEach + * @param {Function} symbolEach + */ + function createConcat(arrayEach, baseEach, symbolEach) { + return function concat(collection, iterator, callback) { + callback = callback || noop; + var size, result; + var completed = 0; + + if (isArray(collection)) { + size = collection.length; + result = Array(size); + arrayEach(collection, iterator, createCallback); + } else if (!collection) { + } else if (iteratorSymbol && collection[iteratorSymbol]) { + result = []; + size = symbolEach(collection, iterator, createCallback); + size && size === completed && callback(null, result); + } else if (typeof collection === obj) { + var keys = nativeKeys(collection); + size = keys.length; + result = Array(size); + baseEach(collection, iterator, createCallback, keys); + } + if (!size) { + callback(null, []); + } + + function createCallback(index) { + return function done(err, res) { + if (index === null) { + throwError(); + } + if (err) { + index = null; + callback = once(callback); + arrayEachSync(result, function(array, index) { + if (array === undefined) { + result[index] = noop; + } + }); + callback(err, makeConcatResult(result)); + return; + } + switch (arguments.length) { + case 0: + case 1: + result[index] = noop; + break; + case 2: + result[index] = res; + break; + default: + result[index] = slice(arguments, 1); + break; + } + index = null; + if (++completed === size) { + callback(null, makeConcatResult(result)); + } + }; + } + }; + } + + /** + * @memberof async + * @namespace concatSeries + * @param {Array|Object} collection + * @param {Function} iterator + * @param {Function} callback + * @example + * + * // array + * var order = []; + * var array = [1, 3, 2]; + * var iterator = function(num, done) { + * setTimeout(function() { + * order.push(num); + * done(null, [num]); + * }, num * 10); + * }; + * async.concatSeries(array, iterator, function(err, res) { + * console.log(res); // [1, 3, 2]; + * console.log(order); // [1, 3, 2] + * }); + * + * @example + * + * // array with index + * var order = []; + * var array = [1, 3, 2]; + * var iterator = function(num, index, done) { + * setTimeout(function() { + * order.push([num, index]); + * done(null, [num]); + * }, num * 10); + * }; + * async.concatSeries(array, iterator, function(err, res) { + * console.log(res); // [1, 3, 2] + * console.log(order); // [[1, 0], [3, 1], [2, 2]] + * }); + * + * @example + * + * // object + * var order = []; + * var object = { a: 1, b: 3, c: 2 }; + * var iterator = function(num, done) { + * setTimeout(function() { + * order.push(num); + * done(null, [num]); + * }, num * 10); + * }; + * async.concatSeries(object, iterator, function(err, res) { + * console.log(res); // [1, 3, 2] + * console.log(order); // [1, 3, 2] + * }); + * + * @example + * + * // object with key + * var order = []; + * var object = { a: 1, b: 3, c: 2 }; + * var iterator = function(num, key, done) { + * setTimeout(function() { + * order.push([num, key]); + * done(null, [num]); + * }, num * 10); + * }; + * async.concatSeries(object, iterator, function(err, res) { + * console.log(res); // [1, 3, 2] + * console.log(order); // [[1, 'a'], [3, 'b'], [2, 'c']] + * }); + * + */ + function concatSeries(collection, iterator, callback) { + callback = onlyOnce(callback || noop); + var size, key, keys, iter, item, iterate; + var sync = false; + var result = []; + var completed = 0; + + if (isArray(collection)) { + size = collection.length; + iterate = iterator.length === 3 ? arrayIteratorWithIndex : arrayIterator; + } else if (!collection) { + } else if (iteratorSymbol && collection[iteratorSymbol]) { + size = Infinity; + iter = collection[iteratorSymbol](); + iterate = iterator.length === 3 ? symbolIteratorWithKey : symbolIterator; + } else if (typeof collection === obj) { + keys = nativeKeys(collection); + size = keys.length; + iterate = iterator.length === 3 ? objectIteratorWithKey : objectIterator; + } + if (!size) { + return callback(null, result); + } + iterate(); + + function arrayIterator() { + iterator(collection[completed], done); + } + + function arrayIteratorWithIndex() { + iterator(collection[completed], completed, done); + } + + function symbolIterator() { + item = iter.next(); + item.done ? callback(null, result) : iterator(item.value, done); + } + + function symbolIteratorWithKey() { + item = iter.next(); + item.done ? callback(null, result) : iterator(item.value, completed, done); + } + + function objectIterator() { + iterator(collection[keys[completed]], done); + } + + function objectIteratorWithKey() { + key = keys[completed]; + iterator(collection[key], key, done); + } + + function done(err, array) { + if (isArray(array)) { + nativePush.apply(result, array); + } else if (arguments.length >= 2) { + nativePush.apply(result, slice(arguments, 1)); + } + if (err) { + callback(err, result); + } else if (++completed === size) { + iterate = throwError; + callback(null, result); + } else if (sync) { + nextTick(iterate); + } else { + sync = true; + iterate(); + } + sync = false; + } + } + + /** + * @memberof async + * @namespace concatLimit + * @param {Array|Object} collection + * @param {number} limit - limit >= 1 + * @param {Function} iterator + * @param {Function} callback + * @example + * + * // array + * var order = []; + * var array = [1, 5, 3, 4, 2]; + * var iterator = function(num, done) { + * setTimeout(function() { + * order.push(num); + * done(null, [num]); + * }, num * 10); + * }; + * async.concatLimit(array, 2, iterator, function(err, res) { + * console.log(res); // [1, 3, 5, 2, 4] + * console.log(order); // [1, 3, 5, 2, 4] + * }); + * + * @example + * + * // array with index + * var order = []; + * var array = [1, 5, 3, 4, 2]; + * var iterator = function(num, index, done) { + * setTimeout(function() { + * order.push([num, index]); + * done(null, [num]); + * }, num * 10); + * }; + * async.cocnatLimit(array, 2, iterator, function(err, res) { + * console.log(res); // [1, 3, 5, 2, 4] + * console.log(order); // [[1, 0], [3, 2], [5, 1], [2, 4], [4, 3]] + * }); + * + * @example + * + * // object + * var order = []; + * var object = { a: 1, b: 5, c: 3, d: 4, e: 2 }; + * var iterator = function(num, done) { + * setTimeout(function() { + * order.push(num); + * done(null, [num]); + * }, num * 10); + * }; + * async.concatLimit(object, 2, iterator, function(err, res) { + * console.log(res); // [1, 3, 5, 2, 4] + * console.log(order); // [1, 3, 5, 2, 4] + * }); + * + * @example + * + * // object with key + * var order = []; + * var object = { a: 1, b: 5, c: 3, d: 4, e: 2 }; + * var iterator = function(num, key, done) { + * setTimeout(function() { + * order.push([num, key]); + * done(null, num); + * }, num * 10); + * }; + * async.cocnatLimit(object, 2, iterator, function(err, res) { + * console.log(res); // [1, 3, 5, 2, 4] + * console.log(order); // [[1, 'a'], [3, 'c'], [5, 'b'], [2, 'e'], [4, 'd']] + * }); + * + */ + function concatLimit(collection, limit, iterator, callback) { + callback = callback || noop; + var size, key, iter, item, iterate, result; + var sync = false; + var started = 0; + var completed = 0; + + if (isArray(collection)) { + size = collection.length; + iterate = iterator.length === 3 ? arrayIteratorWithIndex : arrayIterator; + } else if (!collection) { + } else if (iteratorSymbol && collection[iteratorSymbol]) { + size = Infinity; + result = []; + iter = collection[iteratorSymbol](); + iterate = iterator.length === 3 ? symbolIteratorWithKey : symbolIterator; + } else if (typeof collection === obj) { + var keys = nativeKeys(collection); + size = keys.length; + iterate = iterator.length === 3 ? objectIteratorWithKey : objectIterator; + } + if (!size || isNaN(limit) || limit < 1) { + return callback(null, []); + } + result = result || Array(size); + timesSync(limit > size ? size : limit, iterate); + + function arrayIterator() { + if (started < size) { + iterator(collection[started], createCallback(started++)); + } + } + + function arrayIteratorWithIndex() { + if (started < size) { + iterator(collection[started], started, createCallback(started++)); + } + } + + function symbolIterator() { + item = iter.next(); + if (item.done === false) { + iterator(item.value, createCallback(started++)); + } else if (completed === started && iterator !== noop) { + iterator = noop; + callback(null, makeConcatResult(result)); + } + } + + function symbolIteratorWithKey() { + item = iter.next(); + if (item.done === false) { + iterator(item.value, started, createCallback(started++)); + } else if (completed === started && iterator !== noop) { + iterator = noop; + callback(null, makeConcatResult(result)); + } + } + + function objectIterator() { + if (started < size) { + iterator(collection[keys[started]], createCallback(started++)); + } + } + + function objectIteratorWithKey() { + if (started < size) { + key = keys[started]; + iterator(collection[key], key, createCallback(started++)); + } + } + + function createCallback(index) { + return function(err, res) { + if (index === null) { + throwError(); + } + if (err) { + index = null; + iterate = noop; + callback = once(callback); + arrayEachSync(result, function(array, index) { + if (array === undefined) { + result[index] = noop; + } + }); + callback(err, makeConcatResult(result)); + return; + } + switch (arguments.length) { + case 0: + case 1: + result[index] = noop; + break; + case 2: + result[index] = res; + break; + default: + result[index] = slice(arguments, 1); + break; + } + index = null; + if (++completed === size) { + iterate = throwError; + callback(null, makeConcatResult(result)); + callback = throwError; + } else if (sync) { + nextTick(iterate); + } else { + sync = true; + iterate(); + } + sync = false; + }; + } + } + + /** + * @private + * @param {Function} arrayEach + * @param {Function} baseEach + * @param {Function} symbolEach + */ + function createGroupBy(arrayEach, baseEach, symbolEach) { + return function groupBy(collection, iterator, callback) { + callback = callback || noop; + var size; + var completed = 0; + var result = {}; + + if (isArray(collection)) { + size = collection.length; + arrayEach(collection, iterator, createCallback); + } else if (!collection) { + } else if (iteratorSymbol && collection[iteratorSymbol]) { + size = symbolEach(collection, iterator, createCallback); + size && size === completed && callback(null, result); + } else if (typeof collection === obj) { + var keys = nativeKeys(collection); + size = keys.length; + baseEach(collection, iterator, createCallback, keys); + } + if (!size) { + callback(null, {}); + } + + function createCallback(value) { + var called = false; + return function done(err, key) { + if (called) { + throwError(); + } + called = true; + if (err) { + callback = once(callback); + callback(err, objectClone(result)); + return; + } + var array = result[key]; + if (!array) { + result[key] = [value]; + } else { + array.push(value); + } + if (++completed === size) { + callback(null, result); + } + }; + } + }; + } + + /** + * @memberof async + * @namespace groupBySeries + * @param {Array|Object} collection + * @param {Function} iterator + * @param {Function} callback + * @example + * + * // array + * var order = []; + * var array = [4.2, 6.4, 6.1]; + * var iterator = function(num, done) { + * setTimeout(function() { + * order.push(num); + * done(null, Math.floor(num)); + * }, num * 10); + * }; + * async.groupBySeries(array, iterator, function(err, res) { + * console.log(res); // { '4': [4.2], '6': [6.4, 6.1] } + * console.log(order); // [4.2, 6.4, 6.1] + * }); + * + * @example + * + * // array with index + * var order = []; + * var array = [4.2, 6.4, 6.1]; + * var iterator = function(num, index, done) { + * setTimeout(function() { + * order.push([num, index]); + * done(null, Math.floor(num)); + * }, num * 10); + * }; + * async.groupBySeries(array, iterator, function(err, res) { + * console.log(res); // { '4': [4.2], '6': [6.4, 6.1] } + * console.log(order); // [[4.2, 0], [6.4, 1], [6.1, 2]] + * }); + * + * @example + * + * // object + * var order = []; + * var object = { a: 4.2, b: 6.4, c: 6.1 }; + * var iterator = function(num, done) { + * setTimeout(function() { + * order.push(num); + * done(null, Math.floor(num)); + * }, num * 10); + * }; + * async.groupBySeries(object, iterator, function(err, res) { + * console.log(res); // { '4': [4.2], '6': [6.4, 6.1] } + * console.log(order); // [4.2, 6.4, 6.1] + * }); + * + * @example + * + * // object with key + * var order = []; + * var object = { a: 4.2, b: 6.4, c: 6.1 }; + * var iterator = function(num, key, done) { + * setTimeout(function() { + * order.push([num, key]); + * done(null, Math.floor(num)); + * }, num * 10); + * }; + * async.groupBySeries(object, iterator, function(err, res) { + * console.log(res); // { '4': [4.2], '6': [6.4, 6.1] } + * console.log(order); // [[4.2, 'a'], [6.4, 'b'], [6.1, 'c']] + * }); + * + */ + function groupBySeries(collection, iterator, callback) { + callback = onlyOnce(callback || noop); + var size, key, value, keys, iter, item, iterate; + var sync = false; + var completed = 0; + var result = {}; + + if (isArray(collection)) { + size = collection.length; + iterate = iterator.length === 3 ? arrayIteratorWithIndex : arrayIterator; + } else if (!collection) { + } else if (iteratorSymbol && collection[iteratorSymbol]) { + size = Infinity; + iter = collection[iteratorSymbol](); + iterate = iterator.length === 3 ? symbolIteratorWithKey : symbolIterator; + } else if (typeof collection === obj) { + keys = nativeKeys(collection); + size = keys.length; + iterate = iterator.length === 3 ? objectIteratorWithKey : objectIterator; + } + if (!size) { + return callback(null, result); + } + iterate(); + + function arrayIterator() { + value = collection[completed]; + iterator(value, done); + } + + function arrayIteratorWithIndex() { + value = collection[completed]; + iterator(value, completed, done); + } + + function symbolIterator() { + item = iter.next(); + value = item.value; + item.done ? callback(null, result) : iterator(value, done); + } + + function symbolIteratorWithKey() { + item = iter.next(); + value = item.value; + item.done ? callback(null, result) : iterator(value, completed, done); + } + + function objectIterator() { + value = collection[keys[completed]]; + iterator(value, done); + } + + function objectIteratorWithKey() { + key = keys[completed]; + value = collection[key]; + iterator(value, key, done); + } + + function done(err, key) { + if (err) { + iterate = throwError; + callback = onlyOnce(callback); + callback(err, objectClone(result)); + return; + } + var array = result[key]; + if (!array) { + result[key] = [value]; + } else { + array.push(value); + } + if (++completed === size) { + iterate = throwError; + callback(null, result); + } else if (sync) { + nextTick(iterate); + } else { + sync = true; + iterate(); + } + sync = false; + } + } + + /** + * @memberof async + * @namespace groupByLimit + * @param {Array|Object} collection + * @param {Function} iterator + * @param {Function} callback + * @example + * + * // array + * var order = []; + * var array = [1.1, 5.9, 3.2, 3.9, 2.1]; + * var iterator = function(num, done) { + * setTimeout(function() { + * order.push(num); + * done(null, Math.floor(num)); + * }, num * 10); + * }; + * async.groupByLimit(array, 2, iterator, function(err, res) { + * console.log(res); // { '1': [1.1], '3': [3.2, 3.9], '5': [5.9], '2': [2.1] } + * console.log(order); // [1.1, 3.2, 5.9, 2.1, 3.9] + * }); + * + * @example + * + * // array with index + * var order = []; + * var array = [1.1, 5.9, 3.2, 3.9, 2.1]; + * var iterator = function(num, index, done) { + * setTimeout(function() { + * order.push([num, index]); + * done(null, Math.floor(num)); + * }, num * 10); + * }; + * async.groupByLimit(array, 2, iterator, function(err, res) { + * console.log(res); // { '1': [1.1], '3': [3.2, 3.9], '5': [5.9], '2': [2.1] } + * console.log(order); // [[1.1, 0], [3.2, 2], [5.9, 1], [2.1, 4], [3.9, 3]] + * }); + * + * @example + * + * // object + * var order = []; + * var object = { a: 1.1, b: 5.9, c: 3.2, d: 3.9, e: 2.1 } + * var iterator = function(num, done) { + * setTimeout(function() { + * order.push(num); + * done(null, Math.floor(num)); + * }, num * 10); + * }; + * async.groupByLimit(object, 2, iterator, function(err, res) { + * console.log(res); // { '1': [1.1], '3': [3.2, 3.9], '5': [5.9], '2': [2.1] } + * console.log(order); // [1.1, 3.2, 5.9, 2.1, 3.9] + * }); + * + * @example + * + * // object with key + * var order = []; + * var object = { a: 1.1, b: 5.9, c: 3.2, d: 3.9, e: 2.1 } + * var iterator = function(num, key, done) { + * setTimeout(function() { + * order.push([num, key]); + * done(null, Math.floor(num)); + * }, num * 10); + * }; + * async.groupByLimit(object, 2, iterator, function(err, res) { + * console.log(res); // { '1': [1.1], '3': [3.2, 3.9], '5': [5.9], '2': [2.1] } + * console.log(order); // [[1.1, 'a'], [3.2, 'c'], [5.9, 'b'], [2.1, 'e'], [3.9, 'd']] + * }); + * + */ + function groupByLimit(collection, limit, iterator, callback) { + callback = callback || noop; + var size, index, key, value, keys, iter, item, iterate; + var sync = false; + var started = 0; + var completed = 0; + var result = {}; + + if (isArray(collection)) { + size = collection.length; + iterate = iterator.length === 3 ? arrayIteratorWithIndex : arrayIterator; + } else if (!collection) { + } else if (iteratorSymbol && collection[iteratorSymbol]) { + size = Infinity; + iter = collection[iteratorSymbol](); + iterate = iterator.length === 3 ? symbolIteratorWithKey : symbolIterator; + } else if (typeof collection === obj) { + keys = nativeKeys(collection); + size = keys.length; + iterate = iterator.length === 3 ? objectIteratorWithKey : objectIterator; + } + if (!size || isNaN(limit) || limit < 1) { + return callback(null, result); + } + timesSync(limit > size ? size : limit, iterate); + + function arrayIterator() { + if (started < size) { + value = collection[started++]; + iterator(value, createCallback(value)); + } + } + + function arrayIteratorWithIndex() { + index = started++; + if (index < size) { + value = collection[index]; + iterator(value, index, createCallback(value)); + } + } + + function symbolIterator() { + item = iter.next(); + if (item.done === false) { + started++; + value = item.value; + iterator(value, createCallback(value)); + } else if (completed === started && iterator !== noop) { + iterator = noop; + callback(null, result); + } + } + + function symbolIteratorWithKey() { + item = iter.next(); + if (item.done === false) { + value = item.value; + iterator(value, started++, createCallback(value)); + } else if (completed === started && iterator !== noop) { + iterator = noop; + callback(null, result); + } + } + + function objectIterator() { + if (started < size) { + value = collection[keys[started++]]; + iterator(value, createCallback(value)); + } + } + + function objectIteratorWithKey() { + if (started < size) { + key = keys[started++]; + value = collection[key]; + iterator(value, key, createCallback(value)); + } + } + + function createCallback(value) { + var called = false; + return function(err, key) { + if (called) { + throwError(); + } + called = true; + if (err) { + iterate = noop; + callback = once(callback); + callback(err, objectClone(result)); + return; + } + var array = result[key]; + if (!array) { + result[key] = [value]; + } else { + array.push(value); + } + if (++completed === size) { + callback(null, result); + } else if (sync) { + nextTick(iterate); + } else { + sync = true; + iterate(); + } + sync = false; + }; + } + } + + /** + * @private + * @param {Function} arrayEach + * @param {Function} baseEach + */ + function createParallel(arrayEach, baseEach) { + return function parallel(tasks, callback) { + callback = callback || noop; + var size, keys, result; + var completed = 0; + + if (isArray(tasks)) { + size = tasks.length; + result = Array(size); + arrayEach(tasks, createCallback); + } else if (tasks && typeof tasks === obj) { + keys = nativeKeys(tasks); + size = keys.length; + result = {}; + baseEach(tasks, createCallback, keys); + } + if (!size) { + callback(null, result); + } + + function createCallback(key) { + return function(err, res) { + if (key === null) { + throwError(); + } + if (err) { + key = null; + callback = once(callback); + callback(err, result); + return; + } + result[key] = arguments.length <= 2 ? res : slice(arguments, 1); + key = null; + if (++completed === size) { + callback(null, result); + } + }; + } + }; + } + + /** + * @memberof async + * @namespace series + * @param {Array|Object} tasks - functions + * @param {Function} callback + * @example + * + * var order = []; + * var tasks = [ + * function(done) { + * setTimeout(function() { + * order.push(1); + * done(null, 1); + * }, 10); + * }, + * function(done) { + * setTimeout(function() { + * order.push(2); + * done(null, 2); + * }, 30); + * }, + * function(done) { + * setTimeout(function() { + * order.push(3); + * done(null, 3); + * }, 40); + * }, + * function(done) { + * setTimeout(function() { + * order.push(4); + * done(null, 4); + * }, 20); + * } + * ]; + * async.series(tasks, function(err, res) { + * console.log(res); // [1, 2, 3, 4]; + * console.log(order); // [1, 2, 3, 4] + * }); + * + * @example + * + * var order = []; + * var tasks = { + * 'a': function(done) { + * setTimeout(function() { + * order.push(1); + * done(null, 1); + * }, 10); + * }, + * 'b': function(done) { + * setTimeout(function() { + * order.push(2); + * done(null, 2); + * }, 30); + * }, + * 'c': function(done) { + * setTimeout(function() { + * order.push(3); + * done(null, 3); + * }, 40); + * }, + * 'd': function(done) { + * setTimeout(function() { + * order.push(4); + * done(null, 4); + * }, 20); + * } + * }; + * async.series(tasks, function(err, res) { + * console.log(res); // { a: 1, b: 2, c: 3, d:4 } + * console.log(order); // [1, 4, 2, 3] + * }); + * + */ + function series(tasks, callback) { + callback = callback || noop; + var size, key, keys, result, iterate; + var sync = false; + var completed = 0; + + if (isArray(tasks)) { + size = tasks.length; + result = Array(size); + iterate = arrayIterator; + } else if (tasks && typeof tasks === obj) { + keys = nativeKeys(tasks); + size = keys.length; + result = {}; + iterate = objectIterator; + } else { + return callback(null); + } + if (!size) { + return callback(null, result); + } + iterate(); + + function arrayIterator() { + key = completed; + tasks[completed](done); + } + + function objectIterator() { + key = keys[completed]; + tasks[key](done); + } + + function done(err, res) { + if (err) { + iterate = throwError; + callback = onlyOnce(callback); + callback(err, result); + return; + } + result[key] = arguments.length <= 2 ? res : slice(arguments, 1); + if (++completed === size) { + iterate = throwError; + callback(null, result); + } else if (sync) { + nextTick(iterate); + } else { + sync = true; + iterate(); + } + sync = false; + } + } + + /** + * @memberof async + * @namespace parallelLimit + * @param {Array|Object} tasks - functions + * @param {number} limit - limit >= 1 + * @param {Function} callback + * @example + * + * var order = []; + * var tasks = [ + * function(done) { + * setTimeout(function() { + * order.push(1); + * done(null, 1); + * }, 10); + * }, + * function(done) { + * setTimeout(function() { + * order.push(2); + * done(null, 2); + * }, 50); + * }, + * function(done) { + * setTimeout(function() { + * order.push(3); + * done(null, 3); + * }, 30); + * }, + * function(done) { + * setTimeout(function() { + * order.push(4); + * done(null, 4); + * }, 40); + * } + * ]; + * async.parallelLimit(tasks, 2, function(err, res) { + * console.log(res); // [1, 2, 3, 4]; + * console.log(order); // [1, 3, 2, 4] + * }); + * + * @example + * + * var order = []; + * var tasks = { + * 'a': function(done) { + * setTimeout(function() { + * order.push(1); + * done(null, 1); + * }, 10); + * }, + * 'b': function(done) { + * setTimeout(function() { + * order.push(2); + * done(null, 2); + * }, 50); + * }, + * 'c': function(done) { + * setTimeout(function() { + * order.push(3); + * done(null, 3); + * }, 20); + * }, + * 'd': function(done) { + * setTimeout(function() { + * order.push(4); + * done(null, 4); + * }, 40); + * } + * }; + * async.parallelLimit(tasks, 2, function(err, res) { + * console.log(res); // { a: 1, b: 2, c: 3, d:4 } + * console.log(order); // [1, 3, 2, 4] + * }); + * + */ + function parallelLimit(tasks, limit, callback) { + callback = callback || noop; + var size, index, key, keys, result, iterate; + var sync = false; + var started = 0; + var completed = 0; + + if (isArray(tasks)) { + size = tasks.length; + result = Array(size); + iterate = arrayIterator; + } else if (tasks && typeof tasks === obj) { + keys = nativeKeys(tasks); + size = keys.length; + result = {}; + iterate = objectIterator; + } + if (!size || isNaN(limit) || limit < 1) { + return callback(null, result); + } + timesSync(limit > size ? size : limit, iterate); + + function arrayIterator() { + index = started++; + if (index < size) { + tasks[index](createCallback(index)); + } + } + + function objectIterator() { + if (started < size) { + key = keys[started++]; + tasks[key](createCallback(key)); + } + } + + function createCallback(key) { + return function(err, res) { + if (key === null) { + throwError(); + } + if (err) { + key = null; + iterate = noop; + callback = once(callback); + callback(err, result); + return; + } + result[key] = arguments.length <= 2 ? res : slice(arguments, 1); + key = null; + if (++completed === size) { + callback(null, result); + } else if (sync) { + nextTick(iterate); + } else { + sync = true; + iterate(); + } + sync = false; + }; + } + } + + /** + * @memberof async + * @namespace tryEach + * @param {Array|Object} tasks - functions + * @param {Function} callback + * @example + * + * var tasks = [ + * function(done) { + * setTimeout(function() { + * done(new Error('error')); + * }, 10); + * }, + * function(done) { + * setTimeout(function() { + * done(null, 2); + * }, 10); + * } + * ]; + * async.tryEach(tasks, function(err, res) { + * console.log(res); // 2 + * }); + * + * @example + * + * var tasks = [ + * function(done) { + * setTimeout(function() { + * done(new Error('error1')); + * }, 10); + * }, + * function(done) { + * setTimeout(function() { + * done(new Error('error2'); + * }, 10); + * } + * ]; + * async.tryEach(tasks, function(err, res) { + * console.log(err); // error2 + * console.log(res); // undefined + * }); + * + */ + function tryEach(tasks, callback) { + callback = callback || noop; + var size, keys, iterate; + var sync = false; + var completed = 0; + + if (isArray(tasks)) { + size = tasks.length; + iterate = arrayIterator; + } else if (tasks && typeof tasks === obj) { + keys = nativeKeys(tasks); + size = keys.length; + iterate = objectIterator; + } + if (!size) { + return callback(null); + } + iterate(); + + function arrayIterator() { + tasks[completed](done); + } + + function objectIterator() { + tasks[keys[completed]](done); + } + + function done(err, res) { + if (!err) { + if (arguments.length <= 2) { + callback(null, res); + } else { + callback(null, slice(arguments, 1)); + } + } else if (++completed === size) { + callback(err); + } else { + sync = true; + iterate(); + } + sync = false; + } + } + + /** + * check for waterfall tasks + * @private + * @param {Array} tasks + * @param {Function} callback + * @return {boolean} + */ + function checkWaterfallTasks(tasks, callback) { + if (!isArray(tasks)) { + callback(new Error('First argument to waterfall must be an array of functions')); + return false; + } + if (tasks.length === 0) { + callback(null); + return false; + } + return true; + } + + /** + * check for waterfall tasks + * @private + * @param {function} func + * @param {Array|Object} args - arguments + * @return {function} next + */ + function waterfallIterator(func, args, next) { + switch (args.length) { + case 0: + case 1: + return func(next); + case 2: + return func(args[1], next); + case 3: + return func(args[1], args[2], next); + case 4: + return func(args[1], args[2], args[3], next); + case 5: + return func(args[1], args[2], args[3], args[4], next); + case 6: + return func(args[1], args[2], args[3], args[4], args[5], next); + default: + args = slice(args, 1); + args.push(next); + return func.apply(null, args); + } + } + + /** + * @memberof async + * @namespace waterfall + * @param {Array} tasks - functions + * @param {Function} callback + * @example + * + * var order = []; + * var tasks = [ + * function(next) { + * setTimeout(function() { + * order.push(1); + * next(null, 1); + * }, 10); + * }, + * function(arg1, next) { + * setTimeout(function() { + * order.push(2); + * next(null, 1, 2); + * }, 30); + * }, + * function(arg1, arg2, next) { + * setTimeout(function() { + * order.push(3); + * next(null, 3); + * }, 20); + * }, + * function(arg1, next) { + * setTimeout(function() { + * order.push(4); + * next(null, 1, 2, 3, 4); + * }, 40); + * } + * ]; + * async.waterfall(tasks, function(err, arg1, arg2, arg3, arg4) { + * console.log(arg1, arg2, arg3, arg4); // 1 2 3 4 + * }); + * + */ + function waterfall(tasks, callback) { + callback = callback || noop; + if (!checkWaterfallTasks(tasks, callback)) { + return; + } + var func, args, done, sync; + var completed = 0; + var size = tasks.length; + waterfallIterator(tasks[0], [], createCallback(0)); + + function iterate() { + waterfallIterator(func, args, createCallback(func)); + } + + function createCallback(index) { + return function next(err, res) { + if (index === undefined) { + callback = noop; + throwError(); + } + index = undefined; + if (err) { + done = callback; + callback = throwError; + done(err); + return; + } + if (++completed === size) { + done = callback; + callback = throwError; + if (arguments.length <= 2) { + done(err, res); + } else { + done.apply(null, createArray(arguments)); + } + return; + } + if (sync) { + args = arguments; + func = tasks[completed] || throwError; + nextTick(iterate); + } else { + sync = true; + waterfallIterator(tasks[completed] || throwError, arguments, createCallback(completed)); + } + sync = false; + }; + } + } + + /** + * `angelFall` is like `waterfall` and inject callback to last argument of next task. + * + * @memberof async + * @namespace angelFall + * @param {Array} tasks - functions + * @param {Function} callback + * @example + * + * var order = []; + * var tasks = [ + * function(next) { + * setTimeout(function() { + * order.push(1); + * next(null, 1); + * }, 10); + * }, + * function(arg1, empty, next) { + * setTimeout(function() { + * order.push(2); + * next(null, 1, 2); + * }, 30); + * }, + * function(next) { + * setTimeout(function() { + * order.push(3); + * next(null, 3); + * }, 20); + * }, + * function(arg1, empty1, empty2, empty3, next) { + * setTimeout(function() { + * order.push(4); + * next(null, 1, 2, 3, 4); + * }, 40); + * } + * ]; + * async.angelFall(tasks, function(err, arg1, arg2, arg3, arg4) { + * console.log(arg1, arg2, arg3, arg4); // 1 2 3 4 + * }); + * + */ + function angelFall(tasks, callback) { + callback = callback || noop; + if (!checkWaterfallTasks(tasks, callback)) { + return; + } + var completed = 0; + var sync = false; + var size = tasks.length; + var func = tasks[completed]; + var args = []; + var iterate = function() { + switch (func.length) { + case 0: + try { + next(null, func()); + } catch (e) { + next(e); + } + return; + case 1: + return func(next); + case 2: + return func(args[1], next); + case 3: + return func(args[1], args[2], next); + case 4: + return func(args[1], args[2], args[3], next); + case 5: + return func(args[1], args[2], args[3], args[4], next); + default: + args = slice(args, 1); + args[func.length - 1] = next; + return func.apply(null, args); + } + }; + iterate(); + + function next(err, res) { + if (err) { + iterate = throwError; + callback = onlyOnce(callback); + callback(err); + return; + } + if (++completed === size) { + iterate = throwError; + var done = callback; + callback = throwError; + if (arguments.length === 2) { + done(err, res); + } else { + done.apply(null, createArray(arguments)); + } + return; + } + func = tasks[completed]; + args = arguments; + if (sync) { + nextTick(iterate); + } else { + sync = true; + iterate(); + } + sync = false; + } + } + + /** + * @memberof async + * @namespace whilst + * @param {Function} test + * @param {Function} iterator + * @param {Function} callback + */ + function whilst(test, iterator, callback) { + callback = callback || noop; + var sync = false; + if (test()) { + iterate(); + } else { + callback(null); + } + + function iterate() { + if (sync) { + nextTick(next); + } else { + sync = true; + iterator(done); + } + sync = false; + } + + function next() { + iterator(done); + } + + function done(err, arg) { + if (err) { + return callback(err); + } + if (arguments.length <= 2) { + if (test(arg)) { + iterate(); + } else { + callback(null, arg); + } + return; + } + arg = slice(arguments, 1); + if (test.apply(null, arg)) { + iterate(); + } else { + callback.apply(null, [null].concat(arg)); + } + } + } + + /** + * @memberof async + * @namespace doWhilst + * @param {Function} iterator + * @param {Function} test + * @param {Function} callback + */ + function doWhilst(iterator, test, callback) { + callback = callback || noop; + var sync = false; + next(); + + function iterate() { + if (sync) { + nextTick(next); + } else { + sync = true; + iterator(done); + } + sync = false; + } + + function next() { + iterator(done); + } + + function done(err, arg) { + if (err) { + return callback(err); + } + if (arguments.length <= 2) { + if (test(arg)) { + iterate(); + } else { + callback(null, arg); + } + return; + } + arg = slice(arguments, 1); + if (test.apply(null, arg)) { + iterate(); + } else { + callback.apply(null, [null].concat(arg)); + } + } + } + + /** + * @memberof async + * @namespace until + * @param {Function} test + * @param {Function} iterator + * @param {Function} callback + */ + function until(test, iterator, callback) { + callback = callback || noop; + var sync = false; + if (!test()) { + iterate(); + } else { + callback(null); + } + + function iterate() { + if (sync) { + nextTick(next); + } else { + sync = true; + iterator(done); + } + sync = false; + } + + function next() { + iterator(done); + } + + function done(err, arg) { + if (err) { + return callback(err); + } + if (arguments.length <= 2) { + if (!test(arg)) { + iterate(); + } else { + callback(null, arg); + } + return; + } + arg = slice(arguments, 1); + if (!test.apply(null, arg)) { + iterate(); + } else { + callback.apply(null, [null].concat(arg)); + } + } + } + + /** + * @memberof async + * @namespace doUntil + * @param {Function} iterator + * @param {Function} test + * @param {Function} callback + */ + function doUntil(iterator, test, callback) { + callback = callback || noop; + var sync = false; + next(); + + function iterate() { + if (sync) { + nextTick(next); + } else { + sync = true; + iterator(done); + } + sync = false; + } + + function next() { + iterator(done); + } + + function done(err, arg) { + if (err) { + return callback(err); + } + if (arguments.length <= 2) { + if (!test(arg)) { + iterate(); + } else { + callback(null, arg); + } + return; + } + arg = slice(arguments, 1); + if (!test.apply(null, arg)) { + iterate(); + } else { + callback.apply(null, [null].concat(arg)); + } + } + } + + /** + * @memberof async + * @namespace during + * @param {Function} test + * @param {Function} iterator + * @param {Function} callback + */ + function during(test, iterator, callback) { + callback = callback || noop; + _test(); + + function _test() { + test(iterate); + } + + function iterate(err, truth) { + if (err) { + return callback(err); + } + if (truth) { + iterator(done); + } else { + callback(null); + } + } + + function done(err) { + if (err) { + return callback(err); + } + _test(); + } + } + + /** + * @memberof async + * @namespace doDuring + * @param {Function} test + * @param {Function} iterator + * @param {Function} callback + */ + function doDuring(iterator, test, callback) { + callback = callback || noop; + iterate(null, true); + + function iterate(err, truth) { + if (err) { + return callback(err); + } + if (truth) { + iterator(done); + } else { + callback(null); + } + } + + function done(err, res) { + if (err) { + return callback(err); + } + switch (arguments.length) { + case 0: + case 1: + test(iterate); + break; + case 2: + test(res, iterate); + break; + default: + var args = slice(arguments, 1); + args.push(iterate); + test.apply(null, args); + break; + } + } + } + + /** + * @memberof async + * @namespace forever + */ + function forever(iterator, callback) { + var sync = false; + iterate(); + + function iterate() { + iterator(next); + } + + function next(err) { + if (err) { + if (callback) { + return callback(err); + } + throw err; + } + if (sync) { + nextTick(iterate); + } else { + sync = true; + iterate(); + } + sync = false; + } + } + + /** + * @memberof async + * @namespace compose + */ + function compose() { + return seq.apply(null, reverse(arguments)); + } + + /** + * @memberof async + * @namespace seq + */ + function seq(/* functions... */) { + var fns = createArray(arguments); + + return function() { + var self = this; + var args = createArray(arguments); + var callback = args[args.length - 1]; + if (typeof callback === func) { + args.pop(); + } else { + callback = noop; + } + reduce(fns, args, iterator, done); + + function iterator(newargs, fn, callback) { + var func = function(err) { + var nextargs = slice(arguments, 1); + callback(err, nextargs); + }; + newargs.push(func); + fn.apply(self, newargs); + } + + function done(err, res) { + res = isArray(res) ? res : [res]; + res.unshift(err); + callback.apply(self, res); + } + }; + } + + function createApplyEach(func) { + return function applyEach(fns /* arguments */) { + var go = function() { + var self = this; + var args = createArray(arguments); + var callback = args.pop() || noop; + return func(fns, iterator, callback); + + function iterator(fn, done) { + fn.apply(self, args.concat([done])); + } + }; + if (arguments.length > 1) { + var args = slice(arguments, 1); + return go.apply(this, args); + } else { + return go; + } + }; + } + + /** + * @see https://github.com/caolan/async/blob/master/lib/internal/DoublyLinkedList.js + */ + function DLL() { + this.head = null; + this.tail = null; + this.length = 0; + } + + DLL.prototype._removeLink = function(node) { + var prev = node.prev; + var next = node.next; + if (prev) { + prev.next = next; + } else { + this.head = next; + } + if (next) { + next.prev = prev; + } else { + this.tail = prev; + } + node.prev = null; + node.next = null; + this.length--; + return node; + }; + + DLL.prototype.empty = DLL; + + DLL.prototype._setInitial = function(node) { + this.length = 1; + this.head = this.tail = node; + }; + + DLL.prototype.insertBefore = function(node, newNode) { + newNode.prev = node.prev; + newNode.next = node; + if (node.prev) { + node.prev.next = newNode; + } else { + this.head = newNode; + } + node.prev = newNode; + this.length++; + }; + + DLL.prototype.unshift = function(node) { + if (this.head) { + this.insertBefore(this.head, node); + } else { + this._setInitial(node); + } + }; + + DLL.prototype.push = function(node) { + var tail = this.tail; + if (tail) { + node.prev = tail; + node.next = tail.next; + this.tail = node; + tail.next = node; + this.length++; + } else { + this._setInitial(node); + } + }; + + DLL.prototype.shift = function() { + return this.head && this._removeLink(this.head); + }; + + DLL.prototype.splice = function(end) { + var task; + var tasks = []; + while (end-- && (task = this.shift())) { + tasks.push(task); + } + return tasks; + }; + + DLL.prototype.remove = function(test) { + var node = this.head; + while (node) { + if (test(node)) { + this._removeLink(node); + } + node = node.next; + } + return this; + }; + + /** + * @private + */ + function baseQueue(isQueue, worker, concurrency, payload) { + if (concurrency === undefined) { + concurrency = 1; + } else if (isNaN(concurrency) || concurrency < 1) { + throw new Error('Concurrency must not be zero'); + } + + var workers = 0; + var workersList = []; + var _callback, _unshift; + + var q = { + _tasks: new DLL(), + concurrency: concurrency, + payload: payload, + saturated: noop, + unsaturated: noop, + buffer: concurrency / 4, + empty: noop, + drain: noop, + error: noop, + started: false, + paused: false, + push: push, + kill: kill, + unshift: unshift, + remove: remove, + process: isQueue ? runQueue : runCargo, + length: getLength, + running: running, + workersList: getWorkersList, + idle: idle, + pause: pause, + resume: resume, + _worker: worker + }; + return q; + + function push(tasks, callback) { + _insert(tasks, callback); + } + + function unshift(tasks, callback) { + _insert(tasks, callback, true); + } + + function _exec(task) { + var item = { + data: task, + callback: _callback + }; + if (_unshift) { + q._tasks.unshift(item); + } else { + q._tasks.push(item); + } + nextTick(q.process); + } + + function _insert(tasks, callback, unshift) { + if (callback == null) { + callback = noop; + } else if (typeof callback !== 'function') { + throw new Error('task callback must be a function'); + } + q.started = true; + var _tasks = isArray(tasks) ? tasks : [tasks]; + + if (tasks === undefined || !_tasks.length) { + if (q.idle()) { + nextTick(q.drain); + } + return; + } + + _unshift = unshift; + _callback = callback; + arrayEachSync(_tasks, _exec); + // Avoid leaking the callback + _callback = undefined; + } + + function kill() { + q.drain = noop; + q._tasks.empty(); + } + + function _next(q, tasks) { + var called = false; + return function done(err, res) { + if (called) { + throwError(); + } + called = true; + + workers--; + var task; + var index = -1; + var size = workersList.length; + var taskIndex = -1; + var taskSize = tasks.length; + var useApply = arguments.length > 2; + var args = useApply && createArray(arguments); + while (++taskIndex < taskSize) { + task = tasks[taskIndex]; + while (++index < size) { + if (workersList[index] === task) { + if (index === 0) { + workersList.shift(); + } else { + workersList.splice(index, 1); + } + index = size; + size--; + } + } + index = -1; + if (useApply) { + task.callback.apply(task, args); + } else { + task.callback(err, res); + } + if (err) { + q.error(err, task.data); + } + } + + if (workers <= q.concurrency - q.buffer) { + q.unsaturated(); + } + + if (q._tasks.length + workers === 0) { + q.drain(); + } + q.process(); + }; + } + + function runQueue() { + while (!q.paused && workers < q.concurrency && q._tasks.length) { + var task = q._tasks.shift(); + workers++; + workersList.push(task); + if (q._tasks.length === 0) { + q.empty(); + } + if (workers === q.concurrency) { + q.saturated(); + } + var done = _next(q, [task]); + worker(task.data, done); + } + } + + function runCargo() { + while (!q.paused && workers < q.concurrency && q._tasks.length) { + var tasks = q._tasks.splice(q.payload || q._tasks.length); + var index = -1; + var size = tasks.length; + var data = Array(size); + while (++index < size) { + data[index] = tasks[index].data; + } + workers++; + nativePush.apply(workersList, tasks); + if (q._tasks.length === 0) { + q.empty(); + } + if (workers === q.concurrency) { + q.saturated(); + } + var done = _next(q, tasks); + worker(data, done); + } + } + + function getLength() { + return q._tasks.length; + } + + function running() { + return workers; + } + + function getWorkersList() { + return workersList; + } + + function idle() { + return q.length() + workers === 0; + } + + function pause() { + q.paused = true; + } + + function _resume() { + nextTick(q.process); + } + + function resume() { + if (q.paused === false) { + return; + } + q.paused = false; + var count = q.concurrency < q._tasks.length ? q.concurrency : q._tasks.length; + timesSync(count, _resume); + } + + /** + * @param {Function} test + */ + function remove(test) { + q._tasks.remove(test); + } + } + + /** + * @memberof async + * @namespace queue + */ + function queue(worker, concurrency) { + return baseQueue(true, worker, concurrency); + } + + /** + * @memberof async + * @namespace priorityQueue + */ + function priorityQueue(worker, concurrency) { + var q = baseQueue(true, worker, concurrency); + q.push = push; + delete q.unshift; + return q; + + function push(tasks, priority, callback) { + q.started = true; + priority = priority || 0; + var _tasks = isArray(tasks) ? tasks : [tasks]; + var taskSize = _tasks.length; + + if (tasks === undefined || taskSize === 0) { + if (q.idle()) { + nextTick(q.drain); + } + return; + } + + callback = typeof callback === func ? callback : noop; + var nextNode = q._tasks.head; + while (nextNode && priority >= nextNode.priority) { + nextNode = nextNode.next; + } + while (taskSize--) { + var item = { + data: _tasks[taskSize], + priority: priority, + callback: callback + }; + if (nextNode) { + q._tasks.insertBefore(nextNode, item); + } else { + q._tasks.push(item); + } + nextTick(q.process); + } + } + } + + /** + * @memberof async + * @namespace cargo + */ + function cargo(worker, payload) { + return baseQueue(false, worker, 1, payload); + } + + /** + * @memberof async + * @namespace auto + * @param {Object} tasks + * @param {number} [concurrency] + * @param {Function} [callback] + */ + function auto(tasks, concurrency, callback) { + if (typeof concurrency === func) { + callback = concurrency; + concurrency = null; + } + var keys = nativeKeys(tasks); + var rest = keys.length; + var results = {}; + if (rest === 0) { + return callback(null, results); + } + var runningTasks = 0; + var readyTasks = new DLL(); + var listeners = Object.create(null); + callback = onlyOnce(callback || noop); + concurrency = concurrency || rest; + + baseEachSync(tasks, iterator, keys); + proceedQueue(); + + function iterator(task, key) { + // no dependencies + var _task, _taskSize; + if (!isArray(task)) { + _task = task; + _taskSize = 0; + readyTasks.push([_task, _taskSize, done]); + return; + } + var dependencySize = task.length - 1; + _task = task[dependencySize]; + _taskSize = dependencySize; + if (dependencySize === 0) { + readyTasks.push([_task, _taskSize, done]); + return; + } + // dependencies + var index = -1; + while (++index < dependencySize) { + var dependencyName = task[index]; + if (notInclude(keys, dependencyName)) { + var msg = + 'async.auto task `' + + key + + '` has non-existent dependency `' + + dependencyName + + '` in ' + + task.join(', '); + throw new Error(msg); + } + var taskListeners = listeners[dependencyName]; + if (!taskListeners) { + taskListeners = listeners[dependencyName] = []; + } + taskListeners.push(taskListener); + } + + function done(err, arg) { + if (key === null) { + throwError(); + } + arg = arguments.length <= 2 ? arg : slice(arguments, 1); + if (err) { + rest = 0; + runningTasks = 0; + readyTasks.length = 0; + var safeResults = objectClone(results); + safeResults[key] = arg; + key = null; + var _callback = callback; + callback = noop; + _callback(err, safeResults); + return; + } + runningTasks--; + rest--; + results[key] = arg; + taskComplete(key); + key = null; + } + + function taskListener() { + if (--dependencySize === 0) { + readyTasks.push([_task, _taskSize, done]); + } + } + } + + function proceedQueue() { + if (readyTasks.length === 0 && runningTasks === 0) { + if (rest !== 0) { + throw new Error('async.auto task has cyclic dependencies'); + } + return callback(null, results); + } + while (readyTasks.length && runningTasks < concurrency && callback !== noop) { + runningTasks++; + var array = readyTasks.shift(); + if (array[1] === 0) { + array[0](array[2]); + } else { + array[0](results, array[2]); + } + } + } + + function taskComplete(key) { + var taskListeners = listeners[key] || []; + arrayEachSync(taskListeners, function(task) { + task(); + }); + proceedQueue(); + } + } + + var FN_ARGS = /^(function)?\s*[^\(]*\(\s*([^\)]*)\)/m; + var FN_ARG_SPLIT = /,/; + var FN_ARG = /(=.+)?(\s*)$/; + var STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm; + + /** + * parse function arguments for `autoInject` + * + * @private + */ + function parseParams(func) { + func = func.toString().replace(STRIP_COMMENTS, ''); + func = func.match(FN_ARGS)[2].replace(' ', ''); + func = func ? func.split(FN_ARG_SPLIT) : []; + func = func.map(function(arg) { + return arg.replace(FN_ARG, '').trim(); + }); + return func; + } + + /** + * @memberof async + * @namespace autoInject + * @param {Object} tasks + * @param {number} [concurrency] + * @param {Function} [callback] + */ + function autoInject(tasks, concurrency, callback) { + var newTasks = {}; + baseEachSync(tasks, iterator, nativeKeys(tasks)); + auto(newTasks, concurrency, callback); + + function iterator(task, key) { + var params; + var taskLength = task.length; + + if (isArray(task)) { + if (taskLength === 0) { + throw new Error('autoInject task functions require explicit parameters.'); + } + params = createArray(task); + taskLength = params.length - 1; + task = params[taskLength]; + if (taskLength === 0) { + newTasks[key] = task; + return; + } + } else if (taskLength === 1) { + newTasks[key] = task; + return; + } else { + params = parseParams(task); + if (taskLength === 0 && params.length === 0) { + throw new Error('autoInject task functions require explicit parameters.'); + } + taskLength = params.length - 1; + } + params[taskLength] = newTask; + newTasks[key] = params; + + function newTask(results, done) { + switch (taskLength) { + case 1: + task(results[params[0]], done); + break; + case 2: + task(results[params[0]], results[params[1]], done); + break; + case 3: + task(results[params[0]], results[params[1]], results[params[2]], done); + break; + default: + var i = -1; + while (++i < taskLength) { + params[i] = results[params[i]]; + } + params[i] = done; + task.apply(null, params); + break; + } + } + } + } + + /** + * @memberof async + * @namespace retry + * @param {integer|Object|Function} opts + * @param {Function} [task] + * @param {Function} [callback] + */ + function retry(opts, task, callback) { + var times, intervalFunc, errorFilter; + var count = 0; + if (arguments.length < 3 && typeof opts === func) { + callback = task || noop; + task = opts; + opts = null; + times = DEFAULT_TIMES; + } else { + callback = callback || noop; + switch (typeof opts) { + case 'object': + if (typeof opts.errorFilter === func) { + errorFilter = opts.errorFilter; + } + var interval = opts.interval; + switch (typeof interval) { + case func: + intervalFunc = interval; + break; + case 'string': + case 'number': + interval = +interval; + intervalFunc = interval + ? function() { + return interval; + } + : function() { + return DEFAULT_INTERVAL; + }; + break; + } + times = +opts.times || DEFAULT_TIMES; + break; + case 'number': + times = opts || DEFAULT_TIMES; + break; + case 'string': + times = +opts || DEFAULT_TIMES; + break; + default: + throw new Error('Invalid arguments for async.retry'); + } + } + if (typeof task !== 'function') { + throw new Error('Invalid arguments for async.retry'); + } + + if (intervalFunc) { + task(intervalCallback); + } else { + task(simpleCallback); + } + + function simpleIterator() { + task(simpleCallback); + } + + function simpleCallback(err, res) { + if (++count === times || !err || (errorFilter && !errorFilter(err))) { + if (arguments.length <= 2) { + return callback(err, res); + } + var args = createArray(arguments); + return callback.apply(null, args); + } + simpleIterator(); + } + + function intervalIterator() { + task(intervalCallback); + } + + function intervalCallback(err, res) { + if (++count === times || !err || (errorFilter && !errorFilter(err))) { + if (arguments.length <= 2) { + return callback(err, res); + } + var args = createArray(arguments); + return callback.apply(null, args); + } + setTimeout(intervalIterator, intervalFunc(count)); + } + } + + function retryable(opts, task) { + if (!task) { + task = opts; + opts = null; + } + return done; + + function done() { + var taskFn; + var args = createArray(arguments); + var lastIndex = args.length - 1; + var callback = args[lastIndex]; + switch (task.length) { + case 1: + taskFn = task1; + break; + case 2: + taskFn = task2; + break; + case 3: + taskFn = task3; + break; + default: + taskFn = task4; + } + if (opts) { + retry(opts, taskFn, callback); + } else { + retry(taskFn, callback); + } + + function task1(done) { + task(done); + } + + function task2(done) { + task(args[0], done); + } + + function task3(done) { + task(args[0], args[1], done); + } + + function task4(callback) { + args[lastIndex] = callback; + task.apply(null, args); + } + } + } + + /** + * @memberof async + * @namespace iterator + */ + function iterator(tasks) { + var size = 0; + var keys = []; + if (isArray(tasks)) { + size = tasks.length; + } else { + keys = nativeKeys(tasks); + size = keys.length; + } + return makeCallback(0); + + function makeCallback(index) { + var fn = function() { + if (size) { + var key = keys[index] || index; + tasks[key].apply(null, createArray(arguments)); + } + return fn.next(); + }; + fn.next = function() { + return index < size - 1 ? makeCallback(index + 1) : null; + }; + return fn; + } + } + + /** + * @memberof async + * @namespace apply + */ + function apply(func) { + switch (arguments.length) { + case 0: + case 1: + return func; + case 2: + return func.bind(null, arguments[1]); + case 3: + return func.bind(null, arguments[1], arguments[2]); + case 4: + return func.bind(null, arguments[1], arguments[2], arguments[3]); + case 5: + return func.bind(null, arguments[1], arguments[2], arguments[3], arguments[4]); + default: + var size = arguments.length; + var index = 0; + var args = Array(size); + args[index] = null; + while (++index < size) { + args[index] = arguments[index]; + } + return func.bind.apply(func, args); + } + } + + /** + * @memberof async + * @namespace timeout + * @param {Function} func + * @param {number} millisec + * @param {*} info + */ + function timeout(func, millisec, info) { + var callback, timer; + return wrappedFunc; + + function wrappedFunc() { + timer = setTimeout(timeoutCallback, millisec); + var args = createArray(arguments); + var lastIndex = args.length - 1; + callback = args[lastIndex]; + args[lastIndex] = injectedCallback; + simpleApply(func, args); + } + + function timeoutCallback() { + var name = func.name || 'anonymous'; + var err = new Error('Callback function "' + name + '" timed out.'); + err.code = 'ETIMEDOUT'; + if (info) { + err.info = info; + } + timer = null; + callback(err); + } + + function injectedCallback() { + if (timer !== null) { + simpleApply(callback, createArray(arguments)); + clearTimeout(timer); + } + } + + function simpleApply(func, args) { + switch (args.length) { + case 0: + func(); + break; + case 1: + func(args[0]); + break; + case 2: + func(args[0], args[1]); + break; + default: + func.apply(null, args); + break; + } + } + } + + /** + * @memberof async + * @namespace times + * @param {number} n - n >= 1 + * @param {Function} iterator + * @param {Function} callback + * @example + * + * var iterator = function(n, done) { + * done(null, n); + * }; + * async.times(4, iterator, function(err, res) { + * console.log(res); // [0, 1, 2, 3]; + * }); + * + */ + function times(n, iterator, callback) { + callback = callback || noop; + n = +n; + if (isNaN(n) || n < 1) { + return callback(null, []); + } + var result = Array(n); + timesSync(n, iterate); + + function iterate(num) { + iterator(num, createCallback(num)); + } + + function createCallback(index) { + return function(err, res) { + if (index === null) { + throwError(); + } + result[index] = res; + index = null; + if (err) { + callback(err); + callback = noop; + } else if (--n === 0) { + callback(null, result); + } + }; + } + } + + /** + * @memberof async + * @namespace timesSeries + * @param {number} n - n >= 1 + * @param {Function} iterator + * @param {Function} callback + * @example + * + * var iterator = function(n, done) { + * done(null, n); + * }; + * async.timesSeries(4, iterator, function(err, res) { + * console.log(res); // [0, 1, 2, 3]; + * }); + * + */ + function timesSeries(n, iterator, callback) { + callback = callback || noop; + n = +n; + if (isNaN(n) || n < 1) { + return callback(null, []); + } + var result = Array(n); + var sync = false; + var completed = 0; + iterate(); + + function iterate() { + iterator(completed, done); + } + + function done(err, res) { + result[completed] = res; + if (err) { + callback(err); + callback = throwError; + } else if (++completed >= n) { + callback(null, result); + callback = throwError; + } else if (sync) { + nextTick(iterate); + } else { + sync = true; + iterate(); + } + sync = false; + } + } + + /** + * @memberof async + * @namespace timesLimit + * @param {number} n - n >= 1 + * @param {number} limit - n >= 1 + * @param {Function} iterator + * @param {Function} callback + * @example + * + * var iterator = function(n, done) { + * done(null, n); + * }; + * async.timesLimit(4, 2, iterator, function(err, res) { + * console.log(res); // [0, 1, 2, 3]; + * }); + * + */ + function timesLimit(n, limit, iterator, callback) { + callback = callback || noop; + n = +n; + if (isNaN(n) || n < 1 || isNaN(limit) || limit < 1) { + return callback(null, []); + } + var result = Array(n); + var sync = false; + var started = 0; + var completed = 0; + timesSync(limit > n ? n : limit, iterate); + + function iterate() { + var index = started++; + if (index < n) { + iterator(index, createCallback(index)); + } + } + + function createCallback(index) { + return function(err, res) { + if (index === null) { + throwError(); + } + result[index] = res; + index = null; + if (err) { + callback(err); + callback = noop; + } else if (++completed >= n) { + callback(null, result); + callback = throwError; + } else if (sync) { + nextTick(iterate); + } else { + sync = true; + iterate(); + } + sync = false; + }; + } + } + + /** + * @memberof async + * @namespace race + * @param {Array|Object} tasks - functions + * @param {Function} callback + * @example + * + * // array + * var called = 0; + * var tasks = [ + * function(done) { + * setTimeout(function() { + * called++; + * done(null, '1'); + * }, 30); + * }, + * function(done) { + * setTimeout(function() { + * called++; + * done(null, '2'); + * }, 20); + * }, + * function(done) { + * setTimeout(function() { + * called++; + * done(null, '3'); + * }, 10); + * } + * ]; + * async.race(tasks, function(err, res) { + * console.log(res); // '3' + * console.log(called); // 1 + * setTimeout(function() { + * console.log(called); // 3 + * }, 50); + * }); + * + * @example + * + * // object + * var called = 0; + * var tasks = { + * 'test1': function(done) { + * setTimeout(function() { + * called++; + * done(null, '1'); + * }, 30); + * }, + * 'test2': function(done) { + * setTimeout(function() { + * called++; + * done(null, '2'); + * }, 20); + * }, + * 'test3': function(done) { + * setTimeout(function() { + * called++; + * done(null, '3'); + * }, 10); + * } + * }; + * async.race(tasks, function(err, res) { + * console.log(res); // '3' + * console.log(called); // 1 + * setTimeout(function() { + * console.log(called); // 3 + * done(); + * }, 50); + * }); + * + */ + function race(tasks, callback) { + callback = once(callback || noop); + var size, keys; + var index = -1; + if (isArray(tasks)) { + size = tasks.length; + while (++index < size) { + tasks[index](callback); + } + } else if (tasks && typeof tasks === obj) { + keys = nativeKeys(tasks); + size = keys.length; + while (++index < size) { + tasks[keys[index]](callback); + } + } else { + return callback(new TypeError('First argument to race must be a collection of functions')); + } + if (!size) { + callback(null); + } + } + + /** + * @memberof async + * @namespace memoize + */ + function memoize(fn, hasher) { + hasher = + hasher || + function(hash) { + return hash; + }; + + var memo = {}; + var queues = {}; + var memoized = function() { + var args = createArray(arguments); + var callback = args.pop(); + var key = hasher.apply(null, args); + if (has(memo, key)) { + nextTick(function() { + callback.apply(null, memo[key]); + }); + return; + } + if (has(queues, key)) { + return queues[key].push(callback); + } + + queues[key] = [callback]; + args.push(done); + fn.apply(null, args); + + function done(err) { + var args = createArray(arguments); + if (!err) { + memo[key] = args; + } + var q = queues[key]; + delete queues[key]; + + var i = -1; + var size = q.length; + while (++i < size) { + q[i].apply(null, args); + } + } + }; + memoized.memo = memo; + memoized.unmemoized = fn; + return memoized; + } + + /** + * @memberof async + * @namespace unmemoize + */ + function unmemoize(fn) { + return function() { + return (fn.unmemoized || fn).apply(null, arguments); + }; + } + + /** + * @memberof async + * @namespace ensureAsync + */ + function ensureAsync(fn) { + return function(/* ...args, callback */) { + var args = createArray(arguments); + var lastIndex = args.length - 1; + var callback = args[lastIndex]; + var sync = true; + args[lastIndex] = done; + fn.apply(this, args); + sync = false; + + function done() { + var innerArgs = createArray(arguments); + if (sync) { + nextTick(function() { + callback.apply(null, innerArgs); + }); + } else { + callback.apply(null, innerArgs); + } + } + }; + } + + /** + * @memberof async + * @namespace constant + */ + function constant(/* values... */) { + var args = [null].concat(createArray(arguments)); + return function(callback) { + callback = arguments[arguments.length - 1]; + callback.apply(this, args); + }; + } + + function asyncify(fn) { + return function(/* args..., callback */) { + var args = createArray(arguments); + var callback = args.pop(); + var result; + try { + result = fn.apply(this, args); + } catch (e) { + return callback(e); + } + if (result && typeof result.then === func) { + result.then( + function(value) { + invokeCallback(callback, null, value); + }, + function(err) { + invokeCallback(callback, err && err.message ? err : new Error(err)); + } + ); + } else { + callback(null, result); + } + }; + } + + function invokeCallback(callback, err, value) { + try { + callback(err, value); + } catch (e) { + nextTick(rethrow, e); + } + } + + function rethrow(error) { + throw error; + } + + /** + * @memberof async + * @namespace reflect + * @param {Function} func + * @return {Function} + */ + function reflect(func) { + return function(/* args..., callback */) { + var callback; + switch (arguments.length) { + case 1: + callback = arguments[0]; + return func(done); + case 2: + callback = arguments[1]; + return func(arguments[0], done); + default: + var args = createArray(arguments); + var lastIndex = args.length - 1; + callback = args[lastIndex]; + args[lastIndex] = done; + func.apply(this, args); + } + + function done(err, res) { + if (err) { + return callback(null, { + error: err + }); + } + if (arguments.length > 2) { + res = slice(arguments, 1); + } + callback(null, { + value: res + }); + } + }; + } + + /** + * @memberof async + * @namespace reflectAll + * @param {Array[]|Object} tasks + * @return {Function} + */ + function reflectAll(tasks) { + var newTasks, keys; + if (isArray(tasks)) { + newTasks = Array(tasks.length); + arrayEachSync(tasks, iterate); + } else if (tasks && typeof tasks === obj) { + keys = nativeKeys(tasks); + newTasks = {}; + baseEachSync(tasks, iterate, keys); + } + return newTasks; + + function iterate(func, key) { + newTasks[key] = reflect(func); + } + } + + /** + * @memberof async + * @namespace createLogger + */ + function createLogger(name) { + return function(fn) { + var args = slice(arguments, 1); + args.push(done); + fn.apply(null, args); + }; + + function done(err) { + if (typeof console === obj) { + if (err) { + if (console.error) { + console.error(err); + } + return; + } + if (console[name]) { + var args = slice(arguments, 1); + arrayEachSync(args, function(arg) { + console[name](arg); + }); + } + } + } + } + + /** + * @memberof async + * @namespace safe + */ + function safe() { + createImmediate(); + return exports; + } + + /** + * @memberof async + * @namespace fast + */ + function fast() { + createImmediate(false); + return exports; + } +}); diff --git a/node_modules/neo-async/async.min.js b/node_modules/neo-async/async.min.js new file mode 100644 index 0000000..4161a3f --- /dev/null +++ b/node_modules/neo-async/async.min.js @@ -0,0 +1,80 @@ +(function(N,O){"object"===typeof exports&&"undefined"!==typeof module?O(exports):"function"===typeof define&&define.amd?define(["exports"],O):N.async?O(N.neo_async=N.neo_async||{}):O(N.async=N.async||{})})(this,function(N){function O(a){var c=function(a){var d=J(arguments,1);setTimeout(function(){a.apply(null,d)})};T="function"===typeof setImmediate?setImmediate:c;"object"===typeof process&&"function"===typeof process.nextTick?(D=/^v0.10/.test(process.version)?T:process.nextTick,ba=/^v0/.test(process.version)? +T:process.nextTick):ba=D=T;!1===a&&(D=function(a){a()})}function H(a){for(var c=-1,b=a.length,d=Array(b);++c=d)return[];for(var e=Array(d);++bd[e]){var g=d[f]; +d[f]=d[e];d[e]=g}}if(!(e>b)){for(var l,e=a[a[c]>a[e]?c:e],f=c,g=b;f<=g;){for(l=f;f=l&&a[g]>=e;)g--;if(f>g)break;var q=a;l=d;var s=f++,h=g--,k=q[s];q[s]=q[h];q[h]=k;q=l[s];l[s]=l[h];l[h]=q}e=f;ca(a,c,e-1,d);ca(a,e,b,d)}}}function S(a){var c=[];Q(a,function(a){a!==w&&(C(a)?X.apply(c,a):c.push(a))});return c}function da(a,c,b){var d=-1,e=a.length;if(3===c.length)for(;++db)return e(null,[]);y=y||Array(m);K(b>m?m:b,x)}}function Y(a,c,b){function d(){c(a[v],s)}function e(){c(a[v],v,s)}function f(){n=r.next();n.done?b(null):c(n.value,s)}function g(){n=r.next();n.done?b(null):c(n.value,v,s)}function l(){c(a[m[v]],s)}function q(){k=m[v];c(a[k],k,s)}function s(a,d){a?b(a):++v===h||!1===d?(p=A,b(null)):u?D(p): +(u=!0,p());u=!1}b=E(b||w);var h,k,m,r,n,p,u=!1,v=0;C(a)?(h=a.length,p=3===c.length?e:d):a&&(z&&a[z]?(h=Infinity,r=a[z](),p=3===c.length?g:f):"object"===typeof a&&(m=F(a),h=m.length,p=3===c.length?q:l));if(!h)return b(null);p()}function Z(a,c,b,d){function e(){xc)return d(null);K(c>k?k:c,v)}function za(a,c,b){function d(){c(a[t],s)}function e(){c(a[t],t,s)}function f(){n=r.next(); +n.done?b(null,p):c(n.value,s)}function g(){n=r.next();n.done?b(null,p):c(n.value,t,s)}function l(){c(a[m[t]],s)}function q(){k=m[t];c(a[k],k,s)}function s(a,d){a?(u=A,b=E(b),b(a,H(p))):(p[t]=d,++t===h?(u=A,b(null,p),b=A):v?D(u):(v=!0,u()),v=!1)}b=b||w;var h,k,m,r,n,p,u,v=!1,t=0;C(a)?(h=a.length,u=3===c.length?e:d):a&&(z&&a[z]?(h=Infinity,p=[],r=a[z](),u=3===c.length?g:f):"object"===typeof a&&(m=F(a),h=m.length,u=3===c.length?q:l));if(!h)return b(null,[]);p=p||Array(h);u()}function Aa(a,c,b,d){return function(e, +f,g){function l(a){var b=!1;return function(c,e){b&&A();b=!0;c?(g=I(g),g(c)):!!e===d?(g=I(g),g(null,a)):++h===q&&g(null)}}g=g||w;var q,s,h=0;C(e)?(q=e.length,a(e,f,l)):e&&(z&&e[z]?(q=b(e,f,l))&&q===h&&g(null):"object"===typeof e&&(s=F(e),q=s.length,c(e,f,l,s)));q||g(null)}}function Ba(a){return function(c,b,d){function e(){r=c[x];b(r,h)}function f(){r=c[x];b(r,x,h)}function g(){u=p.next();r=u.value;u.done?d(null):b(r,h)}function l(){u=p.next();r=u.value;u.done?d(null):b(r,x,h)}function q(){r=c[n[x]]; +b(r,h)}function s(){m=n[x];r=c[m];b(r,m,h)}function h(b,c){b?d(b):!!c===a?(v=A,d(null,r)):++x===k?(v=A,d(null)):t?D(v):(t=!0,v());t=!1}d=E(d||w);var k,m,r,n,p,u,v,t=!1,x=0;C(c)?(k=c.length,v=3===b.length?f:e):c&&(z&&c[z]?(k=Infinity,p=c[z](),v=3===b.length?l:g):"object"===typeof c&&(n=F(c),k=n.length,v=3===b.length?s:q));if(!k)return d(null);v()}}function Ca(a){return function(c,b,d,e){function f(){r=G++;rb)return e(null);K(b>m?m:b,x)}}function Da(a,c,b,d){return function(e,f,g){function l(a,b){return function(c,e){null===a&&A();c?(a=null,g=I(g),g(c,L(k))):(!!e===d&&(k[a]=b),a=null,++h===q&&g(null,k))}}g=g||w;var q,s,h=0,k={};C(e)?(q=e.length,a(e,f,l)):e&&(z&&e[z]?(q=b(e,f,l))&&q===h&&g(null,k):"object"===typeof e&&(s=F(e),q=s.length,c(e,f,l,s)));if(!q)return g(null,{})}}function Ea(a){return function(c, +b,d){function e(){m=y;r=c[y];b(r,h)}function f(){m=y;r=c[y];b(r,y,h)}function g(){m=y;u=p.next();r=u.value;u.done?d(null,x):b(r,h)}function l(){m=y;u=p.next();r=u.value;u.done?d(null,x):b(r,m,h)}function q(){m=n[y];r=c[m];b(r,h)}function s(){m=n[y];r=c[m];b(r,m,h)}function h(b,c){b?d(b,x):(!!c===a&&(x[m]=r),++y===k?(v=A,d(null,x)):t?D(v):(t=!0,v()),t=!1)}d=E(d||w);var k,m,r,n,p,u,v,t=!1,x={},y=0;C(c)?(k=c.length,v=3===b.length?f:e):c&&(z&&c[z]?(k=Infinity,p=c[z](),v=3===b.length?l:g):"object"===typeof c&& +(n=F(c),k=n.length,v=3===b.length?s:q));if(!k)return d(null,{});v()}}function Fa(a){return function(c,b,d,e){function f(){r=B++;rb)return e(null,{});K(b>m?m:b,x)}}function $(a,c,b,d){function e(d){b(d,a[t],h)}function f(d){b(d,a[t],t,h)}function g(a){p=n.next();p.done?d(null,a):b(a,p.value, +h)}function l(a){p=n.next();p.done?d(null,a):b(a,p.value,t,h)}function q(d){b(d,a[r[t]],h)}function s(d){m=r[t];b(d,a[m],m,h)}function h(a,c){a?d(a,c):++t===k?(b=A,d(null,c)):v?D(function(){u(c)}):(v=!0,u(c));v=!1}d=E(d||w);var k,m,r,n,p,u,v=!1,t=0;C(a)?(k=a.length,u=4===b.length?f:e):a&&(z&&a[z]?(k=Infinity,n=a[z](),u=4===b.length?l:g):"object"===typeof a&&(r=F(a),k=r.length,u=4===b.length?s:q));if(!k)return d(null,c);u(c)}function Ga(a,c,b,d){function e(d){b(d,a[--s],q)}function f(d){b(d,a[--s], +s,q)}function g(d){b(d,a[m[--s]],q)}function l(d){k=m[--s];b(d,a[k],k,q)}function q(a,b){a?d(a,b):0===s?(u=A,d(null,b)):v?D(function(){u(b)}):(v=!0,u(b));v=!1}d=E(d||w);var s,h,k,m,r,n,p,u,v=!1;if(C(a))s=a.length,u=4===b.length?f:e;else if(a)if(z&&a[z]){p=[];r=a[z]();for(h=-1;!1===(n=r.next()).done;)p[++h]=n.value;a=p;s=p.length;u=4===b.length?f:e}else"object"===typeof a&&(m=F(a),s=m.length,u=4===b.length?l:g);if(!s)return d(null,c);u(c)}function Ha(a,c,b){b=b||w;ja(a,c,function(a,c){if(a)return b(a); +b(null,!!c)})}function Ia(a,c,b){b=b||w;ka(a,c,function(a,c){if(a)return b(a);b(null,!!c)})}function Ja(a,c,b,d){d=d||w;la(a,c,b,function(a,b){if(a)return d(a);d(null,!!b)})}function Ka(a,c){return C(a)?0===a.length?(c(null),!1):!0:(c(Error("First argument to waterfall must be an array of functions")),!1)}function ma(a,c,b){switch(c.length){case 0:case 1:return a(b);case 2:return a(c[1],b);case 3:return a(c[1],c[2],b);case 4:return a(c[1],c[2],c[3],b);case 5:return a(c[1],c[2],c[3],c[4],b);case 6:return a(c[1], +c[2],c[3],c[4],c[5],b);default:return c=J(c,1),c.push(b),a.apply(null,c)}}function La(a,c){function b(b,h){if(b)q=A,c=E(c),c(b);else if(++d===f){q=A;var k=c;c=A;2===arguments.length?k(b,h):k.apply(null,H(arguments))}else g=a[d],l=arguments,e?D(q):(e=!0,q()),e=!1}c=c||w;if(Ka(a,c)){var d=0,e=!1,f=a.length,g=a[d],l=[],q=function(){switch(g.length){case 0:try{b(null,g())}catch(a){b(a)}break;case 1:return g(b);case 2:return g(l[1],b);case 3:return g(l[1],l[2],b);case 4:return g(l[1],l[2],l[3],b);case 5:return g(l[1], +l[2],l[3],l[4],b);default:return l=J(l,1),l[g.length-1]=b,g.apply(null,l)}};q()}}function Ma(){var a=H(arguments);return function(){var c=this,b=H(arguments),d=b[b.length-1];"function"===typeof d?b.pop():d=w;$(a,b,function(a,b,d){a.push(function(a){var b=J(arguments,1);d(a,b)});b.apply(c,a)},function(a,b){b=C(b)?b:[b];b.unshift(a);d.apply(c,b)})}}function Na(a){return function(c){var b=function(){var b=this,d=H(arguments),g=d.pop()||w;return a(c,function(a,c){a.apply(b,d.concat([c]))},g)};if(1b)throw Error("Concurrency must not be zero");var h=0,k=[],m,r,n={_tasks:new M,concurrency:b,payload:d,saturated:w,unsaturated:w,buffer:b/4,empty:w,drain:w,error:w,started:!1,paused:!1,push:function(a, +b){f(a,b)},kill:function(){n.drain=w;n._tasks.empty()},unshift:function(a,b){f(a,b,!0)},remove:function(a){n._tasks.remove(a)},process:a?l:q,length:function(){return n._tasks.length},running:function(){return h},workersList:function(){return k},idle:function(){return 0===n.length()+h},pause:function(){n.paused=!0},resume:function(){!1!==n.paused&&(n.paused=!1,K(n.concurrency=arguments.length?f:J(arguments,1);if(a){q=g=0;s.length=0;var k=L(l);k[d]=f;d=null;var h= +b;b=w;h(a,k)}else q--,g--,l[d]=f,e(d),d=null}function n(){0===--v&&s.push([p,u,c])}var p,u;if(C(a)){var v=a.length-1;p=a[v];u=v;if(0===v)s.push([p,u,c]);else for(var t=-1;++t=arguments.length)return b(a,e);var f=H(arguments);return b.apply(null,f)}c(d)}function e(){c(f)}function f(a,d){if(++s===g||!a||q&&!q(a)){if(2>=arguments.length)return b(a,d);var c=H(arguments);return b.apply(null,c)}setTimeout(e,l(s))}var g,l,q,s=0;if(3>arguments.length&&"function"===typeof a)b=c||w,c=a,a=null,g=5;else switch(b=b||w,typeof a){case "object":"function"===typeof a.errorFilter&&(q=a.errorFilter);var h=a.interval; +switch(typeof h){case "function":l=h;break;case "string":case "number":l=(h=+h)?function(){return h}:function(){return 0}}g=+a.times||5;break;case "number":g=a||5;break;case "string":g=+a||5;break;default:throw Error("Invalid arguments for async.retry");}if("function"!==typeof c)throw Error("Invalid arguments for async.retry");l?c(f):c(d)}function Pa(a){return function(){var c=H(arguments),b=c.pop(),d;try{d=a.apply(this,c)}catch(e){return b(e)}d&&"function"===typeof d.then?d.then(function(a){try{b(null, +a)}catch(d){D(Qa,d)}},function(a){a=a&&a.message?a:Error(a);try{b(a,void 0)}catch(d){D(Qa,d)}}):b(null,d)}}function Qa(a){throw a;}function Ra(a){return function(){function c(a,d){if(a)return b(null,{error:a});2=arguments.length?c:J(arguments,1),a=null,++q===f&&d(null,l))}}d=d||w;var f,g,l,q=0;C(b)?(f=b.length,l=Array(f),a(b,e)):b&&"object"===typeof b&&(g=F(b),f=g.length,l={},c(b,e,g));f||d(null,l)}}(function(a,c){for(var b=-1,d=a.length;++bc)return d(null,[]);v=v||Array(k);K(c>k?k:c,t)},mapValues:fb,mapValuesSeries:function(a,c,b){function d(){k=t;c(a[t], +s)}function e(){k=t;c(a[t],t,s)}function f(){k=t;n=r.next();n.done?b(null,v):c(n.value,s)}function g(){k=t;n=r.next();n.done?b(null,v):c(n.value,t,s)}function l(){k=m[t];c(a[k],s)}function q(){k=m[t];c(a[k],k,s)}function s(a,d){a?(p=A,b=E(b),b(a,L(v))):(v[k]=d,++t===h?(p=A,b(null,v),b=A):u?D(p):(u=!0,p()),u=!1)}b=b||w;var h,k,m,r,n,p,u=!1,v={},t=0;C(a)?(h=a.length,p=3===c.length?e:d):a&&(z&&a[z]?(h=Infinity,r=a[z](),p=3===c.length?g:f):"object"===typeof a&&(m=F(a),h=m.length,p=3===c.length?q:l)); +if(!h)return b(null,v);p()},mapValuesLimit:function(a,c,b,d){function e(){m=y++;mc)return d(null,x);K(c>k?k:c,v)},filter:Ta,filterSeries:Ua,filterLimit:Va,select:Ta,selectSeries:Ua,selectLimit:Va,reject:gb,rejectSeries:hb,rejectLimit:ib,detect:ja,detectSeries:ka,detectLimit:la,find:ja,findSeries:ka,findLimit:la,pick:jb,pickSeries:kb, +pickLimit:lb,omit:mb,omitSeries:nb,omitLimit:ob,reduce:$,inject:$,foldl:$,reduceRight:Ga,foldr:Ga,transform:pb,transformSeries:function(a,c,b,d){function e(){b(v,a[x],h)}function f(){b(v,a[x],x,h)}function g(){p=n.next();p.done?d(null,v):b(v,p.value,h)}function l(){p=n.next();p.done?d(null,v):b(v,p.value,x,h)}function q(){b(v,a[r[x]],h)}function s(){m=r[x];b(v,a[m],m,h)}function h(a,b){a?d(a,v):++x===k||!1===b?(u=A,d(null,v)):t?D(u):(t=!0,u());t=!1}3===arguments.length&&(d=b,b=c,c=void 0);d=E(d|| +w);var k,m,r,n,p,u,v,t=!1,x=0;C(a)?(k=a.length,v=void 0!==c?c:[],u=4===b.length?f:e):a&&(z&&a[z]?(k=Infinity,n=a[z](),v=void 0!==c?c:{},u=4===b.length?l:g):"object"===typeof a&&(r=F(a),k=r.length,v=void 0!==c?c:{},u=4===b.length?s:q));if(!k)return d(null,void 0!==c?c:v||{});u()},transformLimit:function(a,c,b,d,e){function f(){r=A++;rc)return e(null,void 0!==b?b:x||{});K(c>m?m:c,t)},sortBy:qb,sortBySeries:function(a,c,b){function d(){m=a[y];c(m,s)}function e(){m=a[y];c(m,y,s)}function f(){p=n.next();if(p.done)return b(null,P(u,v));m=p.value;u[y]=m;c(m,s)}function g(){p=n.next();if(p.done)return b(null,P(u,v));m=p.value;u[y]=m;c(m,y,s)}function l(){m=a[r[y]];u[y]=m;c(m,s)}function q(){k=r[y];m=a[k];u[y]=m;c(m,k,s)}function s(a,d){v[y]=d;a?b(a):++y===h?(t=A,b(null, +P(u,v))):x?D(t):(x=!0,t());x=!1}b=E(b||w);var h,k,m,r,n,p,u,v,t,x=!1,y=0;C(a)?(h=a.length,u=a,v=Array(h),t=3===c.length?e:d):a&&(z&&a[z]?(h=Infinity,u=[],v=[],n=a[z](),t=3===c.length?g:f):"object"===typeof a&&(r=F(a),h=r.length,u=Array(h),v=Array(h),t=3===c.length?q:l));if(!h)return b(null,[]);t()},sortByLimit:function(a,c,b,d){function e(){Bc)return d(null,[]);x=x||Array(k);K(c>k?k:c,y)},some:Ha,someSeries:Ia,someLimit:Ja,any:Ha,anySeries:Ia,anyLimit:Ja,every:Wa,everySeries:Xa,everyLimit:Ya,all:Wa,allSeries:Xa,allLimit:Ya,concat:rb,concatSeries:function(a,c,b){function d(){c(a[t],s)}function e(){c(a[t],t,s)}function f(){n=r.next();n.done?b(null,v):c(n.value,s)}function g(){n=r.next();n.done?b(null,v):c(n.value,t,s)}function l(){c(a[m[t]], +s)}function q(){k=m[t];c(a[k],k,s)}function s(a,d){C(d)?X.apply(v,d):2<=arguments.length&&X.apply(v,J(arguments,1));a?b(a,v):++t===h?(p=A,b(null,v)):u?D(p):(u=!0,p());u=!1}b=E(b||w);var h,k,m,r,n,p,u=!1,v=[],t=0;C(a)?(h=a.length,p=3===c.length?e:d):a&&(z&&a[z]?(h=Infinity,r=a[z](),p=3===c.length?g:f):"object"===typeof a&&(m=F(a),h=m.length,p=3===c.length?q:l));if(!h)return b(null,v);p()},concatLimit:function(a,c,b,d){function e(){tc)return d(null,[]);u=u||Array(k);K(c>k?k:c,p)},groupBy:sb,groupBySeries:function(a,c,b){function d(){m=a[t];c(m,s)}function e(){m=a[t];c(m,t,s)}function f(){p=n.next();m=p.value;p.done?b(null,x):c(m,s)}function g(){p=n.next();m=p.value;p.done? +b(null,x):c(m,t,s)}function l(){m=a[r[t]];c(m,s)}function q(){k=r[t];m=a[k];c(m,k,s)}function s(a,d){if(a)u=A,b=E(b),b(a,L(x));else{var c=x[d];c?c.push(m):x[d]=[m];++t===h?(u=A,b(null,x)):v?D(u):(v=!0,u());v=!1}}b=E(b||w);var h,k,m,r,n,p,u,v=!1,t=0,x={};C(a)?(h=a.length,u=3===c.length?e:d):a&&(z&&a[z]?(h=Infinity,n=a[z](),u=3===c.length?g:f):"object"===typeof a&&(r=F(a),h=r.length,u=3===c.length?q:l));if(!h)return b(null,x);u()},groupByLimit:function(a,c,b,d){function e(){yc)return d(null,B);K(c>k?k:c,t)},parallel:tb,series:function(a,c){function b(){g=k;a[k](e)}function d(){g=l[k];a[g](e)}function e(a,b){a?(s=A,c=E(c),c(a,q)):(q[g]=2>=arguments.length?b:J(arguments,1),++k===f?(s=A,c(null,q)):h?D(s):(h=!0,s()),h=!1)}c=c||w;var f,g,l,q,s,h=!1,k=0;if(C(a))f=a.length,q=Array(f), +s=b;else if(a&&"object"===typeof a)l=F(a),f=l.length,q={},s=d;else return c(null);if(!f)return c(null,q);s()},parallelLimit:function(a,c,b){function d(){l=r++;if(l=arguments.length?c:J(arguments,1),a=null,++n===g?b(null,h):m?D(k):(m=!0,k()),m=!1)}}b=b||w;var g,l,q,s,h,k,m=!1,r=0,n=0;C(a)?(g=a.length,h=Array(g),k=d):a&&"object"===typeof a&&(s=F(a),g=s.length,h= +{},k=e);if(!g||isNaN(c)||1>c)return b(null,h);K(c>g?g:c,k)},tryEach:function(a,c){function b(){a[q](e)}function d(){a[g[q]](e)}function e(a,b){a?++q===f?c(a):l():2>=arguments.length?c(null,b):c(null,J(arguments,1))}c=c||w;var f,g,l,q=0;C(a)?(f=a.length,l=b):a&&"object"===typeof a&&(g=F(a),f=g.length,l=d);if(!f)return c(null);l()},waterfall:function(a,c){function b(){ma(e,f,d(e))}function d(h){return function(k,m){void 0===h&&(c=w,A());h=void 0;k?(g=c,c=A,g(k)):++q===s?(g=c,c=A,2>=arguments.length? +g(k,m):g.apply(null,H(arguments))):(l?(f=arguments,e=a[q]||A,D(b)):(l=!0,ma(a[q]||A,arguments,d(q))),l=!1)}}c=c||w;if(Ka(a,c)){var e,f,g,l,q=0,s=a.length;ma(a[0],[],d(0))}},angelFall:La,angelfall:La,whilst:function(a,c,b){function d(){g?D(e):(g=!0,c(f));g=!1}function e(){c(f)}function f(c,e){if(c)return b(c);2>=arguments.length?a(e)?d():b(null,e):(e=J(arguments,1),a.apply(null,e)?d():b.apply(null,[null].concat(e)))}b=b||w;var g=!1;a()?d():b(null)},doWhilst:function(a,c,b){function d(){g?D(e):(g=!0, +a(f));g=!1}function e(){a(f)}function f(a,e){if(a)return b(a);2>=arguments.length?c(e)?d():b(null,e):(e=J(arguments,1),c.apply(null,e)?d():b.apply(null,[null].concat(e)))}b=b||w;var g=!1;e()},until:function(a,c,b){function d(){g?D(e):(g=!0,c(f));g=!1}function e(){c(f)}function f(c,e){if(c)return b(c);2>=arguments.length?a(e)?b(null,e):d():(e=J(arguments,1),a.apply(null,e)?b.apply(null,[null].concat(e)):d())}b=b||w;var g=!1;a()?b(null):d()},doUntil:function(a,c,b){function d(){g?D(e):(g=!0,a(f));g= +!1}function e(){a(f)}function f(a,e){if(a)return b(a);2>=arguments.length?c(e)?b(null,e):d():(e=J(arguments,1),c.apply(null,e)?b.apply(null,[null].concat(e)):d())}b=b||w;var g=!1;e()},during:function(a,c,b){function d(a,d){if(a)return b(a);d?c(e):b(null)}function e(c){if(c)return b(c);a(d)}b=b||w;a(d)},doDuring:function(a,c,b){function d(d,c){if(d)return b(d);c?a(e):b(null)}function e(a,e){if(a)return b(a);switch(arguments.length){case 0:case 1:c(d);break;case 2:c(e,d);break;default:var l=J(arguments, +1);l.push(d);c.apply(null,l)}}b=b||w;d(null,!0)},forever:function(a,c){function b(){a(d)}function d(a){if(a){if(c)return c(a);throw a;}e?D(b):(e=!0,b());e=!1}var e=!1;b()},compose:function(){return Ma.apply(null,Za(arguments))},seq:Ma,applyEach:ub,applyEachSeries:vb,queue:function(a,c){return na(!0,a,c)},priorityQueue:function(a,c){var b=na(!0,a,c);b.push=function(a,c,f){b.started=!0;c=c||0;var g=C(a)?a:[a],l=g.length;if(void 0===a||0===l)b.idle()&&D(b.drain);else{f="function"===typeof f?f:w;for(a= +b._tasks.head;a&&c>=a.priority;)a=a.next;for(;l--;){var q={data:g[l],priority:c,callback:f};a?b._tasks.insertBefore(a,q):b._tasks.push(q);D(b.process)}}};delete b.unshift;return b},cargo:function(a,c){return na(!1,a,1,c)},auto:Oa,autoInject:function(a,c,b){var d={};W(a,function(a,b){var c,l=a.length;if(C(a)){if(0===l)throw Error("autoInject task functions require explicit parameters.");c=H(a);l=c.length-1;a=c[l];if(0===l){d[b]=a;return}}else{if(1===l){d[b]=a;return}c=ab(a);if(0===l&&0===c.length)throw Error("autoInject task functions require explicit parameters."); +l=c.length-1}c[l]=function(b,d){switch(l){case 1:a(b[c[0]],d);break;case 2:a(b[c[0]],b[c[1]],d);break;case 3:a(b[c[0]],b[c[1]],b[c[2]],d);break;default:for(var f=-1;++fa)return b(null,[]);var e=Array(a);K(a,function(a){c(a,d(a))})},timesSeries:function(a,c,b){function d(){c(l, +e)}function e(c,e){f[l]=e;c?(b(c),b=A):++l>=a?(b(null,f),b=A):g?D(d):(g=!0,d());g=!1}b=b||w;a=+a;if(isNaN(a)||1>a)return b(null,[]);var f=Array(a),g=!1,l=0;d()},timesLimit:function(a,c,b,d){function e(){var c=q++;c=a?(d(null,g),d=A):l?D(e):(l=!0,e());l=!1}}d=d||w;a=+a;if(isNaN(a)||1>a||isNaN(c)||1>c)return d(null,[]);var g=Array(a),l=!1,q=0,s=0;K(c>a?a:c,e)},race:function(a,c){c=I(c||w);var b,d,e=-1;if(C(a))for(b= +a.length;++e", + "license": "MIT", + "devDependencies": { + "semver": "^7.3.5" + } +} diff --git a/node_modules/normalize-path/LICENSE b/node_modules/normalize-path/LICENSE new file mode 100644 index 0000000..d32ab44 --- /dev/null +++ b/node_modules/normalize-path/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2018, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/normalize-path/README.md b/node_modules/normalize-path/README.md new file mode 100644 index 0000000..726d4d6 --- /dev/null +++ b/node_modules/normalize-path/README.md @@ -0,0 +1,127 @@ +# normalize-path [![NPM version](https://img.shields.io/npm/v/normalize-path.svg?style=flat)](https://www.npmjs.com/package/normalize-path) [![NPM monthly downloads](https://img.shields.io/npm/dm/normalize-path.svg?style=flat)](https://npmjs.org/package/normalize-path) [![NPM total downloads](https://img.shields.io/npm/dt/normalize-path.svg?style=flat)](https://npmjs.org/package/normalize-path) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/normalize-path.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/normalize-path) + +> Normalize slashes in a file path to be posix/unix-like forward slashes. Also condenses repeat slashes to a single slash and removes and trailing slashes, unless disabled. + +Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save normalize-path +``` + +## Usage + +```js +const normalize = require('normalize-path'); + +console.log(normalize('\\foo\\bar\\baz\\')); +//=> '/foo/bar/baz' +``` + +**win32 namespaces** + +```js +console.log(normalize('\\\\?\\UNC\\Server01\\user\\docs\\Letter.txt')); +//=> '//?/UNC/Server01/user/docs/Letter.txt' + +console.log(normalize('\\\\.\\CdRomX')); +//=> '//./CdRomX' +``` + +**Consecutive slashes** + +Condenses multiple consecutive forward slashes (except for leading slashes in win32 namespaces) to a single slash. + +```js +console.log(normalize('.//foo//bar///////baz/')); +//=> './foo/bar/baz' +``` + +### Trailing slashes + +By default trailing slashes are removed. Pass `false` as the last argument to disable this behavior and _**keep** trailing slashes_: + +```js +console.log(normalize('foo\\bar\\baz\\', false)); //=> 'foo/bar/baz/' +console.log(normalize('./foo/bar/baz/', false)); //=> './foo/bar/baz/' +``` + +## Release history + +### v3.0 + +No breaking changes in this release. + +* a check was added to ensure that [win32 namespaces](https://msdn.microsoft.com/library/windows/desktop/aa365247(v=vs.85).aspx#namespaces) are handled properly by win32 `path.parse()` after a path has been normalized by this library. +* a minor optimization was made to simplify how the trailing separator was handled + +## About + +
+Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +
+ +
+Running Tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +
+ +
+Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +
+ +### Related projects + +Other useful path-related libraries: + +* [contains-path](https://www.npmjs.com/package/contains-path): Return true if a file path contains the given path. | [homepage](https://github.com/jonschlinkert/contains-path "Return true if a file path contains the given path.") +* [is-absolute](https://www.npmjs.com/package/is-absolute): Returns true if a file path is absolute. Does not rely on the path module… [more](https://github.com/jonschlinkert/is-absolute) | [homepage](https://github.com/jonschlinkert/is-absolute "Returns true if a file path is absolute. Does not rely on the path module and can be used as a polyfill for node.js native `path.isAbolute`.") +* [is-relative](https://www.npmjs.com/package/is-relative): Returns `true` if the path appears to be relative. | [homepage](https://github.com/jonschlinkert/is-relative "Returns `true` if the path appears to be relative.") +* [parse-filepath](https://www.npmjs.com/package/parse-filepath): Pollyfill for node.js `path.parse`, parses a filepath into an object. | [homepage](https://github.com/jonschlinkert/parse-filepath "Pollyfill for node.js `path.parse`, parses a filepath into an object.") +* [path-ends-with](https://www.npmjs.com/package/path-ends-with): Return `true` if a file path ends with the given string/suffix. | [homepage](https://github.com/jonschlinkert/path-ends-with "Return `true` if a file path ends with the given string/suffix.") +* [unixify](https://www.npmjs.com/package/unixify): Convert Windows file paths to unix paths. | [homepage](https://github.com/jonschlinkert/unixify "Convert Windows file paths to unix paths.") + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 35 | [jonschlinkert](https://github.com/jonschlinkert) | +| 1 | [phated](https://github.com/phated) | + +### Author + +**Jon Schlinkert** + +* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert) +* [GitHub Profile](https://github.com/jonschlinkert) +* [Twitter Profile](https://twitter.com/jonschlinkert) + +### License + +Copyright © 2018, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on April 19, 2018._ \ No newline at end of file diff --git a/node_modules/normalize-path/index.js b/node_modules/normalize-path/index.js new file mode 100644 index 0000000..6fac553 --- /dev/null +++ b/node_modules/normalize-path/index.js @@ -0,0 +1,35 @@ +/*! + * normalize-path + * + * Copyright (c) 2014-2018, Jon Schlinkert. + * Released under the MIT License. + */ + +module.exports = function(path, stripTrailing) { + if (typeof path !== 'string') { + throw new TypeError('expected path to be a string'); + } + + if (path === '\\' || path === '/') return '/'; + + var len = path.length; + if (len <= 1) return path; + + // ensure that win32 namespaces has two leading slashes, so that the path is + // handled properly by the win32 version of path.parse() after being normalized + // https://msdn.microsoft.com/library/windows/desktop/aa365247(v=vs.85).aspx#namespaces + var prefix = ''; + if (len > 4 && path[3] === '\\') { + var ch = path[2]; + if ((ch === '?' || ch === '.') && path.slice(0, 2) === '\\\\') { + path = path.slice(2); + prefix = '//'; + } + } + + var segs = path.split(/[/\\]+/); + if (stripTrailing !== false && segs[segs.length - 1] === '') { + segs.pop(); + } + return prefix + segs.join('/'); +}; diff --git a/node_modules/normalize-path/package.json b/node_modules/normalize-path/package.json new file mode 100644 index 0000000..ad61098 --- /dev/null +++ b/node_modules/normalize-path/package.json @@ -0,0 +1,77 @@ +{ + "name": "normalize-path", + "description": "Normalize slashes in a file path to be posix/unix-like forward slashes. Also condenses repeat slashes to a single slash and removes and trailing slashes, unless disabled.", + "version": "3.0.0", + "homepage": "https://github.com/jonschlinkert/normalize-path", + "author": "Jon Schlinkert (https://github.com/jonschlinkert)", + "contributors": [ + "Blaine Bublitz (https://twitter.com/BlaineBublitz)", + "Jon Schlinkert (http://twitter.com/jonschlinkert)" + ], + "repository": "jonschlinkert/normalize-path", + "bugs": { + "url": "https://github.com/jonschlinkert/normalize-path/issues" + }, + "license": "MIT", + "files": [ + "index.js" + ], + "main": "index.js", + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "mocha" + }, + "devDependencies": { + "gulp-format-md": "^1.0.0", + "minimist": "^1.2.0", + "mocha": "^3.5.3" + }, + "keywords": [ + "absolute", + "backslash", + "delimiter", + "file", + "file-path", + "filepath", + "fix", + "forward", + "fp", + "fs", + "normalize", + "path", + "relative", + "separator", + "slash", + "slashes", + "trailing", + "unix", + "urix" + ], + "verb": { + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "related": { + "description": "Other useful path-related libraries:", + "list": [ + "contains-path", + "is-absolute", + "is-relative", + "parse-filepath", + "path-ends-with", + "path-ends-with", + "unixify" + ] + }, + "lint": { + "reflinks": true + } + } +} diff --git a/node_modules/picocolors/LICENSE b/node_modules/picocolors/LICENSE new file mode 100644 index 0000000..496098c --- /dev/null +++ b/node_modules/picocolors/LICENSE @@ -0,0 +1,15 @@ +ISC License + +Copyright (c) 2021 Alexey Raspopov, Kostiantyn Denysov, Anton Verinov + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/picocolors/README.md b/node_modules/picocolors/README.md new file mode 100644 index 0000000..8e47aa8 --- /dev/null +++ b/node_modules/picocolors/README.md @@ -0,0 +1,21 @@ +# picocolors + +The tiniest and the fastest library for terminal output formatting with ANSI colors. + +```javascript +import pc from "picocolors" + +console.log( + pc.green(`How are ${pc.italic(`you`)} doing?`) +) +``` + +- **No dependencies.** +- **14 times** smaller and **2 times** faster than chalk. +- Used by popular tools like PostCSS, SVGO, Stylelint, and Browserslist. +- Node.js v6+ & browsers support. Support for both CJS and ESM projects. +- TypeScript type declarations included. +- [`NO_COLOR`](https://no-color.org/) friendly. + +## Docs +Read **[full docs](https://github.com/alexeyraspopov/picocolors#readme)** on GitHub. diff --git a/node_modules/picocolors/package.json b/node_modules/picocolors/package.json new file mode 100644 index 0000000..85a12d5 --- /dev/null +++ b/node_modules/picocolors/package.json @@ -0,0 +1,25 @@ +{ + "name": "picocolors", + "version": "1.0.0", + "main": "./picocolors.js", + "types": "./picocolors.d.ts", + "browser": { + "./picocolors.js": "./picocolors.browser.js" + }, + "sideEffects": false, + "description": "The tiniest and the fastest library for terminal output formatting with ANSI colors", + "files": [ + "picocolors.*", + "types.ts" + ], + "keywords": [ + "terminal", + "colors", + "formatting", + "cli", + "console" + ], + "author": "Alexey Raspopov", + "repository": "alexeyraspopov/picocolors", + "license": "ISC" +} diff --git a/node_modules/picocolors/picocolors.browser.js b/node_modules/picocolors/picocolors.browser.js new file mode 100644 index 0000000..5eb9fbe --- /dev/null +++ b/node_modules/picocolors/picocolors.browser.js @@ -0,0 +1,4 @@ +var x=String; +var create=function() {return {isColorSupported:false,reset:x,bold:x,dim:x,italic:x,underline:x,inverse:x,hidden:x,strikethrough:x,black:x,red:x,green:x,yellow:x,blue:x,magenta:x,cyan:x,white:x,gray:x,bgBlack:x,bgRed:x,bgGreen:x,bgYellow:x,bgBlue:x,bgMagenta:x,bgCyan:x,bgWhite:x}}; +module.exports=create(); +module.exports.createColors = create; diff --git a/node_modules/picocolors/picocolors.d.ts b/node_modules/picocolors/picocolors.d.ts new file mode 100644 index 0000000..94e146a --- /dev/null +++ b/node_modules/picocolors/picocolors.d.ts @@ -0,0 +1,5 @@ +import { Colors } from "./types" + +declare const picocolors: Colors & { createColors: (enabled?: boolean) => Colors } + +export = picocolors diff --git a/node_modules/picocolors/picocolors.js b/node_modules/picocolors/picocolors.js new file mode 100644 index 0000000..fdb6304 --- /dev/null +++ b/node_modules/picocolors/picocolors.js @@ -0,0 +1,58 @@ +let tty = require("tty") + +let isColorSupported = + !("NO_COLOR" in process.env || process.argv.includes("--no-color")) && + ("FORCE_COLOR" in process.env || + process.argv.includes("--color") || + process.platform === "win32" || + (tty.isatty(1) && process.env.TERM !== "dumb") || + "CI" in process.env) + +let formatter = + (open, close, replace = open) => + input => { + let string = "" + input + let index = string.indexOf(close, open.length) + return ~index + ? open + replaceClose(string, close, replace, index) + close + : open + string + close + } + +let replaceClose = (string, close, replace, index) => { + let start = string.substring(0, index) + replace + let end = string.substring(index + close.length) + let nextIndex = end.indexOf(close) + return ~nextIndex ? start + replaceClose(end, close, replace, nextIndex) : start + end +} + +let createColors = (enabled = isColorSupported) => ({ + isColorSupported: enabled, + reset: enabled ? s => `\x1b[0m${s}\x1b[0m` : String, + bold: enabled ? formatter("\x1b[1m", "\x1b[22m", "\x1b[22m\x1b[1m") : String, + dim: enabled ? formatter("\x1b[2m", "\x1b[22m", "\x1b[22m\x1b[2m") : String, + italic: enabled ? formatter("\x1b[3m", "\x1b[23m") : String, + underline: enabled ? formatter("\x1b[4m", "\x1b[24m") : String, + inverse: enabled ? formatter("\x1b[7m", "\x1b[27m") : String, + hidden: enabled ? formatter("\x1b[8m", "\x1b[28m") : String, + strikethrough: enabled ? formatter("\x1b[9m", "\x1b[29m") : String, + black: enabled ? formatter("\x1b[30m", "\x1b[39m") : String, + red: enabled ? formatter("\x1b[31m", "\x1b[39m") : String, + green: enabled ? formatter("\x1b[32m", "\x1b[39m") : String, + yellow: enabled ? formatter("\x1b[33m", "\x1b[39m") : String, + blue: enabled ? formatter("\x1b[34m", "\x1b[39m") : String, + magenta: enabled ? formatter("\x1b[35m", "\x1b[39m") : String, + cyan: enabled ? formatter("\x1b[36m", "\x1b[39m") : String, + white: enabled ? formatter("\x1b[37m", "\x1b[39m") : String, + gray: enabled ? formatter("\x1b[90m", "\x1b[39m") : String, + bgBlack: enabled ? formatter("\x1b[40m", "\x1b[49m") : String, + bgRed: enabled ? formatter("\x1b[41m", "\x1b[49m") : String, + bgGreen: enabled ? formatter("\x1b[42m", "\x1b[49m") : String, + bgYellow: enabled ? formatter("\x1b[43m", "\x1b[49m") : String, + bgBlue: enabled ? formatter("\x1b[44m", "\x1b[49m") : String, + bgMagenta: enabled ? formatter("\x1b[45m", "\x1b[49m") : String, + bgCyan: enabled ? formatter("\x1b[46m", "\x1b[49m") : String, + bgWhite: enabled ? formatter("\x1b[47m", "\x1b[49m") : String, +}) + +module.exports = createColors() +module.exports.createColors = createColors diff --git a/node_modules/picocolors/types.ts b/node_modules/picocolors/types.ts new file mode 100644 index 0000000..b4bacee --- /dev/null +++ b/node_modules/picocolors/types.ts @@ -0,0 +1,30 @@ +export type Formatter = (input: string | number | null | undefined) => string + +export interface Colors { + isColorSupported: boolean + reset: Formatter + bold: Formatter + dim: Formatter + italic: Formatter + underline: Formatter + inverse: Formatter + hidden: Formatter + strikethrough: Formatter + black: Formatter + red: Formatter + green: Formatter + yellow: Formatter + blue: Formatter + magenta: Formatter + cyan: Formatter + white: Formatter + gray: Formatter + bgBlack: Formatter + bgRed: Formatter + bgGreen: Formatter + bgYellow: Formatter + bgBlue: Formatter + bgMagenta: Formatter + bgCyan: Formatter + bgWhite: Formatter +} diff --git a/node_modules/picomatch/CHANGELOG.md b/node_modules/picomatch/CHANGELOG.md new file mode 100644 index 0000000..8ccc6c1 --- /dev/null +++ b/node_modules/picomatch/CHANGELOG.md @@ -0,0 +1,136 @@ +# Release history + +**All notable changes to this project will be documented in this file.** + +The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). + +
+ Guiding Principles + +- Changelogs are for humans, not machines. +- There should be an entry for every single version. +- The same types of changes should be grouped. +- Versions and sections should be linkable. +- The latest version comes first. +- The release date of each versions is displayed. +- Mention whether you follow Semantic Versioning. + +
+ +
+ Types of changes + +Changelog entries are classified using the following labels _(from [keep-a-changelog](http://keepachangelog.com/)_): + +- `Added` for new features. +- `Changed` for changes in existing functionality. +- `Deprecated` for soon-to-be removed features. +- `Removed` for now removed features. +- `Fixed` for any bug fixes. +- `Security` in case of vulnerabilities. + +
+ +## 2.3.1 (2022-01-02) + +### Fixed + +* Fixes bug when a pattern containing an expression after the closing parenthesis (`/!(*.d).{ts,tsx}`) was incorrectly converted to regexp ([9f241ef](https://github.com/micromatch/picomatch/commit/9f241ef)). + +### Changed + +* Some documentation improvements ([f81d236](https://github.com/micromatch/picomatch/commit/f81d236), [421e0e7](https://github.com/micromatch/picomatch/commit/421e0e7)). + +## 2.3.0 (2021-05-21) + +### Fixed + +* Fixes bug where file names with two dots were not being matched consistently with negation extglobs containing a star ([56083ef](https://github.com/micromatch/picomatch/commit/56083ef)) + +## 2.2.3 (2021-04-10) + +### Fixed + +* Do not skip pattern seperator for square brackets ([fb08a30](https://github.com/micromatch/picomatch/commit/fb08a30)). +* Set negatedExtGlob also if it does not span the whole pattern ([032e3f5](https://github.com/micromatch/picomatch/commit/032e3f5)). + +## 2.2.2 (2020-03-21) + +### Fixed + +* Correctly handle parts of the pattern after parentheses in the `scan` method ([e15b920](https://github.com/micromatch/picomatch/commit/e15b920)). + +## 2.2.1 (2020-01-04) + +* Fixes [#49](https://github.com/micromatch/picomatch/issues/49), so that braces with no sets or ranges are now propertly treated as literals. + +## 2.2.0 (2020-01-04) + +* Disable fastpaths mode for the parse method ([5b8d33f](https://github.com/micromatch/picomatch/commit/5b8d33f)) +* Add `tokens`, `slashes`, and `parts` to the object returned by `picomatch.scan()`. + +## 2.1.0 (2019-10-31) + +* add benchmarks for scan ([4793b92](https://github.com/micromatch/picomatch/commit/4793b92)) +* Add eslint object-curly-spacing rule ([707c650](https://github.com/micromatch/picomatch/commit/707c650)) +* Add prefer-const eslint rule ([5c7501c](https://github.com/micromatch/picomatch/commit/5c7501c)) +* Add support for nonegate in scan API ([275c9b9](https://github.com/micromatch/picomatch/commit/275c9b9)) +* Change lets to consts. Move root import up. ([4840625](https://github.com/micromatch/picomatch/commit/4840625)) +* closes https://github.com/micromatch/picomatch/issues/21 ([766bcb0](https://github.com/micromatch/picomatch/commit/766bcb0)) +* Fix "Extglobs" table in readme ([eb19da8](https://github.com/micromatch/picomatch/commit/eb19da8)) +* fixes https://github.com/micromatch/picomatch/issues/20 ([9caca07](https://github.com/micromatch/picomatch/commit/9caca07)) +* fixes https://github.com/micromatch/picomatch/issues/26 ([fa58f45](https://github.com/micromatch/picomatch/commit/fa58f45)) +* Lint test ([d433a34](https://github.com/micromatch/picomatch/commit/d433a34)) +* lint unit tests ([0159b55](https://github.com/micromatch/picomatch/commit/0159b55)) +* Make scan work with noext ([6c02e03](https://github.com/micromatch/picomatch/commit/6c02e03)) +* minor linting ([c2a2b87](https://github.com/micromatch/picomatch/commit/c2a2b87)) +* minor parser improvements ([197671d](https://github.com/micromatch/picomatch/commit/197671d)) +* remove eslint since it... ([07876fa](https://github.com/micromatch/picomatch/commit/07876fa)) +* remove funding file ([8ebe96d](https://github.com/micromatch/picomatch/commit/8ebe96d)) +* Remove unused funks ([cbc6d54](https://github.com/micromatch/picomatch/commit/cbc6d54)) +* Run eslint during pretest, fix existing eslint findings ([0682367](https://github.com/micromatch/picomatch/commit/0682367)) +* support `noparen` in scan ([3d37569](https://github.com/micromatch/picomatch/commit/3d37569)) +* update changelog ([7b34e77](https://github.com/micromatch/picomatch/commit/7b34e77)) +* update travis ([777f038](https://github.com/micromatch/picomatch/commit/777f038)) +* Use eslint-disable-next-line instead of eslint-disable ([4e7c1fd](https://github.com/micromatch/picomatch/commit/4e7c1fd)) + +## 2.0.7 (2019-05-14) + +* 2.0.7 ([9eb9a71](https://github.com/micromatch/picomatch/commit/9eb9a71)) +* supports lookbehinds ([1f63f7e](https://github.com/micromatch/picomatch/commit/1f63f7e)) +* update .verb.md file with typo change ([2741279](https://github.com/micromatch/picomatch/commit/2741279)) +* fix: typo in README ([0753e44](https://github.com/micromatch/picomatch/commit/0753e44)) + +## 2.0.4 (2019-04-10) + +### Fixed + +- Readme link [fixed](https://github.com/micromatch/picomatch/pull/13/commits/a96ab3aa2b11b6861c23289964613d85563b05df) by @danez. +- `options.capture` now works as expected when fastpaths are enabled. See https://github.com/micromatch/picomatch/pull/12/commits/26aefd71f1cfaf95c37f1c1fcab68a693b037304. Thanks to @DrPizza. + +## 2.0.0 (2019-04-10) + +### Added + +- Adds support for `options.onIgnore`. See the readme for details +- Adds support for `options.onResult`. See the readme for details + +### Breaking changes + +- The unixify option was renamed to `windows` +- caching and all related options and methods have been removed + +## 1.0.0 (2018-11-05) + +- adds `.onMatch` option +- improvements to `.scan` method +- numerous improvements and optimizations for matching and parsing +- better windows path handling + +## 0.1.0 - 2017-04-13 + +First release. + + +[keep-a-changelog]: https://github.com/olivierlacan/keep-a-changelog diff --git a/node_modules/picomatch/LICENSE b/node_modules/picomatch/LICENSE new file mode 100644 index 0000000..3608dca --- /dev/null +++ b/node_modules/picomatch/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2017-present, Jon Schlinkert. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/picomatch/README.md b/node_modules/picomatch/README.md new file mode 100644 index 0000000..b0526e2 --- /dev/null +++ b/node_modules/picomatch/README.md @@ -0,0 +1,708 @@ +

Picomatch

+ +

+ +version + + +test status + + +coverage status + + +downloads + +

+ +
+
+ +

+Blazing fast and accurate glob matcher written in JavaScript.
+No dependencies and full support for standard and extended Bash glob features, including braces, extglobs, POSIX brackets, and regular expressions. +

+ +
+
+ +## Why picomatch? + +* **Lightweight** - No dependencies +* **Minimal** - Tiny API surface. Main export is a function that takes a glob pattern and returns a matcher function. +* **Fast** - Loads in about 2ms (that's several times faster than a [single frame of a HD movie](http://www.endmemo.com/sconvert/framespersecondframespermillisecond.php) at 60fps) +* **Performant** - Use the returned matcher function to speed up repeat matching (like when watching files) +* **Accurate matching** - Using wildcards (`*` and `?`), globstars (`**`) for nested directories, [advanced globbing](#advanced-globbing) with extglobs, braces, and POSIX brackets, and support for escaping special characters with `\` or quotes. +* **Well tested** - Thousands of unit tests + +See the [library comparison](#library-comparisons) to other libraries. + +
+
+ +## Table of Contents + +
Click to expand + +- [Install](#install) +- [Usage](#usage) +- [API](#api) + * [picomatch](#picomatch) + * [.test](#test) + * [.matchBase](#matchbase) + * [.isMatch](#ismatch) + * [.parse](#parse) + * [.scan](#scan) + * [.compileRe](#compilere) + * [.makeRe](#makere) + * [.toRegex](#toregex) +- [Options](#options) + * [Picomatch options](#picomatch-options) + * [Scan Options](#scan-options) + * [Options Examples](#options-examples) +- [Globbing features](#globbing-features) + * [Basic globbing](#basic-globbing) + * [Advanced globbing](#advanced-globbing) + * [Braces](#braces) + * [Matching special characters as literals](#matching-special-characters-as-literals) +- [Library Comparisons](#library-comparisons) +- [Benchmarks](#benchmarks) +- [Philosophies](#philosophies) +- [About](#about) + * [Author](#author) + * [License](#license) + +_(TOC generated by [verb](https://github.com/verbose/verb) using [markdown-toc](https://github.com/jonschlinkert/markdown-toc))_ + +
+ +
+
+ +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +npm install --save picomatch +``` + +
+ +## Usage + +The main export is a function that takes a glob pattern and an options object and returns a function for matching strings. + +```js +const pm = require('picomatch'); +const isMatch = pm('*.js'); + +console.log(isMatch('abcd')); //=> false +console.log(isMatch('a.js')); //=> true +console.log(isMatch('a.md')); //=> false +console.log(isMatch('a/b.js')); //=> false +``` + +
+ +## API + +### [picomatch](lib/picomatch.js#L32) + +Creates a matcher function from one or more glob patterns. The returned function takes a string to match as its first argument, and returns true if the string is a match. The returned matcher function also takes a boolean as the second argument that, when true, returns an object with additional information. + +**Params** + +* `globs` **{String|Array}**: One or more glob patterns. +* `options` **{Object=}** +* `returns` **{Function=}**: Returns a matcher function. + +**Example** + +```js +const picomatch = require('picomatch'); +// picomatch(glob[, options]); + +const isMatch = picomatch('*.!(*a)'); +console.log(isMatch('a.a')); //=> false +console.log(isMatch('a.b')); //=> true +``` + +### [.test](lib/picomatch.js#L117) + +Test `input` with the given `regex`. This is used by the main `picomatch()` function to test the input string. + +**Params** + +* `input` **{String}**: String to test. +* `regex` **{RegExp}** +* `returns` **{Object}**: Returns an object with matching info. + +**Example** + +```js +const picomatch = require('picomatch'); +// picomatch.test(input, regex[, options]); + +console.log(picomatch.test('foo/bar', /^(?:([^/]*?)\/([^/]*?))$/)); +// { isMatch: true, match: [ 'foo/', 'foo', 'bar' ], output: 'foo/bar' } +``` + +### [.matchBase](lib/picomatch.js#L161) + +Match the basename of a filepath. + +**Params** + +* `input` **{String}**: String to test. +* `glob` **{RegExp|String}**: Glob pattern or regex created by [.makeRe](#makeRe). +* `returns` **{Boolean}** + +**Example** + +```js +const picomatch = require('picomatch'); +// picomatch.matchBase(input, glob[, options]); +console.log(picomatch.matchBase('foo/bar.js', '*.js'); // true +``` + +### [.isMatch](lib/picomatch.js#L183) + +Returns true if **any** of the given glob `patterns` match the specified `string`. + +**Params** + +* **{String|Array}**: str The string to test. +* **{String|Array}**: patterns One or more glob patterns to use for matching. +* **{Object}**: See available [options](#options). +* `returns` **{Boolean}**: Returns true if any patterns match `str` + +**Example** + +```js +const picomatch = require('picomatch'); +// picomatch.isMatch(string, patterns[, options]); + +console.log(picomatch.isMatch('a.a', ['b.*', '*.a'])); //=> true +console.log(picomatch.isMatch('a.a', 'b.*')); //=> false +``` + +### [.parse](lib/picomatch.js#L199) + +Parse a glob pattern to create the source string for a regular expression. + +**Params** + +* `pattern` **{String}** +* `options` **{Object}** +* `returns` **{Object}**: Returns an object with useful properties and output to be used as a regex source string. + +**Example** + +```js +const picomatch = require('picomatch'); +const result = picomatch.parse(pattern[, options]); +``` + +### [.scan](lib/picomatch.js#L231) + +Scan a glob pattern to separate the pattern into segments. + +**Params** + +* `input` **{String}**: Glob pattern to scan. +* `options` **{Object}** +* `returns` **{Object}**: Returns an object with + +**Example** + +```js +const picomatch = require('picomatch'); +// picomatch.scan(input[, options]); + +const result = picomatch.scan('!./foo/*.js'); +console.log(result); +{ prefix: '!./', + input: '!./foo/*.js', + start: 3, + base: 'foo', + glob: '*.js', + isBrace: false, + isBracket: false, + isGlob: true, + isExtglob: false, + isGlobstar: false, + negated: true } +``` + +### [.compileRe](lib/picomatch.js#L245) + +Compile a regular expression from the `state` object returned by the +[parse()](#parse) method. + +**Params** + +* `state` **{Object}** +* `options` **{Object}** +* `returnOutput` **{Boolean}**: Intended for implementors, this argument allows you to return the raw output from the parser. +* `returnState` **{Boolean}**: Adds the state to a `state` property on the returned regex. Useful for implementors and debugging. +* `returns` **{RegExp}** + +### [.makeRe](lib/picomatch.js#L286) + +Create a regular expression from a parsed glob pattern. + +**Params** + +* `state` **{String}**: The object returned from the `.parse` method. +* `options` **{Object}** +* `returnOutput` **{Boolean}**: Implementors may use this argument to return the compiled output, instead of a regular expression. This is not exposed on the options to prevent end-users from mutating the result. +* `returnState` **{Boolean}**: Implementors may use this argument to return the state from the parsed glob with the returned regular expression. +* `returns` **{RegExp}**: Returns a regex created from the given pattern. + +**Example** + +```js +const picomatch = require('picomatch'); +const state = picomatch.parse('*.js'); +// picomatch.compileRe(state[, options]); + +console.log(picomatch.compileRe(state)); +//=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/ +``` + +### [.toRegex](lib/picomatch.js#L321) + +Create a regular expression from the given regex source string. + +**Params** + +* `source` **{String}**: Regular expression source string. +* `options` **{Object}** +* `returns` **{RegExp}** + +**Example** + +```js +const picomatch = require('picomatch'); +// picomatch.toRegex(source[, options]); + +const { output } = picomatch.parse('*.js'); +console.log(picomatch.toRegex(output)); +//=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/ +``` + +
+ +## Options + +### Picomatch options + +The following options may be used with the main `picomatch()` function or any of the methods on the picomatch API. + +| **Option** | **Type** | **Default value** | **Description** | +| --- | --- | --- | --- | +| `basename` | `boolean` | `false` | If set, then patterns without slashes will be matched against the basename of the path if it contains slashes. For example, `a?b` would match the path `/xyz/123/acb`, but not `/xyz/acb/123`. | +| `bash` | `boolean` | `false` | Follow bash matching rules more strictly - disallows backslashes as escape characters, and treats single stars as globstars (`**`). | +| `capture` | `boolean` | `undefined` | Return regex matches in supporting methods. | +| `contains` | `boolean` | `undefined` | Allows glob to match any part of the given string(s). | +| `cwd` | `string` | `process.cwd()` | Current working directory. Used by `picomatch.split()` | +| `debug` | `boolean` | `undefined` | Debug regular expressions when an error is thrown. | +| `dot` | `boolean` | `false` | Enable dotfile matching. By default, dotfiles are ignored unless a `.` is explicitly defined in the pattern, or `options.dot` is true | +| `expandRange` | `function` | `undefined` | Custom function for expanding ranges in brace patterns, such as `{a..z}`. The function receives the range values as two arguments, and it must return a string to be used in the generated regex. It's recommended that returned strings be wrapped in parentheses. | +| `failglob` | `boolean` | `false` | Throws an error if no matches are found. Based on the bash option of the same name. | +| `fastpaths` | `boolean` | `true` | To speed up processing, full parsing is skipped for a handful common glob patterns. Disable this behavior by setting this option to `false`. | +| `flags` | `string` | `undefined` | Regex flags to use in the generated regex. If defined, the `nocase` option will be overridden. | +| [format](#optionsformat) | `function` | `undefined` | Custom function for formatting the returned string. This is useful for removing leading slashes, converting Windows paths to Posix paths, etc. | +| `ignore` | `array\|string` | `undefined` | One or more glob patterns for excluding strings that should not be matched from the result. | +| `keepQuotes` | `boolean` | `false` | Retain quotes in the generated regex, since quotes may also be used as an alternative to backslashes. | +| `literalBrackets` | `boolean` | `undefined` | When `true`, brackets in the glob pattern will be escaped so that only literal brackets will be matched. | +| `matchBase` | `boolean` | `false` | Alias for `basename` | +| `maxLength` | `boolean` | `65536` | Limit the max length of the input string. An error is thrown if the input string is longer than this value. | +| `nobrace` | `boolean` | `false` | Disable brace matching, so that `{a,b}` and `{1..3}` would be treated as literal characters. | +| `nobracket` | `boolean` | `undefined` | Disable matching with regex brackets. | +| `nocase` | `boolean` | `false` | Make matching case-insensitive. Equivalent to the regex `i` flag. Note that this option is overridden by the `flags` option. | +| `nodupes` | `boolean` | `true` | Deprecated, use `nounique` instead. This option will be removed in a future major release. By default duplicates are removed. Disable uniquification by setting this option to false. | +| `noext` | `boolean` | `false` | Alias for `noextglob` | +| `noextglob` | `boolean` | `false` | Disable support for matching with extglobs (like `+(a\|b)`) | +| `noglobstar` | `boolean` | `false` | Disable support for matching nested directories with globstars (`**`) | +| `nonegate` | `boolean` | `false` | Disable support for negating with leading `!` | +| `noquantifiers` | `boolean` | `false` | Disable support for regex quantifiers (like `a{1,2}`) and treat them as brace patterns to be expanded. | +| [onIgnore](#optionsonIgnore) | `function` | `undefined` | Function to be called on ignored items. | +| [onMatch](#optionsonMatch) | `function` | `undefined` | Function to be called on matched items. | +| [onResult](#optionsonResult) | `function` | `undefined` | Function to be called on all items, regardless of whether or not they are matched or ignored. | +| `posix` | `boolean` | `false` | Support POSIX character classes ("posix brackets"). | +| `posixSlashes` | `boolean` | `undefined` | Convert all slashes in file paths to forward slashes. This does not convert slashes in the glob pattern itself | +| `prepend` | `boolean` | `undefined` | String to prepend to the generated regex used for matching. | +| `regex` | `boolean` | `false` | Use regular expression rules for `+` (instead of matching literal `+`), and for stars that follow closing parentheses or brackets (as in `)*` and `]*`). | +| `strictBrackets` | `boolean` | `undefined` | Throw an error if brackets, braces, or parens are imbalanced. | +| `strictSlashes` | `boolean` | `undefined` | When true, picomatch won't match trailing slashes with single stars. | +| `unescape` | `boolean` | `undefined` | Remove backslashes preceding escaped characters in the glob pattern. By default, backslashes are retained. | +| `unixify` | `boolean` | `undefined` | Alias for `posixSlashes`, for backwards compatibility. | + +picomatch has automatic detection for regex positive and negative lookbehinds. If the pattern contains a negative lookbehind, you must be using Node.js >= 8.10 or else picomatch will throw an error. + +### Scan Options + +In addition to the main [picomatch options](#picomatch-options), the following options may also be used with the [.scan](#scan) method. + +| **Option** | **Type** | **Default value** | **Description** | +| --- | --- | --- | --- | +| `tokens` | `boolean` | `false` | When `true`, the returned object will include an array of tokens (objects), representing each path "segment" in the scanned glob pattern | +| `parts` | `boolean` | `false` | When `true`, the returned object will include an array of strings representing each path "segment" in the scanned glob pattern. This is automatically enabled when `options.tokens` is true | + +**Example** + +```js +const picomatch = require('picomatch'); +const result = picomatch.scan('!./foo/*.js', { tokens: true }); +console.log(result); +// { +// prefix: '!./', +// input: '!./foo/*.js', +// start: 3, +// base: 'foo', +// glob: '*.js', +// isBrace: false, +// isBracket: false, +// isGlob: true, +// isExtglob: false, +// isGlobstar: false, +// negated: true, +// maxDepth: 2, +// tokens: [ +// { value: '!./', depth: 0, isGlob: false, negated: true, isPrefix: true }, +// { value: 'foo', depth: 1, isGlob: false }, +// { value: '*.js', depth: 1, isGlob: true } +// ], +// slashes: [ 2, 6 ], +// parts: [ 'foo', '*.js' ] +// } +``` + +
+ +### Options Examples + +#### options.expandRange + +**Type**: `function` + +**Default**: `undefined` + +Custom function for expanding ranges in brace patterns. The [fill-range](https://github.com/jonschlinkert/fill-range) library is ideal for this purpose, or you can use custom code to do whatever you need. + +**Example** + +The following example shows how to create a glob that matches a folder + +```js +const fill = require('fill-range'); +const regex = pm.makeRe('foo/{01..25}/bar', { + expandRange(a, b) { + return `(${fill(a, b, { toRegex: true })})`; + } +}); + +console.log(regex); +//=> /^(?:foo\/((?:0[1-9]|1[0-9]|2[0-5]))\/bar)$/ + +console.log(regex.test('foo/00/bar')) // false +console.log(regex.test('foo/01/bar')) // true +console.log(regex.test('foo/10/bar')) // true +console.log(regex.test('foo/22/bar')) // true +console.log(regex.test('foo/25/bar')) // true +console.log(regex.test('foo/26/bar')) // false +``` + +#### options.format + +**Type**: `function` + +**Default**: `undefined` + +Custom function for formatting strings before they're matched. + +**Example** + +```js +// strip leading './' from strings +const format = str => str.replace(/^\.\//, ''); +const isMatch = picomatch('foo/*.js', { format }); +console.log(isMatch('./foo/bar.js')); //=> true +``` + +#### options.onMatch + +```js +const onMatch = ({ glob, regex, input, output }) => { + console.log({ glob, regex, input, output }); +}; + +const isMatch = picomatch('*', { onMatch }); +isMatch('foo'); +isMatch('bar'); +isMatch('baz'); +``` + +#### options.onIgnore + +```js +const onIgnore = ({ glob, regex, input, output }) => { + console.log({ glob, regex, input, output }); +}; + +const isMatch = picomatch('*', { onIgnore, ignore: 'f*' }); +isMatch('foo'); +isMatch('bar'); +isMatch('baz'); +``` + +#### options.onResult + +```js +const onResult = ({ glob, regex, input, output }) => { + console.log({ glob, regex, input, output }); +}; + +const isMatch = picomatch('*', { onResult, ignore: 'f*' }); +isMatch('foo'); +isMatch('bar'); +isMatch('baz'); +``` + +
+
+ +## Globbing features + +* [Basic globbing](#basic-globbing) (Wildcard matching) +* [Advanced globbing](#advanced-globbing) (extglobs, posix brackets, brace matching) + +### Basic globbing + +| **Character** | **Description** | +| --- | --- | +| `*` | Matches any character zero or more times, excluding path separators. Does _not match_ path separators or hidden files or directories ("dotfiles"), unless explicitly enabled by setting the `dot` option to `true`. | +| `**` | Matches any character zero or more times, including path separators. Note that `**` will only match path separators (`/`, and `\\` on Windows) when they are the only characters in a path segment. Thus, `foo**/bar` is equivalent to `foo*/bar`, and `foo/a**b/bar` is equivalent to `foo/a*b/bar`, and _more than two_ consecutive stars in a glob path segment are regarded as _a single star_. Thus, `foo/***/bar` is equivalent to `foo/*/bar`. | +| `?` | Matches any character excluding path separators one time. Does _not match_ path separators or leading dots. | +| `[abc]` | Matches any characters inside the brackets. For example, `[abc]` would match the characters `a`, `b` or `c`, and nothing else. | + +#### Matching behavior vs. Bash + +Picomatch's matching features and expected results in unit tests are based on Bash's unit tests and the Bash 4.3 specification, with the following exceptions: + +* Bash will match `foo/bar/baz` with `*`. Picomatch only matches nested directories with `**`. +* Bash greedily matches with negated extglobs. For example, Bash 4.3 says that `!(foo)*` should match `foo` and `foobar`, since the trailing `*` bracktracks to match the preceding pattern. This is very memory-inefficient, and IMHO, also incorrect. Picomatch would return `false` for both `foo` and `foobar`. + +
+ +### Advanced globbing + +* [extglobs](#extglobs) +* [POSIX brackets](#posix-brackets) +* [Braces](#brace-expansion) + +#### Extglobs + +| **Pattern** | **Description** | +| --- | --- | +| `@(pattern)` | Match _only one_ consecutive occurrence of `pattern` | +| `*(pattern)` | Match _zero or more_ consecutive occurrences of `pattern` | +| `+(pattern)` | Match _one or more_ consecutive occurrences of `pattern` | +| `?(pattern)` | Match _zero or **one**_ consecutive occurrences of `pattern` | +| `!(pattern)` | Match _anything but_ `pattern` | + +**Examples** + +```js +const pm = require('picomatch'); + +// *(pattern) matches ZERO or more of "pattern" +console.log(pm.isMatch('a', 'a*(z)')); // true +console.log(pm.isMatch('az', 'a*(z)')); // true +console.log(pm.isMatch('azzz', 'a*(z)')); // true + +// +(pattern) matches ONE or more of "pattern" +console.log(pm.isMatch('a', 'a*(z)')); // true +console.log(pm.isMatch('az', 'a*(z)')); // true +console.log(pm.isMatch('azzz', 'a*(z)')); // true + +// supports multiple extglobs +console.log(pm.isMatch('foo.bar', '!(foo).!(bar)')); // false + +// supports nested extglobs +console.log(pm.isMatch('foo.bar', '!(!(foo)).!(!(bar))')); // true +``` + +#### POSIX brackets + +POSIX classes are disabled by default. Enable this feature by setting the `posix` option to true. + +**Enable POSIX bracket support** + +```js +console.log(pm.makeRe('[[:word:]]+', { posix: true })); +//=> /^(?:(?=.)[A-Za-z0-9_]+\/?)$/ +``` + +**Supported POSIX classes** + +The following named POSIX bracket expressions are supported: + +* `[:alnum:]` - Alphanumeric characters, equ `[a-zA-Z0-9]` +* `[:alpha:]` - Alphabetical characters, equivalent to `[a-zA-Z]`. +* `[:ascii:]` - ASCII characters, equivalent to `[\\x00-\\x7F]`. +* `[:blank:]` - Space and tab characters, equivalent to `[ \\t]`. +* `[:cntrl:]` - Control characters, equivalent to `[\\x00-\\x1F\\x7F]`. +* `[:digit:]` - Numerical digits, equivalent to `[0-9]`. +* `[:graph:]` - Graph characters, equivalent to `[\\x21-\\x7E]`. +* `[:lower:]` - Lowercase letters, equivalent to `[a-z]`. +* `[:print:]` - Print characters, equivalent to `[\\x20-\\x7E ]`. +* `[:punct:]` - Punctuation and symbols, equivalent to `[\\-!"#$%&\'()\\*+,./:;<=>?@[\\]^_`{|}~]`. +* `[:space:]` - Extended space characters, equivalent to `[ \\t\\r\\n\\v\\f]`. +* `[:upper:]` - Uppercase letters, equivalent to `[A-Z]`. +* `[:word:]` - Word characters (letters, numbers and underscores), equivalent to `[A-Za-z0-9_]`. +* `[:xdigit:]` - Hexadecimal digits, equivalent to `[A-Fa-f0-9]`. + +See the [Bash Reference Manual](https://www.gnu.org/software/bash/manual/html_node/Pattern-Matching.html) for more information. + +### Braces + +Picomatch does not do brace expansion. For [brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html) and advanced matching with braces, use [micromatch](https://github.com/micromatch/micromatch) instead. Picomatch has very basic support for braces. + +### Matching special characters as literals + +If you wish to match the following special characters in a filepath, and you want to use these characters in your glob pattern, they must be escaped with backslashes or quotes: + +**Special Characters** + +Some characters that are used for matching in regular expressions are also regarded as valid file path characters on some platforms. + +To match any of the following characters as literals: `$^*+?()[] + +Examples: + +```js +console.log(pm.makeRe('foo/bar \\(1\\)')); +console.log(pm.makeRe('foo/bar \\(1\\)')); +``` + +
+
+ +## Library Comparisons + +The following table shows which features are supported by [minimatch](https://github.com/isaacs/minimatch), [micromatch](https://github.com/micromatch/micromatch), [picomatch](https://github.com/micromatch/picomatch), [nanomatch](https://github.com/micromatch/nanomatch), [extglob](https://github.com/micromatch/extglob), [braces](https://github.com/micromatch/braces), and [expand-brackets](https://github.com/micromatch/expand-brackets). + +| **Feature** | `minimatch` | `micromatch` | `picomatch` | `nanomatch` | `extglob` | `braces` | `expand-brackets` | +| --- | --- | --- | --- | --- | --- | --- | --- | +| Wildcard matching (`*?+`) | ✔ | ✔ | ✔ | ✔ | - | - | - | +| Advancing globbing | ✔ | ✔ | ✔ | - | - | - | - | +| Brace _matching_ | ✔ | ✔ | ✔ | - | - | ✔ | - | +| Brace _expansion_ | ✔ | ✔ | - | - | - | ✔ | - | +| Extglobs | partial | ✔ | ✔ | - | ✔ | - | - | +| Posix brackets | - | ✔ | ✔ | - | - | - | ✔ | +| Regular expression syntax | - | ✔ | ✔ | ✔ | ✔ | - | ✔ | +| File system operations | - | - | - | - | - | - | - | + +
+
+ +## Benchmarks + +Performance comparison of picomatch and minimatch. + +``` +# .makeRe star + picomatch x 1,993,050 ops/sec ±0.51% (91 runs sampled) + minimatch x 627,206 ops/sec ±1.96% (87 runs sampled)) + +# .makeRe star; dot=true + picomatch x 1,436,640 ops/sec ±0.62% (91 runs sampled) + minimatch x 525,876 ops/sec ±0.60% (88 runs sampled) + +# .makeRe globstar + picomatch x 1,592,742 ops/sec ±0.42% (90 runs sampled) + minimatch x 962,043 ops/sec ±1.76% (91 runs sampled)d) + +# .makeRe globstars + picomatch x 1,615,199 ops/sec ±0.35% (94 runs sampled) + minimatch x 477,179 ops/sec ±1.33% (91 runs sampled) + +# .makeRe with leading star + picomatch x 1,220,856 ops/sec ±0.40% (92 runs sampled) + minimatch x 453,564 ops/sec ±1.43% (94 runs sampled) + +# .makeRe - basic braces + picomatch x 392,067 ops/sec ±0.70% (90 runs sampled) + minimatch x 99,532 ops/sec ±2.03% (87 runs sampled)) +``` + +
+
+ +## Philosophies + +The goal of this library is to be blazing fast, without compromising on accuracy. + +**Accuracy** + +The number one of goal of this library is accuracy. However, it's not unusual for different glob implementations to have different rules for matching behavior, even with simple wildcard matching. It gets increasingly more complicated when combinations of different features are combined, like when extglobs are combined with globstars, braces, slashes, and so on: `!(**/{a,b,*/c})`. + +Thus, given that there is no canonical glob specification to use as a single source of truth when differences of opinion arise regarding behavior, sometimes we have to implement our best judgement and rely on feedback from users to make improvements. + +**Performance** + +Although this library performs well in benchmarks, and in most cases it's faster than other popular libraries we benchmarked against, we will always choose accuracy over performance. It's not helpful to anyone if our library is faster at returning the wrong answer. + +
+
+ +## About + +
+Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +Please read the [contributing guide](.github/contributing.md) for advice on opening issues, pull requests, and coding standards. + +
+ +
+Running Tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +npm install && npm test +``` + +
+ +
+Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +
+ +### Author + +**Jon Schlinkert** + +* [GitHub Profile](https://github.com/jonschlinkert) +* [Twitter Profile](https://twitter.com/jonschlinkert) +* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert) + +### License + +Copyright © 2017-present, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). diff --git a/node_modules/picomatch/index.js b/node_modules/picomatch/index.js new file mode 100644 index 0000000..d2f2bc5 --- /dev/null +++ b/node_modules/picomatch/index.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./lib/picomatch'); diff --git a/node_modules/picomatch/lib/constants.js b/node_modules/picomatch/lib/constants.js new file mode 100644 index 0000000..a62ef38 --- /dev/null +++ b/node_modules/picomatch/lib/constants.js @@ -0,0 +1,179 @@ +'use strict'; + +const path = require('path'); +const WIN_SLASH = '\\\\/'; +const WIN_NO_SLASH = `[^${WIN_SLASH}]`; + +/** + * Posix glob regex + */ + +const DOT_LITERAL = '\\.'; +const PLUS_LITERAL = '\\+'; +const QMARK_LITERAL = '\\?'; +const SLASH_LITERAL = '\\/'; +const ONE_CHAR = '(?=.)'; +const QMARK = '[^/]'; +const END_ANCHOR = `(?:${SLASH_LITERAL}|$)`; +const START_ANCHOR = `(?:^|${SLASH_LITERAL})`; +const DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`; +const NO_DOT = `(?!${DOT_LITERAL})`; +const NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`; +const NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`; +const NO_DOTS_SLASH = `(?!${DOTS_SLASH})`; +const QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`; +const STAR = `${QMARK}*?`; + +const POSIX_CHARS = { + DOT_LITERAL, + PLUS_LITERAL, + QMARK_LITERAL, + SLASH_LITERAL, + ONE_CHAR, + QMARK, + END_ANCHOR, + DOTS_SLASH, + NO_DOT, + NO_DOTS, + NO_DOT_SLASH, + NO_DOTS_SLASH, + QMARK_NO_DOT, + STAR, + START_ANCHOR +}; + +/** + * Windows glob regex + */ + +const WINDOWS_CHARS = { + ...POSIX_CHARS, + + SLASH_LITERAL: `[${WIN_SLASH}]`, + QMARK: WIN_NO_SLASH, + STAR: `${WIN_NO_SLASH}*?`, + DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`, + NO_DOT: `(?!${DOT_LITERAL})`, + NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`, + NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`, + NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`, + QMARK_NO_DOT: `[^.${WIN_SLASH}]`, + START_ANCHOR: `(?:^|[${WIN_SLASH}])`, + END_ANCHOR: `(?:[${WIN_SLASH}]|$)` +}; + +/** + * POSIX Bracket Regex + */ + +const POSIX_REGEX_SOURCE = { + alnum: 'a-zA-Z0-9', + alpha: 'a-zA-Z', + ascii: '\\x00-\\x7F', + blank: ' \\t', + cntrl: '\\x00-\\x1F\\x7F', + digit: '0-9', + graph: '\\x21-\\x7E', + lower: 'a-z', + print: '\\x20-\\x7E ', + punct: '\\-!"#$%&\'()\\*+,./:;<=>?@[\\]^_`{|}~', + space: ' \\t\\r\\n\\v\\f', + upper: 'A-Z', + word: 'A-Za-z0-9_', + xdigit: 'A-Fa-f0-9' +}; + +module.exports = { + MAX_LENGTH: 1024 * 64, + POSIX_REGEX_SOURCE, + + // regular expressions + REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g, + REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/, + REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/, + REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g, + REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g, + REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g, + + // Replace globs with equivalent patterns to reduce parsing time. + REPLACEMENTS: { + '***': '*', + '**/**': '**', + '**/**/**': '**' + }, + + // Digits + CHAR_0: 48, /* 0 */ + CHAR_9: 57, /* 9 */ + + // Alphabet chars. + CHAR_UPPERCASE_A: 65, /* A */ + CHAR_LOWERCASE_A: 97, /* a */ + CHAR_UPPERCASE_Z: 90, /* Z */ + CHAR_LOWERCASE_Z: 122, /* z */ + + CHAR_LEFT_PARENTHESES: 40, /* ( */ + CHAR_RIGHT_PARENTHESES: 41, /* ) */ + + CHAR_ASTERISK: 42, /* * */ + + // Non-alphabetic chars. + CHAR_AMPERSAND: 38, /* & */ + CHAR_AT: 64, /* @ */ + CHAR_BACKWARD_SLASH: 92, /* \ */ + CHAR_CARRIAGE_RETURN: 13, /* \r */ + CHAR_CIRCUMFLEX_ACCENT: 94, /* ^ */ + CHAR_COLON: 58, /* : */ + CHAR_COMMA: 44, /* , */ + CHAR_DOT: 46, /* . */ + CHAR_DOUBLE_QUOTE: 34, /* " */ + CHAR_EQUAL: 61, /* = */ + CHAR_EXCLAMATION_MARK: 33, /* ! */ + CHAR_FORM_FEED: 12, /* \f */ + CHAR_FORWARD_SLASH: 47, /* / */ + CHAR_GRAVE_ACCENT: 96, /* ` */ + CHAR_HASH: 35, /* # */ + CHAR_HYPHEN_MINUS: 45, /* - */ + CHAR_LEFT_ANGLE_BRACKET: 60, /* < */ + CHAR_LEFT_CURLY_BRACE: 123, /* { */ + CHAR_LEFT_SQUARE_BRACKET: 91, /* [ */ + CHAR_LINE_FEED: 10, /* \n */ + CHAR_NO_BREAK_SPACE: 160, /* \u00A0 */ + CHAR_PERCENT: 37, /* % */ + CHAR_PLUS: 43, /* + */ + CHAR_QUESTION_MARK: 63, /* ? */ + CHAR_RIGHT_ANGLE_BRACKET: 62, /* > */ + CHAR_RIGHT_CURLY_BRACE: 125, /* } */ + CHAR_RIGHT_SQUARE_BRACKET: 93, /* ] */ + CHAR_SEMICOLON: 59, /* ; */ + CHAR_SINGLE_QUOTE: 39, /* ' */ + CHAR_SPACE: 32, /* */ + CHAR_TAB: 9, /* \t */ + CHAR_UNDERSCORE: 95, /* _ */ + CHAR_VERTICAL_LINE: 124, /* | */ + CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279, /* \uFEFF */ + + SEP: path.sep, + + /** + * Create EXTGLOB_CHARS + */ + + extglobChars(chars) { + return { + '!': { type: 'negate', open: '(?:(?!(?:', close: `))${chars.STAR})` }, + '?': { type: 'qmark', open: '(?:', close: ')?' }, + '+': { type: 'plus', open: '(?:', close: ')+' }, + '*': { type: 'star', open: '(?:', close: ')*' }, + '@': { type: 'at', open: '(?:', close: ')' } + }; + }, + + /** + * Create GLOB_CHARS + */ + + globChars(win32) { + return win32 === true ? WINDOWS_CHARS : POSIX_CHARS; + } +}; diff --git a/node_modules/picomatch/lib/parse.js b/node_modules/picomatch/lib/parse.js new file mode 100644 index 0000000..58269d0 --- /dev/null +++ b/node_modules/picomatch/lib/parse.js @@ -0,0 +1,1091 @@ +'use strict'; + +const constants = require('./constants'); +const utils = require('./utils'); + +/** + * Constants + */ + +const { + MAX_LENGTH, + POSIX_REGEX_SOURCE, + REGEX_NON_SPECIAL_CHARS, + REGEX_SPECIAL_CHARS_BACKREF, + REPLACEMENTS +} = constants; + +/** + * Helpers + */ + +const expandRange = (args, options) => { + if (typeof options.expandRange === 'function') { + return options.expandRange(...args, options); + } + + args.sort(); + const value = `[${args.join('-')}]`; + + try { + /* eslint-disable-next-line no-new */ + new RegExp(value); + } catch (ex) { + return args.map(v => utils.escapeRegex(v)).join('..'); + } + + return value; +}; + +/** + * Create the message for a syntax error + */ + +const syntaxError = (type, char) => { + return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`; +}; + +/** + * Parse the given input string. + * @param {String} input + * @param {Object} options + * @return {Object} + */ + +const parse = (input, options) => { + if (typeof input !== 'string') { + throw new TypeError('Expected a string'); + } + + input = REPLACEMENTS[input] || input; + + const opts = { ...options }; + const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; + + let len = input.length; + if (len > max) { + throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`); + } + + const bos = { type: 'bos', value: '', output: opts.prepend || '' }; + const tokens = [bos]; + + const capture = opts.capture ? '' : '?:'; + const win32 = utils.isWindows(options); + + // create constants based on platform, for windows or posix + const PLATFORM_CHARS = constants.globChars(win32); + const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS); + + const { + DOT_LITERAL, + PLUS_LITERAL, + SLASH_LITERAL, + ONE_CHAR, + DOTS_SLASH, + NO_DOT, + NO_DOT_SLASH, + NO_DOTS_SLASH, + QMARK, + QMARK_NO_DOT, + STAR, + START_ANCHOR + } = PLATFORM_CHARS; + + const globstar = opts => { + return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`; + }; + + const nodot = opts.dot ? '' : NO_DOT; + const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT; + let star = opts.bash === true ? globstar(opts) : STAR; + + if (opts.capture) { + star = `(${star})`; + } + + // minimatch options support + if (typeof opts.noext === 'boolean') { + opts.noextglob = opts.noext; + } + + const state = { + input, + index: -1, + start: 0, + dot: opts.dot === true, + consumed: '', + output: '', + prefix: '', + backtrack: false, + negated: false, + brackets: 0, + braces: 0, + parens: 0, + quotes: 0, + globstar: false, + tokens + }; + + input = utils.removePrefix(input, state); + len = input.length; + + const extglobs = []; + const braces = []; + const stack = []; + let prev = bos; + let value; + + /** + * Tokenizing helpers + */ + + const eos = () => state.index === len - 1; + const peek = state.peek = (n = 1) => input[state.index + n]; + const advance = state.advance = () => input[++state.index] || ''; + const remaining = () => input.slice(state.index + 1); + const consume = (value = '', num = 0) => { + state.consumed += value; + state.index += num; + }; + + const append = token => { + state.output += token.output != null ? token.output : token.value; + consume(token.value); + }; + + const negate = () => { + let count = 1; + + while (peek() === '!' && (peek(2) !== '(' || peek(3) === '?')) { + advance(); + state.start++; + count++; + } + + if (count % 2 === 0) { + return false; + } + + state.negated = true; + state.start++; + return true; + }; + + const increment = type => { + state[type]++; + stack.push(type); + }; + + const decrement = type => { + state[type]--; + stack.pop(); + }; + + /** + * Push tokens onto the tokens array. This helper speeds up + * tokenizing by 1) helping us avoid backtracking as much as possible, + * and 2) helping us avoid creating extra tokens when consecutive + * characters are plain text. This improves performance and simplifies + * lookbehinds. + */ + + const push = tok => { + if (prev.type === 'globstar') { + const isBrace = state.braces > 0 && (tok.type === 'comma' || tok.type === 'brace'); + const isExtglob = tok.extglob === true || (extglobs.length && (tok.type === 'pipe' || tok.type === 'paren')); + + if (tok.type !== 'slash' && tok.type !== 'paren' && !isBrace && !isExtglob) { + state.output = state.output.slice(0, -prev.output.length); + prev.type = 'star'; + prev.value = '*'; + prev.output = star; + state.output += prev.output; + } + } + + if (extglobs.length && tok.type !== 'paren') { + extglobs[extglobs.length - 1].inner += tok.value; + } + + if (tok.value || tok.output) append(tok); + if (prev && prev.type === 'text' && tok.type === 'text') { + prev.value += tok.value; + prev.output = (prev.output || '') + tok.value; + return; + } + + tok.prev = prev; + tokens.push(tok); + prev = tok; + }; + + const extglobOpen = (type, value) => { + const token = { ...EXTGLOB_CHARS[value], conditions: 1, inner: '' }; + + token.prev = prev; + token.parens = state.parens; + token.output = state.output; + const output = (opts.capture ? '(' : '') + token.open; + + increment('parens'); + push({ type, value, output: state.output ? '' : ONE_CHAR }); + push({ type: 'paren', extglob: true, value: advance(), output }); + extglobs.push(token); + }; + + const extglobClose = token => { + let output = token.close + (opts.capture ? ')' : ''); + let rest; + + if (token.type === 'negate') { + let extglobStar = star; + + if (token.inner && token.inner.length > 1 && token.inner.includes('/')) { + extglobStar = globstar(opts); + } + + if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) { + output = token.close = `)$))${extglobStar}`; + } + + if (token.inner.includes('*') && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) { + // Any non-magical string (`.ts`) or even nested expression (`.{ts,tsx}`) can follow after the closing parenthesis. + // In this case, we need to parse the string and use it in the output of the original pattern. + // Suitable patterns: `/!(*.d).ts`, `/!(*.d).{ts,tsx}`, `**/!(*-dbg).@(js)`. + // + // Disabling the `fastpaths` option due to a problem with parsing strings as `.ts` in the pattern like `**/!(*.d).ts`. + const expression = parse(rest, { ...options, fastpaths: false }).output; + + output = token.close = `)${expression})${extglobStar})`; + } + + if (token.prev.type === 'bos') { + state.negatedExtglob = true; + } + } + + push({ type: 'paren', extglob: true, value, output }); + decrement('parens'); + }; + + /** + * Fast paths + */ + + if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) { + let backslashes = false; + + let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => { + if (first === '\\') { + backslashes = true; + return m; + } + + if (first === '?') { + if (esc) { + return esc + first + (rest ? QMARK.repeat(rest.length) : ''); + } + if (index === 0) { + return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : ''); + } + return QMARK.repeat(chars.length); + } + + if (first === '.') { + return DOT_LITERAL.repeat(chars.length); + } + + if (first === '*') { + if (esc) { + return esc + first + (rest ? star : ''); + } + return star; + } + return esc ? m : `\\${m}`; + }); + + if (backslashes === true) { + if (opts.unescape === true) { + output = output.replace(/\\/g, ''); + } else { + output = output.replace(/\\+/g, m => { + return m.length % 2 === 0 ? '\\\\' : (m ? '\\' : ''); + }); + } + } + + if (output === input && opts.contains === true) { + state.output = input; + return state; + } + + state.output = utils.wrapOutput(output, state, options); + return state; + } + + /** + * Tokenize input until we reach end-of-string + */ + + while (!eos()) { + value = advance(); + + if (value === '\u0000') { + continue; + } + + /** + * Escaped characters + */ + + if (value === '\\') { + const next = peek(); + + if (next === '/' && opts.bash !== true) { + continue; + } + + if (next === '.' || next === ';') { + continue; + } + + if (!next) { + value += '\\'; + push({ type: 'text', value }); + continue; + } + + // collapse slashes to reduce potential for exploits + const match = /^\\+/.exec(remaining()); + let slashes = 0; + + if (match && match[0].length > 2) { + slashes = match[0].length; + state.index += slashes; + if (slashes % 2 !== 0) { + value += '\\'; + } + } + + if (opts.unescape === true) { + value = advance(); + } else { + value += advance(); + } + + if (state.brackets === 0) { + push({ type: 'text', value }); + continue; + } + } + + /** + * If we're inside a regex character class, continue + * until we reach the closing bracket. + */ + + if (state.brackets > 0 && (value !== ']' || prev.value === '[' || prev.value === '[^')) { + if (opts.posix !== false && value === ':') { + const inner = prev.value.slice(1); + if (inner.includes('[')) { + prev.posix = true; + + if (inner.includes(':')) { + const idx = prev.value.lastIndexOf('['); + const pre = prev.value.slice(0, idx); + const rest = prev.value.slice(idx + 2); + const posix = POSIX_REGEX_SOURCE[rest]; + if (posix) { + prev.value = pre + posix; + state.backtrack = true; + advance(); + + if (!bos.output && tokens.indexOf(prev) === 1) { + bos.output = ONE_CHAR; + } + continue; + } + } + } + } + + if ((value === '[' && peek() !== ':') || (value === '-' && peek() === ']')) { + value = `\\${value}`; + } + + if (value === ']' && (prev.value === '[' || prev.value === '[^')) { + value = `\\${value}`; + } + + if (opts.posix === true && value === '!' && prev.value === '[') { + value = '^'; + } + + prev.value += value; + append({ value }); + continue; + } + + /** + * If we're inside a quoted string, continue + * until we reach the closing double quote. + */ + + if (state.quotes === 1 && value !== '"') { + value = utils.escapeRegex(value); + prev.value += value; + append({ value }); + continue; + } + + /** + * Double quotes + */ + + if (value === '"') { + state.quotes = state.quotes === 1 ? 0 : 1; + if (opts.keepQuotes === true) { + push({ type: 'text', value }); + } + continue; + } + + /** + * Parentheses + */ + + if (value === '(') { + increment('parens'); + push({ type: 'paren', value }); + continue; + } + + if (value === ')') { + if (state.parens === 0 && opts.strictBrackets === true) { + throw new SyntaxError(syntaxError('opening', '(')); + } + + const extglob = extglobs[extglobs.length - 1]; + if (extglob && state.parens === extglob.parens + 1) { + extglobClose(extglobs.pop()); + continue; + } + + push({ type: 'paren', value, output: state.parens ? ')' : '\\)' }); + decrement('parens'); + continue; + } + + /** + * Square brackets + */ + + if (value === '[') { + if (opts.nobracket === true || !remaining().includes(']')) { + if (opts.nobracket !== true && opts.strictBrackets === true) { + throw new SyntaxError(syntaxError('closing', ']')); + } + + value = `\\${value}`; + } else { + increment('brackets'); + } + + push({ type: 'bracket', value }); + continue; + } + + if (value === ']') { + if (opts.nobracket === true || (prev && prev.type === 'bracket' && prev.value.length === 1)) { + push({ type: 'text', value, output: `\\${value}` }); + continue; + } + + if (state.brackets === 0) { + if (opts.strictBrackets === true) { + throw new SyntaxError(syntaxError('opening', '[')); + } + + push({ type: 'text', value, output: `\\${value}` }); + continue; + } + + decrement('brackets'); + + const prevValue = prev.value.slice(1); + if (prev.posix !== true && prevValue[0] === '^' && !prevValue.includes('/')) { + value = `/${value}`; + } + + prev.value += value; + append({ value }); + + // when literal brackets are explicitly disabled + // assume we should match with a regex character class + if (opts.literalBrackets === false || utils.hasRegexChars(prevValue)) { + continue; + } + + const escaped = utils.escapeRegex(prev.value); + state.output = state.output.slice(0, -prev.value.length); + + // when literal brackets are explicitly enabled + // assume we should escape the brackets to match literal characters + if (opts.literalBrackets === true) { + state.output += escaped; + prev.value = escaped; + continue; + } + + // when the user specifies nothing, try to match both + prev.value = `(${capture}${escaped}|${prev.value})`; + state.output += prev.value; + continue; + } + + /** + * Braces + */ + + if (value === '{' && opts.nobrace !== true) { + increment('braces'); + + const open = { + type: 'brace', + value, + output: '(', + outputIndex: state.output.length, + tokensIndex: state.tokens.length + }; + + braces.push(open); + push(open); + continue; + } + + if (value === '}') { + const brace = braces[braces.length - 1]; + + if (opts.nobrace === true || !brace) { + push({ type: 'text', value, output: value }); + continue; + } + + let output = ')'; + + if (brace.dots === true) { + const arr = tokens.slice(); + const range = []; + + for (let i = arr.length - 1; i >= 0; i--) { + tokens.pop(); + if (arr[i].type === 'brace') { + break; + } + if (arr[i].type !== 'dots') { + range.unshift(arr[i].value); + } + } + + output = expandRange(range, opts); + state.backtrack = true; + } + + if (brace.comma !== true && brace.dots !== true) { + const out = state.output.slice(0, brace.outputIndex); + const toks = state.tokens.slice(brace.tokensIndex); + brace.value = brace.output = '\\{'; + value = output = '\\}'; + state.output = out; + for (const t of toks) { + state.output += (t.output || t.value); + } + } + + push({ type: 'brace', value, output }); + decrement('braces'); + braces.pop(); + continue; + } + + /** + * Pipes + */ + + if (value === '|') { + if (extglobs.length > 0) { + extglobs[extglobs.length - 1].conditions++; + } + push({ type: 'text', value }); + continue; + } + + /** + * Commas + */ + + if (value === ',') { + let output = value; + + const brace = braces[braces.length - 1]; + if (brace && stack[stack.length - 1] === 'braces') { + brace.comma = true; + output = '|'; + } + + push({ type: 'comma', value, output }); + continue; + } + + /** + * Slashes + */ + + if (value === '/') { + // if the beginning of the glob is "./", advance the start + // to the current index, and don't add the "./" characters + // to the state. This greatly simplifies lookbehinds when + // checking for BOS characters like "!" and "." (not "./") + if (prev.type === 'dot' && state.index === state.start + 1) { + state.start = state.index + 1; + state.consumed = ''; + state.output = ''; + tokens.pop(); + prev = bos; // reset "prev" to the first token + continue; + } + + push({ type: 'slash', value, output: SLASH_LITERAL }); + continue; + } + + /** + * Dots + */ + + if (value === '.') { + if (state.braces > 0 && prev.type === 'dot') { + if (prev.value === '.') prev.output = DOT_LITERAL; + const brace = braces[braces.length - 1]; + prev.type = 'dots'; + prev.output += value; + prev.value += value; + brace.dots = true; + continue; + } + + if ((state.braces + state.parens) === 0 && prev.type !== 'bos' && prev.type !== 'slash') { + push({ type: 'text', value, output: DOT_LITERAL }); + continue; + } + + push({ type: 'dot', value, output: DOT_LITERAL }); + continue; + } + + /** + * Question marks + */ + + if (value === '?') { + const isGroup = prev && prev.value === '('; + if (!isGroup && opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { + extglobOpen('qmark', value); + continue; + } + + if (prev && prev.type === 'paren') { + const next = peek(); + let output = value; + + if (next === '<' && !utils.supportsLookbehinds()) { + throw new Error('Node.js v10 or higher is required for regex lookbehinds'); + } + + if ((prev.value === '(' && !/[!=<:]/.test(next)) || (next === '<' && !/<([!=]|\w+>)/.test(remaining()))) { + output = `\\${value}`; + } + + push({ type: 'text', value, output }); + continue; + } + + if (opts.dot !== true && (prev.type === 'slash' || prev.type === 'bos')) { + push({ type: 'qmark', value, output: QMARK_NO_DOT }); + continue; + } + + push({ type: 'qmark', value, output: QMARK }); + continue; + } + + /** + * Exclamation + */ + + if (value === '!') { + if (opts.noextglob !== true && peek() === '(') { + if (peek(2) !== '?' || !/[!=<:]/.test(peek(3))) { + extglobOpen('negate', value); + continue; + } + } + + if (opts.nonegate !== true && state.index === 0) { + negate(); + continue; + } + } + + /** + * Plus + */ + + if (value === '+') { + if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { + extglobOpen('plus', value); + continue; + } + + if ((prev && prev.value === '(') || opts.regex === false) { + push({ type: 'plus', value, output: PLUS_LITERAL }); + continue; + } + + if ((prev && (prev.type === 'bracket' || prev.type === 'paren' || prev.type === 'brace')) || state.parens > 0) { + push({ type: 'plus', value }); + continue; + } + + push({ type: 'plus', value: PLUS_LITERAL }); + continue; + } + + /** + * Plain text + */ + + if (value === '@') { + if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { + push({ type: 'at', extglob: true, value, output: '' }); + continue; + } + + push({ type: 'text', value }); + continue; + } + + /** + * Plain text + */ + + if (value !== '*') { + if (value === '$' || value === '^') { + value = `\\${value}`; + } + + const match = REGEX_NON_SPECIAL_CHARS.exec(remaining()); + if (match) { + value += match[0]; + state.index += match[0].length; + } + + push({ type: 'text', value }); + continue; + } + + /** + * Stars + */ + + if (prev && (prev.type === 'globstar' || prev.star === true)) { + prev.type = 'star'; + prev.star = true; + prev.value += value; + prev.output = star; + state.backtrack = true; + state.globstar = true; + consume(value); + continue; + } + + let rest = remaining(); + if (opts.noextglob !== true && /^\([^?]/.test(rest)) { + extglobOpen('star', value); + continue; + } + + if (prev.type === 'star') { + if (opts.noglobstar === true) { + consume(value); + continue; + } + + const prior = prev.prev; + const before = prior.prev; + const isStart = prior.type === 'slash' || prior.type === 'bos'; + const afterStar = before && (before.type === 'star' || before.type === 'globstar'); + + if (opts.bash === true && (!isStart || (rest[0] && rest[0] !== '/'))) { + push({ type: 'star', value, output: '' }); + continue; + } + + const isBrace = state.braces > 0 && (prior.type === 'comma' || prior.type === 'brace'); + const isExtglob = extglobs.length && (prior.type === 'pipe' || prior.type === 'paren'); + if (!isStart && prior.type !== 'paren' && !isBrace && !isExtglob) { + push({ type: 'star', value, output: '' }); + continue; + } + + // strip consecutive `/**/` + while (rest.slice(0, 3) === '/**') { + const after = input[state.index + 4]; + if (after && after !== '/') { + break; + } + rest = rest.slice(3); + consume('/**', 3); + } + + if (prior.type === 'bos' && eos()) { + prev.type = 'globstar'; + prev.value += value; + prev.output = globstar(opts); + state.output = prev.output; + state.globstar = true; + consume(value); + continue; + } + + if (prior.type === 'slash' && prior.prev.type !== 'bos' && !afterStar && eos()) { + state.output = state.output.slice(0, -(prior.output + prev.output).length); + prior.output = `(?:${prior.output}`; + + prev.type = 'globstar'; + prev.output = globstar(opts) + (opts.strictSlashes ? ')' : '|$)'); + prev.value += value; + state.globstar = true; + state.output += prior.output + prev.output; + consume(value); + continue; + } + + if (prior.type === 'slash' && prior.prev.type !== 'bos' && rest[0] === '/') { + const end = rest[1] !== void 0 ? '|$' : ''; + + state.output = state.output.slice(0, -(prior.output + prev.output).length); + prior.output = `(?:${prior.output}`; + + prev.type = 'globstar'; + prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`; + prev.value += value; + + state.output += prior.output + prev.output; + state.globstar = true; + + consume(value + advance()); + + push({ type: 'slash', value: '/', output: '' }); + continue; + } + + if (prior.type === 'bos' && rest[0] === '/') { + prev.type = 'globstar'; + prev.value += value; + prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`; + state.output = prev.output; + state.globstar = true; + consume(value + advance()); + push({ type: 'slash', value: '/', output: '' }); + continue; + } + + // remove single star from output + state.output = state.output.slice(0, -prev.output.length); + + // reset previous token to globstar + prev.type = 'globstar'; + prev.output = globstar(opts); + prev.value += value; + + // reset output with globstar + state.output += prev.output; + state.globstar = true; + consume(value); + continue; + } + + const token = { type: 'star', value, output: star }; + + if (opts.bash === true) { + token.output = '.*?'; + if (prev.type === 'bos' || prev.type === 'slash') { + token.output = nodot + token.output; + } + push(token); + continue; + } + + if (prev && (prev.type === 'bracket' || prev.type === 'paren') && opts.regex === true) { + token.output = value; + push(token); + continue; + } + + if (state.index === state.start || prev.type === 'slash' || prev.type === 'dot') { + if (prev.type === 'dot') { + state.output += NO_DOT_SLASH; + prev.output += NO_DOT_SLASH; + + } else if (opts.dot === true) { + state.output += NO_DOTS_SLASH; + prev.output += NO_DOTS_SLASH; + + } else { + state.output += nodot; + prev.output += nodot; + } + + if (peek() !== '*') { + state.output += ONE_CHAR; + prev.output += ONE_CHAR; + } + } + + push(token); + } + + while (state.brackets > 0) { + if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ']')); + state.output = utils.escapeLast(state.output, '['); + decrement('brackets'); + } + + while (state.parens > 0) { + if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ')')); + state.output = utils.escapeLast(state.output, '('); + decrement('parens'); + } + + while (state.braces > 0) { + if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', '}')); + state.output = utils.escapeLast(state.output, '{'); + decrement('braces'); + } + + if (opts.strictSlashes !== true && (prev.type === 'star' || prev.type === 'bracket')) { + push({ type: 'maybe_slash', value: '', output: `${SLASH_LITERAL}?` }); + } + + // rebuild the output if we had to backtrack at any point + if (state.backtrack === true) { + state.output = ''; + + for (const token of state.tokens) { + state.output += token.output != null ? token.output : token.value; + + if (token.suffix) { + state.output += token.suffix; + } + } + } + + return state; +}; + +/** + * Fast paths for creating regular expressions for common glob patterns. + * This can significantly speed up processing and has very little downside + * impact when none of the fast paths match. + */ + +parse.fastpaths = (input, options) => { + const opts = { ...options }; + const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; + const len = input.length; + if (len > max) { + throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`); + } + + input = REPLACEMENTS[input] || input; + const win32 = utils.isWindows(options); + + // create constants based on platform, for windows or posix + const { + DOT_LITERAL, + SLASH_LITERAL, + ONE_CHAR, + DOTS_SLASH, + NO_DOT, + NO_DOTS, + NO_DOTS_SLASH, + STAR, + START_ANCHOR + } = constants.globChars(win32); + + const nodot = opts.dot ? NO_DOTS : NO_DOT; + const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT; + const capture = opts.capture ? '' : '?:'; + const state = { negated: false, prefix: '' }; + let star = opts.bash === true ? '.*?' : STAR; + + if (opts.capture) { + star = `(${star})`; + } + + const globstar = opts => { + if (opts.noglobstar === true) return star; + return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`; + }; + + const create = str => { + switch (str) { + case '*': + return `${nodot}${ONE_CHAR}${star}`; + + case '.*': + return `${DOT_LITERAL}${ONE_CHAR}${star}`; + + case '*.*': + return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`; + + case '*/*': + return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`; + + case '**': + return nodot + globstar(opts); + + case '**/*': + return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`; + + case '**/*.*': + return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`; + + case '**/.*': + return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`; + + default: { + const match = /^(.*?)\.(\w+)$/.exec(str); + if (!match) return; + + const source = create(match[1]); + if (!source) return; + + return source + DOT_LITERAL + match[2]; + } + } + }; + + const output = utils.removePrefix(input, state); + let source = create(output); + + if (source && opts.strictSlashes !== true) { + source += `${SLASH_LITERAL}?`; + } + + return source; +}; + +module.exports = parse; diff --git a/node_modules/picomatch/lib/picomatch.js b/node_modules/picomatch/lib/picomatch.js new file mode 100644 index 0000000..782d809 --- /dev/null +++ b/node_modules/picomatch/lib/picomatch.js @@ -0,0 +1,342 @@ +'use strict'; + +const path = require('path'); +const scan = require('./scan'); +const parse = require('./parse'); +const utils = require('./utils'); +const constants = require('./constants'); +const isObject = val => val && typeof val === 'object' && !Array.isArray(val); + +/** + * Creates a matcher function from one or more glob patterns. The + * returned function takes a string to match as its first argument, + * and returns true if the string is a match. The returned matcher + * function also takes a boolean as the second argument that, when true, + * returns an object with additional information. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch(glob[, options]); + * + * const isMatch = picomatch('*.!(*a)'); + * console.log(isMatch('a.a')); //=> false + * console.log(isMatch('a.b')); //=> true + * ``` + * @name picomatch + * @param {String|Array} `globs` One or more glob patterns. + * @param {Object=} `options` + * @return {Function=} Returns a matcher function. + * @api public + */ + +const picomatch = (glob, options, returnState = false) => { + if (Array.isArray(glob)) { + const fns = glob.map(input => picomatch(input, options, returnState)); + const arrayMatcher = str => { + for (const isMatch of fns) { + const state = isMatch(str); + if (state) return state; + } + return false; + }; + return arrayMatcher; + } + + const isState = isObject(glob) && glob.tokens && glob.input; + + if (glob === '' || (typeof glob !== 'string' && !isState)) { + throw new TypeError('Expected pattern to be a non-empty string'); + } + + const opts = options || {}; + const posix = utils.isWindows(options); + const regex = isState + ? picomatch.compileRe(glob, options) + : picomatch.makeRe(glob, options, false, true); + + const state = regex.state; + delete regex.state; + + let isIgnored = () => false; + if (opts.ignore) { + const ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null }; + isIgnored = picomatch(opts.ignore, ignoreOpts, returnState); + } + + const matcher = (input, returnObject = false) => { + const { isMatch, match, output } = picomatch.test(input, regex, options, { glob, posix }); + const result = { glob, state, regex, posix, input, output, match, isMatch }; + + if (typeof opts.onResult === 'function') { + opts.onResult(result); + } + + if (isMatch === false) { + result.isMatch = false; + return returnObject ? result : false; + } + + if (isIgnored(input)) { + if (typeof opts.onIgnore === 'function') { + opts.onIgnore(result); + } + result.isMatch = false; + return returnObject ? result : false; + } + + if (typeof opts.onMatch === 'function') { + opts.onMatch(result); + } + return returnObject ? result : true; + }; + + if (returnState) { + matcher.state = state; + } + + return matcher; +}; + +/** + * Test `input` with the given `regex`. This is used by the main + * `picomatch()` function to test the input string. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.test(input, regex[, options]); + * + * console.log(picomatch.test('foo/bar', /^(?:([^/]*?)\/([^/]*?))$/)); + * // { isMatch: true, match: [ 'foo/', 'foo', 'bar' ], output: 'foo/bar' } + * ``` + * @param {String} `input` String to test. + * @param {RegExp} `regex` + * @return {Object} Returns an object with matching info. + * @api public + */ + +picomatch.test = (input, regex, options, { glob, posix } = {}) => { + if (typeof input !== 'string') { + throw new TypeError('Expected input to be a string'); + } + + if (input === '') { + return { isMatch: false, output: '' }; + } + + const opts = options || {}; + const format = opts.format || (posix ? utils.toPosixSlashes : null); + let match = input === glob; + let output = (match && format) ? format(input) : input; + + if (match === false) { + output = format ? format(input) : input; + match = output === glob; + } + + if (match === false || opts.capture === true) { + if (opts.matchBase === true || opts.basename === true) { + match = picomatch.matchBase(input, regex, options, posix); + } else { + match = regex.exec(output); + } + } + + return { isMatch: Boolean(match), match, output }; +}; + +/** + * Match the basename of a filepath. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.matchBase(input, glob[, options]); + * console.log(picomatch.matchBase('foo/bar.js', '*.js'); // true + * ``` + * @param {String} `input` String to test. + * @param {RegExp|String} `glob` Glob pattern or regex created by [.makeRe](#makeRe). + * @return {Boolean} + * @api public + */ + +picomatch.matchBase = (input, glob, options, posix = utils.isWindows(options)) => { + const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options); + return regex.test(path.basename(input)); +}; + +/** + * Returns true if **any** of the given glob `patterns` match the specified `string`. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.isMatch(string, patterns[, options]); + * + * console.log(picomatch.isMatch('a.a', ['b.*', '*.a'])); //=> true + * console.log(picomatch.isMatch('a.a', 'b.*')); //=> false + * ``` + * @param {String|Array} str The string to test. + * @param {String|Array} patterns One or more glob patterns to use for matching. + * @param {Object} [options] See available [options](#options). + * @return {Boolean} Returns true if any patterns match `str` + * @api public + */ + +picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str); + +/** + * Parse a glob pattern to create the source string for a regular + * expression. + * + * ```js + * const picomatch = require('picomatch'); + * const result = picomatch.parse(pattern[, options]); + * ``` + * @param {String} `pattern` + * @param {Object} `options` + * @return {Object} Returns an object with useful properties and output to be used as a regex source string. + * @api public + */ + +picomatch.parse = (pattern, options) => { + if (Array.isArray(pattern)) return pattern.map(p => picomatch.parse(p, options)); + return parse(pattern, { ...options, fastpaths: false }); +}; + +/** + * Scan a glob pattern to separate the pattern into segments. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.scan(input[, options]); + * + * const result = picomatch.scan('!./foo/*.js'); + * console.log(result); + * { prefix: '!./', + * input: '!./foo/*.js', + * start: 3, + * base: 'foo', + * glob: '*.js', + * isBrace: false, + * isBracket: false, + * isGlob: true, + * isExtglob: false, + * isGlobstar: false, + * negated: true } + * ``` + * @param {String} `input` Glob pattern to scan. + * @param {Object} `options` + * @return {Object} Returns an object with + * @api public + */ + +picomatch.scan = (input, options) => scan(input, options); + +/** + * Compile a regular expression from the `state` object returned by the + * [parse()](#parse) method. + * + * @param {Object} `state` + * @param {Object} `options` + * @param {Boolean} `returnOutput` Intended for implementors, this argument allows you to return the raw output from the parser. + * @param {Boolean} `returnState` Adds the state to a `state` property on the returned regex. Useful for implementors and debugging. + * @return {RegExp} + * @api public + */ + +picomatch.compileRe = (state, options, returnOutput = false, returnState = false) => { + if (returnOutput === true) { + return state.output; + } + + const opts = options || {}; + const prepend = opts.contains ? '' : '^'; + const append = opts.contains ? '' : '$'; + + let source = `${prepend}(?:${state.output})${append}`; + if (state && state.negated === true) { + source = `^(?!${source}).*$`; + } + + const regex = picomatch.toRegex(source, options); + if (returnState === true) { + regex.state = state; + } + + return regex; +}; + +/** + * Create a regular expression from a parsed glob pattern. + * + * ```js + * const picomatch = require('picomatch'); + * const state = picomatch.parse('*.js'); + * // picomatch.compileRe(state[, options]); + * + * console.log(picomatch.compileRe(state)); + * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/ + * ``` + * @param {String} `state` The object returned from the `.parse` method. + * @param {Object} `options` + * @param {Boolean} `returnOutput` Implementors may use this argument to return the compiled output, instead of a regular expression. This is not exposed on the options to prevent end-users from mutating the result. + * @param {Boolean} `returnState` Implementors may use this argument to return the state from the parsed glob with the returned regular expression. + * @return {RegExp} Returns a regex created from the given pattern. + * @api public + */ + +picomatch.makeRe = (input, options = {}, returnOutput = false, returnState = false) => { + if (!input || typeof input !== 'string') { + throw new TypeError('Expected a non-empty string'); + } + + let parsed = { negated: false, fastpaths: true }; + + if (options.fastpaths !== false && (input[0] === '.' || input[0] === '*')) { + parsed.output = parse.fastpaths(input, options); + } + + if (!parsed.output) { + parsed = parse(input, options); + } + + return picomatch.compileRe(parsed, options, returnOutput, returnState); +}; + +/** + * Create a regular expression from the given regex source string. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.toRegex(source[, options]); + * + * const { output } = picomatch.parse('*.js'); + * console.log(picomatch.toRegex(output)); + * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/ + * ``` + * @param {String} `source` Regular expression source string. + * @param {Object} `options` + * @return {RegExp} + * @api public + */ + +picomatch.toRegex = (source, options) => { + try { + const opts = options || {}; + return new RegExp(source, opts.flags || (opts.nocase ? 'i' : '')); + } catch (err) { + if (options && options.debug === true) throw err; + return /$^/; + } +}; + +/** + * Picomatch constants. + * @return {Object} + */ + +picomatch.constants = constants; + +/** + * Expose "picomatch" + */ + +module.exports = picomatch; diff --git a/node_modules/picomatch/lib/scan.js b/node_modules/picomatch/lib/scan.js new file mode 100644 index 0000000..e59cd7a --- /dev/null +++ b/node_modules/picomatch/lib/scan.js @@ -0,0 +1,391 @@ +'use strict'; + +const utils = require('./utils'); +const { + CHAR_ASTERISK, /* * */ + CHAR_AT, /* @ */ + CHAR_BACKWARD_SLASH, /* \ */ + CHAR_COMMA, /* , */ + CHAR_DOT, /* . */ + CHAR_EXCLAMATION_MARK, /* ! */ + CHAR_FORWARD_SLASH, /* / */ + CHAR_LEFT_CURLY_BRACE, /* { */ + CHAR_LEFT_PARENTHESES, /* ( */ + CHAR_LEFT_SQUARE_BRACKET, /* [ */ + CHAR_PLUS, /* + */ + CHAR_QUESTION_MARK, /* ? */ + CHAR_RIGHT_CURLY_BRACE, /* } */ + CHAR_RIGHT_PARENTHESES, /* ) */ + CHAR_RIGHT_SQUARE_BRACKET /* ] */ +} = require('./constants'); + +const isPathSeparator = code => { + return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH; +}; + +const depth = token => { + if (token.isPrefix !== true) { + token.depth = token.isGlobstar ? Infinity : 1; + } +}; + +/** + * Quickly scans a glob pattern and returns an object with a handful of + * useful properties, like `isGlob`, `path` (the leading non-glob, if it exists), + * `glob` (the actual pattern), `negated` (true if the path starts with `!` but not + * with `!(`) and `negatedExtglob` (true if the path starts with `!(`). + * + * ```js + * const pm = require('picomatch'); + * console.log(pm.scan('foo/bar/*.js')); + * { isGlob: true, input: 'foo/bar/*.js', base: 'foo/bar', glob: '*.js' } + * ``` + * @param {String} `str` + * @param {Object} `options` + * @return {Object} Returns an object with tokens and regex source string. + * @api public + */ + +const scan = (input, options) => { + const opts = options || {}; + + const length = input.length - 1; + const scanToEnd = opts.parts === true || opts.scanToEnd === true; + const slashes = []; + const tokens = []; + const parts = []; + + let str = input; + let index = -1; + let start = 0; + let lastIndex = 0; + let isBrace = false; + let isBracket = false; + let isGlob = false; + let isExtglob = false; + let isGlobstar = false; + let braceEscaped = false; + let backslashes = false; + let negated = false; + let negatedExtglob = false; + let finished = false; + let braces = 0; + let prev; + let code; + let token = { value: '', depth: 0, isGlob: false }; + + const eos = () => index >= length; + const peek = () => str.charCodeAt(index + 1); + const advance = () => { + prev = code; + return str.charCodeAt(++index); + }; + + while (index < length) { + code = advance(); + let next; + + if (code === CHAR_BACKWARD_SLASH) { + backslashes = token.backslashes = true; + code = advance(); + + if (code === CHAR_LEFT_CURLY_BRACE) { + braceEscaped = true; + } + continue; + } + + if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) { + braces++; + + while (eos() !== true && (code = advance())) { + if (code === CHAR_BACKWARD_SLASH) { + backslashes = token.backslashes = true; + advance(); + continue; + } + + if (code === CHAR_LEFT_CURLY_BRACE) { + braces++; + continue; + } + + if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) { + isBrace = token.isBrace = true; + isGlob = token.isGlob = true; + finished = true; + + if (scanToEnd === true) { + continue; + } + + break; + } + + if (braceEscaped !== true && code === CHAR_COMMA) { + isBrace = token.isBrace = true; + isGlob = token.isGlob = true; + finished = true; + + if (scanToEnd === true) { + continue; + } + + break; + } + + if (code === CHAR_RIGHT_CURLY_BRACE) { + braces--; + + if (braces === 0) { + braceEscaped = false; + isBrace = token.isBrace = true; + finished = true; + break; + } + } + } + + if (scanToEnd === true) { + continue; + } + + break; + } + + if (code === CHAR_FORWARD_SLASH) { + slashes.push(index); + tokens.push(token); + token = { value: '', depth: 0, isGlob: false }; + + if (finished === true) continue; + if (prev === CHAR_DOT && index === (start + 1)) { + start += 2; + continue; + } + + lastIndex = index + 1; + continue; + } + + if (opts.noext !== true) { + const isExtglobChar = code === CHAR_PLUS + || code === CHAR_AT + || code === CHAR_ASTERISK + || code === CHAR_QUESTION_MARK + || code === CHAR_EXCLAMATION_MARK; + + if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES) { + isGlob = token.isGlob = true; + isExtglob = token.isExtglob = true; + finished = true; + if (code === CHAR_EXCLAMATION_MARK && index === start) { + negatedExtglob = true; + } + + if (scanToEnd === true) { + while (eos() !== true && (code = advance())) { + if (code === CHAR_BACKWARD_SLASH) { + backslashes = token.backslashes = true; + code = advance(); + continue; + } + + if (code === CHAR_RIGHT_PARENTHESES) { + isGlob = token.isGlob = true; + finished = true; + break; + } + } + continue; + } + break; + } + } + + if (code === CHAR_ASTERISK) { + if (prev === CHAR_ASTERISK) isGlobstar = token.isGlobstar = true; + isGlob = token.isGlob = true; + finished = true; + + if (scanToEnd === true) { + continue; + } + break; + } + + if (code === CHAR_QUESTION_MARK) { + isGlob = token.isGlob = true; + finished = true; + + if (scanToEnd === true) { + continue; + } + break; + } + + if (code === CHAR_LEFT_SQUARE_BRACKET) { + while (eos() !== true && (next = advance())) { + if (next === CHAR_BACKWARD_SLASH) { + backslashes = token.backslashes = true; + advance(); + continue; + } + + if (next === CHAR_RIGHT_SQUARE_BRACKET) { + isBracket = token.isBracket = true; + isGlob = token.isGlob = true; + finished = true; + break; + } + } + + if (scanToEnd === true) { + continue; + } + + break; + } + + if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) { + negated = token.negated = true; + start++; + continue; + } + + if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) { + isGlob = token.isGlob = true; + + if (scanToEnd === true) { + while (eos() !== true && (code = advance())) { + if (code === CHAR_LEFT_PARENTHESES) { + backslashes = token.backslashes = true; + code = advance(); + continue; + } + + if (code === CHAR_RIGHT_PARENTHESES) { + finished = true; + break; + } + } + continue; + } + break; + } + + if (isGlob === true) { + finished = true; + + if (scanToEnd === true) { + continue; + } + + break; + } + } + + if (opts.noext === true) { + isExtglob = false; + isGlob = false; + } + + let base = str; + let prefix = ''; + let glob = ''; + + if (start > 0) { + prefix = str.slice(0, start); + str = str.slice(start); + lastIndex -= start; + } + + if (base && isGlob === true && lastIndex > 0) { + base = str.slice(0, lastIndex); + glob = str.slice(lastIndex); + } else if (isGlob === true) { + base = ''; + glob = str; + } else { + base = str; + } + + if (base && base !== '' && base !== '/' && base !== str) { + if (isPathSeparator(base.charCodeAt(base.length - 1))) { + base = base.slice(0, -1); + } + } + + if (opts.unescape === true) { + if (glob) glob = utils.removeBackslashes(glob); + + if (base && backslashes === true) { + base = utils.removeBackslashes(base); + } + } + + const state = { + prefix, + input, + start, + base, + glob, + isBrace, + isBracket, + isGlob, + isExtglob, + isGlobstar, + negated, + negatedExtglob + }; + + if (opts.tokens === true) { + state.maxDepth = 0; + if (!isPathSeparator(code)) { + tokens.push(token); + } + state.tokens = tokens; + } + + if (opts.parts === true || opts.tokens === true) { + let prevIndex; + + for (let idx = 0; idx < slashes.length; idx++) { + const n = prevIndex ? prevIndex + 1 : start; + const i = slashes[idx]; + const value = input.slice(n, i); + if (opts.tokens) { + if (idx === 0 && start !== 0) { + tokens[idx].isPrefix = true; + tokens[idx].value = prefix; + } else { + tokens[idx].value = value; + } + depth(tokens[idx]); + state.maxDepth += tokens[idx].depth; + } + if (idx !== 0 || value !== '') { + parts.push(value); + } + prevIndex = i; + } + + if (prevIndex && prevIndex + 1 < input.length) { + const value = input.slice(prevIndex + 1); + parts.push(value); + + if (opts.tokens) { + tokens[tokens.length - 1].value = value; + depth(tokens[tokens.length - 1]); + state.maxDepth += tokens[tokens.length - 1].depth; + } + } + + state.slashes = slashes; + state.parts = parts; + } + + return state; +}; + +module.exports = scan; diff --git a/node_modules/picomatch/lib/utils.js b/node_modules/picomatch/lib/utils.js new file mode 100644 index 0000000..c3ca766 --- /dev/null +++ b/node_modules/picomatch/lib/utils.js @@ -0,0 +1,64 @@ +'use strict'; + +const path = require('path'); +const win32 = process.platform === 'win32'; +const { + REGEX_BACKSLASH, + REGEX_REMOVE_BACKSLASH, + REGEX_SPECIAL_CHARS, + REGEX_SPECIAL_CHARS_GLOBAL +} = require('./constants'); + +exports.isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val); +exports.hasRegexChars = str => REGEX_SPECIAL_CHARS.test(str); +exports.isRegexChar = str => str.length === 1 && exports.hasRegexChars(str); +exports.escapeRegex = str => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, '\\$1'); +exports.toPosixSlashes = str => str.replace(REGEX_BACKSLASH, '/'); + +exports.removeBackslashes = str => { + return str.replace(REGEX_REMOVE_BACKSLASH, match => { + return match === '\\' ? '' : match; + }); +}; + +exports.supportsLookbehinds = () => { + const segs = process.version.slice(1).split('.').map(Number); + if (segs.length === 3 && segs[0] >= 9 || (segs[0] === 8 && segs[1] >= 10)) { + return true; + } + return false; +}; + +exports.isWindows = options => { + if (options && typeof options.windows === 'boolean') { + return options.windows; + } + return win32 === true || path.sep === '\\'; +}; + +exports.escapeLast = (input, char, lastIdx) => { + const idx = input.lastIndexOf(char, lastIdx); + if (idx === -1) return input; + if (input[idx - 1] === '\\') return exports.escapeLast(input, char, idx - 1); + return `${input.slice(0, idx)}\\${input.slice(idx)}`; +}; + +exports.removePrefix = (input, state = {}) => { + let output = input; + if (output.startsWith('./')) { + output = output.slice(2); + state.prefix = './'; + } + return output; +}; + +exports.wrapOutput = (input, state = {}, options = {}) => { + const prepend = options.contains ? '' : '^'; + const append = options.contains ? '' : '$'; + + let output = `${prepend}(?:${input})${append}`; + if (state.negated === true) { + output = `(?:^(?!${output}).*$)`; + } + return output; +}; diff --git a/node_modules/picomatch/package.json b/node_modules/picomatch/package.json new file mode 100644 index 0000000..3db22d4 --- /dev/null +++ b/node_modules/picomatch/package.json @@ -0,0 +1,81 @@ +{ + "name": "picomatch", + "description": "Blazing fast and accurate glob matcher written in JavaScript, with no dependencies and full support for standard and extended Bash glob features, including braces, extglobs, POSIX brackets, and regular expressions.", + "version": "2.3.1", + "homepage": "https://github.com/micromatch/picomatch", + "author": "Jon Schlinkert (https://github.com/jonschlinkert)", + "funding": "https://github.com/sponsors/jonschlinkert", + "repository": "micromatch/picomatch", + "bugs": { + "url": "https://github.com/micromatch/picomatch/issues" + }, + "license": "MIT", + "files": [ + "index.js", + "lib" + ], + "main": "index.js", + "engines": { + "node": ">=8.6" + }, + "scripts": { + "lint": "eslint --cache --cache-location node_modules/.cache/.eslintcache --report-unused-disable-directives --ignore-path .gitignore .", + "mocha": "mocha --reporter dot", + "test": "npm run lint && npm run mocha", + "test:ci": "npm run test:cover", + "test:cover": "nyc npm run mocha" + }, + "devDependencies": { + "eslint": "^6.8.0", + "fill-range": "^7.0.1", + "gulp-format-md": "^2.0.0", + "mocha": "^6.2.2", + "nyc": "^15.0.0", + "time-require": "github:jonschlinkert/time-require" + }, + "keywords": [ + "glob", + "match", + "picomatch" + ], + "nyc": { + "reporter": [ + "html", + "lcov", + "text-summary" + ] + }, + "verb": { + "toc": { + "render": true, + "method": "preWrite", + "maxdepth": 3 + }, + "layout": "empty", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "lint": { + "reflinks": true + }, + "related": { + "list": [ + "braces", + "micromatch" + ] + }, + "reflinks": [ + "braces", + "expand-brackets", + "extglob", + "fill-range", + "micromatch", + "minimatch", + "nanomatch", + "picomatch" + ] + } +} diff --git a/node_modules/punycode/LICENSE-MIT.txt b/node_modules/punycode/LICENSE-MIT.txt new file mode 100644 index 0000000..a41e0a7 --- /dev/null +++ b/node_modules/punycode/LICENSE-MIT.txt @@ -0,0 +1,20 @@ +Copyright Mathias Bynens + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/punycode/README.md b/node_modules/punycode/README.md new file mode 100644 index 0000000..72b632c --- /dev/null +++ b/node_modules/punycode/README.md @@ -0,0 +1,126 @@ +# Punycode.js [![punycode on npm](https://img.shields.io/npm/v/punycode)](https://www.npmjs.com/package/emoji-test-regex-pattern) [![](https://data.jsdelivr.com/v1/package/npm/punycode/badge)](https://www.jsdelivr.com/package/npm/punycode) + +Punycode.js is a robust Punycode converter that fully complies to [RFC 3492](https://tools.ietf.org/html/rfc3492) and [RFC 5891](https://tools.ietf.org/html/rfc5891). + +This JavaScript library is the result of comparing, optimizing and documenting different open-source implementations of the Punycode algorithm: + +* [The C example code from RFC 3492](https://tools.ietf.org/html/rfc3492#appendix-C) +* [`punycode.c` by _Markus W. Scherer_ (IBM)](http://opensource.apple.com/source/ICU/ICU-400.42/icuSources/common/punycode.c) +* [`punycode.c` by _Ben Noordhuis_](https://github.com/bnoordhuis/punycode/blob/master/punycode.c) +* [JavaScript implementation by _some_](http://stackoverflow.com/questions/183485/can-anyone-recommend-a-good-free-javascript-for-punycode-to-unicode-conversion/301287#301287) +* [`punycode.js` by _Ben Noordhuis_](https://github.com/joyent/node/blob/426298c8c1c0d5b5224ac3658c41e7c2a3fe9377/lib/punycode.js) (note: [not fully compliant](https://github.com/joyent/node/issues/2072)) + +This project was [bundled](https://github.com/joyent/node/blob/master/lib/punycode.js) with Node.js from [v0.6.2+](https://github.com/joyent/node/compare/975f1930b1...61e796decc) until [v7](https://github.com/nodejs/node/pull/7941) (soft-deprecated). + +This project provides a CommonJS module that uses ES2015+ features and JavaScript module, which work in modern Node.js versions and browsers. For the old Punycode.js version that offers the same functionality in a UMD build with support for older pre-ES2015 runtimes, including Rhino, Ringo, and Narwhal, see [v1.4.1](https://github.com/mathiasbynens/punycode.js/releases/tag/v1.4.1). + +## Installation + +Via [npm](https://www.npmjs.com/): + +```bash +npm install punycode --save +``` + +In [Node.js](https://nodejs.org/): + +> ⚠️ Note that userland modules don't hide core modules. +> For example, `require('punycode')` still imports the deprecated core module even if you executed `npm install punycode`. +> Use `require('punycode/')` to import userland modules rather than core modules. + +```js +const punycode = require('punycode/'); +``` + +## API + +### `punycode.decode(string)` + +Converts a Punycode string of ASCII symbols to a string of Unicode symbols. + +```js +// decode domain name parts +punycode.decode('maana-pta'); // 'mañana' +punycode.decode('--dqo34k'); // '☃-⌘' +``` + +### `punycode.encode(string)` + +Converts a string of Unicode symbols to a Punycode string of ASCII symbols. + +```js +// encode domain name parts +punycode.encode('mañana'); // 'maana-pta' +punycode.encode('☃-⌘'); // '--dqo34k' +``` + +### `punycode.toUnicode(input)` + +Converts a Punycode string representing a domain name or an email address to Unicode. Only the Punycoded parts of the input will be converted, i.e. it doesn’t matter if you call it on a string that has already been converted to Unicode. + +```js +// decode domain names +punycode.toUnicode('xn--maana-pta.com'); +// → 'mañana.com' +punycode.toUnicode('xn----dqo34k.com'); +// → '☃-⌘.com' + +// decode email addresses +punycode.toUnicode('джумла@xn--p-8sbkgc5ag7bhce.xn--ba-lmcq'); +// → 'джумла@джpумлатест.bрфa' +``` + +### `punycode.toASCII(input)` + +Converts a lowercased Unicode string representing a domain name or an email address to Punycode. Only the non-ASCII parts of the input will be converted, i.e. it doesn’t matter if you call it with a domain that’s already in ASCII. + +```js +// encode domain names +punycode.toASCII('mañana.com'); +// → 'xn--maana-pta.com' +punycode.toASCII('☃-⌘.com'); +// → 'xn----dqo34k.com' + +// encode email addresses +punycode.toASCII('джумла@джpумлатест.bрфa'); +// → 'джумла@xn--p-8sbkgc5ag7bhce.xn--ba-lmcq' +``` + +### `punycode.ucs2` + +#### `punycode.ucs2.decode(string)` + +Creates an array containing the numeric code point values of each Unicode symbol in the string. While [JavaScript uses UCS-2 internally](https://mathiasbynens.be/notes/javascript-encoding), this function will convert a pair of surrogate halves (each of which UCS-2 exposes as separate characters) into a single code point, matching UTF-16. + +```js +punycode.ucs2.decode('abc'); +// → [0x61, 0x62, 0x63] +// surrogate pair for U+1D306 TETRAGRAM FOR CENTRE: +punycode.ucs2.decode('\uD834\uDF06'); +// → [0x1D306] +``` + +#### `punycode.ucs2.encode(codePoints)` + +Creates a string based on an array of numeric code point values. + +```js +punycode.ucs2.encode([0x61, 0x62, 0x63]); +// → 'abc' +punycode.ucs2.encode([0x1D306]); +// → '\uD834\uDF06' +``` + +### `punycode.version` + +A string representing the current Punycode.js version number. + +## Author + +| [![twitter/mathias](https://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") | +|---| +| [Mathias Bynens](https://mathiasbynens.be/) | + +## License + +Punycode.js is available under the [MIT](https://mths.be/mit) license. diff --git a/node_modules/punycode/package.json b/node_modules/punycode/package.json new file mode 100644 index 0000000..9d0790b --- /dev/null +++ b/node_modules/punycode/package.json @@ -0,0 +1,58 @@ +{ + "name": "punycode", + "version": "2.3.0", + "description": "A robust Punycode converter that fully complies to RFC 3492 and RFC 5891, and works on nearly all JavaScript platforms.", + "homepage": "https://mths.be/punycode", + "main": "punycode.js", + "jsnext:main": "punycode.es6.js", + "module": "punycode.es6.js", + "engines": { + "node": ">=6" + }, + "keywords": [ + "punycode", + "unicode", + "idn", + "idna", + "dns", + "url", + "domain" + ], + "license": "MIT", + "author": { + "name": "Mathias Bynens", + "url": "https://mathiasbynens.be/" + }, + "contributors": [ + { + "name": "Mathias Bynens", + "url": "https://mathiasbynens.be/" + } + ], + "repository": { + "type": "git", + "url": "https://github.com/mathiasbynens/punycode.js.git" + }, + "bugs": "https://github.com/mathiasbynens/punycode.js/issues", + "files": [ + "LICENSE-MIT.txt", + "punycode.js", + "punycode.es6.js" + ], + "scripts": { + "test": "mocha tests", + "build": "node scripts/prepublish.js" + }, + "devDependencies": { + "codecov": "^1.0.1", + "istanbul": "^0.4.1", + "mocha": "^10.2.0" + }, + "jspm": { + "map": { + "./punycode.js": { + "node": "@node/punycode" + } + } + } +} diff --git a/node_modules/punycode/punycode.es6.js b/node_modules/punycode/punycode.es6.js new file mode 100644 index 0000000..244e1bf --- /dev/null +++ b/node_modules/punycode/punycode.es6.js @@ -0,0 +1,444 @@ +'use strict'; + +/** Highest positive signed 32-bit float value */ +const maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1 + +/** Bootstring parameters */ +const base = 36; +const tMin = 1; +const tMax = 26; +const skew = 38; +const damp = 700; +const initialBias = 72; +const initialN = 128; // 0x80 +const delimiter = '-'; // '\x2D' + +/** Regular expressions */ +const regexPunycode = /^xn--/; +const regexNonASCII = /[^\0-\x7F]/; // Note: U+007F DEL is excluded too. +const regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g; // RFC 3490 separators + +/** Error messages */ +const errors = { + 'overflow': 'Overflow: input needs wider integers to process', + 'not-basic': 'Illegal input >= 0x80 (not a basic code point)', + 'invalid-input': 'Invalid input' +}; + +/** Convenience shortcuts */ +const baseMinusTMin = base - tMin; +const floor = Math.floor; +const stringFromCharCode = String.fromCharCode; + +/*--------------------------------------------------------------------------*/ + +/** + * A generic error utility function. + * @private + * @param {String} type The error type. + * @returns {Error} Throws a `RangeError` with the applicable error message. + */ +function error(type) { + throw new RangeError(errors[type]); +} + +/** + * A generic `Array#map` utility function. + * @private + * @param {Array} array The array to iterate over. + * @param {Function} callback The function that gets called for every array + * item. + * @returns {Array} A new array of values returned by the callback function. + */ +function map(array, callback) { + const result = []; + let length = array.length; + while (length--) { + result[length] = callback(array[length]); + } + return result; +} + +/** + * A simple `Array#map`-like wrapper to work with domain name strings or email + * addresses. + * @private + * @param {String} domain The domain name or email address. + * @param {Function} callback The function that gets called for every + * character. + * @returns {String} A new string of characters returned by the callback + * function. + */ +function mapDomain(domain, callback) { + const parts = domain.split('@'); + let result = ''; + if (parts.length > 1) { + // In email addresses, only the domain name should be punycoded. Leave + // the local part (i.e. everything up to `@`) intact. + result = parts[0] + '@'; + domain = parts[1]; + } + // Avoid `split(regex)` for IE8 compatibility. See #17. + domain = domain.replace(regexSeparators, '\x2E'); + const labels = domain.split('.'); + const encoded = map(labels, callback).join('.'); + return result + encoded; +} + +/** + * Creates an array containing the numeric code points of each Unicode + * character in the string. While JavaScript uses UCS-2 internally, + * this function will convert a pair of surrogate halves (each of which + * UCS-2 exposes as separate characters) into a single code point, + * matching UTF-16. + * @see `punycode.ucs2.encode` + * @see + * @memberOf punycode.ucs2 + * @name decode + * @param {String} string The Unicode input string (UCS-2). + * @returns {Array} The new array of code points. + */ +function ucs2decode(string) { + const output = []; + let counter = 0; + const length = string.length; + while (counter < length) { + const value = string.charCodeAt(counter++); + if (value >= 0xD800 && value <= 0xDBFF && counter < length) { + // It's a high surrogate, and there is a next character. + const extra = string.charCodeAt(counter++); + if ((extra & 0xFC00) == 0xDC00) { // Low surrogate. + output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000); + } else { + // It's an unmatched surrogate; only append this code unit, in case the + // next code unit is the high surrogate of a surrogate pair. + output.push(value); + counter--; + } + } else { + output.push(value); + } + } + return output; +} + +/** + * Creates a string based on an array of numeric code points. + * @see `punycode.ucs2.decode` + * @memberOf punycode.ucs2 + * @name encode + * @param {Array} codePoints The array of numeric code points. + * @returns {String} The new Unicode string (UCS-2). + */ +const ucs2encode = codePoints => String.fromCodePoint(...codePoints); + +/** + * Converts a basic code point into a digit/integer. + * @see `digitToBasic()` + * @private + * @param {Number} codePoint The basic numeric code point value. + * @returns {Number} The numeric value of a basic code point (for use in + * representing integers) in the range `0` to `base - 1`, or `base` if + * the code point does not represent a value. + */ +const basicToDigit = function(codePoint) { + if (codePoint >= 0x30 && codePoint < 0x3A) { + return 26 + (codePoint - 0x30); + } + if (codePoint >= 0x41 && codePoint < 0x5B) { + return codePoint - 0x41; + } + if (codePoint >= 0x61 && codePoint < 0x7B) { + return codePoint - 0x61; + } + return base; +}; + +/** + * Converts a digit/integer into a basic code point. + * @see `basicToDigit()` + * @private + * @param {Number} digit The numeric value of a basic code point. + * @returns {Number} The basic code point whose value (when used for + * representing integers) is `digit`, which needs to be in the range + * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is + * used; else, the lowercase form is used. The behavior is undefined + * if `flag` is non-zero and `digit` has no uppercase form. + */ +const digitToBasic = function(digit, flag) { + // 0..25 map to ASCII a..z or A..Z + // 26..35 map to ASCII 0..9 + return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5); +}; + +/** + * Bias adaptation function as per section 3.4 of RFC 3492. + * https://tools.ietf.org/html/rfc3492#section-3.4 + * @private + */ +const adapt = function(delta, numPoints, firstTime) { + let k = 0; + delta = firstTime ? floor(delta / damp) : delta >> 1; + delta += floor(delta / numPoints); + for (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) { + delta = floor(delta / baseMinusTMin); + } + return floor(k + (baseMinusTMin + 1) * delta / (delta + skew)); +}; + +/** + * Converts a Punycode string of ASCII-only symbols to a string of Unicode + * symbols. + * @memberOf punycode + * @param {String} input The Punycode string of ASCII-only symbols. + * @returns {String} The resulting string of Unicode symbols. + */ +const decode = function(input) { + // Don't use UCS-2. + const output = []; + const inputLength = input.length; + let i = 0; + let n = initialN; + let bias = initialBias; + + // Handle the basic code points: let `basic` be the number of input code + // points before the last delimiter, or `0` if there is none, then copy + // the first basic code points to the output. + + let basic = input.lastIndexOf(delimiter); + if (basic < 0) { + basic = 0; + } + + for (let j = 0; j < basic; ++j) { + // if it's not a basic code point + if (input.charCodeAt(j) >= 0x80) { + error('not-basic'); + } + output.push(input.charCodeAt(j)); + } + + // Main decoding loop: start just after the last delimiter if any basic code + // points were copied; start at the beginning otherwise. + + for (let index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) { + + // `index` is the index of the next character to be consumed. + // Decode a generalized variable-length integer into `delta`, + // which gets added to `i`. The overflow checking is easier + // if we increase `i` as we go, then subtract off its starting + // value at the end to obtain `delta`. + const oldi = i; + for (let w = 1, k = base; /* no condition */; k += base) { + + if (index >= inputLength) { + error('invalid-input'); + } + + const digit = basicToDigit(input.charCodeAt(index++)); + + if (digit >= base) { + error('invalid-input'); + } + if (digit > floor((maxInt - i) / w)) { + error('overflow'); + } + + i += digit * w; + const t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); + + if (digit < t) { + break; + } + + const baseMinusT = base - t; + if (w > floor(maxInt / baseMinusT)) { + error('overflow'); + } + + w *= baseMinusT; + + } + + const out = output.length + 1; + bias = adapt(i - oldi, out, oldi == 0); + + // `i` was supposed to wrap around from `out` to `0`, + // incrementing `n` each time, so we'll fix that now: + if (floor(i / out) > maxInt - n) { + error('overflow'); + } + + n += floor(i / out); + i %= out; + + // Insert `n` at position `i` of the output. + output.splice(i++, 0, n); + + } + + return String.fromCodePoint(...output); +}; + +/** + * Converts a string of Unicode symbols (e.g. a domain name label) to a + * Punycode string of ASCII-only symbols. + * @memberOf punycode + * @param {String} input The string of Unicode symbols. + * @returns {String} The resulting Punycode string of ASCII-only symbols. + */ +const encode = function(input) { + const output = []; + + // Convert the input in UCS-2 to an array of Unicode code points. + input = ucs2decode(input); + + // Cache the length. + const inputLength = input.length; + + // Initialize the state. + let n = initialN; + let delta = 0; + let bias = initialBias; + + // Handle the basic code points. + for (const currentValue of input) { + if (currentValue < 0x80) { + output.push(stringFromCharCode(currentValue)); + } + } + + const basicLength = output.length; + let handledCPCount = basicLength; + + // `handledCPCount` is the number of code points that have been handled; + // `basicLength` is the number of basic code points. + + // Finish the basic string with a delimiter unless it's empty. + if (basicLength) { + output.push(delimiter); + } + + // Main encoding loop: + while (handledCPCount < inputLength) { + + // All non-basic code points < n have been handled already. Find the next + // larger one: + let m = maxInt; + for (const currentValue of input) { + if (currentValue >= n && currentValue < m) { + m = currentValue; + } + } + + // Increase `delta` enough to advance the decoder's state to , + // but guard against overflow. + const handledCPCountPlusOne = handledCPCount + 1; + if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) { + error('overflow'); + } + + delta += (m - n) * handledCPCountPlusOne; + n = m; + + for (const currentValue of input) { + if (currentValue < n && ++delta > maxInt) { + error('overflow'); + } + if (currentValue === n) { + // Represent delta as a generalized variable-length integer. + let q = delta; + for (let k = base; /* no condition */; k += base) { + const t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); + if (q < t) { + break; + } + const qMinusT = q - t; + const baseMinusT = base - t; + output.push( + stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0)) + ); + q = floor(qMinusT / baseMinusT); + } + + output.push(stringFromCharCode(digitToBasic(q, 0))); + bias = adapt(delta, handledCPCountPlusOne, handledCPCount === basicLength); + delta = 0; + ++handledCPCount; + } + } + + ++delta; + ++n; + + } + return output.join(''); +}; + +/** + * Converts a Punycode string representing a domain name or an email address + * to Unicode. Only the Punycoded parts of the input will be converted, i.e. + * it doesn't matter if you call it on a string that has already been + * converted to Unicode. + * @memberOf punycode + * @param {String} input The Punycoded domain name or email address to + * convert to Unicode. + * @returns {String} The Unicode representation of the given Punycode + * string. + */ +const toUnicode = function(input) { + return mapDomain(input, function(string) { + return regexPunycode.test(string) + ? decode(string.slice(4).toLowerCase()) + : string; + }); +}; + +/** + * Converts a Unicode string representing a domain name or an email address to + * Punycode. Only the non-ASCII parts of the domain name will be converted, + * i.e. it doesn't matter if you call it with a domain that's already in + * ASCII. + * @memberOf punycode + * @param {String} input The domain name or email address to convert, as a + * Unicode string. + * @returns {String} The Punycode representation of the given domain name or + * email address. + */ +const toASCII = function(input) { + return mapDomain(input, function(string) { + return regexNonASCII.test(string) + ? 'xn--' + encode(string) + : string; + }); +}; + +/*--------------------------------------------------------------------------*/ + +/** Define the public API */ +const punycode = { + /** + * A string representing the current Punycode.js version number. + * @memberOf punycode + * @type String + */ + 'version': '2.1.0', + /** + * An object of methods to convert from JavaScript's internal character + * representation (UCS-2) to Unicode code points, and back. + * @see + * @memberOf punycode + * @type Object + */ + 'ucs2': { + 'decode': ucs2decode, + 'encode': ucs2encode + }, + 'decode': decode, + 'encode': encode, + 'toASCII': toASCII, + 'toUnicode': toUnicode +}; + +export { ucs2decode, ucs2encode, decode, encode, toASCII, toUnicode }; +export default punycode; diff --git a/node_modules/punycode/punycode.js b/node_modules/punycode/punycode.js new file mode 100644 index 0000000..752b98a --- /dev/null +++ b/node_modules/punycode/punycode.js @@ -0,0 +1,443 @@ +'use strict'; + +/** Highest positive signed 32-bit float value */ +const maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1 + +/** Bootstring parameters */ +const base = 36; +const tMin = 1; +const tMax = 26; +const skew = 38; +const damp = 700; +const initialBias = 72; +const initialN = 128; // 0x80 +const delimiter = '-'; // '\x2D' + +/** Regular expressions */ +const regexPunycode = /^xn--/; +const regexNonASCII = /[^\0-\x7F]/; // Note: U+007F DEL is excluded too. +const regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g; // RFC 3490 separators + +/** Error messages */ +const errors = { + 'overflow': 'Overflow: input needs wider integers to process', + 'not-basic': 'Illegal input >= 0x80 (not a basic code point)', + 'invalid-input': 'Invalid input' +}; + +/** Convenience shortcuts */ +const baseMinusTMin = base - tMin; +const floor = Math.floor; +const stringFromCharCode = String.fromCharCode; + +/*--------------------------------------------------------------------------*/ + +/** + * A generic error utility function. + * @private + * @param {String} type The error type. + * @returns {Error} Throws a `RangeError` with the applicable error message. + */ +function error(type) { + throw new RangeError(errors[type]); +} + +/** + * A generic `Array#map` utility function. + * @private + * @param {Array} array The array to iterate over. + * @param {Function} callback The function that gets called for every array + * item. + * @returns {Array} A new array of values returned by the callback function. + */ +function map(array, callback) { + const result = []; + let length = array.length; + while (length--) { + result[length] = callback(array[length]); + } + return result; +} + +/** + * A simple `Array#map`-like wrapper to work with domain name strings or email + * addresses. + * @private + * @param {String} domain The domain name or email address. + * @param {Function} callback The function that gets called for every + * character. + * @returns {String} A new string of characters returned by the callback + * function. + */ +function mapDomain(domain, callback) { + const parts = domain.split('@'); + let result = ''; + if (parts.length > 1) { + // In email addresses, only the domain name should be punycoded. Leave + // the local part (i.e. everything up to `@`) intact. + result = parts[0] + '@'; + domain = parts[1]; + } + // Avoid `split(regex)` for IE8 compatibility. See #17. + domain = domain.replace(regexSeparators, '\x2E'); + const labels = domain.split('.'); + const encoded = map(labels, callback).join('.'); + return result + encoded; +} + +/** + * Creates an array containing the numeric code points of each Unicode + * character in the string. While JavaScript uses UCS-2 internally, + * this function will convert a pair of surrogate halves (each of which + * UCS-2 exposes as separate characters) into a single code point, + * matching UTF-16. + * @see `punycode.ucs2.encode` + * @see + * @memberOf punycode.ucs2 + * @name decode + * @param {String} string The Unicode input string (UCS-2). + * @returns {Array} The new array of code points. + */ +function ucs2decode(string) { + const output = []; + let counter = 0; + const length = string.length; + while (counter < length) { + const value = string.charCodeAt(counter++); + if (value >= 0xD800 && value <= 0xDBFF && counter < length) { + // It's a high surrogate, and there is a next character. + const extra = string.charCodeAt(counter++); + if ((extra & 0xFC00) == 0xDC00) { // Low surrogate. + output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000); + } else { + // It's an unmatched surrogate; only append this code unit, in case the + // next code unit is the high surrogate of a surrogate pair. + output.push(value); + counter--; + } + } else { + output.push(value); + } + } + return output; +} + +/** + * Creates a string based on an array of numeric code points. + * @see `punycode.ucs2.decode` + * @memberOf punycode.ucs2 + * @name encode + * @param {Array} codePoints The array of numeric code points. + * @returns {String} The new Unicode string (UCS-2). + */ +const ucs2encode = codePoints => String.fromCodePoint(...codePoints); + +/** + * Converts a basic code point into a digit/integer. + * @see `digitToBasic()` + * @private + * @param {Number} codePoint The basic numeric code point value. + * @returns {Number} The numeric value of a basic code point (for use in + * representing integers) in the range `0` to `base - 1`, or `base` if + * the code point does not represent a value. + */ +const basicToDigit = function(codePoint) { + if (codePoint >= 0x30 && codePoint < 0x3A) { + return 26 + (codePoint - 0x30); + } + if (codePoint >= 0x41 && codePoint < 0x5B) { + return codePoint - 0x41; + } + if (codePoint >= 0x61 && codePoint < 0x7B) { + return codePoint - 0x61; + } + return base; +}; + +/** + * Converts a digit/integer into a basic code point. + * @see `basicToDigit()` + * @private + * @param {Number} digit The numeric value of a basic code point. + * @returns {Number} The basic code point whose value (when used for + * representing integers) is `digit`, which needs to be in the range + * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is + * used; else, the lowercase form is used. The behavior is undefined + * if `flag` is non-zero and `digit` has no uppercase form. + */ +const digitToBasic = function(digit, flag) { + // 0..25 map to ASCII a..z or A..Z + // 26..35 map to ASCII 0..9 + return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5); +}; + +/** + * Bias adaptation function as per section 3.4 of RFC 3492. + * https://tools.ietf.org/html/rfc3492#section-3.4 + * @private + */ +const adapt = function(delta, numPoints, firstTime) { + let k = 0; + delta = firstTime ? floor(delta / damp) : delta >> 1; + delta += floor(delta / numPoints); + for (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) { + delta = floor(delta / baseMinusTMin); + } + return floor(k + (baseMinusTMin + 1) * delta / (delta + skew)); +}; + +/** + * Converts a Punycode string of ASCII-only symbols to a string of Unicode + * symbols. + * @memberOf punycode + * @param {String} input The Punycode string of ASCII-only symbols. + * @returns {String} The resulting string of Unicode symbols. + */ +const decode = function(input) { + // Don't use UCS-2. + const output = []; + const inputLength = input.length; + let i = 0; + let n = initialN; + let bias = initialBias; + + // Handle the basic code points: let `basic` be the number of input code + // points before the last delimiter, or `0` if there is none, then copy + // the first basic code points to the output. + + let basic = input.lastIndexOf(delimiter); + if (basic < 0) { + basic = 0; + } + + for (let j = 0; j < basic; ++j) { + // if it's not a basic code point + if (input.charCodeAt(j) >= 0x80) { + error('not-basic'); + } + output.push(input.charCodeAt(j)); + } + + // Main decoding loop: start just after the last delimiter if any basic code + // points were copied; start at the beginning otherwise. + + for (let index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) { + + // `index` is the index of the next character to be consumed. + // Decode a generalized variable-length integer into `delta`, + // which gets added to `i`. The overflow checking is easier + // if we increase `i` as we go, then subtract off its starting + // value at the end to obtain `delta`. + const oldi = i; + for (let w = 1, k = base; /* no condition */; k += base) { + + if (index >= inputLength) { + error('invalid-input'); + } + + const digit = basicToDigit(input.charCodeAt(index++)); + + if (digit >= base) { + error('invalid-input'); + } + if (digit > floor((maxInt - i) / w)) { + error('overflow'); + } + + i += digit * w; + const t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); + + if (digit < t) { + break; + } + + const baseMinusT = base - t; + if (w > floor(maxInt / baseMinusT)) { + error('overflow'); + } + + w *= baseMinusT; + + } + + const out = output.length + 1; + bias = adapt(i - oldi, out, oldi == 0); + + // `i` was supposed to wrap around from `out` to `0`, + // incrementing `n` each time, so we'll fix that now: + if (floor(i / out) > maxInt - n) { + error('overflow'); + } + + n += floor(i / out); + i %= out; + + // Insert `n` at position `i` of the output. + output.splice(i++, 0, n); + + } + + return String.fromCodePoint(...output); +}; + +/** + * Converts a string of Unicode symbols (e.g. a domain name label) to a + * Punycode string of ASCII-only symbols. + * @memberOf punycode + * @param {String} input The string of Unicode symbols. + * @returns {String} The resulting Punycode string of ASCII-only symbols. + */ +const encode = function(input) { + const output = []; + + // Convert the input in UCS-2 to an array of Unicode code points. + input = ucs2decode(input); + + // Cache the length. + const inputLength = input.length; + + // Initialize the state. + let n = initialN; + let delta = 0; + let bias = initialBias; + + // Handle the basic code points. + for (const currentValue of input) { + if (currentValue < 0x80) { + output.push(stringFromCharCode(currentValue)); + } + } + + const basicLength = output.length; + let handledCPCount = basicLength; + + // `handledCPCount` is the number of code points that have been handled; + // `basicLength` is the number of basic code points. + + // Finish the basic string with a delimiter unless it's empty. + if (basicLength) { + output.push(delimiter); + } + + // Main encoding loop: + while (handledCPCount < inputLength) { + + // All non-basic code points < n have been handled already. Find the next + // larger one: + let m = maxInt; + for (const currentValue of input) { + if (currentValue >= n && currentValue < m) { + m = currentValue; + } + } + + // Increase `delta` enough to advance the decoder's state to , + // but guard against overflow. + const handledCPCountPlusOne = handledCPCount + 1; + if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) { + error('overflow'); + } + + delta += (m - n) * handledCPCountPlusOne; + n = m; + + for (const currentValue of input) { + if (currentValue < n && ++delta > maxInt) { + error('overflow'); + } + if (currentValue === n) { + // Represent delta as a generalized variable-length integer. + let q = delta; + for (let k = base; /* no condition */; k += base) { + const t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); + if (q < t) { + break; + } + const qMinusT = q - t; + const baseMinusT = base - t; + output.push( + stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0)) + ); + q = floor(qMinusT / baseMinusT); + } + + output.push(stringFromCharCode(digitToBasic(q, 0))); + bias = adapt(delta, handledCPCountPlusOne, handledCPCount === basicLength); + delta = 0; + ++handledCPCount; + } + } + + ++delta; + ++n; + + } + return output.join(''); +}; + +/** + * Converts a Punycode string representing a domain name or an email address + * to Unicode. Only the Punycoded parts of the input will be converted, i.e. + * it doesn't matter if you call it on a string that has already been + * converted to Unicode. + * @memberOf punycode + * @param {String} input The Punycoded domain name or email address to + * convert to Unicode. + * @returns {String} The Unicode representation of the given Punycode + * string. + */ +const toUnicode = function(input) { + return mapDomain(input, function(string) { + return regexPunycode.test(string) + ? decode(string.slice(4).toLowerCase()) + : string; + }); +}; + +/** + * Converts a Unicode string representing a domain name or an email address to + * Punycode. Only the non-ASCII parts of the domain name will be converted, + * i.e. it doesn't matter if you call it with a domain that's already in + * ASCII. + * @memberOf punycode + * @param {String} input The domain name or email address to convert, as a + * Unicode string. + * @returns {String} The Punycode representation of the given domain name or + * email address. + */ +const toASCII = function(input) { + return mapDomain(input, function(string) { + return regexNonASCII.test(string) + ? 'xn--' + encode(string) + : string; + }); +}; + +/*--------------------------------------------------------------------------*/ + +/** Define the public API */ +const punycode = { + /** + * A string representing the current Punycode.js version number. + * @memberOf punycode + * @type String + */ + 'version': '2.1.0', + /** + * An object of methods to convert from JavaScript's internal character + * representation (UCS-2) to Unicode code points, and back. + * @see + * @memberOf punycode + * @type Object + */ + 'ucs2': { + 'decode': ucs2decode, + 'encode': ucs2encode + }, + 'decode': decode, + 'encode': encode, + 'toASCII': toASCII, + 'toUnicode': toUnicode +}; + +module.exports = punycode; diff --git a/node_modules/randombytes/.travis.yml b/node_modules/randombytes/.travis.yml new file mode 100644 index 0000000..69fdf71 --- /dev/null +++ b/node_modules/randombytes/.travis.yml @@ -0,0 +1,15 @@ +sudo: false +language: node_js +matrix: + include: + - node_js: '7' + env: TEST_SUITE=test + - node_js: '6' + env: TEST_SUITE=test + - node_js: '5' + env: TEST_SUITE=test + - node_js: '4' + env: TEST_SUITE=test + - node_js: '4' + env: TEST_SUITE=phantom +script: "npm run-script $TEST_SUITE" diff --git a/node_modules/randombytes/.zuul.yml b/node_modules/randombytes/.zuul.yml new file mode 100644 index 0000000..96d9cfb --- /dev/null +++ b/node_modules/randombytes/.zuul.yml @@ -0,0 +1 @@ +ui: tape diff --git a/node_modules/randombytes/LICENSE b/node_modules/randombytes/LICENSE new file mode 100644 index 0000000..fea9d48 --- /dev/null +++ b/node_modules/randombytes/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017 crypto-browserify + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/randombytes/README.md b/node_modules/randombytes/README.md new file mode 100644 index 0000000..3bacba4 --- /dev/null +++ b/node_modules/randombytes/README.md @@ -0,0 +1,14 @@ +randombytes +=== + +[![Version](http://img.shields.io/npm/v/randombytes.svg)](https://www.npmjs.org/package/randombytes) [![Build Status](https://travis-ci.org/crypto-browserify/randombytes.svg?branch=master)](https://travis-ci.org/crypto-browserify/randombytes) + +randombytes from node that works in the browser. In node you just get crypto.randomBytes, but in the browser it uses .crypto/msCrypto.getRandomValues + +```js +var randomBytes = require('randombytes'); +randomBytes(16);//get 16 random bytes +randomBytes(16, function (err, resp) { + // resp is 16 random bytes +}); +``` diff --git a/node_modules/randombytes/browser.js b/node_modules/randombytes/browser.js new file mode 100644 index 0000000..0fb0b71 --- /dev/null +++ b/node_modules/randombytes/browser.js @@ -0,0 +1,50 @@ +'use strict' + +// limit of Crypto.getRandomValues() +// https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues +var MAX_BYTES = 65536 + +// Node supports requesting up to this number of bytes +// https://github.com/nodejs/node/blob/master/lib/internal/crypto/random.js#L48 +var MAX_UINT32 = 4294967295 + +function oldBrowser () { + throw new Error('Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11') +} + +var Buffer = require('safe-buffer').Buffer +var crypto = global.crypto || global.msCrypto + +if (crypto && crypto.getRandomValues) { + module.exports = randomBytes +} else { + module.exports = oldBrowser +} + +function randomBytes (size, cb) { + // phantomjs needs to throw + if (size > MAX_UINT32) throw new RangeError('requested too many random bytes') + + var bytes = Buffer.allocUnsafe(size) + + if (size > 0) { // getRandomValues fails on IE if size == 0 + if (size > MAX_BYTES) { // this is the max bytes crypto.getRandomValues + // can do at once see https://developer.mozilla.org/en-US/docs/Web/API/window.crypto.getRandomValues + for (var generated = 0; generated < size; generated += MAX_BYTES) { + // buffer.slice automatically checks if the end is past the end of + // the buffer so we don't have to here + crypto.getRandomValues(bytes.slice(generated, generated + MAX_BYTES)) + } + } else { + crypto.getRandomValues(bytes) + } + } + + if (typeof cb === 'function') { + return process.nextTick(function () { + cb(null, bytes) + }) + } + + return bytes +} diff --git a/node_modules/randombytes/index.js b/node_modules/randombytes/index.js new file mode 100644 index 0000000..a2d9e39 --- /dev/null +++ b/node_modules/randombytes/index.js @@ -0,0 +1 @@ +module.exports = require('crypto').randomBytes diff --git a/node_modules/randombytes/package.json b/node_modules/randombytes/package.json new file mode 100644 index 0000000..3623652 --- /dev/null +++ b/node_modules/randombytes/package.json @@ -0,0 +1,36 @@ +{ + "name": "randombytes", + "version": "2.1.0", + "description": "random bytes from browserify stand alone", + "main": "index.js", + "scripts": { + "test": "standard && node test.js | tspec", + "phantom": "zuul --phantom -- test.js", + "local": "zuul --local --no-coverage -- test.js" + }, + "repository": { + "type": "git", + "url": "git@github.com:crypto-browserify/randombytes.git" + }, + "keywords": [ + "crypto", + "random" + ], + "author": "", + "license": "MIT", + "bugs": { + "url": "https://github.com/crypto-browserify/randombytes/issues" + }, + "homepage": "https://github.com/crypto-browserify/randombytes", + "browser": "browser.js", + "devDependencies": { + "phantomjs": "^1.9.9", + "standard": "^10.0.2", + "tap-spec": "^2.1.2", + "tape": "^4.6.3", + "zuul": "^3.7.2" + }, + "dependencies": { + "safe-buffer": "^5.1.0" + } +} diff --git a/node_modules/randombytes/test.js b/node_modules/randombytes/test.js new file mode 100644 index 0000000..f266976 --- /dev/null +++ b/node_modules/randombytes/test.js @@ -0,0 +1,81 @@ +var test = require('tape') +var randomBytes = require('./') +var MAX_BYTES = 65536 +var MAX_UINT32 = 4294967295 + +test('sync', function (t) { + t.plan(9) + t.equals(randomBytes(0).length, 0, 'len: ' + 0) + t.equals(randomBytes(3).length, 3, 'len: ' + 3) + t.equals(randomBytes(30).length, 30, 'len: ' + 30) + t.equals(randomBytes(300).length, 300, 'len: ' + 300) + t.equals(randomBytes(17 + MAX_BYTES).length, 17 + MAX_BYTES, 'len: ' + 17 + MAX_BYTES) + t.equals(randomBytes(MAX_BYTES * 100).length, MAX_BYTES * 100, 'len: ' + MAX_BYTES * 100) + t.throws(function () { + randomBytes(MAX_UINT32 + 1) + }) + t.throws(function () { + t.equals(randomBytes(-1)) + }) + t.throws(function () { + t.equals(randomBytes('hello')) + }) +}) + +test('async', function (t) { + t.plan(9) + + randomBytes(0, function (err, resp) { + if (err) throw err + + t.equals(resp.length, 0, 'len: ' + 0) + }) + + randomBytes(3, function (err, resp) { + if (err) throw err + + t.equals(resp.length, 3, 'len: ' + 3) + }) + + randomBytes(30, function (err, resp) { + if (err) throw err + + t.equals(resp.length, 30, 'len: ' + 30) + }) + + randomBytes(300, function (err, resp) { + if (err) throw err + + t.equals(resp.length, 300, 'len: ' + 300) + }) + + randomBytes(17 + MAX_BYTES, function (err, resp) { + if (err) throw err + + t.equals(resp.length, 17 + MAX_BYTES, 'len: ' + 17 + MAX_BYTES) + }) + + randomBytes(MAX_BYTES * 100, function (err, resp) { + if (err) throw err + + t.equals(resp.length, MAX_BYTES * 100, 'len: ' + MAX_BYTES * 100) + }) + + t.throws(function () { + randomBytes(MAX_UINT32 + 1, function () { + t.ok(false, 'should not get here') + }) + }) + + t.throws(function () { + randomBytes(-1, function () { + t.ok(false, 'should not get here') + }) + }) + + t.throws(function () { + randomBytes('hello', function () { + t.ok(false, 'should not get here') + }) + }) +}) diff --git a/node_modules/readdirp/LICENSE b/node_modules/readdirp/LICENSE new file mode 100644 index 0000000..037cbb4 --- /dev/null +++ b/node_modules/readdirp/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2012-2019 Thorsten Lorenz, Paul Miller (https://paulmillr.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS 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/node_modules/readdirp/README.md b/node_modules/readdirp/README.md new file mode 100644 index 0000000..465593c --- /dev/null +++ b/node_modules/readdirp/README.md @@ -0,0 +1,122 @@ +# readdirp [![Weekly downloads](https://img.shields.io/npm/dw/readdirp.svg)](https://github.com/paulmillr/readdirp) + +Recursive version of [fs.readdir](https://nodejs.org/api/fs.html#fs_fs_readdir_path_options_callback). Exposes a **stream API** and a **promise API**. + + +```sh +npm install readdirp +``` + +```javascript +const readdirp = require('readdirp'); + +// Use streams to achieve small RAM & CPU footprint. +// 1) Streams example with for-await. +for await (const entry of readdirp('.')) { + const {path} = entry; + console.log(`${JSON.stringify({path})}`); +} + +// 2) Streams example, non for-await. +// Print out all JS files along with their size within the current folder & subfolders. +readdirp('.', {fileFilter: '*.js', alwaysStat: true}) + .on('data', (entry) => { + const {path, stats: {size}} = entry; + console.log(`${JSON.stringify({path, size})}`); + }) + // Optionally call stream.destroy() in `warn()` in order to abort and cause 'close' to be emitted + .on('warn', error => console.error('non-fatal error', error)) + .on('error', error => console.error('fatal error', error)) + .on('end', () => console.log('done')); + +// 3) Promise example. More RAM and CPU than streams / for-await. +const files = await readdirp.promise('.'); +console.log(files.map(file => file.path)); + +// Other options. +readdirp('test', { + fileFilter: '*.js', + directoryFilter: ['!.git', '!*modules'] + // directoryFilter: (di) => di.basename.length === 9 + type: 'files_directories', + depth: 1 +}); +``` + +For more examples, check out `examples` directory. + +## API + +`const stream = readdirp(root[, options])` — **Stream API** + +- Reads given root recursively and returns a `stream` of [entry infos](#entryinfo) +- Optionally can be used like `for await (const entry of stream)` with node.js 10+ (`asyncIterator`). +- `on('data', (entry) => {})` [entry info](#entryinfo) for every file / dir. +- `on('warn', (error) => {})` non-fatal `Error` that prevents a file / dir from being processed. Example: inaccessible to the user. +- `on('error', (error) => {})` fatal `Error` which also ends the stream. Example: illegal options where passed. +- `on('end')` — we are done. Called when all entries were found and no more will be emitted. +- `on('close')` — stream is destroyed via `stream.destroy()`. + Could be useful if you want to manually abort even on a non fatal error. + At that point the stream is no longer `readable` and no more entries, warning or errors are emitted +- To learn more about streams, consult the very detailed [nodejs streams documentation](https://nodejs.org/api/stream.html) + or the [stream-handbook](https://github.com/substack/stream-handbook) + +`const entries = await readdirp.promise(root[, options])` — **Promise API**. Returns a list of [entry infos](#entryinfo). + +First argument is awalys `root`, path in which to start reading and recursing into subdirectories. + +### options + +- `fileFilter: ["*.js"]`: filter to include or exclude files. A `Function`, Glob string or Array of glob strings. + - **Function**: a function that takes an entry info as a parameter and returns true to include or false to exclude the entry + - **Glob string**: a string (e.g., `*.js`) which is matched using [picomatch](https://github.com/micromatch/picomatch), so go there for more + information. Globstars (`**`) are not supported since specifying a recursive pattern for an already recursive function doesn't make sense. Negated globs (as explained in the minimatch documentation) are allowed, e.g., `!*.txt` matches everything but text files. + - **Array of glob strings**: either need to be all inclusive or all exclusive (negated) patterns otherwise an error is thrown. + `['*.json', '*.js']` includes all JavaScript and Json files. + `['!.git', '!node_modules']` includes all directories except the '.git' and 'node_modules'. + - Directories that do not pass a filter will not be recursed into. +- `directoryFilter: ['!.git']`: filter to include/exclude directories found and to recurse into. Directories that do not pass a filter will not be recursed into. +- `depth: 5`: depth at which to stop recursing even if more subdirectories are found +- `type: 'files'`: determines if data events on the stream should be emitted for `'files'` (default), `'directories'`, `'files_directories'`, or `'all'`. Setting to `'all'` will also include entries for other types of file descriptors like character devices, unix sockets and named pipes. +- `alwaysStat: false`: always return `stats` property for every file. Default is `false`, readdirp will return `Dirent` entries. Setting it to `true` can double readdir execution time - use it only when you need file `size`, `mtime` etc. Cannot be enabled on node <10.10.0. +- `lstat: false`: include symlink entries in the stream along with files. When `true`, `fs.lstat` would be used instead of `fs.stat` + +### `EntryInfo` + +Has the following properties: + +- `path: 'assets/javascripts/react.js'`: path to the file/directory (relative to given root) +- `fullPath: '/Users/dev/projects/app/assets/javascripts/react.js'`: full path to the file/directory found +- `basename: 'react.js'`: name of the file/directory +- `dirent: fs.Dirent`: built-in [dir entry object](https://nodejs.org/api/fs.html#fs_class_fs_dirent) - only with `alwaysStat: false` +- `stats: fs.Stats`: built in [stat object](https://nodejs.org/api/fs.html#fs_class_fs_stats) - only with `alwaysStat: true` + +## Changelog + +- 3.5 (Oct 13, 2020) disallows recursive directory-based symlinks. + Before, it could have entered infinite loop. +- 3.4 (Mar 19, 2020) adds support for directory-based symlinks. +- 3.3 (Dec 6, 2019) stabilizes RAM consumption and enables perf management with `highWaterMark` option. Fixes race conditions related to `for-await` looping. +- 3.2 (Oct 14, 2019) improves performance by 250% and makes streams implementation more idiomatic. +- 3.1 (Jul 7, 2019) brings `bigint` support to `stat` output on Windows. This is backwards-incompatible for some cases. Be careful. It you use it incorrectly, you'll see "TypeError: Cannot mix BigInt and other types, use explicit conversions". +- 3.0 brings huge performance improvements and stream backpressure support. +- Upgrading 2.x to 3.x: + - Signature changed from `readdirp(options)` to `readdirp(root, options)` + - Replaced callback API with promise API. + - Renamed `entryType` option to `type` + - Renamed `entryType: 'both'` to `'files_directories'` + - `EntryInfo` + - Renamed `stat` to `stats` + - Emitted only when `alwaysStat: true` + - `dirent` is emitted instead of `stats` by default with `alwaysStat: false` + - Renamed `name` to `basename` + - Removed `parentDir` and `fullParentDir` properties +- Supported node.js versions: + - 3.x: node 8+ + - 2.x: node 0.6+ + +## License + +Copyright (c) 2012-2019 Thorsten Lorenz, Paul Miller () + +MIT License, see [LICENSE](LICENSE) file. diff --git a/node_modules/readdirp/index.d.ts b/node_modules/readdirp/index.d.ts new file mode 100644 index 0000000..cbbd76c --- /dev/null +++ b/node_modules/readdirp/index.d.ts @@ -0,0 +1,43 @@ +// TypeScript Version: 3.2 + +/// + +import * as fs from 'fs'; +import { Readable } from 'stream'; + +declare namespace readdir { + interface EntryInfo { + path: string; + fullPath: string; + basename: string; + stats?: fs.Stats; + dirent?: fs.Dirent; + } + + interface ReaddirpOptions { + root?: string; + fileFilter?: string | string[] | ((entry: EntryInfo) => boolean); + directoryFilter?: string | string[] | ((entry: EntryInfo) => boolean); + type?: 'files' | 'directories' | 'files_directories' | 'all'; + lstat?: boolean; + depth?: number; + alwaysStat?: boolean; + } + + interface ReaddirpStream extends Readable, AsyncIterable { + read(): EntryInfo; + [Symbol.asyncIterator](): AsyncIterableIterator; + } + + function promise( + root: string, + options?: ReaddirpOptions + ): Promise; +} + +declare function readdir( + root: string, + options?: readdir.ReaddirpOptions +): readdir.ReaddirpStream; + +export = readdir; diff --git a/node_modules/readdirp/index.js b/node_modules/readdirp/index.js new file mode 100644 index 0000000..cf739b2 --- /dev/null +++ b/node_modules/readdirp/index.js @@ -0,0 +1,287 @@ +'use strict'; + +const fs = require('fs'); +const { Readable } = require('stream'); +const sysPath = require('path'); +const { promisify } = require('util'); +const picomatch = require('picomatch'); + +const readdir = promisify(fs.readdir); +const stat = promisify(fs.stat); +const lstat = promisify(fs.lstat); +const realpath = promisify(fs.realpath); + +/** + * @typedef {Object} EntryInfo + * @property {String} path + * @property {String} fullPath + * @property {fs.Stats=} stats + * @property {fs.Dirent=} dirent + * @property {String} basename + */ + +const BANG = '!'; +const RECURSIVE_ERROR_CODE = 'READDIRP_RECURSIVE_ERROR'; +const NORMAL_FLOW_ERRORS = new Set(['ENOENT', 'EPERM', 'EACCES', 'ELOOP', RECURSIVE_ERROR_CODE]); +const FILE_TYPE = 'files'; +const DIR_TYPE = 'directories'; +const FILE_DIR_TYPE = 'files_directories'; +const EVERYTHING_TYPE = 'all'; +const ALL_TYPES = [FILE_TYPE, DIR_TYPE, FILE_DIR_TYPE, EVERYTHING_TYPE]; + +const isNormalFlowError = error => NORMAL_FLOW_ERRORS.has(error.code); +const [maj, min] = process.versions.node.split('.').slice(0, 2).map(n => Number.parseInt(n, 10)); +const wantBigintFsStats = process.platform === 'win32' && (maj > 10 || (maj === 10 && min >= 5)); + +const normalizeFilter = filter => { + if (filter === undefined) return; + if (typeof filter === 'function') return filter; + + if (typeof filter === 'string') { + const glob = picomatch(filter.trim()); + return entry => glob(entry.basename); + } + + if (Array.isArray(filter)) { + const positive = []; + const negative = []; + for (const item of filter) { + const trimmed = item.trim(); + if (trimmed.charAt(0) === BANG) { + negative.push(picomatch(trimmed.slice(1))); + } else { + positive.push(picomatch(trimmed)); + } + } + + if (negative.length > 0) { + if (positive.length > 0) { + return entry => + positive.some(f => f(entry.basename)) && !negative.some(f => f(entry.basename)); + } + return entry => !negative.some(f => f(entry.basename)); + } + return entry => positive.some(f => f(entry.basename)); + } +}; + +class ReaddirpStream extends Readable { + static get defaultOptions() { + return { + root: '.', + /* eslint-disable no-unused-vars */ + fileFilter: (path) => true, + directoryFilter: (path) => true, + /* eslint-enable no-unused-vars */ + type: FILE_TYPE, + lstat: false, + depth: 2147483648, + alwaysStat: false + }; + } + + constructor(options = {}) { + super({ + objectMode: true, + autoDestroy: true, + highWaterMark: options.highWaterMark || 4096 + }); + const opts = { ...ReaddirpStream.defaultOptions, ...options }; + const { root, type } = opts; + + this._fileFilter = normalizeFilter(opts.fileFilter); + this._directoryFilter = normalizeFilter(opts.directoryFilter); + + const statMethod = opts.lstat ? lstat : stat; + // Use bigint stats if it's windows and stat() supports options (node 10+). + if (wantBigintFsStats) { + this._stat = path => statMethod(path, { bigint: true }); + } else { + this._stat = statMethod; + } + + this._maxDepth = opts.depth; + this._wantsDir = [DIR_TYPE, FILE_DIR_TYPE, EVERYTHING_TYPE].includes(type); + this._wantsFile = [FILE_TYPE, FILE_DIR_TYPE, EVERYTHING_TYPE].includes(type); + this._wantsEverything = type === EVERYTHING_TYPE; + this._root = sysPath.resolve(root); + this._isDirent = ('Dirent' in fs) && !opts.alwaysStat; + this._statsProp = this._isDirent ? 'dirent' : 'stats'; + this._rdOptions = { encoding: 'utf8', withFileTypes: this._isDirent }; + + // Launch stream with one parent, the root dir. + this.parents = [this._exploreDir(root, 1)]; + this.reading = false; + this.parent = undefined; + } + + async _read(batch) { + if (this.reading) return; + this.reading = true; + + try { + while (!this.destroyed && batch > 0) { + const { path, depth, files = [] } = this.parent || {}; + + if (files.length > 0) { + const slice = files.splice(0, batch).map(dirent => this._formatEntry(dirent, path)); + for (const entry of await Promise.all(slice)) { + if (this.destroyed) return; + + const entryType = await this._getEntryType(entry); + if (entryType === 'directory' && this._directoryFilter(entry)) { + if (depth <= this._maxDepth) { + this.parents.push(this._exploreDir(entry.fullPath, depth + 1)); + } + + if (this._wantsDir) { + this.push(entry); + batch--; + } + } else if ((entryType === 'file' || this._includeAsFile(entry)) && this._fileFilter(entry)) { + if (this._wantsFile) { + this.push(entry); + batch--; + } + } + } + } else { + const parent = this.parents.pop(); + if (!parent) { + this.push(null); + break; + } + this.parent = await parent; + if (this.destroyed) return; + } + } + } catch (error) { + this.destroy(error); + } finally { + this.reading = false; + } + } + + async _exploreDir(path, depth) { + let files; + try { + files = await readdir(path, this._rdOptions); + } catch (error) { + this._onError(error); + } + return { files, depth, path }; + } + + async _formatEntry(dirent, path) { + let entry; + try { + const basename = this._isDirent ? dirent.name : dirent; + const fullPath = sysPath.resolve(sysPath.join(path, basename)); + entry = { path: sysPath.relative(this._root, fullPath), fullPath, basename }; + entry[this._statsProp] = this._isDirent ? dirent : await this._stat(fullPath); + } catch (err) { + this._onError(err); + } + return entry; + } + + _onError(err) { + if (isNormalFlowError(err) && !this.destroyed) { + this.emit('warn', err); + } else { + this.destroy(err); + } + } + + async _getEntryType(entry) { + // entry may be undefined, because a warning or an error were emitted + // and the statsProp is undefined + const stats = entry && entry[this._statsProp]; + if (!stats) { + return; + } + if (stats.isFile()) { + return 'file'; + } + if (stats.isDirectory()) { + return 'directory'; + } + if (stats && stats.isSymbolicLink()) { + const full = entry.fullPath; + try { + const entryRealPath = await realpath(full); + const entryRealPathStats = await lstat(entryRealPath); + if (entryRealPathStats.isFile()) { + return 'file'; + } + if (entryRealPathStats.isDirectory()) { + const len = entryRealPath.length; + if (full.startsWith(entryRealPath) && full.substr(len, 1) === sysPath.sep) { + const recursiveError = new Error( + `Circular symlink detected: "${full}" points to "${entryRealPath}"` + ); + recursiveError.code = RECURSIVE_ERROR_CODE; + return this._onError(recursiveError); + } + return 'directory'; + } + } catch (error) { + this._onError(error); + } + } + } + + _includeAsFile(entry) { + const stats = entry && entry[this._statsProp]; + + return stats && this._wantsEverything && !stats.isDirectory(); + } +} + +/** + * @typedef {Object} ReaddirpArguments + * @property {Function=} fileFilter + * @property {Function=} directoryFilter + * @property {String=} type + * @property {Number=} depth + * @property {String=} root + * @property {Boolean=} lstat + * @property {Boolean=} bigint + */ + +/** + * Main function which ends up calling readdirRec and reads all files and directories in given root recursively. + * @param {String} root Root directory + * @param {ReaddirpArguments=} options Options to specify root (start directory), filters and recursion depth + */ +const readdirp = (root, options = {}) => { + let type = options.entryType || options.type; + if (type === 'both') type = FILE_DIR_TYPE; // backwards-compatibility + if (type) options.type = type; + if (!root) { + throw new Error('readdirp: root argument is required. Usage: readdirp(root, options)'); + } else if (typeof root !== 'string') { + throw new TypeError('readdirp: root argument must be a string. Usage: readdirp(root, options)'); + } else if (type && !ALL_TYPES.includes(type)) { + throw new Error(`readdirp: Invalid type passed. Use one of ${ALL_TYPES.join(', ')}`); + } + + options.root = root; + return new ReaddirpStream(options); +}; + +const readdirpPromise = (root, options = {}) => { + return new Promise((resolve, reject) => { + const files = []; + readdirp(root, options) + .on('data', entry => files.push(entry)) + .on('end', () => resolve(files)) + .on('error', error => reject(error)); + }); +}; + +readdirp.promise = readdirpPromise; +readdirp.ReaddirpStream = ReaddirpStream; +readdirp.default = readdirp; + +module.exports = readdirp; diff --git a/node_modules/readdirp/package.json b/node_modules/readdirp/package.json new file mode 100644 index 0000000..dba5388 --- /dev/null +++ b/node_modules/readdirp/package.json @@ -0,0 +1,122 @@ +{ + "name": "readdirp", + "description": "Recursive version of fs.readdir with streaming API.", + "version": "3.6.0", + "homepage": "https://github.com/paulmillr/readdirp", + "repository": { + "type": "git", + "url": "git://github.com/paulmillr/readdirp.git" + }, + "license": "MIT", + "bugs": { + "url": "https://github.com/paulmillr/readdirp/issues" + }, + "author": "Thorsten Lorenz (thlorenz.com)", + "contributors": [ + "Thorsten Lorenz (thlorenz.com)", + "Paul Miller (https://paulmillr.com)" + ], + "main": "index.js", + "engines": { + "node": ">=8.10.0" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "recursive", + "fs", + "stream", + "streams", + "readdir", + "filesystem", + "find", + "filter" + ], + "scripts": { + "dtslint": "dtslint", + "nyc": "nyc", + "mocha": "mocha --exit", + "lint": "eslint --report-unused-disable-directives --ignore-path .gitignore .", + "test": "npm run lint && nyc npm run mocha" + }, + "dependencies": { + "picomatch": "^2.2.1" + }, + "devDependencies": { + "@types/node": "^14", + "chai": "^4.2", + "chai-subset": "^1.6", + "dtslint": "^3.3.0", + "eslint": "^7.0.0", + "mocha": "^7.1.1", + "nyc": "^15.0.0", + "rimraf": "^3.0.0", + "typescript": "^4.0.3" + }, + "nyc": { + "reporter": [ + "html", + "text" + ] + }, + "eslintConfig": { + "root": true, + "extends": "eslint:recommended", + "parserOptions": { + "ecmaVersion": 9, + "sourceType": "script" + }, + "env": { + "node": true, + "es6": true + }, + "rules": { + "array-callback-return": "error", + "no-empty": [ + "error", + { + "allowEmptyCatch": true + } + ], + "no-else-return": [ + "error", + { + "allowElseIf": false + } + ], + "no-lonely-if": "error", + "no-var": "error", + "object-shorthand": "error", + "prefer-arrow-callback": [ + "error", + { + "allowNamedFunctions": true + } + ], + "prefer-const": [ + "error", + { + "ignoreReadBeforeAssign": true + } + ], + "prefer-destructuring": [ + "error", + { + "object": true, + "array": false + } + ], + "prefer-spread": "error", + "prefer-template": "error", + "radix": "error", + "semi": "error", + "strict": "error", + "quotes": [ + "error", + "single" + ] + } + } +} diff --git a/node_modules/safe-buffer/LICENSE b/node_modules/safe-buffer/LICENSE new file mode 100644 index 0000000..0c068ce --- /dev/null +++ b/node_modules/safe-buffer/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Feross Aboukhadijeh + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/safe-buffer/README.md b/node_modules/safe-buffer/README.md new file mode 100644 index 0000000..e9a81af --- /dev/null +++ b/node_modules/safe-buffer/README.md @@ -0,0 +1,584 @@ +# safe-buffer [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url] + +[travis-image]: https://img.shields.io/travis/feross/safe-buffer/master.svg +[travis-url]: https://travis-ci.org/feross/safe-buffer +[npm-image]: https://img.shields.io/npm/v/safe-buffer.svg +[npm-url]: https://npmjs.org/package/safe-buffer +[downloads-image]: https://img.shields.io/npm/dm/safe-buffer.svg +[downloads-url]: https://npmjs.org/package/safe-buffer +[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg +[standard-url]: https://standardjs.com + +#### Safer Node.js Buffer API + +**Use the new Node.js Buffer APIs (`Buffer.from`, `Buffer.alloc`, +`Buffer.allocUnsafe`, `Buffer.allocUnsafeSlow`) in all versions of Node.js.** + +**Uses the built-in implementation when available.** + +## install + +``` +npm install safe-buffer +``` + +## usage + +The goal of this package is to provide a safe replacement for the node.js `Buffer`. + +It's a drop-in replacement for `Buffer`. You can use it by adding one `require` line to +the top of your node.js modules: + +```js +var Buffer = require('safe-buffer').Buffer + +// Existing buffer code will continue to work without issues: + +new Buffer('hey', 'utf8') +new Buffer([1, 2, 3], 'utf8') +new Buffer(obj) +new Buffer(16) // create an uninitialized buffer (potentially unsafe) + +// But you can use these new explicit APIs to make clear what you want: + +Buffer.from('hey', 'utf8') // convert from many types to a Buffer +Buffer.alloc(16) // create a zero-filled buffer (safe) +Buffer.allocUnsafe(16) // create an uninitialized buffer (potentially unsafe) +``` + +## api + +### Class Method: Buffer.from(array) + + +* `array` {Array} + +Allocates a new `Buffer` using an `array` of octets. + +```js +const buf = Buffer.from([0x62,0x75,0x66,0x66,0x65,0x72]); + // creates a new Buffer containing ASCII bytes + // ['b','u','f','f','e','r'] +``` + +A `TypeError` will be thrown if `array` is not an `Array`. + +### Class Method: Buffer.from(arrayBuffer[, byteOffset[, length]]) + + +* `arrayBuffer` {ArrayBuffer} The `.buffer` property of a `TypedArray` or + a `new ArrayBuffer()` +* `byteOffset` {Number} Default: `0` +* `length` {Number} Default: `arrayBuffer.length - byteOffset` + +When passed a reference to the `.buffer` property of a `TypedArray` instance, +the newly created `Buffer` will share the same allocated memory as the +TypedArray. + +```js +const arr = new Uint16Array(2); +arr[0] = 5000; +arr[1] = 4000; + +const buf = Buffer.from(arr.buffer); // shares the memory with arr; + +console.log(buf); + // Prints: + +// changing the TypedArray changes the Buffer also +arr[1] = 6000; + +console.log(buf); + // Prints: +``` + +The optional `byteOffset` and `length` arguments specify a memory range within +the `arrayBuffer` that will be shared by the `Buffer`. + +```js +const ab = new ArrayBuffer(10); +const buf = Buffer.from(ab, 0, 2); +console.log(buf.length); + // Prints: 2 +``` + +A `TypeError` will be thrown if `arrayBuffer` is not an `ArrayBuffer`. + +### Class Method: Buffer.from(buffer) + + +* `buffer` {Buffer} + +Copies the passed `buffer` data onto a new `Buffer` instance. + +```js +const buf1 = Buffer.from('buffer'); +const buf2 = Buffer.from(buf1); + +buf1[0] = 0x61; +console.log(buf1.toString()); + // 'auffer' +console.log(buf2.toString()); + // 'buffer' (copy is not changed) +``` + +A `TypeError` will be thrown if `buffer` is not a `Buffer`. + +### Class Method: Buffer.from(str[, encoding]) + + +* `str` {String} String to encode. +* `encoding` {String} Encoding to use, Default: `'utf8'` + +Creates a new `Buffer` containing the given JavaScript string `str`. If +provided, the `encoding` parameter identifies the character encoding. +If not provided, `encoding` defaults to `'utf8'`. + +```js +const buf1 = Buffer.from('this is a tést'); +console.log(buf1.toString()); + // prints: this is a tést +console.log(buf1.toString('ascii')); + // prints: this is a tC)st + +const buf2 = Buffer.from('7468697320697320612074c3a97374', 'hex'); +console.log(buf2.toString()); + // prints: this is a tést +``` + +A `TypeError` will be thrown if `str` is not a string. + +### Class Method: Buffer.alloc(size[, fill[, encoding]]) + + +* `size` {Number} +* `fill` {Value} Default: `undefined` +* `encoding` {String} Default: `utf8` + +Allocates a new `Buffer` of `size` bytes. If `fill` is `undefined`, the +`Buffer` will be *zero-filled*. + +```js +const buf = Buffer.alloc(5); +console.log(buf); + // +``` + +The `size` must be less than or equal to the value of +`require('buffer').kMaxLength` (on 64-bit architectures, `kMaxLength` is +`(2^31)-1`). Otherwise, a [`RangeError`][] is thrown. A zero-length Buffer will +be created if a `size` less than or equal to 0 is specified. + +If `fill` is specified, the allocated `Buffer` will be initialized by calling +`buf.fill(fill)`. See [`buf.fill()`][] for more information. + +```js +const buf = Buffer.alloc(5, 'a'); +console.log(buf); + // +``` + +If both `fill` and `encoding` are specified, the allocated `Buffer` will be +initialized by calling `buf.fill(fill, encoding)`. For example: + +```js +const buf = Buffer.alloc(11, 'aGVsbG8gd29ybGQ=', 'base64'); +console.log(buf); + // +``` + +Calling `Buffer.alloc(size)` can be significantly slower than the alternative +`Buffer.allocUnsafe(size)` but ensures that the newly created `Buffer` instance +contents will *never contain sensitive data*. + +A `TypeError` will be thrown if `size` is not a number. + +### Class Method: Buffer.allocUnsafe(size) + + +* `size` {Number} + +Allocates a new *non-zero-filled* `Buffer` of `size` bytes. The `size` must +be less than or equal to the value of `require('buffer').kMaxLength` (on 64-bit +architectures, `kMaxLength` is `(2^31)-1`). Otherwise, a [`RangeError`][] is +thrown. A zero-length Buffer will be created if a `size` less than or equal to +0 is specified. + +The underlying memory for `Buffer` instances created in this way is *not +initialized*. The contents of the newly created `Buffer` are unknown and +*may contain sensitive data*. Use [`buf.fill(0)`][] to initialize such +`Buffer` instances to zeroes. + +```js +const buf = Buffer.allocUnsafe(5); +console.log(buf); + // + // (octets will be different, every time) +buf.fill(0); +console.log(buf); + // +``` + +A `TypeError` will be thrown if `size` is not a number. + +Note that the `Buffer` module pre-allocates an internal `Buffer` instance of +size `Buffer.poolSize` that is used as a pool for the fast allocation of new +`Buffer` instances created using `Buffer.allocUnsafe(size)` (and the deprecated +`new Buffer(size)` constructor) only when `size` is less than or equal to +`Buffer.poolSize >> 1` (floor of `Buffer.poolSize` divided by two). The default +value of `Buffer.poolSize` is `8192` but can be modified. + +Use of this pre-allocated internal memory pool is a key difference between +calling `Buffer.alloc(size, fill)` vs. `Buffer.allocUnsafe(size).fill(fill)`. +Specifically, `Buffer.alloc(size, fill)` will *never* use the internal Buffer +pool, while `Buffer.allocUnsafe(size).fill(fill)` *will* use the internal +Buffer pool if `size` is less than or equal to half `Buffer.poolSize`. The +difference is subtle but can be important when an application requires the +additional performance that `Buffer.allocUnsafe(size)` provides. + +### Class Method: Buffer.allocUnsafeSlow(size) + + +* `size` {Number} + +Allocates a new *non-zero-filled* and non-pooled `Buffer` of `size` bytes. The +`size` must be less than or equal to the value of +`require('buffer').kMaxLength` (on 64-bit architectures, `kMaxLength` is +`(2^31)-1`). Otherwise, a [`RangeError`][] is thrown. A zero-length Buffer will +be created if a `size` less than or equal to 0 is specified. + +The underlying memory for `Buffer` instances created in this way is *not +initialized*. The contents of the newly created `Buffer` are unknown and +*may contain sensitive data*. Use [`buf.fill(0)`][] to initialize such +`Buffer` instances to zeroes. + +When using `Buffer.allocUnsafe()` to allocate new `Buffer` instances, +allocations under 4KB are, by default, sliced from a single pre-allocated +`Buffer`. This allows applications to avoid the garbage collection overhead of +creating many individually allocated Buffers. This approach improves both +performance and memory usage by eliminating the need to track and cleanup as +many `Persistent` objects. + +However, in the case where a developer may need to retain a small chunk of +memory from a pool for an indeterminate amount of time, it may be appropriate +to create an un-pooled Buffer instance using `Buffer.allocUnsafeSlow()` then +copy out the relevant bits. + +```js +// need to keep around a few small chunks of memory +const store = []; + +socket.on('readable', () => { + const data = socket.read(); + // allocate for retained data + const sb = Buffer.allocUnsafeSlow(10); + // copy the data into the new allocation + data.copy(sb, 0, 0, 10); + store.push(sb); +}); +``` + +Use of `Buffer.allocUnsafeSlow()` should be used only as a last resort *after* +a developer has observed undue memory retention in their applications. + +A `TypeError` will be thrown if `size` is not a number. + +### All the Rest + +The rest of the `Buffer` API is exactly the same as in node.js. +[See the docs](https://nodejs.org/api/buffer.html). + + +## Related links + +- [Node.js issue: Buffer(number) is unsafe](https://github.com/nodejs/node/issues/4660) +- [Node.js Enhancement Proposal: Buffer.from/Buffer.alloc/Buffer.zalloc/Buffer() soft-deprecate](https://github.com/nodejs/node-eps/pull/4) + +## Why is `Buffer` unsafe? + +Today, the node.js `Buffer` constructor is overloaded to handle many different argument +types like `String`, `Array`, `Object`, `TypedArrayView` (`Uint8Array`, etc.), +`ArrayBuffer`, and also `Number`. + +The API is optimized for convenience: you can throw any type at it, and it will try to do +what you want. + +Because the Buffer constructor is so powerful, you often see code like this: + +```js +// Convert UTF-8 strings to hex +function toHex (str) { + return new Buffer(str).toString('hex') +} +``` + +***But what happens if `toHex` is called with a `Number` argument?*** + +### Remote Memory Disclosure + +If an attacker can make your program call the `Buffer` constructor with a `Number` +argument, then they can make it allocate uninitialized memory from the node.js process. +This could potentially disclose TLS private keys, user data, or database passwords. + +When the `Buffer` constructor is passed a `Number` argument, it returns an +**UNINITIALIZED** block of memory of the specified `size`. When you create a `Buffer` like +this, you **MUST** overwrite the contents before returning it to the user. + +From the [node.js docs](https://nodejs.org/api/buffer.html#buffer_new_buffer_size): + +> `new Buffer(size)` +> +> - `size` Number +> +> The underlying memory for `Buffer` instances created in this way is not initialized. +> **The contents of a newly created `Buffer` are unknown and could contain sensitive +> data.** Use `buf.fill(0)` to initialize a Buffer to zeroes. + +(Emphasis our own.) + +Whenever the programmer intended to create an uninitialized `Buffer` you often see code +like this: + +```js +var buf = new Buffer(16) + +// Immediately overwrite the uninitialized buffer with data from another buffer +for (var i = 0; i < buf.length; i++) { + buf[i] = otherBuf[i] +} +``` + + +### Would this ever be a problem in real code? + +Yes. It's surprisingly common to forget to check the type of your variables in a +dynamically-typed language like JavaScript. + +Usually the consequences of assuming the wrong type is that your program crashes with an +uncaught exception. But the failure mode for forgetting to check the type of arguments to +the `Buffer` constructor is more catastrophic. + +Here's an example of a vulnerable service that takes a JSON payload and converts it to +hex: + +```js +// Take a JSON payload {str: "some string"} and convert it to hex +var server = http.createServer(function (req, res) { + var data = '' + req.setEncoding('utf8') + req.on('data', function (chunk) { + data += chunk + }) + req.on('end', function () { + var body = JSON.parse(data) + res.end(new Buffer(body.str).toString('hex')) + }) +}) + +server.listen(8080) +``` + +In this example, an http client just has to send: + +```json +{ + "str": 1000 +} +``` + +and it will get back 1,000 bytes of uninitialized memory from the server. + +This is a very serious bug. It's similar in severity to the +[the Heartbleed bug](http://heartbleed.com/) that allowed disclosure of OpenSSL process +memory by remote attackers. + + +### Which real-world packages were vulnerable? + +#### [`bittorrent-dht`](https://www.npmjs.com/package/bittorrent-dht) + +[Mathias Buus](https://github.com/mafintosh) and I +([Feross Aboukhadijeh](http://feross.org/)) found this issue in one of our own packages, +[`bittorrent-dht`](https://www.npmjs.com/package/bittorrent-dht). The bug would allow +anyone on the internet to send a series of messages to a user of `bittorrent-dht` and get +them to reveal 20 bytes at a time of uninitialized memory from the node.js process. + +Here's +[the commit](https://github.com/feross/bittorrent-dht/commit/6c7da04025d5633699800a99ec3fbadf70ad35b8) +that fixed it. We released a new fixed version, created a +[Node Security Project disclosure](https://nodesecurity.io/advisories/68), and deprecated all +vulnerable versions on npm so users will get a warning to upgrade to a newer version. + +#### [`ws`](https://www.npmjs.com/package/ws) + +That got us wondering if there were other vulnerable packages. Sure enough, within a short +period of time, we found the same issue in [`ws`](https://www.npmjs.com/package/ws), the +most popular WebSocket implementation in node.js. + +If certain APIs were called with `Number` parameters instead of `String` or `Buffer` as +expected, then uninitialized server memory would be disclosed to the remote peer. + +These were the vulnerable methods: + +```js +socket.send(number) +socket.ping(number) +socket.pong(number) +``` + +Here's a vulnerable socket server with some echo functionality: + +```js +server.on('connection', function (socket) { + socket.on('message', function (message) { + message = JSON.parse(message) + if (message.type === 'echo') { + socket.send(message.data) // send back the user's message + } + }) +}) +``` + +`socket.send(number)` called on the server, will disclose server memory. + +Here's [the release](https://github.com/websockets/ws/releases/tag/1.0.1) where the issue +was fixed, with a more detailed explanation. Props to +[Arnout Kazemier](https://github.com/3rd-Eden) for the quick fix. Here's the +[Node Security Project disclosure](https://nodesecurity.io/advisories/67). + + +### What's the solution? + +It's important that node.js offers a fast way to get memory otherwise performance-critical +applications would needlessly get a lot slower. + +But we need a better way to *signal our intent* as programmers. **When we want +uninitialized memory, we should request it explicitly.** + +Sensitive functionality should not be packed into a developer-friendly API that loosely +accepts many different types. This type of API encourages the lazy practice of passing +variables in without checking the type very carefully. + +#### A new API: `Buffer.allocUnsafe(number)` + +The functionality of creating buffers with uninitialized memory should be part of another +API. We propose `Buffer.allocUnsafe(number)`. This way, it's not part of an API that +frequently gets user input of all sorts of different types passed into it. + +```js +var buf = Buffer.allocUnsafe(16) // careful, uninitialized memory! + +// Immediately overwrite the uninitialized buffer with data from another buffer +for (var i = 0; i < buf.length; i++) { + buf[i] = otherBuf[i] +} +``` + + +### How do we fix node.js core? + +We sent [a PR to node.js core](https://github.com/nodejs/node/pull/4514) (merged as +`semver-major`) which defends against one case: + +```js +var str = 16 +new Buffer(str, 'utf8') +``` + +In this situation, it's implied that the programmer intended the first argument to be a +string, since they passed an encoding as a second argument. Today, node.js will allocate +uninitialized memory in the case of `new Buffer(number, encoding)`, which is probably not +what the programmer intended. + +But this is only a partial solution, since if the programmer does `new Buffer(variable)` +(without an `encoding` parameter) there's no way to know what they intended. If `variable` +is sometimes a number, then uninitialized memory will sometimes be returned. + +### What's the real long-term fix? + +We could deprecate and remove `new Buffer(number)` and use `Buffer.allocUnsafe(number)` when +we need uninitialized memory. But that would break 1000s of packages. + +~~We believe the best solution is to:~~ + +~~1. Change `new Buffer(number)` to return safe, zeroed-out memory~~ + +~~2. Create a new API for creating uninitialized Buffers. We propose: `Buffer.allocUnsafe(number)`~~ + +#### Update + +We now support adding three new APIs: + +- `Buffer.from(value)` - convert from any type to a buffer +- `Buffer.alloc(size)` - create a zero-filled buffer +- `Buffer.allocUnsafe(size)` - create an uninitialized buffer with given size + +This solves the core problem that affected `ws` and `bittorrent-dht` which is +`Buffer(variable)` getting tricked into taking a number argument. + +This way, existing code continues working and the impact on the npm ecosystem will be +minimal. Over time, npm maintainers can migrate performance-critical code to use +`Buffer.allocUnsafe(number)` instead of `new Buffer(number)`. + + +### Conclusion + +We think there's a serious design issue with the `Buffer` API as it exists today. It +promotes insecure software by putting high-risk functionality into a convenient API +with friendly "developer ergonomics". + +This wasn't merely a theoretical exercise because we found the issue in some of the +most popular npm packages. + +Fortunately, there's an easy fix that can be applied today. Use `safe-buffer` in place of +`buffer`. + +```js +var Buffer = require('safe-buffer').Buffer +``` + +Eventually, we hope that node.js core can switch to this new, safer behavior. We believe +the impact on the ecosystem would be minimal since it's not a breaking change. +Well-maintained, popular packages would be updated to use `Buffer.alloc` quickly, while +older, insecure packages would magically become safe from this attack vector. + + +## links + +- [Node.js PR: buffer: throw if both length and enc are passed](https://github.com/nodejs/node/pull/4514) +- [Node Security Project disclosure for `ws`](https://nodesecurity.io/advisories/67) +- [Node Security Project disclosure for`bittorrent-dht`](https://nodesecurity.io/advisories/68) + + +## credit + +The original issues in `bittorrent-dht` +([disclosure](https://nodesecurity.io/advisories/68)) and +`ws` ([disclosure](https://nodesecurity.io/advisories/67)) were discovered by +[Mathias Buus](https://github.com/mafintosh) and +[Feross Aboukhadijeh](http://feross.org/). + +Thanks to [Adam Baldwin](https://github.com/evilpacket) for helping disclose these issues +and for his work running the [Node Security Project](https://nodesecurity.io/). + +Thanks to [John Hiesey](https://github.com/jhiesey) for proofreading this README and +auditing the code. + + +## license + +MIT. Copyright (C) [Feross Aboukhadijeh](http://feross.org) diff --git a/node_modules/safe-buffer/index.d.ts b/node_modules/safe-buffer/index.d.ts new file mode 100644 index 0000000..e9fed80 --- /dev/null +++ b/node_modules/safe-buffer/index.d.ts @@ -0,0 +1,187 @@ +declare module "safe-buffer" { + export class Buffer { + length: number + write(string: string, offset?: number, length?: number, encoding?: string): number; + toString(encoding?: string, start?: number, end?: number): string; + toJSON(): { type: 'Buffer', data: any[] }; + equals(otherBuffer: Buffer): boolean; + compare(otherBuffer: Buffer, targetStart?: number, targetEnd?: number, sourceStart?: number, sourceEnd?: number): number; + copy(targetBuffer: Buffer, targetStart?: number, sourceStart?: number, sourceEnd?: number): number; + slice(start?: number, end?: number): Buffer; + writeUIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + writeUIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + writeIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + writeIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + readUIntLE(offset: number, byteLength: number, noAssert?: boolean): number; + readUIntBE(offset: number, byteLength: number, noAssert?: boolean): number; + readIntLE(offset: number, byteLength: number, noAssert?: boolean): number; + readIntBE(offset: number, byteLength: number, noAssert?: boolean): number; + readUInt8(offset: number, noAssert?: boolean): number; + readUInt16LE(offset: number, noAssert?: boolean): number; + readUInt16BE(offset: number, noAssert?: boolean): number; + readUInt32LE(offset: number, noAssert?: boolean): number; + readUInt32BE(offset: number, noAssert?: boolean): number; + readInt8(offset: number, noAssert?: boolean): number; + readInt16LE(offset: number, noAssert?: boolean): number; + readInt16BE(offset: number, noAssert?: boolean): number; + readInt32LE(offset: number, noAssert?: boolean): number; + readInt32BE(offset: number, noAssert?: boolean): number; + readFloatLE(offset: number, noAssert?: boolean): number; + readFloatBE(offset: number, noAssert?: boolean): number; + readDoubleLE(offset: number, noAssert?: boolean): number; + readDoubleBE(offset: number, noAssert?: boolean): number; + swap16(): Buffer; + swap32(): Buffer; + swap64(): Buffer; + writeUInt8(value: number, offset: number, noAssert?: boolean): number; + writeUInt16LE(value: number, offset: number, noAssert?: boolean): number; + writeUInt16BE(value: number, offset: number, noAssert?: boolean): number; + writeUInt32LE(value: number, offset: number, noAssert?: boolean): number; + writeUInt32BE(value: number, offset: number, noAssert?: boolean): number; + writeInt8(value: number, offset: number, noAssert?: boolean): number; + writeInt16LE(value: number, offset: number, noAssert?: boolean): number; + writeInt16BE(value: number, offset: number, noAssert?: boolean): number; + writeInt32LE(value: number, offset: number, noAssert?: boolean): number; + writeInt32BE(value: number, offset: number, noAssert?: boolean): number; + writeFloatLE(value: number, offset: number, noAssert?: boolean): number; + writeFloatBE(value: number, offset: number, noAssert?: boolean): number; + writeDoubleLE(value: number, offset: number, noAssert?: boolean): number; + writeDoubleBE(value: number, offset: number, noAssert?: boolean): number; + fill(value: any, offset?: number, end?: number): this; + indexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number; + lastIndexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number; + includes(value: string | number | Buffer, byteOffset?: number, encoding?: string): boolean; + + /** + * Allocates a new buffer containing the given {str}. + * + * @param str String to store in buffer. + * @param encoding encoding to use, optional. Default is 'utf8' + */ + constructor (str: string, encoding?: string); + /** + * Allocates a new buffer of {size} octets. + * + * @param size count of octets to allocate. + */ + constructor (size: number); + /** + * Allocates a new buffer containing the given {array} of octets. + * + * @param array The octets to store. + */ + constructor (array: Uint8Array); + /** + * Produces a Buffer backed by the same allocated memory as + * the given {ArrayBuffer}. + * + * + * @param arrayBuffer The ArrayBuffer with which to share memory. + */ + constructor (arrayBuffer: ArrayBuffer); + /** + * Allocates a new buffer containing the given {array} of octets. + * + * @param array The octets to store. + */ + constructor (array: any[]); + /** + * Copies the passed {buffer} data onto a new {Buffer} instance. + * + * @param buffer The buffer to copy. + */ + constructor (buffer: Buffer); + prototype: Buffer; + /** + * Allocates a new Buffer using an {array} of octets. + * + * @param array + */ + static from(array: any[]): Buffer; + /** + * When passed a reference to the .buffer property of a TypedArray instance, + * the newly created Buffer will share the same allocated memory as the TypedArray. + * The optional {byteOffset} and {length} arguments specify a memory range + * within the {arrayBuffer} that will be shared by the Buffer. + * + * @param arrayBuffer The .buffer property of a TypedArray or a new ArrayBuffer() + * @param byteOffset + * @param length + */ + static from(arrayBuffer: ArrayBuffer, byteOffset?: number, length?: number): Buffer; + /** + * Copies the passed {buffer} data onto a new Buffer instance. + * + * @param buffer + */ + static from(buffer: Buffer): Buffer; + /** + * Creates a new Buffer containing the given JavaScript string {str}. + * If provided, the {encoding} parameter identifies the character encoding. + * If not provided, {encoding} defaults to 'utf8'. + * + * @param str + */ + static from(str: string, encoding?: string): Buffer; + /** + * Returns true if {obj} is a Buffer + * + * @param obj object to test. + */ + static isBuffer(obj: any): obj is Buffer; + /** + * Returns true if {encoding} is a valid encoding argument. + * Valid string encodings in Node 0.12: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'binary'(deprecated)|'hex' + * + * @param encoding string to test. + */ + static isEncoding(encoding: string): boolean; + /** + * Gives the actual byte length of a string. encoding defaults to 'utf8'. + * This is not the same as String.prototype.length since that returns the number of characters in a string. + * + * @param string string to test. + * @param encoding encoding used to evaluate (defaults to 'utf8') + */ + static byteLength(string: string, encoding?: string): number; + /** + * Returns a buffer which is the result of concatenating all the buffers in the list together. + * + * If the list has no items, or if the totalLength is 0, then it returns a zero-length buffer. + * If the list has exactly one item, then the first item of the list is returned. + * If the list has more than one item, then a new Buffer is created. + * + * @param list An array of Buffer objects to concatenate + * @param totalLength Total length of the buffers when concatenated. + * If totalLength is not provided, it is read from the buffers in the list. However, this adds an additional loop to the function, so it is faster to provide the length explicitly. + */ + static concat(list: Buffer[], totalLength?: number): Buffer; + /** + * The same as buf1.compare(buf2). + */ + static compare(buf1: Buffer, buf2: Buffer): number; + /** + * Allocates a new buffer of {size} octets. + * + * @param size count of octets to allocate. + * @param fill if specified, buffer will be initialized by calling buf.fill(fill). + * If parameter is omitted, buffer will be filled with zeros. + * @param encoding encoding used for call to buf.fill while initalizing + */ + static alloc(size: number, fill?: string | Buffer | number, encoding?: string): Buffer; + /** + * Allocates a new buffer of {size} octets, leaving memory not initialized, so the contents + * of the newly created Buffer are unknown and may contain sensitive data. + * + * @param size count of octets to allocate + */ + static allocUnsafe(size: number): Buffer; + /** + * Allocates a new non-pooled buffer of {size} octets, leaving memory not initialized, so the contents + * of the newly created Buffer are unknown and may contain sensitive data. + * + * @param size count of octets to allocate + */ + static allocUnsafeSlow(size: number): Buffer; + } +} \ No newline at end of file diff --git a/node_modules/safe-buffer/index.js b/node_modules/safe-buffer/index.js new file mode 100644 index 0000000..f8d3ec9 --- /dev/null +++ b/node_modules/safe-buffer/index.js @@ -0,0 +1,65 @@ +/*! safe-buffer. MIT License. Feross Aboukhadijeh */ +/* eslint-disable node/no-deprecated-api */ +var buffer = require('buffer') +var Buffer = buffer.Buffer + +// alternative to using Object.keys for old browsers +function copyProps (src, dst) { + for (var key in src) { + dst[key] = src[key] + } +} +if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) { + module.exports = buffer +} else { + // Copy properties from require('buffer') + copyProps(buffer, exports) + exports.Buffer = SafeBuffer +} + +function SafeBuffer (arg, encodingOrOffset, length) { + return Buffer(arg, encodingOrOffset, length) +} + +SafeBuffer.prototype = Object.create(Buffer.prototype) + +// Copy static methods from Buffer +copyProps(Buffer, SafeBuffer) + +SafeBuffer.from = function (arg, encodingOrOffset, length) { + if (typeof arg === 'number') { + throw new TypeError('Argument must not be a number') + } + return Buffer(arg, encodingOrOffset, length) +} + +SafeBuffer.alloc = function (size, fill, encoding) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + var buf = Buffer(size) + if (fill !== undefined) { + if (typeof encoding === 'string') { + buf.fill(fill, encoding) + } else { + buf.fill(fill) + } + } else { + buf.fill(0) + } + return buf +} + +SafeBuffer.allocUnsafe = function (size) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + return Buffer(size) +} + +SafeBuffer.allocUnsafeSlow = function (size) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + return buffer.SlowBuffer(size) +} diff --git a/node_modules/safe-buffer/package.json b/node_modules/safe-buffer/package.json new file mode 100644 index 0000000..f2869e2 --- /dev/null +++ b/node_modules/safe-buffer/package.json @@ -0,0 +1,51 @@ +{ + "name": "safe-buffer", + "description": "Safer Node.js Buffer API", + "version": "5.2.1", + "author": { + "name": "Feross Aboukhadijeh", + "email": "feross@feross.org", + "url": "https://feross.org" + }, + "bugs": { + "url": "https://github.com/feross/safe-buffer/issues" + }, + "devDependencies": { + "standard": "*", + "tape": "^5.0.0" + }, + "homepage": "https://github.com/feross/safe-buffer", + "keywords": [ + "buffer", + "buffer allocate", + "node security", + "safe", + "safe-buffer", + "security", + "uninitialized" + ], + "license": "MIT", + "main": "index.js", + "types": "index.d.ts", + "repository": { + "type": "git", + "url": "git://github.com/feross/safe-buffer.git" + }, + "scripts": { + "test": "standard && tape test/*.js" + }, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] +} diff --git a/node_modules/sass-loader/CHANGELOG.md b/node_modules/sass-loader/CHANGELOG.md new file mode 100644 index 0000000..1d2d17c --- /dev/null +++ b/node_modules/sass-loader/CHANGELOG.md @@ -0,0 +1,436 @@ +# Changelog + +All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + +### [8.0.2](https://github.com/webpack-contrib/sass-loader/compare/v8.0.1...v8.0.2) (2020-01-13) + + +### Bug Fixes + +* compatibility with node@8 ([#798](https://github.com/webpack-contrib/sass-loader/issues/798)) ([6f3852f](https://github.com/webpack-contrib/sass-loader/commit/6f3852f7d393dd0bc8f8d264d81ecc941bc72511)) + +### [8.0.1](https://github.com/webpack-contrib/sass-loader/compare/v8.0.0...v8.0.1) (2020-01-10) + + +### Bug Fixes + +* support webpack@5 ([#794](https://github.com/webpack-contrib/sass-loader/issues/794)) ([6c59e37](https://github.com/webpack-contrib/sass-loader/commit/6c59e37e3f67668d7a3908444ddfc0176bc5601f)) + +## [8.0.0](https://github.com/webpack-contrib/sass-loader/compare/v7.3.1...v8.0.0) (2019-08-29) + + +### ⚠ BREAKING CHANGES + +* minimum required `webpack` version is `4.36.0` +* minimum required `node.js` version is `8.9.0` +* move all sass (`includePaths`, `importer`, `functions`, `outputStyle`) options to the `sassOptions` option. The `functions` option can't be used as `Function`, you should use `sassOption` as `Function` to achieve this. +* the `data` option was renamed to the `prependData` option +* default value of the `sourceMap` option depends on the `devtool` value (`eval`/`false` values don't enable source map generation) + + +### Features + +* automatically use the `fibers` package if it is possible ([#744](https://github.com/webpack-contrib/sass-loader/issues/744)) ([96184e1](https://github.com/webpack-contrib/sass-loader/commit/96184e1)) +* source map generation depends on the `devtool` option ([#743](https://github.com/webpack-contrib/sass-loader/issues/743)) ([fcea88e](https://github.com/webpack-contrib/sass-loader/commit/fcea88e)) +* validate loader options ([#737](https://github.com/webpack-contrib/sass-loader/issues/737)) ([7b543fc](https://github.com/webpack-contrib/sass-loader/commit/7b543fc)) +* reworked error handling from `node-sass`/`sass` +* improve resolution for `@import` (including support `_index` and `index` files in a directory) + +### Bug Fixes + +* compatibility with `pnp` + + +### [7.3.1](https://github.com/webpack-contrib/sass-loader/compare/v7.3.0...v7.3.1) (2019-08-20) + + +### Bug Fixes + +* minimum `node` version in `package.json` ([#733](https://github.com/webpack-contrib/sass-loader/issues/733)) ([1175920](https://github.com/webpack-contrib/sass-loader/commit/1175920)) + +## [7.3.0](https://github.com/webpack-contrib/sass-loader/compare/v7.2.0...v7.3.0) (2019-08-20) + + +### Bug Fixes + +* handle module import ending `/` as module ([#728](https://github.com/webpack-contrib/sass-loader/issues/728)) ([997a255](https://github.com/webpack-contrib/sass-loader/commit/997a255)) +* resolution algorithm ([#720](https://github.com/webpack-contrib/sass-loader/issues/720)) ([0e94940](https://github.com/webpack-contrib/sass-loader/commit/0e94940)) +* use "compressed" output when mode is "production" ([#723](https://github.com/webpack-contrib/sass-loader/issues/723)) ([b2af379](https://github.com/webpack-contrib/sass-loader/commit/b2af379)) + + +### Features + +* `webpackImporter` option ([#732](https://github.com/webpack-contrib/sass-loader/issues/732)) ([6f4ea37](https://github.com/webpack-contrib/sass-loader/commit/6f4ea37)) + + +# [7.2.0](https://github.com/webpack-contrib/sass-loader/compare/v7.1.0...v7.2.0) (2019-08-08) + + +### Bug Fixes + +* better handle stdin in sources ([#681](https://github.com/webpack-contrib/sass-loader/issues/681)) ([e279f2a](https://github.com/webpack-contrib/sass-loader/commit/e279f2a)) +* prefer `sass`/`scss`/`css` extensions ([#711](https://github.com/webpack-contrib/sass-loader/issues/711)) ([6fc9d4e](https://github.com/webpack-contrib/sass-loader/commit/6fc9d4e)) +* relax node engine ([#708](https://github.com/webpack-contrib/sass-loader/issues/708)) ([2a51502](https://github.com/webpack-contrib/sass-loader/commit/2a51502)) + + +### Features + +* allow passing `functions` option as function ([#651](https://github.com/webpack-contrib/sass-loader/issues/651)) ([6c9654d](https://github.com/webpack-contrib/sass-loader/commit/6c9654d)) +* support `data` as `Function` ([#648](https://github.com/webpack-contrib/sass-loader/issues/648)) ([aa64e1b](https://github.com/webpack-contrib/sass-loader/commit/aa64e1b)) +* support `sass` and `style` fields in `package.json` ([#647](https://github.com/webpack-contrib/sass-loader/issues/647)) ([a8709c9](https://github.com/webpack-contrib/sass-loader/commit/a8709c9)) +* support auto resolving `dart-sass` ([ff90dd6](https://github.com/webpack-contrib/sass-loader/commit/ff90dd6)) + + + + +# [7.1.0](https://github.com/webpack-contrib/sass-loader/compare/v7.0.3...v7.1.0) (2018-08-01) + + +### Features + +* Make this package implementation-agnostic (#573) ([bed9fb5](https://github.com/webpack-contrib/sass-loader/commit/bed9fb5)), closes [#435](https://github.com/webpack-contrib/sass-loader/issues/435) + + + + +## [7.0.3](https://github.com/webpack-contrib/sass-loader/compare/v7.0.2...v7.0.3) (2018-06-05) + + +### Bug Fixes + +* Bare imports not working sometimes (#579) ([c348281](https://github.com/webpack-contrib/sass-loader/commit/c348281)), closes [#566](https://github.com/webpack-contrib/sass-loader/issues/566) + + + + +## [7.0.2](https://github.com/webpack-contrib/sass-loader/compare/v7.0.1...v7.0.2) (2018-06-02) + + +### Bug Fixes + +* Errors being swallowed when trying to load node-sass (#576) ([6dfb274](https://github.com/webpack-contrib/sass-loader/commit/6dfb274)), closes [#563](https://github.com/webpack-contrib/sass-loader/issues/563) +* Report error to user for problems loading node-sass (#562) ([2529c07](https://github.com/webpack-contrib/sass-loader/commit/2529c07)) + + + + +## [7.0.1](https://github.com/webpack-contrib/sass-loader/compare/v7.0.0...v7.0.1) (2018-04-13) + + +### Bug Fixes + +* Wrong import precedence (#557) ([f4eeff1](https://github.com/webpack-contrib/sass-loader/commit/f4eeff1)) + + + + +# [7.0.0](https://github.com/webpack-contrib/sass-loader/compare/v6.0.7...v7.0.0) (2018-04-13) + + +### Features + +* Refactor resolving and simplify webpack config aliases (#479) ([e0fde1a](https://github.com/webpack-contrib/sass-loader/commit/e0fde1a)) +* Remove `node-sass` from `peerDependencies` (#533) ([6439cef](https://github.com/webpack-contrib/sass-loader/commit/6439cef)) + + +### BREAKING CHANGES + +* Drop official node 4 support +* This slightly changes the resolving algorithm. Should not break in normal usage, but might break in complex configurations. +* The sass-loader throws an error at runtime now and refuses to compile if the peer dependency is wrong. This could break applications where npm's peer dependency warning was just ignored. + + + + +## [6.0.7](https://github.com/webpack-contrib/sass-loader/compare/v6.0.6...v6.0.7) (2018-03-03) + + +### Bug Fixes + +* **package:** add `webpack >= v4.0.0` (`peerDependencies`) ([#541](https://github.com/webpack-contrib/sass-loader/issues/541)) ([620bdd4](https://github.com/webpack-contrib/sass-loader/commit/620bdd4)) + + +### Performance Improvements + +* use `neo-async` instead `async` ([#538](https://github.com/webpack-contrib/sass-loader/issues/538)) ([fab89dc](https://github.com/webpack-contrib/sass-loader/commit/fab89dc)) + + + + +## [6.0.6](https://github.com/webpack-contrib/sass-loader/compare/v6.0.5...v6.0.6) (2017-06-14) + +### Chore + +* Adds Webpack 3.x version range to peerDependencies + + + +# [6.0.5](https://github.com/webpack-contrib/sass-loader/compare/v6.0.5...v6.0.4) (2017-05-10) + +### Bug Fixes + +* importing file directly from scoped npm package [#450](https://github.com/webpack-contrib/sass-loader/pull/450) ([5d06e9d](https://github.com/webpack-contrib/sass-loader/commit/5d06e9d)) + + + +# [6.0.4](https://github.com/webpack-contrib/sass-loader/compare/v6.0.4...v6.0.3) (2017-05-09) + +### Bug Fixes + +* fix: Resolving of scoped npm packages [#447](https://github.com/webpack-contrib/sass-loader/pull/447) + + + +# [6.0.3](https://github.com/webpack-contrib/sass-loader/compare/v6.0.3...v6.0.2) (2017-03-07) + +### Bug Fixes + +* Fix regression with empty files [#398](https://github.com/webpack-contrib/sass-loader/pull/398) + + +### Chore + +* Reduce npm package size by using the [files](https://docs.npmjs.com/files/package.json#files) property in the `package.json` + + + +# [6.0.2](https://github.com/webpack-contrib/sass-loader/compare/v6.0.2...v6.0.1) (2017-02-21) + +### Chore + +* Update dependencies [#383](https://github.com/webpack-contrib/sass-loader/pull/383) + + + +# [6.0.1](https://github.com/webpack-contrib/sass-loader/compare/v6.0.1...v6.0.0) (2017-02-17) + +### Bug Fixes + +* Fix source maps in certain CWDs. [#377](https://github.com/webpack-contrib/sass-loader/pull/377) + + + +# [6.0.0](https://github.com/webpack-contrib/sass-loader/compare/v6.0.0...v5.0.1) (2017-02-13) + +### Bug Fixes + +* Improve source map support. [#374](https://github.com/webpack-contrib/sass-loader/issues/374) + + +### BREAKING CHANGES + +* This is breaking for the resolve-url-loader + + + +# [5.0.1](https://github.com/webpack-contrib/sass-loader/compare/v5.0.1...v5.0.0) (2017-02-13) + +### Bug Fixes + +* Fix bug where multiple compilations interfered with each other. [#369](https://github.com/webpack-contrib/sass-loader/pull/369) + + + +# [5.0.0](https://github.com/webpack-contrib/sass-loader/compare/v5.0.0...v4.1.1) (2017-02-13) + +### Code Refactoring + +* Remove synchronous compilation support [#334](https://github.com/webpack-contrib/sass-loader/pull/334) + + +### BREAKING CHANGES + +* Remove node 0.12 support. [29b30755021a834e622bf4b5bb9db4d6e5913905](https://github.com/webpack-contrib/sass-loader/commit/29b30755021a834e622bf4b5bb9db4d6e5913905) +* Remove official node-sass@3 and webpack@1 support. [5a6bcb96d8bd7a7a11c33252ba739ffe09ca38c5](https://github.com/webpack-contrib/sass-loader/commit/5a6bcb96d8bd7a7a11c33252ba739ffe09ca38c5) +* Remove synchronous compilation support. [#334](https://github.com/webpack-contrib/sass-loader/pull/334) + + + +# [4.1.1](https://github.com/webpack-contrib/sass-loader/compare/v4.1.1...v4.1.0) (2016-12-21) + +### Chore + +* Update webpack peer dependency to support 2.2.0rc. [#330](https://github.com/webpack-contrib/sass-loader/pull/330) + + + +# [4.1.0](https://github.com/webpack-contrib/sass-loader/compare/v4.1.0...v4.0.2) (2016-12-14) + +### Features + +* Update `node-sass@4.0.0` [#319](https://github.com/webpack-contrib/sass-loader/pull/319) + + + +# [4.0.2](https://github.com/webpack-contrib/sass-loader/compare/v4.0.2...v4.0.1) (2016-07-07) + +### Bug Fixes + +* Fix wrong context in customImporters [#281](https://github.com/webpack-contrib/sass-loader/pull/281) + + + +# [4.0.1](https://github.com/webpack-contrib/sass-loader/compare/v4.0.1...v4.0.0) (2016-07-01) + +### Bug Fixes + +* Fix custom importers receiving `'stdin'` as second argument instead of the actual `resourcePath` [#267](https://github.com/webpack-contrib/sass-loader/pull/267) + + + +# [4.0.0](https://github.com/webpack-contrib/sass-loader/compare/v4.0.0...v3.2.2) (2016-06-27) + +### Bug Fixes + +* Fix incorrect source map paths [#250](https://github.com/webpack-contrib/sass-loader/pull/250) + + +### BREAKING CHANGES + +* Release new major version because the previous release was a breaking change in certain scenarios + See: https://github.com/webpack-contrib/sass-loader/pull/250#issuecomment-228663059 + + + +# [3.2.2](https://github.com/webpack-contrib/sass-loader/compare/v3.2.2...v3.2.1) (2016-06-26) + +### Bug Fixes + +* Fix incorrect source map paths [#250](https://github.com/webpack-contrib/sass-loader/pull/250) + + + +# [3.2.1](https://github.com/webpack-contrib/sass-loader/compare/v3.2.1...v3.2.0) (2016-06-19) + +### Bug Fixes + +* Add `webpack@^2.1.0-beta` as peer dependency [#233](https://github.com/webpack-contrib/sass-loader/pull/233) + + + +# [3.2.0](https://github.com/webpack-contrib/sass-loader/compare/v3.2.0...v3.1.2) (2016-03-12) + +### Features + +* Append file content instead of overwriting when `data`-option is already present [#216](https://github.com/webpack-contrib/sass-loader/pull/216) +* Make `indentedSyntax` option a bit smarter [#196](https://github.com/webpack-contrib/sass-loader/pull/196) + + + +# [3.1.2](https://github.com/webpack-contrib/sass-loader/compare/v3.1.2...v3.1.1) (2015-11-22) + +### Bug Fixes + +* Fix loader query not overriding webpack config [#189](https://github.com/webpack-contrib/sass-loader/pull/189) +* Update peer-dependencies [#182](https://github.com/webpack-contrib/sass-loader/pull/182) + - `node-sass^3.4.2` + - `webpack^1.12.6` + + + +# [3.1.1](https://github.com/webpack-contrib/sass-loader/compare/v3.1.1...v3.1.0) (2015-10-26) + +### Bug Fixes + +* Fix missing module `object-assign` [#178](https://github.com/webpack-contrib/sass-loader/issues/178) + + + +# [3.1.0](https://github.com/webpack-contrib/sass-loader/compare/v3.1.0...v3.0.0) (2015-10-25) + +### Bug Fixes + +* Fix a problem where modules with a `.` in their names were not resolved [#167](https://github.com/webpack-contrib/sass-loader/issues/167) + + +### Features + +* Add possibility to also define all options in your `webpack.config.js` [#152](https://github.com/webpack-contrib/sass-loader/pull/152) [#170](https://github.com/webpack-contrib/sass-loader/pull/170) + + + +# [3.0.0](https://github.com/webpack-contrib/sass-loader/compare/v3.0.0...v2.0.1) (2015-09-29) + +### Bug Fixes + +* Fix crash when Sass reported an error without `file` [#158](https://github.com/webpack-contrib/sass-loader/pull/158) + + +### BREAKING CHANGES + +* Add `node-sass@^3.3.3` and `webpack@^1.12.2` as peer-dependency [#165](https://github.com/webpack-contrib/sass-loader/pull/165) [#166](https://github.com/webpack-contrib/sass-loader/pull/166) [#169](https://github.com/webpack-contrib/sass-loader/pull/169) + + + +# [2.0.1](https://github.com/webpack-contrib/sass-loader/compare/v2.0.1...v2.0.0) (2015-08-14) + +### Bug Fixes + +* Add missing path normalization (fixes [#141](https://github.com/webpack-contrib/sass-loader/pull/141)) + + + +# [2.0.0](https://github.com/webpack-contrib/sass-loader/compare/v2.0.0...v1.0.4) (2015-08-06) + +### Bug Fixes + +* Add temporary fix for stuck processes (see [sass/node-sass#857](https://github.com/sass/node-sass/issues/857)) [#100](https://github.com/webpack-contrib/sass-loader/issues/100) [#119](https://github.com/webpack-contrib/sass-loader/issues/119) [#132](https://github.com/webpack-contrib/sass-loader/pull/132) +* Fix path resolving on Windows [#108](https://github.com/webpack-contrib/sass-loader/issues/108) +* Fix file watchers on Windows [#102](https://github.com/webpack-contrib/sass-loader/issues/102) +* Fix file watchers for files with errors [#134](https://github.com/webpack-contrib/sass-loader/pull/134) + + +### Code Refactoring + +* Refactor [import resolving algorithm](https://github.com/webpack-contrib/sass-loader/blob/089c52dc9bd02ec67fb5c65c2c226f43710f231c/index.js#L293-L348). ([#138](https://github.com/webpack-contrib/sass-loader/issues/138)) ([c8621a1](https://github.com/webpack-contrib/sass-loader/commit/80944ccf09cd9716a100160c068d255c5d742338)) + + +### BREAKING CHANGES + +* The new algorithm is aligned to libsass' way of resolving files. This yields to different results if two files with the same path and filename but with different extensions are present. Though this change should be no problem for most users, we must flag it as breaking change. [#135](https://github.com/webpack-contrib/sass-loader/issues/135) [#138](https://github.com/webpack-contrib/sass-loader/issues/138) + + + +# [1.0.4](https://github.com/webpack-contrib/sass-loader/compare/v1.0.4...v1.0.3) (2015-08-03) + +### Bug Fixes + +* Fix wrong source-map urls [#123](https://github.com/webpack-contrib/sass-loader/pull/123) +* Include source-map contents by default [#104](https://github.com/webpack-contrib/sass-loader/pull/104) + + + +# [1.0.3](https://github.com/webpack-contrib/sass-loader/compare/v1.0.3...v1.0.2) (2015-07-22) + +### Bug Fixes + +* Fix importing css files from scss/sass [#101](https://github.com/webpack-contrib/sass-loader/issues/101) +* Fix importing Sass partials from includePath [#98](https://github.com/webpack-contrib/sass-loader/issues/98) [#110](https://github.com/webpack-contrib/sass-loader/issues/110) + + + +# [1.0.2](https://github.com/webpack-contrib/sass-loader/compare/v1.0.2...v1.0.1) (2015-04-15) + +### Bug Fixes + +* Fix a bug where files could not be imported across language styles [#73](https://github.com/webpack-contrib/sass-loader/issues/73) +* Update peer-dependency `node-sass` to `3.1.0` + + + +# [1.0.1](https://github.com/webpack-contrib/sass-loader/compare/v1.0.1...v1.0.0) (2015-03-31) + +### Bug Fixes + +* Fix Sass partials not being resolved anymore [#68](https://github.com/webpack-contrib/sass-loader/issues/68) +* Update peer-dependency `node-sass` to `3.0.0-beta.4` + + + +# [1.0.0](https://github.com/webpack-contrib/sass-loader/compare/v1.0.0...v0.3.1) (2015-03-22) + +### Bug Fixes + +* Moved `node-sass^3.0.0-alpha.0` to `peerDependencies` [#28](https://github.com/webpack-contrib/sass-loader/issues/28) +* Using webpack's module resolver as custom importer [#39](https://github.com/webpack-contrib/sass-loader/issues/31) +* Add synchronous compilation support for usage with [enhanced-require](https://github.com/webpack/enhanced-require) [#39](https://github.com/webpack-contrib/sass-loader/pull/39) diff --git a/node_modules/sass-loader/LICENSE b/node_modules/sass-loader/LICENSE new file mode 100644 index 0000000..3d5fa73 --- /dev/null +++ b/node_modules/sass-loader/LICENSE @@ -0,0 +1,20 @@ +Copyright JS Foundation and other contributors + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/node_modules/sass-loader/README.md b/node_modules/sass-loader/README.md new file mode 100644 index 0000000..c2c3f63 --- /dev/null +++ b/node_modules/sass-loader/README.md @@ -0,0 +1,606 @@ +
+ + + + +
+ +[![npm][npm]][npm-url] +[![node][node]][node-url] +[![deps][deps]][deps-url] +[![tests][tests]][tests-url] +[![coverage][cover]][cover-url] +[![chat][chat]][chat-url] +[![size][size]][size-url] + +# sass-loader + +Loads a Sass/SCSS file and compiles it to CSS. + +## Getting Started + +To begin, you'll need to install `sass-loader`: + +```console +npm install sass-loader node-sass webpack --save-dev +``` + +`sass-loader` requires you to install either [Node Sass](https://github.com/sass/node-sass) or [Dart Sass](https://github.com/sass/dart-sass) on your own (more documentation can be found below). +This allows you to control the versions of all your dependencies, and to choose which Sass implementation to use. + +Chain the `sass-loader` with the [css-loader](https://github.com/webpack-contrib/css-loader) and the [style-loader](https://github.com/webpack-contrib/style-loader) to immediately apply all styles to the DOM or the [mini-css-extract-plugin](https://github.com/webpack-contrib/mini-css-extract-plugin) to extract it into a separate file. + +Then add the loader to your Webpack configuration. For example: + +**app.js** + +```js +import './style.scss'; +``` + +**style.scss** + +```scss +$body-color: red; + +body { + color: $body-color; +} +``` + +**webpack.config.js** + +```js +module.exports = { + module: { + rules: [ + { + test: /\.s[ac]ss$/i, + use: [ + // Creates `style` nodes from JS strings + 'style-loader', + // Translates CSS into CommonJS + 'css-loader', + // Compiles Sass to CSS + 'sass-loader', + ], + }, + ], + }, +}; +``` + +Finally run `webpack` via your preferred method. + +### Resolving `import` at-rules + +Webpack provides an [advanced mechanism to resolve files](https://webpack.js.org/concepts/module-resolution/). + +The `sass-loader` uses Sass's custom importer feature to pass all queries to the Webpack resolving engine. Thus you can import your Sass modules from `node_modules`. Just prepend them with a `~` to tell Webpack that this is not a relative import: + +```scss +@import '~bootstrap'; +``` + +It's important to only prepend it with `~`, because `~/` resolves to the home directory. +Webpack needs to distinguish between `bootstrap` and `~bootstrap` because CSS and Sass files have no special syntax for importing relative files. +Writing `@import "style.scss"` is the same as `@import "./style.scss";` + +### Problems with `url(...)` + +Since Sass implementations don't provide [url rewriting](https://github.com/sass/libsass/issues/532), all linked assets must be relative to the output. + +- If you pass the generated CSS on to the `css-loader`, all urls must be relative to the entry-file (e.g. `main.scss`). +- If you're just generating CSS without passing it to the `css-loader`, it must be relative to your web root. + +You will be disrupted by this first issue. It is natural to expect relative references to be resolved against the `.sass`/`.scss` file in which they are specified (like in regular `.css` files). + +Thankfully there are a two solutions to this problem: + +- Add the missing url rewriting using the [resolve-url-loader](https://github.com/bholloway/resolve-url-loader). Place it before `sass-loader` in the loader chain. +- Library authors usually provide a variable to modify the asset path. [bootstrap-sass](https://github.com/twbs/bootstrap-sass) for example has an `$icon-font-path`. + +## Options + +### `implementation` + +The special `implementation` option determines which implementation of Sass to use. + +By default the loader resolve the implementation based on your dependencies. +Just add required implementation to `package.json` (`node-sass` or `sass` package) and install dependencies. + +Example where the `sass-loader` loader uses the `sass` (`dart-sass`) implementation: + +**package.json** + +```json +{ + "devDependencies": { + "sass-loader": "^7.2.0", + "sass": "^1.22.10" + } +} +``` + +Example where the `sass-loader` loader uses the `node-sass` implementation: + +**package.json** + +```json +{ + "devDependencies": { + "sass-loader": "^7.2.0", + "node-sass": "^4.0.0" + } +} +``` + +Beware the situation when `node-sass` and `sass` were installed! By default the `sass-loader` prefers `node-sass`. In order to avoid this situation you can use the `implementation` option. + +The `implementation` options either accepts `node-sass` or `sass` (`Dart Sass`) as a module. + +For example, to use Dart Sass, you'd pass: + +```js +module.exports = { + module: { + rules: [ + { + test: /\.s[ac]ss$/i, + use: [ + 'style-loader', + 'css-loader', + { + loader: 'sass-loader', + options: { + // Prefer `dart-sass` + implementation: require('sass'), + }, + }, + ], + }, + ], + }, +}; +``` + +Note that when using `sass` (`Dart Sass`), **synchronous compilation is twice as fast as asynchronous compilation** by default, due to the overhead of asynchronous callbacks. +To avoid this overhead, you can use the [fibers](https://www.npmjs.com/package/fibers) package to call asynchronous importers from the synchronous code path. + +We automatically inject the [`fibers`](https://github.com/laverdet/node-fibers) package (setup `sassOptions.fiber`) if is possible (i.e. you need install the [`fibers`](https://github.com/laverdet/node-fibers) package). + +**package.json** + +```json +{ + "devDependencies": { + "sass-loader": "^7.2.0", + "sass": "^1.22.10", + "fibers": "^4.0.1" + } +} +``` + +You can disable automatically injecting the [`fibers`](https://github.com/laverdet/node-fibers) package by passing a `false` value for the `sassOptions.fiber` option. + +**webpack.config.js** + +```js +module.exports = { + module: { + rules: [ + { + test: /\.s[ac]ss$/i, + use: [ + 'style-loader', + 'css-loader', + { + loader: 'sass-loader', + options: { + implementation: require('sass'), + sassOptions: { + fiber: false, + }, + }, + }, + ], + }, + ], + }, +}; +``` + +You can also pass the `fiber` value using this code: + +**webpack.config.js** + +```js +module.exports = { + module: { + rules: [ + { + test: /\.s[ac]ss$/i, + use: [ + 'style-loader', + 'css-loader', + { + loader: 'sass-loader', + options: { + implementation: require('sass'), + sassOptions: { + fiber: require('fibers'), + }, + }, + }, + ], + }, + ], + }, +}; +``` + +### `sassOptions` + +Type: `Object|Function` + +Options for [Node Sass](https://github.com/sass/node-sass) or [Dart Sass](http://sass-lang.com/dart-sass) implementation. + +> ℹ️ The `indentedSyntax` option has `true` value for the `sass` extension. + +> ℹ️ Options such as `file` and `outFile` are unavailable. + +> ℹ We recommend not to use the `sourceMapContents`, `sourceMapEmbed`, `sourceMapRoot` options because `sass-loader` automatically sets these options. + +There is a slight difference between the `node-sass` and `sass` (`Dart Sass`) options. +Please consult documentation before using them: + +- [Node Sass documentation](https://github.com/sass/node-sass/#options) for all available `node-sass` options. +- [Dart Sass documentation](https://github.com/sass/dart-sass#javascript-api) for all available `sass` options. + +#### `Object` + +Use and object for the Sass implementation setup. + +**webpack.config.js** + +```js +module.exports = { + module: { + rules: [ + { + test: /\.s[ac]ss$/i, + use: [ + 'style-loader', + 'css-loader', + { + loader: 'sass-loader', + options: { + sassOptions: { + indentWidth: 4, + includePaths: ['absolute/path/a', 'absolute/path/b'], + }, + }, + }, + ], + }, + ], + }, +}; +``` + +#### `Function` + +Allows to setup the Sass implementation by setting different options based on the loader context. + +```js +module.exports = { + module: { + rules: [ + { + test: /\.s[ac]ss$/i, + use: [ + 'style-loader', + 'css-loader', + { + loader: 'sass-loader', + options: { + sassOptions: (loaderContext) => { + // More information about available properties https://webpack.js.org/api/loaders/ + const { resourcePath, rootContext } = loaderContext; + const relativePath = path.relative(rootContext, resourcePath); + + if (relativePath === 'styles/foo.scss') { + return { + includePaths: ['absolute/path/c', 'absolute/path/d'], + }; + } + + return { + includePaths: ['absolute/path/a', 'absolute/path/b'], + }; + }, + }, + }, + ], + }, + ], + }, +}; +``` + +### `prependData` + +Type: `String|Function` +Default: `undefined` + +Prepends `Sass`/`SCSS` code before the actual entry file. +In this case, the `sass-loader` will not override the `data` option but just append the entry's content. + +This is especially useful when some of your Sass variables depend on the environment: + +> ℹ Since you're injecting code, this will break the source mappings in your entry file. Often there's a simpler solution than this, like multiple Sass entry files. + +#### `String` + +```js +module.exports = { + module: { + rules: [ + { + test: /\.s[ac]ss$/i, + use: [ + 'style-loader', + 'css-loader', + { + loader: 'sass-loader', + options: { + prependData: '$env: ' + process.env.NODE_ENV + ';', + }, + }, + ], + }, + ], + }, +}; +``` + +#### `Function` + +```js +module.exports = { + module: { + rules: [ + { + test: /\.s[ac]ss$/i, + use: [ + 'style-loader', + 'css-loader', + { + loader: 'sass-loader', + options: { + prependData: (loaderContext) => { + // More information about available properties https://webpack.js.org/api/loaders/ + const { resourcePath, rootContext } = loaderContext; + const relativePath = path.relative(rootContext, resourcePath); + + if (relativePath === 'styles/foo.scss') { + return '$value: 100px;'; + } + + return '$value: 200px;'; + }, + }, + }, + ], + }, + ], + }, +}; +``` + +### `sourceMap` + +Type: `Boolean` +Default: depends on the `compiler.devtool` value + +Enables/Disables generation of source maps. + +By default generation of source maps depends on the [`devtool`](https://webpack.js.org/configuration/devtool/) option. All values enable source map generation except `eval` and `false` value. + +**webpack.config.js** + +```js +module.exports = { + module: { + rules: [ + { + test: /\.s[ac]ss$/i, + use: [ + 'style-loader', + { + loader: 'css-loader', + options: { + sourceMap: true, + }, + }, + { + loader: 'sass-loader', + options: { + sourceMap: true, + }, + }, + ], + }, + ], + }, +}; +``` + +> ℹ In some rare cases `node-sass` can output invalid source maps (it is a `node-sass` bug). +> In order to avoid this, you can try to update `node-sass` to latest version or you can try to set within `sassOptions` the `outputStyle` option to `compressed`. + +**webpack.config.js** + +```js +module.exports = { + module: { + rules: [ + { + test: /\.s[ac]ss$/i, + use: [ + 'style-loader', + 'css-loader', + { + loader: 'sass-loader', + sourceMap: true, + sassOptions: { + outputStyle: 'compressed', + }, + }, + ], + }, + ], + }, +}; +``` + +### `webpackImporter` + +Type: `Boolean` +Default: `true` + +Enables/Disables the default Webpack importer. + +This can improve performance in some cases. Use it with caution because aliases and `@import` at-rules starting with `~` will not work. You can pass own `importer` to solve this (see [`importer docs`](https://github.com/sass/node-sass#importer--v200---experimental)). + +**webpack.config.js** + +```js +module.exports = { + module: { + rules: [ + { + test: /\.s[ac]ss$/i, + use: [ + 'style-loader', + 'css-loader', + { + loader: 'sass-loader', + options: { + webpackImporter: false, + }, + }, + ], + }, + ], + }, +}; +``` + +## Examples + +### Extracts CSS into separate files + +For production builds it's recommended to extract the CSS from your bundle being able to use parallel loading of CSS/JS resources later on. + +There are two possibilities to extract a style sheet from the bundle: + +- [mini-css-extract-plugin](https://github.com/webpack-contrib/mini-css-extract-plugin) (use this, when using webpack 4 configuration. Works in all use-cases) +- [extract-loader](https://github.com/peerigon/extract-loader) (simpler, but specialized on the css-loader's output) + +**webpack.config.js** + +```js +const MiniCssExtractPlugin = require('mini-css-extract-plugin'); + +module.exports = { + module: { + rules: [ + { + test: /\.s[ac]ss$/i, + use: [ + // fallback to style-loader in development + process.env.NODE_ENV !== 'production' + ? 'style-loader' + : MiniCssExtractPlugin.loader, + 'css-loader', + 'sass-loader', + ], + }, + ], + }, + plugins: [ + new MiniCssExtractPlugin({ + // Options similar to the same options in webpackOptions.output + // both options are optional + filename: '[name].css', + chunkFilename: '[id].css', + }), + ], +}; +``` + +### Source maps + +Enables/Disables generation of source maps. + +To enable CSS source maps, you'll need to pass the `sourceMap` option to the `sass-loader` _and_ the css-loader. + +**webpack.config.js** + +```javascript +module.exports = { + devtool: 'source-map', // any "source-map"-like devtool is possible + module: { + rules: [ + { + test: /\.scss$/, + use: [ + 'style-loader', + { + loader: 'css-loader', + options: { + sourceMap: true, + }, + }, + { + loader: 'sass-loader', + options: { + sourceMap: true, + }, + }, + ], + }, + ], + }, +}; +``` + +If you want to edit the original Sass files inside Chrome, [there's a good blog post](https://medium.com/@toolmantim/getting-started-with-css-sourcemaps-and-in-browser-sass-editing-b4daab987fb0). Checkout [test/sourceMap](https://github.com/webpack-contrib/sass-loader/tree/master/test) for a running example. + +## Contributing + +Please take a moment to read our contributing guidelines if you haven't yet done so. + +[CONTRIBUTING](./.github/CONTRIBUTING.md) + +## License + +[MIT](./LICENSE) + +[npm]: https://img.shields.io/npm/v/sass-loader.svg +[npm-url]: https://npmjs.com/package/sass-loader +[node]: https://img.shields.io/node/v/sass-loader.svg +[node-url]: https://nodejs.org +[deps]: https://david-dm.org/webpack-contrib/sass-loader.svg +[deps-url]: https://david-dm.org/webpack-contrib/sass-loader +[tests]: https://dev.azure.com/webpack-contrib/sass-loader/_apis/build/status/webpack-contrib.sass-loader?branchName=master +[tests-url]: https://dev.azure.com/webpack-contrib/sass-loader/_build/latest?definitionId=21&branchName=master +[cover]: https://codecov.io/gh/webpack-contrib/sass-loader/branch/master/graph/badge.svg +[cover-url]: https://codecov.io/gh/webpack-contrib/sass-loader +[chat]: https://badges.gitter.im/webpack/webpack.svg +[chat-url]: https://gitter.im/webpack/webpack +[size]: https://packagephobia.now.sh/badge?p=css-loader +[size-url]: https://packagephobia.now.sh/result?p=css-loader diff --git a/node_modules/sass-loader/dist/SassError.js b/node_modules/sass-loader/dist/SassError.js new file mode 100644 index 0000000..49cd96d --- /dev/null +++ b/node_modules/sass-loader/dist/SassError.js @@ -0,0 +1,33 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +class SassError extends Error { + constructor(sassError, resourcePath) { + super(); + this.name = 'SassError'; + this.originalSassError = sassError; + this.loc = { + line: sassError.line, + column: sassError.column + }; // Keep original error if `sassError.formatted` is unavailable + + this.message = `${this.name}: ${this.originalSassError.message}`; + + if (this.originalSassError.formatted) { + this.message = `${this.name}: ${this.originalSassError.formatted.replace(/^Error: /, '').replace(/(\s*)stdin(\s*)/, `$1${resourcePath}$2`)}`; // Instruct webpack to hide the JS stack from the console. + // Usually you're only interested in the SASS stack in this case. + // eslint-disable-next-line no-param-reassign + + this.hideStack = true; + Error.captureStackTrace(this, this.constructor); + } + } + +} + +var _default = SassError; +exports.default = _default; \ No newline at end of file diff --git a/node_modules/sass-loader/dist/cjs.js b/node_modules/sass-loader/dist/cjs.js new file mode 100644 index 0000000..7b95573 --- /dev/null +++ b/node_modules/sass-loader/dist/cjs.js @@ -0,0 +1,5 @@ +"use strict"; + +const loader = require('./index'); + +module.exports = loader.default; \ No newline at end of file diff --git a/node_modules/sass-loader/dist/getDefaultSassImplementation.js b/node_modules/sass-loader/dist/getDefaultSassImplementation.js new file mode 100644 index 0000000..0cfd8ba --- /dev/null +++ b/node_modules/sass-loader/dist/getDefaultSassImplementation.js @@ -0,0 +1,28 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +function getDefaultSassImplementation() { + let sassImplPkg = 'node-sass'; + + try { + require.resolve('node-sass'); + } catch (error) { + try { + require.resolve('sass'); + + sassImplPkg = 'sass'; + } catch (ignoreError) { + sassImplPkg = 'node-sass'; + } + } // eslint-disable-next-line import/no-dynamic-require, global-require + + + return require(sassImplPkg); +} + +var _default = getDefaultSassImplementation; +exports.default = _default; \ No newline at end of file diff --git a/node_modules/sass-loader/dist/getRenderFunctionFromSassImplementation.js b/node_modules/sass-loader/dist/getRenderFunctionFromSassImplementation.js new file mode 100644 index 0000000..02d866d --- /dev/null +++ b/node_modules/sass-loader/dist/getRenderFunctionFromSassImplementation.js @@ -0,0 +1,39 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _neoAsync = _interopRequireDefault(require("neo-async")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +let nodeSassJobQueue = null; +/** + * Verifies that the implementation and version of Sass is supported by this loader. + * + * @param {Object} implementation + * @returns {Function} + */ + +function getRenderFunctionFromSassImplementation(implementation) { + const isDartSass = implementation.info.includes('dart-sass'); + + if (isDartSass) { + return implementation.render.bind(implementation); + } // There is an issue with node-sass when async custom importers are used + // See https://github.com/sass/node-sass/issues/857#issuecomment-93594360 + // We need to use a job queue to make sure that one thread is always available to the UV lib + + + if (nodeSassJobQueue === null) { + const threadPoolSize = Number(process.env.UV_THREADPOOL_SIZE || 4); + nodeSassJobQueue = _neoAsync.default.queue(implementation.render.bind(implementation), threadPoolSize - 1); + } + + return nodeSassJobQueue.push.bind(nodeSassJobQueue); +} + +var _default = getRenderFunctionFromSassImplementation; +exports.default = _default; \ No newline at end of file diff --git a/node_modules/sass-loader/dist/getSassImplementation.js b/node_modules/sass-loader/dist/getSassImplementation.js new file mode 100644 index 0000000..3282891 --- /dev/null +++ b/node_modules/sass-loader/dist/getSassImplementation.js @@ -0,0 +1,56 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _semver = _interopRequireDefault(require("semver")); + +var _getDefaultSassImplementation = _interopRequireDefault(require("./getDefaultSassImplementation")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function getSassImplementation(implementation) { + let resolvedImplementation = implementation; + + if (!resolvedImplementation) { + // eslint-disable-next-line no-param-reassign + resolvedImplementation = (0, _getDefaultSassImplementation.default)(); + } + + const { + info + } = resolvedImplementation; + + if (!info) { + throw new Error('Unknown Sass implementation.'); + } + + const infoParts = info.split('\t'); + + if (infoParts.length < 2) { + throw new Error(`Unknown Sass implementation "${info}".`); + } + + const [implementationName, version] = infoParts; + + if (implementationName === 'dart-sass') { + if (!_semver.default.satisfies(version, '^1.3.0')) { + throw new Error(`Dart Sass version ${version} is incompatible with ^1.3.0.`); + } + + return resolvedImplementation; + } else if (implementationName === 'node-sass') { + if (!_semver.default.satisfies(version, '^4.0.0')) { + throw new Error(`Node Sass version ${version} is incompatible with ^4.0.0.`); + } + + return resolvedImplementation; + } + + throw new Error(`Unknown Sass implementation "${implementationName}".`); +} + +var _default = getSassImplementation; +exports.default = _default; \ No newline at end of file diff --git a/node_modules/sass-loader/dist/getSassOptions.js b/node_modules/sass-loader/dist/getSassOptions.js new file mode 100644 index 0000000..dee95cd --- /dev/null +++ b/node_modules/sass-loader/dist/getSassOptions.js @@ -0,0 +1,116 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _os = _interopRequireDefault(require("os")); + +var _path = _interopRequireDefault(require("path")); + +var _cloneDeep = _interopRequireDefault(require("clone-deep")); + +var _proxyCustomImporters = _interopRequireDefault(require("./proxyCustomImporters")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function isProductionLikeMode(loaderContext) { + return loaderContext.mode === 'production' || !loaderContext.mode || loaderContext.minimize; +} +/** + * Derives the sass options from the loader context and normalizes its values with sane defaults. + * + * @param {object} loaderContext + * @param {object} loaderOptions + * @param {string} content + * @param {object} implementation + * @returns {Object} + */ + + +function getSassOptions(loaderContext, loaderOptions, content, implementation) { + const options = (0, _cloneDeep.default)(loaderOptions.sassOptions ? typeof loaderOptions.sassOptions === 'function' ? loaderOptions.sassOptions(loaderContext) || {} : loaderOptions.sassOptions : {}); + const isDartSass = implementation.info.includes('dart-sass'); + + if (isDartSass) { + const shouldTryToResolveFibers = !options.fiber && options.fiber !== false; + + if (shouldTryToResolveFibers) { + let fibers; + + try { + fibers = require.resolve('fibers'); + } catch (_error) {// Nothing + } + + if (fibers) { + // eslint-disable-next-line global-require, import/no-dynamic-require + options.fiber = require(fibers); + } + } else if (options.fiber === false) { + // Don't pass the `fiber` option for `sass` (`Dart Sass`) + delete options.fiber; + } + } else { + // Don't pass the `fiber` option for `node-sass` + delete options.fiber; + } + + options.data = loaderOptions.prependData ? typeof loaderOptions.prependData === 'function' ? loaderOptions.prependData(loaderContext) + _os.default.EOL + content : loaderOptions.prependData + _os.default.EOL + content : content; // opt.outputStyle + + if (!options.outputStyle && isProductionLikeMode(loaderContext)) { + options.outputStyle = 'compressed'; + } + + const useSourceMap = typeof loaderOptions.sourceMap === 'boolean' ? loaderOptions.sourceMap : loaderContext.sourceMap; // opt.sourceMap + // Not using the `this.sourceMap` flag because css source maps are different + // @see https://github.com/webpack/css-loader/pull/40 + + if (useSourceMap) { + // Deliberately overriding the sourceMap option here. + // node-sass won't produce source maps if the data option is used and options.sourceMap is not a string. + // In case it is a string, options.sourceMap should be a path where the source map is written. + // But since we're using the data option, the source map will not actually be written, but + // all paths in sourceMap.sources will be relative to that path. + // Pretty complicated... :( + options.sourceMap = _path.default.join(process.cwd(), '/sass.map'); + + if ('sourceMapRoot' in options === false) { + options.sourceMapRoot = process.cwd(); + } + + if ('omitSourceMapUrl' in options === false) { + // The source map url doesn't make sense because we don't know the output path + // The css-loader will handle that for us + options.omitSourceMapUrl = true; + } + + if ('sourceMapContents' in options === false) { + // If sourceMapContents option is not set, set it to true otherwise maps will be empty/null + // when exported by webpack-extract-text-plugin. + options.sourceMapContents = true; + } + } + + const { + resourcePath + } = loaderContext; + + const ext = _path.default.extname(resourcePath); // If we are compiling sass and indentedSyntax isn't set, automatically set it. + + + if (ext && ext.toLowerCase() === '.sass' && 'indentedSyntax' in options === false) { + options.indentedSyntax = true; + } else { + options.indentedSyntax = Boolean(options.indentedSyntax); + } // Allow passing custom importers to `node-sass`. Accepts `Function` or an array of `Function`s. + + + options.importer = options.importer ? (0, _proxyCustomImporters.default)(options.importer, resourcePath) : []; + options.includePaths = (options.includePaths || []).concat(_path.default.dirname(resourcePath)); + return options; +} + +var _default = getSassOptions; +exports.default = _default; \ No newline at end of file diff --git a/node_modules/sass-loader/dist/importsToResolve.js b/node_modules/sass-loader/dist/importsToResolve.js new file mode 100644 index 0000000..b68acd4 --- /dev/null +++ b/node_modules/sass-loader/dist/importsToResolve.js @@ -0,0 +1,88 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _path = _interopRequireDefault(require("path")); + +var _loaderUtils = _interopRequireDefault(require("loader-utils")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +// Examples: +// - ~package +// - ~package/ +// - ~@org +// - ~@org/ +// - ~@org/package +// - ~@org/package/ +const matchModuleImport = /^~([^/]+|[^/]+\/|@[^/]+[/][^/]+|@[^/]+\/?|@[^/]+[/][^/]+\/)$/; +/** + * When libsass tries to resolve an import, it uses a special algorithm. + * Since the sass-loader uses webpack to resolve the modules, we need to simulate that algorithm. This function + * returns an array of import paths to try. The last entry in the array is always the original url + * to enable straight-forward webpack.config aliases. + * + * @param {string} url + * @returns {Array} + */ + +function importsToResolve(url) { + const request = _loaderUtils.default.urlToRequest(url); // Keep in mind: ext can also be something like '.datepicker' when the true extension is omitted and the filename contains a dot. + // @see https://github.com/webpack-contrib/sass-loader/issues/167 + + + const ext = _path.default.extname(request).toLowerCase(); // In case there is module request, send this to webpack resolver + + + if (matchModuleImport.test(url)) { + return [request, url]; + } // Because @import is also defined in CSS, Sass needs a way of compiling plain CSS @imports without trying to import the files at compile time. + // To accomplish this, and to ensure SCSS is as much of a superset of CSS as possible, Sass will compile any @imports with the following characteristics to plain CSS imports: + // - imports where the URL ends with .css. + // - imports where the URL begins http:// or https://. + // - imports where the URL is written as a url(). + // - imports that have media queries. + // + // The `node-sass` package sends `@import` ending on `.css` to importer, it is bug, so we skip resolve + + + if (ext === '.css') { + return []; + } + + const dirname = _path.default.dirname(request); + + const basename = _path.default.basename(request); // In case there is file extension: + // + // 1. Try to resolve `_` file. + // 2. Try to resolve file without `_`. + // 3. Send a original url to webpack resolver, maybe it is alias. + + + if (['.scss', '.sass'].includes(ext)) { + return [`${dirname}/_${basename}`, `${dirname}/${basename}`, url]; + } // In case there is no file extension and filename starts with `_`: + // + // 1. Try to resolve files with `scss`, `sass` and `css` extensions. + // 2. Try to resolve directory with `_index` or `index` filename. + // 3. Send the original url to webpack resolver, maybe it's alias. + + + if (basename.startsWith('_')) { + return [`${request}.scss`, `${request}.sass`, `${request}.css`, request, url]; + } // In case there is no file extension and filename doesn't start with `_`: + // + // 1. Try to resolve file starts with `_` and with extensions + // 2. Try to resolve file with extensions + // 3. Try to resolve directory with `_index` or `index` filename. + // 4. Send a original url to webpack resolver, maybe it is alias. + + + return [`${dirname}/_${basename}.scss`, `${dirname}/_${basename}.sass`, `${dirname}/_${basename}.css`, `${request}.scss`, `${request}.sass`, `${request}.css`, request, url]; +} + +var _default = importsToResolve; +exports.default = _default; \ No newline at end of file diff --git a/node_modules/sass-loader/dist/index.js b/node_modules/sass-loader/dist/index.js new file mode 100644 index 0000000..bfdb5e0 --- /dev/null +++ b/node_modules/sass-loader/dist/index.js @@ -0,0 +1,114 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _path = _interopRequireDefault(require("path")); + +var _schemaUtils = _interopRequireDefault(require("schema-utils")); + +var _loaderUtils = require("loader-utils"); + +var _options = _interopRequireDefault(require("./options.json")); + +var _getSassImplementation = _interopRequireDefault(require("./getSassImplementation")); + +var _getSassOptions = _interopRequireDefault(require("./getSassOptions")); + +var _webpackImporter = _interopRequireDefault(require("./webpackImporter")); + +var _getRenderFunctionFromSassImplementation = _interopRequireDefault(require("./getRenderFunctionFromSassImplementation")); + +var _SassError = _interopRequireDefault(require("./SassError")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The sass-loader makes node-sass and dart-sass available to webpack modules. + * + * @this {object} + * @param {string} content + */ +function loader(content) { + const options = (0, _loaderUtils.getOptions)(this) || {}; + (0, _schemaUtils.default)(_options.default, options, { + name: 'Sass Loader', + baseDataPath: 'options' + }); + const implementation = (0, _getSassImplementation.default)(options.implementation); + const callback = this.async(); + + const addNormalizedDependency = file => { + // node-sass returns POSIX paths + this.addDependency(_path.default.normalize(file)); + }; + + const sassOptions = (0, _getSassOptions.default)(this, options, content, implementation); + const shouldUseWebpackImporter = typeof options.webpackImporter === 'boolean' ? options.webpackImporter : true; + + if (shouldUseWebpackImporter) { + const resolve = this.getResolve({ + mainFields: ['sass', 'style', 'main', '...'], + mainFiles: ['_index', 'index', '...'], + extensions: ['.scss', '.sass', '.css', '...'] + }); + sassOptions.importer.push((0, _webpackImporter.default)(this.resourcePath, resolve, addNormalizedDependency)); + } // Skip empty files, otherwise it will stop webpack, see issue #21 + + + if (sassOptions.data.trim() === '') { + callback(null, ''); + return; + } + + const render = (0, _getRenderFunctionFromSassImplementation.default)(implementation); + render(sassOptions, (error, result) => { + if (error) { + if (error.file) { + addNormalizedDependency(error.file); + } + + callback(new _SassError.default(error, this.resourcePath)); + return; + } + + if (result.map && result.map !== '{}') { + // eslint-disable-next-line no-param-reassign + result.map = JSON.parse(result.map); // result.map.file is an optional property that provides the output filename. + // Since we don't know the final filename in the webpack build chain yet, it makes no sense to have it. + // eslint-disable-next-line no-param-reassign + + delete result.map.file; // One of the sources is 'stdin' according to dart-sass/node-sass because we've used the data input. + // Now let's override that value with the correct relative path. + // Since we specified options.sourceMap = path.join(process.cwd(), "/sass.map"); in getSassOptions, + // we know that this path is relative to process.cwd(). This is how node-sass works. + // eslint-disable-next-line no-param-reassign + + const stdinIndex = result.map.sources.findIndex(source => source.includes('stdin')); + + if (stdinIndex !== -1) { + // eslint-disable-next-line no-param-reassign + result.map.sources[stdinIndex] = _path.default.relative(process.cwd(), this.resourcePath); + } // node-sass returns POSIX paths, that's why we need to transform them back to native paths. + // This fixes an error on windows where the source-map module cannot resolve the source maps. + // @see https://github.com/webpack-contrib/sass-loader/issues/366#issuecomment-279460722 + // eslint-disable-next-line no-param-reassign + + + result.map.sourceRoot = _path.default.normalize(result.map.sourceRoot); // eslint-disable-next-line no-param-reassign + + result.map.sources = result.map.sources.map(_path.default.normalize); + } else { + // eslint-disable-next-line no-param-reassign + result.map = null; + } + + result.stats.includedFiles.forEach(addNormalizedDependency); + callback(null, result.css.toString(), result.map); + }); +} + +var _default = loader; +exports.default = _default; \ No newline at end of file diff --git a/node_modules/sass-loader/dist/options.json b/node_modules/sass-loader/dist/options.json new file mode 100644 index 0000000..3430c7d --- /dev/null +++ b/node_modules/sass-loader/dist/options.json @@ -0,0 +1,41 @@ +{ + "type": "object", + "properties": { + "implementation": { + "description": "The implementation of the sass to be used (https://github.com/webpack-contrib/sass-loader#implementation).", + "type": "object" + }, + "sassOptions": { + "description": "Options for `node-sass` or `sass` (`Dart Sass`) implementation. (https://github.com/webpack-contrib/sass-loader#implementation).", + "anyOf": [ + { + "type": "object", + "additionalProperties": true + }, + { + "instanceof": "Function" + } + ] + }, + "prependData": { + "description": "Prepends `Sass`/`SCSS` code before the actual entry file (https://github.com/webpack-contrib/sass-loader#prependdata).", + "anyOf": [ + { + "type": "string" + }, + { + "instanceof": "Function" + } + ] + }, + "sourceMap": { + "description": "Enables/Disables generation of source maps (https://github.com/webpack-contrib/sass-loader#sourcemap).", + "type": "boolean" + }, + "webpackImporter": { + "description": "Enables/Disables default `webpack` importer (https://github.com/webpack-contrib/sass-loader#webpackimporter).", + "type": "boolean" + } + }, + "additionalProperties": false +} diff --git a/node_modules/sass-loader/dist/proxyCustomImporters.js b/node_modules/sass-loader/dist/proxyCustomImporters.js new file mode 100644 index 0000000..504a5d7 --- /dev/null +++ b/node_modules/sass-loader/dist/proxyCustomImporters.js @@ -0,0 +1,31 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +/** + * Creates new custom importers that use the given `resourcePath` if libsass calls the custom importer with `prev` + * being 'stdin'. + * + * Why do we need this? We have to use the `data` option of node-sass in order to compile our sass because + * the `resourcePath` might not be an actual file on disk. When using the `data` option, libsass uses the string + * 'stdin' instead of a filename. + * + * We have to fix this behavior in order to provide a consistent experience to the webpack user. + * + * @param {Function|Array} importer + * @param {string} resourcePath + * @returns {Array} + */ +function proxyCustomImporters(importer, resourcePath) { + return [].concat(importer).map( // eslint-disable-next-line no-shadow + importer => function customImporter() { + return importer.apply(this, // eslint-disable-next-line prefer-rest-params + Array.from(arguments).map((arg, i) => i === 1 && arg === 'stdin' ? resourcePath : arg)); + }); +} + +var _default = proxyCustomImporters; +exports.default = _default; \ No newline at end of file diff --git a/node_modules/sass-loader/dist/webpackImporter.js b/node_modules/sass-loader/dist/webpackImporter.js new file mode 100644 index 0000000..07a7ebd --- /dev/null +++ b/node_modules/sass-loader/dist/webpackImporter.js @@ -0,0 +1,75 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _path = _interopRequireDefault(require("path")); + +var _importsToResolve = _interopRequireDefault(require("./importsToResolve")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * @name PromisedResolve + * @type {Function} + * @param {string} dir + * @param {string} request + * @returns Promise + */ + +/** + * @name Importer + * @type {Function} + * @param {string} url + * @param {string} prev + * @param {Function} done + */ +const matchCss = /\.css$/i; +/** + * Returns an importer that uses webpack's resolving algorithm. + * + * It's important that the returned function has the correct number of arguments + * (based on whether the call is sync or async) because otherwise node-sass doesn't exit. + * + * @param {string} resourcePath + * @param {PromisedResolve} resolve + * @param {Function} addNormalizedDependency + * @returns {Importer} + */ + +function webpackImporter(resourcePath, resolve, addNormalizedDependency) { + function dirContextFrom(fileContext) { + return _path.default.dirname( // The first file is 'stdin' when we're using the data option + fileContext === 'stdin' ? resourcePath : fileContext); + } // eslint-disable-next-line no-shadow + + + function startResolving(dir, importsToResolve) { + return importsToResolve.length === 0 ? Promise.reject() : resolve(dir, importsToResolve[0]).then(resolvedFile => { + // Add the resolvedFilename as dependency. Although we're also using stats.includedFiles, this might come + // in handy when an error occurs. In this case, we don't get stats.includedFiles from node-sass. + addNormalizedDependency(resolvedFile); + return { + // By removing the CSS file extension, we trigger node-sass to include the CSS file instead of just linking it. + file: resolvedFile.replace(matchCss, '') + }; + }, () => { + const [, ...tailResult] = importsToResolve; + return startResolving(dir, tailResult); + }); + } + + return (url, prev, done) => { + startResolving(dirContextFrom(prev), (0, _importsToResolve.default)(url)) // Catch all resolving errors, return the original file and pass responsibility back to other custom importers + .catch(() => { + return { + file: url + }; + }).then(done); + }; +} + +var _default = webpackImporter; +exports.default = _default; \ No newline at end of file diff --git a/node_modules/sass-loader/node_modules/schema-utils/CHANGELOG.md b/node_modules/sass-loader/node_modules/schema-utils/CHANGELOG.md new file mode 100644 index 0000000..d075166 --- /dev/null +++ b/node_modules/sass-loader/node_modules/schema-utils/CHANGELOG.md @@ -0,0 +1,286 @@ +# Changelog + +All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + +### [2.7.1](https://github.com/webpack/schema-utils/compare/v2.7.0...v2.7.1) (2020-08-31) + + +### Bug Fixes + +* remove esModuleInterop from tsconfig ([#110](https://github.com/webpack/schema-utils/issues/110)) ([#111](https://github.com/webpack/schema-utils/issues/111)) ([2f40154](https://github.com/webpack/schema-utils/commit/2f40154b91e45b393258ae9dd8f10cc3b8590b7d)) + +## [2.7.0](https://github.com/webpack/schema-utils/compare/v2.6.6...v2.7.0) (2020-05-29) + + +### Features + +* improve hints ([a36e535](https://github.com/webpack/schema-utils/commit/a36e535faca1b01e27c3bfa3c8bee9227c3f836c)) +* smart not case ([#101](https://github.com/webpack/schema-utils/issues/101)) ([698d8b0](https://github.com/webpack/schema-utils/commit/698d8b05462d86aadb217e25a45c7b953a79a52e)) + + +### Bug Fixes + +* move @types/json-schema from devDependencies to dependencies ([#97](https://github.com/webpack/schema-utils/issues/97)) ([#98](https://github.com/webpack/schema-utils/issues/98)) ([945e67d](https://github.com/webpack/schema-utils/commit/945e67db5e19baf7ec7df72813b0739dd56f950d)) + +### [2.6.6](https://github.com/webpack/schema-utils/compare/v2.6.5...v2.6.6) (2020-04-17) + + +### Bug Fixes + +* improve perf + +### [2.6.5](https://github.com/webpack/schema-utils/compare/v2.6.4...v2.6.5) (2020-03-11) + + +### Bug Fixes + +* correct dots at end of sentence ([7284beb](https://github.com/webpack/schema-utils/commit/7284bebe00cd570f1bef2c15951a07b9794038e6)) + +### [2.6.4](https://github.com/webpack/schema-utils/compare/v2.6.3...v2.6.4) (2020-01-17) + + +### Bug Fixes + +* change `initialised` to `initialized` ([#87](https://github.com/webpack/schema-utils/issues/87)) ([70f12d3](https://github.com/webpack/schema-utils/commit/70f12d33a8eaa27249bc9c1a27f886724cf91ea7)) + +### [2.6.3](https://github.com/webpack/schema-utils/compare/v2.6.2...v2.6.3) (2020-01-17) + + +### Bug Fixes + +* prefer the `baseDataPath` option from arguments ([#86](https://github.com/webpack/schema-utils/issues/86)) ([e236859](https://github.com/webpack/schema-utils/commit/e236859e85b28e35e1294f86fc1ff596a5031cea)) + +### [2.6.2](https://github.com/webpack/schema-utils/compare/v2.6.1...v2.6.2) (2020-01-14) + + +### Bug Fixes + +* better handle Windows absolute paths ([#85](https://github.com/webpack/schema-utils/issues/85)) ([1fa2930](https://github.com/webpack/schema-utils/commit/1fa2930a161e907b9fc53a7233d605910afdb883)) + +### [2.6.1](https://github.com/webpack/schema-utils/compare/v2.6.0...v2.6.1) (2019-11-28) + + +### Bug Fixes + +* typescript declarations ([#84](https://github.com/webpack/schema-utils/issues/84)) ([89d55a9](https://github.com/webpack/schema-utils/commit/89d55a9a8edfa6a8ac8b112f226bb3154e260319)) + +## [2.6.0](https://github.com/webpack/schema-utils/compare/v2.5.0...v2.6.0) (2019-11-27) + + +### Features + +* support configuration via title ([#81](https://github.com/webpack/schema-utils/issues/81)) ([afddc10](https://github.com/webpack/schema-utils/commit/afddc109f6891cd37a9f1835d50862d119a072bf)) + + +### Bug Fixes + +* typescript definitions ([#70](https://github.com/webpack/schema-utils/issues/70)) ([f38158d](https://github.com/webpack/schema-utils/commit/f38158d6d040e2c701622778ae8122fb26a4f990)) + +## [2.5.0](https://github.com/webpack/schema-utils/compare/v2.4.1...v2.5.0) (2019-10-15) + + +### Bug Fixes + +* rework format for maxLength, minLength ([#67](https://github.com/webpack/schema-utils/issues/67)) ([0d12259](https://github.com/webpack/schema-utils/commit/0d12259)) +* support all cases with one number in range ([#64](https://github.com/webpack/schema-utils/issues/64)) ([7fc8069](https://github.com/webpack/schema-utils/commit/7fc8069)) +* typescript definition and export naming ([#69](https://github.com/webpack/schema-utils/issues/69)) ([a435b79](https://github.com/webpack/schema-utils/commit/a435b79)) + + +### Features + +* "smart" numbers range ([62fb107](https://github.com/webpack/schema-utils/commit/62fb107)) + +### [2.4.1](https://github.com/webpack/schema-utils/compare/v2.4.0...v2.4.1) (2019-09-27) + + +### Bug Fixes + +* publish definitions ([#58](https://github.com/webpack/schema-utils/issues/58)) ([1885faa](https://github.com/webpack/schema-utils/commit/1885faa)) + +## [2.4.0](https://github.com/webpack/schema-utils/compare/v2.3.0...v2.4.0) (2019-09-26) + + +### Features + +* better errors when the `type` keyword doesn't exist ([0988be2](https://github.com/webpack/schema-utils/commit/0988be2)) +* support $data reference ([#56](https://github.com/webpack/schema-utils/issues/56)) ([d2f11d6](https://github.com/webpack/schema-utils/commit/d2f11d6)) +* types definitions ([#52](https://github.com/webpack/schema-utils/issues/52)) ([facb431](https://github.com/webpack/schema-utils/commit/facb431)) + +## [2.3.0](https://github.com/webpack/schema-utils/compare/v2.2.0...v2.3.0) (2019-09-26) + + +### Features + +* support `not` keyword ([#53](https://github.com/webpack/schema-utils/issues/53)) ([765f458](https://github.com/webpack/schema-utils/commit/765f458)) + +## [2.2.0](https://github.com/webpack/schema-utils/compare/v2.1.0...v2.2.0) (2019-09-02) + + +### Features + +* better error output for `oneOf` and `anyOf` ([#48](https://github.com/webpack/schema-utils/issues/48)) ([#50](https://github.com/webpack/schema-utils/issues/50)) ([332242f](https://github.com/webpack/schema-utils/commit/332242f)) + +## [2.1.0](https://github.com/webpack-contrib/schema-utils/compare/v2.0.1...v2.1.0) (2019-08-07) + + +### Bug Fixes + +* throw error on sparse arrays ([#47](https://github.com/webpack-contrib/schema-utils/issues/47)) ([b85ac38](https://github.com/webpack-contrib/schema-utils/commit/b85ac38)) + + +### Features + +* export `ValidateError` ([#46](https://github.com/webpack-contrib/schema-utils/issues/46)) ([ff781d7](https://github.com/webpack-contrib/schema-utils/commit/ff781d7)) + + + +### [2.0.1](https://github.com/webpack-contrib/schema-utils/compare/v2.0.0...v2.0.1) (2019-07-18) + + +### Bug Fixes + +* error message for empty object ([#44](https://github.com/webpack-contrib/schema-utils/issues/44)) ([0b4b4a2](https://github.com/webpack-contrib/schema-utils/commit/0b4b4a2)) + + + +### [2.0.0](https://github.com/webpack-contrib/schema-utils/compare/v1.0.0...v2.0.0) (2019-07-17) + + +### BREAKING CHANGES + +* drop support for Node.js < 8.9.0 +* drop support `errorMessage`, please use `description` for links. +* api was changed, please look documentation. +* error messages was fully rewritten. + + + +# [1.0.0](https://github.com/webpack-contrib/schema-utils/compare/v0.4.7...v1.0.0) (2018-08-07) + + +### Features + +* **src:** add support for custom error messages ([#33](https://github.com/webpack-contrib/schema-utils/issues/33)) ([1cbe4ef](https://github.com/webpack-contrib/schema-utils/commit/1cbe4ef)) + + + + +## [0.4.7](https://github.com/webpack-contrib/schema-utils/compare/v0.4.6...v0.4.7) (2018-08-07) + + +### Bug Fixes + +* **src:** `node >= v4.0.0` support ([#32](https://github.com/webpack-contrib/schema-utils/issues/32)) ([cb13dd4](https://github.com/webpack-contrib/schema-utils/commit/cb13dd4)) + + + + +## [0.4.6](https://github.com/webpack-contrib/schema-utils/compare/v0.4.5...v0.4.6) (2018-08-06) + + +### Bug Fixes + +* **package:** remove lockfile ([#28](https://github.com/webpack-contrib/schema-utils/issues/28)) ([69f1a81](https://github.com/webpack-contrib/schema-utils/commit/69f1a81)) +* **package:** remove unnecessary `webpack` dependency ([#26](https://github.com/webpack-contrib/schema-utils/issues/26)) ([532eaa5](https://github.com/webpack-contrib/schema-utils/commit/532eaa5)) + + + + +## [0.4.5](https://github.com/webpack-contrib/schema-utils/compare/v0.4.4...v0.4.5) (2018-02-13) + + +### Bug Fixes + +* **CHANGELOG:** update broken links ([4483b9f](https://github.com/webpack-contrib/schema-utils/commit/4483b9f)) +* **package:** update broken links ([f2494ba](https://github.com/webpack-contrib/schema-utils/commit/f2494ba)) + + + + +## [0.4.4](https://github.com/webpack-contrib/schema-utils/compare/v0.4.3...v0.4.4) (2018-02-13) + + +### Bug Fixes + +* **package:** update `dependencies` ([#22](https://github.com/webpack-contrib/schema-utils/issues/22)) ([3aecac6](https://github.com/webpack-contrib/schema-utils/commit/3aecac6)) + + + + +## [0.4.3](https://github.com/webpack-contrib/schema-utils/compare/v0.4.2...v0.4.3) (2017-12-14) + + +### Bug Fixes + +* **validateOptions:** throw `err` instead of `process.exit(1)` ([#17](https://github.com/webpack-contrib/schema-utils/issues/17)) ([c595eda](https://github.com/webpack-contrib/schema-utils/commit/c595eda)) +* **ValidationError:** never return `this` in the ctor ([#16](https://github.com/webpack-contrib/schema-utils/issues/16)) ([c723791](https://github.com/webpack-contrib/schema-utils/commit/c723791)) + + + + +## [0.4.2](https://github.com/webpack-contrib/schema-utils/compare/v0.4.1...v0.4.2) (2017-11-09) + + +### Bug Fixes + +* **validateOptions:** catch `ValidationError` and handle it internally ([#15](https://github.com/webpack-contrib/schema-utils/issues/15)) ([9c5ef5e](https://github.com/webpack-contrib/schema-utils/commit/9c5ef5e)) + + + + +## [0.4.1](https://github.com/webpack-contrib/schema-utils/compare/v0.4.0...v0.4.1) (2017-11-03) + + +### Bug Fixes + +* **ValidationError:** use `Error.captureStackTrace` for `err.stack` handling ([#14](https://github.com/webpack-contrib/schema-utils/issues/14)) ([a6fb974](https://github.com/webpack-contrib/schema-utils/commit/a6fb974)) + + + + +# [0.4.0](https://github.com/webpack-contrib/schema-utils/compare/v0.3.0...v0.4.0) (2017-10-28) + + +### Features + +* add support for `typeof`, `instanceof` (`{Function\|RegExp}`) ([#10](https://github.com/webpack-contrib/schema-utils/issues/10)) ([9f01816](https://github.com/webpack-contrib/schema-utils/commit/9f01816)) + + + + +# [0.3.0](https://github.com/webpack-contrib/schema-utils/compare/v0.2.1...v0.3.0) (2017-04-29) + + +### Features + +* add ValidationError ([#8](https://github.com/webpack-contrib/schema-utils/issues/8)) ([d48f0fb](https://github.com/webpack-contrib/schema-utils/commit/d48f0fb)) + + + + +## [0.2.1](https://github.com/webpack-contrib/schema-utils/compare/v0.2.0...v0.2.1) (2017-03-13) + + +### Bug Fixes + +* Include .babelrc to `files` ([28f0363](https://github.com/webpack-contrib/schema-utils/commit/28f0363)) +* Include source to `files` ([43b0f2f](https://github.com/webpack-contrib/schema-utils/commit/43b0f2f)) + + + + +# [0.2.0](https://github.com/webpack-contrib/schema-utils/compare/v0.1.0...v0.2.0) (2017-03-12) + + +# 0.1.0 (2017-03-07) + + +### Features + +* **validations:** add validateOptions module ([ae9b47b](https://github.com/webpack-contrib/schema-utils/commit/ae9b47b)) + + + +# Change Log + +All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. diff --git a/node_modules/sass-loader/node_modules/schema-utils/LICENSE b/node_modules/sass-loader/node_modules/schema-utils/LICENSE new file mode 100644 index 0000000..8c11fc7 --- /dev/null +++ b/node_modules/sass-loader/node_modules/schema-utils/LICENSE @@ -0,0 +1,20 @@ +Copyright JS Foundation and other contributors + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/sass-loader/node_modules/schema-utils/README.md b/node_modules/sass-loader/node_modules/schema-utils/README.md new file mode 100644 index 0000000..a0150e4 --- /dev/null +++ b/node_modules/sass-loader/node_modules/schema-utils/README.md @@ -0,0 +1,276 @@ + + +[![npm][npm]][npm-url] +[![node][node]][node-url] +[![deps][deps]][deps-url] +[![tests][tests]][tests-url] +[![coverage][cover]][cover-url] +[![chat][chat]][chat-url] +[![size][size]][size-url] + +# schema-utils + +Package for validate options in loaders and plugins. + +## Getting Started + +To begin, you'll need to install `schema-utils`: + +```console +npm install schema-utils +``` + +## API + +**schema.json** + +```json +{ + "type": "object", + "properties": { + "option": { + "type": "boolean" + } + }, + "additionalProperties": false +} +``` + +```js +import schema from './path/to/schema.json'; +import validate from 'schema-utils'; + +const options = { option: true }; +const configuration = { name: 'Loader Name/Plugin Name/Name' }; + +validate(schema, options, configuration); +``` + +### `schema` + +Type: `String` + +JSON schema. + +Simple example of schema: + +```json +{ + "type": "object", + "properties": { + "name": { + "description": "This is description of option.", + "type": "string" + } + }, + "additionalProperties": false +} +``` + +### `options` + +Type: `Object` + +Object with options. + +```js +validate( + schema, + { + name: 123, + }, + { name: 'MyPlugin' } +); +``` + +### `configuration` + +Allow to configure validator. + +There is an alternative method to configure the `name` and`baseDataPath` options via the `title` property in the schema. +For example: + +```json +{ + "title": "My Loader options", + "type": "object", + "properties": { + "name": { + "description": "This is description of option.", + "type": "string" + } + }, + "additionalProperties": false +} +``` + +The last word used for the `baseDataPath` option, other words used for the `name` option. +Based on the example above the `name` option equals `My Loader`, the `baseDataPath` option equals `options`. + +#### `name` + +Type: `Object` +Default: `"Object"` + +Allow to setup name in validation errors. + +```js +validate(schema, options, { name: 'MyPlugin' }); +``` + +```shell +Invalid configuration object. MyPlugin has been initialised using a configuration object that does not match the API schema. + - configuration.optionName should be a integer. +``` + +#### `baseDataPath` + +Type: `String` +Default: `"configuration"` + +Allow to setup base data path in validation errors. + +```js +validate(schema, options, { name: 'MyPlugin', baseDataPath: 'options' }); +``` + +```shell +Invalid options object. MyPlugin has been initialised using an options object that does not match the API schema. + - options.optionName should be a integer. +``` + +#### `postFormatter` + +Type: `Function` +Default: `undefined` + +Allow to reformat errors. + +```js +validate(schema, options, { + name: 'MyPlugin', + postFormatter: (formattedError, error) => { + if (error.keyword === 'type') { + return `${formattedError}\nAdditional Information.`; + } + + return formattedError; + }, +}); +``` + +```shell +Invalid options object. MyPlugin has been initialized using an options object that does not match the API schema. + - options.optionName should be a integer. + Additional Information. +``` + +## Examples + +**schema.json** + +```json +{ + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "test": { + "anyOf": [ + { "type": "array" }, + { "type": "string" }, + { "instanceof": "RegExp" } + ] + }, + "transform": { + "instanceof": "Function" + }, + "sourceMap": { + "type": "boolean" + } + }, + "additionalProperties": false +} +``` + +### `Loader` + +```js +import { getOptions } from 'loader-utils'; +import validateOptions from 'schema-utils'; + +import schema from 'path/to/schema.json'; + +function loader(src, map) { + const options = getOptions(this) || {}; + + validateOptions(schema, options, { + name: 'Loader Name', + baseDataPath: 'options', + }); + + // Code... +} + +export default loader; +``` + +### `Plugin` + +```js +import validateOptions from 'schema-utils'; + +import schema from 'path/to/schema.json'; + +class Plugin { + constructor(options) { + validateOptions(schema, options, { + name: 'Plugin Name', + baseDataPath: 'options', + }); + + this.options = options; + } + + apply(compiler) { + // Code... + } +} + +export default Plugin; +``` + +## Contributing + +Please take a moment to read our contributing guidelines if you haven't yet done so. + +[CONTRIBUTING](./.github/CONTRIBUTING.md) + +## License + +[MIT](./LICENSE) + +[npm]: https://img.shields.io/npm/v/schema-utils.svg +[npm-url]: https://npmjs.com/package/schema-utils +[node]: https://img.shields.io/node/v/schema-utils.svg +[node-url]: https://nodejs.org +[deps]: https://david-dm.org/webpack/schema-utils.svg +[deps-url]: https://david-dm.org/webpack/schema-utils +[tests]: https://github.com/webpack/schema-utils/workflows/schema-utils/badge.svg +[tests-url]: https://github.com/webpack/schema-utils/actions +[cover]: https://codecov.io/gh/webpack/schema-utils/branch/master/graph/badge.svg +[cover-url]: https://codecov.io/gh/webpack/schema-utils +[chat]: https://badges.gitter.im/webpack/webpack.svg +[chat-url]: https://gitter.im/webpack/webpack +[size]: https://packagephobia.com/badge?p=schema-utils +[size-url]: https://packagephobia.com/result?p=schema-utils diff --git a/node_modules/sass-loader/node_modules/schema-utils/declarations/ValidationError.d.ts b/node_modules/sass-loader/node_modules/schema-utils/declarations/ValidationError.d.ts new file mode 100644 index 0000000..1b53f70 --- /dev/null +++ b/node_modules/sass-loader/node_modules/schema-utils/declarations/ValidationError.d.ts @@ -0,0 +1,88 @@ +export default ValidationError; +export type JSONSchema6 = import('json-schema').JSONSchema6; +export type JSONSchema7 = import('json-schema').JSONSchema7; +export type Schema = + | (import('json-schema').JSONSchema4 & import('./validate').Extend) + | (import('json-schema').JSONSchema6 & import('./validate').Extend) + | (import('json-schema').JSONSchema7 & import('./validate').Extend); +export type ValidationErrorConfiguration = { + name?: string | undefined; + baseDataPath?: string | undefined; + postFormatter?: import('./validate').PostFormatter | undefined; +}; +export type PostFormatter = ( + formattedError: string, + error: import('ajv').ErrorObject & { + children?: import('ajv').ErrorObject[] | undefined; + } +) => string; +export type SchemaUtilErrorObject = import('ajv').ErrorObject & { + children?: import('ajv').ErrorObject[] | undefined; +}; +export type SPECIFICITY = number; +declare class ValidationError extends Error { + /** + * @param {Array} errors + * @param {Schema} schema + * @param {ValidationErrorConfiguration} configuration + */ + constructor( + errors: Array, + schema: Schema, + configuration?: ValidationErrorConfiguration + ); + /** @type {Array} */ + errors: Array; + /** @type {Schema} */ + schema: Schema; + /** @type {string} */ + headerName: string; + /** @type {string} */ + baseDataPath: string; + /** @type {PostFormatter | null} */ + postFormatter: PostFormatter | null; + /** + * @param {string} path + * @returns {Schema} + */ + getSchemaPart(path: string): Schema; + /** + * @param {Schema} schema + * @param {boolean} logic + * @param {Array} prevSchemas + * @returns {string} + */ + formatSchema( + schema: Schema, + logic?: boolean, + prevSchemas?: Array + ): string; + /** + * @param {Schema=} schemaPart + * @param {(boolean | Array)=} additionalPath + * @param {boolean=} needDot + * @param {boolean=} logic + * @returns {string} + */ + getSchemaPartText( + schemaPart?: Schema | undefined, + additionalPath?: (boolean | Array) | undefined, + needDot?: boolean | undefined, + logic?: boolean | undefined + ): string; + /** + * @param {Schema=} schemaPart + * @returns {string} + */ + getSchemaPartDescription(schemaPart?: Schema | undefined): string; + /** + * @param {SchemaUtilErrorObject} error + * @returns {string} + */ + formatValidationError(error: SchemaUtilErrorObject): string; + /** + * @param {Array} errors + * @returns {string} + */ + formatValidationErrors(errors: Array): string; +} diff --git a/node_modules/sass-loader/node_modules/schema-utils/declarations/index.d.ts b/node_modules/sass-loader/node_modules/schema-utils/declarations/index.d.ts new file mode 100644 index 0000000..2ee7d9e --- /dev/null +++ b/node_modules/sass-loader/node_modules/schema-utils/declarations/index.d.ts @@ -0,0 +1,2 @@ +declare const _exports: typeof import('./validate').default; +export = _exports; diff --git a/node_modules/sass-loader/node_modules/schema-utils/declarations/keywords/absolutePath.d.ts b/node_modules/sass-loader/node_modules/schema-utils/declarations/keywords/absolutePath.d.ts new file mode 100644 index 0000000..6843dd6 --- /dev/null +++ b/node_modules/sass-loader/node_modules/schema-utils/declarations/keywords/absolutePath.d.ts @@ -0,0 +1,12 @@ +export default addAbsolutePathKeyword; +export type Ajv = import('ajv').Ajv; +export type ValidateFunction = import('ajv').ValidateFunction; +export type SchemaUtilErrorObject = import('ajv').ErrorObject & { + children?: import('ajv').ErrorObject[] | undefined; +}; +/** + * + * @param {Ajv} ajv + * @returns {Ajv} + */ +declare function addAbsolutePathKeyword(ajv: Ajv): Ajv; diff --git a/node_modules/sass-loader/node_modules/schema-utils/declarations/util/Range.d.ts b/node_modules/sass-loader/node_modules/schema-utils/declarations/util/Range.d.ts new file mode 100644 index 0000000..d28de38 --- /dev/null +++ b/node_modules/sass-loader/node_modules/schema-utils/declarations/util/Range.d.ts @@ -0,0 +1,82 @@ +export = Range; +/** + * @typedef {[number, boolean]} RangeValue + */ +/** + * @callback RangeValueCallback + * @param {RangeValue} rangeValue + * @returns {boolean} + */ +declare class Range { + /** + * @param {"left" | "right"} side + * @param {boolean} exclusive + * @returns {">" | ">=" | "<" | "<="} + */ + static getOperator( + side: 'left' | 'right', + exclusive: boolean + ): '>' | '>=' | '<' | '<='; + /** + * @param {number} value + * @param {boolean} logic is not logic applied + * @param {boolean} exclusive is range exclusive + * @returns {string} + */ + static formatRight(value: number, logic: boolean, exclusive: boolean): string; + /** + * @param {number} value + * @param {boolean} logic is not logic applied + * @param {boolean} exclusive is range exclusive + * @returns {string} + */ + static formatLeft(value: number, logic: boolean, exclusive: boolean): string; + /** + * @param {number} start left side value + * @param {number} end right side value + * @param {boolean} startExclusive is range exclusive from left side + * @param {boolean} endExclusive is range exclusive from right side + * @param {boolean} logic is not logic applied + * @returns {string} + */ + static formatRange( + start: number, + end: number, + startExclusive: boolean, + endExclusive: boolean, + logic: boolean + ): string; + /** + * @param {Array} values + * @param {boolean} logic is not logic applied + * @return {RangeValue} computed value and it's exclusive flag + */ + static getRangeValue( + values: Array<[number, boolean]>, + logic: boolean + ): [number, boolean]; + /** @type {Array} */ + _left: Array<[number, boolean]>; + /** @type {Array} */ + _right: Array<[number, boolean]>; + /** + * @param {number} value + * @param {boolean=} exclusive + */ + left(value: number, exclusive?: boolean | undefined): void; + /** + * @param {number} value + * @param {boolean=} exclusive + */ + right(value: number, exclusive?: boolean | undefined): void; + /** + * @param {boolean} logic is not logic applied + * @return {string} "smart" range string representation + */ + format(logic?: boolean): string; +} +declare namespace Range { + export { RangeValue, RangeValueCallback }; +} +type RangeValue = [number, boolean]; +type RangeValueCallback = (rangeValue: [number, boolean]) => boolean; diff --git a/node_modules/sass-loader/node_modules/schema-utils/declarations/util/hints.d.ts b/node_modules/sass-loader/node_modules/schema-utils/declarations/util/hints.d.ts new file mode 100644 index 0000000..39412aa --- /dev/null +++ b/node_modules/sass-loader/node_modules/schema-utils/declarations/util/hints.d.ts @@ -0,0 +1,6 @@ +export function stringHints(schema: Schema, logic: boolean): string[]; +export function numberHints(schema: Schema, logic: boolean): string[]; +export type Schema = + | (import('json-schema').JSONSchema4 & import('../validate').Extend) + | (import('json-schema').JSONSchema6 & import('../validate').Extend) + | (import('json-schema').JSONSchema7 & import('../validate').Extend); diff --git a/node_modules/sass-loader/node_modules/schema-utils/declarations/validate.d.ts b/node_modules/sass-loader/node_modules/schema-utils/declarations/validate.d.ts new file mode 100644 index 0000000..6a3a5b8 --- /dev/null +++ b/node_modules/sass-loader/node_modules/schema-utils/declarations/validate.d.ts @@ -0,0 +1,43 @@ +export default validate; +export type JSONSchema4 = import('json-schema').JSONSchema4; +export type JSONSchema6 = import('json-schema').JSONSchema6; +export type JSONSchema7 = import('json-schema').JSONSchema7; +export type ErrorObject = import('ajv').ErrorObject; +export type Extend = { + formatMinimum?: number | undefined; + formatMaximum?: number | undefined; + formatExclusiveMinimum?: boolean | undefined; + formatExclusiveMaximum?: boolean | undefined; +}; +export type Schema = + | (import('json-schema').JSONSchema4 & Extend) + | (import('json-schema').JSONSchema6 & Extend) + | (import('json-schema').JSONSchema7 & Extend); +export type SchemaUtilErrorObject = import('ajv').ErrorObject & { + children?: import('ajv').ErrorObject[] | undefined; +}; +export type PostFormatter = ( + formattedError: string, + error: SchemaUtilErrorObject +) => string; +export type ValidationErrorConfiguration = { + name?: string | undefined; + baseDataPath?: string | undefined; + postFormatter?: PostFormatter | undefined; +}; +/** + * @param {Schema} schema + * @param {Array | object} options + * @param {ValidationErrorConfiguration=} configuration + * @returns {void} + */ +declare function validate( + schema: Schema, + options: Array | object, + configuration?: ValidationErrorConfiguration | undefined +): void; +declare namespace validate { + export { ValidationError }; + export { ValidationError as ValidateError }; +} +import ValidationError from './ValidationError'; diff --git a/node_modules/sass-loader/node_modules/schema-utils/dist/ValidationError.js b/node_modules/sass-loader/node_modules/schema-utils/dist/ValidationError.js new file mode 100644 index 0000000..ae5bd94 --- /dev/null +++ b/node_modules/sass-loader/node_modules/schema-utils/dist/ValidationError.js @@ -0,0 +1,1261 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +const { + stringHints, + numberHints +} = require('./util/hints'); +/** @typedef {import("json-schema").JSONSchema6} JSONSchema6 */ + +/** @typedef {import("json-schema").JSONSchema7} JSONSchema7 */ + +/** @typedef {import("./validate").Schema} Schema */ + +/** @typedef {import("./validate").ValidationErrorConfiguration} ValidationErrorConfiguration */ + +/** @typedef {import("./validate").PostFormatter} PostFormatter */ + +/** @typedef {import("./validate").SchemaUtilErrorObject} SchemaUtilErrorObject */ + +/** @enum {number} */ + + +const SPECIFICITY = { + type: 1, + not: 1, + oneOf: 1, + anyOf: 1, + if: 1, + enum: 1, + const: 1, + instanceof: 1, + required: 2, + pattern: 2, + patternRequired: 2, + format: 2, + formatMinimum: 2, + formatMaximum: 2, + minimum: 2, + exclusiveMinimum: 2, + maximum: 2, + exclusiveMaximum: 2, + multipleOf: 2, + uniqueItems: 2, + contains: 2, + minLength: 2, + maxLength: 2, + minItems: 2, + maxItems: 2, + minProperties: 2, + maxProperties: 2, + dependencies: 2, + propertyNames: 2, + additionalItems: 2, + additionalProperties: 2, + absolutePath: 2 +}; +/** + * + * @param {Array} array + * @param {(item: SchemaUtilErrorObject) => number} fn + * @returns {Array} + */ + +function filterMax(array, fn) { + const evaluatedMax = array.reduce((max, item) => Math.max(max, fn(item)), 0); + return array.filter(item => fn(item) === evaluatedMax); +} +/** + * + * @param {Array} children + * @returns {Array} + */ + + +function filterChildren(children) { + let newChildren = children; + newChildren = filterMax(newChildren, + /** + * + * @param {SchemaUtilErrorObject} error + * @returns {number} + */ + error => error.dataPath ? error.dataPath.length : 0); + newChildren = filterMax(newChildren, + /** + * @param {SchemaUtilErrorObject} error + * @returns {number} + */ + error => SPECIFICITY[ + /** @type {keyof typeof SPECIFICITY} */ + error.keyword] || 2); + return newChildren; +} +/** + * Find all children errors + * @param {Array} children + * @param {Array} schemaPaths + * @return {number} returns index of first child + */ + + +function findAllChildren(children, schemaPaths) { + let i = children.length - 1; + + const predicate = + /** + * @param {string} schemaPath + * @returns {boolean} + */ + schemaPath => children[i].schemaPath.indexOf(schemaPath) !== 0; + + while (i > -1 && !schemaPaths.every(predicate)) { + if (children[i].keyword === 'anyOf' || children[i].keyword === 'oneOf') { + const refs = extractRefs(children[i]); + const childrenStart = findAllChildren(children.slice(0, i), refs.concat(children[i].schemaPath)); + i = childrenStart - 1; + } else { + i -= 1; + } + } + + return i + 1; +} +/** + * Extracts all refs from schema + * @param {SchemaUtilErrorObject} error + * @return {Array} + */ + + +function extractRefs(error) { + const { + schema + } = error; + + if (!Array.isArray(schema)) { + return []; + } + + return schema.map(({ + $ref + }) => $ref).filter(s => s); +} +/** + * Groups children by their first level parent (assuming that error is root) + * @param {Array} children + * @return {Array} + */ + + +function groupChildrenByFirstChild(children) { + const result = []; + let i = children.length - 1; + + while (i > 0) { + const child = children[i]; + + if (child.keyword === 'anyOf' || child.keyword === 'oneOf') { + const refs = extractRefs(child); + const childrenStart = findAllChildren(children.slice(0, i), refs.concat(child.schemaPath)); + + if (childrenStart !== i) { + result.push(Object.assign({}, child, { + children: children.slice(childrenStart, i) + })); + i = childrenStart; + } else { + result.push(child); + } + } else { + result.push(child); + } + + i -= 1; + } + + if (i === 0) { + result.push(children[i]); + } + + return result.reverse(); +} +/** + * @param {string} str + * @param {string} prefix + * @returns {string} + */ + + +function indent(str, prefix) { + return str.replace(/\n(?!$)/g, `\n${prefix}`); +} +/** + * @param {Schema} schema + * @returns {schema is (Schema & {not: Schema})} + */ + + +function hasNotInSchema(schema) { + return !!schema.not; +} +/** + * @param {Schema} schema + * @return {Schema} + */ + + +function findFirstTypedSchema(schema) { + if (hasNotInSchema(schema)) { + return findFirstTypedSchema(schema.not); + } + + return schema; +} +/** + * @param {Schema} schema + * @return {boolean} + */ + + +function canApplyNot(schema) { + const typedSchema = findFirstTypedSchema(schema); + return likeNumber(typedSchema) || likeInteger(typedSchema) || likeString(typedSchema) || likeNull(typedSchema) || likeBoolean(typedSchema); +} +/** + * @param {any} maybeObj + * @returns {boolean} + */ + + +function isObject(maybeObj) { + return typeof maybeObj === 'object' && maybeObj !== null; +} +/** + * @param {Schema} schema + * @returns {boolean} + */ + + +function likeNumber(schema) { + return schema.type === 'number' || typeof schema.minimum !== 'undefined' || typeof schema.exclusiveMinimum !== 'undefined' || typeof schema.maximum !== 'undefined' || typeof schema.exclusiveMaximum !== 'undefined' || typeof schema.multipleOf !== 'undefined'; +} +/** + * @param {Schema} schema + * @returns {boolean} + */ + + +function likeInteger(schema) { + return schema.type === 'integer' || typeof schema.minimum !== 'undefined' || typeof schema.exclusiveMinimum !== 'undefined' || typeof schema.maximum !== 'undefined' || typeof schema.exclusiveMaximum !== 'undefined' || typeof schema.multipleOf !== 'undefined'; +} +/** + * @param {Schema} schema + * @returns {boolean} + */ + + +function likeString(schema) { + return schema.type === 'string' || typeof schema.minLength !== 'undefined' || typeof schema.maxLength !== 'undefined' || typeof schema.pattern !== 'undefined' || typeof schema.format !== 'undefined' || typeof schema.formatMinimum !== 'undefined' || typeof schema.formatMaximum !== 'undefined'; +} +/** + * @param {Schema} schema + * @returns {boolean} + */ + + +function likeBoolean(schema) { + return schema.type === 'boolean'; +} +/** + * @param {Schema} schema + * @returns {boolean} + */ + + +function likeArray(schema) { + return schema.type === 'array' || typeof schema.minItems === 'number' || typeof schema.maxItems === 'number' || typeof schema.uniqueItems !== 'undefined' || typeof schema.items !== 'undefined' || typeof schema.additionalItems !== 'undefined' || typeof schema.contains !== 'undefined'; +} +/** + * @param {Schema & {patternRequired?: Array}} schema + * @returns {boolean} + */ + + +function likeObject(schema) { + return schema.type === 'object' || typeof schema.minProperties !== 'undefined' || typeof schema.maxProperties !== 'undefined' || typeof schema.required !== 'undefined' || typeof schema.properties !== 'undefined' || typeof schema.patternProperties !== 'undefined' || typeof schema.additionalProperties !== 'undefined' || typeof schema.dependencies !== 'undefined' || typeof schema.propertyNames !== 'undefined' || typeof schema.patternRequired !== 'undefined'; +} +/** + * @param {Schema} schema + * @returns {boolean} + */ + + +function likeNull(schema) { + return schema.type === 'null'; +} +/** + * @param {string} type + * @returns {string} + */ + + +function getArticle(type) { + if (/^[aeiou]/i.test(type)) { + return 'an'; + } + + return 'a'; +} +/** + * @param {Schema=} schema + * @returns {string} + */ + + +function getSchemaNonTypes(schema) { + if (!schema) { + return ''; + } + + if (!schema.type) { + if (likeNumber(schema) || likeInteger(schema)) { + return ' | should be any non-number'; + } + + if (likeString(schema)) { + return ' | should be any non-string'; + } + + if (likeArray(schema)) { + return ' | should be any non-array'; + } + + if (likeObject(schema)) { + return ' | should be any non-object'; + } + } + + return ''; +} +/** + * @param {Array} hints + * @returns {string} + */ + + +function formatHints(hints) { + return hints.length > 0 ? `(${hints.join(', ')})` : ''; +} +/** + * @param {Schema} schema + * @param {boolean} logic + * @returns {string[]} + */ + + +function getHints(schema, logic) { + if (likeNumber(schema) || likeInteger(schema)) { + return numberHints(schema, logic); + } else if (likeString(schema)) { + return stringHints(schema, logic); + } + + return []; +} + +class ValidationError extends Error { + /** + * @param {Array} errors + * @param {Schema} schema + * @param {ValidationErrorConfiguration} configuration + */ + constructor(errors, schema, configuration = {}) { + super(); + /** @type {string} */ + + this.name = 'ValidationError'; + /** @type {Array} */ + + this.errors = errors; + /** @type {Schema} */ + + this.schema = schema; + let headerNameFromSchema; + let baseDataPathFromSchema; + + if (schema.title && (!configuration.name || !configuration.baseDataPath)) { + const splittedTitleFromSchema = schema.title.match(/^(.+) (.+)$/); + + if (splittedTitleFromSchema) { + if (!configuration.name) { + [, headerNameFromSchema] = splittedTitleFromSchema; + } + + if (!configuration.baseDataPath) { + [,, baseDataPathFromSchema] = splittedTitleFromSchema; + } + } + } + /** @type {string} */ + + + this.headerName = configuration.name || headerNameFromSchema || 'Object'; + /** @type {string} */ + + this.baseDataPath = configuration.baseDataPath || baseDataPathFromSchema || 'configuration'; + /** @type {PostFormatter | null} */ + + this.postFormatter = configuration.postFormatter || null; + const header = `Invalid ${this.baseDataPath} object. ${this.headerName} has been initialized using ${getArticle(this.baseDataPath)} ${this.baseDataPath} object that does not match the API schema.\n`; + /** @type {string} */ + + this.message = `${header}${this.formatValidationErrors(errors)}`; + Error.captureStackTrace(this, this.constructor); + } + /** + * @param {string} path + * @returns {Schema} + */ + + + getSchemaPart(path) { + const newPath = path.split('/'); + let schemaPart = this.schema; + + for (let i = 1; i < newPath.length; i++) { + const inner = schemaPart[ + /** @type {keyof Schema} */ + newPath[i]]; + + if (!inner) { + break; + } + + schemaPart = inner; + } + + return schemaPart; + } + /** + * @param {Schema} schema + * @param {boolean} logic + * @param {Array} prevSchemas + * @returns {string} + */ + + + formatSchema(schema, logic = true, prevSchemas = []) { + let newLogic = logic; + + const formatInnerSchema = + /** + * + * @param {Object} innerSchema + * @param {boolean=} addSelf + * @returns {string} + */ + (innerSchema, addSelf) => { + if (!addSelf) { + return this.formatSchema(innerSchema, newLogic, prevSchemas); + } + + if (prevSchemas.includes(innerSchema)) { + return '(recursive)'; + } + + return this.formatSchema(innerSchema, newLogic, prevSchemas.concat(schema)); + }; + + if (hasNotInSchema(schema) && !likeObject(schema)) { + if (canApplyNot(schema.not)) { + newLogic = !logic; + return formatInnerSchema(schema.not); + } + + const needApplyLogicHere = !schema.not.not; + const prefix = logic ? '' : 'non '; + newLogic = !logic; + return needApplyLogicHere ? prefix + formatInnerSchema(schema.not) : formatInnerSchema(schema.not); + } + + if ( + /** @type {Schema & {instanceof: string | Array}} */ + schema.instanceof) { + const { + instanceof: value + } = + /** @type {Schema & {instanceof: string | Array}} */ + schema; + const values = !Array.isArray(value) ? [value] : value; + return values.map( + /** + * @param {string} item + * @returns {string} + */ + item => item === 'Function' ? 'function' : item).join(' | '); + } + + if (schema.enum) { + return ( + /** @type {Array} */ + schema.enum.map(item => JSON.stringify(item)).join(' | ') + ); + } + + if (typeof schema.const !== 'undefined') { + return JSON.stringify(schema.const); + } + + if (schema.oneOf) { + return ( + /** @type {Array} */ + schema.oneOf.map(item => formatInnerSchema(item, true)).join(' | ') + ); + } + + if (schema.anyOf) { + return ( + /** @type {Array} */ + schema.anyOf.map(item => formatInnerSchema(item, true)).join(' | ') + ); + } + + if (schema.allOf) { + return ( + /** @type {Array} */ + schema.allOf.map(item => formatInnerSchema(item, true)).join(' & ') + ); + } + + if ( + /** @type {JSONSchema7} */ + schema.if) { + const { + if: ifValue, + then: thenValue, + else: elseValue + } = + /** @type {JSONSchema7} */ + schema; + return `${ifValue ? `if ${formatInnerSchema(ifValue)}` : ''}${thenValue ? ` then ${formatInnerSchema(thenValue)}` : ''}${elseValue ? ` else ${formatInnerSchema(elseValue)}` : ''}`; + } + + if (schema.$ref) { + return formatInnerSchema(this.getSchemaPart(schema.$ref), true); + } + + if (likeNumber(schema) || likeInteger(schema)) { + const [type, ...hints] = getHints(schema, logic); + const str = `${type}${hints.length > 0 ? ` ${formatHints(hints)}` : ''}`; + return logic ? str : hints.length > 0 ? `non-${type} | ${str}` : `non-${type}`; + } + + if (likeString(schema)) { + const [type, ...hints] = getHints(schema, logic); + const str = `${type}${hints.length > 0 ? ` ${formatHints(hints)}` : ''}`; + return logic ? str : str === 'string' ? 'non-string' : `non-string | ${str}`; + } + + if (likeBoolean(schema)) { + return `${logic ? '' : 'non-'}boolean`; + } + + if (likeArray(schema)) { + // not logic already applied in formatValidationError + newLogic = true; + const hints = []; + + if (typeof schema.minItems === 'number') { + hints.push(`should not have fewer than ${schema.minItems} item${schema.minItems > 1 ? 's' : ''}`); + } + + if (typeof schema.maxItems === 'number') { + hints.push(`should not have more than ${schema.maxItems} item${schema.maxItems > 1 ? 's' : ''}`); + } + + if (schema.uniqueItems) { + hints.push('should not have duplicate items'); + } + + const hasAdditionalItems = typeof schema.additionalItems === 'undefined' || Boolean(schema.additionalItems); + let items = ''; + + if (schema.items) { + if (Array.isArray(schema.items) && schema.items.length > 0) { + items = `${ + /** @type {Array} */ + schema.items.map(item => formatInnerSchema(item)).join(', ')}`; + + if (hasAdditionalItems) { + if (schema.additionalItems && isObject(schema.additionalItems) && Object.keys(schema.additionalItems).length > 0) { + hints.push(`additional items should be ${formatInnerSchema(schema.additionalItems)}`); + } + } + } else if (schema.items && Object.keys(schema.items).length > 0) { + // "additionalItems" is ignored + items = `${formatInnerSchema(schema.items)}`; + } else { + // Fallback for empty `items` value + items = 'any'; + } + } else { + // "additionalItems" is ignored + items = 'any'; + } + + if (schema.contains && Object.keys(schema.contains).length > 0) { + hints.push(`should contains at least one ${this.formatSchema(schema.contains)} item`); + } + + return `[${items}${hasAdditionalItems ? ', ...' : ''}]${hints.length > 0 ? ` (${hints.join(', ')})` : ''}`; + } + + if (likeObject(schema)) { + // not logic already applied in formatValidationError + newLogic = true; + const hints = []; + + if (typeof schema.minProperties === 'number') { + hints.push(`should not have fewer than ${schema.minProperties} ${schema.minProperties > 1 ? 'properties' : 'property'}`); + } + + if (typeof schema.maxProperties === 'number') { + hints.push(`should not have more than ${schema.maxProperties} ${schema.minProperties && schema.minProperties > 1 ? 'properties' : 'property'}`); + } + + if (schema.patternProperties && Object.keys(schema.patternProperties).length > 0) { + const patternProperties = Object.keys(schema.patternProperties); + hints.push(`additional property names should match pattern${patternProperties.length > 1 ? 's' : ''} ${patternProperties.map(pattern => JSON.stringify(pattern)).join(' | ')}`); + } + + const properties = schema.properties ? Object.keys(schema.properties) : []; + const required = schema.required ? schema.required : []; + const allProperties = [...new Set( + /** @type {Array} */ + [].concat(required).concat(properties))]; + const objectStructure = allProperties.map(property => { + const isRequired = required.includes(property); // Some properties need quotes, maybe we should add check + // Maybe we should output type of property (`foo: string`), but it is looks very unreadable + + return `${property}${isRequired ? '' : '?'}`; + }).concat(typeof schema.additionalProperties === 'undefined' || Boolean(schema.additionalProperties) ? schema.additionalProperties && isObject(schema.additionalProperties) ? [`: ${formatInnerSchema(schema.additionalProperties)}`] : ['…'] : []).join(', '); + const { + dependencies, + propertyNames, + patternRequired + } = + /** @type {Schema & {patternRequired?: Array;}} */ + schema; + + if (dependencies) { + Object.keys(dependencies).forEach(dependencyName => { + const dependency = dependencies[dependencyName]; + + if (Array.isArray(dependency)) { + hints.push(`should have ${dependency.length > 1 ? 'properties' : 'property'} ${dependency.map(dep => `'${dep}'`).join(', ')} when property '${dependencyName}' is present`); + } else { + hints.push(`should be valid according to the schema ${formatInnerSchema(dependency)} when property '${dependencyName}' is present`); + } + }); + } + + if (propertyNames && Object.keys(propertyNames).length > 0) { + hints.push(`each property name should match format ${JSON.stringify(schema.propertyNames.format)}`); + } + + if (patternRequired && patternRequired.length > 0) { + hints.push(`should have property matching pattern ${patternRequired.map( + /** + * @param {string} item + * @returns {string} + */ + item => JSON.stringify(item))}`); + } + + return `object {${objectStructure ? ` ${objectStructure} ` : ''}}${hints.length > 0 ? ` (${hints.join(', ')})` : ''}`; + } + + if (likeNull(schema)) { + return `${logic ? '' : 'non-'}null`; + } + + if (Array.isArray(schema.type)) { + // not logic already applied in formatValidationError + return `${schema.type.join(' | ')}`; + } // Fallback for unknown keywords + // not logic already applied in formatValidationError + + /* istanbul ignore next */ + + + return JSON.stringify(schema, null, 2); + } + /** + * @param {Schema=} schemaPart + * @param {(boolean | Array)=} additionalPath + * @param {boolean=} needDot + * @param {boolean=} logic + * @returns {string} + */ + + + getSchemaPartText(schemaPart, additionalPath, needDot = false, logic = true) { + if (!schemaPart) { + return ''; + } + + if (Array.isArray(additionalPath)) { + for (let i = 0; i < additionalPath.length; i++) { + /** @type {Schema | undefined} */ + const inner = schemaPart[ + /** @type {keyof Schema} */ + additionalPath[i]]; + + if (inner) { + // eslint-disable-next-line no-param-reassign + schemaPart = inner; + } else { + break; + } + } + } + + while (schemaPart.$ref) { + // eslint-disable-next-line no-param-reassign + schemaPart = this.getSchemaPart(schemaPart.$ref); + } + + let schemaText = `${this.formatSchema(schemaPart, logic)}${needDot ? '.' : ''}`; + + if (schemaPart.description) { + schemaText += `\n-> ${schemaPart.description}`; + } + + return schemaText; + } + /** + * @param {Schema=} schemaPart + * @returns {string} + */ + + + getSchemaPartDescription(schemaPart) { + if (!schemaPart) { + return ''; + } + + while (schemaPart.$ref) { + // eslint-disable-next-line no-param-reassign + schemaPart = this.getSchemaPart(schemaPart.$ref); + } + + if (schemaPart.description) { + return `\n-> ${schemaPart.description}`; + } + + return ''; + } + /** + * @param {SchemaUtilErrorObject} error + * @returns {string} + */ + + + formatValidationError(error) { + const { + keyword, + dataPath: errorDataPath + } = error; + const dataPath = `${this.baseDataPath}${errorDataPath}`; + + switch (keyword) { + case 'type': + { + const { + parentSchema, + params + } = error; // eslint-disable-next-line default-case + + switch ( + /** @type {import("ajv").TypeParams} */ + params.type) { + case 'number': + return `${dataPath} should be a ${this.getSchemaPartText(parentSchema, false, true)}`; + + case 'integer': + return `${dataPath} should be a ${this.getSchemaPartText(parentSchema, false, true)}`; + + case 'string': + return `${dataPath} should be a ${this.getSchemaPartText(parentSchema, false, true)}`; + + case 'boolean': + return `${dataPath} should be a ${this.getSchemaPartText(parentSchema, false, true)}`; + + case 'array': + return `${dataPath} should be an array:\n${this.getSchemaPartText(parentSchema)}`; + + case 'object': + return `${dataPath} should be an object:\n${this.getSchemaPartText(parentSchema)}`; + + case 'null': + return `${dataPath} should be a ${this.getSchemaPartText(parentSchema, false, true)}`; + + default: + return `${dataPath} should be:\n${this.getSchemaPartText(parentSchema)}`; + } + } + + case 'instanceof': + { + const { + parentSchema + } = error; + return `${dataPath} should be an instance of ${this.getSchemaPartText(parentSchema, false, true)}`; + } + + case 'pattern': + { + const { + params, + parentSchema + } = error; + const { + pattern + } = + /** @type {import("ajv").PatternParams} */ + params; + return `${dataPath} should match pattern ${JSON.stringify(pattern)}${getSchemaNonTypes(parentSchema)}.${this.getSchemaPartDescription(parentSchema)}`; + } + + case 'format': + { + const { + params, + parentSchema + } = error; + const { + format + } = + /** @type {import("ajv").FormatParams} */ + params; + return `${dataPath} should match format ${JSON.stringify(format)}${getSchemaNonTypes(parentSchema)}.${this.getSchemaPartDescription(parentSchema)}`; + } + + case 'formatMinimum': + case 'formatMaximum': + { + const { + params, + parentSchema + } = error; + const { + comparison, + limit + } = + /** @type {import("ajv").ComparisonParams} */ + params; + return `${dataPath} should be ${comparison} ${JSON.stringify(limit)}${getSchemaNonTypes(parentSchema)}.${this.getSchemaPartDescription(parentSchema)}`; + } + + case 'minimum': + case 'maximum': + case 'exclusiveMinimum': + case 'exclusiveMaximum': + { + const { + parentSchema, + params + } = error; + const { + comparison, + limit + } = + /** @type {import("ajv").ComparisonParams} */ + params; + const [, ...hints] = getHints( + /** @type {Schema} */ + parentSchema, true); + + if (hints.length === 0) { + hints.push(`should be ${comparison} ${limit}`); + } + + return `${dataPath} ${hints.join(' ')}${getSchemaNonTypes(parentSchema)}.${this.getSchemaPartDescription(parentSchema)}`; + } + + case 'multipleOf': + { + const { + params, + parentSchema + } = error; + const { + multipleOf + } = + /** @type {import("ajv").MultipleOfParams} */ + params; + return `${dataPath} should be multiple of ${multipleOf}${getSchemaNonTypes(parentSchema)}.${this.getSchemaPartDescription(parentSchema)}`; + } + + case 'patternRequired': + { + const { + params, + parentSchema + } = error; + const { + missingPattern + } = + /** @type {import("ajv").PatternRequiredParams} */ + params; + return `${dataPath} should have property matching pattern ${JSON.stringify(missingPattern)}${getSchemaNonTypes(parentSchema)}.${this.getSchemaPartDescription(parentSchema)}`; + } + + case 'minLength': + { + const { + params, + parentSchema + } = error; + const { + limit + } = + /** @type {import("ajv").LimitParams} */ + params; + + if (limit === 1) { + return `${dataPath} should be an non-empty string${getSchemaNonTypes(parentSchema)}.${this.getSchemaPartDescription(parentSchema)}`; + } + + const length = limit - 1; + return `${dataPath} should be longer than ${length} character${length > 1 ? 's' : ''}${getSchemaNonTypes(parentSchema)}.${this.getSchemaPartDescription(parentSchema)}`; + } + + case 'minItems': + { + const { + params, + parentSchema + } = error; + const { + limit + } = + /** @type {import("ajv").LimitParams} */ + params; + + if (limit === 1) { + return `${dataPath} should be an non-empty array${getSchemaNonTypes(parentSchema)}.${this.getSchemaPartDescription(parentSchema)}`; + } + + return `${dataPath} should not have fewer than ${limit} items${getSchemaNonTypes(parentSchema)}.${this.getSchemaPartDescription(parentSchema)}`; + } + + case 'minProperties': + { + const { + params, + parentSchema + } = error; + const { + limit + } = + /** @type {import("ajv").LimitParams} */ + params; + + if (limit === 1) { + return `${dataPath} should be an non-empty object${getSchemaNonTypes(parentSchema)}.${this.getSchemaPartDescription(parentSchema)}`; + } + + return `${dataPath} should not have fewer than ${limit} properties${getSchemaNonTypes(parentSchema)}.${this.getSchemaPartDescription(parentSchema)}`; + } + + case 'maxLength': + { + const { + params, + parentSchema + } = error; + const { + limit + } = + /** @type {import("ajv").LimitParams} */ + params; + const max = limit + 1; + return `${dataPath} should be shorter than ${max} character${max > 1 ? 's' : ''}${getSchemaNonTypes(parentSchema)}.${this.getSchemaPartDescription(parentSchema)}`; + } + + case 'maxItems': + { + const { + params, + parentSchema + } = error; + const { + limit + } = + /** @type {import("ajv").LimitParams} */ + params; + return `${dataPath} should not have more than ${limit} items${getSchemaNonTypes(parentSchema)}.${this.getSchemaPartDescription(parentSchema)}`; + } + + case 'maxProperties': + { + const { + params, + parentSchema + } = error; + const { + limit + } = + /** @type {import("ajv").LimitParams} */ + params; + return `${dataPath} should not have more than ${limit} properties${getSchemaNonTypes(parentSchema)}.${this.getSchemaPartDescription(parentSchema)}`; + } + + case 'uniqueItems': + { + const { + params, + parentSchema + } = error; + const { + i + } = + /** @type {import("ajv").UniqueItemsParams} */ + params; + return `${dataPath} should not contain the item '${error.data[i]}' twice${getSchemaNonTypes(parentSchema)}.${this.getSchemaPartDescription(parentSchema)}`; + } + + case 'additionalItems': + { + const { + params, + parentSchema + } = error; + const { + limit + } = + /** @type {import("ajv").LimitParams} */ + params; + return `${dataPath} should not have more than ${limit} items${getSchemaNonTypes(parentSchema)}. These items are valid:\n${this.getSchemaPartText(parentSchema)}`; + } + + case 'contains': + { + const { + parentSchema + } = error; + return `${dataPath} should contains at least one ${this.getSchemaPartText(parentSchema, ['contains'])} item${getSchemaNonTypes(parentSchema)}.`; + } + + case 'required': + { + const { + parentSchema, + params + } = error; + const missingProperty = + /** @type {import("ajv").DependenciesParams} */ + params.missingProperty.replace(/^\./, ''); + const hasProperty = parentSchema && Boolean( + /** @type {Schema} */ + parentSchema.properties && + /** @type {Schema} */ + parentSchema.properties[missingProperty]); + return `${dataPath} misses the property '${missingProperty}'${getSchemaNonTypes(parentSchema)}.${hasProperty ? ` Should be:\n${this.getSchemaPartText(parentSchema, ['properties', missingProperty])}` : this.getSchemaPartDescription(parentSchema)}`; + } + + case 'additionalProperties': + { + const { + params, + parentSchema + } = error; + const { + additionalProperty + } = + /** @type {import("ajv").AdditionalPropertiesParams} */ + params; + return `${dataPath} has an unknown property '${additionalProperty}'${getSchemaNonTypes(parentSchema)}. These properties are valid:\n${this.getSchemaPartText(parentSchema)}`; + } + + case 'dependencies': + { + const { + params, + parentSchema + } = error; + const { + property, + deps + } = + /** @type {import("ajv").DependenciesParams} */ + params; + const dependencies = deps.split(',').map( + /** + * @param {string} dep + * @returns {string} + */ + dep => `'${dep.trim()}'`).join(', '); + return `${dataPath} should have properties ${dependencies} when property '${property}' is present${getSchemaNonTypes(parentSchema)}.${this.getSchemaPartDescription(parentSchema)}`; + } + + case 'propertyNames': + { + const { + params, + parentSchema, + schema + } = error; + const { + propertyName + } = + /** @type {import("ajv").PropertyNamesParams} */ + params; + return `${dataPath} property name '${propertyName}' is invalid${getSchemaNonTypes(parentSchema)}. Property names should be match format ${JSON.stringify(schema.format)}.${this.getSchemaPartDescription(parentSchema)}`; + } + + case 'enum': + { + const { + parentSchema + } = error; + + if (parentSchema && + /** @type {Schema} */ + parentSchema.enum && + /** @type {Schema} */ + parentSchema.enum.length === 1) { + return `${dataPath} should be ${this.getSchemaPartText(parentSchema, false, true)}`; + } + + return `${dataPath} should be one of these:\n${this.getSchemaPartText(parentSchema)}`; + } + + case 'const': + { + const { + parentSchema + } = error; + return `${dataPath} should be equal to constant ${this.getSchemaPartText(parentSchema, false, true)}`; + } + + case 'not': + { + const postfix = likeObject( + /** @type {Schema} */ + error.parentSchema) ? `\n${this.getSchemaPartText(error.parentSchema)}` : ''; + const schemaOutput = this.getSchemaPartText(error.schema, false, false, false); + + if (canApplyNot(error.schema)) { + return `${dataPath} should be any ${schemaOutput}${postfix}.`; + } + + const { + schema, + parentSchema + } = error; + return `${dataPath} should not be ${this.getSchemaPartText(schema, false, true)}${parentSchema && likeObject(parentSchema) ? `\n${this.getSchemaPartText(parentSchema)}` : ''}`; + } + + case 'oneOf': + case 'anyOf': + { + const { + parentSchema, + children + } = error; + + if (children && children.length > 0) { + if (error.schema.length === 1) { + const lastChild = children[children.length - 1]; + const remainingChildren = children.slice(0, children.length - 1); + return this.formatValidationError(Object.assign({}, lastChild, { + children: remainingChildren, + parentSchema: Object.assign({}, parentSchema, lastChild.parentSchema) + })); + } + + let filteredChildren = filterChildren(children); + + if (filteredChildren.length === 1) { + return this.formatValidationError(filteredChildren[0]); + } + + filteredChildren = groupChildrenByFirstChild(filteredChildren); + return `${dataPath} should be one of these:\n${this.getSchemaPartText(parentSchema)}\nDetails:\n${filteredChildren.map( + /** + * @param {SchemaUtilErrorObject} nestedError + * @returns {string} + */ + nestedError => ` * ${indent(this.formatValidationError(nestedError), ' ')}`).join('\n')}`; + } + + return `${dataPath} should be one of these:\n${this.getSchemaPartText(parentSchema)}`; + } + + case 'if': + { + const { + params, + parentSchema + } = error; + const { + failingKeyword + } = + /** @type {import("ajv").IfParams} */ + params; + return `${dataPath} should match "${failingKeyword}" schema:\n${this.getSchemaPartText(parentSchema, [failingKeyword])}`; + } + + case 'absolutePath': + { + const { + message, + parentSchema + } = error; + return `${dataPath}: ${message}${this.getSchemaPartDescription(parentSchema)}`; + } + + /* istanbul ignore next */ + + default: + { + const { + message, + parentSchema + } = error; + const ErrorInJSON = JSON.stringify(error, null, 2); // For `custom`, `false schema`, `$ref` keywords + // Fallback for unknown keywords + + return `${dataPath} ${message} (${ErrorInJSON}).\n${this.getSchemaPartText(parentSchema, false)}`; + } + } + } + /** + * @param {Array} errors + * @returns {string} + */ + + + formatValidationErrors(errors) { + return errors.map(error => { + let formattedError = this.formatValidationError(error); + + if (this.postFormatter) { + formattedError = this.postFormatter(formattedError, error); + } + + return ` - ${indent(formattedError, ' ')}`; + }).join('\n'); + } + +} + +var _default = ValidationError; +exports.default = _default; \ No newline at end of file diff --git a/node_modules/sass-loader/node_modules/schema-utils/dist/index.js b/node_modules/sass-loader/node_modules/schema-utils/dist/index.js new file mode 100644 index 0000000..e7c6791 --- /dev/null +++ b/node_modules/sass-loader/node_modules/schema-utils/dist/index.js @@ -0,0 +1,5 @@ +"use strict"; + +const validate = require('./validate'); + +module.exports = validate.default; \ No newline at end of file diff --git a/node_modules/sass-loader/node_modules/schema-utils/dist/keywords/absolutePath.js b/node_modules/sass-loader/node_modules/schema-utils/dist/keywords/absolutePath.js new file mode 100644 index 0000000..1ff958f --- /dev/null +++ b/node_modules/sass-loader/node_modules/schema-utils/dist/keywords/absolutePath.js @@ -0,0 +1,93 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +/** @typedef {import("ajv").Ajv} Ajv */ + +/** @typedef {import("ajv").ValidateFunction} ValidateFunction */ + +/** @typedef {import("../validate").SchemaUtilErrorObject} SchemaUtilErrorObject */ + +/** + * @param {string} message + * @param {object} schema + * @param {string} data + * @returns {SchemaUtilErrorObject} + */ +function errorMessage(message, schema, data) { + return { + // @ts-ignore + // eslint-disable-next-line no-undefined + dataPath: undefined, + // @ts-ignore + // eslint-disable-next-line no-undefined + schemaPath: undefined, + keyword: 'absolutePath', + params: { + absolutePath: data + }, + message, + parentSchema: schema + }; +} +/** + * @param {boolean} shouldBeAbsolute + * @param {object} schema + * @param {string} data + * @returns {SchemaUtilErrorObject} + */ + + +function getErrorFor(shouldBeAbsolute, schema, data) { + const message = shouldBeAbsolute ? `The provided value ${JSON.stringify(data)} is not an absolute path!` : `A relative path is expected. However, the provided value ${JSON.stringify(data)} is an absolute path!`; + return errorMessage(message, schema, data); +} +/** + * + * @param {Ajv} ajv + * @returns {Ajv} + */ + + +function addAbsolutePathKeyword(ajv) { + ajv.addKeyword('absolutePath', { + errors: true, + type: 'string', + + compile(schema, parentSchema) { + /** @type {ValidateFunction} */ + const callback = data => { + let passes = true; + const isExclamationMarkPresent = data.includes('!'); + + if (isExclamationMarkPresent) { + callback.errors = [errorMessage(`The provided value ${JSON.stringify(data)} contains exclamation mark (!) which is not allowed because it's reserved for loader syntax.`, parentSchema, data)]; + passes = false; + } // ?:[A-Za-z]:\\ - Windows absolute path + // \\\\ - Windows network absolute path + // \/ - Unix-like OS absolute path + + + const isCorrectAbsolutePath = schema === /^(?:[A-Za-z]:(\\|\/)|\\\\|\/)/.test(data); + + if (!isCorrectAbsolutePath) { + callback.errors = [getErrorFor(schema, parentSchema, data)]; + passes = false; + } + + return passes; + }; + + callback.errors = []; + return callback; + } + + }); + return ajv; +} + +var _default = addAbsolutePathKeyword; +exports.default = _default; \ No newline at end of file diff --git a/node_modules/sass-loader/node_modules/schema-utils/dist/util/Range.js b/node_modules/sass-loader/node_modules/schema-utils/dist/util/Range.js new file mode 100644 index 0000000..74bb057 --- /dev/null +++ b/node_modules/sass-loader/node_modules/schema-utils/dist/util/Range.js @@ -0,0 +1,163 @@ +"use strict"; + +/** + * @typedef {[number, boolean]} RangeValue + */ + +/** + * @callback RangeValueCallback + * @param {RangeValue} rangeValue + * @returns {boolean} + */ +class Range { + /** + * @param {"left" | "right"} side + * @param {boolean} exclusive + * @returns {">" | ">=" | "<" | "<="} + */ + static getOperator(side, exclusive) { + if (side === 'left') { + return exclusive ? '>' : '>='; + } + + return exclusive ? '<' : '<='; + } + /** + * @param {number} value + * @param {boolean} logic is not logic applied + * @param {boolean} exclusive is range exclusive + * @returns {string} + */ + + + static formatRight(value, logic, exclusive) { + if (logic === false) { + return Range.formatLeft(value, !logic, !exclusive); + } + + return `should be ${Range.getOperator('right', exclusive)} ${value}`; + } + /** + * @param {number} value + * @param {boolean} logic is not logic applied + * @param {boolean} exclusive is range exclusive + * @returns {string} + */ + + + static formatLeft(value, logic, exclusive) { + if (logic === false) { + return Range.formatRight(value, !logic, !exclusive); + } + + return `should be ${Range.getOperator('left', exclusive)} ${value}`; + } + /** + * @param {number} start left side value + * @param {number} end right side value + * @param {boolean} startExclusive is range exclusive from left side + * @param {boolean} endExclusive is range exclusive from right side + * @param {boolean} logic is not logic applied + * @returns {string} + */ + + + static formatRange(start, end, startExclusive, endExclusive, logic) { + let result = 'should be'; + result += ` ${Range.getOperator(logic ? 'left' : 'right', logic ? startExclusive : !startExclusive)} ${start} `; + result += logic ? 'and' : 'or'; + result += ` ${Range.getOperator(logic ? 'right' : 'left', logic ? endExclusive : !endExclusive)} ${end}`; + return result; + } + /** + * @param {Array} values + * @param {boolean} logic is not logic applied + * @return {RangeValue} computed value and it's exclusive flag + */ + + + static getRangeValue(values, logic) { + let minMax = logic ? Infinity : -Infinity; + let j = -1; + const predicate = logic ? + /** @type {RangeValueCallback} */ + ([value]) => value <= minMax : + /** @type {RangeValueCallback} */ + ([value]) => value >= minMax; + + for (let i = 0; i < values.length; i++) { + if (predicate(values[i])) { + [minMax] = values[i]; + j = i; + } + } + + if (j > -1) { + return values[j]; + } + + return [Infinity, true]; + } + + constructor() { + /** @type {Array} */ + this._left = []; + /** @type {Array} */ + + this._right = []; + } + /** + * @param {number} value + * @param {boolean=} exclusive + */ + + + left(value, exclusive = false) { + this._left.push([value, exclusive]); + } + /** + * @param {number} value + * @param {boolean=} exclusive + */ + + + right(value, exclusive = false) { + this._right.push([value, exclusive]); + } + /** + * @param {boolean} logic is not logic applied + * @return {string} "smart" range string representation + */ + + + format(logic = true) { + const [start, leftExclusive] = Range.getRangeValue(this._left, logic); + const [end, rightExclusive] = Range.getRangeValue(this._right, !logic); + + if (!Number.isFinite(start) && !Number.isFinite(end)) { + return ''; + } + + const realStart = leftExclusive ? start + 1 : start; + const realEnd = rightExclusive ? end - 1 : end; // e.g. 5 < x < 7, 5 < x <= 6, 6 <= x <= 6 + + if (realStart === realEnd) { + return `should be ${logic ? '' : '!'}= ${realStart}`; + } // e.g. 4 < x < ∞ + + + if (Number.isFinite(start) && !Number.isFinite(end)) { + return Range.formatLeft(start, logic, leftExclusive); + } // e.g. ∞ < x < 4 + + + if (!Number.isFinite(start) && Number.isFinite(end)) { + return Range.formatRight(end, logic, rightExclusive); + } + + return Range.formatRange(start, end, leftExclusive, rightExclusive, logic); + } + +} + +module.exports = Range; \ No newline at end of file diff --git a/node_modules/sass-loader/node_modules/schema-utils/dist/util/hints.js b/node_modules/sass-loader/node_modules/schema-utils/dist/util/hints.js new file mode 100644 index 0000000..afa00d5 --- /dev/null +++ b/node_modules/sass-loader/node_modules/schema-utils/dist/util/hints.js @@ -0,0 +1,105 @@ +"use strict"; + +const Range = require('./Range'); +/** @typedef {import("../validate").Schema} Schema */ + +/** + * @param {Schema} schema + * @param {boolean} logic + * @return {string[]} + */ + + +module.exports.stringHints = function stringHints(schema, logic) { + const hints = []; + let type = 'string'; + const currentSchema = { ...schema + }; + + if (!logic) { + const tmpLength = currentSchema.minLength; + const tmpFormat = currentSchema.formatMinimum; + const tmpExclusive = currentSchema.formatExclusiveMaximum; + currentSchema.minLength = currentSchema.maxLength; + currentSchema.maxLength = tmpLength; + currentSchema.formatMinimum = currentSchema.formatMaximum; + currentSchema.formatMaximum = tmpFormat; + currentSchema.formatExclusiveMaximum = !currentSchema.formatExclusiveMinimum; + currentSchema.formatExclusiveMinimum = !tmpExclusive; + } + + if (typeof currentSchema.minLength === 'number') { + if (currentSchema.minLength === 1) { + type = 'non-empty string'; + } else { + const length = Math.max(currentSchema.minLength - 1, 0); + hints.push(`should be longer than ${length} character${length > 1 ? 's' : ''}`); + } + } + + if (typeof currentSchema.maxLength === 'number') { + if (currentSchema.maxLength === 0) { + type = 'empty string'; + } else { + const length = currentSchema.maxLength + 1; + hints.push(`should be shorter than ${length} character${length > 1 ? 's' : ''}`); + } + } + + if (currentSchema.pattern) { + hints.push(`should${logic ? '' : ' not'} match pattern ${JSON.stringify(currentSchema.pattern)}`); + } + + if (currentSchema.format) { + hints.push(`should${logic ? '' : ' not'} match format ${JSON.stringify(currentSchema.format)}`); + } + + if (currentSchema.formatMinimum) { + hints.push(`should be ${currentSchema.formatExclusiveMinimum ? '>' : '>='} ${JSON.stringify(currentSchema.formatMinimum)}`); + } + + if (currentSchema.formatMaximum) { + hints.push(`should be ${currentSchema.formatExclusiveMaximum ? '<' : '<='} ${JSON.stringify(currentSchema.formatMaximum)}`); + } + + return [type].concat(hints); +}; +/** + * @param {Schema} schema + * @param {boolean} logic + * @return {string[]} + */ + + +module.exports.numberHints = function numberHints(schema, logic) { + const hints = [schema.type === 'integer' ? 'integer' : 'number']; + const range = new Range(); + + if (typeof schema.minimum === 'number') { + range.left(schema.minimum); + } + + if (typeof schema.exclusiveMinimum === 'number') { + range.left(schema.exclusiveMinimum, true); + } + + if (typeof schema.maximum === 'number') { + range.right(schema.maximum); + } + + if (typeof schema.exclusiveMaximum === 'number') { + range.right(schema.exclusiveMaximum, true); + } + + const rangeFormat = range.format(logic); + + if (rangeFormat) { + hints.push(rangeFormat); + } + + if (typeof schema.multipleOf === 'number') { + hints.push(`should${logic ? '' : ' not'} be multiple of ${schema.multipleOf}`); + } + + return hints; +}; \ No newline at end of file diff --git a/node_modules/sass-loader/node_modules/schema-utils/dist/validate.js b/node_modules/sass-loader/node_modules/schema-utils/dist/validate.js new file mode 100644 index 0000000..c7ea5ee --- /dev/null +++ b/node_modules/sass-loader/node_modules/schema-utils/dist/validate.js @@ -0,0 +1,162 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = void 0; + +var _absolutePath = _interopRequireDefault(require("./keywords/absolutePath")); + +var _ValidationError = _interopRequireDefault(require("./ValidationError")); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +// Use CommonJS require for ajv libs so TypeScript consumers aren't locked into esModuleInterop (see #110). +const Ajv = require('ajv'); + +const ajvKeywords = require('ajv-keywords'); +/** @typedef {import("json-schema").JSONSchema4} JSONSchema4 */ + +/** @typedef {import("json-schema").JSONSchema6} JSONSchema6 */ + +/** @typedef {import("json-schema").JSONSchema7} JSONSchema7 */ + +/** @typedef {import("ajv").ErrorObject} ErrorObject */ + +/** + * @typedef {Object} Extend + * @property {number=} formatMinimum + * @property {number=} formatMaximum + * @property {boolean=} formatExclusiveMinimum + * @property {boolean=} formatExclusiveMaximum + */ + +/** @typedef {(JSONSchema4 | JSONSchema6 | JSONSchema7) & Extend} Schema */ + +/** @typedef {ErrorObject & { children?: Array}} SchemaUtilErrorObject */ + +/** + * @callback PostFormatter + * @param {string} formattedError + * @param {SchemaUtilErrorObject} error + * @returns {string} + */ + +/** + * @typedef {Object} ValidationErrorConfiguration + * @property {string=} name + * @property {string=} baseDataPath + * @property {PostFormatter=} postFormatter + */ + + +const ajv = new Ajv({ + allErrors: true, + verbose: true, + $data: true +}); +ajvKeywords(ajv, ['instanceof', 'formatMinimum', 'formatMaximum', 'patternRequired']); // Custom keywords + +(0, _absolutePath.default)(ajv); +/** + * @param {Schema} schema + * @param {Array | object} options + * @param {ValidationErrorConfiguration=} configuration + * @returns {void} + */ + +function validate(schema, options, configuration) { + let errors = []; + + if (Array.isArray(options)) { + errors = Array.from(options, nestedOptions => validateObject(schema, nestedOptions)); + errors.forEach((list, idx) => { + const applyPrefix = + /** + * @param {SchemaUtilErrorObject} error + */ + error => { + // eslint-disable-next-line no-param-reassign + error.dataPath = `[${idx}]${error.dataPath}`; + + if (error.children) { + error.children.forEach(applyPrefix); + } + }; + + list.forEach(applyPrefix); + }); + errors = errors.reduce((arr, items) => { + arr.push(...items); + return arr; + }, []); + } else { + errors = validateObject(schema, options); + } + + if (errors.length > 0) { + throw new _ValidationError.default(errors, schema, configuration); + } +} +/** + * @param {Schema} schema + * @param {Array | object} options + * @returns {Array} + */ + + +function validateObject(schema, options) { + const compiledSchema = ajv.compile(schema); + const valid = compiledSchema(options); + if (valid) return []; + return compiledSchema.errors ? filterErrors(compiledSchema.errors) : []; +} +/** + * @param {Array} errors + * @returns {Array} + */ + + +function filterErrors(errors) { + /** @type {Array} */ + let newErrors = []; + + for (const error of + /** @type {Array} */ + errors) { + const { + dataPath + } = error; + /** @type {Array} */ + + let children = []; + newErrors = newErrors.filter(oldError => { + if (oldError.dataPath.includes(dataPath)) { + if (oldError.children) { + children = children.concat(oldError.children.slice(0)); + } // eslint-disable-next-line no-undefined, no-param-reassign + + + oldError.children = undefined; + children.push(oldError); + return false; + } + + return true; + }); + + if (children.length) { + error.children = children; + } + + newErrors.push(error); + } + + return newErrors; +} // TODO change after resolve https://github.com/microsoft/TypeScript/issues/34994 + + +validate.ValidationError = _ValidationError.default; +validate.ValidateError = _ValidationError.default; +var _default = validate; +exports.default = _default; \ No newline at end of file diff --git a/node_modules/sass-loader/node_modules/schema-utils/package.json b/node_modules/sass-loader/node_modules/schema-utils/package.json new file mode 100644 index 0000000..009d534 --- /dev/null +++ b/node_modules/sass-loader/node_modules/schema-utils/package.json @@ -0,0 +1,76 @@ +{ + "name": "schema-utils", + "version": "2.7.1", + "description": "webpack Validation Utils", + "license": "MIT", + "repository": "webpack/schema-utils", + "author": "webpack Contrib (https://github.com/webpack-contrib)", + "homepage": "https://github.com/webpack/schema-utils", + "bugs": "https://github.com/webpack/schema-utils/issues", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "main": "dist/index.js", + "types": "declarations/index.d.ts", + "engines": { + "node": ">= 8.9.0" + }, + "scripts": { + "start": "npm run build -- -w", + "clean": "del-cli dist declarations", + "prebuild": "npm run clean", + "build:types": "tsc --declaration --emitDeclarationOnly --outDir declarations && prettier \"declarations/**/*.ts\" --write", + "build:code": "cross-env NODE_ENV=production babel src -d dist --copy-files", + "build": "npm-run-all -p \"build:**\"", + "commitlint": "commitlint --from=master", + "security": "npm audit", + "lint:prettier": "prettier \"{**/*,*}.{js,json,md,yml,css,ts}\" --list-different", + "lint:js": "eslint --cache .", + "lint:types": "tsc --pretty --noEmit", + "lint": "npm-run-all -l -p \"lint:**\"", + "test:only": "cross-env NODE_ENV=test jest", + "test:watch": "npm run test:only -- --watch", + "test:coverage": "npm run test:only -- --collectCoverageFrom=\"src/**/*.js\" --coverage", + "pretest": "npm run lint", + "test": "npm run test:coverage", + "prepare": "npm run build", + "release": "standard-version", + "defaults": "webpack-defaults" + }, + "files": [ + "dist", + "declarations" + ], + "dependencies": { + "ajv": "^6.12.4", + "ajv-keywords": "^3.5.2", + "@types/json-schema": "^7.0.5" + }, + "devDependencies": { + "@babel/cli": "^7.10.5", + "@babel/core": "^7.11.4", + "@babel/preset-env": "^7.11.0", + "@commitlint/cli": "^10.0.0", + "@commitlint/config-conventional": "^10.0.0", + "@webpack-contrib/defaults": "^6.3.0", + "@webpack-contrib/eslint-config-webpack": "^3.0.0", + "babel-jest": "^25.5.1", + "cross-env": "^6.0.3", + "del": "^5.1.0", + "del-cli": "^3.0.1", + "eslint": "^7.7.0", + "eslint-config-prettier": "^6.11.0", + "eslint-plugin-import": "^2.22.0", + "husky": "^4.2.5", + "jest": "^25.5.4", + "lint-staged": "^10.2.13", + "npm-run-all": "^4.1.5", + "prettier": "^1.19.1", + "standard-version": "^9.0.0", + "typescript": "^4.0.2" + }, + "keywords": [ + "webpack" + ] +} diff --git a/node_modules/sass-loader/package.json b/node_modules/sass-loader/package.json new file mode 100644 index 0000000..028a211 --- /dev/null +++ b/node_modules/sass-loader/package.json @@ -0,0 +1,108 @@ +{ + "name": "sass-loader", + "version": "8.0.2", + "description": "Sass loader for webpack", + "license": "MIT", + "repository": "webpack-contrib/sass-loader", + "author": "J. Tangelder", + "homepage": "https://github.com/webpack-contrib/sass-loader", + "bugs": "https://github.com/webpack-contrib/sass-loader/issues", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "main": "dist/cjs.js", + "engines": { + "node": ">= 8.9.0" + }, + "scripts": { + "start": "npm run build -- -w", + "clean": "del-cli dist", + "prebuild": "npm run clean", + "build": "cross-env NODE_ENV=production babel src -d dist --copy-files", + "commitlint": "commitlint --from=master", + "security": "npm audit", + "lint:prettier": "prettier \"{**/*,*}.{js,json,md,yml,css,ts}\" --list-different", + "lint:js": "eslint --cache .", + "lint": "npm-run-all -l -p \"lint:**\"", + "test:only": "cross-env NODE_ENV=test jest", + "test:watch": "npm run test:only -- --watch", + "test:manual": "npm run build && webpack-dev-server test/manual/src/index.js --open --config test/manual/webpack.config.js", + "test:coverage": "npm run test:only -- --collectCoverageFrom=\"src/**/*.js\" --coverage", + "pretest": "npm run lint", + "test": "npm run test:coverage", + "prepare": "npm run build", + "release": "standard-version", + "defaults": "webpack-defaults" + }, + "files": [ + "dist" + ], + "peerDependencies": { + "webpack": "^4.36.0 || ^5.0.0", + "node-sass": "^4.0.0", + "sass": "^1.3.0", + "fibers": ">= 3.1.0" + }, + "peerDependenciesMeta": { + "node-sass": { + "optional": true + }, + "sass": { + "optional": true + }, + "fibers": { + "optional": true + } + }, + "dependencies": { + "clone-deep": "^4.0.1", + "loader-utils": "^1.2.3", + "neo-async": "^2.6.1", + "schema-utils": "^2.6.1", + "semver": "^6.3.0" + }, + "devDependencies": { + "@babel/cli": "^7.8.0", + "@babel/core": "^7.8.0", + "@babel/preset-env": "^7.8.2", + "@commitlint/cli": "^8.3.4", + "@commitlint/config-conventional": "^8.3.4", + "@webpack-contrib/defaults": "^6.3.0", + "@webpack-contrib/eslint-config-webpack": "^3.0.0", + "babel-jest": "^24.9.0", + "bootstrap": "^4.4.1", + "bootstrap-sass": "^3.4.1", + "commitlint-azure-pipelines-cli": "^1.0.3", + "cross-env": "^6.0.3", + "css-loader": "^3.4.2", + "del": "^5.1.0", + "del-cli": "^3.0.0", + "eslint": "^6.8.0", + "eslint-config-prettier": "^6.9.0", + "eslint-plugin-import": "^2.20.0", + "fibers": "^4.0.2", + "file-loader": "^5.0.2", + "husky": "^4.0.7", + "jest": "^24.9.0", + "jest-junit": "^10.0.0", + "jquery": "^3.4.1", + "lint-staged": "^9.5.0", + "memfs": "^3.0.3", + "node-sass": "^4.13.0", + "npm-run-all": "^4.1.5", + "prettier": "^1.19.1", + "sass": "^1.24.4", + "standard-version": "^7.0.1", + "style-loader": "^1.1.2", + "webpack": "^4.41.5", + "webpack-cli": "^3.3.10", + "webpack-dev-server": "^3.10.1" + }, + "keywords": [ + "sass", + "libsass", + "webpack", + "loader" + ] +} diff --git a/node_modules/sass/LICENSE b/node_modules/sass/LICENSE new file mode 100644 index 0000000..8606650 --- /dev/null +++ b/node_modules/sass/LICENSE @@ -0,0 +1,1687 @@ +Dart Sass license: + +Copyright (c) 2016, Google Inc. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +-------------------------------------------------------------------------------- + +Dart SDK license: + +Copyright 2012, the Dart project authors. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google LLC 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 +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +-------------------------------------------------------------------------------- + +_fe_analyzer_shared license: + +Copyright 2019, the Dart project authors. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google LLC 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 +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +-------------------------------------------------------------------------------- + +analyzer, protobuf and protoc_plugin license: + +Copyright 2013, the Dart project authors. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google LLC 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 +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +-------------------------------------------------------------------------------- + +archive license: + +The MIT License + +Copyright (c) 2013-2021 Brendan Duncan. +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: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +-------------------------------------------------------------------------------- + +args, csslib and logging license: + +Copyright 2013, the Dart project authors. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google LLC 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 +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +-------------------------------------------------------------------------------- + +async, cli_util, collection, mime, source_map_stack_trace, stream_channel and +typed_data license: + +Copyright 2015, the Dart project authors. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google LLC 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 +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +-------------------------------------------------------------------------------- + +boolean_selector, meta and shelf_packages_handler license: + +Copyright 2016, the Dart project authors. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google LLC 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 +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +-------------------------------------------------------------------------------- + +charcode license: + +Copyright 2014, the Dart project authors. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. 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 +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +-------------------------------------------------------------------------------- + +checked_yaml license: + +Copyright 2019, the Dart project authors. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. 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 +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +-------------------------------------------------------------------------------- + +cli_pkg license: + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + +-------------------------------------------------------------------------------- + +cli_repl license: + +Copyright (c) 2018, Jennifer Thakar. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the project 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. + + +-------------------------------------------------------------------------------- + +convert, crypto, shelf_static and vm_service license: + +Copyright 2015, the Dart project authors. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google LLC 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 +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +-------------------------------------------------------------------------------- + +coverage, dart_style, dartdoc, glob, http, http_parser, matcher, path, pool, +pub_semver, source_span, string_scanner, test and watcher license: + +Copyright 2014, the Dart project authors. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google LLC 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 +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +-------------------------------------------------------------------------------- + +dart_mappable and type_plus license: + +MIT License + +Copyright (c) 2021 Kilian Schulte + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +-------------------------------------------------------------------------------- + +ffi and package_config license: + +Copyright 2019, the Dart project authors. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google LLC 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 +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +-------------------------------------------------------------------------------- + +file license: + +Copyright 2017, the Dart project authors. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. 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 +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +-------------------------------------------------------------------------------- + +fixnum, http_multi_server, oauth2, shelf, shelf_web_socket, source_maps and +stack_trace license: + +Copyright 2014, the Dart project authors. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google LLC 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 +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +-------------------------------------------------------------------------------- + +frontend_server_client license: + +Copyright 2020, the Dart project authors. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google LLC 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 +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +-------------------------------------------------------------------------------- + +grinder and webkit_inspection_protocol license: + +Copyright 2013, Google Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. 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 +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +-------------------------------------------------------------------------------- + +html license: + +Copyright (c) 2006-2012 The Authors + +Contributors: +James Graham - jg307@cam.ac.uk +Anne van Kesteren - annevankesteren@gmail.com +Lachlan Hunt - lachlan.hunt@lachy.id.au +Matt McDonald - kanashii@kanashii.ca +Sam Ruby - rubys@intertwingly.net +Ian Hickson (Google) - ian@hixie.ch +Thomas Broyer - t.broyer@ltgt.net +Jacques Distler - distler@golem.ph.utexas.edu +Henri Sivonen - hsivonen@iki.fi +Adam Barth - abarth@webkit.org +Eric Seidel - eric@webkit.org +The Mozilla Foundation (contributions from Henri Sivonen since 2008) +David Flanagan (Mozilla) - dflanagan@mozilla.com +Google LLC (contributed the Dart port) - misc@dartlang.org + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +-------------------------------------------------------------------------------- + +io, stream_transform and term_glyph license: + +Copyright 2017, the Dart project authors. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google LLC 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 +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +-------------------------------------------------------------------------------- + +js license: + +Copyright 2012, the Dart project authors. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google LLC 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 +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +-------------------------------------------------------------------------------- + +json_annotation license: + +Copyright 2017, the Dart project authors. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. 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 +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +-------------------------------------------------------------------------------- + +lints license: + +Copyright 2021, the Dart project authors. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google LLC 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 +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +-------------------------------------------------------------------------------- + +markdown license: + +Copyright 2012, the Dart project authors. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google LLC 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 +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +-------------------------------------------------------------------------------- + +native_stack_traces license: + +Copyright 2020, the Dart project authors. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google LLC 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 +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +-------------------------------------------------------------------------------- + +native_synchronization license: + +Copyright 2023, the Dart project authors. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google LLC 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 +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +-------------------------------------------------------------------------------- + +node_interop license: + +Copyright (c) 2017, Anatoly Pulyaevskiy. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the 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 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. + + +-------------------------------------------------------------------------------- + +node_preamble license: + +The MIT License (MIT) + +Copyright (c) 2015 Michael Bullington + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +=== + +Copyright 2012, the Dart project authors. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. 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 +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +-------------------------------------------------------------------------------- + +petitparser and xml license: + +The MIT License + +Copyright (c) 2006-2023 Lukas Renggli. +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: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + + +-------------------------------------------------------------------------------- + +pointycastle license: + + +Copyright (c) 2000 - 2019 The Legion of the Bouncy Castle Inc. (https://www.bouncycastle.org) + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + + +-------------------------------------------------------------------------------- + +pub_api_client license: + +MIT License + +Copyright (c) 2020 Leo Farias + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + +-------------------------------------------------------------------------------- + +pubspec license: + +Copyright (c) 2015, Anders Holmgren. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the 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 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. + + +-------------------------------------------------------------------------------- + +pubspec_parse license: + +Copyright 2018, the Dart project authors. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google LLC 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 +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +-------------------------------------------------------------------------------- + +quiver and retry license: + + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +-------------------------------------------------------------------------------- + +test_api and test_core license: + +Copyright 2018, the Dart project authors. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google LLC 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 +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +-------------------------------------------------------------------------------- + +test_descriptor and web_socket_channel license: + +Copyright 2016, the Dart project authors. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google LLC 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 +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +-------------------------------------------------------------------------------- + +test_process license: + +Copyright 2017, the Dart project authors. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google LLC 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 +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +-------------------------------------------------------------------------------- + +uri license: + +Copyright 2013, the Dart project authors. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. 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 +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +-------------------------------------------------------------------------------- + +web license: + +Copyright 2023, the Dart project authors. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google LLC 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 +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +-------------------------------------------------------------------------------- + +yaml license: + +Copyright (c) 2014, the Dart project authors. +Copyright (c) 2006, Kirill Simonov. + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/sass/README.md b/node_modules/sass/README.md new file mode 100644 index 0000000..c7ad591 --- /dev/null +++ b/node_modules/sass/README.md @@ -0,0 +1,173 @@ +A pure JavaScript implementation of [Sass][sass]. **Sass makes CSS fun again**. + + + + + + + +
+ Sass logo + + npm statistics + + GitHub actions build status +
+ Appveyor build status +
+ +[sass]: https://sass-lang.com/ + +This package is a distribution of [Dart Sass][], compiled to pure JavaScript +with no native code or external dependencies. It provides a command-line `sass` +executable and a Node.js API. + +[Dart Sass]: https://github.com/sass/dart-sass + +* [Usage](#usage) +* [See Also](#see-also) +* [Behavioral Differences from Ruby Sass](#behavioral-differences-from-ruby-sass) + +## Usage + +You can install Sass globally using `npm install -g sass` which will provide +access to the `sass` executable. You can also add it to your project using +`npm install --save-dev sass`. This provides the executable as well as a +library: + +[npm]: https://www.npmjs.com/package/sass + +```js +const sass = require('sass'); + +const result = sass.compile(scssFilename); + +// OR + +// Note that `compileAsync()` is substantially slower than `compile()`. +const result = await sass.compileAsync(scssFilename); +``` + +See [the Sass website][js api] for full API documentation. + +[js api]: https://sass-lang.com/documentation/js-api + +### Legacy API + +Dart Sass also supports an older JavaScript API that's fully compatible with +[Node Sass] (with a few exceptions listed below), with support for both the +[`render()`] and [`renderSync()`] functions. This API is considered deprecated +and will be removed in Dart Sass 2.0.0, so it should be avoided in new projects. + +[Node Sass]: https://github.com/sass/node-sass +[`render()`]: https://sass-lang.com/documentation/js-api/functions/render +[`renderSync()`]: https://sass-lang.com/documentation/js-api/functions/renderSync + +Sass's support for the legacy JavaScript API has the following limitations: + +* Only the `"expanded"` and `"compressed"` values of [`outputStyle`] are + supported. + +* Dart Sass doesn't support the [`precision`] option. Dart Sass defaults to a + sufficiently high precision for all existing browsers, and making this + customizable would make the code substantially less efficient. + +* Dart Sass doesn't support the [`sourceComments`] option. Source maps are the + recommended way of locating the origin of generated selectors. + +[`outputStyle`]: https://sass-lang.com/documentation/js-api/interfaces/LegacySharedOptions#outputStyle +[`precision`]: https://github.com/sass/node-sass#precision +[`sourceComments`]: https://github.com/sass/node-sass#sourcecomments + +## See Also + +* [Dart Sass][], from which this package is compiled, can be used either as a + stand-alone executable or as a Dart library. Running Dart Sass on the Dart VM + is substantially faster than running the pure JavaScript version, so this may + be appropriate for performance-sensitive applications. The Dart API is also + (currently) more user-friendly than the JavaScript API. See + [the Dart Sass README][Using Dart Sass] for details on how to use it. + +* [Node Sass][], which is a wrapper around [LibSass][], the C++ implementation + of Sass. Node Sass supports the same API as this package and is also faster + (although it's usually a little slower than Dart Sass). However, it requires a + native library which may be difficult to install, and it's generally slower to + add features and fix bugs. + +[Using Dart Sass]: https://github.com/sass/dart-sass#using-dart-sass +[Node Sass]: https://www.npmjs.com/package/node-sass +[LibSass]: https://sass-lang.com/libsass + +## Behavioral Differences from Ruby Sass + +There are a few intentional behavioral differences between Dart Sass and Ruby +Sass. These are generally places where Ruby Sass has an undesired behavior, and +it's substantially easier to implement the correct behavior than it would be to +implement compatible behavior. These should all have tracking bugs against Ruby +Sass to update the reference behavior. + +1. `@extend` only accepts simple selectors, as does the second argument of + `selector-extend()`. See [issue 1599][]. + +2. Subject selectors are not supported. See [issue 1126][]. + +3. Pseudo selector arguments are parsed as ``s rather than + having a more limited custom parsing. See [issue 2120][]. + +4. The numeric precision is set to 10. See [issue 1122][]. + +5. The indented syntax parser is more flexible: it doesn't require consistent + indentation across the whole document. See [issue 2176][]. + +6. Colors do not support channel-by-channel arithmetic. See [issue 2144][]. + +7. Unitless numbers aren't `==` to unit numbers with the same value. In + addition, map keys follow the same logic as `==`-equality. See + [issue 1496][]. + +8. `rgba()` and `hsla()` alpha values with percentage units are interpreted as + percentages. Other units are forbidden. See [issue 1525][]. + +9. Too many variable arguments passed to a function is an error. See + [issue 1408][]. + +10. Allow `@extend` to reach outside a media query if there's an identical + `@extend` defined outside that query. This isn't tracked explicitly, because + it'll be irrelevant when [issue 1050][] is fixed. + +11. Some selector pseudos containing placeholder selectors will be compiled + where they wouldn't be in Ruby Sass. This better matches the semantics of + the selectors in question, and is more efficient. See [issue 2228][]. + +12. The old-style `:property value` syntax is not supported in the indented + syntax. See [issue 2245][]. + +13. The reference combinator is not supported. See [issue 303][]. + +14. Universal selector unification is symmetrical. See [issue 2247][]. + +15. `@extend` doesn't produce an error if it matches but fails to unify. See + [issue 2250][]. + +16. Dart Sass currently only supports UTF-8 documents. We'd like to support + more, but Dart currently doesn't support them. See [dart-lang/sdk#11744][], + for example. + +[issue 1599]: https://github.com/sass/sass/issues/1599 +[issue 1126]: https://github.com/sass/sass/issues/1126 +[issue 2120]: https://github.com/sass/sass/issues/2120 +[issue 1122]: https://github.com/sass/sass/issues/1122 +[issue 2176]: https://github.com/sass/sass/issues/2176 +[issue 2144]: https://github.com/sass/sass/issues/2144 +[issue 1496]: https://github.com/sass/sass/issues/1496 +[issue 1525]: https://github.com/sass/sass/issues/1525 +[issue 1408]: https://github.com/sass/sass/issues/1408 +[issue 1050]: https://github.com/sass/sass/issues/1050 +[issue 2228]: https://github.com/sass/sass/issues/2228 +[issue 2245]: https://github.com/sass/sass/issues/2245 +[issue 303]: https://github.com/sass/sass/issues/303 +[issue 2247]: https://github.com/sass/sass/issues/2247 +[issue 2250]: https://github.com/sass/sass/issues/2250 +[dart-lang/sdk#11744]: https://github.com/dart-lang/sdk/issues/11744 + +Disclaimer: this is not an official Google product. diff --git a/node_modules/sass/package.json b/node_modules/sass/package.json new file mode 100644 index 0000000..12ad8d0 --- /dev/null +++ b/node_modules/sass/package.json @@ -0,0 +1 @@ +{"name":"sass","description":"A pure JavaScript implementation of Sass.","license":"MIT","bugs":"https://github.com/sass/dart-sass/issues","homepage":"https://github.com/sass/dart-sass","repository":{"type":"git","url":"https://github.com/sass/dart-sass"},"author":{"name":"Natalie Weizenbaum","email":"nweiz@google.com","url":"https://github.com/nex3"},"engines":{"node":">=14.0.0"},"dependencies":{"chokidar":">=3.0.0 <4.0.0","immutable":"^4.0.0","source-map-js":">=0.6.2 <2.0.0"},"keywords":["style","scss","sass","preprocessor","css"],"types":"types/index.d.ts","exports":{"types":"./types/index.d.ts","node":{"require":"./sass.node.js","default":"./sass.node.mjs"},"default":{"require":"./sass.default.cjs","default":"./sass.default.js"}},"version":"1.72.0","bin":{"sass":"sass.js"},"main":"sass.node.js"} \ No newline at end of file diff --git a/node_modules/sass/sass.dart.js b/node_modules/sass/sass.dart.js new file mode 100644 index 0000000..034c930 --- /dev/null +++ b/node_modules/sass/sass.dart.js @@ -0,0 +1,117519 @@ +// Because of vitejs/vite#12340, there's no way to reliably detect whether we're +// running as a (possibly bundled/polyfilled) ESM module or as a CommonJS +// module. In order to work everywhere, we have to provide the load function via +// a side channel on the global object. We write it as a stack so that multiple +// cli_pkg packages can depend on one another without clobbering their exports. +if (!globalThis._cliPkgExports) { + globalThis._cliPkgExports = []; +} +let _cliPkgExports = {}; +globalThis._cliPkgExports.push(_cliPkgExports); + +_cliPkgExports.load = function(_cliPkgRequires, _cliPkgExportParam) { +var dartNodeIsActuallyNode = typeof process !== "undefined" && (process.versions || {}).hasOwnProperty('node'); + +// make sure to keep this as 'var' +// we don't want block scoping +var self = dartNodeIsActuallyNode ? Object.create(globalThis) : globalThis; + +self.scheduleImmediate = typeof setImmediate !== "undefined" + ? function (cb) { + setImmediate(cb); + } + : function(cb) { + setTimeout(cb, 0); + }; + +// CommonJS globals. +if (typeof require !== "undefined") { + self.require = require; +} +self.exports = _cliPkgExportParam || _cliPkgExports; + +// Node.js specific exports, check to see if they exist & or polyfilled + +if (typeof process !== "undefined") { + self.process = process; +} + +if (typeof __dirname !== "undefined") { + self.__dirname = __dirname; +} + +if (typeof __filename !== "undefined") { + self.__filename = __filename; +} + +if (typeof Buffer !== "undefined") { + self.Buffer = Buffer; +} + +// if we're running in a browser, Dart supports most of this out of box +// make sure we only run these in Node.js environment + +if (dartNodeIsActuallyNode) { + // This line is to: + // 1) Prevent Webpack from bundling. + // 2) In Webpack on Node.js, make sure we're using the native Node.js require, which is available via __non_webpack_require__ + // https://github.com/mbullington/node_preamble.dart/issues/18#issuecomment-527305561 + var url = ("undefined" !== typeof __webpack_require__ ? __non_webpack_require__ : require)("url"); + + // Setting `self.location=` in Electron throws a `TypeError`, so we define it + // as a property instead to be safe. + Object.defineProperty(self, "location", { + value: { + get href() { + if (url.pathToFileURL) { + return url.pathToFileURL(process.cwd()).href + "/"; + } else { + // This isn't really a correct transformation, but it's the best we have + // for versions of Node <10.12.0 which introduced `url.pathToFileURL()`. + // For example, it will fail for paths that contain characters that need + // to be escaped in URLs. + return "file://" + (function() { + var cwd = process.cwd(); + if (process.platform != "win32") return cwd; + return "/" + cwd.replace(/\\/g, "/"); + })() + "/" + } + } + } + }); + + (function() { + function computeCurrentScript() { + try { + throw new Error(); + } catch(e) { + var stack = e.stack; + var re = new RegExp("^ *at [^(]*\\((.*):[0-9]*:[0-9]*\\)$", "mg"); + var lastMatch = null; + do { + var match = re.exec(stack); + if (match != null) lastMatch = match; + } while (match != null); + return lastMatch[1]; + } + } + + // Setting `self.document=` isn't known to throw an error anywhere like + // `self.location=` does on Electron, but it's better to be future-proof + // just in case.. + var cachedCurrentScript = null; + Object.defineProperty(self, "document", { + value: { + get currentScript() { + if (cachedCurrentScript == null) { + cachedCurrentScript = {src: computeCurrentScript()}; + } + return cachedCurrentScript; + } + } + }); + })(); + + self.dartDeferredLibraryLoader = function(uri, successCallback, errorCallback) { + try { + load(uri); + successCallback(); + } catch (error) { + errorCallback(error); + } + }; +} + +self.immutable = _cliPkgRequires.immutable; +self.chokidar = _cliPkgRequires.chokidar; +self.readline = _cliPkgRequires.readline; +self.fs = _cliPkgRequires.fs; +self.nodeModule = _cliPkgRequires.nodeModule; +self.stream = _cliPkgRequires.stream; +self.util = _cliPkgRequires.util; +// Generated by dart2js (NullSafetyMode.sound, trust primitives, omit checks, lax runtime type, csp, intern-composite-values), the Dart to JavaScript compiler version: 3.3.1. +// The code supports the following hooks: +// dartPrint(message): +// if this function is defined it is called instead of the Dart [print] +// method. +// +// dartMainRunner(main, args): +// if this function is defined, the Dart [main] method will not be invoked +// directly. Instead, a closure that will invoke [main], and its arguments +// [args] is passed to [dartMainRunner]. +// +// dartDeferredLibraryLoader(uri, successCallback, errorCallback, loadId, loadPriority): +// if this function is defined, it will be called when a deferred library +// is loaded. It should load and eval the javascript of `uri`, and call +// successCallback. If it fails to do so, it should call errorCallback with +// an error. The loadId argument is the deferred import that resulted in +// this uri being loaded. The loadPriority argument is the priority the +// library should be loaded with as specified in the code via the +// load-priority annotation (0: normal, 1: high). +// dartDeferredLibraryMultiLoader(uris, successCallback, errorCallback, loadId, loadPriority): +// if this function is defined, it will be called when a deferred library +// is loaded. It should load and eval the javascript of every URI in `uris`, +// and call successCallback. If it fails to do so, it should call +// errorCallback with an error. The loadId argument is the deferred import +// that resulted in this uri being loaded. The loadPriority argument is the +// priority the library should be loaded with as specified in the code via +// the load-priority annotation (0: normal, 1: high). +// +// dartCallInstrumentation(id, qualifiedName): +// if this function is defined, it will be called at each entry of a +// method or constructor. Used only when compiling programs with +// --experiment-call-instrumentation. +(function dartProgram() { + function copyProperties(from, to) { + var keys = Object.keys(from); + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + to[key] = from[key]; + } + } + function mixinPropertiesHard(from, to) { + var keys = Object.keys(from); + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + if (!to.hasOwnProperty(key)) { + to[key] = from[key]; + } + } + } + function mixinPropertiesEasy(from, to) { + Object.assign(to, from); + } + var supportsDirectProtoAccess = function() { + var cls = function() { + }; + cls.prototype = {p: {}}; + var object = new cls(); + if (!(Object.getPrototypeOf(object) && Object.getPrototypeOf(object).p === cls.prototype.p)) + return false; + try { + if (typeof navigator != "undefined" && typeof navigator.userAgent == "string" && navigator.userAgent.indexOf("Chrome/") >= 0) + return true; + if (typeof version == "function" && version.length == 0) { + var v = version(); + if (/^\d+\.\d+\.\d+\.\d+$/.test(v)) + return true; + } + } catch (_) { + } + return false; + }(); + function inherit(cls, sup) { + cls.prototype.constructor = cls; + cls.prototype["$is" + cls.name] = cls; + if (sup != null) { + if (supportsDirectProtoAccess) { + Object.setPrototypeOf(cls.prototype, sup.prototype); + return; + } + var clsPrototype = Object.create(sup.prototype); + copyProperties(cls.prototype, clsPrototype); + cls.prototype = clsPrototype; + } + } + function inheritMany(sup, classes) { + for (var i = 0; i < classes.length; i++) { + inherit(classes[i], sup); + } + } + function mixinEasy(cls, mixin) { + mixinPropertiesEasy(mixin.prototype, cls.prototype); + cls.prototype.constructor = cls; + } + function mixinHard(cls, mixin) { + mixinPropertiesHard(mixin.prototype, cls.prototype); + cls.prototype.constructor = cls; + } + function lazyOld(holder, name, getterName, initializer) { + var uninitializedSentinel = holder; + holder[name] = uninitializedSentinel; + holder[getterName] = function() { + holder[getterName] = function() { + A.throwCyclicInit(name); + }; + var result; + var sentinelInProgress = initializer; + try { + if (holder[name] === uninitializedSentinel) { + result = holder[name] = sentinelInProgress; + result = holder[name] = initializer(); + } else { + result = holder[name]; + } + } finally { + if (result === sentinelInProgress) { + holder[name] = null; + } + holder[getterName] = function() { + return this[name]; + }; + } + return result; + }; + } + function lazy(holder, name, getterName, initializer) { + var uninitializedSentinel = holder; + holder[name] = uninitializedSentinel; + holder[getterName] = function() { + if (holder[name] === uninitializedSentinel) { + holder[name] = initializer(); + } + holder[getterName] = function() { + return this[name]; + }; + return holder[name]; + }; + } + function lazyFinal(holder, name, getterName, initializer) { + var uninitializedSentinel = holder; + holder[name] = uninitializedSentinel; + holder[getterName] = function() { + if (holder[name] === uninitializedSentinel) { + var value = initializer(); + if (holder[name] !== uninitializedSentinel) { + A.throwLateFieldADI(name); + } + holder[name] = value; + } + var finalValue = holder[name]; + holder[getterName] = function() { + return finalValue; + }; + return finalValue; + }; + } + function makeConstList(list) { + list.immutable$list = Array; + list.fixed$length = Array; + return list; + } + function convertToFastObject(properties) { + function t() { + } + t.prototype = properties; + new t(); + return properties; + } + function convertAllToFastObject(arrayOfObjects) { + for (var i = 0; i < arrayOfObjects.length; ++i) { + convertToFastObject(arrayOfObjects[i]); + } + } + var functionCounter = 0; + function instanceTearOffGetter(isIntercepted, parameters) { + var cache = null; + return isIntercepted ? function(receiver) { + if (cache === null) + cache = A.closureFromTearOff(parameters); + return new cache(receiver, this); + } : function() { + if (cache === null) + cache = A.closureFromTearOff(parameters); + return new cache(this, null); + }; + } + function staticTearOffGetter(parameters) { + var cache = null; + return function() { + if (cache === null) + cache = A.closureFromTearOff(parameters).prototype; + return cache; + }; + } + var typesOffset = 0; + function tearOffParameters(container, isStatic, isIntercepted, requiredParameterCount, optionalParameterDefaultValues, callNames, funsOrNames, funType, applyIndex, needsDirectAccess) { + if (typeof funType == "number") { + funType += typesOffset; + } + return {co: container, iS: isStatic, iI: isIntercepted, rC: requiredParameterCount, dV: optionalParameterDefaultValues, cs: callNames, fs: funsOrNames, fT: funType, aI: applyIndex || 0, nDA: needsDirectAccess}; + } + function installStaticTearOff(holder, getterName, requiredParameterCount, optionalParameterDefaultValues, callNames, funsOrNames, funType, applyIndex) { + var parameters = tearOffParameters(holder, true, false, requiredParameterCount, optionalParameterDefaultValues, callNames, funsOrNames, funType, applyIndex, false); + var getterFunction = staticTearOffGetter(parameters); + holder[getterName] = getterFunction; + } + function installInstanceTearOff(prototype, getterName, isIntercepted, requiredParameterCount, optionalParameterDefaultValues, callNames, funsOrNames, funType, applyIndex, needsDirectAccess) { + isIntercepted = !!isIntercepted; + var parameters = tearOffParameters(prototype, false, isIntercepted, requiredParameterCount, optionalParameterDefaultValues, callNames, funsOrNames, funType, applyIndex, !!needsDirectAccess); + var getterFunction = instanceTearOffGetter(isIntercepted, parameters); + prototype[getterName] = getterFunction; + } + function setOrUpdateInterceptorsByTag(newTags) { + var tags = init.interceptorsByTag; + if (!tags) { + init.interceptorsByTag = newTags; + return; + } + copyProperties(newTags, tags); + } + function setOrUpdateLeafTags(newTags) { + var tags = init.leafTags; + if (!tags) { + init.leafTags = newTags; + return; + } + copyProperties(newTags, tags); + } + function updateTypes(newTypes) { + var types = init.types; + var length = types.length; + types.push.apply(types, newTypes); + return length; + } + function updateHolder(holder, newHolder) { + copyProperties(newHolder, holder); + return holder; + } + var hunkHelpers = function() { + var mkInstance = function(isIntercepted, requiredParameterCount, optionalParameterDefaultValues, callNames, applyIndex) { + return function(container, getterName, name, funType) { + return installInstanceTearOff(container, getterName, isIntercepted, requiredParameterCount, optionalParameterDefaultValues, callNames, [name], funType, applyIndex, false); + }; + }, + mkStatic = function(requiredParameterCount, optionalParameterDefaultValues, callNames, applyIndex) { + return function(container, getterName, name, funType) { + return installStaticTearOff(container, getterName, requiredParameterCount, optionalParameterDefaultValues, callNames, [name], funType, applyIndex); + }; + }; + return {inherit: inherit, inheritMany: inheritMany, mixin: mixinEasy, mixinHard: mixinHard, installStaticTearOff: installStaticTearOff, installInstanceTearOff: installInstanceTearOff, _instance_0u: mkInstance(0, 0, null, ["call$0"], 0), _instance_1u: mkInstance(0, 1, null, ["call$1"], 0), _instance_2u: mkInstance(0, 2, null, ["call$2"], 0), _instance_0i: mkInstance(1, 0, null, ["call$0"], 0), _instance_1i: mkInstance(1, 1, null, ["call$1"], 0), _instance_2i: mkInstance(1, 2, null, ["call$2"], 0), _static_0: mkStatic(0, null, ["call$0"], 0), _static_1: mkStatic(1, null, ["call$1"], 0), _static_2: mkStatic(2, null, ["call$2"], 0), makeConstList: makeConstList, lazy: lazy, lazyFinal: lazyFinal, lazyOld: lazyOld, updateHolder: updateHolder, convertToFastObject: convertToFastObject, updateTypes: updateTypes, setOrUpdateInterceptorsByTag: setOrUpdateInterceptorsByTag, setOrUpdateLeafTags: setOrUpdateLeafTags}; + }(); + function initializeDeferredHunk(hunk) { + typesOffset = init.types.length; + hunk(hunkHelpers, init, holders, $); + } + var J = { + makeDispatchRecord(interceptor, proto, extension, indexability) { + return {i: interceptor, p: proto, e: extension, x: indexability}; + }, + getNativeInterceptor(object) { + var proto, objectProto, $constructor, interceptor, t1, + record = object[init.dispatchPropertyName]; + if (record == null) + if ($.initNativeDispatchFlag == null) { + A.initNativeDispatch(); + record = object[init.dispatchPropertyName]; + } + if (record != null) { + proto = record.p; + if (false === proto) + return record.i; + if (true === proto) + return object; + objectProto = Object.getPrototypeOf(object); + if (proto === objectProto) + return record.i; + if (record.e === objectProto) + throw A.wrapException(A.UnimplementedError$("Return interceptor for " + A.S(proto(object, record)))); + } + $constructor = object.constructor; + if ($constructor == null) + interceptor = null; + else { + t1 = $._JS_INTEROP_INTERCEPTOR_TAG; + if (t1 == null) + t1 = $._JS_INTEROP_INTERCEPTOR_TAG = init.getIsolateTag("_$dart_js"); + interceptor = $constructor[t1]; + } + if (interceptor != null) + return interceptor; + interceptor = A.lookupAndCacheInterceptor(object); + if (interceptor != null) + return interceptor; + if (typeof object == "function") + return B.JavaScriptFunction_methods; + proto = Object.getPrototypeOf(object); + if (proto == null) + return B.PlainJavaScriptObject_methods; + if (proto === Object.prototype) + return B.PlainJavaScriptObject_methods; + if (typeof $constructor == "function") { + t1 = $._JS_INTEROP_INTERCEPTOR_TAG; + if (t1 == null) + t1 = $._JS_INTEROP_INTERCEPTOR_TAG = init.getIsolateTag("_$dart_js"); + Object.defineProperty($constructor, t1, {value: B.UnknownJavaScriptObject_methods, enumerable: false, writable: true, configurable: true}); + return B.UnknownJavaScriptObject_methods; + } + return B.UnknownJavaScriptObject_methods; + }, + JSArray_JSArray$fixed($length, $E) { + if ($length < 0 || $length > 4294967295) + throw A.wrapException(A.RangeError$range($length, 0, 4294967295, "length", null)); + return J.JSArray_JSArray$markFixed(new Array($length), $E); + }, + JSArray_JSArray$allocateFixed($length, $E) { + if ($length > 4294967295) + throw A.wrapException(A.RangeError$range($length, 0, 4294967295, "length", null)); + return J.JSArray_JSArray$markFixed(new Array($length), $E); + }, + JSArray_JSArray$growable($length, $E) { + if ($length < 0) + throw A.wrapException(A.ArgumentError$("Length must be a non-negative integer: " + $length, null)); + return A._setArrayType(new Array($length), $E._eval$1("JSArray<0>")); + }, + JSArray_JSArray$allocateGrowable($length, $E) { + if ($length < 0) + throw A.wrapException(A.ArgumentError$("Length must be a non-negative integer: " + $length, null)); + return A._setArrayType(new Array($length), $E._eval$1("JSArray<0>")); + }, + JSArray_JSArray$markFixed(allocation, $E) { + return J.JSArray_markFixedList(A._setArrayType(allocation, $E._eval$1("JSArray<0>"))); + }, + JSArray_markFixedList(list) { + list.fixed$length = Array; + return list; + }, + JSArray_markUnmodifiableList(list) { + list.fixed$length = Array; + list.immutable$list = Array; + return list; + }, + JSArray__compareAny(a, b) { + return J.compareTo$1$ns(a, b); + }, + JSString__isWhitespace(codeUnit) { + if (codeUnit < 256) + switch (codeUnit) { + case 9: + case 10: + case 11: + case 12: + case 13: + case 32: + case 133: + case 160: + return true; + default: + return false; + } + switch (codeUnit) { + case 5760: + case 8192: + case 8193: + case 8194: + case 8195: + case 8196: + case 8197: + case 8198: + case 8199: + case 8200: + case 8201: + case 8202: + case 8232: + case 8233: + case 8239: + case 8287: + case 12288: + case 65279: + return true; + default: + return false; + } + }, + JSString__skipLeadingWhitespace(string, index) { + var t1, codeUnit; + for (t1 = string.length; index < t1;) { + codeUnit = string.charCodeAt(index); + if (codeUnit !== 32 && codeUnit !== 13 && !J.JSString__isWhitespace(codeUnit)) + break; + ++index; + } + return index; + }, + JSString__skipTrailingWhitespace(string, index) { + var index0, codeUnit; + for (; index > 0; index = index0) { + index0 = index - 1; + codeUnit = string.charCodeAt(index0); + if (codeUnit !== 32 && codeUnit !== 13 && !J.JSString__isWhitespace(codeUnit)) + break; + } + return index; + }, + getInterceptor$(receiver) { + if (typeof receiver == "number") { + if (Math.floor(receiver) == receiver) + return J.JSInt.prototype; + return J.JSNumNotInt.prototype; + } + if (typeof receiver == "string") + return J.JSString.prototype; + if (receiver == null) + return J.JSNull.prototype; + if (typeof receiver == "boolean") + return J.JSBool.prototype; + if (Array.isArray(receiver)) + return J.JSArray.prototype; + if (typeof receiver != "object") { + if (typeof receiver == "function") + return J.JavaScriptFunction.prototype; + if (typeof receiver == "symbol") + return J.JavaScriptSymbol.prototype; + if (typeof receiver == "bigint") + return J.JavaScriptBigInt.prototype; + return receiver; + } + if (receiver instanceof A.Object) + return receiver; + return J.getNativeInterceptor(receiver); + }, + getInterceptor$ansx(receiver) { + if (typeof receiver == "number") + return J.JSNumber.prototype; + if (typeof receiver == "string") + return J.JSString.prototype; + if (receiver == null) + return receiver; + if (Array.isArray(receiver)) + return J.JSArray.prototype; + if (typeof receiver != "object") { + if (typeof receiver == "function") + return J.JavaScriptFunction.prototype; + if (typeof receiver == "symbol") + return J.JavaScriptSymbol.prototype; + if (typeof receiver == "bigint") + return J.JavaScriptBigInt.prototype; + return receiver; + } + if (receiver instanceof A.Object) + return receiver; + return J.getNativeInterceptor(receiver); + }, + getInterceptor$asx(receiver) { + if (typeof receiver == "string") + return J.JSString.prototype; + if (receiver == null) + return receiver; + if (Array.isArray(receiver)) + return J.JSArray.prototype; + if (typeof receiver != "object") { + if (typeof receiver == "function") + return J.JavaScriptFunction.prototype; + if (typeof receiver == "symbol") + return J.JavaScriptSymbol.prototype; + if (typeof receiver == "bigint") + return J.JavaScriptBigInt.prototype; + return receiver; + } + if (receiver instanceof A.Object) + return receiver; + return J.getNativeInterceptor(receiver); + }, + getInterceptor$ax(receiver) { + if (receiver == null) + return receiver; + if (Array.isArray(receiver)) + return J.JSArray.prototype; + if (typeof receiver != "object") { + if (typeof receiver == "function") + return J.JavaScriptFunction.prototype; + if (typeof receiver == "symbol") + return J.JavaScriptSymbol.prototype; + if (typeof receiver == "bigint") + return J.JavaScriptBigInt.prototype; + return receiver; + } + if (receiver instanceof A.Object) + return receiver; + return J.getNativeInterceptor(receiver); + }, + getInterceptor$in(receiver) { + if (typeof receiver == "number") { + if (Math.floor(receiver) == receiver) + return J.JSInt.prototype; + return J.JSNumNotInt.prototype; + } + if (receiver == null) + return receiver; + if (!(receiver instanceof A.Object)) + return J.UnknownJavaScriptObject.prototype; + return receiver; + }, + getInterceptor$n(receiver) { + if (typeof receiver == "number") + return J.JSNumber.prototype; + if (receiver == null) + return receiver; + if (!(receiver instanceof A.Object)) + return J.UnknownJavaScriptObject.prototype; + return receiver; + }, + getInterceptor$ns(receiver) { + if (typeof receiver == "number") + return J.JSNumber.prototype; + if (typeof receiver == "string") + return J.JSString.prototype; + if (receiver == null) + return receiver; + if (!(receiver instanceof A.Object)) + return J.UnknownJavaScriptObject.prototype; + return receiver; + }, + getInterceptor$s(receiver) { + if (typeof receiver == "string") + return J.JSString.prototype; + if (receiver == null) + return receiver; + if (!(receiver instanceof A.Object)) + return J.UnknownJavaScriptObject.prototype; + return receiver; + }, + getInterceptor$x(receiver) { + if (receiver == null) + return receiver; + if (typeof receiver != "object") { + if (typeof receiver == "function") + return J.JavaScriptFunction.prototype; + if (typeof receiver == "symbol") + return J.JavaScriptSymbol.prototype; + if (typeof receiver == "bigint") + return J.JavaScriptBigInt.prototype; + return receiver; + } + if (receiver instanceof A.Object) + return receiver; + return J.getNativeInterceptor(receiver); + }, + getInterceptor$z(receiver) { + if (receiver == null) + return receiver; + if (!(receiver instanceof A.Object)) + return J.UnknownJavaScriptObject.prototype; + return receiver; + }, + set$AsyncCompiler$x(receiver, value) { + return J.getInterceptor$x(receiver).set$AsyncCompiler(receiver, value); + }, + set$CalculationInterpolation$x(receiver, value) { + return J.getInterceptor$x(receiver).set$CalculationInterpolation(receiver, value); + }, + set$CalculationOperation$x(receiver, value) { + return J.getInterceptor$x(receiver).set$CalculationOperation(receiver, value); + }, + set$Compiler$x(receiver, value) { + return J.getInterceptor$x(receiver).set$Compiler(receiver, value); + }, + set$Exception$x(receiver, value) { + return J.getInterceptor$x(receiver).set$Exception(receiver, value); + }, + set$FALSE$x(receiver, value) { + return J.getInterceptor$x(receiver).set$FALSE(receiver, value); + }, + set$Logger$x(receiver, value) { + return J.getInterceptor$x(receiver).set$Logger(receiver, value); + }, + set$NULL$x(receiver, value) { + return J.getInterceptor$x(receiver).set$NULL(receiver, value); + }, + set$NodePackageImporter$x(receiver, value) { + return J.getInterceptor$x(receiver).set$NodePackageImporter(receiver, value); + }, + set$SassArgumentList$x(receiver, value) { + return J.getInterceptor$x(receiver).set$SassArgumentList(receiver, value); + }, + set$SassBoolean$x(receiver, value) { + return J.getInterceptor$x(receiver).set$SassBoolean(receiver, value); + }, + set$SassCalculation$x(receiver, value) { + return J.getInterceptor$x(receiver).set$SassCalculation(receiver, value); + }, + set$SassColor$x(receiver, value) { + return J.getInterceptor$x(receiver).set$SassColor(receiver, value); + }, + set$SassFunction$x(receiver, value) { + return J.getInterceptor$x(receiver).set$SassFunction(receiver, value); + }, + set$SassList$x(receiver, value) { + return J.getInterceptor$x(receiver).set$SassList(receiver, value); + }, + set$SassMap$x(receiver, value) { + return J.getInterceptor$x(receiver).set$SassMap(receiver, value); + }, + set$SassMixin$x(receiver, value) { + return J.getInterceptor$x(receiver).set$SassMixin(receiver, value); + }, + set$SassNumber$x(receiver, value) { + return J.getInterceptor$x(receiver).set$SassNumber(receiver, value); + }, + set$SassString$x(receiver, value) { + return J.getInterceptor$x(receiver).set$SassString(receiver, value); + }, + set$TRUE$x(receiver, value) { + return J.getInterceptor$x(receiver).set$TRUE(receiver, value); + }, + set$Value$x(receiver, value) { + return J.getInterceptor$x(receiver).set$Value(receiver, value); + }, + set$cli_pkg_main_0_$x(receiver, value) { + return J.getInterceptor$x(receiver).set$cli_pkg_main_0_(receiver, value); + }, + set$compile$x(receiver, value) { + return J.getInterceptor$x(receiver).set$compile(receiver, value); + }, + set$compileAsync$x(receiver, value) { + return J.getInterceptor$x(receiver).set$compileAsync(receiver, value); + }, + set$compileString$x(receiver, value) { + return J.getInterceptor$x(receiver).set$compileString(receiver, value); + }, + set$compileStringAsync$x(receiver, value) { + return J.getInterceptor$x(receiver).set$compileStringAsync(receiver, value); + }, + set$context$x(receiver, value) { + return J.getInterceptor$x(receiver).set$context(receiver, value); + }, + set$dartValue$x(receiver, value) { + return J.getInterceptor$x(receiver).set$dartValue(receiver, value); + }, + set$exitCode$x(receiver, value) { + return J.getInterceptor$x(receiver).set$exitCode(receiver, value); + }, + set$info$x(receiver, value) { + return J.getInterceptor$x(receiver).set$info(receiver, value); + }, + set$initAsyncCompiler$x(receiver, value) { + return J.getInterceptor$x(receiver).set$initAsyncCompiler(receiver, value); + }, + set$initCompiler$x(receiver, value) { + return J.getInterceptor$x(receiver).set$initCompiler(receiver, value); + }, + set$length$asx(receiver, value) { + return J.getInterceptor$asx(receiver).set$length(receiver, value); + }, + set$render$x(receiver, value) { + return J.getInterceptor$x(receiver).set$render(receiver, value); + }, + set$renderSync$x(receiver, value) { + return J.getInterceptor$x(receiver).set$renderSync(receiver, value); + }, + set$sassFalse$x(receiver, value) { + return J.getInterceptor$x(receiver).set$sassFalse(receiver, value); + }, + set$sassNull$x(receiver, value) { + return J.getInterceptor$x(receiver).set$sassNull(receiver, value); + }, + set$sassTrue$x(receiver, value) { + return J.getInterceptor$x(receiver).set$sassTrue(receiver, value); + }, + set$types$x(receiver, value) { + return J.getInterceptor$x(receiver).set$types(receiver, value); + }, + get$$prototype$x(receiver) { + return J.getInterceptor$x(receiver).get$$prototype(receiver); + }, + get$_dartException$x(receiver) { + return J.getInterceptor$x(receiver).get$_dartException(receiver); + }, + get$alertAscii$x(receiver) { + return J.getInterceptor$x(receiver).get$alertAscii(receiver); + }, + get$alertColor$x(receiver) { + return J.getInterceptor$x(receiver).get$alertColor(receiver); + }, + get$argv$x(receiver) { + return J.getInterceptor$x(receiver).get$argv(receiver); + }, + get$blue$x(receiver) { + return J.getInterceptor$x(receiver).get$blue(receiver); + }, + get$brackets$x(receiver) { + return J.getInterceptor$x(receiver).get$brackets(receiver); + }, + get$charset$x(receiver) { + return J.getInterceptor$x(receiver).get$charset(receiver); + }, + get$code$x(receiver) { + return J.getInterceptor$x(receiver).get$code(receiver); + }, + get$current$x(receiver) { + return J.getInterceptor$x(receiver).get$current(receiver); + }, + get$dartValue$x(receiver) { + return J.getInterceptor$x(receiver).get$dartValue(receiver); + }, + get$debug$x(receiver) { + return J.getInterceptor$x(receiver).get$debug(receiver); + }, + get$denominatorUnits$x(receiver) { + return J.getInterceptor$x(receiver).get$denominatorUnits(receiver); + }, + get$end$z(receiver) { + return J.getInterceptor$z(receiver).get$end(receiver); + }, + get$env$x(receiver) { + return J.getInterceptor$x(receiver).get$env(receiver); + }, + get$exitCode$x(receiver) { + return J.getInterceptor$x(receiver).get$exitCode(receiver); + }, + get$fiber$x(receiver) { + return J.getInterceptor$x(receiver).get$fiber(receiver); + }, + get$file$x(receiver) { + return J.getInterceptor$x(receiver).get$file(receiver); + }, + get$filename$x(receiver) { + return J.getInterceptor$x(receiver).get$filename(receiver); + }, + get$first$ax(receiver) { + return J.getInterceptor$ax(receiver).get$first(receiver); + }, + get$functions$x(receiver) { + return J.getInterceptor$x(receiver).get$functions(receiver); + }, + get$green$x(receiver) { + return J.getInterceptor$x(receiver).get$green(receiver); + }, + get$hashCode$(receiver) { + return J.getInterceptor$(receiver).get$hashCode(receiver); + }, + get$importer$x(receiver) { + return J.getInterceptor$x(receiver).get$importer(receiver); + }, + get$importers$x(receiver) { + return J.getInterceptor$x(receiver).get$importers(receiver); + }, + get$isEmpty$asx(receiver) { + return J.getInterceptor$asx(receiver).get$isEmpty(receiver); + }, + get$isNotEmpty$asx(receiver) { + return J.getInterceptor$asx(receiver).get$isNotEmpty(receiver); + }, + get$isTTY$x(receiver) { + return J.getInterceptor$x(receiver).get$isTTY(receiver); + }, + get$iterator$ax(receiver) { + return J.getInterceptor$ax(receiver).get$iterator(receiver); + }, + get$keys$z(receiver) { + return J.getInterceptor$z(receiver).get$keys(receiver); + }, + get$last$ax(receiver) { + return J.getInterceptor$ax(receiver).get$last(receiver); + }, + get$length$asx(receiver) { + return J.getInterceptor$asx(receiver).get$length(receiver); + }, + get$loadPaths$x(receiver) { + return J.getInterceptor$x(receiver).get$loadPaths(receiver); + }, + get$logger$x(receiver) { + return J.getInterceptor$x(receiver).get$logger(receiver); + }, + get$message$x(receiver) { + return J.getInterceptor$x(receiver).get$message(receiver); + }, + get$mtime$x(receiver) { + return J.getInterceptor$x(receiver).get$mtime(receiver); + }, + get$name$x(receiver) { + return J.getInterceptor$x(receiver).get$name(receiver); + }, + get$numeratorUnits$x(receiver) { + return J.getInterceptor$x(receiver).get$numeratorUnits(receiver); + }, + get$options$x(receiver) { + return J.getInterceptor$x(receiver).get$options(receiver); + }, + get$parent$z(receiver) { + return J.getInterceptor$z(receiver).get$parent(receiver); + }, + get$path$x(receiver) { + return J.getInterceptor$x(receiver).get$path(receiver); + }, + get$platform$x(receiver) { + return J.getInterceptor$x(receiver).get$platform(receiver); + }, + get$quietDeps$x(receiver) { + return J.getInterceptor$x(receiver).get$quietDeps(receiver); + }, + get$quotes$x(receiver) { + return J.getInterceptor$x(receiver).get$quotes(receiver); + }, + get$red$x(receiver) { + return J.getInterceptor$x(receiver).get$red(receiver); + }, + get$release$x(receiver) { + return J.getInterceptor$x(receiver).get$release(receiver); + }, + get$reversed$ax(receiver) { + return J.getInterceptor$ax(receiver).get$reversed(receiver); + }, + get$runtimeType$(receiver) { + return J.getInterceptor$(receiver).get$runtimeType(receiver); + }, + get$separator$x(receiver) { + return J.getInterceptor$x(receiver).get$separator(receiver); + }, + get$sign$in(receiver) { + if (typeof receiver === "number") + return receiver > 0 ? 1 : receiver < 0 ? -1 : receiver; + return J.getInterceptor$in(receiver).get$sign(receiver); + }, + get$single$ax(receiver) { + return J.getInterceptor$ax(receiver).get$single(receiver); + }, + get$sourceMap$x(receiver) { + return J.getInterceptor$x(receiver).get$sourceMap(receiver); + }, + get$sourceMapIncludeSources$x(receiver) { + return J.getInterceptor$x(receiver).get$sourceMapIncludeSources(receiver); + }, + get$span$z(receiver) { + return J.getInterceptor$z(receiver).get$span(receiver); + }, + get$stderr$x(receiver) { + return J.getInterceptor$x(receiver).get$stderr(receiver); + }, + get$stdout$x(receiver) { + return J.getInterceptor$x(receiver).get$stdout(receiver); + }, + get$style$x(receiver) { + return J.getInterceptor$x(receiver).get$style(receiver); + }, + get$syntax$x(receiver) { + return J.getInterceptor$x(receiver).get$syntax(receiver); + }, + get$trace$z(receiver) { + return J.getInterceptor$z(receiver).get$trace(receiver); + }, + get$url$x(receiver) { + return J.getInterceptor$x(receiver).get$url(receiver); + }, + get$verbose$x(receiver) { + return J.getInterceptor$x(receiver).get$verbose(receiver); + }, + get$warn$x(receiver) { + return J.getInterceptor$x(receiver).get$warn(receiver); + }, + $add$ansx(receiver, a0) { + if (typeof receiver == "number" && typeof a0 == "number") + return receiver + a0; + return J.getInterceptor$ansx(receiver).$add(receiver, a0); + }, + $eq$(receiver, a0) { + if (receiver == null) + return a0 == null; + if (typeof receiver != "object") + return a0 != null && receiver === a0; + return J.getInterceptor$(receiver).$eq(receiver, a0); + }, + $index$asx(receiver, a0) { + if (typeof a0 === "number") + if (Array.isArray(receiver) || typeof receiver == "string" || A.isJsIndexable(receiver, receiver[init.dispatchPropertyName])) + if (a0 >>> 0 === a0 && a0 < receiver.length) + return receiver[a0]; + return J.getInterceptor$asx(receiver).$index(receiver, a0); + }, + $indexSet$ax(receiver, a0, a1) { + if (typeof a0 === "number") + if ((Array.isArray(receiver) || A.isJsIndexable(receiver, receiver[init.dispatchPropertyName])) && !receiver.immutable$list && a0 >>> 0 === a0 && a0 < receiver.length) + return receiver[a0] = a1; + return J.getInterceptor$ax(receiver).$indexSet(receiver, a0, a1); + }, + $set$2$x(receiver, a0, a1) { + return J.getInterceptor$x(receiver).$set$2(receiver, a0, a1); + }, + add$1$ax(receiver, a0) { + return J.getInterceptor$ax(receiver).add$1(receiver, a0); + }, + addAll$1$ax(receiver, a0) { + return J.getInterceptor$ax(receiver).addAll$1(receiver, a0); + }, + allMatches$1$s(receiver, a0) { + return J.getInterceptor$s(receiver).allMatches$1(receiver, a0); + }, + allMatches$2$s(receiver, a0, a1) { + return J.getInterceptor$s(receiver).allMatches$2(receiver, a0, a1); + }, + any$1$ax(receiver, a0) { + return J.getInterceptor$ax(receiver).any$1(receiver, a0); + }, + apply$2$x(receiver, a0, a1) { + return J.getInterceptor$x(receiver).apply$2(receiver, a0, a1); + }, + asImmutable$0$x(receiver) { + return J.getInterceptor$x(receiver).asImmutable$0(receiver); + }, + asMutable$0$x(receiver) { + return J.getInterceptor$x(receiver).asMutable$0(receiver); + }, + canonicalize$4$baseImporter$baseUrl$forImport$x(receiver, a0, a1, a2, a3) { + return J.getInterceptor$x(receiver).canonicalize$4$baseImporter$baseUrl$forImport(receiver, a0, a1, a2, a3); + }, + cast$1$0$ax(receiver, $T1) { + return J.getInterceptor$ax(receiver).cast$1$0(receiver, $T1); + }, + close$0$x(receiver) { + return J.getInterceptor$x(receiver).close$0(receiver); + }, + codeUnitAt$1$s(receiver, a0) { + return J.getInterceptor$s(receiver).codeUnitAt$1(receiver, a0); + }, + compareTo$1$ns(receiver, a0) { + return J.getInterceptor$ns(receiver).compareTo$1(receiver, a0); + }, + contains$1$asx(receiver, a0) { + return J.getInterceptor$asx(receiver).contains$1(receiver, a0); + }, + createInterface$1$x(receiver, a0) { + return J.getInterceptor$x(receiver).createInterface$1(receiver, a0); + }, + createRequire$1$x(receiver, a0) { + return J.getInterceptor$x(receiver).createRequire$1(receiver, a0); + }, + elementAt$1$ax(receiver, a0) { + return J.getInterceptor$ax(receiver).elementAt$1(receiver, a0); + }, + endsWith$1$s(receiver, a0) { + return J.getInterceptor$s(receiver).endsWith$1(receiver, a0); + }, + error$1$x(receiver, a0) { + return J.getInterceptor$x(receiver).error$1(receiver, a0); + }, + every$1$ax(receiver, a0) { + return J.getInterceptor$ax(receiver).every$1(receiver, a0); + }, + existsSync$1$x(receiver, a0) { + return J.getInterceptor$x(receiver).existsSync$1(receiver, a0); + }, + expand$1$1$ax(receiver, a0, $T1) { + return J.getInterceptor$ax(receiver).expand$1$1(receiver, a0, $T1); + }, + fillRange$3$ax(receiver, a0, a1, a2) { + return J.getInterceptor$ax(receiver).fillRange$3(receiver, a0, a1, a2); + }, + fold$2$ax(receiver, a0, a1) { + return J.getInterceptor$ax(receiver).fold$2(receiver, a0, a1); + }, + forEach$1$ax(receiver, a0) { + return J.getInterceptor$ax(receiver).forEach$1(receiver, a0); + }, + getRange$2$ax(receiver, a0, a1) { + return J.getInterceptor$ax(receiver).getRange$2(receiver, a0, a1); + }, + getTime$0$x(receiver) { + return J.getInterceptor$x(receiver).getTime$0(receiver); + }, + isDirectory$0$x(receiver) { + return J.getInterceptor$x(receiver).isDirectory$0(receiver); + }, + isFile$0$x(receiver) { + return J.getInterceptor$x(receiver).isFile$0(receiver); + }, + join$1$ax(receiver, a0) { + return J.getInterceptor$ax(receiver).join$1(receiver, a0); + }, + listen$1$z(receiver, a0) { + return J.getInterceptor$z(receiver).listen$1(receiver, a0); + }, + log$1$x(receiver, a0) { + return J.getInterceptor$x(receiver).log$1(receiver, a0); + }, + map$1$1$ax(receiver, a0, $T1) { + return J.getInterceptor$ax(receiver).map$1$1(receiver, a0, $T1); + }, + matchAsPrefix$2$s(receiver, a0, a1) { + return J.getInterceptor$s(receiver).matchAsPrefix$2(receiver, a0, a1); + }, + mkdirSync$1$x(receiver, a0) { + return J.getInterceptor$x(receiver).mkdirSync$1(receiver, a0); + }, + noSuchMethod$1$(receiver, a0) { + return J.getInterceptor$(receiver).noSuchMethod$1(receiver, a0); + }, + on$2$x(receiver, a0, a1) { + return J.getInterceptor$x(receiver).on$2(receiver, a0, a1); + }, + readFileSync$2$x(receiver, a0, a1) { + return J.getInterceptor$x(receiver).readFileSync$2(receiver, a0, a1); + }, + readdirSync$1$x(receiver, a0) { + return J.getInterceptor$x(receiver).readdirSync$1(receiver, a0); + }, + remove$1$z(receiver, a0) { + return J.getInterceptor$z(receiver).remove$1(receiver, a0); + }, + removeRange$2$ax(receiver, a0, a1) { + return J.getInterceptor$ax(receiver).removeRange$2(receiver, a0, a1); + }, + replaceFirst$2$s(receiver, a0, a1) { + return J.getInterceptor$s(receiver).replaceFirst$2(receiver, a0, a1); + }, + resolve$1$x(receiver, a0) { + return J.getInterceptor$x(receiver).resolve$1(receiver, a0); + }, + run$0$x(receiver) { + return J.getInterceptor$x(receiver).run$0(receiver); + }, + run$1$x(receiver, a0) { + return J.getInterceptor$x(receiver).run$1(receiver, a0); + }, + setRange$4$ax(receiver, a0, a1, a2, a3) { + return J.getInterceptor$ax(receiver).setRange$4(receiver, a0, a1, a2, a3); + }, + skip$1$ax(receiver, a0) { + return J.getInterceptor$ax(receiver).skip$1(receiver, a0); + }, + sort$1$ax(receiver, a0) { + return J.getInterceptor$ax(receiver).sort$1(receiver, a0); + }, + startsWith$1$s(receiver, a0) { + return J.getInterceptor$s(receiver).startsWith$1(receiver, a0); + }, + statSync$1$x(receiver, a0) { + return J.getInterceptor$x(receiver).statSync$1(receiver, a0); + }, + sublist$1$ax(receiver, a0) { + return J.getInterceptor$ax(receiver).sublist$1(receiver, a0); + }, + substring$1$s(receiver, a0) { + return J.getInterceptor$s(receiver).substring$1(receiver, a0); + }, + substring$2$s(receiver, a0, a1) { + return J.getInterceptor$s(receiver).substring$2(receiver, a0, a1); + }, + take$1$ax(receiver, a0) { + return J.getInterceptor$ax(receiver).take$1(receiver, a0); + }, + then$1$1$x(receiver, a0, $T1) { + return J.getInterceptor$x(receiver).then$1$1(receiver, a0, $T1); + }, + then$1$2$onError$x(receiver, a0, a1, $T1) { + return J.getInterceptor$x(receiver).then$1$2$onError(receiver, a0, a1, $T1); + }, + then$2$x(receiver, a0, a1) { + return J.getInterceptor$x(receiver).then$2(receiver, a0, a1); + }, + toArray$0$x(receiver) { + return J.getInterceptor$x(receiver).toArray$0(receiver); + }, + toList$0$ax(receiver) { + return J.getInterceptor$ax(receiver).toList$0(receiver); + }, + toList$1$growable$ax(receiver, a0) { + return J.getInterceptor$ax(receiver).toList$1$growable(receiver, a0); + }, + toRadixString$1$n(receiver, a0) { + return J.getInterceptor$n(receiver).toRadixString$1(receiver, a0); + }, + toSet$0$ax(receiver) { + return J.getInterceptor$ax(receiver).toSet$0(receiver); + }, + toString$0$(receiver) { + return J.getInterceptor$(receiver).toString$0(receiver); + }, + toString$1$color$(receiver, a0) { + return J.getInterceptor$(receiver).toString$1$color(receiver, a0); + }, + trim$0$s(receiver) { + return J.getInterceptor$s(receiver).trim$0(receiver); + }, + unlinkSync$1$x(receiver, a0) { + return J.getInterceptor$x(receiver).unlinkSync$1(receiver, a0); + }, + watch$2$x(receiver, a0, a1) { + return J.getInterceptor$x(receiver).watch$2(receiver, a0, a1); + }, + where$1$ax(receiver, a0) { + return J.getInterceptor$ax(receiver).where$1(receiver, a0); + }, + write$1$x(receiver, a0) { + return J.getInterceptor$x(receiver).write$1(receiver, a0); + }, + writeFileSync$2$x(receiver, a0, a1) { + return J.getInterceptor$x(receiver).writeFileSync$2(receiver, a0, a1); + }, + yield$0$x(receiver) { + return J.getInterceptor$x(receiver).yield$0(receiver); + }, + Interceptor: function Interceptor() { + }, + JSBool: function JSBool() { + }, + JSNull: function JSNull() { + }, + JavaScriptObject: function JavaScriptObject() { + }, + LegacyJavaScriptObject: function LegacyJavaScriptObject() { + }, + PlainJavaScriptObject: function PlainJavaScriptObject() { + }, + UnknownJavaScriptObject: function UnknownJavaScriptObject() { + }, + JavaScriptFunction: function JavaScriptFunction() { + }, + JavaScriptBigInt: function JavaScriptBigInt() { + }, + JavaScriptSymbol: function JavaScriptSymbol() { + }, + JSArray: function JSArray(t0) { + this.$ti = t0; + }, + JSUnmodifiableArray: function JSUnmodifiableArray(t0) { + this.$ti = t0; + }, + ArrayIterator: function ArrayIterator(t0, t1, t2) { + var _ = this; + _._iterable = t0; + _._length = t1; + _._index = 0; + _._current = null; + _.$ti = t2; + }, + JSNumber: function JSNumber() { + }, + JSInt: function JSInt() { + }, + JSNumNotInt: function JSNumNotInt() { + }, + JSString: function JSString() { + } + }, + A = {JS_CONST: function JS_CONST() { + }, + CastIterable_CastIterable(source, $S, $T) { + if ($S._eval$1("EfficientLengthIterable<0>")._is(source)) + return new A._EfficientLengthCastIterable(source, $S._eval$1("@<0>")._bind$1($T)._eval$1("_EfficientLengthCastIterable<1,2>")); + return new A.CastIterable(source, $S._eval$1("@<0>")._bind$1($T)._eval$1("CastIterable<1,2>")); + }, + LateError$localNI(localName) { + return new A.LateError("Local '" + localName + "' has not been initialized."); + }, + ReachabilityError$(_message) { + return new A.ReachabilityError(_message); + }, + hexDigitValue(char) { + var letter, + digit = char ^ 48; + if (digit <= 9) + return digit; + letter = char | 32; + if (97 <= letter && letter <= 102) + return letter - 87; + return -1; + }, + SystemHash_combine(hash, value) { + hash = hash + value & 536870911; + hash = hash + ((hash & 524287) << 10) & 536870911; + return hash ^ hash >>> 6; + }, + SystemHash_finish(hash) { + hash = hash + ((hash & 67108863) << 3) & 536870911; + hash ^= hash >>> 11; + return hash + ((hash & 16383) << 15) & 536870911; + }, + checkNotNullable(value, $name, $T) { + return value; + }, + isToStringVisiting(object) { + var t1, i; + for (t1 = $.toStringVisiting.length, i = 0; i < t1; ++i) + if (object === $.toStringVisiting[i]) + return true; + return false; + }, + SubListIterable$(_iterable, _start, _endOrLength, $E) { + A.RangeError_checkNotNegative(_start, "start"); + if (_endOrLength != null) { + A.RangeError_checkNotNegative(_endOrLength, "end"); + if (_start > _endOrLength) + A.throwExpression(A.RangeError$range(_start, 0, _endOrLength, "start", null)); + } + return new A.SubListIterable(_iterable, _start, _endOrLength, $E._eval$1("SubListIterable<0>")); + }, + MappedIterable_MappedIterable(iterable, $function, $S, $T) { + if (type$.EfficientLengthIterable_dynamic._is(iterable)) + return new A.EfficientLengthMappedIterable(iterable, $function, $S._eval$1("@<0>")._bind$1($T)._eval$1("EfficientLengthMappedIterable<1,2>")); + return new A.MappedIterable(iterable, $function, $S._eval$1("@<0>")._bind$1($T)._eval$1("MappedIterable<1,2>")); + }, + TakeIterable_TakeIterable(iterable, takeCount, $E) { + var _s9_ = "takeCount"; + A.ArgumentError_checkNotNull(takeCount, _s9_); + A.RangeError_checkNotNegative(takeCount, _s9_); + if (type$.EfficientLengthIterable_dynamic._is(iterable)) + return new A.EfficientLengthTakeIterable(iterable, takeCount, $E._eval$1("EfficientLengthTakeIterable<0>")); + return new A.TakeIterable(iterable, takeCount, $E._eval$1("TakeIterable<0>")); + }, + SkipIterable_SkipIterable(iterable, count, $E) { + var _s5_ = "count"; + if (type$.EfficientLengthIterable_dynamic._is(iterable)) { + A.ArgumentError_checkNotNull(count, _s5_); + A.RangeError_checkNotNegative(count, _s5_); + return new A.EfficientLengthSkipIterable(iterable, count, $E._eval$1("EfficientLengthSkipIterable<0>")); + } + A.ArgumentError_checkNotNull(count, _s5_); + A.RangeError_checkNotNegative(count, _s5_); + return new A.SkipIterable(iterable, count, $E._eval$1("SkipIterable<0>")); + }, + FollowedByIterable_FollowedByIterable$firstEfficient(first, second, $E) { + if ($E._eval$1("EfficientLengthIterable<0>")._is(second)) + return new A.EfficientLengthFollowedByIterable(first, second, $E._eval$1("EfficientLengthFollowedByIterable<0>")); + return new A.FollowedByIterable(first, second, $E._eval$1("FollowedByIterable<0>")); + }, + IterableElementError_noElement() { + return new A.StateError("No element"); + }, + IterableElementError_tooMany() { + return new A.StateError("Too many elements"); + }, + IterableElementError_tooFew() { + return new A.StateError("Too few elements"); + }, + Sort__doSort(a, left, right, compare) { + if (right - left <= 32) + A.Sort__insertionSort(a, left, right, compare); + else + A.Sort__dualPivotQuicksort(a, left, right, compare); + }, + Sort__insertionSort(a, left, right, compare) { + var i, t1, el, j, j0; + for (i = left + 1, t1 = J.getInterceptor$asx(a); i <= right; ++i) { + el = t1.$index(a, i); + j = i; + while (true) { + if (!(j > left && compare.call$2(t1.$index(a, j - 1), el) > 0)) + break; + j0 = j - 1; + t1.$indexSet(a, j, t1.$index(a, j0)); + j = j0; + } + t1.$indexSet(a, j, el); + } + }, + Sort__dualPivotQuicksort(a, left, right, compare) { + var t0, less, great, k, ak, comp, great0, less0, pivots_are_equal, t2, + sixth = B.JSInt_methods._tdivFast$1(right - left + 1, 6), + index1 = left + sixth, + index5 = right - sixth, + index3 = B.JSInt_methods._tdivFast$1(left + right, 2), + index2 = index3 - sixth, + index4 = index3 + sixth, + t1 = J.getInterceptor$asx(a), + el1 = t1.$index(a, index1), + el2 = t1.$index(a, index2), + el3 = t1.$index(a, index3), + el4 = t1.$index(a, index4), + el5 = t1.$index(a, index5); + if (compare.call$2(el1, el2) > 0) { + t0 = el2; + el2 = el1; + el1 = t0; + } + if (compare.call$2(el4, el5) > 0) { + t0 = el5; + el5 = el4; + el4 = t0; + } + if (compare.call$2(el1, el3) > 0) { + t0 = el3; + el3 = el1; + el1 = t0; + } + if (compare.call$2(el2, el3) > 0) { + t0 = el3; + el3 = el2; + el2 = t0; + } + if (compare.call$2(el1, el4) > 0) { + t0 = el4; + el4 = el1; + el1 = t0; + } + if (compare.call$2(el3, el4) > 0) { + t0 = el4; + el4 = el3; + el3 = t0; + } + if (compare.call$2(el2, el5) > 0) { + t0 = el5; + el5 = el2; + el2 = t0; + } + if (compare.call$2(el2, el3) > 0) { + t0 = el3; + el3 = el2; + el2 = t0; + } + if (compare.call$2(el4, el5) > 0) { + t0 = el5; + el5 = el4; + el4 = t0; + } + t1.$indexSet(a, index1, el1); + t1.$indexSet(a, index3, el3); + t1.$indexSet(a, index5, el5); + t1.$indexSet(a, index2, t1.$index(a, left)); + t1.$indexSet(a, index4, t1.$index(a, right)); + less = left + 1; + great = right - 1; + if (J.$eq$(compare.call$2(el2, el4), 0)) { + for (k = less; k <= great; ++k) { + ak = t1.$index(a, k); + comp = compare.call$2(ak, el2); + if (comp === 0) + continue; + if (comp < 0) { + if (k !== less) { + t1.$indexSet(a, k, t1.$index(a, less)); + t1.$indexSet(a, less, ak); + } + ++less; + } else + for (; true;) { + comp = compare.call$2(t1.$index(a, great), el2); + if (comp > 0) { + --great; + continue; + } else { + great0 = great - 1; + if (comp < 0) { + t1.$indexSet(a, k, t1.$index(a, less)); + less0 = less + 1; + t1.$indexSet(a, less, t1.$index(a, great)); + t1.$indexSet(a, great, ak); + great = great0; + less = less0; + break; + } else { + t1.$indexSet(a, k, t1.$index(a, great)); + t1.$indexSet(a, great, ak); + great = great0; + break; + } + } + } + } + pivots_are_equal = true; + } else { + for (k = less; k <= great; ++k) { + ak = t1.$index(a, k); + if (compare.call$2(ak, el2) < 0) { + if (k !== less) { + t1.$indexSet(a, k, t1.$index(a, less)); + t1.$indexSet(a, less, ak); + } + ++less; + } else if (compare.call$2(ak, el4) > 0) + for (; true;) + if (compare.call$2(t1.$index(a, great), el4) > 0) { + --great; + if (great < k) + break; + continue; + } else { + great0 = great - 1; + if (compare.call$2(t1.$index(a, great), el2) < 0) { + t1.$indexSet(a, k, t1.$index(a, less)); + less0 = less + 1; + t1.$indexSet(a, less, t1.$index(a, great)); + t1.$indexSet(a, great, ak); + less = less0; + } else { + t1.$indexSet(a, k, t1.$index(a, great)); + t1.$indexSet(a, great, ak); + } + great = great0; + break; + } + } + pivots_are_equal = false; + } + t2 = less - 1; + t1.$indexSet(a, left, t1.$index(a, t2)); + t1.$indexSet(a, t2, el2); + t2 = great + 1; + t1.$indexSet(a, right, t1.$index(a, t2)); + t1.$indexSet(a, t2, el4); + A.Sort__doSort(a, left, less - 2, compare); + A.Sort__doSort(a, great + 2, right, compare); + if (pivots_are_equal) + return; + if (less < index1 && great > index5) { + for (; J.$eq$(compare.call$2(t1.$index(a, less), el2), 0);) + ++less; + for (; J.$eq$(compare.call$2(t1.$index(a, great), el4), 0);) + --great; + for (k = less; k <= great; ++k) { + ak = t1.$index(a, k); + if (compare.call$2(ak, el2) === 0) { + if (k !== less) { + t1.$indexSet(a, k, t1.$index(a, less)); + t1.$indexSet(a, less, ak); + } + ++less; + } else if (compare.call$2(ak, el4) === 0) + for (; true;) + if (compare.call$2(t1.$index(a, great), el4) === 0) { + --great; + if (great < k) + break; + continue; + } else { + great0 = great - 1; + if (compare.call$2(t1.$index(a, great), el2) < 0) { + t1.$indexSet(a, k, t1.$index(a, less)); + less0 = less + 1; + t1.$indexSet(a, less, t1.$index(a, great)); + t1.$indexSet(a, great, ak); + less = less0; + } else { + t1.$indexSet(a, k, t1.$index(a, great)); + t1.$indexSet(a, great, ak); + } + great = great0; + break; + } + } + A.Sort__doSort(a, less, great, compare); + } else + A.Sort__doSort(a, less, great, compare); + }, + _CastIterableBase: function _CastIterableBase() { + }, + CastIterator: function CastIterator(t0, t1) { + this._source = t0; + this.$ti = t1; + }, + CastIterable: function CastIterable(t0, t1) { + this._source = t0; + this.$ti = t1; + }, + _EfficientLengthCastIterable: function _EfficientLengthCastIterable(t0, t1) { + this._source = t0; + this.$ti = t1; + }, + _CastListBase: function _CastListBase() { + }, + _CastListBase_sort_closure: function _CastListBase_sort_closure(t0, t1) { + this.$this = t0; + this.compare = t1; + }, + CastList: function CastList(t0, t1) { + this._source = t0; + this.$ti = t1; + }, + CastSet: function CastSet(t0, t1, t2) { + this._source = t0; + this._emptySet = t1; + this.$ti = t2; + }, + CastMap: function CastMap(t0, t1) { + this._source = t0; + this.$ti = t1; + }, + CastMap_forEach_closure: function CastMap_forEach_closure(t0, t1) { + this.$this = t0; + this.f = t1; + }, + CastMap_entries_closure: function CastMap_entries_closure(t0) { + this.$this = t0; + }, + LateError: function LateError(t0) { + this._message = t0; + }, + ReachabilityError: function ReachabilityError(t0) { + this._message = t0; + }, + CodeUnits: function CodeUnits(t0) { + this._string = t0; + }, + nullFuture_closure: function nullFuture_closure() { + }, + SentinelValue: function SentinelValue() { + }, + EfficientLengthIterable: function EfficientLengthIterable() { + }, + ListIterable: function ListIterable() { + }, + SubListIterable: function SubListIterable(t0, t1, t2, t3) { + var _ = this; + _.__internal$_iterable = t0; + _._start = t1; + _._endOrLength = t2; + _.$ti = t3; + }, + ListIterator: function ListIterator(t0, t1, t2) { + var _ = this; + _.__internal$_iterable = t0; + _.__internal$_length = t1; + _.__internal$_index = 0; + _.__internal$_current = null; + _.$ti = t2; + }, + MappedIterable: function MappedIterable(t0, t1, t2) { + this.__internal$_iterable = t0; + this._f = t1; + this.$ti = t2; + }, + EfficientLengthMappedIterable: function EfficientLengthMappedIterable(t0, t1, t2) { + this.__internal$_iterable = t0; + this._f = t1; + this.$ti = t2; + }, + MappedIterator: function MappedIterator(t0, t1, t2) { + var _ = this; + _.__internal$_current = null; + _._iterator = t0; + _._f = t1; + _.$ti = t2; + }, + MappedListIterable: function MappedListIterable(t0, t1, t2) { + this._source = t0; + this._f = t1; + this.$ti = t2; + }, + WhereIterable: function WhereIterable(t0, t1, t2) { + this.__internal$_iterable = t0; + this._f = t1; + this.$ti = t2; + }, + WhereIterator: function WhereIterator(t0, t1) { + this._iterator = t0; + this._f = t1; + }, + ExpandIterable: function ExpandIterable(t0, t1, t2) { + this.__internal$_iterable = t0; + this._f = t1; + this.$ti = t2; + }, + ExpandIterator: function ExpandIterator(t0, t1, t2, t3) { + var _ = this; + _._iterator = t0; + _._f = t1; + _._currentExpansion = t2; + _.__internal$_current = null; + _.$ti = t3; + }, + TakeIterable: function TakeIterable(t0, t1, t2) { + this.__internal$_iterable = t0; + this._takeCount = t1; + this.$ti = t2; + }, + EfficientLengthTakeIterable: function EfficientLengthTakeIterable(t0, t1, t2) { + this.__internal$_iterable = t0; + this._takeCount = t1; + this.$ti = t2; + }, + TakeIterator: function TakeIterator(t0, t1, t2) { + this._iterator = t0; + this._remaining = t1; + this.$ti = t2; + }, + SkipIterable: function SkipIterable(t0, t1, t2) { + this.__internal$_iterable = t0; + this._skipCount = t1; + this.$ti = t2; + }, + EfficientLengthSkipIterable: function EfficientLengthSkipIterable(t0, t1, t2) { + this.__internal$_iterable = t0; + this._skipCount = t1; + this.$ti = t2; + }, + SkipIterator: function SkipIterator(t0, t1) { + this._iterator = t0; + this._skipCount = t1; + }, + SkipWhileIterable: function SkipWhileIterable(t0, t1, t2) { + this.__internal$_iterable = t0; + this._f = t1; + this.$ti = t2; + }, + SkipWhileIterator: function SkipWhileIterator(t0, t1) { + this._iterator = t0; + this._f = t1; + this._hasSkipped = false; + }, + EmptyIterable: function EmptyIterable(t0) { + this.$ti = t0; + }, + EmptyIterator: function EmptyIterator() { + }, + FollowedByIterable: function FollowedByIterable(t0, t1, t2) { + this.__internal$_first = t0; + this._second = t1; + this.$ti = t2; + }, + EfficientLengthFollowedByIterable: function EfficientLengthFollowedByIterable(t0, t1, t2) { + this.__internal$_first = t0; + this._second = t1; + this.$ti = t2; + }, + FollowedByIterator: function FollowedByIterator(t0, t1) { + this._currentIterator = t0; + this._nextIterable = t1; + }, + WhereTypeIterable: function WhereTypeIterable(t0, t1) { + this._source = t0; + this.$ti = t1; + }, + WhereTypeIterator: function WhereTypeIterator(t0, t1) { + this._source = t0; + this.$ti = t1; + }, + FixedLengthListMixin: function FixedLengthListMixin() { + }, + UnmodifiableListMixin: function UnmodifiableListMixin() { + }, + UnmodifiableListBase: function UnmodifiableListBase() { + }, + ReversedListIterable: function ReversedListIterable(t0, t1) { + this._source = t0; + this.$ti = t1; + }, + Symbol: function Symbol(t0) { + this.__internal$_name = t0; + }, + __CastListBase__CastIterableBase_ListMixin: function __CastListBase__CastIterableBase_ListMixin() { + }, + ConstantMap_ConstantMap$from(other, $K, $V) { + var allStrings, k, object, index, index0, map, + keys = A.List_List$from(other.get$keys(other), true, $K), + t1 = keys.length, + _i = 0; + while (true) { + if (!(_i < t1)) { + allStrings = true; + break; + } + k = keys[_i]; + if (typeof k != "string" || "__proto__" === k) { + allStrings = false; + break; + } + ++_i; + } + if (allStrings) { + object = {}; + for (index = 0, _i = 0; _i < keys.length; keys.length === t1 || (0, A.throwConcurrentModificationError)(keys), ++_i, index = index0) { + k = keys[_i]; + other.$index(0, k); + index0 = index + 1; + object[k] = index; + } + map = new A.ConstantStringMap(object, A.List_List$from(other.get$values(other), true, $V), $K._eval$1("@<0>")._bind$1($V)._eval$1("ConstantStringMap<1,2>")); + map.$keys = keys; + return map; + } + return new A.ConstantMapView(A.LinkedHashMap_LinkedHashMap$from(other, $K, $V), $K._eval$1("@<0>")._bind$1($V)._eval$1("ConstantMapView<1,2>")); + }, + ConstantMap__throwUnmodifiable() { + throw A.wrapException(A.UnsupportedError$("Cannot modify unmodifiable Map")); + }, + ConstantSet__throwUnmodifiable() { + throw A.wrapException(A.UnsupportedError$("Cannot modify constant Set")); + }, + instantiate1(f, T1) { + var t1 = new A.Instantiation1(f, T1._eval$1("Instantiation1<0>")); + t1.Instantiation$1(f); + return t1; + }, + unminifyOrTag(rawClassName) { + var preserved = init.mangledGlobalNames[rawClassName]; + if (preserved != null) + return preserved; + return rawClassName; + }, + isJsIndexable(object, record) { + var result; + if (record != null) { + result = record.x; + if (result != null) + return result; + } + return type$.JavaScriptIndexingBehavior_dynamic._is(object); + }, + S(value) { + var result; + if (typeof value == "string") + return value; + if (typeof value == "number") { + if (value !== 0) + return "" + value; + } else if (true === value) + return "true"; + else if (false === value) + return "false"; + else if (value == null) + return "null"; + result = J.toString$0$(value); + return result; + }, + JSInvocationMirror$(_memberName, _internalName, _kind, _arguments, _namedArgumentNames, _typeArgumentCount) { + return new A.JSInvocationMirror(_memberName, _kind, _arguments, _namedArgumentNames, _typeArgumentCount); + }, + Primitives_objectHashCode(object) { + var hash, + property = $.Primitives__identityHashCodeProperty; + if (property == null) + property = $.Primitives__identityHashCodeProperty = Symbol("identityHashCode"); + hash = object[property]; + if (hash == null) { + hash = Math.random() * 0x3fffffff | 0; + object[property] = hash; + } + return hash; + }, + Primitives_parseInt(source, radix) { + var decimalMatch, maxCharCode, digitsPart, t1, i, _null = null, + match = /^\s*[+-]?((0x[a-f0-9]+)|(\d+)|([a-z0-9]+))\s*$/i.exec(source); + if (match == null) + return _null; + decimalMatch = match[3]; + if (radix == null) { + if (decimalMatch != null) + return parseInt(source, 10); + if (match[2] != null) + return parseInt(source, 16); + return _null; + } + if (radix < 2 || radix > 36) + throw A.wrapException(A.RangeError$range(radix, 2, 36, "radix", _null)); + if (radix === 10 && decimalMatch != null) + return parseInt(source, 10); + if (radix < 10 || decimalMatch == null) { + maxCharCode = radix <= 10 ? 47 + radix : 86 + radix; + digitsPart = match[1]; + for (t1 = digitsPart.length, i = 0; i < t1; ++i) + if ((digitsPart.charCodeAt(i) | 32) > maxCharCode) + return _null; + } + return parseInt(source, radix); + }, + Primitives_parseDouble(source) { + var result, trimmed; + if (!/^\s*[+-]?(?:Infinity|NaN|(?:\.\d+|\d+(?:\.\d*)?)(?:[eE][+-]?\d+)?)\s*$/.test(source)) + return null; + result = parseFloat(source); + if (isNaN(result)) { + trimmed = B.JSString_methods.trim$0(source); + if (trimmed === "NaN" || trimmed === "+NaN" || trimmed === "-NaN") + return result; + return null; + } + return result; + }, + Primitives_objectTypeName(object) { + return A.Primitives__objectTypeNameNewRti(object); + }, + Primitives__objectTypeNameNewRti(object) { + var interceptor, dispatchName, $constructor, constructorName; + if (object instanceof A.Object) + return A._rtiToString(A.instanceType(object), null); + interceptor = J.getInterceptor$(object); + if (interceptor === B.Interceptor_methods || interceptor === B.JavaScriptObject_methods || type$.UnknownJavaScriptObject._is(object)) { + dispatchName = B.C_JS_CONST(object); + if (dispatchName !== "Object" && dispatchName !== "") + return dispatchName; + $constructor = object.constructor; + if (typeof $constructor == "function") { + constructorName = $constructor.name; + if (typeof constructorName == "string" && constructorName !== "Object" && constructorName !== "") + return constructorName; + } + } + return A._rtiToString(A.instanceType(object), null); + }, + Primitives_safeToString(object) { + if (object == null || typeof object == "number" || A._isBool(object)) + return J.toString$0$(object); + if (typeof object == "string") + return JSON.stringify(object); + if (object instanceof A.Closure) + return object.toString$0(0); + if (object instanceof A._Record) + return object._toString$1(true); + return "Instance of '" + A.Primitives_objectTypeName(object) + "'"; + }, + Primitives_currentUri() { + if (!!self.location) + return self.location.href; + return null; + }, + Primitives__fromCharCodeApply(array) { + var result, i, i0, chunkEnd, + end = array.length; + if (end <= 500) + return String.fromCharCode.apply(null, array); + for (result = "", i = 0; i < end; i = i0) { + i0 = i + 500; + chunkEnd = i0 < end ? i0 : end; + result += String.fromCharCode.apply(null, array.slice(i, chunkEnd)); + } + return result; + }, + Primitives_stringFromCodePoints(codePoints) { + var t1, _i, i, + a = A._setArrayType([], type$.JSArray_int); + for (t1 = codePoints.length, _i = 0; _i < codePoints.length; codePoints.length === t1 || (0, A.throwConcurrentModificationError)(codePoints), ++_i) { + i = codePoints[_i]; + if (!A._isInt(i)) + throw A.wrapException(A.argumentErrorValue(i)); + if (i <= 65535) + a.push(i); + else if (i <= 1114111) { + a.push(55296 + (B.JSInt_methods._shrOtherPositive$1(i - 65536, 10) & 1023)); + a.push(56320 + (i & 1023)); + } else + throw A.wrapException(A.argumentErrorValue(i)); + } + return A.Primitives__fromCharCodeApply(a); + }, + Primitives_stringFromCharCodes(charCodes) { + var t1, _i, i; + for (t1 = charCodes.length, _i = 0; _i < t1; ++_i) { + i = charCodes[_i]; + if (!A._isInt(i)) + throw A.wrapException(A.argumentErrorValue(i)); + if (i < 0) + throw A.wrapException(A.argumentErrorValue(i)); + if (i > 65535) + return A.Primitives_stringFromCodePoints(charCodes); + } + return A.Primitives__fromCharCodeApply(charCodes); + }, + Primitives_stringFromNativeUint8List(charCodes, start, end) { + var i, result, i0, chunkEnd; + if (end <= 500 && start === 0 && end === charCodes.length) + return String.fromCharCode.apply(null, charCodes); + for (i = start, result = ""; i < end; i = i0) { + i0 = i + 500; + chunkEnd = i0 < end ? i0 : end; + result += String.fromCharCode.apply(null, charCodes.subarray(i, chunkEnd)); + } + return result; + }, + Primitives_stringFromCharCode(charCode) { + var bits; + if (0 <= charCode) { + if (charCode <= 65535) + return String.fromCharCode(charCode); + if (charCode <= 1114111) { + bits = charCode - 65536; + return String.fromCharCode((B.JSInt_methods._shrOtherPositive$1(bits, 10) | 55296) >>> 0, bits & 1023 | 56320); + } + } + throw A.wrapException(A.RangeError$range(charCode, 0, 1114111, null, null)); + }, + Primitives_lazyAsJsDate(receiver) { + if (receiver.date === void 0) + receiver.date = new Date(receiver._core$_value); + return receiver.date; + }, + Primitives_getYear(receiver) { + var t1 = A.Primitives_lazyAsJsDate(receiver).getFullYear() + 0; + return t1; + }, + Primitives_getMonth(receiver) { + var t1 = A.Primitives_lazyAsJsDate(receiver).getMonth() + 1; + return t1; + }, + Primitives_getDay(receiver) { + var t1 = A.Primitives_lazyAsJsDate(receiver).getDate() + 0; + return t1; + }, + Primitives_getHours(receiver) { + var t1 = A.Primitives_lazyAsJsDate(receiver).getHours() + 0; + return t1; + }, + Primitives_getMinutes(receiver) { + var t1 = A.Primitives_lazyAsJsDate(receiver).getMinutes() + 0; + return t1; + }, + Primitives_getSeconds(receiver) { + var t1 = A.Primitives_lazyAsJsDate(receiver).getSeconds() + 0; + return t1; + }, + Primitives_getMilliseconds(receiver) { + var t1 = A.Primitives_lazyAsJsDate(receiver).getMilliseconds() + 0; + return t1; + }, + Primitives_functionNoSuchMethod($function, positionalArguments, namedArguments) { + var $arguments, namedArgumentList, t1 = {}; + t1.argumentCount = 0; + $arguments = []; + namedArgumentList = []; + t1.argumentCount = positionalArguments.length; + B.JSArray_methods.addAll$1($arguments, positionalArguments); + t1.names = ""; + if (namedArguments != null && namedArguments.__js_helper$_length !== 0) + namedArguments.forEach$1(0, new A.Primitives_functionNoSuchMethod_closure(t1, namedArgumentList, $arguments)); + return J.noSuchMethod$1$($function, new A.JSInvocationMirror(B.Symbol_call, 0, $arguments, namedArgumentList, 0)); + }, + Primitives_applyFunction($function, positionalArguments, namedArguments) { + var t1, argumentCount, jsStub; + if (Array.isArray(positionalArguments)) + t1 = namedArguments == null || namedArguments.__js_helper$_length === 0; + else + t1 = false; + if (t1) { + argumentCount = positionalArguments.length; + if (argumentCount === 0) { + if (!!$function.call$0) + return $function.call$0(); + } else if (argumentCount === 1) { + if (!!$function.call$1) + return $function.call$1(positionalArguments[0]); + } else if (argumentCount === 2) { + if (!!$function.call$2) + return $function.call$2(positionalArguments[0], positionalArguments[1]); + } else if (argumentCount === 3) { + if (!!$function.call$3) + return $function.call$3(positionalArguments[0], positionalArguments[1], positionalArguments[2]); + } else if (argumentCount === 4) { + if (!!$function.call$4) + return $function.call$4(positionalArguments[0], positionalArguments[1], positionalArguments[2], positionalArguments[3]); + } else if (argumentCount === 5) + if (!!$function.call$5) + return $function.call$5(positionalArguments[0], positionalArguments[1], positionalArguments[2], positionalArguments[3], positionalArguments[4]); + jsStub = $function["call" + "$" + argumentCount]; + if (jsStub != null) + return jsStub.apply($function, positionalArguments); + } + return A.Primitives__generalApplyFunction($function, positionalArguments, namedArguments); + }, + Primitives__generalApplyFunction($function, positionalArguments, namedArguments) { + var defaultValuesClosure, t1, defaultValues, interceptor, jsFunction, maxArguments, missingDefaults, keys, _i, defaultValue, used, t2, + $arguments = Array.isArray(positionalArguments) ? positionalArguments : A.List_List$of(positionalArguments, true, type$.dynamic), + argumentCount = $arguments.length, + requiredParameterCount = $function.$requiredArgCount; + if (argumentCount < requiredParameterCount) + return A.Primitives_functionNoSuchMethod($function, $arguments, namedArguments); + defaultValuesClosure = $function.$defaultValues; + t1 = defaultValuesClosure == null; + defaultValues = !t1 ? defaultValuesClosure() : null; + interceptor = J.getInterceptor$($function); + jsFunction = interceptor["call*"]; + if (typeof jsFunction == "string") + jsFunction = interceptor[jsFunction]; + if (t1) { + if (namedArguments != null && namedArguments.__js_helper$_length !== 0) + return A.Primitives_functionNoSuchMethod($function, $arguments, namedArguments); + if (argumentCount === requiredParameterCount) + return jsFunction.apply($function, $arguments); + return A.Primitives_functionNoSuchMethod($function, $arguments, namedArguments); + } + if (Array.isArray(defaultValues)) { + if (namedArguments != null && namedArguments.__js_helper$_length !== 0) + return A.Primitives_functionNoSuchMethod($function, $arguments, namedArguments); + maxArguments = requiredParameterCount + defaultValues.length; + if (argumentCount > maxArguments) + return A.Primitives_functionNoSuchMethod($function, $arguments, null); + if (argumentCount < maxArguments) { + missingDefaults = defaultValues.slice(argumentCount - requiredParameterCount); + if ($arguments === positionalArguments) + $arguments = A.List_List$of($arguments, true, type$.dynamic); + B.JSArray_methods.addAll$1($arguments, missingDefaults); + } + return jsFunction.apply($function, $arguments); + } else { + if (argumentCount > requiredParameterCount) + return A.Primitives_functionNoSuchMethod($function, $arguments, namedArguments); + if ($arguments === positionalArguments) + $arguments = A.List_List$of($arguments, true, type$.dynamic); + keys = Object.keys(defaultValues); + if (namedArguments == null) + for (t1 = keys.length, _i = 0; _i < keys.length; keys.length === t1 || (0, A.throwConcurrentModificationError)(keys), ++_i) { + defaultValue = defaultValues[keys[_i]]; + if (B.C__Required === defaultValue) + return A.Primitives_functionNoSuchMethod($function, $arguments, namedArguments); + B.JSArray_methods.add$1($arguments, defaultValue); + } + else { + for (t1 = keys.length, used = 0, _i = 0; _i < keys.length; keys.length === t1 || (0, A.throwConcurrentModificationError)(keys), ++_i) { + t2 = keys[_i]; + if (namedArguments.containsKey$1(t2)) { + ++used; + B.JSArray_methods.add$1($arguments, namedArguments.$index(0, t2)); + } else { + defaultValue = defaultValues[t2]; + if (B.C__Required === defaultValue) + return A.Primitives_functionNoSuchMethod($function, $arguments, namedArguments); + B.JSArray_methods.add$1($arguments, defaultValue); + } + } + if (used !== namedArguments.__js_helper$_length) + return A.Primitives_functionNoSuchMethod($function, $arguments, namedArguments); + } + return jsFunction.apply($function, $arguments); + } + }, + diagnoseIndexError(indexable, index) { + var $length, _s5_ = "index"; + if (!A._isInt(index)) + return new A.ArgumentError(true, index, _s5_, null); + $length = J.get$length$asx(indexable); + if (index < 0 || index >= $length) + return A.IndexError$withLength(index, $length, indexable, null, _s5_); + return A.RangeError$value(index, _s5_, null); + }, + diagnoseRangeError(start, end, $length) { + if (start < 0 || start > $length) + return A.RangeError$range(start, 0, $length, "start", null); + if (end != null) + if (end < start || end > $length) + return A.RangeError$range(end, start, $length, "end", null); + return new A.ArgumentError(true, end, "end", null); + }, + argumentErrorValue(object) { + return new A.ArgumentError(true, object, null, null); + }, + checkNum(value) { + return value; + }, + wrapException(ex) { + return A.initializeExceptionWrapper(new Error(), ex); + }, + initializeExceptionWrapper(wrapper, ex) { + var t1; + if (ex == null) + ex = new A.TypeError(); + wrapper.dartException = ex; + t1 = A.toStringWrapper; + if ("defineProperty" in Object) { + Object.defineProperty(wrapper, "message", {get: t1}); + wrapper.name = ""; + } else + wrapper.toString = t1; + return wrapper; + }, + toStringWrapper() { + return J.toString$0$(this.dartException); + }, + throwExpression(ex) { + throw A.wrapException(ex); + }, + throwExpressionWithWrapper(ex, wrapper) { + throw A.initializeExceptionWrapper(wrapper, ex); + }, + throwConcurrentModificationError(collection) { + throw A.wrapException(A.ConcurrentModificationError$(collection)); + }, + TypeErrorDecoder_extractPattern(message) { + var match, $arguments, argumentsExpr, expr, method, receiver; + message = A.quoteStringForRegExp(message.replace(String({}), "$receiver$")); + match = message.match(/\\\$[a-zA-Z]+\\\$/g); + if (match == null) + match = A._setArrayType([], type$.JSArray_String); + $arguments = match.indexOf("\\$arguments\\$"); + argumentsExpr = match.indexOf("\\$argumentsExpr\\$"); + expr = match.indexOf("\\$expr\\$"); + method = match.indexOf("\\$method\\$"); + receiver = match.indexOf("\\$receiver\\$"); + return new A.TypeErrorDecoder(message.replace(new RegExp("\\\\\\$arguments\\\\\\$", "g"), "((?:x|[^x])*)").replace(new RegExp("\\\\\\$argumentsExpr\\\\\\$", "g"), "((?:x|[^x])*)").replace(new RegExp("\\\\\\$expr\\\\\\$", "g"), "((?:x|[^x])*)").replace(new RegExp("\\\\\\$method\\\\\\$", "g"), "((?:x|[^x])*)").replace(new RegExp("\\\\\\$receiver\\\\\\$", "g"), "((?:x|[^x])*)"), $arguments, argumentsExpr, expr, method, receiver); + }, + TypeErrorDecoder_provokeCallErrorOn(expression) { + return function($expr$) { + var $argumentsExpr$ = "$arguments$"; + try { + $expr$.$method$($argumentsExpr$); + } catch (e) { + return e.message; + } + }(expression); + }, + TypeErrorDecoder_provokePropertyErrorOn(expression) { + return function($expr$) { + try { + $expr$.$method$; + } catch (e) { + return e.message; + } + }(expression); + }, + JsNoSuchMethodError$(_message, match) { + var t1 = match == null, + t2 = t1 ? null : match.method; + return new A.JsNoSuchMethodError(_message, t2, t1 ? null : match.receiver); + }, + unwrapException(ex) { + if (ex == null) + return new A.NullThrownFromJavaScriptException(ex); + if (ex instanceof A.ExceptionAndStackTrace) + return A.saveStackTrace(ex, ex.dartException); + if (typeof ex !== "object") + return ex; + if ("dartException" in ex) + return A.saveStackTrace(ex, ex.dartException); + return A._unwrapNonDartException(ex); + }, + saveStackTrace(ex, error) { + if (type$.Error._is(error)) + if (error.$thrownJsError == null) + error.$thrownJsError = ex; + return error; + }, + _unwrapNonDartException(ex) { + var message, number, ieErrorCode, nsme, notClosure, nullCall, nullLiteralCall, undefCall, undefLiteralCall, nullProperty, undefProperty, undefLiteralProperty, match; + if (!("message" in ex)) + return ex; + message = ex.message; + if ("number" in ex && typeof ex.number == "number") { + number = ex.number; + ieErrorCode = number & 65535; + if ((B.JSInt_methods._shrOtherPositive$1(number, 16) & 8191) === 10) + switch (ieErrorCode) { + case 438: + return A.saveStackTrace(ex, A.JsNoSuchMethodError$(A.S(message) + " (Error " + ieErrorCode + ")", null)); + case 445: + case 5007: + A.S(message); + return A.saveStackTrace(ex, new A.NullError()); + } + } + if (ex instanceof TypeError) { + nsme = $.$get$TypeErrorDecoder_noSuchMethodPattern(); + notClosure = $.$get$TypeErrorDecoder_notClosurePattern(); + nullCall = $.$get$TypeErrorDecoder_nullCallPattern(); + nullLiteralCall = $.$get$TypeErrorDecoder_nullLiteralCallPattern(); + undefCall = $.$get$TypeErrorDecoder_undefinedCallPattern(); + undefLiteralCall = $.$get$TypeErrorDecoder_undefinedLiteralCallPattern(); + nullProperty = $.$get$TypeErrorDecoder_nullPropertyPattern(); + $.$get$TypeErrorDecoder_nullLiteralPropertyPattern(); + undefProperty = $.$get$TypeErrorDecoder_undefinedPropertyPattern(); + undefLiteralProperty = $.$get$TypeErrorDecoder_undefinedLiteralPropertyPattern(); + match = nsme.matchTypeError$1(message); + if (match != null) + return A.saveStackTrace(ex, A.JsNoSuchMethodError$(message, match)); + else { + match = notClosure.matchTypeError$1(message); + if (match != null) { + match.method = "call"; + return A.saveStackTrace(ex, A.JsNoSuchMethodError$(message, match)); + } else if (nullCall.matchTypeError$1(message) != null || nullLiteralCall.matchTypeError$1(message) != null || undefCall.matchTypeError$1(message) != null || undefLiteralCall.matchTypeError$1(message) != null || nullProperty.matchTypeError$1(message) != null || nullLiteralCall.matchTypeError$1(message) != null || undefProperty.matchTypeError$1(message) != null || undefLiteralProperty.matchTypeError$1(message) != null) + return A.saveStackTrace(ex, new A.NullError()); + } + return A.saveStackTrace(ex, new A.UnknownJsTypeError(typeof message == "string" ? message : "")); + } + if (ex instanceof RangeError) { + if (typeof message == "string" && message.indexOf("call stack") !== -1) + return new A.StackOverflowError(); + message = function(ex) { + try { + return String(ex); + } catch (e) { + } + return null; + }(ex); + return A.saveStackTrace(ex, new A.ArgumentError(false, null, null, typeof message == "string" ? message.replace(/^RangeError:\s*/, "") : message)); + } + if (typeof InternalError == "function" && ex instanceof InternalError) + if (typeof message == "string" && message === "too much recursion") + return new A.StackOverflowError(); + return ex; + }, + getTraceFromException(exception) { + var trace; + if (exception instanceof A.ExceptionAndStackTrace) + return exception.stackTrace; + if (exception == null) + return new A._StackTrace(exception); + trace = exception.$cachedTrace; + if (trace != null) + return trace; + trace = new A._StackTrace(exception); + if (typeof exception === "object") + exception.$cachedTrace = trace; + return trace; + }, + objectHashCode(object) { + if (object == null) + return J.get$hashCode$(object); + if (typeof object == "object") + return A.Primitives_objectHashCode(object); + return J.get$hashCode$(object); + }, + constantHashCode(key) { + if (typeof key == "number") + return B.JSNumber_methods.get$hashCode(key); + if (key instanceof A._Type) + return A.Primitives_objectHashCode(key); + if (key instanceof A._Record) + return key.get$hashCode(key); + if (key instanceof A.Symbol) + return key.get$hashCode(0); + return A.objectHashCode(key); + }, + fillLiteralMap(keyValuePairs, result) { + var index, index0, index1, + $length = keyValuePairs.length; + for (index = 0; index < $length; index = index1) { + index0 = index + 1; + index1 = index0 + 1; + result.$indexSet(0, keyValuePairs[index], keyValuePairs[index0]); + } + return result; + }, + fillLiteralSet(values, result) { + var index, + $length = values.length; + for (index = 0; index < $length; ++index) + result.add$1(0, values[index]); + return result; + }, + _invokeClosure(closure, numberOfArguments, arg1, arg2, arg3, arg4) { + switch (numberOfArguments) { + case 0: + return closure.call$0(); + case 1: + return closure.call$1(arg1); + case 2: + return closure.call$2(arg1, arg2); + case 3: + return closure.call$3(arg1, arg2, arg3); + case 4: + return closure.call$4(arg1, arg2, arg3, arg4); + } + throw A.wrapException(new A._Exception("Unsupported number of arguments for wrapped closure")); + }, + convertDartClosureToJS(closure, arity) { + var $function; + if (closure == null) + return null; + $function = closure.$identity; + if (!!$function) + return $function; + $function = A.convertDartClosureToJSUncached(closure, arity); + closure.$identity = $function; + return $function; + }, + convertDartClosureToJSUncached(closure, arity) { + var entry; + switch (arity) { + case 0: + entry = closure.call$0; + break; + case 1: + entry = closure.call$1; + break; + case 2: + entry = closure.call$2; + break; + case 3: + entry = closure.call$3; + break; + case 4: + entry = closure.call$4; + break; + default: + entry = null; + } + if (entry != null) + return entry.bind(closure); + return function(closure, arity, invoke) { + return function(a1, a2, a3, a4) { + return invoke(closure, arity, a1, a2, a3, a4); + }; + }(closure, arity, A._invokeClosure); + }, + Closure_fromTearOff(parameters) { + var $prototype, $constructor, t2, trampoline, applyTrampoline, i, stub, stub0, stubName, stubCallName, + container = parameters.co, + isStatic = parameters.iS, + isIntercepted = parameters.iI, + needsDirectAccess = parameters.nDA, + applyTrampolineIndex = parameters.aI, + funsOrNames = parameters.fs, + callNames = parameters.cs, + $name = funsOrNames[0], + callName = callNames[0], + $function = container[$name], + t1 = parameters.fT; + t1.toString; + $prototype = isStatic ? Object.create(new A.StaticClosure().constructor.prototype) : Object.create(new A.BoundClosure(null, null).constructor.prototype); + $prototype.$initialize = $prototype.constructor; + $constructor = isStatic ? function static_tear_off() { + this.$initialize(); + } : function tear_off(a, b) { + this.$initialize(a, b); + }; + $prototype.constructor = $constructor; + $constructor.prototype = $prototype; + $prototype.$_name = $name; + $prototype.$_target = $function; + t2 = !isStatic; + if (t2) + trampoline = A.Closure_forwardCallTo($name, $function, isIntercepted, needsDirectAccess); + else { + $prototype.$static_name = $name; + trampoline = $function; + } + $prototype.$signature = A.Closure__computeSignatureFunctionNewRti(t1, isStatic, isIntercepted); + $prototype[callName] = trampoline; + for (applyTrampoline = trampoline, i = 1; i < funsOrNames.length; ++i) { + stub = funsOrNames[i]; + if (typeof stub == "string") { + stub0 = container[stub]; + stubName = stub; + stub = stub0; + } else + stubName = ""; + stubCallName = callNames[i]; + if (stubCallName != null) { + if (t2) + stub = A.Closure_forwardCallTo(stubName, stub, isIntercepted, needsDirectAccess); + $prototype[stubCallName] = stub; + } + if (i === applyTrampolineIndex) + applyTrampoline = stub; + } + $prototype["call*"] = applyTrampoline; + $prototype.$requiredArgCount = parameters.rC; + $prototype.$defaultValues = parameters.dV; + return $constructor; + }, + Closure__computeSignatureFunctionNewRti(functionType, isStatic, isIntercepted) { + if (typeof functionType == "number") + return functionType; + if (typeof functionType == "string") { + if (isStatic) + throw A.wrapException("Cannot compute signature for static tearoff."); + return function(recipe, evalOnReceiver) { + return function() { + return evalOnReceiver(this, recipe); + }; + }(functionType, A.BoundClosure_evalRecipe); + } + throw A.wrapException("Error in functionType of tearoff"); + }, + Closure_cspForwardCall(arity, needsDirectAccess, stubName, $function) { + var getReceiver = A.BoundClosure_receiverOf; + switch (needsDirectAccess ? -1 : arity) { + case 0: + return function(entry, receiverOf) { + return function() { + return receiverOf(this)[entry](); + }; + }(stubName, getReceiver); + case 1: + return function(entry, receiverOf) { + return function(a) { + return receiverOf(this)[entry](a); + }; + }(stubName, getReceiver); + case 2: + return function(entry, receiverOf) { + return function(a, b) { + return receiverOf(this)[entry](a, b); + }; + }(stubName, getReceiver); + case 3: + return function(entry, receiverOf) { + return function(a, b, c) { + return receiverOf(this)[entry](a, b, c); + }; + }(stubName, getReceiver); + case 4: + return function(entry, receiverOf) { + return function(a, b, c, d) { + return receiverOf(this)[entry](a, b, c, d); + }; + }(stubName, getReceiver); + case 5: + return function(entry, receiverOf) { + return function(a, b, c, d, e) { + return receiverOf(this)[entry](a, b, c, d, e); + }; + }(stubName, getReceiver); + default: + return function(f, receiverOf) { + return function() { + return f.apply(receiverOf(this), arguments); + }; + }($function, getReceiver); + } + }, + Closure_forwardCallTo(stubName, $function, isIntercepted, needsDirectAccess) { + if (isIntercepted) + return A.Closure_forwardInterceptedCallTo(stubName, $function, needsDirectAccess); + return A.Closure_cspForwardCall($function.length, needsDirectAccess, stubName, $function); + }, + Closure_cspForwardInterceptedCall(arity, needsDirectAccess, stubName, $function) { + var getReceiver = A.BoundClosure_receiverOf, + getInterceptor = A.BoundClosure_interceptorOf; + switch (needsDirectAccess ? -1 : arity) { + case 0: + throw A.wrapException(new A.RuntimeError("Intercepted function with no arguments.")); + case 1: + return function(entry, interceptorOf, receiverOf) { + return function() { + return interceptorOf(this)[entry](receiverOf(this)); + }; + }(stubName, getInterceptor, getReceiver); + case 2: + return function(entry, interceptorOf, receiverOf) { + return function(a) { + return interceptorOf(this)[entry](receiverOf(this), a); + }; + }(stubName, getInterceptor, getReceiver); + case 3: + return function(entry, interceptorOf, receiverOf) { + return function(a, b) { + return interceptorOf(this)[entry](receiverOf(this), a, b); + }; + }(stubName, getInterceptor, getReceiver); + case 4: + return function(entry, interceptorOf, receiverOf) { + return function(a, b, c) { + return interceptorOf(this)[entry](receiverOf(this), a, b, c); + }; + }(stubName, getInterceptor, getReceiver); + case 5: + return function(entry, interceptorOf, receiverOf) { + return function(a, b, c, d) { + return interceptorOf(this)[entry](receiverOf(this), a, b, c, d); + }; + }(stubName, getInterceptor, getReceiver); + case 6: + return function(entry, interceptorOf, receiverOf) { + return function(a, b, c, d, e) { + return interceptorOf(this)[entry](receiverOf(this), a, b, c, d, e); + }; + }(stubName, getInterceptor, getReceiver); + default: + return function(f, interceptorOf, receiverOf) { + return function() { + var a = [receiverOf(this)]; + Array.prototype.push.apply(a, arguments); + return f.apply(interceptorOf(this), a); + }; + }($function, getInterceptor, getReceiver); + } + }, + Closure_forwardInterceptedCallTo(stubName, $function, needsDirectAccess) { + var arity, t1; + if ($.BoundClosure__interceptorFieldNameCache == null) + $.BoundClosure__interceptorFieldNameCache = A.BoundClosure__computeFieldNamed("interceptor"); + if ($.BoundClosure__receiverFieldNameCache == null) + $.BoundClosure__receiverFieldNameCache = A.BoundClosure__computeFieldNamed("receiver"); + arity = $function.length; + t1 = A.Closure_cspForwardInterceptedCall(arity, needsDirectAccess, stubName, $function); + return t1; + }, + closureFromTearOff(parameters) { + return A.Closure_fromTearOff(parameters); + }, + BoundClosure_evalRecipe(closure, recipe) { + return A._Universe_evalInEnvironment(init.typeUniverse, A.instanceType(closure._receiver), recipe); + }, + BoundClosure_receiverOf(closure) { + return closure._receiver; + }, + BoundClosure_interceptorOf(closure) { + return closure._interceptor; + }, + BoundClosure__computeFieldNamed(fieldName) { + var t1, i, $name, + template = new A.BoundClosure("receiver", "interceptor"), + names = J.JSArray_markFixedList(Object.getOwnPropertyNames(template)); + for (t1 = names.length, i = 0; i < t1; ++i) { + $name = names[i]; + if (template[$name] === fieldName) + return $name; + } + throw A.wrapException(A.ArgumentError$("Field name " + fieldName + " not found.", null)); + }, + throwCyclicInit(staticName) { + throw A.wrapException(new A._CyclicInitializationError(staticName)); + }, + getIsolateAffinityTag($name) { + return init.getIsolateTag($name); + }, + LinkedHashMapKeyIterator$(_map, _modifications) { + var t1 = new A.LinkedHashMapKeyIterator(_map, _modifications); + t1._cell = _map._first; + return t1; + }, + defineProperty(obj, property, value) { + Object.defineProperty(obj, property, {value: value, enumerable: false, writable: true, configurable: true}); + }, + lookupAndCacheInterceptor(obj) { + var interceptor, interceptorClass, altTag, mark, t1, + tag = $.getTagFunction.call$1(obj), + record = $.dispatchRecordsForInstanceTags[tag]; + if (record != null) { + Object.defineProperty(obj, init.dispatchPropertyName, {value: record, enumerable: false, writable: true, configurable: true}); + return record.i; + } + interceptor = $.interceptorsForUncacheableTags[tag]; + if (interceptor != null) + return interceptor; + interceptorClass = init.interceptorsByTag[tag]; + if (interceptorClass == null) { + altTag = $.alternateTagFunction.call$2(obj, tag); + if (altTag != null) { + record = $.dispatchRecordsForInstanceTags[altTag]; + if (record != null) { + Object.defineProperty(obj, init.dispatchPropertyName, {value: record, enumerable: false, writable: true, configurable: true}); + return record.i; + } + interceptor = $.interceptorsForUncacheableTags[altTag]; + if (interceptor != null) + return interceptor; + interceptorClass = init.interceptorsByTag[altTag]; + tag = altTag; + } + } + if (interceptorClass == null) + return null; + interceptor = interceptorClass.prototype; + mark = tag[0]; + if (mark === "!") { + record = A.makeLeafDispatchRecord(interceptor); + $.dispatchRecordsForInstanceTags[tag] = record; + Object.defineProperty(obj, init.dispatchPropertyName, {value: record, enumerable: false, writable: true, configurable: true}); + return record.i; + } + if (mark === "~") { + $.interceptorsForUncacheableTags[tag] = interceptor; + return interceptor; + } + if (mark === "-") { + t1 = A.makeLeafDispatchRecord(interceptor); + Object.defineProperty(Object.getPrototypeOf(obj), init.dispatchPropertyName, {value: t1, enumerable: false, writable: true, configurable: true}); + return t1.i; + } + if (mark === "+") + return A.patchInteriorProto(obj, interceptor); + if (mark === "*") + throw A.wrapException(A.UnimplementedError$(tag)); + if (init.leafTags[tag] === true) { + t1 = A.makeLeafDispatchRecord(interceptor); + Object.defineProperty(Object.getPrototypeOf(obj), init.dispatchPropertyName, {value: t1, enumerable: false, writable: true, configurable: true}); + return t1.i; + } else + return A.patchInteriorProto(obj, interceptor); + }, + patchInteriorProto(obj, interceptor) { + var proto = Object.getPrototypeOf(obj); + Object.defineProperty(proto, init.dispatchPropertyName, {value: J.makeDispatchRecord(interceptor, proto, null, null), enumerable: false, writable: true, configurable: true}); + return interceptor; + }, + makeLeafDispatchRecord(interceptor) { + return J.makeDispatchRecord(interceptor, false, null, !!interceptor.$isJavaScriptIndexingBehavior); + }, + makeDefaultDispatchRecord(tag, interceptorClass, proto) { + var interceptor = interceptorClass.prototype; + if (init.leafTags[tag] === true) + return A.makeLeafDispatchRecord(interceptor); + else + return J.makeDispatchRecord(interceptor, proto, null, null); + }, + initNativeDispatch() { + if (true === $.initNativeDispatchFlag) + return; + $.initNativeDispatchFlag = true; + A.initNativeDispatchContinue(); + }, + initNativeDispatchContinue() { + var map, tags, fun, i, tag, proto, record, interceptorClass; + $.dispatchRecordsForInstanceTags = Object.create(null); + $.interceptorsForUncacheableTags = Object.create(null); + A.initHooks(); + map = init.interceptorsByTag; + tags = Object.getOwnPropertyNames(map); + if (typeof window != "undefined") { + window; + fun = function() { + }; + for (i = 0; i < tags.length; ++i) { + tag = tags[i]; + proto = $.prototypeForTagFunction.call$1(tag); + if (proto != null) { + record = A.makeDefaultDispatchRecord(tag, map[tag], proto); + if (record != null) { + Object.defineProperty(proto, init.dispatchPropertyName, {value: record, enumerable: false, writable: true, configurable: true}); + fun.prototype = proto; + } + } + } + } + for (i = 0; i < tags.length; ++i) { + tag = tags[i]; + if (/^[A-Za-z_]/.test(tag)) { + interceptorClass = map[tag]; + map["!" + tag] = interceptorClass; + map["~" + tag] = interceptorClass; + map["-" + tag] = interceptorClass; + map["+" + tag] = interceptorClass; + map["*" + tag] = interceptorClass; + } + } + }, + initHooks() { + var transformers, i, transformer, getTag, getUnknownTag, prototypeForTag, + hooks = B.C_JS_CONST0(); + hooks = A.applyHooksTransformer(B.C_JS_CONST1, A.applyHooksTransformer(B.C_JS_CONST2, A.applyHooksTransformer(B.C_JS_CONST3, A.applyHooksTransformer(B.C_JS_CONST3, A.applyHooksTransformer(B.C_JS_CONST4, A.applyHooksTransformer(B.C_JS_CONST5, A.applyHooksTransformer(B.C_JS_CONST6(B.C_JS_CONST), hooks))))))); + if (typeof dartNativeDispatchHooksTransformer != "undefined") { + transformers = dartNativeDispatchHooksTransformer; + if (typeof transformers == "function") + transformers = [transformers]; + if (Array.isArray(transformers)) + for (i = 0; i < transformers.length; ++i) { + transformer = transformers[i]; + if (typeof transformer == "function") + hooks = transformer(hooks) || hooks; + } + } + getTag = hooks.getTag; + getUnknownTag = hooks.getUnknownTag; + prototypeForTag = hooks.prototypeForTag; + $.getTagFunction = new A.initHooks_closure(getTag); + $.alternateTagFunction = new A.initHooks_closure0(getUnknownTag); + $.prototypeForTagFunction = new A.initHooks_closure1(prototypeForTag); + }, + applyHooksTransformer(transformer, hooks) { + return transformer(hooks) || hooks; + }, + _RecordN__equalValues(a, b) { + var i; + for (i = 0; i < a.length; ++i) + if (!J.$eq$(a[i], b[i])) + return false; + return true; + }, + createRecordTypePredicate(shape, fieldRtis) { + var $length = fieldRtis.length, + $function = init.rttc["" + $length + ";" + shape]; + if ($function == null) + return null; + if ($length === 0) + return $function; + if ($length === $function.length) + return $function.apply(null, fieldRtis); + return $function(fieldRtis); + }, + JSSyntaxRegExp_makeNative(source, multiLine, caseSensitive, unicode, dotAll, global) { + var m = multiLine ? "m" : "", + i = caseSensitive ? "" : "i", + u = unicode ? "u" : "", + s = dotAll ? "s" : "", + g = global ? "g" : "", + regexp = function(source, modifiers) { + try { + return new RegExp(source, modifiers); + } catch (e) { + return e; + } + }(source, m + i + u + s + g); + if (regexp instanceof RegExp) + return regexp; + throw A.wrapException(A.FormatException$("Illegal RegExp pattern (" + String(regexp) + ")", source, null)); + }, + stringContainsUnchecked(receiver, other, startIndex) { + var t1; + if (typeof other == "string") + return receiver.indexOf(other, startIndex) >= 0; + else if (other instanceof A.JSSyntaxRegExp) { + t1 = B.JSString_methods.substring$1(receiver, startIndex); + return other._nativeRegExp.test(t1); + } else + return !J.allMatches$1$s(other, B.JSString_methods.substring$1(receiver, startIndex)).get$isEmpty(0); + }, + escapeReplacement(replacement) { + if (replacement.indexOf("$", 0) >= 0) + return replacement.replace(/\$/g, "$$$$"); + return replacement; + }, + stringReplaceFirstRE(receiver, regexp, replacement, startIndex) { + var match = regexp._execGlobal$2(receiver, startIndex); + if (match == null) + return receiver; + return A.stringReplaceRangeUnchecked(receiver, match._match.index, match.get$end(0), replacement); + }, + quoteStringForRegExp(string) { + if (/[[\]{}()*+?.\\^$|]/.test(string)) + return string.replace(/[[\]{}()*+?.\\^$|]/g, "\\$&"); + return string; + }, + stringReplaceAllUnchecked(receiver, pattern, replacement) { + var nativeRegexp; + if (typeof pattern == "string") + return A.stringReplaceAllUncheckedString(receiver, pattern, replacement); + if (pattern instanceof A.JSSyntaxRegExp) { + nativeRegexp = pattern.get$_nativeGlobalVersion(); + nativeRegexp.lastIndex = 0; + return receiver.replace(nativeRegexp, A.escapeReplacement(replacement)); + } + return A.stringReplaceAllGeneral(receiver, pattern, replacement); + }, + stringReplaceAllGeneral(receiver, pattern, replacement) { + var t1, startIndex, t2, match; + for (t1 = J.allMatches$1$s(pattern, receiver), t1 = t1.get$iterator(t1), startIndex = 0, t2 = ""; t1.moveNext$0();) { + match = t1.get$current(t1); + t2 = t2 + receiver.substring(startIndex, match.get$start(match)) + replacement; + startIndex = match.get$end(match); + } + t1 = t2 + receiver.substring(startIndex); + return t1.charCodeAt(0) == 0 ? t1 : t1; + }, + stringReplaceAllUncheckedString(receiver, pattern, replacement) { + var $length, t1, i; + if (pattern === "") { + if (receiver === "") + return replacement; + $length = receiver.length; + t1 = "" + replacement; + for (i = 0; i < $length; ++i) + t1 = t1 + receiver[i] + replacement; + return t1.charCodeAt(0) == 0 ? t1 : t1; + } + if (receiver.indexOf(pattern, 0) < 0) + return receiver; + if (receiver.length < 500 || replacement.indexOf("$", 0) >= 0) + return receiver.split(pattern).join(replacement); + return receiver.replace(new RegExp(A.quoteStringForRegExp(pattern), "g"), A.escapeReplacement(replacement)); + }, + stringReplaceFirstUnchecked(receiver, pattern, replacement, startIndex) { + var index, t1, matches, match; + if (typeof pattern == "string") { + index = receiver.indexOf(pattern, startIndex); + if (index < 0) + return receiver; + return A.stringReplaceRangeUnchecked(receiver, index, index + pattern.length, replacement); + } + if (pattern instanceof A.JSSyntaxRegExp) + return startIndex === 0 ? receiver.replace(pattern._nativeRegExp, A.escapeReplacement(replacement)) : A.stringReplaceFirstRE(receiver, pattern, replacement, startIndex); + t1 = J.allMatches$2$s(pattern, receiver, startIndex); + matches = t1.get$iterator(t1); + if (!matches.moveNext$0()) + return receiver; + match = matches.get$current(matches); + return B.JSString_methods.replaceRange$3(receiver, match.get$start(match), match.get$end(match), replacement); + }, + stringReplaceRangeUnchecked(receiver, start, end, replacement) { + return receiver.substring(0, start) + replacement + receiver.substring(end); + }, + _Record_2: function _Record_2(t0, t1) { + this._0 = t0; + this._1 = t1; + }, + _Record_2_forImport: function _Record_2_forImport(t0, t1) { + this._0 = t0; + this._1 = t1; + }, + _Record_2_imports_modules: function _Record_2_imports_modules(t0, t1) { + this._0 = t0; + this._1 = t1; + }, + _Record_2_loadedUrls_stylesheet: function _Record_2_loadedUrls_stylesheet(t0, t1) { + this._0 = t0; + this._1 = t1; + }, + _Record_2_sourceMap: function _Record_2_sourceMap(t0, t1) { + this._0 = t0; + this._1 = t1; + }, + _Record_3: function _Record_3(t0, t1, t2) { + this._0 = t0; + this._1 = t1; + this._2 = t2; + }, + _Record_3_importer_isDependency: function _Record_3_importer_isDependency(t0, t1, t2) { + this._0 = t0; + this._1 = t1; + this._2 = t2; + }, + _Record_3_originalUrl: function _Record_3_originalUrl(t0, t1, t2) { + this._0 = t0; + this._1 = t1; + this._2 = t2; + }, + _Record_4_baseImporter_baseUrl_forImport: function _Record_4_baseImporter_baseUrl_forImport(t0) { + this._values = t0; + }, + _Record_5_named_namedNodes_positional_positionalNodes_separator: function _Record_5_named_namedNodes_positional_positionalNodes_separator(t0) { + this._values = t0; + }, + ConstantMapView: function ConstantMapView(t0, t1) { + this._map = t0; + this.$ti = t1; + }, + ConstantMap: function ConstantMap() { + }, + ConstantStringMap: function ConstantStringMap(t0, t1, t2) { + this._jsIndex = t0; + this._values = t1; + this.$ti = t2; + }, + _KeysOrValues: function _KeysOrValues(t0, t1) { + this._elements = t0; + this.$ti = t1; + }, + _KeysOrValuesOrElementsIterator: function _KeysOrValuesOrElementsIterator(t0, t1, t2) { + var _ = this; + _._elements = t0; + _.__js_helper$_length = t1; + _.__js_helper$_index = 0; + _.__js_helper$_current = null; + _.$ti = t2; + }, + ConstantSet: function ConstantSet() { + }, + ConstantStringSet: function ConstantStringSet(t0, t1, t2) { + this._jsIndex = t0; + this.__js_helper$_length = t1; + this.$ti = t2; + }, + GeneralConstantSet: function GeneralConstantSet(t0, t1) { + this._elements = t0; + this.$ti = t1; + }, + Instantiation: function Instantiation() { + }, + Instantiation1: function Instantiation1(t0, t1) { + this._genericClosure = t0; + this.$ti = t1; + }, + JSInvocationMirror: function JSInvocationMirror(t0, t1, t2, t3, t4) { + var _ = this; + _.__js_helper$_memberName = t0; + _.__js_helper$_kind = t1; + _._arguments = t2; + _._namedArgumentNames = t3; + _._typeArgumentCount = t4; + }, + Primitives_functionNoSuchMethod_closure: function Primitives_functionNoSuchMethod_closure(t0, t1, t2) { + this._box_0 = t0; + this.namedArgumentList = t1; + this.$arguments = t2; + }, + TypeErrorDecoder: function TypeErrorDecoder(t0, t1, t2, t3, t4, t5) { + var _ = this; + _._pattern = t0; + _._arguments = t1; + _._argumentsExpr = t2; + _._expr = t3; + _._method = t4; + _._receiver = t5; + }, + NullError: function NullError() { + }, + JsNoSuchMethodError: function JsNoSuchMethodError(t0, t1, t2) { + this.__js_helper$_message = t0; + this._method = t1; + this._receiver = t2; + }, + UnknownJsTypeError: function UnknownJsTypeError(t0) { + this.__js_helper$_message = t0; + }, + NullThrownFromJavaScriptException: function NullThrownFromJavaScriptException(t0) { + this._irritant = t0; + }, + ExceptionAndStackTrace: function ExceptionAndStackTrace(t0, t1) { + this.dartException = t0; + this.stackTrace = t1; + }, + _StackTrace: function _StackTrace(t0) { + this._exception = t0; + this._trace = null; + }, + Closure: function Closure() { + }, + Closure0Args: function Closure0Args() { + }, + Closure2Args: function Closure2Args() { + }, + TearOffClosure: function TearOffClosure() { + }, + StaticClosure: function StaticClosure() { + }, + BoundClosure: function BoundClosure(t0, t1) { + this._receiver = t0; + this._interceptor = t1; + }, + _CyclicInitializationError: function _CyclicInitializationError(t0) { + this.variableName = t0; + }, + RuntimeError: function RuntimeError(t0) { + this.message = t0; + }, + _Required: function _Required() { + }, + JsLinkedHashMap: function JsLinkedHashMap(t0) { + var _ = this; + _.__js_helper$_length = 0; + _._last = _._first = _.__js_helper$_rest = _._nums = _._strings = null; + _._modifications = 0; + _.$ti = t0; + }, + JsLinkedHashMap_values_closure: function JsLinkedHashMap_values_closure(t0) { + this.$this = t0; + }, + JsLinkedHashMap_addAll_closure: function JsLinkedHashMap_addAll_closure(t0) { + this.$this = t0; + }, + LinkedHashMapCell: function LinkedHashMapCell(t0, t1) { + var _ = this; + _.hashMapCellKey = t0; + _.hashMapCellValue = t1; + _._previous = _._next = null; + }, + LinkedHashMapKeyIterable: function LinkedHashMapKeyIterable(t0, t1) { + this.__js_helper$_map = t0; + this.$ti = t1; + }, + LinkedHashMapKeyIterator: function LinkedHashMapKeyIterator(t0, t1) { + var _ = this; + _.__js_helper$_map = t0; + _._modifications = t1; + _.__js_helper$_current = _._cell = null; + }, + JsIdentityLinkedHashMap: function JsIdentityLinkedHashMap(t0) { + var _ = this; + _.__js_helper$_length = 0; + _._last = _._first = _.__js_helper$_rest = _._nums = _._strings = null; + _._modifications = 0; + _.$ti = t0; + }, + JsConstantLinkedHashMap: function JsConstantLinkedHashMap(t0) { + var _ = this; + _.__js_helper$_length = 0; + _._last = _._first = _.__js_helper$_rest = _._nums = _._strings = null; + _._modifications = 0; + _.$ti = t0; + }, + initHooks_closure: function initHooks_closure(t0) { + this.getTag = t0; + }, + initHooks_closure0: function initHooks_closure0(t0) { + this.getUnknownTag = t0; + }, + initHooks_closure1: function initHooks_closure1(t0) { + this.prototypeForTag = t0; + }, + _Record: function _Record() { + }, + _Record2: function _Record2() { + }, + _Record3: function _Record3() { + }, + _RecordN: function _RecordN() { + }, + JSSyntaxRegExp: function JSSyntaxRegExp(t0, t1) { + var _ = this; + _.pattern = t0; + _._nativeRegExp = t1; + _._nativeAnchoredRegExp = _._nativeGlobalRegExp = null; + }, + _MatchImplementation: function _MatchImplementation(t0) { + this._match = t0; + }, + _AllMatchesIterable: function _AllMatchesIterable(t0, t1, t2) { + this._re = t0; + this.__js_helper$_string = t1; + this.__js_helper$_start = t2; + }, + _AllMatchesIterator: function _AllMatchesIterator(t0, t1, t2) { + var _ = this; + _._regExp = t0; + _.__js_helper$_string = t1; + _._nextIndex = t2; + _.__js_helper$_current = null; + }, + StringMatch: function StringMatch(t0, t1) { + this.start = t0; + this.pattern = t1; + }, + _StringAllMatchesIterable: function _StringAllMatchesIterable(t0, t1, t2) { + this._input = t0; + this._pattern = t1; + this.__js_helper$_index = t2; + }, + _StringAllMatchesIterator: function _StringAllMatchesIterator(t0, t1, t2) { + var _ = this; + _._input = t0; + _._pattern = t1; + _.__js_helper$_index = t2; + _.__js_helper$_current = null; + }, + throwLateFieldADI(fieldName) { + A.throwExpressionWithWrapper(new A.LateError("Field '" + fieldName + "' has been assigned during initialization."), new Error()); + }, + throwUnnamedLateFieldNI() { + A.throwExpressionWithWrapper(new A.LateError("Field '' has not been initialized."), new Error()); + }, + throwUnnamedLateFieldAI() { + A.throwExpressionWithWrapper(new A.LateError("Field '' has already been initialized."), new Error()); + }, + throwUnnamedLateFieldADI() { + A.throwExpressionWithWrapper(new A.LateError("Field '' has been assigned during initialization."), new Error()); + }, + _Cell$() { + var t1 = new A._Cell(""); + return t1._value = t1; + }, + _Cell$named(_name) { + var t1 = new A._Cell(_name); + return t1._value = t1; + }, + _Cell: function _Cell(t0) { + this.__late_helper$_name = t0; + this._value = null; + }, + _ensureNativeList(list) { + return list; + }, + NativeInt8List__create1(arg) { + return new Int8Array(arg); + }, + NativeUint8List_NativeUint8List($length) { + return new Uint8Array($length); + }, + _checkValidIndex(index, list, $length) { + if (index >>> 0 !== index || index >= $length) + throw A.wrapException(A.diagnoseIndexError(list, index)); + }, + _checkValidRange(start, end, $length) { + var t1; + if (!(start >>> 0 !== start)) + if (end == null) + t1 = start > $length; + else + t1 = end >>> 0 !== end || start > end || end > $length; + else + t1 = true; + if (t1) + throw A.wrapException(A.diagnoseRangeError(start, end, $length)); + if (end == null) + return $length; + return end; + }, + NativeByteBuffer: function NativeByteBuffer() { + }, + NativeTypedData: function NativeTypedData() { + }, + NativeByteData: function NativeByteData() { + }, + NativeTypedArray: function NativeTypedArray() { + }, + NativeTypedArrayOfDouble: function NativeTypedArrayOfDouble() { + }, + NativeTypedArrayOfInt: function NativeTypedArrayOfInt() { + }, + NativeFloat32List: function NativeFloat32List() { + }, + NativeFloat64List: function NativeFloat64List() { + }, + NativeInt16List: function NativeInt16List() { + }, + NativeInt32List: function NativeInt32List() { + }, + NativeInt8List: function NativeInt8List() { + }, + NativeUint16List: function NativeUint16List() { + }, + NativeUint32List: function NativeUint32List() { + }, + NativeUint8ClampedList: function NativeUint8ClampedList() { + }, + NativeUint8List: function NativeUint8List() { + }, + _NativeTypedArrayOfDouble_NativeTypedArray_ListMixin: function _NativeTypedArrayOfDouble_NativeTypedArray_ListMixin() { + }, + _NativeTypedArrayOfDouble_NativeTypedArray_ListMixin_FixedLengthListMixin: function _NativeTypedArrayOfDouble_NativeTypedArray_ListMixin_FixedLengthListMixin() { + }, + _NativeTypedArrayOfInt_NativeTypedArray_ListMixin: function _NativeTypedArrayOfInt_NativeTypedArray_ListMixin() { + }, + _NativeTypedArrayOfInt_NativeTypedArray_ListMixin_FixedLengthListMixin: function _NativeTypedArrayOfInt_NativeTypedArray_ListMixin_FixedLengthListMixin() { + }, + Rti__getQuestionFromStar(universe, rti) { + var question = rti._precomputed1; + return question == null ? rti._precomputed1 = A._Universe__lookupQuestionRti(universe, rti._primary, true) : question; + }, + Rti__getFutureFromFutureOr(universe, rti) { + var future = rti._precomputed1; + return future == null ? rti._precomputed1 = A._Universe__lookupInterfaceRti(universe, "Future", [rti._primary]) : future; + }, + Rti__isUnionOfFunctionType(rti) { + var kind = rti._kind; + if (kind === 6 || kind === 7 || kind === 8) + return A.Rti__isUnionOfFunctionType(rti._primary); + return kind === 12 || kind === 13; + }, + Rti__getCanonicalRecipe(rti) { + return rti._canonicalRecipe; + }, + pairwiseIsTest(fieldRtis, values) { + var i, + $length = values.length; + for (i = 0; i < $length; ++i) + if (!fieldRtis[i]._is(values[i])) + return false; + return true; + }, + findType(recipe) { + return A._Universe_eval(init.typeUniverse, recipe, false); + }, + instantiatedGenericFunctionType(genericFunctionRti, instantiationRti) { + var t1, cache, key, probe, rti; + if (genericFunctionRti == null) + return null; + t1 = instantiationRti._rest; + cache = genericFunctionRti._bindCache; + if (cache == null) + cache = genericFunctionRti._bindCache = new Map(); + key = instantiationRti._canonicalRecipe; + probe = cache.get(key); + if (probe != null) + return probe; + rti = A._substitute(init.typeUniverse, genericFunctionRti._primary, t1, 0); + cache.set(key, rti); + return rti; + }, + _substitute(universe, rti, typeArguments, depth) { + var baseType, substitutedBaseType, interfaceTypeArguments, substitutedInterfaceTypeArguments, base, substitutedBase, $arguments, substitutedArguments, t1, fields, substitutedFields, returnType, substitutedReturnType, functionParameters, substitutedFunctionParameters, bounds, substitutedBounds, index, argument, + kind = rti._kind; + switch (kind) { + case 5: + case 1: + case 2: + case 3: + case 4: + return rti; + case 6: + baseType = rti._primary; + substitutedBaseType = A._substitute(universe, baseType, typeArguments, depth); + if (substitutedBaseType === baseType) + return rti; + return A._Universe__lookupStarRti(universe, substitutedBaseType, true); + case 7: + baseType = rti._primary; + substitutedBaseType = A._substitute(universe, baseType, typeArguments, depth); + if (substitutedBaseType === baseType) + return rti; + return A._Universe__lookupQuestionRti(universe, substitutedBaseType, true); + case 8: + baseType = rti._primary; + substitutedBaseType = A._substitute(universe, baseType, typeArguments, depth); + if (substitutedBaseType === baseType) + return rti; + return A._Universe__lookupFutureOrRti(universe, substitutedBaseType, true); + case 9: + interfaceTypeArguments = rti._rest; + substitutedInterfaceTypeArguments = A._substituteArray(universe, interfaceTypeArguments, typeArguments, depth); + if (substitutedInterfaceTypeArguments === interfaceTypeArguments) + return rti; + return A._Universe__lookupInterfaceRti(universe, rti._primary, substitutedInterfaceTypeArguments); + case 10: + base = rti._primary; + substitutedBase = A._substitute(universe, base, typeArguments, depth); + $arguments = rti._rest; + substitutedArguments = A._substituteArray(universe, $arguments, typeArguments, depth); + if (substitutedBase === base && substitutedArguments === $arguments) + return rti; + return A._Universe__lookupBindingRti(universe, substitutedBase, substitutedArguments); + case 11: + t1 = rti._primary; + fields = rti._rest; + substitutedFields = A._substituteArray(universe, fields, typeArguments, depth); + if (substitutedFields === fields) + return rti; + return A._Universe__lookupRecordRti(universe, t1, substitutedFields); + case 12: + returnType = rti._primary; + substitutedReturnType = A._substitute(universe, returnType, typeArguments, depth); + functionParameters = rti._rest; + substitutedFunctionParameters = A._substituteFunctionParameters(universe, functionParameters, typeArguments, depth); + if (substitutedReturnType === returnType && substitutedFunctionParameters === functionParameters) + return rti; + return A._Universe__lookupFunctionRti(universe, substitutedReturnType, substitutedFunctionParameters); + case 13: + bounds = rti._rest; + depth += bounds.length; + substitutedBounds = A._substituteArray(universe, bounds, typeArguments, depth); + base = rti._primary; + substitutedBase = A._substitute(universe, base, typeArguments, depth); + if (substitutedBounds === bounds && substitutedBase === base) + return rti; + return A._Universe__lookupGenericFunctionRti(universe, substitutedBase, substitutedBounds, true); + case 14: + index = rti._primary; + if (index < depth) + return rti; + argument = typeArguments[index - depth]; + if (argument == null) + return rti; + return argument; + default: + throw A.wrapException(A.AssertionError$("Attempted to substitute unexpected RTI kind " + kind)); + } + }, + _substituteArray(universe, rtiArray, typeArguments, depth) { + var changed, i, rti, substitutedRti, + $length = rtiArray.length, + result = A._Utils_newArrayOrEmpty($length); + for (changed = false, i = 0; i < $length; ++i) { + rti = rtiArray[i]; + substitutedRti = A._substitute(universe, rti, typeArguments, depth); + if (substitutedRti !== rti) + changed = true; + result[i] = substitutedRti; + } + return changed ? result : rtiArray; + }, + _substituteNamed(universe, namedArray, typeArguments, depth) { + var changed, i, t1, t2, rti, substitutedRti, + $length = namedArray.length, + result = A._Utils_newArrayOrEmpty($length); + for (changed = false, i = 0; i < $length; i += 3) { + t1 = namedArray[i]; + t2 = namedArray[i + 1]; + rti = namedArray[i + 2]; + substitutedRti = A._substitute(universe, rti, typeArguments, depth); + if (substitutedRti !== rti) + changed = true; + result.splice(i, 3, t1, t2, substitutedRti); + } + return changed ? result : namedArray; + }, + _substituteFunctionParameters(universe, functionParameters, typeArguments, depth) { + var result, + requiredPositional = functionParameters._requiredPositional, + substitutedRequiredPositional = A._substituteArray(universe, requiredPositional, typeArguments, depth), + optionalPositional = functionParameters._optionalPositional, + substitutedOptionalPositional = A._substituteArray(universe, optionalPositional, typeArguments, depth), + named = functionParameters._named, + substitutedNamed = A._substituteNamed(universe, named, typeArguments, depth); + if (substitutedRequiredPositional === requiredPositional && substitutedOptionalPositional === optionalPositional && substitutedNamed === named) + return functionParameters; + result = new A._FunctionParameters(); + result._requiredPositional = substitutedRequiredPositional; + result._optionalPositional = substitutedOptionalPositional; + result._named = substitutedNamed; + return result; + }, + _setArrayType(target, rti) { + target[init.arrayRti] = rti; + return target; + }, + closureFunctionType(closure) { + var signature = closure.$signature; + if (signature != null) { + if (typeof signature == "number") + return A.getTypeFromTypesTable(signature); + return closure.$signature(); + } + return null; + }, + instanceOrFunctionType(object, testRti) { + var rti; + if (A.Rti__isUnionOfFunctionType(testRti)) + if (object instanceof A.Closure) { + rti = A.closureFunctionType(object); + if (rti != null) + return rti; + } + return A.instanceType(object); + }, + instanceType(object) { + if (object instanceof A.Object) + return A._instanceType(object); + if (Array.isArray(object)) + return A._arrayInstanceType(object); + return A._instanceTypeFromConstructor(J.getInterceptor$(object)); + }, + _arrayInstanceType(object) { + var rti = object[init.arrayRti], + defaultRti = type$.JSArray_dynamic; + if (rti == null) + return defaultRti; + if (rti.constructor !== defaultRti.constructor) + return defaultRti; + return rti; + }, + _instanceType(object) { + var rti = object.$ti; + return rti != null ? rti : A._instanceTypeFromConstructor(object); + }, + _instanceTypeFromConstructor(instance) { + var $constructor = instance.constructor, + probe = $constructor.$ccache; + if (probe != null) + return probe; + return A._instanceTypeFromConstructorMiss(instance, $constructor); + }, + _instanceTypeFromConstructorMiss(instance, $constructor) { + var effectiveConstructor = instance instanceof A.Closure ? Object.getPrototypeOf(Object.getPrototypeOf(instance)).constructor : $constructor, + rti = A._Universe_findErasedType(init.typeUniverse, effectiveConstructor.name); + $constructor.$ccache = rti; + return rti; + }, + getTypeFromTypesTable(index) { + var rti, + table = init.types, + type = table[index]; + if (typeof type == "string") { + rti = A._Universe_eval(init.typeUniverse, type, false); + table[index] = rti; + return rti; + } + return type; + }, + getRuntimeTypeOfDartObject(object) { + return A.createRuntimeType(A._instanceType(object)); + }, + getRuntimeTypeOfClosure(closure) { + var rti = A.closureFunctionType(closure); + return A.createRuntimeType(rti == null ? A.instanceType(closure) : rti); + }, + _structuralTypeOf(object) { + var functionRti; + if (object instanceof A._Record) + return A.evaluateRtiForRecord(object.$recipe, object._getFieldValues$0()); + functionRti = object instanceof A.Closure ? A.closureFunctionType(object) : null; + if (functionRti != null) + return functionRti; + if (type$.TrustedGetRuntimeType._is(object)) + return J.get$runtimeType$(object)._rti; + if (Array.isArray(object)) + return A._arrayInstanceType(object); + return A.instanceType(object); + }, + createRuntimeType(rti) { + var t1 = rti._cachedRuntimeType; + return t1 == null ? rti._cachedRuntimeType = A._createRuntimeType(rti) : t1; + }, + _createRuntimeType(rti) { + var starErasedRti, t1, + s = rti._canonicalRecipe, + starErasedRecipe = s.replace(/\*/g, ""); + if (starErasedRecipe === s) + return rti._cachedRuntimeType = new A._Type(rti); + starErasedRti = A._Universe_eval(init.typeUniverse, starErasedRecipe, true); + t1 = starErasedRti._cachedRuntimeType; + return t1 == null ? starErasedRti._cachedRuntimeType = A._createRuntimeType(starErasedRti) : t1; + }, + evaluateRtiForRecord(recordRecipe, valuesList) { + var bindings, i, + values = valuesList, + $length = values.length; + if ($length === 0) + return type$.Record_0; + bindings = A._Universe_evalInEnvironment(init.typeUniverse, A._structuralTypeOf(values[0]), "@<0>"); + for (i = 1; i < $length; ++i) + bindings = A._Universe_bind(init.typeUniverse, bindings, A._structuralTypeOf(values[i])); + return A._Universe_evalInEnvironment(init.typeUniverse, bindings, recordRecipe); + }, + typeLiteral(recipe) { + return A.createRuntimeType(A._Universe_eval(init.typeUniverse, recipe, false)); + }, + _installSpecializedIsTest(object) { + var t1, unstarred, unstarredKind, isFn, $name, predicate, testRti = this; + if (testRti === type$.Object) + return A._finishIsFn(testRti, object, A._isObject); + if (!A.isSoundTopType(testRti)) + if (!(testRti === type$.legacy_Object)) + t1 = false; + else + t1 = true; + else + t1 = true; + if (t1) + return A._finishIsFn(testRti, object, A._isTop); + t1 = testRti._kind; + if (t1 === 7) + return A._finishIsFn(testRti, object, A._generalNullableIsTestImplementation); + if (t1 === 1) + return A._finishIsFn(testRti, object, A._isNever); + unstarred = t1 === 6 ? testRti._primary : testRti; + unstarredKind = unstarred._kind; + if (unstarredKind === 8) + return A._finishIsFn(testRti, object, A._isFutureOr); + if (unstarred === type$.int) + isFn = A._isInt; + else if (unstarred === type$.double || unstarred === type$.num) + isFn = A._isNum; + else if (unstarred === type$.String) + isFn = A._isString; + else + isFn = unstarred === type$.bool ? A._isBool : null; + if (isFn != null) + return A._finishIsFn(testRti, object, isFn); + if (unstarredKind === 9) { + $name = unstarred._primary; + if (unstarred._rest.every(A.isDefinitelyTopType)) { + testRti._specializedTestResource = "$is" + $name; + if ($name === "List") + return A._finishIsFn(testRti, object, A._isListTestViaProperty); + return A._finishIsFn(testRti, object, A._isTestViaProperty); + } + } else if (unstarredKind === 11) { + predicate = A.createRecordTypePredicate(unstarred._primary, unstarred._rest); + return A._finishIsFn(testRti, object, predicate == null ? A._isNever : predicate); + } + return A._finishIsFn(testRti, object, A._generalIsTestImplementation); + }, + _finishIsFn(testRti, object, isFn) { + testRti._is = isFn; + return testRti._is(object); + }, + _installSpecializedAsCheck(object) { + var t1, testRti = this, + asFn = A._generalAsCheckImplementation; + if (!A.isSoundTopType(testRti)) + if (!(testRti === type$.legacy_Object)) + t1 = false; + else + t1 = true; + else + t1 = true; + if (t1) + asFn = A._asTop; + else if (testRti === type$.Object) + asFn = A._asObject; + else { + t1 = A.isNullable(testRti); + if (t1) + asFn = A._generalNullableAsCheckImplementation; + } + testRti._as = asFn; + return testRti._as(object); + }, + _nullIs(testRti) { + var t1, + kind = testRti._kind; + if (!A.isSoundTopType(testRti)) + if (!(testRti === type$.legacy_Object)) + if (!(testRti === type$.legacy_Never)) + if (kind !== 7) + if (!(kind === 6 && A._nullIs(testRti._primary))) + t1 = kind === 8 && A._nullIs(testRti._primary) || testRti === type$.Null || testRti === type$.JSNull; + else + t1 = true; + else + t1 = true; + else + t1 = true; + else + t1 = true; + else + t1 = true; + return t1; + }, + _generalIsTestImplementation(object) { + var testRti = this; + if (object == null) + return A._nullIs(testRti); + return A.isSubtype(init.typeUniverse, A.instanceOrFunctionType(object, testRti), testRti); + }, + _generalNullableIsTestImplementation(object) { + if (object == null) + return true; + return this._primary._is(object); + }, + _isTestViaProperty(object) { + var tag, testRti = this; + if (object == null) + return A._nullIs(testRti); + tag = testRti._specializedTestResource; + if (object instanceof A.Object) + return !!object[tag]; + return !!J.getInterceptor$(object)[tag]; + }, + _isListTestViaProperty(object) { + var tag, testRti = this; + if (object == null) + return A._nullIs(testRti); + if (typeof object != "object") + return false; + if (Array.isArray(object)) + return true; + tag = testRti._specializedTestResource; + if (object instanceof A.Object) + return !!object[tag]; + return !!J.getInterceptor$(object)[tag]; + }, + _generalAsCheckImplementation(object) { + var testRti = this; + if (object == null) { + if (A.isNullable(testRti)) + return object; + } else if (testRti._is(object)) + return object; + A._failedAsCheck(object, testRti); + }, + _generalNullableAsCheckImplementation(object) { + var testRti = this; + if (object == null) + return object; + else if (testRti._is(object)) + return object; + A._failedAsCheck(object, testRti); + }, + _failedAsCheck(object, testRti) { + throw A.wrapException(A._TypeError$fromMessage(A._Error_compose(object, A._rtiToString(testRti, null)))); + }, + _Error_compose(object, checkedTypeDescription) { + return A.Error_safeToString(object) + ": type '" + A._rtiToString(A._structuralTypeOf(object), null) + "' is not a subtype of type '" + checkedTypeDescription + "'"; + }, + _TypeError$fromMessage(message) { + return new A._TypeError("TypeError: " + message); + }, + _TypeError__TypeError$forType(object, type) { + return new A._TypeError("TypeError: " + A._Error_compose(object, type)); + }, + _isFutureOr(object) { + var testRti = this, + unstarred = testRti._kind === 6 ? testRti._primary : testRti; + return unstarred._primary._is(object) || A.Rti__getFutureFromFutureOr(init.typeUniverse, unstarred)._is(object); + }, + _isObject(object) { + return object != null; + }, + _asObject(object) { + if (object != null) + return object; + throw A.wrapException(A._TypeError__TypeError$forType(object, "Object")); + }, + _isTop(object) { + return true; + }, + _asTop(object) { + return object; + }, + _isNever(object) { + return false; + }, + _isBool(object) { + return true === object || false === object; + }, + _asBool(object) { + if (true === object) + return true; + if (false === object) + return false; + throw A.wrapException(A._TypeError__TypeError$forType(object, "bool")); + }, + _asBoolS(object) { + if (true === object) + return true; + if (false === object) + return false; + if (object == null) + return object; + throw A.wrapException(A._TypeError__TypeError$forType(object, "bool")); + }, + _asBoolQ(object) { + if (true === object) + return true; + if (false === object) + return false; + if (object == null) + return object; + throw A.wrapException(A._TypeError__TypeError$forType(object, "bool?")); + }, + _asDouble(object) { + if (typeof object == "number") + return object; + throw A.wrapException(A._TypeError__TypeError$forType(object, "double")); + }, + _asDoubleS(object) { + if (typeof object == "number") + return object; + if (object == null) + return object; + throw A.wrapException(A._TypeError__TypeError$forType(object, "double")); + }, + _asDoubleQ(object) { + if (typeof object == "number") + return object; + if (object == null) + return object; + throw A.wrapException(A._TypeError__TypeError$forType(object, "double?")); + }, + _isInt(object) { + return typeof object == "number" && Math.floor(object) === object; + }, + _asInt(object) { + if (typeof object == "number" && Math.floor(object) === object) + return object; + throw A.wrapException(A._TypeError__TypeError$forType(object, "int")); + }, + _asIntS(object) { + if (typeof object == "number" && Math.floor(object) === object) + return object; + if (object == null) + return object; + throw A.wrapException(A._TypeError__TypeError$forType(object, "int")); + }, + _asIntQ(object) { + if (typeof object == "number" && Math.floor(object) === object) + return object; + if (object == null) + return object; + throw A.wrapException(A._TypeError__TypeError$forType(object, "int?")); + }, + _isNum(object) { + return typeof object == "number"; + }, + _asNum(object) { + if (typeof object == "number") + return object; + throw A.wrapException(A._TypeError__TypeError$forType(object, "num")); + }, + _asNumS(object) { + if (typeof object == "number") + return object; + if (object == null) + return object; + throw A.wrapException(A._TypeError__TypeError$forType(object, "num")); + }, + _asNumQ(object) { + if (typeof object == "number") + return object; + if (object == null) + return object; + throw A.wrapException(A._TypeError__TypeError$forType(object, "num?")); + }, + _isString(object) { + return typeof object == "string"; + }, + _asString(object) { + if (typeof object == "string") + return object; + throw A.wrapException(A._TypeError__TypeError$forType(object, "String")); + }, + _asStringS(object) { + if (typeof object == "string") + return object; + if (object == null) + return object; + throw A.wrapException(A._TypeError__TypeError$forType(object, "String")); + }, + _asStringQ(object) { + if (typeof object == "string") + return object; + if (object == null) + return object; + throw A.wrapException(A._TypeError__TypeError$forType(object, "String?")); + }, + _rtiArrayToString(array, genericContext) { + var s, sep, i; + for (s = "", sep = "", i = 0; i < array.length; ++i, sep = ", ") + s += sep + A._rtiToString(array[i], genericContext); + return s; + }, + _recordRtiToString(recordType, genericContext) { + var fieldCount, names, namesIndex, s, comma, i, + partialShape = recordType._primary, + fields = recordType._rest; + if ("" === partialShape) + return "(" + A._rtiArrayToString(fields, genericContext) + ")"; + fieldCount = fields.length; + names = partialShape.split(","); + namesIndex = names.length - fieldCount; + for (s = "(", comma = "", i = 0; i < fieldCount; ++i, comma = ", ") { + s += comma; + if (namesIndex === 0) + s += "{"; + s += A._rtiToString(fields[i], genericContext); + if (namesIndex >= 0) + s += " " + names[namesIndex]; + ++namesIndex; + } + return s + "})"; + }, + _functionRtiToString(functionType, genericContext, bounds) { + var boundsLength, outerContextLength, offset, i, t1, t2, typeParametersText, typeSep, boundRti, kind, t3, parameters, requiredPositional, requiredPositionalLength, optionalPositional, optionalPositionalLength, named, namedLength, returnTypeText, argumentsText, sep, _s2_ = ", "; + if (bounds != null) { + boundsLength = bounds.length; + if (genericContext == null) { + genericContext = A._setArrayType([], type$.JSArray_String); + outerContextLength = null; + } else + outerContextLength = genericContext.length; + offset = genericContext.length; + for (i = boundsLength; i > 0; --i) + genericContext.push("T" + (offset + i)); + for (t1 = type$.nullable_Object, t2 = type$.legacy_Object, typeParametersText = "<", typeSep = "", i = 0; i < boundsLength; ++i, typeSep = _s2_) { + typeParametersText = B.JSString_methods.$add(typeParametersText + typeSep, genericContext[genericContext.length - 1 - i]); + boundRti = bounds[i]; + kind = boundRti._kind; + if (!(kind === 2 || kind === 3 || kind === 4 || kind === 5 || boundRti === t1)) + if (!(boundRti === t2)) + t3 = false; + else + t3 = true; + else + t3 = true; + if (!t3) + typeParametersText += " extends " + A._rtiToString(boundRti, genericContext); + } + typeParametersText += ">"; + } else { + typeParametersText = ""; + outerContextLength = null; + } + t1 = functionType._primary; + parameters = functionType._rest; + requiredPositional = parameters._requiredPositional; + requiredPositionalLength = requiredPositional.length; + optionalPositional = parameters._optionalPositional; + optionalPositionalLength = optionalPositional.length; + named = parameters._named; + namedLength = named.length; + returnTypeText = A._rtiToString(t1, genericContext); + for (argumentsText = "", sep = "", i = 0; i < requiredPositionalLength; ++i, sep = _s2_) + argumentsText += sep + A._rtiToString(requiredPositional[i], genericContext); + if (optionalPositionalLength > 0) { + argumentsText += sep + "["; + for (sep = "", i = 0; i < optionalPositionalLength; ++i, sep = _s2_) + argumentsText += sep + A._rtiToString(optionalPositional[i], genericContext); + argumentsText += "]"; + } + if (namedLength > 0) { + argumentsText += sep + "{"; + for (sep = "", i = 0; i < namedLength; i += 3, sep = _s2_) { + argumentsText += sep; + if (named[i + 1]) + argumentsText += "required "; + argumentsText += A._rtiToString(named[i + 2], genericContext) + " " + named[i]; + } + argumentsText += "}"; + } + if (outerContextLength != null) { + genericContext.toString; + genericContext.length = outerContextLength; + } + return typeParametersText + "(" + argumentsText + ") => " + returnTypeText; + }, + _rtiToString(rti, genericContext) { + var questionArgument, s, argumentKind, $name, $arguments, t1, + kind = rti._kind; + if (kind === 5) + return "erased"; + if (kind === 2) + return "dynamic"; + if (kind === 3) + return "void"; + if (kind === 1) + return "Never"; + if (kind === 4) + return "any"; + if (kind === 6) + return A._rtiToString(rti._primary, genericContext); + if (kind === 7) { + questionArgument = rti._primary; + s = A._rtiToString(questionArgument, genericContext); + argumentKind = questionArgument._kind; + return (argumentKind === 12 || argumentKind === 13 ? "(" + s + ")" : s) + "?"; + } + if (kind === 8) + return "FutureOr<" + A._rtiToString(rti._primary, genericContext) + ">"; + if (kind === 9) { + $name = A._unminifyOrTag(rti._primary); + $arguments = rti._rest; + return $arguments.length > 0 ? $name + ("<" + A._rtiArrayToString($arguments, genericContext) + ">") : $name; + } + if (kind === 11) + return A._recordRtiToString(rti, genericContext); + if (kind === 12) + return A._functionRtiToString(rti, genericContext, null); + if (kind === 13) + return A._functionRtiToString(rti._primary, genericContext, rti._rest); + if (kind === 14) { + t1 = rti._primary; + return genericContext[genericContext.length - 1 - t1]; + } + return "?"; + }, + _unminifyOrTag(rawClassName) { + var preserved = init.mangledGlobalNames[rawClassName]; + if (preserved != null) + return preserved; + return rawClassName; + }, + _Universe_findRule(universe, targetType) { + var rule = universe.tR[targetType]; + for (; typeof rule == "string";) + rule = universe.tR[rule]; + return rule; + }, + _Universe_findErasedType(universe, cls) { + var $length, erased, $arguments, i, $interface, + t1 = universe.eT, + probe = t1[cls]; + if (probe == null) + return A._Universe_eval(universe, cls, false); + else if (typeof probe == "number") { + $length = probe; + erased = A._Universe__lookupTerminalRti(universe, 5, "#"); + $arguments = A._Utils_newArrayOrEmpty($length); + for (i = 0; i < $length; ++i) + $arguments[i] = erased; + $interface = A._Universe__lookupInterfaceRti(universe, cls, $arguments); + t1[cls] = $interface; + return $interface; + } else + return probe; + }, + _Universe_addRules(universe, rules) { + return A._Utils_objectAssign(universe.tR, rules); + }, + _Universe_addErasedTypes(universe, types) { + return A._Utils_objectAssign(universe.eT, types); + }, + _Universe_eval(universe, recipe, normalize) { + var rti, + t1 = universe.eC, + probe = t1.get(recipe); + if (probe != null) + return probe; + rti = A._Parser_parse(A._Parser_create(universe, null, recipe, normalize)); + t1.set(recipe, rti); + return rti; + }, + _Universe_evalInEnvironment(universe, environment, recipe) { + var probe, rti, + cache = environment._evalCache; + if (cache == null) + cache = environment._evalCache = new Map(); + probe = cache.get(recipe); + if (probe != null) + return probe; + rti = A._Parser_parse(A._Parser_create(universe, environment, recipe, true)); + cache.set(recipe, rti); + return rti; + }, + _Universe_bind(universe, environment, argumentsRti) { + var argumentsRecipe, probe, rti, + cache = environment._bindCache; + if (cache == null) + cache = environment._bindCache = new Map(); + argumentsRecipe = argumentsRti._canonicalRecipe; + probe = cache.get(argumentsRecipe); + if (probe != null) + return probe; + rti = A._Universe__lookupBindingRti(universe, environment, argumentsRti._kind === 10 ? argumentsRti._rest : [argumentsRti]); + cache.set(argumentsRecipe, rti); + return rti; + }, + _Universe__installTypeTests(universe, rti) { + rti._as = A._installSpecializedAsCheck; + rti._is = A._installSpecializedIsTest; + return rti; + }, + _Universe__lookupTerminalRti(universe, kind, key) { + var rti, t1, + probe = universe.eC.get(key); + if (probe != null) + return probe; + rti = new A.Rti(null, null); + rti._kind = kind; + rti._canonicalRecipe = key; + t1 = A._Universe__installTypeTests(universe, rti); + universe.eC.set(key, t1); + return t1; + }, + _Universe__lookupStarRti(universe, baseType, normalize) { + var t1, + key = baseType._canonicalRecipe + "*", + probe = universe.eC.get(key); + if (probe != null) + return probe; + t1 = A._Universe__createStarRti(universe, baseType, key, normalize); + universe.eC.set(key, t1); + return t1; + }, + _Universe__createStarRti(universe, baseType, key, normalize) { + var baseKind, t1, rti; + if (normalize) { + baseKind = baseType._kind; + if (!A.isSoundTopType(baseType)) + t1 = baseType === type$.Null || baseType === type$.JSNull || baseKind === 7 || baseKind === 6; + else + t1 = true; + if (t1) + return baseType; + } + rti = new A.Rti(null, null); + rti._kind = 6; + rti._primary = baseType; + rti._canonicalRecipe = key; + return A._Universe__installTypeTests(universe, rti); + }, + _Universe__lookupQuestionRti(universe, baseType, normalize) { + var t1, + key = baseType._canonicalRecipe + "?", + probe = universe.eC.get(key); + if (probe != null) + return probe; + t1 = A._Universe__createQuestionRti(universe, baseType, key, normalize); + universe.eC.set(key, t1); + return t1; + }, + _Universe__createQuestionRti(universe, baseType, key, normalize) { + var baseKind, t1, starArgument, rti; + if (normalize) { + baseKind = baseType._kind; + if (!A.isSoundTopType(baseType)) + if (!(baseType === type$.Null || baseType === type$.JSNull)) + if (baseKind !== 7) + t1 = baseKind === 8 && A.isNullable(baseType._primary); + else + t1 = true; + else + t1 = true; + else + t1 = true; + if (t1) + return baseType; + else if (baseKind === 1 || baseType === type$.legacy_Never) + return type$.Null; + else if (baseKind === 6) { + starArgument = baseType._primary; + if (starArgument._kind === 8 && A.isNullable(starArgument._primary)) + return starArgument; + else + return A.Rti__getQuestionFromStar(universe, baseType); + } + } + rti = new A.Rti(null, null); + rti._kind = 7; + rti._primary = baseType; + rti._canonicalRecipe = key; + return A._Universe__installTypeTests(universe, rti); + }, + _Universe__lookupFutureOrRti(universe, baseType, normalize) { + var t1, + key = baseType._canonicalRecipe + "/", + probe = universe.eC.get(key); + if (probe != null) + return probe; + t1 = A._Universe__createFutureOrRti(universe, baseType, key, normalize); + universe.eC.set(key, t1); + return t1; + }, + _Universe__createFutureOrRti(universe, baseType, key, normalize) { + var t1, rti; + if (normalize) { + t1 = baseType._kind; + if (A.isSoundTopType(baseType) || baseType === type$.Object || baseType === type$.legacy_Object) + return baseType; + else if (t1 === 1) + return A._Universe__lookupInterfaceRti(universe, "Future", [baseType]); + else if (baseType === type$.Null || baseType === type$.JSNull) + return type$.nullable_Future_Null; + } + rti = new A.Rti(null, null); + rti._kind = 8; + rti._primary = baseType; + rti._canonicalRecipe = key; + return A._Universe__installTypeTests(universe, rti); + }, + _Universe__lookupGenericFunctionParameterRti(universe, index) { + var rti, t1, + key = "" + index + "^", + probe = universe.eC.get(key); + if (probe != null) + return probe; + rti = new A.Rti(null, null); + rti._kind = 14; + rti._primary = index; + rti._canonicalRecipe = key; + t1 = A._Universe__installTypeTests(universe, rti); + universe.eC.set(key, t1); + return t1; + }, + _Universe__canonicalRecipeJoin($arguments) { + var s, sep, i, + $length = $arguments.length; + for (s = "", sep = "", i = 0; i < $length; ++i, sep = ",") + s += sep + $arguments[i]._canonicalRecipe; + return s; + }, + _Universe__canonicalRecipeJoinNamed($arguments) { + var s, sep, i, t1, nameSep, + $length = $arguments.length; + for (s = "", sep = "", i = 0; i < $length; i += 3, sep = ",") { + t1 = $arguments[i]; + nameSep = $arguments[i + 1] ? "!" : ":"; + s += sep + t1 + nameSep + $arguments[i + 2]._canonicalRecipe; + } + return s; + }, + _Universe__lookupInterfaceRti(universe, $name, $arguments) { + var probe, rti, t1, + s = $name; + if ($arguments.length > 0) + s += "<" + A._Universe__canonicalRecipeJoin($arguments) + ">"; + probe = universe.eC.get(s); + if (probe != null) + return probe; + rti = new A.Rti(null, null); + rti._kind = 9; + rti._primary = $name; + rti._rest = $arguments; + if ($arguments.length > 0) + rti._precomputed1 = $arguments[0]; + rti._canonicalRecipe = s; + t1 = A._Universe__installTypeTests(universe, rti); + universe.eC.set(s, t1); + return t1; + }, + _Universe__lookupBindingRti(universe, base, $arguments) { + var newBase, newArguments, key, probe, rti, t1; + if (base._kind === 10) { + newBase = base._primary; + newArguments = base._rest.concat($arguments); + } else { + newArguments = $arguments; + newBase = base; + } + key = newBase._canonicalRecipe + (";<" + A._Universe__canonicalRecipeJoin(newArguments) + ">"); + probe = universe.eC.get(key); + if (probe != null) + return probe; + rti = new A.Rti(null, null); + rti._kind = 10; + rti._primary = newBase; + rti._rest = newArguments; + rti._canonicalRecipe = key; + t1 = A._Universe__installTypeTests(universe, rti); + universe.eC.set(key, t1); + return t1; + }, + _Universe__lookupRecordRti(universe, partialShapeTag, fields) { + var rti, t1, + key = "+" + (partialShapeTag + "(" + A._Universe__canonicalRecipeJoin(fields) + ")"), + probe = universe.eC.get(key); + if (probe != null) + return probe; + rti = new A.Rti(null, null); + rti._kind = 11; + rti._primary = partialShapeTag; + rti._rest = fields; + rti._canonicalRecipe = key; + t1 = A._Universe__installTypeTests(universe, rti); + universe.eC.set(key, t1); + return t1; + }, + _Universe__lookupFunctionRti(universe, returnType, parameters) { + var sep, key, probe, rti, t1, + s = returnType._canonicalRecipe, + requiredPositional = parameters._requiredPositional, + requiredPositionalLength = requiredPositional.length, + optionalPositional = parameters._optionalPositional, + optionalPositionalLength = optionalPositional.length, + named = parameters._named, + namedLength = named.length, + recipe = "(" + A._Universe__canonicalRecipeJoin(requiredPositional); + if (optionalPositionalLength > 0) { + sep = requiredPositionalLength > 0 ? "," : ""; + recipe += sep + "[" + A._Universe__canonicalRecipeJoin(optionalPositional) + "]"; + } + if (namedLength > 0) { + sep = requiredPositionalLength > 0 ? "," : ""; + recipe += sep + "{" + A._Universe__canonicalRecipeJoinNamed(named) + "}"; + } + key = s + (recipe + ")"); + probe = universe.eC.get(key); + if (probe != null) + return probe; + rti = new A.Rti(null, null); + rti._kind = 12; + rti._primary = returnType; + rti._rest = parameters; + rti._canonicalRecipe = key; + t1 = A._Universe__installTypeTests(universe, rti); + universe.eC.set(key, t1); + return t1; + }, + _Universe__lookupGenericFunctionRti(universe, baseFunctionType, bounds, normalize) { + var t1, + key = baseFunctionType._canonicalRecipe + ("<" + A._Universe__canonicalRecipeJoin(bounds) + ">"), + probe = universe.eC.get(key); + if (probe != null) + return probe; + t1 = A._Universe__createGenericFunctionRti(universe, baseFunctionType, bounds, key, normalize); + universe.eC.set(key, t1); + return t1; + }, + _Universe__createGenericFunctionRti(universe, baseFunctionType, bounds, key, normalize) { + var $length, typeArguments, count, i, bound, substitutedBase, substitutedBounds, rti; + if (normalize) { + $length = bounds.length; + typeArguments = A._Utils_newArrayOrEmpty($length); + for (count = 0, i = 0; i < $length; ++i) { + bound = bounds[i]; + if (bound._kind === 1) { + typeArguments[i] = bound; + ++count; + } + } + if (count > 0) { + substitutedBase = A._substitute(universe, baseFunctionType, typeArguments, 0); + substitutedBounds = A._substituteArray(universe, bounds, typeArguments, 0); + return A._Universe__lookupGenericFunctionRti(universe, substitutedBase, substitutedBounds, bounds !== substitutedBounds); + } + } + rti = new A.Rti(null, null); + rti._kind = 13; + rti._primary = baseFunctionType; + rti._rest = bounds; + rti._canonicalRecipe = key; + return A._Universe__installTypeTests(universe, rti); + }, + _Parser_create(universe, environment, recipe, normalize) { + return {u: universe, e: environment, r: recipe, s: [], p: 0, n: normalize}; + }, + _Parser_parse(parser) { + var t2, i, ch, t3, array, end, item, + source = parser.r, + t1 = parser.s; + for (t2 = source.length, i = 0; i < t2;) { + ch = source.charCodeAt(i); + if (ch >= 48 && ch <= 57) + i = A._Parser_handleDigit(i + 1, ch, source, t1); + else if ((((ch | 32) >>> 0) - 97 & 65535) < 26 || ch === 95 || ch === 36 || ch === 124) + i = A._Parser_handleIdentifier(parser, i, source, t1, false); + else if (ch === 46) + i = A._Parser_handleIdentifier(parser, i, source, t1, true); + else { + ++i; + switch (ch) { + case 44: + break; + case 58: + t1.push(false); + break; + case 33: + t1.push(true); + break; + case 59: + t1.push(A._Parser_toType(parser.u, parser.e, t1.pop())); + break; + case 94: + t1.push(A._Universe__lookupGenericFunctionParameterRti(parser.u, t1.pop())); + break; + case 35: + t1.push(A._Universe__lookupTerminalRti(parser.u, 5, "#")); + break; + case 64: + t1.push(A._Universe__lookupTerminalRti(parser.u, 2, "@")); + break; + case 126: + t1.push(A._Universe__lookupTerminalRti(parser.u, 3, "~")); + break; + case 60: + t1.push(parser.p); + parser.p = t1.length; + break; + case 62: + A._Parser_handleTypeArguments(parser, t1); + break; + case 38: + A._Parser_handleExtendedOperations(parser, t1); + break; + case 42: + t3 = parser.u; + t1.push(A._Universe__lookupStarRti(t3, A._Parser_toType(t3, parser.e, t1.pop()), parser.n)); + break; + case 63: + t3 = parser.u; + t1.push(A._Universe__lookupQuestionRti(t3, A._Parser_toType(t3, parser.e, t1.pop()), parser.n)); + break; + case 47: + t3 = parser.u; + t1.push(A._Universe__lookupFutureOrRti(t3, A._Parser_toType(t3, parser.e, t1.pop()), parser.n)); + break; + case 40: + t1.push(-3); + t1.push(parser.p); + parser.p = t1.length; + break; + case 41: + A._Parser_handleArguments(parser, t1); + break; + case 91: + t1.push(parser.p); + parser.p = t1.length; + break; + case 93: + array = t1.splice(parser.p); + A._Parser_toTypes(parser.u, parser.e, array); + parser.p = t1.pop(); + t1.push(array); + t1.push(-1); + break; + case 123: + t1.push(parser.p); + parser.p = t1.length; + break; + case 125: + array = t1.splice(parser.p); + A._Parser_toTypesNamed(parser.u, parser.e, array); + parser.p = t1.pop(); + t1.push(array); + t1.push(-2); + break; + case 43: + end = source.indexOf("(", i); + t1.push(source.substring(i, end)); + t1.push(-4); + t1.push(parser.p); + parser.p = t1.length; + i = end + 1; + break; + default: + throw "Bad character " + ch; + } + } + } + item = t1.pop(); + return A._Parser_toType(parser.u, parser.e, item); + }, + _Parser_handleDigit(i, digit, source, stack) { + var t1, ch, + value = digit - 48; + for (t1 = source.length; i < t1; ++i) { + ch = source.charCodeAt(i); + if (!(ch >= 48 && ch <= 57)) + break; + value = value * 10 + (ch - 48); + } + stack.push(value); + return i; + }, + _Parser_handleIdentifier(parser, start, source, stack, hasPeriod) { + var t1, ch, t2, string, environment, recipe, + i = start + 1; + for (t1 = source.length; i < t1; ++i) { + ch = source.charCodeAt(i); + if (ch === 46) { + if (hasPeriod) + break; + hasPeriod = true; + } else { + if (!((((ch | 32) >>> 0) - 97 & 65535) < 26 || ch === 95 || ch === 36 || ch === 124)) + t2 = ch >= 48 && ch <= 57; + else + t2 = true; + if (!t2) + break; + } + } + string = source.substring(start, i); + if (hasPeriod) { + t1 = parser.u; + environment = parser.e; + if (environment._kind === 10) + environment = environment._primary; + recipe = A._Universe_findRule(t1, environment._primary)[string]; + if (recipe == null) + A.throwExpression('No "' + string + '" in "' + A.Rti__getCanonicalRecipe(environment) + '"'); + stack.push(A._Universe_evalInEnvironment(t1, environment, recipe)); + } else + stack.push(string); + return i; + }, + _Parser_handleTypeArguments(parser, stack) { + var base, + t1 = parser.u, + $arguments = A._Parser_collectArray(parser, stack), + head = stack.pop(); + if (typeof head == "string") + stack.push(A._Universe__lookupInterfaceRti(t1, head, $arguments)); + else { + base = A._Parser_toType(t1, parser.e, head); + switch (base._kind) { + case 12: + stack.push(A._Universe__lookupGenericFunctionRti(t1, base, $arguments, parser.n)); + break; + default: + stack.push(A._Universe__lookupBindingRti(t1, base, $arguments)); + break; + } + } + }, + _Parser_handleArguments(parser, stack) { + var optionalPositional, named, requiredPositional, returnType, parameters, _null = null, + t1 = parser.u, + head = stack.pop(); + if (typeof head == "number") + switch (head) { + case -1: + optionalPositional = stack.pop(); + named = _null; + break; + case -2: + named = stack.pop(); + optionalPositional = _null; + break; + default: + stack.push(head); + named = _null; + optionalPositional = named; + break; + } + else { + stack.push(head); + named = _null; + optionalPositional = named; + } + requiredPositional = A._Parser_collectArray(parser, stack); + head = stack.pop(); + switch (head) { + case -3: + head = stack.pop(); + if (optionalPositional == null) + optionalPositional = t1.sEA; + if (named == null) + named = t1.sEA; + returnType = A._Parser_toType(t1, parser.e, head); + parameters = new A._FunctionParameters(); + parameters._requiredPositional = requiredPositional; + parameters._optionalPositional = optionalPositional; + parameters._named = named; + stack.push(A._Universe__lookupFunctionRti(t1, returnType, parameters)); + return; + case -4: + stack.push(A._Universe__lookupRecordRti(t1, stack.pop(), requiredPositional)); + return; + default: + throw A.wrapException(A.AssertionError$("Unexpected state under `()`: " + A.S(head))); + } + }, + _Parser_handleExtendedOperations(parser, stack) { + var $top = stack.pop(); + if (0 === $top) { + stack.push(A._Universe__lookupTerminalRti(parser.u, 1, "0&")); + return; + } + if (1 === $top) { + stack.push(A._Universe__lookupTerminalRti(parser.u, 4, "1&")); + return; + } + throw A.wrapException(A.AssertionError$("Unexpected extended operation " + A.S($top))); + }, + _Parser_collectArray(parser, stack) { + var array = stack.splice(parser.p); + A._Parser_toTypes(parser.u, parser.e, array); + parser.p = stack.pop(); + return array; + }, + _Parser_toType(universe, environment, item) { + if (typeof item == "string") + return A._Universe__lookupInterfaceRti(universe, item, universe.sEA); + else if (typeof item == "number") { + environment.toString; + return A._Parser_indexToType(universe, environment, item); + } else + return item; + }, + _Parser_toTypes(universe, environment, items) { + var i, + $length = items.length; + for (i = 0; i < $length; ++i) + items[i] = A._Parser_toType(universe, environment, items[i]); + }, + _Parser_toTypesNamed(universe, environment, items) { + var i, + $length = items.length; + for (i = 2; i < $length; i += 3) + items[i] = A._Parser_toType(universe, environment, items[i]); + }, + _Parser_indexToType(universe, environment, index) { + var typeArguments, len, + kind = environment._kind; + if (kind === 10) { + if (index === 0) + return environment._primary; + typeArguments = environment._rest; + len = typeArguments.length; + if (index <= len) + return typeArguments[index - 1]; + index -= len; + environment = environment._primary; + kind = environment._kind; + } else if (index === 0) + return environment; + if (kind !== 9) + throw A.wrapException(A.AssertionError$("Indexed base must be an interface type")); + typeArguments = environment._rest; + if (index <= typeArguments.length) + return typeArguments[index - 1]; + throw A.wrapException(A.AssertionError$("Bad index " + index + " for " + environment.toString$0(0))); + }, + isSubtype(universe, s, t) { + var result, + sCache = s._isSubtypeCache; + if (sCache == null) + sCache = s._isSubtypeCache = new Map(); + result = sCache.get(t); + if (result == null) { + result = A._isSubtype(universe, s, null, t, null, false) ? 1 : 0; + sCache.set(t, result); + } + if (0 === result) + return false; + if (1 === result) + return true; + return true; + }, + _isSubtype(universe, s, sEnv, t, tEnv, isLegacy) { + var t1, sKind, leftTypeVariable, tKind, t2, sBounds, tBounds, sLength, i, sBound, tBound; + if (s === t) + return true; + if (!A.isSoundTopType(t)) + if (!(t === type$.legacy_Object)) + t1 = false; + else + t1 = true; + else + t1 = true; + if (t1) + return true; + sKind = s._kind; + if (sKind === 4) + return true; + if (A.isSoundTopType(s)) + return false; + if (s._kind !== 1) + t1 = false; + else + t1 = true; + if (t1) + return true; + leftTypeVariable = sKind === 14; + if (leftTypeVariable) + if (A._isSubtype(universe, sEnv[s._primary], sEnv, t, tEnv, false)) + return true; + tKind = t._kind; + t1 = s === type$.Null || s === type$.JSNull; + if (t1) { + if (tKind === 8) + return A._isSubtype(universe, s, sEnv, t._primary, tEnv, false); + return t === type$.Null || t === type$.JSNull || tKind === 7 || tKind === 6; + } + if (t === type$.Object) { + if (sKind === 8) + return A._isSubtype(universe, s._primary, sEnv, t, tEnv, false); + if (sKind === 6) + return A._isSubtype(universe, s._primary, sEnv, t, tEnv, false); + return sKind !== 7; + } + if (sKind === 6) + return A._isSubtype(universe, s._primary, sEnv, t, tEnv, false); + if (tKind === 6) { + t1 = A.Rti__getQuestionFromStar(universe, t); + return A._isSubtype(universe, s, sEnv, t1, tEnv, false); + } + if (sKind === 8) { + if (!A._isSubtype(universe, s._primary, sEnv, t, tEnv, false)) + return false; + return A._isSubtype(universe, A.Rti__getFutureFromFutureOr(universe, s), sEnv, t, tEnv, false); + } + if (sKind === 7) { + t1 = A._isSubtype(universe, type$.Null, sEnv, t, tEnv, false); + return t1 && A._isSubtype(universe, s._primary, sEnv, t, tEnv, false); + } + if (tKind === 8) { + if (A._isSubtype(universe, s, sEnv, t._primary, tEnv, false)) + return true; + return A._isSubtype(universe, s, sEnv, A.Rti__getFutureFromFutureOr(universe, t), tEnv, false); + } + if (tKind === 7) { + t1 = A._isSubtype(universe, s, sEnv, type$.Null, tEnv, false); + return t1 || A._isSubtype(universe, s, sEnv, t._primary, tEnv, false); + } + if (leftTypeVariable) + return false; + t1 = sKind !== 12; + if ((!t1 || sKind === 13) && t === type$.Function) + return true; + t2 = sKind === 11; + if (t2 && t === type$.Record) + return true; + if (tKind === 13) { + if (s === type$.JavaScriptFunction) + return true; + if (sKind !== 13) + return false; + sBounds = s._rest; + tBounds = t._rest; + sLength = sBounds.length; + if (sLength !== tBounds.length) + return false; + sEnv = sEnv == null ? sBounds : sBounds.concat(sEnv); + tEnv = tEnv == null ? tBounds : tBounds.concat(tEnv); + for (i = 0; i < sLength; ++i) { + sBound = sBounds[i]; + tBound = tBounds[i]; + if (!A._isSubtype(universe, sBound, sEnv, tBound, tEnv, false) || !A._isSubtype(universe, tBound, tEnv, sBound, sEnv, false)) + return false; + } + return A._isFunctionSubtype(universe, s._primary, sEnv, t._primary, tEnv, false); + } + if (tKind === 12) { + if (s === type$.JavaScriptFunction) + return true; + if (t1) + return false; + return A._isFunctionSubtype(universe, s, sEnv, t, tEnv, false); + } + if (sKind === 9) { + if (tKind !== 9) + return false; + return A._isInterfaceSubtype(universe, s, sEnv, t, tEnv, false); + } + if (t2 && tKind === 11) + return A._isRecordSubtype(universe, s, sEnv, t, tEnv, false); + return false; + }, + _isFunctionSubtype(universe, s, sEnv, t, tEnv, isLegacy) { + var sParameters, tParameters, sRequiredPositional, tRequiredPositional, sRequiredPositionalLength, tRequiredPositionalLength, requiredPositionalDelta, sOptionalPositional, tOptionalPositional, sOptionalPositionalLength, tOptionalPositionalLength, i, t1, sNamed, tNamed, sNamedLength, tNamedLength, sIndex, tIndex, tName, sName, sIsRequired; + if (!A._isSubtype(universe, s._primary, sEnv, t._primary, tEnv, false)) + return false; + sParameters = s._rest; + tParameters = t._rest; + sRequiredPositional = sParameters._requiredPositional; + tRequiredPositional = tParameters._requiredPositional; + sRequiredPositionalLength = sRequiredPositional.length; + tRequiredPositionalLength = tRequiredPositional.length; + if (sRequiredPositionalLength > tRequiredPositionalLength) + return false; + requiredPositionalDelta = tRequiredPositionalLength - sRequiredPositionalLength; + sOptionalPositional = sParameters._optionalPositional; + tOptionalPositional = tParameters._optionalPositional; + sOptionalPositionalLength = sOptionalPositional.length; + tOptionalPositionalLength = tOptionalPositional.length; + if (sRequiredPositionalLength + sOptionalPositionalLength < tRequiredPositionalLength + tOptionalPositionalLength) + return false; + for (i = 0; i < sRequiredPositionalLength; ++i) { + t1 = sRequiredPositional[i]; + if (!A._isSubtype(universe, tRequiredPositional[i], tEnv, t1, sEnv, false)) + return false; + } + for (i = 0; i < requiredPositionalDelta; ++i) { + t1 = sOptionalPositional[i]; + if (!A._isSubtype(universe, tRequiredPositional[sRequiredPositionalLength + i], tEnv, t1, sEnv, false)) + return false; + } + for (i = 0; i < tOptionalPositionalLength; ++i) { + t1 = sOptionalPositional[requiredPositionalDelta + i]; + if (!A._isSubtype(universe, tOptionalPositional[i], tEnv, t1, sEnv, false)) + return false; + } + sNamed = sParameters._named; + tNamed = tParameters._named; + sNamedLength = sNamed.length; + tNamedLength = tNamed.length; + for (sIndex = 0, tIndex = 0; tIndex < tNamedLength; tIndex += 3) { + tName = tNamed[tIndex]; + for (; true;) { + if (sIndex >= sNamedLength) + return false; + sName = sNamed[sIndex]; + sIndex += 3; + if (tName < sName) + return false; + sIsRequired = sNamed[sIndex - 2]; + if (sName < tName) { + if (sIsRequired) + return false; + continue; + } + t1 = tNamed[tIndex + 1]; + if (sIsRequired && !t1) + return false; + t1 = sNamed[sIndex - 1]; + if (!A._isSubtype(universe, tNamed[tIndex + 2], tEnv, t1, sEnv, false)) + return false; + break; + } + } + for (; sIndex < sNamedLength;) { + if (sNamed[sIndex + 1]) + return false; + sIndex += 3; + } + return true; + }, + _isInterfaceSubtype(universe, s, sEnv, t, tEnv, isLegacy) { + var rule, recipes, $length, supertypeArgs, i, + sName = s._primary, + tName = t._primary; + for (; sName !== tName;) { + rule = universe.tR[sName]; + if (rule == null) + return false; + if (typeof rule == "string") { + sName = rule; + continue; + } + recipes = rule[tName]; + if (recipes == null) + return false; + $length = recipes.length; + supertypeArgs = $length > 0 ? new Array($length) : init.typeUniverse.sEA; + for (i = 0; i < $length; ++i) + supertypeArgs[i] = A._Universe_evalInEnvironment(universe, s, recipes[i]); + return A._areArgumentsSubtypes(universe, supertypeArgs, null, sEnv, t._rest, tEnv, false); + } + return A._areArgumentsSubtypes(universe, s._rest, null, sEnv, t._rest, tEnv, false); + }, + _areArgumentsSubtypes(universe, sArgs, sVariances, sEnv, tArgs, tEnv, isLegacy) { + var i, + $length = sArgs.length; + for (i = 0; i < $length; ++i) + if (!A._isSubtype(universe, sArgs[i], sEnv, tArgs[i], tEnv, false)) + return false; + return true; + }, + _isRecordSubtype(universe, s, sEnv, t, tEnv, isLegacy) { + var i, + sFields = s._rest, + tFields = t._rest, + sCount = sFields.length; + if (sCount !== tFields.length) + return false; + if (s._primary !== t._primary) + return false; + for (i = 0; i < sCount; ++i) + if (!A._isSubtype(universe, sFields[i], sEnv, tFields[i], tEnv, false)) + return false; + return true; + }, + isNullable(t) { + var t1, + kind = t._kind; + if (!(t === type$.Null || t === type$.JSNull)) + if (!A.isSoundTopType(t)) + if (kind !== 7) + if (!(kind === 6 && A.isNullable(t._primary))) + t1 = kind === 8 && A.isNullable(t._primary); + else + t1 = true; + else + t1 = true; + else + t1 = true; + else + t1 = true; + return t1; + }, + isDefinitelyTopType(t) { + var t1; + if (!A.isSoundTopType(t)) + if (!(t === type$.legacy_Object)) + t1 = false; + else + t1 = true; + else + t1 = true; + return t1; + }, + isSoundTopType(t) { + var kind = t._kind; + return kind === 2 || kind === 3 || kind === 4 || kind === 5 || t === type$.nullable_Object; + }, + _Utils_objectAssign(o, other) { + var i, key, + keys = Object.keys(other), + $length = keys.length; + for (i = 0; i < $length; ++i) { + key = keys[i]; + o[key] = other[key]; + } + }, + _Utils_newArrayOrEmpty($length) { + return $length > 0 ? new Array($length) : init.typeUniverse.sEA; + }, + Rti: function Rti(t0, t1) { + var _ = this; + _._as = t0; + _._is = t1; + _._cachedRuntimeType = _._specializedTestResource = _._isSubtypeCache = _._precomputed1 = null; + _._kind = 0; + _._canonicalRecipe = _._bindCache = _._evalCache = _._rest = _._primary = null; + }, + _FunctionParameters: function _FunctionParameters() { + this._named = this._optionalPositional = this._requiredPositional = null; + }, + _Type: function _Type(t0) { + this._rti = t0; + }, + _Error: function _Error() { + }, + _TypeError: function _TypeError(t0) { + this.__rti$_message = t0; + }, + _AsyncRun__initializeScheduleImmediate() { + var div, span, t1 = {}; + if (self.scheduleImmediate != null) + return A.async__AsyncRun__scheduleImmediateJsOverride$closure(); + if (self.MutationObserver != null && self.document != null) { + div = self.document.createElement("div"); + span = self.document.createElement("span"); + t1.storedCallback = null; + new self.MutationObserver(A.convertDartClosureToJS(new A._AsyncRun__initializeScheduleImmediate_internalCallback(t1), 1)).observe(div, {childList: true}); + return new A._AsyncRun__initializeScheduleImmediate_closure(t1, div, span); + } else if (self.setImmediate != null) + return A.async__AsyncRun__scheduleImmediateWithSetImmediate$closure(); + return A.async__AsyncRun__scheduleImmediateWithTimer$closure(); + }, + _AsyncRun__scheduleImmediateJsOverride(callback) { + self.scheduleImmediate(A.convertDartClosureToJS(new A._AsyncRun__scheduleImmediateJsOverride_internalCallback(callback), 0)); + }, + _AsyncRun__scheduleImmediateWithSetImmediate(callback) { + self.setImmediate(A.convertDartClosureToJS(new A._AsyncRun__scheduleImmediateWithSetImmediate_internalCallback(callback), 0)); + }, + _AsyncRun__scheduleImmediateWithTimer(callback) { + A.Timer__createTimer(B.Duration_0, callback); + }, + Timer__createTimer(duration, callback) { + var milliseconds = B.JSInt_methods._tdivFast$1(duration._duration, 1000); + return A._TimerImpl$(milliseconds < 0 ? 0 : milliseconds, callback); + }, + _TimerImpl$(milliseconds, callback) { + var t1 = new A._TimerImpl(true); + t1._TimerImpl$2(milliseconds, callback); + return t1; + }, + _TimerImpl$periodic(milliseconds, callback) { + var t1 = new A._TimerImpl(false); + t1._TimerImpl$periodic$2(milliseconds, callback); + return t1; + }, + _makeAsyncAwaitCompleter($T) { + return new A._AsyncAwaitCompleter(new A._Future($.Zone__current, $T._eval$1("_Future<0>")), $T._eval$1("_AsyncAwaitCompleter<0>")); + }, + _asyncStartSync(bodyFunction, completer) { + bodyFunction.call$2(0, null); + completer.isSync = true; + return completer._future; + }, + _asyncAwait(object, bodyFunction) { + A._awaitOnObject(object, bodyFunction); + }, + _asyncReturn(object, completer) { + completer.complete$1(object); + }, + _asyncRethrow(object, completer) { + completer.completeError$2(A.unwrapException(object), A.getTraceFromException(object)); + }, + _awaitOnObject(object, bodyFunction) { + var t1, future, + thenCallback = new A._awaitOnObject_closure(bodyFunction), + errorCallback = new A._awaitOnObject_closure0(bodyFunction); + if (object instanceof A._Future) + object._thenAwait$1$2(thenCallback, errorCallback, type$.dynamic); + else { + t1 = type$.dynamic; + if (object instanceof A._Future) + object.then$1$2$onError(0, thenCallback, errorCallback, t1); + else { + future = new A._Future($.Zone__current, type$._Future_dynamic); + future._state = 8; + future._resultOrListeners = object; + future._thenAwait$1$2(thenCallback, errorCallback, t1); + } + } + }, + _wrapJsFunctionForAsync($function) { + var $protected = function(fn, ERROR) { + return function(errorCode, result) { + while (true) { + try { + fn(errorCode, result); + break; + } catch (error) { + result = error; + errorCode = ERROR; + } + } + }; + }($function, 1); + return $.Zone__current.registerBinaryCallback$3$1(new A._wrapJsFunctionForAsync_closure($protected), type$.void, type$.int, type$.dynamic); + }, + _SyncStarIterator__terminatedBody(_1, _2, _3) { + return 0; + }, + AsyncError$(error, stackTrace) { + var t1 = A.checkNotNullable(error, "error", type$.Object); + return new A.AsyncError(t1, stackTrace == null ? A.AsyncError_defaultStackTrace(error) : stackTrace); + }, + AsyncError_defaultStackTrace(error) { + var stackTrace; + if (type$.Error._is(error)) { + stackTrace = error.get$stackTrace(); + if (stackTrace != null) + return stackTrace; + } + return B._StringStackTrace_3uE; + }, + Future_Future$value(value, $T) { + var t1; + $T._as(value); + t1 = new A._Future($.Zone__current, $T._eval$1("_Future<0>")); + t1._asyncComplete$1(value); + return t1; + }, + Future_Future$error(error, stackTrace, $T) { + var t1, replacement; + A.checkNotNullable(error, "error", type$.Object); + t1 = $.Zone__current; + if (t1 !== B.C__RootZone) { + replacement = t1.errorCallback$2(error, stackTrace); + if (replacement != null) { + error = replacement.error; + stackTrace = replacement.stackTrace; + } + } + if (stackTrace == null) + stackTrace = A.AsyncError_defaultStackTrace(error); + t1 = new A._Future($.Zone__current, $T._eval$1("_Future<0>")); + t1._asyncCompleteError$2(error, stackTrace); + return t1; + }, + Future_wait(futures, eagerError, $T) { + var error, stackTrace, handleError, future, pos, e, st, t1, t2, exception, _box_0 = {}, cleanUp = null, + _future = new A._Future($.Zone__current, $T._eval$1("_Future>")); + _box_0.values = null; + _box_0.remaining = 0; + error = A._Cell$named("error"); + stackTrace = A._Cell$named("stackTrace"); + handleError = new A.Future_wait_handleError(_box_0, cleanUp, eagerError, _future, error, stackTrace); + try { + for (t1 = J.get$iterator$ax(futures), t2 = type$.Null; t1.moveNext$0();) { + future = t1.get$current(t1); + pos = _box_0.remaining; + J.then$1$2$onError$x(future, new A.Future_wait_closure(_box_0, pos, _future, cleanUp, eagerError, error, stackTrace, $T), handleError, t2); + ++_box_0.remaining; + } + t1 = _box_0.remaining; + if (t1 === 0) { + t1 = _future; + t1._completeWithValue$1(A._setArrayType([], $T._eval$1("JSArray<0>"))); + return t1; + } + _box_0.values = A.List_List$filled(t1, null, false, $T._eval$1("0?")); + } catch (exception) { + e = A.unwrapException(exception); + st = A.getTraceFromException(exception); + if (_box_0.remaining === 0 || eagerError) + return A.Future_Future$error(e, st, $T._eval$1("List<0>")); + else { + error._value = e; + stackTrace._value = st; + } + } + return _future; + }, + _Future$zoneValue(value, _zone, $T) { + var t1 = new A._Future(_zone, $T._eval$1("_Future<0>")); + t1._state = 8; + t1._resultOrListeners = value; + return t1; + }, + _Future$value(value, $T) { + var t1 = new A._Future($.Zone__current, $T._eval$1("_Future<0>")); + t1._state = 8; + t1._resultOrListeners = value; + return t1; + }, + _Future__chainCoreFutureSync(source, target) { + var t1, listeners; + for (; t1 = source._state, (t1 & 4) !== 0;) + source = source._resultOrListeners; + if ((t1 & 24) !== 0) { + listeners = target._removeListeners$0(); + target._cloneResult$1(source); + A._Future__propagateToListeners(target, listeners); + } else { + listeners = target._resultOrListeners; + target._setChained$1(source); + source._prependListeners$1(listeners); + } + }, + _Future__chainCoreFutureAsync(source, target) { + var t2, listeners, _box_0 = {}, + t1 = _box_0.source = source; + for (; t2 = t1._state, (t2 & 4) !== 0;) { + t1 = t1._resultOrListeners; + _box_0.source = t1; + } + if ((t2 & 24) === 0) { + listeners = target._resultOrListeners; + target._setChained$1(t1); + _box_0.source._prependListeners$1(listeners); + return; + } + if ((t2 & 16) === 0 && target._resultOrListeners == null) { + target._cloneResult$1(t1); + return; + } + target._state ^= 2; + target._zone.scheduleMicrotask$1(new A._Future__chainCoreFutureAsync_closure(_box_0, target)); + }, + _Future__propagateToListeners(source, listeners) { + var _box_0, t2, t3, hasError, nextListener, nextListener0, sourceResult, t4, zone, oldZone, result, current, _box_1 = {}, + t1 = _box_1.source = source; + for (; true;) { + _box_0 = {}; + t2 = t1._state; + t3 = (t2 & 16) === 0; + hasError = !t3; + if (listeners == null) { + if (hasError && (t2 & 1) === 0) { + t2 = t1._resultOrListeners; + t1._zone.handleUncaughtError$2(t2.error, t2.stackTrace); + } + return; + } + _box_0.listener = listeners; + nextListener = listeners._nextListener; + for (t1 = listeners; nextListener != null; t1 = nextListener, nextListener = nextListener0) { + t1._nextListener = null; + A._Future__propagateToListeners(_box_1.source, t1); + _box_0.listener = nextListener; + nextListener0 = nextListener._nextListener; + } + t2 = _box_1.source; + sourceResult = t2._resultOrListeners; + _box_0.listenerHasError = hasError; + _box_0.listenerValueOrError = sourceResult; + if (t3) { + t4 = t1.state; + t4 = (t4 & 1) !== 0 || (t4 & 15) === 8; + } else + t4 = true; + if (t4) { + zone = t1.result._zone; + if (hasError) { + t1 = t2._zone; + t1 = !(t1 === zone || t1.get$errorZone() === zone.get$errorZone()); + } else + t1 = false; + if (t1) { + t1 = _box_1.source; + t2 = t1._resultOrListeners; + t1._zone.handleUncaughtError$2(t2.error, t2.stackTrace); + return; + } + oldZone = $.Zone__current; + if (oldZone !== zone) + $.Zone__current = zone; + else + oldZone = null; + t1 = _box_0.listener.state; + if ((t1 & 15) === 8) + new A._Future__propagateToListeners_handleWhenCompleteCallback(_box_0, _box_1, hasError).call$0(); + else if (t3) { + if ((t1 & 1) !== 0) + new A._Future__propagateToListeners_handleValueCallback(_box_0, sourceResult).call$0(); + } else if ((t1 & 2) !== 0) + new A._Future__propagateToListeners_handleError(_box_1, _box_0).call$0(); + if (oldZone != null) + $.Zone__current = oldZone; + t1 = _box_0.listenerValueOrError; + if (t1 instanceof A._Future) { + t2 = _box_0.listener.$ti; + t2 = t2._eval$1("Future<2>")._is(t1) || !t2._rest[1]._is(t1); + } else + t2 = false; + if (t2) { + result = _box_0.listener.result; + if ((t1._state & 24) !== 0) { + current = result._resultOrListeners; + result._resultOrListeners = null; + listeners = result._reverseListeners$1(current); + result._state = t1._state & 30 | result._state & 1; + result._resultOrListeners = t1._resultOrListeners; + _box_1.source = t1; + continue; + } else + A._Future__chainCoreFutureSync(t1, result); + return; + } + } + result = _box_0.listener.result; + current = result._resultOrListeners; + result._resultOrListeners = null; + listeners = result._reverseListeners$1(current); + t1 = _box_0.listenerHasError; + t2 = _box_0.listenerValueOrError; + if (!t1) { + result._state = 8; + result._resultOrListeners = t2; + } else { + result._state = result._state & 1 | 16; + result._resultOrListeners = t2; + } + _box_1.source = result; + t1 = result; + } + }, + _registerErrorHandler(errorHandler, zone) { + if (type$.dynamic_Function_Object_StackTrace._is(errorHandler)) + return zone.registerBinaryCallback$3$1(errorHandler, type$.dynamic, type$.Object, type$.StackTrace); + if (type$.dynamic_Function_Object._is(errorHandler)) + return zone.registerUnaryCallback$2$1(errorHandler, type$.dynamic, type$.Object); + throw A.wrapException(A.ArgumentError$value(errorHandler, "onError", string$.Error_)); + }, + _microtaskLoop() { + var entry, next; + for (entry = $._nextCallback; entry != null; entry = $._nextCallback) { + $._lastPriorityCallback = null; + next = entry.next; + $._nextCallback = next; + if (next == null) + $._lastCallback = null; + entry.callback.call$0(); + } + }, + _startMicrotaskLoop() { + $._isInCallbackLoop = true; + try { + A._microtaskLoop(); + } finally { + $._lastPriorityCallback = null; + $._isInCallbackLoop = false; + if ($._nextCallback != null) + $.$get$_AsyncRun__scheduleImmediateClosure().call$1(A.async___startMicrotaskLoop$closure()); + } + }, + _scheduleAsyncCallback(callback) { + var newEntry = new A._AsyncCallbackEntry(callback), + lastCallback = $._lastCallback; + if (lastCallback == null) { + $._nextCallback = $._lastCallback = newEntry; + if (!$._isInCallbackLoop) + $.$get$_AsyncRun__scheduleImmediateClosure().call$1(A.async___startMicrotaskLoop$closure()); + } else + $._lastCallback = lastCallback.next = newEntry; + }, + _schedulePriorityAsyncCallback(callback) { + var entry, lastPriorityCallback, next, + t1 = $._nextCallback; + if (t1 == null) { + A._scheduleAsyncCallback(callback); + $._lastPriorityCallback = $._lastCallback; + return; + } + entry = new A._AsyncCallbackEntry(callback); + lastPriorityCallback = $._lastPriorityCallback; + if (lastPriorityCallback == null) { + entry.next = t1; + $._nextCallback = $._lastPriorityCallback = entry; + } else { + next = lastPriorityCallback.next; + entry.next = next; + $._lastPriorityCallback = lastPriorityCallback.next = entry; + if (next == null) + $._lastCallback = entry; + } + }, + scheduleMicrotask(callback) { + var t1, _null = null, + currentZone = $.Zone__current; + if (B.C__RootZone === currentZone) { + A._rootScheduleMicrotask(_null, _null, B.C__RootZone, callback); + return; + } + if (B.C__RootZone === currentZone.get$_scheduleMicrotask().zone) + t1 = B.C__RootZone.get$errorZone() === currentZone.get$errorZone(); + else + t1 = false; + if (t1) { + A._rootScheduleMicrotask(_null, _null, currentZone, currentZone.registerCallback$1$1(callback, type$.void)); + return; + } + t1 = $.Zone__current; + t1.scheduleMicrotask$1(t1.bindCallbackGuarded$1(callback)); + }, + Stream_Stream$fromFuture(future, $T) { + var _null = null, + t1 = $T._eval$1("_SyncStreamController<0>"), + controller = new A._SyncStreamController(_null, _null, _null, _null, t1); + future.then$1$2$onError(0, new A.Stream_Stream$fromFuture_closure(controller, $T), new A.Stream_Stream$fromFuture_closure0(controller), type$.Null); + return new A._ControllerStream(controller, t1._eval$1("_ControllerStream<1>")); + }, + StreamIterator_StreamIterator(stream) { + return new A._StreamIterator(A.checkNotNullable(stream, "stream", type$.Object)); + }, + StreamController_StreamController(onCancel, onListen, onPause, onResume, sync, $T) { + return sync ? new A._SyncStreamController(onListen, onPause, onResume, onCancel, $T._eval$1("_SyncStreamController<0>")) : new A._AsyncStreamController(onListen, onPause, onResume, onCancel, $T._eval$1("_AsyncStreamController<0>")); + }, + _runGuarded(notificationHandler) { + var e, s, exception; + if (notificationHandler == null) + return; + try { + notificationHandler.call$0(); + } catch (exception) { + e = A.unwrapException(exception); + s = A.getTraceFromException(exception); + $.Zone__current.handleUncaughtError$2(e, s); + } + }, + _ControllerSubscription$(_controller, onData, onError, onDone, cancelOnError, $T) { + var t1 = $.Zone__current, + t2 = cancelOnError ? 1 : 0, + t3 = A._BufferingStreamSubscription__registerDataHandler(t1, onData, $T), + t4 = A._BufferingStreamSubscription__registerErrorHandler(t1, onError), + t5 = onDone == null ? A.async___nullDoneHandler$closure() : onDone; + return new A._ControllerSubscription(_controller, t3, t4, t1.registerCallback$1$1(t5, type$.void), t1, t2, $T._eval$1("_ControllerSubscription<0>")); + }, + _AddStreamState_makeErrorHandler(controller) { + return new A._AddStreamState_makeErrorHandler_closure(controller); + }, + _BufferingStreamSubscription__registerDataHandler(zone, handleData, $T) { + var t1 = handleData == null ? A.async___nullDataHandler$closure() : handleData; + return zone.registerUnaryCallback$2$1(t1, type$.void, $T); + }, + _BufferingStreamSubscription__registerErrorHandler(zone, handleError) { + if (handleError == null) + handleError = A.async___nullErrorHandler$closure(); + if (type$.void_Function_Object_StackTrace._is(handleError)) + return zone.registerBinaryCallback$3$1(handleError, type$.dynamic, type$.Object, type$.StackTrace); + if (type$.void_Function_Object._is(handleError)) + return zone.registerUnaryCallback$2$1(handleError, type$.dynamic, type$.Object); + throw A.wrapException(A.ArgumentError$("handleError callback must take either an Object (the error), or both an Object (the error) and a StackTrace.", null)); + }, + _nullDataHandler(value) { + }, + _nullErrorHandler(error, stackTrace) { + $.Zone__current.handleUncaughtError$2(error, stackTrace); + }, + _nullDoneHandler() { + }, + Timer_Timer(duration, callback) { + var t1 = $.Zone__current; + if (t1 === B.C__RootZone) + return t1.createTimer$2(duration, callback); + return t1.createTimer$2(duration, t1.bindCallbackGuarded$1(callback)); + }, + _rootHandleUncaughtError($self, $parent, zone, error, stackTrace) { + A._rootHandleError(error, stackTrace); + }, + _rootHandleError(error, stackTrace) { + A._schedulePriorityAsyncCallback(new A._rootHandleError_closure(error, stackTrace)); + }, + _rootRun($self, $parent, zone, f) { + var old, + t1 = $.Zone__current; + if (t1 === zone) + return f.call$0(); + $.Zone__current = zone; + old = t1; + try { + t1 = f.call$0(); + return t1; + } finally { + $.Zone__current = old; + } + }, + _rootRunUnary($self, $parent, zone, f, arg) { + var old, + t1 = $.Zone__current; + if (t1 === zone) + return f.call$1(arg); + $.Zone__current = zone; + old = t1; + try { + t1 = f.call$1(arg); + return t1; + } finally { + $.Zone__current = old; + } + }, + _rootRunBinary($self, $parent, zone, f, arg1, arg2) { + var old, + t1 = $.Zone__current; + if (t1 === zone) + return f.call$2(arg1, arg2); + $.Zone__current = zone; + old = t1; + try { + t1 = f.call$2(arg1, arg2); + return t1; + } finally { + $.Zone__current = old; + } + }, + _rootRegisterCallback($self, $parent, zone, f) { + return f; + }, + _rootRegisterUnaryCallback($self, $parent, zone, f) { + return f; + }, + _rootRegisterBinaryCallback($self, $parent, zone, f) { + return f; + }, + _rootErrorCallback($self, $parent, zone, error, stackTrace) { + return null; + }, + _rootScheduleMicrotask($self, $parent, zone, f) { + var t1, t2; + if (B.C__RootZone !== zone) { + t1 = B.C__RootZone.get$errorZone(); + t2 = zone.get$errorZone(); + f = t1 !== t2 ? zone.bindCallbackGuarded$1(f) : zone.bindCallback$1$1(f, type$.void); + } + A._scheduleAsyncCallback(f); + }, + _rootCreateTimer($self, $parent, zone, duration, callback) { + return A.Timer__createTimer(duration, B.C__RootZone !== zone ? zone.bindCallback$1$1(callback, type$.void) : callback); + }, + _rootCreatePeriodicTimer($self, $parent, zone, duration, callback) { + var milliseconds; + if (B.C__RootZone !== zone) + callback = zone.bindUnaryCallback$2$1(callback, type$.void, type$.Timer); + milliseconds = B.JSInt_methods._tdivFast$1(duration._duration, 1000); + return A._TimerImpl$periodic(milliseconds < 0 ? 0 : milliseconds, callback); + }, + _rootPrint($self, $parent, zone, line) { + A.printString(line); + }, + _printToZone(line) { + $.Zone__current.print$1(line); + }, + _rootFork($self, $parent, zone, specification, zoneValues) { + var valueMap, t1, handleUncaughtError; + $.printToZone = A.async___printToZone$closure(); + if (specification == null) + specification = B._ZoneSpecification_ALf; + if (zoneValues == null) + valueMap = zone.get$_async$_map(); + else { + t1 = type$.nullable_Object; + valueMap = A.HashMap_HashMap$from(zoneValues, t1, t1); + } + t1 = new A._CustomZone(zone.get$_run(), zone.get$_runUnary(), zone.get$_runBinary(), zone.get$_registerCallback(), zone.get$_registerUnaryCallback(), zone.get$_registerBinaryCallback(), zone.get$_errorCallback(), zone.get$_scheduleMicrotask(), zone.get$_createTimer(), zone.get$_createPeriodicTimer(), zone.get$_print(), zone.get$_fork(), zone.get$_handleUncaughtError(), zone, valueMap); + handleUncaughtError = specification.handleUncaughtError; + if (handleUncaughtError != null) + t1._handleUncaughtError = new A._ZoneFunction(t1, handleUncaughtError); + return t1; + }, + runZoned(body, zoneValues, $R) { + A.checkNotNullable(body, "body", $R._eval$1("0()")); + return A._runZoned(body, zoneValues, null, $R); + }, + _runZoned(body, zoneValues, specification, $R) { + return $.Zone__current.fork$2$specification$zoneValues(specification, zoneValues).run$1$1(0, body, $R); + }, + _AsyncRun__initializeScheduleImmediate_internalCallback: function _AsyncRun__initializeScheduleImmediate_internalCallback(t0) { + this._box_0 = t0; + }, + _AsyncRun__initializeScheduleImmediate_closure: function _AsyncRun__initializeScheduleImmediate_closure(t0, t1, t2) { + this._box_0 = t0; + this.div = t1; + this.span = t2; + }, + _AsyncRun__scheduleImmediateJsOverride_internalCallback: function _AsyncRun__scheduleImmediateJsOverride_internalCallback(t0) { + this.callback = t0; + }, + _AsyncRun__scheduleImmediateWithSetImmediate_internalCallback: function _AsyncRun__scheduleImmediateWithSetImmediate_internalCallback(t0) { + this.callback = t0; + }, + _TimerImpl: function _TimerImpl(t0) { + this._once = t0; + this._handle = null; + this._tick = 0; + }, + _TimerImpl_internalCallback: function _TimerImpl_internalCallback(t0, t1) { + this.$this = t0; + this.callback = t1; + }, + _TimerImpl$periodic_closure: function _TimerImpl$periodic_closure(t0, t1, t2, t3) { + var _ = this; + _.$this = t0; + _.milliseconds = t1; + _.start = t2; + _.callback = t3; + }, + _AsyncAwaitCompleter: function _AsyncAwaitCompleter(t0, t1) { + this._future = t0; + this.isSync = false; + this.$ti = t1; + }, + _awaitOnObject_closure: function _awaitOnObject_closure(t0) { + this.bodyFunction = t0; + }, + _awaitOnObject_closure0: function _awaitOnObject_closure0(t0) { + this.bodyFunction = t0; + }, + _wrapJsFunctionForAsync_closure: function _wrapJsFunctionForAsync_closure(t0) { + this.$protected = t0; + }, + _SyncStarIterator: function _SyncStarIterator(t0) { + var _ = this; + _._body = t0; + _._suspendedBodies = _._nestedIterator = _._datum = _._async$_current = null; + }, + _SyncStarIterable: function _SyncStarIterable(t0, t1) { + this._outerHelper = t0; + this.$ti = t1; + }, + AsyncError: function AsyncError(t0, t1) { + this.error = t0; + this.stackTrace = t1; + }, + Future_wait_handleError: function Future_wait_handleError(t0, t1, t2, t3, t4, t5) { + var _ = this; + _._box_0 = t0; + _.cleanUp = t1; + _.eagerError = t2; + _._future = t3; + _.error = t4; + _.stackTrace = t5; + }, + Future_wait_closure: function Future_wait_closure(t0, t1, t2, t3, t4, t5, t6, t7) { + var _ = this; + _._box_0 = t0; + _.pos = t1; + _._future = t2; + _.cleanUp = t3; + _.eagerError = t4; + _.error = t5; + _.stackTrace = t6; + _.T = t7; + }, + _Completer: function _Completer() { + }, + _AsyncCompleter: function _AsyncCompleter(t0, t1) { + this.future = t0; + this.$ti = t1; + }, + _SyncCompleter: function _SyncCompleter(t0, t1) { + this.future = t0; + this.$ti = t1; + }, + _FutureListener: function _FutureListener(t0, t1, t2, t3, t4) { + var _ = this; + _._nextListener = null; + _.result = t0; + _.state = t1; + _.callback = t2; + _.errorCallback = t3; + _.$ti = t4; + }, + _Future: function _Future(t0, t1) { + var _ = this; + _._state = 0; + _._zone = t0; + _._resultOrListeners = null; + _.$ti = t1; + }, + _Future__addListener_closure: function _Future__addListener_closure(t0, t1) { + this.$this = t0; + this.listener = t1; + }, + _Future__prependListeners_closure: function _Future__prependListeners_closure(t0, t1) { + this._box_0 = t0; + this.$this = t1; + }, + _Future__chainForeignFuture_closure: function _Future__chainForeignFuture_closure(t0) { + this.$this = t0; + }, + _Future__chainForeignFuture_closure0: function _Future__chainForeignFuture_closure0(t0) { + this.$this = t0; + }, + _Future__chainForeignFuture_closure1: function _Future__chainForeignFuture_closure1(t0, t1, t2) { + this.$this = t0; + this.e = t1; + this.s = t2; + }, + _Future__chainCoreFutureAsync_closure: function _Future__chainCoreFutureAsync_closure(t0, t1) { + this._box_0 = t0; + this.target = t1; + }, + _Future__asyncCompleteWithValue_closure: function _Future__asyncCompleteWithValue_closure(t0, t1) { + this.$this = t0; + this.value = t1; + }, + _Future__asyncCompleteError_closure: function _Future__asyncCompleteError_closure(t0, t1, t2) { + this.$this = t0; + this.error = t1; + this.stackTrace = t2; + }, + _Future__propagateToListeners_handleWhenCompleteCallback: function _Future__propagateToListeners_handleWhenCompleteCallback(t0, t1, t2) { + this._box_0 = t0; + this._box_1 = t1; + this.hasError = t2; + }, + _Future__propagateToListeners_handleWhenCompleteCallback_closure: function _Future__propagateToListeners_handleWhenCompleteCallback_closure(t0) { + this.originalSource = t0; + }, + _Future__propagateToListeners_handleValueCallback: function _Future__propagateToListeners_handleValueCallback(t0, t1) { + this._box_0 = t0; + this.sourceResult = t1; + }, + _Future__propagateToListeners_handleError: function _Future__propagateToListeners_handleError(t0, t1) { + this._box_1 = t0; + this._box_0 = t1; + }, + _AsyncCallbackEntry: function _AsyncCallbackEntry(t0) { + this.callback = t0; + this.next = null; + }, + Stream: function Stream() { + }, + Stream_Stream$fromFuture_closure: function Stream_Stream$fromFuture_closure(t0, t1) { + this.controller = t0; + this.T = t1; + }, + Stream_Stream$fromFuture_closure0: function Stream_Stream$fromFuture_closure0(t0) { + this.controller = t0; + }, + Stream_length_closure: function Stream_length_closure(t0, t1) { + this._box_0 = t0; + this.$this = t1; + }, + Stream_length_closure0: function Stream_length_closure0(t0, t1) { + this._box_0 = t0; + this.future = t1; + }, + _StreamController: function _StreamController() { + }, + _StreamController__subscribe_closure: function _StreamController__subscribe_closure(t0) { + this.$this = t0; + }, + _StreamController__recordCancel_complete: function _StreamController__recordCancel_complete(t0) { + this.$this = t0; + }, + _SyncStreamControllerDispatch: function _SyncStreamControllerDispatch() { + }, + _AsyncStreamControllerDispatch: function _AsyncStreamControllerDispatch() { + }, + _AsyncStreamController: function _AsyncStreamController(t0, t1, t2, t3, t4) { + var _ = this; + _._varData = null; + _._state = 0; + _._doneFuture = null; + _.onListen = t0; + _.onPause = t1; + _.onResume = t2; + _.onCancel = t3; + _.$ti = t4; + }, + _SyncStreamController: function _SyncStreamController(t0, t1, t2, t3, t4) { + var _ = this; + _._varData = null; + _._state = 0; + _._doneFuture = null; + _.onListen = t0; + _.onPause = t1; + _.onResume = t2; + _.onCancel = t3; + _.$ti = t4; + }, + _ControllerStream: function _ControllerStream(t0, t1) { + this._controller = t0; + this.$ti = t1; + }, + _ControllerSubscription: function _ControllerSubscription(t0, t1, t2, t3, t4, t5, t6) { + var _ = this; + _._controller = t0; + _._onData = t1; + _._onError = t2; + _._onDone = t3; + _._zone = t4; + _._state = t5; + _._pending = _._cancelFuture = null; + _.$ti = t6; + }, + _AddStreamState: function _AddStreamState() { + }, + _AddStreamState_makeErrorHandler_closure: function _AddStreamState_makeErrorHandler_closure(t0) { + this.controller = t0; + }, + _AddStreamState_cancel_closure: function _AddStreamState_cancel_closure(t0) { + this.$this = t0; + }, + _StreamControllerAddStreamState: function _StreamControllerAddStreamState(t0, t1, t2) { + this.varData = t0; + this.addStreamFuture = t1; + this.addSubscription = t2; + }, + _BufferingStreamSubscription: function _BufferingStreamSubscription() { + }, + _BufferingStreamSubscription__sendError_sendError: function _BufferingStreamSubscription__sendError_sendError(t0, t1, t2) { + this.$this = t0; + this.error = t1; + this.stackTrace = t2; + }, + _BufferingStreamSubscription__sendDone_sendDone: function _BufferingStreamSubscription__sendDone_sendDone(t0) { + this.$this = t0; + }, + _StreamImpl: function _StreamImpl() { + }, + _DelayedEvent: function _DelayedEvent() { + }, + _DelayedData: function _DelayedData(t0) { + this.value = t0; + this.next = null; + }, + _DelayedError: function _DelayedError(t0, t1) { + this.error = t0; + this.stackTrace = t1; + this.next = null; + }, + _DelayedDone: function _DelayedDone() { + }, + _PendingEvents: function _PendingEvents() { + this._state = 0; + this.lastPendingEvent = this.firstPendingEvent = null; + }, + _PendingEvents_schedule_closure: function _PendingEvents_schedule_closure(t0, t1) { + this.$this = t0; + this.dispatch = t1; + }, + _StreamIterator: function _StreamIterator(t0) { + this._subscription = null; + this._stateData = t0; + this._async$_hasValue = false; + }, + _ForwardingStream: function _ForwardingStream() { + }, + _ForwardingStreamSubscription: function _ForwardingStreamSubscription(t0, t1, t2, t3, t4, t5, t6) { + var _ = this; + _._stream = t0; + _._subscription = null; + _._onData = t1; + _._onError = t2; + _._onDone = t3; + _._zone = t4; + _._state = t5; + _._pending = _._cancelFuture = null; + _.$ti = t6; + }, + _ExpandStream: function _ExpandStream(t0, t1, t2) { + this._expand = t0; + this._async$_source = t1; + this.$ti = t2; + }, + _ZoneFunction: function _ZoneFunction(t0, t1) { + this.zone = t0; + this.$function = t1; + }, + _ZoneSpecification: function _ZoneSpecification(t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12) { + var _ = this; + _.handleUncaughtError = t0; + _.run = t1; + _.runUnary = t2; + _.runBinary = t3; + _.registerCallback = t4; + _.registerUnaryCallback = t5; + _.registerBinaryCallback = t6; + _.errorCallback = t7; + _.scheduleMicrotask = t8; + _.createTimer = t9; + _.createPeriodicTimer = t10; + _.print = t11; + _.fork = t12; + }, + _ZoneDelegate: function _ZoneDelegate(t0) { + this._delegationTarget = t0; + }, + _Zone: function _Zone() { + }, + _CustomZone: function _CustomZone(t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14) { + var _ = this; + _._run = t0; + _._runUnary = t1; + _._runBinary = t2; + _._registerCallback = t3; + _._registerUnaryCallback = t4; + _._registerBinaryCallback = t5; + _._errorCallback = t6; + _._scheduleMicrotask = t7; + _._createTimer = t8; + _._createPeriodicTimer = t9; + _._print = t10; + _._fork = t11; + _._handleUncaughtError = t12; + _._delegateCache = null; + _.parent = t13; + _._async$_map = t14; + }, + _CustomZone_bindCallback_closure: function _CustomZone_bindCallback_closure(t0, t1, t2) { + this.$this = t0; + this.registered = t1; + this.R = t2; + }, + _CustomZone_bindUnaryCallback_closure: function _CustomZone_bindUnaryCallback_closure(t0, t1, t2, t3) { + var _ = this; + _.$this = t0; + _.registered = t1; + _.T = t2; + _.R = t3; + }, + _CustomZone_bindCallbackGuarded_closure: function _CustomZone_bindCallbackGuarded_closure(t0, t1) { + this.$this = t0; + this.registered = t1; + }, + _rootHandleError_closure: function _rootHandleError_closure(t0, t1) { + this.error = t0; + this.stackTrace = t1; + }, + _RootZone: function _RootZone() { + }, + _RootZone_bindCallback_closure: function _RootZone_bindCallback_closure(t0, t1, t2) { + this.$this = t0; + this.f = t1; + this.R = t2; + }, + _RootZone_bindUnaryCallback_closure: function _RootZone_bindUnaryCallback_closure(t0, t1, t2, t3) { + var _ = this; + _.$this = t0; + _.f = t1; + _.T = t2; + _.R = t3; + }, + _RootZone_bindCallbackGuarded_closure: function _RootZone_bindCallbackGuarded_closure(t0, t1) { + this.$this = t0; + this.f = t1; + }, + HashMap_HashMap($K, $V) { + return new A._HashMap($K._eval$1("@<0>")._bind$1($V)._eval$1("_HashMap<1,2>")); + }, + _HashMap__getTableEntry(table, key) { + var entry = table[key]; + return entry === table ? null : entry; + }, + _HashMap__setTableEntry(table, key, value) { + if (value == null) + table[key] = table; + else + table[key] = value; + }, + _HashMap__newHashTable() { + var table = Object.create(null); + A._HashMap__setTableEntry(table, "", table); + delete table[""]; + return table; + }, + LinkedHashMap_LinkedHashMap(equals, hashCode, isValidKey, $K, $V) { + if (isValidKey == null) + if (hashCode == null) { + if (equals == null) + return new A.JsLinkedHashMap($K._eval$1("@<0>")._bind$1($V)._eval$1("JsLinkedHashMap<1,2>")); + hashCode = A.collection___defaultHashCode$closure(); + } else { + if (A.core__identityHashCode$closure() === hashCode && A.core__identical$closure() === equals) + return new A.JsIdentityLinkedHashMap($K._eval$1("@<0>")._bind$1($V)._eval$1("JsIdentityLinkedHashMap<1,2>")); + if (equals == null) + equals = A.collection___defaultEquals$closure(); + } + else { + if (hashCode == null) + hashCode = A.collection___defaultHashCode$closure(); + if (equals == null) + equals = A.collection___defaultEquals$closure(); + } + return A._LinkedCustomHashMap$(equals, hashCode, isValidKey, $K, $V); + }, + LinkedHashMap_LinkedHashMap$_literal(keyValuePairs, $K, $V) { + return A.fillLiteralMap(keyValuePairs, new A.JsLinkedHashMap($K._eval$1("@<0>")._bind$1($V)._eval$1("JsLinkedHashMap<1,2>"))); + }, + LinkedHashMap_LinkedHashMap$_empty($K, $V) { + return new A.JsLinkedHashMap($K._eval$1("@<0>")._bind$1($V)._eval$1("JsLinkedHashMap<1,2>")); + }, + _LinkedCustomHashMap$(_equals, _hashCode, validKey, $K, $V) { + var t1 = validKey != null ? validKey : new A._LinkedCustomHashMap_closure($K); + return new A._LinkedCustomHashMap(_equals, _hashCode, t1, $K._eval$1("@<0>")._bind$1($V)._eval$1("_LinkedCustomHashMap<1,2>")); + }, + LinkedHashSet_LinkedHashSet($E) { + return new A._LinkedHashSet($E._eval$1("_LinkedHashSet<0>")); + }, + LinkedHashSet_LinkedHashSet$_empty($E) { + return new A._LinkedHashSet($E._eval$1("_LinkedHashSet<0>")); + }, + LinkedHashSet_LinkedHashSet$_literal(values, $E) { + return A.fillLiteralSet(values, new A._LinkedHashSet($E._eval$1("_LinkedHashSet<0>"))); + }, + _LinkedHashSet__newHashTable() { + var table = Object.create(null); + table[""] = table; + delete table[""]; + return table; + }, + _LinkedHashSetIterator$(_set, _modifications, $E) { + var t1 = new A._LinkedHashSetIterator(_set, _modifications, $E._eval$1("_LinkedHashSetIterator<0>")); + t1._collection$_cell = _set._collection$_first; + return t1; + }, + UnmodifiableListView$(source, $E) { + return new A.UnmodifiableListView(source, $E._eval$1("UnmodifiableListView<0>")); + }, + _defaultEquals(a, b) { + return J.$eq$(a, b); + }, + _defaultHashCode(a) { + return J.get$hashCode$(a); + }, + HashMap_HashMap$from(other, $K, $V) { + var result = A.HashMap_HashMap($K, $V); + other.forEach$1(0, new A.HashMap_HashMap$from_closure(result, $K, $V)); + return result; + }, + LinkedHashMap_LinkedHashMap$from(other, $K, $V) { + var result = A.LinkedHashMap_LinkedHashMap(null, null, null, $K, $V); + other.forEach$1(0, new A.LinkedHashMap_LinkedHashMap$from_closure(result, $K, $V)); + return result; + }, + LinkedHashMap_LinkedHashMap$of(other, $K, $V) { + var t1 = A.LinkedHashMap_LinkedHashMap(null, null, null, $K, $V); + t1.addAll$1(0, other); + return t1; + }, + LinkedHashSet_LinkedHashSet$from(elements, $E) { + var t1, _i, + result = A.LinkedHashSet_LinkedHashSet($E); + for (t1 = elements.length, _i = 0; _i < elements.length; elements.length === t1 || (0, A.throwConcurrentModificationError)(elements), ++_i) + result.add$1(0, $E._as(elements[_i])); + return result; + }, + LinkedHashSet_LinkedHashSet$of(elements, $E) { + var t1 = A.LinkedHashSet_LinkedHashSet($E); + t1.addAll$1(0, elements); + return t1; + }, + ListBase__compareAny(a, b) { + var t1 = type$.Comparable_dynamic; + return J.compareTo$1$ns(t1._as(a), t1._as(b)); + }, + MapBase_mapToString(m) { + var result, t1 = {}; + if (A.isToStringVisiting(m)) + return "{...}"; + result = new A.StringBuffer(""); + try { + $.toStringVisiting.push(m); + result._contents += "{"; + t1.first = true; + m.forEach$1(0, new A.MapBase_mapToString_closure(t1, result)); + result._contents += "}"; + } finally { + $.toStringVisiting.pop(); + } + t1 = result._contents; + return t1.charCodeAt(0) == 0 ? t1 : t1; + }, + MapBase__fillMapWithIterables(map, keys, values) { + var keyIterator = keys.get$iterator(keys), + valueIterator = values.get$iterator(values), + hasNextKey = keyIterator.moveNext$0(), + hasNextValue = valueIterator.moveNext$0(); + while (true) { + if (!(hasNextKey && hasNextValue)) + break; + map.$indexSet(0, keyIterator.get$current(keyIterator), valueIterator.get$current(valueIterator)); + hasNextKey = keyIterator.moveNext$0(); + hasNextValue = valueIterator.moveNext$0(); + } + if (hasNextKey || hasNextValue) + throw A.wrapException(A.ArgumentError$("Iterables do not have same length.", null)); + }, + ListQueue$($E) { + return new A.ListQueue(A.List_List$filled(A.ListQueue__calculateCapacity(null), null, false, $E._eval$1("0?")), $E._eval$1("ListQueue<0>")); + }, + ListQueue__calculateCapacity(initialCapacity) { + return 8; + }, + ListQueue__nextPowerOf2(number) { + var nextNumber; + number = (number << 1 >>> 0) - 1; + for (; true; number = nextNumber) { + nextNumber = (number & number - 1) >>> 0; + if (nextNumber === 0) + return number; + } + }, + _ListQueueIterator$(queue, $E) { + return new A._ListQueueIterator(queue, queue._tail, queue._modificationCount, queue._head, $E._eval$1("_ListQueueIterator<0>")); + }, + _UnmodifiableSetMixin__throwUnmodifiable() { + throw A.wrapException(A.UnsupportedError$("Cannot change an unmodifiable set")); + }, + _HashMap: function _HashMap(t0) { + var _ = this; + _._collection$_length = 0; + _._collection$_keys = _._collection$_rest = _._collection$_nums = _._collection$_strings = null; + _.$ti = t0; + }, + _HashMap_values_closure: function _HashMap_values_closure(t0) { + this.$this = t0; + }, + _HashMap_addAll_closure: function _HashMap_addAll_closure(t0) { + this.$this = t0; + }, + _IdentityHashMap: function _IdentityHashMap(t0) { + var _ = this; + _._collection$_length = 0; + _._collection$_keys = _._collection$_rest = _._collection$_nums = _._collection$_strings = null; + _.$ti = t0; + }, + _HashMapKeyIterable: function _HashMapKeyIterable(t0, t1) { + this._map = t0; + this.$ti = t1; + }, + _HashMapKeyIterator: function _HashMapKeyIterator(t0, t1, t2) { + var _ = this; + _._map = t0; + _._collection$_keys = t1; + _._offset = 0; + _._collection$_current = null; + _.$ti = t2; + }, + _LinkedCustomHashMap: function _LinkedCustomHashMap(t0, t1, t2, t3) { + var _ = this; + _._equals = t0; + _._hashCode = t1; + _._validKey = t2; + _.__js_helper$_length = 0; + _._last = _._first = _.__js_helper$_rest = _._nums = _._strings = null; + _._modifications = 0; + _.$ti = t3; + }, + _LinkedCustomHashMap_closure: function _LinkedCustomHashMap_closure(t0) { + this.K = t0; + }, + _LinkedHashSet: function _LinkedHashSet(t0) { + var _ = this; + _._collection$_length = 0; + _._collection$_last = _._collection$_first = _._collection$_rest = _._collection$_nums = _._collection$_strings = null; + _._collection$_modifications = 0; + _.$ti = t0; + }, + _LinkedIdentityHashSet: function _LinkedIdentityHashSet(t0) { + var _ = this; + _._collection$_length = 0; + _._collection$_last = _._collection$_first = _._collection$_rest = _._collection$_nums = _._collection$_strings = null; + _._collection$_modifications = 0; + _.$ti = t0; + }, + _LinkedHashSetCell: function _LinkedHashSetCell(t0) { + this._element = t0; + this._collection$_previous = this._collection$_next = null; + }, + _LinkedHashSetIterator: function _LinkedHashSetIterator(t0, t1, t2) { + var _ = this; + _._set = t0; + _._collection$_modifications = t1; + _._collection$_current = _._collection$_cell = null; + _.$ti = t2; + }, + UnmodifiableListView: function UnmodifiableListView(t0, t1) { + this._collection$_source = t0; + this.$ti = t1; + }, + HashMap_HashMap$from_closure: function HashMap_HashMap$from_closure(t0, t1, t2) { + this.result = t0; + this.K = t1; + this.V = t2; + }, + LinkedHashMap_LinkedHashMap$from_closure: function LinkedHashMap_LinkedHashMap$from_closure(t0, t1, t2) { + this.result = t0; + this.K = t1; + this.V = t2; + }, + ListBase: function ListBase() { + }, + MapBase: function MapBase() { + }, + MapBase_addAll_closure: function MapBase_addAll_closure(t0) { + this.$this = t0; + }, + MapBase_entries_closure: function MapBase_entries_closure(t0) { + this.$this = t0; + }, + MapBase_mapToString_closure: function MapBase_mapToString_closure(t0, t1) { + this._box_0 = t0; + this.result = t1; + }, + UnmodifiableMapBase: function UnmodifiableMapBase() { + }, + _MapBaseValueIterable: function _MapBaseValueIterable(t0, t1) { + this._map = t0; + this.$ti = t1; + }, + _MapBaseValueIterator: function _MapBaseValueIterator(t0, t1, t2) { + var _ = this; + _._collection$_keys = t0; + _._map = t1; + _._collection$_current = null; + _.$ti = t2; + }, + _UnmodifiableMapMixin: function _UnmodifiableMapMixin() { + }, + MapView: function MapView() { + }, + UnmodifiableMapView: function UnmodifiableMapView(t0, t1) { + this._map = t0; + this.$ti = t1; + }, + ListQueue: function ListQueue(t0, t1) { + var _ = this; + _._table = t0; + _._modificationCount = _._tail = _._head = 0; + _.$ti = t1; + }, + _ListQueueIterator: function _ListQueueIterator(t0, t1, t2, t3, t4) { + var _ = this; + _._queue = t0; + _._collection$_end = t1; + _._modificationCount = t2; + _._collection$_position = t3; + _._collection$_current = null; + _.$ti = t4; + }, + SetBase: function SetBase() { + }, + _SetBase: function _SetBase() { + }, + _UnmodifiableSetMixin: function _UnmodifiableSetMixin() { + }, + UnmodifiableSetView: function UnmodifiableSetView(t0, t1) { + this._collection$_source = t0; + this.$ti = t1; + }, + _UnmodifiableMapView_MapView__UnmodifiableMapMixin: function _UnmodifiableMapView_MapView__UnmodifiableMapMixin() { + }, + _UnmodifiableSetView_SetBase__UnmodifiableSetMixin: function _UnmodifiableSetView_SetBase__UnmodifiableSetMixin() { + }, + _parseJson(source, reviver) { + var e, exception, t1, parsed = null; + try { + parsed = JSON.parse(source); + } catch (exception) { + e = A.unwrapException(exception); + t1 = A.FormatException$(String(e), null, null); + throw A.wrapException(t1); + } + t1 = A._convertJsonToDartLazy(parsed); + return t1; + }, + _convertJsonToDartLazy(object) { + var i; + if (object == null) + return null; + if (typeof object != "object") + return object; + if (Object.getPrototypeOf(object) !== Array.prototype) + return new A._JsonMap(object, Object.create(null)); + for (i = 0; i < object.length; ++i) + object[i] = A._convertJsonToDartLazy(object[i]); + return object; + }, + _Utf8Decoder__makeNativeUint8List(codeUnits, start, end) { + var bytes, t1, i, b, + $length = end - start; + if ($length <= 4096) + bytes = $.$get$_Utf8Decoder__reusableBuffer(); + else + bytes = new Uint8Array($length); + for (t1 = J.getInterceptor$asx(codeUnits), i = 0; i < $length; ++i) { + b = t1.$index(codeUnits, start + i); + if ((b & 255) !== b) + b = 255; + bytes[i] = b; + } + return bytes; + }, + _Utf8Decoder__convertInterceptedUint8List(allowMalformed, codeUnits, start, end) { + var decoder = allowMalformed ? $.$get$_Utf8Decoder__decoderNonfatal() : $.$get$_Utf8Decoder__decoder(); + if (decoder == null) + return null; + if (0 === start && end === codeUnits.length) + return A._Utf8Decoder__useTextDecoder(decoder, codeUnits); + return A._Utf8Decoder__useTextDecoder(decoder, codeUnits.subarray(start, end)); + }, + _Utf8Decoder__useTextDecoder(decoder, codeUnits) { + var t1, exception; + try { + t1 = decoder.decode(codeUnits); + return t1; + } catch (exception) { + } + return null; + }, + Base64Codec__checkPadding(source, sourceIndex, sourceEnd, firstPadding, paddingCount, $length) { + if (B.JSInt_methods.$mod($length, 4) !== 0) + throw A.wrapException(A.FormatException$("Invalid base64 padding, padded length must be multiple of four, is " + $length, source, sourceEnd)); + if (firstPadding + paddingCount !== $length) + throw A.wrapException(A.FormatException$("Invalid base64 padding, '=' not at the end", source, sourceIndex)); + if (paddingCount > 2) + throw A.wrapException(A.FormatException$("Invalid base64 padding, more than two '=' characters", source, sourceIndex)); + }, + _Base64Encoder_encodeChunk(alphabet, bytes, start, end, isLast, output, outputIndex, state) { + var t1, i, byteOr, byte, outputIndex0, outputIndex1, + bits = state >>> 2, + expectedChars = 3 - (state & 3); + for (t1 = J.getInterceptor$asx(bytes), i = start, byteOr = 0; i < end; ++i) { + byte = t1.$index(bytes, i); + byteOr = (byteOr | byte) >>> 0; + bits = (bits << 8 | byte) & 16777215; + --expectedChars; + if (expectedChars === 0) { + outputIndex0 = outputIndex + 1; + output[outputIndex] = alphabet.charCodeAt(bits >>> 18 & 63); + outputIndex = outputIndex0 + 1; + output[outputIndex0] = alphabet.charCodeAt(bits >>> 12 & 63); + outputIndex0 = outputIndex + 1; + output[outputIndex] = alphabet.charCodeAt(bits >>> 6 & 63); + outputIndex = outputIndex0 + 1; + output[outputIndex0] = alphabet.charCodeAt(bits & 63); + bits = 0; + expectedChars = 3; + } + } + if (byteOr >= 0 && byteOr <= 255) { + if (isLast && expectedChars < 3) { + outputIndex0 = outputIndex + 1; + outputIndex1 = outputIndex0 + 1; + if (3 - expectedChars === 1) { + output[outputIndex] = alphabet.charCodeAt(bits >>> 2 & 63); + output[outputIndex0] = alphabet.charCodeAt(bits << 4 & 63); + output[outputIndex1] = 61; + output[outputIndex1 + 1] = 61; + } else { + output[outputIndex] = alphabet.charCodeAt(bits >>> 10 & 63); + output[outputIndex0] = alphabet.charCodeAt(bits >>> 4 & 63); + output[outputIndex1] = alphabet.charCodeAt(bits << 2 & 63); + output[outputIndex1 + 1] = 61; + } + return 0; + } + return (bits << 2 | 3 - expectedChars) >>> 0; + } + for (i = start; i < end;) { + byte = t1.$index(bytes, i); + if (byte < 0 || byte > 255) + break; + ++i; + } + throw A.wrapException(A.ArgumentError$value(bytes, "Not a byte value at index " + i + ": 0x" + J.toRadixString$1$n(t1.$index(bytes, i), 16), null)); + }, + JsonUnsupportedObjectError$(unsupportedObject, cause, partialResult) { + return new A.JsonUnsupportedObjectError(unsupportedObject, cause); + }, + _defaultToEncodable(object) { + return object.toJson$0(); + }, + _JsonStringStringifier$(_sink, _toEncodable) { + return new A._JsonStringStringifier(_sink, [], A.convert___defaultToEncodable$closure()); + }, + _JsonStringStringifier_stringify(object, toEncodable, indent) { + var t1, + output = new A.StringBuffer(""), + stringifier = A._JsonStringStringifier$(output, toEncodable); + stringifier.writeObject$1(object); + t1 = output._contents; + return t1.charCodeAt(0) == 0 ? t1 : t1; + }, + _Utf8Decoder_errorDescription(state) { + switch (state) { + case 65: + return "Missing extension byte"; + case 67: + return "Unexpected extension byte"; + case 69: + return "Invalid UTF-8 byte"; + case 71: + return "Overlong encoding"; + case 73: + return "Out of unicode range"; + case 75: + return "Encoded surrogate"; + case 77: + return "Unfinished UTF-8 octet sequence"; + default: + return ""; + } + }, + _JsonMap: function _JsonMap(t0, t1) { + this._original = t0; + this._processed = t1; + this._data = null; + }, + _JsonMap_values_closure: function _JsonMap_values_closure(t0) { + this.$this = t0; + }, + _JsonMap_addAll_closure: function _JsonMap_addAll_closure(t0) { + this.$this = t0; + }, + _JsonMapKeyIterable: function _JsonMapKeyIterable(t0) { + this._convert$_parent = t0; + }, + _Utf8Decoder__decoder_closure: function _Utf8Decoder__decoder_closure() { + }, + _Utf8Decoder__decoderNonfatal_closure: function _Utf8Decoder__decoderNonfatal_closure() { + }, + AsciiCodec: function AsciiCodec() { + }, + _UnicodeSubsetEncoder: function _UnicodeSubsetEncoder() { + }, + AsciiEncoder: function AsciiEncoder(t0) { + this._subsetMask = t0; + }, + Base64Codec: function Base64Codec() { + }, + Base64Encoder: function Base64Encoder() { + }, + _Base64Encoder: function _Base64Encoder(t0) { + this._convert$_state = 0; + this._alphabet = t0; + }, + _Base64EncoderSink: function _Base64EncoderSink() { + }, + _Utf8Base64EncoderSink: function _Utf8Base64EncoderSink(t0, t1) { + this._sink = t0; + this._encoder = t1; + }, + ByteConversionSink: function ByteConversionSink() { + }, + Codec: function Codec() { + }, + Converter: function Converter() { + }, + Encoding: function Encoding() { + }, + JsonUnsupportedObjectError: function JsonUnsupportedObjectError(t0, t1) { + this.unsupportedObject = t0; + this.cause = t1; + }, + JsonCyclicError: function JsonCyclicError(t0, t1) { + this.unsupportedObject = t0; + this.cause = t1; + }, + JsonCodec: function JsonCodec() { + }, + JsonEncoder: function JsonEncoder(t0) { + this._toEncodable = t0; + }, + JsonDecoder: function JsonDecoder(t0) { + this._reviver = t0; + }, + _JsonStringifier: function _JsonStringifier() { + }, + _JsonStringifier_writeMap_closure: function _JsonStringifier_writeMap_closure(t0, t1) { + this._box_0 = t0; + this.keyValueList = t1; + }, + _JsonStringStringifier: function _JsonStringStringifier(t0, t1, t2) { + this._sink = t0; + this._seen = t1; + this._toEncodable = t2; + }, + StringConversionSink: function StringConversionSink() { + }, + _StringSinkConversionSink: function _StringSinkConversionSink(t0) { + this._stringSink = t0; + }, + _StringCallbackSink: function _StringCallbackSink(t0, t1) { + this._convert$_callback = t0; + this._stringSink = t1; + }, + _Utf8StringSinkAdapter: function _Utf8StringSinkAdapter(t0, t1, t2) { + this._decoder = t0; + this._sink = t1; + this._stringSink = t2; + }, + Utf8Codec: function Utf8Codec() { + }, + Utf8Encoder: function Utf8Encoder() { + }, + _Utf8Encoder: function _Utf8Encoder(t0) { + this._bufferIndex = 0; + this._buffer = t0; + }, + Utf8Decoder: function Utf8Decoder(t0) { + this._allowMalformed = t0; + }, + _Utf8Decoder: function _Utf8Decoder(t0) { + this.allowMalformed = t0; + this._convert$_state = 16; + this._charOrIndex = 0; + }, + identityHashCode(object) { + return A.objectHashCode(object); + }, + Function_apply($function, positionalArguments) { + return A.Primitives_applyFunction($function, positionalArguments, null); + }, + Expando$() { + return new A.Expando(new WeakMap()); + }, + Expando__checkType(object) { + if (A._isBool(object) || typeof object == "number" || typeof object == "string" || object instanceof A._Record) + A.Expando__badExpandoKey(object); + }, + Expando__badExpandoKey(object) { + throw A.wrapException(A.ArgumentError$value(object, "object", "Expandos are not allowed on strings, numbers, bools, records or null")); + }, + int_parse(source, radix) { + var value = A.Primitives_parseInt(source, radix); + if (value != null) + return value; + throw A.wrapException(A.FormatException$(source, null, null)); + }, + double_parse(source) { + var value = A.Primitives_parseDouble(source); + if (value != null) + return value; + throw A.wrapException(A.FormatException$("Invalid double", source, null)); + }, + Error__throw(error, stackTrace) { + error = A.wrapException(error); + error.stack = stackTrace.toString$0(0); + throw error; + throw A.wrapException("unreachable"); + }, + List_List$filled($length, fill, growable, $E) { + var i, + result = growable ? J.JSArray_JSArray$growable($length, $E) : J.JSArray_JSArray$fixed($length, $E); + if ($length !== 0 && fill != null) + for (i = 0; i < result.length; ++i) + result[i] = fill; + return result; + }, + List_List$from(elements, growable, $E) { + var t1, + list = A._setArrayType([], $E._eval$1("JSArray<0>")); + for (t1 = J.get$iterator$ax(elements); t1.moveNext$0();) + list.push(t1.get$current(t1)); + if (growable) + return list; + return J.JSArray_markFixedList(list); + }, + List_List$of(elements, growable, $E) { + var t1; + if (growable) + return A.List_List$_of(elements, $E); + t1 = J.JSArray_markFixedList(A.List_List$_of(elements, $E)); + return t1; + }, + List_List$_of(elements, $E) { + var list, t1; + if (Array.isArray(elements)) + return A._setArrayType(elements.slice(0), $E._eval$1("JSArray<0>")); + list = A._setArrayType([], $E._eval$1("JSArray<0>")); + for (t1 = J.get$iterator$ax(elements); t1.moveNext$0();) + list.push(t1.get$current(t1)); + return list; + }, + List_List$unmodifiable(elements, $E) { + return J.JSArray_markUnmodifiableList(A.List_List$from(elements, false, $E)); + }, + String_String$fromCharCodes(charCodes, start, end) { + var t1, t2, maxLength, array, len; + A.RangeError_checkNotNegative(start, "start"); + t1 = end == null; + t2 = !t1; + if (t2) { + maxLength = end - start; + if (maxLength < 0) + throw A.wrapException(A.RangeError$range(end, start, null, "end", null)); + if (maxLength === 0) + return ""; + } + if (Array.isArray(charCodes)) { + array = charCodes; + len = array.length; + if (t1) + end = len; + return A.Primitives_stringFromCharCodes(start > 0 || end < len ? array.slice(start, end) : array); + } + if (type$.NativeUint8List._is(charCodes)) + return A.String__stringFromUint8List(charCodes, start, end); + if (t2) + charCodes = J.take$1$ax(charCodes, end); + if (start > 0) + charCodes = J.skip$1$ax(charCodes, start); + return A.Primitives_stringFromCharCodes(A.List_List$of(charCodes, true, type$.int)); + }, + String_String$fromCharCode(charCode) { + return A.Primitives_stringFromCharCode(charCode); + }, + String__stringFromUint8List(charCodes, start, endOrNull) { + var len = charCodes.length; + if (start >= len) + return ""; + return A.Primitives_stringFromNativeUint8List(charCodes, start, endOrNull == null || endOrNull > len ? len : endOrNull); + }, + RegExp_RegExp(source, multiLine) { + return new A.JSSyntaxRegExp(source, A.JSSyntaxRegExp_makeNative(source, multiLine, true, false, false, false)); + }, + identical(a, b) { + return a == null ? b == null : a === b; + }, + StringBuffer__writeAll(string, objects, separator) { + var iterator = J.get$iterator$ax(objects); + if (!iterator.moveNext$0()) + return string; + if (separator.length === 0) { + do + string += A.S(iterator.get$current(iterator)); + while (iterator.moveNext$0()); + } else { + string += A.S(iterator.get$current(iterator)); + for (; iterator.moveNext$0();) + string = string + separator + A.S(iterator.get$current(iterator)); + } + return string; + }, + NoSuchMethodError_NoSuchMethodError$withInvocation(receiver, invocation) { + return new A.NoSuchMethodError(receiver, invocation.get$memberName(), invocation.get$positionalArguments(), invocation.get$namedArguments()); + }, + Uri_base() { + var cachedUri, uri, + current = A.Primitives_currentUri(); + if (current == null) + throw A.wrapException(A.UnsupportedError$("'Uri.base' is not supported")); + cachedUri = $.Uri__cachedBaseUri; + if (cachedUri != null && current === $.Uri__cachedBaseString) + return cachedUri; + uri = A.Uri_parse(current); + $.Uri__cachedBaseUri = uri; + $.Uri__cachedBaseString = current; + return uri; + }, + _Uri__uriEncode(canonicalTable, text, encoding, spaceToPlus) { + var t1, bytes, i, t2, byte, + _s16_ = "0123456789ABCDEF"; + if (encoding === B.C_Utf8Codec) { + t1 = $.$get$_Uri__needsNoEncoding(); + t1 = t1._nativeRegExp.test(text); + } else + t1 = false; + if (t1) + return text; + bytes = B.C_Utf8Encoder.convert$1(text); + for (t1 = bytes.length, i = 0, t2 = ""; i < t1; ++i) { + byte = bytes[i]; + if (byte < 128 && (canonicalTable[byte >>> 4] & 1 << (byte & 15)) !== 0) + t2 += A.Primitives_stringFromCharCode(byte); + else + t2 = spaceToPlus && byte === 32 ? t2 + "+" : t2 + "%" + _s16_[byte >>> 4 & 15] + _s16_[byte & 15]; + } + return t2.charCodeAt(0) == 0 ? t2 : t2; + }, + StackTrace_current() { + return A.getTraceFromException(new Error()); + }, + DateTime__fourDigits(n) { + var absN = Math.abs(n), + sign = n < 0 ? "-" : ""; + if (absN >= 1000) + return "" + n; + if (absN >= 100) + return sign + "0" + absN; + if (absN >= 10) + return sign + "00" + absN; + return sign + "000" + absN; + }, + DateTime__threeDigits(n) { + if (n >= 100) + return "" + n; + if (n >= 10) + return "0" + n; + return "00" + n; + }, + DateTime__twoDigits(n) { + if (n >= 10) + return "" + n; + return "0" + n; + }, + Duration$(milliseconds) { + return new A.Duration(1000 * milliseconds); + }, + Error_safeToString(object) { + if (typeof object == "number" || A._isBool(object) || object == null) + return J.toString$0$(object); + if (typeof object == "string") + return JSON.stringify(object); + return A.Primitives_safeToString(object); + }, + Error_throwWithStackTrace(error, stackTrace) { + A.checkNotNullable(error, "error", type$.Object); + A.checkNotNullable(stackTrace, "stackTrace", type$.StackTrace); + A.Error__throw(error, stackTrace); + }, + AssertionError$(message) { + return new A.AssertionError(message); + }, + ArgumentError$(message, $name) { + return new A.ArgumentError(false, null, $name, message); + }, + ArgumentError$value(value, $name, message) { + return new A.ArgumentError(true, value, $name, message); + }, + ArgumentError_checkNotNull(argument, $name) { + return argument; + }, + RangeError$(message) { + var _null = null; + return new A.RangeError(_null, _null, false, _null, _null, message); + }, + RangeError$value(value, $name, message) { + return new A.RangeError(null, null, true, value, $name, message == null ? "Value not in range" : message); + }, + RangeError$range(invalidValue, minValue, maxValue, $name, message) { + return new A.RangeError(minValue, maxValue, true, invalidValue, $name, message == null ? "Invalid value" : message); + }, + RangeError_checkValueInInterval(value, minValue, maxValue, $name) { + if (value < minValue || value > maxValue) + throw A.wrapException(A.RangeError$range(value, minValue, maxValue, $name, null)); + return value; + }, + RangeError_checkValidRange(start, end, $length) { + if (0 > start || start > $length) + throw A.wrapException(A.RangeError$range(start, 0, $length, "start", null)); + if (end != null) { + if (start > end || end > $length) + throw A.wrapException(A.RangeError$range(end, start, $length, "end", null)); + return end; + } + return $length; + }, + RangeError_checkNotNegative(value, $name) { + if (value < 0) + throw A.wrapException(A.RangeError$range(value, 0, null, $name, null)); + return value; + }, + IndexError$withLength(invalidValue, $length, indexable, message, $name) { + return new A.IndexError($length, true, invalidValue, $name, "Index out of range"); + }, + IndexError_check(index, $length, indexable, message, $name) { + if (0 > index || index >= $length) + throw A.wrapException(A.IndexError$withLength(index, $length, indexable, message, $name == null ? "index" : $name)); + return index; + }, + UnsupportedError$(message) { + return new A.UnsupportedError(message); + }, + UnimplementedError$(message) { + return new A.UnimplementedError(message); + }, + StateError$(message) { + return new A.StateError(message); + }, + ConcurrentModificationError$(modifiedObject) { + return new A.ConcurrentModificationError(modifiedObject); + }, + FormatException$(message, source, offset) { + return new A.FormatException(message, source, offset); + }, + Iterable_Iterable$generate(count, generator, $E) { + if (count <= 0) + return new A.EmptyIterable($E._eval$1("EmptyIterable<0>")); + return new A._GeneratorIterable(count, generator, $E._eval$1("_GeneratorIterable<0>")); + }, + Iterable_iterableToShortString(iterable, leftDelimiter, rightDelimiter) { + var parts, t1; + if (A.isToStringVisiting(iterable)) { + if (leftDelimiter === "(" && rightDelimiter === ")") + return "(...)"; + return leftDelimiter + "..." + rightDelimiter; + } + parts = A._setArrayType([], type$.JSArray_String); + $.toStringVisiting.push(iterable); + try { + A._iterablePartsToStrings(iterable, parts); + } finally { + $.toStringVisiting.pop(); + } + t1 = A.StringBuffer__writeAll(leftDelimiter, parts, ", ") + rightDelimiter; + return t1.charCodeAt(0) == 0 ? t1 : t1; + }, + Iterable_iterableToFullString(iterable, leftDelimiter, rightDelimiter) { + var buffer, t1; + if (A.isToStringVisiting(iterable)) + return leftDelimiter + "..." + rightDelimiter; + buffer = new A.StringBuffer(leftDelimiter); + $.toStringVisiting.push(iterable); + try { + t1 = buffer; + t1._contents = A.StringBuffer__writeAll(t1._contents, iterable, ", "); + } finally { + $.toStringVisiting.pop(); + } + buffer._contents += rightDelimiter; + t1 = buffer._contents; + return t1.charCodeAt(0) == 0 ? t1 : t1; + }, + _iterablePartsToStrings(iterable, parts) { + var next, ultimateString, penultimateString, penultimate, ultimate, ultimate0, elision, + it = iterable.get$iterator(iterable), + $length = 0, count = 0; + while (true) { + if (!($length < 80 || count < 3)) + break; + if (!it.moveNext$0()) + return; + next = A.S(it.get$current(it)); + parts.push(next); + $length += next.length + 2; + ++count; + } + if (!it.moveNext$0()) { + if (count <= 5) + return; + ultimateString = parts.pop(); + penultimateString = parts.pop(); + } else { + penultimate = it.get$current(it); + ++count; + if (!it.moveNext$0()) { + if (count <= 4) { + parts.push(A.S(penultimate)); + return; + } + ultimateString = A.S(penultimate); + penultimateString = parts.pop(); + $length += ultimateString.length + 2; + } else { + ultimate = it.get$current(it); + ++count; + for (; it.moveNext$0(); penultimate = ultimate, ultimate = ultimate0) { + ultimate0 = it.get$current(it); + ++count; + if (count > 100) { + while (true) { + if (!($length > 75 && count > 3)) + break; + $length -= parts.pop().length + 2; + --count; + } + parts.push("..."); + return; + } + } + penultimateString = A.S(penultimate); + ultimateString = A.S(ultimate); + $length += ultimateString.length + penultimateString.length + 4; + } + } + if (count > parts.length + 2) { + $length += 5; + elision = "..."; + } else + elision = null; + while (true) { + if (!($length > 80 && parts.length > 3)) + break; + $length -= parts.pop().length + 2; + if (elision == null) { + $length += 5; + elision = "..."; + } + } + if (elision != null) + parts.push(elision); + parts.push(penultimateString); + parts.push(ultimateString); + }, + Map_castFrom(source, $K, $V, K2, V2) { + return new A.CastMap(source, $K._eval$1("@<0>")._bind$1($V)._bind$1(K2)._bind$1(V2)._eval$1("CastMap<1,2,3,4>")); + }, + Object_hash(object1, object2, object3, object4) { + var t1; + if (B.C_SentinelValue === object3) { + t1 = J.get$hashCode$(object1); + object2 = J.get$hashCode$(object2); + return A.SystemHash_finish(A.SystemHash_combine(A.SystemHash_combine($.$get$_hashSeed(), t1), object2)); + } + if (B.C_SentinelValue === object4) { + t1 = J.get$hashCode$(object1); + object2 = J.get$hashCode$(object2); + object3 = J.get$hashCode$(object3); + return A.SystemHash_finish(A.SystemHash_combine(A.SystemHash_combine(A.SystemHash_combine($.$get$_hashSeed(), t1), object2), object3)); + } + t1 = J.get$hashCode$(object1); + object2 = J.get$hashCode$(object2); + object3 = J.get$hashCode$(object3); + object4 = J.get$hashCode$(object4); + object4 = A.SystemHash_finish(A.SystemHash_combine(A.SystemHash_combine(A.SystemHash_combine(A.SystemHash_combine($.$get$_hashSeed(), t1), object2), object3), object4)); + return object4; + }, + Object_hashAll(objects) { + var t1, _i, + hash = $.$get$_hashSeed(); + for (t1 = objects.length, _i = 0; _i < objects.length; objects.length === t1 || (0, A.throwConcurrentModificationError)(objects), ++_i) + hash = A.SystemHash_combine(hash, J.get$hashCode$(objects[_i])); + return A.SystemHash_finish(hash); + }, + print(object) { + var line = A.S(object), + toZone = $.printToZone; + if (toZone == null) + A.printString(line); + else + toZone.call$1(line); + }, + Set_Set$unmodifiable(elements, $E) { + return new A.UnmodifiableSetView(A.LinkedHashSet_LinkedHashSet$of(elements, $E), $E._eval$1("UnmodifiableSetView<0>")); + }, + Set_castFrom(source, newSet, $S, $T) { + return new A.CastSet(source, newSet, $S._eval$1("@<0>")._bind$1($T)._eval$1("CastSet<1,2>")); + }, + _combineSurrogatePair(start, end) { + return 65536 + ((start & 1023) << 10) + (end & 1023); + }, + Uri_Uri$dataFromString($content, encoding, mimeType) { + var encodingName, t1, + buffer = new A.StringBuffer(""), + indices = A._setArrayType([-1], type$.JSArray_int); + if (encoding == null) + encodingName = null; + else + encodingName = "utf-8"; + if (encoding == null) + encoding = B.C_AsciiCodec; + A.UriData__writeUri(mimeType, encodingName, null, buffer, indices); + indices.push(buffer._contents.length); + buffer._contents += ","; + A.UriData__uriEncodeBytes(B.List_oFp, encoding.encode$1($content), buffer); + t1 = buffer._contents; + return new A.UriData(t1.charCodeAt(0) == 0 ? t1 : t1, indices, null).get$uri(); + }, + Uri_parse(uri) { + var delta, indices, schemeEnd, hostStart, portStart, pathStart, queryStart, fragmentStart, isSimple, scheme, t1, t2, schemeAuth, queryStart0, pathStart0, userInfoStart, userInfo, host, portNumber, port, path, query, _null = null, + end = uri.length; + if (end >= 5) { + delta = ((uri.charCodeAt(4) ^ 58) * 3 | uri.charCodeAt(0) ^ 100 | uri.charCodeAt(1) ^ 97 | uri.charCodeAt(2) ^ 116 | uri.charCodeAt(3) ^ 97) >>> 0; + if (delta === 0) + return A.UriData__parse(end < end ? B.JSString_methods.substring$2(uri, 0, end) : uri, 5, _null).get$uri(); + else if (delta === 32) + return A.UriData__parse(B.JSString_methods.substring$2(uri, 5, end), 0, _null).get$uri(); + } + indices = A.List_List$filled(8, 0, false, type$.int); + indices[0] = 0; + indices[1] = -1; + indices[2] = -1; + indices[7] = -1; + indices[3] = 0; + indices[4] = 0; + indices[5] = end; + indices[6] = end; + if (A._scan(uri, 0, end, 0, indices) >= 14) + indices[7] = end; + schemeEnd = indices[1]; + if (schemeEnd >= 0) + if (A._scan(uri, 0, schemeEnd, 20, indices) === 20) + indices[7] = schemeEnd; + hostStart = indices[2] + 1; + portStart = indices[3]; + pathStart = indices[4]; + queryStart = indices[5]; + fragmentStart = indices[6]; + if (fragmentStart < queryStart) + queryStart = fragmentStart; + if (pathStart < hostStart) + pathStart = queryStart; + else if (pathStart <= schemeEnd) + pathStart = schemeEnd + 1; + if (portStart < hostStart) + portStart = pathStart; + isSimple = indices[7] < 0; + if (isSimple) + if (hostStart > schemeEnd + 3) { + scheme = _null; + isSimple = false; + } else { + t1 = portStart > 0; + if (t1 && portStart + 1 === pathStart) { + scheme = _null; + isSimple = false; + } else { + if (!B.JSString_methods.startsWith$2(uri, "\\", pathStart)) + if (hostStart > 0) + t2 = B.JSString_methods.startsWith$2(uri, "\\", hostStart - 1) || B.JSString_methods.startsWith$2(uri, "\\", hostStart - 2); + else + t2 = false; + else + t2 = true; + if (t2) { + scheme = _null; + isSimple = false; + } else { + if (!(queryStart < end && queryStart === pathStart + 2 && B.JSString_methods.startsWith$2(uri, "..", pathStart))) + t2 = queryStart > pathStart + 2 && B.JSString_methods.startsWith$2(uri, "/..", queryStart - 3); + else + t2 = true; + if (t2) { + scheme = _null; + isSimple = false; + } else { + if (schemeEnd === 4) + if (B.JSString_methods.startsWith$2(uri, "file", 0)) { + if (hostStart <= 0) { + if (!B.JSString_methods.startsWith$2(uri, "/", pathStart)) { + schemeAuth = "file:///"; + delta = 3; + } else { + schemeAuth = "file://"; + delta = 2; + } + uri = schemeAuth + B.JSString_methods.substring$2(uri, pathStart, end); + schemeEnd -= 0; + t1 = delta - 0; + queryStart += t1; + fragmentStart += t1; + end = uri.length; + hostStart = 7; + portStart = 7; + pathStart = 7; + } else if (pathStart === queryStart) { + ++fragmentStart; + queryStart0 = queryStart + 1; + uri = B.JSString_methods.replaceRange$3(uri, pathStart, queryStart, "/"); + ++end; + queryStart = queryStart0; + } + scheme = "file"; + } else if (B.JSString_methods.startsWith$2(uri, "http", 0)) { + if (t1 && portStart + 3 === pathStart && B.JSString_methods.startsWith$2(uri, "80", portStart + 1)) { + fragmentStart -= 3; + pathStart0 = pathStart - 3; + queryStart -= 3; + uri = B.JSString_methods.replaceRange$3(uri, portStart, pathStart, ""); + end -= 3; + pathStart = pathStart0; + } + scheme = "http"; + } else + scheme = _null; + else if (schemeEnd === 5 && B.JSString_methods.startsWith$2(uri, "https", 0)) { + if (t1 && portStart + 4 === pathStart && B.JSString_methods.startsWith$2(uri, "443", portStart + 1)) { + fragmentStart -= 4; + pathStart0 = pathStart - 4; + queryStart -= 4; + uri = B.JSString_methods.replaceRange$3(uri, portStart, pathStart, ""); + end -= 3; + pathStart = pathStart0; + } + scheme = "https"; + } else + scheme = _null; + isSimple = true; + } + } + } + } + else + scheme = _null; + if (isSimple) { + if (end < uri.length) { + uri = B.JSString_methods.substring$2(uri, 0, end); + schemeEnd -= 0; + hostStart -= 0; + portStart -= 0; + pathStart -= 0; + queryStart -= 0; + fragmentStart -= 0; + } + return new A._SimpleUri(uri, schemeEnd, hostStart, portStart, pathStart, queryStart, fragmentStart, scheme); + } + if (scheme == null) + if (schemeEnd > 0) + scheme = A._Uri__makeScheme(uri, 0, schemeEnd); + else { + if (schemeEnd === 0) + A._Uri__fail(uri, 0, "Invalid empty scheme"); + scheme = ""; + } + if (hostStart > 0) { + userInfoStart = schemeEnd + 3; + userInfo = userInfoStart < hostStart ? A._Uri__makeUserInfo(uri, userInfoStart, hostStart - 1) : ""; + host = A._Uri__makeHost(uri, hostStart, portStart, false); + t1 = portStart + 1; + if (t1 < pathStart) { + portNumber = A.Primitives_parseInt(B.JSString_methods.substring$2(uri, t1, pathStart), _null); + port = A._Uri__makePort(portNumber == null ? A.throwExpression(A.FormatException$("Invalid port", uri, t1)) : portNumber, scheme); + } else + port = _null; + } else { + port = _null; + host = port; + userInfo = ""; + } + path = A._Uri__makePath(uri, pathStart, queryStart, _null, scheme, host != null); + query = queryStart < fragmentStart ? A._Uri__makeQuery(uri, queryStart + 1, fragmentStart, _null) : _null; + return A._Uri$_internal(scheme, userInfo, host, port, path, query, fragmentStart < end ? A._Uri__makeFragment(uri, fragmentStart + 1, end) : _null); + }, + Uri_decodeComponent(encodedComponent) { + return A._Uri__uriDecode(encodedComponent, 0, encodedComponent.length, B.C_Utf8Codec, false); + }, + Uri__parseIPv4Address(host, start, end) { + var i, partStart, partIndex, char, part, partIndex0, + _s43_ = "IPv4 address should contain exactly 4 parts", + _s37_ = "each part must be in the range 0..255", + error = new A.Uri__parseIPv4Address_error(host), + result = new Uint8Array(4); + for (i = start, partStart = i, partIndex = 0; i < end; ++i) { + char = host.charCodeAt(i); + if (char !== 46) { + if ((char ^ 48) > 9) + error.call$2("invalid character", i); + } else { + if (partIndex === 3) + error.call$2(_s43_, i); + part = A.int_parse(B.JSString_methods.substring$2(host, partStart, i), null); + if (part > 255) + error.call$2(_s37_, partStart); + partIndex0 = partIndex + 1; + result[partIndex] = part; + partStart = i + 1; + partIndex = partIndex0; + } + } + if (partIndex !== 3) + error.call$2(_s43_, end); + part = A.int_parse(B.JSString_methods.substring$2(host, partStart, end), null); + if (part > 255) + error.call$2(_s37_, partStart); + result[partIndex] = part; + return result; + }, + Uri_parseIPv6Address(host, start, end) { + var parts, i, partStart, wildcardSeen, seenDot, char, atEnd, t1, last, bytes, wildCardLength, index, value, j, _null = null, + error = new A.Uri_parseIPv6Address_error(host), + parseHex = new A.Uri_parseIPv6Address_parseHex(error, host); + if (host.length < 2) + error.call$2("address is too short", _null); + parts = A._setArrayType([], type$.JSArray_int); + for (i = start, partStart = i, wildcardSeen = false, seenDot = false; i < end; ++i) { + char = host.charCodeAt(i); + if (char === 58) { + if (i === start) { + ++i; + if (host.charCodeAt(i) !== 58) + error.call$2("invalid start colon.", i); + partStart = i; + } + if (i === partStart) { + if (wildcardSeen) + error.call$2("only one wildcard `::` is allowed", i); + parts.push(-1); + wildcardSeen = true; + } else + parts.push(parseHex.call$2(partStart, i)); + partStart = i + 1; + } else if (char === 46) + seenDot = true; + } + if (parts.length === 0) + error.call$2("too few parts", _null); + atEnd = partStart === end; + t1 = B.JSArray_methods.get$last(parts); + if (atEnd && t1 !== -1) + error.call$2("expected a part after last `:`", end); + if (!atEnd) + if (!seenDot) + parts.push(parseHex.call$2(partStart, end)); + else { + last = A.Uri__parseIPv4Address(host, partStart, end); + parts.push((last[0] << 8 | last[1]) >>> 0); + parts.push((last[2] << 8 | last[3]) >>> 0); + } + if (wildcardSeen) { + if (parts.length > 7) + error.call$2("an address with a wildcard must have less than 7 parts", _null); + } else if (parts.length !== 8) + error.call$2("an address without a wildcard must contain exactly 8 parts", _null); + bytes = new Uint8Array(16); + for (t1 = parts.length, wildCardLength = 9 - t1, i = 0, index = 0; i < t1; ++i) { + value = parts[i]; + if (value === -1) + for (j = 0; j < wildCardLength; ++j) { + bytes[index] = 0; + bytes[index + 1] = 0; + index += 2; + } + else { + bytes[index] = B.JSInt_methods._shrOtherPositive$1(value, 8); + bytes[index + 1] = value & 255; + index += 2; + } + } + return bytes; + }, + _Uri$_internal(scheme, _userInfo, _host, _port, path, _query, _fragment) { + return new A._Uri(scheme, _userInfo, _host, _port, path, _query, _fragment); + }, + _Uri__Uri(host, path, pathSegments, scheme) { + var userInfo, query, fragment, port, isFile, t1, hasAuthority, t2, _null = null; + scheme = scheme == null ? "" : A._Uri__makeScheme(scheme, 0, scheme.length); + userInfo = A._Uri__makeUserInfo(_null, 0, 0); + host = A._Uri__makeHost(host, 0, host == null ? 0 : host.length, false); + query = A._Uri__makeQuery(_null, 0, 0, _null); + fragment = A._Uri__makeFragment(_null, 0, 0); + port = A._Uri__makePort(_null, scheme); + isFile = scheme === "file"; + if (host == null) + t1 = userInfo.length !== 0 || port != null || isFile; + else + t1 = false; + if (t1) + host = ""; + t1 = host == null; + hasAuthority = !t1; + path = A._Uri__makePath(path, 0, path == null ? 0 : path.length, pathSegments, scheme, hasAuthority); + t2 = scheme.length === 0; + if (t2 && t1 && !B.JSString_methods.startsWith$1(path, "/")) + path = A._Uri__normalizeRelativePath(path, !t2 || hasAuthority); + else + path = A._Uri__removeDotSegments(path); + return A._Uri$_internal(scheme, userInfo, t1 && B.JSString_methods.startsWith$1(path, "//") ? "" : host, port, path, query, fragment); + }, + _Uri__defaultPort(scheme) { + if (scheme === "http") + return 80; + if (scheme === "https") + return 443; + return 0; + }, + _Uri__fail(uri, index, message) { + throw A.wrapException(A.FormatException$(message, uri, index)); + }, + _Uri__Uri$file(path, windows) { + return windows ? A._Uri__makeWindowsFileUrl(path, false) : A._Uri__makeFileUri(path, false); + }, + _Uri__checkNonWindowsPathReservedCharacters(segments, argumentError) { + var t1, _i, segment, t2, t3; + for (t1 = segments.length, _i = 0; _i < t1; ++_i) { + segment = segments[_i]; + t2 = J.getInterceptor$asx(segment); + t3 = t2.get$length(segment); + if (0 > t3) + A.throwExpression(A.RangeError$range(0, 0, t2.get$length(segment), null, null)); + if (A.stringContainsUnchecked(segment, "/", 0)) { + t1 = A.UnsupportedError$("Illegal path character " + A.S(segment)); + throw A.wrapException(t1); + } + } + }, + _Uri__checkWindowsPathReservedCharacters(segments, argumentError, firstSegment) { + var t1, t2, t3, t4, t5, _null = null; + for (t1 = A.SubListIterable$(segments, firstSegment, _null, A._arrayInstanceType(segments)._precomputed1), t2 = t1.$ti, t1 = new A.ListIterator(t1, t1.get$length(0), t2._eval$1("ListIterator")), t2 = t2._eval$1("ListIterable.E"); t1.moveNext$0();) { + t3 = t1.__internal$_current; + if (t3 == null) + t3 = t2._as(t3); + t4 = A.RegExp_RegExp('["*/:<>?\\\\|]', false); + t5 = t3.length; + if (A.stringContainsUnchecked(t3, t4, 0)) + if (argumentError) + throw A.wrapException(A.ArgumentError$("Illegal character in path", _null)); + else + throw A.wrapException(A.UnsupportedError$("Illegal character in path: " + t3)); + } + }, + _Uri__checkWindowsDriveLetter(charCode, argumentError) { + var t1, + _s21_ = "Illegal drive letter "; + if (!(65 <= charCode && charCode <= 90)) + t1 = 97 <= charCode && charCode <= 122; + else + t1 = true; + if (t1) + return; + if (argumentError) + throw A.wrapException(A.ArgumentError$(_s21_ + A.String_String$fromCharCode(charCode), null)); + else + throw A.wrapException(A.UnsupportedError$(_s21_ + A.String_String$fromCharCode(charCode))); + }, + _Uri__makeFileUri(path, slashTerminated) { + var _null = null, + segments = A._setArrayType(path.split("/"), type$.JSArray_String); + if (B.JSString_methods.startsWith$1(path, "/")) + return A._Uri__Uri(_null, _null, segments, "file"); + else + return A._Uri__Uri(_null, _null, segments, _null); + }, + _Uri__makeWindowsFileUrl(path, slashTerminated) { + var t1, pathSegments, pathStart, hostPart, _s1_ = "\\", _null = null, _s4_ = "file"; + if (B.JSString_methods.startsWith$1(path, "\\\\?\\")) + if (B.JSString_methods.startsWith$2(path, "UNC\\", 4)) + path = B.JSString_methods.replaceRange$3(path, 0, 7, _s1_); + else { + path = B.JSString_methods.substring$1(path, 4); + if (path.length < 3 || path.charCodeAt(1) !== 58 || path.charCodeAt(2) !== 92) + throw A.wrapException(A.ArgumentError$value(path, "path", "Windows paths with \\\\?\\ prefix must be absolute")); + } + else + path = A.stringReplaceAllUnchecked(path, "/", _s1_); + t1 = path.length; + if (t1 > 1 && path.charCodeAt(1) === 58) { + A._Uri__checkWindowsDriveLetter(path.charCodeAt(0), true); + if (t1 === 2 || path.charCodeAt(2) !== 92) + throw A.wrapException(A.ArgumentError$value(path, "path", "Windows paths with drive letter must be absolute")); + pathSegments = A._setArrayType(path.split(_s1_), type$.JSArray_String); + A._Uri__checkWindowsPathReservedCharacters(pathSegments, true, 1); + return A._Uri__Uri(_null, _null, pathSegments, _s4_); + } + if (B.JSString_methods.startsWith$1(path, _s1_)) + if (B.JSString_methods.startsWith$2(path, _s1_, 1)) { + pathStart = B.JSString_methods.indexOf$2(path, _s1_, 2); + t1 = pathStart < 0; + hostPart = t1 ? B.JSString_methods.substring$1(path, 2) : B.JSString_methods.substring$2(path, 2, pathStart); + pathSegments = A._setArrayType((t1 ? "" : B.JSString_methods.substring$1(path, pathStart + 1)).split(_s1_), type$.JSArray_String); + A._Uri__checkWindowsPathReservedCharacters(pathSegments, true, 0); + return A._Uri__Uri(hostPart, _null, pathSegments, _s4_); + } else { + pathSegments = A._setArrayType(path.split(_s1_), type$.JSArray_String); + A._Uri__checkWindowsPathReservedCharacters(pathSegments, true, 0); + return A._Uri__Uri(_null, _null, pathSegments, _s4_); + } + else { + pathSegments = A._setArrayType(path.split(_s1_), type$.JSArray_String); + A._Uri__checkWindowsPathReservedCharacters(pathSegments, true, 0); + return A._Uri__Uri(_null, _null, pathSegments, _null); + } + }, + _Uri__makePort(port, scheme) { + if (port != null && port === A._Uri__defaultPort(scheme)) + return null; + return port; + }, + _Uri__makeHost(host, start, end, strictIPv6) { + var t1, t2, index, zoneIDstart, zoneID, i; + if (host == null) + return null; + if (start === end) + return ""; + if (host.charCodeAt(start) === 91) { + t1 = end - 1; + if (host.charCodeAt(t1) !== 93) + A._Uri__fail(host, start, "Missing end `]` to match `[` in host"); + t2 = start + 1; + index = A._Uri__checkZoneID(host, t2, t1); + if (index < t1) { + zoneIDstart = index + 1; + zoneID = A._Uri__normalizeZoneID(host, B.JSString_methods.startsWith$2(host, "25", zoneIDstart) ? index + 3 : zoneIDstart, t1, "%25"); + } else + zoneID = ""; + A.Uri_parseIPv6Address(host, t2, index); + return B.JSString_methods.substring$2(host, start, index).toLowerCase() + zoneID + "]"; + } + for (i = start; i < end; ++i) + if (host.charCodeAt(i) === 58) { + index = B.JSString_methods.indexOf$2(host, "%", start); + index = index >= start && index < end ? index : end; + if (index < end) { + zoneIDstart = index + 1; + zoneID = A._Uri__normalizeZoneID(host, B.JSString_methods.startsWith$2(host, "25", zoneIDstart) ? index + 3 : zoneIDstart, end, "%25"); + } else + zoneID = ""; + A.Uri_parseIPv6Address(host, start, index); + return "[" + B.JSString_methods.substring$2(host, start, index) + zoneID + "]"; + } + return A._Uri__normalizeRegName(host, start, end); + }, + _Uri__checkZoneID(host, start, end) { + var index = B.JSString_methods.indexOf$2(host, "%", start); + return index >= start && index < end ? index : end; + }, + _Uri__normalizeZoneID(host, start, end, prefix) { + var index, sectionStart, isNormalized, char, replacement, t1, t2, tail, sourceLength, slice, + buffer = prefix !== "" ? new A.StringBuffer(prefix) : null; + for (index = start, sectionStart = index, isNormalized = true; index < end;) { + char = host.charCodeAt(index); + if (char === 37) { + replacement = A._Uri__normalizeEscape(host, index, true); + t1 = replacement == null; + if (t1 && isNormalized) { + index += 3; + continue; + } + if (buffer == null) + buffer = new A.StringBuffer(""); + t2 = buffer._contents += B.JSString_methods.substring$2(host, sectionStart, index); + if (t1) + replacement = B.JSString_methods.substring$2(host, index, index + 3); + else if (replacement === "%") + A._Uri__fail(host, index, "ZoneID should not contain % anymore"); + buffer._contents = t2 + replacement; + index += 3; + sectionStart = index; + isNormalized = true; + } else if (char < 127 && (B.List_M1A[char >>> 4] & 1 << (char & 15)) !== 0) { + if (isNormalized && 65 <= char && 90 >= char) { + if (buffer == null) + buffer = new A.StringBuffer(""); + if (sectionStart < index) { + buffer._contents += B.JSString_methods.substring$2(host, sectionStart, index); + sectionStart = index; + } + isNormalized = false; + } + ++index; + } else { + if ((char & 64512) === 55296 && index + 1 < end) { + tail = host.charCodeAt(index + 1); + if ((tail & 64512) === 56320) { + char = (char & 1023) << 10 | tail & 1023 | 65536; + sourceLength = 2; + } else + sourceLength = 1; + } else + sourceLength = 1; + slice = B.JSString_methods.substring$2(host, sectionStart, index); + if (buffer == null) { + buffer = new A.StringBuffer(""); + t1 = buffer; + } else + t1 = buffer; + t1._contents += slice; + t1._contents += A._Uri__escapeChar(char); + index += sourceLength; + sectionStart = index; + } + } + if (buffer == null) + return B.JSString_methods.substring$2(host, start, end); + if (sectionStart < end) + buffer._contents += B.JSString_methods.substring$2(host, sectionStart, end); + t1 = buffer._contents; + return t1.charCodeAt(0) == 0 ? t1 : t1; + }, + _Uri__normalizeRegName(host, start, end) { + var index, sectionStart, buffer, isNormalized, char, replacement, t1, slice, t2, sourceLength, tail; + for (index = start, sectionStart = index, buffer = null, isNormalized = true; index < end;) { + char = host.charCodeAt(index); + if (char === 37) { + replacement = A._Uri__normalizeEscape(host, index, true); + t1 = replacement == null; + if (t1 && isNormalized) { + index += 3; + continue; + } + if (buffer == null) + buffer = new A.StringBuffer(""); + slice = B.JSString_methods.substring$2(host, sectionStart, index); + t2 = buffer._contents += !isNormalized ? slice.toLowerCase() : slice; + if (t1) { + replacement = B.JSString_methods.substring$2(host, index, index + 3); + sourceLength = 3; + } else if (replacement === "%") { + replacement = "%25"; + sourceLength = 1; + } else + sourceLength = 3; + buffer._contents = t2 + replacement; + index += sourceLength; + sectionStart = index; + isNormalized = true; + } else if (char < 127 && (B.List_ejq[char >>> 4] & 1 << (char & 15)) !== 0) { + if (isNormalized && 65 <= char && 90 >= char) { + if (buffer == null) + buffer = new A.StringBuffer(""); + if (sectionStart < index) { + buffer._contents += B.JSString_methods.substring$2(host, sectionStart, index); + sectionStart = index; + } + isNormalized = false; + } + ++index; + } else if (char <= 93 && (B.List_YmH[char >>> 4] & 1 << (char & 15)) !== 0) + A._Uri__fail(host, index, "Invalid character"); + else { + if ((char & 64512) === 55296 && index + 1 < end) { + tail = host.charCodeAt(index + 1); + if ((tail & 64512) === 56320) { + char = (char & 1023) << 10 | tail & 1023 | 65536; + sourceLength = 2; + } else + sourceLength = 1; + } else + sourceLength = 1; + slice = B.JSString_methods.substring$2(host, sectionStart, index); + if (!isNormalized) + slice = slice.toLowerCase(); + if (buffer == null) { + buffer = new A.StringBuffer(""); + t1 = buffer; + } else + t1 = buffer; + t1._contents += slice; + t1._contents += A._Uri__escapeChar(char); + index += sourceLength; + sectionStart = index; + } + } + if (buffer == null) + return B.JSString_methods.substring$2(host, start, end); + if (sectionStart < end) { + slice = B.JSString_methods.substring$2(host, sectionStart, end); + buffer._contents += !isNormalized ? slice.toLowerCase() : slice; + } + t1 = buffer._contents; + return t1.charCodeAt(0) == 0 ? t1 : t1; + }, + _Uri__makeScheme(scheme, start, end) { + var i, containsUpperCase, codeUnit; + if (start === end) + return ""; + if (!A._Uri__isAlphabeticCharacter(scheme.charCodeAt(start))) + A._Uri__fail(scheme, start, "Scheme not starting with alphabetic character"); + for (i = start, containsUpperCase = false; i < end; ++i) { + codeUnit = scheme.charCodeAt(i); + if (!(codeUnit < 128 && (B.List_MMm[codeUnit >>> 4] & 1 << (codeUnit & 15)) !== 0)) + A._Uri__fail(scheme, i, "Illegal scheme character"); + if (65 <= codeUnit && codeUnit <= 90) + containsUpperCase = true; + } + scheme = B.JSString_methods.substring$2(scheme, start, end); + return A._Uri__canonicalizeScheme(containsUpperCase ? scheme.toLowerCase() : scheme); + }, + _Uri__canonicalizeScheme(scheme) { + if (scheme === "http") + return "http"; + if (scheme === "file") + return "file"; + if (scheme === "https") + return "https"; + if (scheme === "package") + return "package"; + return scheme; + }, + _Uri__makeUserInfo(userInfo, start, end) { + if (userInfo == null) + return ""; + return A._Uri__normalizeOrSubstring(userInfo, start, end, B.List_OL3, false, false); + }, + _Uri__makePath(path, start, end, pathSegments, scheme, hasAuthority) { + var result, + isFile = scheme === "file", + ensureLeadingSlash = isFile || hasAuthority; + if (path == null) { + if (pathSegments == null) + return isFile ? "/" : ""; + result = new A.MappedListIterable(pathSegments, new A._Uri__makePath_closure(), A._arrayInstanceType(pathSegments)._eval$1("MappedListIterable<1,String>")).join$1(0, "/"); + } else if (pathSegments != null) + throw A.wrapException(A.ArgumentError$("Both path and pathSegments specified", null)); + else + result = A._Uri__normalizeOrSubstring(path, start, end, B.List_XRg, true, true); + if (result.length === 0) { + if (isFile) + return "/"; + } else if (ensureLeadingSlash && !B.JSString_methods.startsWith$1(result, "/")) + result = "/" + result; + return A._Uri__normalizePath(result, scheme, hasAuthority); + }, + _Uri__normalizePath(path, scheme, hasAuthority) { + var t1 = scheme.length === 0; + if (t1 && !hasAuthority && !B.JSString_methods.startsWith$1(path, "/") && !B.JSString_methods.startsWith$1(path, "\\")) + return A._Uri__normalizeRelativePath(path, !t1 || hasAuthority); + return A._Uri__removeDotSegments(path); + }, + _Uri__makeQuery(query, start, end, queryParameters) { + if (query != null) + return A._Uri__normalizeOrSubstring(query, start, end, B.List_oFp, true, false); + return null; + }, + _Uri__makeFragment(fragment, start, end) { + if (fragment == null) + return null; + return A._Uri__normalizeOrSubstring(fragment, start, end, B.List_oFp, true, false); + }, + _Uri__normalizeEscape(source, index, lowerCase) { + var firstDigit, secondDigit, firstDigitValue, secondDigitValue, value, + t1 = index + 2; + if (t1 >= source.length) + return "%"; + firstDigit = source.charCodeAt(index + 1); + secondDigit = source.charCodeAt(t1); + firstDigitValue = A.hexDigitValue(firstDigit); + secondDigitValue = A.hexDigitValue(secondDigit); + if (firstDigitValue < 0 || secondDigitValue < 0) + return "%"; + value = firstDigitValue * 16 + secondDigitValue; + if (value < 127 && (B.List_M1A[B.JSInt_methods._shrOtherPositive$1(value, 4)] & 1 << (value & 15)) !== 0) + return A.Primitives_stringFromCharCode(lowerCase && 65 <= value && 90 >= value ? (value | 32) >>> 0 : value); + if (firstDigit >= 97 || secondDigit >= 97) + return B.JSString_methods.substring$2(source, index, index + 3).toUpperCase(); + return null; + }, + _Uri__escapeChar(char) { + var codeUnits, flag, encodedBytes, index, byte, + _s16_ = "0123456789ABCDEF"; + if (char < 128) { + codeUnits = new Uint8Array(3); + codeUnits[0] = 37; + codeUnits[1] = _s16_.charCodeAt(char >>> 4); + codeUnits[2] = _s16_.charCodeAt(char & 15); + } else { + if (char > 2047) + if (char > 65535) { + flag = 240; + encodedBytes = 4; + } else { + flag = 224; + encodedBytes = 3; + } + else { + flag = 192; + encodedBytes = 2; + } + codeUnits = new Uint8Array(3 * encodedBytes); + for (index = 0; --encodedBytes, encodedBytes >= 0; flag = 128) { + byte = B.JSInt_methods._shrReceiverPositive$1(char, 6 * encodedBytes) & 63 | flag; + codeUnits[index] = 37; + codeUnits[index + 1] = _s16_.charCodeAt(byte >>> 4); + codeUnits[index + 2] = _s16_.charCodeAt(byte & 15); + index += 3; + } + } + return A.String_String$fromCharCodes(codeUnits, 0, null); + }, + _Uri__normalizeOrSubstring(component, start, end, charTable, escapeDelimiters, replaceBackslash) { + var t1 = A._Uri__normalize(component, start, end, charTable, escapeDelimiters, replaceBackslash); + return t1 == null ? B.JSString_methods.substring$2(component, start, end) : t1; + }, + _Uri__normalize(component, start, end, charTable, escapeDelimiters, replaceBackslash) { + var t1, index, sectionStart, buffer, char, replacement, sourceLength, t2, tail, t3, _null = null; + for (t1 = !escapeDelimiters, index = start, sectionStart = index, buffer = _null; index < end;) { + char = component.charCodeAt(index); + if (char < 127 && (charTable[char >>> 4] & 1 << (char & 15)) !== 0) + ++index; + else { + if (char === 37) { + replacement = A._Uri__normalizeEscape(component, index, false); + if (replacement == null) { + index += 3; + continue; + } + if ("%" === replacement) { + replacement = "%25"; + sourceLength = 1; + } else + sourceLength = 3; + } else if (char === 92 && replaceBackslash) { + replacement = "/"; + sourceLength = 1; + } else if (t1 && char <= 93 && (B.List_YmH[char >>> 4] & 1 << (char & 15)) !== 0) { + A._Uri__fail(component, index, "Invalid character"); + sourceLength = _null; + replacement = sourceLength; + } else { + if ((char & 64512) === 55296) { + t2 = index + 1; + if (t2 < end) { + tail = component.charCodeAt(t2); + if ((tail & 64512) === 56320) { + char = (char & 1023) << 10 | tail & 1023 | 65536; + sourceLength = 2; + } else + sourceLength = 1; + } else + sourceLength = 1; + } else + sourceLength = 1; + replacement = A._Uri__escapeChar(char); + } + if (buffer == null) { + buffer = new A.StringBuffer(""); + t2 = buffer; + } else + t2 = buffer; + t3 = t2._contents += B.JSString_methods.substring$2(component, sectionStart, index); + t2._contents = t3 + A.S(replacement); + index += sourceLength; + sectionStart = index; + } + } + if (buffer == null) + return _null; + if (sectionStart < end) + buffer._contents += B.JSString_methods.substring$2(component, sectionStart, end); + t1 = buffer._contents; + return t1.charCodeAt(0) == 0 ? t1 : t1; + }, + _Uri__mayContainDotSegments(path) { + if (B.JSString_methods.startsWith$1(path, ".")) + return true; + return B.JSString_methods.indexOf$1(path, "/.") !== -1; + }, + _Uri__removeDotSegments(path) { + var output, t1, t2, appendSlash, _i, segment; + if (!A._Uri__mayContainDotSegments(path)) + return path; + output = A._setArrayType([], type$.JSArray_String); + for (t1 = path.split("/"), t2 = t1.length, appendSlash = false, _i = 0; _i < t2; ++_i) { + segment = t1[_i]; + if (J.$eq$(segment, "..")) { + if (output.length !== 0) { + output.pop(); + if (output.length === 0) + output.push(""); + } + appendSlash = true; + } else if ("." === segment) + appendSlash = true; + else { + output.push(segment); + appendSlash = false; + } + } + if (appendSlash) + output.push(""); + return B.JSArray_methods.join$1(output, "/"); + }, + _Uri__normalizeRelativePath(path, allowScheme) { + var output, t1, t2, appendSlash, _i, segment; + if (!A._Uri__mayContainDotSegments(path)) + return !allowScheme ? A._Uri__escapeScheme(path) : path; + output = A._setArrayType([], type$.JSArray_String); + for (t1 = path.split("/"), t2 = t1.length, appendSlash = false, _i = 0; _i < t2; ++_i) { + segment = t1[_i]; + if (".." === segment) + if (output.length !== 0 && B.JSArray_methods.get$last(output) !== "..") { + output.pop(); + appendSlash = true; + } else { + output.push(".."); + appendSlash = false; + } + else if ("." === segment) + appendSlash = true; + else { + output.push(segment); + appendSlash = false; + } + } + t1 = output.length; + if (t1 !== 0) + t1 = t1 === 1 && output[0].length === 0; + else + t1 = true; + if (t1) + return "./"; + if (appendSlash || B.JSArray_methods.get$last(output) === "..") + output.push(""); + if (!allowScheme) + output[0] = A._Uri__escapeScheme(output[0]); + return B.JSArray_methods.join$1(output, "/"); + }, + _Uri__escapeScheme(path) { + var i, char, + t1 = path.length; + if (t1 >= 2 && A._Uri__isAlphabeticCharacter(path.charCodeAt(0))) + for (i = 1; i < t1; ++i) { + char = path.charCodeAt(i); + if (char === 58) + return B.JSString_methods.substring$2(path, 0, i) + "%3A" + B.JSString_methods.substring$1(path, i + 1); + if (char > 127 || (B.List_MMm[char >>> 4] & 1 << (char & 15)) === 0) + break; + } + return path; + }, + _Uri__packageNameEnd(uri, path) { + if (uri.isScheme$1("package") && uri._host == null) + return A._skipPackageNameChars(path, 0, path.length); + return -1; + }, + _Uri__toWindowsFilePath(uri) { + var hasDriveLetter, t2, host, + segments = uri.get$pathSegments(), + t1 = segments.length; + if (t1 > 0 && J.get$length$asx(segments[0]) === 2 && J.codeUnitAt$1$s(segments[0], 1) === 58) { + A._Uri__checkWindowsDriveLetter(J.codeUnitAt$1$s(segments[0], 0), false); + A._Uri__checkWindowsPathReservedCharacters(segments, false, 1); + hasDriveLetter = true; + } else { + A._Uri__checkWindowsPathReservedCharacters(segments, false, 0); + hasDriveLetter = false; + } + t2 = uri.get$hasAbsolutePath() && !hasDriveLetter ? "" + "\\" : ""; + if (uri.get$hasAuthority()) { + host = uri.get$host(); + if (host.length !== 0) + t2 = t2 + "\\" + host + "\\"; + } + t2 = A.StringBuffer__writeAll(t2, segments, "\\"); + t1 = hasDriveLetter && t1 === 1 ? t2 + "\\" : t2; + return t1.charCodeAt(0) == 0 ? t1 : t1; + }, + _Uri__hexCharPairToByte(s, pos) { + var byte, i, charCode; + for (byte = 0, i = 0; i < 2; ++i) { + charCode = s.charCodeAt(pos + i); + if (48 <= charCode && charCode <= 57) + byte = byte * 16 + charCode - 48; + else { + charCode |= 32; + if (97 <= charCode && charCode <= 102) + byte = byte * 16 + charCode - 87; + else + throw A.wrapException(A.ArgumentError$("Invalid URL encoding", null)); + } + } + return byte; + }, + _Uri__uriDecode(text, start, end, encoding, plusToSpace) { + var simple, codeUnit, t1, bytes, + i = start; + while (true) { + if (!(i < end)) { + simple = true; + break; + } + codeUnit = text.charCodeAt(i); + if (codeUnit <= 127) + if (codeUnit !== 37) + t1 = false; + else + t1 = true; + else + t1 = true; + if (t1) { + simple = false; + break; + } + ++i; + } + if (simple) { + if (B.C_Utf8Codec !== encoding) + t1 = false; + else + t1 = true; + if (t1) + return B.JSString_methods.substring$2(text, start, end); + else + bytes = new A.CodeUnits(B.JSString_methods.substring$2(text, start, end)); + } else { + bytes = A._setArrayType([], type$.JSArray_int); + for (t1 = text.length, i = start; i < end; ++i) { + codeUnit = text.charCodeAt(i); + if (codeUnit > 127) + throw A.wrapException(A.ArgumentError$("Illegal percent encoding in URI", null)); + if (codeUnit === 37) { + if (i + 3 > t1) + throw A.wrapException(A.ArgumentError$("Truncated URI", null)); + bytes.push(A._Uri__hexCharPairToByte(text, i + 1)); + i += 2; + } else + bytes.push(codeUnit); + } + } + return B.Utf8Decoder_false.convert$1(bytes); + }, + _Uri__isAlphabeticCharacter(codeUnit) { + var lowerCase = codeUnit | 32; + return 97 <= lowerCase && lowerCase <= 122; + }, + UriData__writeUri(mimeType, charsetName, parameters, buffer, indices) { + var t1, slashIndex; + if (mimeType != null) + t1 = 10 === mimeType.length && A._caseInsensitiveCompareStart("text/plain", mimeType, 0) >= 0; + else + t1 = true; + if (t1) + mimeType = ""; + if (mimeType.length === 0 || mimeType === "application/octet-stream") + t1 = buffer._contents += mimeType; + else { + slashIndex = A.UriData__validateMimeType(mimeType); + if (slashIndex < 0) + throw A.wrapException(A.ArgumentError$value(mimeType, "mimeType", "Invalid MIME type")); + t1 = buffer._contents += A._Uri__uriEncode(B.List_yzX, B.JSString_methods.substring$2(mimeType, 0, slashIndex), B.C_Utf8Codec, false); + buffer._contents = t1 + "/"; + t1 = buffer._contents += A._Uri__uriEncode(B.List_yzX, B.JSString_methods.substring$1(mimeType, slashIndex + 1), B.C_Utf8Codec, false); + } + if (charsetName != null) { + indices.push(t1.length); + indices.push(buffer._contents.length + 8); + buffer._contents += ";charset="; + buffer._contents += A._Uri__uriEncode(B.List_yzX, charsetName, B.C_Utf8Codec, false); + } + }, + UriData__validateMimeType(mimeType) { + var t1, slashIndex, i; + for (t1 = mimeType.length, slashIndex = -1, i = 0; i < t1; ++i) { + if (mimeType.charCodeAt(i) !== 47) + continue; + if (slashIndex < 0) { + slashIndex = i; + continue; + } + return -1; + } + return slashIndex; + }, + UriData__parse(text, start, sourceUri) { + var t1, i, slashIndex, char, equalsIndex, lastSeparator, t2, data, + _s17_ = "Invalid MIME type", + indices = A._setArrayType([start - 1], type$.JSArray_int); + for (t1 = text.length, i = start, slashIndex = -1, char = null; i < t1; ++i) { + char = text.charCodeAt(i); + if (char === 44 || char === 59) + break; + if (char === 47) { + if (slashIndex < 0) { + slashIndex = i; + continue; + } + throw A.wrapException(A.FormatException$(_s17_, text, i)); + } + } + if (slashIndex < 0 && i > start) + throw A.wrapException(A.FormatException$(_s17_, text, i)); + for (; char !== 44;) { + indices.push(i); + ++i; + for (equalsIndex = -1; i < t1; ++i) { + char = text.charCodeAt(i); + if (char === 61) { + if (equalsIndex < 0) + equalsIndex = i; + } else if (char === 59 || char === 44) + break; + } + if (equalsIndex >= 0) + indices.push(equalsIndex); + else { + lastSeparator = B.JSArray_methods.get$last(indices); + if (char !== 44 || i !== lastSeparator + 7 || !B.JSString_methods.startsWith$2(text, "base64", lastSeparator + 1)) + throw A.wrapException(A.FormatException$("Expecting '='", text, i)); + break; + } + } + indices.push(i); + t2 = i + 1; + if ((indices.length & 1) === 1) + text = B.C_Base64Codec.normalize$3(text, t2, t1); + else { + data = A._Uri__normalize(text, t2, t1, B.List_oFp, true, false); + if (data != null) + text = B.JSString_methods.replaceRange$3(text, t2, t1, data); + } + return new A.UriData(text, indices, sourceUri); + }, + UriData__uriEncodeBytes(canonicalTable, bytes, buffer) { + var t1, byteOr, i, byte, + _s16_ = "0123456789ABCDEF"; + for (t1 = bytes.length, byteOr = 0, i = 0; i < t1; ++i) { + byte = bytes[i]; + byteOr |= byte; + if (byte < 128 && (canonicalTable[byte >>> 4] & 1 << (byte & 15)) !== 0) + buffer._contents += A.Primitives_stringFromCharCode(byte); + else { + buffer._contents += A.Primitives_stringFromCharCode(37); + buffer._contents += A.Primitives_stringFromCharCode(_s16_.charCodeAt(byte >>> 4)); + buffer._contents += A.Primitives_stringFromCharCode(_s16_.charCodeAt(byte & 15)); + } + } + if ((byteOr & 4294967040) !== 0) + for (i = 0; i < t1; ++i) { + byte = bytes[i]; + if (byte > 255) + throw A.wrapException(A.ArgumentError$value(byte, "non-byte value", null)); + } + }, + _createTables() { + var _i, t1, t2, t3, b, + _s77_ = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-._~!$&'()*+,;=", + _s1_ = ".", _s1_0 = ":", _s1_1 = "/", _s1_2 = "\\", _s1_3 = "?", _s1_4 = "#", _s2_ = "/\\", + tables = J.JSArray_JSArray$allocateGrowable(22, type$.Uint8List); + for (_i = 0; _i < 22; ++_i) + tables[_i] = new Uint8Array(96); + t1 = new A._createTables_build(tables); + t2 = new A._createTables_setChars(); + t3 = new A._createTables_setRange(); + b = t1.call$2(0, 225); + t2.call$3(b, _s77_, 1); + t2.call$3(b, _s1_, 14); + t2.call$3(b, _s1_0, 34); + t2.call$3(b, _s1_1, 3); + t2.call$3(b, _s1_2, 227); + t2.call$3(b, _s1_3, 172); + t2.call$3(b, _s1_4, 205); + b = t1.call$2(14, 225); + t2.call$3(b, _s77_, 1); + t2.call$3(b, _s1_, 15); + t2.call$3(b, _s1_0, 34); + t2.call$3(b, _s2_, 234); + t2.call$3(b, _s1_3, 172); + t2.call$3(b, _s1_4, 205); + b = t1.call$2(15, 225); + t2.call$3(b, _s77_, 1); + t2.call$3(b, "%", 225); + t2.call$3(b, _s1_0, 34); + t2.call$3(b, _s1_1, 9); + t2.call$3(b, _s1_2, 233); + t2.call$3(b, _s1_3, 172); + t2.call$3(b, _s1_4, 205); + b = t1.call$2(1, 225); + t2.call$3(b, _s77_, 1); + t2.call$3(b, _s1_0, 34); + t2.call$3(b, _s1_1, 10); + t2.call$3(b, _s1_2, 234); + t2.call$3(b, _s1_3, 172); + t2.call$3(b, _s1_4, 205); + b = t1.call$2(2, 235); + t2.call$3(b, _s77_, 139); + t2.call$3(b, _s1_1, 131); + t2.call$3(b, _s1_2, 131); + t2.call$3(b, _s1_, 146); + t2.call$3(b, _s1_3, 172); + t2.call$3(b, _s1_4, 205); + b = t1.call$2(3, 235); + t2.call$3(b, _s77_, 11); + t2.call$3(b, _s1_1, 68); + t2.call$3(b, _s1_2, 68); + t2.call$3(b, _s1_, 18); + t2.call$3(b, _s1_3, 172); + t2.call$3(b, _s1_4, 205); + b = t1.call$2(4, 229); + t2.call$3(b, _s77_, 5); + t3.call$3(b, "AZ", 229); + t2.call$3(b, _s1_0, 102); + t2.call$3(b, "@", 68); + t2.call$3(b, "[", 232); + t2.call$3(b, _s1_1, 138); + t2.call$3(b, _s1_2, 138); + t2.call$3(b, _s1_3, 172); + t2.call$3(b, _s1_4, 205); + b = t1.call$2(5, 229); + t2.call$3(b, _s77_, 5); + t3.call$3(b, "AZ", 229); + t2.call$3(b, _s1_0, 102); + t2.call$3(b, "@", 68); + t2.call$3(b, _s1_1, 138); + t2.call$3(b, _s1_2, 138); + t2.call$3(b, _s1_3, 172); + t2.call$3(b, _s1_4, 205); + b = t1.call$2(6, 231); + t3.call$3(b, "19", 7); + t2.call$3(b, "@", 68); + t2.call$3(b, _s1_1, 138); + t2.call$3(b, _s1_2, 138); + t2.call$3(b, _s1_3, 172); + t2.call$3(b, _s1_4, 205); + b = t1.call$2(7, 231); + t3.call$3(b, "09", 7); + t2.call$3(b, "@", 68); + t2.call$3(b, _s1_1, 138); + t2.call$3(b, _s1_2, 138); + t2.call$3(b, _s1_3, 172); + t2.call$3(b, _s1_4, 205); + t2.call$3(t1.call$2(8, 8), "]", 5); + b = t1.call$2(9, 235); + t2.call$3(b, _s77_, 11); + t2.call$3(b, _s1_, 16); + t2.call$3(b, _s2_, 234); + t2.call$3(b, _s1_3, 172); + t2.call$3(b, _s1_4, 205); + b = t1.call$2(16, 235); + t2.call$3(b, _s77_, 11); + t2.call$3(b, _s1_, 17); + t2.call$3(b, _s2_, 234); + t2.call$3(b, _s1_3, 172); + t2.call$3(b, _s1_4, 205); + b = t1.call$2(17, 235); + t2.call$3(b, _s77_, 11); + t2.call$3(b, _s1_1, 9); + t2.call$3(b, _s1_2, 233); + t2.call$3(b, _s1_3, 172); + t2.call$3(b, _s1_4, 205); + b = t1.call$2(10, 235); + t2.call$3(b, _s77_, 11); + t2.call$3(b, _s1_, 18); + t2.call$3(b, _s1_1, 10); + t2.call$3(b, _s1_2, 234); + t2.call$3(b, _s1_3, 172); + t2.call$3(b, _s1_4, 205); + b = t1.call$2(18, 235); + t2.call$3(b, _s77_, 11); + t2.call$3(b, _s1_, 19); + t2.call$3(b, _s2_, 234); + t2.call$3(b, _s1_3, 172); + t2.call$3(b, _s1_4, 205); + b = t1.call$2(19, 235); + t2.call$3(b, _s77_, 11); + t2.call$3(b, _s2_, 234); + t2.call$3(b, _s1_3, 172); + t2.call$3(b, _s1_4, 205); + b = t1.call$2(11, 235); + t2.call$3(b, _s77_, 11); + t2.call$3(b, _s1_1, 10); + t2.call$3(b, _s1_2, 234); + t2.call$3(b, _s1_3, 172); + t2.call$3(b, _s1_4, 205); + b = t1.call$2(12, 236); + t2.call$3(b, _s77_, 12); + t2.call$3(b, _s1_3, 12); + t2.call$3(b, _s1_4, 205); + b = t1.call$2(13, 237); + t2.call$3(b, _s77_, 13); + t2.call$3(b, _s1_3, 13); + t3.call$3(t1.call$2(20, 245), "az", 21); + b = t1.call$2(21, 245); + t3.call$3(b, "az", 21); + t3.call$3(b, "09", 21); + t2.call$3(b, "+-.", 21); + return tables; + }, + _scan(uri, start, end, state, indices) { + var i, table, char, transition, + tables = $.$get$_scannerTables(); + for (i = start; i < end; ++i) { + table = tables[state]; + char = uri.charCodeAt(i) ^ 96; + transition = table[char > 95 ? 31 : char]; + state = transition & 31; + indices[transition >>> 5] = i; + } + return state; + }, + _SimpleUri__packageNameEnd(uri) { + if (uri._schemeEnd === 7 && B.JSString_methods.startsWith$1(uri._uri, "package") && uri._hostStart <= 0) + return A._skipPackageNameChars(uri._uri, uri._pathStart, uri._queryStart); + return -1; + }, + _skipPackageNameChars(source, start, end) { + var i, dots, char; + for (i = start, dots = 0; i < end; ++i) { + char = source.charCodeAt(i); + if (char === 47) + return dots !== 0 ? i : -1; + if (char === 37 || char === 58) + return -1; + dots |= char ^ 46; + } + return -1; + }, + _caseInsensitiveCompareStart(prefix, string, start) { + var t1, result, i, stringChar, delta, lowerChar; + for (t1 = prefix.length, result = 0, i = 0; i < t1; ++i) { + stringChar = string.charCodeAt(start + i); + delta = prefix.charCodeAt(i) ^ stringChar; + if (delta !== 0) { + if (delta === 32) { + lowerChar = stringChar | delta; + if (97 <= lowerChar && lowerChar <= 122) { + result = 32; + continue; + } + } + return -1; + } + } + return result; + }, + NoSuchMethodError_toString_closure: function NoSuchMethodError_toString_closure(t0, t1) { + this._box_0 = t0; + this.sb = t1; + }, + DateTime: function DateTime(t0, t1) { + this._core$_value = t0; + this.isUtc = t1; + }, + Duration: function Duration(t0) { + this._duration = t0; + }, + _Enum: function _Enum() { + }, + Error: function Error() { + }, + AssertionError: function AssertionError(t0) { + this.message = t0; + }, + TypeError: function TypeError() { + }, + ArgumentError: function ArgumentError(t0, t1, t2, t3) { + var _ = this; + _._hasValue = t0; + _.invalidValue = t1; + _.name = t2; + _.message = t3; + }, + RangeError: function RangeError(t0, t1, t2, t3, t4, t5) { + var _ = this; + _.start = t0; + _.end = t1; + _._hasValue = t2; + _.invalidValue = t3; + _.name = t4; + _.message = t5; + }, + IndexError: function IndexError(t0, t1, t2, t3, t4) { + var _ = this; + _.length = t0; + _._hasValue = t1; + _.invalidValue = t2; + _.name = t3; + _.message = t4; + }, + NoSuchMethodError: function NoSuchMethodError(t0, t1, t2, t3) { + var _ = this; + _._core$_receiver = t0; + _._memberName = t1; + _._core$_arguments = t2; + _._namedArguments = t3; + }, + UnsupportedError: function UnsupportedError(t0) { + this.message = t0; + }, + UnimplementedError: function UnimplementedError(t0) { + this.message = t0; + }, + StateError: function StateError(t0) { + this.message = t0; + }, + ConcurrentModificationError: function ConcurrentModificationError(t0) { + this.modifiedObject = t0; + }, + OutOfMemoryError: function OutOfMemoryError() { + }, + StackOverflowError: function StackOverflowError() { + }, + _Exception: function _Exception(t0) { + this.message = t0; + }, + FormatException: function FormatException(t0, t1, t2) { + this.message = t0; + this.source = t1; + this.offset = t2; + }, + Iterable: function Iterable() { + }, + _GeneratorIterable: function _GeneratorIterable(t0, t1, t2) { + this.length = t0; + this._generator = t1; + this.$ti = t2; + }, + MapEntry: function MapEntry(t0, t1, t2) { + this.key = t0; + this.value = t1; + this.$ti = t2; + }, + Null: function Null() { + }, + Object: function Object() { + }, + _StringStackTrace: function _StringStackTrace(t0) { + this._stackTrace = t0; + }, + Runes: function Runes(t0) { + this.string = t0; + }, + RuneIterator: function RuneIterator(t0) { + var _ = this; + _.string = t0; + _._nextPosition = _._position = 0; + _._currentCodePoint = -1; + }, + StringBuffer: function StringBuffer(t0) { + this._contents = t0; + }, + Uri__parseIPv4Address_error: function Uri__parseIPv4Address_error(t0) { + this.host = t0; + }, + Uri_parseIPv6Address_error: function Uri_parseIPv6Address_error(t0) { + this.host = t0; + }, + Uri_parseIPv6Address_parseHex: function Uri_parseIPv6Address_parseHex(t0, t1) { + this.error = t0; + this.host = t1; + }, + _Uri: function _Uri(t0, t1, t2, t3, t4, t5, t6) { + var _ = this; + _.scheme = t0; + _._userInfo = t1; + _._host = t2; + _._port = t3; + _.path = t4; + _._query = t5; + _._fragment = t6; + _.___Uri_hashCode_FI = _.___Uri_pathSegments_FI = _.___Uri__text_FI = $; + }, + _Uri__makePath_closure: function _Uri__makePath_closure() { + }, + UriData: function UriData(t0, t1, t2) { + this._text = t0; + this._separatorIndices = t1; + this._uriCache = t2; + }, + _createTables_build: function _createTables_build(t0) { + this.tables = t0; + }, + _createTables_setChars: function _createTables_setChars() { + }, + _createTables_setRange: function _createTables_setRange() { + }, + _SimpleUri: function _SimpleUri(t0, t1, t2, t3, t4, t5, t6, t7) { + var _ = this; + _._uri = t0; + _._schemeEnd = t1; + _._hostStart = t2; + _._portStart = t3; + _._pathStart = t4; + _._queryStart = t5; + _._fragmentStart = t6; + _._schemeCache = t7; + _._hashCodeCache = null; + }, + _DataUri: function _DataUri(t0, t1, t2, t3, t4, t5, t6) { + var _ = this; + _.scheme = t0; + _._userInfo = t1; + _._host = t2; + _._port = t3; + _.path = t4; + _._query = t5; + _._fragment = t6; + _.___Uri_hashCode_FI = _.___Uri_pathSegments_FI = _.___Uri__text_FI = $; + }, + Expando: function Expando(t0) { + this._jsWeakMap = t0; + }, + _convertDartFunctionFast(f) { + var ret, + existing = f.$dart_jsFunction; + if (existing != null) + return existing; + ret = function(_call, f) { + return function() { + return _call(f, Array.prototype.slice.apply(arguments)); + }; + }(A._callDartFunctionFast, f); + ret[$.$get$DART_CLOSURE_PROPERTY_NAME()] = f; + f.$dart_jsFunction = ret; + return ret; + }, + _convertDartFunctionFastCaptureThis(f) { + var ret, + existing = f._$dart_jsFunctionCaptureThis; + if (existing != null) + return existing; + ret = function(_call, f) { + return function() { + return _call(f, this, Array.prototype.slice.apply(arguments)); + }; + }(A._callDartFunctionFastCaptureThis, f); + ret[$.$get$DART_CLOSURE_PROPERTY_NAME()] = f; + f._$dart_jsFunctionCaptureThis = ret; + return ret; + }, + _callDartFunctionFast(callback, $arguments) { + return A.Function_apply(callback, $arguments); + }, + _callDartFunctionFastCaptureThis(callback, $self, $arguments) { + var t1 = [$self]; + B.JSArray_methods.addAll$1(t1, $arguments); + return A.Function_apply(callback, t1); + }, + allowInterop(f) { + if (typeof f == "function") + return f; + else + return A._convertDartFunctionFast(f); + }, + allowInteropCaptureThis(f) { + if (typeof f == "function") + throw A.wrapException(A.ArgumentError$("Function is already a JS function so cannot capture this.", null)); + else + return A._convertDartFunctionFastCaptureThis(f); + }, + _noJsifyRequired(o) { + return o == null || A._isBool(o) || typeof o == "number" || typeof o == "string" || type$.Int8List._is(o) || type$.Uint8List._is(o) || type$.Uint8ClampedList._is(o) || type$.Int16List._is(o) || type$.Uint16List._is(o) || type$.Int32List._is(o) || type$.Uint32List._is(o) || type$.Float32List._is(o) || type$.Float64List._is(o) || type$.ByteBuffer._is(o) || type$.ByteData._is(o); + }, + jsify0(object) { + if (A._noJsifyRequired(object)) + return object; + return new A.jsify__convert(new A._IdentityHashMap(type$._IdentityHashMap_of_nullable_Object_and_nullable_Object)).call$1(object); + }, + callConstructor(constr, $arguments) { + var args, factoryFunction; + if ($arguments instanceof Array) + switch ($arguments.length) { + case 0: + return new constr(); + case 1: + return new constr($arguments[0]); + case 2: + return new constr($arguments[0], $arguments[1]); + case 3: + return new constr($arguments[0], $arguments[1], $arguments[2]); + case 4: + return new constr($arguments[0], $arguments[1], $arguments[2], $arguments[3]); + } + args = [null]; + B.JSArray_methods.addAll$1(args, $arguments); + factoryFunction = constr.bind.apply(constr, args); + String(factoryFunction); + return new factoryFunction(); + }, + promiseToFuture0(jsPromise, $T) { + var t1 = new A._Future($.Zone__current, $T._eval$1("_Future<0>")), + completer = new A._AsyncCompleter(t1, $T._eval$1("_AsyncCompleter<0>")); + jsPromise.then(A.convertDartClosureToJS(new A.promiseToFuture_closure1(completer), 1), A.convertDartClosureToJS(new A.promiseToFuture_closure2(completer), 1)); + return t1; + }, + jsify__convert: function jsify__convert(t0) { + this._convertedObjects = t0; + }, + promiseToFuture_closure1: function promiseToFuture_closure1(t0) { + this.completer = t0; + }, + promiseToFuture_closure2: function promiseToFuture_closure2(t0) { + this.completer = t0; + }, + NullRejectionException: function NullRejectionException(t0) { + this.isUndefined = t0; + }, + max(a, b) { + return Math.max(a, b); + }, + pow(x, exponent) { + return Math.pow(x, exponent); + }, + Random_Random() { + return B.C__JSRandom; + }, + _JSRandom: function _JSRandom() { + }, + ArgParser: function ArgParser(t0, t1, t2, t3, t4, t5, t6) { + var _ = this; + _._arg_parser$_options = t0; + _._aliases = t1; + _.options = t2; + _.commands = t3; + _._optionsAndSeparators = t4; + _.allowTrailingOptions = t5; + _.usageLineLength = t6; + }, + ArgParser__addOption_closure: function ArgParser__addOption_closure(t0) { + this.$this = t0; + }, + ArgParserException$(message, commands) { + return new A.ArgParserException(commands == null ? B.List_empty : A.List_List$unmodifiable(commands, type$.String), message, null, null); + }, + ArgParserException: function ArgParserException(t0, t1, t2, t3) { + var _ = this; + _.commands = t0; + _.message = t1; + _.source = t2; + _.offset = t3; + }, + ArgResults: function ArgResults(t0, t1, t2, t3) { + var _ = this; + _._parser = t0; + _._parsed = t1; + _.name = t2; + _.rest = t3; + }, + Option: function Option(t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12) { + var _ = this; + _.name = t0; + _.abbr = t1; + _.help = t2; + _.valueHelp = t3; + _.allowed = t4; + _.allowedHelp = t5; + _.defaultsTo = t6; + _.negatable = t7; + _.callback = t8; + _.type = t9; + _.splitCommas = t10; + _.mandatory = t11; + _.hide = t12; + }, + OptionType: function OptionType(t0) { + this.name = t0; + }, + Parser$(_commandName, _grammar, _args, _parent, rest) { + var t1 = A._setArrayType([], type$.JSArray_String); + if (rest != null) + B.JSArray_methods.addAll$1(t1, rest); + return new A.Parser0(_commandName, _parent, _grammar, _args, t1, A.LinkedHashMap_LinkedHashMap$_empty(type$.String, type$.dynamic)); + }, + _isLetterOrDigit(codeUnit) { + var t1; + if (!(codeUnit >= 65 && codeUnit <= 90)) + if (!(codeUnit >= 97 && codeUnit <= 122)) + t1 = codeUnit >= 48 && codeUnit <= 57; + else + t1 = true; + else + t1 = true; + return t1; + }, + Parser0: function Parser0(t0, t1, t2, t3, t4, t5) { + var _ = this; + _._commandName = t0; + _._parser$_parent = t1; + _._grammar = t2; + _._args = t3; + _._parser$_rest = t4; + _._results = t5; + }, + Parser_parse_closure: function Parser_parse_closure(t0) { + this.$this = t0; + }, + Parser__setOption_closure: function Parser__setOption_closure() { + }, + _Usage: function _Usage(t0, t1, t2) { + var _ = this; + _._usage$_optionsAndSeparators = t0; + _._usage$_buffer = t1; + _._currentColumn = 0; + _.___Usage__columnWidths_FI = $; + _._newlinesNeeded = 0; + _.lineLength = t2; + }, + _Usage__writeOption_closure: function _Usage__writeOption_closure() { + }, + _Usage__buildAllowedList_closure: function _Usage__buildAllowedList_closure(t0) { + this.option = t0; + }, + FutureGroup: function FutureGroup(t0, t1, t2) { + var _ = this; + _._future_group$_pending = 0; + _._future_group$_closed = false; + _._future_group$_completer = t0; + _._future_group$_values = t1; + _.$ti = t2; + }, + FutureGroup_add_closure: function FutureGroup_add_closure(t0, t1) { + this.$this = t0; + this.index = t1; + }, + FutureGroup_add_closure0: function FutureGroup_add_closure0(t0) { + this.$this = t0; + }, + ErrorResult: function ErrorResult(t0, t1) { + this.error = t0; + this.stackTrace = t1; + }, + ValueResult: function ValueResult(t0, t1) { + this.value = t0; + this.$ti = t1; + }, + StreamCompleter: function StreamCompleter(t0, t1) { + this._stream_completer$_stream = t0; + this.$ti = t1; + }, + _CompleterStream: function _CompleterStream(t0) { + this._sourceStream = this._stream_completer$_controller = null; + this.$ti = t0; + }, + StreamGroup: function StreamGroup(t0, t1, t2) { + var _ = this; + _.__StreamGroup__controller_A = $; + _._closed = false; + _._stream_group$_state = t0; + _._subscriptions = t1; + _.$ti = t2; + }, + StreamGroup_add_closure: function StreamGroup_add_closure() { + }, + StreamGroup_add_closure0: function StreamGroup_add_closure0(t0, t1) { + this.$this = t0; + this.stream = t1; + }, + StreamGroup__onListen_closure: function StreamGroup__onListen_closure() { + }, + StreamGroup__onCancel_closure: function StreamGroup__onCancel_closure(t0) { + this.$this = t0; + }, + StreamGroup__listenToStream_closure: function StreamGroup__listenToStream_closure(t0, t1) { + this.$this = t0; + this.stream = t1; + }, + _StreamGroupState: function _StreamGroupState(t0) { + this.name = t0; + }, + StreamQueue: function StreamQueue(t0, t1, t2, t3) { + var _ = this; + _._stream_queue$_source = t0; + _._stream_queue$_subscription = null; + _._isDone = false; + _._eventsReceived = 0; + _._eventQueue = t1; + _._requestQueue = t2; + _.$ti = t3; + }, + StreamQueue__ensureListening_closure: function StreamQueue__ensureListening_closure(t0) { + this.$this = t0; + }, + StreamQueue__ensureListening_closure1: function StreamQueue__ensureListening_closure1(t0) { + this.$this = t0; + }, + StreamQueue__ensureListening_closure0: function StreamQueue__ensureListening_closure0(t0) { + this.$this = t0; + }, + _NextRequest: function _NextRequest(t0, t1) { + this._completer = t0; + this.$ti = t1; + }, + isNodeJs() { + var t1 = self.process; + if (t1 == null) + t1 = null; + else { + t1 = J.get$release$x(t1); + t1 = t1 == null ? null : J.get$name$x(t1); + } + return J.$eq$(t1, "node"); + }, + isBrowser() { + return !A.isNodeJs() && self.document != null && typeof self.document.querySelector == "function"; + }, + wrapJSExceptions(callback) { + var error, error0, error1, error2, t1, exception; + if (!$.$get$_isStrictMode()) + return callback.call$0(); + try { + t1 = callback.call$0(); + return t1; + } catch (exception) { + t1 = A.unwrapException(exception); + if (typeof t1 == "string") { + error = t1; + throw A.wrapException(error); + } else if (A._isBool(t1)) { + error0 = t1; + throw A.wrapException(error0); + } else if (typeof t1 == "number") { + error1 = t1; + throw A.wrapException(error1); + } else { + error2 = t1; + if (typeof error2 == "symbol" || typeof error2 == "bigint" || error2 == null) + throw A.wrapException(error2.toString()); + throw exception; + } + } + }, + _isStrictMode_closure: function _isStrictMode_closure() { + }, + Repl: function Repl(t0, t1, t2, t3) { + var _ = this; + _.prompt = t0; + _.continuation = t1; + _.validator = t2; + _.__Repl__adapter_A = $; + _.history = t3; + }, + alwaysValid_closure: function alwaysValid_closure() { + }, + ReplAdapter: function ReplAdapter(t0) { + this.repl = t0; + this.rl = null; + }, + ReplAdapter_runAsync_closure: function ReplAdapter_runAsync_closure(t0, t1, t2, t3) { + var _ = this; + _._box_0 = t0; + _.$this = t1; + _.rl = t2; + _.runController = t3; + }, + ReplAdapter_runAsync__closure: function ReplAdapter_runAsync__closure(t0) { + this.lineController = t0; + }, + Stdin: function Stdin() { + }, + Stdout: function Stdout() { + }, + ReadlineModule: function ReadlineModule() { + }, + ReadlineOptions: function ReadlineOptions() { + }, + ReadlineInterface: function ReadlineInterface() { + }, + EmptyUnmodifiableSet: function EmptyUnmodifiableSet(t0) { + this.$ti = t0; + }, + _EmptyUnmodifiableSet_IterableBase_UnmodifiableSetMixin: function _EmptyUnmodifiableSet_IterableBase_UnmodifiableSetMixin() { + }, + DefaultEquality: function DefaultEquality() { + }, + IterableEquality: function IterableEquality() { + }, + ListEquality: function ListEquality() { + }, + _MapEntry: function _MapEntry(t0, t1, t2) { + this.equality = t0; + this.key = t1; + this.value = t2; + }, + MapEquality: function MapEquality(t0) { + this.$ti = t0; + }, + QueueList$(initialCapacity, $E) { + return new A.QueueList(A.List_List$filled(A.QueueList__computeInitialCapacity(initialCapacity), null, false, $E._eval$1("0?")), 0, 0, $E._eval$1("QueueList<0>")); + }, + QueueList_QueueList$from(source, $E) { + var $length, queue, t1; + if (type$.List_dynamic._is(source)) { + $length = J.get$length$asx(source); + queue = A.QueueList$($length + 1, $E); + J.setRange$4$ax(queue._queue_list$_table, 0, $length, source, 0); + queue._queue_list$_tail = $length; + return queue; + } else { + t1 = A.QueueList$(null, $E); + t1.addAll$1(0, source); + return t1; + } + }, + QueueList__computeInitialCapacity(initialCapacity) { + if (initialCapacity == null || initialCapacity < 8) + return 8; + ++initialCapacity; + if ((initialCapacity & initialCapacity - 1) >>> 0 === 0) + return initialCapacity; + return A.QueueList__nextPowerOf2(initialCapacity); + }, + QueueList__nextPowerOf2(number) { + var nextNumber; + number = (number << 1 >>> 0) - 1; + for (; true; number = nextNumber) { + nextNumber = (number & number - 1) >>> 0; + if (nextNumber === 0) + return number; + } + }, + QueueList: function QueueList(t0, t1, t2, t3) { + var _ = this; + _._queue_list$_table = t0; + _._queue_list$_head = t1; + _._queue_list$_tail = t2; + _.$ti = t3; + }, + _CastQueueList: function _CastQueueList(t0, t1, t2, t3, t4) { + var _ = this; + _._queue_list$_delegate = t0; + _._queue_list$_table = t1; + _._queue_list$_head = t2; + _._queue_list$_tail = t3; + _.$ti = t4; + }, + _QueueList_Object_ListMixin: function _QueueList_Object_ListMixin() { + }, + UnionSet: function UnionSet(t0, t1) { + this._sets = t0; + this.$ti = t1; + }, + UnionSet__iterable_closure: function UnionSet__iterable_closure(t0) { + this.$this = t0; + }, + UnionSet_contains_closure: function UnionSet_contains_closure(t0, t1) { + this.$this = t0; + this.element = t1; + }, + _UnionSet_SetBase_UnmodifiableSetMixin: function _UnionSet_SetBase_UnmodifiableSetMixin() { + }, + UnmodifiableSetMixin__throw() { + throw A.wrapException(A.UnsupportedError$("Cannot modify an unmodifiable Set")); + }, + UnmodifiableSetView0: function UnmodifiableSetView0(t0, t1) { + this._base = t0; + this.$ti = t1; + }, + UnmodifiableSetMixin: function UnmodifiableSetMixin() { + }, + _UnmodifiableSetView_DelegatingSet_UnmodifiableSetMixin: function _UnmodifiableSetView_DelegatingSet_UnmodifiableSetMixin() { + }, + _DelegatingIterableBase: function _DelegatingIterableBase() { + }, + DelegatingSet: function DelegatingSet(t0, t1) { + this._base = t0; + this.$ti = t1; + }, + MapKeySet: function MapKeySet(t0, t1) { + this._baseMap = t0; + this.$ti = t1; + }, + MapKeySet_difference_closure: function MapKeySet_difference_closure(t0, t1) { + this.$this = t0; + this.other = t1; + }, + _MapKeySet__DelegatingIterableBase_UnmodifiableSetMixin: function _MapKeySet__DelegatingIterableBase_UnmodifiableSetMixin() { + }, + BufferModule: function BufferModule() { + }, + BufferConstants: function BufferConstants() { + }, + Buffer: function Buffer() { + }, + ConsoleModule: function ConsoleModule() { + }, + Console: function Console() { + }, + EventEmitter: function EventEmitter() { + }, + fs() { + var t1 = $._fs; + return t1 == null ? $._fs = self.fs : t1; + }, + FS: function FS() { + }, + FSConstants: function FSConstants() { + }, + FSWatcher: function FSWatcher() { + }, + ReadStream: function ReadStream() { + }, + ReadStreamOptions: function ReadStreamOptions() { + }, + WriteStream: function WriteStream() { + }, + WriteStreamOptions: function WriteStreamOptions() { + }, + FileOptions: function FileOptions() { + }, + StatOptions: function StatOptions() { + }, + MkdirOptions: function MkdirOptions() { + }, + RmdirOptions: function RmdirOptions() { + }, + WatchOptions: function WatchOptions() { + }, + WatchFileOptions: function WatchFileOptions() { + }, + Stats: function Stats() { + }, + Promise: function Promise() { + }, + Date: function Date() { + }, + JsError: function JsError() { + }, + Atomics: function Atomics() { + }, + Modules: function Modules() { + }, + Module: function Module() { + }, + Net: function Net() { + }, + Socket: function Socket() { + }, + NetAddress: function NetAddress() { + }, + NetServer: function NetServer() { + }, + NodeJsError: function NodeJsError() { + }, + JsAssertionError: function JsAssertionError() { + }, + JsRangeError: function JsRangeError() { + }, + JsReferenceError: function JsReferenceError() { + }, + JsSyntaxError: function JsSyntaxError() { + }, + JsTypeError: function JsTypeError() { + }, + JsSystemError: function JsSystemError() { + }, + Process: function Process() { + }, + CPUUsage: function CPUUsage() { + }, + Release: function Release() { + }, + StreamModule: function StreamModule() { + }, + Readable: function Readable() { + }, + Writable: function Writable() { + }, + Duplex: function Duplex() { + }, + Transform: function Transform() { + }, + WritableOptions: function WritableOptions() { + }, + ReadableOptions: function ReadableOptions() { + }, + Immediate: function Immediate() { + }, + Timeout: function Timeout() { + }, + TTY: function TTY() { + }, + TTYReadStream: function TTYReadStream() { + }, + TTYWriteStream: function TTYWriteStream() { + }, + jsify(dartObject) { + if (A._isBasicType(dartObject)) + return dartObject; + return A.jsify0(dartObject); + }, + _isBasicType(value) { + var t1 = false; + if (t1) + return true; + return false; + }, + promiseToFuture(promise, $T) { + var t1 = new A._Future($.Zone__current, $T._eval$1("_Future<0>")), + completer = new A._SyncCompleter(t1, $T._eval$1("_SyncCompleter<0>")); + J.then$2$x(promise, A.allowInterop(new A.promiseToFuture_closure(completer)), A.allowInterop(new A.promiseToFuture_closure0(completer))); + return t1; + }, + futureToPromise(future, $T) { + return new self.Promise(A.allowInterop(new A.futureToPromise_closure(future, $T))); + }, + Util: function Util() { + }, + promiseToFuture_closure: function promiseToFuture_closure(t0) { + this.completer = t0; + }, + promiseToFuture_closure0: function promiseToFuture_closure0(t0) { + this.completer = t0; + }, + futureToPromise_closure: function futureToPromise_closure(t0, t1) { + this.future = t0; + this.T = t1; + }, + futureToPromise__closure: function futureToPromise__closure(t0, t1) { + this.resolve = t0; + this.T = t1; + }, + Context_Context(style) { + return new A.Context(style, "."); + }, + _parseUri(uri) { + if (typeof uri == "string") + return A.Uri_parse(uri); + if (type$.Uri._is(uri)) + return uri; + throw A.wrapException(A.ArgumentError$value(uri, "uri", "Value must be a String or a Uri")); + }, + _validateArgList(method, args) { + var numArgs, i, numArgs0, message, t1, t2, t3, t4; + for (numArgs = args.length, i = 1; i < numArgs; ++i) { + if (args[i] == null || args[i - 1] != null) + continue; + for (; numArgs >= 1; numArgs = numArgs0) { + numArgs0 = numArgs - 1; + if (args[numArgs0] != null) + break; + } + message = new A.StringBuffer(""); + t1 = "" + (method + "("); + message._contents = t1; + t2 = A._arrayInstanceType(args); + t3 = t2._eval$1("SubListIterable<1>"); + t4 = new A.SubListIterable(args, 0, numArgs, t3); + t4.SubListIterable$3(args, 0, numArgs, t2._precomputed1); + t3 = t1 + new A.MappedListIterable(t4, new A._validateArgList_closure(), t3._eval$1("MappedListIterable")).join$1(0, ", "); + message._contents = t3; + message._contents = t3 + ("): part " + (i - 1) + " was null, but part " + i + " was not."); + throw A.wrapException(A.ArgumentError$(message.toString$0(0), null)); + } + }, + Context: function Context(t0, t1) { + this.style = t0; + this._context$_current = t1; + }, + Context_joinAll_closure: function Context_joinAll_closure() { + }, + Context_split_closure: function Context_split_closure() { + }, + _validateArgList_closure: function _validateArgList_closure() { + }, + _PathDirection: function _PathDirection(t0) { + this.name = t0; + }, + _PathRelation: function _PathRelation(t0) { + this.name = t0; + }, + InternalStyle: function InternalStyle() { + }, + ParsedPath_ParsedPath$parse(path, style) { + var t1, parts, separators, start, i, + root = style.getRoot$1(path), + isRootRelative = style.isRootRelative$1(path); + if (root != null) + path = B.JSString_methods.substring$1(path, root.length); + t1 = type$.JSArray_String; + parts = A._setArrayType([], t1); + separators = A._setArrayType([], t1); + t1 = path.length; + if (t1 !== 0 && style.isSeparator$1(path.charCodeAt(0))) { + separators.push(path[0]); + start = 1; + } else { + separators.push(""); + start = 0; + } + for (i = start; i < t1; ++i) + if (style.isSeparator$1(path.charCodeAt(i))) { + parts.push(B.JSString_methods.substring$2(path, start, i)); + separators.push(path[i]); + start = i + 1; + } + if (start < t1) { + parts.push(B.JSString_methods.substring$1(path, start)); + separators.push(""); + } + return new A.ParsedPath(style, root, isRootRelative, parts, separators); + }, + ParsedPath: function ParsedPath(t0, t1, t2, t3, t4) { + var _ = this; + _.style = t0; + _.root = t1; + _.isRootRelative = t2; + _.parts = t3; + _.separators = t4; + }, + ParsedPath__splitExtension_closure: function ParsedPath__splitExtension_closure() { + }, + ParsedPath__splitExtension_closure0: function ParsedPath__splitExtension_closure0() { + }, + PathException$(message) { + return new A.PathException(message); + }, + PathException: function PathException(t0) { + this.message = t0; + }, + PathMap__create(context, $V) { + var t1 = {}; + t1.context = context; + t1.context = $.$get$context(); + return A.LinkedHashMap_LinkedHashMap(new A.PathMap__create_closure(t1), new A.PathMap__create_closure0(t1), new A.PathMap__create_closure1(), type$.nullable_String, $V); + }, + PathMap: function PathMap(t0, t1) { + this._map = t0; + this.$ti = t1; + }, + PathMap__create_closure: function PathMap__create_closure(t0) { + this._box_0 = t0; + }, + PathMap__create_closure0: function PathMap__create_closure0(t0) { + this._box_0 = t0; + }, + PathMap__create_closure1: function PathMap__create_closure1() { + }, + Style__getPlatformStyle() { + if (A.Uri_base().get$scheme() !== "file") + return $.$get$Style_url(); + var t1 = A.Uri_base(); + if (!B.JSString_methods.endsWith$1(t1.get$path(t1), "/")) + return $.$get$Style_url(); + if (A._Uri__Uri(null, "a/b", null, null).toFilePath$0() === "a\\b") + return $.$get$Style_windows(); + return $.$get$Style_posix(); + }, + Style: function Style() { + }, + PosixStyle: function PosixStyle(t0, t1, t2) { + this.separatorPattern = t0; + this.needsSeparatorPattern = t1; + this.rootPattern = t2; + }, + UrlStyle: function UrlStyle(t0, t1, t2, t3) { + var _ = this; + _.separatorPattern = t0; + _.needsSeparatorPattern = t1; + _.rootPattern = t2; + _.relativeRootPattern = t3; + }, + WindowsStyle: function WindowsStyle(t0, t1, t2, t3) { + var _ = this; + _.separatorPattern = t0; + _.needsSeparatorPattern = t1; + _.rootPattern = t2; + _.relativeRootPattern = t3; + }, + WindowsStyle_absolutePathToUri_closure: function WindowsStyle_absolutePathToUri_closure() { + }, + Version$_(major, minor, patch, preRelease, build, _text) { + var t1 = preRelease == null ? A._setArrayType([], type$.JSArray_Object) : A.Version__splitParts(preRelease), + t2 = build == null ? A._setArrayType([], type$.JSArray_Object) : A.Version__splitParts(build); + if (major < 0) + A.throwExpression(A.ArgumentError$("Major version must be non-negative.", null)); + if (minor < 0) + A.throwExpression(A.ArgumentError$("Minor version must be non-negative.", null)); + if (patch < 0) + A.throwExpression(A.ArgumentError$("Patch version must be non-negative.", null)); + return new A.Version(major, minor, patch, t1, t2, _text); + }, + Version___parse_tearOff(text) { + return A.Version_Version$parse(text); + }, + Version_Version$parse(text) { + var major, minor, patch, preRelease, build, t1, exception, _null = null, + _s17_ = 'Could not parse "', + match = $.$get$completeVersion().firstMatch$1(text); + if (match == null) + throw A.wrapException(A.FormatException$(_s17_ + text + '".', _null, _null)); + try { + t1 = match._match[1]; + t1.toString; + major = A.int_parse(t1, _null); + t1 = match._match[2]; + t1.toString; + minor = A.int_parse(t1, _null); + t1 = match._match[3]; + t1.toString; + patch = A.int_parse(t1, _null); + preRelease = match._match[5]; + build = match._match[8]; + t1 = A.Version$_(major, minor, patch, preRelease, build, text); + return t1; + } catch (exception) { + if (type$.FormatException._is(A.unwrapException(exception))) + throw A.wrapException(A.FormatException$(_s17_ + text + '".', _null, _null)); + else + throw exception; + } + }, + Version__splitParts(text) { + var t1 = type$.MappedListIterable_String_Object; + return A.List_List$of(new A.MappedListIterable(A._setArrayType(text.split("."), type$.JSArray_String), new A.Version__splitParts_closure(), t1), true, t1._eval$1("ListIterable.E")); + }, + Version: function Version(t0, t1, t2, t3, t4, t5) { + var _ = this; + _.major = t0; + _.minor = t1; + _.patch = t2; + _.preRelease = t3; + _.build = t4; + _._version$_text = t5; + }, + Version__splitParts_closure: function Version__splitParts_closure() { + }, + VersionRange: function VersionRange(t0, t1, t2, t3) { + var _ = this; + _.min = t0; + _.max = t1; + _.includeMin = t2; + _.includeMax = t3; + }, + CssMediaQuery_parseList(contents, interpolationMap, logger) { + var t1 = A.SpanScanner$(contents, null); + return new A.MediaQueryParser(t1, logger, interpolationMap).parse$0(); + }, + CssMediaQuery$type(type, conditions, modifier) { + return new A.CssMediaQuery(modifier, type, true, conditions == null ? B.List_empty : A.List_List$unmodifiable(conditions, type$.String)); + }, + CssMediaQuery$condition(conditions, conjunction) { + var t1 = A.List_List$unmodifiable(conditions, type$.String); + if (t1.length > 1 && conjunction == null) + A.throwExpression(A.ArgumentError$(string$.If_con, null)); + return new A.CssMediaQuery(null, null, conjunction !== false, t1); + }, + CssMediaQuery: function CssMediaQuery(t0, t1, t2, t3) { + var _ = this; + _.modifier = t0; + _.type = t1; + _.conjunction = t2; + _.conditions = t3; + }, + _SingletonCssMediaQueryMergeResult: function _SingletonCssMediaQueryMergeResult(t0) { + this._name = t0; + }, + MediaQuerySuccessfulMergeResult: function MediaQuerySuccessfulMergeResult(t0) { + this.query = t0; + }, + ModifiableCssAtRule$($name, span, childless, value) { + var t1 = A._setArrayType([], type$.JSArray_ModifiableCssNode); + return new A.ModifiableCssAtRule($name, value, childless, span, new A.UnmodifiableListView(t1, type$.UnmodifiableListView_ModifiableCssNode), t1); + }, + ModifiableCssAtRule: function ModifiableCssAtRule(t0, t1, t2, t3, t4, t5) { + var _ = this; + _.name = t0; + _.value = t1; + _.isChildless = t2; + _.span = t3; + _.children = t4; + _._children = t5; + _._indexInParent = _._parent = null; + _.isGroupEnd = false; + }, + ModifiableCssComment: function ModifiableCssComment(t0, t1) { + var _ = this; + _.text = t0; + _.span = t1; + _._indexInParent = _._parent = null; + _.isGroupEnd = false; + }, + ModifiableCssDeclaration$($name, value, span, parsedAsCustomProperty, valueSpanForMap) { + var t2, + t1 = valueSpanForMap == null ? value.span : valueSpanForMap; + if (parsedAsCustomProperty) + if (!J.startsWith$1$s($name.value, "--")) + A.throwExpression(A.ArgumentError$(string$.parsed, null)); + else { + t2 = value.value; + if (!(t2 instanceof A.SassString)) + A.throwExpression(A.ArgumentError$(string$.If_par + value.toString$0(0) + "` of type " + A.getRuntimeTypeOfDartObject(t2).toString$0(0) + ").", null)); + } + return new A.ModifiableCssDeclaration($name, value, parsedAsCustomProperty, t1, span); + }, + ModifiableCssDeclaration: function ModifiableCssDeclaration(t0, t1, t2, t3, t4) { + var _ = this; + _.name = t0; + _.value = t1; + _.parsedAsCustomProperty = t2; + _.valueSpanForMap = t3; + _.span = t4; + _._indexInParent = _._parent = null; + _.isGroupEnd = false; + }, + ModifiableCssImport: function ModifiableCssImport(t0, t1, t2) { + var _ = this; + _.url = t0; + _.modifiers = t1; + _.span = t2; + _._indexInParent = _._parent = null; + _.isGroupEnd = false; + }, + ModifiableCssKeyframeBlock$(selector, span) { + var t1 = A._setArrayType([], type$.JSArray_ModifiableCssNode); + return new A.ModifiableCssKeyframeBlock(selector, span, new A.UnmodifiableListView(t1, type$.UnmodifiableListView_ModifiableCssNode), t1); + }, + ModifiableCssKeyframeBlock: function ModifiableCssKeyframeBlock(t0, t1, t2, t3) { + var _ = this; + _.selector = t0; + _.span = t1; + _.children = t2; + _._children = t3; + _._indexInParent = _._parent = null; + _.isGroupEnd = false; + }, + ModifiableCssMediaRule$(queries, span) { + var t1 = A.List_List$unmodifiable(queries, type$.CssMediaQuery), + t2 = A._setArrayType([], type$.JSArray_ModifiableCssNode); + if (J.get$isEmpty$asx(queries)) + A.throwExpression(A.ArgumentError$value(queries, "queries", "may not be empty.")); + return new A.ModifiableCssMediaRule(t1, span, new A.UnmodifiableListView(t2, type$.UnmodifiableListView_ModifiableCssNode), t2); + }, + ModifiableCssMediaRule: function ModifiableCssMediaRule(t0, t1, t2, t3) { + var _ = this; + _.queries = t0; + _.span = t1; + _.children = t2; + _._children = t3; + _._indexInParent = _._parent = null; + _.isGroupEnd = false; + }, + ModifiableCssNode: function ModifiableCssNode() { + }, + ModifiableCssNode_hasFollowingSibling_closure: function ModifiableCssNode_hasFollowingSibling_closure() { + }, + ModifiableCssParentNode: function ModifiableCssParentNode() { + }, + ModifiableCssStyleRule$(_selector, span, originalSelector) { + var t1 = A._setArrayType([], type$.JSArray_ModifiableCssNode); + return new A.ModifiableCssStyleRule(_selector, originalSelector, span, new A.UnmodifiableListView(t1, type$.UnmodifiableListView_ModifiableCssNode), t1); + }, + ModifiableCssStyleRule: function ModifiableCssStyleRule(t0, t1, t2, t3, t4) { + var _ = this; + _._style_rule$_selector = t0; + _.originalSelector = t1; + _.span = t2; + _.children = t3; + _._children = t4; + _._indexInParent = _._parent = null; + _.isGroupEnd = false; + }, + ModifiableCssStylesheet$(span) { + var t1 = A._setArrayType([], type$.JSArray_ModifiableCssNode); + return new A.ModifiableCssStylesheet(span, new A.UnmodifiableListView(t1, type$.UnmodifiableListView_ModifiableCssNode), t1); + }, + ModifiableCssStylesheet: function ModifiableCssStylesheet(t0, t1, t2) { + var _ = this; + _.span = t0; + _.children = t1; + _._children = t2; + _._indexInParent = _._parent = null; + _.isGroupEnd = false; + }, + ModifiableCssSupportsRule$(condition, span) { + var t1 = A._setArrayType([], type$.JSArray_ModifiableCssNode); + return new A.ModifiableCssSupportsRule(condition, span, new A.UnmodifiableListView(t1, type$.UnmodifiableListView_ModifiableCssNode), t1); + }, + ModifiableCssSupportsRule: function ModifiableCssSupportsRule(t0, t1, t2, t3) { + var _ = this; + _.condition = t0; + _.span = t1; + _.children = t2; + _._children = t3; + _._indexInParent = _._parent = null; + _.isGroupEnd = false; + }, + CssNode: function CssNode() { + }, + CssParentNode: function CssParentNode() { + }, + _IsInvisibleVisitor: function _IsInvisibleVisitor(t0, t1) { + this.includeBogus = t0; + this.includeComments = t1; + }, + __IsInvisibleVisitor_Object_EveryCssVisitor: function __IsInvisibleVisitor_Object_EveryCssVisitor() { + }, + CssStylesheet: function CssStylesheet(t0, t1) { + this.children = t0; + this.span = t1; + }, + CssValue: function CssValue(t0, t1, t2) { + this.value = t0; + this.span = t1; + this.$ti = t2; + }, + _FakeAstNode: function _FakeAstNode(t0) { + this._callback = t0; + }, + Argument: function Argument(t0, t1, t2) { + this.name = t0; + this.defaultValue = t1; + this.span = t2; + }, + ArgumentDeclaration_ArgumentDeclaration$parse(contents, url) { + return A.ScssParser$(contents, null, url).parseArgumentDeclaration$0(); + }, + ArgumentDeclaration: function ArgumentDeclaration(t0, t1, t2) { + this.$arguments = t0; + this.restArgument = t1; + this.span = t2; + }, + ArgumentDeclaration_verify_closure: function ArgumentDeclaration_verify_closure() { + }, + ArgumentDeclaration_verify_closure0: function ArgumentDeclaration_verify_closure0() { + }, + ArgumentInvocation$empty(span) { + return new A.ArgumentInvocation(B.List_empty9, B.Map_empty6, null, null, span); + }, + ArgumentInvocation: function ArgumentInvocation(t0, t1, t2, t3, t4) { + var _ = this; + _.positional = t0; + _.named = t1; + _.rest = t2; + _.keywordRest = t3; + _.span = t4; + }, + AtRootQuery: function AtRootQuery(t0, t1, t2, t3) { + var _ = this; + _.include = t0; + _.names = t1; + _._all = t2; + _._at_root_query$_rule = t3; + }, + ConfiguredVariable: function ConfiguredVariable(t0, t1, t2, t3) { + var _ = this; + _.name = t0; + _.expression = t1; + _.isGuarded = t2; + _.span = t3; + }, + _IsCalculationSafeVisitor: function _IsCalculationSafeVisitor() { + }, + _IsCalculationSafeVisitor_visitListExpression_closure: function _IsCalculationSafeVisitor_visitListExpression_closure(t0) { + this.$this = t0; + }, + BinaryOperationExpression: function BinaryOperationExpression(t0, t1, t2, t3) { + var _ = this; + _.operator = t0; + _.left = t1; + _.right = t2; + _.allowsSlash = t3; + }, + BinaryOperator: function BinaryOperator(t0, t1, t2, t3, t4) { + var _ = this; + _.name = t0; + _.operator = t1; + _.precedence = t2; + _.isAssociative = t3; + _._name = t4; + }, + BooleanExpression: function BooleanExpression(t0, t1) { + this.value = t0; + this.span = t1; + }, + ColorExpression: function ColorExpression(t0, t1) { + this.value = t0; + this.span = t1; + }, + FunctionExpression: function FunctionExpression(t0, t1, t2, t3) { + var _ = this; + _.namespace = t0; + _.originalName = t1; + _.$arguments = t2; + _.span = t3; + }, + IfExpression: function IfExpression(t0, t1) { + this.$arguments = t0; + this.span = t1; + }, + InterpolatedFunctionExpression: function InterpolatedFunctionExpression(t0, t1, t2) { + this.name = t0; + this.$arguments = t1; + this.span = t2; + }, + ListExpression: function ListExpression(t0, t1, t2, t3) { + var _ = this; + _.contents = t0; + _.separator = t1; + _.hasBrackets = t2; + _.span = t3; + }, + ListExpression_toString_closure: function ListExpression_toString_closure(t0) { + this.$this = t0; + }, + MapExpression: function MapExpression(t0, t1) { + this.pairs = t0; + this.span = t1; + }, + NullExpression: function NullExpression(t0) { + this.span = t0; + }, + NumberExpression: function NumberExpression(t0, t1, t2) { + this.value = t0; + this.unit = t1; + this.span = t2; + }, + ParenthesizedExpression: function ParenthesizedExpression(t0, t1) { + this.expression = t0; + this.span = t1; + }, + SelectorExpression: function SelectorExpression(t0) { + this.span = t0; + }, + StringExpression_quoteText(text) { + var t1, + quote = A.StringExpression__bestQuote(A._setArrayType([text], type$.JSArray_String)), + buffer = new A.StringBuffer(""); + buffer._contents = "" + A.Primitives_stringFromCharCode(quote); + A.StringExpression__quoteInnerText(text, quote, buffer, true); + t1 = buffer._contents += A.Primitives_stringFromCharCode(quote); + return t1.charCodeAt(0) == 0 ? t1 : t1; + }, + StringExpression__quoteInnerText(text, quote, buffer, $static) { + var t1, t2, i, _1_0, _0_0, t3, t4; + for (t1 = text.length, t2 = t1 - 1, i = 0; i < t1; ++i) { + _1_0 = text.charCodeAt(i); + if (_1_0 === 10 || _1_0 === 13 || _1_0 === 12) { + buffer.writeCharCode$1(92); + buffer.writeCharCode$1(97); + if (i !== t2) { + _0_0 = text.charCodeAt(i + 1); + if (!(_0_0 === 32 || _0_0 === 9 || _0_0 === 10 || _0_0 === 13 || _0_0 === 12)) + if (!(_0_0 >= 48 && _0_0 <= 57)) + if (!(_0_0 >= 97 && _0_0 <= 102)) + t3 = _0_0 >= 65 && _0_0 <= 70; + else + t3 = true; + else + t3 = true; + else + t3 = true; + if (t3) + buffer.writeCharCode$1(32); + } + continue; + } + if (92 === _1_0) { + t3 = _1_0; + t4 = true; + } else { + t3 = null; + t4 = false; + } + if (!t4) { + if (_1_0 === quote) { + t3 = _1_0; + t4 = true; + } else + t4 = false; + if (!t4) + if (35 === _1_0) + if ($static) + if (i < t2) + if (text.charCodeAt(i + 1) === 123) { + t3 = _1_0; + t4 = true; + } else + t4 = false; + else + t4 = false; + else + t4 = false; + else + t4 = false; + else + t4 = true; + } else + t4 = true; + if (t4) { + buffer.writeCharCode$1(92); + buffer.writeCharCode$1(t3); + continue; + } + buffer.writeCharCode$1(_1_0); + } + }, + StringExpression__bestQuote(strings) { + var t1, t2, t3, containsDoubleQuote, t4, t5; + for (t1 = J.get$iterator$ax(strings), t2 = type$.CodeUnits, t3 = t2._eval$1("ListIterator"), t2 = t2._eval$1("ListBase.E"), containsDoubleQuote = false; t1.moveNext$0();) + for (t4 = new A.CodeUnits(t1.get$current(t1)), t4 = new A.ListIterator(t4, t4.get$length(0), t3); t4.moveNext$0();) { + t5 = t4.__internal$_current; + if (t5 == null) + t5 = t2._as(t5); + if (t5 === 39) + return 34; + if (t5 === 34) + containsDoubleQuote = true; + } + return containsDoubleQuote ? 39 : 34; + }, + StringExpression: function StringExpression(t0, t1) { + this.text = t0; + this.hasQuotes = t1; + }, + SupportsExpression: function SupportsExpression(t0) { + this.condition = t0; + }, + UnaryOperationExpression: function UnaryOperationExpression(t0, t1, t2) { + this.operator = t0; + this.operand = t1; + this.span = t2; + }, + UnaryOperator: function UnaryOperator(t0, t1, t2) { + this.name = t0; + this.operator = t1; + this._name = t2; + }, + ValueExpression: function ValueExpression(t0, t1) { + this.value = t0; + this.span = t1; + }, + VariableExpression: function VariableExpression(t0, t1, t2) { + this.namespace = t0; + this.name = t1; + this.span = t2; + }, + DynamicImport: function DynamicImport(t0, t1) { + this.urlString = t0; + this.span = t1; + }, + StaticImport: function StaticImport(t0, t1, t2) { + this.url = t0; + this.modifiers = t1; + this.span = t2; + }, + Interpolation$(contents, span) { + var t1 = new A.Interpolation(A.List_List$unmodifiable(contents, type$.Object), span); + t1.Interpolation$2(contents, span); + return t1; + }, + Interpolation: function Interpolation(t0, t1) { + this.contents = t0; + this.span = t1; + }, + Interpolation_toString_closure: function Interpolation_toString_closure() { + }, + AtRootRule$(children, span, query) { + var t1 = A.List_List$unmodifiable(children, type$.Statement), + t2 = B.JSArray_methods.any$1(t1, new A.ParentStatement_closure()); + return new A.AtRootRule(query, span, t1, t2); + }, + AtRootRule: function AtRootRule(t0, t1, t2, t3) { + var _ = this; + _.query = t0; + _.span = t1; + _.children = t2; + _.hasDeclarations = t3; + }, + AtRule$($name, span, children, value) { + var t1 = children == null ? null : A.List_List$unmodifiable(children, type$.Statement), + t2 = t1 == null ? null : B.JSArray_methods.any$1(t1, new A.ParentStatement_closure()); + return new A.AtRule($name, value, span, t1, t2 === true); + }, + AtRule: function AtRule(t0, t1, t2, t3, t4) { + var _ = this; + _.name = t0; + _.value = t1; + _.span = t2; + _.children = t3; + _.hasDeclarations = t4; + }, + CallableDeclaration: function CallableDeclaration() { + }, + ContentBlock$($arguments, children, span) { + var t1 = A.List_List$unmodifiable(children, type$.Statement), + t2 = B.JSArray_methods.any$1(t1, new A.ParentStatement_closure()); + return new A.ContentBlock("@content", $arguments, span, t1, t2); + }, + ContentBlock: function ContentBlock(t0, t1, t2, t3, t4) { + var _ = this; + _.name = t0; + _.$arguments = t1; + _.span = t2; + _.children = t3; + _.hasDeclarations = t4; + }, + ContentRule: function ContentRule(t0, t1) { + this.$arguments = t0; + this.span = t1; + }, + DebugRule: function DebugRule(t0, t1) { + this.expression = t0; + this.span = t1; + }, + Declaration$($name, value, span) { + return new A.Declaration($name, value, span, null, false); + }, + Declaration$nested($name, children, span, value) { + var t1 = A.List_List$unmodifiable(children, type$.Statement), + t2 = B.JSArray_methods.any$1(t1, new A.ParentStatement_closure()); + return new A.Declaration($name, value, span, t1, t2); + }, + Declaration: function Declaration(t0, t1, t2, t3, t4) { + var _ = this; + _.name = t0; + _.value = t1; + _.span = t2; + _.children = t3; + _.hasDeclarations = t4; + }, + EachRule$(variables, list, children, span) { + var t1 = A.List_List$unmodifiable(variables, type$.String), + t2 = A.List_List$unmodifiable(children, type$.Statement), + t3 = B.JSArray_methods.any$1(t2, new A.ParentStatement_closure()); + return new A.EachRule(t1, list, span, t2, t3); + }, + EachRule: function EachRule(t0, t1, t2, t3, t4) { + var _ = this; + _.variables = t0; + _.list = t1; + _.span = t2; + _.children = t3; + _.hasDeclarations = t4; + }, + EachRule_toString_closure: function EachRule_toString_closure() { + }, + ErrorRule: function ErrorRule(t0, t1) { + this.expression = t0; + this.span = t1; + }, + ExtendRule: function ExtendRule(t0, t1, t2) { + this.selector = t0; + this.isOptional = t1; + this.span = t2; + }, + ForRule$(variable, from, to, children, span, exclusive) { + var t1 = A.List_List$unmodifiable(children, type$.Statement), + t2 = B.JSArray_methods.any$1(t1, new A.ParentStatement_closure()); + return new A.ForRule(variable, from, to, exclusive, span, t1, t2); + }, + ForRule: function ForRule(t0, t1, t2, t3, t4, t5, t6) { + var _ = this; + _.variable = t0; + _.from = t1; + _.to = t2; + _.isExclusive = t3; + _.span = t4; + _.children = t5; + _.hasDeclarations = t6; + }, + ForwardRule: function ForwardRule(t0, t1, t2, t3, t4, t5, t6, t7) { + var _ = this; + _.url = t0; + _.shownMixinsAndFunctions = t1; + _.shownVariables = t2; + _.hiddenMixinsAndFunctions = t3; + _.hiddenVariables = t4; + _.prefix = t5; + _.configuration = t6; + _.span = t7; + }, + FunctionRule$($name, $arguments, children, span, comment) { + var t1 = A.List_List$unmodifiable(children, type$.Statement), + t2 = B.JSArray_methods.any$1(t1, new A.ParentStatement_closure()); + return new A.FunctionRule($name, $arguments, span, t1, t2); + }, + FunctionRule: function FunctionRule(t0, t1, t2, t3, t4) { + var _ = this; + _.name = t0; + _.$arguments = t1; + _.span = t2; + _.children = t3; + _.hasDeclarations = t4; + }, + IfClause$(expression, children) { + var t1 = A.List_List$unmodifiable(children, type$.Statement); + return new A.IfClause(expression, t1, B.JSArray_methods.any$1(t1, new A.IfRuleClause$__closure())); + }, + ElseClause$(children) { + var t1 = A.List_List$unmodifiable(children, type$.Statement); + return new A.ElseClause(t1, B.JSArray_methods.any$1(t1, new A.IfRuleClause$__closure())); + }, + IfRule: function IfRule(t0, t1, t2) { + this.clauses = t0; + this.lastClause = t1; + this.span = t2; + }, + IfRule_toString_closure: function IfRule_toString_closure() { + }, + IfRuleClause: function IfRuleClause() { + }, + IfRuleClause$__closure: function IfRuleClause$__closure() { + }, + IfRuleClause$___closure: function IfRuleClause$___closure() { + }, + IfClause: function IfClause(t0, t1, t2) { + this.expression = t0; + this.children = t1; + this.hasDeclarations = t2; + }, + ElseClause: function ElseClause(t0, t1) { + this.children = t0; + this.hasDeclarations = t1; + }, + ImportRule: function ImportRule(t0, t1) { + this.imports = t0; + this.span = t1; + }, + IncludeRule: function IncludeRule(t0, t1, t2, t3, t4) { + var _ = this; + _.namespace = t0; + _.name = t1; + _.$arguments = t2; + _.content = t3; + _.span = t4; + }, + LoudComment: function LoudComment(t0) { + this.text = t0; + }, + MediaRule$(query, children, span) { + var t1 = A.List_List$unmodifiable(children, type$.Statement), + t2 = B.JSArray_methods.any$1(t1, new A.ParentStatement_closure()); + return new A.MediaRule(query, span, t1, t2); + }, + MediaRule: function MediaRule(t0, t1, t2, t3) { + var _ = this; + _.query = t0; + _.span = t1; + _.children = t2; + _.hasDeclarations = t3; + }, + MixinRule$($name, $arguments, children, span, comment) { + var t1 = A.List_List$unmodifiable(children, type$.Statement), + t2 = B.JSArray_methods.any$1(t1, new A.ParentStatement_closure()); + return new A.MixinRule($name, $arguments, span, t1, t2); + }, + MixinRule: function MixinRule(t0, t1, t2, t3, t4) { + var _ = this; + _.__MixinRule_hasContent_FI = $; + _.name = t0; + _.$arguments = t1; + _.span = t2; + _.children = t3; + _.hasDeclarations = t4; + }, + _HasContentVisitor: function _HasContentVisitor() { + }, + __HasContentVisitor_Object_StatementSearchVisitor: function __HasContentVisitor_Object_StatementSearchVisitor() { + }, + ParentStatement: function ParentStatement() { + }, + ParentStatement_closure: function ParentStatement_closure() { + }, + ParentStatement__closure: function ParentStatement__closure() { + }, + ReturnRule: function ReturnRule(t0, t1) { + this.expression = t0; + this.span = t1; + }, + SilentComment: function SilentComment(t0, t1) { + this.text = t0; + this.span = t1; + }, + StyleRule$(selector, children, span) { + var t1 = A.List_List$unmodifiable(children, type$.Statement), + t2 = B.JSArray_methods.any$1(t1, new A.ParentStatement_closure()); + return new A.StyleRule(selector, span, t1, t2); + }, + StyleRule: function StyleRule(t0, t1, t2, t3) { + var _ = this; + _.selector = t0; + _.span = t1; + _.children = t2; + _.hasDeclarations = t3; + }, + Stylesheet$(children, span) { + var t1 = A._setArrayType([], type$.JSArray_UseRule), + t2 = A._setArrayType([], type$.JSArray_ForwardRule), + t3 = A.List_List$unmodifiable(children, type$.Statement), + t4 = B.JSArray_methods.any$1(t3, new A.ParentStatement_closure()); + t1 = new A.Stylesheet(span, false, t1, t2, t3, t4); + t1.Stylesheet$internal$3$plainCss(children, span, false); + return t1; + }, + Stylesheet$internal(children, span, plainCss) { + var t1 = A._setArrayType([], type$.JSArray_UseRule), + t2 = A._setArrayType([], type$.JSArray_ForwardRule), + t3 = A.List_List$unmodifiable(children, type$.Statement), + t4 = B.JSArray_methods.any$1(t3, new A.ParentStatement_closure()); + t1 = new A.Stylesheet(span, plainCss, t1, t2, t3, t4); + t1.Stylesheet$internal$3$plainCss(children, span, plainCss); + return t1; + }, + Stylesheet_Stylesheet$parse(contents, syntax, logger, url) { + var error, stackTrace, url0, t1, exception, t2; + try { + switch (syntax) { + case B.Syntax_Sass_sass: + t1 = A.SpanScanner$(contents, url); + t1 = new A.SassParser(A.LinkedHashMap_LinkedHashMap$_empty(type$.String, type$.VariableDeclaration), t1, logger, null).parse$0(); + return t1; + case B.Syntax_SCSS_scss: + t1 = A.ScssParser$(contents, logger, url).parse$0(); + return t1; + case B.Syntax_CSS_css: + t1 = A.SpanScanner$(contents, url); + t1 = new A.CssParser(A.LinkedHashMap_LinkedHashMap$_empty(type$.String, type$.VariableDeclaration), t1, logger, null).parse$0(); + return t1; + default: + t1 = A.ArgumentError$("Unknown syntax " + syntax.toString$0(0) + ".", null); + throw A.wrapException(t1); + } + } catch (exception) { + t1 = A.unwrapException(exception); + if (t1 instanceof A.SassException) { + error = t1; + stackTrace = A.getTraceFromException(exception); + t1 = error; + t2 = J.getInterceptor$z(t1); + t1 = A.SourceSpanException.prototype.get$span.call(t2, t1); + url0 = t1.get$sourceUrl(t1); + if (url0 == null || J.toString$0$(url0) === "stdin") + throw exception; + t1 = type$.Uri; + throw A.wrapException(A.throwWithTrace(error.withLoadedUrls$1(A.Set_Set$unmodifiable(A.LinkedHashSet_LinkedHashSet$_literal([url0], t1), t1)), error, stackTrace)); + } else + throw exception; + } + }, + Stylesheet: function Stylesheet(t0, t1, t2, t3, t4, t5) { + var _ = this; + _.span = t0; + _.plainCss = t1; + _._uses = t2; + _._forwards = t3; + _.children = t4; + _.hasDeclarations = t5; + }, + SupportsRule$(condition, children, span) { + var t1 = A.List_List$unmodifiable(children, type$.Statement), + t2 = B.JSArray_methods.any$1(t1, new A.ParentStatement_closure()); + return new A.SupportsRule(condition, span, t1, t2); + }, + SupportsRule: function SupportsRule(t0, t1, t2, t3) { + var _ = this; + _.condition = t0; + _.span = t1; + _.children = t2; + _.hasDeclarations = t3; + }, + UseRule: function UseRule(t0, t1, t2, t3) { + var _ = this; + _.url = t0; + _.namespace = t1; + _.configuration = t2; + _.span = t3; + }, + VariableDeclaration$($name, expression, span, comment, global, guarded, namespace) { + if (namespace != null && global) + A.throwExpression(A.ArgumentError$(string$.Other_, null)); + return new A.VariableDeclaration(namespace, $name, expression, guarded, global, span); + }, + VariableDeclaration: function VariableDeclaration(t0, t1, t2, t3, t4, t5) { + var _ = this; + _.namespace = t0; + _.name = t1; + _.expression = t2; + _.isGuarded = t3; + _.isGlobal = t4; + _.span = t5; + }, + WarnRule: function WarnRule(t0, t1) { + this.expression = t0; + this.span = t1; + }, + WhileRule$(condition, children, span) { + var t1 = A.List_List$unmodifiable(children, type$.Statement), + t2 = B.JSArray_methods.any$1(t1, new A.ParentStatement_closure()); + return new A.WhileRule(condition, span, t1, t2); + }, + WhileRule: function WhileRule(t0, t1, t2, t3) { + var _ = this; + _.condition = t0; + _.span = t1; + _.children = t2; + _.hasDeclarations = t3; + }, + SupportsAnything: function SupportsAnything(t0, t1) { + this.contents = t0; + this.span = t1; + }, + SupportsDeclaration: function SupportsDeclaration(t0, t1, t2) { + this.name = t0; + this.value = t1; + this.span = t2; + }, + SupportsFunction: function SupportsFunction(t0, t1, t2) { + this.name = t0; + this.$arguments = t1; + this.span = t2; + }, + SupportsInterpolation: function SupportsInterpolation(t0, t1) { + this.expression = t0; + this.span = t1; + }, + SupportsNegation: function SupportsNegation(t0, t1) { + this.condition = t0; + this.span = t1; + }, + SupportsOperation$(left, right, operator, span) { + var lowerOperator = operator.toLowerCase(); + if (lowerOperator !== "and" && lowerOperator !== "or") + A.throwExpression(A.ArgumentError$value(operator, "operator", 'may only be "and" or "or".')); + return new A.SupportsOperation(left, right, operator, span); + }, + SupportsOperation: function SupportsOperation(t0, t1, t2, t3) { + var _ = this; + _.left = t0; + _.right = t1; + _.operator = t2; + _.span = t3; + }, + Selector: function Selector() { + }, + _IsInvisibleVisitor0: function _IsInvisibleVisitor0(t0) { + this.includeBogus = t0; + }, + _IsBogusVisitor: function _IsBogusVisitor(t0) { + this.includeLeadingCombinator = t0; + }, + _IsBogusVisitor_visitComplexSelector_closure: function _IsBogusVisitor_visitComplexSelector_closure(t0) { + this.$this = t0; + }, + _IsUselessVisitor: function _IsUselessVisitor() { + }, + _IsUselessVisitor_visitComplexSelector_closure: function _IsUselessVisitor_visitComplexSelector_closure(t0) { + this.$this = t0; + }, + __IsBogusVisitor_Object_AnySelectorVisitor: function __IsBogusVisitor_Object_AnySelectorVisitor() { + }, + __IsInvisibleVisitor_Object_AnySelectorVisitor: function __IsInvisibleVisitor_Object_AnySelectorVisitor() { + }, + __IsUselessVisitor_Object_AnySelectorVisitor: function __IsUselessVisitor_Object_AnySelectorVisitor() { + }, + AttributeSelector: function AttributeSelector(t0, t1, t2, t3, t4) { + var _ = this; + _.name = t0; + _.op = t1; + _.value = t2; + _.modifier = t3; + _.span = t4; + }, + AttributeOperator: function AttributeOperator(t0, t1) { + this._attribute$_text = t0; + this._name = t1; + }, + ClassSelector: function ClassSelector(t0, t1) { + this.name = t0; + this.span = t1; + }, + Combinator: function Combinator(t0, t1) { + this._combinator$_text = t0; + this._name = t1; + }, + ComplexSelector$(leadingCombinators, components, span, lineBreak) { + var t1 = A.List_List$unmodifiable(leadingCombinators, type$.CssValue_Combinator), + t2 = A.List_List$unmodifiable(components, type$.ComplexSelectorComponent); + if (t1.length === 0 && t2.length === 0) + A.throwExpression(A.ArgumentError$(string$.leadin, null)); + return new A.ComplexSelector(t1, t2, lineBreak, span); + }, + ComplexSelector: function ComplexSelector(t0, t1, t2, t3) { + var _ = this; + _.leadingCombinators = t0; + _.components = t1; + _.lineBreak = t2; + _.__ComplexSelector_specificity_FI = $; + _.span = t3; + }, + ComplexSelector_specificity_closure: function ComplexSelector_specificity_closure() { + }, + ComplexSelectorComponent: function ComplexSelectorComponent(t0, t1, t2) { + this.selector = t0; + this.combinators = t1; + this.span = t2; + }, + ComplexSelectorComponent_toString_closure: function ComplexSelectorComponent_toString_closure() { + }, + CompoundSelector$(components, span) { + var t1 = A.List_List$unmodifiable(components, type$.SimpleSelector); + if (t1.length === 0) + A.throwExpression(A.ArgumentError$("components may not be empty.", null)); + return new A.CompoundSelector(t1, span); + }, + CompoundSelector: function CompoundSelector(t0, t1) { + this.components = t0; + this.__CompoundSelector_specificity_FI = $; + this.span = t1; + }, + CompoundSelector_specificity_closure: function CompoundSelector_specificity_closure() { + }, + IDSelector: function IDSelector(t0, t1) { + this.name = t0; + this.span = t1; + }, + IDSelector_unify_closure: function IDSelector_unify_closure(t0) { + this.$this = t0; + }, + SelectorList$(components, span) { + var t1 = A.List_List$unmodifiable(components, type$.ComplexSelector); + if (t1.length === 0) + A.throwExpression(A.ArgumentError$("components may not be empty.", null)); + return new A.SelectorList(t1, span); + }, + SelectorList_SelectorList$parse(contents, allowParent, allowPlaceholder, interpolationMap, logger) { + return A.SelectorParser$(contents, allowParent, allowPlaceholder, interpolationMap, logger, null).parse$0(); + }, + SelectorList: function SelectorList(t0, t1) { + this.components = t0; + this.span = t1; + }, + SelectorList_asSassList_closure: function SelectorList_asSassList_closure() { + }, + SelectorList_resolveParentSelectors_closure: function SelectorList_resolveParentSelectors_closure(t0, t1, t2) { + this.$this = t0; + this.implicitParent = t1; + this.parent = t2; + }, + SelectorList_resolveParentSelectors__closure: function SelectorList_resolveParentSelectors__closure(t0) { + this.complex = t0; + }, + SelectorList_resolveParentSelectors__closure0: function SelectorList_resolveParentSelectors__closure0(t0) { + this.complex = t0; + }, + SelectorList__resolveParentSelectorsCompound_closure: function SelectorList__resolveParentSelectorsCompound_closure() { + }, + SelectorList__resolveParentSelectorsCompound_closure0: function SelectorList__resolveParentSelectorsCompound_closure0(t0) { + this.parent = t0; + }, + SelectorList__resolveParentSelectorsCompound_closure1: function SelectorList__resolveParentSelectorsCompound_closure1(t0, t1, t2) { + this.parentSelector = t0; + this.resolvedSimples = t1; + this.component = t2; + }, + SelectorList_withAdditionalCombinators_closure: function SelectorList_withAdditionalCombinators_closure(t0) { + this.combinators = t0; + }, + _ParentSelectorVisitor: function _ParentSelectorVisitor() { + }, + __ParentSelectorVisitor_Object_SelectorSearchVisitor: function __ParentSelectorVisitor_Object_SelectorSearchVisitor() { + }, + ParentSelector: function ParentSelector(t0, t1) { + this.suffix = t0; + this.span = t1; + }, + PlaceholderSelector: function PlaceholderSelector(t0, t1) { + this.name = t0; + this.span = t1; + }, + PseudoSelector$($name, span, argument, element, selector) { + var t1 = !element, + t2 = t1 && !A.PseudoSelector__isFakePseudoElement($name); + return new A.PseudoSelector($name, A.unvendor($name), t2, t1, argument, selector, span); + }, + PseudoSelector__isFakePseudoElement($name) { + switch ($name.charCodeAt(0)) { + case 97: + case 65: + return A.equalsIgnoreCase($name, "after"); + case 98: + case 66: + return A.equalsIgnoreCase($name, "before"); + case 102: + case 70: + return A.equalsIgnoreCase($name, "first-line") || A.equalsIgnoreCase($name, "first-letter"); + default: + return false; + } + }, + PseudoSelector: function PseudoSelector(t0, t1, t2, t3, t4, t5, t6) { + var _ = this; + _.name = t0; + _.normalizedName = t1; + _.isClass = t2; + _.isSyntacticClass = t3; + _.argument = t4; + _.selector = t5; + _.__PseudoSelector_specificity_FI = $; + _.span = t6; + }, + PseudoSelector_specificity_closure: function PseudoSelector_specificity_closure(t0) { + this.$this = t0; + }, + PseudoSelector_specificity__closure: function PseudoSelector_specificity__closure() { + }, + PseudoSelector_specificity__closure0: function PseudoSelector_specificity__closure0() { + }, + PseudoSelector_unify_closure: function PseudoSelector_unify_closure() { + }, + QualifiedName: function QualifiedName(t0, t1) { + this.name = t0; + this.namespace = t1; + }, + SimpleSelector: function SimpleSelector() { + }, + SimpleSelector_isSuperselector_closure: function SimpleSelector_isSuperselector_closure(t0) { + this.$this = t0; + }, + SimpleSelector_isSuperselector__closure: function SimpleSelector_isSuperselector__closure(t0) { + this.$this = t0; + }, + TypeSelector: function TypeSelector(t0, t1) { + this.name = t0; + this.span = t1; + }, + UniversalSelector: function UniversalSelector(t0, t1) { + this.namespace = t0; + this.span = t1; + }, + compileAsync(path, charset, fatalDeprecations, futureDeprecations, importCache, logger, quietDeps, sourceMap, style, syntax, verbose) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.CompileResult), + $async$returnValue, t3, t0, stylesheet, result, t1, t2; + var $async$compileAsync = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = type$.Deprecation; + t2 = A.LinkedHashSet_LinkedHashSet$_empty(t1); + t2.addAll$1(0, fatalDeprecations); + t3 = A.LinkedHashSet_LinkedHashSet$_empty(t1); + t3.addAll$1(0, futureDeprecations); + logger = new A.DeprecationHandlingLogger(A.LinkedHashMap_LinkedHashMap$_empty(t1, type$.int), logger, t2, t3, !verbose); + t1 = syntax === A.Syntax_forPath(path); + $async$goto = t1 ? 3 : 5; + break; + case 3: + // then + t1 = $.$get$FilesystemImporter_cwd(); + t2 = A.isNodeJs() ? self.process : null; + if (!J.$eq$(t2 == null ? null : J.get$platform$x(t2), "win32")) { + t2 = A.isNodeJs() ? self.process : null; + t2 = J.$eq$(t2 == null ? null : J.get$platform$x(t2), "darwin"); + } else + t2 = true; + if (t2) { + t2 = $.$get$context(); + t3 = A._realCasePath(A.absolute(t2.normalize$1(path), null, null, null, null, null, null, null, null, null, null, null, null, null, null)); + t0 = t3; + t3 = t2; + t2 = t0; + } else { + t2 = $.$get$context(); + t3 = t2.canonicalize$1(0, path); + t0 = t3; + t3 = t2; + t2 = t0; + } + $async$goto = 6; + return A._asyncAwait(importCache.importCanonical$3$originalUrl(t1, t3.toUri$1(t2), t3.toUri$1(path)), $async$compileAsync); + case 6: + // returning from await. + t3 = $async$result; + t3.toString; + stylesheet = t3; + // goto join + $async$goto = 4; + break; + case 5: + // else + t1 = A.readFile(path); + stylesheet = A.Stylesheet_Stylesheet$parse(t1, syntax, logger, $.$get$context().toUri$1(path)); + case 4: + // join + $async$goto = 7; + return A._asyncAwait(A._compileStylesheet0(stylesheet, logger, importCache, null, $.$get$FilesystemImporter_cwd(), null, style, true, null, null, quietDeps, sourceMap, charset), $async$compileAsync); + case 7: + // returning from await. + result = $async$result; + logger.summarize$1$js(false); + $async$returnValue = result; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$compileAsync, $async$completer); + }, + compileStringAsync(source, charset, fatalDeprecations, futureDeprecations, importCache, importer, logger, quietDeps, sourceMap, style, syntax, verbose) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.CompileResult), + $async$returnValue, t3, stylesheet, result, t1, t2; + var $async$compileStringAsync = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = type$.Deprecation; + t2 = A.LinkedHashSet_LinkedHashSet$_empty(t1); + t2.addAll$1(0, fatalDeprecations); + t3 = A.LinkedHashSet_LinkedHashSet$_empty(t1); + t3.addAll$1(0, futureDeprecations); + logger = new A.DeprecationHandlingLogger(A.LinkedHashMap_LinkedHashMap$_empty(t1, type$.int), logger, t2, t3, !verbose); + stylesheet = A.Stylesheet_Stylesheet$parse(source, syntax, logger, null); + $async$goto = 3; + return A._asyncAwait(A._compileStylesheet0(stylesheet, logger, importCache, null, importer, null, style, true, null, null, quietDeps, sourceMap, charset), $async$compileStringAsync); + case 3: + // returning from await. + result = $async$result; + logger.summarize$1$js(false); + $async$returnValue = result; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$compileStringAsync, $async$completer); + }, + _compileStylesheet0(stylesheet, logger, importCache, nodeImporter, importer, functions, style, useSpaces, indentWidth, lineFeed, quietDeps, sourceMap, charset) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.CompileResult), + $async$returnValue, serializeResult, resultSourceMap, $async$temp1; + var $async$_compileStylesheet0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$temp1 = A; + $async$goto = 3; + return A._asyncAwait(A._EvaluateVisitor$0(functions, importCache, logger, nodeImporter, quietDeps, sourceMap).run$2(0, importer, stylesheet), $async$_compileStylesheet0); + case 3: + // returning from await. + serializeResult = $async$temp1.serialize($async$result._1, charset, indentWidth, false, lineFeed, sourceMap, style, true); + resultSourceMap = serializeResult._1; + if (resultSourceMap != null && true) + A.mapInPlace(resultSourceMap.urls, new A._compileStylesheet_closure0(stylesheet, importCache)); + $async$returnValue = new A.CompileResult(serializeResult); + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$_compileStylesheet0, $async$completer); + }, + _compileStylesheet_closure0: function _compileStylesheet_closure0(t0, t1) { + this.stylesheet = t0; + this.importCache = t1; + }, + AsyncEnvironment$() { + var t1 = type$.String, + t2 = type$.Module_AsyncCallable, + t3 = type$.AstNode, + t4 = type$.int, + t5 = type$.AsyncCallable, + t6 = type$.JSArray_Map_String_AsyncCallable; + return new A.AsyncEnvironment(A.LinkedHashMap_LinkedHashMap$_empty(t1, t2), A.LinkedHashMap_LinkedHashMap$_empty(t1, t3), A.LinkedHashMap_LinkedHashMap$_empty(t2, t3), A.LinkedHashMap_LinkedHashMap$_empty(t2, t3), null, null, A._setArrayType([], type$.JSArray_Module_AsyncCallable), A._setArrayType([A.LinkedHashMap_LinkedHashMap$_empty(t1, type$.Value)], type$.JSArray_Map_String_Value), A._setArrayType([A.LinkedHashMap_LinkedHashMap$_empty(t1, t3)], type$.JSArray_Map_String_AstNode), A.LinkedHashMap_LinkedHashMap$_empty(t1, t4), A._setArrayType([A.LinkedHashMap_LinkedHashMap$_empty(t1, t5)], t6), A.LinkedHashMap_LinkedHashMap$_empty(t1, t4), A._setArrayType([A.LinkedHashMap_LinkedHashMap$_empty(t1, t5)], t6), A.LinkedHashMap_LinkedHashMap$_empty(t1, t4), null); + }, + AsyncEnvironment$_(_modules, _namespaceNodes, _globalModules, _importedModules, _forwardedModules, _nestedForwardedModules, _allModules, _variables, _variableNodes, _functions, _mixins, _content) { + var t1 = type$.String, + t2 = type$.int; + return new A.AsyncEnvironment(_modules, _namespaceNodes, _globalModules, _importedModules, _forwardedModules, _nestedForwardedModules, _allModules, _variables, _variableNodes, A.LinkedHashMap_LinkedHashMap$_empty(t1, t2), _functions, A.LinkedHashMap_LinkedHashMap$_empty(t1, t2), _mixins, A.LinkedHashMap_LinkedHashMap$_empty(t1, t2), _content); + }, + _EnvironmentModule__EnvironmentModule0(environment, css, preModuleComments, extensionStore, forwarded) { + var t1, t2, t3, t4, t5, t6, module, result, t7; + if (forwarded == null) + forwarded = B.Set_empty2; + t1 = type$.dynamic; + t1 = A.LinkedHashMap_LinkedHashMap$_empty(t1, t1); + for (t2 = type$.Module_AsyncCallable, t3 = type$.List_CssComment, t4 = A.MapExtensions_get_pairs(preModuleComments, t2, t3), t4 = t4.get$iterator(t4), t5 = type$.CssComment; t4.moveNext$0();) { + t6 = t4.get$current(t4); + module = t6._0; + result = A.List_List$from(t6._1, false, t5); + result.fixed$length = Array; + result.immutable$list = Array; + t1.$indexSet(0, module, result); + } + t1 = A.ConstantMap_ConstantMap$from(t1, t2, t3); + t2 = A._EnvironmentModule__makeModulesByVariable0(forwarded); + t3 = A._EnvironmentModule__memberMap0(B.JSArray_methods.get$first(environment._async_environment$_variables), forwarded.map$1$1(0, new A._EnvironmentModule__EnvironmentModule_closure5(), type$.Map_String_Value), type$.Value); + t4 = A._EnvironmentModule__memberMap0(B.JSArray_methods.get$first(environment._async_environment$_variableNodes), forwarded.map$1$1(0, new A._EnvironmentModule__EnvironmentModule_closure6(), type$.Map_String_AstNode), type$.AstNode); + t5 = type$.Map_String_AsyncCallable; + t6 = type$.AsyncCallable; + t7 = A._EnvironmentModule__memberMap0(B.JSArray_methods.get$first(environment._async_environment$_functions), forwarded.map$1$1(0, new A._EnvironmentModule__EnvironmentModule_closure7(), t5), t6); + t6 = A._EnvironmentModule__memberMap0(B.JSArray_methods.get$first(environment._async_environment$_mixins), forwarded.map$1$1(0, new A._EnvironmentModule__EnvironmentModule_closure8(), t5), t6); + t5 = J.get$isNotEmpty$asx(css.get$children(css)) || preModuleComments.get$isNotEmpty(preModuleComments) || B.JSArray_methods.any$1(environment._async_environment$_allModules, new A._EnvironmentModule__EnvironmentModule_closure9()); + return A._EnvironmentModule$_0(environment, css, t1, extensionStore, t2, t3, t4, t7, t6, t5, !extensionStore.get$isEmpty(extensionStore) || B.JSArray_methods.any$1(environment._async_environment$_allModules, new A._EnvironmentModule__EnvironmentModule_closure10())); + }, + _EnvironmentModule__makeModulesByVariable0(forwarded) { + var modulesByVariable, t1, t2, t3, t4, t5; + if (forwarded.get$isEmpty(forwarded)) + return B.Map_empty8; + modulesByVariable = A.LinkedHashMap_LinkedHashMap$_empty(type$.String, type$.Module_AsyncCallable); + for (t1 = forwarded.get$iterator(forwarded); t1.moveNext$0();) { + t2 = t1.get$current(t1); + if (t2 instanceof A._EnvironmentModule0) { + for (t3 = t2._async_environment$_modulesByVariable, t3 = t3.get$values(t3), t3 = t3.get$iterator(t3); t3.moveNext$0();) { + t4 = t3.get$current(t3); + t5 = t4.get$variables(); + A.setAll(modulesByVariable, t5.get$keys(t5), t4); + } + A.setAll(modulesByVariable, J.get$keys$z(B.JSArray_methods.get$first(t2._async_environment$_environment._async_environment$_variables)), t2); + } else { + t3 = t2.get$variables(); + A.setAll(modulesByVariable, t3.get$keys(t3), t2); + } + } + return modulesByVariable; + }, + _EnvironmentModule__memberMap0(localMap, otherMaps, $V) { + var t1, t2, t3; + localMap = new A.PublicMemberMapView(localMap, $V._eval$1("PublicMemberMapView<0>")); + if (otherMaps.get$isEmpty(otherMaps)) + return localMap; + t1 = A._setArrayType([], $V._eval$1("JSArray>")); + for (t2 = otherMaps.get$iterator(otherMaps); t2.moveNext$0();) { + t3 = t2.get$current(t2); + if (t3.get$isNotEmpty(t3)) + t1.push(t3); + } + t1.push(localMap); + if (t1.length === 1) + return localMap; + return A.MergedMapView$(t1, type$.String, $V); + }, + _EnvironmentModule$_0(_environment, css, preModuleComments, extensionStore, _modulesByVariable, variables, variableNodes, functions, mixins, transitivelyContainsCss, transitivelyContainsExtensions) { + return new A._EnvironmentModule0(_environment._async_environment$_allModules, variables, variableNodes, functions, mixins, extensionStore, css, preModuleComments, transitivelyContainsCss, transitivelyContainsExtensions, _environment, _modulesByVariable); + }, + AsyncEnvironment: function AsyncEnvironment(t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14) { + var _ = this; + _._async_environment$_modules = t0; + _._async_environment$_namespaceNodes = t1; + _._async_environment$_globalModules = t2; + _._async_environment$_importedModules = t3; + _._async_environment$_forwardedModules = t4; + _._async_environment$_nestedForwardedModules = t5; + _._async_environment$_allModules = t6; + _._async_environment$_variables = t7; + _._async_environment$_variableNodes = t8; + _._async_environment$_variableIndices = t9; + _._async_environment$_functions = t10; + _._async_environment$_functionIndices = t11; + _._async_environment$_mixins = t12; + _._async_environment$_mixinIndices = t13; + _._async_environment$_content = t14; + _._async_environment$_inMixin = false; + _._async_environment$_inSemiGlobalScope = true; + _._async_environment$_lastVariableIndex = _._async_environment$_lastVariableName = null; + }, + AsyncEnvironment__getVariableFromGlobalModule_closure: function AsyncEnvironment__getVariableFromGlobalModule_closure(t0) { + this.name = t0; + }, + AsyncEnvironment_setVariable_closure: function AsyncEnvironment_setVariable_closure(t0, t1) { + this.$this = t0; + this.name = t1; + }, + AsyncEnvironment_setVariable_closure0: function AsyncEnvironment_setVariable_closure0(t0) { + this.name = t0; + }, + AsyncEnvironment_setVariable_closure1: function AsyncEnvironment_setVariable_closure1(t0, t1) { + this.$this = t0; + this.name = t1; + }, + AsyncEnvironment__getFunctionFromGlobalModule_closure: function AsyncEnvironment__getFunctionFromGlobalModule_closure(t0) { + this.name = t0; + }, + AsyncEnvironment__getMixinFromGlobalModule_closure: function AsyncEnvironment__getMixinFromGlobalModule_closure(t0) { + this.name = t0; + }, + AsyncEnvironment_toModule_closure: function AsyncEnvironment_toModule_closure() { + }, + AsyncEnvironment_toDummyModule_closure: function AsyncEnvironment_toDummyModule_closure() { + }, + _EnvironmentModule0: function _EnvironmentModule0(t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11) { + var _ = this; + _.upstream = t0; + _.variables = t1; + _.variableNodes = t2; + _.functions = t3; + _.mixins = t4; + _.extensionStore = t5; + _.css = t6; + _.preModuleComments = t7; + _.transitivelyContainsCss = t8; + _.transitivelyContainsExtensions = t9; + _._async_environment$_environment = t10; + _._async_environment$_modulesByVariable = t11; + }, + _EnvironmentModule__EnvironmentModule_closure5: function _EnvironmentModule__EnvironmentModule_closure5() { + }, + _EnvironmentModule__EnvironmentModule_closure6: function _EnvironmentModule__EnvironmentModule_closure6() { + }, + _EnvironmentModule__EnvironmentModule_closure7: function _EnvironmentModule__EnvironmentModule_closure7() { + }, + _EnvironmentModule__EnvironmentModule_closure8: function _EnvironmentModule__EnvironmentModule_closure8() { + }, + _EnvironmentModule__EnvironmentModule_closure9: function _EnvironmentModule__EnvironmentModule_closure9() { + }, + _EnvironmentModule__EnvironmentModule_closure10: function _EnvironmentModule__EnvironmentModule_closure10() { + }, + AsyncImportCache__toImporters(importers, loadPaths, packageConfig) { + var t1, t2, t3, t4, _i, path, _null = null, + sassPath = A.getEnvironmentVariable("SASS_PATH"); + if (A.isBrowser()) { + t1 = A._setArrayType([], type$.JSArray_AsyncImporter_2); + B.JSArray_methods.addAll$1(t1, importers); + return t1; + } + t1 = A._setArrayType([], type$.JSArray_AsyncImporter_2); + B.JSArray_methods.addAll$1(t1, importers); + for (t2 = J.get$iterator$ax(loadPaths); t2.moveNext$0();) { + t3 = t2.get$current(t2); + t1.push(new A.FilesystemImporter($.$get$context().absolute$15(t3, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null))); + } + if (sassPath != null) { + t2 = A.isNodeJs() ? self.process : _null; + t3 = sassPath.split(J.$eq$(t2 == null ? _null : J.get$platform$x(t2), "win32") ? ";" : ":"); + t4 = t3.length; + _i = 0; + for (; _i < t4; ++_i) { + path = t3[_i]; + t1.push(new A.FilesystemImporter($.$get$context().absolute$15(path, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null))); + } + } + return t1; + }, + AsyncImportCache: function AsyncImportCache(t0, t1, t2, t3, t4, t5) { + var _ = this; + _._async_import_cache$_importers = t0; + _._async_import_cache$_logger = t1; + _._async_import_cache$_canonicalizeCache = t2; + _._async_import_cache$_relativeCanonicalizeCache = t3; + _._async_import_cache$_importCache = t4; + _._async_import_cache$_resultsCache = t5; + }, + AsyncImportCache_canonicalize_closure: function AsyncImportCache_canonicalize_closure(t0, t1, t2, t3, t4) { + var _ = this; + _.$this = t0; + _.baseImporter = t1; + _.baseUrl = t2; + _.url = t3; + _.forImport = t4; + }, + AsyncImportCache_canonicalize_closure0: function AsyncImportCache_canonicalize_closure0(t0, t1, t2, t3) { + var _ = this; + _.$this = t0; + _.url = t1; + _.baseUrl = t2; + _.forImport = t3; + }, + AsyncImportCache__canonicalize_closure: function AsyncImportCache__canonicalize_closure(t0, t1) { + this.importer = t0; + this.resolved = t1; + }, + AsyncImportCache__canonicalize__closure: function AsyncImportCache__canonicalize__closure(t0, t1) { + this.importer = t0; + this.resolved = t1; + }, + AsyncImportCache__canonicalize_closure0: function AsyncImportCache__canonicalize_closure0(t0, t1) { + this.importer = t0; + this.resolved = t1; + }, + AsyncImportCache_importCanonical_closure: function AsyncImportCache_importCanonical_closure(t0, t1, t2, t3, t4) { + var _ = this; + _.$this = t0; + _.importer = t1; + _.canonicalUrl = t2; + _.originalUrl = t3; + _.quiet = t4; + }, + AsyncImportCache_humanize_closure: function AsyncImportCache_humanize_closure(t0) { + this.canonicalUrl = t0; + }, + AsyncImportCache_humanize_closure0: function AsyncImportCache_humanize_closure0() { + }, + AsyncImportCache_humanize_closure1: function AsyncImportCache_humanize_closure1() { + }, + AsyncImportCache_humanize_closure2: function AsyncImportCache_humanize_closure2(t0) { + this.canonicalUrl = t0; + }, + AsyncBuiltInCallable$mixin($name, $arguments, callback, acceptsContent, url) { + return new A.AsyncBuiltInCallable($name, A.ScssParser$("@mixin " + $name + "(" + $arguments + ") {", null, url).parseArgumentDeclaration$0(), new A.AsyncBuiltInCallable$mixin_closure(callback), false); + }, + AsyncBuiltInCallable: function AsyncBuiltInCallable(t0, t1, t2, t3) { + var _ = this; + _.name = t0; + _._async_built_in$_arguments = t1; + _._async_built_in$_callback = t2; + _.acceptsContent = t3; + }, + AsyncBuiltInCallable$mixin_closure: function AsyncBuiltInCallable$mixin_closure(t0) { + this.callback = t0; + }, + BuiltInCallable$function($name, $arguments, callback, url) { + return new A.BuiltInCallable($name, A._setArrayType([new A._Record_2(A.ScssParser$("@function " + $name + "(" + $arguments + ") {", null, url).parseArgumentDeclaration$0(), callback)], type$.JSArray_Record_2_ArgumentDeclaration_and_Value_Function_List_Value), false); + }, + BuiltInCallable$mixin($name, $arguments, callback, acceptsContent, url) { + return new A.BuiltInCallable($name, A._setArrayType([new A._Record_2(A.ScssParser$("@mixin " + $name + "(" + $arguments + ") {", null, url).parseArgumentDeclaration$0(), new A.BuiltInCallable$mixin_closure(callback))], type$.JSArray_Record_2_ArgumentDeclaration_and_Value_Function_List_Value), acceptsContent); + }, + BuiltInCallable$overloadedFunction($name, overloads) { + var t2, t3, t4, t5, t6, args, callback, + t1 = A._setArrayType([], type$.JSArray_Record_2_ArgumentDeclaration_and_Value_Function_List_Value); + for (t2 = type$.String, t3 = A.MapExtensions_get_pairs(overloads, t2, type$.Value_Function_List_Value), t3 = t3.get$iterator(t3), t4 = "@function " + $name + "(", t5 = type$.VariableDeclaration; t3.moveNext$0();) { + t6 = t3.get$current(t3); + args = t6._0; + callback = t6._1; + t6 = A.SpanScanner$(t4 + args + ") {", null); + t1.push(new A._Record_2(new A.ScssParser(A.LinkedHashMap_LinkedHashMap$_empty(t2, t5), t6, B.StderrLogger_false, null).parseArgumentDeclaration$0(), callback)); + } + return new A.BuiltInCallable($name, t1, false); + }, + BuiltInCallable: function BuiltInCallable(t0, t1, t2) { + this.name = t0; + this._overloads = t1; + this.acceptsContent = t2; + }, + BuiltInCallable$mixin_closure: function BuiltInCallable$mixin_closure(t0) { + this.callback = t0; + }, + PlainCssCallable: function PlainCssCallable(t0) { + this.name = t0; + }, + UserDefinedCallable: function UserDefinedCallable(t0, t1, t2, t3) { + var _ = this; + _.declaration = t0; + _.environment = t1; + _.inDependency = t2; + _.$ti = t3; + }, + _compileStylesheet(stylesheet, logger, importCache, nodeImporter, importer, functions, style, useSpaces, indentWidth, lineFeed, quietDeps, sourceMap, charset) { + var serializeResult = A.serialize(A._EvaluateVisitor$(functions, importCache, logger, nodeImporter, quietDeps, sourceMap).run$2(0, importer, stylesheet)._1, charset, indentWidth, false, lineFeed, sourceMap, style, true), + resultSourceMap = serializeResult._1; + if (resultSourceMap != null && true) + A.mapInPlace(resultSourceMap.urls, new A._compileStylesheet_closure(stylesheet, importCache)); + return new A.CompileResult(serializeResult); + }, + _compileStylesheet_closure: function _compileStylesheet_closure(t0, t1) { + this.stylesheet = t0; + this.importCache = t1; + }, + CompileResult: function CompileResult(t0) { + this._serialize = t0; + }, + Configuration: function Configuration(t0, t1) { + this._configuration$_values = t0; + this.__originalConfiguration = t1; + }, + ExplicitConfiguration: function ExplicitConfiguration(t0, t1, t2) { + this.nodeWithSpan = t0; + this._configuration$_values = t1; + this.__originalConfiguration = t2; + }, + ConfiguredValue: function ConfiguredValue(t0, t1, t2) { + this.value = t0; + this.configurationSpan = t1; + this.assignmentNode = t2; + }, + Deprecation_fromId(id) { + return A.IterableExtension_firstWhereOrNull(B.List_GN8, new A.Deprecation_fromId_closure(id)); + }, + Deprecation_forVersion(version) { + var t2, _i, deprecation, $self, t3, + t1 = A.LinkedHashSet_LinkedHashSet$_empty(type$.Deprecation); + for (t2 = new A.VersionRange(null, version, false, true).get$allows(), _i = 0; _i < 16; ++_i) { + deprecation = B.List_GN8[_i]; + $self = deprecation._deprecatedIn; + t3 = $self == null ? null : A.Version___parse_tearOff($self); + t3 = t3 == null ? null : t2.call$1(t3); + if (t3 == null ? false : t3) + t1.add$1(0, deprecation); + } + return t1; + }, + Deprecation: function Deprecation(t0, t1, t2, t3, t4) { + var _ = this; + _.id = t0; + _._deprecatedIn = t1; + _.description = t2; + _.isFuture = t3; + _._name = t4; + }, + Deprecation_fromId_closure: function Deprecation_fromId_closure(t0) { + this.id = t0; + }, + Environment$() { + var t1 = type$.String, + t2 = type$.Module_Callable, + t3 = type$.AstNode, + t4 = type$.int, + t5 = type$.Callable, + t6 = type$.JSArray_Map_String_Callable; + return new A.Environment(A.LinkedHashMap_LinkedHashMap$_empty(t1, t2), A.LinkedHashMap_LinkedHashMap$_empty(t1, t3), A.LinkedHashMap_LinkedHashMap$_empty(t2, t3), A.LinkedHashMap_LinkedHashMap$_empty(t2, t3), null, null, A._setArrayType([], type$.JSArray_Module_Callable), A._setArrayType([A.LinkedHashMap_LinkedHashMap$_empty(t1, type$.Value)], type$.JSArray_Map_String_Value), A._setArrayType([A.LinkedHashMap_LinkedHashMap$_empty(t1, t3)], type$.JSArray_Map_String_AstNode), A.LinkedHashMap_LinkedHashMap$_empty(t1, t4), A._setArrayType([A.LinkedHashMap_LinkedHashMap$_empty(t1, t5)], t6), A.LinkedHashMap_LinkedHashMap$_empty(t1, t4), A._setArrayType([A.LinkedHashMap_LinkedHashMap$_empty(t1, t5)], t6), A.LinkedHashMap_LinkedHashMap$_empty(t1, t4), null); + }, + Environment$_(_modules, _namespaceNodes, _globalModules, _importedModules, _forwardedModules, _nestedForwardedModules, _allModules, _variables, _variableNodes, _functions, _mixins, _content) { + var t1 = type$.String, + t2 = type$.int; + return new A.Environment(_modules, _namespaceNodes, _globalModules, _importedModules, _forwardedModules, _nestedForwardedModules, _allModules, _variables, _variableNodes, A.LinkedHashMap_LinkedHashMap$_empty(t1, t2), _functions, A.LinkedHashMap_LinkedHashMap$_empty(t1, t2), _mixins, A.LinkedHashMap_LinkedHashMap$_empty(t1, t2), _content); + }, + _EnvironmentModule__EnvironmentModule(environment, css, preModuleComments, extensionStore, forwarded) { + var t1, t2, t3, t4, t5, t6, module, result, t7; + if (forwarded == null) + forwarded = B.Set_empty0; + t1 = type$.dynamic; + t1 = A.LinkedHashMap_LinkedHashMap$_empty(t1, t1); + for (t2 = type$.Module_Callable, t3 = type$.List_CssComment, t4 = A.MapExtensions_get_pairs(preModuleComments, t2, t3), t4 = t4.get$iterator(t4), t5 = type$.CssComment; t4.moveNext$0();) { + t6 = t4.get$current(t4); + module = t6._0; + result = A.List_List$from(t6._1, false, t5); + result.fixed$length = Array; + result.immutable$list = Array; + t1.$indexSet(0, module, result); + } + t1 = A.ConstantMap_ConstantMap$from(t1, t2, t3); + t2 = A._EnvironmentModule__makeModulesByVariable(forwarded); + t3 = A._EnvironmentModule__memberMap(B.JSArray_methods.get$first(environment._variables), forwarded.map$1$1(0, new A._EnvironmentModule__EnvironmentModule_closure(), type$.Map_String_Value), type$.Value); + t4 = A._EnvironmentModule__memberMap(B.JSArray_methods.get$first(environment._variableNodes), forwarded.map$1$1(0, new A._EnvironmentModule__EnvironmentModule_closure0(), type$.Map_String_AstNode), type$.AstNode); + t5 = type$.Map_String_Callable; + t6 = type$.Callable; + t7 = A._EnvironmentModule__memberMap(B.JSArray_methods.get$first(environment._functions), forwarded.map$1$1(0, new A._EnvironmentModule__EnvironmentModule_closure1(), t5), t6); + t6 = A._EnvironmentModule__memberMap(B.JSArray_methods.get$first(environment._mixins), forwarded.map$1$1(0, new A._EnvironmentModule__EnvironmentModule_closure2(), t5), t6); + t5 = J.get$isNotEmpty$asx(css.get$children(css)) || preModuleComments.get$isNotEmpty(preModuleComments) || B.JSArray_methods.any$1(environment._allModules, new A._EnvironmentModule__EnvironmentModule_closure3()); + return A._EnvironmentModule$_(environment, css, t1, extensionStore, t2, t3, t4, t7, t6, t5, !extensionStore.get$isEmpty(extensionStore) || B.JSArray_methods.any$1(environment._allModules, new A._EnvironmentModule__EnvironmentModule_closure4())); + }, + _EnvironmentModule__makeModulesByVariable(forwarded) { + var modulesByVariable, t1, t2, t3, t4, t5; + if (forwarded.get$isEmpty(forwarded)) + return B.Map_empty1; + modulesByVariable = A.LinkedHashMap_LinkedHashMap$_empty(type$.String, type$.Module_Callable); + for (t1 = forwarded.get$iterator(forwarded); t1.moveNext$0();) { + t2 = t1.get$current(t1); + if (t2 instanceof A._EnvironmentModule) { + for (t3 = t2._modulesByVariable, t3 = t3.get$values(t3), t3 = t3.get$iterator(t3); t3.moveNext$0();) { + t4 = t3.get$current(t3); + t5 = t4.get$variables(); + A.setAll(modulesByVariable, t5.get$keys(t5), t4); + } + A.setAll(modulesByVariable, J.get$keys$z(B.JSArray_methods.get$first(t2._environment$_environment._variables)), t2); + } else { + t3 = t2.get$variables(); + A.setAll(modulesByVariable, t3.get$keys(t3), t2); + } + } + return modulesByVariable; + }, + _EnvironmentModule__memberMap(localMap, otherMaps, $V) { + var t1, t2, t3; + localMap = new A.PublicMemberMapView(localMap, $V._eval$1("PublicMemberMapView<0>")); + if (otherMaps.get$isEmpty(otherMaps)) + return localMap; + t1 = A._setArrayType([], $V._eval$1("JSArray>")); + for (t2 = otherMaps.get$iterator(otherMaps); t2.moveNext$0();) { + t3 = t2.get$current(t2); + if (t3.get$isNotEmpty(t3)) + t1.push(t3); + } + t1.push(localMap); + if (t1.length === 1) + return localMap; + return A.MergedMapView$(t1, type$.String, $V); + }, + _EnvironmentModule$_(_environment, css, preModuleComments, extensionStore, _modulesByVariable, variables, variableNodes, functions, mixins, transitivelyContainsCss, transitivelyContainsExtensions) { + return new A._EnvironmentModule(_environment._allModules, variables, variableNodes, functions, mixins, extensionStore, css, preModuleComments, transitivelyContainsCss, transitivelyContainsExtensions, _environment, _modulesByVariable); + }, + Environment: function Environment(t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14) { + var _ = this; + _._environment$_modules = t0; + _._namespaceNodes = t1; + _._globalModules = t2; + _._importedModules = t3; + _._forwardedModules = t4; + _._nestedForwardedModules = t5; + _._allModules = t6; + _._variables = t7; + _._variableNodes = t8; + _._variableIndices = t9; + _._functions = t10; + _._functionIndices = t11; + _._mixins = t12; + _._mixinIndices = t13; + _._content = t14; + _._inMixin = false; + _._inSemiGlobalScope = true; + _._lastVariableIndex = _._lastVariableName = null; + }, + Environment__getVariableFromGlobalModule_closure: function Environment__getVariableFromGlobalModule_closure(t0) { + this.name = t0; + }, + Environment_setVariable_closure: function Environment_setVariable_closure(t0, t1) { + this.$this = t0; + this.name = t1; + }, + Environment_setVariable_closure0: function Environment_setVariable_closure0(t0) { + this.name = t0; + }, + Environment_setVariable_closure1: function Environment_setVariable_closure1(t0, t1) { + this.$this = t0; + this.name = t1; + }, + Environment__getFunctionFromGlobalModule_closure: function Environment__getFunctionFromGlobalModule_closure(t0) { + this.name = t0; + }, + Environment__getMixinFromGlobalModule_closure: function Environment__getMixinFromGlobalModule_closure(t0) { + this.name = t0; + }, + Environment_toModule_closure: function Environment_toModule_closure() { + }, + Environment_toDummyModule_closure: function Environment_toDummyModule_closure() { + }, + _EnvironmentModule: function _EnvironmentModule(t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11) { + var _ = this; + _.upstream = t0; + _.variables = t1; + _.variableNodes = t2; + _.functions = t3; + _.mixins = t4; + _.extensionStore = t5; + _.css = t6; + _.preModuleComments = t7; + _.transitivelyContainsCss = t8; + _.transitivelyContainsExtensions = t9; + _._environment$_environment = t10; + _._modulesByVariable = t11; + }, + _EnvironmentModule__EnvironmentModule_closure: function _EnvironmentModule__EnvironmentModule_closure() { + }, + _EnvironmentModule__EnvironmentModule_closure0: function _EnvironmentModule__EnvironmentModule_closure0() { + }, + _EnvironmentModule__EnvironmentModule_closure1: function _EnvironmentModule__EnvironmentModule_closure1() { + }, + _EnvironmentModule__EnvironmentModule_closure2: function _EnvironmentModule__EnvironmentModule_closure2() { + }, + _EnvironmentModule__EnvironmentModule_closure3: function _EnvironmentModule__EnvironmentModule_closure3() { + }, + _EnvironmentModule__EnvironmentModule_closure4: function _EnvironmentModule__EnvironmentModule_closure4() { + }, + SassException$(message, span, loadedUrls) { + return new A.SassException(loadedUrls == null ? B.Set_empty : A.Set_Set$unmodifiable(loadedUrls, type$.Uri), message, span); + }, + MultiSpanSassException$(message, span, primaryLabel, secondarySpans, loadedUrls) { + var t1 = A.ConstantMap_ConstantMap$from(secondarySpans, type$.FileSpan, type$.String); + return new A.MultiSpanSassException(primaryLabel, t1, loadedUrls == null ? B.Set_empty : A.Set_Set$unmodifiable(loadedUrls, type$.Uri), message, span); + }, + SassRuntimeException$(message, span, trace, loadedUrls) { + return new A.SassRuntimeException(trace, loadedUrls == null ? B.Set_empty : A.Set_Set$unmodifiable(loadedUrls, type$.Uri), message, span); + }, + MultiSpanSassRuntimeException$(message, span, primaryLabel, secondarySpans, trace, loadedUrls) { + var t1 = A.ConstantMap_ConstantMap$from(secondarySpans, type$.FileSpan, type$.String); + return new A.MultiSpanSassRuntimeException(trace, primaryLabel, t1, loadedUrls == null ? B.Set_empty : A.Set_Set$unmodifiable(loadedUrls, type$.Uri), message, span); + }, + SassFormatException$(message, span, loadedUrls) { + return new A.SassFormatException(loadedUrls == null ? B.Set_empty : A.Set_Set$unmodifiable(loadedUrls, type$.Uri), message, span); + }, + MultiSpanSassFormatException$(message, span, primaryLabel, secondarySpans, loadedUrls) { + var t1 = A.ConstantMap_ConstantMap$from(secondarySpans, type$.FileSpan, type$.String); + return new A.MultiSpanSassFormatException(primaryLabel, t1, loadedUrls == null ? B.Set_empty : A.Set_Set$unmodifiable(loadedUrls, type$.Uri), message, span); + }, + SassScriptException$(message, argumentName) { + return new A.SassScriptException(argumentName == null ? message : "$" + argumentName + ": " + message); + }, + MultiSpanSassScriptException$(message, primaryLabel, secondarySpans) { + var t1 = A.ConstantMap_ConstantMap$from(secondarySpans, type$.FileSpan, type$.String); + return new A.MultiSpanSassScriptException(primaryLabel, t1, message); + }, + SassException: function SassException(t0, t1, t2) { + this.loadedUrls = t0; + this._span_exception$_message = t1; + this._span = t2; + }, + MultiSpanSassException: function MultiSpanSassException(t0, t1, t2, t3, t4) { + var _ = this; + _.primaryLabel = t0; + _.secondarySpans = t1; + _.loadedUrls = t2; + _._span_exception$_message = t3; + _._span = t4; + }, + SassRuntimeException: function SassRuntimeException(t0, t1, t2, t3) { + var _ = this; + _.trace = t0; + _.loadedUrls = t1; + _._span_exception$_message = t2; + _._span = t3; + }, + MultiSpanSassRuntimeException: function MultiSpanSassRuntimeException(t0, t1, t2, t3, t4, t5) { + var _ = this; + _.trace = t0; + _.primaryLabel = t1; + _.secondarySpans = t2; + _.loadedUrls = t3; + _._span_exception$_message = t4; + _._span = t5; + }, + SassFormatException: function SassFormatException(t0, t1, t2) { + this.loadedUrls = t0; + this._span_exception$_message = t1; + this._span = t2; + }, + MultiSpanSassFormatException: function MultiSpanSassFormatException(t0, t1, t2, t3, t4) { + var _ = this; + _.primaryLabel = t0; + _.secondarySpans = t1; + _.loadedUrls = t2; + _._span_exception$_message = t3; + _._span = t4; + }, + SassScriptException: function SassScriptException(t0) { + this.message = t0; + }, + MultiSpanSassScriptException: function MultiSpanSassScriptException(t0, t1, t2) { + this.primaryLabel = t0; + this.secondarySpans = t1; + this.message = t2; + }, + compileStylesheet(options, graph, source, destination, ifModified) { + return A.compileStylesheet$body(options, graph, source, destination, ifModified); + }, + compileStylesheet$body(options, graph, source, destination, ifModified) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.nullable_Record_3_int_and_String_and_nullable_String), + $async$returnValue, $async$handler = 2, $async$currentError, error, stackTrace, message, error0, stackTrace0, path, message0, exception, t1, $async$exception; + var $async$compileStylesheet = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) { + $async$currentError = $async$result; + $async$goto = $async$handler; + } + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$handler = 4; + $async$goto = 7; + return A._asyncAwait(A._compileStylesheetWithoutErrorHandling(options, graph, source, destination, ifModified), $async$compileStylesheet); + case 7: + // returning from await. + $async$handler = 2; + // goto after finally + $async$goto = 6; + break; + case 4: + // catch + $async$handler = 3; + $async$exception = $async$currentError; + t1 = A.unwrapException($async$exception); + if (t1 instanceof A.SassException) { + error = t1; + stackTrace = A.getTraceFromException($async$exception); + if (destination != null && !options.get$emitErrorCss()) + A._tryDelete(destination); + message = J.toString$1$color$(error, options.get$color()); + if (A._asBool(options._options.$index(0, "trace"))) { + t1 = A.getTrace(error); + if (t1 == null) + t1 = stackTrace; + } else + t1 = null; + $async$returnValue = A._getErrorWithStackTrace(65, message, t1); + // goto return + $async$goto = 1; + break; + } else if (t1 instanceof A.FileSystemException) { + error0 = t1; + stackTrace0 = A.getTraceFromException($async$exception); + path = error0.path; + message0 = path == null ? error0.message : "Error reading " + $.$get$context().relative$2$from(path, null) + ": " + error0.message + "."; + if (A._asBool(options._options.$index(0, "trace"))) { + t1 = A.getTrace(error0); + if (t1 == null) + t1 = stackTrace0; + } else + t1 = null; + $async$returnValue = A._getErrorWithStackTrace(66, message0, t1); + // goto return + $async$goto = 1; + break; + } else + throw $async$exception; + // goto after finally + $async$goto = 6; + break; + case 3: + // uncaught + // goto rethrow + $async$goto = 2; + break; + case 6: + // after finally + $async$returnValue = null; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + case 2: + // rethrow + return A._asyncRethrow($async$currentError, $async$completer); + } + }); + return A._asyncStartSync($async$compileStylesheet, $async$completer); + }, + _compileStylesheetWithoutErrorHandling(options, graph, source, destination, ifModified) { + return A._compileStylesheetWithoutErrorHandling$body(options, graph, source, destination, ifModified); + }, + _compileStylesheetWithoutErrorHandling$body(options, graph, source, destination, ifModified) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void), + $async$returnValue, $async$handler = 2, $async$currentError, syntax, result, importCache, error, exception, t1, t2, t3, t4, t5, t6, t7, t8, t9, result0, t10, t11, t12, t13, logger, stylesheet, t0, css, buffer, sourceName, destinationName, nowStr, timestamp, importer, $async$exception; + var $async$_compileStylesheetWithoutErrorHandling = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) { + $async$currentError = $async$result; + $async$goto = $async$handler; + } + while (true) + switch ($async$goto) { + case 0: + // Function start + importer = $.$get$FilesystemImporter_cwd(); + if (ifModified) + try { + if (source != null && destination != null && !graph.modifiedSince$3($.$get$context().toUri$1(source), A.modificationTime(destination), importer)) { + // goto return + $async$goto = 1; + break; + } + } catch (exception) { + if (!(A.unwrapException(exception) instanceof A.FileSystemException)) + throw exception; + } + syntax = null; + if (A._asBoolQ(options._ifParsed$1("indented")) === true) + syntax = B.Syntax_Sass_sass; + else if (source != null) + syntax = A.Syntax_forPath(source); + else + syntax = B.Syntax_SCSS_scss; + result = null; + $async$handler = 4; + t1 = options._options; + $async$goto = A._asBool(t1.$index(0, "async")) ? 7 : 9; + break; + case 7: + // then + t2 = options.get$pkgImporters(); + t3 = type$.List_String._as(t1.$index(0, "load-path")); + t4 = A._asBool(t1.$index(0, "quiet")) ? $.$get$Logger_quiet() : new A.StderrLogger(options.get$color()); + t5 = type$.nullable_Record_3_AsyncImporter_and_Uri_and_Uri_originalUrl; + t6 = type$.Uri; + t3 = A.AsyncImportCache__toImporters(t2, t3, null); + importCache = new A.AsyncImportCache(t3, t4, A.LinkedHashMap_LinkedHashMap$_empty(type$.Record_2_Uri_and_bool_forImport, t5), A.LinkedHashMap_LinkedHashMap$_empty(type$.Record_4_Uri_and_AsyncImporter_baseImporter_and_nullable_Uri_baseUrl_and_bool_forImport, t5), A.LinkedHashMap_LinkedHashMap$_empty(t6, type$.nullable_Stylesheet), A.LinkedHashMap_LinkedHashMap$_empty(t6, type$.ImporterResult)); + $async$goto = source == null ? 10 : 12; + break; + case 10: + // then + $async$goto = 13; + return A._asyncAwait(A.readStdin(), $async$_compileStylesheetWithoutErrorHandling); + case 13: + // returning from await. + t2 = $async$result; + t3 = syntax; + t4 = A._asBool(t1.$index(0, "quiet")) ? $.$get$Logger_quiet() : new A.StderrLogger(options.get$color()); + t5 = $.$get$FilesystemImporter_cwd(); + t6 = J.$eq$(t1.$index(0, "style"), "compressed") ? B.OutputStyle_1 : B.OutputStyle_0; + t7 = A._asBool(t1.$index(0, "quiet-deps")); + t8 = A._asBool(t1.$index(0, "verbose")); + t9 = options.get$emitSourceMap(); + $async$goto = 14; + return A._asyncAwait(A.compileStringAsync(t2, A._asBool(t1.$index(0, "charset")), options.get$fatalDeprecations(), options.get$futureDeprecations(), importCache, t5, t4, t7, t9, t6, t3, t8), $async$_compileStylesheetWithoutErrorHandling); + case 14: + // returning from await. + result0 = $async$result; + // goto join + $async$goto = 11; + break; + case 12: + // else + t2 = syntax; + t3 = A._asBool(t1.$index(0, "quiet")) ? $.$get$Logger_quiet() : new A.StderrLogger(options.get$color()); + t4 = J.$eq$(t1.$index(0, "style"), "compressed") ? B.OutputStyle_1 : B.OutputStyle_0; + t5 = A._asBool(t1.$index(0, "quiet-deps")); + t6 = A._asBool(t1.$index(0, "verbose")); + t7 = options.get$emitSourceMap(); + $async$goto = 15; + return A._asyncAwait(A.compileAsync(source, A._asBool(t1.$index(0, "charset")), options.get$fatalDeprecations(), options.get$futureDeprecations(), importCache, t3, t5, t7, t4, t2, t6), $async$_compileStylesheetWithoutErrorHandling); + case 15: + // returning from await. + result0 = $async$result; + case 11: + // join + result = result0; + // goto join + $async$goto = 8; + break; + case 9: + // else + $async$goto = source == null ? 16 : 18; + break; + case 16: + // then + $async$goto = 19; + return A._asyncAwait(A.readStdin(), $async$_compileStylesheetWithoutErrorHandling); + case 19: + // returning from await. + t2 = $async$result; + t3 = syntax; + t4 = A._asBool(t1.$index(0, "quiet")) ? $.$get$Logger_quiet() : new A.StderrLogger(options.get$color()); + t5 = $.$get$FilesystemImporter_cwd(); + t6 = J.$eq$(t1.$index(0, "style"), "compressed") ? B.OutputStyle_1 : B.OutputStyle_0; + t7 = A._asBool(t1.$index(0, "quiet-deps")); + t8 = A._asBool(t1.$index(0, "verbose")); + t9 = options.get$emitSourceMap(); + t1 = A._asBool(t1.$index(0, "charset")); + t10 = options.get$fatalDeprecations(); + t11 = options.get$futureDeprecations(); + t12 = type$.Deprecation; + t13 = A.LinkedHashSet_LinkedHashSet$_empty(t12); + t13.addAll$1(0, t10); + t10 = A.LinkedHashSet_LinkedHashSet$_empty(t12); + t10.addAll$1(0, t11); + logger = new A.DeprecationHandlingLogger(A.LinkedHashMap_LinkedHashMap$_empty(t12, type$.int), t4, t13, t10, !t8); + stylesheet = A.Stylesheet_Stylesheet$parse(t2, t3 == null ? B.Syntax_SCSS_scss : t3, logger, null); + result0 = A._compileStylesheet(stylesheet, logger, graph.importCache, null, t5, null, t6, true, null, null, t7, t9, t1); + logger.summarize$1$js(false); + // goto join + $async$goto = 17; + break; + case 18: + // else + t2 = syntax; + t3 = A._asBool(t1.$index(0, "quiet")) ? $.$get$Logger_quiet() : new A.StderrLogger(options.get$color()); + importCache = graph.importCache; + t4 = J.$eq$(t1.$index(0, "style"), "compressed") ? B.OutputStyle_1 : B.OutputStyle_0; + t5 = A._asBool(t1.$index(0, "quiet-deps")); + t6 = A._asBool(t1.$index(0, "verbose")); + t7 = options.get$emitSourceMap(); + t1 = A._asBool(t1.$index(0, "charset")); + t8 = options.get$fatalDeprecations(); + t9 = options.get$futureDeprecations(); + t10 = type$.Deprecation; + t11 = A.LinkedHashSet_LinkedHashSet$_empty(t10); + t11.addAll$1(0, t8); + t8 = A.LinkedHashSet_LinkedHashSet$_empty(t10); + t8.addAll$1(0, t9); + logger = new A.DeprecationHandlingLogger(A.LinkedHashMap_LinkedHashMap$_empty(t10, type$.int), t3, t11, t8, !t6); + t3 = t2 == null || t2 === A.Syntax_forPath(source); + if (t3) { + t2 = $.$get$FilesystemImporter_cwd(); + t3 = A.isNodeJs() ? self.process : null; + if (!J.$eq$(t3 == null ? null : J.get$platform$x(t3), "win32")) { + t3 = A.isNodeJs() ? self.process : null; + t3 = J.$eq$(t3 == null ? null : J.get$platform$x(t3), "darwin"); + } else + t3 = true; + if (t3) { + t3 = $.$get$context(); + t6 = A._realCasePath(A.absolute(t3.normalize$1(source), null, null, null, null, null, null, null, null, null, null, null, null, null, null)); + t0 = t6; + t6 = t3; + t3 = t0; + } else { + t3 = $.$get$context(); + t6 = t3.canonicalize$1(0, source); + t0 = t6; + t6 = t3; + t3 = t0; + } + t6 = importCache.importCanonical$3$originalUrl(t2, t6.toUri$1(t3), t6.toUri$1(source)); + t6.toString; + stylesheet = t6; + } else { + t3 = A.readFile(source); + if (t2 == null) + t2 = A.Syntax_forPath(source); + stylesheet = A.Stylesheet_Stylesheet$parse(t3, t2, logger, $.$get$context().toUri$1(source)); + } + result0 = A._compileStylesheet(stylesheet, logger, importCache, null, $.$get$FilesystemImporter_cwd(), null, t4, true, null, null, t5, t7, t1); + logger.summarize$1$js(false); + case 17: + // join + result = result0; + case 8: + // join + $async$handler = 2; + // goto after finally + $async$goto = 6; + break; + case 4: + // catch + $async$handler = 3; + $async$exception = $async$currentError; + t1 = A.unwrapException($async$exception); + if (t1 instanceof A.SassException) { + error = t1; + if (options.get$emitErrorCss()) + if (destination == null) + A.print(error.toCssString$0()); + else { + A.ensureDir($.$get$context().dirname$1(destination)); + A.writeFile(destination, error.toCssString$0() + "\n"); + } + throw $async$exception; + } else + throw $async$exception; + // goto after finally + $async$goto = 6; + break; + case 3: + // uncaught + // goto rethrow + $async$goto = 2; + break; + case 6: + // after finally + css = result._serialize._0 + A._writeSourceMap(options, result._serialize._1, destination); + if (destination == null) { + if (css.length !== 0) + A.print(css); + } else { + A.ensureDir($.$get$context().dirname$1(destination)); + A.writeFile(destination, css + "\n"); + } + t1 = options._options; + if (!A._asBool(t1.$index(0, "quiet"))) + t1 = !A._asBool(t1.$index(0, "update")) && !A._asBool(t1.$index(0, "watch")); + else + t1 = true; + if (t1) { + // goto return + $async$goto = 1; + break; + } + buffer = new A.StringBuffer(""); + if (source == null) + sourceName = "stdin"; + else { + t1 = $.$get$context(); + sourceName = t1.prettyUri$1(t1.toUri$1(source)); + } + destination.toString; + t1 = $.$get$context(); + destinationName = t1.prettyUri$1(t1.toUri$1(destination)); + nowStr = new A.DateTime(Date.now(), false).toString$0(0); + timestamp = B.JSString_methods.substring$2(nowStr, 0, nowStr.length - 7); + t1 = options.get$color() ? buffer._contents = "" + "\x1b[90m" : ""; + t1 = buffer._contents = t1 + ("[" + timestamp + "] "); + if (options.get$color()) + t1 = buffer._contents = t1 + "\x1b[32m"; + t1 += "Compiled " + sourceName + " to " + destinationName + "."; + buffer._contents = t1; + if (options.get$color()) + buffer._contents = t1 + "\x1b[0m"; + t1 = A.isNodeJs() ? self.process : null; + if (t1 != null) { + t1 = J.get$stdout$x(t1); + J.write$1$x(t1, buffer.toString$0(0) + "\n"); + } else { + t1 = self.console; + J.log$1$x(t1, buffer); + } + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + case 2: + // rethrow + return A._asyncRethrow($async$currentError, $async$completer); + } + }); + return A._asyncStartSync($async$_compileStylesheetWithoutErrorHandling, $async$completer); + }, + _writeSourceMap(options, sourceMap, destination) { + var t1, sourceMapText, url, sourceMapPath, t2, escapedUrl; + if (sourceMap == null) + return ""; + if (destination != null) { + t1 = $.$get$context(); + sourceMap.targetUrl = t1.toUri$1(A.ParsedPath_ParsedPath$parse(destination, t1.style).get$basename()).toString$0(0); + } + A.mapInPlace(sourceMap.urls, new A._writeSourceMap_closure(options, destination)); + t1 = options._options; + sourceMapText = B.C_JsonCodec.encode$2$toEncodable(sourceMap.toJson$1$includeSourceContents(A._asBool(t1.$index(0, "embed-sources"))), null); + if (A._asBool(t1.$index(0, "embed-source-map"))) + url = A.Uri_Uri$dataFromString(sourceMapText, B.C_Utf8Codec, "application/json"); + else { + destination.toString; + sourceMapPath = destination + ".map"; + t2 = $.$get$context(); + A.ensureDir(t2.dirname$1(sourceMapPath)); + A.writeFile(sourceMapPath, sourceMapText); + url = t2.toUri$1(t2.relative$2$from(sourceMapPath, t2.dirname$1(destination))); + } + t2 = url.toString$0(0); + escapedUrl = A.stringReplaceAllUnchecked(t2, "*/", "%2A/"); + t1 = (J.$eq$(t1.$index(0, "style"), "compressed") ? B.OutputStyle_1 : B.OutputStyle_0) === B.OutputStyle_1 ? "" : "\n\n"; + return t1 + ("/*# sourceMappingURL=" + escapedUrl + " */"); + }, + _tryDelete(path) { + var exception; + try { + A.deleteFile(path); + } catch (exception) { + if (!(A.unwrapException(exception) instanceof A.FileSystemException)) + throw exception; + } + }, + _getErrorWithStackTrace(exitCode, error, stackTrace) { + return new A._Record_3(exitCode, error, stackTrace != null ? B.JSString_methods.trimRight$0(A.Trace_Trace$from(stackTrace).get$terse().toString$0(0)) : null); + }, + _writeSourceMap_closure: function _writeSourceMap_closure(t0, t1) { + this.options = t0; + this.destination = t1; + }, + ExecutableOptions__separator(text) { + var t1 = $.$get$ExecutableOptions__separatorBar(), + t2 = B.JSString_methods.$mul(t1, 3), + t3 = A.hasTerminal() ? "\x1b[1m" : "", + t4 = A.hasTerminal() ? "\x1b[0m" : ""; + return t2 + " " + t3 + text + t4 + " " + B.JSString_methods.$mul(t1, 35 - text.length); + }, + ExecutableOptions__fail(message) { + return A.throwExpression(A.UsageException$(message)); + }, + ExecutableOptions_ExecutableOptions$parse(args) { + var options, error, t1, t2, exception; + try { + t1 = $.$get$ExecutableOptions__parser(); + t2 = A.ListQueue$(type$.String); + t2.addAll$1(0, args); + t2 = A.Parser$(null, t1, t2, null, null).parse$0(); + if (t2.wasParsed$1("poll") && !A._asBool(t2.$index(0, "watch"))) + A.ExecutableOptions__fail("--poll may not be passed without --watch."); + options = new A.ExecutableOptions(t2); + if (A._asBool(options._options.$index(0, "help"))) + A.ExecutableOptions__fail("Compile Sass to CSS."); + return options; + } catch (exception) { + t1 = A.unwrapException(exception); + if (type$.FormatException._is(t1)) { + error = t1; + A.ExecutableOptions__fail(J.get$message$x(error)); + } else + throw exception; + } + }, + UsageException$(message) { + return new A.UsageException(message); + }, + ExecutableOptions: function ExecutableOptions(t0) { + var _ = this; + _._options = t0; + _.__ExecutableOptions_interactive_FI = $; + _._sourcesToDestinations = null; + _.__ExecutableOptions__sourceDirectoriesToDestinations_F = $; + _._fatalDeprecations = null; + }, + ExecutableOptions__parser_closure: function ExecutableOptions__parser_closure() { + }, + ExecutableOptions_interactive_closure: function ExecutableOptions_interactive_closure(t0) { + this.$this = t0; + }, + ExecutableOptions_emitErrorCss_closure: function ExecutableOptions_emitErrorCss_closure() { + }, + ExecutableOptions_fatalDeprecations_closure: function ExecutableOptions_fatalDeprecations_closure(t0) { + this.$this = t0; + }, + UsageException: function UsageException(t0) { + this.message = t0; + }, + watch(options, graph) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void), + $async$returnValue, t1, t2, t3, t4, t5, t6, dirWatcher, sourcesToDestinations, t0; + var $async$watch = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + options._ensureSources$0(); + t1 = options.__ExecutableOptions__sourceDirectoriesToDestinations_F; + t1 === $ && A.throwUnnamedLateFieldNI(); + t2 = type$.String; + t1 = t1.cast$2$0(0, t2, t2); + t1 = A.List_List$of(t1.get$keys(t1), true, t2); + for (options._ensureSources$0(), t3 = options._sourcesToDestinations.cast$2$0(0, t2, t2), t3 = J.get$iterator$ax(t3.get$keys(t3)); t3.moveNext$0();) { + t4 = t3.get$current(t3); + t1.push($.$get$context().dirname$1(t4)); + } + t3 = options._options; + B.JSArray_methods.addAll$1(t1, type$.List_String._as(t3.$index(0, "load-path"))); + t4 = A._asBool(t3.$index(0, "poll")); + t5 = type$.Stream_WatchEvent; + t6 = A.PathMap__create(null, t5); + t5 = new A.StreamGroup(B._StreamGroupState_dormant, A.LinkedHashMap_LinkedHashMap$_empty(t5, type$.nullable_StreamSubscription_WatchEvent), type$.StreamGroup_WatchEvent); + t5.__StreamGroup__controller_A = A.StreamController_StreamController(t5.get$_onCancel(), t5.get$_onListen(), t5.get$_onPause(), t5.get$_onResume(), true, type$.WatchEvent); + dirWatcher = new A.MultiDirWatcher(new A.PathMap(t6, type$.PathMap_Stream_WatchEvent), t5, t4); + $async$goto = 3; + return A._asyncAwait(A.Future_wait(new A.MappedListIterable(t1, new A.watch_closure(dirWatcher), A._arrayInstanceType(t1)._eval$1("MappedListIterable<1,Future<~>>")), false, type$.void), $async$watch); + case 3: + // returning from await. + options._ensureSources$0(); + sourcesToDestinations = options._sourcesToDestinations.cast$2$0(0, t2, t2); + for (t1 = J.get$iterator$ax(sourcesToDestinations.get$keys(sourcesToDestinations)); t1.moveNext$0();) { + t2 = t1.get$current(t1); + t4 = $.$get$FilesystemImporter_cwd(); + t5 = self.process; + if (t5 == null) + t5 = null; + else { + t5 = J.get$release$x(t5); + t5 = t5 == null ? null : J.get$name$x(t5); + } + t5 = J.$eq$(t5, "node") ? self.process : null; + if (!J.$eq$(t5 == null ? null : J.get$platform$x(t5), "win32")) { + t5 = self.process; + if (t5 == null) + t5 = null; + else { + t5 = J.get$release$x(t5); + t5 = t5 == null ? null : J.get$name$x(t5); + } + t5 = J.$eq$(t5, "node") ? self.process : null; + t5 = J.$eq$(t5 == null ? null : J.get$platform$x(t5), "darwin"); + } else + t5 = true; + if (t5) { + t5 = $.$get$context(); + t6 = A._realCasePath(t5.absolute$15(t5.normalize$1(t2), null, null, null, null, null, null, null, null, null, null, null, null, null, null)); + t0 = t6; + t6 = t5; + t5 = t0; + } else { + t5 = $.$get$context(); + t6 = t5.canonicalize$1(0, t2); + t0 = t6; + t6 = t5; + t5 = t0; + } + graph.addCanonical$4$recanonicalize(t4, t6.toUri$1(t5), t6.toUri$1(t2), false); + } + $async$goto = 4; + return A._asyncAwait(A.compileStylesheets(options, graph, sourcesToDestinations, true), $async$watch); + case 4: + // returning from await. + if (!$async$result && A._asBool(t3.$index(0, "stop-on-error"))) { + t1 = dirWatcher._group.__StreamGroup__controller_A; + t1 === $ && A.throwUnnamedLateFieldNI(); + new A._ControllerStream(t1, A._instanceType(t1)._eval$1("_ControllerStream<1>")).listen$1(0, null).cancel$0(); + // goto return + $async$goto = 1; + break; + } + A.print("Sass is watching for changes. Press Ctrl-C to stop.\n"); + $async$goto = 5; + return A._asyncAwait(new A._Watcher(options, graph).watch$1(0, dirWatcher), $async$watch); + case 5: + // returning from await. + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$watch, $async$completer); + }, + watch_closure: function watch_closure(t0) { + this.dirWatcher = t0; + }, + _Watcher: function _Watcher(t0, t1) { + this._watch$_options = t0; + this._graph = t1; + }, + _Watcher__debounceEvents_closure: function _Watcher__debounceEvents_closure() { + }, + EmptyExtensionStore: function EmptyExtensionStore() { + }, + Extension: function Extension(t0, t1, t2, t3, t4) { + var _ = this; + _.extender = t0; + _.target = t1; + _.mediaContext = t2; + _.isOptional = t3; + _.span = t4; + }, + Extender: function Extender(t0, t1) { + this.selector = t0; + this.isOriginal = t1; + this._extension = null; + }, + ExtensionStore__extendOrReplace(selector, source, targets, mode, span) { + var t1, t2, t3, t4, t5, t6, t7, t8, _i, complex, compound, t9, t10, t11, _i0, simple, t12, _i1, t13, t14, + extender = A.ExtensionStore$_mode(mode); + if (!selector.accept$1(B._IsInvisibleVisitor_true)) + extender._originals.addAll$1(0, selector.components); + for (t1 = targets.components, t2 = t1.length, t3 = source.components, t4 = t3.length, t5 = type$.ComplexSelector, t6 = type$.Extension, t7 = type$.SimpleSelector, t8 = type$.Map_ComplexSelector_Extension, _i = 0; _i < t2; ++_i) { + complex = t1[_i]; + compound = complex.get$singleCompound(); + if (compound == null) + throw A.wrapException(A.SassScriptException$("Can't extend complex selector " + A.S(complex) + ".", null)); + t9 = A.LinkedHashMap_LinkedHashMap$_empty(t7, t8); + for (t10 = compound.components, t11 = t10.length, _i0 = 0; _i0 < t11; ++_i0) { + simple = t10[_i0]; + t12 = A.LinkedHashMap_LinkedHashMap$_empty(t5, t6); + for (_i1 = 0; _i1 < t4; ++_i1) { + complex = t3[_i1]; + complex.get$specificity(); + t13 = new A.Extender(complex, false); + t14 = new A.Extension(t13, simple, null, true, span); + t13._extension = t14; + t12.$indexSet(0, complex, t14); + } + t9.$indexSet(0, simple, t12); + } + selector = extender._extendList$2(selector, t9); + } + return selector; + }, + ExtensionStore$() { + var t1 = type$.SimpleSelector; + return new A.ExtensionStore(A.LinkedHashMap_LinkedHashMap$_empty(t1, type$.Set_ModifiableBox_SelectorList), A.LinkedHashMap_LinkedHashMap$_empty(t1, type$.Map_ComplexSelector_Extension), A.LinkedHashMap_LinkedHashMap$_empty(t1, type$.List_Extension), A.LinkedHashMap_LinkedHashMap$_empty(type$.ModifiableBox_SelectorList, type$.List_CssMediaQuery), new A.JsIdentityLinkedHashMap(type$.JsIdentityLinkedHashMap_SimpleSelector_int), new A._LinkedIdentityHashSet(type$._LinkedIdentityHashSet_ComplexSelector), B.ExtendMode_normal_normal); + }, + ExtensionStore$_mode(_mode) { + var t1 = type$.SimpleSelector; + return new A.ExtensionStore(A.LinkedHashMap_LinkedHashMap$_empty(t1, type$.Set_ModifiableBox_SelectorList), A.LinkedHashMap_LinkedHashMap$_empty(t1, type$.Map_ComplexSelector_Extension), A.LinkedHashMap_LinkedHashMap$_empty(t1, type$.List_Extension), A.LinkedHashMap_LinkedHashMap$_empty(type$.ModifiableBox_SelectorList, type$.List_CssMediaQuery), new A.JsIdentityLinkedHashMap(type$.JsIdentityLinkedHashMap_SimpleSelector_int), new A._LinkedIdentityHashSet(type$._LinkedIdentityHashSet_ComplexSelector), _mode); + }, + ExtensionStore: function ExtensionStore(t0, t1, t2, t3, t4, t5, t6) { + var _ = this; + _._selectors = t0; + _._extensions = t1; + _._extensionsByExtender = t2; + _._mediaContexts = t3; + _._sourceSpecificity = t4; + _._originals = t5; + _._mode = t6; + }, + ExtensionStore_extensionsWhereTarget_closure: function ExtensionStore_extensionsWhereTarget_closure() { + }, + ExtensionStore__registerSelector_closure: function ExtensionStore__registerSelector_closure() { + }, + ExtensionStore_addExtension_closure: function ExtensionStore_addExtension_closure() { + }, + ExtensionStore_addExtension_closure0: function ExtensionStore_addExtension_closure0() { + }, + ExtensionStore_addExtension_closure1: function ExtensionStore_addExtension_closure1(t0) { + this.complex = t0; + }, + ExtensionStore__extendExistingExtensions_closure: function ExtensionStore__extendExistingExtensions_closure() { + }, + ExtensionStore__extendExistingExtensions_closure0: function ExtensionStore__extendExistingExtensions_closure0() { + }, + ExtensionStore_addExtensions_closure: function ExtensionStore_addExtensions_closure() { + }, + ExtensionStore__extendComplex_closure: function ExtensionStore__extendComplex_closure(t0, t1, t2) { + this._box_0 = t0; + this.$this = t1; + this.complex = t2; + }, + ExtensionStore__extendComplex__closure: function ExtensionStore__extendComplex__closure(t0, t1, t2) { + this._box_0 = t0; + this.$this = t1; + this.complex = t2; + }, + ExtensionStore__extendCompound_closure: function ExtensionStore__extendCompound_closure() { + }, + ExtensionStore__extendCompound_closure0: function ExtensionStore__extendCompound_closure0() { + }, + ExtensionStore__extendCompound_closure1: function ExtensionStore__extendCompound_closure1(t0) { + this.original = t0; + }, + ExtensionStore__extendSimple_withoutPseudo: function ExtensionStore__extendSimple_withoutPseudo(t0, t1, t2) { + this.$this = t0; + this.extensions = t1; + this.targetsUsed = t2; + }, + ExtensionStore__extendSimple_closure: function ExtensionStore__extendSimple_closure(t0, t1) { + this.$this = t0; + this.withoutPseudo = t1; + }, + ExtensionStore__extendSimple_closure0: function ExtensionStore__extendSimple_closure0() { + }, + ExtensionStore__extendPseudo_closure: function ExtensionStore__extendPseudo_closure() { + }, + ExtensionStore__extendPseudo_closure0: function ExtensionStore__extendPseudo_closure0() { + }, + ExtensionStore__extendPseudo_closure1: function ExtensionStore__extendPseudo_closure1() { + }, + ExtensionStore__extendPseudo_closure2: function ExtensionStore__extendPseudo_closure2(t0) { + this.pseudo = t0; + }, + ExtensionStore__extendPseudo_closure3: function ExtensionStore__extendPseudo_closure3(t0, t1) { + this.pseudo = t0; + this.selector = t1; + }, + ExtensionStore__trim_closure: function ExtensionStore__trim_closure(t0, t1) { + this._box_0 = t0; + this.complex1 = t1; + }, + ExtensionStore__trim_closure0: function ExtensionStore__trim_closure0(t0, t1) { + this._box_0 = t0; + this.complex1 = t1; + }, + ExtensionStore_clone_closure: function ExtensionStore_clone_closure(t0, t1, t2, t3) { + var _ = this; + _.$this = t0; + _.newSelectors = t1; + _.oldToNewSelectors = t2; + _.newMediaContexts = t3; + }, + unifyComplex(complexes, span) { + var t2, trailingCombinator, leadingCombinator, unifiedBase, t3, t4, _0_6, t5, _0_6_isSet, newLeadingCombinator, base, _1_1, newTrailingCombinator, _i, t6, t7, t8, _null = null, + t1 = J.getInterceptor$asx(complexes); + if (t1.get$length(complexes) === 1) + return complexes; + for (t2 = t1.get$iterator(complexes), trailingCombinator = _null, leadingCombinator = trailingCombinator, unifiedBase = leadingCombinator; t2.moveNext$0();) { + t3 = t2.get$current(t2); + if (t3.accept$1(B.C__IsUselessVisitor)) + return _null; + t4 = t3.components; + if (t4.length === 1) { + _0_6 = t3.leadingCombinators; + t5 = _0_6.length === 1; + _0_6_isSet = true; + } else { + _0_6 = _null; + _0_6_isSet = false; + t5 = false; + } + if (t5) { + newLeadingCombinator = (_0_6_isSet ? _0_6 : t3.leadingCombinators)[0]; + if (leadingCombinator == null) + leadingCombinator = newLeadingCombinator; + else if (!(leadingCombinator.$ti._is(newLeadingCombinator) && J.$eq$(newLeadingCombinator.value, leadingCombinator.value))) + return _null; + } + base = B.JSArray_methods.get$last(t4); + _1_1 = base.combinators; + if (_1_1.length === 1) { + newTrailingCombinator = _1_1[0]; + if (trailingCombinator != null) + t3 = !(trailingCombinator.$ti._is(newTrailingCombinator) && J.$eq$(newTrailingCombinator.value, trailingCombinator.value)); + else + t3 = false; + if (t3) + return _null; + trailingCombinator = newTrailingCombinator; + } + if (unifiedBase == null) + unifiedBase = base.selector.components; + else + for (t3 = base.selector.components, t4 = t3.length, _i = 0; _i < t4; ++_i) { + unifiedBase = t3[_i].unify$1(unifiedBase); + if (unifiedBase == null) + return _null; + } + } + t2 = type$.JSArray_ComplexSelector; + t3 = A._setArrayType([], t2); + for (t4 = t1.get$iterator(complexes); t4.moveNext$0();) { + t5 = t4.get$current(t4); + t6 = t5.components; + t7 = t6.length; + if (t7 > 1) { + t8 = t5.leadingCombinators; + t3.push(A.ComplexSelector$(t8, B.JSArray_methods.take$1(t6, t7 - 1), t5.span, t5.lineBreak)); + } + } + t4 = leadingCombinator == null ? B.List_empty1 : A._setArrayType([leadingCombinator], type$.JSArray_CssValue_Combinator); + unifiedBase.toString; + t5 = A.CompoundSelector$(unifiedBase, span); + t6 = trailingCombinator == null ? B.List_empty1 : A._setArrayType([trailingCombinator], type$.JSArray_CssValue_Combinator); + base = A.ComplexSelector$(t4, A._setArrayType([new A.ComplexSelectorComponent(t5, A.List_List$unmodifiable(t6, type$.CssValue_Combinator), span)], type$.JSArray_ComplexSelectorComponent), span, t1.any$1(complexes, new A.unifyComplex_closure())); + if (t3.length === 0) + t1 = A._setArrayType([base], t2); + else { + t1 = A.List_List$of(A.IterableExtension_get_exceptLast(t3), true, type$.ComplexSelector); + t1.push(B.JSArray_methods.get$last(t3).concatenate$2(base, span)); + } + return A.weave(t1, span, false); + }, + unifyCompound(compound1, compound2) { + var t1, t2, _i, unified, + result = compound2.components; + for (t1 = compound1.components, t2 = t1.length, _i = 0; _i < t2; ++_i, result = unified) { + unified = t1[_i].unify$1(result); + if (unified == null) + return null; + } + return A.CompoundSelector$(result, compound1.span); + }, + unifyUniversalAndElement(selector1, selector2) { + var namespace, $name, t1, + _0_0 = A._namespaceAndName(selector1, "selector1"), + namespace1 = _0_0._0, + name1 = _0_0._1, + _1_0 = A._namespaceAndName(selector2, "selector2"), + namespace2 = _1_0._0, + name2 = _1_0._1; + if (namespace1 == namespace2 || namespace2 === "*") + namespace = namespace1; + else { + if (namespace1 !== "*") + return null; + namespace = namespace2; + } + if (name1 == name2 || name2 == null) + $name = name1; + else { + if (!(name1 == null || name1 === "*")) + return null; + $name = name2; + } + t1 = selector1.span; + return $name == null ? new A.UniversalSelector(namespace, t1) : new A.TypeSelector(new A.QualifiedName($name, namespace), t1); + }, + _namespaceAndName(selector, $name) { + var t1, _0_4; + $label0$0: { + if (selector instanceof A.UniversalSelector) { + t1 = new A._Record_2(selector.namespace, null); + break $label0$0; + } + if (selector instanceof A.TypeSelector) { + _0_4 = selector.name; + t1 = new A._Record_2(_0_4.namespace, _0_4.name); + break $label0$0; + } + t1 = A.throwExpression(A.ArgumentError$value(selector, $name, string$.must_b)); + } + return t1; + }, + weave(complexes, span, forceLineBreak) { + var complex, t2, prefixes, t3, t4, t5, t6, i, t7, t8, _i, t9, t10, _i0, parentPrefix, t11, t12, + t1 = J.getInterceptor$asx(complexes); + if (t1.get$length(complexes) === 1) { + complex = t1.$index(complexes, 0); + if (!forceLineBreak || complex.lineBreak) + return complexes; + return A._setArrayType([A.ComplexSelector$(complex.leadingCombinators, complex.components, complex.span, true)], type$.JSArray_ComplexSelector); + } + t2 = type$.JSArray_ComplexSelector; + prefixes = A._setArrayType([t1.get$first(complexes)], t2); + for (t1 = t1.skip$1(complexes, 1), t3 = A._instanceType(t1), t1 = new A.ListIterator(t1, t1.get$length(t1), t3._eval$1("ListIterator")), t4 = type$.ComplexSelectorComponent, t3 = t3._eval$1("ListIterable.E"); t1.moveNext$0();) { + t5 = t1.__internal$_current; + if (t5 == null) + t5 = t3._as(t5); + t6 = t5.components; + if (t6.length === 1) { + for (i = 0; i < prefixes.length; ++i) + prefixes[i] = prefixes[i].concatenate$3$forceLineBreak(t5, span, forceLineBreak); + continue; + } + t7 = A._setArrayType([], t2); + for (t8 = prefixes.length, _i = 0; _i < prefixes.length; prefixes.length === t8 || (0, A.throwConcurrentModificationError)(prefixes), ++_i) { + t9 = A._weaveParents(prefixes[_i], t5, span); + if (t9 == null) + t9 = B.List_empty2; + t10 = t9.length; + _i0 = 0; + for (; _i0 < t9.length; t9.length === t10 || (0, A.throwConcurrentModificationError)(t9), ++_i0) { + parentPrefix = t9[_i0]; + t11 = B.JSArray_methods.get$last(t6); + t12 = A.List_List$of(parentPrefix.components, true, t4); + t12.push(t11); + t11 = parentPrefix.lineBreak || forceLineBreak; + t7.push(A.ComplexSelector$(parentPrefix.leadingCombinators, t12, span, t11)); + } + } + prefixes = t7; + } + return prefixes; + }, + _weaveParents(prefix, base, span) { + var t1, queue1, queue2, trailingCombinators, _0_1, _0_3, rootish1, rootish2, _0_30, t2, _0_3_isSet, rootish, t3, rootish_case_0, rootish_case_1, groups1, groups2, lcs, choices, t4, _i, group, t5, t6, t7, _i0, chunk, t8, t9, _null = null, + leadingCombinators = A._mergeLeadingCombinators(prefix.leadingCombinators, base.leadingCombinators); + if (leadingCombinators == null) + return _null; + t1 = type$.ComplexSelectorComponent; + queue1 = A.QueueList_QueueList$from(prefix.components, t1); + queue2 = A.QueueList_QueueList$from(A.IterableExtension_get_exceptLast(base.components), t1); + trailingCombinators = A._mergeTrailingCombinators(queue1, queue2, span, _null); + if (trailingCombinators == null) + return _null; + $label0$0: { + _0_1 = A._firstIfRootish(queue1); + _0_3 = A._firstIfRootish(queue2); + if (_0_1 != null) { + rootish1 = _0_1 == null ? t1._as(_0_1) : _0_1; + if (_0_3 != null) { + rootish2 = _0_3 == null ? t1._as(_0_3) : _0_3; + _0_30 = _0_3; + t2 = true; + } else { + rootish2 = _null; + _0_30 = _0_3; + t2 = false; + } + _0_3_isSet = true; + } else { + rootish2 = _null; + rootish1 = rootish2; + _0_30 = rootish1; + _0_3_isSet = false; + t2 = false; + } + if (t2) { + rootish = A.unifyCompound(rootish1.selector, rootish2.selector); + if (rootish == null) + return _null; + t1 = rootish1.combinators; + t2 = rootish1.span; + t3 = type$.CssValue_Combinator; + queue1.addFirst$1(new A.ComplexSelectorComponent(rootish, A.List_List$unmodifiable(t1, t3), t2)); + queue2.addFirst$1(new A.ComplexSelectorComponent(rootish, A.List_List$unmodifiable(rootish2.combinators, t3), t2)); + break $label0$0; + } + if (_0_1 != null) { + rootish_case_0 = _0_1 == null ? t1._as(_0_1) : _0_1; + if (_0_3_isSet) + t2 = _0_30; + else { + t2 = _0_3; + _0_30 = t2; + _0_3_isSet = true; + } + if (t2 == null) { + t2 = rootish_case_0; + t3 = true; + } else { + t2 = _null; + t3 = false; + } + } else { + t2 = _null; + t3 = false; + } + if (!t3) + if (_0_1 == null) { + if (_0_3_isSet) + t3 = _0_30; + else { + t3 = _0_3; + _0_30 = t3; + _0_3_isSet = true; + } + if (t3 != null) { + rootish_case_1 = _0_3_isSet ? _0_30 : _0_3; + if (rootish_case_1 == null) + rootish_case_1 = t1._as(rootish_case_1); + t1 = rootish_case_1; + t2 = true; + } else { + t1 = t2; + t2 = false; + } + } else { + t1 = t2; + t2 = false; + } + else { + t1 = t2; + t2 = true; + } + if (t2) { + queue1.addFirst$1(t1); + queue2.addFirst$1(t1); + } + } + groups1 = A._groupSelectors(queue1); + groups2 = A._groupSelectors(queue2); + t1 = type$.List_ComplexSelectorComponent; + lcs = A.longestCommonSubsequence(groups2, groups1, new A._weaveParents_closure(span), t1); + choices = A._setArrayType([], type$.JSArray_List_Iterable_ComplexSelectorComponent); + for (t2 = lcs.length, t3 = type$.JSArray_Iterable_ComplexSelectorComponent, t4 = type$.JSArray_ComplexSelectorComponent, _i = 0; _i < lcs.length; lcs.length === t2 || (0, A.throwConcurrentModificationError)(lcs), ++_i) { + group = lcs[_i]; + t5 = A._setArrayType([], t3); + for (t6 = A._chunks(groups1, groups2, new A._weaveParents_closure0(group), t1), t7 = t6.length, _i0 = 0; _i0 < t6.length; t6.length === t7 || (0, A.throwConcurrentModificationError)(t6), ++_i0) { + chunk = t6[_i0]; + t8 = A._setArrayType([], t4); + for (t9 = B.JSArray_methods.get$iterator(chunk); t9.moveNext$0();) + B.JSArray_methods.addAll$1(t8, t9.get$current(0)); + t5.push(t8); + } + choices.push(t5); + choices.push(A._setArrayType([group], t3)); + groups1.removeFirst$0(); + groups2.removeFirst$0(); + } + t2 = A._setArrayType([], t3); + for (t1 = A._chunks(groups1, groups2, new A._weaveParents_closure1(), t1), t3 = t1.length, _i = 0; _i < t1.length; t1.length === t3 || (0, A.throwConcurrentModificationError)(t1), ++_i) { + chunk = t1[_i]; + t5 = A._setArrayType([], t4); + for (t6 = B.JSArray_methods.get$iterator(chunk); t6.moveNext$0();) + B.JSArray_methods.addAll$1(t5, t6.get$current(0)); + t2.push(t5); + } + choices.push(t2); + B.JSArray_methods.addAll$1(choices, trailingCombinators); + t1 = A._setArrayType([], type$.JSArray_ComplexSelector); + for (t2 = J.get$iterator$ax(A.paths(new A.WhereIterable(choices, new A._weaveParents_closure2(), type$.WhereIterable_List_Iterable_ComplexSelectorComponent), type$.Iterable_ComplexSelectorComponent)), t3 = !prefix.lineBreak, t5 = base.lineBreak; t2.moveNext$0();) { + t6 = t2.get$current(t2); + t7 = A._setArrayType([], t4); + for (t6 = J.get$iterator$ax(t6); t6.moveNext$0();) + B.JSArray_methods.addAll$1(t7, t6.get$current(t6)); + t1.push(A.ComplexSelector$(leadingCombinators, t7, span, !t3 || t5)); + } + return t1; + }, + _firstIfRootish(queue) { + var first, t1, t2, _i, simple, t3; + if (queue.get$length(0) >= 1) { + first = queue.$index(0, 0); + for (t1 = first.selector.components, t2 = t1.length, _i = 0; _i < t2; ++_i) { + simple = t1[_i]; + if (simple instanceof A.PseudoSelector) + if (simple.isClass) + t3 = $._rootishPseudoClasses.contains$1(0, simple.normalizedName); + else + t3 = false; + else + t3 = false; + if (t3) { + queue.removeFirst$0(); + return first; + } + } + } + return null; + }, + _mergeLeadingCombinators(combinators1, combinators2) { + var _0_4, _0_4_isSet, t1, _0_7, t2, _0_1, _0_7_isSet, _0_11, _0_11_isSet, combinators, _null = null; + $label0$0: { + _0_4 = combinators2; + _0_4_isSet = true; + t1 = false; + if (t1) { + t1 = _null; + break $label0$0; + } + t1 = type$.List_CssValue_Combinator; + if (t1._is(combinators1)) { + _0_7 = combinators1.length; + t2 = _0_7; + _0_1 = combinators1; + t2 = t2 > 1; + _0_7_isSet = true; + } else { + _0_7 = _null; + _0_1 = combinators1; + _0_7_isSet = false; + t2 = false; + } + if (!t2) { + if (_0_4_isSet) + t2 = _0_4; + else { + t2 = combinators2; + _0_4 = t2; + _0_4_isSet = true; + } + if (t1._is(t2)) { + if (_0_4_isSet) + t2 = _0_4; + else { + t2 = combinators2; + _0_4 = t2; + _0_4_isSet = true; + } + _0_11 = (t2 == null ? t1._as(t2) : t2).length; + t2 = _0_11; + t2 = t2 > 1; + _0_11_isSet = true; + } else { + _0_11 = _null; + _0_11_isSet = false; + t2 = false; + } + } else { + _0_11 = _null; + _0_11_isSet = false; + t2 = true; + } + if (t2) { + t1 = _null; + break $label0$0; + } + if (t1._is(_0_1)) { + if (_0_7_isSet) + t2 = _0_7; + else { + _0_7 = _0_1.length; + t2 = _0_7; + } + if (t2 <= 0) { + if (_0_4_isSet) + combinators = _0_4; + else { + combinators = combinators2; + _0_4 = combinators; + _0_4_isSet = true; + } + t2 = true; + } else { + combinators = _null; + t2 = false; + } + } else { + combinators = _null; + t2 = false; + } + if (!t2) { + if (_0_4_isSet) + t2 = _0_4; + else { + t2 = combinators2; + _0_4 = t2; + _0_4_isSet = true; + } + if (t1._is(t2)) { + if (_0_11_isSet) + t1 = _0_11; + else { + t2 = _0_4_isSet ? _0_4 : combinators2; + _0_11 = (t2 == null ? t1._as(t2) : t2).length; + t1 = _0_11; + } + t1 = t1 <= 0; + } else + t1 = false; + combinators = _0_1; + } else + t1 = true; + if (t1) { + t1 = combinators; + break $label0$0; + } + t1 = B.C_ListEquality.equals$2(0, combinators1, combinators2) ? combinators1 : _null; + break $label0$0; + } + return t1; + }, + _mergeTrailingCombinators(components1, components2, span, result) { + var _0_1, t1, _1_1, t2, t3, _4_1, _4_3, _4_4, _4_5, _4_5_isSet, _4_4_isSet, component1, component2, t4, t5, choices, _2_0, _4_9, _4_6, _4_7, nextComponents, followingComponents, _4_6_isSet, _4_7_isSet, _4_9_isSet, _4_10, _4_1_isSet, _4_10_isSet, next, following, _3_0, siblingComponents_case_0, siblingComponents_case_1, combinator1, combinator2, unified, combinator_case_0, combinatorComponents_case_0, descendantComponents_case_0, combinator_case_1, descendantComponents_case_1, combinatorComponents_case_1, _null = null; + if (result == null) + result = A.QueueList$(_null, type$.List_List_ComplexSelectorComponent); + $label0$0: { + _0_1 = components1.get$length(0); + if (_0_1 >= 1) { + t1 = components1.$index(0, _0_1 - 1).combinators; + break $label0$0; + } + t1 = B.List_empty1; + break $label0$0; + } + $label1$1: { + _1_1 = components2.get$length(0); + if (_1_1 >= 1) { + t2 = components2.$index(0, _1_1 - 1).combinators; + break $label1$1; + } + t2 = B.List_empty1; + break $label1$1; + } + t3 = t1.length; + if (t3 === 0 && t2.length === 0) + return result; + if (t3 > 1 || t2.length > 1) + return _null; + $label2$2: { + t3 = A.IterableExtension_get_firstOrNull(t1); + t3 = t3 == null ? _null : t3.value; + t2 = A.IterableExtension_get_firstOrNull(t2); + t2 = [t3, t2 == null ? _null : t2.value, components1, components2]; + _4_1 = t2[0]; + _4_3 = B.Combinator_Htt === _4_1; + t3 = _4_3; + if (t3) { + _4_4 = t2[1]; + _4_5 = B.Combinator_Htt === _4_4; + t3 = _4_5; + _4_5_isSet = true; + _4_4_isSet = true; + } else { + _4_4 = _null; + _4_5 = _4_4; + _4_5_isSet = false; + _4_4_isSet = false; + t3 = false; + } + if (t3) { + component1 = components1.removeLast$0(0); + component2 = components2.removeLast$0(0); + t2 = component1.selector; + t3 = component2.selector; + if (A.compoundIsSuperselector(t2, t3, _null)) + result.addFirst$1(A._setArrayType([A._setArrayType([component2], type$.JSArray_ComplexSelectorComponent)], type$.JSArray_List_ComplexSelectorComponent)); + else { + t4 = type$.JSArray_ComplexSelectorComponent; + t5 = type$.JSArray_List_ComplexSelectorComponent; + if (A.compoundIsSuperselector(t3, t2, _null)) + result.addFirst$1(A._setArrayType([A._setArrayType([component1], t4)], t5)); + else { + choices = A._setArrayType([A._setArrayType([component1, component2], t4), A._setArrayType([component2, component1], t4)], t5); + _2_0 = A.unifyCompound(t2, t3); + if (_2_0 != null) + choices.push(A._setArrayType([new A.ComplexSelectorComponent(_2_0, A.List_List$unmodifiable(A._setArrayType([B.JSArray_methods.get$first(t1)], type$.JSArray_CssValue_Combinator), type$.CssValue_Combinator), span)], t4)); + result.addFirst$1(choices); + } + } + break $label2$2; + } + if (_4_3) { + if (_4_4_isSet) + t3 = _4_4; + else { + _4_4 = t2[1]; + t3 = _4_4; + _4_4_isSet = true; + } + _4_9 = B.Combinator_4QF === t3; + t3 = _4_9; + if (t3) { + _4_6 = t2[2]; + _4_7 = t2[3]; + nextComponents = _4_7; + followingComponents = _4_6; + _4_6_isSet = true; + _4_7_isSet = true; + t3 = true; + } else { + nextComponents = _null; + followingComponents = nextComponents; + _4_7 = followingComponents; + _4_6 = _4_7; + _4_6_isSet = false; + _4_7_isSet = false; + t3 = false; + } + _4_9_isSet = true; + } else { + nextComponents = _null; + followingComponents = nextComponents; + _4_7 = followingComponents; + _4_6 = _4_7; + _4_9 = _4_6; + _4_9_isSet = false; + _4_6_isSet = false; + _4_7_isSet = false; + t3 = false; + } + if (!t3) { + _4_10 = B.Combinator_4QF === _4_1; + t3 = _4_10; + _4_1_isSet = true; + if (t3) { + if (_4_5_isSet) + t3 = _4_5; + else { + if (_4_4_isSet) + t3 = _4_4; + else { + _4_4 = t2[1]; + t3 = _4_4; + _4_4_isSet = true; + } + _4_5 = B.Combinator_Htt === t3; + t3 = _4_5; + _4_5_isSet = true; + } + if (t3) { + if (_4_6_isSet) + nextComponents = _4_6; + else { + _4_6 = t2[2]; + nextComponents = _4_6; + _4_6_isSet = true; + } + if (_4_7_isSet) + followingComponents = _4_7; + else { + _4_7 = t2[3]; + followingComponents = _4_7; + _4_7_isSet = true; + } + t3 = true; + } else + t3 = false; + } else + t3 = false; + _4_10_isSet = true; + } else { + _4_10 = _null; + _4_1_isSet = true; + _4_10_isSet = false; + t3 = true; + } + if (t3) { + next = nextComponents.removeLast$0(0); + following = followingComponents.removeLast$0(0); + t1 = following.selector; + t2 = next.selector; + t3 = type$.JSArray_ComplexSelectorComponent; + t4 = type$.JSArray_List_ComplexSelectorComponent; + if (A.compoundIsSuperselector(t1, t2, _null)) + result.addFirst$1(A._setArrayType([A._setArrayType([next], t3)], t4)); + else { + t4 = A._setArrayType([A._setArrayType([following, next], t3)], t4); + _3_0 = A.unifyCompound(t1, t2); + if (_3_0 != null) + t4.push(A._setArrayType([new A.ComplexSelectorComponent(_3_0, A.List_List$unmodifiable(next.combinators, type$.CssValue_Combinator), span)], t3)); + result.addFirst$1(t4); + } + break $label2$2; + } + if (_4_1_isSet) + t3 = _4_1; + else { + _4_1 = t2[0]; + t3 = _4_1; + _4_1_isSet = true; + } + if (B.Combinator_Cht === t3) { + if (_4_9_isSet) + t3 = _4_9; + else { + if (_4_4_isSet) + t3 = _4_4; + else { + _4_4 = t2[1]; + t3 = _4_4; + _4_4_isSet = true; + } + _4_9 = B.Combinator_4QF === t3; + t3 = _4_9; + } + if (!t3) + if (_4_5_isSet) + t3 = _4_5; + else { + if (_4_4_isSet) + t3 = _4_4; + else { + _4_4 = t2[1]; + t3 = _4_4; + _4_4_isSet = true; + } + _4_5 = B.Combinator_Htt === t3; + t3 = _4_5; + } + else + t3 = true; + if (t3) { + if (_4_7_isSet) + siblingComponents_case_0 = _4_7; + else { + _4_7 = t2[3]; + siblingComponents_case_0 = _4_7; + _4_7_isSet = true; + } + t3 = siblingComponents_case_0; + t4 = true; + } else { + t3 = _null; + t4 = false; + } + } else { + t3 = _null; + t4 = false; + } + if (!t4) { + if (_4_10_isSet) + t4 = _4_10; + else { + if (_4_1_isSet) + t4 = _4_1; + else { + _4_1 = t2[0]; + t4 = _4_1; + _4_1_isSet = true; + } + _4_10 = B.Combinator_4QF === t4; + t4 = _4_10; + } + if (!t4) + t4 = _4_3; + else + t4 = true; + if (t4) { + if (_4_4_isSet) + t4 = _4_4; + else { + _4_4 = t2[1]; + t4 = _4_4; + _4_4_isSet = true; + } + if (B.Combinator_Cht === t4) { + if (_4_6_isSet) + siblingComponents_case_1 = _4_6; + else { + _4_6 = t2[2]; + siblingComponents_case_1 = _4_6; + _4_6_isSet = true; + } + t3 = siblingComponents_case_1; + t4 = true; + } else + t4 = false; + } else + t4 = false; + } else + t4 = true; + if (t4) { + result.addFirst$1(A._setArrayType([A._setArrayType([t3.removeLast$0(0)], type$.JSArray_ComplexSelectorComponent)], type$.JSArray_List_ComplexSelectorComponent)); + break $label2$2; + } + if (_4_1_isSet) + t3 = _4_1; + else { + _4_1 = t2[0]; + t3 = _4_1; + _4_1_isSet = true; + } + if (t3 != null) { + if (_4_1_isSet) + combinator1 = _4_1; + else { + _4_1 = t2[0]; + combinator1 = _4_1; + _4_1_isSet = true; + } + if (combinator1 == null) + combinator1 = type$.Combinator._as(combinator1); + if (_4_4_isSet) + t3 = _4_4; + else { + _4_4 = t2[1]; + t3 = _4_4; + _4_4_isSet = true; + } + if (t3 != null) { + if (_4_4_isSet) + combinator2 = _4_4; + else { + _4_4 = t2[1]; + combinator2 = _4_4; + _4_4_isSet = true; + } + t3 = combinator1 === (combinator2 == null ? type$.Combinator._as(combinator2) : combinator2); + } else + t3 = false; + } else + t3 = false; + if (t3) { + unified = A.unifyCompound(components1.removeLast$0(0).selector, components2.removeLast$0(0).selector); + if (unified == null) + return _null; + result.addFirst$1(A._setArrayType([A._setArrayType([new A.ComplexSelectorComponent(unified, A.List_List$unmodifiable(A._setArrayType([B.JSArray_methods.get$first(t1)], type$.JSArray_CssValue_Combinator), type$.CssValue_Combinator), span)], type$.JSArray_ComplexSelectorComponent)], type$.JSArray_List_ComplexSelectorComponent)); + break $label2$2; + } + if (_4_1_isSet) + t1 = _4_1; + else { + _4_1 = t2[0]; + t1 = _4_1; + _4_1_isSet = true; + } + if (t1 != null) { + if (_4_1_isSet) + combinator_case_0 = _4_1; + else { + _4_1 = t2[0]; + combinator_case_0 = _4_1; + _4_1_isSet = true; + } + if (combinator_case_0 == null) + combinator_case_0 = type$.Combinator._as(combinator_case_0); + if (_4_4_isSet) + t1 = _4_4; + else { + _4_4 = t2[1]; + t1 = _4_4; + _4_4_isSet = true; + } + if (t1 == null) { + if (_4_6_isSet) + combinatorComponents_case_0 = _4_6; + else { + _4_6 = t2[2]; + combinatorComponents_case_0 = _4_6; + _4_6_isSet = true; + } + if (_4_7_isSet) + descendantComponents_case_0 = _4_7; + else { + _4_7 = t2[3]; + descendantComponents_case_0 = _4_7; + _4_7_isSet = true; + } + t1 = descendantComponents_case_0; + t3 = true; + t5 = t3; + t3 = combinatorComponents_case_0; + t4 = t1; + t1 = combinator_case_0; + } else { + t4 = _null; + t3 = t4; + t1 = t3; + t5 = false; + } + } else { + t4 = _null; + t3 = t4; + t1 = t3; + t5 = false; + } + if (!t5) + if ((_4_1_isSet ? _4_1 : t2[0]) == null) { + if (_4_4_isSet) + t5 = _4_4; + else { + _4_4 = t2[1]; + t5 = _4_4; + _4_4_isSet = true; + } + if (t5 != null) { + combinator_case_1 = _4_4_isSet ? _4_4 : t2[1]; + if (combinator_case_1 == null) + combinator_case_1 = type$.Combinator._as(combinator_case_1); + descendantComponents_case_1 = _4_6_isSet ? _4_6 : t2[2]; + combinatorComponents_case_1 = _4_7_isSet ? _4_7 : t2[3]; + t1 = combinatorComponents_case_1; + t2 = true; + t3 = t2; + t2 = descendantComponents_case_1; + t4 = t3; + t3 = t2; + t2 = t1; + t1 = combinator_case_1; + } else { + t2 = t3; + t3 = t4; + t4 = false; + } + } else { + t2 = t3; + t3 = t4; + t4 = false; + } + else { + t2 = t3; + t3 = t4; + t4 = true; + } + if (t4) { + if (t1 === B.Combinator_Cht) { + t1 = A.IterableExtension_get_lastOrNull(t3); + t1 = t1 == null ? _null : A.compoundIsSuperselector(t1.selector, t2.get$last(t2).selector, _null); + t1 = t1 === true; + } else + t1 = false; + if (t1) + t3.removeLast$0(0); + result.addFirst$1(A._setArrayType([A._setArrayType([t2.removeLast$0(0)], type$.JSArray_ComplexSelectorComponent)], type$.JSArray_List_ComplexSelectorComponent)); + break $label2$2; + } + return _null; + } + return A._mergeTrailingCombinators(components1, components2, span, result); + }, + _mustUnify(complex1, complex2) { + var t2, t3, t4, + t1 = A.LinkedHashSet_LinkedHashSet$_empty(type$.SimpleSelector); + for (t2 = J.get$iterator$ax(complex1); t2.moveNext$0();) + for (t3 = B.JSArray_methods.get$iterator(t2.get$current(t2).selector.components), t4 = new A.WhereIterator(t3, A.functions___isUnique$closure()); t4.moveNext$0();) + t1.add$1(0, t3.get$current(0)); + if (t1._collection$_length === 0) + return false; + return J.any$1$ax(complex2, new A._mustUnify_closure(t1)); + }, + _isUnique(simple) { + var t1; + if (!(simple instanceof A.IDSelector)) + t1 = simple instanceof A.PseudoSelector && !simple.isClass; + else + t1 = true; + return t1; + }, + _chunks(queue1, queue2, done, $T) { + var chunk2, _0_4, _0_1, _0_7, _0_5, _0_7_isSet, _0_5_isSet, chunk, t2, _null = null, + t1 = $T._eval$1("JSArray<0>"), + chunk1 = A._setArrayType([], t1); + for (; !done.call$1(queue1);) + chunk1.push(queue1.removeFirst$0()); + chunk2 = A._setArrayType([], t1); + for (; !done.call$1(queue2);) + chunk2.push(queue2.removeFirst$0()); + $label0$0: { + _0_4 = chunk1.length <= 0; + t1 = _0_4; + _0_1 = chunk1; + if (t1) { + _0_7 = chunk2.length <= 0; + t1 = _0_7; + _0_5 = chunk2; + _0_7_isSet = true; + _0_5_isSet = true; + } else { + _0_5 = _null; + _0_7 = _0_5; + _0_7_isSet = false; + _0_5_isSet = false; + t1 = false; + } + if (t1) { + t1 = A._setArrayType([], $T._eval$1("JSArray>")); + break $label0$0; + } + if (_0_4) { + if (_0_5_isSet) + chunk = _0_5; + else { + chunk = chunk2; + _0_5 = chunk; + _0_5_isSet = true; + } + t1 = true; + } else { + chunk = _null; + t1 = false; + } + if (!t1) { + chunk = _0_1; + if (_0_7_isSet) + t1 = _0_7; + else { + _0_7 = (_0_5_isSet ? _0_5 : chunk2).length <= 0; + t1 = _0_7; + } + } else + t1 = true; + if (t1) { + t1 = A._setArrayType([chunk], $T._eval$1("JSArray>")); + break $label0$0; + } + t1 = A.List_List$of(chunk1, true, $T); + B.JSArray_methods.addAll$1(t1, chunk2); + t2 = A.List_List$of(chunk2, true, $T); + B.JSArray_methods.addAll$1(t2, chunk1); + t2 = A._setArrayType([t1, t2], $T._eval$1("JSArray>")); + t1 = t2; + break $label0$0; + } + return t1; + }, + paths(choices, $T) { + return J.fold$2$ax(choices, A._setArrayType([A._setArrayType([], $T._eval$1("JSArray<0>"))], $T._eval$1("JSArray>")), new A.paths_closure($T)); + }, + _groupSelectors(complex) { + var t2, t3, t4, + groups = A.QueueList$(null, type$.List_ComplexSelectorComponent), + t1 = type$.JSArray_ComplexSelectorComponent, + group = A._setArrayType([], t1); + for (t2 = complex.$ti, t3 = new A.ListIterator(complex, complex.get$length(0), t2._eval$1("ListIterator")), t2 = t2._eval$1("ListBase.E"); t3.moveNext$0();) { + t4 = t3.__internal$_current; + if (t4 == null) + t4 = t2._as(t4); + group.push(t4); + if (t4.combinators.length === 0) { + groups._queue_list$_add$1(group); + group = A._setArrayType([], t1); + } + } + if (group.length !== 0) + groups._queue_list$_add$1(group); + return groups; + }, + listIsSuperselector(list1, list2) { + return B.JSArray_methods.every$1(list2, new A.listIsSuperselector_closure(list1)); + }, + _complexIsParentSuperselector(complex1, complex2) { + var t1, base, t2; + if (J.get$length$asx(complex1) > J.get$length$asx(complex2)) + return false; + t1 = $.$get$bogusSpan(); + base = new A.ComplexSelectorComponent(A.CompoundSelector$(A._setArrayType([new A.PlaceholderSelector("", t1)], type$.JSArray_SimpleSelector), t1), A.List_List$unmodifiable(B.List_empty1, type$.CssValue_Combinator), t1); + t1 = type$.ComplexSelectorComponent; + t2 = A.List_List$of(complex1, true, t1); + t2.push(base); + t1 = A.List_List$of(complex2, true, t1); + t1.push(base); + return A.complexIsSuperselector(t2, t1); + }, + complexIsSuperselector(complex1, complex2) { + var t1, t2, t3, i1, i2, previousCombinator, remaining1, t4, remaining2, component1, t5, parents, endOfSubselector, component2, combinator1; + if (B.JSArray_methods.get$last(complex1).combinators.length !== 0) + return false; + if (B.JSArray_methods.get$last(complex2).combinators.length !== 0) + return false; + for (t1 = type$.JSArray_ComplexSelectorComponent, t2 = A._arrayInstanceType(complex2), t3 = t2._precomputed1, t2 = t2._eval$1("SubListIterable<1>"), i1 = 0, i2 = 0, previousCombinator = null; true; previousCombinator = combinator1) { + remaining1 = complex1.length - i1; + t4 = complex2.length; + remaining2 = t4 - i2; + if (remaining1 === 0 || remaining2 === 0) + return false; + if (remaining1 > remaining2) + return false; + component1 = complex1[i1]; + t5 = component1.combinators; + if (t5.length > 1) + return false; + if (remaining1 === 1) { + parents = B.JSArray_methods.sublist$2(complex2, i2, t4 - 1); + if (B.JSArray_methods.any$1(parents, new A.complexIsSuperselector_closure())) + return false; + return A.compoundIsSuperselector(component1.selector, B.JSArray_methods.get$last(complex2).selector, parents); + } + for (t4 = component1.selector, endOfSubselector = i2, parents = null; true;) { + component2 = complex2[endOfSubselector]; + if (component2.combinators.length > 1) + return false; + if (A.compoundIsSuperselector(t4, component2.selector, parents)) + break; + ++endOfSubselector; + if (endOfSubselector === complex2.length - 1) + return false; + if (parents == null) + parents = A._setArrayType([], t1); + parents.push(component2); + } + if (!A._compatibleWithPreviousCombinator(previousCombinator, parents == null ? B.List_empty0 : parents)) + return false; + component2 = complex2[endOfSubselector]; + combinator1 = A.IterableExtension_get_firstOrNull(t5); + if (!A._isSupercombinator(combinator1, A.IterableExtension_get_firstOrNull(component2.combinators))) + return false; + ++i1; + i2 = endOfSubselector + 1; + if (complex1.length - i1 === 1) { + t4 = combinator1 == null; + if (J.$eq$(t4 ? null : combinator1.value, B.Combinator_Htt)) { + t4 = complex2.length - 1; + t5 = new A.SubListIterable(complex2, 0, t4, t2); + t5.SubListIterable$3(complex2, 0, t4, t3); + if (!t5.skip$1(0, i2).every$1(0, new A.complexIsSuperselector_closure0(combinator1))) + return false; + } else if (!t4) + if (complex2.length - i2 > 1) + return false; + } + } + }, + _compatibleWithPreviousCombinator(previous, parents) { + if (parents.length === 0) + return true; + if (previous == null) + return true; + if (previous.value !== B.Combinator_Htt) + return false; + return B.JSArray_methods.every$1(parents, new A._compatibleWithPreviousCombinator_closure()); + }, + _isSupercombinator(combinator1, combinator2) { + var t1, t2; + if (!J.$eq$(combinator1, combinator2)) { + t1 = combinator1 == null; + if (t1) + t2 = J.$eq$(combinator2 == null ? null : combinator2.value, B.Combinator_Cht); + else + t2 = false; + if (!t2) + if (J.$eq$(t1 ? null : combinator1.value, B.Combinator_Htt)) + t1 = J.$eq$(combinator2 == null ? null : combinator2.value, B.Combinator_4QF); + else + t1 = false; + else + t1 = true; + } else + t1 = true; + return t1; + }, + compoundIsSuperselector(compound1, compound2, parents) { + var pseudo1, index1, pseudo2, index2, _0_50, _0_5_isSet, t2, t3, t4, t5, _i, simple1, _null = null, + _0_1 = A._findPseudoElementIndexed(compound1), + _0_5 = A._findPseudoElementIndexed(compound2), + t1 = type$.Record_2_nullable_Object_and_nullable_Object; + if (t1._is(_0_1)) { + pseudo1 = (_0_1 == null ? t1._as(_0_1) : _0_1)._0; + index1 = (_0_1 == null ? t1._as(_0_1) : _0_1)._1; + if (t1._is(_0_5)) { + pseudo2 = (_0_5 == null ? t1._as(_0_5) : _0_5)._0; + index2 = (_0_5 == null ? t1._as(_0_5) : _0_5)._1; + _0_50 = _0_5; + t1 = true; + } else { + index2 = _null; + pseudo2 = index2; + _0_50 = _0_5; + t1 = false; + } + _0_5_isSet = true; + } else { + index2 = _null; + pseudo2 = index2; + index1 = pseudo2; + pseudo1 = index1; + _0_50 = pseudo1; + _0_5_isSet = false; + t1 = false; + } + if (t1) { + if (pseudo1.isSuperselector$1(pseudo2)) { + t1 = compound1.components; + t2 = type$.int; + t3 = A._arrayInstanceType(t1)._precomputed1; + t4 = compound2.components; + t5 = A._arrayInstanceType(t4)._precomputed1; + t1 = A._compoundComponentsIsSuperselector(A.SubListIterable$(t1, 0, A.checkNotNullable(index1, "count", t2), t3), A.SubListIterable$(t4, 0, A.checkNotNullable(index2, "count", t2), t5), parents) && A._compoundComponentsIsSuperselector(A.SubListIterable$(t1, index1 + 1, _null, t3), A.SubListIterable$(t4, index2 + 1, _null, t5), parents); + } else + t1 = false; + return t1; + } + if (!(_0_1 != null && true)) + t1 = (_0_5_isSet ? _0_50 : _0_5) != null && true; + else + t1 = true; + if (t1) + return false; + for (t1 = compound1.components, t2 = t1.length, t3 = compound2.components, _i = 0; _i < t2; ++_i) { + simple1 = t1[_i]; + if (simple1 instanceof A.PseudoSelector && simple1.selector != null && true) { + if (!A._selectorPseudoIsSuperselector(simple1, compound2, parents)) + return false; + } else if (!B.JSArray_methods.any$1(t3, simple1.get$isSuperselector())) + return false; + } + return true; + }, + _findPseudoElementIndexed(compound) { + var t1, t2, i, simple; + for (t1 = compound.components, t2 = t1.length, i = 0; i < t2; ++i) { + simple = t1[i]; + if (simple instanceof A.PseudoSelector && !simple.isClass) + return new A._Record_2(simple, i); + } + return null; + }, + _compoundComponentsIsSuperselector(compound1, compound2, parents) { + var t1; + if (compound1.get$length(0) === 0) + return true; + if (compound2.get$length(0) === 0) + compound2 = A._setArrayType([new A.UniversalSelector("*", $.$get$bogusSpan())], type$.JSArray_SimpleSelector); + t1 = $.$get$bogusSpan(); + return A.compoundIsSuperselector(A.CompoundSelector$(compound1, t1), A.CompoundSelector$(compound2, t1), parents); + }, + _selectorPseudoIsSuperselector(pseudo1, compound2, parents) { + var selector1 = pseudo1.selector; + if (selector1 == null) + throw A.wrapException(A.ArgumentError$("Selector " + pseudo1.toString$0(0) + " must have a selector argument.", null)); + switch (pseudo1.normalizedName) { + case "is": + case "matches": + case "any": + case "where": + return A._selectorPseudoArgs(compound2, pseudo1.name, true).any$1(0, new A._selectorPseudoIsSuperselector_closure(selector1)) || B.JSArray_methods.any$1(selector1.components, new A._selectorPseudoIsSuperselector_closure0(parents, compound2)); + case "has": + case "host": + case "host-context": + return A._selectorPseudoArgs(compound2, pseudo1.name, true).any$1(0, new A._selectorPseudoIsSuperselector_closure1(selector1)); + case "slotted": + return A._selectorPseudoArgs(compound2, pseudo1.name, false).any$1(0, new A._selectorPseudoIsSuperselector_closure2(selector1)); + case "not": + return B.JSArray_methods.every$1(selector1.components, new A._selectorPseudoIsSuperselector_closure3(compound2, pseudo1)); + case "current": + return A._selectorPseudoArgs(compound2, pseudo1.name, true).any$1(0, new A._selectorPseudoIsSuperselector_closure4(selector1)); + case "nth-child": + case "nth-last-child": + return B.JSArray_methods.any$1(compound2.components, new A._selectorPseudoIsSuperselector_closure5(pseudo1, selector1)); + default: + throw A.wrapException("unreachable"); + } + }, + _selectorPseudoArgs(compound, $name, isClass) { + var t1 = type$.WhereTypeIterable_PseudoSelector; + return A.IterableNullableExtension_whereNotNull(new A.MappedIterable(new A.WhereIterable(new A.WhereTypeIterable(compound.components, t1), new A._selectorPseudoArgs_closure(isClass, $name), t1._eval$1("WhereIterable")), new A._selectorPseudoArgs_closure0(), t1._eval$1("MappedIterable")), type$.SelectorList); + }, + unifyComplex_closure: function unifyComplex_closure() { + }, + _weaveParents_closure: function _weaveParents_closure(t0) { + this.span = t0; + }, + _weaveParents_closure0: function _weaveParents_closure0(t0) { + this.group = t0; + }, + _weaveParents_closure1: function _weaveParents_closure1() { + }, + _weaveParents_closure2: function _weaveParents_closure2() { + }, + _mustUnify_closure: function _mustUnify_closure(t0) { + this.uniqueSelectors = t0; + }, + _mustUnify__closure: function _mustUnify__closure(t0) { + this.uniqueSelectors = t0; + }, + paths_closure: function paths_closure(t0) { + this.T = t0; + }, + paths__closure: function paths__closure(t0, t1) { + this.paths = t0; + this.T = t1; + }, + paths___closure: function paths___closure(t0, t1) { + this.option = t0; + this.T = t1; + }, + listIsSuperselector_closure: function listIsSuperselector_closure(t0) { + this.list1 = t0; + }, + listIsSuperselector__closure: function listIsSuperselector__closure(t0) { + this.complex1 = t0; + }, + complexIsSuperselector_closure: function complexIsSuperselector_closure() { + }, + complexIsSuperselector_closure0: function complexIsSuperselector_closure0(t0) { + this.combinator1 = t0; + }, + _compatibleWithPreviousCombinator_closure: function _compatibleWithPreviousCombinator_closure() { + }, + _selectorPseudoIsSuperselector_closure: function _selectorPseudoIsSuperselector_closure(t0) { + this.selector1 = t0; + }, + _selectorPseudoIsSuperselector_closure0: function _selectorPseudoIsSuperselector_closure0(t0, t1) { + this.parents = t0; + this.compound2 = t1; + }, + _selectorPseudoIsSuperselector_closure1: function _selectorPseudoIsSuperselector_closure1(t0) { + this.selector1 = t0; + }, + _selectorPseudoIsSuperselector_closure2: function _selectorPseudoIsSuperselector_closure2(t0) { + this.selector1 = t0; + }, + _selectorPseudoIsSuperselector_closure3: function _selectorPseudoIsSuperselector_closure3(t0, t1) { + this.compound2 = t0; + this.pseudo1 = t1; + }, + _selectorPseudoIsSuperselector__closure: function _selectorPseudoIsSuperselector__closure(t0, t1) { + this.complex = t0; + this.pseudo1 = t1; + }, + _selectorPseudoIsSuperselector___closure: function _selectorPseudoIsSuperselector___closure(t0) { + this.simple2 = t0; + }, + _selectorPseudoIsSuperselector___closure0: function _selectorPseudoIsSuperselector___closure0(t0) { + this.simple2 = t0; + }, + _selectorPseudoIsSuperselector_closure4: function _selectorPseudoIsSuperselector_closure4(t0) { + this.selector1 = t0; + }, + _selectorPseudoIsSuperselector_closure5: function _selectorPseudoIsSuperselector_closure5(t0, t1) { + this.pseudo1 = t0; + this.selector1 = t1; + }, + _selectorPseudoArgs_closure: function _selectorPseudoArgs_closure(t0, t1) { + this.isClass = t0; + this.name = t1; + }, + _selectorPseudoArgs_closure0: function _selectorPseudoArgs_closure0() { + }, + MergedExtension_merge(left, right) { + var t2, t3, t4, + t1 = left.extender.selector; + if (!t1.$eq(0, right.extender.selector) || !left.target.$eq(0, right.target)) + throw A.wrapException(A.ArgumentError$(left.toString$0(0) + " and " + right.toString$0(0) + " aren't the same extension.", null)); + t2 = left.mediaContext; + t3 = t2 == null; + if (!t3) { + t4 = right.mediaContext; + t4 = t4 != null && !B.C_ListEquality.equals$2(0, t2, t4); + } else + t4 = false; + if (t4) + throw A.wrapException(A.SassException$("From " + left.span.message$1(0, "") + string$.x0aYou_m, right.span, null)); + if (right.isOptional && right.mediaContext == null) + return left; + if (left.isOptional && t3) + return right; + if (t3) + t2 = right.mediaContext; + t1.get$specificity(); + t1 = new A.Extender(t1, false); + return t1._extension = new A.MergedExtension(left, right, t1, left.target, t2, true, left.span); + }, + MergedExtension: function MergedExtension(t0, t1, t2, t3, t4, t5, t6) { + var _ = this; + _.left = t0; + _.right = t1; + _.extender = t2; + _.target = t3; + _.mediaContext = t4; + _.isOptional = t5; + _.span = t6; + }, + ExtendMode: function ExtendMode(t0, t1) { + this.name = t0; + this._name = t1; + }, + globalFunctions_closure: function globalFunctions_closure() { + }, + _updateComponents($arguments, adjust, change, scale) { + var keywords, alpha, red, green, blue, hue, saturation, lightness, whiteness, blackness, hasRgb, hasSL, hasWB, t2, t3, t4, t5, _null = null, + t1 = J.getInterceptor$asx($arguments), + color = t1.$index($arguments, 0).assertColor$1("color"), + argumentList = type$.SassArgumentList._as(t1.$index($arguments, 1)); + if (argumentList._list$_contents.length !== 0) + throw A.wrapException(A.SassScriptException$(string$.Only_op, _null)); + argumentList._wereKeywordsAccessed = true; + keywords = A.LinkedHashMap_LinkedHashMap$of(argumentList._keywords, type$.String, type$.Value); + t1 = new A._updateComponents_getParam(keywords, scale, change); + alpha = t1.call$3$checkUnitless("alpha", 1, true); + red = t1.call$2("red", 255); + green = t1.call$2("green", 255); + blue = t1.call$2("blue", 255); + hue = scale ? _null : A.NullableExtension_andThen(keywords.remove$1(0, "hue"), new A._updateComponents_closure()); + saturation = t1.call$3$checkPercent("saturation", 100, true); + lightness = t1.call$3$checkPercent("lightness", 100, true); + whiteness = t1.call$3$assertPercent("whiteness", 100, true); + blackness = t1.call$3$assertPercent("blackness", 100, true); + t1 = keywords.__js_helper$_length; + if (t1 !== 0) + throw A.wrapException(A.SassScriptException$("No " + A.pluralize("argument", t1, _null) + " named " + A.toSentence(keywords.get$keys(0).map$1$1(0, new A._updateComponents_closure0(), type$.Object), "or") + ".", _null)); + hasRgb = red != null || green != null || blue != null; + hasSL = saturation != null || lightness != null; + hasWB = whiteness != null || blackness != null; + if (hasRgb) + t1 = hasSL || hasWB || hue != null; + else + t1 = false; + if (t1) + throw A.wrapException(A.SassScriptException$(string$.RGB_pa + (hasWB ? "HWB" : "HSL") + " parameters.", _null)); + if (hasSL && hasWB) + throw A.wrapException(A.SassScriptException$(string$.HSL_pa, _null)); + t1 = new A._updateComponents_updateValue(change, adjust); + t2 = new A._updateComponents_updateRgb(t1); + if (hasRgb) { + t3 = t2.call$2(color.get$red(0), red); + t4 = t2.call$2(color.get$green(0), green); + t2 = t2.call$2(color.get$blue(0), blue); + return color.changeRgb$4$alpha$blue$green$red(t1.call$3(color._alpha, alpha, 1), t2, t4, t3); + } else if (hasWB) { + if (change) + t2 = hue; + else { + t2 = color.get$hue(0); + t2 += hue == null ? 0 : hue; + } + t3 = t1.call$3(color.get$whiteness(0), whiteness, 100); + t4 = t1.call$3(color.get$blackness(0), blackness, 100); + t5 = color._alpha; + t1 = t1.call$3(t5, alpha, 1); + if (t2 == null) + t2 = color.get$hue(0); + if (t3 == null) + t3 = color.get$whiteness(0); + if (t4 == null) + t4 = color.get$blackness(0); + return A.SassColor_SassColor$hwb(t2, t3, t4, t1 == null ? t5 : t1); + } else { + t2 = hue == null; + if (!t2 || hasSL) { + if (change) + t2 = hue; + else { + t3 = color.get$hue(0); + t3 += t2 ? 0 : hue; + t2 = t3; + } + t3 = t1.call$3(color.get$saturation(0), saturation, 100); + t4 = t1.call$3(color.get$lightness(0), lightness, 100); + return color.changeHsl$4$alpha$hue$lightness$saturation(t1.call$3(color._alpha, alpha, 1), t2, t4, t3); + } else if (alpha != null) + return color.changeAlpha$1(t1.call$3(color._alpha, alpha, 1)); + else + return color; + } + }, + _functionString($name, $arguments) { + return new A.SassString($name + "(" + J.map$1$1$ax($arguments, new A._functionString_closure(), type$.String).join$1(0, ", ") + ")", false); + }, + _removedColorFunction($name, argument, negative) { + return A.BuiltInCallable$function($name, "$color, $amount", new A._removedColorFunction_closure($name, argument, negative), "sass:color"); + }, + _rgb($name, $arguments) { + var t2, red, green, blue, t3, t4, + t1 = J.getInterceptor$asx($arguments), + alpha = t1.get$length($arguments) > 3 ? t1.$index($arguments, 3) : null; + if (!t1.$index($arguments, 0).get$isSpecialNumber()) + if (!t1.$index($arguments, 1).get$isSpecialNumber()) + if (!t1.$index($arguments, 2).get$isSpecialNumber()) { + t2 = alpha == null ? null : alpha.get$isSpecialNumber(); + t2 = t2 === true; + } else + t2 = true; + else + t2 = true; + else + t2 = true; + if (t2) + return A._functionString($name, $arguments); + red = t1.$index($arguments, 0).assertNumber$1("red"); + green = t1.$index($arguments, 1).assertNumber$1("green"); + blue = t1.$index($arguments, 2).assertNumber$1("blue"); + t1 = A.fuzzyRound(A._percentageOrUnitless(red, 255, "red")); + t2 = A.fuzzyRound(A._percentageOrUnitless(green, 255, "green")); + t3 = A.fuzzyRound(A._percentageOrUnitless(blue, 255, "blue")); + t4 = A.NullableExtension_andThen(alpha, new A._rgb_closure()); + return A.SassColor$rgbInternal(t1, t2, t3, t4 == null ? 1 : t4, B._ColorFormatEnum_rgbFunction); + }, + _rgbTwoArg($name, $arguments) { + var t2, color, + t1 = J.getInterceptor$asx($arguments); + if (!t1.$index($arguments, 0).get$isVar()) + t2 = !(t1.$index($arguments, 0) instanceof A.SassColor) && t1.$index($arguments, 1).get$isVar(); + else + t2 = true; + if (t2) + return A._functionString($name, $arguments); + else if (t1.$index($arguments, 1).get$isSpecialNumber()) { + color = t1.$index($arguments, 0).assertColor$1("color"); + return new A.SassString($name + "(" + color.get$red(0) + ", " + color.get$green(0) + ", " + color.get$blue(0) + ", " + A.serializeValue(t1.$index($arguments, 1), false, true) + ")", false); + } + return t1.$index($arguments, 0).assertColor$1("color").changeAlpha$1(A._percentageOrUnitless(t1.$index($arguments, 1).assertNumber$1("alpha"), 1, "alpha")); + }, + _hsl($name, $arguments) { + var t2, hue, saturation, lightness, t3, + _s10_ = "saturation", + _s9_ = "lightness", + t1 = J.getInterceptor$asx($arguments), + alpha = t1.get$length($arguments) > 3 ? t1.$index($arguments, 3) : null; + if (!t1.$index($arguments, 0).get$isSpecialNumber()) + if (!t1.$index($arguments, 1).get$isSpecialNumber()) + if (!t1.$index($arguments, 2).get$isSpecialNumber()) { + t2 = alpha == null ? null : alpha.get$isSpecialNumber(); + t2 = t2 === true; + } else + t2 = true; + else + t2 = true; + else + t2 = true; + if (t2) + return A._functionString($name, $arguments); + hue = A._angleValue(t1.$index($arguments, 0), "hue"); + saturation = t1.$index($arguments, 1).assertNumber$1(_s10_); + lightness = t1.$index($arguments, 2).assertNumber$1(_s9_); + A._checkPercent(saturation, _s10_); + A._checkPercent(lightness, _s9_); + t1 = B.JSNumber_methods.clamp$2(saturation._number$_value, 0, 100); + t2 = B.JSNumber_methods.clamp$2(lightness._number$_value, 0, 100); + t3 = A.NullableExtension_andThen(alpha, new A._hsl_closure()); + return A.SassColor$hslInternal(hue, t1, t2, t3 == null ? 1 : t3, B._ColorFormatEnum_hslFunction); + }, + _angleValue(angleValue, $name) { + var t1, t2, + angle = angleValue.assertNumber$1($name); + if (angle.compatibleWithUnit$1("deg")) + return angle.coerceValueToUnit$1("deg"); + t1 = angle.toString$0(0); + t2 = angle.unitSuggestion$1($name); + A.EvaluationContext_current().warn$2(0, "$" + $name + ": Passing a unit other than deg (" + t1 + string$.x29x20is_d + t2 + string$.x0a_See_, B.Deprecation_8WR); + return angle._number$_value; + }, + _checkPercent(number, $name) { + var t1, t2; + if (number.hasUnit$1("%")) + return; + t1 = number.toString$0(0); + t2 = number.unitSuggestion$2($name, "%"); + A.EvaluationContext_current().warn$2(0, "$" + $name + ": Passing a number without unit % (" + t1 + string$.x29x20is_d + t2 + string$.x0a_Morex3a, B.Deprecation_8WR); + }, + _hwb($arguments) { + var t2, t3, + _s9_ = "whiteness", + _s9_0 = "blackness", + t1 = J.getInterceptor$asx($arguments), + alpha = t1.get$length($arguments) > 3 ? t1.$index($arguments, 3) : null, + hue = A._angleValue(t1.$index($arguments, 0), "hue"), + whiteness = t1.$index($arguments, 1).assertNumber$1(_s9_), + blackness = t1.$index($arguments, 2).assertNumber$1(_s9_0); + whiteness.assertUnit$2("%", _s9_); + blackness.assertUnit$2("%", _s9_0); + t1 = whiteness.valueInRange$3(0, 100, _s9_); + t2 = blackness.valueInRange$3(0, 100, _s9_0); + t3 = A.NullableExtension_andThen(alpha, new A._hwb_closure()); + return A.SassColor_SassColor$hwb(hue, t1, t2, t3 == null ? 1 : t3); + }, + _parseChannels($name, argumentNames, channels) { + var list, t1, channels0, alphaFromSlashList, isCommaSeparated, isBracketed, buffer, _0_4, _1_0, _1_2, _1_2_isSet, t2, _null = null, + _s17_ = "$channels must be"; + if (channels.get$isVar()) + return A._functionString($name, A._setArrayType([channels], type$.JSArray_Value)); + if (channels.get$separator(channels) === B.ListSeparator_zg9) { + list = channels.get$asList(); + t1 = list.length; + if (t1 !== 2) + throw A.wrapException(A.SassScriptException$(string$.Only_2 + t1 + " " + A.pluralize("was", t1, "were") + " passed.", _null)); + channels0 = list[0]; + alphaFromSlashList = list[1]; + if (!alphaFromSlashList.get$isSpecialNumber()) + alphaFromSlashList.assertNumber$1("alpha"); + if (list[0].get$isVar()) + return A._functionString($name, A._setArrayType([channels], type$.JSArray_Value)); + } else { + alphaFromSlashList = _null; + channels0 = channels; + } + isCommaSeparated = channels0.get$separator(channels0) === B.ListSeparator_rXA; + isBracketed = channels0.get$hasBrackets(); + if (isCommaSeparated || isBracketed) { + buffer = new A.StringBuffer(_s17_); + if (isBracketed) { + t1 = _s17_ + " an unbracketed"; + buffer._contents = t1; + } else + t1 = _s17_; + if (isCommaSeparated) { + t1 += isBracketed ? "," : " a"; + buffer._contents = t1; + t1 = buffer._contents = t1 + " space-separated"; + } + buffer._contents = t1 + " list."; + throw A.wrapException(A.SassScriptException$(buffer.toString$0(0), _null)); + } + list = channels0.get$asList(); + if (list.length >= 2) { + _0_4 = list[0]; + t1 = _0_4; + if (t1 instanceof A.SassString) { + type$.SassString._as(_0_4); + t1 = !_0_4._hasQuotes && A.equalsIgnoreCase(_0_4._string$_text, "from"); + } else + t1 = false; + } else + t1 = false; + if (t1) + return A._functionString($name, A._setArrayType([channels], type$.JSArray_Value)); + t1 = list.length; + if (t1 > 3) + throw A.wrapException(A.SassScriptException$("Only 3 elements allowed, but " + t1 + " were passed.", _null)); + else if (t1 < 3) { + if (!B.JSArray_methods.any$1(list, new A._parseChannels_closure())) + if (list.length !== 0) { + t1 = B.JSArray_methods.get$last(list); + if (t1 instanceof A.SassString) + if (t1._hasQuotes) { + t1 = t1._string$_text; + t1 = A.startsWithIgnoreCase(t1, "var(") && B.JSString_methods.contains$1(t1, "/"); + } else + t1 = false; + else + t1 = false; + } else + t1 = false; + else + t1 = true; + if (t1) + return A._functionString($name, A._setArrayType([channels], type$.JSArray_Value)); + else + throw A.wrapException(A.SassScriptException$("Missing element " + argumentNames[list.length] + ".", _null)); + } + if (alphaFromSlashList != null) { + t1 = A.List_List$of(list, true, type$.Value); + t1.push(alphaFromSlashList); + return t1; + } + _1_0 = list[2]; + $label0$0: { + if (_1_0 instanceof A.SassNumber) { + _1_2 = _1_0.asSlash; + t1 = type$.Record_2_nullable_Object_and_nullable_Object._is(_1_2); + _1_2_isSet = true; + } else { + _1_2 = _null; + _1_2_isSet = false; + t1 = false; + } + if (t1) { + if (_1_2_isSet) + t1 = _1_2; + else { + _1_2 = _1_0.asSlash; + t1 = _1_2; + _1_2_isSet = true; + } + if (t1 == null) + t1 = type$.Record_2_nullable_Object_and_nullable_Object._as(t1); + t2 = _1_2_isSet ? _1_2 : _1_0.asSlash; + if (t2 == null) + t2 = type$.Record_2_nullable_Object_and_nullable_Object._as(t2); + t2 = A._setArrayType([list[0], list[1], t1._0, t2._1], type$.JSArray_Value); + t1 = t2; + break $label0$0; + } + if (_1_0 instanceof A.SassString) + if (!_1_0._hasQuotes) + t1 = B.JSString_methods.contains$1(_1_0._string$_text, "/"); + else + t1 = false; + else + t1 = false; + if (t1) { + t1 = A._functionString($name, A._setArrayType([channels0], type$.JSArray_Value)); + break $label0$0; + } + t1 = list; + break $label0$0; + } + return t1; + }, + _percentageOrUnitless(number, max, $name) { + var value; + if (!number.get$hasUnits()) + value = number._number$_value; + else if (number.hasUnit$1("%")) + value = max * number._number$_value / 100; + else + throw A.wrapException(A.SassScriptException$("$" + $name + ": Expected " + number.toString$0(0) + ' to have unit "%" or no units.', null)); + return B.JSNumber_methods.clamp$2(value, 0, max); + }, + _mixColors(color1, color2, weight) { + var weightScale, normalizedWeight, t1, t2, alphaDistance, t3, weight1, weight2; + A._checkPercent(weight, "weight"); + weightScale = weight.valueInRange$3(0, 100, "weight") / 100; + normalizedWeight = weightScale * 2 - 1; + t1 = color1._alpha; + t2 = color2._alpha; + alphaDistance = t1 - t2; + t3 = normalizedWeight * alphaDistance; + weight1 = ((t3 === -1 ? normalizedWeight : (normalizedWeight + alphaDistance) / (1 + t3)) + 1) / 2; + weight2 = 1 - weight1; + return A.SassColor$rgb(A.fuzzyRound(color1.get$red(0) * weight1 + color2.get$red(0) * weight2), A.fuzzyRound(color1.get$green(0) * weight1 + color2.get$green(0) * weight2), A.fuzzyRound(color1.get$blue(0) * weight1 + color2.get$blue(0) * weight2), t1 * weightScale + t2 * (1 - weightScale)); + }, + _opacify($arguments) { + var t1 = J.getInterceptor$asx($arguments), + color = t1.$index($arguments, 0).assertColor$1("color"); + return color.changeAlpha$1(B.JSNumber_methods.clamp$2(color._alpha + t1.$index($arguments, 1).assertNumber$1("amount").valueInRangeWithUnit$4(0, 1, "amount", ""), 0, 1)); + }, + _transparentize($arguments) { + var t1 = J.getInterceptor$asx($arguments), + color = t1.$index($arguments, 0).assertColor$1("color"); + return color.changeAlpha$1(B.JSNumber_methods.clamp$2(color._alpha - t1.$index($arguments, 1).assertNumber$1("amount").valueInRangeWithUnit$4(0, 1, "amount", ""), 0, 1)); + }, + _function4($name, $arguments, callback) { + return A.BuiltInCallable$function($name, $arguments, callback, "sass:color"); + }, + global_closure0: function global_closure0() { + }, + global_closure1: function global_closure1() { + }, + global_closure2: function global_closure2() { + }, + global_closure3: function global_closure3() { + }, + global_closure4: function global_closure4() { + }, + global_closure5: function global_closure5() { + }, + global_closure6: function global_closure6() { + }, + global_closure7: function global_closure7() { + }, + global_closure8: function global_closure8() { + }, + global_closure9: function global_closure9() { + }, + global_closure10: function global_closure10() { + }, + global_closure11: function global_closure11() { + }, + global_closure12: function global_closure12() { + }, + global_closure13: function global_closure13() { + }, + global_closure14: function global_closure14() { + }, + global_closure15: function global_closure15() { + }, + global_closure16: function global_closure16() { + }, + global_closure17: function global_closure17() { + }, + global_closure18: function global_closure18() { + }, + global_closure19: function global_closure19() { + }, + global_closure20: function global_closure20() { + }, + global_closure21: function global_closure21() { + }, + global_closure22: function global_closure22() { + }, + global_closure23: function global_closure23() { + }, + global_closure24: function global_closure24() { + }, + global_closure25: function global_closure25() { + }, + global__closure: function global__closure() { + }, + global_closure26: function global_closure26() { + }, + module_closure1: function module_closure1() { + }, + module_closure2: function module_closure2() { + }, + module_closure3: function module_closure3() { + }, + module_closure4: function module_closure4() { + }, + module_closure5: function module_closure5() { + }, + module_closure6: function module_closure6() { + }, + module_closure7: function module_closure7() { + }, + module_closure8: function module_closure8() { + }, + module__closure1: function module__closure1() { + }, + module_closure9: function module_closure9() { + }, + _red_closure: function _red_closure() { + }, + _green_closure: function _green_closure() { + }, + _blue_closure: function _blue_closure() { + }, + _mix_closure: function _mix_closure() { + }, + _hue_closure: function _hue_closure() { + }, + _saturation_closure: function _saturation_closure() { + }, + _lightness_closure: function _lightness_closure() { + }, + _complement_closure: function _complement_closure() { + }, + _adjust_closure: function _adjust_closure() { + }, + _scale_closure: function _scale_closure() { + }, + _change_closure: function _change_closure() { + }, + _ieHexStr_closure: function _ieHexStr_closure() { + }, + _ieHexStr_closure_hexString: function _ieHexStr_closure_hexString() { + }, + _updateComponents_getParam: function _updateComponents_getParam(t0, t1, t2) { + this.keywords = t0; + this.scale = t1; + this.change = t2; + }, + _updateComponents_closure: function _updateComponents_closure() { + }, + _updateComponents_closure0: function _updateComponents_closure0() { + }, + _updateComponents_updateValue: function _updateComponents_updateValue(t0, t1) { + this.change = t0; + this.adjust = t1; + }, + _updateComponents_updateRgb: function _updateComponents_updateRgb(t0) { + this.updateValue = t0; + }, + _functionString_closure: function _functionString_closure() { + }, + _removedColorFunction_closure: function _removedColorFunction_closure(t0, t1, t2) { + this.name = t0; + this.argument = t1; + this.negative = t2; + }, + _rgb_closure: function _rgb_closure() { + }, + _hsl_closure: function _hsl_closure() { + }, + _hwb_closure: function _hwb_closure() { + }, + _parseChannels_closure: function _parseChannels_closure() { + }, + _function3($name, $arguments, callback) { + return A.BuiltInCallable$function($name, $arguments, callback, "sass:list"); + }, + _length_closure0: function _length_closure0() { + }, + _nth_closure: function _nth_closure() { + }, + _setNth_closure: function _setNth_closure() { + }, + _join_closure: function _join_closure() { + }, + _append_closure0: function _append_closure0() { + }, + _zip_closure: function _zip_closure() { + }, + _zip__closure: function _zip__closure() { + }, + _zip__closure0: function _zip__closure0(t0) { + this._box_0 = t0; + }, + _zip__closure1: function _zip__closure1(t0) { + this._box_0 = t0; + }, + _index_closure0: function _index_closure0() { + }, + _separator_closure: function _separator_closure() { + }, + _isBracketed_closure: function _isBracketed_closure() { + }, + _slash_closure: function _slash_closure() { + }, + _modify(map, keys, modify, addNesting) { + var keyIterator = J.get$iterator$ax(keys); + return keyIterator.moveNext$0() ? new A._modify_modifyNestedMap(keyIterator, modify, addNesting).call$1(map) : modify.call$1(map); + }, + _deepMergeImpl(map1, map2) { + var t2, t3, result, t4, key, value, _1_1, _1_3, resultMap, _1_30, _1_3_isSet, valueMap, merged, _null = null, + t1 = map1._map$_contents; + if (t1.get$isEmpty(t1)) + return map2; + t2 = map2._map$_contents; + if (t2.get$isEmpty(t2)) + return map1; + t3 = type$.Value; + result = A.LinkedHashMap_LinkedHashMap$of(t1, t3, t3); + for (t1 = A.MapExtensions_get_pairs(t2, t3, t3), t1 = t1.get$iterator(t1), t2 = type$.SassMap; t1.moveNext$0();) { + t4 = t1.get$current(t1); + key = t4._0; + value = t4._1; + t4 = result.$index(0, key); + _1_1 = t4 == null ? _null : t4.tryMap$0(); + _1_3 = value.tryMap$0(); + if (_1_1 != null) { + resultMap = _1_1 == null ? t2._as(_1_1) : _1_1; + t4 = _1_3 != null; + _1_30 = _1_3; + _1_3_isSet = true; + } else { + _1_30 = _null; + resultMap = _1_30; + _1_3_isSet = false; + t4 = false; + } + if (t4) { + valueMap = _1_3_isSet ? _1_30 : _1_3; + merged = A._deepMergeImpl(resultMap, valueMap == null ? t2._as(valueMap) : valueMap); + if (merged === resultMap) + continue; + result.$indexSet(0, key, merged); + } else + result.$indexSet(0, key, value); + } + return new A.SassMap(A.ConstantMap_ConstantMap$from(result, t3, t3)); + }, + _function2($name, $arguments, callback) { + return A.BuiltInCallable$function($name, $arguments, callback, "sass:map"); + }, + _get_closure: function _get_closure() { + }, + _set_closure: function _set_closure() { + }, + _set__closure0: function _set__closure0(t0) { + this.$arguments = t0; + }, + _set_closure0: function _set_closure0() { + }, + _set__closure: function _set__closure(t0) { + this._box_0 = t0; + }, + _merge_closure: function _merge_closure() { + }, + _merge_closure0: function _merge_closure0() { + }, + _merge__closure: function _merge__closure(t0) { + this.map2 = t0; + }, + _deepMerge_closure: function _deepMerge_closure() { + }, + _deepRemove_closure: function _deepRemove_closure() { + }, + _deepRemove__closure: function _deepRemove__closure(t0) { + this.keys = t0; + }, + _remove_closure: function _remove_closure() { + }, + _remove_closure0: function _remove_closure0() { + }, + _keys_closure: function _keys_closure() { + }, + _values_closure: function _values_closure() { + }, + _hasKey_closure: function _hasKey_closure() { + }, + _modify_modifyNestedMap: function _modify_modifyNestedMap(t0, t1, t2) { + this.keyIterator = t0; + this.modify = t1; + this.addNesting = t2; + }, + _singleArgumentMathFunc($name, mathFunc) { + return A.BuiltInCallable$function($name, "$number", new A._singleArgumentMathFunc_closure(mathFunc), "sass:math"); + }, + _numberFunction($name, transform) { + return A.BuiltInCallable$function($name, "$number", new A._numberFunction_closure(transform), "sass:math"); + }, + _function1($name, $arguments, callback) { + return A.BuiltInCallable$function($name, $arguments, callback, "sass:math"); + }, + global_closure: function global_closure() { + }, + module_closure0: function module_closure0() { + }, + _ceil_closure: function _ceil_closure() { + }, + _clamp_closure: function _clamp_closure() { + }, + _floor_closure: function _floor_closure() { + }, + _max_closure: function _max_closure() { + }, + _min_closure: function _min_closure() { + }, + _round_closure: function _round_closure() { + }, + _hypot_closure: function _hypot_closure() { + }, + _hypot__closure: function _hypot__closure() { + }, + _log_closure: function _log_closure() { + }, + _pow_closure: function _pow_closure() { + }, + _atan2_closure: function _atan2_closure() { + }, + _compatible_closure: function _compatible_closure() { + }, + _isUnitless_closure: function _isUnitless_closure() { + }, + _unit_closure: function _unit_closure() { + }, + _percentage_closure: function _percentage_closure() { + }, + _randomFunction_closure: function _randomFunction_closure() { + }, + _div_closure: function _div_closure() { + }, + _singleArgumentMathFunc_closure: function _singleArgumentMathFunc_closure(t0) { + this.mathFunc = t0; + }, + _numberFunction_closure: function _numberFunction_closure(t0) { + this.transform = t0; + }, + _function5($name, $arguments, callback) { + return A.BuiltInCallable$function($name, $arguments, callback, "sass:meta"); + }, + global_closure27: function global_closure27() { + }, + global_closure28: function global_closure28() { + }, + global_closure29: function global_closure29() { + }, + global_closure30: function global_closure30() { + }, + local_closure: function local_closure() { + }, + local_closure0: function local_closure0() { + }, + local__closure: function local__closure() { + }, + local_closure1: function local_closure1() { + }, + _prependParent(compound) { + var _0_3, _0_4, t1, _0_4_isSet, rest, _null = null, + span = A.EvaluationContext_current().get$currentCallableSpan(), + _0_0 = compound.components; + $label0$0: { + _0_3 = _0_0.length >= 1; + if (_0_3) { + _0_4 = _0_0[0]; + t1 = _0_4; + t1 = t1 instanceof A.UniversalSelector; + _0_4_isSet = true; + } else { + _0_4 = _null; + _0_4_isSet = false; + t1 = false; + } + if (t1) { + t1 = _null; + break $label0$0; + } + if (_0_3) { + if (_0_4_isSet) + t1 = _0_4; + else { + _0_4 = _0_0[0]; + t1 = _0_4; + _0_4_isSet = true; + } + if (t1 instanceof A.TypeSelector) { + if (_0_4_isSet) + t1 = _0_4; + else { + _0_4 = _0_0[0]; + t1 = _0_4; + _0_4_isSet = true; + } + t1 = type$.TypeSelector._as(t1).name.namespace != null; + } else + t1 = false; + } else + t1 = false; + if (t1) { + t1 = _null; + break $label0$0; + } + if (_0_3) { + if (_0_4_isSet) + t1 = _0_4; + else { + _0_4 = _0_0[0]; + t1 = _0_4; + _0_4_isSet = true; + } + t1 = t1 instanceof A.TypeSelector; + } else + t1 = false; + if (t1) { + t1 = _0_4_isSet ? _0_4 : _0_0[0]; + type$.TypeSelector._as(t1); + rest = B.JSArray_methods.sublist$1(_0_0, 1); + t1 = A._setArrayType([new A.ParentSelector(t1.name.name, span)], type$.JSArray_SimpleSelector); + B.JSArray_methods.addAll$1(t1, rest); + t1 = A.CompoundSelector$(t1, span); + break $label0$0; + } + t1 = A._setArrayType([new A.ParentSelector(_null, span)], type$.JSArray_SimpleSelector); + B.JSArray_methods.addAll$1(t1, _0_0); + t1 = A.CompoundSelector$(t1, span); + break $label0$0; + } + return t1; + }, + _function0($name, $arguments, callback) { + return A.BuiltInCallable$function($name, $arguments, callback, "sass:selector"); + }, + _nest_closure: function _nest_closure() { + }, + _nest__closure: function _nest__closure(t0) { + this._box_0 = t0; + }, + _nest__closure0: function _nest__closure0() { + }, + _append_closure: function _append_closure() { + }, + _append__closure: function _append__closure() { + }, + _append__closure0: function _append__closure0(t0) { + this.span = t0; + }, + _append___closure: function _append___closure(t0, t1) { + this.parent = t0; + this.span = t1; + }, + _extend_closure: function _extend_closure() { + }, + _replace_closure: function _replace_closure() { + }, + _unify_closure: function _unify_closure() { + }, + _isSuperselector_closure: function _isSuperselector_closure() { + }, + _simpleSelectors_closure: function _simpleSelectors_closure() { + }, + _simpleSelectors__closure: function _simpleSelectors__closure() { + }, + _parse_closure: function _parse_closure() { + }, + _codepointForIndex(index, lengthInCodepoints, allowNegative) { + var result; + if (index === 0) + return 0; + if (index > 0) + return Math.min(index - 1, lengthInCodepoints); + result = lengthInCodepoints + index; + if (result < 0 && !allowNegative) + return 0; + return result; + }, + _function($name, $arguments, callback) { + return A.BuiltInCallable$function($name, $arguments, callback, "sass:string"); + }, + module_closure: function module_closure() { + }, + module__closure: function module__closure(t0) { + this.string = t0; + }, + module__closure0: function module__closure0(t0) { + this.string = t0; + }, + _unquote_closure: function _unquote_closure() { + }, + _quote_closure: function _quote_closure() { + }, + _length_closure: function _length_closure() { + }, + _insert_closure: function _insert_closure() { + }, + _index_closure: function _index_closure() { + }, + _slice_closure: function _slice_closure() { + }, + _toUpperCase_closure: function _toUpperCase_closure() { + }, + _toLowerCase_closure: function _toLowerCase_closure() { + }, + _uniqueId_closure: function _uniqueId_closure() { + }, + ImportCache$(importers, loadPaths, logger) { + var t1 = type$.nullable_Record_3_Importer_and_Uri_and_Uri_originalUrl, + t2 = type$.Uri, + t3 = A.ImportCache__toImporters(importers, loadPaths, null); + return new A.ImportCache(t3, logger, A.LinkedHashMap_LinkedHashMap$_empty(type$.Record_2_Uri_and_bool_forImport, t1), A.LinkedHashMap_LinkedHashMap$_empty(type$.Record_4_Uri_and_Importer_baseImporter_and_nullable_Uri_baseUrl_and_bool_forImport, t1), A.LinkedHashMap_LinkedHashMap$_empty(t2, type$.nullable_Stylesheet), A.LinkedHashMap_LinkedHashMap$_empty(t2, type$.ImporterResult)); + }, + ImportCache__toImporters(importers, loadPaths, packageConfig) { + var t1, t2, t3, t4, _i, path, _null = null, + sassPath = A.getEnvironmentVariable("SASS_PATH"); + if (A.isBrowser()) { + t1 = A._setArrayType([], type$.JSArray_Importer); + B.JSArray_methods.addAll$1(t1, importers); + return t1; + } + t1 = A._setArrayType([], type$.JSArray_Importer); + B.JSArray_methods.addAll$1(t1, importers); + for (t2 = J.get$iterator$ax(loadPaths); t2.moveNext$0();) { + t3 = t2.get$current(t2); + t1.push(new A.FilesystemImporter($.$get$context().absolute$15(t3, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null))); + } + if (sassPath != null) { + t2 = A.isNodeJs() ? self.process : _null; + t3 = sassPath.split(J.$eq$(t2 == null ? _null : J.get$platform$x(t2), "win32") ? ";" : ":"); + t4 = t3.length; + _i = 0; + for (; _i < t4; ++_i) { + path = t3[_i]; + t1.push(new A.FilesystemImporter($.$get$context().absolute$15(path, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null))); + } + } + return t1; + }, + ImportCache: function ImportCache(t0, t1, t2, t3, t4, t5) { + var _ = this; + _._importers = t0; + _._logger = t1; + _._canonicalizeCache = t2; + _._relativeCanonicalizeCache = t3; + _._importCache = t4; + _._resultsCache = t5; + }, + ImportCache_canonicalize_closure: function ImportCache_canonicalize_closure(t0, t1, t2, t3, t4) { + var _ = this; + _.$this = t0; + _.baseImporter = t1; + _.baseUrl = t2; + _.url = t3; + _.forImport = t4; + }, + ImportCache_canonicalize_closure0: function ImportCache_canonicalize_closure0(t0, t1, t2, t3) { + var _ = this; + _.$this = t0; + _.url = t1; + _.baseUrl = t2; + _.forImport = t3; + }, + ImportCache__canonicalize_closure: function ImportCache__canonicalize_closure(t0, t1) { + this.importer = t0; + this.resolved = t1; + }, + ImportCache__canonicalize__closure: function ImportCache__canonicalize__closure(t0, t1) { + this.importer = t0; + this.resolved = t1; + }, + ImportCache__canonicalize_closure0: function ImportCache__canonicalize_closure0(t0, t1) { + this.importer = t0; + this.resolved = t1; + }, + ImportCache_importCanonical_closure: function ImportCache_importCanonical_closure(t0, t1, t2, t3, t4) { + var _ = this; + _.$this = t0; + _.importer = t1; + _.canonicalUrl = t2; + _.originalUrl = t3; + _.quiet = t4; + }, + ImportCache_humanize_closure: function ImportCache_humanize_closure(t0) { + this.canonicalUrl = t0; + }, + ImportCache_humanize_closure0: function ImportCache_humanize_closure0() { + }, + ImportCache_humanize_closure1: function ImportCache_humanize_closure1() { + }, + ImportCache_humanize_closure2: function ImportCache_humanize_closure2(t0) { + this.canonicalUrl = t0; + }, + ImportCache_clearCanonicalize_closure: function ImportCache_clearCanonicalize_closure(t0) { + this.url = t0; + }, + Importer: function Importer() { + }, + AsyncImporter: function AsyncImporter() { + }, + FilesystemImporter$(loadPath) { + var _null = null; + return new A.FilesystemImporter(A.absolute(loadPath, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null)); + }, + FilesystemImporter: function FilesystemImporter(t0) { + this._loadPath = t0; + }, + FilesystemImporter_canonicalize_closure: function FilesystemImporter_canonicalize_closure() { + }, + NoOpImporter: function NoOpImporter() { + }, + NodePackageImporter: function NodePackageImporter() { + this.__NodePackageImporter__entryPointDirectory_F = $; + }, + NodePackageImporter__nodePackageExportsResolve_closure: function NodePackageImporter__nodePackageExportsResolve_closure() { + }, + NodePackageImporter__nodePackageExportsResolve_closure0: function NodePackageImporter__nodePackageExportsResolve_closure0() { + }, + NodePackageImporter__nodePackageExportsResolve_closure1: function NodePackageImporter__nodePackageExportsResolve_closure1() { + }, + NodePackageImporter__nodePackageExportsResolve_closure2: function NodePackageImporter__nodePackageExportsResolve_closure2(t0, t1, t2) { + this.$this = t0; + this.exports = t1; + this.packageRoot = t2; + }, + NodePackageImporter__nodePackageExportsResolve__closure: function NodePackageImporter__nodePackageExportsResolve__closure(t0, t1, t2) { + this.$this = t0; + this.variant = t1; + this.packageRoot = t2; + }, + NodePackageImporter__nodePackageExportsResolve__closure0: function NodePackageImporter__nodePackageExportsResolve__closure0() { + }, + NodePackageImporter__getMainExport_closure: function NodePackageImporter__getMainExport_closure() { + }, + ImporterResult: function ImporterResult(t0, t1, t2) { + this.contents = t0; + this._sourceMapUrl = t1; + this.syntax = t2; + }, + fromImport() { + var t1 = A._asBoolQ($.Zone__current.$index(0, B.Symbol__inImportRule)); + return t1 === true; + }, + containingUrl() { + var t1, + _0_0 = $.Zone__current.$index(0, B.Symbol__containingUrl); + $label0$0: { + if (_0_0 == null) + A.throwExpression(A.StateError$(string$.contai)); + if (B.Symbol__none.$eq(0, _0_0)) { + t1 = null; + break $label0$0; + } + if (type$.Uri._is(_0_0)) { + t1 = _0_0; + break $label0$0; + } + t1 = A.throwExpression(A.StateError$(string$.Unexpe + A.S(_0_0) + ".")); + } + return t1; + }, + withContainingUrl(url, callback, $T) { + var t1 = url == null ? B.Symbol__none : url, + t2 = type$.nullable_Object; + return A.runZoned(callback, A.LinkedHashMap_LinkedHashMap$_literal([B.Symbol__containingUrl, t1], t2, t2), $T); + }, + resolveImportPath(path) { + var t1, + extension = A.ParsedPath_ParsedPath$parse(path, $.$get$context().style)._splitExtension$1(1)[1]; + if (extension === ".sass" || extension === ".scss" || extension === ".css") { + t1 = A.fromImport() ? new A.resolveImportPath_closure(path, extension).call$0() : null; + return t1 == null ? A._exactlyOne(A._tryPath(path)) : t1; + } + t1 = A.fromImport() ? new A.resolveImportPath_closure0(path).call$0() : null; + if (t1 == null) + t1 = A._exactlyOne(A._tryPathWithExtensions(path)); + return t1 == null ? A._tryPathAsDirectory(path) : t1; + }, + _tryPathWithExtensions(path) { + var result = A._tryPath(path + ".sass"); + B.JSArray_methods.addAll$1(result, A._tryPath(path + ".scss")); + return result.length !== 0 ? result : A._tryPath(path + ".css"); + }, + _tryPath(path) { + var t1 = $.$get$context(), + partial = A.join(t1.dirname$1(path), "_" + A.ParsedPath_ParsedPath$parse(path, t1.style).get$basename(), null); + t1 = A._setArrayType([], type$.JSArray_String); + if (A.fileExists(partial)) + t1.push(partial); + if (A.fileExists(path)) + t1.push(path); + return t1; + }, + _tryPathAsDirectory(path) { + var t1; + if (!A.dirExists(path)) + return null; + t1 = A.fromImport() ? new A._tryPathAsDirectory_closure(path).call$0() : null; + return t1 == null ? A._exactlyOne(A._tryPathWithExtensions(A.join(path, "index", null))) : t1; + }, + _exactlyOne(paths) { + var _0_1, t1, path; + $label0$0: { + _0_1 = paths.length; + if (_0_1 <= 0) { + t1 = null; + break $label0$0; + } + if (_0_1 === 1) { + path = paths[0]; + t1 = path; + break $label0$0; + } + t1 = A.throwExpression(string$.It_s_n + B.JSArray_methods.map$1$1(paths, new A._exactlyOne_closure(), type$.String).join$1(0, "\n")); + } + return t1; + }, + resolveImportPath_closure: function resolveImportPath_closure(t0, t1) { + this.path = t0; + this.extension = t1; + }, + resolveImportPath_closure0: function resolveImportPath_closure0(t0) { + this.path = t0; + }, + _tryPathAsDirectory_closure: function _tryPathAsDirectory_closure(t0) { + this.path = t0; + }, + _exactlyOne_closure: function _exactlyOne_closure() { + }, + InterpolationBuffer: function InterpolationBuffer(t0, t1) { + this._interpolation_buffer$_text = t0; + this._interpolation_buffer$_contents = t1; + }, + InterpolationMap$(_interpolation, targetLocations) { + var t1 = A.List_List$unmodifiable(targetLocations, type$.SourceLocation), + t2 = _interpolation.contents.length, + expectedLocations = Math.max(0, t2 - 1); + if (t1.length !== expectedLocations) + A.throwExpression(A.ArgumentError$("InterpolationMap must have " + A.S(expectedLocations) + string$.x20targe + t2 + " components.", null)); + return new A.InterpolationMap(_interpolation, t1); + }, + InterpolationMap: function InterpolationMap(t0, t1) { + this._interpolation = t0; + this._targetLocations = t1; + }, + InterpolationMap_mapException_closure: function InterpolationMap_mapException_closure() { + }, + _realCasePath(path) { + var prefix, _null = null, + t1 = A.isNodeJs() ? self.process : _null; + if (!J.$eq$(t1 == null ? _null : J.get$platform$x(t1), "win32")) { + t1 = A.isNodeJs() ? self.process : _null; + t1 = J.$eq$(t1 == null ? _null : J.get$platform$x(t1), "darwin"); + } else + t1 = true; + if (!t1) + return path; + t1 = A.isNodeJs() ? self.process : _null; + if (J.$eq$(t1 == null ? _null : J.get$platform$x(t1), "win32")) { + prefix = B.JSString_methods.substring$2(path, 0, $.$get$context().style.rootLength$1(path)); + t1 = prefix.length; + if (t1 !== 0 && A.CharacterExtension_get_isAlphabetic(prefix.charCodeAt(0))) + path = prefix.toUpperCase() + B.JSString_methods.substring$1(path, t1); + } + return new A._realCasePath_helper().call$1(path); + }, + _realCasePath_helper: function _realCasePath_helper() { + }, + _realCasePath_helper_closure: function _realCasePath_helper_closure(t0, t1, t2) { + this.helper = t0; + this.dirname = t1; + this.path = t2; + }, + _realCasePath_helper__closure: function _realCasePath_helper__closure(t0) { + this.basename = t0; + }, + printError(message) { + var t1 = A.isNodeJs() ? self.process : null; + if (t1 != null) { + t1 = J.get$stderr$x(t1); + J.write$1$x(t1, A.S(message == null ? "" : message) + "\n"); + } else { + t1 = self.console; + J.error$1$x(t1, message == null ? "" : message); + } + }, + readFile(path) { + var contents, sourceFile, t1, i; + if (!A.isNodeJs()) + throw A.wrapException(A.UnsupportedError$("readFile() is only supported on Node.js")); + contents = A._asString(A._readFile(path, "utf8")); + if (!B.JSString_methods.contains$1(contents, "\ufffd")) + return contents; + sourceFile = A.SourceFile$fromString(contents, $.$get$context().toUri$1(path)); + for (t1 = contents.length, i = 0; i < t1; ++i) { + if (contents.charCodeAt(i) !== 65533) + continue; + throw A.wrapException(A.SassException$("Invalid UTF-8.", A.FileLocation$_(sourceFile, i).pointSpan$0(), null)); + } + return contents; + }, + _readFile(path, encoding) { + return A._systemErrorToFileSystemException(new A._readFile_closure(path, encoding)); + }, + writeFile(path, contents) { + if (!A.isNodeJs()) + throw A.wrapException(A.UnsupportedError$("writeFile() is only supported on Node.js")); + return A._systemErrorToFileSystemException(new A.writeFile_closure(path, contents)); + }, + deleteFile(path) { + if (!A.isNodeJs()) + throw A.wrapException(A.UnsupportedError$("deleteFile() is only supported on Node.js")); + return A._systemErrorToFileSystemException(new A.deleteFile_closure(path)); + }, + readStdin() { + return A.readStdin$body(); + }, + readStdin$body() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.String), + $async$returnValue, t3, completer, sink, t1, t2; + var $async$readStdin = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = {}; + t2 = A.isNodeJs() ? self.process : null; + if (t2 == null) + throw A.wrapException(A.UnsupportedError$("readStdin() is only supported on Node.js")); + t3 = new A._Future($.Zone__current, type$._Future_String); + completer = new A._AsyncCompleter(t3, type$._AsyncCompleter_String); + t1.contents = null; + sink = new A._StringCallbackSink(new A.readStdin_closure(t1, completer), new A.StringBuffer("")).asUtf8Sink$1(false); + t1 = J.getInterceptor$x(t2); + J.on$2$x(t1.get$stdin(t2), "data", A.allowInterop(new A.readStdin_closure0(sink))); + J.on$2$x(t1.get$stdin(t2), "end", A.allowInterop(new A.readStdin_closure1(sink))); + J.on$2$x(t1.get$stdin(t2), "error", A.allowInterop(new A.readStdin_closure2(completer))); + $async$returnValue = t3; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$readStdin, $async$completer); + }, + fileExists(path) { + if (!A.isNodeJs()) + throw A.wrapException(A.UnsupportedError$(string$.fileEx)); + return A._systemErrorToFileSystemException(new A.fileExists_closure(path)); + }, + dirExists(path) { + if (!A.isNodeJs()) + throw A.wrapException(A.UnsupportedError$("dirExists() is only supported on Node.js")); + return A._systemErrorToFileSystemException(new A.dirExists_closure(path)); + }, + ensureDir(path) { + if (!A.isNodeJs()) + throw A.wrapException(A.UnsupportedError$("ensureDir() is only supported on Node.js")); + return A._systemErrorToFileSystemException(new A.ensureDir_closure(path)); + }, + listDir(path, recursive) { + if (!A.isNodeJs()) + throw A.wrapException(A.UnsupportedError$("listDir() is only supported on Node.js")); + return A._systemErrorToFileSystemException(new A.listDir_closure(recursive, path)); + }, + modificationTime(path) { + if (!A.isNodeJs()) + throw A.wrapException(A.UnsupportedError$("modificationTime() is only supported on Node.js")); + return A._systemErrorToFileSystemException(new A.modificationTime_closure(path)); + }, + getEnvironmentVariable($name) { + var t1 = A.isNodeJs() ? self.process : null, + env = t1 == null ? null : J.get$env$x(t1); + if (env == null) + t1 = null; + else + t1 = A._asStringQ(env[$name]); + return t1; + }, + _systemErrorToFileSystemException(callback) { + var error, t1, exception, t2; + try { + t1 = callback.call$0(); + return t1; + } catch (exception) { + error = A.unwrapException(exception); + if (!type$.JsSystemError._is(error)) + throw exception; + t1 = error; + t2 = J.getInterceptor$x(t1); + throw A.wrapException(new A.FileSystemException(J.substring$2$s(t2.get$message(t1), (A.S(t2.get$code(t1)) + ": ").length, J.get$length$asx(t2.get$message(t1)) - (", " + A.S(t2.get$syscall(t1)) + " '" + A.S(t2.get$path(t1)) + "'").length), J.get$path$x(error))); + } + }, + hasTerminal() { + var t1 = A.isNodeJs() ? self.process : null; + return J.$eq$(t1 == null ? null : J.get$isTTY$x(J.get$stdout$x(t1)), true); + }, + isWindows() { + var t1 = A.isNodeJs() ? self.process : null; + return J.$eq$(t1 == null ? null : J.get$platform$x(t1), "win32"); + }, + watchDir(path, poll) { + var watcher, t2, t3, t1 = {}; + if (!A.isNodeJs()) + throw A.wrapException(A.UnsupportedError$("watchDir() is only supported on Node.js")); + watcher = J.watch$2$x(self.chokidar, path, {disableGlobbing: true, usePolling: poll}); + t1.controller = null; + t2 = J.getInterceptor$x(watcher); + t2.on$2(watcher, "add", A.allowInterop(new A.watchDir_closure(t1))); + t2.on$2(watcher, "change", A.allowInterop(new A.watchDir_closure0(t1))); + t2.on$2(watcher, "unlink", A.allowInterop(new A.watchDir_closure1(t1))); + t2.on$2(watcher, "error", A.allowInterop(new A.watchDir_closure2(t1))); + t3 = new A._Future($.Zone__current, type$._Future_Stream_WatchEvent); + t2.on$2(watcher, "ready", A.allowInterop(new A.watchDir_closure3(t1, watcher, new A._AsyncCompleter(t3, type$._AsyncCompleter_Stream_WatchEvent)))); + return t3; + }, + FileSystemException: function FileSystemException(t0, t1) { + this.message = t0; + this.path = t1; + }, + _readFile_closure: function _readFile_closure(t0, t1) { + this.path = t0; + this.encoding = t1; + }, + writeFile_closure: function writeFile_closure(t0, t1) { + this.path = t0; + this.contents = t1; + }, + deleteFile_closure: function deleteFile_closure(t0) { + this.path = t0; + }, + readStdin_closure: function readStdin_closure(t0, t1) { + this._box_0 = t0; + this.completer = t1; + }, + readStdin_closure0: function readStdin_closure0(t0) { + this.sink = t0; + }, + readStdin_closure1: function readStdin_closure1(t0) { + this.sink = t0; + }, + readStdin_closure2: function readStdin_closure2(t0) { + this.completer = t0; + }, + fileExists_closure: function fileExists_closure(t0) { + this.path = t0; + }, + dirExists_closure: function dirExists_closure(t0) { + this.path = t0; + }, + ensureDir_closure: function ensureDir_closure(t0) { + this.path = t0; + }, + listDir_closure: function listDir_closure(t0, t1) { + this.recursive = t0; + this.path = t1; + }, + listDir__closure: function listDir__closure(t0) { + this.path = t0; + }, + listDir__closure0: function listDir__closure0() { + }, + listDir_closure_list: function listDir_closure_list() { + }, + listDir__list_closure: function listDir__list_closure(t0, t1) { + this.parent = t0; + this.list = t1; + }, + modificationTime_closure: function modificationTime_closure(t0) { + this.path = t0; + }, + watchDir_closure: function watchDir_closure(t0) { + this._box_0 = t0; + }, + watchDir_closure0: function watchDir_closure0(t0) { + this._box_0 = t0; + }, + watchDir_closure1: function watchDir_closure1(t0) { + this._box_0 = t0; + }, + watchDir_closure2: function watchDir_closure2(t0) { + this._box_0 = t0; + }, + watchDir_closure3: function watchDir_closure3(t0, t1, t2) { + this._box_0 = t0; + this.watcher = t1; + this.completer = t2; + }, + watchDir__closure: function watchDir__closure(t0) { + this.watcher = t0; + }, + JSArray0: function JSArray0() { + }, + Chokidar: function Chokidar() { + }, + ChokidarOptions: function ChokidarOptions() { + }, + ChokidarWatcher: function ChokidarWatcher() { + }, + JSFunction: function JSFunction() { + }, + ImmutableList: function ImmutableList() { + }, + ImmutableMap: function ImmutableMap() { + }, + NodeImporterResult: function NodeImporterResult() { + }, + RenderContext: function RenderContext() { + }, + RenderContextOptions: function RenderContextOptions() { + }, + RenderContextResult: function RenderContextResult() { + }, + RenderContextResultStats: function RenderContextResultStats() { + }, + JSModule: function JSModule() { + }, + JSModuleRequire: function JSModuleRequire() { + }, + JSClass: function JSClass() { + }, + JSUrl: function JSUrl() { + }, + jsThrow0(error) { + return type$.Never._as($.$get$_jsThrow0().call$1(error)); + }, + _PropertyDescriptor: function _PropertyDescriptor() { + }, + _RequireMain: function _RequireMain() { + }, + WarnForDeprecation_warnForDeprecation(_this, deprecation, message, span, trace) { + if (_this instanceof A.DeprecationHandlingLogger) + _this.warnForDeprecation$4$span$trace(deprecation, message, span, trace); + else if (!deprecation.isFuture) + _this.warn$4$deprecation$span$trace(0, message, true, span, trace); + }, + _QuietLogger: function _QuietLogger() { + }, + DeprecationHandlingLogger: function DeprecationHandlingLogger(t0, t1, t2, t3, t4) { + var _ = this; + _._warningCounts = t0; + _._inner = t1; + _.fatalDeprecations = t2; + _.futureDeprecations = t3; + _.limitRepetition = t4; + }, + DeprecationHandlingLogger_summarize_closure: function DeprecationHandlingLogger_summarize_closure() { + }, + DeprecationHandlingLogger_summarize_closure0: function DeprecationHandlingLogger_summarize_closure0() { + }, + StderrLogger: function StderrLogger(t0) { + this.color = t0; + }, + TrackingLogger: function TrackingLogger(t0) { + this._tracking$_logger = t0; + this._emittedDebug = this._emittedWarning = false; + }, + BuiltInModule$($name, functions, mixins, variables, $T) { + var t1 = A._Uri__Uri(null, $name, null, "sass"), + t2 = A.BuiltInModule__callableMap(functions, $T), + t3 = A.BuiltInModule__callableMap(mixins, $T), + t4 = variables == null ? B.Map_empty5 : new A.UnmodifiableMapView(variables, type$.UnmodifiableMapView_String_Value); + return new A.BuiltInModule(t1, t2, t3, t4, $T._eval$1("BuiltInModule<0>")); + }, + BuiltInModule__callableMap(callables, $T) { + var t2, _i, callable, + t1 = type$.String; + if (callables == null) + t1 = A.LinkedHashMap_LinkedHashMap$_empty(t1, $T); + else { + t1 = A.LinkedHashMap_LinkedHashMap$_empty(t1, $T); + for (t2 = callables.length, _i = 0; _i < callables.length; callables.length === t2 || (0, A.throwConcurrentModificationError)(callables), ++_i) { + callable = callables[_i]; + t1.$indexSet(0, J.get$name$x(callable), callable); + } + t1 = new A.UnmodifiableMapView(t1, type$.$env_1_1_String._bind$1($T)._eval$1("UnmodifiableMapView<1,2>")); + } + return new A.UnmodifiableMapView(t1, type$.$env_1_1_String._bind$1($T)._eval$1("UnmodifiableMapView<1,2>")); + }, + BuiltInModule: function BuiltInModule(t0, t1, t2, t3, t4) { + var _ = this; + _.url = t0; + _.functions = t1; + _.mixins = t2; + _.variables = t3; + _.$ti = t4; + }, + ForwardedModuleView_ifNecessary(inner, rule, $T) { + var t1; + if (rule.prefix == null) + if (rule.shownMixinsAndFunctions == null) + if (rule.shownVariables == null) { + t1 = rule.hiddenMixinsAndFunctions; + t1 = t1 == null ? null : t1._base.get$isEmpty(0); + if (t1 === true) { + t1 = rule.hiddenVariables; + t1 = t1 == null ? null : t1._base.get$isEmpty(0); + t1 = t1 === true; + } else + t1 = false; + } else + t1 = false; + else + t1 = false; + else + t1 = false; + if (t1) + return inner; + else + return A.ForwardedModuleView$(inner, rule, $T); + }, + ForwardedModuleView$(_inner, _rule, $T) { + var t1 = _rule.prefix, + t2 = _rule.shownVariables, + t3 = _rule.hiddenVariables, + t4 = _rule.shownMixinsAndFunctions, + t5 = _rule.hiddenMixinsAndFunctions; + return new A.ForwardedModuleView(_inner, _rule, A.ForwardedModuleView__forwardedMap(_inner.get$variables(), t1, t2, t3, type$.Value), A.ForwardedModuleView__forwardedMap(_inner.get$variableNodes(), t1, t2, t3, type$.AstNode), A.ForwardedModuleView__forwardedMap(_inner.get$functions(_inner), t1, t4, t5, $T), A.ForwardedModuleView__forwardedMap(_inner.get$mixins(), t1, t4, t5, $T), $T._eval$1("ForwardedModuleView<0>")); + }, + ForwardedModuleView__forwardedMap(map, prefix, safelist, blocklist, $V) { + var t2, + t1 = prefix == null; + if (t1) + if (safelist == null) + t2 = blocklist == null || blocklist._base.get$isEmpty(0); + else + t2 = false; + else + t2 = false; + if (t2) + return map; + if (!t1) + map = new A.PrefixedMapView(map, prefix, $V._eval$1("PrefixedMapView<0>")); + if (safelist != null) + map = new A.LimitedMapView(map, safelist._base.intersection$1(new A.MapKeySet(map, type$.MapKeySet_nullable_Object)), type$.$env_1_1_String._bind$1($V)._eval$1("LimitedMapView<1,2>")); + else if (blocklist != null && blocklist._base.get$isNotEmpty(0)) + map = A.LimitedMapView$blocklist(map, blocklist, type$.String, $V); + return map; + }, + ForwardedModuleView: function ForwardedModuleView(t0, t1, t2, t3, t4, t5, t6) { + var _ = this; + _._forwarded_view$_inner = t0; + _._rule = t1; + _.variables = t2; + _.variableNodes = t3; + _.functions = t4; + _.mixins = t5; + _.$ti = t6; + }, + ShadowedModuleView_ifNecessary(inner, functions, mixins, variables, $T) { + return A.ShadowedModuleView__needsBlocklist(inner.get$variables(), variables) || A.ShadowedModuleView__needsBlocklist(inner.get$functions(inner), functions) || A.ShadowedModuleView__needsBlocklist(inner.get$mixins(), mixins) ? new A.ShadowedModuleView(inner, A.ShadowedModuleView__shadowedMap(inner.get$variables(), variables, type$.Value), A.ShadowedModuleView__shadowedMap(inner.get$variableNodes(), variables, type$.AstNode), A.ShadowedModuleView__shadowedMap(inner.get$functions(inner), functions, $T), A.ShadowedModuleView__shadowedMap(inner.get$mixins(), mixins, $T), $T._eval$1("ShadowedModuleView<0>")) : null; + }, + ShadowedModuleView__shadowedMap(map, blocklist, $V) { + var t1 = A.ShadowedModuleView__needsBlocklist(map, blocklist); + return !t1 ? map : A.LimitedMapView$blocklist(map, blocklist, type$.String, $V); + }, + ShadowedModuleView__needsBlocklist(map, blocklist) { + return map.get$isNotEmpty(map) && blocklist.any$1(0, map.get$containsKey()); + }, + ShadowedModuleView: function ShadowedModuleView(t0, t1, t2, t3, t4, t5) { + var _ = this; + _._shadowed_view$_inner = t0; + _.variables = t1; + _.variableNodes = t2; + _.functions = t3; + _.mixins = t4; + _.$ti = t5; + }, + AtRootQueryParser$(contents, logger, url) { + var t1 = A.SpanScanner$(contents, url); + return new A.AtRootQueryParser(t1, logger, null); + }, + AtRootQueryParser: function AtRootQueryParser(t0, t1, t2) { + this.scanner = t0; + this.logger = t1; + this._interpolationMap = t2; + }, + AtRootQueryParser_parse_closure: function AtRootQueryParser_parse_closure(t0) { + this.$this = t0; + }, + _disallowedFunctionNames_closure: function _disallowedFunctionNames_closure() { + }, + CssParser: function CssParser(t0, t1, t2, t3) { + var _ = this; + _._isUseAllowed = true; + _._inExpression = _._inParentheses = _._inStyleRule = _._stylesheet$_inUnknownAtRule = _._inControlDirective = _._inContentBlock = _._stylesheet$_inMixin = false; + _._globalVariables = t0; + _.lastSilentComment = null; + _.scanner = t1; + _.logger = t2; + _._interpolationMap = t3; + }, + KeyframeSelectorParser$(contents, interpolationMap, logger) { + var t1 = A.SpanScanner$(contents, null); + return new A.KeyframeSelectorParser(t1, logger, interpolationMap); + }, + KeyframeSelectorParser: function KeyframeSelectorParser(t0, t1, t2) { + this.scanner = t0; + this.logger = t1; + this._interpolationMap = t2; + }, + KeyframeSelectorParser_parse_closure: function KeyframeSelectorParser_parse_closure(t0) { + this.$this = t0; + }, + MediaQueryParser: function MediaQueryParser(t0, t1, t2) { + this.scanner = t0; + this.logger = t1; + this._interpolationMap = t2; + }, + MediaQueryParser_parse_closure: function MediaQueryParser_parse_closure(t0) { + this.$this = t0; + }, + Parser_isIdentifier(text) { + var t1, t2, exception, logger = null; + try { + t1 = logger; + t2 = A.SpanScanner$(text, null); + new A.Parser(t2, t1 == null ? B.StderrLogger_false : t1, null)._parseIdentifier$0(); + return true; + } catch (exception) { + if (type$.SassFormatException._is(A.unwrapException(exception))) + return false; + else + throw exception; + } + }, + Parser: function Parser(t0, t1, t2) { + this.scanner = t0; + this.logger = t1; + this._interpolationMap = t2; + }, + Parser__parseIdentifier_closure: function Parser__parseIdentifier_closure(t0) { + this.$this = t0; + }, + Parser_escape_closure: function Parser_escape_closure() { + }, + Parser_scanIdentChar_matches: function Parser_scanIdentChar_matches(t0, t1) { + this.caseSensitive = t0; + this.char = t1; + }, + Parser_spanFrom_closure: function Parser_spanFrom_closure(t0, t1) { + this.$this = t0; + this.span = t1; + }, + SassParser: function SassParser(t0, t1, t2, t3) { + var _ = this; + _._currentIndentation = 0; + _._spaces = _._nextIndentationEnd = _._nextIndentation = null; + _._isUseAllowed = true; + _._inExpression = _._inParentheses = _._inStyleRule = _._stylesheet$_inUnknownAtRule = _._inControlDirective = _._inContentBlock = _._stylesheet$_inMixin = false; + _._globalVariables = t0; + _.lastSilentComment = null; + _.scanner = t1; + _.logger = t2; + _._interpolationMap = t3; + }, + SassParser_styleRuleSelector_closure: function SassParser_styleRuleSelector_closure() { + }, + SassParser_children_closure: function SassParser_children_closure(t0, t1, t2) { + this.$this = t0; + this.child = t1; + this.children = t2; + }, + SassParser__peekIndentation_closure: function SassParser__peekIndentation_closure() { + }, + SassParser__peekIndentation_closure0: function SassParser__peekIndentation_closure0() { + }, + ScssParser$(contents, logger, url) { + var t1 = A.SpanScanner$(contents, url), + t2 = logger == null ? B.StderrLogger_false : logger; + return new A.ScssParser(A.LinkedHashMap_LinkedHashMap$_empty(type$.String, type$.VariableDeclaration), t1, t2, null); + }, + ScssParser: function ScssParser(t0, t1, t2, t3) { + var _ = this; + _._isUseAllowed = true; + _._inExpression = _._inParentheses = _._inStyleRule = _._stylesheet$_inUnknownAtRule = _._inControlDirective = _._inContentBlock = _._stylesheet$_inMixin = false; + _._globalVariables = t0; + _.lastSilentComment = null; + _.scanner = t1; + _.logger = t2; + _._interpolationMap = t3; + }, + SelectorParser$(contents, allowParent, allowPlaceholder, interpolationMap, logger, url) { + var t1 = A.SpanScanner$(contents, url); + return new A.SelectorParser(allowParent, allowPlaceholder, t1, logger == null ? B.StderrLogger_false : logger, interpolationMap); + }, + SelectorParser: function SelectorParser(t0, t1, t2, t3, t4) { + var _ = this; + _._allowParent = t0; + _._allowPlaceholder = t1; + _.scanner = t2; + _.logger = t3; + _._interpolationMap = t4; + }, + SelectorParser_parse_closure: function SelectorParser_parse_closure(t0) { + this.$this = t0; + }, + SelectorParser_parseCompoundSelector_closure: function SelectorParser_parseCompoundSelector_closure(t0) { + this.$this = t0; + }, + StylesheetParser: function StylesheetParser() { + }, + StylesheetParser_parse_closure: function StylesheetParser_parse_closure(t0) { + this.$this = t0; + }, + StylesheetParser_parse__closure: function StylesheetParser_parse__closure(t0) { + this.$this = t0; + }, + StylesheetParser_parse__closure0: function StylesheetParser_parse__closure0() { + }, + StylesheetParser_parseArgumentDeclaration_closure: function StylesheetParser_parseArgumentDeclaration_closure(t0) { + this.$this = t0; + }, + StylesheetParser_parseVariableDeclaration_closure: function StylesheetParser_parseVariableDeclaration_closure(t0) { + this.$this = t0; + }, + StylesheetParser_parseUseRule_closure: function StylesheetParser_parseUseRule_closure(t0) { + this.$this = t0; + }, + StylesheetParser__parseSingleProduction_closure: function StylesheetParser__parseSingleProduction_closure(t0, t1, t2) { + this.$this = t0; + this.production = t1; + this.T = t2; + }, + StylesheetParser__statement_closure: function StylesheetParser__statement_closure(t0) { + this.$this = t0; + }, + StylesheetParser_variableDeclarationWithoutNamespace_closure: function StylesheetParser_variableDeclarationWithoutNamespace_closure(t0, t1) { + this.$this = t0; + this.start = t1; + }, + StylesheetParser_variableDeclarationWithoutNamespace_closure0: function StylesheetParser_variableDeclarationWithoutNamespace_closure0(t0) { + this.declaration = t0; + }, + StylesheetParser__declarationOrBuffer_closure: function StylesheetParser__declarationOrBuffer_closure(t0) { + this.name = t0; + }, + StylesheetParser__declarationOrBuffer_closure0: function StylesheetParser__declarationOrBuffer_closure0(t0, t1) { + this._box_0 = t0; + this.name = t1; + }, + StylesheetParser__styleRule_closure: function StylesheetParser__styleRule_closure(t0, t1, t2, t3) { + var _ = this; + _._box_0 = t0; + _.$this = t1; + _.wasInStyleRule = t2; + _.start = t3; + }, + StylesheetParser__propertyOrVariableDeclaration_closure: function StylesheetParser__propertyOrVariableDeclaration_closure(t0) { + this._box_0 = t0; + }, + StylesheetParser__propertyOrVariableDeclaration_closure0: function StylesheetParser__propertyOrVariableDeclaration_closure0(t0, t1) { + this._box_0 = t0; + this.value = t1; + }, + StylesheetParser__atRootRule_closure: function StylesheetParser__atRootRule_closure(t0) { + this.query = t0; + }, + StylesheetParser__atRootRule_closure0: function StylesheetParser__atRootRule_closure0() { + }, + StylesheetParser__eachRule_closure: function StylesheetParser__eachRule_closure(t0, t1, t2, t3) { + var _ = this; + _.$this = t0; + _.wasInControlDirective = t1; + _.variables = t2; + _.list = t3; + }, + StylesheetParser__functionRule_closure: function StylesheetParser__functionRule_closure(t0, t1, t2) { + this.name = t0; + this.$arguments = t1; + this.precedingComment = t2; + }, + StylesheetParser__forRule_closure: function StylesheetParser__forRule_closure(t0, t1) { + this._box_0 = t0; + this.$this = t1; + }, + StylesheetParser__forRule_closure0: function StylesheetParser__forRule_closure0(t0, t1, t2, t3, t4, t5) { + var _ = this; + _._box_0 = t0; + _.$this = t1; + _.wasInControlDirective = t2; + _.variable = t3; + _.from = t4; + _.to = t5; + }, + StylesheetParser__memberList_closure: function StylesheetParser__memberList_closure(t0, t1, t2) { + this.$this = t0; + this.variables = t1; + this.identifiers = t2; + }, + StylesheetParser__includeRule_closure: function StylesheetParser__includeRule_closure(t0) { + this.contentArguments_ = t0; + }, + StylesheetParser_mediaRule_closure: function StylesheetParser_mediaRule_closure(t0) { + this.query = t0; + }, + StylesheetParser__mixinRule_closure: function StylesheetParser__mixinRule_closure(t0, t1, t2, t3) { + var _ = this; + _.$this = t0; + _.name = t1; + _.$arguments = t2; + _.precedingComment = t3; + }, + StylesheetParser_mozDocumentRule_closure: function StylesheetParser_mozDocumentRule_closure(t0, t1, t2, t3) { + var _ = this; + _._box_0 = t0; + _.$this = t1; + _.name = t2; + _.value = t3; + }, + StylesheetParser_supportsRule_closure: function StylesheetParser_supportsRule_closure(t0) { + this.condition = t0; + }, + StylesheetParser__whileRule_closure: function StylesheetParser__whileRule_closure(t0, t1, t2) { + this.$this = t0; + this.wasInControlDirective = t1; + this.condition = t2; + }, + StylesheetParser_unknownAtRule_closure: function StylesheetParser_unknownAtRule_closure(t0, t1) { + this._box_0 = t0; + this.name = t1; + }, + StylesheetParser__expression_resetState: function StylesheetParser__expression_resetState(t0, t1, t2) { + this._box_0 = t0; + this.$this = t1; + this.start = t2; + }, + StylesheetParser__expression_resolveOneOperation: function StylesheetParser__expression_resolveOneOperation(t0, t1) { + this._box_0 = t0; + this.$this = t1; + }, + StylesheetParser__expression_resolveOperations: function StylesheetParser__expression_resolveOperations(t0, t1) { + this._box_0 = t0; + this.resolveOneOperation = t1; + }, + StylesheetParser__expression_addSingleExpression: function StylesheetParser__expression_addSingleExpression(t0, t1, t2, t3) { + var _ = this; + _._box_0 = t0; + _.$this = t1; + _.resetState = t2; + _.resolveOperations = t3; + }, + StylesheetParser__expression_addOperator: function StylesheetParser__expression_addOperator(t0, t1, t2) { + this._box_0 = t0; + this.$this = t1; + this.resolveOneOperation = t2; + }, + StylesheetParser__expression_resolveSpaceExpressions: function StylesheetParser__expression_resolveSpaceExpressions(t0, t1, t2) { + this._box_0 = t0; + this.$this = t1; + this.resolveOperations = t2; + }, + StylesheetParser_expressionUntilComma_closure: function StylesheetParser_expressionUntilComma_closure(t0) { + this.$this = t0; + }, + StylesheetParser__isHexColor_closure: function StylesheetParser__isHexColor_closure() { + }, + StylesheetParser__unicodeRange_closure: function StylesheetParser__unicodeRange_closure() { + }, + StylesheetParser__unicodeRange_closure0: function StylesheetParser__unicodeRange_closure0() { + }, + StylesheetParser_namespacedExpression_closure: function StylesheetParser_namespacedExpression_closure(t0, t1) { + this.$this = t0; + this.start = t1; + }, + StylesheetParser_trySpecialFunction_closure: function StylesheetParser_trySpecialFunction_closure() { + }, + StylesheetParser__expressionUntilComparison_closure: function StylesheetParser__expressionUntilComparison_closure(t0) { + this.$this = t0; + }, + StylesheetParser__publicIdentifier_closure: function StylesheetParser__publicIdentifier_closure(t0, t1) { + this.$this = t0; + this.start = t1; + }, + StylesheetNode$_(_stylesheet, importer, canonicalUrl, allUpstream) { + var t1 = new A.StylesheetNode(_stylesheet, importer, canonicalUrl, allUpstream._1, allUpstream._0, A.LinkedHashSet_LinkedHashSet$_empty(type$.StylesheetNode)); + t1.StylesheetNode$_$4(_stylesheet, importer, canonicalUrl, allUpstream); + return t1; + }, + StylesheetGraph: function StylesheetGraph(t0, t1, t2) { + this._nodes = t0; + this.importCache = t1; + this._transitiveModificationTimes = t2; + }, + StylesheetGraph_modifiedSince_transitiveModificationTime: function StylesheetGraph_modifiedSince_transitiveModificationTime(t0) { + this.$this = t0; + }, + StylesheetGraph_modifiedSince_transitiveModificationTime_closure: function StylesheetGraph_modifiedSince_transitiveModificationTime_closure(t0, t1) { + this.node = t0; + this.transitiveModificationTime = t1; + }, + StylesheetGraph__add_closure: function StylesheetGraph__add_closure(t0, t1, t2, t3) { + var _ = this; + _.$this = t0; + _.url = t1; + _.baseImporter = t2; + _.baseUrl = t3; + }, + StylesheetGraph_addCanonical_closure: function StylesheetGraph_addCanonical_closure(t0, t1, t2, t3) { + var _ = this; + _.$this = t0; + _.importer = t1; + _.canonicalUrl = t2; + _.originalUrl = t3; + }, + StylesheetGraph_reload_closure: function StylesheetGraph_reload_closure(t0, t1, t2) { + this.$this = t0; + this.node = t1; + this.canonicalUrl = t2; + }, + StylesheetGraph__nodeFor_closure: function StylesheetGraph__nodeFor_closure(t0, t1, t2, t3, t4) { + var _ = this; + _.$this = t0; + _.url = t1; + _.baseImporter = t2; + _.baseUrl = t3; + _.forImport = t4; + }, + StylesheetGraph__nodeFor_closure0: function StylesheetGraph__nodeFor_closure0(t0, t1) { + this._box_0 = t0; + this.$this = t1; + }, + StylesheetNode: function StylesheetNode(t0, t1, t2, t3, t4, t5) { + var _ = this; + _._stylesheet = t0; + _.importer = t1; + _.canonicalUrl = t2; + _._upstream = t3; + _._upstreamImports = t4; + _._downstream = t5; + }, + Syntax_forPath(path) { + var t1, + _0_0 = A.ParsedPath_ParsedPath$parse(path, $.$get$context().style)._splitExtension$1(1)[1]; + $label0$0: { + if (".sass" === _0_0) { + t1 = B.Syntax_Sass_sass; + break $label0$0; + } + if (".css" === _0_0) { + t1 = B.Syntax_CSS_css; + break $label0$0; + } + t1 = B.Syntax_SCSS_scss; + break $label0$0; + } + return t1; + }, + Syntax: function Syntax(t0, t1) { + this._syntax$_name = t0; + this._name = t1; + }, + Box: function Box(t0, t1) { + this._box$_inner = t0; + this.$ti = t1; + }, + ModifiableBox: function ModifiableBox(t0, t1) { + this.value = t0; + this.$ti = t1; + }, + LazyFileSpan: function LazyFileSpan(t0) { + this._builder = t0; + this._lazy_file_span$_span = null; + }, + LimitedMapView$blocklist(_map, blocklist, $K, $V) { + var t2, key, + t1 = A.LinkedHashSet_LinkedHashSet$_empty($K); + for (t2 = J.get$iterator$ax(_map.get$keys(_map)); t2.moveNext$0();) { + key = t2.get$current(t2); + if (!blocklist.contains$1(0, key)) + t1.add$1(0, key); + } + return new A.LimitedMapView(_map, t1, $K._eval$1("@<0>")._bind$1($V)._eval$1("LimitedMapView<1,2>")); + }, + LimitedMapView: function LimitedMapView(t0, t1, t2) { + this._limited_map_view$_map = t0; + this._limited_map_view$_keys = t1; + this.$ti = t2; + }, + MapExtensions_get_pairs(_this, $K, $V) { + return _this.get$entries(_this).map$1$1(0, new A.MapExtensions_get_pairs_closure($K, $V), $K._eval$1("@<0>")._bind$1($V)._eval$1("+(1,2)")); + }, + MapExtensions_get_pairs_closure: function MapExtensions_get_pairs_closure(t0, t1) { + this.K = t0; + this.V = t1; + }, + MergedMapView$(maps, $K, $V) { + var t1 = $K._eval$1("@<0>")._bind$1($V); + t1 = new A.MergedMapView(A.LinkedHashMap_LinkedHashMap$_empty($K, t1._eval$1("Map<1,2>")), t1._eval$1("MergedMapView<1,2>")); + t1.MergedMapView$1(maps, $K, $V); + return t1; + }, + MergedMapView: function MergedMapView(t0, t1) { + this._mapsByKey = t0; + this.$ti = t1; + }, + MultiDirWatcher: function MultiDirWatcher(t0, t1, t2) { + this._watchers = t0; + this._group = t1; + this._poll = t2; + }, + MultiSpan: function MultiSpan(t0, t1, t2) { + this._multi_span$_primary = t0; + this.primaryLabel = t1; + this.secondarySpans = t2; + }, + NoSourceMapBuffer: function NoSourceMapBuffer(t0) { + this._no_source_map_buffer$_buffer = t0; + }, + PrefixedMapView: function PrefixedMapView(t0, t1, t2) { + this._prefixed_map_view$_map = t0; + this._prefix = t1; + this.$ti = t2; + }, + _PrefixedKeys: function _PrefixedKeys(t0) { + this._view = t0; + }, + _PrefixedKeys_iterator_closure: function _PrefixedKeys_iterator_closure(t0) { + this.$this = t0; + }, + PublicMemberMapView: function PublicMemberMapView(t0, t1) { + this._public_member_map_view$_inner = t0; + this.$ti = t1; + }, + SourceMapBuffer: function SourceMapBuffer(t0, t1) { + var _ = this; + _._source_map_buffer$_buffer = t0; + _._entries = t1; + _._column = _._line = 0; + _._inSpan = false; + }, + SourceMapBuffer_buildSourceMap_closure: function SourceMapBuffer_buildSourceMap_closure(t0, t1) { + this._box_0 = t0; + this.prefixLength = t1; + }, + UnprefixedMapView: function UnprefixedMapView(t0, t1, t2) { + this._unprefixed_map_view$_map = t0; + this._unprefixed_map_view$_prefix = t1; + this.$ti = t2; + }, + _UnprefixedKeys: function _UnprefixedKeys(t0) { + this._unprefixed_map_view$_view = t0; + }, + _UnprefixedKeys_iterator_closure: function _UnprefixedKeys_iterator_closure(t0) { + this.$this = t0; + }, + _UnprefixedKeys_iterator_closure0: function _UnprefixedKeys_iterator_closure0(t0) { + this.$this = t0; + }, + toSentence(iter, conjunction) { + if (iter.get$length(iter) === 1) + return J.toString$0$(iter.get$first(iter)); + return A.IterableExtension_get_exceptLast(iter).join$1(0, ", ") + (" " + conjunction + " " + A.S(iter.get$last(iter))); + }, + indent(string, indentation) { + return new A.MappedListIterable(A._setArrayType(string.split("\n"), type$.JSArray_String), new A.indent_closure(indentation), type$.MappedListIterable_String_String).join$1(0, "\n"); + }, + pluralize($name, number, plural) { + if (number === 1) + return $name; + if (plural != null) + return plural; + return $name + "s"; + }, + trimAscii(string, excludeEscape) { + var t1, + start = A._firstNonWhitespace(string); + if (start == null) + t1 = ""; + else { + t1 = A._lastNonWhitespace(string, true); + t1.toString; + t1 = B.JSString_methods.substring$2(string, start, t1 + 1); + } + return t1; + }, + trimAsciiRight(string, excludeEscape) { + var end = A._lastNonWhitespace(string, excludeEscape); + return end == null ? "" : B.JSString_methods.substring$2(string, 0, end + 1); + }, + _firstNonWhitespace(string) { + var t1, i, t2; + for (t1 = string.length, i = 0; i < t1; ++i) { + t2 = string.charCodeAt(i); + if (!(t2 === 32 || t2 === 9 || t2 === 10 || t2 === 13 || t2 === 12)) + return i; + } + return null; + }, + _lastNonWhitespace(string, excludeEscape) { + var i, i0, codeUnit; + for (i = string.length - 1, i0 = i; i0 >= 0; --i0) { + codeUnit = string.charCodeAt(i0); + if (!(codeUnit === 32 || codeUnit === 9 || codeUnit === 10 || codeUnit === 13 || codeUnit === 12)) + if (excludeEscape && i0 !== 0 && i0 !== i && codeUnit === 92) + return i0 + 1; + else + return i0; + } + return null; + }, + isPublic(member) { + var start = member.charCodeAt(0); + return start !== 45 && start !== 95; + }, + flattenVertically(iterable, $T) { + var result, + t1 = iterable.$ti._eval$1("@")._bind$1($T._eval$1("QueueList<0>"))._eval$1("MappedListIterable<1,2>"), + queues = A.List_List$of(new A.MappedListIterable(iterable, new A.flattenVertically_closure($T), t1), true, t1._eval$1("ListIterable.E")); + if (queues.length === 1) + return B.JSArray_methods.get$first(queues); + result = A._setArrayType([], $T._eval$1("JSArray<0>")); + for (; queues.length !== 0;) { + if (!!queues.fixed$length) + A.throwExpression(A.UnsupportedError$("removeWhere")); + B.JSArray_methods._removeWhere$2(queues, new A.flattenVertically_closure0(result, $T), true); + } + return result; + }, + codepointIndexToCodeUnitIndex(string, codepointIndex) { + var codeUnitIndex, i, codeUnitIndex0; + for (codeUnitIndex = 0, i = 0; i < codepointIndex; ++i) { + codeUnitIndex0 = codeUnitIndex + 1; + codeUnitIndex = string.charCodeAt(codeUnitIndex) >>> 10 === 54 ? codeUnitIndex0 + 1 : codeUnitIndex0; + } + return codeUnitIndex; + }, + codeUnitIndexToCodepointIndex(string, codeUnitIndex) { + var codepointIndex, i; + for (codepointIndex = 0, i = 0; i < codeUnitIndex; i = (string.charCodeAt(i) >>> 10 === 54 ? i + 1 : i) + 1) + ++codepointIndex; + return codepointIndex; + }, + frameForSpan(span, member, url) { + var t2, t3, + t1 = url == null ? span.get$sourceUrl(span) : url; + if (t1 == null) + t1 = $.$get$_noSourceUrl(); + t2 = span.get$start(span); + t2 = t2.file.getLine$1(t2.offset); + t3 = span.get$start(span); + return new A.Frame(t1, t2 + 1, t3.file.getColumn$1(t3.offset) + 1, member); + }, + declarationName(span) { + var text = A.String_String$fromCharCodes(B.NativeUint32List_methods.sublist$2(span.file._decodedChars, span._file$_start, span._end), 0, null); + return A.trimAsciiRight(B.JSString_methods.substring$2(text, 0, B.JSString_methods.indexOf$1(text, ":")), false); + }, + unvendor($name) { + var i, + t1 = $name.length; + if (t1 < 2) + return $name; + if ($name.charCodeAt(0) !== 45) + return $name; + if ($name.charCodeAt(1) === 45) + return $name; + for (i = 2; i < t1; ++i) + if ($name.charCodeAt(i) === 45) + return B.JSString_methods.substring$1($name, i + 1); + return $name; + }, + equalsIgnoreCase(string1, string2) { + var t1, i; + if (string1 === string2) + return true; + if (string1 == null || false) + return false; + t1 = string1.length; + if (t1 !== string2.length) + return false; + for (i = 0; i < t1; ++i) + if (!A.characterEqualsIgnoreCase(string1.charCodeAt(i), string2.charCodeAt(i))) + return false; + return true; + }, + startsWithIgnoreCase(string, prefix) { + var i, + t1 = prefix.length; + if (string.length < t1) + return false; + for (i = 0; i < t1; ++i) + if (!A.characterEqualsIgnoreCase(string.charCodeAt(i), prefix.charCodeAt(i))) + return false; + return true; + }, + mapInPlace(list, $function) { + var i; + for (i = 0; i < list.length; ++i) + list[i] = $function.call$1(list[i]); + }, + longestCommonSubsequence(list1, list2, select, $T) { + var t1, _i, selections, i, i0, j, selection, j0, + _length = list1.get$length(0) + 1, + lengths = J.JSArray_JSArray$allocateFixed(_length, type$.List_int); + for (t1 = type$.int, _i = 0; _i < _length; ++_i) + lengths[_i] = A.List_List$filled(((list2._queue_list$_tail - list2._queue_list$_head & J.get$length$asx(list2._queue_list$_table) - 1) >>> 0) + 1, 0, false, t1); + _length = list1.get$length(0); + selections = J.JSArray_JSArray$allocateFixed(_length, $T._eval$1("List<0?>")); + for (t1 = $T._eval$1("0?"), _i = 0; _i < _length; ++_i) + selections[_i] = A.List_List$filled((list2._queue_list$_tail - list2._queue_list$_head & J.get$length$asx(list2._queue_list$_table) - 1) >>> 0, null, false, t1); + for (i = 0; i < (list1._queue_list$_tail - list1._queue_list$_head & J.get$length$asx(list1._queue_list$_table) - 1) >>> 0; i = i0) + for (i0 = i + 1, j = 0; j < (list2._queue_list$_tail - list2._queue_list$_head & J.get$length$asx(list2._queue_list$_table) - 1) >>> 0; j = j0) { + selection = select.call$2(list1.$index(0, i), list2.$index(0, j)); + selections[i][j] = selection; + t1 = lengths[i0]; + j0 = j + 1; + t1[j0] = selection == null ? Math.max(t1[j], lengths[i][j0]) : lengths[i][j] + 1; + } + return new A.longestCommonSubsequence_backtrack(selections, lengths, $T).call$2(list1.get$length(0) - 1, list2.get$length(0) - 1); + }, + removeFirstWhere(list, test, orElse) { + var i; + for (i = 0; i < list.length; ++i) { + if (!test.call$1(list[i])) + continue; + B.JSArray_methods.removeAt$1(list, i); + return; + } + orElse.call$0(); + }, + mapAddAll2(destination, source, K1, K2, $V) { + source.forEach$1(0, new A.mapAddAll2_closure(destination, K1, K2, $V)); + }, + setAll(map, keys, value) { + var t1; + for (t1 = J.get$iterator$ax(keys); t1.moveNext$0();) + map.$indexSet(0, t1.get$current(t1), value); + }, + rotateSlice(list, start, end) { + var i, next, + element = list.$index(0, end - 1); + for (i = start; i < end; ++i, element = next) { + next = list.$index(0, i); + list.$indexSet(0, i, element); + } + }, + mapAsync(iterable, callback, $E, $F) { + return A.mapAsync$body(iterable, callback, $E, $F, $F._eval$1("Iterable<0>")); + }, + mapAsync$body(iterable, callback, $E, $F, $async$type) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter($async$type), + $async$returnValue, t2, _i, t1, $async$temp1; + var $async$mapAsync = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = A._setArrayType([], $F._eval$1("JSArray<0>")); + t2 = iterable.length, _i = 0; + case 3: + // for condition + if (!(_i < t2)) { + // goto after for + $async$goto = 5; + break; + } + $async$temp1 = t1; + $async$goto = 6; + return A._asyncAwait(callback.call$1(iterable[_i]), $async$mapAsync); + case 6: + // returning from await. + $async$temp1.push($async$result); + case 4: + // for update + ++_i; + // goto for condition + $async$goto = 3; + break; + case 5: + // after for + $async$returnValue = t1; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$mapAsync, $async$completer); + }, + putIfAbsentAsync(map, key, ifAbsent, $K, $V) { + return A.putIfAbsentAsync$body(map, key, ifAbsent, $K, $V, $V); + }, + putIfAbsentAsync$body(map, key, ifAbsent, $K, $V, $async$type) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter($async$type), + $async$returnValue, t1, value; + var $async$putIfAbsentAsync = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + if (map.containsKey$1(key)) { + t1 = map.$index(0, key); + $async$returnValue = t1 == null ? $V._as(t1) : t1; + // goto return + $async$goto = 1; + break; + } + $async$goto = 3; + return A._asyncAwait(ifAbsent.call$0(), $async$putIfAbsentAsync); + case 3: + // returning from await. + value = $async$result; + map.$indexSet(0, key, value); + $async$returnValue = value; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$putIfAbsentAsync, $async$completer); + }, + copyMapOfMap(map, K1, K2, $V) { + var t3, key, child, + t1 = K2._eval$1("@<0>")._bind$1($V)._eval$1("Map<1,2>"), + t2 = A.LinkedHashMap_LinkedHashMap$_empty(K1, t1); + for (t1 = A.MapExtensions_get_pairs(map, K1, t1), t1 = t1.get$iterator(t1); t1.moveNext$0();) { + t3 = t1.get$current(t1); + key = t3._0; + child = t3._1; + t3 = A.LinkedHashMap_LinkedHashMap(null, null, null, K2, $V); + t3.addAll$1(0, child); + t2.$indexSet(0, key, t3); + } + return t2; + }, + copyMapOfList(map, $K, $E) { + var t3, + t1 = $E._eval$1("List<0>"), + t2 = A.LinkedHashMap_LinkedHashMap$_empty($K, t1); + for (t1 = A.MapExtensions_get_pairs(map, $K, t1), t1 = t1.get$iterator(t1); t1.moveNext$0();) { + t3 = t1.get$current(t1); + t2.$indexSet(0, t3._0, J.toList$0$ax(t3._1)); + } + return t2; + }, + consumeEscapedCharacter(scanner) { + var _1_0, value, i, next, t1; + scanner.expectChar$1(92); + _1_0 = scanner.peekChar$0(); + if (_1_0 == null) + return 65533; + if (_1_0 === 10 || _1_0 === 13 || _1_0 === 12) + scanner.error$1(0, "Expected escape sequence."); + if (A.CharacterExtension_get_isHex(_1_0)) { + for (value = 0, i = 0; i < 6; ++i) { + next = scanner.peekChar$0(); + if (next != null) { + if (!(next >= 48 && next <= 57)) + if (!(next >= 97 && next <= 102)) + t1 = next >= 65 && next <= 70; + else + t1 = true; + else + t1 = true; + t1 = !t1; + } else + t1 = true; + if (t1) + break; + value = (value << 4 >>> 0) + A.asHex(scanner.readChar$0()); + } + t1 = scanner.peekChar$0(); + if (t1 === 32 || t1 === 9 || t1 === 10 || t1 === 13 || t1 === 12) + scanner.readChar$0(); + $label0$1: { + if (0 !== value) + t1 = value >= 55296 && value <= 57343 || value >= 1114111; + else + t1 = true; + if (t1) { + t1 = 65533; + break $label0$1; + } + t1 = value; + break $label0$1; + } + return t1; + } + return scanner.readChar$0(); + }, + throwWithTrace(error, originalError, trace) { + var t1 = A.getTrace(originalError); + A.attachTrace(error, t1 == null ? trace : t1); + throw A.wrapException(error); + }, + attachTrace(error, trace) { + var t1; + if (trace.toString$0(0).length === 0) + return; + t1 = $.$get$_traces(); + A.Expando__checkType(error); + if (t1._jsWeakMap.get(error) == null) + t1.$indexSet(0, error, trace); + }, + getTrace(error) { + var t1; + if (typeof error == "string" || typeof error == "number" || A._isBool(error)) + t1 = null; + else { + t1 = $.$get$_traces(); + A.Expando__checkType(error); + t1 = t1._jsWeakMap.get(error); + } + return t1; + }, + indent_closure: function indent_closure(t0) { + this.indentation = t0; + }, + flattenVertically_closure: function flattenVertically_closure(t0) { + this.T = t0; + }, + flattenVertically_closure0: function flattenVertically_closure0(t0, t1) { + this.result = t0; + this.T = t1; + }, + longestCommonSubsequence_backtrack: function longestCommonSubsequence_backtrack(t0, t1, t2) { + this.selections = t0; + this.lengths = t1; + this.T = t2; + }, + mapAddAll2_closure: function mapAddAll2_closure(t0, t1, t2, t3) { + var _ = this; + _.destination = t0; + _.K1 = t1; + _.K2 = t2; + _.V = t3; + }, + SassApiValue_assertSelector(_this, allowParent, $name) { + var error, stackTrace, t1, exception, + string = _this._selectorString$1($name); + try { + t1 = A.SelectorList_SelectorList$parse(string, allowParent, true, null, null); + return t1; + } catch (exception) { + t1 = A.unwrapException(exception); + if (type$.SassFormatException._is(t1)) { + error = t1; + stackTrace = A.getTraceFromException(exception); + t1 = B.JSString_methods.replaceFirst$2(J.toString$0$(error), "Error: ", ""); + A.throwWithTrace(new A.SassScriptException($name == null ? t1 : "$" + $name + ": " + t1), error, stackTrace); + } else + throw exception; + } + }, + SassApiValue_assertCompoundSelector(_this, $name) { + var error, stackTrace, t1, exception, + allowParent = false, + string = _this._selectorString$1($name); + try { + t1 = A.SelectorParser$(string, allowParent, true, null, null, null).parseCompoundSelector$0(); + return t1; + } catch (exception) { + t1 = A.unwrapException(exception); + if (type$.SassFormatException._is(t1)) { + error = t1; + stackTrace = A.getTraceFromException(exception); + t1 = B.JSString_methods.replaceFirst$2(J.toString$0$(error), "Error: ", ""); + A.throwWithTrace(new A.SassScriptException("$" + $name + ": " + t1), error, stackTrace); + } else + throw exception; + } + }, + Value: function Value() { + }, + SassArgumentList$(contents, keywords, separator) { + var t1 = type$.Value; + t1 = new A.SassArgumentList(A.ConstantMap_ConstantMap$from(keywords, type$.String, t1), A.List_List$unmodifiable(contents, t1), separator, false); + t1.SassList$3$brackets(contents, separator, false); + return t1; + }, + SassArgumentList: function SassArgumentList(t0, t1, t2, t3) { + var _ = this; + _._keywords = t0; + _._wereKeywordsAccessed = false; + _._list$_contents = t1; + _._separator = t2; + _._hasBrackets = t3; + }, + SassBoolean: function SassBoolean(t0) { + this.value = t0; + }, + SassCalculation_calc(argument) { + var t1, + _0_0 = A.SassCalculation__simplify(argument); + $label0$0: { + if (_0_0 instanceof A.SassNumber) { + t1 = _0_0; + break $label0$0; + } + if (_0_0 instanceof A.SassCalculation) { + t1 = _0_0; + break $label0$0; + } + t1 = new A.SassCalculation("calc", A.List_List$unmodifiable([_0_0], type$.Object)); + break $label0$0; + } + return t1; + }, + SassCalculation_min($arguments) { + var minimum, _i, arg, t2, + args = A.List_List$unmodifiable(new A.MappedListIterable($arguments, A.calculation_SassCalculation__simplify$closure(), A._arrayInstanceType($arguments)._eval$1("MappedListIterable<1,@>")), type$.Object), + t1 = args.length; + if (t1 === 0) + throw A.wrapException(A.ArgumentError$("min() must have at least one argument.", null)); + for (minimum = null, _i = 0; _i < t1; ++_i) { + arg = args[_i]; + if (arg instanceof A.SassNumber) + t2 = minimum != null && !minimum.isComparableTo$1(arg); + else + t2 = true; + if (t2) { + minimum = null; + break; + } else if (minimum == null || minimum.greaterThan$1(arg).value) + minimum = arg; + } + if (minimum != null) + return minimum; + A.SassCalculation__verifyCompatibleNumbers(args); + return new A.SassCalculation("min", args); + }, + SassCalculation_max($arguments) { + var maximum, _i, arg, t2, + args = A.List_List$unmodifiable(new A.MappedListIterable($arguments, A.calculation_SassCalculation__simplify$closure(), A._arrayInstanceType($arguments)._eval$1("MappedListIterable<1,@>")), type$.Object), + t1 = args.length; + if (t1 === 0) + throw A.wrapException(A.ArgumentError$("max() must have at least one argument.", null)); + for (maximum = null, _i = 0; _i < t1; ++_i) { + arg = args[_i]; + if (arg instanceof A.SassNumber) + t2 = maximum != null && !maximum.isComparableTo$1(arg); + else + t2 = true; + if (t2) { + maximum = null; + break; + } else if (maximum == null || maximum.lessThan$1(arg).value) + maximum = arg; + } + if (maximum != null) + return maximum; + A.SassCalculation__verifyCompatibleNumbers(args); + return new A.SassCalculation("max", args); + }, + SassCalculation_hypot($arguments) { + var first, subtotal, i, number, value, t2, t3, + args = A.List_List$unmodifiable(new A.MappedListIterable($arguments, A.calculation_SassCalculation__simplify$closure(), A._arrayInstanceType($arguments)._eval$1("MappedListIterable<1,@>")), type$.Object), + t1 = args.length; + if (t1 === 0) + throw A.wrapException(A.ArgumentError$("hypot() must have at least one argument.", null)); + A.SassCalculation__verifyCompatibleNumbers(args); + first = B.JSArray_methods.get$first(args); + if (!(first instanceof A.SassNumber) || first.hasUnit$1("%")) + return new A.SassCalculation("hypot", args); + for (subtotal = 0, i = 0; i < t1;) { + number = args[i]; + if (!(number instanceof A.SassNumber) || !number.hasCompatibleUnits$1(first)) + return new A.SassCalculation("hypot", args); + ++i; + value = number.convertValueToMatch$3(first, "numbers[" + i + "]", "numbers[1]"); + subtotal += value * value; + } + t1 = Math.sqrt(subtotal); + t2 = J.getInterceptor$x(first); + t3 = t2.get$numeratorUnits(first); + return A.SassNumber_SassNumber$withUnits(t1, t2.get$denominatorUnits(first), t3); + }, + SassCalculation_abs(argument) { + var t1, t2; + argument = A.SassCalculation__simplify(argument); + if (!(argument instanceof A.SassNumber)) + return new A.SassCalculation("abs", A._setArrayType([argument], type$.JSArray_Object)); + if (argument.hasUnit$1("%")) { + t1 = argument.toString$0(0); + t2 = argument.toString$0(0); + A.EvaluationContext_current().warn$2(0, string$.Passinp + t1 + ")\nTo emit a CSS abs() now: abs(#{" + t2 + string$.x7d__Mor, B.Deprecation_043); + } + return A.SassNumber_SassNumber(Math.abs(argument._number$_value), null).coerceToMatch$1(argument); + }, + SassCalculation_exp(argument) { + argument = A.SassCalculation__simplify(argument); + if (!(argument instanceof A.SassNumber)) + return new A.SassCalculation("exp", A._setArrayType([argument], type$.JSArray_Object)); + argument.assertNoUnits$0(); + return A.pow0(A.SassNumber_SassNumber(2.718281828459045, null), argument); + }, + SassCalculation_sign(argument) { + var t1, _0_2, t2, arg; + argument = A.SassCalculation__simplify(argument); + $label0$0: { + t1 = argument instanceof A.SassNumber; + if (t1) { + _0_2 = argument._number$_value; + if (!isNaN(_0_2)) + t2 = 0 === _0_2; + else + t2 = true; + } else + t2 = false; + if (t2) { + t1 = argument; + break $label0$0; + } + if (t1) { + t1 = !argument.hasUnit$1("%"); + arg = argument; + } else { + arg = null; + t1 = false; + } + if (t1) { + t1 = A.SassNumber_SassNumber(J.get$sign$in(arg._number$_value), null).coerceToMatch$1(argument); + break $label0$0; + } + t1 = new A.SassCalculation("sign", A._setArrayType([argument], type$.JSArray_Object)); + break $label0$0; + } + return t1; + }, + SassCalculation_clamp(min, value, max) { + var t1, args; + if (value == null && max != null) + throw A.wrapException(A.ArgumentError$("If value is null, max must also be null.", null)); + min = A.SassCalculation__simplify(min); + value = A.NullableExtension_andThen(value, A.calculation_SassCalculation__simplify$closure()); + max = A.NullableExtension_andThen(max, A.calculation_SassCalculation__simplify$closure()); + if (min instanceof A.SassNumber && value instanceof A.SassNumber && max instanceof A.SassNumber && min.hasCompatibleUnits$1(value) && min.hasCompatibleUnits$1(max)) { + if (value.lessThanOrEquals$1(min).value) + return min; + if (value.greaterThanOrEquals$1(max).value) + return max; + return value; + } + t1 = [min]; + if (value != null) + t1.push(value); + if (max != null) + t1.push(max); + args = A.List_List$unmodifiable(t1, type$.Object); + A.SassCalculation__verifyCompatibleNumbers(args); + A.SassCalculation__verifyLength(args, 3); + return new A.SassCalculation("clamp", args); + }, + SassCalculation_pow(base, exponent) { + var t1 = A._setArrayType([base], type$.JSArray_Object); + if (exponent != null) + t1.push(exponent); + A.SassCalculation__verifyLength(t1, 2); + base = A.SassCalculation__simplify(base); + exponent = A.NullableExtension_andThen(exponent, A.calculation_SassCalculation__simplify$closure()); + if (!(base instanceof A.SassNumber) || !(exponent instanceof A.SassNumber)) + return new A.SassCalculation("pow", t1); + base.assertNoUnits$0(); + exponent.assertNoUnits$0(); + return A.pow0(base, exponent); + }, + SassCalculation_log(number, base) { + var t1, t2; + number = A.SassCalculation__simplify(number); + base = A.NullableExtension_andThen(base, A.calculation_SassCalculation__simplify$closure()); + t1 = A._setArrayType([number], type$.JSArray_Object); + t2 = base != null; + if (t2) + t1.push(base); + if (number instanceof A.SassNumber) + t2 = t2 && !(base instanceof A.SassNumber); + else + t2 = true; + if (t2) + return new A.SassCalculation("log", t1); + number.assertNoUnits$0(); + if (base instanceof A.SassNumber) { + base.assertNoUnits$0(); + return A.log(number, base); + } + return A.log(number, null); + }, + SassCalculation_atan2(y, x) { + var t1; + y = A.SassCalculation__simplify(y); + x = A.NullableExtension_andThen(x, A.calculation_SassCalculation__simplify$closure()); + t1 = A._setArrayType([y], type$.JSArray_Object); + if (x != null) + t1.push(x); + A.SassCalculation__verifyLength(t1, 2); + A.SassCalculation__verifyCompatibleNumbers(t1); + if (!(y instanceof A.SassNumber) || !(x instanceof A.SassNumber) || y.hasUnit$1("%") || x.hasUnit$1("%") || !y.hasCompatibleUnits$1(x)) + return new A.SassCalculation("atan2", t1); + return A.SassNumber_SassNumber$withUnits(Math.atan2(y._number$_value, x.convertValueToMatch$3(y, "x", "y")) * 57.29577951308232, null, A._setArrayType(["deg"], type$.JSArray_String)); + }, + SassCalculation_rem(dividend, modulus) { + var t1, result; + dividend = A.SassCalculation__simplify(dividend); + modulus = A.NullableExtension_andThen(modulus, A.calculation_SassCalculation__simplify$closure()); + t1 = A._setArrayType([dividend], type$.JSArray_Object); + if (modulus != null) + t1.push(modulus); + A.SassCalculation__verifyLength(t1, 2); + A.SassCalculation__verifyCompatibleNumbers(t1); + if (!(dividend instanceof A.SassNumber) || !(modulus instanceof A.SassNumber) || !dividend.hasCompatibleUnits$1(modulus)) + return new A.SassCalculation("rem", t1); + result = dividend.modulo$1(modulus); + t1 = modulus._number$_value; + if (A.DoubleWithSignedZero_get_signIncludingZero(t1) !== A.DoubleWithSignedZero_get_signIncludingZero(dividend._number$_value)) { + if (t1 == 1 / 0 || t1 == -1 / 0) + return dividend; + if (result._number$_value === 0) + return result.unaryMinus$0(); + return result.minus$1(modulus); + } + return result; + }, + SassCalculation_mod(dividend, modulus) { + var t1; + dividend = A.SassCalculation__simplify(dividend); + modulus = A.NullableExtension_andThen(modulus, A.calculation_SassCalculation__simplify$closure()); + t1 = A._setArrayType([dividend], type$.JSArray_Object); + if (modulus != null) + t1.push(modulus); + A.SassCalculation__verifyLength(t1, 2); + A.SassCalculation__verifyCompatibleNumbers(t1); + if (!(dividend instanceof A.SassNumber) || !(modulus instanceof A.SassNumber) || !dividend.hasCompatibleUnits$1(modulus)) + return new A.SassCalculation("mod", t1); + return dividend.modulo$1(modulus); + }, + SassCalculation_round(strategyOrNumber, numberOrStep, step) { + var _0_4, t1, _0_20, _0_6, _0_50, _0_6_isSet, _0_5_isSet, _0_2_isSet, number, _0_4_isSet, t2, _0_8, _0_8_isSet, _0_12, _0_14, _0_16, _0_16_isSet, _0_14_isSet, _0_12_isSet, t3, strategy, _0_10_isSet, rest, _null = null, _s5_ = "round", + _0_1 = A.SassCalculation__simplify(strategyOrNumber), + _0_2 = A.NullableExtension_andThen(numberOrStep, A.calculation_SassCalculation__simplify$closure()), + _0_5 = A.NullableExtension_andThen(step, A.calculation_SassCalculation__simplify$closure()), + _0_10 = _0_1; + if (_0_1 instanceof A.SassNumber) { + type$.SassNumber._as(_0_10); + _0_4 = _0_2 == null; + t1 = _0_4; + _0_20 = _0_2; + if (t1) { + _0_6 = _0_5 == null; + t1 = _0_6; + _0_50 = _0_5; + _0_6_isSet = true; + _0_5_isSet = true; + } else { + _0_50 = _null; + _0_6 = _0_50; + _0_6_isSet = false; + _0_5_isSet = false; + t1 = false; + } + _0_2_isSet = true; + number = _0_10; + _0_1 = number; + _0_4_isSet = true; + } else { + number = _null; + _0_50 = number; + _0_6 = _0_50; + _0_20 = _0_6; + _0_4 = _0_20; + _0_1 = _0_10; + _0_4_isSet = false; + _0_2_isSet = false; + _0_6_isSet = false; + _0_5_isSet = false; + t1 = false; + } + if (t1) { + t1 = B.JSNumber_methods.round$0(number._number$_value); + t2 = number.get$numeratorUnits(number); + return A.SassNumber_SassNumber$withUnits(t1, number.get$denominatorUnits(number), t2); + } + if (_0_1 instanceof A.SassNumber) { + t1 = type$.SassNumber; + t1._as(_0_1); + if (_0_2_isSet) + t2 = _0_20; + else { + t2 = _0_2; + _0_20 = t2; + _0_2_isSet = true; + } + if (t2 instanceof A.SassNumber) { + if (_0_2_isSet) + t2 = _0_20; + else { + t2 = _0_2; + _0_20 = t2; + _0_2_isSet = true; + } + t1._as(t2); + if (_0_6_isSet) + t1 = _0_6; + else { + if (_0_5_isSet) + t1 = _0_50; + else { + t1 = _0_5; + _0_50 = t1; + _0_5_isSet = true; + } + _0_6 = t1 == null; + t1 = _0_6; + _0_6_isSet = true; + } + t1 = t1 && !_0_1.hasCompatibleUnits$1(t2); + step = t2; + } else { + step = _null; + t1 = false; + } + number = _0_1; + } else { + step = _null; + number = step; + t1 = false; + } + if (t1) { + t1 = type$.JSArray_Object; + A.SassCalculation__verifyCompatibleNumbers(A._setArrayType([number, step], t1)); + return new A.SassCalculation(_s5_, A._setArrayType([number, step], t1)); + } + if (_0_1 instanceof A.SassNumber) { + t1 = type$.SassNumber; + t1._as(_0_1); + if (_0_2_isSet) + t2 = _0_20; + else { + t2 = _0_2; + _0_20 = t2; + _0_2_isSet = true; + } + if (t2 instanceof A.SassNumber) { + if (_0_2_isSet) + t2 = _0_20; + else { + t2 = _0_2; + _0_20 = t2; + _0_2_isSet = true; + } + t1._as(t2); + if (_0_6_isSet) + t1 = _0_6; + else { + if (_0_5_isSet) + t1 = _0_50; + else { + t1 = _0_5; + _0_50 = t1; + _0_5_isSet = true; + } + _0_6 = t1 == null; + t1 = _0_6; + _0_6_isSet = true; + } + step = t2; + } else { + step = _null; + t1 = false; + } + number = _0_1; + } else { + step = _null; + number = step; + t1 = false; + } + if (t1) { + A.SassCalculation__verifyCompatibleNumbers(A._setArrayType([number, step], type$.JSArray_Object)); + return A.SassCalculation__roundWithStep("nearest", number, step); + } + if (_0_1 instanceof A.SassString) { + type$.SassString._as(_0_1); + _0_8 = _0_1._string$_text; + t1 = _0_8; + _0_10 = "nearest" === t1; + t1 = _0_10; + if (!t1) { + t1 = _0_8; + _0_8_isSet = true; + _0_12 = "up" === t1; + t1 = _0_12; + if (!t1) { + if (_0_8_isSet) + t1 = _0_8; + else { + type$.SassString._as(_0_1); + _0_8 = _0_1._string$_text; + t1 = _0_8; + _0_8_isSet = true; + } + _0_14 = "down" === t1; + t1 = _0_14; + if (!t1) { + if (_0_8_isSet) + t1 = _0_8; + else { + type$.SassString._as(_0_1); + _0_8 = _0_1._string$_text; + t1 = _0_8; + _0_8_isSet = true; + } + _0_16 = "to-zero" === t1; + t1 = _0_16; + _0_16_isSet = true; + } else { + _0_16 = _null; + _0_16_isSet = false; + t1 = true; + } + _0_14_isSet = true; + } else { + _0_16 = _null; + _0_14 = _0_16; + _0_14_isSet = false; + _0_16_isSet = false; + t1 = true; + } + _0_12_isSet = true; + } else { + _0_16 = _null; + _0_14 = _0_16; + _0_12 = _0_14; + _0_8_isSet = true; + _0_12_isSet = false; + _0_14_isSet = false; + _0_16_isSet = false; + t1 = true; + } + if (t1) { + type$.SassString._as(_0_1); + if (_0_2_isSet) + t1 = _0_20; + else { + t1 = _0_2; + _0_20 = t1; + _0_2_isSet = true; + } + if (t1 instanceof A.SassNumber) { + if (_0_2_isSet) + t1 = _0_20; + else { + t1 = _0_2; + _0_20 = t1; + _0_2_isSet = true; + } + t2 = type$.SassNumber; + t2._as(t1); + if (_0_5_isSet) + t3 = _0_50; + else { + t3 = _0_5; + _0_50 = t3; + _0_5_isSet = true; + } + if (t3 instanceof A.SassNumber) { + if (_0_5_isSet) + t3 = _0_50; + else { + t3 = _0_5; + _0_50 = t3; + _0_5_isSet = true; + } + t2._as(t3); + t2 = !t1.hasCompatibleUnits$1(t3); + step = t3; + } else { + step = _null; + t2 = false; + } + number = t1; + t1 = t2; + } else { + step = _null; + number = step; + t1 = false; + } + strategy = _0_1; + } else { + step = _null; + number = step; + strategy = number; + t1 = false; + } + _0_10_isSet = true; + } else { + step = _null; + number = step; + strategy = number; + _0_16 = strategy; + _0_14 = _0_16; + _0_12 = _0_14; + _0_8 = _0_12; + _0_10 = _0_8; + _0_10_isSet = false; + _0_8_isSet = false; + _0_12_isSet = false; + _0_14_isSet = false; + _0_16_isSet = false; + t1 = false; + } + if (t1) { + t1 = type$.JSArray_Object; + A.SassCalculation__verifyCompatibleNumbers(A._setArrayType([number, step], t1)); + return new A.SassCalculation(_s5_, A._setArrayType([strategy, number, step], t1)); + } + if (_0_1 instanceof A.SassString) { + if (_0_10_isSet) + t1 = _0_10; + else { + if (_0_8_isSet) + t1 = _0_8; + else { + type$.SassString._as(_0_1); + _0_8 = _0_1._string$_text; + t1 = _0_8; + _0_8_isSet = true; + } + _0_10 = "nearest" === t1; + t1 = _0_10; + _0_10_isSet = true; + } + if (!t1) { + if (_0_12_isSet) + t1 = _0_12; + else { + if (_0_8_isSet) + t1 = _0_8; + else { + type$.SassString._as(_0_1); + _0_8 = _0_1._string$_text; + t1 = _0_8; + _0_8_isSet = true; + } + _0_12 = "up" === t1; + t1 = _0_12; + _0_12_isSet = true; + } + if (!t1) { + if (_0_14_isSet) + t1 = _0_14; + else { + if (_0_8_isSet) + t1 = _0_8; + else { + type$.SassString._as(_0_1); + _0_8 = _0_1._string$_text; + t1 = _0_8; + _0_8_isSet = true; + } + _0_14 = "down" === t1; + t1 = _0_14; + _0_14_isSet = true; + } + if (!t1) + if (_0_16_isSet) + t1 = _0_16; + else { + if (_0_8_isSet) + t1 = _0_8; + else { + type$.SassString._as(_0_1); + _0_8 = _0_1._string$_text; + t1 = _0_8; + _0_8_isSet = true; + } + _0_16 = "to-zero" === t1; + t1 = _0_16; + _0_16_isSet = true; + } + else + t1 = true; + } else + t1 = true; + } else + t1 = true; + if (t1) { + type$.SassString._as(_0_1); + if (_0_2_isSet) + t1 = _0_20; + else { + t1 = _0_2; + _0_20 = t1; + _0_2_isSet = true; + } + if (t1 instanceof A.SassNumber) { + if (_0_2_isSet) + t1 = _0_20; + else { + t1 = _0_2; + _0_20 = t1; + _0_2_isSet = true; + } + t2 = type$.SassNumber; + t2._as(t1); + if (_0_5_isSet) + t3 = _0_50; + else { + t3 = _0_5; + _0_50 = t3; + _0_5_isSet = true; + } + if (t3 instanceof A.SassNumber) { + if (_0_5_isSet) + t3 = _0_50; + else { + t3 = _0_5; + _0_50 = t3; + _0_5_isSet = true; + } + t2._as(t3); + step = t3; + t2 = true; + } else { + step = _null; + t2 = false; + } + number = t1; + t1 = t2; + } else { + step = _null; + number = step; + t1 = false; + } + strategy = _0_1; + } else { + step = _null; + number = step; + strategy = number; + t1 = false; + } + } else { + step = _null; + number = step; + strategy = number; + t1 = false; + } + if (t1) { + A.SassCalculation__verifyCompatibleNumbers(A._setArrayType([number, step], type$.JSArray_Object)); + return A.SassCalculation__roundWithStep(strategy._string$_text, number, step); + } + if (_0_1 instanceof A.SassString) { + if (_0_10_isSet) + t1 = _0_10; + else { + if (_0_8_isSet) + t1 = _0_8; + else { + type$.SassString._as(_0_1); + _0_8 = _0_1._string$_text; + t1 = _0_8; + _0_8_isSet = true; + } + _0_10 = "nearest" === t1; + t1 = _0_10; + _0_10_isSet = true; + } + if (!t1) { + if (_0_12_isSet) + t1 = _0_12; + else { + if (_0_8_isSet) + t1 = _0_8; + else { + type$.SassString._as(_0_1); + _0_8 = _0_1._string$_text; + t1 = _0_8; + _0_8_isSet = true; + } + _0_12 = "up" === t1; + t1 = _0_12; + _0_12_isSet = true; + } + if (!t1) { + if (_0_14_isSet) + t1 = _0_14; + else { + if (_0_8_isSet) + t1 = _0_8; + else { + type$.SassString._as(_0_1); + _0_8 = _0_1._string$_text; + t1 = _0_8; + _0_8_isSet = true; + } + _0_14 = "down" === t1; + t1 = _0_14; + _0_14_isSet = true; + } + if (!t1) + if (_0_16_isSet) + t1 = _0_16; + else { + if (_0_8_isSet) + t1 = _0_8; + else { + type$.SassString._as(_0_1); + _0_8 = _0_1._string$_text; + t1 = _0_8; + _0_8_isSet = true; + } + _0_16 = "to-zero" === t1; + t1 = _0_16; + _0_16_isSet = true; + } + else + t1 = true; + } else + t1 = true; + } else + t1 = true; + if (t1) { + t1 = type$.SassString; + t1._as(_0_1); + if (_0_2_isSet) + t2 = _0_20; + else { + t2 = _0_2; + _0_20 = t2; + _0_2_isSet = true; + } + if (t2 instanceof A.SassString) { + if (_0_2_isSet) + t2 = _0_20; + else { + t2 = _0_2; + _0_20 = t2; + _0_2_isSet = true; + } + t1._as(t2); + if (_0_6_isSet) + t1 = _0_6; + else { + if (_0_5_isSet) + t1 = _0_50; + else { + t1 = _0_5; + _0_50 = t1; + _0_5_isSet = true; + } + _0_6 = t1 == null; + t1 = _0_6; + _0_6_isSet = true; + } + rest = t2; + } else { + rest = _null; + t1 = false; + } + strategy = _0_1; + } else { + rest = _null; + strategy = rest; + t1 = false; + } + } else { + rest = _null; + strategy = rest; + t1 = false; + } + if (t1) + return new A.SassCalculation(_s5_, A._setArrayType([strategy, rest], type$.JSArray_Object)); + if (_0_1 instanceof A.SassString) { + if (_0_10_isSet) + t1 = _0_10; + else { + if (_0_8_isSet) + t1 = _0_8; + else { + type$.SassString._as(_0_1); + _0_8 = _0_1._string$_text; + t1 = _0_8; + _0_8_isSet = true; + } + _0_10 = "nearest" === t1; + t1 = _0_10; + _0_10_isSet = true; + } + if (!t1) { + if (_0_12_isSet) + t1 = _0_12; + else { + if (_0_8_isSet) + t1 = _0_8; + else { + type$.SassString._as(_0_1); + _0_8 = _0_1._string$_text; + t1 = _0_8; + _0_8_isSet = true; + } + _0_12 = "up" === t1; + t1 = _0_12; + _0_12_isSet = true; + } + if (!t1) { + if (_0_14_isSet) + t1 = _0_14; + else { + if (_0_8_isSet) + t1 = _0_8; + else { + type$.SassString._as(_0_1); + _0_8 = _0_1._string$_text; + t1 = _0_8; + _0_8_isSet = true; + } + _0_14 = "down" === t1; + t1 = _0_14; + _0_14_isSet = true; + } + if (!t1) + if (_0_16_isSet) + t1 = _0_16; + else { + if (_0_8_isSet) + t1 = _0_8; + else { + type$.SassString._as(_0_1); + _0_8 = _0_1._string$_text; + t1 = _0_8; + _0_8_isSet = true; + } + _0_16 = "to-zero" === t1; + t1 = _0_16; + _0_16_isSet = true; + } + else + t1 = true; + } else + t1 = true; + } else + t1 = true; + if (t1) { + if (_0_2_isSet) + t1 = _0_20; + else { + t1 = _0_2; + _0_20 = t1; + _0_2_isSet = true; + } + if (t1 != null) + if (_0_6_isSet) + t1 = _0_6; + else { + if (_0_5_isSet) + t1 = _0_50; + else { + t1 = _0_5; + _0_50 = t1; + _0_5_isSet = true; + } + _0_6 = t1 == null; + t1 = _0_6; + _0_6_isSet = true; + } + else + t1 = false; + } else + t1 = false; + } else + t1 = false; + if (t1) + throw A.wrapException(A.SassScriptException$(string$.If_str, _null)); + if (_0_1 instanceof A.SassString) { + if (_0_10_isSet) + t1 = _0_10; + else { + if (_0_8_isSet) + t1 = _0_8; + else { + type$.SassString._as(_0_1); + _0_8 = _0_1._string$_text; + t1 = _0_8; + _0_8_isSet = true; + } + _0_10 = "nearest" === t1; + t1 = _0_10; + _0_10_isSet = true; + } + if (!t1) { + if (_0_12_isSet) + t1 = _0_12; + else { + if (_0_8_isSet) + t1 = _0_8; + else { + type$.SassString._as(_0_1); + _0_8 = _0_1._string$_text; + t1 = _0_8; + _0_8_isSet = true; + } + _0_12 = "up" === t1; + t1 = _0_12; + _0_12_isSet = true; + } + if (!t1) { + if (_0_14_isSet) + t1 = _0_14; + else { + if (_0_8_isSet) + t1 = _0_8; + else { + type$.SassString._as(_0_1); + _0_8 = _0_1._string$_text; + t1 = _0_8; + _0_8_isSet = true; + } + _0_14 = "down" === t1; + t1 = _0_14; + _0_14_isSet = true; + } + if (!t1) + if (_0_16_isSet) + t1 = _0_16; + else { + if (_0_8_isSet) + t1 = _0_8; + else { + type$.SassString._as(_0_1); + _0_8 = _0_1._string$_text; + t1 = _0_8; + _0_8_isSet = true; + } + _0_16 = "to-zero" === t1; + t1 = _0_16; + _0_16_isSet = true; + } + else + t1 = true; + } else + t1 = true; + } else + t1 = true; + if (t1) { + if (_0_4_isSet) + t1 = _0_4; + else { + if (_0_2_isSet) + t1 = _0_20; + else { + t1 = _0_2; + _0_20 = t1; + _0_2_isSet = true; + } + _0_4 = t1 == null; + t1 = _0_4; + _0_4_isSet = true; + } + if (t1) + if (_0_6_isSet) + t1 = _0_6; + else { + if (_0_5_isSet) + t1 = _0_50; + else { + t1 = _0_5; + _0_50 = t1; + _0_5_isSet = true; + } + _0_6 = t1 == null; + t1 = _0_6; + _0_6_isSet = true; + } + else + t1 = false; + } else + t1 = false; + } else + t1 = false; + if (t1) + throw A.wrapException(A.SassScriptException$(string$.Number, _null)); + if (_0_1 instanceof A.SassString) { + type$.SassString._as(_0_1); + if (_0_4_isSet) + t1 = _0_4; + else { + if (_0_2_isSet) + t1 = _0_20; + else { + t1 = _0_2; + _0_20 = t1; + _0_2_isSet = true; + } + _0_4 = t1 == null; + t1 = _0_4; + _0_4_isSet = true; + } + if (t1) + if (_0_6_isSet) + t1 = _0_6; + else { + if (_0_5_isSet) + t1 = _0_50; + else { + t1 = _0_5; + _0_50 = t1; + _0_5_isSet = true; + } + _0_6 = t1 == null; + t1 = _0_6; + _0_6_isSet = true; + } + else + t1 = false; + rest = _0_1; + } else { + rest = _null; + t1 = false; + } + if (t1) + return new A.SassCalculation(_s5_, A._setArrayType([rest], type$.JSArray_Object)); + if (_0_4_isSet) + t1 = _0_4; + else { + if (_0_2_isSet) + t1 = _0_20; + else { + t1 = _0_2; + _0_20 = t1; + _0_2_isSet = true; + } + _0_4 = t1 == null; + t1 = _0_4; + } + if (t1) + if (_0_6_isSet) + t1 = _0_6; + else { + if (_0_5_isSet) + t1 = _0_50; + else { + t1 = _0_5; + _0_50 = t1; + _0_5_isSet = true; + } + _0_6 = t1 == null; + t1 = _0_6; + _0_6_isSet = true; + } + else + t1 = false; + if (t1) + throw A.wrapException(A.SassScriptException$("Single argument " + A.S(_0_1) + " expected to be simplifiable.", _null)); + if (_0_2_isSet) + t1 = _0_20; + else { + t1 = _0_2; + _0_20 = t1; + _0_2_isSet = true; + } + if (t1 != null) { + if (_0_2_isSet) + step = _0_20; + else { + step = _0_2; + _0_20 = step; + _0_2_isSet = true; + } + if (step == null) + step = type$.Object._as(step); + if (_0_6_isSet) + t1 = _0_6; + else { + if (_0_5_isSet) + t1 = _0_50; + else { + t1 = _0_5; + _0_50 = t1; + _0_5_isSet = true; + } + _0_6 = t1 == null; + t1 = _0_6; + } + } else { + step = _null; + t1 = false; + } + if (t1) + return new A.SassCalculation(_s5_, A._setArrayType([_0_1, step], type$.JSArray_Object)); + if (_0_1 instanceof A.SassString) { + if (_0_10_isSet) + t1 = _0_10; + else { + if (_0_8_isSet) + t1 = _0_8; + else { + type$.SassString._as(_0_1); + _0_8 = _0_1._string$_text; + t1 = _0_8; + _0_8_isSet = true; + } + _0_10 = "nearest" === t1; + t1 = _0_10; + } + if (!t1) { + if (_0_12_isSet) + t1 = _0_12; + else { + if (_0_8_isSet) + t1 = _0_8; + else { + type$.SassString._as(_0_1); + _0_8 = _0_1._string$_text; + t1 = _0_8; + _0_8_isSet = true; + } + _0_12 = "up" === t1; + t1 = _0_12; + } + if (!t1) { + if (_0_14_isSet) + t1 = _0_14; + else { + if (_0_8_isSet) + t1 = _0_8; + else { + type$.SassString._as(_0_1); + _0_8 = _0_1._string$_text; + t1 = _0_8; + _0_8_isSet = true; + } + _0_14 = "down" === t1; + t1 = _0_14; + } + if (!t1) + if (_0_16_isSet) + t1 = _0_16; + else { + if (_0_8_isSet) + t1 = _0_8; + else { + type$.SassString._as(_0_1); + _0_8 = _0_1._string$_text; + t1 = _0_8; + } + _0_16 = "to-zero" === t1; + t1 = _0_16; + } + else + t1 = true; + } else + t1 = true; + } else + t1 = true; + } else + t1 = false; + if (!t1) + if (_0_1 instanceof A.SassString) { + type$.SassString._as(_0_1); + t1 = _0_1.get$isVar(); + } else + t1 = false; + else + t1 = true; + if (t1) { + type$.SassString._as(_0_1); + if (_0_2_isSet) + t1 = _0_20; + else { + t1 = _0_2; + _0_20 = t1; + _0_2_isSet = true; + } + if (t1 != null) { + if (_0_2_isSet) + number = _0_20; + else { + number = _0_2; + _0_20 = number; + _0_2_isSet = true; + } + if (number == null) + number = type$.Object._as(number); + if (_0_5_isSet) + t1 = _0_50; + else { + t1 = _0_5; + _0_50 = t1; + _0_5_isSet = true; + } + if (t1 != null) { + if (_0_5_isSet) + step = _0_50; + else { + step = _0_5; + _0_50 = step; + _0_5_isSet = true; + } + if (step == null) + step = type$.Object._as(step); + t1 = true; + } else { + step = _null; + t1 = false; + } + } else { + step = _null; + number = step; + t1 = false; + } + strategy = _0_1; + } else { + step = _null; + number = step; + strategy = number; + t1 = false; + } + if (t1) + return new A.SassCalculation(_s5_, A._setArrayType([strategy, number, step], type$.JSArray_Object)); + if ((_0_2_isSet ? _0_20 : _0_2) != null) + t1 = (_0_5_isSet ? _0_50 : _0_5) != null && true; + else + t1 = false; + if (t1) + throw A.wrapException(A.SassScriptException$(A.S(strategyOrNumber) + string$.x20must_b, _null)); + t1 = A.SassScriptException$("Invalid parameters.", _null); + throw A.wrapException(t1); + }, + SassCalculation_operateInternal(operator, left, right, inLegacySassFunction, simplify) { + var t1; + if (!simplify) + return new A.CalculationOperation(operator, left, right); + left = A.SassCalculation__simplify(left); + right = A.SassCalculation__simplify(right); + if (B.CalculationOperator_IyK === operator || B.CalculationOperator_2bx === operator) { + if (left instanceof A.SassNumber) + if (right instanceof A.SassNumber) + t1 = inLegacySassFunction ? left.isComparableTo$1(right) : left.hasCompatibleUnits$1(right); + else + t1 = false; + else + t1 = false; + if (t1) + return operator === B.CalculationOperator_IyK ? left.plus$1(right) : left.minus$1(right); + A.SassCalculation__verifyCompatibleNumbers(A._setArrayType([left, right], type$.JSArray_Object)); + if (right instanceof A.SassNumber) { + t1 = right._number$_value; + t1 = t1 < 0 && !A.fuzzyEquals(t1, 0); + } else + t1 = false; + if (t1) { + right = right.times$1(A.SassNumber_SassNumber(-1, null)); + operator = operator === B.CalculationOperator_IyK ? B.CalculationOperator_2bx : B.CalculationOperator_IyK; + } + return new A.CalculationOperation(operator, left, right); + } else if (left instanceof A.SassNumber && right instanceof A.SassNumber) + return operator === B.CalculationOperator_jFr ? left.times$1(right) : left.dividedBy$1(right); + else + return new A.CalculationOperation(operator, left, right); + }, + SassCalculation__roundWithStep(strategy, number, step) { + var _0_2, t1, _0_6, _0_8, _0_1, _0_1_isSet, _0_8_isSet, _0_9, _0_9_isSet, _0_11, _0_13, stepWithNumberUnit, t2, _null = null; + if (!A.LinkedHashSet_LinkedHashSet$_literal(["nearest", "up", "down", "to-zero"], type$.String).contains$1(0, strategy)) + throw A.wrapException(A.ArgumentError$(strategy + string$.x20must_b, _null)); + _0_2 = number._number$_value; + if (_0_2 == 1 / 0 || _0_2 == -1 / 0) { + t1 = step._number$_value; + t1 = t1 == 1 / 0 || t1 == -1 / 0; + } else + t1 = false; + if (!t1) { + t1 = step._number$_value; + t1 = t1 === 0 || isNaN(_0_2) || isNaN(t1); + } else + t1 = true; + if (t1) { + t1 = number.get$numeratorUnits(number); + return A.SassNumber_SassNumber$withUnits(0 / 0, number.get$denominatorUnits(number), t1); + } + if (_0_2 == 1 / 0 || _0_2 == -1 / 0) + return number; + t1 = step._number$_value; + if (t1 == 1 / 0 || t1 == -1 / 0) { + $label0$0: { + if (0 === _0_2) { + t1 = number; + break $label0$0; + } + _0_6 = "nearest" === strategy; + t1 = _0_6; + if (!t1) { + _0_8 = "to-zero" === strategy; + t1 = _0_8; + _0_1 = strategy; + _0_1_isSet = true; + _0_8_isSet = true; + } else { + _0_8 = _null; + _0_1 = strategy; + _0_1_isSet = true; + _0_8_isSet = false; + t1 = true; + } + if (t1) { + _0_9 = _0_2 > 0; + t1 = _0_9; + _0_9_isSet = true; + } else { + _0_9 = _null; + _0_9_isSet = false; + t1 = false; + } + if (t1) { + t1 = number.get$numeratorUnits(number); + t1 = A.SassNumber_SassNumber$withUnits(0, number.get$denominatorUnits(number), t1); + break $label0$0; + } + if (!_0_6) + if (_0_8_isSet) + t1 = _0_8; + else { + if (_0_1_isSet) + t1 = _0_1; + else { + t1 = strategy; + _0_1 = t1; + _0_1_isSet = true; + } + _0_8 = "to-zero" === t1; + t1 = _0_8; + } + else + t1 = true; + if (t1) { + t1 = number.get$numeratorUnits(number); + t1 = A.SassNumber_SassNumber$withUnits(-0.0, number.get$denominatorUnits(number), t1); + break $label0$0; + } + if (_0_1_isSet) + t1 = _0_1; + else { + t1 = strategy; + _0_1 = t1; + _0_1_isSet = true; + } + _0_11 = "up" === t1; + t1 = _0_11; + if (t1) + if (_0_9_isSet) + t1 = _0_9; + else { + _0_9 = _0_2 > 0; + t1 = _0_9; + } + else + t1 = false; + if (t1) { + t1 = number.get$numeratorUnits(number); + t1 = A.SassNumber_SassNumber$withUnits(1 / 0, number.get$denominatorUnits(number), t1); + break $label0$0; + } + if (_0_11) { + t1 = number.get$numeratorUnits(number); + t1 = A.SassNumber_SassNumber$withUnits(-0.0, number.get$denominatorUnits(number), t1); + break $label0$0; + } + _0_13 = "down" === (_0_1_isSet ? _0_1 : strategy); + t1 = _0_13; + if (t1) + t1 = _0_2 < 0; + else + t1 = false; + if (t1) { + t1 = number.get$numeratorUnits(number); + t1 = A.SassNumber_SassNumber$withUnits(-1 / 0, number.get$denominatorUnits(number), t1); + break $label0$0; + } + if (_0_13) { + t1 = number.get$numeratorUnits(number); + t1 = A.SassNumber_SassNumber$withUnits(0, number.get$denominatorUnits(number), t1); + break $label0$0; + } + t1 = A.throwExpression(A.UnsupportedError$("Invalid argument: " + strategy + ".")); + } + return t1; + } + stepWithNumberUnit = step.convertValueToMatch$1(number); + $label1$1: { + if ("nearest" === strategy) { + t1 = B.JSNumber_methods.round$0(_0_2 / stepWithNumberUnit); + t2 = number.get$numeratorUnits(number); + t2 = A.SassNumber_SassNumber$withUnits(t1 * stepWithNumberUnit, number.get$denominatorUnits(number), t2); + t1 = t2; + break $label1$1; + } + if ("up" === strategy) { + t2 = _0_2 / stepWithNumberUnit; + t1 = t1 < 0 ? B.JSNumber_methods.floor$0(t2) : B.JSNumber_methods.ceil$0(t2); + t2 = number.get$numeratorUnits(number); + t2 = A.SassNumber_SassNumber$withUnits(t1 * stepWithNumberUnit, number.get$denominatorUnits(number), t2); + t1 = t2; + break $label1$1; + } + if ("down" === strategy) { + t2 = _0_2 / stepWithNumberUnit; + t1 = t1 < 0 ? B.JSNumber_methods.ceil$0(t2) : B.JSNumber_methods.floor$0(t2); + t2 = number.get$numeratorUnits(number); + t2 = A.SassNumber_SassNumber$withUnits(t1 * stepWithNumberUnit, number.get$denominatorUnits(number), t2); + t1 = t2; + break $label1$1; + } + if ("to-zero" === strategy) { + t1 = _0_2 / stepWithNumberUnit; + if (_0_2 < 0) { + t1 = B.JSNumber_methods.ceil$0(t1); + t2 = number.get$numeratorUnits(number); + t2 = A.SassNumber_SassNumber$withUnits(t1 * stepWithNumberUnit, number.get$denominatorUnits(number), t2); + t1 = t2; + } else { + t1 = B.JSNumber_methods.floor$0(t1); + t2 = number.get$numeratorUnits(number); + t2 = A.SassNumber_SassNumber$withUnits(t1 * stepWithNumberUnit, number.get$denominatorUnits(number), t2); + t1 = t2; + } + break $label1$1; + } + t1 = number.get$numeratorUnits(number); + t1 = A.SassNumber_SassNumber$withUnits(0 / 0, number.get$denominatorUnits(number), t1); + break $label1$1; + } + return t1; + }, + SassCalculation__simplify(arg) { + var t1, _0_11, _0_12, _0_15, t2, _0_12_isSet, _0_16, text, _0_16_isSet, _0_15_isSet, _0_11_isSet, value, _null = null, + _s32_ = " can't be used in a calculation."; + $label0$0: { + if (arg instanceof A.SassNumber || arg instanceof A.CalculationOperation) { + t1 = arg; + break $label0$0; + } + t1 = arg instanceof A.SassString; + if (t1 && !arg._hasQuotes) { + t1 = arg; + break $label0$0; + } + if (t1) + A.throwExpression(A.SassScriptException$("Quoted string " + arg.toString$0(0) + _s32_, _null)); + t1 = arg instanceof A.SassCalculation; + if (t1) { + _0_11 = "calc" === arg.name; + if (_0_11) { + _0_12 = arg.$arguments; + _0_15 = _0_12.length === 1; + t2 = _0_15; + if (t2) { + t2 = _0_12; + _0_12_isSet = true; + _0_16 = t2[0]; + t2 = _0_16; + if (t2 instanceof A.SassString) { + type$.SassString._as(_0_16); + if (!_0_16._hasQuotes) { + text = _0_16._string$_text; + t2 = A.SassCalculation__needsParentheses(text); + } else { + text = _null; + t2 = false; + } + } else { + text = _null; + t2 = false; + } + _0_16_isSet = true; + } else { + text = _null; + _0_16 = text; + _0_12_isSet = true; + _0_16_isSet = false; + t2 = false; + } + _0_15_isSet = true; + } else { + text = _null; + _0_16 = text; + _0_12 = _0_16; + _0_15 = _0_12; + _0_15_isSet = false; + _0_12_isSet = false; + _0_16_isSet = false; + t2 = false; + } + _0_11_isSet = true; + } else { + text = _null; + _0_16 = text; + _0_12 = _0_16; + _0_15 = _0_12; + _0_11 = _0_15; + _0_11_isSet = false; + _0_15_isSet = false; + _0_12_isSet = false; + _0_16_isSet = false; + t2 = false; + } + if (t2) { + t1 = new A.SassString("(" + A.S(text) + ")", false); + break $label0$0; + } + if (t1) + if (_0_11_isSet ? _0_11 : "calc" === arg.name) + if (_0_15_isSet) + t2 = _0_15; + else { + if (_0_12_isSet) + t2 = _0_12; + else { + _0_12 = arg.$arguments; + t2 = _0_12; + _0_12_isSet = true; + } + _0_15 = t2.length === 1; + t2 = _0_15; + } + else + t2 = false; + else + t2 = false; + if (t2) { + if (_0_16_isSet) + value = _0_16; + else { + _0_16 = (_0_12_isSet ? _0_12 : arg.$arguments)[0]; + value = _0_16; + } + t1 = value; + break $label0$0; + } + if (t1) { + t1 = arg; + break $label0$0; + } + if (arg instanceof A.Value) + A.throwExpression(A.SassScriptException$("Value " + arg.toString$0(0) + _s32_, _null)); + t1 = A.throwExpression(A.ArgumentError$("Unexpected calculation argument " + A.S(arg) + ".", _null)); + } + return t1; + }, + SassCalculation__needsParentheses(text) { + var t1, couldBeVar, second, third, fourth, i, t2, + first = text.charCodeAt(0); + if (first === 32 || first === 9 || first === 10 || first === 13 || first === 12 || first === 47 || first === 42) + return true; + t1 = text.length; + couldBeVar = t1 >= 4 && A.characterEqualsIgnoreCase(first, 118); + if (t1 < 2) + return false; + second = text.charCodeAt(1); + if (second === 32 || second === 9 || second === 10 || second === 13 || second === 12 || second === 47 || second === 42) + return true; + couldBeVar = couldBeVar && A.characterEqualsIgnoreCase(second, 97); + if (t1 < 3) + return false; + third = text.charCodeAt(2); + if (third === 32 || third === 9 || third === 10 || third === 13 || third === 12 || third === 47 || third === 42) + return true; + couldBeVar = couldBeVar && A.characterEqualsIgnoreCase(third, 114); + if (t1 < 4) + return false; + fourth = text.charCodeAt(3); + if (couldBeVar && fourth === 40) + return true; + if (fourth === 32 || fourth === 9 || fourth === 10 || fourth === 13 || fourth === 12 || fourth === 47 || fourth === 42) + return true; + for (i = 4; i < t1; ++i) { + t2 = text.charCodeAt(i); + if (t2 === 32 || t2 === 9 || t2 === 10 || t2 === 13 || t2 === 12 || t2 === 47 || t2 === 42) + return true; + } + return false; + }, + SassCalculation__verifyCompatibleNumbers(args) { + var t1, _i, t2, arg, i, number1, j, number2; + for (t1 = args.length, _i = 0; t2 = args.length, _i < t2; args.length === t1 || (0, A.throwConcurrentModificationError)(args), ++_i) { + arg = args[_i]; + if (arg instanceof A.SassNumber && arg.get$hasComplexUnits()) + throw A.wrapException(A.SassScriptException$("Number " + A.S(arg) + " isn't compatible with CSS calculations.", null)); + } + for (t1 = t2, i = 0; i < t1 - 1; ++i) { + number1 = args[i]; + if (!(number1 instanceof A.SassNumber)) + continue; + for (j = i + 1; t1 = args.length, j < t1; ++j) { + number2 = args[j]; + if (!(number2 instanceof A.SassNumber)) + continue; + if (number1.hasPossiblyCompatibleUnits$1(number2)) + continue; + throw A.wrapException(A.SassScriptException$(number1.toString$0(0) + " and " + number2.toString$0(0) + " are incompatible.", null)); + } + } + }, + SassCalculation__verifyLength(args, expectedLength) { + var t1; + if (args.length === expectedLength) + return; + if (B.JSArray_methods.any$1(args, new A.SassCalculation__verifyLength_closure())) + return; + t1 = args.length; + throw A.wrapException(A.SassScriptException$("" + expectedLength + " arguments required, but only " + t1 + " " + A.pluralize("was", t1, "were") + " passed.", null)); + }, + SassCalculation__singleArgument($name, argument, mathFunc, forbidUnits) { + argument = A.SassCalculation__simplify(argument); + if (!(argument instanceof A.SassNumber)) + return new A.SassCalculation($name, A._setArrayType([argument], type$.JSArray_Object)); + if (forbidUnits) + argument.assertNoUnits$0(); + return mathFunc.call$1(argument); + }, + SassCalculation: function SassCalculation(t0, t1) { + this.name = t0; + this.$arguments = t1; + }, + SassCalculation__verifyLength_closure: function SassCalculation__verifyLength_closure() { + }, + CalculationOperation: function CalculationOperation(t0, t1, t2) { + this._operator = t0; + this._left = t1; + this._right = t2; + }, + CalculationOperator: function CalculationOperator(t0, t1, t2, t3) { + var _ = this; + _.name = t0; + _.operator = t1; + _.precedence = t2; + _._name = t3; + }, + SassColor$rgb(red, green, blue, alpha) { + var _null = null, + t1 = new A.SassColor(red, green, blue, _null, _null, _null, A.fuzzyAssertRange(A.SassColor__handleNullAlpha(alpha), 0, 1, "alpha"), _null); + A.RangeError_checkValueInInterval(t1.get$red(0), 0, 255, "red"); + A.RangeError_checkValueInInterval(t1.get$green(0), 0, 255, "green"); + A.RangeError_checkValueInInterval(t1.get$blue(0), 0, 255, "blue"); + return t1; + }, + SassColor$rgbInternal(_red, _green, _blue, alpha, format) { + var t1 = new A.SassColor(_red, _green, _blue, null, null, null, A.fuzzyAssertRange(alpha, 0, 1, "alpha"), format); + A.RangeError_checkValueInInterval(t1.get$red(0), 0, 255, "red"); + A.RangeError_checkValueInInterval(t1.get$green(0), 0, 255, "green"); + A.RangeError_checkValueInInterval(t1.get$blue(0), 0, 255, "blue"); + return t1; + }, + SassColor$hslInternal(hue, saturation, lightness, alpha, format) { + return new A.SassColor(null, null, null, B.JSNumber_methods.$mod(hue, 360), A.fuzzyAssertRange(saturation, 0, 100, "saturation"), A.fuzzyAssertRange(lightness, 0, 100, "lightness"), A.fuzzyAssertRange(alpha, 0, 1, "alpha"), format); + }, + SassColor_SassColor$hwb(hue, whiteness, blackness, alpha) { + var t2, t1 = {}, + scaledHue = B.JSNumber_methods.$mod(hue, 360) / 360, + scaledWhiteness = t1.scaledWhiteness = A.fuzzyAssertRange(whiteness, 0, 100, "whiteness") / 100, + scaledBlackness = A.fuzzyAssertRange(blackness, 0, 100, "blackness") / 100, + sum = scaledWhiteness + scaledBlackness; + if (sum > 1) { + t2 = t1.scaledWhiteness = scaledWhiteness / sum; + scaledBlackness /= sum; + } else + t2 = scaledWhiteness; + t2 = new A.SassColor_SassColor$hwb_toRgb(t1, 1 - t2 - scaledBlackness); + return A.SassColor$rgb(t2.call$1(scaledHue + 0.3333333333333333), t2.call$1(scaledHue), t2.call$1(scaledHue - 0.3333333333333333), alpha); + }, + SassColor__handleNullAlpha(alpha) { + return alpha; + }, + SassColor__hueToRgb(m1, m2, hue) { + var t1; + if (hue < 0) + ++hue; + if (hue > 1) + --hue; + $label0$0: { + if (hue < 0.16666666666666666) { + t1 = m1 + (m2 - m1) * hue * 6; + break $label0$0; + } + if (hue < 0.5) { + t1 = m2; + break $label0$0; + } + if (hue < 0.6666666666666666) { + t1 = m1 + (m2 - m1) * (0.6666666666666666 - hue) * 6; + break $label0$0; + } + t1 = m1; + break $label0$0; + } + return t1; + }, + SassColor: function SassColor(t0, t1, t2, t3, t4, t5, t6, t7) { + var _ = this; + _._red = t0; + _._green = t1; + _._blue = t2; + _._hue = t3; + _._saturation = t4; + _._lightness = t5; + _._alpha = t6; + _.format = t7; + }, + SassColor_SassColor$hwb_toRgb: function SassColor_SassColor$hwb_toRgb(t0, t1) { + this._box_0 = t0; + this.factor = t1; + }, + _ColorFormatEnum: function _ColorFormatEnum(t0) { + this._color$_name = t0; + }, + SpanColorFormat: function SpanColorFormat(t0) { + this._color$_span = t0; + }, + SassFunction: function SassFunction(t0) { + this.callable = t0; + }, + SassList$(contents, _separator, brackets) { + var t1 = new A.SassList(A.List_List$unmodifiable(contents, type$.Value), _separator, brackets); + t1.SassList$3$brackets(contents, _separator, brackets); + return t1; + }, + SassList: function SassList(t0, t1, t2) { + this._list$_contents = t0; + this._separator = t1; + this._hasBrackets = t2; + }, + SassList_isBlank_closure: function SassList_isBlank_closure() { + }, + ListSeparator: function ListSeparator(t0, t1, t2) { + this._list$_name = t0; + this.separator = t1; + this._name = t2; + }, + SassMap: function SassMap(t0) { + this._map$_contents = t0; + }, + SassMixin: function SassMixin(t0) { + this.callable = t0; + }, + _SassNull: function _SassNull() { + }, + conversionFactor(unit1, unit2) { + var _0_0; + if (unit1 === unit2) + return 1; + _0_0 = B.Map_nfuzN.$index(0, unit1); + if (_0_0 != null) + return _0_0.$index(0, unit2); + return null; + }, + SassNumber_SassNumber(value, unit) { + return unit == null ? new A.UnitlessSassNumber(value, null) : new A.SingleUnitSassNumber(unit, value, null); + }, + SassNumber_SassNumber$withUnits(value, denominatorUnits, numeratorUnits) { + var _0_4, t1, _0_1, _0_1_isSet, _0_6, _0_6_isSet, _0_4_isSet, _0_8, _0_10, _0_7, _0_7_isSet, _0_10_isSet, _0_8_isSet, t2, unit, numerators, denominators, unsimplifiedDenominators, valueDouble, _i, denominator, simplifiedAway, i, factor, _1_2, _1_7, _1_7_isSet, _null = null; + if (!false) { + _0_4 = (numeratorUnits === null ? type$.List_String._as(numeratorUnits) : numeratorUnits).length; + t1 = _0_4; + _0_1 = numeratorUnits; + _0_1_isSet = true; + _0_6 = t1 <= 0; + t1 = _0_6; + _0_6_isSet = true; + _0_4_isSet = true; + } else { + _0_4 = _null; + _0_6 = _0_4; + _0_1 = numeratorUnits; + _0_1_isSet = true; + _0_6_isSet = false; + _0_4_isSet = false; + t1 = true; + } + if (t1) { + _0_8 = denominatorUnits == null; + t1 = _0_8; + if (!t1) { + _0_10 = (denominatorUnits == null ? type$.List_String._as(denominatorUnits) : denominatorUnits).length <= 0; + t1 = _0_10; + _0_7 = denominatorUnits; + _0_7_isSet = true; + _0_10_isSet = true; + } else { + _0_10 = _null; + _0_7 = denominatorUnits; + _0_7_isSet = true; + _0_10_isSet = false; + t1 = true; + } + _0_8_isSet = true; + } else { + _0_10 = _null; + _0_7 = _0_10; + _0_8 = _0_7; + _0_8_isSet = false; + _0_7_isSet = false; + _0_10_isSet = false; + t1 = false; + } + if (t1) + return new A.UnitlessSassNumber(value, _null); + if (_0_1_isSet) + t1 = _0_1; + else { + t1 = numeratorUnits; + _0_1 = t1; + _0_1_isSet = true; + } + t2 = type$.List_String; + if (t2._is(t1)) { + if (_0_4_isSet) + t1 = _0_4; + else { + if (_0_1_isSet) + t1 = _0_1; + else { + t1 = numeratorUnits; + _0_1 = t1; + _0_1_isSet = true; + } + _0_4 = (t1 == null ? t2._as(t1) : t1).length; + t1 = _0_4; + _0_4_isSet = true; + } + if (t1 === 1) { + if (_0_1_isSet) + t1 = _0_1; + else { + t1 = numeratorUnits; + _0_1 = t1; + _0_1_isSet = true; + } + unit = (t1 == null ? t2._as(t1) : t1)[0]; + if (_0_8_isSet) + t1 = _0_8; + else { + if (_0_7_isSet) + t1 = _0_7; + else { + t1 = denominatorUnits; + _0_7 = t1; + _0_7_isSet = true; + } + _0_8 = t1 == null; + t1 = _0_8; + _0_8_isSet = true; + } + if (!t1) + if (_0_10_isSet) + t1 = _0_10; + else { + if (_0_7_isSet) + t1 = _0_7; + else { + t1 = denominatorUnits; + _0_7 = t1; + _0_7_isSet = true; + } + _0_10 = (t1 == null ? t2._as(t1) : t1).length <= 0; + t1 = _0_10; + _0_10_isSet = true; + } + else + t1 = true; + } else { + unit = _null; + t1 = false; + } + } else { + unit = _null; + t1 = false; + } + if (t1) + return new A.SingleUnitSassNumber(unit, value, _null); + if (_0_1_isSet) + t1 = _0_1; + else { + t1 = numeratorUnits; + _0_1 = t1; + _0_1_isSet = true; + } + if (t1 != null) { + if (_0_1_isSet) + numerators = _0_1; + else { + numerators = numeratorUnits; + _0_1 = numerators; + _0_1_isSet = true; + } + if (numerators == null) + numerators = t2._as(numerators); + if (_0_8_isSet) + t1 = _0_8; + else { + if (_0_7_isSet) + t1 = _0_7; + else { + t1 = denominatorUnits; + _0_7 = t1; + _0_7_isSet = true; + } + _0_8 = t1 == null; + t1 = _0_8; + } + if (!t1) + if (_0_10_isSet) + t1 = _0_10; + else { + if (_0_7_isSet) + t1 = _0_7; + else { + t1 = denominatorUnits; + _0_7 = t1; + _0_7_isSet = true; + } + _0_10 = (t1 == null ? t2._as(t1) : t1).length <= 0; + t1 = _0_10; + } + else + t1 = true; + } else { + numerators = _null; + t1 = false; + } + if (t1) + return new A.ComplexSassNumber(A.List_List$unmodifiable(numerators, type$.String), B.List_empty, value, _null); + if (!false) + if (_0_6_isSet) + t1 = _0_6; + else { + if (_0_4_isSet) + t1 = _0_4; + else { + t1 = _0_1_isSet ? _0_1 : numeratorUnits; + _0_4 = (t1 == null ? t2._as(t1) : t1).length; + t1 = _0_4; + } + _0_6 = t1 <= 0; + t1 = _0_6; + } + else + t1 = true; + if (t1) { + if (_0_7_isSet) + t1 = _0_7; + else { + t1 = denominatorUnits; + _0_7 = t1; + _0_7_isSet = true; + } + if (t1 != null) { + denominators = _0_7_isSet ? _0_7 : denominatorUnits; + if (denominators == null) + denominators = t2._as(denominators); + t1 = true; + } else { + denominators = _null; + t1 = false; + } + } else { + denominators = _null; + t1 = false; + } + if (t1) + return new A.ComplexSassNumber(B.List_empty, A.List_List$unmodifiable(denominators, type$.String), value, _null); + numerators = A._setArrayType(numeratorUnits.slice(0), A._arrayInstanceType(numeratorUnits)); + unsimplifiedDenominators = A._setArrayType(denominatorUnits.slice(0), A.instanceType(denominatorUnits)); + denominators = A._setArrayType([], type$.JSArray_String); + for (t1 = unsimplifiedDenominators.length, valueDouble = value, _i = 0; _i < unsimplifiedDenominators.length; unsimplifiedDenominators.length === t1 || (0, A.throwConcurrentModificationError)(unsimplifiedDenominators), ++_i) { + denominator = unsimplifiedDenominators[_i]; + i = 0; + while (true) { + if (!(i < numerators.length)) { + simplifiedAway = false; + break; + } + c$0: { + factor = A.conversionFactor(denominator, numerators[i]); + if (factor == null) + break c$0; + valueDouble *= factor; + B.JSArray_methods.removeAt$1(numerators, i); + simplifiedAway = true; + break; + } + ++i; + } + if (!simplifiedAway) + denominators.push(denominator); + } + $label0$1: { + _1_2 = numerators.length; + t1 = _1_2; + if (t1 <= 0) { + _1_7 = denominators.length <= 0; + t1 = _1_7; + _1_7_isSet = true; + } else { + _1_7 = _null; + _1_7_isSet = false; + t1 = false; + } + if (t1) { + t1 = new A.UnitlessSassNumber(valueDouble, _null); + break $label0$1; + } + if (_1_2 === 1) { + unit = numerators[0]; + t1 = _1_7_isSet ? _1_7 : denominators.length <= 0; + } else { + unit = _null; + t1 = false; + } + if (t1) { + t1 = new A.SingleUnitSassNumber(unit, valueDouble, _null); + break $label0$1; + } + t1 = type$.String; + t1 = new A.ComplexSassNumber(A.List_List$unmodifiable(numerators, t1), A.List_List$unmodifiable(denominators, t1), valueDouble, _null); + break $label0$1; + } + return t1; + }, + SassNumber: function SassNumber() { + }, + SassNumber__coerceOrConvertValue_compatibilityException: function SassNumber__coerceOrConvertValue_compatibilityException(t0, t1, t2, t3, t4, t5, t6) { + var _ = this; + _.$this = t0; + _.other = t1; + _.otherName = t2; + _.otherHasUnits = t3; + _.name = t4; + _.newNumerators = t5; + _.newDenominators = t6; + }, + SassNumber__coerceOrConvertValue_closure: function SassNumber__coerceOrConvertValue_closure(t0, t1) { + this._box_0 = t0; + this.newNumerator = t1; + }, + SassNumber__coerceOrConvertValue_closure0: function SassNumber__coerceOrConvertValue_closure0(t0) { + this.compatibilityException = t0; + }, + SassNumber__coerceOrConvertValue_closure1: function SassNumber__coerceOrConvertValue_closure1(t0, t1) { + this._box_0 = t0; + this.newDenominator = t1; + }, + SassNumber__coerceOrConvertValue_closure2: function SassNumber__coerceOrConvertValue_closure2(t0) { + this.compatibilityException = t0; + }, + SassNumber_plus_closure: function SassNumber_plus_closure() { + }, + SassNumber_minus_closure: function SassNumber_minus_closure() { + }, + SassNumber_multiplyUnits_closure: function SassNumber_multiplyUnits_closure(t0, t1) { + this._box_0 = t0; + this.numerator = t1; + }, + SassNumber_multiplyUnits_closure0: function SassNumber_multiplyUnits_closure0(t0, t1) { + this.newNumerators = t0; + this.numerator = t1; + }, + SassNumber_multiplyUnits_closure1: function SassNumber_multiplyUnits_closure1(t0, t1) { + this._box_0 = t0; + this.numerator = t1; + }, + SassNumber_multiplyUnits_closure2: function SassNumber_multiplyUnits_closure2(t0, t1) { + this.newNumerators = t0; + this.numerator = t1; + }, + SassNumber__areAnyConvertible_closure: function SassNumber__areAnyConvertible_closure(t0) { + this.units2 = t0; + }, + SassNumber__canonicalizeUnitList_closure: function SassNumber__canonicalizeUnitList_closure() { + }, + SassNumber__canonicalMultiplier_closure: function SassNumber__canonicalMultiplier_closure(t0) { + this.$this = t0; + }, + SassNumber_unitSuggestion_closure: function SassNumber_unitSuggestion_closure() { + }, + SassNumber_unitSuggestion_closure0: function SassNumber_unitSuggestion_closure0() { + }, + ComplexSassNumber: function ComplexSassNumber(t0, t1, t2, t3) { + var _ = this; + _._numeratorUnits = t0; + _._denominatorUnits = t1; + _._number$_value = t2; + _.hashCache = null; + _.asSlash = t3; + }, + SingleUnitSassNumber: function SingleUnitSassNumber(t0, t1, t2) { + var _ = this; + _._unit = t0; + _._number$_value = t1; + _.hashCache = null; + _.asSlash = t2; + }, + SingleUnitSassNumber__coerceToUnit_closure: function SingleUnitSassNumber__coerceToUnit_closure(t0, t1) { + this.$this = t0; + this.unit = t1; + }, + SingleUnitSassNumber__coerceValueToUnit_closure: function SingleUnitSassNumber__coerceValueToUnit_closure(t0) { + this.$this = t0; + }, + SingleUnitSassNumber_multiplyUnits_closure: function SingleUnitSassNumber_multiplyUnits_closure(t0, t1) { + this._box_0 = t0; + this.$this = t1; + }, + SingleUnitSassNumber_multiplyUnits_closure0: function SingleUnitSassNumber_multiplyUnits_closure0(t0, t1) { + this._box_0 = t0; + this.$this = t1; + }, + UnitlessSassNumber: function UnitlessSassNumber(t0, t1) { + this._number$_value = t0; + this.hashCache = null; + this.asSlash = t1; + }, + SassString$(_text, quotes) { + return new A.SassString(_text, quotes); + }, + SassString: function SassString(t0, t1) { + var _ = this; + _._string$_text = t0; + _._hasQuotes = t1; + _.__SassString__sassLength_FI = $; + _._hashCache = null; + }, + AnySelectorVisitor: function AnySelectorVisitor() { + }, + AnySelectorVisitor_visitComplexSelector_closure: function AnySelectorVisitor_visitComplexSelector_closure(t0) { + this.$this = t0; + }, + AnySelectorVisitor_visitCompoundSelector_closure: function AnySelectorVisitor_visitCompoundSelector_closure(t0) { + this.$this = t0; + }, + _EvaluateVisitor$0(functions, importCache, logger, nodeImporter, quietDeps, sourceMap) { + var t1 = type$.Uri, + t2 = type$.Module_AsyncCallable, + t3 = A._setArrayType([], type$.JSArray_Record_2_String_and_AstNode); + t1 = new A._EvaluateVisitor0(importCache, nodeImporter, A.LinkedHashMap_LinkedHashMap$_empty(type$.String, type$.AsyncCallable), A.LinkedHashMap_LinkedHashMap$_empty(t1, t2), A.LinkedHashMap_LinkedHashMap$_empty(t1, t2), A.LinkedHashMap_LinkedHashMap$_empty(t1, type$.Configuration), A.LinkedHashMap_LinkedHashMap$_empty(t1, type$.AstNode), logger, A.LinkedHashSet_LinkedHashSet$_empty(type$.Record_2_String_and_SourceSpan), quietDeps, sourceMap, A.AsyncEnvironment$(), A.LinkedHashSet_LinkedHashSet$_empty(t1), A.LinkedHashMap_LinkedHashMap$_empty(t1, type$.nullable_AstNode), t3, B.Configuration_Map_empty_null); + t1._EvaluateVisitor$6$functions$importCache$logger$nodeImporter$quietDeps$sourceMap0(functions, importCache, logger, nodeImporter, quietDeps, sourceMap); + return t1; + }, + _EvaluateVisitor0: function _EvaluateVisitor0(t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15) { + var _ = this; + _._async_evaluate$_importCache = t0; + _._async_evaluate$_nodeImporter = t1; + _._async_evaluate$_builtInFunctions = t2; + _._async_evaluate$_builtInModules = t3; + _._async_evaluate$_modules = t4; + _._async_evaluate$_moduleConfigurations = t5; + _._async_evaluate$_moduleNodes = t6; + _._async_evaluate$_logger = t7; + _._async_evaluate$_warningsEmitted = t8; + _._async_evaluate$_quietDeps = t9; + _._async_evaluate$_sourceMap = t10; + _._async_evaluate$_environment = t11; + _._async_evaluate$_declarationName = _._async_evaluate$__parent = _._async_evaluate$_mediaQuerySources = _._async_evaluate$_mediaQueries = _._async_evaluate$_styleRuleIgnoringAtRoot = null; + _._async_evaluate$_member = "root stylesheet"; + _._async_evaluate$_importSpan = _._async_evaluate$_callableNode = _._async_evaluate$_currentCallable = null; + _._async_evaluate$_inSupportsDeclaration = _._async_evaluate$_inKeyframes = _._async_evaluate$_atRootExcludingStyleRule = _._async_evaluate$_inUnknownAtRule = _._async_evaluate$_inFunction = false; + _._async_evaluate$_loadedUrls = t12; + _._async_evaluate$_activeModules = t13; + _._async_evaluate$_stack = t14; + _._async_evaluate$_importer = null; + _._async_evaluate$_inDependency = false; + _._async_evaluate$__extensionStore = _._async_evaluate$_preModuleComments = _._async_evaluate$_outOfOrderImports = _._async_evaluate$__endOfImports = _._async_evaluate$__root = _._async_evaluate$__stylesheet = null; + _._async_evaluate$_configuration = t15; + }, + _EvaluateVisitor_closure12: function _EvaluateVisitor_closure12(t0) { + this.$this = t0; + }, + _EvaluateVisitor_closure13: function _EvaluateVisitor_closure13(t0) { + this.$this = t0; + }, + _EvaluateVisitor_closure14: function _EvaluateVisitor_closure14(t0) { + this.$this = t0; + }, + _EvaluateVisitor_closure15: function _EvaluateVisitor_closure15(t0) { + this.$this = t0; + }, + _EvaluateVisitor_closure16: function _EvaluateVisitor_closure16(t0) { + this.$this = t0; + }, + _EvaluateVisitor_closure17: function _EvaluateVisitor_closure17(t0) { + this.$this = t0; + }, + _EvaluateVisitor_closure18: function _EvaluateVisitor_closure18(t0) { + this.$this = t0; + }, + _EvaluateVisitor_closure19: function _EvaluateVisitor_closure19(t0) { + this.$this = t0; + }, + _EvaluateVisitor_closure20: function _EvaluateVisitor_closure20(t0) { + this.$this = t0; + }, + _EvaluateVisitor__closure6: function _EvaluateVisitor__closure6(t0, t1, t2) { + this.$this = t0; + this.name = t1; + this.module = t2; + }, + _EvaluateVisitor_closure21: function _EvaluateVisitor_closure21(t0) { + this.$this = t0; + }, + _EvaluateVisitor__closure5: function _EvaluateVisitor__closure5(t0, t1, t2) { + this.$this = t0; + this.name = t1; + this.module = t2; + }, + _EvaluateVisitor_closure22: function _EvaluateVisitor_closure22(t0) { + this.$this = t0; + }, + _EvaluateVisitor_closure23: function _EvaluateVisitor_closure23(t0) { + this.$this = t0; + }, + _EvaluateVisitor__closure3: function _EvaluateVisitor__closure3(t0, t1, t2) { + this.values = t0; + this.span = t1; + this.callableNode = t2; + }, + _EvaluateVisitor__closure4: function _EvaluateVisitor__closure4(t0) { + this.$this = t0; + }, + _EvaluateVisitor_closure24: function _EvaluateVisitor_closure24(t0) { + this.$this = t0; + }, + _EvaluateVisitor_run_closure0: function _EvaluateVisitor_run_closure0(t0, t1, t2) { + this.$this = t0; + this.node = t1; + this.importer = t2; + }, + _EvaluateVisitor_run__closure0: function _EvaluateVisitor_run__closure0(t0, t1, t2) { + this.$this = t0; + this.importer = t1; + this.node = t2; + }, + _EvaluateVisitor__loadModule_closure1: function _EvaluateVisitor__loadModule_closure1(t0, t1) { + this._box_1 = t0; + this.callback = t1; + }, + _EvaluateVisitor__loadModule_closure2: function _EvaluateVisitor__loadModule_closure2(t0, t1, t2, t3, t4, t5, t6) { + var _ = this; + _.$this = t0; + _.url = t1; + _.nodeWithSpan = t2; + _.baseUrl = t3; + _.namesInErrors = t4; + _.configuration = t5; + _.callback = t6; + }, + _EvaluateVisitor__loadModule__closure1: function _EvaluateVisitor__loadModule__closure1(t0, t1) { + this.$this = t0; + this.message = t1; + }, + _EvaluateVisitor__loadModule__closure2: function _EvaluateVisitor__loadModule__closure2(t0, t1, t2) { + this._box_0 = t0; + this.callback = t1; + this.firstLoad = t2; + }, + _EvaluateVisitor__execute_closure0: function _EvaluateVisitor__execute_closure0(t0, t1, t2, t3, t4, t5, t6) { + var _ = this; + _.$this = t0; + _.importer = t1; + _.stylesheet = t2; + _.extensionStore = t3; + _.configuration = t4; + _.css = t5; + _.preModuleComments = t6; + }, + _EvaluateVisitor__combineCss_closure1: function _EvaluateVisitor__combineCss_closure1() { + }, + _EvaluateVisitor__combineCss_closure2: function _EvaluateVisitor__combineCss_closure2(t0) { + this.selectors = t0; + }, + _EvaluateVisitor__combineCss_visitModule0: function _EvaluateVisitor__combineCss_visitModule0(t0, t1, t2, t3, t4, t5) { + var _ = this; + _.$this = t0; + _.seen = t1; + _.clone = t2; + _.css = t3; + _.imports = t4; + _.sorted = t5; + }, + _EvaluateVisitor__extendModules_closure1: function _EvaluateVisitor__extendModules_closure1(t0) { + this.originalSelectors = t0; + }, + _EvaluateVisitor__extendModules_closure2: function _EvaluateVisitor__extendModules_closure2() { + }, + _EvaluateVisitor_visitAtRootRule_closure1: function _EvaluateVisitor_visitAtRootRule_closure1(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitAtRootRule_closure2: function _EvaluateVisitor_visitAtRootRule_closure2(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor__scopeForAtRoot_closure5: function _EvaluateVisitor__scopeForAtRoot_closure5(t0, t1, t2) { + this.$this = t0; + this.newParent = t1; + this.node = t2; + }, + _EvaluateVisitor__scopeForAtRoot_closure6: function _EvaluateVisitor__scopeForAtRoot_closure6(t0, t1) { + this.$this = t0; + this.innerScope = t1; + }, + _EvaluateVisitor__scopeForAtRoot_closure7: function _EvaluateVisitor__scopeForAtRoot_closure7(t0, t1) { + this.$this = t0; + this.innerScope = t1; + }, + _EvaluateVisitor__scopeForAtRoot__closure0: function _EvaluateVisitor__scopeForAtRoot__closure0(t0, t1) { + this.innerScope = t0; + this.callback = t1; + }, + _EvaluateVisitor__scopeForAtRoot_closure8: function _EvaluateVisitor__scopeForAtRoot_closure8(t0, t1) { + this.$this = t0; + this.innerScope = t1; + }, + _EvaluateVisitor__scopeForAtRoot_closure9: function _EvaluateVisitor__scopeForAtRoot_closure9() { + }, + _EvaluateVisitor__scopeForAtRoot_closure10: function _EvaluateVisitor__scopeForAtRoot_closure10(t0, t1) { + this.$this = t0; + this.innerScope = t1; + }, + _EvaluateVisitor_visitContentRule_closure0: function _EvaluateVisitor_visitContentRule_closure0(t0, t1) { + this.$this = t0; + this.content = t1; + }, + _EvaluateVisitor_visitDeclaration_closure0: function _EvaluateVisitor_visitDeclaration_closure0(t0, t1) { + this._box_0 = t0; + this.$this = t1; + }, + _EvaluateVisitor_visitEachRule_closure2: function _EvaluateVisitor_visitEachRule_closure2(t0, t1, t2) { + this._box_0 = t0; + this.$this = t1; + this.nodeWithSpan = t2; + }, + _EvaluateVisitor_visitEachRule_closure3: function _EvaluateVisitor_visitEachRule_closure3(t0, t1, t2) { + this._box_0 = t0; + this.$this = t1; + this.nodeWithSpan = t2; + }, + _EvaluateVisitor_visitEachRule_closure4: function _EvaluateVisitor_visitEachRule_closure4(t0, t1, t2, t3) { + var _ = this; + _.$this = t0; + _.list = t1; + _.setVariables = t2; + _.node = t3; + }, + _EvaluateVisitor_visitEachRule__closure0: function _EvaluateVisitor_visitEachRule__closure0(t0, t1, t2) { + this.$this = t0; + this.setVariables = t1; + this.node = t2; + }, + _EvaluateVisitor_visitEachRule___closure0: function _EvaluateVisitor_visitEachRule___closure0(t0) { + this.$this = t0; + }, + _EvaluateVisitor_visitAtRule_closure2: function _EvaluateVisitor_visitAtRule_closure2(t0) { + this.$this = t0; + }, + _EvaluateVisitor_visitAtRule_closure3: function _EvaluateVisitor_visitAtRule_closure3(t0, t1, t2) { + this.$this = t0; + this.name = t1; + this.children = t2; + }, + _EvaluateVisitor_visitAtRule__closure0: function _EvaluateVisitor_visitAtRule__closure0(t0, t1) { + this.$this = t0; + this.children = t1; + }, + _EvaluateVisitor_visitAtRule_closure4: function _EvaluateVisitor_visitAtRule_closure4() { + }, + _EvaluateVisitor_visitForRule_closure4: function _EvaluateVisitor_visitForRule_closure4(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitForRule_closure5: function _EvaluateVisitor_visitForRule_closure5(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitForRule_closure6: function _EvaluateVisitor_visitForRule_closure6(t0) { + this.fromNumber = t0; + }, + _EvaluateVisitor_visitForRule_closure7: function _EvaluateVisitor_visitForRule_closure7(t0, t1) { + this.toNumber = t0; + this.fromNumber = t1; + }, + _EvaluateVisitor_visitForRule_closure8: function _EvaluateVisitor_visitForRule_closure8(t0, t1, t2, t3, t4, t5) { + var _ = this; + _._box_0 = t0; + _.$this = t1; + _.node = t2; + _.from = t3; + _.direction = t4; + _.fromNumber = t5; + }, + _EvaluateVisitor_visitForRule__closure0: function _EvaluateVisitor_visitForRule__closure0(t0) { + this.$this = t0; + }, + _EvaluateVisitor_visitForwardRule_closure1: function _EvaluateVisitor_visitForwardRule_closure1(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitForwardRule_closure2: function _EvaluateVisitor_visitForwardRule_closure2(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor__registerCommentsForModule_closure0: function _EvaluateVisitor__registerCommentsForModule_closure0() { + }, + _EvaluateVisitor_visitIfRule_closure0: function _EvaluateVisitor_visitIfRule_closure0(t0) { + this.$this = t0; + }, + _EvaluateVisitor_visitIfRule__closure0: function _EvaluateVisitor_visitIfRule__closure0(t0, t1) { + this.$this = t0; + this.clause = t1; + }, + _EvaluateVisitor_visitIfRule___closure0: function _EvaluateVisitor_visitIfRule___closure0(t0) { + this.$this = t0; + }, + _EvaluateVisitor__visitDynamicImport_closure0: function _EvaluateVisitor__visitDynamicImport_closure0(t0, t1) { + this.$this = t0; + this.$import = t1; + }, + _EvaluateVisitor__visitDynamicImport__closure3: function _EvaluateVisitor__visitDynamicImport__closure3(t0) { + this.$this = t0; + }, + _EvaluateVisitor__visitDynamicImport__closure4: function _EvaluateVisitor__visitDynamicImport__closure4() { + }, + _EvaluateVisitor__visitDynamicImport__closure5: function _EvaluateVisitor__visitDynamicImport__closure5() { + }, + _EvaluateVisitor__visitDynamicImport__closure6: function _EvaluateVisitor__visitDynamicImport__closure6(t0, t1, t2, t3, t4) { + var _ = this; + _._box_0 = t0; + _.$this = t1; + _.loadsUserDefinedModules = t2; + _.environment = t3; + _.children = t4; + }, + _EvaluateVisitor__applyMixin_closure1: function _EvaluateVisitor__applyMixin_closure1(t0, t1, t2, t3) { + var _ = this; + _.$this = t0; + _.$arguments = t1; + _.mixin = t2; + _.nodeWithSpanWithoutContent = t3; + }, + _EvaluateVisitor__applyMixin__closure2: function _EvaluateVisitor__applyMixin__closure2(t0, t1, t2, t3) { + var _ = this; + _.$this = t0; + _.$arguments = t1; + _.mixin = t2; + _.nodeWithSpanWithoutContent = t3; + }, + _EvaluateVisitor__applyMixin_closure2: function _EvaluateVisitor__applyMixin_closure2(t0, t1, t2, t3) { + var _ = this; + _.$this = t0; + _.contentCallable = t1; + _.mixin = t2; + _.nodeWithSpanWithoutContent = t3; + }, + _EvaluateVisitor__applyMixin__closure1: function _EvaluateVisitor__applyMixin__closure1(t0, t1, t2) { + this.$this = t0; + this.mixin = t1; + this.nodeWithSpanWithoutContent = t2; + }, + _EvaluateVisitor__applyMixin___closure0: function _EvaluateVisitor__applyMixin___closure0(t0, t1, t2) { + this.$this = t0; + this.mixin = t1; + this.nodeWithSpanWithoutContent = t2; + }, + _EvaluateVisitor__applyMixin____closure0: function _EvaluateVisitor__applyMixin____closure0(t0, t1) { + this.$this = t0; + this.statement = t1; + }, + _EvaluateVisitor_visitIncludeRule_closure2: function _EvaluateVisitor_visitIncludeRule_closure2(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitIncludeRule_closure3: function _EvaluateVisitor_visitIncludeRule_closure3(t0) { + this.$this = t0; + }, + _EvaluateVisitor_visitIncludeRule_closure4: function _EvaluateVisitor_visitIncludeRule_closure4(t0) { + this.node = t0; + }, + _EvaluateVisitor_visitMediaRule_closure2: function _EvaluateVisitor_visitMediaRule_closure2(t0, t1) { + this.$this = t0; + this.queries = t1; + }, + _EvaluateVisitor_visitMediaRule_closure3: function _EvaluateVisitor_visitMediaRule_closure3(t0, t1, t2, t3, t4) { + var _ = this; + _.$this = t0; + _.mergedQueries = t1; + _.queries = t2; + _.mergedSources = t3; + _.node = t4; + }, + _EvaluateVisitor_visitMediaRule__closure0: function _EvaluateVisitor_visitMediaRule__closure0(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitMediaRule___closure0: function _EvaluateVisitor_visitMediaRule___closure0(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitMediaRule_closure4: function _EvaluateVisitor_visitMediaRule_closure4(t0) { + this.mergedSources = t0; + }, + _EvaluateVisitor_visitStyleRule_closure4: function _EvaluateVisitor_visitStyleRule_closure4(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitStyleRule_closure5: function _EvaluateVisitor_visitStyleRule_closure5() { + }, + _EvaluateVisitor_visitStyleRule_closure6: function _EvaluateVisitor_visitStyleRule_closure6(t0, t1, t2) { + this.$this = t0; + this.rule = t1; + this.node = t2; + }, + _EvaluateVisitor_visitStyleRule__closure0: function _EvaluateVisitor_visitStyleRule__closure0(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitStyleRule_closure7: function _EvaluateVisitor_visitStyleRule_closure7() { + }, + _EvaluateVisitor_visitStyleRule_closure8: function _EvaluateVisitor_visitStyleRule_closure8() { + }, + _EvaluateVisitor_visitSupportsRule_closure1: function _EvaluateVisitor_visitSupportsRule_closure1(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitSupportsRule__closure0: function _EvaluateVisitor_visitSupportsRule__closure0(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitSupportsRule_closure2: function _EvaluateVisitor_visitSupportsRule_closure2() { + }, + _EvaluateVisitor__visitSupportsCondition_closure0: function _EvaluateVisitor__visitSupportsCondition_closure0(t0, t1) { + this._box_0 = t0; + this.$this = t1; + }, + _EvaluateVisitor_visitVariableDeclaration_closure2: function _EvaluateVisitor_visitVariableDeclaration_closure2(t0, t1, t2) { + this._box_0 = t0; + this.$this = t1; + this.node = t2; + }, + _EvaluateVisitor_visitVariableDeclaration_closure3: function _EvaluateVisitor_visitVariableDeclaration_closure3(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitVariableDeclaration_closure4: function _EvaluateVisitor_visitVariableDeclaration_closure4(t0, t1, t2) { + this.$this = t0; + this.node = t1; + this.value = t2; + }, + _EvaluateVisitor_visitUseRule_closure0: function _EvaluateVisitor_visitUseRule_closure0(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitWarnRule_closure0: function _EvaluateVisitor_visitWarnRule_closure0(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitWhileRule_closure0: function _EvaluateVisitor_visitWhileRule_closure0(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitWhileRule__closure0: function _EvaluateVisitor_visitWhileRule__closure0(t0) { + this.$this = t0; + }, + _EvaluateVisitor_visitBinaryOperationExpression_closure0: function _EvaluateVisitor_visitBinaryOperationExpression_closure0(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor__slash_recommendation0: function _EvaluateVisitor__slash_recommendation0() { + }, + _EvaluateVisitor_visitVariableExpression_closure0: function _EvaluateVisitor_visitVariableExpression_closure0(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitUnaryOperationExpression_closure0: function _EvaluateVisitor_visitUnaryOperationExpression_closure0(t0, t1) { + this.node = t0; + this.operand = t1; + }, + _EvaluateVisitor_visitListExpression_closure0: function _EvaluateVisitor_visitListExpression_closure0(t0) { + this.$this = t0; + }, + _EvaluateVisitor_visitFunctionExpression_closure2: function _EvaluateVisitor_visitFunctionExpression_closure2(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitFunctionExpression_closure3: function _EvaluateVisitor_visitFunctionExpression_closure3() { + }, + _EvaluateVisitor_visitFunctionExpression_closure4: function _EvaluateVisitor_visitFunctionExpression_closure4(t0, t1, t2) { + this._box_0 = t0; + this.$this = t1; + this.node = t2; + }, + _EvaluateVisitor__checkCalculationArguments_check0: function _EvaluateVisitor__checkCalculationArguments_check0(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor__visitCalculationExpression_closure0: function _EvaluateVisitor__visitCalculationExpression_closure0(t0, t1, t2, t3) { + var _ = this; + _._box_0 = t0; + _.$this = t1; + _.node = t2; + _.inLegacySassFunction = t3; + }, + _EvaluateVisitor_visitInterpolatedFunctionExpression_closure0: function _EvaluateVisitor_visitInterpolatedFunctionExpression_closure0(t0, t1, t2) { + this.$this = t0; + this.node = t1; + this.$function = t2; + }, + _EvaluateVisitor__runUserDefinedCallable_closure0: function _EvaluateVisitor__runUserDefinedCallable_closure0(t0, t1, t2, t3, t4, t5) { + var _ = this; + _.$this = t0; + _.callable = t1; + _.evaluated = t2; + _.nodeWithSpan = t3; + _.run = t4; + _.V = t5; + }, + _EvaluateVisitor__runUserDefinedCallable__closure0: function _EvaluateVisitor__runUserDefinedCallable__closure0(t0, t1, t2, t3, t4, t5) { + var _ = this; + _.$this = t0; + _.evaluated = t1; + _.callable = t2; + _.nodeWithSpan = t3; + _.run = t4; + _.V = t5; + }, + _EvaluateVisitor__runUserDefinedCallable___closure0: function _EvaluateVisitor__runUserDefinedCallable___closure0(t0, t1, t2, t3, t4, t5) { + var _ = this; + _.$this = t0; + _.evaluated = t1; + _.callable = t2; + _.nodeWithSpan = t3; + _.run = t4; + _.V = t5; + }, + _EvaluateVisitor__runUserDefinedCallable____closure0: function _EvaluateVisitor__runUserDefinedCallable____closure0() { + }, + _EvaluateVisitor__runFunctionCallable_closure0: function _EvaluateVisitor__runFunctionCallable_closure0(t0, t1) { + this.$this = t0; + this.callable = t1; + }, + _EvaluateVisitor__runBuiltInCallable_closure2: function _EvaluateVisitor__runBuiltInCallable_closure2(t0, t1, t2) { + this._box_0 = t0; + this.evaluated = t1; + this.namedSet = t2; + }, + _EvaluateVisitor__runBuiltInCallable_closure3: function _EvaluateVisitor__runBuiltInCallable_closure3(t0, t1) { + this._box_0 = t0; + this.evaluated = t1; + }, + _EvaluateVisitor__runBuiltInCallable_closure4: function _EvaluateVisitor__runBuiltInCallable_closure4() { + }, + _EvaluateVisitor__evaluateArguments_closure3: function _EvaluateVisitor__evaluateArguments_closure3() { + }, + _EvaluateVisitor__evaluateArguments_closure4: function _EvaluateVisitor__evaluateArguments_closure4(t0, t1) { + this.$this = t0; + this.restNodeForSpan = t1; + }, + _EvaluateVisitor__evaluateArguments_closure5: function _EvaluateVisitor__evaluateArguments_closure5(t0, t1, t2, t3) { + var _ = this; + _.$this = t0; + _.named = t1; + _.restNodeForSpan = t2; + _.namedNodes = t3; + }, + _EvaluateVisitor__evaluateArguments_closure6: function _EvaluateVisitor__evaluateArguments_closure6() { + }, + _EvaluateVisitor__evaluateMacroArguments_closure3: function _EvaluateVisitor__evaluateMacroArguments_closure3(t0) { + this.restArgs = t0; + }, + _EvaluateVisitor__evaluateMacroArguments_closure4: function _EvaluateVisitor__evaluateMacroArguments_closure4(t0, t1, t2) { + this.$this = t0; + this.restNodeForSpan = t1; + this.restArgs = t2; + }, + _EvaluateVisitor__evaluateMacroArguments_closure5: function _EvaluateVisitor__evaluateMacroArguments_closure5(t0, t1, t2, t3) { + var _ = this; + _.$this = t0; + _.named = t1; + _.restNodeForSpan = t2; + _.restArgs = t3; + }, + _EvaluateVisitor__evaluateMacroArguments_closure6: function _EvaluateVisitor__evaluateMacroArguments_closure6(t0, t1, t2) { + this.$this = t0; + this.keywordRestNodeForSpan = t1; + this.keywordRestArgs = t2; + }, + _EvaluateVisitor__addRestMap_closure0: function _EvaluateVisitor__addRestMap_closure0(t0, t1, t2, t3, t4, t5) { + var _ = this; + _.$this = t0; + _.values = t1; + _.convert = t2; + _.expressionNode = t3; + _.map = t4; + _.nodeWithSpan = t5; + }, + _EvaluateVisitor__verifyArguments_closure0: function _EvaluateVisitor__verifyArguments_closure0(t0, t1, t2) { + this.$arguments = t0; + this.positional = t1; + this.named = t2; + }, + _EvaluateVisitor_visitCssAtRule_closure1: function _EvaluateVisitor_visitCssAtRule_closure1(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitCssAtRule_closure2: function _EvaluateVisitor_visitCssAtRule_closure2() { + }, + _EvaluateVisitor_visitCssKeyframeBlock_closure1: function _EvaluateVisitor_visitCssKeyframeBlock_closure1(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitCssKeyframeBlock_closure2: function _EvaluateVisitor_visitCssKeyframeBlock_closure2() { + }, + _EvaluateVisitor_visitCssMediaRule_closure2: function _EvaluateVisitor_visitCssMediaRule_closure2(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitCssMediaRule_closure3: function _EvaluateVisitor_visitCssMediaRule_closure3(t0, t1, t2, t3) { + var _ = this; + _.$this = t0; + _.mergedQueries = t1; + _.node = t2; + _.mergedSources = t3; + }, + _EvaluateVisitor_visitCssMediaRule__closure0: function _EvaluateVisitor_visitCssMediaRule__closure0(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitCssMediaRule___closure0: function _EvaluateVisitor_visitCssMediaRule___closure0(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitCssMediaRule_closure4: function _EvaluateVisitor_visitCssMediaRule_closure4(t0) { + this.mergedSources = t0; + }, + _EvaluateVisitor_visitCssStyleRule_closure1: function _EvaluateVisitor_visitCssStyleRule_closure1(t0, t1, t2) { + this.$this = t0; + this.rule = t1; + this.node = t2; + }, + _EvaluateVisitor_visitCssStyleRule__closure0: function _EvaluateVisitor_visitCssStyleRule__closure0(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitCssStyleRule_closure2: function _EvaluateVisitor_visitCssStyleRule_closure2() { + }, + _EvaluateVisitor_visitCssSupportsRule_closure1: function _EvaluateVisitor_visitCssSupportsRule_closure1(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitCssSupportsRule__closure0: function _EvaluateVisitor_visitCssSupportsRule__closure0(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitCssSupportsRule_closure2: function _EvaluateVisitor_visitCssSupportsRule_closure2() { + }, + _EvaluateVisitor__performInterpolationHelper_closure0: function _EvaluateVisitor__performInterpolationHelper_closure0(t0) { + this.interpolation = t0; + }, + _EvaluateVisitor__serialize_closure0: function _EvaluateVisitor__serialize_closure0(t0, t1) { + this.value = t0; + this.quote = t1; + }, + _EvaluateVisitor__expressionNode_closure0: function _EvaluateVisitor__expressionNode_closure0(t0, t1) { + this.$this = t0; + this.expression = t1; + }, + _EvaluateVisitor__withoutSlash_recommendation0: function _EvaluateVisitor__withoutSlash_recommendation0() { + }, + _EvaluateVisitor__stackFrame_closure0: function _EvaluateVisitor__stackFrame_closure0(t0) { + this.$this = t0; + }, + _ImportedCssVisitor0: function _ImportedCssVisitor0(t0) { + this._async_evaluate$_visitor = t0; + }, + _ImportedCssVisitor_visitCssAtRule_closure0: function _ImportedCssVisitor_visitCssAtRule_closure0() { + }, + _ImportedCssVisitor_visitCssMediaRule_closure0: function _ImportedCssVisitor_visitCssMediaRule_closure0(t0) { + this.hasBeenMerged = t0; + }, + _ImportedCssVisitor_visitCssStyleRule_closure0: function _ImportedCssVisitor_visitCssStyleRule_closure0() { + }, + _ImportedCssVisitor_visitCssSupportsRule_closure0: function _ImportedCssVisitor_visitCssSupportsRule_closure0() { + }, + _EvaluationContext0: function _EvaluationContext0(t0, t1) { + this._async_evaluate$_visitor = t0; + this._async_evaluate$_defaultWarnNodeWithSpan = t1; + }, + cloneCssStylesheet(stylesheet, extensionStore) { + var _0_0 = extensionStore.clone$0(); + return new A._Record_2(new A._CloneCssVisitor(_0_0._1)._visitChildren$2(A.ModifiableCssStylesheet$(stylesheet.get$span(stylesheet)), stylesheet), _0_0._0); + }, + _CloneCssVisitor: function _CloneCssVisitor(t0) { + this._oldToNewSelectors = t0; + }, + _EvaluateVisitor$(functions, importCache, logger, nodeImporter, quietDeps, sourceMap) { + var t1 = type$.Uri, + t2 = type$.Module_Callable, + t3 = A._setArrayType([], type$.JSArray_Record_2_String_and_AstNode); + t1 = new A._EvaluateVisitor(importCache, nodeImporter, A.LinkedHashMap_LinkedHashMap$_empty(type$.String, type$.Callable), A.LinkedHashMap_LinkedHashMap$_empty(t1, t2), A.LinkedHashMap_LinkedHashMap$_empty(t1, t2), A.LinkedHashMap_LinkedHashMap$_empty(t1, type$.Configuration), A.LinkedHashMap_LinkedHashMap$_empty(t1, type$.AstNode), logger, A.LinkedHashSet_LinkedHashSet$_empty(type$.Record_2_String_and_SourceSpan), quietDeps, sourceMap, A.Environment$(), A.LinkedHashSet_LinkedHashSet$_empty(t1), A.LinkedHashMap_LinkedHashMap$_empty(t1, type$.nullable_AstNode), t3, B.Configuration_Map_empty_null); + t1._EvaluateVisitor$6$functions$importCache$logger$nodeImporter$quietDeps$sourceMap(functions, importCache, logger, nodeImporter, quietDeps, sourceMap); + return t1; + }, + Evaluator: function Evaluator(t0, t1) { + this._visitor = t0; + this._importer = t1; + }, + _EvaluateVisitor: function _EvaluateVisitor(t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15) { + var _ = this; + _._evaluate$_importCache = t0; + _._evaluate$_nodeImporter = t1; + _._builtInFunctions = t2; + _._builtInModules = t3; + _._modules = t4; + _._moduleConfigurations = t5; + _._moduleNodes = t6; + _._evaluate$_logger = t7; + _._warningsEmitted = t8; + _._quietDeps = t9; + _._sourceMap = t10; + _._environment = t11; + _._declarationName = _.__parent = _._mediaQuerySources = _._mediaQueries = _._styleRuleIgnoringAtRoot = null; + _._member = "root stylesheet"; + _._importSpan = _._callableNode = _._currentCallable = null; + _._inSupportsDeclaration = _._inKeyframes = _._atRootExcludingStyleRule = _._inUnknownAtRule = _._inFunction = false; + _._loadedUrls = t12; + _._activeModules = t13; + _._stack = t14; + _._importer = null; + _._inDependency = false; + _.__extensionStore = _._preModuleComments = _._outOfOrderImports = _.__endOfImports = _.__root = _.__stylesheet = null; + _._configuration = t15; + }, + _EvaluateVisitor_closure: function _EvaluateVisitor_closure(t0) { + this.$this = t0; + }, + _EvaluateVisitor_closure0: function _EvaluateVisitor_closure0(t0) { + this.$this = t0; + }, + _EvaluateVisitor_closure1: function _EvaluateVisitor_closure1(t0) { + this.$this = t0; + }, + _EvaluateVisitor_closure2: function _EvaluateVisitor_closure2(t0) { + this.$this = t0; + }, + _EvaluateVisitor_closure3: function _EvaluateVisitor_closure3(t0) { + this.$this = t0; + }, + _EvaluateVisitor_closure4: function _EvaluateVisitor_closure4(t0) { + this.$this = t0; + }, + _EvaluateVisitor_closure5: function _EvaluateVisitor_closure5(t0) { + this.$this = t0; + }, + _EvaluateVisitor_closure6: function _EvaluateVisitor_closure6(t0) { + this.$this = t0; + }, + _EvaluateVisitor_closure7: function _EvaluateVisitor_closure7(t0) { + this.$this = t0; + }, + _EvaluateVisitor__closure2: function _EvaluateVisitor__closure2(t0, t1, t2) { + this.$this = t0; + this.name = t1; + this.module = t2; + }, + _EvaluateVisitor_closure8: function _EvaluateVisitor_closure8(t0) { + this.$this = t0; + }, + _EvaluateVisitor__closure1: function _EvaluateVisitor__closure1(t0, t1, t2) { + this.$this = t0; + this.name = t1; + this.module = t2; + }, + _EvaluateVisitor_closure9: function _EvaluateVisitor_closure9(t0) { + this.$this = t0; + }, + _EvaluateVisitor_closure10: function _EvaluateVisitor_closure10(t0) { + this.$this = t0; + }, + _EvaluateVisitor__closure: function _EvaluateVisitor__closure(t0, t1, t2) { + this.values = t0; + this.span = t1; + this.callableNode = t2; + }, + _EvaluateVisitor__closure0: function _EvaluateVisitor__closure0(t0) { + this.$this = t0; + }, + _EvaluateVisitor_closure11: function _EvaluateVisitor_closure11(t0) { + this.$this = t0; + }, + _EvaluateVisitor_run_closure: function _EvaluateVisitor_run_closure(t0, t1, t2) { + this.$this = t0; + this.node = t1; + this.importer = t2; + }, + _EvaluateVisitor_run__closure: function _EvaluateVisitor_run__closure(t0, t1, t2) { + this.$this = t0; + this.importer = t1; + this.node = t2; + }, + _EvaluateVisitor_runExpression_closure: function _EvaluateVisitor_runExpression_closure(t0, t1, t2) { + this.$this = t0; + this.importer = t1; + this.expression = t2; + }, + _EvaluateVisitor_runExpression__closure: function _EvaluateVisitor_runExpression__closure(t0, t1) { + this.$this = t0; + this.expression = t1; + }, + _EvaluateVisitor_runExpression___closure: function _EvaluateVisitor_runExpression___closure(t0, t1) { + this.$this = t0; + this.expression = t1; + }, + _EvaluateVisitor_runStatement_closure: function _EvaluateVisitor_runStatement_closure(t0, t1, t2) { + this.$this = t0; + this.importer = t1; + this.statement = t2; + }, + _EvaluateVisitor_runStatement__closure: function _EvaluateVisitor_runStatement__closure(t0, t1) { + this.$this = t0; + this.statement = t1; + }, + _EvaluateVisitor_runStatement___closure: function _EvaluateVisitor_runStatement___closure(t0, t1) { + this.$this = t0; + this.statement = t1; + }, + _EvaluateVisitor__loadModule_closure: function _EvaluateVisitor__loadModule_closure(t0, t1) { + this._box_1 = t0; + this.callback = t1; + }, + _EvaluateVisitor__loadModule_closure0: function _EvaluateVisitor__loadModule_closure0(t0, t1, t2, t3, t4, t5, t6) { + var _ = this; + _.$this = t0; + _.url = t1; + _.nodeWithSpan = t2; + _.baseUrl = t3; + _.namesInErrors = t4; + _.configuration = t5; + _.callback = t6; + }, + _EvaluateVisitor__loadModule__closure: function _EvaluateVisitor__loadModule__closure(t0, t1) { + this.$this = t0; + this.message = t1; + }, + _EvaluateVisitor__loadModule__closure0: function _EvaluateVisitor__loadModule__closure0(t0, t1, t2) { + this._box_0 = t0; + this.callback = t1; + this.firstLoad = t2; + }, + _EvaluateVisitor__execute_closure: function _EvaluateVisitor__execute_closure(t0, t1, t2, t3, t4, t5, t6) { + var _ = this; + _.$this = t0; + _.importer = t1; + _.stylesheet = t2; + _.extensionStore = t3; + _.configuration = t4; + _.css = t5; + _.preModuleComments = t6; + }, + _EvaluateVisitor__combineCss_closure: function _EvaluateVisitor__combineCss_closure() { + }, + _EvaluateVisitor__combineCss_closure0: function _EvaluateVisitor__combineCss_closure0(t0) { + this.selectors = t0; + }, + _EvaluateVisitor__combineCss_visitModule: function _EvaluateVisitor__combineCss_visitModule(t0, t1, t2, t3, t4, t5) { + var _ = this; + _.$this = t0; + _.seen = t1; + _.clone = t2; + _.css = t3; + _.imports = t4; + _.sorted = t5; + }, + _EvaluateVisitor__extendModules_closure: function _EvaluateVisitor__extendModules_closure(t0) { + this.originalSelectors = t0; + }, + _EvaluateVisitor__extendModules_closure0: function _EvaluateVisitor__extendModules_closure0() { + }, + _EvaluateVisitor_visitAtRootRule_closure: function _EvaluateVisitor_visitAtRootRule_closure(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitAtRootRule_closure0: function _EvaluateVisitor_visitAtRootRule_closure0(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor__scopeForAtRoot_closure: function _EvaluateVisitor__scopeForAtRoot_closure(t0, t1, t2) { + this.$this = t0; + this.newParent = t1; + this.node = t2; + }, + _EvaluateVisitor__scopeForAtRoot_closure0: function _EvaluateVisitor__scopeForAtRoot_closure0(t0, t1) { + this.$this = t0; + this.innerScope = t1; + }, + _EvaluateVisitor__scopeForAtRoot_closure1: function _EvaluateVisitor__scopeForAtRoot_closure1(t0, t1) { + this.$this = t0; + this.innerScope = t1; + }, + _EvaluateVisitor__scopeForAtRoot__closure: function _EvaluateVisitor__scopeForAtRoot__closure(t0, t1) { + this.innerScope = t0; + this.callback = t1; + }, + _EvaluateVisitor__scopeForAtRoot_closure2: function _EvaluateVisitor__scopeForAtRoot_closure2(t0, t1) { + this.$this = t0; + this.innerScope = t1; + }, + _EvaluateVisitor__scopeForAtRoot_closure3: function _EvaluateVisitor__scopeForAtRoot_closure3() { + }, + _EvaluateVisitor__scopeForAtRoot_closure4: function _EvaluateVisitor__scopeForAtRoot_closure4(t0, t1) { + this.$this = t0; + this.innerScope = t1; + }, + _EvaluateVisitor_visitContentRule_closure: function _EvaluateVisitor_visitContentRule_closure(t0, t1) { + this.$this = t0; + this.content = t1; + }, + _EvaluateVisitor_visitDeclaration_closure: function _EvaluateVisitor_visitDeclaration_closure(t0, t1) { + this._box_0 = t0; + this.$this = t1; + }, + _EvaluateVisitor_visitEachRule_closure: function _EvaluateVisitor_visitEachRule_closure(t0, t1, t2) { + this._box_0 = t0; + this.$this = t1; + this.nodeWithSpan = t2; + }, + _EvaluateVisitor_visitEachRule_closure0: function _EvaluateVisitor_visitEachRule_closure0(t0, t1, t2) { + this._box_0 = t0; + this.$this = t1; + this.nodeWithSpan = t2; + }, + _EvaluateVisitor_visitEachRule_closure1: function _EvaluateVisitor_visitEachRule_closure1(t0, t1, t2, t3) { + var _ = this; + _.$this = t0; + _.list = t1; + _.setVariables = t2; + _.node = t3; + }, + _EvaluateVisitor_visitEachRule__closure: function _EvaluateVisitor_visitEachRule__closure(t0, t1, t2) { + this.$this = t0; + this.setVariables = t1; + this.node = t2; + }, + _EvaluateVisitor_visitEachRule___closure: function _EvaluateVisitor_visitEachRule___closure(t0) { + this.$this = t0; + }, + _EvaluateVisitor_visitAtRule_closure: function _EvaluateVisitor_visitAtRule_closure(t0) { + this.$this = t0; + }, + _EvaluateVisitor_visitAtRule_closure0: function _EvaluateVisitor_visitAtRule_closure0(t0, t1, t2) { + this.$this = t0; + this.name = t1; + this.children = t2; + }, + _EvaluateVisitor_visitAtRule__closure: function _EvaluateVisitor_visitAtRule__closure(t0, t1) { + this.$this = t0; + this.children = t1; + }, + _EvaluateVisitor_visitAtRule_closure1: function _EvaluateVisitor_visitAtRule_closure1() { + }, + _EvaluateVisitor_visitForRule_closure: function _EvaluateVisitor_visitForRule_closure(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitForRule_closure0: function _EvaluateVisitor_visitForRule_closure0(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitForRule_closure1: function _EvaluateVisitor_visitForRule_closure1(t0) { + this.fromNumber = t0; + }, + _EvaluateVisitor_visitForRule_closure2: function _EvaluateVisitor_visitForRule_closure2(t0, t1) { + this.toNumber = t0; + this.fromNumber = t1; + }, + _EvaluateVisitor_visitForRule_closure3: function _EvaluateVisitor_visitForRule_closure3(t0, t1, t2, t3, t4, t5) { + var _ = this; + _._box_0 = t0; + _.$this = t1; + _.node = t2; + _.from = t3; + _.direction = t4; + _.fromNumber = t5; + }, + _EvaluateVisitor_visitForRule__closure: function _EvaluateVisitor_visitForRule__closure(t0) { + this.$this = t0; + }, + _EvaluateVisitor_visitForwardRule_closure: function _EvaluateVisitor_visitForwardRule_closure(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitForwardRule_closure0: function _EvaluateVisitor_visitForwardRule_closure0(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor__registerCommentsForModule_closure: function _EvaluateVisitor__registerCommentsForModule_closure() { + }, + _EvaluateVisitor_visitIfRule_closure: function _EvaluateVisitor_visitIfRule_closure(t0) { + this.$this = t0; + }, + _EvaluateVisitor_visitIfRule__closure: function _EvaluateVisitor_visitIfRule__closure(t0, t1) { + this.$this = t0; + this.clause = t1; + }, + _EvaluateVisitor_visitIfRule___closure: function _EvaluateVisitor_visitIfRule___closure(t0) { + this.$this = t0; + }, + _EvaluateVisitor__visitDynamicImport_closure: function _EvaluateVisitor__visitDynamicImport_closure(t0, t1) { + this.$this = t0; + this.$import = t1; + }, + _EvaluateVisitor__visitDynamicImport__closure: function _EvaluateVisitor__visitDynamicImport__closure(t0) { + this.$this = t0; + }, + _EvaluateVisitor__visitDynamicImport__closure0: function _EvaluateVisitor__visitDynamicImport__closure0() { + }, + _EvaluateVisitor__visitDynamicImport__closure1: function _EvaluateVisitor__visitDynamicImport__closure1() { + }, + _EvaluateVisitor__visitDynamicImport__closure2: function _EvaluateVisitor__visitDynamicImport__closure2(t0, t1, t2, t3, t4) { + var _ = this; + _._box_0 = t0; + _.$this = t1; + _.loadsUserDefinedModules = t2; + _.environment = t3; + _.children = t4; + }, + _EvaluateVisitor__applyMixin_closure: function _EvaluateVisitor__applyMixin_closure(t0, t1, t2, t3) { + var _ = this; + _.$this = t0; + _.$arguments = t1; + _.mixin = t2; + _.nodeWithSpanWithoutContent = t3; + }, + _EvaluateVisitor__applyMixin__closure0: function _EvaluateVisitor__applyMixin__closure0(t0, t1, t2, t3) { + var _ = this; + _.$this = t0; + _.$arguments = t1; + _.mixin = t2; + _.nodeWithSpanWithoutContent = t3; + }, + _EvaluateVisitor__applyMixin_closure0: function _EvaluateVisitor__applyMixin_closure0(t0, t1, t2, t3) { + var _ = this; + _.$this = t0; + _.contentCallable = t1; + _.mixin = t2; + _.nodeWithSpanWithoutContent = t3; + }, + _EvaluateVisitor__applyMixin__closure: function _EvaluateVisitor__applyMixin__closure(t0, t1, t2) { + this.$this = t0; + this.mixin = t1; + this.nodeWithSpanWithoutContent = t2; + }, + _EvaluateVisitor__applyMixin___closure: function _EvaluateVisitor__applyMixin___closure(t0, t1, t2) { + this.$this = t0; + this.mixin = t1; + this.nodeWithSpanWithoutContent = t2; + }, + _EvaluateVisitor__applyMixin____closure: function _EvaluateVisitor__applyMixin____closure(t0, t1) { + this.$this = t0; + this.statement = t1; + }, + _EvaluateVisitor_visitIncludeRule_closure: function _EvaluateVisitor_visitIncludeRule_closure(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitIncludeRule_closure0: function _EvaluateVisitor_visitIncludeRule_closure0(t0) { + this.$this = t0; + }, + _EvaluateVisitor_visitIncludeRule_closure1: function _EvaluateVisitor_visitIncludeRule_closure1(t0) { + this.node = t0; + }, + _EvaluateVisitor_visitMediaRule_closure: function _EvaluateVisitor_visitMediaRule_closure(t0, t1) { + this.$this = t0; + this.queries = t1; + }, + _EvaluateVisitor_visitMediaRule_closure0: function _EvaluateVisitor_visitMediaRule_closure0(t0, t1, t2, t3, t4) { + var _ = this; + _.$this = t0; + _.mergedQueries = t1; + _.queries = t2; + _.mergedSources = t3; + _.node = t4; + }, + _EvaluateVisitor_visitMediaRule__closure: function _EvaluateVisitor_visitMediaRule__closure(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitMediaRule___closure: function _EvaluateVisitor_visitMediaRule___closure(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitMediaRule_closure1: function _EvaluateVisitor_visitMediaRule_closure1(t0) { + this.mergedSources = t0; + }, + _EvaluateVisitor_visitStyleRule_closure: function _EvaluateVisitor_visitStyleRule_closure(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitStyleRule_closure0: function _EvaluateVisitor_visitStyleRule_closure0() { + }, + _EvaluateVisitor_visitStyleRule_closure1: function _EvaluateVisitor_visitStyleRule_closure1(t0, t1, t2) { + this.$this = t0; + this.rule = t1; + this.node = t2; + }, + _EvaluateVisitor_visitStyleRule__closure: function _EvaluateVisitor_visitStyleRule__closure(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitStyleRule_closure2: function _EvaluateVisitor_visitStyleRule_closure2() { + }, + _EvaluateVisitor_visitStyleRule_closure3: function _EvaluateVisitor_visitStyleRule_closure3() { + }, + _EvaluateVisitor_visitSupportsRule_closure: function _EvaluateVisitor_visitSupportsRule_closure(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitSupportsRule__closure: function _EvaluateVisitor_visitSupportsRule__closure(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitSupportsRule_closure0: function _EvaluateVisitor_visitSupportsRule_closure0() { + }, + _EvaluateVisitor__visitSupportsCondition_closure: function _EvaluateVisitor__visitSupportsCondition_closure(t0, t1) { + this._box_0 = t0; + this.$this = t1; + }, + _EvaluateVisitor_visitVariableDeclaration_closure: function _EvaluateVisitor_visitVariableDeclaration_closure(t0, t1, t2) { + this._box_0 = t0; + this.$this = t1; + this.node = t2; + }, + _EvaluateVisitor_visitVariableDeclaration_closure0: function _EvaluateVisitor_visitVariableDeclaration_closure0(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitVariableDeclaration_closure1: function _EvaluateVisitor_visitVariableDeclaration_closure1(t0, t1, t2) { + this.$this = t0; + this.node = t1; + this.value = t2; + }, + _EvaluateVisitor_visitUseRule_closure: function _EvaluateVisitor_visitUseRule_closure(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitWarnRule_closure: function _EvaluateVisitor_visitWarnRule_closure(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitWhileRule_closure: function _EvaluateVisitor_visitWhileRule_closure(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitWhileRule__closure: function _EvaluateVisitor_visitWhileRule__closure(t0) { + this.$this = t0; + }, + _EvaluateVisitor_visitBinaryOperationExpression_closure: function _EvaluateVisitor_visitBinaryOperationExpression_closure(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor__slash_recommendation: function _EvaluateVisitor__slash_recommendation() { + }, + _EvaluateVisitor_visitVariableExpression_closure: function _EvaluateVisitor_visitVariableExpression_closure(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitUnaryOperationExpression_closure: function _EvaluateVisitor_visitUnaryOperationExpression_closure(t0, t1) { + this.node = t0; + this.operand = t1; + }, + _EvaluateVisitor_visitListExpression_closure: function _EvaluateVisitor_visitListExpression_closure(t0) { + this.$this = t0; + }, + _EvaluateVisitor_visitFunctionExpression_closure: function _EvaluateVisitor_visitFunctionExpression_closure(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitFunctionExpression_closure0: function _EvaluateVisitor_visitFunctionExpression_closure0() { + }, + _EvaluateVisitor_visitFunctionExpression_closure1: function _EvaluateVisitor_visitFunctionExpression_closure1(t0, t1, t2) { + this._box_0 = t0; + this.$this = t1; + this.node = t2; + }, + _EvaluateVisitor__checkCalculationArguments_check: function _EvaluateVisitor__checkCalculationArguments_check(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor__visitCalculationExpression_closure: function _EvaluateVisitor__visitCalculationExpression_closure(t0, t1, t2, t3) { + var _ = this; + _._box_0 = t0; + _.$this = t1; + _.node = t2; + _.inLegacySassFunction = t3; + }, + _EvaluateVisitor_visitInterpolatedFunctionExpression_closure: function _EvaluateVisitor_visitInterpolatedFunctionExpression_closure(t0, t1, t2) { + this.$this = t0; + this.node = t1; + this.$function = t2; + }, + _EvaluateVisitor__runUserDefinedCallable_closure: function _EvaluateVisitor__runUserDefinedCallable_closure(t0, t1, t2, t3, t4, t5) { + var _ = this; + _.$this = t0; + _.callable = t1; + _.evaluated = t2; + _.nodeWithSpan = t3; + _.run = t4; + _.V = t5; + }, + _EvaluateVisitor__runUserDefinedCallable__closure: function _EvaluateVisitor__runUserDefinedCallable__closure(t0, t1, t2, t3, t4, t5) { + var _ = this; + _.$this = t0; + _.evaluated = t1; + _.callable = t2; + _.nodeWithSpan = t3; + _.run = t4; + _.V = t5; + }, + _EvaluateVisitor__runUserDefinedCallable___closure: function _EvaluateVisitor__runUserDefinedCallable___closure(t0, t1, t2, t3, t4, t5) { + var _ = this; + _.$this = t0; + _.evaluated = t1; + _.callable = t2; + _.nodeWithSpan = t3; + _.run = t4; + _.V = t5; + }, + _EvaluateVisitor__runUserDefinedCallable____closure: function _EvaluateVisitor__runUserDefinedCallable____closure() { + }, + _EvaluateVisitor__runFunctionCallable_closure: function _EvaluateVisitor__runFunctionCallable_closure(t0, t1) { + this.$this = t0; + this.callable = t1; + }, + _EvaluateVisitor__runBuiltInCallable_closure: function _EvaluateVisitor__runBuiltInCallable_closure(t0, t1, t2) { + this._box_0 = t0; + this.evaluated = t1; + this.namedSet = t2; + }, + _EvaluateVisitor__runBuiltInCallable_closure0: function _EvaluateVisitor__runBuiltInCallable_closure0(t0, t1) { + this._box_0 = t0; + this.evaluated = t1; + }, + _EvaluateVisitor__runBuiltInCallable_closure1: function _EvaluateVisitor__runBuiltInCallable_closure1() { + }, + _EvaluateVisitor__evaluateArguments_closure: function _EvaluateVisitor__evaluateArguments_closure() { + }, + _EvaluateVisitor__evaluateArguments_closure0: function _EvaluateVisitor__evaluateArguments_closure0(t0, t1) { + this.$this = t0; + this.restNodeForSpan = t1; + }, + _EvaluateVisitor__evaluateArguments_closure1: function _EvaluateVisitor__evaluateArguments_closure1(t0, t1, t2, t3) { + var _ = this; + _.$this = t0; + _.named = t1; + _.restNodeForSpan = t2; + _.namedNodes = t3; + }, + _EvaluateVisitor__evaluateArguments_closure2: function _EvaluateVisitor__evaluateArguments_closure2() { + }, + _EvaluateVisitor__evaluateMacroArguments_closure: function _EvaluateVisitor__evaluateMacroArguments_closure(t0) { + this.restArgs = t0; + }, + _EvaluateVisitor__evaluateMacroArguments_closure0: function _EvaluateVisitor__evaluateMacroArguments_closure0(t0, t1, t2) { + this.$this = t0; + this.restNodeForSpan = t1; + this.restArgs = t2; + }, + _EvaluateVisitor__evaluateMacroArguments_closure1: function _EvaluateVisitor__evaluateMacroArguments_closure1(t0, t1, t2, t3) { + var _ = this; + _.$this = t0; + _.named = t1; + _.restNodeForSpan = t2; + _.restArgs = t3; + }, + _EvaluateVisitor__evaluateMacroArguments_closure2: function _EvaluateVisitor__evaluateMacroArguments_closure2(t0, t1, t2) { + this.$this = t0; + this.keywordRestNodeForSpan = t1; + this.keywordRestArgs = t2; + }, + _EvaluateVisitor__addRestMap_closure: function _EvaluateVisitor__addRestMap_closure(t0, t1, t2, t3, t4, t5) { + var _ = this; + _.$this = t0; + _.values = t1; + _.convert = t2; + _.expressionNode = t3; + _.map = t4; + _.nodeWithSpan = t5; + }, + _EvaluateVisitor__verifyArguments_closure: function _EvaluateVisitor__verifyArguments_closure(t0, t1, t2) { + this.$arguments = t0; + this.positional = t1; + this.named = t2; + }, + _EvaluateVisitor_visitCssAtRule_closure: function _EvaluateVisitor_visitCssAtRule_closure(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitCssAtRule_closure0: function _EvaluateVisitor_visitCssAtRule_closure0() { + }, + _EvaluateVisitor_visitCssKeyframeBlock_closure: function _EvaluateVisitor_visitCssKeyframeBlock_closure(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitCssKeyframeBlock_closure0: function _EvaluateVisitor_visitCssKeyframeBlock_closure0() { + }, + _EvaluateVisitor_visitCssMediaRule_closure: function _EvaluateVisitor_visitCssMediaRule_closure(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitCssMediaRule_closure0: function _EvaluateVisitor_visitCssMediaRule_closure0(t0, t1, t2, t3) { + var _ = this; + _.$this = t0; + _.mergedQueries = t1; + _.node = t2; + _.mergedSources = t3; + }, + _EvaluateVisitor_visitCssMediaRule__closure: function _EvaluateVisitor_visitCssMediaRule__closure(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitCssMediaRule___closure: function _EvaluateVisitor_visitCssMediaRule___closure(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitCssMediaRule_closure1: function _EvaluateVisitor_visitCssMediaRule_closure1(t0) { + this.mergedSources = t0; + }, + _EvaluateVisitor_visitCssStyleRule_closure: function _EvaluateVisitor_visitCssStyleRule_closure(t0, t1, t2) { + this.$this = t0; + this.rule = t1; + this.node = t2; + }, + _EvaluateVisitor_visitCssStyleRule__closure: function _EvaluateVisitor_visitCssStyleRule__closure(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitCssStyleRule_closure0: function _EvaluateVisitor_visitCssStyleRule_closure0() { + }, + _EvaluateVisitor_visitCssSupportsRule_closure: function _EvaluateVisitor_visitCssSupportsRule_closure(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitCssSupportsRule__closure: function _EvaluateVisitor_visitCssSupportsRule__closure(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitCssSupportsRule_closure0: function _EvaluateVisitor_visitCssSupportsRule_closure0() { + }, + _EvaluateVisitor__performInterpolationHelper_closure: function _EvaluateVisitor__performInterpolationHelper_closure(t0) { + this.interpolation = t0; + }, + _EvaluateVisitor__serialize_closure: function _EvaluateVisitor__serialize_closure(t0, t1) { + this.value = t0; + this.quote = t1; + }, + _EvaluateVisitor__expressionNode_closure: function _EvaluateVisitor__expressionNode_closure(t0, t1) { + this.$this = t0; + this.expression = t1; + }, + _EvaluateVisitor__withoutSlash_recommendation: function _EvaluateVisitor__withoutSlash_recommendation() { + }, + _EvaluateVisitor__stackFrame_closure: function _EvaluateVisitor__stackFrame_closure(t0) { + this.$this = t0; + }, + _ImportedCssVisitor: function _ImportedCssVisitor(t0) { + this._visitor = t0; + }, + _ImportedCssVisitor_visitCssAtRule_closure: function _ImportedCssVisitor_visitCssAtRule_closure() { + }, + _ImportedCssVisitor_visitCssMediaRule_closure: function _ImportedCssVisitor_visitCssMediaRule_closure(t0) { + this.hasBeenMerged = t0; + }, + _ImportedCssVisitor_visitCssStyleRule_closure: function _ImportedCssVisitor_visitCssStyleRule_closure() { + }, + _ImportedCssVisitor_visitCssSupportsRule_closure: function _ImportedCssVisitor_visitCssSupportsRule_closure() { + }, + _EvaluationContext: function _EvaluationContext(t0, t1) { + this._visitor = t0; + this._defaultWarnNodeWithSpan = t1; + }, + EveryCssVisitor: function EveryCssVisitor() { + }, + EveryCssVisitor_visitCssAtRule_closure: function EveryCssVisitor_visitCssAtRule_closure(t0) { + this.$this = t0; + }, + EveryCssVisitor_visitCssKeyframeBlock_closure: function EveryCssVisitor_visitCssKeyframeBlock_closure(t0) { + this.$this = t0; + }, + EveryCssVisitor_visitCssMediaRule_closure: function EveryCssVisitor_visitCssMediaRule_closure(t0) { + this.$this = t0; + }, + EveryCssVisitor_visitCssStyleRule_closure: function EveryCssVisitor_visitCssStyleRule_closure(t0) { + this.$this = t0; + }, + EveryCssVisitor_visitCssStylesheet_closure: function EveryCssVisitor_visitCssStylesheet_closure(t0) { + this.$this = t0; + }, + EveryCssVisitor_visitCssSupportsRule_closure: function EveryCssVisitor_visitCssSupportsRule_closure(t0) { + this.$this = t0; + }, + expressionToCalc(expression) { + var t1 = A._setArrayType([B.C__MakeExpressionCalculationSafe.visitBinaryOperationExpression$1(expression)], type$.JSArray_Expression), + t2 = expression.get$span(0), + t3 = type$.Expression; + return new A.FunctionExpression(null, "calc", new A.ArgumentInvocation(A.List_List$unmodifiable(t1, t3), A.ConstantMap_ConstantMap$from(B.Map_empty6, type$.String, t3), null, null, t2), expression.get$span(0)); + }, + _MakeExpressionCalculationSafe: function _MakeExpressionCalculationSafe() { + }, + __MakeExpressionCalculationSafe_Object_ReplaceExpressionVisitor: function __MakeExpressionCalculationSafe_Object_ReplaceExpressionVisitor() { + }, + _FindDependenciesVisitor: function _FindDependenciesVisitor(t0, t1, t2, t3, t4) { + var _ = this; + _._find_dependencies$_uses = t0; + _._find_dependencies$_forwards = t1; + _._metaLoadCss = t2; + _._imports = t3; + _._metaNamespaces = t4; + }, + DependencyReport: function DependencyReport(t0, t1, t2, t3) { + var _ = this; + _.uses = t0; + _.forwards = t1; + _.metaLoadCss = t2; + _.imports = t3; + }, + __FindDependenciesVisitor_Object_RecursiveStatementVisitor: function __FindDependenciesVisitor_Object_RecursiveStatementVisitor() { + }, + RecursiveStatementVisitor: function RecursiveStatementVisitor() { + }, + ReplaceExpressionVisitor: function ReplaceExpressionVisitor() { + }, + ReplaceExpressionVisitor_visitListExpression_closure: function ReplaceExpressionVisitor_visitListExpression_closure(t0) { + this.$this = t0; + }, + ReplaceExpressionVisitor_visitArgumentInvocation_closure: function ReplaceExpressionVisitor_visitArgumentInvocation_closure(t0) { + this.$this = t0; + }, + ReplaceExpressionVisitor_visitInterpolation_closure: function ReplaceExpressionVisitor_visitInterpolation_closure(t0) { + this.$this = t0; + }, + SelectorSearchVisitor: function SelectorSearchVisitor() { + }, + SelectorSearchVisitor_visitComplexSelector_closure: function SelectorSearchVisitor_visitComplexSelector_closure(t0) { + this.$this = t0; + }, + SelectorSearchVisitor_visitCompoundSelector_closure: function SelectorSearchVisitor_visitCompoundSelector_closure(t0) { + this.$this = t0; + }, + serialize(node, charset, indentWidth, inspect, lineFeed, sourceMap, style, useSpaces) { + var t1, css, t2, prefix, + visitor = A._SerializeVisitor$(2, inspect, lineFeed, true, sourceMap, style, true); + node.accept$1(visitor); + t1 = visitor._serialize$_buffer; + css = t1.toString$0(0); + if (charset) { + t2 = new A.CodeUnits(css); + t2 = t2.any$1(t2, new A.serialize_closure()); + } else + t2 = false; + if (t2) + prefix = style === B.OutputStyle_1 ? "\ufeff" : '@charset "UTF-8";\n'; + else + prefix = ""; + t1 = sourceMap ? t1.buildSourceMap$1$prefix(prefix) : null; + return new A._Record_2_sourceMap(prefix + css, t1); + }, + serializeValue(value, inspect, quote) { + var visitor = A._SerializeVisitor$(null, inspect, null, quote, false, null, true); + value.accept$1(visitor); + return visitor._serialize$_buffer.toString$0(0); + }, + serializeSelector(selector, inspect) { + var visitor = A._SerializeVisitor$(null, true, null, true, false, null, true); + selector.accept$1(visitor); + return visitor._serialize$_buffer.toString$0(0); + }, + _SerializeVisitor$(indentWidth, inspect, lineFeed, quote, sourceMap, style, useSpaces) { + var t1 = sourceMap ? new A.SourceMapBuffer(new A.StringBuffer(""), A._setArrayType([], type$.JSArray_Entry)) : new A.NoSourceMapBuffer(new A.StringBuffer("")), + t2 = style == null ? B.OutputStyle_0 : style, + t3 = indentWidth == null ? 2 : indentWidth; + A.RangeError_checkValueInInterval(t3, 0, 10, "indentWidth"); + return new A._SerializeVisitor(t1, t2, inspect, quote, 32, t3, B.LineFeed_lf); + }, + serialize_closure: function serialize_closure() { + }, + _SerializeVisitor: function _SerializeVisitor(t0, t1, t2, t3, t4, t5, t6) { + var _ = this; + _._serialize$_buffer = t0; + _._indentation = 0; + _._style = t1; + _._inspect = t2; + _._quote = t3; + _._indentCharacter = t4; + _._indentWidth = t5; + _._serialize$_lineFeed = t6; + }, + _SerializeVisitor_visitCssComment_closure: function _SerializeVisitor_visitCssComment_closure(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _SerializeVisitor_visitCssAtRule_closure: function _SerializeVisitor_visitCssAtRule_closure(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _SerializeVisitor_visitCssMediaRule_closure: function _SerializeVisitor_visitCssMediaRule_closure(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _SerializeVisitor_visitCssImport_closure: function _SerializeVisitor_visitCssImport_closure(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _SerializeVisitor_visitCssImport__closure: function _SerializeVisitor_visitCssImport__closure(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _SerializeVisitor_visitCssKeyframeBlock_closure: function _SerializeVisitor_visitCssKeyframeBlock_closure(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _SerializeVisitor_visitCssStyleRule_closure: function _SerializeVisitor_visitCssStyleRule_closure(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _SerializeVisitor_visitCssSupportsRule_closure: function _SerializeVisitor_visitCssSupportsRule_closure(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _SerializeVisitor_visitCssDeclaration_closure: function _SerializeVisitor_visitCssDeclaration_closure(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _SerializeVisitor_visitCssDeclaration_closure0: function _SerializeVisitor_visitCssDeclaration_closure0(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _SerializeVisitor_visitList_closure: function _SerializeVisitor_visitList_closure() { + }, + _SerializeVisitor_visitList_closure0: function _SerializeVisitor_visitList_closure0(t0, t1) { + this.$this = t0; + this.value = t1; + }, + _SerializeVisitor_visitList_closure1: function _SerializeVisitor_visitList_closure1(t0) { + this.$this = t0; + }, + _SerializeVisitor_visitMap_closure: function _SerializeVisitor_visitMap_closure(t0) { + this.$this = t0; + }, + _SerializeVisitor_visitSelectorList_closure: function _SerializeVisitor_visitSelectorList_closure() { + }, + _SerializeVisitor__write_closure: function _SerializeVisitor__write_closure(t0, t1) { + this.$this = t0; + this.value = t1; + }, + _SerializeVisitor__visitChildren_closure: function _SerializeVisitor__visitChildren_closure(t0, t1) { + this.$this = t0; + this.child = t1; + }, + _SerializeVisitor__visitChildren_closure0: function _SerializeVisitor__visitChildren_closure0(t0, t1) { + this.$this = t0; + this.child = t1; + }, + OutputStyle: function OutputStyle(t0) { + this._name = t0; + }, + LineFeed: function LineFeed(t0) { + this._name = t0; + }, + StatementSearchVisitor: function StatementSearchVisitor() { + }, + StatementSearchVisitor_visitIfRule_closure: function StatementSearchVisitor_visitIfRule_closure(t0) { + this.$this = t0; + }, + StatementSearchVisitor_visitIfRule__closure0: function StatementSearchVisitor_visitIfRule__closure0(t0) { + this.$this = t0; + }, + StatementSearchVisitor_visitIfRule_closure0: function StatementSearchVisitor_visitIfRule_closure0(t0) { + this.$this = t0; + }, + StatementSearchVisitor_visitIfRule__closure: function StatementSearchVisitor_visitIfRule__closure(t0) { + this.$this = t0; + }, + StatementSearchVisitor_visitChildren_closure: function StatementSearchVisitor_visitChildren_closure(t0) { + this.$this = t0; + }, + Entry: function Entry(t0, t1, t2) { + this.source = t0; + this.target = t1; + this.identifierName = t2; + }, + SingleMapping_SingleMapping$fromEntries(entries) { + var lines, t1, t2, urls, names, files, targetEntries, t3, t4, lineNum, _i, sourceEntry, t5, t6, sourceUrl, t7, urlId, + sourceEntries = J.toList$0$ax(entries); + B.JSArray_methods.sort$0(sourceEntries); + lines = A._setArrayType([], type$.JSArray_TargetLineEntry); + t1 = type$.String; + t2 = type$.int; + urls = A.LinkedHashMap_LinkedHashMap$_empty(t1, t2); + names = A.LinkedHashMap_LinkedHashMap$_empty(t1, t2); + files = A.LinkedHashMap_LinkedHashMap$_empty(t2, type$.SourceFile); + targetEntries = A._Cell$(); + for (t2 = sourceEntries.length, t3 = type$.JSArray_TargetEntry, t4 = targetEntries.__late_helper$_name, lineNum = null, _i = 0; _i < sourceEntries.length; sourceEntries.length === t2 || (0, A.throwConcurrentModificationError)(sourceEntries), ++_i) { + sourceEntry = sourceEntries[_i]; + if (lineNum == null || sourceEntry.target.line > lineNum) { + lineNum = sourceEntry.target.line; + t5 = A._setArrayType([], t3); + targetEntries._value = t5; + lines.push(new A.TargetLineEntry(lineNum, t5)); + } + t5 = sourceEntry.source; + t6 = t5.file; + sourceUrl = t6.url; + t7 = sourceUrl == null ? "" : sourceUrl.toString$0(0); + urlId = urls.putIfAbsent$2(t7, new A.SingleMapping_SingleMapping$fromEntries_closure(urls)); + files.putIfAbsent$2(urlId, new A.SingleMapping_SingleMapping$fromEntries_closure0(sourceEntry)); + t7 = targetEntries._value; + if (t7 === targetEntries) + A.throwExpression(A.LateError$localNI(t4)); + t5 = t5.offset; + J.add$1$ax(t7, new A.TargetEntry(sourceEntry.target.column, urlId, t6.getLine$1(t5), t6.getColumn$1(t5), null)); + } + t2 = urls.get$values(0); + t2 = A.MappedIterable_MappedIterable(t2, new A.SingleMapping_SingleMapping$fromEntries_closure1(files), A._instanceType(t2)._eval$1("Iterable.E"), type$.nullable_SourceFile); + t2 = A.List_List$of(t2, true, A._instanceType(t2)._eval$1("Iterable.E")); + t3 = urls.$ti._eval$1("LinkedHashMapKeyIterable<1>"); + t4 = names.$ti._eval$1("LinkedHashMapKeyIterable<1>"); + return new A.SingleMapping(A.List_List$of(new A.LinkedHashMapKeyIterable(urls, t3), true, t3._eval$1("Iterable.E")), A.List_List$of(new A.LinkedHashMapKeyIterable(names, t4), true, t4._eval$1("Iterable.E")), t2, lines, null, A.LinkedHashMap_LinkedHashMap$_empty(t1, type$.dynamic)); + }, + Mapping: function Mapping() { + }, + SingleMapping: function SingleMapping(t0, t1, t2, t3, t4, t5) { + var _ = this; + _.urls = t0; + _.names = t1; + _.files = t2; + _.lines = t3; + _.targetUrl = t4; + _.sourceRoot = null; + _.extensions = t5; + }, + SingleMapping_SingleMapping$fromEntries_closure: function SingleMapping_SingleMapping$fromEntries_closure(t0) { + this.urls = t0; + }, + SingleMapping_SingleMapping$fromEntries_closure0: function SingleMapping_SingleMapping$fromEntries_closure0(t0) { + this.sourceEntry = t0; + }, + SingleMapping_SingleMapping$fromEntries_closure1: function SingleMapping_SingleMapping$fromEntries_closure1(t0) { + this.files = t0; + }, + SingleMapping_toJson_closure: function SingleMapping_toJson_closure() { + }, + SingleMapping_toJson_closure0: function SingleMapping_toJson_closure0(t0) { + this.result = t0; + }, + TargetLineEntry: function TargetLineEntry(t0, t1) { + this.line = t0; + this.entries = t1; + }, + TargetEntry: function TargetEntry(t0, t1, t2, t3, t4) { + var _ = this; + _.column = t0; + _.sourceUrlId = t1; + _.sourceLine = t2; + _.sourceColumn = t3; + _.sourceNameId = t4; + }, + SourceFile$fromString(text, url) { + var t1 = new A.CodeUnits(text), + t2 = A._setArrayType([0], type$.JSArray_int), + t3 = typeof url == "string" ? A.Uri_parse(url) : type$.nullable_Uri._as(url); + t2 = new A.SourceFile(t3, t2, new Uint32Array(A._ensureNativeList(t1.toList$0(t1)))); + t2.SourceFile$decoded$2$url(t1, url); + return t2; + }, + SourceFile$decoded(decodedChars, url) { + var t1 = A._setArrayType([0], type$.JSArray_int), + t2 = typeof url == "string" ? A.Uri_parse(url) : type$.nullable_Uri._as(url); + t1 = new A.SourceFile(t2, t1, new Uint32Array(A._ensureNativeList(J.toList$0$ax(decodedChars)))); + t1.SourceFile$decoded$2$url(decodedChars, url); + return t1; + }, + FileLocation$_(file, offset) { + if (offset < 0) + A.throwExpression(A.RangeError$("Offset may not be negative, was " + offset + ".")); + else if (offset > file._decodedChars.length) + A.throwExpression(A.RangeError$("Offset " + offset + string$.x20must_n + file.get$length(0) + ".")); + return new A.FileLocation(file, offset); + }, + _FileSpan$(file, _start, _end) { + if (_end < _start) + A.throwExpression(A.ArgumentError$("End " + _end + " must come after start " + _start + ".", null)); + else if (_end > file._decodedChars.length) + A.throwExpression(A.RangeError$("End " + _end + string$.x20must_n + file.get$length(0) + ".")); + else if (_start < 0) + A.throwExpression(A.RangeError$("Start may not be negative, was " + _start + ".")); + return new A._FileSpan(file, _start, _end); + }, + FileSpanExtension_subspan(_this, start, end) { + var t1, startOffset, t2; + A.RangeError_checkValidRange(start, end, _this.get$length(_this)); + if (start === 0) + t1 = end == null || end === _this.get$length(_this); + else + t1 = false; + if (t1) + return _this; + startOffset = _this.get$start(_this).offset; + t1 = _this.get$file(_this); + t2 = end == null ? _this.get$end(_this).offset : startOffset + end; + return t1.span$2(0, startOffset + start, t2); + }, + SourceFile: function SourceFile(t0, t1, t2) { + var _ = this; + _.url = t0; + _._lineStarts = t1; + _._decodedChars = t2; + _._cachedLine = null; + }, + FileLocation: function FileLocation(t0, t1) { + this.file = t0; + this.offset = t1; + }, + _FileSpan: function _FileSpan(t0, t1, t2) { + this.file = t0; + this._file$_start = t1; + this._end = t2; + }, + Highlighter$(span, color) { + var t1 = A.Highlighter__collateLines(A._setArrayType([A._Highlight$(span, null, true)], type$.JSArray__Highlight)), + t2 = new A.Highlighter_closure(color).call$0(), + t3 = B.JSInt_methods.toString$0(B.JSArray_methods.get$last(t1).number + 1), + t4 = A.Highlighter__contiguous(t1) ? 0 : 3, + t5 = A._arrayInstanceType(t1); + return new A.Highlighter(t1, t2, null, 1 + Math.max(t3.length, t4), new A.MappedListIterable(t1, new A.Highlighter$__closure(), t5._eval$1("MappedListIterable<1,int>")).reduce$1(0, B.CONSTANT), !A.isAllTheSame(new A.MappedListIterable(t1, new A.Highlighter$__closure0(), t5._eval$1("MappedListIterable<1,Object?>"))), new A.StringBuffer("")); + }, + Highlighter$multiple(primarySpan, primaryLabel, secondarySpans, color, primaryColor, secondaryColor) { + var t2, t3, t4, t5, t6, + t1 = A._setArrayType([A._Highlight$(primarySpan, primaryLabel, true)], type$.JSArray__Highlight); + for (t2 = secondarySpans.get$entries(secondarySpans), t2 = t2.get$iterator(t2); t2.moveNext$0();) { + t3 = t2.get$current(t2); + t1.push(A._Highlight$(t3.key, t3.value, false)); + } + t1 = A.Highlighter__collateLines(t1); + if (color) + t2 = primaryColor == null ? "\x1b[31m" : primaryColor; + else + t2 = null; + if (color) + t3 = "\x1b[34m"; + else + t3 = null; + t4 = B.JSInt_methods.toString$0(B.JSArray_methods.get$last(t1).number + 1); + t5 = A.Highlighter__contiguous(t1) ? 0 : 3; + t6 = A._arrayInstanceType(t1); + return new A.Highlighter(t1, t2, t3, 1 + Math.max(t4.length, t5), new A.MappedListIterable(t1, new A.Highlighter$__closure(), t6._eval$1("MappedListIterable<1,int>")).reduce$1(0, B.CONSTANT), !A.isAllTheSame(new A.MappedListIterable(t1, new A.Highlighter$__closure0(), t6._eval$1("MappedListIterable<1,Object?>"))), new A.StringBuffer("")); + }, + Highlighter__contiguous(lines) { + var i, thisLine, nextLine; + for (i = 0; i < lines.length - 1;) { + thisLine = lines[i]; + ++i; + nextLine = lines[i]; + if (thisLine.number + 1 !== nextLine.number && J.$eq$(thisLine.url, nextLine.url)) + return false; + } + return true; + }, + Highlighter__collateLines(highlights) { + var t1, t2, t3, + highlightsByUrl = A.groupBy(highlights, new A.Highlighter__collateLines_closure(), type$._Highlight, type$.Object); + for (t1 = highlightsByUrl.get$values(0), t2 = A._instanceType(t1), t2 = t2._eval$1("@<1>")._bind$1(t2._rest[1]), t1 = new A.MappedIterator(J.get$iterator$ax(t1.__internal$_iterable), t1._f, t2._eval$1("MappedIterator<1,2>")), t2 = t2._rest[1]; t1.moveNext$0();) { + t3 = t1.__internal$_current; + if (t3 == null) + t3 = t2._as(t3); + J.sort$1$ax(t3, new A.Highlighter__collateLines_closure0()); + } + t1 = highlightsByUrl.get$entries(0); + t2 = A._instanceType(t1)._eval$1("ExpandIterable"); + return A.List_List$of(new A.ExpandIterable(t1, new A.Highlighter__collateLines_closure1(), t2), true, t2._eval$1("Iterable.E")); + }, + _Highlight$(span, label, primary) { + var t2, + t1 = new A._Highlight_closure(span).call$0(); + if (label == null) + t2 = null; + else + t2 = A.stringReplaceAllUnchecked(label, "\r\n", "\n"); + return new A._Highlight(t1, primary, t2); + }, + _Highlight__normalizeNewlines(span) { + var endOffset, t1, i, t2, t3, t4, + text = span.get$text(); + if (!B.JSString_methods.contains$1(text, "\r\n")) + return span; + endOffset = span.get$end(span).get$offset(); + for (t1 = text.length - 1, i = 0; i < t1; ++i) + if (text.charCodeAt(i) === 13 && text.charCodeAt(i + 1) === 10) + --endOffset; + t1 = span.get$start(span); + t2 = span.get$sourceUrl(span); + t3 = span.get$end(span).get$line(); + t2 = A.SourceLocation$(endOffset, span.get$end(span).get$column(), t3, t2); + t3 = A.stringReplaceAllUnchecked(text, "\r\n", "\n"); + t4 = span.get$context(span); + return A.SourceSpanWithContext$(t1, t2, t3, A.stringReplaceAllUnchecked(t4, "\r\n", "\n")); + }, + _Highlight__normalizeTrailingNewline(span) { + var context, text, start, end, t1, t2, t3; + if (!B.JSString_methods.endsWith$1(span.get$context(span), "\n")) + return span; + if (B.JSString_methods.endsWith$1(span.get$text(), "\n\n")) + return span; + context = B.JSString_methods.substring$2(span.get$context(span), 0, span.get$context(span).length - 1); + text = span.get$text(); + start = span.get$start(span); + end = span.get$end(span); + if (B.JSString_methods.endsWith$1(span.get$text(), "\n")) { + t1 = A.findLineStart(span.get$context(span), span.get$text(), span.get$start(span).get$column()); + t1.toString; + t1 = t1 + span.get$start(span).get$column() + span.get$length(span) === span.get$context(span).length; + } else + t1 = false; + if (t1) { + text = B.JSString_methods.substring$2(span.get$text(), 0, span.get$text().length - 1); + if (text.length === 0) + end = start; + else { + t1 = span.get$end(span).get$offset(); + t2 = span.get$sourceUrl(span); + t3 = span.get$end(span).get$line(); + end = A.SourceLocation$(t1 - 1, A._Highlight__lastLineLength(context), t3 - 1, t2); + start = span.get$start(span).get$offset() === span.get$end(span).get$offset() ? end : span.get$start(span); + } + } + return A.SourceSpanWithContext$(start, end, text, context); + }, + _Highlight__normalizeEndOfLine(span) { + var text, t1, t2, t3, t4; + if (span.get$end(span).get$column() !== 0) + return span; + if (span.get$end(span).get$line() === span.get$start(span).get$line()) + return span; + text = B.JSString_methods.substring$2(span.get$text(), 0, span.get$text().length - 1); + t1 = span.get$start(span); + t2 = span.get$end(span).get$offset(); + t3 = span.get$sourceUrl(span); + t4 = span.get$end(span).get$line(); + t3 = A.SourceLocation$(t2 - 1, text.length - B.JSString_methods.lastIndexOf$1(text, "\n") - 1, t4 - 1, t3); + return A.SourceSpanWithContext$(t1, t3, text, B.JSString_methods.endsWith$1(span.get$context(span), "\n") ? B.JSString_methods.substring$2(span.get$context(span), 0, span.get$context(span).length - 1) : span.get$context(span)); + }, + _Highlight__lastLineLength(text) { + var t1 = text.length; + if (t1 === 0) + return 0; + else if (text.charCodeAt(t1 - 1) === 10) + return t1 === 1 ? 0 : t1 - B.JSString_methods.lastIndexOf$2(text, "\n", t1 - 2) - 1; + else + return t1 - B.JSString_methods.lastIndexOf$1(text, "\n") - 1; + }, + Highlighter: function Highlighter(t0, t1, t2, t3, t4, t5, t6) { + var _ = this; + _._lines = t0; + _._primaryColor = t1; + _._secondaryColor = t2; + _._paddingBeforeSidebar = t3; + _._maxMultilineSpans = t4; + _._multipleFiles = t5; + _._highlighter$_buffer = t6; + }, + Highlighter_closure: function Highlighter_closure(t0) { + this.color = t0; + }, + Highlighter$__closure: function Highlighter$__closure() { + }, + Highlighter$___closure: function Highlighter$___closure() { + }, + Highlighter$__closure0: function Highlighter$__closure0() { + }, + Highlighter__collateLines_closure: function Highlighter__collateLines_closure() { + }, + Highlighter__collateLines_closure0: function Highlighter__collateLines_closure0() { + }, + Highlighter__collateLines_closure1: function Highlighter__collateLines_closure1() { + }, + Highlighter__collateLines__closure: function Highlighter__collateLines__closure(t0) { + this.line = t0; + }, + Highlighter_highlight_closure: function Highlighter_highlight_closure() { + }, + Highlighter__writeFileStart_closure: function Highlighter__writeFileStart_closure(t0) { + this.$this = t0; + }, + Highlighter__writeMultilineHighlights_closure: function Highlighter__writeMultilineHighlights_closure(t0, t1, t2) { + this.$this = t0; + this.startLine = t1; + this.line = t2; + }, + Highlighter__writeMultilineHighlights_closure0: function Highlighter__writeMultilineHighlights_closure0(t0, t1) { + this.$this = t0; + this.highlight = t1; + }, + Highlighter__writeMultilineHighlights_closure1: function Highlighter__writeMultilineHighlights_closure1(t0) { + this.$this = t0; + }, + Highlighter__writeMultilineHighlights_closure2: function Highlighter__writeMultilineHighlights_closure2(t0, t1, t2, t3, t4, t5, t6) { + var _ = this; + _._box_0 = t0; + _.$this = t1; + _.current = t2; + _.startLine = t3; + _.line = t4; + _.highlight = t5; + _.endLine = t6; + }, + Highlighter__writeMultilineHighlights__closure: function Highlighter__writeMultilineHighlights__closure(t0, t1) { + this._box_0 = t0; + this.$this = t1; + }, + Highlighter__writeMultilineHighlights__closure0: function Highlighter__writeMultilineHighlights__closure0(t0, t1) { + this.$this = t0; + this.vertical = t1; + }, + Highlighter__writeHighlightedText_closure: function Highlighter__writeHighlightedText_closure(t0, t1, t2, t3) { + var _ = this; + _.$this = t0; + _.text = t1; + _.startColumn = t2; + _.endColumn = t3; + }, + Highlighter__writeIndicator_closure: function Highlighter__writeIndicator_closure(t0, t1, t2) { + this.$this = t0; + this.line = t1; + this.highlight = t2; + }, + Highlighter__writeIndicator_closure0: function Highlighter__writeIndicator_closure0(t0, t1, t2) { + this.$this = t0; + this.line = t1; + this.highlight = t2; + }, + Highlighter__writeIndicator_closure1: function Highlighter__writeIndicator_closure1(t0, t1, t2, t3) { + var _ = this; + _.$this = t0; + _.coversWholeLine = t1; + _.line = t2; + _.highlight = t3; + }, + Highlighter__writeLabel_closure: function Highlighter__writeLabel_closure(t0, t1) { + this.$this = t0; + this.lines = t1; + }, + Highlighter__writeLabel_closure0: function Highlighter__writeLabel_closure0(t0, t1) { + this.$this = t0; + this.text = t1; + }, + Highlighter__writeSidebar_closure: function Highlighter__writeSidebar_closure(t0, t1, t2) { + this._box_0 = t0; + this.$this = t1; + this.end = t2; + }, + _Highlight: function _Highlight(t0, t1, t2) { + this.span = t0; + this.isPrimary = t1; + this.label = t2; + }, + _Highlight_closure: function _Highlight_closure(t0) { + this.span = t0; + }, + _Line: function _Line(t0, t1, t2, t3) { + var _ = this; + _.text = t0; + _.number = t1; + _.url = t2; + _.highlights = t3; + }, + SourceLocation$(offset, column, line, sourceUrl) { + var t1 = line == null, + t2 = t1 ? 0 : line, + t3 = column == null, + t4 = t3 ? offset : column; + if (offset < 0) + A.throwExpression(A.RangeError$("Offset may not be negative, was " + offset + ".")); + else if (!t1 && line < 0) + A.throwExpression(A.RangeError$("Line may not be negative, was " + A.S(line) + ".")); + else if (!t3 && column < 0) + A.throwExpression(A.RangeError$("Column may not be negative, was " + A.S(column) + ".")); + return new A.SourceLocation(sourceUrl, offset, t2, t4); + }, + SourceLocation: function SourceLocation(t0, t1, t2, t3) { + var _ = this; + _.sourceUrl = t0; + _.offset = t1; + _.line = t2; + _.column = t3; + }, + SourceLocationMixin: function SourceLocationMixin() { + }, + SourceSpanExtension_messageMultiple(_this, message, label, secondarySpans, color, primaryColor, secondaryColor) { + var t2, t3, + t1 = _this.get$start(_this); + t1 = t1.file.getLine$1(t1.offset); + t2 = _this.get$start(_this); + t2 = "" + ("line " + (t1 + 1) + ", column " + (t2.file.getColumn$1(t2.offset) + 1)); + if (_this.get$sourceUrl(_this) != null) { + t1 = _this.get$sourceUrl(_this); + t3 = $.$get$context(); + t1.toString; + t1 = t2 + (" of " + t3.prettyUri$1(t1)); + } else + t1 = t2; + t1 = t1 + (": " + message + "\n") + A.Highlighter$multiple(_this, label, secondarySpans, color, primaryColor, secondaryColor).highlight$0(); + return t1.charCodeAt(0) == 0 ? t1 : t1; + }, + SourceSpanBase: function SourceSpanBase() { + }, + SourceSpanException: function SourceSpanException() { + }, + SourceSpanFormatException: function SourceSpanFormatException(t0, t1, t2) { + this.source = t0; + this._span_exception$_message = t1; + this._span = t2; + }, + MultiSourceSpanException: function MultiSourceSpanException() { + }, + MultiSourceSpanFormatException: function MultiSourceSpanFormatException(t0, t1, t2, t3) { + var _ = this; + _.primaryLabel = t0; + _.secondarySpans = t1; + _._span_exception$_message = t2; + _._span = t3; + }, + SourceSpanMixin: function SourceSpanMixin() { + }, + SourceSpanWithContext$(start, end, text, _context) { + var t1 = new A.SourceSpanWithContext(_context, start, end, text); + t1.SourceSpanBase$3(start, end, text); + if (!B.JSString_methods.contains$1(_context, text)) + A.throwExpression(A.ArgumentError$('The context line "' + _context + '" must contain "' + text + '".', null)); + if (A.findLineStart(_context, text, start.get$column()) == null) + A.throwExpression(A.ArgumentError$('The span text "' + text + '" must start at column ' + (start.get$column() + 1) + ' in a line within "' + _context + '".', null)); + return t1; + }, + SourceSpanWithContext: function SourceSpanWithContext(t0, t1, t2, t3) { + var _ = this; + _._context = t0; + _.start = t1; + _.end = t2; + _.text = t3; + }, + Chain_Chain$parse(chain) { + var t1, t2, + _s51_ = string$.x3d_____; + if (chain.length === 0) + return new A.Chain(A.List_List$unmodifiable(A._setArrayType([], type$.JSArray_Trace), type$.Trace)); + t1 = $.$get$vmChainGap(); + if (B.JSString_methods.contains$1(chain, t1)) { + t1 = B.JSString_methods.split$1(chain, t1); + t2 = A._arrayInstanceType(t1); + return new A.Chain(A.List_List$unmodifiable(new A.MappedIterable(new A.WhereIterable(t1, new A.Chain_Chain$parse_closure(), t2._eval$1("WhereIterable<1>")), A.trace_Trace___parseVM_tearOff$closure(), t2._eval$1("MappedIterable<1,Trace>")), type$.Trace)); + } + if (!B.JSString_methods.contains$1(chain, _s51_)) + return new A.Chain(A.List_List$unmodifiable(A._setArrayType([A.Trace_Trace$parse(chain)], type$.JSArray_Trace), type$.Trace)); + return new A.Chain(A.List_List$unmodifiable(new A.MappedListIterable(A._setArrayType(chain.split(_s51_), type$.JSArray_String), A.trace_Trace___parseFriendly_tearOff$closure(), type$.MappedListIterable_String_Trace), type$.Trace)); + }, + Chain: function Chain(t0) { + this.traces = t0; + }, + Chain_Chain$parse_closure: function Chain_Chain$parse_closure() { + }, + Chain_toTrace_closure: function Chain_toTrace_closure() { + }, + Chain_toString_closure0: function Chain_toString_closure0() { + }, + Chain_toString__closure0: function Chain_toString__closure0() { + }, + Chain_toString_closure: function Chain_toString_closure(t0) { + this.longest = t0; + }, + Chain_toString__closure: function Chain_toString__closure(t0) { + this.longest = t0; + }, + Frame___parseVM_tearOff(frame) { + return A.Frame_Frame$parseVM(frame); + }, + Frame_Frame$parseVM(frame) { + return A.Frame__catchFormatException(frame, new A.Frame_Frame$parseVM_closure(frame)); + }, + Frame___parseV8_tearOff(frame) { + return A.Frame_Frame$parseV8(frame); + }, + Frame_Frame$parseV8(frame) { + return A.Frame__catchFormatException(frame, new A.Frame_Frame$parseV8_closure(frame)); + }, + Frame_Frame$_parseFirefoxEval(frame) { + return A.Frame__catchFormatException(frame, new A.Frame_Frame$_parseFirefoxEval_closure(frame)); + }, + Frame___parseFirefox_tearOff(frame) { + return A.Frame_Frame$parseFirefox(frame); + }, + Frame_Frame$parseFirefox(frame) { + return A.Frame__catchFormatException(frame, new A.Frame_Frame$parseFirefox_closure(frame)); + }, + Frame___parseFriendly_tearOff(frame) { + return A.Frame_Frame$parseFriendly(frame); + }, + Frame_Frame$parseFriendly(frame) { + return A.Frame__catchFormatException(frame, new A.Frame_Frame$parseFriendly_closure(frame)); + }, + Frame__uriOrPathToUri(uriOrPath) { + if (B.JSString_methods.contains$1(uriOrPath, $.$get$Frame__uriRegExp())) + return A.Uri_parse(uriOrPath); + else if (B.JSString_methods.contains$1(uriOrPath, $.$get$Frame__windowsRegExp())) + return A._Uri__Uri$file(uriOrPath, true); + else if (B.JSString_methods.startsWith$1(uriOrPath, "/")) + return A._Uri__Uri$file(uriOrPath, false); + if (B.JSString_methods.contains$1(uriOrPath, "\\")) + return $.$get$windows().toUri$1(uriOrPath); + return A.Uri_parse(uriOrPath); + }, + Frame__catchFormatException(text, body) { + var t1, exception; + try { + t1 = body.call$0(); + return t1; + } catch (exception) { + if (type$.FormatException._is(A.unwrapException(exception))) + return new A.UnparsedFrame(A._Uri__Uri(null, "unparsed", null, null), text); + else + throw exception; + } + }, + Frame: function Frame(t0, t1, t2, t3) { + var _ = this; + _.uri = t0; + _.line = t1; + _.column = t2; + _.member = t3; + }, + Frame_Frame$parseVM_closure: function Frame_Frame$parseVM_closure(t0) { + this.frame = t0; + }, + Frame_Frame$parseV8_closure: function Frame_Frame$parseV8_closure(t0) { + this.frame = t0; + }, + Frame_Frame$parseV8_closure_parseLocation: function Frame_Frame$parseV8_closure_parseLocation(t0) { + this.frame = t0; + }, + Frame_Frame$_parseFirefoxEval_closure: function Frame_Frame$_parseFirefoxEval_closure(t0) { + this.frame = t0; + }, + Frame_Frame$parseFirefox_closure: function Frame_Frame$parseFirefox_closure(t0) { + this.frame = t0; + }, + Frame_Frame$parseFriendly_closure: function Frame_Frame$parseFriendly_closure(t0) { + this.frame = t0; + }, + LazyTrace: function LazyTrace(t0) { + this._thunk = t0; + this.__LazyTrace__trace_FI = $; + }, + LazyTrace_terse_closure: function LazyTrace_terse_closure(t0) { + this.$this = t0; + }, + Trace_Trace$from(trace) { + if (type$.Trace._is(trace)) + return trace; + if (trace instanceof A.Chain) + return trace.toTrace$0(); + return new A.LazyTrace(new A.Trace_Trace$from_closure(trace)); + }, + Trace_Trace$parse(trace) { + var error, t1, exception; + try { + if (trace.length === 0) { + t1 = A.Trace$(A._setArrayType([], type$.JSArray_Frame), null); + return t1; + } + if (B.JSString_methods.contains$1(trace, $.$get$_v8Trace())) { + t1 = A.Trace$parseV8(trace); + return t1; + } + if (B.JSString_methods.contains$1(trace, "\tat ")) { + t1 = A.Trace$parseJSCore(trace); + return t1; + } + if (B.JSString_methods.contains$1(trace, $.$get$_firefoxSafariTrace()) || B.JSString_methods.contains$1(trace, $.$get$_firefoxEvalTrace())) { + t1 = A.Trace$parseFirefox(trace); + return t1; + } + if (B.JSString_methods.contains$1(trace, string$.x3d_____)) { + t1 = A.Chain_Chain$parse(trace).toTrace$0(); + return t1; + } + if (B.JSString_methods.contains$1(trace, $.$get$_friendlyTrace())) { + t1 = A.Trace$parseFriendly(trace); + return t1; + } + t1 = A.Trace$parseVM(trace); + return t1; + } catch (exception) { + t1 = A.unwrapException(exception); + if (type$.FormatException._is(t1)) { + error = t1; + throw A.wrapException(A.FormatException$(J.get$message$x(error) + "\nStack trace:\n" + trace, null, null)); + } else + throw exception; + } + }, + Trace___parseVM_tearOff(trace) { + return A.Trace$parseVM(trace); + }, + Trace$parseVM(trace) { + var t1 = A.List_List$unmodifiable(A.Trace__parseVM(trace), type$.Frame); + return new A.Trace(t1, new A._StringStackTrace(trace)); + }, + Trace__parseVM(trace) { + var $frames, + t1 = B.JSString_methods.trim$0(trace), + t2 = $.$get$vmChainGap(), + t3 = type$.WhereIterable_String, + lines = new A.WhereIterable(A._setArrayType(A.stringReplaceAllUnchecked(t1, t2, "").split("\n"), type$.JSArray_String), new A.Trace__parseVM_closure(), t3); + if (!lines.get$iterator(0).moveNext$0()) + return A._setArrayType([], type$.JSArray_Frame); + t1 = A.TakeIterable_TakeIterable(lines, lines.get$length(0) - 1, t3._eval$1("Iterable.E")); + t1 = A.MappedIterable_MappedIterable(t1, A.frame_Frame___parseVM_tearOff$closure(), A._instanceType(t1)._eval$1("Iterable.E"), type$.Frame); + $frames = A.List_List$of(t1, true, A._instanceType(t1)._eval$1("Iterable.E")); + if (!J.endsWith$1$s(lines.get$last(0), ".da")) + B.JSArray_methods.add$1($frames, A.Frame_Frame$parseVM(lines.get$last(0))); + return $frames; + }, + Trace$parseV8(trace) { + var t1 = A.SubListIterable$(A._setArrayType(trace.split("\n"), type$.JSArray_String), 1, null, type$.String).super$Iterable$skipWhile(0, new A.Trace$parseV8_closure()), + t2 = type$.Frame; + t2 = A.List_List$unmodifiable(A.MappedIterable_MappedIterable(t1, A.frame_Frame___parseV8_tearOff$closure(), t1.$ti._eval$1("Iterable.E"), t2), t2); + return new A.Trace(t2, new A._StringStackTrace(trace)); + }, + Trace$parseJSCore(trace) { + var t1 = A.List_List$unmodifiable(new A.MappedIterable(new A.WhereIterable(A._setArrayType(trace.split("\n"), type$.JSArray_String), new A.Trace$parseJSCore_closure(), type$.WhereIterable_String), A.frame_Frame___parseV8_tearOff$closure(), type$.MappedIterable_String_Frame), type$.Frame); + return new A.Trace(t1, new A._StringStackTrace(trace)); + }, + Trace$parseFirefox(trace) { + var t1 = A.List_List$unmodifiable(new A.MappedIterable(new A.WhereIterable(A._setArrayType(B.JSString_methods.trim$0(trace).split("\n"), type$.JSArray_String), new A.Trace$parseFirefox_closure(), type$.WhereIterable_String), A.frame_Frame___parseFirefox_tearOff$closure(), type$.MappedIterable_String_Frame), type$.Frame); + return new A.Trace(t1, new A._StringStackTrace(trace)); + }, + Trace___parseFriendly_tearOff(trace) { + return A.Trace$parseFriendly(trace); + }, + Trace$parseFriendly(trace) { + var t1 = trace.length === 0 ? A._setArrayType([], type$.JSArray_Frame) : new A.MappedIterable(new A.WhereIterable(A._setArrayType(B.JSString_methods.trim$0(trace).split("\n"), type$.JSArray_String), new A.Trace$parseFriendly_closure(), type$.WhereIterable_String), A.frame_Frame___parseFriendly_tearOff$closure(), type$.MappedIterable_String_Frame); + t1 = A.List_List$unmodifiable(t1, type$.Frame); + return new A.Trace(t1, new A._StringStackTrace(trace)); + }, + Trace$($frames, original) { + var t1 = A.List_List$unmodifiable($frames, type$.Frame); + return new A.Trace(t1, new A._StringStackTrace(original == null ? "" : original)); + }, + Trace: function Trace(t0, t1) { + this.frames = t0; + this.original = t1; + }, + Trace_Trace$from_closure: function Trace_Trace$from_closure(t0) { + this.trace = t0; + }, + Trace__parseVM_closure: function Trace__parseVM_closure() { + }, + Trace$parseV8_closure: function Trace$parseV8_closure() { + }, + Trace$parseJSCore_closure: function Trace$parseJSCore_closure() { + }, + Trace$parseFirefox_closure: function Trace$parseFirefox_closure() { + }, + Trace$parseFriendly_closure: function Trace$parseFriendly_closure() { + }, + Trace_terse_closure: function Trace_terse_closure() { + }, + Trace_foldFrames_closure: function Trace_foldFrames_closure(t0) { + this.oldPredicate = t0; + }, + Trace_foldFrames_closure0: function Trace_foldFrames_closure0(t0) { + this._box_0 = t0; + }, + Trace_toString_closure0: function Trace_toString_closure0() { + }, + Trace_toString_closure: function Trace_toString_closure(t0) { + this.longest = t0; + }, + UnparsedFrame: function UnparsedFrame(t0, t1) { + this.uri = t0; + this.member = t1; + }, + TransformByHandlers_transformByHandlers(_this, onData, onDone, $S, $T) { + var _null = null, t1 = {}, + controller = A.StreamController_StreamController(_null, _null, _null, _null, true, $T); + t1.subscription = null; + controller.onListen = new A.TransformByHandlers_transformByHandlers_closure(t1, _this, onData, controller, A.instantiate1(A.from_handlers__TransformByHandlers__defaultHandleError$closure(), $T), onDone, $S); + return controller.get$stream(); + }, + TransformByHandlers__defaultHandleError(error, stackTrace, sink) { + sink.addError$2(error, stackTrace); + }, + TransformByHandlers_transformByHandlers_closure: function TransformByHandlers_transformByHandlers_closure(t0, t1, t2, t3, t4, t5, t6) { + var _ = this; + _._box_1 = t0; + _._this = t1; + _.handleData = t2; + _.controller = t3; + _.handleError = t4; + _.handleDone = t5; + _.S = t6; + }, + TransformByHandlers_transformByHandlers__closure: function TransformByHandlers_transformByHandlers__closure(t0, t1, t2) { + this.handleData = t0; + this.controller = t1; + this.S = t2; + }, + TransformByHandlers_transformByHandlers__closure1: function TransformByHandlers_transformByHandlers__closure1(t0, t1) { + this.handleError = t0; + this.controller = t1; + }, + TransformByHandlers_transformByHandlers__closure0: function TransformByHandlers_transformByHandlers__closure0(t0, t1, t2) { + this._box_0 = t0; + this.handleDone = t1; + this.controller = t2; + }, + TransformByHandlers_transformByHandlers__closure2: function TransformByHandlers_transformByHandlers__closure2(t0, t1) { + this._box_1 = t0; + this._box_0 = t1; + }, + RateLimit__debounceAggregate(_this, duration, collect, leading, trailing, $T, $S) { + var t1 = {}; + t1.soFar = t1.timer = null; + t1.emittedLatestAsLeading = t1.shouldClose = t1.hasPending = false; + return A.TransformByHandlers_transformByHandlers(_this, new A.RateLimit__debounceAggregate_closure(t1, $S, collect, false, duration, true, $T), new A.RateLimit__debounceAggregate_closure0(t1, true, $S), $T, $S); + }, + _collect($event, soFar, $T) { + var t1 = soFar == null ? A._setArrayType([], $T._eval$1("JSArray<0>")) : soFar; + J.add$1$ax(t1, $event); + return t1; + }, + RateLimit__debounceAggregate_closure: function RateLimit__debounceAggregate_closure(t0, t1, t2, t3, t4, t5, t6) { + var _ = this; + _._box_0 = t0; + _.S = t1; + _.collect = t2; + _.leading = t3; + _.duration = t4; + _.trailing = t5; + _.T = t6; + }, + RateLimit__debounceAggregate_closure_emit: function RateLimit__debounceAggregate_closure_emit(t0, t1, t2) { + this._box_0 = t0; + this.sink = t1; + this.S = t2; + }, + RateLimit__debounceAggregate__closure: function RateLimit__debounceAggregate__closure(t0, t1, t2, t3) { + var _ = this; + _._box_0 = t0; + _.trailing = t1; + _.emit = t2; + _.sink = t3; + }, + RateLimit__debounceAggregate_closure0: function RateLimit__debounceAggregate_closure0(t0, t1, t2) { + this._box_0 = t0; + this.trailing = t1; + this.S = t2; + }, + StringScannerException$(message, span, source) { + return new A.StringScannerException(source, message, span); + }, + StringScannerException: function StringScannerException(t0, t1, t2) { + this.source = t0; + this._span_exception$_message = t1; + this._span = t2; + }, + LineScanner$(string) { + return new A.LineScanner(null, string); + }, + LineScanner: function LineScanner(t0, t1) { + var _ = this; + _._line_scanner$_column = _._line_scanner$_line = 0; + _.sourceUrl = t0; + _.string = t1; + _._string_scanner$_position = 0; + _._lastMatchPosition = _._lastMatch = null; + }, + SpanScanner$(string, sourceUrl) { + var t2, + t1 = A.SourceFile$fromString(string, sourceUrl); + if (sourceUrl == null) + t2 = null; + else + t2 = typeof sourceUrl == "string" ? A.Uri_parse(sourceUrl) : type$.Uri._as(sourceUrl); + return new A.SpanScanner(t1, t2, string); + }, + SpanScanner: function SpanScanner(t0, t1, t2) { + var _ = this; + _._sourceFile = t0; + _.sourceUrl = t1; + _.string = t2; + _._string_scanner$_position = 0; + _._lastMatchPosition = _._lastMatch = null; + }, + _SpanScannerState: function _SpanScannerState(t0, t1) { + this._scanner = t0; + this.position = t1; + }, + StringScanner$(string, position, sourceUrl) { + var t1; + if (sourceUrl == null) + t1 = null; + else + t1 = typeof sourceUrl == "string" ? A.Uri_parse(sourceUrl) : type$.Uri._as(sourceUrl); + return new A.StringScanner(t1, string); + }, + StringScanner: function StringScanner(t0, t1) { + var _ = this; + _.sourceUrl = t0; + _.string = t1; + _._string_scanner$_position = 0; + _._lastMatchPosition = _._lastMatch = null; + }, + AsciiGlyphSet: function AsciiGlyphSet() { + }, + UnicodeGlyphSet: function UnicodeGlyphSet() { + }, + WatchEvent: function WatchEvent(t0, t1) { + this.type = t0; + this.path = t1; + }, + ChangeType: function ChangeType(t0) { + this._watch_event$_name = t0; + }, + AnySelectorVisitor0: function AnySelectorVisitor0() { + }, + AnySelectorVisitor_visitComplexSelector_closure0: function AnySelectorVisitor_visitComplexSelector_closure0(t0) { + this.$this = t0; + }, + AnySelectorVisitor_visitCompoundSelector_closure0: function AnySelectorVisitor_visitCompoundSelector_closure0(t0) { + this.$this = t0; + }, + SupportsAnything0: function SupportsAnything0(t0, t1) { + this.contents = t0; + this.span = t1; + }, + Argument0: function Argument0(t0, t1, t2) { + this.name = t0; + this.defaultValue = t1; + this.span = t2; + }, + ArgumentDeclaration_ArgumentDeclaration$parse0(contents, url) { + return A.ScssParser$0(contents, null, url).parseArgumentDeclaration$0(); + }, + ArgumentDeclaration0: function ArgumentDeclaration0(t0, t1, t2) { + this.$arguments = t0; + this.restArgument = t1; + this.span = t2; + }, + ArgumentDeclaration_verify_closure1: function ArgumentDeclaration_verify_closure1() { + }, + ArgumentDeclaration_verify_closure2: function ArgumentDeclaration_verify_closure2() { + }, + ArgumentInvocation$empty0(span) { + return new A.ArgumentInvocation0(B.List_empty20, B.Map_empty14, null, null, span); + }, + ArgumentInvocation0: function ArgumentInvocation0(t0, t1, t2, t3, t4) { + var _ = this; + _.positional = t0; + _.named = t1; + _.rest = t2; + _.keywordRest = t3; + _.span = t4; + }, + argumentListClass_closure: function argumentListClass_closure() { + }, + argumentListClass__closure: function argumentListClass__closure() { + }, + argumentListClass__closure0: function argumentListClass__closure0() { + }, + SassArgumentList$0(contents, keywords, separator) { + var t1 = type$.Value_2; + t1 = new A.SassArgumentList0(A.ConstantMap_ConstantMap$from(keywords, type$.String, t1), A.List_List$unmodifiable(contents, t1), separator, false); + t1.SassList$3$brackets0(contents, separator, false); + return t1; + }, + SassArgumentList0: function SassArgumentList0(t0, t1, t2, t3) { + var _ = this; + _._argument_list$_keywords = t0; + _._argument_list$_wereKeywordsAccessed = false; + _._list1$_contents = t1; + _._list1$_separator = t2; + _._list1$_hasBrackets = t3; + }, + JSArray1: function JSArray1() { + }, + AsyncImporter0: function AsyncImporter0() { + }, + JSToDartAsyncImporter: function JSToDartAsyncImporter(t0, t1, t2) { + this._async0$_canonicalize = t0; + this._load = t1; + this._nonCanonicalSchemes = t2; + }, + JSToDartAsyncImporter_canonicalize_closure: function JSToDartAsyncImporter_canonicalize_closure(t0, t1) { + this.$this = t0; + this.url = t1; + }, + JSToDartAsyncImporter_load_closure: function JSToDartAsyncImporter_load_closure(t0, t1) { + this.$this = t0; + this.url = t1; + }, + AsyncBuiltInCallable$mixin0($name, $arguments, callback, acceptsContent, url) { + return new A.AsyncBuiltInCallable0($name, A.ScssParser$0("@mixin " + $name + "(" + $arguments + ") {", null, url).parseArgumentDeclaration$0(), new A.AsyncBuiltInCallable$mixin_closure0(callback), false); + }, + AsyncBuiltInCallable0: function AsyncBuiltInCallable0(t0, t1, t2, t3) { + var _ = this; + _.name = t0; + _._async_built_in0$_arguments = t1; + _._async_built_in0$_callback = t2; + _.acceptsContent = t3; + }, + AsyncBuiltInCallable$mixin_closure0: function AsyncBuiltInCallable$mixin_closure0(t0) { + this.callback = t0; + }, + compileAsync0(path, charset, fatalDeprecations, functions, futureDeprecations, importCache, indentWidth, lineFeed, logger, nodeImporter, quietDeps, sourceMap, style, syntax, useSpaces, verbose) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.CompileResult_2), + $async$returnValue, t2, t3, t4, t0, stylesheet, result, t1; + var $async$compileAsync0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = type$.Deprecation_2; + logger = new A.DeprecationHandlingLogger0(A.LinkedHashMap_LinkedHashMap$_empty(t1, type$.int), logger, A.LinkedHashSet_LinkedHashSet$_empty(t1), A.LinkedHashSet_LinkedHashSet$_empty(t1), !verbose); + t1 = nodeImporter == null; + if (t1) + t2 = syntax == null || syntax === A.Syntax_forPath0(path); + else + t2 = false; + $async$goto = t2 ? 3 : 5; + break; + case 3: + // then + if (importCache == null) + importCache = A.AsyncImportCache$none(logger); + t2 = $.$get$FilesystemImporter_cwd0(); + t3 = A.isNodeJs() ? self.process : null; + if (!J.$eq$(t3 == null ? null : J.get$platform$x(t3), "win32")) { + t3 = A.isNodeJs() ? self.process : null; + t3 = J.$eq$(t3 == null ? null : J.get$platform$x(t3), "darwin"); + } else + t3 = true; + if (t3) { + t3 = $.$get$context(); + t4 = A._realCasePath0(A.absolute(t3.normalize$1(path), null, null, null, null, null, null, null, null, null, null, null, null, null, null)); + t0 = t4; + t4 = t3; + t3 = t0; + } else { + t3 = $.$get$context(); + t4 = t3.canonicalize$1(0, path); + t0 = t4; + t4 = t3; + t3 = t0; + } + $async$goto = 6; + return A._asyncAwait(importCache.importCanonical$3$originalUrl(t2, t4.toUri$1(t3), t4.toUri$1(path)), $async$compileAsync0); + case 6: + // returning from await. + t4 = $async$result; + t4.toString; + stylesheet = t4; + // goto join + $async$goto = 4; + break; + case 5: + // else + t2 = A.readFile0(path); + t3 = syntax == null ? A.Syntax_forPath0(path) : syntax; + stylesheet = A.Stylesheet_Stylesheet$parse0(t2, t3, logger, $.$get$context().toUri$1(path)); + case 4: + // join + $async$goto = 7; + return A._asyncAwait(A._compileStylesheet2(stylesheet, logger, importCache, nodeImporter, $.$get$FilesystemImporter_cwd0(), functions, style, useSpaces, indentWidth, lineFeed, quietDeps, sourceMap, charset), $async$compileAsync0); + case 7: + // returning from await. + result = $async$result; + logger.summarize$1$js(!t1); + $async$returnValue = result; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$compileAsync0, $async$completer); + }, + compileStringAsync0(source, charset, functions, importCache, importer, indentWidth, lineFeed, logger, nodeImporter, quietDeps, sourceMap, style, syntax, url, useSpaces, verbose) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.CompileResult_2), + $async$returnValue, stylesheet, result, t1; + var $async$compileStringAsync0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = type$.Deprecation_2; + logger = new A.DeprecationHandlingLogger0(A.LinkedHashMap_LinkedHashMap$_empty(t1, type$.int), logger, A.LinkedHashSet_LinkedHashSet$_empty(t1), A.LinkedHashSet_LinkedHashSet$_empty(t1), !verbose); + stylesheet = A.Stylesheet_Stylesheet$parse0(source, syntax == null ? B.Syntax_SCSS_scss0 : syntax, logger, url); + if (importer == null) + t1 = A.isBrowser() ? new A.NoOpImporter0() : $.$get$FilesystemImporter_cwd0(); + else + t1 = importer; + $async$goto = 3; + return A._asyncAwait(A._compileStylesheet2(stylesheet, logger, importCache, nodeImporter, t1, functions, style, useSpaces, indentWidth, lineFeed, quietDeps, sourceMap, charset), $async$compileStringAsync0); + case 3: + // returning from await. + result = $async$result; + logger.summarize$1$js(nodeImporter != null); + $async$returnValue = result; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$compileStringAsync0, $async$completer); + }, + _compileStylesheet2(stylesheet, logger, importCache, nodeImporter, importer, functions, style, useSpaces, indentWidth, lineFeed, quietDeps, sourceMap, charset) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.CompileResult_2), + $async$returnValue, evaluateResult, serializeResult, resultSourceMap; + var $async$_compileStylesheet2 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$goto = 3; + return A._asyncAwait(A._EvaluateVisitor$2(functions, importCache, logger, nodeImporter, quietDeps, sourceMap).run$2(0, importer, stylesheet), $async$_compileStylesheet2); + case 3: + // returning from await. + evaluateResult = $async$result; + serializeResult = A.serialize0(evaluateResult._1, charset, indentWidth, false, lineFeed, sourceMap, style, useSpaces); + resultSourceMap = serializeResult._1; + if (resultSourceMap != null && importCache != null) + A.mapInPlace0(resultSourceMap.urls, new A._compileStylesheet_closure2(stylesheet, importCache)); + $async$returnValue = new A.CompileResult0(evaluateResult, serializeResult); + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$_compileStylesheet2, $async$completer); + }, + _compileStylesheet_closure2: function _compileStylesheet_closure2(t0, t1) { + this.stylesheet = t0; + this.importCache = t1; + }, + AsyncEnvironment$0() { + var t1 = type$.String, + t2 = type$.Module_AsyncCallable_2, + t3 = type$.AstNode_2, + t4 = type$.int, + t5 = type$.AsyncCallable_2, + t6 = type$.JSArray_Map_String_AsyncCallable_2; + return new A.AsyncEnvironment0(A.LinkedHashMap_LinkedHashMap$_empty(t1, t2), A.LinkedHashMap_LinkedHashMap$_empty(t1, t3), A.LinkedHashMap_LinkedHashMap$_empty(t2, t3), A.LinkedHashMap_LinkedHashMap$_empty(t2, t3), null, null, A._setArrayType([], type$.JSArray_Module_AsyncCallable_2), A._setArrayType([A.LinkedHashMap_LinkedHashMap$_empty(t1, type$.Value_2)], type$.JSArray_Map_String_Value_2), A._setArrayType([A.LinkedHashMap_LinkedHashMap$_empty(t1, t3)], type$.JSArray_Map_String_AstNode_2), A.LinkedHashMap_LinkedHashMap$_empty(t1, t4), A._setArrayType([A.LinkedHashMap_LinkedHashMap$_empty(t1, t5)], t6), A.LinkedHashMap_LinkedHashMap$_empty(t1, t4), A._setArrayType([A.LinkedHashMap_LinkedHashMap$_empty(t1, t5)], t6), A.LinkedHashMap_LinkedHashMap$_empty(t1, t4), null); + }, + AsyncEnvironment$_0(_modules, _namespaceNodes, _globalModules, _importedModules, _forwardedModules, _nestedForwardedModules, _allModules, _variables, _variableNodes, _functions, _mixins, _content) { + var t1 = type$.String, + t2 = type$.int; + return new A.AsyncEnvironment0(_modules, _namespaceNodes, _globalModules, _importedModules, _forwardedModules, _nestedForwardedModules, _allModules, _variables, _variableNodes, A.LinkedHashMap_LinkedHashMap$_empty(t1, t2), _functions, A.LinkedHashMap_LinkedHashMap$_empty(t1, t2), _mixins, A.LinkedHashMap_LinkedHashMap$_empty(t1, t2), _content); + }, + _EnvironmentModule__EnvironmentModule2(environment, css, preModuleComments, extensionStore, forwarded) { + var t1, t2, t3, t4, t5, t6, module, result, t7; + if (forwarded == null) + forwarded = B.Set_empty6; + t1 = type$.dynamic; + t1 = A.LinkedHashMap_LinkedHashMap$_empty(t1, t1); + for (t2 = type$.Module_AsyncCallable_2, t3 = type$.List_CssComment_2, t4 = A.MapExtensions_get_pairs0(preModuleComments, t2, t3), t4 = t4.get$iterator(t4), t5 = type$.CssComment_2; t4.moveNext$0();) { + t6 = t4.get$current(t4); + module = t6._0; + result = A.List_List$from(t6._1, false, t5); + result.fixed$length = Array; + result.immutable$list = Array; + t1.$indexSet(0, module, result); + } + t1 = A.ConstantMap_ConstantMap$from(t1, t2, t3); + t2 = A._EnvironmentModule__makeModulesByVariable2(forwarded); + t3 = A._EnvironmentModule__memberMap2(B.JSArray_methods.get$first(environment._async_environment0$_variables), forwarded.map$1$1(0, new A._EnvironmentModule__EnvironmentModule_closure17(), type$.Map_String_Value_2), type$.Value_2); + t4 = A._EnvironmentModule__memberMap2(B.JSArray_methods.get$first(environment._async_environment0$_variableNodes), forwarded.map$1$1(0, new A._EnvironmentModule__EnvironmentModule_closure18(), type$.Map_String_AstNode_2), type$.AstNode_2); + t5 = type$.Map_String_AsyncCallable_2; + t6 = type$.AsyncCallable_2; + t7 = A._EnvironmentModule__memberMap2(B.JSArray_methods.get$first(environment._async_environment0$_functions), forwarded.map$1$1(0, new A._EnvironmentModule__EnvironmentModule_closure19(), t5), t6); + t6 = A._EnvironmentModule__memberMap2(B.JSArray_methods.get$first(environment._async_environment0$_mixins), forwarded.map$1$1(0, new A._EnvironmentModule__EnvironmentModule_closure20(), t5), t6); + t5 = J.get$isNotEmpty$asx(css.get$children(css)) || preModuleComments.get$isNotEmpty(preModuleComments) || B.JSArray_methods.any$1(environment._async_environment0$_allModules, new A._EnvironmentModule__EnvironmentModule_closure21()); + return A._EnvironmentModule$_2(environment, css, t1, extensionStore, t2, t3, t4, t7, t6, t5, !extensionStore.get$isEmpty(extensionStore) || B.JSArray_methods.any$1(environment._async_environment0$_allModules, new A._EnvironmentModule__EnvironmentModule_closure22())); + }, + _EnvironmentModule__makeModulesByVariable2(forwarded) { + var modulesByVariable, t1, t2, t3, t4, t5; + if (forwarded.get$isEmpty(forwarded)) + return B.Map_empty16; + modulesByVariable = A.LinkedHashMap_LinkedHashMap$_empty(type$.String, type$.Module_AsyncCallable_2); + for (t1 = forwarded.get$iterator(forwarded); t1.moveNext$0();) { + t2 = t1.get$current(t1); + if (t2 instanceof A._EnvironmentModule2) { + for (t3 = t2._async_environment0$_modulesByVariable, t3 = t3.get$values(t3), t3 = t3.get$iterator(t3); t3.moveNext$0();) { + t4 = t3.get$current(t3); + t5 = t4.get$variables(); + A.setAll0(modulesByVariable, t5.get$keys(t5), t4); + } + A.setAll0(modulesByVariable, J.get$keys$z(B.JSArray_methods.get$first(t2._async_environment0$_environment._async_environment0$_variables)), t2); + } else { + t3 = t2.get$variables(); + A.setAll0(modulesByVariable, t3.get$keys(t3), t2); + } + } + return modulesByVariable; + }, + _EnvironmentModule__memberMap2(localMap, otherMaps, $V) { + var t1, t2, t3; + localMap = new A.PublicMemberMapView0(localMap, $V._eval$1("PublicMemberMapView0<0>")); + if (otherMaps.get$isEmpty(otherMaps)) + return localMap; + t1 = A._setArrayType([], $V._eval$1("JSArray>")); + for (t2 = otherMaps.get$iterator(otherMaps); t2.moveNext$0();) { + t3 = t2.get$current(t2); + if (t3.get$isNotEmpty(t3)) + t1.push(t3); + } + t1.push(localMap); + if (t1.length === 1) + return localMap; + return A.MergedMapView$0(t1, type$.String, $V); + }, + _EnvironmentModule$_2(_environment, css, preModuleComments, extensionStore, _modulesByVariable, variables, variableNodes, functions, mixins, transitivelyContainsCss, transitivelyContainsExtensions) { + return new A._EnvironmentModule2(_environment._async_environment0$_allModules, variables, variableNodes, functions, mixins, extensionStore, css, preModuleComments, transitivelyContainsCss, transitivelyContainsExtensions, _environment, _modulesByVariable); + }, + AsyncEnvironment0: function AsyncEnvironment0(t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14) { + var _ = this; + _._async_environment0$_modules = t0; + _._async_environment0$_namespaceNodes = t1; + _._async_environment0$_globalModules = t2; + _._async_environment0$_importedModules = t3; + _._async_environment0$_forwardedModules = t4; + _._async_environment0$_nestedForwardedModules = t5; + _._async_environment0$_allModules = t6; + _._async_environment0$_variables = t7; + _._async_environment0$_variableNodes = t8; + _._async_environment0$_variableIndices = t9; + _._async_environment0$_functions = t10; + _._async_environment0$_functionIndices = t11; + _._async_environment0$_mixins = t12; + _._async_environment0$_mixinIndices = t13; + _._async_environment0$_content = t14; + _._async_environment0$_inMixin = false; + _._async_environment0$_inSemiGlobalScope = true; + _._async_environment0$_lastVariableIndex = _._async_environment0$_lastVariableName = null; + }, + AsyncEnvironment__getVariableFromGlobalModule_closure0: function AsyncEnvironment__getVariableFromGlobalModule_closure0(t0) { + this.name = t0; + }, + AsyncEnvironment_setVariable_closure2: function AsyncEnvironment_setVariable_closure2(t0, t1) { + this.$this = t0; + this.name = t1; + }, + AsyncEnvironment_setVariable_closure3: function AsyncEnvironment_setVariable_closure3(t0) { + this.name = t0; + }, + AsyncEnvironment_setVariable_closure4: function AsyncEnvironment_setVariable_closure4(t0, t1) { + this.$this = t0; + this.name = t1; + }, + AsyncEnvironment__getFunctionFromGlobalModule_closure0: function AsyncEnvironment__getFunctionFromGlobalModule_closure0(t0) { + this.name = t0; + }, + AsyncEnvironment__getMixinFromGlobalModule_closure0: function AsyncEnvironment__getMixinFromGlobalModule_closure0(t0) { + this.name = t0; + }, + AsyncEnvironment_toModule_closure0: function AsyncEnvironment_toModule_closure0() { + }, + AsyncEnvironment_toDummyModule_closure0: function AsyncEnvironment_toDummyModule_closure0() { + }, + _EnvironmentModule2: function _EnvironmentModule2(t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11) { + var _ = this; + _.upstream = t0; + _.variables = t1; + _.variableNodes = t2; + _.functions = t3; + _.mixins = t4; + _.extensionStore = t5; + _.css = t6; + _.preModuleComments = t7; + _.transitivelyContainsCss = t8; + _.transitivelyContainsExtensions = t9; + _._async_environment0$_environment = t10; + _._async_environment0$_modulesByVariable = t11; + }, + _EnvironmentModule__EnvironmentModule_closure17: function _EnvironmentModule__EnvironmentModule_closure17() { + }, + _EnvironmentModule__EnvironmentModule_closure18: function _EnvironmentModule__EnvironmentModule_closure18() { + }, + _EnvironmentModule__EnvironmentModule_closure19: function _EnvironmentModule__EnvironmentModule_closure19() { + }, + _EnvironmentModule__EnvironmentModule_closure20: function _EnvironmentModule__EnvironmentModule_closure20() { + }, + _EnvironmentModule__EnvironmentModule_closure21: function _EnvironmentModule__EnvironmentModule_closure21() { + }, + _EnvironmentModule__EnvironmentModule_closure22: function _EnvironmentModule__EnvironmentModule_closure22() { + }, + _EvaluateVisitor$2(functions, importCache, logger, nodeImporter, quietDeps, sourceMap) { + var t4, + t1 = type$.Uri, + t2 = type$.Module_AsyncCallable_2, + t3 = A._setArrayType([], type$.JSArray_Record_2_String_and_AstNode_2); + if (importCache == null) + t4 = nodeImporter == null ? A.AsyncImportCache$none(logger) : null; + else + t4 = importCache; + t1 = new A._EvaluateVisitor2(t4, nodeImporter, A.LinkedHashMap_LinkedHashMap$_empty(type$.String, type$.AsyncCallable_2), A.LinkedHashMap_LinkedHashMap$_empty(t1, t2), A.LinkedHashMap_LinkedHashMap$_empty(t1, t2), A.LinkedHashMap_LinkedHashMap$_empty(t1, type$.Configuration_2), A.LinkedHashMap_LinkedHashMap$_empty(t1, type$.AstNode_2), logger, A.LinkedHashSet_LinkedHashSet$_empty(type$.Record_2_String_and_SourceSpan), quietDeps, sourceMap, A.AsyncEnvironment$0(), A.LinkedHashSet_LinkedHashSet$_empty(t1), A.LinkedHashMap_LinkedHashMap$_empty(t1, type$.nullable_AstNode_2), t3, B.Configuration_Map_empty_null0); + t1._EvaluateVisitor$6$functions$importCache$logger$nodeImporter$quietDeps$sourceMap2(functions, importCache, logger, nodeImporter, quietDeps, sourceMap); + return t1; + }, + _EvaluateVisitor2: function _EvaluateVisitor2(t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15) { + var _ = this; + _._async_evaluate0$_importCache = t0; + _._async_evaluate0$_nodeImporter = t1; + _._async_evaluate0$_builtInFunctions = t2; + _._async_evaluate0$_builtInModules = t3; + _._async_evaluate0$_modules = t4; + _._async_evaluate0$_moduleConfigurations = t5; + _._async_evaluate0$_moduleNodes = t6; + _._async_evaluate0$_logger = t7; + _._async_evaluate0$_warningsEmitted = t8; + _._async_evaluate0$_quietDeps = t9; + _._async_evaluate0$_sourceMap = t10; + _._async_evaluate0$_environment = t11; + _._async_evaluate0$_declarationName = _._async_evaluate0$__parent = _._async_evaluate0$_mediaQuerySources = _._async_evaluate0$_mediaQueries = _._async_evaluate0$_styleRuleIgnoringAtRoot = null; + _._async_evaluate0$_member = "root stylesheet"; + _._async_evaluate0$_importSpan = _._async_evaluate0$_callableNode = _._async_evaluate0$_currentCallable = null; + _._async_evaluate0$_inSupportsDeclaration = _._async_evaluate0$_inKeyframes = _._async_evaluate0$_atRootExcludingStyleRule = _._async_evaluate0$_inUnknownAtRule = _._async_evaluate0$_inFunction = false; + _._async_evaluate0$_loadedUrls = t12; + _._async_evaluate0$_activeModules = t13; + _._async_evaluate0$_stack = t14; + _._async_evaluate0$_importer = null; + _._async_evaluate0$_inDependency = false; + _._async_evaluate0$__extensionStore = _._async_evaluate0$_preModuleComments = _._async_evaluate0$_outOfOrderImports = _._async_evaluate0$__endOfImports = _._async_evaluate0$__root = _._async_evaluate0$__stylesheet = null; + _._async_evaluate0$_configuration = t15; + }, + _EvaluateVisitor_closure38: function _EvaluateVisitor_closure38(t0) { + this.$this = t0; + }, + _EvaluateVisitor_closure39: function _EvaluateVisitor_closure39(t0) { + this.$this = t0; + }, + _EvaluateVisitor_closure40: function _EvaluateVisitor_closure40(t0) { + this.$this = t0; + }, + _EvaluateVisitor_closure41: function _EvaluateVisitor_closure41(t0) { + this.$this = t0; + }, + _EvaluateVisitor_closure42: function _EvaluateVisitor_closure42(t0) { + this.$this = t0; + }, + _EvaluateVisitor_closure43: function _EvaluateVisitor_closure43(t0) { + this.$this = t0; + }, + _EvaluateVisitor_closure44: function _EvaluateVisitor_closure44(t0) { + this.$this = t0; + }, + _EvaluateVisitor_closure45: function _EvaluateVisitor_closure45(t0) { + this.$this = t0; + }, + _EvaluateVisitor_closure46: function _EvaluateVisitor_closure46(t0) { + this.$this = t0; + }, + _EvaluateVisitor__closure14: function _EvaluateVisitor__closure14(t0, t1, t2) { + this.$this = t0; + this.name = t1; + this.module = t2; + }, + _EvaluateVisitor_closure47: function _EvaluateVisitor_closure47(t0) { + this.$this = t0; + }, + _EvaluateVisitor__closure13: function _EvaluateVisitor__closure13(t0, t1, t2) { + this.$this = t0; + this.name = t1; + this.module = t2; + }, + _EvaluateVisitor_closure48: function _EvaluateVisitor_closure48(t0) { + this.$this = t0; + }, + _EvaluateVisitor_closure49: function _EvaluateVisitor_closure49(t0) { + this.$this = t0; + }, + _EvaluateVisitor__closure11: function _EvaluateVisitor__closure11(t0, t1, t2) { + this.values = t0; + this.span = t1; + this.callableNode = t2; + }, + _EvaluateVisitor__closure12: function _EvaluateVisitor__closure12(t0) { + this.$this = t0; + }, + _EvaluateVisitor_closure50: function _EvaluateVisitor_closure50(t0) { + this.$this = t0; + }, + _EvaluateVisitor_run_closure2: function _EvaluateVisitor_run_closure2(t0, t1, t2) { + this.$this = t0; + this.node = t1; + this.importer = t2; + }, + _EvaluateVisitor_run__closure2: function _EvaluateVisitor_run__closure2(t0, t1, t2) { + this.$this = t0; + this.importer = t1; + this.node = t2; + }, + _EvaluateVisitor__loadModule_closure5: function _EvaluateVisitor__loadModule_closure5(t0, t1) { + this._box_1 = t0; + this.callback = t1; + }, + _EvaluateVisitor__loadModule_closure6: function _EvaluateVisitor__loadModule_closure6(t0, t1, t2, t3, t4, t5, t6) { + var _ = this; + _.$this = t0; + _.url = t1; + _.nodeWithSpan = t2; + _.baseUrl = t3; + _.namesInErrors = t4; + _.configuration = t5; + _.callback = t6; + }, + _EvaluateVisitor__loadModule__closure5: function _EvaluateVisitor__loadModule__closure5(t0, t1) { + this.$this = t0; + this.message = t1; + }, + _EvaluateVisitor__loadModule__closure6: function _EvaluateVisitor__loadModule__closure6(t0, t1, t2) { + this._box_0 = t0; + this.callback = t1; + this.firstLoad = t2; + }, + _EvaluateVisitor__execute_closure2: function _EvaluateVisitor__execute_closure2(t0, t1, t2, t3, t4, t5, t6) { + var _ = this; + _.$this = t0; + _.importer = t1; + _.stylesheet = t2; + _.extensionStore = t3; + _.configuration = t4; + _.css = t5; + _.preModuleComments = t6; + }, + _EvaluateVisitor__combineCss_closure5: function _EvaluateVisitor__combineCss_closure5() { + }, + _EvaluateVisitor__combineCss_closure6: function _EvaluateVisitor__combineCss_closure6(t0) { + this.selectors = t0; + }, + _EvaluateVisitor__combineCss_visitModule2: function _EvaluateVisitor__combineCss_visitModule2(t0, t1, t2, t3, t4, t5) { + var _ = this; + _.$this = t0; + _.seen = t1; + _.clone = t2; + _.css = t3; + _.imports = t4; + _.sorted = t5; + }, + _EvaluateVisitor__extendModules_closure5: function _EvaluateVisitor__extendModules_closure5(t0) { + this.originalSelectors = t0; + }, + _EvaluateVisitor__extendModules_closure6: function _EvaluateVisitor__extendModules_closure6() { + }, + _EvaluateVisitor_visitAtRootRule_closure5: function _EvaluateVisitor_visitAtRootRule_closure5(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitAtRootRule_closure6: function _EvaluateVisitor_visitAtRootRule_closure6(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor__scopeForAtRoot_closure17: function _EvaluateVisitor__scopeForAtRoot_closure17(t0, t1, t2) { + this.$this = t0; + this.newParent = t1; + this.node = t2; + }, + _EvaluateVisitor__scopeForAtRoot_closure18: function _EvaluateVisitor__scopeForAtRoot_closure18(t0, t1) { + this.$this = t0; + this.innerScope = t1; + }, + _EvaluateVisitor__scopeForAtRoot_closure19: function _EvaluateVisitor__scopeForAtRoot_closure19(t0, t1) { + this.$this = t0; + this.innerScope = t1; + }, + _EvaluateVisitor__scopeForAtRoot__closure2: function _EvaluateVisitor__scopeForAtRoot__closure2(t0, t1) { + this.innerScope = t0; + this.callback = t1; + }, + _EvaluateVisitor__scopeForAtRoot_closure20: function _EvaluateVisitor__scopeForAtRoot_closure20(t0, t1) { + this.$this = t0; + this.innerScope = t1; + }, + _EvaluateVisitor__scopeForAtRoot_closure21: function _EvaluateVisitor__scopeForAtRoot_closure21() { + }, + _EvaluateVisitor__scopeForAtRoot_closure22: function _EvaluateVisitor__scopeForAtRoot_closure22(t0, t1) { + this.$this = t0; + this.innerScope = t1; + }, + _EvaluateVisitor_visitContentRule_closure2: function _EvaluateVisitor_visitContentRule_closure2(t0, t1) { + this.$this = t0; + this.content = t1; + }, + _EvaluateVisitor_visitDeclaration_closure2: function _EvaluateVisitor_visitDeclaration_closure2(t0, t1) { + this._box_0 = t0; + this.$this = t1; + }, + _EvaluateVisitor_visitEachRule_closure8: function _EvaluateVisitor_visitEachRule_closure8(t0, t1, t2) { + this._box_0 = t0; + this.$this = t1; + this.nodeWithSpan = t2; + }, + _EvaluateVisitor_visitEachRule_closure9: function _EvaluateVisitor_visitEachRule_closure9(t0, t1, t2) { + this._box_0 = t0; + this.$this = t1; + this.nodeWithSpan = t2; + }, + _EvaluateVisitor_visitEachRule_closure10: function _EvaluateVisitor_visitEachRule_closure10(t0, t1, t2, t3) { + var _ = this; + _.$this = t0; + _.list = t1; + _.setVariables = t2; + _.node = t3; + }, + _EvaluateVisitor_visitEachRule__closure2: function _EvaluateVisitor_visitEachRule__closure2(t0, t1, t2) { + this.$this = t0; + this.setVariables = t1; + this.node = t2; + }, + _EvaluateVisitor_visitEachRule___closure2: function _EvaluateVisitor_visitEachRule___closure2(t0) { + this.$this = t0; + }, + _EvaluateVisitor_visitAtRule_closure8: function _EvaluateVisitor_visitAtRule_closure8(t0) { + this.$this = t0; + }, + _EvaluateVisitor_visitAtRule_closure9: function _EvaluateVisitor_visitAtRule_closure9(t0, t1, t2) { + this.$this = t0; + this.name = t1; + this.children = t2; + }, + _EvaluateVisitor_visitAtRule__closure2: function _EvaluateVisitor_visitAtRule__closure2(t0, t1) { + this.$this = t0; + this.children = t1; + }, + _EvaluateVisitor_visitAtRule_closure10: function _EvaluateVisitor_visitAtRule_closure10() { + }, + _EvaluateVisitor_visitForRule_closure14: function _EvaluateVisitor_visitForRule_closure14(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitForRule_closure15: function _EvaluateVisitor_visitForRule_closure15(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitForRule_closure16: function _EvaluateVisitor_visitForRule_closure16(t0) { + this.fromNumber = t0; + }, + _EvaluateVisitor_visitForRule_closure17: function _EvaluateVisitor_visitForRule_closure17(t0, t1) { + this.toNumber = t0; + this.fromNumber = t1; + }, + _EvaluateVisitor_visitForRule_closure18: function _EvaluateVisitor_visitForRule_closure18(t0, t1, t2, t3, t4, t5) { + var _ = this; + _._box_0 = t0; + _.$this = t1; + _.node = t2; + _.from = t3; + _.direction = t4; + _.fromNumber = t5; + }, + _EvaluateVisitor_visitForRule__closure2: function _EvaluateVisitor_visitForRule__closure2(t0) { + this.$this = t0; + }, + _EvaluateVisitor_visitForwardRule_closure5: function _EvaluateVisitor_visitForwardRule_closure5(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitForwardRule_closure6: function _EvaluateVisitor_visitForwardRule_closure6(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor__registerCommentsForModule_closure2: function _EvaluateVisitor__registerCommentsForModule_closure2() { + }, + _EvaluateVisitor_visitIfRule_closure2: function _EvaluateVisitor_visitIfRule_closure2(t0) { + this.$this = t0; + }, + _EvaluateVisitor_visitIfRule__closure2: function _EvaluateVisitor_visitIfRule__closure2(t0, t1) { + this.$this = t0; + this.clause = t1; + }, + _EvaluateVisitor_visitIfRule___closure2: function _EvaluateVisitor_visitIfRule___closure2(t0) { + this.$this = t0; + }, + _EvaluateVisitor__visitDynamicImport_closure2: function _EvaluateVisitor__visitDynamicImport_closure2(t0, t1) { + this.$this = t0; + this.$import = t1; + }, + _EvaluateVisitor__visitDynamicImport__closure11: function _EvaluateVisitor__visitDynamicImport__closure11(t0) { + this.$this = t0; + }, + _EvaluateVisitor__visitDynamicImport__closure12: function _EvaluateVisitor__visitDynamicImport__closure12() { + }, + _EvaluateVisitor__visitDynamicImport__closure13: function _EvaluateVisitor__visitDynamicImport__closure13() { + }, + _EvaluateVisitor__visitDynamicImport__closure14: function _EvaluateVisitor__visitDynamicImport__closure14(t0, t1, t2, t3, t4) { + var _ = this; + _._box_0 = t0; + _.$this = t1; + _.loadsUserDefinedModules = t2; + _.environment = t3; + _.children = t4; + }, + _EvaluateVisitor__applyMixin_closure5: function _EvaluateVisitor__applyMixin_closure5(t0, t1, t2, t3) { + var _ = this; + _.$this = t0; + _.$arguments = t1; + _.mixin = t2; + _.nodeWithSpanWithoutContent = t3; + }, + _EvaluateVisitor__applyMixin__closure6: function _EvaluateVisitor__applyMixin__closure6(t0, t1, t2, t3) { + var _ = this; + _.$this = t0; + _.$arguments = t1; + _.mixin = t2; + _.nodeWithSpanWithoutContent = t3; + }, + _EvaluateVisitor__applyMixin_closure6: function _EvaluateVisitor__applyMixin_closure6(t0, t1, t2, t3) { + var _ = this; + _.$this = t0; + _.contentCallable = t1; + _.mixin = t2; + _.nodeWithSpanWithoutContent = t3; + }, + _EvaluateVisitor__applyMixin__closure5: function _EvaluateVisitor__applyMixin__closure5(t0, t1, t2) { + this.$this = t0; + this.mixin = t1; + this.nodeWithSpanWithoutContent = t2; + }, + _EvaluateVisitor__applyMixin___closure2: function _EvaluateVisitor__applyMixin___closure2(t0, t1, t2) { + this.$this = t0; + this.mixin = t1; + this.nodeWithSpanWithoutContent = t2; + }, + _EvaluateVisitor__applyMixin____closure2: function _EvaluateVisitor__applyMixin____closure2(t0, t1) { + this.$this = t0; + this.statement = t1; + }, + _EvaluateVisitor_visitIncludeRule_closure8: function _EvaluateVisitor_visitIncludeRule_closure8(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitIncludeRule_closure9: function _EvaluateVisitor_visitIncludeRule_closure9(t0) { + this.$this = t0; + }, + _EvaluateVisitor_visitIncludeRule_closure10: function _EvaluateVisitor_visitIncludeRule_closure10(t0) { + this.node = t0; + }, + _EvaluateVisitor_visitMediaRule_closure8: function _EvaluateVisitor_visitMediaRule_closure8(t0, t1) { + this.$this = t0; + this.queries = t1; + }, + _EvaluateVisitor_visitMediaRule_closure9: function _EvaluateVisitor_visitMediaRule_closure9(t0, t1, t2, t3, t4) { + var _ = this; + _.$this = t0; + _.mergedQueries = t1; + _.queries = t2; + _.mergedSources = t3; + _.node = t4; + }, + _EvaluateVisitor_visitMediaRule__closure2: function _EvaluateVisitor_visitMediaRule__closure2(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitMediaRule___closure2: function _EvaluateVisitor_visitMediaRule___closure2(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitMediaRule_closure10: function _EvaluateVisitor_visitMediaRule_closure10(t0) { + this.mergedSources = t0; + }, + _EvaluateVisitor_visitStyleRule_closure14: function _EvaluateVisitor_visitStyleRule_closure14(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitStyleRule_closure15: function _EvaluateVisitor_visitStyleRule_closure15() { + }, + _EvaluateVisitor_visitStyleRule_closure16: function _EvaluateVisitor_visitStyleRule_closure16(t0, t1, t2) { + this.$this = t0; + this.rule = t1; + this.node = t2; + }, + _EvaluateVisitor_visitStyleRule__closure2: function _EvaluateVisitor_visitStyleRule__closure2(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitStyleRule_closure17: function _EvaluateVisitor_visitStyleRule_closure17() { + }, + _EvaluateVisitor_visitStyleRule_closure18: function _EvaluateVisitor_visitStyleRule_closure18() { + }, + _EvaluateVisitor_visitSupportsRule_closure5: function _EvaluateVisitor_visitSupportsRule_closure5(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitSupportsRule__closure2: function _EvaluateVisitor_visitSupportsRule__closure2(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitSupportsRule_closure6: function _EvaluateVisitor_visitSupportsRule_closure6() { + }, + _EvaluateVisitor__visitSupportsCondition_closure2: function _EvaluateVisitor__visitSupportsCondition_closure2(t0, t1) { + this._box_0 = t0; + this.$this = t1; + }, + _EvaluateVisitor_visitVariableDeclaration_closure8: function _EvaluateVisitor_visitVariableDeclaration_closure8(t0, t1, t2) { + this._box_0 = t0; + this.$this = t1; + this.node = t2; + }, + _EvaluateVisitor_visitVariableDeclaration_closure9: function _EvaluateVisitor_visitVariableDeclaration_closure9(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitVariableDeclaration_closure10: function _EvaluateVisitor_visitVariableDeclaration_closure10(t0, t1, t2) { + this.$this = t0; + this.node = t1; + this.value = t2; + }, + _EvaluateVisitor_visitUseRule_closure2: function _EvaluateVisitor_visitUseRule_closure2(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitWarnRule_closure2: function _EvaluateVisitor_visitWarnRule_closure2(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitWhileRule_closure2: function _EvaluateVisitor_visitWhileRule_closure2(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitWhileRule__closure2: function _EvaluateVisitor_visitWhileRule__closure2(t0) { + this.$this = t0; + }, + _EvaluateVisitor_visitBinaryOperationExpression_closure2: function _EvaluateVisitor_visitBinaryOperationExpression_closure2(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor__slash_recommendation2: function _EvaluateVisitor__slash_recommendation2() { + }, + _EvaluateVisitor_visitVariableExpression_closure2: function _EvaluateVisitor_visitVariableExpression_closure2(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitUnaryOperationExpression_closure2: function _EvaluateVisitor_visitUnaryOperationExpression_closure2(t0, t1) { + this.node = t0; + this.operand = t1; + }, + _EvaluateVisitor_visitListExpression_closure2: function _EvaluateVisitor_visitListExpression_closure2(t0) { + this.$this = t0; + }, + _EvaluateVisitor_visitFunctionExpression_closure8: function _EvaluateVisitor_visitFunctionExpression_closure8(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitFunctionExpression_closure9: function _EvaluateVisitor_visitFunctionExpression_closure9() { + }, + _EvaluateVisitor_visitFunctionExpression_closure10: function _EvaluateVisitor_visitFunctionExpression_closure10(t0, t1, t2) { + this._box_0 = t0; + this.$this = t1; + this.node = t2; + }, + _EvaluateVisitor__checkCalculationArguments_check2: function _EvaluateVisitor__checkCalculationArguments_check2(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor__visitCalculationExpression_closure2: function _EvaluateVisitor__visitCalculationExpression_closure2(t0, t1, t2, t3) { + var _ = this; + _._box_0 = t0; + _.$this = t1; + _.node = t2; + _.inLegacySassFunction = t3; + }, + _EvaluateVisitor_visitInterpolatedFunctionExpression_closure2: function _EvaluateVisitor_visitInterpolatedFunctionExpression_closure2(t0, t1, t2) { + this.$this = t0; + this.node = t1; + this.$function = t2; + }, + _EvaluateVisitor__runUserDefinedCallable_closure2: function _EvaluateVisitor__runUserDefinedCallable_closure2(t0, t1, t2, t3, t4, t5) { + var _ = this; + _.$this = t0; + _.callable = t1; + _.evaluated = t2; + _.nodeWithSpan = t3; + _.run = t4; + _.V = t5; + }, + _EvaluateVisitor__runUserDefinedCallable__closure2: function _EvaluateVisitor__runUserDefinedCallable__closure2(t0, t1, t2, t3, t4, t5) { + var _ = this; + _.$this = t0; + _.evaluated = t1; + _.callable = t2; + _.nodeWithSpan = t3; + _.run = t4; + _.V = t5; + }, + _EvaluateVisitor__runUserDefinedCallable___closure2: function _EvaluateVisitor__runUserDefinedCallable___closure2(t0, t1, t2, t3, t4, t5) { + var _ = this; + _.$this = t0; + _.evaluated = t1; + _.callable = t2; + _.nodeWithSpan = t3; + _.run = t4; + _.V = t5; + }, + _EvaluateVisitor__runUserDefinedCallable____closure2: function _EvaluateVisitor__runUserDefinedCallable____closure2() { + }, + _EvaluateVisitor__runFunctionCallable_closure2: function _EvaluateVisitor__runFunctionCallable_closure2(t0, t1) { + this.$this = t0; + this.callable = t1; + }, + _EvaluateVisitor__runBuiltInCallable_closure8: function _EvaluateVisitor__runBuiltInCallable_closure8(t0, t1, t2) { + this._box_0 = t0; + this.evaluated = t1; + this.namedSet = t2; + }, + _EvaluateVisitor__runBuiltInCallable_closure9: function _EvaluateVisitor__runBuiltInCallable_closure9(t0, t1) { + this._box_0 = t0; + this.evaluated = t1; + }, + _EvaluateVisitor__runBuiltInCallable_closure10: function _EvaluateVisitor__runBuiltInCallable_closure10() { + }, + _EvaluateVisitor__evaluateArguments_closure11: function _EvaluateVisitor__evaluateArguments_closure11() { + }, + _EvaluateVisitor__evaluateArguments_closure12: function _EvaluateVisitor__evaluateArguments_closure12(t0, t1) { + this.$this = t0; + this.restNodeForSpan = t1; + }, + _EvaluateVisitor__evaluateArguments_closure13: function _EvaluateVisitor__evaluateArguments_closure13(t0, t1, t2, t3) { + var _ = this; + _.$this = t0; + _.named = t1; + _.restNodeForSpan = t2; + _.namedNodes = t3; + }, + _EvaluateVisitor__evaluateArguments_closure14: function _EvaluateVisitor__evaluateArguments_closure14() { + }, + _EvaluateVisitor__evaluateMacroArguments_closure11: function _EvaluateVisitor__evaluateMacroArguments_closure11(t0) { + this.restArgs = t0; + }, + _EvaluateVisitor__evaluateMacroArguments_closure12: function _EvaluateVisitor__evaluateMacroArguments_closure12(t0, t1, t2) { + this.$this = t0; + this.restNodeForSpan = t1; + this.restArgs = t2; + }, + _EvaluateVisitor__evaluateMacroArguments_closure13: function _EvaluateVisitor__evaluateMacroArguments_closure13(t0, t1, t2, t3) { + var _ = this; + _.$this = t0; + _.named = t1; + _.restNodeForSpan = t2; + _.restArgs = t3; + }, + _EvaluateVisitor__evaluateMacroArguments_closure14: function _EvaluateVisitor__evaluateMacroArguments_closure14(t0, t1, t2) { + this.$this = t0; + this.keywordRestNodeForSpan = t1; + this.keywordRestArgs = t2; + }, + _EvaluateVisitor__addRestMap_closure2: function _EvaluateVisitor__addRestMap_closure2(t0, t1, t2, t3, t4, t5) { + var _ = this; + _.$this = t0; + _.values = t1; + _.convert = t2; + _.expressionNode = t3; + _.map = t4; + _.nodeWithSpan = t5; + }, + _EvaluateVisitor__verifyArguments_closure2: function _EvaluateVisitor__verifyArguments_closure2(t0, t1, t2) { + this.$arguments = t0; + this.positional = t1; + this.named = t2; + }, + _EvaluateVisitor_visitCssAtRule_closure5: function _EvaluateVisitor_visitCssAtRule_closure5(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitCssAtRule_closure6: function _EvaluateVisitor_visitCssAtRule_closure6() { + }, + _EvaluateVisitor_visitCssKeyframeBlock_closure5: function _EvaluateVisitor_visitCssKeyframeBlock_closure5(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitCssKeyframeBlock_closure6: function _EvaluateVisitor_visitCssKeyframeBlock_closure6() { + }, + _EvaluateVisitor_visitCssMediaRule_closure8: function _EvaluateVisitor_visitCssMediaRule_closure8(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitCssMediaRule_closure9: function _EvaluateVisitor_visitCssMediaRule_closure9(t0, t1, t2, t3) { + var _ = this; + _.$this = t0; + _.mergedQueries = t1; + _.node = t2; + _.mergedSources = t3; + }, + _EvaluateVisitor_visitCssMediaRule__closure2: function _EvaluateVisitor_visitCssMediaRule__closure2(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitCssMediaRule___closure2: function _EvaluateVisitor_visitCssMediaRule___closure2(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitCssMediaRule_closure10: function _EvaluateVisitor_visitCssMediaRule_closure10(t0) { + this.mergedSources = t0; + }, + _EvaluateVisitor_visitCssStyleRule_closure5: function _EvaluateVisitor_visitCssStyleRule_closure5(t0, t1, t2) { + this.$this = t0; + this.rule = t1; + this.node = t2; + }, + _EvaluateVisitor_visitCssStyleRule__closure2: function _EvaluateVisitor_visitCssStyleRule__closure2(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitCssStyleRule_closure6: function _EvaluateVisitor_visitCssStyleRule_closure6() { + }, + _EvaluateVisitor_visitCssSupportsRule_closure5: function _EvaluateVisitor_visitCssSupportsRule_closure5(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitCssSupportsRule__closure2: function _EvaluateVisitor_visitCssSupportsRule__closure2(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitCssSupportsRule_closure6: function _EvaluateVisitor_visitCssSupportsRule_closure6() { + }, + _EvaluateVisitor__performInterpolationHelper_closure2: function _EvaluateVisitor__performInterpolationHelper_closure2(t0) { + this.interpolation = t0; + }, + _EvaluateVisitor__serialize_closure2: function _EvaluateVisitor__serialize_closure2(t0, t1) { + this.value = t0; + this.quote = t1; + }, + _EvaluateVisitor__expressionNode_closure2: function _EvaluateVisitor__expressionNode_closure2(t0, t1) { + this.$this = t0; + this.expression = t1; + }, + _EvaluateVisitor__withoutSlash_recommendation2: function _EvaluateVisitor__withoutSlash_recommendation2() { + }, + _EvaluateVisitor__stackFrame_closure2: function _EvaluateVisitor__stackFrame_closure2(t0) { + this.$this = t0; + }, + _ImportedCssVisitor2: function _ImportedCssVisitor2(t0) { + this._async_evaluate0$_visitor = t0; + }, + _ImportedCssVisitor_visitCssAtRule_closure2: function _ImportedCssVisitor_visitCssAtRule_closure2() { + }, + _ImportedCssVisitor_visitCssMediaRule_closure2: function _ImportedCssVisitor_visitCssMediaRule_closure2(t0) { + this.hasBeenMerged = t0; + }, + _ImportedCssVisitor_visitCssStyleRule_closure2: function _ImportedCssVisitor_visitCssStyleRule_closure2() { + }, + _ImportedCssVisitor_visitCssSupportsRule_closure2: function _ImportedCssVisitor_visitCssSupportsRule_closure2() { + }, + _EvaluationContext2: function _EvaluationContext2(t0, t1) { + this._async_evaluate0$_visitor = t0; + this._async_evaluate0$_defaultWarnNodeWithSpan = t1; + }, + JSToDartAsyncFileImporter: function JSToDartAsyncFileImporter(t0) { + this._findFileUrl = t0; + }, + JSToDartAsyncFileImporter_canonicalize_closure: function JSToDartAsyncFileImporter_canonicalize_closure(t0, t1) { + this.$this = t0; + this.url = t1; + }, + AsyncImportCache$(importers, loadPaths, logger, packageConfig) { + var t1 = type$.nullable_Record_3_AsyncImporter_and_Uri_and_Uri_originalUrl_2, + t2 = type$.Uri, + t3 = A.AsyncImportCache__toImporters0(importers, loadPaths, packageConfig); + return new A.AsyncImportCache0(t3, logger, A.LinkedHashMap_LinkedHashMap$_empty(type$.Record_2_Uri_and_bool_forImport, t1), A.LinkedHashMap_LinkedHashMap$_empty(type$.Record_4_Uri_and_AsyncImporter_baseImporter_and_nullable_Uri_baseUrl_and_bool_forImport_2, t1), A.LinkedHashMap_LinkedHashMap$_empty(t2, type$.nullable_Stylesheet_2), A.LinkedHashMap_LinkedHashMap$_empty(t2, type$.ImporterResult_2)); + }, + AsyncImportCache$none(logger) { + var t1 = type$.nullable_Record_3_AsyncImporter_and_Uri_and_Uri_originalUrl_2, + t2 = type$.Uri; + return new A.AsyncImportCache0(B.List_empty25, logger, A.LinkedHashMap_LinkedHashMap$_empty(type$.Record_2_Uri_and_bool_forImport, t1), A.LinkedHashMap_LinkedHashMap$_empty(type$.Record_4_Uri_and_AsyncImporter_baseImporter_and_nullable_Uri_baseUrl_and_bool_forImport_2, t1), A.LinkedHashMap_LinkedHashMap$_empty(t2, type$.nullable_Stylesheet_2), A.LinkedHashMap_LinkedHashMap$_empty(t2, type$.ImporterResult_2)); + }, + AsyncImportCache__toImporters0(importers, loadPaths, packageConfig) { + var t1, t2, t3, t4, _i, path, _null = null, + sassPath = A.getEnvironmentVariable0("SASS_PATH"); + if (A.isBrowser()) { + t1 = A._setArrayType([], type$.JSArray_AsyncImporter); + if (importers != null) + B.JSArray_methods.addAll$1(t1, importers); + return t1; + } + t1 = A._setArrayType([], type$.JSArray_AsyncImporter); + if (importers != null) + B.JSArray_methods.addAll$1(t1, importers); + if (loadPaths != null) + for (t2 = J.get$iterator$ax(loadPaths); t2.moveNext$0();) { + t3 = t2.get$current(t2); + t1.push(new A.FilesystemImporter0($.$get$context().absolute$15(t3, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null))); + } + if (sassPath != null) { + t2 = A.isNodeJs() ? self.process : _null; + t3 = sassPath.split(J.$eq$(t2 == null ? _null : J.get$platform$x(t2), "win32") ? ";" : ":"); + t4 = t3.length; + _i = 0; + for (; _i < t4; ++_i) { + path = t3[_i]; + t1.push(new A.FilesystemImporter0($.$get$context().absolute$15(path, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null))); + } + } + return t1; + }, + AsyncImportCache0: function AsyncImportCache0(t0, t1, t2, t3, t4, t5) { + var _ = this; + _._async_import_cache0$_importers = t0; + _._async_import_cache0$_logger = t1; + _._async_import_cache0$_canonicalizeCache = t2; + _._async_import_cache0$_relativeCanonicalizeCache = t3; + _._async_import_cache0$_importCache = t4; + _._async_import_cache0$_resultsCache = t5; + }, + AsyncImportCache_canonicalize_closure1: function AsyncImportCache_canonicalize_closure1(t0, t1, t2, t3, t4) { + var _ = this; + _.$this = t0; + _.baseImporter = t1; + _.baseUrl = t2; + _.url = t3; + _.forImport = t4; + }, + AsyncImportCache_canonicalize_closure2: function AsyncImportCache_canonicalize_closure2(t0, t1, t2, t3) { + var _ = this; + _.$this = t0; + _.url = t1; + _.baseUrl = t2; + _.forImport = t3; + }, + AsyncImportCache__canonicalize_closure1: function AsyncImportCache__canonicalize_closure1(t0, t1) { + this.importer = t0; + this.resolved = t1; + }, + AsyncImportCache__canonicalize__closure0: function AsyncImportCache__canonicalize__closure0(t0, t1) { + this.importer = t0; + this.resolved = t1; + }, + AsyncImportCache__canonicalize_closure2: function AsyncImportCache__canonicalize_closure2(t0, t1) { + this.importer = t0; + this.resolved = t1; + }, + AsyncImportCache_importCanonical_closure0: function AsyncImportCache_importCanonical_closure0(t0, t1, t2, t3, t4) { + var _ = this; + _.$this = t0; + _.importer = t1; + _.canonicalUrl = t2; + _.originalUrl = t3; + _.quiet = t4; + }, + AsyncImportCache_humanize_closure3: function AsyncImportCache_humanize_closure3(t0) { + this.canonicalUrl = t0; + }, + AsyncImportCache_humanize_closure4: function AsyncImportCache_humanize_closure4() { + }, + AsyncImportCache_humanize_closure5: function AsyncImportCache_humanize_closure5() { + }, + AsyncImportCache_humanize_closure6: function AsyncImportCache_humanize_closure6(t0) { + this.canonicalUrl = t0; + }, + AtRootQueryParser$0(contents, logger, url) { + var t1 = A.SpanScanner$(contents, url); + return new A.AtRootQueryParser0(t1, logger, null); + }, + AtRootQueryParser0: function AtRootQueryParser0(t0, t1, t2) { + this.scanner = t0; + this.logger = t1; + this._parser0$_interpolationMap = t2; + }, + AtRootQueryParser_parse_closure0: function AtRootQueryParser_parse_closure0(t0) { + this.$this = t0; + }, + AtRootQuery0: function AtRootQuery0(t0, t1, t2, t3) { + var _ = this; + _.include = t0; + _.names = t1; + _._at_root_query0$_all = t2; + _._at_root_query0$_rule = t3; + }, + AtRootRule$0(children, span, query) { + var t1 = A.List_List$unmodifiable(children, type$.Statement_2), + t2 = B.JSArray_methods.any$1(t1, new A.ParentStatement_closure0()); + return new A.AtRootRule0(query, span, t1, t2); + }, + AtRootRule0: function AtRootRule0(t0, t1, t2, t3) { + var _ = this; + _.query = t0; + _.span = t1; + _.children = t2; + _.hasDeclarations = t3; + }, + ModifiableCssAtRule$0($name, span, childless, value) { + var t1 = A._setArrayType([], type$.JSArray_ModifiableCssNode_2); + return new A.ModifiableCssAtRule0($name, value, childless, span, new A.UnmodifiableListView(t1, type$.UnmodifiableListView_ModifiableCssNode_2), t1); + }, + ModifiableCssAtRule0: function ModifiableCssAtRule0(t0, t1, t2, t3, t4, t5) { + var _ = this; + _.name = t0; + _.value = t1; + _.isChildless = t2; + _.span = t3; + _.children = t4; + _._node$_children = t5; + _._node$_indexInParent = _._node$_parent = null; + _.isGroupEnd = false; + }, + AtRule$0($name, span, children, value) { + var t1 = children == null ? null : A.List_List$unmodifiable(children, type$.Statement_2), + t2 = t1 == null ? null : B.JSArray_methods.any$1(t1, new A.ParentStatement_closure0()); + return new A.AtRule0($name, value, span, t1, t2 === true); + }, + AtRule0: function AtRule0(t0, t1, t2, t3, t4) { + var _ = this; + _.name = t0; + _.value = t1; + _.span = t2; + _.children = t3; + _.hasDeclarations = t4; + }, + AttributeSelector0: function AttributeSelector0(t0, t1, t2, t3, t4) { + var _ = this; + _.name = t0; + _.op = t1; + _.value = t2; + _.modifier = t3; + _.span = t4; + }, + AttributeOperator0: function AttributeOperator0(t0, t1) { + this._attribute0$_text = t0; + this._name = t1; + }, + BinaryOperationExpression0: function BinaryOperationExpression0(t0, t1, t2, t3) { + var _ = this; + _.operator = t0; + _.left = t1; + _.right = t2; + _.allowsSlash = t3; + }, + BinaryOperator0: function BinaryOperator0(t0, t1, t2, t3, t4) { + var _ = this; + _.name = t0; + _.operator = t1; + _.precedence = t2; + _.isAssociative = t3; + _._name = t4; + }, + BooleanExpression0: function BooleanExpression0(t0, t1) { + this.value = t0; + this.span = t1; + }, + booleanClass_closure: function booleanClass_closure() { + }, + booleanClass__closure: function booleanClass__closure() { + }, + legacyBooleanClass_closure: function legacyBooleanClass_closure() { + }, + legacyBooleanClass__closure: function legacyBooleanClass__closure() { + }, + legacyBooleanClass__closure0: function legacyBooleanClass__closure0() { + }, + SassBoolean0: function SassBoolean0(t0) { + this.value = t0; + }, + Box0: function Box0(t0, t1) { + this._box0$_inner = t0; + this.$ti = t1; + }, + ModifiableBox0: function ModifiableBox0(t0, t1) { + this.value = t0; + this.$ti = t1; + }, + BuiltInCallable$function0($name, $arguments, callback, url) { + return new A.BuiltInCallable0($name, A._setArrayType([new A._Record_2(A.ScssParser$0("@function " + $name + "(" + $arguments + ") {", null, url).parseArgumentDeclaration$0(), callback)], type$.JSArray_Record_2_ArgumentDeclaration_and_Value_Function_List_Value_2), false); + }, + BuiltInCallable$mixin0($name, $arguments, callback, acceptsContent, url) { + return new A.BuiltInCallable0($name, A._setArrayType([new A._Record_2(A.ScssParser$0("@mixin " + $name + "(" + $arguments + ") {", null, url).parseArgumentDeclaration$0(), new A.BuiltInCallable$mixin_closure0(callback))], type$.JSArray_Record_2_ArgumentDeclaration_and_Value_Function_List_Value_2), acceptsContent); + }, + BuiltInCallable$overloadedFunction0($name, overloads) { + var t2, t3, t4, t5, t6, args, callback, + t1 = A._setArrayType([], type$.JSArray_Record_2_ArgumentDeclaration_and_Value_Function_List_Value_2); + for (t2 = type$.String, t3 = A.MapExtensions_get_pairs0(overloads, t2, type$.Value_Function_List_Value_2), t3 = t3.get$iterator(t3), t4 = "@function " + $name + "(", t5 = type$.VariableDeclaration_2; t3.moveNext$0();) { + t6 = t3.get$current(t3); + args = t6._0; + callback = t6._1; + t6 = A.SpanScanner$(t4 + args + ") {", null); + t1.push(new A._Record_2(new A.ScssParser0(A.LinkedHashMap_LinkedHashMap$_empty(t2, t5), t6, B.StderrLogger_false0, null).parseArgumentDeclaration$0(), callback)); + } + return new A.BuiltInCallable0($name, t1, false); + }, + BuiltInCallable0: function BuiltInCallable0(t0, t1, t2) { + this.name = t0; + this._built_in$_overloads = t1; + this.acceptsContent = t2; + }, + BuiltInCallable$mixin_closure0: function BuiltInCallable$mixin_closure0(t0) { + this.callback = t0; + }, + BuiltInModule$0($name, functions, mixins, variables, $T) { + var t1 = A._Uri__Uri(null, $name, null, "sass"), + t2 = A.BuiltInModule__callableMap0(functions, $T), + t3 = A.BuiltInModule__callableMap0(mixins, $T), + t4 = variables == null ? B.Map_empty13 : new A.UnmodifiableMapView(variables, type$.UnmodifiableMapView_String_Value_2); + return new A.BuiltInModule0(t1, t2, t3, t4, $T._eval$1("BuiltInModule0<0>")); + }, + BuiltInModule__callableMap0(callables, $T) { + var t2, _i, callable, + t1 = type$.String; + if (callables == null) + t1 = A.LinkedHashMap_LinkedHashMap$_empty(t1, $T); + else { + t1 = A.LinkedHashMap_LinkedHashMap$_empty(t1, $T); + for (t2 = callables.length, _i = 0; _i < callables.length; callables.length === t2 || (0, A.throwConcurrentModificationError)(callables), ++_i) { + callable = callables[_i]; + t1.$indexSet(0, J.get$name$x(callable), callable); + } + t1 = new A.UnmodifiableMapView(t1, type$.$env_1_1_String._bind$1($T)._eval$1("UnmodifiableMapView<1,2>")); + } + return new A.UnmodifiableMapView(t1, type$.$env_1_1_String._bind$1($T)._eval$1("UnmodifiableMapView<1,2>")); + }, + BuiltInModule0: function BuiltInModule0(t0, t1, t2, t3, t4) { + var _ = this; + _.url = t0; + _.functions = t1; + _.mixins = t2; + _.variables = t3; + _.$ti = t4; + }, + _assertCalculationValue(arg) { + var t1; + $label0$0: { + if (!(arg instanceof A.SassNumber0)) + t1 = arg instanceof A.SassString0 && !arg._string0$_hasQuotes || arg instanceof A.SassCalculation0 || arg instanceof A.CalculationOperation0 || arg instanceof A.CalculationInterpolation; + else + t1 = true; + if (t1) { + t1 = null; + break $label0$0; + } + t1 = A.jsThrow0(new self.Error("Argument `" + A.S(arg) + "` must be one of SassNumber, unquoted SassString, SassCalculation, CalculationOperation, CalculationInterpolation")); + } + return t1; + }, + _isValidClampArg(arg) { + var t1; + $label0$0: { + if (!(arg instanceof A.CalculationInterpolation)) + t1 = arg instanceof A.SassString0 && !arg._string0$_hasQuotes; + else + t1 = true; + if (t1) { + t1 = true; + break $label0$0; + } + t1 = false; + break $label0$0; + } + return t1; + }, + calculationClass_closure: function calculationClass_closure() { + }, + calculationClass__closure: function calculationClass__closure() { + }, + calculationClass__closure0: function calculationClass__closure0() { + }, + calculationClass__closure1: function calculationClass__closure1() { + }, + calculationClass__closure2: function calculationClass__closure2() { + }, + calculationClass__closure3: function calculationClass__closure3() { + }, + calculationClass__closure4: function calculationClass__closure4() { + }, + calculationClass__closure5: function calculationClass__closure5() { + }, + calculationOperationClass_closure: function calculationOperationClass_closure() { + }, + calculationOperationClass__closure: function calculationOperationClass__closure() { + }, + calculationOperationClass___closure: function calculationOperationClass___closure(t0) { + this.strOperator = t0; + }, + calculationOperationClass__closure0: function calculationOperationClass__closure0() { + }, + calculationOperationClass__closure1: function calculationOperationClass__closure1() { + }, + calculationOperationClass__closure2: function calculationOperationClass__closure2() { + }, + calculationOperationClass__closure3: function calculationOperationClass__closure3() { + }, + calculationOperationClass__closure4: function calculationOperationClass__closure4() { + }, + calculationInterpolationClass_closure: function calculationInterpolationClass_closure() { + }, + calculationInterpolationClass__closure: function calculationInterpolationClass__closure() { + }, + calculationInterpolationClass__closure0: function calculationInterpolationClass__closure0() { + }, + calculationInterpolationClass__closure1: function calculationInterpolationClass__closure1() { + }, + calculationInterpolationClass__closure2: function calculationInterpolationClass__closure2() { + }, + SassCalculation_calc0(argument) { + var t1, + _0_0 = A.SassCalculation__simplify0(argument); + $label0$0: { + if (_0_0 instanceof A.SassNumber0) { + t1 = _0_0; + break $label0$0; + } + if (_0_0 instanceof A.SassCalculation0) { + t1 = _0_0; + break $label0$0; + } + t1 = new A.SassCalculation0("calc", A.List_List$unmodifiable([_0_0], type$.Object)); + break $label0$0; + } + return t1; + }, + SassCalculation_min0($arguments) { + var minimum, _i, arg, t2, + args = A.List_List$unmodifiable(new A.MappedListIterable($arguments, A.calculation0_SassCalculation__simplify$closure(), A._arrayInstanceType($arguments)._eval$1("MappedListIterable<1,@>")), type$.Object), + t1 = args.length; + if (t1 === 0) + throw A.wrapException(A.ArgumentError$("min() must have at least one argument.", null)); + for (minimum = null, _i = 0; _i < t1; ++_i) { + arg = args[_i]; + if (arg instanceof A.SassNumber0) + t2 = minimum != null && !minimum.isComparableTo$1(arg); + else + t2 = true; + if (t2) { + minimum = null; + break; + } else if (minimum == null || minimum.greaterThan$1(arg).value) + minimum = arg; + } + if (minimum != null) + return minimum; + A.SassCalculation__verifyCompatibleNumbers0(args); + return new A.SassCalculation0("min", args); + }, + SassCalculation_max0($arguments) { + var maximum, _i, arg, t2, + args = A.List_List$unmodifiable(new A.MappedListIterable($arguments, A.calculation0_SassCalculation__simplify$closure(), A._arrayInstanceType($arguments)._eval$1("MappedListIterable<1,@>")), type$.Object), + t1 = args.length; + if (t1 === 0) + throw A.wrapException(A.ArgumentError$("max() must have at least one argument.", null)); + for (maximum = null, _i = 0; _i < t1; ++_i) { + arg = args[_i]; + if (arg instanceof A.SassNumber0) + t2 = maximum != null && !maximum.isComparableTo$1(arg); + else + t2 = true; + if (t2) { + maximum = null; + break; + } else if (maximum == null || maximum.lessThan$1(arg).value) + maximum = arg; + } + if (maximum != null) + return maximum; + A.SassCalculation__verifyCompatibleNumbers0(args); + return new A.SassCalculation0("max", args); + }, + SassCalculation_hypot0($arguments) { + var first, subtotal, i, number, value, t2, t3, + args = A.List_List$unmodifiable(new A.MappedListIterable($arguments, A.calculation0_SassCalculation__simplify$closure(), A._arrayInstanceType($arguments)._eval$1("MappedListIterable<1,@>")), type$.Object), + t1 = args.length; + if (t1 === 0) + throw A.wrapException(A.ArgumentError$("hypot() must have at least one argument.", null)); + A.SassCalculation__verifyCompatibleNumbers0(args); + first = B.JSArray_methods.get$first(args); + if (!(first instanceof A.SassNumber0) || first.hasUnit$1("%")) + return new A.SassCalculation0("hypot", args); + for (subtotal = 0, i = 0; i < t1;) { + number = args[i]; + if (!(number instanceof A.SassNumber0) || !number.hasCompatibleUnits$1(first)) + return new A.SassCalculation0("hypot", args); + ++i; + value = number.convertValueToMatch$3(first, "numbers[" + i + "]", "numbers[1]"); + subtotal += value * value; + } + t1 = Math.sqrt(subtotal); + t2 = J.getInterceptor$x(first); + t3 = t2.get$numeratorUnits(first); + return A.SassNumber_SassNumber$withUnits0(t1, t2.get$denominatorUnits(first), t3); + }, + SassCalculation_abs0(argument) { + var t1, t2; + argument = A.SassCalculation__simplify0(argument); + if (!(argument instanceof A.SassNumber0)) + return new A.SassCalculation0("abs", A._setArrayType([argument], type$.JSArray_Object)); + if (argument.hasUnit$1("%")) { + t1 = argument.toString$0(0); + t2 = argument.toString$0(0); + A.EvaluationContext_current0().warn$2(0, string$.Passinp + t1 + ")\nTo emit a CSS abs() now: abs(#{" + t2 + string$.x7d__Mor, B.Deprecation_la6); + } + return A.SassNumber_SassNumber0(Math.abs(argument._number1$_value), null).coerceToMatch$1(argument); + }, + SassCalculation_exp0(argument) { + argument = A.SassCalculation__simplify0(argument); + if (!(argument instanceof A.SassNumber0)) + return new A.SassCalculation0("exp", A._setArrayType([argument], type$.JSArray_Object)); + argument.assertNoUnits$0(); + return A.pow1(A.SassNumber_SassNumber0(2.718281828459045, null), argument); + }, + SassCalculation_sign0(argument) { + var t1, _0_2, t2, arg; + argument = A.SassCalculation__simplify0(argument); + $label0$0: { + t1 = argument instanceof A.SassNumber0; + if (t1) { + _0_2 = argument._number1$_value; + if (!isNaN(_0_2)) + t2 = 0 === _0_2; + else + t2 = true; + } else + t2 = false; + if (t2) { + t1 = argument; + break $label0$0; + } + if (t1) { + t1 = !argument.hasUnit$1("%"); + arg = argument; + } else { + arg = null; + t1 = false; + } + if (t1) { + t1 = A.SassNumber_SassNumber0(J.get$sign$in(arg._number1$_value), null).coerceToMatch$1(argument); + break $label0$0; + } + t1 = new A.SassCalculation0("sign", A._setArrayType([argument], type$.JSArray_Object)); + break $label0$0; + } + return t1; + }, + SassCalculation_clamp0(min, value, max) { + var t1, args; + if (value == null && max != null) + throw A.wrapException(A.ArgumentError$("If value is null, max must also be null.", null)); + min = A.SassCalculation__simplify0(min); + value = A.NullableExtension_andThen0(value, A.calculation0_SassCalculation__simplify$closure()); + max = A.NullableExtension_andThen0(max, A.calculation0_SassCalculation__simplify$closure()); + if (min instanceof A.SassNumber0 && value instanceof A.SassNumber0 && max instanceof A.SassNumber0 && min.hasCompatibleUnits$1(value) && min.hasCompatibleUnits$1(max)) { + if (value.lessThanOrEquals$1(min).value) + return min; + if (value.greaterThanOrEquals$1(max).value) + return max; + return value; + } + t1 = [min]; + if (value != null) + t1.push(value); + if (max != null) + t1.push(max); + args = A.List_List$unmodifiable(t1, type$.Object); + A.SassCalculation__verifyCompatibleNumbers0(args); + A.SassCalculation__verifyLength0(args, 3); + return new A.SassCalculation0("clamp", args); + }, + SassCalculation_pow0(base, exponent) { + var t1 = A._setArrayType([base], type$.JSArray_Object); + if (exponent != null) + t1.push(exponent); + A.SassCalculation__verifyLength0(t1, 2); + base = A.SassCalculation__simplify0(base); + exponent = A.NullableExtension_andThen0(exponent, A.calculation0_SassCalculation__simplify$closure()); + if (!(base instanceof A.SassNumber0) || !(exponent instanceof A.SassNumber0)) + return new A.SassCalculation0("pow", t1); + base.assertNoUnits$0(); + exponent.assertNoUnits$0(); + return A.pow1(base, exponent); + }, + SassCalculation_log0(number, base) { + var t1, t2; + number = A.SassCalculation__simplify0(number); + base = A.NullableExtension_andThen0(base, A.calculation0_SassCalculation__simplify$closure()); + t1 = A._setArrayType([number], type$.JSArray_Object); + t2 = base != null; + if (t2) + t1.push(base); + if (number instanceof A.SassNumber0) + t2 = t2 && !(base instanceof A.SassNumber0); + else + t2 = true; + if (t2) + return new A.SassCalculation0("log", t1); + number.assertNoUnits$0(); + if (base instanceof A.SassNumber0) { + base.assertNoUnits$0(); + return A.log0(number, base); + } + return A.log0(number, null); + }, + SassCalculation_atan20(y, x) { + var t1; + y = A.SassCalculation__simplify0(y); + x = A.NullableExtension_andThen0(x, A.calculation0_SassCalculation__simplify$closure()); + t1 = A._setArrayType([y], type$.JSArray_Object); + if (x != null) + t1.push(x); + A.SassCalculation__verifyLength0(t1, 2); + A.SassCalculation__verifyCompatibleNumbers0(t1); + if (!(y instanceof A.SassNumber0) || !(x instanceof A.SassNumber0) || y.hasUnit$1("%") || x.hasUnit$1("%") || !y.hasCompatibleUnits$1(x)) + return new A.SassCalculation0("atan2", t1); + return A.SassNumber_SassNumber$withUnits0(Math.atan2(y._number1$_value, x.convertValueToMatch$3(y, "x", "y")) * 57.29577951308232, null, A._setArrayType(["deg"], type$.JSArray_String)); + }, + SassCalculation_rem0(dividend, modulus) { + var t1, result; + dividend = A.SassCalculation__simplify0(dividend); + modulus = A.NullableExtension_andThen0(modulus, A.calculation0_SassCalculation__simplify$closure()); + t1 = A._setArrayType([dividend], type$.JSArray_Object); + if (modulus != null) + t1.push(modulus); + A.SassCalculation__verifyLength0(t1, 2); + A.SassCalculation__verifyCompatibleNumbers0(t1); + if (!(dividend instanceof A.SassNumber0) || !(modulus instanceof A.SassNumber0) || !dividend.hasCompatibleUnits$1(modulus)) + return new A.SassCalculation0("rem", t1); + result = dividend.modulo$1(modulus); + t1 = modulus._number1$_value; + if (A.DoubleWithSignedZero_get_signIncludingZero0(t1) !== A.DoubleWithSignedZero_get_signIncludingZero0(dividend._number1$_value)) { + if (t1 == 1 / 0 || t1 == -1 / 0) + return dividend; + if (result._number1$_value === 0) + return result.unaryMinus$0(); + return result.minus$1(modulus); + } + return result; + }, + SassCalculation_mod0(dividend, modulus) { + var t1; + dividend = A.SassCalculation__simplify0(dividend); + modulus = A.NullableExtension_andThen0(modulus, A.calculation0_SassCalculation__simplify$closure()); + t1 = A._setArrayType([dividend], type$.JSArray_Object); + if (modulus != null) + t1.push(modulus); + A.SassCalculation__verifyLength0(t1, 2); + A.SassCalculation__verifyCompatibleNumbers0(t1); + if (!(dividend instanceof A.SassNumber0) || !(modulus instanceof A.SassNumber0) || !dividend.hasCompatibleUnits$1(modulus)) + return new A.SassCalculation0("mod", t1); + return dividend.modulo$1(modulus); + }, + SassCalculation_round0(strategyOrNumber, numberOrStep, step) { + var _0_4, t1, _0_20, _0_6, _0_50, _0_6_isSet, _0_5_isSet, _0_2_isSet, number, _0_4_isSet, t2, _0_8, _0_8_isSet, _0_12, _0_14, _0_16, _0_16_isSet, _0_14_isSet, _0_12_isSet, t3, strategy, _0_10_isSet, rest, _null = null, _s5_ = "round", + _0_1 = A.SassCalculation__simplify0(strategyOrNumber), + _0_2 = A.NullableExtension_andThen0(numberOrStep, A.calculation0_SassCalculation__simplify$closure()), + _0_5 = A.NullableExtension_andThen0(step, A.calculation0_SassCalculation__simplify$closure()), + _0_10 = _0_1; + if (_0_1 instanceof A.SassNumber0) { + type$.SassNumber_2._as(_0_10); + _0_4 = _0_2 == null; + t1 = _0_4; + _0_20 = _0_2; + if (t1) { + _0_6 = _0_5 == null; + t1 = _0_6; + _0_50 = _0_5; + _0_6_isSet = true; + _0_5_isSet = true; + } else { + _0_50 = _null; + _0_6 = _0_50; + _0_6_isSet = false; + _0_5_isSet = false; + t1 = false; + } + _0_2_isSet = true; + number = _0_10; + _0_1 = number; + _0_4_isSet = true; + } else { + number = _null; + _0_50 = number; + _0_6 = _0_50; + _0_20 = _0_6; + _0_4 = _0_20; + _0_1 = _0_10; + _0_4_isSet = false; + _0_2_isSet = false; + _0_6_isSet = false; + _0_5_isSet = false; + t1 = false; + } + if (t1) { + t1 = B.JSNumber_methods.round$0(number._number1$_value); + t2 = number.get$numeratorUnits(number); + return A.SassNumber_SassNumber$withUnits0(t1, number.get$denominatorUnits(number), t2); + } + if (_0_1 instanceof A.SassNumber0) { + t1 = type$.SassNumber_2; + t1._as(_0_1); + if (_0_2_isSet) + t2 = _0_20; + else { + t2 = _0_2; + _0_20 = t2; + _0_2_isSet = true; + } + if (t2 instanceof A.SassNumber0) { + if (_0_2_isSet) + t2 = _0_20; + else { + t2 = _0_2; + _0_20 = t2; + _0_2_isSet = true; + } + t1._as(t2); + if (_0_6_isSet) + t1 = _0_6; + else { + if (_0_5_isSet) + t1 = _0_50; + else { + t1 = _0_5; + _0_50 = t1; + _0_5_isSet = true; + } + _0_6 = t1 == null; + t1 = _0_6; + _0_6_isSet = true; + } + t1 = t1 && !_0_1.hasCompatibleUnits$1(t2); + step = t2; + } else { + step = _null; + t1 = false; + } + number = _0_1; + } else { + step = _null; + number = step; + t1 = false; + } + if (t1) { + t1 = type$.JSArray_Object; + A.SassCalculation__verifyCompatibleNumbers0(A._setArrayType([number, step], t1)); + return new A.SassCalculation0(_s5_, A._setArrayType([number, step], t1)); + } + if (_0_1 instanceof A.SassNumber0) { + t1 = type$.SassNumber_2; + t1._as(_0_1); + if (_0_2_isSet) + t2 = _0_20; + else { + t2 = _0_2; + _0_20 = t2; + _0_2_isSet = true; + } + if (t2 instanceof A.SassNumber0) { + if (_0_2_isSet) + t2 = _0_20; + else { + t2 = _0_2; + _0_20 = t2; + _0_2_isSet = true; + } + t1._as(t2); + if (_0_6_isSet) + t1 = _0_6; + else { + if (_0_5_isSet) + t1 = _0_50; + else { + t1 = _0_5; + _0_50 = t1; + _0_5_isSet = true; + } + _0_6 = t1 == null; + t1 = _0_6; + _0_6_isSet = true; + } + step = t2; + } else { + step = _null; + t1 = false; + } + number = _0_1; + } else { + step = _null; + number = step; + t1 = false; + } + if (t1) { + A.SassCalculation__verifyCompatibleNumbers0(A._setArrayType([number, step], type$.JSArray_Object)); + return A.SassCalculation__roundWithStep0("nearest", number, step); + } + if (_0_1 instanceof A.SassString0) { + type$.SassString_2._as(_0_1); + _0_8 = _0_1._string0$_text; + t1 = _0_8; + _0_10 = "nearest" === t1; + t1 = _0_10; + if (!t1) { + t1 = _0_8; + _0_8_isSet = true; + _0_12 = "up" === t1; + t1 = _0_12; + if (!t1) { + if (_0_8_isSet) + t1 = _0_8; + else { + type$.SassString_2._as(_0_1); + _0_8 = _0_1._string0$_text; + t1 = _0_8; + _0_8_isSet = true; + } + _0_14 = "down" === t1; + t1 = _0_14; + if (!t1) { + if (_0_8_isSet) + t1 = _0_8; + else { + type$.SassString_2._as(_0_1); + _0_8 = _0_1._string0$_text; + t1 = _0_8; + _0_8_isSet = true; + } + _0_16 = "to-zero" === t1; + t1 = _0_16; + _0_16_isSet = true; + } else { + _0_16 = _null; + _0_16_isSet = false; + t1 = true; + } + _0_14_isSet = true; + } else { + _0_16 = _null; + _0_14 = _0_16; + _0_14_isSet = false; + _0_16_isSet = false; + t1 = true; + } + _0_12_isSet = true; + } else { + _0_16 = _null; + _0_14 = _0_16; + _0_12 = _0_14; + _0_8_isSet = true; + _0_12_isSet = false; + _0_14_isSet = false; + _0_16_isSet = false; + t1 = true; + } + if (t1) { + type$.SassString_2._as(_0_1); + if (_0_2_isSet) + t1 = _0_20; + else { + t1 = _0_2; + _0_20 = t1; + _0_2_isSet = true; + } + if (t1 instanceof A.SassNumber0) { + if (_0_2_isSet) + t1 = _0_20; + else { + t1 = _0_2; + _0_20 = t1; + _0_2_isSet = true; + } + t2 = type$.SassNumber_2; + t2._as(t1); + if (_0_5_isSet) + t3 = _0_50; + else { + t3 = _0_5; + _0_50 = t3; + _0_5_isSet = true; + } + if (t3 instanceof A.SassNumber0) { + if (_0_5_isSet) + t3 = _0_50; + else { + t3 = _0_5; + _0_50 = t3; + _0_5_isSet = true; + } + t2._as(t3); + t2 = !t1.hasCompatibleUnits$1(t3); + step = t3; + } else { + step = _null; + t2 = false; + } + number = t1; + t1 = t2; + } else { + step = _null; + number = step; + t1 = false; + } + strategy = _0_1; + } else { + step = _null; + number = step; + strategy = number; + t1 = false; + } + _0_10_isSet = true; + } else { + step = _null; + number = step; + strategy = number; + _0_16 = strategy; + _0_14 = _0_16; + _0_12 = _0_14; + _0_8 = _0_12; + _0_10 = _0_8; + _0_10_isSet = false; + _0_8_isSet = false; + _0_12_isSet = false; + _0_14_isSet = false; + _0_16_isSet = false; + t1 = false; + } + if (t1) { + t1 = type$.JSArray_Object; + A.SassCalculation__verifyCompatibleNumbers0(A._setArrayType([number, step], t1)); + return new A.SassCalculation0(_s5_, A._setArrayType([strategy, number, step], t1)); + } + if (_0_1 instanceof A.SassString0) { + if (_0_10_isSet) + t1 = _0_10; + else { + if (_0_8_isSet) + t1 = _0_8; + else { + type$.SassString_2._as(_0_1); + _0_8 = _0_1._string0$_text; + t1 = _0_8; + _0_8_isSet = true; + } + _0_10 = "nearest" === t1; + t1 = _0_10; + _0_10_isSet = true; + } + if (!t1) { + if (_0_12_isSet) + t1 = _0_12; + else { + if (_0_8_isSet) + t1 = _0_8; + else { + type$.SassString_2._as(_0_1); + _0_8 = _0_1._string0$_text; + t1 = _0_8; + _0_8_isSet = true; + } + _0_12 = "up" === t1; + t1 = _0_12; + _0_12_isSet = true; + } + if (!t1) { + if (_0_14_isSet) + t1 = _0_14; + else { + if (_0_8_isSet) + t1 = _0_8; + else { + type$.SassString_2._as(_0_1); + _0_8 = _0_1._string0$_text; + t1 = _0_8; + _0_8_isSet = true; + } + _0_14 = "down" === t1; + t1 = _0_14; + _0_14_isSet = true; + } + if (!t1) + if (_0_16_isSet) + t1 = _0_16; + else { + if (_0_8_isSet) + t1 = _0_8; + else { + type$.SassString_2._as(_0_1); + _0_8 = _0_1._string0$_text; + t1 = _0_8; + _0_8_isSet = true; + } + _0_16 = "to-zero" === t1; + t1 = _0_16; + _0_16_isSet = true; + } + else + t1 = true; + } else + t1 = true; + } else + t1 = true; + if (t1) { + type$.SassString_2._as(_0_1); + if (_0_2_isSet) + t1 = _0_20; + else { + t1 = _0_2; + _0_20 = t1; + _0_2_isSet = true; + } + if (t1 instanceof A.SassNumber0) { + if (_0_2_isSet) + t1 = _0_20; + else { + t1 = _0_2; + _0_20 = t1; + _0_2_isSet = true; + } + t2 = type$.SassNumber_2; + t2._as(t1); + if (_0_5_isSet) + t3 = _0_50; + else { + t3 = _0_5; + _0_50 = t3; + _0_5_isSet = true; + } + if (t3 instanceof A.SassNumber0) { + if (_0_5_isSet) + t3 = _0_50; + else { + t3 = _0_5; + _0_50 = t3; + _0_5_isSet = true; + } + t2._as(t3); + step = t3; + t2 = true; + } else { + step = _null; + t2 = false; + } + number = t1; + t1 = t2; + } else { + step = _null; + number = step; + t1 = false; + } + strategy = _0_1; + } else { + step = _null; + number = step; + strategy = number; + t1 = false; + } + } else { + step = _null; + number = step; + strategy = number; + t1 = false; + } + if (t1) { + A.SassCalculation__verifyCompatibleNumbers0(A._setArrayType([number, step], type$.JSArray_Object)); + return A.SassCalculation__roundWithStep0(strategy._string0$_text, number, step); + } + if (_0_1 instanceof A.SassString0) { + if (_0_10_isSet) + t1 = _0_10; + else { + if (_0_8_isSet) + t1 = _0_8; + else { + type$.SassString_2._as(_0_1); + _0_8 = _0_1._string0$_text; + t1 = _0_8; + _0_8_isSet = true; + } + _0_10 = "nearest" === t1; + t1 = _0_10; + _0_10_isSet = true; + } + if (!t1) { + if (_0_12_isSet) + t1 = _0_12; + else { + if (_0_8_isSet) + t1 = _0_8; + else { + type$.SassString_2._as(_0_1); + _0_8 = _0_1._string0$_text; + t1 = _0_8; + _0_8_isSet = true; + } + _0_12 = "up" === t1; + t1 = _0_12; + _0_12_isSet = true; + } + if (!t1) { + if (_0_14_isSet) + t1 = _0_14; + else { + if (_0_8_isSet) + t1 = _0_8; + else { + type$.SassString_2._as(_0_1); + _0_8 = _0_1._string0$_text; + t1 = _0_8; + _0_8_isSet = true; + } + _0_14 = "down" === t1; + t1 = _0_14; + _0_14_isSet = true; + } + if (!t1) + if (_0_16_isSet) + t1 = _0_16; + else { + if (_0_8_isSet) + t1 = _0_8; + else { + type$.SassString_2._as(_0_1); + _0_8 = _0_1._string0$_text; + t1 = _0_8; + _0_8_isSet = true; + } + _0_16 = "to-zero" === t1; + t1 = _0_16; + _0_16_isSet = true; + } + else + t1 = true; + } else + t1 = true; + } else + t1 = true; + if (t1) { + t1 = type$.SassString_2; + t1._as(_0_1); + if (_0_2_isSet) + t2 = _0_20; + else { + t2 = _0_2; + _0_20 = t2; + _0_2_isSet = true; + } + if (t2 instanceof A.SassString0) { + if (_0_2_isSet) + t2 = _0_20; + else { + t2 = _0_2; + _0_20 = t2; + _0_2_isSet = true; + } + t1._as(t2); + if (_0_6_isSet) + t1 = _0_6; + else { + if (_0_5_isSet) + t1 = _0_50; + else { + t1 = _0_5; + _0_50 = t1; + _0_5_isSet = true; + } + _0_6 = t1 == null; + t1 = _0_6; + _0_6_isSet = true; + } + rest = t2; + } else { + rest = _null; + t1 = false; + } + strategy = _0_1; + } else { + rest = _null; + strategy = rest; + t1 = false; + } + } else { + rest = _null; + strategy = rest; + t1 = false; + } + if (t1) + return new A.SassCalculation0(_s5_, A._setArrayType([strategy, rest], type$.JSArray_Object)); + if (_0_1 instanceof A.SassString0) { + if (_0_10_isSet) + t1 = _0_10; + else { + if (_0_8_isSet) + t1 = _0_8; + else { + type$.SassString_2._as(_0_1); + _0_8 = _0_1._string0$_text; + t1 = _0_8; + _0_8_isSet = true; + } + _0_10 = "nearest" === t1; + t1 = _0_10; + _0_10_isSet = true; + } + if (!t1) { + if (_0_12_isSet) + t1 = _0_12; + else { + if (_0_8_isSet) + t1 = _0_8; + else { + type$.SassString_2._as(_0_1); + _0_8 = _0_1._string0$_text; + t1 = _0_8; + _0_8_isSet = true; + } + _0_12 = "up" === t1; + t1 = _0_12; + _0_12_isSet = true; + } + if (!t1) { + if (_0_14_isSet) + t1 = _0_14; + else { + if (_0_8_isSet) + t1 = _0_8; + else { + type$.SassString_2._as(_0_1); + _0_8 = _0_1._string0$_text; + t1 = _0_8; + _0_8_isSet = true; + } + _0_14 = "down" === t1; + t1 = _0_14; + _0_14_isSet = true; + } + if (!t1) + if (_0_16_isSet) + t1 = _0_16; + else { + if (_0_8_isSet) + t1 = _0_8; + else { + type$.SassString_2._as(_0_1); + _0_8 = _0_1._string0$_text; + t1 = _0_8; + _0_8_isSet = true; + } + _0_16 = "to-zero" === t1; + t1 = _0_16; + _0_16_isSet = true; + } + else + t1 = true; + } else + t1 = true; + } else + t1 = true; + if (t1) { + if (_0_2_isSet) + t1 = _0_20; + else { + t1 = _0_2; + _0_20 = t1; + _0_2_isSet = true; + } + if (t1 != null) + if (_0_6_isSet) + t1 = _0_6; + else { + if (_0_5_isSet) + t1 = _0_50; + else { + t1 = _0_5; + _0_50 = t1; + _0_5_isSet = true; + } + _0_6 = t1 == null; + t1 = _0_6; + _0_6_isSet = true; + } + else + t1 = false; + } else + t1 = false; + } else + t1 = false; + if (t1) + throw A.wrapException(A.SassScriptException$0(string$.If_str, _null)); + if (_0_1 instanceof A.SassString0) { + if (_0_10_isSet) + t1 = _0_10; + else { + if (_0_8_isSet) + t1 = _0_8; + else { + type$.SassString_2._as(_0_1); + _0_8 = _0_1._string0$_text; + t1 = _0_8; + _0_8_isSet = true; + } + _0_10 = "nearest" === t1; + t1 = _0_10; + _0_10_isSet = true; + } + if (!t1) { + if (_0_12_isSet) + t1 = _0_12; + else { + if (_0_8_isSet) + t1 = _0_8; + else { + type$.SassString_2._as(_0_1); + _0_8 = _0_1._string0$_text; + t1 = _0_8; + _0_8_isSet = true; + } + _0_12 = "up" === t1; + t1 = _0_12; + _0_12_isSet = true; + } + if (!t1) { + if (_0_14_isSet) + t1 = _0_14; + else { + if (_0_8_isSet) + t1 = _0_8; + else { + type$.SassString_2._as(_0_1); + _0_8 = _0_1._string0$_text; + t1 = _0_8; + _0_8_isSet = true; + } + _0_14 = "down" === t1; + t1 = _0_14; + _0_14_isSet = true; + } + if (!t1) + if (_0_16_isSet) + t1 = _0_16; + else { + if (_0_8_isSet) + t1 = _0_8; + else { + type$.SassString_2._as(_0_1); + _0_8 = _0_1._string0$_text; + t1 = _0_8; + _0_8_isSet = true; + } + _0_16 = "to-zero" === t1; + t1 = _0_16; + _0_16_isSet = true; + } + else + t1 = true; + } else + t1 = true; + } else + t1 = true; + if (t1) { + if (_0_4_isSet) + t1 = _0_4; + else { + if (_0_2_isSet) + t1 = _0_20; + else { + t1 = _0_2; + _0_20 = t1; + _0_2_isSet = true; + } + _0_4 = t1 == null; + t1 = _0_4; + _0_4_isSet = true; + } + if (t1) + if (_0_6_isSet) + t1 = _0_6; + else { + if (_0_5_isSet) + t1 = _0_50; + else { + t1 = _0_5; + _0_50 = t1; + _0_5_isSet = true; + } + _0_6 = t1 == null; + t1 = _0_6; + _0_6_isSet = true; + } + else + t1 = false; + } else + t1 = false; + } else + t1 = false; + if (t1) + throw A.wrapException(A.SassScriptException$0(string$.Number, _null)); + if (_0_1 instanceof A.SassString0) { + type$.SassString_2._as(_0_1); + if (_0_4_isSet) + t1 = _0_4; + else { + if (_0_2_isSet) + t1 = _0_20; + else { + t1 = _0_2; + _0_20 = t1; + _0_2_isSet = true; + } + _0_4 = t1 == null; + t1 = _0_4; + _0_4_isSet = true; + } + if (t1) + if (_0_6_isSet) + t1 = _0_6; + else { + if (_0_5_isSet) + t1 = _0_50; + else { + t1 = _0_5; + _0_50 = t1; + _0_5_isSet = true; + } + _0_6 = t1 == null; + t1 = _0_6; + _0_6_isSet = true; + } + else + t1 = false; + rest = _0_1; + } else { + rest = _null; + t1 = false; + } + if (t1) + return new A.SassCalculation0(_s5_, A._setArrayType([rest], type$.JSArray_Object)); + if (_0_4_isSet) + t1 = _0_4; + else { + if (_0_2_isSet) + t1 = _0_20; + else { + t1 = _0_2; + _0_20 = t1; + _0_2_isSet = true; + } + _0_4 = t1 == null; + t1 = _0_4; + } + if (t1) + if (_0_6_isSet) + t1 = _0_6; + else { + if (_0_5_isSet) + t1 = _0_50; + else { + t1 = _0_5; + _0_50 = t1; + _0_5_isSet = true; + } + _0_6 = t1 == null; + t1 = _0_6; + _0_6_isSet = true; + } + else + t1 = false; + if (t1) + throw A.wrapException(A.SassScriptException$0("Single argument " + A.S(_0_1) + " expected to be simplifiable.", _null)); + if (_0_2_isSet) + t1 = _0_20; + else { + t1 = _0_2; + _0_20 = t1; + _0_2_isSet = true; + } + if (t1 != null) { + if (_0_2_isSet) + step = _0_20; + else { + step = _0_2; + _0_20 = step; + _0_2_isSet = true; + } + if (step == null) + step = type$.Object._as(step); + if (_0_6_isSet) + t1 = _0_6; + else { + if (_0_5_isSet) + t1 = _0_50; + else { + t1 = _0_5; + _0_50 = t1; + _0_5_isSet = true; + } + _0_6 = t1 == null; + t1 = _0_6; + } + } else { + step = _null; + t1 = false; + } + if (t1) + return new A.SassCalculation0(_s5_, A._setArrayType([_0_1, step], type$.JSArray_Object)); + if (_0_1 instanceof A.SassString0) { + if (_0_10_isSet) + t1 = _0_10; + else { + if (_0_8_isSet) + t1 = _0_8; + else { + type$.SassString_2._as(_0_1); + _0_8 = _0_1._string0$_text; + t1 = _0_8; + _0_8_isSet = true; + } + _0_10 = "nearest" === t1; + t1 = _0_10; + } + if (!t1) { + if (_0_12_isSet) + t1 = _0_12; + else { + if (_0_8_isSet) + t1 = _0_8; + else { + type$.SassString_2._as(_0_1); + _0_8 = _0_1._string0$_text; + t1 = _0_8; + _0_8_isSet = true; + } + _0_12 = "up" === t1; + t1 = _0_12; + } + if (!t1) { + if (_0_14_isSet) + t1 = _0_14; + else { + if (_0_8_isSet) + t1 = _0_8; + else { + type$.SassString_2._as(_0_1); + _0_8 = _0_1._string0$_text; + t1 = _0_8; + _0_8_isSet = true; + } + _0_14 = "down" === t1; + t1 = _0_14; + } + if (!t1) + if (_0_16_isSet) + t1 = _0_16; + else { + if (_0_8_isSet) + t1 = _0_8; + else { + type$.SassString_2._as(_0_1); + _0_8 = _0_1._string0$_text; + t1 = _0_8; + } + _0_16 = "to-zero" === t1; + t1 = _0_16; + } + else + t1 = true; + } else + t1 = true; + } else + t1 = true; + } else + t1 = false; + if (!t1) + if (_0_1 instanceof A.SassString0) { + type$.SassString_2._as(_0_1); + t1 = _0_1.get$isVar(); + } else + t1 = false; + else + t1 = true; + if (t1) { + type$.SassString_2._as(_0_1); + if (_0_2_isSet) + t1 = _0_20; + else { + t1 = _0_2; + _0_20 = t1; + _0_2_isSet = true; + } + if (t1 != null) { + if (_0_2_isSet) + number = _0_20; + else { + number = _0_2; + _0_20 = number; + _0_2_isSet = true; + } + if (number == null) + number = type$.Object._as(number); + if (_0_5_isSet) + t1 = _0_50; + else { + t1 = _0_5; + _0_50 = t1; + _0_5_isSet = true; + } + if (t1 != null) { + if (_0_5_isSet) + step = _0_50; + else { + step = _0_5; + _0_50 = step; + _0_5_isSet = true; + } + if (step == null) + step = type$.Object._as(step); + t1 = true; + } else { + step = _null; + t1 = false; + } + } else { + step = _null; + number = step; + t1 = false; + } + strategy = _0_1; + } else { + step = _null; + number = step; + strategy = number; + t1 = false; + } + if (t1) + return new A.SassCalculation0(_s5_, A._setArrayType([strategy, number, step], type$.JSArray_Object)); + if ((_0_2_isSet ? _0_20 : _0_2) != null) + t1 = (_0_5_isSet ? _0_50 : _0_5) != null && true; + else + t1 = false; + if (t1) + throw A.wrapException(A.SassScriptException$0(A.S(strategyOrNumber) + string$.x20must_b, _null)); + t1 = A.SassScriptException$0("Invalid parameters.", _null); + throw A.wrapException(t1); + }, + SassCalculation_operateInternal0(operator, left, right, inLegacySassFunction, simplify) { + var t1; + if (!simplify) + return new A.CalculationOperation0(operator, left, right); + left = A.SassCalculation__simplify0(left); + right = A.SassCalculation__simplify0(right); + if (B.CalculationOperator_IyK0 === operator || B.CalculationOperator_2bx0 === operator) { + if (left instanceof A.SassNumber0) + if (right instanceof A.SassNumber0) + t1 = inLegacySassFunction ? left.isComparableTo$1(right) : left.hasCompatibleUnits$1(right); + else + t1 = false; + else + t1 = false; + if (t1) + return operator === B.CalculationOperator_IyK0 ? left.plus$1(right) : left.minus$1(right); + A.SassCalculation__verifyCompatibleNumbers0(A._setArrayType([left, right], type$.JSArray_Object)); + if (right instanceof A.SassNumber0) { + t1 = right._number1$_value; + t1 = t1 < 0 && !A.fuzzyEquals0(t1, 0); + } else + t1 = false; + if (t1) { + right = right.times$1(A.SassNumber_SassNumber0(-1, null)); + operator = operator === B.CalculationOperator_IyK0 ? B.CalculationOperator_2bx0 : B.CalculationOperator_IyK0; + } + return new A.CalculationOperation0(operator, left, right); + } else if (left instanceof A.SassNumber0 && right instanceof A.SassNumber0) + return operator === B.CalculationOperator_jFr0 ? left.times$1(right) : left.dividedBy$1(right); + else + return new A.CalculationOperation0(operator, left, right); + }, + SassCalculation__roundWithStep0(strategy, number, step) { + var _0_2, t1, _0_6, _0_8, _0_1, _0_1_isSet, _0_8_isSet, _0_9, _0_9_isSet, _0_11, _0_13, stepWithNumberUnit, t2, _null = null; + if (!A.LinkedHashSet_LinkedHashSet$_literal(["nearest", "up", "down", "to-zero"], type$.String).contains$1(0, strategy)) + throw A.wrapException(A.ArgumentError$(strategy + string$.x20must_b, _null)); + _0_2 = number._number1$_value; + if (_0_2 == 1 / 0 || _0_2 == -1 / 0) { + t1 = step._number1$_value; + t1 = t1 == 1 / 0 || t1 == -1 / 0; + } else + t1 = false; + if (!t1) { + t1 = step._number1$_value; + t1 = t1 === 0 || isNaN(_0_2) || isNaN(t1); + } else + t1 = true; + if (t1) { + t1 = number.get$numeratorUnits(number); + return A.SassNumber_SassNumber$withUnits0(0 / 0, number.get$denominatorUnits(number), t1); + } + if (_0_2 == 1 / 0 || _0_2 == -1 / 0) + return number; + t1 = step._number1$_value; + if (t1 == 1 / 0 || t1 == -1 / 0) { + $label0$0: { + if (0 === _0_2) { + t1 = number; + break $label0$0; + } + _0_6 = "nearest" === strategy; + t1 = _0_6; + if (!t1) { + _0_8 = "to-zero" === strategy; + t1 = _0_8; + _0_1 = strategy; + _0_1_isSet = true; + _0_8_isSet = true; + } else { + _0_8 = _null; + _0_1 = strategy; + _0_1_isSet = true; + _0_8_isSet = false; + t1 = true; + } + if (t1) { + _0_9 = _0_2 > 0; + t1 = _0_9; + _0_9_isSet = true; + } else { + _0_9 = _null; + _0_9_isSet = false; + t1 = false; + } + if (t1) { + t1 = number.get$numeratorUnits(number); + t1 = A.SassNumber_SassNumber$withUnits0(0, number.get$denominatorUnits(number), t1); + break $label0$0; + } + if (!_0_6) + if (_0_8_isSet) + t1 = _0_8; + else { + if (_0_1_isSet) + t1 = _0_1; + else { + t1 = strategy; + _0_1 = t1; + _0_1_isSet = true; + } + _0_8 = "to-zero" === t1; + t1 = _0_8; + } + else + t1 = true; + if (t1) { + t1 = number.get$numeratorUnits(number); + t1 = A.SassNumber_SassNumber$withUnits0(-0.0, number.get$denominatorUnits(number), t1); + break $label0$0; + } + if (_0_1_isSet) + t1 = _0_1; + else { + t1 = strategy; + _0_1 = t1; + _0_1_isSet = true; + } + _0_11 = "up" === t1; + t1 = _0_11; + if (t1) + if (_0_9_isSet) + t1 = _0_9; + else { + _0_9 = _0_2 > 0; + t1 = _0_9; + } + else + t1 = false; + if (t1) { + t1 = number.get$numeratorUnits(number); + t1 = A.SassNumber_SassNumber$withUnits0(1 / 0, number.get$denominatorUnits(number), t1); + break $label0$0; + } + if (_0_11) { + t1 = number.get$numeratorUnits(number); + t1 = A.SassNumber_SassNumber$withUnits0(-0.0, number.get$denominatorUnits(number), t1); + break $label0$0; + } + _0_13 = "down" === (_0_1_isSet ? _0_1 : strategy); + t1 = _0_13; + if (t1) + t1 = _0_2 < 0; + else + t1 = false; + if (t1) { + t1 = number.get$numeratorUnits(number); + t1 = A.SassNumber_SassNumber$withUnits0(-1 / 0, number.get$denominatorUnits(number), t1); + break $label0$0; + } + if (_0_13) { + t1 = number.get$numeratorUnits(number); + t1 = A.SassNumber_SassNumber$withUnits0(0, number.get$denominatorUnits(number), t1); + break $label0$0; + } + t1 = A.throwExpression(A.UnsupportedError$("Invalid argument: " + strategy + ".")); + } + return t1; + } + stepWithNumberUnit = step.convertValueToMatch$1(number); + $label1$1: { + if ("nearest" === strategy) { + t1 = B.JSNumber_methods.round$0(_0_2 / stepWithNumberUnit); + t2 = number.get$numeratorUnits(number); + t2 = A.SassNumber_SassNumber$withUnits0(t1 * stepWithNumberUnit, number.get$denominatorUnits(number), t2); + t1 = t2; + break $label1$1; + } + if ("up" === strategy) { + t2 = _0_2 / stepWithNumberUnit; + t1 = t1 < 0 ? B.JSNumber_methods.floor$0(t2) : B.JSNumber_methods.ceil$0(t2); + t2 = number.get$numeratorUnits(number); + t2 = A.SassNumber_SassNumber$withUnits0(t1 * stepWithNumberUnit, number.get$denominatorUnits(number), t2); + t1 = t2; + break $label1$1; + } + if ("down" === strategy) { + t2 = _0_2 / stepWithNumberUnit; + t1 = t1 < 0 ? B.JSNumber_methods.ceil$0(t2) : B.JSNumber_methods.floor$0(t2); + t2 = number.get$numeratorUnits(number); + t2 = A.SassNumber_SassNumber$withUnits0(t1 * stepWithNumberUnit, number.get$denominatorUnits(number), t2); + t1 = t2; + break $label1$1; + } + if ("to-zero" === strategy) { + t1 = _0_2 / stepWithNumberUnit; + if (_0_2 < 0) { + t1 = B.JSNumber_methods.ceil$0(t1); + t2 = number.get$numeratorUnits(number); + t2 = A.SassNumber_SassNumber$withUnits0(t1 * stepWithNumberUnit, number.get$denominatorUnits(number), t2); + t1 = t2; + } else { + t1 = B.JSNumber_methods.floor$0(t1); + t2 = number.get$numeratorUnits(number); + t2 = A.SassNumber_SassNumber$withUnits0(t1 * stepWithNumberUnit, number.get$denominatorUnits(number), t2); + t1 = t2; + } + break $label1$1; + } + t1 = number.get$numeratorUnits(number); + t1 = A.SassNumber_SassNumber$withUnits0(0 / 0, number.get$denominatorUnits(number), t1); + break $label1$1; + } + return t1; + }, + SassCalculation__simplify0(arg) { + var t1, _0_11, _0_12, _0_15, t2, _0_12_isSet, _0_16, text, _0_16_isSet, _0_15_isSet, _0_11_isSet, value, _null = null, + _s32_ = " can't be used in a calculation."; + $label0$0: { + if (arg instanceof A.SassNumber0 || arg instanceof A.CalculationOperation0) { + t1 = arg; + break $label0$0; + } + if (arg instanceof A.CalculationInterpolation) { + t1 = new A.SassString0("(" + arg._calculation0$_value + ")", false); + break $label0$0; + } + t1 = arg instanceof A.SassString0; + if (t1 && !arg._string0$_hasQuotes) { + t1 = arg; + break $label0$0; + } + if (t1) + A.throwExpression(A.SassScriptException$0("Quoted string " + arg.toString$0(0) + _s32_, _null)); + t1 = arg instanceof A.SassCalculation0; + if (t1) { + _0_11 = "calc" === arg.name; + if (_0_11) { + _0_12 = arg.$arguments; + _0_15 = _0_12.length === 1; + t2 = _0_15; + if (t2) { + t2 = _0_12; + _0_12_isSet = true; + _0_16 = t2[0]; + t2 = _0_16; + if (t2 instanceof A.SassString0) { + type$.SassString_2._as(_0_16); + if (!_0_16._string0$_hasQuotes) { + text = _0_16._string0$_text; + t2 = A.SassCalculation__needsParentheses0(text); + } else { + text = _null; + t2 = false; + } + } else { + text = _null; + t2 = false; + } + _0_16_isSet = true; + } else { + text = _null; + _0_16 = text; + _0_12_isSet = true; + _0_16_isSet = false; + t2 = false; + } + _0_15_isSet = true; + } else { + text = _null; + _0_16 = text; + _0_12 = _0_16; + _0_15 = _0_12; + _0_15_isSet = false; + _0_12_isSet = false; + _0_16_isSet = false; + t2 = false; + } + _0_11_isSet = true; + } else { + text = _null; + _0_16 = text; + _0_12 = _0_16; + _0_15 = _0_12; + _0_11 = _0_15; + _0_11_isSet = false; + _0_15_isSet = false; + _0_12_isSet = false; + _0_16_isSet = false; + t2 = false; + } + if (t2) { + t1 = new A.SassString0("(" + A.S(text) + ")", false); + break $label0$0; + } + if (t1) + if (_0_11_isSet ? _0_11 : "calc" === arg.name) + if (_0_15_isSet) + t2 = _0_15; + else { + if (_0_12_isSet) + t2 = _0_12; + else { + _0_12 = arg.$arguments; + t2 = _0_12; + _0_12_isSet = true; + } + _0_15 = t2.length === 1; + t2 = _0_15; + } + else + t2 = false; + else + t2 = false; + if (t2) { + if (_0_16_isSet) + value = _0_16; + else { + _0_16 = (_0_12_isSet ? _0_12 : arg.$arguments)[0]; + value = _0_16; + } + t1 = value; + break $label0$0; + } + if (t1) { + t1 = arg; + break $label0$0; + } + if (arg instanceof A.Value0) + A.throwExpression(A.SassScriptException$0("Value " + arg.toString$0(0) + _s32_, _null)); + t1 = A.throwExpression(A.ArgumentError$("Unexpected calculation argument " + A.S(arg) + ".", _null)); + } + return t1; + }, + SassCalculation__needsParentheses0(text) { + var t1, couldBeVar, second, third, fourth, i, t2, + first = text.charCodeAt(0); + if (first === 32 || first === 9 || first === 10 || first === 13 || first === 12 || first === 47 || first === 42) + return true; + t1 = text.length; + couldBeVar = t1 >= 4 && A.characterEqualsIgnoreCase0(first, 118); + if (t1 < 2) + return false; + second = text.charCodeAt(1); + if (second === 32 || second === 9 || second === 10 || second === 13 || second === 12 || second === 47 || second === 42) + return true; + couldBeVar = couldBeVar && A.characterEqualsIgnoreCase0(second, 97); + if (t1 < 3) + return false; + third = text.charCodeAt(2); + if (third === 32 || third === 9 || third === 10 || third === 13 || third === 12 || third === 47 || third === 42) + return true; + couldBeVar = couldBeVar && A.characterEqualsIgnoreCase0(third, 114); + if (t1 < 4) + return false; + fourth = text.charCodeAt(3); + if (couldBeVar && fourth === 40) + return true; + if (fourth === 32 || fourth === 9 || fourth === 10 || fourth === 13 || fourth === 12 || fourth === 47 || fourth === 42) + return true; + for (i = 4; i < t1; ++i) { + t2 = text.charCodeAt(i); + if (t2 === 32 || t2 === 9 || t2 === 10 || t2 === 13 || t2 === 12 || t2 === 47 || t2 === 42) + return true; + } + return false; + }, + SassCalculation__verifyCompatibleNumbers0(args) { + var t1, _i, t2, arg, i, number1, j, number2; + for (t1 = args.length, _i = 0; t2 = args.length, _i < t2; args.length === t1 || (0, A.throwConcurrentModificationError)(args), ++_i) { + arg = args[_i]; + if (arg instanceof A.SassNumber0 && arg.get$hasComplexUnits()) + throw A.wrapException(A.SassScriptException$0("Number " + A.S(arg) + " isn't compatible with CSS calculations.", null)); + } + for (t1 = t2, i = 0; i < t1 - 1; ++i) { + number1 = args[i]; + if (!(number1 instanceof A.SassNumber0)) + continue; + for (j = i + 1; t1 = args.length, j < t1; ++j) { + number2 = args[j]; + if (!(number2 instanceof A.SassNumber0)) + continue; + if (number1.hasPossiblyCompatibleUnits$1(number2)) + continue; + throw A.wrapException(A.SassScriptException$0(number1.toString$0(0) + " and " + number2.toString$0(0) + " are incompatible.", null)); + } + } + }, + SassCalculation__verifyLength0(args, expectedLength) { + var t1; + if (args.length === expectedLength) + return; + if (B.JSArray_methods.any$1(args, new A.SassCalculation__verifyLength_closure0())) + return; + t1 = args.length; + throw A.wrapException(A.SassScriptException$0("" + expectedLength + " arguments required, but only " + t1 + " " + A.pluralize0("was", t1, "were") + " passed.", null)); + }, + SassCalculation__singleArgument0($name, argument, mathFunc, forbidUnits) { + argument = A.SassCalculation__simplify0(argument); + if (!(argument instanceof A.SassNumber0)) + return new A.SassCalculation0($name, A._setArrayType([argument], type$.JSArray_Object)); + if (forbidUnits) + argument.assertNoUnits$0(); + return mathFunc.call$1(argument); + }, + SassCalculation0: function SassCalculation0(t0, t1) { + this.name = t0; + this.$arguments = t1; + }, + SassCalculation__verifyLength_closure0: function SassCalculation__verifyLength_closure0() { + }, + CalculationOperation0: function CalculationOperation0(t0, t1, t2) { + this._calculation0$_operator = t0; + this._calculation0$_left = t1; + this._calculation0$_right = t2; + }, + CalculationOperator0: function CalculationOperator0(t0, t1, t2, t3) { + var _ = this; + _.name = t0; + _.operator = t1; + _.precedence = t2; + _._name = t3; + }, + CalculationInterpolation: function CalculationInterpolation(t0) { + this._calculation0$_value = t0; + }, + CallableDeclaration0: function CallableDeclaration0() { + }, + Chokidar0: function Chokidar0() { + }, + ChokidarOptions0: function ChokidarOptions0() { + }, + ChokidarWatcher0: function ChokidarWatcher0() { + }, + ClassSelector0: function ClassSelector0(t0, t1) { + this.name = t0; + this.span = t1; + }, + cloneCssStylesheet0(stylesheet, extensionStore) { + var _0_0 = extensionStore.clone$0(); + return new A._Record_2(new A._CloneCssVisitor0(_0_0._1)._clone_css$_visitChildren$2(A.ModifiableCssStylesheet$0(stylesheet.get$span(stylesheet)), stylesheet), _0_0._0); + }, + _CloneCssVisitor0: function _CloneCssVisitor0(t0) { + this._clone_css$_oldToNewSelectors = t0; + }, + ColorExpression0: function ColorExpression0(t0, t1) { + this.value = t0; + this.span = t1; + }, + _updateComponents0($arguments, adjust, change, scale) { + var keywords, alpha, red, green, blue, hue, saturation, lightness, whiteness, blackness, hasRgb, hasSL, hasWB, t2, t3, t4, _null = null, + t1 = J.getInterceptor$asx($arguments), + color = t1.$index($arguments, 0).assertColor$1("color"), + argumentList = type$.SassArgumentList_2._as(t1.$index($arguments, 1)); + if (argumentList._list1$_contents.length !== 0) + throw A.wrapException(A.SassScriptException$0(string$.Only_op, _null)); + argumentList._argument_list$_wereKeywordsAccessed = true; + keywords = A.LinkedHashMap_LinkedHashMap$of(argumentList._argument_list$_keywords, type$.String, type$.Value_2); + t1 = new A._updateComponents_getParam0(keywords, scale, change); + alpha = t1.call$3$checkUnitless("alpha", 1, true); + red = t1.call$2("red", 255); + green = t1.call$2("green", 255); + blue = t1.call$2("blue", 255); + hue = scale ? _null : A.NullableExtension_andThen0(keywords.remove$1(0, "hue"), new A._updateComponents_closure1()); + saturation = t1.call$3$checkPercent("saturation", 100, true); + lightness = t1.call$3$checkPercent("lightness", 100, true); + whiteness = t1.call$3$assertPercent("whiteness", 100, true); + blackness = t1.call$3$assertPercent("blackness", 100, true); + t1 = keywords.__js_helper$_length; + if (t1 !== 0) + throw A.wrapException(A.SassScriptException$0("No " + A.pluralize0("argument", t1, _null) + " named " + A.toSentence0(keywords.get$keys(0).map$1$1(0, new A._updateComponents_closure2(), type$.Object), "or") + ".", _null)); + hasRgb = red != null || green != null || blue != null; + hasSL = saturation != null || lightness != null; + hasWB = whiteness != null || blackness != null; + if (hasRgb) + t1 = hasSL || hasWB || hue != null; + else + t1 = false; + if (t1) + throw A.wrapException(A.SassScriptException$0(string$.RGB_pa + (hasWB ? "HWB" : "HSL") + " parameters.", _null)); + if (hasSL && hasWB) + throw A.wrapException(A.SassScriptException$0(string$.HSL_pa, _null)); + t1 = new A._updateComponents_updateValue0(change, adjust); + t2 = new A._updateComponents_updateRgb0(t1); + if (hasRgb) { + t3 = t2.call$2(color.get$red(0), red); + t4 = t2.call$2(color.get$green(0), green); + t2 = t2.call$2(color.get$blue(0), blue); + return color.changeRgb$4$alpha$blue$green$red(t1.call$3(color._color1$_alpha, alpha, 1), t2, t4, t3); + } else if (hasWB) { + if (change) + t2 = hue; + else { + t2 = color.get$hue(0); + t2 += hue == null ? 0 : hue; + } + t3 = t1.call$3(color.get$whiteness(0), whiteness, 100); + t4 = t1.call$3(color.get$blackness(0), blackness, 100); + return color.changeHwb$4$alpha$blackness$hue$whiteness(t1.call$3(color._color1$_alpha, alpha, 1), t4, t2, t3); + } else { + t2 = hue == null; + if (!t2 || hasSL) { + if (change) + t2 = hue; + else { + t3 = color.get$hue(0); + t3 += t2 ? 0 : hue; + t2 = t3; + } + t3 = t1.call$3(color.get$saturation(0), saturation, 100); + t4 = t1.call$3(color.get$lightness(0), lightness, 100); + return color.changeHsl$4$alpha$hue$lightness$saturation(t1.call$3(color._color1$_alpha, alpha, 1), t2, t4, t3); + } else if (alpha != null) + return color.changeAlpha$1(t1.call$3(color._color1$_alpha, alpha, 1)); + else + return color; + } + }, + _functionString0($name, $arguments) { + return new A.SassString0($name + "(" + J.map$1$1$ax($arguments, new A._functionString_closure0(), type$.String).join$1(0, ", ") + ")", false); + }, + _removedColorFunction0($name, argument, negative) { + return A.BuiltInCallable$function0($name, "$color, $amount", new A._removedColorFunction_closure0($name, argument, negative), "sass:color"); + }, + _rgb0($name, $arguments) { + var t2, red, green, blue, t3, t4, + t1 = J.getInterceptor$asx($arguments), + alpha = t1.get$length($arguments) > 3 ? t1.$index($arguments, 3) : null; + if (!t1.$index($arguments, 0).get$isSpecialNumber()) + if (!t1.$index($arguments, 1).get$isSpecialNumber()) + if (!t1.$index($arguments, 2).get$isSpecialNumber()) { + t2 = alpha == null ? null : alpha.get$isSpecialNumber(); + t2 = t2 === true; + } else + t2 = true; + else + t2 = true; + else + t2 = true; + if (t2) + return A._functionString0($name, $arguments); + red = t1.$index($arguments, 0).assertNumber$1("red"); + green = t1.$index($arguments, 1).assertNumber$1("green"); + blue = t1.$index($arguments, 2).assertNumber$1("blue"); + t1 = A.fuzzyRound0(A._percentageOrUnitless0(red, 255, "red")); + t2 = A.fuzzyRound0(A._percentageOrUnitless0(green, 255, "green")); + t3 = A.fuzzyRound0(A._percentageOrUnitless0(blue, 255, "blue")); + t4 = A.NullableExtension_andThen0(alpha, new A._rgb_closure0()); + return A.SassColor$rgbInternal0(t1, t2, t3, t4 == null ? 1 : t4, B._ColorFormatEnum_rgbFunction0); + }, + _rgbTwoArg0($name, $arguments) { + var t2, color, + t1 = J.getInterceptor$asx($arguments); + if (!t1.$index($arguments, 0).get$isVar()) + t2 = !(t1.$index($arguments, 0) instanceof A.SassColor0) && t1.$index($arguments, 1).get$isVar(); + else + t2 = true; + if (t2) + return A._functionString0($name, $arguments); + else if (t1.$index($arguments, 1).get$isSpecialNumber()) { + color = t1.$index($arguments, 0).assertColor$1("color"); + return new A.SassString0($name + "(" + color.get$red(0) + ", " + color.get$green(0) + ", " + color.get$blue(0) + ", " + A.serializeValue0(t1.$index($arguments, 1), false, true) + ")", false); + } + return t1.$index($arguments, 0).assertColor$1("color").changeAlpha$1(A._percentageOrUnitless0(t1.$index($arguments, 1).assertNumber$1("alpha"), 1, "alpha")); + }, + _hsl0($name, $arguments) { + var t2, hue, saturation, lightness, t3, + _s10_ = "saturation", + _s9_ = "lightness", + t1 = J.getInterceptor$asx($arguments), + alpha = t1.get$length($arguments) > 3 ? t1.$index($arguments, 3) : null; + if (!t1.$index($arguments, 0).get$isSpecialNumber()) + if (!t1.$index($arguments, 1).get$isSpecialNumber()) + if (!t1.$index($arguments, 2).get$isSpecialNumber()) { + t2 = alpha == null ? null : alpha.get$isSpecialNumber(); + t2 = t2 === true; + } else + t2 = true; + else + t2 = true; + else + t2 = true; + if (t2) + return A._functionString0($name, $arguments); + hue = A._angleValue0(t1.$index($arguments, 0), "hue"); + saturation = t1.$index($arguments, 1).assertNumber$1(_s10_); + lightness = t1.$index($arguments, 2).assertNumber$1(_s9_); + A._checkPercent0(saturation, _s10_); + A._checkPercent0(lightness, _s9_); + t1 = B.JSNumber_methods.clamp$2(saturation._number1$_value, 0, 100); + t2 = B.JSNumber_methods.clamp$2(lightness._number1$_value, 0, 100); + t3 = A.NullableExtension_andThen0(alpha, new A._hsl_closure0()); + return A.SassColor$hslInternal0(hue, t1, t2, t3 == null ? 1 : t3, B._ColorFormatEnum_hslFunction0); + }, + _angleValue0(angleValue, $name) { + var t1, t2, + angle = angleValue.assertNumber$1($name); + if (angle.compatibleWithUnit$1("deg")) + return angle.coerceValueToUnit$1("deg"); + t1 = angle.toString$0(0); + t2 = angle.unitSuggestion$1($name); + A.EvaluationContext_current0().warn$2(0, "$" + $name + ": Passing a unit other than deg (" + t1 + string$.x29x20is_d + t2 + string$.x0a_See_, B.Deprecation_0bn); + return angle._number1$_value; + }, + _checkPercent0(number, $name) { + var t1, t2; + if (number.hasUnit$1("%")) + return; + t1 = number.toString$0(0); + t2 = number.unitSuggestion$2($name, "%"); + A.EvaluationContext_current0().warn$2(0, "$" + $name + ": Passing a number without unit % (" + t1 + string$.x29x20is_d + t2 + string$.x0a_Morex3a, B.Deprecation_0bn); + }, + _hwb0($arguments) { + var t2, t3, + _s9_ = "whiteness", + _s9_0 = "blackness", + t1 = J.getInterceptor$asx($arguments), + alpha = t1.get$length($arguments) > 3 ? t1.$index($arguments, 3) : null, + hue = A._angleValue0(t1.$index($arguments, 0), "hue"), + whiteness = t1.$index($arguments, 1).assertNumber$1(_s9_), + blackness = t1.$index($arguments, 2).assertNumber$1(_s9_0); + whiteness.assertUnit$2("%", _s9_); + blackness.assertUnit$2("%", _s9_0); + t1 = whiteness.valueInRange$3(0, 100, _s9_); + t2 = blackness.valueInRange$3(0, 100, _s9_0); + t3 = A.NullableExtension_andThen0(alpha, new A._hwb_closure0()); + return A.SassColor_SassColor$hwb0(hue, t1, t2, t3 == null ? 1 : t3); + }, + _parseChannels0($name, argumentNames, channels) { + var list, t1, channels0, alphaFromSlashList, isCommaSeparated, isBracketed, buffer, _0_4, _1_0, _1_2, _1_2_isSet, t2, _null = null, + _s17_ = "$channels must be"; + if (channels.get$isVar()) + return A._functionString0($name, A._setArrayType([channels], type$.JSArray_Value_2)); + if (channels.get$separator(channels) === B.ListSeparator_zg90) { + list = channels.get$asList(); + t1 = list.length; + if (t1 !== 2) + throw A.wrapException(A.SassScriptException$0(string$.Only_2 + t1 + " " + A.pluralize0("was", t1, "were") + " passed.", _null)); + channels0 = list[0]; + alphaFromSlashList = list[1]; + if (!alphaFromSlashList.get$isSpecialNumber()) + alphaFromSlashList.assertNumber$1("alpha"); + if (list[0].get$isVar()) + return A._functionString0($name, A._setArrayType([channels], type$.JSArray_Value_2)); + } else { + alphaFromSlashList = _null; + channels0 = channels; + } + isCommaSeparated = channels0.get$separator(channels0) === B.ListSeparator_rXA0; + isBracketed = channels0.get$hasBrackets(); + if (isCommaSeparated || isBracketed) { + buffer = new A.StringBuffer(_s17_); + if (isBracketed) { + t1 = _s17_ + " an unbracketed"; + buffer._contents = t1; + } else + t1 = _s17_; + if (isCommaSeparated) { + t1 += isBracketed ? "," : " a"; + buffer._contents = t1; + t1 = buffer._contents = t1 + " space-separated"; + } + buffer._contents = t1 + " list."; + throw A.wrapException(A.SassScriptException$0(buffer.toString$0(0), _null)); + } + list = channels0.get$asList(); + if (list.length >= 2) { + _0_4 = list[0]; + t1 = _0_4; + if (t1 instanceof A.SassString0) { + type$.SassString_2._as(_0_4); + t1 = !_0_4._string0$_hasQuotes && A.equalsIgnoreCase0(_0_4._string0$_text, "from"); + } else + t1 = false; + } else + t1 = false; + if (t1) + return A._functionString0($name, A._setArrayType([channels], type$.JSArray_Value_2)); + t1 = list.length; + if (t1 > 3) + throw A.wrapException(A.SassScriptException$0("Only 3 elements allowed, but " + t1 + " were passed.", _null)); + else if (t1 < 3) { + if (!B.JSArray_methods.any$1(list, new A._parseChannels_closure0())) + if (list.length !== 0) { + t1 = B.JSArray_methods.get$last(list); + if (t1 instanceof A.SassString0) + if (t1._string0$_hasQuotes) { + t1 = t1._string0$_text; + t1 = A.startsWithIgnoreCase0(t1, "var(") && B.JSString_methods.contains$1(t1, "/"); + } else + t1 = false; + else + t1 = false; + } else + t1 = false; + else + t1 = true; + if (t1) + return A._functionString0($name, A._setArrayType([channels], type$.JSArray_Value_2)); + else + throw A.wrapException(A.SassScriptException$0("Missing element " + argumentNames[list.length] + ".", _null)); + } + if (alphaFromSlashList != null) { + t1 = A.List_List$of(list, true, type$.Value_2); + t1.push(alphaFromSlashList); + return t1; + } + _1_0 = list[2]; + $label0$0: { + if (_1_0 instanceof A.SassNumber0) { + _1_2 = _1_0.asSlash; + t1 = type$.Record_2_nullable_Object_and_nullable_Object._is(_1_2); + _1_2_isSet = true; + } else { + _1_2 = _null; + _1_2_isSet = false; + t1 = false; + } + if (t1) { + if (_1_2_isSet) + t1 = _1_2; + else { + _1_2 = _1_0.asSlash; + t1 = _1_2; + _1_2_isSet = true; + } + if (t1 == null) + t1 = type$.Record_2_nullable_Object_and_nullable_Object._as(t1); + t2 = _1_2_isSet ? _1_2 : _1_0.asSlash; + if (t2 == null) + t2 = type$.Record_2_nullable_Object_and_nullable_Object._as(t2); + t2 = A._setArrayType([list[0], list[1], t1._0, t2._1], type$.JSArray_Value_2); + t1 = t2; + break $label0$0; + } + if (_1_0 instanceof A.SassString0) + if (!_1_0._string0$_hasQuotes) + t1 = B.JSString_methods.contains$1(_1_0._string0$_text, "/"); + else + t1 = false; + else + t1 = false; + if (t1) { + t1 = A._functionString0($name, A._setArrayType([channels0], type$.JSArray_Value_2)); + break $label0$0; + } + t1 = list; + break $label0$0; + } + return t1; + }, + _percentageOrUnitless0(number, max, $name) { + var value; + if (!number.get$hasUnits()) + value = number._number1$_value; + else if (number.hasUnit$1("%")) + value = max * number._number1$_value / 100; + else + throw A.wrapException(A.SassScriptException$0("$" + $name + ": Expected " + number.toString$0(0) + ' to have unit "%" or no units.', null)); + return B.JSNumber_methods.clamp$2(value, 0, max); + }, + _mixColors0(color1, color2, weight) { + var weightScale, normalizedWeight, t1, t2, alphaDistance, t3, weight1, weight2; + A._checkPercent0(weight, "weight"); + weightScale = weight.valueInRange$3(0, 100, "weight") / 100; + normalizedWeight = weightScale * 2 - 1; + t1 = color1._color1$_alpha; + t2 = color2._color1$_alpha; + alphaDistance = t1 - t2; + t3 = normalizedWeight * alphaDistance; + weight1 = ((t3 === -1 ? normalizedWeight : (normalizedWeight + alphaDistance) / (1 + t3)) + 1) / 2; + weight2 = 1 - weight1; + return A.SassColor$rgb0(A.fuzzyRound0(color1.get$red(0) * weight1 + color2.get$red(0) * weight2), A.fuzzyRound0(color1.get$green(0) * weight1 + color2.get$green(0) * weight2), A.fuzzyRound0(color1.get$blue(0) * weight1 + color2.get$blue(0) * weight2), t1 * weightScale + t2 * (1 - weightScale)); + }, + _opacify0($arguments) { + var t1 = J.getInterceptor$asx($arguments), + color = t1.$index($arguments, 0).assertColor$1("color"); + return color.changeAlpha$1(B.JSNumber_methods.clamp$2(color._color1$_alpha + t1.$index($arguments, 1).assertNumber$1("amount").valueInRangeWithUnit$4(0, 1, "amount", ""), 0, 1)); + }, + _transparentize0($arguments) { + var t1 = J.getInterceptor$asx($arguments), + color = t1.$index($arguments, 0).assertColor$1("color"); + return color.changeAlpha$1(B.JSNumber_methods.clamp$2(color._color1$_alpha - t1.$index($arguments, 1).assertNumber$1("amount").valueInRangeWithUnit$4(0, 1, "amount", ""), 0, 1)); + }, + _function11($name, $arguments, callback) { + return A.BuiltInCallable$function0($name, $arguments, callback, "sass:color"); + }, + global_closure32: function global_closure32() { + }, + global_closure33: function global_closure33() { + }, + global_closure34: function global_closure34() { + }, + global_closure35: function global_closure35() { + }, + global_closure36: function global_closure36() { + }, + global_closure37: function global_closure37() { + }, + global_closure38: function global_closure38() { + }, + global_closure39: function global_closure39() { + }, + global_closure40: function global_closure40() { + }, + global_closure41: function global_closure41() { + }, + global_closure42: function global_closure42() { + }, + global_closure43: function global_closure43() { + }, + global_closure44: function global_closure44() { + }, + global_closure45: function global_closure45() { + }, + global_closure46: function global_closure46() { + }, + global_closure47: function global_closure47() { + }, + global_closure48: function global_closure48() { + }, + global_closure49: function global_closure49() { + }, + global_closure50: function global_closure50() { + }, + global_closure51: function global_closure51() { + }, + global_closure52: function global_closure52() { + }, + global_closure53: function global_closure53() { + }, + global_closure54: function global_closure54() { + }, + global_closure55: function global_closure55() { + }, + global_closure56: function global_closure56() { + }, + global_closure57: function global_closure57() { + }, + global__closure0: function global__closure0() { + }, + global_closure58: function global_closure58() { + }, + module_closure12: function module_closure12() { + }, + module_closure13: function module_closure13() { + }, + module_closure14: function module_closure14() { + }, + module_closure15: function module_closure15() { + }, + module_closure16: function module_closure16() { + }, + module_closure17: function module_closure17() { + }, + module_closure18: function module_closure18() { + }, + module_closure19: function module_closure19() { + }, + module__closure4: function module__closure4() { + }, + module_closure20: function module_closure20() { + }, + _red_closure0: function _red_closure0() { + }, + _green_closure0: function _green_closure0() { + }, + _blue_closure0: function _blue_closure0() { + }, + _mix_closure0: function _mix_closure0() { + }, + _hue_closure0: function _hue_closure0() { + }, + _saturation_closure0: function _saturation_closure0() { + }, + _lightness_closure0: function _lightness_closure0() { + }, + _complement_closure0: function _complement_closure0() { + }, + _adjust_closure0: function _adjust_closure0() { + }, + _scale_closure0: function _scale_closure0() { + }, + _change_closure0: function _change_closure0() { + }, + _ieHexStr_closure0: function _ieHexStr_closure0() { + }, + _ieHexStr_closure_hexString0: function _ieHexStr_closure_hexString0() { + }, + _updateComponents_getParam0: function _updateComponents_getParam0(t0, t1, t2) { + this.keywords = t0; + this.scale = t1; + this.change = t2; + }, + _updateComponents_closure1: function _updateComponents_closure1() { + }, + _updateComponents_closure2: function _updateComponents_closure2() { + }, + _updateComponents_updateValue0: function _updateComponents_updateValue0(t0, t1) { + this.change = t0; + this.adjust = t1; + }, + _updateComponents_updateRgb0: function _updateComponents_updateRgb0(t0) { + this.updateValue = t0; + }, + _functionString_closure0: function _functionString_closure0() { + }, + _removedColorFunction_closure0: function _removedColorFunction_closure0(t0, t1, t2) { + this.name = t0; + this.argument = t1; + this.negative = t2; + }, + _rgb_closure0: function _rgb_closure0() { + }, + _hsl_closure0: function _hsl_closure0() { + }, + _hwb_closure0: function _hwb_closure0() { + }, + _parseChannels_closure0: function _parseChannels_closure0() { + }, + colorClass_closure: function colorClass_closure() { + }, + colorClass__closure: function colorClass__closure() { + }, + colorClass__closure0: function colorClass__closure0() { + }, + colorClass__closure1: function colorClass__closure1() { + }, + colorClass__closure2: function colorClass__closure2() { + }, + colorClass__closure3: function colorClass__closure3() { + }, + colorClass__closure4: function colorClass__closure4() { + }, + colorClass__closure5: function colorClass__closure5() { + }, + colorClass__closure6: function colorClass__closure6() { + }, + colorClass__closure7: function colorClass__closure7() { + }, + colorClass__closure8: function colorClass__closure8() { + }, + colorClass__closure9: function colorClass__closure9() { + }, + _Channels: function _Channels() { + }, + _NodeSassColor: function _NodeSassColor() { + }, + legacyColorClass_closure: function legacyColorClass_closure() { + }, + legacyColorClass_closure0: function legacyColorClass_closure0() { + }, + legacyColorClass_closure1: function legacyColorClass_closure1() { + }, + legacyColorClass_closure2: function legacyColorClass_closure2() { + }, + legacyColorClass_closure3: function legacyColorClass_closure3() { + }, + legacyColorClass_closure4: function legacyColorClass_closure4() { + }, + legacyColorClass_closure5: function legacyColorClass_closure5() { + }, + legacyColorClass_closure6: function legacyColorClass_closure6() { + }, + legacyColorClass_closure7: function legacyColorClass_closure7() { + }, + SassColor$rgb0(red, green, blue, alpha) { + var _null = null, + t1 = new A.SassColor0(red, green, blue, _null, _null, _null, A.fuzzyAssertRange0(A.SassColor__handleNullAlpha0(alpha), 0, 1, "alpha"), _null); + A.RangeError_checkValueInInterval(t1.get$red(0), 0, 255, "red"); + A.RangeError_checkValueInInterval(t1.get$green(0), 0, 255, "green"); + A.RangeError_checkValueInInterval(t1.get$blue(0), 0, 255, "blue"); + return t1; + }, + SassColor$rgbInternal0(_red, _green, _blue, alpha, format) { + var t1 = new A.SassColor0(_red, _green, _blue, null, null, null, A.fuzzyAssertRange0(alpha, 0, 1, "alpha"), format); + A.RangeError_checkValueInInterval(t1.get$red(0), 0, 255, "red"); + A.RangeError_checkValueInInterval(t1.get$green(0), 0, 255, "green"); + A.RangeError_checkValueInInterval(t1.get$blue(0), 0, 255, "blue"); + return t1; + }, + SassColor$hsl(hue, saturation, lightness, alpha) { + var _null = null, + t1 = A.SassColor__handleNullAlpha0(alpha); + return new A.SassColor0(_null, _null, _null, B.JSNumber_methods.$mod(hue, 360), A.fuzzyAssertRange0(saturation, 0, 100, "saturation"), A.fuzzyAssertRange0(lightness, 0, 100, "lightness"), A.fuzzyAssertRange0(t1, 0, 1, "alpha"), _null); + }, + SassColor$hslInternal0(hue, saturation, lightness, alpha, format) { + return new A.SassColor0(null, null, null, B.JSNumber_methods.$mod(hue, 360), A.fuzzyAssertRange0(saturation, 0, 100, "saturation"), A.fuzzyAssertRange0(lightness, 0, 100, "lightness"), A.fuzzyAssertRange0(alpha, 0, 1, "alpha"), format); + }, + SassColor_SassColor$hwb0(hue, whiteness, blackness, alpha) { + var t2, t1 = {}, + scaledHue = B.JSNumber_methods.$mod(hue, 360) / 360, + scaledWhiteness = t1.scaledWhiteness = A.fuzzyAssertRange0(whiteness, 0, 100, "whiteness") / 100, + scaledBlackness = A.fuzzyAssertRange0(blackness, 0, 100, "blackness") / 100, + sum = scaledWhiteness + scaledBlackness; + if (sum > 1) { + t2 = t1.scaledWhiteness = scaledWhiteness / sum; + scaledBlackness /= sum; + } else + t2 = scaledWhiteness; + t2 = new A.SassColor_SassColor$hwb_toRgb0(t1, 1 - t2 - scaledBlackness); + return A.SassColor$rgb0(t2.call$1(scaledHue + 0.3333333333333333), t2.call$1(scaledHue), t2.call$1(scaledHue - 0.3333333333333333), alpha); + }, + SassColor__handleNullAlpha0(alpha) { + if (alpha != null) + return alpha; + A.EvaluationContext_current0().warn$2(0, "Passing null for alpha in the JS API is deprecated.\nTo preserve current behavior, pass 1 or undefined instead.\nMore info: https://sass-lang.com/d/null-alpha", B.Deprecation_UZD); + return 1; + }, + SassColor__hueToRgb0(m1, m2, hue) { + var t1; + if (hue < 0) + ++hue; + if (hue > 1) + --hue; + $label0$0: { + if (hue < 0.16666666666666666) { + t1 = m1 + (m2 - m1) * hue * 6; + break $label0$0; + } + if (hue < 0.5) { + t1 = m2; + break $label0$0; + } + if (hue < 0.6666666666666666) { + t1 = m1 + (m2 - m1) * (0.6666666666666666 - hue) * 6; + break $label0$0; + } + t1 = m1; + break $label0$0; + } + return t1; + }, + SassColor0: function SassColor0(t0, t1, t2, t3, t4, t5, t6, t7) { + var _ = this; + _._color1$_red = t0; + _._color1$_green = t1; + _._color1$_blue = t2; + _._color1$_hue = t3; + _._color1$_saturation = t4; + _._color1$_lightness = t5; + _._color1$_alpha = t6; + _.format = t7; + }, + SassColor_SassColor$hwb_toRgb0: function SassColor_SassColor$hwb_toRgb0(t0, t1) { + this._box_0 = t0; + this.factor = t1; + }, + _ColorFormatEnum0: function _ColorFormatEnum0(t0) { + this._color1$_name = t0; + }, + SpanColorFormat0: function SpanColorFormat0(t0) { + this._color1$_span = t0; + }, + Combinator0: function Combinator0(t0, t1) { + this._combinator0$_text = t0; + this._name = t1; + }, + ModifiableCssComment0: function ModifiableCssComment0(t0, t1) { + var _ = this; + _.text = t0; + _.span = t1; + _._node$_indexInParent = _._node$_parent = null; + _.isGroupEnd = false; + }, + compile0(path, options) { + var color, ascii, result, error, stackTrace, t1, color0, ascii0, t2, t3, t4, t5, t6, t7, t8, t9, t10, exception, _null = null; + if (!A.isNodeJs()) + A.jsThrow(new self.Error("The compile() method is only available in Node.js.")); + t1 = options == null; + color0 = t1 ? _null : J.get$alertColor$x(options); + color = color0 == null ? A.hasTerminal0() : color0; + ascii0 = t1 ? _null : J.get$alertAscii$x(options); + ascii = ascii0 == null ? $._glyphs === B.C_AsciiGlyphSet : ascii0; + try { + t2 = t1 ? _null : J.get$loadPaths$x(options); + t3 = t1 ? _null : J.get$quietDeps$x(options); + if (t3 == null) + t3 = false; + t4 = A._parseOutputStyle0(t1 ? _null : J.get$style$x(options)); + t5 = t1 ? _null : J.get$verbose$x(options); + if (t5 == null) + t5 = false; + t6 = t1 ? _null : J.get$charset$x(options); + if (t6 == null) + t6 = true; + t7 = t1 ? _null : J.get$sourceMap$x(options); + if (t7 == null) + t7 = false; + t8 = t1 ? _null : J.get$logger$x(options); + t9 = ascii; + if (t9 == null) + t9 = $._glyphs === B.C_AsciiGlyphSet; + t9 = new A.JSToDartLogger(t8, new A.StderrLogger0(color), t9); + if (t1) + t8 = _null; + else { + t8 = J.get$importers$x(options); + t8 = t8 == null ? _null : J.map$1$1$ax(t8, A.compile___parseImporter$closure(), type$.Importer); + } + t10 = A._parseFunctions0(t1 ? _null : J.get$functions$x(options), false); + result = A.compile(path, t6, _null, new A.CastList(t10, A._arrayInstanceType(t10)._eval$1("CastList<1,Callable>")), _null, A.ImportCache$0(t8, t2, t9, _null), _null, _null, t9, _null, t3, t7, t4, _null, true, t5); + t1 = t1 ? _null : J.get$sourceMapIncludeSources$x(options); + if (t1 == null) + t1 = false; + t1 = A._convertResult(result, t1); + return t1; + } catch (exception) { + t1 = A.unwrapException(exception); + if (t1 instanceof A.SassException0) { + error = t1; + stackTrace = A.getTraceFromException(exception); + A.throwNodeException(error, ascii, color, stackTrace); + } else + throw exception; + } + }, + compileString0(text, options) { + var result, error, stackTrace, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, exception, _null = null, + t1 = options == null, + color0 = t1 ? _null : J.get$alertColor$x(options), + color = color0 == null ? A.hasTerminal0() : color0, + ascii0 = t1 ? _null : J.get$alertAscii$x(options), + ascii = ascii0 == null ? $._glyphs === B.C_AsciiGlyphSet : ascii0; + try { + t2 = A.parseSyntax(t1 ? _null : J.get$syntax$x(options)); + t3 = t1 ? _null : A.NullableExtension_andThen0(J.get$url$x(options), A.utils1__jsToDartUrl$closure()); + t4 = t1 ? _null : J.get$loadPaths$x(options); + t5 = t1 ? _null : J.get$quietDeps$x(options); + if (t5 == null) + t5 = false; + t6 = A._parseOutputStyle0(t1 ? _null : J.get$style$x(options)); + t7 = t1 ? _null : J.get$verbose$x(options); + if (t7 == null) + t7 = false; + t8 = t1 ? _null : J.get$charset$x(options); + if (t8 == null) + t8 = true; + t9 = t1 ? _null : J.get$sourceMap$x(options); + if (t9 == null) + t9 = false; + t10 = t1 ? _null : J.get$logger$x(options); + t11 = ascii; + if (t11 == null) + t11 = $._glyphs === B.C_AsciiGlyphSet; + t11 = new A.JSToDartLogger(t10, new A.StderrLogger0(color), t11); + if (t1) + t10 = _null; + else { + t10 = J.get$importers$x(options); + t10 = t10 == null ? _null : J.map$1$1$ax(t10, A.compile___parseImporter$closure(), type$.Importer); + } + t12 = t1 ? _null : A.NullableExtension_andThen0(J.get$importer$x(options), A.compile___parseImporter$closure()); + if (t12 == null) + t12 = (t1 ? _null : J.get$url$x(options)) == null ? new A.NoOpImporter0() : _null; + t13 = A._parseFunctions0(t1 ? _null : J.get$functions$x(options), false); + result = A.compileString(text, t8, _null, new A.CastList(t13, A._arrayInstanceType(t13)._eval$1("CastList<1,Callable>")), _null, A.ImportCache$0(t10, t4, t11, _null), t12, _null, _null, t11, _null, t5, t9, t6, t2, t3, true, t7); + t1 = t1 ? _null : J.get$sourceMapIncludeSources$x(options); + if (t1 == null) + t1 = false; + t1 = A._convertResult(result, t1); + return t1; + } catch (exception) { + t1 = A.unwrapException(exception); + if (t1 instanceof A.SassException0) { + error = t1; + stackTrace = A.getTraceFromException(exception); + A.throwNodeException(error, ascii, color, stackTrace); + } else + throw exception; + } + }, + compileAsync1(path, options) { + var t1, color, ascii; + if (!A.isNodeJs()) + A.jsThrow(new self.Error("The compileAsync() method is only available in Node.js.")); + t1 = options == null; + color = t1 ? null : J.get$alertColor$x(options); + if (color == null) + color = A.hasTerminal0(); + ascii = t1 ? null : J.get$alertAscii$x(options); + if (ascii == null) + ascii = $._glyphs === B.C_AsciiGlyphSet; + return A._wrapAsyncSassExceptions(A.futureToPromise0(new A.compileAsync_closure(path, color, options, ascii).call$0()), ascii, color); + }, + compileStringAsync1(text, options) { + var ascii, + t1 = options == null, + color = t1 ? null : J.get$alertColor$x(options); + if (color == null) + color = A.hasTerminal0(); + ascii = t1 ? null : J.get$alertAscii$x(options); + if (ascii == null) + ascii = $._glyphs === B.C_AsciiGlyphSet; + return A._wrapAsyncSassExceptions(A.futureToPromise0(new A.compileStringAsync_closure(text, options, color, ascii).call$0()), ascii, color); + }, + _convertResult(result, includeSourceContents) { + var loadedUrls, + t1 = result._compile_result$_serialize, + t2 = t1._1, + sourceMap = t2 == null ? null : t2.toJson$1$includeSourceContents(includeSourceContents); + if (type$.Map_String_dynamic._is(sourceMap) && !sourceMap.containsKey$1("sources")) + sourceMap.$indexSet(0, "sources", A._setArrayType([], type$.JSArray_String)); + loadedUrls = A.toJSArray(result._evaluate._0.map$1$1(0, A.utils1__dartToJSUrl$closure(), type$.nullable_Object)); + t1 = t1._0; + return sourceMap == null ? {css: t1, loadedUrls: loadedUrls} : {css: t1, sourceMap: A.jsify(sourceMap), loadedUrls: loadedUrls}; + }, + _wrapAsyncSassExceptions(promise, ascii, color) { + return J.then$2$x(promise, null, A.allowInterop(new A._wrapAsyncSassExceptions_closure(color, ascii))); + }, + _parseOutputStyle0(style) { + var t1; + $label0$0: { + if (style == null || "expanded" === style) { + t1 = B.OutputStyle_00; + break $label0$0; + } + if ("compressed" === style) { + t1 = B.OutputStyle_10; + break $label0$0; + } + t1 = A.jsThrow(new self.Error('Unknown output style "' + A.S(style) + '".')); + } + return t1; + }, + _parseAsyncImporter(importer) { + var t1, canonicalize, load, _0_0; + if (importer instanceof A.NodePackageImporter0) + return importer; + if (importer == null) + A.jsThrow(new self.Error("Importers may not be null.")); + type$.JSImporter._as(importer); + t1 = J.getInterceptor$x(importer); + canonicalize = t1.get$canonicalize(importer); + load = t1.get$load(importer); + _0_0 = t1.get$findFileUrl(importer); + if (_0_0 != null) + if (canonicalize != null || load != null) + A.jsThrow(new self.Error(string$.An_impa)); + else + return new A.JSToDartAsyncFileImporter(_0_0); + else if (canonicalize == null || load == null) + A.jsThrow(new self.Error(string$.An_impu)); + else { + t1 = A._normalizeNonCanonicalSchemes(t1.get$nonCanonicalScheme(importer)); + t1 = t1 == null ? B.Set_empty7 : A.Set_Set$unmodifiable(t1, type$.String); + t1.forEach$1(0, A.utils2__validateUrlScheme$closure()); + return new A.JSToDartAsyncImporter(canonicalize, load, t1); + } + }, + _parseImporter0(importer) { + var t1, canonicalize, load, _0_0; + if (importer instanceof A.NodePackageImporter0) + return importer; + if (importer == null) + A.jsThrow(new self.Error("Importers may not be null.")); + type$.JSImporter._as(importer); + t1 = J.getInterceptor$x(importer); + canonicalize = t1.get$canonicalize(importer); + load = t1.get$load(importer); + _0_0 = t1.get$findFileUrl(importer); + if (_0_0 != null) + if (canonicalize != null || load != null) + A.jsThrow(new self.Error(string$.An_impa)); + else + return new A.JSToDartFileImporter(_0_0); + else if (canonicalize == null || load == null) + A.jsThrow(new self.Error(string$.An_impu)); + else { + t1 = A._normalizeNonCanonicalSchemes(t1.get$nonCanonicalScheme(importer)); + t1 = t1 == null ? B.Set_empty7 : A.Set_Set$unmodifiable(t1, type$.String); + t1.forEach$1(0, A.utils2__validateUrlScheme$closure()); + return new A.JSToDartImporter(canonicalize, load, t1); + } + }, + _normalizeNonCanonicalSchemes(schemes) { + var t1; + $label0$0: { + if (typeof schemes == "string") { + t1 = A._setArrayType([schemes], type$.JSArray_String); + break $label0$0; + } + if (type$.List_dynamic._is(schemes)) { + t1 = J.cast$1$0$ax(schemes, type$.String); + break $label0$0; + } + if (schemes == null) { + t1 = null; + break $label0$0; + } + t1 = A.jsThrow(new self.Error('nonCanonicalScheme must be a string or list of strings, was "' + A.S(schemes) + '"')); + } + return t1; + }, + _simplifyValue(value) { + var _0_1, t1, t2, _0_4, _0_3, _0_10, _0_5, _0_40, _0_5_isSet, _0_4_isSet, _0_8, first, _0_1_isSet, _0_100, min, _null = null; + $label1$1: { + if (value instanceof A.SassCalculation0) { + _0_1 = value.name; + t1 = value.$arguments; + t2 = A._arrayInstanceType(t1)._eval$1("MappedListIterable<1,Object>"); + _0_4 = A.List_List$of(new A.MappedListIterable(t1, A.compile___simplifyCalcArg$closure(), t2), true, t2._eval$1("ListIterable.E")); + $label0$0: { + _0_3 = "calc" === _0_1; + t1 = _0_3; + _0_10 = _0_1; + if (t1) { + _0_5 = _0_4.length; + t1 = _0_5; + _0_40 = _0_4; + t1 = t1 === 1; + _0_5_isSet = true; + _0_4_isSet = true; + } else { + _0_40 = _null; + _0_5 = _0_40; + _0_5_isSet = false; + _0_4_isSet = false; + t1 = false; + } + if (t1) { + _0_8 = (_0_4_isSet ? _0_40 : _0_4)[0]; + first = _0_8; + type$.Value_2._as(first); + t1 = first; + break $label0$0; + } + if (_0_3) + A.throwExpression(A.ArgumentError$("calc() requires exactly one argument.", _null)); + t1 = _0_10; + _0_1_isSet = true; + _0_100 = "clamp" === t1; + t1 = _0_100; + if (t1) { + if (_0_5_isSet) + t1 = _0_5; + else { + if (_0_4_isSet) + t1 = _0_40; + else { + t1 = _0_4; + _0_40 = t1; + _0_4_isSet = true; + } + _0_5 = t1.length; + t1 = _0_5; + } + t1 = t1 === 3; + } else + t1 = false; + if (t1) { + if (_0_4_isSet) + t1 = _0_40; + else { + t1 = _0_4; + _0_40 = t1; + _0_4_isSet = true; + } + _0_8 = t1[0]; + min = _0_8; + if (_0_4_isSet) + t1 = _0_40; + else { + t1 = _0_4; + _0_40 = t1; + _0_4_isSet = true; + } + value = t1[1]; + t1 = A.SassCalculation_clamp0(min, value, (_0_4_isSet ? _0_40 : _0_4)[2]); + break $label0$0; + } + if (_0_100) + A.throwExpression(A.ArgumentError$("clamp() requires exactly 3 arguments.", _null)); + if (_0_1_isSet) + t1 = _0_10; + else { + t1 = _0_1; + _0_10 = t1; + _0_1_isSet = true; + } + if ("min" === t1) { + t1 = A.SassCalculation_min0(_0_4_isSet ? _0_40 : _0_4); + break $label0$0; + } + if (_0_1_isSet) + t1 = _0_10; + else { + t1 = _0_1; + _0_10 = t1; + _0_1_isSet = true; + } + if ("max" === t1) { + t1 = A.SassCalculation_max0(_0_4_isSet ? _0_40 : _0_4); + break $label0$0; + } + t1 = A.throwExpression(A.ArgumentError$('"' + (_0_1_isSet ? _0_10 : _0_1) + '" is not a recognized calculation type.', _null)); + } + break $label1$1; + } + t1 = value; + break $label1$1; + } + return t1; + }, + _simplifyCalcArg(value) { + var t1; + $label0$0: { + if (value instanceof A.SassCalculation0) { + t1 = A._simplifyValue(value); + break $label0$0; + } + if (value instanceof A.CalculationOperation0) { + t1 = A.SassCalculation_operateInternal0(value._calculation0$_operator, A._simplifyCalcArg(value._calculation0$_left), A._simplifyCalcArg(value._calculation0$_right), false, true); + break $label0$0; + } + t1 = value; + break $label0$0; + } + return t1; + }, + _parseFunctions0(functions, asynch) { + var result; + if (functions == null) + return B.List_empty24; + result = A._setArrayType([], type$.JSArray_AsyncCallable_2); + A.jsForEach(functions, new A._parseFunctions_closure0(asynch, result)); + return result; + }, + compileAsync_closure: function compileAsync_closure(t0, t1, t2, t3) { + var _ = this; + _.path = t0; + _.color = t1; + _.options = t2; + _.ascii = t3; + }, + compileAsync__closure: function compileAsync__closure() { + }, + compileStringAsync_closure: function compileStringAsync_closure(t0, t1, t2, t3) { + var _ = this; + _.text = t0; + _.options = t1; + _.color = t2; + _.ascii = t3; + }, + compileStringAsync__closure: function compileStringAsync__closure() { + }, + compileStringAsync__closure0: function compileStringAsync__closure0() { + }, + _wrapAsyncSassExceptions_closure: function _wrapAsyncSassExceptions_closure(t0, t1) { + this.color = t0; + this.ascii = t1; + }, + _parseFunctions_closure0: function _parseFunctions_closure0(t0, t1) { + this.asynch = t0; + this.result = t1; + }, + _parseFunctions__closure2: function _parseFunctions__closure2(t0, t1) { + this.callback = t0; + this.callable = t1; + }, + _parseFunctions___closure6: function _parseFunctions___closure6(t0, t1) { + this.callback = t0; + this.$arguments = t1; + }, + _parseFunctions__closure3: function _parseFunctions__closure3(t0, t1) { + this.callback = t0; + this.callable = t1; + }, + _parseFunctions___closure5: function _parseFunctions___closure5(t0, t1) { + this.callback = t0; + this.$arguments = t1; + }, + nodePackageImporterClass_closure: function nodePackageImporterClass_closure() { + }, + nodePackageImporterClass__closure: function nodePackageImporterClass__closure() { + }, + compile(path, charset, fatalDeprecations, functions, futureDeprecations, importCache, indentWidth, lineFeed, logger, nodeImporter, quietDeps, sourceMap, style, syntax, useSpaces, verbose) { + var t2, t3, t4, t0, stylesheet, result, _null = null, + t1 = type$.Deprecation_2; + logger = new A.DeprecationHandlingLogger0(A.LinkedHashMap_LinkedHashMap$_empty(t1, type$.int), logger, A.LinkedHashSet_LinkedHashSet$_empty(t1), A.LinkedHashSet_LinkedHashSet$_empty(t1), !verbose); + t1 = nodeImporter == null; + if (t1) + t2 = syntax == null || syntax === A.Syntax_forPath0(path); + else + t2 = false; + if (t2) { + if (importCache == null) + importCache = A.ImportCache$none(logger); + t2 = $.$get$FilesystemImporter_cwd0(); + t3 = A.isNodeJs() ? self.process : _null; + if (!J.$eq$(t3 == null ? _null : J.get$platform$x(t3), "win32")) { + t3 = A.isNodeJs() ? self.process : _null; + t3 = J.$eq$(t3 == null ? _null : J.get$platform$x(t3), "darwin"); + } else + t3 = true; + if (t3) { + t3 = $.$get$context(); + t4 = A._realCasePath0(A.absolute(t3.normalize$1(path), _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null)); + t0 = t4; + t4 = t3; + t3 = t0; + } else { + t3 = $.$get$context(); + t4 = t3.canonicalize$1(0, path); + t0 = t4; + t4 = t3; + t3 = t0; + } + t4 = importCache.importCanonical$3$originalUrl(t2, t4.toUri$1(t3), t4.toUri$1(path)); + t4.toString; + stylesheet = t4; + } else { + t2 = A.readFile0(path); + t3 = syntax == null ? A.Syntax_forPath0(path) : syntax; + stylesheet = A.Stylesheet_Stylesheet$parse0(t2, t3, logger, $.$get$context().toUri$1(path)); + } + result = A._compileStylesheet1(stylesheet, logger, importCache, nodeImporter, $.$get$FilesystemImporter_cwd0(), functions, style, useSpaces, indentWidth, lineFeed, quietDeps, sourceMap, charset); + logger.summarize$1$js(!t1); + return result; + }, + compileString(source, charset, fatalDeprecations, functions, futureDeprecations, importCache, importer, indentWidth, lineFeed, logger, nodeImporter, quietDeps, sourceMap, style, syntax, url, useSpaces, verbose) { + var stylesheet, result, + t1 = type$.Deprecation_2; + logger = new A.DeprecationHandlingLogger0(A.LinkedHashMap_LinkedHashMap$_empty(t1, type$.int), logger, A.LinkedHashSet_LinkedHashSet$_empty(t1), A.LinkedHashSet_LinkedHashSet$_empty(t1), !verbose); + stylesheet = A.Stylesheet_Stylesheet$parse0(source, syntax == null ? B.Syntax_SCSS_scss0 : syntax, logger, url); + if (importer == null) + t1 = A.isBrowser() ? new A.NoOpImporter0() : $.$get$FilesystemImporter_cwd0(); + else + t1 = importer; + result = A._compileStylesheet1(stylesheet, logger, importCache, nodeImporter, t1, functions, style, useSpaces, indentWidth, lineFeed, quietDeps, sourceMap, charset); + logger.summarize$1$js(nodeImporter != null); + return result; + }, + _compileStylesheet1(stylesheet, logger, importCache, nodeImporter, importer, functions, style, useSpaces, indentWidth, lineFeed, quietDeps, sourceMap, charset) { + var evaluateResult = A._EvaluateVisitor$1(functions, importCache, logger, nodeImporter, quietDeps, sourceMap).run$2(0, importer, stylesheet), + serializeResult = A.serialize0(evaluateResult._1, charset, indentWidth, false, lineFeed, sourceMap, style, useSpaces), + resultSourceMap = serializeResult._1; + if (resultSourceMap != null && importCache != null) + A.mapInPlace0(resultSourceMap.urls, new A._compileStylesheet_closure1(stylesheet, importCache)); + return new A.CompileResult0(evaluateResult, serializeResult); + }, + _compileStylesheet_closure1: function _compileStylesheet_closure1(t0, t1) { + this.stylesheet = t0; + this.importCache = t1; + }, + CompileOptions: function CompileOptions() { + }, + CompileStringOptions: function CompileStringOptions() { + }, + NodeCompileResult: function NodeCompileResult() { + }, + CompileResult0: function CompileResult0(t0, t1) { + this._evaluate = t0; + this._compile_result$_serialize = t1; + }, + initCompiler() { + return new A.Compiler(); + }, + initAsyncCompiler() { + return A.futureToPromise0(new A.initAsyncCompiler_closure().call$0()); + }, + Compiler: function Compiler() { + this._disposed = false; + }, + AsyncCompiler: function AsyncCompiler(t0) { + this.compilations = t0; + this._disposed = false; + }, + AsyncCompiler_addCompilation_closure: function AsyncCompiler_addCompilation_closure() { + }, + compilerClass_closure: function compilerClass_closure() { + }, + compilerClass__closure: function compilerClass__closure() { + }, + compilerClass__closure0: function compilerClass__closure0() { + }, + compilerClass__closure1: function compilerClass__closure1() { + }, + compilerClass__closure2: function compilerClass__closure2() { + }, + asyncCompilerClass_closure: function asyncCompilerClass_closure() { + }, + asyncCompilerClass__closure: function asyncCompilerClass__closure() { + }, + asyncCompilerClass__closure0: function asyncCompilerClass__closure0() { + }, + asyncCompilerClass__closure1: function asyncCompilerClass__closure1() { + }, + asyncCompilerClass__closure2: function asyncCompilerClass__closure2() { + }, + asyncCompilerClass___closure: function asyncCompilerClass___closure(t0) { + this.self = t0; + }, + initAsyncCompiler_closure: function initAsyncCompiler_closure() { + }, + ComplexSassNumber0: function ComplexSassNumber0(t0, t1, t2, t3) { + var _ = this; + _._complex0$_numeratorUnits = t0; + _._complex0$_denominatorUnits = t1; + _._number1$_value = t2; + _.hashCache = null; + _.asSlash = t3; + }, + ComplexSelector$0(leadingCombinators, components, span, lineBreak) { + var t1 = A.List_List$unmodifiable(leadingCombinators, type$.CssValue_Combinator_2), + t2 = A.List_List$unmodifiable(components, type$.ComplexSelectorComponent_2); + if (t1.length === 0 && t2.length === 0) + A.throwExpression(A.ArgumentError$(string$.leadin, null)); + return new A.ComplexSelector0(t1, t2, lineBreak, span); + }, + ComplexSelector0: function ComplexSelector0(t0, t1, t2, t3) { + var _ = this; + _.leadingCombinators = t0; + _.components = t1; + _.lineBreak = t2; + _._complex$__ComplexSelector_specificity_FI = $; + _.span = t3; + }, + ComplexSelector_specificity_closure0: function ComplexSelector_specificity_closure0() { + }, + ComplexSelectorComponent0: function ComplexSelectorComponent0(t0, t1, t2) { + this.selector = t0; + this.combinators = t1; + this.span = t2; + }, + ComplexSelectorComponent_toString_closure0: function ComplexSelectorComponent_toString_closure0() { + }, + CompoundSelector$0(components, span) { + var t1 = A.List_List$unmodifiable(components, type$.SimpleSelector_2); + if (t1.length === 0) + A.throwExpression(A.ArgumentError$("components may not be empty.", null)); + return new A.CompoundSelector0(t1, span); + }, + CompoundSelector0: function CompoundSelector0(t0, t1) { + this.components = t0; + this._compound$__CompoundSelector_specificity_FI = $; + this.span = t1; + }, + CompoundSelector_specificity_closure0: function CompoundSelector_specificity_closure0() { + }, + Configuration0: function Configuration0(t0, t1) { + this._configuration0$_values = t0; + this._configuration0$__originalConfiguration = t1; + }, + ExplicitConfiguration0: function ExplicitConfiguration0(t0, t1, t2) { + this.nodeWithSpan = t0; + this._configuration0$_values = t1; + this._configuration0$__originalConfiguration = t2; + }, + ConfiguredValue0: function ConfiguredValue0(t0, t1, t2) { + this.value = t0; + this.configurationSpan = t1; + this.assignmentNode = t2; + }, + ConfiguredVariable0: function ConfiguredVariable0(t0, t1, t2, t3) { + var _ = this; + _.name = t0; + _.expression = t1; + _.isGuarded = t2; + _.span = t3; + }, + ContentBlock$0($arguments, children, span) { + var t1 = A.List_List$unmodifiable(children, type$.Statement_2), + t2 = B.JSArray_methods.any$1(t1, new A.ParentStatement_closure0()); + return new A.ContentBlock0("@content", $arguments, span, t1, t2); + }, + ContentBlock0: function ContentBlock0(t0, t1, t2, t3, t4) { + var _ = this; + _.name = t0; + _.$arguments = t1; + _.span = t2; + _.children = t3; + _.hasDeclarations = t4; + }, + ContentRule0: function ContentRule0(t0, t1) { + this.$arguments = t0; + this.span = t1; + }, + _disallowedFunctionNames_closure0: function _disallowedFunctionNames_closure0() { + }, + CssParser0: function CssParser0(t0, t1, t2, t3) { + var _ = this; + _._stylesheet0$_isUseAllowed = true; + _._stylesheet0$_inExpression = _._stylesheet0$_inParentheses = _._stylesheet0$_inStyleRule = _._stylesheet0$_inUnknownAtRule = _._stylesheet0$_inControlDirective = _._stylesheet0$_inContentBlock = _._stylesheet0$_inMixin = false; + _._stylesheet0$_globalVariables = t0; + _.lastSilentComment = null; + _.scanner = t1; + _.logger = t2; + _._parser0$_interpolationMap = t3; + }, + DebugRule0: function DebugRule0(t0, t1) { + this.expression = t0; + this.span = t1; + }, + ModifiableCssDeclaration$0($name, value, span, parsedAsCustomProperty, valueSpanForMap) { + var t2, + t1 = valueSpanForMap == null ? value.span : valueSpanForMap; + if (parsedAsCustomProperty) + if (!J.startsWith$1$s($name.value, "--")) + A.throwExpression(A.ArgumentError$(string$.parsed, null)); + else { + t2 = value.value; + if (!(t2 instanceof A.SassString0)) + A.throwExpression(A.ArgumentError$(string$.If_par + value.toString$0(0) + "` of type " + A.getRuntimeTypeOfDartObject(t2).toString$0(0) + ").", null)); + } + return new A.ModifiableCssDeclaration0($name, value, parsedAsCustomProperty, t1, span); + }, + ModifiableCssDeclaration0: function ModifiableCssDeclaration0(t0, t1, t2, t3, t4) { + var _ = this; + _.name = t0; + _.value = t1; + _.parsedAsCustomProperty = t2; + _.valueSpanForMap = t3; + _.span = t4; + _._node$_indexInParent = _._node$_parent = null; + _.isGroupEnd = false; + }, + Declaration$0($name, value, span) { + return new A.Declaration0($name, value, span, null, false); + }, + Declaration$nested0($name, children, span, value) { + var t1 = A.List_List$unmodifiable(children, type$.Statement_2), + t2 = B.JSArray_methods.any$1(t1, new A.ParentStatement_closure0()); + return new A.Declaration0($name, value, span, t1, t2); + }, + Declaration0: function Declaration0(t0, t1, t2, t3, t4) { + var _ = this; + _.name = t0; + _.value = t1; + _.span = t2; + _.children = t3; + _.hasDeclarations = t4; + }, + SupportsDeclaration0: function SupportsDeclaration0(t0, t1, t2) { + this.name = t0; + this.value = t1; + this.span = t2; + }, + Deprecation0: function Deprecation0(t0, t1, t2) { + this.id = t0; + this.isFuture = t1; + this._name = t2; + }, + DeprecationHandlingLogger0: function DeprecationHandlingLogger0(t0, t1, t2, t3, t4) { + var _ = this; + _._deprecation_handling$_warningCounts = t0; + _._deprecation_handling$_inner = t1; + _.fatalDeprecations = t2; + _.futureDeprecations = t3; + _.limitRepetition = t4; + }, + DeprecationHandlingLogger_summarize_closure1: function DeprecationHandlingLogger_summarize_closure1() { + }, + DeprecationHandlingLogger_summarize_closure2: function DeprecationHandlingLogger_summarize_closure2() { + }, + DynamicImport0: function DynamicImport0(t0, t1) { + this.urlString = t0; + this.span = t1; + }, + EachRule$0(variables, list, children, span) { + var t1 = A.List_List$unmodifiable(variables, type$.String), + t2 = A.List_List$unmodifiable(children, type$.Statement_2), + t3 = B.JSArray_methods.any$1(t2, new A.ParentStatement_closure0()); + return new A.EachRule0(t1, list, span, t2, t3); + }, + EachRule0: function EachRule0(t0, t1, t2, t3, t4) { + var _ = this; + _.variables = t0; + _.list = t1; + _.span = t2; + _.children = t3; + _.hasDeclarations = t4; + }, + EachRule_toString_closure0: function EachRule_toString_closure0() { + }, + EmptyExtensionStore0: function EmptyExtensionStore0() { + }, + Environment$0() { + var t1 = type$.String, + t2 = type$.Module_Callable_2, + t3 = type$.AstNode_2, + t4 = type$.int, + t5 = type$.Callable_2, + t6 = type$.JSArray_Map_String_Callable_2; + return new A.Environment0(A.LinkedHashMap_LinkedHashMap$_empty(t1, t2), A.LinkedHashMap_LinkedHashMap$_empty(t1, t3), A.LinkedHashMap_LinkedHashMap$_empty(t2, t3), A.LinkedHashMap_LinkedHashMap$_empty(t2, t3), null, null, A._setArrayType([], type$.JSArray_Module_Callable_2), A._setArrayType([A.LinkedHashMap_LinkedHashMap$_empty(t1, type$.Value_2)], type$.JSArray_Map_String_Value_2), A._setArrayType([A.LinkedHashMap_LinkedHashMap$_empty(t1, t3)], type$.JSArray_Map_String_AstNode_2), A.LinkedHashMap_LinkedHashMap$_empty(t1, t4), A._setArrayType([A.LinkedHashMap_LinkedHashMap$_empty(t1, t5)], t6), A.LinkedHashMap_LinkedHashMap$_empty(t1, t4), A._setArrayType([A.LinkedHashMap_LinkedHashMap$_empty(t1, t5)], t6), A.LinkedHashMap_LinkedHashMap$_empty(t1, t4), null); + }, + Environment$_0(_modules, _namespaceNodes, _globalModules, _importedModules, _forwardedModules, _nestedForwardedModules, _allModules, _variables, _variableNodes, _functions, _mixins, _content) { + var t1 = type$.String, + t2 = type$.int; + return new A.Environment0(_modules, _namespaceNodes, _globalModules, _importedModules, _forwardedModules, _nestedForwardedModules, _allModules, _variables, _variableNodes, A.LinkedHashMap_LinkedHashMap$_empty(t1, t2), _functions, A.LinkedHashMap_LinkedHashMap$_empty(t1, t2), _mixins, A.LinkedHashMap_LinkedHashMap$_empty(t1, t2), _content); + }, + _EnvironmentModule__EnvironmentModule1(environment, css, preModuleComments, extensionStore, forwarded) { + var t1, t2, t3, t4, t5, t6, module, result, t7; + if (forwarded == null) + forwarded = B.Set_empty4; + t1 = type$.dynamic; + t1 = A.LinkedHashMap_LinkedHashMap$_empty(t1, t1); + for (t2 = type$.Module_Callable_2, t3 = type$.List_CssComment_2, t4 = A.MapExtensions_get_pairs0(preModuleComments, t2, t3), t4 = t4.get$iterator(t4), t5 = type$.CssComment_2; t4.moveNext$0();) { + t6 = t4.get$current(t4); + module = t6._0; + result = A.List_List$from(t6._1, false, t5); + result.fixed$length = Array; + result.immutable$list = Array; + t1.$indexSet(0, module, result); + } + t1 = A.ConstantMap_ConstantMap$from(t1, t2, t3); + t2 = A._EnvironmentModule__makeModulesByVariable1(forwarded); + t3 = A._EnvironmentModule__memberMap1(B.JSArray_methods.get$first(environment._environment0$_variables), forwarded.map$1$1(0, new A._EnvironmentModule__EnvironmentModule_closure11(), type$.Map_String_Value_2), type$.Value_2); + t4 = A._EnvironmentModule__memberMap1(B.JSArray_methods.get$first(environment._environment0$_variableNodes), forwarded.map$1$1(0, new A._EnvironmentModule__EnvironmentModule_closure12(), type$.Map_String_AstNode_2), type$.AstNode_2); + t5 = type$.Map_String_Callable_2; + t6 = type$.Callable_2; + t7 = A._EnvironmentModule__memberMap1(B.JSArray_methods.get$first(environment._environment0$_functions), forwarded.map$1$1(0, new A._EnvironmentModule__EnvironmentModule_closure13(), t5), t6); + t6 = A._EnvironmentModule__memberMap1(B.JSArray_methods.get$first(environment._environment0$_mixins), forwarded.map$1$1(0, new A._EnvironmentModule__EnvironmentModule_closure14(), t5), t6); + t5 = J.get$isNotEmpty$asx(css.get$children(css)) || preModuleComments.get$isNotEmpty(preModuleComments) || B.JSArray_methods.any$1(environment._environment0$_allModules, new A._EnvironmentModule__EnvironmentModule_closure15()); + return A._EnvironmentModule$_1(environment, css, t1, extensionStore, t2, t3, t4, t7, t6, t5, !extensionStore.get$isEmpty(extensionStore) || B.JSArray_methods.any$1(environment._environment0$_allModules, new A._EnvironmentModule__EnvironmentModule_closure16())); + }, + _EnvironmentModule__makeModulesByVariable1(forwarded) { + var modulesByVariable, t1, t2, t3, t4, t5; + if (forwarded.get$isEmpty(forwarded)) + return B.Map_empty10; + modulesByVariable = A.LinkedHashMap_LinkedHashMap$_empty(type$.String, type$.Module_Callable_2); + for (t1 = forwarded.get$iterator(forwarded); t1.moveNext$0();) { + t2 = t1.get$current(t1); + if (t2 instanceof A._EnvironmentModule1) { + for (t3 = t2._environment0$_modulesByVariable, t3 = t3.get$values(t3), t3 = t3.get$iterator(t3); t3.moveNext$0();) { + t4 = t3.get$current(t3); + t5 = t4.get$variables(); + A.setAll0(modulesByVariable, t5.get$keys(t5), t4); + } + A.setAll0(modulesByVariable, J.get$keys$z(B.JSArray_methods.get$first(t2._environment0$_environment._environment0$_variables)), t2); + } else { + t3 = t2.get$variables(); + A.setAll0(modulesByVariable, t3.get$keys(t3), t2); + } + } + return modulesByVariable; + }, + _EnvironmentModule__memberMap1(localMap, otherMaps, $V) { + var t1, t2, t3; + localMap = new A.PublicMemberMapView0(localMap, $V._eval$1("PublicMemberMapView0<0>")); + if (otherMaps.get$isEmpty(otherMaps)) + return localMap; + t1 = A._setArrayType([], $V._eval$1("JSArray>")); + for (t2 = otherMaps.get$iterator(otherMaps); t2.moveNext$0();) { + t3 = t2.get$current(t2); + if (t3.get$isNotEmpty(t3)) + t1.push(t3); + } + t1.push(localMap); + if (t1.length === 1) + return localMap; + return A.MergedMapView$0(t1, type$.String, $V); + }, + _EnvironmentModule$_1(_environment, css, preModuleComments, extensionStore, _modulesByVariable, variables, variableNodes, functions, mixins, transitivelyContainsCss, transitivelyContainsExtensions) { + return new A._EnvironmentModule1(_environment._environment0$_allModules, variables, variableNodes, functions, mixins, extensionStore, css, preModuleComments, transitivelyContainsCss, transitivelyContainsExtensions, _environment, _modulesByVariable); + }, + Environment0: function Environment0(t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14) { + var _ = this; + _._environment0$_modules = t0; + _._environment0$_namespaceNodes = t1; + _._environment0$_globalModules = t2; + _._environment0$_importedModules = t3; + _._environment0$_forwardedModules = t4; + _._environment0$_nestedForwardedModules = t5; + _._environment0$_allModules = t6; + _._environment0$_variables = t7; + _._environment0$_variableNodes = t8; + _._environment0$_variableIndices = t9; + _._environment0$_functions = t10; + _._environment0$_functionIndices = t11; + _._environment0$_mixins = t12; + _._environment0$_mixinIndices = t13; + _._environment0$_content = t14; + _._environment0$_inMixin = false; + _._environment0$_inSemiGlobalScope = true; + _._environment0$_lastVariableIndex = _._environment0$_lastVariableName = null; + }, + Environment__getVariableFromGlobalModule_closure0: function Environment__getVariableFromGlobalModule_closure0(t0) { + this.name = t0; + }, + Environment_setVariable_closure2: function Environment_setVariable_closure2(t0, t1) { + this.$this = t0; + this.name = t1; + }, + Environment_setVariable_closure3: function Environment_setVariable_closure3(t0) { + this.name = t0; + }, + Environment_setVariable_closure4: function Environment_setVariable_closure4(t0, t1) { + this.$this = t0; + this.name = t1; + }, + Environment__getFunctionFromGlobalModule_closure0: function Environment__getFunctionFromGlobalModule_closure0(t0) { + this.name = t0; + }, + Environment__getMixinFromGlobalModule_closure0: function Environment__getMixinFromGlobalModule_closure0(t0) { + this.name = t0; + }, + Environment_toModule_closure0: function Environment_toModule_closure0() { + }, + Environment_toDummyModule_closure0: function Environment_toDummyModule_closure0() { + }, + _EnvironmentModule1: function _EnvironmentModule1(t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11) { + var _ = this; + _.upstream = t0; + _.variables = t1; + _.variableNodes = t2; + _.functions = t3; + _.mixins = t4; + _.extensionStore = t5; + _.css = t6; + _.preModuleComments = t7; + _.transitivelyContainsCss = t8; + _.transitivelyContainsExtensions = t9; + _._environment0$_environment = t10; + _._environment0$_modulesByVariable = t11; + }, + _EnvironmentModule__EnvironmentModule_closure11: function _EnvironmentModule__EnvironmentModule_closure11() { + }, + _EnvironmentModule__EnvironmentModule_closure12: function _EnvironmentModule__EnvironmentModule_closure12() { + }, + _EnvironmentModule__EnvironmentModule_closure13: function _EnvironmentModule__EnvironmentModule_closure13() { + }, + _EnvironmentModule__EnvironmentModule_closure14: function _EnvironmentModule__EnvironmentModule_closure14() { + }, + _EnvironmentModule__EnvironmentModule_closure15: function _EnvironmentModule__EnvironmentModule_closure15() { + }, + _EnvironmentModule__EnvironmentModule_closure16: function _EnvironmentModule__EnvironmentModule_closure16() { + }, + ErrorRule0: function ErrorRule0(t0, t1) { + this.expression = t0; + this.span = t1; + }, + _EvaluateVisitor$1(functions, importCache, logger, nodeImporter, quietDeps, sourceMap) { + var t4, + t1 = type$.Uri, + t2 = type$.Module_Callable_2, + t3 = A._setArrayType([], type$.JSArray_Record_2_String_and_AstNode_2); + if (importCache == null) + t4 = nodeImporter == null ? A.ImportCache$none(logger) : null; + else + t4 = importCache; + t1 = new A._EvaluateVisitor1(t4, nodeImporter, A.LinkedHashMap_LinkedHashMap$_empty(type$.String, type$.Callable_2), A.LinkedHashMap_LinkedHashMap$_empty(t1, t2), A.LinkedHashMap_LinkedHashMap$_empty(t1, t2), A.LinkedHashMap_LinkedHashMap$_empty(t1, type$.Configuration_2), A.LinkedHashMap_LinkedHashMap$_empty(t1, type$.AstNode_2), logger, A.LinkedHashSet_LinkedHashSet$_empty(type$.Record_2_String_and_SourceSpan), quietDeps, sourceMap, A.Environment$0(), A.LinkedHashSet_LinkedHashSet$_empty(t1), A.LinkedHashMap_LinkedHashMap$_empty(t1, type$.nullable_AstNode_2), t3, B.Configuration_Map_empty_null0); + t1._EvaluateVisitor$6$functions$importCache$logger$nodeImporter$quietDeps$sourceMap1(functions, importCache, logger, nodeImporter, quietDeps, sourceMap); + return t1; + }, + _EvaluateVisitor1: function _EvaluateVisitor1(t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15) { + var _ = this; + _._evaluate0$_importCache = t0; + _._nodeImporter = t1; + _._evaluate0$_builtInFunctions = t2; + _._evaluate0$_builtInModules = t3; + _._evaluate0$_modules = t4; + _._evaluate0$_moduleConfigurations = t5; + _._evaluate0$_moduleNodes = t6; + _._evaluate0$_logger = t7; + _._evaluate0$_warningsEmitted = t8; + _._evaluate0$_quietDeps = t9; + _._evaluate0$_sourceMap = t10; + _._evaluate0$_environment = t11; + _._evaluate0$_declarationName = _._evaluate0$__parent = _._evaluate0$_mediaQuerySources = _._evaluate0$_mediaQueries = _._evaluate0$_styleRuleIgnoringAtRoot = null; + _._evaluate0$_member = "root stylesheet"; + _._evaluate0$_importSpan = _._evaluate0$_callableNode = _._evaluate0$_currentCallable = null; + _._evaluate0$_inSupportsDeclaration = _._evaluate0$_inKeyframes = _._evaluate0$_atRootExcludingStyleRule = _._evaluate0$_inUnknownAtRule = _._evaluate0$_inFunction = false; + _._evaluate0$_loadedUrls = t12; + _._evaluate0$_activeModules = t13; + _._evaluate0$_stack = t14; + _._evaluate0$_importer = null; + _._evaluate0$_inDependency = false; + _._evaluate0$__extensionStore = _._evaluate0$_preModuleComments = _._evaluate0$_outOfOrderImports = _._evaluate0$__endOfImports = _._evaluate0$__root = _._evaluate0$__stylesheet = null; + _._evaluate0$_configuration = t15; + }, + _EvaluateVisitor_closure25: function _EvaluateVisitor_closure25(t0) { + this.$this = t0; + }, + _EvaluateVisitor_closure26: function _EvaluateVisitor_closure26(t0) { + this.$this = t0; + }, + _EvaluateVisitor_closure27: function _EvaluateVisitor_closure27(t0) { + this.$this = t0; + }, + _EvaluateVisitor_closure28: function _EvaluateVisitor_closure28(t0) { + this.$this = t0; + }, + _EvaluateVisitor_closure29: function _EvaluateVisitor_closure29(t0) { + this.$this = t0; + }, + _EvaluateVisitor_closure30: function _EvaluateVisitor_closure30(t0) { + this.$this = t0; + }, + _EvaluateVisitor_closure31: function _EvaluateVisitor_closure31(t0) { + this.$this = t0; + }, + _EvaluateVisitor_closure32: function _EvaluateVisitor_closure32(t0) { + this.$this = t0; + }, + _EvaluateVisitor_closure33: function _EvaluateVisitor_closure33(t0) { + this.$this = t0; + }, + _EvaluateVisitor__closure10: function _EvaluateVisitor__closure10(t0, t1, t2) { + this.$this = t0; + this.name = t1; + this.module = t2; + }, + _EvaluateVisitor_closure34: function _EvaluateVisitor_closure34(t0) { + this.$this = t0; + }, + _EvaluateVisitor__closure9: function _EvaluateVisitor__closure9(t0, t1, t2) { + this.$this = t0; + this.name = t1; + this.module = t2; + }, + _EvaluateVisitor_closure35: function _EvaluateVisitor_closure35(t0) { + this.$this = t0; + }, + _EvaluateVisitor_closure36: function _EvaluateVisitor_closure36(t0) { + this.$this = t0; + }, + _EvaluateVisitor__closure7: function _EvaluateVisitor__closure7(t0, t1, t2) { + this.values = t0; + this.span = t1; + this.callableNode = t2; + }, + _EvaluateVisitor__closure8: function _EvaluateVisitor__closure8(t0) { + this.$this = t0; + }, + _EvaluateVisitor_closure37: function _EvaluateVisitor_closure37(t0) { + this.$this = t0; + }, + _EvaluateVisitor_run_closure1: function _EvaluateVisitor_run_closure1(t0, t1, t2) { + this.$this = t0; + this.node = t1; + this.importer = t2; + }, + _EvaluateVisitor_run__closure1: function _EvaluateVisitor_run__closure1(t0, t1, t2) { + this.$this = t0; + this.importer = t1; + this.node = t2; + }, + _EvaluateVisitor__loadModule_closure3: function _EvaluateVisitor__loadModule_closure3(t0, t1) { + this._box_1 = t0; + this.callback = t1; + }, + _EvaluateVisitor__loadModule_closure4: function _EvaluateVisitor__loadModule_closure4(t0, t1, t2, t3, t4, t5, t6) { + var _ = this; + _.$this = t0; + _.url = t1; + _.nodeWithSpan = t2; + _.baseUrl = t3; + _.namesInErrors = t4; + _.configuration = t5; + _.callback = t6; + }, + _EvaluateVisitor__loadModule__closure3: function _EvaluateVisitor__loadModule__closure3(t0, t1) { + this.$this = t0; + this.message = t1; + }, + _EvaluateVisitor__loadModule__closure4: function _EvaluateVisitor__loadModule__closure4(t0, t1, t2) { + this._box_0 = t0; + this.callback = t1; + this.firstLoad = t2; + }, + _EvaluateVisitor__execute_closure1: function _EvaluateVisitor__execute_closure1(t0, t1, t2, t3, t4, t5, t6) { + var _ = this; + _.$this = t0; + _.importer = t1; + _.stylesheet = t2; + _.extensionStore = t3; + _.configuration = t4; + _.css = t5; + _.preModuleComments = t6; + }, + _EvaluateVisitor__combineCss_closure3: function _EvaluateVisitor__combineCss_closure3() { + }, + _EvaluateVisitor__combineCss_closure4: function _EvaluateVisitor__combineCss_closure4(t0) { + this.selectors = t0; + }, + _EvaluateVisitor__combineCss_visitModule1: function _EvaluateVisitor__combineCss_visitModule1(t0, t1, t2, t3, t4, t5) { + var _ = this; + _.$this = t0; + _.seen = t1; + _.clone = t2; + _.css = t3; + _.imports = t4; + _.sorted = t5; + }, + _EvaluateVisitor__extendModules_closure3: function _EvaluateVisitor__extendModules_closure3(t0) { + this.originalSelectors = t0; + }, + _EvaluateVisitor__extendModules_closure4: function _EvaluateVisitor__extendModules_closure4() { + }, + _EvaluateVisitor_visitAtRootRule_closure3: function _EvaluateVisitor_visitAtRootRule_closure3(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitAtRootRule_closure4: function _EvaluateVisitor_visitAtRootRule_closure4(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor__scopeForAtRoot_closure11: function _EvaluateVisitor__scopeForAtRoot_closure11(t0, t1, t2) { + this.$this = t0; + this.newParent = t1; + this.node = t2; + }, + _EvaluateVisitor__scopeForAtRoot_closure12: function _EvaluateVisitor__scopeForAtRoot_closure12(t0, t1) { + this.$this = t0; + this.innerScope = t1; + }, + _EvaluateVisitor__scopeForAtRoot_closure13: function _EvaluateVisitor__scopeForAtRoot_closure13(t0, t1) { + this.$this = t0; + this.innerScope = t1; + }, + _EvaluateVisitor__scopeForAtRoot__closure1: function _EvaluateVisitor__scopeForAtRoot__closure1(t0, t1) { + this.innerScope = t0; + this.callback = t1; + }, + _EvaluateVisitor__scopeForAtRoot_closure14: function _EvaluateVisitor__scopeForAtRoot_closure14(t0, t1) { + this.$this = t0; + this.innerScope = t1; + }, + _EvaluateVisitor__scopeForAtRoot_closure15: function _EvaluateVisitor__scopeForAtRoot_closure15() { + }, + _EvaluateVisitor__scopeForAtRoot_closure16: function _EvaluateVisitor__scopeForAtRoot_closure16(t0, t1) { + this.$this = t0; + this.innerScope = t1; + }, + _EvaluateVisitor_visitContentRule_closure1: function _EvaluateVisitor_visitContentRule_closure1(t0, t1) { + this.$this = t0; + this.content = t1; + }, + _EvaluateVisitor_visitDeclaration_closure1: function _EvaluateVisitor_visitDeclaration_closure1(t0, t1) { + this._box_0 = t0; + this.$this = t1; + }, + _EvaluateVisitor_visitEachRule_closure5: function _EvaluateVisitor_visitEachRule_closure5(t0, t1, t2) { + this._box_0 = t0; + this.$this = t1; + this.nodeWithSpan = t2; + }, + _EvaluateVisitor_visitEachRule_closure6: function _EvaluateVisitor_visitEachRule_closure6(t0, t1, t2) { + this._box_0 = t0; + this.$this = t1; + this.nodeWithSpan = t2; + }, + _EvaluateVisitor_visitEachRule_closure7: function _EvaluateVisitor_visitEachRule_closure7(t0, t1, t2, t3) { + var _ = this; + _.$this = t0; + _.list = t1; + _.setVariables = t2; + _.node = t3; + }, + _EvaluateVisitor_visitEachRule__closure1: function _EvaluateVisitor_visitEachRule__closure1(t0, t1, t2) { + this.$this = t0; + this.setVariables = t1; + this.node = t2; + }, + _EvaluateVisitor_visitEachRule___closure1: function _EvaluateVisitor_visitEachRule___closure1(t0) { + this.$this = t0; + }, + _EvaluateVisitor_visitAtRule_closure5: function _EvaluateVisitor_visitAtRule_closure5(t0) { + this.$this = t0; + }, + _EvaluateVisitor_visitAtRule_closure6: function _EvaluateVisitor_visitAtRule_closure6(t0, t1, t2) { + this.$this = t0; + this.name = t1; + this.children = t2; + }, + _EvaluateVisitor_visitAtRule__closure1: function _EvaluateVisitor_visitAtRule__closure1(t0, t1) { + this.$this = t0; + this.children = t1; + }, + _EvaluateVisitor_visitAtRule_closure7: function _EvaluateVisitor_visitAtRule_closure7() { + }, + _EvaluateVisitor_visitForRule_closure9: function _EvaluateVisitor_visitForRule_closure9(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitForRule_closure10: function _EvaluateVisitor_visitForRule_closure10(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitForRule_closure11: function _EvaluateVisitor_visitForRule_closure11(t0) { + this.fromNumber = t0; + }, + _EvaluateVisitor_visitForRule_closure12: function _EvaluateVisitor_visitForRule_closure12(t0, t1) { + this.toNumber = t0; + this.fromNumber = t1; + }, + _EvaluateVisitor_visitForRule_closure13: function _EvaluateVisitor_visitForRule_closure13(t0, t1, t2, t3, t4, t5) { + var _ = this; + _._box_0 = t0; + _.$this = t1; + _.node = t2; + _.from = t3; + _.direction = t4; + _.fromNumber = t5; + }, + _EvaluateVisitor_visitForRule__closure1: function _EvaluateVisitor_visitForRule__closure1(t0) { + this.$this = t0; + }, + _EvaluateVisitor_visitForwardRule_closure3: function _EvaluateVisitor_visitForwardRule_closure3(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitForwardRule_closure4: function _EvaluateVisitor_visitForwardRule_closure4(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor__registerCommentsForModule_closure1: function _EvaluateVisitor__registerCommentsForModule_closure1() { + }, + _EvaluateVisitor_visitIfRule_closure1: function _EvaluateVisitor_visitIfRule_closure1(t0) { + this.$this = t0; + }, + _EvaluateVisitor_visitIfRule__closure1: function _EvaluateVisitor_visitIfRule__closure1(t0, t1) { + this.$this = t0; + this.clause = t1; + }, + _EvaluateVisitor_visitIfRule___closure1: function _EvaluateVisitor_visitIfRule___closure1(t0) { + this.$this = t0; + }, + _EvaluateVisitor__visitDynamicImport_closure1: function _EvaluateVisitor__visitDynamicImport_closure1(t0, t1) { + this.$this = t0; + this.$import = t1; + }, + _EvaluateVisitor__visitDynamicImport__closure7: function _EvaluateVisitor__visitDynamicImport__closure7(t0) { + this.$this = t0; + }, + _EvaluateVisitor__visitDynamicImport__closure8: function _EvaluateVisitor__visitDynamicImport__closure8() { + }, + _EvaluateVisitor__visitDynamicImport__closure9: function _EvaluateVisitor__visitDynamicImport__closure9() { + }, + _EvaluateVisitor__visitDynamicImport__closure10: function _EvaluateVisitor__visitDynamicImport__closure10(t0, t1, t2, t3, t4) { + var _ = this; + _._box_0 = t0; + _.$this = t1; + _.loadsUserDefinedModules = t2; + _.environment = t3; + _.children = t4; + }, + _EvaluateVisitor__applyMixin_closure3: function _EvaluateVisitor__applyMixin_closure3(t0, t1, t2, t3) { + var _ = this; + _.$this = t0; + _.$arguments = t1; + _.mixin = t2; + _.nodeWithSpanWithoutContent = t3; + }, + _EvaluateVisitor__applyMixin__closure4: function _EvaluateVisitor__applyMixin__closure4(t0, t1, t2, t3) { + var _ = this; + _.$this = t0; + _.$arguments = t1; + _.mixin = t2; + _.nodeWithSpanWithoutContent = t3; + }, + _EvaluateVisitor__applyMixin_closure4: function _EvaluateVisitor__applyMixin_closure4(t0, t1, t2, t3) { + var _ = this; + _.$this = t0; + _.contentCallable = t1; + _.mixin = t2; + _.nodeWithSpanWithoutContent = t3; + }, + _EvaluateVisitor__applyMixin__closure3: function _EvaluateVisitor__applyMixin__closure3(t0, t1, t2) { + this.$this = t0; + this.mixin = t1; + this.nodeWithSpanWithoutContent = t2; + }, + _EvaluateVisitor__applyMixin___closure1: function _EvaluateVisitor__applyMixin___closure1(t0, t1, t2) { + this.$this = t0; + this.mixin = t1; + this.nodeWithSpanWithoutContent = t2; + }, + _EvaluateVisitor__applyMixin____closure1: function _EvaluateVisitor__applyMixin____closure1(t0, t1) { + this.$this = t0; + this.statement = t1; + }, + _EvaluateVisitor_visitIncludeRule_closure5: function _EvaluateVisitor_visitIncludeRule_closure5(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitIncludeRule_closure6: function _EvaluateVisitor_visitIncludeRule_closure6(t0) { + this.$this = t0; + }, + _EvaluateVisitor_visitIncludeRule_closure7: function _EvaluateVisitor_visitIncludeRule_closure7(t0) { + this.node = t0; + }, + _EvaluateVisitor_visitMediaRule_closure5: function _EvaluateVisitor_visitMediaRule_closure5(t0, t1) { + this.$this = t0; + this.queries = t1; + }, + _EvaluateVisitor_visitMediaRule_closure6: function _EvaluateVisitor_visitMediaRule_closure6(t0, t1, t2, t3, t4) { + var _ = this; + _.$this = t0; + _.mergedQueries = t1; + _.queries = t2; + _.mergedSources = t3; + _.node = t4; + }, + _EvaluateVisitor_visitMediaRule__closure1: function _EvaluateVisitor_visitMediaRule__closure1(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitMediaRule___closure1: function _EvaluateVisitor_visitMediaRule___closure1(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitMediaRule_closure7: function _EvaluateVisitor_visitMediaRule_closure7(t0) { + this.mergedSources = t0; + }, + _EvaluateVisitor_visitStyleRule_closure9: function _EvaluateVisitor_visitStyleRule_closure9(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitStyleRule_closure10: function _EvaluateVisitor_visitStyleRule_closure10() { + }, + _EvaluateVisitor_visitStyleRule_closure11: function _EvaluateVisitor_visitStyleRule_closure11(t0, t1, t2) { + this.$this = t0; + this.rule = t1; + this.node = t2; + }, + _EvaluateVisitor_visitStyleRule__closure1: function _EvaluateVisitor_visitStyleRule__closure1(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitStyleRule_closure12: function _EvaluateVisitor_visitStyleRule_closure12() { + }, + _EvaluateVisitor_visitStyleRule_closure13: function _EvaluateVisitor_visitStyleRule_closure13() { + }, + _EvaluateVisitor_visitSupportsRule_closure3: function _EvaluateVisitor_visitSupportsRule_closure3(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitSupportsRule__closure1: function _EvaluateVisitor_visitSupportsRule__closure1(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitSupportsRule_closure4: function _EvaluateVisitor_visitSupportsRule_closure4() { + }, + _EvaluateVisitor__visitSupportsCondition_closure1: function _EvaluateVisitor__visitSupportsCondition_closure1(t0, t1) { + this._box_0 = t0; + this.$this = t1; + }, + _EvaluateVisitor_visitVariableDeclaration_closure5: function _EvaluateVisitor_visitVariableDeclaration_closure5(t0, t1, t2) { + this._box_0 = t0; + this.$this = t1; + this.node = t2; + }, + _EvaluateVisitor_visitVariableDeclaration_closure6: function _EvaluateVisitor_visitVariableDeclaration_closure6(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitVariableDeclaration_closure7: function _EvaluateVisitor_visitVariableDeclaration_closure7(t0, t1, t2) { + this.$this = t0; + this.node = t1; + this.value = t2; + }, + _EvaluateVisitor_visitUseRule_closure1: function _EvaluateVisitor_visitUseRule_closure1(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitWarnRule_closure1: function _EvaluateVisitor_visitWarnRule_closure1(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitWhileRule_closure1: function _EvaluateVisitor_visitWhileRule_closure1(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitWhileRule__closure1: function _EvaluateVisitor_visitWhileRule__closure1(t0) { + this.$this = t0; + }, + _EvaluateVisitor_visitBinaryOperationExpression_closure1: function _EvaluateVisitor_visitBinaryOperationExpression_closure1(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor__slash_recommendation1: function _EvaluateVisitor__slash_recommendation1() { + }, + _EvaluateVisitor_visitVariableExpression_closure1: function _EvaluateVisitor_visitVariableExpression_closure1(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitUnaryOperationExpression_closure1: function _EvaluateVisitor_visitUnaryOperationExpression_closure1(t0, t1) { + this.node = t0; + this.operand = t1; + }, + _EvaluateVisitor_visitListExpression_closure1: function _EvaluateVisitor_visitListExpression_closure1(t0) { + this.$this = t0; + }, + _EvaluateVisitor_visitFunctionExpression_closure5: function _EvaluateVisitor_visitFunctionExpression_closure5(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitFunctionExpression_closure6: function _EvaluateVisitor_visitFunctionExpression_closure6() { + }, + _EvaluateVisitor_visitFunctionExpression_closure7: function _EvaluateVisitor_visitFunctionExpression_closure7(t0, t1, t2) { + this._box_0 = t0; + this.$this = t1; + this.node = t2; + }, + _EvaluateVisitor__checkCalculationArguments_check1: function _EvaluateVisitor__checkCalculationArguments_check1(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor__visitCalculationExpression_closure1: function _EvaluateVisitor__visitCalculationExpression_closure1(t0, t1, t2, t3) { + var _ = this; + _._box_0 = t0; + _.$this = t1; + _.node = t2; + _.inLegacySassFunction = t3; + }, + _EvaluateVisitor_visitInterpolatedFunctionExpression_closure1: function _EvaluateVisitor_visitInterpolatedFunctionExpression_closure1(t0, t1, t2) { + this.$this = t0; + this.node = t1; + this.$function = t2; + }, + _EvaluateVisitor__runUserDefinedCallable_closure1: function _EvaluateVisitor__runUserDefinedCallable_closure1(t0, t1, t2, t3, t4, t5) { + var _ = this; + _.$this = t0; + _.callable = t1; + _.evaluated = t2; + _.nodeWithSpan = t3; + _.run = t4; + _.V = t5; + }, + _EvaluateVisitor__runUserDefinedCallable__closure1: function _EvaluateVisitor__runUserDefinedCallable__closure1(t0, t1, t2, t3, t4, t5) { + var _ = this; + _.$this = t0; + _.evaluated = t1; + _.callable = t2; + _.nodeWithSpan = t3; + _.run = t4; + _.V = t5; + }, + _EvaluateVisitor__runUserDefinedCallable___closure1: function _EvaluateVisitor__runUserDefinedCallable___closure1(t0, t1, t2, t3, t4, t5) { + var _ = this; + _.$this = t0; + _.evaluated = t1; + _.callable = t2; + _.nodeWithSpan = t3; + _.run = t4; + _.V = t5; + }, + _EvaluateVisitor__runUserDefinedCallable____closure1: function _EvaluateVisitor__runUserDefinedCallable____closure1() { + }, + _EvaluateVisitor__runFunctionCallable_closure1: function _EvaluateVisitor__runFunctionCallable_closure1(t0, t1) { + this.$this = t0; + this.callable = t1; + }, + _EvaluateVisitor__runBuiltInCallable_closure5: function _EvaluateVisitor__runBuiltInCallable_closure5(t0, t1, t2) { + this._box_0 = t0; + this.evaluated = t1; + this.namedSet = t2; + }, + _EvaluateVisitor__runBuiltInCallable_closure6: function _EvaluateVisitor__runBuiltInCallable_closure6(t0, t1) { + this._box_0 = t0; + this.evaluated = t1; + }, + _EvaluateVisitor__runBuiltInCallable_closure7: function _EvaluateVisitor__runBuiltInCallable_closure7() { + }, + _EvaluateVisitor__evaluateArguments_closure7: function _EvaluateVisitor__evaluateArguments_closure7() { + }, + _EvaluateVisitor__evaluateArguments_closure8: function _EvaluateVisitor__evaluateArguments_closure8(t0, t1) { + this.$this = t0; + this.restNodeForSpan = t1; + }, + _EvaluateVisitor__evaluateArguments_closure9: function _EvaluateVisitor__evaluateArguments_closure9(t0, t1, t2, t3) { + var _ = this; + _.$this = t0; + _.named = t1; + _.restNodeForSpan = t2; + _.namedNodes = t3; + }, + _EvaluateVisitor__evaluateArguments_closure10: function _EvaluateVisitor__evaluateArguments_closure10() { + }, + _EvaluateVisitor__evaluateMacroArguments_closure7: function _EvaluateVisitor__evaluateMacroArguments_closure7(t0) { + this.restArgs = t0; + }, + _EvaluateVisitor__evaluateMacroArguments_closure8: function _EvaluateVisitor__evaluateMacroArguments_closure8(t0, t1, t2) { + this.$this = t0; + this.restNodeForSpan = t1; + this.restArgs = t2; + }, + _EvaluateVisitor__evaluateMacroArguments_closure9: function _EvaluateVisitor__evaluateMacroArguments_closure9(t0, t1, t2, t3) { + var _ = this; + _.$this = t0; + _.named = t1; + _.restNodeForSpan = t2; + _.restArgs = t3; + }, + _EvaluateVisitor__evaluateMacroArguments_closure10: function _EvaluateVisitor__evaluateMacroArguments_closure10(t0, t1, t2) { + this.$this = t0; + this.keywordRestNodeForSpan = t1; + this.keywordRestArgs = t2; + }, + _EvaluateVisitor__addRestMap_closure1: function _EvaluateVisitor__addRestMap_closure1(t0, t1, t2, t3, t4, t5) { + var _ = this; + _.$this = t0; + _.values = t1; + _.convert = t2; + _.expressionNode = t3; + _.map = t4; + _.nodeWithSpan = t5; + }, + _EvaluateVisitor__verifyArguments_closure1: function _EvaluateVisitor__verifyArguments_closure1(t0, t1, t2) { + this.$arguments = t0; + this.positional = t1; + this.named = t2; + }, + _EvaluateVisitor_visitCssAtRule_closure3: function _EvaluateVisitor_visitCssAtRule_closure3(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitCssAtRule_closure4: function _EvaluateVisitor_visitCssAtRule_closure4() { + }, + _EvaluateVisitor_visitCssKeyframeBlock_closure3: function _EvaluateVisitor_visitCssKeyframeBlock_closure3(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitCssKeyframeBlock_closure4: function _EvaluateVisitor_visitCssKeyframeBlock_closure4() { + }, + _EvaluateVisitor_visitCssMediaRule_closure5: function _EvaluateVisitor_visitCssMediaRule_closure5(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitCssMediaRule_closure6: function _EvaluateVisitor_visitCssMediaRule_closure6(t0, t1, t2, t3) { + var _ = this; + _.$this = t0; + _.mergedQueries = t1; + _.node = t2; + _.mergedSources = t3; + }, + _EvaluateVisitor_visitCssMediaRule__closure1: function _EvaluateVisitor_visitCssMediaRule__closure1(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitCssMediaRule___closure1: function _EvaluateVisitor_visitCssMediaRule___closure1(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitCssMediaRule_closure7: function _EvaluateVisitor_visitCssMediaRule_closure7(t0) { + this.mergedSources = t0; + }, + _EvaluateVisitor_visitCssStyleRule_closure3: function _EvaluateVisitor_visitCssStyleRule_closure3(t0, t1, t2) { + this.$this = t0; + this.rule = t1; + this.node = t2; + }, + _EvaluateVisitor_visitCssStyleRule__closure1: function _EvaluateVisitor_visitCssStyleRule__closure1(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitCssStyleRule_closure4: function _EvaluateVisitor_visitCssStyleRule_closure4() { + }, + _EvaluateVisitor_visitCssSupportsRule_closure3: function _EvaluateVisitor_visitCssSupportsRule_closure3(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitCssSupportsRule__closure1: function _EvaluateVisitor_visitCssSupportsRule__closure1(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _EvaluateVisitor_visitCssSupportsRule_closure4: function _EvaluateVisitor_visitCssSupportsRule_closure4() { + }, + _EvaluateVisitor__performInterpolationHelper_closure1: function _EvaluateVisitor__performInterpolationHelper_closure1(t0) { + this.interpolation = t0; + }, + _EvaluateVisitor__serialize_closure1: function _EvaluateVisitor__serialize_closure1(t0, t1) { + this.value = t0; + this.quote = t1; + }, + _EvaluateVisitor__expressionNode_closure1: function _EvaluateVisitor__expressionNode_closure1(t0, t1) { + this.$this = t0; + this.expression = t1; + }, + _EvaluateVisitor__withoutSlash_recommendation1: function _EvaluateVisitor__withoutSlash_recommendation1() { + }, + _EvaluateVisitor__stackFrame_closure1: function _EvaluateVisitor__stackFrame_closure1(t0) { + this.$this = t0; + }, + _ImportedCssVisitor1: function _ImportedCssVisitor1(t0) { + this._evaluate0$_visitor = t0; + }, + _ImportedCssVisitor_visitCssAtRule_closure1: function _ImportedCssVisitor_visitCssAtRule_closure1() { + }, + _ImportedCssVisitor_visitCssMediaRule_closure1: function _ImportedCssVisitor_visitCssMediaRule_closure1(t0) { + this.hasBeenMerged = t0; + }, + _ImportedCssVisitor_visitCssStyleRule_closure1: function _ImportedCssVisitor_visitCssStyleRule_closure1() { + }, + _ImportedCssVisitor_visitCssSupportsRule_closure1: function _ImportedCssVisitor_visitCssSupportsRule_closure1() { + }, + _EvaluationContext1: function _EvaluationContext1(t0, t1) { + this._evaluate0$_visitor = t0; + this._evaluate0$_defaultWarnNodeWithSpan = t1; + }, + EveryCssVisitor0: function EveryCssVisitor0() { + }, + EveryCssVisitor_visitCssAtRule_closure0: function EveryCssVisitor_visitCssAtRule_closure0(t0) { + this.$this = t0; + }, + EveryCssVisitor_visitCssKeyframeBlock_closure0: function EveryCssVisitor_visitCssKeyframeBlock_closure0(t0) { + this.$this = t0; + }, + EveryCssVisitor_visitCssMediaRule_closure0: function EveryCssVisitor_visitCssMediaRule_closure0(t0) { + this.$this = t0; + }, + EveryCssVisitor_visitCssStyleRule_closure0: function EveryCssVisitor_visitCssStyleRule_closure0(t0) { + this.$this = t0; + }, + EveryCssVisitor_visitCssStylesheet_closure0: function EveryCssVisitor_visitCssStylesheet_closure0(t0) { + this.$this = t0; + }, + EveryCssVisitor_visitCssSupportsRule_closure0: function EveryCssVisitor_visitCssSupportsRule_closure0(t0) { + this.$this = t0; + }, + throwNodeException(exception, ascii, color, trace) { + var wasAscii, jsException, t1, trace0; + trace = trace; + wasAscii = $._glyphs === B.C_AsciiGlyphSet; + $._glyphs = ascii ? B.C_AsciiGlyphSet : B.C_UnicodeGlyphSet; + try { + t1 = A.callConstructor($.$get$exceptionClass(), [exception, B.JSString_methods.replaceFirst$2(exception.toString$1$color(0, color), "Error: ", "")]); + jsException = type$._NodeException._as(t1); + trace0 = A.getTrace0(exception); + trace = trace0 == null ? trace : trace0; + if (trace != null) + A.attachJsStack(jsException, trace); + A.jsThrow(jsException); + } finally { + $._glyphs = wasAscii ? B.C_AsciiGlyphSet : B.C_UnicodeGlyphSet; + } + }, + _NodeException: function _NodeException() { + }, + exceptionClass_closure: function exceptionClass_closure() { + }, + exceptionClass__closure: function exceptionClass__closure() { + }, + exceptionClass__closure0: function exceptionClass__closure0() { + }, + exceptionClass__closure1: function exceptionClass__closure1() { + }, + SassException$0(message, span, loadedUrls) { + return new A.SassException0(loadedUrls == null ? B.Set_empty : A.Set_Set$unmodifiable(loadedUrls, type$.Uri), message, span); + }, + MultiSpanSassException$0(message, span, primaryLabel, secondarySpans, loadedUrls) { + var t1 = A.ConstantMap_ConstantMap$from(secondarySpans, type$.FileSpan, type$.String); + return new A.MultiSpanSassException0(primaryLabel, t1, loadedUrls == null ? B.Set_empty : A.Set_Set$unmodifiable(loadedUrls, type$.Uri), message, span); + }, + SassRuntimeException$0(message, span, trace, loadedUrls) { + return new A.SassRuntimeException0(trace, loadedUrls == null ? B.Set_empty : A.Set_Set$unmodifiable(loadedUrls, type$.Uri), message, span); + }, + MultiSpanSassRuntimeException$0(message, span, primaryLabel, secondarySpans, trace, loadedUrls) { + var t1 = A.ConstantMap_ConstantMap$from(secondarySpans, type$.FileSpan, type$.String); + return new A.MultiSpanSassRuntimeException0(trace, primaryLabel, t1, loadedUrls == null ? B.Set_empty : A.Set_Set$unmodifiable(loadedUrls, type$.Uri), message, span); + }, + SassFormatException$0(message, span, loadedUrls) { + return new A.SassFormatException0(loadedUrls == null ? B.Set_empty : A.Set_Set$unmodifiable(loadedUrls, type$.Uri), message, span); + }, + MultiSpanSassFormatException$0(message, span, primaryLabel, secondarySpans, loadedUrls) { + var t1 = A.ConstantMap_ConstantMap$from(secondarySpans, type$.FileSpan, type$.String); + return new A.MultiSpanSassFormatException0(primaryLabel, t1, loadedUrls == null ? B.Set_empty : A.Set_Set$unmodifiable(loadedUrls, type$.Uri), message, span); + }, + SassScriptException$0(message, argumentName) { + return new A.SassScriptException0(argumentName == null ? message : "$" + argumentName + ": " + message); + }, + MultiSpanSassScriptException$0(message, primaryLabel, secondarySpans) { + var t1 = A.ConstantMap_ConstantMap$from(secondarySpans, type$.FileSpan, type$.String); + return new A.MultiSpanSassScriptException0(primaryLabel, t1, message); + }, + SassException0: function SassException0(t0, t1, t2) { + this.loadedUrls = t0; + this._span_exception$_message = t1; + this._span = t2; + }, + MultiSpanSassException0: function MultiSpanSassException0(t0, t1, t2, t3, t4) { + var _ = this; + _.primaryLabel = t0; + _.secondarySpans = t1; + _.loadedUrls = t2; + _._span_exception$_message = t3; + _._span = t4; + }, + SassRuntimeException0: function SassRuntimeException0(t0, t1, t2, t3) { + var _ = this; + _.trace = t0; + _.loadedUrls = t1; + _._span_exception$_message = t2; + _._span = t3; + }, + MultiSpanSassRuntimeException0: function MultiSpanSassRuntimeException0(t0, t1, t2, t3, t4, t5) { + var _ = this; + _.trace = t0; + _.primaryLabel = t1; + _.secondarySpans = t2; + _.loadedUrls = t3; + _._span_exception$_message = t4; + _._span = t5; + }, + SassFormatException0: function SassFormatException0(t0, t1, t2) { + this.loadedUrls = t0; + this._span_exception$_message = t1; + this._span = t2; + }, + MultiSpanSassFormatException0: function MultiSpanSassFormatException0(t0, t1, t2, t3, t4) { + var _ = this; + _.primaryLabel = t0; + _.secondarySpans = t1; + _.loadedUrls = t2; + _._span_exception$_message = t3; + _._span = t4; + }, + SassScriptException0: function SassScriptException0(t0) { + this.message = t0; + }, + MultiSpanSassScriptException0: function MultiSpanSassScriptException0(t0, t1, t2) { + this.primaryLabel = t0; + this.secondarySpans = t1; + this.message = t2; + }, + Exports: function Exports() { + }, + LoggerNamespace: function LoggerNamespace() { + }, + _IsCalculationSafeVisitor0: function _IsCalculationSafeVisitor0() { + }, + _IsCalculationSafeVisitor_visitListExpression_closure0: function _IsCalculationSafeVisitor_visitListExpression_closure0(t0) { + this.$this = t0; + }, + expressionToCalc0(expression) { + var t1 = A._setArrayType([B.C__MakeExpressionCalculationSafe0.visitBinaryOperationExpression$1(expression)], type$.JSArray_Expression_2), + t2 = expression.get$span(0), + t3 = type$.Expression_2; + return new A.FunctionExpression0(null, "calc", new A.ArgumentInvocation0(A.List_List$unmodifiable(t1, t3), A.ConstantMap_ConstantMap$from(B.Map_empty14, type$.String, t3), null, null, t2), expression.get$span(0)); + }, + _MakeExpressionCalculationSafe0: function _MakeExpressionCalculationSafe0() { + }, + __MakeExpressionCalculationSafe_Object_ReplaceExpressionVisitor0: function __MakeExpressionCalculationSafe_Object_ReplaceExpressionVisitor0() { + }, + ExtendRule0: function ExtendRule0(t0, t1, t2) { + this.selector = t0; + this.isOptional = t1; + this.span = t2; + }, + Extension0: function Extension0(t0, t1, t2, t3, t4) { + var _ = this; + _.extender = t0; + _.target = t1; + _.mediaContext = t2; + _.isOptional = t3; + _.span = t4; + }, + Extender0: function Extender0(t0, t1) { + this.selector = t0; + this.isOriginal = t1; + this._extension$_extension = null; + }, + ExtensionStore__extendOrReplace0(selector, source, targets, mode, span) { + var t1, t2, t3, t4, t5, t6, t7, t8, _i, complex, compound, t9, t10, t11, _i0, simple, t12, _i1, t13, t14, + extender = A.ExtensionStore$_mode0(mode); + if (!selector.accept$1(B._IsInvisibleVisitor_true0)) + extender._extension_store$_originals.addAll$1(0, selector.components); + for (t1 = targets.components, t2 = t1.length, t3 = source.components, t4 = t3.length, t5 = type$.ComplexSelector_2, t6 = type$.Extension_2, t7 = type$.SimpleSelector_2, t8 = type$.Map_ComplexSelector_Extension_2, _i = 0; _i < t2; ++_i) { + complex = t1[_i]; + compound = complex.get$singleCompound(); + if (compound == null) + throw A.wrapException(A.SassScriptException$0("Can't extend complex selector " + A.S(complex) + ".", null)); + t9 = A.LinkedHashMap_LinkedHashMap$_empty(t7, t8); + for (t10 = compound.components, t11 = t10.length, _i0 = 0; _i0 < t11; ++_i0) { + simple = t10[_i0]; + t12 = A.LinkedHashMap_LinkedHashMap$_empty(t5, t6); + for (_i1 = 0; _i1 < t4; ++_i1) { + complex = t3[_i1]; + complex.get$specificity(); + t13 = new A.Extender0(complex, false); + t14 = new A.Extension0(t13, simple, null, true, span); + t13._extension$_extension = t14; + t12.$indexSet(0, complex, t14); + } + t9.$indexSet(0, simple, t12); + } + selector = extender._extension_store$_extendList$2(selector, t9); + } + return selector; + }, + ExtensionStore$0() { + var t1 = type$.SimpleSelector_2; + return new A.ExtensionStore0(A.LinkedHashMap_LinkedHashMap$_empty(t1, type$.Set_ModifiableBox_SelectorList_2), A.LinkedHashMap_LinkedHashMap$_empty(t1, type$.Map_ComplexSelector_Extension_2), A.LinkedHashMap_LinkedHashMap$_empty(t1, type$.List_Extension_2), A.LinkedHashMap_LinkedHashMap$_empty(type$.ModifiableBox_SelectorList_2, type$.List_CssMediaQuery_2), new A.JsIdentityLinkedHashMap(type$.JsIdentityLinkedHashMap_SimpleSelector_int_2), new A._LinkedIdentityHashSet(type$._LinkedIdentityHashSet_ComplexSelector_2), B.ExtendMode_normal_normal0); + }, + ExtensionStore$_mode0(_mode) { + var t1 = type$.SimpleSelector_2; + return new A.ExtensionStore0(A.LinkedHashMap_LinkedHashMap$_empty(t1, type$.Set_ModifiableBox_SelectorList_2), A.LinkedHashMap_LinkedHashMap$_empty(t1, type$.Map_ComplexSelector_Extension_2), A.LinkedHashMap_LinkedHashMap$_empty(t1, type$.List_Extension_2), A.LinkedHashMap_LinkedHashMap$_empty(type$.ModifiableBox_SelectorList_2, type$.List_CssMediaQuery_2), new A.JsIdentityLinkedHashMap(type$.JsIdentityLinkedHashMap_SimpleSelector_int_2), new A._LinkedIdentityHashSet(type$._LinkedIdentityHashSet_ComplexSelector_2), _mode); + }, + ExtensionStore0: function ExtensionStore0(t0, t1, t2, t3, t4, t5, t6) { + var _ = this; + _._extension_store$_selectors = t0; + _._extension_store$_extensions = t1; + _._extension_store$_extensionsByExtender = t2; + _._extension_store$_mediaContexts = t3; + _._extension_store$_sourceSpecificity = t4; + _._extension_store$_originals = t5; + _._extension_store$_mode = t6; + }, + ExtensionStore_extensionsWhereTarget_closure0: function ExtensionStore_extensionsWhereTarget_closure0() { + }, + ExtensionStore__registerSelector_closure0: function ExtensionStore__registerSelector_closure0() { + }, + ExtensionStore_addExtension_closure2: function ExtensionStore_addExtension_closure2() { + }, + ExtensionStore_addExtension_closure3: function ExtensionStore_addExtension_closure3() { + }, + ExtensionStore_addExtension_closure4: function ExtensionStore_addExtension_closure4(t0) { + this.complex = t0; + }, + ExtensionStore__extendExistingExtensions_closure1: function ExtensionStore__extendExistingExtensions_closure1() { + }, + ExtensionStore__extendExistingExtensions_closure2: function ExtensionStore__extendExistingExtensions_closure2() { + }, + ExtensionStore_addExtensions_closure0: function ExtensionStore_addExtensions_closure0() { + }, + ExtensionStore__extendComplex_closure0: function ExtensionStore__extendComplex_closure0(t0, t1, t2) { + this._box_0 = t0; + this.$this = t1; + this.complex = t2; + }, + ExtensionStore__extendComplex__closure0: function ExtensionStore__extendComplex__closure0(t0, t1, t2) { + this._box_0 = t0; + this.$this = t1; + this.complex = t2; + }, + ExtensionStore__extendCompound_closure2: function ExtensionStore__extendCompound_closure2() { + }, + ExtensionStore__extendCompound_closure3: function ExtensionStore__extendCompound_closure3() { + }, + ExtensionStore__extendCompound_closure4: function ExtensionStore__extendCompound_closure4(t0) { + this.original = t0; + }, + ExtensionStore__extendSimple_withoutPseudo0: function ExtensionStore__extendSimple_withoutPseudo0(t0, t1, t2) { + this.$this = t0; + this.extensions = t1; + this.targetsUsed = t2; + }, + ExtensionStore__extendSimple_closure1: function ExtensionStore__extendSimple_closure1(t0, t1) { + this.$this = t0; + this.withoutPseudo = t1; + }, + ExtensionStore__extendSimple_closure2: function ExtensionStore__extendSimple_closure2() { + }, + ExtensionStore__extendPseudo_closure4: function ExtensionStore__extendPseudo_closure4() { + }, + ExtensionStore__extendPseudo_closure5: function ExtensionStore__extendPseudo_closure5() { + }, + ExtensionStore__extendPseudo_closure6: function ExtensionStore__extendPseudo_closure6() { + }, + ExtensionStore__extendPseudo_closure7: function ExtensionStore__extendPseudo_closure7(t0) { + this.pseudo = t0; + }, + ExtensionStore__extendPseudo_closure8: function ExtensionStore__extendPseudo_closure8(t0, t1) { + this.pseudo = t0; + this.selector = t1; + }, + ExtensionStore__trim_closure1: function ExtensionStore__trim_closure1(t0, t1) { + this._box_0 = t0; + this.complex1 = t1; + }, + ExtensionStore__trim_closure2: function ExtensionStore__trim_closure2(t0, t1) { + this._box_0 = t0; + this.complex1 = t1; + }, + ExtensionStore_clone_closure0: function ExtensionStore_clone_closure0(t0, t1, t2, t3) { + var _ = this; + _.$this = t0; + _.newSelectors = t1; + _.oldToNewSelectors = t2; + _.newMediaContexts = t3; + }, + FiberClass: function FiberClass() { + }, + Fiber: function Fiber() { + }, + JSToDartFileImporter: function JSToDartFileImporter(t0) { + this._file0$_findFileUrl = t0; + }, + JSToDartFileImporter_canonicalize_closure: function JSToDartFileImporter_canonicalize_closure(t0, t1) { + this.$this = t0; + this.url = t1; + }, + FilesystemImporter$0(loadPath) { + var _null = null; + return new A.FilesystemImporter0(A.absolute(loadPath, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null)); + }, + FilesystemImporter0: function FilesystemImporter0(t0) { + this._filesystem$_loadPath = t0; + }, + FilesystemImporter_canonicalize_closure0: function FilesystemImporter_canonicalize_closure0() { + }, + ForRule$0(variable, from, to, children, span, exclusive) { + var t1 = A.List_List$unmodifiable(children, type$.Statement_2), + t2 = B.JSArray_methods.any$1(t1, new A.ParentStatement_closure0()); + return new A.ForRule0(variable, from, to, exclusive, span, t1, t2); + }, + ForRule0: function ForRule0(t0, t1, t2, t3, t4, t5, t6) { + var _ = this; + _.variable = t0; + _.from = t1; + _.to = t2; + _.isExclusive = t3; + _.span = t4; + _.children = t5; + _.hasDeclarations = t6; + }, + ForwardRule0: function ForwardRule0(t0, t1, t2, t3, t4, t5, t6, t7) { + var _ = this; + _.url = t0; + _.shownMixinsAndFunctions = t1; + _.shownVariables = t2; + _.hiddenMixinsAndFunctions = t3; + _.hiddenVariables = t4; + _.prefix = t5; + _.configuration = t6; + _.span = t7; + }, + ForwardedModuleView_ifNecessary0(inner, rule, $T) { + var t1; + if (rule.prefix == null) + if (rule.shownMixinsAndFunctions == null) + if (rule.shownVariables == null) { + t1 = rule.hiddenMixinsAndFunctions; + t1 = t1 == null ? null : t1._base.get$isEmpty(0); + if (t1 === true) { + t1 = rule.hiddenVariables; + t1 = t1 == null ? null : t1._base.get$isEmpty(0); + t1 = t1 === true; + } else + t1 = false; + } else + t1 = false; + else + t1 = false; + else + t1 = false; + if (t1) + return inner; + else + return A.ForwardedModuleView$0(inner, rule, $T); + }, + ForwardedModuleView$0(_inner, _rule, $T) { + var t1 = _rule.prefix, + t2 = _rule.shownVariables, + t3 = _rule.hiddenVariables, + t4 = _rule.shownMixinsAndFunctions, + t5 = _rule.hiddenMixinsAndFunctions; + return new A.ForwardedModuleView0(_inner, _rule, A.ForwardedModuleView__forwardedMap0(_inner.get$variables(), t1, t2, t3, type$.Value_2), A.ForwardedModuleView__forwardedMap0(_inner.get$variableNodes(), t1, t2, t3, type$.AstNode_2), A.ForwardedModuleView__forwardedMap0(_inner.get$functions(_inner), t1, t4, t5, $T), A.ForwardedModuleView__forwardedMap0(_inner.get$mixins(), t1, t4, t5, $T), $T._eval$1("ForwardedModuleView0<0>")); + }, + ForwardedModuleView__forwardedMap0(map, prefix, safelist, blocklist, $V) { + var t2, + t1 = prefix == null; + if (t1) + if (safelist == null) + t2 = blocklist == null || blocklist._base.get$isEmpty(0); + else + t2 = false; + else + t2 = false; + if (t2) + return map; + if (!t1) + map = new A.PrefixedMapView0(map, prefix, $V._eval$1("PrefixedMapView0<0>")); + if (safelist != null) + map = new A.LimitedMapView0(map, safelist._base.intersection$1(new A.MapKeySet(map, type$.MapKeySet_nullable_Object)), type$.$env_1_1_String._bind$1($V)._eval$1("LimitedMapView0<1,2>")); + else if (blocklist != null && blocklist._base.get$isNotEmpty(0)) + map = A.LimitedMapView$blocklist0(map, blocklist, type$.String, $V); + return map; + }, + ForwardedModuleView0: function ForwardedModuleView0(t0, t1, t2, t3, t4, t5, t6) { + var _ = this; + _._forwarded_view0$_inner = t0; + _._forwarded_view0$_rule = t1; + _.variables = t2; + _.variableNodes = t3; + _.functions = t4; + _.mixins = t5; + _.$ti = t6; + }, + FunctionExpression0: function FunctionExpression0(t0, t1, t2, t3) { + var _ = this; + _.namespace = t0; + _.originalName = t1; + _.$arguments = t2; + _.span = t3; + }, + JSFunction0: function JSFunction0() { + }, + SupportsFunction0: function SupportsFunction0(t0, t1, t2) { + this.name = t0; + this.$arguments = t1; + this.span = t2; + }, + functionClass_closure: function functionClass_closure() { + }, + functionClass__closure: function functionClass__closure() { + }, + functionClass__closure0: function functionClass__closure0() { + }, + SassFunction0: function SassFunction0(t0) { + this.callable = t0; + }, + FunctionRule$0($name, $arguments, children, span, comment) { + var t1 = A.List_List$unmodifiable(children, type$.Statement_2), + t2 = B.JSArray_methods.any$1(t1, new A.ParentStatement_closure0()); + return new A.FunctionRule0($name, $arguments, span, t1, t2); + }, + FunctionRule0: function FunctionRule0(t0, t1, t2, t3, t4) { + var _ = this; + _.name = t0; + _.$arguments = t1; + _.span = t2; + _.children = t3; + _.hasDeclarations = t4; + }, + unifyComplex0(complexes, span) { + var t2, trailingCombinator, leadingCombinator, unifiedBase, t3, t4, _0_6, t5, _0_6_isSet, newLeadingCombinator, base, _1_1, newTrailingCombinator, _i, t6, t7, t8, _null = null, + t1 = J.getInterceptor$asx(complexes); + if (t1.get$length(complexes) === 1) + return complexes; + for (t2 = t1.get$iterator(complexes), trailingCombinator = _null, leadingCombinator = trailingCombinator, unifiedBase = leadingCombinator; t2.moveNext$0();) { + t3 = t2.get$current(t2); + if (t3.accept$1(B.C__IsUselessVisitor0)) + return _null; + t4 = t3.components; + if (t4.length === 1) { + _0_6 = t3.leadingCombinators; + t5 = _0_6.length === 1; + _0_6_isSet = true; + } else { + _0_6 = _null; + _0_6_isSet = false; + t5 = false; + } + if (t5) { + newLeadingCombinator = (_0_6_isSet ? _0_6 : t3.leadingCombinators)[0]; + if (leadingCombinator == null) + leadingCombinator = newLeadingCombinator; + else if (!(leadingCombinator.$ti._is(newLeadingCombinator) && J.$eq$(newLeadingCombinator.value, leadingCombinator.value))) + return _null; + } + base = B.JSArray_methods.get$last(t4); + _1_1 = base.combinators; + if (_1_1.length === 1) { + newTrailingCombinator = _1_1[0]; + if (trailingCombinator != null) + t3 = !(trailingCombinator.$ti._is(newTrailingCombinator) && J.$eq$(newTrailingCombinator.value, trailingCombinator.value)); + else + t3 = false; + if (t3) + return _null; + trailingCombinator = newTrailingCombinator; + } + if (unifiedBase == null) + unifiedBase = base.selector.components; + else + for (t3 = base.selector.components, t4 = t3.length, _i = 0; _i < t4; ++_i) { + unifiedBase = t3[_i].unify$1(unifiedBase); + if (unifiedBase == null) + return _null; + } + } + t2 = type$.JSArray_ComplexSelector_2; + t3 = A._setArrayType([], t2); + for (t4 = t1.get$iterator(complexes); t4.moveNext$0();) { + t5 = t4.get$current(t4); + t6 = t5.components; + t7 = t6.length; + if (t7 > 1) { + t8 = t5.leadingCombinators; + t3.push(A.ComplexSelector$0(t8, B.JSArray_methods.take$1(t6, t7 - 1), t5.span, t5.lineBreak)); + } + } + t4 = leadingCombinator == null ? B.List_empty14 : A._setArrayType([leadingCombinator], type$.JSArray_CssValue_Combinator_2); + unifiedBase.toString; + t5 = A.CompoundSelector$0(unifiedBase, span); + t6 = trailingCombinator == null ? B.List_empty14 : A._setArrayType([trailingCombinator], type$.JSArray_CssValue_Combinator_2); + base = A.ComplexSelector$0(t4, A._setArrayType([new A.ComplexSelectorComponent0(t5, A.List_List$unmodifiable(t6, type$.CssValue_Combinator_2), span)], type$.JSArray_ComplexSelectorComponent_2), span, t1.any$1(complexes, new A.unifyComplex_closure0())); + if (t3.length === 0) + t1 = A._setArrayType([base], t2); + else { + t1 = A.List_List$of(A.IterableExtension_get_exceptLast0(t3), true, type$.ComplexSelector_2); + t1.push(B.JSArray_methods.get$last(t3).concatenate$2(base, span)); + } + return A.weave0(t1, span, false); + }, + unifyCompound0(compound1, compound2) { + var t1, t2, _i, unified, + result = compound2.components; + for (t1 = compound1.components, t2 = t1.length, _i = 0; _i < t2; ++_i, result = unified) { + unified = t1[_i].unify$1(result); + if (unified == null) + return null; + } + return A.CompoundSelector$0(result, compound1.span); + }, + unifyUniversalAndElement0(selector1, selector2) { + var namespace, $name, t1, + _0_0 = A._namespaceAndName0(selector1, "selector1"), + namespace1 = _0_0._0, + name1 = _0_0._1, + _1_0 = A._namespaceAndName0(selector2, "selector2"), + namespace2 = _1_0._0, + name2 = _1_0._1; + if (namespace1 == namespace2 || namespace2 === "*") + namespace = namespace1; + else { + if (namespace1 !== "*") + return null; + namespace = namespace2; + } + if (name1 == name2 || name2 == null) + $name = name1; + else { + if (!(name1 == null || name1 === "*")) + return null; + $name = name2; + } + t1 = selector1.span; + return $name == null ? new A.UniversalSelector0(namespace, t1) : new A.TypeSelector0(new A.QualifiedName0($name, namespace), t1); + }, + _namespaceAndName0(selector, $name) { + var t1, _0_4; + $label0$0: { + if (selector instanceof A.UniversalSelector0) { + t1 = new A._Record_2(selector.namespace, null); + break $label0$0; + } + if (selector instanceof A.TypeSelector0) { + _0_4 = selector.name; + t1 = new A._Record_2(_0_4.namespace, _0_4.name); + break $label0$0; + } + t1 = A.throwExpression(A.ArgumentError$value(selector, $name, string$.must_b)); + } + return t1; + }, + weave0(complexes, span, forceLineBreak) { + var complex, t2, prefixes, t3, t4, t5, t6, i, t7, t8, _i, t9, t10, _i0, parentPrefix, t11, t12, + t1 = J.getInterceptor$asx(complexes); + if (t1.get$length(complexes) === 1) { + complex = t1.$index(complexes, 0); + if (!forceLineBreak || complex.lineBreak) + return complexes; + return A._setArrayType([A.ComplexSelector$0(complex.leadingCombinators, complex.components, complex.span, true)], type$.JSArray_ComplexSelector_2); + } + t2 = type$.JSArray_ComplexSelector_2; + prefixes = A._setArrayType([t1.get$first(complexes)], t2); + for (t1 = t1.skip$1(complexes, 1), t3 = A._instanceType(t1), t1 = new A.ListIterator(t1, t1.get$length(t1), t3._eval$1("ListIterator")), t4 = type$.ComplexSelectorComponent_2, t3 = t3._eval$1("ListIterable.E"); t1.moveNext$0();) { + t5 = t1.__internal$_current; + if (t5 == null) + t5 = t3._as(t5); + t6 = t5.components; + if (t6.length === 1) { + for (i = 0; i < prefixes.length; ++i) + prefixes[i] = prefixes[i].concatenate$3$forceLineBreak(t5, span, forceLineBreak); + continue; + } + t7 = A._setArrayType([], t2); + for (t8 = prefixes.length, _i = 0; _i < prefixes.length; prefixes.length === t8 || (0, A.throwConcurrentModificationError)(prefixes), ++_i) { + t9 = A._weaveParents0(prefixes[_i], t5, span); + if (t9 == null) + t9 = B.List_empty15; + t10 = t9.length; + _i0 = 0; + for (; _i0 < t9.length; t9.length === t10 || (0, A.throwConcurrentModificationError)(t9), ++_i0) { + parentPrefix = t9[_i0]; + t11 = B.JSArray_methods.get$last(t6); + t12 = A.List_List$of(parentPrefix.components, true, t4); + t12.push(t11); + t11 = parentPrefix.lineBreak || forceLineBreak; + t7.push(A.ComplexSelector$0(parentPrefix.leadingCombinators, t12, span, t11)); + } + } + prefixes = t7; + } + return prefixes; + }, + _weaveParents0(prefix, base, span) { + var t1, queue1, queue2, trailingCombinators, _0_1, _0_3, rootish1, rootish2, _0_30, t2, _0_3_isSet, rootish, t3, rootish_case_0, rootish_case_1, groups1, groups2, lcs, choices, t4, _i, group, t5, t6, t7, _i0, chunk, t8, t9, _null = null, + leadingCombinators = A._mergeLeadingCombinators0(prefix.leadingCombinators, base.leadingCombinators); + if (leadingCombinators == null) + return _null; + t1 = type$.ComplexSelectorComponent_2; + queue1 = A.QueueList_QueueList$from(prefix.components, t1); + queue2 = A.QueueList_QueueList$from(A.IterableExtension_get_exceptLast0(base.components), t1); + trailingCombinators = A._mergeTrailingCombinators0(queue1, queue2, span, _null); + if (trailingCombinators == null) + return _null; + $label0$0: { + _0_1 = A._firstIfRootish0(queue1); + _0_3 = A._firstIfRootish0(queue2); + if (_0_1 != null) { + rootish1 = _0_1 == null ? t1._as(_0_1) : _0_1; + if (_0_3 != null) { + rootish2 = _0_3 == null ? t1._as(_0_3) : _0_3; + _0_30 = _0_3; + t2 = true; + } else { + rootish2 = _null; + _0_30 = _0_3; + t2 = false; + } + _0_3_isSet = true; + } else { + rootish2 = _null; + rootish1 = rootish2; + _0_30 = rootish1; + _0_3_isSet = false; + t2 = false; + } + if (t2) { + rootish = A.unifyCompound0(rootish1.selector, rootish2.selector); + if (rootish == null) + return _null; + t1 = rootish1.combinators; + t2 = rootish1.span; + t3 = type$.CssValue_Combinator_2; + queue1.addFirst$1(new A.ComplexSelectorComponent0(rootish, A.List_List$unmodifiable(t1, t3), t2)); + queue2.addFirst$1(new A.ComplexSelectorComponent0(rootish, A.List_List$unmodifiable(rootish2.combinators, t3), t2)); + break $label0$0; + } + if (_0_1 != null) { + rootish_case_0 = _0_1 == null ? t1._as(_0_1) : _0_1; + if (_0_3_isSet) + t2 = _0_30; + else { + t2 = _0_3; + _0_30 = t2; + _0_3_isSet = true; + } + if (t2 == null) { + t2 = rootish_case_0; + t3 = true; + } else { + t2 = _null; + t3 = false; + } + } else { + t2 = _null; + t3 = false; + } + if (!t3) + if (_0_1 == null) { + if (_0_3_isSet) + t3 = _0_30; + else { + t3 = _0_3; + _0_30 = t3; + _0_3_isSet = true; + } + if (t3 != null) { + rootish_case_1 = _0_3_isSet ? _0_30 : _0_3; + if (rootish_case_1 == null) + rootish_case_1 = t1._as(rootish_case_1); + t1 = rootish_case_1; + t2 = true; + } else { + t1 = t2; + t2 = false; + } + } else { + t1 = t2; + t2 = false; + } + else { + t1 = t2; + t2 = true; + } + if (t2) { + queue1.addFirst$1(t1); + queue2.addFirst$1(t1); + } + } + groups1 = A._groupSelectors0(queue1); + groups2 = A._groupSelectors0(queue2); + t1 = type$.List_ComplexSelectorComponent_2; + lcs = A.longestCommonSubsequence0(groups2, groups1, new A._weaveParents_closure3(span), t1); + choices = A._setArrayType([], type$.JSArray_List_Iterable_ComplexSelectorComponent_2); + for (t2 = lcs.length, t3 = type$.JSArray_Iterable_ComplexSelectorComponent_2, t4 = type$.JSArray_ComplexSelectorComponent_2, _i = 0; _i < lcs.length; lcs.length === t2 || (0, A.throwConcurrentModificationError)(lcs), ++_i) { + group = lcs[_i]; + t5 = A._setArrayType([], t3); + for (t6 = A._chunks0(groups1, groups2, new A._weaveParents_closure4(group), t1), t7 = t6.length, _i0 = 0; _i0 < t6.length; t6.length === t7 || (0, A.throwConcurrentModificationError)(t6), ++_i0) { + chunk = t6[_i0]; + t8 = A._setArrayType([], t4); + for (t9 = B.JSArray_methods.get$iterator(chunk); t9.moveNext$0();) + B.JSArray_methods.addAll$1(t8, t9.get$current(0)); + t5.push(t8); + } + choices.push(t5); + choices.push(A._setArrayType([group], t3)); + groups1.removeFirst$0(); + groups2.removeFirst$0(); + } + t2 = A._setArrayType([], t3); + for (t1 = A._chunks0(groups1, groups2, new A._weaveParents_closure5(), t1), t3 = t1.length, _i = 0; _i < t1.length; t1.length === t3 || (0, A.throwConcurrentModificationError)(t1), ++_i) { + chunk = t1[_i]; + t5 = A._setArrayType([], t4); + for (t6 = B.JSArray_methods.get$iterator(chunk); t6.moveNext$0();) + B.JSArray_methods.addAll$1(t5, t6.get$current(0)); + t2.push(t5); + } + choices.push(t2); + B.JSArray_methods.addAll$1(choices, trailingCombinators); + t1 = A._setArrayType([], type$.JSArray_ComplexSelector_2); + for (t2 = J.get$iterator$ax(A.paths0(new A.WhereIterable(choices, new A._weaveParents_closure6(), type$.WhereIterable_List_Iterable_ComplexSelectorComponent_2), type$.Iterable_ComplexSelectorComponent_2)), t3 = !prefix.lineBreak, t5 = base.lineBreak; t2.moveNext$0();) { + t6 = t2.get$current(t2); + t7 = A._setArrayType([], t4); + for (t6 = J.get$iterator$ax(t6); t6.moveNext$0();) + B.JSArray_methods.addAll$1(t7, t6.get$current(t6)); + t1.push(A.ComplexSelector$0(leadingCombinators, t7, span, !t3 || t5)); + } + return t1; + }, + _firstIfRootish0(queue) { + var first, t1, t2, _i, simple, t3; + if (queue.get$length(0) >= 1) { + first = queue.$index(0, 0); + for (t1 = first.selector.components, t2 = t1.length, _i = 0; _i < t2; ++_i) { + simple = t1[_i]; + if (simple instanceof A.PseudoSelector0) + if (simple.isClass) + t3 = $._rootishPseudoClasses0.contains$1(0, simple.normalizedName); + else + t3 = false; + else + t3 = false; + if (t3) { + queue.removeFirst$0(); + return first; + } + } + } + return null; + }, + _mergeLeadingCombinators0(combinators1, combinators2) { + var _0_4, _0_4_isSet, t1, _0_7, t2, _0_1, _0_7_isSet, _0_11, _0_11_isSet, combinators, _null = null; + $label0$0: { + _0_4 = combinators2; + _0_4_isSet = true; + t1 = false; + if (t1) { + t1 = _null; + break $label0$0; + } + t1 = type$.List_CssValue_Combinator_2; + if (t1._is(combinators1)) { + _0_7 = combinators1.length; + t2 = _0_7; + _0_1 = combinators1; + t2 = t2 > 1; + _0_7_isSet = true; + } else { + _0_7 = _null; + _0_1 = combinators1; + _0_7_isSet = false; + t2 = false; + } + if (!t2) { + if (_0_4_isSet) + t2 = _0_4; + else { + t2 = combinators2; + _0_4 = t2; + _0_4_isSet = true; + } + if (t1._is(t2)) { + if (_0_4_isSet) + t2 = _0_4; + else { + t2 = combinators2; + _0_4 = t2; + _0_4_isSet = true; + } + _0_11 = (t2 == null ? t1._as(t2) : t2).length; + t2 = _0_11; + t2 = t2 > 1; + _0_11_isSet = true; + } else { + _0_11 = _null; + _0_11_isSet = false; + t2 = false; + } + } else { + _0_11 = _null; + _0_11_isSet = false; + t2 = true; + } + if (t2) { + t1 = _null; + break $label0$0; + } + if (t1._is(_0_1)) { + if (_0_7_isSet) + t2 = _0_7; + else { + _0_7 = _0_1.length; + t2 = _0_7; + } + if (t2 <= 0) { + if (_0_4_isSet) + combinators = _0_4; + else { + combinators = combinators2; + _0_4 = combinators; + _0_4_isSet = true; + } + t2 = true; + } else { + combinators = _null; + t2 = false; + } + } else { + combinators = _null; + t2 = false; + } + if (!t2) { + if (_0_4_isSet) + t2 = _0_4; + else { + t2 = combinators2; + _0_4 = t2; + _0_4_isSet = true; + } + if (t1._is(t2)) { + if (_0_11_isSet) + t1 = _0_11; + else { + t2 = _0_4_isSet ? _0_4 : combinators2; + _0_11 = (t2 == null ? t1._as(t2) : t2).length; + t1 = _0_11; + } + t1 = t1 <= 0; + } else + t1 = false; + combinators = _0_1; + } else + t1 = true; + if (t1) { + t1 = combinators; + break $label0$0; + } + t1 = B.C_ListEquality.equals$2(0, combinators1, combinators2) ? combinators1 : _null; + break $label0$0; + } + return t1; + }, + _mergeTrailingCombinators0(components1, components2, span, result) { + var _0_1, t1, _1_1, t2, t3, _4_1, _4_3, _4_4, _4_5, _4_5_isSet, _4_4_isSet, component1, component2, t4, t5, choices, _2_0, _4_9, _4_6, _4_7, nextComponents, followingComponents, _4_6_isSet, _4_7_isSet, _4_9_isSet, _4_10, _4_1_isSet, _4_10_isSet, next, following, _3_0, siblingComponents_case_0, siblingComponents_case_1, combinator1, combinator2, unified, combinator_case_0, combinatorComponents_case_0, descendantComponents_case_0, combinator_case_1, descendantComponents_case_1, combinatorComponents_case_1, _null = null; + if (result == null) + result = A.QueueList$(_null, type$.List_List_ComplexSelectorComponent_2); + $label0$0: { + _0_1 = components1.get$length(0); + if (_0_1 >= 1) { + t1 = components1.$index(0, _0_1 - 1).combinators; + break $label0$0; + } + t1 = B.List_empty14; + break $label0$0; + } + $label1$1: { + _1_1 = components2.get$length(0); + if (_1_1 >= 1) { + t2 = components2.$index(0, _1_1 - 1).combinators; + break $label1$1; + } + t2 = B.List_empty14; + break $label1$1; + } + t3 = t1.length; + if (t3 === 0 && t2.length === 0) + return result; + if (t3 > 1 || t2.length > 1) + return _null; + $label2$2: { + t3 = A.IterableExtension_get_firstOrNull(t1); + t3 = t3 == null ? _null : t3.value; + t2 = A.IterableExtension_get_firstOrNull(t2); + t2 = [t3, t2 == null ? _null : t2.value, components1, components2]; + _4_1 = t2[0]; + _4_3 = B.Combinator_Htt0 === _4_1; + t3 = _4_3; + if (t3) { + _4_4 = t2[1]; + _4_5 = B.Combinator_Htt0 === _4_4; + t3 = _4_5; + _4_5_isSet = true; + _4_4_isSet = true; + } else { + _4_4 = _null; + _4_5 = _4_4; + _4_5_isSet = false; + _4_4_isSet = false; + t3 = false; + } + if (t3) { + component1 = components1.removeLast$0(0); + component2 = components2.removeLast$0(0); + t2 = component1.selector; + t3 = component2.selector; + if (A.compoundIsSuperselector0(t2, t3, _null)) + result.addFirst$1(A._setArrayType([A._setArrayType([component2], type$.JSArray_ComplexSelectorComponent_2)], type$.JSArray_List_ComplexSelectorComponent_2)); + else { + t4 = type$.JSArray_ComplexSelectorComponent_2; + t5 = type$.JSArray_List_ComplexSelectorComponent_2; + if (A.compoundIsSuperselector0(t3, t2, _null)) + result.addFirst$1(A._setArrayType([A._setArrayType([component1], t4)], t5)); + else { + choices = A._setArrayType([A._setArrayType([component1, component2], t4), A._setArrayType([component2, component1], t4)], t5); + _2_0 = A.unifyCompound0(t2, t3); + if (_2_0 != null) + choices.push(A._setArrayType([new A.ComplexSelectorComponent0(_2_0, A.List_List$unmodifiable(A._setArrayType([B.JSArray_methods.get$first(t1)], type$.JSArray_CssValue_Combinator_2), type$.CssValue_Combinator_2), span)], t4)); + result.addFirst$1(choices); + } + } + break $label2$2; + } + if (_4_3) { + if (_4_4_isSet) + t3 = _4_4; + else { + _4_4 = t2[1]; + t3 = _4_4; + _4_4_isSet = true; + } + _4_9 = B.Combinator_4QF0 === t3; + t3 = _4_9; + if (t3) { + _4_6 = t2[2]; + _4_7 = t2[3]; + nextComponents = _4_7; + followingComponents = _4_6; + _4_6_isSet = true; + _4_7_isSet = true; + t3 = true; + } else { + nextComponents = _null; + followingComponents = nextComponents; + _4_7 = followingComponents; + _4_6 = _4_7; + _4_6_isSet = false; + _4_7_isSet = false; + t3 = false; + } + _4_9_isSet = true; + } else { + nextComponents = _null; + followingComponents = nextComponents; + _4_7 = followingComponents; + _4_6 = _4_7; + _4_9 = _4_6; + _4_9_isSet = false; + _4_6_isSet = false; + _4_7_isSet = false; + t3 = false; + } + if (!t3) { + _4_10 = B.Combinator_4QF0 === _4_1; + t3 = _4_10; + _4_1_isSet = true; + if (t3) { + if (_4_5_isSet) + t3 = _4_5; + else { + if (_4_4_isSet) + t3 = _4_4; + else { + _4_4 = t2[1]; + t3 = _4_4; + _4_4_isSet = true; + } + _4_5 = B.Combinator_Htt0 === t3; + t3 = _4_5; + _4_5_isSet = true; + } + if (t3) { + if (_4_6_isSet) + nextComponents = _4_6; + else { + _4_6 = t2[2]; + nextComponents = _4_6; + _4_6_isSet = true; + } + if (_4_7_isSet) + followingComponents = _4_7; + else { + _4_7 = t2[3]; + followingComponents = _4_7; + _4_7_isSet = true; + } + t3 = true; + } else + t3 = false; + } else + t3 = false; + _4_10_isSet = true; + } else { + _4_10 = _null; + _4_1_isSet = true; + _4_10_isSet = false; + t3 = true; + } + if (t3) { + next = nextComponents.removeLast$0(0); + following = followingComponents.removeLast$0(0); + t1 = following.selector; + t2 = next.selector; + t3 = type$.JSArray_ComplexSelectorComponent_2; + t4 = type$.JSArray_List_ComplexSelectorComponent_2; + if (A.compoundIsSuperselector0(t1, t2, _null)) + result.addFirst$1(A._setArrayType([A._setArrayType([next], t3)], t4)); + else { + t4 = A._setArrayType([A._setArrayType([following, next], t3)], t4); + _3_0 = A.unifyCompound0(t1, t2); + if (_3_0 != null) + t4.push(A._setArrayType([new A.ComplexSelectorComponent0(_3_0, A.List_List$unmodifiable(next.combinators, type$.CssValue_Combinator_2), span)], t3)); + result.addFirst$1(t4); + } + break $label2$2; + } + if (_4_1_isSet) + t3 = _4_1; + else { + _4_1 = t2[0]; + t3 = _4_1; + _4_1_isSet = true; + } + if (B.Combinator_Cht0 === t3) { + if (_4_9_isSet) + t3 = _4_9; + else { + if (_4_4_isSet) + t3 = _4_4; + else { + _4_4 = t2[1]; + t3 = _4_4; + _4_4_isSet = true; + } + _4_9 = B.Combinator_4QF0 === t3; + t3 = _4_9; + } + if (!t3) + if (_4_5_isSet) + t3 = _4_5; + else { + if (_4_4_isSet) + t3 = _4_4; + else { + _4_4 = t2[1]; + t3 = _4_4; + _4_4_isSet = true; + } + _4_5 = B.Combinator_Htt0 === t3; + t3 = _4_5; + } + else + t3 = true; + if (t3) { + if (_4_7_isSet) + siblingComponents_case_0 = _4_7; + else { + _4_7 = t2[3]; + siblingComponents_case_0 = _4_7; + _4_7_isSet = true; + } + t3 = siblingComponents_case_0; + t4 = true; + } else { + t3 = _null; + t4 = false; + } + } else { + t3 = _null; + t4 = false; + } + if (!t4) { + if (_4_10_isSet) + t4 = _4_10; + else { + if (_4_1_isSet) + t4 = _4_1; + else { + _4_1 = t2[0]; + t4 = _4_1; + _4_1_isSet = true; + } + _4_10 = B.Combinator_4QF0 === t4; + t4 = _4_10; + } + if (!t4) + t4 = _4_3; + else + t4 = true; + if (t4) { + if (_4_4_isSet) + t4 = _4_4; + else { + _4_4 = t2[1]; + t4 = _4_4; + _4_4_isSet = true; + } + if (B.Combinator_Cht0 === t4) { + if (_4_6_isSet) + siblingComponents_case_1 = _4_6; + else { + _4_6 = t2[2]; + siblingComponents_case_1 = _4_6; + _4_6_isSet = true; + } + t3 = siblingComponents_case_1; + t4 = true; + } else + t4 = false; + } else + t4 = false; + } else + t4 = true; + if (t4) { + result.addFirst$1(A._setArrayType([A._setArrayType([t3.removeLast$0(0)], type$.JSArray_ComplexSelectorComponent_2)], type$.JSArray_List_ComplexSelectorComponent_2)); + break $label2$2; + } + if (_4_1_isSet) + t3 = _4_1; + else { + _4_1 = t2[0]; + t3 = _4_1; + _4_1_isSet = true; + } + if (t3 != null) { + if (_4_1_isSet) + combinator1 = _4_1; + else { + _4_1 = t2[0]; + combinator1 = _4_1; + _4_1_isSet = true; + } + if (combinator1 == null) + combinator1 = type$.Combinator_2._as(combinator1); + if (_4_4_isSet) + t3 = _4_4; + else { + _4_4 = t2[1]; + t3 = _4_4; + _4_4_isSet = true; + } + if (t3 != null) { + if (_4_4_isSet) + combinator2 = _4_4; + else { + _4_4 = t2[1]; + combinator2 = _4_4; + _4_4_isSet = true; + } + t3 = combinator1 === (combinator2 == null ? type$.Combinator_2._as(combinator2) : combinator2); + } else + t3 = false; + } else + t3 = false; + if (t3) { + unified = A.unifyCompound0(components1.removeLast$0(0).selector, components2.removeLast$0(0).selector); + if (unified == null) + return _null; + result.addFirst$1(A._setArrayType([A._setArrayType([new A.ComplexSelectorComponent0(unified, A.List_List$unmodifiable(A._setArrayType([B.JSArray_methods.get$first(t1)], type$.JSArray_CssValue_Combinator_2), type$.CssValue_Combinator_2), span)], type$.JSArray_ComplexSelectorComponent_2)], type$.JSArray_List_ComplexSelectorComponent_2)); + break $label2$2; + } + if (_4_1_isSet) + t1 = _4_1; + else { + _4_1 = t2[0]; + t1 = _4_1; + _4_1_isSet = true; + } + if (t1 != null) { + if (_4_1_isSet) + combinator_case_0 = _4_1; + else { + _4_1 = t2[0]; + combinator_case_0 = _4_1; + _4_1_isSet = true; + } + if (combinator_case_0 == null) + combinator_case_0 = type$.Combinator_2._as(combinator_case_0); + if (_4_4_isSet) + t1 = _4_4; + else { + _4_4 = t2[1]; + t1 = _4_4; + _4_4_isSet = true; + } + if (t1 == null) { + if (_4_6_isSet) + combinatorComponents_case_0 = _4_6; + else { + _4_6 = t2[2]; + combinatorComponents_case_0 = _4_6; + _4_6_isSet = true; + } + if (_4_7_isSet) + descendantComponents_case_0 = _4_7; + else { + _4_7 = t2[3]; + descendantComponents_case_0 = _4_7; + _4_7_isSet = true; + } + t1 = descendantComponents_case_0; + t3 = true; + t5 = t3; + t3 = combinatorComponents_case_0; + t4 = t1; + t1 = combinator_case_0; + } else { + t4 = _null; + t3 = t4; + t1 = t3; + t5 = false; + } + } else { + t4 = _null; + t3 = t4; + t1 = t3; + t5 = false; + } + if (!t5) + if ((_4_1_isSet ? _4_1 : t2[0]) == null) { + if (_4_4_isSet) + t5 = _4_4; + else { + _4_4 = t2[1]; + t5 = _4_4; + _4_4_isSet = true; + } + if (t5 != null) { + combinator_case_1 = _4_4_isSet ? _4_4 : t2[1]; + if (combinator_case_1 == null) + combinator_case_1 = type$.Combinator_2._as(combinator_case_1); + descendantComponents_case_1 = _4_6_isSet ? _4_6 : t2[2]; + combinatorComponents_case_1 = _4_7_isSet ? _4_7 : t2[3]; + t1 = combinatorComponents_case_1; + t2 = true; + t3 = t2; + t2 = descendantComponents_case_1; + t4 = t3; + t3 = t2; + t2 = t1; + t1 = combinator_case_1; + } else { + t2 = t3; + t3 = t4; + t4 = false; + } + } else { + t2 = t3; + t3 = t4; + t4 = false; + } + else { + t2 = t3; + t3 = t4; + t4 = true; + } + if (t4) { + if (t1 === B.Combinator_Cht0) { + t1 = A.IterableExtension_get_lastOrNull(t3); + t1 = t1 == null ? _null : A.compoundIsSuperselector0(t1.selector, t2.get$last(t2).selector, _null); + t1 = t1 === true; + } else + t1 = false; + if (t1) + t3.removeLast$0(0); + result.addFirst$1(A._setArrayType([A._setArrayType([t2.removeLast$0(0)], type$.JSArray_ComplexSelectorComponent_2)], type$.JSArray_List_ComplexSelectorComponent_2)); + break $label2$2; + } + return _null; + } + return A._mergeTrailingCombinators0(components1, components2, span, result); + }, + _mustUnify0(complex1, complex2) { + var t2, t3, t4, + t1 = A.LinkedHashSet_LinkedHashSet$_empty(type$.SimpleSelector_2); + for (t2 = J.get$iterator$ax(complex1); t2.moveNext$0();) + for (t3 = B.JSArray_methods.get$iterator(t2.get$current(t2).selector.components), t4 = new A.WhereIterator(t3, A.functions0___isUnique$closure()); t4.moveNext$0();) + t1.add$1(0, t3.get$current(0)); + if (t1._collection$_length === 0) + return false; + return J.any$1$ax(complex2, new A._mustUnify_closure0(t1)); + }, + _isUnique0(simple) { + var t1; + if (!(simple instanceof A.IDSelector0)) + t1 = simple instanceof A.PseudoSelector0 && !simple.isClass; + else + t1 = true; + return t1; + }, + _chunks0(queue1, queue2, done, $T) { + var chunk2, _0_4, _0_1, _0_7, _0_5, _0_7_isSet, _0_5_isSet, chunk, t2, _null = null, + t1 = $T._eval$1("JSArray<0>"), + chunk1 = A._setArrayType([], t1); + for (; !done.call$1(queue1);) + chunk1.push(queue1.removeFirst$0()); + chunk2 = A._setArrayType([], t1); + for (; !done.call$1(queue2);) + chunk2.push(queue2.removeFirst$0()); + $label0$0: { + _0_4 = chunk1.length <= 0; + t1 = _0_4; + _0_1 = chunk1; + if (t1) { + _0_7 = chunk2.length <= 0; + t1 = _0_7; + _0_5 = chunk2; + _0_7_isSet = true; + _0_5_isSet = true; + } else { + _0_5 = _null; + _0_7 = _0_5; + _0_7_isSet = false; + _0_5_isSet = false; + t1 = false; + } + if (t1) { + t1 = A._setArrayType([], $T._eval$1("JSArray>")); + break $label0$0; + } + if (_0_4) { + if (_0_5_isSet) + chunk = _0_5; + else { + chunk = chunk2; + _0_5 = chunk; + _0_5_isSet = true; + } + t1 = true; + } else { + chunk = _null; + t1 = false; + } + if (!t1) { + chunk = _0_1; + if (_0_7_isSet) + t1 = _0_7; + else { + _0_7 = (_0_5_isSet ? _0_5 : chunk2).length <= 0; + t1 = _0_7; + } + } else + t1 = true; + if (t1) { + t1 = A._setArrayType([chunk], $T._eval$1("JSArray>")); + break $label0$0; + } + t1 = A.List_List$of(chunk1, true, $T); + B.JSArray_methods.addAll$1(t1, chunk2); + t2 = A.List_List$of(chunk2, true, $T); + B.JSArray_methods.addAll$1(t2, chunk1); + t2 = A._setArrayType([t1, t2], $T._eval$1("JSArray>")); + t1 = t2; + break $label0$0; + } + return t1; + }, + paths0(choices, $T) { + return J.fold$2$ax(choices, A._setArrayType([A._setArrayType([], $T._eval$1("JSArray<0>"))], $T._eval$1("JSArray>")), new A.paths_closure0($T)); + }, + _groupSelectors0(complex) { + var t2, t3, t4, + groups = A.QueueList$(null, type$.List_ComplexSelectorComponent_2), + t1 = type$.JSArray_ComplexSelectorComponent_2, + group = A._setArrayType([], t1); + for (t2 = complex.$ti, t3 = new A.ListIterator(complex, complex.get$length(0), t2._eval$1("ListIterator")), t2 = t2._eval$1("ListBase.E"); t3.moveNext$0();) { + t4 = t3.__internal$_current; + if (t4 == null) + t4 = t2._as(t4); + group.push(t4); + if (t4.combinators.length === 0) { + groups._queue_list$_add$1(group); + group = A._setArrayType([], t1); + } + } + if (group.length !== 0) + groups._queue_list$_add$1(group); + return groups; + }, + listIsSuperselector0(list1, list2) { + return B.JSArray_methods.every$1(list2, new A.listIsSuperselector_closure0(list1)); + }, + _complexIsParentSuperselector0(complex1, complex2) { + var t1, base, t2; + if (J.get$length$asx(complex1) > J.get$length$asx(complex2)) + return false; + t1 = $.$get$bogusSpan0(); + base = new A.ComplexSelectorComponent0(A.CompoundSelector$0(A._setArrayType([new A.PlaceholderSelector0("", t1)], type$.JSArray_SimpleSelector_2), t1), A.List_List$unmodifiable(B.List_empty14, type$.CssValue_Combinator_2), t1); + t1 = type$.ComplexSelectorComponent_2; + t2 = A.List_List$of(complex1, true, t1); + t2.push(base); + t1 = A.List_List$of(complex2, true, t1); + t1.push(base); + return A.complexIsSuperselector0(t2, t1); + }, + complexIsSuperselector0(complex1, complex2) { + var t1, t2, t3, i1, i2, previousCombinator, remaining1, t4, remaining2, component1, t5, parents, endOfSubselector, component2, combinator1; + if (B.JSArray_methods.get$last(complex1).combinators.length !== 0) + return false; + if (B.JSArray_methods.get$last(complex2).combinators.length !== 0) + return false; + for (t1 = type$.JSArray_ComplexSelectorComponent_2, t2 = A._arrayInstanceType(complex2), t3 = t2._precomputed1, t2 = t2._eval$1("SubListIterable<1>"), i1 = 0, i2 = 0, previousCombinator = null; true; previousCombinator = combinator1) { + remaining1 = complex1.length - i1; + t4 = complex2.length; + remaining2 = t4 - i2; + if (remaining1 === 0 || remaining2 === 0) + return false; + if (remaining1 > remaining2) + return false; + component1 = complex1[i1]; + t5 = component1.combinators; + if (t5.length > 1) + return false; + if (remaining1 === 1) { + parents = B.JSArray_methods.sublist$2(complex2, i2, t4 - 1); + if (B.JSArray_methods.any$1(parents, new A.complexIsSuperselector_closure1())) + return false; + return A.compoundIsSuperselector0(component1.selector, B.JSArray_methods.get$last(complex2).selector, parents); + } + for (t4 = component1.selector, endOfSubselector = i2, parents = null; true;) { + component2 = complex2[endOfSubselector]; + if (component2.combinators.length > 1) + return false; + if (A.compoundIsSuperselector0(t4, component2.selector, parents)) + break; + ++endOfSubselector; + if (endOfSubselector === complex2.length - 1) + return false; + if (parents == null) + parents = A._setArrayType([], t1); + parents.push(component2); + } + if (!A._compatibleWithPreviousCombinator0(previousCombinator, parents == null ? B.List_empty13 : parents)) + return false; + component2 = complex2[endOfSubselector]; + combinator1 = A.IterableExtension_get_firstOrNull(t5); + if (!A._isSupercombinator0(combinator1, A.IterableExtension_get_firstOrNull(component2.combinators))) + return false; + ++i1; + i2 = endOfSubselector + 1; + if (complex1.length - i1 === 1) { + t4 = combinator1 == null; + if (J.$eq$(t4 ? null : combinator1.value, B.Combinator_Htt0)) { + t4 = complex2.length - 1; + t5 = new A.SubListIterable(complex2, 0, t4, t2); + t5.SubListIterable$3(complex2, 0, t4, t3); + if (!t5.skip$1(0, i2).every$1(0, new A.complexIsSuperselector_closure2(combinator1))) + return false; + } else if (!t4) + if (complex2.length - i2 > 1) + return false; + } + } + }, + _compatibleWithPreviousCombinator0(previous, parents) { + if (parents.length === 0) + return true; + if (previous == null) + return true; + if (previous.value !== B.Combinator_Htt0) + return false; + return B.JSArray_methods.every$1(parents, new A._compatibleWithPreviousCombinator_closure0()); + }, + _isSupercombinator0(combinator1, combinator2) { + var t1, t2; + if (!J.$eq$(combinator1, combinator2)) { + t1 = combinator1 == null; + if (t1) + t2 = J.$eq$(combinator2 == null ? null : combinator2.value, B.Combinator_Cht0); + else + t2 = false; + if (!t2) + if (J.$eq$(t1 ? null : combinator1.value, B.Combinator_Htt0)) + t1 = J.$eq$(combinator2 == null ? null : combinator2.value, B.Combinator_4QF0); + else + t1 = false; + else + t1 = true; + } else + t1 = true; + return t1; + }, + compoundIsSuperselector0(compound1, compound2, parents) { + var pseudo1, index1, pseudo2, index2, _0_50, _0_5_isSet, t2, t3, t4, t5, _i, simple1, _null = null, + _0_1 = A._findPseudoElementIndexed0(compound1), + _0_5 = A._findPseudoElementIndexed0(compound2), + t1 = type$.Record_2_nullable_Object_and_nullable_Object; + if (t1._is(_0_1)) { + pseudo1 = (_0_1 == null ? t1._as(_0_1) : _0_1)._0; + index1 = (_0_1 == null ? t1._as(_0_1) : _0_1)._1; + if (t1._is(_0_5)) { + pseudo2 = (_0_5 == null ? t1._as(_0_5) : _0_5)._0; + index2 = (_0_5 == null ? t1._as(_0_5) : _0_5)._1; + _0_50 = _0_5; + t1 = true; + } else { + index2 = _null; + pseudo2 = index2; + _0_50 = _0_5; + t1 = false; + } + _0_5_isSet = true; + } else { + index2 = _null; + pseudo2 = index2; + index1 = pseudo2; + pseudo1 = index1; + _0_50 = pseudo1; + _0_5_isSet = false; + t1 = false; + } + if (t1) { + if (pseudo1.isSuperselector$1(pseudo2)) { + t1 = compound1.components; + t2 = type$.int; + t3 = A._arrayInstanceType(t1)._precomputed1; + t4 = compound2.components; + t5 = A._arrayInstanceType(t4)._precomputed1; + t1 = A._compoundComponentsIsSuperselector0(A.SubListIterable$(t1, 0, A.checkNotNullable(index1, "count", t2), t3), A.SubListIterable$(t4, 0, A.checkNotNullable(index2, "count", t2), t5), parents) && A._compoundComponentsIsSuperselector0(A.SubListIterable$(t1, index1 + 1, _null, t3), A.SubListIterable$(t4, index2 + 1, _null, t5), parents); + } else + t1 = false; + return t1; + } + if (!(_0_1 != null && true)) + t1 = (_0_5_isSet ? _0_50 : _0_5) != null && true; + else + t1 = true; + if (t1) + return false; + for (t1 = compound1.components, t2 = t1.length, t3 = compound2.components, _i = 0; _i < t2; ++_i) { + simple1 = t1[_i]; + if (simple1 instanceof A.PseudoSelector0 && simple1.selector != null && true) { + if (!A._selectorPseudoIsSuperselector0(simple1, compound2, parents)) + return false; + } else if (!B.JSArray_methods.any$1(t3, simple1.get$isSuperselector())) + return false; + } + return true; + }, + _findPseudoElementIndexed0(compound) { + var t1, t2, i, simple; + for (t1 = compound.components, t2 = t1.length, i = 0; i < t2; ++i) { + simple = t1[i]; + if (simple instanceof A.PseudoSelector0 && !simple.isClass) + return new A._Record_2(simple, i); + } + return null; + }, + _compoundComponentsIsSuperselector0(compound1, compound2, parents) { + var t1; + if (compound1.get$length(0) === 0) + return true; + if (compound2.get$length(0) === 0) + compound2 = A._setArrayType([new A.UniversalSelector0("*", $.$get$bogusSpan0())], type$.JSArray_SimpleSelector_2); + t1 = $.$get$bogusSpan0(); + return A.compoundIsSuperselector0(A.CompoundSelector$0(compound1, t1), A.CompoundSelector$0(compound2, t1), parents); + }, + _selectorPseudoIsSuperselector0(pseudo1, compound2, parents) { + var selector1 = pseudo1.selector; + if (selector1 == null) + throw A.wrapException(A.ArgumentError$("Selector " + pseudo1.toString$0(0) + " must have a selector argument.", null)); + switch (pseudo1.normalizedName) { + case "is": + case "matches": + case "any": + case "where": + return A._selectorPseudoArgs0(compound2, pseudo1.name, true).any$1(0, new A._selectorPseudoIsSuperselector_closure6(selector1)) || B.JSArray_methods.any$1(selector1.components, new A._selectorPseudoIsSuperselector_closure7(parents, compound2)); + case "has": + case "host": + case "host-context": + return A._selectorPseudoArgs0(compound2, pseudo1.name, true).any$1(0, new A._selectorPseudoIsSuperselector_closure8(selector1)); + case "slotted": + return A._selectorPseudoArgs0(compound2, pseudo1.name, false).any$1(0, new A._selectorPseudoIsSuperselector_closure9(selector1)); + case "not": + return B.JSArray_methods.every$1(selector1.components, new A._selectorPseudoIsSuperselector_closure10(compound2, pseudo1)); + case "current": + return A._selectorPseudoArgs0(compound2, pseudo1.name, true).any$1(0, new A._selectorPseudoIsSuperselector_closure11(selector1)); + case "nth-child": + case "nth-last-child": + return B.JSArray_methods.any$1(compound2.components, new A._selectorPseudoIsSuperselector_closure12(pseudo1, selector1)); + default: + throw A.wrapException("unreachable"); + } + }, + _selectorPseudoArgs0(compound, $name, isClass) { + var t1 = type$.WhereTypeIterable_PseudoSelector_2; + return A.IterableNullableExtension_whereNotNull(new A.MappedIterable(new A.WhereIterable(new A.WhereTypeIterable(compound.components, t1), new A._selectorPseudoArgs_closure1(isClass, $name), t1._eval$1("WhereIterable")), new A._selectorPseudoArgs_closure2(), t1._eval$1("MappedIterable")), type$.SelectorList_2); + }, + unifyComplex_closure0: function unifyComplex_closure0() { + }, + _weaveParents_closure3: function _weaveParents_closure3(t0) { + this.span = t0; + }, + _weaveParents_closure4: function _weaveParents_closure4(t0) { + this.group = t0; + }, + _weaveParents_closure5: function _weaveParents_closure5() { + }, + _weaveParents_closure6: function _weaveParents_closure6() { + }, + _mustUnify_closure0: function _mustUnify_closure0(t0) { + this.uniqueSelectors = t0; + }, + _mustUnify__closure0: function _mustUnify__closure0(t0) { + this.uniqueSelectors = t0; + }, + paths_closure0: function paths_closure0(t0) { + this.T = t0; + }, + paths__closure0: function paths__closure0(t0, t1) { + this.paths = t0; + this.T = t1; + }, + paths___closure0: function paths___closure0(t0, t1) { + this.option = t0; + this.T = t1; + }, + listIsSuperselector_closure0: function listIsSuperselector_closure0(t0) { + this.list1 = t0; + }, + listIsSuperselector__closure0: function listIsSuperselector__closure0(t0) { + this.complex1 = t0; + }, + complexIsSuperselector_closure1: function complexIsSuperselector_closure1() { + }, + complexIsSuperselector_closure2: function complexIsSuperselector_closure2(t0) { + this.combinator1 = t0; + }, + _compatibleWithPreviousCombinator_closure0: function _compatibleWithPreviousCombinator_closure0() { + }, + _selectorPseudoIsSuperselector_closure6: function _selectorPseudoIsSuperselector_closure6(t0) { + this.selector1 = t0; + }, + _selectorPseudoIsSuperselector_closure7: function _selectorPseudoIsSuperselector_closure7(t0, t1) { + this.parents = t0; + this.compound2 = t1; + }, + _selectorPseudoIsSuperselector_closure8: function _selectorPseudoIsSuperselector_closure8(t0) { + this.selector1 = t0; + }, + _selectorPseudoIsSuperselector_closure9: function _selectorPseudoIsSuperselector_closure9(t0) { + this.selector1 = t0; + }, + _selectorPseudoIsSuperselector_closure10: function _selectorPseudoIsSuperselector_closure10(t0, t1) { + this.compound2 = t0; + this.pseudo1 = t1; + }, + _selectorPseudoIsSuperselector__closure0: function _selectorPseudoIsSuperselector__closure0(t0, t1) { + this.complex = t0; + this.pseudo1 = t1; + }, + _selectorPseudoIsSuperselector___closure1: function _selectorPseudoIsSuperselector___closure1(t0) { + this.simple2 = t0; + }, + _selectorPseudoIsSuperselector___closure2: function _selectorPseudoIsSuperselector___closure2(t0) { + this.simple2 = t0; + }, + _selectorPseudoIsSuperselector_closure11: function _selectorPseudoIsSuperselector_closure11(t0) { + this.selector1 = t0; + }, + _selectorPseudoIsSuperselector_closure12: function _selectorPseudoIsSuperselector_closure12(t0, t1) { + this.pseudo1 = t0; + this.selector1 = t1; + }, + _selectorPseudoArgs_closure1: function _selectorPseudoArgs_closure1(t0, t1) { + this.isClass = t0; + this.name = t1; + }, + _selectorPseudoArgs_closure2: function _selectorPseudoArgs_closure2() { + }, + globalFunctions_closure0: function globalFunctions_closure0() { + }, + IDSelector0: function IDSelector0(t0, t1) { + this.name = t0; + this.span = t1; + }, + IDSelector_unify_closure0: function IDSelector_unify_closure0(t0) { + this.$this = t0; + }, + IfExpression0: function IfExpression0(t0, t1) { + this.$arguments = t0; + this.span = t1; + }, + IfClause$0(expression, children) { + var t1 = A.List_List$unmodifiable(children, type$.Statement_2); + return new A.IfClause0(expression, t1, B.JSArray_methods.any$1(t1, new A.IfRuleClause$__closure0())); + }, + ElseClause$0(children) { + var t1 = A.List_List$unmodifiable(children, type$.Statement_2); + return new A.ElseClause0(t1, B.JSArray_methods.any$1(t1, new A.IfRuleClause$__closure0())); + }, + IfRule0: function IfRule0(t0, t1, t2) { + this.clauses = t0; + this.lastClause = t1; + this.span = t2; + }, + IfRule_toString_closure0: function IfRule_toString_closure0() { + }, + IfRuleClause0: function IfRuleClause0() { + }, + IfRuleClause$__closure0: function IfRuleClause$__closure0() { + }, + IfRuleClause$___closure0: function IfRuleClause$___closure0() { + }, + IfClause0: function IfClause0(t0, t1, t2) { + this.expression = t0; + this.children = t1; + this.hasDeclarations = t2; + }, + ElseClause0: function ElseClause0(t0, t1) { + this.children = t0; + this.hasDeclarations = t1; + }, + jsToDartList(list) { + return self.immutable.isOrderedMap(list) ? J.toArray$0$x(type$.ImmutableList._as(list)) : type$.List_dynamic._as(list); + }, + dartMapToImmutableMap(dartMap) { + var t1, t2, + immutableMap = J.asMutable$0$x(new self.immutable.OrderedMap()); + for (t1 = A.MapExtensions_get_pairs0(dartMap, type$.Object, type$.nullable_Object), t1 = t1.get$iterator(t1); t1.moveNext$0();) { + t2 = t1.get$current(t1); + immutableMap = J.$set$2$x(immutableMap, t2._0, t2._1); + } + return J.asImmutable$0$x(immutableMap); + }, + immutableMapToDartMap(immutableMap) { + var dartMap = A.LinkedHashMap_LinkedHashMap$_empty(type$.Object, type$.nullable_Object); + J.forEach$1$ax(immutableMap, A.allowInterop(new A.immutableMapToDartMap_closure(dartMap))); + return dartMap; + }, + ImmutableList0: function ImmutableList0() { + }, + ImmutableMap0: function ImmutableMap0() { + }, + immutableMapToDartMap_closure: function immutableMapToDartMap_closure(t0) { + this.dartMap = t0; + }, + NodeImporter__addSassPath(includePaths) { + return new A._SyncStarIterable(A.NodeImporter__addSassPath$body(includePaths), type$._SyncStarIterable_String); + }, + NodeImporter__addSassPath$body($async$includePaths) { + return function() { + var includePaths = $async$includePaths; + var $async$goto = 0, $async$handler = 2, $async$currentError, sassPath, t1; + return function $async$NodeImporter__addSassPath($async$iterator, $async$errorCode, $async$result) { + if ($async$errorCode === 1) { + $async$currentError = $async$result; + $async$goto = $async$handler; + } + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$goto = 3; + return $async$iterator._yieldStar$1(includePaths); + case 3: + // after yield + sassPath = A.getEnvironmentVariable0("SASS_PATH"); + if (sassPath == null) { + // goto return + $async$goto = 1; + break; + } + t1 = A.isNodeJs() ? self.process : null; + $async$goto = 4; + return $async$iterator._yieldStar$1(A._setArrayType(sassPath.split(J.$eq$(t1 == null ? null : J.get$platform$x(t1), "win32") ? ";" : ":"), type$.JSArray_String)); + case 4: + // after yield + case 1: + // return + return 0; + case 2: + // rethrow + return $async$iterator._datum = $async$currentError, 3; + } + }; + }; + }, + NodeImporter: function NodeImporter(t0, t1, t2) { + this._implementation$_options = t0; + this._includePaths = t1; + this._implementation$_importers = t2; + }, + NodeImporter_load_closure: function NodeImporter_load_closure(t0, t1, t2, t3, t4) { + var _ = this; + _.$this = t0; + _.importer = t1; + _.forImport = t2; + _.url = t3; + _.previousString = t4; + }, + NodeImporter__tryPath_closure: function NodeImporter__tryPath_closure(t0) { + this.path = t0; + }, + NodeImporter__tryPath_closure0: function NodeImporter__tryPath_closure0() { + }, + NodeImporter__callImporterAsync_closure: function NodeImporter__callImporterAsync_closure(t0, t1, t2, t3, t4, t5) { + var _ = this; + _.$this = t0; + _.importer = t1; + _.forImport = t2; + _.url = t3; + _.previousString = t4; + _.completer = t5; + }, + ModifiableCssImport0: function ModifiableCssImport0(t0, t1, t2) { + var _ = this; + _.url = t0; + _.modifiers = t1; + _.span = t2; + _._node$_indexInParent = _._node$_parent = null; + _.isGroupEnd = false; + }, + ImportCache$0(importers, loadPaths, logger, packageConfig) { + var t1 = type$.nullable_Record_3_Importer_and_Uri_and_Uri_originalUrl_2, + t2 = type$.Uri, + t3 = A.ImportCache__toImporters0(importers, loadPaths, packageConfig); + return new A.ImportCache0(t3, logger, A.LinkedHashMap_LinkedHashMap$_empty(type$.Record_2_Uri_and_bool_forImport, t1), A.LinkedHashMap_LinkedHashMap$_empty(type$.Record_4_Uri_and_Importer_baseImporter_and_nullable_Uri_baseUrl_and_bool_forImport_2, t1), A.LinkedHashMap_LinkedHashMap$_empty(t2, type$.nullable_Stylesheet_2), A.LinkedHashMap_LinkedHashMap$_empty(t2, type$.ImporterResult_2)); + }, + ImportCache$none(logger) { + var t1 = type$.nullable_Record_3_Importer_and_Uri_and_Uri_originalUrl_2, + t2 = type$.Uri; + return new A.ImportCache0(B.List_empty23, logger, A.LinkedHashMap_LinkedHashMap$_empty(type$.Record_2_Uri_and_bool_forImport, t1), A.LinkedHashMap_LinkedHashMap$_empty(type$.Record_4_Uri_and_Importer_baseImporter_and_nullable_Uri_baseUrl_and_bool_forImport_2, t1), A.LinkedHashMap_LinkedHashMap$_empty(t2, type$.nullable_Stylesheet_2), A.LinkedHashMap_LinkedHashMap$_empty(t2, type$.ImporterResult_2)); + }, + ImportCache__toImporters0(importers, loadPaths, packageConfig) { + var t1, t2, t3, t4, _i, path, _null = null, + sassPath = A.getEnvironmentVariable0("SASS_PATH"); + if (A.isBrowser()) { + t1 = A._setArrayType([], type$.JSArray_Importer_2); + if (importers != null) + B.JSArray_methods.addAll$1(t1, importers); + return t1; + } + t1 = A._setArrayType([], type$.JSArray_Importer_2); + if (importers != null) + B.JSArray_methods.addAll$1(t1, importers); + if (loadPaths != null) + for (t2 = J.get$iterator$ax(loadPaths); t2.moveNext$0();) { + t3 = t2.get$current(t2); + t1.push(new A.FilesystemImporter0($.$get$context().absolute$15(t3, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null))); + } + if (sassPath != null) { + t2 = A.isNodeJs() ? self.process : _null; + t3 = sassPath.split(J.$eq$(t2 == null ? _null : J.get$platform$x(t2), "win32") ? ";" : ":"); + t4 = t3.length; + _i = 0; + for (; _i < t4; ++_i) { + path = t3[_i]; + t1.push(new A.FilesystemImporter0($.$get$context().absolute$15(path, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null))); + } + } + return t1; + }, + ImportCache0: function ImportCache0(t0, t1, t2, t3, t4, t5) { + var _ = this; + _._import_cache$_importers = t0; + _._import_cache$_logger = t1; + _._import_cache$_canonicalizeCache = t2; + _._import_cache$_relativeCanonicalizeCache = t3; + _._import_cache$_importCache = t4; + _._import_cache$_resultsCache = t5; + }, + ImportCache_canonicalize_closure1: function ImportCache_canonicalize_closure1(t0, t1, t2, t3, t4) { + var _ = this; + _.$this = t0; + _.baseImporter = t1; + _.baseUrl = t2; + _.url = t3; + _.forImport = t4; + }, + ImportCache_canonicalize_closure2: function ImportCache_canonicalize_closure2(t0, t1, t2, t3) { + var _ = this; + _.$this = t0; + _.url = t1; + _.baseUrl = t2; + _.forImport = t3; + }, + ImportCache__canonicalize_closure1: function ImportCache__canonicalize_closure1(t0, t1) { + this.importer = t0; + this.resolved = t1; + }, + ImportCache__canonicalize__closure0: function ImportCache__canonicalize__closure0(t0, t1) { + this.importer = t0; + this.resolved = t1; + }, + ImportCache__canonicalize_closure2: function ImportCache__canonicalize_closure2(t0, t1) { + this.importer = t0; + this.resolved = t1; + }, + ImportCache_importCanonical_closure0: function ImportCache_importCanonical_closure0(t0, t1, t2, t3, t4) { + var _ = this; + _.$this = t0; + _.importer = t1; + _.canonicalUrl = t2; + _.originalUrl = t3; + _.quiet = t4; + }, + ImportCache_humanize_closure3: function ImportCache_humanize_closure3(t0) { + this.canonicalUrl = t0; + }, + ImportCache_humanize_closure4: function ImportCache_humanize_closure4() { + }, + ImportCache_humanize_closure5: function ImportCache_humanize_closure5() { + }, + ImportCache_humanize_closure6: function ImportCache_humanize_closure6(t0) { + this.canonicalUrl = t0; + }, + ImportRule0: function ImportRule0(t0, t1) { + this.imports = t0; + this.span = t1; + }, + JSImporter: function JSImporter() { + }, + CanonicalizeContext: function CanonicalizeContext() { + }, + JSImporterResult: function JSImporterResult() { + }, + Importer0: function Importer0() { + }, + NodeImporterResult0: function NodeImporterResult0() { + }, + IncludeRule0: function IncludeRule0(t0, t1, t2, t3, t4) { + var _ = this; + _.namespace = t0; + _.name = t1; + _.$arguments = t2; + _.content = t3; + _.span = t4; + }, + InterpolatedFunctionExpression0: function InterpolatedFunctionExpression0(t0, t1, t2) { + this.name = t0; + this.$arguments = t1; + this.span = t2; + }, + Interpolation$0(contents, span) { + var t1 = new A.Interpolation0(A.List_List$unmodifiable(contents, type$.Object), span); + t1.Interpolation$20(contents, span); + return t1; + }, + Interpolation0: function Interpolation0(t0, t1) { + this.contents = t0; + this.span = t1; + }, + Interpolation_toString_closure0: function Interpolation_toString_closure0() { + }, + SupportsInterpolation0: function SupportsInterpolation0(t0, t1) { + this.expression = t0; + this.span = t1; + }, + InterpolationBuffer0: function InterpolationBuffer0(t0, t1) { + this._interpolation_buffer0$_text = t0; + this._interpolation_buffer0$_contents = t1; + }, + InterpolationMap$0(_interpolation, targetLocations) { + var t1 = A.List_List$unmodifiable(targetLocations, type$.SourceLocation), + t2 = _interpolation.contents.length, + expectedLocations = Math.max(0, t2 - 1); + if (t1.length !== expectedLocations) + A.throwExpression(A.ArgumentError$("InterpolationMap must have " + A.S(expectedLocations) + string$.x20targe + t2 + " components.", null)); + return new A.InterpolationMap0(_interpolation, t1); + }, + InterpolationMap0: function InterpolationMap0(t0, t1) { + this._interpolation_map$_interpolation = t0; + this._interpolation_map$_targetLocations = t1; + }, + InterpolationMap_mapException_closure0: function InterpolationMap_mapException_closure0() { + }, + _realCasePath0(path) { + var prefix, _null = null, + t1 = A.isNodeJs() ? self.process : _null; + if (!J.$eq$(t1 == null ? _null : J.get$platform$x(t1), "win32")) { + t1 = A.isNodeJs() ? self.process : _null; + t1 = J.$eq$(t1 == null ? _null : J.get$platform$x(t1), "darwin"); + } else + t1 = true; + if (!t1) + return path; + t1 = A.isNodeJs() ? self.process : _null; + if (J.$eq$(t1 == null ? _null : J.get$platform$x(t1), "win32")) { + prefix = B.JSString_methods.substring$2(path, 0, $.$get$context().style.rootLength$1(path)); + t1 = prefix.length; + if (t1 !== 0 && A.CharacterExtension_get_isAlphabetic0(prefix.charCodeAt(0))) + path = prefix.toUpperCase() + B.JSString_methods.substring$1(path, t1); + } + return new A._realCasePath_helper0().call$1(path); + }, + _realCasePath_helper0: function _realCasePath_helper0() { + }, + _realCasePath_helper_closure0: function _realCasePath_helper_closure0(t0, t1, t2) { + this.helper = t0; + this.dirname = t1; + this.path = t2; + }, + _realCasePath_helper__closure0: function _realCasePath_helper__closure0(t0) { + this.basename = t0; + }, + printError0(message) { + var t1 = A.isNodeJs() ? self.process : null; + if (t1 != null) { + t1 = J.get$stderr$x(t1); + J.write$1$x(t1, A.S(message) + "\n"); + } else { + t1 = self.console; + J.error$1$x(t1, message); + } + }, + readFile0(path) { + var contents, sourceFile, t1, i; + if (!A.isNodeJs()) + throw A.wrapException(A.UnsupportedError$("readFile() is only supported on Node.js")); + contents = A._asString(A._readFile0(path, "utf8")); + if (!B.JSString_methods.contains$1(contents, "\ufffd")) + return contents; + sourceFile = A.SourceFile$fromString(contents, $.$get$context().toUri$1(path)); + for (t1 = contents.length, i = 0; i < t1; ++i) { + if (contents.charCodeAt(i) !== 65533) + continue; + throw A.wrapException(A.SassException$0("Invalid UTF-8.", A.FileLocation$_(sourceFile, i).pointSpan$0(), null)); + } + return contents; + }, + _readFile0(path, encoding) { + return A._systemErrorToFileSystemException0(new A._readFile_closure0(path, encoding)); + }, + fileExists0(path) { + if (!A.isNodeJs()) + throw A.wrapException(A.UnsupportedError$(string$.fileEx)); + return A._systemErrorToFileSystemException0(new A.fileExists_closure0(path)); + }, + dirExists0(path) { + if (!A.isNodeJs()) + throw A.wrapException(A.UnsupportedError$("dirExists() is only supported on Node.js")); + return A._systemErrorToFileSystemException0(new A.dirExists_closure0(path)); + }, + listDir0(path) { + if (!A.isNodeJs()) + throw A.wrapException(A.UnsupportedError$("listDir() is only supported on Node.js")); + return A._systemErrorToFileSystemException0(new A.listDir_closure0(false, path)); + }, + getEnvironmentVariable0($name) { + var t1 = A.isNodeJs() ? self.process : null, + env = t1 == null ? null : J.get$env$x(t1); + if (env == null) + t1 = null; + else + t1 = A._asStringQ(env[$name]); + return t1; + }, + _systemErrorToFileSystemException0(callback) { + var error, t1, exception, t2; + try { + t1 = callback.call$0(); + return t1; + } catch (exception) { + error = A.unwrapException(exception); + if (!type$.JsSystemError._is(error)) + throw exception; + t1 = error; + t2 = J.getInterceptor$x(t1); + throw A.wrapException(new A.FileSystemException0(J.substring$2$s(t2.get$message(t1), (A.S(t2.get$code(t1)) + ": ").length, J.get$length$asx(t2.get$message(t1)) - (", " + A.S(t2.get$syscall(t1)) + " '" + A.S(t2.get$path(t1)) + "'").length), J.get$path$x(error))); + } + }, + hasTerminal0() { + var t1 = A.isNodeJs() ? self.process : null; + return J.$eq$(t1 == null ? null : J.get$isTTY$x(J.get$stdout$x(t1)), true); + }, + FileSystemException0: function FileSystemException0(t0, t1) { + this.message = t0; + this.path = t1; + }, + _readFile_closure0: function _readFile_closure0(t0, t1) { + this.path = t0; + this.encoding = t1; + }, + fileExists_closure0: function fileExists_closure0(t0) { + this.path = t0; + }, + dirExists_closure0: function dirExists_closure0(t0) { + this.path = t0; + }, + listDir_closure0: function listDir_closure0(t0, t1) { + this.recursive = t0; + this.path = t1; + }, + listDir__closure1: function listDir__closure1(t0) { + this.path = t0; + }, + listDir__closure2: function listDir__closure2() { + }, + listDir_closure_list0: function listDir_closure_list0() { + }, + listDir__list_closure0: function listDir__list_closure0(t0, t1) { + this.parent = t0; + this.list = t1; + }, + main() { + J.set$compile$x(self.exports, A.allowInteropNamed("sass.compile", A.compile__compile$closure())); + J.set$compileString$x(self.exports, A.allowInteropNamed("sass.compileString", A.compile__compileString$closure())); + J.set$compileAsync$x(self.exports, A.allowInteropNamed("sass.compileAsync", A.compile__compileAsync$closure())); + J.set$compileStringAsync$x(self.exports, A.allowInteropNamed("sass.compileStringAsync", A.compile__compileStringAsync$closure())); + J.set$initCompiler$x(self.exports, A.allowInteropNamed("sass.initCompiler", A.compiler__initCompiler$closure())); + J.set$initAsyncCompiler$x(self.exports, A.allowInteropNamed("sass.initAsyncCompiler", A.compiler__initAsyncCompiler$closure())); + J.set$Compiler$x(self.exports, $.$get$compilerClass()); + J.set$AsyncCompiler$x(self.exports, $.$get$asyncCompilerClass()); + J.set$Value$x(self.exports, $.$get$valueClass()); + J.set$SassBoolean$x(self.exports, $.$get$booleanClass()); + J.set$SassArgumentList$x(self.exports, $.$get$argumentListClass()); + J.set$SassCalculation$x(self.exports, $.$get$calculationClass()); + J.set$CalculationOperation$x(self.exports, $.$get$calculationOperationClass()); + J.set$CalculationInterpolation$x(self.exports, $.$get$calculationInterpolationClass()); + J.set$SassColor$x(self.exports, $.$get$colorClass()); + J.set$SassFunction$x(self.exports, $.$get$functionClass()); + J.set$SassMixin$x(self.exports, $.$get$mixinClass()); + J.set$SassList$x(self.exports, $.$get$listClass()); + J.set$SassMap$x(self.exports, $.$get$mapClass()); + J.set$SassNumber$x(self.exports, $.$get$numberClass()); + J.set$SassString$x(self.exports, $.$get$stringClass()); + J.set$sassNull$x(self.exports, B.C__SassNull0); + J.set$sassTrue$x(self.exports, B.SassBoolean_true0); + J.set$sassFalse$x(self.exports, B.SassBoolean_false0); + J.set$Exception$x(self.exports, $.$get$exceptionClass()); + J.set$Logger$x(self.exports, {silent: {warn: A.allowInteropNamed("sass.Logger.silent.warn", new A.main_closure()), debug: A.allowInteropNamed("sass.Logger.silent.debug", new A.main_closure0())}}); + J.set$NodePackageImporter$x(self.exports, $.$get$nodePackageImporterClass()); + J.set$info$x(self.exports, "dart-sass\t1.72.0\t(Sass Compiler)\t[Dart]\ndart2js\t3.3.1\t(Dart Compiler)\t[Dart]"); + A.updateSourceSpanPrototype(); + J.set$render$x(self.exports, A.allowInteropNamed("sass.render", A.legacy__render$closure())); + J.set$renderSync$x(self.exports, A.allowInteropNamed("sass.renderSync", A.legacy__renderSync$closure())); + J.set$types$x(self.exports, {Boolean: $.$get$legacyBooleanClass(), Color: $.$get$legacyColorClass(), List: $.$get$legacyListClass(), Map: $.$get$legacyMapClass(), Null: $.$get$legacyNullClass(), Number: $.$get$legacyNumberClass(), String: $.$get$legacyStringClass(), Error: self.Error}); + J.set$NULL$x(self.exports, B.C__SassNull0); + J.set$TRUE$x(self.exports, B.SassBoolean_true0); + J.set$FALSE$x(self.exports, B.SassBoolean_false0); + }, + main_closure: function main_closure() { + }, + main_closure0: function main_closure0() { + }, + JSToDartLogger: function JSToDartLogger(t0, t1, t2) { + this._node = t0; + this._fallback = t1; + this._ascii = t2; + }, + JSToDartLogger_warn_closure: function JSToDartLogger_warn_closure(t0, t1, t2, t3, t4) { + var _ = this; + _.$this = t0; + _.message = t1; + _.span = t2; + _.trace = t3; + _.deprecation = t4; + }, + JSToDartLogger_debug_closure: function JSToDartLogger_debug_closure(t0, t1, t2) { + this.$this = t0; + this.message = t1; + this.span = t2; + }, + ModifiableCssKeyframeBlock$0(selector, span) { + var t1 = A._setArrayType([], type$.JSArray_ModifiableCssNode_2); + return new A.ModifiableCssKeyframeBlock0(selector, span, new A.UnmodifiableListView(t1, type$.UnmodifiableListView_ModifiableCssNode_2), t1); + }, + ModifiableCssKeyframeBlock0: function ModifiableCssKeyframeBlock0(t0, t1, t2, t3) { + var _ = this; + _.selector = t0; + _.span = t1; + _.children = t2; + _._node$_children = t3; + _._node$_indexInParent = _._node$_parent = null; + _.isGroupEnd = false; + }, + KeyframeSelectorParser$0(contents, interpolationMap, logger) { + var t1 = A.SpanScanner$(contents, null); + return new A.KeyframeSelectorParser0(t1, logger, interpolationMap); + }, + KeyframeSelectorParser0: function KeyframeSelectorParser0(t0, t1, t2) { + this.scanner = t0; + this.logger = t1; + this._parser0$_interpolationMap = t2; + }, + KeyframeSelectorParser_parse_closure0: function KeyframeSelectorParser_parse_closure0(t0) { + this.$this = t0; + }, + LazyFileSpan0: function LazyFileSpan0(t0) { + this._lazy_file_span0$_builder = t0; + this._lazy_file_span0$_span = null; + }, + render(options, callback) { + var _0_0; + if (!A.isNodeJs()) + A.jsThrow(new self.Error("The render() method is only available in Node.js.")); + _0_0 = J.get$fiber$x(options); + if (_0_0 != null) + J.run$0$x(_0_0.call$1(A.allowInterop(new A.render_closure(callback, options)))); + else + A._renderAsync(options).then$1$2$onError(0, new A.render_closure0(callback), new A.render_closure1(callback), type$.Null); + }, + _renderAsync(options) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.RenderResult), + $async$returnValue, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16, result, start, t1, file, _0_0; + var $async$_renderAsync = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + start = new A.DateTime(Date.now(), false); + t1 = J.getInterceptor$x(options); + file = A.NullableExtension_andThen0(t1.get$file(options), A.path__absolute$closure()); + _0_0 = t1.get$data(options); + $async$goto = _0_0 != null ? 3 : 5; + break; + case 3: + // then + t2 = A._parseImporter(options, start); + t3 = A._parsePackageImportersAsync(options, start); + t4 = A._parseFunctions(options, start, true); + t5 = t1.get$indentedSyntax(options); + t5 = !J.$eq$(t5, false) && t5 != null ? B.Syntax_Sass_sass0 : null; + t6 = A._parseOutputStyle(t1.get$outputStyle(options)); + t7 = J.$eq$(t1.get$indentType(options), "tab"); + t8 = A._parseIndentWidth(t1.get$indentWidth(options)); + t9 = A._parseLineFeed(t1.get$linefeed(options)); + t10 = file == null ? "stdin" : $.$get$context().toUri$1(file).toString$0(0); + t11 = t1.get$quietDeps(options); + if (t11 == null) + t11 = false; + t12 = t1.get$verbose(options); + if (t12 == null) + t12 = false; + t13 = t1.get$charset(options); + if (t13 == null) + t13 = true; + t14 = A._enableSourceMaps(options); + t1 = t1.get$logger(options); + t15 = A.hasTerminal0(); + t16 = $._glyphs; + $async$goto = 6; + return A._asyncAwait(A.compileStringAsync0(_0_0, t13, t4, t3, null, t8, t9, new A.JSToDartLogger(t1, new A.StderrLogger0(t15), t16 === B.C_AsciiGlyphSet), t2, t11, t14, t6, t5, t10, !t7, t12), $async$_renderAsync); + case 6: + // returning from await. + result = $async$result; + // goto join + $async$goto = 4; + break; + case 5: + // else + $async$goto = file != null ? 7 : 9; + break; + case 7: + // then + t2 = A._parseImporter(options, start); + t3 = A._parsePackageImportersAsync(options, start); + t4 = A._parseFunctions(options, start, true); + t5 = t1.get$indentedSyntax(options); + t5 = !J.$eq$(t5, false) && t5 != null ? B.Syntax_Sass_sass0 : null; + t6 = A._parseOutputStyle(t1.get$outputStyle(options)); + t7 = J.$eq$(t1.get$indentType(options), "tab"); + t8 = A._parseIndentWidth(t1.get$indentWidth(options)); + t9 = A._parseLineFeed(t1.get$linefeed(options)); + t10 = t1.get$quietDeps(options); + if (t10 == null) + t10 = false; + t11 = t1.get$verbose(options); + if (t11 == null) + t11 = false; + t12 = t1.get$charset(options); + if (t12 == null) + t12 = true; + t13 = A._enableSourceMaps(options); + t1 = t1.get$logger(options); + t14 = A.hasTerminal0(); + t15 = $._glyphs; + $async$goto = 10; + return A._asyncAwait(A.compileAsync0(file, t12, null, t4, null, t3, t8, t9, new A.JSToDartLogger(t1, new A.StderrLogger0(t14), t15 === B.C_AsciiGlyphSet), t2, t10, t13, t6, t5, !t7, t11), $async$_renderAsync); + case 10: + // returning from await. + result = $async$result; + // goto join + $async$goto = 8; + break; + case 9: + // else + throw A.wrapException(A.ArgumentError$(string$.Either, null)); + case 8: + // join + case 4: + // join + $async$returnValue = A._newRenderResult(options, result, start); + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$_renderAsync, $async$completer); + }, + renderSync(options) { + var start, result, file, data, _0_0, error, stackTrace, error0, stackTrace0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16, t17, exception, _null = null; + if (!A.isNodeJs()) + A.jsThrow(new self.Error("The renderSync() method is only available in Node.js.")); + try { + start = new A.DateTime(Date.now(), false); + result = null; + t1 = J.getInterceptor$x(options); + file = A.NullableExtension_andThen0(t1.get$file(options), A.path__absolute$closure()); + data = null; + _0_0 = t1.get$data(options); + if (_0_0 != null) { + data = _0_0; + t2 = data; + t3 = A._parseImporter(options, start); + t4 = A._parsePackageImporters(options, start); + t5 = A._parseFunctions(options, start, false); + t6 = t1.get$indentedSyntax(options); + t6 = !J.$eq$(t6, false) && t6 != null ? B.Syntax_Sass_sass0 : _null; + t7 = A._parseOutputStyle(t1.get$outputStyle(options)); + t8 = J.$eq$(t1.get$indentType(options), "tab"); + t9 = A._parseIndentWidth(t1.get$indentWidth(options)); + t10 = A._parseLineFeed(t1.get$linefeed(options)); + t11 = file == null ? "stdin" : $.$get$context().toUri$1(file).toString$0(0); + t12 = t1.get$quietDeps(options); + if (t12 == null) + t12 = false; + t13 = t1.get$verbose(options); + if (t13 == null) + t13 = false; + t14 = t1.get$charset(options); + if (t14 == null) + t14 = true; + t15 = A._enableSourceMaps(options); + t1 = t1.get$logger(options); + t16 = A.hasTerminal0(); + t17 = $._glyphs; + result = A.compileString(t2, t14, _null, new A.CastList(t5, A._arrayInstanceType(t5)._eval$1("CastList<1,Callable>")), _null, t4, _null, t9, t10, new A.JSToDartLogger(t1, new A.StderrLogger0(t16), t17 === B.C_AsciiGlyphSet), t3, t12, t15, t7, t6, t11, !t8, t13); + } else if (file != null) { + t2 = A._parseImporter(options, start); + t3 = A._parsePackageImporters(options, start); + t4 = A._parseFunctions(options, start, false); + t5 = t1.get$indentedSyntax(options); + t5 = !J.$eq$(t5, false) && t5 != null ? B.Syntax_Sass_sass0 : _null; + t6 = A._parseOutputStyle(t1.get$outputStyle(options)); + t7 = J.$eq$(t1.get$indentType(options), "tab"); + t8 = A._parseIndentWidth(t1.get$indentWidth(options)); + t9 = A._parseLineFeed(t1.get$linefeed(options)); + t10 = t1.get$quietDeps(options); + if (t10 == null) + t10 = false; + t11 = t1.get$verbose(options); + if (t11 == null) + t11 = false; + t12 = t1.get$charset(options); + if (t12 == null) + t12 = true; + t13 = A._enableSourceMaps(options); + t1 = t1.get$logger(options); + t14 = A.hasTerminal0(); + t15 = $._glyphs; + result = A.compile(file, t12, _null, new A.CastList(t4, A._arrayInstanceType(t4)._eval$1("CastList<1,Callable>")), _null, t3, t8, t9, new A.JSToDartLogger(t1, new A.StderrLogger0(t14), t15 === B.C_AsciiGlyphSet), t2, t10, t13, t6, t5, !t7, t11); + } else { + t1 = A.ArgumentError$(string$.Either, _null); + throw A.wrapException(t1); + } + t1 = A._newRenderResult(options, result, start); + return t1; + } catch (exception) { + t1 = A.unwrapException(exception); + if (t1 instanceof A.SassException0) { + error = t1; + stackTrace = A.getTraceFromException(exception); + A.jsThrow(A._wrapException(error, stackTrace)); + } else { + error0 = t1; + stackTrace0 = A.getTraceFromException(exception); + t1 = J.toString$0$(error0); + t2 = A.getTrace0(error0); + A.jsThrow(A._newRenderError(t1, t2 == null ? stackTrace0 : t2, _null, _null, _null, 3)); + } + } + }, + _wrapException(exception, stackTrace) { + var t2, t3, t4, t5, + t1 = A.SourceSpanException.prototype.get$span.call(exception, 0), + _0_0 = t1.get$sourceUrl(t1); + $label0$0: { + if (_0_0 == null) { + t1 = "stdin"; + break $label0$0; + } + if ("file" === _0_0.get$scheme()) { + t1 = $.$get$context().style.pathFromUri$1(A._parseUri(_0_0)); + break $label0$0; + } + t1 = _0_0.toString$0(0); + break $label0$0; + } + t2 = B.JSString_methods.replaceFirst$2(exception.toString$0(0), "Error: ", ""); + t3 = A.getTrace0(exception); + if (t3 == null) + t3 = stackTrace; + t4 = A.SourceSpanException.prototype.get$span.call(exception, 0); + t4 = t4.get$start(t4); + t4 = t4.file.getLine$1(t4.offset); + t5 = A.SourceSpanException.prototype.get$span.call(exception, 0); + t5 = t5.get$start(t5); + return A._newRenderError(t2, t3, t5.file.getColumn$1(t5.offset) + 1, t1, t4 + 1, 1); + }, + _parseFunctions(options, start, asynch) { + var result, + functions = J.get$functions$x(options); + if (functions == null) + return B.List_empty24; + result = A._setArrayType([], type$.JSArray_AsyncCallable_2); + A.jsForEach(functions, new A._parseFunctions_closure(options, start, result, asynch)); + return result; + }, + _parseImporter(options, start) { + var t2, t3, contextOptions, _1_0, importers, _box_0 = {}, + t1 = J.getInterceptor$x(options), + _0_0 = t1.get$importer(options); + $label0$0: { + if (_0_0 == null) { + t2 = A._setArrayType([], type$.JSArray_JSFunction); + break $label0$0; + } + if (type$.List_nullable_Object._is(_0_0)) { + t2 = J.cast$1$0$ax(_0_0, type$.JSFunction); + break $label0$0; + } + t2 = A._setArrayType([type$.JSFunction._as(_0_0)], type$.JSArray_JSFunction); + break $label0$0; + } + t3 = J.getInterceptor$asx(t2); + contextOptions = t3.get$isNotEmpty(t2) ? A._contextOptions(options, start) : new A.Object(); + _box_0.fiber = null; + _1_0 = t1.get$fiber(options); + if (_1_0 != null) { + _box_0.fiber = _1_0; + t2 = t3.map$1$1(t2, new A._parseImporter_closure(_box_0), type$.JSFunction); + importers = A.List_List$of(t2, true, t2.$ti._eval$1("ListIterable.E")); + } else + importers = t2; + t1 = t1.get$includePaths(options); + if (t1 == null) + t1 = []; + t2 = type$.String; + return new A.NodeImporter(contextOptions, A.List_List$unmodifiable(A.NodeImporter__addSassPath(A.List_List$from(t1, true, t2)), t2), A.List_List$unmodifiable(J.cast$1$0$ax(importers, type$.dynamic), type$.JSFunction)); + }, + _parsePackageImportersAsync(options, start) { + var t2, t3, + t1 = J.getInterceptor$x(options); + if (t1.get$pkgImporter(options) instanceof A.NodePackageImporter0) { + t1 = t1.get$pkgImporter(options); + t1.toString; + t2 = type$.nullable_Record_3_AsyncImporter_and_Uri_and_Uri_originalUrl_2; + t3 = type$.Uri; + t1 = A.List_List$unmodifiable(A._setArrayType([t1], type$.JSArray_AsyncImporter), type$.AsyncImporter); + return new A.AsyncImportCache0(t1, B.StderrLogger_false0, A.LinkedHashMap_LinkedHashMap$_empty(type$.Record_2_Uri_and_bool_forImport, t2), A.LinkedHashMap_LinkedHashMap$_empty(type$.Record_4_Uri_and_AsyncImporter_baseImporter_and_nullable_Uri_baseUrl_and_bool_forImport_2, t2), A.LinkedHashMap_LinkedHashMap$_empty(t3, type$.nullable_Stylesheet_2), A.LinkedHashMap_LinkedHashMap$_empty(t3, type$.ImporterResult_2)); + } + return null; + }, + _parsePackageImporters(options, start) { + var t2, t3, + t1 = J.getInterceptor$x(options); + if (t1.get$pkgImporter(options) instanceof A.NodePackageImporter0) { + t1 = t1.get$pkgImporter(options); + t1.toString; + t2 = type$.nullable_Record_3_Importer_and_Uri_and_Uri_originalUrl_2; + t3 = type$.Uri; + t1 = A.List_List$unmodifiable(A._setArrayType([t1], type$.JSArray_Importer_2), type$.Importer); + return new A.ImportCache0(t1, B.StderrLogger_false0, A.LinkedHashMap_LinkedHashMap$_empty(type$.Record_2_Uri_and_bool_forImport, t2), A.LinkedHashMap_LinkedHashMap$_empty(type$.Record_4_Uri_and_Importer_baseImporter_and_nullable_Uri_baseUrl_and_bool_forImport_2, t2), A.LinkedHashMap_LinkedHashMap$_empty(t3, type$.nullable_Stylesheet_2), A.LinkedHashMap_LinkedHashMap$_empty(t3, type$.ImporterResult_2)); + } + return null; + }, + _contextOptions(options, start) { + var includePaths, t3, t4, t5, t6, t7, + t1 = J.getInterceptor$x(options), + t2 = t1.get$includePaths(options); + if (t2 == null) + t2 = []; + includePaths = A.List_List$from(t2, true, type$.String); + t2 = t1.get$file(options); + t3 = t1.get$data(options); + t4 = A._setArrayType([A.current()], type$.JSArray_String); + B.JSArray_methods.addAll$1(t4, includePaths); + t5 = A.isNodeJs() ? self.process : null; + t4 = B.JSArray_methods.join$1(t4, J.$eq$(t5 == null ? null : J.get$platform$x(t5), "win32") ? ";" : ":"); + t5 = J.$eq$(t1.get$indentType(options), "tab") ? 1 : 0; + t6 = A._parseIndentWidth(t1.get$indentWidth(options)); + if (t6 == null) + t6 = 2; + t7 = A._parseLineFeed(t1.get$linefeed(options)); + t1 = t1.get$file(options); + if (t1 == null) + t1 = "data"; + return {file: t2, data: t3, includePaths: t4, precision: 10, style: 1, indentType: t5, indentWidth: t6, linefeed: t7.text, result: {stats: {start: start._core$_value, entry: t1}}}; + }, + _parseOutputStyle(style) { + var t1; + $label0$0: { + if (style == null || "expanded" === style) { + t1 = B.OutputStyle_00; + break $label0$0; + } + if ("compressed" === style) { + t1 = B.OutputStyle_10; + break $label0$0; + } + t1 = A.jsThrow(new self.Error('Unknown output style "' + A.S(style) + '".')); + } + return t1; + }, + _parseIndentWidth(width) { + var t1; + $label0$0: { + if (width == null) { + t1 = null; + break $label0$0; + } + if (A._isInt(width)) { + t1 = width; + break $label0$0; + } + t1 = A.int_parse(J.toString$0$(width), null); + break $label0$0; + } + return t1; + }, + _parseLineFeed(str) { + var t1; + $label0$0: { + if ("cr" === str) { + t1 = B.LineFeed_oyU; + break $label0$0; + } + if ("crlf" === str) { + t1 = B.LineFeed_gg4; + break $label0$0; + } + if ("lfcr" === str) { + t1 = B.LineFeed_t2a; + break $label0$0; + } + t1 = B.LineFeed_SsD; + break $label0$0; + } + return t1; + }, + _newRenderResult(options, result, start) { + var t3, sourceMapOption, sourceMapPath, t4, sourceMapDir, outFile, _0_0, t5, sourceMapDirUrl, i, source, t6, buffer, indices, url, t7, t8, _null = null, + t1 = Date.now(), + t2 = result._compile_result$_serialize, + css = t2._0, + sourceMapBytes = type$.Null._as(self.undefined); + if (A._enableSourceMaps(options)) { + t3 = J.getInterceptor$x(options); + sourceMapOption = t3.get$sourceMap(options); + if (typeof sourceMapOption == "string") + sourceMapPath = sourceMapOption; + else { + t4 = t3.get$outFile(options); + t4.toString; + sourceMapPath = J.$add$ansx(t4, ".map"); + } + t4 = $.$get$context(); + sourceMapDir = t4.dirname$1(sourceMapPath); + t2 = t2._1; + t2.toString; + t2.sourceRoot = t3.get$sourceMapRoot(options); + outFile = t3.get$outFile(options); + if (outFile == null) { + _0_0 = t3.get$file(options); + $label0$0: { + if (_0_0 != null) { + t5 = t4.toUri$1(t4.withoutExtension$1(_0_0) + ".css").toString$0(0); + break $label0$0; + } + t5 = t2.targetUrl = "stdin.css"; + break $label0$0; + } + t2.targetUrl = t5; + } else + t2.targetUrl = t4.toUri$1(t4.relative$2$from(outFile, sourceMapDir)).toString$0(0); + sourceMapDirUrl = t4.toUri$1(sourceMapDir).toString$0(0); + for (t4 = t2.urls, i = 0; i < t4.length; ++i) { + source = t4[i]; + if (source === "stdin") + continue; + t5 = $.$get$url(); + t6 = t5.style; + if (t6.rootLength$1(source) <= 0 || t6.isRootRelative$1(source)) + continue; + t4[i] = t5.relative$2$from(source, sourceMapDirUrl); + } + t4 = t3.get$sourceMapContents(options); + sourceMapBytes = self.Buffer.from(B.C_JsonCodec.encode$2$toEncodable(t2.toJson$1$includeSourceContents(!J.$eq$(t4, false) && t4 != null), _null), "utf8"); + t2 = t3.get$omitSourceMapUrl(options); + if (!(!J.$eq$(t2, false) && t2 != null)) { + t2 = t3.get$sourceMapEmbed(options); + if (!J.$eq$(t2, false) && t2 != null) { + buffer = new A.StringBuffer(""); + indices = A._setArrayType([-1], type$.JSArray_int); + A.UriData__writeUri("application/json", _null, _null, buffer, indices); + indices.push(buffer._contents.length); + t2 = buffer._contents += ";base64,"; + indices.push(t2.length - 1); + t2 = B.C_Base64Encoder.startChunkedConversion$1(new A._StringSinkConversionSink(buffer)); + t3 = sourceMapBytes.length; + A.RangeError_checkValidRange(0, t3, t3); + t2._convert$_add$4(sourceMapBytes, 0, t3, true); + t2 = buffer._contents; + url = new A.UriData(t2.charCodeAt(0) == 0 ? t2 : t2, indices, _null).get$uri(); + } else { + if (outFile == null) + t2 = sourceMapPath; + else { + t2 = $.$get$context(); + t2 = t2.relative$2$from(sourceMapPath, t2.dirname$1(outFile)); + } + url = $.$get$context().toUri$1(t2); + } + t2 = url.toString$0(0); + css += "\n\n/*# sourceMappingURL=" + A.stringReplaceAllUnchecked(t2, "*/", "%2A/") + " */"; + } + } + t2 = self.Buffer.from(css, "utf8"); + t3 = J.get$file$x(options); + if (t3 == null) + t3 = "data"; + t4 = start._core$_value; + t1 = new A.DateTime(t1, false)._core$_value; + t5 = B.JSInt_methods._tdivFast$1(A.Duration$(t1 - t4)._duration, 1000); + t6 = A._setArrayType([], type$.JSArray_String); + for (t7 = result._evaluate._0, t7 = t7.get$iterator(t7); t7.moveNext$0();) { + t8 = t7.get$current(t7); + t6.push(t8.get$scheme() === "file" ? $.$get$context().style.pathFromUri$1(A._parseUri(t8)) : t8.toString$0(0)); + } + return {css: t2, map: sourceMapBytes, stats: {entry: t3, start: t4, end: t1, duration: t5, includedFiles: t6}}; + }, + _enableSourceMaps(options) { + var t2, + t1 = J.getInterceptor$x(options); + if (typeof t1.get$sourceMap(options) != "string") { + t2 = t1.get$sourceMap(options); + t1 = !J.$eq$(t2, false) && t2 != null && t1.get$outFile(options) != null; + } else + t1 = true; + return t1; + }, + _newRenderError(message, stackTrace, column, file, line, $status) { + var error = new self.Error(message); + error.formatted = "Error: " + message; + if (line != null) + error.line = line; + if (column != null) + error.column = column; + if (file != null) + error.file = file; + error.status = $status; + A.attachJsStack(error, stackTrace); + return error; + }, + render_closure: function render_closure(t0, t1) { + this.callback = t0; + this.options = t1; + }, + render_closure0: function render_closure0(t0) { + this.callback = t0; + }, + render_closure1: function render_closure1(t0) { + this.callback = t0; + }, + _parseFunctions_closure: function _parseFunctions_closure(t0, t1, t2, t3) { + var _ = this; + _.options = t0; + _.start = t1; + _.result = t2; + _.asynch = t3; + }, + _parseFunctions__closure: function _parseFunctions__closure(t0, t1, t2) { + this._box_0 = t0; + this.callback = t1; + this.context = t2; + }, + _parseFunctions___closure2: function _parseFunctions___closure2(t0) { + this.currentFiber = t0; + }, + _parseFunctions____closure: function _parseFunctions____closure(t0, t1) { + this.currentFiber = t0; + this.result = t1; + }, + _parseFunctions___closure3: function _parseFunctions___closure3(t0, t1, t2) { + this.callback = t0; + this.context = t1; + this.jsArguments = t2; + }, + _parseFunctions___closure4: function _parseFunctions___closure4(t0) { + this._box_0 = t0; + }, + _parseFunctions__closure0: function _parseFunctions__closure0(t0, t1) { + this.callback = t0; + this.context = t1; + }, + _parseFunctions___closure1: function _parseFunctions___closure1(t0, t1, t2) { + this.callback = t0; + this.context = t1; + this.$arguments = t2; + }, + _parseFunctions__closure1: function _parseFunctions__closure1(t0, t1) { + this.callback = t0; + this.context = t1; + }, + _parseFunctions___closure: function _parseFunctions___closure(t0) { + this.completer = t0; + }, + _parseFunctions___closure0: function _parseFunctions___closure0(t0, t1, t2) { + this.callback = t0; + this.context = t1; + this.jsArguments = t2; + }, + _parseImporter_closure: function _parseImporter_closure(t0) { + this._box_0 = t0; + }, + _parseImporter__closure: function _parseImporter__closure(t0, t1) { + this._box_0 = t0; + this.importer = t1; + }, + _parseImporter___closure: function _parseImporter___closure(t0) { + this.currentFiber = t0; + }, + _parseImporter____closure: function _parseImporter____closure(t0, t1) { + this.currentFiber = t0; + this.result = t1; + }, + _parseImporter___closure0: function _parseImporter___closure0(t0) { + this._box_0 = t0; + }, + LimitedMapView$blocklist0(_map, blocklist, $K, $V) { + var t2, key, + t1 = A.LinkedHashSet_LinkedHashSet$_empty($K); + for (t2 = J.get$iterator$ax(_map.get$keys(_map)); t2.moveNext$0();) { + key = t2.get$current(t2); + if (!blocklist.contains$1(0, key)) + t1.add$1(0, key); + } + return new A.LimitedMapView0(_map, t1, $K._eval$1("@<0>")._bind$1($V)._eval$1("LimitedMapView0<1,2>")); + }, + LimitedMapView0: function LimitedMapView0(t0, t1, t2) { + this._limited_map_view0$_map = t0; + this._limited_map_view0$_keys = t1; + this.$ti = t2; + }, + ListExpression0: function ListExpression0(t0, t1, t2, t3) { + var _ = this; + _.contents = t0; + _.separator = t1; + _.hasBrackets = t2; + _.span = t3; + }, + ListExpression_toString_closure0: function ListExpression_toString_closure0(t0) { + this.$this = t0; + }, + _function10($name, $arguments, callback) { + return A.BuiltInCallable$function0($name, $arguments, callback, "sass:list"); + }, + _length_closure2: function _length_closure2() { + }, + _nth_closure0: function _nth_closure0() { + }, + _setNth_closure0: function _setNth_closure0() { + }, + _join_closure0: function _join_closure0() { + }, + _append_closure2: function _append_closure2() { + }, + _zip_closure0: function _zip_closure0() { + }, + _zip__closure2: function _zip__closure2() { + }, + _zip__closure3: function _zip__closure3(t0) { + this._box_0 = t0; + }, + _zip__closure4: function _zip__closure4(t0) { + this._box_0 = t0; + }, + _index_closure2: function _index_closure2() { + }, + _separator_closure0: function _separator_closure0() { + }, + _isBracketed_closure0: function _isBracketed_closure0() { + }, + _slash_closure0: function _slash_closure0() { + }, + SelectorList$0(components, span) { + var t1 = A.List_List$unmodifiable(components, type$.ComplexSelector_2); + if (t1.length === 0) + A.throwExpression(A.ArgumentError$("components may not be empty.", null)); + return new A.SelectorList0(t1, span); + }, + SelectorList_SelectorList$parse0(contents, allowParent, allowPlaceholder, interpolationMap, logger) { + return A.SelectorParser$0(contents, allowParent, allowPlaceholder, interpolationMap, logger, null).parse$0(); + }, + SelectorList0: function SelectorList0(t0, t1) { + this.components = t0; + this.span = t1; + }, + SelectorList_asSassList_closure0: function SelectorList_asSassList_closure0() { + }, + SelectorList_resolveParentSelectors_closure0: function SelectorList_resolveParentSelectors_closure0(t0, t1, t2) { + this.$this = t0; + this.implicitParent = t1; + this.parent = t2; + }, + SelectorList_resolveParentSelectors__closure1: function SelectorList_resolveParentSelectors__closure1(t0) { + this.complex = t0; + }, + SelectorList_resolveParentSelectors__closure2: function SelectorList_resolveParentSelectors__closure2(t0) { + this.complex = t0; + }, + SelectorList__resolveParentSelectorsCompound_closure2: function SelectorList__resolveParentSelectorsCompound_closure2() { + }, + SelectorList__resolveParentSelectorsCompound_closure3: function SelectorList__resolveParentSelectorsCompound_closure3(t0) { + this.parent = t0; + }, + SelectorList__resolveParentSelectorsCompound_closure4: function SelectorList__resolveParentSelectorsCompound_closure4(t0, t1, t2) { + this.parentSelector = t0; + this.resolvedSimples = t1; + this.component = t2; + }, + SelectorList_withAdditionalCombinators_closure0: function SelectorList_withAdditionalCombinators_closure0(t0) { + this.combinators = t0; + }, + _ParentSelectorVisitor0: function _ParentSelectorVisitor0() { + }, + __ParentSelectorVisitor_Object_SelectorSearchVisitor0: function __ParentSelectorVisitor_Object_SelectorSearchVisitor0() { + }, + listClass_closure: function listClass_closure() { + }, + listClass__closure: function listClass__closure() { + }, + listClass__closure0: function listClass__closure0() { + }, + _ConstructorOptions: function _ConstructorOptions() { + }, + _NodeSassList: function _NodeSassList() { + }, + legacyListClass_closure: function legacyListClass_closure() { + }, + legacyListClass__closure: function legacyListClass__closure() { + }, + legacyListClass_closure0: function legacyListClass_closure0() { + }, + legacyListClass_closure1: function legacyListClass_closure1() { + }, + legacyListClass_closure2: function legacyListClass_closure2() { + }, + legacyListClass_closure3: function legacyListClass_closure3() { + }, + legacyListClass_closure4: function legacyListClass_closure4() { + }, + SassList$0(contents, _separator, brackets) { + var t1 = new A.SassList0(A.List_List$unmodifiable(contents, type$.Value_2), _separator, brackets); + t1.SassList$3$brackets0(contents, _separator, brackets); + return t1; + }, + SassList0: function SassList0(t0, t1, t2) { + this._list1$_contents = t0; + this._list1$_separator = t1; + this._list1$_hasBrackets = t2; + }, + SassList_isBlank_closure0: function SassList_isBlank_closure0() { + }, + ListSeparator0: function ListSeparator0(t0, t1, t2) { + this._list1$_name = t0; + this.separator = t1; + this._name = t2; + }, + JSLogger: function JSLogger() { + }, + WarnOptions: function WarnOptions() { + }, + DebugOptions: function DebugOptions() { + }, + WarnForDeprecation_warnForDeprecation0(_this, deprecation, message, span, trace) { + if (_this instanceof A.DeprecationHandlingLogger0) + _this.warnForDeprecation$4$span$trace(deprecation, message, span, trace); + else if (!deprecation.isFuture) + _this.warn$4$deprecation$span$trace(0, message, true, span, trace); + }, + _QuietLogger0: function _QuietLogger0() { + }, + LoudComment0: function LoudComment0(t0) { + this.text = t0; + }, + MapExpression0: function MapExpression0(t0, t1) { + this.pairs = t0; + this.span = t1; + }, + _modify0(map, keys, modify, addNesting) { + var keyIterator = J.get$iterator$ax(keys); + return keyIterator.moveNext$0() ? new A._modify_modifyNestedMap0(keyIterator, modify, addNesting).call$1(map) : modify.call$1(map); + }, + _deepMergeImpl0(map1, map2) { + var t2, t3, result, t4, key, value, _1_1, _1_3, resultMap, _1_30, _1_3_isSet, valueMap, merged, _null = null, + t1 = map1._map0$_contents; + if (t1.get$isEmpty(t1)) + return map2; + t2 = map2._map0$_contents; + if (t2.get$isEmpty(t2)) + return map1; + t3 = type$.Value_2; + result = A.LinkedHashMap_LinkedHashMap$of(t1, t3, t3); + for (t1 = A.MapExtensions_get_pairs0(t2, t3, t3), t1 = t1.get$iterator(t1), t2 = type$.SassMap_2; t1.moveNext$0();) { + t4 = t1.get$current(t1); + key = t4._0; + value = t4._1; + t4 = result.$index(0, key); + _1_1 = t4 == null ? _null : t4.tryMap$0(); + _1_3 = value.tryMap$0(); + if (_1_1 != null) { + resultMap = _1_1 == null ? t2._as(_1_1) : _1_1; + t4 = _1_3 != null; + _1_30 = _1_3; + _1_3_isSet = true; + } else { + _1_30 = _null; + resultMap = _1_30; + _1_3_isSet = false; + t4 = false; + } + if (t4) { + valueMap = _1_3_isSet ? _1_30 : _1_3; + merged = A._deepMergeImpl0(resultMap, valueMap == null ? t2._as(valueMap) : valueMap); + if (merged === resultMap) + continue; + result.$indexSet(0, key, merged); + } else + result.$indexSet(0, key, value); + } + return new A.SassMap0(A.ConstantMap_ConstantMap$from(result, t3, t3)); + }, + _function9($name, $arguments, callback) { + return A.BuiltInCallable$function0($name, $arguments, callback, "sass:map"); + }, + _get_closure0: function _get_closure0() { + }, + _set_closure1: function _set_closure1() { + }, + _set__closure2: function _set__closure2(t0) { + this.$arguments = t0; + }, + _set_closure2: function _set_closure2() { + }, + _set__closure1: function _set__closure1(t0) { + this._box_0 = t0; + }, + _merge_closure1: function _merge_closure1() { + }, + _merge_closure2: function _merge_closure2() { + }, + _merge__closure0: function _merge__closure0(t0) { + this.map2 = t0; + }, + _deepMerge_closure0: function _deepMerge_closure0() { + }, + _deepRemove_closure0: function _deepRemove_closure0() { + }, + _deepRemove__closure0: function _deepRemove__closure0(t0) { + this.keys = t0; + }, + _remove_closure1: function _remove_closure1() { + }, + _remove_closure2: function _remove_closure2() { + }, + _keys_closure0: function _keys_closure0() { + }, + _values_closure0: function _values_closure0() { + }, + _hasKey_closure0: function _hasKey_closure0() { + }, + _modify_modifyNestedMap0: function _modify_modifyNestedMap0(t0, t1, t2) { + this.keyIterator = t0; + this.modify = t1; + this.addNesting = t2; + }, + MapExtensions_get_pairs0(_this, $K, $V) { + return _this.get$entries(_this).map$1$1(0, new A.MapExtensions_get_pairs_closure0($K, $V), $K._eval$1("@<0>")._bind$1($V)._eval$1("+(1,2)")); + }, + MapExtensions_get_pairs_closure0: function MapExtensions_get_pairs_closure0(t0, t1) { + this.K = t0; + this.V = t1; + }, + mapClass_closure: function mapClass_closure() { + }, + mapClass__closure: function mapClass__closure() { + }, + mapClass__closure0: function mapClass__closure0() { + }, + mapClass__closure1: function mapClass__closure1() { + }, + _NodeSassMap: function _NodeSassMap() { + }, + legacyMapClass_closure: function legacyMapClass_closure() { + }, + legacyMapClass__closure: function legacyMapClass__closure() { + }, + legacyMapClass__closure0: function legacyMapClass__closure0() { + }, + legacyMapClass_closure0: function legacyMapClass_closure0() { + }, + legacyMapClass_closure1: function legacyMapClass_closure1() { + }, + legacyMapClass_closure2: function legacyMapClass_closure2() { + }, + legacyMapClass_closure3: function legacyMapClass_closure3() { + }, + legacyMapClass_closure4: function legacyMapClass_closure4() { + }, + SassMap0: function SassMap0(t0) { + this._map0$_contents = t0; + }, + _singleArgumentMathFunc0($name, mathFunc) { + return A.BuiltInCallable$function0($name, "$number", new A._singleArgumentMathFunc_closure0(mathFunc), "sass:math"); + }, + _numberFunction0($name, transform) { + return A.BuiltInCallable$function0($name, "$number", new A._numberFunction_closure0(transform), "sass:math"); + }, + _function8($name, $arguments, callback) { + return A.BuiltInCallable$function0($name, $arguments, callback, "sass:math"); + }, + global_closure31: function global_closure31() { + }, + module_closure11: function module_closure11() { + }, + _ceil_closure0: function _ceil_closure0() { + }, + _clamp_closure0: function _clamp_closure0() { + }, + _floor_closure0: function _floor_closure0() { + }, + _max_closure0: function _max_closure0() { + }, + _min_closure0: function _min_closure0() { + }, + _round_closure0: function _round_closure0() { + }, + _hypot_closure0: function _hypot_closure0() { + }, + _hypot__closure0: function _hypot__closure0() { + }, + _log_closure0: function _log_closure0() { + }, + _pow_closure0: function _pow_closure0() { + }, + _atan2_closure0: function _atan2_closure0() { + }, + _compatible_closure0: function _compatible_closure0() { + }, + _isUnitless_closure0: function _isUnitless_closure0() { + }, + _unit_closure0: function _unit_closure0() { + }, + _percentage_closure0: function _percentage_closure0() { + }, + _randomFunction_closure0: function _randomFunction_closure0() { + }, + _div_closure0: function _div_closure0() { + }, + _singleArgumentMathFunc_closure0: function _singleArgumentMathFunc_closure0(t0) { + this.mathFunc = t0; + }, + _numberFunction_closure0: function _numberFunction_closure0(t0) { + this.transform = t0; + }, + CssMediaQuery_parseList0(contents, interpolationMap, logger) { + var t1 = A.SpanScanner$(contents, null); + return new A.MediaQueryParser0(t1, logger, interpolationMap).parse$0(); + }, + CssMediaQuery$type0(type, conditions, modifier) { + return new A.CssMediaQuery0(modifier, type, true, conditions == null ? B.List_empty : A.List_List$unmodifiable(conditions, type$.String)); + }, + CssMediaQuery$condition0(conditions, conjunction) { + var t1 = A.List_List$unmodifiable(conditions, type$.String); + if (t1.length > 1 && conjunction == null) + A.throwExpression(A.ArgumentError$(string$.If_con, null)); + return new A.CssMediaQuery0(null, null, conjunction !== false, t1); + }, + CssMediaQuery0: function CssMediaQuery0(t0, t1, t2, t3) { + var _ = this; + _.modifier = t0; + _.type = t1; + _.conjunction = t2; + _.conditions = t3; + }, + _SingletonCssMediaQueryMergeResult0: function _SingletonCssMediaQueryMergeResult0(t0) { + this._name = t0; + }, + MediaQuerySuccessfulMergeResult0: function MediaQuerySuccessfulMergeResult0(t0) { + this.query = t0; + }, + MediaQueryParser0: function MediaQueryParser0(t0, t1, t2) { + this.scanner = t0; + this.logger = t1; + this._parser0$_interpolationMap = t2; + }, + MediaQueryParser_parse_closure0: function MediaQueryParser_parse_closure0(t0) { + this.$this = t0; + }, + ModifiableCssMediaRule$0(queries, span) { + var t1 = A.List_List$unmodifiable(queries, type$.CssMediaQuery_2), + t2 = A._setArrayType([], type$.JSArray_ModifiableCssNode_2); + if (J.get$isEmpty$asx(queries)) + A.throwExpression(A.ArgumentError$value(queries, "queries", "may not be empty.")); + return new A.ModifiableCssMediaRule0(t1, span, new A.UnmodifiableListView(t2, type$.UnmodifiableListView_ModifiableCssNode_2), t2); + }, + ModifiableCssMediaRule0: function ModifiableCssMediaRule0(t0, t1, t2, t3) { + var _ = this; + _.queries = t0; + _.span = t1; + _.children = t2; + _._node$_children = t3; + _._node$_indexInParent = _._node$_parent = null; + _.isGroupEnd = false; + }, + MediaRule$0(query, children, span) { + var t1 = A.List_List$unmodifiable(children, type$.Statement_2), + t2 = B.JSArray_methods.any$1(t1, new A.ParentStatement_closure0()); + return new A.MediaRule0(query, span, t1, t2); + }, + MediaRule0: function MediaRule0(t0, t1, t2, t3) { + var _ = this; + _.query = t0; + _.span = t1; + _.children = t2; + _.hasDeclarations = t3; + }, + MergedExtension_merge0(left, right) { + var t2, t3, t4, + t1 = left.extender.selector; + if (!t1.$eq(0, right.extender.selector) || !left.target.$eq(0, right.target)) + throw A.wrapException(A.ArgumentError$(left.toString$0(0) + " and " + right.toString$0(0) + " aren't the same extension.", null)); + t2 = left.mediaContext; + t3 = t2 == null; + if (!t3) { + t4 = right.mediaContext; + t4 = t4 != null && !B.C_ListEquality.equals$2(0, t2, t4); + } else + t4 = false; + if (t4) + throw A.wrapException(A.SassException$0("From " + left.span.message$1(0, "") + string$.x0aYou_m, right.span, null)); + if (right.isOptional && right.mediaContext == null) + return left; + if (left.isOptional && t3) + return right; + if (t3) + t2 = right.mediaContext; + t1.get$specificity(); + t1 = new A.Extender0(t1, false); + return t1._extension$_extension = new A.MergedExtension0(left, right, t1, left.target, t2, true, left.span); + }, + MergedExtension0: function MergedExtension0(t0, t1, t2, t3, t4, t5, t6) { + var _ = this; + _.left = t0; + _.right = t1; + _.extender = t2; + _.target = t3; + _.mediaContext = t4; + _.isOptional = t5; + _.span = t6; + }, + MergedMapView$0(maps, $K, $V) { + var t1 = $K._eval$1("@<0>")._bind$1($V); + t1 = new A.MergedMapView0(A.LinkedHashMap_LinkedHashMap$_empty($K, t1._eval$1("Map<1,2>")), t1._eval$1("MergedMapView0<1,2>")); + t1.MergedMapView$10(maps, $K, $V); + return t1; + }, + MergedMapView0: function MergedMapView0(t0, t1) { + this._merged_map_view$_mapsByKey = t0; + this.$ti = t1; + }, + _function12($name, $arguments, callback) { + return A.BuiltInCallable$function0($name, $arguments, callback, "sass:meta"); + }, + global_closure59: function global_closure59() { + }, + global_closure60: function global_closure60() { + }, + global_closure61: function global_closure61() { + }, + global_closure62: function global_closure62() { + }, + local_closure2: function local_closure2() { + }, + local_closure3: function local_closure3() { + }, + local__closure0: function local__closure0() { + }, + local_closure4: function local_closure4() { + }, + mixinClass_closure: function mixinClass_closure() { + }, + mixinClass__closure: function mixinClass__closure() { + }, + mixinClass__closure0: function mixinClass__closure0() { + }, + SassMixin0: function SassMixin0(t0) { + this.callable = t0; + }, + MixinRule$0($name, $arguments, children, span, comment) { + var t1 = A.List_List$unmodifiable(children, type$.Statement_2), + t2 = B.JSArray_methods.any$1(t1, new A.ParentStatement_closure0()); + return new A.MixinRule0($name, $arguments, span, t1, t2); + }, + MixinRule0: function MixinRule0(t0, t1, t2, t3, t4) { + var _ = this; + _._mixin_rule$__MixinRule_hasContent_FI = $; + _.name = t0; + _.$arguments = t1; + _.span = t2; + _.children = t3; + _.hasDeclarations = t4; + }, + _HasContentVisitor0: function _HasContentVisitor0() { + }, + __HasContentVisitor_Object_StatementSearchVisitor0: function __HasContentVisitor_Object_StatementSearchVisitor0() { + }, + ExtendMode0: function ExtendMode0(t0, t1) { + this.name = t0; + this._name = t1; + }, + JSModule0: function JSModule0() { + }, + JSModuleRequire0: function JSModuleRequire0() { + }, + MultiSpan0: function MultiSpan0(t0, t1, t2) { + this._multi_span0$_primary = t0; + this.primaryLabel = t1; + this.secondarySpans = t2; + }, + SupportsNegation0: function SupportsNegation0(t0, t1) { + this.condition = t0; + this.span = t1; + }, + NoOpImporter0: function NoOpImporter0() { + }, + NoSourceMapBuffer0: function NoSourceMapBuffer0(t0) { + this._no_source_map_buffer0$_buffer = t0; + }, + _FakeAstNode0: function _FakeAstNode0(t0) { + this._node0$_callback = t0; + }, + CssNode0: function CssNode0() { + }, + CssParentNode0: function CssParentNode0() { + }, + _IsInvisibleVisitor1: function _IsInvisibleVisitor1(t0, t1) { + this.includeBogus = t0; + this.includeComments = t1; + }, + __IsInvisibleVisitor_Object_EveryCssVisitor0: function __IsInvisibleVisitor_Object_EveryCssVisitor0() { + }, + ModifiableCssNode0: function ModifiableCssNode0() { + }, + ModifiableCssNode_hasFollowingSibling_closure0: function ModifiableCssNode_hasFollowingSibling_closure0() { + }, + ModifiableCssParentNode0: function ModifiableCssParentNode0() { + }, + NodePackageImporter0: function NodePackageImporter0() { + this._node_package$__NodePackageImporter__entryPointDirectory_F = $; + }, + NodePackageImporter__nodePackageExportsResolve_closure3: function NodePackageImporter__nodePackageExportsResolve_closure3() { + }, + NodePackageImporter__nodePackageExportsResolve_closure4: function NodePackageImporter__nodePackageExportsResolve_closure4() { + }, + NodePackageImporter__nodePackageExportsResolve_closure5: function NodePackageImporter__nodePackageExportsResolve_closure5() { + }, + NodePackageImporter__nodePackageExportsResolve_closure6: function NodePackageImporter__nodePackageExportsResolve_closure6(t0, t1, t2) { + this.$this = t0; + this.exports = t1; + this.packageRoot = t2; + }, + NodePackageImporter__nodePackageExportsResolve__closure1: function NodePackageImporter__nodePackageExportsResolve__closure1(t0, t1, t2) { + this.$this = t0; + this.variant = t1; + this.packageRoot = t2; + }, + NodePackageImporter__nodePackageExportsResolve__closure2: function NodePackageImporter__nodePackageExportsResolve__closure2() { + }, + NodePackageImporter__getMainExport_closure0: function NodePackageImporter__getMainExport_closure0() { + }, + NullExpression0: function NullExpression0(t0) { + this.span = t0; + }, + legacyNullClass_closure: function legacyNullClass_closure() { + }, + legacyNullClass__closure: function legacyNullClass__closure() { + }, + _SassNull0: function _SassNull0() { + }, + NumberExpression0: function NumberExpression0(t0, t1, t2) { + this.value = t0; + this.unit = t1; + this.span = t2; + }, + numberClass_closure: function numberClass_closure() { + }, + numberClass__closure: function numberClass__closure() { + }, + numberClass__closure0: function numberClass__closure0() { + }, + numberClass__closure1: function numberClass__closure1() { + }, + numberClass__closure2: function numberClass__closure2() { + }, + numberClass__closure3: function numberClass__closure3() { + }, + numberClass__closure4: function numberClass__closure4() { + }, + numberClass__closure5: function numberClass__closure5() { + }, + numberClass__closure6: function numberClass__closure6() { + }, + numberClass__closure7: function numberClass__closure7() { + }, + numberClass__closure8: function numberClass__closure8() { + }, + numberClass__closure9: function numberClass__closure9() { + }, + numberClass__closure10: function numberClass__closure10() { + }, + numberClass__closure11: function numberClass__closure11() { + }, + numberClass__closure12: function numberClass__closure12() { + }, + numberClass__closure13: function numberClass__closure13() { + }, + numberClass__closure14: function numberClass__closure14() { + }, + numberClass__closure15: function numberClass__closure15() { + }, + numberClass__closure16: function numberClass__closure16() { + }, + numberClass__closure17: function numberClass__closure17() { + }, + numberClass__closure18: function numberClass__closure18() { + }, + numberClass__closure19: function numberClass__closure19() { + }, + _ConstructorOptions0: function _ConstructorOptions0() { + }, + _parseNumber(value, unit) { + var invalidUnit, operands, t1, numerator, denominator, numeratorUnits, denominatorUnits; + if (unit == null || unit.length === 0) + return A.SassNumber_SassNumber0(value, null); + if (!J.contains$1$asx(unit, "*") && !B.JSString_methods.contains$1(unit, "/")) + return A.SassNumber_SassNumber0(value, unit); + invalidUnit = new A.ArgumentError(true, unit, "unit", "is invalid."); + operands = unit.split("/"); + t1 = operands.length; + if (t1 > 2) + throw A.wrapException(invalidUnit); + numerator = operands[0]; + denominator = t1 === 1 ? null : operands[1]; + t1 = type$.JSArray_String; + numeratorUnits = numerator.length === 0 ? A._setArrayType([], t1) : A._setArrayType(numerator.split("*"), t1); + if (B.JSArray_methods.any$1(numeratorUnits, new A._parseNumber_closure())) + throw A.wrapException(invalidUnit); + denominatorUnits = denominator == null ? A._setArrayType([], t1) : A._setArrayType(denominator.split("*"), t1); + if (B.JSArray_methods.any$1(denominatorUnits, new A._parseNumber_closure0())) + throw A.wrapException(invalidUnit); + return A.SassNumber_SassNumber$withUnits0(value, denominatorUnits, numeratorUnits); + }, + _NodeSassNumber: function _NodeSassNumber() { + }, + legacyNumberClass_closure: function legacyNumberClass_closure() { + }, + legacyNumberClass_closure0: function legacyNumberClass_closure0() { + }, + legacyNumberClass_closure1: function legacyNumberClass_closure1() { + }, + legacyNumberClass_closure2: function legacyNumberClass_closure2() { + }, + legacyNumberClass_closure3: function legacyNumberClass_closure3() { + }, + _parseNumber_closure: function _parseNumber_closure() { + }, + _parseNumber_closure0: function _parseNumber_closure0() { + }, + conversionFactor0(unit1, unit2) { + var _0_0; + if (unit1 === unit2) + return 1; + _0_0 = B.Map_nfuzN.$index(0, unit1); + if (_0_0 != null) + return _0_0.$index(0, unit2); + return null; + }, + SassNumber_SassNumber0(value, unit) { + return unit == null ? new A.UnitlessSassNumber0(value, null) : new A.SingleUnitSassNumber0(unit, value, null); + }, + SassNumber_SassNumber$withUnits0(value, denominatorUnits, numeratorUnits) { + var _0_4, _0_1, _0_1_isSet, _0_6, _0_6_isSet, _0_4_isSet, _0_8, _0_10, _0_7, _0_7_isSet, _0_10_isSet, _0_8_isSet, t2, unit, numerators, denominators, unsimplifiedDenominators, valueDouble, _i, denominator, simplifiedAway, i, factor, _1_2, _1_7, _1_7_isSet, _null = null, + _0_3 = numeratorUnits == null, + t1 = _0_3; + if (!t1) { + _0_4 = J.get$length$asx(numeratorUnits == null ? type$.List_String._as(numeratorUnits) : numeratorUnits); + t1 = _0_4; + _0_1 = numeratorUnits; + _0_1_isSet = true; + _0_6 = t1 <= 0; + t1 = _0_6; + _0_6_isSet = true; + _0_4_isSet = true; + } else { + _0_4 = _null; + _0_6 = _0_4; + _0_1 = numeratorUnits; + _0_1_isSet = true; + _0_6_isSet = false; + _0_4_isSet = false; + t1 = true; + } + if (t1) { + _0_8 = denominatorUnits == null; + t1 = _0_8; + if (!t1) { + _0_10 = J.get$length$asx(denominatorUnits == null ? type$.List_String._as(denominatorUnits) : denominatorUnits) <= 0; + t1 = _0_10; + _0_7 = denominatorUnits; + _0_7_isSet = true; + _0_10_isSet = true; + } else { + _0_10 = _null; + _0_7 = denominatorUnits; + _0_7_isSet = true; + _0_10_isSet = false; + t1 = true; + } + _0_8_isSet = true; + } else { + _0_10 = _null; + _0_7 = _0_10; + _0_8 = _0_7; + _0_8_isSet = false; + _0_7_isSet = false; + _0_10_isSet = false; + t1 = false; + } + if (t1) + return new A.UnitlessSassNumber0(value, _null); + if (_0_1_isSet) + t1 = _0_1; + else { + t1 = numeratorUnits; + _0_1 = t1; + _0_1_isSet = true; + } + t2 = type$.List_String; + if (t2._is(t1)) { + if (_0_4_isSet) + t1 = _0_4; + else { + if (_0_1_isSet) + t1 = _0_1; + else { + t1 = numeratorUnits; + _0_1 = t1; + _0_1_isSet = true; + } + _0_4 = J.get$length$asx(t1 == null ? t2._as(t1) : t1); + t1 = _0_4; + _0_4_isSet = true; + } + if (t1 === 1) { + if (_0_1_isSet) + t1 = _0_1; + else { + t1 = numeratorUnits; + _0_1 = t1; + _0_1_isSet = true; + } + unit = J.$index$asx(t1 == null ? t2._as(t1) : t1, 0); + if (_0_8_isSet) + t1 = _0_8; + else { + if (_0_7_isSet) + t1 = _0_7; + else { + t1 = denominatorUnits; + _0_7 = t1; + _0_7_isSet = true; + } + _0_8 = t1 == null; + t1 = _0_8; + _0_8_isSet = true; + } + if (!t1) + if (_0_10_isSet) + t1 = _0_10; + else { + if (_0_7_isSet) + t1 = _0_7; + else { + t1 = denominatorUnits; + _0_7 = t1; + _0_7_isSet = true; + } + _0_10 = J.get$length$asx(t1 == null ? t2._as(t1) : t1) <= 0; + t1 = _0_10; + _0_10_isSet = true; + } + else + t1 = true; + } else { + unit = _null; + t1 = false; + } + } else { + unit = _null; + t1 = false; + } + if (t1) + return new A.SingleUnitSassNumber0(unit, value, _null); + if (_0_1_isSet) + t1 = _0_1; + else { + t1 = numeratorUnits; + _0_1 = t1; + _0_1_isSet = true; + } + if (t1 != null) { + if (_0_1_isSet) + numerators = _0_1; + else { + numerators = numeratorUnits; + _0_1 = numerators; + _0_1_isSet = true; + } + if (numerators == null) + numerators = t2._as(numerators); + if (_0_8_isSet) + t1 = _0_8; + else { + if (_0_7_isSet) + t1 = _0_7; + else { + t1 = denominatorUnits; + _0_7 = t1; + _0_7_isSet = true; + } + _0_8 = t1 == null; + t1 = _0_8; + } + if (!t1) + if (_0_10_isSet) + t1 = _0_10; + else { + if (_0_7_isSet) + t1 = _0_7; + else { + t1 = denominatorUnits; + _0_7 = t1; + _0_7_isSet = true; + } + _0_10 = J.get$length$asx(t1 == null ? t2._as(t1) : t1) <= 0; + t1 = _0_10; + } + else + t1 = true; + } else { + numerators = _null; + t1 = false; + } + if (t1) + return new A.ComplexSassNumber0(A.List_List$unmodifiable(numerators, type$.String), B.List_empty, value, _null); + if (!_0_3) + if (_0_6_isSet) + t1 = _0_6; + else { + if (_0_4_isSet) + t1 = _0_4; + else { + t1 = _0_1_isSet ? _0_1 : numeratorUnits; + _0_4 = J.get$length$asx(t1 == null ? t2._as(t1) : t1); + t1 = _0_4; + } + _0_6 = t1 <= 0; + t1 = _0_6; + } + else + t1 = true; + if (t1) { + if (_0_7_isSet) + t1 = _0_7; + else { + t1 = denominatorUnits; + _0_7 = t1; + _0_7_isSet = true; + } + if (t1 != null) { + denominators = _0_7_isSet ? _0_7 : denominatorUnits; + if (denominators == null) + denominators = t2._as(denominators); + t1 = true; + } else { + denominators = _null; + t1 = false; + } + } else { + denominators = _null; + t1 = false; + } + if (t1) + return new A.ComplexSassNumber0(B.List_empty, A.List_List$unmodifiable(denominators, type$.String), value, _null); + numeratorUnits.toString; + numerators = J.toList$0$ax(numeratorUnits); + denominatorUnits.toString; + unsimplifiedDenominators = J.toList$0$ax(denominatorUnits); + denominators = A._setArrayType([], type$.JSArray_String); + for (t1 = unsimplifiedDenominators.length, valueDouble = value, _i = 0; _i < unsimplifiedDenominators.length; unsimplifiedDenominators.length === t1 || (0, A.throwConcurrentModificationError)(unsimplifiedDenominators), ++_i) { + denominator = unsimplifiedDenominators[_i]; + i = 0; + while (true) { + if (!(i < numerators.length)) { + simplifiedAway = false; + break; + } + c$0: { + factor = A.conversionFactor0(denominator, numerators[i]); + if (factor == null) + break c$0; + valueDouble *= factor; + B.JSArray_methods.removeAt$1(numerators, i); + simplifiedAway = true; + break; + } + ++i; + } + if (!simplifiedAway) + denominators.push(denominator); + } + $label0$1: { + _1_2 = numerators.length; + t1 = _1_2; + if (t1 <= 0) { + _1_7 = denominators.length <= 0; + t1 = _1_7; + _1_7_isSet = true; + } else { + _1_7 = _null; + _1_7_isSet = false; + t1 = false; + } + if (t1) { + t1 = new A.UnitlessSassNumber0(valueDouble, _null); + break $label0$1; + } + if (_1_2 === 1) { + unit = numerators[0]; + t1 = _1_7_isSet ? _1_7 : denominators.length <= 0; + } else { + unit = _null; + t1 = false; + } + if (t1) { + t1 = new A.SingleUnitSassNumber0(unit, valueDouble, _null); + break $label0$1; + } + t1 = type$.String; + t1 = new A.ComplexSassNumber0(A.List_List$unmodifiable(numerators, t1), A.List_List$unmodifiable(denominators, t1), valueDouble, _null); + break $label0$1; + } + return t1; + }, + SassNumber0: function SassNumber0() { + }, + SassNumber__coerceOrConvertValue_compatibilityException0: function SassNumber__coerceOrConvertValue_compatibilityException0(t0, t1, t2, t3, t4, t5, t6) { + var _ = this; + _.$this = t0; + _.other = t1; + _.otherName = t2; + _.otherHasUnits = t3; + _.name = t4; + _.newNumerators = t5; + _.newDenominators = t6; + }, + SassNumber__coerceOrConvertValue_closure3: function SassNumber__coerceOrConvertValue_closure3(t0, t1) { + this._box_0 = t0; + this.newNumerator = t1; + }, + SassNumber__coerceOrConvertValue_closure4: function SassNumber__coerceOrConvertValue_closure4(t0) { + this.compatibilityException = t0; + }, + SassNumber__coerceOrConvertValue_closure5: function SassNumber__coerceOrConvertValue_closure5(t0, t1) { + this._box_0 = t0; + this.newDenominator = t1; + }, + SassNumber__coerceOrConvertValue_closure6: function SassNumber__coerceOrConvertValue_closure6(t0) { + this.compatibilityException = t0; + }, + SassNumber_plus_closure0: function SassNumber_plus_closure0() { + }, + SassNumber_minus_closure0: function SassNumber_minus_closure0() { + }, + SassNumber_multiplyUnits_closure3: function SassNumber_multiplyUnits_closure3(t0, t1) { + this._box_0 = t0; + this.numerator = t1; + }, + SassNumber_multiplyUnits_closure4: function SassNumber_multiplyUnits_closure4(t0, t1) { + this.newNumerators = t0; + this.numerator = t1; + }, + SassNumber_multiplyUnits_closure5: function SassNumber_multiplyUnits_closure5(t0, t1) { + this._box_0 = t0; + this.numerator = t1; + }, + SassNumber_multiplyUnits_closure6: function SassNumber_multiplyUnits_closure6(t0, t1) { + this.newNumerators = t0; + this.numerator = t1; + }, + SassNumber__areAnyConvertible_closure0: function SassNumber__areAnyConvertible_closure0(t0) { + this.units2 = t0; + }, + SassNumber__canonicalizeUnitList_closure0: function SassNumber__canonicalizeUnitList_closure0() { + }, + SassNumber__canonicalMultiplier_closure0: function SassNumber__canonicalMultiplier_closure0(t0) { + this.$this = t0; + }, + SassNumber_unitSuggestion_closure1: function SassNumber_unitSuggestion_closure1() { + }, + SassNumber_unitSuggestion_closure2: function SassNumber_unitSuggestion_closure2() { + }, + SupportsOperation$0(left, right, operator, span) { + var lowerOperator = operator.toLowerCase(); + if (lowerOperator !== "and" && lowerOperator !== "or") + A.throwExpression(A.ArgumentError$value(operator, "operator", 'may only be "and" or "or".')); + return new A.SupportsOperation0(left, right, operator, span); + }, + SupportsOperation0: function SupportsOperation0(t0, t1, t2, t3) { + var _ = this; + _.left = t0; + _.right = t1; + _.operator = t2; + _.span = t3; + }, + ParentSelector0: function ParentSelector0(t0, t1) { + this.suffix = t0; + this.span = t1; + }, + ParentStatement0: function ParentStatement0() { + }, + ParentStatement_closure0: function ParentStatement_closure0() { + }, + ParentStatement__closure0: function ParentStatement__closure0() { + }, + ParenthesizedExpression0: function ParenthesizedExpression0(t0, t1) { + this.expression = t0; + this.span = t1; + }, + Parser_isIdentifier0(text) { + var t1, t2, exception, logger = null; + try { + t1 = logger; + t2 = A.SpanScanner$(text, null); + new A.Parser1(t2, t1 == null ? B.StderrLogger_false0 : t1, null)._parser0$_parseIdentifier$0(); + return true; + } catch (exception) { + if (type$.SassFormatException_2._is(A.unwrapException(exception))) + return false; + else + throw exception; + } + }, + Parser1: function Parser1(t0, t1, t2) { + this.scanner = t0; + this.logger = t1; + this._parser0$_interpolationMap = t2; + }, + Parser__parseIdentifier_closure0: function Parser__parseIdentifier_closure0(t0) { + this.$this = t0; + }, + Parser_escape_closure0: function Parser_escape_closure0() { + }, + Parser_scanIdentChar_matches0: function Parser_scanIdentChar_matches0(t0, t1) { + this.caseSensitive = t0; + this.char = t1; + }, + Parser_spanFrom_closure0: function Parser_spanFrom_closure0(t0, t1) { + this.$this = t0; + this.span = t1; + }, + PlaceholderSelector0: function PlaceholderSelector0(t0, t1) { + this.name = t0; + this.span = t1; + }, + PlainCssCallable0: function PlainCssCallable0(t0) { + this.name = t0; + }, + PrefixedMapView0: function PrefixedMapView0(t0, t1, t2) { + this._prefixed_map_view0$_map = t0; + this._prefixed_map_view0$_prefix = t1; + this.$ti = t2; + }, + _PrefixedKeys0: function _PrefixedKeys0(t0) { + this._prefixed_map_view0$_view = t0; + }, + _PrefixedKeys_iterator_closure0: function _PrefixedKeys_iterator_closure0(t0) { + this.$this = t0; + }, + PseudoSelector$0($name, span, argument, element, selector) { + var t1 = !element, + t2 = t1 && !A.PseudoSelector__isFakePseudoElement0($name); + return new A.PseudoSelector0($name, A.unvendor0($name), t2, t1, argument, selector, span); + }, + PseudoSelector__isFakePseudoElement0($name) { + switch ($name.charCodeAt(0)) { + case 97: + case 65: + return A.equalsIgnoreCase0($name, "after"); + case 98: + case 66: + return A.equalsIgnoreCase0($name, "before"); + case 102: + case 70: + return A.equalsIgnoreCase0($name, "first-line") || A.equalsIgnoreCase0($name, "first-letter"); + default: + return false; + } + }, + PseudoSelector0: function PseudoSelector0(t0, t1, t2, t3, t4, t5, t6) { + var _ = this; + _.name = t0; + _.normalizedName = t1; + _.isClass = t2; + _.isSyntacticClass = t3; + _.argument = t4; + _.selector = t5; + _._pseudo$__PseudoSelector_specificity_FI = $; + _.span = t6; + }, + PseudoSelector_specificity_closure0: function PseudoSelector_specificity_closure0(t0) { + this.$this = t0; + }, + PseudoSelector_specificity__closure1: function PseudoSelector_specificity__closure1() { + }, + PseudoSelector_specificity__closure2: function PseudoSelector_specificity__closure2() { + }, + PseudoSelector_unify_closure0: function PseudoSelector_unify_closure0() { + }, + PublicMemberMapView0: function PublicMemberMapView0(t0, t1) { + this._public_member_map_view0$_inner = t0; + this.$ti = t1; + }, + QualifiedName0: function QualifiedName0(t0, t1) { + this.name = t0; + this.namespace = t1; + }, + createJSClass($name, $constructor) { + return type$.JSClass._as(A.allowInteropCaptureThisNamed($name, $constructor)); + }, + JSClassExtension_injectSuperclass(_this, superclass) { + var t1 = J.getInterceptor$x(superclass), + t2 = J.getInterceptor$x(_this); + self.Object.setPrototypeOf(t1.get$$prototype(superclass), J.get$$prototype$x(type$.JSClass._as(self.Object.getPrototypeOf(t2.get$$prototype(_this)).constructor))); + self.Object.setPrototypeOf(t2.get$$prototype(_this), self.Object.create(t1.get$$prototype(superclass))); + }, + JSClassExtension_setCustomInspect(_this, inspect) { + if (self.util == null) + return; + J.get$$prototype$x(_this)[self.util.inspect.custom] = A.allowInteropCaptureThis(new A.JSClassExtension_setCustomInspect_closure(inspect)); + }, + JSClassExtension_get_defineStaticMethod(_this) { + return new A.JSClassExtension_get_defineStaticMethod_closure(_this); + }, + JSClassExtension_get_defineMethod(_this) { + return new A.JSClassExtension_get_defineMethod_closure(_this); + }, + JSClassExtension_defineMethods(_this, methods) { + methods.forEach$1(0, A.JSClassExtension_get_defineMethod(_this)); + }, + JSClassExtension_get_defineGetter(_this) { + return new A.JSClassExtension_get_defineGetter_closure(_this); + }, + JSClass0: function JSClass0() { + }, + JSClassExtension_setCustomInspect_closure: function JSClassExtension_setCustomInspect_closure(t0) { + this.inspect = t0; + }, + JSClassExtension_get_defineStaticMethod_closure: function JSClassExtension_get_defineStaticMethod_closure(t0) { + this._this = t0; + }, + JSClassExtension_get_defineMethod_closure: function JSClassExtension_get_defineMethod_closure(t0) { + this._this = t0; + }, + JSClassExtension_get_defineGetter_closure: function JSClassExtension_get_defineGetter_closure(t0) { + this._this = t0; + }, + RenderContext0: function RenderContext0() { + }, + RenderContextOptions0: function RenderContextOptions0() { + }, + RenderContextResult0: function RenderContextResult0() { + }, + RenderContextResultStats0: function RenderContextResultStats0() { + }, + RenderOptions: function RenderOptions() { + }, + RenderResult: function RenderResult() { + }, + RenderResultStats: function RenderResultStats() { + }, + ReplaceExpressionVisitor0: function ReplaceExpressionVisitor0() { + }, + ReplaceExpressionVisitor_visitListExpression_closure0: function ReplaceExpressionVisitor_visitListExpression_closure0(t0) { + this.$this = t0; + }, + ReplaceExpressionVisitor_visitArgumentInvocation_closure0: function ReplaceExpressionVisitor_visitArgumentInvocation_closure0(t0) { + this.$this = t0; + }, + ReplaceExpressionVisitor_visitInterpolation_closure0: function ReplaceExpressionVisitor_visitInterpolation_closure0(t0) { + this.$this = t0; + }, + ImporterResult$(contents, sourceMapUrl, syntax) { + if ((sourceMapUrl == null ? null : sourceMapUrl.get$scheme()) === "") + A.throwExpression(A.ArgumentError$value(sourceMapUrl, "sourceMapUrl", "must be absolute")); + return new A.ImporterResult0(contents, sourceMapUrl, syntax); + }, + ImporterResult0: function ImporterResult0(t0, t1, t2) { + this.contents = t0; + this._result$_sourceMapUrl = t1; + this.syntax = t2; + }, + ReturnRule0: function ReturnRule0(t0, t1) { + this.expression = t0; + this.span = t1; + }, + SassParser0: function SassParser0(t0, t1, t2, t3) { + var _ = this; + _._sass0$_currentIndentation = 0; + _._sass0$_spaces = _._sass0$_nextIndentationEnd = _._sass0$_nextIndentation = null; + _._stylesheet0$_isUseAllowed = true; + _._stylesheet0$_inExpression = _._stylesheet0$_inParentheses = _._stylesheet0$_inStyleRule = _._stylesheet0$_inUnknownAtRule = _._stylesheet0$_inControlDirective = _._stylesheet0$_inContentBlock = _._stylesheet0$_inMixin = false; + _._stylesheet0$_globalVariables = t0; + _.lastSilentComment = null; + _.scanner = t1; + _.logger = t2; + _._parser0$_interpolationMap = t3; + }, + SassParser_styleRuleSelector_closure0: function SassParser_styleRuleSelector_closure0() { + }, + SassParser_children_closure0: function SassParser_children_closure0(t0, t1, t2) { + this.$this = t0; + this.child = t1; + this.children = t2; + }, + SassParser__peekIndentation_closure1: function SassParser__peekIndentation_closure1() { + }, + SassParser__peekIndentation_closure2: function SassParser__peekIndentation_closure2() { + }, + _translateReturnValue(val) { + if (val instanceof A._Future) + return A.futureToPromise(val, type$.dynamic); + else + return val; + }, + main2() { + new Uint8Array(0); + A.main(); + J.set$cli_pkg_main_0_$x(self.exports, A._wrapMain(A.sass__main$closure())); + }, + _wrapMain(main) { + if (type$.dynamic_Function._is(main)) + return A.allowInterop(new A._wrapMain_closure(main)); + else + return A.allowInterop(new A._wrapMain_closure0(main)); + }, + _Exports: function _Exports() { + }, + _wrapMain_closure: function _wrapMain_closure(t0) { + this.main = t0; + }, + _wrapMain_closure0: function _wrapMain_closure0(t0) { + this.main = t0; + }, + ScssParser$0(contents, logger, url) { + var t1 = A.SpanScanner$(contents, url), + t2 = logger == null ? B.StderrLogger_false0 : logger; + return new A.ScssParser0(A.LinkedHashMap_LinkedHashMap$_empty(type$.String, type$.VariableDeclaration_2), t1, t2, null); + }, + ScssParser0: function ScssParser0(t0, t1, t2, t3) { + var _ = this; + _._stylesheet0$_isUseAllowed = true; + _._stylesheet0$_inExpression = _._stylesheet0$_inParentheses = _._stylesheet0$_inStyleRule = _._stylesheet0$_inUnknownAtRule = _._stylesheet0$_inControlDirective = _._stylesheet0$_inContentBlock = _._stylesheet0$_inMixin = false; + _._stylesheet0$_globalVariables = t0; + _.lastSilentComment = null; + _.scanner = t1; + _.logger = t2; + _._parser0$_interpolationMap = t3; + }, + Selector0: function Selector0() { + }, + _IsInvisibleVisitor2: function _IsInvisibleVisitor2(t0) { + this.includeBogus = t0; + }, + _IsBogusVisitor0: function _IsBogusVisitor0(t0) { + this.includeLeadingCombinator = t0; + }, + _IsBogusVisitor_visitComplexSelector_closure0: function _IsBogusVisitor_visitComplexSelector_closure0(t0) { + this.$this = t0; + }, + _IsUselessVisitor0: function _IsUselessVisitor0() { + }, + _IsUselessVisitor_visitComplexSelector_closure0: function _IsUselessVisitor_visitComplexSelector_closure0(t0) { + this.$this = t0; + }, + __IsBogusVisitor_Object_AnySelectorVisitor0: function __IsBogusVisitor_Object_AnySelectorVisitor0() { + }, + __IsInvisibleVisitor_Object_AnySelectorVisitor0: function __IsInvisibleVisitor_Object_AnySelectorVisitor0() { + }, + __IsUselessVisitor_Object_AnySelectorVisitor0: function __IsUselessVisitor_Object_AnySelectorVisitor0() { + }, + SelectorExpression0: function SelectorExpression0(t0) { + this.span = t0; + }, + _prependParent0(compound) { + var _0_3, _0_4, t1, _0_4_isSet, rest, _null = null, + span = A.EvaluationContext_current0().get$currentCallableSpan(), + _0_0 = compound.components; + $label0$0: { + _0_3 = _0_0.length >= 1; + if (_0_3) { + _0_4 = _0_0[0]; + t1 = _0_4; + t1 = t1 instanceof A.UniversalSelector0; + _0_4_isSet = true; + } else { + _0_4 = _null; + _0_4_isSet = false; + t1 = false; + } + if (t1) { + t1 = _null; + break $label0$0; + } + if (_0_3) { + if (_0_4_isSet) + t1 = _0_4; + else { + _0_4 = _0_0[0]; + t1 = _0_4; + _0_4_isSet = true; + } + if (t1 instanceof A.TypeSelector0) { + if (_0_4_isSet) + t1 = _0_4; + else { + _0_4 = _0_0[0]; + t1 = _0_4; + _0_4_isSet = true; + } + t1 = type$.TypeSelector_2._as(t1).name.namespace != null; + } else + t1 = false; + } else + t1 = false; + if (t1) { + t1 = _null; + break $label0$0; + } + if (_0_3) { + if (_0_4_isSet) + t1 = _0_4; + else { + _0_4 = _0_0[0]; + t1 = _0_4; + _0_4_isSet = true; + } + t1 = t1 instanceof A.TypeSelector0; + } else + t1 = false; + if (t1) { + t1 = _0_4_isSet ? _0_4 : _0_0[0]; + type$.TypeSelector_2._as(t1); + rest = B.JSArray_methods.sublist$1(_0_0, 1); + t1 = A._setArrayType([new A.ParentSelector0(t1.name.name, span)], type$.JSArray_SimpleSelector_2); + B.JSArray_methods.addAll$1(t1, rest); + t1 = A.CompoundSelector$0(t1, span); + break $label0$0; + } + t1 = A._setArrayType([new A.ParentSelector0(_null, span)], type$.JSArray_SimpleSelector_2); + B.JSArray_methods.addAll$1(t1, _0_0); + t1 = A.CompoundSelector$0(t1, span); + break $label0$0; + } + return t1; + }, + _function7($name, $arguments, callback) { + return A.BuiltInCallable$function0($name, $arguments, callback, "sass:selector"); + }, + _nest_closure0: function _nest_closure0() { + }, + _nest__closure1: function _nest__closure1(t0) { + this._box_0 = t0; + }, + _nest__closure2: function _nest__closure2() { + }, + _append_closure1: function _append_closure1() { + }, + _append__closure1: function _append__closure1() { + }, + _append__closure2: function _append__closure2(t0) { + this.span = t0; + }, + _append___closure0: function _append___closure0(t0, t1) { + this.parent = t0; + this.span = t1; + }, + _extend_closure0: function _extend_closure0() { + }, + _replace_closure0: function _replace_closure0() { + }, + _unify_closure0: function _unify_closure0() { + }, + _isSuperselector_closure0: function _isSuperselector_closure0() { + }, + _simpleSelectors_closure0: function _simpleSelectors_closure0() { + }, + _simpleSelectors__closure0: function _simpleSelectors__closure0() { + }, + _parse_closure0: function _parse_closure0() { + }, + SelectorParser$0(contents, allowParent, allowPlaceholder, interpolationMap, logger, url) { + var t1 = A.SpanScanner$(contents, url); + return new A.SelectorParser0(allowParent, allowPlaceholder, t1, logger == null ? B.StderrLogger_false0 : logger, interpolationMap); + }, + SelectorParser0: function SelectorParser0(t0, t1, t2, t3, t4) { + var _ = this; + _._selector$_allowParent = t0; + _._selector$_allowPlaceholder = t1; + _.scanner = t2; + _.logger = t3; + _._parser0$_interpolationMap = t4; + }, + SelectorParser_parse_closure0: function SelectorParser_parse_closure0(t0) { + this.$this = t0; + }, + SelectorParser_parseCompoundSelector_closure0: function SelectorParser_parseCompoundSelector_closure0(t0) { + this.$this = t0; + }, + SelectorSearchVisitor0: function SelectorSearchVisitor0() { + }, + SelectorSearchVisitor_visitComplexSelector_closure0: function SelectorSearchVisitor_visitComplexSelector_closure0(t0) { + this.$this = t0; + }, + SelectorSearchVisitor_visitCompoundSelector_closure0: function SelectorSearchVisitor_visitCompoundSelector_closure0(t0) { + this.$this = t0; + }, + serialize0(node, charset, indentWidth, inspect, lineFeed, sourceMap, style, useSpaces) { + var t1, css, t2, prefix, + visitor = A._SerializeVisitor$0(indentWidth == null ? 2 : indentWidth, inspect, lineFeed, true, sourceMap, style, useSpaces); + node.accept$1(visitor); + t1 = visitor._serialize0$_buffer; + css = t1.toString$0(0); + if (charset) { + t2 = new A.CodeUnits(css); + t2 = t2.any$1(t2, new A.serialize_closure0()); + } else + t2 = false; + if (t2) + prefix = style === B.OutputStyle_10 ? "\ufeff" : '@charset "UTF-8";\n'; + else + prefix = ""; + t1 = sourceMap ? t1.buildSourceMap$1$prefix(prefix) : null; + return new A._Record_2_sourceMap(prefix + css, t1); + }, + serializeValue0(value, inspect, quote) { + var visitor = A._SerializeVisitor$0(null, inspect, null, quote, false, null, true); + value.accept$1(visitor); + return visitor._serialize0$_buffer.toString$0(0); + }, + serializeSelector0(selector, inspect) { + var visitor = A._SerializeVisitor$0(null, true, null, true, false, null, true); + selector.accept$1(visitor); + return visitor._serialize0$_buffer.toString$0(0); + }, + _SerializeVisitor$0(indentWidth, inspect, lineFeed, quote, sourceMap, style, useSpaces) { + var t1 = sourceMap ? new A.SourceMapBuffer0(new A.StringBuffer(""), A._setArrayType([], type$.JSArray_Entry)) : new A.NoSourceMapBuffer0(new A.StringBuffer("")), + t2 = style == null ? B.OutputStyle_00 : style, + t3 = useSpaces ? 32 : 9, + t4 = indentWidth == null ? 2 : indentWidth, + t5 = lineFeed == null ? B.LineFeed_SsD : lineFeed; + A.RangeError_checkValueInInterval(t4, 0, 10, "indentWidth"); + return new A._SerializeVisitor0(t1, t2, inspect, quote, t3, t4, t5); + }, + serialize_closure0: function serialize_closure0() { + }, + _SerializeVisitor0: function _SerializeVisitor0(t0, t1, t2, t3, t4, t5, t6) { + var _ = this; + _._serialize0$_buffer = t0; + _._serialize0$_indentation = 0; + _._serialize0$_style = t1; + _._serialize0$_inspect = t2; + _._serialize0$_quote = t3; + _._serialize0$_indentCharacter = t4; + _._serialize0$_indentWidth = t5; + _._lineFeed = t6; + }, + _SerializeVisitor_visitCssComment_closure0: function _SerializeVisitor_visitCssComment_closure0(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _SerializeVisitor_visitCssAtRule_closure0: function _SerializeVisitor_visitCssAtRule_closure0(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _SerializeVisitor_visitCssMediaRule_closure0: function _SerializeVisitor_visitCssMediaRule_closure0(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _SerializeVisitor_visitCssImport_closure0: function _SerializeVisitor_visitCssImport_closure0(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _SerializeVisitor_visitCssImport__closure0: function _SerializeVisitor_visitCssImport__closure0(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _SerializeVisitor_visitCssKeyframeBlock_closure0: function _SerializeVisitor_visitCssKeyframeBlock_closure0(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _SerializeVisitor_visitCssStyleRule_closure0: function _SerializeVisitor_visitCssStyleRule_closure0(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _SerializeVisitor_visitCssSupportsRule_closure0: function _SerializeVisitor_visitCssSupportsRule_closure0(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _SerializeVisitor_visitCssDeclaration_closure1: function _SerializeVisitor_visitCssDeclaration_closure1(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _SerializeVisitor_visitCssDeclaration_closure2: function _SerializeVisitor_visitCssDeclaration_closure2(t0, t1) { + this.$this = t0; + this.node = t1; + }, + _SerializeVisitor_visitList_closure2: function _SerializeVisitor_visitList_closure2() { + }, + _SerializeVisitor_visitList_closure3: function _SerializeVisitor_visitList_closure3(t0, t1) { + this.$this = t0; + this.value = t1; + }, + _SerializeVisitor_visitList_closure4: function _SerializeVisitor_visitList_closure4(t0) { + this.$this = t0; + }, + _SerializeVisitor_visitMap_closure0: function _SerializeVisitor_visitMap_closure0(t0) { + this.$this = t0; + }, + _SerializeVisitor_visitSelectorList_closure0: function _SerializeVisitor_visitSelectorList_closure0() { + }, + _SerializeVisitor__write_closure0: function _SerializeVisitor__write_closure0(t0, t1) { + this.$this = t0; + this.value = t1; + }, + _SerializeVisitor__visitChildren_closure1: function _SerializeVisitor__visitChildren_closure1(t0, t1) { + this.$this = t0; + this.child = t1; + }, + _SerializeVisitor__visitChildren_closure2: function _SerializeVisitor__visitChildren_closure2(t0, t1) { + this.$this = t0; + this.child = t1; + }, + OutputStyle0: function OutputStyle0(t0) { + this._name = t0; + }, + LineFeed0: function LineFeed0(t0, t1, t2) { + this.name = t0; + this.text = t1; + this._name = t2; + }, + ShadowedModuleView_ifNecessary0(inner, functions, mixins, variables, $T) { + return A.ShadowedModuleView__needsBlocklist0(inner.get$variables(), variables) || A.ShadowedModuleView__needsBlocklist0(inner.get$functions(inner), functions) || A.ShadowedModuleView__needsBlocklist0(inner.get$mixins(), mixins) ? new A.ShadowedModuleView0(inner, A.ShadowedModuleView__shadowedMap0(inner.get$variables(), variables, type$.Value_2), A.ShadowedModuleView__shadowedMap0(inner.get$variableNodes(), variables, type$.AstNode_2), A.ShadowedModuleView__shadowedMap0(inner.get$functions(inner), functions, $T), A.ShadowedModuleView__shadowedMap0(inner.get$mixins(), mixins, $T), $T._eval$1("ShadowedModuleView0<0>")) : null; + }, + ShadowedModuleView__shadowedMap0(map, blocklist, $V) { + var t1 = A.ShadowedModuleView__needsBlocklist0(map, blocklist); + return !t1 ? map : A.LimitedMapView$blocklist0(map, blocklist, type$.String, $V); + }, + ShadowedModuleView__needsBlocklist0(map, blocklist) { + return map.get$isNotEmpty(map) && blocklist.any$1(0, map.get$containsKey()); + }, + ShadowedModuleView0: function ShadowedModuleView0(t0, t1, t2, t3, t4, t5) { + var _ = this; + _._shadowed_view0$_inner = t0; + _.variables = t1; + _.variableNodes = t2; + _.functions = t3; + _.mixins = t4; + _.$ti = t5; + }, + SilentComment0: function SilentComment0(t0, t1) { + this.text = t0; + this.span = t1; + }, + SimpleSelector0: function SimpleSelector0() { + }, + SimpleSelector_isSuperselector_closure0: function SimpleSelector_isSuperselector_closure0(t0) { + this.$this = t0; + }, + SimpleSelector_isSuperselector__closure0: function SimpleSelector_isSuperselector__closure0(t0) { + this.$this = t0; + }, + SingleUnitSassNumber0: function SingleUnitSassNumber0(t0, t1, t2) { + var _ = this; + _._single_unit$_unit = t0; + _._number1$_value = t1; + _.hashCache = null; + _.asSlash = t2; + }, + SingleUnitSassNumber__coerceToUnit_closure0: function SingleUnitSassNumber__coerceToUnit_closure0(t0, t1) { + this.$this = t0; + this.unit = t1; + }, + SingleUnitSassNumber__coerceValueToUnit_closure0: function SingleUnitSassNumber__coerceValueToUnit_closure0(t0) { + this.$this = t0; + }, + SingleUnitSassNumber_multiplyUnits_closure1: function SingleUnitSassNumber_multiplyUnits_closure1(t0, t1) { + this._box_0 = t0; + this.$this = t1; + }, + SingleUnitSassNumber_multiplyUnits_closure2: function SingleUnitSassNumber_multiplyUnits_closure2(t0, t1) { + this._box_0 = t0; + this.$this = t1; + }, + SourceMapBuffer0: function SourceMapBuffer0(t0, t1) { + var _ = this; + _._source_map_buffer0$_buffer = t0; + _._source_map_buffer0$_entries = t1; + _._source_map_buffer0$_column = _._source_map_buffer0$_line = 0; + _._source_map_buffer0$_inSpan = false; + }, + SourceMapBuffer_buildSourceMap_closure0: function SourceMapBuffer_buildSourceMap_closure0(t0, t1) { + this._box_0 = t0; + this.prefixLength = t1; + }, + updateSourceSpanPrototype() { + var t3, t4, _i, t5, + span = A.SourceFile$fromString("", null).span$1(0, 0), + t1 = type$.SourceSpan, + t2 = type$.String; + for (t1 = [span, new A.MultiSpan0(span, "", A.ConstantMap_ConstantMap$from(A.LinkedHashMap_LinkedHashMap$_empty(t1, t2), t1, t2)), new A.LazyFileSpan0(new A.updateSourceSpanPrototype_closure(span))], t3 = type$.JSClass, t4 = type$.Function, _i = 0; _i < 3; ++_i) { + t5 = t3._as(t1[_i].constructor); + A.LinkedHashMap_LinkedHashMap$_literal(["start", new A.updateSourceSpanPrototype_closure0(), "end", new A.updateSourceSpanPrototype_closure1(), "url", new A.updateSourceSpanPrototype_closure2(), "text", new A.updateSourceSpanPrototype_closure3(), "context", new A.updateSourceSpanPrototype_closure4()], t2, t4).forEach$1(0, A.JSClassExtension_get_defineGetter(t5)); + } + t1 = t3._as(A.FileLocation$_(span.file, span._file$_start).constructor); + A.LinkedHashMap_LinkedHashMap$_literal(["line", new A.updateSourceSpanPrototype_closure5(), "column", new A.updateSourceSpanPrototype_closure6()], t2, t4).forEach$1(0, A.JSClassExtension_get_defineGetter(t1)); + }, + updateSourceSpanPrototype_closure: function updateSourceSpanPrototype_closure(t0) { + this.span = t0; + }, + updateSourceSpanPrototype_closure0: function updateSourceSpanPrototype_closure0() { + }, + updateSourceSpanPrototype_closure1: function updateSourceSpanPrototype_closure1() { + }, + updateSourceSpanPrototype_closure2: function updateSourceSpanPrototype_closure2() { + }, + updateSourceSpanPrototype_closure3: function updateSourceSpanPrototype_closure3() { + }, + updateSourceSpanPrototype_closure4: function updateSourceSpanPrototype_closure4() { + }, + updateSourceSpanPrototype_closure5: function updateSourceSpanPrototype_closure5() { + }, + updateSourceSpanPrototype_closure6: function updateSourceSpanPrototype_closure6() { + }, + StatementSearchVisitor0: function StatementSearchVisitor0() { + }, + StatementSearchVisitor_visitIfRule_closure1: function StatementSearchVisitor_visitIfRule_closure1(t0) { + this.$this = t0; + }, + StatementSearchVisitor_visitIfRule__closure2: function StatementSearchVisitor_visitIfRule__closure2(t0) { + this.$this = t0; + }, + StatementSearchVisitor_visitIfRule_closure2: function StatementSearchVisitor_visitIfRule_closure2(t0) { + this.$this = t0; + }, + StatementSearchVisitor_visitIfRule__closure1: function StatementSearchVisitor_visitIfRule__closure1(t0) { + this.$this = t0; + }, + StatementSearchVisitor_visitChildren_closure0: function StatementSearchVisitor_visitChildren_closure0(t0) { + this.$this = t0; + }, + StaticImport0: function StaticImport0(t0, t1, t2) { + this.url = t0; + this.modifiers = t1; + this.span = t2; + }, + StderrLogger0: function StderrLogger0(t0) { + this.color = t0; + }, + StringExpression_quoteText0(text) { + var t1, + quote = A.StringExpression__bestQuote0(A._setArrayType([text], type$.JSArray_String)), + buffer = new A.StringBuffer(""); + buffer._contents = "" + A.Primitives_stringFromCharCode(quote); + A.StringExpression__quoteInnerText0(text, quote, buffer, true); + t1 = buffer._contents += A.Primitives_stringFromCharCode(quote); + return t1.charCodeAt(0) == 0 ? t1 : t1; + }, + StringExpression__quoteInnerText0(text, quote, buffer, $static) { + var t1, t2, i, _1_0, _0_0, t3, t4; + for (t1 = text.length, t2 = t1 - 1, i = 0; i < t1; ++i) { + _1_0 = text.charCodeAt(i); + if (_1_0 === 10 || _1_0 === 13 || _1_0 === 12) { + buffer.writeCharCode$1(92); + buffer.writeCharCode$1(97); + if (i !== t2) { + _0_0 = text.charCodeAt(i + 1); + if (!(_0_0 === 32 || _0_0 === 9 || _0_0 === 10 || _0_0 === 13 || _0_0 === 12)) + if (!(_0_0 >= 48 && _0_0 <= 57)) + if (!(_0_0 >= 97 && _0_0 <= 102)) + t3 = _0_0 >= 65 && _0_0 <= 70; + else + t3 = true; + else + t3 = true; + else + t3 = true; + if (t3) + buffer.writeCharCode$1(32); + } + continue; + } + if (92 === _1_0) { + t3 = _1_0; + t4 = true; + } else { + t3 = null; + t4 = false; + } + if (!t4) { + if (_1_0 === quote) { + t3 = _1_0; + t4 = true; + } else + t4 = false; + if (!t4) + if (35 === _1_0) + if ($static) + if (i < t2) + if (text.charCodeAt(i + 1) === 123) { + t3 = _1_0; + t4 = true; + } else + t4 = false; + else + t4 = false; + else + t4 = false; + else + t4 = false; + else + t4 = true; + } else + t4 = true; + if (t4) { + buffer.writeCharCode$1(92); + buffer.writeCharCode$1(t3); + continue; + } + buffer.writeCharCode$1(_1_0); + } + }, + StringExpression__bestQuote0(strings) { + var t1, t2, t3, containsDoubleQuote, t4, t5; + for (t1 = J.get$iterator$ax(strings), t2 = type$.CodeUnits, t3 = t2._eval$1("ListIterator"), t2 = t2._eval$1("ListBase.E"), containsDoubleQuote = false; t1.moveNext$0();) + for (t4 = new A.CodeUnits(t1.get$current(t1)), t4 = new A.ListIterator(t4, t4.get$length(0), t3); t4.moveNext$0();) { + t5 = t4.__internal$_current; + if (t5 == null) + t5 = t2._as(t5); + if (t5 === 39) + return 34; + if (t5 === 34) + containsDoubleQuote = true; + } + return containsDoubleQuote ? 39 : 34; + }, + StringExpression0: function StringExpression0(t0, t1) { + this.text = t0; + this.hasQuotes = t1; + }, + _codepointForIndex0(index, lengthInCodepoints, allowNegative) { + var result; + if (index === 0) + return 0; + if (index > 0) + return Math.min(index - 1, lengthInCodepoints); + result = lengthInCodepoints + index; + if (result < 0 && !allowNegative) + return 0; + return result; + }, + _function6($name, $arguments, callback) { + return A.BuiltInCallable$function0($name, $arguments, callback, "sass:string"); + }, + module_closure10: function module_closure10() { + }, + module__closure2: function module__closure2(t0) { + this.string = t0; + }, + module__closure3: function module__closure3(t0) { + this.string = t0; + }, + _unquote_closure0: function _unquote_closure0() { + }, + _quote_closure0: function _quote_closure0() { + }, + _length_closure1: function _length_closure1() { + }, + _insert_closure0: function _insert_closure0() { + }, + _index_closure1: function _index_closure1() { + }, + _slice_closure0: function _slice_closure0() { + }, + _toUpperCase_closure0: function _toUpperCase_closure0() { + }, + _toLowerCase_closure0: function _toLowerCase_closure0() { + }, + _uniqueId_closure0: function _uniqueId_closure0() { + }, + stringClass_closure: function stringClass_closure() { + }, + stringClass__closure: function stringClass__closure() { + }, + stringClass__closure0: function stringClass__closure0() { + }, + stringClass__closure1: function stringClass__closure1() { + }, + stringClass__closure2: function stringClass__closure2() { + }, + stringClass__closure3: function stringClass__closure3() { + }, + _ConstructorOptions1: function _ConstructorOptions1() { + }, + _NodeSassString: function _NodeSassString() { + }, + legacyStringClass_closure: function legacyStringClass_closure() { + }, + legacyStringClass_closure0: function legacyStringClass_closure0() { + }, + legacyStringClass_closure1: function legacyStringClass_closure1() { + }, + SassString$0(_text, quotes) { + return new A.SassString0(_text, quotes); + }, + SassString0: function SassString0(t0, t1) { + var _ = this; + _._string0$_text = t0; + _._string0$_hasQuotes = t1; + _._string0$__SassString__sassLength_FI = $; + _._string0$_hashCache = null; + }, + ModifiableCssStyleRule$0(_selector, span, originalSelector) { + var t1 = A._setArrayType([], type$.JSArray_ModifiableCssNode_2); + return new A.ModifiableCssStyleRule0(_selector, originalSelector, span, new A.UnmodifiableListView(t1, type$.UnmodifiableListView_ModifiableCssNode_2), t1); + }, + ModifiableCssStyleRule0: function ModifiableCssStyleRule0(t0, t1, t2, t3, t4) { + var _ = this; + _._style_rule0$_selector = t0; + _.originalSelector = t1; + _.span = t2; + _.children = t3; + _._node$_children = t4; + _._node$_indexInParent = _._node$_parent = null; + _.isGroupEnd = false; + }, + StyleRule$0(selector, children, span) { + var t1 = A.List_List$unmodifiable(children, type$.Statement_2), + t2 = B.JSArray_methods.any$1(t1, new A.ParentStatement_closure0()); + return new A.StyleRule0(selector, span, t1, t2); + }, + StyleRule0: function StyleRule0(t0, t1, t2, t3) { + var _ = this; + _.selector = t0; + _.span = t1; + _.children = t2; + _.hasDeclarations = t3; + }, + CssStylesheet0: function CssStylesheet0(t0, t1) { + this.children = t0; + this.span = t1; + }, + ModifiableCssStylesheet$0(span) { + var t1 = A._setArrayType([], type$.JSArray_ModifiableCssNode_2); + return new A.ModifiableCssStylesheet0(span, new A.UnmodifiableListView(t1, type$.UnmodifiableListView_ModifiableCssNode_2), t1); + }, + ModifiableCssStylesheet0: function ModifiableCssStylesheet0(t0, t1, t2) { + var _ = this; + _.span = t0; + _.children = t1; + _._node$_children = t2; + _._node$_indexInParent = _._node$_parent = null; + _.isGroupEnd = false; + }, + StylesheetParser0: function StylesheetParser0() { + }, + StylesheetParser_parse_closure0: function StylesheetParser_parse_closure0(t0) { + this.$this = t0; + }, + StylesheetParser_parse__closure1: function StylesheetParser_parse__closure1(t0) { + this.$this = t0; + }, + StylesheetParser_parse__closure2: function StylesheetParser_parse__closure2() { + }, + StylesheetParser_parseArgumentDeclaration_closure0: function StylesheetParser_parseArgumentDeclaration_closure0(t0) { + this.$this = t0; + }, + StylesheetParser__parseSingleProduction_closure0: function StylesheetParser__parseSingleProduction_closure0(t0, t1, t2) { + this.$this = t0; + this.production = t1; + this.T = t2; + }, + StylesheetParser_parseSignature_closure: function StylesheetParser_parseSignature_closure(t0, t1) { + this.$this = t0; + this.requireParens = t1; + }, + StylesheetParser__statement_closure0: function StylesheetParser__statement_closure0(t0) { + this.$this = t0; + }, + StylesheetParser_variableDeclarationWithoutNamespace_closure1: function StylesheetParser_variableDeclarationWithoutNamespace_closure1(t0, t1) { + this.$this = t0; + this.start = t1; + }, + StylesheetParser_variableDeclarationWithoutNamespace_closure2: function StylesheetParser_variableDeclarationWithoutNamespace_closure2(t0) { + this.declaration = t0; + }, + StylesheetParser__declarationOrBuffer_closure1: function StylesheetParser__declarationOrBuffer_closure1(t0) { + this.name = t0; + }, + StylesheetParser__declarationOrBuffer_closure2: function StylesheetParser__declarationOrBuffer_closure2(t0, t1) { + this._box_0 = t0; + this.name = t1; + }, + StylesheetParser__styleRule_closure0: function StylesheetParser__styleRule_closure0(t0, t1, t2, t3) { + var _ = this; + _._box_0 = t0; + _.$this = t1; + _.wasInStyleRule = t2; + _.start = t3; + }, + StylesheetParser__propertyOrVariableDeclaration_closure1: function StylesheetParser__propertyOrVariableDeclaration_closure1(t0) { + this._box_0 = t0; + }, + StylesheetParser__propertyOrVariableDeclaration_closure2: function StylesheetParser__propertyOrVariableDeclaration_closure2(t0, t1) { + this._box_0 = t0; + this.value = t1; + }, + StylesheetParser__atRootRule_closure1: function StylesheetParser__atRootRule_closure1(t0) { + this.query = t0; + }, + StylesheetParser__atRootRule_closure2: function StylesheetParser__atRootRule_closure2() { + }, + StylesheetParser__eachRule_closure0: function StylesheetParser__eachRule_closure0(t0, t1, t2, t3) { + var _ = this; + _.$this = t0; + _.wasInControlDirective = t1; + _.variables = t2; + _.list = t3; + }, + StylesheetParser__functionRule_closure0: function StylesheetParser__functionRule_closure0(t0, t1, t2) { + this.name = t0; + this.$arguments = t1; + this.precedingComment = t2; + }, + StylesheetParser__forRule_closure1: function StylesheetParser__forRule_closure1(t0, t1) { + this._box_0 = t0; + this.$this = t1; + }, + StylesheetParser__forRule_closure2: function StylesheetParser__forRule_closure2(t0, t1, t2, t3, t4, t5) { + var _ = this; + _._box_0 = t0; + _.$this = t1; + _.wasInControlDirective = t2; + _.variable = t3; + _.from = t4; + _.to = t5; + }, + StylesheetParser__memberList_closure0: function StylesheetParser__memberList_closure0(t0, t1, t2) { + this.$this = t0; + this.variables = t1; + this.identifiers = t2; + }, + StylesheetParser__includeRule_closure0: function StylesheetParser__includeRule_closure0(t0) { + this.contentArguments_ = t0; + }, + StylesheetParser_mediaRule_closure0: function StylesheetParser_mediaRule_closure0(t0) { + this.query = t0; + }, + StylesheetParser__mixinRule_closure0: function StylesheetParser__mixinRule_closure0(t0, t1, t2, t3) { + var _ = this; + _.$this = t0; + _.name = t1; + _.$arguments = t2; + _.precedingComment = t3; + }, + StylesheetParser_mozDocumentRule_closure0: function StylesheetParser_mozDocumentRule_closure0(t0, t1, t2, t3) { + var _ = this; + _._box_0 = t0; + _.$this = t1; + _.name = t2; + _.value = t3; + }, + StylesheetParser_supportsRule_closure0: function StylesheetParser_supportsRule_closure0(t0) { + this.condition = t0; + }, + StylesheetParser__whileRule_closure0: function StylesheetParser__whileRule_closure0(t0, t1, t2) { + this.$this = t0; + this.wasInControlDirective = t1; + this.condition = t2; + }, + StylesheetParser_unknownAtRule_closure0: function StylesheetParser_unknownAtRule_closure0(t0, t1) { + this._box_0 = t0; + this.name = t1; + }, + StylesheetParser__expression_resetState0: function StylesheetParser__expression_resetState0(t0, t1, t2) { + this._box_0 = t0; + this.$this = t1; + this.start = t2; + }, + StylesheetParser__expression_resolveOneOperation0: function StylesheetParser__expression_resolveOneOperation0(t0, t1) { + this._box_0 = t0; + this.$this = t1; + }, + StylesheetParser__expression_resolveOperations0: function StylesheetParser__expression_resolveOperations0(t0, t1) { + this._box_0 = t0; + this.resolveOneOperation = t1; + }, + StylesheetParser__expression_addSingleExpression0: function StylesheetParser__expression_addSingleExpression0(t0, t1, t2, t3) { + var _ = this; + _._box_0 = t0; + _.$this = t1; + _.resetState = t2; + _.resolveOperations = t3; + }, + StylesheetParser__expression_addOperator0: function StylesheetParser__expression_addOperator0(t0, t1, t2) { + this._box_0 = t0; + this.$this = t1; + this.resolveOneOperation = t2; + }, + StylesheetParser__expression_resolveSpaceExpressions0: function StylesheetParser__expression_resolveSpaceExpressions0(t0, t1, t2) { + this._box_0 = t0; + this.$this = t1; + this.resolveOperations = t2; + }, + StylesheetParser_expressionUntilComma_closure0: function StylesheetParser_expressionUntilComma_closure0(t0) { + this.$this = t0; + }, + StylesheetParser__isHexColor_closure0: function StylesheetParser__isHexColor_closure0() { + }, + StylesheetParser__unicodeRange_closure1: function StylesheetParser__unicodeRange_closure1() { + }, + StylesheetParser__unicodeRange_closure2: function StylesheetParser__unicodeRange_closure2() { + }, + StylesheetParser_namespacedExpression_closure0: function StylesheetParser_namespacedExpression_closure0(t0, t1) { + this.$this = t0; + this.start = t1; + }, + StylesheetParser_trySpecialFunction_closure0: function StylesheetParser_trySpecialFunction_closure0() { + }, + StylesheetParser__expressionUntilComparison_closure0: function StylesheetParser__expressionUntilComparison_closure0(t0) { + this.$this = t0; + }, + StylesheetParser__publicIdentifier_closure0: function StylesheetParser__publicIdentifier_closure0(t0, t1) { + this.$this = t0; + this.start = t1; + }, + Stylesheet$internal0(children, span, plainCss) { + var t1 = A._setArrayType([], type$.JSArray_UseRule_2), + t2 = A._setArrayType([], type$.JSArray_ForwardRule_2), + t3 = A.List_List$unmodifiable(children, type$.Statement_2), + t4 = B.JSArray_methods.any$1(t3, new A.ParentStatement_closure0()); + t1 = new A.Stylesheet0(span, plainCss, t1, t2, t3, t4); + t1.Stylesheet$internal$3$plainCss0(children, span, plainCss); + return t1; + }, + Stylesheet_Stylesheet$parse0(contents, syntax, logger, url) { + var error, stackTrace, url0, t1, exception, t2; + try { + switch (syntax) { + case B.Syntax_Sass_sass0: + t1 = A.SpanScanner$(contents, url); + t1 = new A.SassParser0(A.LinkedHashMap_LinkedHashMap$_empty(type$.String, type$.VariableDeclaration_2), t1, logger, null).parse$0(); + return t1; + case B.Syntax_SCSS_scss0: + t1 = A.ScssParser$0(contents, logger, url).parse$0(); + return t1; + case B.Syntax_CSS_css0: + t1 = A.SpanScanner$(contents, url); + t1 = new A.CssParser0(A.LinkedHashMap_LinkedHashMap$_empty(type$.String, type$.VariableDeclaration_2), t1, logger, null).parse$0(); + return t1; + default: + t1 = A.ArgumentError$("Unknown syntax " + syntax.toString$0(0) + ".", null); + throw A.wrapException(t1); + } + } catch (exception) { + t1 = A.unwrapException(exception); + if (t1 instanceof A.SassException0) { + error = t1; + stackTrace = A.getTraceFromException(exception); + t1 = error; + t2 = J.getInterceptor$z(t1); + t1 = A.SourceSpanException.prototype.get$span.call(t2, t1); + url0 = t1.get$sourceUrl(t1); + if (url0 == null || J.toString$0$(url0) === "stdin") + throw exception; + t1 = type$.Uri; + throw A.wrapException(A.throwWithTrace0(error.withLoadedUrls$1(A.Set_Set$unmodifiable(A.LinkedHashSet_LinkedHashSet$_literal([url0], t1), t1)), error, stackTrace)); + } else + throw exception; + } + }, + Stylesheet0: function Stylesheet0(t0, t1, t2, t3, t4, t5) { + var _ = this; + _.span = t0; + _.plainCss = t1; + _._stylesheet1$_uses = t2; + _._stylesheet1$_forwards = t3; + _.children = t4; + _.hasDeclarations = t5; + }, + SupportsExpression0: function SupportsExpression0(t0) { + this.condition = t0; + }, + ModifiableCssSupportsRule$0(condition, span) { + var t1 = A._setArrayType([], type$.JSArray_ModifiableCssNode_2); + return new A.ModifiableCssSupportsRule0(condition, span, new A.UnmodifiableListView(t1, type$.UnmodifiableListView_ModifiableCssNode_2), t1); + }, + ModifiableCssSupportsRule0: function ModifiableCssSupportsRule0(t0, t1, t2, t3) { + var _ = this; + _.condition = t0; + _.span = t1; + _.children = t2; + _._node$_children = t3; + _._node$_indexInParent = _._node$_parent = null; + _.isGroupEnd = false; + }, + SupportsRule$0(condition, children, span) { + var t1 = A.List_List$unmodifiable(children, type$.Statement_2), + t2 = B.JSArray_methods.any$1(t1, new A.ParentStatement_closure0()); + return new A.SupportsRule0(condition, span, t1, t2); + }, + SupportsRule0: function SupportsRule0(t0, t1, t2, t3) { + var _ = this; + _.condition = t0; + _.span = t1; + _.children = t2; + _.hasDeclarations = t3; + }, + JSToDartImporter: function JSToDartImporter(t0, t1, t2) { + this._sync$_canonicalize = t0; + this._sync$_load = t1; + this._sync$_nonCanonicalSchemes = t2; + }, + JSToDartImporter_canonicalize_closure: function JSToDartImporter_canonicalize_closure(t0, t1) { + this.$this = t0; + this.url = t1; + }, + JSToDartImporter_load_closure: function JSToDartImporter_load_closure(t0, t1) { + this.$this = t0; + this.url = t1; + }, + Syntax_forPath0(path) { + var t1, + _0_0 = A.ParsedPath_ParsedPath$parse(path, $.$get$context().style)._splitExtension$1(1)[1]; + $label0$0: { + if (".sass" === _0_0) { + t1 = B.Syntax_Sass_sass0; + break $label0$0; + } + if (".css" === _0_0) { + t1 = B.Syntax_CSS_css0; + break $label0$0; + } + t1 = B.Syntax_SCSS_scss0; + break $label0$0; + } + return t1; + }, + Syntax0: function Syntax0(t0, t1) { + this._syntax0$_name = t0; + this._name = t1; + }, + TypeSelector0: function TypeSelector0(t0, t1) { + this.name = t0; + this.span = t1; + }, + Types: function Types() { + }, + UnaryOperationExpression0: function UnaryOperationExpression0(t0, t1, t2) { + this.operator = t0; + this.operand = t1; + this.span = t2; + }, + UnaryOperator0: function UnaryOperator0(t0, t1, t2) { + this.name = t0; + this.operator = t1; + this._name = t2; + }, + UnitlessSassNumber0: function UnitlessSassNumber0(t0, t1) { + this._number1$_value = t0; + this.hashCache = null; + this.asSlash = t1; + }, + UniversalSelector0: function UniversalSelector0(t0, t1) { + this.namespace = t0; + this.span = t1; + }, + UnprefixedMapView0: function UnprefixedMapView0(t0, t1, t2) { + this._unprefixed_map_view0$_map = t0; + this._unprefixed_map_view0$_prefix = t1; + this.$ti = t2; + }, + _UnprefixedKeys0: function _UnprefixedKeys0(t0) { + this._unprefixed_map_view0$_view = t0; + }, + _UnprefixedKeys_iterator_closure1: function _UnprefixedKeys_iterator_closure1(t0) { + this.$this = t0; + }, + _UnprefixedKeys_iterator_closure2: function _UnprefixedKeys_iterator_closure2(t0) { + this.$this = t0; + }, + JSUrl0: function JSUrl0() { + }, + UseRule0: function UseRule0(t0, t1, t2, t3) { + var _ = this; + _.url = t0; + _.namespace = t1; + _.configuration = t2; + _.span = t3; + }, + UserDefinedCallable0: function UserDefinedCallable0(t0, t1, t2, t3) { + var _ = this; + _.declaration = t0; + _.environment = t1; + _.inDependency = t2; + _.$ti = t3; + }, + fromImport0() { + var t1 = A._asBoolQ($.Zone__current.$index(0, B.Symbol__inImportRule)); + return t1 === true; + }, + containingUrl0() { + var t1, + _0_0 = $.Zone__current.$index(0, B.Symbol__containingUrl); + $label0$0: { + if (_0_0 == null) + A.throwExpression(A.StateError$(string$.contai)); + if (B.Symbol__none.$eq(0, _0_0)) { + t1 = null; + break $label0$0; + } + if (type$.Uri._is(_0_0)) { + t1 = _0_0; + break $label0$0; + } + t1 = A.throwExpression(A.StateError$(string$.Unexpe + A.S(_0_0) + ".")); + } + return t1; + }, + withContainingUrl0(url, callback, $T) { + var t1 = url == null ? B.Symbol__none : url, + t2 = type$.nullable_Object; + return A.runZoned(callback, A.LinkedHashMap_LinkedHashMap$_literal([B.Symbol__containingUrl, t1], t2, t2), $T); + }, + resolveImportPath0(path) { + var t1, + extension = A.ParsedPath_ParsedPath$parse(path, $.$get$context().style)._splitExtension$1(1)[1]; + if (extension === ".sass" || extension === ".scss" || extension === ".css") { + t1 = A.fromImport0() ? new A.resolveImportPath_closure1(path, extension).call$0() : null; + return t1 == null ? A._exactlyOne0(A._tryPath0(path)) : t1; + } + t1 = A.fromImport0() ? new A.resolveImportPath_closure2(path).call$0() : null; + if (t1 == null) + t1 = A._exactlyOne0(A._tryPathWithExtensions0(path)); + return t1 == null ? A._tryPathAsDirectory0(path) : t1; + }, + _tryPathWithExtensions0(path) { + var result = A._tryPath0(path + ".sass"); + B.JSArray_methods.addAll$1(result, A._tryPath0(path + ".scss")); + return result.length !== 0 ? result : A._tryPath0(path + ".css"); + }, + _tryPath0(path) { + var t1 = $.$get$context(), + partial = A.join(t1.dirname$1(path), "_" + A.ParsedPath_ParsedPath$parse(path, t1.style).get$basename(), null); + t1 = A._setArrayType([], type$.JSArray_String); + if (A.fileExists0(partial)) + t1.push(partial); + if (A.fileExists0(path)) + t1.push(path); + return t1; + }, + _tryPathAsDirectory0(path) { + var t1; + if (!A.dirExists0(path)) + return null; + t1 = A.fromImport0() ? new A._tryPathAsDirectory_closure0(path).call$0() : null; + return t1 == null ? A._exactlyOne0(A._tryPathWithExtensions0(A.join(path, "index", null))) : t1; + }, + _exactlyOne0(paths) { + var _0_1, t1, path; + $label0$0: { + _0_1 = paths.length; + if (_0_1 <= 0) { + t1 = null; + break $label0$0; + } + if (_0_1 === 1) { + path = paths[0]; + t1 = path; + break $label0$0; + } + t1 = A.throwExpression(string$.It_s_n + B.JSArray_methods.map$1$1(paths, new A._exactlyOne_closure0(), type$.String).join$1(0, "\n")); + } + return t1; + }, + resolveImportPath_closure1: function resolveImportPath_closure1(t0, t1) { + this.path = t0; + this.extension = t1; + }, + resolveImportPath_closure2: function resolveImportPath_closure2(t0) { + this.path = t0; + }, + _tryPathAsDirectory_closure0: function _tryPathAsDirectory_closure0(t0) { + this.path = t0; + }, + _exactlyOne_closure0: function _exactlyOne_closure0() { + }, + jsThrow(error) { + return type$.Never._as($.$get$_jsThrow().call$1(error)); + }, + attachJsStack(error, trace) { + var traceString = trace.toString$0(0), + firstRealLine = B.JSString_methods.indexOf$1(traceString, "\n at"); + if (firstRealLine !== -1) + traceString = B.JSString_methods.substring$1(traceString, firstRealLine + 1); + error.stack = "Error: " + A.S(J.get$message$x(error)) + "\n" + traceString; + }, + jsForEach(object, callback) { + var t1, t2; + for (t1 = J.get$iterator$ax(self.Object.keys(object)); t1.moveNext$0();) { + t2 = t1.get$current(t1); + callback.call$2(t2, object[t2]); + } + }, + jsType(value) { + var typeOf = A._asString(new self.Function("value", "return typeof value").call$1(value)); + return typeOf !== "object" ? typeOf : A._asString(new self.Function("value", ' if (value && value.constructor && value.constructor.name) {\n return value.constructor.name;\n }\n return "object";\n ').call$1(value)); + }, + defineGetter(object, $name, get, value) { + self.Object.defineProperty(object, $name, get == null ? {value: value, enumerable: false} : {get: A.allowInteropCaptureThis(get), enumerable: false}); + }, + allowInteropNamed($name, $function) { + $function = A.allowInterop($function); + A.defineGetter($function, "name", null, $name); + A._hideDartProperties($function); + return $function; + }, + allowInteropCaptureThisNamed($name, $function) { + $function = A.allowInteropCaptureThis($function); + A.defineGetter($function, "name", null, $name); + A._hideDartProperties($function); + return $function; + }, + _hideDartProperties(object) { + var t1, t2, t3, t4; + for (t1 = J.cast$1$0$ax(self.Object.getOwnPropertyNames(object), type$.String), t2 = A._instanceType(t1), t1 = new A.ListIterator(t1, t1.get$length(t1), t2._eval$1("ListIterator")), t2 = t2._eval$1("ListBase.E"); t1.moveNext$0();) { + t3 = t1.__internal$_current; + if (t3 == null) + t3 = t2._as(t3); + if (B.JSString_methods.startsWith$1(t3, "_")) { + t4 = {value: object[t3], enumerable: false}; + self.Object.defineProperty(object, t3, t4); + } + } + }, + futureToPromise0(future) { + return new self.Promise(A.allowInterop(new A.futureToPromise_closure0(future))); + }, + jsToDartUrl(url) { + return A.Uri_parse(J.toString$0$(url)); + }, + dartToJSUrl(url) { + return new self.URL(url.toString$0(0)); + }, + toJSArray(iterable) { + var t1, t2, + array = new self.Array(); + for (t1 = J.get$iterator$ax(iterable), t2 = J.getInterceptor$x(array); t1.moveNext$0();) + t2.push$1(array, t1.get$current(t1)); + return array; + }, + objectToMap(object) { + var map = A.LinkedHashMap_LinkedHashMap$_empty(type$.String, type$.nullable_Object); + A.jsForEach(object, new A.objectToMap_closure(map)); + return map; + }, + jsToDartSeparator(separator) { + var t1; + $label0$0: { + if (" " === separator) { + t1 = B.ListSeparator_EVt0; + break $label0$0; + } + if ("," === separator) { + t1 = B.ListSeparator_rXA0; + break $label0$0; + } + if ("/" === separator) { + t1 = B.ListSeparator_zg90; + break $label0$0; + } + if (separator == null) { + t1 = B.ListSeparator_undecided_null_undecided0; + break $label0$0; + } + t1 = A.jsThrow(new self.Error('Unknown separator "' + separator + '".')); + } + return t1; + }, + parseSyntax(syntax) { + var t1; + $label0$0: { + if (syntax == null || "scss" === syntax) { + t1 = B.Syntax_SCSS_scss0; + break $label0$0; + } + if ("indented" === syntax) { + t1 = B.Syntax_Sass_sass0; + break $label0$0; + } + if ("css" === syntax) { + t1 = B.Syntax_CSS_css0; + break $label0$0; + } + t1 = A.jsThrow(new self.Error('Unknown syntax "' + A.S(syntax) + '".')); + } + return t1; + }, + entrypointFilename() { + var _1_0, _1_5, t2, _1_5_isSet, path, + t1 = self.require.main, + _0_0 = t1 == null ? null : J.get$filename$x(t1); + if (_0_0 != null) + return _0_0; + else { + _1_0 = J.get$argv$x(self.process); + t1 = J.getInterceptor$asx(_1_0); + if (t1.get$length(_1_0) >= 2) { + _1_5 = t1.$index(_1_0, 1); + t2 = typeof _1_5 == "string"; + _1_5_isSet = true; + } else { + _1_5 = null; + _1_5_isSet = false; + t2 = false; + } + if (t2) { + path = A._asString(_1_5_isSet ? _1_5 : t1.$index(_1_0, 1)); + return J.resolve$1$x(J.createRequire$1$x(self.nodeModule, path), path); + } else + return null; + } + }, + _PropertyDescriptor0: function _PropertyDescriptor0() { + }, + futureToPromise_closure0: function futureToPromise_closure0(t0) { + this.future = t0; + }, + futureToPromise__closure0: function futureToPromise__closure0(t0) { + this.resolve = t0; + }, + futureToPromise__closure1: function futureToPromise__closure1(t0) { + this.reject = t0; + }, + objectToMap_closure: function objectToMap_closure(t0) { + this.map = t0; + }, + _RequireMain0: function _RequireMain0() { + }, + toSentence0(iter, conjunction) { + if (iter.get$length(iter) === 1) + return J.toString$0$(iter.get$first(iter)); + return A.IterableExtension_get_exceptLast0(iter).join$1(0, ", ") + (" " + conjunction + " " + A.S(iter.get$last(iter))); + }, + indent0(string, indentation) { + return new A.MappedListIterable(A._setArrayType(string.split("\n"), type$.JSArray_String), new A.indent_closure0(indentation), type$.MappedListIterable_String_String).join$1(0, "\n"); + }, + pluralize0($name, number, plural) { + if (number === 1) + return $name; + if (plural != null) + return plural; + return $name + "s"; + }, + trimAscii0(string, excludeEscape) { + var t1, + start = A._firstNonWhitespace0(string); + if (start == null) + t1 = ""; + else { + t1 = A._lastNonWhitespace0(string, true); + t1.toString; + t1 = B.JSString_methods.substring$2(string, start, t1 + 1); + } + return t1; + }, + trimAsciiRight0(string, excludeEscape) { + var end = A._lastNonWhitespace0(string, excludeEscape); + return end == null ? "" : B.JSString_methods.substring$2(string, 0, end + 1); + }, + _firstNonWhitespace0(string) { + var t1, i, t2; + for (t1 = string.length, i = 0; i < t1; ++i) { + t2 = string.charCodeAt(i); + if (!(t2 === 32 || t2 === 9 || t2 === 10 || t2 === 13 || t2 === 12)) + return i; + } + return null; + }, + _lastNonWhitespace0(string, excludeEscape) { + var i, i0, codeUnit; + for (i = string.length - 1, i0 = i; i0 >= 0; --i0) { + codeUnit = string.charCodeAt(i0); + if (!(codeUnit === 32 || codeUnit === 9 || codeUnit === 10 || codeUnit === 13 || codeUnit === 12)) + if (excludeEscape && i0 !== 0 && i0 !== i && codeUnit === 92) + return i0 + 1; + else + return i0; + } + return null; + }, + isPublic0(member) { + var start = member.charCodeAt(0); + return start !== 45 && start !== 95; + }, + flattenVertically0(iterable, $T) { + var result, + t1 = iterable.$ti._eval$1("@")._bind$1($T._eval$1("QueueList<0>"))._eval$1("MappedListIterable<1,2>"), + queues = A.List_List$of(new A.MappedListIterable(iterable, new A.flattenVertically_closure1($T), t1), true, t1._eval$1("ListIterable.E")); + if (queues.length === 1) + return B.JSArray_methods.get$first(queues); + result = A._setArrayType([], $T._eval$1("JSArray<0>")); + for (; queues.length !== 0;) { + if (!!queues.fixed$length) + A.throwExpression(A.UnsupportedError$("removeWhere")); + B.JSArray_methods._removeWhere$2(queues, new A.flattenVertically_closure2(result, $T), true); + } + return result; + }, + codepointIndexToCodeUnitIndex0(string, codepointIndex) { + var codeUnitIndex, i, codeUnitIndex0; + for (codeUnitIndex = 0, i = 0; i < codepointIndex; ++i) { + codeUnitIndex0 = codeUnitIndex + 1; + codeUnitIndex = string.charCodeAt(codeUnitIndex) >>> 10 === 54 ? codeUnitIndex0 + 1 : codeUnitIndex0; + } + return codeUnitIndex; + }, + codeUnitIndexToCodepointIndex0(string, codeUnitIndex) { + var codepointIndex, i; + for (codepointIndex = 0, i = 0; i < codeUnitIndex; i = (string.charCodeAt(i) >>> 10 === 54 ? i + 1 : i) + 1) + ++codepointIndex; + return codepointIndex; + }, + frameForSpan0(span, member, url) { + var t2, t3, + t1 = url == null ? span.get$sourceUrl(span) : url; + if (t1 == null) + t1 = $.$get$_noSourceUrl0(); + t2 = span.get$start(span); + t2 = t2.file.getLine$1(t2.offset); + t3 = span.get$start(span); + return new A.Frame(t1, t2 + 1, t3.file.getColumn$1(t3.offset) + 1, member); + }, + declarationName0(span) { + var text = A.String_String$fromCharCodes(B.NativeUint32List_methods.sublist$2(span.file._decodedChars, span._file$_start, span._end), 0, null); + return A.trimAsciiRight0(B.JSString_methods.substring$2(text, 0, B.JSString_methods.indexOf$1(text, ":")), false); + }, + unvendor0($name) { + var i, + t1 = $name.length; + if (t1 < 2) + return $name; + if ($name.charCodeAt(0) !== 45) + return $name; + if ($name.charCodeAt(1) === 45) + return $name; + for (i = 2; i < t1; ++i) + if ($name.charCodeAt(i) === 45) + return B.JSString_methods.substring$1($name, i + 1); + return $name; + }, + equalsIgnoreCase0(string1, string2) { + var t1, i; + if (string1 === string2) + return true; + if (string1 == null || false) + return false; + t1 = string1.length; + if (t1 !== string2.length) + return false; + for (i = 0; i < t1; ++i) + if (!A.characterEqualsIgnoreCase0(string1.charCodeAt(i), string2.charCodeAt(i))) + return false; + return true; + }, + startsWithIgnoreCase0(string, prefix) { + var i, + t1 = prefix.length; + if (string.length < t1) + return false; + for (i = 0; i < t1; ++i) + if (!A.characterEqualsIgnoreCase0(string.charCodeAt(i), prefix.charCodeAt(i))) + return false; + return true; + }, + mapInPlace0(list, $function) { + var i; + for (i = 0; i < list.length; ++i) + list[i] = $function.call$1(list[i]); + }, + longestCommonSubsequence0(list1, list2, select, $T) { + var t1, _i, selections, i, i0, j, selection, j0, + _length = list1.get$length(0) + 1, + lengths = J.JSArray_JSArray$allocateFixed(_length, type$.List_int); + for (t1 = type$.int, _i = 0; _i < _length; ++_i) + lengths[_i] = A.List_List$filled(((list2._queue_list$_tail - list2._queue_list$_head & J.get$length$asx(list2._queue_list$_table) - 1) >>> 0) + 1, 0, false, t1); + _length = list1.get$length(0); + selections = J.JSArray_JSArray$allocateFixed(_length, $T._eval$1("List<0?>")); + for (t1 = $T._eval$1("0?"), _i = 0; _i < _length; ++_i) + selections[_i] = A.List_List$filled((list2._queue_list$_tail - list2._queue_list$_head & J.get$length$asx(list2._queue_list$_table) - 1) >>> 0, null, false, t1); + for (i = 0; i < (list1._queue_list$_tail - list1._queue_list$_head & J.get$length$asx(list1._queue_list$_table) - 1) >>> 0; i = i0) + for (i0 = i + 1, j = 0; j < (list2._queue_list$_tail - list2._queue_list$_head & J.get$length$asx(list2._queue_list$_table) - 1) >>> 0; j = j0) { + selection = select.call$2(list1.$index(0, i), list2.$index(0, j)); + selections[i][j] = selection; + t1 = lengths[i0]; + j0 = j + 1; + t1[j0] = selection == null ? Math.max(t1[j], lengths[i][j0]) : lengths[i][j] + 1; + } + return new A.longestCommonSubsequence_backtrack0(selections, lengths, $T).call$2(list1.get$length(0) - 1, list2.get$length(0) - 1); + }, + removeFirstWhere0(list, test, orElse) { + var i; + for (i = 0; i < list.length; ++i) { + if (!test.call$1(list[i])) + continue; + B.JSArray_methods.removeAt$1(list, i); + return; + } + orElse.call$0(); + }, + mapAddAll20(destination, source, K1, K2, $V) { + source.forEach$1(0, new A.mapAddAll2_closure0(destination, K1, K2, $V)); + }, + setAll0(map, keys, value) { + var t1; + for (t1 = J.get$iterator$ax(keys); t1.moveNext$0();) + map.$indexSet(0, t1.get$current(t1), value); + }, + rotateSlice0(list, start, end) { + var i, next, + element = list.$index(0, end - 1); + for (i = start; i < end; ++i, element = next) { + next = list.$index(0, i); + list.$indexSet(0, i, element); + } + }, + mapAsync0(iterable, callback, $E, $F) { + return A.mapAsync$body0(iterable, callback, $E, $F, $F._eval$1("Iterable<0>")); + }, + mapAsync$body0(iterable, callback, $E, $F, $async$type) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter($async$type), + $async$returnValue, t2, _i, t1, $async$temp1; + var $async$mapAsync0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = A._setArrayType([], $F._eval$1("JSArray<0>")); + t2 = iterable.length, _i = 0; + case 3: + // for condition + if (!(_i < t2)) { + // goto after for + $async$goto = 5; + break; + } + $async$temp1 = t1; + $async$goto = 6; + return A._asyncAwait(callback.call$1(iterable[_i]), $async$mapAsync0); + case 6: + // returning from await. + $async$temp1.push($async$result); + case 4: + // for update + ++_i; + // goto for condition + $async$goto = 3; + break; + case 5: + // after for + $async$returnValue = t1; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$mapAsync0, $async$completer); + }, + putIfAbsentAsync0(map, key, ifAbsent, $K, $V) { + return A.putIfAbsentAsync$body0(map, key, ifAbsent, $K, $V, $V); + }, + putIfAbsentAsync$body0(map, key, ifAbsent, $K, $V, $async$type) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter($async$type), + $async$returnValue, t1, value; + var $async$putIfAbsentAsync0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + if (map.containsKey$1(key)) { + t1 = map.$index(0, key); + $async$returnValue = t1 == null ? $V._as(t1) : t1; + // goto return + $async$goto = 1; + break; + } + $async$goto = 3; + return A._asyncAwait(ifAbsent.call$0(), $async$putIfAbsentAsync0); + case 3: + // returning from await. + value = $async$result; + map.$indexSet(0, key, value); + $async$returnValue = value; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$putIfAbsentAsync0, $async$completer); + }, + copyMapOfMap0(map, K1, K2, $V) { + var t3, key, child, + t1 = K2._eval$1("@<0>")._bind$1($V)._eval$1("Map<1,2>"), + t2 = A.LinkedHashMap_LinkedHashMap$_empty(K1, t1); + for (t1 = A.MapExtensions_get_pairs0(map, K1, t1), t1 = t1.get$iterator(t1); t1.moveNext$0();) { + t3 = t1.get$current(t1); + key = t3._0; + child = t3._1; + t3 = A.LinkedHashMap_LinkedHashMap(null, null, null, K2, $V); + t3.addAll$1(0, child); + t2.$indexSet(0, key, t3); + } + return t2; + }, + copyMapOfList0(map, $K, $E) { + var t3, + t1 = $E._eval$1("List<0>"), + t2 = A.LinkedHashMap_LinkedHashMap$_empty($K, t1); + for (t1 = A.MapExtensions_get_pairs0(map, $K, t1), t1 = t1.get$iterator(t1); t1.moveNext$0();) { + t3 = t1.get$current(t1); + t2.$indexSet(0, t3._0, J.toList$0$ax(t3._1)); + } + return t2; + }, + consumeEscapedCharacter0(scanner) { + var _1_0, value, i, next, t1; + scanner.expectChar$1(92); + _1_0 = scanner.peekChar$0(); + if (_1_0 == null) + return 65533; + if (_1_0 === 10 || _1_0 === 13 || _1_0 === 12) + scanner.error$1(0, "Expected escape sequence."); + if (A.CharacterExtension_get_isHex0(_1_0)) { + for (value = 0, i = 0; i < 6; ++i) { + next = scanner.peekChar$0(); + if (next != null) { + if (!(next >= 48 && next <= 57)) + if (!(next >= 97 && next <= 102)) + t1 = next >= 65 && next <= 70; + else + t1 = true; + else + t1 = true; + t1 = !t1; + } else + t1 = true; + if (t1) + break; + value = (value << 4 >>> 0) + A.asHex0(scanner.readChar$0()); + } + t1 = scanner.peekChar$0(); + if (t1 === 32 || t1 === 9 || t1 === 10 || t1 === 13 || t1 === 12) + scanner.readChar$0(); + $label0$1: { + if (0 !== value) + t1 = value >= 55296 && value <= 57343 || value >= 1114111; + else + t1 = true; + if (t1) { + t1 = 65533; + break $label0$1; + } + t1 = value; + break $label0$1; + } + return t1; + } + return scanner.readChar$0(); + }, + throwWithTrace0(error, originalError, trace) { + var t1 = A.getTrace0(originalError); + A.attachTrace0(error, t1 == null ? trace : t1); + throw A.wrapException(error); + }, + attachTrace0(error, trace) { + var t1; + if (typeof error == "string" || typeof error == "number" || A._isBool(error)) + return; + if (trace.toString$0(0).length === 0) + return; + t1 = $.$get$_traces0(); + A.Expando__checkType(error); + if (t1._jsWeakMap.get(error) == null) + t1.$indexSet(0, error, trace); + }, + getTrace0(error) { + var t1; + if (typeof error == "string" || typeof error == "number" || A._isBool(error)) + t1 = null; + else { + t1 = $.$get$_traces0(); + A.Expando__checkType(error); + t1 = t1._jsWeakMap.get(error); + } + return t1; + }, + parseSignature(signature, requireParens) { + var error, stackTrace, t1, exception, t2; + try { + t1 = A.ScssParser$0(signature, null, null).parseSignature$1$requireParens(requireParens); + return t1; + } catch (exception) { + t1 = A.unwrapException(exception); + if (type$.SassFormatException_2._is(t1)) { + error = t1; + stackTrace = A.getTraceFromException(exception); + t1 = error._span_exception$_message; + t2 = J.get$span$z(error); + A.throwWithTrace0(new A.SassFormatException0(B.Set_empty, 'Invalid signature "' + signature + '": ' + t1, t2), error, stackTrace); + } else + throw exception; + } + }, + indent_closure0: function indent_closure0(t0) { + this.indentation = t0; + }, + flattenVertically_closure1: function flattenVertically_closure1(t0) { + this.T = t0; + }, + flattenVertically_closure2: function flattenVertically_closure2(t0, t1) { + this.result = t0; + this.T = t1; + }, + longestCommonSubsequence_backtrack0: function longestCommonSubsequence_backtrack0(t0, t1, t2) { + this.selections = t0; + this.lengths = t1; + this.T = t2; + }, + mapAddAll2_closure0: function mapAddAll2_closure0(t0, t1, t2, t3) { + var _ = this; + _.destination = t0; + _.K1 = t1; + _.K2 = t2; + _.V = t3; + }, + CssValue0: function CssValue0(t0, t1, t2) { + this.value = t0; + this.span = t1; + this.$ti = t2; + }, + ValueExpression0: function ValueExpression0(t0, t1) { + this.value = t0; + this.span = t1; + }, + valueClass_closure: function valueClass_closure() { + }, + valueClass__closure: function valueClass__closure() { + }, + valueClass__closure0: function valueClass__closure0() { + }, + valueClass__closure1: function valueClass__closure1() { + }, + valueClass__closure2: function valueClass__closure2() { + }, + valueClass__closure3: function valueClass__closure3() { + }, + valueClass__closure4: function valueClass__closure4() { + }, + valueClass__closure5: function valueClass__closure5() { + }, + valueClass__closure6: function valueClass__closure6() { + }, + valueClass__closure7: function valueClass__closure7() { + }, + valueClass__closure8: function valueClass__closure8() { + }, + valueClass__closure9: function valueClass__closure9() { + }, + valueClass__closure10: function valueClass__closure10() { + }, + valueClass__closure11: function valueClass__closure11() { + }, + valueClass__closure12: function valueClass__closure12() { + }, + valueClass__closure13: function valueClass__closure13() { + }, + valueClass__closure14: function valueClass__closure14() { + }, + valueClass__closure15: function valueClass__closure15() { + }, + valueClass__closure16: function valueClass__closure16() { + }, + valueClass__closure17: function valueClass__closure17() { + }, + valueClass__closure18: function valueClass__closure18() { + }, + SassApiValue_assertSelector0(_this, allowParent, $name) { + var error, stackTrace, t1, exception, + string = _this._value$_selectorString$1($name); + try { + t1 = A.SelectorList_SelectorList$parse0(string, allowParent, true, null, null); + return t1; + } catch (exception) { + t1 = A.unwrapException(exception); + if (type$.SassFormatException_2._is(t1)) { + error = t1; + stackTrace = A.getTraceFromException(exception); + t1 = B.JSString_methods.replaceFirst$2(J.toString$0$(error), "Error: ", ""); + A.throwWithTrace0(new A.SassScriptException0($name == null ? t1 : "$" + $name + ": " + t1), error, stackTrace); + } else + throw exception; + } + }, + SassApiValue_assertCompoundSelector0(_this, $name) { + var error, stackTrace, t1, exception, + allowParent = false, + string = _this._value$_selectorString$1($name); + try { + t1 = A.SelectorParser$0(string, allowParent, true, null, null, null).parseCompoundSelector$0(); + return t1; + } catch (exception) { + t1 = A.unwrapException(exception); + if (type$.SassFormatException_2._is(t1)) { + error = t1; + stackTrace = A.getTraceFromException(exception); + t1 = B.JSString_methods.replaceFirst$2(J.toString$0$(error), "Error: ", ""); + A.throwWithTrace0(new A.SassScriptException0("$" + $name + ": " + t1), error, stackTrace); + } else + throw exception; + } + }, + Value0: function Value0() { + }, + VariableExpression0: function VariableExpression0(t0, t1, t2) { + this.namespace = t0; + this.name = t1; + this.span = t2; + }, + VariableDeclaration$0($name, expression, span, comment, global, guarded, namespace) { + if (namespace != null && global) + A.throwExpression(A.ArgumentError$(string$.Other_, null)); + return new A.VariableDeclaration0(namespace, $name, expression, guarded, global, span); + }, + VariableDeclaration0: function VariableDeclaration0(t0, t1, t2, t3, t4, t5) { + var _ = this; + _.namespace = t0; + _.name = t1; + _.expression = t2; + _.isGuarded = t3; + _.isGlobal = t4; + _.span = t5; + }, + WarnRule0: function WarnRule0(t0, t1) { + this.expression = t0; + this.span = t1; + }, + WhileRule$0(condition, children, span) { + var t1 = A.List_List$unmodifiable(children, type$.Statement_2), + t2 = B.JSArray_methods.any$1(t1, new A.ParentStatement_closure0()); + return new A.WhileRule0(condition, span, t1, t2); + }, + WhileRule0: function WhileRule0(t0, t1, t2, t3) { + var _ = this; + _.condition = t0; + _.span = t1; + _.children = t2; + _.hasDeclarations = t3; + }, + AsyncCallable_AsyncCallable$fromSignature(signature, callback, requireParens) { + var _0_0 = A.parseSignature(signature, requireParens); + return new A.AsyncBuiltInCallable0(_0_0._0, _0_0._1, callback, false); + }, + Callable_Callable$fromSignature(signature, callback, requireParens) { + var _0_0 = A.parseSignature(signature, requireParens); + return new A.BuiltInCallable0(_0_0._0, A._setArrayType([new A._Record_2(_0_0._1, callback)], type$.JSArray_Record_2_ArgumentDeclaration_and_Value_Function_List_Value_2), false); + }, + printString(string) { + if (typeof dartPrint == "function") { + dartPrint(string); + return; + } + if (typeof console == "object" && typeof console.log != "undefined") { + console.log(string); + return; + } + if (typeof print == "function") { + print(string); + return; + } + throw "Unable to print message: " + String(string); + }, + mergeMaps(map1, map2, $K, $V) { + var result = A.LinkedHashMap_LinkedHashMap$of(map1, $K, $V); + result.addAll$1(0, map2); + return result; + }, + groupBy(values, key, $S, $T) { + var t1, t2, _i, element, t3, t4, + map = A.LinkedHashMap_LinkedHashMap$_empty($T, $S._eval$1("List<0>")); + for (t1 = values.length, t2 = $S._eval$1("JSArray<0>"), _i = 0; _i < values.length; values.length === t1 || (0, A.throwConcurrentModificationError)(values), ++_i) { + element = values[_i]; + t3 = key.call$1(element); + t4 = map.$index(0, t3); + if (t4 == null) { + t4 = A._setArrayType([], t2); + map.$indexSet(0, t3, t4); + t3 = t4; + } else + t3 = t4; + J.add$1$ax(t3, element); + } + return map; + }, + minBy(values, orderBy) { + var t1, t2, minValue, minOrderBy, element, elementOrderBy; + for (t1 = values.$ti, t1 = t1._eval$1("@<1>")._bind$1(t1._rest[1]), t2 = new A.MappedIterator(J.get$iterator$ax(values.__internal$_iterable), values._f, t1._eval$1("MappedIterator<1,2>")), t1 = t1._rest[1], minValue = null, minOrderBy = null; t2.moveNext$0();) { + element = t2.__internal$_current; + if (element == null) + element = t1._as(element); + elementOrderBy = orderBy.call$1(element); + if (minOrderBy == null || A.defaultCompare(elementOrderBy, minOrderBy) < 0) { + minOrderBy = elementOrderBy; + minValue = element; + } + } + return minValue; + }, + IterableExtension_firstWhereOrNull(_this, test) { + var t1, element; + for (t1 = J.get$iterator$ax(_this); t1.moveNext$0();) { + element = t1.get$current(t1); + if (test.call$1(element)) + return element; + } + return null; + }, + IterableExtension_get_firstOrNull(_this) { + var iterator = J.get$iterator$ax(_this); + if (iterator.moveNext$0()) + return iterator.get$current(iterator); + return null; + }, + IterableExtension_get_lastOrNull(_this) { + if (_this.get$length(0) === 0) + return null; + return _this.get$last(_this); + }, + IterableExtension_get_singleOrNull(_this) { + var result, + iterator = J.get$iterator$ax(_this); + if (iterator.moveNext$0()) { + result = iterator.get$current(iterator); + if (!iterator.moveNext$0()) + return result; + } + return null; + }, + IterableNullableExtension_whereNotNull(_this, $T) { + return new A._SyncStarIterable(A.IterableNullableExtension_whereNotNull$body(_this, $T), $T._eval$1("_SyncStarIterable<0>")); + }, + IterableNullableExtension_whereNotNull$body($async$_this, $async$$T) { + return function() { + var _this = $async$_this, + $T = $async$$T; + var $async$goto = 0, $async$handler = 1, $async$currentError, t1, element; + return function $async$IterableNullableExtension_whereNotNull($async$iterator, $async$errorCode, $async$result) { + if ($async$errorCode === 1) { + $async$currentError = $async$result; + $async$goto = $async$handler; + } + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = J.get$iterator$ax(_this); + case 2: + // for condition + if (!t1.moveNext$0()) { + // goto after for + $async$goto = 3; + break; + } + element = t1.get$current(t1); + $async$goto = element != null ? 4 : 5; + break; + case 4: + // then + $async$goto = 6; + return $async$iterator._async$_current = element, 1; + case 6: + // after yield + case 5: + // join + // goto for condition + $async$goto = 2; + break; + case 3: + // after for + // implicit return + return 0; + case 1: + // rethrow + return $async$iterator._datum = $async$currentError, 3; + } + }; + }; + }, + IterableIntegerExtension_get_maxOrNull(_this) { + var value, newValue, + t1 = _this.$ti, + iterator = new A.ListIterator(_this, _this.get$length(0), t1._eval$1("ListIterator")); + if (iterator.moveNext$0()) { + value = iterator.__internal$_current; + if (value == null) + value = t1._eval$1("ListIterable.E")._as(value); + for (t1 = t1._eval$1("ListIterable.E"); iterator.moveNext$0();) { + newValue = iterator.__internal$_current; + if (newValue == null) + newValue = t1._as(newValue); + if (newValue > value) + value = newValue; + } + return value; + } + return null; + }, + IterableIntegerExtension_get_max(_this) { + var t1 = A.IterableIntegerExtension_get_maxOrNull(_this); + return t1 == null ? A.throwExpression(A.StateError$("No element")) : t1; + }, + IterableIntegerExtension_get_sum(_this) { + var t1, t2, result, t3; + for (t1 = _this.$ti, t1 = t1._eval$1("@<1>")._bind$1(t1._rest[1]), t2 = new A.MappedIterator(J.get$iterator$ax(_this.__internal$_iterable), _this._f, t1._eval$1("MappedIterator<1,2>")), t1 = t1._rest[1], result = 0; t2.moveNext$0();) { + t3 = t2.__internal$_current; + result += t3 == null ? t1._as(t3) : t3; + } + return result; + }, + ListExtensions_mapIndexed(_this, convert, $E, $R) { + return new A._SyncStarIterable(A.ListExtensions_mapIndexed$body(_this, convert, $E, $R), $R._eval$1("_SyncStarIterable<0>")); + }, + ListExtensions_mapIndexed$body($async$_this, $async$convert, $async$$E, $async$$R) { + return function() { + var _this = $async$_this, + convert = $async$convert, + $E = $async$$E, + $R = $async$$R; + var $async$goto = 0, $async$handler = 1, $async$currentError, t1, index; + return function $async$ListExtensions_mapIndexed($async$iterator, $async$errorCode, $async$result) { + if ($async$errorCode === 1) { + $async$currentError = $async$result; + $async$goto = $async$handler; + } + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = _this.length, index = 0; + case 2: + // for condition + if (!(index < t1)) { + // goto after for + $async$goto = 4; + break; + } + $async$goto = 5; + return $async$iterator._async$_current = convert.call$2(index, _this[index]), 1; + case 5: + // after yield + case 3: + // for update + ++index; + // goto for condition + $async$goto = 2; + break; + case 4: + // after for + // implicit return + return 0; + case 1: + // rethrow + return $async$iterator._datum = $async$currentError, 3; + } + }; + }; + }, + ListExtensions_elementAtOrNull(_this, index) { + var t1 = J.getInterceptor$asx(_this); + return index < t1.get$length(_this) ? t1.$index(_this, index) : null; + }, + defaultCompare(value1, value2) { + return J.compareTo$1$ns(type$.Comparable_nullable_Object._as(value1), value2); + }, + current() { + var exception, t1, path, lastIndex, uri = null; + try { + uri = A.Uri_base(); + } catch (exception) { + if (type$.Exception._is(A.unwrapException(exception))) { + t1 = $._current; + if (t1 != null) + return t1; + throw exception; + } else + throw exception; + } + if (J.$eq$(uri, $._currentUriBase)) { + t1 = $._current; + t1.toString; + return t1; + } + $._currentUriBase = uri; + if ($.$get$Style_platform() === $.$get$Style_url()) + t1 = $._current = J.resolve$1$x(uri, ".").toString$0(0); + else { + path = uri.toFilePath$0(); + lastIndex = path.length - 1; + t1 = $._current = lastIndex === 0 ? path : B.JSString_methods.substring$2(path, 0, lastIndex); + } + return t1; + }, + absolute(part1, part2, part3, part4, part5, part6, part7, part8, part9, part10, part11, part12, part13, part14, part15) { + return $.$get$context().absolute$15(part1, part2, part3, part4, part5, part6, part7, part8, part9, part10, part11, part12, part13, part14, part15); + }, + join(part1, part2, part3) { + var _null = null; + return $.$get$context().join$16(0, part1, part2, part3, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null); + }, + prettyUri(uri) { + var t1 = $.$get$context(); + uri.toString; + return t1.prettyUri$1(uri); + }, + isAlphabetic(char) { + var t1; + if (!(char >= 65 && char <= 90)) + t1 = char >= 97 && char <= 122; + else + t1 = true; + return t1; + }, + driveLetterEnd(path, index) { + var t2, t3, _null = null, + t1 = path.length, + index0 = index + 2; + if (t1 < index0) + return _null; + if (!A.isAlphabetic(path.charCodeAt(index))) + return _null; + t2 = index + 1; + if (path.charCodeAt(t2) !== 58) { + t3 = index + 4; + if (t1 < t3) + return _null; + if (B.JSString_methods.substring$2(path, t2, t3).toLowerCase() !== "%3a") + return _null; + index = index0; + } + t2 = index + 2; + if (t1 === t2) + return t2; + if (path.charCodeAt(t2) !== 47) + return _null; + return index + 3; + }, + main0(args) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void), + t1; + var $async$main0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + A.printError("sass --embedded is unavailable in pure JS mode."); + t1 = A.isNodeJs() ? self.process : null; + if (t1 != null) + J.set$exitCode$x(t1, 1); + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$main0, $async$completer); + }, + EvaluationContext_current() { + var _0_0 = $.Zone__current.$index(0, B.Symbol__evaluationContext); + if (type$.EvaluationContext._is(_0_0)) + return _0_0; + else + throw A.wrapException(A.StateError$(string$.No_Sass)); + }, + compileStylesheets(options, graph, sourcesToDestinations, ifModified) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.bool), + $async$returnValue, t2, _1_4, source, t3, _i, t4, printedError, errorWithStackTrace, code, error, stackTrace, buffer, t1, $async$temp1; + var $async$compileStylesheets = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = type$.nullable_String; + t1 = A.List_List$of(A.MapExtensions_get_pairs(sourcesToDestinations, t1, t1), true, type$.Record_2_nullable_String_and_nullable_String); + t2 = t1.length; + $async$goto = t2 === 1 ? 4 : 5; + break; + case 4: + // then + _1_4 = t1[0]; + source = _1_4._0; + $async$temp1 = A; + $async$goto = 6; + return A._asyncAwait(A.compileStylesheet(options, graph, source, _1_4._1, ifModified), $async$compileStylesheets); + case 6: + // returning from await. + t1 = $async$temp1._setArrayType([$async$result], type$.JSArray_nullable_Record_3_int_and_String_and_nullable_String); + // goto break $label0$0 + $async$goto = 3; + break; + case 5: + // join + t3 = A._setArrayType([], type$.JSArray_Future_nullable_Record_3_int_and_String_and_nullable_String); + for (_i = 0; _i < t2; ++_i) { + t4 = t1[_i]; + t3.push(A.compileStylesheet(options, graph, t4._0, t4._1, ifModified)); + } + $async$goto = 7; + return A._asyncAwait(A.Future_wait(t3, A._asBool(options._options.$index(0, "stop-on-error")), type$.nullable_Record_3_int_and_String_and_nullable_String), $async$compileStylesheets); + case 7: + // returning from await. + t1 = $async$result; + // goto break $label0$0 + $async$goto = 3; + break; + case 3: + // break $label0$0 + for (t1 = J.get$iterator$ax(t1), printedError = false; t1.moveNext$0();) { + errorWithStackTrace = t1.get$current(t1); + if (errorWithStackTrace == null) + continue; + code = errorWithStackTrace._0; + error = errorWithStackTrace._1; + stackTrace = errorWithStackTrace._2; + t2 = self.process; + if (t2 == null) + t2 = null; + else { + t2 = J.get$release$x(t2); + t2 = t2 == null ? null : J.get$name$x(t2); + } + t2 = J.$eq$(t2, "node") ? self.process : null; + t2 = t2 == null ? null : J.get$exitCode$x(t2); + if (t2 == null) + t2 = 0; + t2 = Math.max(t2, code); + t3 = self.process; + if (t3 == null) + t3 = null; + else { + t3 = J.get$release$x(t3); + t3 = t3 == null ? null : J.get$name$x(t3); + } + t3 = J.$eq$(t3, "node") ? self.process : null; + if (t3 != null) + J.set$exitCode$x(t3, t2); + buffer = new A.StringBuffer(""); + t2 = (printedError ? buffer._contents = "" + "\n" : "") + error; + buffer._contents = t2; + if (stackTrace != null) { + t2 += "\n"; + buffer._contents = t2; + t2 += "\n"; + buffer._contents = t2; + buffer._contents = t2 + stackTrace; + } + A.printError(buffer); + printedError = true; + } + $async$returnValue = !printedError; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$compileStylesheets, $async$completer); + }, + repl(options) { + return A.repl$body(options); + }, + repl$body(options) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void), + $async$handler = 1, $async$currentError, $async$next = [], repl, logger, evaluator, line, declaration, error, stackTrace, t4, t5, t6, t7, t8, line0, toZone, exception, t1, t2, t3, repl0; + var $async$repl = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) { + $async$currentError = $async$result; + $async$goto = $async$handler; + } + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = A._setArrayType([], type$.JSArray_String); + t2 = B.JSString_methods.$mul(" ", 3); + t3 = $.$get$alwaysValid(); + repl0 = new A.Repl(">> ", t2, t3, t1); + repl0.__Repl__adapter_A = new A.ReplAdapter(repl0); + repl = repl0; + t1 = options._options; + logger = new A.TrackingLogger(A._asBool(t1.$index(0, "quiet")) ? $.$get$Logger_quiet() : new A.StderrLogger(options.get$color())); + t2 = $.$get$FilesystemImporter_cwd(); + evaluator = new A.Evaluator(A._EvaluateVisitor$(null, A.ImportCache$(options.get$pkgImporters(), type$.List_String._as(t1.$index(0, "load-path")), logger), logger, null, false, false), t2); + t2 = repl.__Repl__adapter_A; + t2 === $ && A.throwUnnamedLateFieldNI(); + t2 = new A._StreamIterator(A.checkNotNullable(t2.runAsync$0(), "stream", type$.Object)); + $async$handler = 2; + t1 = type$.Expression, t3 = type$.String, t4 = type$.VariableDeclaration; + case 5: + // for condition + $async$goto = 7; + return A._asyncAwait(t2.moveNext$0(), $async$repl); + case 7: + // returning from await. + if (!$async$result) { + // goto after for + $async$goto = 6; + break; + } + line = t2.get$current(0); + if (J.trim$0$s(line).length === 0) { + // goto for condition + $async$goto = 5; + break; + } + try { + if (J.startsWith$1$s(line, "@")) { + t5 = evaluator; + t6 = logger; + t7 = A.SpanScanner$(line, null); + if (t6 == null) + t6 = B.StderrLogger_false; + t6 = new A.ScssParser(A.LinkedHashMap_LinkedHashMap$_empty(t3, t4), t7, t6, null).parseUseRule$0(); + t5._visitor.runStatement$2(t5._importer, t6); + // goto for condition + $async$goto = 5; + break; + } + t5 = A.SpanScanner$(line, null); + if (new A.Parser(t5, B.StderrLogger_false, null)._isVariableDeclarationLike$0()) { + t5 = logger; + t6 = A.SpanScanner$(line, null); + if (t5 == null) + t5 = B.StderrLogger_false; + declaration = new A.ScssParser(A.LinkedHashMap_LinkedHashMap$_empty(t3, t4), t6, t5, null).parseVariableDeclaration$0(); + t5 = evaluator; + t5._visitor.runStatement$2(t5._importer, declaration); + t5 = evaluator; + t6 = declaration.name; + t7 = declaration.span; + t8 = declaration.namespace; + line0 = t5._visitor.runExpression$2(t5._importer, new A.VariableExpression(t8, t6, t7)).toString$0(0); + toZone = $.printToZone; + if (toZone == null) + A.printString(line0); + else + toZone.call$1(line0); + } else { + t5 = evaluator; + t6 = logger; + t7 = A.SpanScanner$(line, null); + if (t6 == null) + t6 = B.StderrLogger_false; + t6 = new A.ScssParser(A.LinkedHashMap_LinkedHashMap$_empty(t3, t4), t7, t6, null); + t6 = t6._parseSingleProduction$1$1(t6.get$_expression(), t1); + line0 = t5._visitor.runExpression$2(t5._importer, t6).toString$0(0); + toZone = $.printToZone; + if (toZone == null) + A.printString(line0); + else + toZone.call$1(line0); + } + } catch (exception) { + t5 = A.unwrapException(exception); + if (t5 instanceof A.SassException) { + error = t5; + stackTrace = A.getTraceFromException(exception); + t5 = error; + t6 = typeof t5 != "string"; + if (!t6 || typeof t5 == "number" || A._isBool(t5)) + t5 = null; + else { + t7 = $.$get$_traces(); + if (A._isBool(t5) || typeof t5 == "number" || !t6 || t5 instanceof A._Record) + A.Expando__badExpandoKey(t5); + t5 = t7._jsWeakMap.get(t5); + } + if (t5 == null) + t5 = stackTrace; + A._logError(error, t5, line, repl, options, logger); + } else + throw exception; + } + // goto for condition + $async$goto = 5; + break; + case 6: + // after for + $async$next.push(4); + // goto finally + $async$goto = 3; + break; + case 2: + // uncaught + $async$next = [1]; + case 3: + // finally + $async$handler = 1; + $async$goto = 8; + return A._asyncAwait(t2.cancel$0(), $async$repl); + case 8: + // returning from await. + // goto the next finally handler + $async$goto = $async$next.pop(); + break; + case 4: + // after finally + // implicit return + return A._asyncReturn(null, $async$completer); + case 1: + // rethrow + return A._asyncRethrow($async$currentError, $async$completer); + } + }); + return A._asyncStartSync($async$repl, $async$completer); + }, + _logError(error, stackTrace, line, repl, options, logger) { + var t2, spacesBeforeError, t3, + t1 = A.SourceSpanException.prototype.get$span.call(error, 0); + if (t1.get$sourceUrl(t1) == null) + if (!A._asBool(options._options.$index(0, "quiet"))) + t1 = logger._emittedDebug || logger._emittedWarning; + else + t1 = false; + else + t1 = true; + if (t1) { + A.print(error.toString$1$color(0, options.get$color())); + return; + } + t1 = options.get$color() ? "" + "\x1b[31m" : ""; + t2 = A.SourceSpanException.prototype.get$span.call(error, 0); + t2 = t2.get$start(t2); + spacesBeforeError = repl.prompt.length + t2.file.getColumn$1(t2.offset); + if (options.get$color()) { + t2 = A.SourceSpanException.prototype.get$span.call(error, 0); + t2 = t2.get$start(t2); + t2 = t2.file.getColumn$1(t2.offset) < line.length; + } else + t2 = false; + if (t2) + t1 = t1 + ("\x1b[1F\x1b[" + spacesBeforeError + "C") + (A.SourceSpanException.prototype.get$span.call(error, 0).get$text() + "\n"); + t2 = B.JSString_methods.$mul(" ", spacesBeforeError); + t3 = A.SourceSpanException.prototype.get$span.call(error, 0); + t3 = t1 + t2 + (B.JSString_methods.$mul("^", Math.max(1, t3.get$length(t3))) + "\n"); + t1 = options.get$color() ? t3 + "\x1b[0m" : t3; + t1 += "Error: " + error._span_exception$_message + "\n"; + if (A._asBool(options._options.$index(0, "trace"))) + t1 += A.Trace_Trace$from(stackTrace).get$terse().toString$0(0); + A.print(B.JSString_methods.trimRight$0(t1.charCodeAt(0) == 0 ? t1 : t1)); + }, + CharacterExtension_get_isAlphabetic(_this) { + var t1; + if (!(_this >= 97 && _this <= 122)) + t1 = _this >= 65 && _this <= 90; + else + t1 = true; + return t1; + }, + CharacterExtension_get_isHex(_this) { + var t1; + if (!(_this >= 48 && _this <= 57)) + if (!(_this >= 97 && _this <= 102)) + t1 = _this >= 65 && _this <= 70; + else + t1 = true; + else + t1 = true; + return t1; + }, + asHex(character) { + var t1; + $label0$0: { + if (character <= 57) { + t1 = character - 48; + break $label0$0; + } + if (character <= 70) { + t1 = 10 + character - 65; + break $label0$0; + } + t1 = 10 + character - 97; + break $label0$0; + } + return t1; + }, + hexCharFor(number) { + return number < 10 ? 48 + number : 87 + number; + }, + opposite(character) { + var t1; + $label0$0: { + if (40 === character) { + t1 = 41; + break $label0$0; + } + if (123 === character) { + t1 = 125; + break $label0$0; + } + if (91 === character) { + t1 = 93; + break $label0$0; + } + t1 = A.throwExpression(A.ArgumentError$('"' + A.String_String$fromCharCode(character) + "\" isn't a brace-like character.", null)); + } + return t1; + }, + characterEqualsIgnoreCase(character1, character2) { + var upperCase1; + if (character1 === character2) + return true; + if ((character1 ^ character2) >>> 0 !== 32) + return false; + upperCase1 = (character1 & 4294967263) >>> 0; + return upperCase1 >= 65 && upperCase1 <= 90; + }, + IterableExtension_search(_this, callback) { + var t1, _0_0; + for (t1 = J.get$iterator$ax(_this); t1.moveNext$0();) { + _0_0 = callback.call$1(t1.get$current(t1)); + if (_0_0 != null) + return _0_0; + } + return null; + }, + IterableExtension_get_exceptLast(_this) { + var t1 = J.getInterceptor$asx(_this), + size = t1.get$length(_this) - 1; + if (size < 0) + throw A.wrapException(A.StateError$("Iterable may not be empty")); + return t1.take$1(_this, size); + }, + NullableExtension_andThen(_this, fn) { + return _this == null ? null : fn.call$1(_this); + }, + SetExtension_removeNull(_this, $T) { + _this.remove$1(0, null); + return A.Set_castFrom(_this, _this.get$_newSimilarSet(), A._instanceType(_this)._precomputed1, $T); + }, + fuzzyEquals(number1, number2) { + var t1; + if (number1 === number2) + return true; + if (Math.abs(number1 - number2) <= $.$get$_epsilon()) { + t1 = $.$get$_inverseEpsilon(); + t1 = B.JSNumber_methods.round$0(number1 * t1) === B.JSNumber_methods.round$0(number2 * t1); + } else + t1 = false; + return t1; + }, + fuzzyHashCode(number) { + if (!isFinite(number)) + return B.JSNumber_methods.get$hashCode(number); + return B.JSInt_methods.get$hashCode(B.JSNumber_methods.round$0(number * $.$get$_inverseEpsilon())); + }, + fuzzyLessThan(number1, number2) { + return number1 < number2 && !A.fuzzyEquals(number1, number2); + }, + fuzzyLessThanOrEquals(number1, number2) { + return number1 < number2 || A.fuzzyEquals(number1, number2); + }, + fuzzyGreaterThan(number1, number2) { + return number1 > number2 && !A.fuzzyEquals(number1, number2); + }, + fuzzyGreaterThanOrEquals(number1, number2) { + return number1 > number2 || A.fuzzyEquals(number1, number2); + }, + fuzzyAsInt(number) { + var rounded; + if (number == 1 / 0 || number == -1 / 0 || isNaN(number)) + return null; + rounded = B.JSNumber_methods.round$0(number); + return A.fuzzyEquals(number, rounded) ? rounded : null; + }, + fuzzyRound(number) { + var t1; + if (number > 0) { + t1 = B.JSNumber_methods.$mod(number, 1); + return t1 < 0.5 && !A.fuzzyEquals(t1, 0.5) ? B.JSNumber_methods.floor$0(number) : B.JSNumber_methods.ceil$0(number); + } else { + t1 = B.JSNumber_methods.$mod(number, 1); + return t1 < 0.5 || A.fuzzyEquals(t1, 0.5) ? B.JSNumber_methods.floor$0(number) : B.JSNumber_methods.ceil$0(number); + } + }, + fuzzyCheckRange(number, min, max) { + if (A.fuzzyEquals(number, min)) + return min; + if (A.fuzzyEquals(number, max)) + return max; + if (number > min && number < max) + return number; + return null; + }, + fuzzyAssertRange(number, min, max, $name) { + var result = A.fuzzyCheckRange(number, min, max); + if (result != null) + return result; + throw A.wrapException(A.RangeError$range(number, min, max, $name, "must be between " + min + " and " + max)); + }, + moduloLikeSass(num1, num2) { + var result; + if (num1 == 1 / 0 || num1 == -1 / 0) + return 0 / 0; + if (num2 == 1 / 0 || num2 == -1 / 0) + return A.DoubleWithSignedZero_get_signIncludingZero(num1) === J.get$sign$in(num2) ? num1 : 0 / 0; + if (num2 > 0) + return B.JSNumber_methods.$mod(num1, num2); + if (num2 === 0) + return 0 / 0; + result = B.JSNumber_methods.$mod(num1, num2); + return result === 0 ? 0 : result + num2; + }, + sqrt(number) { + number.assertNoUnits$1("number"); + return A.SassNumber_SassNumber(Math.sqrt(number._number$_value), null); + }, + sin(number) { + return A.SassNumber_SassNumber(Math.sin(number.coerceValueToUnit$2("rad", "number")), null); + }, + cos(number) { + return A.SassNumber_SassNumber(Math.cos(number.coerceValueToUnit$2("rad", "number")), null); + }, + tan(number) { + return A.SassNumber_SassNumber(Math.tan(number.coerceValueToUnit$2("rad", "number")), null); + }, + atan(number) { + number.assertNoUnits$1("number"); + return A.SassNumber_SassNumber$withUnits(Math.atan(number._number$_value) * 57.29577951308232, null, A._setArrayType(["deg"], type$.JSArray_String)); + }, + asin(number) { + number.assertNoUnits$1("number"); + return A.SassNumber_SassNumber$withUnits(Math.asin(number._number$_value) * 57.29577951308232, null, A._setArrayType(["deg"], type$.JSArray_String)); + }, + acos(number) { + number.assertNoUnits$1("number"); + return A.SassNumber_SassNumber$withUnits(Math.acos(number._number$_value) * 57.29577951308232, null, A._setArrayType(["deg"], type$.JSArray_String)); + }, + log(number, base) { + if (base != null) + return A.SassNumber_SassNumber(Math.log(number._number$_value) / Math.log(base._number$_value), null); + return A.SassNumber_SassNumber(Math.log(number._number$_value), null); + }, + pow0(base, exponent) { + base.assertNoUnits$1("base"); + exponent.assertNoUnits$1("exponent"); + return A.SassNumber_SassNumber(Math.pow(base._number$_value, exponent._number$_value), null); + }, + DoubleWithSignedZero_get_signIncludingZero(_this) { + if (_this === -0.0) + return -1; + if (_this === 0) + return 1; + return J.get$sign$in(_this); + }, + SpanExtensions_trimLeft(_this) { + var t5, + t1 = _this._file$_start, + t2 = _this._end, + t3 = _this.file._decodedChars, + t4 = t3.length, + start = 0; + while (true) { + t5 = A.String_String$fromCharCodes(new Uint32Array(t3.subarray(t1, A._checkValidRange(t1, t2, t4))), 0, null).charCodeAt(start); + if (!(t5 === 32 || t5 === 9 || t5 === 10 || t5 === 13 || t5 === 12)) + break; + ++start; + } + return A.FileSpanExtension_subspan(_this, start, null); + }, + SpanExtensions_trimRight(_this) { + var t1, + end = _this.get$text().length - 1; + while (true) { + t1 = _this.get$text().charCodeAt(end); + if (!(t1 === 32 || t1 === 9 || t1 === 10 || t1 === 13 || t1 === 12)) + break; + --end; + } + return A.FileSpanExtension_subspan(_this, 0, end + 1); + }, + encodeVlq(value) { + var res, signBit, digit, t1; + if (value < $.$get$minInt32() || value > $.$get$maxInt32()) + throw A.wrapException(A.ArgumentError$("expected 32 bit int, got: " + value, null)); + res = A._setArrayType([], type$.JSArray_String); + if (value < 0) { + value = -value; + signBit = 1; + } else + signBit = 0; + value = value << 1 | signBit; + do { + digit = value & 31; + value = value >>> 5; + t1 = value > 0; + res.push(string$.ABCDEF[t1 ? digit | 32 : digit]); + } while (t1); + return res; + }, + isAllTheSame(iter) { + var firstValue, t1, t2, value; + if (iter.get$length(0) === 0) + return true; + firstValue = iter.get$first(0); + for (t1 = A.SubListIterable$(iter, 1, null, iter.$ti._eval$1("ListIterable.E")), t2 = t1.$ti, t1 = new A.ListIterator(t1, t1.get$length(0), t2._eval$1("ListIterator")), t2 = t2._eval$1("ListIterable.E"); t1.moveNext$0();) { + value = t1.__internal$_current; + if (!J.$eq$(value == null ? t2._as(value) : value, firstValue)) + return false; + } + return true; + }, + replaceFirstNull(list, element) { + var index = B.JSArray_methods.indexOf$1(list, null); + if (index < 0) + throw A.wrapException(A.ArgumentError$(A.S(list) + " contains no null elements.", null)); + list[index] = element; + }, + replaceWithNull(list, element) { + var index = B.JSArray_methods.indexOf$1(list, element); + if (index < 0) + throw A.wrapException(A.ArgumentError$(A.S(list) + " contains no elements matching " + element.toString$0(0) + ".", null)); + list[index] = null; + }, + countCodeUnits(string, codeUnit) { + var t1, t2, count, t3; + for (t1 = new A.CodeUnits(string), t2 = type$.CodeUnits, t1 = new A.ListIterator(t1, t1.get$length(0), t2._eval$1("ListIterator")), t2 = t2._eval$1("ListBase.E"), count = 0; t1.moveNext$0();) { + t3 = t1.__internal$_current; + if ((t3 == null ? t2._as(t3) : t3) === codeUnit) + ++count; + } + return count; + }, + findLineStart(context, text, column) { + var beginningOfLine, index, lineStart; + if (text.length === 0) + for (beginningOfLine = 0; true;) { + index = B.JSString_methods.indexOf$2(context, "\n", beginningOfLine); + if (index === -1) + return context.length - beginningOfLine >= column ? beginningOfLine : null; + if (index - beginningOfLine >= column) + return beginningOfLine; + beginningOfLine = index + 1; + } + index = B.JSString_methods.indexOf$1(context, text); + for (; index !== -1;) { + lineStart = index === 0 ? 0 : B.JSString_methods.lastIndexOf$2(context, "\n", index - 1) + 1; + if (column === index - lineStart) + return lineStart; + index = B.JSString_methods.indexOf$2(context, text, index + 1); + } + return null; + }, + validateErrorArgs(string, match, position, $length) { + var t2, + t1 = position != null; + if (t1) + if (position < 0) + throw A.wrapException(A.RangeError$("position must be greater than or equal to 0.")); + else if (position > string.length) + throw A.wrapException(A.RangeError$("position must be less than or equal to the string length.")); + t2 = $length != null; + if (t2 && $length < 0) + throw A.wrapException(A.RangeError$("length must be greater than or equal to 0.")); + if (t1 && t2 && position + $length > string.length) + throw A.wrapException(A.RangeError$("position plus length must not go beyond the end of the string.")); + }, + CharacterExtension_get_isAlphabetic0(_this) { + var t1; + if (!(_this >= 97 && _this <= 122)) + t1 = _this >= 65 && _this <= 90; + else + t1 = true; + return t1; + }, + CharacterExtension_get_isHex0(_this) { + var t1; + if (!(_this >= 48 && _this <= 57)) + if (!(_this >= 97 && _this <= 102)) + t1 = _this >= 65 && _this <= 70; + else + t1 = true; + else + t1 = true; + return t1; + }, + asHex0(character) { + var t1; + $label0$0: { + if (character <= 57) { + t1 = character - 48; + break $label0$0; + } + if (character <= 70) { + t1 = 10 + character - 65; + break $label0$0; + } + t1 = 10 + character - 97; + break $label0$0; + } + return t1; + }, + hexCharFor0(number) { + return number < 10 ? 48 + number : 87 + number; + }, + opposite0(character) { + var t1; + $label0$0: { + if (40 === character) { + t1 = 41; + break $label0$0; + } + if (123 === character) { + t1 = 125; + break $label0$0; + } + if (91 === character) { + t1 = 93; + break $label0$0; + } + t1 = A.throwExpression(A.ArgumentError$('"' + A.String_String$fromCharCode(character) + "\" isn't a brace-like character.", null)); + } + return t1; + }, + characterEqualsIgnoreCase0(character1, character2) { + var upperCase1; + if (character1 === character2) + return true; + if ((character1 ^ character2) >>> 0 !== 32) + return false; + upperCase1 = (character1 & 4294967263) >>> 0; + return upperCase1 >= 65 && upperCase1 <= 90; + }, + EvaluationContext_current0() { + var _0_0 = $.Zone__current.$index(0, B.Symbol__evaluationContext); + if (type$.EvaluationContext_2._is(_0_0)) + return _0_0; + else + throw A.wrapException(A.StateError$(string$.No_Sass)); + }, + IterableExtension_search0(_this, callback) { + var t1, _0_0; + for (t1 = J.get$iterator$ax(_this); t1.moveNext$0();) { + _0_0 = callback.call$1(t1.get$current(t1)); + if (_0_0 != null) + return _0_0; + } + return null; + }, + IterableExtension_get_exceptLast0(_this) { + var t1 = J.getInterceptor$asx(_this), + size = t1.get$length(_this) - 1; + if (size < 0) + throw A.wrapException(A.StateError$("Iterable may not be empty")); + return t1.take$1(_this, size); + }, + NullableExtension_andThen0(_this, fn) { + return _this == null ? null : fn.call$1(_this); + }, + fuzzyEquals0(number1, number2) { + var t1; + if (number1 === number2) + return true; + if (Math.abs(number1 - number2) <= $.$get$_epsilon0()) { + t1 = $.$get$_inverseEpsilon0(); + t1 = B.JSNumber_methods.round$0(number1 * t1) === B.JSNumber_methods.round$0(number2 * t1); + } else + t1 = false; + return t1; + }, + fuzzyHashCode0(number) { + if (!isFinite(number)) + return B.JSNumber_methods.get$hashCode(number); + return B.JSInt_methods.get$hashCode(B.JSNumber_methods.round$0(number * $.$get$_inverseEpsilon0())); + }, + fuzzyLessThan0(number1, number2) { + return number1 < number2 && !A.fuzzyEquals0(number1, number2); + }, + fuzzyLessThanOrEquals0(number1, number2) { + return number1 < number2 || A.fuzzyEquals0(number1, number2); + }, + fuzzyGreaterThan0(number1, number2) { + return number1 > number2 && !A.fuzzyEquals0(number1, number2); + }, + fuzzyGreaterThanOrEquals0(number1, number2) { + return number1 > number2 || A.fuzzyEquals0(number1, number2); + }, + fuzzyIsInt(number) { + if (number == 1 / 0 || number == -1 / 0 || isNaN(number)) + return false; + return A.fuzzyEquals0(number, B.JSNumber_methods.round$0(number)); + }, + fuzzyAsInt0(number) { + var rounded; + if (number == 1 / 0 || number == -1 / 0 || isNaN(number)) + return null; + rounded = B.JSNumber_methods.round$0(number); + return A.fuzzyEquals0(number, rounded) ? rounded : null; + }, + fuzzyRound0(number) { + var t1; + if (number > 0) { + t1 = B.JSNumber_methods.$mod(number, 1); + return t1 < 0.5 && !A.fuzzyEquals0(t1, 0.5) ? B.JSNumber_methods.floor$0(number) : B.JSNumber_methods.ceil$0(number); + } else { + t1 = B.JSNumber_methods.$mod(number, 1); + return t1 < 0.5 || A.fuzzyEquals0(t1, 0.5) ? B.JSNumber_methods.floor$0(number) : B.JSNumber_methods.ceil$0(number); + } + }, + fuzzyCheckRange0(number, min, max) { + if (A.fuzzyEquals0(number, min)) + return min; + if (A.fuzzyEquals0(number, max)) + return max; + if (number > min && number < max) + return number; + return null; + }, + fuzzyAssertRange0(number, min, max, $name) { + var result = A.fuzzyCheckRange0(number, min, max); + if (result != null) + return result; + throw A.wrapException(A.RangeError$range(number, min, max, $name, "must be between " + min + " and " + max)); + }, + moduloLikeSass0(num1, num2) { + var result; + if (num1 == 1 / 0 || num1 == -1 / 0) + return 0 / 0; + if (num2 == 1 / 0 || num2 == -1 / 0) + return A.DoubleWithSignedZero_get_signIncludingZero0(num1) === J.get$sign$in(num2) ? num1 : 0 / 0; + if (num2 > 0) + return B.JSNumber_methods.$mod(num1, num2); + if (num2 === 0) + return 0 / 0; + result = B.JSNumber_methods.$mod(num1, num2); + return result === 0 ? 0 : result + num2; + }, + sqrt0(number) { + number.assertNoUnits$1("number"); + return A.SassNumber_SassNumber0(Math.sqrt(number._number1$_value), null); + }, + sin0(number) { + return A.SassNumber_SassNumber0(Math.sin(number.coerceValueToUnit$2("rad", "number")), null); + }, + cos0(number) { + return A.SassNumber_SassNumber0(Math.cos(number.coerceValueToUnit$2("rad", "number")), null); + }, + tan0(number) { + return A.SassNumber_SassNumber0(Math.tan(number.coerceValueToUnit$2("rad", "number")), null); + }, + atan0(number) { + number.assertNoUnits$1("number"); + return A.SassNumber_SassNumber$withUnits0(Math.atan(number._number1$_value) * 57.29577951308232, null, A._setArrayType(["deg"], type$.JSArray_String)); + }, + asin0(number) { + number.assertNoUnits$1("number"); + return A.SassNumber_SassNumber$withUnits0(Math.asin(number._number1$_value) * 57.29577951308232, null, A._setArrayType(["deg"], type$.JSArray_String)); + }, + acos0(number) { + number.assertNoUnits$1("number"); + return A.SassNumber_SassNumber$withUnits0(Math.acos(number._number1$_value) * 57.29577951308232, null, A._setArrayType(["deg"], type$.JSArray_String)); + }, + log0(number, base) { + if (base != null) + return A.SassNumber_SassNumber0(Math.log(number._number1$_value) / Math.log(base._number1$_value), null); + return A.SassNumber_SassNumber0(Math.log(number._number1$_value), null); + }, + pow1(base, exponent) { + base.assertNoUnits$1("base"); + exponent.assertNoUnits$1("exponent"); + return A.SassNumber_SassNumber0(Math.pow(base._number1$_value, exponent._number1$_value), null); + }, + DoubleWithSignedZero_get_signIncludingZero0(_this) { + if (_this === -0.0) + return -1; + if (_this === 0) + return 1; + return J.get$sign$in(_this); + }, + main1(args) { + return A.main$body(args); + }, + main$body(args) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void), + $async$returnValue, $async$handler = 2, $async$currentError, options, graph, error, error0, stackTrace, buffer, t1, t2, t3, t4, exception, $async$exception, $async$temp1; + var $async$main1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) { + $async$currentError = $async$result; + $async$goto = $async$handler; + } + while (true) + switch ($async$goto) { + case 0: + // Function start + if (args.length >= 1 && "--embedded" === args[0]) { + A.main0(B.JSArray_methods.sublist$1(args, 1)); + // goto return + $async$goto = 1; + break; + } + options = null; + $async$handler = 4; + options = A.ExecutableOptions_ExecutableOptions$parse(args); + t1 = options._options; + $._glyphs = !(t1.wasParsed$1("unicode") ? A._asBool(t1.$index(0, "unicode")) : $._glyphs !== B.C_AsciiGlyphSet) ? B.C_AsciiGlyphSet : B.C_UnicodeGlyphSet; + $async$goto = A._asBool(options._options.$index(0, "version")) ? 7 : 8; + break; + case 7: + // then + $async$temp1 = A; + $async$goto = 9; + return A._asyncAwait(A._loadVersion(), $async$main1); + case 9: + // returning from await. + $async$temp1.print($async$result); + t1 = A.isNodeJs() ? self.process : null; + if (t1 != null) + J.set$exitCode$x(t1, 0); + // goto return + $async$goto = 1; + break; + case 8: + // join + $async$goto = options.get$interactive() ? 10 : 11; + break; + case 10: + // then + $async$goto = 12; + return A._asyncAwait(A.repl(options), $async$main1); + case 12: + // returning from await. + // goto return + $async$goto = 1; + break; + case 11: + // join + t1 = options.get$pkgImporters(); + t2 = type$.List_String._as(options._options.$index(0, "load-path")); + t3 = options; + t3 = A._asBool(t3._options.$index(0, "quiet")) ? $.$get$Logger_quiet() : new A.StderrLogger(t3.get$color()); + t4 = type$.Uri; + graph = new A.StylesheetGraph(A.LinkedHashMap_LinkedHashMap$_empty(t4, type$.StylesheetNode), A.ImportCache$(t1, t2, new A.DeprecationHandlingLogger(A.LinkedHashMap_LinkedHashMap$_empty(type$.Deprecation, type$.int), t3, options.get$fatalDeprecations(), options.get$futureDeprecations(), false)), A.LinkedHashMap_LinkedHashMap$_empty(t4, type$.DateTime)); + $async$goto = A._asBool(options._options.$index(0, "watch")) ? 13 : 14; + break; + case 13: + // then + $async$goto = 15; + return A._asyncAwait(A.watch(options, graph), $async$main1); + case 15: + // returning from await. + // goto return + $async$goto = 1; + break; + case 14: + // join + t1 = options; + t2 = options; + t2._ensureSources$0(); + t2 = t2._sourcesToDestinations; + t2.toString; + $async$goto = 16; + return A._asyncAwait(A.compileStylesheets(t1, graph, t2, A._asBool(options._options.$index(0, "update"))), $async$main1); + case 16: + // returning from await. + $async$handler = 2; + // goto after finally + $async$goto = 6; + break; + case 4: + // catch + $async$handler = 3; + $async$exception = $async$currentError; + t1 = A.unwrapException($async$exception); + if (t1 instanceof A.UsageException) { + error = t1; + A.print(error.message + "\n"); + A.print("Usage: sass [output.css]\n sass : : \n"); + t1 = $.$get$ExecutableOptions__parser(); + A.print(new A._Usage(t1._optionsAndSeparators, new A.StringBuffer(""), t1.usageLineLength).generate$0()); + t1 = A.isNodeJs() ? self.process : null; + if (t1 != null) + J.set$exitCode$x(t1, 64); + } else { + error0 = t1; + stackTrace = A.getTraceFromException($async$exception); + buffer = new A.StringBuffer(""); + t1 = options; + t1 = t1 == null ? null : t1.get$color(); + if (t1 === true) + buffer._contents += "\x1b[31m\x1b[1m"; + buffer._contents += "Unexpected exception:"; + t1 = options; + t1 = t1 == null ? null : t1.get$color(); + if (t1 === true) + buffer._contents += "\x1b[0m"; + buffer._contents += "\n"; + buffer._contents += A.S(error0) + "\n"; + buffer._contents += "\n"; + buffer._contents += "\n"; + t1 = A.getTrace(error0); + buffer._contents += B.JSString_methods.trimRight$0(A.Trace_Trace$from(t1 == null ? stackTrace : t1).get$terse().toString$0(0)); + A.printError(buffer); + t1 = A.isNodeJs() ? self.process : null; + if (t1 != null) + J.set$exitCode$x(t1, 255); + } + // goto after finally + $async$goto = 6; + break; + case 3: + // uncaught + // goto rethrow + $async$goto = 2; + break; + case 6: + // after finally + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + case 2: + // rethrow + return A._asyncRethrow($async$currentError, $async$completer); + } + }); + return A._asyncStartSync($async$main1, $async$completer); + }, + _loadVersion() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.String), + $async$returnValue; + var $async$_loadVersion = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$returnValue = "1.72.0 compiled with dart2js 3.3.1"; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$_loadVersion, $async$completer); + }, + SpanExtensions_trimLeft0(_this) { + var t5, + t1 = _this._file$_start, + t2 = _this._end, + t3 = _this.file._decodedChars, + t4 = t3.length, + start = 0; + while (true) { + t5 = A.String_String$fromCharCodes(new Uint32Array(t3.subarray(t1, A._checkValidRange(t1, t2, t4))), 0, null).charCodeAt(start); + if (!(t5 === 32 || t5 === 9 || t5 === 10 || t5 === 13 || t5 === 12)) + break; + ++start; + } + return A.FileSpanExtension_subspan(_this, start, null); + }, + SpanExtensions_trimRight0(_this) { + var t1, + end = _this.get$text().length - 1; + while (true) { + t1 = _this.get$text().charCodeAt(end); + if (!(t1 === 32 || t1 === 9 || t1 === 10 || t1 === 13 || t1 === 12)) + break; + --end; + } + return A.FileSpanExtension_subspan(_this, 0, end + 1); + }, + validateUrlScheme(scheme) { + var t1 = $.$get$_urlSchemeRegExp(); + if (!t1._nativeRegExp.test(scheme)) + A.jsThrow(new self.Error('"' + scheme + '" isn\'t a valid URL scheme (for example "file").')); + }, + unwrapValue(object) { + var value; + if (object != null) { + if (object instanceof A.Value0) + return object; + value = object.dartValue; + if (value != null && value instanceof A.Value0) + return value; + if (object instanceof self.Error) + throw A.wrapException(object); + } + throw A.wrapException(A.S(object) + " must be a Sass value type."); + }, + wrapValue(value) { + var t1; + $label0$0: { + if (value instanceof A.SassColor0) { + t1 = A.callConstructor($.$get$legacyColorClass(), [null, null, null, null, value]); + break $label0$0; + } + if (value instanceof A.SassList0) { + t1 = A.callConstructor($.$get$legacyListClass(), [null, null, value]); + break $label0$0; + } + if (value instanceof A.SassMap0) { + t1 = A.callConstructor($.$get$legacyMapClass(), [null, value]); + break $label0$0; + } + if (value instanceof A.SassNumber0) { + t1 = A.callConstructor($.$get$legacyNumberClass(), [null, null, value]); + break $label0$0; + } + if (value instanceof A.SassString0) { + t1 = A.callConstructor($.$get$legacyStringClass(), [null, value]); + break $label0$0; + } + t1 = value; + break $label0$0; + } + return t1; + } + }, + B = {}; + var holders = [A, J, B]; + var $ = {}; + A.JS_CONST.prototype = {}; + J.Interceptor.prototype = { + $eq(receiver, other) { + return receiver === other; + }, + get$hashCode(receiver) { + return A.Primitives_objectHashCode(receiver); + }, + toString$0(receiver) { + return "Instance of '" + A.Primitives_objectTypeName(receiver) + "'"; + }, + noSuchMethod$1(receiver, invocation) { + throw A.wrapException(A.NoSuchMethodError_NoSuchMethodError$withInvocation(receiver, invocation)); + }, + get$runtimeType(receiver) { + return A.createRuntimeType(A._instanceTypeFromConstructor(this)); + } + }; + J.JSBool.prototype = { + toString$0(receiver) { + return String(receiver); + }, + get$hashCode(receiver) { + return receiver ? 519018 : 218159; + }, + get$runtimeType(receiver) { + return A.createRuntimeType(type$.bool); + }, + $isTrustedGetRuntimeType: 1, + $isbool: 1 + }; + J.JSNull.prototype = { + $eq(receiver, other) { + return null == other; + }, + toString$0(receiver) { + return "null"; + }, + get$hashCode(receiver) { + return 0; + }, + get$runtimeType(receiver) { + return A.createRuntimeType(type$.Null); + }, + $isTrustedGetRuntimeType: 1, + $isNull: 1 + }; + J.JavaScriptObject.prototype = {}; + J.LegacyJavaScriptObject.prototype = { + get$hashCode(receiver) { + return 0; + }, + toString$0(receiver) { + return String(receiver); + }, + $isPromise: 1, + $isJsSystemError: 1, + $isImmutableList: 1, + $is_Channels: 1, + $is_NodeSassColor: 1, + $isCompileOptions: 1, + $isCompileStringOptions: 1, + $isNodeCompileResult: 1, + $is_NodeException: 1, + $isFiber: 1, + $isJSFunction0: 1, + $isImmutableList0: 1, + $isImmutableMap0: 1, + $isJSImporter: 1, + $isJSImporterResult: 1, + $isNodeImporterResult0: 1, + $is_ConstructorOptions: 1, + $is_NodeSassList: 1, + $isWarnOptions: 1, + $isDebugOptions: 1, + $is_NodeSassMap: 1, + $is_ConstructorOptions0: 1, + $is_NodeSassNumber: 1, + $isJSClass0: 1, + $isRenderContextOptions0: 1, + $isRenderOptions: 1, + $isRenderResult: 1, + $is_ConstructorOptions1: 1, + $is_NodeSassString: 1, + $isJSUrl0: 1, + get$isTTY(obj) { + return obj.isTTY; + }, + get$write(obj) { + return obj.write; + }, + write$1(receiver, p0) { + return receiver.write(p0); + }, + createInterface$1(receiver, p0) { + return receiver.createInterface(p0); + }, + on$2(receiver, p0, p1) { + return receiver.on(p0, p1); + }, + get$close(obj) { + return obj.close; + }, + close$0(receiver) { + return receiver.close(); + }, + setPrompt$1(receiver, p0) { + return receiver.setPrompt(p0); + }, + get$length(obj) { + return obj.length; + }, + toString$0(receiver) { + return receiver.toString(); + }, + get$debug(obj) { + return obj.debug; + }, + debug$2(receiver, p0, p1) { + return receiver.debug(p0, p1); + }, + get$error(obj) { + return obj.error; + }, + error$1(receiver, p0) { + return receiver.error(p0); + }, + error$2(receiver, p0, p1) { + return receiver.error(p0, p1); + }, + log$1(receiver, p0) { + return receiver.log(p0); + }, + get$warn(obj) { + return obj.warn; + }, + warn$1(receiver, p0) { + return receiver.warn(p0); + }, + warn$2(receiver, p0, p1) { + return receiver.warn(p0, p1); + }, + existsSync$1(receiver, p0) { + return receiver.existsSync(p0); + }, + mkdirSync$1(receiver, p0) { + return receiver.mkdirSync(p0); + }, + readdirSync$1(receiver, p0) { + return receiver.readdirSync(p0); + }, + readFileSync$2(receiver, p0, p1) { + return receiver.readFileSync(p0, p1); + }, + statSync$1(receiver, p0) { + return receiver.statSync(p0); + }, + unlinkSync$1(receiver, p0) { + return receiver.unlinkSync(p0); + }, + watch$2(receiver, p0, p1) { + return receiver.watch(p0, p1); + }, + writeFileSync$2(receiver, p0, p1) { + return receiver.writeFileSync(p0, p1); + }, + get$path(obj) { + return obj.path; + }, + isDirectory$0(receiver) { + return receiver.isDirectory(); + }, + isFile$0(receiver) { + return receiver.isFile(); + }, + get$mtime(obj) { + return obj.mtime; + }, + then$1$1(receiver, p0) { + return receiver.then(p0); + }, + then$2(receiver, p0, p1) { + return receiver.then(p0, p1); + }, + getTime$0(receiver) { + return receiver.getTime(); + }, + get$message(obj) { + return obj.message; + }, + message$1(receiver, p0) { + return receiver.message(p0); + }, + get$filename(obj) { + return obj.filename; + }, + get$code(obj) { + return obj.code; + }, + get$syscall(obj) { + return obj.syscall; + }, + get$argv(obj) { + return obj.argv; + }, + get$env(obj) { + return obj.env; + }, + get$exitCode(obj) { + return obj.exitCode; + }, + set$exitCode(obj, v) { + return obj.exitCode = v; + }, + get$platform(obj) { + return obj.platform; + }, + get$release(obj) { + return obj.release; + }, + get$stderr(obj) { + return obj.stderr; + }, + get$stdin(obj) { + return obj.stdin; + }, + get$stdout(obj) { + return obj.stdout; + }, + get$name(obj) { + return obj.name; + }, + push$1(receiver, p0) { + return receiver.push(p0); + }, + call$0(receiver) { + return receiver.call(); + }, + call$1(receiver, p0) { + return receiver.call(p0); + }, + call$2(receiver, p0, p1) { + return receiver.call(p0, p1); + }, + call$3$1(receiver, p0) { + return receiver.call(p0); + }, + call$2$1(receiver, p0) { + return receiver.call(p0); + }, + call$1$1(receiver, p0) { + return receiver.call(p0); + }, + call$3(receiver, p0, p1, p2) { + return receiver.call(p0, p1, p2); + }, + call$3$3(receiver, p0, p1, p2) { + return receiver.call(p0, p1, p2); + }, + call$2$2(receiver, p0, p1) { + return receiver.call(p0, p1); + }, + call$2$0(receiver) { + return receiver.call(); + }, + call$1$0(receiver) { + return receiver.call(); + }, + call$1$2(receiver, p0, p1) { + return receiver.call(p0, p1); + }, + call$2$3(receiver, p0, p1, p2) { + return receiver.call(p0, p1, p2); + }, + apply$2(receiver, p0, p1) { + return receiver.apply(p0, p1); + }, + toArray$0(receiver) { + return receiver.toArray(); + }, + asMutable$0(receiver) { + return receiver.asMutable(); + }, + asImmutable$0(receiver) { + return receiver.asImmutable(); + }, + $set$2(receiver, p0, p1) { + return receiver.set(p0, p1); + }, + forEach$1(receiver, p0) { + return receiver.forEach(p0); + }, + get$file(obj) { + return obj.file; + }, + get$contents(obj) { + return obj.contents; + }, + get$options(obj) { + return obj.options; + }, + get$data(obj) { + return obj.data; + }, + get$includePaths(obj) { + return obj.includePaths; + }, + get$style(obj) { + return obj.style; + }, + get$indentType(obj) { + return obj.indentType; + }, + get$indentWidth(obj) { + return obj.indentWidth; + }, + get$linefeed(obj) { + return obj.linefeed; + }, + set$context(obj, v) { + return obj.context = v; + }, + createRequire$1(receiver, p0) { + return receiver.createRequire(p0); + }, + resolve$1(receiver, p0) { + return receiver.resolve(p0); + }, + get$$prototype(obj) { + return obj.prototype; + }, + get$red(obj) { + return obj.red; + }, + get$green(obj) { + return obj.green; + }, + get$blue(obj) { + return obj.blue; + }, + get$hue(obj) { + return obj.hue; + }, + get$saturation(obj) { + return obj.saturation; + }, + get$lightness(obj) { + return obj.lightness; + }, + get$whiteness(obj) { + return obj.whiteness; + }, + get$blackness(obj) { + return obj.blackness; + }, + get$alpha(obj) { + return obj.alpha; + }, + get$dartValue(obj) { + return obj.dartValue; + }, + set$dartValue(obj, v) { + return obj.dartValue = v; + }, + get$alertAscii(obj) { + return obj.alertAscii; + }, + get$alertColor(obj) { + return obj.alertColor; + }, + get$loadPaths(obj) { + return obj.loadPaths; + }, + get$quietDeps(obj) { + return obj.quietDeps; + }, + get$verbose(obj) { + return obj.verbose; + }, + get$charset(obj) { + return obj.charset; + }, + get$sourceMap(obj) { + return obj.sourceMap; + }, + get$sourceMapIncludeSources(obj) { + return obj.sourceMapIncludeSources; + }, + get$logger(obj) { + return obj.logger; + }, + get$importers(obj) { + return obj.importers; + }, + get$functions(obj) { + return obj.functions; + }, + get$syntax(obj) { + return obj.syntax; + }, + get$url(obj) { + return obj.url; + }, + get$importer(obj) { + return obj.importer; + }, + get$_dartException(obj) { + return obj._dartException; + }, + set$renderSync(obj, v) { + return obj.renderSync = v; + }, + set$compileString(obj, v) { + return obj.compileString = v; + }, + set$compileStringAsync(obj, v) { + return obj.compileStringAsync = v; + }, + set$compile(obj, v) { + return obj.compile = v; + }, + set$compileAsync(obj, v) { + return obj.compileAsync = v; + }, + set$initCompiler(obj, v) { + return obj.initCompiler = v; + }, + set$initAsyncCompiler(obj, v) { + return obj.initAsyncCompiler = v; + }, + set$Compiler(obj, v) { + return obj.Compiler = v; + }, + set$AsyncCompiler(obj, v) { + return obj.AsyncCompiler = v; + }, + set$info(obj, v) { + return obj.info = v; + }, + set$Exception(obj, v) { + return obj.Exception = v; + }, + set$Logger(obj, v) { + return obj.Logger = v; + }, + set$NodePackageImporter(obj, v) { + return obj.NodePackageImporter = v; + }, + set$Value(obj, v) { + return obj.Value = v; + }, + set$SassArgumentList(obj, v) { + return obj.SassArgumentList = v; + }, + set$SassCalculation(obj, v) { + return obj.SassCalculation = v; + }, + set$CalculationOperation(obj, v) { + return obj.CalculationOperation = v; + }, + set$CalculationInterpolation(obj, v) { + return obj.CalculationInterpolation = v; + }, + set$SassBoolean(obj, v) { + return obj.SassBoolean = v; + }, + set$SassColor(obj, v) { + return obj.SassColor = v; + }, + set$SassFunction(obj, v) { + return obj.SassFunction = v; + }, + set$SassMixin(obj, v) { + return obj.SassMixin = v; + }, + set$SassList(obj, v) { + return obj.SassList = v; + }, + set$SassMap(obj, v) { + return obj.SassMap = v; + }, + set$SassNumber(obj, v) { + return obj.SassNumber = v; + }, + set$SassString(obj, v) { + return obj.SassString = v; + }, + set$sassNull(obj, v) { + return obj.sassNull = v; + }, + set$sassTrue(obj, v) { + return obj.sassTrue = v; + }, + set$sassFalse(obj, v) { + return obj.sassFalse = v; + }, + set$render(obj, v) { + return obj.render = v; + }, + set$types(obj, v) { + return obj.types = v; + }, + set$NULL(obj, v) { + return obj.NULL = v; + }, + set$TRUE(obj, v) { + return obj.TRUE = v; + }, + set$FALSE(obj, v) { + return obj.FALSE = v; + }, + get$current(obj) { + return obj.current; + }, + yield$0(receiver) { + return receiver.yield(); + }, + run$1$1(receiver, p0) { + return receiver.run(p0); + }, + run$1(receiver, p0) { + return receiver.run(p0); + }, + run$0(receiver) { + return receiver.run(); + }, + get$canonicalize(obj) { + return obj.canonicalize; + }, + canonicalize$1(receiver, p0) { + return receiver.canonicalize(p0); + }, + get$load(obj) { + return obj.load; + }, + load$1(receiver, p0) { + return receiver.load(p0); + }, + get$findFileUrl(obj) { + return obj.findFileUrl; + }, + get$nonCanonicalScheme(obj) { + return obj.nonCanonicalScheme; + }, + get$sourceMapUrl(obj) { + return obj.sourceMapUrl; + }, + get$separator(obj) { + return obj.separator; + }, + get$brackets(obj) { + return obj.brackets; + }, + get$numeratorUnits(obj) { + return obj.numeratorUnits; + }, + get$denominatorUnits(obj) { + return obj.denominatorUnits; + }, + get$pkgImporter(obj) { + return obj.pkgImporter; + }, + get$indentedSyntax(obj) { + return obj.indentedSyntax; + }, + get$omitSourceMapUrl(obj) { + return obj.omitSourceMapUrl; + }, + get$outFile(obj) { + return obj.outFile; + }, + get$outputStyle(obj) { + return obj.outputStyle; + }, + get$fiber(obj) { + return obj.fiber; + }, + get$sourceMapContents(obj) { + return obj.sourceMapContents; + }, + get$sourceMapEmbed(obj) { + return obj.sourceMapEmbed; + }, + get$sourceMapRoot(obj) { + return obj.sourceMapRoot; + }, + set$cli_pkg_main_0_(obj, v) { + return obj.cli_pkg_main_0_ = v; + }, + get$quotes(obj) { + return obj.quotes; + } + }; + J.PlainJavaScriptObject.prototype = {}; + J.UnknownJavaScriptObject.prototype = {}; + J.JavaScriptFunction.prototype = { + toString$0(receiver) { + var dartClosure = receiver[$.$get$DART_CLOSURE_PROPERTY_NAME()]; + if (dartClosure == null) + return this.super$LegacyJavaScriptObject$toString(receiver); + return "JavaScript function for " + A.S(J.toString$0$(dartClosure)); + }, + $isFunction: 1 + }; + J.JavaScriptBigInt.prototype = { + get$hashCode(receiver) { + return 0; + }, + toString$0(receiver) { + return String(receiver); + } + }; + J.JavaScriptSymbol.prototype = { + get$hashCode(receiver) { + return 0; + }, + toString$0(receiver) { + return String(receiver); + } + }; + J.JSArray.prototype = { + cast$1$0(receiver, $R) { + return new A.CastList(receiver, A._arrayInstanceType(receiver)._eval$1("@<1>")._bind$1($R)._eval$1("CastList<1,2>")); + }, + add$1(receiver, value) { + if (!!receiver.fixed$length) + A.throwExpression(A.UnsupportedError$("add")); + receiver.push(value); + }, + removeAt$1(receiver, index) { + var t1; + if (!!receiver.fixed$length) + A.throwExpression(A.UnsupportedError$("removeAt")); + t1 = receiver.length; + if (index >= t1) + throw A.wrapException(A.RangeError$value(index, null, null)); + return receiver.splice(index, 1)[0]; + }, + insert$2(receiver, index, value) { + var t1; + if (!!receiver.fixed$length) + A.throwExpression(A.UnsupportedError$("insert")); + t1 = receiver.length; + if (index > t1) + throw A.wrapException(A.RangeError$value(index, null, null)); + receiver.splice(index, 0, value); + }, + insertAll$2(receiver, index, iterable) { + var insertionLength, end; + if (!!receiver.fixed$length) + A.throwExpression(A.UnsupportedError$("insertAll")); + A.RangeError_checkValueInInterval(index, 0, receiver.length, "index"); + if (!type$.EfficientLengthIterable_dynamic._is(iterable)) + iterable = J.toList$0$ax(iterable); + insertionLength = J.get$length$asx(iterable); + receiver.length = receiver.length + insertionLength; + end = index + insertionLength; + this.setRange$4(receiver, end, receiver.length, receiver, index); + this.setRange$3(receiver, index, end, iterable); + }, + removeLast$0(receiver) { + if (!!receiver.fixed$length) + A.throwExpression(A.UnsupportedError$("removeLast")); + if (receiver.length === 0) + throw A.wrapException(A.diagnoseIndexError(receiver, -1)); + return receiver.pop(); + }, + _removeWhere$2(receiver, test, removeMatching) { + var i, element, t1, retained = [], + end = receiver.length; + for (i = 0; i < end; ++i) { + element = receiver[i]; + if (!test.call$1(element)) + retained.push(element); + if (receiver.length !== end) + throw A.wrapException(A.ConcurrentModificationError$(receiver)); + } + t1 = retained.length; + if (t1 === end) + return; + this.set$length(receiver, t1); + for (i = 0; i < retained.length; ++i) + receiver[i] = retained[i]; + }, + where$1(receiver, f) { + return new A.WhereIterable(receiver, f, A._arrayInstanceType(receiver)._eval$1("WhereIterable<1>")); + }, + expand$1$1(receiver, f, $T) { + return new A.ExpandIterable(receiver, f, A._arrayInstanceType(receiver)._eval$1("@<1>")._bind$1($T)._eval$1("ExpandIterable<1,2>")); + }, + addAll$1(receiver, collection) { + var t1; + if (!!receiver.fixed$length) + A.throwExpression(A.UnsupportedError$("addAll")); + if (Array.isArray(collection)) { + this._addAllFromArray$1(receiver, collection); + return; + } + for (t1 = J.get$iterator$ax(collection); t1.moveNext$0();) + receiver.push(t1.get$current(t1)); + }, + _addAllFromArray$1(receiver, array) { + var i, + len = array.length; + if (len === 0) + return; + if (receiver === array) + throw A.wrapException(A.ConcurrentModificationError$(receiver)); + for (i = 0; i < len; ++i) + receiver.push(array[i]); + }, + clear$0(receiver) { + if (!!receiver.fixed$length) + A.throwExpression(A.UnsupportedError$("clear")); + receiver.length = 0; + }, + map$1$1(receiver, f, $T) { + return new A.MappedListIterable(receiver, f, A._arrayInstanceType(receiver)._eval$1("@<1>")._bind$1($T)._eval$1("MappedListIterable<1,2>")); + }, + join$1(receiver, separator) { + var i, + list = A.List_List$filled(receiver.length, "", false, type$.String); + for (i = 0; i < receiver.length; ++i) + list[i] = A.S(receiver[i]); + return list.join(separator); + }, + join$0(receiver) { + return this.join$1(receiver, ""); + }, + take$1(receiver, n) { + return A.SubListIterable$(receiver, 0, A.checkNotNullable(n, "count", type$.int), A._arrayInstanceType(receiver)._precomputed1); + }, + skip$1(receiver, n) { + return A.SubListIterable$(receiver, n, null, A._arrayInstanceType(receiver)._precomputed1); + }, + fold$1$2(receiver, initialValue, combine) { + var value, i, + $length = receiver.length; + for (value = initialValue, i = 0; i < $length; ++i) { + value = combine.call$2(value, receiver[i]); + if (receiver.length !== $length) + throw A.wrapException(A.ConcurrentModificationError$(receiver)); + } + return value; + }, + fold$2(receiver, initialValue, combine) { + return this.fold$1$2(receiver, initialValue, combine, type$.dynamic); + }, + elementAt$1(receiver, index) { + return receiver[index]; + }, + sublist$2(receiver, start, end) { + var end0 = receiver.length; + if (start > end0) + throw A.wrapException(A.RangeError$range(start, 0, end0, "start", null)); + if (end == null) + end = end0; + else if (end < start || end > end0) + throw A.wrapException(A.RangeError$range(end, start, end0, "end", null)); + if (start === end) + return A._setArrayType([], A._arrayInstanceType(receiver)); + return A._setArrayType(receiver.slice(start, end), A._arrayInstanceType(receiver)); + }, + sublist$1(receiver, start) { + return this.sublist$2(receiver, start, null); + }, + getRange$2(receiver, start, end) { + A.RangeError_checkValidRange(start, end, receiver.length); + return A.SubListIterable$(receiver, start, end, A._arrayInstanceType(receiver)._precomputed1); + }, + get$first(receiver) { + if (receiver.length > 0) + return receiver[0]; + throw A.wrapException(A.IterableElementError_noElement()); + }, + get$last(receiver) { + var t1 = receiver.length; + if (t1 > 0) + return receiver[t1 - 1]; + throw A.wrapException(A.IterableElementError_noElement()); + }, + get$single(receiver) { + var t1 = receiver.length; + if (t1 === 1) + return receiver[0]; + if (t1 === 0) + throw A.wrapException(A.IterableElementError_noElement()); + throw A.wrapException(A.IterableElementError_tooMany()); + }, + removeRange$2(receiver, start, end) { + if (!!receiver.fixed$length) + A.throwExpression(A.UnsupportedError$("removeRange")); + A.RangeError_checkValidRange(start, end, receiver.length); + receiver.splice(start, end - start); + }, + setRange$4(receiver, start, end, iterable, skipCount) { + var $length, otherList, otherStart, t1, i; + if (!!receiver.immutable$list) + A.throwExpression(A.UnsupportedError$("setRange")); + A.RangeError_checkValidRange(start, end, receiver.length); + $length = end - start; + if ($length === 0) + return; + A.RangeError_checkNotNegative(skipCount, "skipCount"); + if (type$.List_dynamic._is(iterable)) { + otherList = iterable; + otherStart = skipCount; + } else { + otherList = J.skip$1$ax(iterable, skipCount).toList$1$growable(0, false); + otherStart = 0; + } + t1 = J.getInterceptor$asx(otherList); + if (otherStart + $length > t1.get$length(otherList)) + throw A.wrapException(A.IterableElementError_tooFew()); + if (otherStart < start) + for (i = $length - 1; i >= 0; --i) + receiver[start + i] = t1.$index(otherList, otherStart + i); + else + for (i = 0; i < $length; ++i) + receiver[start + i] = t1.$index(otherList, otherStart + i); + }, + setRange$3(receiver, start, end, iterable) { + return this.setRange$4(receiver, start, end, iterable, 0); + }, + fillRange$3(receiver, start, end, fillValue) { + var i; + if (!!receiver.immutable$list) + A.throwExpression(A.UnsupportedError$("fill range")); + A.RangeError_checkValidRange(start, end, receiver.length); + A._arrayInstanceType(receiver)._precomputed1._as(fillValue); + for (i = start; i < end; ++i) + receiver[i] = fillValue; + }, + any$1(receiver, test) { + var i, + end = receiver.length; + for (i = 0; i < end; ++i) { + if (test.call$1(receiver[i])) + return true; + if (receiver.length !== end) + throw A.wrapException(A.ConcurrentModificationError$(receiver)); + } + return false; + }, + every$1(receiver, test) { + var i, + end = receiver.length; + for (i = 0; i < end; ++i) { + if (!test.call$1(receiver[i])) + return false; + if (receiver.length !== end) + throw A.wrapException(A.ConcurrentModificationError$(receiver)); + } + return true; + }, + get$reversed(receiver) { + return new A.ReversedListIterable(receiver, A._arrayInstanceType(receiver)._eval$1("ReversedListIterable<1>")); + }, + sort$1(receiver, compare) { + var len, a, b, undefineds, i; + if (!!receiver.immutable$list) + A.throwExpression(A.UnsupportedError$("sort")); + len = receiver.length; + if (len < 2) + return; + if (compare == null) + compare = J._interceptors_JSArray__compareAny$closure(); + if (len === 2) { + a = receiver[0]; + b = receiver[1]; + if (compare.call$2(a, b) > 0) { + receiver[0] = b; + receiver[1] = a; + } + return; + } + if (A._arrayInstanceType(receiver)._precomputed1._is(null)) { + for (undefineds = 0, i = 0; i < receiver.length; ++i) + if (receiver[i] === void 0) { + receiver[i] = null; + ++undefineds; + } + } else + undefineds = 0; + receiver.sort(A.convertDartClosureToJS(compare, 2)); + if (undefineds > 0) + this._replaceSomeNullsWithUndefined$1(receiver, undefineds); + }, + sort$0(receiver) { + return this.sort$1(receiver, null); + }, + _replaceSomeNullsWithUndefined$1(receiver, count) { + var i0, + i = receiver.length; + for (; i0 = i - 1, i > 0; i = i0) + if (receiver[i0] === null) { + receiver[i0] = void 0; + --count; + if (count === 0) + break; + } + }, + indexOf$1(receiver, element) { + var i, + $length = receiver.length; + if (0 >= $length) + return -1; + for (i = 0; i < $length; ++i) + if (J.$eq$(receiver[i], element)) + return i; + return -1; + }, + contains$1(receiver, other) { + var i; + for (i = 0; i < receiver.length; ++i) + if (J.$eq$(receiver[i], other)) + return true; + return false; + }, + get$isEmpty(receiver) { + return receiver.length === 0; + }, + get$isNotEmpty(receiver) { + return receiver.length !== 0; + }, + toString$0(receiver) { + return A.Iterable_iterableToFullString(receiver, "[", "]"); + }, + toList$1$growable(receiver, growable) { + var t1 = A._setArrayType(receiver.slice(0), A._arrayInstanceType(receiver)); + return t1; + }, + toList$0(receiver) { + return this.toList$1$growable(receiver, true); + }, + toSet$0(receiver) { + return A.LinkedHashSet_LinkedHashSet$from(receiver, A._arrayInstanceType(receiver)._precomputed1); + }, + get$iterator(receiver) { + return new J.ArrayIterator(receiver, receiver.length, A._arrayInstanceType(receiver)._eval$1("ArrayIterator<1>")); + }, + get$hashCode(receiver) { + return A.Primitives_objectHashCode(receiver); + }, + get$length(receiver) { + return receiver.length; + }, + set$length(receiver, newLength) { + if (!!receiver.fixed$length) + A.throwExpression(A.UnsupportedError$("set length")); + if (newLength < 0) + throw A.wrapException(A.RangeError$range(newLength, 0, null, "newLength", null)); + if (newLength > receiver.length) + A._arrayInstanceType(receiver)._precomputed1._as(null); + receiver.length = newLength; + }, + $index(receiver, index) { + if (!(index >= 0 && index < receiver.length)) + throw A.wrapException(A.diagnoseIndexError(receiver, index)); + return receiver[index]; + }, + $indexSet(receiver, index, value) { + if (!!receiver.immutable$list) + A.throwExpression(A.UnsupportedError$("indexed set")); + if (!(index >= 0 && index < receiver.length)) + throw A.wrapException(A.diagnoseIndexError(receiver, index)); + receiver[index] = value; + }, + $add(receiver, other) { + var t1 = A.List_List$of(receiver, true, A._arrayInstanceType(receiver)._precomputed1); + this.addAll$1(t1, other); + return t1; + }, + indexWhere$1(receiver, test) { + var i; + if (0 >= receiver.length) + return -1; + for (i = 0; i < receiver.length; ++i) + if (test.call$1(receiver[i])) + return i; + return -1; + }, + $isEfficientLengthIterable: 1, + $isIterable: 1, + $isList: 1 + }; + J.JSUnmodifiableArray.prototype = {}; + J.ArrayIterator.prototype = { + get$current(_) { + var t1 = this._current; + return t1 == null ? this.$ti._precomputed1._as(t1) : t1; + }, + moveNext$0() { + var t2, _this = this, + t1 = _this._iterable, + $length = t1.length; + if (_this._length !== $length) + throw A.wrapException(A.throwConcurrentModificationError(t1)); + t2 = _this._index; + if (t2 >= $length) { + _this._current = null; + return false; + } + _this._current = t1[t2]; + _this._index = t2 + 1; + return true; + } + }; + J.JSNumber.prototype = { + compareTo$1(receiver, b) { + var bIsNegative; + if (receiver < b) + return -1; + else if (receiver > b) + return 1; + else if (receiver === b) { + if (receiver === 0) { + bIsNegative = this.get$isNegative(b); + if (this.get$isNegative(receiver) === bIsNegative) + return 0; + if (this.get$isNegative(receiver)) + return -1; + return 1; + } + return 0; + } else if (isNaN(receiver)) { + if (isNaN(b)) + return 0; + return 1; + } else + return -1; + }, + get$isNegative(receiver) { + return receiver === 0 ? 1 / receiver < 0 : receiver < 0; + }, + get$sign(receiver) { + var t1; + if (receiver > 0) + t1 = 1; + else + t1 = receiver < 0 ? -1 : receiver; + return t1; + }, + ceil$0(receiver) { + var truncated, d; + if (receiver >= 0) { + if (receiver <= 2147483647) { + truncated = receiver | 0; + return receiver === truncated ? truncated : truncated + 1; + } + } else if (receiver >= -2147483648) + return receiver | 0; + d = Math.ceil(receiver); + if (isFinite(d)) + return d; + throw A.wrapException(A.UnsupportedError$("" + receiver + ".ceil()")); + }, + floor$0(receiver) { + var truncated, d; + if (receiver >= 0) { + if (receiver <= 2147483647) + return receiver | 0; + } else if (receiver >= -2147483648) { + truncated = receiver | 0; + return receiver === truncated ? truncated : truncated - 1; + } + d = Math.floor(receiver); + if (isFinite(d)) + return d; + throw A.wrapException(A.UnsupportedError$("" + receiver + ".floor()")); + }, + round$0(receiver) { + if (receiver > 0) { + if (receiver !== 1 / 0) + return Math.round(receiver); + } else if (receiver > -1 / 0) + return 0 - Math.round(0 - receiver); + throw A.wrapException(A.UnsupportedError$("" + receiver + ".round()")); + }, + clamp$2(receiver, lowerLimit, upperLimit) { + if (B.JSInt_methods.compareTo$1(lowerLimit, upperLimit) > 0) + throw A.wrapException(A.argumentErrorValue(lowerLimit)); + if (this.compareTo$1(receiver, lowerLimit) < 0) + return lowerLimit; + if (this.compareTo$1(receiver, upperLimit) > 0) + return upperLimit; + return receiver; + }, + toRadixString$1(receiver, radix) { + var result, match, exponent, t1; + if (radix < 2 || radix > 36) + throw A.wrapException(A.RangeError$range(radix, 2, 36, "radix", null)); + result = receiver.toString(radix); + if (result.charCodeAt(result.length - 1) !== 41) + return result; + match = /^([\da-z]+)(?:\.([\da-z]+))?\(e\+(\d+)\)$/.exec(result); + if (match == null) + A.throwExpression(A.UnsupportedError$("Unexpected toString result: " + result)); + result = match[1]; + exponent = +match[3]; + t1 = match[2]; + if (t1 != null) { + result += t1; + exponent -= t1.length; + } + return result + B.JSString_methods.$mul("0", exponent); + }, + toString$0(receiver) { + if (receiver === 0 && 1 / receiver < 0) + return "-0.0"; + else + return "" + receiver; + }, + get$hashCode(receiver) { + var absolute, floorLog2, factor, scaled, + intValue = receiver | 0; + if (receiver === intValue) + return intValue & 536870911; + absolute = Math.abs(receiver); + floorLog2 = Math.log(absolute) / 0.6931471805599453 | 0; + factor = Math.pow(2, floorLog2); + scaled = absolute < 1 ? absolute / factor : factor / absolute; + return ((scaled * 9007199254740992 | 0) + (scaled * 3542243181176521 | 0)) * 599197 + floorLog2 * 1259 & 536870911; + }, + $mod(receiver, other) { + var result = receiver % other; + if (result === 0) + return 0; + if (result > 0) + return result; + if (other < 0) + return result - other; + else + return result + other; + }, + $tdiv(receiver, other) { + if ((receiver | 0) === receiver) + if (other >= 1 || other < -1) + return receiver / other | 0; + return this._tdivSlow$1(receiver, other); + }, + _tdivFast$1(receiver, other) { + return (receiver | 0) === receiver ? receiver / other | 0 : this._tdivSlow$1(receiver, other); + }, + _tdivSlow$1(receiver, other) { + var quotient = receiver / other; + if (quotient >= -2147483648 && quotient <= 2147483647) + return quotient | 0; + if (quotient > 0) { + if (quotient !== 1 / 0) + return Math.floor(quotient); + } else if (quotient > -1 / 0) + return Math.ceil(quotient); + throw A.wrapException(A.UnsupportedError$("Result of truncating division is " + A.S(quotient) + ": " + A.S(receiver) + " ~/ " + other)); + }, + _shrOtherPositive$1(receiver, other) { + var t1; + if (receiver > 0) + t1 = this._shrBothPositive$1(receiver, other); + else { + t1 = other > 31 ? 31 : other; + t1 = receiver >> t1 >>> 0; + } + return t1; + }, + _shrReceiverPositive$1(receiver, other) { + if (0 > other) + throw A.wrapException(A.argumentErrorValue(other)); + return this._shrBothPositive$1(receiver, other); + }, + _shrBothPositive$1(receiver, other) { + return other > 31 ? 0 : receiver >>> other; + }, + get$runtimeType(receiver) { + return A.createRuntimeType(type$.num); + }, + $isComparable: 1, + $isdouble: 1, + $isnum: 1 + }; + J.JSInt.prototype = { + get$sign(receiver) { + var t1; + if (receiver > 0) + t1 = 1; + else + t1 = receiver < 0 ? -1 : receiver; + return t1; + }, + get$runtimeType(receiver) { + return A.createRuntimeType(type$.int); + }, + $isTrustedGetRuntimeType: 1, + $isint: 1 + }; + J.JSNumNotInt.prototype = { + get$runtimeType(receiver) { + return A.createRuntimeType(type$.double); + }, + $isTrustedGetRuntimeType: 1 + }; + J.JSString.prototype = { + codeUnitAt$1(receiver, index) { + if (index < 0) + throw A.wrapException(A.diagnoseIndexError(receiver, index)); + if (index >= receiver.length) + A.throwExpression(A.diagnoseIndexError(receiver, index)); + return receiver.charCodeAt(index); + }, + allMatches$2(receiver, string, start) { + var t1 = string.length; + if (start > t1) + throw A.wrapException(A.RangeError$range(start, 0, t1, null, null)); + return new A._StringAllMatchesIterable(string, receiver, start); + }, + allMatches$1(receiver, string) { + return this.allMatches$2(receiver, string, 0); + }, + matchAsPrefix$2(receiver, string, start) { + var t1, i, _null = null; + if (start < 0 || start > string.length) + throw A.wrapException(A.RangeError$range(start, 0, string.length, _null, _null)); + t1 = receiver.length; + if (start + t1 > string.length) + return _null; + for (i = 0; i < t1; ++i) + if (string.charCodeAt(start + i) !== receiver.charCodeAt(i)) + return _null; + return new A.StringMatch(start, receiver); + }, + $add(receiver, other) { + return receiver + other; + }, + endsWith$1(receiver, other) { + var otherLength = other.length, + t1 = receiver.length; + if (otherLength > t1) + return false; + return other === this.substring$1(receiver, t1 - otherLength); + }, + replaceFirst$2(receiver, from, to) { + A.RangeError_checkValueInInterval(0, 0, receiver.length, "startIndex"); + return A.stringReplaceFirstUnchecked(receiver, from, to, 0); + }, + split$1(receiver, pattern) { + if (typeof pattern == "string") + return A._setArrayType(receiver.split(pattern), type$.JSArray_String); + else if (pattern instanceof A.JSSyntaxRegExp && pattern.get$_nativeAnchoredVersion().exec("").length - 2 === 0) + return A._setArrayType(receiver.split(pattern._nativeRegExp), type$.JSArray_String); + else + return this._defaultSplit$1(receiver, pattern); + }, + replaceRange$3(receiver, start, end, replacement) { + var e = A.RangeError_checkValidRange(start, end, receiver.length); + return A.stringReplaceRangeUnchecked(receiver, start, e, replacement); + }, + _defaultSplit$1(receiver, pattern) { + var t1, start, $length, match, matchStart, matchEnd, + result = A._setArrayType([], type$.JSArray_String); + for (t1 = J.allMatches$1$s(pattern, receiver), t1 = t1.get$iterator(t1), start = 0, $length = 1; t1.moveNext$0();) { + match = t1.get$current(t1); + matchStart = match.get$start(match); + matchEnd = match.get$end(match); + $length = matchEnd - matchStart; + if ($length === 0 && start === matchStart) + continue; + result.push(this.substring$2(receiver, start, matchStart)); + start = matchEnd; + } + if (start < receiver.length || $length > 0) + result.push(this.substring$1(receiver, start)); + return result; + }, + startsWith$2(receiver, pattern, index) { + var endIndex; + if (index < 0 || index > receiver.length) + throw A.wrapException(A.RangeError$range(index, 0, receiver.length, null, null)); + if (typeof pattern == "string") { + endIndex = index + pattern.length; + if (endIndex > receiver.length) + return false; + return pattern === receiver.substring(index, endIndex); + } + return J.matchAsPrefix$2$s(pattern, receiver, index) != null; + }, + startsWith$1(receiver, pattern) { + return this.startsWith$2(receiver, pattern, 0); + }, + substring$2(receiver, start, end) { + return receiver.substring(start, A.RangeError_checkValidRange(start, end, receiver.length)); + }, + substring$1(receiver, start) { + return this.substring$2(receiver, start, null); + }, + trim$0(receiver) { + var startIndex, t1, endIndex0, + result = receiver.trim(), + endIndex = result.length; + if (endIndex === 0) + return result; + if (result.charCodeAt(0) === 133) { + startIndex = J.JSString__skipLeadingWhitespace(result, 1); + if (startIndex === endIndex) + return ""; + } else + startIndex = 0; + t1 = endIndex - 1; + endIndex0 = result.charCodeAt(t1) === 133 ? J.JSString__skipTrailingWhitespace(result, t1) : endIndex; + if (startIndex === 0 && endIndex0 === endIndex) + return result; + return result.substring(startIndex, endIndex0); + }, + trimLeft$0(receiver) { + var result = receiver.trimStart(); + if (result.length === 0) + return result; + if (result.charCodeAt(0) !== 133) + return result; + return result.substring(J.JSString__skipLeadingWhitespace(result, 1)); + }, + trimRight$0(receiver) { + var t1, + result = receiver.trimEnd(), + endIndex = result.length; + if (endIndex === 0) + return result; + t1 = endIndex - 1; + if (result.charCodeAt(t1) !== 133) + return result; + return result.substring(0, J.JSString__skipTrailingWhitespace(result, t1)); + }, + $mul(receiver, times) { + var s, result; + if (0 >= times) + return ""; + if (times === 1 || receiver.length === 0) + return receiver; + if (times !== times >>> 0) + throw A.wrapException(B.C_OutOfMemoryError); + for (s = receiver, result = ""; true;) { + if ((times & 1) === 1) + result = s + result; + times = times >>> 1; + if (times === 0) + break; + s += s; + } + return result; + }, + padLeft$2(receiver, width, padding) { + var delta = width - receiver.length; + if (delta <= 0) + return receiver; + return this.$mul(padding, delta) + receiver; + }, + padRight$1(receiver, width) { + var delta = width - receiver.length; + if (delta <= 0) + return receiver; + return receiver + this.$mul(" ", delta); + }, + indexOf$2(receiver, pattern, start) { + var t1; + if (start < 0 || start > receiver.length) + throw A.wrapException(A.RangeError$range(start, 0, receiver.length, null, null)); + t1 = receiver.indexOf(pattern, start); + return t1; + }, + indexOf$1(receiver, pattern) { + return this.indexOf$2(receiver, pattern, 0); + }, + lastIndexOf$2(receiver, pattern, start) { + var t1, t2, i; + if (start == null) + start = receiver.length; + else if (start < 0 || start > receiver.length) + throw A.wrapException(A.RangeError$range(start, 0, receiver.length, null, null)); + if (typeof pattern == "string") { + t1 = pattern.length; + t2 = receiver.length; + if (start + t1 > t2) + start = t2 - t1; + return receiver.lastIndexOf(pattern, start); + } + for (t1 = J.getInterceptor$s(pattern), i = start; i >= 0; --i) + if (t1.matchAsPrefix$2(pattern, receiver, i) != null) + return i; + return -1; + }, + lastIndexOf$1(receiver, pattern) { + return this.lastIndexOf$2(receiver, pattern, null); + }, + contains$2(receiver, other, startIndex) { + var t1 = receiver.length; + if (startIndex > t1) + throw A.wrapException(A.RangeError$range(startIndex, 0, t1, null, null)); + return A.stringContainsUnchecked(receiver, other, startIndex); + }, + contains$1(receiver, other) { + return this.contains$2(receiver, other, 0); + }, + compareTo$1(receiver, other) { + var t1; + if (receiver === other) + t1 = 0; + else + t1 = receiver < other ? -1 : 1; + return t1; + }, + toString$0(receiver) { + return receiver; + }, + get$hashCode(receiver) { + var t1, hash, i; + for (t1 = receiver.length, hash = 0, i = 0; i < t1; ++i) { + hash = hash + receiver.charCodeAt(i) & 536870911; + hash = hash + ((hash & 524287) << 10) & 536870911; + hash ^= hash >> 6; + } + hash = hash + ((hash & 67108863) << 3) & 536870911; + hash ^= hash >> 11; + return hash + ((hash & 16383) << 15) & 536870911; + }, + get$runtimeType(receiver) { + return A.createRuntimeType(type$.String); + }, + get$length(receiver) { + return receiver.length; + }, + $isTrustedGetRuntimeType: 1, + $isComparable: 1, + $isString: 1 + }; + A._CastIterableBase.prototype = { + get$iterator(_) { + var t1 = A._instanceType(this); + return new A.CastIterator(J.get$iterator$ax(this.get$_source()), t1._eval$1("@<1>")._bind$1(t1._rest[1])._eval$1("CastIterator<1,2>")); + }, + get$length(_) { + return J.get$length$asx(this.get$_source()); + }, + get$isEmpty(_) { + return J.get$isEmpty$asx(this.get$_source()); + }, + get$isNotEmpty(_) { + return J.get$isNotEmpty$asx(this.get$_source()); + }, + skip$1(_, count) { + var t1 = A._instanceType(this); + return A.CastIterable_CastIterable(J.skip$1$ax(this.get$_source(), count), t1._precomputed1, t1._rest[1]); + }, + take$1(_, count) { + var t1 = A._instanceType(this); + return A.CastIterable_CastIterable(J.take$1$ax(this.get$_source(), count), t1._precomputed1, t1._rest[1]); + }, + elementAt$1(_, index) { + return A._instanceType(this)._rest[1]._as(J.elementAt$1$ax(this.get$_source(), index)); + }, + get$first(_) { + return A._instanceType(this)._rest[1]._as(J.get$first$ax(this.get$_source())); + }, + get$last(_) { + return A._instanceType(this)._rest[1]._as(J.get$last$ax(this.get$_source())); + }, + get$single(_) { + return A._instanceType(this)._rest[1]._as(J.get$single$ax(this.get$_source())); + }, + contains$1(_, other) { + return J.contains$1$asx(this.get$_source(), other); + }, + toString$0(_) { + return J.toString$0$(this.get$_source()); + } + }; + A.CastIterator.prototype = { + moveNext$0() { + return this._source.moveNext$0(); + }, + get$current(_) { + var t1 = this._source; + return this.$ti._rest[1]._as(t1.get$current(t1)); + } + }; + A.CastIterable.prototype = { + get$_source() { + return this._source; + } + }; + A._EfficientLengthCastIterable.prototype = {$isEfficientLengthIterable: 1}; + A._CastListBase.prototype = { + $index(_, index) { + return this.$ti._rest[1]._as(J.$index$asx(this._source, index)); + }, + $indexSet(_, index, value) { + J.$indexSet$ax(this._source, index, this.$ti._precomputed1._as(value)); + }, + set$length(_, $length) { + J.set$length$asx(this._source, $length); + }, + add$1(_, value) { + J.add$1$ax(this._source, this.$ti._precomputed1._as(value)); + }, + addAll$1(_, values) { + var t1 = this.$ti; + J.addAll$1$ax(this._source, A.CastIterable_CastIterable(values, t1._rest[1], t1._precomputed1)); + }, + sort$1(_, compare) { + var t1 = compare == null ? null : new A._CastListBase_sort_closure(this, compare); + J.sort$1$ax(this._source, t1); + }, + getRange$2(_, start, end) { + var t1 = this.$ti; + return A.CastIterable_CastIterable(J.getRange$2$ax(this._source, start, end), t1._precomputed1, t1._rest[1]); + }, + setRange$4(_, start, end, iterable, skipCount) { + var t1 = this.$ti; + J.setRange$4$ax(this._source, start, end, A.CastIterable_CastIterable(iterable, t1._rest[1], t1._precomputed1), skipCount); + }, + removeRange$2(_, start, end) { + J.removeRange$2$ax(this._source, start, end); + }, + fillRange$3(_, start, end, fillValue) { + J.fillRange$3$ax(this._source, start, end, this.$ti._precomputed1._as(fillValue)); + }, + $isEfficientLengthIterable: 1, + $isList: 1 + }; + A._CastListBase_sort_closure.prototype = { + call$2(v1, v2) { + var t1 = this.$this.$ti._rest[1]; + return this.compare.call$2(t1._as(v1), t1._as(v2)); + }, + $signature() { + return this.$this.$ti._eval$1("int(1,1)"); + } + }; + A.CastList.prototype = { + cast$1$0(_, $R) { + return new A.CastList(this._source, this.$ti._eval$1("@<1>")._bind$1($R)._eval$1("CastList<1,2>")); + }, + get$_source() { + return this._source; + } + }; + A.CastSet.prototype = { + add$1(_, value) { + return this._source.add$1(0, this.$ti._precomputed1._as(value)); + }, + addAll$1(_, elements) { + var t1 = this.$ti; + this._source.addAll$1(0, A.CastIterable_CastIterable(elements, t1._rest[1], t1._precomputed1)); + }, + difference$1(other) { + var t1, _this = this; + if (_this._emptySet != null) + return _this._conditionalAdd$2(other, false); + t1 = _this.$ti; + return new A.CastSet(_this._source.difference$1(other), null, t1._eval$1("@<1>")._bind$1(t1._rest[1])._eval$1("CastSet<1,2>")); + }, + _conditionalAdd$2(other, otherContains) { + var t3, castElement, + emptySet = this._emptySet, + t1 = this.$ti, + t2 = t1._rest[1], + result = emptySet == null ? A.LinkedHashSet_LinkedHashSet(t2) : emptySet.call$1$0(t2); + for (t2 = this._source, t2 = t2.get$iterator(t2), t3 = other._source, t1 = t1._rest[1]; t2.moveNext$0();) { + castElement = t1._as(t2.get$current(t2)); + if (otherContains === t3.contains$1(0, castElement)) + result.add$1(0, castElement); + } + return result; + }, + toSet$0(_) { + var emptySet = this._emptySet, + t1 = this.$ti._rest[1], + result = emptySet == null ? A.LinkedHashSet_LinkedHashSet(t1) : emptySet.call$1$0(t1); + result.addAll$1(0, this); + return result; + }, + $isEfficientLengthIterable: 1, + $isSet: 1, + get$_source() { + return this._source; + } + }; + A.CastMap.prototype = { + cast$2$0(_, RK, RV) { + var t1 = this.$ti; + return new A.CastMap(this._source, t1._eval$1("@<1>")._bind$1(t1._rest[1])._bind$1(RK)._bind$1(RV)._eval$1("CastMap<1,2,3,4>")); + }, + containsKey$1(key) { + return this._source.containsKey$1(key); + }, + $index(_, key) { + return this.$ti._eval$1("4?")._as(this._source.$index(0, key)); + }, + $indexSet(_, key, value) { + var t1 = this.$ti; + this._source.$indexSet(0, t1._precomputed1._as(key), t1._rest[1]._as(value)); + }, + addAll$1(_, other) { + var t1 = this.$ti; + this._source.addAll$1(0, new A.CastMap(other, t1._eval$1("@<3>")._bind$1(t1._rest[3])._bind$1(t1._precomputed1)._bind$1(t1._rest[1])._eval$1("CastMap<1,2,3,4>"))); + }, + remove$1(_, key) { + return this.$ti._eval$1("4?")._as(this._source.remove$1(0, key)); + }, + forEach$1(_, f) { + this._source.forEach$1(0, new A.CastMap_forEach_closure(this, f)); + }, + get$keys(_) { + var t1 = this._source, + t2 = this.$ti; + return A.CastIterable_CastIterable(t1.get$keys(t1), t2._precomputed1, t2._rest[2]); + }, + get$values(_) { + var t1 = this._source, + t2 = this.$ti; + return A.CastIterable_CastIterable(t1.get$values(t1), t2._rest[1], t2._rest[3]); + }, + get$length(_) { + var t1 = this._source; + return t1.get$length(t1); + }, + get$isEmpty(_) { + var t1 = this._source; + return t1.get$isEmpty(t1); + }, + get$isNotEmpty(_) { + var t1 = this._source; + return t1.get$isNotEmpty(t1); + }, + get$entries(_) { + var t1 = this._source; + return t1.get$entries(t1).map$1$1(0, new A.CastMap_entries_closure(this), this.$ti._eval$1("MapEntry<3,4>")); + } + }; + A.CastMap_forEach_closure.prototype = { + call$2(key, value) { + var t1 = this.$this.$ti; + this.f.call$2(t1._rest[2]._as(key), t1._rest[3]._as(value)); + }, + $signature() { + return this.$this.$ti._eval$1("~(1,2)"); + } + }; + A.CastMap_entries_closure.prototype = { + call$1(e) { + var t1 = this.$this.$ti, + t2 = t1._rest[3]; + return new A.MapEntry(t1._rest[2]._as(e.key), t2._as(e.value), t1._eval$1("@<3>")._bind$1(t2)._eval$1("MapEntry<1,2>")); + }, + $signature() { + return this.$this.$ti._eval$1("MapEntry<3,4>(MapEntry<1,2>)"); + } + }; + A.LateError.prototype = { + toString$0(_) { + return "LateInitializationError: " + this._message; + } + }; + A.ReachabilityError.prototype = { + toString$0(_) { + return "ReachabilityError: " + this._message; + } + }; + A.CodeUnits.prototype = { + get$length(_) { + return this._string.length; + }, + $index(_, i) { + return this._string.charCodeAt(i); + } + }; + A.nullFuture_closure.prototype = { + call$0() { + return A.Future_Future$value(null, type$.Null); + }, + $signature: 2 + }; + A.SentinelValue.prototype = {}; + A.EfficientLengthIterable.prototype = {}; + A.ListIterable.prototype = { + get$iterator(_) { + var _this = this; + return new A.ListIterator(_this, _this.get$length(_this), A._instanceType(_this)._eval$1("ListIterator")); + }, + get$isEmpty(_) { + return this.get$length(this) === 0; + }, + get$first(_) { + if (this.get$length(this) === 0) + throw A.wrapException(A.IterableElementError_noElement()); + return this.elementAt$1(0, 0); + }, + get$last(_) { + var _this = this; + if (_this.get$length(_this) === 0) + throw A.wrapException(A.IterableElementError_noElement()); + return _this.elementAt$1(0, _this.get$length(_this) - 1); + }, + get$single(_) { + var _this = this; + if (_this.get$length(_this) === 0) + throw A.wrapException(A.IterableElementError_noElement()); + if (_this.get$length(_this) > 1) + throw A.wrapException(A.IterableElementError_tooMany()); + return _this.elementAt$1(0, 0); + }, + contains$1(_, element) { + var i, _this = this, + $length = _this.get$length(_this); + for (i = 0; i < $length; ++i) { + if (J.$eq$(_this.elementAt$1(0, i), element)) + return true; + if ($length !== _this.get$length(_this)) + throw A.wrapException(A.ConcurrentModificationError$(_this)); + } + return false; + }, + every$1(_, test) { + var i, _this = this, + $length = _this.get$length(_this); + for (i = 0; i < $length; ++i) { + if (!test.call$1(_this.elementAt$1(0, i))) + return false; + if ($length !== _this.get$length(_this)) + throw A.wrapException(A.ConcurrentModificationError$(_this)); + } + return true; + }, + any$1(_, test) { + var i, _this = this, + $length = _this.get$length(_this); + for (i = 0; i < $length; ++i) { + if (test.call$1(_this.elementAt$1(0, i))) + return true; + if ($length !== _this.get$length(_this)) + throw A.wrapException(A.ConcurrentModificationError$(_this)); + } + return false; + }, + join$1(_, separator) { + var first, t1, i, _this = this, + $length = _this.get$length(_this); + if (separator.length !== 0) { + if ($length === 0) + return ""; + first = A.S(_this.elementAt$1(0, 0)); + if ($length !== _this.get$length(_this)) + throw A.wrapException(A.ConcurrentModificationError$(_this)); + for (t1 = first, i = 1; i < $length; ++i) { + t1 = t1 + separator + A.S(_this.elementAt$1(0, i)); + if ($length !== _this.get$length(_this)) + throw A.wrapException(A.ConcurrentModificationError$(_this)); + } + return t1.charCodeAt(0) == 0 ? t1 : t1; + } else { + for (i = 0, t1 = ""; i < $length; ++i) { + t1 += A.S(_this.elementAt$1(0, i)); + if ($length !== _this.get$length(_this)) + throw A.wrapException(A.ConcurrentModificationError$(_this)); + } + return t1.charCodeAt(0) == 0 ? t1 : t1; + } + }, + join$0(_) { + return this.join$1(0, ""); + }, + where$1(_, test) { + return this.super$Iterable$where(0, test); + }, + map$1$1(_, toElement, $T) { + return new A.MappedListIterable(this, toElement, A._instanceType(this)._eval$1("@")._bind$1($T)._eval$1("MappedListIterable<1,2>")); + }, + reduce$1(_, combine) { + var value, i, _this = this, + $length = _this.get$length(_this); + if ($length === 0) + throw A.wrapException(A.IterableElementError_noElement()); + value = _this.elementAt$1(0, 0); + for (i = 1; i < $length; ++i) { + value = combine.call$2(value, _this.elementAt$1(0, i)); + if ($length !== _this.get$length(_this)) + throw A.wrapException(A.ConcurrentModificationError$(_this)); + } + return value; + }, + fold$1$2(_, initialValue, combine) { + var value, i, _this = this, + $length = _this.get$length(_this); + for (value = initialValue, i = 0; i < $length; ++i) { + value = combine.call$2(value, _this.elementAt$1(0, i)); + if ($length !== _this.get$length(_this)) + throw A.wrapException(A.ConcurrentModificationError$(_this)); + } + return value; + }, + fold$2(_, initialValue, combine) { + return this.fold$1$2(0, initialValue, combine, type$.dynamic); + }, + skip$1(_, count) { + return A.SubListIterable$(this, count, null, A._instanceType(this)._eval$1("ListIterable.E")); + }, + take$1(_, count) { + return A.SubListIterable$(this, 0, A.checkNotNullable(count, "count", type$.int), A._instanceType(this)._eval$1("ListIterable.E")); + }, + toList$1$growable(_, growable) { + return A.List_List$of(this, true, A._instanceType(this)._eval$1("ListIterable.E")); + }, + toList$0(_) { + return this.toList$1$growable(0, true); + }, + toSet$0(_) { + var i, _this = this, + result = A.LinkedHashSet_LinkedHashSet(A._instanceType(_this)._eval$1("ListIterable.E")); + for (i = 0; i < _this.get$length(_this); ++i) + result.add$1(0, _this.elementAt$1(0, i)); + return result; + } + }; + A.SubListIterable.prototype = { + SubListIterable$3(_iterable, _start, _endOrLength, $E) { + var endOrLength, + t1 = this._start; + A.RangeError_checkNotNegative(t1, "start"); + endOrLength = this._endOrLength; + if (endOrLength != null) { + A.RangeError_checkNotNegative(endOrLength, "end"); + if (t1 > endOrLength) + throw A.wrapException(A.RangeError$range(t1, 0, endOrLength, "start", null)); + } + }, + get$_endIndex() { + var $length = J.get$length$asx(this.__internal$_iterable), + endOrLength = this._endOrLength; + if (endOrLength == null || endOrLength > $length) + return $length; + return endOrLength; + }, + get$_startIndex() { + var $length = J.get$length$asx(this.__internal$_iterable), + t1 = this._start; + if (t1 > $length) + return $length; + return t1; + }, + get$length(_) { + var endOrLength, + $length = J.get$length$asx(this.__internal$_iterable), + t1 = this._start; + if (t1 >= $length) + return 0; + endOrLength = this._endOrLength; + if (endOrLength == null || endOrLength >= $length) + return $length - t1; + return endOrLength - t1; + }, + elementAt$1(_, index) { + var _this = this, + realIndex = _this.get$_startIndex() + index; + if (index < 0 || realIndex >= _this.get$_endIndex()) + throw A.wrapException(A.IndexError$withLength(index, _this.get$length(0), _this, null, "index")); + return J.elementAt$1$ax(_this.__internal$_iterable, realIndex); + }, + skip$1(_, count) { + var newStart, endOrLength, _this = this; + A.RangeError_checkNotNegative(count, "count"); + newStart = _this._start + count; + endOrLength = _this._endOrLength; + if (endOrLength != null && newStart >= endOrLength) + return new A.EmptyIterable(_this.$ti._eval$1("EmptyIterable<1>")); + return A.SubListIterable$(_this.__internal$_iterable, newStart, endOrLength, _this.$ti._precomputed1); + }, + take$1(_, count) { + var endOrLength, t1, newEnd, _this = this; + A.RangeError_checkNotNegative(count, "count"); + endOrLength = _this._endOrLength; + t1 = _this._start; + newEnd = t1 + count; + if (endOrLength == null) + return A.SubListIterable$(_this.__internal$_iterable, t1, newEnd, _this.$ti._precomputed1); + else { + if (endOrLength < newEnd) + return _this; + return A.SubListIterable$(_this.__internal$_iterable, t1, newEnd, _this.$ti._precomputed1); + } + }, + toList$1$growable(_, growable) { + var $length, result, i, _this = this, + start = _this._start, + t1 = _this.__internal$_iterable, + t2 = J.getInterceptor$asx(t1), + end = t2.get$length(t1), + endOrLength = _this._endOrLength; + if (endOrLength != null && endOrLength < end) + end = endOrLength; + $length = end - start; + if ($length <= 0) { + t1 = _this.$ti._precomputed1; + return growable ? J.JSArray_JSArray$growable(0, t1) : J.JSArray_JSArray$fixed(0, t1); + } + result = A.List_List$filled($length, t2.elementAt$1(t1, start), growable, _this.$ti._precomputed1); + for (i = 1; i < $length; ++i) { + result[i] = t2.elementAt$1(t1, start + i); + if (t2.get$length(t1) < end) + throw A.wrapException(A.ConcurrentModificationError$(_this)); + } + return result; + }, + toList$0(_) { + return this.toList$1$growable(0, true); + } + }; + A.ListIterator.prototype = { + get$current(_) { + var t1 = this.__internal$_current; + return t1 == null ? this.$ti._precomputed1._as(t1) : t1; + }, + moveNext$0() { + var t3, _this = this, + t1 = _this.__internal$_iterable, + t2 = J.getInterceptor$asx(t1), + $length = t2.get$length(t1); + if (_this.__internal$_length !== $length) + throw A.wrapException(A.ConcurrentModificationError$(t1)); + t3 = _this.__internal$_index; + if (t3 >= $length) { + _this.__internal$_current = null; + return false; + } + _this.__internal$_current = t2.elementAt$1(t1, t3); + ++_this.__internal$_index; + return true; + } + }; + A.MappedIterable.prototype = { + get$iterator(_) { + var t1 = A._instanceType(this); + return new A.MappedIterator(J.get$iterator$ax(this.__internal$_iterable), this._f, t1._eval$1("@<1>")._bind$1(t1._rest[1])._eval$1("MappedIterator<1,2>")); + }, + get$length(_) { + return J.get$length$asx(this.__internal$_iterable); + }, + get$isEmpty(_) { + return J.get$isEmpty$asx(this.__internal$_iterable); + }, + get$first(_) { + return this._f.call$1(J.get$first$ax(this.__internal$_iterable)); + }, + get$last(_) { + return this._f.call$1(J.get$last$ax(this.__internal$_iterable)); + }, + get$single(_) { + return this._f.call$1(J.get$single$ax(this.__internal$_iterable)); + }, + elementAt$1(_, index) { + return this._f.call$1(J.elementAt$1$ax(this.__internal$_iterable, index)); + } + }; + A.EfficientLengthMappedIterable.prototype = {$isEfficientLengthIterable: 1}; + A.MappedIterator.prototype = { + moveNext$0() { + var _this = this, + t1 = _this._iterator; + if (t1.moveNext$0()) { + _this.__internal$_current = _this._f.call$1(t1.get$current(t1)); + return true; + } + _this.__internal$_current = null; + return false; + }, + get$current(_) { + var t1 = this.__internal$_current; + return t1 == null ? this.$ti._rest[1]._as(t1) : t1; + } + }; + A.MappedListIterable.prototype = { + get$length(_) { + return J.get$length$asx(this._source); + }, + elementAt$1(_, index) { + return this._f.call$1(J.elementAt$1$ax(this._source, index)); + } + }; + A.WhereIterable.prototype = { + get$iterator(_) { + return new A.WhereIterator(J.get$iterator$ax(this.__internal$_iterable), this._f); + }, + map$1$1(_, toElement, $T) { + return new A.MappedIterable(this, toElement, this.$ti._eval$1("@<1>")._bind$1($T)._eval$1("MappedIterable<1,2>")); + } + }; + A.WhereIterator.prototype = { + moveNext$0() { + var t1, t2; + for (t1 = this._iterator, t2 = this._f; t1.moveNext$0();) + if (t2.call$1(t1.get$current(t1))) + return true; + return false; + }, + get$current(_) { + var t1 = this._iterator; + return t1.get$current(t1); + } + }; + A.ExpandIterable.prototype = { + get$iterator(_) { + var t1 = this.$ti; + return new A.ExpandIterator(J.get$iterator$ax(this.__internal$_iterable), this._f, B.C_EmptyIterator, t1._eval$1("@<1>")._bind$1(t1._rest[1])._eval$1("ExpandIterator<1,2>")); + } + }; + A.ExpandIterator.prototype = { + get$current(_) { + var t1 = this.__internal$_current; + return t1 == null ? this.$ti._rest[1]._as(t1) : t1; + }, + moveNext$0() { + var t2, t3, _this = this, + t1 = _this._currentExpansion; + if (t1 == null) + return false; + for (t2 = _this._iterator, t3 = _this._f; !t1.moveNext$0();) { + _this.__internal$_current = null; + if (t2.moveNext$0()) { + _this._currentExpansion = null; + t1 = J.get$iterator$ax(t3.call$1(t2.get$current(t2))); + _this._currentExpansion = t1; + } else + return false; + } + t1 = _this._currentExpansion; + _this.__internal$_current = t1.get$current(t1); + return true; + } + }; + A.TakeIterable.prototype = { + get$iterator(_) { + return new A.TakeIterator(J.get$iterator$ax(this.__internal$_iterable), this._takeCount, A._instanceType(this)._eval$1("TakeIterator<1>")); + } + }; + A.EfficientLengthTakeIterable.prototype = { + get$length(_) { + var iterableLength = J.get$length$asx(this.__internal$_iterable), + t1 = this._takeCount; + if (iterableLength > t1) + return t1; + return iterableLength; + }, + $isEfficientLengthIterable: 1 + }; + A.TakeIterator.prototype = { + moveNext$0() { + if (--this._remaining >= 0) + return this._iterator.moveNext$0(); + this._remaining = -1; + return false; + }, + get$current(_) { + var t1; + if (this._remaining < 0) { + this.$ti._precomputed1._as(null); + return null; + } + t1 = this._iterator; + return t1.get$current(t1); + } + }; + A.SkipIterable.prototype = { + skip$1(_, count) { + A.ArgumentError_checkNotNull(count, "count"); + A.RangeError_checkNotNegative(count, "count"); + return new A.SkipIterable(this.__internal$_iterable, this._skipCount + count, A._instanceType(this)._eval$1("SkipIterable<1>")); + }, + get$iterator(_) { + return new A.SkipIterator(J.get$iterator$ax(this.__internal$_iterable), this._skipCount); + } + }; + A.EfficientLengthSkipIterable.prototype = { + get$length(_) { + var $length = J.get$length$asx(this.__internal$_iterable) - this._skipCount; + if ($length >= 0) + return $length; + return 0; + }, + skip$1(_, count) { + A.ArgumentError_checkNotNull(count, "count"); + A.RangeError_checkNotNegative(count, "count"); + return new A.EfficientLengthSkipIterable(this.__internal$_iterable, this._skipCount + count, this.$ti); + }, + $isEfficientLengthIterable: 1 + }; + A.SkipIterator.prototype = { + moveNext$0() { + var t1, i; + for (t1 = this._iterator, i = 0; i < this._skipCount; ++i) + t1.moveNext$0(); + this._skipCount = 0; + return t1.moveNext$0(); + }, + get$current(_) { + var t1 = this._iterator; + return t1.get$current(t1); + } + }; + A.SkipWhileIterable.prototype = { + get$iterator(_) { + return new A.SkipWhileIterator(J.get$iterator$ax(this.__internal$_iterable), this._f); + } + }; + A.SkipWhileIterator.prototype = { + moveNext$0() { + var t1, t2, _this = this; + if (!_this._hasSkipped) { + _this._hasSkipped = true; + for (t1 = _this._iterator, t2 = _this._f; t1.moveNext$0();) + if (!t2.call$1(t1.get$current(t1))) + return true; + } + return _this._iterator.moveNext$0(); + }, + get$current(_) { + var t1 = this._iterator; + return t1.get$current(t1); + } + }; + A.EmptyIterable.prototype = { + get$iterator(_) { + return B.C_EmptyIterator; + }, + get$isEmpty(_) { + return true; + }, + get$length(_) { + return 0; + }, + get$first(_) { + throw A.wrapException(A.IterableElementError_noElement()); + }, + get$last(_) { + throw A.wrapException(A.IterableElementError_noElement()); + }, + get$single(_) { + throw A.wrapException(A.IterableElementError_noElement()); + }, + elementAt$1(_, index) { + throw A.wrapException(A.RangeError$range(index, 0, 0, "index", null)); + }, + contains$1(_, element) { + return false; + }, + every$1(_, test) { + return true; + }, + any$1(_, test) { + return false; + }, + join$1(_, separator) { + return ""; + }, + where$1(_, test) { + return this; + }, + map$1$1(_, toElement, $T) { + return new A.EmptyIterable($T._eval$1("EmptyIterable<0>")); + }, + skip$1(_, count) { + A.RangeError_checkNotNegative(count, "count"); + return this; + }, + take$1(_, count) { + A.RangeError_checkNotNegative(count, "count"); + return this; + }, + toList$1$growable(_, growable) { + var t1 = J.JSArray_JSArray$growable(0, this.$ti._precomputed1); + return t1; + }, + toList$0(_) { + return this.toList$1$growable(0, true); + }, + toSet$0(_) { + return A.LinkedHashSet_LinkedHashSet(this.$ti._precomputed1); + } + }; + A.EmptyIterator.prototype = { + moveNext$0() { + return false; + }, + get$current(_) { + throw A.wrapException(A.IterableElementError_noElement()); + } + }; + A.FollowedByIterable.prototype = { + get$iterator(_) { + return new A.FollowedByIterator(J.get$iterator$ax(this.__internal$_first), this._second); + }, + get$length(_) { + var t1 = this._second; + return J.get$length$asx(this.__internal$_first) + t1.get$length(t1); + }, + get$isEmpty(_) { + var t1; + if (J.get$isEmpty$asx(this.__internal$_first)) { + t1 = this._second; + t1 = t1.get$isEmpty(t1); + } else + t1 = false; + return t1; + }, + get$isNotEmpty(_) { + var t1; + if (!J.get$isNotEmpty$asx(this.__internal$_first)) { + t1 = this._second; + t1 = t1.get$isNotEmpty(t1); + } else + t1 = true; + return t1; + }, + contains$1(_, value) { + var t1; + if (!J.contains$1$asx(this.__internal$_first, value)) { + t1 = this._second; + t1 = t1.contains$1(t1, value); + } else + t1 = true; + return t1; + }, + get$first(_) { + var t1, + iterator = J.get$iterator$ax(this.__internal$_first); + if (iterator.moveNext$0()) + return iterator.get$current(iterator); + t1 = this._second; + return t1.get$first(t1); + }, + get$last(_) { + var last, + t1 = this._second, + iterator = t1.get$iterator(t1); + if (iterator.moveNext$0()) { + last = iterator.get$current(iterator); + for (; iterator.moveNext$0();) + last = iterator.get$current(iterator); + return last; + } + return J.get$last$ax(this.__internal$_first); + } + }; + A.EfficientLengthFollowedByIterable.prototype = { + elementAt$1(_, index) { + var t1 = this.__internal$_first, + t2 = J.getInterceptor$asx(t1), + firstLength = t2.get$length(t1); + if (index < firstLength) + return t2.elementAt$1(t1, index); + t1 = this._second; + return t1.elementAt$1(t1, index - firstLength); + }, + get$first(_) { + var t1 = this.__internal$_first, + t2 = J.getInterceptor$asx(t1); + if (t2.get$isNotEmpty(t1)) + return t2.get$first(t1); + t1 = this._second; + return t1.get$first(t1); + }, + get$last(_) { + var t1 = this._second; + if (t1.get$isNotEmpty(t1)) + return t1.get$last(t1); + return J.get$last$ax(this.__internal$_first); + }, + $isEfficientLengthIterable: 1 + }; + A.FollowedByIterator.prototype = { + moveNext$0() { + var t1, _this = this; + if (_this._currentIterator.moveNext$0()) + return true; + t1 = _this._nextIterable; + if (t1 != null) { + t1 = t1.get$iterator(t1); + _this._currentIterator = t1; + _this._nextIterable = null; + return t1.moveNext$0(); + } + return false; + }, + get$current(_) { + var t1 = this._currentIterator; + return t1.get$current(t1); + } + }; + A.WhereTypeIterable.prototype = { + get$iterator(_) { + return new A.WhereTypeIterator(J.get$iterator$ax(this._source), this.$ti._eval$1("WhereTypeIterator<1>")); + } + }; + A.WhereTypeIterator.prototype = { + moveNext$0() { + var t1, t2; + for (t1 = this._source, t2 = this.$ti._precomputed1; t1.moveNext$0();) + if (t2._is(t1.get$current(t1))) + return true; + return false; + }, + get$current(_) { + var t1 = this._source; + return this.$ti._precomputed1._as(t1.get$current(t1)); + } + }; + A.FixedLengthListMixin.prototype = { + set$length(receiver, newLength) { + throw A.wrapException(A.UnsupportedError$("Cannot change the length of a fixed-length list")); + }, + add$1(receiver, value) { + throw A.wrapException(A.UnsupportedError$("Cannot add to a fixed-length list")); + }, + addAll$1(receiver, iterable) { + throw A.wrapException(A.UnsupportedError$("Cannot add to a fixed-length list")); + }, + removeRange$2(receiver, start, end) { + throw A.wrapException(A.UnsupportedError$("Cannot remove from a fixed-length list")); + } + }; + A.UnmodifiableListMixin.prototype = { + $indexSet(_, index, value) { + throw A.wrapException(A.UnsupportedError$("Cannot modify an unmodifiable list")); + }, + set$length(_, newLength) { + throw A.wrapException(A.UnsupportedError$("Cannot change the length of an unmodifiable list")); + }, + add$1(_, value) { + throw A.wrapException(A.UnsupportedError$("Cannot add to an unmodifiable list")); + }, + addAll$1(_, iterable) { + throw A.wrapException(A.UnsupportedError$("Cannot add to an unmodifiable list")); + }, + sort$1(_, compare) { + throw A.wrapException(A.UnsupportedError$("Cannot modify an unmodifiable list")); + }, + setRange$4(_, start, end, iterable, skipCount) { + throw A.wrapException(A.UnsupportedError$("Cannot modify an unmodifiable list")); + }, + removeRange$2(_, start, end) { + throw A.wrapException(A.UnsupportedError$("Cannot remove from an unmodifiable list")); + }, + fillRange$3(_, start, end, fillValue) { + throw A.wrapException(A.UnsupportedError$("Cannot modify an unmodifiable list")); + } + }; + A.UnmodifiableListBase.prototype = {}; + A.ReversedListIterable.prototype = { + get$length(_) { + return J.get$length$asx(this._source); + }, + elementAt$1(_, index) { + var t1 = this._source, + t2 = J.getInterceptor$asx(t1); + return t2.elementAt$1(t1, t2.get$length(t1) - 1 - index); + } + }; + A.Symbol.prototype = { + get$hashCode(_) { + var hash = this._hashCode; + if (hash != null) + return hash; + hash = 664597 * B.JSString_methods.get$hashCode(this.__internal$_name) & 536870911; + this._hashCode = hash; + return hash; + }, + toString$0(_) { + return 'Symbol("' + this.__internal$_name + '")'; + }, + $eq(_, other) { + if (other == null) + return false; + return other instanceof A.Symbol && this.__internal$_name === other.__internal$_name; + }, + $isSymbol0: 1 + }; + A.__CastListBase__CastIterableBase_ListMixin.prototype = {}; + A._Record_2.prototype = {$recipe: "+(1,2)", $shape: 1}; + A._Record_2_forImport.prototype = {$recipe: "+forImport(1,2)", $shape: 2}; + A._Record_2_imports_modules.prototype = {$recipe: "+imports,modules(1,2)", $shape: 4}; + A._Record_2_loadedUrls_stylesheet.prototype = {$recipe: "+loadedUrls,stylesheet(1,2)", $shape: 5}; + A._Record_2_sourceMap.prototype = {$recipe: "+sourceMap(1,2)", $shape: 3}; + A._Record_3.prototype = {$recipe: "+(1,2,3)", $shape: 6}; + A._Record_3_importer_isDependency.prototype = {$recipe: "+importer,isDependency(1,2,3)", $shape: 8}; + A._Record_3_originalUrl.prototype = {$recipe: "+originalUrl(1,2,3)", $shape: 7}; + A._Record_4_baseImporter_baseUrl_forImport.prototype = {$recipe: "+baseImporter,baseUrl,forImport(1,2,3,4)", $shape: 10}; + A._Record_5_named_namedNodes_positional_positionalNodes_separator.prototype = {$recipe: "+named,namedNodes,positional,positionalNodes,separator(1,2,3,4,5)", $shape: 11}; + A.ConstantMapView.prototype = {}; + A.ConstantMap.prototype = { + cast$2$0(_, RK, RV) { + var t1 = A._instanceType(this); + return A.Map_castFrom(this, t1._precomputed1, t1._rest[1], RK, RV); + }, + get$isEmpty(_) { + return this.get$length(this) === 0; + }, + get$isNotEmpty(_) { + return this.get$length(this) !== 0; + }, + toString$0(_) { + return A.MapBase_mapToString(this); + }, + $indexSet(_, key, value) { + A.ConstantMap__throwUnmodifiable(); + }, + remove$1(_, key) { + A.ConstantMap__throwUnmodifiable(); + }, + addAll$1(_, other) { + A.ConstantMap__throwUnmodifiable(); + }, + get$entries(_) { + return new A._SyncStarIterable(this.entries$body$ConstantMap(0), A._instanceType(this)._eval$1("_SyncStarIterable>")); + }, + entries$body$ConstantMap($async$_) { + var $async$self = this; + return function() { + var _ = $async$_; + var $async$goto = 0, $async$handler = 1, $async$currentError, t1, t2, key; + return function $async$get$entries($async$iterator, $async$errorCode, $async$result) { + if ($async$errorCode === 1) { + $async$currentError = $async$result; + $async$goto = $async$handler; + } + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.get$keys($async$self), t1 = t1.get$iterator(t1), t2 = A._instanceType($async$self), t2 = t2._eval$1("@<1>")._bind$1(t2._rest[1])._eval$1("MapEntry<1,2>"); + case 2: + // for condition + if (!t1.moveNext$0()) { + // goto after for + $async$goto = 3; + break; + } + key = t1.get$current(t1); + $async$goto = 4; + return $async$iterator._async$_current = new A.MapEntry(key, $async$self.$index(0, key), t2), 1; + case 4: + // after yield + // goto for condition + $async$goto = 2; + break; + case 3: + // after for + // implicit return + return 0; + case 1: + // rethrow + return $async$iterator._datum = $async$currentError, 3; + } + }; + }; + }, + $isMap: 1 + }; + A.ConstantStringMap.prototype = { + get$length(_) { + return this._values.length; + }, + get$_keys() { + var keys = this.$keys; + if (keys == null) { + keys = Object.keys(this._jsIndex); + this.$keys = keys; + } + return keys; + }, + containsKey$1(key) { + if (typeof key != "string") + return false; + if ("__proto__" === key) + return false; + return this._jsIndex.hasOwnProperty(key); + }, + $index(_, key) { + if (!this.containsKey$1(key)) + return null; + return this._values[this._jsIndex[key]]; + }, + forEach$1(_, f) { + var t1, i, + keys = this.get$_keys(), + values = this._values; + for (t1 = keys.length, i = 0; i < t1; ++i) + f.call$2(keys[i], values[i]); + }, + get$keys(_) { + return new A._KeysOrValues(this.get$_keys(), this.$ti._eval$1("_KeysOrValues<1>")); + }, + get$values(_) { + return new A._KeysOrValues(this._values, this.$ti._eval$1("_KeysOrValues<2>")); + } + }; + A._KeysOrValues.prototype = { + get$length(_) { + return this._elements.length; + }, + get$isEmpty(_) { + return 0 === this._elements.length; + }, + get$isNotEmpty(_) { + return 0 !== this._elements.length; + }, + get$iterator(_) { + var t1 = this._elements; + return new A._KeysOrValuesOrElementsIterator(t1, t1.length, this.$ti._eval$1("_KeysOrValuesOrElementsIterator<1>")); + } + }; + A._KeysOrValuesOrElementsIterator.prototype = { + get$current(_) { + var t1 = this.__js_helper$_current; + return t1 == null ? this.$ti._precomputed1._as(t1) : t1; + }, + moveNext$0() { + var _this = this, + t1 = _this.__js_helper$_index; + if (t1 >= _this.__js_helper$_length) { + _this.__js_helper$_current = null; + return false; + } + _this.__js_helper$_current = _this._elements[t1]; + _this.__js_helper$_index = t1 + 1; + return true; + } + }; + A.ConstantSet.prototype = { + add$1(_, value) { + A.ConstantSet__throwUnmodifiable(); + }, + addAll$1(_, elements) { + A.ConstantSet__throwUnmodifiable(); + }, + remove$1(_, value) { + A.ConstantSet__throwUnmodifiable(); + } + }; + A.ConstantStringSet.prototype = { + get$length(_) { + return this.__js_helper$_length; + }, + get$isEmpty(_) { + return this.__js_helper$_length === 0; + }, + get$isNotEmpty(_) { + return this.__js_helper$_length !== 0; + }, + get$iterator(_) { + var t1, _this = this, + keys = _this.$keys; + if (keys == null) { + keys = Object.keys(_this._jsIndex); + _this.$keys = keys; + } + t1 = keys; + return new A._KeysOrValuesOrElementsIterator(t1, t1.length, _this.$ti._eval$1("_KeysOrValuesOrElementsIterator<1>")); + }, + contains$1(_, key) { + if (typeof key != "string") + return false; + if ("__proto__" === key) + return false; + return this._jsIndex.hasOwnProperty(key); + }, + toSet$0(_) { + return A.LinkedHashSet_LinkedHashSet$of(this, this.$ti._precomputed1); + } + }; + A.GeneralConstantSet.prototype = { + get$length(_) { + return this._elements.length; + }, + get$isEmpty(_) { + return this._elements.length === 0; + }, + get$isNotEmpty(_) { + return this._elements.length !== 0; + }, + get$iterator(_) { + var t1 = this._elements; + return new A._KeysOrValuesOrElementsIterator(t1, t1.length, this.$ti._eval$1("_KeysOrValuesOrElementsIterator<1>")); + }, + _getMap$0() { + var t1, t2, _i, key, _this = this, + backingMap = _this.$map; + if (backingMap == null) { + t1 = _this.$ti; + backingMap = new A.JsConstantLinkedHashMap(t1._eval$1("@<1>")._bind$1(t1._precomputed1)._eval$1("JsConstantLinkedHashMap<1,2>")); + for (t1 = _this._elements, t2 = t1.length, _i = 0; _i < t1.length; t1.length === t2 || (0, A.throwConcurrentModificationError)(t1), ++_i) { + key = t1[_i]; + backingMap.$indexSet(0, key, key); + } + _this.$map = backingMap; + } + return backingMap; + }, + contains$1(_, key) { + return this._getMap$0().containsKey$1(key); + }, + toSet$0(_) { + return A.LinkedHashSet_LinkedHashSet$of(this, this.$ti._precomputed1); + } + }; + A.Instantiation.prototype = { + Instantiation$1(_genericClosure) { + if (false) + A.instantiatedGenericFunctionType(0, 0); + }, + $eq(_, other) { + if (other == null) + return false; + return other instanceof A.Instantiation && this._genericClosure.$eq(0, other._genericClosure) && A.getRuntimeTypeOfClosure(this) === A.getRuntimeTypeOfClosure(other); + }, + get$hashCode(_) { + return A.Object_hash(this._genericClosure, A.getRuntimeTypeOfClosure(this), B.C_SentinelValue, B.C_SentinelValue); + }, + toString$0(_) { + var t1 = B.JSArray_methods.join$1(this.get$_types(), ", "); + return this._genericClosure.toString$0(0) + " with " + ("<" + t1 + ">"); + } + }; + A.Instantiation1.prototype = { + get$_types() { + return [A.createRuntimeType(this.$ti._precomputed1)]; + }, + call$0() { + return this._genericClosure.call$1$0(this.$ti._rest[0]); + }, + call$2(a0, a1) { + return this._genericClosure.call$1$2(a0, a1, this.$ti._rest[0]); + }, + call$3(a0, a1, a2) { + return this._genericClosure.call$1$3(a0, a1, a2, this.$ti._rest[0]); + }, + call$4(a0, a1, a2, a3) { + return this._genericClosure.call$1$4(a0, a1, a2, a3, this.$ti._rest[0]); + }, + $signature() { + return A.instantiatedGenericFunctionType(A.closureFunctionType(this._genericClosure), this.$ti); + } + }; + A.JSInvocationMirror.prototype = { + get$memberName() { + var t1 = this.__js_helper$_memberName; + if (t1 instanceof A.Symbol) + return t1; + return this.__js_helper$_memberName = new A.Symbol(t1); + }, + get$positionalArguments() { + var t1, t2, argumentCount, list, index, _this = this; + if (_this.__js_helper$_kind === 1) + return B.List_empty6; + t1 = _this._arguments; + t2 = J.getInterceptor$asx(t1); + argumentCount = t2.get$length(t1) - J.get$length$asx(_this._namedArgumentNames) - _this._typeArgumentCount; + if (argumentCount === 0) + return B.List_empty6; + list = []; + for (index = 0; index < argumentCount; ++index) + list.push(t2.$index(t1, index)); + return J.JSArray_markUnmodifiableList(list); + }, + get$namedArguments() { + var t1, t2, namedArgumentCount, t3, t4, namedArgumentsStartIndex, map, i, _this = this; + if (_this.__js_helper$_kind !== 0) + return B.Map_empty3; + t1 = _this._namedArgumentNames; + t2 = J.getInterceptor$asx(t1); + namedArgumentCount = t2.get$length(t1); + t3 = _this._arguments; + t4 = J.getInterceptor$asx(t3); + namedArgumentsStartIndex = t4.get$length(t3) - namedArgumentCount - _this._typeArgumentCount; + if (namedArgumentCount === 0) + return B.Map_empty3; + map = new A.JsLinkedHashMap(type$.JsLinkedHashMap_Symbol_dynamic); + for (i = 0; i < namedArgumentCount; ++i) + map.$indexSet(0, new A.Symbol(t2.$index(t1, i)), t4.$index(t3, namedArgumentsStartIndex + i)); + return new A.ConstantMapView(map, type$.ConstantMapView_Symbol_dynamic); + } + }; + A.Primitives_functionNoSuchMethod_closure.prototype = { + call$2($name, argument) { + var t1 = this._box_0; + t1.names = t1.names + "$" + $name; + this.namedArgumentList.push($name); + this.$arguments.push(argument); + ++t1.argumentCount; + }, + $signature: 129 + }; + A.TypeErrorDecoder.prototype = { + matchTypeError$1(message) { + var result, t1, _this = this, + match = new RegExp(_this._pattern).exec(message); + if (match == null) + return null; + result = Object.create(null); + t1 = _this._arguments; + if (t1 !== -1) + result.arguments = match[t1 + 1]; + t1 = _this._argumentsExpr; + if (t1 !== -1) + result.argumentsExpr = match[t1 + 1]; + t1 = _this._expr; + if (t1 !== -1) + result.expr = match[t1 + 1]; + t1 = _this._method; + if (t1 !== -1) + result.method = match[t1 + 1]; + t1 = _this._receiver; + if (t1 !== -1) + result.receiver = match[t1 + 1]; + return result; + } + }; + A.NullError.prototype = { + toString$0(_) { + return "Null check operator used on a null value"; + } + }; + A.JsNoSuchMethodError.prototype = { + toString$0(_) { + var t2, _this = this, + _s38_ = "NoSuchMethodError: method not found: '", + t1 = _this._method; + if (t1 == null) + return "NoSuchMethodError: " + _this.__js_helper$_message; + t2 = _this._receiver; + if (t2 == null) + return _s38_ + t1 + "' (" + _this.__js_helper$_message + ")"; + return _s38_ + t1 + "' on '" + t2 + "' (" + _this.__js_helper$_message + ")"; + } + }; + A.UnknownJsTypeError.prototype = { + toString$0(_) { + var t1 = this.__js_helper$_message; + return t1.length === 0 ? "Error" : "Error: " + t1; + } + }; + A.NullThrownFromJavaScriptException.prototype = { + toString$0(_) { + return "Throw of null ('" + (this._irritant === null ? "null" : "undefined") + "' from JavaScript)"; + }, + $isException: 1 + }; + A.ExceptionAndStackTrace.prototype = {}; + A._StackTrace.prototype = { + toString$0(_) { + var trace, + t1 = this._trace; + if (t1 != null) + return t1; + t1 = this._exception; + trace = t1 !== null && typeof t1 === "object" ? t1.stack : null; + return this._trace = trace == null ? "" : trace; + }, + $isStackTrace: 1 + }; + A.Closure.prototype = { + toString$0(_) { + var $constructor = this.constructor, + $name = $constructor == null ? null : $constructor.name; + return "Closure '" + A.unminifyOrTag($name == null ? "unknown" : $name) + "'"; + }, + $isFunction: 1, + get$$call() { + return this; + }, + "call*": "call$1", + $requiredArgCount: 1, + $defaultValues: null + }; + A.Closure0Args.prototype = {"call*": "call$0", $requiredArgCount: 0}; + A.Closure2Args.prototype = {"call*": "call$2", $requiredArgCount: 2}; + A.TearOffClosure.prototype = {}; + A.StaticClosure.prototype = { + toString$0(_) { + var $name = this.$static_name; + if ($name == null) + return "Closure of unknown static method"; + return "Closure '" + A.unminifyOrTag($name) + "'"; + } + }; + A.BoundClosure.prototype = { + $eq(_, other) { + if (other == null) + return false; + if (this === other) + return true; + if (!(other instanceof A.BoundClosure)) + return false; + return this.$_target === other.$_target && this._receiver === other._receiver; + }, + get$hashCode(_) { + return (A.objectHashCode(this._receiver) ^ A.Primitives_objectHashCode(this.$_target)) >>> 0; + }, + toString$0(_) { + return "Closure '" + this.$_name + "' of " + ("Instance of '" + A.Primitives_objectTypeName(this._receiver) + "'"); + } + }; + A._CyclicInitializationError.prototype = { + toString$0(_) { + return "Reading static variable '" + this.variableName + "' during its initialization"; + } + }; + A.RuntimeError.prototype = { + toString$0(_) { + return "RuntimeError: " + this.message; + }, + get$message(receiver) { + return this.message; + } + }; + A._Required.prototype = {}; + A.JsLinkedHashMap.prototype = { + get$length(_) { + return this.__js_helper$_length; + }, + get$isEmpty(_) { + return this.__js_helper$_length === 0; + }, + get$isNotEmpty(_) { + return this.__js_helper$_length !== 0; + }, + get$keys(_) { + return new A.LinkedHashMapKeyIterable(this, A._instanceType(this)._eval$1("LinkedHashMapKeyIterable<1>")); + }, + get$values(_) { + var t1 = A._instanceType(this); + return A.MappedIterable_MappedIterable(new A.LinkedHashMapKeyIterable(this, t1._eval$1("LinkedHashMapKeyIterable<1>")), new A.JsLinkedHashMap_values_closure(this), t1._precomputed1, t1._rest[1]); + }, + containsKey$1(key) { + var strings, nums; + if (typeof key == "string") { + strings = this._strings; + if (strings == null) + return false; + return strings[key] != null; + } else if (typeof key == "number" && (key & 0x3fffffff) === key) { + nums = this._nums; + if (nums == null) + return false; + return nums[key] != null; + } else + return this.internalContainsKey$1(key); + }, + internalContainsKey$1(key) { + var rest = this.__js_helper$_rest; + if (rest == null) + return false; + return this.internalFindBucketIndex$2(rest[this.internalComputeHashCode$1(key)], key) >= 0; + }, + addAll$1(_, other) { + other.forEach$1(0, new A.JsLinkedHashMap_addAll_closure(this)); + }, + $index(_, key) { + var strings, cell, t1, nums, _null = null; + if (typeof key == "string") { + strings = this._strings; + if (strings == null) + return _null; + cell = strings[key]; + t1 = cell == null ? _null : cell.hashMapCellValue; + return t1; + } else if (typeof key == "number" && (key & 0x3fffffff) === key) { + nums = this._nums; + if (nums == null) + return _null; + cell = nums[key]; + t1 = cell == null ? _null : cell.hashMapCellValue; + return t1; + } else + return this.internalGet$1(key); + }, + internalGet$1(key) { + var bucket, index, + rest = this.__js_helper$_rest; + if (rest == null) + return null; + bucket = rest[this.internalComputeHashCode$1(key)]; + index = this.internalFindBucketIndex$2(bucket, key); + if (index < 0) + return null; + return bucket[index].hashMapCellValue; + }, + $indexSet(_, key, value) { + var strings, nums, _this = this; + if (typeof key == "string") { + strings = _this._strings; + _this._addHashTableEntry$3(strings == null ? _this._strings = _this._newHashTable$0() : strings, key, value); + } else if (typeof key == "number" && (key & 0x3fffffff) === key) { + nums = _this._nums; + _this._addHashTableEntry$3(nums == null ? _this._nums = _this._newHashTable$0() : nums, key, value); + } else + _this.internalSet$2(key, value); + }, + internalSet$2(key, value) { + var hash, bucket, index, _this = this, + rest = _this.__js_helper$_rest; + if (rest == null) + rest = _this.__js_helper$_rest = _this._newHashTable$0(); + hash = _this.internalComputeHashCode$1(key); + bucket = rest[hash]; + if (bucket == null) + rest[hash] = [_this._newLinkedCell$2(key, value)]; + else { + index = _this.internalFindBucketIndex$2(bucket, key); + if (index >= 0) + bucket[index].hashMapCellValue = value; + else + bucket.push(_this._newLinkedCell$2(key, value)); + } + }, + putIfAbsent$2(key, ifAbsent) { + var t1, value, _this = this; + if (_this.containsKey$1(key)) { + t1 = _this.$index(0, key); + return t1 == null ? A._instanceType(_this)._rest[1]._as(t1) : t1; + } + value = ifAbsent.call$0(); + _this.$indexSet(0, key, value); + return value; + }, + remove$1(_, key) { + var _this = this; + if (typeof key == "string") + return _this.__js_helper$_removeHashTableEntry$2(_this._strings, key); + else if (typeof key == "number" && (key & 0x3fffffff) === key) + return _this.__js_helper$_removeHashTableEntry$2(_this._nums, key); + else + return _this.internalRemove$1(key); + }, + internalRemove$1(key) { + var hash, bucket, index, cell, _this = this, + rest = _this.__js_helper$_rest; + if (rest == null) + return null; + hash = _this.internalComputeHashCode$1(key); + bucket = rest[hash]; + index = _this.internalFindBucketIndex$2(bucket, key); + if (index < 0) + return null; + cell = bucket.splice(index, 1)[0]; + _this.__js_helper$_unlinkCell$1(cell); + if (bucket.length === 0) + delete rest[hash]; + return cell.hashMapCellValue; + }, + clear$0(_) { + var _this = this; + if (_this.__js_helper$_length > 0) { + _this._strings = _this._nums = _this.__js_helper$_rest = _this._first = _this._last = null; + _this.__js_helper$_length = 0; + _this._modified$0(); + } + }, + forEach$1(_, action) { + var _this = this, + cell = _this._first, + modifications = _this._modifications; + for (; cell != null;) { + action.call$2(cell.hashMapCellKey, cell.hashMapCellValue); + if (modifications !== _this._modifications) + throw A.wrapException(A.ConcurrentModificationError$(_this)); + cell = cell._next; + } + }, + _addHashTableEntry$3(table, key, value) { + var cell = table[key]; + if (cell == null) + table[key] = this._newLinkedCell$2(key, value); + else + cell.hashMapCellValue = value; + }, + __js_helper$_removeHashTableEntry$2(table, key) { + var cell; + if (table == null) + return null; + cell = table[key]; + if (cell == null) + return null; + this.__js_helper$_unlinkCell$1(cell); + delete table[key]; + return cell.hashMapCellValue; + }, + _modified$0() { + this._modifications = this._modifications + 1 & 1073741823; + }, + _newLinkedCell$2(key, value) { + var t1, _this = this, + cell = new A.LinkedHashMapCell(key, value); + if (_this._first == null) + _this._first = _this._last = cell; + else { + t1 = _this._last; + t1.toString; + cell._previous = t1; + _this._last = t1._next = cell; + } + ++_this.__js_helper$_length; + _this._modified$0(); + return cell; + }, + __js_helper$_unlinkCell$1(cell) { + var _this = this, + previous = cell._previous, + next = cell._next; + if (previous == null) + _this._first = next; + else + previous._next = next; + if (next == null) + _this._last = previous; + else + next._previous = previous; + --_this.__js_helper$_length; + _this._modified$0(); + }, + internalComputeHashCode$1(key) { + return J.get$hashCode$(key) & 1073741823; + }, + internalFindBucketIndex$2(bucket, key) { + var $length, i; + if (bucket == null) + return -1; + $length = bucket.length; + for (i = 0; i < $length; ++i) + if (J.$eq$(bucket[i].hashMapCellKey, key)) + return i; + return -1; + }, + toString$0(_) { + return A.MapBase_mapToString(this); + }, + _newHashTable$0() { + var table = Object.create(null); + table[""] = table; + delete table[""]; + return table; + } + }; + A.JsLinkedHashMap_values_closure.prototype = { + call$1(each) { + var t1 = this.$this, + t2 = t1.$index(0, each); + return t2 == null ? A._instanceType(t1)._rest[1]._as(t2) : t2; + }, + $signature() { + return A._instanceType(this.$this)._eval$1("2(1)"); + } + }; + A.JsLinkedHashMap_addAll_closure.prototype = { + call$2(key, value) { + this.$this.$indexSet(0, key, value); + }, + $signature() { + return A._instanceType(this.$this)._eval$1("~(1,2)"); + } + }; + A.LinkedHashMapCell.prototype = {}; + A.LinkedHashMapKeyIterable.prototype = { + get$length(_) { + return this.__js_helper$_map.__js_helper$_length; + }, + get$isEmpty(_) { + return this.__js_helper$_map.__js_helper$_length === 0; + }, + get$iterator(_) { + var t1 = this.__js_helper$_map, + t2 = new A.LinkedHashMapKeyIterator(t1, t1._modifications); + t2._cell = t1._first; + return t2; + }, + contains$1(_, element) { + return this.__js_helper$_map.containsKey$1(element); + } + }; + A.LinkedHashMapKeyIterator.prototype = { + get$current(_) { + return this.__js_helper$_current; + }, + moveNext$0() { + var cell, _this = this, + t1 = _this.__js_helper$_map; + if (_this._modifications !== t1._modifications) + throw A.wrapException(A.ConcurrentModificationError$(t1)); + cell = _this._cell; + if (cell == null) { + _this.__js_helper$_current = null; + return false; + } else { + _this.__js_helper$_current = cell.hashMapCellKey; + _this._cell = cell._next; + return true; + } + } + }; + A.JsIdentityLinkedHashMap.prototype = { + internalComputeHashCode$1(key) { + return A.objectHashCode(key) & 1073741823; + }, + internalFindBucketIndex$2(bucket, key) { + var $length, i, t1; + if (bucket == null) + return -1; + $length = bucket.length; + for (i = 0; i < $length; ++i) { + t1 = bucket[i].hashMapCellKey; + if (t1 == null ? key == null : t1 === key) + return i; + } + return -1; + } + }; + A.JsConstantLinkedHashMap.prototype = { + internalComputeHashCode$1(key) { + return A.constantHashCode(key) & 1073741823; + }, + internalFindBucketIndex$2(bucket, key) { + var $length, i; + if (bucket == null) + return -1; + $length = bucket.length; + for (i = 0; i < $length; ++i) + if (J.$eq$(bucket[i].hashMapCellKey, key)) + return i; + return -1; + } + }; + A.initHooks_closure.prototype = { + call$1(o) { + return this.getTag(o); + }, + $signature: 106 + }; + A.initHooks_closure0.prototype = { + call$2(o, tag) { + return this.getUnknownTag(o, tag); + }, + $signature: 623 + }; + A.initHooks_closure1.prototype = { + call$1(tag) { + return this.prototypeForTag(tag); + }, + $signature: 219 + }; + A._Record.prototype = { + toString$0(_) { + return this._toString$1(false); + }, + _toString$1(safe) { + var t2, separator, i, key, value, + keys = this._fieldKeys$0(), + values = this._getFieldValues$0(), + t1 = (safe ? "" + "Record " : "") + "("; + for (t2 = keys.length, separator = "", i = 0; i < t2; ++i, separator = ", ") { + t1 += separator; + key = keys[i]; + if (typeof key == "string") + t1 = t1 + key + ": "; + value = values[i]; + t1 = safe ? t1 + A.Primitives_safeToString(value) : t1 + A.S(value); + } + t1 += ")"; + return t1.charCodeAt(0) == 0 ? t1 : t1; + }, + _fieldKeys$0() { + var t1, + shapeTag = this.$shape; + for (; $._Record__computedFieldKeys.length <= shapeTag;) + $._Record__computedFieldKeys.push(null); + t1 = $._Record__computedFieldKeys[shapeTag]; + if (t1 == null) { + t1 = this._computeFieldKeys$0(); + $._Record__computedFieldKeys[shapeTag] = t1; + } + return t1; + }, + _computeFieldKeys$0() { + var i, names, last, + recipe = this.$recipe, + position = recipe.indexOf("("), + joinedNames = recipe.substring(1, position), + fields = recipe.substring(position), + arity = fields === "()" ? 0 : fields.replace(/[^,]/g, "").length + 1, + t1 = type$.Object, + result = J.JSArray_JSArray$allocateGrowable(arity, t1); + for (i = 0; i < arity; ++i) + result[i] = i; + if (joinedNames !== "") { + names = joinedNames.split(","); + i = names.length; + for (last = arity; i > 0;) { + --last; + --i; + result[last] = names[i]; + } + } + return A.List_List$unmodifiable(result, t1); + } + }; + A._Record2.prototype = { + _getFieldValues$0() { + return [this._0, this._1]; + }, + $eq(_, other) { + if (other == null) + return false; + return other instanceof A._Record2 && this.$shape === other.$shape && J.$eq$(this._0, other._0) && J.$eq$(this._1, other._1); + }, + get$hashCode(_) { + return A.Object_hash(this.$shape, this._0, this._1, B.C_SentinelValue); + } + }; + A._Record3.prototype = { + _getFieldValues$0() { + return [this._0, this._1, this._2]; + }, + $eq(_, other) { + var _this = this; + if (other == null) + return false; + return other instanceof A._Record3 && _this.$shape === other.$shape && J.$eq$(_this._0, other._0) && J.$eq$(_this._1, other._1) && J.$eq$(_this._2, other._2); + }, + get$hashCode(_) { + var _this = this; + return A.Object_hash(_this.$shape, _this._0, _this._1, _this._2); + } + }; + A._RecordN.prototype = { + _getFieldValues$0() { + return this._values; + }, + $eq(_, other) { + if (other == null) + return false; + return other instanceof A._RecordN && this.$shape === other.$shape && A._RecordN__equalValues(this._values, other._values); + }, + get$hashCode(_) { + return A.Object_hash(this.$shape, A.Object_hashAll(this._values), B.C_SentinelValue, B.C_SentinelValue); + } + }; + A.JSSyntaxRegExp.prototype = { + toString$0(_) { + return "RegExp/" + this.pattern + "/" + this._nativeRegExp.flags; + }, + get$_nativeGlobalVersion() { + var _this = this, + t1 = _this._nativeGlobalRegExp; + if (t1 != null) + return t1; + t1 = _this._nativeRegExp; + return _this._nativeGlobalRegExp = A.JSSyntaxRegExp_makeNative(_this.pattern, t1.multiline, !t1.ignoreCase, t1.unicode, t1.dotAll, true); + }, + get$_nativeAnchoredVersion() { + var _this = this, + t1 = _this._nativeAnchoredRegExp; + if (t1 != null) + return t1; + t1 = _this._nativeRegExp; + return _this._nativeAnchoredRegExp = A.JSSyntaxRegExp_makeNative(_this.pattern + "|()", t1.multiline, !t1.ignoreCase, t1.unicode, t1.dotAll, true); + }, + firstMatch$1(string) { + var m = this._nativeRegExp.exec(string); + if (m == null) + return null; + return new A._MatchImplementation(m); + }, + allMatches$2(_, string, start) { + var t1 = string.length; + if (start > t1) + throw A.wrapException(A.RangeError$range(start, 0, t1, null, null)); + return new A._AllMatchesIterable(this, string, start); + }, + allMatches$1(_, string) { + return this.allMatches$2(0, string, 0); + }, + _execGlobal$2(string, start) { + var match, + regexp = this.get$_nativeGlobalVersion(); + regexp.lastIndex = start; + match = regexp.exec(string); + if (match == null) + return null; + return new A._MatchImplementation(match); + }, + _execAnchored$2(string, start) { + var match, + regexp = this.get$_nativeAnchoredVersion(); + regexp.lastIndex = start; + match = regexp.exec(string); + if (match == null) + return null; + if (match.pop() != null) + return null; + return new A._MatchImplementation(match); + }, + matchAsPrefix$2(_, string, start) { + if (start < 0 || start > string.length) + throw A.wrapException(A.RangeError$range(start, 0, string.length, null, null)); + return this._execAnchored$2(string, start); + } + }; + A._MatchImplementation.prototype = { + get$start(_) { + return this._match.index; + }, + get$end(_) { + var t1 = this._match; + return t1.index + t1[0].length; + }, + $isMatch: 1, + $isRegExpMatch: 1 + }; + A._AllMatchesIterable.prototype = { + get$iterator(_) { + return new A._AllMatchesIterator(this._re, this.__js_helper$_string, this.__js_helper$_start); + } + }; + A._AllMatchesIterator.prototype = { + get$current(_) { + var t1 = this.__js_helper$_current; + return t1 == null ? type$.RegExpMatch._as(t1) : t1; + }, + moveNext$0() { + var t1, t2, t3, match, nextIndex, _this = this, + string = _this.__js_helper$_string; + if (string == null) + return false; + t1 = _this._nextIndex; + t2 = string.length; + if (t1 <= t2) { + t3 = _this._regExp; + match = t3._execGlobal$2(string, t1); + if (match != null) { + _this.__js_helper$_current = match; + nextIndex = match.get$end(0); + if (match._match.index === nextIndex) { + if (t3._nativeRegExp.unicode) { + t1 = _this._nextIndex; + t3 = t1 + 1; + if (t3 < t2) { + t1 = string.charCodeAt(t1); + if (t1 >= 55296 && t1 <= 56319) { + t1 = string.charCodeAt(t3); + t1 = t1 >= 56320 && t1 <= 57343; + } else + t1 = false; + } else + t1 = false; + } else + t1 = false; + nextIndex = (t1 ? nextIndex + 1 : nextIndex) + 1; + } + _this._nextIndex = nextIndex; + return true; + } + } + _this.__js_helper$_string = _this.__js_helper$_current = null; + return false; + } + }; + A.StringMatch.prototype = { + get$end(_) { + return this.start + this.pattern.length; + }, + $isMatch: 1, + get$start(receiver) { + return this.start; + } + }; + A._StringAllMatchesIterable.prototype = { + get$iterator(_) { + return new A._StringAllMatchesIterator(this._input, this._pattern, this.__js_helper$_index); + }, + get$first(_) { + var t1 = this._pattern, + index = this._input.indexOf(t1, this.__js_helper$_index); + if (index >= 0) + return new A.StringMatch(index, t1); + throw A.wrapException(A.IterableElementError_noElement()); + } + }; + A._StringAllMatchesIterator.prototype = { + moveNext$0() { + var index, end, _this = this, + t1 = _this.__js_helper$_index, + t2 = _this._pattern, + t3 = t2.length, + t4 = _this._input, + t5 = t4.length; + if (t1 + t3 > t5) { + _this.__js_helper$_current = null; + return false; + } + index = t4.indexOf(t2, t1); + if (index < 0) { + _this.__js_helper$_index = t5 + 1; + _this.__js_helper$_current = null; + return false; + } + end = index + t3; + _this.__js_helper$_current = new A.StringMatch(index, t2); + _this.__js_helper$_index = end === _this.__js_helper$_index ? end + 1 : end; + return true; + }, + get$current(_) { + var t1 = this.__js_helper$_current; + t1.toString; + return t1; + } + }; + A._Cell.prototype = { + readLocal$1$0() { + var t1 = this._value; + if (t1 === this) + A.throwExpression(new A.LateError("Local '" + this.__late_helper$_name + "' has not been initialized.")); + return t1; + }, + readLocal$0() { + return this.readLocal$1$0(type$.dynamic); + }, + _readLocal$0() { + var t1 = this._value; + if (t1 === this) + throw A.wrapException(new A.LateError("Local '" + this.__late_helper$_name + "' has not been initialized.")); + return t1; + } + }; + A.NativeByteBuffer.prototype = { + get$runtimeType(receiver) { + return B.Type_ByteBuffer_RkP; + }, + $isTrustedGetRuntimeType: 1, + $isByteBuffer: 1 + }; + A.NativeTypedData.prototype = { + _invalidPosition$3(receiver, position, $length, $name) { + var t1 = A.RangeError$range(position, 0, $length, $name, null); + throw A.wrapException(t1); + }, + _checkPosition$3(receiver, position, $length, $name) { + if (position >>> 0 !== position || position > $length) + this._invalidPosition$3(receiver, position, $length, $name); + } + }; + A.NativeByteData.prototype = { + get$runtimeType(receiver) { + return B.Type_ByteData_zNC; + }, + $isTrustedGetRuntimeType: 1, + $isByteData: 1 + }; + A.NativeTypedArray.prototype = { + get$length(receiver) { + return receiver.length; + }, + _setRangeFast$4(receiver, start, end, source, skipCount) { + var count, sourceLength, + targetLength = receiver.length; + this._checkPosition$3(receiver, start, targetLength, "start"); + this._checkPosition$3(receiver, end, targetLength, "end"); + if (start > end) + throw A.wrapException(A.RangeError$range(start, 0, end, null, null)); + count = end - start; + if (skipCount < 0) + throw A.wrapException(A.ArgumentError$(skipCount, null)); + sourceLength = source.length; + if (sourceLength - skipCount < count) + throw A.wrapException(A.StateError$("Not enough elements")); + if (skipCount !== 0 || sourceLength !== count) + source = source.subarray(skipCount, skipCount + count); + receiver.set(source, start); + }, + $isJavaScriptIndexingBehavior: 1 + }; + A.NativeTypedArrayOfDouble.prototype = { + $index(receiver, index) { + A._checkValidIndex(index, receiver, receiver.length); + return receiver[index]; + }, + $indexSet(receiver, index, value) { + A._checkValidIndex(index, receiver, receiver.length); + receiver[index] = value; + }, + setRange$4(receiver, start, end, iterable, skipCount) { + if (type$.NativeTypedArrayOfDouble._is(iterable)) { + this._setRangeFast$4(receiver, start, end, iterable, skipCount); + return; + } + this.super$ListBase$setRange(receiver, start, end, iterable, skipCount); + }, + $isEfficientLengthIterable: 1, + $isIterable: 1, + $isList: 1 + }; + A.NativeTypedArrayOfInt.prototype = { + $indexSet(receiver, index, value) { + A._checkValidIndex(index, receiver, receiver.length); + receiver[index] = value; + }, + setRange$4(receiver, start, end, iterable, skipCount) { + if (type$.NativeTypedArrayOfInt._is(iterable)) { + this._setRangeFast$4(receiver, start, end, iterable, skipCount); + return; + } + this.super$ListBase$setRange(receiver, start, end, iterable, skipCount); + }, + $isEfficientLengthIterable: 1, + $isIterable: 1, + $isList: 1 + }; + A.NativeFloat32List.prototype = { + get$runtimeType(receiver) { + return B.Type_Float32List_LB7; + }, + sublist$2(receiver, start, end) { + return new Float32Array(receiver.subarray(start, A._checkValidRange(start, end, receiver.length))); + }, + sublist$1(receiver, start) { + return this.sublist$2(receiver, start, null); + }, + $isTrustedGetRuntimeType: 1, + $isFloat32List: 1 + }; + A.NativeFloat64List.prototype = { + get$runtimeType(receiver) { + return B.Type_Float64List_LB7; + }, + sublist$2(receiver, start, end) { + return new Float64Array(receiver.subarray(start, A._checkValidRange(start, end, receiver.length))); + }, + sublist$1(receiver, start) { + return this.sublist$2(receiver, start, null); + }, + $isTrustedGetRuntimeType: 1, + $isFloat64List: 1 + }; + A.NativeInt16List.prototype = { + get$runtimeType(receiver) { + return B.Type_Int16List_uXf; + }, + $index(receiver, index) { + A._checkValidIndex(index, receiver, receiver.length); + return receiver[index]; + }, + sublist$2(receiver, start, end) { + return new Int16Array(receiver.subarray(start, A._checkValidRange(start, end, receiver.length))); + }, + sublist$1(receiver, start) { + return this.sublist$2(receiver, start, null); + }, + $isTrustedGetRuntimeType: 1, + $isInt16List: 1 + }; + A.NativeInt32List.prototype = { + get$runtimeType(receiver) { + return B.Type_Int32List_O50; + }, + $index(receiver, index) { + A._checkValidIndex(index, receiver, receiver.length); + return receiver[index]; + }, + sublist$2(receiver, start, end) { + return new Int32Array(receiver.subarray(start, A._checkValidRange(start, end, receiver.length))); + }, + sublist$1(receiver, start) { + return this.sublist$2(receiver, start, null); + }, + $isTrustedGetRuntimeType: 1, + $isInt32List: 1 + }; + A.NativeInt8List.prototype = { + get$runtimeType(receiver) { + return B.Type_Int8List_ekJ; + }, + $index(receiver, index) { + A._checkValidIndex(index, receiver, receiver.length); + return receiver[index]; + }, + sublist$2(receiver, start, end) { + return new Int8Array(receiver.subarray(start, A._checkValidRange(start, end, receiver.length))); + }, + sublist$1(receiver, start) { + return this.sublist$2(receiver, start, null); + }, + $isTrustedGetRuntimeType: 1, + $isInt8List: 1 + }; + A.NativeUint16List.prototype = { + get$runtimeType(receiver) { + return B.Type_Uint16List_2bx; + }, + $index(receiver, index) { + A._checkValidIndex(index, receiver, receiver.length); + return receiver[index]; + }, + sublist$2(receiver, start, end) { + return new Uint16Array(receiver.subarray(start, A._checkValidRange(start, end, receiver.length))); + }, + sublist$1(receiver, start) { + return this.sublist$2(receiver, start, null); + }, + $isTrustedGetRuntimeType: 1, + $isUint16List: 1 + }; + A.NativeUint32List.prototype = { + get$runtimeType(receiver) { + return B.Type_Uint32List_2bx; + }, + $index(receiver, index) { + A._checkValidIndex(index, receiver, receiver.length); + return receiver[index]; + }, + sublist$2(receiver, start, end) { + return new Uint32Array(receiver.subarray(start, A._checkValidRange(start, end, receiver.length))); + }, + sublist$1(receiver, start) { + return this.sublist$2(receiver, start, null); + }, + $isTrustedGetRuntimeType: 1, + $isUint32List: 1 + }; + A.NativeUint8ClampedList.prototype = { + get$runtimeType(receiver) { + return B.Type_Uint8ClampedList_Jik; + }, + get$length(receiver) { + return receiver.length; + }, + $index(receiver, index) { + A._checkValidIndex(index, receiver, receiver.length); + return receiver[index]; + }, + sublist$2(receiver, start, end) { + return new Uint8ClampedArray(receiver.subarray(start, A._checkValidRange(start, end, receiver.length))); + }, + sublist$1(receiver, start) { + return this.sublist$2(receiver, start, null); + }, + $isTrustedGetRuntimeType: 1, + $isUint8ClampedList: 1 + }; + A.NativeUint8List.prototype = { + get$runtimeType(receiver) { + return B.Type_Uint8List_WLA; + }, + get$length(receiver) { + return receiver.length; + }, + $index(receiver, index) { + A._checkValidIndex(index, receiver, receiver.length); + return receiver[index]; + }, + sublist$2(receiver, start, end) { + return new Uint8Array(receiver.subarray(start, A._checkValidRange(start, end, receiver.length))); + }, + sublist$1(receiver, start) { + return this.sublist$2(receiver, start, null); + }, + $isTrustedGetRuntimeType: 1, + $isNativeUint8List: 1, + $isUint8List: 1 + }; + A._NativeTypedArrayOfDouble_NativeTypedArray_ListMixin.prototype = {}; + A._NativeTypedArrayOfDouble_NativeTypedArray_ListMixin_FixedLengthListMixin.prototype = {}; + A._NativeTypedArrayOfInt_NativeTypedArray_ListMixin.prototype = {}; + A._NativeTypedArrayOfInt_NativeTypedArray_ListMixin_FixedLengthListMixin.prototype = {}; + A.Rti.prototype = { + _eval$1(recipe) { + return A._Universe_evalInEnvironment(init.typeUniverse, this, recipe); + }, + _bind$1(typeOrTuple) { + return A._Universe_bind(init.typeUniverse, this, typeOrTuple); + } + }; + A._FunctionParameters.prototype = {}; + A._Type.prototype = { + toString$0(_) { + return A._rtiToString(this._rti, null); + } + }; + A._Error.prototype = { + toString$0(_) { + return this.__rti$_message; + } + }; + A._TypeError.prototype = { + get$message(_) { + return this.__rti$_message; + }, + $isTypeError: 1 + }; + A._AsyncRun__initializeScheduleImmediate_internalCallback.prototype = { + call$1(_) { + var t1 = this._box_0, + f = t1.storedCallback; + t1.storedCallback = null; + f.call$0(); + }, + $signature: 54 + }; + A._AsyncRun__initializeScheduleImmediate_closure.prototype = { + call$1(callback) { + var t1, t2; + this._box_0.storedCallback = callback; + t1 = this.div; + t2 = this.span; + t1.firstChild ? t1.removeChild(t2) : t1.appendChild(t2); + }, + $signature: 32 + }; + A._AsyncRun__scheduleImmediateJsOverride_internalCallback.prototype = { + call$0() { + this.callback.call$0(); + }, + $signature: 1 + }; + A._AsyncRun__scheduleImmediateWithSetImmediate_internalCallback.prototype = { + call$0() { + this.callback.call$0(); + }, + $signature: 1 + }; + A._TimerImpl.prototype = { + _TimerImpl$2(milliseconds, callback) { + if (self.setTimeout != null) + this._handle = self.setTimeout(A.convertDartClosureToJS(new A._TimerImpl_internalCallback(this, callback), 0), milliseconds); + else + throw A.wrapException(A.UnsupportedError$("`setTimeout()` not found.")); + }, + _TimerImpl$periodic$2(milliseconds, callback) { + if (self.setTimeout != null) + this._handle = self.setInterval(A.convertDartClosureToJS(new A._TimerImpl$periodic_closure(this, milliseconds, Date.now(), callback), 0), milliseconds); + else + throw A.wrapException(A.UnsupportedError$("Periodic timer.")); + }, + cancel$0() { + if (self.setTimeout != null) { + var t1 = this._handle; + if (t1 == null) + return; + if (this._once) + self.clearTimeout(t1); + else + self.clearInterval(t1); + this._handle = null; + } else + throw A.wrapException(A.UnsupportedError$("Canceling a timer.")); + } + }; + A._TimerImpl_internalCallback.prototype = { + call$0() { + var t1 = this.$this; + t1._handle = null; + t1._tick = 1; + this.callback.call$0(); + }, + $signature: 0 + }; + A._TimerImpl$periodic_closure.prototype = { + call$0() { + var duration, _this = this, + t1 = _this.$this, + tick = t1._tick + 1, + t2 = _this.milliseconds; + if (t2 > 0) { + duration = Date.now() - _this.start; + if (duration > (tick + 1) * t2) + tick = B.JSInt_methods.$tdiv(duration, t2); + } + t1._tick = tick; + _this.callback.call$1(t1); + }, + $signature: 1 + }; + A._AsyncAwaitCompleter.prototype = { + complete$1(value) { + var t1, _this = this; + if (value == null) + value = _this.$ti._precomputed1._as(value); + if (!_this.isSync) + _this._future._asyncComplete$1(value); + else { + t1 = _this._future; + if (_this.$ti._eval$1("Future<1>")._is(value)) + t1._chainFuture$1(value); + else + t1._completeWithValue$1(value); + } + }, + completeError$2(e, st) { + var t1 = this._future; + if (this.isSync) + t1._completeError$2(e, st); + else + t1._asyncCompleteError$2(e, st); + } + }; + A._awaitOnObject_closure.prototype = { + call$1(result) { + return this.bodyFunction.call$2(0, result); + }, + $signature: 76 + }; + A._awaitOnObject_closure0.prototype = { + call$2(error, stackTrace) { + this.bodyFunction.call$2(1, new A.ExceptionAndStackTrace(error, stackTrace)); + }, + $signature: 621 + }; + A._wrapJsFunctionForAsync_closure.prototype = { + call$2(errorCode, result) { + this.$protected(errorCode, result); + }, + $signature: 620 + }; + A._SyncStarIterator.prototype = { + get$current(_) { + return this._async$_current; + }, + _resumeBody$2(errorCode, errorValue) { + var body, t1, exception; + errorCode = errorCode; + errorValue = errorValue; + body = this._body; + for (; true;) + try { + t1 = body(this, errorCode, errorValue); + return t1; + } catch (exception) { + errorValue = exception; + errorCode = 1; + } + }, + moveNext$0() { + var nestedIterator, exception, value, suspendedBodies, _this = this, errorValue = null, errorCode = 0; + for (; true;) { + nestedIterator = _this._nestedIterator; + if (nestedIterator != null) + try { + if (nestedIterator.moveNext$0()) { + _this._async$_current = J.get$current$x(nestedIterator); + return true; + } else + _this._nestedIterator = null; + } catch (exception) { + errorValue = exception; + errorCode = 1; + _this._nestedIterator = null; + } + value = _this._resumeBody$2(errorCode, errorValue); + if (1 === value) + return true; + if (0 === value) { + _this._async$_current = null; + suspendedBodies = _this._suspendedBodies; + if (suspendedBodies == null || suspendedBodies.length === 0) { + _this._body = A._SyncStarIterator__terminatedBody; + return false; + } + _this._body = suspendedBodies.pop(); + errorCode = 0; + errorValue = null; + continue; + } + if (2 === value) { + errorCode = 0; + errorValue = null; + continue; + } + if (3 === value) { + errorValue = _this._datum; + _this._datum = null; + suspendedBodies = _this._suspendedBodies; + if (suspendedBodies == null || suspendedBodies.length === 0) { + _this._async$_current = null; + _this._body = A._SyncStarIterator__terminatedBody; + throw errorValue; + return false; + } + _this._body = suspendedBodies.pop(); + errorCode = 1; + continue; + } + throw A.wrapException(A.StateError$("sync*")); + } + return false; + }, + _yieldStar$1(iterable) { + var t1, t2, _this = this; + if (iterable instanceof A._SyncStarIterable) { + t1 = iterable._outerHelper(); + t2 = _this._suspendedBodies; + if (t2 == null) + t2 = _this._suspendedBodies = []; + t2.push(_this._body); + _this._body = t1; + return 2; + } else { + _this._nestedIterator = J.get$iterator$ax(iterable); + return 2; + } + } + }; + A._SyncStarIterable.prototype = { + get$iterator(_) { + return new A._SyncStarIterator(this._outerHelper()); + } + }; + A.AsyncError.prototype = { + toString$0(_) { + return A.S(this.error); + }, + $isError: 1, + get$stackTrace() { + return this.stackTrace; + } + }; + A.Future_wait_handleError.prototype = { + call$2(theError, theStackTrace) { + var _this = this, + t1 = _this._box_0, + t2 = --t1.remaining; + if (t1.values != null) { + t1.values = null; + if (t1.remaining === 0 || _this.eagerError) + _this._future._completeError$2(theError, theStackTrace); + else { + _this.error._value = theError; + _this.stackTrace._value = theStackTrace; + } + } else if (t2 === 0 && !_this.eagerError) + _this._future._completeError$2(_this.error._readLocal$0(), _this.stackTrace._readLocal$0()); + }, + $signature: 73 + }; + A.Future_wait_closure.prototype = { + call$1(value) { + var valueList, _this = this, + t1 = _this._box_0; + --t1.remaining; + valueList = t1.values; + if (valueList != null) { + J.$indexSet$ax(valueList, _this.pos, value); + if (t1.remaining === 0) + _this._future._completeWithValue$1(A.List_List$from(valueList, true, _this.T)); + } else if (t1.remaining === 0 && !_this.eagerError) + _this._future._completeError$2(_this.error._readLocal$0(), _this.stackTrace._readLocal$0()); + }, + $signature() { + return this.T._eval$1("Null(0)"); + } + }; + A._Completer.prototype = { + completeError$2(error, stackTrace) { + var replacement; + A.checkNotNullable(error, "error", type$.Object); + if ((this.future._state & 30) !== 0) + throw A.wrapException(A.StateError$("Future already completed")); + replacement = $.Zone__current.errorCallback$2(error, stackTrace); + if (replacement != null) { + error = replacement.error; + stackTrace = replacement.stackTrace; + } else if (stackTrace == null) + stackTrace = A.AsyncError_defaultStackTrace(error); + this._completeError$2(error, stackTrace); + }, + completeError$1(error) { + return this.completeError$2(error, null); + } + }; + A._AsyncCompleter.prototype = { + complete$1(value) { + var t1 = this.future; + if ((t1._state & 30) !== 0) + throw A.wrapException(A.StateError$("Future already completed")); + t1._asyncComplete$1(value); + }, + complete$0() { + return this.complete$1(null); + }, + _completeError$2(error, stackTrace) { + this.future._asyncCompleteError$2(error, stackTrace); + } + }; + A._SyncCompleter.prototype = { + complete$1(value) { + var t1 = this.future; + if ((t1._state & 30) !== 0) + throw A.wrapException(A.StateError$("Future already completed")); + t1._complete$1(value); + }, + _completeError$2(error, stackTrace) { + this.future._completeError$2(error, stackTrace); + } + }; + A._FutureListener.prototype = { + matchesErrorTest$1(asyncError) { + if ((this.state & 15) !== 6) + return true; + return this.result._zone.runUnary$2$2(this.callback, asyncError.error, type$.bool, type$.Object); + }, + handleError$1(asyncError) { + var exception, + errorCallback = this.errorCallback, + result = null, + t1 = type$.dynamic, + t2 = type$.Object, + t3 = asyncError.error, + t4 = this.result._zone; + if (type$.dynamic_Function_Object_StackTrace._is(errorCallback)) + result = t4.runBinary$3$3(errorCallback, t3, asyncError.stackTrace, t1, t2, type$.StackTrace); + else + result = t4.runUnary$2$2(errorCallback, t3, t1, t2); + try { + t1 = result; + return t1; + } catch (exception) { + if (type$.TypeError._is(A.unwrapException(exception))) { + if ((this.state & 1) !== 0) + throw A.wrapException(A.ArgumentError$("The error handler of Future.then must return a value of the returned future's type", "onError")); + throw A.wrapException(A.ArgumentError$("The error handler of Future.catchError must return a value of the future's type", "onError")); + } else + throw exception; + } + } + }; + A._Future.prototype = { + _setChained$1(source) { + this._state = this._state & 1 | 4; + this._resultOrListeners = source; + }, + then$1$2$onError(_, f, onError, $R) { + var result, t1, + currentZone = $.Zone__current; + if (currentZone === B.C__RootZone) { + if (onError != null && !type$.dynamic_Function_Object_StackTrace._is(onError) && !type$.dynamic_Function_Object._is(onError)) + throw A.wrapException(A.ArgumentError$value(onError, "onError", string$.Error_)); + } else { + f = currentZone.registerUnaryCallback$2$1(f, $R._eval$1("0/"), this.$ti._precomputed1); + if (onError != null) + onError = A._registerErrorHandler(onError, currentZone); + } + result = new A._Future($.Zone__current, $R._eval$1("_Future<0>")); + t1 = onError == null ? 1 : 3; + this._addListener$1(new A._FutureListener(result, t1, f, onError, this.$ti._eval$1("@<1>")._bind$1($R)._eval$1("_FutureListener<1,2>"))); + return result; + }, + then$1$1(_, f, $R) { + return this.then$1$2$onError(0, f, null, $R); + }, + _thenAwait$1$2(f, onError, $E) { + var result = new A._Future($.Zone__current, $E._eval$1("_Future<0>")); + this._addListener$1(new A._FutureListener(result, 19, f, onError, this.$ti._eval$1("@<1>")._bind$1($E)._eval$1("_FutureListener<1,2>"))); + return result; + }, + catchError$1(onError) { + var t1 = this.$ti, + t2 = $.Zone__current, + result = new A._Future(t2, t1); + if (t2 !== B.C__RootZone) + onError = A._registerErrorHandler(onError, t2); + this._addListener$1(new A._FutureListener(result, 2, null, onError, t1._eval$1("@<1>")._bind$1(t1._precomputed1)._eval$1("_FutureListener<1,2>"))); + return result; + }, + whenComplete$1(action) { + var t1 = this.$ti, + t2 = $.Zone__current, + result = new A._Future(t2, t1); + if (t2 !== B.C__RootZone) + action = t2.registerCallback$1$1(action, type$.dynamic); + this._addListener$1(new A._FutureListener(result, 8, action, null, t1._eval$1("@<1>")._bind$1(t1._precomputed1)._eval$1("_FutureListener<1,2>"))); + return result; + }, + _setErrorObject$1(error) { + this._state = this._state & 1 | 16; + this._resultOrListeners = error; + }, + _cloneResult$1(source) { + this._state = source._state & 30 | this._state & 1; + this._resultOrListeners = source._resultOrListeners; + }, + _addListener$1(listener) { + var _this = this, + t1 = _this._state; + if (t1 <= 3) { + listener._nextListener = _this._resultOrListeners; + _this._resultOrListeners = listener; + } else { + if ((t1 & 4) !== 0) { + t1 = _this._resultOrListeners; + if ((t1._state & 24) === 0) { + t1._addListener$1(listener); + return; + } + _this._cloneResult$1(t1); + } + _this._zone.scheduleMicrotask$1(new A._Future__addListener_closure(_this, listener)); + } + }, + _prependListeners$1(listeners) { + var t1, existingListeners, next, cursor, next0, _this = this, _box_0 = {}; + _box_0.listeners = listeners; + if (listeners == null) + return; + t1 = _this._state; + if (t1 <= 3) { + existingListeners = _this._resultOrListeners; + _this._resultOrListeners = listeners; + if (existingListeners != null) { + next = listeners._nextListener; + for (cursor = listeners; next != null; cursor = next, next = next0) + next0 = next._nextListener; + cursor._nextListener = existingListeners; + } + } else { + if ((t1 & 4) !== 0) { + t1 = _this._resultOrListeners; + if ((t1._state & 24) === 0) { + t1._prependListeners$1(listeners); + return; + } + _this._cloneResult$1(t1); + } + _box_0.listeners = _this._reverseListeners$1(listeners); + _this._zone.scheduleMicrotask$1(new A._Future__prependListeners_closure(_box_0, _this)); + } + }, + _removeListeners$0() { + var current = this._resultOrListeners; + this._resultOrListeners = null; + return this._reverseListeners$1(current); + }, + _reverseListeners$1(listeners) { + var current, prev, next; + for (current = listeners, prev = null; current != null; prev = current, current = next) { + next = current._nextListener; + current._nextListener = prev; + } + return prev; + }, + _chainForeignFuture$1(source) { + var e, s, exception, _this = this; + _this._state ^= 2; + try { + source.then$1$2$onError(0, new A._Future__chainForeignFuture_closure(_this), new A._Future__chainForeignFuture_closure0(_this), type$.Null); + } catch (exception) { + e = A.unwrapException(exception); + s = A.getTraceFromException(exception); + A.scheduleMicrotask(new A._Future__chainForeignFuture_closure1(_this, e, s)); + } + }, + _complete$1(value) { + var listeners, _this = this, + t1 = _this.$ti; + if (t1._eval$1("Future<1>")._is(value)) + if (t1._is(value)) + A._Future__chainCoreFutureSync(value, _this); + else + _this._chainForeignFuture$1(value); + else { + listeners = _this._removeListeners$0(); + _this._state = 8; + _this._resultOrListeners = value; + A._Future__propagateToListeners(_this, listeners); + } + }, + _completeWithValue$1(value) { + var _this = this, + listeners = _this._removeListeners$0(); + _this._state = 8; + _this._resultOrListeners = value; + A._Future__propagateToListeners(_this, listeners); + }, + _completeError$2(error, stackTrace) { + var listeners = this._removeListeners$0(); + this._setErrorObject$1(A.AsyncError$(error, stackTrace)); + A._Future__propagateToListeners(this, listeners); + }, + _asyncComplete$1(value) { + if (this.$ti._eval$1("Future<1>")._is(value)) { + this._chainFuture$1(value); + return; + } + this._asyncCompleteWithValue$1(value); + }, + _asyncCompleteWithValue$1(value) { + this._state ^= 2; + this._zone.scheduleMicrotask$1(new A._Future__asyncCompleteWithValue_closure(this, value)); + }, + _chainFuture$1(value) { + if (this.$ti._is(value)) { + A._Future__chainCoreFutureAsync(value, this); + return; + } + this._chainForeignFuture$1(value); + }, + _asyncCompleteError$2(error, stackTrace) { + this._state ^= 2; + this._zone.scheduleMicrotask$1(new A._Future__asyncCompleteError_closure(this, error, stackTrace)); + }, + $isFuture: 1 + }; + A._Future__addListener_closure.prototype = { + call$0() { + A._Future__propagateToListeners(this.$this, this.listener); + }, + $signature: 0 + }; + A._Future__prependListeners_closure.prototype = { + call$0() { + A._Future__propagateToListeners(this.$this, this._box_0.listeners); + }, + $signature: 0 + }; + A._Future__chainForeignFuture_closure.prototype = { + call$1(value) { + var error, stackTrace, exception, + t1 = this.$this; + t1._state ^= 2; + try { + t1._completeWithValue$1(t1.$ti._precomputed1._as(value)); + } catch (exception) { + error = A.unwrapException(exception); + stackTrace = A.getTraceFromException(exception); + t1._completeError$2(error, stackTrace); + } + }, + $signature: 54 + }; + A._Future__chainForeignFuture_closure0.prototype = { + call$2(error, stackTrace) { + this.$this._completeError$2(error, stackTrace); + }, + $signature: 53 + }; + A._Future__chainForeignFuture_closure1.prototype = { + call$0() { + this.$this._completeError$2(this.e, this.s); + }, + $signature: 0 + }; + A._Future__chainCoreFutureAsync_closure.prototype = { + call$0() { + A._Future__chainCoreFutureSync(this._box_0.source, this.target); + }, + $signature: 0 + }; + A._Future__asyncCompleteWithValue_closure.prototype = { + call$0() { + this.$this._completeWithValue$1(this.value); + }, + $signature: 0 + }; + A._Future__asyncCompleteError_closure.prototype = { + call$0() { + this.$this._completeError$2(this.error, this.stackTrace); + }, + $signature: 0 + }; + A._Future__propagateToListeners_handleWhenCompleteCallback.prototype = { + call$0() { + var e, s, t1, exception, t2, originalSource, _this = this, completeResult = null; + try { + t1 = _this._box_0.listener; + completeResult = t1.result._zone.run$1$1(0, t1.callback, type$.dynamic); + } catch (exception) { + e = A.unwrapException(exception); + s = A.getTraceFromException(exception); + t1 = _this.hasError && _this._box_1.source._resultOrListeners.error === e; + t2 = _this._box_0; + if (t1) + t2.listenerValueOrError = _this._box_1.source._resultOrListeners; + else + t2.listenerValueOrError = A.AsyncError$(e, s); + t2.listenerHasError = true; + return; + } + if (completeResult instanceof A._Future && (completeResult._state & 24) !== 0) { + if ((completeResult._state & 16) !== 0) { + t1 = _this._box_0; + t1.listenerValueOrError = completeResult._resultOrListeners; + t1.listenerHasError = true; + } + return; + } + if (completeResult instanceof A._Future) { + originalSource = _this._box_1.source; + t1 = _this._box_0; + t1.listenerValueOrError = J.then$1$1$x(completeResult, new A._Future__propagateToListeners_handleWhenCompleteCallback_closure(originalSource), type$.dynamic); + t1.listenerHasError = false; + } + }, + $signature: 0 + }; + A._Future__propagateToListeners_handleWhenCompleteCallback_closure.prototype = { + call$1(_) { + return this.originalSource; + }, + $signature: 603 + }; + A._Future__propagateToListeners_handleValueCallback.prototype = { + call$0() { + var e, s, t1, t2, t3, exception; + try { + t1 = this._box_0; + t2 = t1.listener; + t3 = t2.$ti; + t1.listenerValueOrError = t2.result._zone.runUnary$2$2(t2.callback, this.sourceResult, t3._eval$1("2/"), t3._precomputed1); + } catch (exception) { + e = A.unwrapException(exception); + s = A.getTraceFromException(exception); + t1 = this._box_0; + t1.listenerValueOrError = A.AsyncError$(e, s); + t1.listenerHasError = true; + } + }, + $signature: 0 + }; + A._Future__propagateToListeners_handleError.prototype = { + call$0() { + var asyncError, e, s, t1, exception, t2, _this = this; + try { + asyncError = _this._box_1.source._resultOrListeners; + t1 = _this._box_0; + if (t1.listener.matchesErrorTest$1(asyncError) && t1.listener.errorCallback != null) { + t1.listenerValueOrError = t1.listener.handleError$1(asyncError); + t1.listenerHasError = false; + } + } catch (exception) { + e = A.unwrapException(exception); + s = A.getTraceFromException(exception); + t1 = _this._box_1.source._resultOrListeners; + t2 = _this._box_0; + if (t1.error === e) + t2.listenerValueOrError = t1; + else + t2.listenerValueOrError = A.AsyncError$(e, s); + t2.listenerHasError = true; + } + }, + $signature: 0 + }; + A._AsyncCallbackEntry.prototype = {}; + A.Stream.prototype = { + get$isBroadcast() { + return false; + }, + get$length(_) { + var t1 = {}, + future = new A._Future($.Zone__current, type$._Future_int); + t1.count = 0; + this.listen$4$cancelOnError$onDone$onError(0, new A.Stream_length_closure(t1, this), true, new A.Stream_length_closure0(t1, future), future.get$_completeError()); + return future; + } + }; + A.Stream_Stream$fromFuture_closure.prototype = { + call$1(value) { + var t1 = this.controller; + t1._async$_add$1(value); + t1._closeUnchecked$0(); + }, + $signature() { + return this.T._eval$1("Null(0)"); + } + }; + A.Stream_Stream$fromFuture_closure0.prototype = { + call$2(error, stackTrace) { + var t1 = this.controller; + t1._addError$2(error, stackTrace); + t1._closeUnchecked$0(); + }, + $signature: 602 + }; + A.Stream_length_closure.prototype = { + call$1(_) { + ++this._box_0.count; + }, + $signature() { + return A._instanceType(this.$this)._eval$1("~(Stream.T)"); + } + }; + A.Stream_length_closure0.prototype = { + call$0() { + this.future._complete$1(this._box_0.count); + }, + $signature: 0 + }; + A._StreamController.prototype = { + get$stream() { + return new A._ControllerStream(this, A._instanceType(this)._eval$1("_ControllerStream<1>")); + }, + get$_pendingEvents() { + if ((this._state & 8) === 0) + return this._varData; + return this._varData.varData; + }, + _ensurePendingEvents$0() { + var events, state, _this = this; + if ((_this._state & 8) === 0) { + events = _this._varData; + return events == null ? _this._varData = new A._PendingEvents() : events; + } + state = _this._varData; + events = state.varData; + return events == null ? state.varData = new A._PendingEvents() : events; + }, + get$_subscription() { + var varData = this._varData; + return (this._state & 8) !== 0 ? varData.varData : varData; + }, + _badEventState$0() { + if ((this._state & 4) !== 0) + return new A.StateError("Cannot add event after closing"); + return new A.StateError("Cannot add event while adding a stream"); + }, + addStream$2$cancelOnError(source, cancelOnError) { + var t2, t3, t4, _this = this, + t1 = _this._state; + if (t1 >= 4) + throw A.wrapException(_this._badEventState$0()); + if ((t1 & 2) !== 0) { + t1 = new A._Future($.Zone__current, type$._Future_dynamic); + t1._asyncComplete$1(null); + return t1; + } + t1 = _this._varData; + t2 = cancelOnError === true; + t3 = new A._Future($.Zone__current, type$._Future_dynamic); + t4 = t2 ? A._AddStreamState_makeErrorHandler(_this) : _this.get$_addError(); + t4 = source.listen$4$cancelOnError$onDone$onError(0, _this.get$_async$_add(), t2, _this.get$_close(), t4); + t2 = _this._state; + if ((t2 & 1) !== 0 ? (_this.get$_subscription()._state & 4) !== 0 : (t2 & 2) === 0) + t4.pause$0(0); + _this._varData = new A._StreamControllerAddStreamState(t1, t3, t4); + _this._state |= 8; + return t3; + }, + _ensureDoneFuture$0() { + var t1 = this._doneFuture; + if (t1 == null) + t1 = this._doneFuture = (this._state & 2) !== 0 ? $.$get$Future__nullFuture() : new A._Future($.Zone__current, type$._Future_void); + return t1; + }, + add$1(_, value) { + if (this._state >= 4) + throw A.wrapException(this._badEventState$0()); + this._async$_add$1(value); + }, + addError$2(error, stackTrace) { + var replacement; + A.checkNotNullable(error, "error", type$.Object); + if (this._state >= 4) + throw A.wrapException(this._badEventState$0()); + replacement = $.Zone__current.errorCallback$2(error, stackTrace); + if (replacement != null) { + error = replacement.error; + stackTrace = replacement.stackTrace; + } else if (stackTrace == null) + stackTrace = A.AsyncError_defaultStackTrace(error); + this._addError$2(error, stackTrace); + }, + addError$1(error) { + return this.addError$2(error, null); + }, + close$0(_) { + var _this = this, + t1 = _this._state; + if ((t1 & 4) !== 0) + return _this._ensureDoneFuture$0(); + if (t1 >= 4) + throw A.wrapException(_this._badEventState$0()); + _this._closeUnchecked$0(); + return _this._ensureDoneFuture$0(); + }, + _closeUnchecked$0() { + var t1 = this._state |= 4; + if ((t1 & 1) !== 0) + this._sendDone$0(); + else if ((t1 & 3) === 0) + this._ensurePendingEvents$0().add$1(0, B.C__DelayedDone); + }, + _async$_add$1(value) { + var t1 = this._state; + if ((t1 & 1) !== 0) + this._sendData$1(value); + else if ((t1 & 3) === 0) + this._ensurePendingEvents$0().add$1(0, new A._DelayedData(value)); + }, + _addError$2(error, stackTrace) { + var t1 = this._state; + if ((t1 & 1) !== 0) + this._sendError$2(error, stackTrace); + else if ((t1 & 3) === 0) + this._ensurePendingEvents$0().add$1(0, new A._DelayedError(error, stackTrace)); + }, + _close$0() { + var addState = this._varData; + this._varData = addState.varData; + this._state &= 4294967287; + addState.addStreamFuture._asyncComplete$1(null); + }, + _subscribe$4(onData, onError, onDone, cancelOnError) { + var subscription, pendingEvents, t1, addState, _this = this; + if ((_this._state & 3) !== 0) + throw A.wrapException(A.StateError$("Stream has already been listened to.")); + subscription = A._ControllerSubscription$(_this, onData, onError, onDone, cancelOnError, A._instanceType(_this)._precomputed1); + pendingEvents = _this.get$_pendingEvents(); + t1 = _this._state |= 1; + if ((t1 & 8) !== 0) { + addState = _this._varData; + addState.varData = subscription; + addState.addSubscription.resume$0(0); + } else + _this._varData = subscription; + subscription._setPendingEvents$1(pendingEvents); + subscription._guardCallback$1(new A._StreamController__subscribe_closure(_this)); + return subscription; + }, + _recordCancel$1(subscription) { + var onCancel, cancelResult, e, s, exception, result0, t1, _this = this, result = null; + if ((_this._state & 8) !== 0) + result = _this._varData.cancel$0(); + _this._varData = null; + _this._state = _this._state & 4294967286 | 2; + onCancel = _this.onCancel; + if (onCancel != null) + if (result == null) + try { + cancelResult = onCancel.call$0(); + if (cancelResult instanceof A._Future) + result = cancelResult; + } catch (exception) { + e = A.unwrapException(exception); + s = A.getTraceFromException(exception); + result0 = new A._Future($.Zone__current, type$._Future_void); + result0._asyncCompleteError$2(e, s); + result = result0; + } + else + result = result.whenComplete$1(onCancel); + t1 = new A._StreamController__recordCancel_complete(_this); + if (result != null) + result = result.whenComplete$1(t1); + else + t1.call$0(); + return result; + }, + _recordPause$1(subscription) { + if ((this._state & 8) !== 0) + this._varData.addSubscription.pause$0(0); + A._runGuarded(this.onPause); + }, + _recordResume$1(subscription) { + if ((this._state & 8) !== 0) + this._varData.addSubscription.resume$0(0); + A._runGuarded(this.onResume); + }, + $isEventSink: 1, + set$onPause(val) { + return this.onPause = val; + }, + set$onResume(val) { + return this.onResume = val; + }, + set$onCancel(val) { + return this.onCancel = val; + } + }; + A._StreamController__subscribe_closure.prototype = { + call$0() { + A._runGuarded(this.$this.onListen); + }, + $signature: 0 + }; + A._StreamController__recordCancel_complete.prototype = { + call$0() { + var doneFuture = this.$this._doneFuture; + if (doneFuture != null && (doneFuture._state & 30) === 0) + doneFuture._asyncComplete$1(null); + }, + $signature: 0 + }; + A._SyncStreamControllerDispatch.prototype = { + _sendData$1(data) { + this.get$_subscription()._async$_add$1(data); + }, + _sendError$2(error, stackTrace) { + this.get$_subscription()._addError$2(error, stackTrace); + }, + _sendDone$0() { + this.get$_subscription()._close$0(); + } + }; + A._AsyncStreamControllerDispatch.prototype = { + _sendData$1(data) { + this.get$_subscription()._addPending$1(new A._DelayedData(data)); + }, + _sendError$2(error, stackTrace) { + this.get$_subscription()._addPending$1(new A._DelayedError(error, stackTrace)); + }, + _sendDone$0() { + this.get$_subscription()._addPending$1(B.C__DelayedDone); + } + }; + A._AsyncStreamController.prototype = {}; + A._SyncStreamController.prototype = {}; + A._ControllerStream.prototype = { + get$hashCode(_) { + return (A.Primitives_objectHashCode(this._controller) ^ 892482866) >>> 0; + }, + $eq(_, other) { + if (other == null) + return false; + if (this === other) + return true; + return other instanceof A._ControllerStream && other._controller === this._controller; + } + }; + A._ControllerSubscription.prototype = { + _async$_onCancel$0() { + return this._controller._recordCancel$1(this); + }, + _async$_onPause$0() { + this._controller._recordPause$1(this); + }, + _async$_onResume$0() { + this._controller._recordResume$1(this); + } + }; + A._AddStreamState.prototype = { + cancel$0() { + var cancel = this.addSubscription.cancel$0(); + return cancel.whenComplete$1(new A._AddStreamState_cancel_closure(this)); + } + }; + A._AddStreamState_makeErrorHandler_closure.prototype = { + call$2(e, s) { + var t1 = this.controller; + t1._addError$2(e, s); + t1._close$0(); + }, + $signature: 53 + }; + A._AddStreamState_cancel_closure.prototype = { + call$0() { + this.$this.addStreamFuture._asyncComplete$1(null); + }, + $signature: 1 + }; + A._StreamControllerAddStreamState.prototype = {}; + A._BufferingStreamSubscription.prototype = { + _setPendingEvents$1(pendingEvents) { + var _this = this; + if (pendingEvents == null) + return; + _this._pending = pendingEvents; + if (pendingEvents.lastPendingEvent != null) { + _this._state = (_this._state | 64) >>> 0; + pendingEvents.schedule$1(_this); + } + }, + pause$1(_, resumeSignal) { + var t2, t3, _this = this, + t1 = _this._state; + if ((t1 & 8) !== 0) + return; + t2 = (t1 + 128 | 4) >>> 0; + _this._state = t2; + if (t1 < 128) { + t3 = _this._pending; + if (t3 != null) + if (t3._state === 1) + t3._state = 3; + } + if ((t1 & 4) === 0 && (t2 & 32) === 0) + _this._guardCallback$1(_this.get$_async$_onPause()); + }, + pause$0(_) { + return this.pause$1(0, null); + }, + resume$0(_) { + var _this = this, + t1 = _this._state; + if ((t1 & 8) !== 0) + return; + if (t1 >= 128) { + t1 = _this._state = t1 - 128; + if (t1 < 128) + if ((t1 & 64) !== 0 && _this._pending.lastPendingEvent != null) + _this._pending.schedule$1(_this); + else { + t1 = (t1 & 4294967291) >>> 0; + _this._state = t1; + if ((t1 & 32) === 0) + _this._guardCallback$1(_this.get$_async$_onResume()); + } + } + }, + cancel$0() { + var _this = this, + t1 = (_this._state & 4294967279) >>> 0; + _this._state = t1; + if ((t1 & 8) === 0) + _this._cancel$0(); + t1 = _this._cancelFuture; + return t1 == null ? $.$get$Future__nullFuture() : t1; + }, + _cancel$0() { + var t2, _this = this, + t1 = _this._state = (_this._state | 8) >>> 0; + if ((t1 & 64) !== 0) { + t2 = _this._pending; + if (t2._state === 1) + t2._state = 3; + } + if ((t1 & 32) === 0) + _this._pending = null; + _this._cancelFuture = _this._async$_onCancel$0(); + }, + _async$_add$1(data) { + var t1 = this._state; + if ((t1 & 8) !== 0) + return; + if (t1 < 32) + this._sendData$1(data); + else + this._addPending$1(new A._DelayedData(data)); + }, + _addError$2(error, stackTrace) { + var t1 = this._state; + if ((t1 & 8) !== 0) + return; + if (t1 < 32) + this._sendError$2(error, stackTrace); + else + this._addPending$1(new A._DelayedError(error, stackTrace)); + }, + _close$0() { + var _this = this, + t1 = _this._state; + if ((t1 & 8) !== 0) + return; + t1 = (t1 | 2) >>> 0; + _this._state = t1; + if (t1 < 32) + _this._sendDone$0(); + else + _this._addPending$1(B.C__DelayedDone); + }, + _async$_onPause$0() { + }, + _async$_onResume$0() { + }, + _async$_onCancel$0() { + return null; + }, + _addPending$1($event) { + var t1, _this = this, + pending = _this._pending; + if (pending == null) + pending = _this._pending = new A._PendingEvents(); + pending.add$1(0, $event); + t1 = _this._state; + if ((t1 & 64) === 0) { + t1 = (t1 | 64) >>> 0; + _this._state = t1; + if (t1 < 128) + pending.schedule$1(_this); + } + }, + _sendData$1(data) { + var _this = this, + t1 = _this._state; + _this._state = (t1 | 32) >>> 0; + _this._zone.runUnaryGuarded$1$2(_this._onData, data, A._instanceType(_this)._eval$1("_BufferingStreamSubscription.T")); + _this._state = (_this._state & 4294967263) >>> 0; + _this._checkState$1((t1 & 4) !== 0); + }, + _sendError$2(error, stackTrace) { + var cancelFuture, _this = this, + t1 = _this._state, + t2 = new A._BufferingStreamSubscription__sendError_sendError(_this, error, stackTrace); + if ((t1 & 1) !== 0) { + _this._state = (t1 | 16) >>> 0; + _this._cancel$0(); + cancelFuture = _this._cancelFuture; + if (cancelFuture != null && cancelFuture !== $.$get$Future__nullFuture()) + cancelFuture.whenComplete$1(t2); + else + t2.call$0(); + } else { + t2.call$0(); + _this._checkState$1((t1 & 4) !== 0); + } + }, + _sendDone$0() { + var cancelFuture, _this = this, + t1 = new A._BufferingStreamSubscription__sendDone_sendDone(_this); + _this._cancel$0(); + _this._state = (_this._state | 16) >>> 0; + cancelFuture = _this._cancelFuture; + if (cancelFuture != null && cancelFuture !== $.$get$Future__nullFuture()) + cancelFuture.whenComplete$1(t1); + else + t1.call$0(); + }, + _guardCallback$1(callback) { + var _this = this, + t1 = _this._state; + _this._state = (t1 | 32) >>> 0; + callback.call$0(); + _this._state = (_this._state & 4294967263) >>> 0; + _this._checkState$1((t1 & 4) !== 0); + }, + _checkState$1(wasInputPaused) { + var t2, isInputPaused, _this = this, + t1 = _this._state; + if ((t1 & 64) !== 0 && _this._pending.lastPendingEvent == null) { + t1 = _this._state = (t1 & 4294967231) >>> 0; + if ((t1 & 4) !== 0) + if (t1 < 128) { + t2 = _this._pending; + t2 = t2 == null ? null : t2.lastPendingEvent == null; + t2 = t2 !== false; + } else + t2 = false; + else + t2 = false; + if (t2) { + t1 = (t1 & 4294967291) >>> 0; + _this._state = t1; + } + } + for (; true; wasInputPaused = isInputPaused) { + if ((t1 & 8) !== 0) { + _this._pending = null; + return; + } + isInputPaused = (t1 & 4) !== 0; + if (wasInputPaused === isInputPaused) + break; + _this._state = (t1 ^ 32) >>> 0; + if (isInputPaused) + _this._async$_onPause$0(); + else + _this._async$_onResume$0(); + t1 = (_this._state & 4294967263) >>> 0; + _this._state = t1; + } + if ((t1 & 64) !== 0 && t1 < 128) + _this._pending.schedule$1(_this); + }, + $isStreamSubscription: 1 + }; + A._BufferingStreamSubscription__sendError_sendError.prototype = { + call$0() { + var onError, t3, t4, + t1 = this.$this, + t2 = t1._state; + if ((t2 & 8) !== 0 && (t2 & 16) === 0) + return; + t1._state = (t2 | 32) >>> 0; + onError = t1._onError; + t2 = this.error; + t3 = type$.Object; + t4 = t1._zone; + if (type$.void_Function_Object_StackTrace._is(onError)) + t4.runBinaryGuarded$2$3(onError, t2, this.stackTrace, t3, type$.StackTrace); + else + t4.runUnaryGuarded$1$2(onError, t2, t3); + t1._state = (t1._state & 4294967263) >>> 0; + }, + $signature: 0 + }; + A._BufferingStreamSubscription__sendDone_sendDone.prototype = { + call$0() { + var t1 = this.$this, + t2 = t1._state; + if ((t2 & 16) === 0) + return; + t1._state = (t2 | 42) >>> 0; + t1._zone.runGuarded$1(t1._onDone); + t1._state = (t1._state & 4294967263) >>> 0; + }, + $signature: 0 + }; + A._StreamImpl.prototype = { + listen$4$cancelOnError$onDone$onError(_, onData, cancelOnError, onDone, onError) { + return this._controller._subscribe$4(onData, onError, onDone, cancelOnError === true); + }, + listen$1(_, onData) { + return this.listen$4$cancelOnError$onDone$onError(0, onData, null, null, null); + }, + listen$3$onDone$onError(_, onData, onDone, onError) { + return this.listen$4$cancelOnError$onDone$onError(0, onData, null, onDone, onError); + } + }; + A._DelayedEvent.prototype = { + get$next() { + return this.next; + }, + set$next(val) { + return this.next = val; + } + }; + A._DelayedData.prototype = { + perform$1(dispatch) { + dispatch._sendData$1(this.value); + } + }; + A._DelayedError.prototype = { + perform$1(dispatch) { + dispatch._sendError$2(this.error, this.stackTrace); + } + }; + A._DelayedDone.prototype = { + perform$1(dispatch) { + dispatch._sendDone$0(); + }, + get$next() { + return null; + }, + set$next(_) { + throw A.wrapException(A.StateError$("No events after a done.")); + } + }; + A._PendingEvents.prototype = { + schedule$1(dispatch) { + var _this = this, + t1 = _this._state; + if (t1 === 1) + return; + if (t1 >= 1) { + _this._state = 1; + return; + } + A.scheduleMicrotask(new A._PendingEvents_schedule_closure(_this, dispatch)); + _this._state = 1; + }, + add$1(_, $event) { + var _this = this, + lastEvent = _this.lastPendingEvent; + if (lastEvent == null) + _this.firstPendingEvent = _this.lastPendingEvent = $event; + else { + lastEvent.set$next($event); + _this.lastPendingEvent = $event; + } + } + }; + A._PendingEvents_schedule_closure.prototype = { + call$0() { + var $event, nextEvent, + t1 = this.$this, + oldState = t1._state; + t1._state = 0; + if (oldState === 3) + return; + $event = t1.firstPendingEvent; + nextEvent = $event.get$next(); + t1.firstPendingEvent = nextEvent; + if (nextEvent == null) + t1.lastPendingEvent = null; + $event.perform$1(this.dispatch); + }, + $signature: 0 + }; + A._StreamIterator.prototype = { + get$current(_) { + if (this._async$_hasValue) + return this._stateData; + return null; + }, + moveNext$0() { + var future, _this = this, + subscription = _this._subscription; + if (subscription != null) { + if (_this._async$_hasValue) { + future = new A._Future($.Zone__current, type$._Future_bool); + _this._stateData = future; + _this._async$_hasValue = false; + subscription.resume$0(0); + return future; + } + throw A.wrapException(A.StateError$("Already waiting for next.")); + } + return _this._initializeOrDone$0(); + }, + _initializeOrDone$0() { + var future, subscription, _this = this, + stateData = _this._stateData; + if (stateData != null) { + future = new A._Future($.Zone__current, type$._Future_bool); + _this._stateData = future; + subscription = stateData.listen$4$cancelOnError$onDone$onError(0, _this.get$_onData(), true, _this.get$_onDone(), _this.get$_onError()); + if (_this._stateData != null) + _this._subscription = subscription; + return future; + } + return $.$get$Future__falseFuture(); + }, + cancel$0() { + var _this = this, + subscription = _this._subscription, + stateData = _this._stateData; + _this._stateData = null; + if (subscription != null) { + _this._subscription = null; + if (!_this._async$_hasValue) + stateData._asyncComplete$1(false); + else + _this._async$_hasValue = false; + return subscription.cancel$0(); + } + return $.$get$Future__nullFuture(); + }, + _onData$1(data) { + var moveNextFuture, t1, _this = this; + if (_this._subscription == null) + return; + moveNextFuture = _this._stateData; + _this._stateData = data; + _this._async$_hasValue = true; + moveNextFuture._complete$1(true); + if (_this._async$_hasValue) { + t1 = _this._subscription; + if (t1 != null) + t1.pause$0(0); + } + }, + _onError$2(error, stackTrace) { + var _this = this, + subscription = _this._subscription, + moveNextFuture = _this._stateData; + _this._stateData = _this._subscription = null; + if (subscription != null) + moveNextFuture._completeError$2(error, stackTrace); + else + moveNextFuture._asyncCompleteError$2(error, stackTrace); + }, + _onDone$0() { + var _this = this, + subscription = _this._subscription, + moveNextFuture = _this._stateData; + _this._stateData = _this._subscription = null; + if (subscription != null) + moveNextFuture._completeWithValue$1(false); + else + moveNextFuture._asyncCompleteWithValue$1(false); + } + }; + A._ForwardingStream.prototype = { + get$isBroadcast() { + return this._async$_source.get$isBroadcast(); + }, + listen$4$cancelOnError$onDone$onError(_, onData, cancelOnError, onDone, onError) { + var t1 = this.$ti, + t2 = t1._rest[1], + t3 = $.Zone__current, + t4 = cancelOnError === true ? 1 : 0, + t5 = A._BufferingStreamSubscription__registerDataHandler(t3, onData, t2), + t6 = A._BufferingStreamSubscription__registerErrorHandler(t3, onError), + t7 = onDone == null ? A.async___nullDoneHandler$closure() : onDone; + t2 = new A._ForwardingStreamSubscription(this, t5, t6, t3.registerCallback$1$1(t7, type$.void), t3, t4, t1._eval$1("@<1>")._bind$1(t2)._eval$1("_ForwardingStreamSubscription<1,2>")); + t2._subscription = this._async$_source.listen$3$onDone$onError(0, t2.get$_handleData(), t2.get$_handleDone(), t2.get$_handleError()); + return t2; + }, + listen$1(_, onData) { + return this.listen$4$cancelOnError$onDone$onError(0, onData, null, null, null); + }, + listen$3$onDone$onError(_, onData, onDone, onError) { + return this.listen$4$cancelOnError$onDone$onError(0, onData, null, onDone, onError); + } + }; + A._ForwardingStreamSubscription.prototype = { + _async$_add$1(data) { + if ((this._state & 2) !== 0) + return; + this.super$_BufferingStreamSubscription$_add(data); + }, + _addError$2(error, stackTrace) { + if ((this._state & 2) !== 0) + return; + this.super$_BufferingStreamSubscription$_addError(error, stackTrace); + }, + _async$_onPause$0() { + var t1 = this._subscription; + if (t1 != null) + t1.pause$0(0); + }, + _async$_onResume$0() { + var t1 = this._subscription; + if (t1 != null) + t1.resume$0(0); + }, + _async$_onCancel$0() { + var subscription = this._subscription; + if (subscription != null) { + this._subscription = null; + return subscription.cancel$0(); + } + return null; + }, + _handleData$1(data) { + this._stream._handleData$2(data, this); + }, + _handleError$2(error, stackTrace) { + this._addError$2(error, stackTrace); + }, + _handleDone$0() { + this._close$0(); + } + }; + A._ExpandStream.prototype = { + _handleData$2(inputEvent, sink) { + var value, e, s, t1, exception, error, stackTrace, replacement; + try { + for (t1 = J.get$iterator$ax(this._expand.call$1(inputEvent)); t1.moveNext$0();) { + value = t1.get$current(t1); + sink._async$_add$1(value); + } + } catch (exception) { + e = A.unwrapException(exception); + s = A.getTraceFromException(exception); + error = e; + stackTrace = s; + replacement = $.Zone__current.errorCallback$2(error, stackTrace); + if (replacement != null) { + error = replacement.error; + stackTrace = replacement.stackTrace; + } + sink._addError$2(error, stackTrace); + } + } + }; + A._ZoneFunction.prototype = {}; + A._ZoneSpecification.prototype = {$isZoneSpecification: 1}; + A._ZoneDelegate.prototype = {$isZoneDelegate: 1}; + A._Zone.prototype = { + _processUncaughtError$3(zone, error, stackTrace) { + var handler, parentDelegate, parentZone, currentZone, e, s, t1, exception, + implementation = this.get$_handleUncaughtError(), + implZone = implementation.zone; + if (implZone === B.C__RootZone) { + A._rootHandleError(error, stackTrace); + return; + } + handler = implementation.$function; + parentDelegate = implZone.get$_parentDelegate(); + t1 = J.get$parent$z(implZone); + t1.toString; + parentZone = t1; + currentZone = $.Zone__current; + try { + $.Zone__current = parentZone; + handler.call$5(implZone, parentDelegate, zone, error, stackTrace); + $.Zone__current = currentZone; + } catch (exception) { + e = A.unwrapException(exception); + s = A.getTraceFromException(exception); + $.Zone__current = currentZone; + t1 = error === e ? stackTrace : s; + parentZone._processUncaughtError$3(implZone, e, t1); + } + }, + $isZone: 1 + }; + A._CustomZone.prototype = { + get$_delegate() { + var t1 = this._delegateCache; + return t1 == null ? this._delegateCache = new A._ZoneDelegate(this) : t1; + }, + get$_parentDelegate() { + return this.parent.get$_delegate(); + }, + get$errorZone() { + return this._handleUncaughtError.zone; + }, + runGuarded$1(f) { + var e, s, exception; + try { + this.run$1$1(0, f, type$.void); + } catch (exception) { + e = A.unwrapException(exception); + s = A.getTraceFromException(exception); + this._processUncaughtError$3(this, e, s); + } + }, + runUnaryGuarded$1$2(f, arg, $T) { + var e, s, exception; + try { + this.runUnary$2$2(f, arg, type$.void, $T); + } catch (exception) { + e = A.unwrapException(exception); + s = A.getTraceFromException(exception); + this._processUncaughtError$3(this, e, s); + } + }, + runBinaryGuarded$2$3(f, arg1, arg2, T1, T2) { + var e, s, exception; + try { + this.runBinary$3$3(f, arg1, arg2, type$.void, T1, T2); + } catch (exception) { + e = A.unwrapException(exception); + s = A.getTraceFromException(exception); + this._processUncaughtError$3(this, e, s); + } + }, + bindCallback$1$1(f, $R) { + return new A._CustomZone_bindCallback_closure(this, this.registerCallback$1$1(f, $R), $R); + }, + bindUnaryCallback$2$1(f, $R, $T) { + return new A._CustomZone_bindUnaryCallback_closure(this, this.registerUnaryCallback$2$1(f, $R, $T), $T, $R); + }, + bindCallbackGuarded$1(f) { + return new A._CustomZone_bindCallbackGuarded_closure(this, this.registerCallback$1$1(f, type$.void)); + }, + $index(_, key) { + var value, + t1 = this._async$_map, + result = t1.$index(0, key); + if (result != null || t1.containsKey$1(key)) + return result; + value = this.parent.$index(0, key); + if (value != null) + t1.$indexSet(0, key, value); + return value; + }, + handleUncaughtError$2(error, stackTrace) { + this._processUncaughtError$3(this, error, stackTrace); + }, + fork$2$specification$zoneValues(specification, zoneValues) { + var implementation = this._fork, + t1 = implementation.zone; + return implementation.$function.call$5(t1, t1.get$_parentDelegate(), this, specification, zoneValues); + }, + run$1$1(_, f) { + var implementation = this._run, + t1 = implementation.zone; + return implementation.$function.call$4(t1, t1.get$_parentDelegate(), this, f); + }, + runUnary$2$2(f, arg) { + var implementation = this._runUnary, + t1 = implementation.zone; + return implementation.$function.call$5(t1, t1.get$_parentDelegate(), this, f, arg); + }, + runBinary$3$3(f, arg1, arg2) { + var implementation = this._runBinary, + t1 = implementation.zone; + return implementation.$function.call$6(t1, t1.get$_parentDelegate(), this, f, arg1, arg2); + }, + registerCallback$1$1(callback) { + var implementation = this._registerCallback, + t1 = implementation.zone; + return implementation.$function.call$4(t1, t1.get$_parentDelegate(), this, callback); + }, + registerUnaryCallback$2$1(callback) { + var implementation = this._registerUnaryCallback, + t1 = implementation.zone; + return implementation.$function.call$4(t1, t1.get$_parentDelegate(), this, callback); + }, + registerBinaryCallback$3$1(callback) { + var implementation = this._registerBinaryCallback, + t1 = implementation.zone; + return implementation.$function.call$4(t1, t1.get$_parentDelegate(), this, callback); + }, + errorCallback$2(error, stackTrace) { + var implementation, implementationZone; + A.checkNotNullable(error, "error", type$.Object); + implementation = this._errorCallback; + implementationZone = implementation.zone; + if (implementationZone === B.C__RootZone) + return null; + return implementation.$function.call$5(implementationZone, implementationZone.get$_parentDelegate(), this, error, stackTrace); + }, + scheduleMicrotask$1(f) { + var implementation = this._scheduleMicrotask, + t1 = implementation.zone; + return implementation.$function.call$4(t1, t1.get$_parentDelegate(), this, f); + }, + createTimer$2(duration, f) { + var implementation = this._createTimer, + t1 = implementation.zone; + return implementation.$function.call$5(t1, t1.get$_parentDelegate(), this, duration, f); + }, + print$1(line) { + var implementation = this._print, + t1 = implementation.zone; + return implementation.$function.call$4(t1, t1.get$_parentDelegate(), this, line); + }, + get$_run() { + return this._run; + }, + get$_runUnary() { + return this._runUnary; + }, + get$_runBinary() { + return this._runBinary; + }, + get$_registerCallback() { + return this._registerCallback; + }, + get$_registerUnaryCallback() { + return this._registerUnaryCallback; + }, + get$_registerBinaryCallback() { + return this._registerBinaryCallback; + }, + get$_errorCallback() { + return this._errorCallback; + }, + get$_scheduleMicrotask() { + return this._scheduleMicrotask; + }, + get$_createTimer() { + return this._createTimer; + }, + get$_createPeriodicTimer() { + return this._createPeriodicTimer; + }, + get$_print() { + return this._print; + }, + get$_fork() { + return this._fork; + }, + get$_handleUncaughtError() { + return this._handleUncaughtError; + }, + get$parent(receiver) { + return this.parent; + }, + get$_async$_map() { + return this._async$_map; + } + }; + A._CustomZone_bindCallback_closure.prototype = { + call$0() { + return this.$this.run$1$1(0, this.registered, this.R); + }, + $signature() { + return this.R._eval$1("0()"); + } + }; + A._CustomZone_bindUnaryCallback_closure.prototype = { + call$1(arg) { + var _this = this; + return _this.$this.runUnary$2$2(_this.registered, arg, _this.R, _this.T); + }, + $signature() { + return this.R._eval$1("@<0>")._bind$1(this.T)._eval$1("1(2)"); + } + }; + A._CustomZone_bindCallbackGuarded_closure.prototype = { + call$0() { + return this.$this.runGuarded$1(this.registered); + }, + $signature: 0 + }; + A._rootHandleError_closure.prototype = { + call$0() { + A.Error_throwWithStackTrace(this.error, this.stackTrace); + }, + $signature: 0 + }; + A._RootZone.prototype = { + get$_run() { + return B._ZoneFunction__RootZone__rootRun; + }, + get$_runUnary() { + return B._ZoneFunction__RootZone__rootRunUnary; + }, + get$_runBinary() { + return B._ZoneFunction__RootZone__rootRunBinary; + }, + get$_registerCallback() { + return B._ZoneFunction__RootZone__rootRegisterCallback; + }, + get$_registerUnaryCallback() { + return B._ZoneFunction_Eeh; + }, + get$_registerBinaryCallback() { + return B._ZoneFunction_7G2; + }, + get$_errorCallback() { + return B._ZoneFunction__RootZone__rootErrorCallback; + }, + get$_scheduleMicrotask() { + return B._ZoneFunction__RootZone__rootScheduleMicrotask; + }, + get$_createTimer() { + return B._ZoneFunction__RootZone__rootCreateTimer; + }, + get$_createPeriodicTimer() { + return B._ZoneFunction_3bB; + }, + get$_print() { + return B._ZoneFunction__RootZone__rootPrint; + }, + get$_fork() { + return B._ZoneFunction__RootZone__rootFork; + }, + get$_handleUncaughtError() { + return B._ZoneFunction_NMc; + }, + get$parent(_) { + return null; + }, + get$_async$_map() { + return $.$get$_RootZone__rootMap(); + }, + get$_delegate() { + var t1 = $._RootZone__rootDelegate; + return t1 == null ? $._RootZone__rootDelegate = new A._ZoneDelegate(this) : t1; + }, + get$_parentDelegate() { + var t1 = $._RootZone__rootDelegate; + return t1 == null ? $._RootZone__rootDelegate = new A._ZoneDelegate(this) : t1; + }, + get$errorZone() { + return this; + }, + runGuarded$1(f) { + var e, s, exception; + try { + if (B.C__RootZone === $.Zone__current) { + f.call$0(); + return; + } + A._rootRun(null, null, this, f); + } catch (exception) { + e = A.unwrapException(exception); + s = A.getTraceFromException(exception); + A._rootHandleError(e, s); + } + }, + runUnaryGuarded$1$2(f, arg) { + var e, s, exception; + try { + if (B.C__RootZone === $.Zone__current) { + f.call$1(arg); + return; + } + A._rootRunUnary(null, null, this, f, arg); + } catch (exception) { + e = A.unwrapException(exception); + s = A.getTraceFromException(exception); + A._rootHandleError(e, s); + } + }, + runBinaryGuarded$2$3(f, arg1, arg2) { + var e, s, exception; + try { + if (B.C__RootZone === $.Zone__current) { + f.call$2(arg1, arg2); + return; + } + A._rootRunBinary(null, null, this, f, arg1, arg2); + } catch (exception) { + e = A.unwrapException(exception); + s = A.getTraceFromException(exception); + A._rootHandleError(e, s); + } + }, + bindCallback$1$1(f, $R) { + return new A._RootZone_bindCallback_closure(this, f, $R); + }, + bindUnaryCallback$2$1(f, $R, $T) { + return new A._RootZone_bindUnaryCallback_closure(this, f, $T, $R); + }, + bindCallbackGuarded$1(f) { + return new A._RootZone_bindCallbackGuarded_closure(this, f); + }, + $index(_, key) { + return null; + }, + handleUncaughtError$2(error, stackTrace) { + A._rootHandleError(error, stackTrace); + }, + fork$2$specification$zoneValues(specification, zoneValues) { + return A._rootFork(null, null, this, specification, zoneValues); + }, + run$1$1(_, f) { + if ($.Zone__current === B.C__RootZone) + return f.call$0(); + return A._rootRun(null, null, this, f); + }, + runUnary$2$2(f, arg) { + if ($.Zone__current === B.C__RootZone) + return f.call$1(arg); + return A._rootRunUnary(null, null, this, f, arg); + }, + runBinary$3$3(f, arg1, arg2) { + if ($.Zone__current === B.C__RootZone) + return f.call$2(arg1, arg2); + return A._rootRunBinary(null, null, this, f, arg1, arg2); + }, + registerCallback$1$1(f) { + return f; + }, + registerUnaryCallback$2$1(f) { + return f; + }, + registerBinaryCallback$3$1(f) { + return f; + }, + errorCallback$2(error, stackTrace) { + return null; + }, + scheduleMicrotask$1(f) { + A._rootScheduleMicrotask(null, null, this, f); + }, + createTimer$2(duration, f) { + return A.Timer__createTimer(duration, f); + }, + print$1(line) { + A.printString(line); + } + }; + A._RootZone_bindCallback_closure.prototype = { + call$0() { + return this.$this.run$1$1(0, this.f, this.R); + }, + $signature() { + return this.R._eval$1("0()"); + } + }; + A._RootZone_bindUnaryCallback_closure.prototype = { + call$1(arg) { + var _this = this; + return _this.$this.runUnary$2$2(_this.f, arg, _this.R, _this.T); + }, + $signature() { + return this.R._eval$1("@<0>")._bind$1(this.T)._eval$1("1(2)"); + } + }; + A._RootZone_bindCallbackGuarded_closure.prototype = { + call$0() { + return this.$this.runGuarded$1(this.f); + }, + $signature: 0 + }; + A._HashMap.prototype = { + get$length(_) { + return this._collection$_length; + }, + get$isEmpty(_) { + return this._collection$_length === 0; + }, + get$isNotEmpty(_) { + return this._collection$_length !== 0; + }, + get$keys(_) { + return new A._HashMapKeyIterable(this, A._instanceType(this)._eval$1("_HashMapKeyIterable<1>")); + }, + get$values(_) { + var t1 = A._instanceType(this); + return A.MappedIterable_MappedIterable(new A._HashMapKeyIterable(this, t1._eval$1("_HashMapKeyIterable<1>")), new A._HashMap_values_closure(this), t1._precomputed1, t1._rest[1]); + }, + containsKey$1(key) { + var strings, nums; + if (typeof key == "string" && key !== "__proto__") { + strings = this._collection$_strings; + return strings == null ? false : strings[key] != null; + } else if (typeof key == "number" && (key & 1073741823) === key) { + nums = this._collection$_nums; + return nums == null ? false : nums[key] != null; + } else + return this._containsKey$1(key); + }, + _containsKey$1(key) { + var rest = this._collection$_rest; + if (rest == null) + return false; + return this._findBucketIndex$2(this._getBucket$2(rest, key), key) >= 0; + }, + addAll$1(_, other) { + other.forEach$1(0, new A._HashMap_addAll_closure(this)); + }, + $index(_, key) { + var strings, t1, nums; + if (typeof key == "string" && key !== "__proto__") { + strings = this._collection$_strings; + t1 = strings == null ? null : A._HashMap__getTableEntry(strings, key); + return t1; + } else if (typeof key == "number" && (key & 1073741823) === key) { + nums = this._collection$_nums; + t1 = nums == null ? null : A._HashMap__getTableEntry(nums, key); + return t1; + } else + return this._get$1(key); + }, + _get$1(key) { + var bucket, index, + rest = this._collection$_rest; + if (rest == null) + return null; + bucket = this._getBucket$2(rest, key); + index = this._findBucketIndex$2(bucket, key); + return index < 0 ? null : bucket[index + 1]; + }, + $indexSet(_, key, value) { + var strings, nums, _this = this; + if (typeof key == "string" && key !== "__proto__") { + strings = _this._collection$_strings; + _this._collection$_addHashTableEntry$3(strings == null ? _this._collection$_strings = A._HashMap__newHashTable() : strings, key, value); + } else if (typeof key == "number" && (key & 1073741823) === key) { + nums = _this._collection$_nums; + _this._collection$_addHashTableEntry$3(nums == null ? _this._collection$_nums = A._HashMap__newHashTable() : nums, key, value); + } else + _this._set$2(key, value); + }, + _set$2(key, value) { + var hash, bucket, index, _this = this, + rest = _this._collection$_rest; + if (rest == null) + rest = _this._collection$_rest = A._HashMap__newHashTable(); + hash = _this._computeHashCode$1(key); + bucket = rest[hash]; + if (bucket == null) { + A._HashMap__setTableEntry(rest, hash, [key, value]); + ++_this._collection$_length; + _this._collection$_keys = null; + } else { + index = _this._findBucketIndex$2(bucket, key); + if (index >= 0) + bucket[index + 1] = value; + else { + bucket.push(key, value); + ++_this._collection$_length; + _this._collection$_keys = null; + } + } + }, + remove$1(_, key) { + var _this = this; + if (typeof key == "string" && key !== "__proto__") + return _this._removeHashTableEntry$2(_this._collection$_strings, key); + else if (typeof key == "number" && (key & 1073741823) === key) + return _this._removeHashTableEntry$2(_this._collection$_nums, key); + else + return _this._remove$1(key); + }, + _remove$1(key) { + var hash, bucket, index, result, _this = this, + rest = _this._collection$_rest; + if (rest == null) + return null; + hash = _this._computeHashCode$1(key); + bucket = rest[hash]; + index = _this._findBucketIndex$2(bucket, key); + if (index < 0) + return null; + --_this._collection$_length; + _this._collection$_keys = null; + result = bucket.splice(index, 2)[1]; + if (0 === bucket.length) + delete rest[hash]; + return result; + }, + forEach$1(_, action) { + var $length, t1, i, key, t2, _this = this, + keys = _this._computeKeys$0(); + for ($length = keys.length, t1 = A._instanceType(_this)._rest[1], i = 0; i < $length; ++i) { + key = keys[i]; + t2 = _this.$index(0, key); + action.call$2(key, t2 == null ? t1._as(t2) : t2); + if (keys !== _this._collection$_keys) + throw A.wrapException(A.ConcurrentModificationError$(_this)); + } + }, + _computeKeys$0() { + var strings, names, entries, index, i, nums, rest, bucket, $length, i0, _this = this, + result = _this._collection$_keys; + if (result != null) + return result; + result = A.List_List$filled(_this._collection$_length, null, false, type$.dynamic); + strings = _this._collection$_strings; + if (strings != null) { + names = Object.getOwnPropertyNames(strings); + entries = names.length; + for (index = 0, i = 0; i < entries; ++i) { + result[index] = names[i]; + ++index; + } + } else + index = 0; + nums = _this._collection$_nums; + if (nums != null) { + names = Object.getOwnPropertyNames(nums); + entries = names.length; + for (i = 0; i < entries; ++i) { + result[index] = +names[i]; + ++index; + } + } + rest = _this._collection$_rest; + if (rest != null) { + names = Object.getOwnPropertyNames(rest); + entries = names.length; + for (i = 0; i < entries; ++i) { + bucket = rest[names[i]]; + $length = bucket.length; + for (i0 = 0; i0 < $length; i0 += 2) { + result[index] = bucket[i0]; + ++index; + } + } + } + return _this._collection$_keys = result; + }, + _collection$_addHashTableEntry$3(table, key, value) { + if (table[key] == null) { + ++this._collection$_length; + this._collection$_keys = null; + } + A._HashMap__setTableEntry(table, key, value); + }, + _removeHashTableEntry$2(table, key) { + var value; + if (table != null && table[key] != null) { + value = A._HashMap__getTableEntry(table, key); + delete table[key]; + --this._collection$_length; + this._collection$_keys = null; + return value; + } else + return null; + }, + _computeHashCode$1(key) { + return J.get$hashCode$(key) & 1073741823; + }, + _getBucket$2(table, key) { + return table[this._computeHashCode$1(key)]; + }, + _findBucketIndex$2(bucket, key) { + var $length, i; + if (bucket == null) + return -1; + $length = bucket.length; + for (i = 0; i < $length; i += 2) + if (J.$eq$(bucket[i], key)) + return i; + return -1; + } + }; + A._HashMap_values_closure.prototype = { + call$1(each) { + var t1 = this.$this, + t2 = t1.$index(0, each); + return t2 == null ? A._instanceType(t1)._rest[1]._as(t2) : t2; + }, + $signature() { + return A._instanceType(this.$this)._eval$1("2(1)"); + } + }; + A._HashMap_addAll_closure.prototype = { + call$2(key, value) { + this.$this.$indexSet(0, key, value); + }, + $signature() { + return A._instanceType(this.$this)._eval$1("~(1,2)"); + } + }; + A._IdentityHashMap.prototype = { + _computeHashCode$1(key) { + return A.objectHashCode(key) & 1073741823; + }, + _findBucketIndex$2(bucket, key) { + var $length, i, t1; + if (bucket == null) + return -1; + $length = bucket.length; + for (i = 0; i < $length; i += 2) { + t1 = bucket[i]; + if (t1 == null ? key == null : t1 === key) + return i; + } + return -1; + } + }; + A._HashMapKeyIterable.prototype = { + get$length(_) { + return this._map._collection$_length; + }, + get$isEmpty(_) { + return this._map._collection$_length === 0; + }, + get$isNotEmpty(_) { + return this._map._collection$_length !== 0; + }, + get$iterator(_) { + var t1 = this._map; + return new A._HashMapKeyIterator(t1, t1._computeKeys$0(), this.$ti._eval$1("_HashMapKeyIterator<1>")); + }, + contains$1(_, element) { + return this._map.containsKey$1(element); + } + }; + A._HashMapKeyIterator.prototype = { + get$current(_) { + var t1 = this._collection$_current; + return t1 == null ? this.$ti._precomputed1._as(t1) : t1; + }, + moveNext$0() { + var _this = this, + keys = _this._collection$_keys, + offset = _this._offset, + t1 = _this._map; + if (keys !== t1._collection$_keys) + throw A.wrapException(A.ConcurrentModificationError$(t1)); + else if (offset >= keys.length) { + _this._collection$_current = null; + return false; + } else { + _this._collection$_current = keys[offset]; + _this._offset = offset + 1; + return true; + } + } + }; + A._LinkedCustomHashMap.prototype = { + $index(_, key) { + if (!this._validKey.call$1(key)) + return null; + return this.super$JsLinkedHashMap$internalGet(key); + }, + $indexSet(_, key, value) { + this.super$JsLinkedHashMap$internalSet(key, value); + }, + containsKey$1(key) { + if (!this._validKey.call$1(key)) + return false; + return this.super$JsLinkedHashMap$internalContainsKey(key); + }, + remove$1(_, key) { + if (!this._validKey.call$1(key)) + return null; + return this.super$JsLinkedHashMap$internalRemove(key); + }, + internalComputeHashCode$1(key) { + return this._hashCode.call$1(key) & 1073741823; + }, + internalFindBucketIndex$2(bucket, key) { + var $length, t1, i; + if (bucket == null) + return -1; + $length = bucket.length; + for (t1 = this._equals, i = 0; i < $length; ++i) + if (t1.call$2(bucket[i].hashMapCellKey, key)) + return i; + return -1; + } + }; + A._LinkedCustomHashMap_closure.prototype = { + call$1(v) { + return this.K._is(v); + }, + $signature: 134 + }; + A._LinkedHashSet.prototype = { + _newSet$0() { + return new A._LinkedHashSet(A._instanceType(this)._eval$1("_LinkedHashSet<1>")); + }, + _newSimilarSet$1$0($R) { + return new A._LinkedHashSet($R._eval$1("_LinkedHashSet<0>")); + }, + _newSimilarSet$0() { + return this._newSimilarSet$1$0(type$.dynamic); + }, + get$iterator(_) { + var _this = this, + t1 = new A._LinkedHashSetIterator(_this, _this._collection$_modifications, A._instanceType(_this)._eval$1("_LinkedHashSetIterator<1>")); + t1._collection$_cell = _this._collection$_first; + return t1; + }, + get$length(_) { + return this._collection$_length; + }, + get$isEmpty(_) { + return this._collection$_length === 0; + }, + get$isNotEmpty(_) { + return this._collection$_length !== 0; + }, + contains$1(_, object) { + var strings, nums; + if (typeof object == "string" && object !== "__proto__") { + strings = this._collection$_strings; + if (strings == null) + return false; + return strings[object] != null; + } else if (typeof object == "number" && (object & 1073741823) === object) { + nums = this._collection$_nums; + if (nums == null) + return false; + return nums[object] != null; + } else + return this._contains$1(object); + }, + _contains$1(object) { + var rest = this._collection$_rest; + if (rest == null) + return false; + return this._findBucketIndex$2(rest[this._computeHashCode$1(object)], object) >= 0; + }, + get$first(_) { + var first = this._collection$_first; + if (first == null) + throw A.wrapException(A.StateError$("No elements")); + return first._element; + }, + get$last(_) { + var last = this._collection$_last; + if (last == null) + throw A.wrapException(A.StateError$("No elements")); + return last._element; + }, + add$1(_, element) { + var strings, nums, _this = this; + if (typeof element == "string" && element !== "__proto__") { + strings = _this._collection$_strings; + return _this._collection$_addHashTableEntry$2(strings == null ? _this._collection$_strings = A._LinkedHashSet__newHashTable() : strings, element); + } else if (typeof element == "number" && (element & 1073741823) === element) { + nums = _this._collection$_nums; + return _this._collection$_addHashTableEntry$2(nums == null ? _this._collection$_nums = A._LinkedHashSet__newHashTable() : nums, element); + } else + return _this._add$1(element); + }, + _add$1(element) { + var hash, bucket, _this = this, + rest = _this._collection$_rest; + if (rest == null) + rest = _this._collection$_rest = A._LinkedHashSet__newHashTable(); + hash = _this._computeHashCode$1(element); + bucket = rest[hash]; + if (bucket == null) + rest[hash] = [_this._collection$_newLinkedCell$1(element)]; + else { + if (_this._findBucketIndex$2(bucket, element) >= 0) + return false; + bucket.push(_this._collection$_newLinkedCell$1(element)); + } + return true; + }, + remove$1(_, object) { + var _this = this; + if (typeof object == "string" && object !== "__proto__") + return _this._removeHashTableEntry$2(_this._collection$_strings, object); + else if (typeof object == "number" && (object & 1073741823) === object) + return _this._removeHashTableEntry$2(_this._collection$_nums, object); + else + return _this._remove$1(object); + }, + _remove$1(object) { + var hash, bucket, index, cell, _this = this, + rest = _this._collection$_rest; + if (rest == null) + return false; + hash = _this._computeHashCode$1(object); + bucket = rest[hash]; + index = _this._findBucketIndex$2(bucket, object); + if (index < 0) + return false; + cell = bucket.splice(index, 1)[0]; + if (0 === bucket.length) + delete rest[hash]; + _this._unlinkCell$1(cell); + return true; + }, + _collection$_addHashTableEntry$2(table, element) { + if (table[element] != null) + return false; + table[element] = this._collection$_newLinkedCell$1(element); + return true; + }, + _removeHashTableEntry$2(table, element) { + var cell; + if (table == null) + return false; + cell = table[element]; + if (cell == null) + return false; + this._unlinkCell$1(cell); + delete table[element]; + return true; + }, + _collection$_modified$0() { + this._collection$_modifications = this._collection$_modifications + 1 & 1073741823; + }, + _collection$_newLinkedCell$1(element) { + var t1, _this = this, + cell = new A._LinkedHashSetCell(element); + if (_this._collection$_first == null) + _this._collection$_first = _this._collection$_last = cell; + else { + t1 = _this._collection$_last; + t1.toString; + cell._collection$_previous = t1; + _this._collection$_last = t1._collection$_next = cell; + } + ++_this._collection$_length; + _this._collection$_modified$0(); + return cell; + }, + _unlinkCell$1(cell) { + var _this = this, + previous = cell._collection$_previous, + next = cell._collection$_next; + if (previous == null) + _this._collection$_first = next; + else + previous._collection$_next = next; + if (next == null) + _this._collection$_last = previous; + else + next._collection$_previous = previous; + --_this._collection$_length; + _this._collection$_modified$0(); + }, + _computeHashCode$1(element) { + return J.get$hashCode$(element) & 1073741823; + }, + _findBucketIndex$2(bucket, element) { + var $length, i; + if (bucket == null) + return -1; + $length = bucket.length; + for (i = 0; i < $length; ++i) + if (J.$eq$(bucket[i]._element, element)) + return i; + return -1; + } + }; + A._LinkedIdentityHashSet.prototype = { + _newSet$0() { + return new A._LinkedIdentityHashSet(this.$ti); + }, + _newSimilarSet$1$0($R) { + return new A._LinkedIdentityHashSet($R._eval$1("_LinkedIdentityHashSet<0>")); + }, + _newSimilarSet$0() { + return this._newSimilarSet$1$0(type$.dynamic); + }, + _computeHashCode$1(key) { + return A.objectHashCode(key) & 1073741823; + }, + _findBucketIndex$2(bucket, element) { + var $length, i, t1; + if (bucket == null) + return -1; + $length = bucket.length; + for (i = 0; i < $length; ++i) { + t1 = bucket[i]._element; + if (t1 == null ? element == null : t1 === element) + return i; + } + return -1; + } + }; + A._LinkedHashSetCell.prototype = {}; + A._LinkedHashSetIterator.prototype = { + get$current(_) { + var t1 = this._collection$_current; + return t1 == null ? this.$ti._precomputed1._as(t1) : t1; + }, + moveNext$0() { + var _this = this, + cell = _this._collection$_cell, + t1 = _this._set; + if (_this._collection$_modifications !== t1._collection$_modifications) + throw A.wrapException(A.ConcurrentModificationError$(t1)); + else if (cell == null) { + _this._collection$_current = null; + return false; + } else { + _this._collection$_current = cell._element; + _this._collection$_cell = cell._collection$_next; + return true; + } + } + }; + A.UnmodifiableListView.prototype = { + cast$1$0(_, $R) { + return new A.UnmodifiableListView(J.cast$1$0$ax(this._collection$_source, $R), $R._eval$1("UnmodifiableListView<0>")); + }, + get$length(_) { + return J.get$length$asx(this._collection$_source); + }, + $index(_, index) { + return J.elementAt$1$ax(this._collection$_source, index); + } + }; + A.HashMap_HashMap$from_closure.prototype = { + call$2(k, v) { + this.result.$indexSet(0, this.K._as(k), this.V._as(v)); + }, + $signature: 174 + }; + A.LinkedHashMap_LinkedHashMap$from_closure.prototype = { + call$2(k, v) { + this.result.$indexSet(0, this.K._as(k), this.V._as(v)); + }, + $signature: 174 + }; + A.ListBase.prototype = { + get$iterator(receiver) { + return new A.ListIterator(receiver, this.get$length(receiver), A.instanceType(receiver)._eval$1("ListIterator")); + }, + elementAt$1(receiver, index) { + return this.$index(receiver, index); + }, + forEach$1(receiver, action) { + var i, + $length = this.get$length(receiver); + for (i = 0; i < $length; ++i) { + action.call$1(this.$index(receiver, i)); + if ($length !== this.get$length(receiver)) + throw A.wrapException(A.ConcurrentModificationError$(receiver)); + } + }, + get$isEmpty(receiver) { + return this.get$length(receiver) === 0; + }, + get$isNotEmpty(receiver) { + return !this.get$isEmpty(receiver); + }, + get$first(receiver) { + if (this.get$length(receiver) === 0) + throw A.wrapException(A.IterableElementError_noElement()); + return this.$index(receiver, 0); + }, + get$last(receiver) { + if (this.get$length(receiver) === 0) + throw A.wrapException(A.IterableElementError_noElement()); + return this.$index(receiver, this.get$length(receiver) - 1); + }, + get$single(receiver) { + if (this.get$length(receiver) === 0) + throw A.wrapException(A.IterableElementError_noElement()); + if (this.get$length(receiver) > 1) + throw A.wrapException(A.IterableElementError_tooMany()); + return this.$index(receiver, 0); + }, + contains$1(receiver, element) { + var i, + $length = this.get$length(receiver); + for (i = 0; i < $length; ++i) { + if (J.$eq$(this.$index(receiver, i), element)) + return true; + if ($length !== this.get$length(receiver)) + throw A.wrapException(A.ConcurrentModificationError$(receiver)); + } + return false; + }, + every$1(receiver, test) { + var i, + $length = this.get$length(receiver); + for (i = 0; i < $length; ++i) { + if (!test.call$1(this.$index(receiver, i))) + return false; + if ($length !== this.get$length(receiver)) + throw A.wrapException(A.ConcurrentModificationError$(receiver)); + } + return true; + }, + any$1(receiver, test) { + var i, + $length = this.get$length(receiver); + for (i = 0; i < $length; ++i) { + if (test.call$1(this.$index(receiver, i))) + return true; + if ($length !== this.get$length(receiver)) + throw A.wrapException(A.ConcurrentModificationError$(receiver)); + } + return false; + }, + lastWhere$2$orElse(receiver, test, orElse) { + var i, element, + $length = this.get$length(receiver); + for (i = $length - 1; i >= 0; --i) { + element = this.$index(receiver, i); + if (test.call$1(element)) + return element; + if ($length !== this.get$length(receiver)) + throw A.wrapException(A.ConcurrentModificationError$(receiver)); + } + if (orElse != null) + return orElse.call$0(); + throw A.wrapException(A.IterableElementError_noElement()); + }, + join$1(receiver, separator) { + var t1; + if (this.get$length(receiver) === 0) + return ""; + t1 = A.StringBuffer__writeAll("", receiver, separator); + return t1.charCodeAt(0) == 0 ? t1 : t1; + }, + where$1(receiver, test) { + return new A.WhereIterable(receiver, test, A.instanceType(receiver)._eval$1("WhereIterable")); + }, + map$1$1(receiver, f, $T) { + return new A.MappedListIterable(receiver, f, A.instanceType(receiver)._eval$1("@")._bind$1($T)._eval$1("MappedListIterable<1,2>")); + }, + expand$1$1(receiver, f, $T) { + return new A.ExpandIterable(receiver, f, A.instanceType(receiver)._eval$1("@")._bind$1($T)._eval$1("ExpandIterable<1,2>")); + }, + skip$1(receiver, count) { + return A.SubListIterable$(receiver, count, null, A.instanceType(receiver)._eval$1("ListBase.E")); + }, + take$1(receiver, count) { + return A.SubListIterable$(receiver, 0, A.checkNotNullable(count, "count", type$.int), A.instanceType(receiver)._eval$1("ListBase.E")); + }, + toList$1$growable(receiver, growable) { + var t1, first, result, i, _this = this; + if (_this.get$isEmpty(receiver)) { + t1 = J.JSArray_JSArray$growable(0, A.instanceType(receiver)._eval$1("ListBase.E")); + return t1; + } + first = _this.$index(receiver, 0); + result = A.List_List$filled(_this.get$length(receiver), first, true, A.instanceType(receiver)._eval$1("ListBase.E")); + for (i = 1; i < _this.get$length(receiver); ++i) + result[i] = _this.$index(receiver, i); + return result; + }, + toList$0(receiver) { + return this.toList$1$growable(receiver, true); + }, + toSet$0(receiver) { + var i, + result = A.LinkedHashSet_LinkedHashSet(A.instanceType(receiver)._eval$1("ListBase.E")); + for (i = 0; i < this.get$length(receiver); ++i) + result.add$1(0, this.$index(receiver, i)); + return result; + }, + add$1(receiver, element) { + var t1 = this.get$length(receiver); + this.set$length(receiver, t1 + 1); + this.$indexSet(receiver, t1, element); + }, + addAll$1(receiver, iterable) { + var t1, + i = this.get$length(receiver); + for (t1 = iterable.get$iterator(iterable); t1.moveNext$0();) { + this.add$1(receiver, t1.get$current(t1)); + ++i; + } + }, + _closeGap$2(receiver, start, end) { + var i, _this = this, + $length = _this.get$length(receiver), + size = end - start; + for (i = end; i < $length; ++i) + _this.$indexSet(receiver, i - size, _this.$index(receiver, i)); + _this.set$length(receiver, $length - size); + }, + cast$1$0(receiver, $R) { + return new A.CastList(receiver, A.instanceType(receiver)._eval$1("@")._bind$1($R)._eval$1("CastList<1,2>")); + }, + sort$1(receiver, compare) { + var t1 = compare == null ? A.collection_ListBase__compareAny$closure() : compare; + A.Sort__doSort(receiver, 0, this.get$length(receiver) - 1, t1); + }, + sublist$2(receiver, start, end) { + var listLength = this.get$length(receiver); + A.RangeError_checkValidRange(start, listLength, listLength); + return A.List_List$from(this.getRange$2(receiver, start, listLength), true, A.instanceType(receiver)._eval$1("ListBase.E")); + }, + sublist$1(receiver, start) { + return this.sublist$2(receiver, start, null); + }, + getRange$2(receiver, start, end) { + A.RangeError_checkValidRange(start, end, this.get$length(receiver)); + return A.SubListIterable$(receiver, start, end, A.instanceType(receiver)._eval$1("ListBase.E")); + }, + removeRange$2(receiver, start, end) { + A.RangeError_checkValidRange(start, end, this.get$length(receiver)); + if (end > start) + this._closeGap$2(receiver, start, end); + }, + fillRange$3(receiver, start, end, fill) { + var i, + value = fill == null ? A.instanceType(receiver)._eval$1("ListBase.E")._as(fill) : fill; + A.RangeError_checkValidRange(start, end, this.get$length(receiver)); + for (i = start; i < end; ++i) + this.$indexSet(receiver, i, value); + }, + setRange$4(receiver, start, end, iterable, skipCount) { + var $length, otherStart, otherList, t1, i; + A.RangeError_checkValidRange(start, end, this.get$length(receiver)); + $length = end - start; + if ($length === 0) + return; + A.RangeError_checkNotNegative(skipCount, "skipCount"); + if (A.instanceType(receiver)._eval$1("List")._is(iterable)) { + otherStart = skipCount; + otherList = iterable; + } else { + otherList = J.skip$1$ax(iterable, skipCount).toList$1$growable(0, false); + otherStart = 0; + } + t1 = J.getInterceptor$asx(otherList); + if (otherStart + $length > t1.get$length(otherList)) + throw A.wrapException(A.IterableElementError_tooFew()); + if (otherStart < start) + for (i = $length - 1; i >= 0; --i) + this.$indexSet(receiver, start + i, t1.$index(otherList, otherStart + i)); + else + for (i = 0; i < $length; ++i) + this.$indexSet(receiver, start + i, t1.$index(otherList, otherStart + i)); + }, + get$reversed(receiver) { + return new A.ReversedListIterable(receiver, A.instanceType(receiver)._eval$1("ReversedListIterable")); + }, + toString$0(receiver) { + return A.Iterable_iterableToFullString(receiver, "[", "]"); + }, + $isEfficientLengthIterable: 1, + $isIterable: 1, + $isList: 1 + }; + A.MapBase.prototype = { + cast$2$0(_, RK, RV) { + var t1 = A._instanceType(this); + return A.Map_castFrom(this, t1._eval$1("MapBase.K"), t1._eval$1("MapBase.V"), RK, RV); + }, + forEach$1(_, action) { + var t1, t2, key, t3, _this = this; + for (t1 = J.get$iterator$ax(_this.get$keys(_this)), t2 = A._instanceType(_this)._eval$1("MapBase.V"); t1.moveNext$0();) { + key = t1.get$current(t1); + t3 = _this.$index(0, key); + action.call$2(key, t3 == null ? t2._as(t3) : t3); + } + }, + addAll$1(_, other) { + other.forEach$1(0, new A.MapBase_addAll_closure(this)); + }, + get$entries(_) { + var _this = this; + return J.map$1$1$ax(_this.get$keys(_this), new A.MapBase_entries_closure(_this), A._instanceType(_this)._eval$1("MapEntry")); + }, + removeWhere$1(_, test) { + var t2, key, t3, _i, _this = this, + t1 = A._instanceType(_this), + keysToRemove = A._setArrayType([], t1._eval$1("JSArray")); + for (t2 = J.get$iterator$ax(_this.get$keys(_this)), t1 = t1._eval$1("MapBase.V"); t2.moveNext$0();) { + key = t2.get$current(t2); + t3 = _this.$index(0, key); + if (test.call$2(key, t3 == null ? t1._as(t3) : t3)) + keysToRemove.push(key); + } + for (t1 = keysToRemove.length, _i = 0; _i < keysToRemove.length; keysToRemove.length === t1 || (0, A.throwConcurrentModificationError)(keysToRemove), ++_i) + _this.remove$1(0, keysToRemove[_i]); + }, + containsKey$1(key) { + return J.contains$1$asx(this.get$keys(this), key); + }, + get$length(_) { + return J.get$length$asx(this.get$keys(this)); + }, + get$isEmpty(_) { + return J.get$isEmpty$asx(this.get$keys(this)); + }, + get$isNotEmpty(_) { + return J.get$isNotEmpty$asx(this.get$keys(this)); + }, + get$values(_) { + var t1 = A._instanceType(this); + return new A._MapBaseValueIterable(this, t1._eval$1("@")._bind$1(t1._eval$1("MapBase.V"))._eval$1("_MapBaseValueIterable<1,2>")); + }, + toString$0(_) { + return A.MapBase_mapToString(this); + }, + $isMap: 1 + }; + A.MapBase_addAll_closure.prototype = { + call$2(key, value) { + this.$this.$indexSet(0, key, value); + }, + $signature() { + return A._instanceType(this.$this)._eval$1("~(MapBase.K,MapBase.V)"); + } + }; + A.MapBase_entries_closure.prototype = { + call$1(key) { + var t1 = this.$this, + t2 = t1.$index(0, key); + if (t2 == null) + t2 = A._instanceType(t1)._eval$1("MapBase.V")._as(t2); + t1 = A._instanceType(t1); + return new A.MapEntry(key, t2, t1._eval$1("@")._bind$1(t1._eval$1("MapBase.V"))._eval$1("MapEntry<1,2>")); + }, + $signature() { + return A._instanceType(this.$this)._eval$1("MapEntry(MapBase.K)"); + } + }; + A.MapBase_mapToString_closure.prototype = { + call$2(k, v) { + var t2, + t1 = this._box_0; + if (!t1.first) + this.result._contents += ", "; + t1.first = false; + t1 = this.result; + t2 = t1._contents += A.S(k); + t1._contents = t2 + ": "; + t1._contents += A.S(v); + }, + $signature: 176 + }; + A.UnmodifiableMapBase.prototype = {}; + A._MapBaseValueIterable.prototype = { + get$length(_) { + var t1 = this._map; + return t1.get$length(t1); + }, + get$isEmpty(_) { + var t1 = this._map; + return t1.get$isEmpty(t1); + }, + get$isNotEmpty(_) { + var t1 = this._map; + return t1.get$isNotEmpty(t1); + }, + get$first(_) { + var t1 = this._map; + t1 = t1.$index(0, J.get$first$ax(t1.get$keys(t1))); + return t1 == null ? this.$ti._rest[1]._as(t1) : t1; + }, + get$single(_) { + var t1 = this._map; + t1 = t1.$index(0, J.get$single$ax(t1.get$keys(t1))); + return t1 == null ? this.$ti._rest[1]._as(t1) : t1; + }, + get$last(_) { + var t1 = this._map; + t1 = t1.$index(0, J.get$last$ax(t1.get$keys(t1))); + return t1 == null ? this.$ti._rest[1]._as(t1) : t1; + }, + get$iterator(_) { + var t1 = this._map, + t2 = this.$ti; + return new A._MapBaseValueIterator(J.get$iterator$ax(t1.get$keys(t1)), t1, t2._eval$1("@<1>")._bind$1(t2._rest[1])._eval$1("_MapBaseValueIterator<1,2>")); + } + }; + A._MapBaseValueIterator.prototype = { + moveNext$0() { + var _this = this, + t1 = _this._collection$_keys; + if (t1.moveNext$0()) { + _this._collection$_current = _this._map.$index(0, t1.get$current(t1)); + return true; + } + _this._collection$_current = null; + return false; + }, + get$current(_) { + var t1 = this._collection$_current; + return t1 == null ? this.$ti._rest[1]._as(t1) : t1; + } + }; + A._UnmodifiableMapMixin.prototype = { + $indexSet(_, key, value) { + throw A.wrapException(A.UnsupportedError$("Cannot modify unmodifiable map")); + }, + addAll$1(_, other) { + throw A.wrapException(A.UnsupportedError$("Cannot modify unmodifiable map")); + }, + remove$1(_, key) { + throw A.wrapException(A.UnsupportedError$("Cannot modify unmodifiable map")); + } + }; + A.MapView.prototype = { + cast$2$0(_, RK, RV) { + return this._map.cast$2$0(0, RK, RV); + }, + $index(_, key) { + return this._map.$index(0, key); + }, + $indexSet(_, key, value) { + this._map.$indexSet(0, key, value); + }, + addAll$1(_, other) { + this._map.addAll$1(0, other); + }, + containsKey$1(key) { + return this._map.containsKey$1(key); + }, + forEach$1(_, action) { + this._map.forEach$1(0, action); + }, + get$isEmpty(_) { + var t1 = this._map; + return t1.get$isEmpty(t1); + }, + get$isNotEmpty(_) { + var t1 = this._map; + return t1.get$isNotEmpty(t1); + }, + get$length(_) { + var t1 = this._map; + return t1.get$length(t1); + }, + get$keys(_) { + var t1 = this._map; + return t1.get$keys(t1); + }, + remove$1(_, key) { + return this._map.remove$1(0, key); + }, + toString$0(_) { + return this._map.toString$0(0); + }, + get$values(_) { + var t1 = this._map; + return t1.get$values(t1); + }, + get$entries(_) { + var t1 = this._map; + return t1.get$entries(t1); + }, + $isMap: 1 + }; + A.UnmodifiableMapView.prototype = { + cast$2$0(_, RK, RV) { + return new A.UnmodifiableMapView(this._map.cast$2$0(0, RK, RV), RK._eval$1("@<0>")._bind$1(RV)._eval$1("UnmodifiableMapView<1,2>")); + } + }; + A.ListQueue.prototype = { + get$iterator(_) { + var _this = this; + return new A._ListQueueIterator(_this, _this._tail, _this._modificationCount, _this._head, _this.$ti._eval$1("_ListQueueIterator<1>")); + }, + get$isEmpty(_) { + return this._head === this._tail; + }, + get$length(_) { + return (this._tail - this._head & this._table.length - 1) >>> 0; + }, + get$first(_) { + var _this = this, + t1 = _this._head; + if (t1 === _this._tail) + throw A.wrapException(A.IterableElementError_noElement()); + t1 = _this._table[t1]; + return t1 == null ? _this.$ti._precomputed1._as(t1) : t1; + }, + get$last(_) { + var _this = this, + t1 = _this._head, + t2 = _this._tail; + if (t1 === t2) + throw A.wrapException(A.IterableElementError_noElement()); + t1 = _this._table; + t1 = t1[(t2 - 1 & t1.length - 1) >>> 0]; + return t1 == null ? _this.$ti._precomputed1._as(t1) : t1; + }, + get$single(_) { + var t1, _this = this; + if (_this._head === _this._tail) + throw A.wrapException(A.IterableElementError_noElement()); + if (_this.get$length(0) > 1) + throw A.wrapException(A.IterableElementError_tooMany()); + t1 = _this._table[_this._head]; + return t1 == null ? _this.$ti._precomputed1._as(t1) : t1; + }, + elementAt$1(_, index) { + var t1, _this = this; + A.IndexError_check(index, _this.get$length(0), _this, null, null); + t1 = _this._table; + t1 = t1[(_this._head + index & t1.length - 1) >>> 0]; + return t1 == null ? _this.$ti._precomputed1._as(t1) : t1; + }, + toList$1$growable(_, growable) { + var t1, list, t2, t3, i, t4, _this = this, + mask = _this._table.length - 1, + $length = (_this._tail - _this._head & mask) >>> 0; + if ($length === 0) { + t1 = J.JSArray_JSArray$growable(0, _this.$ti._precomputed1); + return t1; + } + t1 = _this.$ti._precomputed1; + list = A.List_List$filled($length, _this.get$first(0), true, t1); + for (t2 = _this._table, t3 = _this._head, i = 0; i < $length; ++i) { + t4 = t2[(t3 + i & mask) >>> 0]; + list[i] = t4 == null ? t1._as(t4) : t4; + } + return list; + }, + toList$0(_) { + return this.toList$1$growable(0, true); + }, + addAll$1(_, elements) { + var addCount, $length, t2, t3, t4, newTable, endSpace, preSpace, _i, _this = this, + t1 = _this.$ti; + if (t1._eval$1("List<1>")._is(elements)) { + addCount = elements.length; + $length = _this.get$length(0); + t2 = $length + addCount; + t3 = _this._table; + t4 = t3.length; + if (t2 >= t4) { + newTable = A.List_List$filled(A.ListQueue__nextPowerOf2(t2 + (t2 >>> 1)), null, false, t1._eval$1("1?")); + _this._tail = _this._collection$_writeToList$1(newTable); + _this._table = newTable; + _this._head = 0; + B.JSArray_methods.setRange$4(newTable, $length, t2, elements, 0); + _this._tail += addCount; + } else { + t1 = _this._tail; + endSpace = t4 - t1; + if (addCount < endSpace) { + B.JSArray_methods.setRange$4(t3, t1, t1 + addCount, elements, 0); + _this._tail += addCount; + } else { + preSpace = addCount - endSpace; + B.JSArray_methods.setRange$4(t3, t1, t1 + endSpace, elements, 0); + B.JSArray_methods.setRange$4(_this._table, 0, preSpace, elements, endSpace); + _this._tail = preSpace; + } + } + ++_this._modificationCount; + } else + for (t1 = elements.length, _i = 0; _i < elements.length; elements.length === t1 || (0, A.throwConcurrentModificationError)(elements), ++_i) + _this._add$1(elements[_i]); + }, + clear$0(_) { + var t2, t3, _this = this, + i = _this._head, + t1 = _this._tail; + if (i !== t1) { + for (t2 = _this._table, t3 = t2.length - 1; i !== t1; i = (i + 1 & t3) >>> 0) + t2[i] = null; + _this._head = _this._tail = 0; + ++_this._modificationCount; + } + }, + toString$0(_) { + return A.Iterable_iterableToFullString(this, "{", "}"); + }, + addFirst$1(value) { + var _this = this, + t1 = _this._head, + t2 = _this._table; + t1 = _this._head = (t1 - 1 & t2.length - 1) >>> 0; + t2[t1] = value; + if (t1 === _this._tail) + _this._grow$0(); + ++_this._modificationCount; + }, + removeFirst$0() { + var t2, result, _this = this, + t1 = _this._head; + if (t1 === _this._tail) + throw A.wrapException(A.IterableElementError_noElement()); + ++_this._modificationCount; + t2 = _this._table; + result = t2[t1]; + if (result == null) + result = _this.$ti._precomputed1._as(result); + t2[t1] = null; + _this._head = (t1 + 1 & t2.length - 1) >>> 0; + return result; + }, + _add$1(element) { + var _this = this, + t1 = _this._table, + t2 = _this._tail; + t1[t2] = element; + t1 = (t2 + 1 & t1.length - 1) >>> 0; + _this._tail = t1; + if (_this._head === t1) + _this._grow$0(); + ++_this._modificationCount; + }, + _grow$0() { + var _this = this, + newTable = A.List_List$filled(_this._table.length * 2, null, false, _this.$ti._eval$1("1?")), + t1 = _this._table, + t2 = _this._head, + split = t1.length - t2; + B.JSArray_methods.setRange$4(newTable, 0, split, t1, t2); + B.JSArray_methods.setRange$4(newTable, split, split + _this._head, _this._table, 0); + _this._head = 0; + _this._tail = _this._table.length; + _this._table = newTable; + }, + _collection$_writeToList$1(target) { + var $length, firstPartSize, _this = this, + t1 = _this._head, + t2 = _this._tail, + t3 = _this._table; + if (t1 <= t2) { + $length = t2 - t1; + B.JSArray_methods.setRange$4(target, 0, $length, t3, t1); + return $length; + } else { + firstPartSize = t3.length - t1; + B.JSArray_methods.setRange$4(target, 0, firstPartSize, t3, t1); + B.JSArray_methods.setRange$4(target, firstPartSize, firstPartSize + _this._tail, _this._table, 0); + return _this._tail + firstPartSize; + } + }, + $isQueue: 1 + }; + A._ListQueueIterator.prototype = { + get$current(_) { + var t1 = this._collection$_current; + return t1 == null ? this.$ti._precomputed1._as(t1) : t1; + }, + moveNext$0() { + var t2, _this = this, + t1 = _this._queue; + if (_this._modificationCount !== t1._modificationCount) + A.throwExpression(A.ConcurrentModificationError$(t1)); + t2 = _this._collection$_position; + if (t2 === _this._collection$_end) { + _this._collection$_current = null; + return false; + } + t1 = t1._table; + _this._collection$_current = t1[t2]; + _this._collection$_position = (t2 + 1 & t1.length - 1) >>> 0; + return true; + } + }; + A.SetBase.prototype = { + get$isEmpty(_) { + return this.get$length(this) === 0; + }, + get$isNotEmpty(_) { + return this.get$length(this) !== 0; + }, + addAll$1(_, elements) { + var t1; + for (t1 = J.get$iterator$ax(elements); t1.moveNext$0();) + this.add$1(0, t1.get$current(t1)); + }, + removeAll$1(elements) { + var t1; + for (t1 = J.get$iterator$ax(elements); t1.moveNext$0();) + this.remove$1(0, t1.get$current(t1)); + }, + difference$1(other) { + var t1, t2, element, + result = this.toSet$0(0); + for (t1 = this.get$iterator(this), t2 = other._source; t1.moveNext$0();) { + element = t1.get$current(t1); + if (t2.contains$1(0, element)) + result.remove$1(0, element); + } + return result; + }, + toList$1$growable(_, growable) { + return A.List_List$of(this, true, A._instanceType(this)._precomputed1); + }, + toList$0(_) { + return this.toList$1$growable(0, true); + }, + map$1$1(_, f, $T) { + return new A.EfficientLengthMappedIterable(this, f, A._instanceType(this)._eval$1("@<1>")._bind$1($T)._eval$1("EfficientLengthMappedIterable<1,2>")); + }, + get$single(_) { + var it, _this = this; + if (_this.get$length(_this) > 1) + throw A.wrapException(A.IterableElementError_tooMany()); + it = _this.get$iterator(_this); + if (!it.moveNext$0()) + throw A.wrapException(A.IterableElementError_noElement()); + return it.get$current(it); + }, + toString$0(_) { + return A.Iterable_iterableToFullString(this, "{", "}"); + }, + where$1(_, f) { + return new A.WhereIterable(this, f, A._instanceType(this)._eval$1("WhereIterable<1>")); + }, + forEach$1(_, f) { + var t1; + for (t1 = this.get$iterator(this); t1.moveNext$0();) + f.call$1(t1.get$current(t1)); + }, + every$1(_, f) { + var t1; + for (t1 = this.get$iterator(this); t1.moveNext$0();) + if (!f.call$1(t1.get$current(t1))) + return false; + return true; + }, + any$1(_, test) { + var t1; + for (t1 = this.get$iterator(this); t1.moveNext$0();) + if (test.call$1(t1.get$current(t1))) + return true; + return false; + }, + take$1(_, n) { + return A.TakeIterable_TakeIterable(this, n, A._instanceType(this)._precomputed1); + }, + skip$1(_, n) { + return A.SkipIterable_SkipIterable(this, n, A._instanceType(this)._precomputed1); + }, + get$first(_) { + var it = this.get$iterator(this); + if (!it.moveNext$0()) + throw A.wrapException(A.IterableElementError_noElement()); + return it.get$current(it); + }, + get$last(_) { + var result, + it = this.get$iterator(this); + if (!it.moveNext$0()) + throw A.wrapException(A.IterableElementError_noElement()); + do + result = it.get$current(it); + while (it.moveNext$0()); + return result; + }, + elementAt$1(_, index) { + var iterator, skipCount; + A.RangeError_checkNotNegative(index, "index"); + iterator = this.get$iterator(this); + for (skipCount = index; iterator.moveNext$0();) { + if (skipCount === 0) + return iterator.get$current(iterator); + --skipCount; + } + throw A.wrapException(A.IndexError$withLength(index, index - skipCount, this, null, "index")); + }, + $isEfficientLengthIterable: 1, + $isIterable: 1, + $isSet: 1 + }; + A._SetBase.prototype = { + difference$1(other) { + var t1, t2, t3, element, _this = this, + result = _this._newSet$0(); + for (t1 = A._LinkedHashSetIterator$(_this, _this._collection$_modifications, A._instanceType(_this)._precomputed1), t2 = other._source, t3 = t1.$ti._precomputed1; t1.moveNext$0();) { + element = t1._collection$_current; + if (element == null) + element = t3._as(element); + if (!t2.contains$1(0, element)) + result.add$1(0, element); + } + return result; + }, + intersection$1(other) { + var t1, t2, t3, element, _this = this, + result = _this._newSet$0(); + for (t1 = A._LinkedHashSetIterator$(_this, _this._collection$_modifications, A._instanceType(_this)._precomputed1), t2 = other._baseMap, t3 = t1.$ti._precomputed1; t1.moveNext$0();) { + element = t1._collection$_current; + if (element == null) + element = t3._as(element); + if (t2.containsKey$1(element)) + result.add$1(0, element); + } + return result; + }, + toSet$0(_) { + var t1 = this._newSet$0(); + t1.addAll$1(0, this); + return t1; + } + }; + A._UnmodifiableSetMixin.prototype = { + add$1(_, value) { + return A._UnmodifiableSetMixin__throwUnmodifiable(); + }, + addAll$1(_, elements) { + return A._UnmodifiableSetMixin__throwUnmodifiable(); + }, + remove$1(_, value) { + return A._UnmodifiableSetMixin__throwUnmodifiable(); + } + }; + A.UnmodifiableSetView.prototype = { + contains$1(_, element) { + return this._collection$_source.contains$1(0, element); + }, + get$length(_) { + return this._collection$_source._collection$_length; + }, + get$iterator(_) { + var t1 = this._collection$_source; + return A._LinkedHashSetIterator$(t1, t1._collection$_modifications, A._instanceType(t1)._precomputed1); + }, + toSet$0(_) { + return this._collection$_source.toSet$0(0); + } + }; + A._UnmodifiableMapView_MapView__UnmodifiableMapMixin.prototype = {}; + A._UnmodifiableSetView_SetBase__UnmodifiableSetMixin.prototype = {}; + A._JsonMap.prototype = { + $index(_, key) { + var result, + t1 = this._processed; + if (t1 == null) + return this._data.$index(0, key); + else if (typeof key != "string") + return null; + else { + result = t1[key]; + return typeof result == "undefined" ? this._process$1(key) : result; + } + }, + get$length(_) { + return this._processed == null ? this._data.__js_helper$_length : this._convert$_computeKeys$0().length; + }, + get$isEmpty(_) { + return this.get$length(0) === 0; + }, + get$isNotEmpty(_) { + return this.get$length(0) > 0; + }, + get$keys(_) { + var t1; + if (this._processed == null) { + t1 = this._data; + return new A.LinkedHashMapKeyIterable(t1, A._instanceType(t1)._eval$1("LinkedHashMapKeyIterable<1>")); + } + return new A._JsonMapKeyIterable(this); + }, + get$values(_) { + var _this = this; + if (_this._processed == null) + return _this._data.get$values(0); + return A.MappedIterable_MappedIterable(_this._convert$_computeKeys$0(), new A._JsonMap_values_closure(_this), type$.String, type$.dynamic); + }, + $indexSet(_, key, value) { + var processed, original, _this = this; + if (_this._processed == null) + _this._data.$indexSet(0, key, value); + else if (_this.containsKey$1(key)) { + processed = _this._processed; + processed[key] = value; + original = _this._original; + if (original == null ? processed != null : original !== processed) + original[key] = null; + } else + _this._upgrade$0().$indexSet(0, key, value); + }, + addAll$1(_, other) { + other.forEach$1(0, new A._JsonMap_addAll_closure(this)); + }, + containsKey$1(key) { + if (this._processed == null) + return this._data.containsKey$1(key); + if (typeof key != "string") + return false; + return Object.prototype.hasOwnProperty.call(this._original, key); + }, + remove$1(_, key) { + if (this._processed != null && !this.containsKey$1(key)) + return null; + return this._upgrade$0().remove$1(0, key); + }, + forEach$1(_, f) { + var keys, i, key, value, _this = this; + if (_this._processed == null) + return _this._data.forEach$1(0, f); + keys = _this._convert$_computeKeys$0(); + for (i = 0; i < keys.length; ++i) { + key = keys[i]; + value = _this._processed[key]; + if (typeof value == "undefined") { + value = A._convertJsonToDartLazy(_this._original[key]); + _this._processed[key] = value; + } + f.call$2(key, value); + if (keys !== _this._data) + throw A.wrapException(A.ConcurrentModificationError$(_this)); + } + }, + _convert$_computeKeys$0() { + var keys = this._data; + if (keys == null) + keys = this._data = A._setArrayType(Object.keys(this._original), type$.JSArray_String); + return keys; + }, + _upgrade$0() { + var result, keys, i, t1, key, _this = this; + if (_this._processed == null) + return _this._data; + result = A.LinkedHashMap_LinkedHashMap$_empty(type$.String, type$.dynamic); + keys = _this._convert$_computeKeys$0(); + for (i = 0; t1 = keys.length, i < t1; ++i) { + key = keys[i]; + result.$indexSet(0, key, _this.$index(0, key)); + } + if (t1 === 0) + keys.push(""); + else + B.JSArray_methods.clear$0(keys); + _this._original = _this._processed = null; + return _this._data = result; + }, + _process$1(key) { + var result; + if (!Object.prototype.hasOwnProperty.call(this._original, key)) + return null; + result = A._convertJsonToDartLazy(this._original[key]); + return this._processed[key] = result; + } + }; + A._JsonMap_values_closure.prototype = { + call$1(each) { + return this.$this.$index(0, each); + }, + $signature: 219 + }; + A._JsonMap_addAll_closure.prototype = { + call$2(key, value) { + this.$this.$indexSet(0, key, value); + }, + $signature: 129 + }; + A._JsonMapKeyIterable.prototype = { + get$length(_) { + return this._convert$_parent.get$length(0); + }, + elementAt$1(_, index) { + var t1 = this._convert$_parent; + return t1._processed == null ? t1.get$keys(0).elementAt$1(0, index) : t1._convert$_computeKeys$0()[index]; + }, + get$iterator(_) { + var t1 = this._convert$_parent; + if (t1._processed == null) { + t1 = t1.get$keys(0); + t1 = t1.get$iterator(t1); + } else { + t1 = t1._convert$_computeKeys$0(); + t1 = new J.ArrayIterator(t1, t1.length, A._arrayInstanceType(t1)._eval$1("ArrayIterator<1>")); + } + return t1; + }, + contains$1(_, key) { + return this._convert$_parent.containsKey$1(key); + } + }; + A._Utf8Decoder__decoder_closure.prototype = { + call$0() { + var t1, exception; + try { + t1 = new TextDecoder("utf-8", {fatal: true}); + return t1; + } catch (exception) { + } + return null; + }, + $signature: 57 + }; + A._Utf8Decoder__decoderNonfatal_closure.prototype = { + call$0() { + var t1, exception; + try { + t1 = new TextDecoder("utf-8", {fatal: false}); + return t1; + } catch (exception) { + } + return null; + }, + $signature: 57 + }; + A.AsciiCodec.prototype = { + encode$1(source) { + return B.AsciiEncoder_127.convert$1(source); + } + }; + A._UnicodeSubsetEncoder.prototype = { + convert$1(string) { + var t1, i, codeUnit, + $length = A.RangeError_checkValidRange(0, null, string.length) - 0, + result = new Uint8Array($length); + for (t1 = ~this._subsetMask, i = 0; i < $length; ++i) { + codeUnit = string.charCodeAt(i); + if ((codeUnit & t1) !== 0) + throw A.wrapException(A.ArgumentError$value(string, "string", "Contains invalid characters.")); + result[i] = codeUnit; + } + return result; + } + }; + A.AsciiEncoder.prototype = {}; + A.Base64Codec.prototype = { + normalize$3(source, start, end) { + var inverseAlphabet, i, sliceStart, buffer, firstPadding, firstPaddingSourceIndex, paddingCount, i0, char, i1, digit1, digit2, char0, value, t1, t2, endLength, $length, + _s31_ = "Invalid base64 encoding length "; + end = A.RangeError_checkValidRange(start, end, source.length); + inverseAlphabet = $.$get$_Base64Decoder__inverseAlphabet(); + for (i = start, sliceStart = i, buffer = null, firstPadding = -1, firstPaddingSourceIndex = -1, paddingCount = 0; i < end; i = i0) { + i0 = i + 1; + char = source.charCodeAt(i); + if (char === 37) { + i1 = i0 + 2; + if (i1 <= end) { + digit1 = A.hexDigitValue(source.charCodeAt(i0)); + digit2 = A.hexDigitValue(source.charCodeAt(i0 + 1)); + char0 = digit1 * 16 + digit2 - (digit2 & 256); + if (char0 === 37) + char0 = -1; + i0 = i1; + } else + char0 = -1; + } else + char0 = char; + if (0 <= char0 && char0 <= 127) { + value = inverseAlphabet[char0]; + if (value >= 0) { + char0 = string$.ABCDEF.charCodeAt(value); + if (char0 === char) + continue; + char = char0; + } else { + if (value === -1) { + if (firstPadding < 0) { + t1 = buffer == null ? null : buffer._contents.length; + if (t1 == null) + t1 = 0; + firstPadding = t1 + (i - sliceStart); + firstPaddingSourceIndex = i; + } + ++paddingCount; + if (char === 61) + continue; + } + char = char0; + } + if (value !== -2) { + if (buffer == null) { + buffer = new A.StringBuffer(""); + t1 = buffer; + } else + t1 = buffer; + t1._contents += B.JSString_methods.substring$2(source, sliceStart, i); + t1._contents += A.Primitives_stringFromCharCode(char); + sliceStart = i0; + continue; + } + } + throw A.wrapException(A.FormatException$("Invalid base64 data", source, i)); + } + if (buffer != null) { + t1 = buffer._contents += B.JSString_methods.substring$2(source, sliceStart, end); + t2 = t1.length; + if (firstPadding >= 0) + A.Base64Codec__checkPadding(source, firstPaddingSourceIndex, end, firstPadding, paddingCount, t2); + else { + endLength = B.JSInt_methods.$mod(t2 - 1, 4) + 1; + if (endLength === 1) + throw A.wrapException(A.FormatException$(_s31_, source, end)); + for (; endLength < 4;) { + t1 += "="; + buffer._contents = t1; + ++endLength; + } + } + t1 = buffer._contents; + return B.JSString_methods.replaceRange$3(source, start, end, t1.charCodeAt(0) == 0 ? t1 : t1); + } + $length = end - start; + if (firstPadding >= 0) + A.Base64Codec__checkPadding(source, firstPaddingSourceIndex, end, firstPadding, paddingCount, $length); + else { + endLength = B.JSInt_methods.$mod($length, 4); + if (endLength === 1) + throw A.wrapException(A.FormatException$(_s31_, source, end)); + if (endLength > 1) + source = B.JSString_methods.replaceRange$3(source, end, end, endLength === 2 ? "==" : "="); + } + return source; + } + }; + A.Base64Encoder.prototype = { + startChunkedConversion$1(sink) { + return new A._Utf8Base64EncoderSink(new A._Utf8StringSinkAdapter(new A._Utf8Decoder(false), sink, sink._stringSink), new A._Base64Encoder(string$.ABCDEF)); + } + }; + A._Base64Encoder.prototype = { + createBuffer$1(bufferLength) { + return new Uint8Array(bufferLength); + }, + encode$4(bytes, start, end, isLast) { + var output, _this = this, + byteCount = (_this._convert$_state & 3) + (end - start), + fullChunks = B.JSInt_methods._tdivFast$1(byteCount, 3), + bufferLength = fullChunks * 4; + if (isLast && byteCount - fullChunks * 3 > 0) + bufferLength += 4; + output = _this.createBuffer$1(bufferLength); + _this._convert$_state = A._Base64Encoder_encodeChunk(_this._alphabet, bytes, start, end, isLast, output, 0, _this._convert$_state); + if (bufferLength > 0) + return output; + return null; + } + }; + A._Base64EncoderSink.prototype = {}; + A._Utf8Base64EncoderSink.prototype = { + _convert$_add$4(source, start, end, isLast) { + var buffer = this._encoder.encode$4(source, start, end, isLast); + if (buffer != null) + this._sink.addSlice$4(buffer, 0, buffer.length, isLast); + } + }; + A.ByteConversionSink.prototype = {}; + A.Codec.prototype = {}; + A.Converter.prototype = {}; + A.Encoding.prototype = {}; + A.JsonUnsupportedObjectError.prototype = { + toString$0(_) { + var safeString = A.Error_safeToString(this.unsupportedObject); + return (this.cause != null ? "Converting object to an encodable object failed:" : "Converting object did not return an encodable object:") + " " + safeString; + } + }; + A.JsonCyclicError.prototype = { + toString$0(_) { + return "Cyclic error in JSON stringify"; + } + }; + A.JsonCodec.prototype = { + decode$1(source) { + var t1 = A._parseJson(source, this.get$decoder()._reviver); + return t1; + }, + encode$2$toEncodable(value, toEncodable) { + var t1 = A._JsonStringStringifier_stringify(value, this.get$encoder()._toEncodable, null); + return t1; + }, + get$encoder() { + return B.JsonEncoder_null; + }, + get$decoder() { + return B.JsonDecoder_null; + } + }; + A.JsonEncoder.prototype = {}; + A.JsonDecoder.prototype = {}; + A._JsonStringifier.prototype = { + writeStringContent$1(s) { + var offset, i, charCode, t1, t2, _this = this, + $length = s.length; + for (offset = 0, i = 0; i < $length; ++i) { + charCode = s.charCodeAt(i); + if (charCode > 92) { + if (charCode >= 55296) { + t1 = charCode & 64512; + if (t1 === 55296) { + t2 = i + 1; + t2 = !(t2 < $length && (s.charCodeAt(t2) & 64512) === 56320); + } else + t2 = false; + if (!t2) + if (t1 === 56320) { + t1 = i - 1; + t1 = !(t1 >= 0 && (s.charCodeAt(t1) & 64512) === 55296); + } else + t1 = false; + else + t1 = true; + if (t1) { + if (i > offset) + _this.writeStringSlice$3(s, offset, i); + offset = i + 1; + _this.writeCharCode$1(92); + _this.writeCharCode$1(117); + _this.writeCharCode$1(100); + t1 = charCode >>> 8 & 15; + _this.writeCharCode$1(t1 < 10 ? 48 + t1 : 87 + t1); + t1 = charCode >>> 4 & 15; + _this.writeCharCode$1(t1 < 10 ? 48 + t1 : 87 + t1); + t1 = charCode & 15; + _this.writeCharCode$1(t1 < 10 ? 48 + t1 : 87 + t1); + } + } + continue; + } + if (charCode < 32) { + if (i > offset) + _this.writeStringSlice$3(s, offset, i); + offset = i + 1; + _this.writeCharCode$1(92); + switch (charCode) { + case 8: + _this.writeCharCode$1(98); + break; + case 9: + _this.writeCharCode$1(116); + break; + case 10: + _this.writeCharCode$1(110); + break; + case 12: + _this.writeCharCode$1(102); + break; + case 13: + _this.writeCharCode$1(114); + break; + default: + _this.writeCharCode$1(117); + _this.writeCharCode$1(48); + _this.writeCharCode$1(48); + t1 = charCode >>> 4 & 15; + _this.writeCharCode$1(t1 < 10 ? 48 + t1 : 87 + t1); + t1 = charCode & 15; + _this.writeCharCode$1(t1 < 10 ? 48 + t1 : 87 + t1); + break; + } + } else if (charCode === 34 || charCode === 92) { + if (i > offset) + _this.writeStringSlice$3(s, offset, i); + offset = i + 1; + _this.writeCharCode$1(92); + _this.writeCharCode$1(charCode); + } + } + if (offset === 0) + _this.writeString$1(s); + else if (offset < $length) + _this.writeStringSlice$3(s, offset, $length); + }, + _checkCycle$1(object) { + var t1, t2, i, t3; + for (t1 = this._seen, t2 = t1.length, i = 0; i < t2; ++i) { + t3 = t1[i]; + if (object == null ? t3 == null : object === t3) + throw A.wrapException(new A.JsonCyclicError(object, null)); + } + t1.push(object); + }, + writeObject$1(object) { + var customJson, e, t1, exception, _this = this; + if (_this.writeJsonValue$1(object)) + return; + _this._checkCycle$1(object); + try { + customJson = _this._toEncodable.call$1(object); + if (!_this.writeJsonValue$1(customJson)) { + t1 = A.JsonUnsupportedObjectError$(object, null, _this.get$_partialResult()); + throw A.wrapException(t1); + } + _this._seen.pop(); + } catch (exception) { + e = A.unwrapException(exception); + t1 = A.JsonUnsupportedObjectError$(object, e, _this.get$_partialResult()); + throw A.wrapException(t1); + } + }, + writeJsonValue$1(object) { + var success, _this = this; + if (typeof object == "number") { + if (!isFinite(object)) + return false; + _this.writeNumber$1(object); + return true; + } else if (object === true) { + _this.writeString$1("true"); + return true; + } else if (object === false) { + _this.writeString$1("false"); + return true; + } else if (object == null) { + _this.writeString$1("null"); + return true; + } else if (typeof object == "string") { + _this.writeString$1('"'); + _this.writeStringContent$1(object); + _this.writeString$1('"'); + return true; + } else if (type$.List_dynamic._is(object)) { + _this._checkCycle$1(object); + _this.writeList$1(object); + _this._seen.pop(); + return true; + } else if (type$.Map_dynamic_dynamic._is(object)) { + _this._checkCycle$1(object); + success = _this.writeMap$1(object); + _this._seen.pop(); + return success; + } else + return false; + }, + writeList$1(list) { + var t1, i, _this = this; + _this.writeString$1("["); + t1 = J.getInterceptor$asx(list); + if (t1.get$isNotEmpty(list)) { + _this.writeObject$1(t1.$index(list, 0)); + for (i = 1; i < t1.get$length(list); ++i) { + _this.writeString$1(","); + _this.writeObject$1(t1.$index(list, i)); + } + } + _this.writeString$1("]"); + }, + writeMap$1(map) { + var t1, keyValueList, i, separator, _this = this, _box_0 = {}; + if (map.get$isEmpty(map)) { + _this.writeString$1("{}"); + return true; + } + t1 = map.get$length(map) * 2; + keyValueList = A.List_List$filled(t1, null, false, type$.nullable_Object); + i = _box_0.i = 0; + _box_0.allStringKeys = true; + map.forEach$1(0, new A._JsonStringifier_writeMap_closure(_box_0, keyValueList)); + if (!_box_0.allStringKeys) + return false; + _this.writeString$1("{"); + for (separator = '"'; i < t1; i += 2, separator = ',"') { + _this.writeString$1(separator); + _this.writeStringContent$1(A._asString(keyValueList[i])); + _this.writeString$1('":'); + _this.writeObject$1(keyValueList[i + 1]); + } + _this.writeString$1("}"); + return true; + } + }; + A._JsonStringifier_writeMap_closure.prototype = { + call$2(key, value) { + var t1, t2, t3, i; + if (typeof key != "string") + this._box_0.allStringKeys = false; + t1 = this.keyValueList; + t2 = this._box_0; + t3 = t2.i; + i = t2.i = t3 + 1; + t1[t3] = key; + t2.i = i + 1; + t1[i] = value; + }, + $signature: 176 + }; + A._JsonStringStringifier.prototype = { + get$_partialResult() { + var t1 = this._sink._contents; + return t1.charCodeAt(0) == 0 ? t1 : t1; + }, + writeNumber$1(number) { + this._sink._contents += B.JSNumber_methods.toString$0(number); + }, + writeString$1(string) { + this._sink._contents += string; + }, + writeStringSlice$3(string, start, end) { + this._sink._contents += B.JSString_methods.substring$2(string, start, end); + }, + writeCharCode$1(charCode) { + this._sink._contents += A.Primitives_stringFromCharCode(charCode); + } + }; + A.StringConversionSink.prototype = {}; + A._StringSinkConversionSink.prototype = { + close$0(_) { + } + }; + A._StringCallbackSink.prototype = { + close$0(_) { + var t1 = this._stringSink, + t2 = t1._contents; + t1._contents = ""; + this._convert$_callback.call$1(t2.charCodeAt(0) == 0 ? t2 : t2); + }, + asUtf8Sink$1(allowMalformed) { + return new A._Utf8StringSinkAdapter(new A._Utf8Decoder(allowMalformed), this, this._stringSink); + } + }; + A._Utf8StringSinkAdapter.prototype = { + close$0(_) { + this._decoder.flush$1(this._stringSink); + this._sink.close$0(0); + }, + add$1(_, chunk) { + this.addSlice$4(chunk, 0, J.get$length$asx(chunk), false); + }, + addSlice$4(codeUnits, startIndex, endIndex, isLast) { + this._stringSink._contents += this._decoder._convertGeneral$4(codeUnits, startIndex, endIndex, false); + if (isLast) + this.close$0(0); + } + }; + A.Utf8Codec.prototype = { + encode$1(string) { + return B.C_Utf8Encoder.convert$1(string); + } + }; + A.Utf8Encoder.prototype = { + convert$1(string) { + var t1, encoder, + end = A.RangeError_checkValidRange(0, null, string.length), + $length = end - 0; + if ($length === 0) + return new Uint8Array(0); + t1 = new Uint8Array($length * 3); + encoder = new A._Utf8Encoder(t1); + if (encoder._fillBuffer$3(string, 0, end) !== end) + encoder._writeReplacementCharacter$0(); + return B.NativeUint8List_methods.sublist$2(t1, 0, encoder._bufferIndex); + } + }; + A._Utf8Encoder.prototype = { + _writeReplacementCharacter$0() { + var _this = this, + t1 = _this._buffer, + t2 = _this._bufferIndex, + t3 = _this._bufferIndex = t2 + 1; + t1[t2] = 239; + t2 = _this._bufferIndex = t3 + 1; + t1[t3] = 191; + _this._bufferIndex = t2 + 1; + t1[t2] = 189; + }, + _writeSurrogate$2(leadingSurrogate, nextCodeUnit) { + var rune, t1, t2, t3, _this = this; + if ((nextCodeUnit & 64512) === 56320) { + rune = 65536 + ((leadingSurrogate & 1023) << 10) | nextCodeUnit & 1023; + t1 = _this._buffer; + t2 = _this._bufferIndex; + t3 = _this._bufferIndex = t2 + 1; + t1[t2] = rune >>> 18 | 240; + t2 = _this._bufferIndex = t3 + 1; + t1[t3] = rune >>> 12 & 63 | 128; + t3 = _this._bufferIndex = t2 + 1; + t1[t2] = rune >>> 6 & 63 | 128; + _this._bufferIndex = t3 + 1; + t1[t3] = rune & 63 | 128; + return true; + } else { + _this._writeReplacementCharacter$0(); + return false; + } + }, + _fillBuffer$3(str, start, end) { + var t1, t2, stringIndex, codeUnit, t3, stringIndex0, t4, _this = this; + if (start !== end && (str.charCodeAt(end - 1) & 64512) === 55296) + --end; + for (t1 = _this._buffer, t2 = t1.length, stringIndex = start; stringIndex < end; ++stringIndex) { + codeUnit = str.charCodeAt(stringIndex); + if (codeUnit <= 127) { + t3 = _this._bufferIndex; + if (t3 >= t2) + break; + _this._bufferIndex = t3 + 1; + t1[t3] = codeUnit; + } else { + t3 = codeUnit & 64512; + if (t3 === 55296) { + if (_this._bufferIndex + 4 > t2) + break; + stringIndex0 = stringIndex + 1; + if (_this._writeSurrogate$2(codeUnit, str.charCodeAt(stringIndex0))) + stringIndex = stringIndex0; + } else if (t3 === 56320) { + if (_this._bufferIndex + 3 > t2) + break; + _this._writeReplacementCharacter$0(); + } else if (codeUnit <= 2047) { + t3 = _this._bufferIndex; + t4 = t3 + 1; + if (t4 >= t2) + break; + _this._bufferIndex = t4; + t1[t3] = codeUnit >>> 6 | 192; + _this._bufferIndex = t4 + 1; + t1[t4] = codeUnit & 63 | 128; + } else { + t3 = _this._bufferIndex; + if (t3 + 2 >= t2) + break; + t4 = _this._bufferIndex = t3 + 1; + t1[t3] = codeUnit >>> 12 | 224; + t3 = _this._bufferIndex = t4 + 1; + t1[t4] = codeUnit >>> 6 & 63 | 128; + _this._bufferIndex = t3 + 1; + t1[t3] = codeUnit & 63 | 128; + } + } + } + return stringIndex; + } + }; + A.Utf8Decoder.prototype = { + convert$1(codeUnits) { + return new A._Utf8Decoder(this._allowMalformed)._convertGeneral$4(codeUnits, 0, null, true); + } + }; + A._Utf8Decoder.prototype = { + _convertGeneral$4(codeUnits, start, maybeEnd, single) { + var casted, bytes, errorOffset, t1, result, message, _this = this, + end = A.RangeError_checkValidRange(start, maybeEnd, J.get$length$asx(codeUnits)); + if (start === end) + return ""; + if (codeUnits instanceof Uint8Array) { + casted = codeUnits; + bytes = casted; + errorOffset = 0; + } else { + bytes = A._Utf8Decoder__makeNativeUint8List(codeUnits, start, end); + end -= start; + errorOffset = start; + start = 0; + } + if (single && end - start >= 15) { + t1 = _this.allowMalformed; + result = A._Utf8Decoder__convertInterceptedUint8List(t1, bytes, start, end); + if (result != null) { + if (!t1) + return result; + if (result.indexOf("\ufffd") < 0) + return result; + } + } + result = _this._decodeRecursive$4(bytes, start, end, single); + t1 = _this._convert$_state; + if ((t1 & 1) !== 0) { + message = A._Utf8Decoder_errorDescription(t1); + _this._convert$_state = 0; + throw A.wrapException(A.FormatException$(message, codeUnits, errorOffset + _this._charOrIndex)); + } + return result; + }, + _decodeRecursive$4(bytes, start, end, single) { + var mid, s1, _this = this; + if (end - start > 1000) { + mid = B.JSInt_methods._tdivFast$1(start + end, 2); + s1 = _this._decodeRecursive$4(bytes, start, mid, false); + if ((_this._convert$_state & 1) !== 0) + return s1; + return s1 + _this._decodeRecursive$4(bytes, mid, end, single); + } + return _this.decodeGeneral$4(bytes, start, end, single); + }, + flush$1(sink) { + var state = this._convert$_state; + this._convert$_state = 0; + if (state <= 32) + return; + if (this.allowMalformed) + sink._contents += A.Primitives_stringFromCharCode(65533); + else + throw A.wrapException(A.FormatException$(A._Utf8Decoder_errorDescription(77), null, null)); + }, + decodeGeneral$4(bytes, start, end, single) { + var t1, type, t2, i0, markEnd, i1, m, _this = this, _65533 = 65533, + state = _this._convert$_state, + char = _this._charOrIndex, + buffer = new A.StringBuffer(""), + i = start + 1, + byte = bytes[start]; + $label0$0: + for (t1 = _this.allowMalformed; true;) { + for (; true; i = i0) { + type = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFFFFFFFFFFFFFFFFGGGGGGGGGGGGGGGGHHHHHHHHHHHHHHHHHHHHHHHHHHHIHHHJEEBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBKCCCCCCCCCCCCDCLONNNMEEEEEEEEEEE".charCodeAt(byte) & 31; + char = state <= 32 ? byte & 61694 >>> type : (byte & 63 | char << 6) >>> 0; + state = " \x000:XECCCCCN:lDb \x000:XECCCCCNvlDb \x000:XECCCCCN:lDb AAAAA\x00\x00\x00\x00\x00AAAAA00000AAAAA:::::AAAAAGG000AAAAA00KKKAAAAAG::::AAAAA:IIIIAAAAA000\x800AAAAA\x00\x00\x00\x00 AAAAA".charCodeAt(state + type); + if (state === 0) { + buffer._contents += A.Primitives_stringFromCharCode(char); + if (i === end) + break $label0$0; + break; + } else if ((state & 1) !== 0) { + if (t1) + switch (state) { + case 69: + case 67: + buffer._contents += A.Primitives_stringFromCharCode(_65533); + break; + case 65: + buffer._contents += A.Primitives_stringFromCharCode(_65533); + --i; + break; + default: + t2 = buffer._contents += A.Primitives_stringFromCharCode(_65533); + buffer._contents = t2 + A.Primitives_stringFromCharCode(_65533); + break; + } + else { + _this._convert$_state = state; + _this._charOrIndex = i - 1; + return ""; + } + state = 0; + } + if (i === end) + break $label0$0; + i0 = i + 1; + byte = bytes[i]; + } + i0 = i + 1; + byte = bytes[i]; + if (byte < 128) { + while (true) { + if (!(i0 < end)) { + markEnd = end; + break; + } + i1 = i0 + 1; + byte = bytes[i0]; + if (byte >= 128) { + markEnd = i1 - 1; + i0 = i1; + break; + } + i0 = i1; + } + if (markEnd - i < 20) + for (m = i; m < markEnd; ++m) + buffer._contents += A.Primitives_stringFromCharCode(bytes[m]); + else + buffer._contents += A.String_String$fromCharCodes(bytes, i, markEnd); + if (markEnd === end) + break $label0$0; + i = i0; + } else + i = i0; + } + if (single && state > 32) + if (t1) + buffer._contents += A.Primitives_stringFromCharCode(_65533); + else { + _this._convert$_state = 77; + _this._charOrIndex = end; + return ""; + } + _this._convert$_state = state; + _this._charOrIndex = char; + t1 = buffer._contents; + return t1.charCodeAt(0) == 0 ? t1 : t1; + } + }; + A.NoSuchMethodError_toString_closure.prototype = { + call$2(key, value) { + var t1 = this.sb, + t2 = this._box_0, + t3 = t1._contents += t2.comma; + t3 += key.__internal$_name; + t1._contents = t3; + t1._contents = t3 + ": "; + t1._contents += A.Error_safeToString(value); + t2.comma = ", "; + }, + $signature: 584 + }; + A.DateTime.prototype = { + $eq(_, other) { + if (other == null) + return false; + return other instanceof A.DateTime && this._core$_value === other._core$_value && true; + }, + compareTo$1(_, other) { + return B.JSInt_methods.compareTo$1(this._core$_value, other._core$_value); + }, + get$hashCode(_) { + var t1 = this._core$_value; + return (t1 ^ B.JSInt_methods._shrOtherPositive$1(t1, 30)) & 1073741823; + }, + toString$0(_) { + var _this = this, + y = A.DateTime__fourDigits(A.Primitives_getYear(_this)), + m = A.DateTime__twoDigits(A.Primitives_getMonth(_this)), + d = A.DateTime__twoDigits(A.Primitives_getDay(_this)), + h = A.DateTime__twoDigits(A.Primitives_getHours(_this)), + min = A.DateTime__twoDigits(A.Primitives_getMinutes(_this)), + sec = A.DateTime__twoDigits(A.Primitives_getSeconds(_this)), + ms = A.DateTime__threeDigits(A.Primitives_getMilliseconds(_this)); + return y + "-" + m + "-" + d + " " + h + ":" + min + ":" + sec + "." + ms; + }, + $isComparable: 1 + }; + A.Duration.prototype = { + $eq(_, other) { + if (other == null) + return false; + return other instanceof A.Duration && this._duration === other._duration; + }, + get$hashCode(_) { + return B.JSInt_methods.get$hashCode(this._duration); + }, + compareTo$1(_, other) { + return B.JSInt_methods.compareTo$1(this._duration, other._duration); + }, + toString$0(_) { + var sign, minutes, minutesPadding, seconds, secondsPadding, + microseconds = this._duration, + hours = B.JSInt_methods._tdivFast$1(microseconds, 3600000000), + microseconds0 = microseconds % 3600000000; + if (microseconds < 0) { + hours = 0 - hours; + microseconds = 0 - microseconds0; + sign = "-"; + } else { + microseconds = microseconds0; + sign = ""; + } + minutes = B.JSInt_methods._tdivFast$1(microseconds, 60000000); + microseconds %= 60000000; + minutesPadding = minutes < 10 ? "0" : ""; + seconds = B.JSInt_methods._tdivFast$1(microseconds, 1000000); + secondsPadding = seconds < 10 ? "0" : ""; + return sign + hours + ":" + minutesPadding + minutes + ":" + secondsPadding + seconds + "." + B.JSString_methods.padLeft$2(B.JSInt_methods.toString$0(microseconds % 1000000), 6, "0"); + }, + $isComparable: 1 + }; + A._Enum.prototype = { + toString$0(_) { + return this._enumToString$0(); + } + }; + A.Error.prototype = { + get$stackTrace() { + return A.getTraceFromException(this.$thrownJsError); + } + }; + A.AssertionError.prototype = { + toString$0(_) { + var t1 = this.message; + if (t1 != null) + return "Assertion failed: " + A.Error_safeToString(t1); + return "Assertion failed"; + }, + get$message(receiver) { + return this.message; + } + }; + A.TypeError.prototype = {}; + A.ArgumentError.prototype = { + get$_errorName() { + return "Invalid argument" + (!this._hasValue ? "(s)" : ""); + }, + get$_errorExplanation() { + return ""; + }, + toString$0(_) { + var _this = this, + $name = _this.name, + nameString = $name == null ? "" : " (" + $name + ")", + message = _this.message, + messageString = message == null ? "" : ": " + A.S(message), + prefix = _this.get$_errorName() + nameString + messageString; + if (!_this._hasValue) + return prefix; + return prefix + _this.get$_errorExplanation() + ": " + A.Error_safeToString(_this.get$invalidValue()); + }, + get$invalidValue() { + return this.invalidValue; + }, + get$message(receiver) { + return this.message; + } + }; + A.RangeError.prototype = { + get$invalidValue() { + return this.invalidValue; + }, + get$_errorName() { + return "RangeError"; + }, + get$_errorExplanation() { + var explanation, + start = this.start, + end = this.end; + if (start == null) + explanation = end != null ? ": Not less than or equal to " + A.S(end) : ""; + else if (end == null) + explanation = ": Not greater than or equal to " + A.S(start); + else if (end > start) + explanation = ": Not in inclusive range " + A.S(start) + ".." + A.S(end); + else + explanation = end < start ? ": Valid value range is empty" : ": Only valid value is " + A.S(start); + return explanation; + } + }; + A.IndexError.prototype = { + get$invalidValue() { + return this.invalidValue; + }, + get$_errorName() { + return "RangeError"; + }, + get$_errorExplanation() { + if (this.invalidValue < 0) + return ": index must not be negative"; + var t1 = this.length; + if (t1 === 0) + return ": no indices are valid"; + return ": index should be less than " + t1; + }, + $isRangeError: 1, + get$length(receiver) { + return this.length; + } + }; + A.NoSuchMethodError.prototype = { + toString$0(_) { + var $arguments, t1, _i, t2, t3, argument, receiverText, actualParameters, _this = this, _box_0 = {}, + sb = new A.StringBuffer(""); + _box_0.comma = ""; + $arguments = _this._core$_arguments; + for (t1 = $arguments.length, _i = 0, t2 = "", t3 = ""; _i < t1; ++_i, t3 = ", ") { + argument = $arguments[_i]; + sb._contents = t2 + t3; + t2 = sb._contents += A.Error_safeToString(argument); + _box_0.comma = ", "; + } + _this._namedArguments.forEach$1(0, new A.NoSuchMethodError_toString_closure(_box_0, sb)); + receiverText = A.Error_safeToString(_this._core$_receiver); + actualParameters = sb.toString$0(0); + return "NoSuchMethodError: method not found: '" + _this._memberName.__internal$_name + "'\nReceiver: " + receiverText + "\nArguments: [" + actualParameters + "]"; + } + }; + A.UnsupportedError.prototype = { + toString$0(_) { + return "Unsupported operation: " + this.message; + }, + get$message(receiver) { + return this.message; + } + }; + A.UnimplementedError.prototype = { + toString$0(_) { + return "UnimplementedError: " + this.message; + }, + get$message(receiver) { + return this.message; + } + }; + A.StateError.prototype = { + toString$0(_) { + return "Bad state: " + this.message; + }, + get$message(receiver) { + return this.message; + } + }; + A.ConcurrentModificationError.prototype = { + toString$0(_) { + var t1 = this.modifiedObject; + if (t1 == null) + return "Concurrent modification during iteration."; + return "Concurrent modification during iteration: " + A.Error_safeToString(t1) + "."; + } + }; + A.OutOfMemoryError.prototype = { + toString$0(_) { + return "Out of Memory"; + }, + get$stackTrace() { + return null; + }, + $isError: 1 + }; + A.StackOverflowError.prototype = { + toString$0(_) { + return "Stack Overflow"; + }, + get$stackTrace() { + return null; + }, + $isError: 1 + }; + A._Exception.prototype = { + toString$0(_) { + return "Exception: " + this.message; + }, + $isException: 1, + get$message(receiver) { + return this.message; + } + }; + A.FormatException.prototype = { + toString$0(_) { + var t1, lineNum, lineStart, previousCharWasCR, i, char, lineEnd, end, start, prefix, postfix, + message = this.message, + report = "" !== message ? "FormatException: " + message : "FormatException", + offset = this.offset, + source = this.source; + if (typeof source == "string") { + if (offset != null) + t1 = offset < 0 || offset > source.length; + else + t1 = false; + if (t1) + offset = null; + if (offset == null) { + if (source.length > 78) + source = B.JSString_methods.substring$2(source, 0, 75) + "..."; + return report + "\n" + source; + } + for (lineNum = 1, lineStart = 0, previousCharWasCR = false, i = 0; i < offset; ++i) { + char = source.charCodeAt(i); + if (char === 10) { + if (lineStart !== i || !previousCharWasCR) + ++lineNum; + lineStart = i + 1; + previousCharWasCR = false; + } else if (char === 13) { + ++lineNum; + lineStart = i + 1; + previousCharWasCR = true; + } + } + report = lineNum > 1 ? report + (" (at line " + lineNum + ", character " + (offset - lineStart + 1) + ")\n") : report + (" (at character " + (offset + 1) + ")\n"); + lineEnd = source.length; + for (i = offset; i < lineEnd; ++i) { + char = source.charCodeAt(i); + if (char === 10 || char === 13) { + lineEnd = i; + break; + } + } + if (lineEnd - lineStart > 78) + if (offset - lineStart < 75) { + end = lineStart + 75; + start = lineStart; + prefix = ""; + postfix = "..."; + } else { + if (lineEnd - offset < 75) { + start = lineEnd - 75; + end = lineEnd; + postfix = ""; + } else { + start = offset - 36; + end = offset + 36; + postfix = "..."; + } + prefix = "..."; + } + else { + end = lineEnd; + start = lineStart; + prefix = ""; + postfix = ""; + } + return report + prefix + B.JSString_methods.substring$2(source, start, end) + postfix + "\n" + B.JSString_methods.$mul(" ", offset - start + prefix.length) + "^\n"; + } else + return offset != null ? report + (" (at offset " + A.S(offset) + ")") : report; + }, + $isException: 1, + get$message(receiver) { + return this.message; + } + }; + A.Iterable.prototype = { + cast$1$0(_, $R) { + return A.CastIterable_CastIterable(this, A._instanceType(this)._eval$1("Iterable.E"), $R); + }, + followedBy$1(_, other) { + var _this = this, + t1 = A._instanceType(_this); + if (t1._eval$1("EfficientLengthIterable")._is(_this)) + return A.FollowedByIterable_FollowedByIterable$firstEfficient(_this, other, t1._eval$1("Iterable.E")); + return new A.FollowedByIterable(_this, other, t1._eval$1("FollowedByIterable")); + }, + map$1$1(_, toElement, $T) { + return A.MappedIterable_MappedIterable(this, toElement, A._instanceType(this)._eval$1("Iterable.E"), $T); + }, + where$1(_, test) { + return new A.WhereIterable(this, test, A._instanceType(this)._eval$1("WhereIterable")); + }, + expand$1$1(_, toElements, $T) { + return new A.ExpandIterable(this, toElements, A._instanceType(this)._eval$1("@")._bind$1($T)._eval$1("ExpandIterable<1,2>")); + }, + contains$1(_, element) { + var t1; + for (t1 = this.get$iterator(this); t1.moveNext$0();) + if (J.$eq$(t1.get$current(t1), element)) + return true; + return false; + }, + forEach$1(_, action) { + var t1; + for (t1 = this.get$iterator(this); t1.moveNext$0();) + action.call$1(t1.get$current(t1)); + }, + fold$1$2(_, initialValue, combine) { + var t1, value; + for (t1 = this.get$iterator(this), value = initialValue; t1.moveNext$0();) + value = combine.call$2(value, t1.get$current(t1)); + return value; + }, + fold$2(_, initialValue, combine) { + return this.fold$1$2(0, initialValue, combine, type$.dynamic); + }, + every$1(_, test) { + var t1; + for (t1 = this.get$iterator(this); t1.moveNext$0();) + if (!test.call$1(t1.get$current(t1))) + return false; + return true; + }, + join$1(_, separator) { + var first, t1, + iterator = this.get$iterator(this); + if (!iterator.moveNext$0()) + return ""; + first = J.toString$0$(iterator.get$current(iterator)); + if (!iterator.moveNext$0()) + return first; + if (separator.length === 0) { + t1 = first; + do + t1 += A.S(J.toString$0$(iterator.get$current(iterator))); + while (iterator.moveNext$0()); + } else { + t1 = first; + do + t1 = t1 + separator + A.S(J.toString$0$(iterator.get$current(iterator))); + while (iterator.moveNext$0()); + } + return t1.charCodeAt(0) == 0 ? t1 : t1; + }, + any$1(_, test) { + var t1; + for (t1 = this.get$iterator(this); t1.moveNext$0();) + if (test.call$1(t1.get$current(t1))) + return true; + return false; + }, + toList$1$growable(_, growable) { + return A.List_List$of(this, growable, A._instanceType(this)._eval$1("Iterable.E")); + }, + toList$0(_) { + return this.toList$1$growable(0, true); + }, + toSet$0(_) { + return A.LinkedHashSet_LinkedHashSet$of(this, A._instanceType(this)._eval$1("Iterable.E")); + }, + get$length(_) { + var count, + it = this.get$iterator(this); + for (count = 0; it.moveNext$0();) + ++count; + return count; + }, + get$isEmpty(_) { + return !this.get$iterator(this).moveNext$0(); + }, + get$isNotEmpty(_) { + return !this.get$isEmpty(this); + }, + take$1(_, count) { + return A.TakeIterable_TakeIterable(this, count, A._instanceType(this)._eval$1("Iterable.E")); + }, + skip$1(_, count) { + return A.SkipIterable_SkipIterable(this, count, A._instanceType(this)._eval$1("Iterable.E")); + }, + skipWhile$1(_, test) { + return new A.SkipWhileIterable(this, test, A._instanceType(this)._eval$1("SkipWhileIterable")); + }, + get$first(_) { + var it = this.get$iterator(this); + if (!it.moveNext$0()) + throw A.wrapException(A.IterableElementError_noElement()); + return it.get$current(it); + }, + get$last(_) { + var result, + it = this.get$iterator(this); + if (!it.moveNext$0()) + throw A.wrapException(A.IterableElementError_noElement()); + do + result = it.get$current(it); + while (it.moveNext$0()); + return result; + }, + get$single(_) { + var result, + it = this.get$iterator(this); + if (!it.moveNext$0()) + throw A.wrapException(A.IterableElementError_noElement()); + result = it.get$current(it); + if (it.moveNext$0()) + throw A.wrapException(A.IterableElementError_tooMany()); + return result; + }, + elementAt$1(_, index) { + var iterator, skipCount; + A.RangeError_checkNotNegative(index, "index"); + iterator = this.get$iterator(this); + for (skipCount = index; iterator.moveNext$0();) { + if (skipCount === 0) + return iterator.get$current(iterator); + --skipCount; + } + throw A.wrapException(A.IndexError$withLength(index, index - skipCount, this, null, "index")); + }, + toString$0(_) { + return A.Iterable_iterableToShortString(this, "(", ")"); + } + }; + A._GeneratorIterable.prototype = { + elementAt$1(_, index) { + A.IndexError_check(index, this.length, this, null, null); + return this._generator.call$1(index); + }, + get$length(receiver) { + return this.length; + } + }; + A.MapEntry.prototype = { + toString$0(_) { + return "MapEntry(" + A.S(this.key) + ": " + A.S(this.value) + ")"; + } + }; + A.Null.prototype = { + get$hashCode(_) { + return A.Object.prototype.get$hashCode.call(this, 0); + }, + toString$0(_) { + return "null"; + } + }; + A.Object.prototype = {$isObject: 1, + $eq(_, other) { + return this === other; + }, + get$hashCode(_) { + return A.Primitives_objectHashCode(this); + }, + toString$0(_) { + return "Instance of '" + A.Primitives_objectTypeName(this) + "'"; + }, + noSuchMethod$1(_, invocation) { + throw A.wrapException(A.NoSuchMethodError_NoSuchMethodError$withInvocation(this, invocation)); + }, + get$runtimeType(_) { + return A.getRuntimeTypeOfDartObject(this); + }, + toString() { + return this.toString$0(this); + } + }; + A._StringStackTrace.prototype = { + toString$0(_) { + return this._stackTrace; + }, + $isStackTrace: 1 + }; + A.Runes.prototype = { + get$iterator(_) { + return new A.RuneIterator(this.string); + }, + get$last(_) { + var code, previousCode, + t1 = this.string, + t2 = t1.length; + if (t2 === 0) + throw A.wrapException(A.StateError$("No elements.")); + code = t1.charCodeAt(t2 - 1); + if ((code & 64512) === 56320 && t2 > 1) { + previousCode = t1.charCodeAt(t2 - 2); + if ((previousCode & 64512) === 55296) + return A._combineSurrogatePair(previousCode, code); + } + return code; + } + }; + A.RuneIterator.prototype = { + get$current(_) { + return this._currentCodePoint; + }, + moveNext$0() { + var codeUnit, nextPosition, nextCodeUnit, _this = this, + t1 = _this._position = _this._nextPosition, + t2 = _this.string, + t3 = t2.length; + if (t1 === t3) { + _this._currentCodePoint = -1; + return false; + } + codeUnit = t2.charCodeAt(t1); + nextPosition = t1 + 1; + if ((codeUnit & 64512) === 55296 && nextPosition < t3) { + nextCodeUnit = t2.charCodeAt(nextPosition); + if ((nextCodeUnit & 64512) === 56320) { + _this._nextPosition = nextPosition + 1; + _this._currentCodePoint = A._combineSurrogatePair(codeUnit, nextCodeUnit); + return true; + } + } + _this._nextPosition = nextPosition; + _this._currentCodePoint = codeUnit; + return true; + } + }; + A.StringBuffer.prototype = { + get$length(_) { + return this._contents.length; + }, + write$1(_, obj) { + this._contents += A.S(obj); + }, + writeCharCode$1(charCode) { + this._contents += A.Primitives_stringFromCharCode(charCode); + }, + toString$0(_) { + var t1 = this._contents; + return t1.charCodeAt(0) == 0 ? t1 : t1; + } + }; + A.Uri__parseIPv4Address_error.prototype = { + call$2(msg, position) { + throw A.wrapException(A.FormatException$("Illegal IPv4 address, " + msg, this.host, position)); + }, + $signature: 563 + }; + A.Uri_parseIPv6Address_error.prototype = { + call$2(msg, position) { + throw A.wrapException(A.FormatException$("Illegal IPv6 address, " + msg, this.host, position)); + }, + $signature: 556 + }; + A.Uri_parseIPv6Address_parseHex.prototype = { + call$2(start, end) { + var value; + if (end - start > 4) + this.error.call$2("an IPv6 part can only contain a maximum of 4 hex digits", start); + value = A.int_parse(B.JSString_methods.substring$2(this.host, start, end), 16); + if (value < 0 || value > 65535) + this.error.call$2("each part must be in the range of `0x0..0xFFFF`", start); + return value; + }, + $signature: 554 + }; + A._Uri.prototype = { + get$_text() { + var t1, t2, t3, t4, _this = this, + value = _this.___Uri__text_FI; + if (value === $) { + t1 = _this.scheme; + t2 = t1.length !== 0 ? "" + t1 + ":" : ""; + t3 = _this._host; + t4 = t3 == null; + if (!t4 || t1 === "file") { + t1 = t2 + "//"; + t2 = _this._userInfo; + if (t2.length !== 0) + t1 = t1 + t2 + "@"; + if (!t4) + t1 += t3; + t2 = _this._port; + if (t2 != null) + t1 = t1 + ":" + A.S(t2); + } else + t1 = t2; + t1 += _this.path; + t2 = _this._query; + if (t2 != null) + t1 = t1 + "?" + t2; + t2 = _this._fragment; + if (t2 != null) + t1 = t1 + "#" + t2; + value !== $ && A.throwUnnamedLateFieldADI(); + value = _this.___Uri__text_FI = t1.charCodeAt(0) == 0 ? t1 : t1; + } + return value; + }, + get$pathSegments() { + var pathToSplit, result, _this = this, + value = _this.___Uri_pathSegments_FI; + if (value === $) { + pathToSplit = _this.path; + if (pathToSplit.length !== 0 && pathToSplit.charCodeAt(0) === 47) + pathToSplit = B.JSString_methods.substring$1(pathToSplit, 1); + result = pathToSplit.length === 0 ? B.List_empty : A.List_List$unmodifiable(new A.MappedListIterable(A._setArrayType(pathToSplit.split("/"), type$.JSArray_String), A.core_Uri_decodeComponent$closure(), type$.MappedListIterable_String_dynamic), type$.String); + _this.___Uri_pathSegments_FI !== $ && A.throwUnnamedLateFieldADI(); + value = _this.___Uri_pathSegments_FI = result; + } + return value; + }, + get$hashCode(_) { + var result, _this = this, + value = _this.___Uri_hashCode_FI; + if (value === $) { + result = B.JSString_methods.get$hashCode(_this.get$_text()); + _this.___Uri_hashCode_FI !== $ && A.throwUnnamedLateFieldADI(); + _this.___Uri_hashCode_FI = result; + value = result; + } + return value; + }, + get$userInfo() { + return this._userInfo; + }, + get$host() { + var host = this._host; + if (host == null) + return ""; + if (B.JSString_methods.startsWith$1(host, "[")) + return B.JSString_methods.substring$2(host, 1, host.length - 1); + return host; + }, + get$port(_) { + var t1 = this._port; + return t1 == null ? A._Uri__defaultPort(this.scheme) : t1; + }, + get$query() { + var t1 = this._query; + return t1 == null ? "" : t1; + }, + get$fragment() { + var t1 = this._fragment; + return t1 == null ? "" : t1; + }, + isScheme$1(scheme) { + var thisScheme = this.scheme; + if (scheme.length !== thisScheme.length) + return false; + return A._caseInsensitiveCompareStart(scheme, thisScheme, 0) >= 0; + }, + _mergePaths$2(base, reference) { + var backCount, refStart, baseEnd, newEnd, delta, t1; + for (backCount = 0, refStart = 0; B.JSString_methods.startsWith$2(reference, "../", refStart);) { + refStart += 3; + ++backCount; + } + baseEnd = B.JSString_methods.lastIndexOf$1(base, "/"); + while (true) { + if (!(baseEnd > 0 && backCount > 0)) + break; + newEnd = B.JSString_methods.lastIndexOf$2(base, "/", baseEnd - 1); + if (newEnd < 0) + break; + delta = baseEnd - newEnd; + t1 = delta !== 2; + if (!t1 || delta === 3) + if (base.charCodeAt(newEnd + 1) === 46) + t1 = !t1 || base.charCodeAt(newEnd + 2) === 46; + else + t1 = false; + else + t1 = false; + if (t1) + break; + --backCount; + baseEnd = newEnd; + } + return B.JSString_methods.replaceRange$3(base, baseEnd + 1, null, B.JSString_methods.substring$1(reference, refStart - 3 * backCount)); + }, + resolve$1(_, reference) { + return this.resolveUri$1(A.Uri_parse(reference)); + }, + resolveUri$1(reference) { + var targetScheme, targetUserInfo, targetHost, targetPort, targetPath, targetQuery, packageNameEnd, packageName, mergedPath, t1, _this = this, _null = null; + if (reference.get$scheme().length !== 0) { + targetScheme = reference.get$scheme(); + if (reference.get$hasAuthority()) { + targetUserInfo = reference.get$userInfo(); + targetHost = reference.get$host(); + targetPort = reference.get$hasPort() ? reference.get$port(reference) : _null; + } else { + targetPort = _null; + targetHost = targetPort; + targetUserInfo = ""; + } + targetPath = A._Uri__removeDotSegments(reference.get$path(reference)); + targetQuery = reference.get$hasQuery() ? reference.get$query() : _null; + } else { + targetScheme = _this.scheme; + if (reference.get$hasAuthority()) { + targetUserInfo = reference.get$userInfo(); + targetHost = reference.get$host(); + targetPort = A._Uri__makePort(reference.get$hasPort() ? reference.get$port(reference) : _null, targetScheme); + targetPath = A._Uri__removeDotSegments(reference.get$path(reference)); + targetQuery = reference.get$hasQuery() ? reference.get$query() : _null; + } else { + targetUserInfo = _this._userInfo; + targetHost = _this._host; + targetPort = _this._port; + targetPath = _this.path; + if (reference.get$path(reference) === "") + targetQuery = reference.get$hasQuery() ? reference.get$query() : _this._query; + else { + packageNameEnd = A._Uri__packageNameEnd(_this, targetPath); + if (packageNameEnd > 0) { + packageName = B.JSString_methods.substring$2(targetPath, 0, packageNameEnd); + targetPath = reference.get$hasAbsolutePath() ? packageName + A._Uri__removeDotSegments(reference.get$path(reference)) : packageName + A._Uri__removeDotSegments(_this._mergePaths$2(B.JSString_methods.substring$1(targetPath, packageName.length), reference.get$path(reference))); + } else if (reference.get$hasAbsolutePath()) + targetPath = A._Uri__removeDotSegments(reference.get$path(reference)); + else if (targetPath.length === 0) + if (targetHost == null) + targetPath = targetScheme.length === 0 ? reference.get$path(reference) : A._Uri__removeDotSegments(reference.get$path(reference)); + else + targetPath = A._Uri__removeDotSegments("/" + reference.get$path(reference)); + else { + mergedPath = _this._mergePaths$2(targetPath, reference.get$path(reference)); + t1 = targetScheme.length === 0; + if (!t1 || targetHost != null || B.JSString_methods.startsWith$1(targetPath, "/")) + targetPath = A._Uri__removeDotSegments(mergedPath); + else + targetPath = A._Uri__normalizeRelativePath(mergedPath, !t1 || targetHost != null); + } + targetQuery = reference.get$hasQuery() ? reference.get$query() : _null; + } + } + } + return A._Uri$_internal(targetScheme, targetUserInfo, targetHost, targetPort, targetPath, targetQuery, reference.get$hasFragment() ? reference.get$fragment() : _null); + }, + get$hasAuthority() { + return this._host != null; + }, + get$hasPort() { + return this._port != null; + }, + get$hasQuery() { + return this._query != null; + }, + get$hasFragment() { + return this._fragment != null; + }, + get$hasAbsolutePath() { + return B.JSString_methods.startsWith$1(this.path, "/"); + }, + toFilePath$0() { + var pathSegments, _this = this, + t1 = _this.scheme; + if (t1 !== "" && t1 !== "file") + throw A.wrapException(A.UnsupportedError$("Cannot extract a file path from a " + t1 + " URI")); + t1 = _this._query; + if ((t1 == null ? "" : t1) !== "") + throw A.wrapException(A.UnsupportedError$(string$.Cannotfq)); + t1 = _this._fragment; + if ((t1 == null ? "" : t1) !== "") + throw A.wrapException(A.UnsupportedError$(string$.Cannotff)); + t1 = $.$get$_Uri__isWindowsCached(); + if (t1) + t1 = A._Uri__toWindowsFilePath(_this); + else { + if (_this._host != null && _this.get$host() !== "") + A.throwExpression(A.UnsupportedError$(string$.Cannotn)); + pathSegments = _this.get$pathSegments(); + A._Uri__checkNonWindowsPathReservedCharacters(pathSegments, false); + t1 = A.StringBuffer__writeAll(B.JSString_methods.startsWith$1(_this.path, "/") ? "" + "/" : "", pathSegments, "/"); + t1 = t1.charCodeAt(0) == 0 ? t1 : t1; + } + return t1; + }, + toString$0(_) { + return this.get$_text(); + }, + $eq(_, other) { + var t1, t2, _this = this; + if (other == null) + return false; + if (_this === other) + return true; + if (type$.Uri._is(other)) + if (_this.scheme === other.get$scheme()) + if (_this._host != null === other.get$hasAuthority()) + if (_this._userInfo === other.get$userInfo()) + if (_this.get$host() === other.get$host()) + if (_this.get$port(0) === other.get$port(other)) + if (_this.path === other.get$path(other)) { + t1 = _this._query; + t2 = t1 == null; + if (!t2 === other.get$hasQuery()) { + if (t2) + t1 = ""; + if (t1 === other.get$query()) { + t1 = _this._fragment; + t2 = t1 == null; + if (!t2 === other.get$hasFragment()) { + if (t2) + t1 = ""; + t1 = t1 === other.get$fragment(); + } else + t1 = false; + } else + t1 = false; + } else + t1 = false; + } else + t1 = false; + else + t1 = false; + else + t1 = false; + else + t1 = false; + else + t1 = false; + else + t1 = false; + else + t1 = false; + return t1; + }, + $isUri: 1, + get$scheme() { + return this.scheme; + }, + get$path(receiver) { + return this.path; + } + }; + A._Uri__makePath_closure.prototype = { + call$1(s) { + return A._Uri__uriEncode(B.List_XRg0, s, B.C_Utf8Codec, false); + }, + $signature: 5 + }; + A.UriData.prototype = { + get$uri() { + var t2, queryIndex, end, query, _this = this, _null = null, + t1 = _this._uriCache; + if (t1 == null) { + t1 = _this._text; + t2 = _this._separatorIndices[0] + 1; + queryIndex = B.JSString_methods.indexOf$2(t1, "?", t2); + end = t1.length; + if (queryIndex >= 0) { + query = A._Uri__normalizeOrSubstring(t1, queryIndex + 1, end, B.List_oFp, false, false); + end = queryIndex; + } else + query = _null; + t1 = _this._uriCache = new A._DataUri("data", "", _null, _null, A._Uri__normalizeOrSubstring(t1, t2, end, B.List_XRg, false, false), query, _null); + } + return t1; + }, + toString$0(_) { + var t1 = this._text; + return this._separatorIndices[0] === -1 ? "data:" + t1 : t1; + } + }; + A._createTables_build.prototype = { + call$2(state, defaultTransition) { + var t1 = this.tables[state]; + B.NativeUint8List_methods.fillRange$3(t1, 0, 96, defaultTransition); + return t1; + }, + $signature: 547 + }; + A._createTables_setChars.prototype = { + call$3(target, chars, transition) { + var t1, i; + for (t1 = chars.length, i = 0; i < t1; ++i) + target[chars.charCodeAt(i) ^ 96] = transition; + }, + $signature: 243 + }; + A._createTables_setRange.prototype = { + call$3(target, range, transition) { + var i, n; + for (i = range.charCodeAt(0), n = range.charCodeAt(1); i <= n; ++i) + target[(i ^ 96) >>> 0] = transition; + }, + $signature: 243 + }; + A._SimpleUri.prototype = { + get$hasAuthority() { + return this._hostStart > 0; + }, + get$hasPort() { + return this._hostStart > 0 && this._portStart + 1 < this._pathStart; + }, + get$hasQuery() { + return this._queryStart < this._fragmentStart; + }, + get$hasFragment() { + return this._fragmentStart < this._uri.length; + }, + get$hasAbsolutePath() { + return B.JSString_methods.startsWith$2(this._uri, "/", this._pathStart); + }, + get$scheme() { + var t1 = this._schemeCache; + return t1 == null ? this._schemeCache = this._computeScheme$0() : t1; + }, + _computeScheme$0() { + var t2, _this = this, + t1 = _this._schemeEnd; + if (t1 <= 0) + return ""; + t2 = t1 === 4; + if (t2 && B.JSString_methods.startsWith$1(_this._uri, "http")) + return "http"; + if (t1 === 5 && B.JSString_methods.startsWith$1(_this._uri, "https")) + return "https"; + if (t2 && B.JSString_methods.startsWith$1(_this._uri, "file")) + return "file"; + if (t1 === 7 && B.JSString_methods.startsWith$1(_this._uri, "package")) + return "package"; + return B.JSString_methods.substring$2(_this._uri, 0, t1); + }, + get$userInfo() { + var t1 = this._hostStart, + t2 = this._schemeEnd + 3; + return t1 > t2 ? B.JSString_methods.substring$2(this._uri, t2, t1 - 1) : ""; + }, + get$host() { + var t1 = this._hostStart; + return t1 > 0 ? B.JSString_methods.substring$2(this._uri, t1, this._portStart) : ""; + }, + get$port(_) { + var t1, _this = this; + if (_this.get$hasPort()) + return A.int_parse(B.JSString_methods.substring$2(_this._uri, _this._portStart + 1, _this._pathStart), null); + t1 = _this._schemeEnd; + if (t1 === 4 && B.JSString_methods.startsWith$1(_this._uri, "http")) + return 80; + if (t1 === 5 && B.JSString_methods.startsWith$1(_this._uri, "https")) + return 443; + return 0; + }, + get$path(_) { + return B.JSString_methods.substring$2(this._uri, this._pathStart, this._queryStart); + }, + get$query() { + var t1 = this._queryStart, + t2 = this._fragmentStart; + return t1 < t2 ? B.JSString_methods.substring$2(this._uri, t1 + 1, t2) : ""; + }, + get$fragment() { + var t1 = this._fragmentStart, + t2 = this._uri; + return t1 < t2.length ? B.JSString_methods.substring$1(t2, t1 + 1) : ""; + }, + get$pathSegments() { + var parts, i, + start = this._pathStart, + end = this._queryStart, + t1 = this._uri; + if (B.JSString_methods.startsWith$2(t1, "/", start)) + ++start; + if (start === end) + return B.List_empty; + parts = A._setArrayType([], type$.JSArray_String); + for (i = start; i < end; ++i) + if (t1.charCodeAt(i) === 47) { + parts.push(B.JSString_methods.substring$2(t1, start, i)); + start = i + 1; + } + parts.push(B.JSString_methods.substring$2(t1, start, end)); + return A.List_List$unmodifiable(parts, type$.String); + }, + _isPort$1(port) { + var portDigitStart = this._portStart + 1; + return portDigitStart + port.length === this._pathStart && B.JSString_methods.startsWith$2(this._uri, port, portDigitStart); + }, + removeFragment$0() { + var _this = this, + t1 = _this._fragmentStart, + t2 = _this._uri; + if (t1 >= t2.length) + return _this; + return new A._SimpleUri(B.JSString_methods.substring$2(t2, 0, t1), _this._schemeEnd, _this._hostStart, _this._portStart, _this._pathStart, _this._queryStart, t1, _this._schemeCache); + }, + resolve$1(_, reference) { + return this.resolveUri$1(A.Uri_parse(reference)); + }, + resolveUri$1(reference) { + if (reference instanceof A._SimpleUri) + return this._simpleMerge$2(this, reference); + return this._toNonSimple$0().resolveUri$1(reference); + }, + _simpleMerge$2(base, ref) { + var t2, t3, t4, isSimple, delta, refStart, basePathStart, packageNameEnd, basePathStart0, baseStart, baseEnd, baseUri, baseStart0, backCount, refStart0, insert, + t1 = ref._schemeEnd; + if (t1 > 0) + return ref; + t2 = ref._hostStart; + if (t2 > 0) { + t3 = base._schemeEnd; + if (t3 <= 0) + return ref; + t4 = t3 === 4; + if (t4 && B.JSString_methods.startsWith$1(base._uri, "file")) + isSimple = ref._pathStart !== ref._queryStart; + else if (t4 && B.JSString_methods.startsWith$1(base._uri, "http")) + isSimple = !ref._isPort$1("80"); + else + isSimple = !(t3 === 5 && B.JSString_methods.startsWith$1(base._uri, "https")) || !ref._isPort$1("443"); + if (isSimple) { + delta = t3 + 1; + return new A._SimpleUri(B.JSString_methods.substring$2(base._uri, 0, delta) + B.JSString_methods.substring$1(ref._uri, t1 + 1), t3, t2 + delta, ref._portStart + delta, ref._pathStart + delta, ref._queryStart + delta, ref._fragmentStart + delta, base._schemeCache); + } else + return this._toNonSimple$0().resolveUri$1(ref); + } + refStart = ref._pathStart; + t1 = ref._queryStart; + if (refStart === t1) { + t2 = ref._fragmentStart; + if (t1 < t2) { + t3 = base._queryStart; + delta = t3 - t1; + return new A._SimpleUri(B.JSString_methods.substring$2(base._uri, 0, t3) + B.JSString_methods.substring$1(ref._uri, t1), base._schemeEnd, base._hostStart, base._portStart, base._pathStart, t1 + delta, t2 + delta, base._schemeCache); + } + t1 = ref._uri; + if (t2 < t1.length) { + t3 = base._fragmentStart; + return new A._SimpleUri(B.JSString_methods.substring$2(base._uri, 0, t3) + B.JSString_methods.substring$1(t1, t2), base._schemeEnd, base._hostStart, base._portStart, base._pathStart, base._queryStart, t2 + (t3 - t2), base._schemeCache); + } + return base.removeFragment$0(); + } + t2 = ref._uri; + if (B.JSString_methods.startsWith$2(t2, "/", refStart)) { + basePathStart = base._pathStart; + packageNameEnd = A._SimpleUri__packageNameEnd(this); + basePathStart0 = packageNameEnd > 0 ? packageNameEnd : basePathStart; + delta = basePathStart0 - refStart; + return new A._SimpleUri(B.JSString_methods.substring$2(base._uri, 0, basePathStart0) + B.JSString_methods.substring$1(t2, refStart), base._schemeEnd, base._hostStart, base._portStart, basePathStart, t1 + delta, ref._fragmentStart + delta, base._schemeCache); + } + baseStart = base._pathStart; + baseEnd = base._queryStart; + if (baseStart === baseEnd && base._hostStart > 0) { + for (; B.JSString_methods.startsWith$2(t2, "../", refStart);) + refStart += 3; + delta = baseStart - refStart + 1; + return new A._SimpleUri(B.JSString_methods.substring$2(base._uri, 0, baseStart) + "/" + B.JSString_methods.substring$1(t2, refStart), base._schemeEnd, base._hostStart, base._portStart, baseStart, t1 + delta, ref._fragmentStart + delta, base._schemeCache); + } + baseUri = base._uri; + packageNameEnd = A._SimpleUri__packageNameEnd(this); + if (packageNameEnd >= 0) + baseStart0 = packageNameEnd; + else + for (baseStart0 = baseStart; B.JSString_methods.startsWith$2(baseUri, "../", baseStart0);) + baseStart0 += 3; + backCount = 0; + while (true) { + refStart0 = refStart + 3; + if (!(refStart0 <= t1 && B.JSString_methods.startsWith$2(t2, "../", refStart))) + break; + ++backCount; + refStart = refStart0; + } + for (insert = ""; baseEnd > baseStart0;) { + --baseEnd; + if (baseUri.charCodeAt(baseEnd) === 47) { + if (backCount === 0) { + insert = "/"; + break; + } + --backCount; + insert = "/"; + } + } + if (baseEnd === baseStart0 && base._schemeEnd <= 0 && !B.JSString_methods.startsWith$2(baseUri, "/", baseStart)) { + refStart -= backCount * 3; + insert = ""; + } + delta = baseEnd - refStart + insert.length; + return new A._SimpleUri(B.JSString_methods.substring$2(baseUri, 0, baseEnd) + insert + B.JSString_methods.substring$1(t2, refStart), base._schemeEnd, base._hostStart, base._portStart, baseStart, t1 + delta, ref._fragmentStart + delta, base._schemeCache); + }, + toFilePath$0() { + var t2, t3, _this = this, + t1 = _this._schemeEnd; + if (t1 >= 0) { + t2 = !(t1 === 4 && B.JSString_methods.startsWith$1(_this._uri, "file")); + t1 = t2; + } else + t1 = false; + if (t1) + throw A.wrapException(A.UnsupportedError$("Cannot extract a file path from a " + _this.get$scheme() + " URI")); + t1 = _this._queryStart; + t2 = _this._uri; + if (t1 < t2.length) { + if (t1 < _this._fragmentStart) + throw A.wrapException(A.UnsupportedError$(string$.Cannotfq)); + throw A.wrapException(A.UnsupportedError$(string$.Cannotff)); + } + t3 = $.$get$_Uri__isWindowsCached(); + if (t3) + t1 = A._Uri__toWindowsFilePath(_this); + else { + if (_this._hostStart < _this._portStart) + A.throwExpression(A.UnsupportedError$(string$.Cannotn)); + t1 = B.JSString_methods.substring$2(t2, _this._pathStart, t1); + } + return t1; + }, + get$hashCode(_) { + var t1 = this._hashCodeCache; + return t1 == null ? this._hashCodeCache = B.JSString_methods.get$hashCode(this._uri) : t1; + }, + $eq(_, other) { + if (other == null) + return false; + if (this === other) + return true; + return type$.Uri._is(other) && this._uri === other.toString$0(0); + }, + _toNonSimple$0() { + var _this = this, _null = null, + t1 = _this.get$scheme(), + t2 = _this.get$userInfo(), + t3 = _this._hostStart > 0 ? _this.get$host() : _null, + t4 = _this.get$hasPort() ? _this.get$port(0) : _null, + t5 = _this._uri, + t6 = _this._queryStart, + t7 = B.JSString_methods.substring$2(t5, _this._pathStart, t6), + t8 = _this._fragmentStart; + t6 = t6 < t8 ? _this.get$query() : _null; + return A._Uri$_internal(t1, t2, t3, t4, t7, t6, t8 < t5.length ? _this.get$fragment() : _null); + }, + toString$0(_) { + return this._uri; + }, + $isUri: 1 + }; + A._DataUri.prototype = {}; + A.Expando.prototype = { + $indexSet(_, object, value) { + if (object instanceof A._Record) + A.Expando__badExpandoKey(object); + this._jsWeakMap.set(object, value); + }, + toString$0(_) { + return "Expando:null"; + } + }; + A.jsify__convert.prototype = { + call$1(o) { + var t1, convertedMap, key, convertedList; + if (A._noJsifyRequired(o)) + return o; + t1 = this._convertedObjects; + if (t1.containsKey$1(o)) + return t1.$index(0, o); + if (type$.Map_of_nullable_Object_and_nullable_Object._is(o)) { + convertedMap = {}; + t1.$indexSet(0, o, convertedMap); + for (t1 = J.get$iterator$ax(o.get$keys(o)); t1.moveNext$0();) { + key = t1.get$current(t1); + convertedMap[key] = this.call$1(o.$index(0, key)); + } + return convertedMap; + } else if (type$.Iterable_nullable_Object._is(o)) { + convertedList = []; + t1.$indexSet(0, o, convertedList); + B.JSArray_methods.addAll$1(convertedList, J.map$1$1$ax(o, this, type$.dynamic)); + return convertedList; + } else + return o; + }, + $signature: 535 + }; + A.promiseToFuture_closure1.prototype = { + call$1(r) { + return this.completer.complete$1(r); + }, + $signature: 76 + }; + A.promiseToFuture_closure2.prototype = { + call$1(e) { + if (e == null) + return this.completer.completeError$1(new A.NullRejectionException(e === undefined)); + return this.completer.completeError$1(e); + }, + $signature: 76 + }; + A.NullRejectionException.prototype = { + toString$0(_) { + return "Promise was rejected with a value of `" + (this.isUndefined ? "undefined" : "null") + "`."; + }, + $isException: 1 + }; + A._JSRandom.prototype = { + nextInt$1(max) { + if (max <= 0 || max > 4294967296) + throw A.wrapException(A.RangeError$("max must be in range 0 < max \u2264 2^32, was " + max)); + return Math.random() * max >>> 0; + }, + nextDouble$0() { + return Math.random(); + } + }; + A.ArgParser.prototype = { + addFlag$6$abbr$defaultsTo$help$hide$negatable($name, abbr, defaultsTo, help, hide, negatable) { + var _null = null; + this._addOption$12$aliases$hide$negatable($name, abbr, help, _null, _null, _null, defaultsTo, _null, B.OptionType_nMZ, B.List_empty, hide, negatable); + }, + addFlag$2$hide($name, hide) { + return this.addFlag$6$abbr$defaultsTo$help$hide$negatable($name, null, false, null, hide, true); + }, + addFlag$2$help($name, help) { + return this.addFlag$6$abbr$defaultsTo$help$hide$negatable($name, null, false, help, false, true); + }, + addFlag$3$defaultsTo$help($name, defaultsTo, help) { + return this.addFlag$6$abbr$defaultsTo$help$hide$negatable($name, null, defaultsTo, help, false, true); + }, + addFlag$3$help$negatable($name, help, negatable) { + return this.addFlag$6$abbr$defaultsTo$help$hide$negatable($name, null, false, help, false, negatable); + }, + addFlag$3$abbr$help($name, abbr, help) { + return this.addFlag$6$abbr$defaultsTo$help$hide$negatable($name, abbr, false, help, false, true); + }, + addFlag$4$abbr$help$negatable($name, abbr, help, negatable) { + return this.addFlag$6$abbr$defaultsTo$help$hide$negatable($name, abbr, false, help, false, negatable); + }, + addOption$7$abbr$allowed$defaultsTo$help$hide$valueHelp($name, abbr, allowed, defaultsTo, help, hide, valueHelp) { + this._addOption$12$aliases$hide$mandatory($name, abbr, help, valueHelp, allowed, null, defaultsTo, null, B.OptionType_YwU, B.List_empty, hide, false); + }, + addOption$2$hide($name, hide) { + var _null = null; + return this.addOption$7$abbr$allowed$defaultsTo$help$hide$valueHelp($name, _null, _null, _null, _null, hide, _null); + }, + addOption$6$abbr$allowed$defaultsTo$help$valueHelp($name, abbr, allowed, defaultsTo, help, valueHelp) { + return this.addOption$7$abbr$allowed$defaultsTo$help$hide$valueHelp($name, abbr, allowed, defaultsTo, help, false, valueHelp); + }, + addOption$4$allowed$defaultsTo$help($name, allowed, defaultsTo, help) { + return this.addOption$7$abbr$allowed$defaultsTo$help$hide$valueHelp($name, null, allowed, defaultsTo, help, false, null); + }, + addMultiOption$7$abbr$allowed$allowedHelp$help$splitCommas$valueHelp($name, abbr, allowed, allowedHelp, help, splitCommas, valueHelp) { + var t1 = A._setArrayType([], type$.JSArray_String); + this._addOption$12$aliases$hide$splitCommas($name, abbr, help, valueHelp, allowed, allowedHelp, t1, null, B.OptionType_qyr, B.List_empty, false, splitCommas); + }, + addMultiOption$5$abbr$help$splitCommas$valueHelp($name, abbr, help, splitCommas, valueHelp) { + return this.addMultiOption$7$abbr$allowed$allowedHelp$help$splitCommas$valueHelp($name, abbr, null, null, help, splitCommas, valueHelp); + }, + addMultiOption$6$abbr$allowed$allowedHelp$help$valueHelp($name, abbr, allowed, allowedHelp, help, valueHelp) { + return this.addMultiOption$7$abbr$allowed$allowedHelp$help$splitCommas$valueHelp($name, abbr, allowed, allowedHelp, help, true, valueHelp); + }, + addMultiOption$3$allowedHelp$help($name, allowedHelp, help) { + return this.addMultiOption$7$abbr$allowed$allowedHelp$help$splitCommas$valueHelp($name, null, null, allowedHelp, help, true, null); + }, + _addOption$14$aliases$hide$mandatory$negatable$splitCommas($name, abbr, help, valueHelp, allowed, allowedHelp, defaultsTo, callback, type, aliases, hide, mandatory, negatable, splitCommas) { + var existing, t2, t3, option, _i, _this = this, _null = null, + t1 = A._setArrayType([$name], type$.JSArray_String); + B.JSArray_methods.addAll$1(t1, aliases); + if (B.JSArray_methods.any$1(t1, new A.ArgParser__addOption_closure(_this))) + throw A.wrapException(A.ArgumentError$('Duplicate option or alias "' + $name + '".', _null)); + t1 = abbr != null; + if (t1) { + existing = _this.findByAbbreviation$1(abbr); + if (existing != null) + throw A.wrapException(A.ArgumentError$('Abbreviation "' + abbr + '" is already used by "' + existing.name + '".', _null)); + } + t2 = allowed == null ? _null : A.List_List$unmodifiable(allowed, type$.String); + if (allowedHelp == null) + t3 = _null; + else { + t3 = type$.String; + t3 = A.ConstantMap_ConstantMap$from(allowedHelp, t3, t3); + } + option = new A.Option($name, abbr, help, valueHelp, t2, t3, defaultsTo, negatable, callback, type, splitCommas == null ? type === B.OptionType_qyr : splitCommas, false, hide); + if ($name.length === 0) + A.throwExpression(A.ArgumentError$("Name cannot be empty.", _null)); + else if (B.JSString_methods.startsWith$1($name, "-")) + A.throwExpression(A.ArgumentError$("Name " + $name + ' cannot start with "-".', _null)); + t2 = $.$get$Option__invalidChars()._nativeRegExp; + if (t2.test($name)) + A.throwExpression(A.ArgumentError$('Name "' + $name + '" contains invalid characters.', _null)); + if (t1) { + if (abbr.length !== 1) + A.throwExpression(A.ArgumentError$("Abbreviation must be null or have length 1.", _null)); + else if (abbr === "-") + A.throwExpression(A.ArgumentError$('Abbreviation cannot be "-".', _null)); + if (t2.test(abbr)) + A.throwExpression(A.ArgumentError$("Abbreviation is an invalid character.", _null)); + } + _this._arg_parser$_options.$indexSet(0, $name, option); + _this._optionsAndSeparators.push(option); + for (t1 = _this._aliases, _i = 0; false; ++_i) + t1.$indexSet(0, aliases[_i], $name); + }, + _addOption$12$aliases$hide$splitCommas($name, abbr, help, valueHelp, allowed, allowedHelp, defaultsTo, callback, type, aliases, hide, splitCommas) { + return this._addOption$14$aliases$hide$mandatory$negatable$splitCommas($name, abbr, help, valueHelp, allowed, allowedHelp, defaultsTo, callback, type, aliases, hide, false, false, splitCommas); + }, + _addOption$12$aliases$hide$mandatory($name, abbr, help, valueHelp, allowed, allowedHelp, defaultsTo, callback, type, aliases, hide, mandatory) { + return this._addOption$14$aliases$hide$mandatory$negatable$splitCommas($name, abbr, help, valueHelp, allowed, allowedHelp, defaultsTo, callback, type, aliases, hide, mandatory, false, null); + }, + _addOption$12$aliases$hide$negatable($name, abbr, help, valueHelp, allowed, allowedHelp, defaultsTo, callback, type, aliases, hide, negatable) { + return this._addOption$14$aliases$hide$mandatory$negatable$splitCommas($name, abbr, help, valueHelp, allowed, allowedHelp, defaultsTo, callback, type, aliases, hide, false, negatable, null); + }, + findByAbbreviation$1(abbr) { + var t1, t2; + for (t1 = this.options._map, t1 = t1.get$values(t1), t1 = t1.get$iterator(t1); t1.moveNext$0();) { + t2 = t1.get$current(t1); + if (t2.abbr === abbr) + return t2; + } + return null; + }, + findByNameOrAlias$1($name) { + var t1 = this._aliases.$index(0, $name); + if (t1 == null) + t1 = $name; + return this.options._map.$index(0, t1); + } + }; + A.ArgParser__addOption_closure.prototype = { + call$1($name) { + return this.$this.findByNameOrAlias$1($name) != null; + }, + $signature: 4 + }; + A.ArgParserException.prototype = {}; + A.ArgResults.prototype = { + $index(_, $name) { + var t1 = this._parser.options._map; + if (!t1.containsKey$1($name)) + throw A.wrapException(A.ArgumentError$('Could not find an option named "' + $name + '".', null)); + t1 = t1.$index(0, $name); + t1.toString; + return t1.valueOrDefault$1(this._parsed.$index(0, $name)); + }, + wasParsed$1($name) { + if (!this._parser.options._map.containsKey$1($name)) + throw A.wrapException(A.ArgumentError$('Could not find an option named "' + $name + '".', null)); + return this._parsed.containsKey$1($name); + } + }; + A.Option.prototype = { + valueOrDefault$1(value) { + var t1; + if (value != null) + return value; + if (this.type === B.OptionType_qyr) { + t1 = this.defaultsTo; + return t1 == null ? A._setArrayType([], type$.JSArray_String) : t1; + } + return this.defaultsTo; + } + }; + A.OptionType.prototype = {}; + A.Parser0.prototype = { + parse$0() { + var commandResults, commandName, commandParser, error, t1, t3, t4, t5, t6, t7, t8, command, exception, _this = this, + t2 = _this._args; + t2.toList$0(0); + commandResults = null; + for (t3 = _this._parser$_rest, t4 = _this._grammar, t5 = t4.commands, t6 = t2.$ti._precomputed1; !t2.get$isEmpty(0);) { + t7 = t2._head; + if (t7 === t2._tail) + A.throwExpression(A.IterableElementError_noElement()); + t7 = t2._table[t7]; + t8 = t7 == null; + if ((t8 ? t6._as(t7) : t7) === "--") { + t2.removeFirst$0(); + break; + } + if (t8) + t7 = t6._as(t7); + command = t5._map.$index(0, t7); + if (command != null) { + if (t3.length !== 0) + A.throwExpression(A.ArgParserException$("Cannot specify arguments before a command.", null)); + commandName = t2.removeFirst$0(); + t5 = type$.JSArray_String; + t6 = A._setArrayType([], t5); + B.JSArray_methods.addAll$1(t6, t3); + commandParser = new A.Parser0(commandName, _this, command, t2, t6, A.LinkedHashMap_LinkedHashMap$_empty(type$.String, type$.dynamic)); + try { + commandResults = commandParser.parse$0(); + } catch (exception) { + t2 = A.unwrapException(exception); + if (t2 instanceof A.ArgParserException) { + error = t2; + t2 = error.message; + t1 = A._setArrayType([commandName], t5); + J.addAll$1$ax(t1, error.commands); + throw A.wrapException(A.ArgParserException$(t2, t1)); + } else + throw exception; + } + B.JSArray_methods.clear$0(t3); + break; + } + if (_this._parseSoloOption$0()) + continue; + if (_this._parseAbbreviation$1(_this)) + continue; + if (_this._parseLongOption$0()) + continue; + t3.push(t2.removeFirst$0()); + } + t4.options._map.forEach$1(0, new A.Parser_parse_closure(_this)); + B.JSArray_methods.addAll$1(t3, t2); + t2.clear$0(0); + return new A.ArgResults(t4, _this._results, _this._commandName, new A.UnmodifiableListView(t3, type$.UnmodifiableListView_String)); + }, + _readNextArgAsValue$1(option) { + var t1 = this._args; + if (t1.get$isEmpty(0)) + A.throwExpression(A.ArgParserException$('Missing argument for "' + option.name + '".', null)); + this._setOption$3(this._results, option, t1.get$first(0)); + t1.removeFirst$0(); + }, + _parseSoloOption$0() { + var opt, + t1 = this._args; + if (t1.get$first(0).length !== 2) + return false; + if (!B.JSString_methods.startsWith$1(t1.get$first(0), "-")) + return false; + opt = t1.get$first(0)[1]; + if (!A._isLetterOrDigit(opt.charCodeAt(0))) + return false; + this._handleSoloOption$1(opt); + return true; + }, + _handleSoloOption$1(opt) { + var t1, _this = this, + option = _this._grammar.findByAbbreviation$1(opt); + if (option == null) { + t1 = _this._parser$_parent; + if (t1 == null) + A.throwExpression(A.ArgParserException$('Could not find an option or flag "-' + opt + '".', null)); + t1._handleSoloOption$1(opt); + return true; + } + _this._args.removeFirst$0(); + if (option.type === B.OptionType_nMZ) + _this._results.$indexSet(0, option.name, true); + else + _this._readNextArgAsValue$1(option); + return true; + }, + _parseAbbreviation$1(innermostCommand) { + var t2, index, t3, t4, lettersAndDigits, rest, + t1 = this._args; + if (t1.get$first(0).length < 2) + return false; + if (!B.JSString_methods.startsWith$1(t1.get$first(0), "-")) + return false; + t2 = t1.$ti._precomputed1; + index = 1; + while (true) { + t3 = t1._head; + if (t3 === t1._tail) + A.throwExpression(A.IterableElementError_noElement()); + t3 = t1._table[t3]; + t4 = t3 == null; + if (index < (t4 ? t2._as(t3) : t3).length) { + t3 = (t4 ? t2._as(t3) : t3).charCodeAt(index); + if (!(t3 >= 65 && t3 <= 90)) + if (!(t3 >= 97 && t3 <= 122)) + t3 = t3 >= 48 && t3 <= 57; + else + t3 = true; + else + t3 = true; + } else + t3 = false; + if (!t3) + break; + ++index; + } + if (index === 1) + return false; + lettersAndDigits = B.JSString_methods.substring$2(t1.get$first(0), 1, index); + rest = B.JSString_methods.substring$1(t1.get$first(0), index); + if (B.JSString_methods.contains$1(rest, "\n") || B.JSString_methods.contains$1(rest, "\r")) + return false; + this._handleAbbreviation$3(lettersAndDigits, rest, innermostCommand); + return true; + }, + _handleAbbreviation$3(lettersAndDigits, rest, innermostCommand) { + var t1, i, i0, _this = this, + c = B.JSString_methods.substring$2(lettersAndDigits, 0, 1), + first = _this._grammar.findByAbbreviation$1(c); + if (first == null) { + t1 = _this._parser$_parent; + if (t1 == null) + A.throwExpression(A.ArgParserException$(string$.Could_ + c + '".', null)); + t1._handleAbbreviation$3(lettersAndDigits, rest, innermostCommand); + return true; + } else if (first.type !== B.OptionType_nMZ) + _this._setOption$3(_this._results, first, B.JSString_methods.substring$1(lettersAndDigits, 1) + rest); + else { + t1 = B.JSString_methods.substring$1(lettersAndDigits, 1); + if (rest !== "") + A.throwExpression(A.ArgParserException$('Option "-' + c + '" is a flag and cannot handle value "' + t1 + rest + '".', null)); + for (t1 = lettersAndDigits.length, i = 0; i < t1; i = i0) { + i0 = i + 1; + innermostCommand._parseShortFlag$1(B.JSString_methods.substring$2(lettersAndDigits, i, i0)); + } + } + _this._args.removeFirst$0(); + return true; + }, + _parseShortFlag$1(c) { + var t1, + option = this._grammar.findByAbbreviation$1(c); + if (option == null) { + t1 = this._parser$_parent; + if (t1 == null) + A.throwExpression(A.ArgParserException$(string$.Could_ + c + '".', null)); + t1._parseShortFlag$1(c); + return; + } + if (option.type !== B.OptionType_nMZ) + A.throwExpression(A.ArgParserException$('Option "-' + c + '" must be a flag to be in a collapsed "-".', null)); + this._results.$indexSet(0, option.name, true); + }, + _parseLongOption$0() { + var index, t2, $name, t3, i, t4, t5, value, + t1 = this._args; + if (!B.JSString_methods.startsWith$1(t1.get$first(0), "--")) + return false; + index = B.JSString_methods.indexOf$1(t1.get$first(0), "="); + t2 = index === -1; + $name = t2 ? B.JSString_methods.substring$1(t1.get$first(0), 2) : B.JSString_methods.substring$2(t1.get$first(0), 2, index); + for (t3 = $name.length, i = 0; i !== t3; ++i) { + t4 = $name.charCodeAt(i); + if (!(t4 >= 65 && t4 <= 90)) + if (!(t4 >= 97 && t4 <= 122)) + t5 = t4 >= 48 && t4 <= 57; + else + t5 = true; + else + t5 = true; + if (!(t5 || t4 === 45 || t4 === 95)) + return false; + } + value = t2 ? null : B.JSString_methods.substring$1(t1.get$first(0), index + 1); + if (value != null) + t1 = B.JSString_methods.contains$1(value, "\n") || B.JSString_methods.contains$1(value, "\r"); + else + t1 = false; + if (t1) + return false; + this._handleLongOption$2($name, value); + return true; + }, + _handleLongOption$2($name, value) { + var _this = this, _null = null, + _s32_ = 'Could not find an option named "', + t1 = _this._grammar, + option = t1.findByNameOrAlias$1($name); + if (option != null) { + _this._args.removeFirst$0(); + if (option.type === B.OptionType_nMZ) { + if (value != null) + A.throwExpression(A.ArgParserException$('Flag option "' + $name + '" should not be given a value.', _null)); + _this._results.$indexSet(0, option.name, true); + } else if (value != null) + _this._setOption$3(_this._results, option, value); + else + _this._readNextArgAsValue$1(option); + } else if (B.JSString_methods.startsWith$1($name, "no-")) { + option = t1.findByNameOrAlias$1(B.JSString_methods.substring$1($name, 3)); + if (option == null) { + t1 = _this._parser$_parent; + if (t1 == null) + A.throwExpression(A.ArgParserException$(_s32_ + $name + '".', _null)); + t1._handleLongOption$2($name, value); + return true; + } + _this._args.removeFirst$0(); + if (option.type !== B.OptionType_nMZ) + A.throwExpression(A.ArgParserException$('Cannot negate non-flag option "' + $name + '".', _null)); + if (!option.negatable) + A.throwExpression(A.ArgParserException$('Cannot negate option "' + $name + '".', _null)); + _this._results.$indexSet(0, option.name, false); + } else { + t1 = _this._parser$_parent; + if (t1 == null) + A.throwExpression(A.ArgParserException$(_s32_ + $name + '".', _null)); + t1._handleLongOption$2($name, value); + return true; + } + return true; + }, + _setOption$3(results, option, value) { + var list, t1, t2, t3, _i, element; + if (option.type !== B.OptionType_qyr) { + this._validateAllowed$2(option, value); + results.$indexSet(0, option.name, value); + return; + } + list = type$.List_dynamic._as(results.putIfAbsent$2(option.name, new A.Parser__setOption_closure())); + if (option.splitCommas) + for (t1 = value.split(","), t2 = t1.length, t3 = J.getInterceptor$ax(list), _i = 0; _i < t2; ++_i) { + element = t1[_i]; + this._validateAllowed$2(option, element); + t3.add$1(list, element); + } + else { + this._validateAllowed$2(option, value); + J.add$1$ax(list, value); + } + }, + _validateAllowed$2(option, value) { + var t1 = option.allowed; + if (t1 == null) + return; + if (!B.JSArray_methods.contains$1(t1, value)) + A.throwExpression(A.ArgParserException$('"' + value + '" is not an allowed value for option "' + option.name + '".', null)); + } + }; + A.Parser_parse_closure.prototype = { + call$2($name, option) { + var parsedOption = this.$this._results.$index(0, $name), + callback = option.callback; + if (callback == null) + return; + callback.call$1(option.valueOrDefault$1(parsedOption)); + }, + $signature: 534 + }; + A.Parser__setOption_closure.prototype = { + call$0() { + return A._setArrayType([], type$.JSArray_String); + }, + $signature: 115 + }; + A._Usage.prototype = { + get$_columnWidths() { + var result, _this = this, + value = _this.___Usage__columnWidths_FI; + if (value === $) { + result = _this._calculateColumnWidths$0(); + _this.___Usage__columnWidths_FI !== $ && A.throwUnnamedLateFieldADI(); + _this.___Usage__columnWidths_FI = result; + value = result; + } + return value; + }, + generate$0() { + var t1, t2, t3, t4, _i, optionOrSeparator, t5, _this = this; + for (t1 = _this._usage$_optionsAndSeparators, t2 = t1.length, t3 = type$.Option, t4 = _this._usage$_buffer, _i = 0; _i < t1.length; t1.length === t2 || (0, A.throwConcurrentModificationError)(t1), ++_i) { + optionOrSeparator = t1[_i]; + if (typeof optionOrSeparator == "string") { + t5 = t4._contents; + t4._contents = (t5.length !== 0 ? t4._contents = t5 + "\n\n" : t5) + optionOrSeparator; + _this._newlinesNeeded = 1; + continue; + } + t3._as(optionOrSeparator); + if (optionOrSeparator.hide) + continue; + _this._writeOption$1(optionOrSeparator); + } + t1 = t4._contents; + return t1.charCodeAt(0) == 0 ? t1 : t1; + }, + _writeOption$1(option) { + var allowedNames, t2, t3, t4, _i, $name, t5, _this = this, + t1 = option.abbr; + _this._write$2(0, t1 == null ? "" : "-" + t1 + ", "); + t1 = _this._longOption$1(option); + _this._write$2(1, t1); + t1 = option.help; + if (t1 != null) + _this._write$2(2, t1); + t1 = option.allowedHelp; + if (t1 != null) { + allowedNames = J.toList$0$ax(t1.get$keys(t1)); + B.JSArray_methods.sort$0(allowedNames); + _this._newline$0(); + for (t2 = allowedNames.length, t3 = option.defaultsTo, t4 = type$.List_dynamic._is(t3), _i = 0; _i < allowedNames.length; allowedNames.length === t2 || (0, A.throwConcurrentModificationError)(allowedNames), ++_i) { + $name = allowedNames[_i]; + t5 = (t4 ? B.JSArray_methods.contains$1(t3, $name) : t3 === $name) ? " (default)" : ""; + _this._write$2(1, " [" + $name + "]" + t5); + t5 = t1.$index(0, $name); + t5.toString; + _this._write$2(2, t5); + } + _this._newline$0(); + } else if (option.allowed != null) + _this._write$2(2, _this._buildAllowedList$1(option)); + else { + t1 = option.type; + if (t1 === B.OptionType_nMZ) { + if (option.defaultsTo === true) + _this._write$2(2, "(defaults to on)"); + } else if (t1 === B.OptionType_qyr) { + t1 = option.defaultsTo; + if (t1 != null && type$.Iterable_dynamic._as(t1).length !== 0) { + type$.List_dynamic._as(t1); + _this._write$2(2, "(defaults to " + new A.MappedListIterable(t1, new A._Usage__writeOption_closure(), A._arrayInstanceType(t1)._eval$1("MappedListIterable<1,String>")).join$1(0, ", ") + ")"); + } + } else { + t1 = option.defaultsTo; + if (t1 != null) + _this._write$2(2, '(defaults to "' + A.S(t1) + '")'); + } + } + }, + _longOption$1(option) { + var t1 = option.name, + result = option.negatable ? "--[no-]" + t1 : "--" + t1; + t1 = option.valueHelp; + return t1 != null ? result + ("=<" + t1 + ">") : result; + }, + _calculateColumnWidths$0() { + var t1, t2, t3, abbr, title, _i, option, t4, t5, t6, t7, t8; + for (t1 = this._usage$_optionsAndSeparators, t2 = t1.length, t3 = type$.List_dynamic, abbr = 0, title = 0, _i = 0; _i < t1.length; t1.length === t2 || (0, A.throwConcurrentModificationError)(t1), ++_i) { + option = t1[_i]; + if (!(option instanceof A.Option)) + continue; + if (option.hide) + continue; + t4 = option.abbr; + abbr = Math.max(abbr, (t4 == null ? "" : "-" + t4 + ", ").length); + t4 = this._longOption$1(option); + title = Math.max(title, t4.length); + t4 = option.allowedHelp; + if (t4 != null) + for (t4 = J.get$iterator$ax(t4.get$keys(t4)), t5 = option.defaultsTo, t6 = t3._is(t5); t4.moveNext$0();) { + t7 = t4.get$current(t4); + t8 = (t6 ? B.JSArray_methods.contains$1(t5, t7) : t5 === t7) ? " (default)" : ""; + title = Math.max(title, (" [" + t7 + "]" + t8).length); + } + } + return A._setArrayType([abbr, title + 4], type$.JSArray_int); + }, + _newline$0() { + ++this._newlinesNeeded; + this._currentColumn = 0; + }, + _write$2(column, text) { + var t1, _i, + lines = A._setArrayType(text.split("\n"), type$.JSArray_String); + this.get$_columnWidths(); + while (true) { + if (!(lines.length !== 0 && J.trim$0$s(B.JSArray_methods.get$first(lines)) === "")) + break; + B.JSArray_methods.removeAt$1(lines, 0); + } + while (true) { + if (!(lines.length !== 0 && J.trim$0$s(B.JSArray_methods.get$last(lines)) === "")) + break; + lines.pop(); + } + for (t1 = lines.length, _i = 0; _i < lines.length; lines.length === t1 || (0, A.throwConcurrentModificationError)(lines), ++_i) + this._writeLine$2(column, lines[_i]); + }, + _writeLine$2(column, text) { + var t1, t2, _this = this; + for (t1 = _this._usage$_buffer; t2 = _this._newlinesNeeded, t2 > 0;) { + t1._contents += "\n"; + _this._newlinesNeeded = t2 - 1; + } + for (; t2 = _this._currentColumn, t2 !== column;) { + if (t2 < 2) + t1._contents += B.JSString_methods.$mul(" ", _this.get$_columnWidths()[_this._currentColumn]); + else + t1._contents += "\n"; + _this._currentColumn = (_this._currentColumn + 1) % 3; + } + _this.get$_columnWidths(); + if (column < 2) + t1._contents += B.JSString_methods.padRight$1(text, _this.get$_columnWidths()[column]); + else + t1._contents += text; + _this._currentColumn = (_this._currentColumn + 1) % 3; + if (column === 2) + ++_this._newlinesNeeded; + }, + _buildAllowedList$1(option) { + var t2, t3, first, _i, allowed, + t1 = option.defaultsTo, + isDefault = type$.List_dynamic._is(t1) ? B.JSArray_methods.get$contains(t1) : new A._Usage__buildAllowedList_closure(option); + t1 = "" + "["; + for (t2 = option.allowed, t3 = t2.length, first = true, _i = 0; _i < t3; ++_i, first = false) { + allowed = t2[_i]; + if (!first) + t1 += ", "; + t1 += A.S(allowed); + if (isDefault.call$1(allowed)) + t1 += " (default)"; + } + t1 += "]"; + return t1.charCodeAt(0) == 0 ? t1 : t1; + } + }; + A._Usage__writeOption_closure.prototype = { + call$1(value) { + return '"' + A.S(value) + '"'; + }, + $signature: 116 + }; + A._Usage__buildAllowedList_closure.prototype = { + call$1(value) { + return value === this.option.defaultsTo; + }, + $signature: 134 + }; + A.FutureGroup.prototype = { + add$1(_, task) { + var t1, index, _this = this; + if (_this._future_group$_closed) + throw A.wrapException(A.StateError$("The FutureGroup is closed.")); + t1 = _this._future_group$_values; + index = t1.length; + t1.push(null); + ++_this._future_group$_pending; + task.then$1$1(0, new A.FutureGroup_add_closure(_this, index), type$.Null).catchError$1(new A.FutureGroup_add_closure0(_this)); + }, + close$0(_) { + var t1, t2, _this = this; + _this._future_group$_closed = true; + if (_this._future_group$_pending !== 0) + return; + t1 = _this._future_group$_completer; + if ((t1.future._state & 30) !== 0) + return; + t2 = _this.$ti._eval$1("WhereTypeIterable<1>"); + t1.complete$1(A.List_List$of(new A.WhereTypeIterable(_this._future_group$_values, t2), true, t2._eval$1("Iterable.E"))); + } + }; + A.FutureGroup_add_closure.prototype = { + call$1(value) { + var t3, t4, + t1 = this.$this, + t2 = t1._future_group$_completer; + if ((t2.future._state & 30) !== 0) + return null; + t3 = --t1._future_group$_pending; + t4 = t1._future_group$_values; + t4[this.index] = value; + if (t3 !== 0) + return null; + if (!t1._future_group$_closed) + return null; + t1 = t1.$ti._eval$1("WhereTypeIterable<1>"); + t2.complete$1(A.List_List$of(new A.WhereTypeIterable(t4, t1), true, t1._eval$1("Iterable.E"))); + }, + $signature() { + return this.$this.$ti._eval$1("Null(1)"); + } + }; + A.FutureGroup_add_closure0.prototype = { + call$2(error, stackTrace) { + var t1 = this.$this._future_group$_completer; + if ((t1.future._state & 30) !== 0) + return null; + t1.completeError$2(error, stackTrace); + }, + $signature: 53 + }; + A.ErrorResult.prototype = { + complete$1(completer) { + completer.completeError$2(this.error, this.stackTrace); + }, + get$hashCode(_) { + return (J.get$hashCode$(this.error) ^ A.Primitives_objectHashCode(this.stackTrace) ^ 492929599) >>> 0; + }, + $eq(_, other) { + if (other == null) + return false; + return other instanceof A.ErrorResult && J.$eq$(this.error, other.error) && this.stackTrace === other.stackTrace; + }, + $isResult: 1 + }; + A.ValueResult.prototype = { + complete$1(completer) { + completer.complete$1(this.value); + }, + get$hashCode(_) { + return (J.get$hashCode$(this.value) ^ 842997089) >>> 0; + }, + $eq(_, other) { + if (other == null) + return false; + return other instanceof A.ValueResult && J.$eq$(this.value, other.value); + }, + $isResult: 1 + }; + A.StreamCompleter.prototype = { + setSourceStream$1(sourceStream) { + var t1 = this._stream_completer$_stream; + if (t1._sourceStream != null) + throw A.wrapException(A.StateError$("Source stream already set")); + t1._sourceStream = sourceStream; + if (t1._stream_completer$_controller != null) + t1._linkStreamToController$0(); + }, + setError$2(error, stackTrace) { + var t1 = this.$ti._precomputed1; + this.setSourceStream$1(A.Stream_Stream$fromFuture(A.Future_Future$error(error, stackTrace, t1), t1)); + }, + setError$1(error) { + return this.setError$2(error, null); + } + }; + A._CompleterStream.prototype = { + listen$4$cancelOnError$onDone$onError(_, onData, cancelOnError, onDone, onError) { + var sourceStream, t1, _this = this, _null = null; + if (_this._stream_completer$_controller == null) { + sourceStream = _this._sourceStream; + if (sourceStream != null && !sourceStream.get$isBroadcast()) + return sourceStream.listen$4$cancelOnError$onDone$onError(0, onData, cancelOnError, onDone, onError); + if (_this._stream_completer$_controller == null) + _this._stream_completer$_controller = A.StreamController_StreamController(_null, _null, _null, _null, true, _this.$ti._precomputed1); + if (_this._sourceStream != null) + _this._linkStreamToController$0(); + } + t1 = _this._stream_completer$_controller; + t1.toString; + return new A._ControllerStream(t1, A._instanceType(t1)._eval$1("_ControllerStream<1>")).listen$4$cancelOnError$onDone$onError(0, onData, cancelOnError, onDone, onError); + }, + listen$1(_, onData) { + return this.listen$4$cancelOnError$onDone$onError(0, onData, null, null, null); + }, + listen$3$onDone$onError(_, onData, onDone, onError) { + return this.listen$4$cancelOnError$onDone$onError(0, onData, null, onDone, onError); + }, + _linkStreamToController$0() { + var t2, + t1 = this._stream_completer$_controller; + t1.toString; + t2 = this._sourceStream; + t2.toString; + t1.addStream$2$cancelOnError(t2, false).whenComplete$1(t1.get$close(t1)); + } + }; + A.StreamGroup.prototype = { + add$1(_, stream) { + var t1, _this = this; + if (_this._closed) + throw A.wrapException(A.StateError$("Can't add a Stream to a closed StreamGroup.")); + t1 = _this._stream_group$_state; + if (t1 === B._StreamGroupState_dormant) + _this._subscriptions.putIfAbsent$2(stream, new A.StreamGroup_add_closure()); + else if (t1 === B._StreamGroupState_canceled) + return stream.listen$1(0, null).cancel$0(); + else + _this._subscriptions.putIfAbsent$2(stream, new A.StreamGroup_add_closure0(_this, stream)); + return null; + }, + remove$1(_, stream) { + var t1 = this._subscriptions, + subscription = t1.remove$1(0, stream), + future = subscription == null ? null : subscription.cancel$0(); + if (t1.__js_helper$_length === 0) + if (this._closed) { + t1 = this.__StreamGroup__controller_A; + t1 === $ && A.throwUnnamedLateFieldNI(); + A.scheduleMicrotask(t1.get$close(t1)); + } + return future; + }, + _onListen$0() { + var stream, t1, t2, t3, _i, entry, exception, _this = this; + _this._stream_group$_state = B._StreamGroupState_listening; + for (t1 = _this._subscriptions, t2 = A.List_List$of(t1.get$entries(0), true, _this.$ti._eval$1("MapEntry,StreamSubscription<1>?>")), t3 = t2.length, _i = 0; _i < t3; ++_i) { + entry = t2[_i]; + if (entry.value != null) + continue; + stream = entry.key; + try { + t1.$indexSet(0, stream, _this._listenToStream$1(stream)); + } catch (exception) { + t1 = _this._onCancel$0(); + if (t1 != null) + t1.catchError$1(new A.StreamGroup__onListen_closure()); + throw exception; + } + } + }, + _onPause$0() { + var t1, t2, t3; + this._stream_group$_state = B._StreamGroupState_paused; + for (t1 = this._subscriptions.get$values(0), t2 = A._instanceType(t1), t2 = t2._eval$1("@<1>")._bind$1(t2._rest[1]), t1 = new A.MappedIterator(J.get$iterator$ax(t1.__internal$_iterable), t1._f, t2._eval$1("MappedIterator<1,2>")), t2 = t2._rest[1]; t1.moveNext$0();) { + t3 = t1.__internal$_current; + (t3 == null ? t2._as(t3) : t3).pause$0(0); + } + }, + _onResume$0() { + var t1, t2, t3; + this._stream_group$_state = B._StreamGroupState_listening; + for (t1 = this._subscriptions.get$values(0), t2 = A._instanceType(t1), t2 = t2._eval$1("@<1>")._bind$1(t2._rest[1]), t1 = new A.MappedIterator(J.get$iterator$ax(t1.__internal$_iterable), t1._f, t2._eval$1("MappedIterator<1,2>")), t2 = t2._rest[1]; t1.moveNext$0();) { + t3 = t1.__internal$_current; + (t3 == null ? t2._as(t3) : t3).resume$0(0); + } + }, + _onCancel$0() { + var t1, t2, futures; + this._stream_group$_state = B._StreamGroupState_canceled; + t1 = this._subscriptions; + t2 = A.IterableNullableExtension_whereNotNull(t1.get$entries(0).map$1$1(0, new A.StreamGroup__onCancel_closure(this), type$.nullable_Future_void), type$.Future_void); + futures = A.List_List$of(t2, true, t2.$ti._eval$1("Iterable.E")); + t1.clear$0(0); + return futures.length === 0 ? null : A.Future_wait(futures, false, type$.void); + }, + _listenToStream$1(stream) { + var subscription, + t1 = this.__StreamGroup__controller_A; + t1 === $ && A.throwUnnamedLateFieldNI(); + subscription = stream.listen$3$onDone$onError(0, t1.get$add(t1), new A.StreamGroup__listenToStream_closure(this, stream), t1.get$addError()); + if (this._stream_group$_state === B._StreamGroupState_paused) + subscription.pause$0(0); + return subscription; + } + }; + A.StreamGroup_add_closure.prototype = { + call$0() { + return null; + }, + $signature: 1 + }; + A.StreamGroup_add_closure0.prototype = { + call$0() { + return this.$this._listenToStream$1(this.stream); + }, + $signature() { + return this.$this.$ti._eval$1("StreamSubscription<1>()"); + } + }; + A.StreamGroup__onListen_closure.prototype = { + call$1(_) { + }, + $signature: 54 + }; + A.StreamGroup__onCancel_closure.prototype = { + call$1(entry) { + var t1, exception, + subscription = entry.value; + try { + if (subscription != null) { + t1 = subscription.cancel$0(); + return t1; + } + t1 = J.listen$1$z(entry.key, null).cancel$0(); + return t1; + } catch (exception) { + return null; + } + }, + $signature() { + return this.$this.$ti._eval$1("Future<~>?(MapEntry,StreamSubscription<1>?>)"); + } + }; + A.StreamGroup__listenToStream_closure.prototype = { + call$0() { + return this.$this.remove$1(0, this.stream); + }, + $signature: 0 + }; + A._StreamGroupState.prototype = { + toString$0(_) { + return this.name; + } + }; + A.StreamQueue.prototype = { + _updateRequests$0() { + var t1, t2, t3, t4, _this = this; + for (t1 = _this._requestQueue, t2 = _this._eventQueue, t3 = t1.$ti._precomputed1; !t1.get$isEmpty(0);) { + t4 = t1._head; + if (t4 === t1._tail) + A.throwExpression(A.IterableElementError_noElement()); + t4 = t1._table[t4]; + if (t4 == null) + t4 = t3._as(t4); + if (t4.update$2(t2, _this._isDone)) + t1.removeFirst$0(); + else + return; + } + if (!_this._isDone) + _this._stream_queue$_subscription.pause$0(0); + }, + _ensureListening$0() { + var t1, _this = this; + if (_this._isDone) + return; + t1 = _this._stream_queue$_subscription; + if (t1 == null) + _this._stream_queue$_subscription = _this._stream_queue$_source.listen$3$onDone$onError(0, new A.StreamQueue__ensureListening_closure(_this), new A.StreamQueue__ensureListening_closure0(_this), new A.StreamQueue__ensureListening_closure1(_this)); + else + t1.resume$0(0); + }, + _addResult$1(result) { + ++this._eventsReceived; + this._eventQueue._queue_list$_add$1(result); + this._updateRequests$0(); + }, + _addRequest$1(request) { + var _this = this, + t1 = _this._requestQueue; + if (t1._head === t1._tail) { + if (request.update$2(_this._eventQueue, _this._isDone)) + return; + _this._ensureListening$0(); + } + t1._add$1(request); + } + }; + A.StreamQueue__ensureListening_closure.prototype = { + call$1(data) { + var t1 = this.$this; + t1._addResult$1(new A.ValueResult(data, t1.$ti._eval$1("ValueResult<1>"))); + }, + $signature() { + return this.$this.$ti._eval$1("~(1)"); + } + }; + A.StreamQueue__ensureListening_closure1.prototype = { + call$2(error, stackTrace) { + this.$this._addResult$1(new A.ErrorResult(error, stackTrace)); + }, + $signature: 53 + }; + A.StreamQueue__ensureListening_closure0.prototype = { + call$0() { + var t1 = this.$this; + t1._stream_queue$_subscription = null; + t1._isDone = true; + t1._updateRequests$0(); + }, + $signature: 0 + }; + A._NextRequest.prototype = { + update$2(events, isDone) { + if (!events.get$isEmpty(events)) { + events.removeFirst$0().complete$1(this._completer); + return true; + } + if (isDone) { + this._completer.completeError$2(new A.StateError("No elements"), A.StackTrace_current()); + return true; + } + return false; + }, + $is_EventRequest: 1 + }; + A._isStrictMode_closure.prototype = { + call$0() { + var exception; + try { + "".name = null; + return false; + } catch (exception) { + return true; + } + }, + $signature: 26 + }; + A.Repl.prototype = {}; + A.alwaysValid_closure.prototype = { + call$1(text) { + return true; + }, + $signature: 4 + }; + A.ReplAdapter.prototype = { + runAsync$0() { + var rl, runController, _this = this, t1 = {}, + t2 = J.get$isTTY$x(self.process.stdin), + output = (t2 == null ? false : t2) ? self.process.stdout : null; + t2 = _this.repl.prompt; + rl = J.createInterface$1$x($.$get$readline(), {input: self.process.stdin, output: output, prompt: t2}); + _this.rl = rl; + t1.statement = ""; + t1.prompt = t2; + runController = A._Cell$(); + runController._value = A.StreamController_StreamController(_this.get$exit(_this), new A.ReplAdapter_runAsync_closure(t1, _this, rl, runController), null, null, false, type$.String); + return runController._readLocal$0().get$stream(); + }, + exit$0(_) { + var t1 = this.rl; + if (t1 != null) + J.close$0$x(t1); + this.rl = null; + } + }; + A.ReplAdapter_runAsync_closure.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void), + $async$handler = 1, $async$currentError, $async$self = this, lineController, lineQueue, line, error, stackTrace, t1, t2, t3, t4, $prompt, prompt0, t5, t6, t7, t8, t9, line0, toZone, statement, exception, $async$exception; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) { + $async$currentError = $async$result; + $async$goto = $async$handler; + } + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$handler = 3; + lineController = A.StreamController_StreamController(null, null, null, null, false, type$.String); + t1 = lineController; + t2 = A.QueueList$(null, type$.Result_String); + t3 = A.ListQueue$(type$._EventRequest_dynamic); + lineQueue = new A.StreamQueue(new A._ControllerStream(t1, A.instanceType(t1)._eval$1("_ControllerStream<1>")), t2, t3, type$.StreamQueue_String); + t1 = $async$self.rl; + t2 = J.getInterceptor$x(t1); + t2.on$2(t1, "line", A.allowInterop(new A.ReplAdapter_runAsync__closure(lineController))); + t3 = $async$self._box_0, t4 = $async$self.$this.repl, $prompt = t4.continuation, prompt0 = t4.prompt, t5 = $async$self.runController, t6 = t5.__late_helper$_name; + case 6: + // for condition + // trivial condition + t7 = J.get$isTTY$x(self.process.stdin); + if (t7 == null ? false : t7) + J.write$1$x(self.process.stdout, t3.prompt); + t7 = lineQueue; + t8 = A.instanceType(t7); + t9 = new A._Future($.Zone__current, t8._eval$1("_Future<1>")); + t7._addRequest$1(new A._NextRequest(new A._AsyncCompleter(t9, t8._eval$1("_AsyncCompleter<1>")), t8._eval$1("_NextRequest<1>"))); + $async$goto = 8; + return A._asyncAwait(t9, $async$call$0); + case 8: + // returning from await. + line = $async$result; + t7 = J.get$isTTY$x(self.process.stdin); + if (!(t7 == null ? false : t7)) { + line0 = t3.prompt + A.S(line); + toZone = $.printToZone; + if (toZone == null) + A.printString(line0); + else + toZone.call$1(line0); + } + statement = B.JSString_methods.$add(t3.statement, line); + t3.statement = statement; + if (t4.validator.call$1(statement)) { + t7 = t5._value; + if (t7 === t5) + A.throwExpression(A.LateError$localNI(t6)); + J.add$1$ax(t7, t3.statement); + t3.statement = ""; + t3.prompt = prompt0; + t2.setPrompt$1(t1, prompt0); + } else { + t3.statement += "\n"; + t3.prompt = $prompt; + t2.setPrompt$1(t1, $prompt); + } + // goto for condition + $async$goto = 6; + break; + case 7: + // after for + $async$handler = 1; + // goto after finally + $async$goto = 5; + break; + case 3: + // catch + $async$handler = 2; + $async$exception = $async$currentError; + error = A.unwrapException($async$exception); + stackTrace = A.getTraceFromException($async$exception); + t1 = $async$self.runController; + t1._readLocal$0().addError$2(error, stackTrace); + t2 = $async$self.$this.exit$0(0); + t2 = A._Future$value(t2, type$.void); + $async$goto = 9; + return A._asyncAwait(t2, $async$call$0); + case 9: + // returning from await. + J.close$0$x(t1._readLocal$0()); + // goto after finally + $async$goto = 5; + break; + case 2: + // uncaught + // goto rethrow + $async$goto = 1; + break; + case 5: + // after finally + // implicit return + return A._asyncReturn(null, $async$completer); + case 1: + // rethrow + return A._asyncRethrow($async$currentError, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 24 + }; + A.ReplAdapter_runAsync__closure.prototype = { + call$1(value) { + return this.lineController.add$1(0, A._asString(value)); + }, + $signature: 76 + }; + A.Stdin.prototype = {}; + A.Stdout.prototype = {}; + A.ReadlineModule.prototype = {}; + A.ReadlineOptions.prototype = {}; + A.ReadlineInterface.prototype = {}; + A.EmptyUnmodifiableSet.prototype = { + get$iterator(_) { + return B.C_EmptyIterator; + }, + get$length(_) { + return 0; + }, + contains$1(_, element) { + return false; + }, + toSet$0(_) { + return A.LinkedHashSet_LinkedHashSet$_empty(this.$ti._precomputed1); + }, + $isEfficientLengthIterable: 1, + $isSet: 1 + }; + A._EmptyUnmodifiableSet_IterableBase_UnmodifiableSetMixin.prototype = {}; + A.DefaultEquality.prototype = {}; + A.IterableEquality.prototype = { + equals$2(_, elements1, elements2) { + var it1, it2, hasNext; + if (elements1 === elements2) + return true; + it1 = J.get$iterator$ax(elements1); + it2 = J.get$iterator$ax(elements2); + for (; true;) { + hasNext = it1.moveNext$0(); + if (hasNext !== it2.moveNext$0()) + return false; + if (!hasNext) + return true; + if (!J.$eq$(it1.get$current(it1), it2.get$current(it2))) + return false; + } + }, + hash$1(elements) { + var t1, hash, _i; + for (t1 = elements.length, hash = 0, _i = 0; _i < elements.length; elements.length === t1 || (0, A.throwConcurrentModificationError)(elements), ++_i) { + hash = hash + J.get$hashCode$(elements[_i]) & 2147483647; + hash = hash + (hash << 10 >>> 0) & 2147483647; + hash ^= hash >>> 6; + } + hash = hash + (hash << 3 >>> 0) & 2147483647; + hash ^= hash >>> 11; + return hash + (hash << 15 >>> 0) & 2147483647; + } + }; + A.ListEquality.prototype = { + equals$2(_, list1, list2) { + var t1, $length, t2, i; + if (list1 == null ? list2 == null : list1 === list2) + return true; + if (list1 == null || list2 == null) + return false; + t1 = J.getInterceptor$asx(list1); + $length = t1.get$length(list1); + t2 = J.getInterceptor$asx(list2); + if ($length !== t2.get$length(list2)) + return false; + for (i = 0; i < $length; ++i) + if (!J.$eq$(t1.$index(list1, i), t2.$index(list2, i))) + return false; + return true; + }, + hash$1(list) { + var hash, i; + for (hash = 0, i = 0; i < list.length; ++i) { + hash = hash + J.get$hashCode$(list[i]) & 2147483647; + hash = hash + (hash << 10 >>> 0) & 2147483647; + hash ^= hash >>> 6; + } + hash = hash + (hash << 3 >>> 0) & 2147483647; + hash ^= hash >>> 11; + return hash + (hash << 15 >>> 0) & 2147483647; + } + }; + A._MapEntry.prototype = { + get$hashCode(_) { + return 3 * J.get$hashCode$(this.key) + 7 * J.get$hashCode$(this.value) & 2147483647; + }, + $eq(_, other) { + if (other == null) + return false; + return other instanceof A._MapEntry && J.$eq$(this.key, other.key) && J.$eq$(this.value, other.value); + } + }; + A.MapEquality.prototype = { + equals$2(_, map1, map2) { + var equalElementCounts, t1, key, entry, count; + if (map1 === map2) + return true; + if (map1.get$length(map1) !== map2.get$length(map2)) + return false; + equalElementCounts = A.HashMap_HashMap(type$._MapEntry, type$.int); + for (t1 = J.get$iterator$ax(map1.get$keys(map1)); t1.moveNext$0();) { + key = t1.get$current(t1); + entry = new A._MapEntry(this, key, map1.$index(0, key)); + count = equalElementCounts.$index(0, entry); + equalElementCounts.$indexSet(0, entry, (count == null ? 0 : count) + 1); + } + for (t1 = J.get$iterator$ax(map2.get$keys(map2)); t1.moveNext$0();) { + key = t1.get$current(t1); + entry = new A._MapEntry(this, key, map2.$index(0, key)); + count = equalElementCounts.$index(0, entry); + if (count == null || count === 0) + return false; + equalElementCounts.$indexSet(0, entry, count - 1); + } + return true; + }, + hash$1(map) { + var t1, t2, hash, key, keyHash, t3; + for (t1 = J.get$iterator$ax(map.get$keys(map)), t2 = this.$ti._rest[1], hash = 0; t1.moveNext$0();) { + key = t1.get$current(t1); + keyHash = J.get$hashCode$(key); + t3 = map.$index(0, key); + hash = hash + 3 * keyHash + 7 * J.get$hashCode$(t3 == null ? t2._as(t3) : t3) & 2147483647; + } + hash = hash + (hash << 3 >>> 0) & 2147483647; + hash ^= hash >>> 11; + return hash + (hash << 15 >>> 0) & 2147483647; + } + }; + A.QueueList.prototype = { + add$1(_, element) { + this._queue_list$_add$1(element); + }, + addAll$1(_, iterable) { + var addCount, $length, t1, endSpace, t2, preSpace, _this = this; + if (type$.List_dynamic._is(iterable)) { + addCount = J.get$length$asx(iterable); + $length = _this.get$length(0); + t1 = $length + addCount; + if (t1 >= J.get$length$asx(_this._queue_list$_table)) { + _this._preGrow$1(t1); + J.setRange$4$ax(_this._queue_list$_table, $length, t1, iterable, 0); + _this.set$_queue_list$_tail(_this.get$_queue_list$_tail() + addCount); + } else { + endSpace = J.get$length$asx(_this._queue_list$_table) - _this.get$_queue_list$_tail(); + t1 = _this._queue_list$_table; + t2 = J.getInterceptor$ax(t1); + if (addCount < endSpace) { + t2.setRange$4(t1, _this.get$_queue_list$_tail(), _this.get$_queue_list$_tail() + addCount, iterable, 0); + _this.set$_queue_list$_tail(_this.get$_queue_list$_tail() + addCount); + } else { + preSpace = addCount - endSpace; + t2.setRange$4(t1, _this.get$_queue_list$_tail(), _this.get$_queue_list$_tail() + endSpace, iterable, 0); + J.setRange$4$ax(_this._queue_list$_table, 0, preSpace, iterable, endSpace); + _this.set$_queue_list$_tail(preSpace); + } + } + } else + for (t1 = J.get$iterator$ax(iterable); t1.moveNext$0();) + _this._queue_list$_add$1(t1.get$current(t1)); + }, + cast$1$0(_, $T) { + return new A._CastQueueList(this, J.cast$1$0$ax(this._queue_list$_table, $T), -1, -1, A._instanceType(this)._eval$1("@")._bind$1($T)._eval$1("_CastQueueList<1,2>")); + }, + toString$0(_) { + return A.Iterable_iterableToFullString(this, "{", "}"); + }, + addFirst$1(element) { + var _this = this; + _this.set$_queue_list$_head((_this.get$_queue_list$_head() - 1 & J.get$length$asx(_this._queue_list$_table) - 1) >>> 0); + J.$indexSet$ax(_this._queue_list$_table, _this.get$_queue_list$_head(), element); + if (_this.get$_queue_list$_head() === _this.get$_queue_list$_tail()) + _this._queue_list$_grow$0(); + }, + removeFirst$0() { + var result, _this = this; + if (_this.get$_queue_list$_head() === _this.get$_queue_list$_tail()) + throw A.wrapException(A.StateError$("No element")); + result = J.$index$asx(_this._queue_list$_table, _this.get$_queue_list$_head()); + if (result == null) + result = A._instanceType(_this)._eval$1("QueueList.E")._as(result); + J.$indexSet$ax(_this._queue_list$_table, _this.get$_queue_list$_head(), null); + _this.set$_queue_list$_head((_this.get$_queue_list$_head() + 1 & J.get$length$asx(_this._queue_list$_table) - 1) >>> 0); + return result; + }, + removeLast$0(_) { + var result, _this = this; + if (_this.get$_queue_list$_head() === _this.get$_queue_list$_tail()) + throw A.wrapException(A.StateError$("No element")); + _this.set$_queue_list$_tail((_this.get$_queue_list$_tail() - 1 & J.get$length$asx(_this._queue_list$_table) - 1) >>> 0); + result = J.$index$asx(_this._queue_list$_table, _this.get$_queue_list$_tail()); + if (result == null) + result = A._instanceType(_this)._eval$1("QueueList.E")._as(result); + J.$indexSet$ax(_this._queue_list$_table, _this.get$_queue_list$_tail(), null); + return result; + }, + get$length(_) { + return (this.get$_queue_list$_tail() - this.get$_queue_list$_head() & J.get$length$asx(this._queue_list$_table) - 1) >>> 0; + }, + set$length(_, value) { + var delta, newTail, t1, t2, _this = this; + if (value < 0) + throw A.wrapException(A.RangeError$("Length " + value + " may not be negative.")); + if (value > _this.get$length(0) && !A._instanceType(_this)._eval$1("QueueList.E")._is(null)) + throw A.wrapException(A.UnsupportedError$("The length can only be increased when the element type is nullable, but the current element type is `" + A.createRuntimeType(A._instanceType(_this)._eval$1("QueueList.E")).toString$0(0) + "`.")); + delta = value - _this.get$length(0); + if (delta >= 0) { + if (J.get$length$asx(_this._queue_list$_table) <= value) + _this._preGrow$1(value); + _this.set$_queue_list$_tail((_this.get$_queue_list$_tail() + delta & J.get$length$asx(_this._queue_list$_table) - 1) >>> 0); + return; + } + newTail = _this.get$_queue_list$_tail() + delta; + t1 = _this._queue_list$_table; + if (newTail >= 0) + J.fillRange$3$ax(t1, newTail, _this.get$_queue_list$_tail(), null); + else { + newTail += J.get$length$asx(t1); + J.fillRange$3$ax(_this._queue_list$_table, 0, _this.get$_queue_list$_tail(), null); + t1 = _this._queue_list$_table; + t2 = J.getInterceptor$asx(t1); + t2.fillRange$3(t1, newTail, t2.get$length(t1), null); + } + _this.set$_queue_list$_tail(newTail); + }, + $index(_, index) { + var t1, _this = this; + if (index < 0 || index >= _this.get$length(0)) + throw A.wrapException(A.RangeError$("Index " + index + " must be in the range [0.." + _this.get$length(0) + ").")); + t1 = J.$index$asx(_this._queue_list$_table, (_this.get$_queue_list$_head() + index & J.get$length$asx(_this._queue_list$_table) - 1) >>> 0); + return t1 == null ? A._instanceType(_this)._eval$1("QueueList.E")._as(t1) : t1; + }, + $indexSet(_, index, value) { + var _this = this; + if (index < 0 || index >= _this.get$length(0)) + throw A.wrapException(A.RangeError$("Index " + index + " must be in the range [0.." + _this.get$length(0) + ").")); + J.$indexSet$ax(_this._queue_list$_table, (_this.get$_queue_list$_head() + index & J.get$length$asx(_this._queue_list$_table) - 1) >>> 0, value); + }, + _queue_list$_add$1(element) { + var _this = this; + J.$indexSet$ax(_this._queue_list$_table, _this.get$_queue_list$_tail(), element); + _this.set$_queue_list$_tail((_this.get$_queue_list$_tail() + 1 & J.get$length$asx(_this._queue_list$_table) - 1) >>> 0); + if (_this.get$_queue_list$_head() === _this.get$_queue_list$_tail()) + _this._queue_list$_grow$0(); + }, + _queue_list$_grow$0() { + var _this = this, + newTable = A.List_List$filled(J.get$length$asx(_this._queue_list$_table) * 2, null, false, A._instanceType(_this)._eval$1("QueueList.E?")), + split = J.get$length$asx(_this._queue_list$_table) - _this.get$_queue_list$_head(); + B.JSArray_methods.setRange$4(newTable, 0, split, _this._queue_list$_table, _this.get$_queue_list$_head()); + B.JSArray_methods.setRange$4(newTable, split, split + _this.get$_queue_list$_head(), _this._queue_list$_table, 0); + _this.set$_queue_list$_head(0); + _this.set$_queue_list$_tail(J.get$length$asx(_this._queue_list$_table)); + _this._queue_list$_table = newTable; + }, + _writeToList$1(target) { + var $length, firstPartSize, _this = this; + if (_this.get$_queue_list$_head() <= _this.get$_queue_list$_tail()) { + $length = _this.get$_queue_list$_tail() - _this.get$_queue_list$_head(); + B.JSArray_methods.setRange$4(target, 0, $length, _this._queue_list$_table, _this.get$_queue_list$_head()); + return $length; + } else { + firstPartSize = J.get$length$asx(_this._queue_list$_table) - _this.get$_queue_list$_head(); + B.JSArray_methods.setRange$4(target, 0, firstPartSize, _this._queue_list$_table, _this.get$_queue_list$_head()); + B.JSArray_methods.setRange$4(target, firstPartSize, firstPartSize + _this.get$_queue_list$_tail(), _this._queue_list$_table, 0); + return _this.get$_queue_list$_tail() + firstPartSize; + } + }, + _preGrow$1(newElementCount) { + var _this = this, + newTable = A.List_List$filled(A.QueueList__nextPowerOf2(newElementCount + B.JSInt_methods._shrOtherPositive$1(newElementCount, 1)), null, false, A._instanceType(_this)._eval$1("QueueList.E?")); + _this.set$_queue_list$_tail(_this._writeToList$1(newTable)); + _this._queue_list$_table = newTable; + _this.set$_queue_list$_head(0); + }, + $isEfficientLengthIterable: 1, + $isQueue: 1, + $isIterable: 1, + $isList: 1, + get$_queue_list$_head() { + return this._queue_list$_head; + }, + get$_queue_list$_tail() { + return this._queue_list$_tail; + }, + set$_queue_list$_head(val) { + return this._queue_list$_head = val; + }, + set$_queue_list$_tail(val) { + return this._queue_list$_tail = val; + } + }; + A._CastQueueList.prototype = { + get$_queue_list$_head() { + return this._queue_list$_delegate.get$_queue_list$_head(); + }, + set$_queue_list$_head(value) { + this._queue_list$_delegate.set$_queue_list$_head(value); + }, + get$_queue_list$_tail() { + return this._queue_list$_delegate.get$_queue_list$_tail(); + }, + set$_queue_list$_tail(value) { + this._queue_list$_delegate.set$_queue_list$_tail(value); + } + }; + A._QueueList_Object_ListMixin.prototype = {}; + A.UnionSet.prototype = { + get$length(_) { + var t1 = this.get$_union_set$_iterable().get$length(0); + return t1; + }, + get$iterator(_) { + var t1 = this.get$_union_set$_iterable(); + return t1.get$iterator(t1); + }, + get$_union_set$_iterable() { + var t1 = this._sets, + t2 = this.$ti._precomputed1, + t3 = A._instanceType(t1)._eval$1("@<1>")._bind$1(t2)._eval$1("ExpandIterable<1,2>"); + t2 = A.LinkedHashSet_LinkedHashSet$_empty(t2); + return new A.WhereIterable(new A.ExpandIterable(t1, new A.UnionSet__iterable_closure(this), t3), t2.get$add(t2), t3._eval$1("WhereIterable")); + }, + contains$1(_, element) { + return this._sets.any$1(0, new A.UnionSet_contains_closure(this, element)); + }, + toSet$0(_) { + var t2, t3, t4, + t1 = A.LinkedHashSet_LinkedHashSet$_empty(this.$ti._precomputed1); + for (t2 = this._sets, t2 = A._LinkedHashSetIterator$(t2, t2._collection$_modifications, A._instanceType(t2)._precomputed1), t3 = t2.$ti._precomputed1; t2.moveNext$0();) { + t4 = t2._collection$_current; + t1.addAll$1(0, t4 == null ? t3._as(t4) : t4); + } + return t1; + } + }; + A.UnionSet__iterable_closure.prototype = { + call$1(set) { + return set; + }, + $signature() { + return this.$this.$ti._eval$1("Set<1>(Set<1>)"); + } + }; + A.UnionSet_contains_closure.prototype = { + call$1(set) { + return set.contains$1(0, this.element); + }, + $signature() { + return this.$this.$ti._eval$1("bool(Set<1>)"); + } + }; + A._UnionSet_SetBase_UnmodifiableSetMixin.prototype = {}; + A.UnmodifiableSetView0.prototype = {}; + A.UnmodifiableSetMixin.prototype = { + add$1(_, value) { + return A.UnmodifiableSetMixin__throw(); + }, + addAll$1(_, elements) { + return A.UnmodifiableSetMixin__throw(); + }, + remove$1(_, value) { + return A.UnmodifiableSetMixin__throw(); + } + }; + A._UnmodifiableSetView_DelegatingSet_UnmodifiableSetMixin.prototype = {}; + A._DelegatingIterableBase.prototype = { + any$1(_, test) { + return J.any$1$ax(this.get$_base(), test); + }, + contains$1(_, element) { + return J.contains$1$asx(this.get$_base(), element); + }, + elementAt$1(_, index) { + return J.elementAt$1$ax(this.get$_base(), index); + }, + every$1(_, test) { + return J.every$1$ax(this.get$_base(), test); + }, + get$first(_) { + return J.get$first$ax(this.get$_base()); + }, + get$isEmpty(_) { + return J.get$isEmpty$asx(this.get$_base()); + }, + get$isNotEmpty(_) { + return J.get$isNotEmpty$asx(this.get$_base()); + }, + get$iterator(_) { + return J.get$iterator$ax(this.get$_base()); + }, + get$last(_) { + return J.get$last$ax(this.get$_base()); + }, + get$length(_) { + return J.get$length$asx(this.get$_base()); + }, + map$1$1(_, f, $T) { + return J.map$1$1$ax(this.get$_base(), f, $T); + }, + get$single(_) { + return J.get$single$ax(this.get$_base()); + }, + skip$1(_, n) { + return J.skip$1$ax(this.get$_base(), n); + }, + take$1(_, n) { + return J.take$1$ax(this.get$_base(), n); + }, + toList$1$growable(_, growable) { + return J.toList$1$growable$ax(this.get$_base(), true); + }, + toList$0(_) { + return this.toList$1$growable(0, true); + }, + toSet$0(_) { + return J.toSet$0$ax(this.get$_base()); + }, + where$1(_, test) { + return J.where$1$ax(this.get$_base(), test); + }, + toString$0(_) { + return J.toString$0$(this.get$_base()); + }, + $isIterable: 1 + }; + A.DelegatingSet.prototype = { + add$1(_, value) { + return this._base.add$1(0, value); + }, + addAll$1(_, elements) { + this._base.addAll$1(0, elements); + }, + toSet$0(_) { + return new A.DelegatingSet(this._base.toSet$0(0), A._instanceType(this)._eval$1("DelegatingSet<1>")); + }, + $isEfficientLengthIterable: 1, + $isSet: 1, + get$_base() { + return this._base; + } + }; + A.MapKeySet.prototype = { + get$_base() { + var t1 = this._baseMap; + return t1.get$keys(t1); + }, + contains$1(_, element) { + return this._baseMap.containsKey$1(element); + }, + get$isEmpty(_) { + var t1 = this._baseMap; + return t1.get$isEmpty(t1); + }, + get$isNotEmpty(_) { + var t1 = this._baseMap; + return t1.get$isNotEmpty(t1); + }, + get$length(_) { + var t1 = this._baseMap; + return t1.get$length(t1); + }, + toString$0(_) { + return A.Iterable_iterableToFullString(this, "{", "}"); + }, + difference$1(other) { + return J.where$1$ax(this.get$_base(), new A.MapKeySet_difference_closure(this, other)).toSet$0(0); + }, + $isEfficientLengthIterable: 1, + $isSet: 1 + }; + A.MapKeySet_difference_closure.prototype = { + call$1(element) { + return !this.other._source.contains$1(0, element); + }, + $signature() { + return this.$this.$ti._eval$1("bool(1)"); + } + }; + A._MapKeySet__DelegatingIterableBase_UnmodifiableSetMixin.prototype = {}; + A.BufferModule.prototype = {}; + A.BufferConstants.prototype = {}; + A.Buffer.prototype = {}; + A.ConsoleModule.prototype = {}; + A.Console.prototype = {}; + A.EventEmitter.prototype = {}; + A.FS.prototype = {}; + A.FSConstants.prototype = {}; + A.FSWatcher.prototype = {}; + A.ReadStream.prototype = {}; + A.ReadStreamOptions.prototype = {}; + A.WriteStream.prototype = {}; + A.WriteStreamOptions.prototype = {}; + A.FileOptions.prototype = {}; + A.StatOptions.prototype = {}; + A.MkdirOptions.prototype = {}; + A.RmdirOptions.prototype = {}; + A.WatchOptions.prototype = {}; + A.WatchFileOptions.prototype = {}; + A.Stats.prototype = {}; + A.Promise.prototype = {}; + A.Date.prototype = {}; + A.JsError.prototype = {}; + A.Atomics.prototype = {}; + A.Modules.prototype = {}; + A.Module.prototype = {}; + A.Net.prototype = {}; + A.Socket.prototype = {}; + A.NetAddress.prototype = {}; + A.NetServer.prototype = {}; + A.NodeJsError.prototype = {}; + A.JsAssertionError.prototype = {}; + A.JsRangeError.prototype = {}; + A.JsReferenceError.prototype = {}; + A.JsSyntaxError.prototype = {}; + A.JsTypeError.prototype = {}; + A.JsSystemError.prototype = {}; + A.Process.prototype = {}; + A.CPUUsage.prototype = {}; + A.Release.prototype = {}; + A.StreamModule.prototype = {}; + A.Readable.prototype = {}; + A.Writable.prototype = {}; + A.Duplex.prototype = {}; + A.Transform.prototype = {}; + A.WritableOptions.prototype = {}; + A.ReadableOptions.prototype = {}; + A.Immediate.prototype = {}; + A.Timeout.prototype = {}; + A.TTY.prototype = {}; + A.TTYReadStream.prototype = {}; + A.TTYWriteStream.prototype = {}; + A.Util.prototype = {}; + A.promiseToFuture_closure.prototype = { + call$1(value) { + this.completer.complete$1(value); + }, + $signature: 54 + }; + A.promiseToFuture_closure0.prototype = { + call$1(error) { + this.completer.completeError$1(error); + }, + $signature: 54 + }; + A.futureToPromise_closure.prototype = { + call$2(resolve, reject) { + this.future.then$1$2$onError(0, new A.futureToPromise__closure(resolve, this.T), reject, type$.dynamic); + }, + $signature: 532 + }; + A.futureToPromise__closure.prototype = { + call$1(result) { + return this.resolve.call$1(result); + }, + $signature() { + return this.T._eval$1("@(0)"); + } + }; + A.Context.prototype = { + absolute$15(part1, part2, part3, part4, part5, part6, part7, part8, part9, part10, part11, part12, part13, part14, part15) { + var t1; + A._validateArgList("absolute", A._setArrayType([part1, part2, part3, part4, part5, part6, part7, part8, part9, part10, part11, part12, part13, part14, part15], type$.JSArray_nullable_String)); + if (part2 == null) { + t1 = this.style; + t1 = t1.rootLength$1(part1) > 0 && !t1.isRootRelative$1(part1); + } else + t1 = false; + if (t1) + return part1; + t1 = this._context$_current; + return this.join$16(0, t1 == null ? A.current() : t1, part1, part2, part3, part4, part5, part6, part7, part8, part9, part10, part11, part12, part13, part14, part15); + }, + absolute$1(part1) { + var _null = null; + return this.absolute$15(part1, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null); + }, + dirname$1(path) { + var t1, t2, + parsed = A.ParsedPath_ParsedPath$parse(path, this.style); + parsed.removeTrailingSeparators$0(); + t1 = parsed.parts; + t2 = t1.length; + if (t2 === 0) { + t1 = parsed.root; + return t1 == null ? "." : t1; + } + if (t2 === 1) { + t1 = parsed.root; + return t1 == null ? "." : t1; + } + B.JSArray_methods.removeLast$0(t1); + parsed.separators.pop(); + parsed.removeTrailingSeparators$0(); + return parsed.toString$0(0); + }, + join$16(_, part1, part2, part3, part4, part5, part6, part7, part8, part9, part10, part11, part12, part13, part14, part15, part16) { + var parts = A._setArrayType([part1, part2, part3, part4, part5, part6, part7, part8, part9, part10, part11, part12, part13, part14, part15, part16], type$.JSArray_nullable_String); + A._validateArgList("join", parts); + return this.joinAll$1(new A.WhereTypeIterable(parts, type$.WhereTypeIterable_String)); + }, + join$2(_, part1, part2) { + var _null = null; + return this.join$16(0, part1, part2, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null); + }, + joinAll$1(parts) { + var t1, t2, t3, needsSeparator, isAbsoluteAndNotRootRelative, t4, t5, parsed, path; + for (t1 = J.where$1$ax(parts, new A.Context_joinAll_closure()), t2 = J.get$iterator$ax(t1.__internal$_iterable), t1 = new A.WhereIterator(t2, t1._f), t3 = this.style, needsSeparator = false, isAbsoluteAndNotRootRelative = false, t4 = ""; t1.moveNext$0();) { + t5 = t2.get$current(t2); + if (t3.isRootRelative$1(t5) && isAbsoluteAndNotRootRelative) { + parsed = A.ParsedPath_ParsedPath$parse(t5, t3); + path = t4.charCodeAt(0) == 0 ? t4 : t4; + t4 = B.JSString_methods.substring$2(path, 0, t3.rootLength$2$withDrive(path, true)); + parsed.root = t4; + if (t3.needsSeparator$1(t4)) + parsed.separators[0] = t3.get$separator(t3); + t4 = "" + parsed.toString$0(0); + } else if (t3.rootLength$1(t5) > 0) { + isAbsoluteAndNotRootRelative = !t3.isRootRelative$1(t5); + t4 = "" + t5; + } else { + if (!(t5.length !== 0 && t3.containsSeparator$1(t5[0]))) + if (needsSeparator) + t4 += t3.get$separator(t3); + t4 += t5; + } + needsSeparator = t3.needsSeparator$1(t5); + } + return t4.charCodeAt(0) == 0 ? t4 : t4; + }, + split$1(_, path) { + var parsed = A.ParsedPath_ParsedPath$parse(path, this.style), + t1 = parsed.parts, + t2 = A._arrayInstanceType(t1)._eval$1("WhereIterable<1>"); + t2 = A.List_List$of(new A.WhereIterable(t1, new A.Context_split_closure(), t2), true, t2._eval$1("Iterable.E")); + parsed.parts = t2; + t1 = parsed.root; + if (t1 != null) + B.JSArray_methods.insert$2(t2, 0, t1); + return parsed.parts; + }, + canonicalize$1(_, path) { + var t1, parsed; + path = this.absolute$1(path); + t1 = this.style; + if (t1 !== $.$get$Style_windows() && !this._needsNormalization$1(path)) + return path; + parsed = A.ParsedPath_ParsedPath$parse(path, t1); + parsed.normalize$1$canonicalize(true); + return parsed.toString$0(0); + }, + normalize$1(path) { + var parsed; + if (!this._needsNormalization$1(path)) + return path; + parsed = A.ParsedPath_ParsedPath$parse(path, this.style); + parsed.normalize$0(); + return parsed.toString$0(0); + }, + _needsNormalization$1(path) { + var i, start, previous, t2, t3, previousPrevious, codeUnit, t4, + t1 = this.style, + root = t1.rootLength$1(path); + if (root !== 0) { + if (t1 === $.$get$Style_windows()) + for (i = 0; i < root; ++i) + if (path.charCodeAt(i) === 47) + return true; + start = root; + previous = 47; + } else { + start = 0; + previous = null; + } + for (t2 = new A.CodeUnits(path)._string, t3 = t2.length, i = start, previousPrevious = null; i < t3; ++i, previousPrevious = previous, previous = codeUnit) { + codeUnit = t2.charCodeAt(i); + if (t1.isSeparator$1(codeUnit)) { + if (t1 === $.$get$Style_windows() && codeUnit === 47) + return true; + if (previous != null && t1.isSeparator$1(previous)) + return true; + if (previous === 46) + t4 = previousPrevious == null || previousPrevious === 46 || t1.isSeparator$1(previousPrevious); + else + t4 = false; + if (t4) + return true; + } + } + if (previous == null) + return true; + if (t1.isSeparator$1(previous)) + return true; + if (previous === 46) + t1 = previousPrevious == null || t1.isSeparator$1(previousPrevious) || previousPrevious === 46; + else + t1 = false; + if (t1) + return true; + return false; + }, + relative$2$from(path, from) { + var fromParsed, pathParsed, t2, t3, _this = this, + _s26_ = 'Unable to find a path to "', + t1 = from == null; + if (t1 && _this.style.rootLength$1(path) <= 0) + return _this.normalize$1(path); + if (t1) { + t1 = _this._context$_current; + from = t1 == null ? A.current() : t1; + } else + from = _this.absolute$1(from); + t1 = _this.style; + if (t1.rootLength$1(from) <= 0 && t1.rootLength$1(path) > 0) + return _this.normalize$1(path); + if (t1.rootLength$1(path) <= 0 || t1.isRootRelative$1(path)) + path = _this.absolute$1(path); + if (t1.rootLength$1(path) <= 0 && t1.rootLength$1(from) > 0) + throw A.wrapException(A.PathException$(_s26_ + path + '" from "' + from + '".')); + fromParsed = A.ParsedPath_ParsedPath$parse(from, t1); + fromParsed.normalize$0(); + pathParsed = A.ParsedPath_ParsedPath$parse(path, t1); + pathParsed.normalize$0(); + t2 = fromParsed.parts; + if (t2.length !== 0 && J.$eq$(t2[0], ".")) + return pathParsed.toString$0(0); + t2 = fromParsed.root; + t3 = pathParsed.root; + if (t2 != t3) + t2 = t2 == null || t3 == null || !t1.pathsEqual$2(t2, t3); + else + t2 = false; + if (t2) + return pathParsed.toString$0(0); + while (true) { + t2 = fromParsed.parts; + if (t2.length !== 0) { + t3 = pathParsed.parts; + t2 = t3.length !== 0 && t1.pathsEqual$2(t2[0], t3[0]); + } else + t2 = false; + if (!t2) + break; + B.JSArray_methods.removeAt$1(fromParsed.parts, 0); + B.JSArray_methods.removeAt$1(fromParsed.separators, 1); + B.JSArray_methods.removeAt$1(pathParsed.parts, 0); + B.JSArray_methods.removeAt$1(pathParsed.separators, 1); + } + t2 = fromParsed.parts; + if (t2.length !== 0 && J.$eq$(t2[0], "..")) + throw A.wrapException(A.PathException$(_s26_ + path + '" from "' + from + '".')); + t2 = type$.String; + B.JSArray_methods.insertAll$2(pathParsed.parts, 0, A.List_List$filled(fromParsed.parts.length, "..", false, t2)); + t3 = pathParsed.separators; + t3[0] = ""; + B.JSArray_methods.insertAll$2(t3, 1, A.List_List$filled(fromParsed.parts.length, t1.get$separator(t1), false, t2)); + t1 = pathParsed.parts; + t2 = t1.length; + if (t2 === 0) + return "."; + if (t2 > 1 && J.$eq$(B.JSArray_methods.get$last(t1), ".")) { + B.JSArray_methods.removeLast$0(pathParsed.parts); + t1 = pathParsed.separators; + t1.pop(); + t1.pop(); + t1.push(""); + } + pathParsed.root = ""; + pathParsed.removeTrailingSeparators$0(); + return pathParsed.toString$0(0); + }, + relative$1(path) { + return this.relative$2$from(path, null); + }, + _isWithinOrEquals$2($parent, child) { + var relative, t1, parentIsAbsolute, childIsAbsolute, childIsRootRelative, parentIsRootRelative, result, exception, _this = this; + $parent = $parent; + child = child; + t1 = _this.style; + parentIsAbsolute = t1.rootLength$1($parent) > 0; + childIsAbsolute = t1.rootLength$1(child) > 0; + if (parentIsAbsolute && !childIsAbsolute) { + child = _this.absolute$1(child); + if (t1.isRootRelative$1($parent)) + $parent = _this.absolute$1($parent); + } else if (childIsAbsolute && !parentIsAbsolute) { + $parent = _this.absolute$1($parent); + if (t1.isRootRelative$1(child)) + child = _this.absolute$1(child); + } else if (childIsAbsolute && parentIsAbsolute) { + childIsRootRelative = t1.isRootRelative$1(child); + parentIsRootRelative = t1.isRootRelative$1($parent); + if (childIsRootRelative && !parentIsRootRelative) + child = _this.absolute$1(child); + else if (parentIsRootRelative && !childIsRootRelative) + $parent = _this.absolute$1($parent); + } + result = _this._isWithinOrEqualsFast$2($parent, child); + if (result !== B._PathRelation_inconclusive) + return result; + relative = null; + try { + relative = _this.relative$2$from(child, $parent); + } catch (exception) { + if (A.unwrapException(exception) instanceof A.PathException) + return B._PathRelation_different; + else + throw exception; + } + if (t1.rootLength$1(relative) > 0) + return B._PathRelation_different; + if (J.$eq$(relative, ".")) + return B._PathRelation_equal; + if (J.$eq$(relative, "..")) + return B._PathRelation_different; + return J.get$length$asx(relative) >= 3 && J.startsWith$1$s(relative, "..") && t1.isSeparator$1(J.codeUnitAt$1$s(relative, 2)) ? B._PathRelation_different : B._PathRelation_within; + }, + _isWithinOrEqualsFast$2($parent, child) { + var t1, parentRootLength, childRootLength, i, t2, t3, childIndex, parentIndex, lastCodeUnit, lastParentSeparator, parentCodeUnit, childCodeUnit, parentIndex0, direction, _this = this; + if ($parent === ".") + $parent = ""; + t1 = _this.style; + parentRootLength = t1.rootLength$1($parent); + childRootLength = t1.rootLength$1(child); + if (parentRootLength !== childRootLength) + return B._PathRelation_different; + for (i = 0; i < parentRootLength; ++i) + if (!t1.codeUnitsEqual$2($parent.charCodeAt(i), child.charCodeAt(i))) + return B._PathRelation_different; + t2 = child.length; + t3 = $parent.length; + childIndex = childRootLength; + parentIndex = parentRootLength; + lastCodeUnit = 47; + lastParentSeparator = null; + while (true) { + if (!(parentIndex < t3 && childIndex < t2)) + break; + c$0: { + parentCodeUnit = $parent.charCodeAt(parentIndex); + childCodeUnit = child.charCodeAt(childIndex); + if (t1.codeUnitsEqual$2(parentCodeUnit, childCodeUnit)) { + if (t1.isSeparator$1(parentCodeUnit)) + lastParentSeparator = parentIndex; + ++parentIndex; + ++childIndex; + lastCodeUnit = parentCodeUnit; + break c$0; + } + if (t1.isSeparator$1(parentCodeUnit) && t1.isSeparator$1(lastCodeUnit)) { + parentIndex0 = parentIndex + 1; + lastParentSeparator = parentIndex; + parentIndex = parentIndex0; + break c$0; + } else if (t1.isSeparator$1(childCodeUnit) && t1.isSeparator$1(lastCodeUnit)) { + ++childIndex; + break c$0; + } + if (parentCodeUnit === 46 && t1.isSeparator$1(lastCodeUnit)) { + ++parentIndex; + if (parentIndex === t3) + break; + parentCodeUnit = $parent.charCodeAt(parentIndex); + if (t1.isSeparator$1(parentCodeUnit)) { + parentIndex0 = parentIndex + 1; + lastParentSeparator = parentIndex; + parentIndex = parentIndex0; + break c$0; + } + if (parentCodeUnit === 46) { + ++parentIndex; + if (parentIndex === t3 || t1.isSeparator$1($parent.charCodeAt(parentIndex))) + return B._PathRelation_inconclusive; + } + } + if (childCodeUnit === 46 && t1.isSeparator$1(lastCodeUnit)) { + ++childIndex; + if (childIndex === t2) + break; + childCodeUnit = child.charCodeAt(childIndex); + if (t1.isSeparator$1(childCodeUnit)) { + ++childIndex; + break c$0; + } + if (childCodeUnit === 46) { + ++childIndex; + if (childIndex === t2 || t1.isSeparator$1(child.charCodeAt(childIndex))) + return B._PathRelation_inconclusive; + } + } + if (_this._pathDirection$2(child, childIndex) !== B._PathDirection_988) + return B._PathRelation_inconclusive; + if (_this._pathDirection$2($parent, parentIndex) !== B._PathDirection_988) + return B._PathRelation_inconclusive; + return B._PathRelation_different; + } + } + if (childIndex === t2) { + if (parentIndex === t3 || t1.isSeparator$1($parent.charCodeAt(parentIndex))) + lastParentSeparator = parentIndex; + else if (lastParentSeparator == null) + lastParentSeparator = Math.max(0, parentRootLength - 1); + direction = _this._pathDirection$2($parent, lastParentSeparator); + if (direction === B._PathDirection_8Gl) + return B._PathRelation_equal; + return direction === B._PathDirection_ZGD ? B._PathRelation_inconclusive : B._PathRelation_different; + } + direction = _this._pathDirection$2(child, childIndex); + if (direction === B._PathDirection_8Gl) + return B._PathRelation_equal; + if (direction === B._PathDirection_ZGD) + return B._PathRelation_inconclusive; + return t1.isSeparator$1(child.charCodeAt(childIndex)) || t1.isSeparator$1(lastCodeUnit) ? B._PathRelation_within : B._PathRelation_different; + }, + _pathDirection$2(path, index) { + var t1, t2, i, depth, reachedRoot, i0, t3; + for (t1 = path.length, t2 = this.style, i = index, depth = 0, reachedRoot = false; i < t1;) { + while (true) { + if (!(i < t1 && t2.isSeparator$1(path.charCodeAt(i)))) + break; + ++i; + } + if (i === t1) + break; + i0 = i; + while (true) { + if (!(i0 < t1 && !t2.isSeparator$1(path.charCodeAt(i0)))) + break; + ++i0; + } + t3 = i0 - i; + if (!(t3 === 1 && path.charCodeAt(i) === 46)) + if (t3 === 2 && path.charCodeAt(i) === 46 && path.charCodeAt(i + 1) === 46) { + --depth; + if (depth < 0) + break; + if (depth === 0) + reachedRoot = true; + } else + ++depth; + if (i0 === t1) + break; + i = i0 + 1; + } + if (depth < 0) + return B._PathDirection_ZGD; + if (depth === 0) + return B._PathDirection_8Gl; + if (reachedRoot) + return B._PathDirection_FIw; + return B._PathDirection_988; + }, + hash$1(path) { + var result, parsed, t1, _this = this; + path = _this.absolute$1(path); + result = _this._hashFast$1(path); + if (result != null) + return result; + parsed = A.ParsedPath_ParsedPath$parse(path, _this.style); + parsed.normalize$0(); + t1 = _this._hashFast$1(parsed.toString$0(0)); + t1.toString; + return t1; + }, + _hashFast$1(path) { + var t1, t2, hash, beginning, wasSeparator, i, codeUnit, t3, next; + for (t1 = path.length, t2 = this.style, hash = 4603, beginning = true, wasSeparator = true, i = 0; i < t1; ++i) { + codeUnit = t2.canonicalizeCodeUnit$1(path.charCodeAt(i)); + if (t2.isSeparator$1(codeUnit)) { + wasSeparator = true; + continue; + } + if (codeUnit === 46 && wasSeparator) { + t3 = i + 1; + if (t3 === t1) + break; + next = path.charCodeAt(t3); + if (t2.isSeparator$1(next)) + continue; + if (!beginning) + if (next === 46) { + t3 = i + 2; + t3 = t3 === t1 || t2.isSeparator$1(path.charCodeAt(t3)); + } else + t3 = false; + else + t3 = false; + if (t3) + return null; + } + hash = ((hash & 67108863) * 33 ^ codeUnit) >>> 0; + beginning = false; + wasSeparator = false; + } + return hash; + }, + withoutExtension$1(path) { + var i, + parsed = A.ParsedPath_ParsedPath$parse(path, this.style); + for (i = parsed.parts.length - 1; i >= 0; --i) + if (J.get$length$asx(parsed.parts[i]) !== 0) { + parsed.parts[i] = parsed._splitExtension$0()[0]; + break; + } + return parsed.toString$0(0); + }, + toUri$1(path) { + var t2, + t1 = this.style; + if (t1.rootLength$1(path) <= 0) + return t1.relativePathToUri$1(path); + else { + t2 = this._context$_current; + return t1.absolutePathToUri$1(this.join$2(0, t2 == null ? A.current() : t2, path)); + } + }, + prettyUri$1(uri) { + var path, rel, _this = this, + typedUri = A._parseUri(uri); + if (typedUri.get$scheme() === "file" && _this.style === $.$get$Style_url()) + return typedUri.toString$0(0); + else if (typedUri.get$scheme() !== "file" && typedUri.get$scheme() !== "" && _this.style !== $.$get$Style_url()) + return typedUri.toString$0(0); + path = _this.normalize$1(_this.style.pathFromUri$1(A._parseUri(typedUri))); + rel = _this.relative$1(path); + return _this.split$1(0, rel).length > _this.split$1(0, path).length ? path : rel; + } + }; + A.Context_joinAll_closure.prototype = { + call$1(part) { + return part !== ""; + }, + $signature: 4 + }; + A.Context_split_closure.prototype = { + call$1(part) { + return part.length !== 0; + }, + $signature: 4 + }; + A._validateArgList_closure.prototype = { + call$1(arg) { + return arg == null ? "null" : '"' + arg + '"'; + }, + $signature: 524 + }; + A._PathDirection.prototype = { + toString$0(_) { + return this.name; + } + }; + A._PathRelation.prototype = { + toString$0(_) { + return this.name; + } + }; + A.InternalStyle.prototype = { + getRoot$1(path) { + var $length = this.rootLength$1(path); + if ($length > 0) + return B.JSString_methods.substring$2(path, 0, $length); + return this.isRootRelative$1(path) ? path[0] : null; + }, + relativePathToUri$1(path) { + var segments, _null = null, + t1 = path.length; + if (t1 === 0) + return A._Uri__Uri(_null, _null, _null, _null); + segments = A.Context_Context(this).split$1(0, path); + if (this.isSeparator$1(path.charCodeAt(t1 - 1))) + B.JSArray_methods.add$1(segments, ""); + return A._Uri__Uri(_null, _null, segments, _null); + }, + codeUnitsEqual$2(codeUnit1, codeUnit2) { + return codeUnit1 === codeUnit2; + }, + pathsEqual$2(path1, path2) { + return path1 === path2; + }, + canonicalizeCodeUnit$1(codeUnit) { + return codeUnit; + }, + canonicalizePart$1(part) { + return part; + } + }; + A.ParsedPath.prototype = { + get$basename() { + var _this = this, + t1 = type$.String, + copy = new A.ParsedPath(_this.style, _this.root, _this.isRootRelative, A.List_List$from(_this.parts, true, t1), A.List_List$from(_this.separators, true, t1)); + copy.removeTrailingSeparators$0(); + t1 = copy.parts; + if (t1.length === 0) { + t1 = _this.root; + return t1 == null ? "" : t1; + } + return B.JSArray_methods.get$last(t1); + }, + get$hasTrailingSeparator() { + var t1 = this.parts; + if (t1.length !== 0) + t1 = J.$eq$(B.JSArray_methods.get$last(t1), "") || !J.$eq$(B.JSArray_methods.get$last(this.separators), ""); + else + t1 = false; + return t1; + }, + removeTrailingSeparators$0() { + var t1, t2, _this = this; + while (true) { + t1 = _this.parts; + if (!(t1.length !== 0 && J.$eq$(B.JSArray_methods.get$last(t1), ""))) + break; + B.JSArray_methods.removeLast$0(_this.parts); + _this.separators.pop(); + } + t1 = _this.separators; + t2 = t1.length; + if (t2 !== 0) + t1[t2 - 1] = ""; + }, + normalize$1$canonicalize(canonicalize) { + var t1, t2, t3, leadingDoubles, _i, part, t4, _this = this, + newParts = A._setArrayType([], type$.JSArray_String); + for (t1 = _this.parts, t2 = t1.length, t3 = _this.style, leadingDoubles = 0, _i = 0; _i < t1.length; t1.length === t2 || (0, A.throwConcurrentModificationError)(t1), ++_i) { + part = t1[_i]; + t4 = J.getInterceptor$(part); + if (!(t4.$eq(part, ".") || t4.$eq(part, ""))) + if (t4.$eq(part, "..")) + if (newParts.length !== 0) + newParts.pop(); + else + ++leadingDoubles; + else + newParts.push(canonicalize ? t3.canonicalizePart$1(part) : part); + } + if (_this.root == null) + B.JSArray_methods.insertAll$2(newParts, 0, A.List_List$filled(leadingDoubles, "..", false, type$.String)); + if (newParts.length === 0 && _this.root == null) + newParts.push("."); + _this.parts = newParts; + _this.separators = A.List_List$filled(newParts.length + 1, t3.get$separator(t3), true, type$.String); + t1 = _this.root; + if (t1 == null || newParts.length === 0 || !t3.needsSeparator$1(t1)) + _this.separators[0] = ""; + t1 = _this.root; + if (t1 != null && t3 === $.$get$Style_windows()) { + if (canonicalize) + t1 = _this.root = t1.toLowerCase(); + t1.toString; + _this.root = A.stringReplaceAllUnchecked(t1, "/", "\\"); + } + _this.removeTrailingSeparators$0(); + }, + normalize$0() { + return this.normalize$1$canonicalize(false); + }, + toString$0(_) { + var i, _this = this, + t1 = _this.root; + t1 = t1 != null ? "" + t1 : ""; + for (i = 0; i < _this.parts.length; ++i) + t1 = t1 + A.S(_this.separators[i]) + A.S(_this.parts[i]); + t1 += A.S(B.JSArray_methods.get$last(_this.separators)); + return t1.charCodeAt(0) == 0 ? t1 : t1; + }, + _kthLastIndexOf$3(path, character, k) { + var index, count, leftMostIndexedCharacter; + for (index = path.length - 1, count = 0, leftMostIndexedCharacter = 0; index >= 0; --index) + if (path[index] === character) { + ++count; + if (count === k) + return index; + leftMostIndexedCharacter = index; + } + return leftMostIndexedCharacter; + }, + _splitExtension$1(level) { + var t1, file, lastDot; + if (level <= 0) + throw A.wrapException(A.RangeError$value(level, "level", "level's value must be greater than 0")); + t1 = this.parts; + t1 = new A.CastList(t1, A._arrayInstanceType(t1)._eval$1("CastList<1,String?>")); + file = t1.lastWhere$2$orElse(t1, new A.ParsedPath__splitExtension_closure(), new A.ParsedPath__splitExtension_closure0()); + if (file == null) + return A._setArrayType(["", ""], type$.JSArray_String); + if (file === "..") + return A._setArrayType(["..", ""], type$.JSArray_String); + lastDot = this._kthLastIndexOf$3(file, ".", level); + if (lastDot <= 0) + return A._setArrayType([file, ""], type$.JSArray_String); + return A._setArrayType([B.JSString_methods.substring$2(file, 0, lastDot), B.JSString_methods.substring$1(file, lastDot)], type$.JSArray_String); + }, + _splitExtension$0() { + return this._splitExtension$1(1); + } + }; + A.ParsedPath__splitExtension_closure.prototype = { + call$1(p) { + return p !== ""; + }, + $signature: 180 + }; + A.ParsedPath__splitExtension_closure0.prototype = { + call$0() { + return null; + }, + $signature: 1 + }; + A.PathException.prototype = { + toString$0(_) { + return "PathException: " + this.message; + }, + $isException: 1, + get$message(receiver) { + return this.message; + } + }; + A.PathMap.prototype = {}; + A.PathMap__create_closure.prototype = { + call$2(path1, path2) { + if (path1 == null) + return path2 == null; + if (path2 == null) + return false; + return this._box_0.context._isWithinOrEquals$2(path1, path2) === B._PathRelation_equal; + }, + $signature: 523 + }; + A.PathMap__create_closure0.prototype = { + call$1(path) { + return path == null ? 0 : this._box_0.context.hash$1(path); + }, + $signature: 522 + }; + A.PathMap__create_closure1.prototype = { + call$1(path) { + return typeof path == "string" || path == null; + }, + $signature: 134 + }; + A.Style.prototype = { + toString$0(_) { + return this.get$name(this); + } + }; + A.PosixStyle.prototype = { + containsSeparator$1(path) { + return B.JSString_methods.contains$1(path, "/"); + }, + isSeparator$1(codeUnit) { + return codeUnit === 47; + }, + needsSeparator$1(path) { + var t1 = path.length; + return t1 !== 0 && path.charCodeAt(t1 - 1) !== 47; + }, + rootLength$2$withDrive(path, withDrive) { + if (path.length !== 0 && path.charCodeAt(0) === 47) + return 1; + return 0; + }, + rootLength$1(path) { + return this.rootLength$2$withDrive(path, false); + }, + isRootRelative$1(path) { + return false; + }, + pathFromUri$1(uri) { + var t1; + if (uri.get$scheme() === "" || uri.get$scheme() === "file") { + t1 = uri.get$path(uri); + return A._Uri__uriDecode(t1, 0, t1.length, B.C_Utf8Codec, false); + } + throw A.wrapException(A.ArgumentError$("Uri " + uri.toString$0(0) + " must have scheme 'file:'.", null)); + }, + absolutePathToUri$1(path) { + var parsed = A.ParsedPath_ParsedPath$parse(path, this), + t1 = parsed.parts; + if (t1.length === 0) + B.JSArray_methods.addAll$1(t1, A._setArrayType(["", ""], type$.JSArray_String)); + else if (parsed.get$hasTrailingSeparator()) + B.JSArray_methods.add$1(parsed.parts, ""); + return A._Uri__Uri(null, null, parsed.parts, "file"); + }, + get$name() { + return "posix"; + }, + get$separator() { + return "/"; + } + }; + A.UrlStyle.prototype = { + containsSeparator$1(path) { + return B.JSString_methods.contains$1(path, "/"); + }, + isSeparator$1(codeUnit) { + return codeUnit === 47; + }, + needsSeparator$1(path) { + var t1 = path.length; + if (t1 === 0) + return false; + if (path.charCodeAt(t1 - 1) !== 47) + return true; + return B.JSString_methods.endsWith$1(path, "://") && this.rootLength$1(path) === t1; + }, + rootLength$2$withDrive(path, withDrive) { + var i, codeUnit, index, + t1 = path.length; + if (t1 === 0) + return 0; + if (path.charCodeAt(0) === 47) + return 1; + for (i = 0; i < t1; ++i) { + codeUnit = path.charCodeAt(i); + if (codeUnit === 47) + return 0; + if (codeUnit === 58) { + if (i === 0) + return 0; + index = B.JSString_methods.indexOf$2(path, "/", B.JSString_methods.startsWith$2(path, "//", i + 1) ? i + 3 : i); + if (index <= 0) + return t1; + if (!withDrive || t1 < index + 3) + return index; + if (!B.JSString_methods.startsWith$1(path, "file://")) + return index; + t1 = A.driveLetterEnd(path, index + 1); + return t1 == null ? index : t1; + } + } + return 0; + }, + rootLength$1(path) { + return this.rootLength$2$withDrive(path, false); + }, + isRootRelative$1(path) { + return path.length !== 0 && path.charCodeAt(0) === 47; + }, + pathFromUri$1(uri) { + return uri.toString$0(0); + }, + relativePathToUri$1(path) { + return A.Uri_parse(path); + }, + absolutePathToUri$1(path) { + return A.Uri_parse(path); + }, + get$name() { + return "url"; + }, + get$separator() { + return "/"; + } + }; + A.WindowsStyle.prototype = { + containsSeparator$1(path) { + return B.JSString_methods.contains$1(path, "/"); + }, + isSeparator$1(codeUnit) { + return codeUnit === 47 || codeUnit === 92; + }, + needsSeparator$1(path) { + var t1 = path.length; + if (t1 === 0) + return false; + t1 = path.charCodeAt(t1 - 1); + return !(t1 === 47 || t1 === 92); + }, + rootLength$2$withDrive(path, withDrive) { + var index, + t1 = path.length; + if (t1 === 0) + return 0; + if (path.charCodeAt(0) === 47) + return 1; + if (path.charCodeAt(0) === 92) { + if (t1 < 2 || path.charCodeAt(1) !== 92) + return 1; + index = B.JSString_methods.indexOf$2(path, "\\", 2); + if (index > 0) { + index = B.JSString_methods.indexOf$2(path, "\\", index + 1); + if (index > 0) + return index; + } + return t1; + } + if (t1 < 3) + return 0; + if (!A.isAlphabetic(path.charCodeAt(0))) + return 0; + if (path.charCodeAt(1) !== 58) + return 0; + t1 = path.charCodeAt(2); + if (!(t1 === 47 || t1 === 92)) + return 0; + return 3; + }, + rootLength$1(path) { + return this.rootLength$2$withDrive(path, false); + }, + isRootRelative$1(path) { + return this.rootLength$1(path) === 1; + }, + pathFromUri$1(uri) { + var path, t1; + if (uri.get$scheme() !== "" && uri.get$scheme() !== "file") + throw A.wrapException(A.ArgumentError$("Uri " + uri.toString$0(0) + " must have scheme 'file:'.", null)); + path = uri.get$path(uri); + if (uri.get$host() === "") { + if (path.length >= 3 && B.JSString_methods.startsWith$1(path, "/") && A.driveLetterEnd(path, 1) != null) + path = B.JSString_methods.replaceFirst$2(path, "/", ""); + } else + path = "\\\\" + uri.get$host() + path; + t1 = A.stringReplaceAllUnchecked(path, "/", "\\"); + return A._Uri__uriDecode(t1, 0, t1.length, B.C_Utf8Codec, false); + }, + absolutePathToUri$1(path) { + var rootParts, t2, + parsed = A.ParsedPath_ParsedPath$parse(path, this), + t1 = parsed.root; + t1.toString; + if (B.JSString_methods.startsWith$1(t1, "\\\\")) { + rootParts = new A.WhereIterable(A._setArrayType(t1.split("\\"), type$.JSArray_String), new A.WindowsStyle_absolutePathToUri_closure(), type$.WhereIterable_String); + B.JSArray_methods.insert$2(parsed.parts, 0, rootParts.get$last(0)); + if (parsed.get$hasTrailingSeparator()) + B.JSArray_methods.add$1(parsed.parts, ""); + return A._Uri__Uri(rootParts.get$first(0), null, parsed.parts, "file"); + } else { + if (parsed.parts.length === 0 || parsed.get$hasTrailingSeparator()) + B.JSArray_methods.add$1(parsed.parts, ""); + t1 = parsed.parts; + t2 = parsed.root; + t2.toString; + t2 = A.stringReplaceAllUnchecked(t2, "/", ""); + B.JSArray_methods.insert$2(t1, 0, A.stringReplaceAllUnchecked(t2, "\\", "")); + return A._Uri__Uri(null, null, parsed.parts, "file"); + } + }, + codeUnitsEqual$2(codeUnit1, codeUnit2) { + var upperCase1; + if (codeUnit1 === codeUnit2) + return true; + if (codeUnit1 === 47) + return codeUnit2 === 92; + if (codeUnit1 === 92) + return codeUnit2 === 47; + if ((codeUnit1 ^ codeUnit2) !== 32) + return false; + upperCase1 = codeUnit1 | 32; + return upperCase1 >= 97 && upperCase1 <= 122; + }, + pathsEqual$2(path1, path2) { + var t1, i; + if (path1 === path2) + return true; + t1 = path1.length; + if (t1 !== path2.length) + return false; + for (i = 0; i < t1; ++i) + if (!this.codeUnitsEqual$2(path1.charCodeAt(i), path2.charCodeAt(i))) + return false; + return true; + }, + canonicalizeCodeUnit$1(codeUnit) { + if (codeUnit === 47) + return 92; + if (codeUnit < 65) + return codeUnit; + if (codeUnit > 90) + return codeUnit; + return codeUnit | 32; + }, + canonicalizePart$1(part) { + return part.toLowerCase(); + }, + get$name() { + return "windows"; + }, + get$separator() { + return "\\"; + } + }; + A.WindowsStyle_absolutePathToUri_closure.prototype = { + call$1(part) { + return part !== ""; + }, + $signature: 4 + }; + A.Version.prototype = { + get$min() { + return this; + }, + get$max() { + return this; + }, + get$includeMin() { + return true; + }, + get$includeMax() { + return true; + }, + $eq(_, other) { + var _this = this; + if (other == null) + return false; + return other instanceof A.Version && _this.major === other.major && _this.minor === other.minor && _this.patch === other.patch && B.C_IterableEquality.equals$2(0, _this.preRelease, other.preRelease) && B.C_IterableEquality.equals$2(0, _this.build, other.build); + }, + get$hashCode(_) { + var _this = this; + return (_this.major ^ _this.minor ^ _this.patch ^ B.C_IterableEquality.hash$1(_this.preRelease) ^ B.C_IterableEquality.hash$1(_this.build)) >>> 0; + }, + compareTo$1(_, other) { + var t1, t2, t3, comparison, _this = this; + if (other instanceof A.Version) { + t1 = _this.major; + t2 = other.major; + if (t1 !== t2) + return B.JSInt_methods.compareTo$1(t1, t2); + t1 = _this.minor; + t2 = other.minor; + if (t1 !== t2) + return B.JSInt_methods.compareTo$1(t1, t2); + t1 = _this.patch; + t2 = other.patch; + if (t1 !== t2) + return B.JSInt_methods.compareTo$1(t1, t2); + t1 = _this.preRelease; + t2 = t1.length === 0; + if (t2 && other.preRelease.length !== 0) + return 1; + t3 = other.preRelease; + if (t3.length === 0 && !t2) + return -1; + comparison = _this._compareLists$2(t1, t3); + if (comparison !== 0) + return comparison; + t1 = _this.build; + t2 = t1.length === 0; + if (t2 && other.build.length !== 0) + return -1; + t3 = other.build; + if (t3.length === 0 && !t2) + return 1; + return _this._compareLists$2(t1, t3); + } else + return -other.compareTo$1(0, _this); + }, + toString$0(_) { + return this._version$_text; + }, + _compareLists$2(a, b) { + var i, t1, t2, aPart, bPart; + for (i = 0; t1 = a.length, t2 = b.length, i < Math.max(t1, t2); ++i) { + aPart = i < t1 ? a[i] : null; + bPart = i < t2 ? b[i] : null; + if (J.$eq$(aPart, bPart)) + continue; + if (aPart == null) + return -1; + if (bPart == null) + return 1; + if (typeof aPart == "number") + if (typeof bPart == "number") + return B.JSNumber_methods.compareTo$1(aPart, bPart); + else + return -1; + else if (typeof bPart == "number") + return 1; + else { + A._asString(aPart); + A._asString(bPart); + if (aPart === bPart) + t1 = 0; + else + t1 = aPart < bPart ? -1 : 1; + return t1; + } + } + return 0; + }, + $isComparable: 1, + $isVersionRange: 1 + }; + A.Version__splitParts_closure.prototype = { + call$1(part) { + var t1 = A.Primitives_parseInt(part, null); + return t1 == null ? part : t1; + }, + $signature: 519 + }; + A.VersionRange.prototype = { + $eq(_, other) { + var t1; + if (other == null) + return false; + if (!type$.VersionRange._is(other)) + return false; + if (this.min == other.get$min()) + if (J.$eq$(this.max, other.get$max())) + if (!other.get$includeMin()) { + other.get$includeMax(); + t1 = true; + } else + t1 = false; + else + t1 = false; + else + t1 = false; + return t1; + }, + get$hashCode(_) { + var t1 = B.JSNull_methods.get$hashCode(this.min), + t2 = J.get$hashCode$(this.max); + return (t1 ^ t2 * 3 ^ 1090795 ^ 3633126) >>> 0; + }, + allows$1(other) { + var t1 = this.max; + if (t1 != null) + if (other.compareTo$1(0, t1) > 0) + return false; + return true; + }, + compareTo$1(_, other) { + if (other.get$min() == null) + return this._compareMax$1(other); + return -1; + }, + _compareMax$1(other) { + var t2, result, + t1 = this.max; + if (t1 == null) { + if (other.get$max() == null) + return 0; + return 1; + } else if (other.get$max() == null) + return -1; + t2 = other.get$max(); + t2.toString; + result = t1.compareTo$1(0, t2); + if (result !== 0) + return result; + other.get$includeMax(); + return 0; + }, + toString$0(_) { + var t2, + max = this.max, + t1 = max == null; + if (!t1) + t2 = "" + "<=" + max.toString$0(0); + else + t2 = ""; + t1 = t1 ? t2 + "any" : t2; + return t1.charCodeAt(0) == 0 ? t1 : t1; + }, + $isComparable: 1, + get$min() { + return this.min; + }, + get$max() { + return this.max; + }, + get$includeMin() { + return this.includeMin; + }, + get$includeMax() { + return this.includeMax; + } + }; + A.CssMediaQuery.prototype = { + merge$1(other) { + var t1, ourModifier, t2, t3, ourType, t4, theirModifier, t5, t6, theirType, t7, t8, negativeConditions, conditions, type, modifier, fewerConditions, fewerConditions0, moreConditions, _this = this, _null = null, _s3_ = "all"; + if (!_this.conjunction || !other.conjunction) + return B._SingletonCssMediaQueryMergeResult_1; + t1 = _this.modifier; + ourModifier = t1 == null ? _null : t1.toLowerCase(); + t2 = _this.type; + t3 = t2 == null; + ourType = t3 ? _null : t2.toLowerCase(); + t4 = other.modifier; + theirModifier = t4 == null ? _null : t4.toLowerCase(); + t5 = other.type; + t6 = t5 == null; + theirType = t6 ? _null : t5.toLowerCase(); + t7 = ourType == null; + if (t7 && theirType == null) { + t1 = A.List_List$of(_this.conditions, true, type$.String); + B.JSArray_methods.addAll$1(t1, other.conditions); + return new A.MediaQuerySuccessfulMergeResult(A.CssMediaQuery$condition(t1, true)); + } + t8 = ourModifier === "not"; + if (t8 !== (theirModifier === "not")) { + if (ourType == theirType) { + negativeConditions = t8 ? _this.conditions : other.conditions; + if (B.JSArray_methods.every$1(negativeConditions, B.JSArray_methods.get$contains(t8 ? other.conditions : _this.conditions))) + return B._SingletonCssMediaQueryMergeResult_0; + else + return B._SingletonCssMediaQueryMergeResult_1; + } else if (t3 || A.equalsIgnoreCase(t2, _s3_) || t6 || A.equalsIgnoreCase(t5, _s3_)) + return B._SingletonCssMediaQueryMergeResult_1; + if (t8) { + conditions = other.conditions; + type = theirType; + modifier = theirModifier; + } else { + conditions = _this.conditions; + type = ourType; + modifier = ourModifier; + } + } else if (t8) { + if (ourType != theirType) + return B._SingletonCssMediaQueryMergeResult_1; + fewerConditions = _this.conditions; + fewerConditions0 = other.conditions; + t3 = fewerConditions.length > fewerConditions0.length; + moreConditions = t3 ? fewerConditions : fewerConditions0; + if (t3) + fewerConditions = fewerConditions0; + if (!B.JSArray_methods.every$1(fewerConditions, B.JSArray_methods.get$contains(moreConditions))) + return B._SingletonCssMediaQueryMergeResult_1; + conditions = moreConditions; + type = ourType; + modifier = ourModifier; + } else if (t3 || A.equalsIgnoreCase(t2, _s3_)) { + type = (t6 || A.equalsIgnoreCase(t5, _s3_)) && t7 ? _null : theirType; + t3 = A.List_List$of(_this.conditions, true, type$.String); + B.JSArray_methods.addAll$1(t3, other.conditions); + conditions = t3; + modifier = theirModifier; + } else { + if (t6 || A.equalsIgnoreCase(t5, _s3_)) { + t3 = A.List_List$of(_this.conditions, true, type$.String); + B.JSArray_methods.addAll$1(t3, other.conditions); + conditions = t3; + modifier = ourModifier; + } else { + if (ourType != theirType) + return B._SingletonCssMediaQueryMergeResult_0; + else { + modifier = ourModifier == null ? theirModifier : ourModifier; + t3 = A.List_List$of(_this.conditions, true, type$.String); + B.JSArray_methods.addAll$1(t3, other.conditions); + } + conditions = t3; + } + type = ourType; + } + t2 = type == ourType ? t2 : t5; + return new A.MediaQuerySuccessfulMergeResult(A.CssMediaQuery$type(t2, conditions, modifier == ourModifier ? t1 : t4)); + }, + $eq(_, other) { + if (other == null) + return false; + return other instanceof A.CssMediaQuery && other.modifier == this.modifier && other.type == this.type && B.C_ListEquality.equals$2(0, other.conditions, this.conditions); + }, + get$hashCode(_) { + return J.get$hashCode$(this.modifier) ^ J.get$hashCode$(this.type) ^ B.C_ListEquality0.hash$1(this.conditions); + }, + toString$0(_) { + var t2, _this = this, + t1 = _this.modifier; + t1 = t1 != null ? "" + (t1 + " ") : ""; + t2 = _this.type; + if (t2 != null) { + t1 += t2; + if (_this.conditions.length !== 0) + t1 += " and "; + } + t2 = _this.conjunction ? " and " : " or "; + t2 = t1 + B.JSArray_methods.join$1(_this.conditions, t2); + return t2.charCodeAt(0) == 0 ? t2 : t2; + } + }; + A._SingletonCssMediaQueryMergeResult.prototype = { + _enumToString$0() { + return "_SingletonCssMediaQueryMergeResult." + this._name; + } + }; + A.MediaQuerySuccessfulMergeResult.prototype = { + toString$0(_) { + return this.query.toString$0(0); + } + }; + A.ModifiableCssAtRule.prototype = { + accept$1$1(visitor) { + return visitor.visitCssAtRule$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + equalsIgnoringChildren$1(other) { + var t1, t2; + if (other instanceof A.ModifiableCssAtRule) { + t1 = this.name; + t2 = other.name; + t1 = t1.$ti._is(t2) && J.$eq$(t2.value, t1.value) && J.$eq$(this.value, other.value) && this.isChildless === other.isChildless; + } else + t1 = false; + return t1; + }, + copyWithoutChildren$0() { + var _this = this; + return A.ModifiableCssAtRule$(_this.name, _this.span, _this.isChildless, _this.value); + }, + addChild$1(child) { + this.super$ModifiableCssParentNode$addChild(child); + }, + get$isChildless() { + return this.isChildless; + }, + get$span(receiver) { + return this.span; + } + }; + A.ModifiableCssComment.prototype = { + accept$1$1(visitor) { + return visitor.visitCssComment$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + $isCssComment: 1, + get$span(receiver) { + return this.span; + } + }; + A.ModifiableCssDeclaration.prototype = { + accept$1$1(visitor) { + return visitor.visitCssDeclaration$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + toString$0(_) { + return this.name.toString$0(0) + ": " + this.value.toString$0(0) + ";"; + }, + get$span(receiver) { + return this.span; + } + }; + A.ModifiableCssImport.prototype = { + accept$1$1(visitor) { + return visitor.visitCssImport$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + get$span(receiver) { + return this.span; + } + }; + A.ModifiableCssKeyframeBlock.prototype = { + accept$1$1(visitor) { + return visitor.visitCssKeyframeBlock$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + equalsIgnoringChildren$1(other) { + return other instanceof A.ModifiableCssKeyframeBlock && B.C_ListEquality.equals$2(0, this.selector.value, other.selector.value); + }, + copyWithoutChildren$0() { + return A.ModifiableCssKeyframeBlock$(this.selector, this.span); + }, + get$span(receiver) { + return this.span; + } + }; + A.ModifiableCssMediaRule.prototype = { + accept$1$1(visitor) { + return visitor.visitCssMediaRule$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + equalsIgnoringChildren$1(other) { + return other instanceof A.ModifiableCssMediaRule && B.C_ListEquality.equals$2(0, this.queries, other.queries); + }, + copyWithoutChildren$0() { + return A.ModifiableCssMediaRule$(this.queries, this.span); + }, + get$span(receiver) { + return this.span; + } + }; + A.ModifiableCssNode.prototype = { + get$hasFollowingSibling() { + var t2, + t1 = this._parent; + if (t1 == null) + t1 = null; + else { + t1 = t1.children; + t2 = this._indexInParent; + t2.toString; + t1 = A.SubListIterable$(t1, t2 + 1, null, t1.$ti._eval$1("ListBase.E")).any$1(0, new A.ModifiableCssNode_hasFollowingSibling_closure()); + } + return t1 === true; + }, + get$isGroupEnd() { + return this.isGroupEnd; + } + }; + A.ModifiableCssNode_hasFollowingSibling_closure.prototype = { + call$1(sibling) { + return !sibling.accept$1(B._IsInvisibleVisitor_true_false); + }, + $signature: 118 + }; + A.ModifiableCssParentNode.prototype = { + get$isChildless() { + return false; + }, + addChild$1(child) { + var t1; + child._parent = this; + t1 = this._children; + child._indexInParent = t1.length; + t1.push(child); + }, + clearChildren$0() { + var t1, t2, _i, child; + for (t1 = this._children, t2 = t1.length, _i = 0; _i < t2; ++_i) { + child = t1[_i]; + child._indexInParent = child._parent = null; + } + B.JSArray_methods.clear$0(t1); + }, + $isCssParentNode: 1, + get$children(receiver) { + return this.children; + } + }; + A.ModifiableCssStyleRule.prototype = { + accept$1$1(visitor) { + return visitor.visitCssStyleRule$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + equalsIgnoringChildren$1(other) { + var t1; + if (other instanceof A.ModifiableCssStyleRule) + t1 = B.C_ListEquality.equals$2(0, other._style_rule$_selector._box$_inner.value.components, this._style_rule$_selector._box$_inner.value.components); + else + t1 = false; + return t1; + }, + copyWithoutChildren$0() { + return A.ModifiableCssStyleRule$(this._style_rule$_selector, this.span, this.originalSelector); + }, + get$span(receiver) { + return this.span; + } + }; + A.ModifiableCssStylesheet.prototype = { + accept$1$1(visitor) { + return visitor.visitCssStylesheet$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + equalsIgnoringChildren$1(other) { + return other instanceof A.ModifiableCssStylesheet; + }, + copyWithoutChildren$0() { + return A.ModifiableCssStylesheet$(this.span); + }, + $isCssStylesheet: 1, + get$span(receiver) { + return this.span; + } + }; + A.ModifiableCssSupportsRule.prototype = { + accept$1$1(visitor) { + return visitor.visitCssSupportsRule$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + equalsIgnoringChildren$1(other) { + var t1, t2; + if (other instanceof A.ModifiableCssSupportsRule) { + t1 = this.condition; + t2 = other.condition; + t1 = t1.$ti._is(t2) && J.$eq$(t2.value, t1.value); + } else + t1 = false; + return t1; + }, + copyWithoutChildren$0() { + return A.ModifiableCssSupportsRule$(this.condition, this.span); + }, + get$span(receiver) { + return this.span; + } + }; + A.CssNode.prototype = { + toString$0(_) { + return A.serialize(this, true, null, true, null, false, null, true)._0; + }, + $isAstNode: 1 + }; + A.CssParentNode.prototype = {}; + A._IsInvisibleVisitor.prototype = { + visitCssAtRule$1(rule) { + return false; + }, + visitCssComment$1(comment) { + return this.includeComments && comment.text.charCodeAt(2) !== 33; + }, + visitCssStyleRule$1(rule) { + var t1 = rule._style_rule$_selector._box$_inner; + return (this.includeBogus ? t1.value.accept$1(B._IsInvisibleVisitor_true) : t1.value.accept$1(B._IsInvisibleVisitor_false)) || this.super$EveryCssVisitor$visitCssStyleRule(rule); + } + }; + A.__IsInvisibleVisitor_Object_EveryCssVisitor.prototype = {}; + A.CssStylesheet.prototype = { + get$isGroupEnd() { + return false; + }, + get$isChildless() { + return false; + }, + accept$1$1(visitor) { + return visitor.visitCssStylesheet$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + get$children(receiver) { + return this.children; + }, + get$span(receiver) { + return this.span; + } + }; + A.CssValue.prototype = { + $eq(_, other) { + if (other == null) + return false; + return this.$ti._is(other) && J.$eq$(other.value, this.value); + }, + get$hashCode(_) { + return J.get$hashCode$(this.value); + }, + toString$0(_) { + return J.toString$0$(this.value); + }, + $isAstNode: 1, + get$span(receiver) { + return this.span; + } + }; + A._FakeAstNode.prototype = { + get$span(_) { + return this._callback.call$0(); + }, + $isAstNode: 1 + }; + A.Argument.prototype = { + toString$0(_) { + var t1 = this.defaultValue, + t2 = this.name; + return t1 == null ? t2 : t2 + ": " + t1.toString$0(0); + }, + $isAstNode: 1, + get$span(receiver) { + return this.span; + } + }; + A.ArgumentDeclaration.prototype = { + get$spanWithName() { + var t3, t4, + t1 = this.span, + t2 = t1.file, + text = A.String_String$fromCharCodes(B.NativeUint32List_methods.sublist$2(t2._decodedChars, 0, null), 0, null), + i = A.FileLocation$_(t2, t1._file$_start).offset - 1; + while (true) { + if (i > 0) { + t3 = text.charCodeAt(i); + t3 = t3 === 32 || t3 === 9 || t3 === 10 || t3 === 13 || t3 === 12; + } else + t3 = false; + if (!t3) + break; + --i; + } + t3 = text.charCodeAt(i); + if (!(t3 === 95 || A.CharacterExtension_get_isAlphabetic(t3) || t3 >= 128)) + t3 = t3 >= 48 && t3 <= 57 || t3 === 45; + else + t3 = true; + if (!t3) + return t1; + --i; + while (true) { + if (i >= 0) { + t3 = text.charCodeAt(i); + if (t3 !== 95) { + if (!(t3 >= 97 && t3 <= 122)) + t4 = t3 >= 65 && t3 <= 90; + else + t4 = true; + t4 = t4 || t3 >= 128; + } else + t4 = true; + if (!t4) + t3 = t3 >= 48 && t3 <= 57 || t3 === 45; + else + t3 = true; + } else + t3 = false; + if (!t3) + break; + --i; + } + t3 = i + 1; + t4 = text.charCodeAt(t3); + if (!(t4 === 95 || A.CharacterExtension_get_isAlphabetic(t4) || t4 >= 128)) + return t1; + return A.SpanExtensions_trimRight(A.SpanExtensions_trimLeft(t2.span$2(0, t3, A.FileLocation$_(t2, t1._end).offset))); + }, + verify$2(positional, names) { + var t1, t2, t3, namedUsed, i, argument, t4, unknownNames, _this = this, + _s10_ = "invocation", + _s8_ = "argument"; + for (t1 = _this.$arguments, t2 = t1.length, t3 = names._baseMap, namedUsed = 0, i = 0; i < t2; ++i) { + argument = t1[i]; + if (i < positional) { + t4 = argument.name; + if (t3.containsKey$1(t4)) + throw A.wrapException(A.SassScriptException$("Argument " + _this._originalArgumentName$1(t4) + string$.x20was_p, null)); + } else { + t4 = argument.name; + if (t3.containsKey$1(t4)) + ++namedUsed; + else if (argument.defaultValue == null) + throw A.wrapException(A.MultiSpanSassScriptException$("Missing argument " + _this._originalArgumentName$1(t4) + ".", _s10_, A.LinkedHashMap_LinkedHashMap$_literal([_this.get$spanWithName(), "declaration"], type$.FileSpan, type$.String))); + } + } + if (_this.restArgument != null) + return; + if (positional > t2) { + t1 = names.get$isEmpty(0) ? "" : "positional "; + throw A.wrapException(A.MultiSpanSassScriptException$("Only " + t2 + " " + t1 + A.pluralize(_s8_, t2, null) + " allowed, but " + positional + " " + A.pluralize("was", positional, "were") + " passed.", _s10_, A.LinkedHashMap_LinkedHashMap$_literal([_this.get$spanWithName(), "declaration"], type$.FileSpan, type$.String))); + } + if (namedUsed < t3.get$length(t3)) { + t2 = type$.String; + unknownNames = A.LinkedHashSet_LinkedHashSet$of(names, t2); + unknownNames.removeAll$1(new A.MappedListIterable(t1, new A.ArgumentDeclaration_verify_closure(), A._arrayInstanceType(t1)._eval$1("MappedListIterable<1,Object?>"))); + throw A.wrapException(A.MultiSpanSassScriptException$("No " + A.pluralize(_s8_, unknownNames._collection$_length, null) + " named " + A.toSentence(unknownNames.map$1$1(0, new A.ArgumentDeclaration_verify_closure0(), type$.Object), "or") + ".", _s10_, A.LinkedHashMap_LinkedHashMap$_literal([_this.get$spanWithName(), "declaration"], type$.FileSpan, t2))); + } + }, + _originalArgumentName$1($name) { + var t1, text, t2, _i, argument, t3, t4, end, _null = null; + if ($name === this.restArgument) { + t1 = this.span; + text = A.String_String$fromCharCodes(B.NativeUint32List_methods.sublist$2(t1.file._decodedChars, t1._file$_start, t1._end), 0, _null); + return B.JSString_methods.substring$2(B.JSString_methods.substring$1(text, B.JSString_methods.lastIndexOf$1(text, "$")), 0, B.JSString_methods.indexOf$1(text, ".")); + } + for (t1 = this.$arguments, t2 = t1.length, _i = 0; _i < t2; ++_i) { + argument = t1[_i]; + if (argument.name === $name) { + t1 = argument.defaultValue; + t2 = argument.span; + t3 = t2.file; + t4 = t2._file$_start; + t2 = t2._end; + if (t1 == null) { + t1 = t3._decodedChars; + t1 = A.String_String$fromCharCodes(new Uint32Array(t1.subarray(t4, A._checkValidRange(t4, t2, t1.length))), 0, _null); + } else { + t1 = t3._decodedChars; + text = A.String_String$fromCharCodes(new Uint32Array(t1.subarray(t4, A._checkValidRange(t4, t2, t1.length))), 0, _null); + t1 = B.JSString_methods.substring$2(text, 0, B.JSString_methods.indexOf$1(text, ":")); + end = A._lastNonWhitespace(t1, false); + t1 = end == null ? "" : B.JSString_methods.substring$2(t1, 0, end + 1); + } + return t1; + } + } + throw A.wrapException(A.ArgumentError$(string$.This_d + $name + '".', _null)); + }, + matches$2(positional, names) { + var t1, t2, t3, namedUsed, i, argument; + for (t1 = this.$arguments, t2 = t1.length, t3 = names._baseMap, namedUsed = 0, i = 0; i < t2; ++i) { + argument = t1[i]; + if (i < positional) { + if (t3.containsKey$1(argument.name)) + return false; + } else if (t3.containsKey$1(argument.name)) + ++namedUsed; + else if (argument.defaultValue == null) + return false; + } + if (this.restArgument != null) + return true; + if (positional > t2) + return false; + if (namedUsed < t3.get$length(t3)) + return false; + return true; + }, + toString$0(_) { + var t2, t3, _i, + t1 = A._setArrayType([], type$.JSArray_String); + for (t2 = this.$arguments, t3 = t2.length, _i = 0; _i < t3; ++_i) + t1.push("$" + A.S(t2[_i])); + t2 = this.restArgument; + if (t2 != null) + t1.push("$" + t2 + "..."); + return B.JSArray_methods.join$1(t1, ", "); + }, + $isAstNode: 1, + get$span(receiver) { + return this.span; + } + }; + A.ArgumentDeclaration_verify_closure.prototype = { + call$1(argument) { + return argument.name; + }, + $signature: 511 + }; + A.ArgumentDeclaration_verify_closure0.prototype = { + call$1($name) { + return "$" + $name; + }, + $signature: 5 + }; + A.ArgumentInvocation.prototype = { + get$isEmpty(_) { + var t1; + if (this.positional.length === 0) { + t1 = this.named; + t1 = t1.get$isEmpty(t1) && this.rest == null; + } else + t1 = false; + return t1; + }, + toString$0(_) { + var t2, t3, _i, _1_0, _2_0, _this = this, + t1 = A._setArrayType([], type$.JSArray_String); + for (t2 = _this.positional, t3 = t2.length, _i = 0; _i < t3; ++_i) + t1.push(_this._parenthesizeArgument$1(t2[_i])); + for (t2 = A.MapExtensions_get_pairs(_this.named, type$.String, type$.Expression), t2 = t2.get$iterator(t2); t2.moveNext$0();) { + t3 = t2.get$current(t2); + t1.push("$" + t3._0 + ": " + _this._parenthesizeArgument$1(t3._1)); + } + _1_0 = _this.rest; + if (_1_0 != null) + t1.push(_this._parenthesizeArgument$1(_1_0) + "..."); + _2_0 = _this.keywordRest; + if (_2_0 != null) + t1.push(_this._parenthesizeArgument$1(_2_0) + "..."); + return "(" + B.JSArray_methods.join$1(t1, ", ") + ")"; + }, + _parenthesizeArgument$1(argument) { + var t1; + $label0$0: { + if (argument instanceof A.ListExpression && B.ListSeparator_rXA === argument.separator && !argument.hasBrackets && argument.contents.length >= 2) { + t1 = "(" + argument.toString$0(0) + ")"; + break $label0$0; + } + t1 = argument.toString$0(0); + break $label0$0; + } + return t1; + }, + $isAstNode: 1, + get$span(receiver) { + return this.span; + } + }; + A.AtRootQuery.prototype = { + excludes$1(node) { + var t1, _this = this; + if (_this._all) + return !_this.include; + $label0$0: { + if (node instanceof A.ModifiableCssStyleRule) { + t1 = _this._at_root_query$_rule !== _this.include; + break $label0$0; + } + if (node instanceof A.ModifiableCssMediaRule) { + t1 = _this.excludesName$1("media"); + break $label0$0; + } + if (node instanceof A.ModifiableCssSupportsRule) { + t1 = _this.excludesName$1("supports"); + break $label0$0; + } + if (node instanceof A.ModifiableCssAtRule) { + t1 = _this.excludesName$1(node.name.value.toLowerCase()); + break $label0$0; + } + t1 = false; + break $label0$0; + } + return t1; + }, + excludesName$1($name) { + var t1 = this._all || this.names.contains$1(0, $name); + return t1 !== this.include; + } + }; + A.ConfiguredVariable.prototype = { + toString$0(_) { + var t1 = this.expression.toString$0(0), + t2 = this.isGuarded ? " !default" : ""; + return "$" + this.name + ": " + t1 + t2; + }, + $isAstNode: 1, + get$span(receiver) { + return this.span; + } + }; + A._IsCalculationSafeVisitor.prototype = { + visitBinaryOperationExpression$1(node) { + var t1; + if (B.Set_FIwG4.contains$1(0, node.operator)) + t1 = node.left.accept$1(this) || node.right.accept$1(this); + else + t1 = false; + return t1; + }, + visitBooleanExpression$1(node) { + return false; + }, + visitColorExpression$1(node) { + return false; + }, + visitFunctionExpression$1(node) { + return true; + }, + visitInterpolatedFunctionExpression$1(node) { + return true; + }, + visitIfExpression$1(node) { + return true; + }, + visitListExpression$1(node) { + var t1; + if (node.separator === B.ListSeparator_EVt) + if (!node.hasBrackets) { + t1 = node.contents; + t1 = t1.length > 1 && B.JSArray_methods.every$1(t1, new A._IsCalculationSafeVisitor_visitListExpression_closure(this)); + } else + t1 = false; + else + t1 = false; + return t1; + }, + visitMapExpression$1(node) { + return false; + }, + visitNullExpression$1(node) { + return false; + }, + visitNumberExpression$1(node) { + return true; + }, + visitParenthesizedExpression$1(node) { + return node.expression.accept$1(this); + }, + visitSelectorExpression$1(node) { + return false; + }, + visitStringExpression$1(node) { + var text, t1, t2; + if (node.hasQuotes) + return false; + text = node.text.get$initialPlain(); + if (!B.JSString_methods.startsWith$1(text, "!")) + if (!B.JSString_methods.startsWith$1(text, "#")) { + t1 = text.length; + if ((1 >= t1 ? null : text.charCodeAt(1)) !== 43) { + t2 = (3 >= t1 ? null : text.charCodeAt(3)) !== 40; + t1 = t2; + } else + t1 = false; + } else + t1 = false; + else + t1 = false; + return t1; + }, + visitSupportsExpression$1(node) { + return false; + }, + visitUnaryOperationExpression$1(node) { + return false; + }, + visitValueExpression$1(node) { + return false; + }, + visitVariableExpression$1(node) { + return true; + } + }; + A._IsCalculationSafeVisitor_visitListExpression_closure.prototype = { + call$1(expression) { + return expression.accept$1(this.$this); + }, + $signature: 119 + }; + A.BinaryOperationExpression.prototype = { + get$span(_) { + var right, + left = this.left; + for (; left instanceof A.BinaryOperationExpression;) + left = left.left; + right = this.right; + for (; right instanceof A.BinaryOperationExpression;) + right = right.right; + return left.get$span(left).expand$1(0, right.get$span(right)); + }, + get$operatorSpan() { + var t3, t4, + t1 = this.left, + t2 = t1.get$span(t1); + t2 = t2.get$file(t2); + t3 = this.right; + t4 = t3.get$span(t3); + if (t2 === t4.get$file(t4)) { + t2 = t1.get$span(t1); + t2 = t2.get$end(t2); + t4 = t3.get$span(t3); + t4 = t2.offset < t4.get$start(t4).offset; + t2 = t4; + } else + t2 = false; + if (t2) { + t2 = t1.get$span(t1); + t2 = t2.get$file(t2); + t1 = t1.get$span(t1); + t1 = t1.get$end(t1); + t3 = t3.get$span(t3); + t3 = A.SpanExtensions_trimRight(A.SpanExtensions_trimLeft(t2.span$2(0, t1.offset, t3.get$start(t3).offset))); + t1 = t3; + } else + t1 = this.get$span(0); + return t1; + }, + accept$1$1(visitor) { + return visitor.visitBinaryOperationExpression$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + toString$0(_) { + var t1, t2, right, operator, t3, _this = this, + _0_0 = _this.left; + $label0$0: { + if (_0_0 instanceof A.BinaryOperationExpression) { + t1 = _0_0.operator.precedence < _this.operator.precedence; + break $label0$0; + } + if (_0_0 instanceof A.ListExpression && !_0_0.hasBrackets && _0_0.contents.length >= 2) { + t1 = true; + break $label0$0; + } + t1 = false; + break $label0$0; + } + t2 = t1 ? "" + A.Primitives_stringFromCharCode(40) : ""; + t2 += _0_0.toString$0(0); + t1 = t1 ? t2 + A.Primitives_stringFromCharCode(41) : t2; + t2 = _this.operator; + t1 = t1 + A.Primitives_stringFromCharCode(32) + t2.operator + A.Primitives_stringFromCharCode(32); + right = _this.right; + $label1$1: { + if (right instanceof A.BinaryOperationExpression) { + operator = right.operator; + if (operator.precedence <= t2.precedence) { + t3 = !(operator === t2 && operator.isAssociative); + t2 = t3; + } else + t2 = false; + break $label1$1; + } + if (right instanceof A.ListExpression && !right.hasBrackets && right.contents.length >= 2) { + t2 = true; + break $label1$1; + } + t2 = false; + break $label1$1; + } + if (t2) + t1 += A.Primitives_stringFromCharCode(40); + t1 += right.toString$0(0); + if (t2) + t1 += A.Primitives_stringFromCharCode(41); + return t1.charCodeAt(0) == 0 ? t1 : t1; + }, + $isAstNode: 1, + $isExpression: 1 + }; + A.BinaryOperator.prototype = { + _enumToString$0() { + return "BinaryOperator." + this._name; + }, + toString$0(_) { + return this.name; + } + }; + A.BooleanExpression.prototype = { + accept$1$1(visitor) { + return visitor.visitBooleanExpression$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + toString$0(_) { + return String(this.value); + }, + $isAstNode: 1, + $isExpression: 1, + get$span(receiver) { + return this.span; + } + }; + A.ColorExpression.prototype = { + accept$1$1(visitor) { + return visitor.visitColorExpression$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + toString$0(_) { + return A.serializeValue(this.value, true, true); + }, + $isAstNode: 1, + $isExpression: 1, + get$span(receiver) { + return this.span; + } + }; + A.FunctionExpression.prototype = { + get$name(_) { + return A.stringReplaceAllUnchecked(this.originalName, "_", "-"); + }, + accept$1$1(visitor) { + return visitor.visitFunctionExpression$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + toString$0(_) { + var t1 = this.namespace; + t1 = t1 != null ? "" + (t1 + ".") : ""; + t1 += this.originalName + this.$arguments.toString$0(0); + return t1.charCodeAt(0) == 0 ? t1 : t1; + }, + $isAstNode: 1, + $isExpression: 1, + get$span(receiver) { + return this.span; + } + }; + A.IfExpression.prototype = { + accept$1$1(visitor) { + return visitor.visitIfExpression$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + toString$0(_) { + return "if" + this.$arguments.toString$0(0); + }, + $isAstNode: 1, + $isExpression: 1, + get$span(receiver) { + return this.span; + } + }; + A.InterpolatedFunctionExpression.prototype = { + accept$1$1(visitor) { + return visitor.visitInterpolatedFunctionExpression$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + toString$0(_) { + return this.name.toString$0(0) + this.$arguments.toString$0(0); + }, + $isAstNode: 1, + $isExpression: 1, + get$span(receiver) { + return this.span; + } + }; + A.ListExpression.prototype = { + accept$1$1(visitor) { + return visitor.visitListExpression$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + toString$0(_) { + var t2, t3, t4, t5, _this = this, + t1 = _this.hasBrackets; + if (t1) + t2 = "" + A.Primitives_stringFromCharCode(91); + else { + t2 = _this.contents.length; + if (t2 !== 0) + t2 = t2 === 1 && _this.separator === B.ListSeparator_rXA; + else + t2 = true; + t2 = t2 ? "" + A.Primitives_stringFromCharCode(40) : ""; + } + t3 = _this.contents; + t4 = _this.separator === B.ListSeparator_rXA; + t5 = t4 ? ", " : " "; + t5 = t2 + new A.MappedListIterable(t3, new A.ListExpression_toString_closure(_this), A._arrayInstanceType(t3)._eval$1("MappedListIterable<1,String>")).join$1(0, t5); + if (t1) + t1 = t5 + A.Primitives_stringFromCharCode(93); + else { + t1 = t3.length; + if (t1 === 0) + t1 = t5 + A.Primitives_stringFromCharCode(41); + else + t1 = t1 === 1 && t4 ? t5 + ",)" : t5; + } + return t1.charCodeAt(0) == 0 ? t1 : t1; + }, + _list0$_elementNeedsParens$1(expression) { + var childSeparator, t1, _0_13; + $label0$0: { + if (expression instanceof A.ListExpression && expression.contents.length >= 2 && !expression.hasBrackets) { + childSeparator = expression.separator; + t1 = this.separator === B.ListSeparator_rXA ? childSeparator === B.ListSeparator_rXA : childSeparator !== B.ListSeparator_undecided_null_undecided; + break $label0$0; + } + if (expression instanceof A.UnaryOperationExpression) { + _0_13 = expression.operator; + if (B.UnaryOperator_gg4 !== _0_13) + t1 = B.UnaryOperator_TLI === _0_13; + else + t1 = true; + } else + t1 = false; + if (t1) { + t1 = this.separator === B.ListSeparator_EVt; + break $label0$0; + } + t1 = false; + break $label0$0; + } + return t1; + }, + $isAstNode: 1, + $isExpression: 1, + get$span(receiver) { + return this.span; + } + }; + A.ListExpression_toString_closure.prototype = { + call$1(element) { + return this.$this._list0$_elementNeedsParens$1(element) ? "(" + element.toString$0(0) + ")" : element.toString$0(0); + }, + $signature: 120 + }; + A.MapExpression.prototype = { + accept$1$1(visitor) { + return visitor.visitMapExpression$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + toString$0(_) { + var t2, t3, _i, t4, key, value, + t1 = A._setArrayType([], type$.JSArray_String); + for (t2 = this.pairs, t3 = t2.length, _i = 0; _i < t3; ++_i) { + t4 = t2[_i]; + key = t4._0; + value = t4._1; + t1.push(key.toString$0(0) + ": " + value.toString$0(0)); + } + return "(" + B.JSArray_methods.join$1(t1, ", ") + ")"; + }, + $isAstNode: 1, + $isExpression: 1, + get$span(receiver) { + return this.span; + } + }; + A.NullExpression.prototype = { + accept$1$1(visitor) { + return visitor.visitNullExpression$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + toString$0(_) { + return "null"; + }, + $isAstNode: 1, + $isExpression: 1, + get$span(receiver) { + return this.span; + } + }; + A.NumberExpression.prototype = { + accept$1$1(visitor) { + return visitor.visitNumberExpression$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + toString$0(_) { + return A.serializeValue(A.SassNumber_SassNumber(this.value, this.unit), true, true); + }, + $isAstNode: 1, + $isExpression: 1, + get$span(receiver) { + return this.span; + } + }; + A.ParenthesizedExpression.prototype = { + accept$1$1(visitor) { + return visitor.visitParenthesizedExpression$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + toString$0(_) { + return "(" + this.expression.toString$0(0) + ")"; + }, + $isAstNode: 1, + $isExpression: 1, + get$span(receiver) { + return this.span; + } + }; + A.SelectorExpression.prototype = { + accept$1$1(visitor) { + return visitor.visitSelectorExpression$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + toString$0(_) { + return "&"; + }, + $isAstNode: 1, + $isExpression: 1, + get$span(receiver) { + return this.span; + } + }; + A.StringExpression.prototype = { + get$span(_) { + return this.text.span; + }, + accept$1$1(visitor) { + return visitor.visitStringExpression$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + asInterpolation$1$static($static) { + var t1, t2, quote, t3, t4, buffer, t5, t6, _i, value; + if (!this.hasQuotes) + return this.text; + t1 = this.text; + t2 = t1.contents; + quote = A.StringExpression__bestQuote(new A.WhereTypeIterable(t2, type$.WhereTypeIterable_String)); + t3 = new A.StringBuffer(""); + t4 = A._setArrayType([], type$.JSArray_Object); + buffer = new A.InterpolationBuffer(t3, t4); + t3._contents += A.Primitives_stringFromCharCode(quote); + for (t5 = t2.length, t6 = type$.Expression, _i = 0; _i < t5; ++_i) { + value = t2[_i]; + if (t6._is(value)) { + buffer._flushText$0(); + t4.push(value); + continue; + } + if (typeof value == "string") + A.StringExpression__quoteInnerText(value, quote, buffer, $static); + } + t3._contents += A.Primitives_stringFromCharCode(quote); + return buffer.interpolation$1(t1.span); + }, + asInterpolation$0() { + return this.asInterpolation$1$static(false); + }, + toString$0(_) { + return this.asInterpolation$0().toString$0(0); + }, + $isAstNode: 1, + $isExpression: 1 + }; + A.SupportsExpression.prototype = { + get$span(_) { + var t1 = this.condition; + return t1.get$span(t1); + }, + accept$1$1(visitor) { + return visitor.visitSupportsExpression$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + toString$0(_) { + return this.condition.toString$0(0); + }, + $isAstNode: 1, + $isExpression: 1 + }; + A.UnaryOperationExpression.prototype = { + accept$1$1(visitor) { + return visitor.visitUnaryOperationExpression$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + toString$0(_) { + var operand, + t1 = this.operator, + t2 = t1.operator; + t1 = t1 === B.UnaryOperator_not_not_not ? t2 + A.Primitives_stringFromCharCode(32) : t2; + operand = this.operand; + $label0$0: { + if (!(operand instanceof A.BinaryOperationExpression)) + if (!(operand instanceof A.UnaryOperationExpression)) + t2 = operand instanceof A.ListExpression && !operand.hasBrackets && operand.contents.length >= 2; + else + t2 = true; + else + t2 = true; + if (t2) { + t2 = true; + break $label0$0; + } + t2 = false; + break $label0$0; + } + if (t2) + t1 += "40"; + t1 += operand.toString$0(0); + if (t2) + t1 += "41"; + return t1.charCodeAt(0) == 0 ? t1 : t1; + }, + $isAstNode: 1, + $isExpression: 1, + get$span(receiver) { + return this.span; + } + }; + A.UnaryOperator.prototype = { + _enumToString$0() { + return "UnaryOperator." + this._name; + }, + toString$0(_) { + return this.name; + } + }; + A.ValueExpression.prototype = { + accept$1$1(visitor) { + return visitor.visitValueExpression$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + toString$0(_) { + return A.serializeValue(this.value, true, true); + }, + $isAstNode: 1, + $isExpression: 1, + get$span(receiver) { + return this.span; + } + }; + A.VariableExpression.prototype = { + accept$1$1(visitor) { + return visitor.visitVariableExpression$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + toString$0(_) { + var t1 = this.span; + return A.String_String$fromCharCodes(B.NativeUint32List_methods.sublist$2(t1.file._decodedChars, t1._file$_start, t1._end), 0, null); + }, + $isAstNode: 1, + $isExpression: 1, + get$span(receiver) { + return this.span; + } + }; + A.DynamicImport.prototype = { + toString$0(_) { + return A.StringExpression_quoteText(this.urlString); + }, + $isAstNode: 1, + $isImport: 1, + get$span(receiver) { + return this.span; + } + }; + A.StaticImport.prototype = { + toString$0(_) { + var t1 = this.url.toString$0(0), + t2 = this.modifiers; + return t1 + (t2 == null ? "" : " " + t2.toString$0(0)); + }, + $isAstNode: 1, + $isImport: 1, + get$span(receiver) { + return this.span; + } + }; + A.Interpolation.prototype = { + get$asPlain() { + var _0_1, t1, _0_6, _0_6_isSet, first, _null = null, + _0_0 = this.contents; + $label0$0: { + _0_1 = _0_0.length; + if (_0_1 <= 0) { + t1 = ""; + break $label0$0; + } + if (_0_1 === 1) { + _0_6 = _0_0[0]; + t1 = _0_6; + t1 = typeof t1 == "string"; + _0_6_isSet = true; + } else { + _0_6 = _null; + _0_6_isSet = false; + t1 = false; + } + if (t1) { + first = A._asString(_0_6_isSet ? _0_6 : _0_0[0]); + t1 = first; + break $label0$0; + } + t1 = _null; + break $label0$0; + } + return t1; + }, + get$initialPlain() { + var _0_4, t1, _0_4_isSet, first, + _0_0 = this.contents; + $label0$0: { + if (_0_0.length >= 1) { + _0_4 = _0_0[0]; + t1 = _0_4; + t1 = typeof t1 == "string"; + _0_4_isSet = true; + } else { + _0_4 = null; + _0_4_isSet = false; + t1 = false; + } + if (t1) { + first = A._asString(_0_4_isSet ? _0_4 : _0_0[0]); + t1 = first; + break $label0$0; + } + t1 = ""; + break $label0$0; + } + return t1; + }, + Interpolation$2(contents, span) { + var t1, t2, t3, i, t4, t5, + _s8_ = "contents"; + for (t1 = this.contents, t2 = t1.length, t3 = type$.Expression, i = 0; i < t2; ++i) { + t4 = t1[i]; + t5 = typeof t4 == "string"; + if (!t5 && !t3._is(t4)) + throw A.wrapException(A.ArgumentError$value(t1, _s8_, string$.May_on)); + if (i !== 0 && typeof t1[i - 1] == "string" && t5) + throw A.wrapException(A.ArgumentError$value(t1, _s8_, "May not contain adjacent Strings.")); + } + }, + toString$0(_) { + var t1 = this.contents; + return new A.MappedListIterable(t1, new A.Interpolation_toString_closure(), A._arrayInstanceType(t1)._eval$1("MappedListIterable<1,String>")).join$0(0); + }, + $isAstNode: 1, + get$span(receiver) { + return this.span; + } + }; + A.Interpolation_toString_closure.prototype = { + call$1(value) { + return typeof value == "string" ? value : "#{" + A.S(value) + "}"; + }, + $signature: 137 + }; + A.AtRootRule.prototype = { + accept$1$1(visitor) { + return visitor.visitAtRootRule$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + toString$0(_) { + var buffer = new A.StringBuffer("@at-root "), + t1 = this.query; + if (t1 != null) + buffer._contents = "@at-root " + (t1.toString$0(0) + " "); + t1 = this.children; + return buffer.toString$0(0) + " {" + (t1 && B.JSArray_methods).join$1(t1, " ") + "}"; + }, + get$span(receiver) { + return this.span; + } + }; + A.AtRule.prototype = { + accept$1$1(visitor) { + return visitor.visitAtRule$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + toString$0(_) { + var children, + t1 = "@" + this.name.toString$0(0), + buffer = new A.StringBuffer(t1), + t2 = this.value; + if (t2 != null) + buffer._contents = t1 + (" " + t2.toString$0(0)); + children = this.children; + return children == null ? buffer.toString$0(0) + ";" : buffer.toString$0(0) + " {" + B.JSArray_methods.join$1(children, " ") + "}"; + }, + get$span(receiver) { + return this.span; + } + }; + A.CallableDeclaration.prototype = { + get$span(receiver) { + return this.span; + } + }; + A.ContentBlock.prototype = { + accept$1$1(visitor) { + return visitor.visitContentBlock$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + toString$0(_) { + var t2, + t1 = this.$arguments; + t1 = t1.$arguments.length === 0 && t1.restArgument == null ? "" : " using (" + t1.toString$0(0) + ")"; + t2 = this.children; + return t1 + (" {" + (t2 && B.JSArray_methods).join$1(t2, " ") + "}"); + } + }; + A.ContentRule.prototype = { + accept$1$1(visitor) { + return visitor.visitContentRule$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + toString$0(_) { + var t1 = this.$arguments; + return t1.get$isEmpty(0) ? "@content;" : "@content(" + t1.toString$0(0) + ");"; + }, + $isAstNode: 1, + $isStatement: 1, + get$span(receiver) { + return this.span; + } + }; + A.DebugRule.prototype = { + accept$1$1(visitor) { + return visitor.visitDebugRule$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + toString$0(_) { + return "@debug " + this.expression.toString$0(0) + ";"; + }, + $isAstNode: 1, + $isStatement: 1, + get$span(receiver) { + return this.span; + } + }; + A.Declaration.prototype = { + accept$1$1(visitor) { + return visitor.visitDeclaration$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + toString$0(_) { + var t3, _0_0, + buffer = new A.StringBuffer(""), + t1 = this.name, + t2 = "" + t1.toString$0(0); + buffer._contents = t2; + t2 = buffer._contents = t2 + A.Primitives_stringFromCharCode(58); + t3 = this.value; + if (t3 != null) { + t1 = !B.JSString_methods.startsWith$1(t1.get$initialPlain(), "--") ? buffer._contents = t2 + A.Primitives_stringFromCharCode(32) : t2; + buffer._contents = t1 + t3.toString$0(0); + } + _0_0 = this.children; + if (_0_0 != null) + return buffer.toString$0(0) + " {" + B.JSArray_methods.join$1(_0_0, " ") + "}"; + else + return buffer.toString$0(0) + ";"; + }, + get$span(receiver) { + return this.span; + } + }; + A.EachRule.prototype = { + accept$1$1(visitor) { + return visitor.visitEachRule$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + toString$0(_) { + var t1 = this.variables, + t2 = this.children; + return "@each " + new A.MappedListIterable(t1, new A.EachRule_toString_closure(), A._arrayInstanceType(t1)._eval$1("MappedListIterable<1,String>")).join$1(0, ", ") + " in " + this.list.toString$0(0) + " {" + (t2 && B.JSArray_methods).join$1(t2, " ") + "}"; + }, + get$span(receiver) { + return this.span; + } + }; + A.EachRule_toString_closure.prototype = { + call$1(variable) { + return "$" + variable; + }, + $signature: 5 + }; + A.ErrorRule.prototype = { + accept$1$1(visitor) { + return visitor.visitErrorRule$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + toString$0(_) { + return "@error " + this.expression.toString$0(0) + ";"; + }, + $isAstNode: 1, + $isStatement: 1, + get$span(receiver) { + return this.span; + } + }; + A.ExtendRule.prototype = { + accept$1$1(visitor) { + return visitor.visitExtendRule$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + toString$0(_) { + var t1 = this.selector.toString$0(0), + t2 = this.isOptional ? " !optional" : ""; + return "@extend " + t1 + t2 + ";"; + }, + $isAstNode: 1, + $isStatement: 1, + get$span(receiver) { + return this.span; + } + }; + A.ForRule.prototype = { + accept$1$1(visitor) { + return visitor.visitForRule$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + toString$0(_) { + var _this = this, + t1 = _this.from.toString$0(0), + t2 = _this.isExclusive ? "to" : "through", + t3 = _this.children; + return "@for $" + _this.variable + " from " + t1 + " " + t2 + " " + _this.to.toString$0(0) + " {" + (t3 && B.JSArray_methods).join$1(t3, " ") + "}"; + }, + get$span(receiver) { + return this.span; + } + }; + A.ForwardRule.prototype = { + accept$1$1(visitor) { + return visitor.visitForwardRule$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + toString$0(_) { + var t2, prefix, _this = this, + t1 = "@forward " + A.StringExpression_quoteText(_this.url.toString$0(0)), + shownMixinsAndFunctions = _this.shownMixinsAndFunctions, + hiddenMixinsAndFunctions = _this.hiddenMixinsAndFunctions; + if (shownMixinsAndFunctions != null) { + t2 = _this.shownVariables; + t2.toString; + t2 = t1 + " show " + _this._forward_rule$_memberList$2(shownMixinsAndFunctions, t2); + t1 = t2; + } else if (hiddenMixinsAndFunctions != null && hiddenMixinsAndFunctions._base.get$isNotEmpty(0)) { + t2 = _this.hiddenVariables; + t2.toString; + t2 = t1 + " hide " + _this._forward_rule$_memberList$2(hiddenMixinsAndFunctions, t2); + t1 = t2; + } + prefix = _this.prefix; + if (prefix != null) + t1 += " as " + prefix + "*"; + t2 = _this.configuration; + t1 = (t2.length !== 0 ? t1 + (" with (" + B.JSArray_methods.join$1(t2, ", ") + ")") : t1) + ";"; + return t1.charCodeAt(0) == 0 ? t1 : t1; + }, + _forward_rule$_memberList$2(mixinsAndFunctions, variables) { + var t2, + t1 = A.List_List$of(mixinsAndFunctions, true, type$.String); + for (t2 = variables._base.get$iterator(0); t2.moveNext$0();) + t1.push("$" + t2.get$current(0)); + return B.JSArray_methods.join$1(t1, ", "); + }, + $isAstNode: 1, + $isStatement: 1, + get$span(receiver) { + return this.span; + } + }; + A.FunctionRule.prototype = { + accept$1$1(visitor) { + return visitor.visitFunctionRule$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + toString$0(_) { + var t1 = this.children; + return "@function " + this.name + "(" + this.$arguments.toString$0(0) + ") {" + (t1 && B.JSArray_methods).join$1(t1, " ") + "}"; + } + }; + A.IfRule.prototype = { + accept$1$1(visitor) { + return visitor.visitIfRule$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + toString$0(_) { + var result = A.ListExtensions_mapIndexed(this.clauses, new A.IfRule_toString_closure(), type$.IfClause, type$.String).join$1(0, " "), + lastClause = this.lastClause; + return lastClause != null ? result + (" " + lastClause.toString$0(0)) : result; + }, + $isAstNode: 1, + $isStatement: 1, + get$span(receiver) { + return this.span; + } + }; + A.IfRule_toString_closure.prototype = { + call$2(index, clause) { + var t1 = index === 0 ? "if" : "else if"; + return "@" + t1 + " " + clause.expression.toString$0(0) + " {" + B.JSArray_methods.join$1(clause.children, " ") + "}"; + }, + $signature: 510 + }; + A.IfRuleClause.prototype = {}; + A.IfRuleClause$__closure.prototype = { + call$1(child) { + var t1; + $label0$0: { + if (child instanceof A.VariableDeclaration || child instanceof A.FunctionRule || child instanceof A.MixinRule) { + t1 = true; + break $label0$0; + } + if (child instanceof A.ImportRule) { + t1 = B.JSArray_methods.any$1(child.imports, new A.IfRuleClause$___closure()); + break $label0$0; + } + t1 = false; + break $label0$0; + } + return t1; + }, + $signature: 147 + }; + A.IfRuleClause$___closure.prototype = { + call$1($import) { + return $import instanceof A.DynamicImport; + }, + $signature: 148 + }; + A.IfClause.prototype = { + toString$0(_) { + return "@if " + this.expression.toString$0(0) + " {" + B.JSArray_methods.join$1(this.children, " ") + "}"; + } + }; + A.ElseClause.prototype = { + toString$0(_) { + return "@else {" + B.JSArray_methods.join$1(this.children, " ") + "}"; + } + }; + A.ImportRule.prototype = { + accept$1$1(visitor) { + return visitor.visitImportRule$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + toString$0(_) { + return "@import " + B.JSArray_methods.join$1(this.imports, ", ") + ";"; + }, + $isAstNode: 1, + $isStatement: 1, + get$span(receiver) { + return this.span; + } + }; + A.IncludeRule.prototype = { + get$spanWithoutContent() { + var t2, t3, + t1 = this.span; + if (!(this.content == null)) { + t2 = t1.file; + t3 = this.$arguments.span; + t3 = A.SpanExtensions_trimRight(A.SpanExtensions_trimLeft(t2.span$2(0, A.FileLocation$_(t2, t1._file$_start).offset, t3.get$end(t3).offset))); + t1 = t3; + } + return t1; + }, + accept$1$1(visitor) { + return visitor.visitIncludeRule$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + toString$0(_) { + var t2, _this = this, + t1 = _this.namespace; + t1 = t1 != null ? "@include " + (t1 + ".") : "@include "; + t1 += _this.name; + t2 = _this.$arguments; + if (!t2.get$isEmpty(0)) + t1 += "(" + t2.toString$0(0) + ")"; + t2 = _this.content; + t1 += t2 == null ? ";" : " " + t2.toString$0(0); + return t1.charCodeAt(0) == 0 ? t1 : t1; + }, + $isAstNode: 1, + $isStatement: 1, + get$span(receiver) { + return this.span; + } + }; + A.LoudComment.prototype = { + get$span(_) { + return this.text.span; + }, + accept$1$1(visitor) { + return visitor.visitLoudComment$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + toString$0(_) { + return this.text.toString$0(0); + }, + $isAstNode: 1, + $isStatement: 1 + }; + A.MediaRule.prototype = { + accept$1$1(visitor) { + return visitor.visitMediaRule$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + toString$0(_) { + var t1 = this.children; + return "@media " + this.query.toString$0(0) + " {" + (t1 && B.JSArray_methods).join$1(t1, " ") + "}"; + }, + get$span(receiver) { + return this.span; + } + }; + A.MixinRule.prototype = { + get$hasContent() { + var result, _this = this, + value = _this.__MixinRule_hasContent_FI; + if (value === $) { + result = J.$eq$(B.C__HasContentVisitor.visitChildren$1(_this.children), true); + _this.__MixinRule_hasContent_FI !== $ && A.throwUnnamedLateFieldADI(); + _this.__MixinRule_hasContent_FI = result; + value = result; + } + return value; + }, + accept$1$1(visitor) { + return visitor.visitMixinRule$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + toString$0(_) { + var t1 = "@mixin " + this.name, + t2 = this.$arguments; + if (!(t2.$arguments.length === 0 && t2.restArgument == null)) + t1 += "(" + t2.toString$0(0) + ")"; + t2 = this.children; + t2 = t1 + (" {" + (t2 && B.JSArray_methods).join$1(t2, " ") + "}"); + return t2.charCodeAt(0) == 0 ? t2 : t2; + } + }; + A._HasContentVisitor.prototype = { + visitContentRule$1(_) { + return true; + } + }; + A.__HasContentVisitor_Object_StatementSearchVisitor.prototype = {}; + A.ParentStatement.prototype = {$isAstNode: 1, $isStatement: 1}; + A.ParentStatement_closure.prototype = { + call$1(child) { + var t1; + $label0$0: { + if (child instanceof A.VariableDeclaration || child instanceof A.FunctionRule || child instanceof A.MixinRule) { + t1 = true; + break $label0$0; + } + if (child instanceof A.ImportRule) { + t1 = B.JSArray_methods.any$1(child.imports, new A.ParentStatement__closure()); + break $label0$0; + } + t1 = false; + break $label0$0; + } + return t1; + }, + $signature: 147 + }; + A.ParentStatement__closure.prototype = { + call$1($import) { + return $import instanceof A.DynamicImport; + }, + $signature: 148 + }; + A.ReturnRule.prototype = { + accept$1$1(visitor) { + return visitor.visitReturnRule$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + toString$0(_) { + return "@return " + this.expression.toString$0(0) + ";"; + }, + $isAstNode: 1, + $isStatement: 1, + get$span(receiver) { + return this.span; + } + }; + A.SilentComment.prototype = { + accept$1$1(visitor) { + return visitor.visitSilentComment$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + toString$0(_) { + return this.text; + }, + $isAstNode: 1, + $isStatement: 1, + get$span(receiver) { + return this.span; + } + }; + A.StyleRule.prototype = { + accept$1$1(visitor) { + return visitor.visitStyleRule$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + toString$0(_) { + var t1 = this.children; + return this.selector.toString$0(0) + " {" + (t1 && B.JSArray_methods).join$1(t1, " ") + "}"; + }, + get$span(receiver) { + return this.span; + } + }; + A.Stylesheet.prototype = { + Stylesheet$internal$3$plainCss(children, span, plainCss) { + var t1, t2, t3, t4, _i, child; + for (t1 = this.children, t2 = t1.length, t3 = this._forwards, t4 = this._uses, _i = 0; _i < t2; ++_i) { + child = t1[_i]; + if (child instanceof A.UseRule) { + t4.push(child); + continue; + } + if (child instanceof A.ForwardRule) { + t3.push(child); + continue; + } + if (child instanceof A.SilentComment || child instanceof A.LoudComment || child instanceof A.VariableDeclaration) + continue; + break; + } + }, + accept$1$1(visitor) { + return visitor.visitStylesheet$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + toString$0(_) { + var t1 = this.children; + return (t1 && B.JSArray_methods).join$1(t1, " "); + }, + get$span(receiver) { + return this.span; + } + }; + A.SupportsRule.prototype = { + accept$1$1(visitor) { + return visitor.visitSupportsRule$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + toString$0(_) { + var t1 = this.children; + return "@supports " + this.condition.toString$0(0) + " {" + (t1 && B.JSArray_methods).join$1(t1, " ") + "}"; + }, + get$span(receiver) { + return this.span; + } + }; + A.UseRule.prototype = { + UseRule$4$configuration(url, namespace, span, configuration) { + var t1, t2, _i, variable; + for (t1 = this.configuration, t2 = t1.length, _i = 0; _i < t2; ++_i) { + variable = t1[_i]; + if (variable.isGuarded) + throw A.wrapException(A.ArgumentError$value(variable, "configured variable", "can't be guarded in a @use rule.")); + } + }, + accept$1$1(visitor) { + return visitor.visitUseRule$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + toString$0(_) { + var t1 = this.url, + t2 = "@use " + A.StringExpression_quoteText(t1.toString$0(0)), + basename = t1.get$pathSegments().length === 0 ? "" : B.JSArray_methods.get$last(t1.get$pathSegments()), + dot = B.JSString_methods.indexOf$1(basename, "."); + t1 = this.namespace; + if (t1 !== B.JSString_methods.substring$2(basename, 0, dot === -1 ? basename.length : dot)) + t1 = t2 + (" as " + (t1 == null ? "*" : t1)); + else + t1 = t2; + t2 = this.configuration; + t1 = (t2.length !== 0 ? t1 + (" with (" + B.JSArray_methods.join$1(t2, ", ") + ")") : t1) + ";"; + return t1.charCodeAt(0) == 0 ? t1 : t1; + }, + $isAstNode: 1, + $isStatement: 1, + get$span(receiver) { + return this.span; + } + }; + A.VariableDeclaration.prototype = { + accept$1$1(visitor) { + return visitor.visitVariableDeclaration$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + toString$0(_) { + var t1 = this.namespace; + t1 = t1 != null ? "" + (t1 + ".") : ""; + t1 += "$" + this.name + ": " + this.expression.toString$0(0) + ";"; + return t1.charCodeAt(0) == 0 ? t1 : t1; + }, + $isAstNode: 1, + $isStatement: 1, + get$span(receiver) { + return this.span; + } + }; + A.WarnRule.prototype = { + accept$1$1(visitor) { + return visitor.visitWarnRule$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + toString$0(_) { + return "@warn " + this.expression.toString$0(0) + ";"; + }, + $isAstNode: 1, + $isStatement: 1, + get$span(receiver) { + return this.span; + } + }; + A.WhileRule.prototype = { + accept$1$1(visitor) { + return visitor.visitWhileRule$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + toString$0(_) { + var t1 = this.children; + return "@while " + this.condition.toString$0(0) + " {" + (t1 && B.JSArray_methods).join$1(t1, " ") + "}"; + }, + get$span(receiver) { + return this.span; + } + }; + A.SupportsAnything.prototype = { + toString$0(_) { + return "(" + this.contents.toString$0(0) + ")"; + }, + $isAstNode: 1, + get$span(receiver) { + return this.span; + } + }; + A.SupportsDeclaration.prototype = { + get$isCustomProperty() { + var t1, + _0_0 = this.name; + $label0$0: { + if (_0_0 instanceof A.StringExpression && !_0_0.hasQuotes) { + t1 = B.JSString_methods.startsWith$1(_0_0.text.get$initialPlain(), "--"); + break $label0$0; + } + t1 = false; + break $label0$0; + } + return t1; + }, + toString$0(_) { + return "(" + this.name.toString$0(0) + ": " + this.value.toString$0(0) + ")"; + }, + $isAstNode: 1, + get$span(receiver) { + return this.span; + } + }; + A.SupportsFunction.prototype = { + toString$0(_) { + return this.name.toString$0(0) + "(" + this.$arguments.toString$0(0) + ")"; + }, + $isAstNode: 1, + get$span(receiver) { + return this.span; + } + }; + A.SupportsInterpolation.prototype = { + toString$0(_) { + return "#{" + this.expression.toString$0(0) + "}"; + }, + $isAstNode: 1, + get$span(receiver) { + return this.span; + } + }; + A.SupportsNegation.prototype = { + toString$0(_) { + var t1 = this.condition; + if (t1 instanceof A.SupportsNegation || t1 instanceof A.SupportsOperation) + return "not (" + t1.toString$0(0) + ")"; + else + return "not " + t1.toString$0(0); + }, + $isAstNode: 1, + get$span(receiver) { + return this.span; + } + }; + A.SupportsOperation.prototype = { + toString$0(_) { + var _this = this; + return _this._operation$_parenthesize$1(_this.left) + " " + _this.operator + " " + _this._operation$_parenthesize$1(_this.right); + }, + _operation$_parenthesize$1(condition) { + var t1; + if (!(condition instanceof A.SupportsNegation)) + t1 = condition instanceof A.SupportsOperation && condition.operator === this.operator; + else + t1 = true; + return t1 ? "(" + condition.toString$0(0) + ")" : condition.toString$0(0); + }, + $isAstNode: 1, + get$span(receiver) { + return this.span; + } + }; + A.Selector.prototype = { + assertNotBogus$1$name($name) { + var t1; + if (!this.accept$1(B._IsBogusVisitor_true)) + return; + t1 = this.toString$0(0); + A.EvaluationContext_current().warn$2(0, "$" + $name + ": " + (t1 + string$.x20is_nov), B.Deprecation_vrR); + }, + toString$0(_) { + var visitor = A._SerializeVisitor$(null, true, null, true, false, null, true); + this.accept$1(visitor); + return visitor._serialize$_buffer.toString$0(0); + }, + $isAstNode: 1, + get$span(receiver) { + return this.span; + } + }; + A._IsInvisibleVisitor0.prototype = { + visitSelectorList$1(list) { + return B.JSArray_methods.every$1(list.components, this.get$visitComplexSelector()); + }, + visitComplexSelector$1(complex) { + var t1; + if (!this.super$AnySelectorVisitor$visitComplexSelector(complex)) + t1 = this.includeBogus && complex.accept$1(B._IsBogusVisitor_false); + else + t1 = true; + return t1; + }, + visitPlaceholderSelector$1(placeholder) { + return true; + }, + visitPseudoSelector$1(pseudo) { + var t1, + _0_0 = pseudo.selector; + if (_0_0 != null) { + if (pseudo.name === "not") + t1 = this.includeBogus && _0_0.accept$1(B._IsBogusVisitor_true); + else + t1 = this.visitSelectorList$1(_0_0); + return t1; + } else + return false; + } + }; + A._IsBogusVisitor.prototype = { + visitComplexSelector$1(complex) { + var t2, + t1 = complex.components; + if (t1.length === 0) + return complex.leadingCombinators.length !== 0; + else { + t2 = this.includeLeadingCombinator ? 0 : 1; + return complex.leadingCombinators.length > t2 || B.JSArray_methods.get$last(t1).combinators.length !== 0 || B.JSArray_methods.any$1(t1, new A._IsBogusVisitor_visitComplexSelector_closure(this)); + } + }, + visitPseudoSelector$1(pseudo) { + var selector = pseudo.selector; + if (selector == null) + return false; + return pseudo.name === "has" ? selector.accept$1(B._IsBogusVisitor_false) : selector.accept$1(B._IsBogusVisitor_true); + } + }; + A._IsBogusVisitor_visitComplexSelector_closure.prototype = { + call$1(component) { + return component.combinators.length > 1 || this.$this.visitCompoundSelector$1(component.selector); + }, + $signature: 48 + }; + A._IsUselessVisitor.prototype = { + visitComplexSelector$1(complex) { + return complex.leadingCombinators.length > 1 || B.JSArray_methods.any$1(complex.components, new A._IsUselessVisitor_visitComplexSelector_closure(this)); + }, + visitPseudoSelector$1(pseudo) { + return pseudo.accept$1(B._IsBogusVisitor_true); + } + }; + A._IsUselessVisitor_visitComplexSelector_closure.prototype = { + call$1(component) { + return component.combinators.length > 1 || this.$this.visitCompoundSelector$1(component.selector); + }, + $signature: 48 + }; + A.__IsBogusVisitor_Object_AnySelectorVisitor.prototype = {}; + A.__IsInvisibleVisitor_Object_AnySelectorVisitor.prototype = {}; + A.__IsUselessVisitor_Object_AnySelectorVisitor.prototype = {}; + A.AttributeSelector.prototype = { + accept$1$1(visitor) { + return visitor.visitAttributeSelector$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + $eq(_, other) { + var _this = this; + if (other == null) + return false; + return other instanceof A.AttributeSelector && other.name.$eq(0, _this.name) && other.op == _this.op && other.value == _this.value && other.modifier == _this.modifier; + }, + get$hashCode(_) { + var _this = this, + t1 = _this.name; + return (B.JSString_methods.get$hashCode(t1.name) ^ J.get$hashCode$(t1.namespace) ^ J.get$hashCode$(_this.op) ^ J.get$hashCode$(_this.value) ^ J.get$hashCode$(_this.modifier)) >>> 0; + } + }; + A.AttributeOperator.prototype = { + _enumToString$0() { + return "AttributeOperator." + this._name; + }, + toString$0(_) { + return this._attribute$_text; + } + }; + A.ClassSelector.prototype = { + $eq(_, other) { + if (other == null) + return false; + return other instanceof A.ClassSelector && other.name === this.name; + }, + accept$1$1(visitor) { + return visitor.visitClassSelector$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + addSuffix$1(suffix) { + return new A.ClassSelector(this.name + suffix, this.span); + }, + get$hashCode(_) { + return B.JSString_methods.get$hashCode(this.name); + } + }; + A.Combinator.prototype = { + _enumToString$0() { + return "Combinator." + this._name; + }, + toString$0(_) { + return this._combinator$_text; + } + }; + A.ComplexSelector.prototype = { + get$specificity() { + var result, _this = this, + value = _this.__ComplexSelector_specificity_FI; + if (value === $) { + result = B.JSArray_methods.fold$2(_this.components, 0, new A.ComplexSelector_specificity_closure()); + _this.__ComplexSelector_specificity_FI !== $ && A.throwUnnamedLateFieldADI(); + _this.__ComplexSelector_specificity_FI = result; + value = result; + } + return value; + }, + get$singleCompound() { + var _0_0, _0_4, t1, selector, _null = null; + if (this.leadingCombinators.length !== 0) + return _null; + _0_0 = this.components; + $label0$0: { + if (_0_0.length === 1) { + _0_4 = _0_0[0]; + t1 = _0_4; + selector = t1.selector; + t1 = _0_4.combinators.length <= 0; + } else { + selector = _null; + t1 = false; + } + if (t1) { + t1 = selector; + break $label0$0; + } + t1 = _null; + break $label0$0; + } + return t1; + }, + accept$1$1(visitor) { + return visitor.visitComplexSelector$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + isSuperselector$1(other) { + return this.leadingCombinators.length === 0 && other.leadingCombinators.length === 0 && A.complexIsSuperselector(this.components, other.components); + }, + withAdditionalCombinators$1(combinators) { + var _0_0, _0_1, initial, last, t1, t2, _this = this; + if (combinators.length === 0) + return _this; + _0_0 = _this.components; + $label0$0: { + _0_1 = _0_0.length; + if (_0_1 >= 1) { + initial = B.JSArray_methods.sublist$2(_0_0, 0, _0_1 - 1); + last = _0_0[_0_1 - 1]; + t1 = A.List_List$of(initial, true, type$.ComplexSelectorComponent); + t1.push(last.withAdditionalCombinators$1(combinators)); + t2 = _this.lineBreak || false; + t2 = A.ComplexSelector$(_this.leadingCombinators, t1, _this.span, t2); + t1 = t2; + break $label0$0; + } + if (_0_1 <= 0) { + t1 = A.List_List$of(_this.leadingCombinators, true, type$.CssValue_Combinator); + B.JSArray_methods.addAll$1(t1, combinators); + t2 = _this.lineBreak || false; + t2 = A.ComplexSelector$(t1, B.List_empty0, _this.span, t2); + t1 = t2; + break $label0$0; + } + throw A.wrapException(A.ReachabilityError$(string$.None_o)); + } + return t1; + }, + concatenate$3$forceLineBreak(child, span, forceLineBreak) { + var t2, _0_1, initial, last, _this = this, + t1 = child.leadingCombinators, + _0_0 = _this.components; + if (t1.length === 0) { + t1 = A.List_List$of(_0_0, true, type$.ComplexSelectorComponent); + B.JSArray_methods.addAll$1(t1, child.components); + t2 = _this.lineBreak || child.lineBreak || forceLineBreak; + return A.ComplexSelector$(_this.leadingCombinators, t1, span, t2); + } else { + _0_1 = _0_0.length; + if (_0_1 >= 1) { + t2 = _0_1 - 1; + initial = B.JSArray_methods.sublist$2(_0_0, 0, t2); + last = _0_0[t2]; + t2 = A.List_List$of(initial, true, type$.ComplexSelectorComponent); + t2.push(last.withAdditionalCombinators$1(t1)); + B.JSArray_methods.addAll$1(t2, child.components); + t1 = _this.lineBreak || child.lineBreak || forceLineBreak; + return A.ComplexSelector$(_this.leadingCombinators, t2, span, t1); + } else { + t2 = A.List_List$of(_this.leadingCombinators, true, type$.CssValue_Combinator); + B.JSArray_methods.addAll$1(t2, t1); + t1 = _this.lineBreak || child.lineBreak || forceLineBreak; + return A.ComplexSelector$(t2, child.components, span, t1); + } + } + }, + concatenate$2(child, span) { + return this.concatenate$3$forceLineBreak(child, span, false); + }, + get$hashCode(_) { + return B.C_ListEquality0.hash$1(this.leadingCombinators) ^ B.C_ListEquality0.hash$1(this.components); + }, + $eq(_, other) { + if (other == null) + return false; + return other instanceof A.ComplexSelector && B.C_ListEquality.equals$2(0, this.leadingCombinators, other.leadingCombinators) && B.C_ListEquality.equals$2(0, this.components, other.components); + } + }; + A.ComplexSelector_specificity_closure.prototype = { + call$2(sum, component) { + return sum + component.selector.get$specificity(); + }, + $signature: 509 + }; + A.ComplexSelectorComponent.prototype = { + withAdditionalCombinators$1(combinators) { + var t1, t2, _this = this; + if (combinators.length === 0) + t1 = _this; + else { + t1 = type$.CssValue_Combinator; + t2 = A.List_List$of(_this.combinators, true, t1); + B.JSArray_methods.addAll$1(t2, combinators); + t1 = new A.ComplexSelectorComponent(_this.selector, A.List_List$unmodifiable(t2, t1), _this.span); + } + return t1; + }, + get$hashCode(_) { + return B.C_ListEquality0.hash$1(this.selector.components) ^ B.C_ListEquality0.hash$1(this.combinators); + }, + $eq(_, other) { + var t1; + if (other == null) + return false; + if (other instanceof A.ComplexSelectorComponent) { + t1 = B.C_ListEquality.equals$2(0, this.selector.components, other.selector.components); + t1 = t1 && B.C_ListEquality.equals$2(0, this.combinators, other.combinators); + } else + t1 = false; + return t1; + }, + toString$0(_) { + var t1 = this.combinators; + return A.serializeSelector(this.selector, true) + new A.MappedListIterable(t1, new A.ComplexSelectorComponent_toString_closure(), A._arrayInstanceType(t1)._eval$1("MappedListIterable<1,String>")).join$1(0, ""); + } + }; + A.ComplexSelectorComponent_toString_closure.prototype = { + call$1(combinator) { + return " " + combinator.toString$0(0); + }, + $signature: 508 + }; + A.CompoundSelector.prototype = { + get$specificity() { + var result, _this = this, + value = _this.__CompoundSelector_specificity_FI; + if (value === $) { + result = B.JSArray_methods.fold$2(_this.components, 0, new A.CompoundSelector_specificity_closure()); + _this.__CompoundSelector_specificity_FI !== $ && A.throwUnnamedLateFieldADI(); + _this.__CompoundSelector_specificity_FI = result; + value = result; + } + return value; + }, + accept$1$1(visitor) { + return visitor.visitCompoundSelector$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + get$hashCode(_) { + return B.C_ListEquality0.hash$1(this.components); + }, + $eq(_, other) { + if (other == null) + return false; + return other instanceof A.CompoundSelector && B.C_ListEquality.equals$2(0, this.components, other.components); + } + }; + A.CompoundSelector_specificity_closure.prototype = { + call$2(sum, component) { + return sum + component.get$specificity(); + }, + $signature: 503 + }; + A.IDSelector.prototype = { + get$specificity() { + return A._asInt(Math.pow(A.SimpleSelector.prototype.get$specificity.call(this), 2)); + }, + accept$1$1(visitor) { + return visitor.visitIDSelector$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + addSuffix$1(suffix) { + return new A.IDSelector(this.name + suffix, this.span); + }, + unify$1(compound) { + if (B.JSArray_methods.any$1(compound, new A.IDSelector_unify_closure(this))) + return null; + return this.super$SimpleSelector$unify(compound); + }, + $eq(_, other) { + if (other == null) + return false; + return other instanceof A.IDSelector && other.name === this.name; + }, + get$hashCode(_) { + return B.JSString_methods.get$hashCode(this.name); + } + }; + A.IDSelector_unify_closure.prototype = { + call$1(simple) { + var t1; + if (simple instanceof A.IDSelector) + t1 = this.$this.name !== simple.name; + else + t1 = false; + return t1; + }, + $signature: 15 + }; + A.SelectorList.prototype = { + get$asSassList() { + var t1 = this.components; + return A.SassList$(new A.MappedListIterable(t1, new A.SelectorList_asSassList_closure(), A._arrayInstanceType(t1)._eval$1("MappedListIterable<1,Value>")), B.ListSeparator_rXA, false); + }, + accept$1$1(visitor) { + return visitor.visitSelectorList$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + unify$1(other) { + var t3, t4, t5, t6, _i, complex1, _i0, t7, + t1 = type$.JSArray_ComplexSelector, + t2 = A._setArrayType([], t1); + for (t3 = this.components, t4 = t3.length, t5 = other.components, t6 = t5.length, _i = 0; _i < t4; ++_i) { + complex1 = t3[_i]; + for (_i0 = 0; _i0 < t6; ++_i0) { + t7 = A.unifyComplex(A._setArrayType([complex1, t5[_i0]], t1), complex1.span); + if (t7 != null) + B.JSArray_methods.addAll$1(t2, t7); + } + } + return t2.length === 0 ? null : A.SelectorList$(t2, this.span); + }, + resolveParentSelectors$2$implicitParent($parent, implicitParent) { + var parentSelector, t1, _this = this; + if ($parent == null) { + parentSelector = B.C__ParentSelectorVisitor.visitSelectorList$1(_this); + if (parentSelector == null) + return _this; + throw A.wrapException(A.SassException$(string$.Top_le, parentSelector.span, null)); + } + t1 = _this.components; + return A.SelectorList$(A.flattenVertically(new A.MappedListIterable(t1, new A.SelectorList_resolveParentSelectors_closure(_this, implicitParent, $parent), A._arrayInstanceType(t1)._eval$1("MappedListIterable<1,Iterable>")), type$.ComplexSelector), _this.span); + }, + resolveParentSelectors$1($parent) { + return this.resolveParentSelectors$2$implicitParent($parent, true); + }, + _resolveParentSelectorsCompound$2(component, $parent) { + var resolvedSimples, parentSelector, error, stackTrace, t2, resolvedSimples0, exception, + t1 = component.selector, + simples = t1.components, + containsSelectorPseudo = J.any$1$ax(simples, new A.SelectorList__resolveParentSelectorsCompound_closure()); + if (!containsSelectorPseudo && !(J.get$first$ax(simples) instanceof A.ParentSelector)) + return null; + if (containsSelectorPseudo) { + t2 = simples; + resolvedSimples0 = new A.MappedListIterable(t2, new A.SelectorList__resolveParentSelectorsCompound_closure0($parent), A.instanceType(t2)._eval$1("MappedListIterable<1,SimpleSelector>")); + } else + resolvedSimples0 = simples; + resolvedSimples = resolvedSimples0; + parentSelector = J.get$first$ax(simples); + try { + if (!(parentSelector instanceof A.ParentSelector)) { + t2 = component.span; + t2 = A._setArrayType([A.ComplexSelector$(B.List_empty1, A._setArrayType([new A.ComplexSelectorComponent(A.CompoundSelector$(resolvedSimples, t1.span), A.List_List$unmodifiable(component.combinators, type$.CssValue_Combinator), t2)], type$.JSArray_ComplexSelectorComponent), t2, false)], type$.JSArray_ComplexSelector); + return t2; + } else if (J.get$length$asx(simples) === 1 && parentSelector.suffix == null) { + t1 = $parent.withAdditionalCombinators$1(component.combinators); + return t1.components; + } + } catch (exception) { + t1 = A.unwrapException(exception); + if (t1 instanceof A.SassException) { + error = t1; + stackTrace = A.getTraceFromException(exception); + A.throwWithTrace(error.withAdditionalSpan$2(parentSelector.span, "parent selector"), error, stackTrace); + } else + throw exception; + } + t1 = $parent.components; + return new A.MappedListIterable(t1, new A.SelectorList__resolveParentSelectorsCompound_closure1(parentSelector, resolvedSimples, component), A._arrayInstanceType(t1)._eval$1("MappedListIterable<1,ComplexSelector>")); + }, + isSuperselector$1(other) { + return A.listIsSuperselector(this.components, other.components); + }, + withAdditionalCombinators$1(combinators) { + var t1; + if (combinators.length === 0) + t1 = this; + else { + t1 = this.components; + t1 = A.SelectorList$(new A.MappedListIterable(t1, new A.SelectorList_withAdditionalCombinators_closure(combinators), A._arrayInstanceType(t1)._eval$1("MappedListIterable<1,ComplexSelector>")), this.span); + } + return t1; + }, + get$hashCode(_) { + return B.C_ListEquality0.hash$1(this.components); + }, + $eq(_, other) { + if (other == null) + return false; + return other instanceof A.SelectorList && B.C_ListEquality.equals$2(0, this.components, other.components); + } + }; + A.SelectorList_asSassList_closure.prototype = { + call$1(complex) { + var t3, t4, _i, component, t5, visitor, t6, t7, _i0, + t1 = type$.JSArray_Value, + t2 = A._setArrayType([], t1); + for (t3 = complex.leadingCombinators, t4 = t3.length, _i = 0; _i < t4; ++_i) + t2.push(new A.SassString(J.toString$0$(t3[_i].value), false)); + for (t3 = complex.components, t4 = t3.length, _i = 0; _i < t4; ++_i) { + component = t3[_i]; + t5 = component.selector; + visitor = A._SerializeVisitor$(null, true, null, true, false, null, true); + t5.accept$1(visitor); + t5 = A._setArrayType([new A.SassString(visitor._serialize$_buffer.toString$0(0), false)], t1); + for (t6 = component.combinators, t7 = t6.length, _i0 = 0; _i0 < t7; ++_i0) + t5.push(new A.SassString(J.toString$0$(t6[_i0].value), false)); + B.JSArray_methods.addAll$1(t2, t5); + } + return A.SassList$(t2, B.ListSeparator_EVt, false); + }, + $signature: 501 + }; + A.SelectorList_resolveParentSelectors_closure.prototype = { + call$1(complex) { + var t1, newComplexes, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, _i, component, resolved, i, t12, t13, t14, _i0, newComplex, t15, _this = this; + if (complex.accept$1(B.C__ParentSelectorVisitor) == null) { + if (!_this.implicitParent) + return A._setArrayType([complex], type$.JSArray_ComplexSelector); + t1 = _this.parent.components; + return new A.MappedListIterable(t1, new A.SelectorList_resolveParentSelectors__closure(complex), A._arrayInstanceType(t1)._eval$1("MappedListIterable<1,ComplexSelector>")); + } + t1 = type$.JSArray_ComplexSelector; + newComplexes = A._setArrayType([], t1); + for (t2 = complex.components, t3 = t2.length, t4 = _this.$this, t5 = _this.parent, t6 = type$.ComplexSelector, t7 = complex.leadingCombinators, t8 = t7.length === 0, t9 = complex.span, t10 = type$.ComplexSelectorComponent, t11 = type$.JSArray_ComplexSelectorComponent, _i = 0; _i < t3; ++_i) { + component = t2[_i]; + resolved = t4._resolveParentSelectorsCompound$2(component, t5); + if (resolved == null) + if (newComplexes.length === 0) + newComplexes.push(A.ComplexSelector$(t7, A._setArrayType([component], t11), t9, false)); + else + for (i = 0; i < newComplexes.length; ++i) { + t12 = newComplexes[i]; + t13 = t12.leadingCombinators; + t14 = A.List_List$of(t12.components, true, t10); + t14.push(component); + newComplexes[i] = A.ComplexSelector$(t13, t14, t9, t12.lineBreak || false); + } + else if (newComplexes.length === 0) + B.JSArray_methods.addAll$1(newComplexes, t8 ? resolved : J.map$1$1$ax(resolved, new A.SelectorList_resolveParentSelectors__closure0(complex), t6)); + else { + t12 = A._setArrayType([], t1); + for (t13 = newComplexes.length, t14 = J.getInterceptor$ax(resolved), _i0 = 0; _i0 < newComplexes.length; newComplexes.length === t13 || (0, A.throwConcurrentModificationError)(newComplexes), ++_i0) { + newComplex = newComplexes[_i0]; + for (t15 = t14.get$iterator(resolved); t15.moveNext$0();) + t12.push(newComplex.concatenate$2(t15.get$current(t15), newComplex.span)); + } + newComplexes = t12; + } + } + return newComplexes; + }, + $signature: 494 + }; + A.SelectorList_resolveParentSelectors__closure.prototype = { + call$1(parentComplex) { + var t1 = this.complex; + return parentComplex.concatenate$2(t1, t1.span); + }, + $signature: 62 + }; + A.SelectorList_resolveParentSelectors__closure0.prototype = { + call$1(resolvedComplex) { + var t1 = resolvedComplex.leadingCombinators, + t2 = this.complex, + t3 = t2.leadingCombinators; + if (t1.length === 0) + t1 = t3; + else { + t3 = A.List_List$of(t3, true, type$.CssValue_Combinator); + B.JSArray_methods.addAll$1(t3, t1); + t1 = t3; + } + return A.ComplexSelector$(t1, resolvedComplex.components, t2.span, resolvedComplex.lineBreak); + }, + $signature: 62 + }; + A.SelectorList__resolveParentSelectorsCompound_closure.prototype = { + call$1(simple) { + var selector; + if (!(simple instanceof A.PseudoSelector)) + return false; + selector = simple.selector; + return selector != null && selector.accept$1(B.C__ParentSelectorVisitor) != null; + }, + $signature: 15 + }; + A.SelectorList__resolveParentSelectorsCompound_closure0.prototype = { + call$1(simple) { + var _0_2, selector, t1; + $label0$0: { + if (simple instanceof A.PseudoSelector) { + _0_2 = simple.selector; + if (_0_2 != null) { + selector = _0_2 == null ? type$.SelectorList._as(_0_2) : _0_2; + t1 = selector.accept$1(B.C__ParentSelectorVisitor) != null; + } else { + selector = null; + t1 = false; + } + } else { + selector = null; + t1 = false; + } + if (t1) { + t1 = simple.withSelector$1(selector.resolveParentSelectors$2$implicitParent(this.parent, false)); + break $label0$0; + } + t1 = simple; + break $label0$0; + } + return t1; + }, + $signature: 492 + }; + A.SelectorList__resolveParentSelectorsCompound_closure1.prototype = { + call$1(complex) { + var lastComponent, suffix, lastSimples, t1, t2, last, t3, error, stackTrace, t4, t5, t6, t7, exception, _this = this; + try { + t4 = complex.components; + lastComponent = B.JSArray_methods.get$last(t4); + if (lastComponent.combinators.length !== 0) { + t1 = A.MultiSpanSassException$('Selector "' + complex.toString$0(0) + string$.x22x20can_, A.SpanExtensions_trimRight(lastComponent.span), "outer selector", A.LinkedHashMap_LinkedHashMap$_literal([_this.parentSelector.span, "parent selector"], type$.FileSpan, type$.String), null); + throw A.wrapException(t1); + } + suffix = _this.parentSelector.suffix; + lastSimples = lastComponent.selector.components; + t5 = type$.SimpleSelector; + t6 = _this.resolvedSimples; + t7 = J.getInterceptor$ax(t6); + if (suffix == null) { + t1 = A.List_List$of(lastSimples, true, t5); + J.addAll$1$ax(t1, t7.skip$1(t6, 1)); + t1 = t1; + } else { + t2 = A.List_List$of(A.IterableExtension_get_exceptLast(lastSimples), true, t5); + J.add$1$ax(t2, J.get$last$ax(lastSimples).addSuffix$1(suffix)); + J.addAll$1$ax(t2, t7.skip$1(t6, 1)); + t1 = t2; + } + t2 = _this.component; + last = A.CompoundSelector$(t1, t2.selector.span); + t3 = A.List_List$of(A.IterableExtension_get_exceptLast(t4), true, type$.ComplexSelectorComponent); + t4 = t2.span; + J.add$1$ax(t3, new A.ComplexSelectorComponent(last, A.List_List$unmodifiable(t2.combinators, type$.CssValue_Combinator), t4)); + t4 = A.ComplexSelector$(complex.leadingCombinators, t3, t4, complex.lineBreak); + return t4; + } catch (exception) { + t1 = A.unwrapException(exception); + if (t1 instanceof A.SassException) { + error = t1; + stackTrace = A.getTraceFromException(exception); + A.throwWithTrace(error.withAdditionalSpan$2(_this.parentSelector.span, "parent selector"), error, stackTrace); + } else + throw exception; + } + }, + $signature: 62 + }; + A.SelectorList_withAdditionalCombinators_closure.prototype = { + call$1(complex) { + return complex.withAdditionalCombinators$1(this.combinators); + }, + $signature: 62 + }; + A._ParentSelectorVisitor.prototype = { + visitParentSelector$1(selector) { + return selector; + } + }; + A.__ParentSelectorVisitor_Object_SelectorSearchVisitor.prototype = {}; + A.ParentSelector.prototype = { + accept$1$1(visitor) { + return visitor.visitParentSelector$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + unify$1(compound) { + return A.throwExpression(A.UnsupportedError$("& doesn't support unification.")); + } + }; + A.PlaceholderSelector.prototype = { + accept$1$1(visitor) { + return visitor.visitPlaceholderSelector$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + addSuffix$1(suffix) { + return new A.PlaceholderSelector(this.name + suffix, this.span); + }, + $eq(_, other) { + if (other == null) + return false; + return other instanceof A.PlaceholderSelector && other.name === this.name; + }, + get$hashCode(_) { + return B.JSString_methods.get$hashCode(this.name); + } + }; + A.PseudoSelector.prototype = { + get$isHostContext() { + return this.isClass && this.name === "host-context" && this.selector != null; + }, + get$specificity() { + var result, _this = this, + value = _this.__PseudoSelector_specificity_FI; + if (value === $) { + result = new A.PseudoSelector_specificity_closure(_this).call$0(); + _this.__PseudoSelector_specificity_FI !== $ && A.throwUnnamedLateFieldADI(); + _this.__PseudoSelector_specificity_FI = result; + value = result; + } + return value; + }, + withSelector$1(selector) { + var _this = this; + return A.PseudoSelector$(_this.name, _this.span, _this.argument, !_this.isClass, selector); + }, + addSuffix$1(suffix) { + var _this = this; + if (_this.argument != null || _this.selector != null) + _this.super$SimpleSelector$addSuffix(suffix); + return A.PseudoSelector$(_this.name + suffix, _this.span, null, !_this.isClass, null); + }, + unify$1(compound) { + var other, result, t2, addedThis, _i, simple, _this = this, + t1 = _this.name; + if (t1 === "host" || t1 === "host-context") { + if (!B.JSArray_methods.every$1(compound, new A.PseudoSelector_unify_closure())) + return null; + } else { + if (compound.length === 1) { + other = compound[0]; + if (!(other instanceof A.UniversalSelector)) + if (other instanceof A.PseudoSelector) + t1 = other.isClass && other.name === "host" || other.get$isHostContext(); + else + t1 = false; + else + t1 = true; + } else { + other = null; + t1 = false; + } + if (t1) + return other.unify$1(A._setArrayType([_this], type$.JSArray_SimpleSelector)); + } + if (B.JSArray_methods.contains$1(compound, _this)) + return compound; + result = A._setArrayType([], type$.JSArray_SimpleSelector); + for (t1 = compound.length, t2 = !_this.isClass, addedThis = false, _i = 0; _i < compound.length; compound.length === t1 || (0, A.throwConcurrentModificationError)(compound), ++_i) { + simple = compound[_i]; + if (simple instanceof A.PseudoSelector && !simple.isClass) { + if (t2) + return null; + result.push(_this); + addedThis = true; + } + result.push(simple); + } + if (!addedThis) + result.push(_this); + return result; + }, + isSuperselector$1(other) { + var selector, t1, t2, _this = this; + if (_this.super$SimpleSelector$isSuperselector(other)) + return true; + selector = _this.selector; + if (selector == null) + return _this.$eq(0, other); + if (other instanceof A.PseudoSelector && !_this.isClass && !other.isClass && _this.normalizedName === "slotted" && other.name === _this.name) { + t1 = A.NullableExtension_andThen(other.selector, selector.get$isSuperselector()); + return t1 == null ? false : t1; + } + t1 = type$.JSArray_SimpleSelector; + t2 = _this.span; + return A.compoundIsSuperselector(A.CompoundSelector$(A._setArrayType([_this], t1), t2), A.CompoundSelector$(A._setArrayType([other], t1), t2), null); + }, + accept$1$1(visitor) { + return visitor.visitPseudoSelector$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + $eq(_, other) { + var _this = this; + if (other == null) + return false; + return other instanceof A.PseudoSelector && other.name === _this.name && other.isClass === _this.isClass && other.argument == _this.argument && J.$eq$(other.selector, _this.selector); + }, + get$hashCode(_) { + var _this = this, + t1 = B.JSString_methods.get$hashCode(_this.name), + t2 = !_this.isClass ? 519018 : 218159; + return t1 ^ t2 ^ J.get$hashCode$(_this.argument) ^ J.get$hashCode$(_this.selector); + } + }; + A.PseudoSelector_specificity_closure.prototype = { + call$0() { + var selector, t2, + t1 = this.$this; + if (!t1.isClass) + return 1; + selector = t1.selector; + if (selector == null) + return A.SimpleSelector.prototype.get$specificity.call(t1); + switch (t1.normalizedName) { + case "where": + return 0; + case "is": + case "not": + case "has": + case "matches": + t1 = selector.components; + return A.IterableIntegerExtension_get_max(new A.MappedListIterable(t1, new A.PseudoSelector_specificity__closure(), A._arrayInstanceType(t1)._eval$1("MappedListIterable<1,int>"))); + case "nth-child": + case "nth-last-child": + t1 = A.SimpleSelector.prototype.get$specificity.call(t1); + t2 = selector.components; + return t1 + A.IterableIntegerExtension_get_max(new A.MappedListIterable(t2, new A.PseudoSelector_specificity__closure0(), A._arrayInstanceType(t2)._eval$1("MappedListIterable<1,int>"))); + default: + return A.SimpleSelector.prototype.get$specificity.call(t1); + } + }, + $signature: 10 + }; + A.PseudoSelector_specificity__closure.prototype = { + call$1(component) { + return component.get$specificity(); + }, + $signature: 179 + }; + A.PseudoSelector_specificity__closure0.prototype = { + call$1(component) { + return component.get$specificity(); + }, + $signature: 179 + }; + A.PseudoSelector_unify_closure.prototype = { + call$1(simple) { + var t1; + if (simple instanceof A.PseudoSelector) + t1 = simple.isClass && simple.name === "host" || simple.selector != null; + else + t1 = false; + return t1; + }, + $signature: 15 + }; + A.QualifiedName.prototype = { + $eq(_, other) { + if (other == null) + return false; + return other instanceof A.QualifiedName && other.name === this.name && other.namespace == this.namespace; + }, + get$hashCode(_) { + return B.JSString_methods.get$hashCode(this.name) ^ J.get$hashCode$(this.namespace); + }, + toString$0(_) { + var t1 = this.namespace, + t2 = this.name; + return t1 == null ? t2 : t1 + "|" + t2; + } + }; + A.SimpleSelector.prototype = { + get$specificity() { + return 1000; + }, + addSuffix$1(suffix) { + return A.throwExpression(A.MultiSpanSassException$('Selector "' + this.toString$0(0) + "\" can't have a suffix", this.span, "outer selector", A.LinkedHashMap_LinkedHashMap$_empty(type$.FileSpan, type$.String), null)); + }, + unify$1(compound) { + var other, t1, result, addedThis, _i, simple, _this = this; + if (compound.length === 1) { + other = compound[0]; + if (!(other instanceof A.UniversalSelector)) + if (other instanceof A.PseudoSelector) + t1 = other.isClass && other.name === "host" || other.get$isHostContext(); + else + t1 = false; + else + t1 = true; + } else { + other = null; + t1 = false; + } + if (t1) + return other.unify$1(A._setArrayType([_this], type$.JSArray_SimpleSelector)); + if (B.JSArray_methods.contains$1(compound, _this)) + return compound; + result = A._setArrayType([], type$.JSArray_SimpleSelector); + for (t1 = compound.length, addedThis = false, _i = 0; _i < compound.length; compound.length === t1 || (0, A.throwConcurrentModificationError)(compound), ++_i) { + simple = compound[_i]; + if (!addedThis && simple instanceof A.PseudoSelector) { + result.push(_this); + addedThis = true; + } + result.push(simple); + } + if (!addedThis) + result.push(_this); + return result; + }, + isSuperselector$1(other) { + var list; + if (this.$eq(0, other)) + return true; + if (other instanceof A.PseudoSelector && other.isClass) { + list = other.selector; + if (list != null && $._subselectorPseudos.contains$1(0, other.normalizedName)) + return B.JSArray_methods.every$1(list.components, new A.SimpleSelector_isSuperselector_closure(this)); + } + return false; + } + }; + A.SimpleSelector_isSuperselector_closure.prototype = { + call$1(complex) { + var t1 = complex.components; + return t1.length !== 0 && B.JSArray_methods.any$1(B.JSArray_methods.get$last(t1).selector.components, new A.SimpleSelector_isSuperselector__closure(this.$this)); + }, + $signature: 18 + }; + A.SimpleSelector_isSuperselector__closure.prototype = { + call$1(simple) { + return this.$this.isSuperselector$1(simple); + }, + $signature: 15 + }; + A.TypeSelector.prototype = { + get$specificity() { + return 1; + }, + accept$1$1(visitor) { + return visitor.visitTypeSelector$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + addSuffix$1(suffix) { + var t1 = this.name; + return new A.TypeSelector(new A.QualifiedName(t1.name + suffix, t1.namespace), this.span); + }, + unify$1(compound) { + var unified, t1, + _0_0 = B.JSArray_methods.get$first(compound); + if (_0_0 instanceof A.UniversalSelector || _0_0 instanceof A.TypeSelector) { + unified = A.unifyUniversalAndElement(this, B.JSArray_methods.get$first(compound)); + if (unified == null) + return null; + t1 = A._setArrayType([unified], type$.JSArray_SimpleSelector); + B.JSArray_methods.addAll$1(t1, A.SubListIterable$(compound, 1, null, A._arrayInstanceType(compound)._precomputed1)); + return t1; + } else { + t1 = A._setArrayType([this], type$.JSArray_SimpleSelector); + B.JSArray_methods.addAll$1(t1, compound); + return t1; + } + }, + isSuperselector$1(other) { + var t1, t2; + if (!this.super$SimpleSelector$isSuperselector(other)) + if (other instanceof A.TypeSelector) { + t1 = this.name; + t2 = other.name; + if (t1.name === t2.name) { + t1 = t1.namespace; + t1 = t1 === "*" || t1 == t2.namespace; + } else + t1 = false; + } else + t1 = false; + else + t1 = true; + return t1; + }, + $eq(_, other) { + if (other == null) + return false; + return other instanceof A.TypeSelector && other.name.$eq(0, this.name); + }, + get$hashCode(_) { + var t1 = this.name; + return B.JSString_methods.get$hashCode(t1.name) ^ J.get$hashCode$(t1.namespace); + } + }; + A.UniversalSelector.prototype = { + get$specificity() { + return 0; + }, + accept$1$1(visitor) { + return visitor.visitUniversalSelector$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + unify$1(compound) { + var _0_4, t1, rest, _0_4_isSet, unified, _this = this, _null = null, + _0_1 = compound.length; + if (_0_1 >= 1) { + _0_4 = compound[0]; + t1 = _0_4; + if (!(t1 instanceof A.UniversalSelector)) + t1 = _0_4 instanceof A.TypeSelector; + else + t1 = true; + if (t1) { + rest = B.JSArray_methods.sublist$1(compound, 1); + t1 = true; + } else { + rest = _null; + t1 = false; + } + _0_4_isSet = true; + } else { + rest = _null; + _0_4 = rest; + _0_4_isSet = false; + t1 = false; + } + if (t1) { + unified = A.unifyUniversalAndElement(_this, B.JSArray_methods.get$first(compound)); + if (unified == null) + return _null; + t1 = A._setArrayType([unified], type$.JSArray_SimpleSelector); + B.JSArray_methods.addAll$1(t1, rest); + return t1; + } + if (_0_1 === 1) { + if (_0_4_isSet) + t1 = _0_4; + else { + _0_4 = compound[0]; + t1 = _0_4; + _0_4_isSet = true; + } + if (t1 instanceof A.PseudoSelector) { + t1 = _0_4_isSet ? _0_4 : compound[0]; + type$.PseudoSelector._as(t1); + t1 = t1.isClass && t1.name === "host" || t1.get$isHostContext(); + } else + t1 = false; + } else + t1 = false; + if (t1) + return _null; + if (_0_1 <= 0) + return A._setArrayType([_this], type$.JSArray_SimpleSelector); + t1 = _this.namespace; + if (t1 == null || t1 === "*") + t1 = compound; + else { + t1 = A._setArrayType([_this], type$.JSArray_SimpleSelector); + B.JSArray_methods.addAll$1(t1, compound); + } + return t1; + }, + isSuperselector$1(other) { + var t1 = this.namespace; + if (t1 === "*") + return true; + if (other instanceof A.TypeSelector) + return t1 == other.name.namespace; + if (other instanceof A.UniversalSelector) + return t1 == other.namespace; + return t1 == null || this.super$SimpleSelector$isSuperselector(other); + }, + $eq(_, other) { + if (other == null) + return false; + return other instanceof A.UniversalSelector && other.namespace == this.namespace; + }, + get$hashCode(_) { + return J.get$hashCode$(this.namespace); + } + }; + A._compileStylesheet_closure0.prototype = { + call$1(url) { + var t1; + if (url === "") { + t1 = this.stylesheet.span; + t1 = A.Uri_Uri$dataFromString(A.String_String$fromCharCodes(B.NativeUint32List_methods.sublist$2(t1.get$file(t1)._decodedChars, 0, null), 0, null), B.C_Utf8Codec, null).get$_text(); + } else + t1 = this.importCache.sourceMapUrl$1(0, A.Uri_parse(url)).toString$0(0); + return t1; + }, + $signature: 5 + }; + A.AsyncEnvironment.prototype = { + closure$0() { + var t4, t5, t6, _this = this, + t1 = _this._async_environment$_forwardedModules, + t2 = _this._async_environment$_nestedForwardedModules, + t3 = _this._async_environment$_variables; + t3 = A._setArrayType(t3.slice(0), A._arrayInstanceType(t3)); + t4 = _this._async_environment$_variableNodes; + t4 = A._setArrayType(t4.slice(0), A._arrayInstanceType(t4)); + t5 = _this._async_environment$_functions; + t5 = A._setArrayType(t5.slice(0), A._arrayInstanceType(t5)); + t6 = _this._async_environment$_mixins; + t6 = A._setArrayType(t6.slice(0), A._arrayInstanceType(t6)); + return A.AsyncEnvironment$_(_this._async_environment$_modules, _this._async_environment$_namespaceNodes, _this._async_environment$_globalModules, _this._async_environment$_importedModules, t1, t2, _this._async_environment$_allModules, t3, t4, t5, t6, _this._async_environment$_content); + }, + forwardModule$2(module, rule) { + var view, t1, t2, _this = this, + forwardedModules = _this._async_environment$_forwardedModules; + if (forwardedModules == null) + forwardedModules = _this._async_environment$_forwardedModules = A.LinkedHashMap_LinkedHashMap$_empty(type$.Module_AsyncCallable, type$.AstNode); + view = A.ForwardedModuleView_ifNecessary(module, rule, type$.AsyncCallable); + for (t1 = A.LinkedHashMapKeyIterator$(forwardedModules, forwardedModules._modifications); t1.moveNext$0();) { + t2 = t1.__js_helper$_current; + _this._async_environment$_assertNoConflicts$5(view.get$variables(), t2.get$variables(), view, t2, "variable"); + _this._async_environment$_assertNoConflicts$5(view.get$functions(view), t2.get$functions(t2), view, t2, "function"); + _this._async_environment$_assertNoConflicts$5(view.get$mixins(), t2.get$mixins(), view, t2, "mixin"); + } + _this._async_environment$_allModules.push(module); + forwardedModules.$indexSet(0, view, rule); + }, + _async_environment$_assertNoConflicts$5(newMembers, oldMembers, newModule, oldModule, type) { + var larger, smaller, t1, t2, t3, t4, $name, small, large, span; + if (newMembers.get$length(newMembers) < oldMembers.get$length(oldMembers)) { + larger = oldMembers; + smaller = newMembers; + } else { + larger = newMembers; + smaller = oldMembers; + } + for (t1 = type$.String, t2 = A.MapExtensions_get_pairs(smaller, t1, type$.Object), t2 = t2.get$iterator(t2), t3 = type === "variable"; t2.moveNext$0();) { + t4 = t2.get$current(t2); + $name = t4._0; + small = t4._1; + large = larger.$index(0, $name); + if (large == null) + continue; + if (t3 ? newModule.variableIdentity$1($name) === oldModule.variableIdentity$1($name) : J.$eq$(large, small)) + continue; + if (t3) + $name = "$" + $name; + t2 = this._async_environment$_forwardedModules; + if (t2 == null) + span = null; + else { + t2 = t2.$index(0, oldModule); + span = t2 == null ? null : J.get$span$z(t2); + } + t2 = A.LinkedHashMap_LinkedHashMap$_empty(type$.FileSpan, t1); + if (span != null) + t2.$indexSet(0, span, "original @forward"); + throw A.wrapException(A.MultiSpanSassScriptException$("Two forwarded modules both define a " + type + " named " + $name + ".", "new @forward", t2)); + } + }, + importForwards$1(module) { + var forwardedModules, t1, t2, t3, t4, node, t5, t6, t7, t8, t9, t10, _i, t11, shadowed, _length, _list, _this = this, + forwarded = module._async_environment$_environment._async_environment$_forwardedModules; + if (forwarded == null) + return; + forwardedModules = _this._async_environment$_forwardedModules; + if (forwardedModules != null) { + t1 = type$.Module_AsyncCallable; + t2 = type$.AstNode; + t3 = A.LinkedHashMap_LinkedHashMap$_empty(t1, t2); + for (t1 = A.MapExtensions_get_pairs(forwarded, t1, t2), t1 = t1.get$iterator(t1), t2 = _this._async_environment$_globalModules; t1.moveNext$0();) { + t4 = t1.get$current(t1); + module = t4._0; + node = t4._1; + if (!forwardedModules.containsKey$1(module) || !t2.containsKey$1(module)) + t3.$indexSet(0, module, node); + } + forwarded = t3; + } else + forwardedModules = _this._async_environment$_forwardedModules = A.LinkedHashMap_LinkedHashMap$_empty(type$.Module_AsyncCallable, type$.AstNode); + t1 = type$.String; + t2 = A.LinkedHashSet_LinkedHashSet$_empty(t1); + for (t3 = A.LinkedHashMapKeyIterator$(forwarded, forwarded._modifications); t3.moveNext$0();) + for (t4 = t3.__js_helper$_current.get$variables(), t4 = J.get$iterator$ax(t4.get$keys(t4)); t4.moveNext$0();) + t2.add$1(0, t4.get$current(t4)); + t3 = A.LinkedHashSet_LinkedHashSet$_empty(t1); + for (t4 = A.LinkedHashMapKeyIterator$(forwarded, forwarded._modifications); t4.moveNext$0();) { + t5 = t4.__js_helper$_current; + for (t5 = t5.get$functions(t5), t5 = J.get$iterator$ax(t5.get$keys(t5)); t5.moveNext$0();) + t3.add$1(0, t5.get$current(t5)); + } + t1 = A.LinkedHashSet_LinkedHashSet$_empty(t1); + for (t4 = A.LinkedHashMapKeyIterator$(forwarded, forwarded._modifications); t4.moveNext$0();) + for (t5 = t4.__js_helper$_current.get$mixins(), t5 = J.get$iterator$ax(t5.get$keys(t5)); t5.moveNext$0();) + t1.add$1(0, t5.get$current(t5)); + t4 = _this._async_environment$_variables; + t5 = t4.length; + if (t5 === 1) { + for (t5 = _this._async_environment$_importedModules, t6 = type$.Module_AsyncCallable, t7 = type$.AstNode, t8 = A.MapExtensions_get_pairs(t5, t6, t7).toList$0(0), t9 = t8.length, t10 = type$.AsyncCallable, _i = 0; _i < t8.length; t8.length === t9 || (0, A.throwConcurrentModificationError)(t8), ++_i) { + t11 = t8[_i]; + module = t11._0; + node = t11._1; + shadowed = A.ShadowedModuleView_ifNecessary(module, t3, t1, t2, t10); + if (shadowed != null) { + t5.remove$1(0, module); + t11 = shadowed.variables; + if (t11.get$isEmpty(t11)) { + t11 = shadowed.functions; + if (t11.get$isEmpty(t11)) { + t11 = shadowed.mixins; + if (t11.get$isEmpty(t11)) { + t11 = shadowed._shadowed_view$_inner; + t11 = t11.get$css(t11); + t11 = J.get$isEmpty$asx(t11.get$children(t11)); + } else + t11 = false; + } else + t11 = false; + } else + t11 = false; + if (!t11) + t5.$indexSet(0, shadowed, node); + } + } + for (t6 = A.MapExtensions_get_pairs(forwardedModules, t6, t7).toList$0(0), t7 = t6.length, _i = 0; _i < t6.length; t6.length === t7 || (0, A.throwConcurrentModificationError)(t6), ++_i) { + t8 = t6[_i]; + module = t8._0; + node = t8._1; + shadowed = A.ShadowedModuleView_ifNecessary(module, t3, t1, t2, t10); + if (shadowed != null) { + forwardedModules.remove$1(0, module); + t8 = shadowed.variables; + if (t8.get$isEmpty(t8)) { + t8 = shadowed.functions; + if (t8.get$isEmpty(t8)) { + t8 = shadowed.mixins; + if (t8.get$isEmpty(t8)) { + t8 = shadowed._shadowed_view$_inner; + t8 = t8.get$css(t8); + t8 = J.get$isEmpty$asx(t8.get$children(t8)); + } else + t8 = false; + } else + t8 = false; + } else + t8 = false; + if (!t8) + forwardedModules.$indexSet(0, shadowed, node); + } + } + t5.addAll$1(0, forwarded); + forwardedModules.addAll$1(0, forwarded); + } else { + t6 = _this._async_environment$_nestedForwardedModules; + if (t6 == null) { + _length = t5 - 1; + _list = J.JSArray_JSArray$allocateGrowable(_length, type$.List_Module_AsyncCallable); + for (t5 = type$.JSArray_Module_AsyncCallable, _i = 0; _i < _length; ++_i) + _list[_i] = A._setArrayType([], t5); + _this._async_environment$_nestedForwardedModules = _list; + t5 = _list; + } else + t5 = t6; + B.JSArray_methods.addAll$1(B.JSArray_methods.get$last(t5), new A.LinkedHashMapKeyIterable(forwarded, A._instanceType(forwarded)._eval$1("LinkedHashMapKeyIterable<1>"))); + } + for (t2 = A._LinkedHashSetIterator$(t2, t2._collection$_modifications, t2.$ti._precomputed1), t5 = _this._async_environment$_variableIndices, t6 = _this._async_environment$_variableNodes, t7 = t2.$ti._precomputed1; t2.moveNext$0();) { + t8 = t2._collection$_current; + if (t8 == null) + t8 = t7._as(t8); + t5.remove$1(0, t8); + J.remove$1$z(B.JSArray_methods.get$last(t4), t8); + J.remove$1$z(B.JSArray_methods.get$last(t6), t8); + } + for (t2 = A._LinkedHashSetIterator$(t3, t3._collection$_modifications, t3.$ti._precomputed1), t3 = _this._async_environment$_functionIndices, t4 = _this._async_environment$_functions, t5 = t2.$ti._precomputed1; t2.moveNext$0();) { + t6 = t2._collection$_current; + if (t6 == null) + t6 = t5._as(t6); + t3.remove$1(0, t6); + J.remove$1$z(B.JSArray_methods.get$last(t4), t6); + } + for (t1 = A._LinkedHashSetIterator$(t1, t1._collection$_modifications, t1.$ti._precomputed1), t2 = _this._async_environment$_mixinIndices, t3 = _this._async_environment$_mixins, t4 = t1.$ti._precomputed1; t1.moveNext$0();) { + t5 = t1._collection$_current; + if (t5 == null) + t5 = t4._as(t5); + t2.remove$1(0, t5); + J.remove$1$z(B.JSArray_methods.get$last(t3), t5); + } + }, + getVariable$2$namespace($name, namespace) { + var t1, _0_0, _1_0, _this = this; + if (namespace != null) + return _this._async_environment$_getModule$1(namespace).get$variables().$index(0, $name); + if (_this._async_environment$_lastVariableName === $name) { + t1 = _this._async_environment$_lastVariableIndex; + t1.toString; + t1 = J.$index$asx(_this._async_environment$_variables[t1], $name); + return t1 == null ? _this._async_environment$_getVariableFromGlobalModule$1($name) : t1; + } + t1 = _this._async_environment$_variableIndices; + _0_0 = t1.$index(0, $name); + if (_0_0 != null) { + _this._async_environment$_lastVariableName = $name; + _this._async_environment$_lastVariableIndex = _0_0; + t1 = J.$index$asx(_this._async_environment$_variables[_0_0], $name); + return t1 == null ? _this._async_environment$_getVariableFromGlobalModule$1($name) : t1; + } else { + _1_0 = _this._async_environment$_variableIndex$1($name); + if (_1_0 != null) { + _this._async_environment$_lastVariableName = $name; + _this._async_environment$_lastVariableIndex = _1_0; + t1.$indexSet(0, $name, _1_0); + t1 = J.$index$asx(_this._async_environment$_variables[_1_0], $name); + return t1 == null ? _this._async_environment$_getVariableFromGlobalModule$1($name) : t1; + } else + return _this._async_environment$_getVariableFromGlobalModule$1($name); + } + }, + getVariable$1($name) { + return this.getVariable$2$namespace($name, null); + }, + _async_environment$_getVariableFromGlobalModule$1($name) { + return this._async_environment$_fromOneModule$3($name, "variable", new A.AsyncEnvironment__getVariableFromGlobalModule_closure($name)); + }, + getVariableNode$2$namespace($name, namespace) { + var t1, _0_0, _1_0, _this = this; + if (namespace != null) + return _this._async_environment$_getModule$1(namespace).get$variableNodes().$index(0, $name); + if (_this._async_environment$_lastVariableName === $name) { + t1 = _this._async_environment$_lastVariableIndex; + t1.toString; + t1 = J.$index$asx(_this._async_environment$_variableNodes[t1], $name); + return t1 == null ? _this._async_environment$_getVariableNodeFromGlobalModule$1($name) : t1; + } + t1 = _this._async_environment$_variableIndices; + _0_0 = t1.$index(0, $name); + if (_0_0 != null) { + _this._async_environment$_lastVariableName = $name; + _this._async_environment$_lastVariableIndex = _0_0; + t1 = J.$index$asx(_this._async_environment$_variableNodes[_0_0], $name); + return t1 == null ? _this._async_environment$_getVariableNodeFromGlobalModule$1($name) : t1; + } else { + _1_0 = _this._async_environment$_variableIndex$1($name); + if (_1_0 != null) { + _this._async_environment$_lastVariableName = $name; + _this._async_environment$_lastVariableIndex = _1_0; + t1.$indexSet(0, $name, _1_0); + t1 = J.$index$asx(_this._async_environment$_variableNodes[_1_0], $name); + return t1 == null ? _this._async_environment$_getVariableNodeFromGlobalModule$1($name) : t1; + } else + return _this._async_environment$_getVariableNodeFromGlobalModule$1($name); + } + }, + _async_environment$_getVariableNodeFromGlobalModule$1($name) { + var t1, t2, _0_0; + for (t1 = this._async_environment$_importedModules, t2 = this._async_environment$_globalModules, t2 = new A.LinkedHashMapKeyIterable(t1, A._instanceType(t1)._eval$1("LinkedHashMapKeyIterable<1>")).followedBy$1(0, new A.LinkedHashMapKeyIterable(t2, A._instanceType(t2)._eval$1("LinkedHashMapKeyIterable<1>"))), t2 = new A.FollowedByIterator(J.get$iterator$ax(t2.__internal$_first), t2._second); t2.moveNext$0();) { + t1 = t2._currentIterator; + _0_0 = t1.get$current(t1).get$variableNodes().$index(0, $name); + if (_0_0 != null) + return _0_0; + } + return null; + }, + globalVariableExists$2$namespace($name, namespace) { + if (namespace != null) + return this._async_environment$_getModule$1(namespace).get$variables().containsKey$1($name); + if (B.JSArray_methods.get$first(this._async_environment$_variables).containsKey$1($name)) + return true; + return this._async_environment$_getVariableFromGlobalModule$1($name) != null; + }, + globalVariableExists$1($name) { + return this.globalVariableExists$2$namespace($name, null); + }, + _async_environment$_variableIndex$1($name) { + var t1, i; + for (t1 = this._async_environment$_variables, i = t1.length - 1; i >= 0; --i) + if (t1[i].containsKey$1($name)) + return i; + return null; + }, + setVariable$5$global$namespace($name, value, nodeWithSpan, global, namespace) { + var t1, moduleWithName, nestedForwardedModules, t2, t3, t4, t5, index, _this = this; + if (namespace != null) { + _this._async_environment$_getModule$1(namespace).setVariable$3($name, value, nodeWithSpan); + return; + } + if (global || _this._async_environment$_variables.length === 1) { + _this._async_environment$_variableIndices.putIfAbsent$2($name, new A.AsyncEnvironment_setVariable_closure(_this, $name)); + t1 = _this._async_environment$_variables; + if (!B.JSArray_methods.get$first(t1).containsKey$1($name)) { + moduleWithName = _this._async_environment$_fromOneModule$3($name, "variable", new A.AsyncEnvironment_setVariable_closure0($name)); + if (moduleWithName != null) { + moduleWithName.setVariable$3($name, value, nodeWithSpan); + return; + } + } + J.$indexSet$ax(B.JSArray_methods.get$first(t1), $name, value); + J.$indexSet$ax(B.JSArray_methods.get$first(_this._async_environment$_variableNodes), $name, nodeWithSpan); + return; + } + nestedForwardedModules = _this._async_environment$_nestedForwardedModules; + if (nestedForwardedModules != null && !_this._async_environment$_variableIndices.containsKey$1($name) && _this._async_environment$_variableIndex$1($name) == null) + for (t1 = A.instanceType(nestedForwardedModules)._eval$1("ReversedListIterable<1>"), t2 = new A.ReversedListIterable(nestedForwardedModules, t1), t2 = new A.ListIterator(t2, t2.get$length(0), t1._eval$1("ListIterator")), t1 = t1._eval$1("ListIterable.E"); t2.moveNext$0();) { + t3 = t2.__internal$_current; + for (t3 = J.get$reversed$ax(t3 == null ? t1._as(t3) : t3), t4 = t3.$ti, t3 = new A.ListIterator(t3, t3.get$length(0), t4._eval$1("ListIterator")), t4 = t4._eval$1("ListIterable.E"); t3.moveNext$0();) { + t5 = t3.__internal$_current; + if (t5 == null) + t5 = t4._as(t5); + if (t5.get$variables().containsKey$1($name)) { + t5.setVariable$3($name, value, nodeWithSpan); + return; + } + } + } + if (_this._async_environment$_lastVariableName === $name) { + t1 = _this._async_environment$_lastVariableIndex; + t1.toString; + index = t1; + } else + index = _this._async_environment$_variableIndices.putIfAbsent$2($name, new A.AsyncEnvironment_setVariable_closure1(_this, $name)); + if (!_this._async_environment$_inSemiGlobalScope && index === 0) { + index = _this._async_environment$_variables.length - 1; + _this._async_environment$_variableIndices.$indexSet(0, $name, index); + } + _this._async_environment$_lastVariableName = $name; + _this._async_environment$_lastVariableIndex = index; + J.$indexSet$ax(_this._async_environment$_variables[index], $name, value); + J.$indexSet$ax(_this._async_environment$_variableNodes[index], $name, nodeWithSpan); + }, + setVariable$4$global($name, value, nodeWithSpan, global) { + return this.setVariable$5$global$namespace($name, value, nodeWithSpan, global, null); + }, + setLocalVariable$3($name, value, nodeWithSpan) { + var index, _this = this, + t1 = _this._async_environment$_variables, + t2 = t1.length; + _this._async_environment$_lastVariableName = $name; + index = _this._async_environment$_lastVariableIndex = t2 - 1; + _this._async_environment$_variableIndices.$indexSet(0, $name, index); + J.$indexSet$ax(t1[index], $name, value); + J.$indexSet$ax(_this._async_environment$_variableNodes[index], $name, nodeWithSpan); + }, + getFunction$2$namespace($name, namespace) { + var t1, _0_0, _1_0, _this = this; + if (namespace != null) { + t1 = _this._async_environment$_getModule$1(namespace); + return t1.get$functions(t1).$index(0, $name); + } + t1 = _this._async_environment$_functionIndices; + _0_0 = t1.$index(0, $name); + if (_0_0 != null) { + t1 = J.$index$asx(_this._async_environment$_functions[_0_0], $name); + return t1 == null ? _this._async_environment$_getFunctionFromGlobalModule$1($name) : t1; + } else { + _1_0 = _this._async_environment$_functionIndex$1($name); + if (_1_0 != null) { + t1.$indexSet(0, $name, _1_0); + t1 = J.$index$asx(_this._async_environment$_functions[_1_0], $name); + return t1 == null ? _this._async_environment$_getFunctionFromGlobalModule$1($name) : t1; + } else + return _this._async_environment$_getFunctionFromGlobalModule$1($name); + } + }, + getFunction$1($name) { + return this.getFunction$2$namespace($name, null); + }, + _async_environment$_getFunctionFromGlobalModule$1($name) { + return this._async_environment$_fromOneModule$3($name, "function", new A.AsyncEnvironment__getFunctionFromGlobalModule_closure($name)); + }, + _async_environment$_functionIndex$1($name) { + var t1, i; + for (t1 = this._async_environment$_functions, i = t1.length - 1; i >= 0; --i) + if (t1[i].containsKey$1($name)) + return i; + return null; + }, + getMixin$2$namespace($name, namespace) { + var t1, _0_0, _1_0, _this = this; + if (namespace != null) + return _this._async_environment$_getModule$1(namespace).get$mixins().$index(0, $name); + t1 = _this._async_environment$_mixinIndices; + _0_0 = t1.$index(0, $name); + if (_0_0 != null) { + t1 = J.$index$asx(_this._async_environment$_mixins[_0_0], $name); + return t1 == null ? _this._async_environment$_getMixinFromGlobalModule$1($name) : t1; + } else { + _1_0 = _this._async_environment$_mixinIndex$1($name); + if (_1_0 != null) { + t1.$indexSet(0, $name, _1_0); + t1 = J.$index$asx(_this._async_environment$_mixins[_1_0], $name); + return t1 == null ? _this._async_environment$_getMixinFromGlobalModule$1($name) : t1; + } else + return _this._async_environment$_getMixinFromGlobalModule$1($name); + } + }, + _async_environment$_getMixinFromGlobalModule$1($name) { + return this._async_environment$_fromOneModule$3($name, "mixin", new A.AsyncEnvironment__getMixinFromGlobalModule_closure($name)); + }, + _async_environment$_mixinIndex$1($name) { + var t1, i; + for (t1 = this._async_environment$_mixins, i = t1.length - 1; i >= 0; --i) + if (t1[i].containsKey$1($name)) + return i; + return null; + }, + withContent$2($content, callback) { + return this.withContent$body$AsyncEnvironment($content, callback); + }, + withContent$body$AsyncEnvironment($content, callback) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void), + $async$self = this, oldContent; + var $async$withContent$2 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + oldContent = $async$self._async_environment$_content; + $async$self._async_environment$_content = $content; + $async$goto = 2; + return A._asyncAwait(callback.call$0(), $async$withContent$2); + case 2: + // returning from await. + $async$self._async_environment$_content = oldContent; + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$withContent$2, $async$completer); + }, + asMixin$1(callback) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void), + $async$self = this, oldInMixin; + var $async$asMixin$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + oldInMixin = $async$self._async_environment$_inMixin; + $async$self._async_environment$_inMixin = true; + $async$goto = 2; + return A._asyncAwait(callback.call$0(), $async$asMixin$1); + case 2: + // returning from await. + $async$self._async_environment$_inMixin = oldInMixin; + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$asMixin$1, $async$completer); + }, + scope$1$3$semiGlobal$when(callback, semiGlobal, when, $T) { + return this.scope$body$AsyncEnvironment(callback, semiGlobal, when, $T, $T); + }, + scope$1$1(callback, $T) { + return this.scope$1$3$semiGlobal$when(callback, false, true, $T); + }, + scope$1$2$when(callback, when, $T) { + return this.scope$1$3$semiGlobal$when(callback, false, when, $T); + }, + scope$1$2$semiGlobal(callback, semiGlobal, $T) { + return this.scope$1$3$semiGlobal$when(callback, semiGlobal, true, $T); + }, + scope$body$AsyncEnvironment(callback, semiGlobal, when, $T, $async$type) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter($async$type), + $async$returnValue, $async$handler = 2, $async$currentError, $async$next = [], $async$self = this, wasInSemiGlobalScope, $name, name0, name1, t1, t2, t3, t4, t5, t6; + var $async$scope$1$3$semiGlobal$when = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) { + $async$currentError = $async$result; + $async$goto = $async$handler; + } + while (true) + switch ($async$goto) { + case 0: + // Function start + semiGlobal = semiGlobal && $async$self._async_environment$_inSemiGlobalScope; + wasInSemiGlobalScope = $async$self._async_environment$_inSemiGlobalScope; + $async$self._async_environment$_inSemiGlobalScope = semiGlobal; + $async$goto = !when ? 3 : 4; + break; + case 3: + // then + $async$handler = 5; + $async$goto = 8; + return A._asyncAwait(callback.call$0(), $async$scope$1$3$semiGlobal$when); + case 8: + // returning from await. + t1 = $async$result; + $async$returnValue = t1; + $async$next = [1]; + // goto finally + $async$goto = 6; + break; + $async$next.push(7); + // goto finally + $async$goto = 6; + break; + case 5: + // uncaught + $async$next = [2]; + case 6: + // finally + $async$handler = 2; + $async$self._async_environment$_inSemiGlobalScope = wasInSemiGlobalScope; + // goto the next finally handler + $async$goto = $async$next.pop(); + break; + case 7: + // after finally + case 4: + // join + t1 = $async$self._async_environment$_variables; + t2 = type$.String; + B.JSArray_methods.add$1(t1, A.LinkedHashMap_LinkedHashMap$_empty(t2, type$.Value)); + t3 = $async$self._async_environment$_variableNodes; + B.JSArray_methods.add$1(t3, A.LinkedHashMap_LinkedHashMap$_empty(t2, type$.AstNode)); + t4 = $async$self._async_environment$_functions; + t5 = type$.AsyncCallable; + B.JSArray_methods.add$1(t4, A.LinkedHashMap_LinkedHashMap$_empty(t2, t5)); + t6 = $async$self._async_environment$_mixins; + B.JSArray_methods.add$1(t6, A.LinkedHashMap_LinkedHashMap$_empty(t2, t5)); + t5 = $async$self._async_environment$_nestedForwardedModules; + if (t5 != null) + t5.push(A._setArrayType([], type$.JSArray_Module_AsyncCallable)); + $async$handler = 9; + $async$goto = 12; + return A._asyncAwait(callback.call$0(), $async$scope$1$3$semiGlobal$when); + case 12: + // returning from await. + t2 = $async$result; + $async$returnValue = t2; + $async$next = [1]; + // goto finally + $async$goto = 10; + break; + $async$next.push(11); + // goto finally + $async$goto = 10; + break; + case 9: + // uncaught + $async$next = [2]; + case 10: + // finally + $async$handler = 2; + $async$self._async_environment$_inSemiGlobalScope = wasInSemiGlobalScope; + $async$self._async_environment$_lastVariableIndex = $async$self._async_environment$_lastVariableName = null; + for (t1 = J.get$iterator$ax(J.get$keys$z(B.JSArray_methods.removeLast$0(t1))), t2 = $async$self._async_environment$_variableIndices; t1.moveNext$0();) { + $name = t1.get$current(t1); + t2.remove$1(0, $name); + } + B.JSArray_methods.removeLast$0(t3); + for (t1 = J.get$iterator$ax(J.get$keys$z(B.JSArray_methods.removeLast$0(t4))), t2 = $async$self._async_environment$_functionIndices; t1.moveNext$0();) { + name0 = t1.get$current(t1); + t2.remove$1(0, name0); + } + for (t1 = J.get$iterator$ax(J.get$keys$z(B.JSArray_methods.removeLast$0(t6))), t2 = $async$self._async_environment$_mixinIndices; t1.moveNext$0();) { + name1 = t1.get$current(t1); + t2.remove$1(0, name1); + } + t1 = $async$self._async_environment$_nestedForwardedModules; + if (t1 != null) + t1.pop(); + // goto the next finally handler + $async$goto = $async$next.pop(); + break; + case 11: + // after finally + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + case 2: + // rethrow + return A._asyncRethrow($async$currentError, $async$completer); + } + }); + return A._asyncStartSync($async$scope$1$3$semiGlobal$when, $async$completer); + }, + toImplicitConfiguration$0() { + var t2, t3, t4, i, values, nodes, t5, t6, $name, value, + t1 = type$.String, + configuration = A.LinkedHashMap_LinkedHashMap$_empty(t1, type$.ConfiguredValue); + for (t2 = this._async_environment$_variables, t3 = type$.Value, t4 = this._async_environment$_variableNodes, i = 0; i < t2.length; ++i) { + values = t2[i]; + nodes = t4[i]; + for (t5 = A.MapExtensions_get_pairs(values, t1, t3), t5 = t5.get$iterator(t5); t5.moveNext$0();) { + t6 = t5.get$current(t5); + $name = t6._0; + value = t6._1; + t6 = nodes.$index(0, $name); + t6.toString; + configuration.$indexSet(0, $name, new A.ConfiguredValue(value, null, t6)); + } + } + return new A.Configuration(configuration, null); + }, + toModule$3(css, preModuleComments, extensionStore) { + return A._EnvironmentModule__EnvironmentModule0(this, css, preModuleComments, extensionStore, A.NullableExtension_andThen(this._async_environment$_forwardedModules, new A.AsyncEnvironment_toModule_closure())); + }, + toDummyModule$0() { + return A._EnvironmentModule__EnvironmentModule0(this, new A.CssStylesheet(new A.UnmodifiableListView(B.List_empty3, type$.UnmodifiableListView_CssNode), A.SourceFile$decoded(B.List_empty4, "").span$1(0, 0)), B.Map_empty7, B.C_EmptyExtensionStore, A.NullableExtension_andThen(this._async_environment$_forwardedModules, new A.AsyncEnvironment_toDummyModule_closure())); + }, + _async_environment$_getModule$1(namespace) { + var _0_0 = this._async_environment$_modules.$index(0, namespace); + if (_0_0 != null) + return _0_0; + throw A.wrapException(A.SassScriptException$('There is no module with the namespace "' + namespace + '".', null)); + }, + _async_environment$_fromOneModule$1$3($name, type, callback) { + var t1, t2, t3, t4, t5, _1_0, _2_0, value, identity, valueInModule, identityFromModule, module, node, + _0_0 = this._async_environment$_nestedForwardedModules; + if (_0_0 != null) + for (t1 = A._arrayInstanceType(_0_0)._eval$1("ReversedListIterable<1>"), t2 = new A.ReversedListIterable(_0_0, t1), t2 = new A.ListIterator(t2, t2.get$length(0), t1._eval$1("ListIterator")), t1 = t1._eval$1("ListIterable.E"); t2.moveNext$0();) { + t3 = t2.__internal$_current; + for (t3 = J.get$reversed$ax(t3 == null ? t1._as(t3) : t3), t4 = t3.$ti, t3 = new A.ListIterator(t3, t3.get$length(0), t4._eval$1("ListIterator")), t4 = t4._eval$1("ListIterable.E"); t3.moveNext$0();) { + t5 = t3.__internal$_current; + _1_0 = callback.call$1(t5 == null ? t4._as(t5) : t5); + if (_1_0 != null) + return _1_0; + } + } + for (t1 = this._async_environment$_importedModules, t1 = A.LinkedHashMapKeyIterator$(t1, t1._modifications); t1.moveNext$0();) { + _2_0 = callback.call$1(t1.__js_helper$_current); + if (_2_0 != null) + return _2_0; + } + for (t1 = this._async_environment$_globalModules, t2 = A.LinkedHashMapKeyIterator$(t1, t1._modifications), t3 = type$.AsyncCallable, value = null, identity = null; t2.moveNext$0();) { + t4 = t2.__js_helper$_current; + valueInModule = callback.call$1(t4); + if (valueInModule == null) + continue; + identityFromModule = t3._is(valueInModule) ? valueInModule : t4.variableIdentity$1($name); + if (identityFromModule.$eq(0, identity)) + continue; + if (value != null) { + t2 = A.LinkedHashMap_LinkedHashMap$_empty(type$.FileSpan, type$.String); + for (t3 = A.MapExtensions_get_pairs(t1, type$.Module_AsyncCallable, type$.AstNode), t3 = t3.get$iterator(t3), t4 = "includes " + type; t3.moveNext$0();) { + t1 = t3.get$current(t3); + module = t1._0; + node = t1._1; + if (callback.call$1(module) != null) + t2.$indexSet(0, node.get$span(node), t4); + } + throw A.wrapException(A.MultiSpanSassScriptException$("This " + type + string$.x20is_av, type + " use", t2)); + } + identity = identityFromModule; + value = valueInModule; + } + return value; + }, + _async_environment$_fromOneModule$3($name, type, callback) { + return this._async_environment$_fromOneModule$1$3($name, type, callback, type$.dynamic); + } + }; + A.AsyncEnvironment__getVariableFromGlobalModule_closure.prototype = { + call$1(module) { + return module.get$variables().$index(0, this.name); + }, + $signature: 479 + }; + A.AsyncEnvironment_setVariable_closure.prototype = { + call$0() { + var t1 = this.$this; + t1._async_environment$_lastVariableName = this.name; + return t1._async_environment$_lastVariableIndex = 0; + }, + $signature: 10 + }; + A.AsyncEnvironment_setVariable_closure0.prototype = { + call$1(module) { + return module.get$variables().containsKey$1(this.name) ? module : null; + }, + $signature: 477 + }; + A.AsyncEnvironment_setVariable_closure1.prototype = { + call$0() { + var t1 = this.$this, + t2 = t1._async_environment$_variableIndex$1(this.name); + return t2 == null ? t1._async_environment$_variables.length - 1 : t2; + }, + $signature: 10 + }; + A.AsyncEnvironment__getFunctionFromGlobalModule_closure.prototype = { + call$1(module) { + return module.get$functions(module).$index(0, this.name); + }, + $signature: 185 + }; + A.AsyncEnvironment__getMixinFromGlobalModule_closure.prototype = { + call$1(module) { + return module.get$mixins().$index(0, this.name); + }, + $signature: 185 + }; + A.AsyncEnvironment_toModule_closure.prototype = { + call$1(modules) { + return new A.MapKeySet(modules, type$.MapKeySet_Module_AsyncCallable); + }, + $signature: 186 + }; + A.AsyncEnvironment_toDummyModule_closure.prototype = { + call$1(modules) { + return new A.MapKeySet(modules, type$.MapKeySet_Module_AsyncCallable); + }, + $signature: 186 + }; + A._EnvironmentModule0.prototype = { + get$url(_) { + var t1 = this.css; + t1 = t1.get$span(t1); + return t1.get$sourceUrl(t1); + }, + setVariable$3($name, value, nodeWithSpan) { + var t1, t2, + _0_0 = this._async_environment$_modulesByVariable.$index(0, $name); + if (_0_0 != null) { + _0_0.setVariable$3($name, value, nodeWithSpan); + return; + } + t1 = this._async_environment$_environment; + t2 = t1._async_environment$_variables; + if (!B.JSArray_methods.get$first(t2).containsKey$1($name)) + throw A.wrapException(A.SassScriptException$("Undefined variable.", null)); + J.$indexSet$ax(B.JSArray_methods.get$first(t2), $name, value); + J.$indexSet$ax(B.JSArray_methods.get$first(t1._async_environment$_variableNodes), $name, nodeWithSpan); + return; + }, + variableIdentity$1($name) { + var module = this._async_environment$_modulesByVariable.$index(0, $name); + return module == null ? this : module.variableIdentity$1($name); + }, + cloneCss$0() { + var _0_0, _this = this; + if (!_this.transitivelyContainsCss) + return _this; + _0_0 = A.cloneCssStylesheet(_this.css, _this.extensionStore); + return A._EnvironmentModule$_0(_this._async_environment$_environment, _0_0._0, _this.preModuleComments, _0_0._1, _this._async_environment$_modulesByVariable, _this.variables, _this.variableNodes, _this.functions, _this.mixins, true, _this.transitivelyContainsExtensions); + }, + toString$0(_) { + var t1 = this.css, + t2 = t1.get$span(t1); + if (t2.get$sourceUrl(t2) == null) + t1 = ""; + else { + t1 = t1.get$span(t1); + t1 = t1.get$sourceUrl(t1); + t2 = $.$get$context(); + t1.toString; + t1 = t2.prettyUri$1(t1); + } + return t1; + }, + $isModule0: 1, + get$upstream() { + return this.upstream; + }, + get$variables() { + return this.variables; + }, + get$variableNodes() { + return this.variableNodes; + }, + get$functions(receiver) { + return this.functions; + }, + get$mixins() { + return this.mixins; + }, + get$extensionStore() { + return this.extensionStore; + }, + get$css(receiver) { + return this.css; + }, + get$preModuleComments() { + return this.preModuleComments; + }, + get$transitivelyContainsCss() { + return this.transitivelyContainsCss; + }, + get$transitivelyContainsExtensions() { + return this.transitivelyContainsExtensions; + } + }; + A._EnvironmentModule__EnvironmentModule_closure5.prototype = { + call$1(module) { + return module.get$variables(); + }, + $signature: 470 + }; + A._EnvironmentModule__EnvironmentModule_closure6.prototype = { + call$1(module) { + return module.get$variableNodes(); + }, + $signature: 460 + }; + A._EnvironmentModule__EnvironmentModule_closure7.prototype = { + call$1(module) { + return module.get$functions(module); + }, + $signature: 196 + }; + A._EnvironmentModule__EnvironmentModule_closure8.prototype = { + call$1(module) { + return module.get$mixins(); + }, + $signature: 196 + }; + A._EnvironmentModule__EnvironmentModule_closure9.prototype = { + call$1(module) { + return module.get$transitivelyContainsCss(); + }, + $signature: 127 + }; + A._EnvironmentModule__EnvironmentModule_closure10.prototype = { + call$1(module) { + return module.get$transitivelyContainsExtensions(); + }, + $signature: 127 + }; + A.AsyncImportCache.prototype = { + canonicalize$4$baseImporter$baseUrl$forImport(_, url, baseImporter, baseUrl, forImport) { + return this.canonicalize$body$AsyncImportCache(0, url, baseImporter, baseUrl, forImport); + }, + canonicalize$body$AsyncImportCache(_, url, baseImporter, baseUrl, forImport) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.nullable_Record_3_AsyncImporter_and_Uri_and_Uri_originalUrl), + $async$returnValue, $async$self = this, t1, relativeResult; + var $async$canonicalize$4$baseImporter$baseUrl$forImport = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + if (A.isBrowser()) + t1 = (baseImporter == null || baseImporter instanceof A.NoOpImporter) && $async$self._async_import_cache$_importers.length === 0; + else + t1 = false; + if (t1) + throw A.wrapException(string$.Custom); + $async$goto = baseImporter != null && url.get$scheme() === "" ? 3 : 4; + break; + case 3: + // then + $async$goto = 5; + return A._asyncAwait(A.putIfAbsentAsync($async$self._async_import_cache$_relativeCanonicalizeCache, new A._Record_4_baseImporter_baseUrl_forImport([url, baseImporter, baseUrl, forImport]), new A.AsyncImportCache_canonicalize_closure($async$self, baseImporter, baseUrl, url, forImport), type$.Record_4_Uri_and_AsyncImporter_baseImporter_and_nullable_Uri_baseUrl_and_bool_forImport, type$.nullable_Record_3_AsyncImporter_and_Uri_and_Uri_originalUrl), $async$canonicalize$4$baseImporter$baseUrl$forImport); + case 5: + // returning from await. + relativeResult = $async$result; + if (relativeResult != null) { + $async$returnValue = relativeResult; + // goto return + $async$goto = 1; + break; + } + case 4: + // join + $async$goto = 6; + return A._asyncAwait(A.putIfAbsentAsync($async$self._async_import_cache$_canonicalizeCache, new A._Record_2_forImport(url, forImport), new A.AsyncImportCache_canonicalize_closure0($async$self, url, baseUrl, forImport), type$.Record_2_Uri_and_bool_forImport, type$.nullable_Record_3_AsyncImporter_and_Uri_and_Uri_originalUrl), $async$canonicalize$4$baseImporter$baseUrl$forImport); + case 6: + // returning from await. + $async$returnValue = $async$result; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$canonicalize$4$baseImporter$baseUrl$forImport, $async$completer); + }, + _async_import_cache$_canonicalize$4(importer, url, baseUrl, forImport) { + return this._canonicalize$body$AsyncImportCache(importer, url, baseUrl, forImport); + }, + _canonicalize$body$AsyncImportCache(importer, url, baseUrl, forImport) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.nullable_Record_3_AsyncImporter_and_Uri_and_Uri_originalUrl), + $async$returnValue, $async$self = this, t1, passContainingUrl, result, canonicalize; + var $async$_async_import_cache$_canonicalize$4 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + canonicalize = forImport ? new A.AsyncImportCache__canonicalize_closure(importer, url) : new A.AsyncImportCache__canonicalize_closure0(importer, url); + $async$goto = baseUrl != null ? 3 : 5; + break; + case 3: + // then + $async$goto = url.get$scheme() !== "" ? 6 : 8; + break; + case 6: + // then + t1 = A._Future$value(importer.isNonCanonicalScheme$1(url.get$scheme()), type$.bool); + $async$goto = 9; + return A._asyncAwait(t1, $async$_async_import_cache$_canonicalize$4); + case 9: + // returning from await. + t1 = $async$result; + passContainingUrl = t1; + // goto join + $async$goto = 7; + break; + case 8: + // else + passContainingUrl = true; + case 7: + // join + // goto join + $async$goto = 4; + break; + case 5: + // else + passContainingUrl = false; + case 4: + // join + t1 = passContainingUrl ? baseUrl : null; + t1 = A.withContainingUrl(t1, canonicalize, type$.FutureOr_nullable_Uri); + $async$goto = 10; + return A._asyncAwait(type$.Future_nullable_Uri._is(t1) ? t1 : A._Future$value(t1, type$.nullable_Uri), $async$_async_import_cache$_canonicalize$4); + case 10: + // returning from await. + result = $async$result; + if (result == null) { + $async$returnValue = null; + // goto return + $async$goto = 1; + break; + } + $async$goto = result.get$scheme() === "" ? 11 : 13; + break; + case 11: + // then + A.WarnForDeprecation_warnForDeprecation($async$self._async_import_cache$_logger, B.Deprecation_mFp, "Importer " + importer.toString$0(0) + " canonicalized " + url.toString$0(0) + " to " + result.toString$0(0) + string$.x2e_Rela, null, null); + // goto join + $async$goto = 12; + break; + case 13: + // else + t1 = A._Future$value(importer.isNonCanonicalScheme$1(result.get$scheme()), type$.bool); + $async$goto = 14; + return A._asyncAwait(t1, $async$_async_import_cache$_canonicalize$4); + case 14: + // returning from await. + if ($async$result) + throw A.wrapException("Importer " + importer.toString$0(0) + " canonicalized " + url.toString$0(0) + " to " + result.toString$0(0) + string$.x2c_whicu); + case 12: + // join + $async$returnValue = new A._Record_3_originalUrl(importer, result, url); + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$_async_import_cache$_canonicalize$4, $async$completer); + }, + importCanonical$4$originalUrl$quiet(importer, canonicalUrl, originalUrl, quiet) { + return this.importCanonical$body$AsyncImportCache(importer, canonicalUrl, originalUrl, quiet); + }, + importCanonical$3$originalUrl(importer, canonicalUrl, originalUrl) { + return this.importCanonical$4$originalUrl$quiet(importer, canonicalUrl, originalUrl, false); + }, + importCanonical$body$AsyncImportCache(importer, canonicalUrl, originalUrl, quiet) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.nullable_Stylesheet), + $async$returnValue, $async$self = this; + var $async$importCanonical$4$originalUrl$quiet = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$goto = 3; + return A._asyncAwait(A.putIfAbsentAsync($async$self._async_import_cache$_importCache, canonicalUrl, new A.AsyncImportCache_importCanonical_closure($async$self, importer, canonicalUrl, originalUrl, quiet), type$.Uri, type$.nullable_Stylesheet), $async$importCanonical$4$originalUrl$quiet); + case 3: + // returning from await. + $async$returnValue = $async$result; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$importCanonical$4$originalUrl$quiet, $async$completer); + }, + humanize$1(canonicalUrl) { + var t1 = A.IterableNullableExtension_whereNotNull(this._async_import_cache$_canonicalizeCache.get$values(0), type$.Record_3_AsyncImporter_and_Uri_and_Uri_originalUrl), + t2 = t1.$ti; + t2 = A.NullableExtension_andThen(A.minBy(new A.MappedIterable(new A.WhereIterable(t1, new A.AsyncImportCache_humanize_closure(canonicalUrl), t2._eval$1("WhereIterable")), new A.AsyncImportCache_humanize_closure0(), t2._eval$1("MappedIterable")), new A.AsyncImportCache_humanize_closure1()), new A.AsyncImportCache_humanize_closure2(canonicalUrl)); + return t2 == null ? canonicalUrl : t2; + }, + sourceMapUrl$1(_, canonicalUrl) { + var t1 = this._async_import_cache$_resultsCache.$index(0, canonicalUrl); + t1 = t1 == null ? null : t1.get$sourceMapUrl(0); + return t1 == null ? canonicalUrl : t1; + } + }; + A.AsyncImportCache_canonicalize_closure.prototype = { + call$0() { + var _this = this, + t1 = _this.baseUrl, + t2 = t1 == null ? null : t1.resolveUri$1(_this.url); + if (t2 == null) + t2 = _this.url; + return _this.$this._async_import_cache$_canonicalize$4(_this.baseImporter, t2, t1, _this.forImport); + }, + $signature: 200 + }; + A.AsyncImportCache_canonicalize_closure0.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.nullable_Record_3_AsyncImporter_and_Uri_and_Uri_originalUrl), + $async$returnValue, $async$self = this, t1, t2, t3, t4, t5, t6, _i, _0_0; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.$this, t2 = t1._async_import_cache$_importers, t3 = t2.length, t4 = $async$self.url, t5 = $async$self.baseUrl, t6 = $async$self.forImport, _i = 0; + case 3: + // for condition + if (!(_i < t2.length)) { + // goto after for + $async$goto = 5; + break; + } + $async$goto = 6; + return A._asyncAwait(t1._async_import_cache$_canonicalize$4(t2[_i], t4, t5, t6), $async$call$0); + case 6: + // returning from await. + _0_0 = $async$result; + if (_0_0 != null) { + $async$returnValue = _0_0; + // goto return + $async$goto = 1; + break; + } + case 4: + // for update + t2.length === t3 || (0, A.throwConcurrentModificationError)(t2), ++_i; + // goto for condition + $async$goto = 3; + break; + case 5: + // after for + $async$returnValue = null; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 200 + }; + A.AsyncImportCache__canonicalize_closure.prototype = { + call$0() { + var t1 = type$.nullable_Object; + return A.runZoned(new A.AsyncImportCache__canonicalize__closure(this.importer, this.resolved), A.LinkedHashMap_LinkedHashMap$_literal([B.Symbol__inImportRule, true], t1, t1), type$.FutureOr_nullable_Uri); + }, + $signature: 61 + }; + A.AsyncImportCache__canonicalize__closure.prototype = { + call$0() { + return this.importer.canonicalize$1(0, this.resolved); + }, + $signature: 61 + }; + A.AsyncImportCache__canonicalize_closure0.prototype = { + call$0() { + return this.importer.canonicalize$1(0, this.resolved); + }, + $signature: 61 + }; + A.AsyncImportCache_importCanonical_closure.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.nullable_Stylesheet), + $async$returnValue, $async$self = this, t3, t4, t1, t2, result; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.canonicalUrl; + t2 = A._Future$value($async$self.importer.load$1(0, t1), type$.nullable_ImporterResult); + $async$goto = 3; + return A._asyncAwait(t2, $async$call$0); + case 3: + // returning from await. + result = $async$result; + if (result == null) { + $async$returnValue = null; + // goto return + $async$goto = 1; + break; + } + t2 = $async$self.$this; + t2._async_import_cache$_resultsCache.$indexSet(0, t1, result); + t3 = result.contents; + t4 = result.syntax; + t1 = $async$self.originalUrl.resolveUri$1(t1); + $async$returnValue = A.Stylesheet_Stylesheet$parse(t3, t4, $async$self.quiet ? $.$get$Logger_quiet() : t2._async_import_cache$_logger, t1); + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 457 + }; + A.AsyncImportCache_humanize_closure.prototype = { + call$1(result) { + return J.$eq$(result._1, this.canonicalUrl); + }, + $signature: 456 + }; + A.AsyncImportCache_humanize_closure0.prototype = { + call$1(result) { + return result._2; + }, + $signature: 452 + }; + A.AsyncImportCache_humanize_closure1.prototype = { + call$1(url) { + return url.get$path(url).length; + }, + $signature: 107 + }; + A.AsyncImportCache_humanize_closure2.prototype = { + call$1(url) { + var t1 = $.$get$url(), + t2 = this.canonicalUrl; + return url.resolve$1(0, A.ParsedPath_ParsedPath$parse(t2.get$path(t2), t1.style).get$basename()); + }, + $signature: 44 + }; + A.AsyncBuiltInCallable.prototype = { + callbackFor$2(positional, names) { + return new A._Record_2(this._async_built_in$_arguments, this._async_built_in$_callback); + }, + $isAsyncCallable: 1, + get$name(receiver) { + return this.name; + }, + get$acceptsContent() { + return this.acceptsContent; + } + }; + A.AsyncBuiltInCallable$mixin_closure.prototype = { + call$1($arguments) { + return this.$call$body$AsyncBuiltInCallable$mixin_closure($arguments); + }, + $call$body$AsyncBuiltInCallable$mixin_closure($arguments) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Value), + $async$returnValue, $async$self = this, t1; + var $async$call$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.callback.call$1($arguments); + $async$goto = 3; + return A._asyncAwait(t1 instanceof A._Future ? t1 : A._Future$value(t1, type$.void), $async$call$1); + case 3: + // returning from await. + $async$returnValue = B.C__SassNull; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$call$1, $async$completer); + }, + $signature: 218 + }; + A.BuiltInCallable.prototype = { + callbackFor$2(positional, names) { + var t1, t2, fuzzyMatch, minMismatchDistance, _i, overload, t3, mismatchDistance, t4; + for (t1 = this._overloads, t2 = t1.length, fuzzyMatch = null, minMismatchDistance = null, _i = 0; _i < t1.length; t1.length === t2 || (0, A.throwConcurrentModificationError)(t1), ++_i) { + overload = t1[_i]; + t3 = overload._0; + if (t3.matches$2(positional, names)) + return overload; + mismatchDistance = t3.$arguments.length - positional; + if (minMismatchDistance != null) { + t3 = Math.abs(mismatchDistance); + t4 = Math.abs(minMismatchDistance); + if (t3 > t4) + continue; + if (t3 === t4 && mismatchDistance < 0) + continue; + } + minMismatchDistance = mismatchDistance; + fuzzyMatch = overload; + } + if (fuzzyMatch != null) + return fuzzyMatch; + throw A.wrapException(A.StateError$("BuiltInCallable " + this.name + " may not have empty overloads.")); + }, + withName$1($name) { + return new A.BuiltInCallable($name, this._overloads, this.acceptsContent); + }, + $isCallable0: 1, + $isAsyncCallable: 1, + $isAsyncBuiltInCallable: 1, + get$name(receiver) { + return this.name; + }, + get$acceptsContent() { + return this.acceptsContent; + } + }; + A.BuiltInCallable$mixin_closure.prototype = { + call$1($arguments) { + this.callback.call$1($arguments); + return B.C__SassNull; + }, + $signature: 6 + }; + A.PlainCssCallable.prototype = { + $eq(_, other) { + if (other == null) + return false; + return other instanceof A.PlainCssCallable && this.name === other.name; + }, + get$hashCode(_) { + return B.JSString_methods.get$hashCode(this.name); + }, + $isCallable0: 1, + $isAsyncCallable: 1, + get$name(receiver) { + return this.name; + } + }; + A.UserDefinedCallable.prototype = { + get$name(_) { + return this.declaration.name; + }, + $isCallable0: 1, + $isAsyncCallable: 1 + }; + A._compileStylesheet_closure.prototype = { + call$1(url) { + var t1; + if (url === "") { + t1 = this.stylesheet.span; + t1 = A.Uri_Uri$dataFromString(A.String_String$fromCharCodes(B.NativeUint32List_methods.sublist$2(t1.get$file(t1)._decodedChars, 0, null), 0, null), B.C_Utf8Codec, null).get$_text(); + } else + t1 = this.importCache.sourceMapUrl$1(0, A.Uri_parse(url)).toString$0(0); + return t1; + }, + $signature: 5 + }; + A.CompileResult.prototype = {}; + A.Configuration.prototype = { + throughForward$1($forward) { + var _0_0, _1_0, _2_0, t1, hiddenVariables, + newValues = this._configuration$_values; + if (newValues.get$isEmpty(newValues)) + return B.Configuration_Map_empty_null; + _0_0 = $forward.prefix; + if (_0_0 != null) + newValues = new A.UnprefixedMapView(newValues, _0_0, type$.UnprefixedMapView_ConfiguredValue); + _1_0 = $forward.shownVariables; + if (_1_0 != null) + newValues = new A.LimitedMapView(newValues, _1_0._base.intersection$1(new A.MapKeySet(newValues, type$.MapKeySet_nullable_Object)), type$.LimitedMapView_String_ConfiguredValue); + else { + _2_0 = $forward.hiddenVariables; + if (_2_0 != null) { + t1 = _2_0._base.get$isNotEmpty(0); + hiddenVariables = _2_0; + } else { + hiddenVariables = null; + t1 = false; + } + if (t1) + newValues = A.LimitedMapView$blocklist(newValues, hiddenVariables, type$.String, type$.ConfiguredValue); + } + return this._withValues$1(newValues); + }, + _withValues$1(values) { + var t1 = this.__originalConfiguration; + return new A.Configuration(values, t1 == null ? this : t1); + }, + toString$0(_) { + var t2, t3, + t1 = A._setArrayType([], type$.JSArray_String); + for (t2 = A.MapExtensions_get_pairs(new A.UnmodifiableMapView(this._configuration$_values, type$.UnmodifiableMapView_String_ConfiguredValue), type$.String, type$.ConfiguredValue), t2 = t2.get$iterator(t2); t2.moveNext$0();) { + t3 = t2.get$current(t2); + t1.push("$" + t3._0 + ": " + t3._1.toString$0(0)); + } + return "(" + B.JSArray_methods.join$1(t1, ",") + ")"; + } + }; + A.ExplicitConfiguration.prototype = { + _withValues$1(values) { + var t1 = this.__originalConfiguration; + if (t1 == null) + t1 = this; + return new A.ExplicitConfiguration(this.nodeWithSpan, values, t1); + } + }; + A.ConfiguredValue.prototype = { + toString$0(_) { + return A.serializeValue(this.value, true, true); + } + }; + A.Deprecation.prototype = { + _enumToString$0() { + return "Deprecation." + this._name; + }, + toString$0(_) { + return this.id; + } + }; + A.Deprecation_fromId_closure.prototype = { + call$1(deprecation) { + return deprecation.id === this.id; + }, + $signature: 450 + }; + A.Environment.prototype = { + closure$0() { + var t4, t5, t6, _this = this, + t1 = _this._forwardedModules, + t2 = _this._nestedForwardedModules, + t3 = _this._variables; + t3 = A._setArrayType(t3.slice(0), A._arrayInstanceType(t3)); + t4 = _this._variableNodes; + t4 = A._setArrayType(t4.slice(0), A._arrayInstanceType(t4)); + t5 = _this._functions; + t5 = A._setArrayType(t5.slice(0), A._arrayInstanceType(t5)); + t6 = _this._mixins; + t6 = A._setArrayType(t6.slice(0), A._arrayInstanceType(t6)); + return A.Environment$_(_this._environment$_modules, _this._namespaceNodes, _this._globalModules, _this._importedModules, t1, t2, _this._allModules, t3, t4, t5, t6, _this._content); + }, + forwardModule$2(module, rule) { + var view, t1, t2, _this = this, + forwardedModules = _this._forwardedModules; + if (forwardedModules == null) + forwardedModules = _this._forwardedModules = A.LinkedHashMap_LinkedHashMap$_empty(type$.Module_Callable, type$.AstNode); + view = A.ForwardedModuleView_ifNecessary(module, rule, type$.Callable); + for (t1 = A.LinkedHashMapKeyIterator$(forwardedModules, forwardedModules._modifications); t1.moveNext$0();) { + t2 = t1.__js_helper$_current; + _this._assertNoConflicts$5(view.get$variables(), t2.get$variables(), view, t2, "variable"); + _this._assertNoConflicts$5(view.get$functions(view), t2.get$functions(t2), view, t2, "function"); + _this._assertNoConflicts$5(view.get$mixins(), t2.get$mixins(), view, t2, "mixin"); + } + _this._allModules.push(module); + forwardedModules.$indexSet(0, view, rule); + }, + _assertNoConflicts$5(newMembers, oldMembers, newModule, oldModule, type) { + var larger, smaller, t1, t2, t3, t4, $name, small, large, span; + if (newMembers.get$length(newMembers) < oldMembers.get$length(oldMembers)) { + larger = oldMembers; + smaller = newMembers; + } else { + larger = newMembers; + smaller = oldMembers; + } + for (t1 = type$.String, t2 = A.MapExtensions_get_pairs(smaller, t1, type$.Object), t2 = t2.get$iterator(t2), t3 = type === "variable"; t2.moveNext$0();) { + t4 = t2.get$current(t2); + $name = t4._0; + small = t4._1; + large = larger.$index(0, $name); + if (large == null) + continue; + if (t3 ? newModule.variableIdentity$1($name) === oldModule.variableIdentity$1($name) : J.$eq$(large, small)) + continue; + if (t3) + $name = "$" + $name; + t2 = this._forwardedModules; + if (t2 == null) + span = null; + else { + t2 = t2.$index(0, oldModule); + span = t2 == null ? null : J.get$span$z(t2); + } + t2 = A.LinkedHashMap_LinkedHashMap$_empty(type$.FileSpan, t1); + if (span != null) + t2.$indexSet(0, span, "original @forward"); + throw A.wrapException(A.MultiSpanSassScriptException$("Two forwarded modules both define a " + type + " named " + $name + ".", "new @forward", t2)); + } + }, + importForwards$1(module) { + var forwardedModules, t1, t2, t3, t4, node, t5, t6, t7, t8, t9, t10, _i, t11, shadowed, _length, _list, _this = this, + forwarded = module._environment$_environment._forwardedModules; + if (forwarded == null) + return; + forwardedModules = _this._forwardedModules; + if (forwardedModules != null) { + t1 = type$.Module_Callable; + t2 = type$.AstNode; + t3 = A.LinkedHashMap_LinkedHashMap$_empty(t1, t2); + for (t1 = A.MapExtensions_get_pairs(forwarded, t1, t2), t1 = t1.get$iterator(t1), t2 = _this._globalModules; t1.moveNext$0();) { + t4 = t1.get$current(t1); + module = t4._0; + node = t4._1; + if (!forwardedModules.containsKey$1(module) || !t2.containsKey$1(module)) + t3.$indexSet(0, module, node); + } + forwarded = t3; + } else + forwardedModules = _this._forwardedModules = A.LinkedHashMap_LinkedHashMap$_empty(type$.Module_Callable, type$.AstNode); + t1 = type$.String; + t2 = A.LinkedHashSet_LinkedHashSet$_empty(t1); + for (t3 = A.LinkedHashMapKeyIterator$(forwarded, forwarded._modifications); t3.moveNext$0();) + for (t4 = t3.__js_helper$_current.get$variables(), t4 = J.get$iterator$ax(t4.get$keys(t4)); t4.moveNext$0();) + t2.add$1(0, t4.get$current(t4)); + t3 = A.LinkedHashSet_LinkedHashSet$_empty(t1); + for (t4 = A.LinkedHashMapKeyIterator$(forwarded, forwarded._modifications); t4.moveNext$0();) { + t5 = t4.__js_helper$_current; + for (t5 = t5.get$functions(t5), t5 = J.get$iterator$ax(t5.get$keys(t5)); t5.moveNext$0();) + t3.add$1(0, t5.get$current(t5)); + } + t1 = A.LinkedHashSet_LinkedHashSet$_empty(t1); + for (t4 = A.LinkedHashMapKeyIterator$(forwarded, forwarded._modifications); t4.moveNext$0();) + for (t5 = t4.__js_helper$_current.get$mixins(), t5 = J.get$iterator$ax(t5.get$keys(t5)); t5.moveNext$0();) + t1.add$1(0, t5.get$current(t5)); + t4 = _this._variables; + t5 = t4.length; + if (t5 === 1) { + for (t5 = _this._importedModules, t6 = type$.Module_Callable, t7 = type$.AstNode, t8 = A.MapExtensions_get_pairs(t5, t6, t7).toList$0(0), t9 = t8.length, t10 = type$.Callable, _i = 0; _i < t8.length; t8.length === t9 || (0, A.throwConcurrentModificationError)(t8), ++_i) { + t11 = t8[_i]; + module = t11._0; + node = t11._1; + shadowed = A.ShadowedModuleView_ifNecessary(module, t3, t1, t2, t10); + if (shadowed != null) { + t5.remove$1(0, module); + t11 = shadowed.variables; + if (t11.get$isEmpty(t11)) { + t11 = shadowed.functions; + if (t11.get$isEmpty(t11)) { + t11 = shadowed.mixins; + if (t11.get$isEmpty(t11)) { + t11 = shadowed._shadowed_view$_inner; + t11 = t11.get$css(t11); + t11 = J.get$isEmpty$asx(t11.get$children(t11)); + } else + t11 = false; + } else + t11 = false; + } else + t11 = false; + if (!t11) + t5.$indexSet(0, shadowed, node); + } + } + for (t6 = A.MapExtensions_get_pairs(forwardedModules, t6, t7).toList$0(0), t7 = t6.length, _i = 0; _i < t6.length; t6.length === t7 || (0, A.throwConcurrentModificationError)(t6), ++_i) { + t8 = t6[_i]; + module = t8._0; + node = t8._1; + shadowed = A.ShadowedModuleView_ifNecessary(module, t3, t1, t2, t10); + if (shadowed != null) { + forwardedModules.remove$1(0, module); + t8 = shadowed.variables; + if (t8.get$isEmpty(t8)) { + t8 = shadowed.functions; + if (t8.get$isEmpty(t8)) { + t8 = shadowed.mixins; + if (t8.get$isEmpty(t8)) { + t8 = shadowed._shadowed_view$_inner; + t8 = t8.get$css(t8); + t8 = J.get$isEmpty$asx(t8.get$children(t8)); + } else + t8 = false; + } else + t8 = false; + } else + t8 = false; + if (!t8) + forwardedModules.$indexSet(0, shadowed, node); + } + } + t5.addAll$1(0, forwarded); + forwardedModules.addAll$1(0, forwarded); + } else { + t6 = _this._nestedForwardedModules; + if (t6 == null) { + _length = t5 - 1; + _list = J.JSArray_JSArray$allocateGrowable(_length, type$.List_Module_Callable); + for (t5 = type$.JSArray_Module_Callable, _i = 0; _i < _length; ++_i) + _list[_i] = A._setArrayType([], t5); + _this._nestedForwardedModules = _list; + t5 = _list; + } else + t5 = t6; + B.JSArray_methods.addAll$1(B.JSArray_methods.get$last(t5), new A.LinkedHashMapKeyIterable(forwarded, A._instanceType(forwarded)._eval$1("LinkedHashMapKeyIterable<1>"))); + } + for (t2 = A._LinkedHashSetIterator$(t2, t2._collection$_modifications, t2.$ti._precomputed1), t5 = _this._variableIndices, t6 = _this._variableNodes, t7 = t2.$ti._precomputed1; t2.moveNext$0();) { + t8 = t2._collection$_current; + if (t8 == null) + t8 = t7._as(t8); + t5.remove$1(0, t8); + J.remove$1$z(B.JSArray_methods.get$last(t4), t8); + J.remove$1$z(B.JSArray_methods.get$last(t6), t8); + } + for (t2 = A._LinkedHashSetIterator$(t3, t3._collection$_modifications, t3.$ti._precomputed1), t3 = _this._functionIndices, t4 = _this._functions, t5 = t2.$ti._precomputed1; t2.moveNext$0();) { + t6 = t2._collection$_current; + if (t6 == null) + t6 = t5._as(t6); + t3.remove$1(0, t6); + J.remove$1$z(B.JSArray_methods.get$last(t4), t6); + } + for (t1 = A._LinkedHashSetIterator$(t1, t1._collection$_modifications, t1.$ti._precomputed1), t2 = _this._mixinIndices, t3 = _this._mixins, t4 = t1.$ti._precomputed1; t1.moveNext$0();) { + t5 = t1._collection$_current; + if (t5 == null) + t5 = t4._as(t5); + t2.remove$1(0, t5); + J.remove$1$z(B.JSArray_methods.get$last(t3), t5); + } + }, + getVariable$2$namespace($name, namespace) { + var t1, _0_0, _1_0, _this = this; + if (namespace != null) + return _this._getModule$1(namespace).get$variables().$index(0, $name); + if (_this._lastVariableName === $name) { + t1 = _this._lastVariableIndex; + t1.toString; + t1 = J.$index$asx(_this._variables[t1], $name); + return t1 == null ? _this._getVariableFromGlobalModule$1($name) : t1; + } + t1 = _this._variableIndices; + _0_0 = t1.$index(0, $name); + if (_0_0 != null) { + _this._lastVariableName = $name; + _this._lastVariableIndex = _0_0; + t1 = J.$index$asx(_this._variables[_0_0], $name); + return t1 == null ? _this._getVariableFromGlobalModule$1($name) : t1; + } else { + _1_0 = _this._variableIndex$1($name); + if (_1_0 != null) { + _this._lastVariableName = $name; + _this._lastVariableIndex = _1_0; + t1.$indexSet(0, $name, _1_0); + t1 = J.$index$asx(_this._variables[_1_0], $name); + return t1 == null ? _this._getVariableFromGlobalModule$1($name) : t1; + } else + return _this._getVariableFromGlobalModule$1($name); + } + }, + getVariable$1($name) { + return this.getVariable$2$namespace($name, null); + }, + _getVariableFromGlobalModule$1($name) { + return this._fromOneModule$3($name, "variable", new A.Environment__getVariableFromGlobalModule_closure($name)); + }, + getVariableNode$2$namespace($name, namespace) { + var t1, _0_0, _1_0, _this = this; + if (namespace != null) + return _this._getModule$1(namespace).get$variableNodes().$index(0, $name); + if (_this._lastVariableName === $name) { + t1 = _this._lastVariableIndex; + t1.toString; + t1 = J.$index$asx(_this._variableNodes[t1], $name); + return t1 == null ? _this._getVariableNodeFromGlobalModule$1($name) : t1; + } + t1 = _this._variableIndices; + _0_0 = t1.$index(0, $name); + if (_0_0 != null) { + _this._lastVariableName = $name; + _this._lastVariableIndex = _0_0; + t1 = J.$index$asx(_this._variableNodes[_0_0], $name); + return t1 == null ? _this._getVariableNodeFromGlobalModule$1($name) : t1; + } else { + _1_0 = _this._variableIndex$1($name); + if (_1_0 != null) { + _this._lastVariableName = $name; + _this._lastVariableIndex = _1_0; + t1.$indexSet(0, $name, _1_0); + t1 = J.$index$asx(_this._variableNodes[_1_0], $name); + return t1 == null ? _this._getVariableNodeFromGlobalModule$1($name) : t1; + } else + return _this._getVariableNodeFromGlobalModule$1($name); + } + }, + _getVariableNodeFromGlobalModule$1($name) { + var t1, t2, _0_0; + for (t1 = this._importedModules, t2 = this._globalModules, t2 = new A.LinkedHashMapKeyIterable(t1, A._instanceType(t1)._eval$1("LinkedHashMapKeyIterable<1>")).followedBy$1(0, new A.LinkedHashMapKeyIterable(t2, A._instanceType(t2)._eval$1("LinkedHashMapKeyIterable<1>"))), t2 = new A.FollowedByIterator(J.get$iterator$ax(t2.__internal$_first), t2._second); t2.moveNext$0();) { + t1 = t2._currentIterator; + _0_0 = t1.get$current(t1).get$variableNodes().$index(0, $name); + if (_0_0 != null) + return _0_0; + } + return null; + }, + globalVariableExists$2$namespace($name, namespace) { + if (namespace != null) + return this._getModule$1(namespace).get$variables().containsKey$1($name); + if (B.JSArray_methods.get$first(this._variables).containsKey$1($name)) + return true; + return this._getVariableFromGlobalModule$1($name) != null; + }, + globalVariableExists$1($name) { + return this.globalVariableExists$2$namespace($name, null); + }, + _variableIndex$1($name) { + var t1, i; + for (t1 = this._variables, i = t1.length - 1; i >= 0; --i) + if (t1[i].containsKey$1($name)) + return i; + return null; + }, + setVariable$5$global$namespace($name, value, nodeWithSpan, global, namespace) { + var t1, moduleWithName, nestedForwardedModules, t2, t3, t4, t5, index, _this = this; + if (namespace != null) { + _this._getModule$1(namespace).setVariable$3($name, value, nodeWithSpan); + return; + } + if (global || _this._variables.length === 1) { + _this._variableIndices.putIfAbsent$2($name, new A.Environment_setVariable_closure(_this, $name)); + t1 = _this._variables; + if (!B.JSArray_methods.get$first(t1).containsKey$1($name)) { + moduleWithName = _this._fromOneModule$3($name, "variable", new A.Environment_setVariable_closure0($name)); + if (moduleWithName != null) { + moduleWithName.setVariable$3($name, value, nodeWithSpan); + return; + } + } + J.$indexSet$ax(B.JSArray_methods.get$first(t1), $name, value); + J.$indexSet$ax(B.JSArray_methods.get$first(_this._variableNodes), $name, nodeWithSpan); + return; + } + nestedForwardedModules = _this._nestedForwardedModules; + if (nestedForwardedModules != null && !_this._variableIndices.containsKey$1($name) && _this._variableIndex$1($name) == null) + for (t1 = A.instanceType(nestedForwardedModules)._eval$1("ReversedListIterable<1>"), t2 = new A.ReversedListIterable(nestedForwardedModules, t1), t2 = new A.ListIterator(t2, t2.get$length(0), t1._eval$1("ListIterator")), t1 = t1._eval$1("ListIterable.E"); t2.moveNext$0();) { + t3 = t2.__internal$_current; + for (t3 = J.get$reversed$ax(t3 == null ? t1._as(t3) : t3), t4 = t3.$ti, t3 = new A.ListIterator(t3, t3.get$length(0), t4._eval$1("ListIterator")), t4 = t4._eval$1("ListIterable.E"); t3.moveNext$0();) { + t5 = t3.__internal$_current; + if (t5 == null) + t5 = t4._as(t5); + if (t5.get$variables().containsKey$1($name)) { + t5.setVariable$3($name, value, nodeWithSpan); + return; + } + } + } + if (_this._lastVariableName === $name) { + t1 = _this._lastVariableIndex; + t1.toString; + index = t1; + } else + index = _this._variableIndices.putIfAbsent$2($name, new A.Environment_setVariable_closure1(_this, $name)); + if (!_this._inSemiGlobalScope && index === 0) { + index = _this._variables.length - 1; + _this._variableIndices.$indexSet(0, $name, index); + } + _this._lastVariableName = $name; + _this._lastVariableIndex = index; + J.$indexSet$ax(_this._variables[index], $name, value); + J.$indexSet$ax(_this._variableNodes[index], $name, nodeWithSpan); + }, + setVariable$4$global($name, value, nodeWithSpan, global) { + return this.setVariable$5$global$namespace($name, value, nodeWithSpan, global, null); + }, + setLocalVariable$3($name, value, nodeWithSpan) { + var index, _this = this, + t1 = _this._variables, + t2 = t1.length; + _this._lastVariableName = $name; + index = _this._lastVariableIndex = t2 - 1; + _this._variableIndices.$indexSet(0, $name, index); + J.$indexSet$ax(t1[index], $name, value); + J.$indexSet$ax(_this._variableNodes[index], $name, nodeWithSpan); + }, + getFunction$2$namespace($name, namespace) { + var t1, _0_0, _1_0, _this = this; + if (namespace != null) { + t1 = _this._getModule$1(namespace); + return t1.get$functions(t1).$index(0, $name); + } + t1 = _this._functionIndices; + _0_0 = t1.$index(0, $name); + if (_0_0 != null) { + t1 = J.$index$asx(_this._functions[_0_0], $name); + return t1 == null ? _this._getFunctionFromGlobalModule$1($name) : t1; + } else { + _1_0 = _this._functionIndex$1($name); + if (_1_0 != null) { + t1.$indexSet(0, $name, _1_0); + t1 = J.$index$asx(_this._functions[_1_0], $name); + return t1 == null ? _this._getFunctionFromGlobalModule$1($name) : t1; + } else + return _this._getFunctionFromGlobalModule$1($name); + } + }, + getFunction$1($name) { + return this.getFunction$2$namespace($name, null); + }, + _getFunctionFromGlobalModule$1($name) { + return this._fromOneModule$3($name, "function", new A.Environment__getFunctionFromGlobalModule_closure($name)); + }, + _functionIndex$1($name) { + var t1, i; + for (t1 = this._functions, i = t1.length - 1; i >= 0; --i) + if (t1[i].containsKey$1($name)) + return i; + return null; + }, + getMixin$2$namespace($name, namespace) { + var t1, _0_0, _1_0, _this = this; + if (namespace != null) + return _this._getModule$1(namespace).get$mixins().$index(0, $name); + t1 = _this._mixinIndices; + _0_0 = t1.$index(0, $name); + if (_0_0 != null) { + t1 = J.$index$asx(_this._mixins[_0_0], $name); + return t1 == null ? _this._getMixinFromGlobalModule$1($name) : t1; + } else { + _1_0 = _this._mixinIndex$1($name); + if (_1_0 != null) { + t1.$indexSet(0, $name, _1_0); + t1 = J.$index$asx(_this._mixins[_1_0], $name); + return t1 == null ? _this._getMixinFromGlobalModule$1($name) : t1; + } else + return _this._getMixinFromGlobalModule$1($name); + } + }, + _getMixinFromGlobalModule$1($name) { + return this._fromOneModule$3($name, "mixin", new A.Environment__getMixinFromGlobalModule_closure($name)); + }, + _mixinIndex$1($name) { + var t1, i; + for (t1 = this._mixins, i = t1.length - 1; i >= 0; --i) + if (t1[i].containsKey$1($name)) + return i; + return null; + }, + withContent$2($content, callback) { + var oldContent = this._content; + this._content = $content; + callback.call$0(); + this._content = oldContent; + }, + asMixin$1(callback) { + var oldInMixin = this._inMixin; + this._inMixin = true; + callback.call$0(); + this._inMixin = oldInMixin; + }, + scope$1$3$semiGlobal$when(callback, semiGlobal, when) { + var wasInSemiGlobalScope, $name, name0, name1, t1, t2, t3, t4, t5, t6, _this = this; + semiGlobal = semiGlobal && _this._inSemiGlobalScope; + wasInSemiGlobalScope = _this._inSemiGlobalScope; + _this._inSemiGlobalScope = semiGlobal; + if (!when) + try { + t1 = callback.call$0(); + return t1; + } finally { + _this._inSemiGlobalScope = wasInSemiGlobalScope; + } + t1 = _this._variables; + t2 = type$.String; + B.JSArray_methods.add$1(t1, A.LinkedHashMap_LinkedHashMap$_empty(t2, type$.Value)); + t3 = _this._variableNodes; + B.JSArray_methods.add$1(t3, A.LinkedHashMap_LinkedHashMap$_empty(t2, type$.AstNode)); + t4 = _this._functions; + t5 = type$.Callable; + B.JSArray_methods.add$1(t4, A.LinkedHashMap_LinkedHashMap$_empty(t2, t5)); + t6 = _this._mixins; + B.JSArray_methods.add$1(t6, A.LinkedHashMap_LinkedHashMap$_empty(t2, t5)); + t5 = _this._nestedForwardedModules; + if (t5 != null) + t5.push(A._setArrayType([], type$.JSArray_Module_Callable)); + try { + t2 = callback.call$0(); + return t2; + } finally { + _this._inSemiGlobalScope = wasInSemiGlobalScope; + _this._lastVariableIndex = _this._lastVariableName = null; + for (t1 = J.get$iterator$ax(J.get$keys$z(B.JSArray_methods.removeLast$0(t1))), t2 = _this._variableIndices; t1.moveNext$0();) { + $name = t1.get$current(t1); + t2.remove$1(0, $name); + } + B.JSArray_methods.removeLast$0(t3); + for (t1 = J.get$iterator$ax(J.get$keys$z(B.JSArray_methods.removeLast$0(t4))), t2 = _this._functionIndices; t1.moveNext$0();) { + name0 = t1.get$current(t1); + t2.remove$1(0, name0); + } + for (t1 = J.get$iterator$ax(J.get$keys$z(B.JSArray_methods.removeLast$0(t6))), t2 = _this._mixinIndices; t1.moveNext$0();) { + name1 = t1.get$current(t1); + t2.remove$1(0, name1); + } + t1 = _this._nestedForwardedModules; + if (t1 != null) + t1.pop(); + } + }, + scope$1$1(callback) { + return this.scope$1$3$semiGlobal$when(callback, false, true); + }, + scope$1$2$when(callback, when) { + return this.scope$1$3$semiGlobal$when(callback, false, when); + }, + scope$1$2$semiGlobal(callback, semiGlobal) { + return this.scope$1$3$semiGlobal$when(callback, semiGlobal, true); + }, + toImplicitConfiguration$0() { + var t2, t3, t4, i, values, nodes, t5, t6, $name, value, + t1 = type$.String, + configuration = A.LinkedHashMap_LinkedHashMap$_empty(t1, type$.ConfiguredValue); + for (t2 = this._variables, t3 = type$.Value, t4 = this._variableNodes, i = 0; i < t2.length; ++i) { + values = t2[i]; + nodes = t4[i]; + for (t5 = A.MapExtensions_get_pairs(values, t1, t3), t5 = t5.get$iterator(t5); t5.moveNext$0();) { + t6 = t5.get$current(t5); + $name = t6._0; + value = t6._1; + t6 = nodes.$index(0, $name); + t6.toString; + configuration.$indexSet(0, $name, new A.ConfiguredValue(value, null, t6)); + } + } + return new A.Configuration(configuration, null); + }, + toModule$3(css, preModuleComments, extensionStore) { + return A._EnvironmentModule__EnvironmentModule(this, css, preModuleComments, extensionStore, A.NullableExtension_andThen(this._forwardedModules, new A.Environment_toModule_closure())); + }, + toDummyModule$0() { + return A._EnvironmentModule__EnvironmentModule(this, new A.CssStylesheet(new A.UnmodifiableListView(B.List_empty3, type$.UnmodifiableListView_CssNode), A.SourceFile$decoded(B.List_empty4, "").span$1(0, 0)), B.Map_empty0, B.C_EmptyExtensionStore, A.NullableExtension_andThen(this._forwardedModules, new A.Environment_toDummyModule_closure())); + }, + _getModule$1(namespace) { + var _0_0 = this._environment$_modules.$index(0, namespace); + if (_0_0 != null) + return _0_0; + throw A.wrapException(A.SassScriptException$('There is no module with the namespace "' + namespace + '".', null)); + }, + _fromOneModule$1$3($name, type, callback) { + var t1, t2, t3, t4, t5, _1_0, _2_0, value, identity, valueInModule, identityFromModule, module, node, + _0_0 = this._nestedForwardedModules; + if (_0_0 != null) + for (t1 = A._arrayInstanceType(_0_0)._eval$1("ReversedListIterable<1>"), t2 = new A.ReversedListIterable(_0_0, t1), t2 = new A.ListIterator(t2, t2.get$length(0), t1._eval$1("ListIterator")), t1 = t1._eval$1("ListIterable.E"); t2.moveNext$0();) { + t3 = t2.__internal$_current; + for (t3 = J.get$reversed$ax(t3 == null ? t1._as(t3) : t3), t4 = t3.$ti, t3 = new A.ListIterator(t3, t3.get$length(0), t4._eval$1("ListIterator")), t4 = t4._eval$1("ListIterable.E"); t3.moveNext$0();) { + t5 = t3.__internal$_current; + _1_0 = callback.call$1(t5 == null ? t4._as(t5) : t5); + if (_1_0 != null) + return _1_0; + } + } + for (t1 = this._importedModules, t1 = A.LinkedHashMapKeyIterator$(t1, t1._modifications); t1.moveNext$0();) { + _2_0 = callback.call$1(t1.__js_helper$_current); + if (_2_0 != null) + return _2_0; + } + for (t1 = this._globalModules, t2 = A.LinkedHashMapKeyIterator$(t1, t1._modifications), t3 = type$.Callable, value = null, identity = null; t2.moveNext$0();) { + t4 = t2.__js_helper$_current; + valueInModule = callback.call$1(t4); + if (valueInModule == null) + continue; + identityFromModule = t3._is(valueInModule) ? valueInModule : t4.variableIdentity$1($name); + if (identityFromModule.$eq(0, identity)) + continue; + if (value != null) { + t2 = A.LinkedHashMap_LinkedHashMap$_empty(type$.FileSpan, type$.String); + for (t3 = A.MapExtensions_get_pairs(t1, type$.Module_Callable, type$.AstNode), t3 = t3.get$iterator(t3), t4 = "includes " + type; t3.moveNext$0();) { + t1 = t3.get$current(t3); + module = t1._0; + node = t1._1; + if (callback.call$1(module) != null) + t2.$indexSet(0, node.get$span(node), t4); + } + throw A.wrapException(A.MultiSpanSassScriptException$("This " + type + string$.x20is_av, type + " use", t2)); + } + identity = identityFromModule; + value = valueInModule; + } + return value; + }, + _fromOneModule$3($name, type, callback) { + return this._fromOneModule$1$3($name, type, callback, type$.dynamic); + } + }; + A.Environment__getVariableFromGlobalModule_closure.prototype = { + call$1(module) { + return module.get$variables().$index(0, this.name); + }, + $signature: 440 + }; + A.Environment_setVariable_closure.prototype = { + call$0() { + var t1 = this.$this; + t1._lastVariableName = this.name; + return t1._lastVariableIndex = 0; + }, + $signature: 10 + }; + A.Environment_setVariable_closure0.prototype = { + call$1(module) { + return module.get$variables().containsKey$1(this.name) ? module : null; + }, + $signature: 438 + }; + A.Environment_setVariable_closure1.prototype = { + call$0() { + var t1 = this.$this, + t2 = t1._variableIndex$1(this.name); + return t2 == null ? t1._variables.length - 1 : t2; + }, + $signature: 10 + }; + A.Environment__getFunctionFromGlobalModule_closure.prototype = { + call$1(module) { + return module.get$functions(module).$index(0, this.name); + }, + $signature: 226 + }; + A.Environment__getMixinFromGlobalModule_closure.prototype = { + call$1(module) { + return module.get$mixins().$index(0, this.name); + }, + $signature: 226 + }; + A.Environment_toModule_closure.prototype = { + call$1(modules) { + return new A.MapKeySet(modules, type$.MapKeySet_Module_Callable); + }, + $signature: 228 + }; + A.Environment_toDummyModule_closure.prototype = { + call$1(modules) { + return new A.MapKeySet(modules, type$.MapKeySet_Module_Callable); + }, + $signature: 228 + }; + A._EnvironmentModule.prototype = { + get$url(_) { + var t1 = this.css; + t1 = t1.get$span(t1); + return t1.get$sourceUrl(t1); + }, + setVariable$3($name, value, nodeWithSpan) { + var t1, t2, + _0_0 = this._modulesByVariable.$index(0, $name); + if (_0_0 != null) { + _0_0.setVariable$3($name, value, nodeWithSpan); + return; + } + t1 = this._environment$_environment; + t2 = t1._variables; + if (!B.JSArray_methods.get$first(t2).containsKey$1($name)) + throw A.wrapException(A.SassScriptException$("Undefined variable.", null)); + J.$indexSet$ax(B.JSArray_methods.get$first(t2), $name, value); + J.$indexSet$ax(B.JSArray_methods.get$first(t1._variableNodes), $name, nodeWithSpan); + return; + }, + variableIdentity$1($name) { + var module = this._modulesByVariable.$index(0, $name); + return module == null ? this : module.variableIdentity$1($name); + }, + cloneCss$0() { + var _0_0, _this = this; + if (!_this.transitivelyContainsCss) + return _this; + _0_0 = A.cloneCssStylesheet(_this.css, _this.extensionStore); + return A._EnvironmentModule$_(_this._environment$_environment, _0_0._0, _this.preModuleComments, _0_0._1, _this._modulesByVariable, _this.variables, _this.variableNodes, _this.functions, _this.mixins, true, _this.transitivelyContainsExtensions); + }, + toString$0(_) { + var t1 = this.css, + t2 = t1.get$span(t1); + if (t2.get$sourceUrl(t2) == null) + t1 = ""; + else { + t1 = t1.get$span(t1); + t1 = t1.get$sourceUrl(t1); + t2 = $.$get$context(); + t1.toString; + t1 = t2.prettyUri$1(t1); + } + return t1; + }, + $isModule0: 1, + get$upstream() { + return this.upstream; + }, + get$variables() { + return this.variables; + }, + get$variableNodes() { + return this.variableNodes; + }, + get$functions(receiver) { + return this.functions; + }, + get$mixins() { + return this.mixins; + }, + get$extensionStore() { + return this.extensionStore; + }, + get$css(receiver) { + return this.css; + }, + get$preModuleComments() { + return this.preModuleComments; + }, + get$transitivelyContainsCss() { + return this.transitivelyContainsCss; + }, + get$transitivelyContainsExtensions() { + return this.transitivelyContainsExtensions; + } + }; + A._EnvironmentModule__EnvironmentModule_closure.prototype = { + call$1(module) { + return module.get$variables(); + }, + $signature: 437 + }; + A._EnvironmentModule__EnvironmentModule_closure0.prototype = { + call$1(module) { + return module.get$variableNodes(); + }, + $signature: 433 + }; + A._EnvironmentModule__EnvironmentModule_closure1.prototype = { + call$1(module) { + return module.get$functions(module); + }, + $signature: 240 + }; + A._EnvironmentModule__EnvironmentModule_closure2.prototype = { + call$1(module) { + return module.get$mixins(); + }, + $signature: 240 + }; + A._EnvironmentModule__EnvironmentModule_closure3.prototype = { + call$1(module) { + return module.get$transitivelyContainsCss(); + }, + $signature: 121 + }; + A._EnvironmentModule__EnvironmentModule_closure4.prototype = { + call$1(module) { + return module.get$transitivelyContainsExtensions(); + }, + $signature: 121 + }; + A.SassException.prototype = { + get$trace(_) { + return A.Trace$(A._setArrayType([A.frameForSpan(A.SourceSpanException.prototype.get$span.call(this, 0), "root stylesheet", null)], type$.JSArray_Frame), null); + }, + get$span(_) { + return A.SourceSpanException.prototype.get$span.call(this, 0); + }, + withAdditionalSpan$2(span, label) { + return A.MultiSpanSassException$(this._span_exception$_message, A.SourceSpanException.prototype.get$span.call(this, 0), "", A.LinkedHashMap_LinkedHashMap$_literal([span, label], type$.FileSpan, type$.String), this.loadedUrls); + }, + withTrace$1(trace) { + var t1 = A.SourceSpanException.prototype.get$span.call(this, 0), + t2 = A.Set_Set$unmodifiable(this.loadedUrls, type$.Uri); + return new A.SassRuntimeException(trace, t2, this._span_exception$_message, t1); + }, + withLoadedUrls$1(loadedUrls) { + var t1 = A.SourceSpanException.prototype.get$span.call(this, 0), + t2 = A.Set_Set$unmodifiable(loadedUrls, type$.Uri); + return new A.SassException(t2, this._span_exception$_message, t1); + }, + toString$1$color(_, color) { + var t2, _i, frame, t3, _this = this, + buffer = new A.StringBuffer(""), + t1 = "" + ("Error: " + _this._span_exception$_message + "\n"); + buffer._contents = t1; + buffer._contents = t1 + A.SourceSpanException.prototype.get$span.call(_this, 0).highlight$1$color(color); + for (t1 = _this.get$trace(_this).toString$0(0).split("\n"), t2 = t1.length, _i = 0; _i < t2; ++_i) { + frame = t1[_i]; + if (J.get$length$asx(frame) === 0) + continue; + t3 = buffer._contents += "\n"; + buffer._contents = t3 + (" " + A.S(frame)); + } + t1 = buffer._contents; + return t1.charCodeAt(0) == 0 ? t1 : t1; + }, + toString$0(_) { + return this.toString$1$color(0, null); + }, + toCssString$0() { + var commentMessage, stringMessage, rune, + t1 = $._glyphs, + t2 = $._glyphs = B.C_AsciiGlyphSet, + t3 = this.toString$1$color(0, false); + t3 = A.stringReplaceAllUnchecked(t3, "*/", "*\u2215"); + commentMessage = A.stringReplaceAllUnchecked(t3, "\r\n", "\n"); + $._glyphs = t1 === B.C_AsciiGlyphSet ? t2 : B.C_UnicodeGlyphSet; + stringMessage = new A.StringBuffer(""); + for (t1 = new A.RuneIterator(A.serializeValue(new A.SassString(this.toString$1$color(0, false), true), true, true)); t1.moveNext$0();) { + rune = t1._currentCodePoint; + if (rune > 127) { + stringMessage._contents += A.Primitives_stringFromCharCode(92); + stringMessage._contents += B.JSInt_methods.toRadixString$1(rune, 16); + stringMessage._contents += A.Primitives_stringFromCharCode(32); + } else + stringMessage._contents += A.Primitives_stringFromCharCode(rune); + } + return "/* " + B.JSArray_methods.join$1(A._setArrayType(commentMessage.split("\n"), type$.JSArray_String), "\n * ") + ' */\n\nbody::before {\n font-family: "Source Code Pro", "SF Mono", Monaco, Inconsolata, "Fira Mono",\n "Droid Sans Mono", monospace, monospace;\n white-space: pre;\n display: block;\n padding: 1em;\n margin-bottom: 1em;\n border-bottom: 2px solid black;\n content: ' + stringMessage.toString$0(0) + ";\n}"; + } + }; + A.MultiSpanSassException.prototype = { + withAdditionalSpan$2(span, label) { + var _this = this, + t1 = A.SourceSpanException.prototype.get$span.call(_this, 0), + t2 = A.LinkedHashMap_LinkedHashMap$of(_this.secondarySpans, type$.FileSpan, type$.String); + t2.$indexSet(0, span, label); + return A.MultiSpanSassException$(_this._span_exception$_message, t1, _this.primaryLabel, t2, _this.loadedUrls); + }, + withTrace$1(trace) { + var _this = this; + return A.MultiSpanSassRuntimeException$(_this._span_exception$_message, A.SourceSpanException.prototype.get$span.call(_this, 0), _this.primaryLabel, _this.secondarySpans, trace, _this.loadedUrls); + }, + withLoadedUrls$1(loadedUrls) { + var _this = this; + return A.MultiSpanSassException$(_this._span_exception$_message, A.SourceSpanException.prototype.get$span.call(_this, 0), _this.primaryLabel, _this.secondarySpans, loadedUrls); + }, + toString$1$color(_, color) { + var t1, t2, _i, frame, _this = this, + useColor = color === true && true, + buffer = new A.StringBuffer("Error: " + _this._span_exception$_message + "\n"); + A.NullableExtension_andThen(A.Highlighter$multiple(A.SourceSpanException.prototype.get$span.call(_this, 0), _this.primaryLabel, _this.secondarySpans, useColor, null, null).highlight$0(), buffer.get$write(buffer)); + for (t1 = _this.get$trace(_this).toString$0(0).split("\n"), t2 = t1.length, _i = 0; _i < t2; ++_i) { + frame = t1[_i]; + if (J.get$length$asx(frame) === 0) + continue; + buffer._contents += "\n"; + buffer._contents += " " + A.S(frame); + } + t1 = buffer._contents; + return t1.charCodeAt(0) == 0 ? t1 : t1; + }, + toString$0(_) { + return this.toString$1$color(0, null); + }, + get$primaryLabel() { + return this.primaryLabel; + }, + get$secondarySpans() { + return this.secondarySpans; + } + }; + A.SassRuntimeException.prototype = { + withAdditionalSpan$2(span, label) { + var _this = this; + return A.MultiSpanSassRuntimeException$(_this._span_exception$_message, A.SourceSpanException.prototype.get$span.call(_this, 0), "", A.LinkedHashMap_LinkedHashMap$_literal([span, label], type$.FileSpan, type$.String), _this.trace, _this.loadedUrls); + }, + withLoadedUrls$1(loadedUrls) { + var t1 = A.SourceSpanException.prototype.get$span.call(this, 0), + t2 = A.Set_Set$unmodifiable(loadedUrls, type$.Uri); + return new A.SassRuntimeException(this.trace, t2, this._span_exception$_message, t1); + }, + get$trace(receiver) { + return this.trace; + } + }; + A.MultiSpanSassRuntimeException.prototype = { + withAdditionalSpan$2(span, label) { + var _this = this, + t1 = A.SourceSpanException.prototype.get$span.call(_this, 0), + t2 = A.LinkedHashMap_LinkedHashMap$of(_this.secondarySpans, type$.FileSpan, type$.String); + t2.$indexSet(0, span, label); + return A.MultiSpanSassRuntimeException$(_this._span_exception$_message, t1, _this.primaryLabel, t2, _this.trace, _this.loadedUrls); + }, + withLoadedUrls$1(loadedUrls) { + var _this = this; + return A.MultiSpanSassRuntimeException$(_this._span_exception$_message, A.SourceSpanException.prototype.get$span.call(_this, 0), _this.primaryLabel, _this.secondarySpans, _this.trace, loadedUrls); + }, + $isSassRuntimeException: 1, + get$trace(receiver) { + return this.trace; + } + }; + A.SassFormatException.prototype = { + get$source() { + var t1 = A.SourceSpanException.prototype.get$span.call(this, 0); + return A.String_String$fromCharCodes(B.NativeUint32List_methods.sublist$2(t1.get$file(t1)._decodedChars, 0, null), 0, null); + }, + withAdditionalSpan$2(span, label) { + return A.MultiSpanSassFormatException$(this._span_exception$_message, A.SourceSpanException.prototype.get$span.call(this, 0), "", A.LinkedHashMap_LinkedHashMap$_literal([span, label], type$.FileSpan, type$.String), this.loadedUrls); + }, + withLoadedUrls$1(loadedUrls) { + var t1 = A.SourceSpanException.prototype.get$span.call(this, 0), + t2 = A.Set_Set$unmodifiable(loadedUrls, type$.Uri); + return new A.SassFormatException(t2, this._span_exception$_message, t1); + }, + $isFormatException: 1, + $isSourceSpanFormatException: 1 + }; + A.MultiSpanSassFormatException.prototype = { + get$source() { + var t1 = A.SourceSpanException.prototype.get$span.call(this, 0); + return A.String_String$fromCharCodes(B.NativeUint32List_methods.sublist$2(t1.get$file(t1)._decodedChars, 0, null), 0, null); + }, + withAdditionalSpan$2(span, label) { + var _this = this, + t1 = A.SourceSpanException.prototype.get$span.call(_this, 0), + t2 = A.LinkedHashMap_LinkedHashMap$of(_this.secondarySpans, type$.FileSpan, type$.String); + t2.$indexSet(0, span, label); + return A.MultiSpanSassFormatException$(_this._span_exception$_message, t1, _this.primaryLabel, t2, _this.loadedUrls); + }, + withLoadedUrls$1(loadedUrls) { + var _this = this; + return A.MultiSpanSassFormatException$(_this._span_exception$_message, A.SourceSpanException.prototype.get$span.call(_this, 0), _this.primaryLabel, _this.secondarySpans, loadedUrls); + }, + $isFormatException: 1, + $isSassFormatException: 1, + $isSourceSpanFormatException: 1, + $isMultiSourceSpanFormatException: 1 + }; + A.SassScriptException.prototype = { + withSpan$1(span) { + return new A.SassException(B.Set_empty, this.message, span); + }, + toString$0(_) { + return this.message + string$.x0a_BUG_; + }, + get$message(receiver) { + return this.message; + } + }; + A.MultiSpanSassScriptException.prototype = { + withSpan$1(span) { + return A.MultiSpanSassException$(this.message, span, this.primaryLabel, this.secondarySpans, null); + } + }; + A._writeSourceMap_closure.prototype = { + call$1(url) { + return this.options.sourceMapUrl$2(0, A.Uri_parse(url), this.destination).toString$0(0); + }, + $signature: 5 + }; + A.ExecutableOptions.prototype = { + get$interactive() { + var result, _this = this, + value = _this.__ExecutableOptions_interactive_FI; + if (value === $) { + result = new A.ExecutableOptions_interactive_closure(_this).call$0(); + _this.__ExecutableOptions_interactive_FI !== $ && A.throwUnnamedLateFieldADI(); + _this.__ExecutableOptions_interactive_FI = result; + value = result; + } + return value; + }, + get$color() { + var t1 = this._options; + return t1.wasParsed$1("color") ? A._asBool(t1.$index(0, "color")) : A.hasTerminal(); + }, + get$pkgImporters() { + var t2, t3, t4, _null = null, + t1 = A._setArrayType([], type$.JSArray_Importer); + for (t2 = J.get$iterator$ax(type$.List_String._as(this._options.$index(0, "pkg-importer"))); t2.moveNext$0();) { + t2.get$current(t2); + t3 = new A.NodePackageImporter(); + t4 = self.process; + if (t4 == null) + t4 = _null; + else { + t4 = J.get$release$x(t4); + t4 = t4 == null ? _null : J.get$name$x(t4); + } + if (!J.$eq$(t4, "node") && self.document != null && typeof self.document.querySelector == "function") + A.throwExpression(string$.The_No); + t3.__NodePackageImporter__entryPointDirectory_F = $.$get$context().absolute$15(".", _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null); + t1.push(t3); + } + return t1; + }, + get$emitErrorCss() { + var t1 = A._asBoolQ(this._options.$index(0, "error-css")); + if (t1 == null) { + this._ensureSources$0(); + t1 = this._sourcesToDestinations; + t1 = t1.get$values(t1).any$1(0, new A.ExecutableOptions_emitErrorCss_closure()); + } + return t1; + }, + _ensureSources$0() { + var t1, stdin, t2, t3, $directories, t4, t5, t6, colonArgs, positionalArgs, t7, t8, t9, message, target, source, destination, seen, _0_0, _this = this, _null = null, + _s18_ = 'Duplicate source "'; + if (_this._sourcesToDestinations != null) + return; + t1 = _this._options; + stdin = A._asBool(t1.$index(0, "stdin")); + t2 = t1.rest; + if (t2.get$length(0) === 0 && !stdin) + A.ExecutableOptions__fail("Compile Sass to CSS."); + t3 = type$.String; + $directories = A.LinkedHashSet_LinkedHashSet$_empty(t3); + for (t4 = t2.$ti, t5 = t4._eval$1("ListIterator"), t6 = new A.ListIterator(t2, t2.get$length(0), t5), t4 = t4._eval$1("ListBase.E"), colonArgs = false, positionalArgs = false; t6.moveNext$0();) { + t7 = t6.__internal$_current; + if (t7 == null) + t7 = t4._as(t7); + t8 = t7.length; + if (t8 === 0) + A.ExecutableOptions__fail('Invalid argument "".'); + if (A.stringContainsUnchecked(t7, ":", 0)) { + if (t8 > 2) { + t9 = t7.charCodeAt(0); + if (!(t9 >= 97 && t9 <= 122)) + t9 = t9 >= 65 && t9 <= 90; + else + t9 = true; + t9 = t9 && t7.charCodeAt(1) === 58; + } else + t9 = false; + if (t9) { + if (2 > t8) + A.throwExpression(A.RangeError$range(2, 0, t8, _null, _null)); + t8 = A.stringContainsUnchecked(t7, ":", 2); + } else + t8 = true; + } else + t8 = false; + if (t8) + colonArgs = true; + else if (A.dirExists(t7)) + $directories.add$1(0, t7); + else + positionalArgs = true; + } + if (positionalArgs || t2.get$length(0) === 0) { + if (colonArgs) + A.ExecutableOptions__fail('Positional and ":" arguments may not both be used.'); + else if (stdin) { + if (J.get$length$asx(t2._collection$_source) > 1) + A.ExecutableOptions__fail("Only one argument is allowed with --stdin."); + else if (A._asBool(t1.$index(0, "update"))) + A.ExecutableOptions__fail("--update is not allowed with --stdin."); + else if (A._asBool(t1.$index(0, "watch"))) + A.ExecutableOptions__fail("--watch is not allowed with --stdin."); + t1 = t2.get$length(0) === 0 ? _null : t2.get$first(t2); + t2 = type$.dynamic; + t3 = type$.nullable_String; + _this._sourcesToDestinations = A.ConstantMap_ConstantMap$from(A.LinkedHashMap_LinkedHashMap$_literal([null, t1], t2, t2), t3, t3); + } else { + t3 = t2._collection$_source; + t4 = J.getInterceptor$asx(t3); + if (t4.get$length(t3) > 2) + A.ExecutableOptions__fail("Only two positional args may be passed."); + else if ($directories._collection$_length !== 0) { + message = 'Directory "' + A.S($directories.get$first(0)) + '" may not be a positional arg.'; + target = t2.get$last(t2); + A.ExecutableOptions__fail(J.$eq$($directories.get$first(0), t2.get$first(t2)) && !A.fileExists(target) ? message + ('\nTo compile all CSS in "' + A.S($directories.get$first(0)) + '" to "' + target + '", use `sass ' + A.S($directories.get$first(0)) + ":" + target + "`.") : message); + } else { + source = J.$eq$(t2.get$first(t2), "-") ? _null : t2.get$first(t2); + destination = t4.get$length(t3) === 1 ? _null : t2.get$last(t2); + if (destination == null) + if (A._asBool(t1.$index(0, "update"))) + A.ExecutableOptions__fail("--update is not allowed when printing to stdout."); + else if (A._asBool(t1.$index(0, "watch"))) + A.ExecutableOptions__fail("--watch is not allowed when printing to stdout."); + t1 = A.PathMap__create(_null, type$.nullable_String); + t1.$indexSet(0, source, destination); + _this._sourcesToDestinations = new A.UnmodifiableMapView(new A.PathMap(t1, type$.PathMap_nullable_String), type$.UnmodifiableMapView_of_nullable_String_and_nullable_String); + } + } + _this.__ExecutableOptions__sourceDirectoriesToDestinations_F !== $ && A.throwUnnamedLateFieldAI(); + _this.__ExecutableOptions__sourceDirectoriesToDestinations_F = B.Map_empty; + return; + } + if (stdin) + A.ExecutableOptions__fail('--stdin may not be used with ":" arguments.'); + seen = A.LinkedHashSet_LinkedHashSet$_empty(t3); + t1 = A.PathMap__create(_null, t3); + t6 = type$.PathMap_String; + t3 = A.PathMap__create(_null, t3); + for (t2 = new A.ListIterator(t2, t2.get$length(0), t5); t2.moveNext$0();) { + t5 = t2.__internal$_current; + if (t5 == null) + t5 = t4._as(t5); + if ($directories.contains$1(0, t5)) { + if (!seen.add$1(0, t5)) + A.ExecutableOptions__fail(_s18_ + t5 + '".'); + t3.$indexSet(0, t5, t5); + t1.addAll$1(0, _this._listSourceDirectory$2(t5, t5)); + continue; + } + _0_0 = _this._splitSourceAndDestination$1(t5); + source = _0_0._0; + destination = _0_0._1; + if (!seen.add$1(0, source)) + A.ExecutableOptions__fail(_s18_ + source + '".'); + if (source === "-") + t1.$indexSet(0, _null, destination); + else if (A.dirExists(source)) { + t3.$indexSet(0, source, destination); + t1.addAll$1(0, _this._listSourceDirectory$2(source, destination)); + } else + t1.$indexSet(0, source, destination); + } + _this._sourcesToDestinations = new A.UnmodifiableMapView(new A.PathMap(t1, t6), type$.UnmodifiableMapView_of_nullable_String_and_nullable_String); + _this.__ExecutableOptions__sourceDirectoriesToDestinations_F !== $ && A.throwUnnamedLateFieldAI(); + _this.__ExecutableOptions__sourceDirectoriesToDestinations_F = new A.UnmodifiableMapView(new A.PathMap(t3, t6), type$.UnmodifiableMapView_of_nullable_String_and_String); + }, + _splitSourceAndDestination$1(argument) { + var t1, i, t2, t3, nextColon; + for (t1 = argument.length, i = 0; i < t1; ++i) { + if (i === 1) { + t2 = i - 1; + if (t1 > t2 + 2) { + t3 = argument.charCodeAt(t2); + if (!(t3 >= 97 && t3 <= 122)) + t3 = t3 >= 65 && t3 <= 90; + else + t3 = true; + t2 = t3 && argument.charCodeAt(t2 + 1) === 58; + } else + t2 = false; + } else + t2 = false; + if (t2) + continue; + if (argument.charCodeAt(i) === 58) { + t2 = i + 1; + nextColon = B.JSString_methods.indexOf$2(argument, ":", t2); + if (nextColon === i + 2) + if (t1 > t2 + 2) { + t1 = argument.charCodeAt(t2); + if (!(t1 >= 97 && t1 <= 122)) + t1 = t1 >= 65 && t1 <= 90; + else + t1 = true; + t1 = t1 && argument.charCodeAt(t2 + 1) === 58; + } else + t1 = false; + else + t1 = false; + if ((t1 ? B.JSString_methods.indexOf$2(argument, ":", nextColon + 1) : nextColon) !== -1) + A.ExecutableOptions__fail('"' + argument + '" may only contain one ":".'); + return new A._Record_2(B.JSString_methods.substring$2(argument, 0, i), B.JSString_methods.substring$1(argument, t2)); + } + } + throw A.wrapException(A.ArgumentError$('Expected "' + argument + '" to contain a colon.', null)); + }, + _listSourceDirectory$2(source, destination) { + var t2, t3, t4, t5, + t1 = type$.String; + t1 = A.LinkedHashMap_LinkedHashMap$_empty(t1, t1); + for (t2 = J.get$iterator$ax(A.listDir(source, true)), t3 = source === destination; t2.moveNext$0();) { + t4 = t2.get$current(t2); + if (this._isEntrypoint$1(t4)) + t5 = !(t3 && A.ParsedPath_ParsedPath$parse(t4, $.$get$context().style)._splitExtension$1(1)[1] === ".css"); + else + t5 = false; + if (t5) { + t5 = $.$get$context(); + t1.$indexSet(0, t4, A.join(destination, t5.withoutExtension$1(t5.relative$2$from(t4, source)) + ".css", null)); + } + } + return t1; + }, + _isEntrypoint$1(path) { + var extension, + t1 = $.$get$context().style; + if (B.JSString_methods.startsWith$1(A.ParsedPath_ParsedPath$parse(path, t1).get$basename(), "_")) + return false; + extension = A.ParsedPath_ParsedPath$parse(path, t1)._splitExtension$1(1)[1]; + return extension === ".scss" || extension === ".sass" || extension === ".css"; + }, + get$_writeToStdout() { + var t1, _this = this; + _this._ensureSources$0(); + t1 = _this._sourcesToDestinations; + if (t1.get$length(t1) === 1) { + _this._ensureSources$0(); + t1 = _this._sourcesToDestinations; + t1 = t1.get$values(t1); + t1 = t1.get$single(t1) == null; + } else + t1 = false; + return t1; + }, + get$emitSourceMap() { + var _this = this, + _s10_ = "source-map", + _s15_ = "source-map-urls", + _s13_ = "embed-sources", + _s16_ = "embed-source-map", + t1 = _this._options; + if (!A._asBool(t1.$index(0, _s10_))) + if (t1.wasParsed$1(_s15_)) + A.ExecutableOptions__fail("--source-map-urls isn't allowed with --no-source-map."); + else if (t1.wasParsed$1(_s13_)) + A.ExecutableOptions__fail("--embed-sources isn't allowed with --no-source-map."); + else if (t1.wasParsed$1(_s16_)) + A.ExecutableOptions__fail("--embed-source-map isn't allowed with --no-source-map."); + if (!_this.get$_writeToStdout()) + return A._asBool(t1.$index(0, _s10_)); + if (J.$eq$(_this._ifParsed$1(_s15_), "relative")) + A.ExecutableOptions__fail("--source-map-urls=relative isn't allowed when printing to stdout."); + if (A._asBool(t1.$index(0, _s16_))) + return A._asBool(t1.$index(0, _s10_)); + else if (J.$eq$(_this._ifParsed$1(_s10_), true)) + A.ExecutableOptions__fail("When printing to stdout, --source-map requires --embed-source-map."); + else if (t1.wasParsed$1(_s15_)) + A.ExecutableOptions__fail("When printing to stdout, --source-map-urls requires --embed-source-map."); + else if (A._asBool(t1.$index(0, _s13_))) + A.ExecutableOptions__fail("When printing to stdout, --embed-sources requires --embed-source-map."); + else + return false; + }, + sourceMapUrl$2(_, url, destination) { + var t1, path, t2, _null = null; + if (url.get$scheme().length !== 0 && url.get$scheme() !== "file") + return url; + t1 = $.$get$context(); + path = t1.style.pathFromUri$1(A._parseUri(url)); + if (J.$eq$(this._options.$index(0, "source-map-urls"), "relative") && !this.get$_writeToStdout()) { + destination.toString; + t2 = t1.relative$2$from(path, t1.dirname$1(destination)); + } else + t2 = A.absolute(path, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null); + return t1.toUri$1(t2); + }, + get$fatalDeprecations() { + var t1 = this._fatalDeprecations; + return t1 == null ? this._fatalDeprecations = new A.ExecutableOptions_fatalDeprecations_closure(this).call$0() : t1; + }, + get$futureDeprecations() { + var t2, t3, t4, + t1 = A.LinkedHashSet_LinkedHashSet$_empty(type$.Deprecation); + for (t2 = J.get$iterator$ax(type$.List_String._as(this._options.$index(0, "future-deprecation"))); t2.moveNext$0();) { + t3 = t2.get$current(t2); + t4 = A.Deprecation_fromId(t3); + t1.add$1(0, t4 == null ? A.ExecutableOptions__fail('Invalid deprecation "' + t3 + '".') : t4); + } + return t1; + }, + _ifParsed$1($name) { + var t1 = this._options; + return t1.wasParsed$1($name) ? t1.$index(0, $name) : null; + } + }; + A.ExecutableOptions__parser_closure.prototype = { + call$0() { + var _i, deprecation, $self, id, _0_4, t4, _0_4_isSet, description, _1_5, _1_5_isSet, _null = null, + t1 = type$.String, + t2 = A.LinkedHashMap_LinkedHashMap$_empty(t1, type$.Option), + t3 = [], + parser = new A.ArgParser(t2, A.LinkedHashMap_LinkedHashMap$_empty(t1, t1), new A.UnmodifiableMapView(t2, type$.UnmodifiableMapView_String_Option), new A.UnmodifiableMapView(A.LinkedHashMap_LinkedHashMap$_empty(t1, type$.ArgParser), type$.UnmodifiableMapView_String_ArgParser), t3, true, _null); + parser.addOption$2$hide("precision", true); + parser.addFlag$2$hide("async", true); + t3.push(A.ExecutableOptions__separator("Input and Output")); + parser.addFlag$2$help("stdin", "Read the stylesheet from stdin."); + parser.addFlag$2$help("indented", "Use the indented syntax for input from stdin."); + parser.addMultiOption$5$abbr$help$splitCommas$valueHelp("load-path", "I", "A path to use when resolving imports.\nMay be passed multiple times.", false, "PATH"); + t2 = type$.JSArray_String; + parser.addMultiOption$6$abbr$allowed$allowedHelp$help$valueHelp("pkg-importer", "p", A._setArrayType(["node"], t2), A.LinkedHashMap_LinkedHashMap$_literal(["node", "Load files like Node.js package resolution."], t1, t1), "Built-in importer(s) to use for pkg: URLs.", "TYPE"); + parser.addOption$6$abbr$allowed$defaultsTo$help$valueHelp("style", "s", A._setArrayType(["expanded", "compressed"], t2), "expanded", "Output style.", "NAME"); + parser.addFlag$3$defaultsTo$help("charset", true, "Emit a @charset or BOM for CSS with non-ASCII characters."); + parser.addFlag$3$defaultsTo$help("error-css", _null, "When an error occurs, emit a stylesheet describing it.\nDefaults to true when compiling to a file."); + parser.addFlag$3$help$negatable("update", "Only compile out-of-date stylesheets.", false); + t3.push(A.ExecutableOptions__separator("Source Maps")); + parser.addFlag$3$defaultsTo$help("source-map", true, "Whether to generate source maps."); + parser.addOption$4$allowed$defaultsTo$help("source-map-urls", A._setArrayType(["relative", "absolute"], t2), "relative", "How to link from source maps to source files."); + parser.addFlag$3$defaultsTo$help("embed-sources", false, "Embed source file contents in source maps."); + parser.addFlag$3$defaultsTo$help("embed-source-map", false, "Embed source map contents in CSS."); + t3.push(A.ExecutableOptions__separator("Warnings")); + parser.addFlag$3$abbr$help("quiet", "q", "Don't print warnings."); + parser.addFlag$2$help("quiet-deps", "Don't print compiler warnings from dependencies.\nStylesheets imported through load paths count as dependencies."); + parser.addFlag$2$help("verbose", "Print all deprecation warnings even when they're repetitive."); + t2 = A.LinkedHashMap_LinkedHashMap$_empty(t1, t1); + for (_i = 0; _i < 16; ++_i) { + deprecation = B.List_GN8[_i]; + $self = deprecation._deprecatedIn; + if (($self == null ? _null : A.Version___parse_tearOff($self)) != null) { + id = deprecation.id; + _0_4 = deprecation.description; + t4 = _0_4 != null; + _0_4_isSet = true; + } else { + _0_4 = _null; + id = _0_4; + _0_4_isSet = false; + t4 = false; + } + if (t4) { + description = _0_4_isSet ? _0_4 : deprecation.description; + t2.$indexSet(0, id, description == null ? A._asString(description) : description); + } + } + parser.addMultiOption$3$allowedHelp$help("fatal-deprecation", t2, "Deprecations to treat as errors. You may also pass a Sass\nversion to include any behavior deprecated in or before it.\nSee https://sass-lang.com/documentation/breaking-changes for \na complete list."); + t1 = A.LinkedHashMap_LinkedHashMap$_empty(t1, t1); + for (_i = 0; _i < 16; ++_i) { + deprecation = B.List_GN8[_i]; + $self = deprecation._deprecatedIn; + if (($self == null ? _null : A.Version___parse_tearOff($self)) == null) { + id = deprecation.id; + _1_5 = deprecation.description; + t2 = _1_5 != null; + _1_5_isSet = true; + } else { + _1_5 = _null; + id = _1_5; + _1_5_isSet = false; + t2 = false; + } + if (t2) { + description = _1_5_isSet ? _1_5 : deprecation.description; + t1.$indexSet(0, id, description == null ? A._asString(description) : description); + } + } + parser.addMultiOption$3$allowedHelp$help("future-deprecation", t1, "Opt in to a deprecation early."); + t3.push(A.ExecutableOptions__separator("Other")); + parser.addFlag$4$abbr$help$negatable("watch", "w", "Watch stylesheets and recompile when they change.", false); + parser.addFlag$2$help("poll", "Manually check for changes rather than using a native watcher.\nOnly valid with --watch."); + parser.addFlag$2$help("stop-on-error", "Don't compile more files once an error is encountered."); + parser.addFlag$4$abbr$help$negatable("interactive", "i", "Run an interactive SassScript shell.", false); + parser.addFlag$3$abbr$help("color", "c", "Whether to use terminal colors for messages."); + parser.addFlag$2$help("unicode", "Whether to use Unicode characters for messages."); + parser.addFlag$2$help("trace", "Print full Dart stack traces for exceptions."); + parser.addFlag$4$abbr$help$negatable("help", "h", "Print this usage information.", false); + parser.addFlag$3$help$negatable("version", "Print the version of Dart Sass.", false); + return parser; + }, + $signature: 429 + }; + A.ExecutableOptions_interactive_closure.prototype = { + call$0() { + var _0_0, + t1 = this.$this._options; + if (!A._asBool(t1.$index(0, "interactive"))) + return false; + _0_0 = A.IterableExtension_firstWhereOrNull(A._setArrayType(["stdin", "indented", "style", "source-map", "source-map-urls", "embed-sources", "embed-source-map", "update", "watch"], type$.JSArray_String), t1.get$wasParsed()); + if (_0_0 != null) + throw A.wrapException(A.UsageException$("--" + _0_0 + " isn't allowed with --interactive.")); + return true; + }, + $signature: 26 + }; + A.ExecutableOptions_emitErrorCss_closure.prototype = { + call$1(destination) { + return destination != null; + }, + $signature: 180 + }; + A.ExecutableOptions_fatalDeprecations_closure.prototype = { + call$0() { + var id, argVersion, sassVersion, t1, t2, _0_0, exception, + deprecations = A.LinkedHashSet_LinkedHashSet$_empty(type$.Deprecation); + for (t1 = J.get$iterator$ax(type$.List_String._as(this.$this._options.$index(0, "fatal-deprecation"))), t2 = type$.FormatException; t1.moveNext$0();) { + id = t1.get$current(t1); + _0_0 = A.Deprecation_fromId(id); + if (_0_0 != null) { + J.add$1$ax(deprecations, _0_0); + continue; + } + try { + argVersion = A.Version_Version$parse(id); + sassVersion = A.Version_Version$parse("1.72.0"); + if (J.compareTo$1$ns(argVersion, sassVersion) > 0) + A.ExecutableOptions__fail("Invalid version " + A.S(argVersion) + ". --fatal-deprecation requires a version less than or equal to the current Dart Sass version."); + J.addAll$1$ax(deprecations, A.Deprecation_forVersion(argVersion)); + } catch (exception) { + if (t2._is(A.unwrapException(exception))) + A.ExecutableOptions__fail('Invalid deprecation "' + A.S(id) + '".'); + else + throw exception; + } + } + return deprecations; + }, + $signature: 427 + }; + A.UsageException.prototype = {$isException: 1, + get$message(receiver) { + return this.message; + } + }; + A.watch_closure.prototype = { + call$1(dir) { + for (; !A.dirExists(dir);) + dir = $.$get$context().dirname$1(dir); + return this.dirWatcher.watch$1(0, dir); + }, + $signature: 426 + }; + A._Watcher.prototype = { + _delete$1(path) { + var buffer, t1, exception; + try { + A.deleteFile(path); + buffer = new A.StringBuffer(""); + t1 = this._watch$_options; + if (t1.get$color()) + buffer._contents += "\x1b[33m"; + buffer._contents += "Deleted " + path + "."; + if (t1.get$color()) + buffer._contents += "\x1b[0m"; + A.print(buffer); + } catch (exception) { + if (!(A.unwrapException(exception) instanceof A.FileSystemException)) + throw exception; + } + }, + watch$1(_, watcher) { + return this.watch$body$_Watcher(0, watcher); + }, + watch$body$_Watcher(_, watcher) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void), + $async$returnValue, $async$handler = 2, $async$currentError, $async$next = [], $async$self = this, $event, extension, success, success0, success1, t2, t1; + var $async$watch$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) { + $async$currentError = $async$result; + $async$goto = $async$handler; + } + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = watcher._group.__StreamGroup__controller_A; + t1 === $ && A.throwUnnamedLateFieldNI(); + t1 = new A._StreamIterator(A.checkNotNullable($async$self._debounceEvents$1(new A._ControllerStream(t1, A._instanceType(t1)._eval$1("_ControllerStream<1>"))), "stream", type$.Object)); + $async$handler = 3; + t2 = $async$self._watch$_options._options; + case 6: + // for condition + $async$goto = 8; + return A._asyncAwait(t1.moveNext$0(), $async$watch$1); + case 8: + // returning from await. + if (!$async$result) { + // goto after for + $async$goto = 7; + break; + } + $event = t1.get$current(0); + extension = A.ParsedPath_ParsedPath$parse($event.path, $.$get$context().style)._splitExtension$1(1)[1]; + if (!J.$eq$(extension, ".sass") && !J.$eq$(extension, ".scss") && !J.$eq$(extension, ".css")) { + // goto for condition + $async$goto = 6; + break; + } + case 9: + // switch + switch ($event.type) { + case B.ChangeType_modify: + // goto case + $async$goto = 11; + break; + case B.ChangeType_add: + // goto case + $async$goto = 12; + break; + case B.ChangeType_remove: + // goto case + $async$goto = 13; + break; + default: + // goto after switch + $async$goto = 10; + break; + } + break; + case 11: + // case + $async$goto = 14; + return A._asyncAwait($async$self._handleModify$1($event.path), $async$watch$1); + case 14: + // returning from await. + success = $async$result; + if (!success && A._asBool(t2.$index(0, "stop-on-error"))) { + $async$next = [1]; + // goto finally + $async$goto = 4; + break; + } + // goto after switch + $async$goto = 10; + break; + case 12: + // case + $async$goto = 15; + return A._asyncAwait($async$self._handleAdd$1($event.path), $async$watch$1); + case 15: + // returning from await. + success0 = $async$result; + if (!success0 && A._asBool(t2.$index(0, "stop-on-error"))) { + $async$next = [1]; + // goto finally + $async$goto = 4; + break; + } + // goto after switch + $async$goto = 10; + break; + case 13: + // case + $async$goto = 16; + return A._asyncAwait($async$self._handleRemove$1($event.path), $async$watch$1); + case 16: + // returning from await. + success1 = $async$result; + if (!success1 && A._asBool(t2.$index(0, "stop-on-error"))) { + $async$next = [1]; + // goto finally + $async$goto = 4; + break; + } + // goto after switch + $async$goto = 10; + break; + case 10: + // after switch + // goto for condition + $async$goto = 6; + break; + case 7: + // after for + $async$next.push(5); + // goto finally + $async$goto = 4; + break; + case 3: + // uncaught + $async$next = [2]; + case 4: + // finally + $async$handler = 2; + $async$goto = 17; + return A._asyncAwait(t1.cancel$0(), $async$watch$1); + case 17: + // returning from await. + // goto the next finally handler + $async$goto = $async$next.pop(); + break; + case 5: + // after finally + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + case 2: + // rethrow + return A._asyncRethrow($async$currentError, $async$completer); + } + }); + return A._asyncStartSync($async$watch$1, $async$completer); + }, + _handleModify$1(path) { + return this._handleModify$body$_Watcher(path); + }, + _handleModify$body$_Watcher(path) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.bool), + $async$returnValue, $async$self = this, t2, t0, url, _0_0, t1; + var $async$_handleModify$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = A.isNodeJs() ? self.process : null; + if (!J.$eq$(t1 == null ? null : J.get$platform$x(t1), "win32")) { + t1 = A.isNodeJs() ? self.process : null; + t1 = J.$eq$(t1 == null ? null : J.get$platform$x(t1), "darwin"); + } else + t1 = true; + if (t1) { + t1 = $.$get$context(); + t2 = A._realCasePath(A.absolute(t1.normalize$1(path), null, null, null, null, null, null, null, null, null, null, null, null, null, null)); + t0 = t2; + t2 = t1; + t1 = t0; + } else { + t1 = $.$get$context(); + t2 = t1.canonicalize$1(0, path); + t0 = t2; + t2 = t1; + t1 = t0; + } + url = t2.toUri$1(t1); + t1 = $async$self._graph; + _0_0 = t1._nodes.$index(0, url); + $async$goto = _0_0 != null ? 3 : 5; + break; + case 3: + // then + t1.reload$1(url); + $async$goto = 6; + return A._asyncAwait($async$self._recompileDownstream$1(A._setArrayType([_0_0], type$.JSArray_StylesheetNode)), $async$_handleModify$1); + case 6: + // returning from await. + $async$returnValue = $async$result; + // goto return + $async$goto = 1; + break; + // goto join + $async$goto = 4; + break; + case 5: + // else + $async$returnValue = $async$self._handleAdd$1(path); + // goto return + $async$goto = 1; + break; + case 4: + // join + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$_handleModify$1, $async$completer); + }, + _handleAdd$1(path) { + return this._handleAdd$body$_Watcher(path); + }, + _handleAdd$body$_Watcher(path) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.bool), + $async$returnValue, $async$self = this, t1, success, t2, t3, t0, destination; + var $async$_handleAdd$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + destination = $async$self._destinationFor$1(path); + $async$goto = destination != null ? 3 : 5; + break; + case 3: + // then + t1 = type$.nullable_String; + $async$goto = 6; + return A._asyncAwait(A.compileStylesheets($async$self._watch$_options, $async$self._graph, A.LinkedHashMap_LinkedHashMap$_literal([path, destination], t1, t1), true), $async$_handleAdd$1); + case 6: + // returning from await. + success = $async$result; + // goto join + $async$goto = 4; + break; + case 5: + // else + success = true; + case 4: + // join + t1 = $.$get$FilesystemImporter_cwd(); + t2 = A.isNodeJs() ? self.process : null; + if (!J.$eq$(t2 == null ? null : J.get$platform$x(t2), "win32")) { + t2 = A.isNodeJs() ? self.process : null; + t2 = J.$eq$(t2 == null ? null : J.get$platform$x(t2), "darwin"); + } else + t2 = true; + if (t2) { + t2 = $.$get$context(); + t3 = A._realCasePath(A.absolute(t2.normalize$1(path), null, null, null, null, null, null, null, null, null, null, null, null, null, null)); + t0 = t3; + t3 = t2; + t2 = t0; + } else { + t2 = $.$get$context(); + t3 = t2.canonicalize$1(0, path); + t0 = t3; + t3 = t2; + t2 = t0; + } + $async$goto = 7; + return A._asyncAwait($async$self._recompileDownstream$1($async$self._graph.addCanonical$3(t1, t3.toUri$1(t2), t3.toUri$1(path))), $async$_handleAdd$1); + case 7: + // returning from await. + $async$returnValue = $async$result && success; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$_handleAdd$1, $async$completer); + }, + _handleRemove$1(path) { + return this._handleRemove$body$_Watcher(path); + }, + _handleRemove$body$_Watcher(path) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.bool), + $async$returnValue, $async$self = this, t2, t0, url, _0_0, t3, node, toRecompile, t1; + var $async$_handleRemove$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = A.isNodeJs() ? self.process : null; + if (!J.$eq$(t1 == null ? null : J.get$platform$x(t1), "win32")) { + t1 = A.isNodeJs() ? self.process : null; + t1 = J.$eq$(t1 == null ? null : J.get$platform$x(t1), "darwin"); + } else + t1 = true; + if (t1) { + t1 = $.$get$context(); + t2 = A._realCasePath(A.absolute(t1.normalize$1(path), null, null, null, null, null, null, null, null, null, null, null, null, null, null)); + t0 = t2; + t2 = t1; + t1 = t0; + } else { + t1 = $.$get$context(); + t2 = t1.canonicalize$1(0, path); + t0 = t2; + t2 = t1; + t1 = t0; + } + url = t2.toUri$1(t1); + t1 = $async$self._graph; + t2 = t1._nodes; + if (t2.containsKey$1(url)) { + _0_0 = $async$self._destinationFor$1(path); + if (_0_0 != null) + $async$self._delete$1(_0_0); + } + t3 = $.$get$FilesystemImporter_cwd(); + node = t2.remove$1(0, url); + t2 = node != null; + if (t2) { + t1._transitiveModificationTimes.clear$0(0); + t1.importCache.clearImport$1(url); + node._stylesheet_graph$_remove$0(); + } + toRecompile = t1._recanonicalizeImports$2(t3, url); + if (t2) + toRecompile.addAll$1(0, node._downstream); + $async$goto = 3; + return A._asyncAwait($async$self._recompileDownstream$1(toRecompile), $async$_handleRemove$1); + case 3: + // returning from await. + $async$returnValue = $async$result; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$_handleRemove$1, $async$completer); + }, + _debounceEvents$1(events) { + var t1 = type$.WatchEvent; + t1 = A.RateLimit__debounceAggregate(events, A.Duration$(25), A.instantiate1(A.rate_limit___collect$closure(), t1), false, true, t1, type$.List_WatchEvent); + return new A._ExpandStream(new A._Watcher__debounceEvents_closure(), t1, A._instanceType(t1)._eval$1("_ExpandStream")); + }, + _recompileDownstream$1(nodes) { + return this._recompileDownstream$body$_Watcher(nodes); + }, + _recompileDownstream$body$_Watcher(nodes) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.bool), + $async$returnValue, $async$self = this, t1, t2, t3, t4, t5, allSucceeded, t6, t7, t8, sourcesToDestinations, success, _i, seen; + var $async$_recompileDownstream$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + seen = A.LinkedHashSet_LinkedHashSet$_empty(type$.StylesheetNode); + t1 = type$.UnmodifiableSetView_StylesheetNode, t2 = type$.JSArray_StylesheetNode, t3 = $async$self._watch$_options, t4 = $async$self._graph, t5 = t3._options, allSucceeded = true; + case 3: + // for condition + if (!(t6 = J.getInterceptor$asx(nodes), t6.get$isNotEmpty(nodes))) { + // goto after for + $async$goto = 5; + break; + } + t7 = A._setArrayType([], t2); + for (t6 = t6.get$iterator(nodes); t6.moveNext$0();) { + t8 = t6.get$current(t6); + if (seen.add$1(0, t8)) + t7.push(t8); + } + sourcesToDestinations = $async$self._sourceEntrypointsToDestinations$1(t7); + $async$goto = sourcesToDestinations.__js_helper$_length !== 0 ? 6 : 7; + break; + case 6: + // then + $async$goto = 8; + return A._asyncAwait(A.compileStylesheets(t3, t4, sourcesToDestinations, true), $async$_recompileDownstream$1); + case 8: + // returning from await. + success = $async$result; + if (!success && A._asBool(t5.$index(0, "stop-on-error"))) { + $async$returnValue = false; + // goto return + $async$goto = 1; + break; + } + allSucceeded = allSucceeded && success; + case 7: + // join + t6 = A._setArrayType([], t2); + for (t8 = t7.length, _i = 0; _i < t7.length; t7.length === t8 || (0, A.throwConcurrentModificationError)(t7), ++_i) + B.JSArray_methods.addAll$1(t6, new A.UnmodifiableSetView0(t7[_i]._downstream, t1)); + case 4: + // for update + nodes = t6; + // goto for condition + $async$goto = 3; + break; + case 5: + // after for + $async$returnValue = allSucceeded; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$_recompileDownstream$1, $async$completer); + }, + _sourceEntrypointsToDestinations$1(nodes) { + var _i, url, source, _0_0, + t1 = type$.String, + entrypoints = A.LinkedHashMap_LinkedHashMap$_empty(t1, t1); + for (t1 = nodes.length, _i = 0; _i < nodes.length; nodes.length === t1 || (0, A.throwConcurrentModificationError)(nodes), ++_i) { + url = nodes[_i].canonicalUrl; + if (url.get$scheme() !== "file") + continue; + source = $.$get$context().style.pathFromUri$1(A._parseUri(url)); + _0_0 = this._destinationFor$1(source); + if (_0_0 != null) + entrypoints.$indexSet(0, source, _0_0); + } + return entrypoints; + }, + _destinationFor$1(source) { + var t2, _0_0, t3, sourceDir, destinationDir, destination, + t1 = this._watch$_options; + t1._ensureSources$0(); + t2 = type$.String; + _0_0 = t1._sourcesToDestinations.cast$2$0(0, t2, t2).$index(0, source); + if (_0_0 != null) + return _0_0; + t3 = $.$get$context(); + if (B.JSString_methods.startsWith$1(A.ParsedPath_ParsedPath$parse(source, t3.style).get$basename(), "_")) + return null; + t1._ensureSources$0(); + t1 = t1.__ExecutableOptions__sourceDirectoriesToDestinations_F; + t1 === $ && A.throwUnnamedLateFieldNI(); + t2 = A.MapExtensions_get_pairs(t1.cast$2$0(0, t2, t2), t2, t2); + t2 = t2.get$iterator(t2); + for (; t2.moveNext$0();) { + t1 = t2.get$current(t2); + sourceDir = t1._0; + destinationDir = t1._1; + if (t3._isWithinOrEquals$2(sourceDir, source) !== B._PathRelation_within) + continue; + destination = A.join(destinationDir, t3.withoutExtension$1(t3.relative$2$from(source, sourceDir)) + ".css", null); + if (t3._isWithinOrEquals$2(destination, source) !== B._PathRelation_equal) + return destination; + } + return null; + } + }; + A._Watcher__debounceEvents_closure.prototype = { + call$1(buffer) { + var t3, t4, t5, oldType, newType, _1_1, + t1 = type$.ChangeType, + t2 = A.PathMap__create(null, t1); + for (t3 = J.get$iterator$ax(buffer); t3.moveNext$0();) { + t4 = t3.get$current(t3); + t5 = t4.path; + oldType = t2.$index(0, t5); + newType = t4.type; + $label0$0: { + if (oldType == null) { + t4 = newType; + break $label0$0; + } + if (B.ChangeType_remove === newType) { + t4 = B.ChangeType_remove; + break $label0$0; + } + if (B.ChangeType_add === oldType) { + t4 = B.ChangeType_add; + break $label0$0; + } + t4 = B.ChangeType_modify; + break $label0$0; + } + t2.$indexSet(0, t5, t4); + } + t3 = A._setArrayType([], type$.JSArray_WatchEvent); + for (t1 = A.MapExtensions_get_pairs(new A.PathMap(t2, type$.PathMap_ChangeType), type$.nullable_String, t1), t1 = t1.get$iterator(t1); t1.moveNext$0();) { + t2 = t1.get$current(t1); + _1_1 = t2._0; + t4 = _1_1; + t4.toString; + _1_1.toString; + t3.push(new A.WatchEvent(t2._1, _1_1)); + } + return t3; + }, + $signature: 422 + }; + A.EmptyExtensionStore.prototype = { + get$_extensions() { + return A.throwExpression(A.NoSuchMethodError_NoSuchMethodError$withInvocation(this, A.JSInvocationMirror$(B.Symbol__extensions, "get$_empty_extension_store$_extensions", 1, [], [], 0))); + }, + get$_sourceSpecificity() { + return A.throwExpression(A.NoSuchMethodError_NoSuchMethodError$withInvocation(this, A.JSInvocationMirror$(B.Symbol__sourceSpecificity, "get$_empty_extension_store$_sourceSpecificity", 1, [], [], 0))); + }, + get$isEmpty(_) { + return true; + }, + get$simpleSelectors() { + return B.C_EmptyUnmodifiableSet; + }, + extensionsWhereTarget$1(callback) { + return B.List_empty5; + }, + addExtensions$1(extenders) { + throw A.wrapException(A.UnsupportedError$(string$.addExt)); + }, + clone$0() { + return B.Record2_EmptyExtensionStore_Map_empty; + }, + $isExtensionStore: 1 + }; + A.Extension.prototype = { + toString$0(_) { + var t1 = this.extender.toString$0(0), + t2 = this.target.toString$0(0), + t3 = this.isOptional ? " !optional" : ""; + return t1 + " {@extend " + t2 + t3 + "}"; + } + }; + A.Extender.prototype = { + assertCompatibleMediaContext$1(mediaContext) { + var expectedMediaContext, + extension = this._extension; + if (extension == null) + return; + expectedMediaContext = extension.mediaContext; + if (expectedMediaContext == null) + return; + if (mediaContext != null && B.C_ListEquality.equals$2(0, expectedMediaContext, mediaContext)) + return; + throw A.wrapException(A.SassException$(string$.You_ma, extension.span, null)); + }, + toString$0(_) { + return A.serializeSelector(this.selector, true); + } + }; + A.ExtensionStore.prototype = { + get$isEmpty(_) { + return this._extensions.__js_helper$_length === 0; + }, + get$simpleSelectors() { + return new A.MapKeySet(this._selectors, type$.MapKeySet_SimpleSelector); + }, + extensionsWhereTarget$1(callback) { + return new A._SyncStarIterable(this.extensionsWhereTarget$body$ExtensionStore(callback), type$._SyncStarIterable_Extension); + }, + extensionsWhereTarget$body$ExtensionStore($async$callback) { + var $async$self = this; + return function() { + var callback = $async$callback; + var $async$goto = 0, $async$handler = 1, $async$currentError, t1, t2, simple, sources, t3; + return function $async$extensionsWhereTarget$1($async$iterator, $async$errorCode, $async$result) { + if ($async$errorCode === 1) { + $async$currentError = $async$result; + $async$goto = $async$handler; + } + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = A.MapExtensions_get_pairs($async$self._extensions, type$.SimpleSelector, type$.Map_ComplexSelector_Extension), t1 = t1.get$iterator(t1); + case 2: + // for condition + if (!t1.moveNext$0()) { + // goto after for + $async$goto = 3; + break; + } + t2 = t1.get$current(t1); + simple = t2._0; + sources = t2._1; + if (!callback.call$1(simple)) { + // goto for condition + $async$goto = 2; + break; + } + t2 = sources.get$values(sources), t2 = t2.get$iterator(t2); + case 4: + // for condition + if (!t2.moveNext$0()) { + // goto after for + $async$goto = 5; + break; + } + t3 = t2.get$current(t2); + $async$goto = t3 instanceof A.MergedExtension ? 6 : 8; + break; + case 6: + // then + t3 = t3.unmerge$0(); + $async$goto = 9; + return $async$iterator._yieldStar$1(new A.WhereIterable(t3, new A.ExtensionStore_extensionsWhereTarget_closure(), t3.$ti._eval$1("WhereIterable"))); + case 9: + // after yield + // goto join + $async$goto = 7; + break; + case 8: + // else + $async$goto = !t3.isOptional ? 10 : 11; + break; + case 10: + // then + $async$goto = 12; + return $async$iterator._async$_current = t3, 1; + case 12: + // after yield + case 11: + // join + case 7: + // join + // goto for condition + $async$goto = 4; + break; + case 5: + // after for + // goto for condition + $async$goto = 2; + break; + case 3: + // after for + // implicit return + return 0; + case 1: + // rethrow + return $async$iterator._datum = $async$currentError, 3; + } + }; + }; + }, + addSelector$2(selector, mediaContext) { + var originalSelector, error, stackTrace, t1, exception, t2, t3, t4, modifiableSelector, _this = this; + selector = selector; + originalSelector = selector; + if (!originalSelector.accept$1(B._IsInvisibleVisitor_true)) + _this._originals.addAll$1(0, originalSelector.components); + t1 = _this._extensions; + if (t1.__js_helper$_length !== 0) + try { + selector = _this._extendList$3(originalSelector, t1, mediaContext); + } catch (exception) { + t1 = A.unwrapException(exception); + if (t1 instanceof A.SassException) { + error = t1; + stackTrace = A.getTraceFromException(exception); + t1 = error; + t2 = J.getInterceptor$z(t1); + t1 = A.SourceSpanException.prototype.get$span.call(t2, t1).message$1(0, ""); + t2 = error._span_exception$_message; + t3 = error; + t4 = J.getInterceptor$z(t3); + t3 = A.SourceSpanException.prototype.get$span.call(t4, t3); + A.throwWithTrace(new A.SassException(B.Set_empty, "From " + t1 + "\n" + t2, t3), error, stackTrace); + } else + throw exception; + } + modifiableSelector = new A.ModifiableBox(selector, type$.ModifiableBox_SelectorList); + if (mediaContext != null) + _this._mediaContexts.$indexSet(0, modifiableSelector, mediaContext); + _this._registerSelector$2(selector, modifiableSelector); + return new A.Box(modifiableSelector, type$.Box_SelectorList); + }, + _registerSelector$2(list, selector) { + var t1, t2, t3, t4, _i, t5, t6, _i0, t7, t8, _i1, simple, _0_2, t9, _0_2_isSet, selectorInPseudo; + for (t1 = list.components, t2 = t1.length, t3 = this._selectors, t4 = type$.SelectorList, _i = 0; _i < t2; ++_i) + for (t5 = t1[_i].components, t6 = t5.length, _i0 = 0; _i0 < t6; ++_i0) + for (t7 = t5[_i0].selector.components, t8 = t7.length, _i1 = 0; _i1 < t8; ++_i1) { + simple = t7[_i1]; + J.add$1$ax(t3.putIfAbsent$2(simple, new A.ExtensionStore__registerSelector_closure()), selector); + if (simple instanceof A.PseudoSelector) { + _0_2 = simple.selector; + t9 = _0_2 != null; + _0_2_isSet = true; + } else { + _0_2 = null; + _0_2_isSet = false; + t9 = false; + } + if (t9) { + selectorInPseudo = _0_2_isSet ? _0_2 : simple.selector; + this._registerSelector$2(selectorInPseudo == null ? t4._as(selectorInPseudo) : selectorInPseudo, selector); + } + } + }, + addExtension$4(extender, target, extend, mediaContext) { + var t2, t3, t4, t5, t6, t7, t8, t9, t10, newExtensions, _i, complex, t11, extension, _0_0, t12, newExtensionsByTarget, additionalExtensions, _this = this, + selectors = _this._selectors.$index(0, target), + t1 = _this._extensionsByExtender, + existingExtensions = t1.$index(0, target), + sources = _this._extensions.putIfAbsent$2(target, new A.ExtensionStore_addExtension_closure()); + for (t2 = extender.components, t3 = t2.length, t4 = selectors == null, t5 = _this._sourceSpecificity, t6 = extend.span, t7 = extend.isOptional, t8 = existingExtensions != null, t9 = type$.ComplexSelector, t10 = type$.Extension, newExtensions = null, _i = 0; _i < t3; ++_i) { + complex = t2[_i]; + if (complex.accept$1(B.C__IsUselessVisitor)) + continue; + complex.get$specificity(); + t11 = new A.Extender(complex, false); + extension = t11._extension = new A.Extension(t11, target, mediaContext, t7, t6); + _0_0 = sources.$index(0, complex); + if (_0_0 != null) { + sources.$indexSet(0, complex, A.MergedExtension_merge(_0_0, extension)); + continue; + } + sources.$indexSet(0, complex, extension); + for (t11 = new A._SyncStarIterator(_this._simpleSelectors$1(complex)._outerHelper()); t11.moveNext$0();) { + t12 = t11._async$_current; + J.add$1$ax(t1.putIfAbsent$2(t12, new A.ExtensionStore_addExtension_closure0()), extension); + t5.putIfAbsent$2(t12, new A.ExtensionStore_addExtension_closure1(complex)); + } + if (!t4 || t8) { + if (newExtensions == null) + newExtensions = A.LinkedHashMap_LinkedHashMap$_empty(t9, t10); + newExtensions.$indexSet(0, complex, extension); + } + } + if (newExtensions == null) + return; + t1 = type$.SimpleSelector; + newExtensionsByTarget = A.LinkedHashMap_LinkedHashMap$_literal([target, newExtensions], t1, type$.Map_ComplexSelector_Extension); + if (t8) { + additionalExtensions = _this._extendExistingExtensions$2(existingExtensions, newExtensionsByTarget); + if (additionalExtensions != null) + A.mapAddAll2(newExtensionsByTarget, additionalExtensions, t1, t9, t10); + } + if (!t4) + _this._extendExistingSelectors$2(selectors, newExtensionsByTarget); + }, + _simpleSelectors$1(complex) { + return new A._SyncStarIterable(this._simpleSelectors$body$ExtensionStore(complex), type$._SyncStarIterable_SimpleSelector); + }, + _simpleSelectors$body$ExtensionStore($async$complex) { + var $async$self = this; + return function() { + var complex = $async$complex; + var $async$goto = 0, $async$handler = 1, $async$currentError, t1, t2, t3, _i, t4, t5, _i0, simple, _0_2, t6, _0_2_isSet, selector, t7, _i1; + return function $async$_simpleSelectors$1($async$iterator, $async$errorCode, $async$result) { + if ($async$errorCode === 1) { + $async$currentError = $async$result; + $async$goto = $async$handler; + } + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = complex.components, t2 = t1.length, t3 = type$.SelectorList, _i = 0; + case 2: + // for condition + if (!(_i < t2)) { + // goto after for + $async$goto = 4; + break; + } + t4 = t1[_i].selector.components, t5 = t4.length, _i0 = 0; + case 5: + // for condition + if (!(_i0 < t5)) { + // goto after for + $async$goto = 7; + break; + } + simple = t4[_i0]; + $async$goto = 8; + return $async$iterator._async$_current = simple, 1; + case 8: + // after yield + if (simple instanceof A.PseudoSelector) { + _0_2 = simple.selector; + t6 = _0_2 != null; + _0_2_isSet = true; + } else { + _0_2 = null; + _0_2_isSet = false; + t6 = false; + } + $async$goto = t6 ? 9 : 10; + break; + case 9: + // then + selector = _0_2_isSet ? _0_2 : simple.selector; + t6 = (selector == null ? t3._as(selector) : selector).components, t7 = t6.length, _i1 = 0; + case 11: + // for condition + if (!(_i1 < t7)) { + // goto after for + $async$goto = 13; + break; + } + $async$goto = 14; + return $async$iterator._yieldStar$1($async$self._simpleSelectors$1(t6[_i1])); + case 14: + // after yield + case 12: + // for update + ++_i1; + // goto for condition + $async$goto = 11; + break; + case 13: + // after for + case 10: + // join + case 6: + // for update + ++_i0; + // goto for condition + $async$goto = 5; + break; + case 7: + // after for + case 3: + // for update + ++_i; + // goto for condition + $async$goto = 2; + break; + case 4: + // after for + // implicit return + return 0; + case 1: + // rethrow + return $async$iterator._datum = $async$currentError, 3; + } + }; + }; + }, + _extendExistingExtensions$2(extensions, newExtensions) { + var extension, selectors, error, stackTrace, t1, t2, t3, t4, t5, t6, additionalExtensions, _i, t7, exception, t8, t9, selectors0, t10, t11, t12, t13, t14, withExtender, _0_0, _i0, _i1; + for (t1 = J.toList$0$ax(extensions), t2 = t1.length, t3 = this._extensionsByExtender, t4 = type$.SimpleSelector, t5 = type$.Map_ComplexSelector_Extension, t6 = this._extensions, additionalExtensions = null, _i = 0; _i < t1.length; t1.length === t2 || (0, A.throwConcurrentModificationError)(t1), ++_i) { + extension = t1[_i]; + t7 = t6.$index(0, extension.target); + t7.toString; + selectors = null; + try { + selectors = this._extendComplex$3(extension.extender.selector, newExtensions, extension.mediaContext); + if (selectors == null) + continue; + } catch (exception) { + t8 = A.unwrapException(exception); + if (t8 instanceof A.SassException) { + error = t8; + stackTrace = A.getTraceFromException(exception); + A.throwWithTrace(error.withAdditionalSpan$2(extension.extender.selector.span, "target selector"), error, stackTrace); + } else + throw exception; + } + t8 = J.get$first$ax(selectors); + t9 = extension.extender.selector; + if (B.C_ListEquality.equals$2(0, t8.leadingCombinators, t9.leadingCombinators) && B.C_ListEquality.equals$2(0, t8.components, t9.components)) { + t8 = selectors; + t9 = A.instanceType(t8); + selectors0 = new A.SubListIterable(t8, 1, null, t9._eval$1("SubListIterable<1>")); + selectors0.SubListIterable$3(t8, 1, null, t9._precomputed1); + selectors = selectors0; + } + for (t8 = J.get$iterator$ax(selectors); t8.moveNext$0();) { + t9 = t8.get$current(t8); + t10 = extension; + t11 = t10.target; + t12 = t10.span; + t13 = t10.mediaContext; + t10 = t10.isOptional; + t9.get$specificity(); + t14 = new A.Extender(t9, false); + withExtender = t14._extension = new A.Extension(t14, t11, t13, t10, t12); + _0_0 = t7.$index(0, t9); + if (_0_0 != null) + t7.$indexSet(0, t9, A.MergedExtension_merge(_0_0, withExtender)); + else { + t7.$indexSet(0, t9, withExtender); + for (t10 = t9.components, t11 = t10.length, _i0 = 0; _i0 < t11; ++_i0) + for (t12 = t10[_i0].selector.components, t13 = t12.length, _i1 = 0; _i1 < t13; ++_i1) + J.add$1$ax(t3.putIfAbsent$2(t12[_i1], new A.ExtensionStore__extendExistingExtensions_closure()), withExtender); + if (newExtensions.containsKey$1(extension.target)) { + if (additionalExtensions == null) + additionalExtensions = A.LinkedHashMap_LinkedHashMap$_empty(t4, t5); + additionalExtensions.putIfAbsent$2(extension.target, new A.ExtensionStore__extendExistingExtensions_closure0()).$indexSet(0, t9, withExtender); + } + } + } + } + return additionalExtensions; + }, + _extendExistingSelectors$2(selectors, newExtensions) { + var selector, error, stackTrace, t1, t2, oldValue, exception, t3, t4, t5, t6; + for (t1 = selectors.get$iterator(selectors), t2 = this._mediaContexts; t1.moveNext$0();) { + selector = t1.get$current(t1); + oldValue = selector.value; + try { + selector.value = this._extendList$3(selector.value, newExtensions, t2.$index(0, selector)); + } catch (exception) { + t3 = A.unwrapException(exception); + if (t3 instanceof A.SassException) { + error = t3; + stackTrace = A.getTraceFromException(exception); + t3 = selector.value.span.message$1(0, ""); + t4 = error._span_exception$_message; + t5 = error; + t6 = J.getInterceptor$z(t5); + t5 = A.SourceSpanException.prototype.get$span.call(t6, t5); + A.throwWithTrace(new A.SassException(B.Set_empty, "From " + t3 + "\n" + t4, t5), error, stackTrace); + } else + throw exception; + } + if (oldValue === selector.value) + continue; + this._registerSelector$2(selector.value, selector); + } + }, + addExtensions$1(extensionStores) { + var t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, newExtensions, selectorsToExtend, extensionsToExtend, t12, t13, target, newSources, first, extensionsForTarget, t14, selectorsForTarget, t15, _2_0, t16, extender, extension, _this = this, _null = null; + for (t1 = J.get$iterator$ax(extensionStores), t2 = type$.SimpleSelector, t3 = type$.Map_ComplexSelector_Extension, t4 = _this._extensions, t5 = type$.ComplexSelector, t6 = type$.Extension, t7 = _this._selectors, t8 = _this._extensionsByExtender, t9 = type$.JSArray_Extension, t10 = type$.ModifiableBox_SelectorList, t11 = _this._sourceSpecificity, newExtensions = _null, selectorsToExtend = newExtensions, extensionsToExtend = selectorsToExtend; t1.moveNext$0();) { + t12 = t1.get$current(t1); + if (t12.get$isEmpty(t12)) + continue; + t11.addAll$1(0, t12.get$_sourceSpecificity()); + for (t12 = A.MapExtensions_get_pairs(t12.get$_extensions(), t2, t3), t12 = t12.get$iterator(t12); t12.moveNext$0();) { + t13 = t12.get$current(t12); + target = t13._0; + newSources = t13._1; + if (target instanceof A.PlaceholderSelector) { + first = target.name.charCodeAt(0); + t13 = first === 45 || first === 95; + } else + t13 = false; + if (t13) + continue; + extensionsForTarget = t8.$index(0, target); + t13 = extensionsForTarget == null; + if (!t13) { + if (extensionsToExtend == null) { + extensionsToExtend = A._setArrayType([], t9); + t14 = extensionsToExtend; + } else + t14 = extensionsToExtend; + B.JSArray_methods.addAll$1(t14, extensionsForTarget); + } + selectorsForTarget = t7.$index(0, target); + t14 = selectorsForTarget != null; + if (t14) { + if (selectorsToExtend == null) { + selectorsToExtend = A.LinkedHashSet_LinkedHashSet$_empty(t10); + t15 = selectorsToExtend; + } else + t15 = selectorsToExtend; + t15.addAll$1(0, selectorsForTarget); + } + _2_0 = t4.$index(0, target); + if (_2_0 != null) + for (t15 = A.MapExtensions_get_pairs(newSources, t5, t6), t15 = t15.get$iterator(t15); t15.moveNext$0();) { + t16 = t15.get$current(t15); + extender = t16._0; + extension = t16._1; + if (_2_0.containsKey$1(extender)) { + t16 = _2_0.$index(0, extender); + extension = A.MergedExtension_merge(t16 == null ? t6._as(t16) : t16, extension); + _2_0.$indexSet(0, extender, extension); + } else + _2_0.$indexSet(0, extender, extension); + if (!t13 || t14) { + if (newExtensions == null) { + newExtensions = A.LinkedHashMap_LinkedHashMap$_empty(t2, t3); + t16 = newExtensions; + } else + t16 = newExtensions; + J.$indexSet$ax(t16.putIfAbsent$2(target, new A.ExtensionStore_addExtensions_closure()), extender, extension); + } + } + else { + t15 = A.LinkedHashMap_LinkedHashMap(_null, _null, _null, t5, t6); + t15.addAll$1(0, newSources); + t4.$indexSet(0, target, t15); + if (!t13 || t14) { + if (newExtensions == null) { + newExtensions = A.LinkedHashMap_LinkedHashMap$_empty(t2, t3); + t13 = newExtensions; + } else + t13 = newExtensions; + t14 = A.LinkedHashMap_LinkedHashMap(_null, _null, _null, t5, t6); + t14.addAll$1(0, newSources); + t13.$indexSet(0, target, t14); + } + } + } + } + if (newExtensions != null) { + if (extensionsToExtend != null) + _this._extendExistingExtensions$2(extensionsToExtend, newExtensions); + if (selectorsToExtend != null) + _this._extendExistingSelectors$2(selectorsToExtend, newExtensions); + } + }, + _extendList$3(list, extensions, mediaQueryContext) { + var t1, t2, t3, extended, i, complex, result, t4; + for (t1 = list.components, t2 = t1.length, t3 = type$.JSArray_ComplexSelector, extended = null, i = 0; i < t2; ++i) { + complex = t1[i]; + result = this._extendComplex$3(complex, extensions, mediaQueryContext); + if (result == null) { + if (extended != null) + extended.push(complex); + } else { + if (extended == null) + if (i === 0) + extended = A._setArrayType([], t3); + else { + t4 = B.JSArray_methods.sublist$2(t1, 0, i); + extended = A._setArrayType(t4.slice(0), A._arrayInstanceType(t4)); + } + B.JSArray_methods.addAll$1(extended, result); + } + } + if (extended == null) + return list; + t1 = this._originals; + return A.SelectorList$(this._trim$2(extended, t1.get$contains(t1)), list.span); + }, + _extendList$2(list, extensions) { + return this._extendList$3(list, extensions, null); + }, + _extendComplex$3(complex, extensions, mediaQueryContext) { + var isOriginal, t3, t4, t5, t6, t7, t8, t9, t10, extendedNotExpanded, i, component, extended, t11, t12, t13, t14, _box_0 = {}, + t1 = complex.leadingCombinators, + t2 = t1.length; + if (t2 > 1) + return null; + isOriginal = this._originals.contains$1(0, complex); + for (t3 = complex.components, t4 = t3.length, t5 = type$.JSArray_List_ComplexSelector, t6 = complex.lineBreak, t7 = !t6, t8 = complex.span, t9 = type$.JSArray_ComplexSelector, t2 = t2 === 0, t10 = type$.JSArray_ComplexSelectorComponent, extendedNotExpanded = null, i = 0; i < t4; ++i) { + component = t3[i]; + extended = this._extendCompound$4$inOriginal(component, extensions, mediaQueryContext, isOriginal); + if (extended == null) { + if (extendedNotExpanded != null) + extendedNotExpanded.push(A._setArrayType([A.ComplexSelector$(B.List_empty1, A._setArrayType([component], t10), t8, t6)], t9)); + } else if (extendedNotExpanded != null) + extendedNotExpanded.push(extended); + else if (i !== 0) { + t11 = A._arrayInstanceType(t3); + t12 = new A.SubListIterable(t3, 0, i, t11._eval$1("SubListIterable<1>")); + t12.SubListIterable$3(t3, 0, i, t11._precomputed1); + extendedNotExpanded = A._setArrayType([A._setArrayType([A.ComplexSelector$(t1, t12, t8, t6)], t9), extended], t5); + } else if (t2) + extendedNotExpanded = A._setArrayType([extended], t5); + else { + t11 = A._setArrayType([], t9); + for (t12 = J.get$iterator$ax(extended); t12.moveNext$0();) { + t13 = t12.get$current(t12); + t14 = t13.leadingCombinators; + if (t14.length === 0 || B.C_ListEquality.equals$2(0, t1, t14)) { + t14 = t13.components; + t11.push(A.ComplexSelector$(t1, t14, t8, !t7 || t13.lineBreak)); + } + } + extendedNotExpanded = A._setArrayType([t11], t5); + } + } + if (extendedNotExpanded == null) + return null; + _box_0.first = true; + t1 = type$.ComplexSelector; + t1 = J.expand$1$1$ax(A.paths(extendedNotExpanded, t1), new A.ExtensionStore__extendComplex_closure(_box_0, this, complex), t1); + return A.List_List$of(t1, true, t1.$ti._eval$1("Iterable.E")); + }, + _extendCompound$4$inOriginal(component, extensions, mediaQueryContext, inOriginal) { + var t3, t4, t5, t6, t7, t8, t9, t10, t11, options, i, simple, extended, t12, result, compound, complex, extenderPaths, withCombinators, isOriginal, _this = this, _null = null, + t1 = _this._mode, + targetsUsed = t1 === B.ExtendMode_normal_normal || extensions.__js_helper$_length < 2 ? _null : A.LinkedHashSet_LinkedHashSet$_empty(type$.SimpleSelector), + t2 = component.selector, + simples = t2.components; + for (t3 = simples.length, t4 = type$.JSArray_List_Extender, t5 = type$.JSArray_Extender, t6 = type$.CssValue_Combinator, t7 = type$.JSArray_ComplexSelectorComponent, t8 = A._arrayInstanceType(simples), t9 = t8._precomputed1, t8 = t8._eval$1("SubListIterable<1>"), t10 = component.span, t11 = type$.SimpleSelector, options = _null, i = 0; i < t3; ++i) { + simple = simples[i]; + extended = _this._extendSimple$4(simple, extensions, mediaQueryContext, targetsUsed); + if (extended == null) { + if (options != null) + options.push(A._setArrayType([_this._extenderForSimple$1(simple)], t5)); + } else { + if (options == null) { + options = A._setArrayType([], t4); + if (i !== 0) { + t12 = new A.SubListIterable(simples, 0, i, t8); + t12.SubListIterable$3(simples, 0, i, t9); + result = A.List_List$from(t12, false, t11); + result.fixed$length = Array; + result.immutable$list = Array; + t12 = result; + compound = new A.CompoundSelector(t12, t10); + if (t12.length === 0) + A.throwExpression(A.ArgumentError$("components may not be empty.", _null)); + result = A.List_List$from(B.List_empty1, false, t6); + result.fixed$length = Array; + result.immutable$list = Array; + t12 = A.ComplexSelector$(B.List_empty1, A._setArrayType([new A.ComplexSelectorComponent(compound, result, t10)], t7), t10, false); + _this._sourceSpecificityFor$1(compound); + options.push(A._setArrayType([new A.Extender(t12, true)], t5)); + } + } + B.JSArray_methods.addAll$1(options, extended); + } + } + if (options == null) + return _null; + if (targetsUsed != null && targetsUsed._collection$_length !== extensions.__js_helper$_length) + return _null; + if (options.length === 1) { + for (t1 = J.get$iterator$ax(options[0]), t2 = component.combinators, t3 = type$.JSArray_ComplexSelector, result = _null; t1.moveNext$0();) { + t4 = t1.get$current(t1); + t4.assertCompatibleMediaContext$1(mediaQueryContext); + complex = t4.selector.withAdditionalCombinators$1(t2); + if (complex.accept$1(B.C__IsUselessVisitor)) + continue; + if (result == null) + result = A._setArrayType([], t3); + result.push(complex); + } + return result; + } + extenderPaths = A.paths(options, type$.Extender); + t3 = A._setArrayType([], type$.JSArray_ComplexSelector); + t1 = t1 === B.ExtendMode_replace_replace; + t4 = !t1; + if (t4) + t3.push(A.ComplexSelector$(B.List_empty1, A._setArrayType([new A.ComplexSelectorComponent(A.CompoundSelector$(J.expand$1$1$ax(J.get$first$ax(extenderPaths), new A.ExtensionStore__extendCompound_closure(), t11), t2.span), A.List_List$unmodifiable(component.combinators, t6), t10)], t7), t10, false)); + t2 = J.skip$1$ax(extenderPaths, t1 ? 0 : 1); + t5 = A._instanceType(t2); + t2 = new A.ListIterator(t2, t2.get$length(t2), t5._eval$1("ListIterator")); + t6 = component.combinators; + t5 = t5._eval$1("ListIterable.E"); + for (; t2.moveNext$0();) { + t1 = t2.__internal$_current; + extended = _this._unifyExtenders$3(t1 == null ? t5._as(t1) : t1, mediaQueryContext, t10); + if (extended == null) + continue; + for (t1 = J.get$iterator$ax(extended); t1.moveNext$0();) { + withCombinators = t1.get$current(t1).withAdditionalCombinators$1(t6); + if (!withCombinators.accept$1(B.C__IsUselessVisitor)) + t3.push(withCombinators); + } + } + isOriginal = new A.ExtensionStore__extendCompound_closure0(); + return _this._trim$2(t3, inOriginal && t4 ? new A.ExtensionStore__extendCompound_closure1(B.JSArray_methods.get$first(t3)) : isOriginal); + }, + _unifyExtenders$3(extenders, mediaQueryContext, span) { + var t1, t2, t3, originals, originalsLineBreak, t4, complexes, _null = null, + toUnify = A.QueueList$(_null, type$.ComplexSelector); + for (t1 = J.getInterceptor$ax(extenders), t2 = t1.get$iterator(extenders), t3 = type$.JSArray_SimpleSelector, originals = _null, originalsLineBreak = false; t2.moveNext$0();) { + t4 = t2.get$current(t2); + if (t4.isOriginal) { + if (originals == null) + originals = A._setArrayType([], t3); + t4 = t4.selector; + B.JSArray_methods.addAll$1(originals, B.JSArray_methods.get$last(t4.components).selector.components); + originalsLineBreak = originalsLineBreak || t4.lineBreak; + } else { + t4 = t4.selector; + if (t4.accept$1(B.C__IsUselessVisitor)) + return _null; + else + toUnify._queue_list$_add$1(t4); + } + } + if (originals != null) + toUnify.addFirst$1(A.ComplexSelector$(B.List_empty1, A._setArrayType([new A.ComplexSelectorComponent(A.CompoundSelector$(originals, span), A.List_List$unmodifiable(B.List_empty1, type$.CssValue_Combinator), span)], type$.JSArray_ComplexSelectorComponent), span, originalsLineBreak)); + complexes = A.unifyComplex(toUnify, span); + if (complexes == null) + return _null; + for (t1 = t1.get$iterator(extenders); t1.moveNext$0();) + t1.get$current(t1).assertCompatibleMediaContext$1(mediaQueryContext); + return complexes; + }, + _extendSimple$4(simple, extensions, mediaQueryContext, targetsUsed) { + var _1_0, + t1 = new A.ExtensionStore__extendSimple_withoutPseudo(this, extensions, targetsUsed); + if (simple instanceof A.PseudoSelector && simple.selector != null && true) { + _1_0 = this._extendPseudo$3(simple, extensions, mediaQueryContext); + if (_1_0 != null) + return new A.MappedListIterable(_1_0, new A.ExtensionStore__extendSimple_closure(this, t1), A._arrayInstanceType(_1_0)._eval$1("MappedListIterable<1,List>")); + } + return A.NullableExtension_andThen(t1.call$1(simple), new A.ExtensionStore__extendSimple_closure0()); + }, + _extenderForSimple$1(simple) { + var t1 = simple.span; + t1 = A.ComplexSelector$(B.List_empty1, A._setArrayType([new A.ComplexSelectorComponent(A.CompoundSelector$(A._setArrayType([simple], type$.JSArray_SimpleSelector), t1), A.List_List$unmodifiable(B.List_empty1, type$.CssValue_Combinator), t1)], type$.JSArray_ComplexSelectorComponent), t1, false); + this._sourceSpecificity.$index(0, simple); + return new A.Extender(t1, true); + }, + _extendPseudo$3(pseudo, extensions, mediaQueryContext) { + var extended, complexes, t1, result, + selector = pseudo.selector; + if (selector == null) + throw A.wrapException(A.ArgumentError$("Selector " + pseudo.toString$0(0) + " must have a selector argument.", null)); + extended = this._extendList$3(selector, extensions, mediaQueryContext); + if (extended === selector) + return null; + complexes = extended.components; + t1 = pseudo.normalizedName === "not"; + if (t1 && !B.JSArray_methods.any$1(selector.components, new A.ExtensionStore__extendPseudo_closure()) && B.JSArray_methods.any$1(complexes, new A.ExtensionStore__extendPseudo_closure0())) + complexes = new A.WhereIterable(complexes, new A.ExtensionStore__extendPseudo_closure1(), A._arrayInstanceType(complexes)._eval$1("WhereIterable<1>")); + complexes = J.expand$1$1$ax(complexes, new A.ExtensionStore__extendPseudo_closure2(pseudo), type$.ComplexSelector); + if (t1 && selector.components.length === 1) { + t1 = A.MappedIterable_MappedIterable(complexes, new A.ExtensionStore__extendPseudo_closure3(pseudo, selector), complexes.$ti._eval$1("Iterable.E"), type$.PseudoSelector); + result = A.List_List$of(t1, true, A._instanceType(t1)._eval$1("Iterable.E")); + return result.length === 0 ? null : result; + } else + return A._setArrayType([pseudo.withSelector$1(A.SelectorList$(complexes, selector.span))], type$.JSArray_PseudoSelector); + }, + _trim$2(selectors, isOriginal) { + var result, i, t1, t2, numOriginals, _box_0, complex1, j, t3, t4, _i, t5, maxSpecificity; + if (selectors.length > 100) + return selectors; + result = A.QueueList$(null, type$.ComplexSelector); + $label0$0: + for (i = selectors.length - 1, t1 = A._arrayInstanceType(selectors), t2 = t1._precomputed1, t1 = t1._eval$1("SubListIterable<1>"), numOriginals = 0; i >= 0; --i) { + _box_0 = {}; + complex1 = selectors[i]; + if (isOriginal.call$1(complex1)) { + for (j = 0; j < numOriginals; ++j) + if (J.$eq$(result.$index(0, j), complex1)) { + A.rotateSlice(result, 0, j + 1); + continue $label0$0; + } + ++numOriginals; + result.addFirst$1(complex1); + continue $label0$0; + } + _box_0.maxSpecificity = 0; + for (t3 = complex1.components, t4 = t3.length, _i = 0, t5 = 0; _i < t4; ++_i, t5 = maxSpecificity) { + maxSpecificity = Math.max(t5, this._sourceSpecificityFor$1(t3[_i].selector)); + _box_0.maxSpecificity = maxSpecificity; + } + if (result.any$1(result, new A.ExtensionStore__trim_closure(_box_0, complex1))) + continue $label0$0; + t3 = new A.SubListIterable(selectors, 0, i, t1); + t3.SubListIterable$3(selectors, 0, i, t2); + if (t3.any$1(0, new A.ExtensionStore__trim_closure0(_box_0, complex1))) + continue $label0$0; + result.addFirst$1(complex1); + } + return result; + }, + _sourceSpecificityFor$1(compound) { + var t1, t2, t3, specificity, _i, t4; + for (t1 = compound.components, t2 = t1.length, t3 = this._sourceSpecificity, specificity = 0, _i = 0; _i < t2; ++_i) { + t4 = t3.$index(0, t1[_i]); + specificity = Math.max(specificity, A.checkNum(t4 == null ? 0 : t4)); + } + return specificity; + }, + clone$0() { + var t2, t3, t4, _this = this, + t1 = type$.SimpleSelector, + newSelectors = A.LinkedHashMap_LinkedHashMap$_empty(t1, type$.Set_ModifiableBox_SelectorList), + newMediaContexts = A.LinkedHashMap_LinkedHashMap$_empty(type$.ModifiableBox_SelectorList, type$.List_CssMediaQuery), + oldToNewSelectors = new A.JsIdentityLinkedHashMap(type$.JsIdentityLinkedHashMap_of_SelectorList_and_Box_SelectorList); + _this._selectors.forEach$1(0, new A.ExtensionStore_clone_closure(_this, newSelectors, oldToNewSelectors, newMediaContexts)); + t2 = type$.Extension; + t3 = A.copyMapOfMap(_this._extensions, t1, type$.ComplexSelector, t2); + t2 = A.copyMapOfList(_this._extensionsByExtender, t1, t2); + t1 = new A.JsIdentityLinkedHashMap(type$.JsIdentityLinkedHashMap_SimpleSelector_int); + t1.addAll$1(0, _this._sourceSpecificity); + t4 = new A._LinkedIdentityHashSet(type$._LinkedIdentityHashSet_ComplexSelector); + t4.addAll$1(0, _this._originals); + return new A._Record_2(new A.ExtensionStore(newSelectors, t3, t2, newMediaContexts, t1, t4, B.ExtendMode_normal_normal), oldToNewSelectors); + }, + get$_extensions() { + return this._extensions; + }, + get$_sourceSpecificity() { + return this._sourceSpecificity; + } + }; + A.ExtensionStore_extensionsWhereTarget_closure.prototype = { + call$1(extension) { + return !extension.isOptional; + }, + $signature: 421 + }; + A.ExtensionStore__registerSelector_closure.prototype = { + call$0() { + return A.LinkedHashSet_LinkedHashSet$_empty(type$.ModifiableBox_SelectorList); + }, + $signature: 420 + }; + A.ExtensionStore_addExtension_closure.prototype = { + call$0() { + return A.LinkedHashMap_LinkedHashMap$_empty(type$.ComplexSelector, type$.Extension); + }, + $signature: 139 + }; + A.ExtensionStore_addExtension_closure0.prototype = { + call$0() { + return A._setArrayType([], type$.JSArray_Extension); + }, + $signature: 255 + }; + A.ExtensionStore_addExtension_closure1.prototype = { + call$0() { + return this.complex.get$specificity(); + }, + $signature: 10 + }; + A.ExtensionStore__extendExistingExtensions_closure.prototype = { + call$0() { + return A._setArrayType([], type$.JSArray_Extension); + }, + $signature: 255 + }; + A.ExtensionStore__extendExistingExtensions_closure0.prototype = { + call$0() { + return A.LinkedHashMap_LinkedHashMap$_empty(type$.ComplexSelector, type$.Extension); + }, + $signature: 139 + }; + A.ExtensionStore_addExtensions_closure.prototype = { + call$0() { + return A.LinkedHashMap_LinkedHashMap$_empty(type$.ComplexSelector, type$.Extension); + }, + $signature: 139 + }; + A.ExtensionStore__extendComplex_closure.prototype = { + call$1(path) { + var t1 = this.complex; + return J.map$1$1$ax(A.weave(path, t1.span, t1.lineBreak), new A.ExtensionStore__extendComplex__closure(this._box_0, this.$this, t1), type$.ComplexSelector); + }, + $signature: 418 + }; + A.ExtensionStore__extendComplex__closure.prototype = { + call$1(outputComplex) { + var _this = this, + t1 = _this._box_0; + if (t1.first && _this.$this._originals.contains$1(0, _this.complex)) + _this.$this._originals.add$1(0, outputComplex); + t1.first = false; + return outputComplex; + }, + $signature: 62 + }; + A.ExtensionStore__extendCompound_closure.prototype = { + call$1(extender) { + return B.JSArray_methods.get$last(extender.selector.components).selector.components; + }, + $signature: 417 + }; + A.ExtensionStore__extendCompound_closure0.prototype = { + call$1(_) { + return false; + }, + $signature: 18 + }; + A.ExtensionStore__extendCompound_closure1.prototype = { + call$1(complex) { + return complex.$eq(0, this.original); + }, + $signature: 18 + }; + A.ExtensionStore__extendSimple_withoutPseudo.prototype = { + call$1(simple) { + var t1, t2, + extensionsForSimple = this.extensions.$index(0, simple); + if (extensionsForSimple == null) + return null; + t1 = this.targetsUsed; + if (t1 != null) + t1.add$1(0, simple); + t1 = A._setArrayType([], type$.JSArray_Extender); + t2 = this.$this; + if (t2._mode !== B.ExtendMode_replace_replace) + t1.push(t2._extenderForSimple$1(simple)); + for (t2 = extensionsForSimple.get$values(extensionsForSimple), t2 = t2.get$iterator(t2); t2.moveNext$0();) + t1.push(t2.get$current(t2).extender); + return t1; + }, + $signature: 414 + }; + A.ExtensionStore__extendSimple_closure.prototype = { + call$1(pseudo) { + var t1 = this.withoutPseudo.call$1(pseudo); + return t1 == null ? A._setArrayType([this.$this._extenderForSimple$1(pseudo)], type$.JSArray_Extender) : t1; + }, + $signature: 413 + }; + A.ExtensionStore__extendSimple_closure0.prototype = { + call$1(result) { + return A._setArrayType([result], type$.JSArray_List_Extender); + }, + $signature: 410 + }; + A.ExtensionStore__extendPseudo_closure.prototype = { + call$1(complex) { + return complex.components.length > 1; + }, + $signature: 18 + }; + A.ExtensionStore__extendPseudo_closure0.prototype = { + call$1(complex) { + return complex.components.length === 1; + }, + $signature: 18 + }; + A.ExtensionStore__extendPseudo_closure1.prototype = { + call$1(complex) { + return complex.components.length <= 1; + }, + $signature: 18 + }; + A.ExtensionStore__extendPseudo_closure2.prototype = { + call$1(complex) { + var innerPseudo, innerSelector, + t1 = complex.get$singleCompound(); + if (t1 == null) + innerPseudo = null; + else { + t1 = t1.components; + innerPseudo = t1.length === 1 ? B.JSArray_methods.get$first(t1) : null; + } + if (!(innerPseudo instanceof A.PseudoSelector)) + return A._setArrayType([complex], type$.JSArray_ComplexSelector); + innerSelector = innerPseudo.selector; + if (innerSelector == null) + return A._setArrayType([complex], type$.JSArray_ComplexSelector); + t1 = this.pseudo; + switch (t1.normalizedName) { + case "not": + if (!B.Set_aAXJu.contains$1(0, innerPseudo.normalizedName)) + return A._setArrayType([], type$.JSArray_ComplexSelector); + return innerSelector.components; + case "is": + case "matches": + case "where": + case "any": + case "current": + case "nth-child": + case "nth-last-child": + if (innerPseudo.name !== t1.name) + return A._setArrayType([], type$.JSArray_ComplexSelector); + if (innerPseudo.argument != t1.argument) + return A._setArrayType([], type$.JSArray_ComplexSelector); + return innerSelector.components; + case "has": + case "host": + case "host-context": + case "slotted": + return A._setArrayType([complex], type$.JSArray_ComplexSelector); + default: + return A._setArrayType([], type$.JSArray_ComplexSelector); + } + }, + $signature: 398 + }; + A.ExtensionStore__extendPseudo_closure3.prototype = { + call$1(complex) { + return this.pseudo.withSelector$1(A.SelectorList$(A._setArrayType([complex], type$.JSArray_ComplexSelector), this.selector.span)); + }, + $signature: 396 + }; + A.ExtensionStore__trim_closure.prototype = { + call$1(complex2) { + return complex2.get$specificity() >= this._box_0.maxSpecificity && complex2.isSuperselector$1(this.complex1); + }, + $signature: 18 + }; + A.ExtensionStore__trim_closure0.prototype = { + call$1(complex2) { + return complex2.get$specificity() >= this._box_0.maxSpecificity && complex2.isSuperselector$1(this.complex1); + }, + $signature: 18 + }; + A.ExtensionStore_clone_closure.prototype = { + call$2(simple, selectors) { + var t2, t3, t4, t5, t6, t7, newSelector, _0_0, _this = this, + t1 = type$.ModifiableBox_SelectorList, + newSelectorSet = A.LinkedHashSet_LinkedHashSet$_empty(t1); + _this.newSelectors.$indexSet(0, simple, newSelectorSet); + for (t2 = selectors.get$iterator(selectors), t3 = _this.oldToNewSelectors, t4 = type$.Box_SelectorList, t5 = _this.$this._mediaContexts, t6 = _this.newMediaContexts; t2.moveNext$0();) { + t7 = t2.get$current(t2); + newSelector = new A.ModifiableBox(t7.value, t1); + newSelectorSet.add$1(0, newSelector); + t3.$indexSet(0, t7.value, new A.Box(newSelector, t4)); + _0_0 = t5.$index(0, t7); + if (_0_0 != null) + t6.$indexSet(0, newSelector, _0_0); + } + }, + $signature: 393 + }; + A.unifyComplex_closure.prototype = { + call$1(complex) { + return complex.lineBreak; + }, + $signature: 18 + }; + A._weaveParents_closure.prototype = { + call$2(group1, group2) { + var t1, unified; + if (B.C_ListEquality.equals$2(0, group1, group2)) + return group1; + if (A._complexIsParentSuperselector(group1, group2)) + return group2; + if (A._complexIsParentSuperselector(group2, group1)) + return group1; + if (!A._mustUnify(group1, group2)) + return null; + t1 = this.span; + unified = A.unifyComplex(A._setArrayType([A.ComplexSelector$(B.List_empty1, group1, t1, false), A.ComplexSelector$(B.List_empty1, group2, t1, false)], type$.JSArray_ComplexSelector), t1); + if (unified == null) + t1 = null; + else { + t1 = A.IterableExtension_get_singleOrNull(unified); + t1 = t1 == null ? null : t1.components; + } + return t1; + }, + $signature: 392 + }; + A._weaveParents_closure0.prototype = { + call$1(sequence) { + return A._complexIsParentSuperselector(sequence.get$first(sequence), this.group); + }, + $signature: 267 + }; + A._weaveParents_closure1.prototype = { + call$1(sequence) { + return sequence.get$length(0) === 0; + }, + $signature: 267 + }; + A._weaveParents_closure2.prototype = { + call$1(choice) { + return J.get$isNotEmpty$asx(choice); + }, + $signature: 391 + }; + A._mustUnify_closure.prototype = { + call$1(component) { + return B.JSArray_methods.any$1(component.selector.components, new A._mustUnify__closure(this.uniqueSelectors)); + }, + $signature: 48 + }; + A._mustUnify__closure.prototype = { + call$1(simple) { + var t1; + if (!(simple instanceof A.IDSelector)) + t1 = simple instanceof A.PseudoSelector && !simple.isClass; + else + t1 = true; + return t1 && this.uniqueSelectors.contains$1(0, simple); + }, + $signature: 15 + }; + A.paths_closure.prototype = { + call$2(paths, choice) { + var t1 = this.T; + t1 = J.expand$1$1$ax(choice, new A.paths__closure(paths, t1), t1._eval$1("List<0>")); + return A.List_List$of(t1, true, t1.$ti._eval$1("Iterable.E")); + }, + $signature() { + return this.T._eval$1("List>(List>,List<0>)"); + } + }; + A.paths__closure.prototype = { + call$1(option) { + var t1 = this.T; + return J.map$1$1$ax(this.paths, new A.paths___closure(option, t1), t1._eval$1("List<0>")); + }, + $signature() { + return this.T._eval$1("Iterable>(0)"); + } + }; + A.paths___closure.prototype = { + call$1(path) { + var t1 = A.List_List$of(path, true, this.T); + t1.push(this.option); + return t1; + }, + $signature() { + return this.T._eval$1("List<0>(List<0>)"); + } + }; + A.listIsSuperselector_closure.prototype = { + call$1(complex1) { + return B.JSArray_methods.any$1(this.list1, new A.listIsSuperselector__closure(complex1)); + }, + $signature: 18 + }; + A.listIsSuperselector__closure.prototype = { + call$1(complex2) { + return complex2.isSuperselector$1(this.complex1); + }, + $signature: 18 + }; + A.complexIsSuperselector_closure.prototype = { + call$1($parent) { + return $parent.combinators.length > 1; + }, + $signature: 48 + }; + A.complexIsSuperselector_closure0.prototype = { + call$1(component) { + return A._isSupercombinator(this.combinator1, A.IterableExtension_get_firstOrNull(component.combinators)); + }, + $signature: 48 + }; + A._compatibleWithPreviousCombinator_closure.prototype = { + call$1(component) { + var t1 = component.combinators, + t2 = A.IterableExtension_get_firstOrNull(t1); + if (!J.$eq$(t2 == null ? null : t2.value, B.Combinator_Htt)) { + t1 = A.IterableExtension_get_firstOrNull(t1); + t1 = J.$eq$(t1 == null ? null : t1.value, B.Combinator_4QF); + } else + t1 = true; + return t1; + }, + $signature: 48 + }; + A._selectorPseudoIsSuperselector_closure.prototype = { + call$1(selector2) { + return A.listIsSuperselector(this.selector1.components, selector2.components); + }, + $signature: 66 + }; + A._selectorPseudoIsSuperselector_closure0.prototype = { + call$1(complex1) { + var t1, t2; + if (complex1.leadingCombinators.length === 0) { + t1 = A._setArrayType([], type$.JSArray_ComplexSelectorComponent); + t2 = this.parents; + if (t2 != null) + B.JSArray_methods.addAll$1(t1, t2); + t2 = this.compound2; + t1.push(new A.ComplexSelectorComponent(t2, A.List_List$unmodifiable(B.List_empty1, type$.CssValue_Combinator), t2.span)); + t1 = A.complexIsSuperselector(complex1.components, t1); + } else + t1 = false; + return t1; + }, + $signature: 18 + }; + A._selectorPseudoIsSuperselector_closure1.prototype = { + call$1(selector2) { + return A.listIsSuperselector(this.selector1.components, selector2.components); + }, + $signature: 66 + }; + A._selectorPseudoIsSuperselector_closure2.prototype = { + call$1(selector2) { + return A.listIsSuperselector(this.selector1.components, selector2.components); + }, + $signature: 66 + }; + A._selectorPseudoIsSuperselector_closure3.prototype = { + call$1(complex) { + if (complex.accept$1(B._IsBogusVisitor_true)) + return false; + return B.JSArray_methods.any$1(this.compound2.components, new A._selectorPseudoIsSuperselector__closure(complex, this.pseudo1)); + }, + $signature: 18 + }; + A._selectorPseudoIsSuperselector__closure.prototype = { + call$1(simple2) { + var t1, _0_4, selector2, _this = this; + $label0$1: { + if (simple2 instanceof A.TypeSelector) { + t1 = B.JSArray_methods.any$1(B.JSArray_methods.get$last(_this.complex.components).selector.components, new A._selectorPseudoIsSuperselector___closure(simple2)); + break $label0$1; + } + if (simple2 instanceof A.IDSelector) { + t1 = B.JSArray_methods.any$1(B.JSArray_methods.get$last(_this.complex.components).selector.components, new A._selectorPseudoIsSuperselector___closure0(simple2)); + break $label0$1; + } + if (simple2 instanceof A.PseudoSelector) { + _0_4 = simple2.selector; + if (_0_4 != null) { + selector2 = _0_4 == null ? type$.SelectorList._as(_0_4) : _0_4; + t1 = simple2.name === _this.pseudo1.name; + } else { + selector2 = null; + t1 = false; + } + } else { + selector2 = null; + t1 = false; + } + if (t1) { + t1 = A.listIsSuperselector(selector2.components, A._setArrayType([_this.complex], type$.JSArray_ComplexSelector)); + break $label0$1; + } + t1 = false; + break $label0$1; + } + return t1; + }, + $signature: 15 + }; + A._selectorPseudoIsSuperselector___closure.prototype = { + call$1(simple1) { + var t1; + if (simple1 instanceof A.TypeSelector) { + t1 = this.simple2; + t1 = !(t1 instanceof A.TypeSelector && t1.name.$eq(0, simple1.name)); + } else + t1 = false; + return t1; + }, + $signature: 15 + }; + A._selectorPseudoIsSuperselector___closure0.prototype = { + call$1(simple1) { + var t1; + if (simple1 instanceof A.IDSelector) { + t1 = this.simple2; + t1 = !(t1 instanceof A.IDSelector && t1.name === simple1.name); + } else + t1 = false; + return t1; + }, + $signature: 15 + }; + A._selectorPseudoIsSuperselector_closure4.prototype = { + call$1(selector2) { + var t1 = B.C_ListEquality.equals$2(0, this.selector1.components, selector2.components); + return t1; + }, + $signature: 66 + }; + A._selectorPseudoIsSuperselector_closure5.prototype = { + call$1(pseudo2) { + var t1, selector2; + if (!(pseudo2 instanceof A.PseudoSelector)) + return false; + t1 = this.pseudo1; + if (pseudo2.name !== t1.name) + return false; + if (pseudo2.argument != t1.argument) + return false; + selector2 = pseudo2.selector; + if (selector2 == null) + return false; + return A.listIsSuperselector(this.selector1.components, selector2.components); + }, + $signature: 15 + }; + A._selectorPseudoArgs_closure.prototype = { + call$1(pseudo) { + return pseudo.isClass === this.isClass && pseudo.name === this.name; + }, + $signature: 271 + }; + A._selectorPseudoArgs_closure0.prototype = { + call$1(pseudo) { + return pseudo.selector; + }, + $signature: 387 + }; + A.MergedExtension.prototype = { + unmerge$0() { + return new A._SyncStarIterable(this.unmerge$body$MergedExtension(), type$._SyncStarIterable_Extension); + }, + unmerge$body$MergedExtension() { + var $async$self = this; + return function() { + var $async$goto = 0, $async$handler = 1, $async$currentError, right, left; + return function $async$unmerge$0($async$iterator, $async$errorCode, $async$result) { + if ($async$errorCode === 1) { + $async$currentError = $async$result; + $async$goto = $async$handler; + } + while (true) + switch ($async$goto) { + case 0: + // Function start + left = $async$self.left; + $async$goto = left instanceof A.MergedExtension ? 2 : 4; + break; + case 2: + // then + $async$goto = 5; + return $async$iterator._yieldStar$1(left.unmerge$0()); + case 5: + // after yield + // goto join + $async$goto = 3; + break; + case 4: + // else + $async$goto = 6; + return $async$iterator._async$_current = left, 1; + case 6: + // after yield + case 3: + // join + right = $async$self.right; + $async$goto = right instanceof A.MergedExtension ? 7 : 9; + break; + case 7: + // then + $async$goto = 10; + return $async$iterator._yieldStar$1(right.unmerge$0()); + case 10: + // after yield + // goto join + $async$goto = 8; + break; + case 9: + // else + $async$goto = 11; + return $async$iterator._async$_current = right, 1; + case 11: + // after yield + case 8: + // join + // implicit return + return 0; + case 1: + // rethrow + return $async$iterator._datum = $async$currentError, 3; + } + }; + }; + } + }; + A.ExtendMode.prototype = { + _enumToString$0() { + return "ExtendMode." + this._name; + }, + toString$0(_) { + return this.name; + } + }; + A.globalFunctions_closure.prototype = { + call$1($arguments) { + var t1 = J.getInterceptor$asx($arguments); + return t1.$index($arguments, 0).get$isTruthy() ? t1.$index($arguments, 1) : t1.$index($arguments, 2); + }, + $signature: 6 + }; + A.global_closure0.prototype = { + call$1($arguments) { + return A._rgb("rgb", $arguments); + }, + $signature: 6 + }; + A.global_closure1.prototype = { + call$1($arguments) { + return A._rgb("rgb", $arguments); + }, + $signature: 6 + }; + A.global_closure2.prototype = { + call$1($arguments) { + return A._rgbTwoArg("rgb", $arguments); + }, + $signature: 6 + }; + A.global_closure3.prototype = { + call$1($arguments) { + var parsed = A._parseChannels("rgb", A._setArrayType(["$red", "$green", "$blue"], type$.JSArray_String), J.get$first$ax($arguments)); + return parsed instanceof A.SassString ? parsed : A._rgb("rgb", type$.List_Value._as(parsed)); + }, + $signature: 6 + }; + A.global_closure4.prototype = { + call$1($arguments) { + return A._rgb("rgba", $arguments); + }, + $signature: 6 + }; + A.global_closure5.prototype = { + call$1($arguments) { + return A._rgb("rgba", $arguments); + }, + $signature: 6 + }; + A.global_closure6.prototype = { + call$1($arguments) { + return A._rgbTwoArg("rgba", $arguments); + }, + $signature: 6 + }; + A.global_closure7.prototype = { + call$1($arguments) { + var parsed = A._parseChannels("rgba", A._setArrayType(["$red", "$green", "$blue"], type$.JSArray_String), J.get$first$ax($arguments)); + return parsed instanceof A.SassString ? parsed : A._rgb("rgba", type$.List_Value._as(parsed)); + }, + $signature: 6 + }; + A.global_closure8.prototype = { + call$1($arguments) { + var color, t2, + t1 = J.getInterceptor$asx($arguments), + weight = t1.$index($arguments, 1).assertNumber$1("weight"); + if (t1.$index($arguments, 0) instanceof A.SassNumber || t1.$index($arguments, 0).get$isSpecialNumber()) { + if (weight._number$_value !== 100 || !weight.hasUnit$1("%")) + throw A.wrapException(string$.Only_oa); + return A._functionString("invert", t1.take$1($arguments, 1)); + } + color = t1.$index($arguments, 0).assertColor$1("color"); + t1 = color.get$red(0); + t2 = color.get$green(0); + return A._mixColors(color.changeRgb$3$blue$green$red(255 - color.get$blue(0), 255 - t2, 255 - t1), color, weight); + }, + $signature: 6 + }; + A.global_closure9.prototype = { + call$1($arguments) { + return A._hsl("hsl", $arguments); + }, + $signature: 6 + }; + A.global_closure10.prototype = { + call$1($arguments) { + return A._hsl("hsl", $arguments); + }, + $signature: 6 + }; + A.global_closure11.prototype = { + call$1($arguments) { + var t1 = J.getInterceptor$asx($arguments); + if (t1.$index($arguments, 0).get$isVar() || t1.$index($arguments, 1).get$isVar()) + return A._functionString("hsl", $arguments); + else + throw A.wrapException(A.SassScriptException$("Missing argument $lightness.", null)); + }, + $signature: 19 + }; + A.global_closure12.prototype = { + call$1($arguments) { + var parsed = A._parseChannels("hsl", A._setArrayType(["$hue", "$saturation", "$lightness"], type$.JSArray_String), J.get$first$ax($arguments)); + return parsed instanceof A.SassString ? parsed : A._hsl("hsl", type$.List_Value._as(parsed)); + }, + $signature: 6 + }; + A.global_closure13.prototype = { + call$1($arguments) { + return A._hsl("hsla", $arguments); + }, + $signature: 6 + }; + A.global_closure14.prototype = { + call$1($arguments) { + return A._hsl("hsla", $arguments); + }, + $signature: 6 + }; + A.global_closure15.prototype = { + call$1($arguments) { + var t1 = J.getInterceptor$asx($arguments); + if (t1.$index($arguments, 0).get$isVar() || t1.$index($arguments, 1).get$isVar()) + return A._functionString("hsla", $arguments); + else + throw A.wrapException(A.SassScriptException$("Missing argument $lightness.", null)); + }, + $signature: 19 + }; + A.global_closure16.prototype = { + call$1($arguments) { + var parsed = A._parseChannels("hsla", A._setArrayType(["$hue", "$saturation", "$lightness"], type$.JSArray_String), J.get$first$ax($arguments)); + return parsed instanceof A.SassString ? parsed : A._hsl("hsla", type$.List_Value._as(parsed)); + }, + $signature: 6 + }; + A.global_closure17.prototype = { + call$1($arguments) { + var t1 = J.getInterceptor$asx($arguments); + if (t1.$index($arguments, 0) instanceof A.SassNumber || t1.$index($arguments, 0).get$isSpecialNumber()) + return A._functionString("grayscale", $arguments); + return t1.$index($arguments, 0).assertColor$1("color").changeHsl$1$saturation(0); + }, + $signature: 6 + }; + A.global_closure18.prototype = { + call$1($arguments) { + var t1 = J.getInterceptor$asx($arguments), + color = t1.$index($arguments, 0).assertColor$1("color"), + degrees = A._angleValue(t1.$index($arguments, 1), "degrees"); + return color.changeHsl$1$hue(color.get$hue(0) + degrees); + }, + $signature: 30 + }; + A.global_closure19.prototype = { + call$1($arguments) { + var t1 = J.getInterceptor$asx($arguments), + color = t1.$index($arguments, 0).assertColor$1("color"), + amount = t1.$index($arguments, 1).assertNumber$1("amount"); + return color.changeHsl$1$lightness(B.JSNumber_methods.clamp$2(color.get$lightness(0) + amount.valueInRange$3(0, 100, "amount"), 0, 100)); + }, + $signature: 30 + }; + A.global_closure20.prototype = { + call$1($arguments) { + var t1 = J.getInterceptor$asx($arguments), + color = t1.$index($arguments, 0).assertColor$1("color"), + amount = t1.$index($arguments, 1).assertNumber$1("amount"); + return color.changeHsl$1$lightness(B.JSNumber_methods.clamp$2(color.get$lightness(0) - amount.valueInRange$3(0, 100, "amount"), 0, 100)); + }, + $signature: 30 + }; + A.global_closure21.prototype = { + call$1($arguments) { + var t1 = J.getInterceptor$asx($arguments); + if (t1.$index($arguments, 0) instanceof A.SassNumber || t1.$index($arguments, 0).get$isSpecialNumber()) + return A._functionString("saturate", $arguments); + return new A.SassString("saturate(" + A.serializeValue(t1.$index($arguments, 0).assertNumber$1("amount"), false, true) + ")", false); + }, + $signature: 19 + }; + A.global_closure22.prototype = { + call$1($arguments) { + var t1 = J.getInterceptor$asx($arguments), + color = t1.$index($arguments, 0).assertColor$1("color"), + amount = t1.$index($arguments, 1).assertNumber$1("amount"); + return color.changeHsl$1$saturation(B.JSNumber_methods.clamp$2(color.get$saturation(0) + amount.valueInRange$3(0, 100, "amount"), 0, 100)); + }, + $signature: 30 + }; + A.global_closure23.prototype = { + call$1($arguments) { + var t1 = J.getInterceptor$asx($arguments), + color = t1.$index($arguments, 0).assertColor$1("color"), + amount = t1.$index($arguments, 1).assertNumber$1("amount"); + return color.changeHsl$1$saturation(B.JSNumber_methods.clamp$2(color.get$saturation(0) - amount.valueInRange$3(0, 100, "amount"), 0, 100)); + }, + $signature: 30 + }; + A.global_closure24.prototype = { + call$1($arguments) { + var argument = J.$index$asx($arguments, 0); + if (argument instanceof A.SassString && !argument._hasQuotes && B.JSString_methods.contains$1(argument._string$_text, $.$get$_microsoftFilterStart())) + return A._functionString("alpha", $arguments); + return A.SassNumber_SassNumber(argument.assertColor$1("color")._alpha, null); + }, + $signature: 6 + }; + A.global_closure25.prototype = { + call$1($arguments) { + var t1, + argList = J.$index$asx($arguments, 0).get$asList(); + if (argList.length !== 0 && B.JSArray_methods.every$1(argList, new A.global__closure())) + return A._functionString("alpha", $arguments); + t1 = argList.length; + if (t1 === 0) + throw A.wrapException(A.SassScriptException$("Missing argument $color.", null)); + else + throw A.wrapException(A.SassScriptException$("Only 1 argument allowed, but " + t1 + " were passed.", null)); + }, + $signature: 19 + }; + A.global__closure.prototype = { + call$1(argument) { + return argument instanceof A.SassString && !argument._hasQuotes && B.JSString_methods.contains$1(argument._string$_text, $.$get$_microsoftFilterStart()); + }, + $signature: 69 + }; + A.global_closure26.prototype = { + call$1($arguments) { + var t1 = J.getInterceptor$asx($arguments); + if (t1.$index($arguments, 0) instanceof A.SassNumber || t1.$index($arguments, 0).get$isSpecialNumber()) + return A._functionString("opacity", $arguments); + return A.SassNumber_SassNumber(t1.$index($arguments, 0).assertColor$1("color")._alpha, null); + }, + $signature: 6 + }; + A.module_closure1.prototype = { + call$1($arguments) { + var result, t2, color, + t1 = J.getInterceptor$asx($arguments), + weight = t1.$index($arguments, 1).assertNumber$1("weight"); + if (t1.$index($arguments, 0) instanceof A.SassNumber) { + if (weight._number$_value !== 100 || !weight.hasUnit$1("%")) + throw A.wrapException(string$.Only_oa); + result = A._functionString("invert", t1.take$1($arguments, 1)); + t1 = A.S(t1.$index($arguments, 0)); + t2 = result.toString$0(0); + A.EvaluationContext_current().warn$2(0, "Passing a number (" + t1 + string$.x29x20to_ci + t2, B.Deprecation_s4m); + return result; + } + color = t1.$index($arguments, 0).assertColor$1("color"); + t1 = color.get$red(0); + t2 = color.get$green(0); + return A._mixColors(color.changeRgb$3$blue$green$red(255 - color.get$blue(0), 255 - t2, 255 - t1), color, weight); + }, + $signature: 6 + }; + A.module_closure2.prototype = { + call$1($arguments) { + var result, t2, + t1 = J.getInterceptor$asx($arguments); + if (t1.$index($arguments, 0) instanceof A.SassNumber) { + result = A._functionString("grayscale", t1.take$1($arguments, 1)); + t1 = A.S(t1.$index($arguments, 0)); + t2 = result.toString$0(0); + A.EvaluationContext_current().warn$2(0, "Passing a number (" + t1 + string$.x29x20to_cg + t2, B.Deprecation_s4m); + return result; + } + return t1.$index($arguments, 0).assertColor$1("color").changeHsl$1$saturation(0); + }, + $signature: 6 + }; + A.module_closure3.prototype = { + call$1($arguments) { + return A._hwb($arguments); + }, + $signature: 6 + }; + A.module_closure4.prototype = { + call$1($arguments) { + var parsed = A._parseChannels("hwb", A._setArrayType(["$hue", "$whiteness", "$blackness"], type$.JSArray_String), J.get$first$ax($arguments)); + if (parsed instanceof A.SassString) + throw A.wrapException(A.SassScriptException$('Expected numeric channels, got "' + parsed.toString$0(0) + '".', null)); + else + return A._hwb(type$.List_Value._as(parsed)); + }, + $signature: 6 + }; + A.module_closure5.prototype = { + call$1($arguments) { + return A.SassNumber_SassNumber(J.get$first$ax($arguments).assertColor$1("color").get$whiteness(0), "%"); + }, + $signature: 12 + }; + A.module_closure6.prototype = { + call$1($arguments) { + return A.SassNumber_SassNumber(J.get$first$ax($arguments).assertColor$1("color").get$blackness(0), "%"); + }, + $signature: 12 + }; + A.module_closure7.prototype = { + call$1($arguments) { + var result, t1, + argument = J.$index$asx($arguments, 0); + if (argument instanceof A.SassString && !argument._hasQuotes && B.JSString_methods.contains$1(argument._string$_text, $.$get$_microsoftFilterStart())) { + result = A._functionString("alpha", $arguments); + t1 = result.toString$0(0); + A.EvaluationContext_current().warn$2(0, string$.Using_c + t1, B.Deprecation_s4m); + return result; + } + return A.SassNumber_SassNumber(argument.assertColor$1("color")._alpha, null); + }, + $signature: 6 + }; + A.module_closure8.prototype = { + call$1($arguments) { + var result, + t1 = J.getInterceptor$asx($arguments); + if (B.JSArray_methods.every$1(t1.$index($arguments, 0).get$asList(), new A.module__closure1())) { + result = A._functionString("alpha", $arguments); + t1 = result.toString$0(0); + A.EvaluationContext_current().warn$2(0, string$.Using_c + t1, B.Deprecation_s4m); + return result; + } + throw A.wrapException(A.SassScriptException$("Only 1 argument allowed, but " + t1.get$length($arguments) + " were passed.", null)); + }, + $signature: 19 + }; + A.module__closure1.prototype = { + call$1(argument) { + return argument instanceof A.SassString && !argument._hasQuotes && B.JSString_methods.contains$1(argument._string$_text, $.$get$_microsoftFilterStart()); + }, + $signature: 69 + }; + A.module_closure9.prototype = { + call$1($arguments) { + var result, t2, + t1 = J.getInterceptor$asx($arguments); + if (t1.$index($arguments, 0) instanceof A.SassNumber) { + result = A._functionString("opacity", $arguments); + t1 = A.S(t1.$index($arguments, 0)); + t2 = result.toString$0(0); + A.EvaluationContext_current().warn$2(0, "Passing a number (" + t1 + string$.x20to_co + t2, B.Deprecation_s4m); + return result; + } + return A.SassNumber_SassNumber(t1.$index($arguments, 0).assertColor$1("color")._alpha, null); + }, + $signature: 6 + }; + A._red_closure.prototype = { + call$1($arguments) { + return A.SassNumber_SassNumber(J.get$first$ax($arguments).assertColor$1("color").get$red(0), null); + }, + $signature: 12 + }; + A._green_closure.prototype = { + call$1($arguments) { + return A.SassNumber_SassNumber(J.get$first$ax($arguments).assertColor$1("color").get$green(0), null); + }, + $signature: 12 + }; + A._blue_closure.prototype = { + call$1($arguments) { + return A.SassNumber_SassNumber(J.get$first$ax($arguments).assertColor$1("color").get$blue(0), null); + }, + $signature: 12 + }; + A._mix_closure.prototype = { + call$1($arguments) { + var t1 = J.getInterceptor$asx($arguments); + return A._mixColors(t1.$index($arguments, 0).assertColor$1("color1"), t1.$index($arguments, 1).assertColor$1("color2"), t1.$index($arguments, 2).assertNumber$1("weight")); + }, + $signature: 30 + }; + A._hue_closure.prototype = { + call$1($arguments) { + return A.SassNumber_SassNumber(J.get$first$ax($arguments).assertColor$1("color").get$hue(0), "deg"); + }, + $signature: 12 + }; + A._saturation_closure.prototype = { + call$1($arguments) { + return A.SassNumber_SassNumber(J.get$first$ax($arguments).assertColor$1("color").get$saturation(0), "%"); + }, + $signature: 12 + }; + A._lightness_closure.prototype = { + call$1($arguments) { + return A.SassNumber_SassNumber(J.get$first$ax($arguments).assertColor$1("color").get$lightness(0), "%"); + }, + $signature: 12 + }; + A._complement_closure.prototype = { + call$1($arguments) { + var color = J.$index$asx($arguments, 0).assertColor$1("color"); + return color.changeHsl$1$hue(color.get$hue(0) + 180); + }, + $signature: 30 + }; + A._adjust_closure.prototype = { + call$1($arguments) { + return A._updateComponents($arguments, true, false, false); + }, + $signature: 30 + }; + A._scale_closure.prototype = { + call$1($arguments) { + return A._updateComponents($arguments, false, false, true); + }, + $signature: 30 + }; + A._change_closure.prototype = { + call$1($arguments) { + return A._updateComponents($arguments, false, true, false); + }, + $signature: 30 + }; + A._ieHexStr_closure.prototype = { + call$1($arguments) { + var color = J.$index$asx($arguments, 0).assertColor$1("color"), + t1 = new A._ieHexStr_closure_hexString(); + return new A.SassString("#" + A.S(t1.call$1(A.fuzzyRound(color._alpha * 255))) + A.S(t1.call$1(color.get$red(0))) + A.S(t1.call$1(color.get$green(0))) + A.S(t1.call$1(color.get$blue(0))), false); + }, + $signature: 19 + }; + A._ieHexStr_closure_hexString.prototype = { + call$1(component) { + return B.JSString_methods.padLeft$2(B.JSInt_methods.toRadixString$1(component, 16), 2, "0").toUpperCase(); + }, + $signature: 230 + }; + A._updateComponents_getParam.prototype = { + call$5$assertPercent$checkPercent$checkUnitless($name, max, assertPercent, checkPercent, checkUnitless) { + var t2, t3, t4, _this = this, + t1 = _this.keywords.remove$1(0, $name), + number = t1 == null ? null : t1.assertNumber$1($name); + if (number == null) + return null; + t1 = _this.scale; + t2 = !t1; + if (t2 && checkUnitless) + if (number.get$hasUnits()) { + t3 = number.get$unitString(); + t4 = number.unitSuggestion$1($name); + A.EvaluationContext_current().warn$2(0, "$" + $name + ": Passing a number with unit " + t3 + string$.x20is_de + t4 + string$.x0a_Morex3a, B.Deprecation_8WR); + } + if (t2 && checkPercent) + A._checkPercent(number, $name); + if (!t2 || assertPercent) + number.assertUnit$2("%", $name); + if (t1) + max = 100; + if (!t2 || assertPercent) + t1 = number.valueInRange$3(_this.change ? 0 : -max, max, $name); + else { + t1 = _this.change ? 0 : -max; + t1 = number.valueInRangeWithUnit$4(t1, max, $name, checkPercent ? "%" : ""); + } + return t1; + }, + call$2($name, max) { + return this.call$5$assertPercent$checkPercent$checkUnitless($name, max, false, false, false); + }, + call$3$checkUnitless($name, max, checkUnitless) { + return this.call$5$assertPercent$checkPercent$checkUnitless($name, max, false, false, checkUnitless); + }, + call$3$checkPercent($name, max, checkPercent) { + return this.call$5$assertPercent$checkPercent$checkUnitless($name, max, false, checkPercent, false); + }, + call$3$assertPercent($name, max, assertPercent) { + return this.call$5$assertPercent$checkPercent$checkUnitless($name, max, assertPercent, false, false); + }, + $signature: 227 + }; + A._updateComponents_closure.prototype = { + call$1(hue) { + return A._angleValue(hue, "hue"); + }, + $signature: 97 + }; + A._updateComponents_closure0.prototype = { + call$1($name) { + return "$" + $name; + }, + $signature: 5 + }; + A._updateComponents_updateValue.prototype = { + call$3(current, param, max) { + var t1; + if (param == null) + return current; + if (this.change) + return param; + if (this.adjust) + return B.JSNumber_methods.clamp$2(current + param, 0, max); + t1 = param > 0 ? max - current : current; + return current + t1 * (param / 100); + }, + $signature: 202 + }; + A._updateComponents_updateRgb.prototype = { + call$2(current, param) { + return A.fuzzyRound(this.updateValue.call$3(current, param, 255)); + }, + $signature: 197 + }; + A._functionString_closure.prototype = { + call$1(argument) { + return A.serializeValue(argument, false, true); + }, + $signature: 386 + }; + A._removedColorFunction_closure.prototype = { + call$1($arguments) { + var t1 = this.name, + t2 = J.getInterceptor$asx($arguments), + t3 = A.S(t2.$index($arguments, 0)), + t4 = this.negative ? "-" : ""; + throw A.wrapException(A.SassScriptException$("The function " + t1 + string$.x28__isn + t3 + ", $" + this.argument + ": " + t4 + A.S(t2.$index($arguments, 1)) + string$.x29x0a_Mor + t1, null)); + }, + $signature: 382 + }; + A._rgb_closure.prototype = { + call$1(alpha) { + return A._percentageOrUnitless(alpha.assertNumber$1("alpha"), 1, "alpha"); + }, + $signature: 97 + }; + A._hsl_closure.prototype = { + call$1(alpha) { + return A._percentageOrUnitless(alpha.assertNumber$1("alpha"), 1, "alpha"); + }, + $signature: 97 + }; + A._hwb_closure.prototype = { + call$1(alpha) { + return A._percentageOrUnitless(alpha.assertNumber$1("alpha"), 1, "alpha"); + }, + $signature: 97 + }; + A._parseChannels_closure.prototype = { + call$1(value) { + return value.get$isVar(); + }, + $signature: 69 + }; + A._length_closure0.prototype = { + call$1($arguments) { + return A.SassNumber_SassNumber(J.$index$asx($arguments, 0).get$asList().length, null); + }, + $signature: 12 + }; + A._nth_closure.prototype = { + call$1($arguments) { + var t1 = J.getInterceptor$asx($arguments), + list = t1.$index($arguments, 0), + index = t1.$index($arguments, 1); + return list.get$asList()[list.sassIndexToListIndex$2(index, "n")]; + }, + $signature: 6 + }; + A._setNth_closure.prototype = { + call$1($arguments) { + var newList, + t1 = J.getInterceptor$asx($arguments), + list = t1.$index($arguments, 0), + index = t1.$index($arguments, 1), + value = t1.$index($arguments, 2); + t1 = list.get$asList(); + newList = A._setArrayType(t1.slice(0), A._arrayInstanceType(t1)); + newList[list.sassIndexToListIndex$2(index, "n")] = value; + return list.withListContents$1(newList); + }, + $signature: 23 + }; + A._join_closure.prototype = { + call$1($arguments) { + var _0_1, _0_4, _0_3, _0_10, _0_40, _0_4_isSet, separator, bracketed, t2, _null = null, + t1 = J.getInterceptor$asx($arguments), + list1 = t1.$index($arguments, 0), + list2 = t1.$index($arguments, 1), + separatorParam = t1.$index($arguments, 2).assertString$1("separator"), + bracketedParam = t1.$index($arguments, 3), + _1_0 = separatorParam._string$_text; + $label1$1: { + if ("auto" === _1_0) { + _0_1 = list1.get$separator(list1); + _0_4 = list2.get$separator(list2); + $label0$0: { + _0_3 = B.ListSeparator_undecided_null_undecided === _0_1; + t1 = _0_3; + _0_10 = _0_1; + if (t1) { + t1 = B.ListSeparator_undecided_null_undecided === _0_4; + _0_40 = _0_4; + _0_4_isSet = true; + } else { + _0_40 = _null; + _0_4_isSet = false; + t1 = false; + } + if (t1) { + t1 = B.ListSeparator_EVt; + break $label0$0; + } + if (_0_3) { + separator = _0_4_isSet ? _0_40 : _0_4; + t1 = true; + } else { + separator = _null; + t1 = false; + } + if (!t1) + separator = _0_10; + t1 = separator; + break $label0$0; + } + break $label1$1; + } + if ("space" === _1_0) { + t1 = B.ListSeparator_EVt; + break $label1$1; + } + if ("comma" === _1_0) { + t1 = B.ListSeparator_rXA; + break $label1$1; + } + if ("slash" === _1_0) { + t1 = B.ListSeparator_zg9; + break $label1$1; + } + t1 = A.throwExpression(A.SassScriptException$(string$.x24separ, _null)); + } + bracketed = bracketedParam instanceof A.SassString && bracketedParam._string$_text === "auto" ? list1.get$hasBrackets() : bracketedParam.get$isTruthy(); + t2 = A.List_List$of(list1.get$asList(), true, type$.Value); + B.JSArray_methods.addAll$1(t2, list2.get$asList()); + return A.SassList$(t2, t1, bracketed); + }, + $signature: 23 + }; + A._append_closure0.prototype = { + call$1($arguments) { + var t2, + t1 = J.getInterceptor$asx($arguments), + list = t1.$index($arguments, 0), + value = t1.$index($arguments, 1), + _0_0 = t1.$index($arguments, 2).assertString$1("separator")._string$_text; + $label0$0: { + if ("auto" === _0_0) { + t1 = list.get$separator(list) === B.ListSeparator_undecided_null_undecided ? B.ListSeparator_EVt : list.get$separator(list); + break $label0$0; + } + if ("space" === _0_0) { + t1 = B.ListSeparator_EVt; + break $label0$0; + } + if ("comma" === _0_0) { + t1 = B.ListSeparator_rXA; + break $label0$0; + } + if ("slash" === _0_0) { + t1 = B.ListSeparator_zg9; + break $label0$0; + } + t1 = A.throwExpression(A.SassScriptException$(string$.x24separ, null)); + } + t2 = A.List_List$of(list.get$asList(), true, type$.Value); + t2.push(value); + return list.withListContents$2$separator(t2, t1); + }, + $signature: 23 + }; + A._zip_closure.prototype = { + call$1($arguments) { + var results, result, _box_0 = {}, + t1 = J.$index$asx($arguments, 0).get$asList(), + t2 = A._arrayInstanceType(t1)._eval$1("MappedListIterable<1,List>"), + lists = A.List_List$of(new A.MappedListIterable(t1, new A._zip__closure(), t2), true, t2._eval$1("ListIterable.E")); + if (lists.length === 0) + return B.SassList_Sof; + _box_0.i = 0; + results = A._setArrayType([], type$.JSArray_SassList); + for (t1 = A._arrayInstanceType(lists)._eval$1("MappedListIterable<1,Value>"), t2 = type$.Value; B.JSArray_methods.every$1(lists, new A._zip__closure0(_box_0));) { + result = A.List_List$from(new A.MappedListIterable(lists, new A._zip__closure1(_box_0), t1), false, t2); + result.fixed$length = Array; + result.immutable$list = Array; + results.push(new A.SassList(result, B.ListSeparator_EVt, false)); + ++_box_0.i; + } + return A.SassList$(results, B.ListSeparator_rXA, false); + }, + $signature: 23 + }; + A._zip__closure.prototype = { + call$1(list) { + return list.get$asList(); + }, + $signature: 381 + }; + A._zip__closure0.prototype = { + call$1(list) { + return this._box_0.i !== J.get$length$asx(list); + }, + $signature: 380 + }; + A._zip__closure1.prototype = { + call$1(list) { + return J.$index$asx(list, this._box_0.i); + }, + $signature: 6 + }; + A._index_closure0.prototype = { + call$1($arguments) { + var t1 = J.getInterceptor$asx($arguments), + index = B.JSArray_methods.indexOf$1(t1.$index($arguments, 0).get$asList(), t1.$index($arguments, 1)); + return index === -1 ? B.C__SassNull : A.SassNumber_SassNumber(index + 1, null); + }, + $signature: 6 + }; + A._separator_closure.prototype = { + call$1($arguments) { + var t1, + _0_0 = J.get$separator$x(J.$index$asx($arguments, 0)); + $label0$0: { + if (B.ListSeparator_rXA === _0_0) { + t1 = new A.SassString("comma", false); + break $label0$0; + } + if (B.ListSeparator_zg9 === _0_0) { + t1 = new A.SassString("slash", false); + break $label0$0; + } + t1 = new A.SassString("space", false); + break $label0$0; + } + return t1; + }, + $signature: 19 + }; + A._isBracketed_closure.prototype = { + call$1($arguments) { + return J.$index$asx($arguments, 0).get$hasBrackets() ? B.SassBoolean_true : B.SassBoolean_false; + }, + $signature: 21 + }; + A._slash_closure.prototype = { + call$1($arguments) { + var list = J.$index$asx($arguments, 0).get$asList(); + if (list.length < 2) + throw A.wrapException(A.SassScriptException$("At least two elements are required.", null)); + return A.SassList$(list, B.ListSeparator_zg9, false); + }, + $signature: 23 + }; + A._get_closure.prototype = { + call$1($arguments) { + var value, + t1 = J.getInterceptor$asx($arguments), + map = t1.$index($arguments, 0).assertMap$1("map"), + t2 = A._setArrayType([t1.$index($arguments, 1)], type$.JSArray_Value); + B.JSArray_methods.addAll$1(t2, t1.$index($arguments, 2).get$asList()); + for (t1 = A.IterableExtension_get_exceptLast(t2), t1 = t1.get$iterator(t1); t1.moveNext$0(); map = value) { + value = map._map$_contents.$index(0, t1.get$current(t1)); + if (!(value instanceof A.SassMap)) + return B.C__SassNull; + } + t1 = map._map$_contents.$index(0, B.JSArray_methods.get$last(t2)); + return t1 == null ? B.C__SassNull : t1; + }, + $signature: 6 + }; + A._set_closure.prototype = { + call$1($arguments) { + var t1 = J.getInterceptor$asx($arguments); + return A._modify(t1.$index($arguments, 0).assertMap$1("map"), A._setArrayType([t1.$index($arguments, 1)], type$.JSArray_Value), new A._set__closure0($arguments), true); + }, + $signature: 6 + }; + A._set__closure0.prototype = { + call$1(_) { + return J.$index$asx(this.$arguments, 2); + }, + $signature: 39 + }; + A._set_closure0.prototype = { + call$1($arguments) { + var keys, t1 = {}, + t2 = J.getInterceptor$asx($arguments), + map = t2.$index($arguments, 0).assertMap$1("map"), + _0_0 = t2.$index($arguments, 1).get$asList(), + _0_1 = _0_0.length; + if (_0_1 <= 0) + throw A.wrapException(A.SassScriptException$("Expected $args to contain a key.", null)); + if (_0_1 === 1) + throw A.wrapException(A.SassScriptException$("Expected $args to contain a value.", null)); + keys = t1.value = null; + if (_0_1 >= 1) { + keys = B.JSArray_methods.sublist$2(_0_0, 0, _0_1 - 1); + t1.value = _0_0[_0_1 - 1]; + t2 = true; + } else + t2 = false; + if (t2) + return A._modify(map, keys, new A._set__closure(t1), true); + throw A.wrapException("[BUG] Unreachable code"); + }, + $signature: 6 + }; + A._set__closure.prototype = { + call$1(_) { + return this._box_0.value; + }, + $signature: 39 + }; + A._merge_closure.prototype = { + call$1($arguments) { + var t2, + t1 = J.getInterceptor$asx($arguments), + map1 = t1.$index($arguments, 0).assertMap$1("map1"), + map2 = t1.$index($arguments, 1).assertMap$1("map2"); + t1 = type$.Value; + t2 = A.LinkedHashMap_LinkedHashMap$of(map1._map$_contents, t1, t1); + t2.addAll$1(0, map2._map$_contents); + return new A.SassMap(A.ConstantMap_ConstantMap$from(t2, t1, t1)); + }, + $signature: 34 + }; + A._merge_closure0.prototype = { + call$1($arguments) { + var keys, last, _null = null, + t1 = J.getInterceptor$asx($arguments), + map1 = t1.$index($arguments, 0).assertMap$1("map1"), + _0_0 = t1.$index($arguments, 1).get$asList(), + _0_1 = _0_0.length; + if (_0_1 <= 0) + throw A.wrapException(A.SassScriptException$("Expected $args to contain a key.", _null)); + if (_0_1 === 1) + throw A.wrapException(A.SassScriptException$("Expected $args to contain a map.", _null)); + if (_0_1 >= 1) { + keys = B.JSArray_methods.sublist$2(_0_0, 0, _0_1 - 1); + last = _0_0[_0_1 - 1]; + t1 = true; + } else { + last = _null; + keys = last; + t1 = false; + } + if (t1) + return A._modify(map1, keys, new A._merge__closure(last.assertMap$1("map2")), true); + throw A.wrapException("[BUG] Unreachable code"); + }, + $signature: 6 + }; + A._merge__closure.prototype = { + call$1(oldValue) { + var t1, t2, + nestedMap = oldValue.tryMap$0(); + if (nestedMap == null) + return this.map2; + t1 = type$.Value; + t2 = A.LinkedHashMap_LinkedHashMap$of(nestedMap._map$_contents, t1, t1); + t2.addAll$1(0, this.map2._map$_contents); + return new A.SassMap(A.ConstantMap_ConstantMap$from(t2, t1, t1)); + }, + $signature: 379 + }; + A._deepMerge_closure.prototype = { + call$1($arguments) { + var t1 = J.getInterceptor$asx($arguments); + return A._deepMergeImpl(t1.$index($arguments, 0).assertMap$1("map1"), t1.$index($arguments, 1).assertMap$1("map2")); + }, + $signature: 34 + }; + A._deepRemove_closure.prototype = { + call$1($arguments) { + var t1 = J.getInterceptor$asx($arguments), + map = t1.$index($arguments, 0).assertMap$1("map"), + t2 = A._setArrayType([t1.$index($arguments, 1)], type$.JSArray_Value); + B.JSArray_methods.addAll$1(t2, t1.$index($arguments, 2).get$asList()); + return A._modify(map, A.IterableExtension_get_exceptLast(t2), new A._deepRemove__closure(t2), false); + }, + $signature: 6 + }; + A._deepRemove__closure.prototype = { + call$1(value) { + var t1, nestedMap, t2, + _0_0 = value.tryMap$0(); + if (_0_0 != null) { + t1 = _0_0._map$_contents.containsKey$1(B.JSArray_methods.get$last(this.keys)); + nestedMap = _0_0; + } else { + nestedMap = null; + t1 = false; + } + if (t1) { + t1 = type$.Value; + t2 = A.LinkedHashMap_LinkedHashMap$of(nestedMap._map$_contents, t1, t1); + t2.remove$1(0, B.JSArray_methods.get$last(this.keys)); + return new A.SassMap(A.ConstantMap_ConstantMap$from(t2, t1, t1)); + } + return value; + }, + $signature: 39 + }; + A._remove_closure.prototype = { + call$1($arguments) { + return J.$index$asx($arguments, 0).assertMap$1("map"); + }, + $signature: 34 + }; + A._remove_closure0.prototype = { + call$1($arguments) { + var mutableMap, t3, _i, + t1 = J.getInterceptor$asx($arguments), + map = t1.$index($arguments, 0).assertMap$1("map"), + t2 = A._setArrayType([t1.$index($arguments, 1)], type$.JSArray_Value); + B.JSArray_methods.addAll$1(t2, t1.$index($arguments, 2).get$asList()); + t1 = type$.Value; + mutableMap = A.LinkedHashMap_LinkedHashMap$of(map._map$_contents, t1, t1); + for (t3 = t2.length, _i = 0; _i < t2.length; t2.length === t3 || (0, A.throwConcurrentModificationError)(t2), ++_i) + mutableMap.remove$1(0, t2[_i]); + return new A.SassMap(A.ConstantMap_ConstantMap$from(mutableMap, t1, t1)); + }, + $signature: 34 + }; + A._keys_closure.prototype = { + call$1($arguments) { + var t1 = J.$index$asx($arguments, 0).assertMap$1("map")._map$_contents; + return A.SassList$(t1.get$keys(t1), B.ListSeparator_rXA, false); + }, + $signature: 23 + }; + A._values_closure.prototype = { + call$1($arguments) { + var t1 = J.$index$asx($arguments, 0).assertMap$1("map")._map$_contents; + return A.SassList$(t1.get$values(t1), B.ListSeparator_rXA, false); + }, + $signature: 23 + }; + A._hasKey_closure.prototype = { + call$1($arguments) { + var value, + t1 = J.getInterceptor$asx($arguments), + map = t1.$index($arguments, 0).assertMap$1("map"), + t2 = A._setArrayType([t1.$index($arguments, 1)], type$.JSArray_Value); + B.JSArray_methods.addAll$1(t2, t1.$index($arguments, 2).get$asList()); + for (t1 = A.IterableExtension_get_exceptLast(t2), t1 = t1.get$iterator(t1); t1.moveNext$0(); map = value) { + value = map._map$_contents.$index(0, t1.get$current(t1)); + if (!(value instanceof A.SassMap)) + return B.SassBoolean_false; + } + return map._map$_contents.containsKey$1(B.JSArray_methods.get$last(t2)) ? B.SassBoolean_true : B.SassBoolean_false; + }, + $signature: 21 + }; + A._modify_modifyNestedMap.prototype = { + call$1(map) { + var nestedMap, _this = this, + t1 = type$.Value, + mutableMap = A.LinkedHashMap_LinkedHashMap$of(map._map$_contents, t1, t1), + t2 = _this.keyIterator, + key = t2.get$current(t2); + if (!t2.moveNext$0()) { + t2 = mutableMap.$index(0, key); + if (t2 == null) + t2 = B.C__SassNull; + mutableMap.$indexSet(0, key, _this.modify.call$1(t2)); + return new A.SassMap(A.ConstantMap_ConstantMap$from(mutableMap, t1, t1)); + } + t2 = mutableMap.$index(0, key); + nestedMap = t2 == null ? null : t2.tryMap$0(); + t2 = nestedMap == null; + if (t2 && !_this.addNesting) + return new A.SassMap(A.ConstantMap_ConstantMap$from(mutableMap, t1, t1)); + mutableMap.$indexSet(0, key, _this.call$1(t2 ? B.SassMap_Map_empty : nestedMap)); + return new A.SassMap(A.ConstantMap_ConstantMap$from(mutableMap, t1, t1)); + }, + $signature: 378 + }; + A.global_closure.prototype = { + call$1($arguments) { + var t1, t2, + number = J.$index$asx($arguments, 0).assertNumber$1("number"); + if (number.hasUnit$1("%")) { + t1 = number.toString$0(0); + t2 = number.toString$0(0); + A.EvaluationContext_current().warn$2(0, string$.Passinp + t1 + ")\nTo emit a CSS abs() now: abs(#{" + t2 + string$.x7d__Mor, B.Deprecation_043); + } + t1 = number.get$numeratorUnits(number); + return A.SassNumber_SassNumber$withUnits(Math.abs(number._number$_value), number.get$denominatorUnits(number), t1); + }, + $signature: 12 + }; + A.module_closure0.prototype = { + call$1(value) { + return Math.abs(value); + }, + $signature: 37 + }; + A._ceil_closure.prototype = { + call$1(value) { + return B.JSNumber_methods.ceil$0(value); + }, + $signature: 37 + }; + A._clamp_closure.prototype = { + call$1($arguments) { + var t1 = J.getInterceptor$asx($arguments), + min = t1.$index($arguments, 0).assertNumber$1("min"), + number = t1.$index($arguments, 1).assertNumber$1("number"), + max = t1.$index($arguments, 2).assertNumber$1("max"); + number.convertValueToMatch$3(min, "number", "min"); + max.convertValueToMatch$3(min, "max", "min"); + if (min.greaterThanOrEquals$1(max).value) + return min; + if (min.greaterThanOrEquals$1(number).value) + return min; + if (number.greaterThanOrEquals$1(max).value) + return max; + return number; + }, + $signature: 12 + }; + A._floor_closure.prototype = { + call$1(value) { + return B.JSNumber_methods.floor$0(value); + }, + $signature: 37 + }; + A._max_closure.prototype = { + call$1($arguments) { + var t1, t2, max, _i, number; + for (t1 = J.$index$asx($arguments, 0).get$asList(), t2 = t1.length, max = null, _i = 0; _i < t1.length; t1.length === t2 || (0, A.throwConcurrentModificationError)(t1), ++_i) { + number = t1[_i].assertNumber$0(); + if (max == null || max.lessThan$1(number).value) + max = number; + } + if (max != null) + return max; + throw A.wrapException(A.SassScriptException$("At least one argument must be passed.", null)); + }, + $signature: 12 + }; + A._min_closure.prototype = { + call$1($arguments) { + var t1, t2, min, _i, number; + for (t1 = J.$index$asx($arguments, 0).get$asList(), t2 = t1.length, min = null, _i = 0; _i < t1.length; t1.length === t2 || (0, A.throwConcurrentModificationError)(t1), ++_i) { + number = t1[_i].assertNumber$0(); + if (min == null || min.greaterThan$1(number).value) + min = number; + } + if (min != null) + return min; + throw A.wrapException(A.SassScriptException$("At least one argument must be passed.", null)); + }, + $signature: 12 + }; + A._round_closure.prototype = { + call$1(number) { + return B.JSNumber_methods.round$0(number); + }, + $signature: 37 + }; + A._hypot_closure.prototype = { + call$1($arguments) { + var subtotal, i, i0, t3, t4, + t1 = J.$index$asx($arguments, 0).get$asList(), + t2 = A._arrayInstanceType(t1)._eval$1("MappedListIterable<1,SassNumber>"), + numbers = A.List_List$of(new A.MappedListIterable(t1, new A._hypot__closure(), t2), true, t2._eval$1("ListIterable.E")); + t1 = numbers.length; + if (t1 === 0) + throw A.wrapException(A.SassScriptException$("At least one argument must be passed.", null)); + for (subtotal = 0, i = 0; i < t1; i = i0) { + i0 = i + 1; + subtotal += Math.pow(numbers[i].convertValueToMatch$3(numbers[0], "numbers[" + i0 + "]", "numbers[1]"), 2); + } + t1 = Math.sqrt(subtotal); + t2 = numbers[0]; + t3 = J.getInterceptor$x(t2); + t4 = t3.get$numeratorUnits(t2); + return A.SassNumber_SassNumber$withUnits(t1, t3.get$denominatorUnits(t2), t4); + }, + $signature: 12 + }; + A._hypot__closure.prototype = { + call$1(argument) { + return argument.assertNumber$0(); + }, + $signature: 377 + }; + A._log_closure.prototype = { + call$1($arguments) { + var base, + _s18_ = " to have no units.", + _null = null, + t1 = J.getInterceptor$asx($arguments), + number = t1.$index($arguments, 0).assertNumber$1("number"); + if (number.get$hasUnits()) + throw A.wrapException(A.SassScriptException$("$number: Expected " + number.toString$0(0) + _s18_, _null)); + else if (J.$eq$(t1.$index($arguments, 1), B.C__SassNull)) + return A.SassNumber_SassNumber(Math.log(number._number$_value), _null); + base = t1.$index($arguments, 1).assertNumber$1("base"); + if (base.get$hasUnits()) + throw A.wrapException(A.SassScriptException$("$base: Expected " + base.toString$0(0) + _s18_, _null)); + else + return A.SassNumber_SassNumber(Math.log(number._number$_value) / Math.log(base._number$_value), _null); + }, + $signature: 12 + }; + A._pow_closure.prototype = { + call$1($arguments) { + var t1 = J.getInterceptor$asx($arguments); + return A.pow0(t1.$index($arguments, 0).assertNumber$1("base"), t1.$index($arguments, 1).assertNumber$1("exponent")); + }, + $signature: 12 + }; + A._atan2_closure.prototype = { + call$1($arguments) { + var t1 = J.getInterceptor$asx($arguments), + y = t1.$index($arguments, 0).assertNumber$1("y"); + return A.SassNumber_SassNumber$withUnits(Math.atan2(y._number$_value, t1.$index($arguments, 1).assertNumber$1("x").convertValueToMatch$3(y, "x", "y")) * 57.29577951308232, null, A._setArrayType(["deg"], type$.JSArray_String)); + }, + $signature: 12 + }; + A._compatible_closure.prototype = { + call$1($arguments) { + var t1 = J.getInterceptor$asx($arguments); + return t1.$index($arguments, 0).assertNumber$1("number1").isComparableTo$1(t1.$index($arguments, 1).assertNumber$1("number2")) ? B.SassBoolean_true : B.SassBoolean_false; + }, + $signature: 21 + }; + A._isUnitless_closure.prototype = { + call$1($arguments) { + return !J.$index$asx($arguments, 0).assertNumber$1("number").get$hasUnits() ? B.SassBoolean_true : B.SassBoolean_false; + }, + $signature: 21 + }; + A._unit_closure.prototype = { + call$1($arguments) { + return new A.SassString(J.$index$asx($arguments, 0).assertNumber$1("number").get$unitString(), true); + }, + $signature: 19 + }; + A._percentage_closure.prototype = { + call$1($arguments) { + var number = J.$index$asx($arguments, 0).assertNumber$1("number"); + number.assertNoUnits$1("number"); + return A.SassNumber_SassNumber(number._number$_value * 100, "%"); + }, + $signature: 12 + }; + A._randomFunction_closure.prototype = { + call$1($arguments) { + var limit, t2, t3, t4, limitScalar, + t1 = J.getInterceptor$asx($arguments); + if (J.$eq$(t1.$index($arguments, 0), B.C__SassNull)) + return A.SassNumber_SassNumber($.$get$_random0().nextDouble$0(), null); + limit = t1.$index($arguments, 0).assertNumber$1("limit"); + if (limit.get$hasUnits()) { + t1 = limit.toString$0(0); + t2 = limit.get$unitString(); + t3 = limit.get$unitString(); + t4 = limit.get$unitString(); + A.EvaluationContext_current().warn$2(0, string$.math_r + t1 + string$.x29x20in_a + t2 + ")) * 1" + t3 + string$.x0a_To_p + t4 + string$.x29x29__Mo, B.Deprecation_8WR); + } + limitScalar = limit.assertInt$1("limit"); + if (limitScalar < 1) + throw A.wrapException(A.SassScriptException$("$limit: Must be greater than 0, was " + limit.toString$0(0) + ".", null)); + return A.SassNumber_SassNumber($.$get$_random0().nextInt$1(limitScalar) + 1, null); + }, + $signature: 12 + }; + A._div_closure.prototype = { + call$1($arguments) { + var t1 = J.getInterceptor$asx($arguments), + number1 = t1.$index($arguments, 0), + number2 = t1.$index($arguments, 1); + if (!(number1 instanceof A.SassNumber) || !(number2 instanceof A.SassNumber)) { + t1 = A.EvaluationContext_current(); + t1.warn$2(0, string$.math_d, null); + } + return number1.dividedBy$1(number2); + }, + $signature: 6 + }; + A._singleArgumentMathFunc_closure.prototype = { + call$1($arguments) { + return this.mathFunc.call$1(J.$index$asx($arguments, 0).assertNumber$1("number")); + }, + $signature: 12 + }; + A._numberFunction_closure.prototype = { + call$1($arguments) { + var number = J.$index$asx($arguments, 0).assertNumber$1("number"), + t1 = this.transform.call$1(number._number$_value), + t2 = number.get$numeratorUnits(number); + return A.SassNumber_SassNumber$withUnits(t1, number.get$denominatorUnits(number), t2); + }, + $signature: 12 + }; + A.global_closure27.prototype = { + call$1($arguments) { + return $._features.contains$1(0, J.$index$asx($arguments, 0).assertString$1("feature")._string$_text) ? B.SassBoolean_true : B.SassBoolean_false; + }, + $signature: 21 + }; + A.global_closure28.prototype = { + call$1($arguments) { + return new A.SassString(A.serializeValue(J.get$first$ax($arguments), true, true), false); + }, + $signature: 19 + }; + A.global_closure29.prototype = { + call$1($arguments) { + var t1 = J.getInterceptor$asx($arguments), + _0_0 = t1.$index($arguments, 0); + $label0$0: { + if (_0_0 instanceof A.SassArgumentList) { + t1 = "arglist"; + break $label0$0; + } + if (_0_0 instanceof A.SassBoolean) { + t1 = "bool"; + break $label0$0; + } + if (_0_0 instanceof A.SassColor) { + t1 = "color"; + break $label0$0; + } + if (_0_0 instanceof A.SassList) { + t1 = "list"; + break $label0$0; + } + if (_0_0 instanceof A.SassMap) { + t1 = "map"; + break $label0$0; + } + if (B.C__SassNull === _0_0) { + t1 = "null"; + break $label0$0; + } + if (_0_0 instanceof A.SassNumber) { + t1 = "number"; + break $label0$0; + } + if (_0_0 instanceof A.SassFunction) { + t1 = "function"; + break $label0$0; + } + if (_0_0 instanceof A.SassMixin) { + t1 = "mixin"; + break $label0$0; + } + if (_0_0 instanceof A.SassCalculation) { + t1 = "calculation"; + break $label0$0; + } + if (_0_0 instanceof A.SassString) { + t1 = "string"; + break $label0$0; + } + t1 = A.throwExpression("[BUG] Unknown value type " + A.S(t1.$index($arguments, 0))); + } + return new A.SassString(t1, false); + }, + $signature: 19 + }; + A.global_closure30.prototype = { + call$1($arguments) { + var t2, t3, t4, + t1 = J.getInterceptor$asx($arguments), + _1_0 = t1.$index($arguments, 0); + if (_1_0 instanceof A.SassArgumentList) { + _1_0._wereKeywordsAccessed = true; + t1 = type$.Value; + t2 = A.LinkedHashMap_LinkedHashMap$_empty(t1, t1); + for (t3 = A.MapExtensions_get_pairs(_1_0._keywords, type$.String, t1), t3 = t3.get$iterator(t3); t3.moveNext$0();) { + t4 = t3.get$current(t3); + t2.$indexSet(0, new A.SassString(t4._0, false), t4._1); + } + return new A.SassMap(A.ConstantMap_ConstantMap$from(t2, t1, t1)); + } else + throw A.wrapException("$args: " + A.S(t1.$index($arguments, 0)) + " is not an argument list."); + }, + $signature: 34 + }; + A.local_closure.prototype = { + call$1($arguments) { + return new A.SassString(J.$index$asx($arguments, 0).assertCalculation$1("calc").name, true); + }, + $signature: 19 + }; + A.local_closure0.prototype = { + call$1($arguments) { + var t1 = J.$index$asx($arguments, 0).assertCalculation$1("calc").$arguments; + return A.SassList$(new A.MappedListIterable(t1, new A.local__closure(), A._arrayInstanceType(t1)._eval$1("MappedListIterable<1,Value>")), B.ListSeparator_rXA, false); + }, + $signature: 23 + }; + A.local__closure.prototype = { + call$1(argument) { + return argument instanceof A.Value ? argument : new A.SassString(J.toString$0$(argument), false); + }, + $signature: 372 + }; + A.local_closure1.prototype = { + call$1($arguments) { + var _0_2, acceptsContent, _0_2_isSet, t1, _0_5, _0_5_isSet, hasContent, + mixin = J.$index$asx($arguments, 0).assertMixin$1("mixin"), + _0_0 = mixin.callable; + $label0$0: { + if (type$.AsyncBuiltInCallable._is(_0_0)) { + _0_2 = _0_0.get$acceptsContent(); + acceptsContent = _0_2; + _0_2_isSet = true; + t1 = true; + } else { + _0_2 = null; + _0_2_isSet = false; + acceptsContent = null; + t1 = false; + } + if (!t1) + if (_0_0 instanceof A.BuiltInCallable) { + acceptsContent = _0_2_isSet ? _0_2 : _0_0.acceptsContent; + t1 = true; + } else + t1 = false; + else + t1 = true; + if (t1) { + t1 = acceptsContent; + break $label0$0; + } + if (_0_0 instanceof A.UserDefinedCallable) { + _0_5 = _0_0.declaration; + t1 = _0_5 instanceof A.MixinRule; + _0_5_isSet = true; + } else { + _0_5 = null; + _0_5_isSet = false; + t1 = false; + } + if (t1) { + t1 = _0_5_isSet ? _0_5 : _0_0.declaration; + hasContent = type$.MixinRule._as(t1).get$hasContent(); + t1 = hasContent; + break $label0$0; + } + t1 = A.throwExpression(A.UnsupportedError$("Unknown callable type " + mixin.toString$0(0) + ".")); + } + return t1 ? B.SassBoolean_true : B.SassBoolean_false; + }, + $signature: 21 + }; + A._nest_closure.prototype = { + call$1($arguments) { + var t1 = {}, + selectors = J.$index$asx($arguments, 0).get$asList(); + if (selectors.length === 0) + throw A.wrapException(A.SassScriptException$(string$.x24selec, null)); + t1.first = true; + return new A.MappedListIterable(selectors, new A._nest__closure(t1), A._arrayInstanceType(selectors)._eval$1("MappedListIterable<1,SelectorList>")).reduce$1(0, new A._nest__closure0()).get$asSassList(); + }, + $signature: 23 + }; + A._nest__closure.prototype = { + call$1(selector) { + var t1 = this._box_0, + result = A.SassApiValue_assertSelector(selector, !t1.first, null); + t1.first = false; + return result; + }, + $signature: 141 + }; + A._nest__closure0.prototype = { + call$2($parent, child) { + return child.resolveParentSelectors$1($parent); + }, + $signature: 142 + }; + A._append_closure.prototype = { + call$1($arguments) { + var selectors = J.$index$asx($arguments, 0).get$asList(); + if (selectors.length === 0) + throw A.wrapException(A.SassScriptException$(string$.x24selec, null)); + return new A.MappedListIterable(selectors, new A._append__closure(), A._arrayInstanceType(selectors)._eval$1("MappedListIterable<1,SelectorList>")).reduce$1(0, new A._append__closure0(A.EvaluationContext_current().get$currentCallableSpan())).get$asSassList(); + }, + $signature: 23 + }; + A._append__closure.prototype = { + call$1(selector) { + return A.SassApiValue_assertSelector(selector, false, null); + }, + $signature: 141 + }; + A._append__closure0.prototype = { + call$2($parent, child) { + var t1 = child.components, + t2 = this.span; + return A.SelectorList$(new A.MappedListIterable(t1, new A._append___closure($parent, t2), A._arrayInstanceType(t1)._eval$1("MappedListIterable<1,ComplexSelector>")), t2).resolveParentSelectors$1($parent); + }, + $signature: 142 + }; + A._append___closure.prototype = { + call$1(complex) { + var _0_0, component, rest, t1, newCompound, t2, _null = null; + if (complex.leadingCombinators.length !== 0) + throw A.wrapException(A.SassScriptException$("Can't append " + complex.toString$0(0) + " to " + this.parent.toString$0(0) + ".", _null)); + _0_0 = complex.components; + if (_0_0.length >= 1) { + component = _0_0[0]; + rest = B.JSArray_methods.sublist$1(_0_0, 1); + t1 = true; + } else { + rest = _null; + component = rest; + t1 = false; + } + if (!t1) + throw A.wrapException(A.StateError$("Pattern matching error")); + newCompound = A._prependParent(component.selector); + if (newCompound == null) + throw A.wrapException(A.SassScriptException$("Can't append " + complex.toString$0(0) + " to " + this.parent.toString$0(0) + ".", _null)); + t1 = this.span; + t2 = A._setArrayType([new A.ComplexSelectorComponent(newCompound, A.List_List$unmodifiable(component.combinators, type$.CssValue_Combinator), t1)], type$.JSArray_ComplexSelectorComponent); + B.JSArray_methods.addAll$1(t2, rest); + return A.ComplexSelector$(B.List_empty1, t2, t1, false); + }, + $signature: 62 + }; + A._extend_closure.prototype = { + call$1($arguments) { + var target, source, + _s8_ = "selector", + _s8_0 = "extendee", + _s8_1 = "extender", + t1 = J.getInterceptor$asx($arguments), + selector = A.SassApiValue_assertSelector(t1.$index($arguments, 0), false, _s8_); + selector.assertNotBogus$1$name(_s8_); + target = A.SassApiValue_assertSelector(t1.$index($arguments, 1), false, _s8_0); + target.assertNotBogus$1$name(_s8_0); + source = A.SassApiValue_assertSelector(t1.$index($arguments, 2), false, _s8_1); + source.assertNotBogus$1$name(_s8_1); + return A.ExtensionStore__extendOrReplace(selector, source, target, B.ExtendMode_allTargets_allTargets, A.EvaluationContext_current().get$currentCallableSpan()).get$asSassList(); + }, + $signature: 23 + }; + A._replace_closure.prototype = { + call$1($arguments) { + var target, source, + _s8_ = "selector", + _s8_0 = "original", + _s11_ = "replacement", + t1 = J.getInterceptor$asx($arguments), + selector = A.SassApiValue_assertSelector(t1.$index($arguments, 0), false, _s8_); + selector.assertNotBogus$1$name(_s8_); + target = A.SassApiValue_assertSelector(t1.$index($arguments, 1), false, _s8_0); + target.assertNotBogus$1$name(_s8_0); + source = A.SassApiValue_assertSelector(t1.$index($arguments, 2), false, _s11_); + source.assertNotBogus$1$name(_s11_); + return A.ExtensionStore__extendOrReplace(selector, source, target, B.ExtendMode_replace_replace, A.EvaluationContext_current().get$currentCallableSpan()).get$asSassList(); + }, + $signature: 23 + }; + A._unify_closure.prototype = { + call$1($arguments) { + var selector2, + _s9_ = "selector1", + _s9_0 = "selector2", + t1 = J.getInterceptor$asx($arguments), + selector1 = A.SassApiValue_assertSelector(t1.$index($arguments, 0), false, _s9_); + selector1.assertNotBogus$1$name(_s9_); + selector2 = A.SassApiValue_assertSelector(t1.$index($arguments, 1), false, _s9_0); + selector2.assertNotBogus$1$name(_s9_0); + t1 = selector1.unify$1(selector2); + t1 = t1 == null ? null : t1.get$asSassList(); + return t1 == null ? B.C__SassNull : t1; + }, + $signature: 6 + }; + A._isSuperselector_closure.prototype = { + call$1($arguments) { + var selector2, + t1 = J.getInterceptor$asx($arguments), + selector1 = A.SassApiValue_assertSelector(t1.$index($arguments, 0), false, "super"); + selector1.assertNotBogus$1$name("super"); + selector2 = A.SassApiValue_assertSelector(t1.$index($arguments, 1), false, "sub"); + selector2.assertNotBogus$1$name("sub"); + return A.listIsSuperselector(selector1.components, selector2.components) ? B.SassBoolean_true : B.SassBoolean_false; + }, + $signature: 21 + }; + A._simpleSelectors_closure.prototype = { + call$1($arguments) { + var t1 = A.SassApiValue_assertCompoundSelector(J.$index$asx($arguments, 0), "selector").components; + return A.SassList$(new A.MappedListIterable(t1, new A._simpleSelectors__closure(), A._arrayInstanceType(t1)._eval$1("MappedListIterable<1,Value>")), B.ListSeparator_rXA, false); + }, + $signature: 23 + }; + A._simpleSelectors__closure.prototype = { + call$1(simple) { + return new A.SassString(A.serializeSelector(simple, true), false); + }, + $signature: 363 + }; + A._parse_closure.prototype = { + call$1($arguments) { + return A.SassApiValue_assertSelector(J.$index$asx($arguments, 0), false, "selector").get$asSassList(); + }, + $signature: 23 + }; + A.module_closure.prototype = { + call$1($arguments) { + var limit, t2, chunks, i, lastEnd, match, t3, + t1 = J.getInterceptor$asx($arguments), + string = t1.$index($arguments, 0).assertString$1("string"), + separator = t1.$index($arguments, 1).assertString$1("separator"); + t1 = t1.$index($arguments, 2).get$realNull(); + limit = t1 == null ? null : t1.assertNumber$1("limit").assertInt$1("limit"); + if (limit != null && limit < 1) + throw A.wrapException(A.SassScriptException$("$limit: Must be 1 or greater, was " + A.S(limit) + ".", null)); + t1 = string._string$_text; + if (t1.length === 0) + return B.SassList_Sof0; + else { + t2 = separator._string$_text; + if (t2.length === 0) + return A.SassList$(A.MappedIterable_MappedIterable(new A.Runes(t1), new A.module__closure(string), type$.Runes._eval$1("Iterable.E"), type$.Value), B.ListSeparator_rXA, true); + } + chunks = A._setArrayType([], type$.JSArray_String); + for (t2 = B.JSString_methods.allMatches$1(t2, t1), t2 = new A._StringAllMatchesIterator(t2._input, t2._pattern, t2.__js_helper$_index), i = 0, lastEnd = 0; t2.moveNext$0();) { + match = t2.__js_helper$_current; + t3 = match.start; + chunks.push(B.JSString_methods.substring$2(t1, lastEnd, t3)); + lastEnd = t3 + match.pattern.length; + ++i; + if (i === limit) + break; + } + chunks.push(B.JSString_methods.substring$1(t1, lastEnd)); + return A.SassList$(new A.MappedListIterable(chunks, new A.module__closure0(string), type$.MappedListIterable_String_Value), B.ListSeparator_rXA, true); + }, + $signature: 23 + }; + A.module__closure.prototype = { + call$1(rune) { + return new A.SassString(A.Primitives_stringFromCharCode(rune), this.string._hasQuotes); + }, + $signature: 362 + }; + A.module__closure0.prototype = { + call$1(chunk) { + return new A.SassString(chunk, this.string._hasQuotes); + }, + $signature: 361 + }; + A._unquote_closure.prototype = { + call$1($arguments) { + var string = J.$index$asx($arguments, 0).assertString$1("string"); + if (!string._hasQuotes) + return string; + return new A.SassString(string._string$_text, false); + }, + $signature: 19 + }; + A._quote_closure.prototype = { + call$1($arguments) { + var string = J.$index$asx($arguments, 0).assertString$1("string"); + if (string._hasQuotes) + return string; + return new A.SassString(string._string$_text, true); + }, + $signature: 19 + }; + A._length_closure.prototype = { + call$1($arguments) { + return A.SassNumber_SassNumber(J.$index$asx($arguments, 0).assertString$1("string").get$_sassLength(), null); + }, + $signature: 12 + }; + A._insert_closure.prototype = { + call$1($arguments) { + var indexInt, codeUnitIndex, _s5_ = "index", + t1 = J.getInterceptor$asx($arguments), + string = t1.$index($arguments, 0).assertString$1("string"), + insert = t1.$index($arguments, 1).assertString$1("insert"), + index = t1.$index($arguments, 2).assertNumber$1(_s5_); + index.assertNoUnits$1(_s5_); + indexInt = index.assertInt$1(_s5_); + if (indexInt < 0) + indexInt = Math.max(string.get$_sassLength() + indexInt + 2, 0); + t1 = string._string$_text; + codeUnitIndex = A.codepointIndexToCodeUnitIndex(t1, A._codepointForIndex(indexInt, string.get$_sassLength(), false)); + return new A.SassString(B.JSString_methods.replaceRange$3(t1, codeUnitIndex, codeUnitIndex, insert._string$_text), string._hasQuotes); + }, + $signature: 19 + }; + A._index_closure.prototype = { + call$1($arguments) { + var t1 = J.getInterceptor$asx($arguments), + t2 = t1.$index($arguments, 0).assertString$1("string")._string$_text, + codeUnitIndex = B.JSString_methods.indexOf$1(t2, t1.$index($arguments, 1).assertString$1("substring")._string$_text); + if (codeUnitIndex === -1) + return B.C__SassNull; + return A.SassNumber_SassNumber(A.codeUnitIndexToCodepointIndex(t2, codeUnitIndex) + 1, null); + }, + $signature: 6 + }; + A._slice_closure.prototype = { + call$1($arguments) { + var lengthInCodepoints, endInt, startCodepoint, endCodepoint, + _s8_ = "start-at", + t1 = J.getInterceptor$asx($arguments), + string = t1.$index($arguments, 0).assertString$1("string"), + start = t1.$index($arguments, 1).assertNumber$1(_s8_), + end = t1.$index($arguments, 2).assertNumber$1("end-at"); + start.assertNoUnits$1(_s8_); + end.assertNoUnits$1("end-at"); + lengthInCodepoints = string.get$_sassLength(); + endInt = end.assertInt$0(); + if (endInt === 0) + return string._hasQuotes ? $.$get$_emptyQuoted() : $.$get$_emptyUnquoted(); + startCodepoint = A._codepointForIndex(start.assertInt$0(), lengthInCodepoints, false); + endCodepoint = A._codepointForIndex(endInt, lengthInCodepoints, true); + if (endCodepoint === lengthInCodepoints) + --endCodepoint; + if (endCodepoint < startCodepoint) + return string._hasQuotes ? $.$get$_emptyQuoted() : $.$get$_emptyUnquoted(); + t1 = string._string$_text; + return new A.SassString(B.JSString_methods.substring$2(t1, A.codepointIndexToCodeUnitIndex(t1, startCodepoint), A.codepointIndexToCodeUnitIndex(t1, endCodepoint + 1)), string._hasQuotes); + }, + $signature: 19 + }; + A._toUpperCase_closure.prototype = { + call$1($arguments) { + var t1, t2, i, t3, t4, + string = J.$index$asx($arguments, 0).assertString$1("string"); + for (t1 = string._string$_text, t2 = t1.length, i = 0, t3 = ""; i < t2; ++i) { + t4 = t1.charCodeAt(i); + t3 += A.Primitives_stringFromCharCode(t4 >= 97 && t4 <= 122 ? t4 & 4294967263 : t4); + } + return new A.SassString(t3.charCodeAt(0) == 0 ? t3 : t3, string._hasQuotes); + }, + $signature: 19 + }; + A._toLowerCase_closure.prototype = { + call$1($arguments) { + var t1, t2, i, t3, t4, + string = J.$index$asx($arguments, 0).assertString$1("string"); + for (t1 = string._string$_text, t2 = t1.length, i = 0, t3 = ""; i < t2; ++i) { + t4 = t1.charCodeAt(i); + t3 += A.Primitives_stringFromCharCode(t4 >= 65 && t4 <= 90 ? t4 | 32 : t4); + } + return new A.SassString(t3.charCodeAt(0) == 0 ? t3 : t3, string._hasQuotes); + }, + $signature: 19 + }; + A._uniqueId_closure.prototype = { + call$1($arguments) { + var t1 = $.$get$_previousUniqueId() + ($.$get$_random().nextInt$1(36) + 1); + $._previousUniqueId = t1; + if (t1 > Math.pow(36, 6)) + $._previousUniqueId = B.JSInt_methods.$mod($.$get$_previousUniqueId(), A._asInt(Math.pow(36, 6))); + return new A.SassString("u" + B.JSString_methods.padLeft$2(B.JSInt_methods.toRadixString$1($.$get$_previousUniqueId(), 36), 6, "0"), false); + }, + $signature: 19 + }; + A.ImportCache.prototype = { + canonicalize$4$baseImporter$baseUrl$forImport(_, url, baseImporter, baseUrl, forImport) { + var t1, relativeResult, _this = this; + if (A.isBrowser()) + t1 = (baseImporter == null || baseImporter instanceof A.NoOpImporter) && _this._importers.length === 0; + else + t1 = false; + if (t1) + throw A.wrapException(string$.Custom); + if (baseImporter != null && url.get$scheme() === "") { + relativeResult = _this._relativeCanonicalizeCache.putIfAbsent$2(new A._Record_4_baseImporter_baseUrl_forImport([url, baseImporter, baseUrl, forImport]), new A.ImportCache_canonicalize_closure(_this, baseImporter, baseUrl, url, forImport)); + if (relativeResult != null) + return relativeResult; + } + return _this._canonicalizeCache.putIfAbsent$2(new A._Record_2_forImport(url, forImport), new A.ImportCache_canonicalize_closure0(_this, url, baseUrl, forImport)); + }, + canonicalize$3$baseImporter$baseUrl(_, url, baseImporter, baseUrl) { + return this.canonicalize$4$baseImporter$baseUrl$forImport(0, url, baseImporter, baseUrl, false); + }, + _canonicalize$4(importer, url, baseUrl, forImport) { + var passContainingUrl, t1, result, _null = null, + canonicalize = forImport ? new A.ImportCache__canonicalize_closure(importer, url) : new A.ImportCache__canonicalize_closure0(importer, url); + if (baseUrl != null) + passContainingUrl = url.get$scheme() === "" || importer.isNonCanonicalScheme$1(url.get$scheme()); + else + passContainingUrl = false; + t1 = passContainingUrl ? baseUrl : _null; + result = A.withContainingUrl(t1, canonicalize, type$.nullable_Uri); + if (result == null) + return _null; + if (result.get$scheme() === "") + A.WarnForDeprecation_warnForDeprecation(this._logger, B.Deprecation_mFp, "Importer " + importer.toString$0(0) + " canonicalized " + url.toString$0(0) + " to " + result.toString$0(0) + string$.x2e_Rela, _null, _null); + else if (importer.isNonCanonicalScheme$1(result.get$scheme())) + throw A.wrapException("Importer " + importer.toString$0(0) + " canonicalized " + url.toString$0(0) + " to " + result.toString$0(0) + string$.x2c_whicu); + return new A._Record_3_originalUrl(importer, result, url); + }, + importCanonical$4$originalUrl$quiet(importer, canonicalUrl, originalUrl, quiet) { + return this._importCache.putIfAbsent$2(canonicalUrl, new A.ImportCache_importCanonical_closure(this, importer, canonicalUrl, originalUrl, quiet)); + }, + importCanonical$3$originalUrl(importer, canonicalUrl, originalUrl) { + return this.importCanonical$4$originalUrl$quiet(importer, canonicalUrl, originalUrl, false); + }, + importCanonical$2(importer, canonicalUrl) { + return this.importCanonical$4$originalUrl$quiet(importer, canonicalUrl, null, false); + }, + humanize$1(canonicalUrl) { + var t1 = A.IterableNullableExtension_whereNotNull(this._canonicalizeCache.get$values(0), type$.Record_3_Importer_and_Uri_and_Uri_originalUrl), + t2 = t1.$ti; + t2 = A.NullableExtension_andThen(A.minBy(new A.MappedIterable(new A.WhereIterable(t1, new A.ImportCache_humanize_closure(canonicalUrl), t2._eval$1("WhereIterable")), new A.ImportCache_humanize_closure0(), t2._eval$1("MappedIterable")), new A.ImportCache_humanize_closure1()), new A.ImportCache_humanize_closure2(canonicalUrl)); + return t2 == null ? canonicalUrl : t2; + }, + sourceMapUrl$1(_, canonicalUrl) { + var t1 = this._resultsCache.$index(0, canonicalUrl); + t1 = t1 == null ? null : t1.get$sourceMapUrl(0); + return t1 == null ? canonicalUrl : t1; + }, + clearCanonicalize$1(url) { + var t1 = this._canonicalizeCache; + t1.remove$1(0, new A._Record_2_forImport(url, false)); + t1.remove$1(0, new A._Record_2_forImport(url, true)); + this._relativeCanonicalizeCache.removeWhere$1(0, new A.ImportCache_clearCanonicalize_closure(url)); + }, + clearImport$1(canonicalUrl) { + this._resultsCache.remove$1(0, canonicalUrl); + this._importCache.remove$1(0, canonicalUrl); + } + }; + A.ImportCache_canonicalize_closure.prototype = { + call$0() { + var _this = this, + t1 = _this.baseUrl, + t2 = t1 == null ? null : t1.resolveUri$1(_this.url); + if (t2 == null) + t2 = _this.url; + return _this.$this._canonicalize$4(_this.baseImporter, t2, t1, _this.forImport); + }, + $signature: 111 + }; + A.ImportCache_canonicalize_closure0.prototype = { + call$0() { + var t1, t2, t3, t4, t5, t6, _i, _0_0, _this = this; + for (t1 = _this.$this, t2 = t1._importers, t3 = t2.length, t4 = _this.url, t5 = _this.baseUrl, t6 = _this.forImport, _i = 0; _i < t2.length; t2.length === t3 || (0, A.throwConcurrentModificationError)(t2), ++_i) { + _0_0 = t1._canonicalize$4(t2[_i], t4, t5, t6); + if (_0_0 != null) + return _0_0; + } + return null; + }, + $signature: 111 + }; + A.ImportCache__canonicalize_closure.prototype = { + call$0() { + var t1 = type$.nullable_Object; + return A.runZoned(new A.ImportCache__canonicalize__closure(this.importer, this.resolved), A.LinkedHashMap_LinkedHashMap$_literal([B.Symbol__inImportRule, true], t1, t1), type$.nullable_Uri); + }, + $signature: 55 + }; + A.ImportCache__canonicalize__closure.prototype = { + call$0() { + return this.importer.canonicalize$1(0, this.resolved); + }, + $signature: 55 + }; + A.ImportCache__canonicalize_closure0.prototype = { + call$0() { + return this.importer.canonicalize$1(0, this.resolved); + }, + $signature: 55 + }; + A.ImportCache_importCanonical_closure.prototype = { + call$0() { + var t2, t3, t4, t5, _this = this, + t1 = _this.canonicalUrl, + result = _this.importer.load$1(0, t1); + if (result == null) + return null; + t2 = _this.$this; + t2._resultsCache.$indexSet(0, t1, result); + t3 = result.contents; + t4 = result.syntax; + t5 = _this.originalUrl; + t1 = t5 == null ? t1 : t5.resolveUri$1(t1); + return A.Stylesheet_Stylesheet$parse(t3, t4, _this.quiet ? $.$get$Logger_quiet() : t2._logger, t1); + }, + $signature: 91 + }; + A.ImportCache_humanize_closure.prototype = { + call$1(result) { + return J.$eq$(result._1, this.canonicalUrl); + }, + $signature: 360 + }; + A.ImportCache_humanize_closure0.prototype = { + call$1(result) { + return result._2; + }, + $signature: 355 + }; + A.ImportCache_humanize_closure1.prototype = { + call$1(url) { + return url.get$path(url).length; + }, + $signature: 107 + }; + A.ImportCache_humanize_closure2.prototype = { + call$1(url) { + var t1 = $.$get$url(), + t2 = this.canonicalUrl; + return url.resolve$1(0, A.ParsedPath_ParsedPath$parse(t2.get$path(t2), t1.style).get$basename()); + }, + $signature: 44 + }; + A.ImportCache_clearCanonicalize_closure.prototype = { + call$2(key, _) { + return J.$eq$(key._values[0], this.url); + }, + $signature: 354 + }; + A.Importer.prototype = { + modificationTime$1(url) { + return new A.DateTime(Date.now(), false); + }, + couldCanonicalize$2(url, canonicalUrl) { + return true; + }, + isNonCanonicalScheme$1(scheme) { + return false; + } + }; + A.AsyncImporter.prototype = {}; + A.FilesystemImporter.prototype = { + canonicalize$1(_, url) { + if (url.get$scheme() !== "file" && url.get$scheme() !== "") + return null; + return A.NullableExtension_andThen(A.resolveImportPath(A.join(this._loadPath, $.$get$context().style.pathFromUri$1(A._parseUri(url)), null)), new A.FilesystemImporter_canonicalize_closure()); + }, + load$1(_, url) { + var path = $.$get$context().style.pathFromUri$1(A._parseUri(url)), + t1 = A.readFile(path), + t2 = A.Syntax_forPath(path), + t3 = url.get$scheme(); + if (t3 === "") + A.throwExpression(A.ArgumentError$value(url, "sourceMapUrl", "must be absolute")); + return new A.ImporterResult(t1, url, t2); + }, + modificationTime$1(url) { + return A.modificationTime($.$get$context().style.pathFromUri$1(A._parseUri(url))); + }, + couldCanonicalize$2(url, canonicalUrl) { + var t1, t2, basename, canonicalBasename; + if (url.get$scheme() !== "file" && url.get$scheme() !== "") + return false; + if (canonicalUrl.get$scheme() !== "file") + return false; + t1 = $.$get$url(); + t2 = t1.style; + basename = A.ParsedPath_ParsedPath$parse(url.get$path(url), t2).get$basename(); + canonicalBasename = A.ParsedPath_ParsedPath$parse(canonicalUrl.get$path(canonicalUrl), t2).get$basename(); + if (!B.JSString_methods.startsWith$1(basename, "_") && B.JSString_methods.startsWith$1(canonicalBasename, "_")) + canonicalBasename = B.JSString_methods.substring$1(canonicalBasename, 1); + return basename === canonicalBasename || basename === t1.withoutExtension$1(canonicalBasename); + }, + toString$0(_) { + return this._loadPath; + } + }; + A.FilesystemImporter_canonicalize_closure.prototype = { + call$1(resolved) { + var t2, t0, _null = null, + t1 = A.isNodeJs() ? self.process : _null; + if (!J.$eq$(t1 == null ? _null : J.get$platform$x(t1), "win32")) { + t1 = A.isNodeJs() ? self.process : _null; + t1 = J.$eq$(t1 == null ? _null : J.get$platform$x(t1), "darwin"); + } else + t1 = true; + if (t1) { + t1 = $.$get$context(); + t2 = A._realCasePath(A.absolute(t1.normalize$1(resolved), _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null)); + t0 = t2; + t2 = t1; + t1 = t0; + } else { + t1 = $.$get$context(); + t2 = t1.canonicalize$1(0, resolved); + t0 = t2; + t2 = t1; + t1 = t0; + } + return t2.toUri$1(t1); + }, + $signature: 152 + }; + A.NoOpImporter.prototype = {}; + A.NodePackageImporter.prototype = { + isNonCanonicalScheme$1(scheme) { + return scheme === "pkg"; + }, + canonicalize$1(_, url) { + var packageName, jsonPath, jsonString, packageManifest, e, t1, t2, t3, t4, baseDirectory, parts, t5, $name, subpath, packageRoot, exception, _1_0, rootPath, subpathInRoot, _this = this, _null = null; + if (url.get$scheme() === "file") + return $.$get$FilesystemImporter_cwd().canonicalize$1(0, url); + if (url.get$scheme() !== "pkg") + return _null; + if (url.get$hasAuthority()) + throw A.wrapException(string$.A_pkg_h); + else { + t1 = $.$get$url(); + t2 = t1.style; + if (t2.rootLength$1(url.get$path(url)) > 0) + throw A.wrapException("A pkg: URL's path must not begin with /."); + else if (url.get$path(url).length === 0) + throw A.wrapException("A pkg: URL must not have an empty path."); + else if (url.get$hasQuery() || url.get$hasFragment()) + throw A.wrapException(string$.A_pkg_q); + } + t3 = A.containingUrl(); + if ((t3 == null ? _null : t3.get$scheme()) === "file") { + t3 = A.containingUrl(); + t3.toString; + t4 = $.$get$context(); + baseDirectory = t4.dirname$1(t4.style.pathFromUri$1(A._parseUri(t3))); + } else { + t3 = _this.__NodePackageImporter__entryPointDirectory_F; + t3 === $ && A.throwUnnamedLateFieldNI(); + baseDirectory = t3; + } + packageName = null; + parts = t1.split$1(0, url.get$path(url)); + t3 = B.JSArray_methods.removeAt$1(parts, 0); + t4 = $.$get$context(); + t3.toString; + t5 = t4.style; + $name = t5.pathFromUri$1(A._parseUri(t3)); + if (B.JSString_methods.startsWith$1($name, "@")) + $name = parts.length !== 0 ? t1.join$2(0, $name, B.JSArray_methods.removeAt$1(parts, 0)) : $name; + subpath = parts.length !== 0 ? t5.pathFromUri$1(A._parseUri(t1.joinAll$1(parts))) : _null; + packageName = $name; + if (!J.startsWith$1$s(packageName, ".")) + if (!J.contains$1$asx(packageName, "\\")) + if (!J.contains$1$asx(packageName, "%")) + t1 = J.startsWith$1$s(packageName, "@") && !J.contains$1$asx(packageName, t2.get$separator(t2)); + else + t1 = true; + else + t1 = true; + else + t1 = true; + if (t1) + return _null; + packageRoot = _this._resolvePackageRoot$2(packageName, baseDirectory); + if (packageRoot == null) + return _null; + jsonPath = A.join(packageRoot, "package.json", _null); + jsonString = A.readFile(jsonPath); + packageManifest = null; + try { + packageManifest = type$.Map_String_dynamic._as(B.C_JsonCodec.decode$1(jsonString)); + } catch (exception) { + e = A.unwrapException(exception); + t1 = A.S(jsonPath); + t2 = A.S(packageName); + t3 = A.S(e); + throw A.wrapException("Failed to parse " + t1 + ' for "pkg:' + t2 + '": ' + t3); + } + _1_0 = _this._resolvePackageExports$4(packageRoot, subpath, packageManifest, packageName); + if (_1_0 != null) + if (B.Set_HW1We.contains$1(0, A.ParsedPath_ParsedPath$parse(_1_0, t5)._splitExtension$1(1)[1])) + return t4.toUri$1(t4.canonicalize$1(0, _1_0)); + else { + t1 = subpath == null ? "root" : subpath; + throw A.wrapException("The export for '" + t1 + "' in '" + A.S(packageName) + "' resolved to '" + _1_0 + string$.x27x2c_whi); + } + if (subpath == null) { + rootPath = _this._resolvePackageRootValues$2(packageRoot, packageManifest); + return rootPath != null ? t4.toUri$1(t4.canonicalize$1(0, rootPath)) : _null; + } + subpathInRoot = A.join(packageRoot, subpath, _null); + return $.$get$FilesystemImporter_cwd().canonicalize$1(0, t4.toUri$1(subpathInRoot)); + }, + load$1(_, url) { + return $.$get$FilesystemImporter_cwd().load$1(0, url); + }, + _resolvePackageRoot$2(packageName, baseDirectory) { + var potentialPackage, t1; + for (; true;) { + potentialPackage = A.join(baseDirectory, "node_modules", packageName); + if (A.dirExists(potentialPackage)) + return potentialPackage; + t1 = $.$get$context(); + if (t1.split$1(0, baseDirectory).length === 1) + return null; + baseDirectory = t1.dirname$1(baseDirectory); + } + }, + _resolvePackageRootValues$2(packageRoot, packageManifest) { + var t1, sassValue, _1_0, styleValue, _null = null, + _0_0 = packageManifest.$index(0, "sass"); + if (typeof _0_0 == "string") { + t1 = B.Set_HW1We.contains$1(0, A.ParsedPath_ParsedPath$parse(_0_0, $.$get$url().style)._splitExtension$1(1)[1]); + sassValue = _0_0; + } else { + sassValue = _null; + t1 = false; + } + if (t1) + return A.join(packageRoot, sassValue, _null); + else { + _1_0 = packageManifest.$index(0, "style"); + if (typeof _1_0 == "string") { + t1 = B.Set_HW1We.contains$1(0, A.ParsedPath_ParsedPath$parse(_1_0, $.$get$url().style)._splitExtension$1(1)[1]); + styleValue = _1_0; + } else { + styleValue = _null; + t1 = false; + } + if (t1) + return A.join(packageRoot, styleValue, _null); + } + return A.resolveImportPath(A.join(packageRoot, "index", _null)); + }, + _resolvePackageExports$4(packageRoot, subpath, packageManifest, packageName) { + var _0_0, _1_0, _this = this, + exports = packageManifest.$index(0, "exports"); + if (exports == null) + return null; + _0_0 = _this._nodePackageExportsResolve$5(packageRoot, _this._exportsToCheck$1(subpath), exports, subpath, packageName); + if (_0_0 != null) + return _0_0; + if (subpath != null && A.ParsedPath_ParsedPath$parse(subpath, $.$get$url().style)._splitExtension$1(1)[1].length !== 0) + return null; + _1_0 = _this._nodePackageExportsResolve$5(packageRoot, _this._exportsToCheck$2$addIndex(subpath, true), exports, subpath, packageName); + if (_1_0 != null) + return _1_0; + return null; + }, + _nodePackageExportsResolve$5(packageRoot, subpathVariants, exports, subpath, packageName) { + var t1, matches, _1_1, path; + if (type$.Map_String_dynamic._is(exports) && J.any$1$ax(exports.get$keys(exports), new A.NodePackageImporter__nodePackageExportsResolve_closure()) && J.any$1$ax(exports.get$keys(exports), new A.NodePackageImporter__nodePackageExportsResolve_closure0())) + throw A.wrapException("`exports` in " + packageName + string$.x20can_n + J.map$1$1$ax(J.get$keys$z(exports), new A.NodePackageImporter__nodePackageExportsResolve_closure1(), type$.String).join$1(0, ",") + " in " + A.join(packageRoot, "package.json", null) + "."); + t1 = A.IterableNullableExtension_whereNotNull(new A.MappedListIterable(subpathVariants, new A.NodePackageImporter__nodePackageExportsResolve_closure2(this, exports, packageRoot), A._arrayInstanceType(subpathVariants)._eval$1("MappedListIterable<1,String?>")), type$.String); + matches = A.List_List$of(t1, true, t1.$ti._eval$1("Iterable.E")); + $label0$1: { + _1_1 = matches.length; + if (_1_1 === 1) { + path = matches[0]; + t1 = path; + break $label0$1; + } + if (_1_1 <= 0) { + t1 = null; + break $label0$1; + } + t1 = subpath == null ? "root" : subpath; + t1 = A.throwExpression(string$.Unable + t1 + " in " + packageName + " should be used. \n\nFound:\n" + B.JSArray_methods.join$1(matches, "\n")); + } + return t1; + }, + _compareExpansionKeys$2(keyA, keyB) { + var t1 = B.JSString_methods.contains$1(keyA, "*"), + baseLengthA = t1 ? B.JSString_methods.indexOf$1(keyA, "*") + 1 : keyA.length, + t2 = B.JSString_methods.contains$1(keyB, "*"), + baseLengthB = t2 ? B.JSString_methods.indexOf$1(keyB, "*") + 1 : keyB.length; + if (baseLengthA > baseLengthB) + return -1; + if (baseLengthB > baseLengthA) + return 1; + if (!t1) + return 1; + if (!t2) + return -1; + t1 = keyA.length; + t2 = keyB.length; + if (t1 > t2) + return -1; + if (t2 > t1) + return 1; + return 0; + }, + _packageTargetResolve$4(subpath, exports, packageRoot, patternMatch) { + var t2, string, path, map, key, value, _1_0, array, _2_0, _null = null, + t1 = typeof exports == "string"; + if (t1) { + t2 = !B.JSString_methods.startsWith$1(exports, "./"); + string = exports; + } else { + string = _null; + t2 = false; + } + if (t2) + throw A.wrapException("Export '" + A.S(string) + string$.x27x20must + packageRoot + "'."); + if (t1) { + t2 = patternMatch != null; + string = exports; + } else { + string = _null; + t2 = false; + } + if (t2) { + t1 = J.replaceFirst$2$s(string, "*", patternMatch); + t2 = $.$get$context(); + path = t2.normalize$1(A.join(packageRoot, t2.style.pathFromUri$1(A._parseUri(t1)), _null)); + return A.fileExists(path) ? path : _null; + } + if (t1) { + string = exports; + t1 = true; + } else { + string = _null; + t1 = false; + } + if (t1) { + t1 = $.$get$context(); + string.toString; + return A.join(packageRoot, t1.style.pathFromUri$1(A._parseUri(string)), _null); + } + if (type$.Map_String_dynamic._is(exports)) { + map = exports; + t1 = true; + } else { + map = _null; + t1 = false; + } + if (t1) { + for (t1 = A.MapExtensions_get_pairs(map, type$.String, type$.dynamic), t1 = t1.get$iterator(t1); t1.moveNext$0();) { + t2 = t1.get$current(t1); + key = t2._0; + value = t2._1; + if (!B.Set_gkcz.contains$1(0, key)) + continue; + if (value == null) + continue; + _1_0 = this._packageTargetResolve$4(subpath, value, packageRoot, patternMatch); + if (_1_0 != null) + return _1_0; + } + return _null; + } + if (type$.List_nullable_Object._is(exports) && J.get$length$asx(exports) <= 0) + return _null; + if (type$.List_dynamic._is(exports)) { + array = exports; + t1 = true; + } else { + array = _null; + t1 = false; + } + if (t1) { + for (t1 = J.get$iterator$ax(array); t1.moveNext$0();) { + value = t1.get$current(t1); + if (value == null) + continue; + _2_0 = this._packageTargetResolve$4(subpath, value, packageRoot, patternMatch); + if (_2_0 != null) + return _2_0; + } + return _null; + } + throw A.wrapException("Invalid 'exports' value " + A.S(exports) + " in " + A.join(packageRoot, "package.json", _null) + "."); + }, + _packageTargetResolve$3(subpath, exports, packageRoot) { + return this._packageTargetResolve$4(subpath, exports, packageRoot, null); + }, + _getMainExport$1(exports) { + var t1, t2, map, _0_4, _0_4_isSet, $export; + $label0$0: { + if (typeof exports == "string") { + t1 = exports; + break $label0$0; + } + if (type$.List_String._is(exports)) { + t1 = exports; + break $label0$0; + } + t1 = type$.Map_String_dynamic._is(exports); + if (t1) { + t2 = !J.any$1$ax(exports.get$keys(exports), new A.NodePackageImporter__getMainExport_closure()); + map = exports; + } else { + map = null; + t2 = false; + } + if (t2) { + t1 = map; + break $label0$0; + } + if (t1) { + _0_4 = exports.$index(0, "."); + t1 = _0_4 == null; + if (t1) + t2 = exports.containsKey$1("."); + else + t2 = true; + if (t2) + t1 = !t1; + else + t1 = false; + _0_4_isSet = true; + } else { + _0_4 = null; + _0_4_isSet = false; + t1 = false; + } + if (t1) { + $export = _0_4_isSet ? _0_4 : J.$index$asx(exports, "."); + t1 = $export; + break $label0$0; + } + t1 = null; + break $label0$0; + } + return t1; + }, + _exportsToCheck$2$addIndex(subpath, addIndex) { + var basename, dirname, t3, t4, _i, path, + t1 = type$.JSArray_String, + paths = A._setArrayType([], t1), + t2 = subpath == null; + if (t2 && addIndex) + subpath = "index"; + else if (!t2 && addIndex) + subpath = A.join(subpath, "index", null); + if (subpath == null) + return A._setArrayType([null], type$.JSArray_nullable_String); + if (B.Set_HW1We.contains$1(0, A.ParsedPath_ParsedPath$parse(subpath, $.$get$url().style)._splitExtension$1(1)[1])) + paths.push(subpath); + else + B.JSArray_methods.addAll$1(paths, A._setArrayType([subpath, subpath + ".scss", subpath + ".sass", subpath + ".css"], t1)); + t1 = $.$get$context(); + t2 = t1.style; + basename = A.ParsedPath_ParsedPath$parse(subpath, t2).get$basename(); + dirname = t1.dirname$1(subpath); + if (B.JSString_methods.startsWith$1(basename, "_")) + return paths; + t1 = A.List_List$of(paths, true, type$.nullable_String); + for (t3 = paths.length, t4 = dirname === ".", _i = 0; _i < paths.length; paths.length === t3 || (0, A.throwConcurrentModificationError)(paths), ++_i) { + path = paths[_i]; + if (t4) + t1.push("_" + A.ParsedPath_ParsedPath$parse(path, t2).get$basename()); + else + t1.push(A.join(dirname, "_" + A.ParsedPath_ParsedPath$parse(path, t2).get$basename(), null)); + } + return t1; + }, + _exportsToCheck$1(subpath) { + return this._exportsToCheck$2$addIndex(subpath, false); + } + }; + A.NodePackageImporter__nodePackageExportsResolve_closure.prototype = { + call$1(key) { + return B.JSString_methods.startsWith$1(key, "."); + }, + $signature: 4 + }; + A.NodePackageImporter__nodePackageExportsResolve_closure0.prototype = { + call$1(key) { + return !B.JSString_methods.startsWith$1(key, "."); + }, + $signature: 4 + }; + A.NodePackageImporter__nodePackageExportsResolve_closure1.prototype = { + call$1(key) { + return '"' + key + '"'; + }, + $signature: 5 + }; + A.NodePackageImporter__nodePackageExportsResolve_closure2.prototype = { + call$1(variant) { + var t1, matchKey, t2, t3, t4, t5, t6, _i, expansionKey, _0_0, patternBase, patternTrailer, t7, t8, target, _this = this, _null = null; + if (variant == null) { + t1 = _this.$this; + return A.NullableExtension_andThen(t1._getMainExport$1(_this.exports), new A.NodePackageImporter__nodePackageExportsResolve__closure(t1, variant, _this.packageRoot)); + } else { + t1 = _this.exports; + if (!type$.Map_String_dynamic._is(t1) || J.every$1$ax(t1.get$keys(t1), new A.NodePackageImporter__nodePackageExportsResolve__closure0())) + return _null; + } + matchKey = "./" + $.$get$context().toUri$1(variant).toString$0(0); + if (t1.containsKey$1(matchKey) && J.$index$asx(t1, matchKey) != null && !B.JSString_methods.contains$1(matchKey, "*")) { + t1 = J.$index$asx(t1, matchKey); + if (t1 == null) + t1 = type$.Object._as(t1); + return _this.$this._packageTargetResolve$3(matchKey, t1, _this.packageRoot); + } + t2 = A._setArrayType([], type$.JSArray_String); + for (t3 = J.getInterceptor$z(t1), t4 = J.get$iterator$ax(t3.get$keys(t1)); t4.moveNext$0();) { + t5 = t4.get$current(t4); + if (B.JSString_methods.allMatches$1("*", t5).get$length(0) === 1) + t2.push(t5); + } + t4 = _this.$this; + B.JSArray_methods.sort$1(t2, t4.get$_compareExpansionKeys()); + for (t5 = t2.length, t6 = matchKey.length, _i = 0; _i < t2.length; t2.length === t5 || (0, A.throwConcurrentModificationError)(t2), ++_i) { + expansionKey = t2[_i]; + _0_0 = expansionKey.split("*"); + if (_0_0.length === 2) { + patternBase = _0_0[0]; + patternTrailer = _0_0[1]; + patternTrailer = patternTrailer; + t7 = true; + } else { + patternTrailer = _null; + patternBase = patternTrailer; + t7 = false; + } + if (!t7) + throw A.wrapException(A.StateError$("Pattern matching error")); + if (!B.JSString_methods.startsWith$1(matchKey, patternBase)) + continue; + if (matchKey === patternBase) + continue; + t7 = patternTrailer.length; + if (t7 !== 0) + t8 = B.JSString_methods.endsWith$1(matchKey, patternTrailer) && t6 >= expansionKey.length; + else + t8 = true; + if (t8) { + target = t3.$index(t1, expansionKey); + if (target == null) + continue; + return t4._packageTargetResolve$4(variant, target, _this.packageRoot, B.JSString_methods.substring$2(matchKey, patternBase.length, t6 - t7)); + } + } + return _null; + }, + $signature: 154 + }; + A.NodePackageImporter__nodePackageExportsResolve__closure.prototype = { + call$1(mainExport) { + return this.$this._packageTargetResolve$3(this.variant, mainExport, this.packageRoot); + }, + $signature: 155 + }; + A.NodePackageImporter__nodePackageExportsResolve__closure0.prototype = { + call$1(key) { + return !B.JSString_methods.startsWith$1(key, "."); + }, + $signature: 4 + }; + A.NodePackageImporter__getMainExport_closure.prototype = { + call$1(key) { + return B.JSString_methods.startsWith$1(key, "."); + }, + $signature: 4 + }; + A.ImporterResult.prototype = { + get$sourceMapUrl(_) { + return this._sourceMapUrl; + } + }; + A.resolveImportPath_closure.prototype = { + call$0() { + return A._exactlyOne(A._tryPath($.$get$context().withoutExtension$1(this.path) + ".import" + this.extension)); + }, + $signature: 45 + }; + A.resolveImportPath_closure0.prototype = { + call$0() { + return A._exactlyOne(A._tryPathWithExtensions(this.path + ".import")); + }, + $signature: 45 + }; + A._tryPathAsDirectory_closure.prototype = { + call$0() { + return A._exactlyOne(A._tryPathWithExtensions(A.join(this.path, "index.import", null))); + }, + $signature: 45 + }; + A._exactlyOne_closure.prototype = { + call$1(path) { + var t1 = $.$get$context(); + return " " + t1.prettyUri$1(t1.toUri$1(path)); + }, + $signature: 5 + }; + A.InterpolationBuffer.prototype = { + writeCharCode$1(character) { + this._interpolation_buffer$_text._contents += A.Primitives_stringFromCharCode(character); + return null; + }, + addInterpolation$1(interpolation) { + var _0_4, _0_4_isSet, first, rest, _this = this, + toAdd = interpolation.contents, + t1 = toAdd.length; + if (t1 === 0) + return; + if (t1 >= 1) { + _0_4 = toAdd[0]; + t1 = _0_4; + t1 = typeof t1 == "string"; + _0_4_isSet = true; + } else { + _0_4 = null; + _0_4_isSet = false; + t1 = false; + } + if (t1) { + first = A._asString(_0_4_isSet ? _0_4 : toAdd[0]); + rest = B.JSArray_methods.sublist$1(toAdd, 1); + _this._interpolation_buffer$_text._contents += first; + toAdd = rest; + } + _this._flushText$0(); + t1 = _this._interpolation_buffer$_contents; + B.JSArray_methods.addAll$1(t1, toAdd); + if (typeof B.JSArray_methods.get$last(t1) == "string") + _this._interpolation_buffer$_text._contents += A.S(t1.pop()); + }, + _flushText$0() { + var t1 = this._interpolation_buffer$_text, + t2 = t1._contents; + if (t2.length === 0) + return; + this._interpolation_buffer$_contents.push(t2.charCodeAt(0) == 0 ? t2 : t2); + t1._contents = ""; + }, + interpolation$1(span) { + var t1 = A.List_List$of(this._interpolation_buffer$_contents, true, type$.Object), + t2 = this._interpolation_buffer$_text._contents; + if (t2.length !== 0) + t1.push(t2.charCodeAt(0) == 0 ? t2 : t2); + return A.Interpolation$(t1, span); + }, + toString$0(_) { + var t1, t2, _i, t3, element; + for (t1 = this._interpolation_buffer$_contents, t2 = t1.length, _i = 0, t3 = ""; _i < t1.length; t1.length === t2 || (0, A.throwConcurrentModificationError)(t1), ++_i) { + element = t1[_i]; + t3 = typeof element == "string" ? t3 + element : t3 + "#{" + A.S(element) + A.Primitives_stringFromCharCode(125); + } + t1 = t3 + this._interpolation_buffer$_text.toString$0(0); + return t1.charCodeAt(0) == 0 ? t1 : t1; + } + }; + A.InterpolationMap.prototype = { + mapException$1(error) { + var t3, t4, _this = this, + target = error.get$span(error), + source = _this.mapSpan$1(target), + startIndex = _this._indexInContents$1(target.get$start(target)), + endIndex = _this._indexInContents$1(target.get$end(target)), + t1 = _this._interpolation.contents, + t2 = error._span_exception$_message; + if (!A.SubListIterable$(t1, startIndex, null, A._arrayInstanceType(t1)._precomputed1).take$1(0, endIndex - startIndex + 1).any$1(0, new A.InterpolationMap_mapException_closure())) + return new A.SourceSpanFormatException(error.get$source(), t2, source); + else { + t1 = type$.SourceSpan; + t3 = type$.String; + t4 = A.LinkedHashMap_LinkedHashMap$_literal([target, "error in interpolated output"], t1, t3); + error.get$source(); + return new A.MultiSourceSpanFormatException("", A.ConstantMap_ConstantMap$from(t4, t1, t3), t2, source); + } + }, + mapSpan$1(target) { + var _0_10, t1, _0_20, t2, start, _0_2_isSet, end, _this = this, _null = null, + _0_1 = _this._mapLocation$1(target.get$start(target)), + _0_2 = _this._mapLocation$1(target.get$end(target)); + $label0$0: { + _0_10 = _0_1; + t1 = type$.FileSpan; + if (t1._is(_0_1)) { + t1._as(_0_10); + _0_20 = _0_2; + t2 = t1._is(_0_2); + start = _0_10; + _0_1 = start; + _0_2_isSet = true; + } else { + start = _null; + _0_20 = start; + _0_1 = _0_10; + _0_2_isSet = false; + t2 = false; + } + if (t2) { + t1 = start.expand$1(0, t1._as(_0_2_isSet ? _0_20 : _0_2)); + break $label0$0; + } + if (t1._is(_0_1)) { + t1._as(_0_1); + if (_0_2_isSet) + t2 = _0_20; + else { + t2 = _0_2; + _0_20 = t2; + _0_2_isSet = true; + } + t2 = t2 instanceof A.FileLocation; + start = _0_1; + } else { + start = _null; + t2 = false; + } + if (t2) { + t1 = _0_2_isSet ? _0_20 : _0_2; + type$.FileLocation._as(t1); + t2 = _this._interpolation.span; + t1 = t2.get$file(t2).span$2(0, _this._expandInterpolationSpanLeft$1(start.get$start(start)), t1.offset); + break $label0$0; + } + if (_0_1 instanceof A.FileLocation) { + type$.FileLocation._as(_0_1); + if (_0_2_isSet) + t2 = _0_20; + else { + t2 = _0_2; + _0_20 = t2; + _0_2_isSet = true; + } + t2 = t1._is(t2); + start = _0_1; + } else { + start = _null; + t2 = false; + } + if (t2) { + end = t1._as(_0_2_isSet ? _0_20 : _0_2); + t1 = _this._interpolation.span; + t1 = t1.get$file(t1).span$2(0, start.offset, _this._expandInterpolationSpanRight$1(end.get$end(end))); + break $label0$0; + } + if (_0_1 instanceof A.FileLocation) { + type$.FileLocation._as(_0_1); + if (_0_2_isSet) + t1 = _0_20; + else { + t1 = _0_2; + _0_20 = t1; + _0_2_isSet = true; + } + t1 = t1 instanceof A.FileLocation; + start = _0_1; + } else { + start = _null; + t1 = false; + } + if (t1) { + t1 = _0_2_isSet ? _0_20 : _0_2; + type$.FileLocation._as(t1); + t2 = _this._interpolation.span; + t1 = t2.get$file(t2).span$2(0, start.offset, t1.offset); + break $label0$0; + } + t1 = A.throwExpression("[BUG] Unreachable"); + } + return t1; + }, + _mapLocation$1(target) { + var t4, previousLocation, _this = this, + index = _this._indexInContents$1(target), + t1 = _this._interpolation, + t2 = t1.contents, + _0_0 = t2[index], + t3 = type$.Expression; + if (t3._is(_0_0)) + return _0_0.get$span(_0_0); + t4 = index === 0; + t1 = t1.span; + if (t4) + previousLocation = t1.get$start(t1); + else { + t1 = t1.get$file(t1); + t2 = t3._as(t2[index - 1]); + t2 = t2.get$span(t2); + previousLocation = A.FileLocation$_(t1, _this._expandInterpolationSpanRight$1(t2.get$end(t2))); + } + t1 = t4 ? 0 : _this._targetLocations[index - 1].get$offset(); + return A.FileLocation$_(previousLocation.file, previousLocation.offset + (target.offset - t1)); + }, + _indexInContents$1(target) { + var t1, t2, t3, i; + for (t1 = this._targetLocations, t2 = t1.length, t3 = target.offset, i = 0; i < t2; ++i) + if (t3 < t1[i].get$offset()) + return i; + return this._interpolation.contents.length - 1; + }, + _expandInterpolationSpanLeft$1(start) { + var i0, prev, char, + source = start.file._decodedChars, + i = start.offset - 1; + for (; i >= 0;) { + i0 = i - 1; + prev = source[i]; + if (prev === 123) { + if (source[i0] === 35) { + i = i0; + break; + } + i = i0; + } else if (prev === 47) { + i = i0 - 1; + if (source[i0] === 42) + for (; true;) { + i0 = i - 1; + if (source[i] !== 42) { + i = i0; + continue; + } + i = i0; + do { + i0 = i - 1; + char = source[i]; + if (char === 42) { + i = i0; + continue; + } else + break; + } while (true); + if (char === 47) { + i = i0; + break; + } + i = i0; + } + } else + i = i0; + } + return i; + }, + _expandInterpolationSpanRight$1(end) { + var t1, i0, next, second, t2, char, + source = end.file._decodedChars, + i = end.offset; + for (t1 = source.length; i < t1;) { + i0 = i + 1; + next = source[i]; + if (next === 125) { + i = i0; + break; + } + if (next === 47) { + i = i0 + 1; + second = source[i0]; + if (second === 47) { + while (true) { + i0 = i + 1; + t2 = source[i]; + if (!!(t2 === 10 || t2 === 13 || t2 === 12)) + break; + i = i0; + } + i = i0; + } else if (second === 42) + for (; true;) { + i0 = i + 1; + if (source[i] !== 42) { + i = i0; + continue; + } + i = i0; + do { + i0 = i + 1; + char = source[i]; + if (char === 42) { + i = i0; + continue; + } else + break; + } while (true); + if (char === 47) { + i = i0; + break; + } + i = i0; + } + } else + i = i0; + } + return i; + } + }; + A.InterpolationMap_mapException_closure.prototype = { + call$1($content) { + return type$.Expression._is($content); + }, + $signature: 71 + }; + A._realCasePath_helper.prototype = { + call$1(path) { + var dirname = $.$get$context().dirname$1(path); + if (dirname === path) + return path; + return $._realCaseCache.putIfAbsent$2(path, new A._realCasePath_helper_closure(this, dirname, path)); + }, + $signature: 5 + }; + A._realCasePath_helper_closure.prototype = { + call$0() { + var matches, t1, _0_0, match, exception, + realDirname = this.helper.call$1(this.dirname), + t2 = this.path, + basename = A.ParsedPath_ParsedPath$parse(t2, $.$get$context().style).get$basename(); + try { + matches = J.where$1$ax(A.listDir(realDirname, false), new A._realCasePath_helper__closure(basename)).toList$0(0); + t1 = null; + _0_0 = matches; + $label0$0: { + match = null; + if (J.get$length$asx(_0_0) === 1) { + match = J.$index$asx(_0_0, 0); + t1 = match; + break $label0$0; + } + t1 = A.join(realDirname, basename, null); + break $label0$0; + } + t1 = t1; + return t1; + } catch (exception) { + if (A.unwrapException(exception) instanceof A.FileSystemException) + return t2; + else + throw exception; + } + }, + $signature: 27 + }; + A._realCasePath_helper__closure.prototype = { + call$1(realPath) { + return A.equalsIgnoreCase(A.ParsedPath_ParsedPath$parse(realPath, $.$get$context().style).get$basename(), this.basename); + }, + $signature: 4 + }; + A.FileSystemException.prototype = { + toString$0(_) { + var t1 = $.$get$context(); + return t1.prettyUri$1(t1.toUri$1(this.path)) + ": " + this.message; + }, + get$message(receiver) { + return this.message; + } + }; + A._readFile_closure.prototype = { + call$0() { + return J.readFileSync$2$x(A.fs(), this.path, this.encoding); + }, + $signature: 57 + }; + A.writeFile_closure.prototype = { + call$0() { + return J.writeFileSync$2$x(A.fs(), this.path, this.contents); + }, + $signature: 0 + }; + A.deleteFile_closure.prototype = { + call$0() { + return J.unlinkSync$1$x(A.fs(), this.path); + }, + $signature: 0 + }; + A.readStdin_closure.prototype = { + call$1(result) { + this._box_0.contents = result; + this.completer.complete$1(result); + }, + $signature: 90 + }; + A.readStdin_closure0.prototype = { + call$1(chunk) { + this.sink.add$1(0, type$.List_int._as(chunk)); + }, + call$0() { + return this.call$1(null); + }, + "call*": "call$1", + $requiredArgCount: 0, + $defaultValues() { + return [null]; + }, + $signature: 89 + }; + A.readStdin_closure1.prototype = { + call$1(_) { + this.sink.close$0(0); + }, + call$0() { + return this.call$1(null); + }, + "call*": "call$1", + $requiredArgCount: 0, + $defaultValues() { + return [null]; + }, + $signature: 89 + }; + A.readStdin_closure2.prototype = { + call$1(e) { + A.printError("Failed to read from stdin"); + A.printError(e); + e.toString; + this.completer.completeError$1(e); + }, + call$0() { + return this.call$1(null); + }, + "call*": "call$1", + $requiredArgCount: 0, + $defaultValues() { + return [null]; + }, + $signature: 89 + }; + A.fileExists_closure.prototype = { + call$0() { + var error, systemError, exception, + t1 = this.path; + if (!J.existsSync$1$x(A.fs(), t1)) + return false; + try { + t1 = J.isFile$0$x(J.statSync$1$x(A.fs(), t1)); + return t1; + } catch (exception) { + error = A.unwrapException(exception); + systemError = type$.JsSystemError._as(error); + if (J.$eq$(J.get$code$x(systemError), "ENOENT")) + return false; + throw exception; + } + }, + $signature: 26 + }; + A.dirExists_closure.prototype = { + call$0() { + var error, systemError, exception, + t1 = this.path; + if (!J.existsSync$1$x(A.fs(), t1)) + return false; + try { + t1 = J.isDirectory$0$x(J.statSync$1$x(A.fs(), t1)); + return t1; + } catch (exception) { + error = A.unwrapException(exception); + systemError = type$.JsSystemError._as(error); + if (J.$eq$(J.get$code$x(systemError), "ENOENT")) + return false; + throw exception; + } + }, + $signature: 26 + }; + A.ensureDir_closure.prototype = { + call$0() { + var error, systemError, exception, t1; + try { + J.mkdirSync$1$x(A.fs(), this.path); + } catch (exception) { + error = A.unwrapException(exception); + systemError = type$.JsSystemError._as(error); + if (J.$eq$(J.get$code$x(systemError), "EEXIST")) + return; + if (!J.$eq$(J.get$code$x(systemError), "ENOENT")) + throw exception; + t1 = this.path; + A.ensureDir($.$get$context().dirname$1(t1)); + J.mkdirSync$1$x(A.fs(), t1); + } + }, + $signature: 0 + }; + A.listDir_closure.prototype = { + call$0() { + var t1 = this.path; + if (!this.recursive) + return J.map$1$1$ax(J.readdirSync$1$x(A.fs(), t1), new A.listDir__closure(t1), type$.String).super$Iterable$where(0, new A.listDir__closure0()); + else + return new A.listDir_closure_list().call$1(t1); + }, + $signature: 161 + }; + A.listDir__closure.prototype = { + call$1(child) { + return A.join(this.path, A._asString(child), null); + }, + $signature: 116 + }; + A.listDir__closure0.prototype = { + call$1(child) { + return !A.dirExists(child); + }, + $signature: 4 + }; + A.listDir_closure_list.prototype = { + call$1($parent) { + return J.expand$1$1$ax(J.readdirSync$1$x(A.fs(), $parent), new A.listDir__list_closure($parent, this), type$.String); + }, + $signature: 162 + }; + A.listDir__list_closure.prototype = { + call$1(child) { + var path = A.join(this.parent, A._asString(child), null); + return A.dirExists(path) ? this.list.call$1(path) : A._setArrayType([path], type$.JSArray_String); + }, + $signature: 163 + }; + A.modificationTime_closure.prototype = { + call$0() { + var t2, + t1 = J.getTime$0$x(J.get$mtime$x(J.statSync$1$x(A.fs(), this.path))); + if (Math.abs(t1) <= 864e13) + t2 = false; + else + t2 = true; + if (t2) + A.throwExpression(A.ArgumentError$("DateTime is outside valid range: " + A.S(t1), null)); + A.checkNotNullable(false, "isUtc", type$.bool); + return new A.DateTime(t1, false); + }, + $signature: 164 + }; + A.watchDir_closure.prototype = { + call$2(path, _) { + var t1 = this._box_0.controller; + return t1 == null ? null : t1.add$1(0, new A.WatchEvent(B.ChangeType_add, path)); + }, + call$1(path) { + return this.call$2(path, null); + }, + "call*": "call$2", + $requiredArgCount: 1, + $defaultValues() { + return [null]; + }, + $signature: 191 + }; + A.watchDir_closure0.prototype = { + call$2(path, _) { + var t1 = this._box_0.controller; + return t1 == null ? null : t1.add$1(0, new A.WatchEvent(B.ChangeType_modify, path)); + }, + call$1(path) { + return this.call$2(path, null); + }, + "call*": "call$2", + $requiredArgCount: 1, + $defaultValues() { + return [null]; + }, + $signature: 191 + }; + A.watchDir_closure1.prototype = { + call$1(path) { + var t1 = this._box_0.controller; + return t1 == null ? null : t1.add$1(0, new A.WatchEvent(B.ChangeType_remove, path)); + }, + $signature: 90 + }; + A.watchDir_closure2.prototype = { + call$1(error) { + var t1 = this._box_0.controller; + return t1 == null ? null : t1.addError$1(error); + }, + $signature: 87 + }; + A.watchDir_closure3.prototype = { + call$0() { + var controller = A.StreamController_StreamController(new A.watchDir__closure(this.watcher), null, null, null, false, type$.WatchEvent); + this._box_0.controller = controller; + this.completer.complete$1(new A._ControllerStream(controller, A._instanceType(controller)._eval$1("_ControllerStream<1>"))); + }, + $signature: 1 + }; + A.watchDir__closure.prototype = { + call$0() { + J.close$0$x(this.watcher); + }, + $signature: 1 + }; + A.JSArray0.prototype = {}; + A.Chokidar.prototype = {}; + A.ChokidarOptions.prototype = {}; + A.ChokidarWatcher.prototype = {}; + A.JSFunction.prototype = {}; + A.ImmutableList.prototype = {}; + A.ImmutableMap.prototype = {}; + A.NodeImporterResult.prototype = {}; + A.RenderContext.prototype = {}; + A.RenderContextOptions.prototype = {}; + A.RenderContextResult.prototype = {}; + A.RenderContextResultStats.prototype = {}; + A.JSModule.prototype = {}; + A.JSModuleRequire.prototype = {}; + A.JSClass.prototype = {}; + A.JSUrl.prototype = {}; + A._PropertyDescriptor.prototype = {}; + A._RequireMain.prototype = {}; + A._QuietLogger.prototype = { + warn$4$deprecation$span$trace(_, message, deprecation, span, trace) { + }, + warn$1(_, message) { + return this.warn$4$deprecation$span$trace(0, message, false, null, null); + }, + warn$2$span(_, message, span) { + return this.warn$4$deprecation$span$trace(0, message, false, span, null); + }, + debug$2(_, message, span) { + } + }; + A.DeprecationHandlingLogger.prototype = { + warn$4$deprecation$span$trace(_, message, deprecation, span, trace) { + this._inner.warn$4$deprecation$span$trace(0, message, deprecation, span, trace); + }, + warn$3$span$trace(_, message, span, trace) { + return this.warn$4$deprecation$span$trace(0, message, false, span, trace); + }, + warn$2$span(_, message, span) { + return this.warn$4$deprecation$span$trace(0, message, false, span, null); + }, + warn$2$trace(_, message, trace) { + return this.warn$4$deprecation$span$trace(0, message, false, null, trace); + }, + warnForDeprecation$4$span$trace(deprecation, message, span, trace) { + var span0, t1, _0_3, _0_1, _0_3_isSet, t2, count, _this = this, _null = null; + if (_this.fatalDeprecations.contains$1(0, deprecation)) { + message += string$.x0a_This + deprecation.toString$0(0) + string$.x20depre; + $label0$0: { + if (span != null) { + span0 = span == null ? type$.FileSpan._as(span) : span; + t1 = trace != null; + _0_3 = trace; + _0_1 = span; + span = span0; + _0_3_isSet = true; + } else { + _0_3 = _null; + _0_1 = span; + span = _0_3; + _0_3_isSet = false; + t1 = false; + } + if (t1) { + if (_0_3_isSet) + trace = _0_3; + t1 = A.SassRuntimeException$(message, span, trace == null ? type$.Trace._as(trace) : trace, _null); + break $label0$0; + } + if (_0_1 != null) { + span = _0_1 == null ? type$.FileSpan._as(_0_1) : _0_1; + t1 = (_0_3_isSet ? _0_3 : trace) == null; + } else { + span = _null; + t1 = false; + } + if (t1) { + t1 = A.SassException$(message, span, _null); + break $label0$0; + } + t1 = A.SassScriptException$(message, _null); + break $label0$0; + } + throw A.wrapException(t1); + } + if (deprecation.isFuture && !_this.futureDeprecations.contains$1(0, deprecation)) + return; + if (_this.limitRepetition) { + t1 = _this._warningCounts; + t2 = t1.$index(0, deprecation); + count = (t2 == null ? 0 : t2) + 1; + t1.$indexSet(0, deprecation, count); + if (count > 5) + return; + } + _this._inner.warn$4$deprecation$span$trace(0, message, true, span, trace); + }, + debug$2(_, message, span) { + return this._inner.debug$2(0, message, span); + }, + summarize$1$js(js) { + var t1 = this._warningCounts.get$values(0), + t2 = A._instanceType(t1), + total = A.IterableIntegerExtension_get_sum(new A.MappedIterable(new A.WhereIterable(t1, new A.DeprecationHandlingLogger_summarize_closure(), t2._eval$1("WhereIterable")), new A.DeprecationHandlingLogger_summarize_closure0(), t2._eval$1("MappedIterable"))); + if (total > 0) { + t1 = js ? "" : string$.x0aRun_i; + this._inner.warn$1(0, "" + total + string$.x20repet + t1); + } + } + }; + A.DeprecationHandlingLogger_summarize_closure.prototype = { + call$1(count) { + return count > 5; + }, + $signature: 46 + }; + A.DeprecationHandlingLogger_summarize_closure0.prototype = { + call$1(count) { + return count - 5; + }, + $signature: 168 + }; + A.StderrLogger.prototype = { + warn$4$deprecation$span$trace(_, message, deprecation, span, trace) { + var t2, + result = new A.StringBuffer(""), + t1 = this.color; + if (t1) { + t2 = result._contents = "" + "\x1b[33m\x1b[1m"; + t2 = result._contents = (deprecation ? result._contents = t2 + "Deprecation " : t2) + "Warning\x1b[0m"; + } else + t2 = result._contents = (deprecation ? result._contents = "" + "DEPRECATION " : "") + "WARNING"; + if (span == null) + t1 = result._contents = t2 + (": " + message + "\n"); + else if (trace != null) { + t1 = t2 + (": " + message + "\n\n" + span.highlight$1$color(t1) + "\n"); + result._contents = t1; + } else { + t1 = t2 + (" on " + span.message$2$color(0, "\n" + message, t1) + "\n"); + result._contents = t1; + } + if (trace != null) + result._contents = t1 + (A.indent(B.JSString_methods.trimRight$0(trace.toString$0(0)), 4) + "\n"); + A.printError(result); + }, + warn$1(_, message) { + return this.warn$4$deprecation$span$trace(0, message, false, null, null); + }, + warn$3$span$trace(_, message, span, trace) { + return this.warn$4$deprecation$span$trace(0, message, false, span, trace); + }, + warn$2$span(_, message, span) { + return this.warn$4$deprecation$span$trace(0, message, false, span, null); + }, + warn$2$trace(_, message, trace) { + return this.warn$4$deprecation$span$trace(0, message, false, null, trace); + }, + debug$2(_, message, span) { + var url, t3, t4, + t1 = span.file, + t2 = span._file$_start; + if (A.FileLocation$_(t1, t2).file.url == null) + url = "-"; + else { + t3 = A.FileLocation$_(t1, t2).file.url; + t4 = $.$get$context(); + t3.toString; + url = t4.prettyUri$1(t3); + } + t1 = A.FileLocation$_(t1, t2); + t1 = t1.file.getLine$1(t1.offset); + t2 = this.color ? "\x1b[1mDebug\x1b[0m" : "DEBUG"; + t2 = "" + (url + ":" + (t1 + 1) + " ") + t2 + (": " + message); + A.printError(t2.charCodeAt(0) == 0 ? t2 : t2); + } + }; + A.TrackingLogger.prototype = { + warn$4$deprecation$span$trace(_, message, deprecation, span, trace) { + this._emittedWarning = true; + this._tracking$_logger.warn$4$deprecation$span$trace(0, message, deprecation, span, trace); + }, + warn$3$span$trace(_, message, span, trace) { + return this.warn$4$deprecation$span$trace(0, message, false, span, trace); + }, + warn$2$span(_, message, span) { + return this.warn$4$deprecation$span$trace(0, message, false, span, null); + }, + warn$2$trace(_, message, trace) { + return this.warn$4$deprecation$span$trace(0, message, false, null, trace); + }, + debug$2(_, message, span) { + this._emittedDebug = true; + this._tracking$_logger.debug$2(0, message, span); + } + }; + A.BuiltInModule.prototype = { + get$upstream() { + return B.List_empty7; + }, + get$variableNodes() { + return B.Map_empty4; + }, + get$extensionStore() { + return B.C_EmptyExtensionStore; + }, + get$css(_) { + return new A.CssStylesheet(B.List_empty3, A.SourceFile$decoded(B.List_empty4, this.url).span$2(0, 0, 0)); + }, + get$preModuleComments() { + return B.Map_empty2; + }, + get$transitivelyContainsCss() { + return false; + }, + get$transitivelyContainsExtensions() { + return false; + }, + setVariable$3($name, value, nodeWithSpan) { + if (!this.variables.containsKey$1($name)) + throw A.wrapException(A.SassScriptException$("Undefined variable.", null)); + throw A.wrapException(A.SassScriptException$("Cannot modify built-in variable.", null)); + }, + variableIdentity$1($name) { + return this; + }, + cloneCss$0() { + return this; + }, + $isModule0: 1, + get$url(receiver) { + return this.url; + }, + get$functions(receiver) { + return this.functions; + }, + get$mixins() { + return this.mixins; + }, + get$variables() { + return this.variables; + } + }; + A.ForwardedModuleView.prototype = { + get$url(_) { + var t1 = this._forwarded_view$_inner; + return t1.get$url(t1); + }, + get$upstream() { + return this._forwarded_view$_inner.get$upstream(); + }, + get$extensionStore() { + return this._forwarded_view$_inner.get$extensionStore(); + }, + get$css(_) { + var t1 = this._forwarded_view$_inner; + return t1.get$css(t1); + }, + get$preModuleComments() { + return this._forwarded_view$_inner.get$preModuleComments(); + }, + get$transitivelyContainsCss() { + return this._forwarded_view$_inner.get$transitivelyContainsCss(); + }, + get$transitivelyContainsExtensions() { + return this._forwarded_view$_inner.get$transitivelyContainsExtensions(); + }, + setVariable$3($name, value, nodeWithSpan) { + var t2, _1_0, _2_0, + _s19_ = "Undefined variable.", + t1 = this._rule, + _0_0 = t1.shownVariables; + if (_0_0 != null) + t2 = !_0_0._base.contains$1(0, $name); + else + t2 = false; + if (t2) + throw A.wrapException(A.SassScriptException$(_s19_, null)); + else { + _1_0 = t1.hiddenVariables; + if (_1_0 != null) + t2 = _1_0._base.contains$1(0, $name); + else + t2 = false; + if (t2) + throw A.wrapException(A.SassScriptException$(_s19_, null)); + } + _2_0 = t1.prefix; + if (_2_0 != null) { + if (!B.JSString_methods.startsWith$1($name, _2_0)) + throw A.wrapException(A.SassScriptException$(_s19_, null)); + $name = B.JSString_methods.substring$1($name, _2_0.length); + } + return this._forwarded_view$_inner.setVariable$3($name, value, nodeWithSpan); + }, + variableIdentity$1($name) { + var _0_0 = this._rule.prefix; + if (_0_0 != null) + $name = B.JSString_methods.substring$1($name, _0_0.length); + return this._forwarded_view$_inner.variableIdentity$1($name); + }, + $eq(_, other) { + if (other == null) + return false; + return other instanceof A.ForwardedModuleView && this._forwarded_view$_inner.$eq(0, other._forwarded_view$_inner) && this._rule === other._rule; + }, + get$hashCode(_) { + var t1 = this._forwarded_view$_inner; + return (t1.get$hashCode(t1) ^ A.Primitives_objectHashCode(this._rule)) >>> 0; + }, + cloneCss$0() { + return A.ForwardedModuleView$(this._forwarded_view$_inner.cloneCss$0(), this._rule, this.$ti._precomputed1); + }, + toString$0(_) { + return "forwarded " + this._forwarded_view$_inner.toString$0(0); + }, + $isModule0: 1, + get$variables() { + return this.variables; + }, + get$variableNodes() { + return this.variableNodes; + }, + get$functions(receiver) { + return this.functions; + }, + get$mixins() { + return this.mixins; + } + }; + A.ShadowedModuleView.prototype = { + get$url(_) { + var t1 = this._shadowed_view$_inner; + return t1.get$url(t1); + }, + get$upstream() { + return this._shadowed_view$_inner.get$upstream(); + }, + get$extensionStore() { + return this._shadowed_view$_inner.get$extensionStore(); + }, + get$css(_) { + var t1 = this._shadowed_view$_inner; + return t1.get$css(t1); + }, + get$preModuleComments() { + return this._shadowed_view$_inner.get$preModuleComments(); + }, + get$transitivelyContainsCss() { + return this._shadowed_view$_inner.get$transitivelyContainsCss(); + }, + get$transitivelyContainsExtensions() { + return this._shadowed_view$_inner.get$transitivelyContainsExtensions(); + }, + setVariable$3($name, value, nodeWithSpan) { + if (!this.variables.containsKey$1($name)) + throw A.wrapException(A.SassScriptException$("Undefined variable.", null)); + else + this._shadowed_view$_inner.setVariable$3($name, value, nodeWithSpan); + }, + variableIdentity$1($name) { + return this._shadowed_view$_inner.variableIdentity$1($name); + }, + $eq(_, other) { + var t1, t2, _this = this; + if (other == null) + return false; + if (other instanceof A.ShadowedModuleView) + if (_this._shadowed_view$_inner.$eq(0, other._shadowed_view$_inner)) { + t1 = _this.variables; + t1 = t1.get$keys(t1); + t2 = other.variables; + if (B.C_IterableEquality.equals$2(0, t1, t2.get$keys(t2))) { + t1 = _this.functions; + t1 = t1.get$keys(t1); + t2 = other.functions; + if (B.C_IterableEquality.equals$2(0, t1, t2.get$keys(t2))) { + t1 = _this.mixins; + t1 = t1.get$keys(t1); + t2 = other.mixins; + t2 = B.C_IterableEquality.equals$2(0, t1, t2.get$keys(t2)); + t1 = t2; + } else + t1 = false; + } else + t1 = false; + } else + t1 = false; + else + t1 = false; + return t1; + }, + get$hashCode(_) { + var t1 = this._shadowed_view$_inner; + return t1.get$hashCode(t1); + }, + cloneCss$0() { + var _this = this; + return new A.ShadowedModuleView(_this._shadowed_view$_inner.cloneCss$0(), _this.variables, _this.variableNodes, _this.functions, _this.mixins, _this.$ti); + }, + toString$0(_) { + return "shadowed " + this._shadowed_view$_inner.toString$0(0); + }, + $isModule0: 1, + get$variables() { + return this.variables; + }, + get$variableNodes() { + return this.variableNodes; + }, + get$functions(receiver) { + return this.functions; + }, + get$mixins() { + return this.mixins; + } + }; + A.AtRootQueryParser.prototype = { + parse$0() { + return this.wrapSpanFormatException$1(new A.AtRootQueryParser_parse_closure(this)); + } + }; + A.AtRootQueryParser_parse_closure.prototype = { + call$0() { + var include, atRules, + t1 = this.$this, + t2 = t1.scanner; + t2.expectChar$1(40); + t1.whitespace$0(); + include = t1.scanIdentifier$1("with"); + if (!include) + t1.expectIdentifier$2$name("without", '"with" or "without"'); + t1.whitespace$0(); + t2.expectChar$1(58); + t1.whitespace$0(); + atRules = A.LinkedHashSet_LinkedHashSet$_empty(type$.String); + do { + atRules.add$1(0, t1.identifier$0().toLowerCase()); + t1.whitespace$0(); + } while (t1.lookingAtIdentifier$0()); + t2.expectChar$1(41); + t2.expectDone$0(); + return new A.AtRootQuery(include, atRules, atRules.contains$1(0, "all"), atRules.contains$1(0, "rule")); + }, + $signature: 353 + }; + A._disallowedFunctionNames_closure.prototype = { + call$1($function) { + return $function.name; + }, + $signature: 352 + }; + A.CssParser.prototype = { + get$plainCss() { + return true; + }, + silentComment$0() { + var t1, t2, _this = this; + if (_this._inExpression) + return false; + t1 = _this.scanner; + t2 = t1._string_scanner$_position; + _this.super$Parser$silentComment(); + _this.error$2(0, string$.Silent, t1.spanFrom$1(new A._SpanScannerState(t1, t2))); + }, + atRule$2$root(child, root) { + var $name, _0_0, _this = this, + t1 = _this.scanner, + start = new A._SpanScannerState(t1, t1._string_scanner$_position); + t1.expectChar$1(64); + $name = _this.interpolatedIdentifier$0(); + _this.whitespace$0(); + _0_0 = $name.get$asPlain(); + $label0$0: { + if ("at-root" === _0_0 || "content" === _0_0 || "debug" === _0_0 || "each" === _0_0 || "error" === _0_0 || "extend" === _0_0 || "for" === _0_0 || "function" === _0_0 || "if" === _0_0 || "include" === _0_0 || "mixin" === _0_0 || "return" === _0_0 || "warn" === _0_0 || "while" === _0_0) + _this._forbiddenAtRoot$1(start); + if ("import" === _0_0) { + t1 = _this._cssImportRule$1(start); + break $label0$0; + } + if ("media" === _0_0) { + t1 = _this.mediaRule$1(start); + break $label0$0; + } + if ("-moz-document" === _0_0) { + t1 = _this.mozDocumentRule$2(start, $name); + break $label0$0; + } + if ("supports" === _0_0) { + t1 = _this.supportsRule$1(start); + break $label0$0; + } + t1 = _this.unknownAtRule$2(start, $name); + break $label0$0; + } + return t1; + }, + _forbiddenAtRoot$1(start) { + this.almostAnyValue$0(); + this.error$2(0, "This at-rule isn't allowed in plain CSS.", this.scanner.spanFrom$1(start)); + }, + _cssImportRule$1(start) { + var t2, urlSpan, modifiers, _this = this, + t1 = _this.scanner, + urlStart = new A._SpanScannerState(t1, t1._string_scanner$_position), + _0_0 = t1.peekChar$0(); + $label0$0: { + if (117 === _0_0 || 85 === _0_0) { + t2 = _this.dynamicUrl$0(); + break $label0$0; + } + t2 = new A.StringExpression(_this.interpolatedString$0().asInterpolation$1$static(true), false); + break $label0$0; + } + urlSpan = t1.spanFrom$1(urlStart); + _this.whitespace$0(); + modifiers = _this.tryImportModifiers$0(); + _this.expectStatementSeparator$1("@import rule"); + t2 = A._setArrayType([new A.StaticImport(A.Interpolation$(A._setArrayType([t2], type$.JSArray_Object), urlSpan), modifiers, t1.spanFrom$1(urlStart))], type$.JSArray_Import); + t1 = t1.spanFrom$1(start); + return new A.ImportRule(A.List_List$unmodifiable(t2, type$.Import), t1); + }, + parentheses$0() { + var expression, + t1 = this.scanner, + t2 = t1._string_scanner$_position; + t1.expectChar$1(40); + this.whitespace$0(); + expression = this.expressionUntilComma$0(); + t1.expectChar$1(41); + return new A.ParenthesizedExpression(expression, t1.spanFrom$1(new A._SpanScannerState(t1, t2))); + }, + identifierLike$0() { + var t2, allowEmptySecondArg, $arguments, t3, t4, _this = this, + t1 = _this.scanner, + start = new A._SpanScannerState(t1, t1._string_scanner$_position), + identifier = _this.interpolatedIdentifier$0(), + plain = identifier.get$asPlain(), + lower = plain.toLowerCase(), + _0_0 = _this.trySpecialFunction$2(lower, start); + if (_0_0 != null) + return _0_0; + t2 = t1._string_scanner$_position; + if (t1.scanChar$1(46)) + return _this.namespacedExpression$2(plain, start); + if (!t1.scanChar$1(40)) + return new A.StringExpression(identifier, false); + allowEmptySecondArg = lower === "var"; + $arguments = A._setArrayType([], type$.JSArray_Expression); + if (!t1.scanChar$1(41)) { + do { + _this.whitespace$0(); + if (allowEmptySecondArg && $arguments.length === 1 && t1.peekChar$0() === 41) { + t3 = A.FileLocation$_(t1._sourceFile, t1._string_scanner$_position); + t4 = t3.offset; + t4 = A._FileSpan$(t3.file, t4, t4); + $arguments.push(new A.StringExpression(A.Interpolation$(A._setArrayType([""], type$.JSArray_Object), t4), false)); + break; + } + $arguments.push(_this.expressionUntilComma$1$singleEquals(true)); + _this.whitespace$0(); + } while (t1.scanChar$1(44)); + t1.expectChar$1(41); + } + if ($.$get$_disallowedFunctionNames().contains$1(0, plain)) + _this.error$2(0, string$.This_f, t1.spanFrom$1(start)); + t2 = t1.spanFrom$1(new A._SpanScannerState(t1, t2)); + t3 = type$.Expression; + return new A.FunctionExpression(null, plain, new A.ArgumentInvocation(A.List_List$unmodifiable($arguments, t3), A.ConstantMap_ConstantMap$from(B.Map_empty6, type$.String, t3), null, null, t2), t1.spanFrom$1(start)); + }, + namespacedExpression$2(namespace, start) { + var expression = this.super$StylesheetParser$namespacedExpression(namespace, start); + this.error$2(0, string$.Modulen, expression.get$span(expression)); + } + }; + A.KeyframeSelectorParser.prototype = { + parse$0() { + return this.wrapSpanFormatException$1(new A.KeyframeSelectorParser_parse_closure(this)); + }, + _percentage$0() { + var $self, _0_0, + t1 = this.scanner, + t2 = t1.scanChar$1(43) ? "" + A.Primitives_stringFromCharCode(43) : "", + second = t1.peekChar$0(); + if (!(second != null && second >= 48 && second <= 57) && second !== 46) + t1.error$1(0, "Expected number."); + while (true) { + $self = t1.peekChar$0(); + if (!($self != null && $self >= 48 && $self <= 57)) + break; + t2 += A.Primitives_stringFromCharCode(t1.readChar$0()); + } + if (t1.peekChar$0() === 46) { + t2 += A.Primitives_stringFromCharCode(t1.readChar$0()); + while (true) { + $self = t1.peekChar$0(); + if (!($self != null && $self >= 48 && $self <= 57)) + break; + t2 += A.Primitives_stringFromCharCode(t1.readChar$0()); + } + } + if (this.scanIdentChar$1(101)) { + t2 += A.Primitives_stringFromCharCode(101); + _0_0 = t1.peekChar$0(); + if (43 === _0_0 || 45 === _0_0) + t2 += A.Primitives_stringFromCharCode(t1.readChar$0()); + $self = t1.peekChar$0(); + if (!($self != null && $self >= 48 && $self <= 57)) + t1.error$1(0, "Expected digit."); + do { + t2 += A.Primitives_stringFromCharCode(t1.readChar$0()); + $self = t1.peekChar$0(); + } while ($self != null && $self >= 48 && $self <= 57); + } + t1.expectChar$1(37); + t2 += A.Primitives_stringFromCharCode(37); + return t2.charCodeAt(0) == 0 ? t2 : t2; + } + }; + A.KeyframeSelectorParser_parse_closure.prototype = { + call$0() { + var selectors = A._setArrayType([], type$.JSArray_String), + t1 = this.$this, + t2 = t1.scanner; + do { + t1.whitespace$0(); + if (t1.lookingAtIdentifier$0()) + if (t1.scanIdentifier$1("from")) + selectors.push("from"); + else { + t1.expectIdentifier$2$name("to", '"to" or "from"'); + selectors.push("to"); + } + else + selectors.push(t1._percentage$0()); + t1.whitespace$0(); + } while (t2.scanChar$1(44)); + t2.expectDone$0(); + return selectors; + }, + $signature: 115 + }; + A.MediaQueryParser.prototype = { + parse$0() { + return this.wrapSpanFormatException$1(new A.MediaQueryParser_parse_closure(this)); + }, + _mediaQuery$0() { + var conditions, conjunction, identifier1, identifier2, type, modifier, _this = this, _s3_ = "and", _null = null; + if (_this.scanner.peekChar$0() === 40) { + conditions = A._setArrayType([_this._mediaInParens$0()], type$.JSArray_String); + _this.whitespace$0(); + if (_this.scanIdentifier$1(_s3_)) { + _this.expectWhitespace$0(); + B.JSArray_methods.addAll$1(conditions, _this._mediaLogicSequence$1(_s3_)); + conjunction = true; + } else if (_this.scanIdentifier$1("or")) { + _this.expectWhitespace$0(); + B.JSArray_methods.addAll$1(conditions, _this._mediaLogicSequence$1("or")); + conjunction = false; + } else + conjunction = true; + return A.CssMediaQuery$condition(conditions, conjunction); + } + identifier1 = _this.identifier$0(); + if (A.equalsIgnoreCase(identifier1, "not")) { + _this.expectWhitespace$0(); + if (!_this.lookingAtIdentifier$0()) + return A.CssMediaQuery$condition(A._setArrayType(["(not " + _this._mediaInParens$0() + ")"], type$.JSArray_String), _null); + } + _this.whitespace$0(); + if (!_this.lookingAtIdentifier$0()) + return A.CssMediaQuery$type(identifier1, _null, _null); + identifier2 = _this.identifier$0(); + if (A.equalsIgnoreCase(identifier2, _s3_)) { + _this.expectWhitespace$0(); + type = identifier1; + modifier = _null; + } else { + _this.whitespace$0(); + if (_this.scanIdentifier$1(_s3_)) + _this.expectWhitespace$0(); + else + return A.CssMediaQuery$type(identifier2, _null, identifier1); + type = identifier2; + modifier = identifier1; + } + if (_this.scanIdentifier$1("not")) { + _this.expectWhitespace$0(); + return A.CssMediaQuery$type(type, A._setArrayType(["(not " + _this._mediaInParens$0() + ")"], type$.JSArray_String), modifier); + } + return A.CssMediaQuery$type(type, _this._mediaLogicSequence$1(_s3_), modifier); + }, + _mediaLogicSequence$1(operator) { + var t1, t2, _this = this, + result = A._setArrayType([], type$.JSArray_String); + for (t1 = _this.scanner; true;) { + t1.expectChar$2$name(40, "media condition in parentheses"); + t2 = _this.declarationValue$0(); + t1.expectChar$1(41); + result.push("(" + t2 + ")"); + _this.whitespace$0(); + if (!_this.scanIdentifier$1(operator)) + return result; + _this.expectWhitespace$0(); + } + }, + _mediaInParens$0() { + var t2, + t1 = this.scanner; + t1.expectChar$2$name(40, "media condition in parentheses"); + t2 = this.declarationValue$0(); + t1.expectChar$1(41); + return "(" + t2 + ")"; + } + }; + A.MediaQueryParser_parse_closure.prototype = { + call$0() { + var queries = A._setArrayType([], type$.JSArray_CssMediaQuery), + t1 = this.$this, + t2 = t1.scanner; + do { + t1.whitespace$0(); + queries.push(t1._mediaQuery$0()); + t1.whitespace$0(); + } while (t2.scanChar$1(44)); + t2.expectDone$0(); + return queries; + }, + $signature: 351 + }; + A.Parser.prototype = { + _parseIdentifier$0() { + return this.wrapSpanFormatException$1(new A.Parser__parseIdentifier_closure(this)); + }, + _isVariableDeclarationLike$0() { + var _this = this, + t1 = _this.scanner; + if (!t1.scanChar$1(36)) + return false; + if (!_this.lookingAtIdentifier$0()) + return false; + _this.identifier$0(); + _this.whitespace$0(); + return t1.scanChar$1(58); + }, + whitespace$0() { + do + this.whitespaceWithoutComments$0(); + while (this.scanComment$0()); + }, + whitespaceWithoutComments$0() { + var t3, + t1 = this.scanner, + t2 = t1.string.length; + while (true) { + if (t1._string_scanner$_position !== t2) { + t3 = t1.peekChar$0(); + t3 = t3 === 32 || t3 === 9 || t3 === 10 || t3 === 13 || t3 === 12; + } else + t3 = false; + if (!t3) + break; + t1.readChar$0(); + } + }, + spaces$0() { + var t3, + t1 = this.scanner, + t2 = t1.string.length; + while (true) { + if (t1._string_scanner$_position !== t2) { + t3 = t1.peekChar$0(); + t3 = t3 === 32 || t3 === 9; + } else + t3 = false; + if (!t3) + break; + t1.readChar$0(); + } + }, + scanComment$0() { + var _0_0, + t1 = this.scanner; + if (t1.peekChar$0() !== 47) + return false; + _0_0 = t1.peekChar$1(1); + if (47 === _0_0) + return this.silentComment$0(); + if (42 === _0_0) { + this.loudComment$0(); + return true; + } + return false; + }, + expectWhitespace$0() { + var t2, t3, + t1 = this.scanner; + if (t1._string_scanner$_position !== t1.string.length) { + t2 = t1.peekChar$0(); + t3 = !(t2 === 32 || t2 === 9 || t2 === 10 || t2 === 13 || t2 === 12 || this.scanComment$0()); + t2 = t3; + } else + t2 = true; + if (t2) + t1.error$1(0, "Expected whitespace."); + this.whitespace$0(); + }, + silentComment$0() { + var t2, t3, + t1 = this.scanner; + t1.expect$1("//"); + t2 = t1.string.length; + while (true) { + if (t1._string_scanner$_position !== t2) { + t3 = t1.peekChar$0(); + t3 = !(t3 === 10 || t3 === 13 || t3 === 12); + } else + t3 = false; + if (!t3) + break; + t1.readChar$0(); + } + return true; + }, + loudComment$0() { + var next, + t1 = this.scanner; + t1.expect$1("/*"); + for (; true;) { + if (t1.readChar$0() !== 42) + continue; + do + next = t1.readChar$0(); + while (next === 42); + if (next === 47) + break; + } + }, + identifier$2$normalize$unit(normalize, unit) { + var t2, _0_0, _this = this, + _s20_ = "Expected identifier.", + text = new A.StringBuffer(""), + t1 = _this.scanner; + if (t1.scanChar$1(45)) { + t2 = text._contents = "" + A.Primitives_stringFromCharCode(45); + if (t1.scanChar$1(45)) { + text._contents = t2 + A.Primitives_stringFromCharCode(45); + _this._identifierBody$3$normalize$unit(text, normalize, unit); + t1 = text._contents; + return t1.charCodeAt(0) == 0 ? t1 : t1; + } + } else + t2 = ""; + $label0$0: { + _0_0 = t1.peekChar$0(); + if (_0_0 == null) + t1.error$1(0, _s20_); + if (95 === _0_0 && normalize) { + t1.readChar$0(); + text._contents = t2 + A.Primitives_stringFromCharCode(45); + break $label0$0; + } + if (_0_0 === 95 || A.CharacterExtension_get_isAlphabetic(_0_0) || _0_0 >= 128) { + text._contents = t2 + A.Primitives_stringFromCharCode(t1.readChar$0()); + break $label0$0; + } + if (92 === _0_0) { + text._contents = t2 + _this.escape$1$identifierStart(true); + break $label0$0; + } + t1.error$1(0, _s20_); + } + _this._identifierBody$3$normalize$unit(text, normalize, unit); + t1 = text._contents; + return t1.charCodeAt(0) == 0 ? t1 : t1; + }, + identifier$0() { + return this.identifier$2$normalize$unit(false, false); + }, + identifier$1$normalize(normalize) { + return this.identifier$2$normalize$unit(normalize, false); + }, + identifier$1$unit(unit) { + return this.identifier$2$normalize$unit(false, unit); + }, + _identifierBody$3$normalize$unit(text, normalize, unit) { + var t1, _1_0, _0_0, t2; + for (t1 = this.scanner; true;) { + _1_0 = t1.peekChar$0(); + if (_1_0 == null) + break; + if (45 === _1_0 && unit) { + _0_0 = t1.peekChar$1(1); + if (46 !== _0_0) + t2 = A._isInt(_0_0) && _0_0 >= 48 && _0_0 <= 57; + else + t2 = true; + if (t2) + break; + text._contents += A.Primitives_stringFromCharCode(t1.readChar$0()); + continue; + } + if (95 === _1_0 && normalize) { + t1.readChar$0(); + text._contents += A.Primitives_stringFromCharCode(45); + continue; + } + if (_1_0 !== 95) { + if (!(_1_0 >= 97 && _1_0 <= 122)) + t2 = _1_0 >= 65 && _1_0 <= 90; + else + t2 = true; + t2 = t2 || _1_0 >= 128; + } else + t2 = true; + if (!t2) + t2 = _1_0 >= 48 && _1_0 <= 57 || _1_0 === 45; + else + t2 = true; + if (t2) { + text._contents += A.Primitives_stringFromCharCode(t1.readChar$0()); + continue; + } + if (92 === _1_0) { + text._contents += this.escape$0(); + continue; + } + break; + } + }, + _identifierBody$1(text) { + return this._identifierBody$3$normalize$unit(text, false, false); + }, + string$0() { + var buffer, _0_0, t2, + t1 = this.scanner, + quote = t1.readChar$0(); + if (quote !== 39 && quote !== 34) + t1.error$2$position(0, "Expected string.", t1._string_scanner$_position - 1); + buffer = new A.StringBuffer(""); + for (; true;) { + _0_0 = t1.peekChar$0(); + if (_0_0 === quote) { + t1.readChar$0(); + break; + } + if (_0_0 == null || _0_0 === 10 || _0_0 === 13 || _0_0 === 12) + t1.error$1(0, "Expected " + A.Primitives_stringFromCharCode(quote) + "."); + if (92 === _0_0) { + t2 = t1.peekChar$1(1); + if (t2 === 10 || t2 === 13 || t2 === 12) { + t1.readChar$0(); + t1.readChar$0(); + } else + buffer._contents += A.Primitives_stringFromCharCode(A.consumeEscapedCharacter(t1)); + continue; + } + buffer._contents += A.Primitives_stringFromCharCode(t1.readChar$0()); + } + t1 = buffer._contents; + return t1.charCodeAt(0) == 0 ? t1 : t1; + }, + declarationValue$1$allowEmpty(allowEmpty) { + var t1, t2, wroteNewline, next, start, end, t3, _0_0, _this = this, + buffer = new A.StringBuffer(""), + brackets = A._setArrayType([], type$.JSArray_int); + for (t1 = _this.scanner, t2 = _this.get$string(), wroteNewline = false; true;) { + next = t1.peekChar$0(); + if (next == null) + break; + if (92 === next) { + buffer._contents += _this.escape$1$identifierStart(true); + wroteNewline = false; + continue; + } + if (34 === next || 39 === next) { + start = t1._string_scanner$_position; + t2.call$0(); + end = t1._string_scanner$_position; + buffer._contents += B.JSString_methods.substring$2(t1.string, start, end); + wroteNewline = false; + continue; + } + if (47 === next) { + if (t1.peekChar$1(1) === 42) { + t3 = _this.get$loudComment(); + start = t1._string_scanner$_position; + t3.call$0(); + end = t1._string_scanner$_position; + buffer._contents += B.JSString_methods.substring$2(t1.string, start, end); + } else + buffer._contents += A.Primitives_stringFromCharCode(t1.readChar$0()); + wroteNewline = false; + continue; + } + if (32 === next || 9 === next) { + if (!wroteNewline) { + t3 = t1.peekChar$1(1); + t3 = !(t3 === 32 || t3 === 9 || t3 === 10 || t3 === 13 || t3 === 12); + } else + t3 = true; + if (t3) + buffer._contents += A.Primitives_stringFromCharCode(32); + t1.readChar$0(); + continue; + } + if (10 === next || 13 === next || 12 === next) { + t3 = t1.peekChar$1(-1); + if (!(t3 === 10 || t3 === 13 || t3 === 12)) + buffer._contents += "\n"; + t1.readChar$0(); + wroteNewline = true; + continue; + } + if (40 === next || 123 === next || 91 === next) { + buffer._contents += A.Primitives_stringFromCharCode(next); + brackets.push(A.opposite(t1.readChar$0())); + wroteNewline = false; + continue; + } + if (41 === next || 125 === next || 93 === next) { + if (brackets.length === 0) + break; + buffer._contents += A.Primitives_stringFromCharCode(next); + t1.expectChar$1(brackets.pop()); + wroteNewline = false; + continue; + } + if (59 === next) { + if (brackets.length === 0) + break; + buffer._contents += A.Primitives_stringFromCharCode(t1.readChar$0()); + continue; + } + if (117 === next || 85 === next) { + _0_0 = _this.tryUrl$0(); + if (_0_0 != null) + buffer._contents += _0_0; + else + buffer._contents += A.Primitives_stringFromCharCode(t1.readChar$0()); + wroteNewline = false; + continue; + } + if (_this.lookingAtIdentifier$0()) + buffer._contents += _this.identifier$0(); + else + buffer._contents += A.Primitives_stringFromCharCode(t1.readChar$0()); + wroteNewline = false; + } + if (brackets.length !== 0) + t1.expectChar$1(B.JSArray_methods.get$last(brackets)); + if (!allowEmpty && buffer._contents.length === 0) + t1.error$1(0, "Expected token."); + t1 = buffer._contents; + return t1.charCodeAt(0) == 0 ? t1 : t1; + }, + declarationValue$0() { + return this.declarationValue$1$allowEmpty(false); + }, + tryUrl$0() { + var buffer, _0_0, t2, _this = this, + t1 = _this.scanner, + start = new A._SpanScannerState(t1, t1._string_scanner$_position); + if (!_this.scanIdentifier$1("url")) + return null; + if (!t1.scanChar$1(40)) { + t1.set$state(start); + return null; + } + _this.whitespace$0(); + buffer = new A.StringBuffer(""); + buffer._contents = "" + "url("; + for (; true;) { + _0_0 = t1.peekChar$0(); + if (_0_0 == null) + break; + if (92 === _0_0) { + buffer._contents += _this.escape$0(); + continue; + } + if (37 !== _0_0) + if (38 !== _0_0) + if (35 !== _0_0) + t2 = _0_0 >= 42 && _0_0 <= 126 || _0_0 >= 128; + else + t2 = true; + else + t2 = true; + else + t2 = true; + if (t2) { + buffer._contents += A.Primitives_stringFromCharCode(t1.readChar$0()); + continue; + } + if (_0_0 === 32 || _0_0 === 9 || _0_0 === 10 || _0_0 === 13 || _0_0 === 12) { + _this.whitespace$0(); + if (t1.peekChar$0() !== 41) + break; + continue; + } + if (41 === _0_0) { + t2 = buffer._contents += A.Primitives_stringFromCharCode(t1.readChar$0()); + return t2.charCodeAt(0) == 0 ? t2 : t2; + } + break; + } + t1.set$state(start); + return null; + }, + variableName$0() { + this.scanner.expectChar$1(36); + return this.identifier$1$normalize(true); + }, + escape$1$identifierStart(identifierStart) { + var value, _0_0, i, next, t2, exception, + _s25_ = "Expected escape sequence.", + t1 = this.scanner, + start = t1._string_scanner$_position; + t1.expectChar$1(92); + value = 0; + $label0$1: { + _0_0 = t1.peekChar$0(); + if (_0_0 == null) + t1.error$1(0, _s25_); + if (_0_0 === 10 || _0_0 === 13 || _0_0 === 12) + t1.error$1(0, _s25_); + if (A.CharacterExtension_get_isHex(_0_0)) { + for (i = 0; i < 6; ++i) { + next = t1.peekChar$0(); + if (next != null) { + if (!(next >= 48 && next <= 57)) + if (!(next >= 97 && next <= 102)) + t2 = next >= 65 && next <= 70; + else + t2 = true; + else + t2 = true; + t2 = !t2; + } else + t2 = true; + if (t2) + break; + value *= 16; + value += A.asHex(t1.readChar$0()); + } + this.scanCharIf$1(new A.Parser_escape_closure()); + break $label0$1; + } + value = t1.readChar$0(); + } + if (identifierStart) { + t2 = value; + t2 = t2 === 95 || A.CharacterExtension_get_isAlphabetic(t2) || t2 >= 128; + } else { + t2 = value; + if (!(t2 === 95 || A.CharacterExtension_get_isAlphabetic(t2) || t2 >= 128)) + t2 = t2 >= 48 && t2 <= 57 || t2 === 45; + else + t2 = true; + } + if (t2) + try { + t2 = A.Primitives_stringFromCharCode(value); + return t2; + } catch (exception) { + if (type$.RangeError._is(A.unwrapException(exception))) + t1.error$3$length$position(0, "Invalid Unicode code point.", t1._string_scanner$_position - start, start); + else + throw exception; + } + else { + if (!(value <= 31)) + if (!J.$eq$(value, 127)) + if (identifierStart) { + t1 = value; + t1 = t1 >= 48 && t1 <= 57; + } else + t1 = false; + else + t1 = true; + else + t1 = true; + if (t1) { + t1 = "" + A.Primitives_stringFromCharCode(92); + if (value > 15) + t1 += A.Primitives_stringFromCharCode(A.hexCharFor(B.JSNumber_methods._shrOtherPositive$1(value, 4))); + t1 = t1 + A.Primitives_stringFromCharCode(A.hexCharFor(value & 15)) + A.Primitives_stringFromCharCode(32); + return t1.charCodeAt(0) == 0 ? t1 : t1; + } else + return A.String_String$fromCharCodes(A._setArrayType([92, value], type$.JSArray_int), 0, null); + } + }, + escape$0() { + return this.escape$1$identifierStart(false); + }, + scanCharIf$1(condition) { + var t1 = this.scanner; + if (!condition.call$1(t1.peekChar$0())) + return false; + t1.readChar$0(); + return true; + }, + scanIdentChar$2$caseSensitive(char, caseSensitive) { + var t3, + t1 = new A.Parser_scanIdentChar_matches(caseSensitive, char), + t2 = this.scanner, + _0_0 = t2.peekChar$0(); + if (_0_0 != null) { + t3 = t1.call$1(_0_0); + t3 = t3; + } else + t3 = false; + if (t3) { + t2.readChar$0(); + return true; + } + if (92 === _0_0) { + t3 = t2._string_scanner$_position; + if (t1.call$1(A.consumeEscapedCharacter(t2))) + return true; + t2.set$state(new A._SpanScannerState(t2, t3)); + } + return false; + }, + scanIdentChar$1(char) { + return this.scanIdentChar$2$caseSensitive(char, false); + }, + expectIdentChar$1(letter) { + var t1; + if (this.scanIdentChar$2$caseSensitive(letter, false)) + return; + t1 = this.scanner; + t1.error$2$position(0, 'Expected "' + A.Primitives_stringFromCharCode(letter) + '".', t1._string_scanner$_position); + }, + lookingAtIdentifier$1($forward) { + var t1, _1_0, t2, _0_0; + if ($forward == null) + $forward = 0; + t1 = this.scanner; + _1_0 = t1.peekChar$1($forward); + $label0$0: { + if (A._isInt(_1_0)) + t2 = _1_0 === 95 || A.CharacterExtension_get_isAlphabetic(_1_0) || _1_0 >= 128; + else + t2 = false; + if (t2 || 92 === _1_0) { + t1 = true; + break $label0$0; + } + if (45 === _1_0) { + _0_0 = t1.peekChar$1($forward + 1); + $label1$1: { + if (A._isInt(_0_0)) + t1 = _0_0 === 95 || A.CharacterExtension_get_isAlphabetic(_0_0) || _0_0 >= 128; + else + t1 = false; + if (t1 || 92 === _0_0 || 45 === _0_0) { + t1 = true; + break $label1$1; + } + t1 = false; + break $label1$1; + } + break $label0$0; + } + t1 = false; + break $label0$0; + } + return t1; + }, + lookingAtIdentifier$0() { + return this.lookingAtIdentifier$1(null); + }, + lookingAtIdentifierBody$0() { + var t1, + next = this.scanner.peekChar$0(); + if (next != null) { + if (!(next === 95 || A.CharacterExtension_get_isAlphabetic(next) || next >= 128)) + t1 = next >= 48 && next <= 57 || next === 45; + else + t1 = true; + t1 = t1 || next === 92; + } else + t1 = false; + return t1; + }, + scanIdentifier$2$caseSensitive(text, caseSensitive) { + var t1, t2, _this = this; + if (!_this.lookingAtIdentifier$0()) + return false; + t1 = _this.scanner; + t2 = t1._string_scanner$_position; + if (_this._consumeIdentifier$2(text, caseSensitive) && !_this.lookingAtIdentifierBody$0()) + return true; + else { + t1.set$state(new A._SpanScannerState(t1, t2)); + return false; + } + }, + scanIdentifier$1(text) { + return this.scanIdentifier$2$caseSensitive(text, false); + }, + _consumeIdentifier$2(text, caseSensitive) { + var t1, t2, t3; + for (t1 = new A.CodeUnits(text), t2 = type$.CodeUnits, t1 = new A.ListIterator(t1, t1.get$length(0), t2._eval$1("ListIterator")), t2 = t2._eval$1("ListBase.E"); t1.moveNext$0();) { + t3 = t1.__internal$_current; + if (!this.scanIdentChar$2$caseSensitive(t3 == null ? t2._as(t3) : t3, caseSensitive)) + return false; + } + return true; + }, + expectIdentifier$2$name(text, $name) { + var t1, start, t2, t3, t4, t5, t6; + if ($name == null) + $name = '"' + text + '"'; + t1 = this.scanner; + start = t1._string_scanner$_position; + for (t2 = new A.CodeUnits(text), t3 = type$.CodeUnits, t2 = new A.ListIterator(t2, t2.get$length(0), t3._eval$1("ListIterator")), t4 = "Expected " + $name, t5 = t4 + ".", t3 = t3._eval$1("ListBase.E"); t2.moveNext$0();) { + t6 = t2.__internal$_current; + if (this.scanIdentChar$2$caseSensitive(t6 == null ? t3._as(t6) : t6, false)) + continue; + t1.error$2$position(0, t5, start); + } + if (!this.lookingAtIdentifierBody$0()) + return; + t1.error$2$position(0, t4, start); + }, + expectIdentifier$1(text) { + return this.expectIdentifier$2$name(text, null); + }, + rawText$1(consumer) { + var t1 = this.scanner, + start = t1._string_scanner$_position; + consumer.call$0(); + return t1.substring$1(0, start); + }, + spanFrom$1(state) { + var span = this.scanner.spanFrom$1(state); + return this._interpolationMap == null ? span : new A.LazyFileSpan(new A.Parser_spanFrom_closure(this, span)); + }, + error$3(_, message, span, trace) { + var exception = new A.StringScannerException(this.scanner.string, message, span); + if (trace == null) + throw A.wrapException(exception); + else + A.throwWithTrace(exception, this.get$error(this), trace); + }, + error$2(_, message, span) { + return this.error$3(0, message, span, null); + }, + withErrorMessage$1$2(message, callback) { + var error, stackTrace, t1, exception; + try { + t1 = callback.call$0(); + return t1; + } catch (exception) { + t1 = A.unwrapException(exception); + if (type$.SourceSpanFormatException._is(t1)) { + error = t1; + stackTrace = A.getTraceFromException(exception); + t1 = J.get$span$z(error); + A.throwWithTrace(new A.SourceSpanFormatException(error.get$source(), message, t1), error, stackTrace); + } else + throw exception; + } + }, + withErrorMessage$2(message, callback) { + return this.withErrorMessage$1$2(message, callback, type$.dynamic); + }, + wrapSpanFormatException$1$1(callback) { + var error, stackTrace, map, error0, stackTrace0, span, error1, stackTrace1, span0, secondarySpans, t1, t2, span1, description, _0_0, t3, exception, t4, _this = this, + _s8_ = "expected"; + try { + try { + t3 = callback.call$0(); + return t3; + } catch (exception) { + t3 = A.unwrapException(exception); + if (type$.SourceSpanFormatException._is(t3)) { + error = t3; + stackTrace = A.getTraceFromException(exception); + map = _this._interpolationMap; + if (map == null) + throw exception; + A.throwWithTrace(map.mapException$1(error), error, stackTrace); + } else + throw exception; + } + } catch (exception) { + t3 = A.unwrapException(exception); + if (type$.SourceSpanFormatException._is(t3)) { + error0 = t3; + stackTrace0 = A.getTraceFromException(exception); + span = J.get$span$z(error0); + if (A.startsWithIgnoreCase(error0._span_exception$_message, _s8_)) + span = _this._adjustExceptionSpan$1(span); + t1 = error0._span_exception$_message; + t2 = span; + A.throwWithTrace(new A.SassFormatException(B.Set_empty, t1, t2), error0, stackTrace0); + } else if (type$.MultiSourceSpanFormatException._is(t3)) { + error1 = t3; + stackTrace1 = A.getTraceFromException(exception); + span0 = J.get$span$z(error1); + t3 = type$.FileSpan; + t4 = type$.String; + secondarySpans = error1.get$secondarySpans().cast$2$0(0, t3, t4); + if (A.startsWithIgnoreCase(error1._span_exception$_message, _s8_)) { + span0 = _this._adjustExceptionSpan$1(span0); + t1 = A.LinkedHashMap_LinkedHashMap$_empty(t3, t4); + for (t3 = A.MapExtensions_get_pairs(secondarySpans, t3, t4), t3 = t3.get$iterator(t3); t3.moveNext$0();) { + t2 = t3.get$current(t3); + span1 = null; + description = null; + _0_0 = t2; + span1 = _0_0._0; + description = _0_0._1; + J.$indexSet$ax(t1, _this._adjustExceptionSpan$1(span1), description); + } + secondarySpans = t1; + } + A.throwWithTrace(A.MultiSpanSassFormatException$(error1._span_exception$_message, span0, error1.get$primaryLabel(), secondarySpans, null), error1, stackTrace1); + } else + throw exception; + } + }, + wrapSpanFormatException$1(callback) { + return this.wrapSpanFormatException$1$1(callback, type$.dynamic); + }, + _adjustExceptionSpan$1(span) { + var start, t1; + if (span.get$length(span) > 0) + return span; + start = this._firstNewlineBefore$1(span.get$start(span)); + if (start.$eq(0, span.get$start(span))) + t1 = span; + else { + t1 = start.offset; + t1 = A._FileSpan$(start.file, t1, t1); + } + return t1; + }, + _firstNewlineBefore$1($location) { + var lastNewline, codeUnit, + t1 = $location.file, + t2 = $location.offset, + text = A.String_String$fromCharCodes(B.NativeUint32List_methods.sublist$2(t1._decodedChars, 0, t2), 0, null), + index = t2 - 1; + for (lastNewline = null; index >= 0;) { + codeUnit = text.charCodeAt(index); + if (!(codeUnit === 32 || codeUnit === 9 || codeUnit === 10 || codeUnit === 13 || codeUnit === 12)) { + if (lastNewline == null) + t1 = $location; + else { + t2 = new A.FileLocation(t1, lastNewline); + t2.FileLocation$_$2(t1, lastNewline); + t1 = t2; + } + return t1; + } + if (codeUnit === 10 || codeUnit === 13 || codeUnit === 12) + lastNewline = index; + --index; + } + return $location; + } + }; + A.Parser__parseIdentifier_closure.prototype = { + call$0() { + var t1 = this.$this, + result = t1.identifier$0(); + t1.scanner.expectDone$0(); + return result; + }, + $signature: 27 + }; + A.Parser_escape_closure.prototype = { + call$1(char) { + return char === 32 || char === 9 || char === 10 || char === 13 || char === 12; + }, + $signature: 28 + }; + A.Parser_scanIdentChar_matches.prototype = { + call$1(actual) { + var t1 = this.char; + return this.caseSensitive ? actual === t1 : A.characterEqualsIgnoreCase(t1, actual); + }, + $signature: 46 + }; + A.Parser_spanFrom_closure.prototype = { + call$0() { + return this.$this._interpolationMap.mapSpan$1(this.span); + }, + $signature: 25 + }; + A.SassParser.prototype = { + get$currentIndentation() { + return this._currentIndentation; + }, + get$indented() { + return true; + }, + styleRuleSelector$0() { + var t4, + t1 = this.scanner, + t2 = t1._string_scanner$_position, + t3 = new A.StringBuffer(""), + buffer = new A.InterpolationBuffer(t3, A._setArrayType([], type$.JSArray_Object)); + do { + buffer.addInterpolation$1(this.almostAnyValue$1$omitComments(true)); + t4 = t3._contents += A.Primitives_stringFromCharCode(10); + } while (B.JSString_methods.endsWith$1(B.JSString_methods.trimRight$0(t4.charCodeAt(0) == 0 ? t4 : t4), ",") && this.scanCharIf$1(new A.SassParser_styleRuleSelector_closure())); + return buffer.interpolation$1(t1.spanFrom$1(new A._SpanScannerState(t1, t2))); + }, + expectStatementSeparator$1($name) { + var t1, _this = this; + if (!_this.atEndOfStatement$0()) + _this._expectNewline$0(); + if (_this._peekIndentation$0() <= _this._currentIndentation) + return; + t1 = $name == null ? "here" : "beneath a " + $name; + _this.scanner.error$2$position(0, "Nothing may be indented " + t1 + ".", _this._nextIndentationEnd.position); + }, + expectStatementSeparator$0() { + return this.expectStatementSeparator$1(null); + }, + atEndOfStatement$0() { + var t1 = this.scanner.peekChar$0(); + if (t1 == null) + t1 = null; + else + t1 = t1 === 10 || t1 === 13 || t1 === 12; + return t1 !== false; + }, + lookingAtChildren$0() { + return this.atEndOfStatement$0() && this._peekIndentation$0() > this._currentIndentation; + }, + importArgument$0() { + var url, span, innerError, stackTrace, t1, _0_0, start, next, t2, exception, _this = this; + $label0$0: { + t1 = _this.scanner; + _0_0 = t1.peekChar$0(); + if (117 === _0_0 || 85 === _0_0) { + start = new A._SpanScannerState(t1, t1._string_scanner$_position); + if (_this.scanIdentifier$1("url")) + if (t1.scanChar$1(40)) { + t1.set$state(start); + return _this.super$StylesheetParser$importArgument(); + } else + t1.set$state(start); + break $label0$0; + } + if (39 === _0_0 || 34 === _0_0) + return _this.super$StylesheetParser$importArgument(); + } + start = new A._SpanScannerState(t1, t1._string_scanner$_position); + next = t1.peekChar$0(); + while (true) { + if (next != null) + if (next !== 44) + if (next !== 59) + t2 = !(next === 10 || next === 13 || next === 12); + else + t2 = false; + else + t2 = false; + else + t2 = false; + if (!t2) + break; + t1.readChar$0(); + next = t1.peekChar$0(); + } + url = t1.substring$1(0, start.position); + span = t1.spanFrom$1(start); + if (_this.isPlainImportUrl$1(url)) + return new A.StaticImport(A.Interpolation$(A._setArrayType([A.serializeValue(new A.SassString(url, true), true, true)], type$.JSArray_Object), span), null, span); + else + try { + t1 = _this.parseImportUrl$1(url); + return new A.DynamicImport(t1, span); + } catch (exception) { + t1 = A.unwrapException(exception); + if (type$.FormatException._is(t1)) { + innerError = t1; + stackTrace = A.getTraceFromException(exception); + _this.error$3(0, "Invalid URL: " + J.get$message$x(innerError), span, stackTrace); + } else + throw exception; + } + }, + scanElse$1(ifIndentation) { + var t1, t2, startIndentation, startNextIndentation, startNextIndentationEnd, _this = this; + if (_this._peekIndentation$0() !== ifIndentation) + return false; + t1 = _this.scanner; + t2 = t1._string_scanner$_position; + startIndentation = _this._currentIndentation; + startNextIndentation = _this._nextIndentation; + startNextIndentationEnd = _this._nextIndentationEnd; + _this._readIndentation$0(); + if (t1.scanChar$1(64) && _this.scanIdentifier$1("else")) + return true; + t1.set$state(new A._SpanScannerState(t1, t2)); + _this._currentIndentation = startIndentation; + _this._nextIndentation = startNextIndentation; + _this._nextIndentationEnd = startNextIndentationEnd; + return false; + }, + children$1(_, child) { + var children = A._setArrayType([], type$.JSArray_Statement); + this._whileIndentedLower$1(new A.SassParser_children_closure(this, child, children)); + return children; + }, + statements$1(statement) { + var statements, t2, _1_0, + t1 = this.scanner, + _0_0 = t1.peekChar$0(); + if (9 === _0_0 || 32 === _0_0) + t1.error$3$length$position(0, string$.Indent, t1._string_scanner$_position, 0); + statements = A._setArrayType([], type$.JSArray_Statement); + for (t2 = t1.string.length; t1._string_scanner$_position !== t2;) { + _1_0 = this._child$1(statement); + if (_1_0 != null) + statements.push(_1_0); + this._readIndentation$0(); + } + return statements; + }, + _child$1(child) { + var _0_0, _this = this, + t1 = _this.scanner, + _1_0 = t1.peekChar$0(); + $label0$0: { + if (13 === _1_0 || 10 === _1_0 || 12 === _1_0) { + t1 = null; + break $label0$0; + } + if (36 === _1_0) { + t1 = _this.variableDeclarationWithoutNamespace$0(); + break $label0$0; + } + if (47 === _1_0) { + _0_0 = t1.peekChar$1(1); + $label1$1: { + if (47 === _0_0) { + t1 = _this._silentComment$0(); + break $label1$1; + } + if (42 === _0_0) { + t1 = _this._loudComment$0(); + break $label1$1; + } + t1 = child.call$0(); + break $label1$1; + } + break $label0$0; + } + t1 = child.call$0(); + break $label0$0; + } + return t1; + }, + _silentComment$0() { + var buffer, parentIndentation, t3, t4, t5, commentPrefix, i, t6, i0, t7, _this = this, + t1 = _this.scanner, + t2 = t1._string_scanner$_position; + t1.expect$1("//"); + buffer = new A.StringBuffer(""); + parentIndentation = _this._currentIndentation; + t3 = t1.string.length; + t4 = 1 + parentIndentation; + t5 = 2 + parentIndentation; + $label0$0: + do { + commentPrefix = t1.scanChar$1(47) ? "///" : "//"; + for (i = commentPrefix.length; true;) { + t6 = buffer._contents += commentPrefix; + for (i0 = i; i0 < _this._currentIndentation - parentIndentation; ++i0) { + t6 += A.Primitives_stringFromCharCode(32); + buffer._contents = t6; + } + while (true) { + if (t1._string_scanner$_position !== t3) { + t7 = t1.peekChar$0(); + t7 = !(t7 === 10 || t7 === 13 || t7 === 12); + } else + t7 = false; + if (!t7) + break; + t6 += A.Primitives_stringFromCharCode(t1.readChar$0()); + buffer._contents = t6; + } + buffer._contents = t6 + "\n"; + if (_this._peekIndentation$0() < parentIndentation) + break $label0$0; + if (_this._peekIndentation$0() === parentIndentation) { + if (t1.peekChar$1(t4) === 47 && t1.peekChar$1(t5) === 47) + _this._readIndentation$0(); + break; + } + _this._readIndentation$0(); + } + } while (t1.scan$1("//")); + t3 = buffer._contents; + return _this.lastSilentComment = new A.SilentComment(t3.charCodeAt(0) == 0 ? t3 : t3, t1.spanFrom$1(new A._SpanScannerState(t1, t2))); + }, + _loudComment$0() { + var t3, t4, buffer, parentIndentation, t5, t6, first, beginningOfComment, t7, end, i, _0_0, _this = this, + t1 = _this.scanner, + t2 = t1._string_scanner$_position; + t1.expect$1("/*"); + t3 = new A.StringBuffer(""); + t4 = A._setArrayType([], type$.JSArray_Object); + buffer = new A.InterpolationBuffer(t3, t4); + t3._contents = "" + "/*"; + parentIndentation = _this._currentIndentation; + for (t5 = t1.string, t6 = t5.length, first = true; true; first = false) { + if (first) { + beginningOfComment = t1._string_scanner$_position; + _this.spaces$0(); + t7 = t1.peekChar$0(); + if (t7 === 10 || t7 === 13 || t7 === 12) { + _this._readIndentation$0(); + t3._contents += A.Primitives_stringFromCharCode(32); + } else { + end = t1._string_scanner$_position; + t3._contents += B.JSString_methods.substring$2(t5, beginningOfComment, end); + } + } else { + t7 = t3._contents += "\n"; + t3._contents = t7 + " * "; + } + for (i = 3; i < _this._currentIndentation - parentIndentation; ++i) + t3._contents += A.Primitives_stringFromCharCode(32); + for (; t1._string_scanner$_position !== t6;) { + _0_0 = t1.peekChar$0(); + if (10 === _0_0 || 13 === _0_0 || 12 === _0_0) + break; + if (35 === _0_0) { + if (t1.peekChar$1(1) === 123) { + t7 = _this.singleInterpolation$0(); + buffer._flushText$0(); + t4.push(t7); + } else + t3._contents += A.Primitives_stringFromCharCode(t1.readChar$0()); + continue; + } + t3._contents += A.Primitives_stringFromCharCode(t1.readChar$0()); + } + if (_this._peekIndentation$0() <= parentIndentation) + break; + for (; _this._lookingAtDoubleNewline$0();) { + _this._expectNewline$0(); + t7 = t3._contents += "\n"; + t3._contents = t7 + " *"; + } + _this._readIndentation$0(); + } + t4 = t3._contents; + if (!B.JSString_methods.endsWith$1(B.JSString_methods.trimRight$0(t4.charCodeAt(0) == 0 ? t4 : t4), "*/")) + t3._contents += " */"; + return new A.LoudComment(buffer.interpolation$1(t1.spanFrom$1(new A._SpanScannerState(t1, t2)))); + }, + whitespaceWithoutComments$0() { + var t1, t2, next; + for (t1 = this.scanner, t2 = t1.string.length; t1._string_scanner$_position !== t2;) { + next = t1.peekChar$0(); + if (next !== 9 && next !== 32) + break; + t1.readChar$0(); + } + }, + loudComment$0() { + var next, + t1 = this.scanner; + t1.expect$1("/*"); + for (; true;) { + next = t1.readChar$0(); + if (next === 10 || next === 13 || next === 12) + t1.error$1(0, "expected */."); + if (next !== 42) + continue; + do + next = t1.readChar$0(); + while (next === 42); + if (next === 47) + break; + } + }, + _expectNewline$0() { + var t1 = this.scanner, + _0_0 = t1.peekChar$0(); + if (59 === _0_0) + t1.error$1(0, string$.semico); + if (13 === _0_0) { + t1.readChar$0(); + if (t1.peekChar$0() === 10) + t1.readChar$0(); + return; + } + if (10 === _0_0 || 12 === _0_0) { + t1.readChar$0(); + return; + } + t1.error$1(0, "expected newline."); + }, + _lookingAtDoubleNewline$0() { + var _0_0, + t1 = this.scanner, + _1_0 = t1.peekChar$0(); + $label1$1: { + if (13 === _1_0) { + _0_0 = t1.peekChar$1(1); + $label0$0: { + if (10 === _0_0) { + t1 = t1.peekChar$1(2); + t1 = t1 === 10 || t1 === 13 || t1 === 12; + break $label0$0; + } + if (13 === _0_0 || 12 === _0_0) { + t1 = true; + break $label0$0; + } + t1 = false; + break $label0$0; + } + break $label1$1; + } + if (10 === _1_0 || 12 === _1_0) { + t1 = t1.peekChar$1(1); + t1 = t1 === 10 || t1 === 13 || t1 === 12; + break $label1$1; + } + t1 = false; + break $label1$1; + } + return t1; + }, + _whileIndentedLower$1(body) { + var t1, t2, childIndentation, indentation, t3, t4, _this = this, + parentIndentation = _this._currentIndentation; + for (t1 = _this.scanner, t2 = t1._sourceFile, childIndentation = null; _this._peekIndentation$0() > parentIndentation;) { + indentation = _this._readIndentation$0(); + if (childIndentation == null) + childIndentation = indentation; + if (childIndentation !== indentation) { + t3 = t1._string_scanner$_position; + t4 = t2.getColumn$1(t3); + t1.error$3$length$position(0, "Inconsistent indentation, expected " + childIndentation + " spaces.", t2.getColumn$1(t1._string_scanner$_position), t3 - t4); + } + body.call$0(); + } + }, + _readIndentation$0() { + var t1, _this = this, + currentIndentation = _this._nextIndentation; + if (currentIndentation == null) + currentIndentation = _this._nextIndentation = _this._peekIndentation$0(); + _this._currentIndentation = currentIndentation; + t1 = _this._nextIndentationEnd; + t1.toString; + _this.scanner.set$state(t1); + _this._nextIndentationEnd = _this._nextIndentation = null; + return currentIndentation; + }, + _peekIndentation$0() { + var t1, t2, t3, start, containsTab, containsSpace, nextIndentation, _1_0, t4, _this = this, + _0_0 = _this._nextIndentation; + if (_0_0 != null) + return _0_0; + t1 = _this.scanner; + t2 = t1._string_scanner$_position; + t3 = t1.string.length; + if (t2 === t3) { + _this._nextIndentation = 0; + _this._nextIndentationEnd = new A._SpanScannerState(t1, t2); + return 0; + } + start = new A._SpanScannerState(t1, t2); + if (!_this.scanCharIf$1(new A.SassParser__peekIndentation_closure())) + t1.error$2$position(0, "Expected newline.", t1._string_scanner$_position); + containsTab = A._Cell$(); + containsSpace = A._Cell$(); + nextIndentation = A._Cell$(); + t2 = nextIndentation.__late_helper$_name; + do { + containsSpace._value = containsTab._value = false; + nextIndentation._value = 0; + for (; true;) { + $label0$0: { + _1_0 = t1.peekChar$0(); + if (32 === _1_0) { + containsSpace._value = true; + break $label0$0; + } + if (9 === _1_0) { + containsTab._value = true; + break $label0$0; + } + break; + } + t4 = nextIndentation._value; + if (t4 === nextIndentation) + A.throwExpression(A.LateError$localNI(t2)); + nextIndentation._value = t4 + 1; + t1.readChar$0(); + } + t4 = t1._string_scanner$_position; + if (t4 === t3) { + _this._nextIndentation = 0; + _this._nextIndentationEnd = new A._SpanScannerState(t1, t4); + t1.set$state(start); + return 0; + } + } while (_this.scanCharIf$1(new A.SassParser__peekIndentation_closure0())); + t2 = containsTab._readLocal$0(); + t3 = containsSpace._readLocal$0(); + if (t2) { + if (t3) { + t2 = t1._string_scanner$_position; + t3 = t1._sourceFile; + t4 = t3.getColumn$1(t2); + t1.error$3$length$position(0, "Tabs and spaces may not be mixed.", t3.getColumn$1(t1._string_scanner$_position), t2 - t4); + } else if (_this._spaces === true) { + t2 = t1._string_scanner$_position; + t3 = t1._sourceFile; + t4 = t3.getColumn$1(t2); + t1.error$3$length$position(0, "Expected spaces, was tabs.", t3.getColumn$1(t1._string_scanner$_position), t2 - t4); + } + } else if (t3 && _this._spaces === false) { + t2 = t1._string_scanner$_position; + t3 = t1._sourceFile; + t4 = t3.getColumn$1(t2); + t1.error$3$length$position(0, "Expected tabs, was spaces.", t3.getColumn$1(t1._string_scanner$_position), t2 - t4); + } + _this._nextIndentation = nextIndentation._readLocal$0(); + if (nextIndentation._readLocal$0() > 0) + if (_this._spaces == null) + _this._spaces = containsSpace._readLocal$0(); + _this._nextIndentationEnd = new A._SpanScannerState(t1, t1._string_scanner$_position); + t1.set$state(start); + return nextIndentation._readLocal$0(); + } + }; + A.SassParser_styleRuleSelector_closure.prototype = { + call$1(char) { + return char === 10 || char === 13 || char === 12; + }, + $signature: 28 + }; + A.SassParser_children_closure.prototype = { + call$0() { + var _0_0 = this.$this._child$1(this.child); + if (_0_0 != null) + this.children.push(_0_0); + }, + $signature: 0 + }; + A.SassParser__peekIndentation_closure.prototype = { + call$1(char) { + return char === 10 || char === 13 || char === 12; + }, + $signature: 28 + }; + A.SassParser__peekIndentation_closure0.prototype = { + call$1(char) { + return char === 10 || char === 13 || char === 12; + }, + $signature: 28 + }; + A.ScssParser.prototype = { + get$indented() { + return false; + }, + get$currentIndentation() { + return 0; + }, + styleRuleSelector$0() { + return this.almostAnyValue$0(); + }, + expectStatementSeparator$1($name) { + var t1, _0_0; + this.whitespaceWithoutComments$0(); + t1 = this.scanner; + if (t1._string_scanner$_position === t1.string.length) + return; + _0_0 = t1.peekChar$0(); + if (59 === _0_0 || 125 === _0_0) + return; + t1.expectChar$1(59); + }, + expectStatementSeparator$0() { + return this.expectStatementSeparator$1(null); + }, + atEndOfStatement$0() { + var next = this.scanner.peekChar$0(); + return next == null || next === 59 || next === 125 || next === 123; + }, + lookingAtChildren$0() { + return this.scanner.peekChar$0() === 123; + }, + scanElse$1(ifIndentation) { + var t3, _this = this, + t1 = _this.scanner, + t2 = t1._string_scanner$_position; + _this.whitespace$0(); + t3 = t1._string_scanner$_position; + if (t1.scanChar$1(64)) { + if (_this.scanIdentifier$2$caseSensitive("else", true)) + return true; + if (_this.scanIdentifier$2$caseSensitive("elseif", true)) { + A.WarnForDeprecation_warnForDeprecation(_this.logger, B.Deprecation_JAZ, string$.x40elsei, t1.spanFrom$1(new A._SpanScannerState(t1, t3)), null); + t1.set$position(t1._string_scanner$_position - 2); + return true; + } + } + t1.set$state(new A._SpanScannerState(t1, t2)); + return false; + }, + children$1(_, child) { + var children, _this = this, + t1 = _this.scanner; + t1.expectChar$1(123); + _this.whitespaceWithoutComments$0(); + children = A._setArrayType([], type$.JSArray_Statement); + for (; true;) + switch (t1.peekChar$0()) { + case 36: + children.push(_this.variableDeclarationWithoutNamespace$0()); + break; + case 47: + switch (t1.peekChar$1(1)) { + case 47: + children.push(_this._scss$_silentComment$0()); + _this.whitespaceWithoutComments$0(); + break; + case 42: + children.push(_this._scss$_loudComment$0()); + _this.whitespaceWithoutComments$0(); + break; + default: + children.push(child.call$0()); + } + break; + case 59: + t1.readChar$0(); + _this.whitespaceWithoutComments$0(); + break; + case 125: + t1.expectChar$1(125); + return children; + default: + children.push(child.call$0()); + } + }, + statements$1(statement) { + var t1, t2, _0_0, _1_0, _this = this, + statements = A._setArrayType([], type$.JSArray_Statement); + _this.whitespaceWithoutComments$0(); + for (t1 = _this.scanner, t2 = t1.string.length; t1._string_scanner$_position !== t2;) + switch (t1.peekChar$0()) { + case 36: + statements.push(_this.variableDeclarationWithoutNamespace$0()); + break; + case 47: + switch (t1.peekChar$1(1)) { + case 47: + statements.push(_this._scss$_silentComment$0()); + _this.whitespaceWithoutComments$0(); + break; + case 42: + statements.push(_this._scss$_loudComment$0()); + _this.whitespaceWithoutComments$0(); + break; + default: + _0_0 = statement.call$0(); + if (_0_0 != null) + statements.push(_0_0); + } + break; + case 59: + t1.readChar$0(); + _this.whitespaceWithoutComments$0(); + break; + default: + _1_0 = statement.call$0(); + if (_1_0 != null) + statements.push(_1_0); + } + return statements; + }, + _scss$_silentComment$0() { + var t2, t3, _this = this, + t1 = _this.scanner, + start = new A._SpanScannerState(t1, t1._string_scanner$_position); + t1.expect$1("//"); + t2 = t1.string.length; + do { + while (true) { + if (t1._string_scanner$_position !== t2) { + t3 = t1.readChar$0(); + t3 = !(t3 === 10 || t3 === 13 || t3 === 12); + } else + t3 = false; + if (!t3) + break; + } + if (t1._string_scanner$_position === t2) + break; + _this.spaces$0(); + } while (t1.scan$1("//")); + if (_this.get$plainCss()) + _this.error$2(0, string$.Silent, t1.spanFrom$1(start)); + return _this.lastSilentComment = new A.SilentComment(t1.substring$1(0, start.position), t1.spanFrom$1(start)); + }, + _scss$_loudComment$0() { + var t3, t4, buffer, t5, endPosition, t6, result, + t1 = this.scanner, + t2 = t1._string_scanner$_position; + t1.expect$1("/*"); + t3 = new A.StringBuffer(""); + t4 = A._setArrayType([], type$.JSArray_Object); + buffer = new A.InterpolationBuffer(t3, t4); + t3._contents = "" + "/*"; + $label0$1: + for (; true;) + switch (t1.peekChar$0()) { + case 35: + if (t1.peekChar$1(1) === 123) { + t5 = this.singleInterpolation$0(); + buffer._flushText$0(); + t4.push(t5); + } else + t3._contents += A.Primitives_stringFromCharCode(t1.readChar$0()); + break; + case 42: + t3._contents += A.Primitives_stringFromCharCode(t1.readChar$0()); + if (t1.peekChar$0() !== 47) + continue $label0$1; + t3._contents += A.Primitives_stringFromCharCode(t1.readChar$0()); + endPosition = t1._string_scanner$_position; + t5 = t1._sourceFile; + t6 = new A._SpanScannerState(t1, t2).position; + t1 = new A._FileSpan(t5, t6, endPosition); + t1._FileSpan$3(t5, t6, endPosition); + t6 = type$.Object; + t5 = A.List_List$of(t4, true, t6); + t2 = t3._contents; + if (t2.length !== 0) + t5.push(t2.charCodeAt(0) == 0 ? t2 : t2); + result = A.List_List$from(t5, false, t6); + result.fixed$length = Array; + result.immutable$list = Array; + t2 = new A.Interpolation(result, t1); + t2.Interpolation$2(t5, t1); + return new A.LoudComment(t2); + case 13: + t1.readChar$0(); + if (t1.peekChar$0() !== 10) + t3._contents += A.Primitives_stringFromCharCode(10); + break; + case 12: + t1.readChar$0(); + t3._contents += A.Primitives_stringFromCharCode(10); + break; + default: + t3._contents += A.Primitives_stringFromCharCode(t1.readChar$0()); + } + } + }; + A.SelectorParser.prototype = { + parse$0() { + return this.wrapSpanFormatException$1(new A.SelectorParser_parse_closure(this)); + }, + parseCompoundSelector$0() { + return this.wrapSpanFormatException$1(new A.SelectorParser_parseCompoundSelector_closure(this)); + }, + _selectorList$0() { + var t4, t5, lineBreak, _this = this, + t1 = _this.scanner, + t2 = t1._string_scanner$_position, + t3 = t1._sourceFile, + previousLine = t3.getLine$1(t2), + components = A._setArrayType([_this._complexSelector$0()], type$.JSArray_ComplexSelector); + _this.whitespace$0(); + for (t4 = t1.string.length; t1.scanChar$1(44);) { + _this.whitespace$0(); + if (t1.peekChar$0() === 44) + continue; + t5 = t1._string_scanner$_position; + if (t5 === t4) + break; + lineBreak = t3.getLine$1(t5) !== previousLine; + if (lineBreak) + previousLine = t3.getLine$1(t1._string_scanner$_position); + components.push(_this._complexSelector$1$lineBreak(lineBreak)); + } + return A.SelectorList$(components, _this.spanFrom$1(new A._SpanScannerState(t1, t2))); + }, + _complexSelector$1$lineBreak(lineBreak) { + var t4, lastCompound, initialCombinators, _0_0, t5, result, _this = this, + t1 = _this.scanner, + t2 = t1._string_scanner$_position, + componentStart = new A._SpanScannerState(t1, t2), + t3 = type$.JSArray_CssValue_Combinator, + combinators = A._setArrayType([], t3), + components = A._setArrayType([], type$.JSArray_ComplexSelectorComponent); + for (t4 = type$.CssValue_Combinator, lastCompound = null, initialCombinators = null; true;) { + _this.whitespace$0(); + _0_0 = t1.peekChar$0(); + if (43 === _0_0) { + t5 = t1._string_scanner$_position; + t1.readChar$0(); + combinators.push(new A.CssValue(B.Combinator_4QF, _this.spanFrom$1(new A._SpanScannerState(t1, t5)), t4)); + continue; + } + if (62 === _0_0) { + t5 = t1._string_scanner$_position; + t1.readChar$0(); + combinators.push(new A.CssValue(B.Combinator_Cht, _this.spanFrom$1(new A._SpanScannerState(t1, t5)), t4)); + continue; + } + if (126 === _0_0) { + t5 = t1._string_scanner$_position; + t1.readChar$0(); + combinators.push(new A.CssValue(B.Combinator_Htt, _this.spanFrom$1(new A._SpanScannerState(t1, t5)), t4)); + continue; + } + if (_0_0 == null) + break; + if (91 !== _0_0) + if (46 !== _0_0) + if (35 !== _0_0) + if (37 !== _0_0) + if (58 !== _0_0) + if (38 !== _0_0) + if (42 !== _0_0) + if (124 !== _0_0) + t5 = _this.lookingAtIdentifier$0(); + else + t5 = true; + else + t5 = true; + else + t5 = true; + else + t5 = true; + else + t5 = true; + else + t5 = true; + else + t5 = true; + else + t5 = true; + if (t5) { + if (lastCompound != null) { + t5 = _this.spanFrom$1(componentStart); + result = A.List_List$from(combinators, false, t4); + result.fixed$length = Array; + result.immutable$list = Array; + components.push(new A.ComplexSelectorComponent(lastCompound, result, t5)); + } else if (combinators.length !== 0) { + componentStart = new A._SpanScannerState(t1, t1._string_scanner$_position); + initialCombinators = combinators; + } + lastCompound = _this._compoundSelector$0(); + combinators = A._setArrayType([], t3); + if (t1.peekChar$0() === 38) + t1.error$1(0, string$.x22x26__ma); + continue; + } + break; + } + if (lastCompound != null) { + t3 = _this.spanFrom$1(componentStart); + components.push(new A.ComplexSelectorComponent(lastCompound, A.List_List$unmodifiable(combinators, t4), t3)); + } else if (combinators.length !== 0) + initialCombinators = combinators; + else + t1.error$1(0, "expected selector."); + t3 = initialCombinators == null ? B.List_empty1 : initialCombinators; + return A.ComplexSelector$(t3, components, _this.spanFrom$1(new A._SpanScannerState(t1, t2)), lineBreak); + }, + _complexSelector$0() { + return this._complexSelector$1$lineBreak(false); + }, + _compoundSelector$0() { + var t3, _this = this, + t1 = _this.scanner, + t2 = t1._string_scanner$_position, + components = A._setArrayType([_this._simpleSelector$0()], type$.JSArray_SimpleSelector); + while (true) { + t3 = t1.peekChar$0(); + if (!(t3 === 42 || t3 === 91 || t3 === 46 || t3 === 35 || t3 === 37 || t3 === 58)) + break; + components.push(_this._simpleSelector$1$allowParent(false)); + } + return A.CompoundSelector$(components, _this.spanFrom$1(new A._SpanScannerState(t1, t2))); + }, + _simpleSelector$1$allowParent(allowParent) { + var t2, $name, text, t3, suffix, _this = this, + t1 = _this.scanner, + start = new A._SpanScannerState(t1, t1._string_scanner$_position); + if (allowParent == null) + allowParent = _this._allowParent; + switch (t1.peekChar$0()) { + case 91: + return _this._attributeSelector$0(); + case 46: + t2 = t1._string_scanner$_position; + t1.expectChar$1(46); + return new A.ClassSelector(_this.identifier$0(), _this.spanFrom$1(new A._SpanScannerState(t1, t2))); + case 35: + t2 = t1._string_scanner$_position; + t1.expectChar$1(35); + return new A.IDSelector(_this.identifier$0(), _this.spanFrom$1(new A._SpanScannerState(t1, t2))); + case 37: + t2 = t1._string_scanner$_position; + t1.expectChar$1(37); + $name = _this.identifier$0(); + t2 = _this.spanFrom$1(new A._SpanScannerState(t1, t2)); + if (!_this._allowPlaceholder) + _this.error$2(0, string$.Placeh, t1.spanFrom$1(start)); + return new A.PlaceholderSelector($name, t2); + case 58: + return _this._pseudoSelector$0(); + case 38: + t2 = t1._string_scanner$_position; + t1.expectChar$1(38); + if (_this.lookingAtIdentifierBody$0()) { + text = new A.StringBuffer(""); + _this._identifierBody$1(text); + if (text._contents.length === 0) + t1.error$1(0, "Expected identifier body."); + t3 = text._contents; + suffix = t3.charCodeAt(0) == 0 ? t3 : t3; + } else + suffix = null; + t2 = _this.spanFrom$1(new A._SpanScannerState(t1, t2)); + if (!allowParent) + _this.error$2(0, "Parent selectors aren't allowed here.", t1.spanFrom$1(start)); + return new A.ParentSelector(suffix, t2); + default: + return _this._typeOrUniversalSelector$0(); + } + }, + _simpleSelector$0() { + return this._simpleSelector$1$allowParent(null); + }, + _attributeSelector$0() { + var $name, operator, next, value, modifier, _this = this, _null = null, + t1 = _this.scanner, + start = new A._SpanScannerState(t1, t1._string_scanner$_position); + t1.expectChar$1(91); + _this.whitespace$0(); + $name = _this._attributeName$0(); + _this.whitespace$0(); + if (t1.scanChar$1(93)) + return new A.AttributeSelector($name, _null, _null, _null, _this.spanFrom$1(start)); + operator = _this._attributeOperator$0(); + _this.whitespace$0(); + next = t1.peekChar$0(); + value = next === 39 || next === 34 ? _this.string$0() : _this.identifier$0(); + _this.whitespace$0(); + next = t1.peekChar$0(); + modifier = next != null && A.CharacterExtension_get_isAlphabetic(next) ? A.Primitives_stringFromCharCode(t1.readChar$0()) : _null; + t1.expectChar$1(93); + return new A.AttributeSelector($name, operator, value, modifier, _this.spanFrom$1(start)); + }, + _attributeName$0() { + var nameOrNamespace, _this = this, + t1 = _this.scanner; + if (t1.scanChar$1(42)) { + t1.expectChar$1(124); + return new A.QualifiedName(_this.identifier$0(), "*"); + } + if (t1.scanChar$1(124)) + return new A.QualifiedName(_this.identifier$0(), ""); + nameOrNamespace = _this.identifier$0(); + if (t1.peekChar$0() !== 124 || t1.peekChar$1(1) === 61) + return new A.QualifiedName(nameOrNamespace, null); + t1.readChar$0(); + return new A.QualifiedName(_this.identifier$0(), nameOrNamespace); + }, + _attributeOperator$0() { + var t1 = this.scanner, + t2 = t1._string_scanner$_position; + switch (t1.readChar$0()) { + case 61: + return B.AttributeOperator_ES6; + case 126: + t1.expectChar$1(61); + return B.AttributeOperator_r60; + case 124: + t1.expectChar$1(61); + return B.AttributeOperator_ivT; + case 94: + t1.expectChar$1(61); + return B.AttributeOperator_eot; + case 36: + t1.expectChar$1(61); + return B.AttributeOperator_BGd; + case 42: + t1.expectChar$1(61); + return B.AttributeOperator_8aB; + default: + t1.error$2$position(0, 'Expected "]".', t2); + } + }, + _pseudoSelector$0() { + var element, $name, unvendored, selector, argument, t2, _this = this, _null = null, + t1 = _this.scanner, + start = new A._SpanScannerState(t1, t1._string_scanner$_position); + t1.expectChar$1(58); + element = t1.scanChar$1(58); + $name = _this.identifier$0(); + if (!t1.scanChar$1(40)) + return A.PseudoSelector$($name, _this.spanFrom$1(start), _null, element, _null); + _this.whitespace$0(); + unvendored = A.unvendor($name); + if (element) + if ($._selectorPseudoElements.contains$1(0, unvendored)) { + selector = _this._selectorList$0(); + argument = _null; + } else { + argument = _this.declarationValue$1$allowEmpty(true); + selector = _null; + } + else if ($._selectorPseudoClasses.contains$1(0, unvendored)) { + selector = _this._selectorList$0(); + argument = _null; + } else if (unvendored === "nth-child" || unvendored === "nth-last-child") { + argument = _this._aNPlusB$0(); + _this.whitespace$0(); + t2 = t1.peekChar$1(-1); + if ((t2 === 32 || t2 === 9 || t2 === 10 || t2 === 13 || t2 === 12) && t1.peekChar$0() !== 41) { + _this.expectIdentifier$1("of"); + argument += " of"; + _this.whitespace$0(); + selector = _this._selectorList$0(); + } else + selector = _null; + } else { + argument = B.JSString_methods.trimRight$0(_this.declarationValue$1$allowEmpty(true)); + selector = _null; + } + t1.expectChar$1(41); + return A.PseudoSelector$($name, _this.spanFrom$1(start), argument, element, selector); + }, + _aNPlusB$0() { + var t1, _0_0, t2, $self, next, _this = this; + $label0$0: { + t1 = _this.scanner; + _0_0 = t1.peekChar$0(); + if (101 === _0_0 || 69 === _0_0) { + _this.expectIdentifier$1("even"); + return "even"; + } + if (111 === _0_0 || 79 === _0_0) { + _this.expectIdentifier$1("odd"); + return "odd"; + } + if (43 === _0_0 || 45 === _0_0) { + t2 = "" + A.Primitives_stringFromCharCode(t1.readChar$0()); + break $label0$0; + } + t2 = ""; + } + $self = t1.peekChar$0(); + if ($self != null && $self >= 48 && $self <= 57) { + do { + t2 += A.Primitives_stringFromCharCode(t1.readChar$0()); + $self = t1.peekChar$0(); + } while ($self != null && $self >= 48 && $self <= 57); + _this.whitespace$0(); + if (!_this.scanIdentChar$1(110)) + return t2.charCodeAt(0) == 0 ? t2 : t2; + } else + _this.expectIdentChar$1(110); + t2 += A.Primitives_stringFromCharCode(110); + _this.whitespace$0(); + next = t1.peekChar$0(); + if (next !== 43 && next !== 45) + return t2.charCodeAt(0) == 0 ? t2 : t2; + t2 += A.Primitives_stringFromCharCode(t1.readChar$0()); + _this.whitespace$0(); + $self = t1.peekChar$0(); + if (!($self != null && $self >= 48 && $self <= 57)) + t1.error$1(0, "Expected a number."); + do { + t2 += A.Primitives_stringFromCharCode(t1.readChar$0()); + $self = t1.peekChar$0(); + } while ($self != null && $self >= 48 && $self <= 57); + return t2.charCodeAt(0) == 0 ? t2 : t2; + }, + _typeOrUniversalSelector$0() { + var nameOrNamespace, _this = this, + t1 = _this.scanner, + start = new A._SpanScannerState(t1, t1._string_scanner$_position); + if (t1.scanChar$1(42)) { + if (!t1.scanChar$1(124)) + return new A.UniversalSelector(null, _this.spanFrom$1(start)); + return t1.scanChar$1(42) ? new A.UniversalSelector("*", _this.spanFrom$1(start)) : new A.TypeSelector(new A.QualifiedName(_this.identifier$0(), "*"), _this.spanFrom$1(start)); + } else if (t1.scanChar$1(124)) + return t1.scanChar$1(42) ? new A.UniversalSelector("", _this.spanFrom$1(start)) : new A.TypeSelector(new A.QualifiedName(_this.identifier$0(), ""), _this.spanFrom$1(start)); + nameOrNamespace = _this.identifier$0(); + if (!t1.scanChar$1(124)) + return new A.TypeSelector(new A.QualifiedName(nameOrNamespace, null), _this.spanFrom$1(start)); + else if (t1.scanChar$1(42)) + return new A.UniversalSelector(nameOrNamespace, _this.spanFrom$1(start)); + else + return new A.TypeSelector(new A.QualifiedName(_this.identifier$0(), nameOrNamespace), _this.spanFrom$1(start)); + } + }; + A.SelectorParser_parse_closure.prototype = { + call$0() { + var t1 = this.$this, + selector = t1._selectorList$0(); + t1 = t1.scanner; + if (t1._string_scanner$_position !== t1.string.length) + t1.error$1(0, "expected selector."); + return selector; + }, + $signature: 350 + }; + A.SelectorParser_parseCompoundSelector_closure.prototype = { + call$0() { + var t1 = this.$this, + compound = t1._compoundSelector$0(); + t1 = t1.scanner; + if (t1._string_scanner$_position !== t1.string.length) + t1.error$1(0, "expected selector."); + return compound; + }, + $signature: 349 + }; + A.StylesheetParser.prototype = { + parse$0() { + return this.wrapSpanFormatException$1(new A.StylesheetParser_parse_closure(this)); + }, + parseArgumentDeclaration$0() { + return this._parseSingleProduction$1$1(new A.StylesheetParser_parseArgumentDeclaration_closure(this), type$.ArgumentDeclaration); + }, + parseVariableDeclaration$0() { + return this._parseSingleProduction$1$1(new A.StylesheetParser_parseVariableDeclaration_closure(this), type$.VariableDeclaration); + }, + parseUseRule$0() { + return this._parseSingleProduction$1$1(new A.StylesheetParser_parseUseRule_closure(this), type$.UseRule); + }, + _parseSingleProduction$1$1(production, $T) { + return this.wrapSpanFormatException$1(new A.StylesheetParser__parseSingleProduction_closure(this, production, $T)); + }, + _statement$1$root(root) { + var t2, _this = this, + t1 = _this.scanner, + _0_0 = t1.peekChar$0(); + if (64 === _0_0) + return _this.atRule$2$root(new A.StylesheetParser__statement_closure(_this), root); + if (43 === _0_0) { + if (!_this.get$indented() || !_this.lookingAtIdentifier$1(1)) + return _this._styleRule$0(); + _this._isUseAllowed = false; + t2 = t1._string_scanner$_position; + t1.readChar$0(); + return _this._includeRule$1(new A._SpanScannerState(t1, t2)); + } + if (61 === _0_0) { + if (!_this.get$indented()) + return _this._styleRule$0(); + _this._isUseAllowed = false; + t2 = t1._string_scanner$_position; + t1.readChar$0(); + _this.whitespace$0(); + return _this._mixinRule$1(new A._SpanScannerState(t1, t2)); + } + if (125 === _0_0) + t1.error$2$length(0, 'unmatched "}".', 1); + return _this._inStyleRule || _this._stylesheet$_inUnknownAtRule || _this._stylesheet$_inMixin || _this._inContentBlock ? _this._declarationOrStyleRule$0() : _this._variableDeclarationOrStyleRule$0(); + }, + _statement$0() { + return this._statement$1$root(false); + }, + _variableDeclarationWithNamespace$0() { + var t1 = this.scanner, + t2 = t1._string_scanner$_position, + namespace = this.identifier$0(); + t1.expectChar$1(46); + return this.variableDeclarationWithoutNamespace$2(namespace, new A._SpanScannerState(t1, t2)); + }, + variableDeclarationWithoutNamespace$2(namespace, start_) { + var t1, start, $name, t2, value, flagStart, t3, guarded, global, _0_0, endPosition, t4, t5, t6, declaration, _this = this, + precedingComment = _this.lastSilentComment; + _this.lastSilentComment = null; + if (start_ == null) { + t1 = _this.scanner; + start = new A._SpanScannerState(t1, t1._string_scanner$_position); + } else + start = start_; + $name = _this.variableName$0(); + t1 = namespace != null; + if (t1) + _this._assertPublic$2($name, new A.StylesheetParser_variableDeclarationWithoutNamespace_closure(_this, start)); + if (_this.get$plainCss()) + _this.error$2(0, string$.Sass_v, _this.scanner.spanFrom$1(start)); + _this.whitespace$0(); + t2 = _this.scanner; + t2.expectChar$1(58); + _this.whitespace$0(); + value = _this._expression$0(); + flagStart = new A._SpanScannerState(t2, t2._string_scanner$_position); + for (t3 = _this.logger, guarded = false, global = false; t2.scanChar$1(33);) { + $label0$0: { + _0_0 = _this.identifier$0(); + if ("default" === _0_0) { + if (guarded) { + endPosition = t2._string_scanner$_position; + t4 = t2._sourceFile; + t5 = flagStart.position; + t6 = new A._FileSpan(t4, t5, endPosition); + t6._FileSpan$3(t4, t5, endPosition); + A.WarnForDeprecation_warnForDeprecation(t3, B.Deprecation_Auo, string$.x21defau, t6, null); + } + guarded = true; + break $label0$0; + } + if ("global" === _0_0) { + if (t1) { + endPosition = t2._string_scanner$_position; + t4 = t2._sourceFile; + t5 = flagStart.position; + t6 = new A._FileSpan(t4, t5, endPosition); + t6._FileSpan$3(t4, t5, endPosition); + _this.error$2(0, string$.x21globai, t6); + } else if (global) { + endPosition = t2._string_scanner$_position; + t4 = t2._sourceFile; + t5 = flagStart.position; + t6 = new A._FileSpan(t4, t5, endPosition); + t6._FileSpan$3(t4, t5, endPosition); + A.WarnForDeprecation_warnForDeprecation(t3, B.Deprecation_Auo, string$.x21globas, t6, null); + } + global = true; + break $label0$0; + } + endPosition = t2._string_scanner$_position; + t4 = t2._sourceFile; + t5 = flagStart.position; + t6 = new A._FileSpan(t4, t5, endPosition); + t6._FileSpan$3(t4, t5, endPosition); + _this.error$2(0, "Invalid flag name.", t6); + } + _this.whitespace$0(); + flagStart = new A._SpanScannerState(t2, t2._string_scanner$_position); + } + _this.expectStatementSeparator$1("variable declaration"); + declaration = A.VariableDeclaration$($name, value, t2.spanFrom$1(start), precedingComment, global, guarded, namespace); + if (global) + _this._globalVariables.putIfAbsent$2($name, new A.StylesheetParser_variableDeclarationWithoutNamespace_closure0(declaration)); + return declaration; + }, + variableDeclarationWithoutNamespace$0() { + return this.variableDeclarationWithoutNamespace$2(null, null); + }, + _variableDeclarationOrStyleRule$0() { + var t1, t2, variableOrInterpolation, t3, _this = this; + if (_this.get$plainCss()) + return _this._styleRule$0(); + if (_this.get$indented() && _this.scanner.scanChar$1(92)) + return _this._styleRule$0(); + if (!_this.lookingAtIdentifier$0()) + return _this._styleRule$0(); + t1 = _this.scanner; + t2 = t1._string_scanner$_position; + variableOrInterpolation = _this._variableDeclarationOrInterpolation$0(); + if (variableOrInterpolation instanceof A.VariableDeclaration) + t1 = variableOrInterpolation; + else { + t3 = new A.InterpolationBuffer(new A.StringBuffer(""), A._setArrayType([], type$.JSArray_Object)); + t3.addInterpolation$1(type$.Interpolation._as(variableOrInterpolation)); + t2 = _this._styleRule$2(t3, new A._SpanScannerState(t1, t2)); + t1 = t2; + } + return t1; + }, + _declarationOrStyleRule$0() { + var t1, t2, declarationOrBuffer, _this = this; + if (_this.get$plainCss() && _this._inStyleRule && !_this._stylesheet$_inUnknownAtRule) + return _this._propertyOrVariableDeclaration$0(); + if (_this.get$indented() && _this.scanner.scanChar$1(92)) + return _this._styleRule$0(); + t1 = _this.scanner; + t2 = t1._string_scanner$_position; + declarationOrBuffer = _this._declarationOrBuffer$0(); + return type$.Statement._is(declarationOrBuffer) ? declarationOrBuffer : _this._styleRule$2(type$.InterpolationBuffer._as(declarationOrBuffer), new A._SpanScannerState(t1, t2)); + }, + _declarationOrBuffer$0() { + var midBuffer, couldBeSelector, beforeDeclaration, additional, t3, startsWithPunctuation, variableOrInterpolation, t4, $name, postColonWhitespace, exception, _this = this, t1 = {}, + t2 = _this.scanner, + start = new A._SpanScannerState(t2, t2._string_scanner$_position), + nameBuffer = new A.InterpolationBuffer(new A.StringBuffer(""), A._setArrayType([], type$.JSArray_Object)); + if (_this._lookingAtPotentialPropertyHack$0()) { + t3 = t2.readChar$0(); + nameBuffer._interpolation_buffer$_text._contents += A.Primitives_stringFromCharCode(t3); + t3 = _this.rawText$1(_this.get$whitespace()); + nameBuffer._interpolation_buffer$_text._contents += t3; + startsWithPunctuation = true; + } else + startsWithPunctuation = false; + if (!_this._lookingAtInterpolatedIdentifier$0()) + return nameBuffer; + variableOrInterpolation = startsWithPunctuation ? _this.interpolatedIdentifier$0() : _this._variableDeclarationOrInterpolation$0(); + if (variableOrInterpolation instanceof A.VariableDeclaration) + return variableOrInterpolation; + else + nameBuffer.addInterpolation$1(type$.Interpolation._as(variableOrInterpolation)); + _this._isUseAllowed = false; + if (t2.matches$1("/*")) { + t3 = _this.rawText$1(_this.get$loudComment()); + nameBuffer._interpolation_buffer$_text._contents += t3; + } + midBuffer = new A.StringBuffer(""); + t3 = _this.get$whitespace(); + midBuffer._contents += _this.rawText$1(t3); + t4 = t2._string_scanner$_position; + if (!t2.scanChar$1(58)) { + if (midBuffer._contents.length !== 0) + nameBuffer._interpolation_buffer$_text._contents += A.Primitives_stringFromCharCode(32); + return nameBuffer; + } + midBuffer._contents += A.Primitives_stringFromCharCode(58); + $name = nameBuffer.interpolation$1(t2.spanFrom$2(start, new A._SpanScannerState(t2, t4))); + if (B.JSString_methods.startsWith$1($name.get$initialPlain(), "--")) { + t1 = _this._interpolatedDeclarationValue$0(); + _this.expectStatementSeparator$1("custom property"); + return A.Declaration$($name, new A.StringExpression(t1, false), t2.spanFrom$1(start)); + } + if (t2.scanChar$1(58)) { + t1 = nameBuffer; + t2 = t1._interpolation_buffer$_text; + t2._contents += A.S(midBuffer); + t2._contents += A.Primitives_stringFromCharCode(58); + return t1; + } else if (_this.get$indented() && _this._lookingAtInterpolatedIdentifier$0()) { + t1 = nameBuffer; + t1._interpolation_buffer$_text._contents += A.S(midBuffer); + return t1; + } + postColonWhitespace = _this.rawText$1(t3); + if (_this.lookingAtChildren$0()) + return _this._withChildren$3(_this.get$_declarationChild(), start, new A.StylesheetParser__declarationOrBuffer_closure($name)); + midBuffer._contents += postColonWhitespace; + couldBeSelector = postColonWhitespace.length === 0 && _this._lookingAtInterpolatedIdentifier$0(); + beforeDeclaration = new A._SpanScannerState(t2, t2._string_scanner$_position); + t3 = t1.value = null; + try { + t3 = t1.value = _this._expression$0(); + if (_this.lookingAtChildren$0()) { + if (couldBeSelector) + _this.expectStatementSeparator$0(); + } else if (!_this.atEndOfStatement$0()) + _this.expectStatementSeparator$0(); + } catch (exception) { + if (type$.FormatException._is(A.unwrapException(exception))) { + if (!couldBeSelector) + throw exception; + t2.set$state(beforeDeclaration); + additional = _this.almostAnyValue$0(); + if (!_this.get$indented() && t2.peekChar$0() === 59) + throw exception; + nameBuffer._interpolation_buffer$_text._contents += A.S(midBuffer); + nameBuffer.addInterpolation$1(additional); + return nameBuffer; + } else + throw exception; + } + if (_this.lookingAtChildren$0()) + return _this._withChildren$3(_this.get$_declarationChild(), start, new A.StylesheetParser__declarationOrBuffer_closure0(t1, $name)); + else { + _this.expectStatementSeparator$0(); + return A.Declaration$($name, t3, t2.spanFrom$1(start)); + } + }, + _variableDeclarationOrInterpolation$0() { + var t1, start, identifier, t2, buffer, _this = this; + if (!_this.lookingAtIdentifier$0()) + return _this.interpolatedIdentifier$0(); + t1 = _this.scanner; + start = new A._SpanScannerState(t1, t1._string_scanner$_position); + identifier = _this.identifier$0(); + if (t1.matches$1(".$")) { + t1.readChar$0(); + return _this.variableDeclarationWithoutNamespace$2(identifier, start); + } else { + t2 = new A.StringBuffer(""); + buffer = new A.InterpolationBuffer(t2, A._setArrayType([], type$.JSArray_Object)); + t2._contents = "" + identifier; + if (_this._lookingAtInterpolatedIdentifierBody$0()) + buffer.addInterpolation$1(_this.interpolatedIdentifier$0()); + return buffer.interpolation$1(t1.spanFrom$1(start)); + } + }, + _styleRule$2(buffer, start_) { + var t2, start, interpolation, wasInStyleRule, _this = this, t1 = {}; + _this._isUseAllowed = false; + if (start_ == null) { + t2 = _this.scanner; + start = new A._SpanScannerState(t2, t2._string_scanner$_position); + } else + start = start_; + interpolation = t1.interpolation = _this.styleRuleSelector$0(); + if (buffer != null) { + buffer.addInterpolation$1(interpolation); + t2 = t1.interpolation = buffer.interpolation$1(_this.scanner.spanFrom$1(start)); + } else + t2 = interpolation; + if (t2.contents.length === 0) + _this.scanner.error$1(0, 'expected "}".'); + wasInStyleRule = _this._inStyleRule; + _this._inStyleRule = true; + return _this._withChildren$3(_this.get$_statement(), start, new A.StylesheetParser__styleRule_closure(t1, _this, wasInStyleRule, start)); + }, + _styleRule$0() { + return this._styleRule$2(null, null); + }, + _propertyOrVariableDeclaration$1$parseCustomProperties(parseCustomProperties) { + var t3, nameBuffer, variableOrInterpolation, $name, value, _this = this, + _s48_ = string$.Nested, + t1 = {}, + t2 = _this.scanner, + start = new A._SpanScannerState(t2, t2._string_scanner$_position); + t1.name = null; + if (_this._lookingAtPotentialPropertyHack$0()) { + t3 = new A.StringBuffer(""); + nameBuffer = new A.InterpolationBuffer(t3, A._setArrayType([], type$.JSArray_Object)); + t3._contents += A.Primitives_stringFromCharCode(t2.readChar$0()); + t3._contents += _this.rawText$1(_this.get$whitespace()); + nameBuffer.addInterpolation$1(_this.interpolatedIdentifier$0()); + t3 = t1.name = nameBuffer.interpolation$1(t2.spanFrom$1(start)); + } else if (!_this.get$plainCss()) { + variableOrInterpolation = _this._variableDeclarationOrInterpolation$0(); + if (variableOrInterpolation instanceof A.VariableDeclaration) + return variableOrInterpolation; + else { + type$.Interpolation._as(variableOrInterpolation); + t1.name = variableOrInterpolation; + } + t3 = variableOrInterpolation; + } else { + $name = _this.interpolatedIdentifier$0(); + t1.name = $name; + t3 = $name; + } + _this.whitespace$0(); + t2.expectChar$1(58); + if (parseCustomProperties && B.JSString_methods.startsWith$1(t3.get$initialPlain(), "--")) { + t1 = _this._interpolatedDeclarationValue$0(); + _this.expectStatementSeparator$1("custom property"); + return A.Declaration$(t3, new A.StringExpression(t1, false), t2.spanFrom$1(start)); + } + _this.whitespace$0(); + if (_this.lookingAtChildren$0()) { + if (_this.get$plainCss()) + t2.error$1(0, _s48_); + return _this._withChildren$3(_this.get$_declarationChild(), start, new A.StylesheetParser__propertyOrVariableDeclaration_closure(t1)); + } + value = _this._expression$0(); + if (_this.lookingAtChildren$0()) { + if (_this.get$plainCss()) + t2.error$1(0, _s48_); + return _this._withChildren$3(_this.get$_declarationChild(), start, new A.StylesheetParser__propertyOrVariableDeclaration_closure0(t1, value)); + } else { + _this.expectStatementSeparator$0(); + return A.Declaration$(t3, value, t2.spanFrom$1(start)); + } + }, + _propertyOrVariableDeclaration$0() { + return this._propertyOrVariableDeclaration$1$parseCustomProperties(true); + }, + _declarationChild$0() { + return this.scanner.peekChar$0() === 64 ? this._declarationAtRule$0() : this._propertyOrVariableDeclaration$1$parseCustomProperties(false); + }, + atRule$2$root(child, root) { + var $name, wasUseAllowed, value, optional, _this = this, + t1 = _this.scanner, + start = new A._SpanScannerState(t1, t1._string_scanner$_position); + t1.expectChar$2$name(64, "@-rule"); + $name = _this.interpolatedIdentifier$0(); + _this.whitespace$0(); + wasUseAllowed = _this._isUseAllowed; + _this._isUseAllowed = false; + switch ($name.get$asPlain()) { + case "at-root": + return _this._atRootRule$1(start); + case "content": + return _this._contentRule$1(start); + case "debug": + return _this._debugRule$1(start); + case "each": + return _this._eachRule$2(start, child); + case "else": + return _this._disallowedAtRule$1(start); + case "error": + return _this._errorRule$1(start); + case "extend": + if (!_this._inStyleRule && !_this._stylesheet$_inMixin && !_this._inContentBlock) + _this.error$2(0, string$.x40exten, t1.spanFrom$1(start)); + value = _this.almostAnyValue$0(); + optional = t1.scanChar$1(33); + if (optional) + _this.expectIdentifier$1("optional"); + _this.expectStatementSeparator$1("@extend rule"); + return new A.ExtendRule(value, optional, t1.spanFrom$1(start)); + case "for": + return _this._forRule$2(start, child); + case "forward": + _this._isUseAllowed = wasUseAllowed; + if (!root) + _this._disallowedAtRule$1(start); + return _this._forwardRule$1(start); + case "function": + return _this._functionRule$1(start); + case "if": + return _this._ifRule$2(start, child); + case "import": + return _this._importRule$1(start); + case "include": + return _this._includeRule$1(start); + case "media": + return _this.mediaRule$1(start); + case "mixin": + return _this._mixinRule$1(start); + case "-moz-document": + return _this.mozDocumentRule$2(start, $name); + case "return": + return _this._disallowedAtRule$1(start); + case "supports": + return _this.supportsRule$1(start); + case "use": + _this._isUseAllowed = wasUseAllowed; + if (!root) + _this._disallowedAtRule$1(start); + return _this._useRule$1(start); + case "warn": + return _this._warnRule$1(start); + case "while": + return _this._whileRule$2(start, child); + default: + return _this.unknownAtRule$2(start, $name); + } + }, + _declarationAtRule$0() { + var _this = this, + t1 = _this.scanner, + start = new A._SpanScannerState(t1, t1._string_scanner$_position), + _0_0 = _this._plainAtRuleName$0(); + $label0$0: { + if ("content" === _0_0) { + t1 = _this._contentRule$1(start); + break $label0$0; + } + if ("debug" === _0_0) { + t1 = _this._debugRule$1(start); + break $label0$0; + } + if ("each" === _0_0) { + t1 = _this._eachRule$2(start, _this.get$_declarationChild()); + break $label0$0; + } + if ("else" === _0_0) + _this._disallowedAtRule$1(start); + if ("error" === _0_0) { + t1 = _this._errorRule$1(start); + break $label0$0; + } + if ("for" === _0_0) { + t1 = _this._forRule$2(start, _this.get$_declarationChild()); + break $label0$0; + } + if ("if" === _0_0) { + t1 = _this._ifRule$2(start, _this.get$_declarationChild()); + break $label0$0; + } + if ("include" === _0_0) { + t1 = _this._includeRule$1(start); + break $label0$0; + } + if ("warn" === _0_0) { + t1 = _this._warnRule$1(start); + break $label0$0; + } + if ("while" === _0_0) { + t1 = _this._whileRule$2(start, _this.get$_declarationChild()); + break $label0$0; + } + t1 = _this._disallowedAtRule$1(start); + } + return t1; + }, + _functionChild$0() { + var state, variableDeclarationError, stackTrace, statement, t2, exception, t3, start, _0_0, value, _this = this, + t1 = _this.scanner; + if (t1.peekChar$0() !== 64) { + state = new A._SpanScannerState(t1, t1._string_scanner$_position); + try { + t2 = _this._variableDeclarationWithNamespace$0(); + return t2; + } catch (exception) { + t2 = A.unwrapException(exception); + t3 = type$.SourceSpanFormatException; + if (t3._is(t2)) { + variableDeclarationError = t2; + stackTrace = A.getTraceFromException(exception); + t1.set$state(state); + statement = null; + try { + statement = _this._declarationOrStyleRule$0(); + } catch (exception) { + if (t3._is(A.unwrapException(exception))) + throw A.wrapException(variableDeclarationError); + else + throw exception; + } + t2 = statement instanceof A.StyleRule ? "style rules" : "declarations"; + _this.error$3(0, "@function rules may not contain " + t2 + ".", J.get$span$z(statement), stackTrace); + } else + throw exception; + } + } + start = new A._SpanScannerState(t1, t1._string_scanner$_position); + _0_0 = _this._plainAtRuleName$0(); + $label0$0: { + if ("debug" === _0_0) { + t1 = _this._debugRule$1(start); + break $label0$0; + } + if ("each" === _0_0) { + t1 = _this._eachRule$2(start, _this.get$_functionChild()); + break $label0$0; + } + if ("else" === _0_0) + _this._disallowedAtRule$1(start); + if ("error" === _0_0) { + t1 = _this._errorRule$1(start); + break $label0$0; + } + if ("for" === _0_0) { + t1 = _this._forRule$2(start, _this.get$_functionChild()); + break $label0$0; + } + if ("if" === _0_0) { + t1 = _this._ifRule$2(start, _this.get$_functionChild()); + break $label0$0; + } + if ("return" === _0_0) { + value = _this._expression$0(); + _this.expectStatementSeparator$1("@return rule"); + t1 = new A.ReturnRule(value, t1.spanFrom$1(start)); + break $label0$0; + } + if ("warn" === _0_0) { + t1 = _this._warnRule$1(start); + break $label0$0; + } + if ("while" === _0_0) { + t1 = _this._whileRule$2(start, _this.get$_functionChild()); + break $label0$0; + } + t1 = _this._disallowedAtRule$1(start); + } + return t1; + }, + _plainAtRuleName$0() { + this.scanner.expectChar$2$name(64, "@-rule"); + var $name = this.identifier$0(); + this.whitespace$0(); + return $name; + }, + _atRootRule$1(start) { + var t2, t3, t4, buffer, t5, query, _this = this, + t1 = _this.scanner; + if (t1.peekChar$0() === 40) { + t2 = t1._string_scanner$_position; + t3 = new A.StringBuffer(""); + t4 = A._setArrayType([], type$.JSArray_Object); + buffer = new A.InterpolationBuffer(t3, t4); + t1.expectChar$1(40); + t3._contents += A.Primitives_stringFromCharCode(40); + _this.whitespace$0(); + t5 = _this._expression$0(); + buffer._flushText$0(); + t4.push(t5); + if (t1.scanChar$1(58)) { + _this.whitespace$0(); + t3._contents += A.Primitives_stringFromCharCode(58); + t3._contents += A.Primitives_stringFromCharCode(32); + t5 = _this._expression$0(); + buffer._flushText$0(); + t4.push(t5); + } + t1.expectChar$1(41); + _this.whitespace$0(); + t3._contents += A.Primitives_stringFromCharCode(41); + query = buffer.interpolation$1(t1.spanFrom$1(new A._SpanScannerState(t1, t2))); + _this.whitespace$0(); + return _this._withChildren$3(_this.get$_statement(), start, new A.StylesheetParser__atRootRule_closure(query)); + } else if (_this.lookingAtChildren$0()) + return _this._withChildren$3(_this.get$_statement(), start, new A.StylesheetParser__atRootRule_closure0()); + else + return A.AtRootRule$(A._setArrayType([_this._styleRule$0()], type$.JSArray_Statement), t1.spanFrom$1(start), null); + }, + _contentRule$1(start) { + var t1, $arguments, t2, t3, _this = this; + if (!_this._stylesheet$_inMixin) + _this.error$2(0, string$.x40conte, _this.scanner.spanFrom$1(start)); + _this.whitespace$0(); + t1 = _this.scanner; + if (t1.peekChar$0() === 40) + $arguments = _this._argumentInvocation$1$mixin(true); + else { + t2 = A.FileLocation$_(t1._sourceFile, t1._string_scanner$_position); + t3 = t2.offset; + $arguments = A.ArgumentInvocation$empty(A._FileSpan$(t2.file, t3, t3)); + } + _this.expectStatementSeparator$1("@content rule"); + return new A.ContentRule($arguments, t1.spanFrom$1(start)); + }, + _debugRule$1(start) { + var value = this._expression$0(); + this.expectStatementSeparator$1("@debug rule"); + return new A.DebugRule(value, this.scanner.spanFrom$1(start)); + }, + _eachRule$2(start, child) { + var variables, t1, _this = this, + wasInControlDirective = _this._inControlDirective; + _this._inControlDirective = true; + variables = A._setArrayType([_this.variableName$0()], type$.JSArray_String); + _this.whitespace$0(); + for (t1 = _this.scanner; t1.scanChar$1(44);) { + _this.whitespace$0(); + t1.expectChar$1(36); + variables.push(_this.identifier$1$normalize(true)); + _this.whitespace$0(); + } + _this.expectIdentifier$1("in"); + _this.whitespace$0(); + return _this._withChildren$3(child, start, new A.StylesheetParser__eachRule_closure(_this, wasInControlDirective, variables, _this._expression$0())); + }, + _errorRule$1(start) { + var value = this._expression$0(); + this.expectStatementSeparator$1("@error rule"); + return new A.ErrorRule(value, this.scanner.spanFrom$1(start)); + }, + _functionRule$1(start) { + var $name, $arguments, _0_0, _this = this, + precedingComment = _this.lastSilentComment; + _this.lastSilentComment = null; + $name = _this.identifier$1$normalize(true); + _this.whitespace$0(); + $arguments = _this._argumentDeclaration$0(); + if (_this._stylesheet$_inMixin || _this._inContentBlock) + _this.error$2(0, string$.Mixinscf, _this.scanner.spanFrom$1(start)); + else if (_this._inControlDirective) + _this.error$2(0, string$.Functi, _this.scanner.spanFrom$1(start)); + _0_0 = A.unvendor($name); + if ("calc" === _0_0 || "element" === _0_0 || "expression" === _0_0 || "url" === _0_0 || "and" === _0_0 || "or" === _0_0 || "not" === _0_0 || "clamp" === _0_0) + _this.error$2(0, "Invalid function name.", _this.scanner.spanFrom$1(start)); + _this.whitespace$0(); + return _this._withChildren$3(_this.get$_functionChild(), start, new A.StylesheetParser__functionRule_closure($name, $arguments, precedingComment)); + }, + _forRule$2(start, child) { + var variable, from, _this = this, t1 = {}, + wasInControlDirective = _this._inControlDirective; + _this._inControlDirective = true; + variable = _this.variableName$0(); + _this.whitespace$0(); + _this.expectIdentifier$1("from"); + _this.whitespace$0(); + t1.exclusive = null; + from = _this._expression$1$until(new A.StylesheetParser__forRule_closure(t1, _this)); + if (t1.exclusive == null) + _this.scanner.error$1(0, 'Expected "to" or "through".'); + _this.whitespace$0(); + return _this._withChildren$3(child, start, new A.StylesheetParser__forRule_closure0(t1, _this, wasInControlDirective, variable, from, _this._expression$0())); + }, + _forwardRule$1(start) { + var prefix, _0_0, shownMixinsAndFunctions, shownVariables, hiddenVariables, hiddenMixinsAndFunctions, _1_0, configuration, span, t1, t2, t3, t4, _this = this, _null = null, + url = _this._urlString$0(); + _this.whitespace$0(); + if (_this.scanIdentifier$1("as")) { + _this.whitespace$0(); + prefix = _this.identifier$1$normalize(true); + _this.scanner.expectChar$1(42); + _this.whitespace$0(); + } else + prefix = _null; + if (_this.scanIdentifier$1("show")) { + _0_0 = _this._memberList$0(); + shownMixinsAndFunctions = _0_0._0; + shownVariables = _0_0._1; + hiddenVariables = _null; + hiddenMixinsAndFunctions = hiddenVariables; + } else { + if (_this.scanIdentifier$1("hide")) { + _1_0 = _this._memberList$0(); + hiddenMixinsAndFunctions = _1_0._0; + hiddenVariables = _1_0._1; + } else { + hiddenVariables = _null; + hiddenMixinsAndFunctions = hiddenVariables; + } + shownVariables = _null; + shownMixinsAndFunctions = shownVariables; + } + configuration = _this._stylesheet$_configuration$1$allowGuarded(true); + _this.expectStatementSeparator$1("@forward rule"); + span = _this.scanner.spanFrom$1(start); + if (!_this._isUseAllowed) + _this.error$2(0, string$.x40forwa, span); + if (shownMixinsAndFunctions != null) { + shownVariables.toString; + t1 = type$.String; + t2 = A.LinkedHashSet_LinkedHashSet$of(shownMixinsAndFunctions, t1); + t3 = type$.UnmodifiableSetView_String; + t1 = A.LinkedHashSet_LinkedHashSet$of(shownVariables, t1); + t4 = configuration == null ? B.List_empty10 : A.List_List$unmodifiable(configuration, type$.ConfiguredVariable); + return new A.ForwardRule(url, new A.UnmodifiableSetView0(t2, t3), new A.UnmodifiableSetView0(t1, t3), _null, _null, prefix, t4, span); + } else if (hiddenMixinsAndFunctions != null) { + hiddenVariables.toString; + t1 = type$.String; + t2 = A.LinkedHashSet_LinkedHashSet$of(hiddenMixinsAndFunctions, t1); + t3 = type$.UnmodifiableSetView_String; + t1 = A.LinkedHashSet_LinkedHashSet$of(hiddenVariables, t1); + t4 = configuration == null ? B.List_empty10 : A.List_List$unmodifiable(configuration, type$.ConfiguredVariable); + return new A.ForwardRule(url, _null, _null, new A.UnmodifiableSetView0(t2, t3), new A.UnmodifiableSetView0(t1, t3), prefix, t4, span); + } else + return new A.ForwardRule(url, _null, _null, _null, _null, prefix, configuration == null ? B.List_empty10 : A.List_List$unmodifiable(configuration, type$.ConfiguredVariable), span); + }, + _memberList$0() { + var _this = this, + t1 = type$.String, + identifiers = A.LinkedHashSet_LinkedHashSet$_empty(t1), + variables = A.LinkedHashSet_LinkedHashSet$_empty(t1); + t1 = _this.scanner; + do { + _this.whitespace$0(); + _this.withErrorMessage$2(string$.Expect, new A.StylesheetParser__memberList_closure(_this, variables, identifiers)); + _this.whitespace$0(); + } while (t1.scanChar$1(44)); + return new A._Record_2(identifiers, variables); + }, + _ifRule$2(start, child) { + var condition, children, clauses, lastClause, span, _this = this, + ifIndentation = _this.get$currentIndentation(), + wasInControlDirective = _this._inControlDirective; + _this._inControlDirective = true; + condition = _this._expression$0(); + children = _this.children$1(0, child); + _this.whitespaceWithoutComments$0(); + clauses = A._setArrayType([A.IfClause$(condition, children)], type$.JSArray_IfClause); + while (true) { + if (!_this.scanElse$1(ifIndentation)) { + lastClause = null; + break; + } + _this.whitespace$0(); + if (_this.scanIdentifier$1("if")) { + _this.whitespace$0(); + clauses.push(A.IfClause$(_this._expression$0(), _this.children$1(0, child))); + } else { + lastClause = A.ElseClause$(_this.children$1(0, child)); + break; + } + } + _this._inControlDirective = wasInControlDirective; + span = _this.scanner.spanFrom$1(start); + _this.whitespaceWithoutComments$0(); + return new A.IfRule(A.List_List$unmodifiable(clauses, type$.IfClause), lastClause, span); + }, + _importRule$1(start) { + var argument, t3, _this = this, + imports = A._setArrayType([], type$.JSArray_Import), + t1 = _this.scanner, + t2 = _this.logger; + do { + _this.whitespace$0(); + argument = _this.importArgument$0(); + t3 = argument instanceof A.DynamicImport; + if (t3) + A.WarnForDeprecation_warnForDeprecation(t2, B.Deprecation_B8J, string$.Sass__, argument.span, null); + if ((_this._inControlDirective || _this._stylesheet$_inMixin) && t3) + _this._disallowedAtRule$1(start); + imports.push(argument); + _this.whitespace$0(); + } while (t1.scanChar$1(44)); + _this.expectStatementSeparator$1("@import rule"); + t1 = t1.spanFrom$1(start); + return new A.ImportRule(A.List_List$unmodifiable(imports, type$.Import), t1); + }, + importArgument$0() { + var url, urlSpan, innerError, stackTrace, modifiers, t2, exception, _this = this, + t1 = _this.scanner, + start = new A._SpanScannerState(t1, t1._string_scanner$_position), + _0_0 = t1.peekChar$0(); + if (117 === _0_0 || 85 === _0_0) { + url = _this.dynamicUrl$0(); + _this.whitespace$0(); + modifiers = _this.tryImportModifiers$0(); + return new A.StaticImport(A.Interpolation$(A._setArrayType([url], type$.JSArray_Object), t1.spanFrom$1(start)), modifiers, t1.spanFrom$1(start)); + } + url = _this.string$0(); + urlSpan = t1.spanFrom$1(start); + _this.whitespace$0(); + modifiers = _this.tryImportModifiers$0(); + if (_this.isPlainImportUrl$1(url) || modifiers != null) { + t2 = urlSpan; + return new A.StaticImport(A.Interpolation$(A._setArrayType([A.String_String$fromCharCodes(B.NativeUint32List_methods.sublist$2(t2.file._decodedChars, t2._file$_start, t2._end), 0, null)], type$.JSArray_Object), urlSpan), modifiers, t1.spanFrom$1(start)); + } else + try { + t1 = _this.parseImportUrl$1(url); + return new A.DynamicImport(t1, urlSpan); + } catch (exception) { + t1 = A.unwrapException(exception); + if (type$.FormatException._is(t1)) { + innerError = t1; + stackTrace = A.getTraceFromException(exception); + _this.error$3(0, "Invalid URL: " + J.get$message$x(innerError), urlSpan, stackTrace); + } else + throw exception; + } + }, + parseImportUrl$1(url) { + var t1 = $.$get$windows(); + if (t1.style.rootLength$1(url) > 0 && !$.$get$url().style.isRootRelative$1(url)) + return t1.toUri$1(url).toString$0(0); + A.Uri_parse(url); + return url; + }, + isPlainImportUrl$1(url) { + var _0_0, t1; + if (url.length < 5) + return false; + if (B.JSString_methods.endsWith$1(url, ".css")) + return true; + _0_0 = url.charCodeAt(0); + $label0$0: { + if (47 === _0_0) { + t1 = url.charCodeAt(1) === 47; + break $label0$0; + } + if (104 === _0_0) { + t1 = B.JSString_methods.startsWith$1(url, "http://") || B.JSString_methods.startsWith$1(url, "https://"); + break $label0$0; + } + t1 = false; + break $label0$0; + } + return t1; + }, + tryImportModifiers$0() { + var t1, start, t2, t3, buffer, identifier, t4, $name, query, endPosition, t5, result, _this = this; + if (!_this._lookingAtInterpolatedIdentifier$0() && _this.scanner.peekChar$0() !== 40) + return null; + t1 = _this.scanner; + start = new A._SpanScannerState(t1, t1._string_scanner$_position); + t2 = new A.StringBuffer(""); + t3 = A._setArrayType([], type$.JSArray_Object); + buffer = new A.InterpolationBuffer(t2, t3); + for (; true;) + if (_this._lookingAtInterpolatedIdentifier$0()) { + if (!(t3.length === 0 && t2._contents.length === 0)) + t2._contents += A.Primitives_stringFromCharCode(32); + identifier = _this.interpolatedIdentifier$0(); + buffer.addInterpolation$1(identifier); + t4 = identifier.get$asPlain(); + $name = t4 == null ? null : t4.toLowerCase(); + if ($name !== "and" && t1.scanChar$1(40)) { + if ($name === "supports") { + query = _this._importSupportsQuery$0(); + t4 = !(query instanceof A.SupportsDeclaration); + if (t4) + t2._contents += A.Primitives_stringFromCharCode(40); + buffer._flushText$0(); + t3.push(new A.SupportsExpression(query)); + if (t4) + t2._contents += A.Primitives_stringFromCharCode(41); + } else { + t2._contents += A.Primitives_stringFromCharCode(40); + buffer.addInterpolation$1(_this._interpolatedDeclarationValue$2$allowEmpty$allowSemicolon(true, true)); + t2._contents += A.Primitives_stringFromCharCode(41); + } + t1.expectChar$1(41); + _this.whitespace$0(); + } else { + _this.whitespace$0(); + if (t1.scanChar$1(44)) { + t2._contents += ", "; + buffer.addInterpolation$1(_this._mediaQueryList$0()); + endPosition = t1._string_scanner$_position; + t4 = t1._sourceFile; + t5 = start.position; + t1 = new A._FileSpan(t4, t5, endPosition); + t1._FileSpan$3(t4, t5, endPosition); + t5 = type$.Object; + t4 = A.List_List$of(t3, true, t5); + t3 = t2._contents; + if (t3.length !== 0) + t4.push(t3.charCodeAt(0) == 0 ? t3 : t3); + result = A.List_List$from(t4, false, t5); + result.fixed$length = Array; + result.immutable$list = Array; + t2 = new A.Interpolation(result, t1); + t2.Interpolation$2(t4, t1); + return t2; + } + } + } else if (t1.peekChar$0() === 40) { + if (!(t3.length === 0 && t2._contents.length === 0)) + t2._contents += A.Primitives_stringFromCharCode(32); + buffer.addInterpolation$1(_this._mediaQueryList$0()); + endPosition = t1._string_scanner$_position; + t1 = t1._sourceFile; + t4 = start.position; + t5 = new A._FileSpan(t1, t4, endPosition); + t5._FileSpan$3(t1, t4, endPosition); + t4 = type$.Object; + t3 = A.List_List$of(t3, true, t4); + t1 = t2._contents; + if (t1.length !== 0) + t3.push(t1.charCodeAt(0) == 0 ? t1 : t1); + result = A.List_List$from(t3, false, t4); + result.fixed$length = Array; + result.immutable$list = Array; + t1 = new A.Interpolation(result, t5); + t1.Interpolation$2(t3, t5); + return t1; + } else { + endPosition = t1._string_scanner$_position; + t1 = t1._sourceFile; + t4 = start.position; + t5 = new A._FileSpan(t1, t4, endPosition); + t5._FileSpan$3(t1, t4, endPosition); + t4 = type$.Object; + t3 = A.List_List$of(t3, true, t4); + t1 = t2._contents; + if (t1.length !== 0) + t3.push(t1.charCodeAt(0) == 0 ? t1 : t1); + result = A.List_List$from(t3, false, t4); + result.fixed$length = Array; + result.immutable$list = Array; + t1 = new A.Interpolation(result, t5); + t1.Interpolation$2(t3, t5); + return t1; + } + }, + _importSupportsQuery$0() { + var t1, t2, _0_0, $name, _this = this; + if (_this.scanIdentifier$1("not")) { + _this.whitespace$0(); + t1 = _this.scanner; + t2 = t1._string_scanner$_position; + return new A.SupportsNegation(_this._supportsConditionInParens$0(), t1.spanFrom$1(new A._SpanScannerState(t1, t2))); + } else { + t1 = _this.scanner; + if (t1.peekChar$0() === 40) + return _this._supportsCondition$0(); + else { + _0_0 = _this._tryImportSupportsFunction$0(); + if (_0_0 != null) + return _0_0; + t2 = t1._string_scanner$_position; + $name = _this._expression$0(); + t1.expectChar$1(58); + return _this._supportsDeclarationValue$2($name, new A._SpanScannerState(t1, t2)); + } + } + }, + _tryImportSupportsFunction$0() { + var t1, start, $name, value, _this = this; + if (!_this._lookingAtInterpolatedIdentifier$0()) + return null; + t1 = _this.scanner; + start = new A._SpanScannerState(t1, t1._string_scanner$_position); + $name = _this.interpolatedIdentifier$0(); + if (!t1.scanChar$1(40)) { + t1.set$state(start); + return null; + } + value = _this._interpolatedDeclarationValue$2$allowEmpty$allowSemicolon(true, true); + t1.expectChar$1(41); + return new A.SupportsFunction($name, value, t1.spanFrom$1(start)); + }, + _includeRule$1(start) { + var name0, namespace, $arguments, t2, t3, contentArguments, contentArguments_, wasInContentBlock, $content, _this = this, _null = null, + $name = _this.identifier$0(), + t1 = _this.scanner; + if (t1.scanChar$1(46)) { + name0 = _this._publicIdentifier$0(); + namespace = $name; + $name = name0; + } else { + $name = A.stringReplaceAllUnchecked($name, "_", "-"); + namespace = _null; + } + _this.whitespace$0(); + if (t1.peekChar$0() === 40) + $arguments = _this._argumentInvocation$1$mixin(true); + else { + t2 = A.FileLocation$_(t1._sourceFile, t1._string_scanner$_position); + t3 = t2.offset; + $arguments = A.ArgumentInvocation$empty(A._FileSpan$(t2.file, t3, t3)); + } + _this.whitespace$0(); + if (_this.scanIdentifier$1("using")) { + _this.whitespace$0(); + contentArguments = _this._argumentDeclaration$0(); + _this.whitespace$0(); + } else + contentArguments = _null; + t2 = contentArguments == null; + if (!t2 || _this.lookingAtChildren$0()) { + if (t2) { + t2 = A.FileLocation$_(t1._sourceFile, t1._string_scanner$_position); + t3 = t2.offset; + contentArguments_ = new A.ArgumentDeclaration(B.List_empty11, _null, A._FileSpan$(t2.file, t3, t3)); + } else + contentArguments_ = contentArguments; + wasInContentBlock = _this._inContentBlock; + _this._inContentBlock = true; + $content = _this._withChildren$3(_this.get$_statement(), start, new A.StylesheetParser__includeRule_closure(contentArguments_)); + _this._inContentBlock = wasInContentBlock; + } else { + _this.expectStatementSeparator$0(); + $content = _null; + } + t1 = t1.spanFrom$2(start, start); + t2 = $content == null ? $arguments : $content; + return new A.IncludeRule(namespace, $name, $arguments, $content, t1.expand$1(0, t2.get$span(t2))); + }, + mediaRule$1(start) { + return this._withChildren$3(this.get$_statement(), start, new A.StylesheetParser_mediaRule_closure(this._mediaQueryList$0())); + }, + _mixinRule$1(start) { + var $name, t1, $arguments, t2, t3, _this = this, + precedingComment = _this.lastSilentComment; + _this.lastSilentComment = null; + $name = _this.identifier$1$normalize(true); + _this.whitespace$0(); + t1 = _this.scanner; + if (t1.peekChar$0() === 40) + $arguments = _this._argumentDeclaration$0(); + else { + t2 = A.FileLocation$_(t1._sourceFile, t1._string_scanner$_position); + t3 = t2.offset; + $arguments = new A.ArgumentDeclaration(B.List_empty11, null, A._FileSpan$(t2.file, t3, t3)); + } + if (_this._stylesheet$_inMixin || _this._inContentBlock) + _this.error$2(0, string$.Mixinscm, t1.spanFrom$1(start)); + else if (_this._inControlDirective) + _this.error$2(0, string$.Mixinsb, t1.spanFrom$1(start)); + _this.whitespace$0(); + _this._stylesheet$_inMixin = true; + return _this._withChildren$3(_this.get$_statement(), start, new A.StylesheetParser__mixinRule_closure(_this, $name, $arguments, precedingComment)); + }, + mozDocumentRule$2(start, $name) { + var t5, t6, identifier, _0_0, argument, trailing, endPosition, t7, t8, start0, end, _this = this, _box_0 = {}, + t1 = _this.scanner, + t2 = t1._string_scanner$_position, + t3 = new A.StringBuffer(""), + t4 = A._setArrayType([], type$.JSArray_Object), + buffer = new A.InterpolationBuffer(t3, t4); + _box_0.needsDeprecationWarning = false; + for (t5 = _this.get$whitespace(); true;) { + if (t1.peekChar$0() === 35) { + t6 = _this.singleInterpolation$0(); + buffer._flushText$0(); + t4.push(t6); + _box_0.needsDeprecationWarning = true; + } else { + t6 = t1._string_scanner$_position; + identifier = _this.identifier$0(); + $label0$0: { + if ("url" === identifier || "url-prefix" === identifier || "domain" === identifier) { + _0_0 = _this._tryUrlContents$2$name(new A._SpanScannerState(t1, t6), identifier); + if (_0_0 != null) + buffer.addInterpolation$1(_0_0); + else { + t1.expectChar$1(40); + _this.whitespace$0(); + argument = _this.interpolatedString$0(); + t1.expectChar$1(41); + t3._contents += identifier; + t3._contents += A.Primitives_stringFromCharCode(40); + buffer.addInterpolation$1(argument.asInterpolation$0()); + t3._contents += A.Primitives_stringFromCharCode(41); + } + t6 = t3._contents; + trailing = t6.charCodeAt(0) == 0 ? t6 : t6; + if (!B.JSString_methods.endsWith$1(trailing, "url-prefix()") && !B.JSString_methods.endsWith$1(trailing, "url-prefix('')") && !B.JSString_methods.endsWith$1(trailing, 'url-prefix("")')) + _box_0.needsDeprecationWarning = true; + break $label0$0; + } + if ("regexp" === identifier) { + t3._contents += "regexp("; + t1.expectChar$1(40); + buffer.addInterpolation$1(_this.interpolatedString$0().asInterpolation$0()); + t1.expectChar$1(41); + t3._contents += A.Primitives_stringFromCharCode(41); + _box_0.needsDeprecationWarning = true; + break $label0$0; + } + endPosition = t1._string_scanner$_position; + t7 = t1._sourceFile; + t8 = new A._FileSpan(t7, t6, endPosition); + t8._FileSpan$3(t7, t6, endPosition); + _this.error$2(0, "Invalid function name.", t8); + } + } + _this.whitespace$0(); + if (!t1.scanChar$1(44)) + break; + t3._contents += A.Primitives_stringFromCharCode(44); + start0 = t1._string_scanner$_position; + t5.call$0(); + end = t1._string_scanner$_position; + t3._contents += B.JSString_methods.substring$2(t1.string, start0, end); + } + return _this._withChildren$3(_this.get$_statement(), start, new A.StylesheetParser_mozDocumentRule_closure(_box_0, _this, $name, buffer.interpolation$1(t1.spanFrom$1(new A._SpanScannerState(t1, t2))))); + }, + supportsRule$1(start) { + var _this = this, + condition = _this._supportsCondition$0(); + _this.whitespace$0(); + return _this._withChildren$3(_this.get$_statement(), start, new A.StylesheetParser_supportsRule_closure(condition)); + }, + _useRule$1(start) { + var namespace, configuration, span, t1, _this = this, + _s9_ = "@use rule", + url = _this._urlString$0(); + _this.whitespace$0(); + namespace = _this._useNamespace$2(url, start); + _this.whitespace$0(); + configuration = _this._stylesheet$_configuration$0(); + _this.expectStatementSeparator$1(_s9_); + span = _this.scanner.spanFrom$1(start); + if (!_this._isUseAllowed) + _this.error$2(0, string$.x40use_r, span); + _this.expectStatementSeparator$1(_s9_); + t1 = new A.UseRule(url, namespace, configuration == null ? B.List_empty10 : A.List_List$unmodifiable(configuration, type$.ConfiguredVariable), span); + t1.UseRule$4$configuration(url, namespace, span, configuration); + return t1; + }, + _useNamespace$2(url, start) { + var namespace, basename, dot, t1, exception, _this = this; + if (_this.scanIdentifier$1("as")) { + _this.whitespace$0(); + return _this.scanner.scanChar$1(42) ? null : _this.identifier$0(); + } + basename = url.get$pathSegments().length === 0 ? "" : B.JSArray_methods.get$last(url.get$pathSegments()); + dot = B.JSString_methods.indexOf$1(basename, "."); + t1 = B.JSString_methods.startsWith$1(basename, "_") ? 1 : 0; + namespace = B.JSString_methods.substring$2(basename, t1, dot === -1 ? basename.length : dot); + try { + t1 = A.SpanScanner$(namespace, null); + t1 = new A.Parser(t1, _this.logger, null)._parseIdentifier$0(); + return t1; + } catch (exception) { + if (type$.SassFormatException._is(A.unwrapException(exception))) + _this.error$2(0, 'The default namespace "' + A.S(namespace) + string$.x22x20is_n, _this.scanner.spanFrom$1(start)); + else + throw exception; + } + }, + _stylesheet$_configuration$1$allowGuarded(allowGuarded) { + var variableNames, configuration, t1, t2, $name, expression, t3, guarded, endPosition, t4, t5, span, _this = this; + if (!_this.scanIdentifier$1("with")) + return null; + variableNames = A.LinkedHashSet_LinkedHashSet$_empty(type$.String); + configuration = A._setArrayType([], type$.JSArray_ConfiguredVariable); + _this.whitespace$0(); + t1 = _this.scanner; + t1.expectChar$1(40); + for (; true;) { + _this.whitespace$0(); + t2 = t1._string_scanner$_position; + t1.expectChar$1(36); + $name = _this.identifier$1$normalize(true); + _this.whitespace$0(); + t1.expectChar$1(58); + _this.whitespace$0(); + expression = _this.expressionUntilComma$0(); + t3 = t1._string_scanner$_position; + if (allowGuarded && t1.scanChar$1(33)) + if (_this.identifier$0() === "default") { + _this.whitespace$0(); + guarded = true; + } else { + endPosition = t1._string_scanner$_position; + t4 = t1._sourceFile; + t5 = new A._FileSpan(t4, t3, endPosition); + t5._FileSpan$3(t4, t3, endPosition); + _this.error$2(0, "Invalid flag name.", t5); + guarded = false; + } + else + guarded = false; + endPosition = t1._string_scanner$_position; + t3 = t1._sourceFile; + span = new A._FileSpan(t3, t2, endPosition); + span._FileSpan$3(t3, t2, endPosition); + if (variableNames.contains$1(0, $name)) + _this.error$2(0, string$.The_sa, span); + variableNames.add$1(0, $name); + configuration.push(new A.ConfiguredVariable($name, expression, guarded, span)); + if (!t1.scanChar$1(44)) + break; + _this.whitespace$0(); + if (!_this._lookingAtExpression$0()) + break; + } + t1.expectChar$1(41); + return configuration; + }, + _stylesheet$_configuration$0() { + return this._stylesheet$_configuration$1$allowGuarded(false); + }, + _warnRule$1(start) { + var value = this._expression$0(); + this.expectStatementSeparator$1("@warn rule"); + return new A.WarnRule(value, this.scanner.spanFrom$1(start)); + }, + _whileRule$2(start, child) { + var _this = this, + wasInControlDirective = _this._inControlDirective; + _this._inControlDirective = true; + return _this._withChildren$3(child, start, new A.StylesheetParser__whileRule_closure(_this, wasInControlDirective, _this._expression$0())); + }, + unknownAtRule$2(start, $name) { + var t2, t3, rule, _this = this, t1 = {}, + wasInUnknownAtRule = _this._stylesheet$_inUnknownAtRule; + _this._stylesheet$_inUnknownAtRule = true; + t1.value = null; + t2 = _this.scanner; + t3 = t2.peekChar$0() !== 33 && !_this.atEndOfStatement$0() ? t1.value = _this.almostAnyValue$0() : null; + if (_this.lookingAtChildren$0()) + rule = _this._withChildren$3(_this.get$_statement(), start, new A.StylesheetParser_unknownAtRule_closure(t1, $name)); + else { + _this.expectStatementSeparator$0(); + rule = A.AtRule$($name, t2.spanFrom$1(start), null, t3); + } + _this._stylesheet$_inUnknownAtRule = wasInUnknownAtRule; + return rule; + }, + _disallowedAtRule$1(start) { + this.almostAnyValue$0(); + this.error$2(0, "This at-rule is not allowed here.", this.scanner.spanFrom$1(start)); + }, + _argumentDeclaration$0() { + var $arguments, named, restArgument, t3, $name, defaultValue, endPosition, t4, t5, _this = this, + t1 = _this.scanner, + t2 = t1._string_scanner$_position; + t1.expectChar$1(40); + _this.whitespace$0(); + $arguments = A._setArrayType([], type$.JSArray_Argument); + named = A.LinkedHashSet_LinkedHashSet$_empty(type$.String); + while (true) { + if (!(t1.peekChar$0() === 36)) { + restArgument = null; + break; + } + t3 = t1._string_scanner$_position; + t1.expectChar$1(36); + $name = _this.identifier$1$normalize(true); + _this.whitespace$0(); + if (t1.scanChar$1(58)) { + _this.whitespace$0(); + defaultValue = _this.expressionUntilComma$0(); + } else { + if (t1.scanChar$1(46)) { + t1.expectChar$1(46); + t1.expectChar$1(46); + _this.whitespace$0(); + restArgument = $name; + break; + } + defaultValue = null; + } + endPosition = t1._string_scanner$_position; + t4 = t1._sourceFile; + t5 = new A._FileSpan(t4, t3, endPosition); + t5._FileSpan$3(t4, t3, endPosition); + $arguments.push(new A.Argument($name, defaultValue, t5)); + if (!named.add$1(0, $name)) + _this.error$2(0, "Duplicate argument.", B.JSArray_methods.get$last($arguments).span); + if (!t1.scanChar$1(44)) { + restArgument = null; + break; + } + _this.whitespace$0(); + } + t1.expectChar$1(41); + t1 = t1.spanFrom$1(new A._SpanScannerState(t1, t2)); + return new A.ArgumentDeclaration(A.List_List$unmodifiable($arguments, type$.Argument), restArgument, t1); + }, + _argumentInvocation$2$allowEmptySecondArg$mixin(allowEmptySecondArg, mixin) { + var positional, t3, t4, named, keywordRest, t5, rest, expression, t6, t7, result, _this = this, _null = null, + t1 = _this.scanner, + t2 = t1._string_scanner$_position; + t1.expectChar$1(40); + _this.whitespace$0(); + positional = A._setArrayType([], type$.JSArray_Expression); + t3 = type$.String; + t4 = type$.Expression; + named = A.LinkedHashMap_LinkedHashMap$_empty(t3, t4); + t5 = !mixin; + rest = _null; + while (true) { + if (!_this._lookingAtExpression$0()) { + keywordRest = _null; + break; + } + expression = _this.expressionUntilComma$1$singleEquals(t5); + _this.whitespace$0(); + if (expression instanceof A.VariableExpression && t1.scanChar$1(58)) { + _this.whitespace$0(); + t6 = expression.name; + if (named.containsKey$1(t6)) + _this.error$2(0, "Duplicate argument.", expression.span); + named.$indexSet(0, t6, _this.expressionUntilComma$1$singleEquals(t5)); + } else if (t1.scanChar$1(46)) { + t1.expectChar$1(46); + t1.expectChar$1(46); + if (rest != null) { + _this.whitespace$0(); + keywordRest = expression; + break; + } + rest = expression; + } else if (named.__js_helper$_length !== 0) + _this.error$2(0, string$.Positi, expression.get$span(expression)); + else + positional.push(expression); + _this.whitespace$0(); + if (!t1.scanChar$1(44)) { + keywordRest = _null; + break; + } + _this.whitespace$0(); + if (allowEmptySecondArg && positional.length === 1 && named.__js_helper$_length === 0 && rest == null && t1.peekChar$0() === 41) { + t5 = t1._sourceFile; + t6 = t1._string_scanner$_position; + new A.FileLocation(t5, t6).FileLocation$_$2(t5, t6); + t7 = new A._FileSpan(t5, t6, t6); + t7._FileSpan$3(t5, t6, t6); + t6 = A._setArrayType([""], type$.JSArray_Object); + result = A.List_List$from(t6, false, type$.Object); + result.fixed$length = Array; + result.immutable$list = Array; + t5 = new A.Interpolation(result, t7); + t5.Interpolation$2(t6, t7); + positional.push(new A.StringExpression(t5, false)); + keywordRest = _null; + break; + } + } + t1.expectChar$1(41); + t1 = t1.spanFrom$1(new A._SpanScannerState(t1, t2)); + return new A.ArgumentInvocation(A.List_List$unmodifiable(positional, t4), A.ConstantMap_ConstantMap$from(named, t3, t4), rest, keywordRest, t1); + }, + _argumentInvocation$0() { + return this._argumentInvocation$2$allowEmptySecondArg$mixin(false, false); + }, + _argumentInvocation$1$allowEmptySecondArg(allowEmptySecondArg) { + return this._argumentInvocation$2$allowEmptySecondArg$mixin(allowEmptySecondArg, false); + }, + _argumentInvocation$1$mixin(mixin) { + return this._argumentInvocation$2$allowEmptySecondArg$mixin(false, mixin); + }, + _expression$3$bracketList$singleEquals$until(bracketList, singleEquals, until) { + var t2, beforeBracket, start, wasInExpression, wasInParentheses, resetState, resolveOneOperation, resolveOperations, addSingleExpression, addOperator, resolveSpaceExpressions, t3, _3_0, _1_0, t4, _3_28, _2_0, _3_32, _3_40, commaExpressions, spaceExpressions, singleExpression, _this = this, + _s20_ = "Expected expression.", + _box_0 = {}, + t1 = until != null; + if (t1 && until.call$0()) + _this.scanner.error$1(0, _s20_); + if (bracketList) { + t2 = _this.scanner; + beforeBracket = new A._SpanScannerState(t2, t2._string_scanner$_position); + t2.expectChar$1(91); + _this.whitespace$0(); + if (t2.scanChar$1(93)) { + t1 = A._setArrayType([], type$.JSArray_Expression); + t2 = t2.spanFrom$1(beforeBracket); + return new A.ListExpression(A.List_List$unmodifiable(t1, type$.Expression), B.ListSeparator_undecided_null_undecided, true, t2); + } + } else + beforeBracket = null; + t2 = _this.scanner; + start = new A._SpanScannerState(t2, t2._string_scanner$_position); + wasInExpression = _this._inExpression; + wasInParentheses = _this._inParentheses; + _this._inExpression = true; + _box_0.operands_ = _box_0.operators_ = _box_0.spaceExpressions_ = _box_0.commaExpressions_ = null; + _box_0.allowSlash = true; + _box_0.singleExpression_ = _this._singleExpression$0(); + resetState = new A.StylesheetParser__expression_resetState(_box_0, _this, start); + resolveOneOperation = new A.StylesheetParser__expression_resolveOneOperation(_box_0, _this); + resolveOperations = new A.StylesheetParser__expression_resolveOperations(_box_0, resolveOneOperation); + addSingleExpression = new A.StylesheetParser__expression_addSingleExpression(_box_0, _this, resetState, resolveOperations); + addOperator = new A.StylesheetParser__expression_addOperator(_box_0, _this, resolveOneOperation); + resolveSpaceExpressions = new A.StylesheetParser__expression_resolveSpaceExpressions(_box_0, _this, resolveOperations); + for (t3 = type$.JSArray_Expression; true;) { + _this.whitespace$0(); + if (t1 && until.call$0()) + break; + _3_0 = t2.peekChar$0(); + if (_3_0 == null) + break; + if (40 === _3_0) { + addSingleExpression.call$1(_this.parentheses$0()); + continue; + } + if (91 === _3_0) { + addSingleExpression.call$1(_this._expression$1$bracketList(true)); + continue; + } + if (36 === _3_0) { + addSingleExpression.call$1(_this._variable$0()); + continue; + } + if (38 === _3_0) { + addSingleExpression.call$1(_this._selector$0()); + continue; + } + if (39 === _3_0 || 34 === _3_0) { + addSingleExpression.call$1(_this.interpolatedString$0()); + continue; + } + if (35 === _3_0) { + addSingleExpression.call$1(_this._hashExpression$0()); + continue; + } + if (61 === _3_0) { + t2.readChar$0(); + if (singleEquals && t2.peekChar$0() !== 61) + addOperator.call$1(B.BinaryOperator_2jN); + else { + t2.expectChar$1(61); + addOperator.call$1(B.BinaryOperator_ql5); + } + continue; + } + if (33 === _3_0) { + $label0$1: { + _1_0 = t2.peekChar$1(1); + if (61 === _1_0) { + t2.readChar$0(); + t2.readChar$0(); + addOperator.call$1(B.BinaryOperator_ViB); + break $label0$1; + } + if (_1_0 != null) + if (105 !== _1_0) + if (73 !== _1_0) + t4 = _1_0 === 32 || _1_0 === 9 || _1_0 === 10 || _1_0 === 13 || _1_0 === 12; + else + t4 = true; + else + t4 = true; + else + t4 = true; + if (t4) { + addSingleExpression.call$1(_this._importantExpression$0()); + break $label0$1; + } + break; + } + continue; + } + if (60 === _3_0) { + t2.readChar$0(); + addOperator.call$1(t2.scanChar$1(61) ? B.BinaryOperator_kpg : B.BinaryOperator_U8c); + continue; + } + if (62 === _3_0) { + t2.readChar$0(); + addOperator.call$1(t2.scanChar$1(61) ? B.BinaryOperator_7Tg : B.BinaryOperator_cIH); + continue; + } + if (42 === _3_0) { + t2.readChar$0(); + addOperator.call$1(B.BinaryOperator_qN2); + continue; + } + _3_28 = 43 === _3_0; + if (_3_28 && _box_0.singleExpression_ == null) { + addSingleExpression.call$1(_this._unaryOperation$0()); + continue; + } + if (_3_28) { + t2.readChar$0(); + addOperator.call$1(B.BinaryOperator_anB); + continue; + } + if (45 === _3_0) { + _2_0 = t2.peekChar$1(1); + if (A._isInt(_2_0) && _2_0 >= 48 && _2_0 <= 57 || 46 === _2_0) + if (_box_0.singleExpression_ != null) { + t4 = t2.peekChar$1(-1); + t4 = t4 === 32 || t4 === 9 || t4 === 10 || t4 === 13 || t4 === 12; + } else + t4 = true; + else + t4 = false; + if (t4) + addSingleExpression.call$1(_this._number$0()); + else if (_this._lookingAtInterpolatedIdentifier$0()) + addSingleExpression.call$1(_this.identifierLike$0()); + else if (_box_0.singleExpression_ == null) + addSingleExpression.call$1(_this._unaryOperation$0()); + else { + t2.readChar$0(); + addOperator.call$1(B.BinaryOperator_olz); + } + continue; + } + _3_32 = 47 === _3_0; + if (_3_32 && _box_0.singleExpression_ == null) { + addSingleExpression.call$1(_this._unaryOperation$0()); + continue; + } + if (_3_32) { + t2.readChar$0(); + addOperator.call$1(B.BinaryOperator_t8B); + continue; + } + if (37 === _3_0) { + t2.readChar$0(); + addOperator.call$1(B.BinaryOperator_OTG); + continue; + } + if (_3_0 >= 48 && _3_0 <= 57) { + addSingleExpression.call$1(_this._number$0()); + continue; + } + _3_40 = 46 === _3_0; + if (_3_40 && t2.peekChar$1(1) === 46) + break; + if (_3_40) { + addSingleExpression.call$1(_this._number$0()); + continue; + } + if (97 === _3_0 && !_this.get$plainCss() && _this.scanIdentifier$1("and")) { + addOperator.call$1(B.BinaryOperator_SNp); + continue; + } + if (111 === _3_0 && !_this.get$plainCss() && _this.scanIdentifier$1("or")) { + addOperator.call$1(B.BinaryOperator_M6L); + continue; + } + if ((117 === _3_0 || 85 === _3_0) && t2.peekChar$1(1) === 43) { + addSingleExpression.call$1(_this._unicodeRange$0()); + continue; + } + if (!(_3_0 >= 97 && _3_0 <= 122)) + t4 = _3_0 >= 65 && _3_0 <= 90 || 95 === _3_0 || 92 === _3_0 || _3_0 >= 128; + else + t4 = true; + if (t4) { + addSingleExpression.call$1(_this.identifierLike$0()); + continue; + } + if (44 === _3_0) { + if (_this._inParentheses) { + _this._inParentheses = false; + if (_box_0.allowSlash) { + resetState.call$0(); + continue; + } + } + commaExpressions = _box_0.commaExpressions_; + if (commaExpressions == null) + commaExpressions = _box_0.commaExpressions_ = A._setArrayType([], t3); + if (_box_0.singleExpression_ == null) + t2.error$1(0, _s20_); + resolveSpaceExpressions.call$0(); + t4 = _box_0.singleExpression_; + t4.toString; + commaExpressions.push(t4); + t2.readChar$0(); + _box_0.allowSlash = true; + _box_0.singleExpression_ = null; + continue; + } + break; + } + if (bracketList) + t2.expectChar$1(93); + commaExpressions = _box_0.commaExpressions_; + spaceExpressions = _box_0.spaceExpressions_; + if (commaExpressions != null) { + resolveSpaceExpressions.call$0(); + _this._inParentheses = wasInParentheses; + singleExpression = _box_0.singleExpression_; + if (singleExpression != null) + commaExpressions.push(singleExpression); + _this._inExpression = wasInExpression; + t1 = t2.spanFrom$1(beforeBracket == null ? start : beforeBracket); + return new A.ListExpression(A.List_List$unmodifiable(commaExpressions, type$.Expression), B.ListSeparator_rXA, bracketList, t1); + } else if (bracketList && spaceExpressions != null) { + resolveOperations.call$0(); + _this._inExpression = wasInExpression; + t1 = _box_0.singleExpression_; + t1.toString; + spaceExpressions.push(t1); + beforeBracket.toString; + t2 = t2.spanFrom$1(beforeBracket); + return new A.ListExpression(A.List_List$unmodifiable(spaceExpressions, type$.Expression), B.ListSeparator_EVt, true, t2); + } else { + resolveSpaceExpressions.call$0(); + if (bracketList) { + t1 = _box_0.singleExpression_; + t1.toString; + t3 = A._setArrayType([t1], t3); + beforeBracket.toString; + t2 = t2.spanFrom$1(beforeBracket); + _box_0.singleExpression_ = new A.ListExpression(A.List_List$unmodifiable(t3, type$.Expression), B.ListSeparator_undecided_null_undecided, true, t2); + } + _this._inExpression = wasInExpression; + t1 = _box_0.singleExpression_; + t1.toString; + return t1; + } + }, + _expression$0() { + return this._expression$3$bracketList$singleEquals$until(false, false, null); + }, + _expression$2$singleEquals$until(singleEquals, until) { + return this._expression$3$bracketList$singleEquals$until(false, singleEquals, until); + }, + _expression$1$bracketList(bracketList) { + return this._expression$3$bracketList$singleEquals$until(bracketList, false, null); + }, + _expression$1$until(until) { + return this._expression$3$bracketList$singleEquals$until(false, false, until); + }, + expressionUntilComma$1$singleEquals(singleEquals) { + return this._expression$2$singleEquals$until(singleEquals, new A.StylesheetParser_expressionUntilComma_closure(this)); + }, + expressionUntilComma$0() { + return this.expressionUntilComma$1$singleEquals(false); + }, + _isSlashOperand$1(expression) { + var t1; + if (!(expression instanceof A.NumberExpression)) + if (!(expression instanceof A.FunctionExpression)) + t1 = expression instanceof A.BinaryOperationExpression && expression.allowsSlash; + else + t1 = true; + else + t1 = true; + return t1; + }, + _singleExpression$0() { + var next, t2, _this = this, + _s20_ = "Expected expression.", + t1 = _this.scanner, + _0_0 = t1.peekChar$0(); + $label0$0: { + if (_0_0 == null) + t1.error$1(0, _s20_); + if (40 === _0_0) { + t1 = _this.parentheses$0(); + break $label0$0; + } + if (47 === _0_0) { + t1 = _this._unaryOperation$0(); + break $label0$0; + } + if (46 === _0_0) { + t1 = _this._number$0(); + break $label0$0; + } + if (91 === _0_0) { + t1 = _this._expression$1$bracketList(true); + break $label0$0; + } + if (36 === _0_0) { + t1 = _this._variable$0(); + break $label0$0; + } + if (38 === _0_0) { + t1 = _this._selector$0(); + break $label0$0; + } + if (39 === _0_0 || 34 === _0_0) { + t1 = _this.interpolatedString$0(); + break $label0$0; + } + if (35 === _0_0) { + t1 = _this._hashExpression$0(); + break $label0$0; + } + if (43 === _0_0) { + next = t1.peekChar$1(1); + t1 = next != null && next >= 48 && next <= 57 || next === 46 ? _this._number$0() : _this._unaryOperation$0(); + break $label0$0; + } + if (45 === _0_0) { + t1 = _this._minusExpression$0(); + break $label0$0; + } + if (33 === _0_0) { + t1 = _this._importantExpression$0(); + break $label0$0; + } + if ((117 === _0_0 || 85 === _0_0) && t1.peekChar$1(1) === 43) { + t1 = _this._unicodeRange$0(); + break $label0$0; + } + if (_0_0 >= 48 && _0_0 <= 57) { + t1 = _this._number$0(); + break $label0$0; + } + if (!(_0_0 >= 97 && _0_0 <= 122)) + t2 = _0_0 >= 65 && _0_0 <= 90 || 95 === _0_0 || 92 === _0_0 || _0_0 >= 128; + else + t2 = true; + if (t2) { + t1 = _this.identifierLike$0(); + break $label0$0; + } + t1 = t1.error$1(0, _s20_); + } + return t1; + }, + parentheses$0() { + var start, first, expressions, t1, t2, _this = this, + wasInParentheses = _this._inParentheses; + _this._inParentheses = true; + try { + t1 = _this.scanner; + start = new A._SpanScannerState(t1, t1._string_scanner$_position); + t1.expectChar$1(40); + _this.whitespace$0(); + if (!_this._lookingAtExpression$0()) { + t1.expectChar$1(41); + t2 = A._setArrayType([], type$.JSArray_Expression); + t1 = t1.spanFrom$1(start); + t2 = A.List_List$unmodifiable(t2, type$.Expression); + return new A.ListExpression(t2, B.ListSeparator_undecided_null_undecided, false, t1); + } + first = _this.expressionUntilComma$0(); + if (t1.scanChar$1(58)) { + _this.whitespace$0(); + t1 = _this._stylesheet$_map$2(first, start); + return t1; + } + if (!t1.scanChar$1(44)) { + t1.expectChar$1(41); + t1 = t1.spanFrom$1(start); + return new A.ParenthesizedExpression(first, t1); + } + _this.whitespace$0(); + expressions = A._setArrayType([first], type$.JSArray_Expression); + for (; true;) { + if (!_this._lookingAtExpression$0()) + break; + J.add$1$ax(expressions, _this.expressionUntilComma$0()); + if (!t1.scanChar$1(44)) + break; + _this.whitespace$0(); + } + t1.expectChar$1(41); + t1 = t1.spanFrom$1(start); + t2 = A.List_List$unmodifiable(expressions, type$.Expression); + return new A.ListExpression(t2, B.ListSeparator_rXA, false, t1); + } finally { + _this._inParentheses = wasInParentheses; + } + }, + _stylesheet$_map$2(first, start) { + var t1, key, _this = this, + pairs = A._setArrayType([new A._Record_2(first, _this.expressionUntilComma$0())], type$.JSArray_Record_2_Expression_and_Expression); + for (t1 = _this.scanner; t1.scanChar$1(44);) { + _this.whitespace$0(); + if (!_this._lookingAtExpression$0()) + break; + key = _this.expressionUntilComma$0(); + t1.expectChar$1(58); + _this.whitespace$0(); + pairs.push(new A._Record_2(key, _this.expressionUntilComma$0())); + } + t1.expectChar$1(41); + t1 = t1.spanFrom$1(start); + return new A.MapExpression(A.List_List$unmodifiable(pairs, type$.Record_2_Expression_and_Expression), t1); + }, + _hashExpression$0() { + var start, t2, identifier, buffer, _this = this, + t1 = _this.scanner; + if (t1.peekChar$1(1) === 123) + return _this.identifierLike$0(); + start = new A._SpanScannerState(t1, t1._string_scanner$_position); + t1.expectChar$1(35); + t2 = t1.peekChar$0(); + if (t2 == null) + t2 = null; + else + t2 = t2 >= 48 && t2 <= 57; + if (t2 === true) + return new A.ColorExpression(_this._hexColorContents$1(start), t1.spanFrom$1(start)); + t2 = t1._string_scanner$_position; + identifier = _this.interpolatedIdentifier$0(); + if (_this._isHexColor$1(identifier)) { + t1.set$state(new A._SpanScannerState(t1, t2)); + return new A.ColorExpression(_this._hexColorContents$1(start), t1.spanFrom$1(start)); + } + t2 = new A.StringBuffer(""); + buffer = new A.InterpolationBuffer(t2, A._setArrayType([], type$.JSArray_Object)); + t2._contents += A.Primitives_stringFromCharCode(35); + buffer.addInterpolation$1(identifier); + return new A.StringExpression(buffer.interpolation$1(t1.spanFrom$1(start)), false); + }, + _hexColorContents$1(start) { + var red, green, blue, alpha, digit4, t2, t3, t4, _this = this, + digit1 = _this._hexDigit$0(), + digit2 = _this._hexDigit$0(), + digit3 = _this._hexDigit$0(), + t1 = _this.scanner, + $self = t1.peekChar$0(); + if (!($self != null && A.CharacterExtension_get_isHex($self))) { + red = (digit1 << 4 >>> 0) + digit1; + green = (digit2 << 4 >>> 0) + digit2; + blue = (digit3 << 4 >>> 0) + digit3; + alpha = null; + } else { + digit4 = _this._hexDigit$0(); + $self = t1.peekChar$0(); + t2 = $self != null && A.CharacterExtension_get_isHex($self); + t3 = digit1 << 4 >>> 0; + t4 = digit3 << 4 >>> 0; + if (!t2) { + red = t3 + digit1; + green = (digit2 << 4 >>> 0) + digit2; + blue = t4 + digit3; + alpha = ((digit4 << 4 >>> 0) + digit4) / 255; + } else { + red = t3 + digit2; + green = t4 + digit4; + blue = (_this._hexDigit$0() << 4 >>> 0) + _this._hexDigit$0(); + $self = t1.peekChar$0(); + alpha = $self != null && A.CharacterExtension_get_isHex($self) ? ((_this._hexDigit$0() << 4 >>> 0) + _this._hexDigit$0()) / 255 : null; + } + } + t2 = alpha == null; + t3 = t2 ? 1 : alpha; + return A.SassColor$rgbInternal(red, green, blue, t3, t2 ? new A.SpanColorFormat(t1.spanFrom$1(start)) : null); + }, + _isHexColor$1(interpolation) { + var _0_2, t1, + plain = interpolation.get$asPlain(); + if (typeof plain == "string") { + _0_2 = plain.length; + if (3 !== _0_2) + if (4 !== _0_2) + if (6 !== _0_2) + t1 = 8 === _0_2; + else + t1 = true; + else + t1 = true; + else + t1 = true; + } else + t1 = false; + if (t1) { + t1 = new A.CodeUnits(plain); + return t1.every$1(t1, new A.StylesheetParser__isHexColor_closure()); + } else + return false; + }, + _hexDigit$0() { + var t1 = this.scanner, + t2 = t1.peekChar$0(); + t2 = t2 == null ? null : A.CharacterExtension_get_isHex(t2); + return t2 === true ? A.asHex(t1.readChar$0()) : t1.error$1(0, "Expected hex digit."); + }, + _minusExpression$0() { + var _this = this, + _0_0 = _this.scanner.peekChar$1(1); + if (A._isInt(_0_0) && _0_0 >= 48 && _0_0 <= 57 || 46 === _0_0) + return _this._number$0(); + if (_this._lookingAtInterpolatedIdentifier$0()) + return _this.identifierLike$0(); + return _this._unaryOperation$0(); + }, + _importantExpression$0() { + var t1 = this.scanner, + t2 = t1._string_scanner$_position; + t1.readChar$0(); + this.whitespace$0(); + this.expectIdentifier$1("important"); + t2 = t1.spanFrom$1(new A._SpanScannerState(t1, t2)); + return new A.StringExpression(A.Interpolation$(A._setArrayType(["!important"], type$.JSArray_Object), t2), false); + }, + _unaryOperation$0() { + var _this = this, + t1 = _this.scanner, + t2 = t1._string_scanner$_position, + operator = _this._unaryOperatorFor$1(t1.readChar$0()); + if (operator == null) + t1.error$2$position(0, "Expected unary operator.", t1._string_scanner$_position - 1); + else if (_this.get$plainCss() && operator !== B.UnaryOperator_Ix1) + t1.error$3$length$position(0, "Operators aren't allowed in plain CSS.", 1, t1._string_scanner$_position - 1); + _this.whitespace$0(); + return new A.UnaryOperationExpression(operator, _this._singleExpression$0(), t1.spanFrom$1(new A._SpanScannerState(t1, t2))); + }, + _unaryOperatorFor$1(character) { + var t1; + $label0$0: { + if (43 === character) { + t1 = B.UnaryOperator_gg4; + break $label0$0; + } + if (45 === character) { + t1 = B.UnaryOperator_TLI; + break $label0$0; + } + if (47 === character) { + t1 = B.UnaryOperator_Ix1; + break $label0$0; + } + t1 = null; + break $label0$0; + } + return t1; + }, + _number$0() { + var number, unit, _this = this, + t1 = _this.scanner, + t2 = t1._string_scanner$_position, + first = t1.peekChar$0(), + t3 = first !== 43; + if (!t3 || first === 45) + t1.readChar$0(); + if (t1.peekChar$0() !== 46) + _this._consumeNaturalNumber$0(); + _this._tryDecimal$1$allowTrailingDot(t1._string_scanner$_position !== t2 && t3 && first !== 45); + _this._tryExponent$0(); + number = A.double_parse(t1.substring$1(0, t2)); + if (t1.scanChar$1(37)) + unit = "%"; + else { + if (_this.lookingAtIdentifier$0()) + t3 = t1.peekChar$0() !== 45 || t1.peekChar$1(1) !== 45; + else + t3 = false; + unit = t3 ? _this.identifier$1$unit(true) : null; + } + return new A.NumberExpression(number, unit, t1.spanFrom$1(new A._SpanScannerState(t1, t2))); + }, + _consumeNaturalNumber$0() { + var $self, + t1 = this.scanner, + t2 = t1.readChar$0(); + if (!(t2 >= 48 && t2 <= 57)) + t1.error$2$position(0, "Expected digit.", t1._string_scanner$_position - 1); + while (true) { + $self = t1.peekChar$0(); + if (!($self != null && $self >= 48 && $self <= 57)) + break; + t1.readChar$0(); + } + }, + _tryDecimal$1$allowTrailingDot(allowTrailingDot) { + var $self, + t1 = this.scanner; + if (t1.peekChar$0() !== 46) + return; + $self = t1.peekChar$1(1); + if (!($self != null && $self >= 48 && $self <= 57)) { + if (allowTrailingDot) + return; + t1.error$2$position(0, "Expected digit.", t1._string_scanner$_position + 1); + } + t1.readChar$0(); + while (true) { + $self = t1.peekChar$0(); + if (!($self != null && $self >= 48 && $self <= 57)) + break; + t1.readChar$0(); + } + }, + _tryExponent$0() { + var next, $self, + t1 = this.scanner, + first = t1.peekChar$0(); + if (first !== 101 && first !== 69) + return; + next = t1.peekChar$1(1); + if (!(next != null && next >= 48 && next <= 57) && next !== 45 && next !== 43) + return; + t1.readChar$0(); + if (43 === next || 45 === next) + t1.readChar$0(); + $self = t1.peekChar$0(); + if (!($self != null && $self >= 48 && $self <= 57)) + t1.error$1(0, "Expected digit."); + while (true) { + $self = t1.peekChar$0(); + if (!($self != null && $self >= 48 && $self <= 57)) + break; + t1.readChar$0(); + } + }, + _unicodeRange$0() { + var firstRangeLength, hasQuestionMark, t2, secondRangeLength, _this = this, + _s26_ = "Expected at most 6 digits.", + t1 = _this.scanner, + start = new A._SpanScannerState(t1, t1._string_scanner$_position); + _this.expectIdentChar$1(117); + t1.expectChar$1(43); + for (firstRangeLength = 0; _this.scanCharIf$1(new A.StylesheetParser__unicodeRange_closure());) + ++firstRangeLength; + for (hasQuestionMark = false; t1.scanChar$1(63); hasQuestionMark = true) + ++firstRangeLength; + if (firstRangeLength === 0) + t1.error$1(0, 'Expected hex digit or "?".'); + else if (firstRangeLength > 6) + _this.error$2(0, _s26_, t1.spanFrom$1(start)); + else if (hasQuestionMark) { + t2 = t1.substring$1(0, start.position); + t1 = t1.spanFrom$1(start); + return new A.StringExpression(A.Interpolation$(A._setArrayType([t2], type$.JSArray_Object), t1), false); + } + if (t1.scanChar$1(45)) { + t2 = t1._string_scanner$_position; + for (secondRangeLength = 0; _this.scanCharIf$1(new A.StylesheetParser__unicodeRange_closure0());) + ++secondRangeLength; + if (secondRangeLength === 0) + t1.error$1(0, "Expected hex digit."); + else if (secondRangeLength > 6) + _this.error$2(0, _s26_, t1.spanFrom$1(new A._SpanScannerState(t1, t2))); + } + if (_this._lookingAtInterpolatedIdentifierBody$0()) + t1.error$1(0, "Expected end of identifier."); + t2 = t1.substring$1(0, start.position); + t1 = t1.spanFrom$1(start); + return new A.StringExpression(A.Interpolation$(A._setArrayType([t2], type$.JSArray_Object), t1), false); + }, + _variable$0() { + var _this = this, + t1 = _this.scanner, + start = new A._SpanScannerState(t1, t1._string_scanner$_position), + $name = _this.variableName$0(); + if (_this.get$plainCss()) + _this.error$2(0, string$.Sass_v, t1.spanFrom$1(start)); + return new A.VariableExpression(null, $name, t1.spanFrom$1(start)); + }, + _selector$0() { + var t1, start, _this = this; + if (_this.get$plainCss()) + _this.scanner.error$2$length(0, string$.The_pa, 1); + t1 = _this.scanner; + start = new A._SpanScannerState(t1, t1._string_scanner$_position); + t1.expectChar$1(38); + if (t1.scanChar$1(38)) { + _this.logger.warn$2$span(0, string$.In_Sas, t1.spanFrom$1(start)); + t1.set$position(t1._string_scanner$_position - 1); + } + return new A.SelectorExpression(t1.spanFrom$1(start)); + }, + interpolatedString$0() { + var t3, t4, buffer, _0_0, second, t5, + t1 = this.scanner, + t2 = t1._string_scanner$_position, + quote = t1.readChar$0(); + if (quote !== 39 && quote !== 34) + t1.error$2$position(0, "Expected string.", t2); + t3 = new A.StringBuffer(""); + t4 = A._setArrayType([], type$.JSArray_Object); + buffer = new A.InterpolationBuffer(t3, t4); + for (; true;) { + _0_0 = t1.peekChar$0(); + if (_0_0 === quote) { + t1.readChar$0(); + break; + } + if (_0_0 == null || _0_0 === 10 || _0_0 === 13 || _0_0 === 12) + t1.error$1(0, "Expected " + A.Primitives_stringFromCharCode(quote) + "."); + if (92 === _0_0) { + second = t1.peekChar$1(1); + if (second === 10 || second === 13 || second === 12) { + t1.readChar$0(); + t1.readChar$0(); + if (second === 13) + t1.scanChar$1(10); + } else + t3._contents += A.Primitives_stringFromCharCode(A.consumeEscapedCharacter(t1)); + continue; + } + if (35 === _0_0 && t1.peekChar$1(1) === 123) { + t5 = this.singleInterpolation$0(); + buffer._flushText$0(); + t4.push(t5); + continue; + } + t3._contents += A.Primitives_stringFromCharCode(t1.readChar$0()); + } + return new A.StringExpression(buffer.interpolation$1(t1.spanFrom$1(new A._SpanScannerState(t1, t2))), true); + }, + identifierLike$0() { + var invocation, expression, _0_0, _1_0, _2_0, _2_2, _2_4, _this = this, + t1 = _this.scanner, + start = new A._SpanScannerState(t1, t1._string_scanner$_position), + identifier = _this.interpolatedIdentifier$0(), + plain = identifier.get$asPlain(), + lower = A._Cell$(), + t2 = plain != null; + if (t2) { + if (plain === "if" && t1.peekChar$0() === 40) { + invocation = _this._argumentInvocation$0(); + return new A.IfExpression(invocation, identifier.span.expand$1(0, invocation.span)); + } else if (plain === "not") { + _this.whitespace$0(); + expression = _this._singleExpression$0(); + return new A.UnaryOperationExpression(B.UnaryOperator_not_not_not, expression, identifier.span.expand$1(0, expression.get$span(expression))); + } + lower._value = plain.toLowerCase(); + if (t1.peekChar$0() !== 40) { + switch (plain) { + case "false": + return new A.BooleanExpression(false, identifier.span); + case "null": + return new A.NullExpression(identifier.span); + case "true": + return new A.BooleanExpression(true, identifier.span); + } + _0_0 = $.$get$colorsByName().$index(0, lower._readLocal$0()); + if (_0_0 != null) { + t1 = identifier.span; + return new A.ColorExpression(A.SassColor$rgbInternal(_0_0.get$red(0), _0_0.get$green(0), _0_0.get$blue(0), _0_0._alpha, new A.SpanColorFormat(t1)), t1); + } + } + _1_0 = _this.trySpecialFunction$2(lower._readLocal$0(), start); + if (_1_0 != null) + return _1_0; + } + _2_0 = t1.peekChar$0(); + _2_2 = 46 === _2_0; + if (_2_2 && t1.peekChar$1(1) === 46) + return new A.StringExpression(identifier, false); + if (_2_2) { + t1.readChar$0(); + if (t2) + return _this.namespacedExpression$2(plain, start); + _this.error$2(0, string$.Interpn, identifier.span); + } + _2_4 = 40 === _2_0; + if (_2_4 && t2) + return new A.FunctionExpression(null, plain, _this._argumentInvocation$1$allowEmptySecondArg(J.$eq$(lower._readLocal$0(), "var")), t1.spanFrom$1(start)); + if (_2_4) + return new A.InterpolatedFunctionExpression(identifier, _this._argumentInvocation$0(), t1.spanFrom$1(start)); + return new A.StringExpression(identifier, false); + }, + namespacedExpression$2(namespace, start) { + var $name, _this = this, + t1 = _this.scanner; + if (t1.peekChar$0() === 36) { + $name = _this.variableName$0(); + _this._assertPublic$2($name, new A.StylesheetParser_namespacedExpression_closure(_this, start)); + return new A.VariableExpression(namespace, $name, t1.spanFrom$1(start)); + } + return new A.FunctionExpression(namespace, _this._publicIdentifier$0(), _this._argumentInvocation$0(), t1.spanFrom$1(start)); + }, + trySpecialFunction$2($name, start) { + var t1, buffer, t2, next, t3, _this = this, + normalized = A.unvendor($name); + $label0$0: { + if (!("calc" === normalized && normalized !== $name && _this.scanner.scanChar$1(40))) + t1 = ("element" === normalized || "expression" === normalized) && _this.scanner.scanChar$1(40); + else + t1 = true; + if (t1) { + t1 = new A.StringBuffer(""); + buffer = new A.InterpolationBuffer(t1, A._setArrayType([], type$.JSArray_Object)); + t1._contents = "" + $name; + t1._contents += A.Primitives_stringFromCharCode(40); + break $label0$0; + } + if ("progid" === normalized && _this.scanner.scanChar$1(58)) { + t1 = new A.StringBuffer(""); + buffer = new A.InterpolationBuffer(t1, A._setArrayType([], type$.JSArray_Object)); + t1._contents = "" + $name; + t1._contents += A.Primitives_stringFromCharCode(58); + t2 = _this.scanner; + next = t2.peekChar$0(); + while (true) { + if (next != null) { + if (!(next >= 97 && next <= 122)) + t3 = next >= 65 && next <= 90; + else + t3 = true; + t3 = t3 || next === 46; + } else + t3 = false; + if (!t3) + break; + t1._contents += A.Primitives_stringFromCharCode(t2.readChar$0()); + next = t2.peekChar$0(); + } + t2.expectChar$1(40); + t1._contents += A.Primitives_stringFromCharCode(40); + break $label0$0; + } + if ("url" === normalized) + return A.NullableExtension_andThen(_this._tryUrlContents$1(start), new A.StylesheetParser_trySpecialFunction_closure()); + return null; + } + buffer.addInterpolation$1(_this._interpolatedDeclarationValue$1$allowEmpty(true)); + t1 = _this.scanner; + t1.expectChar$1(41); + buffer._interpolation_buffer$_text._contents += A.Primitives_stringFromCharCode(41); + return new A.StringExpression(buffer.interpolation$1(t1.spanFrom$1(start)), false); + }, + _tryUrlContents$2$name(start, $name) { + var t3, t4, buffer, _0_0, _0_6, t5, endPosition, result, _this = this, + t1 = _this.scanner, + t2 = t1._string_scanner$_position; + if (!t1.scanChar$1(40)) + return null; + _this.whitespaceWithoutComments$0(); + t3 = new A.StringBuffer(""); + t4 = A._setArrayType([], type$.JSArray_Object); + buffer = new A.InterpolationBuffer(t3, t4); + t3._contents = "" + ($name == null ? "url" : $name); + t3._contents += A.Primitives_stringFromCharCode(40); + for (; true;) { + _0_0 = t1.peekChar$0(); + if (_0_0 == null) + break; + if (92 === _0_0) { + t3._contents += _this.escape$0(); + continue; + } + _0_6 = 35 === _0_0; + if (_0_6 && t1.peekChar$1(1) === 123) { + t5 = _this.singleInterpolation$0(); + buffer._flushText$0(); + t4.push(t5); + continue; + } + if (33 !== _0_0) + if (37 !== _0_0) + if (38 !== _0_0) + if (!_0_6) + t5 = _0_0 >= 42 && _0_0 <= 126 || _0_0 >= 128; + else + t5 = true; + else + t5 = true; + else + t5 = true; + else + t5 = true; + if (t5) { + t3._contents += A.Primitives_stringFromCharCode(t1.readChar$0()); + continue; + } + if (_0_0 === 32 || _0_0 === 9 || _0_0 === 10 || _0_0 === 13 || _0_0 === 12) { + _this.whitespaceWithoutComments$0(); + if (t1.peekChar$0() !== 41) + break; + continue; + } + if (41 === _0_0) { + t3._contents += A.Primitives_stringFromCharCode(t1.readChar$0()); + endPosition = t1._string_scanner$_position; + t2 = t1._sourceFile; + t5 = start.position; + t1 = new A._FileSpan(t2, t5, endPosition); + t1._FileSpan$3(t2, t5, endPosition); + t5 = type$.Object; + t2 = A.List_List$of(t4, true, t5); + t4 = t3._contents; + if (t4.length !== 0) + t2.push(t4.charCodeAt(0) == 0 ? t4 : t4); + result = A.List_List$from(t2, false, t5); + result.fixed$length = Array; + result.immutable$list = Array; + t3 = new A.Interpolation(result, t1); + t3.Interpolation$2(t2, t1); + return t3; + } + break; + } + t1.set$state(new A._SpanScannerState(t1, t2)); + return null; + }, + _tryUrlContents$1(start) { + return this._tryUrlContents$2$name(start, null); + }, + dynamicUrl$0() { + var _0_0, _this = this, + t1 = _this.scanner, + start = new A._SpanScannerState(t1, t1._string_scanner$_position); + _this.expectIdentifier$1("url"); + _0_0 = _this._tryUrlContents$1(start); + if (_0_0 != null) + return new A.StringExpression(_0_0, false); + return new A.InterpolatedFunctionExpression(A.Interpolation$(A._setArrayType(["url"], type$.JSArray_Object), t1.spanFrom$1(start)), _this._argumentInvocation$0(), t1.spanFrom$1(start)); + }, + almostAnyValue$1$omitComments(omitComments) { + var t4, t5, t6, _1_0, commentStart, end, t7, _0_0, _this = this, + t1 = _this.scanner, + t2 = t1._string_scanner$_position, + t3 = new A.StringBuffer(""), + buffer = new A.InterpolationBuffer(t3, A._setArrayType([], type$.JSArray_Object)); + for (t4 = t1.string, t5 = t4.length, t6 = !omitComments; true;) + $label0$0: { + _1_0 = t1.peekChar$0(); + if (92 === _1_0) { + t3._contents += A.Primitives_stringFromCharCode(t1.readChar$0()); + t3._contents += A.Primitives_stringFromCharCode(t1.readChar$0()); + break $label0$0; + } + if (34 === _1_0 || 39 === _1_0) { + buffer.addInterpolation$1(_this.interpolatedString$0().asInterpolation$0()); + break $label0$0; + } + if (47 === _1_0) { + commentStart = t1._string_scanner$_position; + if (_this.scanComment$0()) { + if (t6) { + end = t1._string_scanner$_position; + t3._contents += B.JSString_methods.substring$2(t4, commentStart, end); + } + } else + t3._contents += A.Primitives_stringFromCharCode(t1.readChar$0()); + break $label0$0; + } + if (35 === _1_0 && t1.peekChar$1(1) === 123) { + buffer.addInterpolation$1(_this.interpolatedIdentifier$0()); + break $label0$0; + } + if (13 === _1_0 || 10 === _1_0 || 12 === _1_0) { + if (_this.get$indented()) + break; + t3._contents += A.Primitives_stringFromCharCode(t1.readChar$0()); + break $label0$0; + } + if (33 === _1_0 || 59 === _1_0 || 123 === _1_0 || 125 === _1_0) + break; + if (117 === _1_0 || 85 === _1_0) { + t7 = t1._string_scanner$_position; + if (!_this.scanIdentifier$1("url")) { + t3._contents += A.Primitives_stringFromCharCode(t1.readChar$0()); + continue; + } + _0_0 = _this._tryUrlContents$1(new A._SpanScannerState(t1, t7)); + if (_0_0 != null) + buffer.addInterpolation$1(_0_0); + else { + if ((t7 === 0 ? 1 / t7 < 0 : t7 < 0) || t7 > t5) + A.throwExpression(A.ArgumentError$("Invalid position " + t7, null)); + t1._string_scanner$_position = t7; + t1._lastMatch = null; + t3._contents += A.Primitives_stringFromCharCode(t1.readChar$0()); + } + break $label0$0; + } + if (_1_0 == null) + break; + t7 = _this.lookingAtIdentifier$0(); + if (t7) { + t3._contents += _this.identifier$0(); + break $label0$0; + } + t3._contents += A.Primitives_stringFromCharCode(t1.readChar$0()); + } + return buffer.interpolation$1(t1.spanFrom$1(new A._SpanScannerState(t1, t2))); + }, + almostAnyValue$0() { + return this.almostAnyValue$1$omitComments(false); + }, + _interpolatedDeclarationValue$3$allowColon$allowEmpty$allowSemicolon(allowColon, allowEmpty, allowSemicolon) { + var t4, t5, t6, t7, wroteNewline, _1_0, t8, start, end, _1_14, t9, _1_14_isSet, _1_18, _1_20, _1_20_isSet, _1_18_isSet, bracket, _0_0, _this = this, _null = null, + t1 = _this.scanner, + t2 = t1._string_scanner$_position, + t3 = new A.StringBuffer(""), + buffer = new A.InterpolationBuffer(t3, A._setArrayType([], type$.JSArray_Object)), + brackets = A._setArrayType([], type$.JSArray_int); + for (t4 = t1.string, t5 = t4.length, t6 = !allowColon, t7 = !allowSemicolon, wroteNewline = false; true;) + $label0$0: { + _1_0 = t1.peekChar$0(); + if (92 === _1_0) { + t3._contents += _this.escape$1$identifierStart(true); + wroteNewline = false; + break $label0$0; + } + if (34 === _1_0 || 39 === _1_0) { + buffer.addInterpolation$1(_this.interpolatedString$0().asInterpolation$0()); + wroteNewline = false; + break $label0$0; + } + if (47 === _1_0 && t1.peekChar$1(1) === 42) { + t8 = _this.get$loudComment(); + start = t1._string_scanner$_position; + t8.call$0(); + end = t1._string_scanner$_position; + t3._contents += B.JSString_methods.substring$2(t4, start, end); + wroteNewline = false; + break $label0$0; + } + if (35 === _1_0 && t1.peekChar$1(1) === 123) { + buffer.addInterpolation$1(_this.interpolatedIdentifier$0()); + wroteNewline = false; + break $label0$0; + } + t8 = 32 !== _1_0; + if (t8) { + _1_14 = 9 === _1_0; + t9 = _1_14; + _1_14_isSet = true; + } else { + _1_14 = _null; + _1_14_isSet = false; + t9 = true; + } + if (t9) + if (!wroteNewline) { + t9 = t1.peekChar$1(1); + t9 = t9 === 32 || t9 === 9 || t9 === 10 || t9 === 13 || t9 === 12; + } else + t9 = false; + else + t9 = false; + if (t9) { + t1.readChar$0(); + break $label0$0; + } + if (t8) + t8 = _1_14_isSet ? _1_14 : 9 === _1_0; + else + t8 = true; + if (t8) { + t3._contents += A.Primitives_stringFromCharCode(t1.readChar$0()); + break $label0$0; + } + t8 = 10 !== _1_0; + if (t8) { + _1_18 = 13 === _1_0; + if (!_1_18) { + _1_20 = 12 === _1_0; + t9 = _1_20; + _1_20_isSet = true; + } else { + _1_20 = _null; + _1_20_isSet = false; + t9 = true; + } + _1_18_isSet = true; + } else { + _1_20 = _null; + _1_18 = _1_20; + _1_18_isSet = false; + _1_20_isSet = false; + t9 = true; + } + if (t9 && _this.get$indented()) + break; + if (t8) + if (!(_1_18_isSet ? _1_18 : 13 === _1_0)) + t8 = _1_20_isSet ? _1_20 : 12 === _1_0; + else + t8 = true; + else + t8 = true; + if (t8) { + t8 = t1.peekChar$1(-1); + if (!(t8 === 10 || t8 === 13 || t8 === 12)) + t3._contents += "\n"; + t1.readChar$0(); + wroteNewline = true; + break $label0$0; + } + if (40 === _1_0 || 123 === _1_0 || 91 === _1_0) { + bracket = t1.readChar$0(); + t3._contents += A.Primitives_stringFromCharCode(bracket); + brackets.push(A.opposite(bracket)); + wroteNewline = false; + break $label0$0; + } + if (41 === _1_0 || 125 === _1_0 || 93 === _1_0) { + if (brackets.length === 0) + break; + bracket = brackets.pop(); + t1.expectChar$1(bracket); + t3._contents += A.Primitives_stringFromCharCode(bracket); + wroteNewline = false; + break $label0$0; + } + if (59 === _1_0) { + if (t7 && brackets.length === 0) + break; + t3._contents += A.Primitives_stringFromCharCode(t1.readChar$0()); + wroteNewline = false; + break $label0$0; + } + if (58 === _1_0) { + if (t6 && brackets.length === 0) + break; + t3._contents += A.Primitives_stringFromCharCode(t1.readChar$0()); + wroteNewline = false; + break $label0$0; + } + if (117 === _1_0 || 85 === _1_0) { + t8 = t1._string_scanner$_position; + if (!_this.scanIdentifier$1("url")) { + t3._contents += A.Primitives_stringFromCharCode(t1.readChar$0()); + wroteNewline = false; + continue; + } + _0_0 = _this._tryUrlContents$1(new A._SpanScannerState(t1, t8)); + if (_0_0 != null) + buffer.addInterpolation$1(_0_0); + else { + if ((t8 === 0 ? 1 / t8 < 0 : t8 < 0) || t8 > t5) + A.throwExpression(A.ArgumentError$("Invalid position " + t8, _null)); + t1._string_scanner$_position = t8; + t1._lastMatch = null; + t3._contents += A.Primitives_stringFromCharCode(t1.readChar$0()); + } + wroteNewline = false; + break $label0$0; + } + if (_1_0 == null) + break; + t8 = _this.lookingAtIdentifier$0(); + if (t8) { + t3._contents += _this.identifier$0(); + wroteNewline = false; + break $label0$0; + } + t3._contents += A.Primitives_stringFromCharCode(t1.readChar$0()); + wroteNewline = false; + } + if (brackets.length !== 0) + t1.expectChar$1(B.JSArray_methods.get$last(brackets)); + if (!allowEmpty && buffer._interpolation_buffer$_contents.length === 0 && t3._contents.length === 0) + t1.error$1(0, "Expected token."); + return buffer.interpolation$1(t1.spanFrom$1(new A._SpanScannerState(t1, t2))); + }, + _interpolatedDeclarationValue$1$allowEmpty(allowEmpty) { + return this._interpolatedDeclarationValue$3$allowColon$allowEmpty$allowSemicolon(true, allowEmpty, false); + }, + _interpolatedDeclarationValue$2$allowEmpty$allowSemicolon(allowEmpty, allowSemicolon) { + return this._interpolatedDeclarationValue$3$allowColon$allowEmpty$allowSemicolon(true, allowEmpty, allowSemicolon); + }, + _interpolatedDeclarationValue$0() { + return this._interpolatedDeclarationValue$3$allowColon$allowEmpty$allowSemicolon(true, false, false); + }, + interpolatedIdentifier$0() { + var _0_0, _this = this, + _s20_ = "Expected identifier.", + t1 = _this.scanner, + start = new A._SpanScannerState(t1, t1._string_scanner$_position), + t2 = new A.StringBuffer(""), + t3 = A._setArrayType([], type$.JSArray_Object), + buffer = new A.InterpolationBuffer(t2, t3); + if (t1.scanChar$1(45)) { + t2._contents += A.Primitives_stringFromCharCode(45); + if (t1.scanChar$1(45)) { + t2._contents += A.Primitives_stringFromCharCode(45); + _this._interpolatedIdentifierBody$1(buffer); + return buffer.interpolation$1(t1.spanFrom$1(start)); + } + } + $label0$0: { + _0_0 = t1.peekChar$0(); + if (_0_0 == null) + t1.error$1(0, _s20_); + if (_0_0 === 95 || A.CharacterExtension_get_isAlphabetic(_0_0) || _0_0 >= 128) { + t2._contents += A.Primitives_stringFromCharCode(t1.readChar$0()); + break $label0$0; + } + if (92 === _0_0) { + t2._contents += _this.escape$1$identifierStart(true); + break $label0$0; + } + if (35 === _0_0 && t1.peekChar$1(1) === 123) { + t2 = _this.singleInterpolation$0(); + buffer._flushText$0(); + t3.push(t2); + break $label0$0; + } + t1.error$1(0, _s20_); + } + _this._interpolatedIdentifierBody$1(buffer); + return buffer.interpolation$1(t1.spanFrom$1(start)); + }, + _interpolatedIdentifierBody$1(buffer) { + var t1, t2, t3, _0_0, t4; + for (t1 = buffer._interpolation_buffer$_contents, t2 = this.scanner, t3 = buffer._interpolation_buffer$_text; true;) { + _0_0 = t2.peekChar$0(); + if (_0_0 == null) + break; + if (95 !== _0_0) + if (45 !== _0_0) { + if (!(_0_0 >= 97 && _0_0 <= 122)) + t4 = _0_0 >= 65 && _0_0 <= 90; + else + t4 = true; + if (!t4) + t4 = _0_0 >= 48 && _0_0 <= 57; + else + t4 = true; + t4 = t4 || _0_0 >= 128; + } else + t4 = true; + else + t4 = true; + if (t4) { + t3._contents += A.Primitives_stringFromCharCode(t2.readChar$0()); + continue; + } + if (92 === _0_0) { + t3._contents += this.escape$0(); + continue; + } + if (35 === _0_0 && t2.peekChar$1(1) === 123) { + t4 = this.singleInterpolation$0(); + buffer._flushText$0(); + t1.push(t4); + continue; + } + break; + } + }, + singleInterpolation$0() { + var contents, _this = this, + t1 = _this.scanner, + t2 = t1._string_scanner$_position; + t1.expect$1("#{"); + _this.whitespace$0(); + contents = _this._expression$0(); + t1.expectChar$1(125); + if (_this.get$plainCss()) + _this.error$2(0, string$.Interpp, t1.spanFrom$1(new A._SpanScannerState(t1, t2))); + return contents; + }, + _mediaQueryList$0() { + var _this = this, + t1 = _this.scanner, + t2 = t1._string_scanner$_position, + t3 = new A.StringBuffer(""), + buffer = new A.InterpolationBuffer(t3, A._setArrayType([], type$.JSArray_Object)); + for (; true;) { + _this.whitespace$0(); + _this._stylesheet$_mediaQuery$1(buffer); + _this.whitespace$0(); + if (!t1.scanChar$1(44)) + break; + t3._contents += A.Primitives_stringFromCharCode(44); + t3._contents += A.Primitives_stringFromCharCode(32); + } + return buffer.interpolation$1(t1.spanFrom$1(new A._SpanScannerState(t1, t2))); + }, + _stylesheet$_mediaQuery$1(buffer) { + var identifier1, t1, identifier2, _this = this, _s3_ = "and"; + if (_this.scanner.peekChar$0() === 40) { + _this._stylesheet$_mediaInParens$1(buffer); + _this.whitespace$0(); + if (_this.scanIdentifier$1(_s3_)) { + buffer._interpolation_buffer$_text._contents += " and "; + _this.expectWhitespace$0(); + _this._stylesheet$_mediaLogicSequence$2(buffer, _s3_); + } else if (_this.scanIdentifier$1("or")) { + buffer._interpolation_buffer$_text._contents += " or "; + _this.expectWhitespace$0(); + _this._stylesheet$_mediaLogicSequence$2(buffer, "or"); + } + return; + } + identifier1 = _this.interpolatedIdentifier$0(); + if (A.equalsIgnoreCase(identifier1.get$asPlain(), "not")) { + _this.expectWhitespace$0(); + if (!_this._lookingAtInterpolatedIdentifier$0()) { + buffer._interpolation_buffer$_text._contents += "not "; + _this._mediaOrInterp$1(buffer); + return; + } + } + _this.whitespace$0(); + buffer.addInterpolation$1(identifier1); + if (!_this._lookingAtInterpolatedIdentifier$0()) + return; + t1 = buffer._interpolation_buffer$_text; + t1._contents += A.Primitives_stringFromCharCode(32); + identifier2 = _this.interpolatedIdentifier$0(); + if (A.equalsIgnoreCase(identifier2.get$asPlain(), _s3_)) { + _this.expectWhitespace$0(); + t1._contents += " and "; + } else { + _this.whitespace$0(); + buffer.addInterpolation$1(identifier2); + if (_this.scanIdentifier$1(_s3_)) { + _this.expectWhitespace$0(); + t1._contents += " and "; + } else + return; + } + if (_this.scanIdentifier$1("not")) { + _this.expectWhitespace$0(); + t1._contents += "not "; + _this._mediaOrInterp$1(buffer); + return; + } + _this._stylesheet$_mediaLogicSequence$2(buffer, _s3_); + return; + }, + _stylesheet$_mediaLogicSequence$2(buffer, operator) { + var t1, t2, _this = this; + for (t1 = buffer._interpolation_buffer$_text; true;) { + _this._mediaOrInterp$1(buffer); + _this.whitespace$0(); + if (!_this.scanIdentifier$1(operator)) + return; + _this.expectWhitespace$0(); + t2 = t1._contents += A.Primitives_stringFromCharCode(32); + t1._contents = t2 + operator; + t1._contents += A.Primitives_stringFromCharCode(32); + } + }, + _mediaOrInterp$1(buffer) { + var interpolation; + if (this.scanner.peekChar$0() === 35) { + interpolation = this.singleInterpolation$0(); + buffer.addInterpolation$1(A.Interpolation$(A._setArrayType([interpolation], type$.JSArray_Object), interpolation.get$span(interpolation))); + } else + this._stylesheet$_mediaInParens$1(buffer); + }, + _stylesheet$_mediaInParens$1(buffer) { + var t2, t3, t4, next, t5, _this = this, + t1 = _this.scanner; + t1.expectChar$2$name(40, "media condition in parentheses"); + t2 = buffer._interpolation_buffer$_text; + t2._contents += A.Primitives_stringFromCharCode(40); + _this.whitespace$0(); + if (t1.peekChar$0() === 40) { + _this._stylesheet$_mediaInParens$1(buffer); + _this.whitespace$0(); + if (_this.scanIdentifier$1("and")) { + t2._contents += " and "; + _this.expectWhitespace$0(); + _this._stylesheet$_mediaLogicSequence$2(buffer, "and"); + } else if (_this.scanIdentifier$1("or")) { + t2._contents += " or "; + _this.expectWhitespace$0(); + _this._stylesheet$_mediaLogicSequence$2(buffer, "or"); + } + } else if (_this.scanIdentifier$1("not")) { + t2._contents += "not "; + _this.expectWhitespace$0(); + _this._mediaOrInterp$1(buffer); + } else { + t3 = _this._expressionUntilComparison$0(); + buffer._flushText$0(); + t4 = buffer._interpolation_buffer$_contents; + t4.push(t3); + if (t1.scanChar$1(58)) { + _this.whitespace$0(); + t2._contents += A.Primitives_stringFromCharCode(58); + t2._contents += A.Primitives_stringFromCharCode(32); + t3 = _this._expression$0(); + buffer._flushText$0(); + t4.push(t3); + } else { + next = t1.peekChar$0(); + t3 = 60 !== next; + if (!t3 || 62 === next || 61 === next) { + t2._contents += A.Primitives_stringFromCharCode(32); + t2._contents += A.Primitives_stringFromCharCode(t1.readChar$0()); + if ((!t3 || 62 === next) && t1.scanChar$1(61)) + t2._contents += A.Primitives_stringFromCharCode(61); + t2._contents += A.Primitives_stringFromCharCode(32); + _this.whitespace$0(); + t5 = _this._expressionUntilComparison$0(); + buffer._flushText$0(); + t4.push(t5); + if (!t3 || 62 === next) { + next.toString; + t3 = t1.scanChar$1(next); + } else + t3 = false; + if (t3) { + t2._contents += A.Primitives_stringFromCharCode(32); + t2._contents += A.Primitives_stringFromCharCode(next); + if (t1.scanChar$1(61)) + t2._contents += A.Primitives_stringFromCharCode(61); + t2._contents += A.Primitives_stringFromCharCode(32); + _this.whitespace$0(); + t3 = _this._expressionUntilComparison$0(); + buffer._flushText$0(); + t4.push(t3); + } + } + } + } + t1.expectChar$1(41); + _this.whitespace$0(); + t2._contents += A.Primitives_stringFromCharCode(41); + }, + _expressionUntilComparison$0() { + return this._expression$1$until(new A.StylesheetParser__expressionUntilComparison_closure(this)); + }, + _supportsCondition$0() { + var condition, operator, right, endPosition, t3, t4, lowerOperator, _this = this, + t1 = _this.scanner, + t2 = t1._string_scanner$_position; + if (_this.scanIdentifier$1("not")) { + _this.whitespace$0(); + return new A.SupportsNegation(_this._supportsConditionInParens$0(), t1.spanFrom$1(new A._SpanScannerState(t1, t2))); + } + condition = _this._supportsConditionInParens$0(); + _this.whitespace$0(); + for (operator = null; _this.lookingAtIdentifier$0();) { + if (operator != null) + _this.expectIdentifier$1(operator); + else if (_this.scanIdentifier$1("or")) + operator = "or"; + else { + _this.expectIdentifier$1("and"); + operator = "and"; + } + _this.whitespace$0(); + right = _this._supportsConditionInParens$0(); + endPosition = t1._string_scanner$_position; + t3 = t1._sourceFile; + t4 = new A._FileSpan(t3, t2, endPosition); + t4._FileSpan$3(t3, t2, endPosition); + condition = new A.SupportsOperation(condition, right, operator, t4); + lowerOperator = operator.toLowerCase(); + if (lowerOperator !== "and" && lowerOperator !== "or") + A.throwExpression(A.ArgumentError$value(operator, "operator", 'may only be "and" or "or".')); + _this.whitespace$0(); + } + return condition; + }, + _supportsConditionInParens$0() { + var $name, nameStart, wasInParentheses, identifier, operation, _1_0, contents, identifier0, t2, $arguments, _0_0, _0_4, _0_4_isSet, condition, exception, declaration, _this = this, _null = null, + t1 = _this.scanner, + start = new A._SpanScannerState(t1, t1._string_scanner$_position); + if (_this._lookingAtInterpolatedIdentifier$0()) { + identifier0 = _this.interpolatedIdentifier$0(); + t2 = identifier0.get$asPlain(); + if ((t2 == null ? _null : t2.toLowerCase()) === "not") + _this.error$2(0, '"not" is not a valid identifier here.', identifier0.span); + if (t1.scanChar$1(40)) { + $arguments = _this._interpolatedDeclarationValue$2$allowEmpty$allowSemicolon(true, true); + t1.expectChar$1(41); + return new A.SupportsFunction(identifier0, $arguments, t1.spanFrom$1(start)); + } else { + _0_0 = identifier0.contents; + if (_0_0.length === 1) { + _0_4 = _0_0[0]; + t2 = _0_4; + t2 = type$.Expression._is(t2); + _0_4_isSet = true; + } else { + _0_4 = _null; + _0_4_isSet = false; + t2 = false; + } + if (t2) { + t2 = _0_4_isSet ? _0_4 : _0_0[0]; + return new A.SupportsInterpolation(type$.Expression._as(t2), t1.spanFrom$1(start)); + } else + _this.error$2(0, "Expected @supports condition.", identifier0.span); + } + } + t1.expectChar$1(40); + _this.whitespace$0(); + if (_this.scanIdentifier$1("not")) { + _this.whitespace$0(); + condition = _this._supportsConditionInParens$0(); + t1.expectChar$1(41); + return new A.SupportsNegation(condition, t1.spanFrom$1(start)); + } else if (t1.peekChar$0() === 40) { + condition = _this._supportsCondition$0(); + t1.expectChar$1(41); + return condition; + } + $name = null; + nameStart = new A._SpanScannerState(t1, t1._string_scanner$_position); + wasInParentheses = _this._inParentheses; + try { + $name = _this._expression$0(); + t1.expectChar$1(58); + } catch (exception) { + if (type$.FormatException._is(A.unwrapException(exception))) { + t1.set$state(nameStart); + _this._inParentheses = wasInParentheses; + identifier = _this.interpolatedIdentifier$0(); + operation = null; + _1_0 = _this._trySupportsOperation$2(identifier, nameStart); + if (_1_0 != null) { + operation = _1_0; + t1.expectChar$1(41); + return operation; + } + t2 = new A.InterpolationBuffer(new A.StringBuffer(""), A._setArrayType([], type$.JSArray_Object)); + t2.addInterpolation$1(identifier); + t2.addInterpolation$1(_this._interpolatedDeclarationValue$3$allowColon$allowEmpty$allowSemicolon(false, true, true)); + contents = t2.interpolation$1(t1.spanFrom$1(nameStart)); + if (t1.peekChar$0() === 58) + throw exception; + t1.expectChar$1(41); + return new A.SupportsAnything(contents, t1.spanFrom$1(start)); + } else + throw exception; + } + declaration = _this._supportsDeclarationValue$2($name, start); + t1.expectChar$1(41); + return declaration; + }, + _supportsDeclarationValue$2($name, start) { + var t1, value, _this = this; + if ($name instanceof A.StringExpression) + if (!$name.hasQuotes) + t1 = B.JSString_methods.startsWith$1($name.text.get$initialPlain(), "--"); + else + t1 = false; + else + t1 = false; + if (t1) + value = new A.StringExpression(_this._interpolatedDeclarationValue$0(), false); + else { + _this.whitespace$0(); + value = _this._expression$0(); + } + return new A.SupportsDeclaration($name, value, _this.scanner.spanFrom$1(start)); + }, + _trySupportsOperation$2(interpolation, start) { + var expression, beforeWhitespace, t2, t3, operator, operation, right, t4, endPosition, t5, t6, lowerOperator, _this = this, _null = null, + t1 = interpolation.contents; + if (t1.length !== 1) + return _null; + expression = B.JSArray_methods.get$first(t1); + if (!type$.Expression._is(expression)) + return _null; + t1 = _this.scanner; + beforeWhitespace = new A._SpanScannerState(t1, t1._string_scanner$_position); + _this.whitespace$0(); + for (t2 = start.position, t3 = interpolation.span, operator = _null, operation = operator; _this.lookingAtIdentifier$0();) { + if (operator != null) + _this.expectIdentifier$1(operator); + else if (_this.scanIdentifier$1("and")) + operator = "and"; + else { + if (!_this.scanIdentifier$1("or")) { + if (beforeWhitespace._scanner !== t1) + A.throwExpression(A.ArgumentError$(string$.The_gi, _null)); + t2 = beforeWhitespace.position; + if ((t2 === 0 ? 1 / t2 < 0 : t2 < 0) || t2 > t1.string.length) + A.throwExpression(A.ArgumentError$("Invalid position " + t2, _null)); + t1._string_scanner$_position = t2; + return t1._lastMatch = null; + } + operator = "or"; + } + _this.whitespace$0(); + right = _this._supportsConditionInParens$0(); + t4 = operation == null ? new A.SupportsInterpolation(expression, t3) : operation; + endPosition = t1._string_scanner$_position; + t5 = t1._sourceFile; + t6 = new A._FileSpan(t5, t2, endPosition); + t6._FileSpan$3(t5, t2, endPosition); + operation = new A.SupportsOperation(t4, right, operator, t6); + lowerOperator = operator.toLowerCase(); + if (lowerOperator !== "and" && lowerOperator !== "or") + A.throwExpression(A.ArgumentError$value(operator, "operator", 'may only be "and" or "or".')); + _this.whitespace$0(); + } + return operation; + }, + _lookingAtInterpolatedIdentifier$0() { + var _0_0, + t1 = this.scanner, + _1_0 = t1.peekChar$0(); + $label0$0: { + if (_1_0 == null) { + t1 = false; + break $label0$0; + } + if (_1_0 === 95 || A.CharacterExtension_get_isAlphabetic(_1_0) || _1_0 >= 128 || 92 === _1_0) { + t1 = true; + break $label0$0; + } + if (35 === _1_0) { + t1 = t1.peekChar$1(1) === 123; + break $label0$0; + } + if (45 === _1_0) { + _0_0 = t1.peekChar$1(1); + $label1$1: { + if (_0_0 == null) { + t1 = false; + break $label1$1; + } + if (35 === _0_0) { + t1 = t1.peekChar$1(2) === 123; + break $label1$1; + } + if (_0_0 === 95 || A.CharacterExtension_get_isAlphabetic(_0_0) || _0_0 >= 128 || 92 === _0_0 || 45 === _0_0) { + t1 = true; + break $label1$1; + } + t1 = false; + break $label1$1; + } + break $label0$0; + } + t1 = false; + break $label0$0; + } + return t1; + }, + _lookingAtPotentialPropertyHack$0() { + var t1 = this.scanner, + _0_0 = t1.peekChar$0(); + $label0$0: { + if (58 === _0_0 || 42 === _0_0 || 46 === _0_0) { + t1 = true; + break $label0$0; + } + if (35 === _0_0) { + t1 = t1.peekChar$1(1) !== 123; + break $label0$0; + } + t1 = false; + break $label0$0; + } + return t1; + }, + _lookingAtInterpolatedIdentifierBody$0() { + var t2, + t1 = this.scanner, + _0_0 = t1.peekChar$0(); + $label0$0: { + if (_0_0 == null) { + t1 = false; + break $label0$0; + } + if (!(_0_0 === 95 || A.CharacterExtension_get_isAlphabetic(_0_0) || _0_0 >= 128)) + t2 = _0_0 >= 48 && _0_0 <= 57 || _0_0 === 45; + else + t2 = true; + if (t2 || 92 === _0_0) { + t1 = true; + break $label0$0; + } + if (35 === _0_0) { + t1 = t1.peekChar$1(1) === 123; + break $label0$0; + } + t1 = false; + break $label0$0; + } + return t1; + }, + _lookingAtExpression$0() { + var _0_0, + t1 = this.scanner, + _1_0 = t1.peekChar$0(); + $label0$0: { + if (_1_0 == null) { + t1 = false; + break $label0$0; + } + if (46 === _1_0) { + t1 = t1.peekChar$1(1) !== 46; + break $label0$0; + } + if (33 === _1_0) { + _0_0 = t1.peekChar$1(1); + $label1$1: { + if (_0_0 != null) + if (105 !== _0_0) + if (73 !== _0_0) + t1 = _0_0 === 32 || _0_0 === 9 || _0_0 === 10 || _0_0 === 13 || _0_0 === 12; + else + t1 = true; + else + t1 = true; + else + t1 = true; + if (t1) { + t1 = true; + break $label1$1; + } + t1 = false; + break $label1$1; + } + break $label0$0; + } + if (40 !== _1_0) + if (47 !== _1_0) + if (91 !== _1_0) + if (39 !== _1_0) + if (34 !== _1_0) + if (35 !== _1_0) + if (43 !== _1_0) + if (45 !== _1_0) + if (92 !== _1_0) + if (36 !== _1_0) + if (38 !== _1_0) + if (!(_1_0 === 95 || A.CharacterExtension_get_isAlphabetic(_1_0) || _1_0 >= 128)) + t1 = _1_0 >= 48 && _1_0 <= 57; + else + t1 = true; + else + t1 = true; + else + t1 = true; + else + t1 = true; + else + t1 = true; + else + t1 = true; + else + t1 = true; + else + t1 = true; + else + t1 = true; + else + t1 = true; + else + t1 = true; + else + t1 = true; + if (t1) { + t1 = true; + break $label0$0; + } + t1 = false; + break $label0$0; + } + return t1; + }, + _withChildren$1$3(child, start, create) { + var result = create.call$2(this.children$1(0, child), this.scanner.spanFrom$1(start)); + this.whitespaceWithoutComments$0(); + return result; + }, + _withChildren$3(child, start, create) { + return this._withChildren$1$3(child, start, create, type$.dynamic); + }, + _urlString$0() { + var innerError, stackTrace, t2, exception, + t1 = this.scanner, + start = new A._SpanScannerState(t1, t1._string_scanner$_position), + url = this.string$0(); + try { + t2 = A.Uri_parse(url); + return t2; + } catch (exception) { + t2 = A.unwrapException(exception); + if (type$.FormatException._is(t2)) { + innerError = t2; + stackTrace = A.getTraceFromException(exception); + this.error$3(0, "Invalid URL: " + J.get$message$x(innerError), t1.spanFrom$1(start), stackTrace); + } else + throw exception; + } + }, + _publicIdentifier$0() { + var _this = this, + t1 = _this.scanner, + t2 = t1._string_scanner$_position, + result = _this.identifier$1$normalize(true); + _this._assertPublic$2(result, new A.StylesheetParser__publicIdentifier_closure(_this, new A._SpanScannerState(t1, t2))); + return result; + }, + _assertPublic$2(identifier, span) { + var first = identifier.charCodeAt(0); + if (!(first === 45 || first === 95)) + return; + this.error$2(0, string$.Privat, span.call$0()); + }, + get$plainCss() { + return false; + } + }; + A.StylesheetParser_parse_closure.prototype = { + call$0() { + var statements, t4, + t1 = this.$this, + t2 = t1.scanner, + t3 = t2._string_scanner$_position; + t2.scanChar$1(65279); + statements = t1.statements$1(new A.StylesheetParser_parse__closure(t1)); + t2.expectDone$0(); + t4 = t1._globalVariables.get$values(0); + B.JSArray_methods.addAll$1(statements, A.MappedIterable_MappedIterable(t4, new A.StylesheetParser_parse__closure0(), A._instanceType(t4)._eval$1("Iterable.E"), type$.Statement)); + return A.Stylesheet$internal(statements, t2.spanFrom$1(new A._SpanScannerState(t2, t3)), t1.get$plainCss()); + }, + $signature: 344 + }; + A.StylesheetParser_parse__closure.prototype = { + call$0() { + var t1 = this.$this; + if (t1.scanner.scan$1("@charset")) { + t1.whitespace$0(); + t1.string$0(); + return null; + } + return t1._statement$1$root(true); + }, + $signature: 343 + }; + A.StylesheetParser_parse__closure0.prototype = { + call$1(declaration) { + var t1 = declaration.expression; + return A.VariableDeclaration$(declaration.name, new A.NullExpression(t1.get$span(t1)), declaration.span, null, false, true, null); + }, + $signature: 342 + }; + A.StylesheetParser_parseArgumentDeclaration_closure.prototype = { + call$0() { + var $arguments, + t1 = this.$this, + t2 = t1.scanner; + t2.expectChar$2$name(64, "@-rule"); + t1.identifier$0(); + t1.whitespace$0(); + t1.identifier$0(); + $arguments = t1._argumentDeclaration$0(); + t1.whitespace$0(); + t2.expectChar$1(123); + return $arguments; + }, + $signature: 341 + }; + A.StylesheetParser_parseVariableDeclaration_closure.prototype = { + call$0() { + var t1 = this.$this; + return t1.lookingAtIdentifier$0() ? t1._variableDeclarationWithNamespace$0() : t1.variableDeclarationWithoutNamespace$0(); + }, + $signature: 184 + }; + A.StylesheetParser_parseUseRule_closure.prototype = { + call$0() { + var t1 = this.$this, + t2 = t1.scanner, + t3 = t2._string_scanner$_position; + t2.expectChar$2$name(64, "@-rule"); + t1.expectIdentifier$1("use"); + t1.whitespace$0(); + return t1._useRule$1(new A._SpanScannerState(t2, t3)); + }, + $signature: 340 + }; + A.StylesheetParser__parseSingleProduction_closure.prototype = { + call$0() { + var result = this.production.call$0(); + this.$this.scanner.expectDone$0(); + return result; + }, + $signature() { + return this.T._eval$1("0()"); + } + }; + A.StylesheetParser__statement_closure.prototype = { + call$0() { + return this.$this._statement$0(); + }, + $signature: 132 + }; + A.StylesheetParser_variableDeclarationWithoutNamespace_closure.prototype = { + call$0() { + return this.$this.scanner.spanFrom$1(this.start); + }, + $signature: 25 + }; + A.StylesheetParser_variableDeclarationWithoutNamespace_closure0.prototype = { + call$0() { + return this.declaration; + }, + $signature: 184 + }; + A.StylesheetParser__declarationOrBuffer_closure.prototype = { + call$2(children, span) { + return A.Declaration$nested(this.name, children, span, null); + }, + $signature: 81 + }; + A.StylesheetParser__declarationOrBuffer_closure0.prototype = { + call$2(children, span) { + return A.Declaration$nested(this.name, children, span, this._box_0.value); + }, + $signature: 81 + }; + A.StylesheetParser__styleRule_closure.prototype = { + call$2(children, span) { + var _this = this, + t1 = _this.$this; + if (t1.get$indented() && children.length === 0) + t1.logger.warn$2$span(0, string$.This_s, _this._box_0.interpolation.span); + t1._inStyleRule = _this.wasInStyleRule; + return A.StyleRule$(_this._box_0.interpolation, children, t1.scanner.spanFrom$1(_this.start)); + }, + $signature: 338 + }; + A.StylesheetParser__propertyOrVariableDeclaration_closure.prototype = { + call$2(children, span) { + return A.Declaration$nested(this._box_0.name, children, span, null); + }, + $signature: 81 + }; + A.StylesheetParser__propertyOrVariableDeclaration_closure0.prototype = { + call$2(children, span) { + return A.Declaration$nested(this._box_0.name, children, span, this.value); + }, + $signature: 81 + }; + A.StylesheetParser__atRootRule_closure.prototype = { + call$2(children, span) { + return A.AtRootRule$(children, span, this.query); + }, + $signature: 188 + }; + A.StylesheetParser__atRootRule_closure0.prototype = { + call$2(children, span) { + return A.AtRootRule$(children, span, null); + }, + $signature: 188 + }; + A.StylesheetParser__eachRule_closure.prototype = { + call$2(children, span) { + var _this = this; + _this.$this._inControlDirective = _this.wasInControlDirective; + return A.EachRule$(_this.variables, _this.list, children, span); + }, + $signature: 337 + }; + A.StylesheetParser__functionRule_closure.prototype = { + call$2(children, span) { + return A.FunctionRule$(this.name, this.$arguments, children, span, this.precedingComment); + }, + $signature: 335 + }; + A.StylesheetParser__forRule_closure.prototype = { + call$0() { + var t1 = this.$this; + if (!t1.lookingAtIdentifier$0()) + return false; + if (t1.scanIdentifier$1("to")) + return this._box_0.exclusive = true; + else if (t1.scanIdentifier$1("through")) { + this._box_0.exclusive = false; + return true; + } else + return false; + }, + $signature: 26 + }; + A.StylesheetParser__forRule_closure0.prototype = { + call$2(children, span) { + var t1, _this = this; + _this.$this._inControlDirective = _this.wasInControlDirective; + t1 = _this._box_0.exclusive; + t1.toString; + return A.ForRule$(_this.variable, _this.from, _this.to, children, span, t1); + }, + $signature: 334 + }; + A.StylesheetParser__memberList_closure.prototype = { + call$0() { + var t1 = this.$this; + if (t1.scanner.peekChar$0() === 36) + this.variables.add$1(0, t1.variableName$0()); + else + this.identifiers.add$1(0, t1.identifier$1$normalize(true)); + }, + $signature: 1 + }; + A.StylesheetParser__includeRule_closure.prototype = { + call$2(children, span) { + return A.ContentBlock$(this.contentArguments_, children, span); + }, + $signature: 333 + }; + A.StylesheetParser_mediaRule_closure.prototype = { + call$2(children, span) { + return A.MediaRule$(this.query, children, span); + }, + $signature: 332 + }; + A.StylesheetParser__mixinRule_closure.prototype = { + call$2(children, span) { + var _this = this; + _this.$this._stylesheet$_inMixin = false; + return A.MixinRule$(_this.name, _this.$arguments, children, span, _this.precedingComment); + }, + $signature: 330 + }; + A.StylesheetParser_mozDocumentRule_closure.prototype = { + call$2(children, span) { + var _this = this; + if (_this._box_0.needsDeprecationWarning) + A.WarnForDeprecation_warnForDeprecation(_this.$this.logger, B.Deprecation_gJ9, string$.x40_moz_, span, null); + return A.AtRule$(_this.name, span, children, _this.value); + }, + $signature: 195 + }; + A.StylesheetParser_supportsRule_closure.prototype = { + call$2(children, span) { + return A.SupportsRule$(this.condition, children, span); + }, + $signature: 328 + }; + A.StylesheetParser__whileRule_closure.prototype = { + call$2(children, span) { + this.$this._inControlDirective = this.wasInControlDirective; + return A.WhileRule$(this.condition, children, span); + }, + $signature: 327 + }; + A.StylesheetParser_unknownAtRule_closure.prototype = { + call$2(children, span) { + return A.AtRule$(this.name, span, children, this._box_0.value); + }, + $signature: 195 + }; + A.StylesheetParser__expression_resetState.prototype = { + call$0() { + var t2, + t1 = this._box_0; + t1.operands_ = t1.operators_ = t1.spaceExpressions_ = t1.commaExpressions_ = null; + t2 = this.$this; + t2.scanner.set$state(this.start); + t1.allowSlash = true; + t1.singleExpression_ = t2._singleExpression$0(); + }, + $signature: 0 + }; + A.StylesheetParser__expression_resolveOneOperation.prototype = { + call$0() { + var t2, t3, t4, t5, t6, t7, _this = this, + t1 = _this._box_0, + operator = t1.operators_.pop(), + left = t1.operands_.pop(), + right = t1.singleExpression_; + if (right == null) { + t2 = _this.$this.scanner; + t3 = operator.operator.length; + t2.error$3$length$position(0, "Expected expression.", t3, t2._string_scanner$_position - t3); + } + if (t1.allowSlash) { + t2 = _this.$this; + t2 = !t2._inParentheses && operator === B.BinaryOperator_t8B && t2._isSlashOperand$1(left) && t2._isSlashOperand$1(right); + } else + t2 = false; + if (t2) + t1.singleExpression_ = new A.BinaryOperationExpression(B.BinaryOperator_t8B, left, right, true); + else { + t1.singleExpression_ = new A.BinaryOperationExpression(operator, left, right, false); + t2 = t1.allowSlash = false; + if (B.BinaryOperator_anB === operator || B.BinaryOperator_olz === operator) { + t3 = _this.$this; + t4 = t3.scanner.string; + t5 = right.get$span(right); + t5 = t5.get$start(t5); + t6 = right.get$span(right); + t7 = operator.operator; + if (B.JSString_methods.substring$2(t4, t5.offset - 1, t6.get$start(t6).offset) === t7) { + t2 = left.get$span(left); + t2 = t4.charCodeAt(t2.get$end(t2).offset); + t2 = t2 === 32 || t2 === 9 || t2 === 10 || t2 === 13 || t2 === 12; + } + if (t2) { + t2 = left.toString$0(0); + t4 = right.toString$0(0); + t5 = left.toString$0(0); + t6 = right.toString$0(0); + t1 = t1.singleExpression_; + A.WarnForDeprecation_warnForDeprecation(t3.logger, B.Deprecation_sIK, "This operation is parsed as:\n\n " + t2 + " " + t7 + " " + t4 + string$.x0a_but_ + t5 + " (" + t7 + t6 + ")\n\nAdd a space after " + t7 + string$.x20to_cl, t1.get$span(t1), null); + } + } + } + }, + $signature: 0 + }; + A.StylesheetParser__expression_resolveOperations.prototype = { + call$0() { + var t1, + operators = this._box_0.operators_; + if (operators == null) + return; + for (t1 = this.resolveOneOperation; operators.length !== 0;) + t1.call$0(); + }, + $signature: 0 + }; + A.StylesheetParser__expression_addSingleExpression.prototype = { + call$1(expression) { + var t2, spaceExpressions, _this = this, + t1 = _this._box_0; + if (t1.singleExpression_ != null) { + t2 = _this.$this; + if (t2._inParentheses) { + t2._inParentheses = false; + if (t1.allowSlash) { + _this.resetState.call$0(); + return; + } + } + spaceExpressions = t1.spaceExpressions_; + if (spaceExpressions == null) + spaceExpressions = t1.spaceExpressions_ = A._setArrayType([], type$.JSArray_Expression); + _this.resolveOperations.call$0(); + t2 = t1.singleExpression_; + t2.toString; + spaceExpressions.push(t2); + t1.allowSlash = true; + } + t1.singleExpression_ = expression; + }, + $signature: 326 + }; + A.StylesheetParser__expression_addOperator.prototype = { + call$1(operator) { + var t2, t3, operators, operands, t4, singleExpression, + t1 = this.$this; + if (t1.get$plainCss() && operator !== B.BinaryOperator_2jN && operator !== B.BinaryOperator_anB && operator !== B.BinaryOperator_olz && operator !== B.BinaryOperator_qN2 && operator !== B.BinaryOperator_t8B) { + t2 = t1.scanner; + t3 = operator.operator.length; + t2.error$3$length$position(0, "Operators aren't allowed in plain CSS.", t3, t2._string_scanner$_position - t3); + } + t2 = this._box_0; + t2.allowSlash = t2.allowSlash && operator === B.BinaryOperator_t8B; + operators = t2.operators_; + if (operators == null) + operators = t2.operators_ = A._setArrayType([], type$.JSArray_BinaryOperator); + operands = t2.operands_; + if (operands == null) + operands = t2.operands_ = A._setArrayType([], type$.JSArray_Expression); + t3 = this.resolveOneOperation; + t4 = operator.precedence; + while (true) { + if (!(operators.length !== 0 && B.JSArray_methods.get$last(operators).precedence >= t4)) + break; + t3.call$0(); + } + operators.push(operator); + singleExpression = t2.singleExpression_; + if (singleExpression == null) { + t3 = t1.scanner; + t4 = operator.operator.length; + t3.error$3$length$position(0, "Expected expression.", t4, t3._string_scanner$_position - t4); + } + operands.push(singleExpression); + t1.whitespace$0(); + t2.singleExpression_ = t1._singleExpression$0(); + }, + $signature: 325 + }; + A.StylesheetParser__expression_resolveSpaceExpressions.prototype = { + call$0() { + var t1, spaceExpressions, singleExpression, t2; + this.resolveOperations.call$0(); + t1 = this._box_0; + spaceExpressions = t1.spaceExpressions_; + if (spaceExpressions == null) + return; + singleExpression = t1.singleExpression_; + if (singleExpression == null) + this.$this.scanner.error$1(0, "Expected expression."); + spaceExpressions.push(singleExpression); + t2 = B.JSArray_methods.get$first(spaceExpressions); + t2 = t2.get$span(t2).expand$1(0, singleExpression.get$span(singleExpression)); + t1.singleExpression_ = new A.ListExpression(A.List_List$unmodifiable(spaceExpressions, type$.Expression), B.ListSeparator_EVt, false, t2); + t1.spaceExpressions_ = null; + }, + $signature: 0 + }; + A.StylesheetParser_expressionUntilComma_closure.prototype = { + call$0() { + return this.$this.scanner.peekChar$0() === 44; + }, + $signature: 26 + }; + A.StylesheetParser__isHexColor_closure.prototype = { + call$1(char) { + return A.CharacterExtension_get_isHex(char); + }, + $signature: 46 + }; + A.StylesheetParser__unicodeRange_closure.prototype = { + call$1(char) { + return char != null && A.CharacterExtension_get_isHex(char); + }, + $signature: 28 + }; + A.StylesheetParser__unicodeRange_closure0.prototype = { + call$1(char) { + return char != null && A.CharacterExtension_get_isHex(char); + }, + $signature: 28 + }; + A.StylesheetParser_namespacedExpression_closure.prototype = { + call$0() { + return this.$this.scanner.spanFrom$1(this.start); + }, + $signature: 25 + }; + A.StylesheetParser_trySpecialFunction_closure.prototype = { + call$1(contents) { + return new A.StringExpression(contents, false); + }, + $signature: 323 + }; + A.StylesheetParser__expressionUntilComparison_closure.prototype = { + call$0() { + var t1 = this.$this.scanner, + _0_0 = t1.peekChar$0(); + $label0$0: { + if (61 === _0_0) { + t1 = t1.peekChar$1(1) !== 61; + break $label0$0; + } + if (60 === _0_0 || 62 === _0_0) { + t1 = true; + break $label0$0; + } + t1 = false; + break $label0$0; + } + return t1; + }, + $signature: 26 + }; + A.StylesheetParser__publicIdentifier_closure.prototype = { + call$0() { + return this.$this.scanner.spanFrom$1(this.start); + }, + $signature: 25 + }; + A.StylesheetGraph.prototype = { + modifiedSince$3(url, since, baseImporter) { + var node = this._stylesheet_graph$_add$3(url, baseImporter, null); + if (node == null) + return true; + return new A.StylesheetGraph_modifiedSince_transitiveModificationTime(this).call$1(node)._core$_value > since._core$_value; + }, + _stylesheet_graph$_add$3(url, baseImporter, baseUrl) { + var importer, canonicalUrl, _this = this, + result = _this._ignoreErrors$1(new A.StylesheetGraph__add_closure(_this, url, baseImporter, baseUrl)); + if (type$.Record_3_nullable_Object_and_nullable_Object_and_nullable_Object_originalUrl._is(result)) { + importer = result._0; + canonicalUrl = result._1; + _this.addCanonical$3(importer, canonicalUrl, result._2); + return _this._nodes.$index(0, canonicalUrl); + } else + return null; + }, + addCanonical$4$recanonicalize(importer, canonicalUrl, originalUrl, recanonicalize) { + var stylesheet, _this = this, + t1 = _this._nodes; + if (t1.$index(0, canonicalUrl) != null) + return B.Set_empty3; + stylesheet = _this._ignoreErrors$1(new A.StylesheetGraph_addCanonical_closure(_this, importer, canonicalUrl, originalUrl)); + if (stylesheet == null) + return B.Set_empty3; + t1.$indexSet(0, canonicalUrl, A.StylesheetNode$_(stylesheet, importer, canonicalUrl, _this._upstreamNodes$3(stylesheet, importer, canonicalUrl))); + return recanonicalize ? _this._recanonicalizeImports$2(importer, canonicalUrl) : B.Set_empty3; + }, + addCanonical$3(importer, canonicalUrl, originalUrl) { + return this.addCanonical$4$recanonicalize(importer, canonicalUrl, originalUrl, true); + }, + _upstreamNodes$3(stylesheet, baseImporter, baseUrl) { + var t6, t7, t8, t9, t10, + t1 = type$.Uri, + active = A.LinkedHashSet_LinkedHashSet$_literal([baseUrl], t1), + t2 = A.LinkedHashSet_LinkedHashSet$_empty(t1), + t3 = A.LinkedHashSet_LinkedHashSet$_empty(t1), + t4 = A.LinkedHashSet_LinkedHashSet$_empty(t1), + t5 = A.LinkedHashSet_LinkedHashSet$_empty(t1); + new A._FindDependenciesVisitor(t2, t3, t4, t5, A.LinkedHashSet_LinkedHashSet$_empty(type$.nullable_String)).visitChildren$1(stylesheet.children); + t6 = type$.UnmodifiableSetView_Uri; + t2 = new A.UnmodifiableSetView0(t2, t6); + t3 = new A.UnmodifiableSetView0(t3, t6); + t4 = new A.UnmodifiableSetView0(t4, t6); + t7 = type$.nullable_StylesheetNode; + t8 = A.LinkedHashMap_LinkedHashMap$_empty(t1, t7); + for (t9 = new A.UnionSet(A.LinkedHashSet_LinkedHashSet$_literal([t2, t3, t4], type$.Set_Uri), type$.UnionSet_Uri).get$_union_set$_iterable(), t9 = t9.get$iterator(t9); t9.moveNext$0();) { + t10 = t9.get$current(t9); + t8.$indexSet(0, t10, this._nodeFor$4(t10, baseImporter, baseUrl, active)); + } + t1 = A.LinkedHashMap_LinkedHashMap$_empty(t1, t7); + for (t2 = new A.DependencyReport(t2, t3, t4, new A.UnmodifiableSetView0(t5, t6)).imports._base.get$iterator(0); t2.moveNext$0();) { + t3 = t2.get$current(0); + t1.$indexSet(0, t3, this._nodeFor$5$forImport(t3, baseImporter, baseUrl, active, true)); + } + return new A._Record_2_imports_modules(t1, t8); + }, + reload$1(canonicalUrl) { + var stylesheet, upstream, _this = this, + node = _this._nodes.$index(0, canonicalUrl); + if (node == null) + throw A.wrapException(A.StateError$(canonicalUrl.toString$0(0) + " is not in the dependency graph.")); + _this._transitiveModificationTimes.clear$0(0); + _this.importCache.clearImport$1(canonicalUrl); + stylesheet = _this._ignoreErrors$1(new A.StylesheetGraph_reload_closure(_this, node, canonicalUrl)); + if (stylesheet == null) + return false; + node._stylesheet = stylesheet; + upstream = _this._upstreamNodes$3(stylesheet, node.importer, canonicalUrl); + node._replaceUpstream$2(upstream._1, upstream._0); + return true; + }, + _recanonicalizeImports$2(importer, canonicalUrl) { + var t1, t2, t3, t4, t5, newUpstream, newUpstreamImports, _this = this, + changed = A.LinkedHashSet_LinkedHashSet$_empty(type$.StylesheetNode); + for (t1 = _this._nodes.get$values(0).get$iterator(0), t2 = type$.UnmodifiableMapView_of_Uri_and_nullable_StylesheetNode, t3 = type$.Uri, t4 = type$.nullable_StylesheetNode; t1.moveNext$0();) { + t5 = t1.get$current(0); + newUpstream = _this._recanonicalizeImportsForNode$4$forImport(t5, importer, canonicalUrl, false); + newUpstreamImports = _this._recanonicalizeImportsForNode$4$forImport(t5, importer, canonicalUrl, true); + if (newUpstream.__js_helper$_length !== 0 || newUpstreamImports.__js_helper$_length !== 0) { + changed.add$1(0, t5); + t5._replaceUpstream$2(A.mergeMaps(new A.UnmodifiableMapView(t5._upstream, t2), newUpstream, t3, t4), A.mergeMaps(new A.UnmodifiableMapView(t5._upstreamImports, t2), newUpstreamImports, t3, t4)); + } + } + if (changed._collection$_length !== 0) + _this._transitiveModificationTimes.clear$0(0); + return changed; + }, + _recanonicalizeImportsForNode$4$forImport(node, importer, canonicalUrl, forImport) { + var url, result, t2, newMap, t3, t4, t5, t6, upstream, exception, newCanonicalUrl, + t1 = type$.UnmodifiableMapView_of_Uri_and_nullable_StylesheetNode, + map = forImport ? new A.UnmodifiableMapView(node._upstreamImports, t1) : new A.UnmodifiableMapView(node._upstream, t1); + t1 = type$.Uri; + t2 = type$.nullable_StylesheetNode; + newMap = A.LinkedHashMap_LinkedHashMap$_empty(t1, t2); + for (t1 = A.MapExtensions_get_pairs(map, t1, t2), t1 = t1.get$iterator(t1), t2 = this._nodes, t3 = this.importCache, t4 = node.importer, t5 = node.canonicalUrl; t1.moveNext$0();) { + t6 = t1.get$current(t1); + url = null; + url = t6._0; + upstream = t6._1; + if (!importer.couldCanonicalize$2(url, canonicalUrl)) + continue; + t3.clearCanonicalize$1(url); + result = null; + try { + result = t3.canonicalize$4$baseImporter$baseUrl$forImport(0, url, t4, t5, forImport); + } catch (exception) { + } + t6 = result; + newCanonicalUrl = t6 == null ? null : t6._1; + if (J.$eq$(newCanonicalUrl, upstream == null ? null : upstream.canonicalUrl)) + continue; + t6 = url; + newMap.$indexSet(0, t6, result == null ? null : t2.$index(0, newCanonicalUrl)); + } + return newMap; + }, + _nodeFor$5$forImport(url, baseImporter, baseUrl, active, forImport) { + var canonicalUrl, t2, _1_0, stylesheet, t3, t4, node, _this = this, t1 = {}, + result = _this._ignoreErrors$1(new A.StylesheetGraph__nodeFor_closure(_this, url, baseImporter, baseUrl, forImport)); + if (result == null) + return null; + t1.originalUrl = t1.canonicalUrl = t1.importer = null; + t1.importer = result._0; + canonicalUrl = t1.canonicalUrl = result._1; + t1.originalUrl = result._2; + t2 = _this._nodes; + _1_0 = t2.$index(0, canonicalUrl); + if (_1_0 != null) + return _1_0; + if (active.contains$1(0, canonicalUrl)) + return null; + stylesheet = _this._ignoreErrors$1(new A.StylesheetGraph__nodeFor_closure0(t1, _this)); + if (stylesheet == null) + return null; + active.add$1(0, t1.canonicalUrl); + t3 = t1.importer; + t4 = t1.canonicalUrl; + node = A.StylesheetNode$_(stylesheet, t3, t4, _this._upstreamNodes$3(stylesheet, t3, t4)); + active.remove$1(0, t1.canonicalUrl); + t2.$indexSet(0, t1.canonicalUrl, node); + return node; + }, + _nodeFor$4(url, baseImporter, baseUrl, active) { + return this._nodeFor$5$forImport(url, baseImporter, baseUrl, active, false); + }, + _ignoreErrors$1$1(callback) { + var t1, exception; + try { + t1 = callback.call$0(); + return t1; + } catch (exception) { + return null; + } + }, + _ignoreErrors$1(callback) { + return this._ignoreErrors$1$1(callback, type$.dynamic); + } + }; + A.StylesheetGraph_modifiedSince_transitiveModificationTime.prototype = { + call$1(node) { + return this.$this._transitiveModificationTimes.putIfAbsent$2(node.canonicalUrl, new A.StylesheetGraph_modifiedSince_transitiveModificationTime_closure(node, this)); + }, + $signature: 319 + }; + A.StylesheetGraph_modifiedSince_transitiveModificationTime_closure.prototype = { + call$0() { + var t2, t3, upstreamTime, + t1 = this.node, + latest = t1.importer.modificationTime$1(t1.canonicalUrl); + for (t1 = t1._upstream.get$values(0).followedBy$1(0, t1._upstreamImports.get$values(0)), t1 = new A.FollowedByIterator(J.get$iterator$ax(t1.__internal$_first), t1._second), t2 = this.transitiveModificationTime; t1.moveNext$0();) { + t3 = t1._currentIterator; + t3 = t3.get$current(t3); + upstreamTime = t3 == null ? new A.DateTime(Date.now(), false) : t2.call$1(t3); + if (upstreamTime._core$_value > latest._core$_value) + latest = upstreamTime; + } + return latest; + }, + $signature: 164 + }; + A.StylesheetGraph__add_closure.prototype = { + call$0() { + var _this = this; + return _this.$this.importCache.canonicalize$3$baseImporter$baseUrl(0, _this.url, _this.baseImporter, _this.baseUrl); + }, + $signature: 111 + }; + A.StylesheetGraph_addCanonical_closure.prototype = { + call$0() { + var _this = this; + return _this.$this.importCache.importCanonical$3$originalUrl(_this.importer, _this.canonicalUrl, _this.originalUrl); + }, + $signature: 91 + }; + A.StylesheetGraph_reload_closure.prototype = { + call$0() { + return this.$this.importCache.importCanonical$2(this.node.importer, this.canonicalUrl); + }, + $signature: 91 + }; + A.StylesheetGraph__nodeFor_closure.prototype = { + call$0() { + var _this = this; + return _this.$this.importCache.canonicalize$4$baseImporter$baseUrl$forImport(0, _this.url, _this.baseImporter, _this.baseUrl, _this.forImport); + }, + $signature: 111 + }; + A.StylesheetGraph__nodeFor_closure0.prototype = { + call$0() { + var t1 = this._box_0; + return this.$this.importCache.importCanonical$3$originalUrl(t1.importer, t1.canonicalUrl, t1.originalUrl); + }, + $signature: 91 + }; + A.StylesheetNode.prototype = { + StylesheetNode$_$4(_stylesheet, importer, canonicalUrl, allUpstream) { + var t1, t2; + for (t1 = this._upstream.get$values(0).followedBy$1(0, this._upstreamImports.get$values(0)), t1 = new A.FollowedByIterator(J.get$iterator$ax(t1.__internal$_first), t1._second); t1.moveNext$0();) { + t2 = t1._currentIterator; + t2 = t2.get$current(t2); + if (t2 != null) + t2._downstream.add$1(0, this); + } + }, + _replaceUpstream$2(newUpstream, newUpstreamImports) { + var t3, oldUpstream, newUpstreamSet, _this = this, + t1 = type$.nullable_StylesheetNode, + t2 = A.LinkedHashSet_LinkedHashSet$of(_this._upstream.get$values(0), t1); + t2.addAll$1(0, _this._upstreamImports.get$values(0)); + t3 = type$.StylesheetNode; + oldUpstream = A.SetExtension_removeNull(t2, t3); + t1 = A.LinkedHashSet_LinkedHashSet$of(newUpstream.get$values(0), t1); + t1.addAll$1(0, newUpstreamImports.get$values(0)); + newUpstreamSet = A.SetExtension_removeNull(t1, t3); + for (t1 = oldUpstream.difference$1(newUpstreamSet), t1 = t1.get$iterator(t1); t1.moveNext$0();) + t1.get$current(t1)._downstream.remove$1(0, _this); + for (t1 = newUpstreamSet.difference$1(oldUpstream), t1 = t1.get$iterator(t1); t1.moveNext$0();) + t1.get$current(t1)._downstream.add$1(0, _this); + _this._upstream = newUpstream; + _this._upstreamImports = newUpstreamImports; + }, + _stylesheet_graph$_remove$0() { + var t1, t2, t3, t4, _i, url, _this = this; + for (t1 = A.LinkedHashSet_LinkedHashSet$of(_this._upstream.get$values(0), type$.nullable_StylesheetNode), t1.addAll$1(0, _this._upstreamImports.get$values(0)), t1 = A._LinkedHashSetIterator$(t1, t1._collection$_modifications, A._instanceType(t1)._precomputed1), t2 = t1.$ti._precomputed1; t1.moveNext$0();) { + t3 = t1._collection$_current; + if (t3 == null) + t3 = t2._as(t3); + if (t3 == null) + continue; + t3._downstream.remove$1(0, _this); + } + for (t1 = _this._downstream.get$iterator(0); t1.moveNext$0();) { + t2 = t1.get$current(0); + for (t3 = t2._upstream, t4 = A._instanceType(t3)._eval$1("LinkedHashMapKeyIterable<1>"), t4 = A.List_List$of(new A.LinkedHashMapKeyIterable(t3, t4), true, t4._eval$1("Iterable.E")), t3 = t4.length, _i = 0; _i < t3; ++_i) { + url = t4[_i]; + if (J.$eq$(t2._upstream.$index(0, url), _this)) { + t2._upstream.$indexSet(0, url, null); + break; + } + } + for (t3 = t2._upstreamImports, t4 = A._instanceType(t3)._eval$1("LinkedHashMapKeyIterable<1>"), t4 = A.List_List$of(new A.LinkedHashMapKeyIterable(t3, t4), true, t4._eval$1("Iterable.E")), t3 = t4.length, _i = 0; _i < t3; ++_i) { + url = t4[_i]; + if (J.$eq$(t2._upstreamImports.$index(0, url), _this)) { + t2._upstreamImports.$indexSet(0, url, null); + break; + } + } + } + }, + toString$0(_) { + var t1 = this._stylesheet.span; + t1 = A.NullableExtension_andThen(t1.get$sourceUrl(t1), A.path__prettyUri$closure()); + return t1 == null ? "" : t1; + } + }; + A.Syntax.prototype = { + _enumToString$0() { + return "Syntax." + this._name; + }, + toString$0(_) { + return this._syntax$_name; + } + }; + A.Box.prototype = { + $eq(_, other) { + if (other == null) + return false; + return this.$ti._is(other) && other._box$_inner === this._box$_inner; + }, + get$hashCode(_) { + return A.Primitives_objectHashCode(this._box$_inner); + } + }; + A.ModifiableBox.prototype = {}; + A.LazyFileSpan.prototype = { + get$span(_) { + var t1 = this._lazy_file_span$_span; + return t1 == null ? this._lazy_file_span$_span = this._builder.call$0() : t1; + }, + compareTo$1(_, other) { + return this.get$span(0).compareTo$1(0, other); + }, + get$context(_) { + var t1 = this.get$span(0); + return t1.get$context(t1); + }, + get$end(_) { + var t1 = this.get$span(0); + return t1.get$end(t1); + }, + expand$1(_, other) { + return this.get$span(0).expand$1(0, other); + }, + get$file(_) { + var t1 = this.get$span(0); + return t1.get$file(t1); + }, + highlight$1$color(color) { + return this.get$span(0).highlight$1$color(color); + }, + get$length(_) { + var t1 = this.get$span(0); + return t1.get$length(t1); + }, + message$2$color(_, message, color) { + return this.get$span(0).message$2$color(0, message, color); + }, + message$1(_, message) { + return this.message$2$color(0, message, null); + }, + get$sourceUrl(_) { + var t1 = this.get$span(0); + return t1.get$sourceUrl(t1); + }, + get$start(_) { + var t1 = this.get$span(0); + return t1.get$start(t1); + }, + get$text() { + return this.get$span(0).get$text(); + }, + $isComparable: 1, + $isFileSpan: 1, + $isSourceSpan: 1, + $isSourceSpanWithContext: 1 + }; + A.LimitedMapView.prototype = { + get$keys(_) { + return this._limited_map_view$_keys; + }, + get$length(_) { + return this._limited_map_view$_keys._collection$_length; + }, + get$isEmpty(_) { + return this._limited_map_view$_keys._collection$_length === 0; + }, + get$isNotEmpty(_) { + return this._limited_map_view$_keys._collection$_length !== 0; + }, + $index(_, key) { + return this._limited_map_view$_keys.contains$1(0, key) ? this._limited_map_view$_map.$index(0, key) : null; + }, + containsKey$1(key) { + return this._limited_map_view$_keys.contains$1(0, key); + }, + remove$1(_, key) { + return this._limited_map_view$_keys.contains$1(0, key) ? this._limited_map_view$_map.remove$1(0, key) : null; + } + }; + A.MapExtensions_get_pairs_closure.prototype = { + call$1(e) { + return new A._Record_2(e.key, e.value); + }, + $signature() { + return this.K._eval$1("@<0>")._bind$1(this.V)._eval$1("+(1,2)(MapEntry<1,2>)"); + } + }; + A.MergedMapView.prototype = { + get$keys(_) { + var t1 = this._mapsByKey; + return new A.LinkedHashMapKeyIterable(t1, A._instanceType(t1)._eval$1("LinkedHashMapKeyIterable<1>")); + }, + get$length(_) { + return this._mapsByKey.__js_helper$_length; + }, + get$isEmpty(_) { + return this._mapsByKey.__js_helper$_length === 0; + }, + get$isNotEmpty(_) { + return this._mapsByKey.__js_helper$_length !== 0; + }, + MergedMapView$1(maps, $K, $V) { + var t1, t2, t3, _i, map, t4, t5, t6; + for (t1 = maps.length, t2 = this._mapsByKey, t3 = $K._eval$1("@<0>")._bind$1($V)._eval$1("MergedMapView<1,2>"), _i = 0; _i < maps.length; maps.length === t1 || (0, A.throwConcurrentModificationError)(maps), ++_i) { + map = maps[_i]; + if (t3._is(map)) + for (t4 = map._mapsByKey.get$values(0), t5 = A._instanceType(t4), t5 = t5._eval$1("@<1>")._bind$1(t5._rest[1]), t4 = new A.MappedIterator(J.get$iterator$ax(t4.__internal$_iterable), t4._f, t5._eval$1("MappedIterator<1,2>")), t5 = t5._rest[1]; t4.moveNext$0();) { + t6 = t4.__internal$_current; + if (t6 == null) + t6 = t5._as(t6); + A.setAll(t2, t6.get$keys(t6), t6); + } + else + A.setAll(t2, map.get$keys(map), map); + } + }, + $index(_, key) { + var t1 = this._mapsByKey.$index(0, this.$ti._precomputed1._as(key)); + return t1 == null ? null : t1.$index(0, key); + }, + $indexSet(_, key, value) { + var _0_0 = this._mapsByKey.$index(0, key); + if (_0_0 != null) + _0_0.$indexSet(0, key, value); + else + throw A.wrapException(A.UnsupportedError$(string$.New_en)); + }, + remove$1(_, key) { + throw A.wrapException(A.UnsupportedError$(string$.Entrie)); + }, + containsKey$1(key) { + return this._mapsByKey.containsKey$1(key); + } + }; + A.MultiDirWatcher.prototype = { + watch$1(_, directory) { + var t1, t2, t3, t4, isParentOfExistingDir, _i, t5, _0_1, existingWatcher, future, completer; + for (t1 = this._watchers, t2 = A.MapExtensions_get_pairs(t1, type$.nullable_String, type$.Stream_WatchEvent).toList$0(0), t3 = t2.length, t1 = t1._map, t4 = this._group, isParentOfExistingDir = false, _i = 0; _i < t2.length; t2.length === t3 || (0, A.throwConcurrentModificationError)(t2), ++_i) { + t5 = t2[_i]; + _0_1 = t5._0; + _0_1.toString; + existingWatcher = t5._1; + if (!isParentOfExistingDir) { + t5 = $.$get$context(); + t5 = t5._isWithinOrEquals$2(_0_1, directory) === B._PathRelation_equal || t5._isWithinOrEquals$2(_0_1, directory) === B._PathRelation_within; + } else + t5 = false; + if (t5) { + t1 = new A._Future($.Zone__current, type$._Future_void); + t1._asyncComplete$1(null); + return t1; + } + if ($.$get$context()._isWithinOrEquals$2(directory, _0_1) === B._PathRelation_within) { + t1.remove$1(0, _0_1); + t4.remove$1(0, existingWatcher); + isParentOfExistingDir = true; + } + } + future = A.watchDir(directory, this._poll); + t2 = new A._CompleterStream(type$._CompleterStream_WatchEvent); + completer = new A.StreamCompleter(t2, type$.StreamCompleter_WatchEvent); + future.then$1$2$onError(0, completer.get$setSourceStream(), completer.get$setError(), type$.void); + t1.$indexSet(0, directory, t2); + t4.add$1(0, t2); + return future; + } + }; + A.MultiSpan.prototype = { + get$start(_) { + var t1 = this._multi_span$_primary; + return t1.get$start(t1); + }, + get$end(_) { + var t1 = this._multi_span$_primary; + return t1.get$end(t1); + }, + get$text() { + return this._multi_span$_primary.get$text(); + }, + get$context(_) { + var t1 = this._multi_span$_primary; + return t1.get$context(t1); + }, + get$file(_) { + var t1 = this._multi_span$_primary; + return t1.get$file(t1); + }, + get$length(_) { + var t1 = this._multi_span$_primary; + return t1.get$length(t1); + }, + get$sourceUrl(_) { + var t1 = this._multi_span$_primary; + return t1.get$sourceUrl(t1); + }, + compareTo$1(_, other) { + return this._multi_span$_primary.compareTo$1(0, other); + }, + toString$0(_) { + return this._multi_span$_primary.toString$0(0); + }, + expand$1(_, other) { + return new A.MultiSpan(this._multi_span$_primary.expand$1(0, other), this.primaryLabel, this.secondarySpans); + }, + highlight$1$color(color) { + var t1 = color === true || false; + return A.Highlighter$multiple(this._multi_span$_primary, this.primaryLabel, this.secondarySpans, t1, null, null).highlight$0(); + }, + message$2$color(_, message, color) { + var t1 = J.$eq$(color, true) || typeof color == "string", + t2 = typeof color == "string" ? color : null; + return A.SourceSpanExtension_messageMultiple(this._multi_span$_primary, message, this.primaryLabel, this.secondarySpans, t1, t2, null); + }, + message$1(_, message) { + return this.message$2$color(0, message, null); + }, + $isComparable: 1, + $isFileSpan: 1, + $isSourceSpan: 1, + $isSourceSpanWithContext: 1 + }; + A.NoSourceMapBuffer.prototype = { + get$length(_) { + return this._no_source_map_buffer$_buffer._contents.length; + }, + forSpan$1$2(span, callback) { + return callback.call$0(); + }, + forSpan$2(span, callback) { + return this.forSpan$1$2(span, callback, type$.dynamic); + }, + write$1(_, object) { + this._no_source_map_buffer$_buffer._contents += A.S(object); + return null; + }, + writeCharCode$1(charCode) { + this._no_source_map_buffer$_buffer._contents += A.Primitives_stringFromCharCode(charCode); + return null; + }, + toString$0(_) { + var t1 = this._no_source_map_buffer$_buffer._contents; + return t1.charCodeAt(0) == 0 ? t1 : t1; + }, + buildSourceMap$1$prefix(prefix) { + return A.throwExpression(A.UnsupportedError$(string$.NoSour)); + } + }; + A.PrefixedMapView.prototype = { + get$keys(_) { + return new A._PrefixedKeys(this); + }, + get$length(_) { + var t1 = this._prefixed_map_view$_map; + return t1.get$length(t1); + }, + get$isEmpty(_) { + var t1 = this._prefixed_map_view$_map; + return t1.get$isEmpty(t1); + }, + get$isNotEmpty(_) { + var t1 = this._prefixed_map_view$_map; + return t1.get$isNotEmpty(t1); + }, + $index(_, key) { + return typeof key == "string" && B.JSString_methods.startsWith$1(key, this._prefix) ? this._prefixed_map_view$_map.$index(0, J.substring$1$s(key, this._prefix.length)) : null; + }, + containsKey$1(key) { + return typeof key == "string" && B.JSString_methods.startsWith$1(key, this._prefix) && this._prefixed_map_view$_map.containsKey$1(J.substring$1$s(key, this._prefix.length)); + } + }; + A._PrefixedKeys.prototype = { + get$length(_) { + var t1 = this._view._prefixed_map_view$_map; + return t1.get$length(t1); + }, + get$iterator(_) { + var t1 = this._view._prefixed_map_view$_map; + t1 = J.map$1$1$ax(t1.get$keys(t1), new A._PrefixedKeys_iterator_closure(this), type$.String); + return t1.get$iterator(t1); + }, + contains$1(_, key) { + return this._view.containsKey$1(key); + } + }; + A._PrefixedKeys_iterator_closure.prototype = { + call$1(key) { + return this.$this._view._prefix + key; + }, + $signature: 5 + }; + A.PublicMemberMapView.prototype = { + get$keys(_) { + var t1 = this._public_member_map_view$_inner; + return J.where$1$ax(t1.get$keys(t1), A.utils__isPublic$closure()); + }, + containsKey$1(key) { + return typeof key == "string" && A.isPublic(key) && this._public_member_map_view$_inner.containsKey$1(key); + }, + $index(_, key) { + if (typeof key == "string" && A.isPublic(key)) + return this._public_member_map_view$_inner.$index(0, key); + return null; + } + }; + A.SourceMapBuffer.prototype = { + get$_targetLocation() { + var t1 = this._source_map_buffer$_buffer._contents, + t2 = this._line; + return A.SourceLocation$(t1.length, this._column, t2, null); + }, + get$length(_) { + return this._source_map_buffer$_buffer._contents.length; + }, + forSpan$1$2(span, callback) { + var t1, _this = this, + wasInSpan = _this._inSpan; + _this._inSpan = true; + _this._addEntry$2(span.get$start(span), _this.get$_targetLocation()); + try { + t1 = callback.call$0(); + return t1; + } finally { + _this._inSpan = wasInSpan; + } + }, + forSpan$2(span, callback) { + return this.forSpan$1$2(span, callback, type$.dynamic); + }, + _addEntry$2(source, target) { + var entry, t2, + t1 = this._entries; + if (t1.length !== 0) { + entry = B.JSArray_methods.get$last(t1); + t2 = entry.source; + if (t2.file.getLine$1(t2.offset) === source.file.getLine$1(source.offset) && entry.target.line === target.line) + return; + if (entry.target.offset === target.offset) + return; + } + t1.push(new A.Entry(source, target, null)); + }, + write$1(_, object) { + var t1, i, + string = J.toString$0$(object); + this._source_map_buffer$_buffer._contents += string; + for (t1 = string.length, i = 0; i < t1; ++i) + if (string.charCodeAt(i) === 10) + this._source_map_buffer$_writeLine$0(); + else + ++this._column; + }, + writeCharCode$1(charCode) { + this._source_map_buffer$_buffer._contents += A.Primitives_stringFromCharCode(charCode); + if (charCode === 10) + this._source_map_buffer$_writeLine$0(); + else + ++this._column; + }, + _source_map_buffer$_writeLine$0() { + var _this = this, + t1 = _this._entries; + if (B.JSArray_methods.get$last(t1).target.line === _this._line && B.JSArray_methods.get$last(t1).target.column === _this._column) + t1.pop(); + ++_this._line; + _this._column = 0; + if (_this._inSpan) + t1.push(new A.Entry(B.JSArray_methods.get$last(t1).source, _this.get$_targetLocation(), null)); + }, + toString$0(_) { + var t1 = this._source_map_buffer$_buffer._contents; + return t1.charCodeAt(0) == 0 ? t1 : t1; + }, + buildSourceMap$1$prefix(prefix) { + var i, t2, prefixColumn, _box_0 = {}, + t1 = prefix.length; + if (t1 === 0) + return A.SingleMapping_SingleMapping$fromEntries(this._entries); + _box_0.prefixColumn = _box_0.prefixLines = 0; + for (i = 0, t2 = 0; i < t1; ++i) + if (prefix.charCodeAt(i) === 10) { + ++_box_0.prefixLines; + _box_0.prefixColumn = 0; + t2 = 0; + } else { + prefixColumn = t2 + 1; + _box_0.prefixColumn = prefixColumn; + t2 = prefixColumn; + } + t2 = this._entries; + return A.SingleMapping_SingleMapping$fromEntries(new A.MappedListIterable(t2, new A.SourceMapBuffer_buildSourceMap_closure(_box_0, t1), A._arrayInstanceType(t2)._eval$1("MappedListIterable<1,Entry>"))); + } + }; + A.SourceMapBuffer_buildSourceMap_closure.prototype = { + call$1(entry) { + var t1 = entry.target, + t2 = t1.line, + t3 = this._box_0, + t4 = t3.prefixLines; + t3 = t2 === 0 ? t3.prefixColumn : 0; + return new A.Entry(entry.source, A.SourceLocation$(t1.offset + this.prefixLength, t1.column + t3, t2 + t4, null), entry.identifierName); + }, + $signature: 204 + }; + A.UnprefixedMapView.prototype = { + get$keys(_) { + return new A._UnprefixedKeys(this); + }, + $index(_, key) { + return typeof key == "string" ? this._unprefixed_map_view$_map.$index(0, this._unprefixed_map_view$_prefix + key) : null; + }, + containsKey$1(key) { + return typeof key == "string" && this._unprefixed_map_view$_map.containsKey$1(this._unprefixed_map_view$_prefix + key); + }, + remove$1(_, key) { + return typeof key == "string" ? this._unprefixed_map_view$_map.remove$1(0, this._unprefixed_map_view$_prefix + key) : null; + } + }; + A._UnprefixedKeys.prototype = { + get$iterator(_) { + var t1 = this._unprefixed_map_view$_view._unprefixed_map_view$_map; + t1 = J.where$1$ax(t1.get$keys(t1), new A._UnprefixedKeys_iterator_closure(this)).map$1$1(0, new A._UnprefixedKeys_iterator_closure0(this), type$.String); + return t1.get$iterator(t1); + }, + contains$1(_, key) { + return this._unprefixed_map_view$_view.containsKey$1(key); + } + }; + A._UnprefixedKeys_iterator_closure.prototype = { + call$1(key) { + return B.JSString_methods.startsWith$1(key, this.$this._unprefixed_map_view$_view._unprefixed_map_view$_prefix); + }, + $signature: 4 + }; + A._UnprefixedKeys_iterator_closure0.prototype = { + call$1(key) { + return B.JSString_methods.substring$1(key, this.$this._unprefixed_map_view$_view._unprefixed_map_view$_prefix.length); + }, + $signature: 5 + }; + A.indent_closure.prototype = { + call$1(line) { + return B.JSString_methods.$mul(" ", this.indentation) + line; + }, + $signature: 5 + }; + A.flattenVertically_closure.prototype = { + call$1(inner) { + return A.QueueList_QueueList$from(inner, this.T); + }, + $signature() { + return this.T._eval$1("QueueList<0>(Iterable<0>)"); + } + }; + A.flattenVertically_closure0.prototype = { + call$1(queue) { + this.result.push(queue.removeFirst$0()); + return queue.get$length(0) === 0; + }, + $signature() { + return this.T._eval$1("bool(QueueList<0>)"); + } + }; + A.longestCommonSubsequence_backtrack.prototype = { + call$2(i, j) { + var selection, t1, _this = this; + if (i === -1 || j === -1) + return A._setArrayType([], _this.T._eval$1("JSArray<0>")); + selection = _this.selections[i][j]; + if (selection != null) { + t1 = _this.call$2(i - 1, j - 1); + J.add$1$ax(t1, selection); + return t1; + } + t1 = _this.lengths; + return t1[i + 1][j] > t1[i][j + 1] ? _this.call$2(i, j - 1) : _this.call$2(i - 1, j); + }, + $signature() { + return this.T._eval$1("List<0>(int,int)"); + } + }; + A.mapAddAll2_closure.prototype = { + call$2(key, inner) { + var t1 = this.destination, + _0_0 = t1.$index(0, key); + if (_0_0 != null) + _0_0.addAll$1(0, inner); + else + t1.$indexSet(0, key, inner); + }, + $signature() { + return this.K1._eval$1("@<0>")._bind$1(this.K2)._bind$1(this.V)._eval$1("~(1,Map<2,3>)"); + } + }; + A.Value.prototype = { + get$isTruthy() { + return true; + }, + get$separator(_) { + return B.ListSeparator_undecided_null_undecided; + }, + get$hasBrackets() { + return false; + }, + get$asList() { + return A._setArrayType([this], type$.JSArray_Value); + }, + get$lengthAsList() { + return 1; + }, + get$isBlank() { + return false; + }, + get$isSpecialNumber() { + return false; + }, + get$isVar() { + return false; + }, + get$realNull() { + return this; + }, + sassIndexToListIndex$2(sassIndex, $name) { + var t1, t2, index, + indexValue = sassIndex.assertNumber$1($name); + if (indexValue.get$hasUnits()) { + t1 = indexValue.get$unitString(); + t2 = indexValue.unitSuggestion$1($name); + A.EvaluationContext_current().warn$2(0, "$" + $name + ": Passing a number with unit " + t1 + string$.x20is_de + t2 + string$.x0a_Morex3a, B.Deprecation_8WR); + } + index = indexValue.assertInt$1($name); + if (index === 0) + throw A.wrapException(A.SassScriptException$("List index may not be 0.", $name)); + if (Math.abs(index) > this.get$lengthAsList()) + throw A.wrapException(A.SassScriptException$("Invalid index " + sassIndex.toString$0(0) + " for a list with " + this.get$lengthAsList() + " elements.", $name)); + return index < 0 ? this.get$lengthAsList() + index : index - 1; + }, + assertCalculation$1($name) { + return A.throwExpression(A.SassScriptException$(this.toString$0(0) + " is not a calculation.", $name)); + }, + assertColor$1($name) { + return A.throwExpression(A.SassScriptException$(this.toString$0(0) + " is not a color.", $name)); + }, + assertFunction$1($name) { + return A.throwExpression(A.SassScriptException$(this.toString$0(0) + " is not a function reference.", $name)); + }, + assertMixin$1($name) { + return A.throwExpression(A.SassScriptException$(this.toString$0(0) + " is not a mixin reference.", $name)); + }, + assertMap$1($name) { + return A.throwExpression(A.SassScriptException$(this.toString$0(0) + " is not a map.", $name)); + }, + tryMap$0() { + return null; + }, + assertNumber$1($name) { + return A.throwExpression(A.SassScriptException$(this.toString$0(0) + " is not a number.", $name)); + }, + assertNumber$0() { + return this.assertNumber$1(null); + }, + assertString$1($name) { + return A.throwExpression(A.SassScriptException$(this.toString$0(0) + " is not a string.", $name)); + }, + _selectorString$1($name) { + var _0_0 = this._selectorStringOrNull$0(); + if (_0_0 != null) + return _0_0; + throw A.wrapException(A.SassScriptException$(this.toString$0(0) + string$.x20is_noa, $name)); + }, + _selectorStringOrNull$0() { + var t1, t2, result, _1_0, _i, complex, string, compound, _this = this, _null = null; + if (_this instanceof A.SassString) + return _this._string$_text; + if (!(_this instanceof A.SassList)) + return _null; + t1 = _this._list$_contents; + t2 = t1.length; + if (t2 === 0) + return _null; + result = A._setArrayType([], type$.JSArray_String); + $label0$1: { + _1_0 = _this._separator; + if (B.ListSeparator_rXA === _1_0) { + for (_i = 0; _i < t2; ++_i) { + complex = t1[_i]; + if (complex instanceof A.SassString) { + result.push(complex._string$_text); + continue; + } + if (complex instanceof A.SassList && B.ListSeparator_EVt === complex._separator) { + string = complex._selectorStringOrNull$0(); + if (string == null) + return _null; + result.push(string); + continue; + } + return _null; + } + break $label0$1; + } + if (B.ListSeparator_zg9 === _1_0) + return _null; + for (_i = 0; _i < t2; ++_i) { + compound = t1[_i]; + if (!(compound instanceof A.SassString)) + return _null; + result.push(compound._string$_text); + } + break $label0$1; + } + return B.JSArray_methods.join$1(result, _1_0 === B.ListSeparator_rXA ? ", " : " "); + }, + withListContents$2$separator(contents, separator) { + var t1 = separator == null ? this.get$separator(this) : separator, + t2 = this.get$hasBrackets(); + return A.SassList$(contents, t1, t2); + }, + withListContents$1(contents) { + return this.withListContents$2$separator(contents, null); + }, + greaterThan$1(other) { + return A.throwExpression(A.SassScriptException$('Undefined operation "' + this.toString$0(0) + " > " + other.toString$0(0) + '".', null)); + }, + greaterThanOrEquals$1(other) { + return A.throwExpression(A.SassScriptException$('Undefined operation "' + this.toString$0(0) + " >= " + other.toString$0(0) + '".', null)); + }, + lessThan$1(other) { + return A.throwExpression(A.SassScriptException$('Undefined operation "' + this.toString$0(0) + " < " + other.toString$0(0) + '".', null)); + }, + lessThanOrEquals$1(other) { + return A.throwExpression(A.SassScriptException$('Undefined operation "' + this.toString$0(0) + " <= " + other.toString$0(0) + '".', null)); + }, + times$1(other) { + return A.throwExpression(A.SassScriptException$('Undefined operation "' + this.toString$0(0) + " * " + other.toString$0(0) + '".', null)); + }, + modulo$1(other) { + return A.throwExpression(A.SassScriptException$('Undefined operation "' + this.toString$0(0) + " % " + other.toString$0(0) + '".', null)); + }, + plus$1(other) { + var t1; + $label0$0: { + if (other instanceof A.SassString) { + t1 = new A.SassString(A.serializeValue(this, false, true) + other._string$_text, other._hasQuotes); + break $label0$0; + } + if (other instanceof A.SassCalculation) + A.throwExpression(A.SassScriptException$('Undefined operation "' + this.toString$0(0) + " + " + other.toString$0(0) + '".', null)); + t1 = new A.SassString(A.serializeValue(this, false, true) + A.serializeValue(other, false, true), false); + break $label0$0; + } + return t1; + }, + minus$1(other) { + return other instanceof A.SassCalculation ? A.throwExpression(A.SassScriptException$('Undefined operation "' + this.toString$0(0) + " - " + other.toString$0(0) + '".', null)) : new A.SassString(A.serializeValue(this, false, true) + "-" + A.serializeValue(other, false, true), false); + }, + dividedBy$1(other) { + return new A.SassString(A.serializeValue(this, false, true) + "/" + A.serializeValue(other, false, true), false); + }, + unaryPlus$0() { + return new A.SassString("+" + A.serializeValue(this, false, true), false); + }, + unaryMinus$0() { + return new A.SassString("-" + A.serializeValue(this, false, true), false); + }, + unaryNot$0() { + return B.SassBoolean_false; + }, + withoutSlash$0() { + return this; + }, + toString$0(_) { + return A.serializeValue(this, true, true); + } + }; + A.SassArgumentList.prototype = {}; + A.SassBoolean.prototype = { + get$isTruthy() { + return this.value; + }, + accept$1$1(visitor) { + return visitor._serialize$_buffer.write$1(0, String(this.value)); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + unaryNot$0() { + return this.value ? B.SassBoolean_false : B.SassBoolean_true; + } + }; + A.SassCalculation.prototype = { + get$isSpecialNumber() { + return true; + }, + accept$1$1(visitor) { + return visitor.visitCalculation$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + assertCalculation$1($name) { + return this; + }, + plus$1(other) { + if (other instanceof A.SassString) + return this.super$Value$plus(other); + throw A.wrapException(A.SassScriptException$('Undefined operation "' + this.toString$0(0) + " + " + other.toString$0(0) + '".', null)); + }, + minus$1(other) { + return A.throwExpression(A.SassScriptException$('Undefined operation "' + this.toString$0(0) + " - " + other.toString$0(0) + '".', null)); + }, + unaryPlus$0() { + return A.throwExpression(A.SassScriptException$('Undefined operation "+' + this.toString$0(0) + '".', null)); + }, + unaryMinus$0() { + return A.throwExpression(A.SassScriptException$('Undefined operation "-' + this.toString$0(0) + '".', null)); + }, + $eq(_, other) { + if (other == null) + return false; + return other instanceof A.SassCalculation && this.name === other.name && B.C_ListEquality.equals$2(0, this.$arguments, other.$arguments); + }, + get$hashCode(_) { + return B.JSString_methods.get$hashCode(this.name) ^ B.C_ListEquality0.hash$1(this.$arguments); + } + }; + A.SassCalculation__verifyLength_closure.prototype = { + call$1(arg) { + return arg instanceof A.SassString; + }, + $signature: 71 + }; + A.CalculationOperation.prototype = { + $eq(_, other) { + if (other == null) + return false; + return other instanceof A.CalculationOperation && this._operator === other._operator && J.$eq$(this._left, other._left) && J.$eq$(this._right, other._right); + }, + get$hashCode(_) { + return (A.Primitives_objectHashCode(this._operator) ^ J.get$hashCode$(this._left) ^ J.get$hashCode$(this._right)) >>> 0; + }, + toString$0(_) { + var parenthesized = A.serializeValue(new A.SassCalculation("", A._setArrayType([this], type$.JSArray_Object)), true, true); + return B.JSString_methods.substring$2(parenthesized, 1, parenthesized.length - 1); + } + }; + A.CalculationOperator.prototype = { + _enumToString$0() { + return "CalculationOperator." + this._name; + }, + toString$0(_) { + return this.name; + } + }; + A.SassColor.prototype = { + get$red(_) { + var t1; + if (this._red == null) + this._hslToRgb$0(); + t1 = this._red; + t1.toString; + return t1; + }, + get$green(_) { + var t1; + if (this._green == null) + this._hslToRgb$0(); + t1 = this._green; + t1.toString; + return t1; + }, + get$blue(_) { + var t1; + if (this._blue == null) + this._hslToRgb$0(); + t1 = this._blue; + t1.toString; + return t1; + }, + get$hue(_) { + var t1; + if (this._hue == null) + this._rgbToHsl$0(); + t1 = this._hue; + t1.toString; + return t1; + }, + get$saturation(_) { + var t1; + if (this._saturation == null) + this._rgbToHsl$0(); + t1 = this._saturation; + t1.toString; + return t1; + }, + get$lightness(_) { + var t1; + if (this._lightness == null) + this._rgbToHsl$0(); + t1 = this._lightness; + t1.toString; + return t1; + }, + get$whiteness(_) { + return Math.min(Math.min(this.get$red(0), this.get$green(0)), this.get$blue(0)) / 255 * 100; + }, + get$blackness(_) { + return 100 - Math.max(Math.max(this.get$red(0), this.get$green(0)), this.get$blue(0)) / 255 * 100; + }, + accept$1$1(visitor) { + return visitor.visitColor$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + assertColor$1($name) { + return this; + }, + changeRgb$4$alpha$blue$green$red(alpha, blue, green, red) { + return A.SassColor$rgb(red, green, blue, alpha == null ? this._alpha : alpha); + }, + changeRgb$3$blue$green$red(blue, green, red) { + return this.changeRgb$4$alpha$blue$green$red(null, blue, green, red); + }, + changeHsl$4$alpha$hue$lightness$saturation(alpha, hue, lightness, saturation) { + var _this = this, _null = null, + t1 = hue == null ? _this.get$hue(0) : hue, + t2 = saturation == null ? _this.get$saturation(0) : saturation, + t3 = lightness == null ? _this.get$lightness(0) : lightness, + t4 = A.SassColor__handleNullAlpha(alpha == null ? _this._alpha : alpha); + return new A.SassColor(_null, _null, _null, B.JSNumber_methods.$mod(t1, 360), A.fuzzyAssertRange(t2, 0, 100, "saturation"), A.fuzzyAssertRange(t3, 0, 100, "lightness"), A.fuzzyAssertRange(t4, 0, 1, "alpha"), _null); + }, + changeHsl$1$saturation(saturation) { + return this.changeHsl$4$alpha$hue$lightness$saturation(null, null, null, saturation); + }, + changeHsl$1$lightness(lightness) { + return this.changeHsl$4$alpha$hue$lightness$saturation(null, null, lightness, null); + }, + changeHsl$1$hue(hue) { + return this.changeHsl$4$alpha$hue$lightness$saturation(null, hue, null, null); + }, + changeAlpha$1(alpha) { + var _this = this; + return new A.SassColor(_this._red, _this._green, _this._blue, _this._hue, _this._saturation, _this._lightness, A.fuzzyAssertRange(alpha, 0, 1, "alpha"), null); + }, + plus$1(other) { + if (!(other instanceof A.SassNumber) && !(other instanceof A.SassColor)) + return this.super$Value$plus(other); + throw A.wrapException(A.SassScriptException$('Undefined operation "' + this.toString$0(0) + " + " + other.toString$0(0) + '".', null)); + }, + minus$1(other) { + if (!(other instanceof A.SassNumber) && !(other instanceof A.SassColor)) + return this.super$Value$minus(other); + throw A.wrapException(A.SassScriptException$('Undefined operation "' + this.toString$0(0) + " - " + other.toString$0(0) + '".', null)); + }, + dividedBy$1(other) { + if (!(other instanceof A.SassNumber) && !(other instanceof A.SassColor)) + return this.super$Value$dividedBy(other); + throw A.wrapException(A.SassScriptException$('Undefined operation "' + this.toString$0(0) + " / " + other.toString$0(0) + '".', null)); + }, + $eq(_, other) { + var _this = this; + if (other == null) + return false; + return other instanceof A.SassColor && other.get$red(0) === _this.get$red(0) && other.get$green(0) === _this.get$green(0) && other.get$blue(0) === _this.get$blue(0) && other._alpha === _this._alpha; + }, + get$hashCode(_) { + var _this = this; + return B.JSInt_methods.get$hashCode(_this.get$red(0)) ^ B.JSInt_methods.get$hashCode(_this.get$green(0)) ^ B.JSInt_methods.get$hashCode(_this.get$blue(0)) ^ B.JSNumber_methods.get$hashCode(_this._alpha); + }, + _rgbToHsl$0() { + var t2, lightness, _this = this, + scaledRed = _this.get$red(0) / 255, + scaledGreen = _this.get$green(0) / 255, + scaledBlue = _this.get$blue(0) / 255, + max = Math.max(Math.max(scaledRed, scaledGreen), scaledBlue), + min = Math.min(Math.min(scaledRed, scaledGreen), scaledBlue), + delta = max - min, + t1 = max === min; + if (t1) + _this._hue = 0; + else if (max === scaledRed) + _this._hue = B.JSNumber_methods.$mod(60 * (scaledGreen - scaledBlue) / delta, 360); + else if (max === scaledGreen) + _this._hue = B.JSNumber_methods.$mod(120 + 60 * (scaledBlue - scaledRed) / delta, 360); + else if (max === scaledBlue) + _this._hue = B.JSNumber_methods.$mod(240 + 60 * (scaledRed - scaledGreen) / delta, 360); + t2 = max + min; + lightness = 50 * t2; + _this._lightness = lightness; + if (t1) + _this._saturation = 0; + else { + t1 = 100 * delta; + if (lightness < 50) + _this._saturation = t1 / t2; + else + _this._saturation = t1 / (2 - max - min); + } + }, + _hslToRgb$0() { + var _this = this, + scaledHue = _this.get$hue(0) / 360, + scaledSaturation = _this.get$saturation(0) / 100, + scaledLightness = _this.get$lightness(0) / 100, + m2 = scaledLightness <= 0.5 ? scaledLightness * (scaledSaturation + 1) : scaledLightness + scaledSaturation - scaledLightness * scaledSaturation, + m1 = scaledLightness * 2 - m2; + _this._red = A.fuzzyRound(A.SassColor__hueToRgb(m1, m2, scaledHue + 0.3333333333333333) * 255); + _this._green = A.fuzzyRound(A.SassColor__hueToRgb(m1, m2, scaledHue) * 255); + _this._blue = A.fuzzyRound(A.SassColor__hueToRgb(m1, m2, scaledHue - 0.3333333333333333) * 255); + } + }; + A.SassColor_SassColor$hwb_toRgb.prototype = { + call$1(hue) { + return A.fuzzyRound((A.SassColor__hueToRgb(0, 1, hue) * this.factor + this._box_0.scaledWhiteness) * 255); + }, + $signature: 205 + }; + A._ColorFormatEnum.prototype = { + toString$0(_) { + return this._color$_name; + } + }; + A.SpanColorFormat.prototype = {}; + A.SassFunction.prototype = { + accept$1$1(visitor) { + var t1, t2; + if (!visitor._inspect) + A.throwExpression(A.SassScriptException$(this.toString$0(0) + " isn't a valid CSS value.", null)); + t1 = visitor._serialize$_buffer; + t1.write$1(0, "get-function("); + t2 = this.callable; + visitor._visitQuotedString$1(t2.get$name(t2)); + t1.writeCharCode$1(41); + return null; + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + assertFunction$1($name) { + return this; + }, + $eq(_, other) { + if (other == null) + return false; + return other instanceof A.SassFunction && this.callable.$eq(0, other.callable); + }, + get$hashCode(_) { + var t1 = this.callable; + return t1.get$hashCode(t1); + } + }; + A.SassList.prototype = { + get$separator(_) { + return this._separator; + }, + get$hasBrackets() { + return this._hasBrackets; + }, + get$isBlank() { + return !this._hasBrackets && B.JSArray_methods.every$1(this._list$_contents, new A.SassList_isBlank_closure()); + }, + get$asList() { + return this._list$_contents; + }, + get$lengthAsList() { + return this._list$_contents.length; + }, + SassList$3$brackets(contents, _separator, brackets) { + if (this._separator === B.ListSeparator_undecided_null_undecided && this._list$_contents.length > 1) + throw A.wrapException(A.ArgumentError$(string$.A_list, null)); + }, + accept$1$1(visitor) { + return visitor.visitList$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + assertMap$1($name) { + return this._list$_contents.length === 0 ? B.SassMap_Map_empty : this.super$Value$assertMap($name); + }, + tryMap$0() { + return this._list$_contents.length === 0 ? B.SassMap_Map_empty : null; + }, + $eq(_, other) { + var t1, _this = this; + if (other == null) + return false; + if (!(other instanceof A.SassList && other._separator === _this._separator && other._hasBrackets === _this._hasBrackets && B.C_ListEquality.equals$2(0, other._list$_contents, _this._list$_contents))) + t1 = _this._list$_contents.length === 0 && other instanceof A.SassMap && other.get$asList().length === 0; + else + t1 = true; + return t1; + }, + get$hashCode(_) { + return B.C_ListEquality0.hash$1(this._list$_contents); + } + }; + A.SassList_isBlank_closure.prototype = { + call$1(element) { + return element.get$isBlank(); + }, + $signature: 69 + }; + A.ListSeparator.prototype = { + _enumToString$0() { + return "ListSeparator." + this._name; + }, + toString$0(_) { + return this._list$_name; + } + }; + A.SassMap.prototype = { + get$separator(_) { + var t1 = this._map$_contents; + return t1.get$isEmpty(t1) ? B.ListSeparator_undecided_null_undecided : B.ListSeparator_rXA; + }, + get$asList() { + var t3, t4, t5, result, + t1 = type$.JSArray_Value, + t2 = A._setArrayType([], t1); + for (t3 = type$.Value, t4 = A.MapExtensions_get_pairs(this._map$_contents, t3, t3), t4 = t4.get$iterator(t4); t4.moveNext$0();) { + t5 = t4.get$current(t4); + result = A.List_List$from(A._setArrayType([t5._0, t5._1], t1), false, t3); + result.fixed$length = Array; + result.immutable$list = Array; + t2.push(new A.SassList(result, B.ListSeparator_EVt, false)); + } + return t2; + }, + get$lengthAsList() { + var t1 = this._map$_contents; + return t1.get$length(t1); + }, + accept$1$1(visitor) { + return visitor.visitMap$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + assertMap$1($name) { + return this; + }, + tryMap$0() { + return this; + }, + $eq(_, other) { + var t1; + if (other == null) + return false; + if (!(other instanceof A.SassMap && B.C_MapEquality.equals$2(0, other._map$_contents, this._map$_contents))) { + t1 = this._map$_contents; + t1 = t1.get$isEmpty(t1) && other instanceof A.SassList && other._list$_contents.length === 0; + } else + t1 = true; + return t1; + }, + get$hashCode(_) { + var t1 = this._map$_contents; + return t1.get$isEmpty(t1) ? B.C_ListEquality0.hash$1(B.List_empty8) : B.C_MapEquality.hash$1(t1); + } + }; + A.SassMixin.prototype = { + accept$1$1(visitor) { + var t1, t2; + if (!visitor._inspect) + A.throwExpression(A.SassScriptException$(this.toString$0(0) + " isn't a valid CSS value.", null)); + t1 = visitor._serialize$_buffer; + t1.write$1(0, "get-mixin("); + t2 = this.callable; + visitor._visitQuotedString$1(t2.get$name(t2)); + t1.writeCharCode$1(41); + return null; + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + assertMixin$1($name) { + return this; + }, + $eq(_, other) { + if (other == null) + return false; + return other instanceof A.SassMixin && this.callable.$eq(0, other.callable); + }, + get$hashCode(_) { + var t1 = this.callable; + return t1.get$hashCode(t1); + } + }; + A._SassNull.prototype = { + get$isTruthy() { + return false; + }, + get$isBlank() { + return true; + }, + get$realNull() { + return null; + }, + accept$1$1(visitor) { + if (visitor._inspect) + visitor._serialize$_buffer.write$1(0, "null"); + return null; + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + unaryNot$0() { + return B.SassBoolean_true; + } + }; + A.SassNumber.prototype = { + get$unitString() { + var _this = this; + return _this.get$hasUnits() ? _this._unitString$2(_this.get$numeratorUnits(_this), _this.get$denominatorUnits(_this)) : ""; + }, + accept$1$1(visitor) { + return visitor.visitNumber$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + withoutSlash$0() { + var _this = this; + return _this.asSlash == null ? _this : _this.withValue$1(_this._number$_value); + }, + assertNumber$1($name) { + return this; + }, + assertNumber$0() { + return this.assertNumber$1(null); + }, + assertInt$1($name) { + var _0_0 = A.fuzzyAsInt(this._number$_value); + if (_0_0 != null) + return _0_0; + throw A.wrapException(A.SassScriptException$(this.toString$0(0) + " is not an int.", $name)); + }, + assertInt$0() { + return this.assertInt$1(null); + }, + valueInRange$3(min, max, $name) { + var _this = this, + _0_0 = A.fuzzyCheckRange(_this._number$_value, min, max); + if (_0_0 != null) + return _0_0; + throw A.wrapException(A.SassScriptException$("Expected " + _this.toString$0(0) + " to be within " + min + _this.get$unitString() + " and " + max + _this.get$unitString() + ".", $name)); + }, + valueInRangeWithUnit$4(min, max, $name, unit) { + var _0_0 = A.fuzzyCheckRange(this._number$_value, min, max); + if (_0_0 != null) + return _0_0; + throw A.wrapException(A.SassScriptException$("Expected " + this.toString$0(0) + " to be within " + min + unit + " and " + max + unit + ".", $name)); + }, + hasCompatibleUnits$1(other) { + var _this = this; + if (_this.get$numeratorUnits(_this).length !== other.get$numeratorUnits(other).length) + return false; + if (_this.get$denominatorUnits(_this).length !== other.get$denominatorUnits(other).length) + return false; + return _this.isComparableTo$1(other); + }, + assertUnit$2(unit, $name) { + if (this.hasUnit$1(unit)) + return; + throw A.wrapException(A.SassScriptException$("Expected " + this.toString$0(0) + ' to have unit "' + unit + '".', $name)); + }, + assertNoUnits$1($name) { + if (!this.get$hasUnits()) + return; + throw A.wrapException(A.SassScriptException$("Expected " + this.toString$0(0) + " to have no units.", $name)); + }, + assertNoUnits$0() { + return this.assertNoUnits$1(null); + }, + convertValueToMatch$3(other, $name, otherName) { + return this._coerceOrConvertValue$6$coerceUnitless$name$other$otherName(other.get$numeratorUnits(other), other.get$denominatorUnits(other), false, $name, other, otherName); + }, + convertValueToMatch$1(other) { + return this.convertValueToMatch$3(other, null, null); + }, + coerce$3(newNumerators, newDenominators, $name) { + return A.SassNumber_SassNumber$withUnits(this.coerceValue$3(newNumerators, newDenominators, $name), newDenominators, newNumerators); + }, + coerce$2(newNumerators, newDenominators) { + return this.coerce$3(newNumerators, newDenominators, null); + }, + coerceValue$3(newNumerators, newDenominators, $name) { + return this._coerceOrConvertValue$4$coerceUnitless$name(newNumerators, newDenominators, true, $name); + }, + coerceValueToUnit$2(unit, $name) { + var t1 = type$.JSArray_String; + return this.coerceValue$3(A._setArrayType([unit], t1), A._setArrayType([], t1), $name); + }, + coerceValueToUnit$1(unit) { + return this.coerceValueToUnit$2(unit, null); + }, + coerceToMatch$3(other, $name, otherName) { + var t1 = this.coerceValueToMatch$3(other, $name, otherName), + t2 = other.get$numeratorUnits(other); + return A.SassNumber_SassNumber$withUnits(t1, other.get$denominatorUnits(other), t2); + }, + coerceValueToMatch$3(other, $name, otherName) { + return this._coerceOrConvertValue$6$coerceUnitless$name$other$otherName(other.get$numeratorUnits(other), other.get$denominatorUnits(other), true, $name, other, otherName); + }, + coerceValueToMatch$1(other) { + return this.coerceValueToMatch$3(other, null, null); + }, + _coerceOrConvertValue$6$coerceUnitless$name$other$otherName(newNumerators, newDenominators, coerceUnitless, $name, other, otherName) { + var otherHasUnits, t1, compatibilityException, oldNumerators, _i, oldDenominators, _this = this, _box_0 = {}; + if (B.C_ListEquality.equals$2(0, _this.get$numeratorUnits(_this), newNumerators) && B.C_ListEquality.equals$2(0, _this.get$denominatorUnits(_this), newDenominators)) + return _this._number$_value; + otherHasUnits = newNumerators.length !== 0 || newDenominators.length !== 0; + if (coerceUnitless) + t1 = !_this.get$hasUnits() || !otherHasUnits; + else + t1 = false; + if (t1) + return _this._number$_value; + compatibilityException = new A.SassNumber__coerceOrConvertValue_compatibilityException(_this, other, otherName, otherHasUnits, $name, newNumerators, newDenominators); + _box_0.value = _this._number$_value; + t1 = _this.get$numeratorUnits(_this); + oldNumerators = A._setArrayType(t1.slice(0), A._arrayInstanceType(t1)); + for (t1 = newNumerators.length, _i = 0; _i < newNumerators.length; newNumerators.length === t1 || (0, A.throwConcurrentModificationError)(newNumerators), ++_i) + A.removeFirstWhere(oldNumerators, new A.SassNumber__coerceOrConvertValue_closure(_box_0, newNumerators[_i]), new A.SassNumber__coerceOrConvertValue_closure0(compatibilityException)); + t1 = _this.get$denominatorUnits(_this); + oldDenominators = A._setArrayType(t1.slice(0), A._arrayInstanceType(t1)); + for (t1 = newDenominators.length, _i = 0; _i < newDenominators.length; newDenominators.length === t1 || (0, A.throwConcurrentModificationError)(newDenominators), ++_i) + A.removeFirstWhere(oldDenominators, new A.SassNumber__coerceOrConvertValue_closure1(_box_0, newDenominators[_i]), new A.SassNumber__coerceOrConvertValue_closure2(compatibilityException)); + if (oldNumerators.length !== 0 || oldDenominators.length !== 0) + throw A.wrapException(compatibilityException.call$0()); + return _box_0.value; + }, + _coerceOrConvertValue$4$coerceUnitless$name(newNumerators, newDenominators, coerceUnitless, $name) { + return this._coerceOrConvertValue$6$coerceUnitless$name$other$otherName(newNumerators, newDenominators, coerceUnitless, $name, null, null); + }, + isComparableTo$1(other) { + var exception; + if (!this.get$hasUnits() || !other.get$hasUnits()) + return true; + try { + this.greaterThan$1(other); + return true; + } catch (exception) { + if (A.unwrapException(exception) instanceof A.SassScriptException) + return false; + else + throw exception; + } + }, + greaterThan$1(other) { + if (other instanceof A.SassNumber) + return this._coerceUnits$2(other, A.number0__fuzzyGreaterThan$closure()) ? B.SassBoolean_true : B.SassBoolean_false; + throw A.wrapException(A.SassScriptException$('Undefined operation "' + this.toString$0(0) + " > " + other.toString$0(0) + '".', null)); + }, + greaterThanOrEquals$1(other) { + if (other instanceof A.SassNumber) + return this._coerceUnits$2(other, A.number0__fuzzyGreaterThanOrEquals$closure()) ? B.SassBoolean_true : B.SassBoolean_false; + throw A.wrapException(A.SassScriptException$('Undefined operation "' + this.toString$0(0) + " >= " + other.toString$0(0) + '".', null)); + }, + lessThan$1(other) { + if (other instanceof A.SassNumber) + return this._coerceUnits$2(other, A.number0__fuzzyLessThan$closure()) ? B.SassBoolean_true : B.SassBoolean_false; + throw A.wrapException(A.SassScriptException$('Undefined operation "' + this.toString$0(0) + " < " + other.toString$0(0) + '".', null)); + }, + lessThanOrEquals$1(other) { + if (other instanceof A.SassNumber) + return this._coerceUnits$2(other, A.number0__fuzzyLessThanOrEquals$closure()) ? B.SassBoolean_true : B.SassBoolean_false; + throw A.wrapException(A.SassScriptException$('Undefined operation "' + this.toString$0(0) + " <= " + other.toString$0(0) + '".', null)); + }, + modulo$1(other) { + if (other instanceof A.SassNumber) + return this.withValue$1(this._coerceUnits$2(other, A.number0__moduloLikeSass$closure())); + throw A.wrapException(A.SassScriptException$('Undefined operation "' + this.toString$0(0) + " % " + other.toString$0(0) + '".', null)); + }, + plus$1(other) { + var _this = this; + if (other instanceof A.SassNumber) + return _this.withValue$1(_this._coerceUnits$2(other, new A.SassNumber_plus_closure())); + if (!(other instanceof A.SassColor)) + return _this.super$Value$plus(other); + throw A.wrapException(A.SassScriptException$('Undefined operation "' + _this.toString$0(0) + " + " + other.toString$0(0) + '".', null)); + }, + minus$1(other) { + var _this = this; + if (other instanceof A.SassNumber) + return _this.withValue$1(_this._coerceUnits$2(other, new A.SassNumber_minus_closure())); + if (!(other instanceof A.SassColor)) + return _this.super$Value$minus(other); + throw A.wrapException(A.SassScriptException$('Undefined operation "' + _this.toString$0(0) + " - " + other.toString$0(0) + '".', null)); + }, + times$1(other) { + var _this = this; + if (other instanceof A.SassNumber) { + if (!other.get$hasUnits()) + return _this.withValue$1(_this._number$_value * other._number$_value); + return _this.multiplyUnits$3(_this._number$_value * other._number$_value, other.get$numeratorUnits(other), other.get$denominatorUnits(other)); + } + throw A.wrapException(A.SassScriptException$('Undefined operation "' + _this.toString$0(0) + " * " + other.toString$0(0) + '".', null)); + }, + dividedBy$1(other) { + var _this = this; + if (other instanceof A.SassNumber) { + if (!other.get$hasUnits()) + return _this.withValue$1(_this._number$_value / other._number$_value); + return _this.multiplyUnits$3(_this._number$_value / other._number$_value, other.get$denominatorUnits(other), other.get$numeratorUnits(other)); + } + return _this.super$Value$dividedBy(other); + }, + unaryPlus$0() { + return this; + }, + _coerceUnits$1$2(other, operation) { + var t1, exception; + try { + t1 = operation.call$2(this._number$_value, other.coerceValueToMatch$1(this)); + return t1; + } catch (exception) { + if (A.unwrapException(exception) instanceof A.SassScriptException) { + this.coerceValueToMatch$1(other); + throw exception; + } else + throw exception; + } + }, + _coerceUnits$2(other, operation) { + return this._coerceUnits$1$2(other, operation, type$.dynamic); + }, + multiplyUnits$3(value, otherNumerators, otherDenominators) { + var t1, _0_1, _0_2, _0_3, _0_6, t2, _0_7, _0_9, _0_9_isSet, _0_7_isSet, _0_3_isSet, denominators_case_0, _0_6_isSet, _0_11, _0_10, _0_2_isSet, _0_13, numerators_case_0, _0_13_isSet, _0_11_isSet, t3, t4, denominators_case_1, numerators_case_1, newNumerators, mutableOtherDenominators, _i, numerator, mutableDenominatorUnits, _this = this, _null = null, _box_0 = {}; + _box_0.value = value; + t1 = [_this.get$numeratorUnits(_this), _this.get$denominatorUnits(_this), otherNumerators, otherDenominators]; + _0_1 = t1[0]; + _0_2 = t1[1]; + _0_3 = t1[2]; + _0_6 = _0_3.length <= 0; + t2 = _0_6; + if (t2) { + _0_7 = t1[3]; + _0_9 = _0_7.length <= 0; + t2 = _0_9; + _0_9_isSet = true; + _0_7_isSet = true; + } else { + _0_7 = _null; + _0_9 = _0_7; + _0_9_isSet = false; + _0_7_isSet = false; + t2 = false; + } + _0_3_isSet = true; + denominators_case_0 = _0_2; + _0_6_isSet = true; + if (!t2) { + _0_11 = _0_1.length <= 0; + t2 = _0_11; + _0_10 = _0_1; + if (t2) { + t2 = _0_2; + _0_2_isSet = true; + _0_13 = t2.length <= 0; + t2 = _0_13; + if (t2) { + if (_0_3_isSet) + numerators_case_0 = _0_3; + else { + _0_3 = t1[2]; + numerators_case_0 = _0_3; + _0_3_isSet = true; + } + if (_0_7_isSet) + denominators_case_0 = _0_7; + else { + _0_7 = t1[3]; + denominators_case_0 = _0_7; + _0_7_isSet = true; + } + t2 = true; + } else { + numerators_case_0 = _0_1; + t2 = false; + } + _0_13_isSet = true; + } else { + numerators_case_0 = _0_1; + _0_13 = _null; + _0_2_isSet = true; + _0_13_isSet = false; + t2 = false; + } + _0_1 = _0_10; + _0_11_isSet = true; + } else { + numerators_case_0 = _0_1; + _0_13 = _null; + _0_11 = _0_13; + _0_2_isSet = true; + _0_11_isSet = false; + _0_13_isSet = false; + t2 = true; + } + if (t2) { + t3 = denominators_case_0; + t2 = numerators_case_0; + t4 = true; + } else { + t3 = _null; + t2 = t3; + t4 = false; + } + if (!t4) { + if (_0_11_isSet) + t4 = _0_11; + else { + _0_11 = _0_1.length <= 0; + t4 = _0_11; + } + if (t4) { + if (_0_2_isSet) + denominators_case_1 = _0_2; + else { + _0_2 = t1[1]; + denominators_case_1 = _0_2; + _0_2_isSet = true; + } + if (_0_3_isSet) + numerators_case_1 = _0_3; + else { + _0_3 = t1[2]; + numerators_case_1 = _0_3; + _0_3_isSet = true; + } + if (_0_9_isSet) + t4 = _0_9; + else { + if (_0_7_isSet) + t4 = _0_7; + else { + _0_7 = t1[3]; + t4 = _0_7; + _0_7_isSet = true; + } + _0_9 = t4.length <= 0; + t4 = _0_9; + } + } else { + numerators_case_1 = _null; + denominators_case_1 = numerators_case_1; + t4 = false; + } + if (!t4) { + if (_0_13_isSet) + t4 = _0_13; + else { + _0_13 = (_0_2_isSet ? _0_2 : t1[1]).length <= 0; + t4 = _0_13; + } + if (t4) { + if (_0_6_isSet) + t4 = _0_6; + else { + _0_6 = (_0_3_isSet ? _0_3 : t1[2]).length <= 0; + t4 = _0_6; + } + if (t4) { + denominators_case_1 = _0_7_isSet ? _0_7 : t1[3]; + t1 = true; + } else + t1 = false; + } else + t1 = false; + numerators_case_1 = _0_1; + } else + t1 = true; + if (t1) + if (!_this._areAnyConvertible$2(numerators_case_1, denominators_case_1)) { + t2 = denominators_case_1; + t1 = numerators_case_1; + t3 = true; + } else { + t1 = t2; + t2 = t3; + t3 = false; + } + else { + t1 = t2; + t2 = t3; + t3 = false; + } + } else { + t1 = t2; + t2 = t3; + t3 = true; + } + if (t3) + return A.SassNumber_SassNumber$withUnits(value, t2, t1); + newNumerators = A._setArrayType([], type$.JSArray_String); + mutableOtherDenominators = A._setArrayType(otherDenominators.slice(0), A._arrayInstanceType(otherDenominators)); + for (t1 = _this.get$numeratorUnits(_this), t2 = t1.length, _i = 0; _i < t2; ++_i) { + numerator = t1[_i]; + A.removeFirstWhere(mutableOtherDenominators, new A.SassNumber_multiplyUnits_closure(_box_0, numerator), new A.SassNumber_multiplyUnits_closure0(newNumerators, numerator)); + } + t1 = _this.get$denominatorUnits(_this); + mutableDenominatorUnits = A._setArrayType(t1.slice(0), A._arrayInstanceType(t1)); + for (t1 = otherNumerators.length, _i = 0; _i < t1; ++_i) { + numerator = otherNumerators[_i]; + A.removeFirstWhere(mutableDenominatorUnits, new A.SassNumber_multiplyUnits_closure1(_box_0, numerator), new A.SassNumber_multiplyUnits_closure2(newNumerators, numerator)); + } + t1 = _box_0.value; + B.JSArray_methods.addAll$1(mutableDenominatorUnits, mutableOtherDenominators); + return A.SassNumber_SassNumber$withUnits(t1, mutableDenominatorUnits, newNumerators); + }, + _areAnyConvertible$2(units1, units2) { + return B.JSArray_methods.any$1(units1, new A.SassNumber__areAnyConvertible_closure(units2)); + }, + _unitString$2(numerators, denominators) { + var _0_4, _0_6, t1, _0_7, _0_5, _0_7_isSet, _0_6_isSet, _0_5_isSet, _null = null; + $label0$0: { + _0_4 = numerators.length <= 0; + if (_0_4) { + _0_6 = denominators.length; + t1 = _0_6; + _0_7 = t1 <= 0; + t1 = _0_7; + _0_5 = denominators; + _0_7_isSet = true; + _0_6_isSet = true; + _0_5_isSet = true; + } else { + _0_5 = _null; + _0_6 = _0_5; + _0_7 = _0_6; + _0_7_isSet = false; + _0_6_isSet = false; + _0_5_isSet = false; + t1 = false; + } + if (t1) { + t1 = "no units"; + break $label0$0; + } + if (_0_4) { + if (_0_6_isSet) + t1 = _0_6; + else { + if (_0_5_isSet) + t1 = _0_5; + else { + t1 = denominators; + _0_5 = t1; + _0_5_isSet = true; + } + _0_6 = t1.length; + t1 = _0_6; + _0_6_isSet = true; + } + t1 = t1 === 1; + } else + t1 = false; + if (t1) { + t1 = (_0_5_isSet ? _0_5 : denominators)[0] + "^-1"; + break $label0$0; + } + if (_0_4) { + t1 = "(" + B.JSArray_methods.join$1(denominators, "*") + ")^-1"; + break $label0$0; + } + if (_0_7_isSet) + t1 = _0_7; + else { + if (_0_6_isSet) + t1 = _0_6; + else { + _0_6 = (_0_5_isSet ? _0_5 : denominators).length; + t1 = _0_6; + } + _0_7 = t1 <= 0; + t1 = _0_7; + } + if (t1) { + t1 = B.JSArray_methods.join$1(numerators, "*"); + break $label0$0; + } + t1 = B.JSArray_methods.join$1(numerators, "*") + "/" + B.JSArray_methods.join$1(denominators, "*"); + break $label0$0; + } + return t1; + }, + $eq(_, other) { + var _this = this; + if (other == null) + return false; + if (!(other instanceof A.SassNumber)) + return false; + if (_this.get$numeratorUnits(_this).length !== other.get$numeratorUnits(other).length || _this.get$denominatorUnits(_this).length !== other.get$denominatorUnits(other).length) + return false; + if (!_this.get$hasUnits()) + return A.fuzzyEquals(_this._number$_value, other._number$_value); + if (!B.C_ListEquality.equals$2(0, _this._canonicalizeUnitList$1(_this.get$numeratorUnits(_this)), _this._canonicalizeUnitList$1(other.get$numeratorUnits(other))) || !B.C_ListEquality.equals$2(0, _this._canonicalizeUnitList$1(_this.get$denominatorUnits(_this)), _this._canonicalizeUnitList$1(other.get$denominatorUnits(other)))) + return false; + return A.fuzzyEquals(_this._number$_value * _this._canonicalMultiplier$1(_this.get$numeratorUnits(_this)) / _this._canonicalMultiplier$1(_this.get$denominatorUnits(_this)), other._number$_value * _this._canonicalMultiplier$1(other.get$numeratorUnits(other)) / _this._canonicalMultiplier$1(other.get$denominatorUnits(other))); + }, + get$hashCode(_) { + var _this = this, + t1 = _this.hashCache; + return t1 == null ? _this.hashCache = A.fuzzyHashCode(_this._number$_value * _this._canonicalMultiplier$1(_this.get$numeratorUnits(_this)) / _this._canonicalMultiplier$1(_this.get$denominatorUnits(_this))) : t1; + }, + _canonicalizeUnitList$1(units) { + var type, + t1 = units.length; + if (t1 === 0) + return units; + if (t1 === 1) { + type = $.$get$_typesByUnit().$index(0, B.JSArray_methods.get$first(units)); + if (type == null) + t1 = units; + else { + t1 = B.Map_ws7dy.$index(0, type); + t1.toString; + t1 = A._setArrayType([B.JSArray_methods.get$first(t1)], type$.JSArray_String); + } + return t1; + } + t1 = A._arrayInstanceType(units)._eval$1("MappedListIterable<1,String>"); + t1 = A.List_List$of(new A.MappedListIterable(units, new A.SassNumber__canonicalizeUnitList_closure(), t1), true, t1._eval$1("ListIterable.E")); + B.JSArray_methods.sort$0(t1); + return t1; + }, + _canonicalMultiplier$1(units) { + return B.JSArray_methods.fold$2(units, 1, new A.SassNumber__canonicalMultiplier_closure(this)); + }, + canonicalMultiplierForUnit$1(unit) { + var t1, + innerMap = B.Map_nfuzN.$index(0, unit); + if (innerMap == null) + t1 = 1; + else { + t1 = innerMap.get$values(innerMap); + t1 = 1 / t1.get$first(t1); + } + return t1; + }, + unitSuggestion$2($name, unit) { + var t2, t3, result, _this = this, + t1 = _this.get$denominatorUnits(_this); + t1 = new A.MappedListIterable(t1, new A.SassNumber_unitSuggestion_closure(), A._arrayInstanceType(t1)._eval$1("MappedListIterable<1,String>")).join$0(0); + t2 = _this.get$numeratorUnits(_this); + t2 = new A.MappedListIterable(t2, new A.SassNumber_unitSuggestion_closure0(), A._arrayInstanceType(t2)._eval$1("MappedListIterable<1,String>")).join$0(0); + t3 = unit == null ? "" : " * 1" + unit; + result = "$" + $name + t1 + t2 + t3; + return _this.get$numeratorUnits(_this).length === 0 ? result : "calc(" + result + ")"; + }, + unitSuggestion$1($name) { + return this.unitSuggestion$2($name, null); + } + }; + A.SassNumber__coerceOrConvertValue_compatibilityException.prototype = { + call$0() { + var t2, t3, message, t4, type, unit, _this = this, + t1 = _this.other; + if (t1 != null) { + t2 = _this.$this; + t3 = t2.toString$0(0) + " and"; + message = new A.StringBuffer(t3); + t4 = _this.otherName; + if (t4 != null) + t3 = message._contents = t3 + (" $" + t4 + ":"); + t1 = t3 + (" " + t1.toString$0(0) + " have incompatible units"); + message._contents = t1; + if (!t2.get$hasUnits() || !_this.otherHasUnits) + message._contents = t1 + " (one has units and the other doesn't)"; + t1 = message.toString$0(0) + "."; + t2 = _this.name; + return new A.SassScriptException(t2 == null ? t1 : "$" + t2 + ": " + t1); + } else if (!_this.otherHasUnits) { + t1 = "Expected " + _this.$this.toString$0(0) + " to have no units."; + t2 = _this.name; + return new A.SassScriptException(t2 == null ? t1 : "$" + t2 + ": " + t1); + } else { + t1 = _this.newNumerators; + if (t1.length === 1 && _this.newDenominators.length === 0) { + type = $.$get$_typesByUnit().$index(0, B.JSArray_methods.get$first(t1)); + if (type != null) { + t1 = _this.$this.toString$0(0); + t2 = B.JSArray_methods.contains$1(A._setArrayType([97, 101, 105, 111, 117], type$.JSArray_int), type.charCodeAt(0)) ? "an " + type : "a " + type; + t3 = B.Map_ws7dy.$index(0, type); + t3.toString; + t3 = "Expected " + t1 + " to have " + t2 + " unit (" + B.JSArray_methods.join$1(t3, ", ") + ")."; + t2 = _this.name; + return new A.SassScriptException(t2 == null ? t3 : "$" + t2 + ": " + t3); + } + } + t2 = _this.newDenominators; + unit = A.pluralize("unit", t1.length + t2.length, null); + t3 = _this.$this; + t2 = "Expected " + t3.toString$0(0) + " to have " + unit + " " + t3._unitString$2(t1, t2) + "."; + t1 = _this.name; + return new A.SassScriptException(t1 == null ? t2 : "$" + t1 + ": " + t2); + } + }, + $signature: 318 + }; + A.SassNumber__coerceOrConvertValue_closure.prototype = { + call$1(oldNumerator) { + var factor = A.conversionFactor(this.newNumerator, oldNumerator); + if (factor == null) + return false; + this._box_0.value *= factor; + return true; + }, + $signature: 4 + }; + A.SassNumber__coerceOrConvertValue_closure0.prototype = { + call$0() { + return A.throwExpression(this.compatibilityException.call$0()); + }, + $signature: 0 + }; + A.SassNumber__coerceOrConvertValue_closure1.prototype = { + call$1(oldDenominator) { + var factor = A.conversionFactor(this.newDenominator, oldDenominator); + if (factor == null) + return false; + this._box_0.value /= factor; + return true; + }, + $signature: 4 + }; + A.SassNumber__coerceOrConvertValue_closure2.prototype = { + call$0() { + return A.throwExpression(this.compatibilityException.call$0()); + }, + $signature: 0 + }; + A.SassNumber_plus_closure.prototype = { + call$2(num1, num2) { + return num1 + num2; + }, + $signature: 64 + }; + A.SassNumber_minus_closure.prototype = { + call$2(num1, num2) { + return num1 - num2; + }, + $signature: 64 + }; + A.SassNumber_multiplyUnits_closure.prototype = { + call$1(denominator) { + var factor = A.conversionFactor(this.numerator, denominator); + if (factor == null) + return false; + this._box_0.value /= factor; + return true; + }, + $signature: 4 + }; + A.SassNumber_multiplyUnits_closure0.prototype = { + call$0() { + return this.newNumerators.push(this.numerator); + }, + $signature: 0 + }; + A.SassNumber_multiplyUnits_closure1.prototype = { + call$1(denominator) { + var factor = A.conversionFactor(this.numerator, denominator); + if (factor == null) + return false; + this._box_0.value /= factor; + return true; + }, + $signature: 4 + }; + A.SassNumber_multiplyUnits_closure2.prototype = { + call$0() { + return this.newNumerators.push(this.numerator); + }, + $signature: 0 + }; + A.SassNumber__areAnyConvertible_closure.prototype = { + call$1(unit1) { + var t1, + _0_0 = B.Map_nfuzN.$index(0, unit1); + $label0$0: { + if (_0_0 != null) { + t1 = B.JSArray_methods.any$1(this.units2, _0_0.get$containsKey()); + break $label0$0; + } + t1 = B.JSArray_methods.contains$1(this.units2, unit1); + break $label0$0; + } + return t1; + }, + $signature: 4 + }; + A.SassNumber__canonicalizeUnitList_closure.prototype = { + call$1(unit) { + var t1, + type = $.$get$_typesByUnit().$index(0, unit); + if (type == null) + t1 = unit; + else { + t1 = B.Map_ws7dy.$index(0, type); + t1.toString; + t1 = B.JSArray_methods.get$first(t1); + } + return t1; + }, + $signature: 5 + }; + A.SassNumber__canonicalMultiplier_closure.prototype = { + call$2(multiplier, unit) { + return multiplier * this.$this.canonicalMultiplierForUnit$1(unit); + }, + $signature: 221 + }; + A.SassNumber_unitSuggestion_closure.prototype = { + call$1(unit) { + return " * 1" + unit; + }, + $signature: 5 + }; + A.SassNumber_unitSuggestion_closure0.prototype = { + call$1(unit) { + return " / 1" + unit; + }, + $signature: 5 + }; + A.ComplexSassNumber.prototype = { + get$numeratorUnits(_) { + return this._numeratorUnits; + }, + get$denominatorUnits(_) { + return this._denominatorUnits; + }, + get$hasUnits() { + return true; + }, + get$hasComplexUnits() { + return true; + }, + hasUnit$1(unit) { + return false; + }, + compatibleWithUnit$1(unit) { + return false; + }, + hasPossiblyCompatibleUnits$1(other) { + throw A.wrapException(A.UnimplementedError$(string$.Comple)); + }, + withValue$1(value) { + return new A.ComplexSassNumber(this._numeratorUnits, this._denominatorUnits, value, null); + }, + withSlash$2(numerator, denominator) { + return new A.ComplexSassNumber(this._numeratorUnits, this._denominatorUnits, this._number$_value, new A._Record_2(numerator, denominator)); + } + }; + A.SingleUnitSassNumber.prototype = { + get$numeratorUnits(_) { + return A.List_List$unmodifiable([this._unit], type$.String); + }, + get$denominatorUnits(_) { + return B.List_empty; + }, + get$hasUnits() { + return true; + }, + get$hasComplexUnits() { + return false; + }, + withValue$1(value) { + return new A.SingleUnitSassNumber(this._unit, value, null); + }, + withSlash$2(numerator, denominator) { + return new A.SingleUnitSassNumber(this._unit, this._number$_value, new A._Record_2(numerator, denominator)); + }, + hasUnit$1(unit) { + return unit === this._unit; + }, + hasCompatibleUnits$1(other) { + return other instanceof A.SingleUnitSassNumber && A.conversionFactor(this._unit, other._unit) != null; + }, + hasPossiblyCompatibleUnits$1(other) { + var t1, knownCompatibilities, otherUnit; + if (!(other instanceof A.SingleUnitSassNumber)) + return false; + t1 = $.$get$_knownCompatibilitiesByUnit(); + knownCompatibilities = t1.$index(0, this._unit.toLowerCase()); + if (knownCompatibilities == null) + return true; + otherUnit = other._unit.toLowerCase(); + return knownCompatibilities.contains$1(0, otherUnit) || !t1.containsKey$1(otherUnit); + }, + compatibleWithUnit$1(unit) { + return A.conversionFactor(this._unit, unit) != null; + }, + coerceToMatch$1(other) { + var t1 = other instanceof A.SingleUnitSassNumber ? this._coerceToUnit$1(other._unit) : null; + return t1 == null ? this.super$SassNumber$coerceToMatch(other, null, null) : t1; + }, + coerceValueToMatch$3(other, $name, otherName) { + var t1 = other instanceof A.SingleUnitSassNumber ? this._coerceValueToUnit$1(other._unit) : null; + return t1 == null ? this.super$SassNumber$coerceValueToMatch(other, $name, otherName) : t1; + }, + coerceValueToMatch$1(other) { + return this.coerceValueToMatch$3(other, null, null); + }, + convertValueToMatch$3(other, $name, otherName) { + var t1 = other instanceof A.SingleUnitSassNumber ? this._coerceValueToUnit$1(other._unit) : null; + return t1 == null ? this.super$SassNumber$convertValueToMatch(other, $name, otherName) : t1; + }, + convertValueToMatch$1(other) { + return this.convertValueToMatch$3(other, null, null); + }, + coerce$2(newNumerators, newDenominators) { + var t1 = newNumerators.length === 1 && newDenominators.length === 0 ? this._coerceToUnit$1(newNumerators[0]) : null; + return t1 == null ? this.super$SassNumber$coerce(newNumerators, newDenominators, null) : t1; + }, + coerceValue$3(newNumerators, newDenominators, $name) { + var t1 = newNumerators.length === 1 && newDenominators.length === 0 ? this._coerceValueToUnit$1(newNumerators[0]) : null; + return t1 == null ? this.super$SassNumber$coerceValue(newNumerators, newDenominators, $name) : t1; + }, + coerceValueToUnit$2(unit, $name) { + var t1 = this._coerceValueToUnit$1(unit); + return t1 == null ? this.super$SassNumber$coerceValueToUnit(unit, $name) : t1; + }, + coerceValueToUnit$1(unit) { + return this.coerceValueToUnit$2(unit, null); + }, + _coerceToUnit$1(unit) { + var t1 = this._unit; + if (t1 === unit) + return this; + return A.NullableExtension_andThen(A.conversionFactor(unit, t1), new A.SingleUnitSassNumber__coerceToUnit_closure(this, unit)); + }, + _coerceValueToUnit$1(unit) { + return A.NullableExtension_andThen(A.conversionFactor(unit, this._unit), new A.SingleUnitSassNumber__coerceValueToUnit_closure(this)); + }, + multiplyUnits$3(value, otherNumerators, otherDenominators) { + var mutableOtherDenominators, t1 = {}; + t1.value = value; + t1.newNumerators = otherNumerators; + mutableOtherDenominators = A._setArrayType(otherDenominators.slice(0), A._arrayInstanceType(otherDenominators)); + A.removeFirstWhere(mutableOtherDenominators, new A.SingleUnitSassNumber_multiplyUnits_closure(t1, this), new A.SingleUnitSassNumber_multiplyUnits_closure0(t1, this)); + return A.SassNumber_SassNumber$withUnits(t1.value, mutableOtherDenominators, t1.newNumerators); + }, + unaryMinus$0() { + return new A.SingleUnitSassNumber(this._unit, -this._number$_value, null); + }, + $eq(_, other) { + var factor; + if (other == null) + return false; + if (other instanceof A.SingleUnitSassNumber) { + factor = A.conversionFactor(other._unit, this._unit); + return factor != null && A.fuzzyEquals(this._number$_value * factor, other._number$_value); + } else + return false; + }, + get$hashCode(_) { + var _this = this, + t1 = _this.hashCache; + return t1 == null ? _this.hashCache = A.fuzzyHashCode(_this._number$_value * _this.canonicalMultiplierForUnit$1(_this._unit)) : t1; + } + }; + A.SingleUnitSassNumber__coerceToUnit_closure.prototype = { + call$1(factor) { + return new A.SingleUnitSassNumber(this.unit, this.$this._number$_value * factor, null); + }, + $signature: 317 + }; + A.SingleUnitSassNumber__coerceValueToUnit_closure.prototype = { + call$1(factor) { + return this.$this._number$_value * factor; + }, + $signature: 37 + }; + A.SingleUnitSassNumber_multiplyUnits_closure.prototype = { + call$1(denominator) { + var factor = A.conversionFactor(denominator, this.$this._unit); + if (factor == null) + return false; + this._box_0.value *= factor; + return true; + }, + $signature: 4 + }; + A.SingleUnitSassNumber_multiplyUnits_closure0.prototype = { + call$0() { + var t1 = A._setArrayType([this.$this._unit], type$.JSArray_String), + t2 = this._box_0; + B.JSArray_methods.addAll$1(t1, t2.newNumerators); + t2.newNumerators = t1; + }, + $signature: 0 + }; + A.UnitlessSassNumber.prototype = { + get$numeratorUnits(_) { + return B.List_empty; + }, + get$denominatorUnits(_) { + return B.List_empty; + }, + get$hasUnits() { + return false; + }, + get$hasComplexUnits() { + return false; + }, + withValue$1(value) { + return new A.UnitlessSassNumber(value, null); + }, + withSlash$2(numerator, denominator) { + return new A.UnitlessSassNumber(this._number$_value, new A._Record_2(numerator, denominator)); + }, + hasUnit$1(unit) { + return false; + }, + hasCompatibleUnits$1(other) { + return other instanceof A.UnitlessSassNumber; + }, + hasPossiblyCompatibleUnits$1(other) { + return other instanceof A.UnitlessSassNumber; + }, + compatibleWithUnit$1(unit) { + return true; + }, + coerceToMatch$1(other) { + return other.withValue$1(this._number$_value); + }, + coerceValueToMatch$3(other, $name, otherName) { + return this._number$_value; + }, + coerceValueToMatch$1(other) { + return this.coerceValueToMatch$3(other, null, null); + }, + convertValueToMatch$3(other, $name, otherName) { + return other.get$hasUnits() ? this.super$SassNumber$convertValueToMatch(other, $name, otherName) : this._number$_value; + }, + convertValueToMatch$1(other) { + return this.convertValueToMatch$3(other, null, null); + }, + coerce$2(newNumerators, newDenominators) { + return A.SassNumber_SassNumber$withUnits(this._number$_value, newDenominators, newNumerators); + }, + coerceValue$3(newNumerators, newDenominators, $name) { + return this._number$_value; + }, + coerceValueToUnit$2(unit, $name) { + return this._number$_value; + }, + coerceValueToUnit$1(unit) { + return this.coerceValueToUnit$2(unit, null); + }, + greaterThan$1(other) { + var t1, t2; + if (other instanceof A.SassNumber) { + t1 = this._number$_value; + t2 = other._number$_value; + return t1 > t2 && !A.fuzzyEquals(t1, t2) ? B.SassBoolean_true : B.SassBoolean_false; + } + return this.super$SassNumber$greaterThan(other); + }, + greaterThanOrEquals$1(other) { + var t1, t2; + if (other instanceof A.SassNumber) { + t1 = this._number$_value; + t2 = other._number$_value; + return t1 > t2 || A.fuzzyEquals(t1, t2) ? B.SassBoolean_true : B.SassBoolean_false; + } + return this.super$SassNumber$greaterThanOrEquals(other); + }, + lessThan$1(other) { + var t1, t2; + if (other instanceof A.SassNumber) { + t1 = this._number$_value; + t2 = other._number$_value; + return t1 < t2 && !A.fuzzyEquals(t1, t2) ? B.SassBoolean_true : B.SassBoolean_false; + } + return this.super$SassNumber$lessThan(other); + }, + lessThanOrEquals$1(other) { + var t1, t2; + if (other instanceof A.SassNumber) { + t1 = this._number$_value; + t2 = other._number$_value; + return t1 < t2 || A.fuzzyEquals(t1, t2) ? B.SassBoolean_true : B.SassBoolean_false; + } + return this.super$SassNumber$lessThanOrEquals(other); + }, + modulo$1(other) { + if (other instanceof A.SassNumber) + return other.withValue$1(A.moduloLikeSass(this._number$_value, other._number$_value)); + return this.super$SassNumber$modulo(other); + }, + plus$1(other) { + if (other instanceof A.SassNumber) + return other.withValue$1(this._number$_value + other._number$_value); + return this.super$SassNumber$plus(other); + }, + minus$1(other) { + if (other instanceof A.SassNumber) + return other.withValue$1(this._number$_value - other._number$_value); + return this.super$SassNumber$minus(other); + }, + times$1(other) { + if (other instanceof A.SassNumber) + return other.withValue$1(this._number$_value * other._number$_value); + return this.super$SassNumber$times(other); + }, + dividedBy$1(other) { + var t1, t2; + if (other instanceof A.SassNumber) { + t1 = this._number$_value / other._number$_value; + if (other.get$hasUnits()) { + t2 = other.get$denominatorUnits(other); + t2 = A.SassNumber_SassNumber$withUnits(t1, other.get$numeratorUnits(other), t2); + t1 = t2; + } else + t1 = new A.UnitlessSassNumber(t1, null); + return t1; + } + return this.super$SassNumber$dividedBy(other); + }, + unaryMinus$0() { + return new A.UnitlessSassNumber(-this._number$_value, null); + }, + $eq(_, other) { + if (other == null) + return false; + return other instanceof A.UnitlessSassNumber && A.fuzzyEquals(this._number$_value, other._number$_value); + }, + get$hashCode(_) { + var t1 = this.hashCache; + return t1 == null ? this.hashCache = A.fuzzyHashCode(this._number$_value) : t1; + } + }; + A.SassString.prototype = { + get$_sassLength() { + var result, _this = this, + value = _this.__SassString__sassLength_FI; + if (value === $) { + result = new A.Runes(_this._string$_text).get$length(0); + _this.__SassString__sassLength_FI !== $ && A.throwUnnamedLateFieldADI(); + _this.__SassString__sassLength_FI = result; + value = result; + } + return value; + }, + get$isSpecialNumber() { + var t1, _2_0, _0_0, _1_0; + if (this._hasQuotes) + return false; + t1 = this._string$_text; + if (t1.length < 6) + return false; + _2_0 = t1.charCodeAt(0); + $label1$1: { + if (99 === _2_0 || 67 === _2_0) { + _0_0 = t1.charCodeAt(1); + $label0$0: { + if (108 === _0_0 || 76 === _0_0) { + t1 = (t1.charCodeAt(2) | 32) === 97 && (t1.charCodeAt(3) | 32) === 109 && (t1.charCodeAt(4) | 32) === 112 && t1.charCodeAt(5) === 40; + break $label0$0; + } + if (97 === _0_0 || 65 === _0_0) { + t1 = (t1.charCodeAt(2) | 32) === 108 && (t1.charCodeAt(3) | 32) === 99 && t1.charCodeAt(4) === 40; + break $label0$0; + } + t1 = false; + break $label0$0; + } + break $label1$1; + } + if (118 === _2_0 || 86 === _2_0) { + t1 = (t1.charCodeAt(1) | 32) === 97 && (t1.charCodeAt(2) | 32) === 114 && t1.charCodeAt(3) === 40; + break $label1$1; + } + if (101 === _2_0 || 69 === _2_0) { + t1 = (t1.charCodeAt(1) | 32) === 110 && (t1.charCodeAt(2) | 32) === 118 && t1.charCodeAt(3) === 40; + break $label1$1; + } + if (109 === _2_0 || 77 === _2_0) { + _1_0 = t1.charCodeAt(1); + $label2$2: { + if (97 === _1_0 || 65 === _1_0) { + t1 = (t1.charCodeAt(2) | 32) === 120 && t1.charCodeAt(3) === 40; + break $label2$2; + } + if (105 === _1_0 || 73 === _1_0) { + t1 = (t1.charCodeAt(2) | 32) === 110 && t1.charCodeAt(3) === 40; + break $label2$2; + } + t1 = false; + break $label2$2; + } + break $label1$1; + } + t1 = false; + break $label1$1; + } + return t1; + }, + get$isVar() { + if (this._hasQuotes) + return false; + var t1 = this._string$_text; + if (t1.length < 8) + return false; + return (t1.charCodeAt(0) | 32) === 118 && (t1.charCodeAt(1) | 32) === 97 && (t1.charCodeAt(2) | 32) === 114 && t1.charCodeAt(3) === 40; + }, + get$isBlank() { + return !this._hasQuotes && this._string$_text.length === 0; + }, + accept$1$1(visitor) { + var t1 = visitor._quote && this._hasQuotes, + t2 = this._string$_text; + if (t1) + visitor._visitQuotedString$1(t2); + else + visitor._visitUnquotedString$1(t2); + return null; + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + assertString$1($name) { + return this; + }, + plus$1(other) { + var t1 = this._string$_text, + t2 = this._hasQuotes; + return other instanceof A.SassString ? new A.SassString(t1 + other._string$_text, t2) : new A.SassString(t1 + A.serializeValue(other, false, true), t2); + }, + $eq(_, other) { + if (other == null) + return false; + return other instanceof A.SassString && this._string$_text === other._string$_text; + }, + get$hashCode(_) { + var t1 = this._hashCache; + return t1 == null ? this._hashCache = B.JSString_methods.get$hashCode(this._string$_text) : t1; + } + }; + A.AnySelectorVisitor.prototype = { + visitComplexSelector$1(complex) { + return B.JSArray_methods.any$1(complex.components, new A.AnySelectorVisitor_visitComplexSelector_closure(this)); + }, + visitCompoundSelector$1(compound) { + return B.JSArray_methods.any$1(compound.components, new A.AnySelectorVisitor_visitCompoundSelector_closure(this)); + }, + visitPseudoSelector$1(pseudo) { + var selector = pseudo.selector; + return selector == null ? false : this.visitSelectorList$1(selector); + }, + visitSelectorList$1(list) { + return B.JSArray_methods.any$1(list.components, this.get$visitComplexSelector()); + }, + visitAttributeSelector$1(attribute) { + return false; + }, + visitClassSelector$1(klass) { + return false; + }, + visitIDSelector$1(id) { + return false; + }, + visitParentSelector$1($parent) { + return false; + }, + visitPlaceholderSelector$1(placeholder) { + return false; + }, + visitTypeSelector$1(type) { + return false; + }, + visitUniversalSelector$1(universal) { + return false; + } + }; + A.AnySelectorVisitor_visitComplexSelector_closure.prototype = { + call$1(component) { + return this.$this.visitCompoundSelector$1(component.selector); + }, + $signature: 48 + }; + A.AnySelectorVisitor_visitCompoundSelector_closure.prototype = { + call$1(simple) { + return simple.accept$1(this.$this); + }, + $signature: 15 + }; + A._EvaluateVisitor0.prototype = { + _EvaluateVisitor$6$functions$importCache$logger$nodeImporter$quietDeps$sourceMap0(functions, importCache, logger, nodeImporter, quietDeps, sourceMap) { + var t2, metaModule, t3, _i, module, $function, t4, _this = this, + _s20_ = "$name, $module: null", + _s9_ = "sass:meta", + _s7_ = "$module", + t1 = type$.JSArray_AsyncBuiltInCallable, + metaFunctions = A._setArrayType([A.BuiltInCallable$function("global-variable-exists", _s20_, new A._EvaluateVisitor_closure12(_this), _s9_), A.BuiltInCallable$function("variable-exists", "$name", new A._EvaluateVisitor_closure13(_this), _s9_), A.BuiltInCallable$function("function-exists", _s20_, new A._EvaluateVisitor_closure14(_this), _s9_), A.BuiltInCallable$function("mixin-exists", _s20_, new A._EvaluateVisitor_closure15(_this), _s9_), A.BuiltInCallable$function("content-exists", "", new A._EvaluateVisitor_closure16(_this), _s9_), A.BuiltInCallable$function("module-variables", _s7_, new A._EvaluateVisitor_closure17(_this), _s9_), A.BuiltInCallable$function("module-functions", _s7_, new A._EvaluateVisitor_closure18(_this), _s9_), A.BuiltInCallable$function("module-mixins", _s7_, new A._EvaluateVisitor_closure19(_this), _s9_), A.BuiltInCallable$function("get-function", "$name, $css: false, $module: null", new A._EvaluateVisitor_closure20(_this), _s9_), A.BuiltInCallable$function("get-mixin", _s20_, new A._EvaluateVisitor_closure21(_this), _s9_), new A.AsyncBuiltInCallable("call", A.ScssParser$("@function call($function, $args...) {", null, _s9_).parseArgumentDeclaration$0(), new A._EvaluateVisitor_closure22(_this), false)], t1), + metaMixins = A._setArrayType([A.AsyncBuiltInCallable$mixin("load-css", "$url, $with: null", new A._EvaluateVisitor_closure23(_this), false, _s9_), A.AsyncBuiltInCallable$mixin("apply", "$mixin, $args...", new A._EvaluateVisitor_closure24(_this), true, _s9_)], t1); + t1 = type$.AsyncBuiltInCallable; + t2 = A.List_List$of($.$get$global(), true, t1); + B.JSArray_methods.addAll$1(t2, $.$get$local()); + B.JSArray_methods.addAll$1(t2, metaFunctions); + metaModule = A.BuiltInModule$("meta", t2, metaMixins, null, t1); + for (t1 = A.List_List$of($.$get$coreModules(), true, type$.BuiltInModule_AsyncCallable), t1.push(metaModule), t2 = t1.length, t3 = _this._async_evaluate$_builtInModules, _i = 0; _i < t1.length; t1.length === t2 || (0, A.throwConcurrentModificationError)(t1), ++_i) { + module = t1[_i]; + t3.$indexSet(0, module.url, module); + } + t1 = A._setArrayType([], type$.JSArray_AsyncCallable); + B.JSArray_methods.addAll$1(t1, $.$get$globalFunctions()); + B.JSArray_methods.addAll$1(t1, metaFunctions); + for (t2 = t1.length, t3 = _this._async_evaluate$_builtInFunctions, _i = 0; _i < t1.length; t1.length === t2 || (0, A.throwConcurrentModificationError)(t1), ++_i) { + $function = t1[_i]; + t4 = J.get$name$x($function); + t3.$indexSet(0, A.stringReplaceAllUnchecked(t4, "_", "-"), $function); + } + }, + run$2(_, importer, node) { + return this.run$body$_EvaluateVisitor(0, importer, node); + }, + run$body$_EvaluateVisitor(_, importer, node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Record_2_Set_Uri_loadedUrls_and_CssStylesheet_stylesheet), + $async$returnValue, $async$handler = 2, $async$currentError, $async$self = this, error, stackTrace, t1, exception, $async$exception; + var $async$run$2 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) { + $async$currentError = $async$result; + $async$goto = $async$handler; + } + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$handler = 4; + t1 = type$.nullable_Object; + t1 = A.runZoned(new A._EvaluateVisitor_run_closure0($async$self, node, importer), A.LinkedHashMap_LinkedHashMap$_literal([B.Symbol__evaluationContext, new A._EvaluationContext0($async$self, node)], t1, t1), type$.FutureOr_Record_2_Set_Uri_loadedUrls_and_CssStylesheet_stylesheet); + $async$goto = 7; + return A._asyncAwait(type$.Future_Record_2_Set_Uri_loadedUrls_and_CssStylesheet_stylesheet._is(t1) ? t1 : A._Future$value(t1, type$.Record_2_Set_Uri_loadedUrls_and_CssStylesheet_stylesheet), $async$run$2); + case 7: + // returning from await. + t1 = $async$result; + $async$returnValue = t1; + // goto return + $async$goto = 1; + break; + $async$handler = 2; + // goto after finally + $async$goto = 6; + break; + case 4: + // catch + $async$handler = 3; + $async$exception = $async$currentError; + t1 = A.unwrapException($async$exception); + if (t1 instanceof A.SassException) { + error = t1; + stackTrace = A.getTraceFromException($async$exception); + A.throwWithTrace(error.withLoadedUrls$1($async$self._async_evaluate$_loadedUrls), error, stackTrace); + } else + throw $async$exception; + // goto after finally + $async$goto = 6; + break; + case 3: + // uncaught + // goto rethrow + $async$goto = 2; + break; + case 6: + // after finally + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + case 2: + // rethrow + return A._asyncRethrow($async$currentError, $async$completer); + } + }); + return A._asyncStartSync($async$run$2, $async$completer); + }, + _async_evaluate$_assertInModule$1$2(value, $name) { + if (value != null) + return value; + throw A.wrapException(A.StateError$("Can't access " + $name + " outside of a module.")); + }, + _async_evaluate$_assertInModule$2(value, $name) { + return this._async_evaluate$_assertInModule$1$2(value, $name, type$.dynamic); + }, + _async_evaluate$_loadModule$7$baseUrl$configuration$namesInErrors(url, stackFrame, nodeWithSpan, callback, baseUrl, configuration, namesInErrors) { + return this._loadModule$body$_EvaluateVisitor(url, stackFrame, nodeWithSpan, callback, baseUrl, configuration, namesInErrors); + }, + _async_evaluate$_loadModule$5$configuration(url, stackFrame, nodeWithSpan, callback, configuration) { + return this._async_evaluate$_loadModule$7$baseUrl$configuration$namesInErrors(url, stackFrame, nodeWithSpan, callback, null, configuration, false); + }, + _async_evaluate$_loadModule$4(url, stackFrame, nodeWithSpan, callback) { + return this._async_evaluate$_loadModule$7$baseUrl$configuration$namesInErrors(url, stackFrame, nodeWithSpan, callback, null, null, false); + }, + _loadModule$body$_EvaluateVisitor(url, stackFrame, nodeWithSpan, callback, baseUrl, configuration, namesInErrors) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void), + $async$returnValue, $async$self = this, _0_0, t2, t1; + var $async$_async_evaluate$_loadModule$7$baseUrl$configuration$namesInErrors = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = {}; + t1.builtInModule = null; + _0_0 = $async$self._async_evaluate$_builtInModules.$index(0, url); + $async$goto = _0_0 != null ? 3 : 4; + break; + case 3: + // then + t1.builtInModule = _0_0; + if (configuration instanceof A.ExplicitConfiguration) { + t1 = namesInErrors ? "Built-in module " + url.toString$0(0) + " can't be configured." : "Built-in modules can't be configured."; + t2 = configuration.nodeWithSpan; + throw A.wrapException($async$self._async_evaluate$_exception$2(t1, t2.get$span(t2))); + } + $async$goto = 5; + return A._asyncAwait($async$self._addExceptionSpanAsync$1$2(nodeWithSpan, new A._EvaluateVisitor__loadModule_closure1(t1, callback), type$.void), $async$_async_evaluate$_loadModule$7$baseUrl$configuration$namesInErrors); + case 5: + // returning from await. + // goto return + $async$goto = 1; + break; + case 4: + // join + $async$goto = 6; + return A._asyncAwait($async$self._async_evaluate$_withStackFrame$1$3(stackFrame, nodeWithSpan, new A._EvaluateVisitor__loadModule_closure2($async$self, url, nodeWithSpan, baseUrl, namesInErrors, configuration, callback), type$.Null), $async$_async_evaluate$_loadModule$7$baseUrl$configuration$namesInErrors); + case 6: + // returning from await. + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$_async_evaluate$_loadModule$7$baseUrl$configuration$namesInErrors, $async$completer); + }, + _async_evaluate$_execute$5$configuration$namesInErrors$nodeWithSpan(importer, stylesheet, configuration, namesInErrors, nodeWithSpan) { + return this._execute$body$_EvaluateVisitor(importer, stylesheet, configuration, namesInErrors, nodeWithSpan); + }, + _async_evaluate$_execute$2(importer, stylesheet) { + return this._async_evaluate$_execute$5$configuration$namesInErrors$nodeWithSpan(importer, stylesheet, null, false, null); + }, + _execute$body$_EvaluateVisitor(importer, stylesheet, configuration, namesInErrors, nodeWithSpan) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Module_AsyncCallable), + $async$returnValue, $async$self = this, _0_0, currentConfiguration, t2, t3, message, existingSpan, configurationSpan, environment, css, preModuleComments, extensionStore, module, t1, url; + var $async$_async_evaluate$_execute$5$configuration$namesInErrors$nodeWithSpan = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = stylesheet.span; + url = t1.get$sourceUrl(t1); + t1 = $async$self._async_evaluate$_modules; + _0_0 = t1.$index(0, url); + if (_0_0 != null) { + t1 = configuration == null; + currentConfiguration = t1 ? $async$self._async_evaluate$_configuration : configuration; + t2 = $async$self._async_evaluate$_moduleConfigurations.$index(0, url); + t3 = t2.__originalConfiguration; + t2 = t3 == null ? t2 : t3; + t3 = currentConfiguration.__originalConfiguration; + if (t2 !== (t3 == null ? currentConfiguration : t3) && currentConfiguration instanceof A.ExplicitConfiguration) { + if (namesInErrors) { + t2 = $.$get$context(); + url.toString; + message = t2.prettyUri$1(url) + string$.x20was_a; + } else + message = string$.This_mw; + t2 = $async$self._async_evaluate$_moduleNodes.$index(0, url); + existingSpan = t2 == null ? null : t2.get$span(t2); + if (t1) { + t1 = currentConfiguration.nodeWithSpan; + configurationSpan = t1.get$span(t1); + } else + configurationSpan = null; + t1 = A.LinkedHashMap_LinkedHashMap$_empty(type$.FileSpan, type$.String); + if (existingSpan != null) + t1.$indexSet(0, existingSpan, "original load"); + if (configurationSpan != null) + t1.$indexSet(0, configurationSpan, "configuration"); + throw A.wrapException(t1.get$isEmpty(0) ? $async$self._async_evaluate$_exception$1(message) : $async$self._async_evaluate$_multiSpanException$3(message, "new load", t1)); + } + $async$returnValue = _0_0; + // goto return + $async$goto = 1; + break; + } + environment = A.AsyncEnvironment$(); + css = A._Cell$(); + preModuleComments = A._Cell$(); + extensionStore = A.ExtensionStore$(); + $async$goto = 3; + return A._asyncAwait($async$self._async_evaluate$_withEnvironment$1$2(environment, new A._EvaluateVisitor__execute_closure0($async$self, importer, stylesheet, extensionStore, configuration, css, preModuleComments), type$.Null), $async$_async_evaluate$_execute$5$configuration$namesInErrors$nodeWithSpan); + case 3: + // returning from await. + t2 = css._readLocal$0(); + t3 = preModuleComments._readLocal$0(); + module = environment.toModule$3(t2, t3 == null ? B.Map_empty7 : t3, extensionStore); + if (url != null) { + t1.$indexSet(0, url, module); + $async$self._async_evaluate$_moduleConfigurations.$indexSet(0, url, $async$self._async_evaluate$_configuration); + if (nodeWithSpan != null) + $async$self._async_evaluate$_moduleNodes.$indexSet(0, url, nodeWithSpan); + } + $async$returnValue = module; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$_async_evaluate$_execute$5$configuration$namesInErrors$nodeWithSpan, $async$completer); + }, + _async_evaluate$_addOutOfOrderImports$0() { + var t1, t2, _this = this, _s5_ = "_root", + _s13_ = "_endOfImports", + _0_0 = _this._async_evaluate$_outOfOrderImports; + $label0$0: { + if (_0_0 == null) { + t1 = _this._async_evaluate$_assertInModule$2(_this._async_evaluate$__root, _s5_).children; + break $label0$0; + } + t1 = _this._async_evaluate$_assertInModule$2(_this._async_evaluate$__root, _s5_).children; + t1 = A.List_List$of(A.SubListIterable$(t1, 0, A.checkNotNullable(_this._async_evaluate$_assertInModule$2(_this._async_evaluate$__endOfImports, _s13_), "count", type$.int), t1.$ti._eval$1("ListBase.E")), true, type$.ModifiableCssNode); + B.JSArray_methods.addAll$1(t1, _0_0); + t2 = _this._async_evaluate$_assertInModule$2(_this._async_evaluate$__root, _s5_).children; + B.JSArray_methods.addAll$1(t1, A.SubListIterable$(t2, _this._async_evaluate$_assertInModule$2(_this._async_evaluate$__endOfImports, _s13_), null, t2.$ti._eval$1("ListBase.E"))); + break $label0$0; + } + return t1; + }, + _async_evaluate$_combineCss$2$clone(root, clone) { + var selectors, _0_0, t1, imports, css, sorted, t2; + if (!B.JSArray_methods.any$1(root.get$upstream(), new A._EvaluateVisitor__combineCss_closure1())) { + selectors = root.get$extensionStore().get$simpleSelectors(); + _0_0 = A.IterableExtension_get_firstOrNull(root.get$extensionStore().extensionsWhereTarget$1(new A._EvaluateVisitor__combineCss_closure2(selectors))); + if (_0_0 != null) + this._async_evaluate$_throwForUnsatisfiedExtension$1(_0_0); + return root.get$css(root); + } + t1 = type$.JSArray_CssNode; + imports = A._setArrayType([], t1); + css = A._setArrayType([], t1); + t1 = type$.Module_AsyncCallable; + sorted = A.ListQueue$(t1); + new A._EvaluateVisitor__combineCss_visitModule0(this, A.LinkedHashSet_LinkedHashSet$_empty(t1), clone, css, imports, sorted).call$1(root); + if (root.get$transitivelyContainsExtensions()) + this._async_evaluate$_extendModules$1(sorted); + t1 = B.JSArray_methods.$add(imports, css); + t2 = root.get$css(root); + return new A.CssStylesheet(new A.UnmodifiableListView(t1, type$.UnmodifiableListView_CssNode), t2.get$span(t2)); + }, + _async_evaluate$_combineCss$1(root) { + return this._async_evaluate$_combineCss$2$clone(root, false); + }, + _async_evaluate$_extendModules$1(sortedModules) { + var t1, t2, t3, originalSelectors, $self, t4, t5, _i, upstream, _0_0, + downstreamExtensionStores = A.LinkedHashMap_LinkedHashMap$_empty(type$.Uri, type$.List_ExtensionStore), + unsatisfiedExtensions = new A._LinkedIdentityHashSet(type$._LinkedIdentityHashSet_Extension); + for (t1 = A._ListQueueIterator$(sortedModules, sortedModules.$ti._precomputed1), t2 = t1.$ti._precomputed1; t1.moveNext$0();) { + t3 = t1._collection$_current; + if (t3 == null) + t3 = t2._as(t3); + originalSelectors = t3.get$extensionStore().get$simpleSelectors().toSet$0(0); + unsatisfiedExtensions.addAll$1(0, t3.get$extensionStore().extensionsWhereTarget$1(new A._EvaluateVisitor__extendModules_closure1(originalSelectors))); + $self = downstreamExtensionStores.$index(0, t3.get$url(t3)); + t4 = t3.get$extensionStore().get$addExtensions(); + if ($self != null) + t4.call$1($self); + t4 = t3.get$extensionStore(); + if (t4.get$isEmpty(t4)) + continue; + for (t4 = t3.get$upstream(), t5 = t4.length, _i = 0; _i < t4.length; t4.length === t5 || (0, A.throwConcurrentModificationError)(t4), ++_i) { + upstream = t4[_i]; + _0_0 = upstream.get$url(upstream); + if (_0_0 != null) + J.add$1$ax(downstreamExtensionStores.putIfAbsent$2(_0_0, new A._EvaluateVisitor__extendModules_closure2()), t3.get$extensionStore()); + } + unsatisfiedExtensions.removeAll$1(t3.get$extensionStore().extensionsWhereTarget$1(originalSelectors.get$contains(originalSelectors))); + } + if (unsatisfiedExtensions._collection$_length !== 0) + this._async_evaluate$_throwForUnsatisfiedExtension$1(unsatisfiedExtensions.get$first(0)); + }, + _async_evaluate$_throwForUnsatisfiedExtension$1(extension) { + throw A.wrapException(A.SassException$(string$.The_ta + extension.target.toString$0(0) + ' !optional" to avoid this error.', extension.span, null)); + }, + _async_evaluate$_indexAfterImports$1(statements) { + var t1, lastImport, i, _0_0; + for (t1 = J.getInterceptor$asx(statements), lastImport = -1, i = 0; i < t1.get$length(statements); ++i) { + $label0$0: { + _0_0 = t1.$index(statements, i); + if (_0_0 instanceof A.ModifiableCssImport) + break $label0$0; + if (_0_0 instanceof A.ModifiableCssComment) + continue; + break; + } + lastImport = i; + } + return lastImport + 1; + }, + visitStylesheet$1(node) { + return this.visitStylesheet$body$_EvaluateVisitor(node); + }, + visitStylesheet$body$_EvaluateVisitor(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.nullable_Value), + $async$returnValue, $async$self = this, t1, t2, _i; + var $async$visitStylesheet$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = node.children, t2 = t1.length, _i = 0; + case 3: + // for condition + if (!(_i < t2)) { + // goto after for + $async$goto = 5; + break; + } + $async$goto = 6; + return A._asyncAwait(t1[_i].accept$1($async$self), $async$visitStylesheet$1); + case 6: + // returning from await. + case 4: + // for update + ++_i; + // goto for condition + $async$goto = 3; + break; + case 5: + // after for + $async$returnValue = null; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$visitStylesheet$1, $async$completer); + }, + visitAtRootRule$1(node) { + return this.visitAtRootRule$body$_EvaluateVisitor(node); + }, + visitAtRootRule$body$_EvaluateVisitor(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.nullable_Value), + $async$returnValue, $async$self = this, _1_0, resolved, query, $parent, included, t1, _2_0, root, first, rest, innerCopy, outerCopy, _i, copy, _0_0; + var $async$visitAtRootRule$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + _0_0 = node.query; + $async$goto = _0_0 != null ? 3 : 5; + break; + case 3: + // then + $async$goto = 6; + return A._asyncAwait($async$self._async_evaluate$_performInterpolationWithMap$2$warnForColor(_0_0, true), $async$visitAtRootRule$1); + case 6: + // returning from await. + _1_0 = $async$result; + resolved = _1_0._0; + _1_0._1; + query = A.AtRootQueryParser$(resolved, $async$self._async_evaluate$_logger, null).parse$0(); + // goto join + $async$goto = 4; + break; + case 5: + // else + query = B.AtRootQuery_UsS; + case 4: + // join + $parent = $async$self._async_evaluate$_assertInModule$2($async$self._async_evaluate$__parent, "__parent"); + included = A._setArrayType([], type$.JSArray_ModifiableCssParentNode); + for (t1 = type$.CssStylesheet; !t1._is($parent); $parent = _2_0) { + if (!query.excludes$1($parent)) + included.push($parent); + _2_0 = $parent._parent; + if (_2_0 == null) + throw A.wrapException(A.StateError$(string$.CssNod)); + } + root = $async$self._async_evaluate$_trimIncluded$1(included); + $async$goto = root === $async$self._async_evaluate$_assertInModule$2($async$self._async_evaluate$__parent, "__parent") ? 7 : 8; + break; + case 7: + // then + $async$goto = 9; + return A._asyncAwait($async$self._async_evaluate$_environment.scope$1$2$when(new A._EvaluateVisitor_visitAtRootRule_closure1($async$self, node), node.hasDeclarations, type$.Null), $async$visitAtRootRule$1); + case 9: + // returning from await. + $async$returnValue = null; + // goto return + $async$goto = 1; + break; + case 8: + // join + if (included.length >= 1) { + first = included[0]; + rest = B.JSArray_methods.sublist$1(included, 1); + innerCopy = first.copyWithoutChildren$0(); + for (t1 = rest.length, outerCopy = innerCopy, _i = 0; _i < rest.length; rest.length === t1 || (0, A.throwConcurrentModificationError)(rest), ++_i, outerCopy = copy) { + copy = rest[_i].copyWithoutChildren$0(); + copy.addChild$1(outerCopy); + } + root.addChild$1(outerCopy); + } else + innerCopy = root; + $async$goto = 10; + return A._asyncAwait($async$self._async_evaluate$_scopeForAtRoot$4(node, innerCopy, query, included).call$1(new A._EvaluateVisitor_visitAtRootRule_closure2($async$self, node)), $async$visitAtRootRule$1); + case 10: + // returning from await. + $async$returnValue = null; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$visitAtRootRule$1, $async$completer); + }, + _async_evaluate$_trimIncluded$1(nodes) { + var $parent, t1, innermostContiguous, i, t2, _0_0, _1_0, root, _this = this, _null = null, _s5_ = "_root", + _s22_ = " to be an ancestor of "; + if (nodes.length === 0) + return _this._async_evaluate$_assertInModule$2(_this._async_evaluate$__root, _s5_); + $parent = _this._async_evaluate$_assertInModule$2(_this._async_evaluate$__parent, "__parent"); + for (t1 = nodes.length, innermostContiguous = _null, i = 0; i < t1; ++i, $parent = _1_0) { + for (; t2 = nodes[i], $parent !== t2; innermostContiguous = _null, $parent = _0_0) { + _0_0 = $parent._parent; + if (_0_0 == null) + throw A.wrapException(A.ArgumentError$("Expected " + t2.toString$0(0) + _s22_ + _this.toString$0(0) + ".", _null)); + } + if (innermostContiguous == null) + innermostContiguous = i; + _1_0 = $parent._parent; + if (_1_0 == null) + throw A.wrapException(A.ArgumentError$("Expected " + t2.toString$0(0) + _s22_ + _this.toString$0(0) + ".", _null)); + } + if ($parent !== _this._async_evaluate$_assertInModule$2(_this._async_evaluate$__root, _s5_)) + return _this._async_evaluate$_assertInModule$2(_this._async_evaluate$__root, _s5_); + innermostContiguous.toString; + root = nodes[innermostContiguous]; + B.JSArray_methods.removeRange$2(nodes, innermostContiguous, nodes.length); + return root; + }, + _async_evaluate$_scopeForAtRoot$4(node, newParent, query, included) { + var _this = this, + scope = new A._EvaluateVisitor__scopeForAtRoot_closure5(_this, newParent, node), + t1 = query._all || query._at_root_query$_rule; + if (t1 !== query.include) + scope = new A._EvaluateVisitor__scopeForAtRoot_closure6(_this, scope); + if (_this._async_evaluate$_mediaQueries != null && query.excludesName$1("media")) + scope = new A._EvaluateVisitor__scopeForAtRoot_closure7(_this, scope); + if (_this._async_evaluate$_inKeyframes && query.excludesName$1("keyframes")) + scope = new A._EvaluateVisitor__scopeForAtRoot_closure8(_this, scope); + return _this._async_evaluate$_inUnknownAtRule && !B.JSArray_methods.any$1(included, new A._EvaluateVisitor__scopeForAtRoot_closure9()) ? new A._EvaluateVisitor__scopeForAtRoot_closure10(_this, scope) : scope; + }, + visitContentBlock$1(node) { + return A.throwExpression(A.UnsupportedError$(string$.Evalua)); + }, + visitContentRule$1(node) { + return this.visitContentRule$body$_EvaluateVisitor(node); + }, + visitContentRule$body$_EvaluateVisitor(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.nullable_Value), + $async$returnValue, $async$self = this, $content; + var $async$visitContentRule$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + $content = $async$self._async_evaluate$_environment._async_environment$_content; + if ($content == null) { + $async$returnValue = null; + // goto return + $async$goto = 1; + break; + } + $async$goto = 3; + return A._asyncAwait($async$self._async_evaluate$_runUserDefinedCallable$1$4(node.$arguments, $content, node, new A._EvaluateVisitor_visitContentRule_closure0($async$self, $content), type$.Null), $async$visitContentRule$1); + case 3: + // returning from await. + $async$returnValue = null; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$visitContentRule$1, $async$completer); + }, + visitDebugRule$1(node) { + return this.visitDebugRule$body$_EvaluateVisitor(node); + }, + visitDebugRule$body$_EvaluateVisitor(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.nullable_Value), + $async$returnValue, $async$self = this, value, t1; + var $async$visitDebugRule$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$goto = 3; + return A._asyncAwait(node.expression.accept$1($async$self), $async$visitDebugRule$1); + case 3: + // returning from await. + value = $async$result; + t1 = value instanceof A.SassString ? value._string$_text : A.serializeValue(value, true, true); + $async$self._async_evaluate$_logger.debug$2(0, t1, node.span); + $async$returnValue = null; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$visitDebugRule$1, $async$completer); + }, + visitDeclaration$1(node) { + return this.visitDeclaration$body$_EvaluateVisitor(node); + }, + visitDeclaration$body$_EvaluateVisitor(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.nullable_Value), + $async$returnValue, $async$self = this, t2, $name, _0_0, _1_0, value, t3, t4, t5, _2_0, oldDeclarationName, t1; + var $async$visitDeclaration$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = {}; + if (($async$self._async_evaluate$_atRootExcludingStyleRule ? null : $async$self._async_evaluate$_styleRuleIgnoringAtRoot) == null && !$async$self._async_evaluate$_inUnknownAtRule && !$async$self._async_evaluate$_inKeyframes) + throw A.wrapException($async$self._async_evaluate$_exception$2(string$.Declarm, node.span)); + if ($async$self._async_evaluate$_declarationName != null && B.JSString_methods.startsWith$1(node.name.get$initialPlain(), "--")) + throw A.wrapException($async$self._async_evaluate$_exception$2(string$.Declarw, node.span)); + t2 = node.name; + $async$goto = 3; + return A._asyncAwait($async$self._async_evaluate$_interpolationToValue$2$warnForColor(t2, true), $async$visitDeclaration$1); + case 3: + // returning from await. + $name = $async$result; + _0_0 = $async$self._async_evaluate$_declarationName; + if (_0_0 != null) + $name = new A.CssValue(_0_0 + "-" + A.S($name.value), $name.span, type$.CssValue_String); + _1_0 = node.value; + $async$goto = _1_0 != null ? 4 : 5; + break; + case 4: + // then + $async$goto = 6; + return A._asyncAwait(_1_0.accept$1($async$self), $async$visitDeclaration$1); + case 6: + // returning from await. + value = $async$result; + if (!value.get$isBlank() || value.get$asList().length === 0) { + t3 = $async$self._async_evaluate$_assertInModule$2($async$self._async_evaluate$__parent, "__parent"); + t4 = _1_0.get$span(_1_0); + t2 = B.JSString_methods.startsWith$1(t2.get$initialPlain(), "--"); + if ($async$self._async_evaluate$_sourceMap) { + t5 = A.NullableExtension_andThen(_1_0, $async$self.get$_async_evaluate$_expressionNode()); + t5 = t5 == null ? null : J.get$span$z(t5); + } else + t5 = null; + t3.addChild$1(A.ModifiableCssDeclaration$($name, new A.CssValue(value, t4, type$.CssValue_Value), node.span, t2, t5)); + } else if (J.startsWith$1$s($name.value, "--")) + throw A.wrapException($async$self._async_evaluate$_exception$2("Custom property values may not be empty.", _1_0.get$span(_1_0))); + case 5: + // join + t1.children = null; + _2_0 = node.children; + $async$goto = _2_0 != null ? 7 : 8; + break; + case 7: + // then + t1.children = _2_0; + oldDeclarationName = $async$self._async_evaluate$_declarationName; + $async$self._async_evaluate$_declarationName = $name.value; + $async$goto = 9; + return A._asyncAwait($async$self._async_evaluate$_environment.scope$1$2$when(new A._EvaluateVisitor_visitDeclaration_closure0(t1, $async$self), node.hasDeclarations, type$.Null), $async$visitDeclaration$1); + case 9: + // returning from await. + $async$self._async_evaluate$_declarationName = oldDeclarationName; + case 8: + // join + $async$returnValue = null; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$visitDeclaration$1, $async$completer); + }, + visitEachRule$1(node) { + return this.visitEachRule$body$_EvaluateVisitor(node); + }, + visitEachRule$body$_EvaluateVisitor(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.nullable_Value), + $async$returnValue, $async$self = this, _box_0, t1, list, nodeWithSpan, _0_0; + var $async$visitEachRule$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + _box_0 = {}; + t1 = node.list; + $async$goto = 3; + return A._asyncAwait(t1.accept$1($async$self), $async$visitEachRule$1); + case 3: + // returning from await. + list = $async$result; + nodeWithSpan = $async$self._async_evaluate$_expressionNode$1(t1); + _0_0 = node.variables; + $label0$0: { + _box_0.variable = null; + if (_0_0.length === 1) { + _box_0.variable = _0_0[0]; + t1 = new A._EvaluateVisitor_visitEachRule_closure2(_box_0, $async$self, nodeWithSpan); + break $label0$0; + } + _box_0.variables = null; + _box_0.variables = _0_0; + t1 = new A._EvaluateVisitor_visitEachRule_closure3(_box_0, $async$self, nodeWithSpan); + break $label0$0; + } + $async$returnValue = $async$self._async_evaluate$_environment.scope$1$2$semiGlobal(new A._EvaluateVisitor_visitEachRule_closure4($async$self, list, t1, node), true, type$.nullable_Value); + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$visitEachRule$1, $async$completer); + }, + _async_evaluate$_setMultipleVariables$3(variables, value, nodeWithSpan) { + var i, + list = value.get$asList(), + t1 = variables.length, + minLength = Math.min(t1, list.length); + for (i = 0; i < minLength; ++i) + this._async_evaluate$_environment.setLocalVariable$3(variables[i], this._async_evaluate$_withoutSlash$2(list[i], nodeWithSpan), nodeWithSpan); + for (i = minLength; i < t1; ++i) + this._async_evaluate$_environment.setLocalVariable$3(variables[i], B.C__SassNull, nodeWithSpan); + }, + visitErrorRule$1(node) { + return this.visitErrorRule$body$_EvaluateVisitor(node); + }, + visitErrorRule$body$_EvaluateVisitor(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Value), + $async$self = this, $async$temp1, $async$temp2; + var $async$visitErrorRule$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$temp1 = A; + $async$temp2 = J; + $async$goto = 2; + return A._asyncAwait(node.expression.accept$1($async$self), $async$visitErrorRule$1); + case 2: + // returning from await. + throw $async$temp1.wrapException($async$self._async_evaluate$_exception$2($async$temp2.toString$0$($async$result), node.span)); + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$visitErrorRule$1, $async$completer); + }, + visitExtendRule$1(node) { + return this.visitExtendRule$body$_EvaluateVisitor(node); + }, + visitExtendRule$body$_EvaluateVisitor(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.nullable_Value), + $async$returnValue, $async$self = this, t1, t2, t3, t4, t5, _i, complex, visitor, t6, t7, _0_0, targetText, targetMap, compound, styleRule; + var $async$visitExtendRule$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + styleRule = $async$self._async_evaluate$_atRootExcludingStyleRule ? null : $async$self._async_evaluate$_styleRuleIgnoringAtRoot; + if (styleRule == null || $async$self._async_evaluate$_declarationName != null) + throw A.wrapException($async$self._async_evaluate$_exception$2(string$.x40exten, node.span)); + for (t1 = styleRule.originalSelector.components, t2 = t1.length, t3 = node.span, t4 = type$.SourceSpan, t5 = type$.String, _i = 0; _i < t2; ++_i) { + complex = t1[_i]; + if (!complex.accept$1(B._IsBogusVisitor_true)) + continue; + visitor = A._SerializeVisitor$(null, true, null, true, false, null, true); + complex.accept$1(visitor); + t6 = B.JSString_methods.trim$0(visitor._serialize$_buffer.toString$0(0)); + t7 = complex.accept$1(B.C__IsUselessVisitor) ? "can't" : "shouldn't"; + $async$self._async_evaluate$_warn$3('The selector "' + t6 + '" is invalid CSS and ' + t7 + string$.x20be_an, new A.MultiSpan(A.SpanExtensions_trimRight(complex.span), "invalid selector", A.ConstantMap_ConstantMap$from(A.LinkedHashMap_LinkedHashMap$_literal([t3, "@extend rule"], t4, t5), t4, t5)), B.Deprecation_vrR); + } + $async$goto = 3; + return A._asyncAwait($async$self._async_evaluate$_performInterpolationWithMap$2$warnForColor(node.selector, true), $async$visitExtendRule$1); + case 3: + // returning from await. + _0_0 = $async$result; + targetText = _0_0._0; + targetMap = _0_0._1; + for (t1 = A.SelectorList_SelectorList$parse(A.trimAscii(targetText, true), false, true, targetMap, $async$self._async_evaluate$_logger).components, t2 = t1.length, t3 = styleRule._style_rule$_selector._box$_inner, _i = 0; _i < t2; ++_i) { + complex = t1[_i]; + compound = complex.get$singleCompound(); + if (compound == null) + throw A.wrapException(A.SassFormatException$("complex selectors may not be extended.", complex.span, null)); + t4 = compound.components; + t5 = t4.length === 1 ? B.JSArray_methods.get$first(t4) : null; + if (t5 == null) + throw A.wrapException(A.SassFormatException$(string$.compou + B.JSArray_methods.join$1(t4, ", ") + string$.x60_inst, compound.span, null)); + $async$self._async_evaluate$_assertInModule$2($async$self._async_evaluate$__extensionStore, "_extensionStore").addExtension$4(t3.value, t5, node, $async$self._async_evaluate$_mediaQueries); + } + $async$returnValue = null; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$visitExtendRule$1, $async$completer); + }, + visitAtRule$1(node) { + return this.visitAtRule$body$_EvaluateVisitor(node); + }, + visitAtRule$body$_EvaluateVisitor(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.nullable_Value), + $async$returnValue, $async$self = this, $name, t1, value, children, wasInKeyframes, wasInUnknownAtRule; + var $async$visitAtRule$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + if ($async$self._async_evaluate$_declarationName != null) + throw A.wrapException($async$self._async_evaluate$_exception$2(string$.At_rul, node.span)); + $async$goto = 3; + return A._asyncAwait($async$self._async_evaluate$_interpolationToValue$1(node.name), $async$visitAtRule$1); + case 3: + // returning from await. + $name = $async$result; + t1 = A.NullableExtension_andThen(node.value, new A._EvaluateVisitor_visitAtRule_closure2($async$self)); + $async$goto = 4; + return A._asyncAwait(type$.Future_nullable_CssValue_String._is(t1) ? t1 : A._Future$value(t1, type$.nullable_CssValue_String), $async$visitAtRule$1); + case 4: + // returning from await. + value = $async$result; + children = node.children; + if (children == null) { + $async$self._async_evaluate$_assertInModule$2($async$self._async_evaluate$__parent, "__parent").addChild$1(A.ModifiableCssAtRule$($name, node.span, true, value)); + $async$returnValue = null; + // goto return + $async$goto = 1; + break; + } + wasInKeyframes = $async$self._async_evaluate$_inKeyframes; + wasInUnknownAtRule = $async$self._async_evaluate$_inUnknownAtRule; + if (A.unvendor($name.value) === "keyframes") + $async$self._async_evaluate$_inKeyframes = true; + else + $async$self._async_evaluate$_inUnknownAtRule = true; + $async$goto = 5; + return A._asyncAwait($async$self._async_evaluate$_withParent$2$4$scopeWhen$through(A.ModifiableCssAtRule$($name, node.span, false, value), new A._EvaluateVisitor_visitAtRule_closure3($async$self, $name, children), node.hasDeclarations, new A._EvaluateVisitor_visitAtRule_closure4(), type$.ModifiableCssAtRule, type$.Null), $async$visitAtRule$1); + case 5: + // returning from await. + $async$self._async_evaluate$_inUnknownAtRule = wasInUnknownAtRule; + $async$self._async_evaluate$_inKeyframes = wasInKeyframes; + $async$returnValue = null; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$visitAtRule$1, $async$completer); + }, + visitForRule$1(node) { + return this.visitForRule$body$_EvaluateVisitor(node); + }, + visitForRule$body$_EvaluateVisitor(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.nullable_Value), + $async$returnValue, $async$self = this, t1, t2, t3, fromNumber, t4, toNumber, from, to, direction; + var $async$visitForRule$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = {}; + t2 = node.from; + t3 = type$.SassNumber; + $async$goto = 3; + return A._asyncAwait($async$self._addExceptionSpanAsync$1$2(t2, new A._EvaluateVisitor_visitForRule_closure4($async$self, node), t3), $async$visitForRule$1); + case 3: + // returning from await. + fromNumber = $async$result; + t4 = node.to; + $async$goto = 4; + return A._asyncAwait($async$self._addExceptionSpanAsync$1$2(t4, new A._EvaluateVisitor_visitForRule_closure5($async$self, node), t3), $async$visitForRule$1); + case 4: + // returning from await. + toNumber = $async$result; + from = $async$self._async_evaluate$_addExceptionSpan$2(t2, new A._EvaluateVisitor_visitForRule_closure6(fromNumber)); + to = t1.to = $async$self._async_evaluate$_addExceptionSpan$2(t4, new A._EvaluateVisitor_visitForRule_closure7(toNumber, fromNumber)); + direction = from > to ? -1 : 1; + if (from === (!node.isExclusive ? t1.to = to + direction : to)) { + $async$returnValue = null; + // goto return + $async$goto = 1; + break; + } + $async$returnValue = $async$self._async_evaluate$_environment.scope$1$2$semiGlobal(new A._EvaluateVisitor_visitForRule_closure8(t1, $async$self, node, from, direction, fromNumber), true, type$.nullable_Value); + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$visitForRule$1, $async$completer); + }, + visitForwardRule$1(node) { + return this.visitForwardRule$body$_EvaluateVisitor(node); + }, + visitForwardRule$body$_EvaluateVisitor(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.nullable_Value), + $async$returnValue, $async$self = this, newConfiguration, t4, _i, variable, $name, oldConfiguration, adjustedConfiguration, t1, t2, t3; + var $async$visitForwardRule$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + oldConfiguration = $async$self._async_evaluate$_configuration; + adjustedConfiguration = oldConfiguration.throughForward$1(node); + t1 = node.configuration; + t2 = t1.length; + t3 = node.url; + $async$goto = t2 !== 0 ? 3 : 5; + break; + case 3: + // then + $async$goto = 6; + return A._asyncAwait($async$self._async_evaluate$_addForwardConfiguration$2(adjustedConfiguration, node), $async$visitForwardRule$1); + case 6: + // returning from await. + newConfiguration = $async$result; + $async$goto = 7; + return A._asyncAwait($async$self._async_evaluate$_loadModule$5$configuration(t3, "@forward", node, new A._EvaluateVisitor_visitForwardRule_closure1($async$self, node), newConfiguration), $async$visitForwardRule$1); + case 7: + // returning from await. + t3 = type$.String; + t4 = A.LinkedHashSet_LinkedHashSet$_empty(t3); + for (_i = 0; _i < t2; ++_i) { + variable = t1[_i]; + if (!variable.isGuarded) + t4.add$1(0, variable.name); + } + $async$self._async_evaluate$_removeUsedConfiguration$3$except(adjustedConfiguration, newConfiguration, t4); + t3 = A.LinkedHashSet_LinkedHashSet$_empty(t3); + for (_i = 0; _i < t2; ++_i) + t3.add$1(0, t1[_i].name); + for (t1 = newConfiguration._configuration$_values, t2 = J.toList$0$ax(t1.get$keys(t1)), t4 = t2.length, _i = 0; _i < t2.length; t2.length === t4 || (0, A.throwConcurrentModificationError)(t2), ++_i) { + $name = t2[_i]; + if (!t3.contains$1(0, $name)) + if (!t1.get$isEmpty(t1)) + t1.remove$1(0, $name); + } + $async$self._async_evaluate$_assertConfigurationIsEmpty$1(newConfiguration); + // goto join + $async$goto = 4; + break; + case 5: + // else + $async$self._async_evaluate$_configuration = adjustedConfiguration; + $async$goto = 8; + return A._asyncAwait($async$self._async_evaluate$_loadModule$4(t3, "@forward", node, new A._EvaluateVisitor_visitForwardRule_closure2($async$self, node)), $async$visitForwardRule$1); + case 8: + // returning from await. + $async$self._async_evaluate$_configuration = oldConfiguration; + case 4: + // join + $async$returnValue = null; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$visitForwardRule$1, $async$completer); + }, + _async_evaluate$_addForwardConfiguration$2(configuration, node) { + return this._addForwardConfiguration$body$_EvaluateVisitor(configuration, node); + }, + _addForwardConfiguration$body$_EvaluateVisitor(configuration, node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Configuration), + $async$returnValue, $async$self = this, t2, t3, t4, t5, _i, variable, t6, oldValue, t7, variableNodeWithSpan, t8, t1, newValues, $async$temp1, $async$temp2, $async$temp3; + var $async$_async_evaluate$_addForwardConfiguration$2 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = configuration._configuration$_values; + newValues = A.LinkedHashMap_LinkedHashMap$of(new A.UnmodifiableMapView(t1, type$.UnmodifiableMapView_String_ConfiguredValue), type$.String, type$.ConfiguredValue); + t2 = node.configuration, t3 = t2.length, t4 = type$._Future_Value, t5 = type$.Future_Value, _i = 0; + case 3: + // for condition + if (!(_i < t3)) { + // goto after for + $async$goto = 5; + break; + } + variable = t2[_i]; + if (variable.isGuarded) { + t6 = variable.name; + oldValue = t1.get$isEmpty(t1) ? null : t1.remove$1(0, t6); + if (oldValue != null) + t7 = !oldValue.value.$eq(0, B.C__SassNull); + else { + oldValue = null; + t7 = false; + } + if (t7) { + newValues.$indexSet(0, t6, oldValue); + // goto for update + $async$goto = 4; + break; + } + } + t6 = variable.expression; + variableNodeWithSpan = $async$self._async_evaluate$_expressionNode$1(t6); + t7 = variable.name; + t6 = t6.accept$1($async$self); + if (!t5._is(t6)) { + t8 = new A._Future($.Zone__current, t4); + t8._state = 8; + t8._resultOrListeners = t6; + t6 = t8; + } + $async$temp1 = newValues; + $async$temp2 = t7; + $async$temp3 = A; + $async$goto = 6; + return A._asyncAwait(t6, $async$_async_evaluate$_addForwardConfiguration$2); + case 6: + // returning from await. + $async$temp1.$indexSet(0, $async$temp2, new $async$temp3.ConfiguredValue($async$self._async_evaluate$_withoutSlash$2($async$result, variableNodeWithSpan), variable.span, variableNodeWithSpan)); + case 4: + // for update + ++_i; + // goto for condition + $async$goto = 3; + break; + case 5: + // after for + if (configuration instanceof A.ExplicitConfiguration || t1.get$isEmpty(t1)) { + $async$returnValue = new A.ExplicitConfiguration(node, newValues, null); + // goto return + $async$goto = 1; + break; + } else { + $async$returnValue = new A.Configuration(newValues, null); + // goto return + $async$goto = 1; + break; + } + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$_async_evaluate$_addForwardConfiguration$2, $async$completer); + }, + _async_evaluate$_registerCommentsForModule$1(module) { + var _this = this, _s5_ = "_root", + t1 = _this._async_evaluate$__root; + if (t1 == null) + return; + if (_this._async_evaluate$_assertInModule$2(t1, _s5_).children.get$length(0) === 0 || !module.get$transitivelyContainsCss()) + return; + t1 = _this._async_evaluate$_preModuleComments; + if (t1 == null) + t1 = _this._async_evaluate$_preModuleComments = A.LinkedHashMap_LinkedHashMap$_empty(type$.Module_AsyncCallable, type$.List_CssComment); + J.addAll$1$ax(t1.putIfAbsent$2(module, new A._EvaluateVisitor__registerCommentsForModule_closure0()), new A.UnmodifiableListView(J.cast$1$0$ax(_this._async_evaluate$_assertInModule$2(_this._async_evaluate$__root, _s5_).children._collection$_source, type$.CssComment), type$.UnmodifiableListView_CssComment)); + _this._async_evaluate$_assertInModule$2(_this._async_evaluate$__root, _s5_).clearChildren$0(); + _this._async_evaluate$__endOfImports = 0; + }, + _async_evaluate$_removeUsedConfiguration$3$except(upstream, downstream, except) { + var t1, t2, t3, t4, _i, $name; + for (t1 = upstream._configuration$_values, t2 = J.toList$0$ax(t1.get$keys(t1)), t3 = t2.length, t4 = downstream._configuration$_values, _i = 0; _i < t2.length; t2.length === t3 || (0, A.throwConcurrentModificationError)(t2), ++_i) { + $name = t2[_i]; + if (except.contains$1(0, $name)) + continue; + if (!t4.containsKey$1($name)) + if (!t1.get$isEmpty(t1)) + t1.remove$1(0, $name); + } + }, + _async_evaluate$_assertConfigurationIsEmpty$2$nameInError(configuration, nameInError) { + var t1, _0_0, $name, value; + if (!(configuration instanceof A.ExplicitConfiguration)) + return; + t1 = configuration._configuration$_values; + if (t1.get$isEmpty(t1)) + return; + t1 = A.MapExtensions_get_pairs(new A.UnmodifiableMapView(t1, type$.UnmodifiableMapView_String_ConfiguredValue), type$.String, type$.ConfiguredValue); + _0_0 = t1.get$first(t1); + $name = _0_0._0; + value = _0_0._1; + t1 = nameInError ? "$" + $name + string$.x20was_n : string$.This_v; + throw A.wrapException(this._async_evaluate$_exception$2(t1, value.configurationSpan)); + }, + _async_evaluate$_assertConfigurationIsEmpty$1(configuration) { + return this._async_evaluate$_assertConfigurationIsEmpty$2$nameInError(configuration, false); + }, + visitFunctionRule$1(node) { + return this.visitFunctionRule$body$_EvaluateVisitor(node); + }, + visitFunctionRule$body$_EvaluateVisitor(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.nullable_Value), + $async$returnValue, $async$self = this, t1, t2, t3, t4, index, t5; + var $async$visitFunctionRule$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self._async_evaluate$_environment; + t2 = t1.closure$0(); + t3 = $async$self._async_evaluate$_inDependency; + t4 = t1._async_environment$_functions; + index = t4.length - 1; + t5 = node.name; + t1._async_environment$_functionIndices.$indexSet(0, t5, index); + J.$indexSet$ax(t4[index], t5, new A.UserDefinedCallable(node, t2, t3, type$.UserDefinedCallable_AsyncEnvironment)); + $async$returnValue = null; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$visitFunctionRule$1, $async$completer); + }, + visitIfRule$1(node) { + return this.visitIfRule$body$_EvaluateVisitor(node); + }, + visitIfRule$body$_EvaluateVisitor(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.nullable_Value), + $async$returnValue, $async$self = this, t1, t2, _i, clauseToCheck, clause; + var $async$visitIfRule$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + clause = node.lastClause; + t1 = node.clauses, t2 = t1.length, _i = 0; + case 3: + // for condition + if (!(_i < t2)) { + // goto after for + $async$goto = 5; + break; + } + clauseToCheck = t1[_i]; + $async$goto = 6; + return A._asyncAwait(clauseToCheck.expression.accept$1($async$self), $async$visitIfRule$1); + case 6: + // returning from await. + if ($async$result.get$isTruthy()) { + clause = clauseToCheck; + // goto after for + $async$goto = 5; + break; + } + case 4: + // for update + ++_i; + // goto for condition + $async$goto = 3; + break; + case 5: + // after for + t1 = A.NullableExtension_andThen(clause, new A._EvaluateVisitor_visitIfRule_closure0($async$self)); + $async$goto = 7; + return A._asyncAwait(type$.Future_nullable_Value._is(t1) ? t1 : A._Future$value(t1, type$.nullable_Value), $async$visitIfRule$1); + case 7: + // returning from await. + $async$returnValue = $async$result; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$visitIfRule$1, $async$completer); + }, + visitImportRule$1(node) { + return this.visitImportRule$body$_EvaluateVisitor(node); + }, + visitImportRule$body$_EvaluateVisitor(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.nullable_Value), + $async$returnValue, $async$self = this, t1, t2, t3, _i, $import; + var $async$visitImportRule$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = node.imports, t2 = t1.length, t3 = type$.StaticImport, _i = 0; + case 3: + // for condition + if (!(_i < t2)) { + // goto after for + $async$goto = 5; + break; + } + $import = t1[_i]; + $async$goto = $import instanceof A.DynamicImport ? 6 : 8; + break; + case 6: + // then + $async$goto = 9; + return A._asyncAwait($async$self._async_evaluate$_visitDynamicImport$1($import), $async$visitImportRule$1); + case 9: + // returning from await. + // goto join + $async$goto = 7; + break; + case 8: + // else + $async$goto = 10; + return A._asyncAwait($async$self._visitStaticImport$1(t3._as($import)), $async$visitImportRule$1); + case 10: + // returning from await. + case 7: + // join + case 4: + // for update + ++_i; + // goto for condition + $async$goto = 3; + break; + case 5: + // after for + $async$returnValue = null; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$visitImportRule$1, $async$completer); + }, + _async_evaluate$_visitDynamicImport$1($import) { + return this._async_evaluate$_withStackFrame$1$3("@import", $import, new A._EvaluateVisitor__visitDynamicImport_closure0(this, $import), type$.void); + }, + _async_evaluate$_loadStylesheet$4$baseUrl$forImport(url, span, baseUrl, forImport) { + return this._loadStylesheet$body$_EvaluateVisitor(url, span, baseUrl, forImport); + }, + _async_evaluate$_loadStylesheet$3$baseUrl(url, span, baseUrl) { + return this._async_evaluate$_loadStylesheet$4$baseUrl$forImport(url, span, baseUrl, false); + }, + _async_evaluate$_loadStylesheet$3$forImport(url, span, forImport) { + return this._async_evaluate$_loadStylesheet$4$baseUrl$forImport(url, span, null, forImport); + }, + _loadStylesheet$body$_EvaluateVisitor(url, span, baseUrl, forImport) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Record_3_Stylesheet_and_nullable_AsyncImporter_importer_and_bool_isDependency), + $async$returnValue, $async$handler = 2, $async$currentError, $async$next = [], $async$self = this, importCache, _0_0, importer, canonicalUrl, originalUrl, _1_0, isDependency, stylesheet, _2_0, error, stackTrace, error0, stackTrace0, message, t1, t2, t3, t4, exception, message0, $async$exception; + var $async$_async_evaluate$_loadStylesheet$4$baseUrl$forImport = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) { + $async$currentError = $async$result; + $async$goto = $async$handler; + } + while (true) + switch ($async$goto) { + case 0: + // Function start + baseUrl = baseUrl; + $async$handler = 4; + $async$self._async_evaluate$_importSpan = span; + importCache = null; + _0_0 = $async$self._async_evaluate$_importCache; + $async$goto = _0_0 != null ? 7 : 8; + break; + case 7: + // then + importCache = _0_0; + if (baseUrl == null) { + t1 = $async$self._async_evaluate$_assertInModule$2($async$self._async_evaluate$__stylesheet, "_stylesheet").span; + baseUrl = t1.get$sourceUrl(t1); + } + importer = null; + canonicalUrl = null; + originalUrl = null; + $async$goto = 9; + return A._asyncAwait(J.canonicalize$4$baseImporter$baseUrl$forImport$x(importCache, A.Uri_parse(url), $async$self._async_evaluate$_importer, baseUrl, forImport), $async$_async_evaluate$_loadStylesheet$4$baseUrl$forImport); + case 9: + // returning from await. + _1_0 = $async$result; + $async$goto = type$.Record_3_nullable_Object_and_nullable_Object_and_nullable_Object_originalUrl._is(_1_0) ? 10 : 11; + break; + case 10: + // then + importer = _1_0._0; + canonicalUrl = _1_0._1; + originalUrl = _1_0._2; + $async$self._async_evaluate$_loadedUrls.add$1(0, canonicalUrl); + isDependency = $async$self._async_evaluate$_inDependency || !J.$eq$(importer, $async$self._async_evaluate$_importer); + stylesheet = null; + t1 = importCache; + t2 = importer; + t3 = canonicalUrl; + t4 = originalUrl; + $async$goto = 12; + return A._asyncAwait(t1.importCanonical$4$originalUrl$quiet(t2, t3, t4, $async$self._async_evaluate$_quietDeps && isDependency), $async$_async_evaluate$_loadStylesheet$4$baseUrl$forImport); + case 12: + // returning from await. + _2_0 = $async$result; + if (_2_0 != null) { + stylesheet = _2_0; + t1 = stylesheet; + t2 = importer; + $async$returnValue = new A._Record_3_importer_isDependency(t1, t2, isDependency); + $async$next = [1]; + // goto finally + $async$goto = 5; + break; + } + case 11: + // join + case 8: + // join + if (B.JSString_methods.startsWith$1(url, "package:") && true) + throw A.wrapException(string$.x22packa); + else + throw A.wrapException("Can't find stylesheet to import."); + $async$next.push(6); + // goto finally + $async$goto = 5; + break; + case 4: + // catch + $async$handler = 3; + $async$exception = $async$currentError; + t1 = A.unwrapException($async$exception); + if (t1 instanceof A.SassException) + throw $async$exception; + else if (t1 instanceof A.ArgumentError) { + error = t1; + stackTrace = A.getTraceFromException($async$exception); + A.throwWithTrace($async$self._async_evaluate$_exception$1(J.toString$0$(error)), error, stackTrace); + } else { + error0 = t1; + stackTrace0 = A.getTraceFromException($async$exception); + message = null; + try { + message = A._asString(J.get$message$x(error0)); + } catch (exception) { + message0 = J.toString$0$(error0); + message = message0; + } + A.throwWithTrace($async$self._async_evaluate$_exception$1(message), error0, stackTrace0); + } + $async$next.push(6); + // goto finally + $async$goto = 5; + break; + case 3: + // uncaught + $async$next = [2]; + case 5: + // finally + $async$handler = 2; + $async$self._async_evaluate$_importSpan = null; + // goto the next finally handler + $async$goto = $async$next.pop(); + break; + case 6: + // after finally + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + case 2: + // rethrow + return A._asyncRethrow($async$currentError, $async$completer); + } + }); + return A._asyncStartSync($async$_async_evaluate$_loadStylesheet$4$baseUrl$forImport, $async$completer); + }, + _visitStaticImport$1($import) { + return this._visitStaticImport$body$_EvaluateVisitor($import); + }, + _visitStaticImport$body$_EvaluateVisitor($import) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void), + $async$self = this, t1, t2, node, $async$temp1, $async$temp2; + var $async$_visitStaticImport$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$goto = 2; + return A._asyncAwait($async$self._async_evaluate$_interpolationToValue$1($import.url), $async$_visitStaticImport$1); + case 2: + // returning from await. + t1 = $async$result; + t2 = A.NullableExtension_andThen($import.modifiers, $async$self.get$_async_evaluate$_interpolationToValue()); + $async$temp1 = A; + $async$temp2 = t1; + $async$goto = 3; + return A._asyncAwait(type$.Future_nullable_CssValue_String._is(t2) ? t2 : A._Future$value(t2, type$.nullable_CssValue_String), $async$_visitStaticImport$1); + case 3: + // returning from await. + node = new $async$temp1.ModifiableCssImport($async$temp2, $async$result, $import.span); + if ($async$self._async_evaluate$_assertInModule$2($async$self._async_evaluate$__parent, "__parent") !== $async$self._async_evaluate$_assertInModule$2($async$self._async_evaluate$__root, "_root")) + $async$self._async_evaluate$_assertInModule$2($async$self._async_evaluate$__parent, "__parent").addChild$1(node); + else if ($async$self._async_evaluate$_assertInModule$2($async$self._async_evaluate$__endOfImports, "_endOfImports") === J.get$length$asx($async$self._async_evaluate$_assertInModule$2($async$self._async_evaluate$__root, "_root").children._collection$_source)) { + $async$self._async_evaluate$_assertInModule$2($async$self._async_evaluate$__root, "_root").addChild$1(node); + $async$self._async_evaluate$__endOfImports = $async$self._async_evaluate$_assertInModule$2($async$self._async_evaluate$__endOfImports, "_endOfImports") + 1; + } else { + t1 = $async$self._async_evaluate$_outOfOrderImports; + (t1 == null ? $async$self._async_evaluate$_outOfOrderImports = A._setArrayType([], type$.JSArray_ModifiableCssImport) : t1).push(node); + } + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$_visitStaticImport$1, $async$completer); + }, + _async_evaluate$_applyMixin$5(mixin, contentCallable, $arguments, nodeWithSpan, nodeWithSpanWithoutContent) { + return this._applyMixin$body$_EvaluateVisitor(mixin, contentCallable, $arguments, nodeWithSpan, nodeWithSpanWithoutContent); + }, + _applyMixin$body$_EvaluateVisitor(mixin, contentCallable, $arguments, nodeWithSpan, nodeWithSpanWithoutContent) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void), + $async$self = this, t1, _0_0, _1_8, t2; + var $async$_async_evaluate$_applyMixin$5 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + if (mixin == null) + throw A.wrapException($async$self._async_evaluate$_exception$2("Undefined mixin.", nodeWithSpan.get$span(nodeWithSpan))); + t1 = type$.AsyncBuiltInCallable._is(mixin); + $async$goto = t1 && !mixin.get$acceptsContent() && contentCallable != null ? 3 : 4; + break; + case 3: + // then + $async$goto = 5; + return A._asyncAwait($async$self._async_evaluate$_evaluateArguments$1($arguments), $async$_async_evaluate$_applyMixin$5); + case 5: + // returning from await. + t1 = $async$result._values; + _0_0 = mixin.callbackFor$2(J.get$length$asx(t1[2]), new A.MapKeySet(t1[0], type$.MapKeySet_String)); + throw A.wrapException(A.MultiSpanSassRuntimeException$("Mixin doesn't accept a content block.", nodeWithSpanWithoutContent.get$span(nodeWithSpanWithoutContent), "invocation", A.LinkedHashMap_LinkedHashMap$_literal([_0_0._0.get$spanWithName(), "declaration"], type$.FileSpan, type$.String), $async$self._async_evaluate$_stackTrace$1(nodeWithSpanWithoutContent.get$span(nodeWithSpanWithoutContent)), null)); + case 4: + // join + $async$goto = t1 ? 6 : 7; + break; + case 6: + // then + $async$goto = 8; + return A._asyncAwait($async$self._async_evaluate$_environment.withContent$2(contentCallable, new A._EvaluateVisitor__applyMixin_closure1($async$self, $arguments, mixin, nodeWithSpanWithoutContent)), $async$_async_evaluate$_applyMixin$5); + case 8: + // returning from await. + // goto break $label0$0 + $async$goto = 2; + break; + case 7: + // join + t1 = type$.UserDefinedCallable_AsyncEnvironment._is(mixin); + if (t1) { + _1_8 = mixin.declaration; + if (_1_8 instanceof A.MixinRule) + t2 = !type$.MixinRule._as(_1_8).get$hasContent() && contentCallable != null; + else + t2 = false; + } else + t2 = false; + if (t2) + throw A.wrapException(A.MultiSpanSassRuntimeException$("Mixin doesn't accept a content block.", nodeWithSpanWithoutContent.get$span(nodeWithSpanWithoutContent), "invocation", A.LinkedHashMap_LinkedHashMap$_literal([mixin.declaration.$arguments.get$spanWithName(), "declaration"], type$.FileSpan, type$.String), $async$self._async_evaluate$_stackTrace$1(nodeWithSpanWithoutContent.get$span(nodeWithSpanWithoutContent)), null)); + $async$goto = t1 ? 9 : 10; + break; + case 9: + // then + $async$goto = 11; + return A._asyncAwait($async$self._async_evaluate$_runUserDefinedCallable$1$4($arguments, mixin, nodeWithSpanWithoutContent, new A._EvaluateVisitor__applyMixin_closure2($async$self, contentCallable, mixin, nodeWithSpanWithoutContent), type$.Null), $async$_async_evaluate$_applyMixin$5); + case 11: + // returning from await. + // goto break $label0$0 + $async$goto = 2; + break; + case 10: + // join + throw A.wrapException(A.UnsupportedError$("Unknown callable type " + mixin.toString$0(0) + ".")); + case 2: + // break $label0$0 + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$_async_evaluate$_applyMixin$5, $async$completer); + }, + visitIncludeRule$1(node) { + return this.visitIncludeRule$body$_EvaluateVisitor(node); + }, + visitIncludeRule$body$_EvaluateVisitor(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.nullable_Value), + $async$returnValue, $async$self = this; + var $async$visitIncludeRule$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$goto = 3; + return A._asyncAwait($async$self._async_evaluate$_applyMixin$5($async$self._async_evaluate$_addExceptionSpan$2(node, new A._EvaluateVisitor_visitIncludeRule_closure2($async$self, node)), A.NullableExtension_andThen(node.content, new A._EvaluateVisitor_visitIncludeRule_closure3($async$self)), node.$arguments, node, new A._FakeAstNode(new A._EvaluateVisitor_visitIncludeRule_closure4(node))), $async$visitIncludeRule$1); + case 3: + // returning from await. + $async$returnValue = null; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$visitIncludeRule$1, $async$completer); + }, + visitMixinRule$1(node) { + return this.visitMixinRule$body$_EvaluateVisitor(node); + }, + visitMixinRule$body$_EvaluateVisitor(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.nullable_Value), + $async$returnValue, $async$self = this, t1, t2, t3, t4, index, t5; + var $async$visitMixinRule$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self._async_evaluate$_environment; + t2 = t1.closure$0(); + t3 = $async$self._async_evaluate$_inDependency; + t4 = t1._async_environment$_mixins; + index = t4.length - 1; + t5 = node.name; + t1._async_environment$_mixinIndices.$indexSet(0, t5, index); + J.$indexSet$ax(t4[index], t5, new A.UserDefinedCallable(node, t2, t3, type$.UserDefinedCallable_AsyncEnvironment)); + $async$returnValue = null; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$visitMixinRule$1, $async$completer); + }, + visitLoudComment$1(node) { + return this.visitLoudComment$body$_EvaluateVisitor(node); + }, + visitLoudComment$body$_EvaluateVisitor(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.nullable_Value), + $async$returnValue, $async$self = this, t1, $async$temp1, $async$temp2; + var $async$visitLoudComment$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + if ($async$self._async_evaluate$_inFunction) { + $async$returnValue = null; + // goto return + $async$goto = 1; + break; + } + if ($async$self._async_evaluate$_assertInModule$2($async$self._async_evaluate$__parent, "__parent") === $async$self._async_evaluate$_assertInModule$2($async$self._async_evaluate$__root, "_root") && $async$self._async_evaluate$_assertInModule$2($async$self._async_evaluate$__endOfImports, "_endOfImports") === J.get$length$asx($async$self._async_evaluate$_assertInModule$2($async$self._async_evaluate$__root, "_root").children._collection$_source)) + $async$self._async_evaluate$__endOfImports = $async$self._async_evaluate$_assertInModule$2($async$self._async_evaluate$__endOfImports, "_endOfImports") + 1; + t1 = node.text; + $async$temp1 = $async$self._async_evaluate$_assertInModule$2($async$self._async_evaluate$__parent, "__parent"); + $async$temp2 = A; + $async$goto = 3; + return A._asyncAwait($async$self._async_evaluate$_performInterpolation$1(t1), $async$visitLoudComment$1); + case 3: + // returning from await. + $async$temp1.addChild$1(new $async$temp2.ModifiableCssComment($async$result, t1.span)); + $async$returnValue = null; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$visitLoudComment$1, $async$completer); + }, + visitMediaRule$1(node) { + return this.visitMediaRule$body$_EvaluateVisitor(node); + }, + visitMediaRule$body$_EvaluateVisitor(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.nullable_Value), + $async$returnValue, $async$self = this, queries, mergedQueries, t1, mergedSources, t2, t3; + var $async$visitMediaRule$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + if ($async$self._async_evaluate$_declarationName != null) + throw A.wrapException($async$self._async_evaluate$_exception$2(string$.Media_, node.span)); + $async$goto = 3; + return A._asyncAwait($async$self._visitMediaQueries$1(node.query), $async$visitMediaRule$1); + case 3: + // returning from await. + queries = $async$result; + mergedQueries = A.NullableExtension_andThen($async$self._async_evaluate$_mediaQueries, new A._EvaluateVisitor_visitMediaRule_closure2($async$self, queries)); + t1 = mergedQueries == null; + if (!t1 && J.get$isEmpty$asx(mergedQueries)) { + $async$returnValue = null; + // goto return + $async$goto = 1; + break; + } + if (t1) + mergedSources = B.Set_empty1; + else { + t2 = $async$self._async_evaluate$_mediaQuerySources; + t2.toString; + t2 = A.LinkedHashSet_LinkedHashSet$of(t2, type$.CssMediaQuery); + t3 = $async$self._async_evaluate$_mediaQueries; + t3.toString; + t2.addAll$1(0, t3); + t2.addAll$1(0, queries); + mergedSources = t2; + } + t1 = t1 ? queries : mergedQueries; + $async$goto = 4; + return A._asyncAwait($async$self._async_evaluate$_withParent$2$4$scopeWhen$through(A.ModifiableCssMediaRule$(t1, node.span), new A._EvaluateVisitor_visitMediaRule_closure3($async$self, mergedQueries, queries, mergedSources, node), node.hasDeclarations, new A._EvaluateVisitor_visitMediaRule_closure4(mergedSources), type$.ModifiableCssMediaRule, type$.Null), $async$visitMediaRule$1); + case 4: + // returning from await. + $async$returnValue = null; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$visitMediaRule$1, $async$completer); + }, + _visitMediaQueries$1(interpolation) { + return this._visitMediaQueries$body$_EvaluateVisitor(interpolation); + }, + _visitMediaQueries$body$_EvaluateVisitor(interpolation) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.List_CssMediaQuery), + $async$returnValue, $async$self = this, _0_0; + var $async$_visitMediaQueries$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$goto = 3; + return A._asyncAwait($async$self._async_evaluate$_performInterpolationWithMap$2$warnForColor(interpolation, true), $async$_visitMediaQueries$1); + case 3: + // returning from await. + _0_0 = $async$result; + $async$returnValue = A.CssMediaQuery_parseList(_0_0._0, _0_0._1, $async$self._async_evaluate$_logger); + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$_visitMediaQueries$1, $async$completer); + }, + _async_evaluate$_mergeMediaQueries$2(queries1, queries2) { + var t1, t2, t3, t4, _0_0, result, t5, + queries = A._setArrayType([], type$.JSArray_CssMediaQuery); + for (t1 = J.get$iterator$ax(queries1), t2 = J.getInterceptor$ax(queries2); t1.moveNext$0();) { + t3 = t1.get$current(t1); + for (t4 = t2.get$iterator(queries2); t4.moveNext$0();) + $label0$1: { + _0_0 = t3.merge$1(t4.get$current(t4)); + if (B._SingletonCssMediaQueryMergeResult_0 === _0_0) + continue; + if (B._SingletonCssMediaQueryMergeResult_1 === _0_0) + return null; + if (_0_0 instanceof A.MediaQuerySuccessfulMergeResult) { + result = _0_0; + t5 = true; + } else { + result = null; + t5 = false; + } + if (t5) + queries.push(result.query); + break $label0$1; + } + } + return queries; + }, + visitReturnRule$1(node) { + return this.visitReturnRule$body$_EvaluateVisitor(node); + }, + visitReturnRule$body$_EvaluateVisitor(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Value), + $async$returnValue, $async$self = this, t1, t2; + var $async$visitReturnRule$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = node.expression; + t2 = t1.accept$1($async$self); + $async$goto = 3; + return A._asyncAwait(type$.Future_Value._is(t2) ? t2 : A._Future$value(t2, type$.Value), $async$visitReturnRule$1); + case 3: + // returning from await. + $async$returnValue = $async$self._async_evaluate$_withoutSlash$2($async$result, t1); + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$visitReturnRule$1, $async$completer); + }, + visitSilentComment$1(node) { + return this.visitSilentComment$body$_EvaluateVisitor(node); + }, + visitSilentComment$body$_EvaluateVisitor(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.nullable_Value), + $async$returnValue; + var $async$visitSilentComment$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$returnValue = null; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$visitSilentComment$1, $async$completer); + }, + visitStyleRule$1(node) { + return this.visitStyleRule$body$_EvaluateVisitor(node); + }, + visitStyleRule$body$_EvaluateVisitor(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.nullable_Value), + $async$returnValue, $async$self = this, t1, _0_0, selectorText, selectorMap, t2, parsedSelector, rule, oldAtRootExcludingStyleRule, t3, t4, t5, _i, complex, visitor, t6, t7, t8, t9; + var $async$visitStyleRule$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + if ($async$self._async_evaluate$_declarationName != null) + throw A.wrapException($async$self._async_evaluate$_exception$2(string$.Style_, node.span)); + t1 = node.selector; + $async$goto = 3; + return A._asyncAwait($async$self._async_evaluate$_performInterpolationWithMap$2$warnForColor(t1, true), $async$visitStyleRule$1); + case 3: + // returning from await. + _0_0 = $async$result; + selectorText = _0_0._0; + selectorMap = _0_0._1; + $async$goto = $async$self._async_evaluate$_inKeyframes ? 4 : 5; + break; + case 4: + // then + $async$goto = 6; + return A._asyncAwait($async$self._async_evaluate$_withParent$2$4$scopeWhen$through(A.ModifiableCssKeyframeBlock$(new A.CssValue(A.List_List$unmodifiable(A.KeyframeSelectorParser$(selectorText, selectorMap, $async$self._async_evaluate$_logger).parse$0(), type$.String), t1.span, type$.CssValue_List_String), node.span), new A._EvaluateVisitor_visitStyleRule_closure4($async$self, node), node.hasDeclarations, new A._EvaluateVisitor_visitStyleRule_closure5(), type$.ModifiableCssKeyframeBlock, type$.Null), $async$visitStyleRule$1); + case 6: + // returning from await. + $async$returnValue = null; + // goto return + $async$goto = 1; + break; + case 5: + // join + t1 = A.SelectorList_SelectorList$parse(selectorText, !$async$self._async_evaluate$_assertInModule$2($async$self._async_evaluate$__stylesheet, "_stylesheet").plainCss, !$async$self._async_evaluate$_assertInModule$2($async$self._async_evaluate$__stylesheet, "_stylesheet").plainCss, selectorMap, $async$self._async_evaluate$_logger); + t2 = $async$self._async_evaluate$_styleRuleIgnoringAtRoot; + t2 = t2 == null ? null : t2.originalSelector; + parsedSelector = t1.resolveParentSelectors$2$implicitParent(t2, !$async$self._async_evaluate$_atRootExcludingStyleRule); + rule = A.ModifiableCssStyleRule$($async$self._async_evaluate$_assertInModule$2($async$self._async_evaluate$__extensionStore, "_extensionStore").addSelector$2(parsedSelector, $async$self._async_evaluate$_mediaQueries), node.span, parsedSelector); + oldAtRootExcludingStyleRule = $async$self._async_evaluate$_atRootExcludingStyleRule; + $async$self._async_evaluate$_atRootExcludingStyleRule = false; + $async$goto = 7; + return A._asyncAwait($async$self._async_evaluate$_withParent$2$4$scopeWhen$through(rule, new A._EvaluateVisitor_visitStyleRule_closure6($async$self, rule, node), node.hasDeclarations, new A._EvaluateVisitor_visitStyleRule_closure7(), type$.ModifiableCssStyleRule, type$.Null), $async$visitStyleRule$1); + case 7: + // returning from await. + $async$self._async_evaluate$_atRootExcludingStyleRule = oldAtRootExcludingStyleRule; + if (!rule.accept$1(B._IsInvisibleVisitor_false_false)) + for (t1 = parsedSelector.components, t2 = t1.length, t3 = type$.SourceSpan, t4 = type$.String, t5 = rule.children, _i = 0; _i < t2; ++_i) { + complex = t1[_i]; + if (!complex.accept$1(B._IsBogusVisitor_true)) + continue; + if (complex.accept$1(B.C__IsUselessVisitor)) { + visitor = A._SerializeVisitor$(null, true, null, true, false, null, true); + complex.accept$1(visitor); + $async$self._async_evaluate$_warn$3('The selector "' + B.JSString_methods.trim$0(visitor._serialize$_buffer.toString$0(0)) + string$.x22x20is_ix20, A.SpanExtensions_trimRight(complex.span), B.Deprecation_vrR); + } else if (complex.leadingCombinators.length !== 0) { + visitor = A._SerializeVisitor$(null, true, null, true, false, null, true); + complex.accept$1(visitor); + $async$self._async_evaluate$_warn$3('The selector "' + B.JSString_methods.trim$0(visitor._serialize$_buffer.toString$0(0)) + string$.x22x20is_ix0a, A.SpanExtensions_trimRight(complex.span), B.Deprecation_vrR); + } else { + visitor = A._SerializeVisitor$(null, true, null, true, false, null, true); + complex.accept$1(visitor); + t6 = B.JSString_methods.trim$0(visitor._serialize$_buffer.toString$0(0)); + t7 = complex.accept$1(B._IsBogusVisitor_false) ? string$.x20It_wi : ""; + t8 = A.SpanExtensions_trimRight(complex.span); + if (t5.get$length(0) === 0) + A.throwExpression(A.IterableElementError_noElement()); + t9 = J.get$span$z(t5.$index(0, 0)); + $async$self._async_evaluate$_warn$3('The selector "' + t6 + string$.x22x20is_o + t7 + string$.x0aThis_, new A.MultiSpan(t8, "invalid selector", A.ConstantMap_ConstantMap$from(A.LinkedHashMap_LinkedHashMap$_literal([t9, "this is not a style rule" + (t5.every$1(t5, new A._EvaluateVisitor_visitStyleRule_closure8()) ? "\n(try converting to a //-style comment)" : "")], t3, t4), t3, t4)), B.Deprecation_vrR); + } + } + if (($async$self._async_evaluate$_atRootExcludingStyleRule ? null : $async$self._async_evaluate$_styleRuleIgnoringAtRoot) == null) { + t1 = $async$self._async_evaluate$_assertInModule$2($async$self._async_evaluate$__parent, "__parent").children; + t1 = !t1.get$isEmpty(t1); + } else + t1 = false; + if (t1) { + t1 = $async$self._async_evaluate$_assertInModule$2($async$self._async_evaluate$__parent, "__parent").children; + t1.get$last(t1).isGroupEnd = true; + } + $async$returnValue = null; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$visitStyleRule$1, $async$completer); + }, + visitSupportsRule$1(node) { + return this.visitSupportsRule$body$_EvaluateVisitor(node); + }, + visitSupportsRule$body$_EvaluateVisitor(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.nullable_Value), + $async$returnValue, $async$self = this, t1, $async$temp1, $async$temp2; + var $async$visitSupportsRule$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + if ($async$self._async_evaluate$_declarationName != null) + throw A.wrapException($async$self._async_evaluate$_exception$2(string$.Suppor, node.span)); + t1 = node.condition; + $async$temp1 = A; + $async$temp2 = A; + $async$goto = 4; + return A._asyncAwait($async$self._async_evaluate$_visitSupportsCondition$1(t1), $async$visitSupportsRule$1); + case 4: + // returning from await. + $async$goto = 3; + return A._asyncAwait($async$self._async_evaluate$_withParent$2$4$scopeWhen$through($async$temp1.ModifiableCssSupportsRule$(new $async$temp2.CssValue($async$result, t1.get$span(t1), type$.CssValue_String), node.span), new A._EvaluateVisitor_visitSupportsRule_closure1($async$self, node), node.hasDeclarations, new A._EvaluateVisitor_visitSupportsRule_closure2(), type$.ModifiableCssSupportsRule, type$.Null), $async$visitSupportsRule$1); + case 3: + // returning from await. + $async$returnValue = null; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$visitSupportsRule$1, $async$completer); + }, + _async_evaluate$_visitSupportsCondition$1(condition) { + return this._visitSupportsCondition$body$_EvaluateVisitor(condition); + }, + _visitSupportsCondition$body$_EvaluateVisitor(condition) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.String), + $async$returnValue, $async$self = this, t1, _box_0, $async$temp1, $async$temp2; + var $async$_async_evaluate$_visitSupportsCondition$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + _box_0 = {}; + $async$goto = condition instanceof A.SupportsOperation ? 4 : 5; + break; + case 4: + // then + t1 = condition.operator; + $async$temp1 = A; + $async$goto = 6; + return A._asyncAwait($async$self._async_evaluate$_parenthesize$2(condition.left, t1), $async$_async_evaluate$_visitSupportsCondition$1); + case 6: + // returning from await. + $async$temp1 = $async$temp1.S($async$result) + " " + t1 + " "; + $async$temp2 = A; + $async$goto = 7; + return A._asyncAwait($async$self._async_evaluate$_parenthesize$2(condition.right, t1), $async$_async_evaluate$_visitSupportsCondition$1); + case 7: + // returning from await. + t1 = $async$temp1 + $async$temp2.S($async$result); + // goto break $label0$0 + $async$goto = 3; + break; + case 5: + // join + $async$goto = condition instanceof A.SupportsNegation ? 8 : 9; + break; + case 8: + // then + $async$temp1 = A; + $async$goto = 10; + return A._asyncAwait($async$self._async_evaluate$_parenthesize$1(condition.condition), $async$_async_evaluate$_visitSupportsCondition$1); + case 10: + // returning from await. + t1 = "not " + $async$temp1.S($async$result); + // goto break $label0$0 + $async$goto = 3; + break; + case 9: + // join + $async$goto = condition instanceof A.SupportsInterpolation ? 11 : 12; + break; + case 11: + // then + $async$goto = 13; + return A._asyncAwait($async$self._evaluateToCss$2$quote(condition.expression, false), $async$_async_evaluate$_visitSupportsCondition$1); + case 13: + // returning from await. + t1 = $async$result; + // goto break $label0$0 + $async$goto = 3; + break; + case 12: + // join + _box_0.declaration = null; + $async$goto = condition instanceof A.SupportsDeclaration ? 14 : 15; + break; + case 14: + // then + _box_0.declaration = condition; + $async$goto = 16; + return A._asyncAwait($async$self._async_evaluate$_withSupportsDeclaration$1$1(new A._EvaluateVisitor__visitSupportsCondition_closure0(_box_0, $async$self), type$.String), $async$_async_evaluate$_visitSupportsCondition$1); + case 16: + // returning from await. + t1 = $async$result; + // goto break $label0$0 + $async$goto = 3; + break; + case 15: + // join + $async$goto = condition instanceof A.SupportsFunction ? 17 : 18; + break; + case 17: + // then + $async$temp1 = A; + $async$goto = 19; + return A._asyncAwait($async$self._async_evaluate$_performInterpolation$1(condition.name), $async$_async_evaluate$_visitSupportsCondition$1); + case 19: + // returning from await. + $async$temp1 = $async$temp1.S($async$result) + "("; + $async$temp2 = A; + $async$goto = 20; + return A._asyncAwait($async$self._async_evaluate$_performInterpolation$1(condition.$arguments), $async$_async_evaluate$_visitSupportsCondition$1); + case 20: + // returning from await. + t1 = $async$temp1 + $async$temp2.S($async$result) + ")"; + // goto break $label0$0 + $async$goto = 3; + break; + case 18: + // join + $async$goto = condition instanceof A.SupportsAnything ? 21 : 22; + break; + case 21: + // then + $async$temp1 = A; + $async$goto = 23; + return A._asyncAwait($async$self._async_evaluate$_performInterpolation$1(condition.contents), $async$_async_evaluate$_visitSupportsCondition$1); + case 23: + // returning from await. + t1 = "(" + $async$temp1.S($async$result) + ")"; + // goto break $label0$0 + $async$goto = 3; + break; + case 22: + // join + t1 = A.throwExpression(A.ArgumentError$("Unknown supports condition type " + A.getRuntimeTypeOfDartObject(condition).toString$0(0) + ".", null)); + case 3: + // break $label0$0 + $async$returnValue = t1; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$_async_evaluate$_visitSupportsCondition$1, $async$completer); + }, + _async_evaluate$_withSupportsDeclaration$1$1(callback, $T) { + return this._withSupportsDeclaration$body$_EvaluateVisitor(callback, $T, $T); + }, + _withSupportsDeclaration$body$_EvaluateVisitor(callback, $T, $async$type) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter($async$type), + $async$returnValue, $async$handler = 2, $async$currentError, $async$next = [], $async$self = this, t1, oldInSupportsDeclaration; + var $async$_async_evaluate$_withSupportsDeclaration$1$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) { + $async$currentError = $async$result; + $async$goto = $async$handler; + } + while (true) + switch ($async$goto) { + case 0: + // Function start + oldInSupportsDeclaration = $async$self._async_evaluate$_inSupportsDeclaration; + $async$self._async_evaluate$_inSupportsDeclaration = true; + $async$handler = 3; + t1 = callback.call$0(); + $async$goto = 6; + return A._asyncAwait($T._eval$1("Future<0>")._is(t1) ? t1 : A._Future$value(t1, $T), $async$_async_evaluate$_withSupportsDeclaration$1$1); + case 6: + // returning from await. + t1 = $async$result; + $async$returnValue = t1; + $async$next = [1]; + // goto finally + $async$goto = 4; + break; + $async$next.push(5); + // goto finally + $async$goto = 4; + break; + case 3: + // uncaught + $async$next = [2]; + case 4: + // finally + $async$handler = 2; + $async$self._async_evaluate$_inSupportsDeclaration = oldInSupportsDeclaration; + // goto the next finally handler + $async$goto = $async$next.pop(); + break; + case 5: + // after finally + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + case 2: + // rethrow + return A._asyncRethrow($async$currentError, $async$completer); + } + }); + return A._asyncStartSync($async$_async_evaluate$_withSupportsDeclaration$1$1, $async$completer); + }, + _async_evaluate$_parenthesize$2(condition, operator) { + return this._parenthesize$body$_EvaluateVisitor(condition, operator); + }, + _async_evaluate$_parenthesize$1(condition) { + return this._async_evaluate$_parenthesize$2(condition, null); + }, + _parenthesize$body$_EvaluateVisitor(condition, operator) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.String), + $async$returnValue, $async$self = this, t1, $async$temp1; + var $async$_async_evaluate$_parenthesize$2 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + if (!(condition instanceof A.SupportsNegation)) + if (condition instanceof A.SupportsOperation) + t1 = operator == null || operator !== condition.operator; + else + t1 = false; + else + t1 = true; + $async$goto = t1 ? 3 : 4; + break; + case 3: + // then + $async$temp1 = A; + $async$goto = 5; + return A._asyncAwait($async$self._async_evaluate$_visitSupportsCondition$1(condition), $async$_async_evaluate$_parenthesize$2); + case 5: + // returning from await. + $async$returnValue = "(" + $async$temp1.S($async$result) + ")"; + // goto return + $async$goto = 1; + break; + case 4: + // join + $async$goto = 6; + return A._asyncAwait($async$self._async_evaluate$_visitSupportsCondition$1(condition), $async$_async_evaluate$_parenthesize$2); + case 6: + // returning from await. + $async$returnValue = $async$result; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$_async_evaluate$_parenthesize$2, $async$completer); + }, + visitVariableDeclaration$1(node) { + return this.visitVariableDeclaration$body$_EvaluateVisitor(node); + }, + visitVariableDeclaration$body$_EvaluateVisitor(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.nullable_Value), + $async$returnValue, $async$self = this, t2, value, t1, $async$temp1, $async$temp2, $async$temp3; + var $async$visitVariableDeclaration$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = {}; + if (node.isGuarded) { + if (node.namespace == null && $async$self._async_evaluate$_environment._async_environment$_variables.length === 1) { + t1.override = null; + t2 = $async$self._async_evaluate$_configuration._configuration$_values; + t2 = t2.get$isEmpty(t2) ? null : t2.remove$1(0, node.name); + if (t2 != null) { + t1.override = t2; + t2 = !t2.value.$eq(0, B.C__SassNull); + } else + t2 = false; + if (t2) { + $async$self._async_evaluate$_addExceptionSpan$2(node, new A._EvaluateVisitor_visitVariableDeclaration_closure2(t1, $async$self, node)); + $async$returnValue = null; + // goto return + $async$goto = 1; + break; + } + } + value = $async$self._async_evaluate$_addExceptionSpan$2(node, new A._EvaluateVisitor_visitVariableDeclaration_closure3($async$self, node)); + if (value != null && !value.$eq(0, B.C__SassNull)) { + $async$returnValue = null; + // goto return + $async$goto = 1; + break; + } + } + if (node.isGlobal && !$async$self._async_evaluate$_environment.globalVariableExists$1(node.name)) { + t1 = $async$self._async_evaluate$_environment._async_environment$_variables.length === 1 ? string$.As_of_S : string$.As_of_R + A.declarationName(node.span) + ": null` at the stylesheet root."; + $async$self._async_evaluate$_warn$3(t1, node.span, B.Deprecation_hzy); + } + t1 = node.expression; + t2 = t1.accept$1($async$self); + $async$temp1 = node; + $async$temp2 = A; + $async$temp3 = node; + $async$goto = 3; + return A._asyncAwait(type$.Future_Value._is(t2) ? t2 : A._Future$value(t2, type$.Value), $async$visitVariableDeclaration$1); + case 3: + // returning from await. + $async$self._async_evaluate$_addExceptionSpan$2($async$temp1, new $async$temp2._EvaluateVisitor_visitVariableDeclaration_closure4($async$self, $async$temp3, $async$self._async_evaluate$_withoutSlash$2($async$result, t1))); + $async$returnValue = null; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$visitVariableDeclaration$1, $async$completer); + }, + visitUseRule$1(node) { + return this.visitUseRule$body$_EvaluateVisitor(node); + }, + visitUseRule$body$_EvaluateVisitor(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.nullable_Value), + $async$returnValue, $async$self = this, values, t3, t4, _i, variable, t5, variableNodeWithSpan, t6, t7, configuration, t1, t2, $async$temp1, $async$temp2, $async$temp3; + var $async$visitUseRule$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = node.configuration; + t2 = t1.length; + $async$goto = t2 !== 0 ? 3 : 5; + break; + case 3: + // then + values = A.LinkedHashMap_LinkedHashMap$_empty(type$.String, type$.ConfiguredValue); + t3 = type$._Future_Value, t4 = type$.Future_Value, _i = 0; + case 6: + // for condition + if (!(_i < t2)) { + // goto after for + $async$goto = 8; + break; + } + variable = t1[_i]; + t5 = variable.expression; + variableNodeWithSpan = $async$self._async_evaluate$_expressionNode$1(t5); + t6 = variable.name; + t5 = t5.accept$1($async$self); + if (!t4._is(t5)) { + t7 = new A._Future($.Zone__current, t3); + t7._state = 8; + t7._resultOrListeners = t5; + t5 = t7; + } + $async$temp1 = values; + $async$temp2 = t6; + $async$temp3 = A; + $async$goto = 9; + return A._asyncAwait(t5, $async$visitUseRule$1); + case 9: + // returning from await. + $async$temp1.$indexSet(0, $async$temp2, new $async$temp3.ConfiguredValue($async$self._async_evaluate$_withoutSlash$2($async$result, variableNodeWithSpan), variable.span, variableNodeWithSpan)); + case 7: + // for update + ++_i; + // goto for condition + $async$goto = 6; + break; + case 8: + // after for + configuration = new A.ExplicitConfiguration(node, values, null); + // goto join + $async$goto = 4; + break; + case 5: + // else + configuration = B.Configuration_Map_empty_null; + case 4: + // join + $async$goto = 10; + return A._asyncAwait($async$self._async_evaluate$_loadModule$5$configuration(node.url, "@use", node, new A._EvaluateVisitor_visitUseRule_closure0($async$self, node), configuration), $async$visitUseRule$1); + case 10: + // returning from await. + $async$self._async_evaluate$_assertConfigurationIsEmpty$1(configuration); + $async$returnValue = null; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$visitUseRule$1, $async$completer); + }, + visitWarnRule$1(node) { + return this.visitWarnRule$body$_EvaluateVisitor(node); + }, + visitWarnRule$body$_EvaluateVisitor(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.nullable_Value), + $async$returnValue, $async$self = this, value, t1; + var $async$visitWarnRule$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$goto = 3; + return A._asyncAwait($async$self._addExceptionSpanAsync$1$2(node, new A._EvaluateVisitor_visitWarnRule_closure0($async$self, node), type$.Value), $async$visitWarnRule$1); + case 3: + // returning from await. + value = $async$result; + t1 = value instanceof A.SassString ? value._string$_text : $async$self._async_evaluate$_serialize$2(value, node.expression); + $async$self._async_evaluate$_logger.warn$2$trace(0, t1, $async$self._async_evaluate$_stackTrace$1(node.span)); + $async$returnValue = null; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$visitWarnRule$1, $async$completer); + }, + visitWhileRule$1(node) { + return this._async_evaluate$_environment.scope$1$3$semiGlobal$when(new A._EvaluateVisitor_visitWhileRule_closure0(this, node), true, node.hasDeclarations, type$.nullable_Value); + }, + visitBinaryOperationExpression$1(node) { + var t1, _this = this; + if (_this._async_evaluate$_assertInModule$2(_this._async_evaluate$__stylesheet, "_stylesheet").plainCss) { + t1 = node.operator; + t1 = t1 !== B.BinaryOperator_2jN && t1 !== B.BinaryOperator_t8B; + } else + t1 = false; + if (t1) + throw A.wrapException(_this._async_evaluate$_exception$2("Operators aren't allowed in plain CSS.", node.get$operatorSpan())); + return _this._addExceptionSpanAsync$1$2(node, new A._EvaluateVisitor_visitBinaryOperationExpression_closure0(_this, node), type$.Value); + }, + _async_evaluate$_slash$3(left, right, node) { + var t1, right0, _1_2, _1_1, _1_2_isSet, _null = null, + result = left.dividedBy$1(right); + if (left instanceof A.SassNumber) { + t1 = type$.SassNumber; + t1._as(left); + if (right instanceof A.SassNumber) { + t1._as(right); + t1 = node.allowsSlash && this._async_evaluate$_operandAllowsSlash$1(node.left) && this._async_evaluate$_operandAllowsSlash$1(node.right); + right0 = right; + _1_2 = right0; + } else { + right0 = _null; + _1_2 = right; + t1 = false; + } + _1_1 = left; + _1_2_isSet = true; + } else { + right0 = _null; + _1_2 = right0; + _1_1 = left; + left = _1_2; + _1_2_isSet = false; + t1 = false; + } + if (t1) + return type$.SassNumber._as(result).withSlash$2(left, right0); + if (_1_1 instanceof A.SassNumber) + t1 = (_1_2_isSet ? _1_2 : right) instanceof A.SassNumber; + else + t1 = false; + if (t1) { + this._async_evaluate$_warn$3(string$.Using__o + A.S(new A._EvaluateVisitor__slash_recommendation0().call$1(node)) + " or " + A.expressionToCalc(node).toString$0(0) + string$.x0a_Morex20, node.get$span(0), B.Deprecation_xHK); + return result; + } + return result; + }, + _async_evaluate$_operandAllowsSlash$1(node) { + var t1, t2; + if (node instanceof A.FunctionExpression) + if (node.namespace == null) { + t1 = node.originalName; + if (B.Set_WfnXb.contains$1(0, A.stringReplaceAllUnchecked(t1, "_", "-").toLowerCase())) { + t2 = this._async_evaluate$_environment; + t1 = t2.getFunction$1(A.stringReplaceAllUnchecked(t1, "_", "-")) == null; + } else + t1 = false; + } else + t1 = false; + else + t1 = true; + return t1; + }, + visitValueExpression$1(node) { + return this.visitValueExpression$body$_EvaluateVisitor(node); + }, + visitValueExpression$body$_EvaluateVisitor(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Value), + $async$returnValue; + var $async$visitValueExpression$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$returnValue = node.value; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$visitValueExpression$1, $async$completer); + }, + visitVariableExpression$1(node) { + return this.visitVariableExpression$body$_EvaluateVisitor(node); + }, + visitVariableExpression$body$_EvaluateVisitor(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Value), + $async$returnValue, $async$self = this, result; + var $async$visitVariableExpression$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + result = $async$self._async_evaluate$_addExceptionSpan$2(node, new A._EvaluateVisitor_visitVariableExpression_closure0($async$self, node)); + if (result != null) { + $async$returnValue = result; + // goto return + $async$goto = 1; + break; + } + throw A.wrapException($async$self._async_evaluate$_exception$2("Undefined variable.", node.span)); + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$visitVariableExpression$1, $async$completer); + }, + visitUnaryOperationExpression$1(node) { + return this.visitUnaryOperationExpression$body$_EvaluateVisitor(node); + }, + visitUnaryOperationExpression$body$_EvaluateVisitor(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Value), + $async$returnValue, $async$self = this, $async$temp1, $async$temp2, $async$temp3; + var $async$visitUnaryOperationExpression$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$temp1 = node; + $async$temp2 = A; + $async$temp3 = node; + $async$goto = 3; + return A._asyncAwait(node.operand.accept$1($async$self), $async$visitUnaryOperationExpression$1); + case 3: + // returning from await. + $async$returnValue = $async$self._async_evaluate$_addExceptionSpan$2($async$temp1, new $async$temp2._EvaluateVisitor_visitUnaryOperationExpression_closure0($async$temp3, $async$result)); + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$visitUnaryOperationExpression$1, $async$completer); + }, + visitBooleanExpression$1(node) { + return this.visitBooleanExpression$body$_EvaluateVisitor(node); + }, + visitBooleanExpression$body$_EvaluateVisitor(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.SassBoolean), + $async$returnValue; + var $async$visitBooleanExpression$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$returnValue = node.value ? B.SassBoolean_true : B.SassBoolean_false; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$visitBooleanExpression$1, $async$completer); + }, + visitIfExpression$1(node) { + return this.visitIfExpression$body$_EvaluateVisitor(node); + }, + visitIfExpression$body$_EvaluateVisitor(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Value), + $async$returnValue, $async$self = this, condition, t1, ifTrue, ifFalse, result, _0_0, positional, named; + var $async$visitIfExpression$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$goto = 3; + return A._asyncAwait($async$self._async_evaluate$_evaluateMacroArguments$1(node), $async$visitIfExpression$1); + case 3: + // returning from await. + _0_0 = $async$result; + positional = _0_0._0; + named = _0_0._1; + $async$self._async_evaluate$_verifyArguments$4(J.get$length$asx(positional), named, $.$get$IfExpression_declaration(), node); + condition = A.ListExtensions_elementAtOrNull(positional, 0); + if (condition == null) { + t1 = named.$index(0, "condition"); + t1.toString; + condition = t1; + } + ifTrue = A.ListExtensions_elementAtOrNull(positional, 1); + if (ifTrue == null) { + t1 = named.$index(0, "if-true"); + t1.toString; + ifTrue = t1; + } + ifFalse = A.ListExtensions_elementAtOrNull(positional, 2); + if (ifFalse == null) { + t1 = named.$index(0, "if-false"); + t1.toString; + ifFalse = t1; + } + $async$goto = 4; + return A._asyncAwait(condition.accept$1($async$self), $async$visitIfExpression$1); + case 4: + // returning from await. + result = $async$result.get$isTruthy() ? ifTrue : ifFalse; + t1 = result.accept$1($async$self); + $async$goto = 5; + return A._asyncAwait(type$.Future_Value._is(t1) ? t1 : A._Future$value(t1, type$.Value), $async$visitIfExpression$1); + case 5: + // returning from await. + $async$returnValue = $async$self._async_evaluate$_withoutSlash$2($async$result, $async$self._async_evaluate$_expressionNode$1(result)); + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$visitIfExpression$1, $async$completer); + }, + visitNullExpression$1(node) { + return this.visitNullExpression$body$_EvaluateVisitor(node); + }, + visitNullExpression$body$_EvaluateVisitor(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Value), + $async$returnValue; + var $async$visitNullExpression$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$returnValue = B.C__SassNull; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$visitNullExpression$1, $async$completer); + }, + visitNumberExpression$1(node) { + return this.visitNumberExpression$body$_EvaluateVisitor(node); + }, + visitNumberExpression$body$_EvaluateVisitor(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.SassNumber), + $async$returnValue; + var $async$visitNumberExpression$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$returnValue = A.SassNumber_SassNumber(node.value, node.unit); + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$visitNumberExpression$1, $async$completer); + }, + visitParenthesizedExpression$1(node) { + var _this = this; + return _this._async_evaluate$_assertInModule$2(_this._async_evaluate$__stylesheet, "_stylesheet").plainCss ? A.throwExpression(_this._async_evaluate$_exception$2("Parentheses aren't allowed in plain CSS.", node.span)) : node.expression.accept$1(_this); + }, + visitColorExpression$1(node) { + return this.visitColorExpression$body$_EvaluateVisitor(node); + }, + visitColorExpression$body$_EvaluateVisitor(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.SassColor), + $async$returnValue; + var $async$visitColorExpression$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$returnValue = node.value; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$visitColorExpression$1, $async$completer); + }, + visitListExpression$1(node) { + return this.visitListExpression$body$_EvaluateVisitor(node); + }, + visitListExpression$body$_EvaluateVisitor(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.SassList), + $async$returnValue, $async$self = this, $async$temp1; + var $async$visitListExpression$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$temp1 = A; + $async$goto = 3; + return A._asyncAwait(A.mapAsync(node.contents, new A._EvaluateVisitor_visitListExpression_closure0($async$self), type$.Expression, type$.Value), $async$visitListExpression$1); + case 3: + // returning from await. + $async$returnValue = $async$temp1.SassList$($async$result, node.separator, node.hasBrackets); + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$visitListExpression$1, $async$completer); + }, + visitMapExpression$1(node) { + return this.visitMapExpression$body$_EvaluateVisitor(node); + }, + visitMapExpression$body$_EvaluateVisitor(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.SassMap), + $async$returnValue, $async$self = this, t2, t3, _i, t4, key, value, keyValue, valueValue, oldValueSpan, t1, map, keyNodes; + var $async$visitMapExpression$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = type$.Value; + map = A.LinkedHashMap_LinkedHashMap$_empty(t1, t1); + keyNodes = A.LinkedHashMap_LinkedHashMap$_empty(t1, type$.AstNode); + t2 = node.pairs, t3 = t2.length, _i = 0; + case 3: + // for condition + if (!(_i < t3)) { + // goto after for + $async$goto = 5; + break; + } + t4 = t2[_i]; + key = t4._0; + value = t4._1; + $async$goto = 6; + return A._asyncAwait(key.accept$1($async$self), $async$visitMapExpression$1); + case 6: + // returning from await. + keyValue = $async$result; + $async$goto = 7; + return A._asyncAwait(value.accept$1($async$self), $async$visitMapExpression$1); + case 7: + // returning from await. + valueValue = $async$result; + if (map.containsKey$1(keyValue)) { + t1 = keyNodes.$index(0, keyValue); + oldValueSpan = t1 == null ? null : t1.get$span(t1); + t1 = key.get$span(key); + t2 = A.LinkedHashMap_LinkedHashMap$_empty(type$.FileSpan, type$.String); + if (oldValueSpan != null) + t2.$indexSet(0, oldValueSpan, "first key"); + throw A.wrapException(A.MultiSpanSassRuntimeException$("Duplicate key.", t1, "second key", t2, $async$self._async_evaluate$_stackTrace$1(key.get$span(key)), null)); + } + map.$indexSet(0, keyValue, valueValue); + keyNodes.$indexSet(0, keyValue, key); + case 4: + // for update + ++_i; + // goto for condition + $async$goto = 3; + break; + case 5: + // after for + $async$returnValue = new A.SassMap(A.ConstantMap_ConstantMap$from(map, t1, t1)); + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$visitMapExpression$1, $async$completer); + }, + visitFunctionExpression$1(node) { + return this.visitFunctionExpression$body$_EvaluateVisitor(node); + }, + visitFunctionExpression$body$_EvaluateVisitor(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Value), + $async$returnValue, $async$self = this, t2, _0_0, t3, t4, oldInFunction, result, t1, $function; + var $async$visitFunctionExpression$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = {}; + $function = $async$self._async_evaluate$_assertInModule$2($async$self._async_evaluate$__stylesheet, "_stylesheet").plainCss ? null : $async$self._async_evaluate$_addExceptionSpan$2(node, new A._EvaluateVisitor_visitFunctionExpression_closure2($async$self, node)); + t1.$function = $function; + $async$goto = $function == null ? 3 : 4; + break; + case 3: + // then + if (node.namespace != null) + throw A.wrapException($async$self._async_evaluate$_exception$2("Undefined function.", node.span)); + t2 = node.originalName; + _0_0 = A.stringReplaceAllUnchecked(t2, "_", "-").toLowerCase(); + if ("min" === _0_0 || "max" === _0_0 || "round" === _0_0 || "abs" === _0_0) { + t3 = node.$arguments; + t4 = t3.named; + t3 = t4.get$isEmpty(t4) && t3.rest == null && B.JSArray_methods.every$1(t3.positional, new A._EvaluateVisitor_visitFunctionExpression_closure3()); + } else + t3 = false; + $async$goto = t3 ? 5 : 6; + break; + case 5: + // then + $async$goto = 7; + return A._asyncAwait($async$self._async_evaluate$_visitCalculation$2$inLegacySassFunction(node, true), $async$visitFunctionExpression$1); + case 7: + // returning from await. + $async$returnValue = $async$result; + // goto return + $async$goto = 1; + break; + case 6: + // join + $async$goto = "calc" === _0_0 || "clamp" === _0_0 || "hypot" === _0_0 || "sin" === _0_0 || "cos" === _0_0 || "tan" === _0_0 || "asin" === _0_0 || "acos" === _0_0 || "atan" === _0_0 || "sqrt" === _0_0 || "exp" === _0_0 || "sign" === _0_0 || "mod" === _0_0 || "rem" === _0_0 || "atan2" === _0_0 || "pow" === _0_0 || "log" === _0_0 ? 8 : 9; + break; + case 8: + // then + $async$goto = 10; + return A._asyncAwait($async$self._async_evaluate$_visitCalculation$1(node), $async$visitFunctionExpression$1); + case 10: + // returning from await. + $async$returnValue = $async$result; + // goto return + $async$goto = 1; + break; + case 9: + // join + if ($async$self._async_evaluate$_assertInModule$2($async$self._async_evaluate$__stylesheet, "_stylesheet").plainCss) + $function = null; + else { + t3 = $async$self._async_evaluate$_builtInFunctions.$index(0, A.stringReplaceAllUnchecked(t2, "_", "-")); + $function = t3; + } + t1.$function = $function == null ? new A.PlainCssCallable(t2) : $function; + case 4: + // join + oldInFunction = $async$self._async_evaluate$_inFunction; + $async$self._async_evaluate$_inFunction = true; + $async$goto = 11; + return A._asyncAwait($async$self._async_evaluate$_addErrorSpan$1$2(node, new A._EvaluateVisitor_visitFunctionExpression_closure4(t1, $async$self, node), type$.Value), $async$visitFunctionExpression$1); + case 11: + // returning from await. + result = $async$result; + $async$self._async_evaluate$_inFunction = oldInFunction; + $async$returnValue = result; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$visitFunctionExpression$1, $async$completer); + }, + _async_evaluate$_visitCalculation$2$inLegacySassFunction(node, inLegacySassFunction) { + return this._visitCalculation$body$_EvaluateVisitor(node, inLegacySassFunction); + }, + _async_evaluate$_visitCalculation$1(node) { + return this._async_evaluate$_visitCalculation$2$inLegacySassFunction(node, false); + }, + _visitCalculation$body$_EvaluateVisitor(node, inLegacySassFunction) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Value), + $async$returnValue, $async$next = [], $async$self = this, $arguments, oldCallableNode, t1, _0_0, error, stackTrace, t4, _i, exception, t2, t3, $async$temp1; + var $async$_async_evaluate$_visitCalculation$2$inLegacySassFunction = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t2 = node.$arguments; + t3 = t2.named; + if (t3.get$isNotEmpty(t3)) + throw A.wrapException($async$self._async_evaluate$_exception$2(string$.Keywor, node.span)); + else if (t2.rest != null) + throw A.wrapException($async$self._async_evaluate$_exception$2(string$.Rest_a, node.span)); + $async$self._async_evaluate$_checkCalculationArguments$1(node); + t3 = A._setArrayType([], type$.JSArray_Object); + t2 = t2.positional, t4 = t2.length, _i = 0; + case 3: + // for condition + if (!(_i < t4)) { + // goto after for + $async$goto = 5; + break; + } + $async$temp1 = t3; + $async$goto = 6; + return A._asyncAwait($async$self._async_evaluate$_visitCalculationExpression$2$inLegacySassFunction(t2[_i], inLegacySassFunction), $async$_async_evaluate$_visitCalculation$2$inLegacySassFunction); + case 6: + // returning from await. + $async$temp1.push($async$result); + case 4: + // for update + ++_i; + // goto for condition + $async$goto = 3; + break; + case 5: + // after for + $arguments = t3; + if ($async$self._async_evaluate$_inSupportsDeclaration) { + $async$returnValue = new A.SassCalculation(A.stringReplaceAllUnchecked(node.originalName, "_", "-"), A.List_List$unmodifiable($arguments, type$.Object)); + // goto return + $async$goto = 1; + break; + } + oldCallableNode = $async$self._async_evaluate$_callableNode; + $async$self._async_evaluate$_callableNode = node; + try { + t1 = null; + _0_0 = A.stringReplaceAllUnchecked(node.originalName, "_", "-").toLowerCase(); + $label0$0: { + if ("calc" === _0_0) { + t1 = A.SassCalculation_calc(J.$index$asx($arguments, 0)); + break $label0$0; + } + if ("sqrt" === _0_0) { + t1 = A.SassCalculation__singleArgument("sqrt", J.$index$asx($arguments, 0), A.number0__sqrt$closure(), true); + break $label0$0; + } + if ("sin" === _0_0) { + t1 = A.SassCalculation__singleArgument("sin", J.$index$asx($arguments, 0), A.number0__sin$closure(), false); + break $label0$0; + } + if ("cos" === _0_0) { + t1 = A.SassCalculation__singleArgument("cos", J.$index$asx($arguments, 0), A.number0__cos$closure(), false); + break $label0$0; + } + if ("tan" === _0_0) { + t1 = A.SassCalculation__singleArgument("tan", J.$index$asx($arguments, 0), A.number0__tan$closure(), false); + break $label0$0; + } + if ("asin" === _0_0) { + t1 = A.SassCalculation__singleArgument("asin", J.$index$asx($arguments, 0), A.number0__asin$closure(), true); + break $label0$0; + } + if ("acos" === _0_0) { + t1 = A.SassCalculation__singleArgument("acos", J.$index$asx($arguments, 0), A.number0__acos$closure(), true); + break $label0$0; + } + if ("atan" === _0_0) { + t1 = A.SassCalculation__singleArgument("atan", J.$index$asx($arguments, 0), A.number0__atan$closure(), true); + break $label0$0; + } + if ("abs" === _0_0) { + t1 = A.SassCalculation_abs(J.$index$asx($arguments, 0)); + break $label0$0; + } + if ("exp" === _0_0) { + t1 = A.SassCalculation_exp(J.$index$asx($arguments, 0)); + break $label0$0; + } + if ("sign" === _0_0) { + t1 = A.SassCalculation_sign(J.$index$asx($arguments, 0)); + break $label0$0; + } + if ("min" === _0_0) { + t1 = A.SassCalculation_min($arguments); + break $label0$0; + } + if ("max" === _0_0) { + t1 = A.SassCalculation_max($arguments); + break $label0$0; + } + if ("hypot" === _0_0) { + t1 = A.SassCalculation_hypot($arguments); + break $label0$0; + } + if ("pow" === _0_0) { + t1 = A.SassCalculation_pow(J.$index$asx($arguments, 0), A.ListExtensions_elementAtOrNull($arguments, 1)); + break $label0$0; + } + if ("atan2" === _0_0) { + t1 = A.SassCalculation_atan2(J.$index$asx($arguments, 0), A.ListExtensions_elementAtOrNull($arguments, 1)); + break $label0$0; + } + if ("log" === _0_0) { + t1 = A.SassCalculation_log(J.$index$asx($arguments, 0), A.ListExtensions_elementAtOrNull($arguments, 1)); + break $label0$0; + } + if ("mod" === _0_0) { + t1 = A.SassCalculation_mod(J.$index$asx($arguments, 0), A.ListExtensions_elementAtOrNull($arguments, 1)); + break $label0$0; + } + if ("rem" === _0_0) { + t1 = A.SassCalculation_rem(J.$index$asx($arguments, 0), A.ListExtensions_elementAtOrNull($arguments, 1)); + break $label0$0; + } + if ("round" === _0_0) { + t1 = A.SassCalculation_round(J.$index$asx($arguments, 0), A.ListExtensions_elementAtOrNull($arguments, 1), A.ListExtensions_elementAtOrNull($arguments, 2)); + break $label0$0; + } + if ("clamp" === _0_0) { + t1 = A.SassCalculation_clamp(J.$index$asx($arguments, 0), A.ListExtensions_elementAtOrNull($arguments, 1), A.ListExtensions_elementAtOrNull($arguments, 2)); + break $label0$0; + } + t3 = A.UnsupportedError$('Unknown calculation name "' + node.get$name(0) + '".'); + t1 = A.throwExpression(t3); + } + t1 = t1; + $async$returnValue = t1; + // goto return + $async$goto = 1; + break; + } catch (exception) { + t1 = A.unwrapException(exception); + if (t1 instanceof A.SassScriptException) { + error = t1; + stackTrace = A.getTraceFromException(exception); + if (B.JSString_methods.contains$1(error.message, "compatible")) + $async$self._async_evaluate$_verifyCompatibleNumbers$2($arguments, t2); + A.throwWithTrace($async$self._async_evaluate$_exception$2(error.message, node.span), error, stackTrace); + } else + throw exception; + } finally { + $async$self._async_evaluate$_callableNode = oldCallableNode; + } + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$_async_evaluate$_visitCalculation$2$inLegacySassFunction, $async$completer); + }, + _async_evaluate$_checkCalculationArguments$1(node) { + var _0_0, + check = new A._EvaluateVisitor__checkCalculationArguments_check0(this, node); + $label0$0: { + _0_0 = A.stringReplaceAllUnchecked(node.originalName, "_", "-").toLowerCase(); + if ("calc" === _0_0 || "sqrt" === _0_0 || "sin" === _0_0 || "cos" === _0_0 || "tan" === _0_0 || "asin" === _0_0 || "acos" === _0_0 || "atan" === _0_0 || "abs" === _0_0 || "exp" === _0_0 || "sign" === _0_0) { + check.call$1(1); + break $label0$0; + } + if ("min" === _0_0 || "max" === _0_0 || "hypot" === _0_0) { + check.call$0(); + break $label0$0; + } + if ("pow" === _0_0 || "atan2" === _0_0 || "log" === _0_0 || "mod" === _0_0 || "rem" === _0_0) { + check.call$1(2); + break $label0$0; + } + if ("round" === _0_0 || "clamp" === _0_0) { + check.call$1(3); + break $label0$0; + } + throw A.wrapException(A.UnsupportedError$('Unknown calculation name "' + node.get$name(0) + '".')); + } + }, + _async_evaluate$_verifyCompatibleNumbers$2(args, nodesWithSpans) { + var i, t1, _0_0, arg, number1, j, number2; + for (i = 0; t1 = args.length, i < t1; ++i) { + _0_0 = args[i]; + if (_0_0 instanceof A.SassNumber) { + t1 = _0_0.get$hasComplexUnits(); + arg = _0_0; + } else { + arg = null; + t1 = false; + } + if (t1) + throw A.wrapException(this._async_evaluate$_exception$2("Number " + A.S(arg) + " isn't compatible with CSS calculations.", J.get$span$z(nodesWithSpans[i]))); + } + for (i = 0; i < t1 - 1; ++i) { + number1 = args[i]; + if (!(number1 instanceof A.SassNumber)) + continue; + for (j = i + 1; t1 = args.length, j < t1; ++j) { + number2 = args[j]; + if (!(number2 instanceof A.SassNumber)) + continue; + if (number1.hasPossiblyCompatibleUnits$1(number2)) + continue; + throw A.wrapException(A.MultiSpanSassRuntimeException$(number1.toString$0(0) + " and " + number2.toString$0(0) + " are incompatible.", J.get$span$z(nodesWithSpans[i]), number1.toString$0(0), A.LinkedHashMap_LinkedHashMap$_literal([J.get$span$z(nodesWithSpans[j]), number2.toString$0(0)], type$.FileSpan, type$.String), this._async_evaluate$_stackTrace$1(J.get$span$z(nodesWithSpans[i])), null)); + } + } + }, + _async_evaluate$_visitCalculationExpression$2$inLegacySassFunction(node, inLegacySassFunction) { + return this._visitCalculationExpression$body$_EvaluateVisitor(node, inLegacySassFunction); + }, + _visitCalculationExpression$body$_EvaluateVisitor(node, inLegacySassFunction) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Object), + $async$returnValue, $async$self = this, inner, t1, result, t2, _0_0, _1_0, t3, _i, i, _box_0, $async$temp1; + var $async$_async_evaluate$_visitCalculationExpression$2$inLegacySassFunction = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + _box_0 = {}; + if (node instanceof A.ParenthesizedExpression) { + inner = node.expression; + t1 = true; + } else { + inner = null; + t1 = false; + } + $async$goto = t1 ? 3 : 4; + break; + case 3: + // then + $async$goto = 5; + return A._asyncAwait($async$self._async_evaluate$_visitCalculationExpression$2$inLegacySassFunction(inner, inLegacySassFunction), $async$_async_evaluate$_visitCalculationExpression$2$inLegacySassFunction); + case 5: + // returning from await. + result = $async$result; + $async$returnValue = result instanceof A.SassString ? new A.SassString("(" + result._string$_text + ")", false) : result; + // goto return + $async$goto = 1; + break; + case 4: + // join + $async$goto = node instanceof A.StringExpression && node.accept$1(new A._IsCalculationSafeVisitor()) ? 6 : 7; + break; + case 6: + // then + t1 = node.text; + t2 = t1.get$asPlain(); + _0_0 = t2 == null ? null : t2.toLowerCase(); + if ("pi" === _0_0) { + t1 = A.SassNumber_SassNumber(3.141592653589793, null); + // goto break $label0$0 + $async$goto = 8; + break; + } + if ("e" === _0_0) { + t1 = A.SassNumber_SassNumber(2.718281828459045, null); + // goto break $label0$0 + $async$goto = 8; + break; + } + if ("infinity" === _0_0) { + t1 = A.SassNumber_SassNumber(1 / 0, null); + // goto break $label0$0 + $async$goto = 8; + break; + } + if ("-infinity" === _0_0) { + t1 = A.SassNumber_SassNumber(-1 / 0, null); + // goto break $label0$0 + $async$goto = 8; + break; + } + if ("nan" === _0_0) { + t1 = A.SassNumber_SassNumber(0 / 0, null); + // goto break $label0$0 + $async$goto = 8; + break; + } + $async$temp1 = A; + $async$goto = 9; + return A._asyncAwait($async$self._async_evaluate$_performInterpolation$1(t1), $async$_async_evaluate$_visitCalculationExpression$2$inLegacySassFunction); + case 9: + // returning from await. + t1 = new $async$temp1.SassString($async$result, false); + // goto break $label0$0 + $async$goto = 8; + break; + case 8: + // break $label0$0 + $async$returnValue = t1; + // goto return + $async$goto = 1; + break; + case 7: + // join + _box_0.right = _box_0.left = _box_0.operator = null; + if (node instanceof A.BinaryOperationExpression) { + _box_0.operator = node.operator; + _box_0.left = node.left; + _box_0.right = node.right; + t1 = true; + } else + t1 = false; + $async$goto = t1 ? 10 : 11; + break; + case 10: + // then + $async$self._async_evaluate$_checkWhitespaceAroundCalculationOperator$1(node); + $async$goto = 12; + return A._asyncAwait($async$self._addExceptionSpanAsync$1$2(node, new A._EvaluateVisitor__visitCalculationExpression_closure0(_box_0, $async$self, node, inLegacySassFunction), type$.Object), $async$_async_evaluate$_visitCalculationExpression$2$inLegacySassFunction); + case 12: + // returning from await. + $async$returnValue = $async$result; + // goto return + $async$goto = 1; + break; + case 11: + // join + $async$goto = node instanceof A.NumberExpression || node instanceof A.VariableExpression || node instanceof A.FunctionExpression || node instanceof A.IfExpression ? 13 : 14; + break; + case 13: + // then + $async$goto = 15; + return A._asyncAwait(node.accept$1($async$self), $async$_async_evaluate$_visitCalculationExpression$2$inLegacySassFunction); + case 15: + // returning from await. + _1_0 = $async$result; + $label1$1: { + if (_1_0 instanceof A.SassNumber) { + t1 = _1_0; + break $label1$1; + } + if (_1_0 instanceof A.SassCalculation) { + t1 = _1_0; + break $label1$1; + } + if (_1_0 instanceof A.SassString) { + t1 = !_1_0._hasQuotes; + result = _1_0; + } else { + result = null; + t1 = false; + } + if (t1) { + t1 = result; + break $label1$1; + } + t1 = A.throwExpression($async$self._async_evaluate$_exception$2("Value " + _1_0.toString$0(0) + " can't be used in a calculation.", node.get$span(node))); + } + $async$returnValue = t1; + // goto return + $async$goto = 1; + break; + case 14: + // join + $async$goto = node instanceof A.ListExpression && !node.hasBrackets && B.ListSeparator_EVt === node.separator && node.contents.length >= 2 ? 16 : 17; + break; + case 16: + // then + t1 = A._setArrayType([], type$.JSArray_Object); + t2 = node.contents, t3 = t2.length, _i = 0; + case 18: + // for condition + if (!(_i < t3)) { + // goto after for + $async$goto = 20; + break; + } + $async$temp1 = t1; + $async$goto = 21; + return A._asyncAwait($async$self._async_evaluate$_visitCalculationExpression$2$inLegacySassFunction(t2[_i], inLegacySassFunction), $async$_async_evaluate$_visitCalculationExpression$2$inLegacySassFunction); + case 21: + // returning from await. + $async$temp1.push($async$result); + case 19: + // for update + ++_i; + // goto for condition + $async$goto = 18; + break; + case 20: + // after for + $async$self._async_evaluate$_checkAdjacentCalculationValues$2(t1, node); + for (i = 0; i < t1.length; ++i) { + t3 = t1[i]; + if (t3 instanceof A.CalculationOperation && t2[i] instanceof A.ParenthesizedExpression) + t1[i] = new A.SassString("(" + A.S(t3) + ")", false); + } + $async$returnValue = new A.SassString(B.JSArray_methods.join$1(t1, " "), false); + // goto return + $async$goto = 1; + break; + case 17: + // join + throw A.wrapException($async$self._async_evaluate$_exception$2(string$.This_e, node.get$span(node))); + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$_async_evaluate$_visitCalculationExpression$2$inLegacySassFunction, $async$completer); + }, + _async_evaluate$_checkWhitespaceAroundCalculationOperator$1(node) { + var t2, t3, t4, textBetweenOperands, first, last, + t1 = node.operator; + if (t1 !== B.BinaryOperator_anB && t1 !== B.BinaryOperator_olz) + return; + t1 = node.left; + t2 = t1.get$span(t1); + t2 = t2.get$file(t2); + t3 = node.right; + t4 = t3.get$span(t3); + if (t2 !== t4.get$file(t4)) + return; + t2 = t1.get$span(t1); + t2 = t2.get$end(t2); + t4 = t3.get$span(t3); + if (t2.offset >= t4.get$start(t4).offset) + return; + t2 = t1.get$span(t1); + t2 = t2.get$file(t2); + t1 = t1.get$span(t1); + t1 = t1.get$end(t1); + t3 = t3.get$span(t3); + textBetweenOperands = A.String_String$fromCharCodes(B.NativeUint32List_methods.sublist$2(t2._decodedChars, t1.offset, t3.get$start(t3).offset), 0, null); + first = textBetweenOperands.charCodeAt(0); + last = textBetweenOperands.charCodeAt(textBetweenOperands.length - 1); + if (first === 32 || first === 9 || first === 10 || first === 13 || first === 12 || first === 47) + t1 = !(last === 32 || last === 9 || last === 10 || last === 13 || last === 12 || last === 47); + else + t1 = true; + if (t1) + throw A.wrapException(this._async_evaluate$_exception$2(string$.x22x2b__an, node.get$operatorSpan())); + }, + _async_evaluate$_binaryOperatorToCalculationOperator$2(operator, node) { + var t1; + $label0$0: { + if (B.BinaryOperator_anB === operator) { + t1 = B.CalculationOperator_IyK; + break $label0$0; + } + if (B.BinaryOperator_olz === operator) { + t1 = B.CalculationOperator_2bx; + break $label0$0; + } + if (B.BinaryOperator_qN2 === operator) { + t1 = B.CalculationOperator_jFr; + break $label0$0; + } + if (B.BinaryOperator_t8B === operator) { + t1 = B.CalculationOperator_OvN; + break $label0$0; + } + t1 = A.throwExpression(this._async_evaluate$_exception$2(string$.This_o, node.get$operatorSpan())); + } + return t1; + }, + _async_evaluate$_checkAdjacentCalculationValues$2(elements, node) { + var t1, i, t2, previous, current, previousNode, currentNode, _0_2; + for (t1 = elements.length, i = 1; i < t1; ++i) { + t2 = i - 1; + previous = elements[t2]; + current = elements[i]; + if (previous instanceof A.SassString || current instanceof A.SassString) + continue; + t1 = node.contents; + previousNode = t1[t2]; + currentNode = t1[i]; + if (currentNode instanceof A.UnaryOperationExpression) { + _0_2 = currentNode.operator; + if (B.UnaryOperator_TLI !== _0_2) + t1 = B.UnaryOperator_gg4 === _0_2; + else + t1 = true; + } else + t1 = false; + if (!t1) + t1 = currentNode instanceof A.NumberExpression && currentNode.value < 0; + else + t1 = true; + if (t1) + throw A.wrapException(this._async_evaluate$_exception$2(string$.x22x2b__an, A.FileSpanExtension_subspan(currentNode.get$span(currentNode), 0, 1))); + else + throw A.wrapException(this._async_evaluate$_exception$2("Missing math operator.", previousNode.get$span(previousNode).expand$1(0, currentNode.get$span(currentNode)))); + } + }, + visitInterpolatedFunctionExpression$1(node) { + return this.visitInterpolatedFunctionExpression$body$_EvaluateVisitor(node); + }, + visitInterpolatedFunctionExpression$body$_EvaluateVisitor(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Value), + $async$returnValue, $async$self = this, result, t1, oldInFunction; + var $async$visitInterpolatedFunctionExpression$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$goto = 3; + return A._asyncAwait($async$self._async_evaluate$_performInterpolation$1(node.name), $async$visitInterpolatedFunctionExpression$1); + case 3: + // returning from await. + t1 = $async$result; + oldInFunction = $async$self._async_evaluate$_inFunction; + $async$self._async_evaluate$_inFunction = true; + $async$goto = 4; + return A._asyncAwait($async$self._async_evaluate$_addErrorSpan$1$2(node, new A._EvaluateVisitor_visitInterpolatedFunctionExpression_closure0($async$self, node, new A.PlainCssCallable(t1)), type$.Value), $async$visitInterpolatedFunctionExpression$1); + case 4: + // returning from await. + result = $async$result; + $async$self._async_evaluate$_inFunction = oldInFunction; + $async$returnValue = result; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$visitInterpolatedFunctionExpression$1, $async$completer); + }, + _async_evaluate$_runUserDefinedCallable$1$4($arguments, callable, nodeWithSpan, run, $V) { + return this._runUserDefinedCallable$body$_EvaluateVisitor($arguments, callable, nodeWithSpan, run, $V, $V); + }, + _runUserDefinedCallable$body$_EvaluateVisitor($arguments, callable, nodeWithSpan, run, $V, $async$type) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter($async$type), + $async$returnValue, $async$self = this, oldCallable, result, evaluated, $name; + var $async$_async_evaluate$_runUserDefinedCallable$1$4 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$goto = 3; + return A._asyncAwait($async$self._async_evaluate$_evaluateArguments$1($arguments), $async$_async_evaluate$_runUserDefinedCallable$1$4); + case 3: + // returning from await. + evaluated = $async$result; + $name = callable.declaration.name; + if ($name !== "@content") + $name += "()"; + oldCallable = $async$self._async_evaluate$_currentCallable; + $async$self._async_evaluate$_currentCallable = callable; + $async$goto = 4; + return A._asyncAwait($async$self._async_evaluate$_withStackFrame$1$3($name, nodeWithSpan, new A._EvaluateVisitor__runUserDefinedCallable_closure0($async$self, callable, evaluated, nodeWithSpan, run, $V), $V), $async$_async_evaluate$_runUserDefinedCallable$1$4); + case 4: + // returning from await. + result = $async$result; + $async$self._async_evaluate$_currentCallable = oldCallable; + $async$returnValue = result; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$_async_evaluate$_runUserDefinedCallable$1$4, $async$completer); + }, + _async_evaluate$_runFunctionCallable$3($arguments, callable, nodeWithSpan) { + return this._runFunctionCallable$body$_EvaluateVisitor($arguments, callable, nodeWithSpan); + }, + _runFunctionCallable$body$_EvaluateVisitor($arguments, callable, nodeWithSpan) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Value), + $async$returnValue, $async$handler = 2, $async$currentError, $async$self = this, buffer, first, argument, restArg, rest, error, t1, t2, _i, exception, $async$exception, $async$temp1, $async$temp2; + var $async$_async_evaluate$_runFunctionCallable$3 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) { + $async$currentError = $async$result; + $async$goto = $async$handler; + } + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$goto = type$.AsyncBuiltInCallable._is(callable) ? 3 : 5; + break; + case 3: + // then + $async$goto = 6; + return A._asyncAwait($async$self._async_evaluate$_runBuiltInCallable$3($arguments, callable, nodeWithSpan), $async$_async_evaluate$_runFunctionCallable$3); + case 6: + // returning from await. + $async$returnValue = $async$self._async_evaluate$_withoutSlash$2($async$result, nodeWithSpan); + // goto return + $async$goto = 1; + break; + // goto join + $async$goto = 4; + break; + case 5: + // else + $async$goto = type$.UserDefinedCallable_AsyncEnvironment._is(callable) ? 7 : 9; + break; + case 7: + // then + $async$goto = 10; + return A._asyncAwait($async$self._async_evaluate$_runUserDefinedCallable$1$4($arguments, callable, nodeWithSpan, new A._EvaluateVisitor__runFunctionCallable_closure0($async$self, callable), type$.Value), $async$_async_evaluate$_runFunctionCallable$3); + case 10: + // returning from await. + $async$returnValue = $async$result; + // goto return + $async$goto = 1; + break; + // goto join + $async$goto = 8; + break; + case 9: + // else + $async$goto = callable instanceof A.PlainCssCallable ? 11 : 13; + break; + case 11: + // then + t1 = $arguments.named; + if (t1.get$isNotEmpty(t1) || $arguments.keywordRest != null) + throw A.wrapException($async$self._async_evaluate$_exception$2(string$.Plain_, nodeWithSpan.get$span(nodeWithSpan))); + buffer = new A.StringBuffer(callable.name + "("); + $async$handler = 15; + first = true; + t1 = $arguments.positional, t2 = t1.length, _i = 0; + case 18: + // for condition + if (!(_i < t2)) { + // goto after for + $async$goto = 20; + break; + } + argument = t1[_i]; + if (first) + first = false; + else + buffer._contents += ", "; + $async$temp1 = buffer; + $async$temp2 = A; + $async$goto = 21; + return A._asyncAwait($async$self._evaluateToCss$1(argument), $async$_async_evaluate$_runFunctionCallable$3); + case 21: + // returning from await. + $async$temp1._contents += $async$temp2.S($async$result); + case 19: + // for update + ++_i; + // goto for condition + $async$goto = 18; + break; + case 20: + // after for + restArg = $arguments.rest; + $async$goto = restArg != null ? 22 : 23; + break; + case 22: + // then + $async$goto = 24; + return A._asyncAwait(restArg.accept$1($async$self), $async$_async_evaluate$_runFunctionCallable$3); + case 24: + // returning from await. + rest = $async$result; + if (!first) + buffer._contents += ", "; + buffer._contents += $async$self._async_evaluate$_serialize$2(rest, restArg); + case 23: + // join + $async$handler = 2; + // goto after finally + $async$goto = 17; + break; + case 15: + // catch + $async$handler = 14; + $async$exception = $async$currentError; + t1 = A.unwrapException($async$exception); + if (type$.SassRuntimeException._is(t1)) { + error = t1; + if (!B.JSString_methods.endsWith$1(error._span_exception$_message, "isn't a valid CSS value.")) + throw $async$exception; + throw A.wrapException(A.MultiSpanSassRuntimeException$(error._span_exception$_message, J.get$span$z(error), "value", A.LinkedHashMap_LinkedHashMap$_literal([nodeWithSpan.get$span(nodeWithSpan), "unknown function treated as plain CSS"], type$.FileSpan, type$.String), J.get$trace$z(error), null)); + } else + throw $async$exception; + // goto after finally + $async$goto = 17; + break; + case 14: + // uncaught + // goto rethrow + $async$goto = 2; + break; + case 17: + // after finally + buffer._contents += A.Primitives_stringFromCharCode(41); + t1 = buffer._contents; + $async$returnValue = new A.SassString(t1.charCodeAt(0) == 0 ? t1 : t1, false); + // goto return + $async$goto = 1; + break; + // goto join + $async$goto = 12; + break; + case 13: + // else + throw A.wrapException(A.ArgumentError$("Unknown callable type " + J.get$runtimeType$(callable).toString$0(0) + ".", null)); + case 12: + // join + case 8: + // join + case 4: + // join + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + case 2: + // rethrow + return A._asyncRethrow($async$currentError, $async$completer); + } + }); + return A._asyncStartSync($async$_async_evaluate$_runFunctionCallable$3, $async$completer); + }, + _async_evaluate$_runBuiltInCallable$3($arguments, callable, nodeWithSpan) { + return this._runBuiltInCallable$body$_EvaluateVisitor($arguments, callable, nodeWithSpan); + }, + _runBuiltInCallable$body$_EvaluateVisitor($arguments, callable, nodeWithSpan) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Value), + $async$returnValue, $async$handler = 2, $async$currentError, $async$self = this, result, error, stackTrace, message, namedSet, _0_0, declaredArguments, i, t1, t2, t3, argument, t4, t5, t6, t7, rest, argumentList, exception, message0, _box_0, evaluated, oldCallableNode, $async$exception; + var $async$_async_evaluate$_runBuiltInCallable$3 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) { + $async$currentError = $async$result; + $async$goto = $async$handler; + } + while (true) + switch ($async$goto) { + case 0: + // Function start + _box_0 = {}; + $async$goto = 3; + return A._asyncAwait($async$self._async_evaluate$_evaluateArguments$1($arguments), $async$_async_evaluate$_runBuiltInCallable$3); + case 3: + // returning from await. + evaluated = $async$result; + oldCallableNode = $async$self._async_evaluate$_callableNode; + $async$self._async_evaluate$_callableNode = nodeWithSpan; + namedSet = new A.MapKeySet(evaluated._values[0], type$.MapKeySet_String); + _box_0.callback = _box_0.overload = null; + _0_0 = callable.callbackFor$2(J.get$length$asx(evaluated._values[2]), namedSet); + _box_0.overload = _0_0._0; + _box_0.callback = _0_0._1; + $async$self._async_evaluate$_addExceptionSpan$2(nodeWithSpan, new A._EvaluateVisitor__runBuiltInCallable_closure2(_box_0, evaluated, namedSet)); + declaredArguments = _box_0.overload.$arguments; + i = J.get$length$asx(evaluated._values[2]), t1 = declaredArguments.length, t2 = type$._Future_Value, t3 = type$.Future_Value; + case 4: + // for condition + if (!(i < t1)) { + // goto after for + $async$goto = 6; + break; + } + argument = declaredArguments[i]; + t4 = evaluated._values[2]; + t5 = evaluated._values[0].remove$1(0, argument.name); + $async$goto = t5 == null ? 7 : 8; + break; + case 7: + // then + t5 = argument.defaultValue; + t6 = t5.accept$1($async$self); + if (!t3._is(t6)) { + t7 = new A._Future($.Zone__current, t2); + t7._state = 8; + t7._resultOrListeners = t6; + t6 = t7; + } + $async$goto = 9; + return A._asyncAwait(t6, $async$_async_evaluate$_runBuiltInCallable$3); + case 9: + // returning from await. + t5 = $async$self._async_evaluate$_withoutSlash$2($async$result, t5); + case 8: + // join + J.add$1$ax(t4, t5); + case 5: + // for update + ++i; + // goto for condition + $async$goto = 4; + break; + case 6: + // after for + if (_box_0.overload.restArgument != null) { + if (J.get$length$asx(evaluated._values[2]) > t1) { + rest = J.sublist$1$ax(evaluated._values[2], t1); + J.removeRange$2$ax(evaluated._values[2], t1, J.get$length$asx(evaluated._values[2])); + } else + rest = B.List_empty8; + t1 = evaluated._values[0]; + argumentList = A.SassArgumentList$(rest, t1, evaluated._values[4] === B.ListSeparator_undecided_null_undecided ? B.ListSeparator_rXA : evaluated._values[4]); + J.add$1$ax(evaluated._values[2], argumentList); + } else + argumentList = null; + result = null; + $async$handler = 11; + $async$goto = 14; + return A._asyncAwait($async$self._addExceptionSpanAsync$1$2(nodeWithSpan, new A._EvaluateVisitor__runBuiltInCallable_closure3(_box_0, evaluated), type$.Value), $async$_async_evaluate$_runBuiltInCallable$3); + case 14: + // returning from await. + result = $async$result; + $async$handler = 2; + // goto after finally + $async$goto = 13; + break; + case 11: + // catch + $async$handler = 10; + $async$exception = $async$currentError; + t1 = A.unwrapException($async$exception); + if (t1 instanceof A.SassException) + throw $async$exception; + else { + error = t1; + stackTrace = A.getTraceFromException($async$exception); + message = null; + try { + message = A._asString(J.get$message$x(error)); + } catch (exception) { + message0 = J.toString$0$(error); + message = message0; + } + A.throwWithTrace($async$self._async_evaluate$_exception$2(message, nodeWithSpan.get$span(nodeWithSpan)), error, stackTrace); + } + // goto after finally + $async$goto = 13; + break; + case 10: + // uncaught + // goto rethrow + $async$goto = 2; + break; + case 13: + // after finally + $async$self._async_evaluate$_callableNode = oldCallableNode; + if (argumentList == null) { + $async$returnValue = result; + // goto return + $async$goto = 1; + break; + } + t1 = evaluated._values[0]; + if (t1.get$isEmpty(t1)) { + $async$returnValue = result; + // goto return + $async$goto = 1; + break; + } + if (argumentList._wereKeywordsAccessed) { + $async$returnValue = result; + // goto return + $async$goto = 1; + break; + } + t1 = evaluated._values[0]; + t1 = A.pluralize("argument", J.get$length$asx(t1.get$keys(t1)), null); + t2 = evaluated._values[0]; + throw A.wrapException(A.MultiSpanSassRuntimeException$("No " + t1 + " named " + A.toSentence(J.map$1$1$ax(t2.get$keys(t2), new A._EvaluateVisitor__runBuiltInCallable_closure4(), type$.Object), "or") + ".", nodeWithSpan.get$span(nodeWithSpan), "invocation", A.LinkedHashMap_LinkedHashMap$_literal([_box_0.overload.get$spanWithName(), "declaration"], type$.FileSpan, type$.String), $async$self._async_evaluate$_stackTrace$1(nodeWithSpan.get$span(nodeWithSpan)), null)); + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + case 2: + // rethrow + return A._asyncRethrow($async$currentError, $async$completer); + } + }); + return A._asyncStartSync($async$_async_evaluate$_runBuiltInCallable$3, $async$completer); + }, + _async_evaluate$_evaluateArguments$1($arguments) { + return this._evaluateArguments$body$_EvaluateVisitor($arguments); + }, + _evaluateArguments$body$_EvaluateVisitor($arguments) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Record_5_Map_String_Value_named_and_Map_String_AstNode_namedNodes_and_List_Value_positional_and_List_AstNode_positionalNodes_and_ListSeparator_separator), + $async$returnValue, $async$self = this, t1, t2, t3, t4, _i, expression, nodeForSpan, t5, t6, named, namedNodes, $name, value, t7, restArgs, rest, restNodeForSpan, separator, keywordRestArgs, keywordRest, keywordRestNodeForSpan, positional, positionalNodes, $async$temp1, $async$temp2; + var $async$_async_evaluate$_evaluateArguments$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + positional = A._setArrayType([], type$.JSArray_Value); + positionalNodes = A._setArrayType([], type$.JSArray_AstNode); + t1 = $arguments.positional, t2 = t1.length, t3 = type$._Future_Value, t4 = type$.Future_Value, _i = 0; + case 3: + // for condition + if (!(_i < t2)) { + // goto after for + $async$goto = 5; + break; + } + expression = t1[_i]; + nodeForSpan = $async$self._async_evaluate$_expressionNode$1(expression); + t5 = expression.accept$1($async$self); + if (!t4._is(t5)) { + t6 = new A._Future($.Zone__current, t3); + t6._state = 8; + t6._resultOrListeners = t5; + t5 = t6; + } + $async$temp1 = positional; + $async$goto = 6; + return A._asyncAwait(t5, $async$_async_evaluate$_evaluateArguments$1); + case 6: + // returning from await. + $async$temp1.push($async$self._async_evaluate$_withoutSlash$2($async$result, nodeForSpan)); + positionalNodes.push(nodeForSpan); + case 4: + // for update + ++_i; + // goto for condition + $async$goto = 3; + break; + case 5: + // after for + t1 = type$.String; + named = A.LinkedHashMap_LinkedHashMap$_empty(t1, type$.Value); + t2 = type$.AstNode; + namedNodes = A.LinkedHashMap_LinkedHashMap$_empty(t1, t2); + t5 = A.MapExtensions_get_pairs($arguments.named, t1, type$.Expression), t5 = t5.get$iterator(t5); + case 7: + // for condition + if (!t5.moveNext$0()) { + // goto after for + $async$goto = 8; + break; + } + t6 = t5.get$current(t5); + $name = t6._0; + value = t6._1; + nodeForSpan = $async$self._async_evaluate$_expressionNode$1(value); + t6 = value.accept$1($async$self); + if (!t4._is(t6)) { + t7 = new A._Future($.Zone__current, t3); + t7._state = 8; + t7._resultOrListeners = t6; + t6 = t7; + } + $async$temp1 = named; + $async$temp2 = $name; + $async$goto = 9; + return A._asyncAwait(t6, $async$_async_evaluate$_evaluateArguments$1); + case 9: + // returning from await. + $async$temp1.$indexSet(0, $async$temp2, $async$self._async_evaluate$_withoutSlash$2($async$result, nodeForSpan)); + namedNodes.$indexSet(0, $name, nodeForSpan); + // goto for condition + $async$goto = 7; + break; + case 8: + // after for + restArgs = $arguments.rest; + if (restArgs == null) { + $async$returnValue = new A._Record_5_named_namedNodes_positional_positionalNodes_separator([named, namedNodes, positional, positionalNodes, B.ListSeparator_undecided_null_undecided]); + // goto return + $async$goto = 1; + break; + } + $async$goto = 10; + return A._asyncAwait(restArgs.accept$1($async$self), $async$_async_evaluate$_evaluateArguments$1); + case 10: + // returning from await. + rest = $async$result; + restNodeForSpan = $async$self._async_evaluate$_expressionNode$1(restArgs); + if (rest instanceof A.SassMap) { + $async$self._async_evaluate$_addRestMap$4(named, rest, restArgs, new A._EvaluateVisitor__evaluateArguments_closure3()); + t3 = A.LinkedHashMap_LinkedHashMap$_empty(t1, t2); + for (t4 = rest._map$_contents, t4 = J.get$iterator$ax(t4.get$keys(t4)), t5 = type$.SassString; t4.moveNext$0();) + t3.$indexSet(0, t5._as(t4.get$current(t4))._string$_text, restNodeForSpan); + namedNodes.addAll$1(0, t3); + separator = B.ListSeparator_undecided_null_undecided; + } else if (rest instanceof A.SassList) { + t3 = rest._list$_contents; + B.JSArray_methods.addAll$1(positional, new A.MappedListIterable(t3, new A._EvaluateVisitor__evaluateArguments_closure4($async$self, restNodeForSpan), A._arrayInstanceType(t3)._eval$1("MappedListIterable<1,Value>"))); + B.JSArray_methods.addAll$1(positionalNodes, A.List_List$filled(t3.length, restNodeForSpan, false, t2)); + separator = rest._separator; + if (rest instanceof A.SassArgumentList) { + rest._wereKeywordsAccessed = true; + rest._keywords.forEach$1(0, new A._EvaluateVisitor__evaluateArguments_closure5($async$self, named, restNodeForSpan, namedNodes)); + } + } else { + positional.push($async$self._async_evaluate$_withoutSlash$2(rest, restNodeForSpan)); + positionalNodes.push(restNodeForSpan); + separator = B.ListSeparator_undecided_null_undecided; + } + keywordRestArgs = $arguments.keywordRest; + if (keywordRestArgs == null) { + $async$returnValue = new A._Record_5_named_namedNodes_positional_positionalNodes_separator([named, namedNodes, positional, positionalNodes, separator]); + // goto return + $async$goto = 1; + break; + } + $async$goto = 11; + return A._asyncAwait(keywordRestArgs.accept$1($async$self), $async$_async_evaluate$_evaluateArguments$1); + case 11: + // returning from await. + keywordRest = $async$result; + keywordRestNodeForSpan = $async$self._async_evaluate$_expressionNode$1(keywordRestArgs); + if (keywordRest instanceof A.SassMap) { + $async$self._async_evaluate$_addRestMap$4(named, keywordRest, keywordRestArgs, new A._EvaluateVisitor__evaluateArguments_closure6()); + t1 = A.LinkedHashMap_LinkedHashMap$_empty(t1, t2); + for (t2 = keywordRest._map$_contents, t2 = J.get$iterator$ax(t2.get$keys(t2)), t3 = type$.SassString; t2.moveNext$0();) + t1.$indexSet(0, t3._as(t2.get$current(t2))._string$_text, keywordRestNodeForSpan); + namedNodes.addAll$1(0, t1); + $async$returnValue = new A._Record_5_named_namedNodes_positional_positionalNodes_separator([named, namedNodes, positional, positionalNodes, separator]); + // goto return + $async$goto = 1; + break; + } else + throw A.wrapException($async$self._async_evaluate$_exception$2(string$.Variabs + keywordRest.toString$0(0) + ").", keywordRestArgs.get$span(keywordRestArgs))); + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$_async_evaluate$_evaluateArguments$1, $async$completer); + }, + _async_evaluate$_evaluateMacroArguments$1(invocation) { + return this._evaluateMacroArguments$body$_EvaluateVisitor(invocation); + }, + _evaluateMacroArguments$body$_EvaluateVisitor(invocation) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Record_2_List_Expression_and_Map_String_Expression), + $async$returnValue, $async$self = this, t2, positional, named, rest, restNodeForSpan, keywordRestArgs_, keywordRest, keywordRestNodeForSpan, t1, restArgs_; + var $async$_async_evaluate$_evaluateMacroArguments$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = invocation.$arguments; + restArgs_ = t1.rest; + if (restArgs_ == null) { + $async$returnValue = new A._Record_2(t1.positional, t1.named); + // goto return + $async$goto = 1; + break; + } + t2 = t1.positional; + positional = A._setArrayType(t2.slice(0), A._arrayInstanceType(t2)); + named = A.LinkedHashMap_LinkedHashMap$of(t1.named, type$.String, type$.Expression); + $async$goto = 3; + return A._asyncAwait(restArgs_.accept$1($async$self), $async$_async_evaluate$_evaluateMacroArguments$1); + case 3: + // returning from await. + rest = $async$result; + restNodeForSpan = $async$self._async_evaluate$_expressionNode$1(restArgs_); + if (rest instanceof A.SassMap) + $async$self._async_evaluate$_addRestMap$4(named, rest, invocation, new A._EvaluateVisitor__evaluateMacroArguments_closure3(restArgs_)); + else if (rest instanceof A.SassList) { + t2 = rest._list$_contents; + B.JSArray_methods.addAll$1(positional, new A.MappedListIterable(t2, new A._EvaluateVisitor__evaluateMacroArguments_closure4($async$self, restNodeForSpan, restArgs_), A._arrayInstanceType(t2)._eval$1("MappedListIterable<1,Expression>"))); + if (rest instanceof A.SassArgumentList) { + rest._wereKeywordsAccessed = true; + rest._keywords.forEach$1(0, new A._EvaluateVisitor__evaluateMacroArguments_closure5($async$self, named, restNodeForSpan, restArgs_)); + } + } else + positional.push(new A.ValueExpression($async$self._async_evaluate$_withoutSlash$2(rest, restNodeForSpan), restArgs_.get$span(restArgs_))); + keywordRestArgs_ = t1.keywordRest; + if (keywordRestArgs_ == null) { + $async$returnValue = new A._Record_2(positional, named); + // goto return + $async$goto = 1; + break; + } + $async$goto = 4; + return A._asyncAwait(keywordRestArgs_.accept$1($async$self), $async$_async_evaluate$_evaluateMacroArguments$1); + case 4: + // returning from await. + keywordRest = $async$result; + keywordRestNodeForSpan = $async$self._async_evaluate$_expressionNode$1(keywordRestArgs_); + if (keywordRest instanceof A.SassMap) { + $async$self._async_evaluate$_addRestMap$4(named, keywordRest, invocation, new A._EvaluateVisitor__evaluateMacroArguments_closure6($async$self, keywordRestNodeForSpan, keywordRestArgs_)); + $async$returnValue = new A._Record_2(positional, named); + // goto return + $async$goto = 1; + break; + } else + throw A.wrapException($async$self._async_evaluate$_exception$2(string$.Variabs + keywordRest.toString$0(0) + ").", keywordRestArgs_.get$span(keywordRestArgs_))); + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$_async_evaluate$_evaluateMacroArguments$1, $async$completer); + }, + _async_evaluate$_addRestMap$1$4(values, map, nodeWithSpan, convert) { + map._map$_contents.forEach$1(0, new A._EvaluateVisitor__addRestMap_closure0(this, values, convert, this._async_evaluate$_expressionNode$1(nodeWithSpan), map, nodeWithSpan)); + }, + _async_evaluate$_addRestMap$4(values, map, nodeWithSpan, convert) { + return this._async_evaluate$_addRestMap$1$4(values, map, nodeWithSpan, convert, type$.dynamic); + }, + _async_evaluate$_verifyArguments$4(positional, named, $arguments, nodeWithSpan) { + return this._async_evaluate$_addExceptionSpan$2(nodeWithSpan, new A._EvaluateVisitor__verifyArguments_closure0($arguments, positional, named)); + }, + visitSelectorExpression$1(node) { + return this.visitSelectorExpression$body$_EvaluateVisitor(node); + }, + visitSelectorExpression$body$_EvaluateVisitor(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Value), + $async$returnValue, $async$self = this, t1; + var $async$visitSelectorExpression$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self._async_evaluate$_styleRuleIgnoringAtRoot; + t1 = t1 == null ? null : t1.originalSelector.get$asSassList(); + $async$returnValue = t1 == null ? B.C__SassNull : t1; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$visitSelectorExpression$1, $async$completer); + }, + visitStringExpression$1(node) { + return this.visitStringExpression$body$_EvaluateVisitor(node); + }, + visitStringExpression$body$_EvaluateVisitor(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.SassString), + $async$returnValue, $async$self = this, t1, t2, t3, t4, _i, value, t5, _0_0, text, oldInSupportsDeclaration; + var $async$visitStringExpression$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + oldInSupportsDeclaration = $async$self._async_evaluate$_inSupportsDeclaration; + $async$self._async_evaluate$_inSupportsDeclaration = false; + t1 = A._setArrayType([], type$.JSArray_String); + t2 = node.text.contents, t3 = t2.length, t4 = type$.Expression, _i = 0; + case 3: + // for condition + if (!(_i < t3)) { + // goto after for + $async$goto = 5; + break; + } + value = t2[_i]; + if (typeof value == "string") { + t5 = value; + // goto break $label0$0 + $async$goto = 6; + break; + } + $async$goto = t4._is(value) ? 7 : 8; + break; + case 7: + // then + $async$goto = 9; + return A._asyncAwait(value.accept$1($async$self), $async$visitStringExpression$1); + case 9: + // returning from await. + _0_0 = $async$result; + $label1$1: { + if (_0_0 instanceof A.SassString) { + text = _0_0._string$_text; + t5 = text; + break $label1$1; + } + t5 = $async$self._async_evaluate$_serialize$3$quote(_0_0, value, false); + break $label1$1; + } + // goto break $label0$0 + $async$goto = 6; + break; + case 8: + // join + t5 = A.throwExpression(A.UnsupportedError$("Unknown interpolation value " + A.S(value))); + case 6: + // break $label0$0 + t1.push(t5); + case 4: + // for update + ++_i; + // goto for condition + $async$goto = 3; + break; + case 5: + // after for + t1 = B.JSArray_methods.join$0(t1); + $async$self._async_evaluate$_inSupportsDeclaration = oldInSupportsDeclaration; + $async$returnValue = new A.SassString(t1, node.hasQuotes); + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$visitStringExpression$1, $async$completer); + }, + visitSupportsExpression$1(expression) { + return this.visitSupportsExpression$body$_EvaluateVisitor(expression); + }, + visitSupportsExpression$body$_EvaluateVisitor(expression) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.SassString), + $async$returnValue, $async$self = this, $async$temp1; + var $async$visitSupportsExpression$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$temp1 = A; + $async$goto = 3; + return A._asyncAwait($async$self._async_evaluate$_visitSupportsCondition$1(expression.condition), $async$visitSupportsExpression$1); + case 3: + // returning from await. + $async$returnValue = new $async$temp1.SassString($async$result, false); + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$visitSupportsExpression$1, $async$completer); + }, + visitCssAtRule$1(node) { + return this.visitCssAtRule$body$_EvaluateVisitor(node); + }, + visitCssAtRule$body$_EvaluateVisitor(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void), + $async$returnValue, $async$self = this, wasInKeyframes, wasInUnknownAtRule, t1; + var $async$visitCssAtRule$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + if ($async$self._async_evaluate$_declarationName != null) + throw A.wrapException($async$self._async_evaluate$_exception$2(string$.At_rul, node.span)); + if (node.isChildless) { + $async$self._async_evaluate$_assertInModule$2($async$self._async_evaluate$__parent, "__parent").addChild$1(A.ModifiableCssAtRule$(node.name, node.span, true, node.value)); + // goto return + $async$goto = 1; + break; + } + wasInKeyframes = $async$self._async_evaluate$_inKeyframes; + wasInUnknownAtRule = $async$self._async_evaluate$_inUnknownAtRule; + t1 = node.name; + if (A.unvendor(t1.value) === "keyframes") + $async$self._async_evaluate$_inKeyframes = true; + else + $async$self._async_evaluate$_inUnknownAtRule = true; + $async$goto = 3; + return A._asyncAwait($async$self._async_evaluate$_withParent$2$4$scopeWhen$through(A.ModifiableCssAtRule$(t1, node.span, false, node.value), new A._EvaluateVisitor_visitCssAtRule_closure1($async$self, node), false, new A._EvaluateVisitor_visitCssAtRule_closure2(), type$.ModifiableCssAtRule, type$.Null), $async$visitCssAtRule$1); + case 3: + // returning from await. + $async$self._async_evaluate$_inUnknownAtRule = wasInUnknownAtRule; + $async$self._async_evaluate$_inKeyframes = wasInKeyframes; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$visitCssAtRule$1, $async$completer); + }, + visitCssComment$1(node) { + return this.visitCssComment$body$_EvaluateVisitor(node); + }, + visitCssComment$body$_EvaluateVisitor(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void), + $async$self = this; + var $async$visitCssComment$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + if ($async$self._async_evaluate$_assertInModule$2($async$self._async_evaluate$__parent, "__parent") === $async$self._async_evaluate$_assertInModule$2($async$self._async_evaluate$__root, "_root") && $async$self._async_evaluate$_assertInModule$2($async$self._async_evaluate$__endOfImports, "_endOfImports") === J.get$length$asx($async$self._async_evaluate$_assertInModule$2($async$self._async_evaluate$__root, "_root").children._collection$_source)) + $async$self._async_evaluate$__endOfImports = $async$self._async_evaluate$_assertInModule$2($async$self._async_evaluate$__endOfImports, "_endOfImports") + 1; + $async$self._async_evaluate$_assertInModule$2($async$self._async_evaluate$__parent, "__parent").addChild$1(new A.ModifiableCssComment(node.text, node.span)); + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$visitCssComment$1, $async$completer); + }, + visitCssDeclaration$1(node) { + return this.visitCssDeclaration$body$_EvaluateVisitor(node); + }, + visitCssDeclaration$body$_EvaluateVisitor(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void), + $async$self = this; + var $async$visitCssDeclaration$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$self._async_evaluate$_assertInModule$2($async$self._async_evaluate$__parent, "__parent").addChild$1(A.ModifiableCssDeclaration$(node.name, node.value, node.span, node.parsedAsCustomProperty, node.valueSpanForMap)); + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$visitCssDeclaration$1, $async$completer); + }, + visitCssImport$1(node) { + return this.visitCssImport$body$_EvaluateVisitor(node); + }, + visitCssImport$body$_EvaluateVisitor(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void), + $async$self = this, t1, modifiableNode; + var $async$visitCssImport$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + modifiableNode = new A.ModifiableCssImport(node.url, node.modifiers, node.span); + if ($async$self._async_evaluate$_assertInModule$2($async$self._async_evaluate$__parent, "__parent") !== $async$self._async_evaluate$_assertInModule$2($async$self._async_evaluate$__root, "_root")) + $async$self._async_evaluate$_assertInModule$2($async$self._async_evaluate$__parent, "__parent").addChild$1(modifiableNode); + else if ($async$self._async_evaluate$_assertInModule$2($async$self._async_evaluate$__endOfImports, "_endOfImports") === J.get$length$asx($async$self._async_evaluate$_assertInModule$2($async$self._async_evaluate$__root, "_root").children._collection$_source)) { + $async$self._async_evaluate$_assertInModule$2($async$self._async_evaluate$__root, "_root").addChild$1(modifiableNode); + $async$self._async_evaluate$__endOfImports = $async$self._async_evaluate$_assertInModule$2($async$self._async_evaluate$__endOfImports, "_endOfImports") + 1; + } else { + t1 = $async$self._async_evaluate$_outOfOrderImports; + (t1 == null ? $async$self._async_evaluate$_outOfOrderImports = A._setArrayType([], type$.JSArray_ModifiableCssImport) : t1).push(modifiableNode); + } + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$visitCssImport$1, $async$completer); + }, + visitCssKeyframeBlock$1(node) { + return this.visitCssKeyframeBlock$body$_EvaluateVisitor(node); + }, + visitCssKeyframeBlock$body$_EvaluateVisitor(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void), + $async$self = this; + var $async$visitCssKeyframeBlock$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$goto = 2; + return A._asyncAwait($async$self._async_evaluate$_withParent$2$4$scopeWhen$through(A.ModifiableCssKeyframeBlock$(node.selector, node.span), new A._EvaluateVisitor_visitCssKeyframeBlock_closure1($async$self, node), false, new A._EvaluateVisitor_visitCssKeyframeBlock_closure2(), type$.ModifiableCssKeyframeBlock, type$.Null), $async$visitCssKeyframeBlock$1); + case 2: + // returning from await. + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$visitCssKeyframeBlock$1, $async$completer); + }, + visitCssMediaRule$1(node) { + return this.visitCssMediaRule$body$_EvaluateVisitor(node); + }, + visitCssMediaRule$body$_EvaluateVisitor(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void), + $async$returnValue, $async$self = this, mergedQueries, t1, mergedSources, t2, t3; + var $async$visitCssMediaRule$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + if ($async$self._async_evaluate$_declarationName != null) + throw A.wrapException($async$self._async_evaluate$_exception$2(string$.Media_, node.span)); + mergedQueries = A.NullableExtension_andThen($async$self._async_evaluate$_mediaQueries, new A._EvaluateVisitor_visitCssMediaRule_closure2($async$self, node)); + t1 = mergedQueries == null; + if (!t1 && J.get$isEmpty$asx(mergedQueries)) { + // goto return + $async$goto = 1; + break; + } + if (t1) + mergedSources = B.Set_empty1; + else { + t2 = $async$self._async_evaluate$_mediaQuerySources; + t2.toString; + t2 = A.LinkedHashSet_LinkedHashSet$of(t2, type$.CssMediaQuery); + t3 = $async$self._async_evaluate$_mediaQueries; + t3.toString; + t2.addAll$1(0, t3); + t2.addAll$1(0, node.queries); + mergedSources = t2; + } + t1 = t1 ? node.queries : mergedQueries; + $async$goto = 3; + return A._asyncAwait($async$self._async_evaluate$_withParent$2$4$scopeWhen$through(A.ModifiableCssMediaRule$(t1, node.span), new A._EvaluateVisitor_visitCssMediaRule_closure3($async$self, mergedQueries, node, mergedSources), false, new A._EvaluateVisitor_visitCssMediaRule_closure4(mergedSources), type$.ModifiableCssMediaRule, type$.Null), $async$visitCssMediaRule$1); + case 3: + // returning from await. + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$visitCssMediaRule$1, $async$completer); + }, + visitCssStyleRule$1(node) { + return this.visitCssStyleRule$body$_EvaluateVisitor(node); + }, + visitCssStyleRule$body$_EvaluateVisitor(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void), + $async$self = this, t1, styleRule, t2, t3, t4, originalSelector, rule, oldAtRootExcludingStyleRule, _0_1, lastChild; + var $async$visitCssStyleRule$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + if ($async$self._async_evaluate$_declarationName != null) + throw A.wrapException($async$self._async_evaluate$_exception$2(string$.Style_, node.span)); + t1 = $async$self._async_evaluate$_atRootExcludingStyleRule; + styleRule = t1 ? null : $async$self._async_evaluate$_styleRuleIgnoringAtRoot; + t2 = node._style_rule$_selector._box$_inner.value; + t3 = styleRule == null; + t4 = t3 ? null : styleRule.originalSelector; + originalSelector = t2.resolveParentSelectors$2$implicitParent(t4, !t1); + rule = A.ModifiableCssStyleRule$($async$self._async_evaluate$_assertInModule$2($async$self._async_evaluate$__extensionStore, "_extensionStore").addSelector$2(originalSelector, $async$self._async_evaluate$_mediaQueries), node.span, originalSelector); + oldAtRootExcludingStyleRule = $async$self._async_evaluate$_atRootExcludingStyleRule; + $async$self._async_evaluate$_atRootExcludingStyleRule = false; + $async$goto = 2; + return A._asyncAwait($async$self._async_evaluate$_withParent$2$4$scopeWhen$through(rule, new A._EvaluateVisitor_visitCssStyleRule_closure1($async$self, rule, node), false, new A._EvaluateVisitor_visitCssStyleRule_closure2(), type$.ModifiableCssStyleRule, type$.Null), $async$visitCssStyleRule$1); + case 2: + // returning from await. + $async$self._async_evaluate$_atRootExcludingStyleRule = oldAtRootExcludingStyleRule; + t1 = $async$self._async_evaluate$_assertInModule$2($async$self._async_evaluate$__parent, "__parent").children._collection$_source; + t2 = J.getInterceptor$asx(t1); + _0_1 = t2.get$length(t1); + if (_0_1 >= 1) { + lastChild = t2.elementAt$1(t1, _0_1 - 1); + t1 = t3; + } else { + lastChild = null; + t1 = false; + } + if (t1) + lastChild.isGroupEnd = true; + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$visitCssStyleRule$1, $async$completer); + }, + visitCssStylesheet$1(node) { + return this.visitCssStylesheet$body$_EvaluateVisitor(node); + }, + visitCssStylesheet$body$_EvaluateVisitor(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void), + $async$self = this, t1; + var $async$visitCssStylesheet$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = J.get$iterator$ax(node.get$children(node)); + case 2: + // for condition + if (!t1.moveNext$0()) { + // goto after for + $async$goto = 3; + break; + } + $async$goto = 4; + return A._asyncAwait(t1.get$current(t1).accept$1($async$self), $async$visitCssStylesheet$1); + case 4: + // returning from await. + // goto for condition + $async$goto = 2; + break; + case 3: + // after for + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$visitCssStylesheet$1, $async$completer); + }, + visitCssSupportsRule$1(node) { + return this.visitCssSupportsRule$body$_EvaluateVisitor(node); + }, + visitCssSupportsRule$body$_EvaluateVisitor(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void), + $async$self = this; + var $async$visitCssSupportsRule$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + if ($async$self._async_evaluate$_declarationName != null) + throw A.wrapException($async$self._async_evaluate$_exception$2(string$.Suppor, node.span)); + $async$goto = 2; + return A._asyncAwait($async$self._async_evaluate$_withParent$2$4$scopeWhen$through(A.ModifiableCssSupportsRule$(node.condition, node.span), new A._EvaluateVisitor_visitCssSupportsRule_closure1($async$self, node), false, new A._EvaluateVisitor_visitCssSupportsRule_closure2(), type$.ModifiableCssSupportsRule, type$.Null), $async$visitCssSupportsRule$1); + case 2: + // returning from await. + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$visitCssSupportsRule$1, $async$completer); + }, + _async_evaluate$_handleReturn$1$2(list, callback) { + return this._handleReturn$body$_EvaluateVisitor(list, callback); + }, + _async_evaluate$_handleReturn$2(list, callback) { + return this._async_evaluate$_handleReturn$1$2(list, callback, type$.dynamic); + }, + _handleReturn$body$_EvaluateVisitor(list, callback) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.nullable_Value), + $async$returnValue, t1, _i, _0_0; + var $async$_async_evaluate$_handleReturn$1$2 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = list.length, _i = 0; + case 3: + // for condition + if (!(_i < list.length)) { + // goto after for + $async$goto = 5; + break; + } + $async$goto = 6; + return A._asyncAwait(callback.call$1(list[_i]), $async$_async_evaluate$_handleReturn$1$2); + case 6: + // returning from await. + _0_0 = $async$result; + if (_0_0 != null) { + $async$returnValue = _0_0; + // goto return + $async$goto = 1; + break; + } + case 4: + // for update + list.length === t1 || (0, A.throwConcurrentModificationError)(list), ++_i; + // goto for condition + $async$goto = 3; + break; + case 5: + // after for + $async$returnValue = null; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$_async_evaluate$_handleReturn$1$2, $async$completer); + }, + _async_evaluate$_withEnvironment$1$2(environment, callback, $T) { + return this._withEnvironment$body$_EvaluateVisitor(environment, callback, $T, $T); + }, + _withEnvironment$body$_EvaluateVisitor(environment, callback, $T, $async$type) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter($async$type), + $async$returnValue, $async$self = this, result, oldEnvironment; + var $async$_async_evaluate$_withEnvironment$1$2 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + oldEnvironment = $async$self._async_evaluate$_environment; + $async$self._async_evaluate$_environment = environment; + $async$goto = 3; + return A._asyncAwait(callback.call$0(), $async$_async_evaluate$_withEnvironment$1$2); + case 3: + // returning from await. + result = $async$result; + $async$self._async_evaluate$_environment = oldEnvironment; + $async$returnValue = result; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$_async_evaluate$_withEnvironment$1$2, $async$completer); + }, + _async_evaluate$_interpolationToValue$3$trim$warnForColor(interpolation, trim, warnForColor) { + return this._interpolationToValue$body$_EvaluateVisitor(interpolation, trim, warnForColor); + }, + _async_evaluate$_interpolationToValue$1(interpolation) { + return this._async_evaluate$_interpolationToValue$3$trim$warnForColor(interpolation, false, false); + }, + _async_evaluate$_interpolationToValue$2$warnForColor(interpolation, warnForColor) { + return this._async_evaluate$_interpolationToValue$3$trim$warnForColor(interpolation, false, warnForColor); + }, + _interpolationToValue$body$_EvaluateVisitor(interpolation, trim, warnForColor) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.CssValue_String), + $async$returnValue, $async$self = this, result, t1; + var $async$_async_evaluate$_interpolationToValue$3$trim$warnForColor = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$goto = 3; + return A._asyncAwait($async$self._async_evaluate$_performInterpolation$2$warnForColor(interpolation, warnForColor), $async$_async_evaluate$_interpolationToValue$3$trim$warnForColor); + case 3: + // returning from await. + result = $async$result; + t1 = trim ? A.trimAscii(result, true) : result; + $async$returnValue = new A.CssValue(t1, interpolation.span, type$.CssValue_String); + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$_async_evaluate$_interpolationToValue$3$trim$warnForColor, $async$completer); + }, + _async_evaluate$_performInterpolation$2$warnForColor(interpolation, warnForColor) { + return this._performInterpolation$body$_EvaluateVisitor(interpolation, warnForColor); + }, + _async_evaluate$_performInterpolation$1(interpolation) { + return this._async_evaluate$_performInterpolation$2$warnForColor(interpolation, false); + }, + _performInterpolation$body$_EvaluateVisitor(interpolation, warnForColor) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.String), + $async$returnValue, $async$self = this; + var $async$_async_evaluate$_performInterpolation$2$warnForColor = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$goto = 3; + return A._asyncAwait($async$self._async_evaluate$_performInterpolationHelper$3$sourceMap$warnForColor(interpolation, false, warnForColor), $async$_async_evaluate$_performInterpolation$2$warnForColor); + case 3: + // returning from await. + $async$returnValue = $async$result._0; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$_async_evaluate$_performInterpolation$2$warnForColor, $async$completer); + }, + _async_evaluate$_performInterpolationWithMap$2$warnForColor(interpolation, warnForColor) { + return this._performInterpolationWithMap$body$_EvaluateVisitor(interpolation, true); + }, + _performInterpolationWithMap$body$_EvaluateVisitor(interpolation, warnForColor) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Record_2_String_and_InterpolationMap), + $async$returnValue, $async$self = this, _0_0, result, map; + var $async$_async_evaluate$_performInterpolationWithMap$2$warnForColor = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$goto = 3; + return A._asyncAwait($async$self._async_evaluate$_performInterpolationHelper$3$sourceMap$warnForColor(interpolation, true, true), $async$_async_evaluate$_performInterpolationWithMap$2$warnForColor); + case 3: + // returning from await. + _0_0 = $async$result; + result = _0_0._0; + map = _0_0._1; + map.toString; + $async$returnValue = new A._Record_2(result, map); + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$_async_evaluate$_performInterpolationWithMap$2$warnForColor, $async$completer); + }, + _async_evaluate$_performInterpolationHelper$3$sourceMap$warnForColor(interpolation, sourceMap, warnForColor) { + return this._performInterpolationHelper$body$_EvaluateVisitor(interpolation, sourceMap, warnForColor); + }, + _performInterpolationHelper$body$_EvaluateVisitor(interpolation, sourceMap, warnForColor) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Record_2_String_and_nullable_InterpolationMap), + $async$returnValue, $async$self = this, t1, t2, t3, t4, t5, t6, t7, first, _i, t8, value, result, t9, result0, targetLocations, oldInSupportsDeclaration; + var $async$_async_evaluate$_performInterpolationHelper$3$sourceMap$warnForColor = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + targetLocations = sourceMap ? A._setArrayType([], type$.JSArray_SourceLocation) : null; + oldInSupportsDeclaration = $async$self._async_evaluate$_inSupportsDeclaration; + $async$self._async_evaluate$_inSupportsDeclaration = false; + t1 = interpolation.contents, t2 = t1.length, t3 = type$.Expression, t4 = targetLocations == null, t5 = type$.JSArray_Object, t6 = interpolation.span, t7 = type$.Object, first = true, _i = 0, t8 = ""; + case 3: + // for condition + if (!(_i < t2)) { + // goto after for + $async$goto = 5; + break; + } + value = t1[_i]; + if (!first) + if (!t4) + targetLocations.push(A.SourceLocation$(t8.length, null, null, null)); + if (typeof value == "string") { + t8 += value; + // goto for update + $async$goto = 4; + break; + } + t3._as(value); + $async$goto = 6; + return A._asyncAwait(value.accept$1($async$self), $async$_async_evaluate$_performInterpolationHelper$3$sourceMap$warnForColor); + case 6: + // returning from await. + result = $async$result; + if (warnForColor && $.$get$namesByColor().containsKey$1(result)) { + t9 = A._setArrayType([""], t5); + result0 = A.List_List$from(t9, false, t7); + result0.fixed$length = Array; + result0.immutable$list = Array; + result0 = new A.Interpolation(result0, t6); + result0.Interpolation$2(t9, t6); + t9 = $.$get$namesByColor(); + $async$self._async_evaluate$_warn$2(string$.You_pr + A.S(t9.$index(0, result)) + string$.x20in_in + result.toString$0(0) + string$.x2c_whicw + A.S(t9.$index(0, result)) + string$.x22x29__If + new A.BinaryOperationExpression(B.BinaryOperator_anB, new A.StringExpression(result0, true), value, false).toString$0(0) + "'.", value.get$span(value)); + } + t8 += $async$self._async_evaluate$_serialize$3$quote(result, value, false); + case 4: + // for update + ++_i, first = false; + // goto for condition + $async$goto = 3; + break; + case 5: + // after for + $async$self._async_evaluate$_inSupportsDeclaration = oldInSupportsDeclaration; + $async$returnValue = new A._Record_2(t8.charCodeAt(0) == 0 ? t8 : t8, A.NullableExtension_andThen(targetLocations, new A._EvaluateVisitor__performInterpolationHelper_closure0(interpolation))); + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$_async_evaluate$_performInterpolationHelper$3$sourceMap$warnForColor, $async$completer); + }, + _evaluateToCss$2$quote(expression, quote) { + return this._evaluateToCss$body$_EvaluateVisitor(expression, quote); + }, + _evaluateToCss$1(expression) { + return this._evaluateToCss$2$quote(expression, true); + }, + _evaluateToCss$body$_EvaluateVisitor(expression, quote) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.String), + $async$returnValue, $async$self = this, t1; + var $async$_evaluateToCss$2$quote = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = expression.accept$1($async$self); + $async$goto = 3; + return A._asyncAwait(type$.Future_Value._is(t1) ? t1 : A._Future$value(t1, type$.Value), $async$_evaluateToCss$2$quote); + case 3: + // returning from await. + $async$returnValue = $async$self._async_evaluate$_serialize$3$quote($async$result, expression, quote); + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$_evaluateToCss$2$quote, $async$completer); + }, + _async_evaluate$_serialize$3$quote(value, nodeWithSpan, quote) { + return this._async_evaluate$_addExceptionSpan$2(nodeWithSpan, new A._EvaluateVisitor__serialize_closure0(value, quote)); + }, + _async_evaluate$_serialize$2(value, nodeWithSpan) { + return this._async_evaluate$_serialize$3$quote(value, nodeWithSpan, true); + }, + _async_evaluate$_expressionNode$1(expression) { + var t1; + if (expression instanceof A.VariableExpression) { + t1 = this._async_evaluate$_addExceptionSpan$2(expression, new A._EvaluateVisitor__expressionNode_closure0(this, expression)); + return t1 == null ? expression : t1; + } else + return expression; + }, + _async_evaluate$_withParent$2$4$scopeWhen$through(node, callback, scopeWhen, through, $S, $T) { + return this._withParent$body$_EvaluateVisitor(node, callback, scopeWhen, through, $S, $T, $T); + }, + _async_evaluate$_withParent$2$2(node, callback, $S, $T) { + return this._async_evaluate$_withParent$2$4$scopeWhen$through(node, callback, true, null, $S, $T); + }, + _async_evaluate$_withParent$2$3$scopeWhen(node, callback, scopeWhen, $S, $T) { + return this._async_evaluate$_withParent$2$4$scopeWhen$through(node, callback, scopeWhen, null, $S, $T); + }, + _withParent$body$_EvaluateVisitor(node, callback, scopeWhen, through, $S, $T, $async$type) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter($async$type), + $async$returnValue, $async$self = this, t1, result; + var $async$_async_evaluate$_withParent$2$4$scopeWhen$through = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$self._async_evaluate$_addChild$2$through(node, through); + t1 = $async$self._async_evaluate$_assertInModule$2($async$self._async_evaluate$__parent, "__parent"); + $async$self._async_evaluate$__parent = node; + $async$goto = 3; + return A._asyncAwait($async$self._async_evaluate$_environment.scope$1$2$when(callback, scopeWhen, $T), $async$_async_evaluate$_withParent$2$4$scopeWhen$through); + case 3: + // returning from await. + result = $async$result; + $async$self._async_evaluate$__parent = t1; + $async$returnValue = result; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$_async_evaluate$_withParent$2$4$scopeWhen$through, $async$completer); + }, + _async_evaluate$_addChild$2$through(node, through) { + var _0_0, grandparent, t1, + $parent = this._async_evaluate$_assertInModule$2(this._async_evaluate$__parent, "__parent"); + if (through != null) { + for (; through.call$1($parent); $parent = _0_0) { + _0_0 = $parent._parent; + if (_0_0 == null) + throw A.wrapException(A.ArgumentError$(string$.throug + node.toString$0(0) + ".", null)); + } + if ($parent.get$hasFollowingSibling()) { + grandparent = $parent._parent; + t1 = grandparent.children; + if ($parent.equalsIgnoringChildren$1(t1.get$last(t1))) + $parent = type$.ModifiableCssParentNode._as(t1.get$last(t1)); + else { + $parent = $parent.copyWithoutChildren$0(); + grandparent.addChild$1($parent); + } + } + } + $parent.addChild$1(node); + }, + _async_evaluate$_addChild$1(node) { + return this._async_evaluate$_addChild$2$through(node, null); + }, + _async_evaluate$_withStyleRule$1$2(rule, callback, $T) { + return this._withStyleRule$body$_EvaluateVisitor(rule, callback, $T, $T); + }, + _withStyleRule$body$_EvaluateVisitor(rule, callback, $T, $async$type) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter($async$type), + $async$returnValue, $async$self = this, result, oldRule; + var $async$_async_evaluate$_withStyleRule$1$2 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + oldRule = $async$self._async_evaluate$_styleRuleIgnoringAtRoot; + $async$self._async_evaluate$_styleRuleIgnoringAtRoot = rule; + $async$goto = 3; + return A._asyncAwait(callback.call$0(), $async$_async_evaluate$_withStyleRule$1$2); + case 3: + // returning from await. + result = $async$result; + $async$self._async_evaluate$_styleRuleIgnoringAtRoot = oldRule; + $async$returnValue = result; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$_async_evaluate$_withStyleRule$1$2, $async$completer); + }, + _async_evaluate$_withMediaQueries$1$3(queries, sources, callback, $T) { + return this._withMediaQueries$body$_EvaluateVisitor(queries, sources, callback, $T, $T); + }, + _withMediaQueries$body$_EvaluateVisitor(queries, sources, callback, $T, $async$type) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter($async$type), + $async$returnValue, $async$self = this, result, oldMediaQueries, oldSources; + var $async$_async_evaluate$_withMediaQueries$1$3 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + oldMediaQueries = $async$self._async_evaluate$_mediaQueries; + oldSources = $async$self._async_evaluate$_mediaQuerySources; + $async$self._async_evaluate$_mediaQueries = queries; + $async$self._async_evaluate$_mediaQuerySources = sources; + $async$goto = 3; + return A._asyncAwait(callback.call$0(), $async$_async_evaluate$_withMediaQueries$1$3); + case 3: + // returning from await. + result = $async$result; + $async$self._async_evaluate$_mediaQueries = oldMediaQueries; + $async$self._async_evaluate$_mediaQuerySources = oldSources; + $async$returnValue = result; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$_async_evaluate$_withMediaQueries$1$3, $async$completer); + }, + _async_evaluate$_withStackFrame$1$3(member, nodeWithSpan, callback, $T) { + return this._withStackFrame$body$_EvaluateVisitor(member, nodeWithSpan, callback, $T, $T); + }, + _withStackFrame$body$_EvaluateVisitor(member, nodeWithSpan, callback, $T, $async$type) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter($async$type), + $async$returnValue, $async$self = this, oldMember, result, t1; + var $async$_async_evaluate$_withStackFrame$1$3 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self._async_evaluate$_stack; + t1.push(new A._Record_2($async$self._async_evaluate$_member, nodeWithSpan)); + oldMember = $async$self._async_evaluate$_member; + $async$self._async_evaluate$_member = member; + $async$goto = 3; + return A._asyncAwait(callback.call$0(), $async$_async_evaluate$_withStackFrame$1$3); + case 3: + // returning from await. + result = $async$result; + $async$self._async_evaluate$_member = oldMember; + t1.pop(); + $async$returnValue = result; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$_async_evaluate$_withStackFrame$1$3, $async$completer); + }, + _async_evaluate$_withoutSlash$2(value, nodeForSpan) { + if (value instanceof A.SassNumber && value.asSlash != null && true) + this._async_evaluate$_warn$3(string$.Using__i + A.S(new A._EvaluateVisitor__withoutSlash_recommendation0().call$1(value)) + string$.x0a_Morex20, nodeForSpan.get$span(nodeForSpan), B.Deprecation_xHK); + return value.withoutSlash$0(); + }, + _async_evaluate$_stackFrame$2(member, span) { + return A.frameForSpan(span, member, A.NullableExtension_andThen(span.get$sourceUrl(span), new A._EvaluateVisitor__stackFrame_closure0(this))); + }, + _async_evaluate$_stackTrace$1(span) { + var t2, t3, _i, t4, nodeWithSpan, _this = this, + t1 = A._setArrayType([], type$.JSArray_Frame); + for (t2 = _this._async_evaluate$_stack, t3 = t2.length, _i = 0; _i < t2.length; t2.length === t3 || (0, A.throwConcurrentModificationError)(t2), ++_i) { + t4 = t2[_i]; + nodeWithSpan = t4._1; + t1.push(_this._async_evaluate$_stackFrame$2(t4._0, nodeWithSpan.get$span(nodeWithSpan))); + } + if (span != null) + t1.push(_this._async_evaluate$_stackFrame$2(_this._async_evaluate$_member, span)); + return A.Trace$(new A.ReversedListIterable(t1, type$.ReversedListIterable_Frame), null); + }, + _async_evaluate$_stackTrace$0() { + return this._async_evaluate$_stackTrace$1(null); + }, + _async_evaluate$_warn$3(message, span, deprecation) { + var t1, trace, _this = this; + if (_this._async_evaluate$_quietDeps) + if (!_this._async_evaluate$_inDependency) { + t1 = _this._async_evaluate$_currentCallable; + t1 = t1 == null ? null : t1.inDependency; + t1 = t1 === true; + } else + t1 = true; + else + t1 = false; + if (t1) + return; + if (!_this._async_evaluate$_warningsEmitted.add$1(0, new A._Record_2(message, span))) + return; + trace = _this._async_evaluate$_stackTrace$1(span); + t1 = _this._async_evaluate$_logger; + if (deprecation == null) + t1.warn$3$span$trace(0, message, span, trace); + else + A.WarnForDeprecation_warnForDeprecation(t1, deprecation, message, span, trace); + }, + _async_evaluate$_warn$2(message, span) { + return this._async_evaluate$_warn$3(message, span, null); + }, + _async_evaluate$_exception$2(message, span) { + var t1, t2; + if (span == null) { + t1 = B.JSArray_methods.get$last(this._async_evaluate$_stack)._1; + t1 = t1.get$span(t1); + } else + t1 = span; + t2 = this._async_evaluate$_stackTrace$1(span); + return new A.SassRuntimeException(t2, B.Set_empty, message, t1); + }, + _async_evaluate$_exception$1(message) { + return this._async_evaluate$_exception$2(message, null); + }, + _async_evaluate$_multiSpanException$3(message, primaryLabel, secondaryLabels) { + var t1 = B.JSArray_methods.get$last(this._async_evaluate$_stack)._1; + return A.MultiSpanSassRuntimeException$(message, t1.get$span(t1), primaryLabel, secondaryLabels, this._async_evaluate$_stackTrace$0(), null); + }, + _async_evaluate$_addExceptionSpan$1$2(nodeWithSpan, callback) { + var error, stackTrace, t1, exception, + addStackFrame = true; + try { + t1 = callback.call$0(); + return t1; + } catch (exception) { + t1 = A.unwrapException(exception); + if (t1 instanceof A.SassScriptException) { + error = t1; + stackTrace = A.getTraceFromException(exception); + t1 = error.withSpan$1(nodeWithSpan.get$span(nodeWithSpan)); + A.throwWithTrace(t1.withTrace$1(this._async_evaluate$_stackTrace$1(addStackFrame ? nodeWithSpan.get$span(nodeWithSpan) : null)), error, stackTrace); + } else + throw exception; + } + }, + _async_evaluate$_addExceptionSpan$2(nodeWithSpan, callback) { + return this._async_evaluate$_addExceptionSpan$1$2(nodeWithSpan, callback, type$.dynamic); + }, + _addExceptionSpanAsync$1$3$addStackFrame(nodeWithSpan, callback, addStackFrame, $T) { + return this._addExceptionSpanAsync$body$_EvaluateVisitor(nodeWithSpan, callback, addStackFrame, $T, $T); + }, + _addExceptionSpanAsync$1$2(nodeWithSpan, callback, $T) { + return this._addExceptionSpanAsync$1$3$addStackFrame(nodeWithSpan, callback, true, $T); + }, + _addExceptionSpanAsync$body$_EvaluateVisitor(nodeWithSpan, callback, addStackFrame, $T, $async$type) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter($async$type), + $async$returnValue, $async$handler = 2, $async$currentError, $async$self = this, error, stackTrace, t1, exception, $async$exception; + var $async$_addExceptionSpanAsync$1$3$addStackFrame = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) { + $async$currentError = $async$result; + $async$goto = $async$handler; + } + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$handler = 4; + t1 = callback.call$0(); + $async$goto = 7; + return A._asyncAwait($T._eval$1("Future<0>")._is(t1) ? t1 : A._Future$value(t1, $T), $async$_addExceptionSpanAsync$1$3$addStackFrame); + case 7: + // returning from await. + t1 = $async$result; + $async$returnValue = t1; + // goto return + $async$goto = 1; + break; + $async$handler = 2; + // goto after finally + $async$goto = 6; + break; + case 4: + // catch + $async$handler = 3; + $async$exception = $async$currentError; + t1 = A.unwrapException($async$exception); + if (t1 instanceof A.SassScriptException) { + error = t1; + stackTrace = A.getTraceFromException($async$exception); + t1 = error.withSpan$1(nodeWithSpan.get$span(nodeWithSpan)); + A.throwWithTrace(t1.withTrace$1($async$self._async_evaluate$_stackTrace$1(addStackFrame ? nodeWithSpan.get$span(nodeWithSpan) : null)), error, stackTrace); + } else + throw $async$exception; + // goto after finally + $async$goto = 6; + break; + case 3: + // uncaught + // goto rethrow + $async$goto = 2; + break; + case 6: + // after finally + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + case 2: + // rethrow + return A._asyncRethrow($async$currentError, $async$completer); + } + }); + return A._asyncStartSync($async$_addExceptionSpanAsync$1$3$addStackFrame, $async$completer); + }, + _async_evaluate$_addExceptionTrace$1$1(callback, $T) { + return this._addExceptionTrace$body$_EvaluateVisitor(callback, $T, $T); + }, + _addExceptionTrace$body$_EvaluateVisitor(callback, $T, $async$type) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter($async$type), + $async$returnValue, $async$handler = 2, $async$currentError, $async$self = this, error, stackTrace, t1, exception, t2, $async$exception; + var $async$_async_evaluate$_addExceptionTrace$1$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) { + $async$currentError = $async$result; + $async$goto = $async$handler; + } + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$handler = 4; + t1 = callback.call$0(); + $async$goto = 7; + return A._asyncAwait($T._eval$1("Future<0>")._is(t1) ? t1 : A._Future$value(t1, $T), $async$_async_evaluate$_addExceptionTrace$1$1); + case 7: + // returning from await. + t1 = $async$result; + $async$returnValue = t1; + // goto return + $async$goto = 1; + break; + $async$handler = 2; + // goto after finally + $async$goto = 6; + break; + case 4: + // catch + $async$handler = 3; + $async$exception = $async$currentError; + t1 = A.unwrapException($async$exception); + if (type$.SassRuntimeException._is(t1)) + throw $async$exception; + else if (t1 instanceof A.SassException) { + error = t1; + stackTrace = A.getTraceFromException($async$exception); + t1 = error; + t2 = J.getInterceptor$z(t1); + A.throwWithTrace(error.withTrace$1($async$self._async_evaluate$_stackTrace$1(A.SourceSpanException.prototype.get$span.call(t2, t1))), error, stackTrace); + } else + throw $async$exception; + // goto after finally + $async$goto = 6; + break; + case 3: + // uncaught + // goto rethrow + $async$goto = 2; + break; + case 6: + // after finally + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + case 2: + // rethrow + return A._asyncRethrow($async$currentError, $async$completer); + } + }); + return A._asyncStartSync($async$_async_evaluate$_addExceptionTrace$1$1, $async$completer); + }, + _async_evaluate$_addErrorSpan$1$2(nodeWithSpan, callback, $T) { + return this._addErrorSpan$body$_EvaluateVisitor(nodeWithSpan, callback, $T, $T); + }, + _addErrorSpan$body$_EvaluateVisitor(nodeWithSpan, callback, $T, $async$type) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter($async$type), + $async$returnValue, $async$handler = 2, $async$currentError, $async$self = this, error, stackTrace, t1, exception, t2, t3, $async$exception; + var $async$_async_evaluate$_addErrorSpan$1$2 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) { + $async$currentError = $async$result; + $async$goto = $async$handler; + } + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$handler = 4; + $async$goto = 7; + return A._asyncAwait(callback.call$0(), $async$_async_evaluate$_addErrorSpan$1$2); + case 7: + // returning from await. + t1 = $async$result; + $async$returnValue = t1; + // goto return + $async$goto = 1; + break; + $async$handler = 2; + // goto after finally + $async$goto = 6; + break; + case 4: + // catch + $async$handler = 3; + $async$exception = $async$currentError; + t1 = A.unwrapException($async$exception); + if (type$.SassRuntimeException._is(t1)) { + error = t1; + stackTrace = A.getTraceFromException($async$exception); + if (!B.JSString_methods.startsWith$1(J.get$span$z(error).get$text(), "@error")) + throw $async$exception; + t1 = error._span_exception$_message; + t2 = nodeWithSpan.get$span(nodeWithSpan); + t3 = $async$self._async_evaluate$_stackTrace$0(); + A.throwWithTrace(new A.SassRuntimeException(t3, B.Set_empty, t1, t2), error, stackTrace); + } else + throw $async$exception; + // goto after finally + $async$goto = 6; + break; + case 3: + // uncaught + // goto rethrow + $async$goto = 2; + break; + case 6: + // after finally + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + case 2: + // rethrow + return A._asyncRethrow($async$currentError, $async$completer); + } + }); + return A._asyncStartSync($async$_async_evaluate$_addErrorSpan$1$2, $async$completer); + } + }; + A._EvaluateVisitor_closure12.prototype = { + call$1($arguments) { + var module, t2, + t1 = J.getInterceptor$asx($arguments), + variable = t1.$index($arguments, 0).assertString$1("name"); + t1 = t1.$index($arguments, 1).get$realNull(); + module = t1 == null ? null : t1.assertString$1("module"); + t1 = this.$this._async_evaluate$_environment; + t2 = A.stringReplaceAllUnchecked(variable._string$_text, "_", "-"); + return t1.globalVariableExists$2$namespace(t2, module == null ? null : module._string$_text) ? B.SassBoolean_true : B.SassBoolean_false; + }, + $signature: 21 + }; + A._EvaluateVisitor_closure13.prototype = { + call$1($arguments) { + var variable = J.$index$asx($arguments, 0).assertString$1("name"), + t1 = this.$this._async_evaluate$_environment; + return t1.getVariable$1(A.stringReplaceAllUnchecked(variable._string$_text, "_", "-")) != null ? B.SassBoolean_true : B.SassBoolean_false; + }, + $signature: 21 + }; + A._EvaluateVisitor_closure14.prototype = { + call$1($arguments) { + var module, t2, t3, t4, + t1 = J.getInterceptor$asx($arguments), + variable = t1.$index($arguments, 0).assertString$1("name"); + t1 = t1.$index($arguments, 1).get$realNull(); + module = t1 == null ? null : t1.assertString$1("module"); + t1 = this.$this; + t2 = t1._async_evaluate$_environment; + t3 = variable._string$_text; + t4 = A.stringReplaceAllUnchecked(t3, "_", "-"); + return t2.getFunction$2$namespace(t4, module == null ? null : module._string$_text) != null || t1._async_evaluate$_builtInFunctions.containsKey$1(t3) ? B.SassBoolean_true : B.SassBoolean_false; + }, + $signature: 21 + }; + A._EvaluateVisitor_closure15.prototype = { + call$1($arguments) { + var module, t2, + t1 = J.getInterceptor$asx($arguments), + variable = t1.$index($arguments, 0).assertString$1("name"); + t1 = t1.$index($arguments, 1).get$realNull(); + module = t1 == null ? null : t1.assertString$1("module"); + t1 = this.$this._async_evaluate$_environment; + t2 = A.stringReplaceAllUnchecked(variable._string$_text, "_", "-"); + return t1.getMixin$2$namespace(t2, module == null ? null : module._string$_text) != null ? B.SassBoolean_true : B.SassBoolean_false; + }, + $signature: 21 + }; + A._EvaluateVisitor_closure16.prototype = { + call$1($arguments) { + var t1 = this.$this._async_evaluate$_environment; + if (!t1._async_environment$_inMixin) + throw A.wrapException(A.SassScriptException$(string$.conten, null)); + return t1._async_environment$_content != null ? B.SassBoolean_true : B.SassBoolean_false; + }, + $signature: 21 + }; + A._EvaluateVisitor_closure17.prototype = { + call$1($arguments) { + var t2, t3, t4, + t1 = J.$index$asx($arguments, 0).assertString$1("module")._string$_text, + module = this.$this._async_evaluate$_environment._async_environment$_modules.$index(0, t1); + if (module == null) + throw A.wrapException('There is no module with namespace "' + t1 + '".'); + t1 = type$.Value; + t2 = A.LinkedHashMap_LinkedHashMap$_empty(t1, t1); + for (t3 = A.MapExtensions_get_pairs(module.get$variables(), type$.String, t1), t3 = t3.get$iterator(t3); t3.moveNext$0();) { + t4 = t3.get$current(t3); + t2.$indexSet(0, new A.SassString(t4._0, true), t4._1); + } + return new A.SassMap(A.ConstantMap_ConstantMap$from(t2, t1, t1)); + }, + $signature: 34 + }; + A._EvaluateVisitor_closure18.prototype = { + call$1($arguments) { + var t2, t3, t4, + t1 = J.$index$asx($arguments, 0).assertString$1("module")._string$_text, + module = this.$this._async_evaluate$_environment._async_environment$_modules.$index(0, t1); + if (module == null) + throw A.wrapException('There is no module with namespace "' + t1 + '".'); + t1 = type$.Value; + t2 = A.LinkedHashMap_LinkedHashMap$_empty(t1, t1); + for (t3 = A.MapExtensions_get_pairs(module.get$functions(module), type$.String, type$.AsyncCallable), t3 = t3.get$iterator(t3); t3.moveNext$0();) { + t4 = t3.get$current(t3); + t2.$indexSet(0, new A.SassString(t4._0, true), new A.SassFunction(t4._1)); + } + return new A.SassMap(A.ConstantMap_ConstantMap$from(t2, t1, t1)); + }, + $signature: 34 + }; + A._EvaluateVisitor_closure19.prototype = { + call$1($arguments) { + var t2, t3, t4, + t1 = J.$index$asx($arguments, 0).assertString$1("module")._string$_text, + module = this.$this._async_evaluate$_environment._async_environment$_modules.$index(0, t1); + if (module == null) + throw A.wrapException('There is no module with namespace "' + t1 + '".'); + t1 = type$.Value; + t2 = A.LinkedHashMap_LinkedHashMap$_empty(t1, t1); + for (t3 = A.MapExtensions_get_pairs(module.get$mixins(), type$.String, type$.AsyncCallable), t3 = t3.get$iterator(t3); t3.moveNext$0();) { + t4 = t3.get$current(t3); + t2.$indexSet(0, new A.SassString(t4._0, true), new A.SassMixin(t4._1)); + } + return new A.SassMap(A.ConstantMap_ConstantMap$from(t2, t1, t1)); + }, + $signature: 34 + }; + A._EvaluateVisitor_closure20.prototype = { + call$1($arguments) { + var module, t2, callable, + t1 = J.getInterceptor$asx($arguments), + $name = t1.$index($arguments, 0).assertString$1("name"), + css = t1.$index($arguments, 1).get$isTruthy(); + t1 = t1.$index($arguments, 2).get$realNull(); + module = t1 == null ? null : t1.assertString$1("module"); + if (css) { + if (module != null) + throw A.wrapException(string$.x24css_a); + return new A.SassFunction(new A.PlainCssCallable($name._string$_text)); + } + t1 = this.$this; + t2 = t1._async_evaluate$_callableNode; + t2.toString; + callable = t1._async_evaluate$_addExceptionSpan$2(t2, new A._EvaluateVisitor__closure6(t1, $name, module)); + if (callable == null) + throw A.wrapException("Function not found: " + $name.toString$0(0)); + return new A.SassFunction(callable); + }, + $signature: 212 + }; + A._EvaluateVisitor__closure6.prototype = { + call$0() { + var local, + normalizedName = A.stringReplaceAllUnchecked(this.name._string$_text, "_", "-"), + t1 = this.module, + namespace = t1 == null ? null : t1._string$_text; + t1 = this.$this; + local = t1._async_evaluate$_environment.getFunction$2$namespace(normalizedName, namespace); + if (local != null || namespace != null) + return local; + return t1._async_evaluate$_builtInFunctions.$index(0, normalizedName); + }, + $signature: 84 + }; + A._EvaluateVisitor_closure21.prototype = { + call$1($arguments) { + var module, t2, callable, + t1 = J.getInterceptor$asx($arguments), + $name = t1.$index($arguments, 0).assertString$1("name"); + t1 = t1.$index($arguments, 1).get$realNull(); + module = t1 == null ? null : t1.assertString$1("module"); + t1 = this.$this; + t2 = t1._async_evaluate$_callableNode; + t2.toString; + callable = t1._async_evaluate$_addExceptionSpan$2(t2, new A._EvaluateVisitor__closure5(t1, $name, module)); + if (callable == null) + throw A.wrapException("Mixin not found: " + $name.toString$0(0)); + return new A.SassMixin(callable); + }, + $signature: 214 + }; + A._EvaluateVisitor__closure5.prototype = { + call$0() { + var t1 = this.$this._async_evaluate$_environment, + t2 = A.stringReplaceAllUnchecked(this.name._string$_text, "_", "-"), + t3 = this.module; + return t1.getMixin$2$namespace(t2, t3 == null ? null : t3._string$_text); + }, + $signature: 84 + }; + A._EvaluateVisitor_closure22.prototype = { + call$1($arguments) { + return this.$call$body$_EvaluateVisitor_closure1($arguments); + }, + $call$body$_EvaluateVisitor_closure1($arguments) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Value), + $async$returnValue, $async$self = this, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, invocation, callableNode, t1, $function, args; + var $async$call$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = J.getInterceptor$asx($arguments); + $function = t1.$index($arguments, 0); + args = type$.SassArgumentList._as(t1.$index($arguments, 1)); + t1 = $async$self.$this; + t2 = t1._async_evaluate$_callableNode; + t2.toString; + t3 = A._setArrayType([], type$.JSArray_Expression); + t4 = type$.String; + t5 = type$.Expression; + t6 = t2.get$span(t2); + t7 = t2.get$span(t2); + args._wereKeywordsAccessed = true; + t8 = args._keywords; + if (t8.get$isEmpty(t8)) + t2 = null; + else { + t9 = type$.Value; + t10 = A.LinkedHashMap_LinkedHashMap$_empty(t9, t9); + for (args._wereKeywordsAccessed = true, t8 = A.MapExtensions_get_pairs(t8, t4, t9), t8 = t8.get$iterator(t8); t8.moveNext$0();) { + t11 = t8.get$current(t8); + t10.$indexSet(0, new A.SassString(t11._0, false), t11._1); + } + t2 = new A.ValueExpression(new A.SassMap(A.ConstantMap_ConstantMap$from(t10, t9, t9)), t2.get$span(t2)); + } + invocation = new A.ArgumentInvocation(A.List_List$unmodifiable(t3, t5), A.ConstantMap_ConstantMap$from(A.LinkedHashMap_LinkedHashMap$_empty(t4, t5), t4, t5), new A.ValueExpression(args, t7), t2, t6); + $async$goto = $function instanceof A.SassString ? 3 : 4; + break; + case 3: + // then + t2 = $function.toString$0(0); + A.EvaluationContext_current().warn$2(0, string$.Passina + t2 + "))", B.Deprecation_qVK); + callableNode = t1._async_evaluate$_callableNode; + t1 = t1.visitFunctionExpression$1(new A.FunctionExpression(null, $function._string$_text, invocation, callableNode.get$span(callableNode))); + $async$goto = 5; + return A._asyncAwait(type$.Future_Value._is(t1) ? t1 : A._Future$value(t1, type$.Value), $async$call$1); + case 5: + // returning from await. + $async$returnValue = $async$result; + // goto return + $async$goto = 1; + break; + case 4: + // join + t2 = $function.assertFunction$1("function"); + t3 = t1._async_evaluate$_callableNode; + t3.toString; + $async$goto = 6; + return A._asyncAwait(t1._async_evaluate$_runFunctionCallable$3(invocation, t2.callable, t3), $async$call$1); + case 6: + // returning from await. + t3 = $async$result; + $async$returnValue = t3; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$call$1, $async$completer); + }, + $signature: 218 + }; + A._EvaluateVisitor_closure23.prototype = { + call$1($arguments) { + return this.$call$body$_EvaluateVisitor_closure0($arguments); + }, + $call$body$_EvaluateVisitor_closure0($arguments) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void), + $async$self = this, withMap, t2, values, configuration, t3, t1, url; + var $async$call$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = J.getInterceptor$asx($arguments); + url = A.Uri_parse(t1.$index($arguments, 0).assertString$1("url")._string$_text); + t1 = t1.$index($arguments, 1).get$realNull(); + withMap = t1 == null ? null : t1.assertMap$1("with")._map$_contents; + t1 = $async$self.$this; + t2 = t1._async_evaluate$_callableNode; + t2.toString; + if (withMap != null) { + values = A.LinkedHashMap_LinkedHashMap$_empty(type$.String, type$.ConfiguredValue); + withMap.forEach$1(0, new A._EvaluateVisitor__closure3(values, t2.get$span(t2), t2)); + configuration = new A.ExplicitConfiguration(t2, values, null); + } else + configuration = B.Configuration_Map_empty_null; + t3 = t2.get$span(t2); + $async$goto = 2; + return A._asyncAwait(t1._async_evaluate$_loadModule$7$baseUrl$configuration$namesInErrors(url, "load-css()", t2, new A._EvaluateVisitor__closure4(t1), t3.get$sourceUrl(t3), configuration, true), $async$call$1); + case 2: + // returning from await. + t1._async_evaluate$_assertConfigurationIsEmpty$2$nameInError(configuration, true); + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$call$1, $async$completer); + }, + $signature: 215 + }; + A._EvaluateVisitor__closure3.prototype = { + call$2(variable, value) { + var t1 = variable.assertString$1("with key"), + $name = A.stringReplaceAllUnchecked(t1._string$_text, "_", "-"); + t1 = this.values; + if (t1.containsKey$1($name)) + throw A.wrapException("The variable $" + $name + " was configured twice."); + t1.$indexSet(0, $name, new A.ConfiguredValue(value, this.span, this.callableNode)); + }, + $signature: 85 + }; + A._EvaluateVisitor__closure4.prototype = { + call$2(module, _) { + var t1 = this.$this; + return t1._async_evaluate$_combineCss$2$clone(module, true).accept$1(t1); + }, + $signature: 315 + }; + A._EvaluateVisitor_closure24.prototype = { + call$1($arguments) { + return this.$call$body$_EvaluateVisitor_closure($arguments); + }, + $call$body$_EvaluateVisitor_closure($arguments) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void), + $async$self = this, callableNode, t2, t3, t4, t5, t1, mixin, args; + var $async$call$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = J.getInterceptor$asx($arguments); + mixin = t1.$index($arguments, 0); + args = type$.SassArgumentList._as(t1.$index($arguments, 1)); + t1 = $async$self.$this; + callableNode = t1._async_evaluate$_callableNode; + t2 = callableNode.get$span(callableNode); + t3 = callableNode.get$span(callableNode); + t4 = type$.Expression; + t5 = A.List_List$unmodifiable(B.List_empty9, t4); + t4 = A.ConstantMap_ConstantMap$from(B.Map_empty6, type$.String, t4); + $async$goto = 2; + return A._asyncAwait(t1._async_evaluate$_applyMixin$5(mixin.assertMixin$1("mixin").callable, t1._async_evaluate$_environment._async_environment$_content, new A.ArgumentInvocation(t5, t4, new A.ValueExpression(args, t3), null, t2), callableNode, callableNode), $async$call$1); + case 2: + // returning from await. + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$call$1, $async$completer); + }, + $signature: 215 + }; + A._EvaluateVisitor_run_closure0.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Record_2_Set_Uri_loadedUrls_and_CssStylesheet_stylesheet), + $async$returnValue, $async$self = this, module, url, t1, t2, _0_0; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + url = null; + t1 = $async$self.node; + t2 = t1.span; + _0_0 = t2.get$sourceUrl(t2); + if (_0_0 != null) { + url = _0_0; + t2 = $async$self.$this; + t2._async_evaluate$_activeModules.$indexSet(0, url, null); + t2._async_evaluate$_loadedUrls.add$1(0, url); + } + t2 = $async$self.$this; + $async$goto = 3; + return A._asyncAwait(t2._async_evaluate$_addExceptionTrace$1$1(new A._EvaluateVisitor_run__closure0(t2, $async$self.importer, t1), type$.Module_AsyncCallable), $async$call$0); + case 3: + // returning from await. + module = $async$result; + $async$returnValue = new A._Record_2_loadedUrls_stylesheet(t2._async_evaluate$_loadedUrls, t2._async_evaluate$_combineCss$1(module)); + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 314 + }; + A._EvaluateVisitor_run__closure0.prototype = { + call$0() { + return this.$this._async_evaluate$_execute$2(this.importer, this.node); + }, + $signature: 313 + }; + A._EvaluateVisitor__loadModule_closure1.prototype = { + call$0() { + return this.callback.call$2(this._box_1.builtInModule, false); + }, + $signature: 0 + }; + A._EvaluateVisitor__loadModule_closure2.prototype = { + call$0() { + return this.$call$body$_EvaluateVisitor__loadModule_closure(); + }, + $call$body$_EvaluateVisitor__loadModule_closure() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Null), + $async$handler = 1, $async$currentError, $async$next = [], $async$self = this, canonicalUrl, oldInDependency, isDependency, t4, message, t1, stylesheet, importer, t2, t3, _1_0, $async$temp1; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) { + $async$currentError = $async$result; + $async$goto = $async$handler; + } + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = {}; + stylesheet = null; + importer = null; + t2 = $async$self.$this; + t3 = $async$self.nodeWithSpan; + $async$goto = 2; + return A._asyncAwait(t2._async_evaluate$_loadStylesheet$3$baseUrl($async$self.url.toString$0(0), t3.get$span(t3), $async$self.baseUrl), $async$call$0); + case 2: + // returning from await. + _1_0 = $async$result; + stylesheet = _1_0._0; + importer = _1_0._1; + isDependency = _1_0._2; + t4 = stylesheet.span; + canonicalUrl = t4.get$sourceUrl(t4); + if (canonicalUrl != null) { + t4 = t2._async_evaluate$_activeModules; + if (t4.containsKey$1(canonicalUrl)) { + if ($async$self.namesInErrors) { + t1 = canonicalUrl; + t3 = $.$get$context(); + t1.toString; + message = "Module loop: " + t3.prettyUri$1(t1) + " is already being loaded."; + } else + message = string$.Modulel; + t1 = A.NullableExtension_andThen(t4.$index(0, canonicalUrl), new A._EvaluateVisitor__loadModule__closure1(t2, message)); + throw A.wrapException(t1 == null ? t2._async_evaluate$_exception$1(message) : t1); + } else + t4.$indexSet(0, canonicalUrl, t3); + } + t4 = t2._async_evaluate$_modules.containsKey$1(canonicalUrl); + oldInDependency = t2._async_evaluate$_inDependency; + t2._async_evaluate$_inDependency = isDependency; + t1.module = null; + $async$handler = 3; + $async$temp1 = t1; + $async$goto = 6; + return A._asyncAwait(t2._async_evaluate$_execute$5$configuration$namesInErrors$nodeWithSpan(importer, stylesheet, $async$self.configuration, $async$self.namesInErrors, t3), $async$call$0); + case 6: + // returning from await. + $async$temp1.module = $async$result; + $async$next.push(5); + // goto finally + $async$goto = 4; + break; + case 3: + // uncaught + $async$next = [1]; + case 4: + // finally + $async$handler = 1; + t2._async_evaluate$_activeModules.remove$1(0, canonicalUrl); + t2._async_evaluate$_inDependency = oldInDependency; + // goto the next finally handler + $async$goto = $async$next.pop(); + break; + case 5: + // after finally + $async$goto = 7; + return A._asyncAwait(t2._addExceptionSpanAsync$1$3$addStackFrame(t3, new A._EvaluateVisitor__loadModule__closure2(t1, $async$self.callback, !t4), false, type$.void), $async$call$0); + case 7: + // returning from await. + // implicit return + return A._asyncReturn(null, $async$completer); + case 1: + // rethrow + return A._asyncRethrow($async$currentError, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 2 + }; + A._EvaluateVisitor__loadModule__closure1.prototype = { + call$1(previousLoad) { + return this.$this._async_evaluate$_multiSpanException$3(this.message, "new load", A.LinkedHashMap_LinkedHashMap$_literal([previousLoad.get$span(previousLoad), "original load"], type$.FileSpan, type$.String)); + }, + $signature: 88 + }; + A._EvaluateVisitor__loadModule__closure2.prototype = { + call$0() { + return this.callback.call$2(this._box_0.module, this.firstLoad); + }, + $signature: 0 + }; + A._EvaluateVisitor__execute_closure0.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Null), + $async$self = this, t3, t4, t5, t6, t1, oldImporter, oldStylesheet, oldRoot, oldPreModuleComments, oldParent, oldEndOfImports, oldOutOfOrderImports, oldExtensionStore, t2, oldStyleRule, oldMediaQueries, oldDeclarationName, oldInUnknownAtRule, oldInKeyframes, oldConfiguration; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.$this; + oldImporter = t1._async_evaluate$_importer; + oldStylesheet = t1._async_evaluate$__stylesheet; + oldRoot = t1._async_evaluate$__root; + oldPreModuleComments = t1._async_evaluate$_preModuleComments; + oldParent = t1._async_evaluate$__parent; + oldEndOfImports = t1._async_evaluate$__endOfImports; + oldOutOfOrderImports = t1._async_evaluate$_outOfOrderImports; + oldExtensionStore = t1._async_evaluate$__extensionStore; + t2 = t1._async_evaluate$_atRootExcludingStyleRule; + oldStyleRule = t2 ? null : t1._async_evaluate$_styleRuleIgnoringAtRoot; + oldMediaQueries = t1._async_evaluate$_mediaQueries; + oldDeclarationName = t1._async_evaluate$_declarationName; + oldInUnknownAtRule = t1._async_evaluate$_inUnknownAtRule; + oldInKeyframes = t1._async_evaluate$_inKeyframes; + oldConfiguration = t1._async_evaluate$_configuration; + t1._async_evaluate$_importer = $async$self.importer; + t3 = t1._async_evaluate$__stylesheet = $async$self.stylesheet; + t4 = t3.span; + t5 = t1._async_evaluate$__parent = t1._async_evaluate$__root = A.ModifiableCssStylesheet$(t4); + t1._async_evaluate$__endOfImports = 0; + t1._async_evaluate$_outOfOrderImports = null; + t1._async_evaluate$__extensionStore = $async$self.extensionStore; + t1._async_evaluate$_declarationName = t1._async_evaluate$_mediaQueries = t1._async_evaluate$_styleRuleIgnoringAtRoot = null; + t1._async_evaluate$_inKeyframes = t1._async_evaluate$_atRootExcludingStyleRule = t1._async_evaluate$_inUnknownAtRule = false; + t6 = $async$self.configuration; + if (t6 != null) + t1._async_evaluate$_configuration = t6; + $async$goto = 2; + return A._asyncAwait(t1.visitStylesheet$1(t3), $async$call$0); + case 2: + // returning from await. + t3 = t1._async_evaluate$_outOfOrderImports == null ? t5 : new A.CssStylesheet(new A.UnmodifiableListView(t1._async_evaluate$_addOutOfOrderImports$0(), type$.UnmodifiableListView_CssNode), t4); + $async$self.css._value = t3; + $async$self.preModuleComments._value = t1._async_evaluate$_preModuleComments; + t1._async_evaluate$_importer = oldImporter; + t1._async_evaluate$__stylesheet = oldStylesheet; + t1._async_evaluate$__root = oldRoot; + t1._async_evaluate$_preModuleComments = oldPreModuleComments; + t1._async_evaluate$__parent = oldParent; + t1._async_evaluate$__endOfImports = oldEndOfImports; + t1._async_evaluate$_outOfOrderImports = oldOutOfOrderImports; + t1._async_evaluate$__extensionStore = oldExtensionStore; + t1._async_evaluate$_styleRuleIgnoringAtRoot = oldStyleRule; + t1._async_evaluate$_mediaQueries = oldMediaQueries; + t1._async_evaluate$_declarationName = oldDeclarationName; + t1._async_evaluate$_inUnknownAtRule = oldInUnknownAtRule; + t1._async_evaluate$_atRootExcludingStyleRule = t2; + t1._async_evaluate$_inKeyframes = oldInKeyframes; + t1._async_evaluate$_configuration = oldConfiguration; + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 2 + }; + A._EvaluateVisitor__combineCss_closure1.prototype = { + call$1(module) { + return module.get$transitivelyContainsCss(); + }, + $signature: 127 + }; + A._EvaluateVisitor__combineCss_closure2.prototype = { + call$1(target) { + return !this.selectors.contains$1(0, target); + }, + $signature: 15 + }; + A._EvaluateVisitor__combineCss_visitModule0.prototype = { + call$1(module) { + var t1, t2, t3, t4, _i, upstream, _1_0, statements, index, _this = this; + if (!_this.seen.add$1(0, module)) + return; + if (_this.clone) + module = module.cloneCss$0(); + for (t1 = module.get$upstream(), t2 = t1.length, t3 = _this.css, t4 = _this.imports, _i = 0; _i < t1.length; t1.length === t2 || (0, A.throwConcurrentModificationError)(t1), ++_i) { + upstream = t1[_i]; + if (upstream.get$transitivelyContainsCss()) { + _1_0 = module.get$preModuleComments().$index(0, upstream); + if (_1_0 != null) + B.JSArray_methods.addAll$1(t3.length === 0 ? t4 : t3, _1_0); + _this.call$1(upstream); + } + } + _this.sorted.addFirst$1(module); + t1 = module.get$css(module); + statements = t1.get$children(t1); + index = _this.$this._async_evaluate$_indexAfterImports$1(statements); + t1 = J.getInterceptor$ax(statements); + B.JSArray_methods.addAll$1(t4, t1.getRange$2(statements, 0, index)); + B.JSArray_methods.addAll$1(t3, t1.getRange$2(statements, index, t1.get$length(statements))); + }, + $signature: 312 + }; + A._EvaluateVisitor__extendModules_closure1.prototype = { + call$1(target) { + return !this.originalSelectors.contains$1(0, target); + }, + $signature: 15 + }; + A._EvaluateVisitor__extendModules_closure2.prototype = { + call$0() { + return A._setArrayType([], type$.JSArray_ExtensionStore); + }, + $signature: 222 + }; + A._EvaluateVisitor_visitAtRootRule_closure1.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Null), + $async$self = this, t1, t2, t3, _i; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.node.children, t2 = t1.length, t3 = $async$self.$this, _i = 0; + case 2: + // for condition + if (!(_i < t2)) { + // goto after for + $async$goto = 4; + break; + } + $async$goto = 5; + return A._asyncAwait(t1[_i].accept$1(t3), $async$call$0); + case 5: + // returning from await. + case 3: + // for update + ++_i; + // goto for condition + $async$goto = 2; + break; + case 4: + // after for + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 2 + }; + A._EvaluateVisitor_visitAtRootRule_closure2.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void), + $async$self = this, t1, t2, t3, _i; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.node.children, t2 = t1.length, t3 = $async$self.$this, _i = 0; + case 2: + // for condition + if (!(_i < t2)) { + // goto after for + $async$goto = 4; + break; + } + $async$goto = 5; + return A._asyncAwait(t1[_i].accept$1(t3), $async$call$0); + case 5: + // returning from await. + case 3: + // for update + ++_i; + // goto for condition + $async$goto = 2; + break; + case 4: + // after for + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 24 + }; + A._EvaluateVisitor__scopeForAtRoot_closure5.prototype = { + call$1(callback) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Null), + $async$self = this, t1, t2; + var $async$call$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.$this; + t2 = t1._async_evaluate$_assertInModule$2(t1._async_evaluate$__parent, "__parent"); + t1._async_evaluate$__parent = $async$self.newParent; + $async$goto = 2; + return A._asyncAwait(t1._async_evaluate$_environment.scope$1$2$when(callback, $async$self.node.hasDeclarations, type$.void), $async$call$1); + case 2: + // returning from await. + t1._async_evaluate$__parent = t2; + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$call$1, $async$completer); + }, + $signature: 38 + }; + A._EvaluateVisitor__scopeForAtRoot_closure6.prototype = { + call$1(callback) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Null), + $async$self = this, t1, oldAtRootExcludingStyleRule; + var $async$call$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.$this; + oldAtRootExcludingStyleRule = t1._async_evaluate$_atRootExcludingStyleRule; + t1._async_evaluate$_atRootExcludingStyleRule = true; + $async$goto = 2; + return A._asyncAwait($async$self.innerScope.call$1(callback), $async$call$1); + case 2: + // returning from await. + t1._async_evaluate$_atRootExcludingStyleRule = oldAtRootExcludingStyleRule; + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$call$1, $async$completer); + }, + $signature: 38 + }; + A._EvaluateVisitor__scopeForAtRoot_closure7.prototype = { + call$1(callback) { + return this.$this._async_evaluate$_withMediaQueries$1$3(null, null, new A._EvaluateVisitor__scopeForAtRoot__closure0(this.innerScope, callback), type$.Null); + }, + $signature: 38 + }; + A._EvaluateVisitor__scopeForAtRoot__closure0.prototype = { + call$0() { + return this.innerScope.call$1(this.callback); + }, + $signature: 2 + }; + A._EvaluateVisitor__scopeForAtRoot_closure8.prototype = { + call$1(callback) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Null), + $async$self = this, t1, wasInKeyframes; + var $async$call$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.$this; + wasInKeyframes = t1._async_evaluate$_inKeyframes; + t1._async_evaluate$_inKeyframes = false; + $async$goto = 2; + return A._asyncAwait($async$self.innerScope.call$1(callback), $async$call$1); + case 2: + // returning from await. + t1._async_evaluate$_inKeyframes = wasInKeyframes; + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$call$1, $async$completer); + }, + $signature: 38 + }; + A._EvaluateVisitor__scopeForAtRoot_closure9.prototype = { + call$1($parent) { + return $parent instanceof A.ModifiableCssAtRule; + }, + $signature: 224 + }; + A._EvaluateVisitor__scopeForAtRoot_closure10.prototype = { + call$1(callback) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Null), + $async$self = this, t1, wasInUnknownAtRule; + var $async$call$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.$this; + wasInUnknownAtRule = t1._async_evaluate$_inUnknownAtRule; + t1._async_evaluate$_inUnknownAtRule = false; + $async$goto = 2; + return A._asyncAwait($async$self.innerScope.call$1(callback), $async$call$1); + case 2: + // returning from await. + t1._async_evaluate$_inUnknownAtRule = wasInUnknownAtRule; + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$call$1, $async$completer); + }, + $signature: 38 + }; + A._EvaluateVisitor_visitContentRule_closure0.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Null), + $async$returnValue, $async$self = this, t1, t2, t3, _i; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.content.declaration.children, t2 = t1.length, t3 = $async$self.$this, _i = 0; + case 3: + // for condition + if (!(_i < t2)) { + // goto after for + $async$goto = 5; + break; + } + $async$goto = 6; + return A._asyncAwait(t1[_i].accept$1(t3), $async$call$0); + case 6: + // returning from await. + case 4: + // for update + ++_i; + // goto for condition + $async$goto = 3; + break; + case 5: + // after for + $async$returnValue = null; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 2 + }; + A._EvaluateVisitor_visitDeclaration_closure0.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Null), + $async$self = this, t1, t2, t3, _i; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self._box_0.children, t2 = t1.length, t3 = $async$self.$this, _i = 0; + case 2: + // for condition + if (!(_i < t2)) { + // goto after for + $async$goto = 4; + break; + } + $async$goto = 5; + return A._asyncAwait(t1[_i].accept$1(t3), $async$call$0); + case 5: + // returning from await. + case 3: + // for update + ++_i; + // goto for condition + $async$goto = 2; + break; + case 4: + // after for + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 2 + }; + A._EvaluateVisitor_visitEachRule_closure2.prototype = { + call$1(value) { + var t1 = this.$this, + t2 = this.nodeWithSpan; + return t1._async_evaluate$_environment.setLocalVariable$3(this._box_0.variable, t1._async_evaluate$_withoutSlash$2(value, t2), t2); + }, + $signature: 58 + }; + A._EvaluateVisitor_visitEachRule_closure3.prototype = { + call$1(value) { + return this.$this._async_evaluate$_setMultipleVariables$3(this._box_0.variables, value, this.nodeWithSpan); + }, + $signature: 58 + }; + A._EvaluateVisitor_visitEachRule_closure4.prototype = { + call$0() { + var _this = this, + t1 = _this.$this; + return t1._async_evaluate$_handleReturn$2(_this.list.get$asList(), new A._EvaluateVisitor_visitEachRule__closure0(t1, _this.setVariables, _this.node)); + }, + $signature: 70 + }; + A._EvaluateVisitor_visitEachRule__closure0.prototype = { + call$1(element) { + var t1; + this.setVariables.call$1(element); + t1 = this.$this; + return t1._async_evaluate$_handleReturn$2(this.node.children, new A._EvaluateVisitor_visitEachRule___closure0(t1)); + }, + $signature: 310 + }; + A._EvaluateVisitor_visitEachRule___closure0.prototype = { + call$1(child) { + return child.accept$1(this.$this); + }, + $signature: 92 + }; + A._EvaluateVisitor_visitAtRule_closure2.prototype = { + call$1(value) { + return this.$this._async_evaluate$_interpolationToValue$3$trim$warnForColor(value, true, true); + }, + $signature: 309 + }; + A._EvaluateVisitor_visitAtRule_closure3.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Null), + $async$self = this, t2, t3, _i, t1, styleRule; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.$this; + styleRule = t1._async_evaluate$_atRootExcludingStyleRule ? null : t1._async_evaluate$_styleRuleIgnoringAtRoot; + $async$goto = styleRule == null || t1._async_evaluate$_inKeyframes || J.$eq$($async$self.name.value, "font-face") ? 2 : 4; + break; + case 2: + // then + t2 = $async$self.children, t3 = t2.length, _i = 0; + case 5: + // for condition + if (!(_i < t3)) { + // goto after for + $async$goto = 7; + break; + } + $async$goto = 8; + return A._asyncAwait(t2[_i].accept$1(t1), $async$call$0); + case 8: + // returning from await. + case 6: + // for update + ++_i; + // goto for condition + $async$goto = 5; + break; + case 7: + // after for + // goto join + $async$goto = 3; + break; + case 4: + // else + $async$goto = 9; + return A._asyncAwait(t1._async_evaluate$_withParent$2$3$scopeWhen(A.ModifiableCssStyleRule$(styleRule._style_rule$_selector, styleRule.span, styleRule.originalSelector), new A._EvaluateVisitor_visitAtRule__closure0(t1, $async$self.children), false, type$.ModifiableCssStyleRule, type$.Null), $async$call$0); + case 9: + // returning from await. + case 3: + // join + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 2 + }; + A._EvaluateVisitor_visitAtRule__closure0.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Null), + $async$self = this, t1, t2, t3, _i; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.children, t2 = t1.length, t3 = $async$self.$this, _i = 0; + case 2: + // for condition + if (!(_i < t2)) { + // goto after for + $async$goto = 4; + break; + } + $async$goto = 5; + return A._asyncAwait(t1[_i].accept$1(t3), $async$call$0); + case 5: + // returning from await. + case 3: + // for update + ++_i; + // goto for condition + $async$goto = 2; + break; + case 4: + // after for + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 2 + }; + A._EvaluateVisitor_visitAtRule_closure4.prototype = { + call$1(node) { + return node instanceof A.ModifiableCssStyleRule; + }, + $signature: 7 + }; + A._EvaluateVisitor_visitForRule_closure4.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.SassNumber), + $async$returnValue, $async$self = this; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$goto = 3; + return A._asyncAwait($async$self.node.from.accept$1($async$self.$this), $async$call$0); + case 3: + // returning from await. + $async$returnValue = $async$result.assertNumber$0(); + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 231 + }; + A._EvaluateVisitor_visitForRule_closure5.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.SassNumber), + $async$returnValue, $async$self = this; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$goto = 3; + return A._asyncAwait($async$self.node.to.accept$1($async$self.$this), $async$call$0); + case 3: + // returning from await. + $async$returnValue = $async$result.assertNumber$0(); + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 231 + }; + A._EvaluateVisitor_visitForRule_closure6.prototype = { + call$0() { + return this.fromNumber.assertInt$0(); + }, + $signature: 10 + }; + A._EvaluateVisitor_visitForRule_closure7.prototype = { + call$0() { + var t1 = this.fromNumber; + return this.toNumber.coerce$2(t1.get$numeratorUnits(t1), t1.get$denominatorUnits(t1)).assertInt$0(); + }, + $signature: 10 + }; + A._EvaluateVisitor_visitForRule_closure8.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.nullable_Value), + $async$returnValue, $async$self = this, i, t3, t4, t5, t6, t7, t8, _0_0, t1, t2, nodeWithSpan; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.$this; + t2 = $async$self.node; + nodeWithSpan = t1._async_evaluate$_expressionNode$1(t2.from); + i = $async$self.from, t3 = $async$self._box_0, t4 = $async$self.direction, t5 = t2.variable, t6 = $async$self.fromNumber, t2 = t2.children; + case 3: + // for condition + if (!(i !== t3.to)) { + // goto after for + $async$goto = 5; + break; + } + t7 = t1._async_evaluate$_environment; + t8 = t6.get$numeratorUnits(t6); + t7.setLocalVariable$3(t5, A.SassNumber_SassNumber$withUnits(i, t6.get$denominatorUnits(t6), t8), nodeWithSpan); + $async$goto = 6; + return A._asyncAwait(t1._async_evaluate$_handleReturn$2(t2, new A._EvaluateVisitor_visitForRule__closure0(t1)), $async$call$0); + case 6: + // returning from await. + _0_0 = $async$result; + if (_0_0 != null) { + $async$returnValue = _0_0; + // goto return + $async$goto = 1; + break; + } + case 4: + // for update + i += t4; + // goto for condition + $async$goto = 3; + break; + case 5: + // after for + $async$returnValue = null; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 70 + }; + A._EvaluateVisitor_visitForRule__closure0.prototype = { + call$1(child) { + return child.accept$1(this.$this); + }, + $signature: 92 + }; + A._EvaluateVisitor_visitForwardRule_closure1.prototype = { + call$2(module, firstLoad) { + if (firstLoad) + this.$this._async_evaluate$_registerCommentsForModule$1(module); + this.$this._async_evaluate$_environment.forwardModule$2(module, this.node); + }, + $signature: 122 + }; + A._EvaluateVisitor_visitForwardRule_closure2.prototype = { + call$2(module, firstLoad) { + if (firstLoad) + this.$this._async_evaluate$_registerCommentsForModule$1(module); + this.$this._async_evaluate$_environment.forwardModule$2(module, this.node); + }, + $signature: 122 + }; + A._EvaluateVisitor__registerCommentsForModule_closure0.prototype = { + call$0() { + return A._setArrayType([], type$.JSArray_CssComment); + }, + $signature: 233 + }; + A._EvaluateVisitor_visitIfRule_closure0.prototype = { + call$1(clause) { + var t1 = this.$this; + return t1._async_evaluate$_environment.scope$1$3$semiGlobal$when(new A._EvaluateVisitor_visitIfRule__closure0(t1, clause), true, clause.hasDeclarations, type$.nullable_Value); + }, + $signature: 306 + }; + A._EvaluateVisitor_visitIfRule__closure0.prototype = { + call$0() { + var t1 = this.$this; + return t1._async_evaluate$_handleReturn$2(this.clause.children, new A._EvaluateVisitor_visitIfRule___closure0(t1)); + }, + $signature: 70 + }; + A._EvaluateVisitor_visitIfRule___closure0.prototype = { + call$1(child) { + return child.accept$1(this.$this); + }, + $signature: 92 + }; + A._EvaluateVisitor__visitDynamicImport_closure0.prototype = { + call$0() { + return this.$call$body$_EvaluateVisitor__visitDynamicImport_closure(); + }, + $call$body$_EvaluateVisitor__visitDynamicImport_closure() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void), + $async$returnValue, $async$self = this, t1, t2, _0_0, stylesheet, importer, isDependency, t3, url, oldImporter, oldInDependency, loadsUserDefinedModules, children, t4, t5, t6, t7, t8, t9, t10, environment, module, visitor, _box_0; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + _box_0 = {}; + _box_0.isDependency = _box_0.importer = _box_0.stylesheet = null; + t1 = $async$self.$this; + t2 = $async$self.$import; + $async$goto = 3; + return A._asyncAwait(t1._async_evaluate$_loadStylesheet$3$forImport(t2.urlString, t2.span, true), $async$call$0); + case 3: + // returning from await. + _0_0 = $async$result; + stylesheet = _box_0.stylesheet = _0_0._0; + importer = _0_0._1; + _box_0.importer = importer; + isDependency = _0_0._2; + _box_0.isDependency = isDependency; + t3 = stylesheet.span; + url = t3.get$sourceUrl(t3); + if (url != null) { + t3 = t1._async_evaluate$_activeModules; + if (t3.containsKey$1(url)) { + t2 = A.NullableExtension_andThen(t3.$index(0, url), new A._EvaluateVisitor__visitDynamicImport__closure3(t1)); + throw A.wrapException(t2 == null ? t1._async_evaluate$_exception$1("This file is already being loaded.") : t2); + } + t3.$indexSet(0, url, t2); + } + t2 = stylesheet._uses; + t3 = type$.UnmodifiableListView_UseRule; + $async$goto = new A.UnmodifiableListView(t2, t3).get$length(0) === 0 && new A.UnmodifiableListView(stylesheet._forwards, type$.UnmodifiableListView_ForwardRule).get$length(0) === 0 ? 4 : 5; + break; + case 4: + // then + oldImporter = t1._async_evaluate$_importer; + t2 = t1._async_evaluate$_assertInModule$2(t1._async_evaluate$__stylesheet, "_stylesheet"); + oldInDependency = t1._async_evaluate$_inDependency; + t1._async_evaluate$_importer = importer; + t1._async_evaluate$__stylesheet = stylesheet; + t1._async_evaluate$_inDependency = isDependency; + $async$goto = 6; + return A._asyncAwait(t1.visitStylesheet$1(stylesheet), $async$call$0); + case 6: + // returning from await. + t1._async_evaluate$_importer = oldImporter; + t1._async_evaluate$__stylesheet = t2; + t1._async_evaluate$_inDependency = oldInDependency; + t1._async_evaluate$_activeModules.remove$1(0, url); + // goto return + $async$goto = 1; + break; + case 5: + // join + t2 = new A.UnmodifiableListView(t2, t3); + if (!t2.any$1(t2, new A._EvaluateVisitor__visitDynamicImport__closure4())) { + t2 = new A.UnmodifiableListView(stylesheet._forwards, type$.UnmodifiableListView_ForwardRule); + loadsUserDefinedModules = t2.any$1(t2, new A._EvaluateVisitor__visitDynamicImport__closure5()); + } else + loadsUserDefinedModules = true; + children = A._Cell$(); + t2 = t1._async_evaluate$_environment; + t3 = type$.String; + t4 = type$.Module_AsyncCallable; + t5 = type$.AstNode; + t6 = A._setArrayType([], type$.JSArray_Module_AsyncCallable); + t7 = t2._async_environment$_variables; + t7 = A._setArrayType(t7.slice(0), A._arrayInstanceType(t7)); + t8 = t2._async_environment$_variableNodes; + t8 = A._setArrayType(t8.slice(0), A._arrayInstanceType(t8)); + t9 = t2._async_environment$_functions; + t9 = A._setArrayType(t9.slice(0), A._arrayInstanceType(t9)); + t10 = t2._async_environment$_mixins; + t10 = A._setArrayType(t10.slice(0), A._arrayInstanceType(t10)); + environment = A.AsyncEnvironment$_(A.LinkedHashMap_LinkedHashMap$_empty(t3, t4), A.LinkedHashMap_LinkedHashMap$_empty(t3, t5), A.LinkedHashMap_LinkedHashMap$_empty(t4, t5), t2._async_environment$_importedModules, null, null, t6, t7, t8, t9, t10, t2._async_environment$_content); + $async$goto = 7; + return A._asyncAwait(t1._async_evaluate$_withEnvironment$1$2(environment, new A._EvaluateVisitor__visitDynamicImport__closure6(_box_0, t1, loadsUserDefinedModules, environment, children), type$.Null), $async$call$0); + case 7: + // returning from await. + module = environment.toDummyModule$0(); + t1._async_evaluate$_environment.importForwards$1(module); + $async$goto = loadsUserDefinedModules ? 8 : 9; + break; + case 8: + // then + $async$goto = module.transitivelyContainsCss ? 10 : 11; + break; + case 10: + // then + $async$goto = 12; + return A._asyncAwait(t1._async_evaluate$_combineCss$2$clone(module, module.transitivelyContainsExtensions).accept$1(t1), $async$call$0); + case 12: + // returning from await. + case 11: + // join + visitor = new A._ImportedCssVisitor0(t1); + for (t2 = J.get$iterator$ax(children._readLocal$0()); t2.moveNext$0();) + t2.get$current(t2).accept$1(visitor); + case 9: + // join + t1._async_evaluate$_activeModules.remove$1(0, url); + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 24 + }; + A._EvaluateVisitor__visitDynamicImport__closure3.prototype = { + call$1(previousLoad) { + return this.$this._async_evaluate$_multiSpanException$3("This file is already being loaded.", "new load", A.LinkedHashMap_LinkedHashMap$_literal([previousLoad.get$span(previousLoad), "original load"], type$.FileSpan, type$.String)); + }, + $signature: 88 + }; + A._EvaluateVisitor__visitDynamicImport__closure4.prototype = { + call$1(rule) { + return rule.url.get$scheme() !== "sass"; + }, + $signature: 235 + }; + A._EvaluateVisitor__visitDynamicImport__closure5.prototype = { + call$1(rule) { + return rule.url.get$scheme() !== "sass"; + }, + $signature: 236 + }; + A._EvaluateVisitor__visitDynamicImport__closure6.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Null), + $async$self = this, t7, t8, t1, oldImporter, t2, t3, t4, t5, oldOutOfOrderImports, oldConfiguration, oldInDependency, t6; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.$this; + oldImporter = t1._async_evaluate$_importer; + t2 = t1._async_evaluate$_assertInModule$2(t1._async_evaluate$__stylesheet, "_stylesheet"); + t3 = t1._async_evaluate$_assertInModule$2(t1._async_evaluate$__root, "_root"); + t4 = t1._async_evaluate$_assertInModule$2(t1._async_evaluate$__parent, "__parent"); + t5 = t1._async_evaluate$_assertInModule$2(t1._async_evaluate$__endOfImports, "_endOfImports"); + oldOutOfOrderImports = t1._async_evaluate$_outOfOrderImports; + oldConfiguration = t1._async_evaluate$_configuration; + oldInDependency = t1._async_evaluate$_inDependency; + t6 = $async$self._box_0; + t1._async_evaluate$_importer = t6.importer; + t7 = t6.stylesheet; + t1._async_evaluate$__stylesheet = t7; + t8 = $async$self.loadsUserDefinedModules; + if (t8) { + t7 = A.ModifiableCssStylesheet$(t7.span); + t1._async_evaluate$__root = t7; + t1._async_evaluate$__parent = t1._async_evaluate$_assertInModule$2(t7, "_root"); + t1._async_evaluate$__endOfImports = 0; + t1._async_evaluate$_outOfOrderImports = null; + } + t1._async_evaluate$_inDependency = t6.isDependency; + t7 = new A.UnmodifiableListView(t6.stylesheet._forwards, type$.UnmodifiableListView_ForwardRule); + if (!t7.get$isEmpty(t7)) + t1._async_evaluate$_configuration = $async$self.environment.toImplicitConfiguration$0(); + $async$goto = 2; + return A._asyncAwait(t1.visitStylesheet$1(t6.stylesheet), $async$call$0); + case 2: + // returning from await. + t6 = t8 ? t1._async_evaluate$_addOutOfOrderImports$0() : A._setArrayType([], type$.JSArray_ModifiableCssNode); + $async$self.children._value = t6; + t1._async_evaluate$_importer = oldImporter; + t1._async_evaluate$__stylesheet = t2; + if (t8) { + t1._async_evaluate$__root = t3; + t1._async_evaluate$__parent = t4; + t1._async_evaluate$__endOfImports = t5; + t1._async_evaluate$_outOfOrderImports = oldOutOfOrderImports; + } + t1._async_evaluate$_configuration = oldConfiguration; + t1._async_evaluate$_inDependency = oldInDependency; + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 2 + }; + A._EvaluateVisitor__applyMixin_closure1.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void), + $async$self = this, t1; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.$this; + $async$goto = 2; + return A._asyncAwait(t1._async_evaluate$_environment.asMixin$1(new A._EvaluateVisitor__applyMixin__closure2(t1, $async$self.$arguments, $async$self.mixin, $async$self.nodeWithSpanWithoutContent)), $async$call$0); + case 2: + // returning from await. + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 24 + }; + A._EvaluateVisitor__applyMixin__closure2.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void), + $async$self = this; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$goto = 2; + return A._asyncAwait($async$self.$this._async_evaluate$_runBuiltInCallable$3($async$self.$arguments, $async$self.mixin, $async$self.nodeWithSpanWithoutContent), $async$call$0); + case 2: + // returning from await. + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 24 + }; + A._EvaluateVisitor__applyMixin_closure2.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Null), + $async$self = this, t1; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.$this; + $async$goto = 2; + return A._asyncAwait(t1._async_evaluate$_environment.withContent$2($async$self.contentCallable, new A._EvaluateVisitor__applyMixin__closure1(t1, $async$self.mixin, $async$self.nodeWithSpanWithoutContent)), $async$call$0); + case 2: + // returning from await. + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 2 + }; + A._EvaluateVisitor__applyMixin__closure1.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void), + $async$self = this, t1; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.$this; + $async$goto = 2; + return A._asyncAwait(t1._async_evaluate$_environment.asMixin$1(new A._EvaluateVisitor__applyMixin___closure0(t1, $async$self.mixin, $async$self.nodeWithSpanWithoutContent)), $async$call$0); + case 2: + // returning from await. + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 24 + }; + A._EvaluateVisitor__applyMixin___closure0.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void), + $async$self = this, t1, t2, t3, t4, t5, _i; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.mixin.declaration.children, t2 = t1.length, t3 = $async$self.$this, t4 = $async$self.nodeWithSpanWithoutContent, t5 = type$.nullable_Value, _i = 0; + case 2: + // for condition + if (!(_i < t2)) { + // goto after for + $async$goto = 4; + break; + } + $async$goto = 5; + return A._asyncAwait(t3._async_evaluate$_addErrorSpan$1$2(t4, new A._EvaluateVisitor__applyMixin____closure0(t3, t1[_i]), t5), $async$call$0); + case 5: + // returning from await. + case 3: + // for update + ++_i; + // goto for condition + $async$goto = 2; + break; + case 4: + // after for + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 24 + }; + A._EvaluateVisitor__applyMixin____closure0.prototype = { + call$0() { + return this.statement.accept$1(this.$this); + }, + $signature: 70 + }; + A._EvaluateVisitor_visitIncludeRule_closure2.prototype = { + call$0() { + var t1 = this.node; + return this.$this._async_evaluate$_environment.getMixin$2$namespace(t1.name, t1.namespace); + }, + $signature: 84 + }; + A._EvaluateVisitor_visitIncludeRule_closure3.prototype = { + call$1($content) { + var t1 = this.$this; + return new A.UserDefinedCallable($content, t1._async_evaluate$_environment.closure$0(), t1._async_evaluate$_inDependency, type$.UserDefinedCallable_AsyncEnvironment); + }, + $signature: 305 + }; + A._EvaluateVisitor_visitIncludeRule_closure4.prototype = { + call$0() { + return this.node.get$spanWithoutContent(); + }, + $signature: 25 + }; + A._EvaluateVisitor_visitMediaRule_closure2.prototype = { + call$1(mediaQueries) { + return this.$this._async_evaluate$_mergeMediaQueries$2(mediaQueries, this.queries); + }, + $signature: 94 + }; + A._EvaluateVisitor_visitMediaRule_closure3.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Null), + $async$self = this, t1, t2; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.$this; + t2 = $async$self.mergedQueries; + if (t2 == null) + t2 = $async$self.queries; + $async$goto = 2; + return A._asyncAwait(t1._async_evaluate$_withMediaQueries$1$3(t2, $async$self.mergedSources, new A._EvaluateVisitor_visitMediaRule__closure0(t1, $async$self.node), type$.Null), $async$call$0); + case 2: + // returning from await. + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 2 + }; + A._EvaluateVisitor_visitMediaRule__closure0.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Null), + $async$self = this, t2, t3, _i, t1, _0_0; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.$this; + _0_0 = t1._async_evaluate$_atRootExcludingStyleRule ? null : t1._async_evaluate$_styleRuleIgnoringAtRoot; + $async$goto = _0_0 != null ? 2 : 4; + break; + case 2: + // then + $async$goto = 5; + return A._asyncAwait(t1._async_evaluate$_withParent$2$3$scopeWhen(A.ModifiableCssStyleRule$(_0_0._style_rule$_selector, _0_0.span, _0_0.originalSelector), new A._EvaluateVisitor_visitMediaRule___closure0(t1, $async$self.node), false, type$.ModifiableCssStyleRule, type$.Null), $async$call$0); + case 5: + // returning from await. + // goto join + $async$goto = 3; + break; + case 4: + // else + t2 = $async$self.node.children, t3 = t2.length, _i = 0; + case 6: + // for condition + if (!(_i < t3)) { + // goto after for + $async$goto = 8; + break; + } + $async$goto = 9; + return A._asyncAwait(t2[_i].accept$1(t1), $async$call$0); + case 9: + // returning from await. + case 7: + // for update + ++_i; + // goto for condition + $async$goto = 6; + break; + case 8: + // after for + case 3: + // join + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 2 + }; + A._EvaluateVisitor_visitMediaRule___closure0.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Null), + $async$self = this, t1, t2, t3, _i; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.node.children, t2 = t1.length, t3 = $async$self.$this, _i = 0; + case 2: + // for condition + if (!(_i < t2)) { + // goto after for + $async$goto = 4; + break; + } + $async$goto = 5; + return A._asyncAwait(t1[_i].accept$1(t3), $async$call$0); + case 5: + // returning from await. + case 3: + // for update + ++_i; + // goto for condition + $async$goto = 2; + break; + case 4: + // after for + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 2 + }; + A._EvaluateVisitor_visitMediaRule_closure4.prototype = { + call$1(node) { + var t1; + if (!(node instanceof A.ModifiableCssStyleRule)) { + t1 = this.mergedSources; + t1 = t1.get$isNotEmpty(t1) && node instanceof A.ModifiableCssMediaRule && B.JSArray_methods.every$1(node.queries, t1.get$contains(t1)); + } else + t1 = true; + return t1; + }, + $signature: 7 + }; + A._EvaluateVisitor_visitStyleRule_closure4.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Null), + $async$self = this, t1, t2, t3, _i; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.node.children, t2 = t1.length, t3 = $async$self.$this, _i = 0; + case 2: + // for condition + if (!(_i < t2)) { + // goto after for + $async$goto = 4; + break; + } + $async$goto = 5; + return A._asyncAwait(t1[_i].accept$1(t3), $async$call$0); + case 5: + // returning from await. + case 3: + // for update + ++_i; + // goto for condition + $async$goto = 2; + break; + case 4: + // after for + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 2 + }; + A._EvaluateVisitor_visitStyleRule_closure5.prototype = { + call$1(node) { + return node instanceof A.ModifiableCssStyleRule; + }, + $signature: 7 + }; + A._EvaluateVisitor_visitStyleRule_closure6.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Null), + $async$self = this, t1; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.$this; + $async$goto = 2; + return A._asyncAwait(t1._async_evaluate$_withStyleRule$1$2($async$self.rule, new A._EvaluateVisitor_visitStyleRule__closure0(t1, $async$self.node), type$.Null), $async$call$0); + case 2: + // returning from await. + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 2 + }; + A._EvaluateVisitor_visitStyleRule__closure0.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Null), + $async$self = this, t1, t2, t3, _i; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.node.children, t2 = t1.length, t3 = $async$self.$this, _i = 0; + case 2: + // for condition + if (!(_i < t2)) { + // goto after for + $async$goto = 4; + break; + } + $async$goto = 5; + return A._asyncAwait(t1[_i].accept$1(t3), $async$call$0); + case 5: + // returning from await. + case 3: + // for update + ++_i; + // goto for condition + $async$goto = 2; + break; + case 4: + // after for + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 2 + }; + A._EvaluateVisitor_visitStyleRule_closure7.prototype = { + call$1(node) { + return node instanceof A.ModifiableCssStyleRule; + }, + $signature: 7 + }; + A._EvaluateVisitor_visitStyleRule_closure8.prototype = { + call$1(child) { + return child instanceof A.ModifiableCssComment; + }, + $signature: 118 + }; + A._EvaluateVisitor_visitSupportsRule_closure1.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Null), + $async$self = this, t2, t3, _i, t1, _0_0; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.$this; + _0_0 = t1._async_evaluate$_atRootExcludingStyleRule ? null : t1._async_evaluate$_styleRuleIgnoringAtRoot; + $async$goto = _0_0 != null ? 2 : 4; + break; + case 2: + // then + $async$goto = 5; + return A._asyncAwait(t1._async_evaluate$_withParent$2$2(A.ModifiableCssStyleRule$(_0_0._style_rule$_selector, _0_0.span, _0_0.originalSelector), new A._EvaluateVisitor_visitSupportsRule__closure0(t1, $async$self.node), type$.ModifiableCssStyleRule, type$.Null), $async$call$0); + case 5: + // returning from await. + // goto join + $async$goto = 3; + break; + case 4: + // else + t2 = $async$self.node.children, t3 = t2.length, _i = 0; + case 6: + // for condition + if (!(_i < t3)) { + // goto after for + $async$goto = 8; + break; + } + $async$goto = 9; + return A._asyncAwait(t2[_i].accept$1(t1), $async$call$0); + case 9: + // returning from await. + case 7: + // for update + ++_i; + // goto for condition + $async$goto = 6; + break; + case 8: + // after for + case 3: + // join + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 2 + }; + A._EvaluateVisitor_visitSupportsRule__closure0.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Null), + $async$self = this, t1, t2, t3, _i; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.node.children, t2 = t1.length, t3 = $async$self.$this, _i = 0; + case 2: + // for condition + if (!(_i < t2)) { + // goto after for + $async$goto = 4; + break; + } + $async$goto = 5; + return A._asyncAwait(t1[_i].accept$1(t3), $async$call$0); + case 5: + // returning from await. + case 3: + // for update + ++_i; + // goto for condition + $async$goto = 2; + break; + case 4: + // after for + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 2 + }; + A._EvaluateVisitor_visitSupportsRule_closure2.prototype = { + call$1(node) { + return node instanceof A.ModifiableCssStyleRule; + }, + $signature: 7 + }; + A._EvaluateVisitor__visitSupportsCondition_closure0.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.String), + $async$returnValue, $async$self = this, t1, t2, t3, t4, $async$temp1, $async$temp2; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.$this; + t2 = $async$self._box_0; + $async$temp1 = A; + $async$goto = 3; + return A._asyncAwait(t1._evaluateToCss$1(t2.declaration.name), $async$call$0); + case 3: + // returning from await. + t3 = $async$temp1.S($async$result); + t4 = t2.declaration.get$isCustomProperty() ? "" : " "; + $async$temp1 = "(" + t3 + ":" + t4; + $async$temp2 = A; + $async$goto = 4; + return A._asyncAwait(t1._evaluateToCss$1(t2.declaration.value), $async$call$0); + case 4: + // returning from await. + $async$returnValue = $async$temp1 + $async$temp2.S($async$result) + ")"; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 239 + }; + A._EvaluateVisitor_visitVariableDeclaration_closure2.prototype = { + call$0() { + var t1 = this.$this._async_evaluate$_environment, + t2 = this._box_0.override; + t1.setVariable$4$global(this.node.name, t2.value, t2.assignmentNode, true); + }, + $signature: 1 + }; + A._EvaluateVisitor_visitVariableDeclaration_closure3.prototype = { + call$0() { + var t1 = this.node; + return this.$this._async_evaluate$_environment.getVariable$2$namespace(t1.name, t1.namespace); + }, + $signature: 40 + }; + A._EvaluateVisitor_visitVariableDeclaration_closure4.prototype = { + call$0() { + var t1 = this.$this, + t2 = this.node; + t1._async_evaluate$_environment.setVariable$5$global$namespace(t2.name, this.value, t1._async_evaluate$_expressionNode$1(t2.expression), t2.isGlobal, t2.namespace); + }, + $signature: 1 + }; + A._EvaluateVisitor_visitUseRule_closure0.prototype = { + call$2(module, firstLoad) { + var t1, t2, t3, _0_0, t4, t5, span; + if (firstLoad) + this.$this._async_evaluate$_registerCommentsForModule$1(module); + t1 = this.$this._async_evaluate$_environment; + t2 = this.node; + t3 = t2.namespace; + if (t3 == null) { + t1._async_environment$_globalModules.$indexSet(0, module, t2); + t1._async_environment$_allModules.push(module); + _0_0 = A.IterableExtension_firstWhereOrNull(J.get$keys$z(B.JSArray_methods.get$first(t1._async_environment$_variables)), module.get$variables().get$containsKey()); + if (_0_0 != null) + A.throwExpression(A.SassScriptException$(string$.This_ma + _0_0 + '".', null)); + } else { + t4 = t1._async_environment$_modules; + if (t4.containsKey$1(t3)) { + t5 = t1._async_environment$_namespaceNodes.$index(0, t3); + span = t5 == null ? null : t5.span; + t5 = A.LinkedHashMap_LinkedHashMap$_empty(type$.FileSpan, type$.String); + if (span != null) + t5.$indexSet(0, span, "original @use"); + A.throwExpression(A.MultiSpanSassScriptException$(string$.There_ + t3 + '".', "new @use", t5)); + } + t4.$indexSet(0, t3, module); + t1._async_environment$_namespaceNodes.$indexSet(0, t3, t2); + t1._async_environment$_allModules.push(module); + } + }, + $signature: 122 + }; + A._EvaluateVisitor_visitWarnRule_closure0.prototype = { + call$0() { + return this.node.expression.accept$1(this.$this); + }, + $signature: 74 + }; + A._EvaluateVisitor_visitWhileRule_closure0.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.nullable_Value), + $async$returnValue, $async$self = this, t1, t2, t3, _0_0; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.node, t2 = t1.condition, t3 = $async$self.$this, t1 = t1.children; + case 3: + // for condition + $async$goto = 5; + return A._asyncAwait(t2.accept$1(t3), $async$call$0); + case 5: + // returning from await. + if (!$async$result.get$isTruthy()) { + // goto after for + $async$goto = 4; + break; + } + $async$goto = 6; + return A._asyncAwait(t3._async_evaluate$_handleReturn$2(t1, new A._EvaluateVisitor_visitWhileRule__closure0(t3)), $async$call$0); + case 6: + // returning from await. + _0_0 = $async$result; + if (_0_0 != null) { + $async$returnValue = _0_0; + // goto return + $async$goto = 1; + break; + } + // goto for condition + $async$goto = 3; + break; + case 4: + // after for + $async$returnValue = null; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 70 + }; + A._EvaluateVisitor_visitWhileRule__closure0.prototype = { + call$1(child) { + return child.accept$1(this.$this); + }, + $signature: 92 + }; + A._EvaluateVisitor_visitBinaryOperationExpression_closure0.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Value), + $async$returnValue, $async$self = this, t3, t1, t2, left, $async$temp1, $async$temp2; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.node; + t2 = $async$self.$this; + $async$goto = 3; + return A._asyncAwait(t1.left.accept$1(t2), $async$call$0); + case 3: + // returning from await. + left = $async$result; + case 4: + // switch + switch (t1.operator) { + case B.BinaryOperator_2jN: + // goto case + $async$goto = 6; + break; + case B.BinaryOperator_M6L: + // goto case + $async$goto = 7; + break; + case B.BinaryOperator_SNp: + // goto case + $async$goto = 8; + break; + case B.BinaryOperator_ql5: + // goto case + $async$goto = 9; + break; + case B.BinaryOperator_ViB: + // goto case + $async$goto = 10; + break; + case B.BinaryOperator_cIH: + // goto case + $async$goto = 11; + break; + case B.BinaryOperator_7Tg: + // goto case + $async$goto = 12; + break; + case B.BinaryOperator_U8c: + // goto case + $async$goto = 13; + break; + case B.BinaryOperator_kpg: + // goto case + $async$goto = 14; + break; + case B.BinaryOperator_anB: + // goto case + $async$goto = 15; + break; + case B.BinaryOperator_olz: + // goto case + $async$goto = 16; + break; + case B.BinaryOperator_qN2: + // goto case + $async$goto = 17; + break; + case B.BinaryOperator_t8B: + // goto case + $async$goto = 18; + break; + case B.BinaryOperator_OTG: + // goto case + $async$goto = 19; + break; + default: + // goto default + $async$goto = 20; + break; + } + break; + case 6: + // case + t1 = t1.right.accept$1(t2); + $async$goto = 21; + return A._asyncAwait(type$.Future_Value._is(t1) ? t1 : A._Future$value(t1, type$.Value), $async$call$0); + case 21: + // returning from await. + t1 = $async$result; + t1 = new A.SassString(A.serializeValue(left, false, true) + "=" + A.serializeValue(t1, false, true), false); + // goto after switch + $async$goto = 5; + break; + case 7: + // case + $async$goto = left.get$isTruthy() ? 22 : 24; + break; + case 22: + // then + t1 = left; + // goto join + $async$goto = 23; + break; + case 24: + // else + t1 = t1.right.accept$1(t2); + $async$goto = 25; + return A._asyncAwait(type$.Future_Value._is(t1) ? t1 : A._Future$value(t1, type$.Value), $async$call$0); + case 25: + // returning from await. + t1 = $async$result; + case 23: + // join + // goto after switch + $async$goto = 5; + break; + case 8: + // case + $async$goto = left.get$isTruthy() ? 26 : 28; + break; + case 26: + // then + t1 = t1.right.accept$1(t2); + $async$goto = 29; + return A._asyncAwait(type$.Future_Value._is(t1) ? t1 : A._Future$value(t1, type$.Value), $async$call$0); + case 29: + // returning from await. + t1 = $async$result; + // goto join + $async$goto = 27; + break; + case 28: + // else + t1 = left; + case 27: + // join + // goto after switch + $async$goto = 5; + break; + case 9: + // case + $async$temp1 = left; + $async$goto = 30; + return A._asyncAwait(t1.right.accept$1(t2), $async$call$0); + case 30: + // returning from await. + t1 = $async$temp1.$eq(0, $async$result) ? B.SassBoolean_true : B.SassBoolean_false; + // goto after switch + $async$goto = 5; + break; + case 10: + // case + $async$temp1 = left; + $async$goto = 31; + return A._asyncAwait(t1.right.accept$1(t2), $async$call$0); + case 31: + // returning from await. + t1 = !$async$temp1.$eq(0, $async$result) ? B.SassBoolean_true : B.SassBoolean_false; + // goto after switch + $async$goto = 5; + break; + case 11: + // case + t1 = t1.right.accept$1(t2); + $async$temp1 = left; + $async$goto = 32; + return A._asyncAwait(type$.Future_Value._is(t1) ? t1 : A._Future$value(t1, type$.Value), $async$call$0); + case 32: + // returning from await. + t1 = $async$temp1.greaterThan$1($async$result); + // goto after switch + $async$goto = 5; + break; + case 12: + // case + t1 = t1.right.accept$1(t2); + $async$temp1 = left; + $async$goto = 33; + return A._asyncAwait(type$.Future_Value._is(t1) ? t1 : A._Future$value(t1, type$.Value), $async$call$0); + case 33: + // returning from await. + t1 = $async$temp1.greaterThanOrEquals$1($async$result); + // goto after switch + $async$goto = 5; + break; + case 13: + // case + t1 = t1.right.accept$1(t2); + $async$temp1 = left; + $async$goto = 34; + return A._asyncAwait(type$.Future_Value._is(t1) ? t1 : A._Future$value(t1, type$.Value), $async$call$0); + case 34: + // returning from await. + t1 = $async$temp1.lessThan$1($async$result); + // goto after switch + $async$goto = 5; + break; + case 14: + // case + t1 = t1.right.accept$1(t2); + $async$temp1 = left; + $async$goto = 35; + return A._asyncAwait(type$.Future_Value._is(t1) ? t1 : A._Future$value(t1, type$.Value), $async$call$0); + case 35: + // returning from await. + t1 = $async$temp1.lessThanOrEquals$1($async$result); + // goto after switch + $async$goto = 5; + break; + case 15: + // case + t1 = t1.right.accept$1(t2); + $async$temp1 = left; + $async$goto = 36; + return A._asyncAwait(type$.Future_Value._is(t1) ? t1 : A._Future$value(t1, type$.Value), $async$call$0); + case 36: + // returning from await. + t1 = $async$temp1.plus$1($async$result); + // goto after switch + $async$goto = 5; + break; + case 16: + // case + t1 = t1.right.accept$1(t2); + $async$temp1 = left; + $async$goto = 37; + return A._asyncAwait(type$.Future_Value._is(t1) ? t1 : A._Future$value(t1, type$.Value), $async$call$0); + case 37: + // returning from await. + t1 = $async$temp1.minus$1($async$result); + // goto after switch + $async$goto = 5; + break; + case 17: + // case + t1 = t1.right.accept$1(t2); + $async$temp1 = left; + $async$goto = 38; + return A._asyncAwait(type$.Future_Value._is(t1) ? t1 : A._Future$value(t1, type$.Value), $async$call$0); + case 38: + // returning from await. + t1 = $async$temp1.times$1($async$result); + // goto after switch + $async$goto = 5; + break; + case 18: + // case + t3 = t1.right.accept$1(t2); + $async$temp1 = t2; + $async$temp2 = left; + $async$goto = 39; + return A._asyncAwait(type$.Future_Value._is(t3) ? t3 : A._Future$value(t3, type$.Value), $async$call$0); + case 39: + // returning from await. + t1 = $async$temp1._async_evaluate$_slash$3($async$temp2, $async$result, t1); + // goto after switch + $async$goto = 5; + break; + case 19: + // case + t1 = t1.right.accept$1(t2); + $async$temp1 = left; + $async$goto = 40; + return A._asyncAwait(type$.Future_Value._is(t1) ? t1 : A._Future$value(t1, type$.Value), $async$call$0); + case 40: + // returning from await. + t1 = $async$temp1.modulo$1($async$result); + // goto after switch + $async$goto = 5; + break; + case 20: + // default + t1 = null; + case 5: + // after switch + $async$returnValue = t1; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 74 + }; + A._EvaluateVisitor__slash_recommendation0.prototype = { + call$1(expression) { + var t1; + $label0$0: { + if (expression instanceof A.BinaryOperationExpression && B.BinaryOperator_t8B === expression.operator) { + t1 = "math.div(" + A.S(this.call$1(expression.left)) + ", " + A.S(this.call$1(expression.right)) + ")"; + break $label0$0; + } + if (expression instanceof A.ParenthesizedExpression) { + t1 = expression.expression.toString$0(0); + break $label0$0; + } + t1 = expression.toString$0(0); + break $label0$0; + } + return t1; + }, + $signature: 120 + }; + A._EvaluateVisitor_visitVariableExpression_closure0.prototype = { + call$0() { + var t1 = this.node; + return this.$this._async_evaluate$_environment.getVariable$2$namespace(t1.name, t1.namespace); + }, + $signature: 40 + }; + A._EvaluateVisitor_visitUnaryOperationExpression_closure0.prototype = { + call$0() { + var t1, _this = this; + switch (_this.node.operator) { + case B.UnaryOperator_gg4: + t1 = _this.operand.unaryPlus$0(); + break; + case B.UnaryOperator_TLI: + t1 = _this.operand.unaryMinus$0(); + break; + case B.UnaryOperator_Ix1: + t1 = new A.SassString("/" + A.serializeValue(_this.operand, false, true), false); + break; + case B.UnaryOperator_not_not_not: + t1 = _this.operand.unaryNot$0(); + break; + default: + t1 = null; + } + return t1; + }, + $signature: 36 + }; + A._EvaluateVisitor_visitListExpression_closure0.prototype = { + call$1(expression) { + return expression.accept$1(this.$this); + }, + $signature: 302 + }; + A._EvaluateVisitor_visitFunctionExpression_closure2.prototype = { + call$0() { + var t1 = this.$this._async_evaluate$_environment, + t2 = this.node; + return t1.getFunction$2$namespace(A.stringReplaceAllUnchecked(t2.originalName, "_", "-"), t2.namespace); + }, + $signature: 84 + }; + A._EvaluateVisitor_visitFunctionExpression_closure3.prototype = { + call$1(argument) { + return argument.accept$1(new A._IsCalculationSafeVisitor()); + }, + $signature: 119 + }; + A._EvaluateVisitor_visitFunctionExpression_closure4.prototype = { + call$0() { + var t1 = this.node; + return this.$this._async_evaluate$_runFunctionCallable$3(t1.$arguments, this._box_0.$function, t1); + }, + $signature: 74 + }; + A._EvaluateVisitor__checkCalculationArguments_check0.prototype = { + call$1(maxArgs) { + var t1 = this.node, + t2 = t1.$arguments.positional.length; + if (t2 === 0) + throw A.wrapException(this.$this._async_evaluate$_exception$2("Missing argument.", t1.span)); + else if (maxArgs != null && t2 > maxArgs) + throw A.wrapException(this.$this._async_evaluate$_exception$2("Only " + A.S(maxArgs) + " " + A.pluralize("argument", maxArgs, null) + " allowed, but " + t2 + " " + A.pluralize("was", t2, "were") + " passed.", t1.span)); + }, + call$0() { + return this.call$1(null); + }, + $signature: 99 + }; + A._EvaluateVisitor__visitCalculationExpression_closure0.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Object), + $async$returnValue, $async$self = this, t1, t2, t3, $async$temp1, $async$temp2, $async$temp3; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.$this; + t2 = $async$self._box_0; + t3 = $async$self.inLegacySassFunction; + $async$temp1 = A; + $async$temp2 = t1._async_evaluate$_binaryOperatorToCalculationOperator$2(t2.operator, $async$self.node); + $async$goto = 3; + return A._asyncAwait(t1._async_evaluate$_visitCalculationExpression$2$inLegacySassFunction(t2.left, t3), $async$call$0); + case 3: + // returning from await. + $async$temp3 = $async$result; + $async$goto = 4; + return A._asyncAwait(t1._async_evaluate$_visitCalculationExpression$2$inLegacySassFunction(t2.right, t3), $async$call$0); + case 4: + // returning from await. + $async$returnValue = $async$temp1.SassCalculation_operateInternal($async$temp2, $async$temp3, $async$result, t3, !t1._async_evaluate$_inSupportsDeclaration); + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 245 + }; + A._EvaluateVisitor_visitInterpolatedFunctionExpression_closure0.prototype = { + call$0() { + var t1 = this.node; + return this.$this._async_evaluate$_runFunctionCallable$3(t1.$arguments, this.$function, t1); + }, + $signature: 74 + }; + A._EvaluateVisitor__runUserDefinedCallable_closure0.prototype = { + call$0() { + var _this = this, + t1 = _this.$this, + t2 = _this.callable, + t3 = _this.V; + return t1._async_evaluate$_withEnvironment$1$2(t2.environment.closure$0(), new A._EvaluateVisitor__runUserDefinedCallable__closure0(t1, _this.evaluated, t2, _this.nodeWithSpan, _this.run, t3), t3); + }, + $signature() { + return this.V._eval$1("Future<0>()"); + } + }; + A._EvaluateVisitor__runUserDefinedCallable__closure0.prototype = { + call$0() { + var _this = this, + t1 = _this.$this, + t2 = _this.V; + return t1._async_evaluate$_environment.scope$1$1(new A._EvaluateVisitor__runUserDefinedCallable___closure0(t1, _this.evaluated, _this.callable, _this.nodeWithSpan, _this.run, t2), t2); + }, + $signature() { + return this.V._eval$1("Future<0>()"); + } + }; + A._EvaluateVisitor__runUserDefinedCallable___closure0.prototype = { + call$0() { + return this.$call$body$_EvaluateVisitor__runUserDefinedCallable___closure(this.V); + }, + $call$body$_EvaluateVisitor__runUserDefinedCallable___closure($async$type) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter($async$type), + $async$returnValue, $async$self = this, declaredArguments, t5, minLength, i, argument, t6, t7, value, t8, restArgument, rest, argumentList, result, t1, t2, t3, t4, $async$temp1; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.$this; + t2 = $async$self.evaluated._values; + t3 = $async$self.callable.declaration.$arguments; + t4 = $async$self.nodeWithSpan; + t1._async_evaluate$_verifyArguments$4(J.get$length$asx(t2[2]), t2[0], t3, t4); + declaredArguments = t3.$arguments; + t5 = declaredArguments.length; + minLength = Math.min(J.get$length$asx(t2[2]), t5); + for (i = 0; i < minLength; ++i) + t1._async_evaluate$_environment.setLocalVariable$3(declaredArguments[i].name, J.$index$asx(t2[2], i), J.$index$asx(t2[3], i)); + i = J.get$length$asx(t2[2]); + case 3: + // for condition + if (!(i < t5)) { + // goto after for + $async$goto = 5; + break; + } + argument = declaredArguments[i]; + t6 = t2[0]; + t7 = argument.name; + value = J.remove$1$z(t6, t7); + $async$goto = value == null ? 6 : 7; + break; + case 6: + // then + t6 = argument.defaultValue; + $async$temp1 = t1; + $async$goto = 8; + return A._asyncAwait(t6.accept$1(t1), $async$call$0); + case 8: + // returning from await. + value = $async$temp1._async_evaluate$_withoutSlash$2($async$result, t1._async_evaluate$_expressionNode$1(t6)); + case 7: + // join + t6 = t1._async_evaluate$_environment; + t8 = J.$index$asx(t2[1], t7); + if (t8 == null) { + t8 = argument.defaultValue; + t8.toString; + t8 = t1._async_evaluate$_expressionNode$1(t8); + } + t6.setLocalVariable$3(t7, value, t8); + case 4: + // for update + ++i; + // goto for condition + $async$goto = 3; + break; + case 5: + // after for + restArgument = t3.restArgument; + if (restArgument != null) { + rest = J.get$length$asx(t2[2]) > t5 ? J.sublist$1$ax(t2[2], t5) : B.List_empty8; + t5 = t2[0]; + t6 = t2[4]; + argumentList = A.SassArgumentList$(rest, t5, t6 === B.ListSeparator_undecided_null_undecided ? B.ListSeparator_rXA : t6); + t1._async_evaluate$_environment.setLocalVariable$3(restArgument, argumentList, t4); + } else + argumentList = null; + $async$goto = 9; + return A._asyncAwait($async$self.run.call$0(), $async$call$0); + case 9: + // returning from await. + result = $async$result; + if (argumentList == null) { + $async$returnValue = result; + // goto return + $async$goto = 1; + break; + } + if (J.get$isEmpty$asx(t2[0])) { + $async$returnValue = result; + // goto return + $async$goto = 1; + break; + } + if (argumentList._wereKeywordsAccessed) { + $async$returnValue = result; + // goto return + $async$goto = 1; + break; + } + throw A.wrapException(A.MultiSpanSassRuntimeException$("No " + A.pluralize("argument", J.get$length$asx(J.get$keys$z(t2[0])), null) + " named " + A.toSentence(J.map$1$1$ax(J.get$keys$z(t2[0]), new A._EvaluateVisitor__runUserDefinedCallable____closure0(), type$.Object), "or") + ".", t4.get$span(t4), "invocation", A.LinkedHashMap_LinkedHashMap$_literal([t3.get$spanWithName(), "declaration"], type$.FileSpan, type$.String), t1._async_evaluate$_stackTrace$1(t4.get$span(t4)), null)); + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature() { + return this.V._eval$1("Future<0>()"); + } + }; + A._EvaluateVisitor__runUserDefinedCallable____closure0.prototype = { + call$1($name) { + return "$" + $name; + }, + $signature: 5 + }; + A._EvaluateVisitor__runFunctionCallable_closure0.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Value), + $async$returnValue, $async$self = this, t1, t2, t3, t4, _i, $returnValue; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.callable.declaration, t2 = t1.children, t3 = t2.length, t4 = $async$self.$this, _i = 0; + case 3: + // for condition + if (!(_i < t3)) { + // goto after for + $async$goto = 5; + break; + } + $async$goto = 6; + return A._asyncAwait(t2[_i].accept$1(t4), $async$call$0); + case 6: + // returning from await. + $returnValue = $async$result; + if ($returnValue instanceof A.Value) { + $async$returnValue = $returnValue; + // goto return + $async$goto = 1; + break; + } + case 4: + // for update + ++_i; + // goto for condition + $async$goto = 3; + break; + case 5: + // after for + throw A.wrapException(t4._async_evaluate$_exception$2("Function finished without @return.", t1.span)); + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 74 + }; + A._EvaluateVisitor__runBuiltInCallable_closure2.prototype = { + call$0() { + return this._box_0.overload.verify$2(J.get$length$asx(this.evaluated._values[2]), this.namedSet); + }, + $signature: 0 + }; + A._EvaluateVisitor__runBuiltInCallable_closure3.prototype = { + call$0() { + return this._box_0.callback.call$1(this.evaluated._values[2]); + }, + $signature: 301 + }; + A._EvaluateVisitor__runBuiltInCallable_closure4.prototype = { + call$1($name) { + return "$" + $name; + }, + $signature: 5 + }; + A._EvaluateVisitor__evaluateArguments_closure3.prototype = { + call$1(value) { + return value; + }, + $signature: 39 + }; + A._EvaluateVisitor__evaluateArguments_closure4.prototype = { + call$1(value) { + return this.$this._async_evaluate$_withoutSlash$2(value, this.restNodeForSpan); + }, + $signature: 39 + }; + A._EvaluateVisitor__evaluateArguments_closure5.prototype = { + call$2(key, value) { + var _this = this, + t1 = _this.restNodeForSpan; + _this.named.$indexSet(0, key, _this.$this._async_evaluate$_withoutSlash$2(value, t1)); + _this.namedNodes.$indexSet(0, key, t1); + }, + $signature: 101 + }; + A._EvaluateVisitor__evaluateArguments_closure6.prototype = { + call$1(value) { + return value; + }, + $signature: 39 + }; + A._EvaluateVisitor__evaluateMacroArguments_closure3.prototype = { + call$1(value) { + var t1 = this.restArgs; + return new A.ValueExpression(value, t1.get$span(t1)); + }, + $signature: 59 + }; + A._EvaluateVisitor__evaluateMacroArguments_closure4.prototype = { + call$1(value) { + var t1 = this.restArgs; + return new A.ValueExpression(this.$this._async_evaluate$_withoutSlash$2(value, this.restNodeForSpan), t1.get$span(t1)); + }, + $signature: 59 + }; + A._EvaluateVisitor__evaluateMacroArguments_closure5.prototype = { + call$2(key, value) { + var _this = this, + t1 = _this.restArgs; + _this.named.$indexSet(0, key, new A.ValueExpression(_this.$this._async_evaluate$_withoutSlash$2(value, _this.restNodeForSpan), t1.get$span(t1))); + }, + $signature: 101 + }; + A._EvaluateVisitor__evaluateMacroArguments_closure6.prototype = { + call$1(value) { + var t1 = this.keywordRestArgs; + return new A.ValueExpression(this.$this._async_evaluate$_withoutSlash$2(value, this.keywordRestNodeForSpan), t1.get$span(t1)); + }, + $signature: 59 + }; + A._EvaluateVisitor__addRestMap_closure0.prototype = { + call$2(key, value) { + var t2, _this = this, + t1 = _this.$this; + if (key instanceof A.SassString) + _this.values.$indexSet(0, key._string$_text, _this.convert.call$1(t1._async_evaluate$_withoutSlash$2(value, _this.expressionNode))); + else { + t2 = _this.nodeWithSpan; + throw A.wrapException(t1._async_evaluate$_exception$2(string$.Variab_ + key.toString$0(0) + " is not a string in " + _this.map.toString$0(0) + ".", t2.get$span(t2))); + } + }, + $signature: 85 + }; + A._EvaluateVisitor__verifyArguments_closure0.prototype = { + call$0() { + return this.$arguments.verify$2(this.positional, new A.MapKeySet(this.named, type$.MapKeySet_String)); + }, + $signature: 0 + }; + A._EvaluateVisitor_visitCssAtRule_closure1.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Null), + $async$self = this, t1, t2, t3, t4; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.node.children, t2 = t1.$ti, t1 = new A.ListIterator(t1, t1.get$length(0), t2._eval$1("ListIterator")), t3 = $async$self.$this, t2 = t2._eval$1("ListBase.E"); + case 2: + // for condition + if (!t1.moveNext$0()) { + // goto after for + $async$goto = 3; + break; + } + t4 = t1.__internal$_current; + $async$goto = 4; + return A._asyncAwait((t4 == null ? t2._as(t4) : t4).accept$1(t3), $async$call$0); + case 4: + // returning from await. + // goto for condition + $async$goto = 2; + break; + case 3: + // after for + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 2 + }; + A._EvaluateVisitor_visitCssAtRule_closure2.prototype = { + call$1(node) { + return node instanceof A.ModifiableCssStyleRule; + }, + $signature: 7 + }; + A._EvaluateVisitor_visitCssKeyframeBlock_closure1.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Null), + $async$self = this, t1, t2, t3, t4; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.node.children, t2 = t1.$ti, t1 = new A.ListIterator(t1, t1.get$length(0), t2._eval$1("ListIterator")), t3 = $async$self.$this, t2 = t2._eval$1("ListBase.E"); + case 2: + // for condition + if (!t1.moveNext$0()) { + // goto after for + $async$goto = 3; + break; + } + t4 = t1.__internal$_current; + $async$goto = 4; + return A._asyncAwait((t4 == null ? t2._as(t4) : t4).accept$1(t3), $async$call$0); + case 4: + // returning from await. + // goto for condition + $async$goto = 2; + break; + case 3: + // after for + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 2 + }; + A._EvaluateVisitor_visitCssKeyframeBlock_closure2.prototype = { + call$1(node) { + return node instanceof A.ModifiableCssStyleRule; + }, + $signature: 7 + }; + A._EvaluateVisitor_visitCssMediaRule_closure2.prototype = { + call$1(mediaQueries) { + return this.$this._async_evaluate$_mergeMediaQueries$2(mediaQueries, this.node.queries); + }, + $signature: 94 + }; + A._EvaluateVisitor_visitCssMediaRule_closure3.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Null), + $async$self = this, t1, t2; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.$this; + t2 = $async$self.mergedQueries; + if (t2 == null) + t2 = $async$self.node.queries; + $async$goto = 2; + return A._asyncAwait(t1._async_evaluate$_withMediaQueries$1$3(t2, $async$self.mergedSources, new A._EvaluateVisitor_visitCssMediaRule__closure0(t1, $async$self.node), type$.Null), $async$call$0); + case 2: + // returning from await. + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 2 + }; + A._EvaluateVisitor_visitCssMediaRule__closure0.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Null), + $async$self = this, t2, t3, t4, t1, _0_0; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.$this; + _0_0 = t1._async_evaluate$_atRootExcludingStyleRule ? null : t1._async_evaluate$_styleRuleIgnoringAtRoot; + $async$goto = _0_0 != null ? 2 : 4; + break; + case 2: + // then + $async$goto = 5; + return A._asyncAwait(t1._async_evaluate$_withParent$2$3$scopeWhen(A.ModifiableCssStyleRule$(_0_0._style_rule$_selector, _0_0.span, _0_0.originalSelector), new A._EvaluateVisitor_visitCssMediaRule___closure0(t1, $async$self.node), false, type$.ModifiableCssStyleRule, type$.Null), $async$call$0); + case 5: + // returning from await. + // goto join + $async$goto = 3; + break; + case 4: + // else + t2 = $async$self.node.children, t3 = t2.$ti, t2 = new A.ListIterator(t2, t2.get$length(0), t3._eval$1("ListIterator")), t3 = t3._eval$1("ListBase.E"); + case 6: + // for condition + if (!t2.moveNext$0()) { + // goto after for + $async$goto = 7; + break; + } + t4 = t2.__internal$_current; + $async$goto = 8; + return A._asyncAwait((t4 == null ? t3._as(t4) : t4).accept$1(t1), $async$call$0); + case 8: + // returning from await. + // goto for condition + $async$goto = 6; + break; + case 7: + // after for + case 3: + // join + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 2 + }; + A._EvaluateVisitor_visitCssMediaRule___closure0.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Null), + $async$self = this, t1, t2, t3, t4; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.node.children, t2 = t1.$ti, t1 = new A.ListIterator(t1, t1.get$length(0), t2._eval$1("ListIterator")), t3 = $async$self.$this, t2 = t2._eval$1("ListBase.E"); + case 2: + // for condition + if (!t1.moveNext$0()) { + // goto after for + $async$goto = 3; + break; + } + t4 = t1.__internal$_current; + $async$goto = 4; + return A._asyncAwait((t4 == null ? t2._as(t4) : t4).accept$1(t3), $async$call$0); + case 4: + // returning from await. + // goto for condition + $async$goto = 2; + break; + case 3: + // after for + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 2 + }; + A._EvaluateVisitor_visitCssMediaRule_closure4.prototype = { + call$1(node) { + var t1; + if (!(node instanceof A.ModifiableCssStyleRule)) { + t1 = this.mergedSources; + t1 = t1.get$isNotEmpty(t1) && node instanceof A.ModifiableCssMediaRule && B.JSArray_methods.every$1(node.queries, t1.get$contains(t1)); + } else + t1 = true; + return t1; + }, + $signature: 7 + }; + A._EvaluateVisitor_visitCssStyleRule_closure1.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Null), + $async$self = this, t1; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.$this; + $async$goto = 2; + return A._asyncAwait(t1._async_evaluate$_withStyleRule$1$2($async$self.rule, new A._EvaluateVisitor_visitCssStyleRule__closure0(t1, $async$self.node), type$.Null), $async$call$0); + case 2: + // returning from await. + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 2 + }; + A._EvaluateVisitor_visitCssStyleRule__closure0.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Null), + $async$self = this, t1, t2, t3, t4; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.node.children, t2 = t1.$ti, t1 = new A.ListIterator(t1, t1.get$length(0), t2._eval$1("ListIterator")), t3 = $async$self.$this, t2 = t2._eval$1("ListBase.E"); + case 2: + // for condition + if (!t1.moveNext$0()) { + // goto after for + $async$goto = 3; + break; + } + t4 = t1.__internal$_current; + $async$goto = 4; + return A._asyncAwait((t4 == null ? t2._as(t4) : t4).accept$1(t3), $async$call$0); + case 4: + // returning from await. + // goto for condition + $async$goto = 2; + break; + case 3: + // after for + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 2 + }; + A._EvaluateVisitor_visitCssStyleRule_closure2.prototype = { + call$1(node) { + return node instanceof A.ModifiableCssStyleRule; + }, + $signature: 7 + }; + A._EvaluateVisitor_visitCssSupportsRule_closure1.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Null), + $async$self = this, t2, t3, t4, t1, _0_0; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.$this; + _0_0 = t1._async_evaluate$_atRootExcludingStyleRule ? null : t1._async_evaluate$_styleRuleIgnoringAtRoot; + $async$goto = _0_0 != null ? 2 : 4; + break; + case 2: + // then + $async$goto = 5; + return A._asyncAwait(t1._async_evaluate$_withParent$2$2(A.ModifiableCssStyleRule$(_0_0._style_rule$_selector, _0_0.span, _0_0.originalSelector), new A._EvaluateVisitor_visitCssSupportsRule__closure0(t1, $async$self.node), type$.ModifiableCssStyleRule, type$.Null), $async$call$0); + case 5: + // returning from await. + // goto join + $async$goto = 3; + break; + case 4: + // else + t2 = $async$self.node.children, t3 = t2.$ti, t2 = new A.ListIterator(t2, t2.get$length(0), t3._eval$1("ListIterator")), t3 = t3._eval$1("ListBase.E"); + case 6: + // for condition + if (!t2.moveNext$0()) { + // goto after for + $async$goto = 7; + break; + } + t4 = t2.__internal$_current; + $async$goto = 8; + return A._asyncAwait((t4 == null ? t3._as(t4) : t4).accept$1(t1), $async$call$0); + case 8: + // returning from await. + // goto for condition + $async$goto = 6; + break; + case 7: + // after for + case 3: + // join + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 2 + }; + A._EvaluateVisitor_visitCssSupportsRule__closure0.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Null), + $async$self = this, t1, t2, t3, t4; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.node.children, t2 = t1.$ti, t1 = new A.ListIterator(t1, t1.get$length(0), t2._eval$1("ListIterator")), t3 = $async$self.$this, t2 = t2._eval$1("ListBase.E"); + case 2: + // for condition + if (!t1.moveNext$0()) { + // goto after for + $async$goto = 3; + break; + } + t4 = t1.__internal$_current; + $async$goto = 4; + return A._asyncAwait((t4 == null ? t2._as(t4) : t4).accept$1(t3), $async$call$0); + case 4: + // returning from await. + // goto for condition + $async$goto = 2; + break; + case 3: + // after for + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 2 + }; + A._EvaluateVisitor_visitCssSupportsRule_closure2.prototype = { + call$1(node) { + return node instanceof A.ModifiableCssStyleRule; + }, + $signature: 7 + }; + A._EvaluateVisitor__performInterpolationHelper_closure0.prototype = { + call$1(targetLocations) { + return A.InterpolationMap$(this.interpolation, targetLocations); + }, + $signature: 249 + }; + A._EvaluateVisitor__serialize_closure0.prototype = { + call$0() { + return A.serializeValue(this.value, false, this.quote); + }, + $signature: 27 + }; + A._EvaluateVisitor__expressionNode_closure0.prototype = { + call$0() { + var t1 = this.expression; + return this.$this._async_evaluate$_environment.getVariableNode$2$namespace(t1.name, t1.namespace); + }, + $signature: 250 + }; + A._EvaluateVisitor__withoutSlash_recommendation0.prototype = { + call$1(number) { + var t1, before, after, + _1_0 = number.asSlash; + $label0$0: { + if (type$.Record_2_nullable_Object_and_nullable_Object._is(_1_0)) { + t1 = type$.SassNumber; + before = t1._as(_1_0._0); + after = t1._as(_1_0._1); + t1 = "math.div(" + A.S(this.call$1(before)) + ", " + A.S(this.call$1(after)) + ")"; + break $label0$0; + } + t1 = A.serializeValue(number, true, true); + break $label0$0; + } + return t1; + }, + $signature: 251 + }; + A._EvaluateVisitor__stackFrame_closure0.prototype = { + call$1(url) { + var t1 = this.$this._async_evaluate$_importCache; + t1 = t1 == null ? null : t1.humanize$1(url); + return t1 == null ? url : t1; + }, + $signature: 44 + }; + A._ImportedCssVisitor0.prototype = { + visitCssAtRule$1(node) { + var t1 = node.isChildless ? null : new A._ImportedCssVisitor_visitCssAtRule_closure0(); + this._async_evaluate$_visitor._async_evaluate$_addChild$2$through(node, t1); + }, + visitCssComment$1(node) { + return this._async_evaluate$_visitor._async_evaluate$_addChild$1(node); + }, + visitCssDeclaration$1(node) { + }, + visitCssImport$1(node) { + var t2, + _s13_ = "_endOfImports", + t1 = this._async_evaluate$_visitor; + if (t1._async_evaluate$_assertInModule$2(t1._async_evaluate$__parent, "__parent") !== t1._async_evaluate$_assertInModule$2(t1._async_evaluate$__root, "_root")) + t1._async_evaluate$_addChild$1(node); + else if (t1._async_evaluate$_assertInModule$2(t1._async_evaluate$__endOfImports, _s13_) === J.get$length$asx(t1._async_evaluate$_assertInModule$2(t1._async_evaluate$__root, "_root").children._collection$_source)) { + t1._async_evaluate$_addChild$1(node); + t1._async_evaluate$__endOfImports = t1._async_evaluate$_assertInModule$2(t1._async_evaluate$__endOfImports, _s13_) + 1; + } else { + t2 = t1._async_evaluate$_outOfOrderImports; + (t2 == null ? t1._async_evaluate$_outOfOrderImports = A._setArrayType([], type$.JSArray_ModifiableCssImport) : t2).push(node); + } + }, + visitCssKeyframeBlock$1(node) { + }, + visitCssMediaRule$1(node) { + var t1 = this._async_evaluate$_visitor, + mediaQueries = t1._async_evaluate$_mediaQueries; + t1._async_evaluate$_addChild$2$through(node, new A._ImportedCssVisitor_visitCssMediaRule_closure0(mediaQueries == null || t1._async_evaluate$_mergeMediaQueries$2(mediaQueries, node.queries) != null)); + }, + visitCssStyleRule$1(node) { + return this._async_evaluate$_visitor._async_evaluate$_addChild$2$through(node, new A._ImportedCssVisitor_visitCssStyleRule_closure0()); + }, + visitCssStylesheet$1(node) { + var t1, t2, t3; + for (t1 = node.children, t2 = t1.$ti, t1 = new A.ListIterator(t1, t1.get$length(0), t2._eval$1("ListIterator")), t2 = t2._eval$1("ListBase.E"); t1.moveNext$0();) { + t3 = t1.__internal$_current; + (t3 == null ? t2._as(t3) : t3).accept$1(this); + } + }, + visitCssSupportsRule$1(node) { + return this._async_evaluate$_visitor._async_evaluate$_addChild$2$through(node, new A._ImportedCssVisitor_visitCssSupportsRule_closure0()); + } + }; + A._ImportedCssVisitor_visitCssAtRule_closure0.prototype = { + call$1(node) { + return node instanceof A.ModifiableCssStyleRule; + }, + $signature: 7 + }; + A._ImportedCssVisitor_visitCssMediaRule_closure0.prototype = { + call$1(node) { + var t1; + if (!(node instanceof A.ModifiableCssStyleRule)) + t1 = this.hasBeenMerged && node instanceof A.ModifiableCssMediaRule; + else + t1 = true; + return t1; + }, + $signature: 7 + }; + A._ImportedCssVisitor_visitCssStyleRule_closure0.prototype = { + call$1(node) { + return node instanceof A.ModifiableCssStyleRule; + }, + $signature: 7 + }; + A._ImportedCssVisitor_visitCssSupportsRule_closure0.prototype = { + call$1(node) { + return node instanceof A.ModifiableCssStyleRule; + }, + $signature: 7 + }; + A._EvaluationContext0.prototype = { + get$currentCallableSpan() { + var _0_0 = this._async_evaluate$_visitor._async_evaluate$_callableNode; + if (_0_0 != null) + return _0_0.get$span(_0_0); + throw A.wrapException(A.StateError$(string$.No_Sasc)); + }, + warn$2(_, message, deprecation) { + var t1 = this._async_evaluate$_visitor, + t2 = t1._async_evaluate$_importSpan; + if (t2 == null) { + t2 = t1._async_evaluate$_callableNode; + t2 = t2 == null ? null : t2.get$span(t2); + } + t1._async_evaluate$_warn$3(message, t2 == null ? this._async_evaluate$_defaultWarnNodeWithSpan.span : t2, deprecation); + }, + $isEvaluationContext: 1 + }; + A._CloneCssVisitor.prototype = { + visitCssAtRule$1(node) { + var t1 = node.isChildless, + rule = A.ModifiableCssAtRule$(node.name, node.span, t1, node.value); + return t1 ? rule : this._visitChildren$2(rule, node); + }, + visitCssComment$1(node) { + return new A.ModifiableCssComment(node.text, node.span); + }, + visitCssDeclaration$1(node) { + return A.ModifiableCssDeclaration$(node.name, node.value, node.span, node.parsedAsCustomProperty, node.valueSpanForMap); + }, + visitCssImport$1(node) { + return new A.ModifiableCssImport(node.url, node.modifiers, node.span); + }, + visitCssKeyframeBlock$1(node) { + return this._visitChildren$2(A.ModifiableCssKeyframeBlock$(node.selector, node.span), node); + }, + visitCssMediaRule$1(node) { + return this._visitChildren$2(A.ModifiableCssMediaRule$(node.queries, node.span), node); + }, + visitCssStyleRule$1(node) { + var _0_0 = this._oldToNewSelectors.$index(0, node._style_rule$_selector._box$_inner.value); + if (_0_0 != null) + return this._visitChildren$2(A.ModifiableCssStyleRule$(_0_0, node.span, node.originalSelector), node); + else + throw A.wrapException(A.StateError$(string$.The_Ex)); + }, + visitCssStylesheet$1(node) { + return this._visitChildren$2(A.ModifiableCssStylesheet$(node.get$span(node)), node); + }, + visitCssSupportsRule$1(node) { + return this._visitChildren$2(A.ModifiableCssSupportsRule$(node.condition, node.span), node); + }, + _visitChildren$1$2(newParent, oldParent) { + var t1, t2, newChild; + for (t1 = J.get$iterator$ax(oldParent.get$children(oldParent)); t1.moveNext$0();) { + t2 = t1.get$current(t1); + newChild = t2.accept$1(this); + newChild.isGroupEnd = t2.get$isGroupEnd(); + newParent.addChild$1(newChild); + } + return newParent; + }, + _visitChildren$2(newParent, oldParent) { + return this._visitChildren$1$2(newParent, oldParent, type$.ModifiableCssParentNode); + } + }; + A.Evaluator.prototype = {}; + A._EvaluateVisitor.prototype = { + _EvaluateVisitor$6$functions$importCache$logger$nodeImporter$quietDeps$sourceMap(functions, importCache, logger, nodeImporter, quietDeps, sourceMap) { + var t2, metaModule, t3, _i, module, $function, t4, _this = this, + _s20_ = "$name, $module: null", + _s9_ = "sass:meta", + _s7_ = "$module", + t1 = type$.JSArray_BuiltInCallable, + metaFunctions = A._setArrayType([A.BuiltInCallable$function("global-variable-exists", _s20_, new A._EvaluateVisitor_closure(_this), _s9_), A.BuiltInCallable$function("variable-exists", "$name", new A._EvaluateVisitor_closure0(_this), _s9_), A.BuiltInCallable$function("function-exists", _s20_, new A._EvaluateVisitor_closure1(_this), _s9_), A.BuiltInCallable$function("mixin-exists", _s20_, new A._EvaluateVisitor_closure2(_this), _s9_), A.BuiltInCallable$function("content-exists", "", new A._EvaluateVisitor_closure3(_this), _s9_), A.BuiltInCallable$function("module-variables", _s7_, new A._EvaluateVisitor_closure4(_this), _s9_), A.BuiltInCallable$function("module-functions", _s7_, new A._EvaluateVisitor_closure5(_this), _s9_), A.BuiltInCallable$function("module-mixins", _s7_, new A._EvaluateVisitor_closure6(_this), _s9_), A.BuiltInCallable$function("get-function", "$name, $css: false, $module: null", new A._EvaluateVisitor_closure7(_this), _s9_), A.BuiltInCallable$function("get-mixin", _s20_, new A._EvaluateVisitor_closure8(_this), _s9_), A.BuiltInCallable$function("call", "$function, $args...", new A._EvaluateVisitor_closure9(_this), _s9_)], t1), + metaMixins = A._setArrayType([A.BuiltInCallable$mixin("load-css", "$url, $with: null", new A._EvaluateVisitor_closure10(_this), false, _s9_), A.BuiltInCallable$mixin("apply", "$mixin, $args...", new A._EvaluateVisitor_closure11(_this), true, _s9_)], t1); + t1 = type$.BuiltInCallable; + t2 = A.List_List$of($.$get$global(), true, t1); + B.JSArray_methods.addAll$1(t2, $.$get$local()); + B.JSArray_methods.addAll$1(t2, metaFunctions); + metaModule = A.BuiltInModule$("meta", t2, metaMixins, null, t1); + for (t1 = A.List_List$of($.$get$coreModules(), true, type$.BuiltInModule_Callable), t1.push(metaModule), t2 = t1.length, t3 = _this._builtInModules, _i = 0; _i < t1.length; t1.length === t2 || (0, A.throwConcurrentModificationError)(t1), ++_i) { + module = t1[_i]; + t3.$indexSet(0, module.url, module); + } + t1 = A._setArrayType([], type$.JSArray_Callable); + B.JSArray_methods.addAll$1(t1, $.$get$globalFunctions()); + B.JSArray_methods.addAll$1(t1, metaFunctions); + for (t2 = t1.length, t3 = _this._builtInFunctions, _i = 0; _i < t1.length; t1.length === t2 || (0, A.throwConcurrentModificationError)(t1), ++_i) { + $function = t1[_i]; + t4 = J.get$name$x($function); + t3.$indexSet(0, A.stringReplaceAllUnchecked(t4, "_", "-"), $function); + } + }, + run$2(_, importer, node) { + var error, stackTrace, t1, exception; + try { + t1 = type$.nullable_Object; + t1 = A.runZoned(new A._EvaluateVisitor_run_closure(this, node, importer), A.LinkedHashMap_LinkedHashMap$_literal([B.Symbol__evaluationContext, new A._EvaluationContext(this, node)], t1, t1), type$.Record_2_Set_Uri_loadedUrls_and_CssStylesheet_stylesheet); + return t1; + } catch (exception) { + t1 = A.unwrapException(exception); + if (t1 instanceof A.SassException) { + error = t1; + stackTrace = A.getTraceFromException(exception); + A.throwWithTrace(error.withLoadedUrls$1(this._loadedUrls), error, stackTrace); + } else + throw exception; + } + }, + runExpression$2(importer, expression) { + var t1 = type$.nullable_Object; + return A.runZoned(new A._EvaluateVisitor_runExpression_closure(this, importer, expression), A.LinkedHashMap_LinkedHashMap$_literal([B.Symbol__evaluationContext, new A._EvaluationContext(this, expression)], t1, t1), type$.Value); + }, + runStatement$2(importer, statement) { + var t1 = type$.nullable_Object; + return A.runZoned(new A._EvaluateVisitor_runStatement_closure(this, importer, statement), A.LinkedHashMap_LinkedHashMap$_literal([B.Symbol__evaluationContext, new A._EvaluationContext(this, statement)], t1, t1), type$.void); + }, + _assertInModule$1$2(value, $name) { + if (value != null) + return value; + throw A.wrapException(A.StateError$("Can't access " + $name + " outside of a module.")); + }, + _assertInModule$2(value, $name) { + return this._assertInModule$1$2(value, $name, type$.dynamic); + }, + _withFakeStylesheet$1$3(importer, nodeWithSpan, callback) { + var t1, _this = this, + oldImporter = _this._importer; + _this._importer = importer; + _this.__stylesheet = A.Stylesheet$(B.List_empty12, nodeWithSpan.get$span(nodeWithSpan)); + try { + t1 = callback.call$0(); + return t1; + } finally { + _this._importer = oldImporter; + _this.__stylesheet = null; + } + }, + _withFakeStylesheet$3(importer, nodeWithSpan, callback) { + return this._withFakeStylesheet$1$3(importer, nodeWithSpan, callback, type$.dynamic); + }, + _loadModule$7$baseUrl$configuration$namesInErrors(url, stackFrame, nodeWithSpan, callback, baseUrl, configuration, namesInErrors) { + var _0_0, t2, _this = this, t1 = {}; + t1.builtInModule = null; + _0_0 = _this._builtInModules.$index(0, url); + if (_0_0 != null) { + t1.builtInModule = _0_0; + if (configuration instanceof A.ExplicitConfiguration) { + t1 = namesInErrors ? "Built-in module " + url.toString$0(0) + " can't be configured." : "Built-in modules can't be configured."; + t2 = configuration.nodeWithSpan; + throw A.wrapException(_this._evaluate$_exception$2(t1, t2.get$span(t2))); + } + _this._addExceptionSpan$2(nodeWithSpan, new A._EvaluateVisitor__loadModule_closure(t1, callback)); + return; + } + _this._withStackFrame$3(stackFrame, nodeWithSpan, new A._EvaluateVisitor__loadModule_closure0(_this, url, nodeWithSpan, baseUrl, namesInErrors, configuration, callback)); + }, + _loadModule$5$configuration(url, stackFrame, nodeWithSpan, callback, configuration) { + return this._loadModule$7$baseUrl$configuration$namesInErrors(url, stackFrame, nodeWithSpan, callback, null, configuration, false); + }, + _loadModule$4(url, stackFrame, nodeWithSpan, callback) { + return this._loadModule$7$baseUrl$configuration$namesInErrors(url, stackFrame, nodeWithSpan, callback, null, null, false); + }, + _execute$5$configuration$namesInErrors$nodeWithSpan(importer, stylesheet, configuration, namesInErrors, nodeWithSpan) { + var _0_0, currentConfiguration, t2, t3, message, existingSpan, configurationSpan, environment, css, preModuleComments, extensionStore, module, _this = this, + t1 = stylesheet.span, + url = t1.get$sourceUrl(t1); + t1 = _this._modules; + _0_0 = t1.$index(0, url); + if (_0_0 != null) { + t1 = configuration == null; + currentConfiguration = t1 ? _this._configuration : configuration; + t2 = _this._moduleConfigurations.$index(0, url); + t3 = t2.__originalConfiguration; + t2 = t3 == null ? t2 : t3; + t3 = currentConfiguration.__originalConfiguration; + if (t2 !== (t3 == null ? currentConfiguration : t3) && currentConfiguration instanceof A.ExplicitConfiguration) { + if (namesInErrors) { + t2 = $.$get$context(); + url.toString; + message = t2.prettyUri$1(url) + string$.x20was_a; + } else + message = string$.This_mw; + t2 = _this._moduleNodes.$index(0, url); + existingSpan = t2 == null ? null : t2.get$span(t2); + if (t1) { + t1 = currentConfiguration.nodeWithSpan; + configurationSpan = t1.get$span(t1); + } else + configurationSpan = null; + t1 = A.LinkedHashMap_LinkedHashMap$_empty(type$.FileSpan, type$.String); + if (existingSpan != null) + t1.$indexSet(0, existingSpan, "original load"); + if (configurationSpan != null) + t1.$indexSet(0, configurationSpan, "configuration"); + throw A.wrapException(t1.get$isEmpty(0) ? _this._evaluate$_exception$1(message) : _this._multiSpanException$3(message, "new load", t1)); + } + return _0_0; + } + environment = A.Environment$(); + css = A._Cell$(); + preModuleComments = A._Cell$(); + extensionStore = A.ExtensionStore$(); + _this._withEnvironment$2(environment, new A._EvaluateVisitor__execute_closure(_this, importer, stylesheet, extensionStore, configuration, css, preModuleComments)); + t2 = css._readLocal$0(); + t3 = preModuleComments._readLocal$0(); + module = environment.toModule$3(t2, t3 == null ? B.Map_empty0 : t3, extensionStore); + if (url != null) { + t1.$indexSet(0, url, module); + _this._moduleConfigurations.$indexSet(0, url, _this._configuration); + if (nodeWithSpan != null) + _this._moduleNodes.$indexSet(0, url, nodeWithSpan); + } + return module; + }, + _execute$2(importer, stylesheet) { + return this._execute$5$configuration$namesInErrors$nodeWithSpan(importer, stylesheet, null, false, null); + }, + _addOutOfOrderImports$0() { + var t1, t2, _this = this, _s5_ = "_root", + _s13_ = "_endOfImports", + _0_0 = _this._outOfOrderImports; + $label0$0: { + if (_0_0 == null) { + t1 = _this._assertInModule$2(_this.__root, _s5_).children; + break $label0$0; + } + t1 = _this._assertInModule$2(_this.__root, _s5_).children; + t1 = A.List_List$of(A.SubListIterable$(t1, 0, A.checkNotNullable(_this._assertInModule$2(_this.__endOfImports, _s13_), "count", type$.int), t1.$ti._eval$1("ListBase.E")), true, type$.ModifiableCssNode); + B.JSArray_methods.addAll$1(t1, _0_0); + t2 = _this._assertInModule$2(_this.__root, _s5_).children; + B.JSArray_methods.addAll$1(t1, A.SubListIterable$(t2, _this._assertInModule$2(_this.__endOfImports, _s13_), null, t2.$ti._eval$1("ListBase.E"))); + break $label0$0; + } + return t1; + }, + _combineCss$2$clone(root, clone) { + var selectors, _0_0, t1, imports, css, sorted, t2; + if (!B.JSArray_methods.any$1(root.get$upstream(), new A._EvaluateVisitor__combineCss_closure())) { + selectors = root.get$extensionStore().get$simpleSelectors(); + _0_0 = A.IterableExtension_get_firstOrNull(root.get$extensionStore().extensionsWhereTarget$1(new A._EvaluateVisitor__combineCss_closure0(selectors))); + if (_0_0 != null) + this._throwForUnsatisfiedExtension$1(_0_0); + return root.get$css(root); + } + t1 = type$.JSArray_CssNode; + imports = A._setArrayType([], t1); + css = A._setArrayType([], t1); + t1 = type$.Module_Callable; + sorted = A.ListQueue$(t1); + new A._EvaluateVisitor__combineCss_visitModule(this, A.LinkedHashSet_LinkedHashSet$_empty(t1), clone, css, imports, sorted).call$1(root); + if (root.get$transitivelyContainsExtensions()) + this._extendModules$1(sorted); + t1 = B.JSArray_methods.$add(imports, css); + t2 = root.get$css(root); + return new A.CssStylesheet(new A.UnmodifiableListView(t1, type$.UnmodifiableListView_CssNode), t2.get$span(t2)); + }, + _combineCss$1(root) { + return this._combineCss$2$clone(root, false); + }, + _extendModules$1(sortedModules) { + var t1, t2, t3, originalSelectors, $self, t4, t5, _i, upstream, _0_0, + downstreamExtensionStores = A.LinkedHashMap_LinkedHashMap$_empty(type$.Uri, type$.List_ExtensionStore), + unsatisfiedExtensions = new A._LinkedIdentityHashSet(type$._LinkedIdentityHashSet_Extension); + for (t1 = A._ListQueueIterator$(sortedModules, sortedModules.$ti._precomputed1), t2 = t1.$ti._precomputed1; t1.moveNext$0();) { + t3 = t1._collection$_current; + if (t3 == null) + t3 = t2._as(t3); + originalSelectors = t3.get$extensionStore().get$simpleSelectors().toSet$0(0); + unsatisfiedExtensions.addAll$1(0, t3.get$extensionStore().extensionsWhereTarget$1(new A._EvaluateVisitor__extendModules_closure(originalSelectors))); + $self = downstreamExtensionStores.$index(0, t3.get$url(t3)); + t4 = t3.get$extensionStore().get$addExtensions(); + if ($self != null) + t4.call$1($self); + t4 = t3.get$extensionStore(); + if (t4.get$isEmpty(t4)) + continue; + for (t4 = t3.get$upstream(), t5 = t4.length, _i = 0; _i < t4.length; t4.length === t5 || (0, A.throwConcurrentModificationError)(t4), ++_i) { + upstream = t4[_i]; + _0_0 = upstream.get$url(upstream); + if (_0_0 != null) + J.add$1$ax(downstreamExtensionStores.putIfAbsent$2(_0_0, new A._EvaluateVisitor__extendModules_closure0()), t3.get$extensionStore()); + } + unsatisfiedExtensions.removeAll$1(t3.get$extensionStore().extensionsWhereTarget$1(originalSelectors.get$contains(originalSelectors))); + } + if (unsatisfiedExtensions._collection$_length !== 0) + this._throwForUnsatisfiedExtension$1(unsatisfiedExtensions.get$first(0)); + }, + _throwForUnsatisfiedExtension$1(extension) { + throw A.wrapException(A.SassException$(string$.The_ta + extension.target.toString$0(0) + ' !optional" to avoid this error.', extension.span, null)); + }, + _indexAfterImports$1(statements) { + var t1, lastImport, i, _0_0; + for (t1 = J.getInterceptor$asx(statements), lastImport = -1, i = 0; i < t1.get$length(statements); ++i) { + $label0$0: { + _0_0 = t1.$index(statements, i); + if (_0_0 instanceof A.ModifiableCssImport) + break $label0$0; + if (_0_0 instanceof A.ModifiableCssComment) + continue; + break; + } + lastImport = i; + } + return lastImport + 1; + }, + visitStylesheet$1(node) { + var t1, t2, _i; + for (t1 = node.children, t2 = t1.length, _i = 0; _i < t2; ++_i) + t1[_i].accept$1(this); + return null; + }, + visitAtRootRule$1(node) { + var t1, _2_0, root, first, rest, innerCopy, outerCopy, _i, copy, _this = this, + _s8_ = "__parent", + _0_0 = node.query, + query = _0_0 != null ? A.AtRootQueryParser$(_this._performInterpolationWithMap$2$warnForColor(_0_0, true)._0, _this._evaluate$_logger, null).parse$0() : B.AtRootQuery_UsS, + $parent = _this._assertInModule$2(_this.__parent, _s8_), + included = A._setArrayType([], type$.JSArray_ModifiableCssParentNode); + for (t1 = type$.CssStylesheet; !t1._is($parent); $parent = _2_0) { + if (!query.excludes$1($parent)) + included.push($parent); + _2_0 = $parent._parent; + if (_2_0 == null) + throw A.wrapException(A.StateError$(string$.CssNod)); + } + root = _this._trimIncluded$1(included); + if (root === _this._assertInModule$2(_this.__parent, _s8_)) { + _this._environment.scope$1$2$when(new A._EvaluateVisitor_visitAtRootRule_closure(_this, node), node.hasDeclarations, type$.Null); + return null; + } + if (included.length >= 1) { + first = included[0]; + rest = B.JSArray_methods.sublist$1(included, 1); + innerCopy = first.copyWithoutChildren$0(); + for (t1 = rest.length, outerCopy = innerCopy, _i = 0; _i < rest.length; rest.length === t1 || (0, A.throwConcurrentModificationError)(rest), ++_i, outerCopy = copy) { + copy = rest[_i].copyWithoutChildren$0(); + copy.addChild$1(outerCopy); + } + root.addChild$1(outerCopy); + } else + innerCopy = root; + _this._scopeForAtRoot$4(node, innerCopy, query, included).call$1(new A._EvaluateVisitor_visitAtRootRule_closure0(_this, node)); + return null; + }, + _trimIncluded$1(nodes) { + var $parent, t1, innermostContiguous, i, t2, _0_0, _1_0, root, _this = this, _null = null, _s5_ = "_root", + _s22_ = " to be an ancestor of "; + if (nodes.length === 0) + return _this._assertInModule$2(_this.__root, _s5_); + $parent = _this._assertInModule$2(_this.__parent, "__parent"); + for (t1 = nodes.length, innermostContiguous = _null, i = 0; i < t1; ++i, $parent = _1_0) { + for (; t2 = nodes[i], $parent !== t2; innermostContiguous = _null, $parent = _0_0) { + _0_0 = $parent._parent; + if (_0_0 == null) + throw A.wrapException(A.ArgumentError$("Expected " + t2.toString$0(0) + _s22_ + _this.toString$0(0) + ".", _null)); + } + if (innermostContiguous == null) + innermostContiguous = i; + _1_0 = $parent._parent; + if (_1_0 == null) + throw A.wrapException(A.ArgumentError$("Expected " + t2.toString$0(0) + _s22_ + _this.toString$0(0) + ".", _null)); + } + if ($parent !== _this._assertInModule$2(_this.__root, _s5_)) + return _this._assertInModule$2(_this.__root, _s5_); + innermostContiguous.toString; + root = nodes[innermostContiguous]; + B.JSArray_methods.removeRange$2(nodes, innermostContiguous, nodes.length); + return root; + }, + _scopeForAtRoot$4(node, newParent, query, included) { + var _this = this, + scope = new A._EvaluateVisitor__scopeForAtRoot_closure(_this, newParent, node), + t1 = query._all || query._at_root_query$_rule; + if (t1 !== query.include) + scope = new A._EvaluateVisitor__scopeForAtRoot_closure0(_this, scope); + if (_this._mediaQueries != null && query.excludesName$1("media")) + scope = new A._EvaluateVisitor__scopeForAtRoot_closure1(_this, scope); + if (_this._inKeyframes && query.excludesName$1("keyframes")) + scope = new A._EvaluateVisitor__scopeForAtRoot_closure2(_this, scope); + return _this._inUnknownAtRule && !B.JSArray_methods.any$1(included, new A._EvaluateVisitor__scopeForAtRoot_closure3()) ? new A._EvaluateVisitor__scopeForAtRoot_closure4(_this, scope) : scope; + }, + visitContentBlock$1(node) { + return A.throwExpression(A.UnsupportedError$(string$.Evalua)); + }, + visitContentRule$1(node) { + var $content = this._environment._content; + if ($content == null) + return null; + this._runUserDefinedCallable$1$4(node.$arguments, $content, node, new A._EvaluateVisitor_visitContentRule_closure(this, $content), type$.Null); + return null; + }, + visitDebugRule$1(node) { + var value = node.expression.accept$1(this), + t1 = value instanceof A.SassString ? value._string$_text : A.serializeValue(value, true, true); + this._evaluate$_logger.debug$2(0, t1, node.span); + return null; + }, + visitDeclaration$1(node) { + var t2, $name, _0_0, _1_0, value, t3, t4, t5, _2_0, oldDeclarationName, _this = this, _null = null, t1 = {}; + if ((_this._atRootExcludingStyleRule ? _null : _this._styleRuleIgnoringAtRoot) == null && !_this._inUnknownAtRule && !_this._inKeyframes) + throw A.wrapException(_this._evaluate$_exception$2(string$.Declarm, node.span)); + if (_this._declarationName != null && B.JSString_methods.startsWith$1(node.name.get$initialPlain(), "--")) + throw A.wrapException(_this._evaluate$_exception$2(string$.Declarw, node.span)); + t2 = node.name; + $name = _this._interpolationToValue$2$warnForColor(t2, true); + _0_0 = _this._declarationName; + if (_0_0 != null) + $name = new A.CssValue(_0_0 + "-" + A.S($name.value), $name.span, type$.CssValue_String); + _1_0 = node.value; + if (_1_0 != null) { + value = _1_0.accept$1(_this); + if (!value.get$isBlank() || value.get$asList().length === 0) { + t3 = _this._assertInModule$2(_this.__parent, "__parent"); + t4 = _1_0.get$span(_1_0); + t2 = B.JSString_methods.startsWith$1(t2.get$initialPlain(), "--"); + if (_this._sourceMap) { + t5 = A.NullableExtension_andThen(_1_0, _this.get$_expressionNode()); + t5 = t5 == null ? _null : J.get$span$z(t5); + } else + t5 = _null; + t3.addChild$1(A.ModifiableCssDeclaration$($name, new A.CssValue(value, t4, type$.CssValue_Value), node.span, t2, t5)); + } else if (J.startsWith$1$s($name.value, "--")) + throw A.wrapException(_this._evaluate$_exception$2("Custom property values may not be empty.", _1_0.get$span(_1_0))); + } + t1.children = null; + _2_0 = node.children; + if (_2_0 != null) { + t1.children = _2_0; + oldDeclarationName = _this._declarationName; + _this._declarationName = $name.value; + _this._environment.scope$1$2$when(new A._EvaluateVisitor_visitDeclaration_closure(t1, _this), node.hasDeclarations, type$.Null); + _this._declarationName = oldDeclarationName; + } + return _null; + }, + visitEachRule$1(node) { + var _this = this, _box_0 = {}, + t1 = node.list, + list = t1.accept$1(_this), + nodeWithSpan = _this._expressionNode$1(t1), + _0_0 = node.variables; + $label0$0: { + _box_0.variable = null; + if (_0_0.length === 1) { + _box_0.variable = _0_0[0]; + t1 = new A._EvaluateVisitor_visitEachRule_closure(_box_0, _this, nodeWithSpan); + break $label0$0; + } + _box_0.variables = null; + _box_0.variables = _0_0; + t1 = new A._EvaluateVisitor_visitEachRule_closure0(_box_0, _this, nodeWithSpan); + break $label0$0; + } + return _this._environment.scope$1$2$semiGlobal(new A._EvaluateVisitor_visitEachRule_closure1(_this, list, t1, node), true, type$.nullable_Value); + }, + _setMultipleVariables$3(variables, value, nodeWithSpan) { + var i, + list = value.get$asList(), + t1 = variables.length, + minLength = Math.min(t1, list.length); + for (i = 0; i < minLength; ++i) + this._environment.setLocalVariable$3(variables[i], this._withoutSlash$2(list[i], nodeWithSpan), nodeWithSpan); + for (i = minLength; i < t1; ++i) + this._environment.setLocalVariable$3(variables[i], B.C__SassNull, nodeWithSpan); + }, + visitErrorRule$1(node) { + throw A.wrapException(this._evaluate$_exception$2(J.toString$0$(node.expression.accept$1(this)), node.span)); + }, + visitExtendRule$1(node) { + var t1, t2, t3, t4, t5, _i, complex, visitor, t6, t7, _0_0, compound, _this = this, _null = null, + styleRule = _this._atRootExcludingStyleRule ? _null : _this._styleRuleIgnoringAtRoot; + if (styleRule == null || _this._declarationName != null) + throw A.wrapException(_this._evaluate$_exception$2(string$.x40exten, node.span)); + for (t1 = styleRule.originalSelector.components, t2 = t1.length, t3 = node.span, t4 = type$.SourceSpan, t5 = type$.String, _i = 0; _i < t2; ++_i) { + complex = t1[_i]; + if (!complex.accept$1(B._IsBogusVisitor_true)) + continue; + visitor = A._SerializeVisitor$(_null, true, _null, true, false, _null, true); + complex.accept$1(visitor); + t6 = B.JSString_methods.trim$0(visitor._serialize$_buffer.toString$0(0)); + t7 = complex.accept$1(B.C__IsUselessVisitor) ? "can't" : "shouldn't"; + _this._warn$3('The selector "' + t6 + '" is invalid CSS and ' + t7 + string$.x20be_an, new A.MultiSpan(A.SpanExtensions_trimRight(complex.span), "invalid selector", A.ConstantMap_ConstantMap$from(A.LinkedHashMap_LinkedHashMap$_literal([t3, "@extend rule"], t4, t5), t4, t5)), B.Deprecation_vrR); + } + _0_0 = _this._performInterpolationWithMap$2$warnForColor(node.selector, true); + for (t1 = A.SelectorList_SelectorList$parse(A.trimAscii(_0_0._0, true), false, true, _0_0._1, _this._evaluate$_logger).components, t2 = t1.length, t3 = styleRule._style_rule$_selector._box$_inner, _i = 0; _i < t2; ++_i) { + complex = t1[_i]; + compound = complex.get$singleCompound(); + if (compound == null) + throw A.wrapException(A.SassFormatException$("complex selectors may not be extended.", complex.span, _null)); + t4 = compound.components; + t5 = t4.length === 1 ? B.JSArray_methods.get$first(t4) : _null; + if (t5 == null) + throw A.wrapException(A.SassFormatException$(string$.compou + B.JSArray_methods.join$1(t4, ", ") + string$.x60_inst, compound.span, _null)); + _this._assertInModule$2(_this.__extensionStore, "_extensionStore").addExtension$4(t3.value, t5, node, _this._mediaQueries); + } + return _null; + }, + visitAtRule$1(node) { + var $name, value, children, wasInKeyframes, wasInUnknownAtRule, _this = this; + if (_this._declarationName != null) + throw A.wrapException(_this._evaluate$_exception$2(string$.At_rul, node.span)); + $name = _this._interpolationToValue$1(node.name); + value = A.NullableExtension_andThen(node.value, new A._EvaluateVisitor_visitAtRule_closure(_this)); + children = node.children; + if (children == null) { + _this._assertInModule$2(_this.__parent, "__parent").addChild$1(A.ModifiableCssAtRule$($name, node.span, true, value)); + return null; + } + wasInKeyframes = _this._inKeyframes; + wasInUnknownAtRule = _this._inUnknownAtRule; + if (A.unvendor($name.value) === "keyframes") + _this._inKeyframes = true; + else + _this._inUnknownAtRule = true; + _this._withParent$2$4$scopeWhen$through(A.ModifiableCssAtRule$($name, node.span, false, value), new A._EvaluateVisitor_visitAtRule_closure0(_this, $name, children), node.hasDeclarations, new A._EvaluateVisitor_visitAtRule_closure1(), type$.ModifiableCssAtRule, type$.Null); + _this._inUnknownAtRule = wasInUnknownAtRule; + _this._inKeyframes = wasInKeyframes; + return null; + }, + visitForRule$1(node) { + var _this = this, t1 = {}, + t2 = node.from, + fromNumber = _this._addExceptionSpan$2(t2, new A._EvaluateVisitor_visitForRule_closure(_this, node)), + t3 = node.to, + toNumber = _this._addExceptionSpan$2(t3, new A._EvaluateVisitor_visitForRule_closure0(_this, node)), + from = _this._addExceptionSpan$2(t2, new A._EvaluateVisitor_visitForRule_closure1(fromNumber)), + to = t1.to = _this._addExceptionSpan$2(t3, new A._EvaluateVisitor_visitForRule_closure2(toNumber, fromNumber)), + direction = from > to ? -1 : 1; + if (from === (!node.isExclusive ? t1.to = to + direction : to)) + return null; + return _this._environment.scope$1$2$semiGlobal(new A._EvaluateVisitor_visitForRule_closure3(t1, _this, node, from, direction, fromNumber), true, type$.nullable_Value); + }, + visitForwardRule$1(node) { + var newConfiguration, t4, _i, variable, $name, _this = this, + _s8_ = "@forward", + oldConfiguration = _this._configuration, + adjustedConfiguration = oldConfiguration.throughForward$1(node), + t1 = node.configuration, + t2 = t1.length, + t3 = node.url; + if (t2 !== 0) { + newConfiguration = _this._addForwardConfiguration$2(adjustedConfiguration, node); + _this._loadModule$5$configuration(t3, _s8_, node, new A._EvaluateVisitor_visitForwardRule_closure(_this, node), newConfiguration); + t3 = type$.String; + t4 = A.LinkedHashSet_LinkedHashSet$_empty(t3); + for (_i = 0; _i < t2; ++_i) { + variable = t1[_i]; + if (!variable.isGuarded) + t4.add$1(0, variable.name); + } + _this._removeUsedConfiguration$3$except(adjustedConfiguration, newConfiguration, t4); + t3 = A.LinkedHashSet_LinkedHashSet$_empty(t3); + for (_i = 0; _i < t2; ++_i) + t3.add$1(0, t1[_i].name); + for (t1 = newConfiguration._configuration$_values, t2 = J.toList$0$ax(t1.get$keys(t1)), t4 = t2.length, _i = 0; _i < t2.length; t2.length === t4 || (0, A.throwConcurrentModificationError)(t2), ++_i) { + $name = t2[_i]; + if (!t3.contains$1(0, $name)) + if (!t1.get$isEmpty(t1)) + t1.remove$1(0, $name); + } + _this._assertConfigurationIsEmpty$1(newConfiguration); + } else { + _this._configuration = adjustedConfiguration; + _this._loadModule$4(t3, _s8_, node, new A._EvaluateVisitor_visitForwardRule_closure0(_this, node)); + _this._configuration = oldConfiguration; + } + return null; + }, + _addForwardConfiguration$2(configuration, node) { + var t2, t3, _i, variable, t4, oldValue, t5, variableNodeWithSpan, _null = null, + t1 = configuration._configuration$_values, + newValues = A.LinkedHashMap_LinkedHashMap$of(new A.UnmodifiableMapView(t1, type$.UnmodifiableMapView_String_ConfiguredValue), type$.String, type$.ConfiguredValue); + for (t2 = node.configuration, t3 = t2.length, _i = 0; _i < t3; ++_i) { + variable = t2[_i]; + if (variable.isGuarded) { + t4 = variable.name; + oldValue = t1.get$isEmpty(t1) ? _null : t1.remove$1(0, t4); + if (oldValue != null) + t5 = !oldValue.value.$eq(0, B.C__SassNull); + else { + oldValue = _null; + t5 = false; + } + if (t5) { + newValues.$indexSet(0, t4, oldValue); + continue; + } + } + t4 = variable.expression; + variableNodeWithSpan = this._expressionNode$1(t4); + newValues.$indexSet(0, variable.name, new A.ConfiguredValue(this._withoutSlash$2(t4.accept$1(this), variableNodeWithSpan), variable.span, variableNodeWithSpan)); + } + if (configuration instanceof A.ExplicitConfiguration || t1.get$isEmpty(t1)) + return new A.ExplicitConfiguration(node, newValues, _null); + else + return new A.Configuration(newValues, _null); + }, + _registerCommentsForModule$1(module) { + var _this = this, _s5_ = "_root", + t1 = _this.__root; + if (t1 == null) + return; + if (_this._assertInModule$2(t1, _s5_).children.get$length(0) === 0 || !module.get$transitivelyContainsCss()) + return; + t1 = _this._preModuleComments; + if (t1 == null) + t1 = _this._preModuleComments = A.LinkedHashMap_LinkedHashMap$_empty(type$.Module_Callable, type$.List_CssComment); + J.addAll$1$ax(t1.putIfAbsent$2(module, new A._EvaluateVisitor__registerCommentsForModule_closure()), new A.UnmodifiableListView(J.cast$1$0$ax(_this._assertInModule$2(_this.__root, _s5_).children._collection$_source, type$.CssComment), type$.UnmodifiableListView_CssComment)); + _this._assertInModule$2(_this.__root, _s5_).clearChildren$0(); + _this.__endOfImports = 0; + }, + _removeUsedConfiguration$3$except(upstream, downstream, except) { + var t1, t2, t3, t4, _i, $name; + for (t1 = upstream._configuration$_values, t2 = J.toList$0$ax(t1.get$keys(t1)), t3 = t2.length, t4 = downstream._configuration$_values, _i = 0; _i < t2.length; t2.length === t3 || (0, A.throwConcurrentModificationError)(t2), ++_i) { + $name = t2[_i]; + if (except.contains$1(0, $name)) + continue; + if (!t4.containsKey$1($name)) + if (!t1.get$isEmpty(t1)) + t1.remove$1(0, $name); + } + }, + _assertConfigurationIsEmpty$2$nameInError(configuration, nameInError) { + var t1, _0_0, $name, value; + if (!(configuration instanceof A.ExplicitConfiguration)) + return; + t1 = configuration._configuration$_values; + if (t1.get$isEmpty(t1)) + return; + t1 = A.MapExtensions_get_pairs(new A.UnmodifiableMapView(t1, type$.UnmodifiableMapView_String_ConfiguredValue), type$.String, type$.ConfiguredValue); + _0_0 = t1.get$first(t1); + $name = _0_0._0; + value = _0_0._1; + t1 = nameInError ? "$" + $name + string$.x20was_n : string$.This_v; + throw A.wrapException(this._evaluate$_exception$2(t1, value.configurationSpan)); + }, + _assertConfigurationIsEmpty$1(configuration) { + return this._assertConfigurationIsEmpty$2$nameInError(configuration, false); + }, + visitFunctionRule$1(node) { + var t1 = this._environment, + t2 = t1.closure$0(), + t3 = this._inDependency, + t4 = t1._functions, + index = t4.length - 1, + t5 = node.name; + t1._functionIndices.$indexSet(0, t5, index); + J.$indexSet$ax(t4[index], t5, new A.UserDefinedCallable(node, t2, t3, type$.UserDefinedCallable_Environment)); + return null; + }, + visitIfRule$1(node) { + var t1, t2, _i, clauseToCheck, + clause = node.lastClause; + for (t1 = node.clauses, t2 = t1.length, _i = 0; _i < t2; ++_i) { + clauseToCheck = t1[_i]; + if (clauseToCheck.expression.accept$1(this).get$isTruthy()) { + clause = clauseToCheck; + break; + } + } + return A.NullableExtension_andThen(clause, new A._EvaluateVisitor_visitIfRule_closure(this)); + }, + visitImportRule$1(node) { + var t1, t2, t3, t4, t5, t6, _i, $import, t7, _0_0, $self, t8, _this = this, + _s8_ = "__parent", + _s5_ = "_root", + _s13_ = "_endOfImports"; + for (t1 = node.imports, t2 = t1.length, t3 = type$.CssValue_String, t4 = _this.get$_interpolationToValue(), t5 = type$.StaticImport, t6 = type$.JSArray_ModifiableCssImport, _i = 0; _i < t2; ++_i) { + $import = t1[_i]; + if ($import instanceof A.DynamicImport) + _this._visitDynamicImport$1($import); + else { + t5._as($import); + t7 = $import.url; + _0_0 = _this._performInterpolationHelper$3$sourceMap$warnForColor(t7, false, false); + $self = $import.modifiers; + t8 = $self == null ? null : t4.call$1($self); + node = new A.ModifiableCssImport(new A.CssValue(_0_0._0, t7.span, t3), t8, $import.span); + if (_this._assertInModule$2(_this.__parent, _s8_) !== _this._assertInModule$2(_this.__root, _s5_)) + _this._assertInModule$2(_this.__parent, _s8_).addChild$1(node); + else if (_this._assertInModule$2(_this.__endOfImports, _s13_) === J.get$length$asx(_this._assertInModule$2(_this.__root, _s5_).children._collection$_source)) { + t7 = _this._assertInModule$2(_this.__root, _s5_); + node._parent = t7; + t7 = t7._children; + node._indexInParent = t7.length; + t7.push(node); + _this.__endOfImports = _this._assertInModule$2(_this.__endOfImports, _s13_) + 1; + } else { + t7 = _this._outOfOrderImports; + (t7 == null ? _this._outOfOrderImports = A._setArrayType([], t6) : t7).push(node); + } + } + } + return null; + }, + _visitDynamicImport$1($import) { + return this._withStackFrame$3("@import", $import, new A._EvaluateVisitor__visitDynamicImport_closure(this, $import)); + }, + _loadStylesheet$4$baseUrl$forImport(url, span, baseUrl, forImport) { + var importCache, _0_0, importer, canonicalUrl, originalUrl, _1_0, isDependency, stylesheet, _2_0, error, stackTrace, error0, stackTrace0, message, t1, t2, t3, t4, exception, message0, _this = this; + baseUrl = baseUrl; + try { + _this._importSpan = span; + importCache = null; + _0_0 = _this._evaluate$_importCache; + if (_0_0 != null) { + importCache = _0_0; + if (baseUrl == null) { + t1 = _this._assertInModule$2(_this.__stylesheet, "_stylesheet").span; + baseUrl = t1.get$sourceUrl(t1); + } + importer = null; + canonicalUrl = null; + originalUrl = null; + _1_0 = J.canonicalize$4$baseImporter$baseUrl$forImport$x(importCache, A.Uri_parse(url), _this._importer, baseUrl, forImport); + if (type$.Record_3_nullable_Object_and_nullable_Object_and_nullable_Object_originalUrl._is(_1_0)) { + importer = _1_0._0; + canonicalUrl = _1_0._1; + originalUrl = _1_0._2; + _this._loadedUrls.add$1(0, canonicalUrl); + isDependency = _this._inDependency || !J.$eq$(importer, _this._importer); + stylesheet = null; + t1 = importCache; + t2 = importer; + t3 = canonicalUrl; + t4 = originalUrl; + _2_0 = t1.importCanonical$4$originalUrl$quiet(t2, t3, t4, _this._quietDeps && isDependency); + if (_2_0 != null) { + stylesheet = _2_0; + t1 = stylesheet; + t2 = importer; + return new A._Record_3_importer_isDependency(t1, t2, isDependency); + } + } + } + if (B.JSString_methods.startsWith$1(url, "package:") && true) + throw A.wrapException(string$.x22packa); + else + throw A.wrapException("Can't find stylesheet to import."); + } catch (exception) { + t1 = A.unwrapException(exception); + if (t1 instanceof A.SassException) + throw exception; + else if (t1 instanceof A.ArgumentError) { + error = t1; + stackTrace = A.getTraceFromException(exception); + A.throwWithTrace(_this._evaluate$_exception$1(J.toString$0$(error)), error, stackTrace); + } else { + error0 = t1; + stackTrace0 = A.getTraceFromException(exception); + message = null; + try { + message = A._asString(J.get$message$x(error0)); + } catch (exception) { + message0 = J.toString$0$(error0); + message = message0; + } + A.throwWithTrace(_this._evaluate$_exception$1(message), error0, stackTrace0); + } + } finally { + _this._importSpan = null; + } + }, + _loadStylesheet$3$baseUrl(url, span, baseUrl) { + return this._loadStylesheet$4$baseUrl$forImport(url, span, baseUrl, false); + }, + _loadStylesheet$3$forImport(url, span, forImport) { + return this._loadStylesheet$4$baseUrl$forImport(url, span, null, forImport); + }, + _applyMixin$5(mixin, contentCallable, $arguments, nodeWithSpan, nodeWithSpanWithoutContent) { + var t1, _0_0, _1_8, t2, _this = this, + _s37_ = "Mixin doesn't accept a content block.", + _s10_ = "invocation"; + $label0$0: { + if (mixin == null) + throw A.wrapException(_this._evaluate$_exception$2("Undefined mixin.", nodeWithSpan.get$span(nodeWithSpan))); + t1 = mixin instanceof A.BuiltInCallable; + if (t1 && !mixin.acceptsContent && contentCallable != null) { + t1 = _this._evaluateArguments$1($arguments)._values; + _0_0 = mixin.callbackFor$2(t1[2].length, new A.MapKeySet(t1[0], type$.MapKeySet_String)); + throw A.wrapException(A.MultiSpanSassRuntimeException$(_s37_, nodeWithSpanWithoutContent.get$span(nodeWithSpanWithoutContent), _s10_, A.LinkedHashMap_LinkedHashMap$_literal([_0_0._0.get$spanWithName(), "declaration"], type$.FileSpan, type$.String), _this._evaluate$_stackTrace$1(nodeWithSpanWithoutContent.get$span(nodeWithSpanWithoutContent)), null)); + } + if (t1) { + _this._environment.withContent$2(contentCallable, new A._EvaluateVisitor__applyMixin_closure(_this, $arguments, mixin, nodeWithSpanWithoutContent)); + break $label0$0; + } + t1 = type$.UserDefinedCallable_Environment._is(mixin); + if (t1) { + _1_8 = mixin.declaration; + if (_1_8 instanceof A.MixinRule) + t2 = !type$.MixinRule._as(_1_8).get$hasContent() && contentCallable != null; + else + t2 = false; + } else + t2 = false; + if (t2) + throw A.wrapException(A.MultiSpanSassRuntimeException$(_s37_, nodeWithSpanWithoutContent.get$span(nodeWithSpanWithoutContent), _s10_, A.LinkedHashMap_LinkedHashMap$_literal([mixin.declaration.$arguments.get$spanWithName(), "declaration"], type$.FileSpan, type$.String), _this._evaluate$_stackTrace$1(nodeWithSpanWithoutContent.get$span(nodeWithSpanWithoutContent)), null)); + if (t1) { + _this._runUserDefinedCallable$1$4($arguments, mixin, nodeWithSpanWithoutContent, new A._EvaluateVisitor__applyMixin_closure0(_this, contentCallable, mixin, nodeWithSpanWithoutContent), type$.Null); + break $label0$0; + } + throw A.wrapException(A.UnsupportedError$("Unknown callable type " + mixin.toString$0(0) + ".")); + } + }, + visitIncludeRule$1(node) { + var _this = this; + _this._applyMixin$5(_this._addExceptionSpan$2(node, new A._EvaluateVisitor_visitIncludeRule_closure(_this, node)), A.NullableExtension_andThen(node.content, new A._EvaluateVisitor_visitIncludeRule_closure0(_this)), node.$arguments, node, new A._FakeAstNode(new A._EvaluateVisitor_visitIncludeRule_closure1(node))); + return null; + }, + visitMixinRule$1(node) { + var t1 = this._environment, + t2 = t1.closure$0(), + t3 = this._inDependency, + t4 = t1._mixins, + index = t4.length - 1, + t5 = node.name; + t1._mixinIndices.$indexSet(0, t5, index); + J.$indexSet$ax(t4[index], t5, new A.UserDefinedCallable(node, t2, t3, type$.UserDefinedCallable_Environment)); + return null; + }, + visitLoudComment$1(node) { + var t1, _this = this, + _s8_ = "__parent", + _s13_ = "_endOfImports"; + if (_this._inFunction) + return null; + if (_this._assertInModule$2(_this.__parent, _s8_) === _this._assertInModule$2(_this.__root, "_root") && _this._assertInModule$2(_this.__endOfImports, _s13_) === J.get$length$asx(_this._assertInModule$2(_this.__root, "_root").children._collection$_source)) + _this.__endOfImports = _this._assertInModule$2(_this.__endOfImports, _s13_) + 1; + t1 = node.text; + _this._assertInModule$2(_this.__parent, _s8_).addChild$1(new A.ModifiableCssComment(_this._performInterpolation$1(t1), t1.span)); + return null; + }, + visitMediaRule$1(node) { + var _0_0, queries, mergedQueries, t1, mergedSources, t2, t3, _this = this; + if (_this._declarationName != null) + throw A.wrapException(_this._evaluate$_exception$2(string$.Media_, node.span)); + _0_0 = _this._performInterpolationWithMap$2$warnForColor(node.query, true); + queries = A.CssMediaQuery_parseList(_0_0._0, _0_0._1, _this._evaluate$_logger); + mergedQueries = A.NullableExtension_andThen(_this._mediaQueries, new A._EvaluateVisitor_visitMediaRule_closure(_this, queries)); + t1 = mergedQueries == null; + if (!t1 && J.get$isEmpty$asx(mergedQueries)) + return null; + if (t1) + mergedSources = B.Set_empty1; + else { + t2 = _this._mediaQuerySources; + t2.toString; + t2 = A.LinkedHashSet_LinkedHashSet$of(t2, type$.CssMediaQuery); + t3 = _this._mediaQueries; + t3.toString; + t2.addAll$1(0, t3); + t2.addAll$1(0, queries); + mergedSources = t2; + } + t1 = t1 ? queries : mergedQueries; + _this._withParent$2$4$scopeWhen$through(A.ModifiableCssMediaRule$(t1, node.span), new A._EvaluateVisitor_visitMediaRule_closure0(_this, mergedQueries, queries, mergedSources, node), node.hasDeclarations, new A._EvaluateVisitor_visitMediaRule_closure1(mergedSources), type$.ModifiableCssMediaRule, type$.Null); + return null; + }, + _mergeMediaQueries$2(queries1, queries2) { + var t1, t2, t3, t4, _0_0, result, t5, + queries = A._setArrayType([], type$.JSArray_CssMediaQuery); + for (t1 = J.get$iterator$ax(queries1), t2 = J.getInterceptor$ax(queries2); t1.moveNext$0();) { + t3 = t1.get$current(t1); + for (t4 = t2.get$iterator(queries2); t4.moveNext$0();) + $label0$1: { + _0_0 = t3.merge$1(t4.get$current(t4)); + if (B._SingletonCssMediaQueryMergeResult_0 === _0_0) + continue; + if (B._SingletonCssMediaQueryMergeResult_1 === _0_0) + return null; + if (_0_0 instanceof A.MediaQuerySuccessfulMergeResult) { + result = _0_0; + t5 = true; + } else { + result = null; + t5 = false; + } + if (t5) + queries.push(result.query); + break $label0$1; + } + } + return queries; + }, + visitReturnRule$1(node) { + var t1 = node.expression; + return this._withoutSlash$2(t1.accept$1(this), t1); + }, + visitSilentComment$1(node) { + return null; + }, + visitStyleRule$1(node) { + var t1, _0_0, selectorText, selectorMap, t2, parsedSelector, rule, oldAtRootExcludingStyleRule, t3, t4, t5, _i, complex, visitor, t6, t7, t8, t9, _this = this, _null = null, + _s11_ = "_stylesheet", + _s8_ = "__parent"; + if (_this._declarationName != null) + throw A.wrapException(_this._evaluate$_exception$2(string$.Style_, node.span)); + t1 = node.selector; + _0_0 = _this._performInterpolationWithMap$2$warnForColor(t1, true); + selectorText = _0_0._0; + selectorMap = _0_0._1; + if (_this._inKeyframes) { + _this._withParent$2$4$scopeWhen$through(A.ModifiableCssKeyframeBlock$(new A.CssValue(A.List_List$unmodifiable(A.KeyframeSelectorParser$(selectorText, selectorMap, _this._evaluate$_logger).parse$0(), type$.String), t1.span, type$.CssValue_List_String), node.span), new A._EvaluateVisitor_visitStyleRule_closure(_this, node), node.hasDeclarations, new A._EvaluateVisitor_visitStyleRule_closure0(), type$.ModifiableCssKeyframeBlock, type$.Null); + return _null; + } + t1 = A.SelectorList_SelectorList$parse(selectorText, !_this._assertInModule$2(_this.__stylesheet, _s11_).plainCss, !_this._assertInModule$2(_this.__stylesheet, _s11_).plainCss, selectorMap, _this._evaluate$_logger); + t2 = _this._styleRuleIgnoringAtRoot; + t2 = t2 == null ? _null : t2.originalSelector; + parsedSelector = t1.resolveParentSelectors$2$implicitParent(t2, !_this._atRootExcludingStyleRule); + rule = A.ModifiableCssStyleRule$(_this._assertInModule$2(_this.__extensionStore, "_extensionStore").addSelector$2(parsedSelector, _this._mediaQueries), node.span, parsedSelector); + oldAtRootExcludingStyleRule = _this._atRootExcludingStyleRule; + _this._atRootExcludingStyleRule = false; + _this._withParent$2$4$scopeWhen$through(rule, new A._EvaluateVisitor_visitStyleRule_closure1(_this, rule, node), node.hasDeclarations, new A._EvaluateVisitor_visitStyleRule_closure2(), type$.ModifiableCssStyleRule, type$.Null); + _this._atRootExcludingStyleRule = oldAtRootExcludingStyleRule; + if (!rule.accept$1(B._IsInvisibleVisitor_false_false)) + for (t1 = parsedSelector.components, t2 = t1.length, t3 = type$.SourceSpan, t4 = type$.String, t5 = rule.children, _i = 0; _i < t2; ++_i) { + complex = t1[_i]; + if (!complex.accept$1(B._IsBogusVisitor_true)) + continue; + if (complex.accept$1(B.C__IsUselessVisitor)) { + visitor = A._SerializeVisitor$(_null, true, _null, true, false, _null, true); + complex.accept$1(visitor); + _this._warn$3('The selector "' + B.JSString_methods.trim$0(visitor._serialize$_buffer.toString$0(0)) + string$.x22x20is_ix20, A.SpanExtensions_trimRight(complex.span), B.Deprecation_vrR); + } else if (complex.leadingCombinators.length !== 0) { + visitor = A._SerializeVisitor$(_null, true, _null, true, false, _null, true); + complex.accept$1(visitor); + _this._warn$3('The selector "' + B.JSString_methods.trim$0(visitor._serialize$_buffer.toString$0(0)) + string$.x22x20is_ix0a, A.SpanExtensions_trimRight(complex.span), B.Deprecation_vrR); + } else { + visitor = A._SerializeVisitor$(_null, true, _null, true, false, _null, true); + complex.accept$1(visitor); + t6 = B.JSString_methods.trim$0(visitor._serialize$_buffer.toString$0(0)); + t7 = complex.accept$1(B._IsBogusVisitor_false) ? string$.x20It_wi : ""; + t8 = A.SpanExtensions_trimRight(complex.span); + if (t5.get$length(0) === 0) + A.throwExpression(A.IterableElementError_noElement()); + t9 = J.get$span$z(t5.$index(0, 0)); + _this._warn$3('The selector "' + t6 + string$.x22x20is_o + t7 + string$.x0aThis_, new A.MultiSpan(t8, "invalid selector", A.ConstantMap_ConstantMap$from(A.LinkedHashMap_LinkedHashMap$_literal([t9, "this is not a style rule" + (t5.every$1(t5, new A._EvaluateVisitor_visitStyleRule_closure3()) ? "\n(try converting to a //-style comment)" : "")], t3, t4), t3, t4)), B.Deprecation_vrR); + } + } + if ((_this._atRootExcludingStyleRule ? _null : _this._styleRuleIgnoringAtRoot) == null) { + t1 = _this._assertInModule$2(_this.__parent, _s8_).children; + t1 = !t1.get$isEmpty(t1); + } else + t1 = false; + if (t1) { + t1 = _this._assertInModule$2(_this.__parent, _s8_).children; + t1.get$last(t1).isGroupEnd = true; + } + return _null; + }, + visitSupportsRule$1(node) { + var t1, _this = this; + if (_this._declarationName != null) + throw A.wrapException(_this._evaluate$_exception$2(string$.Suppor, node.span)); + t1 = node.condition; + _this._withParent$2$4$scopeWhen$through(A.ModifiableCssSupportsRule$(new A.CssValue(_this._visitSupportsCondition$1(t1), t1.get$span(t1), type$.CssValue_String), node.span), new A._EvaluateVisitor_visitSupportsRule_closure(_this, node), node.hasDeclarations, new A._EvaluateVisitor_visitSupportsRule_closure0(), type$.ModifiableCssSupportsRule, type$.Null); + return null; + }, + _visitSupportsCondition$1(condition) { + var t1, _this = this, _box_0 = {}; + $label0$0: { + if (condition instanceof A.SupportsOperation) { + t1 = condition.operator; + t1 = _this._parenthesize$2(condition.left, t1) + " " + t1 + " " + _this._parenthesize$2(condition.right, t1); + break $label0$0; + } + if (condition instanceof A.SupportsNegation) { + t1 = "not " + _this._parenthesize$1(condition.condition); + break $label0$0; + } + if (condition instanceof A.SupportsInterpolation) { + t1 = condition.expression; + t1 = _this._evaluate$_serialize$3$quote(t1.accept$1(_this), t1, false); + break $label0$0; + } + _box_0.declaration = null; + if (condition instanceof A.SupportsDeclaration) { + _box_0.declaration = condition; + t1 = _this._withSupportsDeclaration$1(new A._EvaluateVisitor__visitSupportsCondition_closure(_box_0, _this)); + break $label0$0; + } + if (condition instanceof A.SupportsFunction) { + t1 = _this._performInterpolation$1(condition.name) + "(" + _this._performInterpolation$1(condition.$arguments) + ")"; + break $label0$0; + } + if (condition instanceof A.SupportsAnything) { + t1 = "(" + _this._performInterpolation$1(condition.contents) + ")"; + break $label0$0; + } + t1 = A.throwExpression(A.ArgumentError$("Unknown supports condition type " + A.getRuntimeTypeOfDartObject(condition).toString$0(0) + ".", null)); + } + return t1; + }, + _withSupportsDeclaration$1$1(callback) { + var t1, + oldInSupportsDeclaration = this._inSupportsDeclaration; + this._inSupportsDeclaration = true; + try { + t1 = callback.call$0(); + return t1; + } finally { + this._inSupportsDeclaration = oldInSupportsDeclaration; + } + }, + _withSupportsDeclaration$1(callback) { + return this._withSupportsDeclaration$1$1(callback, type$.dynamic); + }, + _parenthesize$2(condition, operator) { + var t1; + if (!(condition instanceof A.SupportsNegation)) + if (condition instanceof A.SupportsOperation) + t1 = operator == null || operator !== condition.operator; + else + t1 = false; + else + t1 = true; + if (t1) + return "(" + this._visitSupportsCondition$1(condition) + ")"; + return this._visitSupportsCondition$1(condition); + }, + _parenthesize$1(condition) { + return this._parenthesize$2(condition, null); + }, + visitVariableDeclaration$1(node) { + var t2, value, _this = this, _null = null, t1 = {}; + if (node.isGuarded) { + if (node.namespace == null && _this._environment._variables.length === 1) { + t1.override = null; + t2 = _this._configuration._configuration$_values; + t2 = t2.get$isEmpty(t2) ? _null : t2.remove$1(0, node.name); + if (t2 != null) { + t1.override = t2; + t2 = !t2.value.$eq(0, B.C__SassNull); + } else + t2 = false; + if (t2) { + _this._addExceptionSpan$2(node, new A._EvaluateVisitor_visitVariableDeclaration_closure(t1, _this, node)); + return _null; + } + } + value = _this._addExceptionSpan$2(node, new A._EvaluateVisitor_visitVariableDeclaration_closure0(_this, node)); + if (value != null && !value.$eq(0, B.C__SassNull)) + return _null; + } + if (node.isGlobal && !_this._environment.globalVariableExists$1(node.name)) { + t1 = _this._environment._variables.length === 1 ? string$.As_of_S : string$.As_of_R + A.declarationName(node.span) + ": null` at the stylesheet root."; + _this._warn$3(t1, node.span, B.Deprecation_hzy); + } + t1 = node.expression; + _this._addExceptionSpan$2(node, new A._EvaluateVisitor_visitVariableDeclaration_closure1(_this, node, _this._withoutSlash$2(t1.accept$1(_this), t1))); + return _null; + }, + visitUseRule$1(node) { + var values, _i, variable, t3, variableNodeWithSpan, configuration, _this = this, + t1 = node.configuration, + t2 = t1.length; + if (t2 !== 0) { + values = A.LinkedHashMap_LinkedHashMap$_empty(type$.String, type$.ConfiguredValue); + for (_i = 0; _i < t2; ++_i) { + variable = t1[_i]; + t3 = variable.expression; + variableNodeWithSpan = _this._expressionNode$1(t3); + values.$indexSet(0, variable.name, new A.ConfiguredValue(_this._withoutSlash$2(t3.accept$1(_this), variableNodeWithSpan), variable.span, variableNodeWithSpan)); + } + configuration = new A.ExplicitConfiguration(node, values, null); + } else + configuration = B.Configuration_Map_empty_null; + _this._loadModule$5$configuration(node.url, "@use", node, new A._EvaluateVisitor_visitUseRule_closure(_this, node), configuration); + _this._assertConfigurationIsEmpty$1(configuration); + return null; + }, + visitWarnRule$1(node) { + var _this = this, + value = _this._addExceptionSpan$2(node, new A._EvaluateVisitor_visitWarnRule_closure(_this, node)), + t1 = value instanceof A.SassString ? value._string$_text : _this._evaluate$_serialize$2(value, node.expression); + _this._evaluate$_logger.warn$2$trace(0, t1, _this._evaluate$_stackTrace$1(node.span)); + return null; + }, + visitWhileRule$1(node) { + return this._environment.scope$1$3$semiGlobal$when(new A._EvaluateVisitor_visitWhileRule_closure(this, node), true, node.hasDeclarations, type$.nullable_Value); + }, + visitBinaryOperationExpression$1(node) { + var t1, _this = this; + if (_this._assertInModule$2(_this.__stylesheet, "_stylesheet").plainCss) { + t1 = node.operator; + t1 = t1 !== B.BinaryOperator_2jN && t1 !== B.BinaryOperator_t8B; + } else + t1 = false; + if (t1) + throw A.wrapException(_this._evaluate$_exception$2("Operators aren't allowed in plain CSS.", node.get$operatorSpan())); + return _this._addExceptionSpan$2(node, new A._EvaluateVisitor_visitBinaryOperationExpression_closure(_this, node)); + }, + _slash$3(left, right, node) { + var t1, right0, _1_2, _1_1, _1_2_isSet, _null = null, + result = left.dividedBy$1(right); + if (left instanceof A.SassNumber) { + t1 = type$.SassNumber; + t1._as(left); + if (right instanceof A.SassNumber) { + t1._as(right); + t1 = node.allowsSlash && this._operandAllowsSlash$1(node.left) && this._operandAllowsSlash$1(node.right); + right0 = right; + _1_2 = right0; + } else { + right0 = _null; + _1_2 = right; + t1 = false; + } + _1_1 = left; + _1_2_isSet = true; + } else { + right0 = _null; + _1_2 = right0; + _1_1 = left; + left = _1_2; + _1_2_isSet = false; + t1 = false; + } + if (t1) + return type$.SassNumber._as(result).withSlash$2(left, right0); + if (_1_1 instanceof A.SassNumber) + t1 = (_1_2_isSet ? _1_2 : right) instanceof A.SassNumber; + else + t1 = false; + if (t1) { + this._warn$3(string$.Using__o + A.S(new A._EvaluateVisitor__slash_recommendation().call$1(node)) + " or " + A.expressionToCalc(node).toString$0(0) + string$.x0a_Morex20, node.get$span(0), B.Deprecation_xHK); + return result; + } + return result; + }, + _operandAllowsSlash$1(node) { + var t1, t2; + if (node instanceof A.FunctionExpression) + if (node.namespace == null) { + t1 = node.originalName; + if (B.Set_WfnXb.contains$1(0, A.stringReplaceAllUnchecked(t1, "_", "-").toLowerCase())) { + t2 = this._environment; + t1 = t2.getFunction$1(A.stringReplaceAllUnchecked(t1, "_", "-")) == null; + } else + t1 = false; + } else + t1 = false; + else + t1 = true; + return t1; + }, + visitValueExpression$1(node) { + return node.value; + }, + visitVariableExpression$1(node) { + var result = this._addExceptionSpan$2(node, new A._EvaluateVisitor_visitVariableExpression_closure(this, node)); + if (result != null) + return result; + throw A.wrapException(this._evaluate$_exception$2("Undefined variable.", node.span)); + }, + visitUnaryOperationExpression$1(node) { + return this._addExceptionSpan$2(node, new A._EvaluateVisitor_visitUnaryOperationExpression_closure(node, node.operand.accept$1(this))); + }, + visitBooleanExpression$1(node) { + return node.value ? B.SassBoolean_true : B.SassBoolean_false; + }, + visitIfExpression$1(node) { + var condition, t1, ifTrue, ifFalse, result, _this = this, + _0_0 = _this._evaluateMacroArguments$1(node), + positional = _0_0._0, + named = _0_0._1; + _this._verifyArguments$4(positional.length, named, $.$get$IfExpression_declaration(), node); + condition = A.ListExtensions_elementAtOrNull(positional, 0); + if (condition == null) { + t1 = named.$index(0, "condition"); + t1.toString; + condition = t1; + } + ifTrue = A.ListExtensions_elementAtOrNull(positional, 1); + if (ifTrue == null) { + t1 = named.$index(0, "if-true"); + t1.toString; + ifTrue = t1; + } + ifFalse = A.ListExtensions_elementAtOrNull(positional, 2); + if (ifFalse == null) { + t1 = named.$index(0, "if-false"); + t1.toString; + ifFalse = t1; + } + result = condition.accept$1(_this).get$isTruthy() ? ifTrue : ifFalse; + return _this._withoutSlash$2(result.accept$1(_this), _this._expressionNode$1(result)); + }, + visitNullExpression$1(node) { + return B.C__SassNull; + }, + visitNumberExpression$1(node) { + return A.SassNumber_SassNumber(node.value, node.unit); + }, + visitParenthesizedExpression$1(node) { + var _this = this; + return _this._assertInModule$2(_this.__stylesheet, "_stylesheet").plainCss ? A.throwExpression(_this._evaluate$_exception$2("Parentheses aren't allowed in plain CSS.", node.span)) : node.expression.accept$1(_this); + }, + visitColorExpression$1(node) { + return node.value; + }, + visitListExpression$1(node) { + var t1 = node.contents; + return A.SassList$(new A.MappedListIterable(t1, new A._EvaluateVisitor_visitListExpression_closure(this), A._arrayInstanceType(t1)._eval$1("MappedListIterable<1,Value>")), node.separator, node.hasBrackets); + }, + visitMapExpression$1(node) { + var t2, t3, _i, t4, key, value, keyValue, valueValue, oldValueSpan, + t1 = type$.Value, + map = A.LinkedHashMap_LinkedHashMap$_empty(t1, t1), + keyNodes = A.LinkedHashMap_LinkedHashMap$_empty(t1, type$.AstNode); + for (t2 = node.pairs, t3 = t2.length, _i = 0; _i < t3; ++_i) { + t4 = t2[_i]; + key = t4._0; + value = t4._1; + keyValue = key.accept$1(this); + valueValue = value.accept$1(this); + if (map.containsKey$1(keyValue)) { + t1 = keyNodes.$index(0, keyValue); + oldValueSpan = t1 == null ? null : t1.get$span(t1); + t1 = key.get$span(key); + t2 = A.LinkedHashMap_LinkedHashMap$_empty(type$.FileSpan, type$.String); + if (oldValueSpan != null) + t2.$indexSet(0, oldValueSpan, "first key"); + throw A.wrapException(A.MultiSpanSassRuntimeException$("Duplicate key.", t1, "second key", t2, this._evaluate$_stackTrace$1(key.get$span(key)), null)); + } + map.$indexSet(0, keyValue, valueValue); + keyNodes.$indexSet(0, keyValue, key); + } + return new A.SassMap(A.ConstantMap_ConstantMap$from(map, t1, t1)); + }, + visitFunctionExpression$1(node) { + var t2, _0_0, t3, t4, oldInFunction, result, _this = this, + _s11_ = "_stylesheet", + t1 = {}, + $function = _this._assertInModule$2(_this.__stylesheet, _s11_).plainCss ? null : _this._addExceptionSpan$2(node, new A._EvaluateVisitor_visitFunctionExpression_closure(_this, node)); + t1.$function = $function; + if ($function == null) { + if (node.namespace != null) + throw A.wrapException(_this._evaluate$_exception$2("Undefined function.", node.span)); + t2 = node.originalName; + _0_0 = A.stringReplaceAllUnchecked(t2, "_", "-").toLowerCase(); + if ("min" === _0_0 || "max" === _0_0 || "round" === _0_0 || "abs" === _0_0) { + t3 = node.$arguments; + t4 = t3.named; + t3 = t4.get$isEmpty(t4) && t3.rest == null && B.JSArray_methods.every$1(t3.positional, new A._EvaluateVisitor_visitFunctionExpression_closure0()); + } else + t3 = false; + if (t3) + return _this._visitCalculation$2$inLegacySassFunction(node, true); + if ("calc" === _0_0 || "clamp" === _0_0 || "hypot" === _0_0 || "sin" === _0_0 || "cos" === _0_0 || "tan" === _0_0 || "asin" === _0_0 || "acos" === _0_0 || "atan" === _0_0 || "sqrt" === _0_0 || "exp" === _0_0 || "sign" === _0_0 || "mod" === _0_0 || "rem" === _0_0 || "atan2" === _0_0 || "pow" === _0_0 || "log" === _0_0) + return _this._visitCalculation$1(node); + if (_this._assertInModule$2(_this.__stylesheet, _s11_).plainCss) + $function = null; + else { + t3 = _this._builtInFunctions.$index(0, A.stringReplaceAllUnchecked(t2, "_", "-")); + $function = t3; + } + t1.$function = $function == null ? new A.PlainCssCallable(t2) : $function; + } + oldInFunction = _this._inFunction; + _this._inFunction = true; + result = _this._addErrorSpan$2(node, new A._EvaluateVisitor_visitFunctionExpression_closure1(t1, _this, node)); + _this._inFunction = oldInFunction; + return result; + }, + _visitCalculation$2$inLegacySassFunction(node, inLegacySassFunction) { + var $arguments, oldCallableNode, t1, _0_0, error, stackTrace, t4, _i, exception, _this = this, + t2 = node.$arguments, + t3 = t2.named; + if (t3.get$isNotEmpty(t3)) + throw A.wrapException(_this._evaluate$_exception$2(string$.Keywor, node.span)); + else if (t2.rest != null) + throw A.wrapException(_this._evaluate$_exception$2(string$.Rest_a, node.span)); + _this._checkCalculationArguments$1(node); + t3 = A._setArrayType([], type$.JSArray_Object); + for (t2 = t2.positional, t4 = t2.length, _i = 0; _i < t4; ++_i) + t3.push(_this._visitCalculationExpression$2$inLegacySassFunction(t2[_i], inLegacySassFunction)); + $arguments = t3; + if (_this._inSupportsDeclaration) + return new A.SassCalculation(A.stringReplaceAllUnchecked(node.originalName, "_", "-"), A.List_List$unmodifiable($arguments, type$.Object)); + oldCallableNode = _this._callableNode; + _this._callableNode = node; + try { + t1 = null; + _0_0 = A.stringReplaceAllUnchecked(node.originalName, "_", "-").toLowerCase(); + $label0$0: { + if ("calc" === _0_0) { + t1 = A.SassCalculation_calc(J.$index$asx($arguments, 0)); + break $label0$0; + } + if ("sqrt" === _0_0) { + t1 = A.SassCalculation__singleArgument("sqrt", J.$index$asx($arguments, 0), A.number0__sqrt$closure(), true); + break $label0$0; + } + if ("sin" === _0_0) { + t1 = A.SassCalculation__singleArgument("sin", J.$index$asx($arguments, 0), A.number0__sin$closure(), false); + break $label0$0; + } + if ("cos" === _0_0) { + t1 = A.SassCalculation__singleArgument("cos", J.$index$asx($arguments, 0), A.number0__cos$closure(), false); + break $label0$0; + } + if ("tan" === _0_0) { + t1 = A.SassCalculation__singleArgument("tan", J.$index$asx($arguments, 0), A.number0__tan$closure(), false); + break $label0$0; + } + if ("asin" === _0_0) { + t1 = A.SassCalculation__singleArgument("asin", J.$index$asx($arguments, 0), A.number0__asin$closure(), true); + break $label0$0; + } + if ("acos" === _0_0) { + t1 = A.SassCalculation__singleArgument("acos", J.$index$asx($arguments, 0), A.number0__acos$closure(), true); + break $label0$0; + } + if ("atan" === _0_0) { + t1 = A.SassCalculation__singleArgument("atan", J.$index$asx($arguments, 0), A.number0__atan$closure(), true); + break $label0$0; + } + if ("abs" === _0_0) { + t1 = A.SassCalculation_abs(J.$index$asx($arguments, 0)); + break $label0$0; + } + if ("exp" === _0_0) { + t1 = A.SassCalculation_exp(J.$index$asx($arguments, 0)); + break $label0$0; + } + if ("sign" === _0_0) { + t1 = A.SassCalculation_sign(J.$index$asx($arguments, 0)); + break $label0$0; + } + if ("min" === _0_0) { + t1 = A.SassCalculation_min($arguments); + break $label0$0; + } + if ("max" === _0_0) { + t1 = A.SassCalculation_max($arguments); + break $label0$0; + } + if ("hypot" === _0_0) { + t1 = A.SassCalculation_hypot($arguments); + break $label0$0; + } + if ("pow" === _0_0) { + t1 = A.SassCalculation_pow(J.$index$asx($arguments, 0), A.ListExtensions_elementAtOrNull($arguments, 1)); + break $label0$0; + } + if ("atan2" === _0_0) { + t1 = A.SassCalculation_atan2(J.$index$asx($arguments, 0), A.ListExtensions_elementAtOrNull($arguments, 1)); + break $label0$0; + } + if ("log" === _0_0) { + t1 = A.SassCalculation_log(J.$index$asx($arguments, 0), A.ListExtensions_elementAtOrNull($arguments, 1)); + break $label0$0; + } + if ("mod" === _0_0) { + t1 = A.SassCalculation_mod(J.$index$asx($arguments, 0), A.ListExtensions_elementAtOrNull($arguments, 1)); + break $label0$0; + } + if ("rem" === _0_0) { + t1 = A.SassCalculation_rem(J.$index$asx($arguments, 0), A.ListExtensions_elementAtOrNull($arguments, 1)); + break $label0$0; + } + if ("round" === _0_0) { + t1 = A.SassCalculation_round(J.$index$asx($arguments, 0), A.ListExtensions_elementAtOrNull($arguments, 1), A.ListExtensions_elementAtOrNull($arguments, 2)); + break $label0$0; + } + if ("clamp" === _0_0) { + t1 = A.SassCalculation_clamp(J.$index$asx($arguments, 0), A.ListExtensions_elementAtOrNull($arguments, 1), A.ListExtensions_elementAtOrNull($arguments, 2)); + break $label0$0; + } + t3 = A.UnsupportedError$('Unknown calculation name "' + node.get$name(0) + '".'); + t1 = A.throwExpression(t3); + } + t1 = t1; + return t1; + } catch (exception) { + t1 = A.unwrapException(exception); + if (t1 instanceof A.SassScriptException) { + error = t1; + stackTrace = A.getTraceFromException(exception); + if (B.JSString_methods.contains$1(error.message, "compatible")) + _this._verifyCompatibleNumbers$2($arguments, t2); + A.throwWithTrace(_this._evaluate$_exception$2(error.message, node.span), error, stackTrace); + } else + throw exception; + } finally { + _this._callableNode = oldCallableNode; + } + }, + _visitCalculation$1(node) { + return this._visitCalculation$2$inLegacySassFunction(node, false); + }, + _checkCalculationArguments$1(node) { + var _0_0, + check = new A._EvaluateVisitor__checkCalculationArguments_check(this, node); + $label0$0: { + _0_0 = A.stringReplaceAllUnchecked(node.originalName, "_", "-").toLowerCase(); + if ("calc" === _0_0 || "sqrt" === _0_0 || "sin" === _0_0 || "cos" === _0_0 || "tan" === _0_0 || "asin" === _0_0 || "acos" === _0_0 || "atan" === _0_0 || "abs" === _0_0 || "exp" === _0_0 || "sign" === _0_0) { + check.call$1(1); + break $label0$0; + } + if ("min" === _0_0 || "max" === _0_0 || "hypot" === _0_0) { + check.call$0(); + break $label0$0; + } + if ("pow" === _0_0 || "atan2" === _0_0 || "log" === _0_0 || "mod" === _0_0 || "rem" === _0_0) { + check.call$1(2); + break $label0$0; + } + if ("round" === _0_0 || "clamp" === _0_0) { + check.call$1(3); + break $label0$0; + } + throw A.wrapException(A.UnsupportedError$('Unknown calculation name "' + node.get$name(0) + '".')); + } + }, + _verifyCompatibleNumbers$2(args, nodesWithSpans) { + var i, t1, _0_0, arg, number1, j, number2; + for (i = 0; t1 = args.length, i < t1; ++i) { + _0_0 = args[i]; + if (_0_0 instanceof A.SassNumber) { + t1 = _0_0.get$hasComplexUnits(); + arg = _0_0; + } else { + arg = null; + t1 = false; + } + if (t1) + throw A.wrapException(this._evaluate$_exception$2("Number " + A.S(arg) + " isn't compatible with CSS calculations.", J.get$span$z(nodesWithSpans[i]))); + } + for (i = 0; i < t1 - 1; ++i) { + number1 = args[i]; + if (!(number1 instanceof A.SassNumber)) + continue; + for (j = i + 1; t1 = args.length, j < t1; ++j) { + number2 = args[j]; + if (!(number2 instanceof A.SassNumber)) + continue; + if (number1.hasPossiblyCompatibleUnits$1(number2)) + continue; + throw A.wrapException(A.MultiSpanSassRuntimeException$(number1.toString$0(0) + " and " + number2.toString$0(0) + " are incompatible.", J.get$span$z(nodesWithSpans[i]), number1.toString$0(0), A.LinkedHashMap_LinkedHashMap$_literal([J.get$span$z(nodesWithSpans[j]), number2.toString$0(0)], type$.FileSpan, type$.String), this._evaluate$_stackTrace$1(J.get$span$z(nodesWithSpans[i])), null)); + } + } + }, + _visitCalculationExpression$2$inLegacySassFunction(node, inLegacySassFunction) { + var inner, t1, result, t2, _0_0, _1_0, t3, _i, i, _this = this, _null = null, _box_0 = {}; + if (node instanceof A.ParenthesizedExpression) { + inner = node.expression; + t1 = true; + } else { + inner = _null; + t1 = false; + } + if (t1) { + result = _this._visitCalculationExpression$2$inLegacySassFunction(inner, inLegacySassFunction); + return result instanceof A.SassString ? new A.SassString("(" + result._string$_text + ")", false) : result; + } + if (node instanceof A.StringExpression && node.accept$1(new A._IsCalculationSafeVisitor())) { + t1 = node.text; + t2 = t1.get$asPlain(); + _0_0 = t2 == null ? _null : t2.toLowerCase(); + $label0$0: { + if ("pi" === _0_0) { + t1 = A.SassNumber_SassNumber(3.141592653589793, _null); + break $label0$0; + } + if ("e" === _0_0) { + t1 = A.SassNumber_SassNumber(2.718281828459045, _null); + break $label0$0; + } + if ("infinity" === _0_0) { + t1 = A.SassNumber_SassNumber(1 / 0, _null); + break $label0$0; + } + if ("-infinity" === _0_0) { + t1 = A.SassNumber_SassNumber(-1 / 0, _null); + break $label0$0; + } + if ("nan" === _0_0) { + t1 = A.SassNumber_SassNumber(0 / 0, _null); + break $label0$0; + } + t1 = new A.SassString(_this._performInterpolation$1(t1), false); + break $label0$0; + } + return t1; + } + _box_0.right = _box_0.left = _box_0.operator = null; + if (node instanceof A.BinaryOperationExpression) { + _box_0.operator = node.operator; + _box_0.left = node.left; + _box_0.right = node.right; + t1 = true; + } else + t1 = false; + if (t1) { + _this._checkWhitespaceAroundCalculationOperator$1(node); + return _this._addExceptionSpan$2(node, new A._EvaluateVisitor__visitCalculationExpression_closure(_box_0, _this, node, inLegacySassFunction)); + } + if (node instanceof A.NumberExpression || node instanceof A.VariableExpression || node instanceof A.FunctionExpression || node instanceof A.IfExpression) { + _1_0 = node.accept$1(_this); + $label1$1: { + if (_1_0 instanceof A.SassNumber) { + t1 = _1_0; + break $label1$1; + } + if (_1_0 instanceof A.SassCalculation) { + t1 = _1_0; + break $label1$1; + } + if (_1_0 instanceof A.SassString) { + t1 = !_1_0._hasQuotes; + result = _1_0; + } else { + result = _null; + t1 = false; + } + if (t1) { + t1 = result; + break $label1$1; + } + t1 = A.throwExpression(_this._evaluate$_exception$2("Value " + _1_0.toString$0(0) + " can't be used in a calculation.", node.get$span(node))); + } + return t1; + } + if (node instanceof A.ListExpression && !node.hasBrackets && B.ListSeparator_EVt === node.separator && node.contents.length >= 2) { + t1 = A._setArrayType([], type$.JSArray_Object); + for (t2 = node.contents, t3 = t2.length, _i = 0; _i < t3; ++_i) + t1.push(_this._visitCalculationExpression$2$inLegacySassFunction(t2[_i], inLegacySassFunction)); + _this._checkAdjacentCalculationValues$2(t1, node); + for (i = 0; i < t1.length; ++i) { + t3 = t1[i]; + if (t3 instanceof A.CalculationOperation && t2[i] instanceof A.ParenthesizedExpression) + t1[i] = new A.SassString("(" + A.S(t3) + ")", false); + } + return new A.SassString(B.JSArray_methods.join$1(t1, " "), false); + } + throw A.wrapException(_this._evaluate$_exception$2(string$.This_e, node.get$span(node))); + }, + _checkWhitespaceAroundCalculationOperator$1(node) { + var t2, t3, t4, textBetweenOperands, first, last, + t1 = node.operator; + if (t1 !== B.BinaryOperator_anB && t1 !== B.BinaryOperator_olz) + return; + t1 = node.left; + t2 = t1.get$span(t1); + t2 = t2.get$file(t2); + t3 = node.right; + t4 = t3.get$span(t3); + if (t2 !== t4.get$file(t4)) + return; + t2 = t1.get$span(t1); + t2 = t2.get$end(t2); + t4 = t3.get$span(t3); + if (t2.offset >= t4.get$start(t4).offset) + return; + t2 = t1.get$span(t1); + t2 = t2.get$file(t2); + t1 = t1.get$span(t1); + t1 = t1.get$end(t1); + t3 = t3.get$span(t3); + textBetweenOperands = A.String_String$fromCharCodes(B.NativeUint32List_methods.sublist$2(t2._decodedChars, t1.offset, t3.get$start(t3).offset), 0, null); + first = textBetweenOperands.charCodeAt(0); + last = textBetweenOperands.charCodeAt(textBetweenOperands.length - 1); + if (first === 32 || first === 9 || first === 10 || first === 13 || first === 12 || first === 47) + t1 = !(last === 32 || last === 9 || last === 10 || last === 13 || last === 12 || last === 47); + else + t1 = true; + if (t1) + throw A.wrapException(this._evaluate$_exception$2(string$.x22x2b__an, node.get$operatorSpan())); + }, + _binaryOperatorToCalculationOperator$2(operator, node) { + var t1; + $label0$0: { + if (B.BinaryOperator_anB === operator) { + t1 = B.CalculationOperator_IyK; + break $label0$0; + } + if (B.BinaryOperator_olz === operator) { + t1 = B.CalculationOperator_2bx; + break $label0$0; + } + if (B.BinaryOperator_qN2 === operator) { + t1 = B.CalculationOperator_jFr; + break $label0$0; + } + if (B.BinaryOperator_t8B === operator) { + t1 = B.CalculationOperator_OvN; + break $label0$0; + } + t1 = A.throwExpression(this._evaluate$_exception$2(string$.This_o, node.get$operatorSpan())); + } + return t1; + }, + _checkAdjacentCalculationValues$2(elements, node) { + var t1, i, t2, previous, current, previousNode, currentNode, _0_2; + for (t1 = elements.length, i = 1; i < t1; ++i) { + t2 = i - 1; + previous = elements[t2]; + current = elements[i]; + if (previous instanceof A.SassString || current instanceof A.SassString) + continue; + t1 = node.contents; + previousNode = t1[t2]; + currentNode = t1[i]; + if (currentNode instanceof A.UnaryOperationExpression) { + _0_2 = currentNode.operator; + if (B.UnaryOperator_TLI !== _0_2) + t1 = B.UnaryOperator_gg4 === _0_2; + else + t1 = true; + } else + t1 = false; + if (!t1) + t1 = currentNode instanceof A.NumberExpression && currentNode.value < 0; + else + t1 = true; + if (t1) + throw A.wrapException(this._evaluate$_exception$2(string$.x22x2b__an, A.FileSpanExtension_subspan(currentNode.get$span(currentNode), 0, 1))); + else + throw A.wrapException(this._evaluate$_exception$2("Missing math operator.", previousNode.get$span(previousNode).expand$1(0, currentNode.get$span(currentNode)))); + } + }, + visitInterpolatedFunctionExpression$1(node) { + var result, _this = this, + t1 = _this._performInterpolation$1(node.name), + oldInFunction = _this._inFunction; + _this._inFunction = true; + result = _this._addErrorSpan$2(node, new A._EvaluateVisitor_visitInterpolatedFunctionExpression_closure(_this, node, new A.PlainCssCallable(t1))); + _this._inFunction = oldInFunction; + return result; + }, + _runUserDefinedCallable$1$4($arguments, callable, nodeWithSpan, run, $V) { + var oldCallable, result, _this = this, + evaluated = _this._evaluateArguments$1($arguments), + $name = callable.declaration.name; + if ($name !== "@content") + $name += "()"; + oldCallable = _this._currentCallable; + _this._currentCallable = callable; + result = _this._withStackFrame$3($name, nodeWithSpan, new A._EvaluateVisitor__runUserDefinedCallable_closure(_this, callable, evaluated, nodeWithSpan, run, $V)); + _this._currentCallable = oldCallable; + return result; + }, + _runFunctionCallable$3($arguments, callable, nodeWithSpan) { + var buffer, first, argument, restArg, rest, error, t1, t2, _i, t3, exception, _this = this; + if (callable instanceof A.BuiltInCallable) + return _this._withoutSlash$2(_this._runBuiltInCallable$3($arguments, callable, nodeWithSpan), nodeWithSpan); + else if (type$.UserDefinedCallable_Environment._is(callable)) + return _this._runUserDefinedCallable$1$4($arguments, callable, nodeWithSpan, new A._EvaluateVisitor__runFunctionCallable_closure(_this, callable), type$.Value); + else if (callable instanceof A.PlainCssCallable) { + t1 = $arguments.named; + if (t1.get$isNotEmpty(t1) || $arguments.keywordRest != null) + throw A.wrapException(_this._evaluate$_exception$2(string$.Plain_, nodeWithSpan.get$span(nodeWithSpan))); + buffer = new A.StringBuffer(callable.name + "("); + try { + first = true; + for (t1 = $arguments.positional, t2 = t1.length, _i = 0; _i < t2; ++_i) { + argument = t1[_i]; + if (first) + first = false; + else + buffer._contents += ", "; + t3 = argument; + buffer._contents += _this._evaluate$_serialize$3$quote(t3.accept$1(_this), t3, true); + } + restArg = $arguments.rest; + if (restArg != null) { + rest = restArg.accept$1(_this); + if (!first) + buffer._contents += ", "; + buffer._contents += _this._evaluate$_serialize$2(rest, restArg); + } + } catch (exception) { + t1 = A.unwrapException(exception); + if (type$.SassRuntimeException._is(t1)) { + error = t1; + if (!B.JSString_methods.endsWith$1(error._span_exception$_message, "isn't a valid CSS value.")) + throw exception; + throw A.wrapException(A.MultiSpanSassRuntimeException$(error._span_exception$_message, J.get$span$z(error), "value", A.LinkedHashMap_LinkedHashMap$_literal([nodeWithSpan.get$span(nodeWithSpan), "unknown function treated as plain CSS"], type$.FileSpan, type$.String), J.get$trace$z(error), null)); + } else + throw exception; + } + buffer._contents += A.Primitives_stringFromCharCode(41); + t1 = buffer._contents; + return new A.SassString(t1.charCodeAt(0) == 0 ? t1 : t1, false); + } else + throw A.wrapException(A.ArgumentError$("Unknown callable type " + J.get$runtimeType$(callable).toString$0(0) + ".", null)); + }, + _runBuiltInCallable$3($arguments, callable, nodeWithSpan) { + var result, error, stackTrace, message, namedSet, _0_0, declaredArguments, i, t1, argument, t2, t3, rest, argumentList, exception, message0, _this = this, _box_0 = {}, + evaluated = _this._evaluateArguments$1($arguments), + oldCallableNode = _this._callableNode; + _this._callableNode = nodeWithSpan; + namedSet = new A.MapKeySet(evaluated._values[0], type$.MapKeySet_String); + _box_0.callback = _box_0.overload = null; + _0_0 = callable.callbackFor$2(evaluated._values[2].length, namedSet); + _box_0.overload = _0_0._0; + _box_0.callback = _0_0._1; + _this._addExceptionSpan$2(nodeWithSpan, new A._EvaluateVisitor__runBuiltInCallable_closure(_box_0, evaluated, namedSet)); + declaredArguments = _box_0.overload.$arguments; + for (i = evaluated._values[2].length, t1 = declaredArguments.length; i < t1; ++i) { + argument = declaredArguments[i]; + t2 = evaluated._values[2]; + t3 = evaluated._values[0].remove$1(0, argument.name); + if (t3 == null) { + t3 = argument.defaultValue; + t3 = _this._withoutSlash$2(t3.accept$1(_this), t3); + } + t2.push(t3); + } + if (_box_0.overload.restArgument != null) { + if (evaluated._values[2].length > t1) { + rest = B.JSArray_methods.sublist$1(evaluated._values[2], t1); + B.JSArray_methods.removeRange$2(evaluated._values[2], t1, evaluated._values[2].length); + } else + rest = B.List_empty8; + t1 = evaluated._values[0]; + argumentList = A.SassArgumentList$(rest, t1, evaluated._values[4] === B.ListSeparator_undecided_null_undecided ? B.ListSeparator_rXA : evaluated._values[4]); + evaluated._values[2].push(argumentList); + } else + argumentList = null; + result = null; + try { + result = _this._addExceptionSpan$2(nodeWithSpan, new A._EvaluateVisitor__runBuiltInCallable_closure0(_box_0, evaluated)); + } catch (exception) { + t1 = A.unwrapException(exception); + if (t1 instanceof A.SassException) + throw exception; + else { + error = t1; + stackTrace = A.getTraceFromException(exception); + message = null; + try { + message = A._asString(J.get$message$x(error)); + } catch (exception) { + message0 = J.toString$0$(error); + message = message0; + } + A.throwWithTrace(_this._evaluate$_exception$2(message, nodeWithSpan.get$span(nodeWithSpan)), error, stackTrace); + } + } + _this._callableNode = oldCallableNode; + if (argumentList == null) + return result; + if (evaluated._values[0].__js_helper$_length === 0) + return result; + if (argumentList._wereKeywordsAccessed) + return result; + throw A.wrapException(A.MultiSpanSassRuntimeException$("No " + A.pluralize("argument", evaluated._values[0].get$keys(0).get$length(0), null) + " named " + A.toSentence(evaluated._values[0].get$keys(0).map$1$1(0, new A._EvaluateVisitor__runBuiltInCallable_closure1(), type$.Object), "or") + ".", nodeWithSpan.get$span(nodeWithSpan), "invocation", A.LinkedHashMap_LinkedHashMap$_literal([_box_0.overload.get$spanWithName(), "declaration"], type$.FileSpan, type$.String), _this._evaluate$_stackTrace$1(nodeWithSpan.get$span(nodeWithSpan)), null)); + }, + _evaluateArguments$1($arguments) { + var t1, t2, _i, expression, nodeForSpan, named, namedNodes, t3, t4, $name, value, restArgs, rest, restNodeForSpan, t5, separator, keywordRestArgs, keywordRest, keywordRestNodeForSpan, _this = this, + positional = A._setArrayType([], type$.JSArray_Value), + positionalNodes = A._setArrayType([], type$.JSArray_AstNode); + for (t1 = $arguments.positional, t2 = t1.length, _i = 0; _i < t2; ++_i) { + expression = t1[_i]; + nodeForSpan = _this._expressionNode$1(expression); + positional.push(_this._withoutSlash$2(expression.accept$1(_this), nodeForSpan)); + positionalNodes.push(nodeForSpan); + } + t1 = type$.String; + named = A.LinkedHashMap_LinkedHashMap$_empty(t1, type$.Value); + t2 = type$.AstNode; + namedNodes = A.LinkedHashMap_LinkedHashMap$_empty(t1, t2); + for (t3 = A.MapExtensions_get_pairs($arguments.named, t1, type$.Expression), t3 = t3.get$iterator(t3); t3.moveNext$0();) { + t4 = t3.get$current(t3); + $name = t4._0; + value = t4._1; + nodeForSpan = _this._expressionNode$1(value); + named.$indexSet(0, $name, _this._withoutSlash$2(value.accept$1(_this), nodeForSpan)); + namedNodes.$indexSet(0, $name, nodeForSpan); + } + restArgs = $arguments.rest; + if (restArgs == null) + return new A._Record_5_named_namedNodes_positional_positionalNodes_separator([named, namedNodes, positional, positionalNodes, B.ListSeparator_undecided_null_undecided]); + rest = restArgs.accept$1(_this); + restNodeForSpan = _this._expressionNode$1(restArgs); + if (rest instanceof A.SassMap) { + _this._addRestMap$4(named, rest, restArgs, new A._EvaluateVisitor__evaluateArguments_closure()); + t3 = A.LinkedHashMap_LinkedHashMap$_empty(t1, t2); + for (t4 = rest._map$_contents, t4 = J.get$iterator$ax(t4.get$keys(t4)), t5 = type$.SassString; t4.moveNext$0();) + t3.$indexSet(0, t5._as(t4.get$current(t4))._string$_text, restNodeForSpan); + namedNodes.addAll$1(0, t3); + separator = B.ListSeparator_undecided_null_undecided; + } else if (rest instanceof A.SassList) { + t3 = rest._list$_contents; + B.JSArray_methods.addAll$1(positional, new A.MappedListIterable(t3, new A._EvaluateVisitor__evaluateArguments_closure0(_this, restNodeForSpan), A._arrayInstanceType(t3)._eval$1("MappedListIterable<1,Value>"))); + B.JSArray_methods.addAll$1(positionalNodes, A.List_List$filled(t3.length, restNodeForSpan, false, t2)); + separator = rest._separator; + if (rest instanceof A.SassArgumentList) { + rest._wereKeywordsAccessed = true; + rest._keywords.forEach$1(0, new A._EvaluateVisitor__evaluateArguments_closure1(_this, named, restNodeForSpan, namedNodes)); + } + } else { + positional.push(_this._withoutSlash$2(rest, restNodeForSpan)); + positionalNodes.push(restNodeForSpan); + separator = B.ListSeparator_undecided_null_undecided; + } + keywordRestArgs = $arguments.keywordRest; + if (keywordRestArgs == null) + return new A._Record_5_named_namedNodes_positional_positionalNodes_separator([named, namedNodes, positional, positionalNodes, separator]); + keywordRest = keywordRestArgs.accept$1(_this); + keywordRestNodeForSpan = _this._expressionNode$1(keywordRestArgs); + if (keywordRest instanceof A.SassMap) { + _this._addRestMap$4(named, keywordRest, keywordRestArgs, new A._EvaluateVisitor__evaluateArguments_closure2()); + t1 = A.LinkedHashMap_LinkedHashMap$_empty(t1, t2); + for (t2 = keywordRest._map$_contents, t2 = J.get$iterator$ax(t2.get$keys(t2)), t3 = type$.SassString; t2.moveNext$0();) + t1.$indexSet(0, t3._as(t2.get$current(t2))._string$_text, keywordRestNodeForSpan); + namedNodes.addAll$1(0, t1); + return new A._Record_5_named_namedNodes_positional_positionalNodes_separator([named, namedNodes, positional, positionalNodes, separator]); + } else + throw A.wrapException(_this._evaluate$_exception$2(string$.Variabs + keywordRest.toString$0(0) + ").", keywordRestArgs.get$span(keywordRestArgs))); + }, + _evaluateMacroArguments$1(invocation) { + var t2, positional, named, rest, restNodeForSpan, keywordRestArgs_, keywordRest, keywordRestNodeForSpan, _this = this, + t1 = invocation.$arguments, + restArgs_ = t1.rest; + if (restArgs_ == null) + return new A._Record_2(t1.positional, t1.named); + t2 = t1.positional; + positional = A._setArrayType(t2.slice(0), A._arrayInstanceType(t2)); + named = A.LinkedHashMap_LinkedHashMap$of(t1.named, type$.String, type$.Expression); + rest = restArgs_.accept$1(_this); + restNodeForSpan = _this._expressionNode$1(restArgs_); + if (rest instanceof A.SassMap) + _this._addRestMap$4(named, rest, invocation, new A._EvaluateVisitor__evaluateMacroArguments_closure(restArgs_)); + else if (rest instanceof A.SassList) { + t2 = rest._list$_contents; + B.JSArray_methods.addAll$1(positional, new A.MappedListIterable(t2, new A._EvaluateVisitor__evaluateMacroArguments_closure0(_this, restNodeForSpan, restArgs_), A._arrayInstanceType(t2)._eval$1("MappedListIterable<1,Expression>"))); + if (rest instanceof A.SassArgumentList) { + rest._wereKeywordsAccessed = true; + rest._keywords.forEach$1(0, new A._EvaluateVisitor__evaluateMacroArguments_closure1(_this, named, restNodeForSpan, restArgs_)); + } + } else + positional.push(new A.ValueExpression(_this._withoutSlash$2(rest, restNodeForSpan), restArgs_.get$span(restArgs_))); + keywordRestArgs_ = t1.keywordRest; + if (keywordRestArgs_ == null) + return new A._Record_2(positional, named); + keywordRest = keywordRestArgs_.accept$1(_this); + keywordRestNodeForSpan = _this._expressionNode$1(keywordRestArgs_); + if (keywordRest instanceof A.SassMap) { + _this._addRestMap$4(named, keywordRest, invocation, new A._EvaluateVisitor__evaluateMacroArguments_closure2(_this, keywordRestNodeForSpan, keywordRestArgs_)); + return new A._Record_2(positional, named); + } else + throw A.wrapException(_this._evaluate$_exception$2(string$.Variabs + keywordRest.toString$0(0) + ").", keywordRestArgs_.get$span(keywordRestArgs_))); + }, + _addRestMap$1$4(values, map, nodeWithSpan, convert) { + map._map$_contents.forEach$1(0, new A._EvaluateVisitor__addRestMap_closure(this, values, convert, this._expressionNode$1(nodeWithSpan), map, nodeWithSpan)); + }, + _addRestMap$4(values, map, nodeWithSpan, convert) { + return this._addRestMap$1$4(values, map, nodeWithSpan, convert, type$.dynamic); + }, + _verifyArguments$4(positional, named, $arguments, nodeWithSpan) { + return this._addExceptionSpan$2(nodeWithSpan, new A._EvaluateVisitor__verifyArguments_closure($arguments, positional, named)); + }, + visitSelectorExpression$1(node) { + var t1 = this._styleRuleIgnoringAtRoot; + t1 = t1 == null ? null : t1.originalSelector.get$asSassList(); + return t1 == null ? B.C__SassNull : t1; + }, + visitStringExpression$1(node) { + var t1, t2, t3, t4, _i, value, t5, _0_0, text, _this = this, + oldInSupportsDeclaration = _this._inSupportsDeclaration; + _this._inSupportsDeclaration = false; + t1 = A._setArrayType([], type$.JSArray_String); + for (t2 = node.text.contents, t3 = t2.length, t4 = type$.Expression, _i = 0; _i < t3; ++_i) { + value = t2[_i]; + $label0$0: { + if (typeof value == "string") { + t5 = value; + break $label0$0; + } + if (t4._is(value)) { + _0_0 = value.accept$1(_this); + $label1$1: { + if (_0_0 instanceof A.SassString) { + text = _0_0._string$_text; + t5 = text; + break $label1$1; + } + t5 = _this._evaluate$_serialize$3$quote(_0_0, value, false); + break $label1$1; + } + break $label0$0; + } + t5 = A.throwExpression(A.UnsupportedError$("Unknown interpolation value " + A.S(value))); + } + t1.push(t5); + } + t1 = B.JSArray_methods.join$0(t1); + _this._inSupportsDeclaration = oldInSupportsDeclaration; + return new A.SassString(t1, node.hasQuotes); + }, + visitSupportsExpression$1(expression) { + return new A.SassString(this._visitSupportsCondition$1(expression.condition), false); + }, + visitCssAtRule$1(node) { + var wasInKeyframes, wasInUnknownAtRule, t1, _this = this; + if (_this._declarationName != null) + throw A.wrapException(_this._evaluate$_exception$2(string$.At_rul, node.span)); + if (node.isChildless) { + _this._assertInModule$2(_this.__parent, "__parent").addChild$1(A.ModifiableCssAtRule$(node.name, node.span, true, node.value)); + return; + } + wasInKeyframes = _this._inKeyframes; + wasInUnknownAtRule = _this._inUnknownAtRule; + t1 = node.name; + if (A.unvendor(t1.value) === "keyframes") + _this._inKeyframes = true; + else + _this._inUnknownAtRule = true; + _this._withParent$2$4$scopeWhen$through(A.ModifiableCssAtRule$(t1, node.span, false, node.value), new A._EvaluateVisitor_visitCssAtRule_closure(_this, node), false, new A._EvaluateVisitor_visitCssAtRule_closure0(), type$.ModifiableCssAtRule, type$.Null); + _this._inUnknownAtRule = wasInUnknownAtRule; + _this._inKeyframes = wasInKeyframes; + }, + visitCssComment$1(node) { + var _this = this, + _s8_ = "__parent", + _s13_ = "_endOfImports"; + if (_this._assertInModule$2(_this.__parent, _s8_) === _this._assertInModule$2(_this.__root, "_root") && _this._assertInModule$2(_this.__endOfImports, _s13_) === J.get$length$asx(_this._assertInModule$2(_this.__root, "_root").children._collection$_source)) + _this.__endOfImports = _this._assertInModule$2(_this.__endOfImports, _s13_) + 1; + _this._assertInModule$2(_this.__parent, _s8_).addChild$1(new A.ModifiableCssComment(node.text, node.span)); + }, + visitCssDeclaration$1(node) { + this._assertInModule$2(this.__parent, "__parent").addChild$1(A.ModifiableCssDeclaration$(node.name, node.value, node.span, node.parsedAsCustomProperty, node.valueSpanForMap)); + }, + visitCssImport$1(node) { + var t1, _this = this, + _s8_ = "__parent", + _s5_ = "_root", + _s13_ = "_endOfImports", + modifiableNode = new A.ModifiableCssImport(node.url, node.modifiers, node.span); + if (_this._assertInModule$2(_this.__parent, _s8_) !== _this._assertInModule$2(_this.__root, _s5_)) + _this._assertInModule$2(_this.__parent, _s8_).addChild$1(modifiableNode); + else if (_this._assertInModule$2(_this.__endOfImports, _s13_) === J.get$length$asx(_this._assertInModule$2(_this.__root, _s5_).children._collection$_source)) { + _this._assertInModule$2(_this.__root, _s5_).addChild$1(modifiableNode); + _this.__endOfImports = _this._assertInModule$2(_this.__endOfImports, _s13_) + 1; + } else { + t1 = _this._outOfOrderImports; + (t1 == null ? _this._outOfOrderImports = A._setArrayType([], type$.JSArray_ModifiableCssImport) : t1).push(modifiableNode); + } + }, + visitCssKeyframeBlock$1(node) { + this._withParent$2$4$scopeWhen$through(A.ModifiableCssKeyframeBlock$(node.selector, node.span), new A._EvaluateVisitor_visitCssKeyframeBlock_closure(this, node), false, new A._EvaluateVisitor_visitCssKeyframeBlock_closure0(), type$.ModifiableCssKeyframeBlock, type$.Null); + }, + visitCssMediaRule$1(node) { + var mergedQueries, t1, mergedSources, t2, t3, _this = this; + if (_this._declarationName != null) + throw A.wrapException(_this._evaluate$_exception$2(string$.Media_, node.span)); + mergedQueries = A.NullableExtension_andThen(_this._mediaQueries, new A._EvaluateVisitor_visitCssMediaRule_closure(_this, node)); + t1 = mergedQueries == null; + if (!t1 && J.get$isEmpty$asx(mergedQueries)) + return; + if (t1) + mergedSources = B.Set_empty1; + else { + t2 = _this._mediaQuerySources; + t2.toString; + t2 = A.LinkedHashSet_LinkedHashSet$of(t2, type$.CssMediaQuery); + t3 = _this._mediaQueries; + t3.toString; + t2.addAll$1(0, t3); + t2.addAll$1(0, node.queries); + mergedSources = t2; + } + t1 = t1 ? node.queries : mergedQueries; + _this._withParent$2$4$scopeWhen$through(A.ModifiableCssMediaRule$(t1, node.span), new A._EvaluateVisitor_visitCssMediaRule_closure0(_this, mergedQueries, node, mergedSources), false, new A._EvaluateVisitor_visitCssMediaRule_closure1(mergedSources), type$.ModifiableCssMediaRule, type$.Null); + }, + visitCssStyleRule$1(node) { + var t1, styleRule, t2, t3, t4, originalSelector, rule, oldAtRootExcludingStyleRule, _0_1, lastChild, _this = this; + if (_this._declarationName != null) + throw A.wrapException(_this._evaluate$_exception$2(string$.Style_, node.span)); + t1 = _this._atRootExcludingStyleRule; + styleRule = t1 ? null : _this._styleRuleIgnoringAtRoot; + t2 = node._style_rule$_selector._box$_inner.value; + t3 = styleRule == null; + t4 = t3 ? null : styleRule.originalSelector; + originalSelector = t2.resolveParentSelectors$2$implicitParent(t4, !t1); + rule = A.ModifiableCssStyleRule$(_this._assertInModule$2(_this.__extensionStore, "_extensionStore").addSelector$2(originalSelector, _this._mediaQueries), node.span, originalSelector); + oldAtRootExcludingStyleRule = _this._atRootExcludingStyleRule; + _this._atRootExcludingStyleRule = false; + _this._withParent$2$4$scopeWhen$through(rule, new A._EvaluateVisitor_visitCssStyleRule_closure(_this, rule, node), false, new A._EvaluateVisitor_visitCssStyleRule_closure0(), type$.ModifiableCssStyleRule, type$.Null); + _this._atRootExcludingStyleRule = oldAtRootExcludingStyleRule; + t1 = _this._assertInModule$2(_this.__parent, "__parent").children._collection$_source; + t2 = J.getInterceptor$asx(t1); + _0_1 = t2.get$length(t1); + if (_0_1 >= 1) { + lastChild = t2.elementAt$1(t1, _0_1 - 1); + t1 = t3; + } else { + lastChild = null; + t1 = false; + } + if (t1) + lastChild.isGroupEnd = true; + }, + visitCssStylesheet$1(node) { + var t1; + for (t1 = J.get$iterator$ax(node.get$children(node)); t1.moveNext$0();) + t1.get$current(t1).accept$1(this); + }, + visitCssSupportsRule$1(node) { + var _this = this; + if (_this._declarationName != null) + throw A.wrapException(_this._evaluate$_exception$2(string$.Suppor, node.span)); + _this._withParent$2$4$scopeWhen$through(A.ModifiableCssSupportsRule$(node.condition, node.span), new A._EvaluateVisitor_visitCssSupportsRule_closure(_this, node), false, new A._EvaluateVisitor_visitCssSupportsRule_closure0(), type$.ModifiableCssSupportsRule, type$.Null); + }, + _handleReturn$1$2(list, callback) { + var t1, _i, _0_0; + for (t1 = list.length, _i = 0; _i < list.length; list.length === t1 || (0, A.throwConcurrentModificationError)(list), ++_i) { + _0_0 = callback.call$1(list[_i]); + if (_0_0 != null) + return _0_0; + } + return null; + }, + _handleReturn$2(list, callback) { + return this._handleReturn$1$2(list, callback, type$.dynamic); + }, + _withEnvironment$1$2(environment, callback) { + var result, + oldEnvironment = this._environment; + this._environment = environment; + result = callback.call$0(); + this._environment = oldEnvironment; + return result; + }, + _withEnvironment$2(environment, callback) { + return this._withEnvironment$1$2(environment, callback, type$.dynamic); + }, + _interpolationToValue$3$trim$warnForColor(interpolation, trim, warnForColor) { + var result = this._performInterpolation$2$warnForColor(interpolation, warnForColor), + t1 = trim ? A.trimAscii(result, true) : result; + return new A.CssValue(t1, interpolation.span, type$.CssValue_String); + }, + _interpolationToValue$1(interpolation) { + return this._interpolationToValue$3$trim$warnForColor(interpolation, false, false); + }, + _interpolationToValue$2$warnForColor(interpolation, warnForColor) { + return this._interpolationToValue$3$trim$warnForColor(interpolation, false, warnForColor); + }, + _performInterpolation$2$warnForColor(interpolation, warnForColor) { + return this._performInterpolationHelper$3$sourceMap$warnForColor(interpolation, false, warnForColor)._0; + }, + _performInterpolation$1(interpolation) { + return this._performInterpolation$2$warnForColor(interpolation, false); + }, + _performInterpolationWithMap$2$warnForColor(interpolation, warnForColor) { + var _0_0 = this._performInterpolationHelper$3$sourceMap$warnForColor(interpolation, true, true), + map = _0_0._1; + map.toString; + return new A._Record_2(_0_0._0, map); + }, + _performInterpolationHelper$3$sourceMap$warnForColor(interpolation, sourceMap, warnForColor) { + var t1, t2, t3, t4, t5, t6, t7, first, _i, t8, value, result, t9, result0, _this = this, _null = null, + targetLocations = sourceMap ? A._setArrayType([], type$.JSArray_SourceLocation) : _null, + oldInSupportsDeclaration = _this._inSupportsDeclaration; + _this._inSupportsDeclaration = false; + for (t1 = interpolation.contents, t2 = t1.length, t3 = type$.Expression, t4 = targetLocations == null, t5 = type$.JSArray_Object, t6 = interpolation.span, t7 = type$.Object, first = true, _i = 0, t8 = ""; _i < t2; ++_i, first = false) { + value = t1[_i]; + if (!first) + if (!t4) + targetLocations.push(A.SourceLocation$(t8.length, _null, _null, _null)); + if (typeof value == "string") { + t8 += value; + continue; + } + t3._as(value); + result = value.accept$1(_this); + if (warnForColor && $.$get$namesByColor().containsKey$1(result)) { + t9 = A._setArrayType([""], t5); + result0 = A.List_List$from(t9, false, t7); + result0.fixed$length = Array; + result0.immutable$list = Array; + result0 = new A.Interpolation(result0, t6); + result0.Interpolation$2(t9, t6); + t9 = $.$get$namesByColor(); + _this._warn$2(string$.You_pr + A.S(t9.$index(0, result)) + string$.x20in_in + result.toString$0(0) + string$.x2c_whicw + A.S(t9.$index(0, result)) + string$.x22x29__If + new A.BinaryOperationExpression(B.BinaryOperator_anB, new A.StringExpression(result0, true), value, false).toString$0(0) + "'.", value.get$span(value)); + } + t8 += _this._evaluate$_serialize$3$quote(result, value, false); + } + _this._inSupportsDeclaration = oldInSupportsDeclaration; + return new A._Record_2(t8.charCodeAt(0) == 0 ? t8 : t8, A.NullableExtension_andThen(targetLocations, new A._EvaluateVisitor__performInterpolationHelper_closure(interpolation))); + }, + _evaluate$_serialize$3$quote(value, nodeWithSpan, quote) { + return this._addExceptionSpan$2(nodeWithSpan, new A._EvaluateVisitor__serialize_closure(value, quote)); + }, + _evaluate$_serialize$2(value, nodeWithSpan) { + return this._evaluate$_serialize$3$quote(value, nodeWithSpan, true); + }, + _expressionNode$1(expression) { + var t1; + if (expression instanceof A.VariableExpression) { + t1 = this._addExceptionSpan$2(expression, new A._EvaluateVisitor__expressionNode_closure(this, expression)); + return t1 == null ? expression : t1; + } else + return expression; + }, + _withParent$2$4$scopeWhen$through(node, callback, scopeWhen, through, $S, $T) { + var t1, result, _this = this; + _this._addChild$2$through(node, through); + t1 = _this._assertInModule$2(_this.__parent, "__parent"); + _this.__parent = node; + result = _this._environment.scope$1$2$when(callback, scopeWhen, $T); + _this.__parent = t1; + return result; + }, + _withParent$2$3$scopeWhen(node, callback, scopeWhen, $S, $T) { + return this._withParent$2$4$scopeWhen$through(node, callback, scopeWhen, null, $S, $T); + }, + _withParent$2$2(node, callback, $S, $T) { + return this._withParent$2$4$scopeWhen$through(node, callback, true, null, $S, $T); + }, + _addChild$2$through(node, through) { + var _0_0, grandparent, t1, + $parent = this._assertInModule$2(this.__parent, "__parent"); + if (through != null) { + for (; through.call$1($parent); $parent = _0_0) { + _0_0 = $parent._parent; + if (_0_0 == null) + throw A.wrapException(A.ArgumentError$(string$.throug + node.toString$0(0) + ".", null)); + } + if ($parent.get$hasFollowingSibling()) { + grandparent = $parent._parent; + t1 = grandparent.children; + if ($parent.equalsIgnoringChildren$1(t1.get$last(t1))) + $parent = type$.ModifiableCssParentNode._as(t1.get$last(t1)); + else { + $parent = $parent.copyWithoutChildren$0(); + grandparent.addChild$1($parent); + } + } + } + $parent.addChild$1(node); + }, + _addChild$1(node) { + return this._addChild$2$through(node, null); + }, + _withStyleRule$1$2(rule, callback) { + var result, + oldRule = this._styleRuleIgnoringAtRoot; + this._styleRuleIgnoringAtRoot = rule; + result = callback.call$0(); + this._styleRuleIgnoringAtRoot = oldRule; + return result; + }, + _withStyleRule$2(rule, callback) { + return this._withStyleRule$1$2(rule, callback, type$.dynamic); + }, + _withMediaQueries$1$3(queries, sources, callback) { + var result, _this = this, + oldMediaQueries = _this._mediaQueries, + oldSources = _this._mediaQuerySources; + _this._mediaQueries = queries; + _this._mediaQuerySources = sources; + result = callback.call$0(); + _this._mediaQueries = oldMediaQueries; + _this._mediaQuerySources = oldSources; + return result; + }, + _withMediaQueries$3(queries, sources, callback) { + return this._withMediaQueries$1$3(queries, sources, callback, type$.dynamic); + }, + _withStackFrame$1$3(member, nodeWithSpan, callback) { + var oldMember, result, _this = this, + t1 = _this._stack; + t1.push(new A._Record_2(_this._member, nodeWithSpan)); + oldMember = _this._member; + _this._member = member; + result = callback.call$0(); + _this._member = oldMember; + t1.pop(); + return result; + }, + _withStackFrame$3(member, nodeWithSpan, callback) { + return this._withStackFrame$1$3(member, nodeWithSpan, callback, type$.dynamic); + }, + _withoutSlash$2(value, nodeForSpan) { + if (value instanceof A.SassNumber && value.asSlash != null && true) + this._warn$3(string$.Using__i + A.S(new A._EvaluateVisitor__withoutSlash_recommendation().call$1(value)) + string$.x0a_Morex20, nodeForSpan.get$span(nodeForSpan), B.Deprecation_xHK); + return value.withoutSlash$0(); + }, + _stackFrame$2(member, span) { + return A.frameForSpan(span, member, A.NullableExtension_andThen(span.get$sourceUrl(span), new A._EvaluateVisitor__stackFrame_closure(this))); + }, + _evaluate$_stackTrace$1(span) { + var t2, t3, _i, t4, nodeWithSpan, _this = this, + t1 = A._setArrayType([], type$.JSArray_Frame); + for (t2 = _this._stack, t3 = t2.length, _i = 0; _i < t2.length; t2.length === t3 || (0, A.throwConcurrentModificationError)(t2), ++_i) { + t4 = t2[_i]; + nodeWithSpan = t4._1; + t1.push(_this._stackFrame$2(t4._0, nodeWithSpan.get$span(nodeWithSpan))); + } + if (span != null) + t1.push(_this._stackFrame$2(_this._member, span)); + return A.Trace$(new A.ReversedListIterable(t1, type$.ReversedListIterable_Frame), null); + }, + _evaluate$_stackTrace$0() { + return this._evaluate$_stackTrace$1(null); + }, + _warn$3(message, span, deprecation) { + var t1, trace, _this = this; + if (_this._quietDeps) + if (!_this._inDependency) { + t1 = _this._currentCallable; + t1 = t1 == null ? null : t1.inDependency; + t1 = t1 === true; + } else + t1 = true; + else + t1 = false; + if (t1) + return; + if (!_this._warningsEmitted.add$1(0, new A._Record_2(message, span))) + return; + trace = _this._evaluate$_stackTrace$1(span); + t1 = _this._evaluate$_logger; + if (deprecation == null) + t1.warn$3$span$trace(0, message, span, trace); + else + A.WarnForDeprecation_warnForDeprecation(t1, deprecation, message, span, trace); + }, + _warn$2(message, span) { + return this._warn$3(message, span, null); + }, + _evaluate$_exception$2(message, span) { + var t1, t2; + if (span == null) { + t1 = B.JSArray_methods.get$last(this._stack)._1; + t1 = t1.get$span(t1); + } else + t1 = span; + t2 = this._evaluate$_stackTrace$1(span); + return new A.SassRuntimeException(t2, B.Set_empty, message, t1); + }, + _evaluate$_exception$1(message) { + return this._evaluate$_exception$2(message, null); + }, + _multiSpanException$3(message, primaryLabel, secondaryLabels) { + var t1 = B.JSArray_methods.get$last(this._stack)._1; + return A.MultiSpanSassRuntimeException$(message, t1.get$span(t1), primaryLabel, secondaryLabels, this._evaluate$_stackTrace$0(), null); + }, + _addExceptionSpan$1$3$addStackFrame(nodeWithSpan, callback, addStackFrame) { + var error, stackTrace, t1, exception; + try { + t1 = callback.call$0(); + return t1; + } catch (exception) { + t1 = A.unwrapException(exception); + if (t1 instanceof A.SassScriptException) { + error = t1; + stackTrace = A.getTraceFromException(exception); + t1 = error.withSpan$1(nodeWithSpan.get$span(nodeWithSpan)); + A.throwWithTrace(t1.withTrace$1(this._evaluate$_stackTrace$1(addStackFrame ? nodeWithSpan.get$span(nodeWithSpan) : null)), error, stackTrace); + } else + throw exception; + } + }, + _addExceptionSpan$2(nodeWithSpan, callback) { + return this._addExceptionSpan$1$3$addStackFrame(nodeWithSpan, callback, true, type$.dynamic); + }, + _addExceptionSpan$3$addStackFrame(nodeWithSpan, callback, addStackFrame) { + return this._addExceptionSpan$1$3$addStackFrame(nodeWithSpan, callback, addStackFrame, type$.dynamic); + }, + _addExceptionTrace$1$1(callback) { + var error, stackTrace, t1, exception, t2; + try { + t1 = callback.call$0(); + return t1; + } catch (exception) { + t1 = A.unwrapException(exception); + if (type$.SassRuntimeException._is(t1)) + throw exception; + else if (t1 instanceof A.SassException) { + error = t1; + stackTrace = A.getTraceFromException(exception); + t1 = error; + t2 = J.getInterceptor$z(t1); + A.throwWithTrace(error.withTrace$1(this._evaluate$_stackTrace$1(A.SourceSpanException.prototype.get$span.call(t2, t1))), error, stackTrace); + } else + throw exception; + } + }, + _addExceptionTrace$1(callback) { + return this._addExceptionTrace$1$1(callback, type$.dynamic); + }, + _addErrorSpan$1$2(nodeWithSpan, callback) { + var error, stackTrace, t1, exception, t2, t3; + try { + t1 = callback.call$0(); + return t1; + } catch (exception) { + t1 = A.unwrapException(exception); + if (type$.SassRuntimeException._is(t1)) { + error = t1; + stackTrace = A.getTraceFromException(exception); + if (!B.JSString_methods.startsWith$1(J.get$span$z(error).get$text(), "@error")) + throw exception; + t1 = error._span_exception$_message; + t2 = nodeWithSpan.get$span(nodeWithSpan); + t3 = this._evaluate$_stackTrace$0(); + A.throwWithTrace(new A.SassRuntimeException(t3, B.Set_empty, t1, t2), error, stackTrace); + } else + throw exception; + } + }, + _addErrorSpan$2(nodeWithSpan, callback) { + return this._addErrorSpan$1$2(nodeWithSpan, callback, type$.dynamic); + } + }; + A._EvaluateVisitor_closure.prototype = { + call$1($arguments) { + var module, t2, + t1 = J.getInterceptor$asx($arguments), + variable = t1.$index($arguments, 0).assertString$1("name"); + t1 = t1.$index($arguments, 1).get$realNull(); + module = t1 == null ? null : t1.assertString$1("module"); + t1 = this.$this._environment; + t2 = A.stringReplaceAllUnchecked(variable._string$_text, "_", "-"); + return t1.globalVariableExists$2$namespace(t2, module == null ? null : module._string$_text) ? B.SassBoolean_true : B.SassBoolean_false; + }, + $signature: 21 + }; + A._EvaluateVisitor_closure0.prototype = { + call$1($arguments) { + var variable = J.$index$asx($arguments, 0).assertString$1("name"), + t1 = this.$this._environment; + return t1.getVariable$1(A.stringReplaceAllUnchecked(variable._string$_text, "_", "-")) != null ? B.SassBoolean_true : B.SassBoolean_false; + }, + $signature: 21 + }; + A._EvaluateVisitor_closure1.prototype = { + call$1($arguments) { + var module, t2, t3, t4, + t1 = J.getInterceptor$asx($arguments), + variable = t1.$index($arguments, 0).assertString$1("name"); + t1 = t1.$index($arguments, 1).get$realNull(); + module = t1 == null ? null : t1.assertString$1("module"); + t1 = this.$this; + t2 = t1._environment; + t3 = variable._string$_text; + t4 = A.stringReplaceAllUnchecked(t3, "_", "-"); + return t2.getFunction$2$namespace(t4, module == null ? null : module._string$_text) != null || t1._builtInFunctions.containsKey$1(t3) ? B.SassBoolean_true : B.SassBoolean_false; + }, + $signature: 21 + }; + A._EvaluateVisitor_closure2.prototype = { + call$1($arguments) { + var module, t2, + t1 = J.getInterceptor$asx($arguments), + variable = t1.$index($arguments, 0).assertString$1("name"); + t1 = t1.$index($arguments, 1).get$realNull(); + module = t1 == null ? null : t1.assertString$1("module"); + t1 = this.$this._environment; + t2 = A.stringReplaceAllUnchecked(variable._string$_text, "_", "-"); + return t1.getMixin$2$namespace(t2, module == null ? null : module._string$_text) != null ? B.SassBoolean_true : B.SassBoolean_false; + }, + $signature: 21 + }; + A._EvaluateVisitor_closure3.prototype = { + call$1($arguments) { + var t1 = this.$this._environment; + if (!t1._inMixin) + throw A.wrapException(A.SassScriptException$(string$.conten, null)); + return t1._content != null ? B.SassBoolean_true : B.SassBoolean_false; + }, + $signature: 21 + }; + A._EvaluateVisitor_closure4.prototype = { + call$1($arguments) { + var t2, t3, t4, + t1 = J.$index$asx($arguments, 0).assertString$1("module")._string$_text, + module = this.$this._environment._environment$_modules.$index(0, t1); + if (module == null) + throw A.wrapException('There is no module with namespace "' + t1 + '".'); + t1 = type$.Value; + t2 = A.LinkedHashMap_LinkedHashMap$_empty(t1, t1); + for (t3 = A.MapExtensions_get_pairs(module.get$variables(), type$.String, t1), t3 = t3.get$iterator(t3); t3.moveNext$0();) { + t4 = t3.get$current(t3); + t2.$indexSet(0, new A.SassString(t4._0, true), t4._1); + } + return new A.SassMap(A.ConstantMap_ConstantMap$from(t2, t1, t1)); + }, + $signature: 34 + }; + A._EvaluateVisitor_closure5.prototype = { + call$1($arguments) { + var t2, t3, t4, + t1 = J.$index$asx($arguments, 0).assertString$1("module")._string$_text, + module = this.$this._environment._environment$_modules.$index(0, t1); + if (module == null) + throw A.wrapException('There is no module with namespace "' + t1 + '".'); + t1 = type$.Value; + t2 = A.LinkedHashMap_LinkedHashMap$_empty(t1, t1); + for (t3 = A.MapExtensions_get_pairs(module.get$functions(module), type$.String, type$.Callable), t3 = t3.get$iterator(t3); t3.moveNext$0();) { + t4 = t3.get$current(t3); + t2.$indexSet(0, new A.SassString(t4._0, true), new A.SassFunction(t4._1)); + } + return new A.SassMap(A.ConstantMap_ConstantMap$from(t2, t1, t1)); + }, + $signature: 34 + }; + A._EvaluateVisitor_closure6.prototype = { + call$1($arguments) { + var t2, t3, t4, + t1 = J.$index$asx($arguments, 0).assertString$1("module")._string$_text, + module = this.$this._environment._environment$_modules.$index(0, t1); + if (module == null) + throw A.wrapException('There is no module with namespace "' + t1 + '".'); + t1 = type$.Value; + t2 = A.LinkedHashMap_LinkedHashMap$_empty(t1, t1); + for (t3 = A.MapExtensions_get_pairs(module.get$mixins(), type$.String, type$.Callable), t3 = t3.get$iterator(t3); t3.moveNext$0();) { + t4 = t3.get$current(t3); + t2.$indexSet(0, new A.SassString(t4._0, true), new A.SassMixin(t4._1)); + } + return new A.SassMap(A.ConstantMap_ConstantMap$from(t2, t1, t1)); + }, + $signature: 34 + }; + A._EvaluateVisitor_closure7.prototype = { + call$1($arguments) { + var module, t2, callable, + t1 = J.getInterceptor$asx($arguments), + $name = t1.$index($arguments, 0).assertString$1("name"), + css = t1.$index($arguments, 1).get$isTruthy(); + t1 = t1.$index($arguments, 2).get$realNull(); + module = t1 == null ? null : t1.assertString$1("module"); + if (css) { + if (module != null) + throw A.wrapException(string$.x24css_a); + return new A.SassFunction(new A.PlainCssCallable($name._string$_text)); + } + t1 = this.$this; + t2 = t1._callableNode; + t2.toString; + callable = t1._addExceptionSpan$2(t2, new A._EvaluateVisitor__closure2(t1, $name, module)); + if (callable == null) + throw A.wrapException("Function not found: " + $name.toString$0(0)); + return new A.SassFunction(callable); + }, + $signature: 212 + }; + A._EvaluateVisitor__closure2.prototype = { + call$0() { + var local, + normalizedName = A.stringReplaceAllUnchecked(this.name._string$_text, "_", "-"), + t1 = this.module, + namespace = t1 == null ? null : t1._string$_text; + t1 = this.$this; + local = t1._environment.getFunction$2$namespace(normalizedName, namespace); + if (local != null || namespace != null) + return local; + return t1._builtInFunctions.$index(0, normalizedName); + }, + $signature: 104 + }; + A._EvaluateVisitor_closure8.prototype = { + call$1($arguments) { + var module, t2, callable, + t1 = J.getInterceptor$asx($arguments), + $name = t1.$index($arguments, 0).assertString$1("name"); + t1 = t1.$index($arguments, 1).get$realNull(); + module = t1 == null ? null : t1.assertString$1("module"); + t1 = this.$this; + t2 = t1._callableNode; + t2.toString; + callable = t1._addExceptionSpan$2(t2, new A._EvaluateVisitor__closure1(t1, $name, module)); + if (callable == null) + throw A.wrapException("Mixin not found: " + $name.toString$0(0)); + return new A.SassMixin(callable); + }, + $signature: 214 + }; + A._EvaluateVisitor__closure1.prototype = { + call$0() { + var t1 = this.$this._environment, + t2 = A.stringReplaceAllUnchecked(this.name._string$_text, "_", "-"), + t3 = this.module; + return t1.getMixin$2$namespace(t2, t3 == null ? null : t3._string$_text); + }, + $signature: 104 + }; + A._EvaluateVisitor_closure9.prototype = { + call$1($arguments) { + var t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, invocation, callableNode, callable, + t1 = J.getInterceptor$asx($arguments), + $function = t1.$index($arguments, 0), + args = type$.SassArgumentList._as(t1.$index($arguments, 1)); + t1 = this.$this; + t2 = t1._callableNode; + t2.toString; + t3 = A._setArrayType([], type$.JSArray_Expression); + t4 = type$.String; + t5 = type$.Expression; + t6 = t2.get$span(t2); + t7 = t2.get$span(t2); + args._wereKeywordsAccessed = true; + t8 = args._keywords; + if (t8.get$isEmpty(t8)) + t2 = null; + else { + t9 = type$.Value; + t10 = A.LinkedHashMap_LinkedHashMap$_empty(t9, t9); + for (args._wereKeywordsAccessed = true, t8 = A.MapExtensions_get_pairs(t8, t4, t9), t8 = t8.get$iterator(t8); t8.moveNext$0();) { + t11 = t8.get$current(t8); + t10.$indexSet(0, new A.SassString(t11._0, false), t11._1); + } + t2 = new A.ValueExpression(new A.SassMap(A.ConstantMap_ConstantMap$from(t10, t9, t9)), t2.get$span(t2)); + } + invocation = new A.ArgumentInvocation(A.List_List$unmodifiable(t3, t5), A.ConstantMap_ConstantMap$from(A.LinkedHashMap_LinkedHashMap$_empty(t4, t5), t4, t5), new A.ValueExpression(args, t7), t2, t6); + if ($function instanceof A.SassString) { + t2 = $function.toString$0(0); + A.EvaluationContext_current().warn$2(0, string$.Passina + t2 + "))", B.Deprecation_qVK); + callableNode = t1._callableNode; + return t1.visitFunctionExpression$1(new A.FunctionExpression(null, $function._string$_text, invocation, callableNode.get$span(callableNode))); + } + callable = $function.assertFunction$1("function").callable; + if (type$.Callable._is(callable)) { + t2 = t1._callableNode; + t2.toString; + return t1._runFunctionCallable$3(invocation, callable, t2); + } else + throw A.wrapException(A.SassScriptException$("The function " + callable.get$name(callable) + string$.x20is_as, null)); + }, + $signature: 6 + }; + A._EvaluateVisitor_closure10.prototype = { + call$1($arguments) { + var withMap, t2, values, configuration, t3, + t1 = J.getInterceptor$asx($arguments), + url = A.Uri_parse(t1.$index($arguments, 0).assertString$1("url")._string$_text); + t1 = t1.$index($arguments, 1).get$realNull(); + withMap = t1 == null ? null : t1.assertMap$1("with")._map$_contents; + t1 = this.$this; + t2 = t1._callableNode; + t2.toString; + if (withMap != null) { + values = A.LinkedHashMap_LinkedHashMap$_empty(type$.String, type$.ConfiguredValue); + withMap.forEach$1(0, new A._EvaluateVisitor__closure(values, t2.get$span(t2), t2)); + configuration = new A.ExplicitConfiguration(t2, values, null); + } else + configuration = B.Configuration_Map_empty_null; + t3 = t2.get$span(t2); + t1._loadModule$7$baseUrl$configuration$namesInErrors(url, "load-css()", t2, new A._EvaluateVisitor__closure0(t1), t3.get$sourceUrl(t3), configuration, true); + t1._assertConfigurationIsEmpty$2$nameInError(configuration, true); + }, + $signature: 254 + }; + A._EvaluateVisitor__closure.prototype = { + call$2(variable, value) { + var t1 = variable.assertString$1("with key"), + $name = A.stringReplaceAllUnchecked(t1._string$_text, "_", "-"); + t1 = this.values; + if (t1.containsKey$1($name)) + throw A.wrapException("The variable $" + $name + " was configured twice."); + t1.$indexSet(0, $name, new A.ConfiguredValue(value, this.span, this.callableNode)); + }, + $signature: 85 + }; + A._EvaluateVisitor__closure0.prototype = { + call$2(module, _) { + var t1 = this.$this; + return t1._combineCss$2$clone(module, true).accept$1(t1); + }, + $signature: 105 + }; + A._EvaluateVisitor_closure11.prototype = { + call$1($arguments) { + var callableNode, t2, t3, t4, t5, callable, $content, + t1 = J.getInterceptor$asx($arguments), + mixin = t1.$index($arguments, 0), + args = type$.SassArgumentList._as(t1.$index($arguments, 1)); + t1 = this.$this; + callableNode = t1._callableNode; + t2 = callableNode.get$span(callableNode); + t3 = callableNode.get$span(callableNode); + t4 = type$.Expression; + t5 = A.List_List$unmodifiable(B.List_empty9, t4); + t4 = A.ConstantMap_ConstantMap$from(B.Map_empty6, type$.String, t4); + callable = mixin.assertMixin$1("mixin").callable; + $content = t1._environment._content; + if (type$.Callable._is(callable)) + t1._applyMixin$5(callable, $content, new A.ArgumentInvocation(t5, t4, new A.ValueExpression(args, t3), null, t2), callableNode, callableNode); + else + throw A.wrapException(A.SassScriptException$("The mixin " + callable.get$name(callable) + string$.x20is_as, null)); + }, + $signature: 254 + }; + A._EvaluateVisitor_run_closure.prototype = { + call$0() { + var module, _this = this, url = null, + t1 = _this.node, + t2 = t1.span, + _0_0 = t2.get$sourceUrl(t2); + if (_0_0 != null) { + url = _0_0; + t2 = _this.$this; + t2._activeModules.$indexSet(0, url, null); + t2._loadedUrls.add$1(0, url); + } + t2 = _this.$this; + module = t2._addExceptionTrace$1(new A._EvaluateVisitor_run__closure(t2, _this.importer, t1)); + return new A._Record_2_loadedUrls_stylesheet(t2._loadedUrls, t2._combineCss$1(module)); + }, + $signature: 296 + }; + A._EvaluateVisitor_run__closure.prototype = { + call$0() { + return this.$this._execute$2(this.importer, this.node); + }, + $signature: 295 + }; + A._EvaluateVisitor_runExpression_closure.prototype = { + call$0() { + var t1 = this.$this, + t2 = this.expression; + return t1._withFakeStylesheet$3(this.importer, t2, new A._EvaluateVisitor_runExpression__closure(t1, t2)); + }, + $signature: 36 + }; + A._EvaluateVisitor_runExpression__closure.prototype = { + call$0() { + var t1 = this.$this; + return t1._addExceptionTrace$1(new A._EvaluateVisitor_runExpression___closure(t1, this.expression)); + }, + $signature: 36 + }; + A._EvaluateVisitor_runExpression___closure.prototype = { + call$0() { + return this.expression.accept$1(this.$this); + }, + $signature: 36 + }; + A._EvaluateVisitor_runStatement_closure.prototype = { + call$0() { + var t1 = this.$this, + t2 = this.statement; + return t1._withFakeStylesheet$3(this.importer, t2, new A._EvaluateVisitor_runStatement__closure(t1, t2)); + }, + $signature: 0 + }; + A._EvaluateVisitor_runStatement__closure.prototype = { + call$0() { + var t1 = this.$this; + return t1._addExceptionTrace$1(new A._EvaluateVisitor_runStatement___closure(t1, this.statement)); + }, + $signature: 0 + }; + A._EvaluateVisitor_runStatement___closure.prototype = { + call$0() { + return this.statement.accept$1(this.$this); + }, + $signature: 0 + }; + A._EvaluateVisitor__loadModule_closure.prototype = { + call$0() { + return this.callback.call$2(this._box_1.builtInModule, false); + }, + $signature: 0 + }; + A._EvaluateVisitor__loadModule_closure0.prototype = { + call$0() { + var canonicalUrl, oldInDependency, t4, message, _this = this, t1 = {}, stylesheet = null, importer = null, + t2 = _this.$this, + t3 = _this.nodeWithSpan, + _1_0 = t2._loadStylesheet$3$baseUrl(_this.url.toString$0(0), t3.get$span(t3), _this.baseUrl); + stylesheet = _1_0._0; + importer = _1_0._1; + t4 = stylesheet.span; + canonicalUrl = t4.get$sourceUrl(t4); + if (canonicalUrl != null) { + t4 = t2._activeModules; + if (t4.containsKey$1(canonicalUrl)) { + if (_this.namesInErrors) { + t1 = canonicalUrl; + t3 = $.$get$context(); + t1.toString; + message = "Module loop: " + t3.prettyUri$1(t1) + " is already being loaded."; + } else + message = string$.Modulel; + t1 = A.NullableExtension_andThen(t4.$index(0, canonicalUrl), new A._EvaluateVisitor__loadModule__closure(t2, message)); + throw A.wrapException(t1 == null ? t2._evaluate$_exception$1(message) : t1); + } else + t4.$indexSet(0, canonicalUrl, t3); + } + t4 = t2._modules.containsKey$1(canonicalUrl); + oldInDependency = t2._inDependency; + t2._inDependency = _1_0._2; + t1.module = null; + try { + t1.module = t2._execute$5$configuration$namesInErrors$nodeWithSpan(importer, stylesheet, _this.configuration, _this.namesInErrors, t3); + } finally { + t2._activeModules.remove$1(0, canonicalUrl); + t2._inDependency = oldInDependency; + } + t2._addExceptionSpan$3$addStackFrame(t3, new A._EvaluateVisitor__loadModule__closure0(t1, _this.callback, !t4), false); + }, + $signature: 1 + }; + A._EvaluateVisitor__loadModule__closure.prototype = { + call$1(previousLoad) { + return this.$this._multiSpanException$3(this.message, "new load", A.LinkedHashMap_LinkedHashMap$_literal([previousLoad.get$span(previousLoad), "original load"], type$.FileSpan, type$.String)); + }, + $signature: 88 + }; + A._EvaluateVisitor__loadModule__closure0.prototype = { + call$0() { + return this.callback.call$2(this._box_0.module, this.firstLoad); + }, + $signature: 0 + }; + A._EvaluateVisitor__execute_closure.prototype = { + call$0() { + var t3, t4, t5, t6, _this = this, + t1 = _this.$this, + oldImporter = t1._importer, + oldStylesheet = t1.__stylesheet, + oldRoot = t1.__root, + oldPreModuleComments = t1._preModuleComments, + oldParent = t1.__parent, + oldEndOfImports = t1.__endOfImports, + oldOutOfOrderImports = t1._outOfOrderImports, + oldExtensionStore = t1.__extensionStore, + t2 = t1._atRootExcludingStyleRule, + oldStyleRule = t2 ? null : t1._styleRuleIgnoringAtRoot, + oldMediaQueries = t1._mediaQueries, + oldDeclarationName = t1._declarationName, + oldInUnknownAtRule = t1._inUnknownAtRule, + oldInKeyframes = t1._inKeyframes, + oldConfiguration = t1._configuration; + t1._importer = _this.importer; + t3 = t1.__stylesheet = _this.stylesheet; + t4 = t3.span; + t5 = t1.__parent = t1.__root = A.ModifiableCssStylesheet$(t4); + t1.__endOfImports = 0; + t1._outOfOrderImports = null; + t1.__extensionStore = _this.extensionStore; + t1._declarationName = t1._mediaQueries = t1._styleRuleIgnoringAtRoot = null; + t1._inKeyframes = t1._atRootExcludingStyleRule = t1._inUnknownAtRule = false; + t6 = _this.configuration; + if (t6 != null) + t1._configuration = t6; + t1.visitStylesheet$1(t3); + t3 = t1._outOfOrderImports == null ? t5 : new A.CssStylesheet(new A.UnmodifiableListView(t1._addOutOfOrderImports$0(), type$.UnmodifiableListView_CssNode), t4); + _this.css._value = t3; + _this.preModuleComments._value = t1._preModuleComments; + t1._importer = oldImporter; + t1.__stylesheet = oldStylesheet; + t1.__root = oldRoot; + t1._preModuleComments = oldPreModuleComments; + t1.__parent = oldParent; + t1.__endOfImports = oldEndOfImports; + t1._outOfOrderImports = oldOutOfOrderImports; + t1.__extensionStore = oldExtensionStore; + t1._styleRuleIgnoringAtRoot = oldStyleRule; + t1._mediaQueries = oldMediaQueries; + t1._declarationName = oldDeclarationName; + t1._inUnknownAtRule = oldInUnknownAtRule; + t1._atRootExcludingStyleRule = t2; + t1._inKeyframes = oldInKeyframes; + t1._configuration = oldConfiguration; + }, + $signature: 1 + }; + A._EvaluateVisitor__combineCss_closure.prototype = { + call$1(module) { + return module.get$transitivelyContainsCss(); + }, + $signature: 121 + }; + A._EvaluateVisitor__combineCss_closure0.prototype = { + call$1(target) { + return !this.selectors.contains$1(0, target); + }, + $signature: 15 + }; + A._EvaluateVisitor__combineCss_visitModule.prototype = { + call$1(module) { + var t1, t2, t3, t4, _i, upstream, _1_0, statements, index, _this = this; + if (!_this.seen.add$1(0, module)) + return; + if (_this.clone) + module = module.cloneCss$0(); + for (t1 = module.get$upstream(), t2 = t1.length, t3 = _this.css, t4 = _this.imports, _i = 0; _i < t1.length; t1.length === t2 || (0, A.throwConcurrentModificationError)(t1), ++_i) { + upstream = t1[_i]; + if (upstream.get$transitivelyContainsCss()) { + _1_0 = module.get$preModuleComments().$index(0, upstream); + if (_1_0 != null) + B.JSArray_methods.addAll$1(t3.length === 0 ? t4 : t3, _1_0); + _this.call$1(upstream); + } + } + _this.sorted.addFirst$1(module); + t1 = module.get$css(module); + statements = t1.get$children(t1); + index = _this.$this._indexAfterImports$1(statements); + t1 = J.getInterceptor$ax(statements); + B.JSArray_methods.addAll$1(t4, t1.getRange$2(statements, 0, index)); + B.JSArray_methods.addAll$1(t3, t1.getRange$2(statements, index, t1.get$length(statements))); + }, + $signature: 294 + }; + A._EvaluateVisitor__extendModules_closure.prototype = { + call$1(target) { + return !this.originalSelectors.contains$1(0, target); + }, + $signature: 15 + }; + A._EvaluateVisitor__extendModules_closure0.prototype = { + call$0() { + return A._setArrayType([], type$.JSArray_ExtensionStore); + }, + $signature: 222 + }; + A._EvaluateVisitor_visitAtRootRule_closure.prototype = { + call$0() { + var t1, t2, t3, _i; + for (t1 = this.node.children, t2 = t1.length, t3 = this.$this, _i = 0; _i < t2; ++_i) + t1[_i].accept$1(t3); + }, + $signature: 1 + }; + A._EvaluateVisitor_visitAtRootRule_closure0.prototype = { + call$0() { + var t1, t2, t3, _i; + for (t1 = this.node.children, t2 = t1.length, t3 = this.$this, _i = 0; _i < t2; ++_i) + t1[_i].accept$1(t3); + }, + $signature: 0 + }; + A._EvaluateVisitor__scopeForAtRoot_closure.prototype = { + call$1(callback) { + var t1 = this.$this, + t2 = t1._assertInModule$2(t1.__parent, "__parent"); + t1.__parent = this.newParent; + t1._environment.scope$1$2$when(callback, this.node.hasDeclarations, type$.void); + t1.__parent = t2; + }, + $signature: 32 + }; + A._EvaluateVisitor__scopeForAtRoot_closure0.prototype = { + call$1(callback) { + var t1 = this.$this, + oldAtRootExcludingStyleRule = t1._atRootExcludingStyleRule; + t1._atRootExcludingStyleRule = true; + this.innerScope.call$1(callback); + t1._atRootExcludingStyleRule = oldAtRootExcludingStyleRule; + }, + $signature: 32 + }; + A._EvaluateVisitor__scopeForAtRoot_closure1.prototype = { + call$1(callback) { + return this.$this._withMediaQueries$3(null, null, new A._EvaluateVisitor__scopeForAtRoot__closure(this.innerScope, callback)); + }, + $signature: 32 + }; + A._EvaluateVisitor__scopeForAtRoot__closure.prototype = { + call$0() { + return this.innerScope.call$1(this.callback); + }, + $signature: 1 + }; + A._EvaluateVisitor__scopeForAtRoot_closure2.prototype = { + call$1(callback) { + var t1 = this.$this, + wasInKeyframes = t1._inKeyframes; + t1._inKeyframes = false; + this.innerScope.call$1(callback); + t1._inKeyframes = wasInKeyframes; + }, + $signature: 32 + }; + A._EvaluateVisitor__scopeForAtRoot_closure3.prototype = { + call$1($parent) { + return $parent instanceof A.ModifiableCssAtRule; + }, + $signature: 224 + }; + A._EvaluateVisitor__scopeForAtRoot_closure4.prototype = { + call$1(callback) { + var t1 = this.$this, + wasInUnknownAtRule = t1._inUnknownAtRule; + t1._inUnknownAtRule = false; + this.innerScope.call$1(callback); + t1._inUnknownAtRule = wasInUnknownAtRule; + }, + $signature: 32 + }; + A._EvaluateVisitor_visitContentRule_closure.prototype = { + call$0() { + var t1, t2, t3, _i; + for (t1 = this.content.declaration.children, t2 = t1.length, t3 = this.$this, _i = 0; _i < t2; ++_i) + t1[_i].accept$1(t3); + return null; + }, + $signature: 1 + }; + A._EvaluateVisitor_visitDeclaration_closure.prototype = { + call$0() { + var t1, t2, t3, _i; + for (t1 = this._box_0.children, t2 = t1.length, t3 = this.$this, _i = 0; _i < t2; ++_i) + t1[_i].accept$1(t3); + }, + $signature: 1 + }; + A._EvaluateVisitor_visitEachRule_closure.prototype = { + call$1(value) { + var t1 = this.$this, + t2 = this.nodeWithSpan; + return t1._environment.setLocalVariable$3(this._box_0.variable, t1._withoutSlash$2(value, t2), t2); + }, + $signature: 58 + }; + A._EvaluateVisitor_visitEachRule_closure0.prototype = { + call$1(value) { + return this.$this._setMultipleVariables$3(this._box_0.variables, value, this.nodeWithSpan); + }, + $signature: 58 + }; + A._EvaluateVisitor_visitEachRule_closure1.prototype = { + call$0() { + var _this = this, + t1 = _this.$this; + return t1._handleReturn$2(_this.list.get$asList(), new A._EvaluateVisitor_visitEachRule__closure(t1, _this.setVariables, _this.node)); + }, + $signature: 40 + }; + A._EvaluateVisitor_visitEachRule__closure.prototype = { + call$1(element) { + var t1; + this.setVariables.call$1(element); + t1 = this.$this; + return t1._handleReturn$2(this.node.children, new A._EvaluateVisitor_visitEachRule___closure(t1)); + }, + $signature: 292 + }; + A._EvaluateVisitor_visitEachRule___closure.prototype = { + call$1(child) { + return child.accept$1(this.$this); + }, + $signature: 109 + }; + A._EvaluateVisitor_visitAtRule_closure.prototype = { + call$1(value) { + return this.$this._interpolationToValue$3$trim$warnForColor(value, true, true); + }, + $signature: 291 + }; + A._EvaluateVisitor_visitAtRule_closure0.prototype = { + call$0() { + var t2, t3, _i, _this = this, + t1 = _this.$this, + styleRule = t1._atRootExcludingStyleRule ? null : t1._styleRuleIgnoringAtRoot; + if (styleRule == null || t1._inKeyframes || J.$eq$(_this.name.value, "font-face")) + for (t2 = _this.children, t3 = t2.length, _i = 0; _i < t3; ++_i) + t2[_i].accept$1(t1); + else + t1._withParent$2$3$scopeWhen(A.ModifiableCssStyleRule$(styleRule._style_rule$_selector, styleRule.span, styleRule.originalSelector), new A._EvaluateVisitor_visitAtRule__closure(t1, _this.children), false, type$.ModifiableCssStyleRule, type$.Null); + }, + $signature: 1 + }; + A._EvaluateVisitor_visitAtRule__closure.prototype = { + call$0() { + var t1, t2, t3, _i; + for (t1 = this.children, t2 = t1.length, t3 = this.$this, _i = 0; _i < t2; ++_i) + t1[_i].accept$1(t3); + }, + $signature: 1 + }; + A._EvaluateVisitor_visitAtRule_closure1.prototype = { + call$1(node) { + return node instanceof A.ModifiableCssStyleRule; + }, + $signature: 7 + }; + A._EvaluateVisitor_visitForRule_closure.prototype = { + call$0() { + return this.node.from.accept$1(this.$this).assertNumber$0(); + }, + $signature: 262 + }; + A._EvaluateVisitor_visitForRule_closure0.prototype = { + call$0() { + return this.node.to.accept$1(this.$this).assertNumber$0(); + }, + $signature: 262 + }; + A._EvaluateVisitor_visitForRule_closure1.prototype = { + call$0() { + return this.fromNumber.assertInt$0(); + }, + $signature: 10 + }; + A._EvaluateVisitor_visitForRule_closure2.prototype = { + call$0() { + var t1 = this.fromNumber; + return this.toNumber.coerce$2(t1.get$numeratorUnits(t1), t1.get$denominatorUnits(t1)).assertInt$0(); + }, + $signature: 10 + }; + A._EvaluateVisitor_visitForRule_closure3.prototype = { + call$0() { + var i, t3, t4, t5, t6, t7, t8, _0_0, _this = this, + t1 = _this.$this, + t2 = _this.node, + nodeWithSpan = t1._expressionNode$1(t2.from); + for (i = _this.from, t3 = _this._box_0, t4 = _this.direction, t5 = t2.variable, t6 = _this.fromNumber, t2 = t2.children; i !== t3.to; i += t4) { + t7 = t1._environment; + t8 = t6.get$numeratorUnits(t6); + t7.setLocalVariable$3(t5, A.SassNumber_SassNumber$withUnits(i, t6.get$denominatorUnits(t6), t8), nodeWithSpan); + _0_0 = t1._handleReturn$2(t2, new A._EvaluateVisitor_visitForRule__closure(t1)); + if (_0_0 != null) + return _0_0; + } + return null; + }, + $signature: 40 + }; + A._EvaluateVisitor_visitForRule__closure.prototype = { + call$1(child) { + return child.accept$1(this.$this); + }, + $signature: 109 + }; + A._EvaluateVisitor_visitForwardRule_closure.prototype = { + call$2(module, firstLoad) { + if (firstLoad) + this.$this._registerCommentsForModule$1(module); + this.$this._environment.forwardModule$2(module, this.node); + }, + $signature: 105 + }; + A._EvaluateVisitor_visitForwardRule_closure0.prototype = { + call$2(module, firstLoad) { + if (firstLoad) + this.$this._registerCommentsForModule$1(module); + this.$this._environment.forwardModule$2(module, this.node); + }, + $signature: 105 + }; + A._EvaluateVisitor__registerCommentsForModule_closure.prototype = { + call$0() { + return A._setArrayType([], type$.JSArray_CssComment); + }, + $signature: 233 + }; + A._EvaluateVisitor_visitIfRule_closure.prototype = { + call$1(clause) { + var t1 = this.$this; + return t1._environment.scope$1$3$semiGlobal$when(new A._EvaluateVisitor_visitIfRule__closure(t1, clause), true, clause.hasDeclarations, type$.nullable_Value); + }, + $signature: 289 + }; + A._EvaluateVisitor_visitIfRule__closure.prototype = { + call$0() { + var t1 = this.$this; + return t1._handleReturn$2(this.clause.children, new A._EvaluateVisitor_visitIfRule___closure(t1)); + }, + $signature: 40 + }; + A._EvaluateVisitor_visitIfRule___closure.prototype = { + call$1(child) { + return child.accept$1(this.$this); + }, + $signature: 109 + }; + A._EvaluateVisitor__visitDynamicImport_closure.prototype = { + call$0() { + var t1, t2, _0_0, stylesheet, importer, isDependency, t3, url, oldImporter, oldInDependency, loadsUserDefinedModules, children, t4, t5, t6, t7, t8, t9, t10, environment, module, visitor, _box_0 = {}; + _box_0.isDependency = _box_0.importer = _box_0.stylesheet = null; + t1 = this.$this; + t2 = this.$import; + _0_0 = t1._loadStylesheet$3$forImport(t2.urlString, t2.span, true); + stylesheet = _box_0.stylesheet = _0_0._0; + importer = _0_0._1; + _box_0.importer = importer; + isDependency = _0_0._2; + _box_0.isDependency = isDependency; + t3 = stylesheet.span; + url = t3.get$sourceUrl(t3); + if (url != null) { + t3 = t1._activeModules; + if (t3.containsKey$1(url)) { + t2 = A.NullableExtension_andThen(t3.$index(0, url), new A._EvaluateVisitor__visitDynamicImport__closure(t1)); + throw A.wrapException(t2 == null ? t1._evaluate$_exception$1("This file is already being loaded.") : t2); + } + t3.$indexSet(0, url, t2); + } + t2 = stylesheet._uses; + t3 = type$.UnmodifiableListView_UseRule; + if (new A.UnmodifiableListView(t2, t3).get$length(0) === 0 && new A.UnmodifiableListView(stylesheet._forwards, type$.UnmodifiableListView_ForwardRule).get$length(0) === 0) { + oldImporter = t1._importer; + t2 = t1._assertInModule$2(t1.__stylesheet, "_stylesheet"); + oldInDependency = t1._inDependency; + t1._importer = importer; + t1.__stylesheet = stylesheet; + t1._inDependency = isDependency; + t1.visitStylesheet$1(stylesheet); + t1._importer = oldImporter; + t1.__stylesheet = t2; + t1._inDependency = oldInDependency; + t1._activeModules.remove$1(0, url); + return; + } + t2 = new A.UnmodifiableListView(t2, t3); + if (!t2.any$1(t2, new A._EvaluateVisitor__visitDynamicImport__closure0())) { + t2 = new A.UnmodifiableListView(stylesheet._forwards, type$.UnmodifiableListView_ForwardRule); + loadsUserDefinedModules = t2.any$1(t2, new A._EvaluateVisitor__visitDynamicImport__closure1()); + } else + loadsUserDefinedModules = true; + children = A._Cell$(); + t2 = t1._environment; + t3 = type$.String; + t4 = type$.Module_Callable; + t5 = type$.AstNode; + t6 = A._setArrayType([], type$.JSArray_Module_Callable); + t7 = t2._variables; + t7 = A._setArrayType(t7.slice(0), A._arrayInstanceType(t7)); + t8 = t2._variableNodes; + t8 = A._setArrayType(t8.slice(0), A._arrayInstanceType(t8)); + t9 = t2._functions; + t9 = A._setArrayType(t9.slice(0), A._arrayInstanceType(t9)); + t10 = t2._mixins; + t10 = A._setArrayType(t10.slice(0), A._arrayInstanceType(t10)); + environment = A.Environment$_(A.LinkedHashMap_LinkedHashMap$_empty(t3, t4), A.LinkedHashMap_LinkedHashMap$_empty(t3, t5), A.LinkedHashMap_LinkedHashMap$_empty(t4, t5), t2._importedModules, null, null, t6, t7, t8, t9, t10, t2._content); + t1._withEnvironment$2(environment, new A._EvaluateVisitor__visitDynamicImport__closure2(_box_0, t1, loadsUserDefinedModules, environment, children)); + module = environment.toDummyModule$0(); + t1._environment.importForwards$1(module); + if (loadsUserDefinedModules) { + if (module.transitivelyContainsCss) + t1._combineCss$2$clone(module, module.transitivelyContainsExtensions).accept$1(t1); + visitor = new A._ImportedCssVisitor(t1); + for (t2 = J.get$iterator$ax(children._readLocal$0()); t2.moveNext$0();) + t2.get$current(t2).accept$1(visitor); + } + t1._activeModules.remove$1(0, url); + }, + $signature: 0 + }; + A._EvaluateVisitor__visitDynamicImport__closure.prototype = { + call$1(previousLoad) { + return this.$this._multiSpanException$3("This file is already being loaded.", "new load", A.LinkedHashMap_LinkedHashMap$_literal([previousLoad.get$span(previousLoad), "original load"], type$.FileSpan, type$.String)); + }, + $signature: 88 + }; + A._EvaluateVisitor__visitDynamicImport__closure0.prototype = { + call$1(rule) { + return rule.url.get$scheme() !== "sass"; + }, + $signature: 235 + }; + A._EvaluateVisitor__visitDynamicImport__closure1.prototype = { + call$1(rule) { + return rule.url.get$scheme() !== "sass"; + }, + $signature: 236 + }; + A._EvaluateVisitor__visitDynamicImport__closure2.prototype = { + call$0() { + var t7, t8, _this = this, + t1 = _this.$this, + oldImporter = t1._importer, + t2 = t1._assertInModule$2(t1.__stylesheet, "_stylesheet"), + t3 = t1._assertInModule$2(t1.__root, "_root"), + t4 = t1._assertInModule$2(t1.__parent, "__parent"), + t5 = t1._assertInModule$2(t1.__endOfImports, "_endOfImports"), + oldOutOfOrderImports = t1._outOfOrderImports, + oldConfiguration = t1._configuration, + oldInDependency = t1._inDependency, + t6 = _this._box_0; + t1._importer = t6.importer; + t7 = t6.stylesheet; + t1.__stylesheet = t7; + t8 = _this.loadsUserDefinedModules; + if (t8) { + t7 = A.ModifiableCssStylesheet$(t7.span); + t1.__root = t7; + t1.__parent = t1._assertInModule$2(t7, "_root"); + t1.__endOfImports = 0; + t1._outOfOrderImports = null; + } + t1._inDependency = t6.isDependency; + t7 = new A.UnmodifiableListView(t6.stylesheet._forwards, type$.UnmodifiableListView_ForwardRule); + if (!t7.get$isEmpty(t7)) + t1._configuration = _this.environment.toImplicitConfiguration$0(); + t1.visitStylesheet$1(t6.stylesheet); + t6 = t8 ? t1._addOutOfOrderImports$0() : A._setArrayType([], type$.JSArray_ModifiableCssNode); + _this.children._value = t6; + t1._importer = oldImporter; + t1.__stylesheet = t2; + if (t8) { + t1.__root = t3; + t1.__parent = t4; + t1.__endOfImports = t5; + t1._outOfOrderImports = oldOutOfOrderImports; + } + t1._configuration = oldConfiguration; + t1._inDependency = oldInDependency; + }, + $signature: 1 + }; + A._EvaluateVisitor__applyMixin_closure.prototype = { + call$0() { + var _this = this, + t1 = _this.$this; + t1._environment.asMixin$1(new A._EvaluateVisitor__applyMixin__closure0(t1, _this.$arguments, _this.mixin, _this.nodeWithSpanWithoutContent)); + }, + $signature: 0 + }; + A._EvaluateVisitor__applyMixin__closure0.prototype = { + call$0() { + var _this = this; + _this.$this._runBuiltInCallable$3(_this.$arguments, _this.mixin, _this.nodeWithSpanWithoutContent); + }, + $signature: 0 + }; + A._EvaluateVisitor__applyMixin_closure0.prototype = { + call$0() { + var _this = this, + t1 = _this.$this; + t1._environment.withContent$2(_this.contentCallable, new A._EvaluateVisitor__applyMixin__closure(t1, _this.mixin, _this.nodeWithSpanWithoutContent)); + }, + $signature: 1 + }; + A._EvaluateVisitor__applyMixin__closure.prototype = { + call$0() { + var t1 = this.$this; + t1._environment.asMixin$1(new A._EvaluateVisitor__applyMixin___closure(t1, this.mixin, this.nodeWithSpanWithoutContent)); + }, + $signature: 0 + }; + A._EvaluateVisitor__applyMixin___closure.prototype = { + call$0() { + var t1, t2, t3, t4, _i; + for (t1 = this.mixin.declaration.children, t2 = t1.length, t3 = this.$this, t4 = this.nodeWithSpanWithoutContent, _i = 0; _i < t2; ++_i) + t3._addErrorSpan$2(t4, new A._EvaluateVisitor__applyMixin____closure(t3, t1[_i])); + }, + $signature: 0 + }; + A._EvaluateVisitor__applyMixin____closure.prototype = { + call$0() { + return this.statement.accept$1(this.$this); + }, + $signature: 40 + }; + A._EvaluateVisitor_visitIncludeRule_closure.prototype = { + call$0() { + var t1 = this.node; + return this.$this._environment.getMixin$2$namespace(t1.name, t1.namespace); + }, + $signature: 104 + }; + A._EvaluateVisitor_visitIncludeRule_closure0.prototype = { + call$1($content) { + var t1 = this.$this; + return new A.UserDefinedCallable($content, t1._environment.closure$0(), t1._inDependency, type$.UserDefinedCallable_Environment); + }, + $signature: 288 + }; + A._EvaluateVisitor_visitIncludeRule_closure1.prototype = { + call$0() { + return this.node.get$spanWithoutContent(); + }, + $signature: 25 + }; + A._EvaluateVisitor_visitMediaRule_closure.prototype = { + call$1(mediaQueries) { + return this.$this._mergeMediaQueries$2(mediaQueries, this.queries); + }, + $signature: 94 + }; + A._EvaluateVisitor_visitMediaRule_closure0.prototype = { + call$0() { + var _this = this, + t1 = _this.$this, + t2 = _this.mergedQueries; + if (t2 == null) + t2 = _this.queries; + t1._withMediaQueries$3(t2, _this.mergedSources, new A._EvaluateVisitor_visitMediaRule__closure(t1, _this.node)); + }, + $signature: 1 + }; + A._EvaluateVisitor_visitMediaRule__closure.prototype = { + call$0() { + var t2, t3, _i, + t1 = this.$this, + _0_0 = t1._atRootExcludingStyleRule ? null : t1._styleRuleIgnoringAtRoot; + if (_0_0 != null) + t1._withParent$2$3$scopeWhen(A.ModifiableCssStyleRule$(_0_0._style_rule$_selector, _0_0.span, _0_0.originalSelector), new A._EvaluateVisitor_visitMediaRule___closure(t1, this.node), false, type$.ModifiableCssStyleRule, type$.Null); + else + for (t2 = this.node.children, t3 = t2.length, _i = 0; _i < t3; ++_i) + t2[_i].accept$1(t1); + }, + $signature: 1 + }; + A._EvaluateVisitor_visitMediaRule___closure.prototype = { + call$0() { + var t1, t2, t3, _i; + for (t1 = this.node.children, t2 = t1.length, t3 = this.$this, _i = 0; _i < t2; ++_i) + t1[_i].accept$1(t3); + }, + $signature: 1 + }; + A._EvaluateVisitor_visitMediaRule_closure1.prototype = { + call$1(node) { + var t1; + if (!(node instanceof A.ModifiableCssStyleRule)) { + t1 = this.mergedSources; + t1 = t1.get$isNotEmpty(t1) && node instanceof A.ModifiableCssMediaRule && B.JSArray_methods.every$1(node.queries, t1.get$contains(t1)); + } else + t1 = true; + return t1; + }, + $signature: 7 + }; + A._EvaluateVisitor_visitStyleRule_closure.prototype = { + call$0() { + var t1, t2, t3, _i; + for (t1 = this.node.children, t2 = t1.length, t3 = this.$this, _i = 0; _i < t2; ++_i) + t1[_i].accept$1(t3); + }, + $signature: 1 + }; + A._EvaluateVisitor_visitStyleRule_closure0.prototype = { + call$1(node) { + return node instanceof A.ModifiableCssStyleRule; + }, + $signature: 7 + }; + A._EvaluateVisitor_visitStyleRule_closure1.prototype = { + call$0() { + var t1 = this.$this; + t1._withStyleRule$2(this.rule, new A._EvaluateVisitor_visitStyleRule__closure(t1, this.node)); + }, + $signature: 1 + }; + A._EvaluateVisitor_visitStyleRule__closure.prototype = { + call$0() { + var t1, t2, t3, _i; + for (t1 = this.node.children, t2 = t1.length, t3 = this.$this, _i = 0; _i < t2; ++_i) + t1[_i].accept$1(t3); + }, + $signature: 1 + }; + A._EvaluateVisitor_visitStyleRule_closure2.prototype = { + call$1(node) { + return node instanceof A.ModifiableCssStyleRule; + }, + $signature: 7 + }; + A._EvaluateVisitor_visitStyleRule_closure3.prototype = { + call$1(child) { + return child instanceof A.ModifiableCssComment; + }, + $signature: 118 + }; + A._EvaluateVisitor_visitSupportsRule_closure.prototype = { + call$0() { + var t2, t3, _i, + t1 = this.$this, + _0_0 = t1._atRootExcludingStyleRule ? null : t1._styleRuleIgnoringAtRoot; + if (_0_0 != null) + t1._withParent$2$2(A.ModifiableCssStyleRule$(_0_0._style_rule$_selector, _0_0.span, _0_0.originalSelector), new A._EvaluateVisitor_visitSupportsRule__closure(t1, this.node), type$.ModifiableCssStyleRule, type$.Null); + else + for (t2 = this.node.children, t3 = t2.length, _i = 0; _i < t3; ++_i) + t2[_i].accept$1(t1); + }, + $signature: 1 + }; + A._EvaluateVisitor_visitSupportsRule__closure.prototype = { + call$0() { + var t1, t2, t3, _i; + for (t1 = this.node.children, t2 = t1.length, t3 = this.$this, _i = 0; _i < t2; ++_i) + t1[_i].accept$1(t3); + }, + $signature: 1 + }; + A._EvaluateVisitor_visitSupportsRule_closure0.prototype = { + call$1(node) { + return node instanceof A.ModifiableCssStyleRule; + }, + $signature: 7 + }; + A._EvaluateVisitor__visitSupportsCondition_closure.prototype = { + call$0() { + var t4, + t1 = this.$this, + t2 = this._box_0, + t3 = t2.declaration.name; + t3 = t1._evaluate$_serialize$3$quote(t3.accept$1(t1), t3, true); + t4 = t2.declaration.get$isCustomProperty() ? "" : " "; + t2 = t2.declaration.value; + return "(" + t3 + ":" + t4 + t1._evaluate$_serialize$3$quote(t2.accept$1(t1), t2, true) + ")"; + }, + $signature: 27 + }; + A._EvaluateVisitor_visitVariableDeclaration_closure.prototype = { + call$0() { + var t1 = this.$this._environment, + t2 = this._box_0.override; + t1.setVariable$4$global(this.node.name, t2.value, t2.assignmentNode, true); + }, + $signature: 1 + }; + A._EvaluateVisitor_visitVariableDeclaration_closure0.prototype = { + call$0() { + var t1 = this.node; + return this.$this._environment.getVariable$2$namespace(t1.name, t1.namespace); + }, + $signature: 40 + }; + A._EvaluateVisitor_visitVariableDeclaration_closure1.prototype = { + call$0() { + var t1 = this.$this, + t2 = this.node; + t1._environment.setVariable$5$global$namespace(t2.name, this.value, t1._expressionNode$1(t2.expression), t2.isGlobal, t2.namespace); + }, + $signature: 1 + }; + A._EvaluateVisitor_visitUseRule_closure.prototype = { + call$2(module, firstLoad) { + var t1, t2, t3, _0_0, t4, t5, span; + if (firstLoad) + this.$this._registerCommentsForModule$1(module); + t1 = this.$this._environment; + t2 = this.node; + t3 = t2.namespace; + if (t3 == null) { + t1._globalModules.$indexSet(0, module, t2); + t1._allModules.push(module); + _0_0 = A.IterableExtension_firstWhereOrNull(J.get$keys$z(B.JSArray_methods.get$first(t1._variables)), module.get$variables().get$containsKey()); + if (_0_0 != null) + A.throwExpression(A.SassScriptException$(string$.This_ma + _0_0 + '".', null)); + } else { + t4 = t1._environment$_modules; + if (t4.containsKey$1(t3)) { + t5 = t1._namespaceNodes.$index(0, t3); + span = t5 == null ? null : t5.span; + t5 = A.LinkedHashMap_LinkedHashMap$_empty(type$.FileSpan, type$.String); + if (span != null) + t5.$indexSet(0, span, "original @use"); + A.throwExpression(A.MultiSpanSassScriptException$(string$.There_ + t3 + '".', "new @use", t5)); + } + t4.$indexSet(0, t3, module); + t1._namespaceNodes.$indexSet(0, t3, t2); + t1._allModules.push(module); + } + }, + $signature: 105 + }; + A._EvaluateVisitor_visitWarnRule_closure.prototype = { + call$0() { + return this.node.expression.accept$1(this.$this); + }, + $signature: 36 + }; + A._EvaluateVisitor_visitWhileRule_closure.prototype = { + call$0() { + var t1, t2, t3, _0_0; + for (t1 = this.node, t2 = t1.condition, t3 = this.$this, t1 = t1.children; t2.accept$1(t3).get$isTruthy();) { + _0_0 = t3._handleReturn$2(t1, new A._EvaluateVisitor_visitWhileRule__closure(t3)); + if (_0_0 != null) + return _0_0; + } + return null; + }, + $signature: 40 + }; + A._EvaluateVisitor_visitWhileRule__closure.prototype = { + call$1(child) { + return child.accept$1(this.$this); + }, + $signature: 109 + }; + A._EvaluateVisitor_visitBinaryOperationExpression_closure.prototype = { + call$0() { + var t1 = this.node, + t2 = this.$this, + left = t1.left.accept$1(t2); + switch (t1.operator) { + case B.BinaryOperator_2jN: + t1 = t1.right.accept$1(t2); + t1 = new A.SassString(A.serializeValue(left, false, true) + "=" + A.serializeValue(t1, false, true), false); + break; + case B.BinaryOperator_M6L: + t1 = left.get$isTruthy() ? left : t1.right.accept$1(t2); + break; + case B.BinaryOperator_SNp: + t1 = left.get$isTruthy() ? t1.right.accept$1(t2) : left; + break; + case B.BinaryOperator_ql5: + t1 = left.$eq(0, t1.right.accept$1(t2)) ? B.SassBoolean_true : B.SassBoolean_false; + break; + case B.BinaryOperator_ViB: + t1 = !left.$eq(0, t1.right.accept$1(t2)) ? B.SassBoolean_true : B.SassBoolean_false; + break; + case B.BinaryOperator_cIH: + t1 = left.greaterThan$1(t1.right.accept$1(t2)); + break; + case B.BinaryOperator_7Tg: + t1 = left.greaterThanOrEquals$1(t1.right.accept$1(t2)); + break; + case B.BinaryOperator_U8c: + t1 = left.lessThan$1(t1.right.accept$1(t2)); + break; + case B.BinaryOperator_kpg: + t1 = left.lessThanOrEquals$1(t1.right.accept$1(t2)); + break; + case B.BinaryOperator_anB: + t1 = left.plus$1(t1.right.accept$1(t2)); + break; + case B.BinaryOperator_olz: + t1 = left.minus$1(t1.right.accept$1(t2)); + break; + case B.BinaryOperator_qN2: + t1 = left.times$1(t1.right.accept$1(t2)); + break; + case B.BinaryOperator_t8B: + t1 = t2._slash$3(left, t1.right.accept$1(t2), t1); + break; + case B.BinaryOperator_OTG: + t1 = left.modulo$1(t1.right.accept$1(t2)); + break; + default: + t1 = null; + } + return t1; + }, + $signature: 36 + }; + A._EvaluateVisitor__slash_recommendation.prototype = { + call$1(expression) { + var t1; + $label0$0: { + if (expression instanceof A.BinaryOperationExpression && B.BinaryOperator_t8B === expression.operator) { + t1 = "math.div(" + A.S(this.call$1(expression.left)) + ", " + A.S(this.call$1(expression.right)) + ")"; + break $label0$0; + } + if (expression instanceof A.ParenthesizedExpression) { + t1 = expression.expression.toString$0(0); + break $label0$0; + } + t1 = expression.toString$0(0); + break $label0$0; + } + return t1; + }, + $signature: 120 + }; + A._EvaluateVisitor_visitVariableExpression_closure.prototype = { + call$0() { + var t1 = this.node; + return this.$this._environment.getVariable$2$namespace(t1.name, t1.namespace); + }, + $signature: 40 + }; + A._EvaluateVisitor_visitUnaryOperationExpression_closure.prototype = { + call$0() { + var t1, _this = this; + switch (_this.node.operator) { + case B.UnaryOperator_gg4: + t1 = _this.operand.unaryPlus$0(); + break; + case B.UnaryOperator_TLI: + t1 = _this.operand.unaryMinus$0(); + break; + case B.UnaryOperator_Ix1: + t1 = new A.SassString("/" + A.serializeValue(_this.operand, false, true), false); + break; + case B.UnaryOperator_not_not_not: + t1 = _this.operand.unaryNot$0(); + break; + default: + t1 = null; + } + return t1; + }, + $signature: 36 + }; + A._EvaluateVisitor_visitListExpression_closure.prototype = { + call$1(expression) { + return expression.accept$1(this.$this); + }, + $signature: 286 + }; + A._EvaluateVisitor_visitFunctionExpression_closure.prototype = { + call$0() { + var t1 = this.$this._environment, + t2 = this.node; + return t1.getFunction$2$namespace(A.stringReplaceAllUnchecked(t2.originalName, "_", "-"), t2.namespace); + }, + $signature: 104 + }; + A._EvaluateVisitor_visitFunctionExpression_closure0.prototype = { + call$1(argument) { + return argument.accept$1(new A._IsCalculationSafeVisitor()); + }, + $signature: 119 + }; + A._EvaluateVisitor_visitFunctionExpression_closure1.prototype = { + call$0() { + var t1 = this.node; + return this.$this._runFunctionCallable$3(t1.$arguments, this._box_0.$function, t1); + }, + $signature: 36 + }; + A._EvaluateVisitor__checkCalculationArguments_check.prototype = { + call$1(maxArgs) { + var t1 = this.node, + t2 = t1.$arguments.positional.length; + if (t2 === 0) + throw A.wrapException(this.$this._evaluate$_exception$2("Missing argument.", t1.span)); + else if (maxArgs != null && t2 > maxArgs) + throw A.wrapException(this.$this._evaluate$_exception$2("Only " + A.S(maxArgs) + " " + A.pluralize("argument", maxArgs, null) + " allowed, but " + t2 + " " + A.pluralize("was", t2, "were") + " passed.", t1.span)); + }, + call$0() { + return this.call$1(null); + }, + $signature: 99 + }; + A._EvaluateVisitor__visitCalculationExpression_closure.prototype = { + call$0() { + var _this = this, + t1 = _this.$this, + t2 = _this._box_0, + t3 = _this.inLegacySassFunction; + return A.SassCalculation_operateInternal(t1._binaryOperatorToCalculationOperator$2(t2.operator, _this.node), t1._visitCalculationExpression$2$inLegacySassFunction(t2.left, t3), t1._visitCalculationExpression$2$inLegacySassFunction(t2.right, t3), t3, !t1._inSupportsDeclaration); + }, + $signature: 82 + }; + A._EvaluateVisitor_visitInterpolatedFunctionExpression_closure.prototype = { + call$0() { + var t1 = this.node; + return this.$this._runFunctionCallable$3(t1.$arguments, this.$function, t1); + }, + $signature: 36 + }; + A._EvaluateVisitor__runUserDefinedCallable_closure.prototype = { + call$0() { + var _this = this, + t1 = _this.$this, + t2 = _this.callable; + return t1._withEnvironment$2(t2.environment.closure$0(), new A._EvaluateVisitor__runUserDefinedCallable__closure(t1, _this.evaluated, t2, _this.nodeWithSpan, _this.run, _this.V)); + }, + $signature() { + return this.V._eval$1("0()"); + } + }; + A._EvaluateVisitor__runUserDefinedCallable__closure.prototype = { + call$0() { + var _this = this, + t1 = _this.$this, + t2 = _this.V; + return t1._environment.scope$1$1(new A._EvaluateVisitor__runUserDefinedCallable___closure(t1, _this.evaluated, _this.callable, _this.nodeWithSpan, _this.run, t2), t2); + }, + $signature() { + return this.V._eval$1("0()"); + } + }; + A._EvaluateVisitor__runUserDefinedCallable___closure.prototype = { + call$0() { + var declaredArguments, t5, minLength, i, argument, t6, t7, value, t8, restArgument, rest, argumentList, result, argumentWord, _this = this, + t1 = _this.$this, + t2 = _this.evaluated._values, + t3 = _this.callable.declaration.$arguments, + t4 = _this.nodeWithSpan; + t1._verifyArguments$4(J.get$length$asx(t2[2]), t2[0], t3, t4); + declaredArguments = t3.$arguments; + t5 = declaredArguments.length; + minLength = Math.min(J.get$length$asx(t2[2]), t5); + for (i = 0; i < minLength; ++i) + t1._environment.setLocalVariable$3(declaredArguments[i].name, J.$index$asx(t2[2], i), J.$index$asx(t2[3], i)); + for (i = J.get$length$asx(t2[2]); i < t5; ++i) { + argument = declaredArguments[i]; + t6 = t2[0]; + t7 = argument.name; + value = J.remove$1$z(t6, t7); + if (value == null) { + t6 = argument.defaultValue; + value = t1._withoutSlash$2(t6.accept$1(t1), t1._expressionNode$1(t6)); + } + t6 = t1._environment; + t8 = J.$index$asx(t2[1], t7); + if (t8 == null) { + t8 = argument.defaultValue; + t8.toString; + t8 = t1._expressionNode$1(t8); + } + t6.setLocalVariable$3(t7, value, t8); + } + restArgument = t3.restArgument; + if (restArgument != null) { + rest = J.get$length$asx(t2[2]) > t5 ? J.sublist$1$ax(t2[2], t5) : B.List_empty8; + t5 = t2[0]; + t6 = t2[4]; + argumentList = A.SassArgumentList$(rest, t5, t6 === B.ListSeparator_undecided_null_undecided ? B.ListSeparator_rXA : t6); + t1._environment.setLocalVariable$3(restArgument, argumentList, t4); + } else + argumentList = null; + result = _this.run.call$0(); + if (argumentList == null) + return result; + t5 = t2[0].__js_helper$_length; + if (t5 === 0) + return result; + if (argumentList._wereKeywordsAccessed) + return result; + argumentWord = A.pluralize("argument", t5, null); + t2 = t2[0]; + t5 = A.instanceType(t2)._eval$1("LinkedHashMapKeyIterable<1>"); + throw A.wrapException(A.MultiSpanSassRuntimeException$("No " + argumentWord + " named " + A.toSentence(A.MappedIterable_MappedIterable(new A.LinkedHashMapKeyIterable(t2, t5), new A._EvaluateVisitor__runUserDefinedCallable____closure(), t5._eval$1("Iterable.E"), type$.Object), "or") + ".", t4.get$span(t4), "invocation", A.LinkedHashMap_LinkedHashMap$_literal([t3.get$spanWithName(), "declaration"], type$.FileSpan, type$.String), t1._evaluate$_stackTrace$1(t4.get$span(t4)), null)); + }, + $signature() { + return this.V._eval$1("0()"); + } + }; + A._EvaluateVisitor__runUserDefinedCallable____closure.prototype = { + call$1($name) { + return "$" + $name; + }, + $signature: 5 + }; + A._EvaluateVisitor__runFunctionCallable_closure.prototype = { + call$0() { + var t1, t2, t3, t4, _i, $returnValue; + for (t1 = this.callable.declaration, t2 = t1.children, t3 = t2.length, t4 = this.$this, _i = 0; _i < t3; ++_i) { + $returnValue = t2[_i].accept$1(t4); + if ($returnValue instanceof A.Value) + return $returnValue; + } + throw A.wrapException(t4._evaluate$_exception$2("Function finished without @return.", t1.span)); + }, + $signature: 36 + }; + A._EvaluateVisitor__runBuiltInCallable_closure.prototype = { + call$0() { + return this._box_0.overload.verify$2(J.get$length$asx(this.evaluated._values[2]), this.namedSet); + }, + $signature: 0 + }; + A._EvaluateVisitor__runBuiltInCallable_closure0.prototype = { + call$0() { + return this._box_0.callback.call$1(this.evaluated._values[2]); + }, + $signature: 36 + }; + A._EvaluateVisitor__runBuiltInCallable_closure1.prototype = { + call$1($name) { + return "$" + $name; + }, + $signature: 5 + }; + A._EvaluateVisitor__evaluateArguments_closure.prototype = { + call$1(value) { + return value; + }, + $signature: 39 + }; + A._EvaluateVisitor__evaluateArguments_closure0.prototype = { + call$1(value) { + return this.$this._withoutSlash$2(value, this.restNodeForSpan); + }, + $signature: 39 + }; + A._EvaluateVisitor__evaluateArguments_closure1.prototype = { + call$2(key, value) { + var _this = this, + t1 = _this.restNodeForSpan; + _this.named.$indexSet(0, key, _this.$this._withoutSlash$2(value, t1)); + _this.namedNodes.$indexSet(0, key, t1); + }, + $signature: 101 + }; + A._EvaluateVisitor__evaluateArguments_closure2.prototype = { + call$1(value) { + return value; + }, + $signature: 39 + }; + A._EvaluateVisitor__evaluateMacroArguments_closure.prototype = { + call$1(value) { + var t1 = this.restArgs; + return new A.ValueExpression(value, t1.get$span(t1)); + }, + $signature: 59 + }; + A._EvaluateVisitor__evaluateMacroArguments_closure0.prototype = { + call$1(value) { + var t1 = this.restArgs; + return new A.ValueExpression(this.$this._withoutSlash$2(value, this.restNodeForSpan), t1.get$span(t1)); + }, + $signature: 59 + }; + A._EvaluateVisitor__evaluateMacroArguments_closure1.prototype = { + call$2(key, value) { + var _this = this, + t1 = _this.restArgs; + _this.named.$indexSet(0, key, new A.ValueExpression(_this.$this._withoutSlash$2(value, _this.restNodeForSpan), t1.get$span(t1))); + }, + $signature: 101 + }; + A._EvaluateVisitor__evaluateMacroArguments_closure2.prototype = { + call$1(value) { + var t1 = this.keywordRestArgs; + return new A.ValueExpression(this.$this._withoutSlash$2(value, this.keywordRestNodeForSpan), t1.get$span(t1)); + }, + $signature: 59 + }; + A._EvaluateVisitor__addRestMap_closure.prototype = { + call$2(key, value) { + var t2, _this = this, + t1 = _this.$this; + if (key instanceof A.SassString) + _this.values.$indexSet(0, key._string$_text, _this.convert.call$1(t1._withoutSlash$2(value, _this.expressionNode))); + else { + t2 = _this.nodeWithSpan; + throw A.wrapException(t1._evaluate$_exception$2(string$.Variab_ + key.toString$0(0) + " is not a string in " + _this.map.toString$0(0) + ".", t2.get$span(t2))); + } + }, + $signature: 85 + }; + A._EvaluateVisitor__verifyArguments_closure.prototype = { + call$0() { + return this.$arguments.verify$2(this.positional, new A.MapKeySet(this.named, type$.MapKeySet_String)); + }, + $signature: 0 + }; + A._EvaluateVisitor_visitCssAtRule_closure.prototype = { + call$0() { + var t1, t2, t3, t4; + for (t1 = this.node.children, t2 = t1.$ti, t1 = new A.ListIterator(t1, t1.get$length(0), t2._eval$1("ListIterator")), t3 = this.$this, t2 = t2._eval$1("ListBase.E"); t1.moveNext$0();) { + t4 = t1.__internal$_current; + (t4 == null ? t2._as(t4) : t4).accept$1(t3); + } + }, + $signature: 1 + }; + A._EvaluateVisitor_visitCssAtRule_closure0.prototype = { + call$1(node) { + return node instanceof A.ModifiableCssStyleRule; + }, + $signature: 7 + }; + A._EvaluateVisitor_visitCssKeyframeBlock_closure.prototype = { + call$0() { + var t1, t2, t3, t4; + for (t1 = this.node.children, t2 = t1.$ti, t1 = new A.ListIterator(t1, t1.get$length(0), t2._eval$1("ListIterator")), t3 = this.$this, t2 = t2._eval$1("ListBase.E"); t1.moveNext$0();) { + t4 = t1.__internal$_current; + (t4 == null ? t2._as(t4) : t4).accept$1(t3); + } + }, + $signature: 1 + }; + A._EvaluateVisitor_visitCssKeyframeBlock_closure0.prototype = { + call$1(node) { + return node instanceof A.ModifiableCssStyleRule; + }, + $signature: 7 + }; + A._EvaluateVisitor_visitCssMediaRule_closure.prototype = { + call$1(mediaQueries) { + return this.$this._mergeMediaQueries$2(mediaQueries, this.node.queries); + }, + $signature: 94 + }; + A._EvaluateVisitor_visitCssMediaRule_closure0.prototype = { + call$0() { + var _this = this, + t1 = _this.$this, + t2 = _this.mergedQueries; + if (t2 == null) + t2 = _this.node.queries; + t1._withMediaQueries$3(t2, _this.mergedSources, new A._EvaluateVisitor_visitCssMediaRule__closure(t1, _this.node)); + }, + $signature: 1 + }; + A._EvaluateVisitor_visitCssMediaRule__closure.prototype = { + call$0() { + var t2, t3, t4, + t1 = this.$this, + _0_0 = t1._atRootExcludingStyleRule ? null : t1._styleRuleIgnoringAtRoot; + if (_0_0 != null) + t1._withParent$2$3$scopeWhen(A.ModifiableCssStyleRule$(_0_0._style_rule$_selector, _0_0.span, _0_0.originalSelector), new A._EvaluateVisitor_visitCssMediaRule___closure(t1, this.node), false, type$.ModifiableCssStyleRule, type$.Null); + else + for (t2 = this.node.children, t3 = t2.$ti, t2 = new A.ListIterator(t2, t2.get$length(0), t3._eval$1("ListIterator")), t3 = t3._eval$1("ListBase.E"); t2.moveNext$0();) { + t4 = t2.__internal$_current; + (t4 == null ? t3._as(t4) : t4).accept$1(t1); + } + }, + $signature: 1 + }; + A._EvaluateVisitor_visitCssMediaRule___closure.prototype = { + call$0() { + var t1, t2, t3, t4; + for (t1 = this.node.children, t2 = t1.$ti, t1 = new A.ListIterator(t1, t1.get$length(0), t2._eval$1("ListIterator")), t3 = this.$this, t2 = t2._eval$1("ListBase.E"); t1.moveNext$0();) { + t4 = t1.__internal$_current; + (t4 == null ? t2._as(t4) : t4).accept$1(t3); + } + }, + $signature: 1 + }; + A._EvaluateVisitor_visitCssMediaRule_closure1.prototype = { + call$1(node) { + var t1; + if (!(node instanceof A.ModifiableCssStyleRule)) { + t1 = this.mergedSources; + t1 = t1.get$isNotEmpty(t1) && node instanceof A.ModifiableCssMediaRule && B.JSArray_methods.every$1(node.queries, t1.get$contains(t1)); + } else + t1 = true; + return t1; + }, + $signature: 7 + }; + A._EvaluateVisitor_visitCssStyleRule_closure.prototype = { + call$0() { + var t1 = this.$this; + t1._withStyleRule$2(this.rule, new A._EvaluateVisitor_visitCssStyleRule__closure(t1, this.node)); + }, + $signature: 1 + }; + A._EvaluateVisitor_visitCssStyleRule__closure.prototype = { + call$0() { + var t1, t2, t3, t4; + for (t1 = this.node.children, t2 = t1.$ti, t1 = new A.ListIterator(t1, t1.get$length(0), t2._eval$1("ListIterator")), t3 = this.$this, t2 = t2._eval$1("ListBase.E"); t1.moveNext$0();) { + t4 = t1.__internal$_current; + (t4 == null ? t2._as(t4) : t4).accept$1(t3); + } + }, + $signature: 1 + }; + A._EvaluateVisitor_visitCssStyleRule_closure0.prototype = { + call$1(node) { + return node instanceof A.ModifiableCssStyleRule; + }, + $signature: 7 + }; + A._EvaluateVisitor_visitCssSupportsRule_closure.prototype = { + call$0() { + var t2, t3, t4, + t1 = this.$this, + _0_0 = t1._atRootExcludingStyleRule ? null : t1._styleRuleIgnoringAtRoot; + if (_0_0 != null) + t1._withParent$2$2(A.ModifiableCssStyleRule$(_0_0._style_rule$_selector, _0_0.span, _0_0.originalSelector), new A._EvaluateVisitor_visitCssSupportsRule__closure(t1, this.node), type$.ModifiableCssStyleRule, type$.Null); + else + for (t2 = this.node.children, t3 = t2.$ti, t2 = new A.ListIterator(t2, t2.get$length(0), t3._eval$1("ListIterator")), t3 = t3._eval$1("ListBase.E"); t2.moveNext$0();) { + t4 = t2.__internal$_current; + (t4 == null ? t3._as(t4) : t4).accept$1(t1); + } + }, + $signature: 1 + }; + A._EvaluateVisitor_visitCssSupportsRule__closure.prototype = { + call$0() { + var t1, t2, t3, t4; + for (t1 = this.node.children, t2 = t1.$ti, t1 = new A.ListIterator(t1, t1.get$length(0), t2._eval$1("ListIterator")), t3 = this.$this, t2 = t2._eval$1("ListBase.E"); t1.moveNext$0();) { + t4 = t1.__internal$_current; + (t4 == null ? t2._as(t4) : t4).accept$1(t3); + } + }, + $signature: 1 + }; + A._EvaluateVisitor_visitCssSupportsRule_closure0.prototype = { + call$1(node) { + return node instanceof A.ModifiableCssStyleRule; + }, + $signature: 7 + }; + A._EvaluateVisitor__performInterpolationHelper_closure.prototype = { + call$1(targetLocations) { + return A.InterpolationMap$(this.interpolation, targetLocations); + }, + $signature: 249 + }; + A._EvaluateVisitor__serialize_closure.prototype = { + call$0() { + return A.serializeValue(this.value, false, this.quote); + }, + $signature: 27 + }; + A._EvaluateVisitor__expressionNode_closure.prototype = { + call$0() { + var t1 = this.expression; + return this.$this._environment.getVariableNode$2$namespace(t1.name, t1.namespace); + }, + $signature: 250 + }; + A._EvaluateVisitor__withoutSlash_recommendation.prototype = { + call$1(number) { + var t1, before, after, + _1_0 = number.asSlash; + $label0$0: { + if (type$.Record_2_nullable_Object_and_nullable_Object._is(_1_0)) { + t1 = type$.SassNumber; + before = t1._as(_1_0._0); + after = t1._as(_1_0._1); + t1 = "math.div(" + A.S(this.call$1(before)) + ", " + A.S(this.call$1(after)) + ")"; + break $label0$0; + } + t1 = A.serializeValue(number, true, true); + break $label0$0; + } + return t1; + }, + $signature: 251 + }; + A._EvaluateVisitor__stackFrame_closure.prototype = { + call$1(url) { + var t1 = this.$this._evaluate$_importCache; + t1 = t1 == null ? null : t1.humanize$1(url); + return t1 == null ? url : t1; + }, + $signature: 44 + }; + A._ImportedCssVisitor.prototype = { + visitCssAtRule$1(node) { + var t1 = node.isChildless ? null : new A._ImportedCssVisitor_visitCssAtRule_closure(); + this._visitor._addChild$2$through(node, t1); + }, + visitCssComment$1(node) { + return this._visitor._addChild$1(node); + }, + visitCssDeclaration$1(node) { + }, + visitCssImport$1(node) { + var t2, + _s13_ = "_endOfImports", + t1 = this._visitor; + if (t1._assertInModule$2(t1.__parent, "__parent") !== t1._assertInModule$2(t1.__root, "_root")) + t1._addChild$1(node); + else if (t1._assertInModule$2(t1.__endOfImports, _s13_) === J.get$length$asx(t1._assertInModule$2(t1.__root, "_root").children._collection$_source)) { + t1._addChild$1(node); + t1.__endOfImports = t1._assertInModule$2(t1.__endOfImports, _s13_) + 1; + } else { + t2 = t1._outOfOrderImports; + (t2 == null ? t1._outOfOrderImports = A._setArrayType([], type$.JSArray_ModifiableCssImport) : t2).push(node); + } + }, + visitCssKeyframeBlock$1(node) { + }, + visitCssMediaRule$1(node) { + var t1 = this._visitor, + mediaQueries = t1._mediaQueries; + t1._addChild$2$through(node, new A._ImportedCssVisitor_visitCssMediaRule_closure(mediaQueries == null || t1._mergeMediaQueries$2(mediaQueries, node.queries) != null)); + }, + visitCssStyleRule$1(node) { + return this._visitor._addChild$2$through(node, new A._ImportedCssVisitor_visitCssStyleRule_closure()); + }, + visitCssStylesheet$1(node) { + var t1, t2, t3; + for (t1 = node.children, t2 = t1.$ti, t1 = new A.ListIterator(t1, t1.get$length(0), t2._eval$1("ListIterator")), t2 = t2._eval$1("ListBase.E"); t1.moveNext$0();) { + t3 = t1.__internal$_current; + (t3 == null ? t2._as(t3) : t3).accept$1(this); + } + }, + visitCssSupportsRule$1(node) { + return this._visitor._addChild$2$through(node, new A._ImportedCssVisitor_visitCssSupportsRule_closure()); + } + }; + A._ImportedCssVisitor_visitCssAtRule_closure.prototype = { + call$1(node) { + return node instanceof A.ModifiableCssStyleRule; + }, + $signature: 7 + }; + A._ImportedCssVisitor_visitCssMediaRule_closure.prototype = { + call$1(node) { + var t1; + if (!(node instanceof A.ModifiableCssStyleRule)) + t1 = this.hasBeenMerged && node instanceof A.ModifiableCssMediaRule; + else + t1 = true; + return t1; + }, + $signature: 7 + }; + A._ImportedCssVisitor_visitCssStyleRule_closure.prototype = { + call$1(node) { + return node instanceof A.ModifiableCssStyleRule; + }, + $signature: 7 + }; + A._ImportedCssVisitor_visitCssSupportsRule_closure.prototype = { + call$1(node) { + return node instanceof A.ModifiableCssStyleRule; + }, + $signature: 7 + }; + A._EvaluationContext.prototype = { + get$currentCallableSpan() { + var _0_0 = this._visitor._callableNode; + if (_0_0 != null) + return _0_0.get$span(_0_0); + throw A.wrapException(A.StateError$(string$.No_Sasc)); + }, + warn$2(_, message, deprecation) { + var t1 = this._visitor, + t2 = t1._importSpan; + if (t2 == null) { + t2 = t1._callableNode; + t2 = t2 == null ? null : t2.get$span(t2); + } + if (t2 == null) { + t2 = this._defaultWarnNodeWithSpan; + t2 = t2.get$span(t2); + } + t1._warn$3(message, t2, deprecation); + }, + $isEvaluationContext: 1 + }; + A.EveryCssVisitor.prototype = { + visitCssAtRule$1(node) { + var t1 = node.children; + return t1.every$1(t1, new A.EveryCssVisitor_visitCssAtRule_closure(this)); + }, + visitCssComment$1(node) { + return false; + }, + visitCssDeclaration$1(node) { + return false; + }, + visitCssImport$1(node) { + return false; + }, + visitCssKeyframeBlock$1(node) { + var t1 = node.children; + return t1.every$1(t1, new A.EveryCssVisitor_visitCssKeyframeBlock_closure(this)); + }, + visitCssMediaRule$1(node) { + var t1 = node.children; + return t1.every$1(t1, new A.EveryCssVisitor_visitCssMediaRule_closure(this)); + }, + visitCssStyleRule$1(node) { + var t1 = node.children; + return t1.every$1(t1, new A.EveryCssVisitor_visitCssStyleRule_closure(this)); + }, + visitCssStylesheet$1(node) { + return J.every$1$ax(node.get$children(node), new A.EveryCssVisitor_visitCssStylesheet_closure(this)); + }, + visitCssSupportsRule$1(node) { + var t1 = node.children; + return t1.every$1(t1, new A.EveryCssVisitor_visitCssSupportsRule_closure(this)); + } + }; + A.EveryCssVisitor_visitCssAtRule_closure.prototype = { + call$1(child) { + return child.accept$1(this.$this); + }, + $signature: 7 + }; + A.EveryCssVisitor_visitCssKeyframeBlock_closure.prototype = { + call$1(child) { + return child.accept$1(this.$this); + }, + $signature: 7 + }; + A.EveryCssVisitor_visitCssMediaRule_closure.prototype = { + call$1(child) { + return child.accept$1(this.$this); + }, + $signature: 7 + }; + A.EveryCssVisitor_visitCssStyleRule_closure.prototype = { + call$1(child) { + return child.accept$1(this.$this); + }, + $signature: 7 + }; + A.EveryCssVisitor_visitCssStylesheet_closure.prototype = { + call$1(child) { + return child.accept$1(this.$this); + }, + $signature: 7 + }; + A.EveryCssVisitor_visitCssSupportsRule_closure.prototype = { + call$1(child) { + return child.accept$1(this.$this); + }, + $signature: 7 + }; + A._MakeExpressionCalculationSafe.prototype = { + visitBinaryOperationExpression$1(node) { + var t1, t2, t3; + if (node.operator === B.BinaryOperator_OTG) { + t1 = A._setArrayType([node], type$.JSArray_Expression); + t2 = node.get$span(0); + t3 = type$.Expression; + t2 = new A.FunctionExpression("math", "max", new A.ArgumentInvocation(A.List_List$unmodifiable(t1, t3), A.ConstantMap_ConstantMap$from(B.Map_empty6, type$.String, t3), null, null, t2), node.get$span(0)); + t1 = t2; + } else + t1 = this.super$ReplaceExpressionVisitor$visitBinaryOperationExpression(node); + return t1; + }, + visitInterpolatedFunctionExpression$1(node) { + return node; + }, + visitUnaryOperationExpression$1(node) { + var t1, + _0_0 = node.operator; + $label0$0: { + if (B.UnaryOperator_gg4 === _0_0) { + t1 = node.operand; + break $label0$0; + } + if (B.UnaryOperator_TLI === _0_0) { + t1 = new A.BinaryOperationExpression(B.BinaryOperator_qN2, new A.NumberExpression(-1, null, node.span), node.operand, false); + break $label0$0; + } + t1 = this.super$ReplaceExpressionVisitor$visitUnaryOperationExpression(node); + break $label0$0; + } + return t1; + } + }; + A.__MakeExpressionCalculationSafe_Object_ReplaceExpressionVisitor.prototype = {}; + A._FindDependenciesVisitor.prototype = { + visitEachRule$1(node) { + }, + visitForRule$1(node) { + }, + visitIfRule$1(node) { + }, + visitWhileRule$1(node) { + }, + visitUseRule$1(node) { + var t1 = node.url; + if (t1.get$scheme() !== "sass") + this._find_dependencies$_uses.add$1(0, t1); + else if (t1.toString$0(0) === "sass:meta") + this._metaNamespaces.add$1(0, node.namespace); + }, + visitForwardRule$1(node) { + var t1 = node.url; + if (t1.get$scheme() !== "sass") + this._find_dependencies$_forwards.add$1(0, t1); + }, + visitImportRule$1(node) { + var t1, t2, t3, _i, $import; + for (t1 = node.imports, t2 = t1.length, t3 = this._imports, _i = 0; _i < t2; ++_i) { + $import = t1[_i]; + if ($import instanceof A.DynamicImport) + t3.add$1(0, A.Uri_parse($import.urlString)); + } + }, + visitIncludeRule$1(node) { + var url, _0_0, _0_4, t1, _0_7, _0_7_isSet, _0_4_isSet, url0, exception, _null = null; + if (node.name !== "load-css") + return; + if (!this._metaNamespaces.contains$1(0, node.namespace)) + return; + url = null; + _0_0 = node.$arguments.positional; + if (_0_0.length === 1) { + _0_4 = _0_0[0]; + t1 = _0_4; + if (t1 instanceof A.StringExpression) { + type$.StringExpression._as(_0_4); + _0_7 = _0_4.text.get$asPlain(); + t1 = _0_7; + t1 = t1 != null; + _0_7_isSet = true; + } else { + _0_7 = _null; + _0_7_isSet = false; + t1 = false; + } + _0_4_isSet = true; + } else { + _0_7 = _null; + _0_4 = _0_7; + _0_4_isSet = false; + _0_7_isSet = false; + t1 = false; + } + if (t1) { + if (_0_7_isSet) + url0 = _0_7; + else { + t1 = _0_4_isSet ? _0_4 : _0_0[0]; + _0_7 = type$.StringExpression._as(t1).text.get$asPlain(); + url0 = _0_7; + } + url = url0 == null ? A._asString(url0) : url0; + try { + this._metaLoadCss.add$1(0, A.Uri_parse(url)); + } catch (exception) { + if (!type$.FormatException._is(A.unwrapException(exception))) + throw exception; + } + } + } + }; + A.DependencyReport.prototype = {}; + A.__FindDependenciesVisitor_Object_RecursiveStatementVisitor.prototype = {}; + A.RecursiveStatementVisitor.prototype = { + visitAtRootRule$1(node) { + this.visitChildren$1(node.children); + }, + visitAtRule$1(node) { + return A.NullableExtension_andThen(node.children, this.get$visitChildren()); + }, + visitContentBlock$1(node) { + return null; + }, + visitContentRule$1(node) { + }, + visitDebugRule$1(node) { + }, + visitDeclaration$1(node) { + return A.NullableExtension_andThen(node.children, this.get$visitChildren()); + }, + visitEachRule$1(node) { + return this.visitChildren$1(node.children); + }, + visitErrorRule$1(node) { + }, + visitExtendRule$1(node) { + }, + visitForRule$1(node) { + return this.visitChildren$1(node.children); + }, + visitForwardRule$1(node) { + }, + visitFunctionRule$1(node) { + return null; + }, + visitIfRule$1(node) { + var t1, t2, _i, t3, t4, _i0, _0_0; + for (t1 = node.clauses, t2 = t1.length, _i = 0; _i < t2; ++_i) + for (t3 = t1[_i].children, t4 = t3.length, _i0 = 0; _i0 < t4; ++_i0) + t3[_i0].accept$1(this); + _0_0 = node.lastClause; + if (_0_0 != null) + for (t1 = _0_0.children, t2 = t1.length, _i = 0; _i < t2; ++_i) + t1[_i].accept$1(this); + }, + visitImportRule$1(node) { + }, + visitIncludeRule$1(node) { + return A.NullableExtension_andThen(node.content, this.get$visitContentBlock()); + }, + visitLoudComment$1(node) { + }, + visitMediaRule$1(node) { + return this.visitChildren$1(node.children); + }, + visitMixinRule$1(node) { + return null; + }, + visitReturnRule$1(node) { + }, + visitSilentComment$1(node) { + }, + visitStyleRule$1(node) { + return this.visitChildren$1(node.children); + }, + visitStylesheet$1(node) { + return this.visitChildren$1(node.children); + }, + visitSupportsRule$1(node) { + return this.visitChildren$1(node.children); + }, + visitUseRule$1(node) { + }, + visitVariableDeclaration$1(node) { + }, + visitWarnRule$1(node) { + }, + visitWhileRule$1(node) { + return this.visitChildren$1(node.children); + }, + visitChildren$1(children) { + var t1; + for (t1 = J.get$iterator$ax(children); t1.moveNext$0();) + t1.get$current(t1).accept$1(this); + } + }; + A.ReplaceExpressionVisitor.prototype = { + visitBinaryOperationExpression$1(node) { + return new A.BinaryOperationExpression(node.operator, node.left.accept$1(this), node.right.accept$1(this), false); + }, + visitBooleanExpression$1(node) { + return node; + }, + visitColorExpression$1(node) { + return node; + }, + visitFunctionExpression$1(node) { + return new A.FunctionExpression(node.namespace, node.originalName, this.visitArgumentInvocation$1(node.$arguments), node.span); + }, + visitInterpolatedFunctionExpression$1(node) { + return new A.InterpolatedFunctionExpression(this.visitInterpolation$1(node.name), this.visitArgumentInvocation$1(node.$arguments), node.span); + }, + visitIfExpression$1(node) { + return new A.IfExpression(this.visitArgumentInvocation$1(node.$arguments), node.span); + }, + visitListExpression$1(node) { + var t1 = node.contents; + return new A.ListExpression(A.List_List$unmodifiable(new A.MappedListIterable(t1, new A.ReplaceExpressionVisitor_visitListExpression_closure(this), A._arrayInstanceType(t1)._eval$1("MappedListIterable<1,Expression>")), type$.Expression), node.separator, node.hasBrackets, node.span); + }, + visitMapExpression$1(node) { + var t2, t3, _i, t4, key, value, + t1 = A._setArrayType([], type$.JSArray_Record_2_Expression_and_Expression); + for (t2 = node.pairs, t3 = t2.length, _i = 0; _i < t3; ++_i) { + t4 = t2[_i]; + key = t4._0; + value = t4._1; + t1.push(new A._Record_2(key.accept$1(this), value.accept$1(this))); + } + return new A.MapExpression(A.List_List$unmodifiable(t1, type$.Record_2_Expression_and_Expression), node.span); + }, + visitNullExpression$1(node) { + return node; + }, + visitNumberExpression$1(node) { + return node; + }, + visitParenthesizedExpression$1(node) { + return new A.ParenthesizedExpression(node.expression.accept$1(this), node.span); + }, + visitSelectorExpression$1(node) { + return node; + }, + visitStringExpression$1(node) { + return new A.StringExpression(this.visitInterpolation$1(node.text), node.hasQuotes); + }, + visitSupportsExpression$1(node) { + return new A.SupportsExpression(this.visitSupportsCondition$1(node.condition)); + }, + visitUnaryOperationExpression$1(node) { + return new A.UnaryOperationExpression(node.operator, node.operand.accept$1(this), node.span); + }, + visitValueExpression$1(node) { + return node; + }, + visitVariableExpression$1(node) { + return node; + }, + visitArgumentInvocation$1(invocation) { + var t5, t6, _this = this, + t1 = invocation.positional, + t2 = type$.String, + t3 = type$.Expression, + t4 = A.LinkedHashMap_LinkedHashMap$_empty(t2, t3); + for (t5 = A.MapExtensions_get_pairs(invocation.named, t2, t3), t5 = t5.get$iterator(t5); t5.moveNext$0();) { + t6 = t5.get$current(t5); + t4.$indexSet(0, t6._0, t6._1.accept$1(_this)); + } + t5 = invocation.rest; + t5 = t5 == null ? null : t5.accept$1(_this); + t6 = invocation.keywordRest; + t6 = t6 == null ? null : t6.accept$1(_this); + return new A.ArgumentInvocation(A.List_List$unmodifiable(new A.MappedListIterable(t1, new A.ReplaceExpressionVisitor_visitArgumentInvocation_closure(_this), A._arrayInstanceType(t1)._eval$1("MappedListIterable<1,Expression>")), t3), A.ConstantMap_ConstantMap$from(t4, t2, t3), t5, t6, invocation.span); + }, + visitSupportsCondition$1(condition) { + var _this = this; + if (condition instanceof A.SupportsOperation) + return A.SupportsOperation$(_this.visitSupportsCondition$1(condition.left), _this.visitSupportsCondition$1(condition.right), condition.operator, condition.span); + else if (condition instanceof A.SupportsNegation) + return new A.SupportsNegation(_this.visitSupportsCondition$1(condition.condition), condition.span); + else if (condition instanceof A.SupportsInterpolation) + return new A.SupportsInterpolation(condition.expression.accept$1(_this), condition.span); + else if (condition instanceof A.SupportsDeclaration) + return new A.SupportsDeclaration(condition.name.accept$1(_this), condition.value.accept$1(_this), condition.span); + else + throw A.wrapException(A.SassException$("BUG: Unknown SupportsCondition " + condition.toString$0(0) + ".", condition.get$span(condition), null)); + }, + visitInterpolation$1(interpolation) { + var t1 = interpolation.contents; + return A.Interpolation$(new A.MappedListIterable(t1, new A.ReplaceExpressionVisitor_visitInterpolation_closure(this), A._arrayInstanceType(t1)._eval$1("MappedListIterable<1,Object>")), interpolation.span); + } + }; + A.ReplaceExpressionVisitor_visitListExpression_closure.prototype = { + call$1(item) { + return item.accept$1(this.$this); + }, + $signature: 217 + }; + A.ReplaceExpressionVisitor_visitArgumentInvocation_closure.prototype = { + call$1(expression) { + return expression.accept$1(this.$this); + }, + $signature: 217 + }; + A.ReplaceExpressionVisitor_visitInterpolation_closure.prototype = { + call$1(node) { + return type$.Expression._is(node) ? node.accept$1(this.$this) : node; + }, + $signature: 67 + }; + A.SelectorSearchVisitor.prototype = { + visitAttributeSelector$1(attribute) { + return null; + }, + visitClassSelector$1(klass) { + return null; + }, + visitIDSelector$1(id) { + return null; + }, + visitParentSelector$1(placeholder) { + return null; + }, + visitPlaceholderSelector$1(placeholder) { + return null; + }, + visitTypeSelector$1(type) { + return null; + }, + visitUniversalSelector$1(universal) { + return null; + }, + visitComplexSelector$1(complex) { + return A.IterableExtension_search(complex.components, new A.SelectorSearchVisitor_visitComplexSelector_closure(this)); + }, + visitCompoundSelector$1(compound) { + return A.IterableExtension_search(compound.components, new A.SelectorSearchVisitor_visitCompoundSelector_closure(this)); + }, + visitPseudoSelector$1(pseudo) { + return A.NullableExtension_andThen(pseudo.selector, this.get$visitSelectorList()); + }, + visitSelectorList$1(list) { + return A.IterableExtension_search(list.components, this.get$visitComplexSelector()); + } + }; + A.SelectorSearchVisitor_visitComplexSelector_closure.prototype = { + call$1(component) { + return this.$this.visitCompoundSelector$1(component.selector); + }, + $signature() { + return A._instanceType(this.$this)._eval$1("SelectorSearchVisitor.T?(ComplexSelectorComponent)"); + } + }; + A.SelectorSearchVisitor_visitCompoundSelector_closure.prototype = { + call$1(simple) { + return simple.accept$1(this.$this); + }, + $signature() { + return A._instanceType(this.$this)._eval$1("SelectorSearchVisitor.T?(SimpleSelector)"); + } + }; + A.serialize_closure.prototype = { + call$1(codeUnit) { + return codeUnit > 127; + }, + $signature: 46 + }; + A._SerializeVisitor.prototype = { + visitCssStylesheet$1(node) { + var t1, t2, t3, t4, t5, t6, previous, previous0, t7, _this = this; + for (t1 = J.get$iterator$ax(node.get$children(node)), t2 = !_this._inspect, t3 = _this._style === B.OutputStyle_1, t4 = !t3, t5 = type$.CssParentNode, t6 = _this._serialize$_buffer, previous = null; t1.moveNext$0();) { + previous0 = t1.get$current(t1); + if (t2) + t7 = t3 ? previous0.accept$1(B._IsInvisibleVisitor_true_true) : previous0.accept$1(B._IsInvisibleVisitor_true_false); + else + t7 = false; + if (t7) + continue; + if (previous != null) { + if (t5._is(previous) ? previous.get$isChildless() : !(previous instanceof A.ModifiableCssComment)) + t6.writeCharCode$1(59); + if (_this._isTrailingComment$2(previous0, previous)) { + if (t4) + t6.writeCharCode$1(32); + } else { + if (t4) + t6.write$1(0, "\n"); + if (previous.get$isGroupEnd()) + if (t4) + t6.write$1(0, "\n"); + } + } + previous0.accept$1(_this); + previous = previous0; + } + if (previous != null) + t1 = (t5._is(previous) ? previous.get$isChildless() : !(previous instanceof A.ModifiableCssComment)) && t4; + else + t1 = false; + if (t1) + t6.writeCharCode$1(59); + }, + visitCssComment$1(node) { + this._serialize$_buffer.forSpan$2(node.span, new A._SerializeVisitor_visitCssComment_closure(this, node)); + }, + visitCssAtRule$1(node) { + var t1, _this = this; + _this._writeIndentation$0(); + t1 = _this._serialize$_buffer; + t1.forSpan$2(node.span, new A._SerializeVisitor_visitCssAtRule_closure(_this, node)); + if (!node.isChildless) { + if (_this._style !== B.OutputStyle_1) + t1.writeCharCode$1(32); + _this._serialize$_visitChildren$1(node); + } + }, + visitCssMediaRule$1(node) { + var t1, _this = this; + _this._writeIndentation$0(); + t1 = _this._serialize$_buffer; + t1.forSpan$2(node.span, new A._SerializeVisitor_visitCssMediaRule_closure(_this, node)); + if (_this._style !== B.OutputStyle_1) + t1.writeCharCode$1(32); + _this._serialize$_visitChildren$1(node); + }, + visitCssImport$1(node) { + this._writeIndentation$0(); + this._serialize$_buffer.forSpan$2(node.span, new A._SerializeVisitor_visitCssImport_closure(this, node)); + }, + _writeImportUrl$1(url) { + var urlContents, maybeQuote, _this = this; + if (_this._style !== B.OutputStyle_1 || url.charCodeAt(0) !== 117) { + _this._serialize$_buffer.write$1(0, url); + return; + } + urlContents = B.JSString_methods.substring$2(url, 4, url.length - 1); + maybeQuote = urlContents.charCodeAt(0); + if (maybeQuote === 39 || maybeQuote === 34) + _this._serialize$_buffer.write$1(0, urlContents); + else + _this._visitQuotedString$1(urlContents); + }, + visitCssKeyframeBlock$1(node) { + var t1, _this = this; + _this._writeIndentation$0(); + t1 = _this._serialize$_buffer; + t1.forSpan$2(node.selector.span, new A._SerializeVisitor_visitCssKeyframeBlock_closure(_this, node)); + if (_this._style !== B.OutputStyle_1) + t1.writeCharCode$1(32); + _this._serialize$_visitChildren$1(node); + }, + _visitMediaQuery$1(query) { + var t1, _1_0, _2_0, condition, operator, t2, _this = this, + _0_0 = query.modifier; + if (_0_0 != null) { + t1 = _this._serialize$_buffer; + t1.write$1(0, _0_0); + t1.writeCharCode$1(32); + } + _1_0 = query.type; + if (_1_0 != null) { + t1 = _this._serialize$_buffer; + t1.write$1(0, _1_0); + if (query.conditions.length !== 0) + t1.write$1(0, " and "); + } + _2_0 = query.conditions; + if (_2_0.length === 1) + t1 = B.JSString_methods.startsWith$1(_2_0[0], "(not "); + else + t1 = false; + if (t1) { + t1 = _this._serialize$_buffer; + t1.write$1(0, "not "); + condition = B.JSArray_methods.get$first(_2_0); + t1.write$1(0, B.JSString_methods.substring$2(condition, 5, condition.length - 1)); + } else { + operator = query.conjunction ? "and" : "or"; + t1 = _this._style === B.OutputStyle_1 ? operator + " " : " " + operator + " "; + t2 = _this._serialize$_buffer; + _this._writeBetween$3(_2_0, t1, t2.get$write(t2)); + } + }, + visitCssStyleRule$1(node) { + var t1, _this = this; + _this._writeIndentation$0(); + t1 = _this._serialize$_buffer; + t1.forSpan$2(node._style_rule$_selector._box$_inner.value.span, new A._SerializeVisitor_visitCssStyleRule_closure(_this, node)); + if (_this._style !== B.OutputStyle_1) + t1.writeCharCode$1(32); + _this._serialize$_visitChildren$1(node); + }, + visitCssSupportsRule$1(node) { + var t1, _this = this; + _this._writeIndentation$0(); + t1 = _this._serialize$_buffer; + t1.forSpan$2(node.span, new A._SerializeVisitor_visitCssSupportsRule_closure(_this, node)); + if (_this._style !== B.OutputStyle_1) + t1.writeCharCode$1(32); + _this._serialize$_visitChildren$1(node); + }, + visitCssDeclaration$1(node) { + var error, stackTrace, error0, stackTrace0, t1, t2, exception, _this = this; + _this._writeIndentation$0(); + t1 = node.name; + _this._serialize$_write$1(t1); + t2 = _this._serialize$_buffer; + t2.writeCharCode$1(58); + if (J.startsWith$1$s(t1.value, "--") && node.parsedAsCustomProperty) + t2.forSpan$2(node.value.span, new A._SerializeVisitor_visitCssDeclaration_closure(_this, node)); + else { + if (_this._style !== B.OutputStyle_1) + t2.writeCharCode$1(32); + try { + t2.forSpan$2(node.valueSpanForMap, new A._SerializeVisitor_visitCssDeclaration_closure0(_this, node)); + } catch (exception) { + t1 = A.unwrapException(exception); + if (t1 instanceof A.MultiSpanSassScriptException) { + error = t1; + stackTrace = A.getTraceFromException(exception); + A.throwWithTrace(A.MultiSpanSassException$(error.message, node.value.span, error.primaryLabel, error.secondarySpans, null), error, stackTrace); + } else if (t1 instanceof A.SassScriptException) { + error0 = t1; + stackTrace0 = A.getTraceFromException(exception); + t1 = error0.message; + A.throwWithTrace(new A.SassException(B.Set_empty, t1, node.value.span), error0, stackTrace0); + } else + throw exception; + } + } + }, + _writeFoldedValue$1(node) { + var t1, t2, next, t3, + scanner = A.StringScanner$(type$.SassString._as(node.value.value)._string$_text, null, null); + for (t1 = scanner.string.length, t2 = this._serialize$_buffer; scanner._string_scanner$_position !== t1;) { + next = scanner.readChar$0(); + if (next !== 10) { + t2.writeCharCode$1(next); + continue; + } + t2.writeCharCode$1(32); + while (true) { + t3 = scanner.peekChar$0(); + if (!(t3 === 32 || t3 === 9 || t3 === 10 || t3 === 13 || t3 === 12)) + break; + scanner.readChar$0(); + } + } + }, + _writeReindentedValue$1(node) { + var _0_0, t1, _this = this, + value = type$.SassString._as(node.value.value)._string$_text; + $label0$0: { + _0_0 = _this._minimumIndentation$1(value); + if (_0_0 == null) { + _this._serialize$_buffer.write$1(0, value); + break $label0$0; + } + if (-1 === _0_0) { + t1 = _this._serialize$_buffer; + t1.write$1(0, A.trimAsciiRight(value, true)); + t1.writeCharCode$1(32); + break $label0$0; + } + t1 = node.name.span; + t1 = t1.get$start(t1); + _this._writeWithIndent$2(value, Math.min(_0_0, t1.file.getColumn$1(t1.offset))); + } + }, + _minimumIndentation$1(text) { + var character, t2, min, next, min0, + scanner = A.LineScanner$(text), + t1 = scanner.string.length; + while (true) { + if (scanner._string_scanner$_position !== t1) { + character = scanner.super$StringScanner$readChar(); + scanner._adjustLineAndColumn$1(character); + t2 = character !== 10; + } else + t2 = false; + if (!t2) + break; + } + if (scanner._string_scanner$_position === t1) + return scanner.peekChar$1(-1) === 10 ? -1 : null; + for (min = null; scanner._string_scanner$_position !== t1;) { + for (; scanner._string_scanner$_position !== t1;) { + next = scanner.peekChar$0(); + if (next !== 32 && next !== 9) + break; + scanner._adjustLineAndColumn$1(scanner.super$StringScanner$readChar()); + } + if (scanner._string_scanner$_position === t1 || scanner.scanChar$1(10)) + continue; + min0 = scanner._line_scanner$_column; + min = min == null ? min0 : Math.min(min, min0); + while (true) { + if (scanner._string_scanner$_position !== t1) { + character = scanner.super$StringScanner$readChar(); + scanner._adjustLineAndColumn$1(character); + t2 = character !== 10; + } else + t2 = false; + if (!t2) + break; + } + } + return min == null ? -1 : min; + }, + _writeWithIndent$2(text, minimumIndentation) { + var t1, t2, t3, character, lineStart, newlines, end, + scanner = A.LineScanner$(text); + for (t1 = scanner.string, t2 = t1.length, t3 = this._serialize$_buffer; scanner._string_scanner$_position !== t2;) { + character = scanner.super$StringScanner$readChar(); + scanner._adjustLineAndColumn$1(character); + if (character === 10) + break; + t3.writeCharCode$1(character); + } + for (; true;) { + lineStart = scanner._string_scanner$_position; + for (newlines = 1; true;) { + if (scanner._string_scanner$_position === t2) { + t3.writeCharCode$1(32); + return; + } + $label0$2: { + character = scanner.super$StringScanner$readChar(); + scanner._adjustLineAndColumn$1(character); + if (32 === character || 9 === character) + continue; + if (10 === character) { + lineStart = scanner._string_scanner$_position; + ++newlines; + break $label0$2; + } + break; + } + } + this._writeTimes$2(10, newlines); + this._writeIndentation$0(); + end = scanner._string_scanner$_position; + t3.write$1(0, B.JSString_methods.substring$2(t1, lineStart + minimumIndentation, end)); + for (; true;) { + if (scanner._string_scanner$_position === t2) + return; + character = scanner.super$StringScanner$readChar(); + scanner._adjustLineAndColumn$1(character); + if (character === 10) + break; + t3.writeCharCode$1(character); + } + } + }, + visitCalculation$1(value) { + var t2, _this = this, + t1 = _this._serialize$_buffer; + t1.write$1(0, value.name); + t1.writeCharCode$1(40); + t2 = _this._style === B.OutputStyle_1 ? "," : ", "; + _this._writeBetween$3(value.$arguments, t2, _this.get$_writeCalculationValue()); + t1.writeCharCode$1(41); + }, + _writeCalculationValue$1(value) { + var t1, _2_4, t2, _2_4_isSet, _0_0, _1_0, first, rest, operator, left, right, parenthesizeLeft, operatorWhitespace, parenthesizeRight, _this = this, _null = null; + $label1$1: { + t1 = value instanceof A.SassNumber; + if (t1) { + _2_4 = value.get$hasComplexUnits(); + t2 = _2_4 && !_this._inspect; + _2_4_isSet = true; + } else { + _2_4 = _null; + _2_4_isSet = false; + t2 = false; + } + if (t2) + throw A.wrapException(A.SassScriptException$(A.S(value) + " isn't a valid CSS value.", _null)); + if (t1 && !isFinite(value._number$_value)) { + $label0$0: { + _0_0 = value._number$_value; + if (1 / 0 === _0_0) { + _this._serialize$_buffer.write$1(0, "infinity"); + break $label0$0; + } + if (-1 / 0 === _0_0) { + _this._serialize$_buffer.write$1(0, "-infinity"); + break $label0$0; + } + if (isNaN(_0_0)) + _this._serialize$_buffer.write$1(0, "NaN"); + } + t1 = J.getInterceptor$x(value); + _this._writeCalculationUnits$2(t1.get$numeratorUnits(value), t1.get$denominatorUnits(value)); + break $label1$1; + } + if (t1) + t1 = _2_4_isSet ? _2_4 : value.get$hasComplexUnits(); + else + t1 = false; + if (t1) { + _this._writeNumber$1(value._number$_value); + t1 = J.getInterceptor$x(value); + _1_0 = t1.get$numeratorUnits(value); + if (_1_0.length >= 1) { + first = _1_0[0]; + rest = B.JSArray_methods.sublist$1(_1_0, 1); + _this._serialize$_buffer.write$1(0, first); + _this._writeCalculationUnits$2(rest, t1.get$denominatorUnits(value)); + } else + _this._writeCalculationUnits$2(A._setArrayType([], type$.JSArray_String), t1.get$denominatorUnits(value)); + break $label1$1; + } + if (value instanceof A.Value) { + value.accept$1(_this); + break $label1$1; + } + if (value instanceof A.CalculationOperation) { + operator = value._operator; + left = value._left; + right = value._right; + right = right; + t1 = true; + } else { + right = _null; + left = right; + operator = left; + t1 = false; + } + if (t1) { + parenthesizeLeft = left instanceof A.CalculationOperation && left._operator.precedence < operator.precedence; + if (parenthesizeLeft) + _this._serialize$_buffer.writeCharCode$1(40); + _this._writeCalculationValue$1(left); + if (parenthesizeLeft) + _this._serialize$_buffer.writeCharCode$1(41); + operatorWhitespace = _this._style !== B.OutputStyle_1 || operator.precedence === 1; + if (operatorWhitespace) + _this._serialize$_buffer.writeCharCode$1(32); + t1 = _this._serialize$_buffer; + t1.write$1(0, operator.operator); + if (operatorWhitespace) + t1.writeCharCode$1(32); + if (!(right instanceof A.CalculationOperation && _this._parenthesizeCalculationRhs$2(operator, right._operator))) + if (operator === B.CalculationOperator_OvN) { + if (right instanceof A.SassNumber) + t2 = isFinite(right._number$_value) ? right.get$hasComplexUnits() : right.get$hasUnits(); + else + t2 = false; + parenthesizeRight = t2; + } else + parenthesizeRight = false; + else + parenthesizeRight = true; + if (parenthesizeRight) + t1.writeCharCode$1(40); + _this._writeCalculationValue$1(right); + if (parenthesizeRight) + t1.writeCharCode$1(41); + } + } + }, + _writeCalculationUnits$2(numeratorUnits, denominatorUnits) { + var t1, t2, t3, t4; + for (t1 = J.get$iterator$ax(numeratorUnits), t2 = this._serialize$_buffer, t3 = this._style !== B.OutputStyle_1; t1.moveNext$0();) { + t4 = t1.get$current(t1); + if (t3) + t2.writeCharCode$1(32); + t2.writeCharCode$1(42); + if (t3) + t2.writeCharCode$1(32); + t2.writeCharCode$1(49); + t2.write$1(0, t4); + } + for (t1 = J.get$iterator$ax(denominatorUnits); t1.moveNext$0();) { + t4 = t1.get$current(t1); + if (t3) + t2.writeCharCode$1(32); + t2.writeCharCode$1(47); + if (t3) + t2.writeCharCode$1(32); + t2.writeCharCode$1(49); + t2.write$1(0, t4); + } + }, + _parenthesizeCalculationRhs$2(outer, right) { + var t1; + $label0$0: { + if (B.CalculationOperator_OvN === outer) { + t1 = true; + break $label0$0; + } + if (B.CalculationOperator_IyK === outer) { + t1 = false; + break $label0$0; + } + t1 = right === B.CalculationOperator_IyK || right === B.CalculationOperator_2bx; + break $label0$0; + } + return t1; + }, + visitColor$1(value) { + var hexLength, _0_0, t1, $name, _1_0, opaque, t2, _3_0, _this = this; + if (_this._style === B.OutputStyle_1) + if (!A.fuzzyEquals(value._alpha, 1)) + _this._writeRgb$1(value); + else { + hexLength = _this._canUseShortHex$1(value) ? 4 : 7; + _0_0 = $.$get$namesByColor().$index(0, value); + if (_0_0 != null) { + t1 = _0_0.length <= hexLength; + $name = _0_0; + } else { + $name = null; + t1 = false; + } + if (t1) + _this._serialize$_buffer.write$1(0, $name); + else { + t1 = _this._serialize$_buffer; + if (_this._canUseShortHex$1(value)) { + t1.writeCharCode$1(35); + t1.writeCharCode$1(A.hexCharFor(value.get$red(0) & 15)); + t1.writeCharCode$1(A.hexCharFor(value.get$green(0) & 15)); + t1.writeCharCode$1(A.hexCharFor(value.get$blue(0) & 15)); + } else { + t1.writeCharCode$1(35); + _this._writeHexComponent$1(value.get$red(0)); + _this._writeHexComponent$1(value.get$green(0)); + _this._writeHexComponent$1(value.get$blue(0)); + } + } + } + else { + _1_0 = value.format; + if (_1_0 != null) + $label0$0: { + if (B._ColorFormatEnum_rgbFunction === _1_0) { + _this._writeRgb$1(value); + break $label0$0; + } + if (B._ColorFormatEnum_hslFunction === _1_0) { + t1 = value._alpha; + opaque = A.fuzzyEquals(t1, 1); + t2 = _this._serialize$_buffer; + t2.write$1(0, opaque ? "hsl(" : "hsla("); + _this._writeNumber$1(value.get$hue(0)); + t2.write$1(0, ", "); + _this._writeNumber$1(value.get$saturation(0)); + t2.writeCharCode$1(37); + t2.write$1(0, ", "); + _this._writeNumber$1(value.get$lightness(0)); + t2.writeCharCode$1(37); + if (!opaque) { + t2.write$1(0, ", "); + _this._writeNumber$1(t1); + } + t2.writeCharCode$1(41); + break $label0$0; + } + if (_1_0 instanceof A.SpanColorFormat) { + _this._serialize$_buffer.write$1(0, _1_0._color$_span.get$text()); + break $label0$0; + } + } + else { + _3_0 = $.$get$namesByColor().$index(0, value); + if (_3_0 != null) { + t1 = !A.fuzzyEquals(value._alpha, 0); + $name = _3_0; + } else { + $name = null; + t1 = false; + } + if (t1) + _this._serialize$_buffer.write$1(0, $name); + else if (A.fuzzyEquals(value._alpha, 1)) { + _this._serialize$_buffer.writeCharCode$1(35); + _this._writeHexComponent$1(value.get$red(0)); + _this._writeHexComponent$1(value.get$green(0)); + _this._writeHexComponent$1(value.get$blue(0)); + } else + _this._writeRgb$1(value); + } + } + }, + _writeRgb$1(value) { + var t3, + t1 = value._alpha, + opaque = A.fuzzyEquals(t1, 1), + t2 = this._serialize$_buffer; + t2.write$1(0, opaque ? "rgb(" : "rgba("); + t2.write$1(0, value.get$red(0)); + t3 = this._style === B.OutputStyle_1; + t2.write$1(0, t3 ? "," : ", "); + t2.write$1(0, value.get$green(0)); + t2.write$1(0, t3 ? "," : ", "); + t2.write$1(0, value.get$blue(0)); + if (!opaque) { + t2.write$1(0, t3 ? "," : ", "); + this._writeNumber$1(t1); + } + t2.writeCharCode$1(41); + }, + _canUseShortHex$1(color) { + var t1 = color.get$red(0); + if ((t1 & 15) === B.JSInt_methods._shrOtherPositive$1(t1, 4)) { + t1 = color.get$green(0); + if ((t1 & 15) === B.JSInt_methods._shrOtherPositive$1(t1, 4)) { + t1 = color.get$blue(0); + t1 = (t1 & 15) === B.JSInt_methods._shrOtherPositive$1(t1, 4); + } else + t1 = false; + } else + t1 = false; + return t1; + }, + _writeHexComponent$1(color) { + var t1 = this._serialize$_buffer; + t1.writeCharCode$1(A.hexCharFor(B.JSInt_methods._shrOtherPositive$1(color, 4))); + t1.writeCharCode$1(A.hexCharFor(color & 15)); + }, + visitList$1(value) { + var t2, t3, singleton, t4, t5, _this = this, + t1 = value._hasBrackets; + if (t1) + _this._serialize$_buffer.writeCharCode$1(91); + else if (value._list$_contents.length === 0) { + if (!_this._inspect) + throw A.wrapException(A.SassScriptException$("() isn't a valid CSS value.", null)); + _this._serialize$_buffer.write$1(0, "()"); + return; + } + t2 = _this._inspect; + if (t2) + if (value._list$_contents.length === 1) { + t3 = value._separator; + t3 = t3 === B.ListSeparator_rXA || t3 === B.ListSeparator_zg9; + singleton = t3; + } else + singleton = false; + else + singleton = false; + if (singleton && !t1) + _this._serialize$_buffer.writeCharCode$1(40); + t3 = value._list$_contents; + t3 = t2 ? t3 : new A.WhereIterable(t3, new A._SerializeVisitor_visitList_closure(), A._arrayInstanceType(t3)._eval$1("WhereIterable<1>")); + t4 = value._separator; + t5 = _this._separatorString$1(t4); + _this._writeBetween$3(t3, t5, t2 ? new A._SerializeVisitor_visitList_closure0(_this, value) : new A._SerializeVisitor_visitList_closure1(_this)); + if (singleton) { + t2 = _this._serialize$_buffer; + t2.write$1(0, t4.separator); + if (!t1) + t2.writeCharCode$1(41); + } + if (t1) + _this._serialize$_buffer.writeCharCode$1(93); + }, + _separatorString$1(separator) { + var t1; + $label0$0: { + if (B.ListSeparator_rXA === separator) { + t1 = this._style === B.OutputStyle_1 ? "," : ", "; + break $label0$0; + } + if (B.ListSeparator_zg9 === separator) { + t1 = this._style === B.OutputStyle_1 ? "/" : " / "; + break $label0$0; + } + if (B.ListSeparator_EVt === separator) { + t1 = " "; + break $label0$0; + } + t1 = ""; + break $label0$0; + } + return t1; + }, + _elementNeedsParens$2(separator, value) { + var t1; + $label1$1: { + if (value instanceof A.SassList && value._list$_contents.length > 1 && !value._hasBrackets) { + $label0$0: { + if (B.ListSeparator_rXA === separator) { + t1 = value._separator === B.ListSeparator_rXA; + break $label0$0; + } + if (B.ListSeparator_zg9 === separator) { + t1 = value._separator; + t1 = t1 === B.ListSeparator_rXA || t1 === B.ListSeparator_zg9; + break $label0$0; + } + t1 = value._separator !== B.ListSeparator_undecided_null_undecided; + break $label0$0; + } + break $label1$1; + } + t1 = false; + break $label1$1; + } + return t1; + }, + visitMap$1(map) { + var t1, t2, _this = this; + if (!_this._inspect) + throw A.wrapException(A.SassScriptException$(map.toString$0(0) + " isn't a valid CSS value.", null)); + t1 = _this._serialize$_buffer; + t1.writeCharCode$1(40); + t2 = map._map$_contents; + _this._writeBetween$3(t2.get$entries(t2), ", ", new A._SerializeVisitor_visitMap_closure(_this)); + t1.writeCharCode$1(41); + }, + _writeMapElement$1(value) { + var needsParens = value instanceof A.SassList && value._separator === B.ListSeparator_rXA && !value._hasBrackets; + if (needsParens) + this._serialize$_buffer.writeCharCode$1(40); + value.accept$1(this); + if (needsParens) + this._serialize$_buffer.writeCharCode$1(41); + }, + visitNumber$1(value) { + var before, after, t1, _1_0, _this = this, + _0_0 = value.asSlash; + if (type$.Record_2_nullable_Object_and_nullable_Object._is(_0_0)) { + before = _0_0._0; + after = _0_0._1; + _this.visitNumber$1(before); + _this._serialize$_buffer.writeCharCode$1(47); + _this.visitNumber$1(after); + return; + } + t1 = value._number$_value; + if (!isFinite(t1)) { + _this.visitCalculation$1(new A.SassCalculation("calc", A.List_List$unmodifiable(A._setArrayType([value], type$.JSArray_Object), type$.Object))); + return; + } + if (value.get$hasComplexUnits()) { + if (!_this._inspect) + throw A.wrapException(A.SassScriptException$(value.toString$0(0) + " isn't a valid CSS value.", null)); + _this.visitCalculation$1(new A.SassCalculation("calc", A.List_List$unmodifiable(A._setArrayType([value], type$.JSArray_Object), type$.Object))); + } else { + _this._writeNumber$1(t1); + _1_0 = value.get$numeratorUnits(value); + if (_1_0.length === 1) + _this._serialize$_buffer.write$1(0, _1_0[0]); + } + }, + _writeNumber$1(number) { + var text, _this = this, + _0_0 = A.fuzzyAsInt(number); + if (_0_0 != null) { + _this._serialize$_buffer.write$1(0, _this._removeExponent$1(B.JSInt_methods.toString$0(_0_0))); + return; + } + text = _this._removeExponent$1(B.JSNumber_methods.toString$0(number)); + if (text.length < 12) { + if (_this._style === B.OutputStyle_1 && text.charCodeAt(0) === 48) + text = B.JSString_methods.substring$1(text, 1); + _this._serialize$_buffer.write$1(0, text); + return; + } + _this._writeRounded$1(text); + }, + _removeExponent$1(text) { + var buffer, t2, t3, additionalZeroes, + negative = text.charCodeAt(0) === 45, + exponent = A._Cell$(), + t1 = text.length, + i = 0; + while (true) { + if (!(i < t1)) { + buffer = null; + break; + } + c$0: { + if (text.charCodeAt(i) !== 101) + break c$0; + buffer = new A.StringBuffer(""); + t2 = buffer._contents = "" + A.Primitives_stringFromCharCode(text.charCodeAt(0)); + if (negative) { + t2 += A.Primitives_stringFromCharCode(text.charCodeAt(1)); + buffer._contents = t2; + if (i > 3) + buffer._contents = t2 + B.JSString_methods.substring$2(text, 3, i); + } else if (i > 2) + buffer._contents = t2 + B.JSString_methods.substring$2(text, 2, i); + exponent._value = A.int_parse(B.JSString_methods.substring$2(text, i + 1, t1), null); + break; + } + ++i; + } + if (buffer == null) + return text; + if (exponent._readLocal$0() > 0) { + t1 = exponent._readLocal$0(); + t2 = buffer._contents; + t3 = negative ? 1 : 0; + additionalZeroes = t1 - (t2.length - 1 - t3); + for (t1 = t2, i = 0; i < additionalZeroes; ++i) + t1 = buffer._contents += A.Primitives_stringFromCharCode(48); + return t1.charCodeAt(0) == 0 ? t1 : t1; + } else { + negative = text.charCodeAt(0) === 45; + t1 = (negative ? "" + A.Primitives_stringFromCharCode(45) : "") + "0."; + t2 = exponent.__late_helper$_name; + i = -1; + while (true) { + t3 = exponent._value; + if (t3 === exponent) + A.throwExpression(A.LateError$localNI(t2)); + if (!(i > t3)) + break; + t1 += A.Primitives_stringFromCharCode(48); + --i; + } + if (negative) { + t2 = buffer._contents; + t2 = B.JSString_methods.substring$1(t2.charCodeAt(0) == 0 ? t2 : t2, 1); + } else + t2 = buffer; + t2 = t1 + A.S(t2); + return t2.charCodeAt(0) == 0 ? t2 : t2; + } + }, + _writeRounded$1(text) { + var t1, digits, negative, textIndex, digitsIndex, textIndex0, codeUnit, digitsIndex0, indexAfterPrecision, digitsIndex1, newDigit, writtenIndex, t2, _this = this; + if (B.JSString_methods.endsWith$1(text, ".0")) { + _this._serialize$_buffer.write$1(0, B.JSString_methods.substring$2(text, 0, text.length - 2)); + return; + } + t1 = text.length; + digits = new Uint8Array(t1 + 1); + negative = text.charCodeAt(0) === 45; + textIndex = negative ? 1 : 0; + for (digitsIndex = 1; true; textIndex = textIndex0, digitsIndex = digitsIndex0) { + if (textIndex === t1) { + _this._serialize$_buffer.write$1(0, text); + return; + } + textIndex0 = textIndex + 1; + codeUnit = text.charCodeAt(textIndex); + if (codeUnit === 46) { + textIndex = textIndex0; + break; + } + digitsIndex0 = digitsIndex + 1; + digits[digitsIndex] = codeUnit - 48; + } + indexAfterPrecision = textIndex + 10; + if (indexAfterPrecision >= t1) { + _this._serialize$_buffer.write$1(0, text); + return; + } + for (digitsIndex0 = digitsIndex; textIndex < indexAfterPrecision; textIndex = textIndex0, digitsIndex0 = digitsIndex1) { + digitsIndex1 = digitsIndex0 + 1; + textIndex0 = textIndex + 1; + digits[digitsIndex0] = text.charCodeAt(textIndex) - 48; + } + if (text.charCodeAt(textIndex) - 48 >= 5) + for (; true; digitsIndex0 = digitsIndex1) { + digitsIndex1 = digitsIndex0 - 1; + newDigit = digits[digitsIndex1] + 1; + digits[digitsIndex1] = newDigit; + if (newDigit !== 10) + break; + } + for (; digitsIndex0 < digitsIndex; ++digitsIndex0) + digits[digitsIndex0] = 0; + while (true) { + t1 = digitsIndex0 > digitsIndex; + if (!(t1 && digits[digitsIndex0 - 1] === 0)) + break; + --digitsIndex0; + } + if (digitsIndex0 === 2 && digits[0] === 0 && digits[1] === 0) { + _this._serialize$_buffer.writeCharCode$1(48); + return; + } + if (negative) + _this._serialize$_buffer.writeCharCode$1(45); + if (digits[0] === 0) + writtenIndex = _this._style === B.OutputStyle_1 && digits[1] === 0 ? 2 : 1; + else + writtenIndex = 0; + for (t2 = _this._serialize$_buffer; writtenIndex < digitsIndex; ++writtenIndex) + t2.writeCharCode$1(48 + digits[writtenIndex]); + if (t1) { + t2.writeCharCode$1(46); + for (; writtenIndex < digitsIndex0; ++writtenIndex) + t2.writeCharCode$1(48 + digits[writtenIndex]); + } + }, + _visitQuotedString$2$forceDoubleQuote(string, forceDoubleQuote) { + var t1, includesSingleQuote, includesDoubleQuote, i, char, _1_2, _1_4, _0_0, quote, _this = this, + buffer = forceDoubleQuote ? _this._serialize$_buffer : new A.StringBuffer(""); + if (forceDoubleQuote) + buffer.writeCharCode$1(34); + for (t1 = string.length, includesSingleQuote = false, includesDoubleQuote = false, i = 0; i < t1; ++i) { + char = string.charCodeAt(i); + _1_2 = 39 === char; + if (_1_2 && forceDoubleQuote) { + buffer.writeCharCode$1(39); + continue; + } + if (_1_2 && includesDoubleQuote) { + _this._visitQuotedString$2$forceDoubleQuote(string, true); + return; + } + if (_1_2) { + buffer.writeCharCode$1(39); + includesSingleQuote = true; + continue; + } + _1_4 = 34 === char; + if (_1_4 && forceDoubleQuote) { + buffer.writeCharCode$1(92); + buffer.writeCharCode$1(34); + continue; + } + if (_1_4 && includesSingleQuote) { + _this._visitQuotedString$2$forceDoubleQuote(string, true); + return; + } + if (_1_4) { + buffer.writeCharCode$1(34); + includesDoubleQuote = true; + continue; + } + if (0 === char || 1 === char || 2 === char || 3 === char || 4 === char || 5 === char || 6 === char || 7 === char || 8 === char || 10 === char || 11 === char || 12 === char || 13 === char || 14 === char || 15 === char || 16 === char || 17 === char || 18 === char || 19 === char || 20 === char || 21 === char || 22 === char || 23 === char || 24 === char || 25 === char || 26 === char || 27 === char || 28 === char || 29 === char || 30 === char || 31 === char || 127 === char) { + _this._writeEscape$4(buffer, char, string, i); + continue; + } + if (92 === char) { + buffer.writeCharCode$1(92); + buffer.writeCharCode$1(92); + continue; + } + _0_0 = _this._tryPrivateUseCharacter$4(buffer, char, string, i); + if (_0_0 != null) + i = _0_0; + else + buffer.writeCharCode$1(char); + } + if (forceDoubleQuote) + buffer.writeCharCode$1(34); + else { + quote = includesDoubleQuote ? 39 : 34; + t1 = _this._serialize$_buffer; + t1.writeCharCode$1(quote); + t1.write$1(0, buffer); + t1.writeCharCode$1(quote); + } + }, + _visitQuotedString$1(string) { + return this._visitQuotedString$2$forceDoubleQuote(string, false); + }, + _visitUnquotedString$1(string) { + var t1, t2, afterNewline, i, _1_0, _0_0; + for (t1 = string.length, t2 = this._serialize$_buffer, afterNewline = false, i = 0; i < t1; ++i) { + _1_0 = string.charCodeAt(i); + if (10 === _1_0) { + t2.writeCharCode$1(32); + afterNewline = true; + continue; + } + if (32 === _1_0) { + if (!afterNewline) + t2.writeCharCode$1(32); + continue; + } + _0_0 = this._tryPrivateUseCharacter$4(t2, _1_0, string, i); + if (_0_0 != null) + i = _0_0; + else + t2.writeCharCode$1(_1_0); + afterNewline = false; + } + }, + _tryPrivateUseCharacter$4(buffer, codeUnit, string, i) { + var t1; + if (this._style === B.OutputStyle_1) + return null; + if (codeUnit >= 57344 && codeUnit <= 63743) { + this._writeEscape$4(buffer, codeUnit, string, i); + return i; + } + if (codeUnit >>> 7 === 439 && string.length > i + 1) { + t1 = i + 1; + this._writeEscape$4(buffer, 65536 + ((codeUnit & 1023) << 10) + (string.charCodeAt(t1) & 1023), string, t1); + return t1; + } + return null; + }, + _writeEscape$4(buffer, character, string, i) { + var t1, next; + buffer.writeCharCode$1(92); + buffer.write$1(0, B.JSInt_methods.toRadixString$1(character, 16)); + t1 = i + 1; + if (string.length === t1) + return; + next = string.charCodeAt(t1); + if (A.CharacterExtension_get_isHex(next) || 32 === next || 9 === next) + buffer.writeCharCode$1(32); + }, + visitAttributeSelector$1(attribute) { + var _0_0, t2, + t1 = this._serialize$_buffer; + t1.writeCharCode$1(91); + t1.write$1(0, attribute.name); + _0_0 = attribute.value; + if (_0_0 != null) { + t1.write$1(0, attribute.op); + if (A.Parser_isIdentifier(_0_0) && !B.JSString_methods.startsWith$1(_0_0, "--")) { + t1.write$1(0, _0_0); + t2 = attribute.modifier; + if (t2 != null) + t1.writeCharCode$1(32); + } else { + this._visitQuotedString$1(_0_0); + t2 = attribute.modifier; + if (t2 != null) + if (this._style !== B.OutputStyle_1) + t1.writeCharCode$1(32); + } + A.NullableExtension_andThen(t2, t1.get$write(t1)); + } + t1.writeCharCode$1(93); + }, + visitClassSelector$1(klass) { + var t1 = this._serialize$_buffer; + t1.writeCharCode$1(46); + t1.write$1(0, klass.name); + }, + visitComplexSelector$1(complex) { + var t2, t3, t4, t5, t6, i, component, t7, t8, t9, _this = this, + t1 = complex.leadingCombinators; + _this._writeCombinators$1(t1); + if (t1.length >= 1 && complex.components.length >= 1) + if (_this._style !== B.OutputStyle_1) + _this._serialize$_buffer.writeCharCode$1(32); + for (t1 = complex.components, t2 = t1.length, t3 = t2 - 1, t4 = _this._serialize$_buffer, t5 = _this._style === B.OutputStyle_1, t6 = !t5, i = 0; i < t2; ++i) { + component = t1[i]; + _this.visitCompoundSelector$1(component.selector); + t7 = component.combinators; + t8 = t7.length === 0; + if (!t8) + if (t6) + t4.writeCharCode$1(32); + t9 = t5 ? "" : " "; + _this._writeBetween$3(t7, t9, t4.get$write(t4)); + if (i !== t3) + t7 = !t5 || t8; + else + t7 = false; + if (t7) + t4.writeCharCode$1(32); + } + }, + _writeCombinators$1(combinators) { + var t1 = this._style === B.OutputStyle_1 ? "" : " ", + t2 = this._serialize$_buffer; + return this._writeBetween$3(combinators, t1, t2.get$write(t2)); + }, + visitCompoundSelector$1(compound) { + var t2, t3, _i, + t1 = this._serialize$_buffer, + start = t1.get$length(t1); + for (t2 = compound.components, t3 = t2.length, _i = 0; _i < t3; ++_i) + t2[_i].accept$1(this); + if (t1.get$length(t1) === start) + t1.writeCharCode$1(42); + }, + visitIDSelector$1(id) { + var t1 = this._serialize$_buffer; + t1.writeCharCode$1(35); + t1.write$1(0, id.name); + }, + visitSelectorList$1(list) { + var t1, t2, t3, first, t4, _this = this, + complexes = list.components; + for (t1 = J.get$iterator$ax(_this._inspect ? complexes : new A.WhereIterable(complexes, new A._SerializeVisitor_visitSelectorList_closure(), A._arrayInstanceType(complexes)._eval$1("WhereIterable<1>"))), t2 = _this._style !== B.OutputStyle_1, t3 = _this._serialize$_buffer, first = true; t1.moveNext$0();) { + t4 = t1.get$current(t1); + if (first) + first = false; + else { + t3.writeCharCode$1(44); + if (t4.lineBreak) { + if (t2) + t3.write$1(0, "\n"); + _this._writeIndentation$0(); + } else if (t2) + t3.writeCharCode$1(32); + } + _this.visitComplexSelector$1(t4); + } + }, + visitParentSelector$1($parent) { + var t1 = this._serialize$_buffer; + t1.writeCharCode$1(38); + A.NullableExtension_andThen($parent.suffix, t1.get$write(t1)); + }, + visitPlaceholderSelector$1(placeholder) { + var t1 = this._serialize$_buffer; + t1.writeCharCode$1(37); + t1.write$1(0, placeholder.name); + }, + visitPseudoSelector$1(pseudo) { + var _0_4, t2, t3, + t1 = pseudo.name; + if ("not" === t1) { + _0_4 = pseudo.selector; + if (_0_4 instanceof A.SelectorList) + t2 = (_0_4 == null ? type$.SelectorList._as(_0_4) : _0_4).accept$1(B._IsInvisibleVisitor_true); + else + t2 = false; + } else + t2 = false; + if (t2) + return; + t2 = this._serialize$_buffer; + t2.writeCharCode$1(58); + if (!pseudo.isSyntacticClass) + t2.writeCharCode$1(58); + t2.write$1(0, t1); + t1 = pseudo.argument; + t3 = t1 == null; + if (t3 && pseudo.selector == null) + return; + t2.writeCharCode$1(40); + if (!t3) { + t2.write$1(0, t1); + if (pseudo.selector != null) + t2.writeCharCode$1(32); + } + A.NullableExtension_andThen(pseudo.selector, this.get$visitSelectorList()); + t2.writeCharCode$1(41); + }, + visitTypeSelector$1(type) { + this._serialize$_buffer.write$1(0, type.name); + }, + visitUniversalSelector$1(universal) { + var t2, + t1 = universal.namespace; + if (t1 != null) { + t2 = this._serialize$_buffer; + t2.write$1(0, t1); + t2.writeCharCode$1(124); + } + this._serialize$_buffer.writeCharCode$1(42); + }, + _serialize$_write$1(value) { + return this._serialize$_buffer.forSpan$2(value.span, new A._SerializeVisitor__write_closure(this, value)); + }, + _serialize$_visitChildren$1($parent) { + var t2, t3, t4, t5, t6, t7, prePrevious, previous, t8, previous0, t9, savedIndentation, _this = this, + t1 = _this._serialize$_buffer; + t1.writeCharCode$1(123); + for (t2 = $parent.children, t3 = t2.$ti, t2 = new A.ListIterator(t2, t2.get$length(0), t3._eval$1("ListIterator")), t4 = _this._style === B.OutputStyle_1, t5 = !t4, t6 = _this.get$_requiresSemicolon(), t7 = !_this._inspect, t3 = t3._eval$1("ListBase.E"), prePrevious = null, previous = null; t2.moveNext$0();) { + t8 = t2.__internal$_current; + previous0 = t8 == null ? t3._as(t8) : t8; + if (t7) + t8 = t4 ? previous0.accept$1(B._IsInvisibleVisitor_true_true) : previous0.accept$1(B._IsInvisibleVisitor_true_false); + else + t8 = false; + if (t8) + continue; + t8 = previous == null; + t9 = t8 ? null : t6.call$1(previous); + if (t9 == null ? false : t9) + t1.writeCharCode$1(59); + if (_this._isTrailingComment$2(previous0, t8 ? $parent : previous)) { + if (t5) + t1.writeCharCode$1(32); + savedIndentation = _this._indentation; + _this._indentation = 0; + new A._SerializeVisitor__visitChildren_closure(_this, previous0).call$0(); + _this._indentation = savedIndentation; + } else { + if (t5) + t1.write$1(0, "\n"); + ++_this._indentation; + new A._SerializeVisitor__visitChildren_closure0(_this, previous0).call$0(); + --_this._indentation; + } + prePrevious = previous; + previous = previous0; + } + if (previous != null) { + if ((type$.CssParentNode._is(previous) ? previous.get$isChildless() : !(previous instanceof A.ModifiableCssComment)) && t5) + t1.writeCharCode$1(59); + if (prePrevious == null && _this._isTrailingComment$2(previous, $parent)) { + if (t5) + t1.writeCharCode$1(32); + } else { + _this._writeLineFeed$0(); + _this._writeIndentation$0(); + } + } + t1.writeCharCode$1(125); + }, + _requiresSemicolon$1(node) { + return type$.CssParentNode._is(node) ? node.get$isChildless() : !(node instanceof A.ModifiableCssComment); + }, + _isTrailingComment$2(node, previous) { + var t1, t2, t3, searchFrom, endOffset, t4, span; + if (this._style === B.OutputStyle_1) + return false; + if (!(node instanceof A.ModifiableCssComment)) + return false; + t1 = node.span; + t2 = t1.get$sourceUrl(t1); + t3 = previous.get$span(previous); + if (!J.$eq$(t2, t3.get$sourceUrl(t3))) + return false; + t2 = previous.get$span(previous); + if (!(J.$eq$(t2.get$file(t2).url, t1.get$file(t1).url) && t2.get$start(t2).offset <= t1.get$start(t1).offset && t2.get$end(t2).offset >= t1.get$end(t1).offset)) { + t1 = t1.get$start(t1); + t1 = t1.file.getLine$1(t1.offset); + t2 = previous.get$span(previous); + t2 = t2.get$end(t2); + return t1 === t2.file.getLine$1(t2.offset); + } + t2 = t1.get$start(t1); + t3 = previous.get$span(previous); + searchFrom = t2.offset - t3.get$start(t3).offset - 1; + if (searchFrom < 0) + return false; + endOffset = Math.max(0, B.JSString_methods.lastIndexOf$2(previous.get$span(previous).get$text(), "{", searchFrom)); + t2 = previous.get$span(previous); + t2 = t2.get$file(t2); + t3 = previous.get$span(previous); + t3 = t3.get$start(t3); + t4 = previous.get$span(previous); + span = t2.span$2(0, t3.offset, t4.get$start(t4).offset + endOffset); + t1 = t1.get$start(t1); + t1 = t1.file.getLine$1(t1.offset); + t4 = A.FileLocation$_(span.file, span._end); + return t1 === t4.file.getLine$1(t4.offset); + }, + _writeLineFeed$0() { + if (this._style !== B.OutputStyle_1) + this._serialize$_buffer.write$1(0, "\n"); + }, + _writeIndentation$0() { + var _this = this; + if (_this._style === B.OutputStyle_1) + return; + _this._writeTimes$2(_this._indentCharacter, _this._indentation * _this._indentWidth); + }, + _writeTimes$2(char, times) { + var t1, i; + for (t1 = this._serialize$_buffer, i = 0; i < times; ++i) + t1.writeCharCode$1(char); + }, + _writeBetween$1$3(iterable, text, callback) { + var t1, t2, first, value; + for (t1 = J.get$iterator$ax(iterable), t2 = this._serialize$_buffer, first = true; t1.moveNext$0();) { + value = t1.get$current(t1); + if (first) + first = false; + else + t2.write$1(0, text); + callback.call$1(value); + } + }, + _writeBetween$3(iterable, text, callback) { + return this._writeBetween$1$3(iterable, text, callback, type$.dynamic); + } + }; + A._SerializeVisitor_visitCssComment_closure.prototype = { + call$0() { + var t2, t3, _0_0, minimumIndentation, + t1 = this.$this; + if (t1._style === B.OutputStyle_1 && this.node.text.charCodeAt(2) !== 33) + return; + t2 = this.node; + t3 = t2.text; + if (B.JSString_methods.startsWith$1(t3, A.RegExp_RegExp("/\\*# source(Mapping)?URL=", false))) + return; + _0_0 = t1._minimumIndentation$1(t3); + if (_0_0 != null) { + t2 = t2.span; + t2 = t2.get$start(t2); + minimumIndentation = Math.min(_0_0, t2.file.getColumn$1(t2.offset)); + t1._writeIndentation$0(); + t1._writeWithIndent$2(t3, minimumIndentation); + } else { + t1._writeIndentation$0(); + t1._serialize$_buffer.write$1(0, t3); + } + }, + $signature: 1 + }; + A._SerializeVisitor_visitCssAtRule_closure.prototype = { + call$0() { + var t3, _0_0, + t1 = this.$this, + t2 = t1._serialize$_buffer; + t2.writeCharCode$1(64); + t3 = this.node; + t1._serialize$_write$1(t3.name); + _0_0 = t3.value; + if (_0_0 != null) { + t2.writeCharCode$1(32); + t1._serialize$_write$1(_0_0); + } + }, + $signature: 1 + }; + A._SerializeVisitor_visitCssMediaRule_closure.prototype = { + call$0() { + var t3, firstQuery, t4, t5, + t1 = this.$this, + t2 = t1._serialize$_buffer; + t2.write$1(0, "@media"); + t3 = this.node.queries; + firstQuery = B.JSArray_methods.get$first(t3); + t4 = t1._style === B.OutputStyle_1; + if (t4) + if (firstQuery.modifier == null) + if (firstQuery.type == null) { + t5 = firstQuery.conditions; + t5 = t5.length === 1 && J.startsWith$1$s(B.JSArray_methods.get$first(t5), "(not "); + } else + t5 = true; + else + t5 = true; + else + t5 = true; + if (t5) + t2.writeCharCode$1(32); + t2 = t4 ? "," : ", "; + t1._writeBetween$3(t3, t2, t1.get$_visitMediaQuery()); + }, + $signature: 1 + }; + A._SerializeVisitor_visitCssImport_closure.prototype = { + call$0() { + var t3, t4, _0_0, + t1 = this.$this, + t2 = t1._serialize$_buffer; + t2.write$1(0, "@import"); + t3 = t1._style !== B.OutputStyle_1; + if (t3) + t2.writeCharCode$1(32); + t4 = this.node; + t2.forSpan$2(t4.url.span, new A._SerializeVisitor_visitCssImport__closure(t1, t4)); + _0_0 = t4.modifiers; + if (_0_0 != null) { + if (t3) + t2.writeCharCode$1(32); + t2.write$1(0, _0_0); + } + }, + $signature: 1 + }; + A._SerializeVisitor_visitCssImport__closure.prototype = { + call$0() { + return this.$this._writeImportUrl$1(this.node.url.value); + }, + $signature: 0 + }; + A._SerializeVisitor_visitCssKeyframeBlock_closure.prototype = { + call$0() { + var t1 = this.$this, + t2 = t1._style === B.OutputStyle_1 ? "," : ", ", + t3 = t1._serialize$_buffer; + return t1._writeBetween$3(this.node.selector.value, t2, t3.get$write(t3)); + }, + $signature: 0 + }; + A._SerializeVisitor_visitCssStyleRule_closure.prototype = { + call$0() { + return this.$this.visitSelectorList$1(this.node._style_rule$_selector._box$_inner.value); + }, + $signature: 0 + }; + A._SerializeVisitor_visitCssSupportsRule_closure.prototype = { + call$0() { + var t1 = this.$this, + t2 = t1._serialize$_buffer; + t2.write$1(0, "@supports"); + if (!(t1._style === B.OutputStyle_1 && J.codeUnitAt$1$s(this.node.condition.value, 0) === 40)) + t2.writeCharCode$1(32); + t1._serialize$_write$1(this.node.condition); + }, + $signature: 1 + }; + A._SerializeVisitor_visitCssDeclaration_closure.prototype = { + call$0() { + var t1 = this.$this, + t2 = this.node; + if (t1._style === B.OutputStyle_1) + t1._writeFoldedValue$1(t2); + else + t1._writeReindentedValue$1(t2); + }, + $signature: 1 + }; + A._SerializeVisitor_visitCssDeclaration_closure0.prototype = { + call$0() { + return this.node.value.value.accept$1(this.$this); + }, + $signature: 0 + }; + A._SerializeVisitor_visitList_closure.prototype = { + call$1(element) { + return !element.get$isBlank(); + }, + $signature: 69 + }; + A._SerializeVisitor_visitList_closure0.prototype = { + call$1(element) { + var t1 = this.$this, + needsParens = t1._elementNeedsParens$2(this.value._separator, element); + if (needsParens) + t1._serialize$_buffer.writeCharCode$1(40); + element.accept$1(t1); + if (needsParens) + t1._serialize$_buffer.writeCharCode$1(41); + }, + $signature: 58 + }; + A._SerializeVisitor_visitList_closure1.prototype = { + call$1(element) { + element.accept$1(this.$this); + }, + $signature: 58 + }; + A._SerializeVisitor_visitMap_closure.prototype = { + call$1(entry) { + var t1 = this.$this; + t1._writeMapElement$1(entry.key); + t1._serialize$_buffer.write$1(0, ": "); + t1._writeMapElement$1(entry.value); + }, + $signature: 273 + }; + A._SerializeVisitor_visitSelectorList_closure.prototype = { + call$1(complex) { + return !complex.accept$1(B._IsInvisibleVisitor_true); + }, + $signature: 18 + }; + A._SerializeVisitor__write_closure.prototype = { + call$0() { + return this.$this._serialize$_buffer.write$1(0, this.value.value); + }, + $signature: 0 + }; + A._SerializeVisitor__visitChildren_closure.prototype = { + call$0() { + return this.child.accept$1(this.$this); + }, + $signature: 0 + }; + A._SerializeVisitor__visitChildren_closure0.prototype = { + call$0() { + this.child.accept$1(this.$this); + }, + $signature: 0 + }; + A.OutputStyle.prototype = { + _enumToString$0() { + return "OutputStyle." + this._name; + } + }; + A.LineFeed.prototype = { + _enumToString$0() { + return "LineFeed." + this._name; + }, + toString$0(_) { + return "lf"; + } + }; + A.StatementSearchVisitor.prototype = { + visitAtRootRule$1(node) { + return this.visitChildren$1(node.children); + }, + visitAtRule$1(node) { + return A.NullableExtension_andThen(node.children, this.get$visitChildren()); + }, + visitContentBlock$1(node) { + return this.visitChildren$1(node.children); + }, + visitContentRule$1(node) { + return null; + }, + visitDebugRule$1(node) { + return null; + }, + visitDeclaration$1(node) { + return A.NullableExtension_andThen(node.children, this.get$visitChildren()); + }, + visitEachRule$1(node) { + return this.visitChildren$1(node.children); + }, + visitErrorRule$1(node) { + return null; + }, + visitExtendRule$1(node) { + return null; + }, + visitForRule$1(node) { + return this.visitChildren$1(node.children); + }, + visitForwardRule$1(node) { + return null; + }, + visitFunctionRule$1(node) { + return this.visitChildren$1(node.children); + }, + visitIfRule$1(node) { + var t1 = A.IterableExtension_search(node.clauses, new A.StatementSearchVisitor_visitIfRule_closure(this)); + return t1 == null ? A.NullableExtension_andThen(node.lastClause, new A.StatementSearchVisitor_visitIfRule_closure0(this)) : t1; + }, + visitImportRule$1(node) { + return null; + }, + visitIncludeRule$1(node) { + return A.NullableExtension_andThen(node.content, this.get$visitContentBlock()); + }, + visitLoudComment$1(node) { + return null; + }, + visitMediaRule$1(node) { + return this.visitChildren$1(node.children); + }, + visitMixinRule$1(node) { + return this.visitChildren$1(node.children); + }, + visitReturnRule$1(node) { + return null; + }, + visitSilentComment$1(node) { + return null; + }, + visitStyleRule$1(node) { + return this.visitChildren$1(node.children); + }, + visitStylesheet$1(node) { + return this.visitChildren$1(node.children); + }, + visitSupportsRule$1(node) { + return this.visitChildren$1(node.children); + }, + visitUseRule$1(node) { + return null; + }, + visitVariableDeclaration$1(node) { + return null; + }, + visitWarnRule$1(node) { + return null; + }, + visitWhileRule$1(node) { + return this.visitChildren$1(node.children); + }, + visitChildren$1(children) { + return A.IterableExtension_search(children, new A.StatementSearchVisitor_visitChildren_closure(this)); + } + }; + A.StatementSearchVisitor_visitIfRule_closure.prototype = { + call$1(clause) { + return A.IterableExtension_search(clause.children, new A.StatementSearchVisitor_visitIfRule__closure0(this.$this)); + }, + $signature() { + return A._instanceType(this.$this)._eval$1("StatementSearchVisitor.T?(IfClause)"); + } + }; + A.StatementSearchVisitor_visitIfRule__closure0.prototype = { + call$1(child) { + return child.accept$1(this.$this); + }, + $signature() { + return A._instanceType(this.$this)._eval$1("StatementSearchVisitor.T?(Statement)"); + } + }; + A.StatementSearchVisitor_visitIfRule_closure0.prototype = { + call$1(lastClause) { + return A.IterableExtension_search(lastClause.children, new A.StatementSearchVisitor_visitIfRule__closure(this.$this)); + }, + $signature() { + return A._instanceType(this.$this)._eval$1("StatementSearchVisitor.T?(ElseClause)"); + } + }; + A.StatementSearchVisitor_visitIfRule__closure.prototype = { + call$1(child) { + return child.accept$1(this.$this); + }, + $signature() { + return A._instanceType(this.$this)._eval$1("StatementSearchVisitor.T?(Statement)"); + } + }; + A.StatementSearchVisitor_visitChildren_closure.prototype = { + call$1(child) { + return child.accept$1(this.$this); + }, + $signature() { + return A._instanceType(this.$this)._eval$1("StatementSearchVisitor.T?(Statement)"); + } + }; + A.Entry.prototype = { + compareTo$1(_, other) { + var t1, t2, + res = this.target.compareTo$1(0, other.target); + if (res !== 0) + return res; + t1 = this.source; + t2 = other.source; + res = B.JSString_methods.compareTo$1(J.toString$0$(t1.file.url), J.toString$0$(t2.file.url)); + if (res !== 0) + return res; + return t1.compareTo$1(0, t2); + }, + $isComparable: 1 + }; + A.Mapping.prototype = {}; + A.SingleMapping.prototype = { + toJson$1$includeSourceContents(includeSourceContents) { + var t1, t2, line, column, srcLine, srcColumn, srcUrlId, srcNameId, first, _i, entry, nextLine, i, t3, t4, column0, t5, newUrlId, srcLine0, srcColumn0, srcNameId0, result, _this = this, + buff = new A.StringBuffer(""); + for (t1 = _this.lines, t2 = t1.length, line = 0, column = 0, srcLine = 0, srcColumn = 0, srcUrlId = 0, srcNameId = 0, first = true, _i = 0; _i < t1.length; t1.length === t2 || (0, A.throwConcurrentModificationError)(t1), ++_i) { + entry = t1[_i]; + nextLine = entry.line; + if (nextLine > line) { + for (i = line; i < nextLine; ++i) + buff._contents += ";"; + line = nextLine; + column = 0; + first = true; + } + for (t3 = J.get$iterator$ax(entry.entries); t3.moveNext$0(); column = column0, first = false) { + t4 = t3.get$current(t3); + if (!first) + buff._contents += ","; + column0 = t4.column; + t5 = A.encodeVlq(column0 - column); + t5 = A.StringBuffer__writeAll(buff._contents, t5, ""); + buff._contents = t5; + newUrlId = t4.sourceUrlId; + t5 = A.StringBuffer__writeAll(t5, A.encodeVlq(newUrlId - srcUrlId), ""); + buff._contents = t5; + srcLine0 = t4.sourceLine; + t5 = A.StringBuffer__writeAll(t5, A.encodeVlq(srcLine0 - srcLine), ""); + buff._contents = t5; + srcColumn0 = t4.sourceColumn; + t5 = A.StringBuffer__writeAll(t5, A.encodeVlq(srcColumn0 - srcColumn), ""); + buff._contents = t5; + srcNameId0 = t4.sourceNameId; + if (srcNameId0 == null) { + srcUrlId = newUrlId; + srcColumn = srcColumn0; + srcLine = srcLine0; + continue; + } + buff._contents = A.StringBuffer__writeAll(t5, A.encodeVlq(srcNameId0 - srcNameId), ""); + srcNameId = srcNameId0; + srcUrlId = newUrlId; + srcColumn = srcColumn0; + srcLine = srcLine0; + } + } + t1 = _this.sourceRoot; + if (t1 == null) + t1 = ""; + t2 = buff._contents; + result = A.LinkedHashMap_LinkedHashMap$_literal(["version", 3, "sourceRoot", t1, "sources", _this.urls, "names", _this.names, "mappings", t2.charCodeAt(0) == 0 ? t2 : t2], type$.String, type$.dynamic); + t1 = _this.targetUrl; + if (t1 != null) + result.$indexSet(0, "file", t1); + if (includeSourceContents) { + t1 = _this.files; + t2 = A._arrayInstanceType(t1)._eval$1("MappedListIterable<1,String?>"); + result.$indexSet(0, "sourcesContent", A.List_List$of(new A.MappedListIterable(t1, new A.SingleMapping_toJson_closure(), t2), true, t2._eval$1("ListIterable.E"))); + } + _this.extensions.forEach$1(0, new A.SingleMapping_toJson_closure0(result)); + return result; + }, + toJson$0() { + return this.toJson$1$includeSourceContents(false); + }, + toString$0(_) { + var _this = this, + t1 = A.getRuntimeTypeOfDartObject(_this).toString$0(0) + " : [" + "targetUrl: " + A.S(_this.targetUrl) + ", sourceRoot: " + A.S(_this.sourceRoot) + ", urls: " + A.S(_this.urls) + ", names: " + A.S(_this.names) + ", lines: " + A.S(_this.lines) + "]"; + return t1.charCodeAt(0) == 0 ? t1 : t1; + } + }; + A.SingleMapping_SingleMapping$fromEntries_closure.prototype = { + call$0() { + return this.urls.__js_helper$_length; + }, + $signature: 10 + }; + A.SingleMapping_SingleMapping$fromEntries_closure0.prototype = { + call$0() { + return this.sourceEntry.source.file; + }, + $signature: 274 + }; + A.SingleMapping_SingleMapping$fromEntries_closure1.prototype = { + call$1(i) { + return this.files.$index(0, i); + }, + $signature: 275 + }; + A.SingleMapping_toJson_closure.prototype = { + call$1(file) { + return file == null ? null : A.String_String$fromCharCodes(B.NativeUint32List_methods.sublist$2(file._decodedChars, 0, null), 0, null); + }, + $signature: 276 + }; + A.SingleMapping_toJson_closure0.prototype = { + call$2($name, value) { + this.result.$indexSet(0, $name, value); + return value; + }, + $signature: 129 + }; + A.TargetLineEntry.prototype = { + toString$0(_) { + return A.getRuntimeTypeOfDartObject(this).toString$0(0) + ": " + this.line + " " + A.S(this.entries); + } + }; + A.TargetEntry.prototype = { + toString$0(_) { + var _this = this; + return A.getRuntimeTypeOfDartObject(_this).toString$0(0) + ": (" + _this.column + ", " + _this.sourceUrlId + ", " + _this.sourceLine + ", " + _this.sourceColumn + ", " + A.S(_this.sourceNameId) + ")"; + } + }; + A.SourceFile.prototype = { + get$length(_) { + return this._decodedChars.length; + }, + get$lines() { + return this._lineStarts.length; + }, + SourceFile$decoded$2$url(decodedChars, url) { + var t1, t2, t3, i, c, j; + for (t1 = this._decodedChars, t2 = t1.length, t3 = this._lineStarts, i = 0; i < t2; ++i) { + c = t1[i]; + if (c === 13) { + j = i + 1; + if (j >= t2 || t1[j] !== 10) + c = 10; + } + if (c === 10) + t3.push(i + 1); + } + }, + span$2(_, start, end) { + return A._FileSpan$(this, start, end == null ? this._decodedChars.length : end); + }, + span$1(_, start) { + return this.span$2(0, start, null); + }, + getLine$1(offset) { + var t1, _this = this; + if (offset < 0) + throw A.wrapException(A.RangeError$("Offset may not be negative, was " + offset + ".")); + else if (offset > _this._decodedChars.length) + throw A.wrapException(A.RangeError$("Offset " + offset + string$.x20must_n + _this.get$length(0) + ".")); + t1 = _this._lineStarts; + if (offset < B.JSArray_methods.get$first(t1)) + return -1; + if (offset >= B.JSArray_methods.get$last(t1)) + return t1.length - 1; + if (_this._isNearCachedLine$1(offset)) { + t1 = _this._cachedLine; + t1.toString; + return t1; + } + return _this._cachedLine = _this._binarySearch$1(offset) - 1; + }, + _isNearCachedLine$1(offset) { + var t2, t3, + t1 = this._cachedLine; + if (t1 == null) + return false; + t2 = this._lineStarts; + if (offset < t2[t1]) + return false; + t3 = t2.length; + if (t1 >= t3 - 1 || offset < t2[t1 + 1]) + return true; + if (t1 >= t3 - 2 || offset < t2[t1 + 2]) { + this._cachedLine = t1 + 1; + return true; + } + return false; + }, + _binarySearch$1(offset) { + var min, half, + t1 = this._lineStarts, + max = t1.length - 1; + for (min = 0; min < max;) { + half = min + B.JSInt_methods._tdivFast$1(max - min, 2); + if (t1[half] > offset) + max = half; + else + min = half + 1; + } + return max; + }, + getColumn$1(offset) { + var line, lineStart, _this = this; + if (offset < 0) + throw A.wrapException(A.RangeError$("Offset may not be negative, was " + offset + ".")); + else if (offset > _this._decodedChars.length) + throw A.wrapException(A.RangeError$("Offset " + offset + " must be not be greater than the number of characters in the file, " + _this.get$length(0) + ".")); + line = _this.getLine$1(offset); + lineStart = _this._lineStarts[line]; + if (lineStart > offset) + throw A.wrapException(A.RangeError$("Line " + line + " comes after offset " + offset + ".")); + return offset - lineStart; + }, + getOffset$1(line) { + var t1, t2, result, t3; + if (line < 0) + throw A.wrapException(A.RangeError$("Line may not be negative, was " + line + ".")); + else { + t1 = this._lineStarts; + t2 = t1.length; + if (line >= t2) + throw A.wrapException(A.RangeError$("Line " + line + " must be less than the number of lines in the file, " + this.get$lines() + ".")); + } + result = t1[line]; + if (result <= this._decodedChars.length) { + t3 = line + 1; + t1 = t3 < t2 && result >= t1[t3]; + } else + t1 = true; + if (t1) + throw A.wrapException(A.RangeError$("Line " + line + " doesn't have 0 columns.")); + return result; + } + }; + A.FileLocation.prototype = { + get$sourceUrl(_) { + return this.file.url; + }, + get$line() { + return this.file.getLine$1(this.offset); + }, + get$column() { + return this.file.getColumn$1(this.offset); + }, + FileLocation$_$2(file, offset) { + var t2, + t1 = this.offset; + if (t1 < 0) + throw A.wrapException(A.RangeError$("Offset may not be negative, was " + t1 + ".")); + else { + t2 = this.file; + if (t1 > t2._decodedChars.length) + throw A.wrapException(A.RangeError$("Offset " + t1 + string$.x20must_n + t2.get$length(0) + ".")); + } + }, + pointSpan$0() { + var t1 = this.offset; + return A._FileSpan$(this.file, t1, t1); + }, + get$offset() { + return this.offset; + } + }; + A._FileSpan.prototype = { + get$sourceUrl(_) { + return this.file.url; + }, + get$length(_) { + return this._end - this._file$_start; + }, + get$start(_) { + return A.FileLocation$_(this.file, this._file$_start); + }, + get$end(_) { + return A.FileLocation$_(this.file, this._end); + }, + get$text() { + return A.String_String$fromCharCodes(B.NativeUint32List_methods.sublist$2(this.file._decodedChars, this._file$_start, this._end), 0, null); + }, + get$context(_) { + var _this = this, + t1 = _this.file, + endOffset = _this._end, + endLine = t1.getLine$1(endOffset); + if (t1.getColumn$1(endOffset) === 0 && endLine !== 0) { + if (endOffset - _this._file$_start === 0) + return endLine === t1._lineStarts.length - 1 ? "" : A.String_String$fromCharCodes(B.NativeUint32List_methods.sublist$2(t1._decodedChars, t1.getOffset$1(endLine), t1.getOffset$1(endLine + 1)), 0, null); + } else + endOffset = endLine === t1._lineStarts.length - 1 ? t1._decodedChars.length : t1.getOffset$1(endLine + 1); + return A.String_String$fromCharCodes(B.NativeUint32List_methods.sublist$2(t1._decodedChars, t1.getOffset$1(t1.getLine$1(_this._file$_start)), endOffset), 0, null); + }, + _FileSpan$3(file, _start, _end) { + var t3, + t1 = this._end, + t2 = this._file$_start; + if (t1 < t2) + throw A.wrapException(A.ArgumentError$("End " + t1 + " must come after start " + t2 + ".", null)); + else { + t3 = this.file; + if (t1 > t3._decodedChars.length) + throw A.wrapException(A.RangeError$("End " + t1 + string$.x20must_n + t3.get$length(0) + ".")); + else if (t2 < 0) + throw A.wrapException(A.RangeError$("Start may not be negative, was " + t2 + ".")); + } + }, + compareTo$1(_, other) { + var result; + if (!(other instanceof A._FileSpan)) + return this.super$SourceSpanMixin$compareTo(0, other); + result = B.JSInt_methods.compareTo$1(this._file$_start, other._file$_start); + return result === 0 ? B.JSInt_methods.compareTo$1(this._end, other._end) : result; + }, + $eq(_, other) { + var _this = this; + if (other == null) + return false; + if (!type$.FileSpan._is(other)) + return _this.super$SourceSpanMixin$$eq(0, other); + if (!(other instanceof A._FileSpan)) + return _this.super$SourceSpanMixin$$eq(0, other) && J.$eq$(_this.file.url, other.get$sourceUrl(other)); + return _this._file$_start === other._file$_start && _this._end === other._end && J.$eq$(_this.file.url, other.file.url); + }, + get$hashCode(_) { + return A.Object_hash(this._file$_start, this._end, this.file.url, B.C_SentinelValue); + }, + expand$1(_, other) { + var t2, t3, _this = this, + t1 = _this.file; + if (!J.$eq$(t1.url, other.get$sourceUrl(other))) + throw A.wrapException(A.ArgumentError$('Source URLs "' + A.S(_this.get$sourceUrl(0)) + '" and "' + A.S(other.get$sourceUrl(other)) + "\" don't match.", null)); + t2 = _this._file$_start; + t3 = _this._end; + if (other instanceof A._FileSpan) + return A._FileSpan$(t1, Math.min(t2, other._file$_start), Math.max(t3, other._end)); + else + return A._FileSpan$(t1, Math.min(t2, other.get$start(other).offset), Math.max(t3, other.get$end(other).offset)); + }, + $isFileSpan: 1, + $isSourceSpanWithContext: 1, + get$file(receiver) { + return this.file; + } + }; + A.Highlighter.prototype = { + highlight$0() { + var t2, highlightsByColumn, t3, t4, i, line, lastLine, t5, t6, t7, t8, t9, t10, t11, index, primaryIdx, primary, _i, highlight, _this = this, _null = null, + t1 = _this._lines; + _this._writeFileStart$1(B.JSArray_methods.get$first(t1).url); + t2 = _this._maxMultilineSpans; + highlightsByColumn = A.List_List$filled(t2, _null, false, type$.nullable__Highlight); + for (t3 = _this._highlighter$_buffer, t2 = t2 !== 0, t4 = _this._primaryColor, i = 0; i < t1.length; ++i) { + line = t1[i]; + if (i > 0) { + lastLine = t1[i - 1]; + t5 = lastLine.url; + t6 = line.url; + if (!J.$eq$(t5, t6)) { + _this._writeSidebar$1$end($._glyphs.get$upEnd()); + t3._contents += "\n"; + _this._writeFileStart$1(t6); + } else if (lastLine.number + 1 !== line.number) { + _this._writeSidebar$1$text("..."); + t3._contents += "\n"; + } + } + for (t5 = line.highlights, t6 = A._arrayInstanceType(t5)._eval$1("ReversedListIterable<1>"), t7 = new A.ReversedListIterable(t5, t6), t7 = new A.ListIterator(t7, t7.get$length(0), t6._eval$1("ListIterator")), t6 = t6._eval$1("ListIterable.E"), t8 = line.number, t9 = line.text; t7.moveNext$0();) { + t10 = t7.__internal$_current; + if (t10 == null) + t10 = t6._as(t10); + t11 = t10.span; + if (t11.get$start(t11).get$line() !== t11.get$end(t11).get$line() && t11.get$start(t11).get$line() === t8 && _this._isOnlyWhitespace$1(B.JSString_methods.substring$2(t9, 0, t11.get$start(t11).get$column()))) { + index = B.JSArray_methods.indexOf$1(highlightsByColumn, _null); + if (index < 0) + A.throwExpression(A.ArgumentError$(A.S(highlightsByColumn) + " contains no null elements.", _null)); + highlightsByColumn[index] = t10; + } + } + _this._writeSidebar$1$line(t8); + t3._contents += " "; + _this._writeMultilineHighlights$2(line, highlightsByColumn); + if (t2) + t3._contents += " "; + primaryIdx = B.JSArray_methods.indexWhere$1(t5, new A.Highlighter_highlight_closure()); + primary = primaryIdx === -1 ? _null : t5[primaryIdx]; + t6 = primary != null; + if (t6) { + t7 = primary.span; + t10 = t7.get$start(t7).get$line() === t8 ? t7.get$start(t7).get$column() : 0; + _this._writeHighlightedText$4$color(t9, t10, t7.get$end(t7).get$line() === t8 ? t7.get$end(t7).get$column() : t9.length, t4); + } else + _this._writeText$1(t9); + t3._contents += "\n"; + if (t6) + _this._writeIndicator$3(line, primary, highlightsByColumn); + for (t6 = t5.length, _i = 0; _i < t5.length; t5.length === t6 || (0, A.throwConcurrentModificationError)(t5), ++_i) { + highlight = t5[_i]; + if (highlight.isPrimary) + continue; + _this._writeIndicator$3(line, highlight, highlightsByColumn); + } + } + _this._writeSidebar$1$end($._glyphs.get$upEnd()); + t1 = t3._contents; + return t1.charCodeAt(0) == 0 ? t1 : t1; + }, + _writeFileStart$1(url) { + var _this = this, + t1 = !_this._multipleFiles || !type$.Uri._is(url), + t2 = $._glyphs; + if (t1) + _this._writeSidebar$1$end(t2.get$downEnd()); + else { + _this._writeSidebar$1$end(t2.get$topLeftCorner()); + _this._colorize$2$color(new A.Highlighter__writeFileStart_closure(_this), "\x1b[34m"); + _this._highlighter$_buffer._contents += " " + $.$get$context().prettyUri$1(url); + } + _this._highlighter$_buffer._contents += "\n"; + }, + _writeMultilineHighlights$3$current(line, highlightsByColumn, current) { + var t1, currentColor, t2, t3, t4, t5, foundCurrent, _i, highlight, t6, startLine, t7, endLine, _this = this, _box_0 = {}; + _box_0.openedOnThisLine = false; + _box_0.openedOnThisLineColor = null; + t1 = current == null; + if (t1) + currentColor = null; + else + currentColor = current.isPrimary ? _this._primaryColor : _this._secondaryColor; + for (t2 = highlightsByColumn.length, t3 = _this._secondaryColor, t1 = !t1, t4 = _this._primaryColor, t5 = _this._highlighter$_buffer, foundCurrent = false, _i = 0; _i < t2; ++_i) { + highlight = highlightsByColumn[_i]; + t6 = highlight == null; + if (t6) + startLine = null; + else { + t7 = highlight.span; + startLine = t7.get$start(t7).get$line(); + } + if (t6) + endLine = null; + else { + t7 = highlight.span; + endLine = t7.get$end(t7).get$line(); + } + if (t1 && highlight === current) { + _this._colorize$2$color(new A.Highlighter__writeMultilineHighlights_closure(_this, startLine, line), currentColor); + foundCurrent = true; + } else if (foundCurrent) + _this._colorize$2$color(new A.Highlighter__writeMultilineHighlights_closure0(_this, highlight), currentColor); + else if (t6) + if (_box_0.openedOnThisLine) + _this._colorize$2$color(new A.Highlighter__writeMultilineHighlights_closure1(_this), _box_0.openedOnThisLineColor); + else + t5._contents += " "; + else { + t6 = highlight.isPrimary ? t4 : t3; + _this._colorize$2$color(new A.Highlighter__writeMultilineHighlights_closure2(_box_0, _this, current, startLine, line, highlight, endLine), t6); + } + } + }, + _writeMultilineHighlights$2(line, highlightsByColumn) { + return this._writeMultilineHighlights$3$current(line, highlightsByColumn, null); + }, + _writeHighlightedText$4$color(text, startColumn, endColumn, color) { + var _this = this; + _this._writeText$1(B.JSString_methods.substring$2(text, 0, startColumn)); + _this._colorize$2$color(new A.Highlighter__writeHighlightedText_closure(_this, text, startColumn, endColumn), color); + _this._writeText$1(B.JSString_methods.substring$2(text, endColumn, text.length)); + }, + _writeIndicator$3(line, highlight, highlightsByColumn) { + var t2, coversWholeLine, _this = this, + color = highlight.isPrimary ? _this._primaryColor : _this._secondaryColor, + t1 = highlight.span; + if (t1.get$start(t1).get$line() === t1.get$end(t1).get$line()) { + _this._writeSidebar$0(); + t1 = _this._highlighter$_buffer; + t1._contents += " "; + _this._writeMultilineHighlights$3$current(line, highlightsByColumn, highlight); + if (highlightsByColumn.length !== 0) + t1._contents += " "; + _this._writeLabel$3(highlight, highlightsByColumn, _this._colorize$2$color(new A.Highlighter__writeIndicator_closure(_this, line, highlight), color)); + } else { + t2 = line.number; + if (t1.get$start(t1).get$line() === t2) { + if (B.JSArray_methods.contains$1(highlightsByColumn, highlight)) + return; + A.replaceFirstNull(highlightsByColumn, highlight); + _this._writeSidebar$0(); + t1 = _this._highlighter$_buffer; + t1._contents += " "; + _this._writeMultilineHighlights$3$current(line, highlightsByColumn, highlight); + _this._colorize$2$color(new A.Highlighter__writeIndicator_closure0(_this, line, highlight), color); + t1._contents += "\n"; + } else if (t1.get$end(t1).get$line() === t2) { + coversWholeLine = t1.get$end(t1).get$column() === line.text.length; + if (coversWholeLine && highlight.label == null) { + A.replaceWithNull(highlightsByColumn, highlight); + return; + } + _this._writeSidebar$0(); + _this._highlighter$_buffer._contents += " "; + _this._writeMultilineHighlights$3$current(line, highlightsByColumn, highlight); + _this._writeLabel$3(highlight, highlightsByColumn, _this._colorize$2$color(new A.Highlighter__writeIndicator_closure1(_this, coversWholeLine, line, highlight), color)); + A.replaceWithNull(highlightsByColumn, highlight); + } + } + }, + _writeArrow$3$beginning(line, column, beginning) { + var t2, + t1 = beginning ? 0 : 1, + tabs = this._countTabs$1(B.JSString_methods.substring$2(line.text, 0, column + t1)); + t1 = this._highlighter$_buffer; + t2 = t1._contents += B.JSString_methods.$mul($._glyphs.get$horizontalLine(), 1 + column + tabs * 3); + t1._contents = t2 + "^"; + }, + _writeArrow$2(line, column) { + return this._writeArrow$3$beginning(line, column, true); + }, + _writeLabel$3(highlight, highlightsByColumn, underlineLength) { + var lines, color, t1, t2, t3, t4, t5, t6, _i, columnHighlight, _this = this, + label = highlight.label; + if (label == null) { + _this._highlighter$_buffer._contents += "\n"; + return; + } + lines = A._setArrayType(label.split("\n"), type$.JSArray_String); + color = highlight.isPrimary ? _this._primaryColor : _this._secondaryColor; + _this._colorize$2$color(new A.Highlighter__writeLabel_closure(_this, lines), color); + t1 = _this._highlighter$_buffer; + t1._contents += "\n"; + for (t2 = A.SubListIterable$(lines, 1, null, type$.String), t3 = t2.$ti, t2 = new A.ListIterator(t2, t2.get$length(0), t3._eval$1("ListIterator")), t4 = highlightsByColumn.length, t3 = t3._eval$1("ListIterable.E"); t2.moveNext$0();) { + t5 = t2.__internal$_current; + if (t5 == null) + t5 = t3._as(t5); + _this._writeSidebar$0(); + t6 = t1._contents += " "; + for (_i = 0; _i < t4; ++_i) { + columnHighlight = highlightsByColumn[_i]; + if (columnHighlight == null || columnHighlight === highlight) { + t6 += " "; + t1._contents = t6; + } else + t6 = t1._contents += $._glyphs.get$verticalLine(); + } + t1._contents += B.JSString_methods.$mul(" ", underlineLength); + _this._colorize$2$color(new A.Highlighter__writeLabel_closure0(_this, t5), color); + t1._contents += "\n"; + } + }, + _writeText$1(text) { + var t1, t2, t3, t4; + for (t1 = new A.CodeUnits(text), t2 = type$.CodeUnits, t1 = new A.ListIterator(t1, t1.get$length(0), t2._eval$1("ListIterator")), t3 = this._highlighter$_buffer, t2 = t2._eval$1("ListBase.E"); t1.moveNext$0();) { + t4 = t1.__internal$_current; + if (t4 == null) + t4 = t2._as(t4); + if (t4 === 9) + t3._contents += B.JSString_methods.$mul(" ", 4); + else + t3._contents += A.Primitives_stringFromCharCode(t4); + } + }, + _writeSidebar$3$end$line$text(end, line, text) { + var t1 = {}; + t1.text = text; + if (line != null) + t1.text = B.JSInt_methods.toString$0(line + 1); + this._colorize$2$color(new A.Highlighter__writeSidebar_closure(t1, this, end), "\x1b[34m"); + }, + _writeSidebar$1$end(end) { + return this._writeSidebar$3$end$line$text(end, null, null); + }, + _writeSidebar$1$text(text) { + return this._writeSidebar$3$end$line$text(null, null, text); + }, + _writeSidebar$1$line(line) { + return this._writeSidebar$3$end$line$text(null, line, null); + }, + _writeSidebar$0() { + return this._writeSidebar$3$end$line$text(null, null, null); + }, + _countTabs$1(text) { + var t1, t2, count, t3; + for (t1 = new A.CodeUnits(text), t2 = type$.CodeUnits, t1 = new A.ListIterator(t1, t1.get$length(0), t2._eval$1("ListIterator")), t2 = t2._eval$1("ListBase.E"), count = 0; t1.moveNext$0();) { + t3 = t1.__internal$_current; + if ((t3 == null ? t2._as(t3) : t3) === 9) + ++count; + } + return count; + }, + _isOnlyWhitespace$1(text) { + var t1, t2, t3; + for (t1 = new A.CodeUnits(text), t2 = type$.CodeUnits, t1 = new A.ListIterator(t1, t1.get$length(0), t2._eval$1("ListIterator")), t2 = t2._eval$1("ListBase.E"); t1.moveNext$0();) { + t3 = t1.__internal$_current; + if (t3 == null) + t3 = t2._as(t3); + if (t3 !== 32 && t3 !== 9) + return false; + } + return true; + }, + _colorize$1$2$color(callback, color) { + var result, + t1 = this._primaryColor != null; + if (t1 && color != null) + this._highlighter$_buffer._contents += color; + result = callback.call$0(); + if (t1 && color != null) + this._highlighter$_buffer._contents += "\x1b[0m"; + return result; + }, + _colorize$2$color(callback, color) { + return this._colorize$1$2$color(callback, color, type$.dynamic); + } + }; + A.Highlighter_closure.prototype = { + call$0() { + var t1 = this.color, + t2 = J.getInterceptor$(t1); + if (t2.$eq(t1, true)) + return "\x1b[31m"; + if (t2.$eq(t1, false)) + return null; + return A._asStringQ(t1); + }, + $signature: 45 + }; + A.Highlighter$__closure.prototype = { + call$1(line) { + var t1 = line.highlights; + return new A.WhereIterable(t1, new A.Highlighter$___closure(), A._arrayInstanceType(t1)._eval$1("WhereIterable<1>")).get$length(0); + }, + $signature: 277 + }; + A.Highlighter$___closure.prototype = { + call$1(highlight) { + var t1 = highlight.span; + return t1.get$start(t1).get$line() !== t1.get$end(t1).get$line(); + }, + $signature: 136 + }; + A.Highlighter$__closure0.prototype = { + call$1(line) { + return line.url; + }, + $signature: 279 + }; + A.Highlighter__collateLines_closure.prototype = { + call$1(highlight) { + var t1 = highlight.span; + t1 = t1.get$sourceUrl(t1); + return t1 == null ? new A.Object() : t1; + }, + $signature: 280 + }; + A.Highlighter__collateLines_closure0.prototype = { + call$2(highlight1, highlight2) { + return highlight1.span.compareTo$1(0, highlight2.span); + }, + $signature: 281 + }; + A.Highlighter__collateLines_closure1.prototype = { + call$1(entry) { + var t1, t2, t3, t4, context, t5, linesBeforeSpan, lineNumber, _i, line, activeHighlights, highlightIndex, oldHighlightLength, t6, + url = entry.key, + highlightsForFile = entry.value, + lines = A._setArrayType([], type$.JSArray__Line); + for (t1 = J.getInterceptor$ax(highlightsForFile), t2 = t1.get$iterator(highlightsForFile), t3 = type$.JSArray__Highlight; t2.moveNext$0();) { + t4 = t2.get$current(t2).span; + context = t4.get$context(t4); + t5 = A.findLineStart(context, t4.get$text(), t4.get$start(t4).get$column()); + t5.toString; + linesBeforeSpan = B.JSString_methods.allMatches$1("\n", B.JSString_methods.substring$2(context, 0, t5)).get$length(0); + lineNumber = t4.get$start(t4).get$line() - linesBeforeSpan; + for (t4 = context.split("\n"), t5 = t4.length, _i = 0; _i < t5; ++_i) { + line = t4[_i]; + if (lines.length === 0 || lineNumber > B.JSArray_methods.get$last(lines).number) + lines.push(new A._Line(line, lineNumber, url, A._setArrayType([], t3))); + ++lineNumber; + } + } + activeHighlights = A._setArrayType([], t3); + for (t2 = lines.length, highlightIndex = 0, _i = 0; _i < lines.length; lines.length === t2 || (0, A.throwConcurrentModificationError)(lines), ++_i) { + line = lines[_i]; + if (!!activeHighlights.fixed$length) + A.throwExpression(A.UnsupportedError$("removeWhere")); + B.JSArray_methods._removeWhere$2(activeHighlights, new A.Highlighter__collateLines__closure(line), true); + oldHighlightLength = activeHighlights.length; + for (t3 = t1.skip$1(highlightsForFile, highlightIndex), t4 = A._instanceType(t3), t3 = new A.ListIterator(t3, t3.get$length(t3), t4._eval$1("ListIterator")), t4 = t4._eval$1("ListIterable.E"); t3.moveNext$0();) { + t5 = t3.__internal$_current; + if (t5 == null) + t5 = t4._as(t5); + t6 = t5.span; + if (t6.get$start(t6).get$line() > line.number) + break; + activeHighlights.push(t5); + } + highlightIndex += activeHighlights.length - oldHighlightLength; + B.JSArray_methods.addAll$1(line.highlights, activeHighlights); + } + return lines; + }, + $signature: 282 + }; + A.Highlighter__collateLines__closure.prototype = { + call$1(highlight) { + var t1 = highlight.span; + return t1.get$end(t1).get$line() < this.line.number; + }, + $signature: 136 + }; + A.Highlighter_highlight_closure.prototype = { + call$1(highlight) { + return highlight.isPrimary; + }, + $signature: 136 + }; + A.Highlighter__writeFileStart_closure.prototype = { + call$0() { + this.$this._highlighter$_buffer._contents += B.JSString_methods.$mul($._glyphs.get$horizontalLine(), 2) + ">"; + return null; + }, + $signature: 0 + }; + A.Highlighter__writeMultilineHighlights_closure.prototype = { + call$0() { + var t1 = $._glyphs; + t1 = this.startLine === this.line.number ? t1.get$topLeftCorner() : t1.get$bottomLeftCorner(); + this.$this._highlighter$_buffer._contents += t1; + }, + $signature: 1 + }; + A.Highlighter__writeMultilineHighlights_closure0.prototype = { + call$0() { + var t1 = $._glyphs; + t1 = this.highlight == null ? t1.get$horizontalLine() : t1.get$cross(); + this.$this._highlighter$_buffer._contents += t1; + }, + $signature: 1 + }; + A.Highlighter__writeMultilineHighlights_closure1.prototype = { + call$0() { + this.$this._highlighter$_buffer._contents += $._glyphs.get$horizontalLine(); + return null; + }, + $signature: 0 + }; + A.Highlighter__writeMultilineHighlights_closure2.prototype = { + call$0() { + var _this = this, + t1 = _this._box_0, + t2 = t1.openedOnThisLine, + t3 = $._glyphs, + vertical = t2 ? t3.get$cross() : t3.get$verticalLine(); + if (_this.current != null) + _this.$this._highlighter$_buffer._contents += vertical; + else { + t2 = _this.line; + t3 = t2.number; + if (_this.startLine === t3) { + t2 = _this.$this; + t2._colorize$2$color(new A.Highlighter__writeMultilineHighlights__closure(t1, t2), t1.openedOnThisLineColor); + t1.openedOnThisLine = true; + if (t1.openedOnThisLineColor == null) + t1.openedOnThisLineColor = _this.highlight.isPrimary ? t2._primaryColor : t2._secondaryColor; + } else { + if (_this.endLine === t3) { + t3 = _this.highlight.span; + t2 = t3.get$end(t3).get$column() === t2.text.length; + } else + t2 = false; + t3 = _this.$this; + if (t2) { + t1 = _this.highlight.label == null ? $._glyphs.glyphOrAscii$2("\u2514", "\\") : vertical; + t3._highlighter$_buffer._contents += t1; + } else + t3._colorize$2$color(new A.Highlighter__writeMultilineHighlights__closure0(t3, vertical), t1.openedOnThisLineColor); + } + } + }, + $signature: 1 + }; + A.Highlighter__writeMultilineHighlights__closure.prototype = { + call$0() { + var t1 = this._box_0.openedOnThisLine ? "\u252c" : "\u250c"; + this.$this._highlighter$_buffer._contents += $._glyphs.glyphOrAscii$2(t1, "/"); + }, + $signature: 1 + }; + A.Highlighter__writeMultilineHighlights__closure0.prototype = { + call$0() { + this.$this._highlighter$_buffer._contents += this.vertical; + }, + $signature: 1 + }; + A.Highlighter__writeHighlightedText_closure.prototype = { + call$0() { + var _this = this; + return _this.$this._writeText$1(B.JSString_methods.substring$2(_this.text, _this.startColumn, _this.endColumn)); + }, + $signature: 0 + }; + A.Highlighter__writeIndicator_closure.prototype = { + call$0() { + var startColumn, endColumn, tabsBefore, tabsInside, + t1 = this.$this, + t2 = t1._highlighter$_buffer, + t3 = t2._contents, + t4 = this.highlight, + t5 = t4.span; + t4 = t4.isPrimary ? "^" : $._glyphs.get$horizontalLineBold(); + startColumn = t5.get$start(t5).get$column(); + endColumn = t5.get$end(t5).get$column(); + t5 = this.line.text; + tabsBefore = t1._countTabs$1(B.JSString_methods.substring$2(t5, 0, startColumn)); + tabsInside = t1._countTabs$1(B.JSString_methods.substring$2(t5, startColumn, endColumn)); + startColumn += tabsBefore * 3; + t2._contents += B.JSString_methods.$mul(" ", startColumn); + t4 = t2._contents += B.JSString_methods.$mul(t4, Math.max(endColumn + (tabsBefore + tabsInside) * 3 - startColumn, 1)); + return t4.length - t3.length; + }, + $signature: 10 + }; + A.Highlighter__writeIndicator_closure0.prototype = { + call$0() { + var t1 = this.highlight.span; + return this.$this._writeArrow$2(this.line, t1.get$start(t1).get$column()); + }, + $signature: 0 + }; + A.Highlighter__writeIndicator_closure1.prototype = { + call$0() { + var t4, _this = this, + t1 = _this.$this, + t2 = t1._highlighter$_buffer, + t3 = t2._contents; + if (_this.coversWholeLine) + t2._contents += B.JSString_methods.$mul($._glyphs.get$horizontalLine(), 3); + else { + t4 = _this.highlight.span; + t1._writeArrow$3$beginning(_this.line, Math.max(t4.get$end(t4).get$column() - 1, 0), false); + } + return t2._contents.length - t3.length; + }, + $signature: 10 + }; + A.Highlighter__writeLabel_closure.prototype = { + call$0() { + this.$this._highlighter$_buffer._contents += " " + A.S(B.JSArray_methods.get$first(this.lines)); + return null; + }, + $signature: 0 + }; + A.Highlighter__writeLabel_closure0.prototype = { + call$0() { + this.$this._highlighter$_buffer._contents += " " + this.text; + return null; + }, + $signature: 0 + }; + A.Highlighter__writeSidebar_closure.prototype = { + call$0() { + var t1 = this.$this, + t2 = t1._highlighter$_buffer, + t3 = this._box_0.text; + if (t3 == null) + t3 = ""; + t2._contents += B.JSString_methods.padRight$1(t3, t1._paddingBeforeSidebar); + t1 = this.end; + t2._contents += t1 == null ? $._glyphs.get$verticalLine() : t1; + }, + $signature: 1 + }; + A._Highlight.prototype = { + toString$0(_) { + var t1 = this.isPrimary ? "" + "primary " : "", + t2 = this.span; + t2 = t1 + ("" + t2.get$start(t2).get$line() + ":" + t2.get$start(t2).get$column() + "-" + t2.get$end(t2).get$line() + ":" + t2.get$end(t2).get$column()); + t1 = this.label; + t1 = t1 != null ? t2 + (" (" + t1 + ")") : t2; + return t1.charCodeAt(0) == 0 ? t1 : t1; + } + }; + A._Highlight_closure.prototype = { + call$0() { + var t2, t3, t4, t5, + t1 = this.span; + if (!(type$.SourceSpanWithContext._is(t1) && A.findLineStart(t1.get$context(t1), t1.get$text(), t1.get$start(t1).get$column()) != null)) { + t2 = A.SourceLocation$(t1.get$start(t1).get$offset(), 0, 0, t1.get$sourceUrl(t1)); + t3 = t1.get$end(t1).get$offset(); + t4 = t1.get$sourceUrl(t1); + t5 = A.countCodeUnits(t1.get$text(), 10); + t1 = A.SourceSpanWithContext$(t2, A.SourceLocation$(t3, A._Highlight__lastLineLength(t1.get$text()), t5, t4), t1.get$text(), t1.get$text()); + } + return A._Highlight__normalizeEndOfLine(A._Highlight__normalizeTrailingNewline(A._Highlight__normalizeNewlines(t1))); + }, + $signature: 283 + }; + A._Line.prototype = { + toString$0(_) { + return "" + this.number + ': "' + this.text + '" (' + B.JSArray_methods.join$1(this.highlights, ", ") + ")"; + } + }; + A.SourceLocation.prototype = { + distance$1(other) { + var t1 = this.sourceUrl; + if (!J.$eq$(t1, other.get$sourceUrl(other))) + throw A.wrapException(A.ArgumentError$('Source URLs "' + A.S(t1) + '" and "' + A.S(other.get$sourceUrl(other)) + "\" don't match.", null)); + return Math.abs(this.offset - other.get$offset()); + }, + compareTo$1(_, other) { + var t1 = this.sourceUrl; + if (!J.$eq$(t1, other.get$sourceUrl(other))) + throw A.wrapException(A.ArgumentError$('Source URLs "' + A.S(t1) + '" and "' + A.S(other.get$sourceUrl(other)) + "\" don't match.", null)); + return this.offset - other.get$offset(); + }, + $eq(_, other) { + if (other == null) + return false; + return type$.SourceLocation._is(other) && J.$eq$(this.sourceUrl, other.get$sourceUrl(other)) && this.offset === other.get$offset(); + }, + get$hashCode(_) { + var t1 = this.sourceUrl; + t1 = t1 == null ? null : t1.get$hashCode(t1); + if (t1 == null) + t1 = 0; + return t1 + this.offset; + }, + toString$0(_) { + var _this = this, + t1 = A.getRuntimeTypeOfDartObject(_this).toString$0(0), + source = _this.sourceUrl; + return "<" + t1 + ": " + _this.offset + " " + (A.S(source == null ? "unknown source" : source) + ":" + (_this.line + 1) + ":" + (_this.column + 1)) + ">"; + }, + $isComparable: 1, + get$sourceUrl(receiver) { + return this.sourceUrl; + }, + get$offset() { + return this.offset; + }, + get$line() { + return this.line; + }, + get$column() { + return this.column; + } + }; + A.SourceLocationMixin.prototype = { + distance$1(other) { + if (!J.$eq$(this.file.url, other.get$sourceUrl(other))) + throw A.wrapException(A.ArgumentError$('Source URLs "' + A.S(this.get$sourceUrl(0)) + '" and "' + A.S(other.get$sourceUrl(other)) + "\" don't match.", null)); + return Math.abs(this.offset - other.get$offset()); + }, + compareTo$1(_, other) { + if (!J.$eq$(this.file.url, other.get$sourceUrl(other))) + throw A.wrapException(A.ArgumentError$('Source URLs "' + A.S(this.get$sourceUrl(0)) + '" and "' + A.S(other.get$sourceUrl(other)) + "\" don't match.", null)); + return this.offset - other.get$offset(); + }, + $eq(_, other) { + if (other == null) + return false; + return type$.SourceLocation._is(other) && J.$eq$(this.file.url, other.get$sourceUrl(other)) && this.offset === other.get$offset(); + }, + get$hashCode(_) { + var t1 = this.file.url; + t1 = t1 == null ? null : t1.get$hashCode(t1); + if (t1 == null) + t1 = 0; + return t1 + this.offset; + }, + toString$0(_) { + var t1 = A.getRuntimeTypeOfDartObject(this).toString$0(0), + t2 = this.offset, + t3 = this.file, + source = t3.url; + return "<" + t1 + ": " + t2 + " " + (A.S(source == null ? "unknown source" : source) + ":" + (t3.getLine$1(t2) + 1) + ":" + (t3.getColumn$1(t2) + 1)) + ">"; + }, + $isComparable: 1, + $isSourceLocation: 1 + }; + A.SourceSpanBase.prototype = { + SourceSpanBase$3(start, end, text) { + var t3, + t1 = this.end, + t2 = this.start; + if (!J.$eq$(t1.get$sourceUrl(t1), t2.get$sourceUrl(t2))) + throw A.wrapException(A.ArgumentError$('Source URLs "' + A.S(t2.get$sourceUrl(t2)) + '" and "' + A.S(t1.get$sourceUrl(t1)) + "\" don't match.", null)); + else if (t1.get$offset() < t2.get$offset()) + throw A.wrapException(A.ArgumentError$("End " + t1.toString$0(0) + " must come after start " + t2.toString$0(0) + ".", null)); + else { + t3 = this.text; + if (t3.length !== t2.distance$1(t1)) + throw A.wrapException(A.ArgumentError$('Text "' + t3 + '" must be ' + t2.distance$1(t1) + " characters long.", null)); + } + }, + get$start(receiver) { + return this.start; + }, + get$end(receiver) { + return this.end; + }, + get$text() { + return this.text; + } + }; + A.SourceSpanException.prototype = { + get$message(_) { + return this._span_exception$_message; + }, + get$span(_) { + return this._span; + }, + toString$1$color(_, color) { + var _this = this; + _this.get$span(_this); + return "Error on " + _this.get$span(_this).message$2$color(0, _this._span_exception$_message, color); + }, + toString$0(_) { + return this.toString$1$color(0, null); + }, + $isException: 1 + }; + A.SourceSpanFormatException.prototype = {$isFormatException: 1, + get$source() { + return this.source; + } + }; + A.MultiSourceSpanException.prototype = { + toString$0(_) { + var _this = this; + return "Error on " + A.SourceSpanExtension_messageMultiple(_this._span, _this._span_exception$_message, _this.primaryLabel, _this.secondarySpans, false, null, null); + }, + get$primaryLabel() { + return this.primaryLabel; + }, + get$secondarySpans() { + return this.secondarySpans; + } + }; + A.MultiSourceSpanFormatException.prototype = {$isFormatException: 1}; + A.SourceSpanMixin.prototype = { + get$sourceUrl(_) { + var t1 = this.get$start(this); + return t1.get$sourceUrl(t1); + }, + get$length(_) { + var _this = this; + return _this.get$end(_this).get$offset() - _this.get$start(_this).get$offset(); + }, + compareTo$1(_, other) { + var _this = this, + result = _this.get$start(_this).compareTo$1(0, other.get$start(other)); + return result === 0 ? _this.get$end(_this).compareTo$1(0, other.get$end(other)) : result; + }, + message$2$color(_, message, color) { + var t2, t3, highlight, _this = this, + t1 = "" + ("line " + (_this.get$start(_this).get$line() + 1) + ", column " + (_this.get$start(_this).get$column() + 1)); + if (_this.get$sourceUrl(_this) != null) { + t2 = _this.get$sourceUrl(_this); + t3 = $.$get$context(); + t2.toString; + t2 = t1 + (" of " + t3.prettyUri$1(t2)); + t1 = t2; + } + t1 += ": " + message; + highlight = _this.highlight$1$color(color); + if (highlight.length !== 0) + t1 = t1 + "\n" + highlight; + return t1.charCodeAt(0) == 0 ? t1 : t1; + }, + message$1(_, message) { + return this.message$2$color(0, message, null); + }, + highlight$1$color(color) { + var _this = this; + if (!type$.SourceSpanWithContext._is(_this) && _this.get$length(_this) === 0) + return ""; + return A.Highlighter$(_this, color).highlight$0(); + }, + $eq(_, other) { + var _this = this; + if (other == null) + return false; + return type$.SourceSpan._is(other) && _this.get$start(_this).$eq(0, other.get$start(other)) && _this.get$end(_this).$eq(0, other.get$end(other)); + }, + get$hashCode(_) { + var _this = this; + return A.Object_hash(_this.get$start(_this), _this.get$end(_this), B.C_SentinelValue, B.C_SentinelValue); + }, + toString$0(_) { + var _this = this; + return "<" + A.getRuntimeTypeOfDartObject(_this).toString$0(0) + ": from " + _this.get$start(_this).toString$0(0) + " to " + _this.get$end(_this).toString$0(0) + ' "' + _this.get$text() + '">'; + }, + $isComparable: 1, + $isSourceSpan: 1 + }; + A.SourceSpanWithContext.prototype = { + get$context(_) { + return this._context; + } + }; + A.Chain.prototype = { + toTrace$0() { + var t1 = this.traces; + return A.Trace$(new A.ExpandIterable(t1, new A.Chain_toTrace_closure(), A._arrayInstanceType(t1)._eval$1("ExpandIterable<1,Frame>")), null); + }, + toString$0(_) { + var t1 = this.traces, + t2 = A._arrayInstanceType(t1); + return new A.MappedListIterable(t1, new A.Chain_toString_closure(new A.MappedListIterable(t1, new A.Chain_toString_closure0(), t2._eval$1("MappedListIterable<1,int>")).fold$2(0, 0, B.CONSTANT)), t2._eval$1("MappedListIterable<1,String>")).join$1(0, string$.x3d_____); + }, + $isStackTrace: 1 + }; + A.Chain_Chain$parse_closure.prototype = { + call$1(line) { + return line.length !== 0; + }, + $signature: 4 + }; + A.Chain_toTrace_closure.prototype = { + call$1(trace) { + return trace.get$frames(); + }, + $signature: 284 + }; + A.Chain_toString_closure0.prototype = { + call$1(trace) { + var t1 = trace.get$frames(); + return new A.MappedListIterable(t1, new A.Chain_toString__closure0(), A._arrayInstanceType(t1)._eval$1("MappedListIterable<1,int>")).fold$2(0, 0, B.CONSTANT); + }, + $signature: 285 + }; + A.Chain_toString__closure0.prototype = { + call$1(frame) { + return frame.get$location().length; + }, + $signature: 265 + }; + A.Chain_toString_closure.prototype = { + call$1(trace) { + var t1 = trace.get$frames(); + return new A.MappedListIterable(t1, new A.Chain_toString__closure(this.longest), A._arrayInstanceType(t1)._eval$1("MappedListIterable<1,String>")).join$0(0); + }, + $signature: 287 + }; + A.Chain_toString__closure.prototype = { + call$1(frame) { + return B.JSString_methods.padRight$1(frame.get$location(), this.longest) + " " + A.S(frame.get$member()) + "\n"; + }, + $signature: 264 + }; + A.Frame.prototype = { + get$isCore() { + return this.uri.get$scheme() === "dart"; + }, + get$library() { + var t1 = this.uri; + if (t1.get$scheme() === "data") + return "data:..."; + return $.$get$context().prettyUri$1(t1); + }, + get$$package() { + var t1 = this.uri; + if (t1.get$scheme() !== "package") + return null; + return B.JSArray_methods.get$first(t1.get$path(t1).split("/")); + }, + get$location() { + var t2, _this = this, + t1 = _this.line; + if (t1 == null) + return _this.get$library(); + t2 = _this.column; + if (t2 == null) + return _this.get$library() + " " + A.S(t1); + return _this.get$library() + " " + A.S(t1) + ":" + A.S(t2); + }, + toString$0(_) { + return this.get$location() + " in " + A.S(this.member); + }, + get$uri() { + return this.uri; + }, + get$line() { + return this.line; + }, + get$column() { + return this.column; + }, + get$member() { + return this.member; + } + }; + A.Frame_Frame$parseVM_closure.prototype = { + call$0() { + var match, t2, t3, member, uri, lineAndColumn, line, _null = null, + t1 = this.frame; + if (t1 === "...") + return new A.Frame(A._Uri__Uri(_null, _null, _null, _null), _null, _null, "..."); + match = $.$get$_vmFrame().firstMatch$1(t1); + if (match == null) + return new A.UnparsedFrame(A._Uri__Uri(_null, "unparsed", _null, _null), t1); + t1 = match._match; + t2 = t1[1]; + t2.toString; + t3 = $.$get$_asyncBody(); + t2 = A.stringReplaceAllUnchecked(t2, t3, ""); + member = A.stringReplaceAllUnchecked(t2, "", ""); + t2 = t1[2]; + t3 = t2; + t3.toString; + if (B.JSString_methods.startsWith$1(t3, " 1 ? A.int_parse(lineAndColumn[1], _null) : _null; + return new A.Frame(uri, line, t1 > 2 ? A.int_parse(lineAndColumn[2], _null) : _null, member); + }, + $signature: 77 + }; + A.Frame_Frame$parseV8_closure.prototype = { + call$0() { + var t2, t3, _s4_ = "", + t1 = this.frame, + match = $.$get$_v8Frame().firstMatch$1(t1); + if (match == null) + return new A.UnparsedFrame(A._Uri__Uri(null, "unparsed", null, null), t1); + t1 = new A.Frame_Frame$parseV8_closure_parseLocation(t1); + t2 = match._match; + t3 = t2[2]; + if (t3 != null) { + t3 = t3; + t3.toString; + t2 = t2[1]; + t2.toString; + t2 = A.stringReplaceAllUnchecked(t2, "", _s4_); + t2 = A.stringReplaceAllUnchecked(t2, "Anonymous function", _s4_); + return t1.call$2(t3, A.stringReplaceAllUnchecked(t2, "(anonymous function)", _s4_)); + } else { + t2 = t2[3]; + t2.toString; + return t1.call$2(t2, _s4_); + } + }, + $signature: 77 + }; + A.Frame_Frame$parseV8_closure_parseLocation.prototype = { + call$2($location, member) { + var t2, urlMatch, uri, line, columnMatch, _null = null, + t1 = $.$get$_v8EvalLocation(), + evalMatch = t1.firstMatch$1($location); + for (; evalMatch != null; $location = t2) { + t2 = evalMatch._match[1]; + t2.toString; + evalMatch = t1.firstMatch$1(t2); + } + if ($location === "native") + return new A.Frame(A.Uri_parse("native"), _null, _null, member); + urlMatch = $.$get$_v8UrlLocation().firstMatch$1($location); + if (urlMatch == null) + return new A.UnparsedFrame(A._Uri__Uri(_null, "unparsed", _null, _null), this.frame); + t1 = urlMatch._match; + t2 = t1[1]; + t2.toString; + uri = A.Frame__uriOrPathToUri(t2); + t2 = t1[2]; + t2.toString; + line = A.int_parse(t2, _null); + columnMatch = t1[3]; + return new A.Frame(uri, line, columnMatch != null ? A.int_parse(columnMatch, _null) : _null, member); + }, + $signature: 290 + }; + A.Frame_Frame$_parseFirefoxEval_closure.prototype = { + call$0() { + var t2, member, uri, line, _null = null, + t1 = this.frame, + match = $.$get$_firefoxEvalLocation().firstMatch$1(t1); + if (match == null) + return new A.UnparsedFrame(A._Uri__Uri(_null, "unparsed", _null, _null), t1); + t1 = match._match; + t2 = t1[1]; + t2.toString; + member = A.stringReplaceAllUnchecked(t2, "/<", ""); + t2 = t1[2]; + t2.toString; + uri = A.Frame__uriOrPathToUri(t2); + t1 = t1[3]; + t1.toString; + line = A.int_parse(t1, _null); + return new A.Frame(uri, line, _null, member.length === 0 || member === "anonymous" ? "" : member); + }, + $signature: 77 + }; + A.Frame_Frame$parseFirefox_closure.prototype = { + call$0() { + var t2, t3, t4, uri, member, line, column, _null = null, + t1 = this.frame, + match = $.$get$_firefoxSafariFrame().firstMatch$1(t1); + if (match == null) + return new A.UnparsedFrame(A._Uri__Uri(_null, "unparsed", _null, _null), t1); + t2 = match._match; + t3 = t2[3]; + t4 = t3; + t4.toString; + if (B.JSString_methods.contains$1(t4, " line ")) + return A.Frame_Frame$_parseFirefoxEval(t1); + t1 = t3; + t1.toString; + uri = A.Frame__uriOrPathToUri(t1); + member = t2[1]; + if (member != null) { + t1 = t2[2]; + t1.toString; + member += B.JSArray_methods.join$0(A.List_List$filled(B.JSString_methods.allMatches$1("/", t1).get$length(0), ".", false, type$.String)); + if (member === "") + member = ""; + member = B.JSString_methods.replaceFirst$2(member, $.$get$_initialDot(), ""); + } else + member = ""; + t1 = t2[4]; + if (t1 === "") + line = _null; + else { + t1 = t1; + t1.toString; + line = A.int_parse(t1, _null); + } + t1 = t2[5]; + if (t1 == null || t1 === "") + column = _null; + else { + t1 = t1; + t1.toString; + column = A.int_parse(t1, _null); + } + return new A.Frame(uri, line, column, member); + }, + $signature: 77 + }; + A.Frame_Frame$parseFriendly_closure.prototype = { + call$0() { + var t2, uri, line, column, _null = null, + t1 = this.frame, + match = $.$get$_friendlyFrame().firstMatch$1(t1); + if (match == null) + throw A.wrapException(A.FormatException$("Couldn't parse package:stack_trace stack trace line '" + t1 + "'.", _null, _null)); + t1 = match._match; + t2 = t1[1]; + if (t2 === "data:...") + uri = A.Uri_Uri$dataFromString("", _null, _null); + else { + t2 = t2; + t2.toString; + uri = A.Uri_parse(t2); + } + if (uri.get$scheme() === "") { + t2 = $.$get$context(); + uri = t2.toUri$1(A.absolute(t2.style.pathFromUri$1(A._parseUri(uri)), _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null)); + } + t2 = t1[2]; + if (t2 == null) + line = _null; + else { + t2 = t2; + t2.toString; + line = A.int_parse(t2, _null); + } + t2 = t1[3]; + if (t2 == null) + column = _null; + else { + t2 = t2; + t2.toString; + column = A.int_parse(t2, _null); + } + return new A.Frame(uri, line, column, t1[4]); + }, + $signature: 77 + }; + A.LazyTrace.prototype = { + get$_lazy_trace$_trace() { + var result, _this = this, + value = _this.__LazyTrace__trace_FI; + if (value === $) { + result = _this._thunk.call$0(); + _this.__LazyTrace__trace_FI !== $ && A.throwUnnamedLateFieldADI(); + _this.__LazyTrace__trace_FI = result; + value = result; + } + return value; + }, + get$frames() { + return this.get$_lazy_trace$_trace().get$frames(); + }, + get$terse() { + return new A.LazyTrace(new A.LazyTrace_terse_closure(this)); + }, + toString$0(_) { + return this.get$_lazy_trace$_trace().toString$0(0); + }, + $isStackTrace: 1, + $isTrace: 1 + }; + A.LazyTrace_terse_closure.prototype = { + call$0() { + return this.$this.get$_lazy_trace$_trace().get$terse(); + }, + $signature: 261 + }; + A.Trace.prototype = { + get$terse() { + return this.foldFrames$2$terse(new A.Trace_terse_closure(), true); + }, + foldFrames$2$terse(predicate, terse) { + var newFrames, t1, t2, t3, _box_0 = {}; + _box_0.predicate = predicate; + _box_0.predicate = new A.Trace_foldFrames_closure(predicate); + newFrames = A._setArrayType([], type$.JSArray_Frame); + for (t1 = this.frames, t2 = A._arrayInstanceType(t1)._eval$1("ReversedListIterable<1>"), t1 = new A.ReversedListIterable(t1, t2), t1 = new A.ListIterator(t1, t1.get$length(0), t2._eval$1("ListIterator")), t2 = t2._eval$1("ListIterable.E"); t1.moveNext$0();) { + t3 = t1.__internal$_current; + if (t3 == null) + t3 = t2._as(t3); + if (t3 instanceof A.UnparsedFrame || !_box_0.predicate.call$1(t3)) + newFrames.push(t3); + else if (newFrames.length === 0 || !_box_0.predicate.call$1(B.JSArray_methods.get$last(newFrames))) + newFrames.push(new A.Frame(t3.get$uri(), t3.get$line(), t3.get$column(), t3.get$member())); + } + t1 = type$.MappedListIterable_Frame_Frame; + newFrames = A.List_List$of(new A.MappedListIterable(newFrames, new A.Trace_foldFrames_closure0(_box_0), t1), true, t1._eval$1("ListIterable.E")); + if (newFrames.length > 1 && _box_0.predicate.call$1(B.JSArray_methods.get$first(newFrames))) + B.JSArray_methods.removeAt$1(newFrames, 0); + return A.Trace$(new A.ReversedListIterable(newFrames, A._arrayInstanceType(newFrames)._eval$1("ReversedListIterable<1>")), this.original._stackTrace); + }, + toString$0(_) { + var t1 = this.frames, + t2 = A._arrayInstanceType(t1); + return new A.MappedListIterable(t1, new A.Trace_toString_closure(new A.MappedListIterable(t1, new A.Trace_toString_closure0(), t2._eval$1("MappedListIterable<1,int>")).fold$2(0, 0, B.CONSTANT)), t2._eval$1("MappedListIterable<1,String>")).join$0(0); + }, + $isStackTrace: 1, + get$frames() { + return this.frames; + } + }; + A.Trace_Trace$from_closure.prototype = { + call$0() { + return A.Trace_Trace$parse(this.trace.toString$0(0)); + }, + $signature: 261 + }; + A.Trace__parseVM_closure.prototype = { + call$1(line) { + return line.length !== 0; + }, + $signature: 4 + }; + A.Trace$parseV8_closure.prototype = { + call$1(line) { + return !B.JSString_methods.startsWith$1(line, $.$get$_v8TraceLine()); + }, + $signature: 4 + }; + A.Trace$parseJSCore_closure.prototype = { + call$1(line) { + return line !== "\tat "; + }, + $signature: 4 + }; + A.Trace$parseFirefox_closure.prototype = { + call$1(line) { + return line.length !== 0 && line !== "[native code]"; + }, + $signature: 4 + }; + A.Trace$parseFriendly_closure.prototype = { + call$1(line) { + return !B.JSString_methods.startsWith$1(line, "====="); + }, + $signature: 4 + }; + A.Trace_terse_closure.prototype = { + call$1(_) { + return false; + }, + $signature: 259 + }; + A.Trace_foldFrames_closure.prototype = { + call$1(frame) { + var t1; + if (this.oldPredicate.call$1(frame)) + return true; + if (frame.get$isCore()) + return true; + if (frame.get$$package() === "stack_trace") + return true; + t1 = frame.get$member(); + t1.toString; + if (!B.JSString_methods.contains$1(t1, "")) + return false; + return frame.get$line() == null; + }, + $signature: 259 + }; + A.Trace_foldFrames_closure0.prototype = { + call$1(frame) { + var t1, t2; + if (frame instanceof A.UnparsedFrame || !this._box_0.predicate.call$1(frame)) + return frame; + t1 = frame.get$library(); + t2 = $.$get$_terseRegExp(); + return new A.Frame(A.Uri_parse(A.stringReplaceAllUnchecked(t1, t2, "")), null, null, frame.get$member()); + }, + $signature: 293 + }; + A.Trace_toString_closure0.prototype = { + call$1(frame) { + return frame.get$location().length; + }, + $signature: 265 + }; + A.Trace_toString_closure.prototype = { + call$1(frame) { + if (frame instanceof A.UnparsedFrame) + return frame.toString$0(0) + "\n"; + return B.JSString_methods.padRight$1(frame.get$location(), this.longest) + " " + A.S(frame.get$member()) + "\n"; + }, + $signature: 264 + }; + A.UnparsedFrame.prototype = { + toString$0(_) { + return this.member; + }, + $isFrame: 1, + get$uri() { + return this.uri; + }, + get$line() { + return null; + }, + get$column() { + return null; + }, + get$isCore() { + return false; + }, + get$library() { + return "unparsed"; + }, + get$$package() { + return null; + }, + get$location() { + return "unparsed"; + }, + get$member() { + return this.member; + } + }; + A.TransformByHandlers_transformByHandlers_closure.prototype = { + call$0() { + var t2, subscription, t3, t4, _this = this, t1 = {}; + t1.valuesDone = false; + t2 = _this.controller; + subscription = _this._this.listen$3$onDone$onError(0, new A.TransformByHandlers_transformByHandlers__closure(_this.handleData, t2, _this.S), new A.TransformByHandlers_transformByHandlers__closure0(t1, _this.handleDone, t2), new A.TransformByHandlers_transformByHandlers__closure1(_this.handleError, t2)); + t3 = _this._box_1; + t3.subscription = subscription; + t2.set$onPause(subscription.get$pause(subscription)); + t4 = t3.subscription; + t2.set$onResume(t4.get$resume(t4)); + t2.set$onCancel(new A.TransformByHandlers_transformByHandlers__closure2(t3, t1)); + }, + $signature: 0 + }; + A.TransformByHandlers_transformByHandlers__closure.prototype = { + call$1(value) { + return this.handleData.call$2(value, this.controller); + }, + $signature() { + return this.S._eval$1("~(0)"); + } + }; + A.TransformByHandlers_transformByHandlers__closure1.prototype = { + call$2(error, stackTrace) { + this.handleError.call$3(error, stackTrace, this.controller); + }, + $signature: 53 + }; + A.TransformByHandlers_transformByHandlers__closure0.prototype = { + call$0() { + this._box_0.valuesDone = true; + this.handleDone.call$1(this.controller); + }, + $signature: 0 + }; + A.TransformByHandlers_transformByHandlers__closure2.prototype = { + call$0() { + var t1 = this._box_1, + toCancel = t1.subscription; + t1.subscription = null; + if (!this._box_0.valuesDone) + return toCancel.cancel$0(); + return null; + }, + $signature: 253 + }; + A.RateLimit__debounceAggregate_closure.prototype = { + call$2(value, sink) { + var _this = this, + t1 = _this._box_0, + t2 = new A.RateLimit__debounceAggregate_closure_emit(t1, sink, _this.S), + t3 = t1.timer; + if (t3 != null) + t3.cancel$0(); + t1.soFar = _this.collect.call$2(value, t1.soFar); + t1.hasPending = true; + if (t1.timer == null && _this.leading) { + t1.emittedLatestAsLeading = true; + t2.call$0(); + } else + t1.emittedLatestAsLeading = false; + t1.timer = A.Timer_Timer(_this.duration, new A.RateLimit__debounceAggregate__closure(t1, _this.trailing, t2, sink)); + }, + $signature() { + return this.T._eval$1("@<0>")._bind$1(this.S)._eval$1("~(1,EventSink<2>)"); + } + }; + A.RateLimit__debounceAggregate_closure_emit.prototype = { + call$0() { + var t1 = this._box_0, + t2 = t1.soFar; + if (t2 == null) + t2 = this.S._as(t2); + this.sink.add$1(0, t2); + t1.soFar = null; + t1.hasPending = false; + }, + $signature: 0 + }; + A.RateLimit__debounceAggregate__closure.prototype = { + call$0() { + var t1 = this._box_0, + t2 = t1.emittedLatestAsLeading; + if (!t2) + this.emit.call$0(); + if (t1.shouldClose) + this.sink.close$0(0); + t1.timer = null; + }, + $signature: 0 + }; + A.RateLimit__debounceAggregate_closure0.prototype = { + call$1(sink) { + var t1 = this._box_0; + if (t1.hasPending && this.trailing) + t1.shouldClose = true; + else { + t1 = t1.timer; + if (t1 != null) + t1.cancel$0(); + sink.close$0(0); + } + }, + $signature() { + return this.S._eval$1("~(EventSink<0>)"); + } + }; + A.StringScannerException.prototype = { + get$source() { + return A._asString(this.source); + } + }; + A.LineScanner.prototype = { + scanChar$1(character) { + if (!this.super$StringScanner$scanChar(character)) + return false; + this._adjustLineAndColumn$1(character); + return true; + }, + _adjustLineAndColumn$1(character) { + var t1, _this = this; + if (character !== 10) + t1 = character === 13 && _this.peekChar$0() !== 10; + else + t1 = true; + if (t1) { + ++_this._line_scanner$_line; + _this._line_scanner$_column = 0; + } else { + t1 = _this._line_scanner$_column; + _this._line_scanner$_column = t1 + (character >= 65536 && character <= 1114111 ? 2 : 1); + } + }, + scan$1(pattern) { + var t1, newlines, t2, _this = this; + if (!_this.super$StringScanner$scan(pattern)) + return false; + t1 = _this.get$lastMatch(); + newlines = _this._newlinesIn$1(t1.pattern); + t1 = _this._line_scanner$_line; + t2 = newlines.length; + _this._line_scanner$_line = t1 + t2; + if (t2 === 0) { + t1 = _this._line_scanner$_column; + t2 = _this.get$lastMatch(); + _this._line_scanner$_column = t1 + t2.pattern.length; + } else { + t1 = _this.get$lastMatch(); + _this._line_scanner$_column = t1.pattern.length - J.get$end$z(B.JSArray_methods.get$last(newlines)); + } + return true; + }, + _newlinesIn$1(text) { + var t1 = $.$get$_newlineRegExp().allMatches$1(0, text), + newlines = A.List_List$of(t1, true, A._instanceType(t1)._eval$1("Iterable.E")); + if (this.peekChar$1(-1) === 13 && this.peekChar$0() === 10) + B.JSArray_methods.removeLast$0(newlines); + return newlines; + } + }; + A.SpanScanner.prototype = { + set$state(state) { + if (state._scanner !== this) + throw A.wrapException(A.ArgumentError$(string$.The_gi, null)); + this.set$position(state.position); + }, + spanFrom$2(startState, endState) { + var endPosition = endState == null ? this._string_scanner$_position : endState.position; + return this._sourceFile.span$2(0, startState.position, endPosition); + }, + spanFrom$1(startState) { + return this.spanFrom$2(startState, null); + }, + matches$1(pattern) { + var t1, t2, _this = this; + if (!_this.super$StringScanner$matches(pattern)) + return false; + t1 = _this._string_scanner$_position; + t2 = _this.get$lastMatch(); + _this._sourceFile.span$2(0, t1, t2.start + t2.pattern.length); + return true; + }, + error$3$length$position(_, message, $length, position) { + var match, t2, _this = this, + t1 = _this.string; + A.validateErrorArgs(t1, null, position, $length); + match = position == null && $length == null ? _this.get$lastMatch() : null; + if (position == null) + position = match == null ? _this._string_scanner$_position : match.start; + if ($length == null) + if (match == null) + $length = 0; + else { + t2 = match.start; + $length = t2 + match.pattern.length - t2; + } + throw A.wrapException(A.StringScannerException$(message, _this._sourceFile.span$2(0, position, position + $length), t1)); + }, + error$1(_, message) { + return this.error$3$length$position(0, message, null, null); + }, + error$2$position(_, message, position) { + return this.error$3$length$position(0, message, null, position); + }, + error$2$length(_, message, $length) { + return this.error$3$length$position(0, message, $length, null); + } + }; + A._SpanScannerState.prototype = {}; + A.StringScanner.prototype = { + set$position(position) { + if (B.JSInt_methods.get$isNegative(position) || position > this.string.length) + throw A.wrapException(A.ArgumentError$("Invalid position " + position, null)); + this._string_scanner$_position = position; + this._lastMatch = null; + }, + get$lastMatch() { + var _this = this; + if (_this._string_scanner$_position !== _this._lastMatchPosition) + _this._lastMatch = null; + return _this._lastMatch; + }, + readChar$0() { + var _this = this, + t1 = _this.string; + if (_this._string_scanner$_position === t1.length) + _this._fail$1("more input"); + return t1.charCodeAt(_this._string_scanner$_position++); + }, + peekChar$1(offset) { + var index; + if (offset == null) + offset = 0; + index = this._string_scanner$_position + offset; + if (index < 0 || index >= this.string.length) + return null; + return this.string.charCodeAt(index); + }, + peekChar$0() { + return this.peekChar$1(null); + }, + scanChar$1(character) { + var t1, t2, t3, t4, _this = this; + if (character >= 65536 && character <= 1114111) { + t1 = _this._string_scanner$_position; + t2 = t1 + 1; + t3 = _this.string; + if (t2 < t3.length) { + t4 = character - 65536; + t2 = t3.charCodeAt(t1) !== B.JSInt_methods._shrOtherPositive$1(t4, 10) + 55296 || t3.charCodeAt(t2) !== (t4 & 1023) + 56320; + } else + t2 = true; + if (t2) + return false; + else { + _this._string_scanner$_position = t1 + 2; + return true; + } + } else { + t1 = _this._string_scanner$_position; + t2 = _this.string; + if (t1 === t2.length) + return false; + if (t2.charCodeAt(t1) !== character) + return false; + _this._string_scanner$_position = t1 + 1; + return true; + } + }, + expectChar$2$name(character, $name) { + if (this.scanChar$1(character)) + return; + if ($name == null) + if (character === 92) + $name = '"\\"'; + else + $name = character === 34 ? '"\\""' : '"' + A.Primitives_stringFromCharCode(character) + '"'; + this._fail$1($name); + }, + expectChar$1(character) { + return this.expectChar$2$name(character, null); + }, + scan$1(pattern) { + var t1, _this = this, + success = _this.matches$1(pattern); + if (success) { + t1 = _this._lastMatch; + _this._lastMatchPosition = _this._string_scanner$_position = t1.start + t1.pattern.length; + } + return success; + }, + expect$1(pattern) { + var t1, $name; + if (this.scan$1(pattern)) + return; + t1 = A.stringReplaceAllUnchecked(pattern, "\\", "\\\\"); + $name = '"' + A.stringReplaceAllUnchecked(t1, '"', '\\"') + '"'; + this._fail$1($name); + }, + expectDone$0() { + if (this._string_scanner$_position === this.string.length) + return; + this._fail$1("no more input"); + }, + matches$1(pattern) { + var _this = this, + t1 = B.JSString_methods.matchAsPrefix$2(pattern, _this.string, _this._string_scanner$_position); + _this._lastMatch = t1; + _this._lastMatchPosition = _this._string_scanner$_position; + return t1 != null; + }, + substring$1(_, start) { + var end = this._string_scanner$_position; + return B.JSString_methods.substring$2(this.string, start, end); + }, + error$3$length$position(_, message, $length, position) { + var t1 = this.string; + A.validateErrorArgs(t1, null, position, $length); + throw A.wrapException(A.StringScannerException$(message, A.SourceFile$fromString(t1, this.sourceUrl).span$2(0, position, position + $length), t1)); + }, + _fail$1($name) { + this.error$3$length$position(0, "expected " + $name + ".", 0, this._string_scanner$_position); + } + }; + A.AsciiGlyphSet.prototype = { + glyphOrAscii$2(glyph, alternative) { + return alternative; + }, + get$horizontalLine() { + return "-"; + }, + get$verticalLine() { + return "|"; + }, + get$topLeftCorner() { + return ","; + }, + get$bottomLeftCorner() { + return "'"; + }, + get$cross() { + return "+"; + }, + get$upEnd() { + return "'"; + }, + get$downEnd() { + return ","; + }, + get$horizontalLineBold() { + return "="; + } + }; + A.UnicodeGlyphSet.prototype = { + glyphOrAscii$2(glyph, alternative) { + return glyph; + }, + get$horizontalLine() { + return "\u2500"; + }, + get$verticalLine() { + return "\u2502"; + }, + get$topLeftCorner() { + return "\u250c"; + }, + get$bottomLeftCorner() { + return "\u2514"; + }, + get$cross() { + return "\u253c"; + }, + get$upEnd() { + return "\u2575"; + }, + get$downEnd() { + return "\u2577"; + }, + get$horizontalLineBold() { + return "\u2501"; + } + }; + A.WatchEvent.prototype = { + toString$0(_) { + return this.type.toString$0(0) + " " + this.path; + } + }; + A.ChangeType.prototype = { + toString$0(_) { + return this._watch_event$_name; + } + }; + A.AnySelectorVisitor0.prototype = { + visitComplexSelector$1(complex) { + return B.JSArray_methods.any$1(complex.components, new A.AnySelectorVisitor_visitComplexSelector_closure0(this)); + }, + visitCompoundSelector$1(compound) { + return B.JSArray_methods.any$1(compound.components, new A.AnySelectorVisitor_visitCompoundSelector_closure0(this)); + }, + visitPseudoSelector$1(pseudo) { + var selector = pseudo.selector; + return selector == null ? false : this.visitSelectorList$1(selector); + }, + visitSelectorList$1(list) { + return B.JSArray_methods.any$1(list.components, this.get$visitComplexSelector()); + }, + visitAttributeSelector$1(attribute) { + return false; + }, + visitClassSelector$1(klass) { + return false; + }, + visitIDSelector$1(id) { + return false; + }, + visitParentSelector$1($parent) { + return false; + }, + visitPlaceholderSelector$1(placeholder) { + return false; + }, + visitTypeSelector$1(type) { + return false; + }, + visitUniversalSelector$1(universal) { + return false; + } + }; + A.AnySelectorVisitor_visitComplexSelector_closure0.prototype = { + call$1(component) { + return this.$this.visitCompoundSelector$1(component.selector); + }, + $signature: 51 + }; + A.AnySelectorVisitor_visitCompoundSelector_closure0.prototype = { + call$1(simple) { + return simple.accept$1(this.$this); + }, + $signature: 14 + }; + A.SupportsAnything0.prototype = { + toString$0(_) { + return "(" + this.contents.toString$0(0) + ")"; + }, + $isAstNode0: 1, + get$span(receiver) { + return this.span; + } + }; + A.Argument0.prototype = { + toString$0(_) { + var t1 = this.defaultValue, + t2 = this.name; + return t1 == null ? t2 : t2 + ": " + t1.toString$0(0); + }, + $isAstNode0: 1, + get$span(receiver) { + return this.span; + } + }; + A.ArgumentDeclaration0.prototype = { + get$spanWithName() { + var t3, t4, + t1 = this.span, + t2 = t1.file, + text = A.String_String$fromCharCodes(B.NativeUint32List_methods.sublist$2(t2._decodedChars, 0, null), 0, null), + i = A.FileLocation$_(t2, t1._file$_start).offset - 1; + while (true) { + if (i > 0) { + t3 = text.charCodeAt(i); + t3 = t3 === 32 || t3 === 9 || t3 === 10 || t3 === 13 || t3 === 12; + } else + t3 = false; + if (!t3) + break; + --i; + } + t3 = text.charCodeAt(i); + if (!(t3 === 95 || A.CharacterExtension_get_isAlphabetic0(t3) || t3 >= 128)) + t3 = t3 >= 48 && t3 <= 57 || t3 === 45; + else + t3 = true; + if (!t3) + return t1; + --i; + while (true) { + if (i >= 0) { + t3 = text.charCodeAt(i); + if (t3 !== 95) { + if (!(t3 >= 97 && t3 <= 122)) + t4 = t3 >= 65 && t3 <= 90; + else + t4 = true; + t4 = t4 || t3 >= 128; + } else + t4 = true; + if (!t4) + t3 = t3 >= 48 && t3 <= 57 || t3 === 45; + else + t3 = true; + } else + t3 = false; + if (!t3) + break; + --i; + } + t3 = i + 1; + t4 = text.charCodeAt(t3); + if (!(t4 === 95 || A.CharacterExtension_get_isAlphabetic0(t4) || t4 >= 128)) + return t1; + return A.SpanExtensions_trimRight0(A.SpanExtensions_trimLeft0(t2.span$2(0, t3, A.FileLocation$_(t2, t1._end).offset))); + }, + verify$2(positional, names) { + var t1, t2, t3, namedUsed, i, argument, t4, unknownNames, _this = this, + _s10_ = "invocation", + _s8_ = "argument"; + for (t1 = _this.$arguments, t2 = t1.length, t3 = names._baseMap, namedUsed = 0, i = 0; i < t2; ++i) { + argument = t1[i]; + if (i < positional) { + t4 = argument.name; + if (t3.containsKey$1(t4)) + throw A.wrapException(A.SassScriptException$0("Argument " + _this._argument_declaration$_originalArgumentName$1(t4) + string$.x20was_p, null)); + } else { + t4 = argument.name; + if (t3.containsKey$1(t4)) + ++namedUsed; + else if (argument.defaultValue == null) + throw A.wrapException(A.MultiSpanSassScriptException$0("Missing argument " + _this._argument_declaration$_originalArgumentName$1(t4) + ".", _s10_, A.LinkedHashMap_LinkedHashMap$_literal([_this.get$spanWithName(), "declaration"], type$.FileSpan, type$.String))); + } + } + if (_this.restArgument != null) + return; + if (positional > t2) { + t1 = names.get$isEmpty(0) ? "" : "positional "; + throw A.wrapException(A.MultiSpanSassScriptException$0("Only " + t2 + " " + t1 + A.pluralize0(_s8_, t2, null) + " allowed, but " + positional + " " + A.pluralize0("was", positional, "were") + " passed.", _s10_, A.LinkedHashMap_LinkedHashMap$_literal([_this.get$spanWithName(), "declaration"], type$.FileSpan, type$.String))); + } + if (namedUsed < t3.get$length(t3)) { + t2 = type$.String; + unknownNames = A.LinkedHashSet_LinkedHashSet$of(names, t2); + unknownNames.removeAll$1(new A.MappedListIterable(t1, new A.ArgumentDeclaration_verify_closure1(), A._arrayInstanceType(t1)._eval$1("MappedListIterable<1,Object?>"))); + throw A.wrapException(A.MultiSpanSassScriptException$0("No " + A.pluralize0(_s8_, unknownNames._collection$_length, null) + " named " + A.toSentence0(unknownNames.map$1$1(0, new A.ArgumentDeclaration_verify_closure2(), type$.Object), "or") + ".", _s10_, A.LinkedHashMap_LinkedHashMap$_literal([_this.get$spanWithName(), "declaration"], type$.FileSpan, t2))); + } + }, + _argument_declaration$_originalArgumentName$1($name) { + var t1, text, t2, _i, argument, t3, t4, end, _null = null; + if ($name === this.restArgument) { + t1 = this.span; + text = A.String_String$fromCharCodes(B.NativeUint32List_methods.sublist$2(t1.file._decodedChars, t1._file$_start, t1._end), 0, _null); + return B.JSString_methods.substring$2(B.JSString_methods.substring$1(text, B.JSString_methods.lastIndexOf$1(text, "$")), 0, B.JSString_methods.indexOf$1(text, ".")); + } + for (t1 = this.$arguments, t2 = t1.length, _i = 0; _i < t2; ++_i) { + argument = t1[_i]; + if (argument.name === $name) { + t1 = argument.defaultValue; + t2 = argument.span; + t3 = t2.file; + t4 = t2._file$_start; + t2 = t2._end; + if (t1 == null) { + t1 = t3._decodedChars; + t1 = A.String_String$fromCharCodes(new Uint32Array(t1.subarray(t4, A._checkValidRange(t4, t2, t1.length))), 0, _null); + } else { + t1 = t3._decodedChars; + text = A.String_String$fromCharCodes(new Uint32Array(t1.subarray(t4, A._checkValidRange(t4, t2, t1.length))), 0, _null); + t1 = B.JSString_methods.substring$2(text, 0, B.JSString_methods.indexOf$1(text, ":")); + end = A._lastNonWhitespace0(t1, false); + t1 = end == null ? "" : B.JSString_methods.substring$2(t1, 0, end + 1); + } + return t1; + } + } + throw A.wrapException(A.ArgumentError$(string$.This_d + $name + '".', _null)); + }, + matches$2(positional, names) { + var t1, t2, t3, namedUsed, i, argument; + for (t1 = this.$arguments, t2 = t1.length, t3 = names._baseMap, namedUsed = 0, i = 0; i < t2; ++i) { + argument = t1[i]; + if (i < positional) { + if (t3.containsKey$1(argument.name)) + return false; + } else if (t3.containsKey$1(argument.name)) + ++namedUsed; + else if (argument.defaultValue == null) + return false; + } + if (this.restArgument != null) + return true; + if (positional > t2) + return false; + if (namedUsed < t3.get$length(t3)) + return false; + return true; + }, + toString$0(_) { + var t2, t3, _i, + t1 = A._setArrayType([], type$.JSArray_String); + for (t2 = this.$arguments, t3 = t2.length, _i = 0; _i < t3; ++_i) + t1.push("$" + A.S(t2[_i])); + t2 = this.restArgument; + if (t2 != null) + t1.push("$" + t2 + "..."); + return B.JSArray_methods.join$1(t1, ", "); + }, + $isAstNode0: 1, + get$span(receiver) { + return this.span; + } + }; + A.ArgumentDeclaration_verify_closure1.prototype = { + call$1(argument) { + return argument.name; + }, + $signature: 297 + }; + A.ArgumentDeclaration_verify_closure2.prototype = { + call$1($name) { + return "$" + $name; + }, + $signature: 5 + }; + A.ArgumentInvocation0.prototype = { + get$isEmpty(_) { + var t1; + if (this.positional.length === 0) { + t1 = this.named; + t1 = t1.get$isEmpty(t1) && this.rest == null; + } else + t1 = false; + return t1; + }, + toString$0(_) { + var t2, t3, _i, _1_0, _2_0, _this = this, + t1 = A._setArrayType([], type$.JSArray_String); + for (t2 = _this.positional, t3 = t2.length, _i = 0; _i < t3; ++_i) + t1.push(_this._argument_invocation$_parenthesizeArgument$1(t2[_i])); + for (t2 = A.MapExtensions_get_pairs0(_this.named, type$.String, type$.Expression_2), t2 = t2.get$iterator(t2); t2.moveNext$0();) { + t3 = t2.get$current(t2); + t1.push("$" + t3._0 + ": " + _this._argument_invocation$_parenthesizeArgument$1(t3._1)); + } + _1_0 = _this.rest; + if (_1_0 != null) + t1.push(_this._argument_invocation$_parenthesizeArgument$1(_1_0) + "..."); + _2_0 = _this.keywordRest; + if (_2_0 != null) + t1.push(_this._argument_invocation$_parenthesizeArgument$1(_2_0) + "..."); + return "(" + B.JSArray_methods.join$1(t1, ", ") + ")"; + }, + _argument_invocation$_parenthesizeArgument$1(argument) { + var t1; + $label0$0: { + if (argument instanceof A.ListExpression0 && B.ListSeparator_rXA0 === argument.separator && !argument.hasBrackets && argument.contents.length >= 2) { + t1 = "(" + argument.toString$0(0) + ")"; + break $label0$0; + } + t1 = argument.toString$0(0); + break $label0$0; + } + return t1; + }, + $isAstNode0: 1, + get$span(receiver) { + return this.span; + } + }; + A.argumentListClass_closure.prototype = { + call$0() { + var t1 = type$.JSClass, + jsClass = t1._as(A.allowInteropCaptureThisNamed("sass.SassArgumentList", new A.argumentListClass__closure())); + A.defineGetter(J.get$$prototype$x(jsClass), "keywords", new A.argumentListClass__closure0(), null); + A.JSClassExtension_injectSuperclass(t1._as(A.SassArgumentList$0(A._setArrayType([], type$.JSArray_Value_2), A.LinkedHashMap_LinkedHashMap$_empty(type$.String, type$.Value_2), B.ListSeparator_undecided_null_undecided0).constructor), jsClass); + return jsClass; + }, + $signature: 13 + }; + A.argumentListClass__closure.prototype = { + call$4($self, contents, keywords, separator) { + var t3, + t1 = self.immutable.isOrderedMap(contents) ? J.toArray$0$x(type$.ImmutableList._as(contents)) : type$.List_dynamic._as(contents), + t2 = type$.Value_2; + t1 = J.cast$1$0$ax(t1, t2); + t3 = self.immutable.isOrderedMap(keywords) ? A.immutableMapToDartMap(type$.ImmutableMap._as(keywords)) : A.objectToMap(keywords); + return A.SassArgumentList$0(t1, t3.cast$2$0(0, type$.String, t2), A.jsToDartSeparator(separator)); + }, + call$3($self, contents, keywords) { + return this.call$4($self, contents, keywords, ","); + }, + "call*": "call$4", + $requiredArgCount: 3, + $defaultValues() { + return [","]; + }, + $signature: 299 + }; + A.argumentListClass__closure0.prototype = { + call$1($self) { + $self._argument_list$_wereKeywordsAccessed = true; + return A.dartMapToImmutableMap($self._argument_list$_keywords); + }, + $signature: 300 + }; + A.SassArgumentList0.prototype = {}; + A.JSArray1.prototype = {}; + A.AsyncImporter0.prototype = { + isNonCanonicalScheme$1(scheme) { + return false; + } + }; + A.JSToDartAsyncImporter.prototype = { + canonicalize$1(_, url) { + return this.canonicalize$body$JSToDartAsyncImporter(0, url); + }, + canonicalize$body$JSToDartAsyncImporter(_, url) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.nullable_Uri), + $async$returnValue, $async$self = this, t1, result; + var $async$canonicalize$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + result = A.wrapJSExceptions(new A.JSToDartAsyncImporter_canonicalize_closure($async$self, url)); + $async$goto = result != null && result instanceof self.Promise ? 3 : 4; + break; + case 3: + // then + $async$goto = 5; + return A._asyncAwait(A.promiseToFuture(type$.Promise._as(result), type$.nullable_Object), $async$canonicalize$1); + case 5: + // returning from await. + result = $async$result; + case 4: + // join + if (result == null) { + $async$returnValue = null; + // goto return + $async$goto = 1; + break; + } + t1 = self.URL; + if (result instanceof t1) { + $async$returnValue = A.Uri_parse(J.toString$0$(type$.JSUrl._as(result))); + // goto return + $async$goto = 1; + break; + } + A.jsThrow(new self.Error(string$.The_ca)); + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$canonicalize$1, $async$completer); + }, + load$1(_, url) { + return this.load$body$JSToDartAsyncImporter(0, url); + }, + load$body$JSToDartAsyncImporter(_, url) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.nullable_ImporterResult_2), + $async$returnValue, $async$self = this, t1, contents, syntax, t2, result; + var $async$load$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + result = A.wrapJSExceptions(new A.JSToDartAsyncImporter_load_closure($async$self, url)); + $async$goto = result != null && result instanceof self.Promise ? 3 : 4; + break; + case 3: + // then + $async$goto = 5; + return A._asyncAwait(A.promiseToFuture(type$.Promise._as(result), type$.nullable_Object), $async$load$1); + case 5: + // returning from await. + result = $async$result; + case 4: + // join + if (result == null) { + $async$returnValue = null; + // goto return + $async$goto = 1; + break; + } + type$.JSImporterResult._as(result); + t1 = J.getInterceptor$x(result); + contents = t1.get$contents(result); + if (A._asString(new self.Function("value", "return typeof value").call$1(contents)) !== "string") + A.jsThrow(new A.ArgumentError(true, contents, "contents", "must be a string but was: " + A.jsType(contents))); + syntax = t1.get$syntax(result); + if (contents == null || syntax == null) + A.jsThrow(new self.Error(string$.The_lo)); + t2 = A.parseSyntax(syntax); + $async$returnValue = A.ImporterResult$(contents, A.NullableExtension_andThen0(t1.get$sourceMapUrl(result), A.utils1__jsToDartUrl$closure()), t2); + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$load$1, $async$completer); + }, + isNonCanonicalScheme$1(scheme) { + return this._nonCanonicalSchemes.contains$1(0, scheme); + } + }; + A.JSToDartAsyncImporter_canonicalize_closure.prototype = { + call$0() { + return this.$this._async0$_canonicalize.call$2(this.url.toString$0(0), {fromImport: A.fromImport0(), containingUrl: A.NullableExtension_andThen0(A.containingUrl0(), A.utils1__dartToJSUrl$closure())}); + }, + $signature: 35 + }; + A.JSToDartAsyncImporter_load_closure.prototype = { + call$0() { + return this.$this._load.call$1(new self.URL(this.url.toString$0(0))); + }, + $signature: 35 + }; + A.AsyncBuiltInCallable0.prototype = { + callbackFor$2(positional, names) { + return new A._Record_2(this._async_built_in0$_arguments, this._async_built_in0$_callback); + }, + $isAsyncCallable0: 1, + get$name(receiver) { + return this.name; + }, + get$acceptsContent() { + return this.acceptsContent; + } + }; + A.AsyncBuiltInCallable$mixin_closure0.prototype = { + call$1($arguments) { + return this.$call$body$AsyncBuiltInCallable$mixin_closure0($arguments); + }, + $call$body$AsyncBuiltInCallable$mixin_closure0($arguments) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Value_2), + $async$returnValue, $async$self = this, t1; + var $async$call$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.callback.call$1($arguments); + $async$goto = 3; + return A._asyncAwait(t1 instanceof A._Future ? t1 : A._Future$value(t1, type$.void), $async$call$1); + case 3: + // returning from await. + $async$returnValue = B.C__SassNull0; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$call$1, $async$completer); + }, + $signature: 98 + }; + A._compileStylesheet_closure2.prototype = { + call$1(url) { + return url === "" ? A.Uri_Uri$dataFromString(A.String_String$fromCharCodes(B.NativeUint32List_methods.sublist$2(this.stylesheet.span.file._decodedChars, 0, null), 0, null), B.C_Utf8Codec, null).get$_text() : this.importCache.sourceMapUrl$1(0, A.Uri_parse(url)).toString$0(0); + }, + $signature: 5 + }; + A.AsyncEnvironment0.prototype = { + closure$0() { + var t4, t5, t6, _this = this, + t1 = _this._async_environment0$_forwardedModules, + t2 = _this._async_environment0$_nestedForwardedModules, + t3 = _this._async_environment0$_variables; + t3 = A._setArrayType(t3.slice(0), A._arrayInstanceType(t3)); + t4 = _this._async_environment0$_variableNodes; + t4 = A._setArrayType(t4.slice(0), A._arrayInstanceType(t4)); + t5 = _this._async_environment0$_functions; + t5 = A._setArrayType(t5.slice(0), A._arrayInstanceType(t5)); + t6 = _this._async_environment0$_mixins; + t6 = A._setArrayType(t6.slice(0), A._arrayInstanceType(t6)); + return A.AsyncEnvironment$_0(_this._async_environment0$_modules, _this._async_environment0$_namespaceNodes, _this._async_environment0$_globalModules, _this._async_environment0$_importedModules, t1, t2, _this._async_environment0$_allModules, t3, t4, t5, t6, _this._async_environment0$_content); + }, + forwardModule$2(module, rule) { + var view, t1, t2, _this = this, + forwardedModules = _this._async_environment0$_forwardedModules; + if (forwardedModules == null) + forwardedModules = _this._async_environment0$_forwardedModules = A.LinkedHashMap_LinkedHashMap$_empty(type$.Module_AsyncCallable_2, type$.AstNode_2); + view = A.ForwardedModuleView_ifNecessary0(module, rule, type$.AsyncCallable_2); + for (t1 = A.LinkedHashMapKeyIterator$(forwardedModules, forwardedModules._modifications); t1.moveNext$0();) { + t2 = t1.__js_helper$_current; + _this._async_environment0$_assertNoConflicts$5(view.get$variables(), t2.get$variables(), view, t2, "variable"); + _this._async_environment0$_assertNoConflicts$5(view.get$functions(view), t2.get$functions(t2), view, t2, "function"); + _this._async_environment0$_assertNoConflicts$5(view.get$mixins(), t2.get$mixins(), view, t2, "mixin"); + } + _this._async_environment0$_allModules.push(module); + forwardedModules.$indexSet(0, view, rule); + }, + _async_environment0$_assertNoConflicts$5(newMembers, oldMembers, newModule, oldModule, type) { + var larger, smaller, t1, t2, t3, t4, $name, small, large, span; + if (newMembers.get$length(newMembers) < oldMembers.get$length(oldMembers)) { + larger = oldMembers; + smaller = newMembers; + } else { + larger = newMembers; + smaller = oldMembers; + } + for (t1 = type$.String, t2 = A.MapExtensions_get_pairs0(smaller, t1, type$.Object), t2 = t2.get$iterator(t2), t3 = type === "variable"; t2.moveNext$0();) { + t4 = t2.get$current(t2); + $name = t4._0; + small = t4._1; + large = larger.$index(0, $name); + if (large == null) + continue; + if (t3 ? newModule.variableIdentity$1($name) === oldModule.variableIdentity$1($name) : J.$eq$(large, small)) + continue; + if (t3) + $name = "$" + $name; + t2 = this._async_environment0$_forwardedModules; + if (t2 == null) + span = null; + else { + t2 = t2.$index(0, oldModule); + span = t2 == null ? null : J.get$span$z(t2); + } + t2 = A.LinkedHashMap_LinkedHashMap$_empty(type$.FileSpan, t1); + if (span != null) + t2.$indexSet(0, span, "original @forward"); + throw A.wrapException(A.MultiSpanSassScriptException$0("Two forwarded modules both define a " + type + " named " + $name + ".", "new @forward", t2)); + } + }, + importForwards$1(module) { + var forwardedModules, t1, t2, t3, t4, node, t5, t6, t7, t8, t9, t10, _i, t11, shadowed, _length, _list, _this = this, + forwarded = module._async_environment0$_environment._async_environment0$_forwardedModules; + if (forwarded == null) + return; + forwardedModules = _this._async_environment0$_forwardedModules; + if (forwardedModules != null) { + t1 = type$.Module_AsyncCallable_2; + t2 = type$.AstNode_2; + t3 = A.LinkedHashMap_LinkedHashMap$_empty(t1, t2); + for (t1 = A.MapExtensions_get_pairs0(forwarded, t1, t2), t1 = t1.get$iterator(t1), t2 = _this._async_environment0$_globalModules; t1.moveNext$0();) { + t4 = t1.get$current(t1); + module = t4._0; + node = t4._1; + if (!forwardedModules.containsKey$1(module) || !t2.containsKey$1(module)) + t3.$indexSet(0, module, node); + } + forwarded = t3; + } else + forwardedModules = _this._async_environment0$_forwardedModules = A.LinkedHashMap_LinkedHashMap$_empty(type$.Module_AsyncCallable_2, type$.AstNode_2); + t1 = type$.String; + t2 = A.LinkedHashSet_LinkedHashSet$_empty(t1); + for (t3 = A.LinkedHashMapKeyIterator$(forwarded, forwarded._modifications); t3.moveNext$0();) + for (t4 = t3.__js_helper$_current.get$variables(), t4 = J.get$iterator$ax(t4.get$keys(t4)); t4.moveNext$0();) + t2.add$1(0, t4.get$current(t4)); + t3 = A.LinkedHashSet_LinkedHashSet$_empty(t1); + for (t4 = A.LinkedHashMapKeyIterator$(forwarded, forwarded._modifications); t4.moveNext$0();) { + t5 = t4.__js_helper$_current; + for (t5 = t5.get$functions(t5), t5 = J.get$iterator$ax(t5.get$keys(t5)); t5.moveNext$0();) + t3.add$1(0, t5.get$current(t5)); + } + t1 = A.LinkedHashSet_LinkedHashSet$_empty(t1); + for (t4 = A.LinkedHashMapKeyIterator$(forwarded, forwarded._modifications); t4.moveNext$0();) + for (t5 = t4.__js_helper$_current.get$mixins(), t5 = J.get$iterator$ax(t5.get$keys(t5)); t5.moveNext$0();) + t1.add$1(0, t5.get$current(t5)); + t4 = _this._async_environment0$_variables; + t5 = t4.length; + if (t5 === 1) { + for (t5 = _this._async_environment0$_importedModules, t6 = type$.Module_AsyncCallable_2, t7 = type$.AstNode_2, t8 = A.MapExtensions_get_pairs0(t5, t6, t7).toList$0(0), t9 = t8.length, t10 = type$.AsyncCallable_2, _i = 0; _i < t8.length; t8.length === t9 || (0, A.throwConcurrentModificationError)(t8), ++_i) { + t11 = t8[_i]; + module = t11._0; + node = t11._1; + shadowed = A.ShadowedModuleView_ifNecessary0(module, t3, t1, t2, t10); + if (shadowed != null) { + t5.remove$1(0, module); + t11 = shadowed.variables; + if (t11.get$isEmpty(t11)) { + t11 = shadowed.functions; + if (t11.get$isEmpty(t11)) { + t11 = shadowed.mixins; + if (t11.get$isEmpty(t11)) { + t11 = shadowed._shadowed_view0$_inner; + t11 = t11.get$css(t11); + t11 = J.get$isEmpty$asx(t11.get$children(t11)); + } else + t11 = false; + } else + t11 = false; + } else + t11 = false; + if (!t11) + t5.$indexSet(0, shadowed, node); + } + } + for (t6 = A.MapExtensions_get_pairs0(forwardedModules, t6, t7).toList$0(0), t7 = t6.length, _i = 0; _i < t6.length; t6.length === t7 || (0, A.throwConcurrentModificationError)(t6), ++_i) { + t8 = t6[_i]; + module = t8._0; + node = t8._1; + shadowed = A.ShadowedModuleView_ifNecessary0(module, t3, t1, t2, t10); + if (shadowed != null) { + forwardedModules.remove$1(0, module); + t8 = shadowed.variables; + if (t8.get$isEmpty(t8)) { + t8 = shadowed.functions; + if (t8.get$isEmpty(t8)) { + t8 = shadowed.mixins; + if (t8.get$isEmpty(t8)) { + t8 = shadowed._shadowed_view0$_inner; + t8 = t8.get$css(t8); + t8 = J.get$isEmpty$asx(t8.get$children(t8)); + } else + t8 = false; + } else + t8 = false; + } else + t8 = false; + if (!t8) + forwardedModules.$indexSet(0, shadowed, node); + } + } + t5.addAll$1(0, forwarded); + forwardedModules.addAll$1(0, forwarded); + } else { + t6 = _this._async_environment0$_nestedForwardedModules; + if (t6 == null) { + _length = t5 - 1; + _list = J.JSArray_JSArray$allocateGrowable(_length, type$.List_Module_AsyncCallable_2); + for (t5 = type$.JSArray_Module_AsyncCallable_2, _i = 0; _i < _length; ++_i) + _list[_i] = A._setArrayType([], t5); + _this._async_environment0$_nestedForwardedModules = _list; + t5 = _list; + } else + t5 = t6; + B.JSArray_methods.addAll$1(B.JSArray_methods.get$last(t5), new A.LinkedHashMapKeyIterable(forwarded, A._instanceType(forwarded)._eval$1("LinkedHashMapKeyIterable<1>"))); + } + for (t2 = A._LinkedHashSetIterator$(t2, t2._collection$_modifications, t2.$ti._precomputed1), t5 = _this._async_environment0$_variableIndices, t6 = _this._async_environment0$_variableNodes, t7 = t2.$ti._precomputed1; t2.moveNext$0();) { + t8 = t2._collection$_current; + if (t8 == null) + t8 = t7._as(t8); + t5.remove$1(0, t8); + J.remove$1$z(B.JSArray_methods.get$last(t4), t8); + J.remove$1$z(B.JSArray_methods.get$last(t6), t8); + } + for (t2 = A._LinkedHashSetIterator$(t3, t3._collection$_modifications, t3.$ti._precomputed1), t3 = _this._async_environment0$_functionIndices, t4 = _this._async_environment0$_functions, t5 = t2.$ti._precomputed1; t2.moveNext$0();) { + t6 = t2._collection$_current; + if (t6 == null) + t6 = t5._as(t6); + t3.remove$1(0, t6); + J.remove$1$z(B.JSArray_methods.get$last(t4), t6); + } + for (t1 = A._LinkedHashSetIterator$(t1, t1._collection$_modifications, t1.$ti._precomputed1), t2 = _this._async_environment0$_mixinIndices, t3 = _this._async_environment0$_mixins, t4 = t1.$ti._precomputed1; t1.moveNext$0();) { + t5 = t1._collection$_current; + if (t5 == null) + t5 = t4._as(t5); + t2.remove$1(0, t5); + J.remove$1$z(B.JSArray_methods.get$last(t3), t5); + } + }, + getVariable$2$namespace($name, namespace) { + var t1, _0_0, _1_0, _this = this; + if (namespace != null) + return _this._async_environment0$_getModule$1(namespace).get$variables().$index(0, $name); + if (_this._async_environment0$_lastVariableName === $name) { + t1 = _this._async_environment0$_lastVariableIndex; + t1.toString; + t1 = J.$index$asx(_this._async_environment0$_variables[t1], $name); + return t1 == null ? _this._async_environment0$_getVariableFromGlobalModule$1($name) : t1; + } + t1 = _this._async_environment0$_variableIndices; + _0_0 = t1.$index(0, $name); + if (_0_0 != null) { + _this._async_environment0$_lastVariableName = $name; + _this._async_environment0$_lastVariableIndex = _0_0; + t1 = J.$index$asx(_this._async_environment0$_variables[_0_0], $name); + return t1 == null ? _this._async_environment0$_getVariableFromGlobalModule$1($name) : t1; + } else { + _1_0 = _this._async_environment0$_variableIndex$1($name); + if (_1_0 != null) { + _this._async_environment0$_lastVariableName = $name; + _this._async_environment0$_lastVariableIndex = _1_0; + t1.$indexSet(0, $name, _1_0); + t1 = J.$index$asx(_this._async_environment0$_variables[_1_0], $name); + return t1 == null ? _this._async_environment0$_getVariableFromGlobalModule$1($name) : t1; + } else + return _this._async_environment0$_getVariableFromGlobalModule$1($name); + } + }, + getVariable$1($name) { + return this.getVariable$2$namespace($name, null); + }, + _async_environment0$_getVariableFromGlobalModule$1($name) { + return this._async_environment0$_fromOneModule$3($name, "variable", new A.AsyncEnvironment__getVariableFromGlobalModule_closure0($name)); + }, + getVariableNode$2$namespace($name, namespace) { + var t1, _0_0, _1_0, _this = this; + if (namespace != null) + return _this._async_environment0$_getModule$1(namespace).get$variableNodes().$index(0, $name); + if (_this._async_environment0$_lastVariableName === $name) { + t1 = _this._async_environment0$_lastVariableIndex; + t1.toString; + t1 = J.$index$asx(_this._async_environment0$_variableNodes[t1], $name); + return t1 == null ? _this._async_environment0$_getVariableNodeFromGlobalModule$1($name) : t1; + } + t1 = _this._async_environment0$_variableIndices; + _0_0 = t1.$index(0, $name); + if (_0_0 != null) { + _this._async_environment0$_lastVariableName = $name; + _this._async_environment0$_lastVariableIndex = _0_0; + t1 = J.$index$asx(_this._async_environment0$_variableNodes[_0_0], $name); + return t1 == null ? _this._async_environment0$_getVariableNodeFromGlobalModule$1($name) : t1; + } else { + _1_0 = _this._async_environment0$_variableIndex$1($name); + if (_1_0 != null) { + _this._async_environment0$_lastVariableName = $name; + _this._async_environment0$_lastVariableIndex = _1_0; + t1.$indexSet(0, $name, _1_0); + t1 = J.$index$asx(_this._async_environment0$_variableNodes[_1_0], $name); + return t1 == null ? _this._async_environment0$_getVariableNodeFromGlobalModule$1($name) : t1; + } else + return _this._async_environment0$_getVariableNodeFromGlobalModule$1($name); + } + }, + _async_environment0$_getVariableNodeFromGlobalModule$1($name) { + var t1, t2, _0_0; + for (t1 = this._async_environment0$_importedModules, t2 = this._async_environment0$_globalModules, t2 = new A.LinkedHashMapKeyIterable(t1, A._instanceType(t1)._eval$1("LinkedHashMapKeyIterable<1>")).followedBy$1(0, new A.LinkedHashMapKeyIterable(t2, A._instanceType(t2)._eval$1("LinkedHashMapKeyIterable<1>"))), t2 = new A.FollowedByIterator(J.get$iterator$ax(t2.__internal$_first), t2._second); t2.moveNext$0();) { + t1 = t2._currentIterator; + _0_0 = t1.get$current(t1).get$variableNodes().$index(0, $name); + if (_0_0 != null) + return _0_0; + } + return null; + }, + globalVariableExists$2$namespace($name, namespace) { + if (namespace != null) + return this._async_environment0$_getModule$1(namespace).get$variables().containsKey$1($name); + if (B.JSArray_methods.get$first(this._async_environment0$_variables).containsKey$1($name)) + return true; + return this._async_environment0$_getVariableFromGlobalModule$1($name) != null; + }, + globalVariableExists$1($name) { + return this.globalVariableExists$2$namespace($name, null); + }, + _async_environment0$_variableIndex$1($name) { + var t1, i; + for (t1 = this._async_environment0$_variables, i = t1.length - 1; i >= 0; --i) + if (t1[i].containsKey$1($name)) + return i; + return null; + }, + setVariable$5$global$namespace($name, value, nodeWithSpan, global, namespace) { + var t1, moduleWithName, nestedForwardedModules, t2, t3, t4, t5, index, _this = this; + if (namespace != null) { + _this._async_environment0$_getModule$1(namespace).setVariable$3($name, value, nodeWithSpan); + return; + } + if (global || _this._async_environment0$_variables.length === 1) { + _this._async_environment0$_variableIndices.putIfAbsent$2($name, new A.AsyncEnvironment_setVariable_closure2(_this, $name)); + t1 = _this._async_environment0$_variables; + if (!B.JSArray_methods.get$first(t1).containsKey$1($name)) { + moduleWithName = _this._async_environment0$_fromOneModule$3($name, "variable", new A.AsyncEnvironment_setVariable_closure3($name)); + if (moduleWithName != null) { + moduleWithName.setVariable$3($name, value, nodeWithSpan); + return; + } + } + J.$indexSet$ax(B.JSArray_methods.get$first(t1), $name, value); + J.$indexSet$ax(B.JSArray_methods.get$first(_this._async_environment0$_variableNodes), $name, nodeWithSpan); + return; + } + nestedForwardedModules = _this._async_environment0$_nestedForwardedModules; + if (nestedForwardedModules != null && !_this._async_environment0$_variableIndices.containsKey$1($name) && _this._async_environment0$_variableIndex$1($name) == null) + for (t1 = A.instanceType(nestedForwardedModules)._eval$1("ReversedListIterable<1>"), t2 = new A.ReversedListIterable(nestedForwardedModules, t1), t2 = new A.ListIterator(t2, t2.get$length(0), t1._eval$1("ListIterator")), t1 = t1._eval$1("ListIterable.E"); t2.moveNext$0();) { + t3 = t2.__internal$_current; + for (t3 = J.get$reversed$ax(t3 == null ? t1._as(t3) : t3), t4 = t3.$ti, t3 = new A.ListIterator(t3, t3.get$length(0), t4._eval$1("ListIterator")), t4 = t4._eval$1("ListIterable.E"); t3.moveNext$0();) { + t5 = t3.__internal$_current; + if (t5 == null) + t5 = t4._as(t5); + if (t5.get$variables().containsKey$1($name)) { + t5.setVariable$3($name, value, nodeWithSpan); + return; + } + } + } + if (_this._async_environment0$_lastVariableName === $name) { + t1 = _this._async_environment0$_lastVariableIndex; + t1.toString; + index = t1; + } else + index = _this._async_environment0$_variableIndices.putIfAbsent$2($name, new A.AsyncEnvironment_setVariable_closure4(_this, $name)); + if (!_this._async_environment0$_inSemiGlobalScope && index === 0) { + index = _this._async_environment0$_variables.length - 1; + _this._async_environment0$_variableIndices.$indexSet(0, $name, index); + } + _this._async_environment0$_lastVariableName = $name; + _this._async_environment0$_lastVariableIndex = index; + J.$indexSet$ax(_this._async_environment0$_variables[index], $name, value); + J.$indexSet$ax(_this._async_environment0$_variableNodes[index], $name, nodeWithSpan); + }, + setVariable$4$global($name, value, nodeWithSpan, global) { + return this.setVariable$5$global$namespace($name, value, nodeWithSpan, global, null); + }, + setLocalVariable$3($name, value, nodeWithSpan) { + var index, _this = this, + t1 = _this._async_environment0$_variables, + t2 = t1.length; + _this._async_environment0$_lastVariableName = $name; + index = _this._async_environment0$_lastVariableIndex = t2 - 1; + _this._async_environment0$_variableIndices.$indexSet(0, $name, index); + J.$indexSet$ax(t1[index], $name, value); + J.$indexSet$ax(_this._async_environment0$_variableNodes[index], $name, nodeWithSpan); + }, + getFunction$2$namespace($name, namespace) { + var t1, _0_0, _1_0, _this = this; + if (namespace != null) { + t1 = _this._async_environment0$_getModule$1(namespace); + return t1.get$functions(t1).$index(0, $name); + } + t1 = _this._async_environment0$_functionIndices; + _0_0 = t1.$index(0, $name); + if (_0_0 != null) { + t1 = J.$index$asx(_this._async_environment0$_functions[_0_0], $name); + return t1 == null ? _this._async_environment0$_getFunctionFromGlobalModule$1($name) : t1; + } else { + _1_0 = _this._async_environment0$_functionIndex$1($name); + if (_1_0 != null) { + t1.$indexSet(0, $name, _1_0); + t1 = J.$index$asx(_this._async_environment0$_functions[_1_0], $name); + return t1 == null ? _this._async_environment0$_getFunctionFromGlobalModule$1($name) : t1; + } else + return _this._async_environment0$_getFunctionFromGlobalModule$1($name); + } + }, + getFunction$1($name) { + return this.getFunction$2$namespace($name, null); + }, + _async_environment0$_getFunctionFromGlobalModule$1($name) { + return this._async_environment0$_fromOneModule$3($name, "function", new A.AsyncEnvironment__getFunctionFromGlobalModule_closure0($name)); + }, + _async_environment0$_functionIndex$1($name) { + var t1, i; + for (t1 = this._async_environment0$_functions, i = t1.length - 1; i >= 0; --i) + if (t1[i].containsKey$1($name)) + return i; + return null; + }, + getMixin$2$namespace($name, namespace) { + var t1, _0_0, _1_0, _this = this; + if (namespace != null) + return _this._async_environment0$_getModule$1(namespace).get$mixins().$index(0, $name); + t1 = _this._async_environment0$_mixinIndices; + _0_0 = t1.$index(0, $name); + if (_0_0 != null) { + t1 = J.$index$asx(_this._async_environment0$_mixins[_0_0], $name); + return t1 == null ? _this._async_environment0$_getMixinFromGlobalModule$1($name) : t1; + } else { + _1_0 = _this._async_environment0$_mixinIndex$1($name); + if (_1_0 != null) { + t1.$indexSet(0, $name, _1_0); + t1 = J.$index$asx(_this._async_environment0$_mixins[_1_0], $name); + return t1 == null ? _this._async_environment0$_getMixinFromGlobalModule$1($name) : t1; + } else + return _this._async_environment0$_getMixinFromGlobalModule$1($name); + } + }, + _async_environment0$_getMixinFromGlobalModule$1($name) { + return this._async_environment0$_fromOneModule$3($name, "mixin", new A.AsyncEnvironment__getMixinFromGlobalModule_closure0($name)); + }, + _async_environment0$_mixinIndex$1($name) { + var t1, i; + for (t1 = this._async_environment0$_mixins, i = t1.length - 1; i >= 0; --i) + if (t1[i].containsKey$1($name)) + return i; + return null; + }, + withContent$2($content, callback) { + return this.withContent$body$AsyncEnvironment0($content, callback); + }, + withContent$body$AsyncEnvironment0($content, callback) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void), + $async$self = this, oldContent; + var $async$withContent$2 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + oldContent = $async$self._async_environment0$_content; + $async$self._async_environment0$_content = $content; + $async$goto = 2; + return A._asyncAwait(callback.call$0(), $async$withContent$2); + case 2: + // returning from await. + $async$self._async_environment0$_content = oldContent; + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$withContent$2, $async$completer); + }, + asMixin$1(callback) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void), + $async$self = this, oldInMixin; + var $async$asMixin$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + oldInMixin = $async$self._async_environment0$_inMixin; + $async$self._async_environment0$_inMixin = true; + $async$goto = 2; + return A._asyncAwait(callback.call$0(), $async$asMixin$1); + case 2: + // returning from await. + $async$self._async_environment0$_inMixin = oldInMixin; + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$asMixin$1, $async$completer); + }, + scope$1$3$semiGlobal$when(callback, semiGlobal, when, $T) { + return this.scope$body$AsyncEnvironment0(callback, semiGlobal, when, $T, $T); + }, + scope$1$1(callback, $T) { + return this.scope$1$3$semiGlobal$when(callback, false, true, $T); + }, + scope$1$2$when(callback, when, $T) { + return this.scope$1$3$semiGlobal$when(callback, false, when, $T); + }, + scope$1$2$semiGlobal(callback, semiGlobal, $T) { + return this.scope$1$3$semiGlobal$when(callback, semiGlobal, true, $T); + }, + scope$body$AsyncEnvironment0(callback, semiGlobal, when, $T, $async$type) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter($async$type), + $async$returnValue, $async$handler = 2, $async$currentError, $async$next = [], $async$self = this, wasInSemiGlobalScope, $name, name0, name1, t1, t2, t3, t4, t5, t6; + var $async$scope$1$3$semiGlobal$when = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) { + $async$currentError = $async$result; + $async$goto = $async$handler; + } + while (true) + switch ($async$goto) { + case 0: + // Function start + semiGlobal = semiGlobal && $async$self._async_environment0$_inSemiGlobalScope; + wasInSemiGlobalScope = $async$self._async_environment0$_inSemiGlobalScope; + $async$self._async_environment0$_inSemiGlobalScope = semiGlobal; + $async$goto = !when ? 3 : 4; + break; + case 3: + // then + $async$handler = 5; + $async$goto = 8; + return A._asyncAwait(callback.call$0(), $async$scope$1$3$semiGlobal$when); + case 8: + // returning from await. + t1 = $async$result; + $async$returnValue = t1; + $async$next = [1]; + // goto finally + $async$goto = 6; + break; + $async$next.push(7); + // goto finally + $async$goto = 6; + break; + case 5: + // uncaught + $async$next = [2]; + case 6: + // finally + $async$handler = 2; + $async$self._async_environment0$_inSemiGlobalScope = wasInSemiGlobalScope; + // goto the next finally handler + $async$goto = $async$next.pop(); + break; + case 7: + // after finally + case 4: + // join + t1 = $async$self._async_environment0$_variables; + t2 = type$.String; + B.JSArray_methods.add$1(t1, A.LinkedHashMap_LinkedHashMap$_empty(t2, type$.Value_2)); + t3 = $async$self._async_environment0$_variableNodes; + B.JSArray_methods.add$1(t3, A.LinkedHashMap_LinkedHashMap$_empty(t2, type$.AstNode_2)); + t4 = $async$self._async_environment0$_functions; + t5 = type$.AsyncCallable_2; + B.JSArray_methods.add$1(t4, A.LinkedHashMap_LinkedHashMap$_empty(t2, t5)); + t6 = $async$self._async_environment0$_mixins; + B.JSArray_methods.add$1(t6, A.LinkedHashMap_LinkedHashMap$_empty(t2, t5)); + t5 = $async$self._async_environment0$_nestedForwardedModules; + if (t5 != null) + t5.push(A._setArrayType([], type$.JSArray_Module_AsyncCallable_2)); + $async$handler = 9; + $async$goto = 12; + return A._asyncAwait(callback.call$0(), $async$scope$1$3$semiGlobal$when); + case 12: + // returning from await. + t2 = $async$result; + $async$returnValue = t2; + $async$next = [1]; + // goto finally + $async$goto = 10; + break; + $async$next.push(11); + // goto finally + $async$goto = 10; + break; + case 9: + // uncaught + $async$next = [2]; + case 10: + // finally + $async$handler = 2; + $async$self._async_environment0$_inSemiGlobalScope = wasInSemiGlobalScope; + $async$self._async_environment0$_lastVariableIndex = $async$self._async_environment0$_lastVariableName = null; + for (t1 = J.get$iterator$ax(J.get$keys$z(B.JSArray_methods.removeLast$0(t1))), t2 = $async$self._async_environment0$_variableIndices; t1.moveNext$0();) { + $name = t1.get$current(t1); + t2.remove$1(0, $name); + } + B.JSArray_methods.removeLast$0(t3); + for (t1 = J.get$iterator$ax(J.get$keys$z(B.JSArray_methods.removeLast$0(t4))), t2 = $async$self._async_environment0$_functionIndices; t1.moveNext$0();) { + name0 = t1.get$current(t1); + t2.remove$1(0, name0); + } + for (t1 = J.get$iterator$ax(J.get$keys$z(B.JSArray_methods.removeLast$0(t6))), t2 = $async$self._async_environment0$_mixinIndices; t1.moveNext$0();) { + name1 = t1.get$current(t1); + t2.remove$1(0, name1); + } + t1 = $async$self._async_environment0$_nestedForwardedModules; + if (t1 != null) + t1.pop(); + // goto the next finally handler + $async$goto = $async$next.pop(); + break; + case 11: + // after finally + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + case 2: + // rethrow + return A._asyncRethrow($async$currentError, $async$completer); + } + }); + return A._asyncStartSync($async$scope$1$3$semiGlobal$when, $async$completer); + }, + toImplicitConfiguration$0() { + var t2, t3, t4, i, values, nodes, t5, t6, $name, value, + t1 = type$.String, + configuration = A.LinkedHashMap_LinkedHashMap$_empty(t1, type$.ConfiguredValue_2); + for (t2 = this._async_environment0$_variables, t3 = type$.Value_2, t4 = this._async_environment0$_variableNodes, i = 0; i < t2.length; ++i) { + values = t2[i]; + nodes = t4[i]; + for (t5 = A.MapExtensions_get_pairs0(values, t1, t3), t5 = t5.get$iterator(t5); t5.moveNext$0();) { + t6 = t5.get$current(t5); + $name = t6._0; + value = t6._1; + t6 = nodes.$index(0, $name); + t6.toString; + configuration.$indexSet(0, $name, new A.ConfiguredValue0(value, null, t6)); + } + } + return new A.Configuration0(configuration, null); + }, + toModule$3(css, preModuleComments, extensionStore) { + return A._EnvironmentModule__EnvironmentModule2(this, css, preModuleComments, extensionStore, A.NullableExtension_andThen0(this._async_environment0$_forwardedModules, new A.AsyncEnvironment_toModule_closure0())); + }, + toDummyModule$0() { + return A._EnvironmentModule__EnvironmentModule2(this, new A.CssStylesheet0(new A.UnmodifiableListView(B.List_empty16, type$.UnmodifiableListView_CssNode_2), A.SourceFile$decoded(B.List_empty4, "").span$1(0, 0)), B.Map_empty15, B.C_EmptyExtensionStore0, A.NullableExtension_andThen0(this._async_environment0$_forwardedModules, new A.AsyncEnvironment_toDummyModule_closure0())); + }, + _async_environment0$_getModule$1(namespace) { + var _0_0 = this._async_environment0$_modules.$index(0, namespace); + if (_0_0 != null) + return _0_0; + throw A.wrapException(A.SassScriptException$0('There is no module with the namespace "' + namespace + '".', null)); + }, + _async_environment0$_fromOneModule$1$3($name, type, callback) { + var t1, t2, t3, t4, t5, _1_0, _2_0, value, identity, valueInModule, identityFromModule, module, node, + _0_0 = this._async_environment0$_nestedForwardedModules; + if (_0_0 != null) + for (t1 = A._arrayInstanceType(_0_0)._eval$1("ReversedListIterable<1>"), t2 = new A.ReversedListIterable(_0_0, t1), t2 = new A.ListIterator(t2, t2.get$length(0), t1._eval$1("ListIterator")), t1 = t1._eval$1("ListIterable.E"); t2.moveNext$0();) { + t3 = t2.__internal$_current; + for (t3 = J.get$reversed$ax(t3 == null ? t1._as(t3) : t3), t4 = t3.$ti, t3 = new A.ListIterator(t3, t3.get$length(0), t4._eval$1("ListIterator")), t4 = t4._eval$1("ListIterable.E"); t3.moveNext$0();) { + t5 = t3.__internal$_current; + _1_0 = callback.call$1(t5 == null ? t4._as(t5) : t5); + if (_1_0 != null) + return _1_0; + } + } + for (t1 = this._async_environment0$_importedModules, t1 = A.LinkedHashMapKeyIterator$(t1, t1._modifications); t1.moveNext$0();) { + _2_0 = callback.call$1(t1.__js_helper$_current); + if (_2_0 != null) + return _2_0; + } + for (t1 = this._async_environment0$_globalModules, t2 = A.LinkedHashMapKeyIterator$(t1, t1._modifications), t3 = type$.AsyncCallable_2, value = null, identity = null; t2.moveNext$0();) { + t4 = t2.__js_helper$_current; + valueInModule = callback.call$1(t4); + if (valueInModule == null) + continue; + identityFromModule = t3._is(valueInModule) ? valueInModule : t4.variableIdentity$1($name); + if (identityFromModule.$eq(0, identity)) + continue; + if (value != null) { + t2 = A.LinkedHashMap_LinkedHashMap$_empty(type$.FileSpan, type$.String); + for (t3 = A.MapExtensions_get_pairs0(t1, type$.Module_AsyncCallable_2, type$.AstNode_2), t3 = t3.get$iterator(t3), t4 = "includes " + type; t3.moveNext$0();) { + t1 = t3.get$current(t3); + module = t1._0; + node = t1._1; + if (callback.call$1(module) != null) + t2.$indexSet(0, node.get$span(node), t4); + } + throw A.wrapException(A.MultiSpanSassScriptException$0("This " + type + string$.x20is_av, type + " use", t2)); + } + identity = identityFromModule; + value = valueInModule; + } + return value; + }, + _async_environment0$_fromOneModule$3($name, type, callback) { + return this._async_environment0$_fromOneModule$1$3($name, type, callback, type$.dynamic); + } + }; + A.AsyncEnvironment__getVariableFromGlobalModule_closure0.prototype = { + call$1(module) { + return module.get$variables().$index(0, this.name); + }, + $signature: 303 + }; + A.AsyncEnvironment_setVariable_closure2.prototype = { + call$0() { + var t1 = this.$this; + t1._async_environment0$_lastVariableName = this.name; + return t1._async_environment0$_lastVariableIndex = 0; + }, + $signature: 10 + }; + A.AsyncEnvironment_setVariable_closure3.prototype = { + call$1(module) { + return module.get$variables().containsKey$1(this.name) ? module : null; + }, + $signature: 304 + }; + A.AsyncEnvironment_setVariable_closure4.prototype = { + call$0() { + var t1 = this.$this, + t2 = t1._async_environment0$_variableIndex$1(this.name); + return t2 == null ? t1._async_environment0$_variables.length - 1 : t2; + }, + $signature: 10 + }; + A.AsyncEnvironment__getFunctionFromGlobalModule_closure0.prototype = { + call$1(module) { + return module.get$functions(module).$index(0, this.name); + }, + $signature: 237 + }; + A.AsyncEnvironment__getMixinFromGlobalModule_closure0.prototype = { + call$1(module) { + return module.get$mixins().$index(0, this.name); + }, + $signature: 237 + }; + A.AsyncEnvironment_toModule_closure0.prototype = { + call$1(modules) { + return new A.MapKeySet(modules, type$.MapKeySet_Module_AsyncCallable_2); + }, + $signature: 234 + }; + A.AsyncEnvironment_toDummyModule_closure0.prototype = { + call$1(modules) { + return new A.MapKeySet(modules, type$.MapKeySet_Module_AsyncCallable_2); + }, + $signature: 234 + }; + A._EnvironmentModule2.prototype = { + get$url(_) { + var t1 = this.css; + return t1.get$span(t1).file.url; + }, + setVariable$3($name, value, nodeWithSpan) { + var t1, t2, + _0_0 = this._async_environment0$_modulesByVariable.$index(0, $name); + if (_0_0 != null) { + _0_0.setVariable$3($name, value, nodeWithSpan); + return; + } + t1 = this._async_environment0$_environment; + t2 = t1._async_environment0$_variables; + if (!B.JSArray_methods.get$first(t2).containsKey$1($name)) + throw A.wrapException(A.SassScriptException$0("Undefined variable.", null)); + J.$indexSet$ax(B.JSArray_methods.get$first(t2), $name, value); + J.$indexSet$ax(B.JSArray_methods.get$first(t1._async_environment0$_variableNodes), $name, nodeWithSpan); + return; + }, + variableIdentity$1($name) { + var module = this._async_environment0$_modulesByVariable.$index(0, $name); + return module == null ? this : module.variableIdentity$1($name); + }, + cloneCss$0() { + var _0_0, _this = this; + if (!_this.transitivelyContainsCss) + return _this; + _0_0 = A.cloneCssStylesheet0(_this.css, _this.extensionStore); + return A._EnvironmentModule$_2(_this._async_environment0$_environment, _0_0._0, _this.preModuleComments, _0_0._1, _this._async_environment0$_modulesByVariable, _this.variables, _this.variableNodes, _this.functions, _this.mixins, true, _this.transitivelyContainsExtensions); + }, + toString$0(_) { + var t2, + t1 = this.css; + if (t1.get$span(t1).file.url == null) + t1 = ""; + else { + t1 = t1.get$span(t1).file.url; + t2 = $.$get$context(); + t1.toString; + t1 = t2.prettyUri$1(t1); + } + return t1; + }, + $isModule1: 1, + get$upstream() { + return this.upstream; + }, + get$variables() { + return this.variables; + }, + get$variableNodes() { + return this.variableNodes; + }, + get$functions(receiver) { + return this.functions; + }, + get$mixins() { + return this.mixins; + }, + get$extensionStore() { + return this.extensionStore; + }, + get$css(receiver) { + return this.css; + }, + get$preModuleComments() { + return this.preModuleComments; + }, + get$transitivelyContainsCss() { + return this.transitivelyContainsCss; + }, + get$transitivelyContainsExtensions() { + return this.transitivelyContainsExtensions; + } + }; + A._EnvironmentModule__EnvironmentModule_closure17.prototype = { + call$1(module) { + return module.get$variables(); + }, + $signature: 307 + }; + A._EnvironmentModule__EnvironmentModule_closure18.prototype = { + call$1(module) { + return module.get$variableNodes(); + }, + $signature: 308 + }; + A._EnvironmentModule__EnvironmentModule_closure19.prototype = { + call$1(module) { + return module.get$functions(module); + }, + $signature: 229 + }; + A._EnvironmentModule__EnvironmentModule_closure20.prototype = { + call$1(module) { + return module.get$mixins(); + }, + $signature: 229 + }; + A._EnvironmentModule__EnvironmentModule_closure21.prototype = { + call$1(module) { + return module.get$transitivelyContainsCss(); + }, + $signature: 124 + }; + A._EnvironmentModule__EnvironmentModule_closure22.prototype = { + call$1(module) { + return module.get$transitivelyContainsExtensions(); + }, + $signature: 124 + }; + A._EvaluateVisitor2.prototype = { + _EvaluateVisitor$6$functions$importCache$logger$nodeImporter$quietDeps$sourceMap2(functions, importCache, logger, nodeImporter, quietDeps, sourceMap) { + var t2, metaModule, t3, _i, module, $function, t4, _this = this, + _s20_ = "$name, $module: null", + _s9_ = "sass:meta", + _s7_ = "$module", + t1 = type$.JSArray_AsyncBuiltInCallable_2, + metaFunctions = A._setArrayType([A.BuiltInCallable$function0("global-variable-exists", _s20_, new A._EvaluateVisitor_closure38(_this), _s9_), A.BuiltInCallable$function0("variable-exists", "$name", new A._EvaluateVisitor_closure39(_this), _s9_), A.BuiltInCallable$function0("function-exists", _s20_, new A._EvaluateVisitor_closure40(_this), _s9_), A.BuiltInCallable$function0("mixin-exists", _s20_, new A._EvaluateVisitor_closure41(_this), _s9_), A.BuiltInCallable$function0("content-exists", "", new A._EvaluateVisitor_closure42(_this), _s9_), A.BuiltInCallable$function0("module-variables", _s7_, new A._EvaluateVisitor_closure43(_this), _s9_), A.BuiltInCallable$function0("module-functions", _s7_, new A._EvaluateVisitor_closure44(_this), _s9_), A.BuiltInCallable$function0("module-mixins", _s7_, new A._EvaluateVisitor_closure45(_this), _s9_), A.BuiltInCallable$function0("get-function", "$name, $css: false, $module: null", new A._EvaluateVisitor_closure46(_this), _s9_), A.BuiltInCallable$function0("get-mixin", _s20_, new A._EvaluateVisitor_closure47(_this), _s9_), new A.AsyncBuiltInCallable0("call", A.ScssParser$0("@function call($function, $args...) {", null, _s9_).parseArgumentDeclaration$0(), new A._EvaluateVisitor_closure48(_this), false)], t1), + metaMixins = A._setArrayType([A.AsyncBuiltInCallable$mixin0("load-css", "$url, $with: null", new A._EvaluateVisitor_closure49(_this), false, _s9_), A.AsyncBuiltInCallable$mixin0("apply", "$mixin, $args...", new A._EvaluateVisitor_closure50(_this), true, _s9_)], t1); + t1 = type$.AsyncBuiltInCallable_2; + t2 = A.List_List$of($.$get$global6(), true, t1); + B.JSArray_methods.addAll$1(t2, $.$get$local0()); + B.JSArray_methods.addAll$1(t2, metaFunctions); + metaModule = A.BuiltInModule$0("meta", t2, metaMixins, null, t1); + for (t1 = A.List_List$of($.$get$coreModules0(), true, type$.BuiltInModule_AsyncCallable_2), t1.push(metaModule), t2 = t1.length, t3 = _this._async_evaluate0$_builtInModules, _i = 0; _i < t1.length; t1.length === t2 || (0, A.throwConcurrentModificationError)(t1), ++_i) { + module = t1[_i]; + t3.$indexSet(0, module.url, module); + } + t1 = A._setArrayType([], type$.JSArray_AsyncCallable_2); + B.JSArray_methods.addAll$1(t1, functions); + B.JSArray_methods.addAll$1(t1, $.$get$globalFunctions0()); + B.JSArray_methods.addAll$1(t1, metaFunctions); + for (t2 = t1.length, t3 = _this._async_evaluate0$_builtInFunctions, _i = 0; _i < t1.length; t1.length === t2 || (0, A.throwConcurrentModificationError)(t1), ++_i) { + $function = t1[_i]; + t4 = J.get$name$x($function); + t3.$indexSet(0, A.stringReplaceAllUnchecked(t4, "_", "-"), $function); + } + }, + run$2(_, importer, node) { + return this.run$body$_EvaluateVisitor0(0, importer, node); + }, + run$body$_EvaluateVisitor0(_, importer, node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Record_2_Set_Uri_loadedUrls_and_CssStylesheet_stylesheet_2), + $async$returnValue, $async$handler = 2, $async$currentError, $async$self = this, error, stackTrace, t1, exception, $async$exception; + var $async$run$2 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) { + $async$currentError = $async$result; + $async$goto = $async$handler; + } + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$handler = 4; + t1 = type$.nullable_Object; + t1 = A.runZoned(new A._EvaluateVisitor_run_closure2($async$self, node, importer), A.LinkedHashMap_LinkedHashMap$_literal([B.Symbol__evaluationContext, new A._EvaluationContext2($async$self, node)], t1, t1), type$.FutureOr_Record_2_Set_Uri_loadedUrls_and_CssStylesheet_stylesheet_2); + $async$goto = 7; + return A._asyncAwait(type$.Future_Record_2_Set_Uri_loadedUrls_and_CssStylesheet_stylesheet_2._is(t1) ? t1 : A._Future$value(t1, type$.Record_2_Set_Uri_loadedUrls_and_CssStylesheet_stylesheet_2), $async$run$2); + case 7: + // returning from await. + t1 = $async$result; + $async$returnValue = t1; + // goto return + $async$goto = 1; + break; + $async$handler = 2; + // goto after finally + $async$goto = 6; + break; + case 4: + // catch + $async$handler = 3; + $async$exception = $async$currentError; + t1 = A.unwrapException($async$exception); + if (t1 instanceof A.SassException0) { + error = t1; + stackTrace = A.getTraceFromException($async$exception); + A.throwWithTrace0(error.withLoadedUrls$1($async$self._async_evaluate0$_loadedUrls), error, stackTrace); + } else + throw $async$exception; + // goto after finally + $async$goto = 6; + break; + case 3: + // uncaught + // goto rethrow + $async$goto = 2; + break; + case 6: + // after finally + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + case 2: + // rethrow + return A._asyncRethrow($async$currentError, $async$completer); + } + }); + return A._asyncStartSync($async$run$2, $async$completer); + }, + _async_evaluate0$_assertInModule$1$2(value, $name) { + if (value != null) + return value; + throw A.wrapException(A.StateError$("Can't access " + $name + " outside of a module.")); + }, + _async_evaluate0$_assertInModule$2(value, $name) { + return this._async_evaluate0$_assertInModule$1$2(value, $name, type$.dynamic); + }, + _async_evaluate0$_loadModule$7$baseUrl$configuration$namesInErrors(url, stackFrame, nodeWithSpan, callback, baseUrl, configuration, namesInErrors) { + return this._loadModule$body$_EvaluateVisitor0(url, stackFrame, nodeWithSpan, callback, baseUrl, configuration, namesInErrors); + }, + _async_evaluate0$_loadModule$5$configuration(url, stackFrame, nodeWithSpan, callback, configuration) { + return this._async_evaluate0$_loadModule$7$baseUrl$configuration$namesInErrors(url, stackFrame, nodeWithSpan, callback, null, configuration, false); + }, + _async_evaluate0$_loadModule$4(url, stackFrame, nodeWithSpan, callback) { + return this._async_evaluate0$_loadModule$7$baseUrl$configuration$namesInErrors(url, stackFrame, nodeWithSpan, callback, null, null, false); + }, + _loadModule$body$_EvaluateVisitor0(url, stackFrame, nodeWithSpan, callback, baseUrl, configuration, namesInErrors) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void), + $async$returnValue, $async$self = this, _0_0, t2, t1; + var $async$_async_evaluate0$_loadModule$7$baseUrl$configuration$namesInErrors = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = {}; + t1.builtInModule = null; + _0_0 = $async$self._async_evaluate0$_builtInModules.$index(0, url); + $async$goto = _0_0 != null ? 3 : 4; + break; + case 3: + // then + t1.builtInModule = _0_0; + if (configuration instanceof A.ExplicitConfiguration0) { + t1 = namesInErrors ? "Built-in module " + url.toString$0(0) + " can't be configured." : "Built-in modules can't be configured."; + t2 = configuration.nodeWithSpan; + throw A.wrapException($async$self._async_evaluate0$_exception$2(t1, t2.get$span(t2))); + } + $async$goto = 5; + return A._asyncAwait($async$self._async_evaluate0$_addExceptionSpanAsync$1$2(nodeWithSpan, new A._EvaluateVisitor__loadModule_closure5(t1, callback), type$.void), $async$_async_evaluate0$_loadModule$7$baseUrl$configuration$namesInErrors); + case 5: + // returning from await. + // goto return + $async$goto = 1; + break; + case 4: + // join + $async$goto = 6; + return A._asyncAwait($async$self._async_evaluate0$_withStackFrame$1$3(stackFrame, nodeWithSpan, new A._EvaluateVisitor__loadModule_closure6($async$self, url, nodeWithSpan, baseUrl, namesInErrors, configuration, callback), type$.Null), $async$_async_evaluate0$_loadModule$7$baseUrl$configuration$namesInErrors); + case 6: + // returning from await. + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$_async_evaluate0$_loadModule$7$baseUrl$configuration$namesInErrors, $async$completer); + }, + _async_evaluate0$_execute$5$configuration$namesInErrors$nodeWithSpan(importer, stylesheet, configuration, namesInErrors, nodeWithSpan) { + return this._execute$body$_EvaluateVisitor0(importer, stylesheet, configuration, namesInErrors, nodeWithSpan); + }, + _async_evaluate0$_execute$2(importer, stylesheet) { + return this._async_evaluate0$_execute$5$configuration$namesInErrors$nodeWithSpan(importer, stylesheet, null, false, null); + }, + _execute$body$_EvaluateVisitor0(importer, stylesheet, configuration, namesInErrors, nodeWithSpan) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Module_AsyncCallable_2), + $async$returnValue, $async$self = this, currentConfiguration, t2, t3, message, existingSpan, configurationSpan, environment, css, preModuleComments, extensionStore, module, url, t1, _0_0; + var $async$_async_evaluate0$_execute$5$configuration$namesInErrors$nodeWithSpan = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + url = stylesheet.span.file.url; + t1 = $async$self._async_evaluate0$_modules; + _0_0 = t1.$index(0, url); + if (_0_0 != null) { + t1 = configuration == null; + currentConfiguration = t1 ? $async$self._async_evaluate0$_configuration : configuration; + t2 = $async$self._async_evaluate0$_moduleConfigurations.$index(0, url); + t3 = t2._configuration0$__originalConfiguration; + t2 = t3 == null ? t2 : t3; + t3 = currentConfiguration._configuration0$__originalConfiguration; + if (t2 !== (t3 == null ? currentConfiguration : t3) && currentConfiguration instanceof A.ExplicitConfiguration0) { + if (namesInErrors) { + t2 = $.$get$context(); + url.toString; + message = t2.prettyUri$1(url) + string$.x20was_a; + } else + message = string$.This_mw; + t2 = $async$self._async_evaluate0$_moduleNodes.$index(0, url); + existingSpan = t2 == null ? null : t2.get$span(t2); + if (t1) { + t1 = currentConfiguration.nodeWithSpan; + configurationSpan = t1.get$span(t1); + } else + configurationSpan = null; + t1 = A.LinkedHashMap_LinkedHashMap$_empty(type$.FileSpan, type$.String); + if (existingSpan != null) + t1.$indexSet(0, existingSpan, "original load"); + if (configurationSpan != null) + t1.$indexSet(0, configurationSpan, "configuration"); + throw A.wrapException(t1.get$isEmpty(0) ? $async$self._async_evaluate0$_exception$1(message) : $async$self._async_evaluate0$_multiSpanException$3(message, "new load", t1)); + } + $async$returnValue = _0_0; + // goto return + $async$goto = 1; + break; + } + environment = A.AsyncEnvironment$0(); + css = A._Cell$(); + preModuleComments = A._Cell$(); + extensionStore = A.ExtensionStore$0(); + $async$goto = 3; + return A._asyncAwait($async$self._async_evaluate0$_withEnvironment$1$2(environment, new A._EvaluateVisitor__execute_closure2($async$self, importer, stylesheet, extensionStore, configuration, css, preModuleComments), type$.Null), $async$_async_evaluate0$_execute$5$configuration$namesInErrors$nodeWithSpan); + case 3: + // returning from await. + t2 = css._readLocal$0(); + t3 = preModuleComments._readLocal$0(); + module = environment.toModule$3(t2, t3 == null ? B.Map_empty15 : t3, extensionStore); + if (url != null) { + t1.$indexSet(0, url, module); + $async$self._async_evaluate0$_moduleConfigurations.$indexSet(0, url, $async$self._async_evaluate0$_configuration); + if (nodeWithSpan != null) + $async$self._async_evaluate0$_moduleNodes.$indexSet(0, url, nodeWithSpan); + } + $async$returnValue = module; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$_async_evaluate0$_execute$5$configuration$namesInErrors$nodeWithSpan, $async$completer); + }, + _async_evaluate0$_addOutOfOrderImports$0() { + var t1, t2, _this = this, _s5_ = "_root", + _s13_ = "_endOfImports", + _0_0 = _this._async_evaluate0$_outOfOrderImports; + $label0$0: { + if (_0_0 == null) { + t1 = _this._async_evaluate0$_assertInModule$2(_this._async_evaluate0$__root, _s5_).children; + break $label0$0; + } + t1 = _this._async_evaluate0$_assertInModule$2(_this._async_evaluate0$__root, _s5_).children; + t1 = A.List_List$of(A.SubListIterable$(t1, 0, A.checkNotNullable(_this._async_evaluate0$_assertInModule$2(_this._async_evaluate0$__endOfImports, _s13_), "count", type$.int), t1.$ti._eval$1("ListBase.E")), true, type$.ModifiableCssNode_2); + B.JSArray_methods.addAll$1(t1, _0_0); + t2 = _this._async_evaluate0$_assertInModule$2(_this._async_evaluate0$__root, _s5_).children; + B.JSArray_methods.addAll$1(t1, A.SubListIterable$(t2, _this._async_evaluate0$_assertInModule$2(_this._async_evaluate0$__endOfImports, _s13_), null, t2.$ti._eval$1("ListBase.E"))); + break $label0$0; + } + return t1; + }, + _async_evaluate0$_combineCss$2$clone(root, clone) { + var selectors, _0_0, t1, imports, css, sorted, t2; + if (!B.JSArray_methods.any$1(root.get$upstream(), new A._EvaluateVisitor__combineCss_closure5())) { + selectors = root.get$extensionStore().get$simpleSelectors(); + _0_0 = A.IterableExtension_get_firstOrNull(root.get$extensionStore().extensionsWhereTarget$1(new A._EvaluateVisitor__combineCss_closure6(selectors))); + if (_0_0 != null) + this._async_evaluate0$_throwForUnsatisfiedExtension$1(_0_0); + return root.get$css(root); + } + t1 = type$.JSArray_CssNode_2; + imports = A._setArrayType([], t1); + css = A._setArrayType([], t1); + t1 = type$.Module_AsyncCallable_2; + sorted = A.ListQueue$(t1); + new A._EvaluateVisitor__combineCss_visitModule2(this, A.LinkedHashSet_LinkedHashSet$_empty(t1), clone, css, imports, sorted).call$1(root); + if (root.get$transitivelyContainsExtensions()) + this._async_evaluate0$_extendModules$1(sorted); + t1 = B.JSArray_methods.$add(imports, css); + t2 = root.get$css(root); + return new A.CssStylesheet0(new A.UnmodifiableListView(t1, type$.UnmodifiableListView_CssNode_2), t2.get$span(t2)); + }, + _async_evaluate0$_combineCss$1(root) { + return this._async_evaluate0$_combineCss$2$clone(root, false); + }, + _async_evaluate0$_extendModules$1(sortedModules) { + var t1, t2, t3, originalSelectors, $self, t4, t5, _i, upstream, _0_0, + downstreamExtensionStores = A.LinkedHashMap_LinkedHashMap$_empty(type$.Uri, type$.List_ExtensionStore_2), + unsatisfiedExtensions = new A._LinkedIdentityHashSet(type$._LinkedIdentityHashSet_Extension_2); + for (t1 = A._ListQueueIterator$(sortedModules, sortedModules.$ti._precomputed1), t2 = t1.$ti._precomputed1; t1.moveNext$0();) { + t3 = t1._collection$_current; + if (t3 == null) + t3 = t2._as(t3); + originalSelectors = t3.get$extensionStore().get$simpleSelectors().toSet$0(0); + unsatisfiedExtensions.addAll$1(0, t3.get$extensionStore().extensionsWhereTarget$1(new A._EvaluateVisitor__extendModules_closure5(originalSelectors))); + $self = downstreamExtensionStores.$index(0, t3.get$url(t3)); + t4 = t3.get$extensionStore().get$addExtensions(); + if ($self != null) + t4.call$1($self); + t4 = t3.get$extensionStore(); + if (t4.get$isEmpty(t4)) + continue; + for (t4 = t3.get$upstream(), t5 = t4.length, _i = 0; _i < t4.length; t4.length === t5 || (0, A.throwConcurrentModificationError)(t4), ++_i) { + upstream = t4[_i]; + _0_0 = upstream.get$url(upstream); + if (_0_0 != null) + J.add$1$ax(downstreamExtensionStores.putIfAbsent$2(_0_0, new A._EvaluateVisitor__extendModules_closure6()), t3.get$extensionStore()); + } + unsatisfiedExtensions.removeAll$1(t3.get$extensionStore().extensionsWhereTarget$1(originalSelectors.get$contains(originalSelectors))); + } + if (unsatisfiedExtensions._collection$_length !== 0) + this._async_evaluate0$_throwForUnsatisfiedExtension$1(unsatisfiedExtensions.get$first(0)); + }, + _async_evaluate0$_throwForUnsatisfiedExtension$1(extension) { + throw A.wrapException(A.SassException$0(string$.The_ta + extension.target.toString$0(0) + ' !optional" to avoid this error.', extension.span, null)); + }, + _async_evaluate0$_indexAfterImports$1(statements) { + var t1, lastImport, i, _0_0; + for (t1 = J.getInterceptor$asx(statements), lastImport = -1, i = 0; i < t1.get$length(statements); ++i) { + $label0$0: { + _0_0 = t1.$index(statements, i); + if (_0_0 instanceof A.ModifiableCssImport0) + break $label0$0; + if (_0_0 instanceof A.ModifiableCssComment0) + continue; + break; + } + lastImport = i; + } + return lastImport + 1; + }, + visitStylesheet$1(node) { + return this.visitStylesheet$body$_EvaluateVisitor0(node); + }, + visitStylesheet$body$_EvaluateVisitor0(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.nullable_Value_2), + $async$returnValue, $async$self = this, t1, t2, _i; + var $async$visitStylesheet$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = node.children, t2 = t1.length, _i = 0; + case 3: + // for condition + if (!(_i < t2)) { + // goto after for + $async$goto = 5; + break; + } + $async$goto = 6; + return A._asyncAwait(t1[_i].accept$1($async$self), $async$visitStylesheet$1); + case 6: + // returning from await. + case 4: + // for update + ++_i; + // goto for condition + $async$goto = 3; + break; + case 5: + // after for + $async$returnValue = null; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$visitStylesheet$1, $async$completer); + }, + visitAtRootRule$1(node) { + return this.visitAtRootRule$body$_EvaluateVisitor0(node); + }, + visitAtRootRule$body$_EvaluateVisitor0(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.nullable_Value_2), + $async$returnValue, $async$self = this, _1_0, resolved, query, $parent, included, t1, _2_0, root, first, rest, innerCopy, outerCopy, _i, copy, _0_0; + var $async$visitAtRootRule$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + _0_0 = node.query; + $async$goto = _0_0 != null ? 3 : 5; + break; + case 3: + // then + $async$goto = 6; + return A._asyncAwait($async$self._async_evaluate0$_performInterpolationWithMap$2$warnForColor(_0_0, true), $async$visitAtRootRule$1); + case 6: + // returning from await. + _1_0 = $async$result; + resolved = _1_0._0; + _1_0._1; + query = A.AtRootQueryParser$0(resolved, $async$self._async_evaluate0$_logger, null).parse$0(); + // goto join + $async$goto = 4; + break; + case 5: + // else + query = B.AtRootQuery_UsS0; + case 4: + // join + $parent = $async$self._async_evaluate0$_assertInModule$2($async$self._async_evaluate0$__parent, "__parent"); + included = A._setArrayType([], type$.JSArray_ModifiableCssParentNode_2); + for (t1 = type$.CssStylesheet_2; !t1._is($parent); $parent = _2_0) { + if (!query.excludes$1($parent)) + included.push($parent); + _2_0 = $parent._node$_parent; + if (_2_0 == null) + throw A.wrapException(A.StateError$(string$.CssNod)); + } + root = $async$self._async_evaluate0$_trimIncluded$1(included); + $async$goto = root === $async$self._async_evaluate0$_assertInModule$2($async$self._async_evaluate0$__parent, "__parent") ? 7 : 8; + break; + case 7: + // then + $async$goto = 9; + return A._asyncAwait($async$self._async_evaluate0$_environment.scope$1$2$when(new A._EvaluateVisitor_visitAtRootRule_closure5($async$self, node), node.hasDeclarations, type$.Null), $async$visitAtRootRule$1); + case 9: + // returning from await. + $async$returnValue = null; + // goto return + $async$goto = 1; + break; + case 8: + // join + if (included.length >= 1) { + first = included[0]; + rest = B.JSArray_methods.sublist$1(included, 1); + innerCopy = first.copyWithoutChildren$0(); + for (t1 = rest.length, outerCopy = innerCopy, _i = 0; _i < rest.length; rest.length === t1 || (0, A.throwConcurrentModificationError)(rest), ++_i, outerCopy = copy) { + copy = rest[_i].copyWithoutChildren$0(); + copy.addChild$1(outerCopy); + } + root.addChild$1(outerCopy); + } else + innerCopy = root; + $async$goto = 10; + return A._asyncAwait($async$self._async_evaluate0$_scopeForAtRoot$4(node, innerCopy, query, included).call$1(new A._EvaluateVisitor_visitAtRootRule_closure6($async$self, node)), $async$visitAtRootRule$1); + case 10: + // returning from await. + $async$returnValue = null; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$visitAtRootRule$1, $async$completer); + }, + _async_evaluate0$_trimIncluded$1(nodes) { + var $parent, t1, innermostContiguous, i, t2, _0_0, _1_0, root, _this = this, _null = null, _s5_ = "_root", + _s22_ = " to be an ancestor of "; + if (nodes.length === 0) + return _this._async_evaluate0$_assertInModule$2(_this._async_evaluate0$__root, _s5_); + $parent = _this._async_evaluate0$_assertInModule$2(_this._async_evaluate0$__parent, "__parent"); + for (t1 = nodes.length, innermostContiguous = _null, i = 0; i < t1; ++i, $parent = _1_0) { + for (; t2 = nodes[i], $parent !== t2; innermostContiguous = _null, $parent = _0_0) { + _0_0 = $parent._node$_parent; + if (_0_0 == null) + throw A.wrapException(A.ArgumentError$("Expected " + t2.toString$0(0) + _s22_ + _this.toString$0(0) + ".", _null)); + } + if (innermostContiguous == null) + innermostContiguous = i; + _1_0 = $parent._node$_parent; + if (_1_0 == null) + throw A.wrapException(A.ArgumentError$("Expected " + t2.toString$0(0) + _s22_ + _this.toString$0(0) + ".", _null)); + } + if ($parent !== _this._async_evaluate0$_assertInModule$2(_this._async_evaluate0$__root, _s5_)) + return _this._async_evaluate0$_assertInModule$2(_this._async_evaluate0$__root, _s5_); + innermostContiguous.toString; + root = nodes[innermostContiguous]; + B.JSArray_methods.removeRange$2(nodes, innermostContiguous, nodes.length); + return root; + }, + _async_evaluate0$_scopeForAtRoot$4(node, newParent, query, included) { + var _this = this, + scope = new A._EvaluateVisitor__scopeForAtRoot_closure17(_this, newParent, node), + t1 = query._at_root_query0$_all || query._at_root_query0$_rule; + if (t1 !== query.include) + scope = new A._EvaluateVisitor__scopeForAtRoot_closure18(_this, scope); + if (_this._async_evaluate0$_mediaQueries != null && query.excludesName$1("media")) + scope = new A._EvaluateVisitor__scopeForAtRoot_closure19(_this, scope); + if (_this._async_evaluate0$_inKeyframes && query.excludesName$1("keyframes")) + scope = new A._EvaluateVisitor__scopeForAtRoot_closure20(_this, scope); + return _this._async_evaluate0$_inUnknownAtRule && !B.JSArray_methods.any$1(included, new A._EvaluateVisitor__scopeForAtRoot_closure21()) ? new A._EvaluateVisitor__scopeForAtRoot_closure22(_this, scope) : scope; + }, + visitContentBlock$1(node) { + return A.throwExpression(A.UnsupportedError$(string$.Evalua)); + }, + visitContentRule$1(node) { + return this.visitContentRule$body$_EvaluateVisitor0(node); + }, + visitContentRule$body$_EvaluateVisitor0(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.nullable_Value_2), + $async$returnValue, $async$self = this, $content; + var $async$visitContentRule$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + $content = $async$self._async_evaluate0$_environment._async_environment0$_content; + if ($content == null) { + $async$returnValue = null; + // goto return + $async$goto = 1; + break; + } + $async$goto = 3; + return A._asyncAwait($async$self._async_evaluate0$_runUserDefinedCallable$1$4(node.$arguments, $content, node, new A._EvaluateVisitor_visitContentRule_closure2($async$self, $content), type$.Null), $async$visitContentRule$1); + case 3: + // returning from await. + $async$returnValue = null; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$visitContentRule$1, $async$completer); + }, + visitDebugRule$1(node) { + return this.visitDebugRule$body$_EvaluateVisitor0(node); + }, + visitDebugRule$body$_EvaluateVisitor0(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.nullable_Value_2), + $async$returnValue, $async$self = this, value, t1; + var $async$visitDebugRule$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$goto = 3; + return A._asyncAwait(node.expression.accept$1($async$self), $async$visitDebugRule$1); + case 3: + // returning from await. + value = $async$result; + t1 = value instanceof A.SassString0 ? value._string0$_text : A.serializeValue0(value, true, true); + $async$self._async_evaluate0$_logger.debug$2(0, t1, node.span); + $async$returnValue = null; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$visitDebugRule$1, $async$completer); + }, + visitDeclaration$1(node) { + return this.visitDeclaration$body$_EvaluateVisitor0(node); + }, + visitDeclaration$body$_EvaluateVisitor0(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.nullable_Value_2), + $async$returnValue, $async$self = this, t2, $name, _0_0, _1_0, value, t3, t4, t5, _2_0, oldDeclarationName, t1; + var $async$visitDeclaration$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = {}; + if (($async$self._async_evaluate0$_atRootExcludingStyleRule ? null : $async$self._async_evaluate0$_styleRuleIgnoringAtRoot) == null && !$async$self._async_evaluate0$_inUnknownAtRule && !$async$self._async_evaluate0$_inKeyframes) + throw A.wrapException($async$self._async_evaluate0$_exception$2(string$.Declarm, node.span)); + if ($async$self._async_evaluate0$_declarationName != null && B.JSString_methods.startsWith$1(node.name.get$initialPlain(), "--")) + throw A.wrapException($async$self._async_evaluate0$_exception$2(string$.Declarw, node.span)); + t2 = node.name; + $async$goto = 3; + return A._asyncAwait($async$self._async_evaluate0$_interpolationToValue$2$warnForColor(t2, true), $async$visitDeclaration$1); + case 3: + // returning from await. + $name = $async$result; + _0_0 = $async$self._async_evaluate0$_declarationName; + if (_0_0 != null) + $name = new A.CssValue0(_0_0 + "-" + A.S($name.value), $name.span, type$.CssValue_String_2); + _1_0 = node.value; + $async$goto = _1_0 != null ? 4 : 5; + break; + case 4: + // then + $async$goto = 6; + return A._asyncAwait(_1_0.accept$1($async$self), $async$visitDeclaration$1); + case 6: + // returning from await. + value = $async$result; + if (!value.get$isBlank() || value.get$asList().length === 0) { + t3 = $async$self._async_evaluate0$_assertInModule$2($async$self._async_evaluate0$__parent, "__parent"); + t4 = _1_0.get$span(_1_0); + t2 = B.JSString_methods.startsWith$1(t2.get$initialPlain(), "--"); + if ($async$self._async_evaluate0$_sourceMap) { + t5 = A.NullableExtension_andThen0(_1_0, $async$self.get$_async_evaluate0$_expressionNode()); + t5 = t5 == null ? null : J.get$span$z(t5); + } else + t5 = null; + t3.addChild$1(A.ModifiableCssDeclaration$0($name, new A.CssValue0(value, t4, type$.CssValue_Value_2), node.span, t2, t5)); + } else if (J.startsWith$1$s($name.value, "--")) + throw A.wrapException($async$self._async_evaluate0$_exception$2("Custom property values may not be empty.", _1_0.get$span(_1_0))); + case 5: + // join + t1.children = null; + _2_0 = node.children; + $async$goto = _2_0 != null ? 7 : 8; + break; + case 7: + // then + t1.children = _2_0; + oldDeclarationName = $async$self._async_evaluate0$_declarationName; + $async$self._async_evaluate0$_declarationName = $name.value; + $async$goto = 9; + return A._asyncAwait($async$self._async_evaluate0$_environment.scope$1$2$when(new A._EvaluateVisitor_visitDeclaration_closure2(t1, $async$self), node.hasDeclarations, type$.Null), $async$visitDeclaration$1); + case 9: + // returning from await. + $async$self._async_evaluate0$_declarationName = oldDeclarationName; + case 8: + // join + $async$returnValue = null; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$visitDeclaration$1, $async$completer); + }, + visitEachRule$1(node) { + return this.visitEachRule$body$_EvaluateVisitor0(node); + }, + visitEachRule$body$_EvaluateVisitor0(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.nullable_Value_2), + $async$returnValue, $async$self = this, _box_0, t1, list, nodeWithSpan, _0_0; + var $async$visitEachRule$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + _box_0 = {}; + t1 = node.list; + $async$goto = 3; + return A._asyncAwait(t1.accept$1($async$self), $async$visitEachRule$1); + case 3: + // returning from await. + list = $async$result; + nodeWithSpan = $async$self._async_evaluate0$_expressionNode$1(t1); + _0_0 = node.variables; + $label0$0: { + _box_0.variable = null; + if (_0_0.length === 1) { + _box_0.variable = _0_0[0]; + t1 = new A._EvaluateVisitor_visitEachRule_closure8(_box_0, $async$self, nodeWithSpan); + break $label0$0; + } + _box_0.variables = null; + _box_0.variables = _0_0; + t1 = new A._EvaluateVisitor_visitEachRule_closure9(_box_0, $async$self, nodeWithSpan); + break $label0$0; + } + $async$returnValue = $async$self._async_evaluate0$_environment.scope$1$2$semiGlobal(new A._EvaluateVisitor_visitEachRule_closure10($async$self, list, t1, node), true, type$.nullable_Value_2); + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$visitEachRule$1, $async$completer); + }, + _async_evaluate0$_setMultipleVariables$3(variables, value, nodeWithSpan) { + var i, + list = value.get$asList(), + t1 = variables.length, + minLength = Math.min(t1, list.length); + for (i = 0; i < minLength; ++i) + this._async_evaluate0$_environment.setLocalVariable$3(variables[i], this._async_evaluate0$_withoutSlash$2(list[i], nodeWithSpan), nodeWithSpan); + for (i = minLength; i < t1; ++i) + this._async_evaluate0$_environment.setLocalVariable$3(variables[i], B.C__SassNull0, nodeWithSpan); + }, + visitErrorRule$1(node) { + return this.visitErrorRule$body$_EvaluateVisitor0(node); + }, + visitErrorRule$body$_EvaluateVisitor0(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Value_2), + $async$self = this, $async$temp1, $async$temp2; + var $async$visitErrorRule$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$temp1 = A; + $async$temp2 = J; + $async$goto = 2; + return A._asyncAwait(node.expression.accept$1($async$self), $async$visitErrorRule$1); + case 2: + // returning from await. + throw $async$temp1.wrapException($async$self._async_evaluate0$_exception$2($async$temp2.toString$0$($async$result), node.span)); + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$visitErrorRule$1, $async$completer); + }, + visitExtendRule$1(node) { + return this.visitExtendRule$body$_EvaluateVisitor0(node); + }, + visitExtendRule$body$_EvaluateVisitor0(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.nullable_Value_2), + $async$returnValue, $async$self = this, t1, t2, t3, t4, t5, _i, complex, visitor, t6, t7, _0_0, targetText, targetMap, compound, styleRule; + var $async$visitExtendRule$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + styleRule = $async$self._async_evaluate0$_atRootExcludingStyleRule ? null : $async$self._async_evaluate0$_styleRuleIgnoringAtRoot; + if (styleRule == null || $async$self._async_evaluate0$_declarationName != null) + throw A.wrapException($async$self._async_evaluate0$_exception$2(string$.x40exten, node.span)); + for (t1 = styleRule.originalSelector.components, t2 = t1.length, t3 = node.span, t4 = type$.SourceSpan, t5 = type$.String, _i = 0; _i < t2; ++_i) { + complex = t1[_i]; + if (!complex.accept$1(B._IsBogusVisitor_true0)) + continue; + visitor = A._SerializeVisitor$0(null, true, null, true, false, null, true); + complex.accept$1(visitor); + t6 = B.JSString_methods.trim$0(visitor._serialize0$_buffer.toString$0(0)); + t7 = complex.accept$1(B.C__IsUselessVisitor0) ? "can't" : "shouldn't"; + $async$self._async_evaluate0$_warn$3('The selector "' + t6 + '" is invalid CSS and ' + t7 + string$.x20be_an, new A.MultiSpan0(A.SpanExtensions_trimRight0(complex.span), "invalid selector", A.ConstantMap_ConstantMap$from(A.LinkedHashMap_LinkedHashMap$_literal([t3, "@extend rule"], t4, t5), t4, t5)), B.Deprecation_XV6); + } + $async$goto = 3; + return A._asyncAwait($async$self._async_evaluate0$_performInterpolationWithMap$2$warnForColor(node.selector, true), $async$visitExtendRule$1); + case 3: + // returning from await. + _0_0 = $async$result; + targetText = _0_0._0; + targetMap = _0_0._1; + for (t1 = A.SelectorList_SelectorList$parse0(A.trimAscii0(targetText, true), false, true, targetMap, $async$self._async_evaluate0$_logger).components, t2 = t1.length, t3 = styleRule._style_rule0$_selector._box0$_inner, _i = 0; _i < t2; ++_i) { + complex = t1[_i]; + compound = complex.get$singleCompound(); + if (compound == null) + throw A.wrapException(A.SassFormatException$0("complex selectors may not be extended.", complex.span, null)); + t4 = compound.components; + t5 = t4.length === 1 ? B.JSArray_methods.get$first(t4) : null; + if (t5 == null) + throw A.wrapException(A.SassFormatException$0(string$.compou + B.JSArray_methods.join$1(t4, ", ") + string$.x60_inst, compound.span, null)); + $async$self._async_evaluate0$_assertInModule$2($async$self._async_evaluate0$__extensionStore, "_extensionStore").addExtension$4(t3.value, t5, node, $async$self._async_evaluate0$_mediaQueries); + } + $async$returnValue = null; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$visitExtendRule$1, $async$completer); + }, + visitAtRule$1(node) { + return this.visitAtRule$body$_EvaluateVisitor0(node); + }, + visitAtRule$body$_EvaluateVisitor0(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.nullable_Value_2), + $async$returnValue, $async$self = this, $name, t1, value, children, wasInKeyframes, wasInUnknownAtRule; + var $async$visitAtRule$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + if ($async$self._async_evaluate0$_declarationName != null) + throw A.wrapException($async$self._async_evaluate0$_exception$2(string$.At_rul, node.span)); + $async$goto = 3; + return A._asyncAwait($async$self._async_evaluate0$_interpolationToValue$1(node.name), $async$visitAtRule$1); + case 3: + // returning from await. + $name = $async$result; + t1 = A.NullableExtension_andThen0(node.value, new A._EvaluateVisitor_visitAtRule_closure8($async$self)); + $async$goto = 4; + return A._asyncAwait(type$.Future_nullable_CssValue_String_2._is(t1) ? t1 : A._Future$value(t1, type$.nullable_CssValue_String_2), $async$visitAtRule$1); + case 4: + // returning from await. + value = $async$result; + children = node.children; + if (children == null) { + $async$self._async_evaluate0$_assertInModule$2($async$self._async_evaluate0$__parent, "__parent").addChild$1(A.ModifiableCssAtRule$0($name, node.span, true, value)); + $async$returnValue = null; + // goto return + $async$goto = 1; + break; + } + wasInKeyframes = $async$self._async_evaluate0$_inKeyframes; + wasInUnknownAtRule = $async$self._async_evaluate0$_inUnknownAtRule; + if (A.unvendor0($name.value) === "keyframes") + $async$self._async_evaluate0$_inKeyframes = true; + else + $async$self._async_evaluate0$_inUnknownAtRule = true; + $async$goto = 5; + return A._asyncAwait($async$self._async_evaluate0$_withParent$2$4$scopeWhen$through(A.ModifiableCssAtRule$0($name, node.span, false, value), new A._EvaluateVisitor_visitAtRule_closure9($async$self, $name, children), node.hasDeclarations, new A._EvaluateVisitor_visitAtRule_closure10(), type$.ModifiableCssAtRule_2, type$.Null), $async$visitAtRule$1); + case 5: + // returning from await. + $async$self._async_evaluate0$_inUnknownAtRule = wasInUnknownAtRule; + $async$self._async_evaluate0$_inKeyframes = wasInKeyframes; + $async$returnValue = null; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$visitAtRule$1, $async$completer); + }, + visitForRule$1(node) { + return this.visitForRule$body$_EvaluateVisitor0(node); + }, + visitForRule$body$_EvaluateVisitor0(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.nullable_Value_2), + $async$returnValue, $async$self = this, t1, t2, t3, fromNumber, t4, toNumber, from, to, direction; + var $async$visitForRule$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = {}; + t2 = node.from; + t3 = type$.SassNumber_2; + $async$goto = 3; + return A._asyncAwait($async$self._async_evaluate0$_addExceptionSpanAsync$1$2(t2, new A._EvaluateVisitor_visitForRule_closure14($async$self, node), t3), $async$visitForRule$1); + case 3: + // returning from await. + fromNumber = $async$result; + t4 = node.to; + $async$goto = 4; + return A._asyncAwait($async$self._async_evaluate0$_addExceptionSpanAsync$1$2(t4, new A._EvaluateVisitor_visitForRule_closure15($async$self, node), t3), $async$visitForRule$1); + case 4: + // returning from await. + toNumber = $async$result; + from = $async$self._async_evaluate0$_addExceptionSpan$2(t2, new A._EvaluateVisitor_visitForRule_closure16(fromNumber)); + to = t1.to = $async$self._async_evaluate0$_addExceptionSpan$2(t4, new A._EvaluateVisitor_visitForRule_closure17(toNumber, fromNumber)); + direction = from > to ? -1 : 1; + if (from === (!node.isExclusive ? t1.to = to + direction : to)) { + $async$returnValue = null; + // goto return + $async$goto = 1; + break; + } + $async$returnValue = $async$self._async_evaluate0$_environment.scope$1$2$semiGlobal(new A._EvaluateVisitor_visitForRule_closure18(t1, $async$self, node, from, direction, fromNumber), true, type$.nullable_Value_2); + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$visitForRule$1, $async$completer); + }, + visitForwardRule$1(node) { + return this.visitForwardRule$body$_EvaluateVisitor0(node); + }, + visitForwardRule$body$_EvaluateVisitor0(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.nullable_Value_2), + $async$returnValue, $async$self = this, newConfiguration, t4, _i, variable, $name, oldConfiguration, adjustedConfiguration, t1, t2, t3; + var $async$visitForwardRule$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + oldConfiguration = $async$self._async_evaluate0$_configuration; + adjustedConfiguration = oldConfiguration.throughForward$1(node); + t1 = node.configuration; + t2 = t1.length; + t3 = node.url; + $async$goto = t2 !== 0 ? 3 : 5; + break; + case 3: + // then + $async$goto = 6; + return A._asyncAwait($async$self._async_evaluate0$_addForwardConfiguration$2(adjustedConfiguration, node), $async$visitForwardRule$1); + case 6: + // returning from await. + newConfiguration = $async$result; + $async$goto = 7; + return A._asyncAwait($async$self._async_evaluate0$_loadModule$5$configuration(t3, "@forward", node, new A._EvaluateVisitor_visitForwardRule_closure5($async$self, node), newConfiguration), $async$visitForwardRule$1); + case 7: + // returning from await. + t3 = type$.String; + t4 = A.LinkedHashSet_LinkedHashSet$_empty(t3); + for (_i = 0; _i < t2; ++_i) { + variable = t1[_i]; + if (!variable.isGuarded) + t4.add$1(0, variable.name); + } + $async$self._async_evaluate0$_removeUsedConfiguration$3$except(adjustedConfiguration, newConfiguration, t4); + t3 = A.LinkedHashSet_LinkedHashSet$_empty(t3); + for (_i = 0; _i < t2; ++_i) + t3.add$1(0, t1[_i].name); + for (t1 = newConfiguration._configuration0$_values, t2 = J.toList$0$ax(t1.get$keys(t1)), t4 = t2.length, _i = 0; _i < t2.length; t2.length === t4 || (0, A.throwConcurrentModificationError)(t2), ++_i) { + $name = t2[_i]; + if (!t3.contains$1(0, $name)) + if (!t1.get$isEmpty(t1)) + t1.remove$1(0, $name); + } + $async$self._async_evaluate0$_assertConfigurationIsEmpty$1(newConfiguration); + // goto join + $async$goto = 4; + break; + case 5: + // else + $async$self._async_evaluate0$_configuration = adjustedConfiguration; + $async$goto = 8; + return A._asyncAwait($async$self._async_evaluate0$_loadModule$4(t3, "@forward", node, new A._EvaluateVisitor_visitForwardRule_closure6($async$self, node)), $async$visitForwardRule$1); + case 8: + // returning from await. + $async$self._async_evaluate0$_configuration = oldConfiguration; + case 4: + // join + $async$returnValue = null; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$visitForwardRule$1, $async$completer); + }, + _async_evaluate0$_addForwardConfiguration$2(configuration, node) { + return this._addForwardConfiguration$body$_EvaluateVisitor0(configuration, node); + }, + _addForwardConfiguration$body$_EvaluateVisitor0(configuration, node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Configuration_2), + $async$returnValue, $async$self = this, t2, t3, t4, t5, _i, variable, t6, oldValue, t7, variableNodeWithSpan, t8, t1, newValues, $async$temp1, $async$temp2, $async$temp3; + var $async$_async_evaluate0$_addForwardConfiguration$2 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = configuration._configuration0$_values; + newValues = A.LinkedHashMap_LinkedHashMap$of(new A.UnmodifiableMapView(t1, type$.UnmodifiableMapView_String_ConfiguredValue_2), type$.String, type$.ConfiguredValue_2); + t2 = node.configuration, t3 = t2.length, t4 = type$._Future_Value_2, t5 = type$.Future_Value_2, _i = 0; + case 3: + // for condition + if (!(_i < t3)) { + // goto after for + $async$goto = 5; + break; + } + variable = t2[_i]; + if (variable.isGuarded) { + t6 = variable.name; + oldValue = t1.get$isEmpty(t1) ? null : t1.remove$1(0, t6); + if (oldValue != null) + t7 = !oldValue.value.$eq(0, B.C__SassNull0); + else { + oldValue = null; + t7 = false; + } + if (t7) { + newValues.$indexSet(0, t6, oldValue); + // goto for update + $async$goto = 4; + break; + } + } + t6 = variable.expression; + variableNodeWithSpan = $async$self._async_evaluate0$_expressionNode$1(t6); + t7 = variable.name; + t6 = t6.accept$1($async$self); + if (!t5._is(t6)) { + t8 = new A._Future($.Zone__current, t4); + t8._state = 8; + t8._resultOrListeners = t6; + t6 = t8; + } + $async$temp1 = newValues; + $async$temp2 = t7; + $async$temp3 = A; + $async$goto = 6; + return A._asyncAwait(t6, $async$_async_evaluate0$_addForwardConfiguration$2); + case 6: + // returning from await. + $async$temp1.$indexSet(0, $async$temp2, new $async$temp3.ConfiguredValue0($async$self._async_evaluate0$_withoutSlash$2($async$result, variableNodeWithSpan), variable.span, variableNodeWithSpan)); + case 4: + // for update + ++_i; + // goto for condition + $async$goto = 3; + break; + case 5: + // after for + if (configuration instanceof A.ExplicitConfiguration0 || t1.get$isEmpty(t1)) { + $async$returnValue = new A.ExplicitConfiguration0(node, newValues, null); + // goto return + $async$goto = 1; + break; + } else { + $async$returnValue = new A.Configuration0(newValues, null); + // goto return + $async$goto = 1; + break; + } + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$_async_evaluate0$_addForwardConfiguration$2, $async$completer); + }, + _async_evaluate0$_registerCommentsForModule$1(module) { + var _this = this, _s5_ = "_root", + t1 = _this._async_evaluate0$__root; + if (t1 == null) + return; + if (_this._async_evaluate0$_assertInModule$2(t1, _s5_).children.get$length(0) === 0 || !module.get$transitivelyContainsCss()) + return; + t1 = _this._async_evaluate0$_preModuleComments; + if (t1 == null) + t1 = _this._async_evaluate0$_preModuleComments = A.LinkedHashMap_LinkedHashMap$_empty(type$.Module_AsyncCallable_2, type$.List_CssComment_2); + J.addAll$1$ax(t1.putIfAbsent$2(module, new A._EvaluateVisitor__registerCommentsForModule_closure2()), new A.UnmodifiableListView(J.cast$1$0$ax(_this._async_evaluate0$_assertInModule$2(_this._async_evaluate0$__root, _s5_).children._collection$_source, type$.CssComment_2), type$.UnmodifiableListView_CssComment_2)); + _this._async_evaluate0$_assertInModule$2(_this._async_evaluate0$__root, _s5_).clearChildren$0(); + _this._async_evaluate0$__endOfImports = 0; + }, + _async_evaluate0$_removeUsedConfiguration$3$except(upstream, downstream, except) { + var t1, t2, t3, t4, _i, $name; + for (t1 = upstream._configuration0$_values, t2 = J.toList$0$ax(t1.get$keys(t1)), t3 = t2.length, t4 = downstream._configuration0$_values, _i = 0; _i < t2.length; t2.length === t3 || (0, A.throwConcurrentModificationError)(t2), ++_i) { + $name = t2[_i]; + if (except.contains$1(0, $name)) + continue; + if (!t4.containsKey$1($name)) + if (!t1.get$isEmpty(t1)) + t1.remove$1(0, $name); + } + }, + _async_evaluate0$_assertConfigurationIsEmpty$2$nameInError(configuration, nameInError) { + var t1, _0_0, $name, value; + if (!(configuration instanceof A.ExplicitConfiguration0)) + return; + t1 = configuration._configuration0$_values; + if (t1.get$isEmpty(t1)) + return; + t1 = A.MapExtensions_get_pairs0(new A.UnmodifiableMapView(t1, type$.UnmodifiableMapView_String_ConfiguredValue_2), type$.String, type$.ConfiguredValue_2); + _0_0 = t1.get$first(t1); + $name = _0_0._0; + value = _0_0._1; + t1 = nameInError ? "$" + $name + string$.x20was_n : string$.This_v; + throw A.wrapException(this._async_evaluate0$_exception$2(t1, value.configurationSpan)); + }, + _async_evaluate0$_assertConfigurationIsEmpty$1(configuration) { + return this._async_evaluate0$_assertConfigurationIsEmpty$2$nameInError(configuration, false); + }, + visitFunctionRule$1(node) { + return this.visitFunctionRule$body$_EvaluateVisitor0(node); + }, + visitFunctionRule$body$_EvaluateVisitor0(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.nullable_Value_2), + $async$returnValue, $async$self = this, t1, t2, t3, t4, index, t5; + var $async$visitFunctionRule$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self._async_evaluate0$_environment; + t2 = t1.closure$0(); + t3 = $async$self._async_evaluate0$_inDependency; + t4 = t1._async_environment0$_functions; + index = t4.length - 1; + t5 = node.name; + t1._async_environment0$_functionIndices.$indexSet(0, t5, index); + J.$indexSet$ax(t4[index], t5, new A.UserDefinedCallable0(node, t2, t3, type$.UserDefinedCallable_AsyncEnvironment_2)); + $async$returnValue = null; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$visitFunctionRule$1, $async$completer); + }, + visitIfRule$1(node) { + return this.visitIfRule$body$_EvaluateVisitor0(node); + }, + visitIfRule$body$_EvaluateVisitor0(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.nullable_Value_2), + $async$returnValue, $async$self = this, t1, t2, _i, clauseToCheck, clause; + var $async$visitIfRule$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + clause = node.lastClause; + t1 = node.clauses, t2 = t1.length, _i = 0; + case 3: + // for condition + if (!(_i < t2)) { + // goto after for + $async$goto = 5; + break; + } + clauseToCheck = t1[_i]; + $async$goto = 6; + return A._asyncAwait(clauseToCheck.expression.accept$1($async$self), $async$visitIfRule$1); + case 6: + // returning from await. + if ($async$result.get$isTruthy()) { + clause = clauseToCheck; + // goto after for + $async$goto = 5; + break; + } + case 4: + // for update + ++_i; + // goto for condition + $async$goto = 3; + break; + case 5: + // after for + t1 = A.NullableExtension_andThen0(clause, new A._EvaluateVisitor_visitIfRule_closure2($async$self)); + $async$goto = 7; + return A._asyncAwait(type$.Future_nullable_Value_2._is(t1) ? t1 : A._Future$value(t1, type$.nullable_Value_2), $async$visitIfRule$1); + case 7: + // returning from await. + $async$returnValue = $async$result; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$visitIfRule$1, $async$completer); + }, + visitImportRule$1(node) { + return this.visitImportRule$body$_EvaluateVisitor0(node); + }, + visitImportRule$body$_EvaluateVisitor0(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.nullable_Value_2), + $async$returnValue, $async$self = this, t1, t2, t3, _i, $import; + var $async$visitImportRule$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = node.imports, t2 = t1.length, t3 = type$.StaticImport_2, _i = 0; + case 3: + // for condition + if (!(_i < t2)) { + // goto after for + $async$goto = 5; + break; + } + $import = t1[_i]; + $async$goto = $import instanceof A.DynamicImport0 ? 6 : 8; + break; + case 6: + // then + $async$goto = 9; + return A._asyncAwait($async$self._async_evaluate0$_visitDynamicImport$1($import), $async$visitImportRule$1); + case 9: + // returning from await. + // goto join + $async$goto = 7; + break; + case 8: + // else + $async$goto = 10; + return A._asyncAwait($async$self._async_evaluate0$_visitStaticImport$1(t3._as($import)), $async$visitImportRule$1); + case 10: + // returning from await. + case 7: + // join + case 4: + // for update + ++_i; + // goto for condition + $async$goto = 3; + break; + case 5: + // after for + $async$returnValue = null; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$visitImportRule$1, $async$completer); + }, + _async_evaluate0$_visitDynamicImport$1($import) { + return this._async_evaluate0$_withStackFrame$1$3("@import", $import, new A._EvaluateVisitor__visitDynamicImport_closure2(this, $import), type$.void); + }, + _async_evaluate0$_loadStylesheet$4$baseUrl$forImport(url, span, baseUrl, forImport) { + return this._loadStylesheet$body$_EvaluateVisitor0(url, span, baseUrl, forImport); + }, + _async_evaluate0$_loadStylesheet$3$baseUrl(url, span, baseUrl) { + return this._async_evaluate0$_loadStylesheet$4$baseUrl$forImport(url, span, baseUrl, false); + }, + _async_evaluate0$_loadStylesheet$3$forImport(url, span, forImport) { + return this._async_evaluate0$_loadStylesheet$4$baseUrl$forImport(url, span, null, forImport); + }, + _loadStylesheet$body$_EvaluateVisitor0(url, span, baseUrl, forImport) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Record_3_Stylesheet_and_nullable_AsyncImporter_importer_and_bool_isDependency_2), + $async$returnValue, $async$handler = 2, $async$currentError, $async$next = [], $async$self = this, importCache, _0_0, importer, canonicalUrl, originalUrl, _1_0, isDependency, stylesheet, _2_0, result, _3_0, error, stackTrace, error0, stackTrace0, message, t1, t2, t3, t4, exception, message0, $async$exception; + var $async$_async_evaluate0$_loadStylesheet$4$baseUrl$forImport = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) { + $async$currentError = $async$result; + $async$goto = $async$handler; + } + while (true) + switch ($async$goto) { + case 0: + // Function start + baseUrl = baseUrl; + $async$handler = 4; + $async$self._async_evaluate0$_importSpan = span; + importCache = null; + _0_0 = $async$self._async_evaluate0$_importCache; + $async$goto = _0_0 != null ? 7 : 8; + break; + case 7: + // then + importCache = _0_0; + if (baseUrl == null) + baseUrl = $async$self._async_evaluate0$_assertInModule$2($async$self._async_evaluate0$__stylesheet, "_stylesheet").span.file.url; + importer = null; + canonicalUrl = null; + originalUrl = null; + $async$goto = 9; + return A._asyncAwait(J.canonicalize$4$baseImporter$baseUrl$forImport$x(importCache, A.Uri_parse(url), $async$self._async_evaluate0$_importer, baseUrl, forImport), $async$_async_evaluate0$_loadStylesheet$4$baseUrl$forImport); + case 9: + // returning from await. + _1_0 = $async$result; + $async$goto = type$.Record_3_nullable_Object_and_nullable_Object_and_nullable_Object_originalUrl._is(_1_0) ? 10 : 11; + break; + case 10: + // then + importer = _1_0._0; + canonicalUrl = _1_0._1; + originalUrl = _1_0._2; + $async$self._async_evaluate0$_loadedUrls.add$1(0, canonicalUrl); + isDependency = $async$self._async_evaluate0$_inDependency || !J.$eq$(importer, $async$self._async_evaluate0$_importer); + stylesheet = null; + t1 = importCache; + t2 = importer; + t3 = canonicalUrl; + t4 = originalUrl; + $async$goto = 12; + return A._asyncAwait(t1.importCanonical$4$originalUrl$quiet(t2, t3, t4, $async$self._async_evaluate0$_quietDeps && isDependency), $async$_async_evaluate0$_loadStylesheet$4$baseUrl$forImport); + case 12: + // returning from await. + _2_0 = $async$result; + if (_2_0 != null) { + stylesheet = _2_0; + t1 = stylesheet; + t2 = importer; + $async$returnValue = new A._Record_3_importer_isDependency(t1, t2, isDependency); + $async$next = [1]; + // goto finally + $async$goto = 5; + break; + } + case 11: + // join + case 8: + // join + $async$goto = $async$self._async_evaluate0$_nodeImporter != null ? 13 : 14; + break; + case 13: + // then + result = null; + t1 = baseUrl; + $async$goto = 15; + return A._asyncAwait($async$self._async_evaluate0$_importLikeNode$3(url, t1 == null ? $async$self._async_evaluate0$_assertInModule$2($async$self._async_evaluate0$__stylesheet, "_stylesheet").span.file.url : t1, forImport), $async$_async_evaluate0$_loadStylesheet$4$baseUrl$forImport); + case 15: + // returning from await. + _3_0 = $async$result; + if (_3_0 != null) { + result = _3_0; + t1 = $async$self._async_evaluate0$_loadedUrls; + A.NullableExtension_andThen0(result._0.span.file.url, t1.get$add(t1)); + t1 = result; + $async$returnValue = t1; + $async$next = [1]; + // goto finally + $async$goto = 5; + break; + } + case 14: + // join + if (B.JSString_methods.startsWith$1(url, "package:") && true) + throw A.wrapException(string$.x22packa); + else + throw A.wrapException("Can't find stylesheet to import."); + $async$next.push(6); + // goto finally + $async$goto = 5; + break; + case 4: + // catch + $async$handler = 3; + $async$exception = $async$currentError; + t1 = A.unwrapException($async$exception); + if (t1 instanceof A.SassException0) + throw $async$exception; + else if (t1 instanceof A.ArgumentError) { + error = t1; + stackTrace = A.getTraceFromException($async$exception); + A.throwWithTrace0($async$self._async_evaluate0$_exception$1(J.toString$0$(error)), error, stackTrace); + } else { + error0 = t1; + stackTrace0 = A.getTraceFromException($async$exception); + message = null; + try { + message = A._asString(J.get$message$x(error0)); + } catch (exception) { + message0 = J.toString$0$(error0); + message = message0; + } + A.throwWithTrace0($async$self._async_evaluate0$_exception$1(message), error0, stackTrace0); + } + $async$next.push(6); + // goto finally + $async$goto = 5; + break; + case 3: + // uncaught + $async$next = [2]; + case 5: + // finally + $async$handler = 2; + $async$self._async_evaluate0$_importSpan = null; + // goto the next finally handler + $async$goto = $async$next.pop(); + break; + case 6: + // after finally + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + case 2: + // rethrow + return A._asyncRethrow($async$currentError, $async$completer); + } + }); + return A._asyncStartSync($async$_async_evaluate0$_loadStylesheet$4$baseUrl$forImport, $async$completer); + }, + _async_evaluate0$_importLikeNode$3(originalUrl, previous, forImport) { + return this._importLikeNode$body$_EvaluateVisitor(originalUrl, previous, forImport); + }, + _importLikeNode$body$_EvaluateVisitor(originalUrl, previous, forImport) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.nullable_Record_3_Stylesheet_and_nullable_AsyncImporter_importer_and_bool_isDependency), + $async$returnValue, $async$self = this, isDependency, url, t2, t1, result; + var $async$_async_evaluate0$_importLikeNode$3 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self._async_evaluate0$_nodeImporter; + result = t1.loadRelative$3(originalUrl, previous, forImport); + $async$goto = result != null ? 3 : 5; + break; + case 3: + // then + isDependency = $async$self._async_evaluate0$_inDependency; + // goto join + $async$goto = 4; + break; + case 5: + // else + $async$goto = 6; + return A._asyncAwait(t1.loadAsync$3(originalUrl, previous, forImport), $async$_async_evaluate0$_importLikeNode$3); + case 6: + // returning from await. + result = $async$result; + if (result == null) { + $async$returnValue = null; + // goto return + $async$goto = 1; + break; + } + isDependency = true; + case 4: + // join + url = result._1; + t1 = B.JSString_methods.startsWith$1(url, "file") ? A.Syntax_forPath0(url) : B.Syntax_SCSS_scss0; + t2 = $async$self._async_evaluate0$_quietDeps && isDependency ? $.$get$Logger_quiet0() : $async$self._async_evaluate0$_logger; + $async$returnValue = new A._Record_3_importer_isDependency(A.Stylesheet_Stylesheet$parse0(result._0, t1, t2, url), null, isDependency); + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$_async_evaluate0$_importLikeNode$3, $async$completer); + }, + _async_evaluate0$_visitStaticImport$1($import) { + return this._visitStaticImport$body$_EvaluateVisitor0($import); + }, + _visitStaticImport$body$_EvaluateVisitor0($import) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void), + $async$self = this, t1, t2, node, $async$temp1, $async$temp2; + var $async$_async_evaluate0$_visitStaticImport$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$goto = 2; + return A._asyncAwait($async$self._async_evaluate0$_interpolationToValue$1($import.url), $async$_async_evaluate0$_visitStaticImport$1); + case 2: + // returning from await. + t1 = $async$result; + t2 = A.NullableExtension_andThen0($import.modifiers, $async$self.get$_async_evaluate0$_interpolationToValue()); + $async$temp1 = A; + $async$temp2 = t1; + $async$goto = 3; + return A._asyncAwait(type$.Future_nullable_CssValue_String_2._is(t2) ? t2 : A._Future$value(t2, type$.nullable_CssValue_String_2), $async$_async_evaluate0$_visitStaticImport$1); + case 3: + // returning from await. + node = new $async$temp1.ModifiableCssImport0($async$temp2, $async$result, $import.span); + if ($async$self._async_evaluate0$_assertInModule$2($async$self._async_evaluate0$__parent, "__parent") !== $async$self._async_evaluate0$_assertInModule$2($async$self._async_evaluate0$__root, "_root")) + $async$self._async_evaluate0$_assertInModule$2($async$self._async_evaluate0$__parent, "__parent").addChild$1(node); + else if ($async$self._async_evaluate0$_assertInModule$2($async$self._async_evaluate0$__endOfImports, "_endOfImports") === J.get$length$asx($async$self._async_evaluate0$_assertInModule$2($async$self._async_evaluate0$__root, "_root").children._collection$_source)) { + $async$self._async_evaluate0$_assertInModule$2($async$self._async_evaluate0$__root, "_root").addChild$1(node); + $async$self._async_evaluate0$__endOfImports = $async$self._async_evaluate0$_assertInModule$2($async$self._async_evaluate0$__endOfImports, "_endOfImports") + 1; + } else { + t1 = $async$self._async_evaluate0$_outOfOrderImports; + (t1 == null ? $async$self._async_evaluate0$_outOfOrderImports = A._setArrayType([], type$.JSArray_ModifiableCssImport_2) : t1).push(node); + } + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$_async_evaluate0$_visitStaticImport$1, $async$completer); + }, + _async_evaluate0$_applyMixin$5(mixin, contentCallable, $arguments, nodeWithSpan, nodeWithSpanWithoutContent) { + return this._applyMixin$body$_EvaluateVisitor0(mixin, contentCallable, $arguments, nodeWithSpan, nodeWithSpanWithoutContent); + }, + _applyMixin$body$_EvaluateVisitor0(mixin, contentCallable, $arguments, nodeWithSpan, nodeWithSpanWithoutContent) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void), + $async$self = this, t1, _0_0, _1_8, t2; + var $async$_async_evaluate0$_applyMixin$5 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + if (mixin == null) + throw A.wrapException($async$self._async_evaluate0$_exception$2("Undefined mixin.", nodeWithSpan.get$span(nodeWithSpan))); + t1 = type$.AsyncBuiltInCallable_2._is(mixin); + $async$goto = t1 && !mixin.get$acceptsContent() && contentCallable != null ? 3 : 4; + break; + case 3: + // then + $async$goto = 5; + return A._asyncAwait($async$self._async_evaluate0$_evaluateArguments$1($arguments), $async$_async_evaluate0$_applyMixin$5); + case 5: + // returning from await. + t1 = $async$result._values; + _0_0 = mixin.callbackFor$2(J.get$length$asx(t1[2]), new A.MapKeySet(t1[0], type$.MapKeySet_String)); + throw A.wrapException(A.MultiSpanSassRuntimeException$0("Mixin doesn't accept a content block.", nodeWithSpanWithoutContent.get$span(nodeWithSpanWithoutContent), "invocation", A.LinkedHashMap_LinkedHashMap$_literal([_0_0._0.get$spanWithName(), "declaration"], type$.FileSpan, type$.String), $async$self._async_evaluate0$_stackTrace$1(nodeWithSpanWithoutContent.get$span(nodeWithSpanWithoutContent)), null)); + case 4: + // join + $async$goto = t1 ? 6 : 7; + break; + case 6: + // then + $async$goto = 8; + return A._asyncAwait($async$self._async_evaluate0$_environment.withContent$2(contentCallable, new A._EvaluateVisitor__applyMixin_closure5($async$self, $arguments, mixin, nodeWithSpanWithoutContent)), $async$_async_evaluate0$_applyMixin$5); + case 8: + // returning from await. + // goto break $label0$0 + $async$goto = 2; + break; + case 7: + // join + t1 = type$.UserDefinedCallable_AsyncEnvironment_2._is(mixin); + if (t1) { + _1_8 = mixin.declaration; + if (_1_8 instanceof A.MixinRule0) + t2 = !type$.MixinRule_2._as(_1_8).get$hasContent() && contentCallable != null; + else + t2 = false; + } else + t2 = false; + if (t2) + throw A.wrapException(A.MultiSpanSassRuntimeException$0("Mixin doesn't accept a content block.", nodeWithSpanWithoutContent.get$span(nodeWithSpanWithoutContent), "invocation", A.LinkedHashMap_LinkedHashMap$_literal([mixin.declaration.$arguments.get$spanWithName(), "declaration"], type$.FileSpan, type$.String), $async$self._async_evaluate0$_stackTrace$1(nodeWithSpanWithoutContent.get$span(nodeWithSpanWithoutContent)), null)); + $async$goto = t1 ? 9 : 10; + break; + case 9: + // then + $async$goto = 11; + return A._asyncAwait($async$self._async_evaluate0$_runUserDefinedCallable$1$4($arguments, mixin, nodeWithSpanWithoutContent, new A._EvaluateVisitor__applyMixin_closure6($async$self, contentCallable, mixin, nodeWithSpanWithoutContent), type$.Null), $async$_async_evaluate0$_applyMixin$5); + case 11: + // returning from await. + // goto break $label0$0 + $async$goto = 2; + break; + case 10: + // join + throw A.wrapException(A.UnsupportedError$("Unknown callable type " + mixin.toString$0(0) + ".")); + case 2: + // break $label0$0 + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$_async_evaluate0$_applyMixin$5, $async$completer); + }, + visitIncludeRule$1(node) { + return this.visitIncludeRule$body$_EvaluateVisitor0(node); + }, + visitIncludeRule$body$_EvaluateVisitor0(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.nullable_Value_2), + $async$returnValue, $async$self = this; + var $async$visitIncludeRule$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$goto = 3; + return A._asyncAwait($async$self._async_evaluate0$_applyMixin$5($async$self._async_evaluate0$_addExceptionSpan$2(node, new A._EvaluateVisitor_visitIncludeRule_closure8($async$self, node)), A.NullableExtension_andThen0(node.content, new A._EvaluateVisitor_visitIncludeRule_closure9($async$self)), node.$arguments, node, new A._FakeAstNode0(new A._EvaluateVisitor_visitIncludeRule_closure10(node))), $async$visitIncludeRule$1); + case 3: + // returning from await. + $async$returnValue = null; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$visitIncludeRule$1, $async$completer); + }, + visitMixinRule$1(node) { + return this.visitMixinRule$body$_EvaluateVisitor0(node); + }, + visitMixinRule$body$_EvaluateVisitor0(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.nullable_Value_2), + $async$returnValue, $async$self = this, t1, t2, t3, t4, index, t5; + var $async$visitMixinRule$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self._async_evaluate0$_environment; + t2 = t1.closure$0(); + t3 = $async$self._async_evaluate0$_inDependency; + t4 = t1._async_environment0$_mixins; + index = t4.length - 1; + t5 = node.name; + t1._async_environment0$_mixinIndices.$indexSet(0, t5, index); + J.$indexSet$ax(t4[index], t5, new A.UserDefinedCallable0(node, t2, t3, type$.UserDefinedCallable_AsyncEnvironment_2)); + $async$returnValue = null; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$visitMixinRule$1, $async$completer); + }, + visitLoudComment$1(node) { + return this.visitLoudComment$body$_EvaluateVisitor0(node); + }, + visitLoudComment$body$_EvaluateVisitor0(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.nullable_Value_2), + $async$returnValue, $async$self = this, t1, $async$temp1, $async$temp2; + var $async$visitLoudComment$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + if ($async$self._async_evaluate0$_inFunction) { + $async$returnValue = null; + // goto return + $async$goto = 1; + break; + } + if ($async$self._async_evaluate0$_assertInModule$2($async$self._async_evaluate0$__parent, "__parent") === $async$self._async_evaluate0$_assertInModule$2($async$self._async_evaluate0$__root, "_root") && $async$self._async_evaluate0$_assertInModule$2($async$self._async_evaluate0$__endOfImports, "_endOfImports") === J.get$length$asx($async$self._async_evaluate0$_assertInModule$2($async$self._async_evaluate0$__root, "_root").children._collection$_source)) + $async$self._async_evaluate0$__endOfImports = $async$self._async_evaluate0$_assertInModule$2($async$self._async_evaluate0$__endOfImports, "_endOfImports") + 1; + t1 = node.text; + $async$temp1 = $async$self._async_evaluate0$_assertInModule$2($async$self._async_evaluate0$__parent, "__parent"); + $async$temp2 = A; + $async$goto = 3; + return A._asyncAwait($async$self._async_evaluate0$_performInterpolation$1(t1), $async$visitLoudComment$1); + case 3: + // returning from await. + $async$temp1.addChild$1(new $async$temp2.ModifiableCssComment0($async$result, t1.span)); + $async$returnValue = null; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$visitLoudComment$1, $async$completer); + }, + visitMediaRule$1(node) { + return this.visitMediaRule$body$_EvaluateVisitor0(node); + }, + visitMediaRule$body$_EvaluateVisitor0(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.nullable_Value_2), + $async$returnValue, $async$self = this, queries, mergedQueries, t1, mergedSources, t2, t3; + var $async$visitMediaRule$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + if ($async$self._async_evaluate0$_declarationName != null) + throw A.wrapException($async$self._async_evaluate0$_exception$2(string$.Media_, node.span)); + $async$goto = 3; + return A._asyncAwait($async$self._async_evaluate0$_visitMediaQueries$1(node.query), $async$visitMediaRule$1); + case 3: + // returning from await. + queries = $async$result; + mergedQueries = A.NullableExtension_andThen0($async$self._async_evaluate0$_mediaQueries, new A._EvaluateVisitor_visitMediaRule_closure8($async$self, queries)); + t1 = mergedQueries == null; + if (!t1 && J.get$isEmpty$asx(mergedQueries)) { + $async$returnValue = null; + // goto return + $async$goto = 1; + break; + } + if (t1) + mergedSources = B.Set_empty5; + else { + t2 = $async$self._async_evaluate0$_mediaQuerySources; + t2.toString; + t2 = A.LinkedHashSet_LinkedHashSet$of(t2, type$.CssMediaQuery_2); + t3 = $async$self._async_evaluate0$_mediaQueries; + t3.toString; + t2.addAll$1(0, t3); + t2.addAll$1(0, queries); + mergedSources = t2; + } + t1 = t1 ? queries : mergedQueries; + $async$goto = 4; + return A._asyncAwait($async$self._async_evaluate0$_withParent$2$4$scopeWhen$through(A.ModifiableCssMediaRule$0(t1, node.span), new A._EvaluateVisitor_visitMediaRule_closure9($async$self, mergedQueries, queries, mergedSources, node), node.hasDeclarations, new A._EvaluateVisitor_visitMediaRule_closure10(mergedSources), type$.ModifiableCssMediaRule_2, type$.Null), $async$visitMediaRule$1); + case 4: + // returning from await. + $async$returnValue = null; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$visitMediaRule$1, $async$completer); + }, + _async_evaluate0$_visitMediaQueries$1(interpolation) { + return this._visitMediaQueries$body$_EvaluateVisitor0(interpolation); + }, + _visitMediaQueries$body$_EvaluateVisitor0(interpolation) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.List_CssMediaQuery_2), + $async$returnValue, $async$self = this, _0_0; + var $async$_async_evaluate0$_visitMediaQueries$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$goto = 3; + return A._asyncAwait($async$self._async_evaluate0$_performInterpolationWithMap$2$warnForColor(interpolation, true), $async$_async_evaluate0$_visitMediaQueries$1); + case 3: + // returning from await. + _0_0 = $async$result; + $async$returnValue = A.CssMediaQuery_parseList0(_0_0._0, _0_0._1, $async$self._async_evaluate0$_logger); + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$_async_evaluate0$_visitMediaQueries$1, $async$completer); + }, + _async_evaluate0$_mergeMediaQueries$2(queries1, queries2) { + var t1, t2, t3, t4, _0_0, result, t5, + queries = A._setArrayType([], type$.JSArray_CssMediaQuery_2); + for (t1 = J.get$iterator$ax(queries1), t2 = J.getInterceptor$ax(queries2); t1.moveNext$0();) { + t3 = t1.get$current(t1); + for (t4 = t2.get$iterator(queries2); t4.moveNext$0();) + $label0$1: { + _0_0 = t3.merge$1(t4.get$current(t4)); + if (B._SingletonCssMediaQueryMergeResult_00 === _0_0) + continue; + if (B._SingletonCssMediaQueryMergeResult_10 === _0_0) + return null; + if (_0_0 instanceof A.MediaQuerySuccessfulMergeResult0) { + result = _0_0; + t5 = true; + } else { + result = null; + t5 = false; + } + if (t5) + queries.push(result.query); + break $label0$1; + } + } + return queries; + }, + visitReturnRule$1(node) { + return this.visitReturnRule$body$_EvaluateVisitor0(node); + }, + visitReturnRule$body$_EvaluateVisitor0(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Value_2), + $async$returnValue, $async$self = this, t1, t2; + var $async$visitReturnRule$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = node.expression; + t2 = t1.accept$1($async$self); + $async$goto = 3; + return A._asyncAwait(type$.Future_Value_2._is(t2) ? t2 : A._Future$value(t2, type$.Value_2), $async$visitReturnRule$1); + case 3: + // returning from await. + $async$returnValue = $async$self._async_evaluate0$_withoutSlash$2($async$result, t1); + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$visitReturnRule$1, $async$completer); + }, + visitSilentComment$1(node) { + return this.visitSilentComment$body$_EvaluateVisitor0(node); + }, + visitSilentComment$body$_EvaluateVisitor0(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.nullable_Value_2), + $async$returnValue; + var $async$visitSilentComment$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$returnValue = null; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$visitSilentComment$1, $async$completer); + }, + visitStyleRule$1(node) { + return this.visitStyleRule$body$_EvaluateVisitor0(node); + }, + visitStyleRule$body$_EvaluateVisitor0(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.nullable_Value_2), + $async$returnValue, $async$self = this, t1, _0_0, selectorText, selectorMap, t2, parsedSelector, rule, oldAtRootExcludingStyleRule, t3, t4, t5, _i, complex, visitor, t6, t7, t8, t9; + var $async$visitStyleRule$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + if ($async$self._async_evaluate0$_declarationName != null) + throw A.wrapException($async$self._async_evaluate0$_exception$2(string$.Style_, node.span)); + t1 = node.selector; + $async$goto = 3; + return A._asyncAwait($async$self._async_evaluate0$_performInterpolationWithMap$2$warnForColor(t1, true), $async$visitStyleRule$1); + case 3: + // returning from await. + _0_0 = $async$result; + selectorText = _0_0._0; + selectorMap = _0_0._1; + $async$goto = $async$self._async_evaluate0$_inKeyframes ? 4 : 5; + break; + case 4: + // then + $async$goto = 6; + return A._asyncAwait($async$self._async_evaluate0$_withParent$2$4$scopeWhen$through(A.ModifiableCssKeyframeBlock$0(new A.CssValue0(A.List_List$unmodifiable(A.KeyframeSelectorParser$0(selectorText, selectorMap, $async$self._async_evaluate0$_logger).parse$0(), type$.String), t1.span, type$.CssValue_List_String_2), node.span), new A._EvaluateVisitor_visitStyleRule_closure14($async$self, node), node.hasDeclarations, new A._EvaluateVisitor_visitStyleRule_closure15(), type$.ModifiableCssKeyframeBlock_2, type$.Null), $async$visitStyleRule$1); + case 6: + // returning from await. + $async$returnValue = null; + // goto return + $async$goto = 1; + break; + case 5: + // join + t1 = A.SelectorList_SelectorList$parse0(selectorText, !$async$self._async_evaluate0$_assertInModule$2($async$self._async_evaluate0$__stylesheet, "_stylesheet").plainCss, !$async$self._async_evaluate0$_assertInModule$2($async$self._async_evaluate0$__stylesheet, "_stylesheet").plainCss, selectorMap, $async$self._async_evaluate0$_logger); + t2 = $async$self._async_evaluate0$_styleRuleIgnoringAtRoot; + t2 = t2 == null ? null : t2.originalSelector; + parsedSelector = t1.resolveParentSelectors$2$implicitParent(t2, !$async$self._async_evaluate0$_atRootExcludingStyleRule); + rule = A.ModifiableCssStyleRule$0($async$self._async_evaluate0$_assertInModule$2($async$self._async_evaluate0$__extensionStore, "_extensionStore").addSelector$2(parsedSelector, $async$self._async_evaluate0$_mediaQueries), node.span, parsedSelector); + oldAtRootExcludingStyleRule = $async$self._async_evaluate0$_atRootExcludingStyleRule; + $async$self._async_evaluate0$_atRootExcludingStyleRule = false; + $async$goto = 7; + return A._asyncAwait($async$self._async_evaluate0$_withParent$2$4$scopeWhen$through(rule, new A._EvaluateVisitor_visitStyleRule_closure16($async$self, rule, node), node.hasDeclarations, new A._EvaluateVisitor_visitStyleRule_closure17(), type$.ModifiableCssStyleRule_2, type$.Null), $async$visitStyleRule$1); + case 7: + // returning from await. + $async$self._async_evaluate0$_atRootExcludingStyleRule = oldAtRootExcludingStyleRule; + if (!rule.accept$1(B._IsInvisibleVisitor_false_false0)) + for (t1 = parsedSelector.components, t2 = t1.length, t3 = type$.SourceSpan, t4 = type$.String, t5 = rule.children, _i = 0; _i < t2; ++_i) { + complex = t1[_i]; + if (!complex.accept$1(B._IsBogusVisitor_true0)) + continue; + if (complex.accept$1(B.C__IsUselessVisitor0)) { + visitor = A._SerializeVisitor$0(null, true, null, true, false, null, true); + complex.accept$1(visitor); + $async$self._async_evaluate0$_warn$3('The selector "' + B.JSString_methods.trim$0(visitor._serialize0$_buffer.toString$0(0)) + string$.x22x20is_ix20, A.SpanExtensions_trimRight0(complex.span), B.Deprecation_XV6); + } else if (complex.leadingCombinators.length !== 0) { + visitor = A._SerializeVisitor$0(null, true, null, true, false, null, true); + complex.accept$1(visitor); + $async$self._async_evaluate0$_warn$3('The selector "' + B.JSString_methods.trim$0(visitor._serialize0$_buffer.toString$0(0)) + string$.x22x20is_ix0a, A.SpanExtensions_trimRight0(complex.span), B.Deprecation_XV6); + } else { + visitor = A._SerializeVisitor$0(null, true, null, true, false, null, true); + complex.accept$1(visitor); + t6 = B.JSString_methods.trim$0(visitor._serialize0$_buffer.toString$0(0)); + t7 = complex.accept$1(B._IsBogusVisitor_false0) ? string$.x20It_wi : ""; + t8 = A.SpanExtensions_trimRight0(complex.span); + if (t5.get$length(0) === 0) + A.throwExpression(A.IterableElementError_noElement()); + t9 = J.get$span$z(t5.$index(0, 0)); + $async$self._async_evaluate0$_warn$3('The selector "' + t6 + string$.x22x20is_o + t7 + string$.x0aThis_, new A.MultiSpan0(t8, "invalid selector", A.ConstantMap_ConstantMap$from(A.LinkedHashMap_LinkedHashMap$_literal([t9, "this is not a style rule" + (t5.every$1(t5, new A._EvaluateVisitor_visitStyleRule_closure18()) ? "\n(try converting to a //-style comment)" : "")], t3, t4), t3, t4)), B.Deprecation_XV6); + } + } + if (($async$self._async_evaluate0$_atRootExcludingStyleRule ? null : $async$self._async_evaluate0$_styleRuleIgnoringAtRoot) == null) { + t1 = $async$self._async_evaluate0$_assertInModule$2($async$self._async_evaluate0$__parent, "__parent").children; + t1 = !t1.get$isEmpty(t1); + } else + t1 = false; + if (t1) { + t1 = $async$self._async_evaluate0$_assertInModule$2($async$self._async_evaluate0$__parent, "__parent").children; + t1.get$last(t1).isGroupEnd = true; + } + $async$returnValue = null; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$visitStyleRule$1, $async$completer); + }, + visitSupportsRule$1(node) { + return this.visitSupportsRule$body$_EvaluateVisitor0(node); + }, + visitSupportsRule$body$_EvaluateVisitor0(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.nullable_Value_2), + $async$returnValue, $async$self = this, t1, $async$temp1, $async$temp2; + var $async$visitSupportsRule$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + if ($async$self._async_evaluate0$_declarationName != null) + throw A.wrapException($async$self._async_evaluate0$_exception$2(string$.Suppor, node.span)); + t1 = node.condition; + $async$temp1 = A; + $async$temp2 = A; + $async$goto = 4; + return A._asyncAwait($async$self._async_evaluate0$_visitSupportsCondition$1(t1), $async$visitSupportsRule$1); + case 4: + // returning from await. + $async$goto = 3; + return A._asyncAwait($async$self._async_evaluate0$_withParent$2$4$scopeWhen$through($async$temp1.ModifiableCssSupportsRule$0(new $async$temp2.CssValue0($async$result, t1.get$span(t1), type$.CssValue_String_2), node.span), new A._EvaluateVisitor_visitSupportsRule_closure5($async$self, node), node.hasDeclarations, new A._EvaluateVisitor_visitSupportsRule_closure6(), type$.ModifiableCssSupportsRule_2, type$.Null), $async$visitSupportsRule$1); + case 3: + // returning from await. + $async$returnValue = null; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$visitSupportsRule$1, $async$completer); + }, + _async_evaluate0$_visitSupportsCondition$1(condition) { + return this._visitSupportsCondition$body$_EvaluateVisitor0(condition); + }, + _visitSupportsCondition$body$_EvaluateVisitor0(condition) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.String), + $async$returnValue, $async$self = this, t1, _box_0, $async$temp1, $async$temp2; + var $async$_async_evaluate0$_visitSupportsCondition$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + _box_0 = {}; + $async$goto = condition instanceof A.SupportsOperation0 ? 4 : 5; + break; + case 4: + // then + t1 = condition.operator; + $async$temp1 = A; + $async$goto = 6; + return A._asyncAwait($async$self._async_evaluate0$_parenthesize$2(condition.left, t1), $async$_async_evaluate0$_visitSupportsCondition$1); + case 6: + // returning from await. + $async$temp1 = $async$temp1.S($async$result) + " " + t1 + " "; + $async$temp2 = A; + $async$goto = 7; + return A._asyncAwait($async$self._async_evaluate0$_parenthesize$2(condition.right, t1), $async$_async_evaluate0$_visitSupportsCondition$1); + case 7: + // returning from await. + t1 = $async$temp1 + $async$temp2.S($async$result); + // goto break $label0$0 + $async$goto = 3; + break; + case 5: + // join + $async$goto = condition instanceof A.SupportsNegation0 ? 8 : 9; + break; + case 8: + // then + $async$temp1 = A; + $async$goto = 10; + return A._asyncAwait($async$self._async_evaluate0$_parenthesize$1(condition.condition), $async$_async_evaluate0$_visitSupportsCondition$1); + case 10: + // returning from await. + t1 = "not " + $async$temp1.S($async$result); + // goto break $label0$0 + $async$goto = 3; + break; + case 9: + // join + $async$goto = condition instanceof A.SupportsInterpolation0 ? 11 : 12; + break; + case 11: + // then + $async$goto = 13; + return A._asyncAwait($async$self._async_evaluate0$_evaluateToCss$2$quote(condition.expression, false), $async$_async_evaluate0$_visitSupportsCondition$1); + case 13: + // returning from await. + t1 = $async$result; + // goto break $label0$0 + $async$goto = 3; + break; + case 12: + // join + _box_0.declaration = null; + $async$goto = condition instanceof A.SupportsDeclaration0 ? 14 : 15; + break; + case 14: + // then + _box_0.declaration = condition; + $async$goto = 16; + return A._asyncAwait($async$self._async_evaluate0$_withSupportsDeclaration$1$1(new A._EvaluateVisitor__visitSupportsCondition_closure2(_box_0, $async$self), type$.String), $async$_async_evaluate0$_visitSupportsCondition$1); + case 16: + // returning from await. + t1 = $async$result; + // goto break $label0$0 + $async$goto = 3; + break; + case 15: + // join + $async$goto = condition instanceof A.SupportsFunction0 ? 17 : 18; + break; + case 17: + // then + $async$temp1 = A; + $async$goto = 19; + return A._asyncAwait($async$self._async_evaluate0$_performInterpolation$1(condition.name), $async$_async_evaluate0$_visitSupportsCondition$1); + case 19: + // returning from await. + $async$temp1 = $async$temp1.S($async$result) + "("; + $async$temp2 = A; + $async$goto = 20; + return A._asyncAwait($async$self._async_evaluate0$_performInterpolation$1(condition.$arguments), $async$_async_evaluate0$_visitSupportsCondition$1); + case 20: + // returning from await. + t1 = $async$temp1 + $async$temp2.S($async$result) + ")"; + // goto break $label0$0 + $async$goto = 3; + break; + case 18: + // join + $async$goto = condition instanceof A.SupportsAnything0 ? 21 : 22; + break; + case 21: + // then + $async$temp1 = A; + $async$goto = 23; + return A._asyncAwait($async$self._async_evaluate0$_performInterpolation$1(condition.contents), $async$_async_evaluate0$_visitSupportsCondition$1); + case 23: + // returning from await. + t1 = "(" + $async$temp1.S($async$result) + ")"; + // goto break $label0$0 + $async$goto = 3; + break; + case 22: + // join + t1 = A.throwExpression(A.ArgumentError$("Unknown supports condition type " + A.getRuntimeTypeOfDartObject(condition).toString$0(0) + ".", null)); + case 3: + // break $label0$0 + $async$returnValue = t1; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$_async_evaluate0$_visitSupportsCondition$1, $async$completer); + }, + _async_evaluate0$_withSupportsDeclaration$1$1(callback, $T) { + return this._withSupportsDeclaration$body$_EvaluateVisitor0(callback, $T, $T); + }, + _withSupportsDeclaration$body$_EvaluateVisitor0(callback, $T, $async$type) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter($async$type), + $async$returnValue, $async$handler = 2, $async$currentError, $async$next = [], $async$self = this, t1, oldInSupportsDeclaration; + var $async$_async_evaluate0$_withSupportsDeclaration$1$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) { + $async$currentError = $async$result; + $async$goto = $async$handler; + } + while (true) + switch ($async$goto) { + case 0: + // Function start + oldInSupportsDeclaration = $async$self._async_evaluate0$_inSupportsDeclaration; + $async$self._async_evaluate0$_inSupportsDeclaration = true; + $async$handler = 3; + t1 = callback.call$0(); + $async$goto = 6; + return A._asyncAwait($T._eval$1("Future<0>")._is(t1) ? t1 : A._Future$value(t1, $T), $async$_async_evaluate0$_withSupportsDeclaration$1$1); + case 6: + // returning from await. + t1 = $async$result; + $async$returnValue = t1; + $async$next = [1]; + // goto finally + $async$goto = 4; + break; + $async$next.push(5); + // goto finally + $async$goto = 4; + break; + case 3: + // uncaught + $async$next = [2]; + case 4: + // finally + $async$handler = 2; + $async$self._async_evaluate0$_inSupportsDeclaration = oldInSupportsDeclaration; + // goto the next finally handler + $async$goto = $async$next.pop(); + break; + case 5: + // after finally + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + case 2: + // rethrow + return A._asyncRethrow($async$currentError, $async$completer); + } + }); + return A._asyncStartSync($async$_async_evaluate0$_withSupportsDeclaration$1$1, $async$completer); + }, + _async_evaluate0$_parenthesize$2(condition, operator) { + return this._parenthesize$body$_EvaluateVisitor0(condition, operator); + }, + _async_evaluate0$_parenthesize$1(condition) { + return this._async_evaluate0$_parenthesize$2(condition, null); + }, + _parenthesize$body$_EvaluateVisitor0(condition, operator) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.String), + $async$returnValue, $async$self = this, t1, $async$temp1; + var $async$_async_evaluate0$_parenthesize$2 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + if (!(condition instanceof A.SupportsNegation0)) + if (condition instanceof A.SupportsOperation0) + t1 = operator == null || operator !== condition.operator; + else + t1 = false; + else + t1 = true; + $async$goto = t1 ? 3 : 4; + break; + case 3: + // then + $async$temp1 = A; + $async$goto = 5; + return A._asyncAwait($async$self._async_evaluate0$_visitSupportsCondition$1(condition), $async$_async_evaluate0$_parenthesize$2); + case 5: + // returning from await. + $async$returnValue = "(" + $async$temp1.S($async$result) + ")"; + // goto return + $async$goto = 1; + break; + case 4: + // join + $async$goto = 6; + return A._asyncAwait($async$self._async_evaluate0$_visitSupportsCondition$1(condition), $async$_async_evaluate0$_parenthesize$2); + case 6: + // returning from await. + $async$returnValue = $async$result; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$_async_evaluate0$_parenthesize$2, $async$completer); + }, + visitVariableDeclaration$1(node) { + return this.visitVariableDeclaration$body$_EvaluateVisitor0(node); + }, + visitVariableDeclaration$body$_EvaluateVisitor0(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.nullable_Value_2), + $async$returnValue, $async$self = this, t2, value, t1, $async$temp1, $async$temp2, $async$temp3; + var $async$visitVariableDeclaration$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = {}; + if (node.isGuarded) { + if (node.namespace == null && $async$self._async_evaluate0$_environment._async_environment0$_variables.length === 1) { + t1.override = null; + t2 = $async$self._async_evaluate0$_configuration._configuration0$_values; + t2 = t2.get$isEmpty(t2) ? null : t2.remove$1(0, node.name); + if (t2 != null) { + t1.override = t2; + t2 = !t2.value.$eq(0, B.C__SassNull0); + } else + t2 = false; + if (t2) { + $async$self._async_evaluate0$_addExceptionSpan$2(node, new A._EvaluateVisitor_visitVariableDeclaration_closure8(t1, $async$self, node)); + $async$returnValue = null; + // goto return + $async$goto = 1; + break; + } + } + value = $async$self._async_evaluate0$_addExceptionSpan$2(node, new A._EvaluateVisitor_visitVariableDeclaration_closure9($async$self, node)); + if (value != null && !value.$eq(0, B.C__SassNull0)) { + $async$returnValue = null; + // goto return + $async$goto = 1; + break; + } + } + if (node.isGlobal && !$async$self._async_evaluate0$_environment.globalVariableExists$1(node.name)) { + t1 = $async$self._async_evaluate0$_environment._async_environment0$_variables.length === 1 ? string$.As_of_S : string$.As_of_R + A.declarationName0(node.span) + ": null` at the stylesheet root."; + $async$self._async_evaluate0$_warn$3(t1, node.span, B.Deprecation_wKk); + } + t1 = node.expression; + t2 = t1.accept$1($async$self); + $async$temp1 = node; + $async$temp2 = A; + $async$temp3 = node; + $async$goto = 3; + return A._asyncAwait(type$.Future_Value_2._is(t2) ? t2 : A._Future$value(t2, type$.Value_2), $async$visitVariableDeclaration$1); + case 3: + // returning from await. + $async$self._async_evaluate0$_addExceptionSpan$2($async$temp1, new $async$temp2._EvaluateVisitor_visitVariableDeclaration_closure10($async$self, $async$temp3, $async$self._async_evaluate0$_withoutSlash$2($async$result, t1))); + $async$returnValue = null; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$visitVariableDeclaration$1, $async$completer); + }, + visitUseRule$1(node) { + return this.visitUseRule$body$_EvaluateVisitor0(node); + }, + visitUseRule$body$_EvaluateVisitor0(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.nullable_Value_2), + $async$returnValue, $async$self = this, values, t3, t4, _i, variable, t5, variableNodeWithSpan, t6, t7, configuration, t1, t2, $async$temp1, $async$temp2, $async$temp3; + var $async$visitUseRule$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = node.configuration; + t2 = t1.length; + $async$goto = t2 !== 0 ? 3 : 5; + break; + case 3: + // then + values = A.LinkedHashMap_LinkedHashMap$_empty(type$.String, type$.ConfiguredValue_2); + t3 = type$._Future_Value_2, t4 = type$.Future_Value_2, _i = 0; + case 6: + // for condition + if (!(_i < t2)) { + // goto after for + $async$goto = 8; + break; + } + variable = t1[_i]; + t5 = variable.expression; + variableNodeWithSpan = $async$self._async_evaluate0$_expressionNode$1(t5); + t6 = variable.name; + t5 = t5.accept$1($async$self); + if (!t4._is(t5)) { + t7 = new A._Future($.Zone__current, t3); + t7._state = 8; + t7._resultOrListeners = t5; + t5 = t7; + } + $async$temp1 = values; + $async$temp2 = t6; + $async$temp3 = A; + $async$goto = 9; + return A._asyncAwait(t5, $async$visitUseRule$1); + case 9: + // returning from await. + $async$temp1.$indexSet(0, $async$temp2, new $async$temp3.ConfiguredValue0($async$self._async_evaluate0$_withoutSlash$2($async$result, variableNodeWithSpan), variable.span, variableNodeWithSpan)); + case 7: + // for update + ++_i; + // goto for condition + $async$goto = 6; + break; + case 8: + // after for + configuration = new A.ExplicitConfiguration0(node, values, null); + // goto join + $async$goto = 4; + break; + case 5: + // else + configuration = B.Configuration_Map_empty_null0; + case 4: + // join + $async$goto = 10; + return A._asyncAwait($async$self._async_evaluate0$_loadModule$5$configuration(node.url, "@use", node, new A._EvaluateVisitor_visitUseRule_closure2($async$self, node), configuration), $async$visitUseRule$1); + case 10: + // returning from await. + $async$self._async_evaluate0$_assertConfigurationIsEmpty$1(configuration); + $async$returnValue = null; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$visitUseRule$1, $async$completer); + }, + visitWarnRule$1(node) { + return this.visitWarnRule$body$_EvaluateVisitor0(node); + }, + visitWarnRule$body$_EvaluateVisitor0(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.nullable_Value_2), + $async$returnValue, $async$self = this, value, t1; + var $async$visitWarnRule$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$goto = 3; + return A._asyncAwait($async$self._async_evaluate0$_addExceptionSpanAsync$1$2(node, new A._EvaluateVisitor_visitWarnRule_closure2($async$self, node), type$.Value_2), $async$visitWarnRule$1); + case 3: + // returning from await. + value = $async$result; + t1 = value instanceof A.SassString0 ? value._string0$_text : $async$self._async_evaluate0$_serialize$2(value, node.expression); + $async$self._async_evaluate0$_logger.warn$2$trace(0, t1, $async$self._async_evaluate0$_stackTrace$1(node.span)); + $async$returnValue = null; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$visitWarnRule$1, $async$completer); + }, + visitWhileRule$1(node) { + return this._async_evaluate0$_environment.scope$1$3$semiGlobal$when(new A._EvaluateVisitor_visitWhileRule_closure2(this, node), true, node.hasDeclarations, type$.nullable_Value_2); + }, + visitBinaryOperationExpression$1(node) { + var t1, _this = this; + if (_this._async_evaluate0$_assertInModule$2(_this._async_evaluate0$__stylesheet, "_stylesheet").plainCss) { + t1 = node.operator; + t1 = t1 !== B.BinaryOperator_2jN0 && t1 !== B.BinaryOperator_t8B0; + } else + t1 = false; + if (t1) + throw A.wrapException(_this._async_evaluate0$_exception$2("Operators aren't allowed in plain CSS.", node.get$operatorSpan())); + return _this._async_evaluate0$_addExceptionSpanAsync$1$2(node, new A._EvaluateVisitor_visitBinaryOperationExpression_closure2(_this, node), type$.Value_2); + }, + _async_evaluate0$_slash$3(left, right, node) { + var t1, right0, _1_2, _1_1, _1_2_isSet, _null = null, + result = left.dividedBy$1(right); + if (left instanceof A.SassNumber0) { + t1 = type$.SassNumber_2; + t1._as(left); + if (right instanceof A.SassNumber0) { + t1._as(right); + t1 = node.allowsSlash && this._async_evaluate0$_operandAllowsSlash$1(node.left) && this._async_evaluate0$_operandAllowsSlash$1(node.right); + right0 = right; + _1_2 = right0; + } else { + right0 = _null; + _1_2 = right; + t1 = false; + } + _1_1 = left; + _1_2_isSet = true; + } else { + right0 = _null; + _1_2 = right0; + _1_1 = left; + left = _1_2; + _1_2_isSet = false; + t1 = false; + } + if (t1) + return type$.SassNumber_2._as(result).withSlash$2(left, right0); + if (_1_1 instanceof A.SassNumber0) + t1 = (_1_2_isSet ? _1_2 : right) instanceof A.SassNumber0; + else + t1 = false; + if (t1) { + this._async_evaluate0$_warn$3(string$.Using__o + A.S(new A._EvaluateVisitor__slash_recommendation2().call$1(node)) + " or " + A.expressionToCalc0(node).toString$0(0) + string$.x0a_Morex20, node.get$span(0), B.Deprecation_wWh); + return result; + } + return result; + }, + _async_evaluate0$_operandAllowsSlash$1(node) { + var t1, t2; + if (node instanceof A.FunctionExpression0) + if (node.namespace == null) { + t1 = node.originalName; + if (B.Set_WfnXb.contains$1(0, A.stringReplaceAllUnchecked(t1, "_", "-").toLowerCase())) { + t2 = this._async_evaluate0$_environment; + t1 = t2.getFunction$1(A.stringReplaceAllUnchecked(t1, "_", "-")) == null; + } else + t1 = false; + } else + t1 = false; + else + t1 = true; + return t1; + }, + visitValueExpression$1(node) { + return this.visitValueExpression$body$_EvaluateVisitor0(node); + }, + visitValueExpression$body$_EvaluateVisitor0(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Value_2), + $async$returnValue; + var $async$visitValueExpression$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$returnValue = node.value; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$visitValueExpression$1, $async$completer); + }, + visitVariableExpression$1(node) { + return this.visitVariableExpression$body$_EvaluateVisitor0(node); + }, + visitVariableExpression$body$_EvaluateVisitor0(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Value_2), + $async$returnValue, $async$self = this, result; + var $async$visitVariableExpression$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + result = $async$self._async_evaluate0$_addExceptionSpan$2(node, new A._EvaluateVisitor_visitVariableExpression_closure2($async$self, node)); + if (result != null) { + $async$returnValue = result; + // goto return + $async$goto = 1; + break; + } + throw A.wrapException($async$self._async_evaluate0$_exception$2("Undefined variable.", node.span)); + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$visitVariableExpression$1, $async$completer); + }, + visitUnaryOperationExpression$1(node) { + return this.visitUnaryOperationExpression$body$_EvaluateVisitor0(node); + }, + visitUnaryOperationExpression$body$_EvaluateVisitor0(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Value_2), + $async$returnValue, $async$self = this, $async$temp1, $async$temp2, $async$temp3; + var $async$visitUnaryOperationExpression$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$temp1 = node; + $async$temp2 = A; + $async$temp3 = node; + $async$goto = 3; + return A._asyncAwait(node.operand.accept$1($async$self), $async$visitUnaryOperationExpression$1); + case 3: + // returning from await. + $async$returnValue = $async$self._async_evaluate0$_addExceptionSpan$2($async$temp1, new $async$temp2._EvaluateVisitor_visitUnaryOperationExpression_closure2($async$temp3, $async$result)); + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$visitUnaryOperationExpression$1, $async$completer); + }, + visitBooleanExpression$1(node) { + return this.visitBooleanExpression$body$_EvaluateVisitor0(node); + }, + visitBooleanExpression$body$_EvaluateVisitor0(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.SassBoolean_2), + $async$returnValue; + var $async$visitBooleanExpression$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$returnValue = node.value ? B.SassBoolean_true0 : B.SassBoolean_false0; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$visitBooleanExpression$1, $async$completer); + }, + visitIfExpression$1(node) { + return this.visitIfExpression$body$_EvaluateVisitor0(node); + }, + visitIfExpression$body$_EvaluateVisitor0(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Value_2), + $async$returnValue, $async$self = this, condition, t1, ifTrue, ifFalse, result, _0_0, positional, named; + var $async$visitIfExpression$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$goto = 3; + return A._asyncAwait($async$self._async_evaluate0$_evaluateMacroArguments$1(node), $async$visitIfExpression$1); + case 3: + // returning from await. + _0_0 = $async$result; + positional = _0_0._0; + named = _0_0._1; + $async$self._async_evaluate0$_verifyArguments$4(J.get$length$asx(positional), named, $.$get$IfExpression_declaration0(), node); + condition = A.ListExtensions_elementAtOrNull(positional, 0); + if (condition == null) { + t1 = named.$index(0, "condition"); + t1.toString; + condition = t1; + } + ifTrue = A.ListExtensions_elementAtOrNull(positional, 1); + if (ifTrue == null) { + t1 = named.$index(0, "if-true"); + t1.toString; + ifTrue = t1; + } + ifFalse = A.ListExtensions_elementAtOrNull(positional, 2); + if (ifFalse == null) { + t1 = named.$index(0, "if-false"); + t1.toString; + ifFalse = t1; + } + $async$goto = 4; + return A._asyncAwait(condition.accept$1($async$self), $async$visitIfExpression$1); + case 4: + // returning from await. + result = $async$result.get$isTruthy() ? ifTrue : ifFalse; + t1 = result.accept$1($async$self); + $async$goto = 5; + return A._asyncAwait(type$.Future_Value_2._is(t1) ? t1 : A._Future$value(t1, type$.Value_2), $async$visitIfExpression$1); + case 5: + // returning from await. + $async$returnValue = $async$self._async_evaluate0$_withoutSlash$2($async$result, $async$self._async_evaluate0$_expressionNode$1(result)); + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$visitIfExpression$1, $async$completer); + }, + visitNullExpression$1(node) { + return this.visitNullExpression$body$_EvaluateVisitor0(node); + }, + visitNullExpression$body$_EvaluateVisitor0(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Value_2), + $async$returnValue; + var $async$visitNullExpression$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$returnValue = B.C__SassNull0; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$visitNullExpression$1, $async$completer); + }, + visitNumberExpression$1(node) { + return this.visitNumberExpression$body$_EvaluateVisitor0(node); + }, + visitNumberExpression$body$_EvaluateVisitor0(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.SassNumber_2), + $async$returnValue; + var $async$visitNumberExpression$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$returnValue = A.SassNumber_SassNumber0(node.value, node.unit); + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$visitNumberExpression$1, $async$completer); + }, + visitParenthesizedExpression$1(node) { + var _this = this; + return _this._async_evaluate0$_assertInModule$2(_this._async_evaluate0$__stylesheet, "_stylesheet").plainCss ? A.throwExpression(_this._async_evaluate0$_exception$2("Parentheses aren't allowed in plain CSS.", node.span)) : node.expression.accept$1(_this); + }, + visitColorExpression$1(node) { + return this.visitColorExpression$body$_EvaluateVisitor0(node); + }, + visitColorExpression$body$_EvaluateVisitor0(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.SassColor_2), + $async$returnValue; + var $async$visitColorExpression$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$returnValue = node.value; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$visitColorExpression$1, $async$completer); + }, + visitListExpression$1(node) { + return this.visitListExpression$body$_EvaluateVisitor0(node); + }, + visitListExpression$body$_EvaluateVisitor0(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.SassList_2), + $async$returnValue, $async$self = this, $async$temp1; + var $async$visitListExpression$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$temp1 = A; + $async$goto = 3; + return A._asyncAwait(A.mapAsync0(node.contents, new A._EvaluateVisitor_visitListExpression_closure2($async$self), type$.Expression_2, type$.Value_2), $async$visitListExpression$1); + case 3: + // returning from await. + $async$returnValue = $async$temp1.SassList$0($async$result, node.separator, node.hasBrackets); + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$visitListExpression$1, $async$completer); + }, + visitMapExpression$1(node) { + return this.visitMapExpression$body$_EvaluateVisitor0(node); + }, + visitMapExpression$body$_EvaluateVisitor0(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.SassMap_2), + $async$returnValue, $async$self = this, t2, t3, _i, t4, key, value, keyValue, valueValue, oldValueSpan, t1, map, keyNodes; + var $async$visitMapExpression$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = type$.Value_2; + map = A.LinkedHashMap_LinkedHashMap$_empty(t1, t1); + keyNodes = A.LinkedHashMap_LinkedHashMap$_empty(t1, type$.AstNode_2); + t2 = node.pairs, t3 = t2.length, _i = 0; + case 3: + // for condition + if (!(_i < t3)) { + // goto after for + $async$goto = 5; + break; + } + t4 = t2[_i]; + key = t4._0; + value = t4._1; + $async$goto = 6; + return A._asyncAwait(key.accept$1($async$self), $async$visitMapExpression$1); + case 6: + // returning from await. + keyValue = $async$result; + $async$goto = 7; + return A._asyncAwait(value.accept$1($async$self), $async$visitMapExpression$1); + case 7: + // returning from await. + valueValue = $async$result; + if (map.containsKey$1(keyValue)) { + t1 = keyNodes.$index(0, keyValue); + oldValueSpan = t1 == null ? null : t1.get$span(t1); + t1 = key.get$span(key); + t2 = A.LinkedHashMap_LinkedHashMap$_empty(type$.FileSpan, type$.String); + if (oldValueSpan != null) + t2.$indexSet(0, oldValueSpan, "first key"); + throw A.wrapException(A.MultiSpanSassRuntimeException$0("Duplicate key.", t1, "second key", t2, $async$self._async_evaluate0$_stackTrace$1(key.get$span(key)), null)); + } + map.$indexSet(0, keyValue, valueValue); + keyNodes.$indexSet(0, keyValue, key); + case 4: + // for update + ++_i; + // goto for condition + $async$goto = 3; + break; + case 5: + // after for + $async$returnValue = new A.SassMap0(A.ConstantMap_ConstantMap$from(map, t1, t1)); + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$visitMapExpression$1, $async$completer); + }, + visitFunctionExpression$1(node) { + return this.visitFunctionExpression$body$_EvaluateVisitor0(node); + }, + visitFunctionExpression$body$_EvaluateVisitor0(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Value_2), + $async$returnValue, $async$self = this, t2, _0_0, t3, t4, oldInFunction, result, t1, $function; + var $async$visitFunctionExpression$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = {}; + $function = $async$self._async_evaluate0$_assertInModule$2($async$self._async_evaluate0$__stylesheet, "_stylesheet").plainCss ? null : $async$self._async_evaluate0$_addExceptionSpan$2(node, new A._EvaluateVisitor_visitFunctionExpression_closure8($async$self, node)); + t1.$function = $function; + $async$goto = $function == null ? 3 : 4; + break; + case 3: + // then + if (node.namespace != null) + throw A.wrapException($async$self._async_evaluate0$_exception$2("Undefined function.", node.span)); + t2 = node.originalName; + _0_0 = A.stringReplaceAllUnchecked(t2, "_", "-").toLowerCase(); + if ("min" === _0_0 || "max" === _0_0 || "round" === _0_0 || "abs" === _0_0) { + t3 = node.$arguments; + t4 = t3.named; + t3 = t4.get$isEmpty(t4) && t3.rest == null && B.JSArray_methods.every$1(t3.positional, new A._EvaluateVisitor_visitFunctionExpression_closure9()); + } else + t3 = false; + $async$goto = t3 ? 5 : 6; + break; + case 5: + // then + $async$goto = 7; + return A._asyncAwait($async$self._async_evaluate0$_visitCalculation$2$inLegacySassFunction(node, true), $async$visitFunctionExpression$1); + case 7: + // returning from await. + $async$returnValue = $async$result; + // goto return + $async$goto = 1; + break; + case 6: + // join + $async$goto = "calc" === _0_0 || "clamp" === _0_0 || "hypot" === _0_0 || "sin" === _0_0 || "cos" === _0_0 || "tan" === _0_0 || "asin" === _0_0 || "acos" === _0_0 || "atan" === _0_0 || "sqrt" === _0_0 || "exp" === _0_0 || "sign" === _0_0 || "mod" === _0_0 || "rem" === _0_0 || "atan2" === _0_0 || "pow" === _0_0 || "log" === _0_0 ? 8 : 9; + break; + case 8: + // then + $async$goto = 10; + return A._asyncAwait($async$self._async_evaluate0$_visitCalculation$1(node), $async$visitFunctionExpression$1); + case 10: + // returning from await. + $async$returnValue = $async$result; + // goto return + $async$goto = 1; + break; + case 9: + // join + if ($async$self._async_evaluate0$_assertInModule$2($async$self._async_evaluate0$__stylesheet, "_stylesheet").plainCss) + $function = null; + else { + t3 = $async$self._async_evaluate0$_builtInFunctions.$index(0, A.stringReplaceAllUnchecked(t2, "_", "-")); + $function = t3; + } + t1.$function = $function == null ? new A.PlainCssCallable0(t2) : $function; + case 4: + // join + oldInFunction = $async$self._async_evaluate0$_inFunction; + $async$self._async_evaluate0$_inFunction = true; + $async$goto = 11; + return A._asyncAwait($async$self._async_evaluate0$_addErrorSpan$1$2(node, new A._EvaluateVisitor_visitFunctionExpression_closure10(t1, $async$self, node), type$.Value_2), $async$visitFunctionExpression$1); + case 11: + // returning from await. + result = $async$result; + $async$self._async_evaluate0$_inFunction = oldInFunction; + $async$returnValue = result; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$visitFunctionExpression$1, $async$completer); + }, + _async_evaluate0$_visitCalculation$2$inLegacySassFunction(node, inLegacySassFunction) { + return this._visitCalculation$body$_EvaluateVisitor0(node, inLegacySassFunction); + }, + _async_evaluate0$_visitCalculation$1(node) { + return this._async_evaluate0$_visitCalculation$2$inLegacySassFunction(node, false); + }, + _visitCalculation$body$_EvaluateVisitor0(node, inLegacySassFunction) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Value_2), + $async$returnValue, $async$next = [], $async$self = this, $arguments, oldCallableNode, t1, _0_0, error, stackTrace, t4, _i, exception, t2, t3, $async$temp1; + var $async$_async_evaluate0$_visitCalculation$2$inLegacySassFunction = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t2 = node.$arguments; + t3 = t2.named; + if (t3.get$isNotEmpty(t3)) + throw A.wrapException($async$self._async_evaluate0$_exception$2(string$.Keywor, node.span)); + else if (t2.rest != null) + throw A.wrapException($async$self._async_evaluate0$_exception$2(string$.Rest_a, node.span)); + $async$self._async_evaluate0$_checkCalculationArguments$1(node); + t3 = A._setArrayType([], type$.JSArray_Object); + t2 = t2.positional, t4 = t2.length, _i = 0; + case 3: + // for condition + if (!(_i < t4)) { + // goto after for + $async$goto = 5; + break; + } + $async$temp1 = t3; + $async$goto = 6; + return A._asyncAwait($async$self._async_evaluate0$_visitCalculationExpression$2$inLegacySassFunction(t2[_i], inLegacySassFunction), $async$_async_evaluate0$_visitCalculation$2$inLegacySassFunction); + case 6: + // returning from await. + $async$temp1.push($async$result); + case 4: + // for update + ++_i; + // goto for condition + $async$goto = 3; + break; + case 5: + // after for + $arguments = t3; + if ($async$self._async_evaluate0$_inSupportsDeclaration) { + $async$returnValue = new A.SassCalculation0(A.stringReplaceAllUnchecked(node.originalName, "_", "-"), A.List_List$unmodifiable($arguments, type$.Object)); + // goto return + $async$goto = 1; + break; + } + oldCallableNode = $async$self._async_evaluate0$_callableNode; + $async$self._async_evaluate0$_callableNode = node; + try { + t1 = null; + _0_0 = A.stringReplaceAllUnchecked(node.originalName, "_", "-").toLowerCase(); + $label0$0: { + if ("calc" === _0_0) { + t1 = A.SassCalculation_calc0(J.$index$asx($arguments, 0)); + break $label0$0; + } + if ("sqrt" === _0_0) { + t1 = A.SassCalculation__singleArgument0("sqrt", J.$index$asx($arguments, 0), A.number2__sqrt$closure(), true); + break $label0$0; + } + if ("sin" === _0_0) { + t1 = A.SassCalculation__singleArgument0("sin", J.$index$asx($arguments, 0), A.number2__sin$closure(), false); + break $label0$0; + } + if ("cos" === _0_0) { + t1 = A.SassCalculation__singleArgument0("cos", J.$index$asx($arguments, 0), A.number2__cos$closure(), false); + break $label0$0; + } + if ("tan" === _0_0) { + t1 = A.SassCalculation__singleArgument0("tan", J.$index$asx($arguments, 0), A.number2__tan$closure(), false); + break $label0$0; + } + if ("asin" === _0_0) { + t1 = A.SassCalculation__singleArgument0("asin", J.$index$asx($arguments, 0), A.number2__asin$closure(), true); + break $label0$0; + } + if ("acos" === _0_0) { + t1 = A.SassCalculation__singleArgument0("acos", J.$index$asx($arguments, 0), A.number2__acos$closure(), true); + break $label0$0; + } + if ("atan" === _0_0) { + t1 = A.SassCalculation__singleArgument0("atan", J.$index$asx($arguments, 0), A.number2__atan$closure(), true); + break $label0$0; + } + if ("abs" === _0_0) { + t1 = A.SassCalculation_abs0(J.$index$asx($arguments, 0)); + break $label0$0; + } + if ("exp" === _0_0) { + t1 = A.SassCalculation_exp0(J.$index$asx($arguments, 0)); + break $label0$0; + } + if ("sign" === _0_0) { + t1 = A.SassCalculation_sign0(J.$index$asx($arguments, 0)); + break $label0$0; + } + if ("min" === _0_0) { + t1 = A.SassCalculation_min0($arguments); + break $label0$0; + } + if ("max" === _0_0) { + t1 = A.SassCalculation_max0($arguments); + break $label0$0; + } + if ("hypot" === _0_0) { + t1 = A.SassCalculation_hypot0($arguments); + break $label0$0; + } + if ("pow" === _0_0) { + t1 = A.SassCalculation_pow0(J.$index$asx($arguments, 0), A.ListExtensions_elementAtOrNull($arguments, 1)); + break $label0$0; + } + if ("atan2" === _0_0) { + t1 = A.SassCalculation_atan20(J.$index$asx($arguments, 0), A.ListExtensions_elementAtOrNull($arguments, 1)); + break $label0$0; + } + if ("log" === _0_0) { + t1 = A.SassCalculation_log0(J.$index$asx($arguments, 0), A.ListExtensions_elementAtOrNull($arguments, 1)); + break $label0$0; + } + if ("mod" === _0_0) { + t1 = A.SassCalculation_mod0(J.$index$asx($arguments, 0), A.ListExtensions_elementAtOrNull($arguments, 1)); + break $label0$0; + } + if ("rem" === _0_0) { + t1 = A.SassCalculation_rem0(J.$index$asx($arguments, 0), A.ListExtensions_elementAtOrNull($arguments, 1)); + break $label0$0; + } + if ("round" === _0_0) { + t1 = A.SassCalculation_round0(J.$index$asx($arguments, 0), A.ListExtensions_elementAtOrNull($arguments, 1), A.ListExtensions_elementAtOrNull($arguments, 2)); + break $label0$0; + } + if ("clamp" === _0_0) { + t1 = A.SassCalculation_clamp0(J.$index$asx($arguments, 0), A.ListExtensions_elementAtOrNull($arguments, 1), A.ListExtensions_elementAtOrNull($arguments, 2)); + break $label0$0; + } + t3 = A.UnsupportedError$('Unknown calculation name "' + node.get$name(0) + '".'); + t1 = A.throwExpression(t3); + } + t1 = t1; + $async$returnValue = t1; + // goto return + $async$goto = 1; + break; + } catch (exception) { + t1 = A.unwrapException(exception); + if (t1 instanceof A.SassScriptException0) { + error = t1; + stackTrace = A.getTraceFromException(exception); + if (B.JSString_methods.contains$1(error.message, "compatible")) + $async$self._async_evaluate0$_verifyCompatibleNumbers$2($arguments, t2); + A.throwWithTrace0($async$self._async_evaluate0$_exception$2(error.message, node.span), error, stackTrace); + } else + throw exception; + } finally { + $async$self._async_evaluate0$_callableNode = oldCallableNode; + } + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$_async_evaluate0$_visitCalculation$2$inLegacySassFunction, $async$completer); + }, + _async_evaluate0$_checkCalculationArguments$1(node) { + var _0_0, + check = new A._EvaluateVisitor__checkCalculationArguments_check2(this, node); + $label0$0: { + _0_0 = A.stringReplaceAllUnchecked(node.originalName, "_", "-").toLowerCase(); + if ("calc" === _0_0 || "sqrt" === _0_0 || "sin" === _0_0 || "cos" === _0_0 || "tan" === _0_0 || "asin" === _0_0 || "acos" === _0_0 || "atan" === _0_0 || "abs" === _0_0 || "exp" === _0_0 || "sign" === _0_0) { + check.call$1(1); + break $label0$0; + } + if ("min" === _0_0 || "max" === _0_0 || "hypot" === _0_0) { + check.call$0(); + break $label0$0; + } + if ("pow" === _0_0 || "atan2" === _0_0 || "log" === _0_0 || "mod" === _0_0 || "rem" === _0_0) { + check.call$1(2); + break $label0$0; + } + if ("round" === _0_0 || "clamp" === _0_0) { + check.call$1(3); + break $label0$0; + } + throw A.wrapException(A.UnsupportedError$('Unknown calculation name "' + node.get$name(0) + '".')); + } + }, + _async_evaluate0$_verifyCompatibleNumbers$2(args, nodesWithSpans) { + var i, t1, _0_0, arg, number1, j, number2; + for (i = 0; t1 = args.length, i < t1; ++i) { + _0_0 = args[i]; + if (_0_0 instanceof A.SassNumber0) { + t1 = _0_0.get$hasComplexUnits(); + arg = _0_0; + } else { + arg = null; + t1 = false; + } + if (t1) + throw A.wrapException(this._async_evaluate0$_exception$2("Number " + A.S(arg) + " isn't compatible with CSS calculations.", J.get$span$z(nodesWithSpans[i]))); + } + for (i = 0; i < t1 - 1; ++i) { + number1 = args[i]; + if (!(number1 instanceof A.SassNumber0)) + continue; + for (j = i + 1; t1 = args.length, j < t1; ++j) { + number2 = args[j]; + if (!(number2 instanceof A.SassNumber0)) + continue; + if (number1.hasPossiblyCompatibleUnits$1(number2)) + continue; + throw A.wrapException(A.MultiSpanSassRuntimeException$0(number1.toString$0(0) + " and " + number2.toString$0(0) + " are incompatible.", J.get$span$z(nodesWithSpans[i]), number1.toString$0(0), A.LinkedHashMap_LinkedHashMap$_literal([J.get$span$z(nodesWithSpans[j]), number2.toString$0(0)], type$.FileSpan, type$.String), this._async_evaluate0$_stackTrace$1(J.get$span$z(nodesWithSpans[i])), null)); + } + } + }, + _async_evaluate0$_visitCalculationExpression$2$inLegacySassFunction(node, inLegacySassFunction) { + return this._visitCalculationExpression$body$_EvaluateVisitor0(node, inLegacySassFunction); + }, + _visitCalculationExpression$body$_EvaluateVisitor0(node, inLegacySassFunction) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Object), + $async$returnValue, $async$self = this, inner, t1, result, t2, _0_0, _1_0, t3, _i, i, _box_0, $async$temp1; + var $async$_async_evaluate0$_visitCalculationExpression$2$inLegacySassFunction = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + _box_0 = {}; + if (node instanceof A.ParenthesizedExpression0) { + inner = node.expression; + t1 = true; + } else { + inner = null; + t1 = false; + } + $async$goto = t1 ? 3 : 4; + break; + case 3: + // then + $async$goto = 5; + return A._asyncAwait($async$self._async_evaluate0$_visitCalculationExpression$2$inLegacySassFunction(inner, inLegacySassFunction), $async$_async_evaluate0$_visitCalculationExpression$2$inLegacySassFunction); + case 5: + // returning from await. + result = $async$result; + $async$returnValue = result instanceof A.SassString0 ? new A.SassString0("(" + result._string0$_text + ")", false) : result; + // goto return + $async$goto = 1; + break; + case 4: + // join + $async$goto = node instanceof A.StringExpression0 && node.accept$1(new A._IsCalculationSafeVisitor0()) ? 6 : 7; + break; + case 6: + // then + t1 = node.text; + t2 = t1.get$asPlain(); + _0_0 = t2 == null ? null : t2.toLowerCase(); + if ("pi" === _0_0) { + t1 = A.SassNumber_SassNumber0(3.141592653589793, null); + // goto break $label0$0 + $async$goto = 8; + break; + } + if ("e" === _0_0) { + t1 = A.SassNumber_SassNumber0(2.718281828459045, null); + // goto break $label0$0 + $async$goto = 8; + break; + } + if ("infinity" === _0_0) { + t1 = A.SassNumber_SassNumber0(1 / 0, null); + // goto break $label0$0 + $async$goto = 8; + break; + } + if ("-infinity" === _0_0) { + t1 = A.SassNumber_SassNumber0(-1 / 0, null); + // goto break $label0$0 + $async$goto = 8; + break; + } + if ("nan" === _0_0) { + t1 = A.SassNumber_SassNumber0(0 / 0, null); + // goto break $label0$0 + $async$goto = 8; + break; + } + $async$temp1 = A; + $async$goto = 9; + return A._asyncAwait($async$self._async_evaluate0$_performInterpolation$1(t1), $async$_async_evaluate0$_visitCalculationExpression$2$inLegacySassFunction); + case 9: + // returning from await. + t1 = new $async$temp1.SassString0($async$result, false); + // goto break $label0$0 + $async$goto = 8; + break; + case 8: + // break $label0$0 + $async$returnValue = t1; + // goto return + $async$goto = 1; + break; + case 7: + // join + _box_0.right = _box_0.left = _box_0.operator = null; + if (node instanceof A.BinaryOperationExpression0) { + _box_0.operator = node.operator; + _box_0.left = node.left; + _box_0.right = node.right; + t1 = true; + } else + t1 = false; + $async$goto = t1 ? 10 : 11; + break; + case 10: + // then + $async$self._async_evaluate0$_checkWhitespaceAroundCalculationOperator$1(node); + $async$goto = 12; + return A._asyncAwait($async$self._async_evaluate0$_addExceptionSpanAsync$1$2(node, new A._EvaluateVisitor__visitCalculationExpression_closure2(_box_0, $async$self, node, inLegacySassFunction), type$.Object), $async$_async_evaluate0$_visitCalculationExpression$2$inLegacySassFunction); + case 12: + // returning from await. + $async$returnValue = $async$result; + // goto return + $async$goto = 1; + break; + case 11: + // join + $async$goto = node instanceof A.NumberExpression0 || node instanceof A.VariableExpression0 || node instanceof A.FunctionExpression0 || node instanceof A.IfExpression0 ? 13 : 14; + break; + case 13: + // then + $async$goto = 15; + return A._asyncAwait(node.accept$1($async$self), $async$_async_evaluate0$_visitCalculationExpression$2$inLegacySassFunction); + case 15: + // returning from await. + _1_0 = $async$result; + $label1$1: { + if (_1_0 instanceof A.SassNumber0) { + t1 = _1_0; + break $label1$1; + } + if (_1_0 instanceof A.SassCalculation0) { + t1 = _1_0; + break $label1$1; + } + if (_1_0 instanceof A.SassString0) { + t1 = !_1_0._string0$_hasQuotes; + result = _1_0; + } else { + result = null; + t1 = false; + } + if (t1) { + t1 = result; + break $label1$1; + } + t1 = A.throwExpression($async$self._async_evaluate0$_exception$2("Value " + _1_0.toString$0(0) + " can't be used in a calculation.", node.get$span(node))); + } + $async$returnValue = t1; + // goto return + $async$goto = 1; + break; + case 14: + // join + $async$goto = node instanceof A.ListExpression0 && !node.hasBrackets && B.ListSeparator_EVt0 === node.separator && node.contents.length >= 2 ? 16 : 17; + break; + case 16: + // then + t1 = A._setArrayType([], type$.JSArray_Object); + t2 = node.contents, t3 = t2.length, _i = 0; + case 18: + // for condition + if (!(_i < t3)) { + // goto after for + $async$goto = 20; + break; + } + $async$temp1 = t1; + $async$goto = 21; + return A._asyncAwait($async$self._async_evaluate0$_visitCalculationExpression$2$inLegacySassFunction(t2[_i], inLegacySassFunction), $async$_async_evaluate0$_visitCalculationExpression$2$inLegacySassFunction); + case 21: + // returning from await. + $async$temp1.push($async$result); + case 19: + // for update + ++_i; + // goto for condition + $async$goto = 18; + break; + case 20: + // after for + $async$self._async_evaluate0$_checkAdjacentCalculationValues$2(t1, node); + for (i = 0; i < t1.length; ++i) { + t3 = t1[i]; + if (t3 instanceof A.CalculationOperation0 && t2[i] instanceof A.ParenthesizedExpression0) + t1[i] = new A.SassString0("(" + A.S(t3) + ")", false); + } + $async$returnValue = new A.SassString0(B.JSArray_methods.join$1(t1, " "), false); + // goto return + $async$goto = 1; + break; + case 17: + // join + throw A.wrapException($async$self._async_evaluate0$_exception$2(string$.This_e, node.get$span(node))); + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$_async_evaluate0$_visitCalculationExpression$2$inLegacySassFunction, $async$completer); + }, + _async_evaluate0$_checkWhitespaceAroundCalculationOperator$1(node) { + var t2, t3, t4, textBetweenOperands, first, last, + t1 = node.operator; + if (t1 !== B.BinaryOperator_anB0 && t1 !== B.BinaryOperator_olz0) + return; + t1 = node.left; + t2 = t1.get$span(t1); + t2 = t2.get$file(t2); + t3 = node.right; + t4 = t3.get$span(t3); + if (t2 !== t4.get$file(t4)) + return; + t2 = t1.get$span(t1); + t2 = t2.get$end(t2); + t4 = t3.get$span(t3); + if (t2.offset >= t4.get$start(t4).offset) + return; + t2 = t1.get$span(t1); + t2 = t2.get$file(t2); + t1 = t1.get$span(t1); + t1 = t1.get$end(t1); + t3 = t3.get$span(t3); + textBetweenOperands = A.String_String$fromCharCodes(B.NativeUint32List_methods.sublist$2(t2._decodedChars, t1.offset, t3.get$start(t3).offset), 0, null); + first = textBetweenOperands.charCodeAt(0); + last = textBetweenOperands.charCodeAt(textBetweenOperands.length - 1); + if (first === 32 || first === 9 || first === 10 || first === 13 || first === 12 || first === 47) + t1 = !(last === 32 || last === 9 || last === 10 || last === 13 || last === 12 || last === 47); + else + t1 = true; + if (t1) + throw A.wrapException(this._async_evaluate0$_exception$2(string$.x22x2b__an, node.get$operatorSpan())); + }, + _async_evaluate0$_binaryOperatorToCalculationOperator$2(operator, node) { + var t1; + $label0$0: { + if (B.BinaryOperator_anB0 === operator) { + t1 = B.CalculationOperator_IyK0; + break $label0$0; + } + if (B.BinaryOperator_olz0 === operator) { + t1 = B.CalculationOperator_2bx0; + break $label0$0; + } + if (B.BinaryOperator_qN20 === operator) { + t1 = B.CalculationOperator_jFr0; + break $label0$0; + } + if (B.BinaryOperator_t8B0 === operator) { + t1 = B.CalculationOperator_OvN0; + break $label0$0; + } + t1 = A.throwExpression(this._async_evaluate0$_exception$2(string$.This_o, node.get$operatorSpan())); + } + return t1; + }, + _async_evaluate0$_checkAdjacentCalculationValues$2(elements, node) { + var t1, i, t2, previous, current, previousNode, currentNode, _0_2; + for (t1 = elements.length, i = 1; i < t1; ++i) { + t2 = i - 1; + previous = elements[t2]; + current = elements[i]; + if (previous instanceof A.SassString0 || current instanceof A.SassString0) + continue; + t1 = node.contents; + previousNode = t1[t2]; + currentNode = t1[i]; + if (currentNode instanceof A.UnaryOperationExpression0) { + _0_2 = currentNode.operator; + if (B.UnaryOperator_TLI0 !== _0_2) + t1 = B.UnaryOperator_gg40 === _0_2; + else + t1 = true; + } else + t1 = false; + if (!t1) + t1 = currentNode instanceof A.NumberExpression0 && currentNode.value < 0; + else + t1 = true; + if (t1) + throw A.wrapException(this._async_evaluate0$_exception$2(string$.x22x2b__an, A.FileSpanExtension_subspan(currentNode.get$span(currentNode), 0, 1))); + else + throw A.wrapException(this._async_evaluate0$_exception$2("Missing math operator.", previousNode.get$span(previousNode).expand$1(0, currentNode.get$span(currentNode)))); + } + }, + visitInterpolatedFunctionExpression$1(node) { + return this.visitInterpolatedFunctionExpression$body$_EvaluateVisitor0(node); + }, + visitInterpolatedFunctionExpression$body$_EvaluateVisitor0(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Value_2), + $async$returnValue, $async$self = this, result, t1, oldInFunction; + var $async$visitInterpolatedFunctionExpression$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$goto = 3; + return A._asyncAwait($async$self._async_evaluate0$_performInterpolation$1(node.name), $async$visitInterpolatedFunctionExpression$1); + case 3: + // returning from await. + t1 = $async$result; + oldInFunction = $async$self._async_evaluate0$_inFunction; + $async$self._async_evaluate0$_inFunction = true; + $async$goto = 4; + return A._asyncAwait($async$self._async_evaluate0$_addErrorSpan$1$2(node, new A._EvaluateVisitor_visitInterpolatedFunctionExpression_closure2($async$self, node, new A.PlainCssCallable0(t1)), type$.Value_2), $async$visitInterpolatedFunctionExpression$1); + case 4: + // returning from await. + result = $async$result; + $async$self._async_evaluate0$_inFunction = oldInFunction; + $async$returnValue = result; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$visitInterpolatedFunctionExpression$1, $async$completer); + }, + _async_evaluate0$_runUserDefinedCallable$1$4($arguments, callable, nodeWithSpan, run, $V) { + return this._runUserDefinedCallable$body$_EvaluateVisitor0($arguments, callable, nodeWithSpan, run, $V, $V); + }, + _runUserDefinedCallable$body$_EvaluateVisitor0($arguments, callable, nodeWithSpan, run, $V, $async$type) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter($async$type), + $async$returnValue, $async$self = this, oldCallable, result, evaluated, $name; + var $async$_async_evaluate0$_runUserDefinedCallable$1$4 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$goto = 3; + return A._asyncAwait($async$self._async_evaluate0$_evaluateArguments$1($arguments), $async$_async_evaluate0$_runUserDefinedCallable$1$4); + case 3: + // returning from await. + evaluated = $async$result; + $name = callable.declaration.name; + if ($name !== "@content") + $name += "()"; + oldCallable = $async$self._async_evaluate0$_currentCallable; + $async$self._async_evaluate0$_currentCallable = callable; + $async$goto = 4; + return A._asyncAwait($async$self._async_evaluate0$_withStackFrame$1$3($name, nodeWithSpan, new A._EvaluateVisitor__runUserDefinedCallable_closure2($async$self, callable, evaluated, nodeWithSpan, run, $V), $V), $async$_async_evaluate0$_runUserDefinedCallable$1$4); + case 4: + // returning from await. + result = $async$result; + $async$self._async_evaluate0$_currentCallable = oldCallable; + $async$returnValue = result; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$_async_evaluate0$_runUserDefinedCallable$1$4, $async$completer); + }, + _async_evaluate0$_runFunctionCallable$3($arguments, callable, nodeWithSpan) { + return this._runFunctionCallable$body$_EvaluateVisitor0($arguments, callable, nodeWithSpan); + }, + _runFunctionCallable$body$_EvaluateVisitor0($arguments, callable, nodeWithSpan) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Value_2), + $async$returnValue, $async$handler = 2, $async$currentError, $async$self = this, buffer, first, argument, restArg, rest, error, t1, t2, _i, exception, $async$exception, $async$temp1, $async$temp2; + var $async$_async_evaluate0$_runFunctionCallable$3 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) { + $async$currentError = $async$result; + $async$goto = $async$handler; + } + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$goto = type$.AsyncBuiltInCallable_2._is(callable) ? 3 : 5; + break; + case 3: + // then + $async$goto = 6; + return A._asyncAwait($async$self._async_evaluate0$_runBuiltInCallable$3($arguments, callable, nodeWithSpan), $async$_async_evaluate0$_runFunctionCallable$3); + case 6: + // returning from await. + $async$returnValue = $async$self._async_evaluate0$_withoutSlash$2($async$result, nodeWithSpan); + // goto return + $async$goto = 1; + break; + // goto join + $async$goto = 4; + break; + case 5: + // else + $async$goto = type$.UserDefinedCallable_AsyncEnvironment_2._is(callable) ? 7 : 9; + break; + case 7: + // then + $async$goto = 10; + return A._asyncAwait($async$self._async_evaluate0$_runUserDefinedCallable$1$4($arguments, callable, nodeWithSpan, new A._EvaluateVisitor__runFunctionCallable_closure2($async$self, callable), type$.Value_2), $async$_async_evaluate0$_runFunctionCallable$3); + case 10: + // returning from await. + $async$returnValue = $async$result; + // goto return + $async$goto = 1; + break; + // goto join + $async$goto = 8; + break; + case 9: + // else + $async$goto = callable instanceof A.PlainCssCallable0 ? 11 : 13; + break; + case 11: + // then + t1 = $arguments.named; + if (t1.get$isNotEmpty(t1) || $arguments.keywordRest != null) + throw A.wrapException($async$self._async_evaluate0$_exception$2(string$.Plain_, nodeWithSpan.get$span(nodeWithSpan))); + buffer = new A.StringBuffer(callable.name + "("); + $async$handler = 15; + first = true; + t1 = $arguments.positional, t2 = t1.length, _i = 0; + case 18: + // for condition + if (!(_i < t2)) { + // goto after for + $async$goto = 20; + break; + } + argument = t1[_i]; + if (first) + first = false; + else + buffer._contents += ", "; + $async$temp1 = buffer; + $async$temp2 = A; + $async$goto = 21; + return A._asyncAwait($async$self._async_evaluate0$_evaluateToCss$1(argument), $async$_async_evaluate0$_runFunctionCallable$3); + case 21: + // returning from await. + $async$temp1._contents += $async$temp2.S($async$result); + case 19: + // for update + ++_i; + // goto for condition + $async$goto = 18; + break; + case 20: + // after for + restArg = $arguments.rest; + $async$goto = restArg != null ? 22 : 23; + break; + case 22: + // then + $async$goto = 24; + return A._asyncAwait(restArg.accept$1($async$self), $async$_async_evaluate0$_runFunctionCallable$3); + case 24: + // returning from await. + rest = $async$result; + if (!first) + buffer._contents += ", "; + buffer._contents += $async$self._async_evaluate0$_serialize$2(rest, restArg); + case 23: + // join + $async$handler = 2; + // goto after finally + $async$goto = 17; + break; + case 15: + // catch + $async$handler = 14; + $async$exception = $async$currentError; + t1 = A.unwrapException($async$exception); + if (type$.SassRuntimeException_2._is(t1)) { + error = t1; + if (!B.JSString_methods.endsWith$1(error._span_exception$_message, "isn't a valid CSS value.")) + throw $async$exception; + throw A.wrapException(A.MultiSpanSassRuntimeException$0(error._span_exception$_message, J.get$span$z(error), "value", A.LinkedHashMap_LinkedHashMap$_literal([nodeWithSpan.get$span(nodeWithSpan), "unknown function treated as plain CSS"], type$.FileSpan, type$.String), J.get$trace$z(error), null)); + } else + throw $async$exception; + // goto after finally + $async$goto = 17; + break; + case 14: + // uncaught + // goto rethrow + $async$goto = 2; + break; + case 17: + // after finally + buffer._contents += A.Primitives_stringFromCharCode(41); + t1 = buffer._contents; + $async$returnValue = new A.SassString0(t1.charCodeAt(0) == 0 ? t1 : t1, false); + // goto return + $async$goto = 1; + break; + // goto join + $async$goto = 12; + break; + case 13: + // else + throw A.wrapException(A.ArgumentError$("Unknown callable type " + J.get$runtimeType$(callable).toString$0(0) + ".", null)); + case 12: + // join + case 8: + // join + case 4: + // join + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + case 2: + // rethrow + return A._asyncRethrow($async$currentError, $async$completer); + } + }); + return A._asyncStartSync($async$_async_evaluate0$_runFunctionCallable$3, $async$completer); + }, + _async_evaluate0$_runBuiltInCallable$3($arguments, callable, nodeWithSpan) { + return this._runBuiltInCallable$body$_EvaluateVisitor0($arguments, callable, nodeWithSpan); + }, + _runBuiltInCallable$body$_EvaluateVisitor0($arguments, callable, nodeWithSpan) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Value_2), + $async$returnValue, $async$handler = 2, $async$currentError, $async$self = this, result, error, stackTrace, message, namedSet, _0_0, declaredArguments, i, t1, t2, t3, argument, t4, t5, t6, t7, rest, argumentList, exception, message0, _box_0, evaluated, oldCallableNode, $async$exception; + var $async$_async_evaluate0$_runBuiltInCallable$3 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) { + $async$currentError = $async$result; + $async$goto = $async$handler; + } + while (true) + switch ($async$goto) { + case 0: + // Function start + _box_0 = {}; + $async$goto = 3; + return A._asyncAwait($async$self._async_evaluate0$_evaluateArguments$1($arguments), $async$_async_evaluate0$_runBuiltInCallable$3); + case 3: + // returning from await. + evaluated = $async$result; + oldCallableNode = $async$self._async_evaluate0$_callableNode; + $async$self._async_evaluate0$_callableNode = nodeWithSpan; + namedSet = new A.MapKeySet(evaluated._values[0], type$.MapKeySet_String); + _box_0.callback = _box_0.overload = null; + _0_0 = callable.callbackFor$2(J.get$length$asx(evaluated._values[2]), namedSet); + _box_0.overload = _0_0._0; + _box_0.callback = _0_0._1; + $async$self._async_evaluate0$_addExceptionSpan$2(nodeWithSpan, new A._EvaluateVisitor__runBuiltInCallable_closure8(_box_0, evaluated, namedSet)); + declaredArguments = _box_0.overload.$arguments; + i = J.get$length$asx(evaluated._values[2]), t1 = declaredArguments.length, t2 = type$._Future_Value_2, t3 = type$.Future_Value_2; + case 4: + // for condition + if (!(i < t1)) { + // goto after for + $async$goto = 6; + break; + } + argument = declaredArguments[i]; + t4 = evaluated._values[2]; + t5 = evaluated._values[0].remove$1(0, argument.name); + $async$goto = t5 == null ? 7 : 8; + break; + case 7: + // then + t5 = argument.defaultValue; + t6 = t5.accept$1($async$self); + if (!t3._is(t6)) { + t7 = new A._Future($.Zone__current, t2); + t7._state = 8; + t7._resultOrListeners = t6; + t6 = t7; + } + $async$goto = 9; + return A._asyncAwait(t6, $async$_async_evaluate0$_runBuiltInCallable$3); + case 9: + // returning from await. + t5 = $async$self._async_evaluate0$_withoutSlash$2($async$result, t5); + case 8: + // join + J.add$1$ax(t4, t5); + case 5: + // for update + ++i; + // goto for condition + $async$goto = 4; + break; + case 6: + // after for + if (_box_0.overload.restArgument != null) { + if (J.get$length$asx(evaluated._values[2]) > t1) { + rest = J.sublist$1$ax(evaluated._values[2], t1); + J.removeRange$2$ax(evaluated._values[2], t1, J.get$length$asx(evaluated._values[2])); + } else + rest = B.List_empty19; + t1 = evaluated._values[0]; + argumentList = A.SassArgumentList$0(rest, t1, evaluated._values[4] === B.ListSeparator_undecided_null_undecided0 ? B.ListSeparator_rXA0 : evaluated._values[4]); + J.add$1$ax(evaluated._values[2], argumentList); + } else + argumentList = null; + result = null; + $async$handler = 11; + $async$goto = 14; + return A._asyncAwait($async$self._async_evaluate0$_addExceptionSpanAsync$1$2(nodeWithSpan, new A._EvaluateVisitor__runBuiltInCallable_closure9(_box_0, evaluated), type$.Value_2), $async$_async_evaluate0$_runBuiltInCallable$3); + case 14: + // returning from await. + result = $async$result; + $async$handler = 2; + // goto after finally + $async$goto = 13; + break; + case 11: + // catch + $async$handler = 10; + $async$exception = $async$currentError; + t1 = A.unwrapException($async$exception); + if (t1 instanceof A.SassException0) + throw $async$exception; + else { + error = t1; + stackTrace = A.getTraceFromException($async$exception); + message = null; + try { + message = A._asString(J.get$message$x(error)); + } catch (exception) { + message0 = J.toString$0$(error); + message = message0; + } + A.throwWithTrace0($async$self._async_evaluate0$_exception$2(message, nodeWithSpan.get$span(nodeWithSpan)), error, stackTrace); + } + // goto after finally + $async$goto = 13; + break; + case 10: + // uncaught + // goto rethrow + $async$goto = 2; + break; + case 13: + // after finally + $async$self._async_evaluate0$_callableNode = oldCallableNode; + if (argumentList == null) { + $async$returnValue = result; + // goto return + $async$goto = 1; + break; + } + t1 = evaluated._values[0]; + if (t1.get$isEmpty(t1)) { + $async$returnValue = result; + // goto return + $async$goto = 1; + break; + } + if (argumentList._argument_list$_wereKeywordsAccessed) { + $async$returnValue = result; + // goto return + $async$goto = 1; + break; + } + t1 = evaluated._values[0]; + t1 = A.pluralize0("argument", J.get$length$asx(t1.get$keys(t1)), null); + t2 = evaluated._values[0]; + throw A.wrapException(A.MultiSpanSassRuntimeException$0("No " + t1 + " named " + A.toSentence0(J.map$1$1$ax(t2.get$keys(t2), new A._EvaluateVisitor__runBuiltInCallable_closure10(), type$.Object), "or") + ".", nodeWithSpan.get$span(nodeWithSpan), "invocation", A.LinkedHashMap_LinkedHashMap$_literal([_box_0.overload.get$spanWithName(), "declaration"], type$.FileSpan, type$.String), $async$self._async_evaluate0$_stackTrace$1(nodeWithSpan.get$span(nodeWithSpan)), null)); + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + case 2: + // rethrow + return A._asyncRethrow($async$currentError, $async$completer); + } + }); + return A._asyncStartSync($async$_async_evaluate0$_runBuiltInCallable$3, $async$completer); + }, + _async_evaluate0$_evaluateArguments$1($arguments) { + return this._evaluateArguments$body$_EvaluateVisitor0($arguments); + }, + _evaluateArguments$body$_EvaluateVisitor0($arguments) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Record_5_Map_String_Value_named_and_Map_String_AstNode_namedNodes_and_List_Value_positional_and_List_AstNode_positionalNodes_and_ListSeparator_separator_2), + $async$returnValue, $async$self = this, t1, t2, t3, t4, _i, expression, nodeForSpan, t5, t6, named, namedNodes, $name, value, t7, restArgs, rest, restNodeForSpan, separator, keywordRestArgs, keywordRest, keywordRestNodeForSpan, positional, positionalNodes, $async$temp1, $async$temp2; + var $async$_async_evaluate0$_evaluateArguments$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + positional = A._setArrayType([], type$.JSArray_Value_2); + positionalNodes = A._setArrayType([], type$.JSArray_AstNode_2); + t1 = $arguments.positional, t2 = t1.length, t3 = type$._Future_Value_2, t4 = type$.Future_Value_2, _i = 0; + case 3: + // for condition + if (!(_i < t2)) { + // goto after for + $async$goto = 5; + break; + } + expression = t1[_i]; + nodeForSpan = $async$self._async_evaluate0$_expressionNode$1(expression); + t5 = expression.accept$1($async$self); + if (!t4._is(t5)) { + t6 = new A._Future($.Zone__current, t3); + t6._state = 8; + t6._resultOrListeners = t5; + t5 = t6; + } + $async$temp1 = positional; + $async$goto = 6; + return A._asyncAwait(t5, $async$_async_evaluate0$_evaluateArguments$1); + case 6: + // returning from await. + $async$temp1.push($async$self._async_evaluate0$_withoutSlash$2($async$result, nodeForSpan)); + positionalNodes.push(nodeForSpan); + case 4: + // for update + ++_i; + // goto for condition + $async$goto = 3; + break; + case 5: + // after for + t1 = type$.String; + named = A.LinkedHashMap_LinkedHashMap$_empty(t1, type$.Value_2); + t2 = type$.AstNode_2; + namedNodes = A.LinkedHashMap_LinkedHashMap$_empty(t1, t2); + t5 = A.MapExtensions_get_pairs0($arguments.named, t1, type$.Expression_2), t5 = t5.get$iterator(t5); + case 7: + // for condition + if (!t5.moveNext$0()) { + // goto after for + $async$goto = 8; + break; + } + t6 = t5.get$current(t5); + $name = t6._0; + value = t6._1; + nodeForSpan = $async$self._async_evaluate0$_expressionNode$1(value); + t6 = value.accept$1($async$self); + if (!t4._is(t6)) { + t7 = new A._Future($.Zone__current, t3); + t7._state = 8; + t7._resultOrListeners = t6; + t6 = t7; + } + $async$temp1 = named; + $async$temp2 = $name; + $async$goto = 9; + return A._asyncAwait(t6, $async$_async_evaluate0$_evaluateArguments$1); + case 9: + // returning from await. + $async$temp1.$indexSet(0, $async$temp2, $async$self._async_evaluate0$_withoutSlash$2($async$result, nodeForSpan)); + namedNodes.$indexSet(0, $name, nodeForSpan); + // goto for condition + $async$goto = 7; + break; + case 8: + // after for + restArgs = $arguments.rest; + if (restArgs == null) { + $async$returnValue = new A._Record_5_named_namedNodes_positional_positionalNodes_separator([named, namedNodes, positional, positionalNodes, B.ListSeparator_undecided_null_undecided0]); + // goto return + $async$goto = 1; + break; + } + $async$goto = 10; + return A._asyncAwait(restArgs.accept$1($async$self), $async$_async_evaluate0$_evaluateArguments$1); + case 10: + // returning from await. + rest = $async$result; + restNodeForSpan = $async$self._async_evaluate0$_expressionNode$1(restArgs); + if (rest instanceof A.SassMap0) { + $async$self._async_evaluate0$_addRestMap$4(named, rest, restArgs, new A._EvaluateVisitor__evaluateArguments_closure11()); + t3 = A.LinkedHashMap_LinkedHashMap$_empty(t1, t2); + for (t4 = rest._map0$_contents, t4 = J.get$iterator$ax(t4.get$keys(t4)), t5 = type$.SassString_2; t4.moveNext$0();) + t3.$indexSet(0, t5._as(t4.get$current(t4))._string0$_text, restNodeForSpan); + namedNodes.addAll$1(0, t3); + separator = B.ListSeparator_undecided_null_undecided0; + } else if (rest instanceof A.SassList0) { + t3 = rest._list1$_contents; + B.JSArray_methods.addAll$1(positional, new A.MappedListIterable(t3, new A._EvaluateVisitor__evaluateArguments_closure12($async$self, restNodeForSpan), A._arrayInstanceType(t3)._eval$1("MappedListIterable<1,Value0>"))); + B.JSArray_methods.addAll$1(positionalNodes, A.List_List$filled(t3.length, restNodeForSpan, false, t2)); + separator = rest._list1$_separator; + if (rest instanceof A.SassArgumentList0) { + rest._argument_list$_wereKeywordsAccessed = true; + rest._argument_list$_keywords.forEach$1(0, new A._EvaluateVisitor__evaluateArguments_closure13($async$self, named, restNodeForSpan, namedNodes)); + } + } else { + positional.push($async$self._async_evaluate0$_withoutSlash$2(rest, restNodeForSpan)); + positionalNodes.push(restNodeForSpan); + separator = B.ListSeparator_undecided_null_undecided0; + } + keywordRestArgs = $arguments.keywordRest; + if (keywordRestArgs == null) { + $async$returnValue = new A._Record_5_named_namedNodes_positional_positionalNodes_separator([named, namedNodes, positional, positionalNodes, separator]); + // goto return + $async$goto = 1; + break; + } + $async$goto = 11; + return A._asyncAwait(keywordRestArgs.accept$1($async$self), $async$_async_evaluate0$_evaluateArguments$1); + case 11: + // returning from await. + keywordRest = $async$result; + keywordRestNodeForSpan = $async$self._async_evaluate0$_expressionNode$1(keywordRestArgs); + if (keywordRest instanceof A.SassMap0) { + $async$self._async_evaluate0$_addRestMap$4(named, keywordRest, keywordRestArgs, new A._EvaluateVisitor__evaluateArguments_closure14()); + t1 = A.LinkedHashMap_LinkedHashMap$_empty(t1, t2); + for (t2 = keywordRest._map0$_contents, t2 = J.get$iterator$ax(t2.get$keys(t2)), t3 = type$.SassString_2; t2.moveNext$0();) + t1.$indexSet(0, t3._as(t2.get$current(t2))._string0$_text, keywordRestNodeForSpan); + namedNodes.addAll$1(0, t1); + $async$returnValue = new A._Record_5_named_namedNodes_positional_positionalNodes_separator([named, namedNodes, positional, positionalNodes, separator]); + // goto return + $async$goto = 1; + break; + } else + throw A.wrapException($async$self._async_evaluate0$_exception$2(string$.Variabs + keywordRest.toString$0(0) + ").", keywordRestArgs.get$span(keywordRestArgs))); + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$_async_evaluate0$_evaluateArguments$1, $async$completer); + }, + _async_evaluate0$_evaluateMacroArguments$1(invocation) { + return this._evaluateMacroArguments$body$_EvaluateVisitor0(invocation); + }, + _evaluateMacroArguments$body$_EvaluateVisitor0(invocation) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Record_2_List_Expression_and_Map_String_Expression_2), + $async$returnValue, $async$self = this, t2, positional, named, rest, restNodeForSpan, keywordRestArgs_, keywordRest, keywordRestNodeForSpan, t1, restArgs_; + var $async$_async_evaluate0$_evaluateMacroArguments$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = invocation.$arguments; + restArgs_ = t1.rest; + if (restArgs_ == null) { + $async$returnValue = new A._Record_2(t1.positional, t1.named); + // goto return + $async$goto = 1; + break; + } + t2 = t1.positional; + positional = A._setArrayType(t2.slice(0), A._arrayInstanceType(t2)); + named = A.LinkedHashMap_LinkedHashMap$of(t1.named, type$.String, type$.Expression_2); + $async$goto = 3; + return A._asyncAwait(restArgs_.accept$1($async$self), $async$_async_evaluate0$_evaluateMacroArguments$1); + case 3: + // returning from await. + rest = $async$result; + restNodeForSpan = $async$self._async_evaluate0$_expressionNode$1(restArgs_); + if (rest instanceof A.SassMap0) + $async$self._async_evaluate0$_addRestMap$4(named, rest, invocation, new A._EvaluateVisitor__evaluateMacroArguments_closure11(restArgs_)); + else if (rest instanceof A.SassList0) { + t2 = rest._list1$_contents; + B.JSArray_methods.addAll$1(positional, new A.MappedListIterable(t2, new A._EvaluateVisitor__evaluateMacroArguments_closure12($async$self, restNodeForSpan, restArgs_), A._arrayInstanceType(t2)._eval$1("MappedListIterable<1,Expression0>"))); + if (rest instanceof A.SassArgumentList0) { + rest._argument_list$_wereKeywordsAccessed = true; + rest._argument_list$_keywords.forEach$1(0, new A._EvaluateVisitor__evaluateMacroArguments_closure13($async$self, named, restNodeForSpan, restArgs_)); + } + } else + positional.push(new A.ValueExpression0($async$self._async_evaluate0$_withoutSlash$2(rest, restNodeForSpan), restArgs_.get$span(restArgs_))); + keywordRestArgs_ = t1.keywordRest; + if (keywordRestArgs_ == null) { + $async$returnValue = new A._Record_2(positional, named); + // goto return + $async$goto = 1; + break; + } + $async$goto = 4; + return A._asyncAwait(keywordRestArgs_.accept$1($async$self), $async$_async_evaluate0$_evaluateMacroArguments$1); + case 4: + // returning from await. + keywordRest = $async$result; + keywordRestNodeForSpan = $async$self._async_evaluate0$_expressionNode$1(keywordRestArgs_); + if (keywordRest instanceof A.SassMap0) { + $async$self._async_evaluate0$_addRestMap$4(named, keywordRest, invocation, new A._EvaluateVisitor__evaluateMacroArguments_closure14($async$self, keywordRestNodeForSpan, keywordRestArgs_)); + $async$returnValue = new A._Record_2(positional, named); + // goto return + $async$goto = 1; + break; + } else + throw A.wrapException($async$self._async_evaluate0$_exception$2(string$.Variabs + keywordRest.toString$0(0) + ").", keywordRestArgs_.get$span(keywordRestArgs_))); + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$_async_evaluate0$_evaluateMacroArguments$1, $async$completer); + }, + _async_evaluate0$_addRestMap$1$4(values, map, nodeWithSpan, convert) { + map._map0$_contents.forEach$1(0, new A._EvaluateVisitor__addRestMap_closure2(this, values, convert, this._async_evaluate0$_expressionNode$1(nodeWithSpan), map, nodeWithSpan)); + }, + _async_evaluate0$_addRestMap$4(values, map, nodeWithSpan, convert) { + return this._async_evaluate0$_addRestMap$1$4(values, map, nodeWithSpan, convert, type$.dynamic); + }, + _async_evaluate0$_verifyArguments$4(positional, named, $arguments, nodeWithSpan) { + return this._async_evaluate0$_addExceptionSpan$2(nodeWithSpan, new A._EvaluateVisitor__verifyArguments_closure2($arguments, positional, named)); + }, + visitSelectorExpression$1(node) { + return this.visitSelectorExpression$body$_EvaluateVisitor0(node); + }, + visitSelectorExpression$body$_EvaluateVisitor0(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Value_2), + $async$returnValue, $async$self = this, t1; + var $async$visitSelectorExpression$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self._async_evaluate0$_styleRuleIgnoringAtRoot; + t1 = t1 == null ? null : t1.originalSelector.get$asSassList(); + $async$returnValue = t1 == null ? B.C__SassNull0 : t1; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$visitSelectorExpression$1, $async$completer); + }, + visitStringExpression$1(node) { + return this.visitStringExpression$body$_EvaluateVisitor0(node); + }, + visitStringExpression$body$_EvaluateVisitor0(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.SassString_2), + $async$returnValue, $async$self = this, t1, t2, t3, t4, _i, value, t5, _0_0, text, oldInSupportsDeclaration; + var $async$visitStringExpression$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + oldInSupportsDeclaration = $async$self._async_evaluate0$_inSupportsDeclaration; + $async$self._async_evaluate0$_inSupportsDeclaration = false; + t1 = A._setArrayType([], type$.JSArray_String); + t2 = node.text.contents, t3 = t2.length, t4 = type$.Expression_2, _i = 0; + case 3: + // for condition + if (!(_i < t3)) { + // goto after for + $async$goto = 5; + break; + } + value = t2[_i]; + if (typeof value == "string") { + t5 = value; + // goto break $label0$0 + $async$goto = 6; + break; + } + $async$goto = t4._is(value) ? 7 : 8; + break; + case 7: + // then + $async$goto = 9; + return A._asyncAwait(value.accept$1($async$self), $async$visitStringExpression$1); + case 9: + // returning from await. + _0_0 = $async$result; + $label1$1: { + if (_0_0 instanceof A.SassString0) { + text = _0_0._string0$_text; + t5 = text; + break $label1$1; + } + t5 = $async$self._async_evaluate0$_serialize$3$quote(_0_0, value, false); + break $label1$1; + } + // goto break $label0$0 + $async$goto = 6; + break; + case 8: + // join + t5 = A.throwExpression(A.UnsupportedError$("Unknown interpolation value " + A.S(value))); + case 6: + // break $label0$0 + t1.push(t5); + case 4: + // for update + ++_i; + // goto for condition + $async$goto = 3; + break; + case 5: + // after for + t1 = B.JSArray_methods.join$0(t1); + $async$self._async_evaluate0$_inSupportsDeclaration = oldInSupportsDeclaration; + $async$returnValue = new A.SassString0(t1, node.hasQuotes); + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$visitStringExpression$1, $async$completer); + }, + visitSupportsExpression$1(expression) { + return this.visitSupportsExpression$body$_EvaluateVisitor0(expression); + }, + visitSupportsExpression$body$_EvaluateVisitor0(expression) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.SassString_2), + $async$returnValue, $async$self = this, $async$temp1; + var $async$visitSupportsExpression$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$temp1 = A; + $async$goto = 3; + return A._asyncAwait($async$self._async_evaluate0$_visitSupportsCondition$1(expression.condition), $async$visitSupportsExpression$1); + case 3: + // returning from await. + $async$returnValue = new $async$temp1.SassString0($async$result, false); + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$visitSupportsExpression$1, $async$completer); + }, + visitCssAtRule$1(node) { + return this.visitCssAtRule$body$_EvaluateVisitor0(node); + }, + visitCssAtRule$body$_EvaluateVisitor0(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void), + $async$returnValue, $async$self = this, wasInKeyframes, wasInUnknownAtRule, t1; + var $async$visitCssAtRule$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + if ($async$self._async_evaluate0$_declarationName != null) + throw A.wrapException($async$self._async_evaluate0$_exception$2(string$.At_rul, node.span)); + if (node.isChildless) { + $async$self._async_evaluate0$_assertInModule$2($async$self._async_evaluate0$__parent, "__parent").addChild$1(A.ModifiableCssAtRule$0(node.name, node.span, true, node.value)); + // goto return + $async$goto = 1; + break; + } + wasInKeyframes = $async$self._async_evaluate0$_inKeyframes; + wasInUnknownAtRule = $async$self._async_evaluate0$_inUnknownAtRule; + t1 = node.name; + if (A.unvendor0(t1.value) === "keyframes") + $async$self._async_evaluate0$_inKeyframes = true; + else + $async$self._async_evaluate0$_inUnknownAtRule = true; + $async$goto = 3; + return A._asyncAwait($async$self._async_evaluate0$_withParent$2$4$scopeWhen$through(A.ModifiableCssAtRule$0(t1, node.span, false, node.value), new A._EvaluateVisitor_visitCssAtRule_closure5($async$self, node), false, new A._EvaluateVisitor_visitCssAtRule_closure6(), type$.ModifiableCssAtRule_2, type$.Null), $async$visitCssAtRule$1); + case 3: + // returning from await. + $async$self._async_evaluate0$_inUnknownAtRule = wasInUnknownAtRule; + $async$self._async_evaluate0$_inKeyframes = wasInKeyframes; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$visitCssAtRule$1, $async$completer); + }, + visitCssComment$1(node) { + return this.visitCssComment$body$_EvaluateVisitor0(node); + }, + visitCssComment$body$_EvaluateVisitor0(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void), + $async$self = this; + var $async$visitCssComment$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + if ($async$self._async_evaluate0$_assertInModule$2($async$self._async_evaluate0$__parent, "__parent") === $async$self._async_evaluate0$_assertInModule$2($async$self._async_evaluate0$__root, "_root") && $async$self._async_evaluate0$_assertInModule$2($async$self._async_evaluate0$__endOfImports, "_endOfImports") === J.get$length$asx($async$self._async_evaluate0$_assertInModule$2($async$self._async_evaluate0$__root, "_root").children._collection$_source)) + $async$self._async_evaluate0$__endOfImports = $async$self._async_evaluate0$_assertInModule$2($async$self._async_evaluate0$__endOfImports, "_endOfImports") + 1; + $async$self._async_evaluate0$_assertInModule$2($async$self._async_evaluate0$__parent, "__parent").addChild$1(new A.ModifiableCssComment0(node.text, node.span)); + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$visitCssComment$1, $async$completer); + }, + visitCssDeclaration$1(node) { + return this.visitCssDeclaration$body$_EvaluateVisitor0(node); + }, + visitCssDeclaration$body$_EvaluateVisitor0(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void), + $async$self = this; + var $async$visitCssDeclaration$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$self._async_evaluate0$_assertInModule$2($async$self._async_evaluate0$__parent, "__parent").addChild$1(A.ModifiableCssDeclaration$0(node.name, node.value, node.span, node.parsedAsCustomProperty, node.valueSpanForMap)); + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$visitCssDeclaration$1, $async$completer); + }, + visitCssImport$1(node) { + return this.visitCssImport$body$_EvaluateVisitor0(node); + }, + visitCssImport$body$_EvaluateVisitor0(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void), + $async$self = this, t1, modifiableNode; + var $async$visitCssImport$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + modifiableNode = new A.ModifiableCssImport0(node.url, node.modifiers, node.span); + if ($async$self._async_evaluate0$_assertInModule$2($async$self._async_evaluate0$__parent, "__parent") !== $async$self._async_evaluate0$_assertInModule$2($async$self._async_evaluate0$__root, "_root")) + $async$self._async_evaluate0$_assertInModule$2($async$self._async_evaluate0$__parent, "__parent").addChild$1(modifiableNode); + else if ($async$self._async_evaluate0$_assertInModule$2($async$self._async_evaluate0$__endOfImports, "_endOfImports") === J.get$length$asx($async$self._async_evaluate0$_assertInModule$2($async$self._async_evaluate0$__root, "_root").children._collection$_source)) { + $async$self._async_evaluate0$_assertInModule$2($async$self._async_evaluate0$__root, "_root").addChild$1(modifiableNode); + $async$self._async_evaluate0$__endOfImports = $async$self._async_evaluate0$_assertInModule$2($async$self._async_evaluate0$__endOfImports, "_endOfImports") + 1; + } else { + t1 = $async$self._async_evaluate0$_outOfOrderImports; + (t1 == null ? $async$self._async_evaluate0$_outOfOrderImports = A._setArrayType([], type$.JSArray_ModifiableCssImport_2) : t1).push(modifiableNode); + } + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$visitCssImport$1, $async$completer); + }, + visitCssKeyframeBlock$1(node) { + return this.visitCssKeyframeBlock$body$_EvaluateVisitor0(node); + }, + visitCssKeyframeBlock$body$_EvaluateVisitor0(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void), + $async$self = this; + var $async$visitCssKeyframeBlock$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$goto = 2; + return A._asyncAwait($async$self._async_evaluate0$_withParent$2$4$scopeWhen$through(A.ModifiableCssKeyframeBlock$0(node.selector, node.span), new A._EvaluateVisitor_visitCssKeyframeBlock_closure5($async$self, node), false, new A._EvaluateVisitor_visitCssKeyframeBlock_closure6(), type$.ModifiableCssKeyframeBlock_2, type$.Null), $async$visitCssKeyframeBlock$1); + case 2: + // returning from await. + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$visitCssKeyframeBlock$1, $async$completer); + }, + visitCssMediaRule$1(node) { + return this.visitCssMediaRule$body$_EvaluateVisitor0(node); + }, + visitCssMediaRule$body$_EvaluateVisitor0(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void), + $async$returnValue, $async$self = this, mergedQueries, t1, mergedSources, t2, t3; + var $async$visitCssMediaRule$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + if ($async$self._async_evaluate0$_declarationName != null) + throw A.wrapException($async$self._async_evaluate0$_exception$2(string$.Media_, node.span)); + mergedQueries = A.NullableExtension_andThen0($async$self._async_evaluate0$_mediaQueries, new A._EvaluateVisitor_visitCssMediaRule_closure8($async$self, node)); + t1 = mergedQueries == null; + if (!t1 && J.get$isEmpty$asx(mergedQueries)) { + // goto return + $async$goto = 1; + break; + } + if (t1) + mergedSources = B.Set_empty5; + else { + t2 = $async$self._async_evaluate0$_mediaQuerySources; + t2.toString; + t2 = A.LinkedHashSet_LinkedHashSet$of(t2, type$.CssMediaQuery_2); + t3 = $async$self._async_evaluate0$_mediaQueries; + t3.toString; + t2.addAll$1(0, t3); + t2.addAll$1(0, node.queries); + mergedSources = t2; + } + t1 = t1 ? node.queries : mergedQueries; + $async$goto = 3; + return A._asyncAwait($async$self._async_evaluate0$_withParent$2$4$scopeWhen$through(A.ModifiableCssMediaRule$0(t1, node.span), new A._EvaluateVisitor_visitCssMediaRule_closure9($async$self, mergedQueries, node, mergedSources), false, new A._EvaluateVisitor_visitCssMediaRule_closure10(mergedSources), type$.ModifiableCssMediaRule_2, type$.Null), $async$visitCssMediaRule$1); + case 3: + // returning from await. + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$visitCssMediaRule$1, $async$completer); + }, + visitCssStyleRule$1(node) { + return this.visitCssStyleRule$body$_EvaluateVisitor0(node); + }, + visitCssStyleRule$body$_EvaluateVisitor0(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void), + $async$self = this, t1, styleRule, t2, t3, t4, originalSelector, rule, oldAtRootExcludingStyleRule, _0_1, lastChild; + var $async$visitCssStyleRule$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + if ($async$self._async_evaluate0$_declarationName != null) + throw A.wrapException($async$self._async_evaluate0$_exception$2(string$.Style_, node.span)); + t1 = $async$self._async_evaluate0$_atRootExcludingStyleRule; + styleRule = t1 ? null : $async$self._async_evaluate0$_styleRuleIgnoringAtRoot; + t2 = node._style_rule0$_selector._box0$_inner.value; + t3 = styleRule == null; + t4 = t3 ? null : styleRule.originalSelector; + originalSelector = t2.resolveParentSelectors$2$implicitParent(t4, !t1); + rule = A.ModifiableCssStyleRule$0($async$self._async_evaluate0$_assertInModule$2($async$self._async_evaluate0$__extensionStore, "_extensionStore").addSelector$2(originalSelector, $async$self._async_evaluate0$_mediaQueries), node.span, originalSelector); + oldAtRootExcludingStyleRule = $async$self._async_evaluate0$_atRootExcludingStyleRule; + $async$self._async_evaluate0$_atRootExcludingStyleRule = false; + $async$goto = 2; + return A._asyncAwait($async$self._async_evaluate0$_withParent$2$4$scopeWhen$through(rule, new A._EvaluateVisitor_visitCssStyleRule_closure5($async$self, rule, node), false, new A._EvaluateVisitor_visitCssStyleRule_closure6(), type$.ModifiableCssStyleRule_2, type$.Null), $async$visitCssStyleRule$1); + case 2: + // returning from await. + $async$self._async_evaluate0$_atRootExcludingStyleRule = oldAtRootExcludingStyleRule; + t1 = $async$self._async_evaluate0$_assertInModule$2($async$self._async_evaluate0$__parent, "__parent").children._collection$_source; + t2 = J.getInterceptor$asx(t1); + _0_1 = t2.get$length(t1); + if (_0_1 >= 1) { + lastChild = t2.elementAt$1(t1, _0_1 - 1); + t1 = t3; + } else { + lastChild = null; + t1 = false; + } + if (t1) + lastChild.isGroupEnd = true; + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$visitCssStyleRule$1, $async$completer); + }, + visitCssStylesheet$1(node) { + return this.visitCssStylesheet$body$_EvaluateVisitor0(node); + }, + visitCssStylesheet$body$_EvaluateVisitor0(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void), + $async$self = this, t1; + var $async$visitCssStylesheet$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = J.get$iterator$ax(node.get$children(node)); + case 2: + // for condition + if (!t1.moveNext$0()) { + // goto after for + $async$goto = 3; + break; + } + $async$goto = 4; + return A._asyncAwait(t1.get$current(t1).accept$1($async$self), $async$visitCssStylesheet$1); + case 4: + // returning from await. + // goto for condition + $async$goto = 2; + break; + case 3: + // after for + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$visitCssStylesheet$1, $async$completer); + }, + visitCssSupportsRule$1(node) { + return this.visitCssSupportsRule$body$_EvaluateVisitor0(node); + }, + visitCssSupportsRule$body$_EvaluateVisitor0(node) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void), + $async$self = this; + var $async$visitCssSupportsRule$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + if ($async$self._async_evaluate0$_declarationName != null) + throw A.wrapException($async$self._async_evaluate0$_exception$2(string$.Suppor, node.span)); + $async$goto = 2; + return A._asyncAwait($async$self._async_evaluate0$_withParent$2$4$scopeWhen$through(A.ModifiableCssSupportsRule$0(node.condition, node.span), new A._EvaluateVisitor_visitCssSupportsRule_closure5($async$self, node), false, new A._EvaluateVisitor_visitCssSupportsRule_closure6(), type$.ModifiableCssSupportsRule_2, type$.Null), $async$visitCssSupportsRule$1); + case 2: + // returning from await. + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$visitCssSupportsRule$1, $async$completer); + }, + _async_evaluate0$_handleReturn$1$2(list, callback) { + return this._handleReturn$body$_EvaluateVisitor0(list, callback); + }, + _async_evaluate0$_handleReturn$2(list, callback) { + return this._async_evaluate0$_handleReturn$1$2(list, callback, type$.dynamic); + }, + _handleReturn$body$_EvaluateVisitor0(list, callback) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.nullable_Value_2), + $async$returnValue, t1, _i, _0_0; + var $async$_async_evaluate0$_handleReturn$1$2 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = list.length, _i = 0; + case 3: + // for condition + if (!(_i < list.length)) { + // goto after for + $async$goto = 5; + break; + } + $async$goto = 6; + return A._asyncAwait(callback.call$1(list[_i]), $async$_async_evaluate0$_handleReturn$1$2); + case 6: + // returning from await. + _0_0 = $async$result; + if (_0_0 != null) { + $async$returnValue = _0_0; + // goto return + $async$goto = 1; + break; + } + case 4: + // for update + list.length === t1 || (0, A.throwConcurrentModificationError)(list), ++_i; + // goto for condition + $async$goto = 3; + break; + case 5: + // after for + $async$returnValue = null; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$_async_evaluate0$_handleReturn$1$2, $async$completer); + }, + _async_evaluate0$_withEnvironment$1$2(environment, callback, $T) { + return this._withEnvironment$body$_EvaluateVisitor0(environment, callback, $T, $T); + }, + _withEnvironment$body$_EvaluateVisitor0(environment, callback, $T, $async$type) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter($async$type), + $async$returnValue, $async$self = this, result, oldEnvironment; + var $async$_async_evaluate0$_withEnvironment$1$2 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + oldEnvironment = $async$self._async_evaluate0$_environment; + $async$self._async_evaluate0$_environment = environment; + $async$goto = 3; + return A._asyncAwait(callback.call$0(), $async$_async_evaluate0$_withEnvironment$1$2); + case 3: + // returning from await. + result = $async$result; + $async$self._async_evaluate0$_environment = oldEnvironment; + $async$returnValue = result; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$_async_evaluate0$_withEnvironment$1$2, $async$completer); + }, + _async_evaluate0$_interpolationToValue$3$trim$warnForColor(interpolation, trim, warnForColor) { + return this._interpolationToValue$body$_EvaluateVisitor0(interpolation, trim, warnForColor); + }, + _async_evaluate0$_interpolationToValue$1(interpolation) { + return this._async_evaluate0$_interpolationToValue$3$trim$warnForColor(interpolation, false, false); + }, + _async_evaluate0$_interpolationToValue$2$warnForColor(interpolation, warnForColor) { + return this._async_evaluate0$_interpolationToValue$3$trim$warnForColor(interpolation, false, warnForColor); + }, + _interpolationToValue$body$_EvaluateVisitor0(interpolation, trim, warnForColor) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.CssValue_String_2), + $async$returnValue, $async$self = this, result, t1; + var $async$_async_evaluate0$_interpolationToValue$3$trim$warnForColor = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$goto = 3; + return A._asyncAwait($async$self._async_evaluate0$_performInterpolation$2$warnForColor(interpolation, warnForColor), $async$_async_evaluate0$_interpolationToValue$3$trim$warnForColor); + case 3: + // returning from await. + result = $async$result; + t1 = trim ? A.trimAscii0(result, true) : result; + $async$returnValue = new A.CssValue0(t1, interpolation.span, type$.CssValue_String_2); + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$_async_evaluate0$_interpolationToValue$3$trim$warnForColor, $async$completer); + }, + _async_evaluate0$_performInterpolation$2$warnForColor(interpolation, warnForColor) { + return this._performInterpolation$body$_EvaluateVisitor0(interpolation, warnForColor); + }, + _async_evaluate0$_performInterpolation$1(interpolation) { + return this._async_evaluate0$_performInterpolation$2$warnForColor(interpolation, false); + }, + _performInterpolation$body$_EvaluateVisitor0(interpolation, warnForColor) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.String), + $async$returnValue, $async$self = this; + var $async$_async_evaluate0$_performInterpolation$2$warnForColor = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$goto = 3; + return A._asyncAwait($async$self._async_evaluate0$_performInterpolationHelper$3$sourceMap$warnForColor(interpolation, false, warnForColor), $async$_async_evaluate0$_performInterpolation$2$warnForColor); + case 3: + // returning from await. + $async$returnValue = $async$result._0; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$_async_evaluate0$_performInterpolation$2$warnForColor, $async$completer); + }, + _async_evaluate0$_performInterpolationWithMap$2$warnForColor(interpolation, warnForColor) { + return this._performInterpolationWithMap$body$_EvaluateVisitor0(interpolation, true); + }, + _performInterpolationWithMap$body$_EvaluateVisitor0(interpolation, warnForColor) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Record_2_String_and_InterpolationMap_2), + $async$returnValue, $async$self = this, _0_0, result, map; + var $async$_async_evaluate0$_performInterpolationWithMap$2$warnForColor = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$goto = 3; + return A._asyncAwait($async$self._async_evaluate0$_performInterpolationHelper$3$sourceMap$warnForColor(interpolation, true, true), $async$_async_evaluate0$_performInterpolationWithMap$2$warnForColor); + case 3: + // returning from await. + _0_0 = $async$result; + result = _0_0._0; + map = _0_0._1; + map.toString; + $async$returnValue = new A._Record_2(result, map); + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$_async_evaluate0$_performInterpolationWithMap$2$warnForColor, $async$completer); + }, + _async_evaluate0$_performInterpolationHelper$3$sourceMap$warnForColor(interpolation, sourceMap, warnForColor) { + return this._performInterpolationHelper$body$_EvaluateVisitor0(interpolation, sourceMap, warnForColor); + }, + _performInterpolationHelper$body$_EvaluateVisitor0(interpolation, sourceMap, warnForColor) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Record_2_String_and_nullable_InterpolationMap_2), + $async$returnValue, $async$self = this, t1, t2, t3, t4, t5, t6, t7, first, _i, t8, value, result, t9, result0, targetLocations, oldInSupportsDeclaration; + var $async$_async_evaluate0$_performInterpolationHelper$3$sourceMap$warnForColor = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + targetLocations = sourceMap ? A._setArrayType([], type$.JSArray_SourceLocation) : null; + oldInSupportsDeclaration = $async$self._async_evaluate0$_inSupportsDeclaration; + $async$self._async_evaluate0$_inSupportsDeclaration = false; + t1 = interpolation.contents, t2 = t1.length, t3 = type$.Expression_2, t4 = targetLocations == null, t5 = type$.JSArray_Object, t6 = interpolation.span, t7 = type$.Object, first = true, _i = 0, t8 = ""; + case 3: + // for condition + if (!(_i < t2)) { + // goto after for + $async$goto = 5; + break; + } + value = t1[_i]; + if (!first) + if (!t4) + targetLocations.push(A.SourceLocation$(t8.length, null, null, null)); + if (typeof value == "string") { + t8 += value; + // goto for update + $async$goto = 4; + break; + } + t3._as(value); + $async$goto = 6; + return A._asyncAwait(value.accept$1($async$self), $async$_async_evaluate0$_performInterpolationHelper$3$sourceMap$warnForColor); + case 6: + // returning from await. + result = $async$result; + if (warnForColor && $.$get$namesByColor0().containsKey$1(result)) { + t9 = A._setArrayType([""], t5); + result0 = A.List_List$from(t9, false, t7); + result0.fixed$length = Array; + result0.immutable$list = Array; + result0 = new A.Interpolation0(result0, t6); + result0.Interpolation$20(t9, t6); + t9 = $.$get$namesByColor0(); + $async$self._async_evaluate0$_warn$2(string$.You_pr + A.S(t9.$index(0, result)) + string$.x20in_in + result.toString$0(0) + string$.x2c_whicw + A.S(t9.$index(0, result)) + string$.x22x29__If + new A.BinaryOperationExpression0(B.BinaryOperator_anB0, new A.StringExpression0(result0, true), value, false).toString$0(0) + "'.", value.get$span(value)); + } + t8 += $async$self._async_evaluate0$_serialize$3$quote(result, value, false); + case 4: + // for update + ++_i, first = false; + // goto for condition + $async$goto = 3; + break; + case 5: + // after for + $async$self._async_evaluate0$_inSupportsDeclaration = oldInSupportsDeclaration; + $async$returnValue = new A._Record_2(t8.charCodeAt(0) == 0 ? t8 : t8, A.NullableExtension_andThen0(targetLocations, new A._EvaluateVisitor__performInterpolationHelper_closure2(interpolation))); + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$_async_evaluate0$_performInterpolationHelper$3$sourceMap$warnForColor, $async$completer); + }, + _async_evaluate0$_evaluateToCss$2$quote(expression, quote) { + return this._evaluateToCss$body$_EvaluateVisitor0(expression, quote); + }, + _async_evaluate0$_evaluateToCss$1(expression) { + return this._async_evaluate0$_evaluateToCss$2$quote(expression, true); + }, + _evaluateToCss$body$_EvaluateVisitor0(expression, quote) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.String), + $async$returnValue, $async$self = this, t1; + var $async$_async_evaluate0$_evaluateToCss$2$quote = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = expression.accept$1($async$self); + $async$goto = 3; + return A._asyncAwait(type$.Future_Value_2._is(t1) ? t1 : A._Future$value(t1, type$.Value_2), $async$_async_evaluate0$_evaluateToCss$2$quote); + case 3: + // returning from await. + $async$returnValue = $async$self._async_evaluate0$_serialize$3$quote($async$result, expression, quote); + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$_async_evaluate0$_evaluateToCss$2$quote, $async$completer); + }, + _async_evaluate0$_serialize$3$quote(value, nodeWithSpan, quote) { + return this._async_evaluate0$_addExceptionSpan$2(nodeWithSpan, new A._EvaluateVisitor__serialize_closure2(value, quote)); + }, + _async_evaluate0$_serialize$2(value, nodeWithSpan) { + return this._async_evaluate0$_serialize$3$quote(value, nodeWithSpan, true); + }, + _async_evaluate0$_expressionNode$1(expression) { + var t1; + if (expression instanceof A.VariableExpression0) { + t1 = this._async_evaluate0$_addExceptionSpan$2(expression, new A._EvaluateVisitor__expressionNode_closure2(this, expression)); + return t1 == null ? expression : t1; + } else + return expression; + }, + _async_evaluate0$_withParent$2$4$scopeWhen$through(node, callback, scopeWhen, through, $S, $T) { + return this._withParent$body$_EvaluateVisitor0(node, callback, scopeWhen, through, $S, $T, $T); + }, + _async_evaluate0$_withParent$2$2(node, callback, $S, $T) { + return this._async_evaluate0$_withParent$2$4$scopeWhen$through(node, callback, true, null, $S, $T); + }, + _async_evaluate0$_withParent$2$3$scopeWhen(node, callback, scopeWhen, $S, $T) { + return this._async_evaluate0$_withParent$2$4$scopeWhen$through(node, callback, scopeWhen, null, $S, $T); + }, + _withParent$body$_EvaluateVisitor0(node, callback, scopeWhen, through, $S, $T, $async$type) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter($async$type), + $async$returnValue, $async$self = this, t1, result; + var $async$_async_evaluate0$_withParent$2$4$scopeWhen$through = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$self._async_evaluate0$_addChild$2$through(node, through); + t1 = $async$self._async_evaluate0$_assertInModule$2($async$self._async_evaluate0$__parent, "__parent"); + $async$self._async_evaluate0$__parent = node; + $async$goto = 3; + return A._asyncAwait($async$self._async_evaluate0$_environment.scope$1$2$when(callback, scopeWhen, $T), $async$_async_evaluate0$_withParent$2$4$scopeWhen$through); + case 3: + // returning from await. + result = $async$result; + $async$self._async_evaluate0$__parent = t1; + $async$returnValue = result; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$_async_evaluate0$_withParent$2$4$scopeWhen$through, $async$completer); + }, + _async_evaluate0$_addChild$2$through(node, through) { + var _0_0, grandparent, t1, + $parent = this._async_evaluate0$_assertInModule$2(this._async_evaluate0$__parent, "__parent"); + if (through != null) { + for (; through.call$1($parent); $parent = _0_0) { + _0_0 = $parent._node$_parent; + if (_0_0 == null) + throw A.wrapException(A.ArgumentError$(string$.throug + node.toString$0(0) + ".", null)); + } + if ($parent.get$hasFollowingSibling()) { + grandparent = $parent._node$_parent; + t1 = grandparent.children; + if ($parent.equalsIgnoringChildren$1(t1.get$last(t1))) + $parent = type$.ModifiableCssParentNode_2._as(t1.get$last(t1)); + else { + $parent = $parent.copyWithoutChildren$0(); + grandparent.addChild$1($parent); + } + } + } + $parent.addChild$1(node); + }, + _async_evaluate0$_addChild$1(node) { + return this._async_evaluate0$_addChild$2$through(node, null); + }, + _async_evaluate0$_withStyleRule$1$2(rule, callback, $T) { + return this._withStyleRule$body$_EvaluateVisitor0(rule, callback, $T, $T); + }, + _withStyleRule$body$_EvaluateVisitor0(rule, callback, $T, $async$type) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter($async$type), + $async$returnValue, $async$self = this, result, oldRule; + var $async$_async_evaluate0$_withStyleRule$1$2 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + oldRule = $async$self._async_evaluate0$_styleRuleIgnoringAtRoot; + $async$self._async_evaluate0$_styleRuleIgnoringAtRoot = rule; + $async$goto = 3; + return A._asyncAwait(callback.call$0(), $async$_async_evaluate0$_withStyleRule$1$2); + case 3: + // returning from await. + result = $async$result; + $async$self._async_evaluate0$_styleRuleIgnoringAtRoot = oldRule; + $async$returnValue = result; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$_async_evaluate0$_withStyleRule$1$2, $async$completer); + }, + _async_evaluate0$_withMediaQueries$1$3(queries, sources, callback, $T) { + return this._withMediaQueries$body$_EvaluateVisitor0(queries, sources, callback, $T, $T); + }, + _withMediaQueries$body$_EvaluateVisitor0(queries, sources, callback, $T, $async$type) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter($async$type), + $async$returnValue, $async$self = this, result, oldMediaQueries, oldSources; + var $async$_async_evaluate0$_withMediaQueries$1$3 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + oldMediaQueries = $async$self._async_evaluate0$_mediaQueries; + oldSources = $async$self._async_evaluate0$_mediaQuerySources; + $async$self._async_evaluate0$_mediaQueries = queries; + $async$self._async_evaluate0$_mediaQuerySources = sources; + $async$goto = 3; + return A._asyncAwait(callback.call$0(), $async$_async_evaluate0$_withMediaQueries$1$3); + case 3: + // returning from await. + result = $async$result; + $async$self._async_evaluate0$_mediaQueries = oldMediaQueries; + $async$self._async_evaluate0$_mediaQuerySources = oldSources; + $async$returnValue = result; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$_async_evaluate0$_withMediaQueries$1$3, $async$completer); + }, + _async_evaluate0$_withStackFrame$1$3(member, nodeWithSpan, callback, $T) { + return this._withStackFrame$body$_EvaluateVisitor0(member, nodeWithSpan, callback, $T, $T); + }, + _withStackFrame$body$_EvaluateVisitor0(member, nodeWithSpan, callback, $T, $async$type) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter($async$type), + $async$returnValue, $async$self = this, oldMember, result, t1; + var $async$_async_evaluate0$_withStackFrame$1$3 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self._async_evaluate0$_stack; + t1.push(new A._Record_2($async$self._async_evaluate0$_member, nodeWithSpan)); + oldMember = $async$self._async_evaluate0$_member; + $async$self._async_evaluate0$_member = member; + $async$goto = 3; + return A._asyncAwait(callback.call$0(), $async$_async_evaluate0$_withStackFrame$1$3); + case 3: + // returning from await. + result = $async$result; + $async$self._async_evaluate0$_member = oldMember; + t1.pop(); + $async$returnValue = result; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$_async_evaluate0$_withStackFrame$1$3, $async$completer); + }, + _async_evaluate0$_withoutSlash$2(value, nodeForSpan) { + if (value instanceof A.SassNumber0 && value.asSlash != null && true) + this._async_evaluate0$_warn$3(string$.Using__i + A.S(new A._EvaluateVisitor__withoutSlash_recommendation2().call$1(value)) + string$.x0a_Morex20, nodeForSpan.get$span(nodeForSpan), B.Deprecation_wWh); + return value.withoutSlash$0(); + }, + _async_evaluate0$_stackFrame$2(member, span) { + return A.frameForSpan0(span, member, A.NullableExtension_andThen0(span.get$sourceUrl(span), new A._EvaluateVisitor__stackFrame_closure2(this))); + }, + _async_evaluate0$_stackTrace$1(span) { + var t2, t3, _i, t4, nodeWithSpan, _this = this, + t1 = A._setArrayType([], type$.JSArray_Frame); + for (t2 = _this._async_evaluate0$_stack, t3 = t2.length, _i = 0; _i < t2.length; t2.length === t3 || (0, A.throwConcurrentModificationError)(t2), ++_i) { + t4 = t2[_i]; + nodeWithSpan = t4._1; + t1.push(_this._async_evaluate0$_stackFrame$2(t4._0, nodeWithSpan.get$span(nodeWithSpan))); + } + if (span != null) + t1.push(_this._async_evaluate0$_stackFrame$2(_this._async_evaluate0$_member, span)); + return A.Trace$(new A.ReversedListIterable(t1, type$.ReversedListIterable_Frame), null); + }, + _async_evaluate0$_stackTrace$0() { + return this._async_evaluate0$_stackTrace$1(null); + }, + _async_evaluate0$_warn$3(message, span, deprecation) { + var t1, trace, _this = this; + if (_this._async_evaluate0$_quietDeps) + if (!_this._async_evaluate0$_inDependency) { + t1 = _this._async_evaluate0$_currentCallable; + t1 = t1 == null ? null : t1.inDependency; + t1 = t1 === true; + } else + t1 = true; + else + t1 = false; + if (t1) + return; + if (!_this._async_evaluate0$_warningsEmitted.add$1(0, new A._Record_2(message, span))) + return; + trace = _this._async_evaluate0$_stackTrace$1(span); + t1 = _this._async_evaluate0$_logger; + if (deprecation == null) + t1.warn$3$span$trace(0, message, span, trace); + else + A.WarnForDeprecation_warnForDeprecation0(t1, deprecation, message, span, trace); + }, + _async_evaluate0$_warn$2(message, span) { + return this._async_evaluate0$_warn$3(message, span, null); + }, + _async_evaluate0$_exception$2(message, span) { + var t1, t2; + if (span == null) { + t1 = B.JSArray_methods.get$last(this._async_evaluate0$_stack)._1; + t1 = t1.get$span(t1); + } else + t1 = span; + t2 = this._async_evaluate0$_stackTrace$1(span); + return new A.SassRuntimeException0(t2, B.Set_empty, message, t1); + }, + _async_evaluate0$_exception$1(message) { + return this._async_evaluate0$_exception$2(message, null); + }, + _async_evaluate0$_multiSpanException$3(message, primaryLabel, secondaryLabels) { + var t1 = B.JSArray_methods.get$last(this._async_evaluate0$_stack)._1; + return A.MultiSpanSassRuntimeException$0(message, t1.get$span(t1), primaryLabel, secondaryLabels, this._async_evaluate0$_stackTrace$0(), null); + }, + _async_evaluate0$_addExceptionSpan$1$2(nodeWithSpan, callback) { + var error, stackTrace, t1, exception, + addStackFrame = true; + try { + t1 = callback.call$0(); + return t1; + } catch (exception) { + t1 = A.unwrapException(exception); + if (t1 instanceof A.SassScriptException0) { + error = t1; + stackTrace = A.getTraceFromException(exception); + t1 = error.withSpan$1(nodeWithSpan.get$span(nodeWithSpan)); + A.throwWithTrace0(t1.withTrace$1(this._async_evaluate0$_stackTrace$1(addStackFrame ? nodeWithSpan.get$span(nodeWithSpan) : null)), error, stackTrace); + } else + throw exception; + } + }, + _async_evaluate0$_addExceptionSpan$2(nodeWithSpan, callback) { + return this._async_evaluate0$_addExceptionSpan$1$2(nodeWithSpan, callback, type$.dynamic); + }, + _async_evaluate0$_addExceptionSpanAsync$1$3$addStackFrame(nodeWithSpan, callback, addStackFrame, $T) { + return this._addExceptionSpanAsync$body$_EvaluateVisitor0(nodeWithSpan, callback, addStackFrame, $T, $T); + }, + _async_evaluate0$_addExceptionSpanAsync$1$2(nodeWithSpan, callback, $T) { + return this._async_evaluate0$_addExceptionSpanAsync$1$3$addStackFrame(nodeWithSpan, callback, true, $T); + }, + _addExceptionSpanAsync$body$_EvaluateVisitor0(nodeWithSpan, callback, addStackFrame, $T, $async$type) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter($async$type), + $async$returnValue, $async$handler = 2, $async$currentError, $async$self = this, error, stackTrace, t1, exception, $async$exception; + var $async$_async_evaluate0$_addExceptionSpanAsync$1$3$addStackFrame = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) { + $async$currentError = $async$result; + $async$goto = $async$handler; + } + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$handler = 4; + t1 = callback.call$0(); + $async$goto = 7; + return A._asyncAwait($T._eval$1("Future<0>")._is(t1) ? t1 : A._Future$value(t1, $T), $async$_async_evaluate0$_addExceptionSpanAsync$1$3$addStackFrame); + case 7: + // returning from await. + t1 = $async$result; + $async$returnValue = t1; + // goto return + $async$goto = 1; + break; + $async$handler = 2; + // goto after finally + $async$goto = 6; + break; + case 4: + // catch + $async$handler = 3; + $async$exception = $async$currentError; + t1 = A.unwrapException($async$exception); + if (t1 instanceof A.SassScriptException0) { + error = t1; + stackTrace = A.getTraceFromException($async$exception); + t1 = error.withSpan$1(nodeWithSpan.get$span(nodeWithSpan)); + A.throwWithTrace0(t1.withTrace$1($async$self._async_evaluate0$_stackTrace$1(addStackFrame ? nodeWithSpan.get$span(nodeWithSpan) : null)), error, stackTrace); + } else + throw $async$exception; + // goto after finally + $async$goto = 6; + break; + case 3: + // uncaught + // goto rethrow + $async$goto = 2; + break; + case 6: + // after finally + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + case 2: + // rethrow + return A._asyncRethrow($async$currentError, $async$completer); + } + }); + return A._asyncStartSync($async$_async_evaluate0$_addExceptionSpanAsync$1$3$addStackFrame, $async$completer); + }, + _async_evaluate0$_addExceptionTrace$1$1(callback, $T) { + return this._addExceptionTrace$body$_EvaluateVisitor0(callback, $T, $T); + }, + _addExceptionTrace$body$_EvaluateVisitor0(callback, $T, $async$type) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter($async$type), + $async$returnValue, $async$handler = 2, $async$currentError, $async$self = this, error, stackTrace, t1, exception, t2, $async$exception; + var $async$_async_evaluate0$_addExceptionTrace$1$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) { + $async$currentError = $async$result; + $async$goto = $async$handler; + } + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$handler = 4; + t1 = callback.call$0(); + $async$goto = 7; + return A._asyncAwait($T._eval$1("Future<0>")._is(t1) ? t1 : A._Future$value(t1, $T), $async$_async_evaluate0$_addExceptionTrace$1$1); + case 7: + // returning from await. + t1 = $async$result; + $async$returnValue = t1; + // goto return + $async$goto = 1; + break; + $async$handler = 2; + // goto after finally + $async$goto = 6; + break; + case 4: + // catch + $async$handler = 3; + $async$exception = $async$currentError; + t1 = A.unwrapException($async$exception); + if (type$.SassRuntimeException_2._is(t1)) + throw $async$exception; + else if (t1 instanceof A.SassException0) { + error = t1; + stackTrace = A.getTraceFromException($async$exception); + t1 = error; + t2 = J.getInterceptor$z(t1); + A.throwWithTrace0(error.withTrace$1($async$self._async_evaluate0$_stackTrace$1(A.SourceSpanException.prototype.get$span.call(t2, t1))), error, stackTrace); + } else + throw $async$exception; + // goto after finally + $async$goto = 6; + break; + case 3: + // uncaught + // goto rethrow + $async$goto = 2; + break; + case 6: + // after finally + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + case 2: + // rethrow + return A._asyncRethrow($async$currentError, $async$completer); + } + }); + return A._asyncStartSync($async$_async_evaluate0$_addExceptionTrace$1$1, $async$completer); + }, + _async_evaluate0$_addErrorSpan$1$2(nodeWithSpan, callback, $T) { + return this._addErrorSpan$body$_EvaluateVisitor0(nodeWithSpan, callback, $T, $T); + }, + _addErrorSpan$body$_EvaluateVisitor0(nodeWithSpan, callback, $T, $async$type) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter($async$type), + $async$returnValue, $async$handler = 2, $async$currentError, $async$self = this, error, stackTrace, t1, exception, t2, t3, $async$exception; + var $async$_async_evaluate0$_addErrorSpan$1$2 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) { + $async$currentError = $async$result; + $async$goto = $async$handler; + } + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$handler = 4; + $async$goto = 7; + return A._asyncAwait(callback.call$0(), $async$_async_evaluate0$_addErrorSpan$1$2); + case 7: + // returning from await. + t1 = $async$result; + $async$returnValue = t1; + // goto return + $async$goto = 1; + break; + $async$handler = 2; + // goto after finally + $async$goto = 6; + break; + case 4: + // catch + $async$handler = 3; + $async$exception = $async$currentError; + t1 = A.unwrapException($async$exception); + if (type$.SassRuntimeException_2._is(t1)) { + error = t1; + stackTrace = A.getTraceFromException($async$exception); + if (!B.JSString_methods.startsWith$1(J.get$span$z(error).get$text(), "@error")) + throw $async$exception; + t1 = error._span_exception$_message; + t2 = nodeWithSpan.get$span(nodeWithSpan); + t3 = $async$self._async_evaluate0$_stackTrace$0(); + A.throwWithTrace0(new A.SassRuntimeException0(t3, B.Set_empty, t1, t2), error, stackTrace); + } else + throw $async$exception; + // goto after finally + $async$goto = 6; + break; + case 3: + // uncaught + // goto rethrow + $async$goto = 2; + break; + case 6: + // after finally + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + case 2: + // rethrow + return A._asyncRethrow($async$currentError, $async$completer); + } + }); + return A._asyncStartSync($async$_async_evaluate0$_addErrorSpan$1$2, $async$completer); + } + }; + A._EvaluateVisitor_closure38.prototype = { + call$1($arguments) { + var module, t2, + t1 = J.getInterceptor$asx($arguments), + variable = t1.$index($arguments, 0).assertString$1("name"); + t1 = t1.$index($arguments, 1).get$realNull(); + module = t1 == null ? null : t1.assertString$1("module"); + t1 = this.$this._async_evaluate0$_environment; + t2 = A.stringReplaceAllUnchecked(variable._string0$_text, "_", "-"); + return t1.globalVariableExists$2$namespace(t2, module == null ? null : module._string0$_text) ? B.SassBoolean_true0 : B.SassBoolean_false0; + }, + $signature: 20 + }; + A._EvaluateVisitor_closure39.prototype = { + call$1($arguments) { + var variable = J.$index$asx($arguments, 0).assertString$1("name"), + t1 = this.$this._async_evaluate0$_environment; + return t1.getVariable$1(A.stringReplaceAllUnchecked(variable._string0$_text, "_", "-")) != null ? B.SassBoolean_true0 : B.SassBoolean_false0; + }, + $signature: 20 + }; + A._EvaluateVisitor_closure40.prototype = { + call$1($arguments) { + var module, t2, t3, t4, + t1 = J.getInterceptor$asx($arguments), + variable = t1.$index($arguments, 0).assertString$1("name"); + t1 = t1.$index($arguments, 1).get$realNull(); + module = t1 == null ? null : t1.assertString$1("module"); + t1 = this.$this; + t2 = t1._async_evaluate0$_environment; + t3 = variable._string0$_text; + t4 = A.stringReplaceAllUnchecked(t3, "_", "-"); + return t2.getFunction$2$namespace(t4, module == null ? null : module._string0$_text) != null || t1._async_evaluate0$_builtInFunctions.containsKey$1(t3) ? B.SassBoolean_true0 : B.SassBoolean_false0; + }, + $signature: 20 + }; + A._EvaluateVisitor_closure41.prototype = { + call$1($arguments) { + var module, t2, + t1 = J.getInterceptor$asx($arguments), + variable = t1.$index($arguments, 0).assertString$1("name"); + t1 = t1.$index($arguments, 1).get$realNull(); + module = t1 == null ? null : t1.assertString$1("module"); + t1 = this.$this._async_evaluate0$_environment; + t2 = A.stringReplaceAllUnchecked(variable._string0$_text, "_", "-"); + return t1.getMixin$2$namespace(t2, module == null ? null : module._string0$_text) != null ? B.SassBoolean_true0 : B.SassBoolean_false0; + }, + $signature: 20 + }; + A._EvaluateVisitor_closure42.prototype = { + call$1($arguments) { + var t1 = this.$this._async_evaluate0$_environment; + if (!t1._async_environment0$_inMixin) + throw A.wrapException(A.SassScriptException$0(string$.conten, null)); + return t1._async_environment0$_content != null ? B.SassBoolean_true0 : B.SassBoolean_false0; + }, + $signature: 20 + }; + A._EvaluateVisitor_closure43.prototype = { + call$1($arguments) { + var t2, t3, t4, + t1 = J.$index$asx($arguments, 0).assertString$1("module")._string0$_text, + module = this.$this._async_evaluate0$_environment._async_environment0$_modules.$index(0, t1); + if (module == null) + throw A.wrapException('There is no module with namespace "' + t1 + '".'); + t1 = type$.Value_2; + t2 = A.LinkedHashMap_LinkedHashMap$_empty(t1, t1); + for (t3 = A.MapExtensions_get_pairs0(module.get$variables(), type$.String, t1), t3 = t3.get$iterator(t3); t3.moveNext$0();) { + t4 = t3.get$current(t3); + t2.$indexSet(0, new A.SassString0(t4._0, true), t4._1); + } + return new A.SassMap0(A.ConstantMap_ConstantMap$from(t2, t1, t1)); + }, + $signature: 31 + }; + A._EvaluateVisitor_closure44.prototype = { + call$1($arguments) { + var t2, t3, t4, + t1 = J.$index$asx($arguments, 0).assertString$1("module")._string0$_text, + module = this.$this._async_evaluate0$_environment._async_environment0$_modules.$index(0, t1); + if (module == null) + throw A.wrapException('There is no module with namespace "' + t1 + '".'); + t1 = type$.Value_2; + t2 = A.LinkedHashMap_LinkedHashMap$_empty(t1, t1); + for (t3 = A.MapExtensions_get_pairs0(module.get$functions(module), type$.String, type$.AsyncCallable_2), t3 = t3.get$iterator(t3); t3.moveNext$0();) { + t4 = t3.get$current(t3); + t2.$indexSet(0, new A.SassString0(t4._0, true), new A.SassFunction0(t4._1)); + } + return new A.SassMap0(A.ConstantMap_ConstantMap$from(t2, t1, t1)); + }, + $signature: 31 + }; + A._EvaluateVisitor_closure45.prototype = { + call$1($arguments) { + var t2, t3, t4, + t1 = J.$index$asx($arguments, 0).assertString$1("module")._string0$_text, + module = this.$this._async_evaluate0$_environment._async_environment0$_modules.$index(0, t1); + if (module == null) + throw A.wrapException('There is no module with namespace "' + t1 + '".'); + t1 = type$.Value_2; + t2 = A.LinkedHashMap_LinkedHashMap$_empty(t1, t1); + for (t3 = A.MapExtensions_get_pairs0(module.get$mixins(), type$.String, type$.AsyncCallable_2), t3 = t3.get$iterator(t3); t3.moveNext$0();) { + t4 = t3.get$current(t3); + t2.$indexSet(0, new A.SassString0(t4._0, true), new A.SassMixin0(t4._1)); + } + return new A.SassMap0(A.ConstantMap_ConstantMap$from(t2, t1, t1)); + }, + $signature: 31 + }; + A._EvaluateVisitor_closure46.prototype = { + call$1($arguments) { + var module, t2, callable, + t1 = J.getInterceptor$asx($arguments), + $name = t1.$index($arguments, 0).assertString$1("name"), + css = t1.$index($arguments, 1).get$isTruthy(); + t1 = t1.$index($arguments, 2).get$realNull(); + module = t1 == null ? null : t1.assertString$1("module"); + if (css) { + if (module != null) + throw A.wrapException(string$.x24css_a); + return new A.SassFunction0(new A.PlainCssCallable0($name._string0$_text)); + } + t1 = this.$this; + t2 = t1._async_evaluate0$_callableNode; + t2.toString; + callable = t1._async_evaluate0$_addExceptionSpan$2(t2, new A._EvaluateVisitor__closure14(t1, $name, module)); + if (callable == null) + throw A.wrapException("Function not found: " + $name.toString$0(0)); + return new A.SassFunction0(callable); + }, + $signature: 269 + }; + A._EvaluateVisitor__closure14.prototype = { + call$0() { + var local, + normalizedName = A.stringReplaceAllUnchecked(this.name._string0$_text, "_", "-"), + t1 = this.module, + namespace = t1 == null ? null : t1._string0$_text; + t1 = this.$this; + local = t1._async_evaluate0$_environment.getFunction$2$namespace(normalizedName, namespace); + if (local != null || namespace != null) + return local; + return t1._async_evaluate0$_builtInFunctions.$index(0, normalizedName); + }, + $signature: 83 + }; + A._EvaluateVisitor_closure47.prototype = { + call$1($arguments) { + var module, t2, callable, + t1 = J.getInterceptor$asx($arguments), + $name = t1.$index($arguments, 0).assertString$1("name"); + t1 = t1.$index($arguments, 1).get$realNull(); + module = t1 == null ? null : t1.assertString$1("module"); + t1 = this.$this; + t2 = t1._async_evaluate0$_callableNode; + t2.toString; + callable = t1._async_evaluate0$_addExceptionSpan$2(t2, new A._EvaluateVisitor__closure13(t1, $name, module)); + if (callable == null) + throw A.wrapException("Mixin not found: " + $name.toString$0(0)); + return new A.SassMixin0(callable); + }, + $signature: 209 + }; + A._EvaluateVisitor__closure13.prototype = { + call$0() { + var t1 = this.$this._async_evaluate0$_environment, + t2 = A.stringReplaceAllUnchecked(this.name._string0$_text, "_", "-"), + t3 = this.module; + return t1.getMixin$2$namespace(t2, t3 == null ? null : t3._string0$_text); + }, + $signature: 83 + }; + A._EvaluateVisitor_closure48.prototype = { + call$1($arguments) { + return this.$call$body$_EvaluateVisitor_closure4($arguments); + }, + $call$body$_EvaluateVisitor_closure4($arguments) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Value_2), + $async$returnValue, $async$self = this, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, invocation, callableNode, t1, $function, args; + var $async$call$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = J.getInterceptor$asx($arguments); + $function = t1.$index($arguments, 0); + args = type$.SassArgumentList_2._as(t1.$index($arguments, 1)); + t1 = $async$self.$this; + t2 = t1._async_evaluate0$_callableNode; + t2.toString; + t3 = A._setArrayType([], type$.JSArray_Expression_2); + t4 = type$.String; + t5 = type$.Expression_2; + t6 = t2.get$span(t2); + t7 = t2.get$span(t2); + args._argument_list$_wereKeywordsAccessed = true; + t8 = args._argument_list$_keywords; + if (t8.get$isEmpty(t8)) + t2 = null; + else { + t9 = type$.Value_2; + t10 = A.LinkedHashMap_LinkedHashMap$_empty(t9, t9); + for (args._argument_list$_wereKeywordsAccessed = true, t8 = A.MapExtensions_get_pairs0(t8, t4, t9), t8 = t8.get$iterator(t8); t8.moveNext$0();) { + t11 = t8.get$current(t8); + t10.$indexSet(0, new A.SassString0(t11._0, false), t11._1); + } + t2 = new A.ValueExpression0(new A.SassMap0(A.ConstantMap_ConstantMap$from(t10, t9, t9)), t2.get$span(t2)); + } + invocation = new A.ArgumentInvocation0(A.List_List$unmodifiable(t3, t5), A.ConstantMap_ConstantMap$from(A.LinkedHashMap_LinkedHashMap$_empty(t4, t5), t4, t5), new A.ValueExpression0(args, t7), t2, t6); + $async$goto = $function instanceof A.SassString0 ? 3 : 4; + break; + case 3: + // then + t2 = $function.toString$0(0); + A.EvaluationContext_current0().warn$2(0, string$.Passina + t2 + "))", B.Deprecation_4iQ); + callableNode = t1._async_evaluate0$_callableNode; + t1 = t1.visitFunctionExpression$1(new A.FunctionExpression0(null, $function._string0$_text, invocation, callableNode.get$span(callableNode))); + $async$goto = 5; + return A._asyncAwait(type$.Future_Value_2._is(t1) ? t1 : A._Future$value(t1, type$.Value_2), $async$call$1); + case 5: + // returning from await. + $async$returnValue = $async$result; + // goto return + $async$goto = 1; + break; + case 4: + // join + t2 = $function.assertFunction$1("function"); + t3 = t1._async_evaluate0$_callableNode; + t3.toString; + $async$goto = 6; + return A._asyncAwait(t1._async_evaluate0$_runFunctionCallable$3(invocation, t2.callable, t3), $async$call$1); + case 6: + // returning from await. + t3 = $async$result; + $async$returnValue = t3; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$call$1, $async$completer); + }, + $signature: 98 + }; + A._EvaluateVisitor_closure49.prototype = { + call$1($arguments) { + return this.$call$body$_EvaluateVisitor_closure3($arguments); + }, + $call$body$_EvaluateVisitor_closure3($arguments) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void), + $async$self = this, withMap, t2, values, configuration, t3, t1, url; + var $async$call$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = J.getInterceptor$asx($arguments); + url = A.Uri_parse(t1.$index($arguments, 0).assertString$1("url")._string0$_text); + t1 = t1.$index($arguments, 1).get$realNull(); + withMap = t1 == null ? null : t1.assertMap$1("with")._map0$_contents; + t1 = $async$self.$this; + t2 = t1._async_evaluate0$_callableNode; + t2.toString; + if (withMap != null) { + values = A.LinkedHashMap_LinkedHashMap$_empty(type$.String, type$.ConfiguredValue_2); + withMap.forEach$1(0, new A._EvaluateVisitor__closure11(values, t2.get$span(t2), t2)); + configuration = new A.ExplicitConfiguration0(t2, values, null); + } else + configuration = B.Configuration_Map_empty_null0; + t3 = t2.get$span(t2); + $async$goto = 2; + return A._asyncAwait(t1._async_evaluate0$_loadModule$7$baseUrl$configuration$namesInErrors(url, "load-css()", t2, new A._EvaluateVisitor__closure12(t1), t3.get$sourceUrl(t3), configuration, true), $async$call$1); + case 2: + // returning from await. + t1._async_evaluate0$_assertConfigurationIsEmpty$2$nameInError(configuration, true); + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$call$1, $async$completer); + }, + $signature: 206 + }; + A._EvaluateVisitor__closure11.prototype = { + call$2(variable, value) { + var t1 = variable.assertString$1("with key"), + $name = A.stringReplaceAllUnchecked(t1._string0$_text, "_", "-"); + t1 = this.values; + if (t1.containsKey$1($name)) + throw A.wrapException("The variable $" + $name + " was configured twice."); + t1.$indexSet(0, $name, new A.ConfiguredValue0(value, this.span, this.callableNode)); + }, + $signature: 80 + }; + A._EvaluateVisitor__closure12.prototype = { + call$2(module, _) { + var t1 = this.$this; + return t1._async_evaluate0$_combineCss$2$clone(module, true).accept$1(t1); + }, + $signature: 320 + }; + A._EvaluateVisitor_closure50.prototype = { + call$1($arguments) { + return this.$call$body$_EvaluateVisitor_closure2($arguments); + }, + $call$body$_EvaluateVisitor_closure2($arguments) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void), + $async$self = this, callableNode, t2, t3, t4, t5, t1, mixin, args; + var $async$call$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = J.getInterceptor$asx($arguments); + mixin = t1.$index($arguments, 0); + args = type$.SassArgumentList_2._as(t1.$index($arguments, 1)); + t1 = $async$self.$this; + callableNode = t1._async_evaluate0$_callableNode; + t2 = callableNode.get$span(callableNode); + t3 = callableNode.get$span(callableNode); + t4 = type$.Expression_2; + t5 = A.List_List$unmodifiable(B.List_empty20, t4); + t4 = A.ConstantMap_ConstantMap$from(B.Map_empty14, type$.String, t4); + $async$goto = 2; + return A._asyncAwait(t1._async_evaluate0$_applyMixin$5(mixin.assertMixin$1("mixin").callable, t1._async_evaluate0$_environment._async_environment0$_content, new A.ArgumentInvocation0(t5, t4, new A.ValueExpression0(args, t3), null, t2), callableNode, callableNode), $async$call$1); + case 2: + // returning from await. + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$call$1, $async$completer); + }, + $signature: 206 + }; + A._EvaluateVisitor_run_closure2.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Record_2_Set_Uri_loadedUrls_and_CssStylesheet_stylesheet_2), + $async$returnValue, $async$self = this, module, t2, url, t1, _0_0; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + url = null; + t1 = $async$self.node; + _0_0 = t1.span.file.url; + if (_0_0 != null) { + url = _0_0; + t2 = $async$self.$this; + t2._async_evaluate0$_activeModules.$indexSet(0, url, null); + if (!(t2._async_evaluate0$_nodeImporter != null && J.toString$0$(url) === "stdin")) + t2._async_evaluate0$_loadedUrls.add$1(0, url); + } + t2 = $async$self.$this; + $async$goto = 3; + return A._asyncAwait(t2._async_evaluate0$_addExceptionTrace$1$1(new A._EvaluateVisitor_run__closure2(t2, $async$self.importer, t1), type$.Module_AsyncCallable_2), $async$call$0); + case 3: + // returning from await. + module = $async$result; + $async$returnValue = new A._Record_2_loadedUrls_stylesheet(t2._async_evaluate0$_loadedUrls, t2._async_evaluate0$_combineCss$1(module)); + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 321 + }; + A._EvaluateVisitor_run__closure2.prototype = { + call$0() { + return this.$this._async_evaluate0$_execute$2(this.importer, this.node); + }, + $signature: 322 + }; + A._EvaluateVisitor__loadModule_closure5.prototype = { + call$0() { + return this.callback.call$2(this._box_1.builtInModule, false); + }, + $signature: 0 + }; + A._EvaluateVisitor__loadModule_closure6.prototype = { + call$0() { + return this.$call$body$_EvaluateVisitor__loadModule_closure0(); + }, + $call$body$_EvaluateVisitor__loadModule_closure0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Null), + $async$handler = 1, $async$currentError, $async$next = [], $async$self = this, canonicalUrl, oldInDependency, isDependency, t4, message, t1, stylesheet, importer, t2, t3, _1_0, $async$temp1; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) { + $async$currentError = $async$result; + $async$goto = $async$handler; + } + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = {}; + stylesheet = null; + importer = null; + t2 = $async$self.$this; + t3 = $async$self.nodeWithSpan; + $async$goto = 2; + return A._asyncAwait(t2._async_evaluate0$_loadStylesheet$3$baseUrl($async$self.url.toString$0(0), t3.get$span(t3), $async$self.baseUrl), $async$call$0); + case 2: + // returning from await. + _1_0 = $async$result; + stylesheet = _1_0._0; + importer = _1_0._1; + isDependency = _1_0._2; + canonicalUrl = stylesheet.span.file.url; + if (canonicalUrl != null) { + t4 = t2._async_evaluate0$_activeModules; + if (t4.containsKey$1(canonicalUrl)) { + if ($async$self.namesInErrors) { + t1 = canonicalUrl; + t3 = $.$get$context(); + t1.toString; + message = "Module loop: " + t3.prettyUri$1(t1) + " is already being loaded."; + } else + message = string$.Modulel; + t1 = A.NullableExtension_andThen0(t4.$index(0, canonicalUrl), new A._EvaluateVisitor__loadModule__closure5(t2, message)); + throw A.wrapException(t1 == null ? t2._async_evaluate0$_exception$1(message) : t1); + } else + t4.$indexSet(0, canonicalUrl, t3); + } + t4 = t2._async_evaluate0$_modules.containsKey$1(canonicalUrl); + oldInDependency = t2._async_evaluate0$_inDependency; + t2._async_evaluate0$_inDependency = isDependency; + t1.module = null; + $async$handler = 3; + $async$temp1 = t1; + $async$goto = 6; + return A._asyncAwait(t2._async_evaluate0$_execute$5$configuration$namesInErrors$nodeWithSpan(importer, stylesheet, $async$self.configuration, $async$self.namesInErrors, t3), $async$call$0); + case 6: + // returning from await. + $async$temp1.module = $async$result; + $async$next.push(5); + // goto finally + $async$goto = 4; + break; + case 3: + // uncaught + $async$next = [1]; + case 4: + // finally + $async$handler = 1; + t2._async_evaluate0$_activeModules.remove$1(0, canonicalUrl); + t2._async_evaluate0$_inDependency = oldInDependency; + // goto the next finally handler + $async$goto = $async$next.pop(); + break; + case 5: + // after finally + $async$goto = 7; + return A._asyncAwait(t2._async_evaluate0$_addExceptionSpanAsync$1$3$addStackFrame(t3, new A._EvaluateVisitor__loadModule__closure6(t1, $async$self.callback, !t4), false, type$.void), $async$call$0); + case 7: + // returning from await. + // implicit return + return A._asyncReturn(null, $async$completer); + case 1: + // rethrow + return A._asyncRethrow($async$currentError, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 2 + }; + A._EvaluateVisitor__loadModule__closure5.prototype = { + call$1(previousLoad) { + return this.$this._async_evaluate0$_multiSpanException$3(this.message, "new load", A.LinkedHashMap_LinkedHashMap$_literal([previousLoad.get$span(previousLoad), "original load"], type$.FileSpan, type$.String)); + }, + $signature: 79 + }; + A._EvaluateVisitor__loadModule__closure6.prototype = { + call$0() { + return this.callback.call$2(this._box_0.module, this.firstLoad); + }, + $signature: 0 + }; + A._EvaluateVisitor__execute_closure2.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Null), + $async$self = this, t3, t4, t5, t6, t1, oldImporter, oldStylesheet, oldRoot, oldPreModuleComments, oldParent, oldEndOfImports, oldOutOfOrderImports, oldExtensionStore, t2, oldStyleRule, oldMediaQueries, oldDeclarationName, oldInUnknownAtRule, oldInKeyframes, oldConfiguration; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.$this; + oldImporter = t1._async_evaluate0$_importer; + oldStylesheet = t1._async_evaluate0$__stylesheet; + oldRoot = t1._async_evaluate0$__root; + oldPreModuleComments = t1._async_evaluate0$_preModuleComments; + oldParent = t1._async_evaluate0$__parent; + oldEndOfImports = t1._async_evaluate0$__endOfImports; + oldOutOfOrderImports = t1._async_evaluate0$_outOfOrderImports; + oldExtensionStore = t1._async_evaluate0$__extensionStore; + t2 = t1._async_evaluate0$_atRootExcludingStyleRule; + oldStyleRule = t2 ? null : t1._async_evaluate0$_styleRuleIgnoringAtRoot; + oldMediaQueries = t1._async_evaluate0$_mediaQueries; + oldDeclarationName = t1._async_evaluate0$_declarationName; + oldInUnknownAtRule = t1._async_evaluate0$_inUnknownAtRule; + oldInKeyframes = t1._async_evaluate0$_inKeyframes; + oldConfiguration = t1._async_evaluate0$_configuration; + t1._async_evaluate0$_importer = $async$self.importer; + t3 = t1._async_evaluate0$__stylesheet = $async$self.stylesheet; + t4 = t3.span; + t5 = t1._async_evaluate0$__parent = t1._async_evaluate0$__root = A.ModifiableCssStylesheet$0(t4); + t1._async_evaluate0$__endOfImports = 0; + t1._async_evaluate0$_outOfOrderImports = null; + t1._async_evaluate0$__extensionStore = $async$self.extensionStore; + t1._async_evaluate0$_declarationName = t1._async_evaluate0$_mediaQueries = t1._async_evaluate0$_styleRuleIgnoringAtRoot = null; + t1._async_evaluate0$_inKeyframes = t1._async_evaluate0$_atRootExcludingStyleRule = t1._async_evaluate0$_inUnknownAtRule = false; + t6 = $async$self.configuration; + if (t6 != null) + t1._async_evaluate0$_configuration = t6; + $async$goto = 2; + return A._asyncAwait(t1.visitStylesheet$1(t3), $async$call$0); + case 2: + // returning from await. + t3 = t1._async_evaluate0$_outOfOrderImports == null ? t5 : new A.CssStylesheet0(new A.UnmodifiableListView(t1._async_evaluate0$_addOutOfOrderImports$0(), type$.UnmodifiableListView_CssNode_2), t4); + $async$self.css._value = t3; + $async$self.preModuleComments._value = t1._async_evaluate0$_preModuleComments; + t1._async_evaluate0$_importer = oldImporter; + t1._async_evaluate0$__stylesheet = oldStylesheet; + t1._async_evaluate0$__root = oldRoot; + t1._async_evaluate0$_preModuleComments = oldPreModuleComments; + t1._async_evaluate0$__parent = oldParent; + t1._async_evaluate0$__endOfImports = oldEndOfImports; + t1._async_evaluate0$_outOfOrderImports = oldOutOfOrderImports; + t1._async_evaluate0$__extensionStore = oldExtensionStore; + t1._async_evaluate0$_styleRuleIgnoringAtRoot = oldStyleRule; + t1._async_evaluate0$_mediaQueries = oldMediaQueries; + t1._async_evaluate0$_declarationName = oldDeclarationName; + t1._async_evaluate0$_inUnknownAtRule = oldInUnknownAtRule; + t1._async_evaluate0$_atRootExcludingStyleRule = t2; + t1._async_evaluate0$_inKeyframes = oldInKeyframes; + t1._async_evaluate0$_configuration = oldConfiguration; + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 2 + }; + A._EvaluateVisitor__combineCss_closure5.prototype = { + call$1(module) { + return module.get$transitivelyContainsCss(); + }, + $signature: 124 + }; + A._EvaluateVisitor__combineCss_closure6.prototype = { + call$1(target) { + return !this.selectors.contains$1(0, target); + }, + $signature: 14 + }; + A._EvaluateVisitor__combineCss_visitModule2.prototype = { + call$1(module) { + var t1, t2, t3, t4, _i, upstream, _1_0, statements, index, _this = this; + if (!_this.seen.add$1(0, module)) + return; + if (_this.clone) + module = module.cloneCss$0(); + for (t1 = module.get$upstream(), t2 = t1.length, t3 = _this.css, t4 = _this.imports, _i = 0; _i < t1.length; t1.length === t2 || (0, A.throwConcurrentModificationError)(t1), ++_i) { + upstream = t1[_i]; + if (upstream.get$transitivelyContainsCss()) { + _1_0 = module.get$preModuleComments().$index(0, upstream); + if (_1_0 != null) + B.JSArray_methods.addAll$1(t3.length === 0 ? t4 : t3, _1_0); + _this.call$1(upstream); + } + } + _this.sorted.addFirst$1(module); + t1 = module.get$css(module); + statements = t1.get$children(t1); + index = _this.$this._async_evaluate0$_indexAfterImports$1(statements); + t1 = J.getInterceptor$ax(statements); + B.JSArray_methods.addAll$1(t4, t1.getRange$2(statements, 0, index)); + B.JSArray_methods.addAll$1(t3, t1.getRange$2(statements, index, t1.get$length(statements))); + }, + $signature: 324 + }; + A._EvaluateVisitor__extendModules_closure5.prototype = { + call$1(target) { + return !this.originalSelectors.contains$1(0, target); + }, + $signature: 14 + }; + A._EvaluateVisitor__extendModules_closure6.prototype = { + call$0() { + return A._setArrayType([], type$.JSArray_ExtensionStore_2); + }, + $signature: 199 + }; + A._EvaluateVisitor_visitAtRootRule_closure5.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Null), + $async$self = this, t1, t2, t3, _i; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.node.children, t2 = t1.length, t3 = $async$self.$this, _i = 0; + case 2: + // for condition + if (!(_i < t2)) { + // goto after for + $async$goto = 4; + break; + } + $async$goto = 5; + return A._asyncAwait(t1[_i].accept$1(t3), $async$call$0); + case 5: + // returning from await. + case 3: + // for update + ++_i; + // goto for condition + $async$goto = 2; + break; + case 4: + // after for + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 2 + }; + A._EvaluateVisitor_visitAtRootRule_closure6.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void), + $async$self = this, t1, t2, t3, _i; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.node.children, t2 = t1.length, t3 = $async$self.$this, _i = 0; + case 2: + // for condition + if (!(_i < t2)) { + // goto after for + $async$goto = 4; + break; + } + $async$goto = 5; + return A._asyncAwait(t1[_i].accept$1(t3), $async$call$0); + case 5: + // returning from await. + case 3: + // for update + ++_i; + // goto for condition + $async$goto = 2; + break; + case 4: + // after for + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 24 + }; + A._EvaluateVisitor__scopeForAtRoot_closure17.prototype = { + call$1(callback) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Null), + $async$self = this, t1, t2; + var $async$call$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.$this; + t2 = t1._async_evaluate0$_assertInModule$2(t1._async_evaluate0$__parent, "__parent"); + t1._async_evaluate0$__parent = $async$self.newParent; + $async$goto = 2; + return A._asyncAwait(t1._async_evaluate0$_environment.scope$1$2$when(callback, $async$self.node.hasDeclarations, type$.void), $async$call$1); + case 2: + // returning from await. + t1._async_evaluate0$__parent = t2; + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$call$1, $async$completer); + }, + $signature: 38 + }; + A._EvaluateVisitor__scopeForAtRoot_closure18.prototype = { + call$1(callback) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Null), + $async$self = this, t1, oldAtRootExcludingStyleRule; + var $async$call$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.$this; + oldAtRootExcludingStyleRule = t1._async_evaluate0$_atRootExcludingStyleRule; + t1._async_evaluate0$_atRootExcludingStyleRule = true; + $async$goto = 2; + return A._asyncAwait($async$self.innerScope.call$1(callback), $async$call$1); + case 2: + // returning from await. + t1._async_evaluate0$_atRootExcludingStyleRule = oldAtRootExcludingStyleRule; + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$call$1, $async$completer); + }, + $signature: 38 + }; + A._EvaluateVisitor__scopeForAtRoot_closure19.prototype = { + call$1(callback) { + return this.$this._async_evaluate0$_withMediaQueries$1$3(null, null, new A._EvaluateVisitor__scopeForAtRoot__closure2(this.innerScope, callback), type$.Null); + }, + $signature: 38 + }; + A._EvaluateVisitor__scopeForAtRoot__closure2.prototype = { + call$0() { + return this.innerScope.call$1(this.callback); + }, + $signature: 2 + }; + A._EvaluateVisitor__scopeForAtRoot_closure20.prototype = { + call$1(callback) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Null), + $async$self = this, t1, wasInKeyframes; + var $async$call$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.$this; + wasInKeyframes = t1._async_evaluate0$_inKeyframes; + t1._async_evaluate0$_inKeyframes = false; + $async$goto = 2; + return A._asyncAwait($async$self.innerScope.call$1(callback), $async$call$1); + case 2: + // returning from await. + t1._async_evaluate0$_inKeyframes = wasInKeyframes; + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$call$1, $async$completer); + }, + $signature: 38 + }; + A._EvaluateVisitor__scopeForAtRoot_closure21.prototype = { + call$1($parent) { + return $parent instanceof A.ModifiableCssAtRule0; + }, + $signature: 198 + }; + A._EvaluateVisitor__scopeForAtRoot_closure22.prototype = { + call$1(callback) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Null), + $async$self = this, t1, wasInUnknownAtRule; + var $async$call$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.$this; + wasInUnknownAtRule = t1._async_evaluate0$_inUnknownAtRule; + t1._async_evaluate0$_inUnknownAtRule = false; + $async$goto = 2; + return A._asyncAwait($async$self.innerScope.call$1(callback), $async$call$1); + case 2: + // returning from await. + t1._async_evaluate0$_inUnknownAtRule = wasInUnknownAtRule; + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$call$1, $async$completer); + }, + $signature: 38 + }; + A._EvaluateVisitor_visitContentRule_closure2.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Null), + $async$returnValue, $async$self = this, t1, t2, t3, _i; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.content.declaration.children, t2 = t1.length, t3 = $async$self.$this, _i = 0; + case 3: + // for condition + if (!(_i < t2)) { + // goto after for + $async$goto = 5; + break; + } + $async$goto = 6; + return A._asyncAwait(t1[_i].accept$1(t3), $async$call$0); + case 6: + // returning from await. + case 4: + // for update + ++_i; + // goto for condition + $async$goto = 3; + break; + case 5: + // after for + $async$returnValue = null; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 2 + }; + A._EvaluateVisitor_visitDeclaration_closure2.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Null), + $async$self = this, t1, t2, t3, _i; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self._box_0.children, t2 = t1.length, t3 = $async$self.$this, _i = 0; + case 2: + // for condition + if (!(_i < t2)) { + // goto after for + $async$goto = 4; + break; + } + $async$goto = 5; + return A._asyncAwait(t1[_i].accept$1(t3), $async$call$0); + case 5: + // returning from await. + case 3: + // for update + ++_i; + // goto for condition + $async$goto = 2; + break; + case 4: + // after for + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 2 + }; + A._EvaluateVisitor_visitEachRule_closure8.prototype = { + call$1(value) { + var t1 = this.$this, + t2 = this.nodeWithSpan; + return t1._async_evaluate0$_environment.setLocalVariable$3(this._box_0.variable, t1._async_evaluate0$_withoutSlash$2(value, t2), t2); + }, + $signature: 65 + }; + A._EvaluateVisitor_visitEachRule_closure9.prototype = { + call$1(value) { + return this.$this._async_evaluate0$_setMultipleVariables$3(this._box_0.variables, value, this.nodeWithSpan); + }, + $signature: 65 + }; + A._EvaluateVisitor_visitEachRule_closure10.prototype = { + call$0() { + var _this = this, + t1 = _this.$this; + return t1._async_evaluate0$_handleReturn$2(_this.list.get$asList(), new A._EvaluateVisitor_visitEachRule__closure2(t1, _this.setVariables, _this.node)); + }, + $signature: 68 + }; + A._EvaluateVisitor_visitEachRule__closure2.prototype = { + call$1(element) { + var t1; + this.setVariables.call$1(element); + t1 = this.$this; + return t1._async_evaluate0$_handleReturn$2(this.node.children, new A._EvaluateVisitor_visitEachRule___closure2(t1)); + }, + $signature: 329 + }; + A._EvaluateVisitor_visitEachRule___closure2.prototype = { + call$1(child) { + return child.accept$1(this.$this); + }, + $signature: 78 + }; + A._EvaluateVisitor_visitAtRule_closure8.prototype = { + call$1(value) { + return this.$this._async_evaluate0$_interpolationToValue$3$trim$warnForColor(value, true, true); + }, + $signature: 331 + }; + A._EvaluateVisitor_visitAtRule_closure9.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Null), + $async$self = this, t2, t3, _i, t1, styleRule; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.$this; + styleRule = t1._async_evaluate0$_atRootExcludingStyleRule ? null : t1._async_evaluate0$_styleRuleIgnoringAtRoot; + $async$goto = styleRule == null || t1._async_evaluate0$_inKeyframes || J.$eq$($async$self.name.value, "font-face") ? 2 : 4; + break; + case 2: + // then + t2 = $async$self.children, t3 = t2.length, _i = 0; + case 5: + // for condition + if (!(_i < t3)) { + // goto after for + $async$goto = 7; + break; + } + $async$goto = 8; + return A._asyncAwait(t2[_i].accept$1(t1), $async$call$0); + case 8: + // returning from await. + case 6: + // for update + ++_i; + // goto for condition + $async$goto = 5; + break; + case 7: + // after for + // goto join + $async$goto = 3; + break; + case 4: + // else + $async$goto = 9; + return A._asyncAwait(t1._async_evaluate0$_withParent$2$3$scopeWhen(A.ModifiableCssStyleRule$0(styleRule._style_rule0$_selector, styleRule.span, styleRule.originalSelector), new A._EvaluateVisitor_visitAtRule__closure2(t1, $async$self.children), false, type$.ModifiableCssStyleRule_2, type$.Null), $async$call$0); + case 9: + // returning from await. + case 3: + // join + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 2 + }; + A._EvaluateVisitor_visitAtRule__closure2.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Null), + $async$self = this, t1, t2, t3, _i; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.children, t2 = t1.length, t3 = $async$self.$this, _i = 0; + case 2: + // for condition + if (!(_i < t2)) { + // goto after for + $async$goto = 4; + break; + } + $async$goto = 5; + return A._asyncAwait(t1[_i].accept$1(t3), $async$call$0); + case 5: + // returning from await. + case 3: + // for update + ++_i; + // goto for condition + $async$goto = 2; + break; + case 4: + // after for + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 2 + }; + A._EvaluateVisitor_visitAtRule_closure10.prototype = { + call$1(node) { + return node instanceof A.ModifiableCssStyleRule0; + }, + $signature: 8 + }; + A._EvaluateVisitor_visitForRule_closure14.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.SassNumber_2), + $async$returnValue, $async$self = this; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$goto = 3; + return A._asyncAwait($async$self.node.from.accept$1($async$self.$this), $async$call$0); + case 3: + // returning from await. + $async$returnValue = $async$result.assertNumber$0(); + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 192 + }; + A._EvaluateVisitor_visitForRule_closure15.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.SassNumber_2), + $async$returnValue, $async$self = this; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$goto = 3; + return A._asyncAwait($async$self.node.to.accept$1($async$self.$this), $async$call$0); + case 3: + // returning from await. + $async$returnValue = $async$result.assertNumber$0(); + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 192 + }; + A._EvaluateVisitor_visitForRule_closure16.prototype = { + call$0() { + return this.fromNumber.assertInt$0(); + }, + $signature: 10 + }; + A._EvaluateVisitor_visitForRule_closure17.prototype = { + call$0() { + var t1 = this.fromNumber; + return this.toNumber.coerce$2(t1.get$numeratorUnits(t1), t1.get$denominatorUnits(t1)).assertInt$0(); + }, + $signature: 10 + }; + A._EvaluateVisitor_visitForRule_closure18.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.nullable_Value_2), + $async$returnValue, $async$self = this, i, t3, t4, t5, t6, t7, t8, _0_0, t1, t2, nodeWithSpan; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.$this; + t2 = $async$self.node; + nodeWithSpan = t1._async_evaluate0$_expressionNode$1(t2.from); + i = $async$self.from, t3 = $async$self._box_0, t4 = $async$self.direction, t5 = t2.variable, t6 = $async$self.fromNumber, t2 = t2.children; + case 3: + // for condition + if (!(i !== t3.to)) { + // goto after for + $async$goto = 5; + break; + } + t7 = t1._async_evaluate0$_environment; + t8 = t6.get$numeratorUnits(t6); + t7.setLocalVariable$3(t5, A.SassNumber_SassNumber$withUnits0(i, t6.get$denominatorUnits(t6), t8), nodeWithSpan); + $async$goto = 6; + return A._asyncAwait(t1._async_evaluate0$_handleReturn$2(t2, new A._EvaluateVisitor_visitForRule__closure2(t1)), $async$call$0); + case 6: + // returning from await. + _0_0 = $async$result; + if (_0_0 != null) { + $async$returnValue = _0_0; + // goto return + $async$goto = 1; + break; + } + case 4: + // for update + i += t4; + // goto for condition + $async$goto = 3; + break; + case 5: + // after for + $async$returnValue = null; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 68 + }; + A._EvaluateVisitor_visitForRule__closure2.prototype = { + call$1(child) { + return child.accept$1(this.$this); + }, + $signature: 78 + }; + A._EvaluateVisitor_visitForwardRule_closure5.prototype = { + call$2(module, firstLoad) { + if (firstLoad) + this.$this._async_evaluate0$_registerCommentsForModule$1(module); + this.$this._async_evaluate0$_environment.forwardModule$2(module, this.node); + }, + $signature: 113 + }; + A._EvaluateVisitor_visitForwardRule_closure6.prototype = { + call$2(module, firstLoad) { + if (firstLoad) + this.$this._async_evaluate0$_registerCommentsForModule$1(module); + this.$this._async_evaluate0$_environment.forwardModule$2(module, this.node); + }, + $signature: 113 + }; + A._EvaluateVisitor__registerCommentsForModule_closure2.prototype = { + call$0() { + return A._setArrayType([], type$.JSArray_CssComment_2); + }, + $signature: 190 + }; + A._EvaluateVisitor_visitIfRule_closure2.prototype = { + call$1(clause) { + var t1 = this.$this; + return t1._async_evaluate0$_environment.scope$1$3$semiGlobal$when(new A._EvaluateVisitor_visitIfRule__closure2(t1, clause), true, clause.hasDeclarations, type$.nullable_Value_2); + }, + $signature: 336 + }; + A._EvaluateVisitor_visitIfRule__closure2.prototype = { + call$0() { + var t1 = this.$this; + return t1._async_evaluate0$_handleReturn$2(this.clause.children, new A._EvaluateVisitor_visitIfRule___closure2(t1)); + }, + $signature: 68 + }; + A._EvaluateVisitor_visitIfRule___closure2.prototype = { + call$1(child) { + return child.accept$1(this.$this); + }, + $signature: 78 + }; + A._EvaluateVisitor__visitDynamicImport_closure2.prototype = { + call$0() { + return this.$call$body$_EvaluateVisitor__visitDynamicImport_closure0(); + }, + $call$body$_EvaluateVisitor__visitDynamicImport_closure0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void), + $async$returnValue, $async$self = this, t1, t2, _0_0, stylesheet, importer, isDependency, url, t3, oldImporter, oldInDependency, loadsUserDefinedModules, children, t4, t5, t6, t7, t8, t9, t10, environment, module, visitor, _box_0; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + _box_0 = {}; + _box_0.isDependency = _box_0.importer = _box_0.stylesheet = null; + t1 = $async$self.$this; + t2 = $async$self.$import; + $async$goto = 3; + return A._asyncAwait(t1._async_evaluate0$_loadStylesheet$3$forImport(t2.urlString, t2.span, true), $async$call$0); + case 3: + // returning from await. + _0_0 = $async$result; + stylesheet = _box_0.stylesheet = _0_0._0; + importer = _0_0._1; + _box_0.importer = importer; + isDependency = _0_0._2; + _box_0.isDependency = isDependency; + url = stylesheet.span.file.url; + if (url != null) { + t3 = t1._async_evaluate0$_activeModules; + if (t3.containsKey$1(url)) { + t2 = A.NullableExtension_andThen0(t3.$index(0, url), new A._EvaluateVisitor__visitDynamicImport__closure11(t1)); + throw A.wrapException(t2 == null ? t1._async_evaluate0$_exception$1("This file is already being loaded.") : t2); + } + t3.$indexSet(0, url, t2); + } + t2 = stylesheet._stylesheet1$_uses; + t3 = type$.UnmodifiableListView_UseRule_2; + $async$goto = new A.UnmodifiableListView(t2, t3).get$length(0) === 0 && new A.UnmodifiableListView(stylesheet._stylesheet1$_forwards, type$.UnmodifiableListView_ForwardRule_2).get$length(0) === 0 ? 4 : 5; + break; + case 4: + // then + oldImporter = t1._async_evaluate0$_importer; + t2 = t1._async_evaluate0$_assertInModule$2(t1._async_evaluate0$__stylesheet, "_stylesheet"); + oldInDependency = t1._async_evaluate0$_inDependency; + t1._async_evaluate0$_importer = importer; + t1._async_evaluate0$__stylesheet = stylesheet; + t1._async_evaluate0$_inDependency = isDependency; + $async$goto = 6; + return A._asyncAwait(t1.visitStylesheet$1(stylesheet), $async$call$0); + case 6: + // returning from await. + t1._async_evaluate0$_importer = oldImporter; + t1._async_evaluate0$__stylesheet = t2; + t1._async_evaluate0$_inDependency = oldInDependency; + t1._async_evaluate0$_activeModules.remove$1(0, url); + // goto return + $async$goto = 1; + break; + case 5: + // join + t2 = new A.UnmodifiableListView(t2, t3); + if (!t2.any$1(t2, new A._EvaluateVisitor__visitDynamicImport__closure12())) { + t2 = new A.UnmodifiableListView(stylesheet._stylesheet1$_forwards, type$.UnmodifiableListView_ForwardRule_2); + loadsUserDefinedModules = t2.any$1(t2, new A._EvaluateVisitor__visitDynamicImport__closure13()); + } else + loadsUserDefinedModules = true; + children = A._Cell$(); + t2 = t1._async_evaluate0$_environment; + t3 = type$.String; + t4 = type$.Module_AsyncCallable_2; + t5 = type$.AstNode_2; + t6 = A._setArrayType([], type$.JSArray_Module_AsyncCallable_2); + t7 = t2._async_environment0$_variables; + t7 = A._setArrayType(t7.slice(0), A._arrayInstanceType(t7)); + t8 = t2._async_environment0$_variableNodes; + t8 = A._setArrayType(t8.slice(0), A._arrayInstanceType(t8)); + t9 = t2._async_environment0$_functions; + t9 = A._setArrayType(t9.slice(0), A._arrayInstanceType(t9)); + t10 = t2._async_environment0$_mixins; + t10 = A._setArrayType(t10.slice(0), A._arrayInstanceType(t10)); + environment = A.AsyncEnvironment$_0(A.LinkedHashMap_LinkedHashMap$_empty(t3, t4), A.LinkedHashMap_LinkedHashMap$_empty(t3, t5), A.LinkedHashMap_LinkedHashMap$_empty(t4, t5), t2._async_environment0$_importedModules, null, null, t6, t7, t8, t9, t10, t2._async_environment0$_content); + $async$goto = 7; + return A._asyncAwait(t1._async_evaluate0$_withEnvironment$1$2(environment, new A._EvaluateVisitor__visitDynamicImport__closure14(_box_0, t1, loadsUserDefinedModules, environment, children), type$.Null), $async$call$0); + case 7: + // returning from await. + module = environment.toDummyModule$0(); + t1._async_evaluate0$_environment.importForwards$1(module); + $async$goto = loadsUserDefinedModules ? 8 : 9; + break; + case 8: + // then + $async$goto = module.transitivelyContainsCss ? 10 : 11; + break; + case 10: + // then + $async$goto = 12; + return A._asyncAwait(t1._async_evaluate0$_combineCss$2$clone(module, module.transitivelyContainsExtensions).accept$1(t1), $async$call$0); + case 12: + // returning from await. + case 11: + // join + visitor = new A._ImportedCssVisitor2(t1); + for (t2 = J.get$iterator$ax(children._readLocal$0()); t2.moveNext$0();) + t2.get$current(t2).accept$1(visitor); + case 9: + // join + t1._async_evaluate0$_activeModules.remove$1(0, url); + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 24 + }; + A._EvaluateVisitor__visitDynamicImport__closure11.prototype = { + call$1(previousLoad) { + return this.$this._async_evaluate0$_multiSpanException$3("This file is already being loaded.", "new load", A.LinkedHashMap_LinkedHashMap$_literal([previousLoad.get$span(previousLoad), "original load"], type$.FileSpan, type$.String)); + }, + $signature: 79 + }; + A._EvaluateVisitor__visitDynamicImport__closure12.prototype = { + call$1(rule) { + return rule.url.get$scheme() !== "sass"; + }, + $signature: 189 + }; + A._EvaluateVisitor__visitDynamicImport__closure13.prototype = { + call$1(rule) { + return rule.url.get$scheme() !== "sass"; + }, + $signature: 187 + }; + A._EvaluateVisitor__visitDynamicImport__closure14.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Null), + $async$self = this, t7, t8, t1, oldImporter, t2, t3, t4, t5, oldOutOfOrderImports, oldConfiguration, oldInDependency, t6; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.$this; + oldImporter = t1._async_evaluate0$_importer; + t2 = t1._async_evaluate0$_assertInModule$2(t1._async_evaluate0$__stylesheet, "_stylesheet"); + t3 = t1._async_evaluate0$_assertInModule$2(t1._async_evaluate0$__root, "_root"); + t4 = t1._async_evaluate0$_assertInModule$2(t1._async_evaluate0$__parent, "__parent"); + t5 = t1._async_evaluate0$_assertInModule$2(t1._async_evaluate0$__endOfImports, "_endOfImports"); + oldOutOfOrderImports = t1._async_evaluate0$_outOfOrderImports; + oldConfiguration = t1._async_evaluate0$_configuration; + oldInDependency = t1._async_evaluate0$_inDependency; + t6 = $async$self._box_0; + t1._async_evaluate0$_importer = t6.importer; + t7 = t6.stylesheet; + t1._async_evaluate0$__stylesheet = t7; + t8 = $async$self.loadsUserDefinedModules; + if (t8) { + t7 = A.ModifiableCssStylesheet$0(t7.span); + t1._async_evaluate0$__root = t7; + t1._async_evaluate0$__parent = t1._async_evaluate0$_assertInModule$2(t7, "_root"); + t1._async_evaluate0$__endOfImports = 0; + t1._async_evaluate0$_outOfOrderImports = null; + } + t1._async_evaluate0$_inDependency = t6.isDependency; + t7 = new A.UnmodifiableListView(t6.stylesheet._stylesheet1$_forwards, type$.UnmodifiableListView_ForwardRule_2); + if (!t7.get$isEmpty(t7)) + t1._async_evaluate0$_configuration = $async$self.environment.toImplicitConfiguration$0(); + $async$goto = 2; + return A._asyncAwait(t1.visitStylesheet$1(t6.stylesheet), $async$call$0); + case 2: + // returning from await. + t6 = t8 ? t1._async_evaluate0$_addOutOfOrderImports$0() : A._setArrayType([], type$.JSArray_ModifiableCssNode_2); + $async$self.children._value = t6; + t1._async_evaluate0$_importer = oldImporter; + t1._async_evaluate0$__stylesheet = t2; + if (t8) { + t1._async_evaluate0$__root = t3; + t1._async_evaluate0$__parent = t4; + t1._async_evaluate0$__endOfImports = t5; + t1._async_evaluate0$_outOfOrderImports = oldOutOfOrderImports; + } + t1._async_evaluate0$_configuration = oldConfiguration; + t1._async_evaluate0$_inDependency = oldInDependency; + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 2 + }; + A._EvaluateVisitor__applyMixin_closure5.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void), + $async$self = this, t1; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.$this; + $async$goto = 2; + return A._asyncAwait(t1._async_evaluate0$_environment.asMixin$1(new A._EvaluateVisitor__applyMixin__closure6(t1, $async$self.$arguments, $async$self.mixin, $async$self.nodeWithSpanWithoutContent)), $async$call$0); + case 2: + // returning from await. + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 24 + }; + A._EvaluateVisitor__applyMixin__closure6.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void), + $async$self = this; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$goto = 2; + return A._asyncAwait($async$self.$this._async_evaluate0$_runBuiltInCallable$3($async$self.$arguments, $async$self.mixin, $async$self.nodeWithSpanWithoutContent), $async$call$0); + case 2: + // returning from await. + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 24 + }; + A._EvaluateVisitor__applyMixin_closure6.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Null), + $async$self = this, t1; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.$this; + $async$goto = 2; + return A._asyncAwait(t1._async_evaluate0$_environment.withContent$2($async$self.contentCallable, new A._EvaluateVisitor__applyMixin__closure5(t1, $async$self.mixin, $async$self.nodeWithSpanWithoutContent)), $async$call$0); + case 2: + // returning from await. + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 2 + }; + A._EvaluateVisitor__applyMixin__closure5.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void), + $async$self = this, t1; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.$this; + $async$goto = 2; + return A._asyncAwait(t1._async_evaluate0$_environment.asMixin$1(new A._EvaluateVisitor__applyMixin___closure2(t1, $async$self.mixin, $async$self.nodeWithSpanWithoutContent)), $async$call$0); + case 2: + // returning from await. + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 24 + }; + A._EvaluateVisitor__applyMixin___closure2.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.void), + $async$self = this, t1, t2, t3, t4, t5, _i; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.mixin.declaration.children, t2 = t1.length, t3 = $async$self.$this, t4 = $async$self.nodeWithSpanWithoutContent, t5 = type$.nullable_Value_2, _i = 0; + case 2: + // for condition + if (!(_i < t2)) { + // goto after for + $async$goto = 4; + break; + } + $async$goto = 5; + return A._asyncAwait(t3._async_evaluate0$_addErrorSpan$1$2(t4, new A._EvaluateVisitor__applyMixin____closure2(t3, t1[_i]), t5), $async$call$0); + case 5: + // returning from await. + case 3: + // for update + ++_i; + // goto for condition + $async$goto = 2; + break; + case 4: + // after for + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 24 + }; + A._EvaluateVisitor__applyMixin____closure2.prototype = { + call$0() { + return this.statement.accept$1(this.$this); + }, + $signature: 68 + }; + A._EvaluateVisitor_visitIncludeRule_closure8.prototype = { + call$0() { + var t1 = this.node; + return this.$this._async_evaluate0$_environment.getMixin$2$namespace(t1.name, t1.namespace); + }, + $signature: 83 + }; + A._EvaluateVisitor_visitIncludeRule_closure9.prototype = { + call$1($content) { + var t1 = this.$this; + return new A.UserDefinedCallable0($content, t1._async_evaluate0$_environment.closure$0(), t1._async_evaluate0$_inDependency, type$.UserDefinedCallable_AsyncEnvironment_2); + }, + $signature: 339 + }; + A._EvaluateVisitor_visitIncludeRule_closure10.prototype = { + call$0() { + return this.node.get$spanWithoutContent(); + }, + $signature: 25 + }; + A._EvaluateVisitor_visitMediaRule_closure8.prototype = { + call$1(mediaQueries) { + return this.$this._async_evaluate0$_mergeMediaQueries$2(mediaQueries, this.queries); + }, + $signature: 93 + }; + A._EvaluateVisitor_visitMediaRule_closure9.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Null), + $async$self = this, t1, t2; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.$this; + t2 = $async$self.mergedQueries; + if (t2 == null) + t2 = $async$self.queries; + $async$goto = 2; + return A._asyncAwait(t1._async_evaluate0$_withMediaQueries$1$3(t2, $async$self.mergedSources, new A._EvaluateVisitor_visitMediaRule__closure2(t1, $async$self.node), type$.Null), $async$call$0); + case 2: + // returning from await. + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 2 + }; + A._EvaluateVisitor_visitMediaRule__closure2.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Null), + $async$self = this, t2, t3, _i, t1, _0_0; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.$this; + _0_0 = t1._async_evaluate0$_atRootExcludingStyleRule ? null : t1._async_evaluate0$_styleRuleIgnoringAtRoot; + $async$goto = _0_0 != null ? 2 : 4; + break; + case 2: + // then + $async$goto = 5; + return A._asyncAwait(t1._async_evaluate0$_withParent$2$3$scopeWhen(A.ModifiableCssStyleRule$0(_0_0._style_rule0$_selector, _0_0.span, _0_0.originalSelector), new A._EvaluateVisitor_visitMediaRule___closure2(t1, $async$self.node), false, type$.ModifiableCssStyleRule_2, type$.Null), $async$call$0); + case 5: + // returning from await. + // goto join + $async$goto = 3; + break; + case 4: + // else + t2 = $async$self.node.children, t3 = t2.length, _i = 0; + case 6: + // for condition + if (!(_i < t3)) { + // goto after for + $async$goto = 8; + break; + } + $async$goto = 9; + return A._asyncAwait(t2[_i].accept$1(t1), $async$call$0); + case 9: + // returning from await. + case 7: + // for update + ++_i; + // goto for condition + $async$goto = 6; + break; + case 8: + // after for + case 3: + // join + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 2 + }; + A._EvaluateVisitor_visitMediaRule___closure2.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Null), + $async$self = this, t1, t2, t3, _i; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.node.children, t2 = t1.length, t3 = $async$self.$this, _i = 0; + case 2: + // for condition + if (!(_i < t2)) { + // goto after for + $async$goto = 4; + break; + } + $async$goto = 5; + return A._asyncAwait(t1[_i].accept$1(t3), $async$call$0); + case 5: + // returning from await. + case 3: + // for update + ++_i; + // goto for condition + $async$goto = 2; + break; + case 4: + // after for + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 2 + }; + A._EvaluateVisitor_visitMediaRule_closure10.prototype = { + call$1(node) { + var t1; + if (!(node instanceof A.ModifiableCssStyleRule0)) { + t1 = this.mergedSources; + t1 = t1.get$isNotEmpty(t1) && node instanceof A.ModifiableCssMediaRule0 && B.JSArray_methods.every$1(node.queries, t1.get$contains(t1)); + } else + t1 = true; + return t1; + }, + $signature: 8 + }; + A._EvaluateVisitor_visitStyleRule_closure14.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Null), + $async$self = this, t1, t2, t3, _i; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.node.children, t2 = t1.length, t3 = $async$self.$this, _i = 0; + case 2: + // for condition + if (!(_i < t2)) { + // goto after for + $async$goto = 4; + break; + } + $async$goto = 5; + return A._asyncAwait(t1[_i].accept$1(t3), $async$call$0); + case 5: + // returning from await. + case 3: + // for update + ++_i; + // goto for condition + $async$goto = 2; + break; + case 4: + // after for + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 2 + }; + A._EvaluateVisitor_visitStyleRule_closure15.prototype = { + call$1(node) { + return node instanceof A.ModifiableCssStyleRule0; + }, + $signature: 8 + }; + A._EvaluateVisitor_visitStyleRule_closure16.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Null), + $async$self = this, t1; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.$this; + $async$goto = 2; + return A._asyncAwait(t1._async_evaluate0$_withStyleRule$1$2($async$self.rule, new A._EvaluateVisitor_visitStyleRule__closure2(t1, $async$self.node), type$.Null), $async$call$0); + case 2: + // returning from await. + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 2 + }; + A._EvaluateVisitor_visitStyleRule__closure2.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Null), + $async$self = this, t1, t2, t3, _i; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.node.children, t2 = t1.length, t3 = $async$self.$this, _i = 0; + case 2: + // for condition + if (!(_i < t2)) { + // goto after for + $async$goto = 4; + break; + } + $async$goto = 5; + return A._asyncAwait(t1[_i].accept$1(t3), $async$call$0); + case 5: + // returning from await. + case 3: + // for update + ++_i; + // goto for condition + $async$goto = 2; + break; + case 4: + // after for + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 2 + }; + A._EvaluateVisitor_visitStyleRule_closure17.prototype = { + call$1(node) { + return node instanceof A.ModifiableCssStyleRule0; + }, + $signature: 8 + }; + A._EvaluateVisitor_visitStyleRule_closure18.prototype = { + call$1(child) { + return child instanceof A.ModifiableCssComment0; + }, + $signature: 130 + }; + A._EvaluateVisitor_visitSupportsRule_closure5.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Null), + $async$self = this, t2, t3, _i, t1, _0_0; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.$this; + _0_0 = t1._async_evaluate0$_atRootExcludingStyleRule ? null : t1._async_evaluate0$_styleRuleIgnoringAtRoot; + $async$goto = _0_0 != null ? 2 : 4; + break; + case 2: + // then + $async$goto = 5; + return A._asyncAwait(t1._async_evaluate0$_withParent$2$2(A.ModifiableCssStyleRule$0(_0_0._style_rule0$_selector, _0_0.span, _0_0.originalSelector), new A._EvaluateVisitor_visitSupportsRule__closure2(t1, $async$self.node), type$.ModifiableCssStyleRule_2, type$.Null), $async$call$0); + case 5: + // returning from await. + // goto join + $async$goto = 3; + break; + case 4: + // else + t2 = $async$self.node.children, t3 = t2.length, _i = 0; + case 6: + // for condition + if (!(_i < t3)) { + // goto after for + $async$goto = 8; + break; + } + $async$goto = 9; + return A._asyncAwait(t2[_i].accept$1(t1), $async$call$0); + case 9: + // returning from await. + case 7: + // for update + ++_i; + // goto for condition + $async$goto = 6; + break; + case 8: + // after for + case 3: + // join + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 2 + }; + A._EvaluateVisitor_visitSupportsRule__closure2.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Null), + $async$self = this, t1, t2, t3, _i; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.node.children, t2 = t1.length, t3 = $async$self.$this, _i = 0; + case 2: + // for condition + if (!(_i < t2)) { + // goto after for + $async$goto = 4; + break; + } + $async$goto = 5; + return A._asyncAwait(t1[_i].accept$1(t3), $async$call$0); + case 5: + // returning from await. + case 3: + // for update + ++_i; + // goto for condition + $async$goto = 2; + break; + case 4: + // after for + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 2 + }; + A._EvaluateVisitor_visitSupportsRule_closure6.prototype = { + call$1(node) { + return node instanceof A.ModifiableCssStyleRule0; + }, + $signature: 8 + }; + A._EvaluateVisitor__visitSupportsCondition_closure2.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.String), + $async$returnValue, $async$self = this, t1, t2, t3, t4, $async$temp1, $async$temp2; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.$this; + t2 = $async$self._box_0; + $async$temp1 = A; + $async$goto = 3; + return A._asyncAwait(t1._async_evaluate0$_evaluateToCss$1(t2.declaration.name), $async$call$0); + case 3: + // returning from await. + t3 = $async$temp1.S($async$result); + t4 = t2.declaration.get$isCustomProperty() ? "" : " "; + $async$temp1 = "(" + t3 + ":" + t4; + $async$temp2 = A; + $async$goto = 4; + return A._asyncAwait(t1._async_evaluate0$_evaluateToCss$1(t2.declaration.value), $async$call$0); + case 4: + // returning from await. + $async$returnValue = $async$temp1 + $async$temp2.S($async$result) + ")"; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 239 + }; + A._EvaluateVisitor_visitVariableDeclaration_closure8.prototype = { + call$0() { + var t1 = this.$this._async_evaluate0$_environment, + t2 = this._box_0.override; + t1.setVariable$4$global(this.node.name, t2.value, t2.assignmentNode, true); + }, + $signature: 1 + }; + A._EvaluateVisitor_visitVariableDeclaration_closure9.prototype = { + call$0() { + var t1 = this.node; + return this.$this._async_evaluate0$_environment.getVariable$2$namespace(t1.name, t1.namespace); + }, + $signature: 42 + }; + A._EvaluateVisitor_visitVariableDeclaration_closure10.prototype = { + call$0() { + var t1 = this.$this, + t2 = this.node; + t1._async_evaluate0$_environment.setVariable$5$global$namespace(t2.name, this.value, t1._async_evaluate0$_expressionNode$1(t2.expression), t2.isGlobal, t2.namespace); + }, + $signature: 1 + }; + A._EvaluateVisitor_visitUseRule_closure2.prototype = { + call$2(module, firstLoad) { + var t1, t2, t3, _0_0, t4, t5, span; + if (firstLoad) + this.$this._async_evaluate0$_registerCommentsForModule$1(module); + t1 = this.$this._async_evaluate0$_environment; + t2 = this.node; + t3 = t2.namespace; + if (t3 == null) { + t1._async_environment0$_globalModules.$indexSet(0, module, t2); + t1._async_environment0$_allModules.push(module); + _0_0 = A.IterableExtension_firstWhereOrNull(J.get$keys$z(B.JSArray_methods.get$first(t1._async_environment0$_variables)), module.get$variables().get$containsKey()); + if (_0_0 != null) + A.throwExpression(A.SassScriptException$0(string$.This_ma + _0_0 + '".', null)); + } else { + t4 = t1._async_environment0$_modules; + if (t4.containsKey$1(t3)) { + t5 = t1._async_environment0$_namespaceNodes.$index(0, t3); + span = t5 == null ? null : t5.span; + t5 = A.LinkedHashMap_LinkedHashMap$_empty(type$.FileSpan, type$.String); + if (span != null) + t5.$indexSet(0, span, "original @use"); + A.throwExpression(A.MultiSpanSassScriptException$0(string$.There_ + t3 + '".', "new @use", t5)); + } + t4.$indexSet(0, t3, module); + t1._async_environment0$_namespaceNodes.$indexSet(0, t3, t2); + t1._async_environment0$_allModules.push(module); + } + }, + $signature: 113 + }; + A._EvaluateVisitor_visitWarnRule_closure2.prototype = { + call$0() { + return this.node.expression.accept$1(this.$this); + }, + $signature: 75 + }; + A._EvaluateVisitor_visitWhileRule_closure2.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.nullable_Value_2), + $async$returnValue, $async$self = this, t1, t2, t3, _0_0; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.node, t2 = t1.condition, t3 = $async$self.$this, t1 = t1.children; + case 3: + // for condition + $async$goto = 5; + return A._asyncAwait(t2.accept$1(t3), $async$call$0); + case 5: + // returning from await. + if (!$async$result.get$isTruthy()) { + // goto after for + $async$goto = 4; + break; + } + $async$goto = 6; + return A._asyncAwait(t3._async_evaluate0$_handleReturn$2(t1, new A._EvaluateVisitor_visitWhileRule__closure2(t3)), $async$call$0); + case 6: + // returning from await. + _0_0 = $async$result; + if (_0_0 != null) { + $async$returnValue = _0_0; + // goto return + $async$goto = 1; + break; + } + // goto for condition + $async$goto = 3; + break; + case 4: + // after for + $async$returnValue = null; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 68 + }; + A._EvaluateVisitor_visitWhileRule__closure2.prototype = { + call$1(child) { + return child.accept$1(this.$this); + }, + $signature: 78 + }; + A._EvaluateVisitor_visitBinaryOperationExpression_closure2.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Value_2), + $async$returnValue, $async$self = this, t3, t1, t2, left, $async$temp1, $async$temp2; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.node; + t2 = $async$self.$this; + $async$goto = 3; + return A._asyncAwait(t1.left.accept$1(t2), $async$call$0); + case 3: + // returning from await. + left = $async$result; + case 4: + // switch + switch (t1.operator) { + case B.BinaryOperator_2jN0: + // goto case + $async$goto = 6; + break; + case B.BinaryOperator_M6L0: + // goto case + $async$goto = 7; + break; + case B.BinaryOperator_SNp0: + // goto case + $async$goto = 8; + break; + case B.BinaryOperator_ql50: + // goto case + $async$goto = 9; + break; + case B.BinaryOperator_ViB0: + // goto case + $async$goto = 10; + break; + case B.BinaryOperator_cIH0: + // goto case + $async$goto = 11; + break; + case B.BinaryOperator_7Tg0: + // goto case + $async$goto = 12; + break; + case B.BinaryOperator_U8c0: + // goto case + $async$goto = 13; + break; + case B.BinaryOperator_kpg0: + // goto case + $async$goto = 14; + break; + case B.BinaryOperator_anB0: + // goto case + $async$goto = 15; + break; + case B.BinaryOperator_olz0: + // goto case + $async$goto = 16; + break; + case B.BinaryOperator_qN20: + // goto case + $async$goto = 17; + break; + case B.BinaryOperator_t8B0: + // goto case + $async$goto = 18; + break; + case B.BinaryOperator_OTG0: + // goto case + $async$goto = 19; + break; + default: + // goto default + $async$goto = 20; + break; + } + break; + case 6: + // case + t1 = t1.right.accept$1(t2); + $async$goto = 21; + return A._asyncAwait(type$.Future_Value_2._is(t1) ? t1 : A._Future$value(t1, type$.Value_2), $async$call$0); + case 21: + // returning from await. + t1 = $async$result; + t1 = new A.SassString0(A.serializeValue0(left, false, true) + "=" + A.serializeValue0(t1, false, true), false); + // goto after switch + $async$goto = 5; + break; + case 7: + // case + $async$goto = left.get$isTruthy() ? 22 : 24; + break; + case 22: + // then + t1 = left; + // goto join + $async$goto = 23; + break; + case 24: + // else + t1 = t1.right.accept$1(t2); + $async$goto = 25; + return A._asyncAwait(type$.Future_Value_2._is(t1) ? t1 : A._Future$value(t1, type$.Value_2), $async$call$0); + case 25: + // returning from await. + t1 = $async$result; + case 23: + // join + // goto after switch + $async$goto = 5; + break; + case 8: + // case + $async$goto = left.get$isTruthy() ? 26 : 28; + break; + case 26: + // then + t1 = t1.right.accept$1(t2); + $async$goto = 29; + return A._asyncAwait(type$.Future_Value_2._is(t1) ? t1 : A._Future$value(t1, type$.Value_2), $async$call$0); + case 29: + // returning from await. + t1 = $async$result; + // goto join + $async$goto = 27; + break; + case 28: + // else + t1 = left; + case 27: + // join + // goto after switch + $async$goto = 5; + break; + case 9: + // case + $async$temp1 = left; + $async$goto = 30; + return A._asyncAwait(t1.right.accept$1(t2), $async$call$0); + case 30: + // returning from await. + t1 = $async$temp1.$eq(0, $async$result) ? B.SassBoolean_true0 : B.SassBoolean_false0; + // goto after switch + $async$goto = 5; + break; + case 10: + // case + $async$temp1 = left; + $async$goto = 31; + return A._asyncAwait(t1.right.accept$1(t2), $async$call$0); + case 31: + // returning from await. + t1 = !$async$temp1.$eq(0, $async$result) ? B.SassBoolean_true0 : B.SassBoolean_false0; + // goto after switch + $async$goto = 5; + break; + case 11: + // case + t1 = t1.right.accept$1(t2); + $async$temp1 = left; + $async$goto = 32; + return A._asyncAwait(type$.Future_Value_2._is(t1) ? t1 : A._Future$value(t1, type$.Value_2), $async$call$0); + case 32: + // returning from await. + t1 = $async$temp1.greaterThan$1($async$result); + // goto after switch + $async$goto = 5; + break; + case 12: + // case + t1 = t1.right.accept$1(t2); + $async$temp1 = left; + $async$goto = 33; + return A._asyncAwait(type$.Future_Value_2._is(t1) ? t1 : A._Future$value(t1, type$.Value_2), $async$call$0); + case 33: + // returning from await. + t1 = $async$temp1.greaterThanOrEquals$1($async$result); + // goto after switch + $async$goto = 5; + break; + case 13: + // case + t1 = t1.right.accept$1(t2); + $async$temp1 = left; + $async$goto = 34; + return A._asyncAwait(type$.Future_Value_2._is(t1) ? t1 : A._Future$value(t1, type$.Value_2), $async$call$0); + case 34: + // returning from await. + t1 = $async$temp1.lessThan$1($async$result); + // goto after switch + $async$goto = 5; + break; + case 14: + // case + t1 = t1.right.accept$1(t2); + $async$temp1 = left; + $async$goto = 35; + return A._asyncAwait(type$.Future_Value_2._is(t1) ? t1 : A._Future$value(t1, type$.Value_2), $async$call$0); + case 35: + // returning from await. + t1 = $async$temp1.lessThanOrEquals$1($async$result); + // goto after switch + $async$goto = 5; + break; + case 15: + // case + t1 = t1.right.accept$1(t2); + $async$temp1 = left; + $async$goto = 36; + return A._asyncAwait(type$.Future_Value_2._is(t1) ? t1 : A._Future$value(t1, type$.Value_2), $async$call$0); + case 36: + // returning from await. + t1 = $async$temp1.plus$1($async$result); + // goto after switch + $async$goto = 5; + break; + case 16: + // case + t1 = t1.right.accept$1(t2); + $async$temp1 = left; + $async$goto = 37; + return A._asyncAwait(type$.Future_Value_2._is(t1) ? t1 : A._Future$value(t1, type$.Value_2), $async$call$0); + case 37: + // returning from await. + t1 = $async$temp1.minus$1($async$result); + // goto after switch + $async$goto = 5; + break; + case 17: + // case + t1 = t1.right.accept$1(t2); + $async$temp1 = left; + $async$goto = 38; + return A._asyncAwait(type$.Future_Value_2._is(t1) ? t1 : A._Future$value(t1, type$.Value_2), $async$call$0); + case 38: + // returning from await. + t1 = $async$temp1.times$1($async$result); + // goto after switch + $async$goto = 5; + break; + case 18: + // case + t3 = t1.right.accept$1(t2); + $async$temp1 = t2; + $async$temp2 = left; + $async$goto = 39; + return A._asyncAwait(type$.Future_Value_2._is(t3) ? t3 : A._Future$value(t3, type$.Value_2), $async$call$0); + case 39: + // returning from await. + t1 = $async$temp1._async_evaluate0$_slash$3($async$temp2, $async$result, t1); + // goto after switch + $async$goto = 5; + break; + case 19: + // case + t1 = t1.right.accept$1(t2); + $async$temp1 = left; + $async$goto = 40; + return A._asyncAwait(type$.Future_Value_2._is(t1) ? t1 : A._Future$value(t1, type$.Value_2), $async$call$0); + case 40: + // returning from await. + t1 = $async$temp1.modulo$1($async$result); + // goto after switch + $async$goto = 5; + break; + case 20: + // default + t1 = null; + case 5: + // after switch + $async$returnValue = t1; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 75 + }; + A._EvaluateVisitor__slash_recommendation2.prototype = { + call$1(expression) { + var t1; + $label0$0: { + if (expression instanceof A.BinaryOperationExpression0 && B.BinaryOperator_t8B0 === expression.operator) { + t1 = "math.div(" + A.S(this.call$1(expression.left)) + ", " + A.S(this.call$1(expression.right)) + ")"; + break $label0$0; + } + if (expression instanceof A.ParenthesizedExpression0) { + t1 = expression.expression.toString$0(0); + break $label0$0; + } + t1 = expression.toString$0(0); + break $label0$0; + } + return t1; + }, + $signature: 131 + }; + A._EvaluateVisitor_visitVariableExpression_closure2.prototype = { + call$0() { + var t1 = this.node; + return this.$this._async_evaluate0$_environment.getVariable$2$namespace(t1.name, t1.namespace); + }, + $signature: 42 + }; + A._EvaluateVisitor_visitUnaryOperationExpression_closure2.prototype = { + call$0() { + var t1, _this = this; + switch (_this.node.operator) { + case B.UnaryOperator_gg40: + t1 = _this.operand.unaryPlus$0(); + break; + case B.UnaryOperator_TLI0: + t1 = _this.operand.unaryMinus$0(); + break; + case B.UnaryOperator_Ix10: + t1 = new A.SassString0("/" + A.serializeValue0(_this.operand, false, true), false); + break; + case B.UnaryOperator_not_not_not0: + t1 = _this.operand.unaryNot$0(); + break; + default: + t1 = null; + } + return t1; + }, + $signature: 47 + }; + A._EvaluateVisitor_visitListExpression_closure2.prototype = { + call$1(expression) { + return expression.accept$1(this.$this); + }, + $signature: 346 + }; + A._EvaluateVisitor_visitFunctionExpression_closure8.prototype = { + call$0() { + var t1 = this.$this._async_evaluate0$_environment, + t2 = this.node; + return t1.getFunction$2$namespace(A.stringReplaceAllUnchecked(t2.originalName, "_", "-"), t2.namespace); + }, + $signature: 83 + }; + A._EvaluateVisitor_visitFunctionExpression_closure9.prototype = { + call$1(argument) { + return argument.accept$1(new A._IsCalculationSafeVisitor0()); + }, + $signature: 133 + }; + A._EvaluateVisitor_visitFunctionExpression_closure10.prototype = { + call$0() { + var t1 = this.node; + return this.$this._async_evaluate0$_runFunctionCallable$3(t1.$arguments, this._box_0.$function, t1); + }, + $signature: 75 + }; + A._EvaluateVisitor__checkCalculationArguments_check2.prototype = { + call$1(maxArgs) { + var t1 = this.node, + t2 = t1.$arguments.positional.length; + if (t2 === 0) + throw A.wrapException(this.$this._async_evaluate0$_exception$2("Missing argument.", t1.span)); + else if (maxArgs != null && t2 > maxArgs) + throw A.wrapException(this.$this._async_evaluate0$_exception$2("Only " + A.S(maxArgs) + " " + A.pluralize0("argument", maxArgs, null) + " allowed, but " + t2 + " " + A.pluralize0("was", t2, "were") + " passed.", t1.span)); + }, + call$0() { + return this.call$1(null); + }, + $signature: 99 + }; + A._EvaluateVisitor__visitCalculationExpression_closure2.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Object), + $async$returnValue, $async$self = this, t1, t2, t3, $async$temp1, $async$temp2, $async$temp3; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.$this; + t2 = $async$self._box_0; + t3 = $async$self.inLegacySassFunction; + $async$temp1 = A; + $async$temp2 = t1._async_evaluate0$_binaryOperatorToCalculationOperator$2(t2.operator, $async$self.node); + $async$goto = 3; + return A._asyncAwait(t1._async_evaluate0$_visitCalculationExpression$2$inLegacySassFunction(t2.left, t3), $async$call$0); + case 3: + // returning from await. + $async$temp3 = $async$result; + $async$goto = 4; + return A._asyncAwait(t1._async_evaluate0$_visitCalculationExpression$2$inLegacySassFunction(t2.right, t3), $async$call$0); + case 4: + // returning from await. + $async$returnValue = $async$temp1.SassCalculation_operateInternal0($async$temp2, $async$temp3, $async$result, t3, !t1._async_evaluate0$_inSupportsDeclaration); + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 245 + }; + A._EvaluateVisitor_visitInterpolatedFunctionExpression_closure2.prototype = { + call$0() { + var t1 = this.node; + return this.$this._async_evaluate0$_runFunctionCallable$3(t1.$arguments, this.$function, t1); + }, + $signature: 75 + }; + A._EvaluateVisitor__runUserDefinedCallable_closure2.prototype = { + call$0() { + var _this = this, + t1 = _this.$this, + t2 = _this.callable, + t3 = _this.V; + return t1._async_evaluate0$_withEnvironment$1$2(t2.environment.closure$0(), new A._EvaluateVisitor__runUserDefinedCallable__closure2(t1, _this.evaluated, t2, _this.nodeWithSpan, _this.run, t3), t3); + }, + $signature() { + return this.V._eval$1("Future<0>()"); + } + }; + A._EvaluateVisitor__runUserDefinedCallable__closure2.prototype = { + call$0() { + var _this = this, + t1 = _this.$this, + t2 = _this.V; + return t1._async_evaluate0$_environment.scope$1$1(new A._EvaluateVisitor__runUserDefinedCallable___closure2(t1, _this.evaluated, _this.callable, _this.nodeWithSpan, _this.run, t2), t2); + }, + $signature() { + return this.V._eval$1("Future<0>()"); + } + }; + A._EvaluateVisitor__runUserDefinedCallable___closure2.prototype = { + call$0() { + return this.$call$body$_EvaluateVisitor__runUserDefinedCallable___closure0(this.V); + }, + $call$body$_EvaluateVisitor__runUserDefinedCallable___closure0($async$type) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter($async$type), + $async$returnValue, $async$self = this, declaredArguments, t5, minLength, i, argument, t6, t7, value, t8, restArgument, rest, argumentList, result, t1, t2, t3, t4, $async$temp1; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.$this; + t2 = $async$self.evaluated._values; + t3 = $async$self.callable.declaration.$arguments; + t4 = $async$self.nodeWithSpan; + t1._async_evaluate0$_verifyArguments$4(J.get$length$asx(t2[2]), t2[0], t3, t4); + declaredArguments = t3.$arguments; + t5 = declaredArguments.length; + minLength = Math.min(J.get$length$asx(t2[2]), t5); + for (i = 0; i < minLength; ++i) + t1._async_evaluate0$_environment.setLocalVariable$3(declaredArguments[i].name, J.$index$asx(t2[2], i), J.$index$asx(t2[3], i)); + i = J.get$length$asx(t2[2]); + case 3: + // for condition + if (!(i < t5)) { + // goto after for + $async$goto = 5; + break; + } + argument = declaredArguments[i]; + t6 = t2[0]; + t7 = argument.name; + value = J.remove$1$z(t6, t7); + $async$goto = value == null ? 6 : 7; + break; + case 6: + // then + t6 = argument.defaultValue; + $async$temp1 = t1; + $async$goto = 8; + return A._asyncAwait(t6.accept$1(t1), $async$call$0); + case 8: + // returning from await. + value = $async$temp1._async_evaluate0$_withoutSlash$2($async$result, t1._async_evaluate0$_expressionNode$1(t6)); + case 7: + // join + t6 = t1._async_evaluate0$_environment; + t8 = J.$index$asx(t2[1], t7); + if (t8 == null) { + t8 = argument.defaultValue; + t8.toString; + t8 = t1._async_evaluate0$_expressionNode$1(t8); + } + t6.setLocalVariable$3(t7, value, t8); + case 4: + // for update + ++i; + // goto for condition + $async$goto = 3; + break; + case 5: + // after for + restArgument = t3.restArgument; + if (restArgument != null) { + rest = J.get$length$asx(t2[2]) > t5 ? J.sublist$1$ax(t2[2], t5) : B.List_empty19; + t5 = t2[0]; + t6 = t2[4]; + argumentList = A.SassArgumentList$0(rest, t5, t6 === B.ListSeparator_undecided_null_undecided0 ? B.ListSeparator_rXA0 : t6); + t1._async_evaluate0$_environment.setLocalVariable$3(restArgument, argumentList, t4); + } else + argumentList = null; + $async$goto = 9; + return A._asyncAwait($async$self.run.call$0(), $async$call$0); + case 9: + // returning from await. + result = $async$result; + if (argumentList == null) { + $async$returnValue = result; + // goto return + $async$goto = 1; + break; + } + if (J.get$isEmpty$asx(t2[0])) { + $async$returnValue = result; + // goto return + $async$goto = 1; + break; + } + if (argumentList._argument_list$_wereKeywordsAccessed) { + $async$returnValue = result; + // goto return + $async$goto = 1; + break; + } + throw A.wrapException(A.MultiSpanSassRuntimeException$0("No " + A.pluralize0("argument", J.get$length$asx(J.get$keys$z(t2[0])), null) + " named " + A.toSentence0(J.map$1$1$ax(J.get$keys$z(t2[0]), new A._EvaluateVisitor__runUserDefinedCallable____closure2(), type$.Object), "or") + ".", t4.get$span(t4), "invocation", A.LinkedHashMap_LinkedHashMap$_literal([t3.get$spanWithName(), "declaration"], type$.FileSpan, type$.String), t1._async_evaluate0$_stackTrace$1(t4.get$span(t4)), null)); + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature() { + return this.V._eval$1("Future<0>()"); + } + }; + A._EvaluateVisitor__runUserDefinedCallable____closure2.prototype = { + call$1($name) { + return "$" + $name; + }, + $signature: 5 + }; + A._EvaluateVisitor__runFunctionCallable_closure2.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Value_2), + $async$returnValue, $async$self = this, t1, t2, t3, t4, _i, $returnValue; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.callable.declaration, t2 = t1.children, t3 = t2.length, t4 = $async$self.$this, _i = 0; + case 3: + // for condition + if (!(_i < t3)) { + // goto after for + $async$goto = 5; + break; + } + $async$goto = 6; + return A._asyncAwait(t2[_i].accept$1(t4), $async$call$0); + case 6: + // returning from await. + $returnValue = $async$result; + if ($returnValue instanceof A.Value0) { + $async$returnValue = $returnValue; + // goto return + $async$goto = 1; + break; + } + case 4: + // for update + ++_i; + // goto for condition + $async$goto = 3; + break; + case 5: + // after for + throw A.wrapException(t4._async_evaluate0$_exception$2("Function finished without @return.", t1.span)); + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 75 + }; + A._EvaluateVisitor__runBuiltInCallable_closure8.prototype = { + call$0() { + return this._box_0.overload.verify$2(J.get$length$asx(this.evaluated._values[2]), this.namedSet); + }, + $signature: 0 + }; + A._EvaluateVisitor__runBuiltInCallable_closure9.prototype = { + call$0() { + return this._box_0.callback.call$1(this.evaluated._values[2]); + }, + $signature: 348 + }; + A._EvaluateVisitor__runBuiltInCallable_closure10.prototype = { + call$1($name) { + return "$" + $name; + }, + $signature: 5 + }; + A._EvaluateVisitor__evaluateArguments_closure11.prototype = { + call$1(value) { + return value; + }, + $signature: 41 + }; + A._EvaluateVisitor__evaluateArguments_closure12.prototype = { + call$1(value) { + return this.$this._async_evaluate0$_withoutSlash$2(value, this.restNodeForSpan); + }, + $signature: 41 + }; + A._EvaluateVisitor__evaluateArguments_closure13.prototype = { + call$2(key, value) { + var _this = this, + t1 = _this.restNodeForSpan; + _this.named.$indexSet(0, key, _this.$this._async_evaluate0$_withoutSlash$2(value, t1)); + _this.namedNodes.$indexSet(0, key, t1); + }, + $signature: 86 + }; + A._EvaluateVisitor__evaluateArguments_closure14.prototype = { + call$1(value) { + return value; + }, + $signature: 41 + }; + A._EvaluateVisitor__evaluateMacroArguments_closure11.prototype = { + call$1(value) { + var t1 = this.restArgs; + return new A.ValueExpression0(value, t1.get$span(t1)); + }, + $signature: 60 + }; + A._EvaluateVisitor__evaluateMacroArguments_closure12.prototype = { + call$1(value) { + var t1 = this.restArgs; + return new A.ValueExpression0(this.$this._async_evaluate0$_withoutSlash$2(value, this.restNodeForSpan), t1.get$span(t1)); + }, + $signature: 60 + }; + A._EvaluateVisitor__evaluateMacroArguments_closure13.prototype = { + call$2(key, value) { + var _this = this, + t1 = _this.restArgs; + _this.named.$indexSet(0, key, new A.ValueExpression0(_this.$this._async_evaluate0$_withoutSlash$2(value, _this.restNodeForSpan), t1.get$span(t1))); + }, + $signature: 86 + }; + A._EvaluateVisitor__evaluateMacroArguments_closure14.prototype = { + call$1(value) { + var t1 = this.keywordRestArgs; + return new A.ValueExpression0(this.$this._async_evaluate0$_withoutSlash$2(value, this.keywordRestNodeForSpan), t1.get$span(t1)); + }, + $signature: 60 + }; + A._EvaluateVisitor__addRestMap_closure2.prototype = { + call$2(key, value) { + var t2, _this = this, + t1 = _this.$this; + if (key instanceof A.SassString0) + _this.values.$indexSet(0, key._string0$_text, _this.convert.call$1(t1._async_evaluate0$_withoutSlash$2(value, _this.expressionNode))); + else { + t2 = _this.nodeWithSpan; + throw A.wrapException(t1._async_evaluate0$_exception$2(string$.Variab_ + key.toString$0(0) + " is not a string in " + _this.map.toString$0(0) + ".", t2.get$span(t2))); + } + }, + $signature: 80 + }; + A._EvaluateVisitor__verifyArguments_closure2.prototype = { + call$0() { + return this.$arguments.verify$2(this.positional, new A.MapKeySet(this.named, type$.MapKeySet_String)); + }, + $signature: 0 + }; + A._EvaluateVisitor_visitCssAtRule_closure5.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Null), + $async$self = this, t1, t2, t3, t4; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.node.children, t2 = t1.$ti, t1 = new A.ListIterator(t1, t1.get$length(0), t2._eval$1("ListIterator")), t3 = $async$self.$this, t2 = t2._eval$1("ListBase.E"); + case 2: + // for condition + if (!t1.moveNext$0()) { + // goto after for + $async$goto = 3; + break; + } + t4 = t1.__internal$_current; + $async$goto = 4; + return A._asyncAwait((t4 == null ? t2._as(t4) : t4).accept$1(t3), $async$call$0); + case 4: + // returning from await. + // goto for condition + $async$goto = 2; + break; + case 3: + // after for + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 2 + }; + A._EvaluateVisitor_visitCssAtRule_closure6.prototype = { + call$1(node) { + return node instanceof A.ModifiableCssStyleRule0; + }, + $signature: 8 + }; + A._EvaluateVisitor_visitCssKeyframeBlock_closure5.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Null), + $async$self = this, t1, t2, t3, t4; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.node.children, t2 = t1.$ti, t1 = new A.ListIterator(t1, t1.get$length(0), t2._eval$1("ListIterator")), t3 = $async$self.$this, t2 = t2._eval$1("ListBase.E"); + case 2: + // for condition + if (!t1.moveNext$0()) { + // goto after for + $async$goto = 3; + break; + } + t4 = t1.__internal$_current; + $async$goto = 4; + return A._asyncAwait((t4 == null ? t2._as(t4) : t4).accept$1(t3), $async$call$0); + case 4: + // returning from await. + // goto for condition + $async$goto = 2; + break; + case 3: + // after for + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 2 + }; + A._EvaluateVisitor_visitCssKeyframeBlock_closure6.prototype = { + call$1(node) { + return node instanceof A.ModifiableCssStyleRule0; + }, + $signature: 8 + }; + A._EvaluateVisitor_visitCssMediaRule_closure8.prototype = { + call$1(mediaQueries) { + return this.$this._async_evaluate0$_mergeMediaQueries$2(mediaQueries, this.node.queries); + }, + $signature: 93 + }; + A._EvaluateVisitor_visitCssMediaRule_closure9.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Null), + $async$self = this, t1, t2; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.$this; + t2 = $async$self.mergedQueries; + if (t2 == null) + t2 = $async$self.node.queries; + $async$goto = 2; + return A._asyncAwait(t1._async_evaluate0$_withMediaQueries$1$3(t2, $async$self.mergedSources, new A._EvaluateVisitor_visitCssMediaRule__closure2(t1, $async$self.node), type$.Null), $async$call$0); + case 2: + // returning from await. + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 2 + }; + A._EvaluateVisitor_visitCssMediaRule__closure2.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Null), + $async$self = this, t2, t3, t4, t1, _0_0; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.$this; + _0_0 = t1._async_evaluate0$_atRootExcludingStyleRule ? null : t1._async_evaluate0$_styleRuleIgnoringAtRoot; + $async$goto = _0_0 != null ? 2 : 4; + break; + case 2: + // then + $async$goto = 5; + return A._asyncAwait(t1._async_evaluate0$_withParent$2$3$scopeWhen(A.ModifiableCssStyleRule$0(_0_0._style_rule0$_selector, _0_0.span, _0_0.originalSelector), new A._EvaluateVisitor_visitCssMediaRule___closure2(t1, $async$self.node), false, type$.ModifiableCssStyleRule_2, type$.Null), $async$call$0); + case 5: + // returning from await. + // goto join + $async$goto = 3; + break; + case 4: + // else + t2 = $async$self.node.children, t3 = t2.$ti, t2 = new A.ListIterator(t2, t2.get$length(0), t3._eval$1("ListIterator")), t3 = t3._eval$1("ListBase.E"); + case 6: + // for condition + if (!t2.moveNext$0()) { + // goto after for + $async$goto = 7; + break; + } + t4 = t2.__internal$_current; + $async$goto = 8; + return A._asyncAwait((t4 == null ? t3._as(t4) : t4).accept$1(t1), $async$call$0); + case 8: + // returning from await. + // goto for condition + $async$goto = 6; + break; + case 7: + // after for + case 3: + // join + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 2 + }; + A._EvaluateVisitor_visitCssMediaRule___closure2.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Null), + $async$self = this, t1, t2, t3, t4; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.node.children, t2 = t1.$ti, t1 = new A.ListIterator(t1, t1.get$length(0), t2._eval$1("ListIterator")), t3 = $async$self.$this, t2 = t2._eval$1("ListBase.E"); + case 2: + // for condition + if (!t1.moveNext$0()) { + // goto after for + $async$goto = 3; + break; + } + t4 = t1.__internal$_current; + $async$goto = 4; + return A._asyncAwait((t4 == null ? t2._as(t4) : t4).accept$1(t3), $async$call$0); + case 4: + // returning from await. + // goto for condition + $async$goto = 2; + break; + case 3: + // after for + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 2 + }; + A._EvaluateVisitor_visitCssMediaRule_closure10.prototype = { + call$1(node) { + var t1; + if (!(node instanceof A.ModifiableCssStyleRule0)) { + t1 = this.mergedSources; + t1 = t1.get$isNotEmpty(t1) && node instanceof A.ModifiableCssMediaRule0 && B.JSArray_methods.every$1(node.queries, t1.get$contains(t1)); + } else + t1 = true; + return t1; + }, + $signature: 8 + }; + A._EvaluateVisitor_visitCssStyleRule_closure5.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Null), + $async$self = this, t1; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.$this; + $async$goto = 2; + return A._asyncAwait(t1._async_evaluate0$_withStyleRule$1$2($async$self.rule, new A._EvaluateVisitor_visitCssStyleRule__closure2(t1, $async$self.node), type$.Null), $async$call$0); + case 2: + // returning from await. + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 2 + }; + A._EvaluateVisitor_visitCssStyleRule__closure2.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Null), + $async$self = this, t1, t2, t3, t4; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.node.children, t2 = t1.$ti, t1 = new A.ListIterator(t1, t1.get$length(0), t2._eval$1("ListIterator")), t3 = $async$self.$this, t2 = t2._eval$1("ListBase.E"); + case 2: + // for condition + if (!t1.moveNext$0()) { + // goto after for + $async$goto = 3; + break; + } + t4 = t1.__internal$_current; + $async$goto = 4; + return A._asyncAwait((t4 == null ? t2._as(t4) : t4).accept$1(t3), $async$call$0); + case 4: + // returning from await. + // goto for condition + $async$goto = 2; + break; + case 3: + // after for + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 2 + }; + A._EvaluateVisitor_visitCssStyleRule_closure6.prototype = { + call$1(node) { + return node instanceof A.ModifiableCssStyleRule0; + }, + $signature: 8 + }; + A._EvaluateVisitor_visitCssSupportsRule_closure5.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Null), + $async$self = this, t2, t3, t4, t1, _0_0; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.$this; + _0_0 = t1._async_evaluate0$_atRootExcludingStyleRule ? null : t1._async_evaluate0$_styleRuleIgnoringAtRoot; + $async$goto = _0_0 != null ? 2 : 4; + break; + case 2: + // then + $async$goto = 5; + return A._asyncAwait(t1._async_evaluate0$_withParent$2$2(A.ModifiableCssStyleRule$0(_0_0._style_rule0$_selector, _0_0.span, _0_0.originalSelector), new A._EvaluateVisitor_visitCssSupportsRule__closure2(t1, $async$self.node), type$.ModifiableCssStyleRule_2, type$.Null), $async$call$0); + case 5: + // returning from await. + // goto join + $async$goto = 3; + break; + case 4: + // else + t2 = $async$self.node.children, t3 = t2.$ti, t2 = new A.ListIterator(t2, t2.get$length(0), t3._eval$1("ListIterator")), t3 = t3._eval$1("ListBase.E"); + case 6: + // for condition + if (!t2.moveNext$0()) { + // goto after for + $async$goto = 7; + break; + } + t4 = t2.__internal$_current; + $async$goto = 8; + return A._asyncAwait((t4 == null ? t3._as(t4) : t4).accept$1(t1), $async$call$0); + case 8: + // returning from await. + // goto for condition + $async$goto = 6; + break; + case 7: + // after for + case 3: + // join + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 2 + }; + A._EvaluateVisitor_visitCssSupportsRule__closure2.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Null), + $async$self = this, t1, t2, t3, t4; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.node.children, t2 = t1.$ti, t1 = new A.ListIterator(t1, t1.get$length(0), t2._eval$1("ListIterator")), t3 = $async$self.$this, t2 = t2._eval$1("ListBase.E"); + case 2: + // for condition + if (!t1.moveNext$0()) { + // goto after for + $async$goto = 3; + break; + } + t4 = t1.__internal$_current; + $async$goto = 4; + return A._asyncAwait((t4 == null ? t2._as(t4) : t4).accept$1(t3), $async$call$0); + case 4: + // returning from await. + // goto for condition + $async$goto = 2; + break; + case 3: + // after for + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 2 + }; + A._EvaluateVisitor_visitCssSupportsRule_closure6.prototype = { + call$1(node) { + return node instanceof A.ModifiableCssStyleRule0; + }, + $signature: 8 + }; + A._EvaluateVisitor__performInterpolationHelper_closure2.prototype = { + call$1(targetLocations) { + return A.InterpolationMap$0(this.interpolation, targetLocations); + }, + $signature: 170 + }; + A._EvaluateVisitor__serialize_closure2.prototype = { + call$0() { + return A.serializeValue0(this.value, false, this.quote); + }, + $signature: 27 + }; + A._EvaluateVisitor__expressionNode_closure2.prototype = { + call$0() { + var t1 = this.expression; + return this.$this._async_evaluate0$_environment.getVariableNode$2$namespace(t1.name, t1.namespace); + }, + $signature: 169 + }; + A._EvaluateVisitor__withoutSlash_recommendation2.prototype = { + call$1(number) { + var t1, before, after, + _1_0 = number.asSlash; + $label0$0: { + if (type$.Record_2_nullable_Object_and_nullable_Object._is(_1_0)) { + t1 = type$.SassNumber_2; + before = t1._as(_1_0._0); + after = t1._as(_1_0._1); + t1 = "math.div(" + A.S(this.call$1(before)) + ", " + A.S(this.call$1(after)) + ")"; + break $label0$0; + } + t1 = A.serializeValue0(number, true, true); + break $label0$0; + } + return t1; + }, + $signature: 151 + }; + A._EvaluateVisitor__stackFrame_closure2.prototype = { + call$1(url) { + var t1 = this.$this._async_evaluate0$_importCache; + t1 = t1 == null ? null : t1.humanize$1(url); + return t1 == null ? url : t1; + }, + $signature: 44 + }; + A._ImportedCssVisitor2.prototype = { + visitCssAtRule$1(node) { + var t1 = node.isChildless ? null : new A._ImportedCssVisitor_visitCssAtRule_closure2(); + this._async_evaluate0$_visitor._async_evaluate0$_addChild$2$through(node, t1); + }, + visitCssComment$1(node) { + return this._async_evaluate0$_visitor._async_evaluate0$_addChild$1(node); + }, + visitCssDeclaration$1(node) { + }, + visitCssImport$1(node) { + var t2, + _s13_ = "_endOfImports", + t1 = this._async_evaluate0$_visitor; + if (t1._async_evaluate0$_assertInModule$2(t1._async_evaluate0$__parent, "__parent") !== t1._async_evaluate0$_assertInModule$2(t1._async_evaluate0$__root, "_root")) + t1._async_evaluate0$_addChild$1(node); + else if (t1._async_evaluate0$_assertInModule$2(t1._async_evaluate0$__endOfImports, _s13_) === J.get$length$asx(t1._async_evaluate0$_assertInModule$2(t1._async_evaluate0$__root, "_root").children._collection$_source)) { + t1._async_evaluate0$_addChild$1(node); + t1._async_evaluate0$__endOfImports = t1._async_evaluate0$_assertInModule$2(t1._async_evaluate0$__endOfImports, _s13_) + 1; + } else { + t2 = t1._async_evaluate0$_outOfOrderImports; + (t2 == null ? t1._async_evaluate0$_outOfOrderImports = A._setArrayType([], type$.JSArray_ModifiableCssImport_2) : t2).push(node); + } + }, + visitCssKeyframeBlock$1(node) { + }, + visitCssMediaRule$1(node) { + var t1 = this._async_evaluate0$_visitor, + mediaQueries = t1._async_evaluate0$_mediaQueries; + t1._async_evaluate0$_addChild$2$through(node, new A._ImportedCssVisitor_visitCssMediaRule_closure2(mediaQueries == null || t1._async_evaluate0$_mergeMediaQueries$2(mediaQueries, node.queries) != null)); + }, + visitCssStyleRule$1(node) { + return this._async_evaluate0$_visitor._async_evaluate0$_addChild$2$through(node, new A._ImportedCssVisitor_visitCssStyleRule_closure2()); + }, + visitCssStylesheet$1(node) { + var t1, t2, t3; + for (t1 = node.children, t2 = t1.$ti, t1 = new A.ListIterator(t1, t1.get$length(0), t2._eval$1("ListIterator")), t2 = t2._eval$1("ListBase.E"); t1.moveNext$0();) { + t3 = t1.__internal$_current; + (t3 == null ? t2._as(t3) : t3).accept$1(this); + } + }, + visitCssSupportsRule$1(node) { + return this._async_evaluate0$_visitor._async_evaluate0$_addChild$2$through(node, new A._ImportedCssVisitor_visitCssSupportsRule_closure2()); + } + }; + A._ImportedCssVisitor_visitCssAtRule_closure2.prototype = { + call$1(node) { + return node instanceof A.ModifiableCssStyleRule0; + }, + $signature: 8 + }; + A._ImportedCssVisitor_visitCssMediaRule_closure2.prototype = { + call$1(node) { + var t1; + if (!(node instanceof A.ModifiableCssStyleRule0)) + t1 = this.hasBeenMerged && node instanceof A.ModifiableCssMediaRule0; + else + t1 = true; + return t1; + }, + $signature: 8 + }; + A._ImportedCssVisitor_visitCssStyleRule_closure2.prototype = { + call$1(node) { + return node instanceof A.ModifiableCssStyleRule0; + }, + $signature: 8 + }; + A._ImportedCssVisitor_visitCssSupportsRule_closure2.prototype = { + call$1(node) { + return node instanceof A.ModifiableCssStyleRule0; + }, + $signature: 8 + }; + A._EvaluationContext2.prototype = { + get$currentCallableSpan() { + var _0_0 = this._async_evaluate0$_visitor._async_evaluate0$_callableNode; + if (_0_0 != null) + return _0_0.get$span(_0_0); + throw A.wrapException(A.StateError$(string$.No_Sasc)); + }, + warn$2(_, message, deprecation) { + var t1 = this._async_evaluate0$_visitor, + t2 = t1._async_evaluate0$_importSpan; + if (t2 == null) { + t2 = t1._async_evaluate0$_callableNode; + t2 = t2 == null ? null : t2.get$span(t2); + } + t1._async_evaluate0$_warn$3(message, t2 == null ? this._async_evaluate0$_defaultWarnNodeWithSpan.span : t2, deprecation); + }, + $isEvaluationContext0: 1 + }; + A.JSToDartAsyncFileImporter.prototype = { + canonicalize$1(_, url) { + return this.canonicalize$body$JSToDartAsyncFileImporter(0, url); + }, + canonicalize$body$JSToDartAsyncFileImporter(_, url) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.nullable_Uri), + $async$returnValue, $async$self = this, result, t1, resultUrl; + var $async$canonicalize$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + if (url.get$scheme() === "file") { + $async$returnValue = $.$get$FilesystemImporter_cwd0().canonicalize$1(0, url); + // goto return + $async$goto = 1; + break; + } + result = A.wrapJSExceptions(new A.JSToDartAsyncFileImporter_canonicalize_closure($async$self, url)); + $async$goto = result != null && result instanceof self.Promise ? 3 : 4; + break; + case 3: + // then + $async$goto = 5; + return A._asyncAwait(A.promiseToFuture(type$.Promise._as(result), type$.nullable_Object), $async$canonicalize$1); + case 5: + // returning from await. + result = $async$result; + case 4: + // join + if (result == null) { + $async$returnValue = null; + // goto return + $async$goto = 1; + break; + } + t1 = self.URL; + if (!(result instanceof t1)) + A.jsThrow(new self.Error(string$.The_fie)); + resultUrl = A.Uri_parse(J.toString$0$(type$.JSUrl._as(result))); + if (resultUrl.get$scheme() !== "file") + A.jsThrow(new self.Error(string$.The_fiu + url.toString$0(0) + '".')); + $async$returnValue = $.$get$FilesystemImporter_cwd0().canonicalize$1(0, resultUrl); + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$canonicalize$1, $async$completer); + }, + load$1(_, url) { + return $.$get$FilesystemImporter_cwd0().load$1(0, url); + }, + isNonCanonicalScheme$1(scheme) { + return scheme !== "file"; + } + }; + A.JSToDartAsyncFileImporter_canonicalize_closure.prototype = { + call$0() { + return this.$this._findFileUrl.call$2(this.url.toString$0(0), {fromImport: A.fromImport0(), containingUrl: A.NullableExtension_andThen0(A.containingUrl0(), A.utils1__dartToJSUrl$closure())}); + }, + $signature: 35 + }; + A.AsyncImportCache0.prototype = { + canonicalize$4$baseImporter$baseUrl$forImport(_, url, baseImporter, baseUrl, forImport) { + return this.canonicalize$body$AsyncImportCache0(0, url, baseImporter, baseUrl, forImport); + }, + canonicalize$body$AsyncImportCache0(_, url, baseImporter, baseUrl, forImport) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.nullable_Record_3_AsyncImporter_and_Uri_and_Uri_originalUrl_2), + $async$returnValue, $async$self = this, t1, relativeResult; + var $async$canonicalize$4$baseImporter$baseUrl$forImport = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + if (A.isBrowser()) + t1 = (baseImporter == null || baseImporter instanceof A.NoOpImporter0) && $async$self._async_import_cache0$_importers.length === 0; + else + t1 = false; + if (t1) + throw A.wrapException(string$.Custom); + $async$goto = baseImporter != null && url.get$scheme() === "" ? 3 : 4; + break; + case 3: + // then + $async$goto = 5; + return A._asyncAwait(A.putIfAbsentAsync0($async$self._async_import_cache0$_relativeCanonicalizeCache, new A._Record_4_baseImporter_baseUrl_forImport([url, baseImporter, baseUrl, forImport]), new A.AsyncImportCache_canonicalize_closure1($async$self, baseImporter, baseUrl, url, forImport), type$.Record_4_Uri_and_AsyncImporter_baseImporter_and_nullable_Uri_baseUrl_and_bool_forImport_2, type$.nullable_Record_3_AsyncImporter_and_Uri_and_Uri_originalUrl_2), $async$canonicalize$4$baseImporter$baseUrl$forImport); + case 5: + // returning from await. + relativeResult = $async$result; + if (relativeResult != null) { + $async$returnValue = relativeResult; + // goto return + $async$goto = 1; + break; + } + case 4: + // join + $async$goto = 6; + return A._asyncAwait(A.putIfAbsentAsync0($async$self._async_import_cache0$_canonicalizeCache, new A._Record_2_forImport(url, forImport), new A.AsyncImportCache_canonicalize_closure2($async$self, url, baseUrl, forImport), type$.Record_2_Uri_and_bool_forImport, type$.nullable_Record_3_AsyncImporter_and_Uri_and_Uri_originalUrl_2), $async$canonicalize$4$baseImporter$baseUrl$forImport); + case 6: + // returning from await. + $async$returnValue = $async$result; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$canonicalize$4$baseImporter$baseUrl$forImport, $async$completer); + }, + _async_import_cache0$_canonicalize$4(importer, url, baseUrl, forImport) { + return this._canonicalize$body$AsyncImportCache0(importer, url, baseUrl, forImport); + }, + _canonicalize$body$AsyncImportCache0(importer, url, baseUrl, forImport) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.nullable_Record_3_AsyncImporter_and_Uri_and_Uri_originalUrl_2), + $async$returnValue, $async$self = this, t1, passContainingUrl, result, canonicalize; + var $async$_async_import_cache0$_canonicalize$4 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + canonicalize = forImport ? new A.AsyncImportCache__canonicalize_closure1(importer, url) : new A.AsyncImportCache__canonicalize_closure2(importer, url); + $async$goto = baseUrl != null ? 3 : 5; + break; + case 3: + // then + $async$goto = url.get$scheme() !== "" ? 6 : 8; + break; + case 6: + // then + t1 = A._Future$value(importer.isNonCanonicalScheme$1(url.get$scheme()), type$.bool); + $async$goto = 9; + return A._asyncAwait(t1, $async$_async_import_cache0$_canonicalize$4); + case 9: + // returning from await. + t1 = $async$result; + passContainingUrl = t1; + // goto join + $async$goto = 7; + break; + case 8: + // else + passContainingUrl = true; + case 7: + // join + // goto join + $async$goto = 4; + break; + case 5: + // else + passContainingUrl = false; + case 4: + // join + t1 = passContainingUrl ? baseUrl : null; + t1 = A.withContainingUrl0(t1, canonicalize, type$.FutureOr_nullable_Uri); + $async$goto = 10; + return A._asyncAwait(type$.Future_nullable_Uri._is(t1) ? t1 : A._Future$value(t1, type$.nullable_Uri), $async$_async_import_cache0$_canonicalize$4); + case 10: + // returning from await. + result = $async$result; + if (result == null) { + $async$returnValue = null; + // goto return + $async$goto = 1; + break; + } + $async$goto = result.get$scheme() === "" ? 11 : 13; + break; + case 11: + // then + A.WarnForDeprecation_warnForDeprecation0($async$self._async_import_cache0$_logger, B.Deprecation_E5x, "Importer " + importer.toString$0(0) + " canonicalized " + url.toString$0(0) + " to " + result.toString$0(0) + string$.x2e_Rela, null, null); + // goto join + $async$goto = 12; + break; + case 13: + // else + t1 = A._Future$value(importer.isNonCanonicalScheme$1(result.get$scheme()), type$.bool); + $async$goto = 14; + return A._asyncAwait(t1, $async$_async_import_cache0$_canonicalize$4); + case 14: + // returning from await. + if ($async$result) + throw A.wrapException("Importer " + importer.toString$0(0) + " canonicalized " + url.toString$0(0) + " to " + result.toString$0(0) + string$.x2c_whicu); + case 12: + // join + $async$returnValue = new A._Record_3_originalUrl(importer, result, url); + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$_async_import_cache0$_canonicalize$4, $async$completer); + }, + importCanonical$4$originalUrl$quiet(importer, canonicalUrl, originalUrl, quiet) { + return this.importCanonical$body$AsyncImportCache0(importer, canonicalUrl, originalUrl, quiet); + }, + importCanonical$3$originalUrl(importer, canonicalUrl, originalUrl) { + return this.importCanonical$4$originalUrl$quiet(importer, canonicalUrl, originalUrl, false); + }, + importCanonical$body$AsyncImportCache0(importer, canonicalUrl, originalUrl, quiet) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.nullable_Stylesheet_2), + $async$returnValue, $async$self = this; + var $async$importCanonical$4$originalUrl$quiet = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$goto = 3; + return A._asyncAwait(A.putIfAbsentAsync0($async$self._async_import_cache0$_importCache, canonicalUrl, new A.AsyncImportCache_importCanonical_closure0($async$self, importer, canonicalUrl, originalUrl, quiet), type$.Uri, type$.nullable_Stylesheet_2), $async$importCanonical$4$originalUrl$quiet); + case 3: + // returning from await. + $async$returnValue = $async$result; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$importCanonical$4$originalUrl$quiet, $async$completer); + }, + humanize$1(canonicalUrl) { + var t1 = A.IterableNullableExtension_whereNotNull(this._async_import_cache0$_canonicalizeCache.get$values(0), type$.Record_3_AsyncImporter_and_Uri_and_Uri_originalUrl_2), + t2 = t1.$ti; + t2 = A.NullableExtension_andThen0(A.minBy(new A.MappedIterable(new A.WhereIterable(t1, new A.AsyncImportCache_humanize_closure3(canonicalUrl), t2._eval$1("WhereIterable")), new A.AsyncImportCache_humanize_closure4(), t2._eval$1("MappedIterable")), new A.AsyncImportCache_humanize_closure5()), new A.AsyncImportCache_humanize_closure6(canonicalUrl)); + return t2 == null ? canonicalUrl : t2; + }, + sourceMapUrl$1(_, canonicalUrl) { + var t1 = this._async_import_cache0$_resultsCache.$index(0, canonicalUrl); + t1 = t1 == null ? null : t1.get$sourceMapUrl(0); + return t1 == null ? canonicalUrl : t1; + } + }; + A.AsyncImportCache_canonicalize_closure1.prototype = { + call$0() { + var _this = this, + t1 = _this.baseUrl, + t2 = t1 == null ? null : t1.resolveUri$1(_this.url); + if (t2 == null) + t2 = _this.url; + return _this.$this._async_import_cache0$_canonicalize$4(_this.baseImporter, t2, t1, _this.forImport); + }, + $signature: 150 + }; + A.AsyncImportCache_canonicalize_closure2.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.nullable_Record_3_AsyncImporter_and_Uri_and_Uri_originalUrl_2), + $async$returnValue, $async$self = this, t1, t2, t3, t4, t5, t6, _i, _0_0; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.$this, t2 = t1._async_import_cache0$_importers, t3 = t2.length, t4 = $async$self.url, t5 = $async$self.baseUrl, t6 = $async$self.forImport, _i = 0; + case 3: + // for condition + if (!(_i < t2.length)) { + // goto after for + $async$goto = 5; + break; + } + $async$goto = 6; + return A._asyncAwait(t1._async_import_cache0$_canonicalize$4(t2[_i], t4, t5, t6), $async$call$0); + case 6: + // returning from await. + _0_0 = $async$result; + if (_0_0 != null) { + $async$returnValue = _0_0; + // goto return + $async$goto = 1; + break; + } + case 4: + // for update + t2.length === t3 || (0, A.throwConcurrentModificationError)(t2), ++_i; + // goto for condition + $async$goto = 3; + break; + case 5: + // after for + $async$returnValue = null; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 150 + }; + A.AsyncImportCache__canonicalize_closure1.prototype = { + call$0() { + var t1 = type$.nullable_Object; + return A.runZoned(new A.AsyncImportCache__canonicalize__closure0(this.importer, this.resolved), A.LinkedHashMap_LinkedHashMap$_literal([B.Symbol__inImportRule, true], t1, t1), type$.FutureOr_nullable_Uri); + }, + $signature: 61 + }; + A.AsyncImportCache__canonicalize__closure0.prototype = { + call$0() { + return this.importer.canonicalize$1(0, this.resolved); + }, + $signature: 61 + }; + A.AsyncImportCache__canonicalize_closure2.prototype = { + call$0() { + return this.importer.canonicalize$1(0, this.resolved); + }, + $signature: 61 + }; + A.AsyncImportCache_importCanonical_closure0.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.nullable_Stylesheet_2), + $async$returnValue, $async$self = this, t3, t4, t1, t2, result; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.canonicalUrl; + t2 = $async$self.importer.load$1(0, t1); + $async$goto = 3; + return A._asyncAwait(type$.Future_nullable_ImporterResult._is(t2) ? t2 : A._Future$value(t2, type$.nullable_ImporterResult_2), $async$call$0); + case 3: + // returning from await. + result = $async$result; + if (result == null) { + $async$returnValue = null; + // goto return + $async$goto = 1; + break; + } + t2 = $async$self.$this; + t2._async_import_cache0$_resultsCache.$indexSet(0, t1, result); + t3 = result.contents; + t4 = result.syntax; + t1 = $async$self.originalUrl.resolveUri$1(t1); + $async$returnValue = A.Stylesheet_Stylesheet$parse0(t3, t4, $async$self.quiet ? $.$get$Logger_quiet0() : t2._async_import_cache0$_logger, t1); + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 356 + }; + A.AsyncImportCache_humanize_closure3.prototype = { + call$1(result) { + return J.$eq$(result._1, this.canonicalUrl); + }, + $signature: 357 + }; + A.AsyncImportCache_humanize_closure4.prototype = { + call$1(result) { + return result._2; + }, + $signature: 358 + }; + A.AsyncImportCache_humanize_closure5.prototype = { + call$1(url) { + return url.get$path(url).length; + }, + $signature: 107 + }; + A.AsyncImportCache_humanize_closure6.prototype = { + call$1(url) { + var t1 = $.$get$url(), + t2 = this.canonicalUrl; + return url.resolve$1(0, A.ParsedPath_ParsedPath$parse(t2.get$path(t2), t1.style).get$basename()); + }, + $signature: 44 + }; + A.AtRootQueryParser0.prototype = { + parse$0() { + return this.wrapSpanFormatException$1(new A.AtRootQueryParser_parse_closure0(this)); + } + }; + A.AtRootQueryParser_parse_closure0.prototype = { + call$0() { + var include, atRules, + t1 = this.$this, + t2 = t1.scanner; + t2.expectChar$1(40); + t1.whitespace$0(); + include = t1.scanIdentifier$1("with"); + if (!include) + t1.expectIdentifier$2$name("without", '"with" or "without"'); + t1.whitespace$0(); + t2.expectChar$1(58); + t1.whitespace$0(); + atRules = A.LinkedHashSet_LinkedHashSet$_empty(type$.String); + do { + atRules.add$1(0, t1.identifier$0().toLowerCase()); + t1.whitespace$0(); + } while (t1.lookingAtIdentifier$0()); + t2.expectChar$1(41); + t2.expectDone$0(); + return new A.AtRootQuery0(include, atRules, atRules.contains$1(0, "all"), atRules.contains$1(0, "rule")); + }, + $signature: 359 + }; + A.AtRootQuery0.prototype = { + excludes$1(node) { + var t1, _this = this; + if (_this._at_root_query0$_all) + return !_this.include; + $label0$0: { + if (node instanceof A.ModifiableCssStyleRule0) { + t1 = _this._at_root_query0$_rule !== _this.include; + break $label0$0; + } + if (node instanceof A.ModifiableCssMediaRule0) { + t1 = _this.excludesName$1("media"); + break $label0$0; + } + if (node instanceof A.ModifiableCssSupportsRule0) { + t1 = _this.excludesName$1("supports"); + break $label0$0; + } + if (node instanceof A.ModifiableCssAtRule0) { + t1 = _this.excludesName$1(node.name.value.toLowerCase()); + break $label0$0; + } + t1 = false; + break $label0$0; + } + return t1; + }, + excludesName$1($name) { + var t1 = this._at_root_query0$_all || this.names.contains$1(0, $name); + return t1 !== this.include; + } + }; + A.AtRootRule0.prototype = { + accept$1$1(visitor) { + return visitor.visitAtRootRule$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + toString$0(_) { + var buffer = new A.StringBuffer("@at-root "), + t1 = this.query; + if (t1 != null) + buffer._contents = "@at-root " + (t1.toString$0(0) + " "); + t1 = this.children; + return buffer.toString$0(0) + " {" + (t1 && B.JSArray_methods).join$1(t1, " ") + "}"; + }, + get$span(receiver) { + return this.span; + } + }; + A.ModifiableCssAtRule0.prototype = { + accept$1$1(visitor) { + return visitor.visitCssAtRule$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + equalsIgnoringChildren$1(other) { + var t1, t2; + if (other instanceof A.ModifiableCssAtRule0) { + t1 = this.name; + t2 = other.name; + t1 = t1.$ti._is(t2) && J.$eq$(t2.value, t1.value) && J.$eq$(this.value, other.value) && this.isChildless === other.isChildless; + } else + t1 = false; + return t1; + }, + copyWithoutChildren$0() { + var _this = this; + return A.ModifiableCssAtRule$0(_this.name, _this.span, _this.isChildless, _this.value); + }, + addChild$1(child) { + this.super$ModifiableCssParentNode$addChild0(child); + }, + get$isChildless() { + return this.isChildless; + }, + get$span(receiver) { + return this.span; + } + }; + A.AtRule0.prototype = { + accept$1$1(visitor) { + return visitor.visitAtRule$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + toString$0(_) { + var children, + t1 = "@" + this.name.toString$0(0), + buffer = new A.StringBuffer(t1), + t2 = this.value; + if (t2 != null) + buffer._contents = t1 + (" " + t2.toString$0(0)); + children = this.children; + return children == null ? buffer.toString$0(0) + ";" : buffer.toString$0(0) + " {" + B.JSArray_methods.join$1(children, " ") + "}"; + }, + get$span(receiver) { + return this.span; + } + }; + A.AttributeSelector0.prototype = { + accept$1$1(visitor) { + return visitor.visitAttributeSelector$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + $eq(_, other) { + var _this = this; + if (other == null) + return false; + return other instanceof A.AttributeSelector0 && other.name.$eq(0, _this.name) && other.op == _this.op && other.value == _this.value && other.modifier == _this.modifier; + }, + get$hashCode(_) { + var _this = this, + t1 = _this.name; + return (B.JSString_methods.get$hashCode(t1.name) ^ J.get$hashCode$(t1.namespace) ^ J.get$hashCode$(_this.op) ^ J.get$hashCode$(_this.value) ^ J.get$hashCode$(_this.modifier)) >>> 0; + } + }; + A.AttributeOperator0.prototype = { + _enumToString$0() { + return "AttributeOperator." + this._name; + }, + toString$0(_) { + return this._attribute0$_text; + } + }; + A.BinaryOperationExpression0.prototype = { + get$span(_) { + var right, + left = this.left; + for (; left instanceof A.BinaryOperationExpression0;) + left = left.left; + right = this.right; + for (; right instanceof A.BinaryOperationExpression0;) + right = right.right; + return left.get$span(left).expand$1(0, right.get$span(right)); + }, + get$operatorSpan() { + var t3, t4, + t1 = this.left, + t2 = t1.get$span(t1); + t2 = t2.get$file(t2); + t3 = this.right; + t4 = t3.get$span(t3); + if (t2 === t4.get$file(t4)) { + t2 = t1.get$span(t1); + t2 = t2.get$end(t2); + t4 = t3.get$span(t3); + t4 = t2.offset < t4.get$start(t4).offset; + t2 = t4; + } else + t2 = false; + if (t2) { + t2 = t1.get$span(t1); + t2 = t2.get$file(t2); + t1 = t1.get$span(t1); + t1 = t1.get$end(t1); + t3 = t3.get$span(t3); + t3 = A.SpanExtensions_trimRight0(A.SpanExtensions_trimLeft0(t2.span$2(0, t1.offset, t3.get$start(t3).offset))); + t1 = t3; + } else + t1 = this.get$span(0); + return t1; + }, + accept$1$1(visitor) { + return visitor.visitBinaryOperationExpression$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + toString$0(_) { + var t1, t2, right, operator, t3, _this = this, + _0_0 = _this.left; + $label0$0: { + if (_0_0 instanceof A.BinaryOperationExpression0) { + t1 = _0_0.operator.precedence < _this.operator.precedence; + break $label0$0; + } + if (_0_0 instanceof A.ListExpression0 && !_0_0.hasBrackets && _0_0.contents.length >= 2) { + t1 = true; + break $label0$0; + } + t1 = false; + break $label0$0; + } + t2 = t1 ? "" + A.Primitives_stringFromCharCode(40) : ""; + t2 += _0_0.toString$0(0); + t1 = t1 ? t2 + A.Primitives_stringFromCharCode(41) : t2; + t2 = _this.operator; + t1 = t1 + A.Primitives_stringFromCharCode(32) + t2.operator + A.Primitives_stringFromCharCode(32); + right = _this.right; + $label1$1: { + if (right instanceof A.BinaryOperationExpression0) { + operator = right.operator; + if (operator.precedence <= t2.precedence) { + t3 = !(operator === t2 && operator.isAssociative); + t2 = t3; + } else + t2 = false; + break $label1$1; + } + if (right instanceof A.ListExpression0 && !right.hasBrackets && right.contents.length >= 2) { + t2 = true; + break $label1$1; + } + t2 = false; + break $label1$1; + } + if (t2) + t1 += A.Primitives_stringFromCharCode(40); + t1 += right.toString$0(0); + if (t2) + t1 += A.Primitives_stringFromCharCode(41); + return t1.charCodeAt(0) == 0 ? t1 : t1; + }, + $isExpression0: 1, + $isAstNode0: 1 + }; + A.BinaryOperator0.prototype = { + _enumToString$0() { + return "BinaryOperator." + this._name; + }, + toString$0(_) { + return this.name; + } + }; + A.BooleanExpression0.prototype = { + accept$1$1(visitor) { + return visitor.visitBooleanExpression$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + toString$0(_) { + return String(this.value); + }, + $isExpression0: 1, + $isAstNode0: 1, + get$span(receiver) { + return this.span; + } + }; + A.booleanClass_closure.prototype = { + call$0() { + var t1 = type$.JSClass, + jsClass = t1._as(A.allowInteropCaptureThisNamed("sass.SassBoolean", new A.booleanClass__closure())); + A.JSClassExtension_injectSuperclass(t1._as(B.SassBoolean_true0.constructor), jsClass); + return jsClass; + }, + $signature: 13 + }; + A.booleanClass__closure.prototype = { + call$2($self, _) { + A.jsThrow(new self.Error("new sass.SassBoolean() isn't allowed.\nUse sass.sassTrue or sass.sassFalse instead.")); + }, + call$1($self) { + return this.call$2($self, null); + }, + "call*": "call$2", + $requiredArgCount: 1, + $defaultValues() { + return [null]; + }, + $signature: 149 + }; + A.legacyBooleanClass_closure.prototype = { + call$0() { + var t1 = type$.JSClass, + jsClass = t1._as(A.allowInteropCaptureThisNamed("sass.types.Boolean", new A.legacyBooleanClass__closure())); + J.get$$prototype$x(jsClass).getValue = A.allowInteropCaptureThisNamed("getValue", new A.legacyBooleanClass__closure0()); + jsClass.TRUE = B.SassBoolean_true0; + jsClass.FALSE = B.SassBoolean_false0; + A.JSClassExtension_injectSuperclass(t1._as(B.SassBoolean_true0.constructor), jsClass); + return jsClass; + }, + $signature: 13 + }; + A.legacyBooleanClass__closure.prototype = { + call$2(_, __) { + throw A.wrapException("new sass.types.Boolean() isn't allowed.\nUse sass.types.Boolean.TRUE or sass.types.Boolean.FALSE instead."); + }, + call$1(_) { + return this.call$2(_, null); + }, + "call*": "call$2", + $requiredArgCount: 1, + $defaultValues() { + return [null]; + }, + $signature: 145 + }; + A.legacyBooleanClass__closure0.prototype = { + call$1($self) { + return $self === B.SassBoolean_true0; + }, + $signature: 71 + }; + A.SassBoolean0.prototype = { + get$isTruthy() { + return this.value; + }, + accept$1$1(visitor) { + return visitor._serialize0$_buffer.write$1(0, String(this.value)); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + assertBoolean$1($name) { + return this; + }, + unaryNot$0() { + return this.value ? B.SassBoolean_false0 : B.SassBoolean_true0; + } + }; + A.Box0.prototype = { + $eq(_, other) { + if (other == null) + return false; + return this.$ti._is(other) && other._box0$_inner === this._box0$_inner; + }, + get$hashCode(_) { + return A.Primitives_objectHashCode(this._box0$_inner); + } + }; + A.ModifiableBox0.prototype = {}; + A.BuiltInCallable0.prototype = { + callbackFor$2(positional, names) { + var t1, t2, fuzzyMatch, minMismatchDistance, _i, overload, t3, mismatchDistance, t4; + for (t1 = this._built_in$_overloads, t2 = t1.length, fuzzyMatch = null, minMismatchDistance = null, _i = 0; _i < t1.length; t1.length === t2 || (0, A.throwConcurrentModificationError)(t1), ++_i) { + overload = t1[_i]; + t3 = overload._0; + if (t3.matches$2(positional, names)) + return overload; + mismatchDistance = t3.$arguments.length - positional; + if (minMismatchDistance != null) { + t3 = Math.abs(mismatchDistance); + t4 = Math.abs(minMismatchDistance); + if (t3 > t4) + continue; + if (t3 === t4 && mismatchDistance < 0) + continue; + } + minMismatchDistance = mismatchDistance; + fuzzyMatch = overload; + } + if (fuzzyMatch != null) + return fuzzyMatch; + throw A.wrapException(A.StateError$("BuiltInCallable " + this.name + " may not have empty overloads.")); + }, + withName$1($name) { + return new A.BuiltInCallable0($name, this._built_in$_overloads, this.acceptsContent); + }, + $isAsyncCallable0: 1, + $isAsyncBuiltInCallable0: 1, + $isCallable: 1, + get$name(receiver) { + return this.name; + }, + get$acceptsContent() { + return this.acceptsContent; + } + }; + A.BuiltInCallable$mixin_closure0.prototype = { + call$1($arguments) { + this.callback.call$1($arguments); + return B.C__SassNull0; + }, + $signature: 3 + }; + A.BuiltInModule0.prototype = { + get$upstream() { + return B.List_empty18; + }, + get$variableNodes() { + return B.Map_empty12; + }, + get$extensionStore() { + return B.C_EmptyExtensionStore0; + }, + get$css(_) { + return new A.CssStylesheet0(B.List_empty16, A.SourceFile$decoded(B.List_empty4, this.url).span$2(0, 0, 0)); + }, + get$preModuleComments() { + return B.Map_empty11; + }, + get$transitivelyContainsCss() { + return false; + }, + get$transitivelyContainsExtensions() { + return false; + }, + setVariable$3($name, value, nodeWithSpan) { + if (!this.variables.containsKey$1($name)) + throw A.wrapException(A.SassScriptException$0("Undefined variable.", null)); + throw A.wrapException(A.SassScriptException$0("Cannot modify built-in variable.", null)); + }, + variableIdentity$1($name) { + return this; + }, + cloneCss$0() { + return this; + }, + $isModule1: 1, + get$url(receiver) { + return this.url; + }, + get$functions(receiver) { + return this.functions; + }, + get$mixins() { + return this.mixins; + }, + get$variables() { + return this.variables; + } + }; + A.calculationClass_closure.prototype = { + call$0() { + var t1 = type$.JSClass, + jsClass = t1._as(A.allowInteropCaptureThisNamed("sass.SassCalculation", new A.calculationClass__closure())), + t2 = type$.String, + t3 = type$.Function; + A.LinkedHashMap_LinkedHashMap$_literal(["calc", new A.calculationClass__closure0(), "min", new A.calculationClass__closure1(), "max", new A.calculationClass__closure2(), "clamp", new A.calculationClass__closure3()], t2, t3).forEach$1(0, A.JSClassExtension_get_defineStaticMethod(jsClass)); + A.LinkedHashMap_LinkedHashMap$_literal(["assertCalculation", new A.calculationClass__closure4()], t2, t3).forEach$1(0, A.JSClassExtension_get_defineMethod(jsClass)); + A.LinkedHashMap_LinkedHashMap$_literal(["arguments", new A.calculationClass__closure5()], t2, t3).forEach$1(0, A.JSClassExtension_get_defineGetter(jsClass)); + A.JSClassExtension_injectSuperclass(t1._as(new A.SassCalculation0("calc", A.List_List$unmodifiable(A._setArrayType([A.SassNumber_SassNumber0(1, null)], type$.JSArray_Object), type$.Object)).constructor), jsClass); + return jsClass; + }, + $signature: 13 + }; + A.calculationClass__closure.prototype = { + call$2($self, _) { + A.jsThrow0(new self.Error("new sass.SassCalculation() isn't allowed")); + }, + call$1($self) { + return this.call$2($self, null); + }, + "call*": "call$2", + $requiredArgCount: 1, + $defaultValues() { + return [null]; + }, + $signature: 149 + }; + A.calculationClass__closure0.prototype = { + call$1(argument) { + A._assertCalculationValue(argument); + return new A.SassCalculation0("calc", A.List_List$unmodifiable(A._setArrayType([argument], type$.JSArray_Object), type$.Object)); + }, + $signature: 140 + }; + A.calculationClass__closure1.prototype = { + call$1($arguments) { + var t1 = self.immutable.isOrderedMap($arguments) ? J.toArray$0$x(type$.ImmutableList_2._as($arguments)) : type$.List_dynamic._as($arguments), + t2 = type$.Object, + argList = J.cast$1$0$ax(t1, t2); + argList.forEach$1(argList, A.calculation1___assertCalculationValue$closure()); + return new A.SassCalculation0("min", A.List_List$unmodifiable(argList, t2)); + }, + $signature: 140 + }; + A.calculationClass__closure2.prototype = { + call$1($arguments) { + var t1 = self.immutable.isOrderedMap($arguments) ? J.toArray$0$x(type$.ImmutableList_2._as($arguments)) : type$.List_dynamic._as($arguments), + t2 = type$.Object, + argList = J.cast$1$0$ax(t1, t2); + argList.forEach$1(argList, A.calculation1___assertCalculationValue$closure()); + return new A.SassCalculation0("max", A.List_List$unmodifiable(argList, t2)); + }, + $signature: 140 + }; + A.calculationClass__closure3.prototype = { + call$3(min, value, max) { + var t1; + if (!(value == null && !A._isValidClampArg(min))) + t1 = max == null && !B.JSArray_methods.any$1([min, value], A.calculation1___isValidClampArg$closure()); + else + t1 = true; + if (t1) + A.jsThrow0(new self.Error("Expected at least one SassString or CalculationInterpolation in `" + A.IterableNullableExtension_whereNotNull([min, value, max], type$.Object).toString$0(0) + "`")); + t1 = type$.Object; + A.IterableNullableExtension_whereNotNull([min, value, max], t1).forEach$1(0, A.calculation1___assertCalculationValue$closure()); + return new A.SassCalculation0("clamp", A.List_List$unmodifiable(A.IterableNullableExtension_whereNotNull([min, value, max], t1), t1)); + }, + call$1(min) { + return this.call$3(min, null, null); + }, + call$2(min, value) { + return this.call$3(min, value, null); + }, + "call*": "call$3", + $requiredArgCount: 1, + $defaultValues() { + return [null, null]; + }, + $signature: 364 + }; + A.calculationClass__closure4.prototype = { + call$2($self, $name) { + return $self; + }, + call$1($self) { + return this.call$2($self, null); + }, + "call*": "call$2", + $requiredArgCount: 1, + $defaultValues() { + return [null]; + }, + $signature: 365 + }; + A.calculationClass__closure5.prototype = { + call$1($self) { + return new self.immutable.List($self.$arguments); + }, + $signature: 366 + }; + A.calculationOperationClass_closure.prototype = { + call$0() { + var t1 = type$.JSClass, + jsClass = t1._as(A.allowInteropCaptureThisNamed("sass.CalculationOperation", new A.calculationOperationClass__closure())), + t2 = type$.String, + t3 = type$.Function; + A.LinkedHashMap_LinkedHashMap$_literal(["equals", new A.calculationOperationClass__closure0(), "hashCode", new A.calculationOperationClass__closure1()], t2, t3).forEach$1(0, A.JSClassExtension_get_defineMethod(jsClass)); + A.LinkedHashMap_LinkedHashMap$_literal(["operator", new A.calculationOperationClass__closure2(), "left", new A.calculationOperationClass__closure3(), "right", new A.calculationOperationClass__closure4()], t2, t3).forEach$1(0, A.JSClassExtension_get_defineGetter(jsClass)); + A.JSClassExtension_injectSuperclass(t1._as(A.SassCalculation_operateInternal0(B.CalculationOperator_IyK0, A.SassNumber_SassNumber0(1, null), A.SassNumber_SassNumber0(1, null), false, false).constructor), jsClass); + return jsClass; + }, + $signature: 13 + }; + A.calculationOperationClass__closure.prototype = { + call$4($self, strOperator, left, right) { + var operator = A.IterableExtension_firstWhereOrNull(B.List_cUt, new A.calculationOperationClass___closure(strOperator)); + if (operator == null) + A.jsThrow0(new self.Error("Invalid operator: " + strOperator)); + A._assertCalculationValue(left); + A._assertCalculationValue(right); + return A.SassCalculation_operateInternal0(operator, left, right, false, false); + }, + "call*": "call$4", + $requiredArgCount: 4, + $signature: 367 + }; + A.calculationOperationClass___closure.prototype = { + call$1(value) { + return value.operator === this.strOperator; + }, + $signature: 368 + }; + A.calculationOperationClass__closure0.prototype = { + call$2($self, other) { + return $self.$eq(0, other); + }, + $signature: 369 + }; + A.calculationOperationClass__closure1.prototype = { + call$1($self) { + return $self.get$hashCode(0); + }, + $signature: 370 + }; + A.calculationOperationClass__closure2.prototype = { + call$1($self) { + return $self._calculation0$_operator.operator; + }, + $signature: 371 + }; + A.calculationOperationClass__closure3.prototype = { + call$1($self) { + return $self._calculation0$_left; + }, + $signature: 143 + }; + A.calculationOperationClass__closure4.prototype = { + call$1($self) { + return $self._calculation0$_right; + }, + $signature: 143 + }; + A.calculationInterpolationClass_closure.prototype = { + call$0() { + var t1 = type$.JSClass, + jsClass = t1._as(A.allowInteropCaptureThisNamed("sass.CalculationInterpolation", new A.calculationInterpolationClass__closure())), + t2 = type$.String, + t3 = type$.Function; + A.LinkedHashMap_LinkedHashMap$_literal(["equals", new A.calculationInterpolationClass__closure0(), "hashCode", new A.calculationInterpolationClass__closure1()], t2, t3).forEach$1(0, A.JSClassExtension_get_defineMethod(jsClass)); + A.LinkedHashMap_LinkedHashMap$_literal(["value", new A.calculationInterpolationClass__closure2()], t2, t3).forEach$1(0, A.JSClassExtension_get_defineGetter(jsClass)); + A.JSClassExtension_injectSuperclass(t1._as(new A.CalculationInterpolation("").constructor), jsClass); + return jsClass; + }, + $signature: 13 + }; + A.calculationInterpolationClass__closure.prototype = { + call$2($self, value) { + return new A.CalculationInterpolation(value); + }, + $signature: 373 + }; + A.calculationInterpolationClass__closure0.prototype = { + call$2($self, other) { + return other instanceof A.CalculationInterpolation && $self._calculation0$_value === other._calculation0$_value; + }, + $signature: 374 + }; + A.calculationInterpolationClass__closure1.prototype = { + call$1($self) { + return B.JSString_methods.get$hashCode($self._calculation0$_value); + }, + $signature: 375 + }; + A.calculationInterpolationClass__closure2.prototype = { + call$1($self) { + return $self._calculation0$_value; + }, + $signature: 376 + }; + A.SassCalculation0.prototype = { + get$isSpecialNumber() { + return true; + }, + accept$1$1(visitor) { + return visitor.visitCalculation$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + assertCalculation$1($name) { + return this; + }, + plus$1(other) { + if (other instanceof A.SassString0) + return this.super$Value$plus0(other); + throw A.wrapException(A.SassScriptException$0('Undefined operation "' + this.toString$0(0) + " + " + other.toString$0(0) + '".', null)); + }, + minus$1(other) { + return A.throwExpression(A.SassScriptException$0('Undefined operation "' + this.toString$0(0) + " - " + other.toString$0(0) + '".', null)); + }, + unaryPlus$0() { + return A.throwExpression(A.SassScriptException$0('Undefined operation "+' + this.toString$0(0) + '".', null)); + }, + unaryMinus$0() { + return A.throwExpression(A.SassScriptException$0('Undefined operation "-' + this.toString$0(0) + '".', null)); + }, + $eq(_, other) { + if (other == null) + return false; + return other instanceof A.SassCalculation0 && this.name === other.name && B.C_ListEquality.equals$2(0, this.$arguments, other.$arguments); + }, + get$hashCode(_) { + return B.JSString_methods.get$hashCode(this.name) ^ B.C_ListEquality0.hash$1(this.$arguments); + } + }; + A.SassCalculation__verifyLength_closure0.prototype = { + call$1(arg) { + return arg instanceof A.SassString0; + }, + $signature: 71 + }; + A.CalculationOperation0.prototype = { + $eq(_, other) { + if (other == null) + return false; + return other instanceof A.CalculationOperation0 && this._calculation0$_operator === other._calculation0$_operator && J.$eq$(this._calculation0$_left, other._calculation0$_left) && J.$eq$(this._calculation0$_right, other._calculation0$_right); + }, + get$hashCode(_) { + return (A.Primitives_objectHashCode(this._calculation0$_operator) ^ J.get$hashCode$(this._calculation0$_left) ^ J.get$hashCode$(this._calculation0$_right)) >>> 0; + }, + toString$0(_) { + var parenthesized = A.serializeValue0(new A.SassCalculation0("", A._setArrayType([this], type$.JSArray_Object)), true, true); + return B.JSString_methods.substring$2(parenthesized, 1, parenthesized.length - 1); + } + }; + A.CalculationOperator0.prototype = { + _enumToString$0() { + return "CalculationOperator." + this._name; + }, + toString$0(_) { + return this.name; + } + }; + A.CalculationInterpolation.prototype = { + $eq(_, other) { + if (other == null) + return false; + return other instanceof A.CalculationInterpolation && this._calculation0$_value === other._calculation0$_value; + }, + get$hashCode(_) { + return B.JSString_methods.get$hashCode(this._calculation0$_value); + }, + toString$0(_) { + return this._calculation0$_value; + } + }; + A.CallableDeclaration0.prototype = { + get$span(receiver) { + return this.span; + } + }; + A.Chokidar0.prototype = {}; + A.ChokidarOptions0.prototype = {}; + A.ChokidarWatcher0.prototype = {}; + A.ClassSelector0.prototype = { + $eq(_, other) { + if (other == null) + return false; + return other instanceof A.ClassSelector0 && other.name === this.name; + }, + accept$1$1(visitor) { + return visitor.visitClassSelector$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + addSuffix$1(suffix) { + return new A.ClassSelector0(this.name + suffix, this.span); + }, + get$hashCode(_) { + return B.JSString_methods.get$hashCode(this.name); + } + }; + A._CloneCssVisitor0.prototype = { + visitCssAtRule$1(node) { + var t1 = node.isChildless, + rule = A.ModifiableCssAtRule$0(node.name, node.span, t1, node.value); + return t1 ? rule : this._clone_css$_visitChildren$2(rule, node); + }, + visitCssComment$1(node) { + return new A.ModifiableCssComment0(node.text, node.span); + }, + visitCssDeclaration$1(node) { + return A.ModifiableCssDeclaration$0(node.name, node.value, node.span, node.parsedAsCustomProperty, node.valueSpanForMap); + }, + visitCssImport$1(node) { + return new A.ModifiableCssImport0(node.url, node.modifiers, node.span); + }, + visitCssKeyframeBlock$1(node) { + return this._clone_css$_visitChildren$2(A.ModifiableCssKeyframeBlock$0(node.selector, node.span), node); + }, + visitCssMediaRule$1(node) { + return this._clone_css$_visitChildren$2(A.ModifiableCssMediaRule$0(node.queries, node.span), node); + }, + visitCssStyleRule$1(node) { + var _0_0 = this._clone_css$_oldToNewSelectors.$index(0, node._style_rule0$_selector._box0$_inner.value); + if (_0_0 != null) + return this._clone_css$_visitChildren$2(A.ModifiableCssStyleRule$0(_0_0, node.span, node.originalSelector), node); + else + throw A.wrapException(A.StateError$(string$.The_Ex)); + }, + visitCssStylesheet$1(node) { + return this._clone_css$_visitChildren$2(A.ModifiableCssStylesheet$0(node.get$span(node)), node); + }, + visitCssSupportsRule$1(node) { + return this._clone_css$_visitChildren$2(A.ModifiableCssSupportsRule$0(node.condition, node.span), node); + }, + _clone_css$_visitChildren$1$2(newParent, oldParent) { + var t1, t2, newChild; + for (t1 = J.get$iterator$ax(oldParent.get$children(oldParent)); t1.moveNext$0();) { + t2 = t1.get$current(t1); + newChild = t2.accept$1(this); + newChild.isGroupEnd = t2.get$isGroupEnd(); + newParent.addChild$1(newChild); + } + return newParent; + }, + _clone_css$_visitChildren$2(newParent, oldParent) { + return this._clone_css$_visitChildren$1$2(newParent, oldParent, type$.ModifiableCssParentNode_2); + } + }; + A.ColorExpression0.prototype = { + accept$1$1(visitor) { + return visitor.visitColorExpression$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + toString$0(_) { + return A.serializeValue0(this.value, true, true); + }, + $isExpression0: 1, + $isAstNode0: 1, + get$span(receiver) { + return this.span; + } + }; + A.global_closure32.prototype = { + call$1($arguments) { + return A._rgb0("rgb", $arguments); + }, + $signature: 3 + }; + A.global_closure33.prototype = { + call$1($arguments) { + return A._rgb0("rgb", $arguments); + }, + $signature: 3 + }; + A.global_closure34.prototype = { + call$1($arguments) { + return A._rgbTwoArg0("rgb", $arguments); + }, + $signature: 3 + }; + A.global_closure35.prototype = { + call$1($arguments) { + var parsed = A._parseChannels0("rgb", A._setArrayType(["$red", "$green", "$blue"], type$.JSArray_String), J.get$first$ax($arguments)); + return parsed instanceof A.SassString0 ? parsed : A._rgb0("rgb", type$.List_Value_2._as(parsed)); + }, + $signature: 3 + }; + A.global_closure36.prototype = { + call$1($arguments) { + return A._rgb0("rgba", $arguments); + }, + $signature: 3 + }; + A.global_closure37.prototype = { + call$1($arguments) { + return A._rgb0("rgba", $arguments); + }, + $signature: 3 + }; + A.global_closure38.prototype = { + call$1($arguments) { + return A._rgbTwoArg0("rgba", $arguments); + }, + $signature: 3 + }; + A.global_closure39.prototype = { + call$1($arguments) { + var parsed = A._parseChannels0("rgba", A._setArrayType(["$red", "$green", "$blue"], type$.JSArray_String), J.get$first$ax($arguments)); + return parsed instanceof A.SassString0 ? parsed : A._rgb0("rgba", type$.List_Value_2._as(parsed)); + }, + $signature: 3 + }; + A.global_closure40.prototype = { + call$1($arguments) { + var color, t2, + t1 = J.getInterceptor$asx($arguments), + weight = t1.$index($arguments, 1).assertNumber$1("weight"); + if (t1.$index($arguments, 0) instanceof A.SassNumber0 || t1.$index($arguments, 0).get$isSpecialNumber()) { + if (weight._number1$_value !== 100 || !weight.hasUnit$1("%")) + throw A.wrapException(string$.Only_oa); + return A._functionString0("invert", t1.take$1($arguments, 1)); + } + color = t1.$index($arguments, 0).assertColor$1("color"); + t1 = color.get$red(0); + t2 = color.get$green(0); + return A._mixColors0(color.changeRgb$3$blue$green$red(255 - color.get$blue(0), 255 - t2, 255 - t1), color, weight); + }, + $signature: 3 + }; + A.global_closure41.prototype = { + call$1($arguments) { + return A._hsl0("hsl", $arguments); + }, + $signature: 3 + }; + A.global_closure42.prototype = { + call$1($arguments) { + return A._hsl0("hsl", $arguments); + }, + $signature: 3 + }; + A.global_closure43.prototype = { + call$1($arguments) { + var t1 = J.getInterceptor$asx($arguments); + if (t1.$index($arguments, 0).get$isVar() || t1.$index($arguments, 1).get$isVar()) + return A._functionString0("hsl", $arguments); + else + throw A.wrapException(A.SassScriptException$0("Missing argument $lightness.", null)); + }, + $signature: 17 + }; + A.global_closure44.prototype = { + call$1($arguments) { + var parsed = A._parseChannels0("hsl", A._setArrayType(["$hue", "$saturation", "$lightness"], type$.JSArray_String), J.get$first$ax($arguments)); + return parsed instanceof A.SassString0 ? parsed : A._hsl0("hsl", type$.List_Value_2._as(parsed)); + }, + $signature: 3 + }; + A.global_closure45.prototype = { + call$1($arguments) { + return A._hsl0("hsla", $arguments); + }, + $signature: 3 + }; + A.global_closure46.prototype = { + call$1($arguments) { + return A._hsl0("hsla", $arguments); + }, + $signature: 3 + }; + A.global_closure47.prototype = { + call$1($arguments) { + var t1 = J.getInterceptor$asx($arguments); + if (t1.$index($arguments, 0).get$isVar() || t1.$index($arguments, 1).get$isVar()) + return A._functionString0("hsla", $arguments); + else + throw A.wrapException(A.SassScriptException$0("Missing argument $lightness.", null)); + }, + $signature: 17 + }; + A.global_closure48.prototype = { + call$1($arguments) { + var parsed = A._parseChannels0("hsla", A._setArrayType(["$hue", "$saturation", "$lightness"], type$.JSArray_String), J.get$first$ax($arguments)); + return parsed instanceof A.SassString0 ? parsed : A._hsl0("hsla", type$.List_Value_2._as(parsed)); + }, + $signature: 3 + }; + A.global_closure49.prototype = { + call$1($arguments) { + var t1 = J.getInterceptor$asx($arguments); + if (t1.$index($arguments, 0) instanceof A.SassNumber0 || t1.$index($arguments, 0).get$isSpecialNumber()) + return A._functionString0("grayscale", $arguments); + return t1.$index($arguments, 0).assertColor$1("color").changeHsl$1$saturation(0); + }, + $signature: 3 + }; + A.global_closure50.prototype = { + call$1($arguments) { + var t1 = J.getInterceptor$asx($arguments), + color = t1.$index($arguments, 0).assertColor$1("color"), + degrees = A._angleValue0(t1.$index($arguments, 1), "degrees"); + return color.changeHsl$1$hue(color.get$hue(0) + degrees); + }, + $signature: 29 + }; + A.global_closure51.prototype = { + call$1($arguments) { + var t1 = J.getInterceptor$asx($arguments), + color = t1.$index($arguments, 0).assertColor$1("color"), + amount = t1.$index($arguments, 1).assertNumber$1("amount"); + return color.changeHsl$1$lightness(B.JSNumber_methods.clamp$2(color.get$lightness(0) + amount.valueInRange$3(0, 100, "amount"), 0, 100)); + }, + $signature: 29 + }; + A.global_closure52.prototype = { + call$1($arguments) { + var t1 = J.getInterceptor$asx($arguments), + color = t1.$index($arguments, 0).assertColor$1("color"), + amount = t1.$index($arguments, 1).assertNumber$1("amount"); + return color.changeHsl$1$lightness(B.JSNumber_methods.clamp$2(color.get$lightness(0) - amount.valueInRange$3(0, 100, "amount"), 0, 100)); + }, + $signature: 29 + }; + A.global_closure53.prototype = { + call$1($arguments) { + var t1 = J.getInterceptor$asx($arguments); + if (t1.$index($arguments, 0) instanceof A.SassNumber0 || t1.$index($arguments, 0).get$isSpecialNumber()) + return A._functionString0("saturate", $arguments); + return new A.SassString0("saturate(" + A.serializeValue0(t1.$index($arguments, 0).assertNumber$1("amount"), false, true) + ")", false); + }, + $signature: 17 + }; + A.global_closure54.prototype = { + call$1($arguments) { + var t1 = J.getInterceptor$asx($arguments), + color = t1.$index($arguments, 0).assertColor$1("color"), + amount = t1.$index($arguments, 1).assertNumber$1("amount"); + return color.changeHsl$1$saturation(B.JSNumber_methods.clamp$2(color.get$saturation(0) + amount.valueInRange$3(0, 100, "amount"), 0, 100)); + }, + $signature: 29 + }; + A.global_closure55.prototype = { + call$1($arguments) { + var t1 = J.getInterceptor$asx($arguments), + color = t1.$index($arguments, 0).assertColor$1("color"), + amount = t1.$index($arguments, 1).assertNumber$1("amount"); + return color.changeHsl$1$saturation(B.JSNumber_methods.clamp$2(color.get$saturation(0) - amount.valueInRange$3(0, 100, "amount"), 0, 100)); + }, + $signature: 29 + }; + A.global_closure56.prototype = { + call$1($arguments) { + var argument = J.$index$asx($arguments, 0); + if (argument instanceof A.SassString0 && !argument._string0$_hasQuotes && B.JSString_methods.contains$1(argument._string0$_text, $.$get$_microsoftFilterStart0())) + return A._functionString0("alpha", $arguments); + return A.SassNumber_SassNumber0(argument.assertColor$1("color")._color1$_alpha, null); + }, + $signature: 3 + }; + A.global_closure57.prototype = { + call$1($arguments) { + var t1, + argList = J.$index$asx($arguments, 0).get$asList(); + if (argList.length !== 0 && B.JSArray_methods.every$1(argList, new A.global__closure0())) + return A._functionString0("alpha", $arguments); + t1 = argList.length; + if (t1 === 0) + throw A.wrapException(A.SassScriptException$0("Missing argument $color.", null)); + else + throw A.wrapException(A.SassScriptException$0("Only 1 argument allowed, but " + t1 + " were passed.", null)); + }, + $signature: 17 + }; + A.global__closure0.prototype = { + call$1(argument) { + return argument instanceof A.SassString0 && !argument._string0$_hasQuotes && B.JSString_methods.contains$1(argument._string0$_text, $.$get$_microsoftFilterStart0()); + }, + $signature: 49 + }; + A.global_closure58.prototype = { + call$1($arguments) { + var t1 = J.getInterceptor$asx($arguments); + if (t1.$index($arguments, 0) instanceof A.SassNumber0 || t1.$index($arguments, 0).get$isSpecialNumber()) + return A._functionString0("opacity", $arguments); + return A.SassNumber_SassNumber0(t1.$index($arguments, 0).assertColor$1("color")._color1$_alpha, null); + }, + $signature: 3 + }; + A.module_closure12.prototype = { + call$1($arguments) { + var result, t2, color, + t1 = J.getInterceptor$asx($arguments), + weight = t1.$index($arguments, 1).assertNumber$1("weight"); + if (t1.$index($arguments, 0) instanceof A.SassNumber0) { + if (weight._number1$_value !== 100 || !weight.hasUnit$1("%")) + throw A.wrapException(string$.Only_oa); + result = A._functionString0("invert", t1.take$1($arguments, 1)); + t1 = A.S(t1.$index($arguments, 0)); + t2 = result.toString$0(0); + A.EvaluationContext_current0().warn$2(0, "Passing a number (" + t1 + string$.x29x20to_ci + t2, B.Deprecation_LT8); + return result; + } + color = t1.$index($arguments, 0).assertColor$1("color"); + t1 = color.get$red(0); + t2 = color.get$green(0); + return A._mixColors0(color.changeRgb$3$blue$green$red(255 - color.get$blue(0), 255 - t2, 255 - t1), color, weight); + }, + $signature: 3 + }; + A.module_closure13.prototype = { + call$1($arguments) { + var result, t2, + t1 = J.getInterceptor$asx($arguments); + if (t1.$index($arguments, 0) instanceof A.SassNumber0) { + result = A._functionString0("grayscale", t1.take$1($arguments, 1)); + t1 = A.S(t1.$index($arguments, 0)); + t2 = result.toString$0(0); + A.EvaluationContext_current0().warn$2(0, "Passing a number (" + t1 + string$.x29x20to_cg + t2, B.Deprecation_LT8); + return result; + } + return t1.$index($arguments, 0).assertColor$1("color").changeHsl$1$saturation(0); + }, + $signature: 3 + }; + A.module_closure14.prototype = { + call$1($arguments) { + return A._hwb0($arguments); + }, + $signature: 3 + }; + A.module_closure15.prototype = { + call$1($arguments) { + var parsed = A._parseChannels0("hwb", A._setArrayType(["$hue", "$whiteness", "$blackness"], type$.JSArray_String), J.get$first$ax($arguments)); + if (parsed instanceof A.SassString0) + throw A.wrapException(A.SassScriptException$0('Expected numeric channels, got "' + parsed.toString$0(0) + '".', null)); + else + return A._hwb0(type$.List_Value_2._as(parsed)); + }, + $signature: 3 + }; + A.module_closure16.prototype = { + call$1($arguments) { + return A.SassNumber_SassNumber0(J.get$first$ax($arguments).assertColor$1("color").get$whiteness(0), "%"); + }, + $signature: 11 + }; + A.module_closure17.prototype = { + call$1($arguments) { + return A.SassNumber_SassNumber0(J.get$first$ax($arguments).assertColor$1("color").get$blackness(0), "%"); + }, + $signature: 11 + }; + A.module_closure18.prototype = { + call$1($arguments) { + var result, t1, + argument = J.$index$asx($arguments, 0); + if (argument instanceof A.SassString0 && !argument._string0$_hasQuotes && B.JSString_methods.contains$1(argument._string0$_text, $.$get$_microsoftFilterStart0())) { + result = A._functionString0("alpha", $arguments); + t1 = result.toString$0(0); + A.EvaluationContext_current0().warn$2(0, string$.Using_c + t1, B.Deprecation_LT8); + return result; + } + return A.SassNumber_SassNumber0(argument.assertColor$1("color")._color1$_alpha, null); + }, + $signature: 3 + }; + A.module_closure19.prototype = { + call$1($arguments) { + var result, + t1 = J.getInterceptor$asx($arguments); + if (B.JSArray_methods.every$1(t1.$index($arguments, 0).get$asList(), new A.module__closure4())) { + result = A._functionString0("alpha", $arguments); + t1 = result.toString$0(0); + A.EvaluationContext_current0().warn$2(0, string$.Using_c + t1, B.Deprecation_LT8); + return result; + } + throw A.wrapException(A.SassScriptException$0("Only 1 argument allowed, but " + t1.get$length($arguments) + " were passed.", null)); + }, + $signature: 17 + }; + A.module__closure4.prototype = { + call$1(argument) { + return argument instanceof A.SassString0 && !argument._string0$_hasQuotes && B.JSString_methods.contains$1(argument._string0$_text, $.$get$_microsoftFilterStart0()); + }, + $signature: 49 + }; + A.module_closure20.prototype = { + call$1($arguments) { + var result, t2, + t1 = J.getInterceptor$asx($arguments); + if (t1.$index($arguments, 0) instanceof A.SassNumber0) { + result = A._functionString0("opacity", $arguments); + t1 = A.S(t1.$index($arguments, 0)); + t2 = result.toString$0(0); + A.EvaluationContext_current0().warn$2(0, "Passing a number (" + t1 + string$.x20to_co + t2, B.Deprecation_LT8); + return result; + } + return A.SassNumber_SassNumber0(t1.$index($arguments, 0).assertColor$1("color")._color1$_alpha, null); + }, + $signature: 3 + }; + A._red_closure0.prototype = { + call$1($arguments) { + return A.SassNumber_SassNumber0(J.get$first$ax($arguments).assertColor$1("color").get$red(0), null); + }, + $signature: 11 + }; + A._green_closure0.prototype = { + call$1($arguments) { + return A.SassNumber_SassNumber0(J.get$first$ax($arguments).assertColor$1("color").get$green(0), null); + }, + $signature: 11 + }; + A._blue_closure0.prototype = { + call$1($arguments) { + return A.SassNumber_SassNumber0(J.get$first$ax($arguments).assertColor$1("color").get$blue(0), null); + }, + $signature: 11 + }; + A._mix_closure0.prototype = { + call$1($arguments) { + var t1 = J.getInterceptor$asx($arguments); + return A._mixColors0(t1.$index($arguments, 0).assertColor$1("color1"), t1.$index($arguments, 1).assertColor$1("color2"), t1.$index($arguments, 2).assertNumber$1("weight")); + }, + $signature: 29 + }; + A._hue_closure0.prototype = { + call$1($arguments) { + return A.SassNumber_SassNumber0(J.get$first$ax($arguments).assertColor$1("color").get$hue(0), "deg"); + }, + $signature: 11 + }; + A._saturation_closure0.prototype = { + call$1($arguments) { + return A.SassNumber_SassNumber0(J.get$first$ax($arguments).assertColor$1("color").get$saturation(0), "%"); + }, + $signature: 11 + }; + A._lightness_closure0.prototype = { + call$1($arguments) { + return A.SassNumber_SassNumber0(J.get$first$ax($arguments).assertColor$1("color").get$lightness(0), "%"); + }, + $signature: 11 + }; + A._complement_closure0.prototype = { + call$1($arguments) { + var color = J.$index$asx($arguments, 0).assertColor$1("color"); + return color.changeHsl$1$hue(color.get$hue(0) + 180); + }, + $signature: 29 + }; + A._adjust_closure0.prototype = { + call$1($arguments) { + return A._updateComponents0($arguments, true, false, false); + }, + $signature: 29 + }; + A._scale_closure0.prototype = { + call$1($arguments) { + return A._updateComponents0($arguments, false, false, true); + }, + $signature: 29 + }; + A._change_closure0.prototype = { + call$1($arguments) { + return A._updateComponents0($arguments, false, true, false); + }, + $signature: 29 + }; + A._ieHexStr_closure0.prototype = { + call$1($arguments) { + var color = J.$index$asx($arguments, 0).assertColor$1("color"), + t1 = new A._ieHexStr_closure_hexString0(); + return new A.SassString0("#" + A.S(t1.call$1(A.fuzzyRound0(color._color1$_alpha * 255))) + A.S(t1.call$1(color.get$red(0))) + A.S(t1.call$1(color.get$green(0))) + A.S(t1.call$1(color.get$blue(0))), false); + }, + $signature: 17 + }; + A._ieHexStr_closure_hexString0.prototype = { + call$1(component) { + return B.JSString_methods.padLeft$2(B.JSInt_methods.toRadixString$1(component, 16), 2, "0").toUpperCase(); + }, + $signature: 230 + }; + A._updateComponents_getParam0.prototype = { + call$5$assertPercent$checkPercent$checkUnitless($name, max, assertPercent, checkPercent, checkUnitless) { + var t2, t3, t4, _this = this, + t1 = _this.keywords.remove$1(0, $name), + number = t1 == null ? null : t1.assertNumber$1($name); + if (number == null) + return null; + t1 = _this.scale; + t2 = !t1; + if (t2 && checkUnitless) + if (number.get$hasUnits()) { + t3 = number.get$unitString(); + t4 = number.unitSuggestion$1($name); + A.EvaluationContext_current0().warn$2(0, "$" + $name + ": Passing a number with unit " + t3 + string$.x20is_de + t4 + string$.x0a_Morex3a, B.Deprecation_0bn); + } + if (t2 && checkPercent) + A._checkPercent0(number, $name); + if (!t2 || assertPercent) + number.assertUnit$2("%", $name); + if (t1) + max = 100; + if (!t2 || assertPercent) + t1 = number.valueInRange$3(_this.change ? 0 : -max, max, $name); + else { + t1 = _this.change ? 0 : -max; + t1 = number.valueInRangeWithUnit$4(t1, max, $name, checkPercent ? "%" : ""); + } + return t1; + }, + call$2($name, max) { + return this.call$5$assertPercent$checkPercent$checkUnitless($name, max, false, false, false); + }, + call$3$checkUnitless($name, max, checkUnitless) { + return this.call$5$assertPercent$checkPercent$checkUnitless($name, max, false, false, checkUnitless); + }, + call$3$checkPercent($name, max, checkPercent) { + return this.call$5$assertPercent$checkPercent$checkUnitless($name, max, false, checkPercent, false); + }, + call$3$assertPercent($name, max, assertPercent) { + return this.call$5$assertPercent$checkPercent$checkUnitless($name, max, assertPercent, false, false); + }, + $signature: 227 + }; + A._updateComponents_closure1.prototype = { + call$1(hue) { + return A._angleValue0(hue, "hue"); + }, + $signature: 96 + }; + A._updateComponents_closure2.prototype = { + call$1($name) { + return "$" + $name; + }, + $signature: 5 + }; + A._updateComponents_updateValue0.prototype = { + call$3(current, param, max) { + var t1; + if (param == null) + return current; + if (this.change) + return param; + if (this.adjust) + return B.JSNumber_methods.clamp$2(current + param, 0, max); + t1 = param > 0 ? max - current : current; + return current + t1 * (param / 100); + }, + $signature: 202 + }; + A._updateComponents_updateRgb0.prototype = { + call$2(current, param) { + return A.fuzzyRound0(this.updateValue.call$3(current, param, 255)); + }, + $signature: 197 + }; + A._functionString_closure0.prototype = { + call$1(argument) { + return A.serializeValue0(argument, false, true); + }, + $signature: 193 + }; + A._removedColorFunction_closure0.prototype = { + call$1($arguments) { + var t1 = this.name, + t2 = J.getInterceptor$asx($arguments), + t3 = A.S(t2.$index($arguments, 0)), + t4 = this.negative ? "-" : ""; + throw A.wrapException(A.SassScriptException$0("The function " + t1 + string$.x28__isn + t3 + ", $" + this.argument + ": " + t4 + A.S(t2.$index($arguments, 1)) + string$.x29x0a_Mor + t1, null)); + }, + $signature: 383 + }; + A._rgb_closure0.prototype = { + call$1(alpha) { + return A._percentageOrUnitless0(alpha.assertNumber$1("alpha"), 1, "alpha"); + }, + $signature: 96 + }; + A._hsl_closure0.prototype = { + call$1(alpha) { + return A._percentageOrUnitless0(alpha.assertNumber$1("alpha"), 1, "alpha"); + }, + $signature: 96 + }; + A._hwb_closure0.prototype = { + call$1(alpha) { + return A._percentageOrUnitless0(alpha.assertNumber$1("alpha"), 1, "alpha"); + }, + $signature: 96 + }; + A._parseChannels_closure0.prototype = { + call$1(value) { + return value.get$isVar(); + }, + $signature: 49 + }; + A.colorClass_closure.prototype = { + call$0() { + var t1 = type$.JSClass, + jsClass = t1._as(A.allowInteropCaptureThisNamed("sass.SassColor", new A.colorClass__closure())); + J.get$$prototype$x(jsClass).change = A.allowInteropCaptureThisNamed("change", new A.colorClass__closure0()); + A.LinkedHashMap_LinkedHashMap$_literal(["red", new A.colorClass__closure1(), "green", new A.colorClass__closure2(), "blue", new A.colorClass__closure3(), "hue", new A.colorClass__closure4(), "saturation", new A.colorClass__closure5(), "lightness", new A.colorClass__closure6(), "whiteness", new A.colorClass__closure7(), "blackness", new A.colorClass__closure8(), "alpha", new A.colorClass__closure9()], type$.String, type$.Function).forEach$1(0, A.JSClassExtension_get_defineGetter(jsClass)); + A.JSClassExtension_injectSuperclass(t1._as(A.SassColor$rgb0(0, 0, 0, 1).constructor), jsClass); + return jsClass; + }, + $signature: 13 + }; + A.colorClass__closure.prototype = { + call$2($self, color) { + var t2, t3, t4, + t1 = J.getInterceptor$x(color); + if (t1.get$red(color) != null) { + t2 = t1.get$red(color); + t2.toString; + t2 = A.fuzzyRound0(t2); + t3 = t1.get$green(color); + t3.toString; + t3 = A.fuzzyRound0(t3); + t4 = t1.get$blue(color); + t4.toString; + t4 = A.fuzzyRound0(t4); + t1 = t1.get$alpha(color); + return A.SassColor$rgb0(t2, t3, t4, A._asBool($.$get$_isUndefined().call$1(t1)) ? 1 : t1); + } else if (t1.get$saturation(color) != null) { + t2 = t1.get$hue(color); + t2.toString; + t3 = t1.get$saturation(color); + t3.toString; + t4 = t1.get$lightness(color); + t4.toString; + t1 = t1.get$alpha(color); + return A.SassColor$hsl(t2, t3, t4, A._asBool($.$get$_isUndefined().call$1(t1)) ? 1 : t1); + } else { + t2 = t1.get$hue(color); + t2.toString; + t3 = t1.get$whiteness(color); + t3.toString; + t4 = t1.get$blackness(color); + t4.toString; + t1 = t1.get$alpha(color); + return A.SassColor_SassColor$hwb0(t2, t3, t4, A._asBool($.$get$_isUndefined().call$1(t1)) ? 1 : t1); + } + }, + $signature: 384 + }; + A.colorClass__closure0.prototype = { + call$2($self, options) { + var t2, t3, t4, + t1 = J.getInterceptor$x(options); + if (t1.get$whiteness(options) != null || t1.get$blackness(options) != null) { + t2 = t1.get$hue(options); + if (t2 == null) + t2 = $self.get$hue(0); + t3 = t1.get$whiteness(options); + if (t3 == null) + t3 = $self.get$whiteness(0); + t4 = t1.get$blackness(options); + if (t4 == null) + t4 = $self.get$blackness(0); + t1 = t1.get$alpha(options); + return $self.changeHwb$4$alpha$blackness$hue$whiteness(t1 == null ? $self._color1$_alpha : t1, t4, t2, t3); + } else if (t1.get$hue(options) != null || t1.get$saturation(options) != null || t1.get$lightness(options) != null) { + t2 = t1.get$hue(options); + if (t2 == null) + t2 = $self.get$hue(0); + t3 = t1.get$saturation(options); + if (t3 == null) + t3 = $self.get$saturation(0); + t4 = t1.get$lightness(options); + if (t4 == null) + t4 = $self.get$lightness(0); + t1 = t1.get$alpha(options); + return $self.changeHsl$4$alpha$hue$lightness$saturation(t1 == null ? $self._color1$_alpha : t1, t2, t4, t3); + } else if (t1.get$red(options) != null || t1.get$green(options) != null || t1.get$blue(options) != null) { + t2 = A.NullableExtension_andThen0(t1.get$red(options), A.number2__fuzzyRound$closure()); + if (t2 == null) + t2 = $self.get$red(0); + t3 = A.NullableExtension_andThen0(t1.get$green(options), A.number2__fuzzyRound$closure()); + if (t3 == null) + t3 = $self.get$green(0); + t4 = A.NullableExtension_andThen0(t1.get$blue(options), A.number2__fuzzyRound$closure()); + if (t4 == null) + t4 = $self.get$blue(0); + t1 = t1.get$alpha(options); + return $self.changeRgb$4$alpha$blue$green$red(t1 == null ? $self._color1$_alpha : t1, t4, t3, t2); + } else { + t1 = t1.get$alpha(options); + return $self.changeAlpha$1(t1 == null ? $self._color1$_alpha : t1); + } + }, + $signature: 385 + }; + A.colorClass__closure1.prototype = { + call$1($self) { + return $self.get$red(0); + }, + $signature: 117 + }; + A.colorClass__closure2.prototype = { + call$1($self) { + return $self.get$green(0); + }, + $signature: 117 + }; + A.colorClass__closure3.prototype = { + call$1($self) { + return $self.get$blue(0); + }, + $signature: 117 + }; + A.colorClass__closure4.prototype = { + call$1($self) { + return $self.get$hue(0); + }, + $signature: 56 + }; + A.colorClass__closure5.prototype = { + call$1($self) { + return $self.get$saturation(0); + }, + $signature: 56 + }; + A.colorClass__closure6.prototype = { + call$1($self) { + return $self.get$lightness(0); + }, + $signature: 56 + }; + A.colorClass__closure7.prototype = { + call$1($self) { + return $self.get$whiteness(0); + }, + $signature: 56 + }; + A.colorClass__closure8.prototype = { + call$1($self) { + return $self.get$blackness(0); + }, + $signature: 56 + }; + A.colorClass__closure9.prototype = { + call$1($self) { + return $self._color1$_alpha; + }, + $signature: 56 + }; + A._Channels.prototype = {}; + A._NodeSassColor.prototype = {}; + A.legacyColorClass_closure.prototype = { + call$6(thisArg, redOrArgb, green, blue, alpha, dartValue) { + var red, t1, t2, t3, t4; + if (dartValue != null) { + J.set$dartValue$x(thisArg, dartValue); + return; + } + if (green == null || blue == null) { + A._asInt(redOrArgb); + alpha = B.JSInt_methods._shrOtherPositive$1(redOrArgb, 24) / 255; + red = B.JSInt_methods.$mod(B.JSInt_methods._shrOtherPositive$1(redOrArgb, 16), 256); + green = B.JSInt_methods.$mod(B.JSInt_methods._shrOtherPositive$1(redOrArgb, 8), 256); + blue = B.JSInt_methods.$mod(redOrArgb, 256); + } else { + redOrArgb.toString; + red = redOrArgb; + } + t1 = A.fuzzyRound0(B.JSNumber_methods.clamp$2(red, 0, 255)); + t2 = A.fuzzyRound0(B.JSNumber_methods.clamp$2(green, 0, 255)); + t3 = A.fuzzyRound0(B.JSNumber_methods.clamp$2(blue, 0, 255)); + t4 = alpha == null ? null : B.JSNumber_methods.clamp$2(alpha, 0, 1); + J.set$dartValue$x(thisArg, A.SassColor$rgb0(t1, t2, t3, t4 == null ? 1 : t4)); + }, + call$2(thisArg, redOrArgb) { + var _null = null; + return this.call$6(thisArg, redOrArgb, _null, _null, _null, _null); + }, + call$3(thisArg, redOrArgb, green) { + return this.call$6(thisArg, redOrArgb, green, null, null, null); + }, + call$4(thisArg, redOrArgb, green, blue) { + return this.call$6(thisArg, redOrArgb, green, blue, null, null); + }, + call$5(thisArg, redOrArgb, green, blue, alpha) { + return this.call$6(thisArg, redOrArgb, green, blue, alpha, null); + }, + "call*": "call$6", + $requiredArgCount: 2, + $defaultValues() { + return [null, null, null, null]; + }, + $signature: 388 + }; + A.legacyColorClass_closure0.prototype = { + call$1(thisArg) { + return J.get$red$x(J.get$dartValue$x(thisArg)); + }, + $signature: 114 + }; + A.legacyColorClass_closure1.prototype = { + call$1(thisArg) { + return J.get$green$x(J.get$dartValue$x(thisArg)); + }, + $signature: 114 + }; + A.legacyColorClass_closure2.prototype = { + call$1(thisArg) { + return J.get$blue$x(J.get$dartValue$x(thisArg)); + }, + $signature: 114 + }; + A.legacyColorClass_closure3.prototype = { + call$1(thisArg) { + return J.get$dartValue$x(thisArg)._color1$_alpha; + }, + $signature: 390 + }; + A.legacyColorClass_closure4.prototype = { + call$2(thisArg, value) { + var t1 = J.getInterceptor$x(thisArg); + t1.set$dartValue(thisArg, t1.get$dartValue(thisArg).changeRgb$1$red(A.fuzzyRound0(B.JSNumber_methods.clamp$2(value, 0, 255)))); + }, + $signature: 95 + }; + A.legacyColorClass_closure5.prototype = { + call$2(thisArg, value) { + var t1 = J.getInterceptor$x(thisArg); + t1.set$dartValue(thisArg, t1.get$dartValue(thisArg).changeRgb$1$green(A.fuzzyRound0(B.JSNumber_methods.clamp$2(value, 0, 255)))); + }, + $signature: 95 + }; + A.legacyColorClass_closure6.prototype = { + call$2(thisArg, value) { + var t1 = J.getInterceptor$x(thisArg); + t1.set$dartValue(thisArg, t1.get$dartValue(thisArg).changeRgb$1$blue(A.fuzzyRound0(B.JSNumber_methods.clamp$2(value, 0, 255)))); + }, + $signature: 95 + }; + A.legacyColorClass_closure7.prototype = { + call$2(thisArg, value) { + var t1 = J.getInterceptor$x(thisArg); + t1.set$dartValue(thisArg, t1.get$dartValue(thisArg).changeRgb$1$alpha(B.JSNumber_methods.clamp$2(value, 0, 1))); + }, + $signature: 95 + }; + A.SassColor0.prototype = { + get$red(_) { + var t1; + if (this._color1$_red == null) + this._color1$_hslToRgb$0(); + t1 = this._color1$_red; + t1.toString; + return t1; + }, + get$green(_) { + var t1; + if (this._color1$_green == null) + this._color1$_hslToRgb$0(); + t1 = this._color1$_green; + t1.toString; + return t1; + }, + get$blue(_) { + var t1; + if (this._color1$_blue == null) + this._color1$_hslToRgb$0(); + t1 = this._color1$_blue; + t1.toString; + return t1; + }, + get$hue(_) { + var t1; + if (this._color1$_hue == null) + this._color1$_rgbToHsl$0(); + t1 = this._color1$_hue; + t1.toString; + return t1; + }, + get$saturation(_) { + var t1; + if (this._color1$_saturation == null) + this._color1$_rgbToHsl$0(); + t1 = this._color1$_saturation; + t1.toString; + return t1; + }, + get$lightness(_) { + var t1; + if (this._color1$_lightness == null) + this._color1$_rgbToHsl$0(); + t1 = this._color1$_lightness; + t1.toString; + return t1; + }, + get$whiteness(_) { + return Math.min(Math.min(this.get$red(0), this.get$green(0)), this.get$blue(0)) / 255 * 100; + }, + get$blackness(_) { + return 100 - Math.max(Math.max(this.get$red(0), this.get$green(0)), this.get$blue(0)) / 255 * 100; + }, + accept$1$1(visitor) { + return visitor.visitColor$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + assertColor$1($name) { + return this; + }, + changeRgb$4$alpha$blue$green$red(alpha, blue, green, red) { + var _this = this, + t1 = red == null ? _this.get$red(0) : red, + t2 = green == null ? _this.get$green(0) : green, + t3 = blue == null ? _this.get$blue(0) : blue; + return A.SassColor$rgb0(t1, t2, t3, alpha == null ? _this._color1$_alpha : alpha); + }, + changeRgb$3$blue$green$red(blue, green, red) { + return this.changeRgb$4$alpha$blue$green$red(null, blue, green, red); + }, + changeRgb$1$alpha(alpha) { + return this.changeRgb$4$alpha$blue$green$red(alpha, null, null, null); + }, + changeRgb$1$blue(blue) { + return this.changeRgb$4$alpha$blue$green$red(null, blue, null, null); + }, + changeRgb$1$green(green) { + return this.changeRgb$4$alpha$blue$green$red(null, null, green, null); + }, + changeRgb$1$red(red) { + return this.changeRgb$4$alpha$blue$green$red(null, null, null, red); + }, + changeHsl$4$alpha$hue$lightness$saturation(alpha, hue, lightness, saturation) { + var _this = this, + t1 = hue == null ? _this.get$hue(0) : hue, + t2 = saturation == null ? _this.get$saturation(0) : saturation, + t3 = lightness == null ? _this.get$lightness(0) : lightness; + return A.SassColor$hsl(t1, t2, t3, alpha == null ? _this._color1$_alpha : alpha); + }, + changeHsl$1$saturation(saturation) { + return this.changeHsl$4$alpha$hue$lightness$saturation(null, null, null, saturation); + }, + changeHsl$1$lightness(lightness) { + return this.changeHsl$4$alpha$hue$lightness$saturation(null, null, lightness, null); + }, + changeHsl$1$hue(hue) { + return this.changeHsl$4$alpha$hue$lightness$saturation(null, hue, null, null); + }, + changeHwb$4$alpha$blackness$hue$whiteness(alpha, blackness, hue, whiteness) { + var t1 = hue == null ? this.get$hue(0) : hue; + return A.SassColor_SassColor$hwb0(t1, whiteness, blackness, alpha); + }, + changeAlpha$1(alpha) { + var _this = this; + return new A.SassColor0(_this._color1$_red, _this._color1$_green, _this._color1$_blue, _this._color1$_hue, _this._color1$_saturation, _this._color1$_lightness, A.fuzzyAssertRange0(alpha, 0, 1, "alpha"), null); + }, + plus$1(other) { + if (!(other instanceof A.SassNumber0) && !(other instanceof A.SassColor0)) + return this.super$Value$plus0(other); + throw A.wrapException(A.SassScriptException$0('Undefined operation "' + this.toString$0(0) + " + " + other.toString$0(0) + '".', null)); + }, + minus$1(other) { + if (!(other instanceof A.SassNumber0) && !(other instanceof A.SassColor0)) + return this.super$Value$minus0(other); + throw A.wrapException(A.SassScriptException$0('Undefined operation "' + this.toString$0(0) + " - " + other.toString$0(0) + '".', null)); + }, + dividedBy$1(other) { + if (!(other instanceof A.SassNumber0) && !(other instanceof A.SassColor0)) + return this.super$Value$dividedBy0(other); + throw A.wrapException(A.SassScriptException$0('Undefined operation "' + this.toString$0(0) + " / " + other.toString$0(0) + '".', null)); + }, + $eq(_, other) { + var _this = this; + if (other == null) + return false; + return other instanceof A.SassColor0 && other.get$red(0) === _this.get$red(0) && other.get$green(0) === _this.get$green(0) && other.get$blue(0) === _this.get$blue(0) && other._color1$_alpha === _this._color1$_alpha; + }, + get$hashCode(_) { + var _this = this; + return B.JSInt_methods.get$hashCode(_this.get$red(0)) ^ B.JSInt_methods.get$hashCode(_this.get$green(0)) ^ B.JSInt_methods.get$hashCode(_this.get$blue(0)) ^ B.JSNumber_methods.get$hashCode(_this._color1$_alpha); + }, + _color1$_rgbToHsl$0() { + var t2, lightness, _this = this, + scaledRed = _this.get$red(0) / 255, + scaledGreen = _this.get$green(0) / 255, + scaledBlue = _this.get$blue(0) / 255, + max = Math.max(Math.max(scaledRed, scaledGreen), scaledBlue), + min = Math.min(Math.min(scaledRed, scaledGreen), scaledBlue), + delta = max - min, + t1 = max === min; + if (t1) + _this._color1$_hue = 0; + else if (max === scaledRed) + _this._color1$_hue = B.JSNumber_methods.$mod(60 * (scaledGreen - scaledBlue) / delta, 360); + else if (max === scaledGreen) + _this._color1$_hue = B.JSNumber_methods.$mod(120 + 60 * (scaledBlue - scaledRed) / delta, 360); + else if (max === scaledBlue) + _this._color1$_hue = B.JSNumber_methods.$mod(240 + 60 * (scaledRed - scaledGreen) / delta, 360); + t2 = max + min; + lightness = 50 * t2; + _this._color1$_lightness = lightness; + if (t1) + _this._color1$_saturation = 0; + else { + t1 = 100 * delta; + if (lightness < 50) + _this._color1$_saturation = t1 / t2; + else + _this._color1$_saturation = t1 / (2 - max - min); + } + }, + _color1$_hslToRgb$0() { + var _this = this, + scaledHue = _this.get$hue(0) / 360, + scaledSaturation = _this.get$saturation(0) / 100, + scaledLightness = _this.get$lightness(0) / 100, + m2 = scaledLightness <= 0.5 ? scaledLightness * (scaledSaturation + 1) : scaledLightness + scaledSaturation - scaledLightness * scaledSaturation, + m1 = scaledLightness * 2 - m2; + _this._color1$_red = A.fuzzyRound0(A.SassColor__hueToRgb0(m1, m2, scaledHue + 0.3333333333333333) * 255); + _this._color1$_green = A.fuzzyRound0(A.SassColor__hueToRgb0(m1, m2, scaledHue) * 255); + _this._color1$_blue = A.fuzzyRound0(A.SassColor__hueToRgb0(m1, m2, scaledHue - 0.3333333333333333) * 255); + } + }; + A.SassColor_SassColor$hwb_toRgb0.prototype = { + call$1(hue) { + return A.fuzzyRound0((A.SassColor__hueToRgb0(0, 1, hue) * this.factor + this._box_0.scaledWhiteness) * 255); + }, + $signature: 205 + }; + A._ColorFormatEnum0.prototype = { + toString$0(_) { + return this._color1$_name; + } + }; + A.SpanColorFormat0.prototype = {}; + A.Combinator0.prototype = { + _enumToString$0() { + return "Combinator." + this._name; + }, + toString$0(_) { + return this._combinator0$_text; + } + }; + A.ModifiableCssComment0.prototype = { + accept$1$1(visitor) { + return visitor.visitCssComment$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + $isCssComment0: 1, + get$span(receiver) { + return this.span; + } + }; + A.compileAsync_closure.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.NodeCompileResult), + $async$returnValue, $async$self = this, t5, t6, t7, t8, t9, t10, t11, result, t1, t2, t3, t4; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.options; + t2 = t1 == null; + t3 = t2 ? null : J.get$loadPaths$x(t1); + t4 = t2 ? null : J.get$quietDeps$x(t1); + if (t4 == null) + t4 = false; + t5 = A._parseOutputStyle0(t2 ? null : J.get$style$x(t1)); + t6 = t2 ? null : J.get$verbose$x(t1); + if (t6 == null) + t6 = false; + t7 = t2 ? null : J.get$charset$x(t1); + if (t7 == null) + t7 = true; + t8 = t2 ? null : J.get$sourceMap$x(t1); + if (t8 == null) + t8 = false; + t9 = t2 ? null : J.get$logger$x(t1); + t9 = new A.JSToDartLogger(t9, new A.StderrLogger0($async$self.color), $async$self.ascii); + if (t2) + t10 = null; + else { + t10 = J.get$importers$x(t1); + t10 = t10 == null ? null : J.map$1$1$ax(t10, new A.compileAsync__closure(), type$.AsyncImporter); + } + t11 = A._parseFunctions0(t2 ? null : J.get$functions$x(t1), true); + $async$goto = 3; + return A._asyncAwait(A.compileAsync0($async$self.path, t7, null, t11, null, A.AsyncImportCache$(t10, t3, t9, null), null, null, t9, null, t4, t8, t5, null, true, t6), $async$call$0); + case 3: + // returning from await. + result = $async$result; + t1 = t2 ? null : J.get$sourceMapIncludeSources$x(t1); + $async$returnValue = A._convertResult(result, t1 == null ? false : t1); + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 268 + }; + A.compileAsync__closure.prototype = { + call$1(importer) { + return A._parseAsyncImporter(importer); + }, + $signature: 165 + }; + A.compileStringAsync_closure.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.NodeCompileResult), + $async$returnValue, $async$self = this, t7, t8, t9, t10, t11, t12, t13, t14, result, t1, t2, t3, t4, t5, t6; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.options; + t2 = t1 == null; + t3 = A.parseSyntax(t2 ? null : J.get$syntax$x(t1)); + t4 = t2 ? null : A.NullableExtension_andThen0(J.get$url$x(t1), A.utils1__jsToDartUrl$closure()); + t5 = t2 ? null : J.get$loadPaths$x(t1); + t6 = t2 ? null : J.get$quietDeps$x(t1); + if (t6 == null) + t6 = false; + t7 = A._parseOutputStyle0(t2 ? null : J.get$style$x(t1)); + t8 = t2 ? null : J.get$verbose$x(t1); + if (t8 == null) + t8 = false; + t9 = t2 ? null : J.get$charset$x(t1); + if (t9 == null) + t9 = true; + t10 = t2 ? null : J.get$sourceMap$x(t1); + if (t10 == null) + t10 = false; + t11 = t2 ? null : J.get$logger$x(t1); + t11 = new A.JSToDartLogger(t11, new A.StderrLogger0($async$self.color), $async$self.ascii); + if (t2) + t12 = null; + else { + t12 = J.get$importers$x(t1); + t12 = t12 == null ? null : J.map$1$1$ax(t12, new A.compileStringAsync__closure(), type$.AsyncImporter); + } + t13 = t2 ? null : A.NullableExtension_andThen0(J.get$importer$x(t1), new A.compileStringAsync__closure0()); + if (t13 == null) + t13 = (t2 ? null : J.get$url$x(t1)) == null ? new A.NoOpImporter0() : null; + t14 = A._parseFunctions0(t2 ? null : J.get$functions$x(t1), true); + $async$goto = 3; + return A._asyncAwait(A.compileStringAsync0($async$self.text, t9, t14, A.AsyncImportCache$(t12, t5, t11, null), t13, null, null, t11, null, t6, t10, t7, t3, t4, true, t8), $async$call$0); + case 3: + // returning from await. + result = $async$result; + t1 = t2 ? null : J.get$sourceMapIncludeSources$x(t1); + $async$returnValue = A._convertResult(result, t1 == null ? false : t1); + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 268 + }; + A.compileStringAsync__closure.prototype = { + call$1(importer) { + return A._parseAsyncImporter(importer); + }, + $signature: 165 + }; + A.compileStringAsync__closure0.prototype = { + call$1(importer) { + return A._parseAsyncImporter(importer); + }, + $signature: 394 + }; + A._wrapAsyncSassExceptions_closure.prototype = { + call$1(error) { + var t1; + if (error instanceof A.SassException0) + t1 = A.throwNodeException(error, this.ascii, this.color, null); + else + t1 = A.jsThrow(error == null ? type$.Object._as(error) : error); + return t1; + }, + $signature: 395 + }; + A._parseFunctions_closure0.prototype = { + call$2(signature, callback) { + var callable, + t1 = this.result; + if (!this.asynch) { + callable = A._Cell$(); + callable._value = A.Callable_Callable$fromSignature(signature, new A._parseFunctions__closure2(callback, callable), true); + t1.push(callable._readLocal$0()); + } else { + callable = A._Cell$(); + callable._value = A.AsyncCallable_AsyncCallable$fromSignature(signature, new A._parseFunctions__closure3(callback, callable), true); + t1.push(callable._readLocal$0()); + } + }, + $signature: 128 + }; + A._parseFunctions__closure2.prototype = { + call$1($arguments) { + var t1, t2, + _s42_ = string$.Invali, + result = A.wrapJSExceptions(new A._parseFunctions___closure6(this.callback, $arguments)); + if (result instanceof A.Value0) + return A._simplifyValue(result); + t1 = result != null && result instanceof self.Promise; + t2 = this.callable; + if (t1) + throw A.wrapException(_s42_ + J.get$name$x(t2.readLocal$0()) + '":\nPromises may only be returned for sass.compileAsync() and sass.compileStringAsync().'); + else + throw A.wrapException(_s42_ + J.get$name$x(t2.readLocal$0()) + '": ' + A.S(result) + " is not a sass.Value."); + }, + $signature: 3 + }; + A._parseFunctions___closure6.prototype = { + call$0() { + return type$.Function._as(this.callback).call$1(A.toJSArray(this.$arguments)); + }, + $signature: 57 + }; + A._parseFunctions__closure3.prototype = { + call$1($arguments) { + return this.$call$body$_parseFunctions__closure0($arguments); + }, + $call$body$_parseFunctions__closure0($arguments) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Value_2), + $async$returnValue, $async$self = this, result; + var $async$call$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + result = A.wrapJSExceptions(new A._parseFunctions___closure5($async$self.callback, $arguments)); + $async$goto = result != null && result instanceof self.Promise ? 3 : 4; + break; + case 3: + // then + $async$goto = 5; + return A._asyncAwait(A.promiseToFuture(type$.Promise._as(result), type$.Object), $async$call$1); + case 5: + // returning from await. + result = $async$result; + case 4: + // join + if (result instanceof A.Value0) { + $async$returnValue = A._simplifyValue(result); + // goto return + $async$goto = 1; + break; + } + throw A.wrapException(string$.Invali + J.get$name$x($async$self.callable.readLocal$0()) + '": ' + A.S(result) + " is not a sass.Value."); + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$call$1, $async$completer); + }, + $signature: 98 + }; + A._parseFunctions___closure5.prototype = { + call$0() { + return type$.Function._as(this.callback).call$1(A.toJSArray(this.$arguments)); + }, + $signature: 57 + }; + A.nodePackageImporterClass_closure.prototype = { + call$0() { + return type$.JSClass._as(A.allowInteropCaptureThisNamed("sass.NodePackageImporter", new A.nodePackageImporterClass__closure())); + }, + $signature: 13 + }; + A.nodePackageImporterClass__closure.prototype = { + call$2($self, entrypointDirectory) { + var directory, t1, filename, t2, _null = null, + _0_3 = A.entrypointFilename(); + $label0$0: { + if (entrypointDirectory != null) { + directory = entrypointDirectory == null ? A._asString(entrypointDirectory) : entrypointDirectory; + t1 = directory; + break $label0$0; + } + if (_0_3 != null) { + filename = _0_3 == null ? A._asString(_0_3) : _0_3; + t1 = $.$get$context().dirname$1(filename); + break $label0$0; + } + t1 = A.throwExpression("The Node package importer cannot determine an entry point because `require.main.filename` is not defined. Please provide an `entryPointDirectory` to the `NodePackageImporter`."); + } + t2 = new A.NodePackageImporter0(); + if (A.isBrowser()) + A.throwExpression(string$.The_No); + t2._node_package$__NodePackageImporter__entryPointDirectory_F = A.absolute(t1, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null); + return t2; + }, + call$1($self) { + return this.call$2($self, null); + }, + "call*": "call$2", + $requiredArgCount: 1, + $defaultValues() { + return [null]; + }, + $signature: 397 + }; + A._compileStylesheet_closure1.prototype = { + call$1(url) { + return url === "" ? A.Uri_Uri$dataFromString(A.String_String$fromCharCodes(B.NativeUint32List_methods.sublist$2(this.stylesheet.span.file._decodedChars, 0, null), 0, null), B.C_Utf8Codec, null).get$_text() : this.importCache.sourceMapUrl$1(0, A.Uri_parse(url)).toString$0(0); + }, + $signature: 5 + }; + A.CompileOptions.prototype = {}; + A.CompileStringOptions.prototype = {}; + A.NodeCompileResult.prototype = {}; + A.CompileResult0.prototype = {}; + A.Compiler.prototype = {}; + A.AsyncCompiler.prototype = { + addCompilation$1(compilation) { + this.compilations.add$1(0, A.promiseToFuture0(compilation, type$.dynamic).catchError$1(new A.AsyncCompiler_addCompilation_closure())); + } + }; + A.AsyncCompiler_addCompilation_closure.prototype = { + call$1(err) { + }, + $signature: 54 + }; + A.compilerClass_closure.prototype = { + call$0() { + var t1 = type$.JSClass, + jsClass = t1._as(A.allowInteropCaptureThisNamed("sass.Compiler", new A.compilerClass__closure())); + A.LinkedHashMap_LinkedHashMap$_literal(["compile", new A.compilerClass__closure0(), "compileString", new A.compilerClass__closure1(), "dispose", new A.compilerClass__closure2()], type$.String, type$.Function).forEach$1(0, A.JSClassExtension_get_defineMethod(jsClass)); + A.JSClassExtension_injectSuperclass(t1._as(new A.Compiler().constructor), jsClass); + return jsClass; + }, + $signature: 13 + }; + A.compilerClass__closure.prototype = { + call$1($self) { + return A.LinkedHashSet_LinkedHashSet$_literal([A.jsThrow(new self.Error("Compiler can not be directly constructed. Please use `sass.initCompiler()` instead."))], type$.Never); + }, + $signature: 266 + }; + A.compilerClass__closure0.prototype = { + call$3($self, path, options) { + if ($self._disposed) + A.jsThrow(new self.Error("Compiler has already been disposed.")); + return A.compile0(path, options); + }, + call$2($self, path) { + return this.call$3($self, path, null); + }, + "call*": "call$3", + $requiredArgCount: 2, + $defaultValues() { + return [null]; + }, + $signature: 399 + }; + A.compilerClass__closure1.prototype = { + call$3($self, source, options) { + if ($self._disposed) + A.jsThrow(new self.Error("Compiler has already been disposed.")); + return A.compileString0(source, options); + }, + call$2($self, source) { + return this.call$3($self, source, null); + }, + "call*": "call$3", + $requiredArgCount: 2, + $defaultValues() { + return [null]; + }, + $signature: 400 + }; + A.compilerClass__closure2.prototype = { + call$1($self) { + $self._disposed = true; + }, + $signature: 401 + }; + A.asyncCompilerClass_closure.prototype = { + call$0() { + var t1 = type$.JSClass, + jsClass = t1._as(A.allowInteropCaptureThisNamed("sass.AsyncCompiler", new A.asyncCompilerClass__closure())); + A.LinkedHashMap_LinkedHashMap$_literal(["compileAsync", new A.asyncCompilerClass__closure0(), "compileStringAsync", new A.asyncCompilerClass__closure1(), "dispose", new A.asyncCompilerClass__closure2()], type$.String, type$.Function).forEach$1(0, A.JSClassExtension_get_defineMethod(jsClass)); + A.JSClassExtension_injectSuperclass(t1._as(new A.AsyncCompiler(new A.FutureGroup(new A._AsyncCompleter(new A._Future($.Zone__current, type$._Future_List_void), type$._AsyncCompleter_List_void), [], type$.FutureGroup_void)).constructor), jsClass); + return jsClass; + }, + $signature: 13 + }; + A.asyncCompilerClass__closure.prototype = { + call$1($self) { + return A.LinkedHashSet_LinkedHashSet$_literal([A.jsThrow(new self.Error("AsyncCompiler can not be directly constructed. Please use `sass.initAsyncCompiler()` instead."))], type$.Never); + }, + $signature: 266 + }; + A.asyncCompilerClass__closure0.prototype = { + call$3($self, path, options) { + var compilation; + if ($self._disposed) + A.jsThrow(new self.Error("Compiler has already been disposed.")); + compilation = A.compileAsync1(path, options); + $self.addCompilation$1(compilation); + return compilation; + }, + call$2($self, path) { + return this.call$3($self, path, null); + }, + "call*": "call$3", + $requiredArgCount: 2, + $defaultValues() { + return [null]; + }, + $signature: 402 + }; + A.asyncCompilerClass__closure1.prototype = { + call$3($self, source, options) { + var compilation; + if ($self._disposed) + A.jsThrow(new self.Error("Compiler has already been disposed.")); + compilation = A.compileStringAsync1(source, options); + $self.addCompilation$1(compilation); + return compilation; + }, + call$2($self, source) { + return this.call$3($self, source, null); + }, + "call*": "call$3", + $requiredArgCount: 2, + $defaultValues() { + return [null]; + }, + $signature: 403 + }; + A.asyncCompilerClass__closure2.prototype = { + call$1($self) { + $self._disposed = true; + return A.futureToPromise0(new A.asyncCompilerClass___closure($self).call$0()); + }, + $signature: 404 + }; + A.asyncCompilerClass___closure.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Null), + $async$self = this, t1; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = $async$self.self.compilations; + t1.close$0(0); + $async$goto = 2; + return A._asyncAwait(t1._future_group$_completer.future, $async$call$0); + case 2: + // returning from await. + // implicit return + return A._asyncReturn(null, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 2 + }; + A.initAsyncCompiler_closure.prototype = { + call$0() { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.AsyncCompiler), + $async$returnValue; + var $async$call$0 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + $async$returnValue = new A.AsyncCompiler(new A.FutureGroup(new A._AsyncCompleter(new A._Future($.Zone__current, type$._Future_List_void), type$._AsyncCompleter_List_void), [], type$.FutureGroup_void)); + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$call$0, $async$completer); + }, + $signature: 405 + }; + A.ComplexSassNumber0.prototype = { + get$numeratorUnits(_) { + return this._complex0$_numeratorUnits; + }, + get$denominatorUnits(_) { + return this._complex0$_denominatorUnits; + }, + get$hasUnits() { + return true; + }, + get$hasComplexUnits() { + return true; + }, + hasUnit$1(unit) { + return false; + }, + compatibleWithUnit$1(unit) { + return false; + }, + hasPossiblyCompatibleUnits$1(other) { + throw A.wrapException(A.UnimplementedError$(string$.Comple)); + }, + withValue$1(value) { + return new A.ComplexSassNumber0(this._complex0$_numeratorUnits, this._complex0$_denominatorUnits, value, null); + }, + withSlash$2(numerator, denominator) { + return new A.ComplexSassNumber0(this._complex0$_numeratorUnits, this._complex0$_denominatorUnits, this._number1$_value, new A._Record_2(numerator, denominator)); + } + }; + A.ComplexSelector0.prototype = { + get$specificity() { + var result, _this = this, + value = _this._complex$__ComplexSelector_specificity_FI; + if (value === $) { + result = B.JSArray_methods.fold$2(_this.components, 0, new A.ComplexSelector_specificity_closure0()); + _this._complex$__ComplexSelector_specificity_FI !== $ && A.throwUnnamedLateFieldADI(); + _this._complex$__ComplexSelector_specificity_FI = result; + value = result; + } + return value; + }, + get$singleCompound() { + var _0_0, _0_4, t1, selector, _null = null; + if (this.leadingCombinators.length !== 0) + return _null; + _0_0 = this.components; + $label0$0: { + if (_0_0.length === 1) { + _0_4 = _0_0[0]; + t1 = _0_4; + selector = t1.selector; + t1 = _0_4.combinators.length <= 0; + } else { + selector = _null; + t1 = false; + } + if (t1) { + t1 = selector; + break $label0$0; + } + t1 = _null; + break $label0$0; + } + return t1; + }, + accept$1$1(visitor) { + return visitor.visitComplexSelector$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + isSuperselector$1(other) { + return this.leadingCombinators.length === 0 && other.leadingCombinators.length === 0 && A.complexIsSuperselector0(this.components, other.components); + }, + withAdditionalCombinators$1(combinators) { + var _0_0, _0_1, initial, last, t1, t2, _this = this; + if (combinators.length === 0) + return _this; + _0_0 = _this.components; + $label0$0: { + _0_1 = _0_0.length; + if (_0_1 >= 1) { + initial = B.JSArray_methods.sublist$2(_0_0, 0, _0_1 - 1); + last = _0_0[_0_1 - 1]; + t1 = A.List_List$of(initial, true, type$.ComplexSelectorComponent_2); + t1.push(last.withAdditionalCombinators$1(combinators)); + t2 = _this.lineBreak || false; + t2 = A.ComplexSelector$0(_this.leadingCombinators, t1, _this.span, t2); + t1 = t2; + break $label0$0; + } + if (_0_1 <= 0) { + t1 = A.List_List$of(_this.leadingCombinators, true, type$.CssValue_Combinator_2); + B.JSArray_methods.addAll$1(t1, combinators); + t2 = _this.lineBreak || false; + t2 = A.ComplexSelector$0(t1, B.List_empty13, _this.span, t2); + t1 = t2; + break $label0$0; + } + throw A.wrapException(A.ReachabilityError$(string$.None_o)); + } + return t1; + }, + concatenate$3$forceLineBreak(child, span, forceLineBreak) { + var t2, _0_1, initial, last, _this = this, + t1 = child.leadingCombinators, + _0_0 = _this.components; + if (t1.length === 0) { + t1 = A.List_List$of(_0_0, true, type$.ComplexSelectorComponent_2); + B.JSArray_methods.addAll$1(t1, child.components); + t2 = _this.lineBreak || child.lineBreak || forceLineBreak; + return A.ComplexSelector$0(_this.leadingCombinators, t1, span, t2); + } else { + _0_1 = _0_0.length; + if (_0_1 >= 1) { + t2 = _0_1 - 1; + initial = B.JSArray_methods.sublist$2(_0_0, 0, t2); + last = _0_0[t2]; + t2 = A.List_List$of(initial, true, type$.ComplexSelectorComponent_2); + t2.push(last.withAdditionalCombinators$1(t1)); + B.JSArray_methods.addAll$1(t2, child.components); + t1 = _this.lineBreak || child.lineBreak || forceLineBreak; + return A.ComplexSelector$0(_this.leadingCombinators, t2, span, t1); + } else { + t2 = A.List_List$of(_this.leadingCombinators, true, type$.CssValue_Combinator_2); + B.JSArray_methods.addAll$1(t2, t1); + t1 = _this.lineBreak || child.lineBreak || forceLineBreak; + return A.ComplexSelector$0(t2, child.components, span, t1); + } + } + }, + concatenate$2(child, span) { + return this.concatenate$3$forceLineBreak(child, span, false); + }, + get$hashCode(_) { + return B.C_ListEquality0.hash$1(this.leadingCombinators) ^ B.C_ListEquality0.hash$1(this.components); + }, + $eq(_, other) { + if (other == null) + return false; + return other instanceof A.ComplexSelector0 && B.C_ListEquality.equals$2(0, this.leadingCombinators, other.leadingCombinators) && B.C_ListEquality.equals$2(0, this.components, other.components); + } + }; + A.ComplexSelector_specificity_closure0.prototype = { + call$2(sum, component) { + return sum + component.selector.get$specificity(); + }, + $signature: 406 + }; + A.ComplexSelectorComponent0.prototype = { + withAdditionalCombinators$1(combinators) { + var t1, t2, _this = this; + if (combinators.length === 0) + t1 = _this; + else { + t1 = type$.CssValue_Combinator_2; + t2 = A.List_List$of(_this.combinators, true, t1); + B.JSArray_methods.addAll$1(t2, combinators); + t1 = new A.ComplexSelectorComponent0(_this.selector, A.List_List$unmodifiable(t2, t1), _this.span); + } + return t1; + }, + get$hashCode(_) { + return B.C_ListEquality0.hash$1(this.selector.components) ^ B.C_ListEquality0.hash$1(this.combinators); + }, + $eq(_, other) { + var t1; + if (other == null) + return false; + if (other instanceof A.ComplexSelectorComponent0) { + t1 = B.C_ListEquality.equals$2(0, this.selector.components, other.selector.components); + t1 = t1 && B.C_ListEquality.equals$2(0, this.combinators, other.combinators); + } else + t1 = false; + return t1; + }, + toString$0(_) { + var t1 = this.combinators; + return A.serializeSelector0(this.selector, true) + new A.MappedListIterable(t1, new A.ComplexSelectorComponent_toString_closure0(), A._arrayInstanceType(t1)._eval$1("MappedListIterable<1,String>")).join$1(0, ""); + } + }; + A.ComplexSelectorComponent_toString_closure0.prototype = { + call$1(combinator) { + return " " + combinator.toString$0(0); + }, + $signature: 407 + }; + A.CompoundSelector0.prototype = { + get$specificity() { + var result, _this = this, + value = _this._compound$__CompoundSelector_specificity_FI; + if (value === $) { + result = B.JSArray_methods.fold$2(_this.components, 0, new A.CompoundSelector_specificity_closure0()); + _this._compound$__CompoundSelector_specificity_FI !== $ && A.throwUnnamedLateFieldADI(); + _this._compound$__CompoundSelector_specificity_FI = result; + value = result; + } + return value; + }, + accept$1$1(visitor) { + return visitor.visitCompoundSelector$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + get$hashCode(_) { + return B.C_ListEquality0.hash$1(this.components); + }, + $eq(_, other) { + if (other == null) + return false; + return other instanceof A.CompoundSelector0 && B.C_ListEquality.equals$2(0, this.components, other.components); + } + }; + A.CompoundSelector_specificity_closure0.prototype = { + call$2(sum, component) { + return sum + component.get$specificity(); + }, + $signature: 408 + }; + A.Configuration0.prototype = { + throughForward$1($forward) { + var _0_0, _1_0, _2_0, t1, hiddenVariables, + newValues = this._configuration0$_values; + if (newValues.get$isEmpty(newValues)) + return B.Configuration_Map_empty_null0; + _0_0 = $forward.prefix; + if (_0_0 != null) + newValues = new A.UnprefixedMapView0(newValues, _0_0, type$.UnprefixedMapView_ConfiguredValue_2); + _1_0 = $forward.shownVariables; + if (_1_0 != null) + newValues = new A.LimitedMapView0(newValues, _1_0._base.intersection$1(new A.MapKeySet(newValues, type$.MapKeySet_nullable_Object)), type$.LimitedMapView_String_ConfiguredValue_2); + else { + _2_0 = $forward.hiddenVariables; + if (_2_0 != null) { + t1 = _2_0._base.get$isNotEmpty(0); + hiddenVariables = _2_0; + } else { + hiddenVariables = null; + t1 = false; + } + if (t1) + newValues = A.LimitedMapView$blocklist0(newValues, hiddenVariables, type$.String, type$.ConfiguredValue_2); + } + return this._configuration0$_withValues$1(newValues); + }, + _configuration0$_withValues$1(values) { + var t1 = this._configuration0$__originalConfiguration; + return new A.Configuration0(values, t1 == null ? this : t1); + }, + toString$0(_) { + var t2, t3, + t1 = A._setArrayType([], type$.JSArray_String); + for (t2 = A.MapExtensions_get_pairs0(new A.UnmodifiableMapView(this._configuration0$_values, type$.UnmodifiableMapView_String_ConfiguredValue_2), type$.String, type$.ConfiguredValue_2), t2 = t2.get$iterator(t2); t2.moveNext$0();) { + t3 = t2.get$current(t2); + t1.push("$" + t3._0 + ": " + t3._1.toString$0(0)); + } + return "(" + B.JSArray_methods.join$1(t1, ",") + ")"; + } + }; + A.ExplicitConfiguration0.prototype = { + _configuration0$_withValues$1(values) { + var t1 = this._configuration0$__originalConfiguration; + if (t1 == null) + t1 = this; + return new A.ExplicitConfiguration0(this.nodeWithSpan, values, t1); + } + }; + A.ConfiguredValue0.prototype = { + toString$0(_) { + return A.serializeValue0(this.value, true, true); + } + }; + A.ConfiguredVariable0.prototype = { + toString$0(_) { + var t1 = this.expression.toString$0(0), + t2 = this.isGuarded ? " !default" : ""; + return "$" + this.name + ": " + t1 + t2; + }, + $isAstNode0: 1, + get$span(receiver) { + return this.span; + } + }; + A.ContentBlock0.prototype = { + accept$1$1(visitor) { + return visitor.visitContentBlock$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + toString$0(_) { + var t2, + t1 = this.$arguments; + t1 = t1.$arguments.length === 0 && t1.restArgument == null ? "" : " using (" + t1.toString$0(0) + ")"; + t2 = this.children; + return t1 + (" {" + (t2 && B.JSArray_methods).join$1(t2, " ") + "}"); + } + }; + A.ContentRule0.prototype = { + accept$1$1(visitor) { + return visitor.visitContentRule$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + toString$0(_) { + var t1 = this.$arguments; + return t1.get$isEmpty(0) ? "@content;" : "@content(" + t1.toString$0(0) + ");"; + }, + $isAstNode0: 1, + $isStatement0: 1, + get$span(receiver) { + return this.span; + } + }; + A._disallowedFunctionNames_closure0.prototype = { + call$1($function) { + return $function.name; + }, + $signature: 409 + }; + A.CssParser0.prototype = { + get$plainCss() { + return true; + }, + silentComment$0() { + var t1, t2, _this = this; + if (_this._stylesheet0$_inExpression) + return false; + t1 = _this.scanner; + t2 = t1._string_scanner$_position; + _this.super$Parser$silentComment0(); + _this.error$2(0, string$.Silent, t1.spanFrom$1(new A._SpanScannerState(t1, t2))); + }, + atRule$2$root(child, root) { + var $name, _0_0, _this = this, + t1 = _this.scanner, + start = new A._SpanScannerState(t1, t1._string_scanner$_position); + t1.expectChar$1(64); + $name = _this.interpolatedIdentifier$0(); + _this.whitespace$0(); + _0_0 = $name.get$asPlain(); + $label0$0: { + if ("at-root" === _0_0 || "content" === _0_0 || "debug" === _0_0 || "each" === _0_0 || "error" === _0_0 || "extend" === _0_0 || "for" === _0_0 || "function" === _0_0 || "if" === _0_0 || "include" === _0_0 || "mixin" === _0_0 || "return" === _0_0 || "warn" === _0_0 || "while" === _0_0) + _this._css$_forbiddenAtRoot$1(start); + if ("import" === _0_0) { + t1 = _this._css$_cssImportRule$1(start); + break $label0$0; + } + if ("media" === _0_0) { + t1 = _this.mediaRule$1(start); + break $label0$0; + } + if ("-moz-document" === _0_0) { + t1 = _this.mozDocumentRule$2(start, $name); + break $label0$0; + } + if ("supports" === _0_0) { + t1 = _this.supportsRule$1(start); + break $label0$0; + } + t1 = _this.unknownAtRule$2(start, $name); + break $label0$0; + } + return t1; + }, + _css$_forbiddenAtRoot$1(start) { + this.almostAnyValue$0(); + this.error$2(0, "This at-rule isn't allowed in plain CSS.", this.scanner.spanFrom$1(start)); + }, + _css$_cssImportRule$1(start) { + var t2, urlSpan, modifiers, _this = this, + t1 = _this.scanner, + urlStart = new A._SpanScannerState(t1, t1._string_scanner$_position), + _0_0 = t1.peekChar$0(); + $label0$0: { + if (117 === _0_0 || 85 === _0_0) { + t2 = _this.dynamicUrl$0(); + break $label0$0; + } + t2 = new A.StringExpression0(_this.interpolatedString$0().asInterpolation$1$static(true), false); + break $label0$0; + } + urlSpan = t1.spanFrom$1(urlStart); + _this.whitespace$0(); + modifiers = _this.tryImportModifiers$0(); + _this.expectStatementSeparator$1("@import rule"); + t2 = A._setArrayType([new A.StaticImport0(A.Interpolation$0(A._setArrayType([t2], type$.JSArray_Object), urlSpan), modifiers, t1.spanFrom$1(urlStart))], type$.JSArray_Import_2); + t1 = t1.spanFrom$1(start); + return new A.ImportRule0(A.List_List$unmodifiable(t2, type$.Import_2), t1); + }, + parentheses$0() { + var expression, + t1 = this.scanner, + t2 = t1._string_scanner$_position; + t1.expectChar$1(40); + this.whitespace$0(); + expression = this.expressionUntilComma$0(); + t1.expectChar$1(41); + return new A.ParenthesizedExpression0(expression, t1.spanFrom$1(new A._SpanScannerState(t1, t2))); + }, + identifierLike$0() { + var t2, allowEmptySecondArg, $arguments, t3, t4, _this = this, + t1 = _this.scanner, + start = new A._SpanScannerState(t1, t1._string_scanner$_position), + identifier = _this.interpolatedIdentifier$0(), + plain = identifier.get$asPlain(), + lower = plain.toLowerCase(), + _0_0 = _this.trySpecialFunction$2(lower, start); + if (_0_0 != null) + return _0_0; + t2 = t1._string_scanner$_position; + if (t1.scanChar$1(46)) + return _this.namespacedExpression$2(plain, start); + if (!t1.scanChar$1(40)) + return new A.StringExpression0(identifier, false); + allowEmptySecondArg = lower === "var"; + $arguments = A._setArrayType([], type$.JSArray_Expression_2); + if (!t1.scanChar$1(41)) { + do { + _this.whitespace$0(); + if (allowEmptySecondArg && $arguments.length === 1 && t1.peekChar$0() === 41) { + t3 = A.FileLocation$_(t1._sourceFile, t1._string_scanner$_position); + t4 = t3.offset; + t4 = A._FileSpan$(t3.file, t4, t4); + $arguments.push(new A.StringExpression0(A.Interpolation$0(A._setArrayType([""], type$.JSArray_Object), t4), false)); + break; + } + $arguments.push(_this.expressionUntilComma$1$singleEquals(true)); + _this.whitespace$0(); + } while (t1.scanChar$1(44)); + t1.expectChar$1(41); + } + if ($.$get$_disallowedFunctionNames0().contains$1(0, plain)) + _this.error$2(0, string$.This_f, t1.spanFrom$1(start)); + t2 = t1.spanFrom$1(new A._SpanScannerState(t1, t2)); + t3 = type$.Expression_2; + return new A.FunctionExpression0(null, plain, new A.ArgumentInvocation0(A.List_List$unmodifiable($arguments, t3), A.ConstantMap_ConstantMap$from(B.Map_empty14, type$.String, t3), null, null, t2), t1.spanFrom$1(start)); + }, + namespacedExpression$2(namespace, start) { + var expression = this.super$StylesheetParser$namespacedExpression0(namespace, start); + this.error$2(0, string$.Modulen, expression.get$span(expression)); + } + }; + A.DebugRule0.prototype = { + accept$1$1(visitor) { + return visitor.visitDebugRule$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + toString$0(_) { + return "@debug " + this.expression.toString$0(0) + ";"; + }, + $isAstNode0: 1, + $isStatement0: 1, + get$span(receiver) { + return this.span; + } + }; + A.ModifiableCssDeclaration0.prototype = { + accept$1$1(visitor) { + return visitor.visitCssDeclaration$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + toString$0(_) { + return this.name.toString$0(0) + ": " + this.value.toString$0(0) + ";"; + }, + get$span(receiver) { + return this.span; + } + }; + A.Declaration0.prototype = { + accept$1$1(visitor) { + return visitor.visitDeclaration$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + toString$0(_) { + var t3, _0_0, + buffer = new A.StringBuffer(""), + t1 = this.name, + t2 = "" + t1.toString$0(0); + buffer._contents = t2; + t2 = buffer._contents = t2 + A.Primitives_stringFromCharCode(58); + t3 = this.value; + if (t3 != null) { + t1 = !B.JSString_methods.startsWith$1(t1.get$initialPlain(), "--") ? buffer._contents = t2 + A.Primitives_stringFromCharCode(32) : t2; + buffer._contents = t1 + t3.toString$0(0); + } + _0_0 = this.children; + if (_0_0 != null) + return buffer.toString$0(0) + " {" + B.JSArray_methods.join$1(_0_0, " ") + "}"; + else + return buffer.toString$0(0) + ";"; + }, + get$span(receiver) { + return this.span; + } + }; + A.SupportsDeclaration0.prototype = { + get$isCustomProperty() { + var t1, + _0_0 = this.name; + $label0$0: { + if (_0_0 instanceof A.StringExpression0 && !_0_0.hasQuotes) { + t1 = B.JSString_methods.startsWith$1(_0_0.text.get$initialPlain(), "--"); + break $label0$0; + } + t1 = false; + break $label0$0; + } + return t1; + }, + toString$0(_) { + return "(" + this.name.toString$0(0) + ": " + this.value.toString$0(0) + ")"; + }, + $isAstNode0: 1, + get$span(receiver) { + return this.span; + } + }; + A.Deprecation0.prototype = { + _enumToString$0() { + return "Deprecation." + this._name; + }, + toString$0(_) { + return this.id; + } + }; + A.DeprecationHandlingLogger0.prototype = { + warn$4$deprecation$span$trace(_, message, deprecation, span, trace) { + this._deprecation_handling$_inner.warn$4$deprecation$span$trace(0, message, deprecation, span, trace); + }, + warn$3$span$trace(_, message, span, trace) { + return this.warn$4$deprecation$span$trace(0, message, false, span, trace); + }, + warn$2$span(_, message, span) { + return this.warn$4$deprecation$span$trace(0, message, false, span, null); + }, + warn$2$trace(_, message, trace) { + return this.warn$4$deprecation$span$trace(0, message, false, null, trace); + }, + warnForDeprecation$4$span$trace(deprecation, message, span, trace) { + var span0, t1, _0_3, _0_1, _0_3_isSet, t2, count, _this = this, _null = null; + if (_this.fatalDeprecations.contains$1(0, deprecation)) { + message += string$.x0a_This + deprecation.toString$0(0) + string$.x20depre; + $label0$0: { + if (span != null) { + span0 = span == null ? type$.FileSpan._as(span) : span; + t1 = trace != null; + _0_3 = trace; + _0_1 = span; + span = span0; + _0_3_isSet = true; + } else { + _0_3 = _null; + _0_1 = span; + span = _0_3; + _0_3_isSet = false; + t1 = false; + } + if (t1) { + if (_0_3_isSet) + trace = _0_3; + t1 = A.SassRuntimeException$0(message, span, trace == null ? type$.Trace._as(trace) : trace, _null); + break $label0$0; + } + if (_0_1 != null) { + span = _0_1 == null ? type$.FileSpan._as(_0_1) : _0_1; + t1 = (_0_3_isSet ? _0_3 : trace) == null; + } else { + span = _null; + t1 = false; + } + if (t1) { + t1 = A.SassException$0(message, span, _null); + break $label0$0; + } + t1 = A.SassScriptException$0(message, _null); + break $label0$0; + } + throw A.wrapException(t1); + } + if (deprecation.isFuture && !_this.futureDeprecations.contains$1(0, deprecation)) + return; + if (_this.limitRepetition) { + t1 = _this._deprecation_handling$_warningCounts; + t2 = t1.$index(0, deprecation); + count = (t2 == null ? 0 : t2) + 1; + t1.$indexSet(0, deprecation, count); + if (count > 5) + return; + } + _this._deprecation_handling$_inner.warn$4$deprecation$span$trace(0, message, true, span, trace); + }, + debug$2(_, message, span) { + return this._deprecation_handling$_inner.debug$2(0, message, span); + }, + summarize$1$js(js) { + var t1 = this._deprecation_handling$_warningCounts.get$values(0), + t2 = A._instanceType(t1), + total = A.IterableIntegerExtension_get_sum(new A.MappedIterable(new A.WhereIterable(t1, new A.DeprecationHandlingLogger_summarize_closure1(), t2._eval$1("WhereIterable")), new A.DeprecationHandlingLogger_summarize_closure2(), t2._eval$1("MappedIterable"))); + if (total > 0) { + t1 = js ? "" : string$.x0aRun_i; + this._deprecation_handling$_inner.warn$1(0, "" + total + string$.x20repet + t1); + } + } + }; + A.DeprecationHandlingLogger_summarize_closure1.prototype = { + call$1(count) { + return count > 5; + }, + $signature: 46 + }; + A.DeprecationHandlingLogger_summarize_closure2.prototype = { + call$1(count) { + return count - 5; + }, + $signature: 168 + }; + A.DynamicImport0.prototype = { + toString$0(_) { + return A.StringExpression_quoteText0(this.urlString); + }, + $isImport0: 1, + $isAstNode0: 1, + get$span(receiver) { + return this.span; + } + }; + A.EachRule0.prototype = { + accept$1$1(visitor) { + return visitor.visitEachRule$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + toString$0(_) { + var t1 = this.variables, + t2 = this.children; + return "@each " + new A.MappedListIterable(t1, new A.EachRule_toString_closure0(), A._arrayInstanceType(t1)._eval$1("MappedListIterable<1,String>")).join$1(0, ", ") + " in " + this.list.toString$0(0) + " {" + (t2 && B.JSArray_methods).join$1(t2, " ") + "}"; + }, + get$span(receiver) { + return this.span; + } + }; + A.EachRule_toString_closure0.prototype = { + call$1(variable) { + return "$" + variable; + }, + $signature: 5 + }; + A.EmptyExtensionStore0.prototype = { + get$_extension_store$_extensions() { + return A.throwExpression(A.NoSuchMethodError_NoSuchMethodError$withInvocation(this, A.JSInvocationMirror$(B.Symbol__extensions, "get$_empty_extension_store0$_extensions", 1, [], [], 0))); + }, + get$_extension_store$_sourceSpecificity() { + return A.throwExpression(A.NoSuchMethodError_NoSuchMethodError$withInvocation(this, A.JSInvocationMirror$(B.Symbol__sourceSpecificity, "get$_empty_extension_store0$_sourceSpecificity", 1, [], [], 0))); + }, + get$isEmpty(_) { + return true; + }, + get$simpleSelectors() { + return B.C_EmptyUnmodifiableSet0; + }, + extensionsWhereTarget$1(callback) { + return B.List_empty17; + }, + addSelector$2(selector, mediaContext) { + throw A.wrapException(A.UnsupportedError$("addSelector() can't be called for a const ExtensionStore.")); + }, + addExtension$4(extender, target, extend, mediaContext) { + throw A.wrapException(A.UnsupportedError$("addExtension() can't be called for a const ExtensionStore.")); + }, + addExtensions$1(extenders) { + throw A.wrapException(A.UnsupportedError$(string$.addExt)); + }, + clone$0() { + return B.Record2_EmptyExtensionStore_Map_empty0; + }, + $isExtensionStore0: 1 + }; + A.Environment0.prototype = { + closure$0() { + var t4, t5, t6, _this = this, + t1 = _this._environment0$_forwardedModules, + t2 = _this._environment0$_nestedForwardedModules, + t3 = _this._environment0$_variables; + t3 = A._setArrayType(t3.slice(0), A._arrayInstanceType(t3)); + t4 = _this._environment0$_variableNodes; + t4 = A._setArrayType(t4.slice(0), A._arrayInstanceType(t4)); + t5 = _this._environment0$_functions; + t5 = A._setArrayType(t5.slice(0), A._arrayInstanceType(t5)); + t6 = _this._environment0$_mixins; + t6 = A._setArrayType(t6.slice(0), A._arrayInstanceType(t6)); + return A.Environment$_0(_this._environment0$_modules, _this._environment0$_namespaceNodes, _this._environment0$_globalModules, _this._environment0$_importedModules, t1, t2, _this._environment0$_allModules, t3, t4, t5, t6, _this._environment0$_content); + }, + forwardModule$2(module, rule) { + var view, t1, t2, _this = this, + forwardedModules = _this._environment0$_forwardedModules; + if (forwardedModules == null) + forwardedModules = _this._environment0$_forwardedModules = A.LinkedHashMap_LinkedHashMap$_empty(type$.Module_Callable_2, type$.AstNode_2); + view = A.ForwardedModuleView_ifNecessary0(module, rule, type$.Callable_2); + for (t1 = A.LinkedHashMapKeyIterator$(forwardedModules, forwardedModules._modifications); t1.moveNext$0();) { + t2 = t1.__js_helper$_current; + _this._environment0$_assertNoConflicts$5(view.get$variables(), t2.get$variables(), view, t2, "variable"); + _this._environment0$_assertNoConflicts$5(view.get$functions(view), t2.get$functions(t2), view, t2, "function"); + _this._environment0$_assertNoConflicts$5(view.get$mixins(), t2.get$mixins(), view, t2, "mixin"); + } + _this._environment0$_allModules.push(module); + forwardedModules.$indexSet(0, view, rule); + }, + _environment0$_assertNoConflicts$5(newMembers, oldMembers, newModule, oldModule, type) { + var larger, smaller, t1, t2, t3, t4, $name, small, large, span; + if (newMembers.get$length(newMembers) < oldMembers.get$length(oldMembers)) { + larger = oldMembers; + smaller = newMembers; + } else { + larger = newMembers; + smaller = oldMembers; + } + for (t1 = type$.String, t2 = A.MapExtensions_get_pairs0(smaller, t1, type$.Object), t2 = t2.get$iterator(t2), t3 = type === "variable"; t2.moveNext$0();) { + t4 = t2.get$current(t2); + $name = t4._0; + small = t4._1; + large = larger.$index(0, $name); + if (large == null) + continue; + if (t3 ? newModule.variableIdentity$1($name) === oldModule.variableIdentity$1($name) : J.$eq$(large, small)) + continue; + if (t3) + $name = "$" + $name; + t2 = this._environment0$_forwardedModules; + if (t2 == null) + span = null; + else { + t2 = t2.$index(0, oldModule); + span = t2 == null ? null : J.get$span$z(t2); + } + t2 = A.LinkedHashMap_LinkedHashMap$_empty(type$.FileSpan, t1); + if (span != null) + t2.$indexSet(0, span, "original @forward"); + throw A.wrapException(A.MultiSpanSassScriptException$0("Two forwarded modules both define a " + type + " named " + $name + ".", "new @forward", t2)); + } + }, + importForwards$1(module) { + var forwardedModules, t1, t2, t3, t4, node, t5, t6, t7, t8, t9, t10, _i, t11, shadowed, _length, _list, _this = this, + forwarded = module._environment0$_environment._environment0$_forwardedModules; + if (forwarded == null) + return; + forwardedModules = _this._environment0$_forwardedModules; + if (forwardedModules != null) { + t1 = type$.Module_Callable_2; + t2 = type$.AstNode_2; + t3 = A.LinkedHashMap_LinkedHashMap$_empty(t1, t2); + for (t1 = A.MapExtensions_get_pairs0(forwarded, t1, t2), t1 = t1.get$iterator(t1), t2 = _this._environment0$_globalModules; t1.moveNext$0();) { + t4 = t1.get$current(t1); + module = t4._0; + node = t4._1; + if (!forwardedModules.containsKey$1(module) || !t2.containsKey$1(module)) + t3.$indexSet(0, module, node); + } + forwarded = t3; + } else + forwardedModules = _this._environment0$_forwardedModules = A.LinkedHashMap_LinkedHashMap$_empty(type$.Module_Callable_2, type$.AstNode_2); + t1 = type$.String; + t2 = A.LinkedHashSet_LinkedHashSet$_empty(t1); + for (t3 = A.LinkedHashMapKeyIterator$(forwarded, forwarded._modifications); t3.moveNext$0();) + for (t4 = t3.__js_helper$_current.get$variables(), t4 = J.get$iterator$ax(t4.get$keys(t4)); t4.moveNext$0();) + t2.add$1(0, t4.get$current(t4)); + t3 = A.LinkedHashSet_LinkedHashSet$_empty(t1); + for (t4 = A.LinkedHashMapKeyIterator$(forwarded, forwarded._modifications); t4.moveNext$0();) { + t5 = t4.__js_helper$_current; + for (t5 = t5.get$functions(t5), t5 = J.get$iterator$ax(t5.get$keys(t5)); t5.moveNext$0();) + t3.add$1(0, t5.get$current(t5)); + } + t1 = A.LinkedHashSet_LinkedHashSet$_empty(t1); + for (t4 = A.LinkedHashMapKeyIterator$(forwarded, forwarded._modifications); t4.moveNext$0();) + for (t5 = t4.__js_helper$_current.get$mixins(), t5 = J.get$iterator$ax(t5.get$keys(t5)); t5.moveNext$0();) + t1.add$1(0, t5.get$current(t5)); + t4 = _this._environment0$_variables; + t5 = t4.length; + if (t5 === 1) { + for (t5 = _this._environment0$_importedModules, t6 = type$.Module_Callable_2, t7 = type$.AstNode_2, t8 = A.MapExtensions_get_pairs0(t5, t6, t7).toList$0(0), t9 = t8.length, t10 = type$.Callable_2, _i = 0; _i < t8.length; t8.length === t9 || (0, A.throwConcurrentModificationError)(t8), ++_i) { + t11 = t8[_i]; + module = t11._0; + node = t11._1; + shadowed = A.ShadowedModuleView_ifNecessary0(module, t3, t1, t2, t10); + if (shadowed != null) { + t5.remove$1(0, module); + t11 = shadowed.variables; + if (t11.get$isEmpty(t11)) { + t11 = shadowed.functions; + if (t11.get$isEmpty(t11)) { + t11 = shadowed.mixins; + if (t11.get$isEmpty(t11)) { + t11 = shadowed._shadowed_view0$_inner; + t11 = t11.get$css(t11); + t11 = J.get$isEmpty$asx(t11.get$children(t11)); + } else + t11 = false; + } else + t11 = false; + } else + t11 = false; + if (!t11) + t5.$indexSet(0, shadowed, node); + } + } + for (t6 = A.MapExtensions_get_pairs0(forwardedModules, t6, t7).toList$0(0), t7 = t6.length, _i = 0; _i < t6.length; t6.length === t7 || (0, A.throwConcurrentModificationError)(t6), ++_i) { + t8 = t6[_i]; + module = t8._0; + node = t8._1; + shadowed = A.ShadowedModuleView_ifNecessary0(module, t3, t1, t2, t10); + if (shadowed != null) { + forwardedModules.remove$1(0, module); + t8 = shadowed.variables; + if (t8.get$isEmpty(t8)) { + t8 = shadowed.functions; + if (t8.get$isEmpty(t8)) { + t8 = shadowed.mixins; + if (t8.get$isEmpty(t8)) { + t8 = shadowed._shadowed_view0$_inner; + t8 = t8.get$css(t8); + t8 = J.get$isEmpty$asx(t8.get$children(t8)); + } else + t8 = false; + } else + t8 = false; + } else + t8 = false; + if (!t8) + forwardedModules.$indexSet(0, shadowed, node); + } + } + t5.addAll$1(0, forwarded); + forwardedModules.addAll$1(0, forwarded); + } else { + t6 = _this._environment0$_nestedForwardedModules; + if (t6 == null) { + _length = t5 - 1; + _list = J.JSArray_JSArray$allocateGrowable(_length, type$.List_Module_Callable_2); + for (t5 = type$.JSArray_Module_Callable_2, _i = 0; _i < _length; ++_i) + _list[_i] = A._setArrayType([], t5); + _this._environment0$_nestedForwardedModules = _list; + t5 = _list; + } else + t5 = t6; + B.JSArray_methods.addAll$1(B.JSArray_methods.get$last(t5), new A.LinkedHashMapKeyIterable(forwarded, A._instanceType(forwarded)._eval$1("LinkedHashMapKeyIterable<1>"))); + } + for (t2 = A._LinkedHashSetIterator$(t2, t2._collection$_modifications, t2.$ti._precomputed1), t5 = _this._environment0$_variableIndices, t6 = _this._environment0$_variableNodes, t7 = t2.$ti._precomputed1; t2.moveNext$0();) { + t8 = t2._collection$_current; + if (t8 == null) + t8 = t7._as(t8); + t5.remove$1(0, t8); + J.remove$1$z(B.JSArray_methods.get$last(t4), t8); + J.remove$1$z(B.JSArray_methods.get$last(t6), t8); + } + for (t2 = A._LinkedHashSetIterator$(t3, t3._collection$_modifications, t3.$ti._precomputed1), t3 = _this._environment0$_functionIndices, t4 = _this._environment0$_functions, t5 = t2.$ti._precomputed1; t2.moveNext$0();) { + t6 = t2._collection$_current; + if (t6 == null) + t6 = t5._as(t6); + t3.remove$1(0, t6); + J.remove$1$z(B.JSArray_methods.get$last(t4), t6); + } + for (t1 = A._LinkedHashSetIterator$(t1, t1._collection$_modifications, t1.$ti._precomputed1), t2 = _this._environment0$_mixinIndices, t3 = _this._environment0$_mixins, t4 = t1.$ti._precomputed1; t1.moveNext$0();) { + t5 = t1._collection$_current; + if (t5 == null) + t5 = t4._as(t5); + t2.remove$1(0, t5); + J.remove$1$z(B.JSArray_methods.get$last(t3), t5); + } + }, + getVariable$2$namespace($name, namespace) { + var t1, _0_0, _1_0, _this = this; + if (namespace != null) + return _this._environment0$_getModule$1(namespace).get$variables().$index(0, $name); + if (_this._environment0$_lastVariableName === $name) { + t1 = _this._environment0$_lastVariableIndex; + t1.toString; + t1 = J.$index$asx(_this._environment0$_variables[t1], $name); + return t1 == null ? _this._environment0$_getVariableFromGlobalModule$1($name) : t1; + } + t1 = _this._environment0$_variableIndices; + _0_0 = t1.$index(0, $name); + if (_0_0 != null) { + _this._environment0$_lastVariableName = $name; + _this._environment0$_lastVariableIndex = _0_0; + t1 = J.$index$asx(_this._environment0$_variables[_0_0], $name); + return t1 == null ? _this._environment0$_getVariableFromGlobalModule$1($name) : t1; + } else { + _1_0 = _this._environment0$_variableIndex$1($name); + if (_1_0 != null) { + _this._environment0$_lastVariableName = $name; + _this._environment0$_lastVariableIndex = _1_0; + t1.$indexSet(0, $name, _1_0); + t1 = J.$index$asx(_this._environment0$_variables[_1_0], $name); + return t1 == null ? _this._environment0$_getVariableFromGlobalModule$1($name) : t1; + } else + return _this._environment0$_getVariableFromGlobalModule$1($name); + } + }, + getVariable$1($name) { + return this.getVariable$2$namespace($name, null); + }, + _environment0$_getVariableFromGlobalModule$1($name) { + return this._environment0$_fromOneModule$3($name, "variable", new A.Environment__getVariableFromGlobalModule_closure0($name)); + }, + getVariableNode$2$namespace($name, namespace) { + var t1, _0_0, _1_0, _this = this; + if (namespace != null) + return _this._environment0$_getModule$1(namespace).get$variableNodes().$index(0, $name); + if (_this._environment0$_lastVariableName === $name) { + t1 = _this._environment0$_lastVariableIndex; + t1.toString; + t1 = J.$index$asx(_this._environment0$_variableNodes[t1], $name); + return t1 == null ? _this._environment0$_getVariableNodeFromGlobalModule$1($name) : t1; + } + t1 = _this._environment0$_variableIndices; + _0_0 = t1.$index(0, $name); + if (_0_0 != null) { + _this._environment0$_lastVariableName = $name; + _this._environment0$_lastVariableIndex = _0_0; + t1 = J.$index$asx(_this._environment0$_variableNodes[_0_0], $name); + return t1 == null ? _this._environment0$_getVariableNodeFromGlobalModule$1($name) : t1; + } else { + _1_0 = _this._environment0$_variableIndex$1($name); + if (_1_0 != null) { + _this._environment0$_lastVariableName = $name; + _this._environment0$_lastVariableIndex = _1_0; + t1.$indexSet(0, $name, _1_0); + t1 = J.$index$asx(_this._environment0$_variableNodes[_1_0], $name); + return t1 == null ? _this._environment0$_getVariableNodeFromGlobalModule$1($name) : t1; + } else + return _this._environment0$_getVariableNodeFromGlobalModule$1($name); + } + }, + _environment0$_getVariableNodeFromGlobalModule$1($name) { + var t1, t2, _0_0; + for (t1 = this._environment0$_importedModules, t2 = this._environment0$_globalModules, t2 = new A.LinkedHashMapKeyIterable(t1, A._instanceType(t1)._eval$1("LinkedHashMapKeyIterable<1>")).followedBy$1(0, new A.LinkedHashMapKeyIterable(t2, A._instanceType(t2)._eval$1("LinkedHashMapKeyIterable<1>"))), t2 = new A.FollowedByIterator(J.get$iterator$ax(t2.__internal$_first), t2._second); t2.moveNext$0();) { + t1 = t2._currentIterator; + _0_0 = t1.get$current(t1).get$variableNodes().$index(0, $name); + if (_0_0 != null) + return _0_0; + } + return null; + }, + globalVariableExists$2$namespace($name, namespace) { + if (namespace != null) + return this._environment0$_getModule$1(namespace).get$variables().containsKey$1($name); + if (B.JSArray_methods.get$first(this._environment0$_variables).containsKey$1($name)) + return true; + return this._environment0$_getVariableFromGlobalModule$1($name) != null; + }, + globalVariableExists$1($name) { + return this.globalVariableExists$2$namespace($name, null); + }, + _environment0$_variableIndex$1($name) { + var t1, i; + for (t1 = this._environment0$_variables, i = t1.length - 1; i >= 0; --i) + if (t1[i].containsKey$1($name)) + return i; + return null; + }, + setVariable$5$global$namespace($name, value, nodeWithSpan, global, namespace) { + var t1, moduleWithName, nestedForwardedModules, t2, t3, t4, t5, index, _this = this; + if (namespace != null) { + _this._environment0$_getModule$1(namespace).setVariable$3($name, value, nodeWithSpan); + return; + } + if (global || _this._environment0$_variables.length === 1) { + _this._environment0$_variableIndices.putIfAbsent$2($name, new A.Environment_setVariable_closure2(_this, $name)); + t1 = _this._environment0$_variables; + if (!B.JSArray_methods.get$first(t1).containsKey$1($name)) { + moduleWithName = _this._environment0$_fromOneModule$3($name, "variable", new A.Environment_setVariable_closure3($name)); + if (moduleWithName != null) { + moduleWithName.setVariable$3($name, value, nodeWithSpan); + return; + } + } + J.$indexSet$ax(B.JSArray_methods.get$first(t1), $name, value); + J.$indexSet$ax(B.JSArray_methods.get$first(_this._environment0$_variableNodes), $name, nodeWithSpan); + return; + } + nestedForwardedModules = _this._environment0$_nestedForwardedModules; + if (nestedForwardedModules != null && !_this._environment0$_variableIndices.containsKey$1($name) && _this._environment0$_variableIndex$1($name) == null) + for (t1 = A.instanceType(nestedForwardedModules)._eval$1("ReversedListIterable<1>"), t2 = new A.ReversedListIterable(nestedForwardedModules, t1), t2 = new A.ListIterator(t2, t2.get$length(0), t1._eval$1("ListIterator")), t1 = t1._eval$1("ListIterable.E"); t2.moveNext$0();) { + t3 = t2.__internal$_current; + for (t3 = J.get$reversed$ax(t3 == null ? t1._as(t3) : t3), t4 = t3.$ti, t3 = new A.ListIterator(t3, t3.get$length(0), t4._eval$1("ListIterator")), t4 = t4._eval$1("ListIterable.E"); t3.moveNext$0();) { + t5 = t3.__internal$_current; + if (t5 == null) + t5 = t4._as(t5); + if (t5.get$variables().containsKey$1($name)) { + t5.setVariable$3($name, value, nodeWithSpan); + return; + } + } + } + if (_this._environment0$_lastVariableName === $name) { + t1 = _this._environment0$_lastVariableIndex; + t1.toString; + index = t1; + } else + index = _this._environment0$_variableIndices.putIfAbsent$2($name, new A.Environment_setVariable_closure4(_this, $name)); + if (!_this._environment0$_inSemiGlobalScope && index === 0) { + index = _this._environment0$_variables.length - 1; + _this._environment0$_variableIndices.$indexSet(0, $name, index); + } + _this._environment0$_lastVariableName = $name; + _this._environment0$_lastVariableIndex = index; + J.$indexSet$ax(_this._environment0$_variables[index], $name, value); + J.$indexSet$ax(_this._environment0$_variableNodes[index], $name, nodeWithSpan); + }, + setVariable$4$global($name, value, nodeWithSpan, global) { + return this.setVariable$5$global$namespace($name, value, nodeWithSpan, global, null); + }, + setLocalVariable$3($name, value, nodeWithSpan) { + var index, _this = this, + t1 = _this._environment0$_variables, + t2 = t1.length; + _this._environment0$_lastVariableName = $name; + index = _this._environment0$_lastVariableIndex = t2 - 1; + _this._environment0$_variableIndices.$indexSet(0, $name, index); + J.$indexSet$ax(t1[index], $name, value); + J.$indexSet$ax(_this._environment0$_variableNodes[index], $name, nodeWithSpan); + }, + getFunction$2$namespace($name, namespace) { + var t1, _0_0, _1_0, _this = this; + if (namespace != null) { + t1 = _this._environment0$_getModule$1(namespace); + return t1.get$functions(t1).$index(0, $name); + } + t1 = _this._environment0$_functionIndices; + _0_0 = t1.$index(0, $name); + if (_0_0 != null) { + t1 = J.$index$asx(_this._environment0$_functions[_0_0], $name); + return t1 == null ? _this._environment0$_getFunctionFromGlobalModule$1($name) : t1; + } else { + _1_0 = _this._environment0$_functionIndex$1($name); + if (_1_0 != null) { + t1.$indexSet(0, $name, _1_0); + t1 = J.$index$asx(_this._environment0$_functions[_1_0], $name); + return t1 == null ? _this._environment0$_getFunctionFromGlobalModule$1($name) : t1; + } else + return _this._environment0$_getFunctionFromGlobalModule$1($name); + } + }, + getFunction$1($name) { + return this.getFunction$2$namespace($name, null); + }, + _environment0$_getFunctionFromGlobalModule$1($name) { + return this._environment0$_fromOneModule$3($name, "function", new A.Environment__getFunctionFromGlobalModule_closure0($name)); + }, + _environment0$_functionIndex$1($name) { + var t1, i; + for (t1 = this._environment0$_functions, i = t1.length - 1; i >= 0; --i) + if (t1[i].containsKey$1($name)) + return i; + return null; + }, + getMixin$2$namespace($name, namespace) { + var t1, _0_0, _1_0, _this = this; + if (namespace != null) + return _this._environment0$_getModule$1(namespace).get$mixins().$index(0, $name); + t1 = _this._environment0$_mixinIndices; + _0_0 = t1.$index(0, $name); + if (_0_0 != null) { + t1 = J.$index$asx(_this._environment0$_mixins[_0_0], $name); + return t1 == null ? _this._environment0$_getMixinFromGlobalModule$1($name) : t1; + } else { + _1_0 = _this._environment0$_mixinIndex$1($name); + if (_1_0 != null) { + t1.$indexSet(0, $name, _1_0); + t1 = J.$index$asx(_this._environment0$_mixins[_1_0], $name); + return t1 == null ? _this._environment0$_getMixinFromGlobalModule$1($name) : t1; + } else + return _this._environment0$_getMixinFromGlobalModule$1($name); + } + }, + _environment0$_getMixinFromGlobalModule$1($name) { + return this._environment0$_fromOneModule$3($name, "mixin", new A.Environment__getMixinFromGlobalModule_closure0($name)); + }, + _environment0$_mixinIndex$1($name) { + var t1, i; + for (t1 = this._environment0$_mixins, i = t1.length - 1; i >= 0; --i) + if (t1[i].containsKey$1($name)) + return i; + return null; + }, + withContent$2($content, callback) { + var oldContent = this._environment0$_content; + this._environment0$_content = $content; + callback.call$0(); + this._environment0$_content = oldContent; + }, + asMixin$1(callback) { + var oldInMixin = this._environment0$_inMixin; + this._environment0$_inMixin = true; + callback.call$0(); + this._environment0$_inMixin = oldInMixin; + }, + scope$1$3$semiGlobal$when(callback, semiGlobal, when) { + var wasInSemiGlobalScope, $name, name0, name1, t1, t2, t3, t4, t5, t6, _this = this; + semiGlobal = semiGlobal && _this._environment0$_inSemiGlobalScope; + wasInSemiGlobalScope = _this._environment0$_inSemiGlobalScope; + _this._environment0$_inSemiGlobalScope = semiGlobal; + if (!when) + try { + t1 = callback.call$0(); + return t1; + } finally { + _this._environment0$_inSemiGlobalScope = wasInSemiGlobalScope; + } + t1 = _this._environment0$_variables; + t2 = type$.String; + B.JSArray_methods.add$1(t1, A.LinkedHashMap_LinkedHashMap$_empty(t2, type$.Value_2)); + t3 = _this._environment0$_variableNodes; + B.JSArray_methods.add$1(t3, A.LinkedHashMap_LinkedHashMap$_empty(t2, type$.AstNode_2)); + t4 = _this._environment0$_functions; + t5 = type$.Callable_2; + B.JSArray_methods.add$1(t4, A.LinkedHashMap_LinkedHashMap$_empty(t2, t5)); + t6 = _this._environment0$_mixins; + B.JSArray_methods.add$1(t6, A.LinkedHashMap_LinkedHashMap$_empty(t2, t5)); + t5 = _this._environment0$_nestedForwardedModules; + if (t5 != null) + t5.push(A._setArrayType([], type$.JSArray_Module_Callable_2)); + try { + t2 = callback.call$0(); + return t2; + } finally { + _this._environment0$_inSemiGlobalScope = wasInSemiGlobalScope; + _this._environment0$_lastVariableIndex = _this._environment0$_lastVariableName = null; + for (t1 = J.get$iterator$ax(J.get$keys$z(B.JSArray_methods.removeLast$0(t1))), t2 = _this._environment0$_variableIndices; t1.moveNext$0();) { + $name = t1.get$current(t1); + t2.remove$1(0, $name); + } + B.JSArray_methods.removeLast$0(t3); + for (t1 = J.get$iterator$ax(J.get$keys$z(B.JSArray_methods.removeLast$0(t4))), t2 = _this._environment0$_functionIndices; t1.moveNext$0();) { + name0 = t1.get$current(t1); + t2.remove$1(0, name0); + } + for (t1 = J.get$iterator$ax(J.get$keys$z(B.JSArray_methods.removeLast$0(t6))), t2 = _this._environment0$_mixinIndices; t1.moveNext$0();) { + name1 = t1.get$current(t1); + t2.remove$1(0, name1); + } + t1 = _this._environment0$_nestedForwardedModules; + if (t1 != null) + t1.pop(); + } + }, + scope$1$1(callback) { + return this.scope$1$3$semiGlobal$when(callback, false, true); + }, + scope$1$2$when(callback, when) { + return this.scope$1$3$semiGlobal$when(callback, false, when); + }, + scope$1$2$semiGlobal(callback, semiGlobal) { + return this.scope$1$3$semiGlobal$when(callback, semiGlobal, true); + }, + toImplicitConfiguration$0() { + var t2, t3, t4, i, values, nodes, t5, t6, $name, value, + t1 = type$.String, + configuration = A.LinkedHashMap_LinkedHashMap$_empty(t1, type$.ConfiguredValue_2); + for (t2 = this._environment0$_variables, t3 = type$.Value_2, t4 = this._environment0$_variableNodes, i = 0; i < t2.length; ++i) { + values = t2[i]; + nodes = t4[i]; + for (t5 = A.MapExtensions_get_pairs0(values, t1, t3), t5 = t5.get$iterator(t5); t5.moveNext$0();) { + t6 = t5.get$current(t5); + $name = t6._0; + value = t6._1; + t6 = nodes.$index(0, $name); + t6.toString; + configuration.$indexSet(0, $name, new A.ConfiguredValue0(value, null, t6)); + } + } + return new A.Configuration0(configuration, null); + }, + toModule$3(css, preModuleComments, extensionStore) { + return A._EnvironmentModule__EnvironmentModule1(this, css, preModuleComments, extensionStore, A.NullableExtension_andThen0(this._environment0$_forwardedModules, new A.Environment_toModule_closure0())); + }, + toDummyModule$0() { + return A._EnvironmentModule__EnvironmentModule1(this, new A.CssStylesheet0(new A.UnmodifiableListView(B.List_empty16, type$.UnmodifiableListView_CssNode_2), A.SourceFile$decoded(B.List_empty4, "").span$1(0, 0)), B.Map_empty9, B.C_EmptyExtensionStore0, A.NullableExtension_andThen0(this._environment0$_forwardedModules, new A.Environment_toDummyModule_closure0())); + }, + _environment0$_getModule$1(namespace) { + var _0_0 = this._environment0$_modules.$index(0, namespace); + if (_0_0 != null) + return _0_0; + throw A.wrapException(A.SassScriptException$0('There is no module with the namespace "' + namespace + '".', null)); + }, + _environment0$_fromOneModule$1$3($name, type, callback) { + var t1, t2, t3, t4, t5, _1_0, _2_0, value, identity, valueInModule, identityFromModule, module, node, + _0_0 = this._environment0$_nestedForwardedModules; + if (_0_0 != null) + for (t1 = A._arrayInstanceType(_0_0)._eval$1("ReversedListIterable<1>"), t2 = new A.ReversedListIterable(_0_0, t1), t2 = new A.ListIterator(t2, t2.get$length(0), t1._eval$1("ListIterator")), t1 = t1._eval$1("ListIterable.E"); t2.moveNext$0();) { + t3 = t2.__internal$_current; + for (t3 = J.get$reversed$ax(t3 == null ? t1._as(t3) : t3), t4 = t3.$ti, t3 = new A.ListIterator(t3, t3.get$length(0), t4._eval$1("ListIterator")), t4 = t4._eval$1("ListIterable.E"); t3.moveNext$0();) { + t5 = t3.__internal$_current; + _1_0 = callback.call$1(t5 == null ? t4._as(t5) : t5); + if (_1_0 != null) + return _1_0; + } + } + for (t1 = this._environment0$_importedModules, t1 = A.LinkedHashMapKeyIterator$(t1, t1._modifications); t1.moveNext$0();) { + _2_0 = callback.call$1(t1.__js_helper$_current); + if (_2_0 != null) + return _2_0; + } + for (t1 = this._environment0$_globalModules, t2 = A.LinkedHashMapKeyIterator$(t1, t1._modifications), t3 = type$.Callable_2, value = null, identity = null; t2.moveNext$0();) { + t4 = t2.__js_helper$_current; + valueInModule = callback.call$1(t4); + if (valueInModule == null) + continue; + identityFromModule = t3._is(valueInModule) ? valueInModule : t4.variableIdentity$1($name); + if (identityFromModule.$eq(0, identity)) + continue; + if (value != null) { + t2 = A.LinkedHashMap_LinkedHashMap$_empty(type$.FileSpan, type$.String); + for (t3 = A.MapExtensions_get_pairs0(t1, type$.Module_Callable_2, type$.AstNode_2), t3 = t3.get$iterator(t3), t4 = "includes " + type; t3.moveNext$0();) { + t1 = t3.get$current(t3); + module = t1._0; + node = t1._1; + if (callback.call$1(module) != null) + t2.$indexSet(0, node.get$span(node), t4); + } + throw A.wrapException(A.MultiSpanSassScriptException$0("This " + type + string$.x20is_av, type + " use", t2)); + } + identity = identityFromModule; + value = valueInModule; + } + return value; + }, + _environment0$_fromOneModule$3($name, type, callback) { + return this._environment0$_fromOneModule$1$3($name, type, callback, type$.dynamic); + } + }; + A.Environment__getVariableFromGlobalModule_closure0.prototype = { + call$1(module) { + return module.get$variables().$index(0, this.name); + }, + $signature: 411 + }; + A.Environment_setVariable_closure2.prototype = { + call$0() { + var t1 = this.$this; + t1._environment0$_lastVariableName = this.name; + return t1._environment0$_lastVariableIndex = 0; + }, + $signature: 10 + }; + A.Environment_setVariable_closure3.prototype = { + call$1(module) { + return module.get$variables().containsKey$1(this.name) ? module : null; + }, + $signature: 412 + }; + A.Environment_setVariable_closure4.prototype = { + call$0() { + var t1 = this.$this, + t2 = t1._environment0$_variableIndex$1(this.name); + return t2 == null ? t1._environment0$_variables.length - 1 : t2; + }, + $signature: 10 + }; + A.Environment__getFunctionFromGlobalModule_closure0.prototype = { + call$1(module) { + return module.get$functions(module).$index(0, this.name); + }, + $signature: 260 + }; + A.Environment__getMixinFromGlobalModule_closure0.prototype = { + call$1(module) { + return module.get$mixins().$index(0, this.name); + }, + $signature: 260 + }; + A.Environment_toModule_closure0.prototype = { + call$1(modules) { + return new A.MapKeySet(modules, type$.MapKeySet_Module_Callable_2); + }, + $signature: 258 + }; + A.Environment_toDummyModule_closure0.prototype = { + call$1(modules) { + return new A.MapKeySet(modules, type$.MapKeySet_Module_Callable_2); + }, + $signature: 258 + }; + A._EnvironmentModule1.prototype = { + get$url(_) { + var t1 = this.css; + return t1.get$span(t1).file.url; + }, + setVariable$3($name, value, nodeWithSpan) { + var t1, t2, + _0_0 = this._environment0$_modulesByVariable.$index(0, $name); + if (_0_0 != null) { + _0_0.setVariable$3($name, value, nodeWithSpan); + return; + } + t1 = this._environment0$_environment; + t2 = t1._environment0$_variables; + if (!B.JSArray_methods.get$first(t2).containsKey$1($name)) + throw A.wrapException(A.SassScriptException$0("Undefined variable.", null)); + J.$indexSet$ax(B.JSArray_methods.get$first(t2), $name, value); + J.$indexSet$ax(B.JSArray_methods.get$first(t1._environment0$_variableNodes), $name, nodeWithSpan); + return; + }, + variableIdentity$1($name) { + var module = this._environment0$_modulesByVariable.$index(0, $name); + return module == null ? this : module.variableIdentity$1($name); + }, + cloneCss$0() { + var _0_0, _this = this; + if (!_this.transitivelyContainsCss) + return _this; + _0_0 = A.cloneCssStylesheet0(_this.css, _this.extensionStore); + return A._EnvironmentModule$_1(_this._environment0$_environment, _0_0._0, _this.preModuleComments, _0_0._1, _this._environment0$_modulesByVariable, _this.variables, _this.variableNodes, _this.functions, _this.mixins, true, _this.transitivelyContainsExtensions); + }, + toString$0(_) { + var t2, + t1 = this.css; + if (t1.get$span(t1).file.url == null) + t1 = ""; + else { + t1 = t1.get$span(t1).file.url; + t2 = $.$get$context(); + t1.toString; + t1 = t2.prettyUri$1(t1); + } + return t1; + }, + $isModule1: 1, + get$upstream() { + return this.upstream; + }, + get$variables() { + return this.variables; + }, + get$variableNodes() { + return this.variableNodes; + }, + get$functions(receiver) { + return this.functions; + }, + get$mixins() { + return this.mixins; + }, + get$extensionStore() { + return this.extensionStore; + }, + get$css(receiver) { + return this.css; + }, + get$preModuleComments() { + return this.preModuleComments; + }, + get$transitivelyContainsCss() { + return this.transitivelyContainsCss; + }, + get$transitivelyContainsExtensions() { + return this.transitivelyContainsExtensions; + } + }; + A._EnvironmentModule__EnvironmentModule_closure11.prototype = { + call$1(module) { + return module.get$variables(); + }, + $signature: 415 + }; + A._EnvironmentModule__EnvironmentModule_closure12.prototype = { + call$1(module) { + return module.get$variableNodes(); + }, + $signature: 521 + }; + A._EnvironmentModule__EnvironmentModule_closure13.prototype = { + call$1(module) { + return module.get$functions(module); + }, + $signature: 257 + }; + A._EnvironmentModule__EnvironmentModule_closure14.prototype = { + call$1(module) { + return module.get$mixins(); + }, + $signature: 257 + }; + A._EnvironmentModule__EnvironmentModule_closure15.prototype = { + call$1(module) { + return module.get$transitivelyContainsCss(); + }, + $signature: 138 + }; + A._EnvironmentModule__EnvironmentModule_closure16.prototype = { + call$1(module) { + return module.get$transitivelyContainsExtensions(); + }, + $signature: 138 + }; + A.ErrorRule0.prototype = { + accept$1$1(visitor) { + return visitor.visitErrorRule$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + toString$0(_) { + return "@error " + this.expression.toString$0(0) + ";"; + }, + $isAstNode0: 1, + $isStatement0: 1, + get$span(receiver) { + return this.span; + } + }; + A._EvaluateVisitor1.prototype = { + _EvaluateVisitor$6$functions$importCache$logger$nodeImporter$quietDeps$sourceMap1(functions, importCache, logger, nodeImporter, quietDeps, sourceMap) { + var t2, metaModule, t3, _i, module, $function, t4, _this = this, + _s20_ = "$name, $module: null", + _s9_ = "sass:meta", + _s7_ = "$module", + t1 = type$.JSArray_BuiltInCallable_2, + metaFunctions = A._setArrayType([A.BuiltInCallable$function0("global-variable-exists", _s20_, new A._EvaluateVisitor_closure25(_this), _s9_), A.BuiltInCallable$function0("variable-exists", "$name", new A._EvaluateVisitor_closure26(_this), _s9_), A.BuiltInCallable$function0("function-exists", _s20_, new A._EvaluateVisitor_closure27(_this), _s9_), A.BuiltInCallable$function0("mixin-exists", _s20_, new A._EvaluateVisitor_closure28(_this), _s9_), A.BuiltInCallable$function0("content-exists", "", new A._EvaluateVisitor_closure29(_this), _s9_), A.BuiltInCallable$function0("module-variables", _s7_, new A._EvaluateVisitor_closure30(_this), _s9_), A.BuiltInCallable$function0("module-functions", _s7_, new A._EvaluateVisitor_closure31(_this), _s9_), A.BuiltInCallable$function0("module-mixins", _s7_, new A._EvaluateVisitor_closure32(_this), _s9_), A.BuiltInCallable$function0("get-function", "$name, $css: false, $module: null", new A._EvaluateVisitor_closure33(_this), _s9_), A.BuiltInCallable$function0("get-mixin", _s20_, new A._EvaluateVisitor_closure34(_this), _s9_), A.BuiltInCallable$function0("call", "$function, $args...", new A._EvaluateVisitor_closure35(_this), _s9_)], t1), + metaMixins = A._setArrayType([A.BuiltInCallable$mixin0("load-css", "$url, $with: null", new A._EvaluateVisitor_closure36(_this), false, _s9_), A.BuiltInCallable$mixin0("apply", "$mixin, $args...", new A._EvaluateVisitor_closure37(_this), true, _s9_)], t1); + t1 = type$.BuiltInCallable_2; + t2 = A.List_List$of($.$get$global6(), true, t1); + B.JSArray_methods.addAll$1(t2, $.$get$local0()); + B.JSArray_methods.addAll$1(t2, metaFunctions); + metaModule = A.BuiltInModule$0("meta", t2, metaMixins, null, t1); + for (t1 = A.List_List$of($.$get$coreModules0(), true, type$.BuiltInModule_Callable_2), t1.push(metaModule), t2 = t1.length, t3 = _this._evaluate0$_builtInModules, _i = 0; _i < t1.length; t1.length === t2 || (0, A.throwConcurrentModificationError)(t1), ++_i) { + module = t1[_i]; + t3.$indexSet(0, module.url, module); + } + t1 = A._setArrayType([], type$.JSArray_Callable_2); + B.JSArray_methods.addAll$1(t1, functions); + B.JSArray_methods.addAll$1(t1, $.$get$globalFunctions0()); + B.JSArray_methods.addAll$1(t1, metaFunctions); + for (t2 = t1.length, t3 = _this._evaluate0$_builtInFunctions, _i = 0; _i < t1.length; t1.length === t2 || (0, A.throwConcurrentModificationError)(t1), ++_i) { + $function = t1[_i]; + t4 = J.get$name$x($function); + t3.$indexSet(0, A.stringReplaceAllUnchecked(t4, "_", "-"), $function); + } + }, + run$2(_, importer, node) { + var error, stackTrace, t1, exception; + try { + t1 = type$.nullable_Object; + t1 = A.runZoned(new A._EvaluateVisitor_run_closure1(this, node, importer), A.LinkedHashMap_LinkedHashMap$_literal([B.Symbol__evaluationContext, new A._EvaluationContext1(this, node)], t1, t1), type$.Record_2_Set_Uri_loadedUrls_and_CssStylesheet_stylesheet_2); + return t1; + } catch (exception) { + t1 = A.unwrapException(exception); + if (t1 instanceof A.SassException0) { + error = t1; + stackTrace = A.getTraceFromException(exception); + A.throwWithTrace0(error.withLoadedUrls$1(this._evaluate0$_loadedUrls), error, stackTrace); + } else + throw exception; + } + }, + _evaluate0$_assertInModule$1$2(value, $name) { + if (value != null) + return value; + throw A.wrapException(A.StateError$("Can't access " + $name + " outside of a module.")); + }, + _evaluate0$_assertInModule$2(value, $name) { + return this._evaluate0$_assertInModule$1$2(value, $name, type$.dynamic); + }, + _evaluate0$_loadModule$7$baseUrl$configuration$namesInErrors(url, stackFrame, nodeWithSpan, callback, baseUrl, configuration, namesInErrors) { + var _0_0, t2, _this = this, t1 = {}; + t1.builtInModule = null; + _0_0 = _this._evaluate0$_builtInModules.$index(0, url); + if (_0_0 != null) { + t1.builtInModule = _0_0; + if (configuration instanceof A.ExplicitConfiguration0) { + t1 = namesInErrors ? "Built-in module " + url.toString$0(0) + " can't be configured." : "Built-in modules can't be configured."; + t2 = configuration.nodeWithSpan; + throw A.wrapException(_this._evaluate0$_exception$2(t1, t2.get$span(t2))); + } + _this._evaluate0$_addExceptionSpan$2(nodeWithSpan, new A._EvaluateVisitor__loadModule_closure3(t1, callback)); + return; + } + _this._evaluate0$_withStackFrame$3(stackFrame, nodeWithSpan, new A._EvaluateVisitor__loadModule_closure4(_this, url, nodeWithSpan, baseUrl, namesInErrors, configuration, callback)); + }, + _evaluate0$_loadModule$5$configuration(url, stackFrame, nodeWithSpan, callback, configuration) { + return this._evaluate0$_loadModule$7$baseUrl$configuration$namesInErrors(url, stackFrame, nodeWithSpan, callback, null, configuration, false); + }, + _evaluate0$_loadModule$4(url, stackFrame, nodeWithSpan, callback) { + return this._evaluate0$_loadModule$7$baseUrl$configuration$namesInErrors(url, stackFrame, nodeWithSpan, callback, null, null, false); + }, + _evaluate0$_execute$5$configuration$namesInErrors$nodeWithSpan(importer, stylesheet, configuration, namesInErrors, nodeWithSpan) { + var currentConfiguration, t2, t3, message, existingSpan, configurationSpan, environment, css, preModuleComments, extensionStore, module, _this = this, + url = stylesheet.span.file.url, + t1 = _this._evaluate0$_modules, + _0_0 = t1.$index(0, url); + if (_0_0 != null) { + t1 = configuration == null; + currentConfiguration = t1 ? _this._evaluate0$_configuration : configuration; + t2 = _this._evaluate0$_moduleConfigurations.$index(0, url); + t3 = t2._configuration0$__originalConfiguration; + t2 = t3 == null ? t2 : t3; + t3 = currentConfiguration._configuration0$__originalConfiguration; + if (t2 !== (t3 == null ? currentConfiguration : t3) && currentConfiguration instanceof A.ExplicitConfiguration0) { + if (namesInErrors) { + t2 = $.$get$context(); + url.toString; + message = t2.prettyUri$1(url) + string$.x20was_a; + } else + message = string$.This_mw; + t2 = _this._evaluate0$_moduleNodes.$index(0, url); + existingSpan = t2 == null ? null : t2.get$span(t2); + if (t1) { + t1 = currentConfiguration.nodeWithSpan; + configurationSpan = t1.get$span(t1); + } else + configurationSpan = null; + t1 = A.LinkedHashMap_LinkedHashMap$_empty(type$.FileSpan, type$.String); + if (existingSpan != null) + t1.$indexSet(0, existingSpan, "original load"); + if (configurationSpan != null) + t1.$indexSet(0, configurationSpan, "configuration"); + throw A.wrapException(t1.get$isEmpty(0) ? _this._evaluate0$_exception$1(message) : _this._evaluate0$_multiSpanException$3(message, "new load", t1)); + } + return _0_0; + } + environment = A.Environment$0(); + css = A._Cell$(); + preModuleComments = A._Cell$(); + extensionStore = A.ExtensionStore$0(); + _this._evaluate0$_withEnvironment$2(environment, new A._EvaluateVisitor__execute_closure1(_this, importer, stylesheet, extensionStore, configuration, css, preModuleComments)); + t2 = css._readLocal$0(); + t3 = preModuleComments._readLocal$0(); + module = environment.toModule$3(t2, t3 == null ? B.Map_empty9 : t3, extensionStore); + if (url != null) { + t1.$indexSet(0, url, module); + _this._evaluate0$_moduleConfigurations.$indexSet(0, url, _this._evaluate0$_configuration); + if (nodeWithSpan != null) + _this._evaluate0$_moduleNodes.$indexSet(0, url, nodeWithSpan); + } + return module; + }, + _evaluate0$_execute$2(importer, stylesheet) { + return this._evaluate0$_execute$5$configuration$namesInErrors$nodeWithSpan(importer, stylesheet, null, false, null); + }, + _evaluate0$_addOutOfOrderImports$0() { + var t1, t2, _this = this, _s5_ = "_root", + _s13_ = "_endOfImports", + _0_0 = _this._evaluate0$_outOfOrderImports; + $label0$0: { + if (_0_0 == null) { + t1 = _this._evaluate0$_assertInModule$2(_this._evaluate0$__root, _s5_).children; + break $label0$0; + } + t1 = _this._evaluate0$_assertInModule$2(_this._evaluate0$__root, _s5_).children; + t1 = A.List_List$of(A.SubListIterable$(t1, 0, A.checkNotNullable(_this._evaluate0$_assertInModule$2(_this._evaluate0$__endOfImports, _s13_), "count", type$.int), t1.$ti._eval$1("ListBase.E")), true, type$.ModifiableCssNode_2); + B.JSArray_methods.addAll$1(t1, _0_0); + t2 = _this._evaluate0$_assertInModule$2(_this._evaluate0$__root, _s5_).children; + B.JSArray_methods.addAll$1(t1, A.SubListIterable$(t2, _this._evaluate0$_assertInModule$2(_this._evaluate0$__endOfImports, _s13_), null, t2.$ti._eval$1("ListBase.E"))); + break $label0$0; + } + return t1; + }, + _evaluate0$_combineCss$2$clone(root, clone) { + var selectors, _0_0, t1, imports, css, sorted, t2; + if (!B.JSArray_methods.any$1(root.get$upstream(), new A._EvaluateVisitor__combineCss_closure3())) { + selectors = root.get$extensionStore().get$simpleSelectors(); + _0_0 = A.IterableExtension_get_firstOrNull(root.get$extensionStore().extensionsWhereTarget$1(new A._EvaluateVisitor__combineCss_closure4(selectors))); + if (_0_0 != null) + this._evaluate0$_throwForUnsatisfiedExtension$1(_0_0); + return root.get$css(root); + } + t1 = type$.JSArray_CssNode_2; + imports = A._setArrayType([], t1); + css = A._setArrayType([], t1); + t1 = type$.Module_Callable_2; + sorted = A.ListQueue$(t1); + new A._EvaluateVisitor__combineCss_visitModule1(this, A.LinkedHashSet_LinkedHashSet$_empty(t1), clone, css, imports, sorted).call$1(root); + if (root.get$transitivelyContainsExtensions()) + this._evaluate0$_extendModules$1(sorted); + t1 = B.JSArray_methods.$add(imports, css); + t2 = root.get$css(root); + return new A.CssStylesheet0(new A.UnmodifiableListView(t1, type$.UnmodifiableListView_CssNode_2), t2.get$span(t2)); + }, + _evaluate0$_combineCss$1(root) { + return this._evaluate0$_combineCss$2$clone(root, false); + }, + _evaluate0$_extendModules$1(sortedModules) { + var t1, t2, t3, originalSelectors, $self, t4, t5, _i, upstream, _0_0, + downstreamExtensionStores = A.LinkedHashMap_LinkedHashMap$_empty(type$.Uri, type$.List_ExtensionStore_2), + unsatisfiedExtensions = new A._LinkedIdentityHashSet(type$._LinkedIdentityHashSet_Extension_2); + for (t1 = A._ListQueueIterator$(sortedModules, sortedModules.$ti._precomputed1), t2 = t1.$ti._precomputed1; t1.moveNext$0();) { + t3 = t1._collection$_current; + if (t3 == null) + t3 = t2._as(t3); + originalSelectors = t3.get$extensionStore().get$simpleSelectors().toSet$0(0); + unsatisfiedExtensions.addAll$1(0, t3.get$extensionStore().extensionsWhereTarget$1(new A._EvaluateVisitor__extendModules_closure3(originalSelectors))); + $self = downstreamExtensionStores.$index(0, t3.get$url(t3)); + t4 = t3.get$extensionStore().get$addExtensions(); + if ($self != null) + t4.call$1($self); + t4 = t3.get$extensionStore(); + if (t4.get$isEmpty(t4)) + continue; + for (t4 = t3.get$upstream(), t5 = t4.length, _i = 0; _i < t4.length; t4.length === t5 || (0, A.throwConcurrentModificationError)(t4), ++_i) { + upstream = t4[_i]; + _0_0 = upstream.get$url(upstream); + if (_0_0 != null) + J.add$1$ax(downstreamExtensionStores.putIfAbsent$2(_0_0, new A._EvaluateVisitor__extendModules_closure4()), t3.get$extensionStore()); + } + unsatisfiedExtensions.removeAll$1(t3.get$extensionStore().extensionsWhereTarget$1(originalSelectors.get$contains(originalSelectors))); + } + if (unsatisfiedExtensions._collection$_length !== 0) + this._evaluate0$_throwForUnsatisfiedExtension$1(unsatisfiedExtensions.get$first(0)); + }, + _evaluate0$_throwForUnsatisfiedExtension$1(extension) { + throw A.wrapException(A.SassException$0(string$.The_ta + extension.target.toString$0(0) + ' !optional" to avoid this error.', extension.span, null)); + }, + _evaluate0$_indexAfterImports$1(statements) { + var t1, lastImport, i, _0_0; + for (t1 = J.getInterceptor$asx(statements), lastImport = -1, i = 0; i < t1.get$length(statements); ++i) { + $label0$0: { + _0_0 = t1.$index(statements, i); + if (_0_0 instanceof A.ModifiableCssImport0) + break $label0$0; + if (_0_0 instanceof A.ModifiableCssComment0) + continue; + break; + } + lastImport = i; + } + return lastImport + 1; + }, + visitStylesheet$1(node) { + var t1, t2, _i; + for (t1 = node.children, t2 = t1.length, _i = 0; _i < t2; ++_i) + t1[_i].accept$1(this); + return null; + }, + visitAtRootRule$1(node) { + var t1, _2_0, root, first, rest, innerCopy, outerCopy, _i, copy, _this = this, + _s8_ = "__parent", + _0_0 = node.query, + query = _0_0 != null ? A.AtRootQueryParser$0(_this._evaluate0$_performInterpolationWithMap$2$warnForColor(_0_0, true)._0, _this._evaluate0$_logger, null).parse$0() : B.AtRootQuery_UsS0, + $parent = _this._evaluate0$_assertInModule$2(_this._evaluate0$__parent, _s8_), + included = A._setArrayType([], type$.JSArray_ModifiableCssParentNode_2); + for (t1 = type$.CssStylesheet_2; !t1._is($parent); $parent = _2_0) { + if (!query.excludes$1($parent)) + included.push($parent); + _2_0 = $parent._node$_parent; + if (_2_0 == null) + throw A.wrapException(A.StateError$(string$.CssNod)); + } + root = _this._evaluate0$_trimIncluded$1(included); + if (root === _this._evaluate0$_assertInModule$2(_this._evaluate0$__parent, _s8_)) { + _this._evaluate0$_environment.scope$1$2$when(new A._EvaluateVisitor_visitAtRootRule_closure3(_this, node), node.hasDeclarations, type$.Null); + return null; + } + if (included.length >= 1) { + first = included[0]; + rest = B.JSArray_methods.sublist$1(included, 1); + innerCopy = first.copyWithoutChildren$0(); + for (t1 = rest.length, outerCopy = innerCopy, _i = 0; _i < rest.length; rest.length === t1 || (0, A.throwConcurrentModificationError)(rest), ++_i, outerCopy = copy) { + copy = rest[_i].copyWithoutChildren$0(); + copy.addChild$1(outerCopy); + } + root.addChild$1(outerCopy); + } else + innerCopy = root; + _this._evaluate0$_scopeForAtRoot$4(node, innerCopy, query, included).call$1(new A._EvaluateVisitor_visitAtRootRule_closure4(_this, node)); + return null; + }, + _evaluate0$_trimIncluded$1(nodes) { + var $parent, t1, innermostContiguous, i, t2, _0_0, _1_0, root, _this = this, _null = null, _s5_ = "_root", + _s22_ = " to be an ancestor of "; + if (nodes.length === 0) + return _this._evaluate0$_assertInModule$2(_this._evaluate0$__root, _s5_); + $parent = _this._evaluate0$_assertInModule$2(_this._evaluate0$__parent, "__parent"); + for (t1 = nodes.length, innermostContiguous = _null, i = 0; i < t1; ++i, $parent = _1_0) { + for (; t2 = nodes[i], $parent !== t2; innermostContiguous = _null, $parent = _0_0) { + _0_0 = $parent._node$_parent; + if (_0_0 == null) + throw A.wrapException(A.ArgumentError$("Expected " + t2.toString$0(0) + _s22_ + _this.toString$0(0) + ".", _null)); + } + if (innermostContiguous == null) + innermostContiguous = i; + _1_0 = $parent._node$_parent; + if (_1_0 == null) + throw A.wrapException(A.ArgumentError$("Expected " + t2.toString$0(0) + _s22_ + _this.toString$0(0) + ".", _null)); + } + if ($parent !== _this._evaluate0$_assertInModule$2(_this._evaluate0$__root, _s5_)) + return _this._evaluate0$_assertInModule$2(_this._evaluate0$__root, _s5_); + innermostContiguous.toString; + root = nodes[innermostContiguous]; + B.JSArray_methods.removeRange$2(nodes, innermostContiguous, nodes.length); + return root; + }, + _evaluate0$_scopeForAtRoot$4(node, newParent, query, included) { + var _this = this, + scope = new A._EvaluateVisitor__scopeForAtRoot_closure11(_this, newParent, node), + t1 = query._at_root_query0$_all || query._at_root_query0$_rule; + if (t1 !== query.include) + scope = new A._EvaluateVisitor__scopeForAtRoot_closure12(_this, scope); + if (_this._evaluate0$_mediaQueries != null && query.excludesName$1("media")) + scope = new A._EvaluateVisitor__scopeForAtRoot_closure13(_this, scope); + if (_this._evaluate0$_inKeyframes && query.excludesName$1("keyframes")) + scope = new A._EvaluateVisitor__scopeForAtRoot_closure14(_this, scope); + return _this._evaluate0$_inUnknownAtRule && !B.JSArray_methods.any$1(included, new A._EvaluateVisitor__scopeForAtRoot_closure15()) ? new A._EvaluateVisitor__scopeForAtRoot_closure16(_this, scope) : scope; + }, + visitContentBlock$1(node) { + return A.throwExpression(A.UnsupportedError$(string$.Evalua)); + }, + visitContentRule$1(node) { + var $content = this._evaluate0$_environment._environment0$_content; + if ($content == null) + return null; + this._evaluate0$_runUserDefinedCallable$1$4(node.$arguments, $content, node, new A._EvaluateVisitor_visitContentRule_closure1(this, $content), type$.Null); + return null; + }, + visitDebugRule$1(node) { + var value = node.expression.accept$1(this), + t1 = value instanceof A.SassString0 ? value._string0$_text : A.serializeValue0(value, true, true); + this._evaluate0$_logger.debug$2(0, t1, node.span); + return null; + }, + visitDeclaration$1(node) { + var t2, $name, _0_0, _1_0, value, t3, t4, t5, _2_0, oldDeclarationName, _this = this, _null = null, t1 = {}; + if ((_this._evaluate0$_atRootExcludingStyleRule ? _null : _this._evaluate0$_styleRuleIgnoringAtRoot) == null && !_this._evaluate0$_inUnknownAtRule && !_this._evaluate0$_inKeyframes) + throw A.wrapException(_this._evaluate0$_exception$2(string$.Declarm, node.span)); + if (_this._evaluate0$_declarationName != null && B.JSString_methods.startsWith$1(node.name.get$initialPlain(), "--")) + throw A.wrapException(_this._evaluate0$_exception$2(string$.Declarw, node.span)); + t2 = node.name; + $name = _this._evaluate0$_interpolationToValue$2$warnForColor(t2, true); + _0_0 = _this._evaluate0$_declarationName; + if (_0_0 != null) + $name = new A.CssValue0(_0_0 + "-" + A.S($name.value), $name.span, type$.CssValue_String_2); + _1_0 = node.value; + if (_1_0 != null) { + value = _1_0.accept$1(_this); + if (!value.get$isBlank() || value.get$asList().length === 0) { + t3 = _this._evaluate0$_assertInModule$2(_this._evaluate0$__parent, "__parent"); + t4 = _1_0.get$span(_1_0); + t2 = B.JSString_methods.startsWith$1(t2.get$initialPlain(), "--"); + if (_this._evaluate0$_sourceMap) { + t5 = A.NullableExtension_andThen0(_1_0, _this.get$_evaluate0$_expressionNode()); + t5 = t5 == null ? _null : J.get$span$z(t5); + } else + t5 = _null; + t3.addChild$1(A.ModifiableCssDeclaration$0($name, new A.CssValue0(value, t4, type$.CssValue_Value_2), node.span, t2, t5)); + } else if (J.startsWith$1$s($name.value, "--")) + throw A.wrapException(_this._evaluate0$_exception$2("Custom property values may not be empty.", _1_0.get$span(_1_0))); + } + t1.children = null; + _2_0 = node.children; + if (_2_0 != null) { + t1.children = _2_0; + oldDeclarationName = _this._evaluate0$_declarationName; + _this._evaluate0$_declarationName = $name.value; + _this._evaluate0$_environment.scope$1$2$when(new A._EvaluateVisitor_visitDeclaration_closure1(t1, _this), node.hasDeclarations, type$.Null); + _this._evaluate0$_declarationName = oldDeclarationName; + } + return _null; + }, + visitEachRule$1(node) { + var _this = this, _box_0 = {}, + t1 = node.list, + list = t1.accept$1(_this), + nodeWithSpan = _this._evaluate0$_expressionNode$1(t1), + _0_0 = node.variables; + $label0$0: { + _box_0.variable = null; + if (_0_0.length === 1) { + _box_0.variable = _0_0[0]; + t1 = new A._EvaluateVisitor_visitEachRule_closure5(_box_0, _this, nodeWithSpan); + break $label0$0; + } + _box_0.variables = null; + _box_0.variables = _0_0; + t1 = new A._EvaluateVisitor_visitEachRule_closure6(_box_0, _this, nodeWithSpan); + break $label0$0; + } + return _this._evaluate0$_environment.scope$1$2$semiGlobal(new A._EvaluateVisitor_visitEachRule_closure7(_this, list, t1, node), true, type$.nullable_Value_2); + }, + _evaluate0$_setMultipleVariables$3(variables, value, nodeWithSpan) { + var i, + list = value.get$asList(), + t1 = variables.length, + minLength = Math.min(t1, list.length); + for (i = 0; i < minLength; ++i) + this._evaluate0$_environment.setLocalVariable$3(variables[i], this._evaluate0$_withoutSlash$2(list[i], nodeWithSpan), nodeWithSpan); + for (i = minLength; i < t1; ++i) + this._evaluate0$_environment.setLocalVariable$3(variables[i], B.C__SassNull0, nodeWithSpan); + }, + visitErrorRule$1(node) { + throw A.wrapException(this._evaluate0$_exception$2(J.toString$0$(node.expression.accept$1(this)), node.span)); + }, + visitExtendRule$1(node) { + var t1, t2, t3, t4, t5, _i, complex, visitor, t6, t7, _0_0, compound, _this = this, _null = null, + styleRule = _this._evaluate0$_atRootExcludingStyleRule ? _null : _this._evaluate0$_styleRuleIgnoringAtRoot; + if (styleRule == null || _this._evaluate0$_declarationName != null) + throw A.wrapException(_this._evaluate0$_exception$2(string$.x40exten, node.span)); + for (t1 = styleRule.originalSelector.components, t2 = t1.length, t3 = node.span, t4 = type$.SourceSpan, t5 = type$.String, _i = 0; _i < t2; ++_i) { + complex = t1[_i]; + if (!complex.accept$1(B._IsBogusVisitor_true0)) + continue; + visitor = A._SerializeVisitor$0(_null, true, _null, true, false, _null, true); + complex.accept$1(visitor); + t6 = B.JSString_methods.trim$0(visitor._serialize0$_buffer.toString$0(0)); + t7 = complex.accept$1(B.C__IsUselessVisitor0) ? "can't" : "shouldn't"; + _this._evaluate0$_warn$3('The selector "' + t6 + '" is invalid CSS and ' + t7 + string$.x20be_an, new A.MultiSpan0(A.SpanExtensions_trimRight0(complex.span), "invalid selector", A.ConstantMap_ConstantMap$from(A.LinkedHashMap_LinkedHashMap$_literal([t3, "@extend rule"], t4, t5), t4, t5)), B.Deprecation_XV6); + } + _0_0 = _this._evaluate0$_performInterpolationWithMap$2$warnForColor(node.selector, true); + for (t1 = A.SelectorList_SelectorList$parse0(A.trimAscii0(_0_0._0, true), false, true, _0_0._1, _this._evaluate0$_logger).components, t2 = t1.length, t3 = styleRule._style_rule0$_selector._box0$_inner, _i = 0; _i < t2; ++_i) { + complex = t1[_i]; + compound = complex.get$singleCompound(); + if (compound == null) + throw A.wrapException(A.SassFormatException$0("complex selectors may not be extended.", complex.span, _null)); + t4 = compound.components; + t5 = t4.length === 1 ? B.JSArray_methods.get$first(t4) : _null; + if (t5 == null) + throw A.wrapException(A.SassFormatException$0(string$.compou + B.JSArray_methods.join$1(t4, ", ") + string$.x60_inst, compound.span, _null)); + _this._evaluate0$_assertInModule$2(_this._evaluate0$__extensionStore, "_extensionStore").addExtension$4(t3.value, t5, node, _this._evaluate0$_mediaQueries); + } + return _null; + }, + visitAtRule$1(node) { + var $name, value, children, wasInKeyframes, wasInUnknownAtRule, _this = this; + if (_this._evaluate0$_declarationName != null) + throw A.wrapException(_this._evaluate0$_exception$2(string$.At_rul, node.span)); + $name = _this._evaluate0$_interpolationToValue$1(node.name); + value = A.NullableExtension_andThen0(node.value, new A._EvaluateVisitor_visitAtRule_closure5(_this)); + children = node.children; + if (children == null) { + _this._evaluate0$_assertInModule$2(_this._evaluate0$__parent, "__parent").addChild$1(A.ModifiableCssAtRule$0($name, node.span, true, value)); + return null; + } + wasInKeyframes = _this._evaluate0$_inKeyframes; + wasInUnknownAtRule = _this._evaluate0$_inUnknownAtRule; + if (A.unvendor0($name.value) === "keyframes") + _this._evaluate0$_inKeyframes = true; + else + _this._evaluate0$_inUnknownAtRule = true; + _this._evaluate0$_withParent$2$4$scopeWhen$through(A.ModifiableCssAtRule$0($name, node.span, false, value), new A._EvaluateVisitor_visitAtRule_closure6(_this, $name, children), node.hasDeclarations, new A._EvaluateVisitor_visitAtRule_closure7(), type$.ModifiableCssAtRule_2, type$.Null); + _this._evaluate0$_inUnknownAtRule = wasInUnknownAtRule; + _this._evaluate0$_inKeyframes = wasInKeyframes; + return null; + }, + visitForRule$1(node) { + var _this = this, t1 = {}, + t2 = node.from, + fromNumber = _this._evaluate0$_addExceptionSpan$2(t2, new A._EvaluateVisitor_visitForRule_closure9(_this, node)), + t3 = node.to, + toNumber = _this._evaluate0$_addExceptionSpan$2(t3, new A._EvaluateVisitor_visitForRule_closure10(_this, node)), + from = _this._evaluate0$_addExceptionSpan$2(t2, new A._EvaluateVisitor_visitForRule_closure11(fromNumber)), + to = t1.to = _this._evaluate0$_addExceptionSpan$2(t3, new A._EvaluateVisitor_visitForRule_closure12(toNumber, fromNumber)), + direction = from > to ? -1 : 1; + if (from === (!node.isExclusive ? t1.to = to + direction : to)) + return null; + return _this._evaluate0$_environment.scope$1$2$semiGlobal(new A._EvaluateVisitor_visitForRule_closure13(t1, _this, node, from, direction, fromNumber), true, type$.nullable_Value_2); + }, + visitForwardRule$1(node) { + var newConfiguration, t4, _i, variable, $name, _this = this, + _s8_ = "@forward", + oldConfiguration = _this._evaluate0$_configuration, + adjustedConfiguration = oldConfiguration.throughForward$1(node), + t1 = node.configuration, + t2 = t1.length, + t3 = node.url; + if (t2 !== 0) { + newConfiguration = _this._evaluate0$_addForwardConfiguration$2(adjustedConfiguration, node); + _this._evaluate0$_loadModule$5$configuration(t3, _s8_, node, new A._EvaluateVisitor_visitForwardRule_closure3(_this, node), newConfiguration); + t3 = type$.String; + t4 = A.LinkedHashSet_LinkedHashSet$_empty(t3); + for (_i = 0; _i < t2; ++_i) { + variable = t1[_i]; + if (!variable.isGuarded) + t4.add$1(0, variable.name); + } + _this._evaluate0$_removeUsedConfiguration$3$except(adjustedConfiguration, newConfiguration, t4); + t3 = A.LinkedHashSet_LinkedHashSet$_empty(t3); + for (_i = 0; _i < t2; ++_i) + t3.add$1(0, t1[_i].name); + for (t1 = newConfiguration._configuration0$_values, t2 = J.toList$0$ax(t1.get$keys(t1)), t4 = t2.length, _i = 0; _i < t2.length; t2.length === t4 || (0, A.throwConcurrentModificationError)(t2), ++_i) { + $name = t2[_i]; + if (!t3.contains$1(0, $name)) + if (!t1.get$isEmpty(t1)) + t1.remove$1(0, $name); + } + _this._evaluate0$_assertConfigurationIsEmpty$1(newConfiguration); + } else { + _this._evaluate0$_configuration = adjustedConfiguration; + _this._evaluate0$_loadModule$4(t3, _s8_, node, new A._EvaluateVisitor_visitForwardRule_closure4(_this, node)); + _this._evaluate0$_configuration = oldConfiguration; + } + return null; + }, + _evaluate0$_addForwardConfiguration$2(configuration, node) { + var t2, t3, _i, variable, t4, oldValue, t5, variableNodeWithSpan, _null = null, + t1 = configuration._configuration0$_values, + newValues = A.LinkedHashMap_LinkedHashMap$of(new A.UnmodifiableMapView(t1, type$.UnmodifiableMapView_String_ConfiguredValue_2), type$.String, type$.ConfiguredValue_2); + for (t2 = node.configuration, t3 = t2.length, _i = 0; _i < t3; ++_i) { + variable = t2[_i]; + if (variable.isGuarded) { + t4 = variable.name; + oldValue = t1.get$isEmpty(t1) ? _null : t1.remove$1(0, t4); + if (oldValue != null) + t5 = !oldValue.value.$eq(0, B.C__SassNull0); + else { + oldValue = _null; + t5 = false; + } + if (t5) { + newValues.$indexSet(0, t4, oldValue); + continue; + } + } + t4 = variable.expression; + variableNodeWithSpan = this._evaluate0$_expressionNode$1(t4); + newValues.$indexSet(0, variable.name, new A.ConfiguredValue0(this._evaluate0$_withoutSlash$2(t4.accept$1(this), variableNodeWithSpan), variable.span, variableNodeWithSpan)); + } + if (configuration instanceof A.ExplicitConfiguration0 || t1.get$isEmpty(t1)) + return new A.ExplicitConfiguration0(node, newValues, _null); + else + return new A.Configuration0(newValues, _null); + }, + _evaluate0$_registerCommentsForModule$1(module) { + var _this = this, _s5_ = "_root", + t1 = _this._evaluate0$__root; + if (t1 == null) + return; + if (_this._evaluate0$_assertInModule$2(t1, _s5_).children.get$length(0) === 0 || !module.get$transitivelyContainsCss()) + return; + t1 = _this._evaluate0$_preModuleComments; + if (t1 == null) + t1 = _this._evaluate0$_preModuleComments = A.LinkedHashMap_LinkedHashMap$_empty(type$.Module_Callable_2, type$.List_CssComment_2); + J.addAll$1$ax(t1.putIfAbsent$2(module, new A._EvaluateVisitor__registerCommentsForModule_closure1()), new A.UnmodifiableListView(J.cast$1$0$ax(_this._evaluate0$_assertInModule$2(_this._evaluate0$__root, _s5_).children._collection$_source, type$.CssComment_2), type$.UnmodifiableListView_CssComment_2)); + _this._evaluate0$_assertInModule$2(_this._evaluate0$__root, _s5_).clearChildren$0(); + _this._evaluate0$__endOfImports = 0; + }, + _evaluate0$_removeUsedConfiguration$3$except(upstream, downstream, except) { + var t1, t2, t3, t4, _i, $name; + for (t1 = upstream._configuration0$_values, t2 = J.toList$0$ax(t1.get$keys(t1)), t3 = t2.length, t4 = downstream._configuration0$_values, _i = 0; _i < t2.length; t2.length === t3 || (0, A.throwConcurrentModificationError)(t2), ++_i) { + $name = t2[_i]; + if (except.contains$1(0, $name)) + continue; + if (!t4.containsKey$1($name)) + if (!t1.get$isEmpty(t1)) + t1.remove$1(0, $name); + } + }, + _evaluate0$_assertConfigurationIsEmpty$2$nameInError(configuration, nameInError) { + var t1, _0_0, $name, value; + if (!(configuration instanceof A.ExplicitConfiguration0)) + return; + t1 = configuration._configuration0$_values; + if (t1.get$isEmpty(t1)) + return; + t1 = A.MapExtensions_get_pairs0(new A.UnmodifiableMapView(t1, type$.UnmodifiableMapView_String_ConfiguredValue_2), type$.String, type$.ConfiguredValue_2); + _0_0 = t1.get$first(t1); + $name = _0_0._0; + value = _0_0._1; + t1 = nameInError ? "$" + $name + string$.x20was_n : string$.This_v; + throw A.wrapException(this._evaluate0$_exception$2(t1, value.configurationSpan)); + }, + _evaluate0$_assertConfigurationIsEmpty$1(configuration) { + return this._evaluate0$_assertConfigurationIsEmpty$2$nameInError(configuration, false); + }, + visitFunctionRule$1(node) { + var t1 = this._evaluate0$_environment, + t2 = t1.closure$0(), + t3 = this._evaluate0$_inDependency, + t4 = t1._environment0$_functions, + index = t4.length - 1, + t5 = node.name; + t1._environment0$_functionIndices.$indexSet(0, t5, index); + J.$indexSet$ax(t4[index], t5, new A.UserDefinedCallable0(node, t2, t3, type$.UserDefinedCallable_Environment_2)); + return null; + }, + visitIfRule$1(node) { + var t1, t2, _i, clauseToCheck, + clause = node.lastClause; + for (t1 = node.clauses, t2 = t1.length, _i = 0; _i < t2; ++_i) { + clauseToCheck = t1[_i]; + if (clauseToCheck.expression.accept$1(this).get$isTruthy()) { + clause = clauseToCheck; + break; + } + } + return A.NullableExtension_andThen0(clause, new A._EvaluateVisitor_visitIfRule_closure1(this)); + }, + visitImportRule$1(node) { + var t1, t2, t3, t4, t5, t6, _i, $import, t7, _0_0, $self, t8, _this = this, + _s8_ = "__parent", + _s5_ = "_root", + _s13_ = "_endOfImports"; + for (t1 = node.imports, t2 = t1.length, t3 = type$.CssValue_String_2, t4 = _this.get$_evaluate0$_interpolationToValue(), t5 = type$.StaticImport_2, t6 = type$.JSArray_ModifiableCssImport_2, _i = 0; _i < t2; ++_i) { + $import = t1[_i]; + if ($import instanceof A.DynamicImport0) + _this._evaluate0$_visitDynamicImport$1($import); + else { + t5._as($import); + t7 = $import.url; + _0_0 = _this._evaluate0$_performInterpolationHelper$3$sourceMap$warnForColor(t7, false, false); + $self = $import.modifiers; + t8 = $self == null ? null : t4.call$1($self); + node = new A.ModifiableCssImport0(new A.CssValue0(_0_0._0, t7.span, t3), t8, $import.span); + if (_this._evaluate0$_assertInModule$2(_this._evaluate0$__parent, _s8_) !== _this._evaluate0$_assertInModule$2(_this._evaluate0$__root, _s5_)) + _this._evaluate0$_assertInModule$2(_this._evaluate0$__parent, _s8_).addChild$1(node); + else if (_this._evaluate0$_assertInModule$2(_this._evaluate0$__endOfImports, _s13_) === J.get$length$asx(_this._evaluate0$_assertInModule$2(_this._evaluate0$__root, _s5_).children._collection$_source)) { + t7 = _this._evaluate0$_assertInModule$2(_this._evaluate0$__root, _s5_); + node._node$_parent = t7; + t7 = t7._node$_children; + node._node$_indexInParent = t7.length; + t7.push(node); + _this._evaluate0$__endOfImports = _this._evaluate0$_assertInModule$2(_this._evaluate0$__endOfImports, _s13_) + 1; + } else { + t7 = _this._evaluate0$_outOfOrderImports; + (t7 == null ? _this._evaluate0$_outOfOrderImports = A._setArrayType([], t6) : t7).push(node); + } + } + } + return null; + }, + _evaluate0$_visitDynamicImport$1($import) { + return this._evaluate0$_withStackFrame$3("@import", $import, new A._EvaluateVisitor__visitDynamicImport_closure1(this, $import)); + }, + _evaluate0$_loadStylesheet$4$baseUrl$forImport(url, span, baseUrl, forImport) { + var importCache, _0_0, importer, canonicalUrl, originalUrl, _1_0, isDependency, stylesheet, _2_0, result, _3_0, error, stackTrace, error0, stackTrace0, message, t1, t2, t3, t4, exception, message0, _this = this, + _s11_ = "_stylesheet"; + baseUrl = baseUrl; + try { + _this._evaluate0$_importSpan = span; + importCache = null; + _0_0 = _this._evaluate0$_importCache; + if (_0_0 != null) { + importCache = _0_0; + if (baseUrl == null) + baseUrl = _this._evaluate0$_assertInModule$2(_this._evaluate0$__stylesheet, _s11_).span.file.url; + importer = null; + canonicalUrl = null; + originalUrl = null; + _1_0 = J.canonicalize$4$baseImporter$baseUrl$forImport$x(importCache, A.Uri_parse(url), _this._evaluate0$_importer, baseUrl, forImport); + if (type$.Record_3_nullable_Object_and_nullable_Object_and_nullable_Object_originalUrl._is(_1_0)) { + importer = _1_0._0; + canonicalUrl = _1_0._1; + originalUrl = _1_0._2; + _this._evaluate0$_loadedUrls.add$1(0, canonicalUrl); + isDependency = _this._evaluate0$_inDependency || !J.$eq$(importer, _this._evaluate0$_importer); + stylesheet = null; + t1 = importCache; + t2 = importer; + t3 = canonicalUrl; + t4 = originalUrl; + _2_0 = t1.importCanonical$4$originalUrl$quiet(t2, t3, t4, _this._evaluate0$_quietDeps && isDependency); + if (_2_0 != null) { + stylesheet = _2_0; + t1 = stylesheet; + t2 = importer; + return new A._Record_3_importer_isDependency(t1, t2, isDependency); + } + } + } + if (_this._nodeImporter != null) { + result = null; + t1 = baseUrl; + _3_0 = _this._importLikeNode$3(url, t1 == null ? _this._evaluate0$_assertInModule$2(_this._evaluate0$__stylesheet, _s11_).span.file.url : t1, forImport); + if (_3_0 != null) { + result = _3_0; + t1 = _this._evaluate0$_loadedUrls; + A.NullableExtension_andThen0(result._0.span.file.url, t1.get$add(t1)); + t1 = result; + return t1; + } + } + if (B.JSString_methods.startsWith$1(url, "package:") && true) + throw A.wrapException(string$.x22packa); + else + throw A.wrapException("Can't find stylesheet to import."); + } catch (exception) { + t1 = A.unwrapException(exception); + if (t1 instanceof A.SassException0) + throw exception; + else if (t1 instanceof A.ArgumentError) { + error = t1; + stackTrace = A.getTraceFromException(exception); + A.throwWithTrace0(_this._evaluate0$_exception$1(J.toString$0$(error)), error, stackTrace); + } else { + error0 = t1; + stackTrace0 = A.getTraceFromException(exception); + message = null; + try { + message = A._asString(J.get$message$x(error0)); + } catch (exception) { + message0 = J.toString$0$(error0); + message = message0; + } + A.throwWithTrace0(_this._evaluate0$_exception$1(message), error0, stackTrace0); + } + } finally { + _this._evaluate0$_importSpan = null; + } + }, + _evaluate0$_loadStylesheet$3$baseUrl(url, span, baseUrl) { + return this._evaluate0$_loadStylesheet$4$baseUrl$forImport(url, span, baseUrl, false); + }, + _evaluate0$_loadStylesheet$3$forImport(url, span, forImport) { + return this._evaluate0$_loadStylesheet$4$baseUrl$forImport(url, span, null, forImport); + }, + _importLikeNode$3(originalUrl, previous, forImport) { + var isDependency, url, t2, _this = this, + t1 = _this._nodeImporter, + result = t1.loadRelative$3(originalUrl, previous, forImport); + if (result != null) + isDependency = _this._evaluate0$_inDependency; + else { + result = t1.load$3(0, originalUrl, previous, forImport); + if (result == null) + return null; + isDependency = true; + } + url = result._1; + t1 = B.JSString_methods.startsWith$1(url, "file") ? A.Syntax_forPath0(url) : B.Syntax_SCSS_scss0; + t2 = _this._evaluate0$_quietDeps && isDependency ? $.$get$Logger_quiet0() : _this._evaluate0$_logger; + return new A._Record_3_importer_isDependency(A.Stylesheet_Stylesheet$parse0(result._0, t1, t2, url), null, isDependency); + }, + _evaluate0$_applyMixin$5(mixin, contentCallable, $arguments, nodeWithSpan, nodeWithSpanWithoutContent) { + var t1, _0_0, _1_8, t2, _this = this, + _s37_ = "Mixin doesn't accept a content block.", + _s10_ = "invocation"; + $label0$0: { + if (mixin == null) + throw A.wrapException(_this._evaluate0$_exception$2("Undefined mixin.", nodeWithSpan.get$span(nodeWithSpan))); + t1 = mixin instanceof A.BuiltInCallable0; + if (t1 && !mixin.acceptsContent && contentCallable != null) { + t1 = _this._evaluate0$_evaluateArguments$1($arguments)._values; + _0_0 = mixin.callbackFor$2(t1[2].length, new A.MapKeySet(t1[0], type$.MapKeySet_String)); + throw A.wrapException(A.MultiSpanSassRuntimeException$0(_s37_, nodeWithSpanWithoutContent.get$span(nodeWithSpanWithoutContent), _s10_, A.LinkedHashMap_LinkedHashMap$_literal([_0_0._0.get$spanWithName(), "declaration"], type$.FileSpan, type$.String), _this._evaluate0$_stackTrace$1(nodeWithSpanWithoutContent.get$span(nodeWithSpanWithoutContent)), null)); + } + if (t1) { + _this._evaluate0$_environment.withContent$2(contentCallable, new A._EvaluateVisitor__applyMixin_closure3(_this, $arguments, mixin, nodeWithSpanWithoutContent)); + break $label0$0; + } + t1 = type$.UserDefinedCallable_Environment_2._is(mixin); + if (t1) { + _1_8 = mixin.declaration; + if (_1_8 instanceof A.MixinRule0) + t2 = !type$.MixinRule_2._as(_1_8).get$hasContent() && contentCallable != null; + else + t2 = false; + } else + t2 = false; + if (t2) + throw A.wrapException(A.MultiSpanSassRuntimeException$0(_s37_, nodeWithSpanWithoutContent.get$span(nodeWithSpanWithoutContent), _s10_, A.LinkedHashMap_LinkedHashMap$_literal([mixin.declaration.$arguments.get$spanWithName(), "declaration"], type$.FileSpan, type$.String), _this._evaluate0$_stackTrace$1(nodeWithSpanWithoutContent.get$span(nodeWithSpanWithoutContent)), null)); + if (t1) { + _this._evaluate0$_runUserDefinedCallable$1$4($arguments, mixin, nodeWithSpanWithoutContent, new A._EvaluateVisitor__applyMixin_closure4(_this, contentCallable, mixin, nodeWithSpanWithoutContent), type$.Null); + break $label0$0; + } + throw A.wrapException(A.UnsupportedError$("Unknown callable type " + mixin.toString$0(0) + ".")); + } + }, + visitIncludeRule$1(node) { + var _this = this; + _this._evaluate0$_applyMixin$5(_this._evaluate0$_addExceptionSpan$2(node, new A._EvaluateVisitor_visitIncludeRule_closure5(_this, node)), A.NullableExtension_andThen0(node.content, new A._EvaluateVisitor_visitIncludeRule_closure6(_this)), node.$arguments, node, new A._FakeAstNode0(new A._EvaluateVisitor_visitIncludeRule_closure7(node))); + return null; + }, + visitMixinRule$1(node) { + var t1 = this._evaluate0$_environment, + t2 = t1.closure$0(), + t3 = this._evaluate0$_inDependency, + t4 = t1._environment0$_mixins, + index = t4.length - 1, + t5 = node.name; + t1._environment0$_mixinIndices.$indexSet(0, t5, index); + J.$indexSet$ax(t4[index], t5, new A.UserDefinedCallable0(node, t2, t3, type$.UserDefinedCallable_Environment_2)); + return null; + }, + visitLoudComment$1(node) { + var t1, _this = this, + _s8_ = "__parent", + _s13_ = "_endOfImports"; + if (_this._evaluate0$_inFunction) + return null; + if (_this._evaluate0$_assertInModule$2(_this._evaluate0$__parent, _s8_) === _this._evaluate0$_assertInModule$2(_this._evaluate0$__root, "_root") && _this._evaluate0$_assertInModule$2(_this._evaluate0$__endOfImports, _s13_) === J.get$length$asx(_this._evaluate0$_assertInModule$2(_this._evaluate0$__root, "_root").children._collection$_source)) + _this._evaluate0$__endOfImports = _this._evaluate0$_assertInModule$2(_this._evaluate0$__endOfImports, _s13_) + 1; + t1 = node.text; + _this._evaluate0$_assertInModule$2(_this._evaluate0$__parent, _s8_).addChild$1(new A.ModifiableCssComment0(_this._evaluate0$_performInterpolation$1(t1), t1.span)); + return null; + }, + visitMediaRule$1(node) { + var _0_0, queries, mergedQueries, t1, mergedSources, t2, t3, _this = this; + if (_this._evaluate0$_declarationName != null) + throw A.wrapException(_this._evaluate0$_exception$2(string$.Media_, node.span)); + _0_0 = _this._evaluate0$_performInterpolationWithMap$2$warnForColor(node.query, true); + queries = A.CssMediaQuery_parseList0(_0_0._0, _0_0._1, _this._evaluate0$_logger); + mergedQueries = A.NullableExtension_andThen0(_this._evaluate0$_mediaQueries, new A._EvaluateVisitor_visitMediaRule_closure5(_this, queries)); + t1 = mergedQueries == null; + if (!t1 && J.get$isEmpty$asx(mergedQueries)) + return null; + if (t1) + mergedSources = B.Set_empty5; + else { + t2 = _this._evaluate0$_mediaQuerySources; + t2.toString; + t2 = A.LinkedHashSet_LinkedHashSet$of(t2, type$.CssMediaQuery_2); + t3 = _this._evaluate0$_mediaQueries; + t3.toString; + t2.addAll$1(0, t3); + t2.addAll$1(0, queries); + mergedSources = t2; + } + t1 = t1 ? queries : mergedQueries; + _this._evaluate0$_withParent$2$4$scopeWhen$through(A.ModifiableCssMediaRule$0(t1, node.span), new A._EvaluateVisitor_visitMediaRule_closure6(_this, mergedQueries, queries, mergedSources, node), node.hasDeclarations, new A._EvaluateVisitor_visitMediaRule_closure7(mergedSources), type$.ModifiableCssMediaRule_2, type$.Null); + return null; + }, + _evaluate0$_mergeMediaQueries$2(queries1, queries2) { + var t1, t2, t3, t4, _0_0, result, t5, + queries = A._setArrayType([], type$.JSArray_CssMediaQuery_2); + for (t1 = J.get$iterator$ax(queries1), t2 = J.getInterceptor$ax(queries2); t1.moveNext$0();) { + t3 = t1.get$current(t1); + for (t4 = t2.get$iterator(queries2); t4.moveNext$0();) + $label0$1: { + _0_0 = t3.merge$1(t4.get$current(t4)); + if (B._SingletonCssMediaQueryMergeResult_00 === _0_0) + continue; + if (B._SingletonCssMediaQueryMergeResult_10 === _0_0) + return null; + if (_0_0 instanceof A.MediaQuerySuccessfulMergeResult0) { + result = _0_0; + t5 = true; + } else { + result = null; + t5 = false; + } + if (t5) + queries.push(result.query); + break $label0$1; + } + } + return queries; + }, + visitReturnRule$1(node) { + var t1 = node.expression; + return this._evaluate0$_withoutSlash$2(t1.accept$1(this), t1); + }, + visitSilentComment$1(node) { + return null; + }, + visitStyleRule$1(node) { + var t1, _0_0, selectorText, selectorMap, t2, parsedSelector, rule, oldAtRootExcludingStyleRule, t3, t4, t5, _i, complex, visitor, t6, t7, t8, t9, _this = this, _null = null, + _s11_ = "_stylesheet", + _s8_ = "__parent"; + if (_this._evaluate0$_declarationName != null) + throw A.wrapException(_this._evaluate0$_exception$2(string$.Style_, node.span)); + t1 = node.selector; + _0_0 = _this._evaluate0$_performInterpolationWithMap$2$warnForColor(t1, true); + selectorText = _0_0._0; + selectorMap = _0_0._1; + if (_this._evaluate0$_inKeyframes) { + _this._evaluate0$_withParent$2$4$scopeWhen$through(A.ModifiableCssKeyframeBlock$0(new A.CssValue0(A.List_List$unmodifiable(A.KeyframeSelectorParser$0(selectorText, selectorMap, _this._evaluate0$_logger).parse$0(), type$.String), t1.span, type$.CssValue_List_String_2), node.span), new A._EvaluateVisitor_visitStyleRule_closure9(_this, node), node.hasDeclarations, new A._EvaluateVisitor_visitStyleRule_closure10(), type$.ModifiableCssKeyframeBlock_2, type$.Null); + return _null; + } + t1 = A.SelectorList_SelectorList$parse0(selectorText, !_this._evaluate0$_assertInModule$2(_this._evaluate0$__stylesheet, _s11_).plainCss, !_this._evaluate0$_assertInModule$2(_this._evaluate0$__stylesheet, _s11_).plainCss, selectorMap, _this._evaluate0$_logger); + t2 = _this._evaluate0$_styleRuleIgnoringAtRoot; + t2 = t2 == null ? _null : t2.originalSelector; + parsedSelector = t1.resolveParentSelectors$2$implicitParent(t2, !_this._evaluate0$_atRootExcludingStyleRule); + rule = A.ModifiableCssStyleRule$0(_this._evaluate0$_assertInModule$2(_this._evaluate0$__extensionStore, "_extensionStore").addSelector$2(parsedSelector, _this._evaluate0$_mediaQueries), node.span, parsedSelector); + oldAtRootExcludingStyleRule = _this._evaluate0$_atRootExcludingStyleRule; + _this._evaluate0$_atRootExcludingStyleRule = false; + _this._evaluate0$_withParent$2$4$scopeWhen$through(rule, new A._EvaluateVisitor_visitStyleRule_closure11(_this, rule, node), node.hasDeclarations, new A._EvaluateVisitor_visitStyleRule_closure12(), type$.ModifiableCssStyleRule_2, type$.Null); + _this._evaluate0$_atRootExcludingStyleRule = oldAtRootExcludingStyleRule; + if (!rule.accept$1(B._IsInvisibleVisitor_false_false0)) + for (t1 = parsedSelector.components, t2 = t1.length, t3 = type$.SourceSpan, t4 = type$.String, t5 = rule.children, _i = 0; _i < t2; ++_i) { + complex = t1[_i]; + if (!complex.accept$1(B._IsBogusVisitor_true0)) + continue; + if (complex.accept$1(B.C__IsUselessVisitor0)) { + visitor = A._SerializeVisitor$0(_null, true, _null, true, false, _null, true); + complex.accept$1(visitor); + _this._evaluate0$_warn$3('The selector "' + B.JSString_methods.trim$0(visitor._serialize0$_buffer.toString$0(0)) + string$.x22x20is_ix20, A.SpanExtensions_trimRight0(complex.span), B.Deprecation_XV6); + } else if (complex.leadingCombinators.length !== 0) { + visitor = A._SerializeVisitor$0(_null, true, _null, true, false, _null, true); + complex.accept$1(visitor); + _this._evaluate0$_warn$3('The selector "' + B.JSString_methods.trim$0(visitor._serialize0$_buffer.toString$0(0)) + string$.x22x20is_ix0a, A.SpanExtensions_trimRight0(complex.span), B.Deprecation_XV6); + } else { + visitor = A._SerializeVisitor$0(_null, true, _null, true, false, _null, true); + complex.accept$1(visitor); + t6 = B.JSString_methods.trim$0(visitor._serialize0$_buffer.toString$0(0)); + t7 = complex.accept$1(B._IsBogusVisitor_false0) ? string$.x20It_wi : ""; + t8 = A.SpanExtensions_trimRight0(complex.span); + if (t5.get$length(0) === 0) + A.throwExpression(A.IterableElementError_noElement()); + t9 = J.get$span$z(t5.$index(0, 0)); + _this._evaluate0$_warn$3('The selector "' + t6 + string$.x22x20is_o + t7 + string$.x0aThis_, new A.MultiSpan0(t8, "invalid selector", A.ConstantMap_ConstantMap$from(A.LinkedHashMap_LinkedHashMap$_literal([t9, "this is not a style rule" + (t5.every$1(t5, new A._EvaluateVisitor_visitStyleRule_closure13()) ? "\n(try converting to a //-style comment)" : "")], t3, t4), t3, t4)), B.Deprecation_XV6); + } + } + if ((_this._evaluate0$_atRootExcludingStyleRule ? _null : _this._evaluate0$_styleRuleIgnoringAtRoot) == null) { + t1 = _this._evaluate0$_assertInModule$2(_this._evaluate0$__parent, _s8_).children; + t1 = !t1.get$isEmpty(t1); + } else + t1 = false; + if (t1) { + t1 = _this._evaluate0$_assertInModule$2(_this._evaluate0$__parent, _s8_).children; + t1.get$last(t1).isGroupEnd = true; + } + return _null; + }, + visitSupportsRule$1(node) { + var t1, _this = this; + if (_this._evaluate0$_declarationName != null) + throw A.wrapException(_this._evaluate0$_exception$2(string$.Suppor, node.span)); + t1 = node.condition; + _this._evaluate0$_withParent$2$4$scopeWhen$through(A.ModifiableCssSupportsRule$0(new A.CssValue0(_this._evaluate0$_visitSupportsCondition$1(t1), t1.get$span(t1), type$.CssValue_String_2), node.span), new A._EvaluateVisitor_visitSupportsRule_closure3(_this, node), node.hasDeclarations, new A._EvaluateVisitor_visitSupportsRule_closure4(), type$.ModifiableCssSupportsRule_2, type$.Null); + return null; + }, + _evaluate0$_visitSupportsCondition$1(condition) { + var t1, _this = this, _box_0 = {}; + $label0$0: { + if (condition instanceof A.SupportsOperation0) { + t1 = condition.operator; + t1 = _this._evaluate0$_parenthesize$2(condition.left, t1) + " " + t1 + " " + _this._evaluate0$_parenthesize$2(condition.right, t1); + break $label0$0; + } + if (condition instanceof A.SupportsNegation0) { + t1 = "not " + _this._evaluate0$_parenthesize$1(condition.condition); + break $label0$0; + } + if (condition instanceof A.SupportsInterpolation0) { + t1 = condition.expression; + t1 = _this._evaluate0$_serialize$3$quote(t1.accept$1(_this), t1, false); + break $label0$0; + } + _box_0.declaration = null; + if (condition instanceof A.SupportsDeclaration0) { + _box_0.declaration = condition; + t1 = _this._evaluate0$_withSupportsDeclaration$1(new A._EvaluateVisitor__visitSupportsCondition_closure1(_box_0, _this)); + break $label0$0; + } + if (condition instanceof A.SupportsFunction0) { + t1 = _this._evaluate0$_performInterpolation$1(condition.name) + "(" + _this._evaluate0$_performInterpolation$1(condition.$arguments) + ")"; + break $label0$0; + } + if (condition instanceof A.SupportsAnything0) { + t1 = "(" + _this._evaluate0$_performInterpolation$1(condition.contents) + ")"; + break $label0$0; + } + t1 = A.throwExpression(A.ArgumentError$("Unknown supports condition type " + A.getRuntimeTypeOfDartObject(condition).toString$0(0) + ".", null)); + } + return t1; + }, + _evaluate0$_withSupportsDeclaration$1$1(callback) { + var t1, + oldInSupportsDeclaration = this._evaluate0$_inSupportsDeclaration; + this._evaluate0$_inSupportsDeclaration = true; + try { + t1 = callback.call$0(); + return t1; + } finally { + this._evaluate0$_inSupportsDeclaration = oldInSupportsDeclaration; + } + }, + _evaluate0$_withSupportsDeclaration$1(callback) { + return this._evaluate0$_withSupportsDeclaration$1$1(callback, type$.dynamic); + }, + _evaluate0$_parenthesize$2(condition, operator) { + var t1; + if (!(condition instanceof A.SupportsNegation0)) + if (condition instanceof A.SupportsOperation0) + t1 = operator == null || operator !== condition.operator; + else + t1 = false; + else + t1 = true; + if (t1) + return "(" + this._evaluate0$_visitSupportsCondition$1(condition) + ")"; + return this._evaluate0$_visitSupportsCondition$1(condition); + }, + _evaluate0$_parenthesize$1(condition) { + return this._evaluate0$_parenthesize$2(condition, null); + }, + visitVariableDeclaration$1(node) { + var t2, value, _this = this, _null = null, t1 = {}; + if (node.isGuarded) { + if (node.namespace == null && _this._evaluate0$_environment._environment0$_variables.length === 1) { + t1.override = null; + t2 = _this._evaluate0$_configuration._configuration0$_values; + t2 = t2.get$isEmpty(t2) ? _null : t2.remove$1(0, node.name); + if (t2 != null) { + t1.override = t2; + t2 = !t2.value.$eq(0, B.C__SassNull0); + } else + t2 = false; + if (t2) { + _this._evaluate0$_addExceptionSpan$2(node, new A._EvaluateVisitor_visitVariableDeclaration_closure5(t1, _this, node)); + return _null; + } + } + value = _this._evaluate0$_addExceptionSpan$2(node, new A._EvaluateVisitor_visitVariableDeclaration_closure6(_this, node)); + if (value != null && !value.$eq(0, B.C__SassNull0)) + return _null; + } + if (node.isGlobal && !_this._evaluate0$_environment.globalVariableExists$1(node.name)) { + t1 = _this._evaluate0$_environment._environment0$_variables.length === 1 ? string$.As_of_S : string$.As_of_R + A.declarationName0(node.span) + ": null` at the stylesheet root."; + _this._evaluate0$_warn$3(t1, node.span, B.Deprecation_wKk); + } + t1 = node.expression; + _this._evaluate0$_addExceptionSpan$2(node, new A._EvaluateVisitor_visitVariableDeclaration_closure7(_this, node, _this._evaluate0$_withoutSlash$2(t1.accept$1(_this), t1))); + return _null; + }, + visitUseRule$1(node) { + var values, _i, variable, t3, variableNodeWithSpan, configuration, _this = this, + t1 = node.configuration, + t2 = t1.length; + if (t2 !== 0) { + values = A.LinkedHashMap_LinkedHashMap$_empty(type$.String, type$.ConfiguredValue_2); + for (_i = 0; _i < t2; ++_i) { + variable = t1[_i]; + t3 = variable.expression; + variableNodeWithSpan = _this._evaluate0$_expressionNode$1(t3); + values.$indexSet(0, variable.name, new A.ConfiguredValue0(_this._evaluate0$_withoutSlash$2(t3.accept$1(_this), variableNodeWithSpan), variable.span, variableNodeWithSpan)); + } + configuration = new A.ExplicitConfiguration0(node, values, null); + } else + configuration = B.Configuration_Map_empty_null0; + _this._evaluate0$_loadModule$5$configuration(node.url, "@use", node, new A._EvaluateVisitor_visitUseRule_closure1(_this, node), configuration); + _this._evaluate0$_assertConfigurationIsEmpty$1(configuration); + return null; + }, + visitWarnRule$1(node) { + var _this = this, + value = _this._evaluate0$_addExceptionSpan$2(node, new A._EvaluateVisitor_visitWarnRule_closure1(_this, node)), + t1 = value instanceof A.SassString0 ? value._string0$_text : _this._evaluate0$_serialize$2(value, node.expression); + _this._evaluate0$_logger.warn$2$trace(0, t1, _this._evaluate0$_stackTrace$1(node.span)); + return null; + }, + visitWhileRule$1(node) { + return this._evaluate0$_environment.scope$1$3$semiGlobal$when(new A._EvaluateVisitor_visitWhileRule_closure1(this, node), true, node.hasDeclarations, type$.nullable_Value_2); + }, + visitBinaryOperationExpression$1(node) { + var t1, _this = this; + if (_this._evaluate0$_assertInModule$2(_this._evaluate0$__stylesheet, "_stylesheet").plainCss) { + t1 = node.operator; + t1 = t1 !== B.BinaryOperator_2jN0 && t1 !== B.BinaryOperator_t8B0; + } else + t1 = false; + if (t1) + throw A.wrapException(_this._evaluate0$_exception$2("Operators aren't allowed in plain CSS.", node.get$operatorSpan())); + return _this._evaluate0$_addExceptionSpan$2(node, new A._EvaluateVisitor_visitBinaryOperationExpression_closure1(_this, node)); + }, + _evaluate0$_slash$3(left, right, node) { + var t1, right0, _1_2, _1_1, _1_2_isSet, _null = null, + result = left.dividedBy$1(right); + if (left instanceof A.SassNumber0) { + t1 = type$.SassNumber_2; + t1._as(left); + if (right instanceof A.SassNumber0) { + t1._as(right); + t1 = node.allowsSlash && this._evaluate0$_operandAllowsSlash$1(node.left) && this._evaluate0$_operandAllowsSlash$1(node.right); + right0 = right; + _1_2 = right0; + } else { + right0 = _null; + _1_2 = right; + t1 = false; + } + _1_1 = left; + _1_2_isSet = true; + } else { + right0 = _null; + _1_2 = right0; + _1_1 = left; + left = _1_2; + _1_2_isSet = false; + t1 = false; + } + if (t1) + return type$.SassNumber_2._as(result).withSlash$2(left, right0); + if (_1_1 instanceof A.SassNumber0) + t1 = (_1_2_isSet ? _1_2 : right) instanceof A.SassNumber0; + else + t1 = false; + if (t1) { + this._evaluate0$_warn$3(string$.Using__o + A.S(new A._EvaluateVisitor__slash_recommendation1().call$1(node)) + " or " + A.expressionToCalc0(node).toString$0(0) + string$.x0a_Morex20, node.get$span(0), B.Deprecation_wWh); + return result; + } + return result; + }, + _evaluate0$_operandAllowsSlash$1(node) { + var t1, t2; + if (node instanceof A.FunctionExpression0) + if (node.namespace == null) { + t1 = node.originalName; + if (B.Set_WfnXb.contains$1(0, A.stringReplaceAllUnchecked(t1, "_", "-").toLowerCase())) { + t2 = this._evaluate0$_environment; + t1 = t2.getFunction$1(A.stringReplaceAllUnchecked(t1, "_", "-")) == null; + } else + t1 = false; + } else + t1 = false; + else + t1 = true; + return t1; + }, + visitValueExpression$1(node) { + return node.value; + }, + visitVariableExpression$1(node) { + var result = this._evaluate0$_addExceptionSpan$2(node, new A._EvaluateVisitor_visitVariableExpression_closure1(this, node)); + if (result != null) + return result; + throw A.wrapException(this._evaluate0$_exception$2("Undefined variable.", node.span)); + }, + visitUnaryOperationExpression$1(node) { + return this._evaluate0$_addExceptionSpan$2(node, new A._EvaluateVisitor_visitUnaryOperationExpression_closure1(node, node.operand.accept$1(this))); + }, + visitBooleanExpression$1(node) { + return node.value ? B.SassBoolean_true0 : B.SassBoolean_false0; + }, + visitIfExpression$1(node) { + var condition, t1, ifTrue, ifFalse, result, _this = this, + _0_0 = _this._evaluate0$_evaluateMacroArguments$1(node), + positional = _0_0._0, + named = _0_0._1; + _this._evaluate0$_verifyArguments$4(positional.length, named, $.$get$IfExpression_declaration0(), node); + condition = A.ListExtensions_elementAtOrNull(positional, 0); + if (condition == null) { + t1 = named.$index(0, "condition"); + t1.toString; + condition = t1; + } + ifTrue = A.ListExtensions_elementAtOrNull(positional, 1); + if (ifTrue == null) { + t1 = named.$index(0, "if-true"); + t1.toString; + ifTrue = t1; + } + ifFalse = A.ListExtensions_elementAtOrNull(positional, 2); + if (ifFalse == null) { + t1 = named.$index(0, "if-false"); + t1.toString; + ifFalse = t1; + } + result = condition.accept$1(_this).get$isTruthy() ? ifTrue : ifFalse; + return _this._evaluate0$_withoutSlash$2(result.accept$1(_this), _this._evaluate0$_expressionNode$1(result)); + }, + visitNullExpression$1(node) { + return B.C__SassNull0; + }, + visitNumberExpression$1(node) { + return A.SassNumber_SassNumber0(node.value, node.unit); + }, + visitParenthesizedExpression$1(node) { + var _this = this; + return _this._evaluate0$_assertInModule$2(_this._evaluate0$__stylesheet, "_stylesheet").plainCss ? A.throwExpression(_this._evaluate0$_exception$2("Parentheses aren't allowed in plain CSS.", node.span)) : node.expression.accept$1(_this); + }, + visitColorExpression$1(node) { + return node.value; + }, + visitListExpression$1(node) { + var t1 = node.contents; + return A.SassList$0(new A.MappedListIterable(t1, new A._EvaluateVisitor_visitListExpression_closure1(this), A._arrayInstanceType(t1)._eval$1("MappedListIterable<1,Value0>")), node.separator, node.hasBrackets); + }, + visitMapExpression$1(node) { + var t2, t3, _i, t4, key, value, keyValue, valueValue, oldValueSpan, + t1 = type$.Value_2, + map = A.LinkedHashMap_LinkedHashMap$_empty(t1, t1), + keyNodes = A.LinkedHashMap_LinkedHashMap$_empty(t1, type$.AstNode_2); + for (t2 = node.pairs, t3 = t2.length, _i = 0; _i < t3; ++_i) { + t4 = t2[_i]; + key = t4._0; + value = t4._1; + keyValue = key.accept$1(this); + valueValue = value.accept$1(this); + if (map.containsKey$1(keyValue)) { + t1 = keyNodes.$index(0, keyValue); + oldValueSpan = t1 == null ? null : t1.get$span(t1); + t1 = key.get$span(key); + t2 = A.LinkedHashMap_LinkedHashMap$_empty(type$.FileSpan, type$.String); + if (oldValueSpan != null) + t2.$indexSet(0, oldValueSpan, "first key"); + throw A.wrapException(A.MultiSpanSassRuntimeException$0("Duplicate key.", t1, "second key", t2, this._evaluate0$_stackTrace$1(key.get$span(key)), null)); + } + map.$indexSet(0, keyValue, valueValue); + keyNodes.$indexSet(0, keyValue, key); + } + return new A.SassMap0(A.ConstantMap_ConstantMap$from(map, t1, t1)); + }, + visitFunctionExpression$1(node) { + var t2, _0_0, t3, t4, oldInFunction, result, _this = this, + _s11_ = "_stylesheet", + t1 = {}, + $function = _this._evaluate0$_assertInModule$2(_this._evaluate0$__stylesheet, _s11_).plainCss ? null : _this._evaluate0$_addExceptionSpan$2(node, new A._EvaluateVisitor_visitFunctionExpression_closure5(_this, node)); + t1.$function = $function; + if ($function == null) { + if (node.namespace != null) + throw A.wrapException(_this._evaluate0$_exception$2("Undefined function.", node.span)); + t2 = node.originalName; + _0_0 = A.stringReplaceAllUnchecked(t2, "_", "-").toLowerCase(); + if ("min" === _0_0 || "max" === _0_0 || "round" === _0_0 || "abs" === _0_0) { + t3 = node.$arguments; + t4 = t3.named; + t3 = t4.get$isEmpty(t4) && t3.rest == null && B.JSArray_methods.every$1(t3.positional, new A._EvaluateVisitor_visitFunctionExpression_closure6()); + } else + t3 = false; + if (t3) + return _this._evaluate0$_visitCalculation$2$inLegacySassFunction(node, true); + if ("calc" === _0_0 || "clamp" === _0_0 || "hypot" === _0_0 || "sin" === _0_0 || "cos" === _0_0 || "tan" === _0_0 || "asin" === _0_0 || "acos" === _0_0 || "atan" === _0_0 || "sqrt" === _0_0 || "exp" === _0_0 || "sign" === _0_0 || "mod" === _0_0 || "rem" === _0_0 || "atan2" === _0_0 || "pow" === _0_0 || "log" === _0_0) + return _this._evaluate0$_visitCalculation$1(node); + if (_this._evaluate0$_assertInModule$2(_this._evaluate0$__stylesheet, _s11_).plainCss) + $function = null; + else { + t3 = _this._evaluate0$_builtInFunctions.$index(0, A.stringReplaceAllUnchecked(t2, "_", "-")); + $function = t3; + } + t1.$function = $function == null ? new A.PlainCssCallable0(t2) : $function; + } + oldInFunction = _this._evaluate0$_inFunction; + _this._evaluate0$_inFunction = true; + result = _this._evaluate0$_addErrorSpan$2(node, new A._EvaluateVisitor_visitFunctionExpression_closure7(t1, _this, node)); + _this._evaluate0$_inFunction = oldInFunction; + return result; + }, + _evaluate0$_visitCalculation$2$inLegacySassFunction(node, inLegacySassFunction) { + var $arguments, oldCallableNode, t1, _0_0, error, stackTrace, t4, _i, exception, _this = this, + t2 = node.$arguments, + t3 = t2.named; + if (t3.get$isNotEmpty(t3)) + throw A.wrapException(_this._evaluate0$_exception$2(string$.Keywor, node.span)); + else if (t2.rest != null) + throw A.wrapException(_this._evaluate0$_exception$2(string$.Rest_a, node.span)); + _this._evaluate0$_checkCalculationArguments$1(node); + t3 = A._setArrayType([], type$.JSArray_Object); + for (t2 = t2.positional, t4 = t2.length, _i = 0; _i < t4; ++_i) + t3.push(_this._evaluate0$_visitCalculationExpression$2$inLegacySassFunction(t2[_i], inLegacySassFunction)); + $arguments = t3; + if (_this._evaluate0$_inSupportsDeclaration) + return new A.SassCalculation0(A.stringReplaceAllUnchecked(node.originalName, "_", "-"), A.List_List$unmodifiable($arguments, type$.Object)); + oldCallableNode = _this._evaluate0$_callableNode; + _this._evaluate0$_callableNode = node; + try { + t1 = null; + _0_0 = A.stringReplaceAllUnchecked(node.originalName, "_", "-").toLowerCase(); + $label0$0: { + if ("calc" === _0_0) { + t1 = A.SassCalculation_calc0(J.$index$asx($arguments, 0)); + break $label0$0; + } + if ("sqrt" === _0_0) { + t1 = A.SassCalculation__singleArgument0("sqrt", J.$index$asx($arguments, 0), A.number2__sqrt$closure(), true); + break $label0$0; + } + if ("sin" === _0_0) { + t1 = A.SassCalculation__singleArgument0("sin", J.$index$asx($arguments, 0), A.number2__sin$closure(), false); + break $label0$0; + } + if ("cos" === _0_0) { + t1 = A.SassCalculation__singleArgument0("cos", J.$index$asx($arguments, 0), A.number2__cos$closure(), false); + break $label0$0; + } + if ("tan" === _0_0) { + t1 = A.SassCalculation__singleArgument0("tan", J.$index$asx($arguments, 0), A.number2__tan$closure(), false); + break $label0$0; + } + if ("asin" === _0_0) { + t1 = A.SassCalculation__singleArgument0("asin", J.$index$asx($arguments, 0), A.number2__asin$closure(), true); + break $label0$0; + } + if ("acos" === _0_0) { + t1 = A.SassCalculation__singleArgument0("acos", J.$index$asx($arguments, 0), A.number2__acos$closure(), true); + break $label0$0; + } + if ("atan" === _0_0) { + t1 = A.SassCalculation__singleArgument0("atan", J.$index$asx($arguments, 0), A.number2__atan$closure(), true); + break $label0$0; + } + if ("abs" === _0_0) { + t1 = A.SassCalculation_abs0(J.$index$asx($arguments, 0)); + break $label0$0; + } + if ("exp" === _0_0) { + t1 = A.SassCalculation_exp0(J.$index$asx($arguments, 0)); + break $label0$0; + } + if ("sign" === _0_0) { + t1 = A.SassCalculation_sign0(J.$index$asx($arguments, 0)); + break $label0$0; + } + if ("min" === _0_0) { + t1 = A.SassCalculation_min0($arguments); + break $label0$0; + } + if ("max" === _0_0) { + t1 = A.SassCalculation_max0($arguments); + break $label0$0; + } + if ("hypot" === _0_0) { + t1 = A.SassCalculation_hypot0($arguments); + break $label0$0; + } + if ("pow" === _0_0) { + t1 = A.SassCalculation_pow0(J.$index$asx($arguments, 0), A.ListExtensions_elementAtOrNull($arguments, 1)); + break $label0$0; + } + if ("atan2" === _0_0) { + t1 = A.SassCalculation_atan20(J.$index$asx($arguments, 0), A.ListExtensions_elementAtOrNull($arguments, 1)); + break $label0$0; + } + if ("log" === _0_0) { + t1 = A.SassCalculation_log0(J.$index$asx($arguments, 0), A.ListExtensions_elementAtOrNull($arguments, 1)); + break $label0$0; + } + if ("mod" === _0_0) { + t1 = A.SassCalculation_mod0(J.$index$asx($arguments, 0), A.ListExtensions_elementAtOrNull($arguments, 1)); + break $label0$0; + } + if ("rem" === _0_0) { + t1 = A.SassCalculation_rem0(J.$index$asx($arguments, 0), A.ListExtensions_elementAtOrNull($arguments, 1)); + break $label0$0; + } + if ("round" === _0_0) { + t1 = A.SassCalculation_round0(J.$index$asx($arguments, 0), A.ListExtensions_elementAtOrNull($arguments, 1), A.ListExtensions_elementAtOrNull($arguments, 2)); + break $label0$0; + } + if ("clamp" === _0_0) { + t1 = A.SassCalculation_clamp0(J.$index$asx($arguments, 0), A.ListExtensions_elementAtOrNull($arguments, 1), A.ListExtensions_elementAtOrNull($arguments, 2)); + break $label0$0; + } + t3 = A.UnsupportedError$('Unknown calculation name "' + node.get$name(0) + '".'); + t1 = A.throwExpression(t3); + } + t1 = t1; + return t1; + } catch (exception) { + t1 = A.unwrapException(exception); + if (t1 instanceof A.SassScriptException0) { + error = t1; + stackTrace = A.getTraceFromException(exception); + if (B.JSString_methods.contains$1(error.message, "compatible")) + _this._evaluate0$_verifyCompatibleNumbers$2($arguments, t2); + A.throwWithTrace0(_this._evaluate0$_exception$2(error.message, node.span), error, stackTrace); + } else + throw exception; + } finally { + _this._evaluate0$_callableNode = oldCallableNode; + } + }, + _evaluate0$_visitCalculation$1(node) { + return this._evaluate0$_visitCalculation$2$inLegacySassFunction(node, false); + }, + _evaluate0$_checkCalculationArguments$1(node) { + var _0_0, + check = new A._EvaluateVisitor__checkCalculationArguments_check1(this, node); + $label0$0: { + _0_0 = A.stringReplaceAllUnchecked(node.originalName, "_", "-").toLowerCase(); + if ("calc" === _0_0 || "sqrt" === _0_0 || "sin" === _0_0 || "cos" === _0_0 || "tan" === _0_0 || "asin" === _0_0 || "acos" === _0_0 || "atan" === _0_0 || "abs" === _0_0 || "exp" === _0_0 || "sign" === _0_0) { + check.call$1(1); + break $label0$0; + } + if ("min" === _0_0 || "max" === _0_0 || "hypot" === _0_0) { + check.call$0(); + break $label0$0; + } + if ("pow" === _0_0 || "atan2" === _0_0 || "log" === _0_0 || "mod" === _0_0 || "rem" === _0_0) { + check.call$1(2); + break $label0$0; + } + if ("round" === _0_0 || "clamp" === _0_0) { + check.call$1(3); + break $label0$0; + } + throw A.wrapException(A.UnsupportedError$('Unknown calculation name "' + node.get$name(0) + '".')); + } + }, + _evaluate0$_verifyCompatibleNumbers$2(args, nodesWithSpans) { + var i, t1, _0_0, arg, number1, j, number2; + for (i = 0; t1 = args.length, i < t1; ++i) { + _0_0 = args[i]; + if (_0_0 instanceof A.SassNumber0) { + t1 = _0_0.get$hasComplexUnits(); + arg = _0_0; + } else { + arg = null; + t1 = false; + } + if (t1) + throw A.wrapException(this._evaluate0$_exception$2("Number " + A.S(arg) + " isn't compatible with CSS calculations.", J.get$span$z(nodesWithSpans[i]))); + } + for (i = 0; i < t1 - 1; ++i) { + number1 = args[i]; + if (!(number1 instanceof A.SassNumber0)) + continue; + for (j = i + 1; t1 = args.length, j < t1; ++j) { + number2 = args[j]; + if (!(number2 instanceof A.SassNumber0)) + continue; + if (number1.hasPossiblyCompatibleUnits$1(number2)) + continue; + throw A.wrapException(A.MultiSpanSassRuntimeException$0(number1.toString$0(0) + " and " + number2.toString$0(0) + " are incompatible.", J.get$span$z(nodesWithSpans[i]), number1.toString$0(0), A.LinkedHashMap_LinkedHashMap$_literal([J.get$span$z(nodesWithSpans[j]), number2.toString$0(0)], type$.FileSpan, type$.String), this._evaluate0$_stackTrace$1(J.get$span$z(nodesWithSpans[i])), null)); + } + } + }, + _evaluate0$_visitCalculationExpression$2$inLegacySassFunction(node, inLegacySassFunction) { + var inner, t1, result, t2, _0_0, _1_0, t3, _i, i, _this = this, _null = null, _box_0 = {}; + if (node instanceof A.ParenthesizedExpression0) { + inner = node.expression; + t1 = true; + } else { + inner = _null; + t1 = false; + } + if (t1) { + result = _this._evaluate0$_visitCalculationExpression$2$inLegacySassFunction(inner, inLegacySassFunction); + return result instanceof A.SassString0 ? new A.SassString0("(" + result._string0$_text + ")", false) : result; + } + if (node instanceof A.StringExpression0 && node.accept$1(new A._IsCalculationSafeVisitor0())) { + t1 = node.text; + t2 = t1.get$asPlain(); + _0_0 = t2 == null ? _null : t2.toLowerCase(); + $label0$0: { + if ("pi" === _0_0) { + t1 = A.SassNumber_SassNumber0(3.141592653589793, _null); + break $label0$0; + } + if ("e" === _0_0) { + t1 = A.SassNumber_SassNumber0(2.718281828459045, _null); + break $label0$0; + } + if ("infinity" === _0_0) { + t1 = A.SassNumber_SassNumber0(1 / 0, _null); + break $label0$0; + } + if ("-infinity" === _0_0) { + t1 = A.SassNumber_SassNumber0(-1 / 0, _null); + break $label0$0; + } + if ("nan" === _0_0) { + t1 = A.SassNumber_SassNumber0(0 / 0, _null); + break $label0$0; + } + t1 = new A.SassString0(_this._evaluate0$_performInterpolation$1(t1), false); + break $label0$0; + } + return t1; + } + _box_0.right = _box_0.left = _box_0.operator = null; + if (node instanceof A.BinaryOperationExpression0) { + _box_0.operator = node.operator; + _box_0.left = node.left; + _box_0.right = node.right; + t1 = true; + } else + t1 = false; + if (t1) { + _this._evaluate0$_checkWhitespaceAroundCalculationOperator$1(node); + return _this._evaluate0$_addExceptionSpan$2(node, new A._EvaluateVisitor__visitCalculationExpression_closure1(_box_0, _this, node, inLegacySassFunction)); + } + if (node instanceof A.NumberExpression0 || node instanceof A.VariableExpression0 || node instanceof A.FunctionExpression0 || node instanceof A.IfExpression0) { + _1_0 = node.accept$1(_this); + $label1$1: { + if (_1_0 instanceof A.SassNumber0) { + t1 = _1_0; + break $label1$1; + } + if (_1_0 instanceof A.SassCalculation0) { + t1 = _1_0; + break $label1$1; + } + if (_1_0 instanceof A.SassString0) { + t1 = !_1_0._string0$_hasQuotes; + result = _1_0; + } else { + result = _null; + t1 = false; + } + if (t1) { + t1 = result; + break $label1$1; + } + t1 = A.throwExpression(_this._evaluate0$_exception$2("Value " + _1_0.toString$0(0) + " can't be used in a calculation.", node.get$span(node))); + } + return t1; + } + if (node instanceof A.ListExpression0 && !node.hasBrackets && B.ListSeparator_EVt0 === node.separator && node.contents.length >= 2) { + t1 = A._setArrayType([], type$.JSArray_Object); + for (t2 = node.contents, t3 = t2.length, _i = 0; _i < t3; ++_i) + t1.push(_this._evaluate0$_visitCalculationExpression$2$inLegacySassFunction(t2[_i], inLegacySassFunction)); + _this._evaluate0$_checkAdjacentCalculationValues$2(t1, node); + for (i = 0; i < t1.length; ++i) { + t3 = t1[i]; + if (t3 instanceof A.CalculationOperation0 && t2[i] instanceof A.ParenthesizedExpression0) + t1[i] = new A.SassString0("(" + A.S(t3) + ")", false); + } + return new A.SassString0(B.JSArray_methods.join$1(t1, " "), false); + } + throw A.wrapException(_this._evaluate0$_exception$2(string$.This_e, node.get$span(node))); + }, + _evaluate0$_checkWhitespaceAroundCalculationOperator$1(node) { + var t2, t3, t4, textBetweenOperands, first, last, + t1 = node.operator; + if (t1 !== B.BinaryOperator_anB0 && t1 !== B.BinaryOperator_olz0) + return; + t1 = node.left; + t2 = t1.get$span(t1); + t2 = t2.get$file(t2); + t3 = node.right; + t4 = t3.get$span(t3); + if (t2 !== t4.get$file(t4)) + return; + t2 = t1.get$span(t1); + t2 = t2.get$end(t2); + t4 = t3.get$span(t3); + if (t2.offset >= t4.get$start(t4).offset) + return; + t2 = t1.get$span(t1); + t2 = t2.get$file(t2); + t1 = t1.get$span(t1); + t1 = t1.get$end(t1); + t3 = t3.get$span(t3); + textBetweenOperands = A.String_String$fromCharCodes(B.NativeUint32List_methods.sublist$2(t2._decodedChars, t1.offset, t3.get$start(t3).offset), 0, null); + first = textBetweenOperands.charCodeAt(0); + last = textBetweenOperands.charCodeAt(textBetweenOperands.length - 1); + if (first === 32 || first === 9 || first === 10 || first === 13 || first === 12 || first === 47) + t1 = !(last === 32 || last === 9 || last === 10 || last === 13 || last === 12 || last === 47); + else + t1 = true; + if (t1) + throw A.wrapException(this._evaluate0$_exception$2(string$.x22x2b__an, node.get$operatorSpan())); + }, + _evaluate0$_binaryOperatorToCalculationOperator$2(operator, node) { + var t1; + $label0$0: { + if (B.BinaryOperator_anB0 === operator) { + t1 = B.CalculationOperator_IyK0; + break $label0$0; + } + if (B.BinaryOperator_olz0 === operator) { + t1 = B.CalculationOperator_2bx0; + break $label0$0; + } + if (B.BinaryOperator_qN20 === operator) { + t1 = B.CalculationOperator_jFr0; + break $label0$0; + } + if (B.BinaryOperator_t8B0 === operator) { + t1 = B.CalculationOperator_OvN0; + break $label0$0; + } + t1 = A.throwExpression(this._evaluate0$_exception$2(string$.This_o, node.get$operatorSpan())); + } + return t1; + }, + _evaluate0$_checkAdjacentCalculationValues$2(elements, node) { + var t1, i, t2, previous, current, previousNode, currentNode, _0_2; + for (t1 = elements.length, i = 1; i < t1; ++i) { + t2 = i - 1; + previous = elements[t2]; + current = elements[i]; + if (previous instanceof A.SassString0 || current instanceof A.SassString0) + continue; + t1 = node.contents; + previousNode = t1[t2]; + currentNode = t1[i]; + if (currentNode instanceof A.UnaryOperationExpression0) { + _0_2 = currentNode.operator; + if (B.UnaryOperator_TLI0 !== _0_2) + t1 = B.UnaryOperator_gg40 === _0_2; + else + t1 = true; + } else + t1 = false; + if (!t1) + t1 = currentNode instanceof A.NumberExpression0 && currentNode.value < 0; + else + t1 = true; + if (t1) + throw A.wrapException(this._evaluate0$_exception$2(string$.x22x2b__an, A.FileSpanExtension_subspan(currentNode.get$span(currentNode), 0, 1))); + else + throw A.wrapException(this._evaluate0$_exception$2("Missing math operator.", previousNode.get$span(previousNode).expand$1(0, currentNode.get$span(currentNode)))); + } + }, + visitInterpolatedFunctionExpression$1(node) { + var result, _this = this, + t1 = _this._evaluate0$_performInterpolation$1(node.name), + oldInFunction = _this._evaluate0$_inFunction; + _this._evaluate0$_inFunction = true; + result = _this._evaluate0$_addErrorSpan$2(node, new A._EvaluateVisitor_visitInterpolatedFunctionExpression_closure1(_this, node, new A.PlainCssCallable0(t1))); + _this._evaluate0$_inFunction = oldInFunction; + return result; + }, + _evaluate0$_runUserDefinedCallable$1$4($arguments, callable, nodeWithSpan, run, $V) { + var oldCallable, result, _this = this, + evaluated = _this._evaluate0$_evaluateArguments$1($arguments), + $name = callable.declaration.name; + if ($name !== "@content") + $name += "()"; + oldCallable = _this._evaluate0$_currentCallable; + _this._evaluate0$_currentCallable = callable; + result = _this._evaluate0$_withStackFrame$3($name, nodeWithSpan, new A._EvaluateVisitor__runUserDefinedCallable_closure1(_this, callable, evaluated, nodeWithSpan, run, $V)); + _this._evaluate0$_currentCallable = oldCallable; + return result; + }, + _evaluate0$_runFunctionCallable$3($arguments, callable, nodeWithSpan) { + var buffer, first, argument, restArg, rest, error, t1, t2, _i, t3, exception, _this = this; + if (callable instanceof A.BuiltInCallable0) + return _this._evaluate0$_withoutSlash$2(_this._evaluate0$_runBuiltInCallable$3($arguments, callable, nodeWithSpan), nodeWithSpan); + else if (type$.UserDefinedCallable_Environment_2._is(callable)) + return _this._evaluate0$_runUserDefinedCallable$1$4($arguments, callable, nodeWithSpan, new A._EvaluateVisitor__runFunctionCallable_closure1(_this, callable), type$.Value_2); + else if (callable instanceof A.PlainCssCallable0) { + t1 = $arguments.named; + if (t1.get$isNotEmpty(t1) || $arguments.keywordRest != null) + throw A.wrapException(_this._evaluate0$_exception$2(string$.Plain_, nodeWithSpan.get$span(nodeWithSpan))); + buffer = new A.StringBuffer(callable.name + "("); + try { + first = true; + for (t1 = $arguments.positional, t2 = t1.length, _i = 0; _i < t2; ++_i) { + argument = t1[_i]; + if (first) + first = false; + else + buffer._contents += ", "; + t3 = argument; + buffer._contents += _this._evaluate0$_serialize$3$quote(t3.accept$1(_this), t3, true); + } + restArg = $arguments.rest; + if (restArg != null) { + rest = restArg.accept$1(_this); + if (!first) + buffer._contents += ", "; + buffer._contents += _this._evaluate0$_serialize$2(rest, restArg); + } + } catch (exception) { + t1 = A.unwrapException(exception); + if (type$.SassRuntimeException_2._is(t1)) { + error = t1; + if (!B.JSString_methods.endsWith$1(error._span_exception$_message, "isn't a valid CSS value.")) + throw exception; + throw A.wrapException(A.MultiSpanSassRuntimeException$0(error._span_exception$_message, J.get$span$z(error), "value", A.LinkedHashMap_LinkedHashMap$_literal([nodeWithSpan.get$span(nodeWithSpan), "unknown function treated as plain CSS"], type$.FileSpan, type$.String), J.get$trace$z(error), null)); + } else + throw exception; + } + buffer._contents += A.Primitives_stringFromCharCode(41); + t1 = buffer._contents; + return new A.SassString0(t1.charCodeAt(0) == 0 ? t1 : t1, false); + } else + throw A.wrapException(A.ArgumentError$("Unknown callable type " + J.get$runtimeType$(callable).toString$0(0) + ".", null)); + }, + _evaluate0$_runBuiltInCallable$3($arguments, callable, nodeWithSpan) { + var result, error, stackTrace, message, namedSet, _0_0, declaredArguments, i, t1, argument, t2, t3, rest, argumentList, exception, message0, _this = this, _box_0 = {}, + evaluated = _this._evaluate0$_evaluateArguments$1($arguments), + oldCallableNode = _this._evaluate0$_callableNode; + _this._evaluate0$_callableNode = nodeWithSpan; + namedSet = new A.MapKeySet(evaluated._values[0], type$.MapKeySet_String); + _box_0.callback = _box_0.overload = null; + _0_0 = callable.callbackFor$2(evaluated._values[2].length, namedSet); + _box_0.overload = _0_0._0; + _box_0.callback = _0_0._1; + _this._evaluate0$_addExceptionSpan$2(nodeWithSpan, new A._EvaluateVisitor__runBuiltInCallable_closure5(_box_0, evaluated, namedSet)); + declaredArguments = _box_0.overload.$arguments; + for (i = evaluated._values[2].length, t1 = declaredArguments.length; i < t1; ++i) { + argument = declaredArguments[i]; + t2 = evaluated._values[2]; + t3 = evaluated._values[0].remove$1(0, argument.name); + if (t3 == null) { + t3 = argument.defaultValue; + t3 = _this._evaluate0$_withoutSlash$2(t3.accept$1(_this), t3); + } + t2.push(t3); + } + if (_box_0.overload.restArgument != null) { + if (evaluated._values[2].length > t1) { + rest = B.JSArray_methods.sublist$1(evaluated._values[2], t1); + B.JSArray_methods.removeRange$2(evaluated._values[2], t1, evaluated._values[2].length); + } else + rest = B.List_empty19; + t1 = evaluated._values[0]; + argumentList = A.SassArgumentList$0(rest, t1, evaluated._values[4] === B.ListSeparator_undecided_null_undecided0 ? B.ListSeparator_rXA0 : evaluated._values[4]); + evaluated._values[2].push(argumentList); + } else + argumentList = null; + result = null; + try { + result = _this._evaluate0$_addExceptionSpan$2(nodeWithSpan, new A._EvaluateVisitor__runBuiltInCallable_closure6(_box_0, evaluated)); + } catch (exception) { + t1 = A.unwrapException(exception); + if (t1 instanceof A.SassException0) + throw exception; + else { + error = t1; + stackTrace = A.getTraceFromException(exception); + message = null; + try { + message = A._asString(J.get$message$x(error)); + } catch (exception) { + message0 = J.toString$0$(error); + message = message0; + } + A.throwWithTrace0(_this._evaluate0$_exception$2(message, nodeWithSpan.get$span(nodeWithSpan)), error, stackTrace); + } + } + _this._evaluate0$_callableNode = oldCallableNode; + if (argumentList == null) + return result; + if (evaluated._values[0].__js_helper$_length === 0) + return result; + if (argumentList._argument_list$_wereKeywordsAccessed) + return result; + throw A.wrapException(A.MultiSpanSassRuntimeException$0("No " + A.pluralize0("argument", evaluated._values[0].get$keys(0).get$length(0), null) + " named " + A.toSentence0(evaluated._values[0].get$keys(0).map$1$1(0, new A._EvaluateVisitor__runBuiltInCallable_closure7(), type$.Object), "or") + ".", nodeWithSpan.get$span(nodeWithSpan), "invocation", A.LinkedHashMap_LinkedHashMap$_literal([_box_0.overload.get$spanWithName(), "declaration"], type$.FileSpan, type$.String), _this._evaluate0$_stackTrace$1(nodeWithSpan.get$span(nodeWithSpan)), null)); + }, + _evaluate0$_evaluateArguments$1($arguments) { + var t1, t2, _i, expression, nodeForSpan, named, namedNodes, t3, t4, $name, value, restArgs, rest, restNodeForSpan, t5, separator, keywordRestArgs, keywordRest, keywordRestNodeForSpan, _this = this, + positional = A._setArrayType([], type$.JSArray_Value_2), + positionalNodes = A._setArrayType([], type$.JSArray_AstNode_2); + for (t1 = $arguments.positional, t2 = t1.length, _i = 0; _i < t2; ++_i) { + expression = t1[_i]; + nodeForSpan = _this._evaluate0$_expressionNode$1(expression); + positional.push(_this._evaluate0$_withoutSlash$2(expression.accept$1(_this), nodeForSpan)); + positionalNodes.push(nodeForSpan); + } + t1 = type$.String; + named = A.LinkedHashMap_LinkedHashMap$_empty(t1, type$.Value_2); + t2 = type$.AstNode_2; + namedNodes = A.LinkedHashMap_LinkedHashMap$_empty(t1, t2); + for (t3 = A.MapExtensions_get_pairs0($arguments.named, t1, type$.Expression_2), t3 = t3.get$iterator(t3); t3.moveNext$0();) { + t4 = t3.get$current(t3); + $name = t4._0; + value = t4._1; + nodeForSpan = _this._evaluate0$_expressionNode$1(value); + named.$indexSet(0, $name, _this._evaluate0$_withoutSlash$2(value.accept$1(_this), nodeForSpan)); + namedNodes.$indexSet(0, $name, nodeForSpan); + } + restArgs = $arguments.rest; + if (restArgs == null) + return new A._Record_5_named_namedNodes_positional_positionalNodes_separator([named, namedNodes, positional, positionalNodes, B.ListSeparator_undecided_null_undecided0]); + rest = restArgs.accept$1(_this); + restNodeForSpan = _this._evaluate0$_expressionNode$1(restArgs); + if (rest instanceof A.SassMap0) { + _this._evaluate0$_addRestMap$4(named, rest, restArgs, new A._EvaluateVisitor__evaluateArguments_closure7()); + t3 = A.LinkedHashMap_LinkedHashMap$_empty(t1, t2); + for (t4 = rest._map0$_contents, t4 = J.get$iterator$ax(t4.get$keys(t4)), t5 = type$.SassString_2; t4.moveNext$0();) + t3.$indexSet(0, t5._as(t4.get$current(t4))._string0$_text, restNodeForSpan); + namedNodes.addAll$1(0, t3); + separator = B.ListSeparator_undecided_null_undecided0; + } else if (rest instanceof A.SassList0) { + t3 = rest._list1$_contents; + B.JSArray_methods.addAll$1(positional, new A.MappedListIterable(t3, new A._EvaluateVisitor__evaluateArguments_closure8(_this, restNodeForSpan), A._arrayInstanceType(t3)._eval$1("MappedListIterable<1,Value0>"))); + B.JSArray_methods.addAll$1(positionalNodes, A.List_List$filled(t3.length, restNodeForSpan, false, t2)); + separator = rest._list1$_separator; + if (rest instanceof A.SassArgumentList0) { + rest._argument_list$_wereKeywordsAccessed = true; + rest._argument_list$_keywords.forEach$1(0, new A._EvaluateVisitor__evaluateArguments_closure9(_this, named, restNodeForSpan, namedNodes)); + } + } else { + positional.push(_this._evaluate0$_withoutSlash$2(rest, restNodeForSpan)); + positionalNodes.push(restNodeForSpan); + separator = B.ListSeparator_undecided_null_undecided0; + } + keywordRestArgs = $arguments.keywordRest; + if (keywordRestArgs == null) + return new A._Record_5_named_namedNodes_positional_positionalNodes_separator([named, namedNodes, positional, positionalNodes, separator]); + keywordRest = keywordRestArgs.accept$1(_this); + keywordRestNodeForSpan = _this._evaluate0$_expressionNode$1(keywordRestArgs); + if (keywordRest instanceof A.SassMap0) { + _this._evaluate0$_addRestMap$4(named, keywordRest, keywordRestArgs, new A._EvaluateVisitor__evaluateArguments_closure10()); + t1 = A.LinkedHashMap_LinkedHashMap$_empty(t1, t2); + for (t2 = keywordRest._map0$_contents, t2 = J.get$iterator$ax(t2.get$keys(t2)), t3 = type$.SassString_2; t2.moveNext$0();) + t1.$indexSet(0, t3._as(t2.get$current(t2))._string0$_text, keywordRestNodeForSpan); + namedNodes.addAll$1(0, t1); + return new A._Record_5_named_namedNodes_positional_positionalNodes_separator([named, namedNodes, positional, positionalNodes, separator]); + } else + throw A.wrapException(_this._evaluate0$_exception$2(string$.Variabs + keywordRest.toString$0(0) + ").", keywordRestArgs.get$span(keywordRestArgs))); + }, + _evaluate0$_evaluateMacroArguments$1(invocation) { + var t2, positional, named, rest, restNodeForSpan, keywordRestArgs_, keywordRest, keywordRestNodeForSpan, _this = this, + t1 = invocation.$arguments, + restArgs_ = t1.rest; + if (restArgs_ == null) + return new A._Record_2(t1.positional, t1.named); + t2 = t1.positional; + positional = A._setArrayType(t2.slice(0), A._arrayInstanceType(t2)); + named = A.LinkedHashMap_LinkedHashMap$of(t1.named, type$.String, type$.Expression_2); + rest = restArgs_.accept$1(_this); + restNodeForSpan = _this._evaluate0$_expressionNode$1(restArgs_); + if (rest instanceof A.SassMap0) + _this._evaluate0$_addRestMap$4(named, rest, invocation, new A._EvaluateVisitor__evaluateMacroArguments_closure7(restArgs_)); + else if (rest instanceof A.SassList0) { + t2 = rest._list1$_contents; + B.JSArray_methods.addAll$1(positional, new A.MappedListIterable(t2, new A._EvaluateVisitor__evaluateMacroArguments_closure8(_this, restNodeForSpan, restArgs_), A._arrayInstanceType(t2)._eval$1("MappedListIterable<1,Expression0>"))); + if (rest instanceof A.SassArgumentList0) { + rest._argument_list$_wereKeywordsAccessed = true; + rest._argument_list$_keywords.forEach$1(0, new A._EvaluateVisitor__evaluateMacroArguments_closure9(_this, named, restNodeForSpan, restArgs_)); + } + } else + positional.push(new A.ValueExpression0(_this._evaluate0$_withoutSlash$2(rest, restNodeForSpan), restArgs_.get$span(restArgs_))); + keywordRestArgs_ = t1.keywordRest; + if (keywordRestArgs_ == null) + return new A._Record_2(positional, named); + keywordRest = keywordRestArgs_.accept$1(_this); + keywordRestNodeForSpan = _this._evaluate0$_expressionNode$1(keywordRestArgs_); + if (keywordRest instanceof A.SassMap0) { + _this._evaluate0$_addRestMap$4(named, keywordRest, invocation, new A._EvaluateVisitor__evaluateMacroArguments_closure10(_this, keywordRestNodeForSpan, keywordRestArgs_)); + return new A._Record_2(positional, named); + } else + throw A.wrapException(_this._evaluate0$_exception$2(string$.Variabs + keywordRest.toString$0(0) + ").", keywordRestArgs_.get$span(keywordRestArgs_))); + }, + _evaluate0$_addRestMap$1$4(values, map, nodeWithSpan, convert) { + map._map0$_contents.forEach$1(0, new A._EvaluateVisitor__addRestMap_closure1(this, values, convert, this._evaluate0$_expressionNode$1(nodeWithSpan), map, nodeWithSpan)); + }, + _evaluate0$_addRestMap$4(values, map, nodeWithSpan, convert) { + return this._evaluate0$_addRestMap$1$4(values, map, nodeWithSpan, convert, type$.dynamic); + }, + _evaluate0$_verifyArguments$4(positional, named, $arguments, nodeWithSpan) { + return this._evaluate0$_addExceptionSpan$2(nodeWithSpan, new A._EvaluateVisitor__verifyArguments_closure1($arguments, positional, named)); + }, + visitSelectorExpression$1(node) { + var t1 = this._evaluate0$_styleRuleIgnoringAtRoot; + t1 = t1 == null ? null : t1.originalSelector.get$asSassList(); + return t1 == null ? B.C__SassNull0 : t1; + }, + visitStringExpression$1(node) { + var t1, t2, t3, t4, _i, value, t5, _0_0, text, _this = this, + oldInSupportsDeclaration = _this._evaluate0$_inSupportsDeclaration; + _this._evaluate0$_inSupportsDeclaration = false; + t1 = A._setArrayType([], type$.JSArray_String); + for (t2 = node.text.contents, t3 = t2.length, t4 = type$.Expression_2, _i = 0; _i < t3; ++_i) { + value = t2[_i]; + $label0$0: { + if (typeof value == "string") { + t5 = value; + break $label0$0; + } + if (t4._is(value)) { + _0_0 = value.accept$1(_this); + $label1$1: { + if (_0_0 instanceof A.SassString0) { + text = _0_0._string0$_text; + t5 = text; + break $label1$1; + } + t5 = _this._evaluate0$_serialize$3$quote(_0_0, value, false); + break $label1$1; + } + break $label0$0; + } + t5 = A.throwExpression(A.UnsupportedError$("Unknown interpolation value " + A.S(value))); + } + t1.push(t5); + } + t1 = B.JSArray_methods.join$0(t1); + _this._evaluate0$_inSupportsDeclaration = oldInSupportsDeclaration; + return new A.SassString0(t1, node.hasQuotes); + }, + visitSupportsExpression$1(expression) { + return new A.SassString0(this._evaluate0$_visitSupportsCondition$1(expression.condition), false); + }, + visitCssAtRule$1(node) { + var wasInKeyframes, wasInUnknownAtRule, t1, _this = this; + if (_this._evaluate0$_declarationName != null) + throw A.wrapException(_this._evaluate0$_exception$2(string$.At_rul, node.span)); + if (node.isChildless) { + _this._evaluate0$_assertInModule$2(_this._evaluate0$__parent, "__parent").addChild$1(A.ModifiableCssAtRule$0(node.name, node.span, true, node.value)); + return; + } + wasInKeyframes = _this._evaluate0$_inKeyframes; + wasInUnknownAtRule = _this._evaluate0$_inUnknownAtRule; + t1 = node.name; + if (A.unvendor0(t1.value) === "keyframes") + _this._evaluate0$_inKeyframes = true; + else + _this._evaluate0$_inUnknownAtRule = true; + _this._evaluate0$_withParent$2$4$scopeWhen$through(A.ModifiableCssAtRule$0(t1, node.span, false, node.value), new A._EvaluateVisitor_visitCssAtRule_closure3(_this, node), false, new A._EvaluateVisitor_visitCssAtRule_closure4(), type$.ModifiableCssAtRule_2, type$.Null); + _this._evaluate0$_inUnknownAtRule = wasInUnknownAtRule; + _this._evaluate0$_inKeyframes = wasInKeyframes; + }, + visitCssComment$1(node) { + var _this = this, + _s8_ = "__parent", + _s13_ = "_endOfImports"; + if (_this._evaluate0$_assertInModule$2(_this._evaluate0$__parent, _s8_) === _this._evaluate0$_assertInModule$2(_this._evaluate0$__root, "_root") && _this._evaluate0$_assertInModule$2(_this._evaluate0$__endOfImports, _s13_) === J.get$length$asx(_this._evaluate0$_assertInModule$2(_this._evaluate0$__root, "_root").children._collection$_source)) + _this._evaluate0$__endOfImports = _this._evaluate0$_assertInModule$2(_this._evaluate0$__endOfImports, _s13_) + 1; + _this._evaluate0$_assertInModule$2(_this._evaluate0$__parent, _s8_).addChild$1(new A.ModifiableCssComment0(node.text, node.span)); + }, + visitCssDeclaration$1(node) { + this._evaluate0$_assertInModule$2(this._evaluate0$__parent, "__parent").addChild$1(A.ModifiableCssDeclaration$0(node.name, node.value, node.span, node.parsedAsCustomProperty, node.valueSpanForMap)); + }, + visitCssImport$1(node) { + var t1, _this = this, + _s8_ = "__parent", + _s5_ = "_root", + _s13_ = "_endOfImports", + modifiableNode = new A.ModifiableCssImport0(node.url, node.modifiers, node.span); + if (_this._evaluate0$_assertInModule$2(_this._evaluate0$__parent, _s8_) !== _this._evaluate0$_assertInModule$2(_this._evaluate0$__root, _s5_)) + _this._evaluate0$_assertInModule$2(_this._evaluate0$__parent, _s8_).addChild$1(modifiableNode); + else if (_this._evaluate0$_assertInModule$2(_this._evaluate0$__endOfImports, _s13_) === J.get$length$asx(_this._evaluate0$_assertInModule$2(_this._evaluate0$__root, _s5_).children._collection$_source)) { + _this._evaluate0$_assertInModule$2(_this._evaluate0$__root, _s5_).addChild$1(modifiableNode); + _this._evaluate0$__endOfImports = _this._evaluate0$_assertInModule$2(_this._evaluate0$__endOfImports, _s13_) + 1; + } else { + t1 = _this._evaluate0$_outOfOrderImports; + (t1 == null ? _this._evaluate0$_outOfOrderImports = A._setArrayType([], type$.JSArray_ModifiableCssImport_2) : t1).push(modifiableNode); + } + }, + visitCssKeyframeBlock$1(node) { + this._evaluate0$_withParent$2$4$scopeWhen$through(A.ModifiableCssKeyframeBlock$0(node.selector, node.span), new A._EvaluateVisitor_visitCssKeyframeBlock_closure3(this, node), false, new A._EvaluateVisitor_visitCssKeyframeBlock_closure4(), type$.ModifiableCssKeyframeBlock_2, type$.Null); + }, + visitCssMediaRule$1(node) { + var mergedQueries, t1, mergedSources, t2, t3, _this = this; + if (_this._evaluate0$_declarationName != null) + throw A.wrapException(_this._evaluate0$_exception$2(string$.Media_, node.span)); + mergedQueries = A.NullableExtension_andThen0(_this._evaluate0$_mediaQueries, new A._EvaluateVisitor_visitCssMediaRule_closure5(_this, node)); + t1 = mergedQueries == null; + if (!t1 && J.get$isEmpty$asx(mergedQueries)) + return; + if (t1) + mergedSources = B.Set_empty5; + else { + t2 = _this._evaluate0$_mediaQuerySources; + t2.toString; + t2 = A.LinkedHashSet_LinkedHashSet$of(t2, type$.CssMediaQuery_2); + t3 = _this._evaluate0$_mediaQueries; + t3.toString; + t2.addAll$1(0, t3); + t2.addAll$1(0, node.queries); + mergedSources = t2; + } + t1 = t1 ? node.queries : mergedQueries; + _this._evaluate0$_withParent$2$4$scopeWhen$through(A.ModifiableCssMediaRule$0(t1, node.span), new A._EvaluateVisitor_visitCssMediaRule_closure6(_this, mergedQueries, node, mergedSources), false, new A._EvaluateVisitor_visitCssMediaRule_closure7(mergedSources), type$.ModifiableCssMediaRule_2, type$.Null); + }, + visitCssStyleRule$1(node) { + var t1, styleRule, t2, t3, t4, originalSelector, rule, oldAtRootExcludingStyleRule, _0_1, lastChild, _this = this; + if (_this._evaluate0$_declarationName != null) + throw A.wrapException(_this._evaluate0$_exception$2(string$.Style_, node.span)); + t1 = _this._evaluate0$_atRootExcludingStyleRule; + styleRule = t1 ? null : _this._evaluate0$_styleRuleIgnoringAtRoot; + t2 = node._style_rule0$_selector._box0$_inner.value; + t3 = styleRule == null; + t4 = t3 ? null : styleRule.originalSelector; + originalSelector = t2.resolveParentSelectors$2$implicitParent(t4, !t1); + rule = A.ModifiableCssStyleRule$0(_this._evaluate0$_assertInModule$2(_this._evaluate0$__extensionStore, "_extensionStore").addSelector$2(originalSelector, _this._evaluate0$_mediaQueries), node.span, originalSelector); + oldAtRootExcludingStyleRule = _this._evaluate0$_atRootExcludingStyleRule; + _this._evaluate0$_atRootExcludingStyleRule = false; + _this._evaluate0$_withParent$2$4$scopeWhen$through(rule, new A._EvaluateVisitor_visitCssStyleRule_closure3(_this, rule, node), false, new A._EvaluateVisitor_visitCssStyleRule_closure4(), type$.ModifiableCssStyleRule_2, type$.Null); + _this._evaluate0$_atRootExcludingStyleRule = oldAtRootExcludingStyleRule; + t1 = _this._evaluate0$_assertInModule$2(_this._evaluate0$__parent, "__parent").children._collection$_source; + t2 = J.getInterceptor$asx(t1); + _0_1 = t2.get$length(t1); + if (_0_1 >= 1) { + lastChild = t2.elementAt$1(t1, _0_1 - 1); + t1 = t3; + } else { + lastChild = null; + t1 = false; + } + if (t1) + lastChild.isGroupEnd = true; + }, + visitCssStylesheet$1(node) { + var t1; + for (t1 = J.get$iterator$ax(node.get$children(node)); t1.moveNext$0();) + t1.get$current(t1).accept$1(this); + }, + visitCssSupportsRule$1(node) { + var _this = this; + if (_this._evaluate0$_declarationName != null) + throw A.wrapException(_this._evaluate0$_exception$2(string$.Suppor, node.span)); + _this._evaluate0$_withParent$2$4$scopeWhen$through(A.ModifiableCssSupportsRule$0(node.condition, node.span), new A._EvaluateVisitor_visitCssSupportsRule_closure3(_this, node), false, new A._EvaluateVisitor_visitCssSupportsRule_closure4(), type$.ModifiableCssSupportsRule_2, type$.Null); + }, + _evaluate0$_handleReturn$1$2(list, callback) { + var t1, _i, _0_0; + for (t1 = list.length, _i = 0; _i < list.length; list.length === t1 || (0, A.throwConcurrentModificationError)(list), ++_i) { + _0_0 = callback.call$1(list[_i]); + if (_0_0 != null) + return _0_0; + } + return null; + }, + _evaluate0$_handleReturn$2(list, callback) { + return this._evaluate0$_handleReturn$1$2(list, callback, type$.dynamic); + }, + _evaluate0$_withEnvironment$1$2(environment, callback) { + var result, + oldEnvironment = this._evaluate0$_environment; + this._evaluate0$_environment = environment; + result = callback.call$0(); + this._evaluate0$_environment = oldEnvironment; + return result; + }, + _evaluate0$_withEnvironment$2(environment, callback) { + return this._evaluate0$_withEnvironment$1$2(environment, callback, type$.dynamic); + }, + _evaluate0$_interpolationToValue$3$trim$warnForColor(interpolation, trim, warnForColor) { + var result = this._evaluate0$_performInterpolation$2$warnForColor(interpolation, warnForColor), + t1 = trim ? A.trimAscii0(result, true) : result; + return new A.CssValue0(t1, interpolation.span, type$.CssValue_String_2); + }, + _evaluate0$_interpolationToValue$1(interpolation) { + return this._evaluate0$_interpolationToValue$3$trim$warnForColor(interpolation, false, false); + }, + _evaluate0$_interpolationToValue$2$warnForColor(interpolation, warnForColor) { + return this._evaluate0$_interpolationToValue$3$trim$warnForColor(interpolation, false, warnForColor); + }, + _evaluate0$_performInterpolation$2$warnForColor(interpolation, warnForColor) { + return this._evaluate0$_performInterpolationHelper$3$sourceMap$warnForColor(interpolation, false, warnForColor)._0; + }, + _evaluate0$_performInterpolation$1(interpolation) { + return this._evaluate0$_performInterpolation$2$warnForColor(interpolation, false); + }, + _evaluate0$_performInterpolationWithMap$2$warnForColor(interpolation, warnForColor) { + var _0_0 = this._evaluate0$_performInterpolationHelper$3$sourceMap$warnForColor(interpolation, true, true), + map = _0_0._1; + map.toString; + return new A._Record_2(_0_0._0, map); + }, + _evaluate0$_performInterpolationHelper$3$sourceMap$warnForColor(interpolation, sourceMap, warnForColor) { + var t1, t2, t3, t4, t5, t6, t7, first, _i, t8, value, result, t9, result0, _this = this, _null = null, + targetLocations = sourceMap ? A._setArrayType([], type$.JSArray_SourceLocation) : _null, + oldInSupportsDeclaration = _this._evaluate0$_inSupportsDeclaration; + _this._evaluate0$_inSupportsDeclaration = false; + for (t1 = interpolation.contents, t2 = t1.length, t3 = type$.Expression_2, t4 = targetLocations == null, t5 = type$.JSArray_Object, t6 = interpolation.span, t7 = type$.Object, first = true, _i = 0, t8 = ""; _i < t2; ++_i, first = false) { + value = t1[_i]; + if (!first) + if (!t4) + targetLocations.push(A.SourceLocation$(t8.length, _null, _null, _null)); + if (typeof value == "string") { + t8 += value; + continue; + } + t3._as(value); + result = value.accept$1(_this); + if (warnForColor && $.$get$namesByColor0().containsKey$1(result)) { + t9 = A._setArrayType([""], t5); + result0 = A.List_List$from(t9, false, t7); + result0.fixed$length = Array; + result0.immutable$list = Array; + result0 = new A.Interpolation0(result0, t6); + result0.Interpolation$20(t9, t6); + t9 = $.$get$namesByColor0(); + _this._evaluate0$_warn$2(string$.You_pr + A.S(t9.$index(0, result)) + string$.x20in_in + result.toString$0(0) + string$.x2c_whicw + A.S(t9.$index(0, result)) + string$.x22x29__If + new A.BinaryOperationExpression0(B.BinaryOperator_anB0, new A.StringExpression0(result0, true), value, false).toString$0(0) + "'.", value.get$span(value)); + } + t8 += _this._evaluate0$_serialize$3$quote(result, value, false); + } + _this._evaluate0$_inSupportsDeclaration = oldInSupportsDeclaration; + return new A._Record_2(t8.charCodeAt(0) == 0 ? t8 : t8, A.NullableExtension_andThen0(targetLocations, new A._EvaluateVisitor__performInterpolationHelper_closure1(interpolation))); + }, + _evaluate0$_serialize$3$quote(value, nodeWithSpan, quote) { + return this._evaluate0$_addExceptionSpan$2(nodeWithSpan, new A._EvaluateVisitor__serialize_closure1(value, quote)); + }, + _evaluate0$_serialize$2(value, nodeWithSpan) { + return this._evaluate0$_serialize$3$quote(value, nodeWithSpan, true); + }, + _evaluate0$_expressionNode$1(expression) { + var t1; + if (expression instanceof A.VariableExpression0) { + t1 = this._evaluate0$_addExceptionSpan$2(expression, new A._EvaluateVisitor__expressionNode_closure1(this, expression)); + return t1 == null ? expression : t1; + } else + return expression; + }, + _evaluate0$_withParent$2$4$scopeWhen$through(node, callback, scopeWhen, through, $S, $T) { + var t1, result, _this = this; + _this._evaluate0$_addChild$2$through(node, through); + t1 = _this._evaluate0$_assertInModule$2(_this._evaluate0$__parent, "__parent"); + _this._evaluate0$__parent = node; + result = _this._evaluate0$_environment.scope$1$2$when(callback, scopeWhen, $T); + _this._evaluate0$__parent = t1; + return result; + }, + _evaluate0$_withParent$2$3$scopeWhen(node, callback, scopeWhen, $S, $T) { + return this._evaluate0$_withParent$2$4$scopeWhen$through(node, callback, scopeWhen, null, $S, $T); + }, + _evaluate0$_withParent$2$2(node, callback, $S, $T) { + return this._evaluate0$_withParent$2$4$scopeWhen$through(node, callback, true, null, $S, $T); + }, + _evaluate0$_addChild$2$through(node, through) { + var _0_0, grandparent, t1, + $parent = this._evaluate0$_assertInModule$2(this._evaluate0$__parent, "__parent"); + if (through != null) { + for (; through.call$1($parent); $parent = _0_0) { + _0_0 = $parent._node$_parent; + if (_0_0 == null) + throw A.wrapException(A.ArgumentError$(string$.throug + node.toString$0(0) + ".", null)); + } + if ($parent.get$hasFollowingSibling()) { + grandparent = $parent._node$_parent; + t1 = grandparent.children; + if ($parent.equalsIgnoringChildren$1(t1.get$last(t1))) + $parent = type$.ModifiableCssParentNode_2._as(t1.get$last(t1)); + else { + $parent = $parent.copyWithoutChildren$0(); + grandparent.addChild$1($parent); + } + } + } + $parent.addChild$1(node); + }, + _evaluate0$_addChild$1(node) { + return this._evaluate0$_addChild$2$through(node, null); + }, + _evaluate0$_withStyleRule$1$2(rule, callback) { + var result, + oldRule = this._evaluate0$_styleRuleIgnoringAtRoot; + this._evaluate0$_styleRuleIgnoringAtRoot = rule; + result = callback.call$0(); + this._evaluate0$_styleRuleIgnoringAtRoot = oldRule; + return result; + }, + _evaluate0$_withStyleRule$2(rule, callback) { + return this._evaluate0$_withStyleRule$1$2(rule, callback, type$.dynamic); + }, + _evaluate0$_withMediaQueries$1$3(queries, sources, callback) { + var result, _this = this, + oldMediaQueries = _this._evaluate0$_mediaQueries, + oldSources = _this._evaluate0$_mediaQuerySources; + _this._evaluate0$_mediaQueries = queries; + _this._evaluate0$_mediaQuerySources = sources; + result = callback.call$0(); + _this._evaluate0$_mediaQueries = oldMediaQueries; + _this._evaluate0$_mediaQuerySources = oldSources; + return result; + }, + _evaluate0$_withMediaQueries$3(queries, sources, callback) { + return this._evaluate0$_withMediaQueries$1$3(queries, sources, callback, type$.dynamic); + }, + _evaluate0$_withStackFrame$1$3(member, nodeWithSpan, callback) { + var oldMember, result, _this = this, + t1 = _this._evaluate0$_stack; + t1.push(new A._Record_2(_this._evaluate0$_member, nodeWithSpan)); + oldMember = _this._evaluate0$_member; + _this._evaluate0$_member = member; + result = callback.call$0(); + _this._evaluate0$_member = oldMember; + t1.pop(); + return result; + }, + _evaluate0$_withStackFrame$3(member, nodeWithSpan, callback) { + return this._evaluate0$_withStackFrame$1$3(member, nodeWithSpan, callback, type$.dynamic); + }, + _evaluate0$_withoutSlash$2(value, nodeForSpan) { + if (value instanceof A.SassNumber0 && value.asSlash != null && true) + this._evaluate0$_warn$3(string$.Using__i + A.S(new A._EvaluateVisitor__withoutSlash_recommendation1().call$1(value)) + string$.x0a_Morex20, nodeForSpan.get$span(nodeForSpan), B.Deprecation_wWh); + return value.withoutSlash$0(); + }, + _evaluate0$_stackFrame$2(member, span) { + return A.frameForSpan0(span, member, A.NullableExtension_andThen0(span.get$sourceUrl(span), new A._EvaluateVisitor__stackFrame_closure1(this))); + }, + _evaluate0$_stackTrace$1(span) { + var t2, t3, _i, t4, nodeWithSpan, _this = this, + t1 = A._setArrayType([], type$.JSArray_Frame); + for (t2 = _this._evaluate0$_stack, t3 = t2.length, _i = 0; _i < t2.length; t2.length === t3 || (0, A.throwConcurrentModificationError)(t2), ++_i) { + t4 = t2[_i]; + nodeWithSpan = t4._1; + t1.push(_this._evaluate0$_stackFrame$2(t4._0, nodeWithSpan.get$span(nodeWithSpan))); + } + if (span != null) + t1.push(_this._evaluate0$_stackFrame$2(_this._evaluate0$_member, span)); + return A.Trace$(new A.ReversedListIterable(t1, type$.ReversedListIterable_Frame), null); + }, + _evaluate0$_stackTrace$0() { + return this._evaluate0$_stackTrace$1(null); + }, + _evaluate0$_warn$3(message, span, deprecation) { + var t1, trace, _this = this; + if (_this._evaluate0$_quietDeps) + if (!_this._evaluate0$_inDependency) { + t1 = _this._evaluate0$_currentCallable; + t1 = t1 == null ? null : t1.inDependency; + t1 = t1 === true; + } else + t1 = true; + else + t1 = false; + if (t1) + return; + if (!_this._evaluate0$_warningsEmitted.add$1(0, new A._Record_2(message, span))) + return; + trace = _this._evaluate0$_stackTrace$1(span); + t1 = _this._evaluate0$_logger; + if (deprecation == null) + t1.warn$3$span$trace(0, message, span, trace); + else + A.WarnForDeprecation_warnForDeprecation0(t1, deprecation, message, span, trace); + }, + _evaluate0$_warn$2(message, span) { + return this._evaluate0$_warn$3(message, span, null); + }, + _evaluate0$_exception$2(message, span) { + var t1, t2; + if (span == null) { + t1 = B.JSArray_methods.get$last(this._evaluate0$_stack)._1; + t1 = t1.get$span(t1); + } else + t1 = span; + t2 = this._evaluate0$_stackTrace$1(span); + return new A.SassRuntimeException0(t2, B.Set_empty, message, t1); + }, + _evaluate0$_exception$1(message) { + return this._evaluate0$_exception$2(message, null); + }, + _evaluate0$_multiSpanException$3(message, primaryLabel, secondaryLabels) { + var t1 = B.JSArray_methods.get$last(this._evaluate0$_stack)._1; + return A.MultiSpanSassRuntimeException$0(message, t1.get$span(t1), primaryLabel, secondaryLabels, this._evaluate0$_stackTrace$0(), null); + }, + _evaluate0$_addExceptionSpan$1$3$addStackFrame(nodeWithSpan, callback, addStackFrame) { + var error, stackTrace, t1, exception; + try { + t1 = callback.call$0(); + return t1; + } catch (exception) { + t1 = A.unwrapException(exception); + if (t1 instanceof A.SassScriptException0) { + error = t1; + stackTrace = A.getTraceFromException(exception); + t1 = error.withSpan$1(nodeWithSpan.get$span(nodeWithSpan)); + A.throwWithTrace0(t1.withTrace$1(this._evaluate0$_stackTrace$1(addStackFrame ? nodeWithSpan.get$span(nodeWithSpan) : null)), error, stackTrace); + } else + throw exception; + } + }, + _evaluate0$_addExceptionSpan$2(nodeWithSpan, callback) { + return this._evaluate0$_addExceptionSpan$1$3$addStackFrame(nodeWithSpan, callback, true, type$.dynamic); + }, + _evaluate0$_addExceptionSpan$3$addStackFrame(nodeWithSpan, callback, addStackFrame) { + return this._evaluate0$_addExceptionSpan$1$3$addStackFrame(nodeWithSpan, callback, addStackFrame, type$.dynamic); + }, + _evaluate0$_addExceptionTrace$1$1(callback) { + var error, stackTrace, t1, exception, t2; + try { + t1 = callback.call$0(); + return t1; + } catch (exception) { + t1 = A.unwrapException(exception); + if (type$.SassRuntimeException_2._is(t1)) + throw exception; + else if (t1 instanceof A.SassException0) { + error = t1; + stackTrace = A.getTraceFromException(exception); + t1 = error; + t2 = J.getInterceptor$z(t1); + A.throwWithTrace0(error.withTrace$1(this._evaluate0$_stackTrace$1(A.SourceSpanException.prototype.get$span.call(t2, t1))), error, stackTrace); + } else + throw exception; + } + }, + _evaluate0$_addExceptionTrace$1(callback) { + return this._evaluate0$_addExceptionTrace$1$1(callback, type$.dynamic); + }, + _evaluate0$_addErrorSpan$1$2(nodeWithSpan, callback) { + var error, stackTrace, t1, exception, t2, t3; + try { + t1 = callback.call$0(); + return t1; + } catch (exception) { + t1 = A.unwrapException(exception); + if (type$.SassRuntimeException_2._is(t1)) { + error = t1; + stackTrace = A.getTraceFromException(exception); + if (!B.JSString_methods.startsWith$1(J.get$span$z(error).get$text(), "@error")) + throw exception; + t1 = error._span_exception$_message; + t2 = nodeWithSpan.get$span(nodeWithSpan); + t3 = this._evaluate0$_stackTrace$0(); + A.throwWithTrace0(new A.SassRuntimeException0(t3, B.Set_empty, t1, t2), error, stackTrace); + } else + throw exception; + } + }, + _evaluate0$_addErrorSpan$2(nodeWithSpan, callback) { + return this._evaluate0$_addErrorSpan$1$2(nodeWithSpan, callback, type$.dynamic); + } + }; + A._EvaluateVisitor_closure25.prototype = { + call$1($arguments) { + var module, t2, + t1 = J.getInterceptor$asx($arguments), + variable = t1.$index($arguments, 0).assertString$1("name"); + t1 = t1.$index($arguments, 1).get$realNull(); + module = t1 == null ? null : t1.assertString$1("module"); + t1 = this.$this._evaluate0$_environment; + t2 = A.stringReplaceAllUnchecked(variable._string0$_text, "_", "-"); + return t1.globalVariableExists$2$namespace(t2, module == null ? null : module._string0$_text) ? B.SassBoolean_true0 : B.SassBoolean_false0; + }, + $signature: 20 + }; + A._EvaluateVisitor_closure26.prototype = { + call$1($arguments) { + var variable = J.$index$asx($arguments, 0).assertString$1("name"), + t1 = this.$this._evaluate0$_environment; + return t1.getVariable$1(A.stringReplaceAllUnchecked(variable._string0$_text, "_", "-")) != null ? B.SassBoolean_true0 : B.SassBoolean_false0; + }, + $signature: 20 + }; + A._EvaluateVisitor_closure27.prototype = { + call$1($arguments) { + var module, t2, t3, t4, + t1 = J.getInterceptor$asx($arguments), + variable = t1.$index($arguments, 0).assertString$1("name"); + t1 = t1.$index($arguments, 1).get$realNull(); + module = t1 == null ? null : t1.assertString$1("module"); + t1 = this.$this; + t2 = t1._evaluate0$_environment; + t3 = variable._string0$_text; + t4 = A.stringReplaceAllUnchecked(t3, "_", "-"); + return t2.getFunction$2$namespace(t4, module == null ? null : module._string0$_text) != null || t1._evaluate0$_builtInFunctions.containsKey$1(t3) ? B.SassBoolean_true0 : B.SassBoolean_false0; + }, + $signature: 20 + }; + A._EvaluateVisitor_closure28.prototype = { + call$1($arguments) { + var module, t2, + t1 = J.getInterceptor$asx($arguments), + variable = t1.$index($arguments, 0).assertString$1("name"); + t1 = t1.$index($arguments, 1).get$realNull(); + module = t1 == null ? null : t1.assertString$1("module"); + t1 = this.$this._evaluate0$_environment; + t2 = A.stringReplaceAllUnchecked(variable._string0$_text, "_", "-"); + return t1.getMixin$2$namespace(t2, module == null ? null : module._string0$_text) != null ? B.SassBoolean_true0 : B.SassBoolean_false0; + }, + $signature: 20 + }; + A._EvaluateVisitor_closure29.prototype = { + call$1($arguments) { + var t1 = this.$this._evaluate0$_environment; + if (!t1._environment0$_inMixin) + throw A.wrapException(A.SassScriptException$0(string$.conten, null)); + return t1._environment0$_content != null ? B.SassBoolean_true0 : B.SassBoolean_false0; + }, + $signature: 20 + }; + A._EvaluateVisitor_closure30.prototype = { + call$1($arguments) { + var t2, t3, t4, + t1 = J.$index$asx($arguments, 0).assertString$1("module")._string0$_text, + module = this.$this._evaluate0$_environment._environment0$_modules.$index(0, t1); + if (module == null) + throw A.wrapException('There is no module with namespace "' + t1 + '".'); + t1 = type$.Value_2; + t2 = A.LinkedHashMap_LinkedHashMap$_empty(t1, t1); + for (t3 = A.MapExtensions_get_pairs0(module.get$variables(), type$.String, t1), t3 = t3.get$iterator(t3); t3.moveNext$0();) { + t4 = t3.get$current(t3); + t2.$indexSet(0, new A.SassString0(t4._0, true), t4._1); + } + return new A.SassMap0(A.ConstantMap_ConstantMap$from(t2, t1, t1)); + }, + $signature: 31 + }; + A._EvaluateVisitor_closure31.prototype = { + call$1($arguments) { + var t2, t3, t4, + t1 = J.$index$asx($arguments, 0).assertString$1("module")._string0$_text, + module = this.$this._evaluate0$_environment._environment0$_modules.$index(0, t1); + if (module == null) + throw A.wrapException('There is no module with namespace "' + t1 + '".'); + t1 = type$.Value_2; + t2 = A.LinkedHashMap_LinkedHashMap$_empty(t1, t1); + for (t3 = A.MapExtensions_get_pairs0(module.get$functions(module), type$.String, type$.Callable_2), t3 = t3.get$iterator(t3); t3.moveNext$0();) { + t4 = t3.get$current(t3); + t2.$indexSet(0, new A.SassString0(t4._0, true), new A.SassFunction0(t4._1)); + } + return new A.SassMap0(A.ConstantMap_ConstantMap$from(t2, t1, t1)); + }, + $signature: 31 + }; + A._EvaluateVisitor_closure32.prototype = { + call$1($arguments) { + var t2, t3, t4, + t1 = J.$index$asx($arguments, 0).assertString$1("module")._string0$_text, + module = this.$this._evaluate0$_environment._environment0$_modules.$index(0, t1); + if (module == null) + throw A.wrapException('There is no module with namespace "' + t1 + '".'); + t1 = type$.Value_2; + t2 = A.LinkedHashMap_LinkedHashMap$_empty(t1, t1); + for (t3 = A.MapExtensions_get_pairs0(module.get$mixins(), type$.String, type$.Callable_2), t3 = t3.get$iterator(t3); t3.moveNext$0();) { + t4 = t3.get$current(t3); + t2.$indexSet(0, new A.SassString0(t4._0, true), new A.SassMixin0(t4._1)); + } + return new A.SassMap0(A.ConstantMap_ConstantMap$from(t2, t1, t1)); + }, + $signature: 31 + }; + A._EvaluateVisitor_closure33.prototype = { + call$1($arguments) { + var module, t2, callable, + t1 = J.getInterceptor$asx($arguments), + $name = t1.$index($arguments, 0).assertString$1("name"), + css = t1.$index($arguments, 1).get$isTruthy(); + t1 = t1.$index($arguments, 2).get$realNull(); + module = t1 == null ? null : t1.assertString$1("module"); + if (css) { + if (module != null) + throw A.wrapException(string$.x24css_a); + return new A.SassFunction0(new A.PlainCssCallable0($name._string0$_text)); + } + t1 = this.$this; + t2 = t1._evaluate0$_callableNode; + t2.toString; + callable = t1._evaluate0$_addExceptionSpan$2(t2, new A._EvaluateVisitor__closure10(t1, $name, module)); + if (callable == null) + throw A.wrapException("Function not found: " + $name.toString$0(0)); + return new A.SassFunction0(callable); + }, + $signature: 269 + }; + A._EvaluateVisitor__closure10.prototype = { + call$0() { + var local, + normalizedName = A.stringReplaceAllUnchecked(this.name._string0$_text, "_", "-"), + t1 = this.module, + namespace = t1 == null ? null : t1._string0$_text; + t1 = this.$this; + local = t1._evaluate0$_environment.getFunction$2$namespace(normalizedName, namespace); + if (local != null || namespace != null) + return local; + return t1._evaluate0$_builtInFunctions.$index(0, normalizedName); + }, + $signature: 100 + }; + A._EvaluateVisitor_closure34.prototype = { + call$1($arguments) { + var module, t2, callable, + t1 = J.getInterceptor$asx($arguments), + $name = t1.$index($arguments, 0).assertString$1("name"); + t1 = t1.$index($arguments, 1).get$realNull(); + module = t1 == null ? null : t1.assertString$1("module"); + t1 = this.$this; + t2 = t1._evaluate0$_callableNode; + t2.toString; + callable = t1._evaluate0$_addExceptionSpan$2(t2, new A._EvaluateVisitor__closure9(t1, $name, module)); + if (callable == null) + throw A.wrapException("Mixin not found: " + $name.toString$0(0)); + return new A.SassMixin0(callable); + }, + $signature: 209 + }; + A._EvaluateVisitor__closure9.prototype = { + call$0() { + var t1 = this.$this._evaluate0$_environment, + t2 = A.stringReplaceAllUnchecked(this.name._string0$_text, "_", "-"), + t3 = this.module; + return t1.getMixin$2$namespace(t2, t3 == null ? null : t3._string0$_text); + }, + $signature: 100 + }; + A._EvaluateVisitor_closure35.prototype = { + call$1($arguments) { + var t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, invocation, callableNode, callable, + t1 = J.getInterceptor$asx($arguments), + $function = t1.$index($arguments, 0), + args = type$.SassArgumentList_2._as(t1.$index($arguments, 1)); + t1 = this.$this; + t2 = t1._evaluate0$_callableNode; + t2.toString; + t3 = A._setArrayType([], type$.JSArray_Expression_2); + t4 = type$.String; + t5 = type$.Expression_2; + t6 = t2.get$span(t2); + t7 = t2.get$span(t2); + args._argument_list$_wereKeywordsAccessed = true; + t8 = args._argument_list$_keywords; + if (t8.get$isEmpty(t8)) + t2 = null; + else { + t9 = type$.Value_2; + t10 = A.LinkedHashMap_LinkedHashMap$_empty(t9, t9); + for (args._argument_list$_wereKeywordsAccessed = true, t8 = A.MapExtensions_get_pairs0(t8, t4, t9), t8 = t8.get$iterator(t8); t8.moveNext$0();) { + t11 = t8.get$current(t8); + t10.$indexSet(0, new A.SassString0(t11._0, false), t11._1); + } + t2 = new A.ValueExpression0(new A.SassMap0(A.ConstantMap_ConstantMap$from(t10, t9, t9)), t2.get$span(t2)); + } + invocation = new A.ArgumentInvocation0(A.List_List$unmodifiable(t3, t5), A.ConstantMap_ConstantMap$from(A.LinkedHashMap_LinkedHashMap$_empty(t4, t5), t4, t5), new A.ValueExpression0(args, t7), t2, t6); + if ($function instanceof A.SassString0) { + t2 = $function.toString$0(0); + A.EvaluationContext_current0().warn$2(0, string$.Passina + t2 + "))", B.Deprecation_4iQ); + callableNode = t1._evaluate0$_callableNode; + return t1.visitFunctionExpression$1(new A.FunctionExpression0(null, $function._string0$_text, invocation, callableNode.get$span(callableNode))); + } + callable = $function.assertFunction$1("function").callable; + if (type$.Callable_2._is(callable)) { + t2 = t1._evaluate0$_callableNode; + t2.toString; + return t1._evaluate0$_runFunctionCallable$3(invocation, callable, t2); + } else + throw A.wrapException(A.SassScriptException$0("The function " + callable.get$name(callable) + string$.x20is_as, null)); + }, + $signature: 3 + }; + A._EvaluateVisitor_closure36.prototype = { + call$1($arguments) { + var withMap, t2, values, configuration, t3, + t1 = J.getInterceptor$asx($arguments), + url = A.Uri_parse(t1.$index($arguments, 0).assertString$1("url")._string0$_text); + t1 = t1.$index($arguments, 1).get$realNull(); + withMap = t1 == null ? null : t1.assertMap$1("with")._map0$_contents; + t1 = this.$this; + t2 = t1._evaluate0$_callableNode; + t2.toString; + if (withMap != null) { + values = A.LinkedHashMap_LinkedHashMap$_empty(type$.String, type$.ConfiguredValue_2); + withMap.forEach$1(0, new A._EvaluateVisitor__closure7(values, t2.get$span(t2), t2)); + configuration = new A.ExplicitConfiguration0(t2, values, null); + } else + configuration = B.Configuration_Map_empty_null0; + t3 = t2.get$span(t2); + t1._evaluate0$_loadModule$7$baseUrl$configuration$namesInErrors(url, "load-css()", t2, new A._EvaluateVisitor__closure8(t1), t3.get$sourceUrl(t3), configuration, true); + t1._evaluate0$_assertConfigurationIsEmpty$2$nameInError(configuration, true); + }, + $signature: 248 + }; + A._EvaluateVisitor__closure7.prototype = { + call$2(variable, value) { + var t1 = variable.assertString$1("with key"), + $name = A.stringReplaceAllUnchecked(t1._string0$_text, "_", "-"); + t1 = this.values; + if (t1.containsKey$1($name)) + throw A.wrapException("The variable $" + $name + " was configured twice."); + t1.$indexSet(0, $name, new A.ConfiguredValue0(value, this.span, this.callableNode)); + }, + $signature: 80 + }; + A._EvaluateVisitor__closure8.prototype = { + call$2(module, _) { + var t1 = this.$this; + return t1._evaluate0$_combineCss$2$clone(module, true).accept$1(t1); + }, + $signature: 102 + }; + A._EvaluateVisitor_closure37.prototype = { + call$1($arguments) { + var callableNode, t2, t3, t4, t5, callable, $content, + t1 = J.getInterceptor$asx($arguments), + mixin = t1.$index($arguments, 0), + args = type$.SassArgumentList_2._as(t1.$index($arguments, 1)); + t1 = this.$this; + callableNode = t1._evaluate0$_callableNode; + t2 = callableNode.get$span(callableNode); + t3 = callableNode.get$span(callableNode); + t4 = type$.Expression_2; + t5 = A.List_List$unmodifiable(B.List_empty20, t4); + t4 = A.ConstantMap_ConstantMap$from(B.Map_empty14, type$.String, t4); + callable = mixin.assertMixin$1("mixin").callable; + $content = t1._evaluate0$_environment._environment0$_content; + if (type$.Callable_2._is(callable)) + t1._evaluate0$_applyMixin$5(callable, $content, new A.ArgumentInvocation0(t5, t4, new A.ValueExpression0(args, t3), null, t2), callableNode, callableNode); + else + throw A.wrapException(A.SassScriptException$0("The mixin " + callable.get$name(callable) + string$.x20is_as, null)); + }, + $signature: 248 + }; + A._EvaluateVisitor_run_closure1.prototype = { + call$0() { + var module, t2, _this = this, url = null, + t1 = _this.node, + _0_0 = t1.span.file.url; + if (_0_0 != null) { + url = _0_0; + t2 = _this.$this; + t2._evaluate0$_activeModules.$indexSet(0, url, null); + if (!(t2._nodeImporter != null && J.toString$0$(url) === "stdin")) + t2._evaluate0$_loadedUrls.add$1(0, url); + } + t2 = _this.$this; + module = t2._evaluate0$_addExceptionTrace$1(new A._EvaluateVisitor_run__closure1(t2, _this.importer, t1)); + return new A._Record_2_loadedUrls_stylesheet(t2._evaluate0$_loadedUrls, t2._evaluate0$_combineCss$1(module)); + }, + $signature: 423 + }; + A._EvaluateVisitor_run__closure1.prototype = { + call$0() { + return this.$this._evaluate0$_execute$2(this.importer, this.node); + }, + $signature: 424 + }; + A._EvaluateVisitor__loadModule_closure3.prototype = { + call$0() { + return this.callback.call$2(this._box_1.builtInModule, false); + }, + $signature: 0 + }; + A._EvaluateVisitor__loadModule_closure4.prototype = { + call$0() { + var canonicalUrl, oldInDependency, t4, message, _this = this, t1 = {}, stylesheet = null, importer = null, + t2 = _this.$this, + t3 = _this.nodeWithSpan, + _1_0 = t2._evaluate0$_loadStylesheet$3$baseUrl(_this.url.toString$0(0), t3.get$span(t3), _this.baseUrl); + stylesheet = _1_0._0; + importer = _1_0._1; + canonicalUrl = stylesheet.span.file.url; + if (canonicalUrl != null) { + t4 = t2._evaluate0$_activeModules; + if (t4.containsKey$1(canonicalUrl)) { + if (_this.namesInErrors) { + t1 = canonicalUrl; + t3 = $.$get$context(); + t1.toString; + message = "Module loop: " + t3.prettyUri$1(t1) + " is already being loaded."; + } else + message = string$.Modulel; + t1 = A.NullableExtension_andThen0(t4.$index(0, canonicalUrl), new A._EvaluateVisitor__loadModule__closure3(t2, message)); + throw A.wrapException(t1 == null ? t2._evaluate0$_exception$1(message) : t1); + } else + t4.$indexSet(0, canonicalUrl, t3); + } + t4 = t2._evaluate0$_modules.containsKey$1(canonicalUrl); + oldInDependency = t2._evaluate0$_inDependency; + t2._evaluate0$_inDependency = _1_0._2; + t1.module = null; + try { + t1.module = t2._evaluate0$_execute$5$configuration$namesInErrors$nodeWithSpan(importer, stylesheet, _this.configuration, _this.namesInErrors, t3); + } finally { + t2._evaluate0$_activeModules.remove$1(0, canonicalUrl); + t2._evaluate0$_inDependency = oldInDependency; + } + t2._evaluate0$_addExceptionSpan$3$addStackFrame(t3, new A._EvaluateVisitor__loadModule__closure4(t1, _this.callback, !t4), false); + }, + $signature: 1 + }; + A._EvaluateVisitor__loadModule__closure3.prototype = { + call$1(previousLoad) { + return this.$this._evaluate0$_multiSpanException$3(this.message, "new load", A.LinkedHashMap_LinkedHashMap$_literal([previousLoad.get$span(previousLoad), "original load"], type$.FileSpan, type$.String)); + }, + $signature: 79 + }; + A._EvaluateVisitor__loadModule__closure4.prototype = { + call$0() { + return this.callback.call$2(this._box_0.module, this.firstLoad); + }, + $signature: 0 + }; + A._EvaluateVisitor__execute_closure1.prototype = { + call$0() { + var t3, t4, t5, t6, _this = this, + t1 = _this.$this, + oldImporter = t1._evaluate0$_importer, + oldStylesheet = t1._evaluate0$__stylesheet, + oldRoot = t1._evaluate0$__root, + oldPreModuleComments = t1._evaluate0$_preModuleComments, + oldParent = t1._evaluate0$__parent, + oldEndOfImports = t1._evaluate0$__endOfImports, + oldOutOfOrderImports = t1._evaluate0$_outOfOrderImports, + oldExtensionStore = t1._evaluate0$__extensionStore, + t2 = t1._evaluate0$_atRootExcludingStyleRule, + oldStyleRule = t2 ? null : t1._evaluate0$_styleRuleIgnoringAtRoot, + oldMediaQueries = t1._evaluate0$_mediaQueries, + oldDeclarationName = t1._evaluate0$_declarationName, + oldInUnknownAtRule = t1._evaluate0$_inUnknownAtRule, + oldInKeyframes = t1._evaluate0$_inKeyframes, + oldConfiguration = t1._evaluate0$_configuration; + t1._evaluate0$_importer = _this.importer; + t3 = t1._evaluate0$__stylesheet = _this.stylesheet; + t4 = t3.span; + t5 = t1._evaluate0$__parent = t1._evaluate0$__root = A.ModifiableCssStylesheet$0(t4); + t1._evaluate0$__endOfImports = 0; + t1._evaluate0$_outOfOrderImports = null; + t1._evaluate0$__extensionStore = _this.extensionStore; + t1._evaluate0$_declarationName = t1._evaluate0$_mediaQueries = t1._evaluate0$_styleRuleIgnoringAtRoot = null; + t1._evaluate0$_inKeyframes = t1._evaluate0$_atRootExcludingStyleRule = t1._evaluate0$_inUnknownAtRule = false; + t6 = _this.configuration; + if (t6 != null) + t1._evaluate0$_configuration = t6; + t1.visitStylesheet$1(t3); + t3 = t1._evaluate0$_outOfOrderImports == null ? t5 : new A.CssStylesheet0(new A.UnmodifiableListView(t1._evaluate0$_addOutOfOrderImports$0(), type$.UnmodifiableListView_CssNode_2), t4); + _this.css._value = t3; + _this.preModuleComments._value = t1._evaluate0$_preModuleComments; + t1._evaluate0$_importer = oldImporter; + t1._evaluate0$__stylesheet = oldStylesheet; + t1._evaluate0$__root = oldRoot; + t1._evaluate0$_preModuleComments = oldPreModuleComments; + t1._evaluate0$__parent = oldParent; + t1._evaluate0$__endOfImports = oldEndOfImports; + t1._evaluate0$_outOfOrderImports = oldOutOfOrderImports; + t1._evaluate0$__extensionStore = oldExtensionStore; + t1._evaluate0$_styleRuleIgnoringAtRoot = oldStyleRule; + t1._evaluate0$_mediaQueries = oldMediaQueries; + t1._evaluate0$_declarationName = oldDeclarationName; + t1._evaluate0$_inUnknownAtRule = oldInUnknownAtRule; + t1._evaluate0$_atRootExcludingStyleRule = t2; + t1._evaluate0$_inKeyframes = oldInKeyframes; + t1._evaluate0$_configuration = oldConfiguration; + }, + $signature: 1 + }; + A._EvaluateVisitor__combineCss_closure3.prototype = { + call$1(module) { + return module.get$transitivelyContainsCss(); + }, + $signature: 138 + }; + A._EvaluateVisitor__combineCss_closure4.prototype = { + call$1(target) { + return !this.selectors.contains$1(0, target); + }, + $signature: 14 + }; + A._EvaluateVisitor__combineCss_visitModule1.prototype = { + call$1(module) { + var t1, t2, t3, t4, _i, upstream, _1_0, statements, index, _this = this; + if (!_this.seen.add$1(0, module)) + return; + if (_this.clone) + module = module.cloneCss$0(); + for (t1 = module.get$upstream(), t2 = t1.length, t3 = _this.css, t4 = _this.imports, _i = 0; _i < t1.length; t1.length === t2 || (0, A.throwConcurrentModificationError)(t1), ++_i) { + upstream = t1[_i]; + if (upstream.get$transitivelyContainsCss()) { + _1_0 = module.get$preModuleComments().$index(0, upstream); + if (_1_0 != null) + B.JSArray_methods.addAll$1(t3.length === 0 ? t4 : t3, _1_0); + _this.call$1(upstream); + } + } + _this.sorted.addFirst$1(module); + t1 = module.get$css(module); + statements = t1.get$children(t1); + index = _this.$this._evaluate0$_indexAfterImports$1(statements); + t1 = J.getInterceptor$ax(statements); + B.JSArray_methods.addAll$1(t4, t1.getRange$2(statements, 0, index)); + B.JSArray_methods.addAll$1(t3, t1.getRange$2(statements, index, t1.get$length(statements))); + }, + $signature: 425 + }; + A._EvaluateVisitor__extendModules_closure3.prototype = { + call$1(target) { + return !this.originalSelectors.contains$1(0, target); + }, + $signature: 14 + }; + A._EvaluateVisitor__extendModules_closure4.prototype = { + call$0() { + return A._setArrayType([], type$.JSArray_ExtensionStore_2); + }, + $signature: 199 + }; + A._EvaluateVisitor_visitAtRootRule_closure3.prototype = { + call$0() { + var t1, t2, t3, _i; + for (t1 = this.node.children, t2 = t1.length, t3 = this.$this, _i = 0; _i < t2; ++_i) + t1[_i].accept$1(t3); + }, + $signature: 1 + }; + A._EvaluateVisitor_visitAtRootRule_closure4.prototype = { + call$0() { + var t1, t2, t3, _i; + for (t1 = this.node.children, t2 = t1.length, t3 = this.$this, _i = 0; _i < t2; ++_i) + t1[_i].accept$1(t3); + }, + $signature: 0 + }; + A._EvaluateVisitor__scopeForAtRoot_closure11.prototype = { + call$1(callback) { + var t1 = this.$this, + t2 = t1._evaluate0$_assertInModule$2(t1._evaluate0$__parent, "__parent"); + t1._evaluate0$__parent = this.newParent; + t1._evaluate0$_environment.scope$1$2$when(callback, this.node.hasDeclarations, type$.void); + t1._evaluate0$__parent = t2; + }, + $signature: 32 + }; + A._EvaluateVisitor__scopeForAtRoot_closure12.prototype = { + call$1(callback) { + var t1 = this.$this, + oldAtRootExcludingStyleRule = t1._evaluate0$_atRootExcludingStyleRule; + t1._evaluate0$_atRootExcludingStyleRule = true; + this.innerScope.call$1(callback); + t1._evaluate0$_atRootExcludingStyleRule = oldAtRootExcludingStyleRule; + }, + $signature: 32 + }; + A._EvaluateVisitor__scopeForAtRoot_closure13.prototype = { + call$1(callback) { + return this.$this._evaluate0$_withMediaQueries$3(null, null, new A._EvaluateVisitor__scopeForAtRoot__closure1(this.innerScope, callback)); + }, + $signature: 32 + }; + A._EvaluateVisitor__scopeForAtRoot__closure1.prototype = { + call$0() { + return this.innerScope.call$1(this.callback); + }, + $signature: 1 + }; + A._EvaluateVisitor__scopeForAtRoot_closure14.prototype = { + call$1(callback) { + var t1 = this.$this, + wasInKeyframes = t1._evaluate0$_inKeyframes; + t1._evaluate0$_inKeyframes = false; + this.innerScope.call$1(callback); + t1._evaluate0$_inKeyframes = wasInKeyframes; + }, + $signature: 32 + }; + A._EvaluateVisitor__scopeForAtRoot_closure15.prototype = { + call$1($parent) { + return $parent instanceof A.ModifiableCssAtRule0; + }, + $signature: 198 + }; + A._EvaluateVisitor__scopeForAtRoot_closure16.prototype = { + call$1(callback) { + var t1 = this.$this, + wasInUnknownAtRule = t1._evaluate0$_inUnknownAtRule; + t1._evaluate0$_inUnknownAtRule = false; + this.innerScope.call$1(callback); + t1._evaluate0$_inUnknownAtRule = wasInUnknownAtRule; + }, + $signature: 32 + }; + A._EvaluateVisitor_visitContentRule_closure1.prototype = { + call$0() { + var t1, t2, t3, _i; + for (t1 = this.content.declaration.children, t2 = t1.length, t3 = this.$this, _i = 0; _i < t2; ++_i) + t1[_i].accept$1(t3); + return null; + }, + $signature: 1 + }; + A._EvaluateVisitor_visitDeclaration_closure1.prototype = { + call$0() { + var t1, t2, t3, _i; + for (t1 = this._box_0.children, t2 = t1.length, t3 = this.$this, _i = 0; _i < t2; ++_i) + t1[_i].accept$1(t3); + }, + $signature: 1 + }; + A._EvaluateVisitor_visitEachRule_closure5.prototype = { + call$1(value) { + var t1 = this.$this, + t2 = this.nodeWithSpan; + return t1._evaluate0$_environment.setLocalVariable$3(this._box_0.variable, t1._evaluate0$_withoutSlash$2(value, t2), t2); + }, + $signature: 65 + }; + A._EvaluateVisitor_visitEachRule_closure6.prototype = { + call$1(value) { + return this.$this._evaluate0$_setMultipleVariables$3(this._box_0.variables, value, this.nodeWithSpan); + }, + $signature: 65 + }; + A._EvaluateVisitor_visitEachRule_closure7.prototype = { + call$0() { + var _this = this, + t1 = _this.$this; + return t1._evaluate0$_handleReturn$2(_this.list.get$asList(), new A._EvaluateVisitor_visitEachRule__closure1(t1, _this.setVariables, _this.node)); + }, + $signature: 42 + }; + A._EvaluateVisitor_visitEachRule__closure1.prototype = { + call$1(element) { + var t1; + this.setVariables.call$1(element); + t1 = this.$this; + return t1._evaluate0$_handleReturn$2(this.node.children, new A._EvaluateVisitor_visitEachRule___closure1(t1)); + }, + $signature: 244 + }; + A._EvaluateVisitor_visitEachRule___closure1.prototype = { + call$1(child) { + return child.accept$1(this.$this); + }, + $signature: 103 + }; + A._EvaluateVisitor_visitAtRule_closure5.prototype = { + call$1(value) { + return this.$this._evaluate0$_interpolationToValue$3$trim$warnForColor(value, true, true); + }, + $signature: 428 + }; + A._EvaluateVisitor_visitAtRule_closure6.prototype = { + call$0() { + var t2, t3, _i, _this = this, + t1 = _this.$this, + styleRule = t1._evaluate0$_atRootExcludingStyleRule ? null : t1._evaluate0$_styleRuleIgnoringAtRoot; + if (styleRule == null || t1._evaluate0$_inKeyframes || J.$eq$(_this.name.value, "font-face")) + for (t2 = _this.children, t3 = t2.length, _i = 0; _i < t3; ++_i) + t2[_i].accept$1(t1); + else + t1._evaluate0$_withParent$2$3$scopeWhen(A.ModifiableCssStyleRule$0(styleRule._style_rule0$_selector, styleRule.span, styleRule.originalSelector), new A._EvaluateVisitor_visitAtRule__closure1(t1, _this.children), false, type$.ModifiableCssStyleRule_2, type$.Null); + }, + $signature: 1 + }; + A._EvaluateVisitor_visitAtRule__closure1.prototype = { + call$0() { + var t1, t2, t3, _i; + for (t1 = this.children, t2 = t1.length, t3 = this.$this, _i = 0; _i < t2; ++_i) + t1[_i].accept$1(t3); + }, + $signature: 1 + }; + A._EvaluateVisitor_visitAtRule_closure7.prototype = { + call$1(node) { + return node instanceof A.ModifiableCssStyleRule0; + }, + $signature: 8 + }; + A._EvaluateVisitor_visitForRule_closure9.prototype = { + call$0() { + return this.node.from.accept$1(this.$this).assertNumber$0(); + }, + $signature: 242 + }; + A._EvaluateVisitor_visitForRule_closure10.prototype = { + call$0() { + return this.node.to.accept$1(this.$this).assertNumber$0(); + }, + $signature: 242 + }; + A._EvaluateVisitor_visitForRule_closure11.prototype = { + call$0() { + return this.fromNumber.assertInt$0(); + }, + $signature: 10 + }; + A._EvaluateVisitor_visitForRule_closure12.prototype = { + call$0() { + var t1 = this.fromNumber; + return this.toNumber.coerce$2(t1.get$numeratorUnits(t1), t1.get$denominatorUnits(t1)).assertInt$0(); + }, + $signature: 10 + }; + A._EvaluateVisitor_visitForRule_closure13.prototype = { + call$0() { + var i, t3, t4, t5, t6, t7, t8, _0_0, _this = this, + t1 = _this.$this, + t2 = _this.node, + nodeWithSpan = t1._evaluate0$_expressionNode$1(t2.from); + for (i = _this.from, t3 = _this._box_0, t4 = _this.direction, t5 = t2.variable, t6 = _this.fromNumber, t2 = t2.children; i !== t3.to; i += t4) { + t7 = t1._evaluate0$_environment; + t8 = t6.get$numeratorUnits(t6); + t7.setLocalVariable$3(t5, A.SassNumber_SassNumber$withUnits0(i, t6.get$denominatorUnits(t6), t8), nodeWithSpan); + _0_0 = t1._evaluate0$_handleReturn$2(t2, new A._EvaluateVisitor_visitForRule__closure1(t1)); + if (_0_0 != null) + return _0_0; + } + return null; + }, + $signature: 42 + }; + A._EvaluateVisitor_visitForRule__closure1.prototype = { + call$1(child) { + return child.accept$1(this.$this); + }, + $signature: 103 + }; + A._EvaluateVisitor_visitForwardRule_closure3.prototype = { + call$2(module, firstLoad) { + if (firstLoad) + this.$this._evaluate0$_registerCommentsForModule$1(module); + this.$this._evaluate0$_environment.forwardModule$2(module, this.node); + }, + $signature: 102 + }; + A._EvaluateVisitor_visitForwardRule_closure4.prototype = { + call$2(module, firstLoad) { + if (firstLoad) + this.$this._evaluate0$_registerCommentsForModule$1(module); + this.$this._evaluate0$_environment.forwardModule$2(module, this.node); + }, + $signature: 102 + }; + A._EvaluateVisitor__registerCommentsForModule_closure1.prototype = { + call$0() { + return A._setArrayType([], type$.JSArray_CssComment_2); + }, + $signature: 190 + }; + A._EvaluateVisitor_visitIfRule_closure1.prototype = { + call$1(clause) { + var t1 = this.$this; + return t1._evaluate0$_environment.scope$1$3$semiGlobal$when(new A._EvaluateVisitor_visitIfRule__closure1(t1, clause), true, clause.hasDeclarations, type$.nullable_Value_2); + }, + $signature: 430 + }; + A._EvaluateVisitor_visitIfRule__closure1.prototype = { + call$0() { + var t1 = this.$this; + return t1._evaluate0$_handleReturn$2(this.clause.children, new A._EvaluateVisitor_visitIfRule___closure1(t1)); + }, + $signature: 42 + }; + A._EvaluateVisitor_visitIfRule___closure1.prototype = { + call$1(child) { + return child.accept$1(this.$this); + }, + $signature: 103 + }; + A._EvaluateVisitor__visitDynamicImport_closure1.prototype = { + call$0() { + var t1, t2, _0_0, stylesheet, importer, isDependency, url, t3, oldImporter, oldInDependency, loadsUserDefinedModules, children, t4, t5, t6, t7, t8, t9, t10, environment, module, visitor, _box_0 = {}; + _box_0.isDependency = _box_0.importer = _box_0.stylesheet = null; + t1 = this.$this; + t2 = this.$import; + _0_0 = t1._evaluate0$_loadStylesheet$3$forImport(t2.urlString, t2.span, true); + stylesheet = _box_0.stylesheet = _0_0._0; + importer = _0_0._1; + _box_0.importer = importer; + isDependency = _0_0._2; + _box_0.isDependency = isDependency; + url = stylesheet.span.file.url; + if (url != null) { + t3 = t1._evaluate0$_activeModules; + if (t3.containsKey$1(url)) { + t2 = A.NullableExtension_andThen0(t3.$index(0, url), new A._EvaluateVisitor__visitDynamicImport__closure7(t1)); + throw A.wrapException(t2 == null ? t1._evaluate0$_exception$1("This file is already being loaded.") : t2); + } + t3.$indexSet(0, url, t2); + } + t2 = stylesheet._stylesheet1$_uses; + t3 = type$.UnmodifiableListView_UseRule_2; + if (new A.UnmodifiableListView(t2, t3).get$length(0) === 0 && new A.UnmodifiableListView(stylesheet._stylesheet1$_forwards, type$.UnmodifiableListView_ForwardRule_2).get$length(0) === 0) { + oldImporter = t1._evaluate0$_importer; + t2 = t1._evaluate0$_assertInModule$2(t1._evaluate0$__stylesheet, "_stylesheet"); + oldInDependency = t1._evaluate0$_inDependency; + t1._evaluate0$_importer = importer; + t1._evaluate0$__stylesheet = stylesheet; + t1._evaluate0$_inDependency = isDependency; + t1.visitStylesheet$1(stylesheet); + t1._evaluate0$_importer = oldImporter; + t1._evaluate0$__stylesheet = t2; + t1._evaluate0$_inDependency = oldInDependency; + t1._evaluate0$_activeModules.remove$1(0, url); + return; + } + t2 = new A.UnmodifiableListView(t2, t3); + if (!t2.any$1(t2, new A._EvaluateVisitor__visitDynamicImport__closure8())) { + t2 = new A.UnmodifiableListView(stylesheet._stylesheet1$_forwards, type$.UnmodifiableListView_ForwardRule_2); + loadsUserDefinedModules = t2.any$1(t2, new A._EvaluateVisitor__visitDynamicImport__closure9()); + } else + loadsUserDefinedModules = true; + children = A._Cell$(); + t2 = t1._evaluate0$_environment; + t3 = type$.String; + t4 = type$.Module_Callable_2; + t5 = type$.AstNode_2; + t6 = A._setArrayType([], type$.JSArray_Module_Callable_2); + t7 = t2._environment0$_variables; + t7 = A._setArrayType(t7.slice(0), A._arrayInstanceType(t7)); + t8 = t2._environment0$_variableNodes; + t8 = A._setArrayType(t8.slice(0), A._arrayInstanceType(t8)); + t9 = t2._environment0$_functions; + t9 = A._setArrayType(t9.slice(0), A._arrayInstanceType(t9)); + t10 = t2._environment0$_mixins; + t10 = A._setArrayType(t10.slice(0), A._arrayInstanceType(t10)); + environment = A.Environment$_0(A.LinkedHashMap_LinkedHashMap$_empty(t3, t4), A.LinkedHashMap_LinkedHashMap$_empty(t3, t5), A.LinkedHashMap_LinkedHashMap$_empty(t4, t5), t2._environment0$_importedModules, null, null, t6, t7, t8, t9, t10, t2._environment0$_content); + t1._evaluate0$_withEnvironment$2(environment, new A._EvaluateVisitor__visitDynamicImport__closure10(_box_0, t1, loadsUserDefinedModules, environment, children)); + module = environment.toDummyModule$0(); + t1._evaluate0$_environment.importForwards$1(module); + if (loadsUserDefinedModules) { + if (module.transitivelyContainsCss) + t1._evaluate0$_combineCss$2$clone(module, module.transitivelyContainsExtensions).accept$1(t1); + visitor = new A._ImportedCssVisitor1(t1); + for (t2 = J.get$iterator$ax(children._readLocal$0()); t2.moveNext$0();) + t2.get$current(t2).accept$1(visitor); + } + t1._evaluate0$_activeModules.remove$1(0, url); + }, + $signature: 0 + }; + A._EvaluateVisitor__visitDynamicImport__closure7.prototype = { + call$1(previousLoad) { + return this.$this._evaluate0$_multiSpanException$3("This file is already being loaded.", "new load", A.LinkedHashMap_LinkedHashMap$_literal([previousLoad.get$span(previousLoad), "original load"], type$.FileSpan, type$.String)); + }, + $signature: 79 + }; + A._EvaluateVisitor__visitDynamicImport__closure8.prototype = { + call$1(rule) { + return rule.url.get$scheme() !== "sass"; + }, + $signature: 189 + }; + A._EvaluateVisitor__visitDynamicImport__closure9.prototype = { + call$1(rule) { + return rule.url.get$scheme() !== "sass"; + }, + $signature: 187 + }; + A._EvaluateVisitor__visitDynamicImport__closure10.prototype = { + call$0() { + var t7, t8, _this = this, + t1 = _this.$this, + oldImporter = t1._evaluate0$_importer, + t2 = t1._evaluate0$_assertInModule$2(t1._evaluate0$__stylesheet, "_stylesheet"), + t3 = t1._evaluate0$_assertInModule$2(t1._evaluate0$__root, "_root"), + t4 = t1._evaluate0$_assertInModule$2(t1._evaluate0$__parent, "__parent"), + t5 = t1._evaluate0$_assertInModule$2(t1._evaluate0$__endOfImports, "_endOfImports"), + oldOutOfOrderImports = t1._evaluate0$_outOfOrderImports, + oldConfiguration = t1._evaluate0$_configuration, + oldInDependency = t1._evaluate0$_inDependency, + t6 = _this._box_0; + t1._evaluate0$_importer = t6.importer; + t7 = t6.stylesheet; + t1._evaluate0$__stylesheet = t7; + t8 = _this.loadsUserDefinedModules; + if (t8) { + t7 = A.ModifiableCssStylesheet$0(t7.span); + t1._evaluate0$__root = t7; + t1._evaluate0$__parent = t1._evaluate0$_assertInModule$2(t7, "_root"); + t1._evaluate0$__endOfImports = 0; + t1._evaluate0$_outOfOrderImports = null; + } + t1._evaluate0$_inDependency = t6.isDependency; + t7 = new A.UnmodifiableListView(t6.stylesheet._stylesheet1$_forwards, type$.UnmodifiableListView_ForwardRule_2); + if (!t7.get$isEmpty(t7)) + t1._evaluate0$_configuration = _this.environment.toImplicitConfiguration$0(); + t1.visitStylesheet$1(t6.stylesheet); + t6 = t8 ? t1._evaluate0$_addOutOfOrderImports$0() : A._setArrayType([], type$.JSArray_ModifiableCssNode_2); + _this.children._value = t6; + t1._evaluate0$_importer = oldImporter; + t1._evaluate0$__stylesheet = t2; + if (t8) { + t1._evaluate0$__root = t3; + t1._evaluate0$__parent = t4; + t1._evaluate0$__endOfImports = t5; + t1._evaluate0$_outOfOrderImports = oldOutOfOrderImports; + } + t1._evaluate0$_configuration = oldConfiguration; + t1._evaluate0$_inDependency = oldInDependency; + }, + $signature: 1 + }; + A._EvaluateVisitor__applyMixin_closure3.prototype = { + call$0() { + var _this = this, + t1 = _this.$this; + t1._evaluate0$_environment.asMixin$1(new A._EvaluateVisitor__applyMixin__closure4(t1, _this.$arguments, _this.mixin, _this.nodeWithSpanWithoutContent)); + }, + $signature: 0 + }; + A._EvaluateVisitor__applyMixin__closure4.prototype = { + call$0() { + var _this = this; + _this.$this._evaluate0$_runBuiltInCallable$3(_this.$arguments, _this.mixin, _this.nodeWithSpanWithoutContent); + }, + $signature: 0 + }; + A._EvaluateVisitor__applyMixin_closure4.prototype = { + call$0() { + var _this = this, + t1 = _this.$this; + t1._evaluate0$_environment.withContent$2(_this.contentCallable, new A._EvaluateVisitor__applyMixin__closure3(t1, _this.mixin, _this.nodeWithSpanWithoutContent)); + }, + $signature: 1 + }; + A._EvaluateVisitor__applyMixin__closure3.prototype = { + call$0() { + var t1 = this.$this; + t1._evaluate0$_environment.asMixin$1(new A._EvaluateVisitor__applyMixin___closure1(t1, this.mixin, this.nodeWithSpanWithoutContent)); + }, + $signature: 0 + }; + A._EvaluateVisitor__applyMixin___closure1.prototype = { + call$0() { + var t1, t2, t3, t4, _i; + for (t1 = this.mixin.declaration.children, t2 = t1.length, t3 = this.$this, t4 = this.nodeWithSpanWithoutContent, _i = 0; _i < t2; ++_i) + t3._evaluate0$_addErrorSpan$2(t4, new A._EvaluateVisitor__applyMixin____closure1(t3, t1[_i])); + }, + $signature: 0 + }; + A._EvaluateVisitor__applyMixin____closure1.prototype = { + call$0() { + return this.statement.accept$1(this.$this); + }, + $signature: 42 + }; + A._EvaluateVisitor_visitIncludeRule_closure5.prototype = { + call$0() { + var t1 = this.node; + return this.$this._evaluate0$_environment.getMixin$2$namespace(t1.name, t1.namespace); + }, + $signature: 100 + }; + A._EvaluateVisitor_visitIncludeRule_closure6.prototype = { + call$1($content) { + var t1 = this.$this; + return new A.UserDefinedCallable0($content, t1._evaluate0$_environment.closure$0(), t1._evaluate0$_inDependency, type$.UserDefinedCallable_Environment_2); + }, + $signature: 431 + }; + A._EvaluateVisitor_visitIncludeRule_closure7.prototype = { + call$0() { + return this.node.get$spanWithoutContent(); + }, + $signature: 25 + }; + A._EvaluateVisitor_visitMediaRule_closure5.prototype = { + call$1(mediaQueries) { + return this.$this._evaluate0$_mergeMediaQueries$2(mediaQueries, this.queries); + }, + $signature: 93 + }; + A._EvaluateVisitor_visitMediaRule_closure6.prototype = { + call$0() { + var _this = this, + t1 = _this.$this, + t2 = _this.mergedQueries; + if (t2 == null) + t2 = _this.queries; + t1._evaluate0$_withMediaQueries$3(t2, _this.mergedSources, new A._EvaluateVisitor_visitMediaRule__closure1(t1, _this.node)); + }, + $signature: 1 + }; + A._EvaluateVisitor_visitMediaRule__closure1.prototype = { + call$0() { + var t2, t3, _i, + t1 = this.$this, + _0_0 = t1._evaluate0$_atRootExcludingStyleRule ? null : t1._evaluate0$_styleRuleIgnoringAtRoot; + if (_0_0 != null) + t1._evaluate0$_withParent$2$3$scopeWhen(A.ModifiableCssStyleRule$0(_0_0._style_rule0$_selector, _0_0.span, _0_0.originalSelector), new A._EvaluateVisitor_visitMediaRule___closure1(t1, this.node), false, type$.ModifiableCssStyleRule_2, type$.Null); + else + for (t2 = this.node.children, t3 = t2.length, _i = 0; _i < t3; ++_i) + t2[_i].accept$1(t1); + }, + $signature: 1 + }; + A._EvaluateVisitor_visitMediaRule___closure1.prototype = { + call$0() { + var t1, t2, t3, _i; + for (t1 = this.node.children, t2 = t1.length, t3 = this.$this, _i = 0; _i < t2; ++_i) + t1[_i].accept$1(t3); + }, + $signature: 1 + }; + A._EvaluateVisitor_visitMediaRule_closure7.prototype = { + call$1(node) { + var t1; + if (!(node instanceof A.ModifiableCssStyleRule0)) { + t1 = this.mergedSources; + t1 = t1.get$isNotEmpty(t1) && node instanceof A.ModifiableCssMediaRule0 && B.JSArray_methods.every$1(node.queries, t1.get$contains(t1)); + } else + t1 = true; + return t1; + }, + $signature: 8 + }; + A._EvaluateVisitor_visitStyleRule_closure9.prototype = { + call$0() { + var t1, t2, t3, _i; + for (t1 = this.node.children, t2 = t1.length, t3 = this.$this, _i = 0; _i < t2; ++_i) + t1[_i].accept$1(t3); + }, + $signature: 1 + }; + A._EvaluateVisitor_visitStyleRule_closure10.prototype = { + call$1(node) { + return node instanceof A.ModifiableCssStyleRule0; + }, + $signature: 8 + }; + A._EvaluateVisitor_visitStyleRule_closure11.prototype = { + call$0() { + var t1 = this.$this; + t1._evaluate0$_withStyleRule$2(this.rule, new A._EvaluateVisitor_visitStyleRule__closure1(t1, this.node)); + }, + $signature: 1 + }; + A._EvaluateVisitor_visitStyleRule__closure1.prototype = { + call$0() { + var t1, t2, t3, _i; + for (t1 = this.node.children, t2 = t1.length, t3 = this.$this, _i = 0; _i < t2; ++_i) + t1[_i].accept$1(t3); + }, + $signature: 1 + }; + A._EvaluateVisitor_visitStyleRule_closure12.prototype = { + call$1(node) { + return node instanceof A.ModifiableCssStyleRule0; + }, + $signature: 8 + }; + A._EvaluateVisitor_visitStyleRule_closure13.prototype = { + call$1(child) { + return child instanceof A.ModifiableCssComment0; + }, + $signature: 130 + }; + A._EvaluateVisitor_visitSupportsRule_closure3.prototype = { + call$0() { + var t2, t3, _i, + t1 = this.$this, + _0_0 = t1._evaluate0$_atRootExcludingStyleRule ? null : t1._evaluate0$_styleRuleIgnoringAtRoot; + if (_0_0 != null) + t1._evaluate0$_withParent$2$2(A.ModifiableCssStyleRule$0(_0_0._style_rule0$_selector, _0_0.span, _0_0.originalSelector), new A._EvaluateVisitor_visitSupportsRule__closure1(t1, this.node), type$.ModifiableCssStyleRule_2, type$.Null); + else + for (t2 = this.node.children, t3 = t2.length, _i = 0; _i < t3; ++_i) + t2[_i].accept$1(t1); + }, + $signature: 1 + }; + A._EvaluateVisitor_visitSupportsRule__closure1.prototype = { + call$0() { + var t1, t2, t3, _i; + for (t1 = this.node.children, t2 = t1.length, t3 = this.$this, _i = 0; _i < t2; ++_i) + t1[_i].accept$1(t3); + }, + $signature: 1 + }; + A._EvaluateVisitor_visitSupportsRule_closure4.prototype = { + call$1(node) { + return node instanceof A.ModifiableCssStyleRule0; + }, + $signature: 8 + }; + A._EvaluateVisitor__visitSupportsCondition_closure1.prototype = { + call$0() { + var t4, + t1 = this.$this, + t2 = this._box_0, + t3 = t2.declaration.name; + t3 = t1._evaluate0$_serialize$3$quote(t3.accept$1(t1), t3, true); + t4 = t2.declaration.get$isCustomProperty() ? "" : " "; + t2 = t2.declaration.value; + return "(" + t3 + ":" + t4 + t1._evaluate0$_serialize$3$quote(t2.accept$1(t1), t2, true) + ")"; + }, + $signature: 27 + }; + A._EvaluateVisitor_visitVariableDeclaration_closure5.prototype = { + call$0() { + var t1 = this.$this._evaluate0$_environment, + t2 = this._box_0.override; + t1.setVariable$4$global(this.node.name, t2.value, t2.assignmentNode, true); + }, + $signature: 1 + }; + A._EvaluateVisitor_visitVariableDeclaration_closure6.prototype = { + call$0() { + var t1 = this.node; + return this.$this._evaluate0$_environment.getVariable$2$namespace(t1.name, t1.namespace); + }, + $signature: 42 + }; + A._EvaluateVisitor_visitVariableDeclaration_closure7.prototype = { + call$0() { + var t1 = this.$this, + t2 = this.node; + t1._evaluate0$_environment.setVariable$5$global$namespace(t2.name, this.value, t1._evaluate0$_expressionNode$1(t2.expression), t2.isGlobal, t2.namespace); + }, + $signature: 1 + }; + A._EvaluateVisitor_visitUseRule_closure1.prototype = { + call$2(module, firstLoad) { + var t1, t2, t3, _0_0, t4, t5, span; + if (firstLoad) + this.$this._evaluate0$_registerCommentsForModule$1(module); + t1 = this.$this._evaluate0$_environment; + t2 = this.node; + t3 = t2.namespace; + if (t3 == null) { + t1._environment0$_globalModules.$indexSet(0, module, t2); + t1._environment0$_allModules.push(module); + _0_0 = A.IterableExtension_firstWhereOrNull(J.get$keys$z(B.JSArray_methods.get$first(t1._environment0$_variables)), module.get$variables().get$containsKey()); + if (_0_0 != null) + A.throwExpression(A.SassScriptException$0(string$.This_ma + _0_0 + '".', null)); + } else { + t4 = t1._environment0$_modules; + if (t4.containsKey$1(t3)) { + t5 = t1._environment0$_namespaceNodes.$index(0, t3); + span = t5 == null ? null : t5.span; + t5 = A.LinkedHashMap_LinkedHashMap$_empty(type$.FileSpan, type$.String); + if (span != null) + t5.$indexSet(0, span, "original @use"); + A.throwExpression(A.MultiSpanSassScriptException$0(string$.There_ + t3 + '".', "new @use", t5)); + } + t4.$indexSet(0, t3, module); + t1._environment0$_namespaceNodes.$indexSet(0, t3, t2); + t1._environment0$_allModules.push(module); + } + }, + $signature: 102 + }; + A._EvaluateVisitor_visitWarnRule_closure1.prototype = { + call$0() { + return this.node.expression.accept$1(this.$this); + }, + $signature: 47 + }; + A._EvaluateVisitor_visitWhileRule_closure1.prototype = { + call$0() { + var t1, t2, t3, _0_0; + for (t1 = this.node, t2 = t1.condition, t3 = this.$this, t1 = t1.children; t2.accept$1(t3).get$isTruthy();) { + _0_0 = t3._evaluate0$_handleReturn$2(t1, new A._EvaluateVisitor_visitWhileRule__closure1(t3)); + if (_0_0 != null) + return _0_0; + } + return null; + }, + $signature: 42 + }; + A._EvaluateVisitor_visitWhileRule__closure1.prototype = { + call$1(child) { + return child.accept$1(this.$this); + }, + $signature: 103 + }; + A._EvaluateVisitor_visitBinaryOperationExpression_closure1.prototype = { + call$0() { + var t1 = this.node, + t2 = this.$this, + left = t1.left.accept$1(t2); + switch (t1.operator) { + case B.BinaryOperator_2jN0: + t1 = t1.right.accept$1(t2); + t1 = new A.SassString0(A.serializeValue0(left, false, true) + "=" + A.serializeValue0(t1, false, true), false); + break; + case B.BinaryOperator_M6L0: + t1 = left.get$isTruthy() ? left : t1.right.accept$1(t2); + break; + case B.BinaryOperator_SNp0: + t1 = left.get$isTruthy() ? t1.right.accept$1(t2) : left; + break; + case B.BinaryOperator_ql50: + t1 = left.$eq(0, t1.right.accept$1(t2)) ? B.SassBoolean_true0 : B.SassBoolean_false0; + break; + case B.BinaryOperator_ViB0: + t1 = !left.$eq(0, t1.right.accept$1(t2)) ? B.SassBoolean_true0 : B.SassBoolean_false0; + break; + case B.BinaryOperator_cIH0: + t1 = left.greaterThan$1(t1.right.accept$1(t2)); + break; + case B.BinaryOperator_7Tg0: + t1 = left.greaterThanOrEquals$1(t1.right.accept$1(t2)); + break; + case B.BinaryOperator_U8c0: + t1 = left.lessThan$1(t1.right.accept$1(t2)); + break; + case B.BinaryOperator_kpg0: + t1 = left.lessThanOrEquals$1(t1.right.accept$1(t2)); + break; + case B.BinaryOperator_anB0: + t1 = left.plus$1(t1.right.accept$1(t2)); + break; + case B.BinaryOperator_olz0: + t1 = left.minus$1(t1.right.accept$1(t2)); + break; + case B.BinaryOperator_qN20: + t1 = left.times$1(t1.right.accept$1(t2)); + break; + case B.BinaryOperator_t8B0: + t1 = t2._evaluate0$_slash$3(left, t1.right.accept$1(t2), t1); + break; + case B.BinaryOperator_OTG0: + t1 = left.modulo$1(t1.right.accept$1(t2)); + break; + default: + t1 = null; + } + return t1; + }, + $signature: 47 + }; + A._EvaluateVisitor__slash_recommendation1.prototype = { + call$1(expression) { + var t1; + $label0$0: { + if (expression instanceof A.BinaryOperationExpression0 && B.BinaryOperator_t8B0 === expression.operator) { + t1 = "math.div(" + A.S(this.call$1(expression.left)) + ", " + A.S(this.call$1(expression.right)) + ")"; + break $label0$0; + } + if (expression instanceof A.ParenthesizedExpression0) { + t1 = expression.expression.toString$0(0); + break $label0$0; + } + t1 = expression.toString$0(0); + break $label0$0; + } + return t1; + }, + $signature: 131 + }; + A._EvaluateVisitor_visitVariableExpression_closure1.prototype = { + call$0() { + var t1 = this.node; + return this.$this._evaluate0$_environment.getVariable$2$namespace(t1.name, t1.namespace); + }, + $signature: 42 + }; + A._EvaluateVisitor_visitUnaryOperationExpression_closure1.prototype = { + call$0() { + var t1, _this = this; + switch (_this.node.operator) { + case B.UnaryOperator_gg40: + t1 = _this.operand.unaryPlus$0(); + break; + case B.UnaryOperator_TLI0: + t1 = _this.operand.unaryMinus$0(); + break; + case B.UnaryOperator_Ix10: + t1 = new A.SassString0("/" + A.serializeValue0(_this.operand, false, true), false); + break; + case B.UnaryOperator_not_not_not0: + t1 = _this.operand.unaryNot$0(); + break; + default: + t1 = null; + } + return t1; + }, + $signature: 47 + }; + A._EvaluateVisitor_visitListExpression_closure1.prototype = { + call$1(expression) { + return expression.accept$1(this.$this); + }, + $signature: 432 + }; + A._EvaluateVisitor_visitFunctionExpression_closure5.prototype = { + call$0() { + var t1 = this.$this._evaluate0$_environment, + t2 = this.node; + return t1.getFunction$2$namespace(A.stringReplaceAllUnchecked(t2.originalName, "_", "-"), t2.namespace); + }, + $signature: 100 + }; + A._EvaluateVisitor_visitFunctionExpression_closure6.prototype = { + call$1(argument) { + return argument.accept$1(new A._IsCalculationSafeVisitor0()); + }, + $signature: 133 + }; + A._EvaluateVisitor_visitFunctionExpression_closure7.prototype = { + call$0() { + var t1 = this.node; + return this.$this._evaluate0$_runFunctionCallable$3(t1.$arguments, this._box_0.$function, t1); + }, + $signature: 47 + }; + A._EvaluateVisitor__checkCalculationArguments_check1.prototype = { + call$1(maxArgs) { + var t1 = this.node, + t2 = t1.$arguments.positional.length; + if (t2 === 0) + throw A.wrapException(this.$this._evaluate0$_exception$2("Missing argument.", t1.span)); + else if (maxArgs != null && t2 > maxArgs) + throw A.wrapException(this.$this._evaluate0$_exception$2("Only " + A.S(maxArgs) + " " + A.pluralize0("argument", maxArgs, null) + " allowed, but " + t2 + " " + A.pluralize0("was", t2, "were") + " passed.", t1.span)); + }, + call$0() { + return this.call$1(null); + }, + $signature: 99 + }; + A._EvaluateVisitor__visitCalculationExpression_closure1.prototype = { + call$0() { + var _this = this, + t1 = _this.$this, + t2 = _this._box_0, + t3 = _this.inLegacySassFunction; + return A.SassCalculation_operateInternal0(t1._evaluate0$_binaryOperatorToCalculationOperator$2(t2.operator, _this.node), t1._evaluate0$_visitCalculationExpression$2$inLegacySassFunction(t2.left, t3), t1._evaluate0$_visitCalculationExpression$2$inLegacySassFunction(t2.right, t3), t3, !t1._evaluate0$_inSupportsDeclaration); + }, + $signature: 82 + }; + A._EvaluateVisitor_visitInterpolatedFunctionExpression_closure1.prototype = { + call$0() { + var t1 = this.node; + return this.$this._evaluate0$_runFunctionCallable$3(t1.$arguments, this.$function, t1); + }, + $signature: 47 + }; + A._EvaluateVisitor__runUserDefinedCallable_closure1.prototype = { + call$0() { + var _this = this, + t1 = _this.$this, + t2 = _this.callable; + return t1._evaluate0$_withEnvironment$2(t2.environment.closure$0(), new A._EvaluateVisitor__runUserDefinedCallable__closure1(t1, _this.evaluated, t2, _this.nodeWithSpan, _this.run, _this.V)); + }, + $signature() { + return this.V._eval$1("0()"); + } + }; + A._EvaluateVisitor__runUserDefinedCallable__closure1.prototype = { + call$0() { + var _this = this, + t1 = _this.$this, + t2 = _this.V; + return t1._evaluate0$_environment.scope$1$1(new A._EvaluateVisitor__runUserDefinedCallable___closure1(t1, _this.evaluated, _this.callable, _this.nodeWithSpan, _this.run, t2), t2); + }, + $signature() { + return this.V._eval$1("0()"); + } + }; + A._EvaluateVisitor__runUserDefinedCallable___closure1.prototype = { + call$0() { + var declaredArguments, t5, minLength, i, argument, t6, t7, value, t8, restArgument, rest, argumentList, result, argumentWord, _this = this, + t1 = _this.$this, + t2 = _this.evaluated._values, + t3 = _this.callable.declaration.$arguments, + t4 = _this.nodeWithSpan; + t1._evaluate0$_verifyArguments$4(J.get$length$asx(t2[2]), t2[0], t3, t4); + declaredArguments = t3.$arguments; + t5 = declaredArguments.length; + minLength = Math.min(J.get$length$asx(t2[2]), t5); + for (i = 0; i < minLength; ++i) + t1._evaluate0$_environment.setLocalVariable$3(declaredArguments[i].name, J.$index$asx(t2[2], i), J.$index$asx(t2[3], i)); + for (i = J.get$length$asx(t2[2]); i < t5; ++i) { + argument = declaredArguments[i]; + t6 = t2[0]; + t7 = argument.name; + value = J.remove$1$z(t6, t7); + if (value == null) { + t6 = argument.defaultValue; + value = t1._evaluate0$_withoutSlash$2(t6.accept$1(t1), t1._evaluate0$_expressionNode$1(t6)); + } + t6 = t1._evaluate0$_environment; + t8 = J.$index$asx(t2[1], t7); + if (t8 == null) { + t8 = argument.defaultValue; + t8.toString; + t8 = t1._evaluate0$_expressionNode$1(t8); + } + t6.setLocalVariable$3(t7, value, t8); + } + restArgument = t3.restArgument; + if (restArgument != null) { + rest = J.get$length$asx(t2[2]) > t5 ? J.sublist$1$ax(t2[2], t5) : B.List_empty19; + t5 = t2[0]; + t6 = t2[4]; + argumentList = A.SassArgumentList$0(rest, t5, t6 === B.ListSeparator_undecided_null_undecided0 ? B.ListSeparator_rXA0 : t6); + t1._evaluate0$_environment.setLocalVariable$3(restArgument, argumentList, t4); + } else + argumentList = null; + result = _this.run.call$0(); + if (argumentList == null) + return result; + t5 = t2[0].__js_helper$_length; + if (t5 === 0) + return result; + if (argumentList._argument_list$_wereKeywordsAccessed) + return result; + argumentWord = A.pluralize0("argument", t5, null); + t2 = t2[0]; + t5 = A.instanceType(t2)._eval$1("LinkedHashMapKeyIterable<1>"); + throw A.wrapException(A.MultiSpanSassRuntimeException$0("No " + argumentWord + " named " + A.toSentence0(A.MappedIterable_MappedIterable(new A.LinkedHashMapKeyIterable(t2, t5), new A._EvaluateVisitor__runUserDefinedCallable____closure1(), t5._eval$1("Iterable.E"), type$.Object), "or") + ".", t4.get$span(t4), "invocation", A.LinkedHashMap_LinkedHashMap$_literal([t3.get$spanWithName(), "declaration"], type$.FileSpan, type$.String), t1._evaluate0$_stackTrace$1(t4.get$span(t4)), null)); + }, + $signature() { + return this.V._eval$1("0()"); + } + }; + A._EvaluateVisitor__runUserDefinedCallable____closure1.prototype = { + call$1($name) { + return "$" + $name; + }, + $signature: 5 + }; + A._EvaluateVisitor__runFunctionCallable_closure1.prototype = { + call$0() { + var t1, t2, t3, t4, _i, $returnValue; + for (t1 = this.callable.declaration, t2 = t1.children, t3 = t2.length, t4 = this.$this, _i = 0; _i < t3; ++_i) { + $returnValue = t2[_i].accept$1(t4); + if ($returnValue instanceof A.Value0) + return $returnValue; + } + throw A.wrapException(t4._evaluate0$_exception$2("Function finished without @return.", t1.span)); + }, + $signature: 47 + }; + A._EvaluateVisitor__runBuiltInCallable_closure5.prototype = { + call$0() { + return this._box_0.overload.verify$2(J.get$length$asx(this.evaluated._values[2]), this.namedSet); + }, + $signature: 0 + }; + A._EvaluateVisitor__runBuiltInCallable_closure6.prototype = { + call$0() { + return this._box_0.callback.call$1(this.evaluated._values[2]); + }, + $signature: 47 + }; + A._EvaluateVisitor__runBuiltInCallable_closure7.prototype = { + call$1($name) { + return "$" + $name; + }, + $signature: 5 + }; + A._EvaluateVisitor__evaluateArguments_closure7.prototype = { + call$1(value) { + return value; + }, + $signature: 41 + }; + A._EvaluateVisitor__evaluateArguments_closure8.prototype = { + call$1(value) { + return this.$this._evaluate0$_withoutSlash$2(value, this.restNodeForSpan); + }, + $signature: 41 + }; + A._EvaluateVisitor__evaluateArguments_closure9.prototype = { + call$2(key, value) { + var _this = this, + t1 = _this.restNodeForSpan; + _this.named.$indexSet(0, key, _this.$this._evaluate0$_withoutSlash$2(value, t1)); + _this.namedNodes.$indexSet(0, key, t1); + }, + $signature: 86 + }; + A._EvaluateVisitor__evaluateArguments_closure10.prototype = { + call$1(value) { + return value; + }, + $signature: 41 + }; + A._EvaluateVisitor__evaluateMacroArguments_closure7.prototype = { + call$1(value) { + var t1 = this.restArgs; + return new A.ValueExpression0(value, t1.get$span(t1)); + }, + $signature: 60 + }; + A._EvaluateVisitor__evaluateMacroArguments_closure8.prototype = { + call$1(value) { + var t1 = this.restArgs; + return new A.ValueExpression0(this.$this._evaluate0$_withoutSlash$2(value, this.restNodeForSpan), t1.get$span(t1)); + }, + $signature: 60 + }; + A._EvaluateVisitor__evaluateMacroArguments_closure9.prototype = { + call$2(key, value) { + var _this = this, + t1 = _this.restArgs; + _this.named.$indexSet(0, key, new A.ValueExpression0(_this.$this._evaluate0$_withoutSlash$2(value, _this.restNodeForSpan), t1.get$span(t1))); + }, + $signature: 86 + }; + A._EvaluateVisitor__evaluateMacroArguments_closure10.prototype = { + call$1(value) { + var t1 = this.keywordRestArgs; + return new A.ValueExpression0(this.$this._evaluate0$_withoutSlash$2(value, this.keywordRestNodeForSpan), t1.get$span(t1)); + }, + $signature: 60 + }; + A._EvaluateVisitor__addRestMap_closure1.prototype = { + call$2(key, value) { + var t2, _this = this, + t1 = _this.$this; + if (key instanceof A.SassString0) + _this.values.$indexSet(0, key._string0$_text, _this.convert.call$1(t1._evaluate0$_withoutSlash$2(value, _this.expressionNode))); + else { + t2 = _this.nodeWithSpan; + throw A.wrapException(t1._evaluate0$_exception$2(string$.Variab_ + key.toString$0(0) + " is not a string in " + _this.map.toString$0(0) + ".", t2.get$span(t2))); + } + }, + $signature: 80 + }; + A._EvaluateVisitor__verifyArguments_closure1.prototype = { + call$0() { + return this.$arguments.verify$2(this.positional, new A.MapKeySet(this.named, type$.MapKeySet_String)); + }, + $signature: 0 + }; + A._EvaluateVisitor_visitCssAtRule_closure3.prototype = { + call$0() { + var t1, t2, t3, t4; + for (t1 = this.node.children, t2 = t1.$ti, t1 = new A.ListIterator(t1, t1.get$length(0), t2._eval$1("ListIterator")), t3 = this.$this, t2 = t2._eval$1("ListBase.E"); t1.moveNext$0();) { + t4 = t1.__internal$_current; + (t4 == null ? t2._as(t4) : t4).accept$1(t3); + } + }, + $signature: 1 + }; + A._EvaluateVisitor_visitCssAtRule_closure4.prototype = { + call$1(node) { + return node instanceof A.ModifiableCssStyleRule0; + }, + $signature: 8 + }; + A._EvaluateVisitor_visitCssKeyframeBlock_closure3.prototype = { + call$0() { + var t1, t2, t3, t4; + for (t1 = this.node.children, t2 = t1.$ti, t1 = new A.ListIterator(t1, t1.get$length(0), t2._eval$1("ListIterator")), t3 = this.$this, t2 = t2._eval$1("ListBase.E"); t1.moveNext$0();) { + t4 = t1.__internal$_current; + (t4 == null ? t2._as(t4) : t4).accept$1(t3); + } + }, + $signature: 1 + }; + A._EvaluateVisitor_visitCssKeyframeBlock_closure4.prototype = { + call$1(node) { + return node instanceof A.ModifiableCssStyleRule0; + }, + $signature: 8 + }; + A._EvaluateVisitor_visitCssMediaRule_closure5.prototype = { + call$1(mediaQueries) { + return this.$this._evaluate0$_mergeMediaQueries$2(mediaQueries, this.node.queries); + }, + $signature: 93 + }; + A._EvaluateVisitor_visitCssMediaRule_closure6.prototype = { + call$0() { + var _this = this, + t1 = _this.$this, + t2 = _this.mergedQueries; + if (t2 == null) + t2 = _this.node.queries; + t1._evaluate0$_withMediaQueries$3(t2, _this.mergedSources, new A._EvaluateVisitor_visitCssMediaRule__closure1(t1, _this.node)); + }, + $signature: 1 + }; + A._EvaluateVisitor_visitCssMediaRule__closure1.prototype = { + call$0() { + var t2, t3, t4, + t1 = this.$this, + _0_0 = t1._evaluate0$_atRootExcludingStyleRule ? null : t1._evaluate0$_styleRuleIgnoringAtRoot; + if (_0_0 != null) + t1._evaluate0$_withParent$2$3$scopeWhen(A.ModifiableCssStyleRule$0(_0_0._style_rule0$_selector, _0_0.span, _0_0.originalSelector), new A._EvaluateVisitor_visitCssMediaRule___closure1(t1, this.node), false, type$.ModifiableCssStyleRule_2, type$.Null); + else + for (t2 = this.node.children, t3 = t2.$ti, t2 = new A.ListIterator(t2, t2.get$length(0), t3._eval$1("ListIterator")), t3 = t3._eval$1("ListBase.E"); t2.moveNext$0();) { + t4 = t2.__internal$_current; + (t4 == null ? t3._as(t4) : t4).accept$1(t1); + } + }, + $signature: 1 + }; + A._EvaluateVisitor_visitCssMediaRule___closure1.prototype = { + call$0() { + var t1, t2, t3, t4; + for (t1 = this.node.children, t2 = t1.$ti, t1 = new A.ListIterator(t1, t1.get$length(0), t2._eval$1("ListIterator")), t3 = this.$this, t2 = t2._eval$1("ListBase.E"); t1.moveNext$0();) { + t4 = t1.__internal$_current; + (t4 == null ? t2._as(t4) : t4).accept$1(t3); + } + }, + $signature: 1 + }; + A._EvaluateVisitor_visitCssMediaRule_closure7.prototype = { + call$1(node) { + var t1; + if (!(node instanceof A.ModifiableCssStyleRule0)) { + t1 = this.mergedSources; + t1 = t1.get$isNotEmpty(t1) && node instanceof A.ModifiableCssMediaRule0 && B.JSArray_methods.every$1(node.queries, t1.get$contains(t1)); + } else + t1 = true; + return t1; + }, + $signature: 8 + }; + A._EvaluateVisitor_visitCssStyleRule_closure3.prototype = { + call$0() { + var t1 = this.$this; + t1._evaluate0$_withStyleRule$2(this.rule, new A._EvaluateVisitor_visitCssStyleRule__closure1(t1, this.node)); + }, + $signature: 1 + }; + A._EvaluateVisitor_visitCssStyleRule__closure1.prototype = { + call$0() { + var t1, t2, t3, t4; + for (t1 = this.node.children, t2 = t1.$ti, t1 = new A.ListIterator(t1, t1.get$length(0), t2._eval$1("ListIterator")), t3 = this.$this, t2 = t2._eval$1("ListBase.E"); t1.moveNext$0();) { + t4 = t1.__internal$_current; + (t4 == null ? t2._as(t4) : t4).accept$1(t3); + } + }, + $signature: 1 + }; + A._EvaluateVisitor_visitCssStyleRule_closure4.prototype = { + call$1(node) { + return node instanceof A.ModifiableCssStyleRule0; + }, + $signature: 8 + }; + A._EvaluateVisitor_visitCssSupportsRule_closure3.prototype = { + call$0() { + var t2, t3, t4, + t1 = this.$this, + _0_0 = t1._evaluate0$_atRootExcludingStyleRule ? null : t1._evaluate0$_styleRuleIgnoringAtRoot; + if (_0_0 != null) + t1._evaluate0$_withParent$2$2(A.ModifiableCssStyleRule$0(_0_0._style_rule0$_selector, _0_0.span, _0_0.originalSelector), new A._EvaluateVisitor_visitCssSupportsRule__closure1(t1, this.node), type$.ModifiableCssStyleRule_2, type$.Null); + else + for (t2 = this.node.children, t3 = t2.$ti, t2 = new A.ListIterator(t2, t2.get$length(0), t3._eval$1("ListIterator")), t3 = t3._eval$1("ListBase.E"); t2.moveNext$0();) { + t4 = t2.__internal$_current; + (t4 == null ? t3._as(t4) : t4).accept$1(t1); + } + }, + $signature: 1 + }; + A._EvaluateVisitor_visitCssSupportsRule__closure1.prototype = { + call$0() { + var t1, t2, t3, t4; + for (t1 = this.node.children, t2 = t1.$ti, t1 = new A.ListIterator(t1, t1.get$length(0), t2._eval$1("ListIterator")), t3 = this.$this, t2 = t2._eval$1("ListBase.E"); t1.moveNext$0();) { + t4 = t1.__internal$_current; + (t4 == null ? t2._as(t4) : t4).accept$1(t3); + } + }, + $signature: 1 + }; + A._EvaluateVisitor_visitCssSupportsRule_closure4.prototype = { + call$1(node) { + return node instanceof A.ModifiableCssStyleRule0; + }, + $signature: 8 + }; + A._EvaluateVisitor__performInterpolationHelper_closure1.prototype = { + call$1(targetLocations) { + return A.InterpolationMap$0(this.interpolation, targetLocations); + }, + $signature: 170 + }; + A._EvaluateVisitor__serialize_closure1.prototype = { + call$0() { + return A.serializeValue0(this.value, false, this.quote); + }, + $signature: 27 + }; + A._EvaluateVisitor__expressionNode_closure1.prototype = { + call$0() { + var t1 = this.expression; + return this.$this._evaluate0$_environment.getVariableNode$2$namespace(t1.name, t1.namespace); + }, + $signature: 169 + }; + A._EvaluateVisitor__withoutSlash_recommendation1.prototype = { + call$1(number) { + var t1, before, after, + _1_0 = number.asSlash; + $label0$0: { + if (type$.Record_2_nullable_Object_and_nullable_Object._is(_1_0)) { + t1 = type$.SassNumber_2; + before = t1._as(_1_0._0); + after = t1._as(_1_0._1); + t1 = "math.div(" + A.S(this.call$1(before)) + ", " + A.S(this.call$1(after)) + ")"; + break $label0$0; + } + t1 = A.serializeValue0(number, true, true); + break $label0$0; + } + return t1; + }, + $signature: 151 + }; + A._EvaluateVisitor__stackFrame_closure1.prototype = { + call$1(url) { + var t1 = this.$this._evaluate0$_importCache; + t1 = t1 == null ? null : t1.humanize$1(url); + return t1 == null ? url : t1; + }, + $signature: 44 + }; + A._ImportedCssVisitor1.prototype = { + visitCssAtRule$1(node) { + var t1 = node.isChildless ? null : new A._ImportedCssVisitor_visitCssAtRule_closure1(); + this._evaluate0$_visitor._evaluate0$_addChild$2$through(node, t1); + }, + visitCssComment$1(node) { + return this._evaluate0$_visitor._evaluate0$_addChild$1(node); + }, + visitCssDeclaration$1(node) { + }, + visitCssImport$1(node) { + var t2, + _s13_ = "_endOfImports", + t1 = this._evaluate0$_visitor; + if (t1._evaluate0$_assertInModule$2(t1._evaluate0$__parent, "__parent") !== t1._evaluate0$_assertInModule$2(t1._evaluate0$__root, "_root")) + t1._evaluate0$_addChild$1(node); + else if (t1._evaluate0$_assertInModule$2(t1._evaluate0$__endOfImports, _s13_) === J.get$length$asx(t1._evaluate0$_assertInModule$2(t1._evaluate0$__root, "_root").children._collection$_source)) { + t1._evaluate0$_addChild$1(node); + t1._evaluate0$__endOfImports = t1._evaluate0$_assertInModule$2(t1._evaluate0$__endOfImports, _s13_) + 1; + } else { + t2 = t1._evaluate0$_outOfOrderImports; + (t2 == null ? t1._evaluate0$_outOfOrderImports = A._setArrayType([], type$.JSArray_ModifiableCssImport_2) : t2).push(node); + } + }, + visitCssKeyframeBlock$1(node) { + }, + visitCssMediaRule$1(node) { + var t1 = this._evaluate0$_visitor, + mediaQueries = t1._evaluate0$_mediaQueries; + t1._evaluate0$_addChild$2$through(node, new A._ImportedCssVisitor_visitCssMediaRule_closure1(mediaQueries == null || t1._evaluate0$_mergeMediaQueries$2(mediaQueries, node.queries) != null)); + }, + visitCssStyleRule$1(node) { + return this._evaluate0$_visitor._evaluate0$_addChild$2$through(node, new A._ImportedCssVisitor_visitCssStyleRule_closure1()); + }, + visitCssStylesheet$1(node) { + var t1, t2, t3; + for (t1 = node.children, t2 = t1.$ti, t1 = new A.ListIterator(t1, t1.get$length(0), t2._eval$1("ListIterator")), t2 = t2._eval$1("ListBase.E"); t1.moveNext$0();) { + t3 = t1.__internal$_current; + (t3 == null ? t2._as(t3) : t3).accept$1(this); + } + }, + visitCssSupportsRule$1(node) { + return this._evaluate0$_visitor._evaluate0$_addChild$2$through(node, new A._ImportedCssVisitor_visitCssSupportsRule_closure1()); + } + }; + A._ImportedCssVisitor_visitCssAtRule_closure1.prototype = { + call$1(node) { + return node instanceof A.ModifiableCssStyleRule0; + }, + $signature: 8 + }; + A._ImportedCssVisitor_visitCssMediaRule_closure1.prototype = { + call$1(node) { + var t1; + if (!(node instanceof A.ModifiableCssStyleRule0)) + t1 = this.hasBeenMerged && node instanceof A.ModifiableCssMediaRule0; + else + t1 = true; + return t1; + }, + $signature: 8 + }; + A._ImportedCssVisitor_visitCssStyleRule_closure1.prototype = { + call$1(node) { + return node instanceof A.ModifiableCssStyleRule0; + }, + $signature: 8 + }; + A._ImportedCssVisitor_visitCssSupportsRule_closure1.prototype = { + call$1(node) { + return node instanceof A.ModifiableCssStyleRule0; + }, + $signature: 8 + }; + A._EvaluationContext1.prototype = { + get$currentCallableSpan() { + var _0_0 = this._evaluate0$_visitor._evaluate0$_callableNode; + if (_0_0 != null) + return _0_0.get$span(_0_0); + throw A.wrapException(A.StateError$(string$.No_Sasc)); + }, + warn$2(_, message, deprecation) { + var t1 = this._evaluate0$_visitor, + t2 = t1._evaluate0$_importSpan; + if (t2 == null) { + t2 = t1._evaluate0$_callableNode; + t2 = t2 == null ? null : t2.get$span(t2); + } + t1._evaluate0$_warn$3(message, t2 == null ? this._evaluate0$_defaultWarnNodeWithSpan.span : t2, deprecation); + }, + $isEvaluationContext0: 1 + }; + A.EveryCssVisitor0.prototype = { + visitCssAtRule$1(node) { + var t1 = node.children; + return t1.every$1(t1, new A.EveryCssVisitor_visitCssAtRule_closure0(this)); + }, + visitCssComment$1(node) { + return false; + }, + visitCssDeclaration$1(node) { + return false; + }, + visitCssImport$1(node) { + return false; + }, + visitCssKeyframeBlock$1(node) { + var t1 = node.children; + return t1.every$1(t1, new A.EveryCssVisitor_visitCssKeyframeBlock_closure0(this)); + }, + visitCssMediaRule$1(node) { + var t1 = node.children; + return t1.every$1(t1, new A.EveryCssVisitor_visitCssMediaRule_closure0(this)); + }, + visitCssStyleRule$1(node) { + var t1 = node.children; + return t1.every$1(t1, new A.EveryCssVisitor_visitCssStyleRule_closure0(this)); + }, + visitCssStylesheet$1(node) { + return J.every$1$ax(node.get$children(node), new A.EveryCssVisitor_visitCssStylesheet_closure0(this)); + }, + visitCssSupportsRule$1(node) { + var t1 = node.children; + return t1.every$1(t1, new A.EveryCssVisitor_visitCssSupportsRule_closure0(this)); + } + }; + A.EveryCssVisitor_visitCssAtRule_closure0.prototype = { + call$1(child) { + return child.accept$1(this.$this); + }, + $signature: 8 + }; + A.EveryCssVisitor_visitCssKeyframeBlock_closure0.prototype = { + call$1(child) { + return child.accept$1(this.$this); + }, + $signature: 8 + }; + A.EveryCssVisitor_visitCssMediaRule_closure0.prototype = { + call$1(child) { + return child.accept$1(this.$this); + }, + $signature: 8 + }; + A.EveryCssVisitor_visitCssStyleRule_closure0.prototype = { + call$1(child) { + return child.accept$1(this.$this); + }, + $signature: 8 + }; + A.EveryCssVisitor_visitCssStylesheet_closure0.prototype = { + call$1(child) { + return child.accept$1(this.$this); + }, + $signature: 8 + }; + A.EveryCssVisitor_visitCssSupportsRule_closure0.prototype = { + call$1(child) { + return child.accept$1(this.$this); + }, + $signature: 8 + }; + A._NodeException.prototype = {}; + A.exceptionClass_closure.prototype = { + call$0() { + var jsClass = type$.JSClass._as(new self.Function("", " return class Exception extends Error {\n constructor(dartException, message) {\n super(message);\n\n // Define this as non-enumerable so that it doesn't show up when the\n // exception hits the top level.\n Object.defineProperty(this, '_dartException', {\n value: dartException,\n enumerable: false\n });\n }\n\n toString() {\n return this.message;\n }\n }\n ").call$0()); + A.defineGetter(jsClass, "name", null, "sass.Exception"); + A.LinkedHashMap_LinkedHashMap$_literal(["sassMessage", new A.exceptionClass__closure(), "sassStack", new A.exceptionClass__closure0(), "span", new A.exceptionClass__closure1()], type$.String, type$.Function).forEach$1(0, A.JSClassExtension_get_defineGetter(jsClass)); + return jsClass; + }, + $signature: 13 + }; + A.exceptionClass__closure.prototype = { + call$1(exception) { + return J.get$_dartException$x(exception)._span_exception$_message; + }, + $signature: 238 + }; + A.exceptionClass__closure0.prototype = { + call$1(exception) { + return J.get$trace$z(J.get$_dartException$x(exception)).toString$0(0); + }, + $signature: 238 + }; + A.exceptionClass__closure1.prototype = { + call$1(exception) { + var t1 = J.get$_dartException$x(exception), + t2 = J.getInterceptor$z(t1); + return A.SourceSpanException.prototype.get$span.call(t2, t1); + }, + $signature: 434 + }; + A.SassException0.prototype = { + get$trace(_) { + return A.Trace$(A._setArrayType([A.frameForSpan0(A.SourceSpanException.prototype.get$span.call(this, 0), "root stylesheet", null)], type$.JSArray_Frame), null); + }, + get$span(_) { + return A.SourceSpanException.prototype.get$span.call(this, 0); + }, + withAdditionalSpan$2(span, label) { + return A.MultiSpanSassException$0(this._span_exception$_message, A.SourceSpanException.prototype.get$span.call(this, 0), "", A.LinkedHashMap_LinkedHashMap$_literal([span, label], type$.FileSpan, type$.String), this.loadedUrls); + }, + withTrace$1(trace) { + var t1 = A.SourceSpanException.prototype.get$span.call(this, 0), + t2 = A.Set_Set$unmodifiable(this.loadedUrls, type$.Uri); + return new A.SassRuntimeException0(trace, t2, this._span_exception$_message, t1); + }, + withLoadedUrls$1(loadedUrls) { + var t1 = A.SourceSpanException.prototype.get$span.call(this, 0), + t2 = A.Set_Set$unmodifiable(loadedUrls, type$.Uri); + return new A.SassException0(t2, this._span_exception$_message, t1); + }, + toString$1$color(_, color) { + var t2, _i, frame, t3, _this = this, + buffer = new A.StringBuffer(""), + t1 = "" + ("Error: " + _this._span_exception$_message + "\n"); + buffer._contents = t1; + buffer._contents = t1 + A.SourceSpanException.prototype.get$span.call(_this, 0).highlight$1$color(color); + for (t1 = _this.get$trace(_this).toString$0(0).split("\n"), t2 = t1.length, _i = 0; _i < t2; ++_i) { + frame = t1[_i]; + if (J.get$length$asx(frame) === 0) + continue; + t3 = buffer._contents += "\n"; + buffer._contents = t3 + (" " + A.S(frame)); + } + t1 = buffer._contents; + return t1.charCodeAt(0) == 0 ? t1 : t1; + }, + toString$0(_) { + return this.toString$1$color(0, null); + } + }; + A.MultiSpanSassException0.prototype = { + withAdditionalSpan$2(span, label) { + var _this = this, + t1 = A.SourceSpanException.prototype.get$span.call(_this, 0), + t2 = A.LinkedHashMap_LinkedHashMap$of(_this.secondarySpans, type$.FileSpan, type$.String); + t2.$indexSet(0, span, label); + return A.MultiSpanSassException$0(_this._span_exception$_message, t1, _this.primaryLabel, t2, _this.loadedUrls); + }, + withTrace$1(trace) { + var _this = this; + return A.MultiSpanSassRuntimeException$0(_this._span_exception$_message, A.SourceSpanException.prototype.get$span.call(_this, 0), _this.primaryLabel, _this.secondarySpans, trace, _this.loadedUrls); + }, + withLoadedUrls$1(loadedUrls) { + var _this = this; + return A.MultiSpanSassException$0(_this._span_exception$_message, A.SourceSpanException.prototype.get$span.call(_this, 0), _this.primaryLabel, _this.secondarySpans, loadedUrls); + }, + toString$1$color(_, color) { + var t1, t2, _i, frame, _this = this, + useColor = color === true && true, + buffer = new A.StringBuffer("Error: " + _this._span_exception$_message + "\n"); + A.NullableExtension_andThen0(A.Highlighter$multiple(A.SourceSpanException.prototype.get$span.call(_this, 0), _this.primaryLabel, _this.secondarySpans, useColor, null, null).highlight$0(), buffer.get$write(buffer)); + for (t1 = _this.get$trace(_this).toString$0(0).split("\n"), t2 = t1.length, _i = 0; _i < t2; ++_i) { + frame = t1[_i]; + if (J.get$length$asx(frame) === 0) + continue; + buffer._contents += "\n"; + buffer._contents += " " + A.S(frame); + } + t1 = buffer._contents; + return t1.charCodeAt(0) == 0 ? t1 : t1; + }, + toString$0(_) { + return this.toString$1$color(0, null); + }, + get$primaryLabel() { + return this.primaryLabel; + }, + get$secondarySpans() { + return this.secondarySpans; + } + }; + A.SassRuntimeException0.prototype = { + withAdditionalSpan$2(span, label) { + var _this = this; + return A.MultiSpanSassRuntimeException$0(_this._span_exception$_message, A.SourceSpanException.prototype.get$span.call(_this, 0), "", A.LinkedHashMap_LinkedHashMap$_literal([span, label], type$.FileSpan, type$.String), _this.trace, _this.loadedUrls); + }, + withLoadedUrls$1(loadedUrls) { + var t1 = A.SourceSpanException.prototype.get$span.call(this, 0), + t2 = A.Set_Set$unmodifiable(loadedUrls, type$.Uri); + return new A.SassRuntimeException0(this.trace, t2, this._span_exception$_message, t1); + }, + get$trace(receiver) { + return this.trace; + } + }; + A.MultiSpanSassRuntimeException0.prototype = { + withAdditionalSpan$2(span, label) { + var _this = this, + t1 = A.SourceSpanException.prototype.get$span.call(_this, 0), + t2 = A.LinkedHashMap_LinkedHashMap$of(_this.secondarySpans, type$.FileSpan, type$.String); + t2.$indexSet(0, span, label); + return A.MultiSpanSassRuntimeException$0(_this._span_exception$_message, t1, _this.primaryLabel, t2, _this.trace, _this.loadedUrls); + }, + withLoadedUrls$1(loadedUrls) { + var _this = this; + return A.MultiSpanSassRuntimeException$0(_this._span_exception$_message, A.SourceSpanException.prototype.get$span.call(_this, 0), _this.primaryLabel, _this.secondarySpans, _this.trace, loadedUrls); + }, + $isSassRuntimeException0: 1, + get$trace(receiver) { + return this.trace; + } + }; + A.SassFormatException0.prototype = { + get$source() { + var t1 = A.SourceSpanException.prototype.get$span.call(this, 0); + return A.String_String$fromCharCodes(B.NativeUint32List_methods.sublist$2(t1.get$file(t1)._decodedChars, 0, null), 0, null); + }, + withAdditionalSpan$2(span, label) { + return A.MultiSpanSassFormatException$0(this._span_exception$_message, A.SourceSpanException.prototype.get$span.call(this, 0), "", A.LinkedHashMap_LinkedHashMap$_literal([span, label], type$.FileSpan, type$.String), this.loadedUrls); + }, + withLoadedUrls$1(loadedUrls) { + var t1 = A.SourceSpanException.prototype.get$span.call(this, 0), + t2 = A.Set_Set$unmodifiable(loadedUrls, type$.Uri); + return new A.SassFormatException0(t2, this._span_exception$_message, t1); + }, + $isFormatException: 1, + $isSourceSpanFormatException: 1 + }; + A.MultiSpanSassFormatException0.prototype = { + get$source() { + var t1 = A.SourceSpanException.prototype.get$span.call(this, 0); + return A.String_String$fromCharCodes(B.NativeUint32List_methods.sublist$2(t1.get$file(t1)._decodedChars, 0, null), 0, null); + }, + withAdditionalSpan$2(span, label) { + var _this = this, + t1 = A.SourceSpanException.prototype.get$span.call(_this, 0), + t2 = A.LinkedHashMap_LinkedHashMap$of(_this.secondarySpans, type$.FileSpan, type$.String); + t2.$indexSet(0, span, label); + return A.MultiSpanSassFormatException$0(_this._span_exception$_message, t1, _this.primaryLabel, t2, _this.loadedUrls); + }, + withLoadedUrls$1(loadedUrls) { + var _this = this; + return A.MultiSpanSassFormatException$0(_this._span_exception$_message, A.SourceSpanException.prototype.get$span.call(_this, 0), _this.primaryLabel, _this.secondarySpans, loadedUrls); + }, + $isFormatException: 1, + $isSourceSpanFormatException: 1, + $isMultiSourceSpanFormatException: 1, + $isSassFormatException0: 1 + }; + A.SassScriptException0.prototype = { + withSpan$1(span) { + return new A.SassException0(B.Set_empty, this.message, span); + }, + toString$0(_) { + return this.message + string$.x0a_BUG_; + }, + get$message(receiver) { + return this.message; + } + }; + A.MultiSpanSassScriptException0.prototype = { + withSpan$1(span) { + return A.MultiSpanSassException$0(this.message, span, this.primaryLabel, this.secondarySpans, null); + } + }; + A.Exports.prototype = {}; + A.LoggerNamespace.prototype = {}; + A._IsCalculationSafeVisitor0.prototype = { + visitBinaryOperationExpression$1(node) { + var t1; + if (B.Set_FIwG40.contains$1(0, node.operator)) + t1 = node.left.accept$1(this) || node.right.accept$1(this); + else + t1 = false; + return t1; + }, + visitBooleanExpression$1(node) { + return false; + }, + visitColorExpression$1(node) { + return false; + }, + visitFunctionExpression$1(node) { + return true; + }, + visitInterpolatedFunctionExpression$1(node) { + return true; + }, + visitIfExpression$1(node) { + return true; + }, + visitListExpression$1(node) { + var t1; + if (node.separator === B.ListSeparator_EVt0) + if (!node.hasBrackets) { + t1 = node.contents; + t1 = t1.length > 1 && B.JSArray_methods.every$1(t1, new A._IsCalculationSafeVisitor_visitListExpression_closure0(this)); + } else + t1 = false; + else + t1 = false; + return t1; + }, + visitMapExpression$1(node) { + return false; + }, + visitNullExpression$1(node) { + return false; + }, + visitNumberExpression$1(node) { + return true; + }, + visitParenthesizedExpression$1(node) { + return node.expression.accept$1(this); + }, + visitSelectorExpression$1(node) { + return false; + }, + visitStringExpression$1(node) { + var text, t1, t2; + if (node.hasQuotes) + return false; + text = node.text.get$initialPlain(); + if (!B.JSString_methods.startsWith$1(text, "!")) + if (!B.JSString_methods.startsWith$1(text, "#")) { + t1 = text.length; + if ((1 >= t1 ? null : text.charCodeAt(1)) !== 43) { + t2 = (3 >= t1 ? null : text.charCodeAt(3)) !== 40; + t1 = t2; + } else + t1 = false; + } else + t1 = false; + else + t1 = false; + return t1; + }, + visitSupportsExpression$1(node) { + return false; + }, + visitUnaryOperationExpression$1(node) { + return false; + }, + visitValueExpression$1(node) { + return false; + }, + visitVariableExpression$1(node) { + return true; + } + }; + A._IsCalculationSafeVisitor_visitListExpression_closure0.prototype = { + call$1(expression) { + return expression.accept$1(this.$this); + }, + $signature: 133 + }; + A._MakeExpressionCalculationSafe0.prototype = { + visitBinaryOperationExpression$1(node) { + var t1, t2, t3; + if (node.operator === B.BinaryOperator_OTG0) { + t1 = A._setArrayType([node], type$.JSArray_Expression_2); + t2 = node.get$span(0); + t3 = type$.Expression_2; + t2 = new A.FunctionExpression0("math", "max", new A.ArgumentInvocation0(A.List_List$unmodifiable(t1, t3), A.ConstantMap_ConstantMap$from(B.Map_empty14, type$.String, t3), null, null, t2), node.get$span(0)); + t1 = t2; + } else + t1 = this.super$ReplaceExpressionVisitor$visitBinaryOperationExpression0(node); + return t1; + }, + visitInterpolatedFunctionExpression$1(node) { + return node; + }, + visitUnaryOperationExpression$1(node) { + var t1, + _0_0 = node.operator; + $label0$0: { + if (B.UnaryOperator_gg40 === _0_0) { + t1 = node.operand; + break $label0$0; + } + if (B.UnaryOperator_TLI0 === _0_0) { + t1 = new A.BinaryOperationExpression0(B.BinaryOperator_qN20, new A.NumberExpression0(-1, null, node.span), node.operand, false); + break $label0$0; + } + t1 = this.super$ReplaceExpressionVisitor$visitUnaryOperationExpression0(node); + break $label0$0; + } + return t1; + } + }; + A.__MakeExpressionCalculationSafe_Object_ReplaceExpressionVisitor0.prototype = {}; + A.ExtendRule0.prototype = { + accept$1$1(visitor) { + return visitor.visitExtendRule$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + toString$0(_) { + var t1 = this.selector.toString$0(0), + t2 = this.isOptional ? " !optional" : ""; + return "@extend " + t1 + t2 + ";"; + }, + $isAstNode0: 1, + $isStatement0: 1, + get$span(receiver) { + return this.span; + } + }; + A.Extension0.prototype = { + toString$0(_) { + var t1 = this.extender.toString$0(0), + t2 = this.target.toString$0(0), + t3 = this.isOptional ? " !optional" : ""; + return t1 + " {@extend " + t2 + t3 + "}"; + } + }; + A.Extender0.prototype = { + assertCompatibleMediaContext$1(mediaContext) { + var expectedMediaContext, + extension = this._extension$_extension; + if (extension == null) + return; + expectedMediaContext = extension.mediaContext; + if (expectedMediaContext == null) + return; + if (mediaContext != null && B.C_ListEquality.equals$2(0, expectedMediaContext, mediaContext)) + return; + throw A.wrapException(A.SassException$0(string$.You_ma, extension.span, null)); + }, + toString$0(_) { + return A.serializeSelector0(this.selector, true); + } + }; + A.ExtensionStore0.prototype = { + get$isEmpty(_) { + return this._extension_store$_extensions.__js_helper$_length === 0; + }, + get$simpleSelectors() { + return new A.MapKeySet(this._extension_store$_selectors, type$.MapKeySet_SimpleSelector_2); + }, + extensionsWhereTarget$1(callback) { + return new A._SyncStarIterable(this.extensionsWhereTarget$body$ExtensionStore0(callback), type$._SyncStarIterable_Extension_2); + }, + extensionsWhereTarget$body$ExtensionStore0($async$callback) { + var $async$self = this; + return function() { + var callback = $async$callback; + var $async$goto = 0, $async$handler = 1, $async$currentError, t1, t2, simple, sources, t3; + return function $async$extensionsWhereTarget$1($async$iterator, $async$errorCode, $async$result) { + if ($async$errorCode === 1) { + $async$currentError = $async$result; + $async$goto = $async$handler; + } + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = A.MapExtensions_get_pairs0($async$self._extension_store$_extensions, type$.SimpleSelector_2, type$.Map_ComplexSelector_Extension_2), t1 = t1.get$iterator(t1); + case 2: + // for condition + if (!t1.moveNext$0()) { + // goto after for + $async$goto = 3; + break; + } + t2 = t1.get$current(t1); + simple = t2._0; + sources = t2._1; + if (!callback.call$1(simple)) { + // goto for condition + $async$goto = 2; + break; + } + t2 = sources.get$values(sources), t2 = t2.get$iterator(t2); + case 4: + // for condition + if (!t2.moveNext$0()) { + // goto after for + $async$goto = 5; + break; + } + t3 = t2.get$current(t2); + $async$goto = t3 instanceof A.MergedExtension0 ? 6 : 8; + break; + case 6: + // then + t3 = t3.unmerge$0(); + $async$goto = 9; + return $async$iterator._yieldStar$1(new A.WhereIterable(t3, new A.ExtensionStore_extensionsWhereTarget_closure0(), t3.$ti._eval$1("WhereIterable"))); + case 9: + // after yield + // goto join + $async$goto = 7; + break; + case 8: + // else + $async$goto = !t3.isOptional ? 10 : 11; + break; + case 10: + // then + $async$goto = 12; + return $async$iterator._async$_current = t3, 1; + case 12: + // after yield + case 11: + // join + case 7: + // join + // goto for condition + $async$goto = 4; + break; + case 5: + // after for + // goto for condition + $async$goto = 2; + break; + case 3: + // after for + // implicit return + return 0; + case 1: + // rethrow + return $async$iterator._datum = $async$currentError, 3; + } + }; + }; + }, + addSelector$2(selector, mediaContext) { + var originalSelector, error, stackTrace, t1, exception, t2, t3, t4, modifiableSelector, _this = this; + selector = selector; + originalSelector = selector; + if (!originalSelector.accept$1(B._IsInvisibleVisitor_true0)) + _this._extension_store$_originals.addAll$1(0, originalSelector.components); + t1 = _this._extension_store$_extensions; + if (t1.__js_helper$_length !== 0) + try { + selector = _this._extension_store$_extendList$3(originalSelector, t1, mediaContext); + } catch (exception) { + t1 = A.unwrapException(exception); + if (t1 instanceof A.SassException0) { + error = t1; + stackTrace = A.getTraceFromException(exception); + t1 = error; + t2 = J.getInterceptor$z(t1); + t1 = A.SourceSpanException.prototype.get$span.call(t2, t1).message$1(0, ""); + t2 = error._span_exception$_message; + t3 = error; + t4 = J.getInterceptor$z(t3); + t3 = A.SourceSpanException.prototype.get$span.call(t4, t3); + A.throwWithTrace0(new A.SassException0(B.Set_empty, "From " + t1 + "\n" + t2, t3), error, stackTrace); + } else + throw exception; + } + modifiableSelector = new A.ModifiableBox0(selector, type$.ModifiableBox_SelectorList_2); + if (mediaContext != null) + _this._extension_store$_mediaContexts.$indexSet(0, modifiableSelector, mediaContext); + _this._extension_store$_registerSelector$2(selector, modifiableSelector); + return new A.Box0(modifiableSelector, type$.Box_SelectorList_2); + }, + _extension_store$_registerSelector$2(list, selector) { + var t1, t2, t3, t4, _i, t5, t6, _i0, t7, t8, _i1, simple, _0_2, t9, _0_2_isSet, selectorInPseudo; + for (t1 = list.components, t2 = t1.length, t3 = this._extension_store$_selectors, t4 = type$.SelectorList_2, _i = 0; _i < t2; ++_i) + for (t5 = t1[_i].components, t6 = t5.length, _i0 = 0; _i0 < t6; ++_i0) + for (t7 = t5[_i0].selector.components, t8 = t7.length, _i1 = 0; _i1 < t8; ++_i1) { + simple = t7[_i1]; + J.add$1$ax(t3.putIfAbsent$2(simple, new A.ExtensionStore__registerSelector_closure0()), selector); + if (simple instanceof A.PseudoSelector0) { + _0_2 = simple.selector; + t9 = _0_2 != null; + _0_2_isSet = true; + } else { + _0_2 = null; + _0_2_isSet = false; + t9 = false; + } + if (t9) { + selectorInPseudo = _0_2_isSet ? _0_2 : simple.selector; + this._extension_store$_registerSelector$2(selectorInPseudo == null ? t4._as(selectorInPseudo) : selectorInPseudo, selector); + } + } + }, + addExtension$4(extender, target, extend, mediaContext) { + var t2, t3, t4, t5, t6, t7, t8, t9, t10, newExtensions, _i, complex, t11, extension, _0_0, t12, newExtensionsByTarget, additionalExtensions, _this = this, + selectors = _this._extension_store$_selectors.$index(0, target), + t1 = _this._extension_store$_extensionsByExtender, + existingExtensions = t1.$index(0, target), + sources = _this._extension_store$_extensions.putIfAbsent$2(target, new A.ExtensionStore_addExtension_closure2()); + for (t2 = extender.components, t3 = t2.length, t4 = selectors == null, t5 = _this._extension_store$_sourceSpecificity, t6 = extend.span, t7 = extend.isOptional, t8 = existingExtensions != null, t9 = type$.ComplexSelector_2, t10 = type$.Extension_2, newExtensions = null, _i = 0; _i < t3; ++_i) { + complex = t2[_i]; + if (complex.accept$1(B.C__IsUselessVisitor0)) + continue; + complex.get$specificity(); + t11 = new A.Extender0(complex, false); + extension = t11._extension$_extension = new A.Extension0(t11, target, mediaContext, t7, t6); + _0_0 = sources.$index(0, complex); + if (_0_0 != null) { + sources.$indexSet(0, complex, A.MergedExtension_merge0(_0_0, extension)); + continue; + } + sources.$indexSet(0, complex, extension); + for (t11 = new A._SyncStarIterator(_this._extension_store$_simpleSelectors$1(complex)._outerHelper()); t11.moveNext$0();) { + t12 = t11._async$_current; + J.add$1$ax(t1.putIfAbsent$2(t12, new A.ExtensionStore_addExtension_closure3()), extension); + t5.putIfAbsent$2(t12, new A.ExtensionStore_addExtension_closure4(complex)); + } + if (!t4 || t8) { + if (newExtensions == null) + newExtensions = A.LinkedHashMap_LinkedHashMap$_empty(t9, t10); + newExtensions.$indexSet(0, complex, extension); + } + } + if (newExtensions == null) + return; + t1 = type$.SimpleSelector_2; + newExtensionsByTarget = A.LinkedHashMap_LinkedHashMap$_literal([target, newExtensions], t1, type$.Map_ComplexSelector_Extension_2); + if (t8) { + additionalExtensions = _this._extension_store$_extendExistingExtensions$2(existingExtensions, newExtensionsByTarget); + if (additionalExtensions != null) + A.mapAddAll20(newExtensionsByTarget, additionalExtensions, t1, t9, t10); + } + if (!t4) + _this._extension_store$_extendExistingSelectors$2(selectors, newExtensionsByTarget); + }, + _extension_store$_simpleSelectors$1(complex) { + return new A._SyncStarIterable(this._simpleSelectors$body$ExtensionStore0(complex), type$._SyncStarIterable_SimpleSelector_2); + }, + _simpleSelectors$body$ExtensionStore0($async$complex) { + var $async$self = this; + return function() { + var complex = $async$complex; + var $async$goto = 0, $async$handler = 1, $async$currentError, t1, t2, t3, _i, t4, t5, _i0, simple, _0_2, t6, _0_2_isSet, selector, t7, _i1; + return function $async$_extension_store$_simpleSelectors$1($async$iterator, $async$errorCode, $async$result) { + if ($async$errorCode === 1) { + $async$currentError = $async$result; + $async$goto = $async$handler; + } + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = complex.components, t2 = t1.length, t3 = type$.SelectorList_2, _i = 0; + case 2: + // for condition + if (!(_i < t2)) { + // goto after for + $async$goto = 4; + break; + } + t4 = t1[_i].selector.components, t5 = t4.length, _i0 = 0; + case 5: + // for condition + if (!(_i0 < t5)) { + // goto after for + $async$goto = 7; + break; + } + simple = t4[_i0]; + $async$goto = 8; + return $async$iterator._async$_current = simple, 1; + case 8: + // after yield + if (simple instanceof A.PseudoSelector0) { + _0_2 = simple.selector; + t6 = _0_2 != null; + _0_2_isSet = true; + } else { + _0_2 = null; + _0_2_isSet = false; + t6 = false; + } + $async$goto = t6 ? 9 : 10; + break; + case 9: + // then + selector = _0_2_isSet ? _0_2 : simple.selector; + t6 = (selector == null ? t3._as(selector) : selector).components, t7 = t6.length, _i1 = 0; + case 11: + // for condition + if (!(_i1 < t7)) { + // goto after for + $async$goto = 13; + break; + } + $async$goto = 14; + return $async$iterator._yieldStar$1($async$self._extension_store$_simpleSelectors$1(t6[_i1])); + case 14: + // after yield + case 12: + // for update + ++_i1; + // goto for condition + $async$goto = 11; + break; + case 13: + // after for + case 10: + // join + case 6: + // for update + ++_i0; + // goto for condition + $async$goto = 5; + break; + case 7: + // after for + case 3: + // for update + ++_i; + // goto for condition + $async$goto = 2; + break; + case 4: + // after for + // implicit return + return 0; + case 1: + // rethrow + return $async$iterator._datum = $async$currentError, 3; + } + }; + }; + }, + _extension_store$_extendExistingExtensions$2(extensions, newExtensions) { + var extension, selectors, error, stackTrace, t1, t2, t3, t4, t5, t6, additionalExtensions, _i, t7, exception, t8, t9, selectors0, t10, t11, t12, t13, t14, withExtender, _0_0, _i0, _i1; + for (t1 = J.toList$0$ax(extensions), t2 = t1.length, t3 = this._extension_store$_extensionsByExtender, t4 = type$.SimpleSelector_2, t5 = type$.Map_ComplexSelector_Extension_2, t6 = this._extension_store$_extensions, additionalExtensions = null, _i = 0; _i < t1.length; t1.length === t2 || (0, A.throwConcurrentModificationError)(t1), ++_i) { + extension = t1[_i]; + t7 = t6.$index(0, extension.target); + t7.toString; + selectors = null; + try { + selectors = this._extension_store$_extendComplex$3(extension.extender.selector, newExtensions, extension.mediaContext); + if (selectors == null) + continue; + } catch (exception) { + t8 = A.unwrapException(exception); + if (t8 instanceof A.SassException0) { + error = t8; + stackTrace = A.getTraceFromException(exception); + A.throwWithTrace0(error.withAdditionalSpan$2(extension.extender.selector.span, "target selector"), error, stackTrace); + } else + throw exception; + } + t8 = J.get$first$ax(selectors); + t9 = extension.extender.selector; + if (B.C_ListEquality.equals$2(0, t8.leadingCombinators, t9.leadingCombinators) && B.C_ListEquality.equals$2(0, t8.components, t9.components)) { + t8 = selectors; + t9 = A.instanceType(t8); + selectors0 = new A.SubListIterable(t8, 1, null, t9._eval$1("SubListIterable<1>")); + selectors0.SubListIterable$3(t8, 1, null, t9._precomputed1); + selectors = selectors0; + } + for (t8 = J.get$iterator$ax(selectors); t8.moveNext$0();) { + t9 = t8.get$current(t8); + t10 = extension; + t11 = t10.target; + t12 = t10.span; + t13 = t10.mediaContext; + t10 = t10.isOptional; + t9.get$specificity(); + t14 = new A.Extender0(t9, false); + withExtender = t14._extension$_extension = new A.Extension0(t14, t11, t13, t10, t12); + _0_0 = t7.$index(0, t9); + if (_0_0 != null) + t7.$indexSet(0, t9, A.MergedExtension_merge0(_0_0, withExtender)); + else { + t7.$indexSet(0, t9, withExtender); + for (t10 = t9.components, t11 = t10.length, _i0 = 0; _i0 < t11; ++_i0) + for (t12 = t10[_i0].selector.components, t13 = t12.length, _i1 = 0; _i1 < t13; ++_i1) + J.add$1$ax(t3.putIfAbsent$2(t12[_i1], new A.ExtensionStore__extendExistingExtensions_closure1()), withExtender); + if (newExtensions.containsKey$1(extension.target)) { + if (additionalExtensions == null) + additionalExtensions = A.LinkedHashMap_LinkedHashMap$_empty(t4, t5); + additionalExtensions.putIfAbsent$2(extension.target, new A.ExtensionStore__extendExistingExtensions_closure2()).$indexSet(0, t9, withExtender); + } + } + } + } + return additionalExtensions; + }, + _extension_store$_extendExistingSelectors$2(selectors, newExtensions) { + var selector, error, stackTrace, t1, t2, oldValue, exception, t3, t4, t5, t6; + for (t1 = selectors.get$iterator(selectors), t2 = this._extension_store$_mediaContexts; t1.moveNext$0();) { + selector = t1.get$current(t1); + oldValue = selector.value; + try { + selector.value = this._extension_store$_extendList$3(selector.value, newExtensions, t2.$index(0, selector)); + } catch (exception) { + t3 = A.unwrapException(exception); + if (t3 instanceof A.SassException0) { + error = t3; + stackTrace = A.getTraceFromException(exception); + t3 = selector.value.span.message$1(0, ""); + t4 = error._span_exception$_message; + t5 = error; + t6 = J.getInterceptor$z(t5); + t5 = A.SourceSpanException.prototype.get$span.call(t6, t5); + A.throwWithTrace0(new A.SassException0(B.Set_empty, "From " + t3 + "\n" + t4, t5), error, stackTrace); + } else + throw exception; + } + if (oldValue === selector.value) + continue; + this._extension_store$_registerSelector$2(selector.value, selector); + } + }, + addExtensions$1(extensionStores) { + var t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, newExtensions, selectorsToExtend, extensionsToExtend, t12, t13, target, newSources, first, extensionsForTarget, t14, selectorsForTarget, t15, _2_0, t16, extender, extension, _this = this, _null = null; + for (t1 = J.get$iterator$ax(extensionStores), t2 = type$.SimpleSelector_2, t3 = type$.Map_ComplexSelector_Extension_2, t4 = _this._extension_store$_extensions, t5 = type$.ComplexSelector_2, t6 = type$.Extension_2, t7 = _this._extension_store$_selectors, t8 = _this._extension_store$_extensionsByExtender, t9 = type$.JSArray_Extension_2, t10 = type$.ModifiableBox_SelectorList_2, t11 = _this._extension_store$_sourceSpecificity, newExtensions = _null, selectorsToExtend = newExtensions, extensionsToExtend = selectorsToExtend; t1.moveNext$0();) { + t12 = t1.get$current(t1); + if (t12.get$isEmpty(t12)) + continue; + t11.addAll$1(0, t12.get$_extension_store$_sourceSpecificity()); + for (t12 = A.MapExtensions_get_pairs0(t12.get$_extension_store$_extensions(), t2, t3), t12 = t12.get$iterator(t12); t12.moveNext$0();) { + t13 = t12.get$current(t12); + target = t13._0; + newSources = t13._1; + if (target instanceof A.PlaceholderSelector0) { + first = target.name.charCodeAt(0); + t13 = first === 45 || first === 95; + } else + t13 = false; + if (t13) + continue; + extensionsForTarget = t8.$index(0, target); + t13 = extensionsForTarget == null; + if (!t13) { + if (extensionsToExtend == null) { + extensionsToExtend = A._setArrayType([], t9); + t14 = extensionsToExtend; + } else + t14 = extensionsToExtend; + B.JSArray_methods.addAll$1(t14, extensionsForTarget); + } + selectorsForTarget = t7.$index(0, target); + t14 = selectorsForTarget != null; + if (t14) { + if (selectorsToExtend == null) { + selectorsToExtend = A.LinkedHashSet_LinkedHashSet$_empty(t10); + t15 = selectorsToExtend; + } else + t15 = selectorsToExtend; + t15.addAll$1(0, selectorsForTarget); + } + _2_0 = t4.$index(0, target); + if (_2_0 != null) + for (t15 = A.MapExtensions_get_pairs0(newSources, t5, t6), t15 = t15.get$iterator(t15); t15.moveNext$0();) { + t16 = t15.get$current(t15); + extender = t16._0; + extension = t16._1; + if (_2_0.containsKey$1(extender)) { + t16 = _2_0.$index(0, extender); + extension = A.MergedExtension_merge0(t16 == null ? t6._as(t16) : t16, extension); + _2_0.$indexSet(0, extender, extension); + } else + _2_0.$indexSet(0, extender, extension); + if (!t13 || t14) { + if (newExtensions == null) { + newExtensions = A.LinkedHashMap_LinkedHashMap$_empty(t2, t3); + t16 = newExtensions; + } else + t16 = newExtensions; + J.$indexSet$ax(t16.putIfAbsent$2(target, new A.ExtensionStore_addExtensions_closure0()), extender, extension); + } + } + else { + t15 = A.LinkedHashMap_LinkedHashMap(_null, _null, _null, t5, t6); + t15.addAll$1(0, newSources); + t4.$indexSet(0, target, t15); + if (!t13 || t14) { + if (newExtensions == null) { + newExtensions = A.LinkedHashMap_LinkedHashMap$_empty(t2, t3); + t13 = newExtensions; + } else + t13 = newExtensions; + t14 = A.LinkedHashMap_LinkedHashMap(_null, _null, _null, t5, t6); + t14.addAll$1(0, newSources); + t13.$indexSet(0, target, t14); + } + } + } + } + if (newExtensions != null) { + if (extensionsToExtend != null) + _this._extension_store$_extendExistingExtensions$2(extensionsToExtend, newExtensions); + if (selectorsToExtend != null) + _this._extension_store$_extendExistingSelectors$2(selectorsToExtend, newExtensions); + } + }, + _extension_store$_extendList$3(list, extensions, mediaQueryContext) { + var t1, t2, t3, extended, i, complex, result, t4; + for (t1 = list.components, t2 = t1.length, t3 = type$.JSArray_ComplexSelector_2, extended = null, i = 0; i < t2; ++i) { + complex = t1[i]; + result = this._extension_store$_extendComplex$3(complex, extensions, mediaQueryContext); + if (result == null) { + if (extended != null) + extended.push(complex); + } else { + if (extended == null) + if (i === 0) + extended = A._setArrayType([], t3); + else { + t4 = B.JSArray_methods.sublist$2(t1, 0, i); + extended = A._setArrayType(t4.slice(0), A._arrayInstanceType(t4)); + } + B.JSArray_methods.addAll$1(extended, result); + } + } + if (extended == null) + return list; + t1 = this._extension_store$_originals; + return A.SelectorList$0(this._extension_store$_trim$2(extended, t1.get$contains(t1)), list.span); + }, + _extension_store$_extendList$2(list, extensions) { + return this._extension_store$_extendList$3(list, extensions, null); + }, + _extension_store$_extendComplex$3(complex, extensions, mediaQueryContext) { + var isOriginal, t3, t4, t5, t6, t7, t8, t9, t10, extendedNotExpanded, i, component, extended, t11, t12, t13, t14, _box_0 = {}, + t1 = complex.leadingCombinators, + t2 = t1.length; + if (t2 > 1) + return null; + isOriginal = this._extension_store$_originals.contains$1(0, complex); + for (t3 = complex.components, t4 = t3.length, t5 = type$.JSArray_List_ComplexSelector_2, t6 = complex.lineBreak, t7 = !t6, t8 = complex.span, t9 = type$.JSArray_ComplexSelector_2, t2 = t2 === 0, t10 = type$.JSArray_ComplexSelectorComponent_2, extendedNotExpanded = null, i = 0; i < t4; ++i) { + component = t3[i]; + extended = this._extension_store$_extendCompound$4$inOriginal(component, extensions, mediaQueryContext, isOriginal); + if (extended == null) { + if (extendedNotExpanded != null) + extendedNotExpanded.push(A._setArrayType([A.ComplexSelector$0(B.List_empty14, A._setArrayType([component], t10), t8, t6)], t9)); + } else if (extendedNotExpanded != null) + extendedNotExpanded.push(extended); + else if (i !== 0) { + t11 = A._arrayInstanceType(t3); + t12 = new A.SubListIterable(t3, 0, i, t11._eval$1("SubListIterable<1>")); + t12.SubListIterable$3(t3, 0, i, t11._precomputed1); + extendedNotExpanded = A._setArrayType([A._setArrayType([A.ComplexSelector$0(t1, t12, t8, t6)], t9), extended], t5); + } else if (t2) + extendedNotExpanded = A._setArrayType([extended], t5); + else { + t11 = A._setArrayType([], t9); + for (t12 = J.get$iterator$ax(extended); t12.moveNext$0();) { + t13 = t12.get$current(t12); + t14 = t13.leadingCombinators; + if (t14.length === 0 || B.C_ListEquality.equals$2(0, t1, t14)) { + t14 = t13.components; + t11.push(A.ComplexSelector$0(t1, t14, t8, !t7 || t13.lineBreak)); + } + } + extendedNotExpanded = A._setArrayType([t11], t5); + } + } + if (extendedNotExpanded == null) + return null; + _box_0.first = true; + t1 = type$.ComplexSelector_2; + t1 = J.expand$1$1$ax(A.paths0(extendedNotExpanded, t1), new A.ExtensionStore__extendComplex_closure0(_box_0, this, complex), t1); + return A.List_List$of(t1, true, t1.$ti._eval$1("Iterable.E")); + }, + _extension_store$_extendCompound$4$inOriginal(component, extensions, mediaQueryContext, inOriginal) { + var t3, t4, t5, t6, t7, t8, t9, t10, t11, options, i, simple, extended, t12, result, compound, complex, extenderPaths, withCombinators, isOriginal, _this = this, _null = null, + t1 = _this._extension_store$_mode, + targetsUsed = t1 === B.ExtendMode_normal_normal0 || extensions.__js_helper$_length < 2 ? _null : A.LinkedHashSet_LinkedHashSet$_empty(type$.SimpleSelector_2), + t2 = component.selector, + simples = t2.components; + for (t3 = simples.length, t4 = type$.JSArray_List_Extender_2, t5 = type$.JSArray_Extender_2, t6 = type$.CssValue_Combinator_2, t7 = type$.JSArray_ComplexSelectorComponent_2, t8 = A._arrayInstanceType(simples), t9 = t8._precomputed1, t8 = t8._eval$1("SubListIterable<1>"), t10 = component.span, t11 = type$.SimpleSelector_2, options = _null, i = 0; i < t3; ++i) { + simple = simples[i]; + extended = _this._extension_store$_extendSimple$4(simple, extensions, mediaQueryContext, targetsUsed); + if (extended == null) { + if (options != null) + options.push(A._setArrayType([_this._extension_store$_extenderForSimple$1(simple)], t5)); + } else { + if (options == null) { + options = A._setArrayType([], t4); + if (i !== 0) { + t12 = new A.SubListIterable(simples, 0, i, t8); + t12.SubListIterable$3(simples, 0, i, t9); + result = A.List_List$from(t12, false, t11); + result.fixed$length = Array; + result.immutable$list = Array; + t12 = result; + compound = new A.CompoundSelector0(t12, t10); + if (t12.length === 0) + A.throwExpression(A.ArgumentError$("components may not be empty.", _null)); + result = A.List_List$from(B.List_empty14, false, t6); + result.fixed$length = Array; + result.immutable$list = Array; + t12 = A.ComplexSelector$0(B.List_empty14, A._setArrayType([new A.ComplexSelectorComponent0(compound, result, t10)], t7), t10, false); + _this._extension_store$_sourceSpecificityFor$1(compound); + options.push(A._setArrayType([new A.Extender0(t12, true)], t5)); + } + } + B.JSArray_methods.addAll$1(options, extended); + } + } + if (options == null) + return _null; + if (targetsUsed != null && targetsUsed._collection$_length !== extensions.__js_helper$_length) + return _null; + if (options.length === 1) { + for (t1 = J.get$iterator$ax(options[0]), t2 = component.combinators, t3 = type$.JSArray_ComplexSelector_2, result = _null; t1.moveNext$0();) { + t4 = t1.get$current(t1); + t4.assertCompatibleMediaContext$1(mediaQueryContext); + complex = t4.selector.withAdditionalCombinators$1(t2); + if (complex.accept$1(B.C__IsUselessVisitor0)) + continue; + if (result == null) + result = A._setArrayType([], t3); + result.push(complex); + } + return result; + } + extenderPaths = A.paths0(options, type$.Extender_2); + t3 = A._setArrayType([], type$.JSArray_ComplexSelector_2); + t1 = t1 === B.ExtendMode_replace_replace0; + t4 = !t1; + if (t4) + t3.push(A.ComplexSelector$0(B.List_empty14, A._setArrayType([new A.ComplexSelectorComponent0(A.CompoundSelector$0(J.expand$1$1$ax(J.get$first$ax(extenderPaths), new A.ExtensionStore__extendCompound_closure2(), t11), t2.span), A.List_List$unmodifiable(component.combinators, t6), t10)], t7), t10, false)); + t2 = J.skip$1$ax(extenderPaths, t1 ? 0 : 1); + t5 = A._instanceType(t2); + t2 = new A.ListIterator(t2, t2.get$length(t2), t5._eval$1("ListIterator")); + t6 = component.combinators; + t5 = t5._eval$1("ListIterable.E"); + for (; t2.moveNext$0();) { + t1 = t2.__internal$_current; + extended = _this._extension_store$_unifyExtenders$3(t1 == null ? t5._as(t1) : t1, mediaQueryContext, t10); + if (extended == null) + continue; + for (t1 = J.get$iterator$ax(extended); t1.moveNext$0();) { + withCombinators = t1.get$current(t1).withAdditionalCombinators$1(t6); + if (!withCombinators.accept$1(B.C__IsUselessVisitor0)) + t3.push(withCombinators); + } + } + isOriginal = new A.ExtensionStore__extendCompound_closure3(); + return _this._extension_store$_trim$2(t3, inOriginal && t4 ? new A.ExtensionStore__extendCompound_closure4(B.JSArray_methods.get$first(t3)) : isOriginal); + }, + _extension_store$_unifyExtenders$3(extenders, mediaQueryContext, span) { + var t1, t2, t3, originals, originalsLineBreak, t4, complexes, _null = null, + toUnify = A.QueueList$(_null, type$.ComplexSelector_2); + for (t1 = J.getInterceptor$ax(extenders), t2 = t1.get$iterator(extenders), t3 = type$.JSArray_SimpleSelector_2, originals = _null, originalsLineBreak = false; t2.moveNext$0();) { + t4 = t2.get$current(t2); + if (t4.isOriginal) { + if (originals == null) + originals = A._setArrayType([], t3); + t4 = t4.selector; + B.JSArray_methods.addAll$1(originals, B.JSArray_methods.get$last(t4.components).selector.components); + originalsLineBreak = originalsLineBreak || t4.lineBreak; + } else { + t4 = t4.selector; + if (t4.accept$1(B.C__IsUselessVisitor0)) + return _null; + else + toUnify._queue_list$_add$1(t4); + } + } + if (originals != null) + toUnify.addFirst$1(A.ComplexSelector$0(B.List_empty14, A._setArrayType([new A.ComplexSelectorComponent0(A.CompoundSelector$0(originals, span), A.List_List$unmodifiable(B.List_empty14, type$.CssValue_Combinator_2), span)], type$.JSArray_ComplexSelectorComponent_2), span, originalsLineBreak)); + complexes = A.unifyComplex0(toUnify, span); + if (complexes == null) + return _null; + for (t1 = t1.get$iterator(extenders); t1.moveNext$0();) + t1.get$current(t1).assertCompatibleMediaContext$1(mediaQueryContext); + return complexes; + }, + _extension_store$_extendSimple$4(simple, extensions, mediaQueryContext, targetsUsed) { + var _1_0, + t1 = new A.ExtensionStore__extendSimple_withoutPseudo0(this, extensions, targetsUsed); + if (simple instanceof A.PseudoSelector0 && simple.selector != null && true) { + _1_0 = this._extension_store$_extendPseudo$3(simple, extensions, mediaQueryContext); + if (_1_0 != null) + return new A.MappedListIterable(_1_0, new A.ExtensionStore__extendSimple_closure1(this, t1), A._arrayInstanceType(_1_0)._eval$1("MappedListIterable<1,List>")); + } + return A.NullableExtension_andThen0(t1.call$1(simple), new A.ExtensionStore__extendSimple_closure2()); + }, + _extension_store$_extenderForSimple$1(simple) { + var t1 = simple.span; + t1 = A.ComplexSelector$0(B.List_empty14, A._setArrayType([new A.ComplexSelectorComponent0(A.CompoundSelector$0(A._setArrayType([simple], type$.JSArray_SimpleSelector_2), t1), A.List_List$unmodifiable(B.List_empty14, type$.CssValue_Combinator_2), t1)], type$.JSArray_ComplexSelectorComponent_2), t1, false); + this._extension_store$_sourceSpecificity.$index(0, simple); + return new A.Extender0(t1, true); + }, + _extension_store$_extendPseudo$3(pseudo, extensions, mediaQueryContext) { + var extended, complexes, t1, result, + selector = pseudo.selector; + if (selector == null) + throw A.wrapException(A.ArgumentError$("Selector " + pseudo.toString$0(0) + " must have a selector argument.", null)); + extended = this._extension_store$_extendList$3(selector, extensions, mediaQueryContext); + if (extended === selector) + return null; + complexes = extended.components; + t1 = pseudo.normalizedName === "not"; + if (t1 && !B.JSArray_methods.any$1(selector.components, new A.ExtensionStore__extendPseudo_closure4()) && B.JSArray_methods.any$1(complexes, new A.ExtensionStore__extendPseudo_closure5())) + complexes = new A.WhereIterable(complexes, new A.ExtensionStore__extendPseudo_closure6(), A._arrayInstanceType(complexes)._eval$1("WhereIterable<1>")); + complexes = J.expand$1$1$ax(complexes, new A.ExtensionStore__extendPseudo_closure7(pseudo), type$.ComplexSelector_2); + if (t1 && selector.components.length === 1) { + t1 = A.MappedIterable_MappedIterable(complexes, new A.ExtensionStore__extendPseudo_closure8(pseudo, selector), complexes.$ti._eval$1("Iterable.E"), type$.PseudoSelector_2); + result = A.List_List$of(t1, true, A._instanceType(t1)._eval$1("Iterable.E")); + return result.length === 0 ? null : result; + } else + return A._setArrayType([pseudo.withSelector$1(A.SelectorList$0(complexes, selector.span))], type$.JSArray_PseudoSelector_2); + }, + _extension_store$_trim$2(selectors, isOriginal) { + var result, i, t1, t2, numOriginals, _box_0, complex1, j, t3, t4, _i, t5, maxSpecificity; + if (selectors.length > 100) + return selectors; + result = A.QueueList$(null, type$.ComplexSelector_2); + $label0$0: + for (i = selectors.length - 1, t1 = A._arrayInstanceType(selectors), t2 = t1._precomputed1, t1 = t1._eval$1("SubListIterable<1>"), numOriginals = 0; i >= 0; --i) { + _box_0 = {}; + complex1 = selectors[i]; + if (isOriginal.call$1(complex1)) { + for (j = 0; j < numOriginals; ++j) + if (J.$eq$(result.$index(0, j), complex1)) { + A.rotateSlice0(result, 0, j + 1); + continue $label0$0; + } + ++numOriginals; + result.addFirst$1(complex1); + continue $label0$0; + } + _box_0.maxSpecificity = 0; + for (t3 = complex1.components, t4 = t3.length, _i = 0, t5 = 0; _i < t4; ++_i, t5 = maxSpecificity) { + maxSpecificity = Math.max(t5, this._extension_store$_sourceSpecificityFor$1(t3[_i].selector)); + _box_0.maxSpecificity = maxSpecificity; + } + if (result.any$1(result, new A.ExtensionStore__trim_closure1(_box_0, complex1))) + continue $label0$0; + t3 = new A.SubListIterable(selectors, 0, i, t1); + t3.SubListIterable$3(selectors, 0, i, t2); + if (t3.any$1(0, new A.ExtensionStore__trim_closure2(_box_0, complex1))) + continue $label0$0; + result.addFirst$1(complex1); + } + return result; + }, + _extension_store$_sourceSpecificityFor$1(compound) { + var t1, t2, t3, specificity, _i, t4; + for (t1 = compound.components, t2 = t1.length, t3 = this._extension_store$_sourceSpecificity, specificity = 0, _i = 0; _i < t2; ++_i) { + t4 = t3.$index(0, t1[_i]); + specificity = Math.max(specificity, A.checkNum(t4 == null ? 0 : t4)); + } + return specificity; + }, + clone$0() { + var t2, t3, t4, _this = this, + t1 = type$.SimpleSelector_2, + newSelectors = A.LinkedHashMap_LinkedHashMap$_empty(t1, type$.Set_ModifiableBox_SelectorList_2), + newMediaContexts = A.LinkedHashMap_LinkedHashMap$_empty(type$.ModifiableBox_SelectorList_2, type$.List_CssMediaQuery_2), + oldToNewSelectors = new A.JsIdentityLinkedHashMap(type$.JsIdentityLinkedHashMap_of_SelectorList_and_Box_SelectorList_2); + _this._extension_store$_selectors.forEach$1(0, new A.ExtensionStore_clone_closure0(_this, newSelectors, oldToNewSelectors, newMediaContexts)); + t2 = type$.Extension_2; + t3 = A.copyMapOfMap0(_this._extension_store$_extensions, t1, type$.ComplexSelector_2, t2); + t2 = A.copyMapOfList0(_this._extension_store$_extensionsByExtender, t1, t2); + t1 = new A.JsIdentityLinkedHashMap(type$.JsIdentityLinkedHashMap_SimpleSelector_int_2); + t1.addAll$1(0, _this._extension_store$_sourceSpecificity); + t4 = new A._LinkedIdentityHashSet(type$._LinkedIdentityHashSet_ComplexSelector_2); + t4.addAll$1(0, _this._extension_store$_originals); + return new A._Record_2(new A.ExtensionStore0(newSelectors, t3, t2, newMediaContexts, t1, t4, B.ExtendMode_normal_normal0), oldToNewSelectors); + }, + get$_extension_store$_extensions() { + return this._extension_store$_extensions; + }, + get$_extension_store$_sourceSpecificity() { + return this._extension_store$_sourceSpecificity; + } + }; + A.ExtensionStore_extensionsWhereTarget_closure0.prototype = { + call$1(extension) { + return !extension.isOptional; + }, + $signature: 435 + }; + A.ExtensionStore__registerSelector_closure0.prototype = { + call$0() { + return A.LinkedHashSet_LinkedHashSet$_empty(type$.ModifiableBox_SelectorList_2); + }, + $signature: 436 + }; + A.ExtensionStore_addExtension_closure2.prototype = { + call$0() { + return A.LinkedHashMap_LinkedHashMap$_empty(type$.ComplexSelector_2, type$.Extension_2); + }, + $signature: 123 + }; + A.ExtensionStore_addExtension_closure3.prototype = { + call$0() { + return A._setArrayType([], type$.JSArray_Extension_2); + }, + $signature: 225 + }; + A.ExtensionStore_addExtension_closure4.prototype = { + call$0() { + return this.complex.get$specificity(); + }, + $signature: 10 + }; + A.ExtensionStore__extendExistingExtensions_closure1.prototype = { + call$0() { + return A._setArrayType([], type$.JSArray_Extension_2); + }, + $signature: 225 + }; + A.ExtensionStore__extendExistingExtensions_closure2.prototype = { + call$0() { + return A.LinkedHashMap_LinkedHashMap$_empty(type$.ComplexSelector_2, type$.Extension_2); + }, + $signature: 123 + }; + A.ExtensionStore_addExtensions_closure0.prototype = { + call$0() { + return A.LinkedHashMap_LinkedHashMap$_empty(type$.ComplexSelector_2, type$.Extension_2); + }, + $signature: 123 + }; + A.ExtensionStore__extendComplex_closure0.prototype = { + call$1(path) { + var t1 = this.complex; + return J.map$1$1$ax(A.weave0(path, t1.span, t1.lineBreak), new A.ExtensionStore__extendComplex__closure0(this._box_0, this.$this, t1), type$.ComplexSelector_2); + }, + $signature: 439 + }; + A.ExtensionStore__extendComplex__closure0.prototype = { + call$1(outputComplex) { + var _this = this, + t1 = _this._box_0; + if (t1.first && _this.$this._extension_store$_originals.contains$1(0, _this.complex)) + _this.$this._extension_store$_originals.add$1(0, outputComplex); + t1.first = false; + return outputComplex; + }, + $signature: 63 + }; + A.ExtensionStore__extendCompound_closure2.prototype = { + call$1(extender) { + return B.JSArray_methods.get$last(extender.selector.components).selector.components; + }, + $signature: 441 + }; + A.ExtensionStore__extendCompound_closure3.prototype = { + call$1(_) { + return false; + }, + $signature: 16 + }; + A.ExtensionStore__extendCompound_closure4.prototype = { + call$1(complex) { + return complex.$eq(0, this.original); + }, + $signature: 16 + }; + A.ExtensionStore__extendSimple_withoutPseudo0.prototype = { + call$1(simple) { + var t1, t2, + extensionsForSimple = this.extensions.$index(0, simple); + if (extensionsForSimple == null) + return null; + t1 = this.targetsUsed; + if (t1 != null) + t1.add$1(0, simple); + t1 = A._setArrayType([], type$.JSArray_Extender_2); + t2 = this.$this; + if (t2._extension_store$_mode !== B.ExtendMode_replace_replace0) + t1.push(t2._extension_store$_extenderForSimple$1(simple)); + for (t2 = extensionsForSimple.get$values(extensionsForSimple), t2 = t2.get$iterator(t2); t2.moveNext$0();) + t1.push(t2.get$current(t2).extender); + return t1; + }, + $signature: 442 + }; + A.ExtensionStore__extendSimple_closure1.prototype = { + call$1(pseudo) { + var t1 = this.withoutPseudo.call$1(pseudo); + return t1 == null ? A._setArrayType([this.$this._extension_store$_extenderForSimple$1(pseudo)], type$.JSArray_Extender_2) : t1; + }, + $signature: 443 + }; + A.ExtensionStore__extendSimple_closure2.prototype = { + call$1(result) { + return A._setArrayType([result], type$.JSArray_List_Extender_2); + }, + $signature: 444 + }; + A.ExtensionStore__extendPseudo_closure4.prototype = { + call$1(complex) { + return complex.components.length > 1; + }, + $signature: 16 + }; + A.ExtensionStore__extendPseudo_closure5.prototype = { + call$1(complex) { + return complex.components.length === 1; + }, + $signature: 16 + }; + A.ExtensionStore__extendPseudo_closure6.prototype = { + call$1(complex) { + return complex.components.length <= 1; + }, + $signature: 16 + }; + A.ExtensionStore__extendPseudo_closure7.prototype = { + call$1(complex) { + var innerPseudo, innerSelector, + t1 = complex.get$singleCompound(); + if (t1 == null) + innerPseudo = null; + else { + t1 = t1.components; + innerPseudo = t1.length === 1 ? B.JSArray_methods.get$first(t1) : null; + } + if (!(innerPseudo instanceof A.PseudoSelector0)) + return A._setArrayType([complex], type$.JSArray_ComplexSelector_2); + innerSelector = innerPseudo.selector; + if (innerSelector == null) + return A._setArrayType([complex], type$.JSArray_ComplexSelector_2); + t1 = this.pseudo; + switch (t1.normalizedName) { + case "not": + if (!B.Set_aAXJu.contains$1(0, innerPseudo.normalizedName)) + return A._setArrayType([], type$.JSArray_ComplexSelector_2); + return innerSelector.components; + case "is": + case "matches": + case "where": + case "any": + case "current": + case "nth-child": + case "nth-last-child": + if (innerPseudo.name !== t1.name) + return A._setArrayType([], type$.JSArray_ComplexSelector_2); + if (innerPseudo.argument != t1.argument) + return A._setArrayType([], type$.JSArray_ComplexSelector_2); + return innerSelector.components; + case "has": + case "host": + case "host-context": + case "slotted": + return A._setArrayType([complex], type$.JSArray_ComplexSelector_2); + default: + return A._setArrayType([], type$.JSArray_ComplexSelector_2); + } + }, + $signature: 445 + }; + A.ExtensionStore__extendPseudo_closure8.prototype = { + call$1(complex) { + return this.pseudo.withSelector$1(A.SelectorList$0(A._setArrayType([complex], type$.JSArray_ComplexSelector_2), this.selector.span)); + }, + $signature: 446 + }; + A.ExtensionStore__trim_closure1.prototype = { + call$1(complex2) { + return complex2.get$specificity() >= this._box_0.maxSpecificity && complex2.isSuperselector$1(this.complex1); + }, + $signature: 16 + }; + A.ExtensionStore__trim_closure2.prototype = { + call$1(complex2) { + return complex2.get$specificity() >= this._box_0.maxSpecificity && complex2.isSuperselector$1(this.complex1); + }, + $signature: 16 + }; + A.ExtensionStore_clone_closure0.prototype = { + call$2(simple, selectors) { + var t2, t3, t4, t5, t6, t7, newSelector, _0_0, _this = this, + t1 = type$.ModifiableBox_SelectorList_2, + newSelectorSet = A.LinkedHashSet_LinkedHashSet$_empty(t1); + _this.newSelectors.$indexSet(0, simple, newSelectorSet); + for (t2 = selectors.get$iterator(selectors), t3 = _this.oldToNewSelectors, t4 = type$.Box_SelectorList_2, t5 = _this.$this._extension_store$_mediaContexts, t6 = _this.newMediaContexts; t2.moveNext$0();) { + t7 = t2.get$current(t2); + newSelector = new A.ModifiableBox0(t7.value, t1); + newSelectorSet.add$1(0, newSelector); + t3.$indexSet(0, t7.value, new A.Box0(newSelector, t4)); + _0_0 = t5.$index(0, t7); + if (_0_0 != null) + t6.$indexSet(0, newSelector, _0_0); + } + }, + $signature: 447 + }; + A.FiberClass.prototype = {}; + A.Fiber.prototype = {}; + A.JSToDartFileImporter.prototype = { + canonicalize$1(_, url) { + var result, t1, resultUrl; + if (url.get$scheme() === "file") + return $.$get$FilesystemImporter_cwd0().canonicalize$1(0, url); + result = A.wrapJSExceptions(new A.JSToDartFileImporter_canonicalize_closure(this, url)); + if (result == null) + return null; + t1 = self.Promise; + if (result instanceof t1) + A.jsThrow(new self.Error("The findFileUrl() function can't return a Promise for synchron compile functions.")); + else { + t1 = self.URL; + if (!(result instanceof t1)) + A.jsThrow(new self.Error(string$.The_fie)); + } + resultUrl = A.Uri_parse(J.toString$0$(type$.JSUrl._as(result))); + if (resultUrl.get$scheme() !== "file") + A.jsThrow(new self.Error(string$.The_fiu + url.toString$0(0) + '".')); + return $.$get$FilesystemImporter_cwd0().canonicalize$1(0, resultUrl); + }, + load$1(_, url) { + return $.$get$FilesystemImporter_cwd0().load$1(0, url); + }, + isNonCanonicalScheme$1(scheme) { + return scheme !== "file"; + } + }; + A.JSToDartFileImporter_canonicalize_closure.prototype = { + call$0() { + return this.$this._file0$_findFileUrl.call$2(this.url.toString$0(0), {fromImport: A.fromImport0(), containingUrl: A.NullableExtension_andThen0(A.containingUrl0(), A.utils1__dartToJSUrl$closure())}); + }, + $signature: 35 + }; + A.FilesystemImporter0.prototype = { + canonicalize$1(_, url) { + if (url.get$scheme() !== "file" && url.get$scheme() !== "") + return null; + return A.NullableExtension_andThen0(A.resolveImportPath0(A.join(this._filesystem$_loadPath, $.$get$context().style.pathFromUri$1(A._parseUri(url)), null)), new A.FilesystemImporter_canonicalize_closure0()); + }, + load$1(_, url) { + var path = $.$get$context().style.pathFromUri$1(A._parseUri(url)); + return A.ImporterResult$(A.readFile0(path), url, A.Syntax_forPath0(path)); + }, + toString$0(_) { + return this._filesystem$_loadPath; + } + }; + A.FilesystemImporter_canonicalize_closure0.prototype = { + call$1(resolved) { + var t2, t0, _null = null, + t1 = A.isNodeJs() ? self.process : _null; + if (!J.$eq$(t1 == null ? _null : J.get$platform$x(t1), "win32")) { + t1 = A.isNodeJs() ? self.process : _null; + t1 = J.$eq$(t1 == null ? _null : J.get$platform$x(t1), "darwin"); + } else + t1 = true; + if (t1) { + t1 = $.$get$context(); + t2 = A._realCasePath0(A.absolute(t1.normalize$1(resolved), _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null)); + t0 = t2; + t2 = t1; + t1 = t0; + } else { + t1 = $.$get$context(); + t2 = t1.canonicalize$1(0, resolved); + t0 = t2; + t2 = t1; + t1 = t0; + } + return t2.toUri$1(t1); + }, + $signature: 152 + }; + A.ForRule0.prototype = { + accept$1$1(visitor) { + return visitor.visitForRule$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + toString$0(_) { + var _this = this, + t1 = _this.from.toString$0(0), + t2 = _this.isExclusive ? "to" : "through", + t3 = _this.children; + return "@for $" + _this.variable + " from " + t1 + " " + t2 + " " + _this.to.toString$0(0) + " {" + (t3 && B.JSArray_methods).join$1(t3, " ") + "}"; + }, + get$span(receiver) { + return this.span; + } + }; + A.ForwardRule0.prototype = { + accept$1$1(visitor) { + return visitor.visitForwardRule$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + toString$0(_) { + var t2, prefix, _this = this, + t1 = "@forward " + A.StringExpression_quoteText0(_this.url.toString$0(0)), + shownMixinsAndFunctions = _this.shownMixinsAndFunctions, + hiddenMixinsAndFunctions = _this.hiddenMixinsAndFunctions; + if (shownMixinsAndFunctions != null) { + t2 = _this.shownVariables; + t2.toString; + t2 = t1 + " show " + _this._forward_rule0$_memberList$2(shownMixinsAndFunctions, t2); + t1 = t2; + } else if (hiddenMixinsAndFunctions != null && hiddenMixinsAndFunctions._base.get$isNotEmpty(0)) { + t2 = _this.hiddenVariables; + t2.toString; + t2 = t1 + " hide " + _this._forward_rule0$_memberList$2(hiddenMixinsAndFunctions, t2); + t1 = t2; + } + prefix = _this.prefix; + if (prefix != null) + t1 += " as " + prefix + "*"; + t2 = _this.configuration; + t1 = (t2.length !== 0 ? t1 + (" with (" + B.JSArray_methods.join$1(t2, ", ") + ")") : t1) + ";"; + return t1.charCodeAt(0) == 0 ? t1 : t1; + }, + _forward_rule0$_memberList$2(mixinsAndFunctions, variables) { + var t2, + t1 = A.List_List$of(mixinsAndFunctions, true, type$.String); + for (t2 = variables._base.get$iterator(0); t2.moveNext$0();) + t1.push("$" + t2.get$current(0)); + return B.JSArray_methods.join$1(t1, ", "); + }, + $isAstNode0: 1, + $isStatement0: 1, + get$span(receiver) { + return this.span; + } + }; + A.ForwardedModuleView0.prototype = { + get$url(_) { + var t1 = this._forwarded_view0$_inner; + return t1.get$url(t1); + }, + get$upstream() { + return this._forwarded_view0$_inner.get$upstream(); + }, + get$extensionStore() { + return this._forwarded_view0$_inner.get$extensionStore(); + }, + get$css(_) { + var t1 = this._forwarded_view0$_inner; + return t1.get$css(t1); + }, + get$preModuleComments() { + return this._forwarded_view0$_inner.get$preModuleComments(); + }, + get$transitivelyContainsCss() { + return this._forwarded_view0$_inner.get$transitivelyContainsCss(); + }, + get$transitivelyContainsExtensions() { + return this._forwarded_view0$_inner.get$transitivelyContainsExtensions(); + }, + setVariable$3($name, value, nodeWithSpan) { + var t2, _1_0, _2_0, + _s19_ = "Undefined variable.", + t1 = this._forwarded_view0$_rule, + _0_0 = t1.shownVariables; + if (_0_0 != null) + t2 = !_0_0._base.contains$1(0, $name); + else + t2 = false; + if (t2) + throw A.wrapException(A.SassScriptException$0(_s19_, null)); + else { + _1_0 = t1.hiddenVariables; + if (_1_0 != null) + t2 = _1_0._base.contains$1(0, $name); + else + t2 = false; + if (t2) + throw A.wrapException(A.SassScriptException$0(_s19_, null)); + } + _2_0 = t1.prefix; + if (_2_0 != null) { + if (!B.JSString_methods.startsWith$1($name, _2_0)) + throw A.wrapException(A.SassScriptException$0(_s19_, null)); + $name = B.JSString_methods.substring$1($name, _2_0.length); + } + return this._forwarded_view0$_inner.setVariable$3($name, value, nodeWithSpan); + }, + variableIdentity$1($name) { + var _0_0 = this._forwarded_view0$_rule.prefix; + if (_0_0 != null) + $name = B.JSString_methods.substring$1($name, _0_0.length); + return this._forwarded_view0$_inner.variableIdentity$1($name); + }, + $eq(_, other) { + if (other == null) + return false; + return other instanceof A.ForwardedModuleView0 && this._forwarded_view0$_inner.$eq(0, other._forwarded_view0$_inner) && this._forwarded_view0$_rule === other._forwarded_view0$_rule; + }, + get$hashCode(_) { + var t1 = this._forwarded_view0$_inner; + return (t1.get$hashCode(t1) ^ A.Primitives_objectHashCode(this._forwarded_view0$_rule)) >>> 0; + }, + cloneCss$0() { + return A.ForwardedModuleView$0(this._forwarded_view0$_inner.cloneCss$0(), this._forwarded_view0$_rule, this.$ti._precomputed1); + }, + toString$0(_) { + return "forwarded " + this._forwarded_view0$_inner.toString$0(0); + }, + $isModule1: 1, + get$variables() { + return this.variables; + }, + get$variableNodes() { + return this.variableNodes; + }, + get$functions(receiver) { + return this.functions; + }, + get$mixins() { + return this.mixins; + } + }; + A.FunctionExpression0.prototype = { + get$name(_) { + return A.stringReplaceAllUnchecked(this.originalName, "_", "-"); + }, + accept$1$1(visitor) { + return visitor.visitFunctionExpression$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + toString$0(_) { + var t1 = this.namespace; + t1 = t1 != null ? "" + (t1 + ".") : ""; + t1 += this.originalName + this.$arguments.toString$0(0); + return t1.charCodeAt(0) == 0 ? t1 : t1; + }, + $isExpression0: 1, + $isAstNode0: 1, + get$span(receiver) { + return this.span; + } + }; + A.JSFunction0.prototype = {}; + A.SupportsFunction0.prototype = { + toString$0(_) { + return this.name.toString$0(0) + "(" + this.$arguments.toString$0(0) + ")"; + }, + $isAstNode0: 1, + get$span(receiver) { + return this.span; + } + }; + A.functionClass_closure.prototype = { + call$0() { + var t1 = type$.JSClass, + jsClass = t1._as(A.allowInteropCaptureThisNamed("sass.SassFunction", new A.functionClass__closure())); + A.JSClassExtension_injectSuperclass(t1._as(new A.SassFunction0(A.BuiltInCallable$function0("f", "", new A.functionClass__closure0(), null)).constructor), jsClass); + return jsClass; + }, + $signature: 13 + }; + A.functionClass__closure.prototype = { + call$3($self, signature, callback) { + var paren = B.JSString_methods.indexOf$1(signature, "("); + if (paren === -1 || !B.JSString_methods.endsWith$1(signature, ")")) + A.jsThrow(new self.Error('Invalid signature for new sass.SassFunction(): "' + signature + '"')); + return new A.SassFunction0(A.BuiltInCallable$function0(B.JSString_methods.substring$2(signature, 0, paren), B.JSString_methods.substring$2(signature, paren + 1, signature.length - 1), callback, null)); + }, + "call*": "call$3", + $requiredArgCount: 3, + $signature: 448 + }; + A.functionClass__closure0.prototype = { + call$1(_) { + return B.C__SassNull0; + }, + $signature: 3 + }; + A.SassFunction0.prototype = { + accept$1$1(visitor) { + var t1, t2; + if (!visitor._serialize0$_inspect) + A.throwExpression(A.SassScriptException$0(this.toString$0(0) + " isn't a valid CSS value.", null)); + t1 = visitor._serialize0$_buffer; + t1.write$1(0, "get-function("); + t2 = this.callable; + visitor._serialize0$_visitQuotedString$1(t2.get$name(t2)); + t1.writeCharCode$1(41); + return null; + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + assertFunction$1($name) { + return this; + }, + $eq(_, other) { + if (other == null) + return false; + return other instanceof A.SassFunction0 && this.callable.$eq(0, other.callable); + }, + get$hashCode(_) { + var t1 = this.callable; + return t1.get$hashCode(t1); + } + }; + A.FunctionRule0.prototype = { + accept$1$1(visitor) { + return visitor.visitFunctionRule$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + toString$0(_) { + var t1 = this.children; + return "@function " + this.name + "(" + this.$arguments.toString$0(0) + ") {" + (t1 && B.JSArray_methods).join$1(t1, " ") + "}"; + } + }; + A.unifyComplex_closure0.prototype = { + call$1(complex) { + return complex.lineBreak; + }, + $signature: 16 + }; + A._weaveParents_closure3.prototype = { + call$2(group1, group2) { + var t1, unified; + if (B.C_ListEquality.equals$2(0, group1, group2)) + return group1; + if (A._complexIsParentSuperselector0(group1, group2)) + return group2; + if (A._complexIsParentSuperselector0(group2, group1)) + return group1; + if (!A._mustUnify0(group1, group2)) + return null; + t1 = this.span; + unified = A.unifyComplex0(A._setArrayType([A.ComplexSelector$0(B.List_empty14, group1, t1, false), A.ComplexSelector$0(B.List_empty14, group2, t1, false)], type$.JSArray_ComplexSelector_2), t1); + if (unified == null) + t1 = null; + else { + t1 = A.IterableExtension_get_singleOrNull(unified); + t1 = t1 == null ? null : t1.components; + } + return t1; + }, + $signature: 449 + }; + A._weaveParents_closure4.prototype = { + call$1(sequence) { + return A._complexIsParentSuperselector0(sequence.get$first(sequence), this.group); + }, + $signature: 220 + }; + A._weaveParents_closure5.prototype = { + call$1(sequence) { + return sequence.get$length(0) === 0; + }, + $signature: 220 + }; + A._weaveParents_closure6.prototype = { + call$1(choice) { + return J.get$isNotEmpty$asx(choice); + }, + $signature: 451 + }; + A._mustUnify_closure0.prototype = { + call$1(component) { + return B.JSArray_methods.any$1(component.selector.components, new A._mustUnify__closure0(this.uniqueSelectors)); + }, + $signature: 51 + }; + A._mustUnify__closure0.prototype = { + call$1(simple) { + var t1; + if (!(simple instanceof A.IDSelector0)) + t1 = simple instanceof A.PseudoSelector0 && !simple.isClass; + else + t1 = true; + return t1 && this.uniqueSelectors.contains$1(0, simple); + }, + $signature: 14 + }; + A.paths_closure0.prototype = { + call$2(paths, choice) { + var t1 = this.T; + t1 = J.expand$1$1$ax(choice, new A.paths__closure0(paths, t1), t1._eval$1("List<0>")); + return A.List_List$of(t1, true, t1.$ti._eval$1("Iterable.E")); + }, + $signature() { + return this.T._eval$1("List>(List>,List<0>)"); + } + }; + A.paths__closure0.prototype = { + call$1(option) { + var t1 = this.T; + return J.map$1$1$ax(this.paths, new A.paths___closure0(option, t1), t1._eval$1("List<0>")); + }, + $signature() { + return this.T._eval$1("Iterable>(0)"); + } + }; + A.paths___closure0.prototype = { + call$1(path) { + var t1 = A.List_List$of(path, true, this.T); + t1.push(this.option); + return t1; + }, + $signature() { + return this.T._eval$1("List<0>(List<0>)"); + } + }; + A.listIsSuperselector_closure0.prototype = { + call$1(complex1) { + return B.JSArray_methods.any$1(this.list1, new A.listIsSuperselector__closure0(complex1)); + }, + $signature: 16 + }; + A.listIsSuperselector__closure0.prototype = { + call$1(complex2) { + return complex2.isSuperselector$1(this.complex1); + }, + $signature: 16 + }; + A.complexIsSuperselector_closure1.prototype = { + call$1($parent) { + return $parent.combinators.length > 1; + }, + $signature: 51 + }; + A.complexIsSuperselector_closure2.prototype = { + call$1(component) { + return A._isSupercombinator0(this.combinator1, A.IterableExtension_get_firstOrNull(component.combinators)); + }, + $signature: 51 + }; + A._compatibleWithPreviousCombinator_closure0.prototype = { + call$1(component) { + var t1 = component.combinators, + t2 = A.IterableExtension_get_firstOrNull(t1); + if (!J.$eq$(t2 == null ? null : t2.value, B.Combinator_Htt0)) { + t1 = A.IterableExtension_get_firstOrNull(t1); + t1 = J.$eq$(t1 == null ? null : t1.value, B.Combinator_4QF0); + } else + t1 = true; + return t1; + }, + $signature: 51 + }; + A._selectorPseudoIsSuperselector_closure6.prototype = { + call$1(selector2) { + return A.listIsSuperselector0(this.selector1.components, selector2.components); + }, + $signature: 72 + }; + A._selectorPseudoIsSuperselector_closure7.prototype = { + call$1(complex1) { + var t1, t2; + if (complex1.leadingCombinators.length === 0) { + t1 = A._setArrayType([], type$.JSArray_ComplexSelectorComponent_2); + t2 = this.parents; + if (t2 != null) + B.JSArray_methods.addAll$1(t1, t2); + t2 = this.compound2; + t1.push(new A.ComplexSelectorComponent0(t2, A.List_List$unmodifiable(B.List_empty14, type$.CssValue_Combinator_2), t2.span)); + t1 = A.complexIsSuperselector0(complex1.components, t1); + } else + t1 = false; + return t1; + }, + $signature: 16 + }; + A._selectorPseudoIsSuperselector_closure8.prototype = { + call$1(selector2) { + return A.listIsSuperselector0(this.selector1.components, selector2.components); + }, + $signature: 72 + }; + A._selectorPseudoIsSuperselector_closure9.prototype = { + call$1(selector2) { + return A.listIsSuperselector0(this.selector1.components, selector2.components); + }, + $signature: 72 + }; + A._selectorPseudoIsSuperselector_closure10.prototype = { + call$1(complex) { + if (complex.accept$1(B._IsBogusVisitor_true0)) + return false; + return B.JSArray_methods.any$1(this.compound2.components, new A._selectorPseudoIsSuperselector__closure0(complex, this.pseudo1)); + }, + $signature: 16 + }; + A._selectorPseudoIsSuperselector__closure0.prototype = { + call$1(simple2) { + var t1, _0_4, selector2, _this = this; + $label0$1: { + if (simple2 instanceof A.TypeSelector0) { + t1 = B.JSArray_methods.any$1(B.JSArray_methods.get$last(_this.complex.components).selector.components, new A._selectorPseudoIsSuperselector___closure1(simple2)); + break $label0$1; + } + if (simple2 instanceof A.IDSelector0) { + t1 = B.JSArray_methods.any$1(B.JSArray_methods.get$last(_this.complex.components).selector.components, new A._selectorPseudoIsSuperselector___closure2(simple2)); + break $label0$1; + } + if (simple2 instanceof A.PseudoSelector0) { + _0_4 = simple2.selector; + if (_0_4 != null) { + selector2 = _0_4 == null ? type$.SelectorList_2._as(_0_4) : _0_4; + t1 = simple2.name === _this.pseudo1.name; + } else { + selector2 = null; + t1 = false; + } + } else { + selector2 = null; + t1 = false; + } + if (t1) { + t1 = A.listIsSuperselector0(selector2.components, A._setArrayType([_this.complex], type$.JSArray_ComplexSelector_2)); + break $label0$1; + } + t1 = false; + break $label0$1; + } + return t1; + }, + $signature: 14 + }; + A._selectorPseudoIsSuperselector___closure1.prototype = { + call$1(simple1) { + var t1; + if (simple1 instanceof A.TypeSelector0) { + t1 = this.simple2; + t1 = !(t1 instanceof A.TypeSelector0 && t1.name.$eq(0, simple1.name)); + } else + t1 = false; + return t1; + }, + $signature: 14 + }; + A._selectorPseudoIsSuperselector___closure2.prototype = { + call$1(simple1) { + var t1; + if (simple1 instanceof A.IDSelector0) { + t1 = this.simple2; + t1 = !(t1 instanceof A.IDSelector0 && t1.name === simple1.name); + } else + t1 = false; + return t1; + }, + $signature: 14 + }; + A._selectorPseudoIsSuperselector_closure11.prototype = { + call$1(selector2) { + var t1 = B.C_ListEquality.equals$2(0, this.selector1.components, selector2.components); + return t1; + }, + $signature: 72 + }; + A._selectorPseudoIsSuperselector_closure12.prototype = { + call$1(pseudo2) { + var t1, selector2; + if (!(pseudo2 instanceof A.PseudoSelector0)) + return false; + t1 = this.pseudo1; + if (pseudo2.name !== t1.name) + return false; + if (pseudo2.argument != t1.argument) + return false; + selector2 = pseudo2.selector; + if (selector2 == null) + return false; + return A.listIsSuperselector0(this.selector1.components, selector2.components); + }, + $signature: 14 + }; + A._selectorPseudoArgs_closure1.prototype = { + call$1(pseudo) { + return pseudo.isClass === this.isClass && pseudo.name === this.name; + }, + $signature: 453 + }; + A._selectorPseudoArgs_closure2.prototype = { + call$1(pseudo) { + return pseudo.selector; + }, + $signature: 454 + }; + A.globalFunctions_closure0.prototype = { + call$1($arguments) { + var t1 = J.getInterceptor$asx($arguments); + return t1.$index($arguments, 0).get$isTruthy() ? t1.$index($arguments, 1) : t1.$index($arguments, 2); + }, + $signature: 3 + }; + A.IDSelector0.prototype = { + get$specificity() { + return A._asInt(Math.pow(A.SimpleSelector0.prototype.get$specificity.call(this), 2)); + }, + accept$1$1(visitor) { + return visitor.visitIDSelector$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + addSuffix$1(suffix) { + return new A.IDSelector0(this.name + suffix, this.span); + }, + unify$1(compound) { + if (B.JSArray_methods.any$1(compound, new A.IDSelector_unify_closure0(this))) + return null; + return this.super$SimpleSelector$unify0(compound); + }, + $eq(_, other) { + if (other == null) + return false; + return other instanceof A.IDSelector0 && other.name === this.name; + }, + get$hashCode(_) { + return B.JSString_methods.get$hashCode(this.name); + } + }; + A.IDSelector_unify_closure0.prototype = { + call$1(simple) { + var t1; + if (simple instanceof A.IDSelector0) + t1 = this.$this.name !== simple.name; + else + t1 = false; + return t1; + }, + $signature: 14 + }; + A.IfExpression0.prototype = { + accept$1$1(visitor) { + return visitor.visitIfExpression$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + toString$0(_) { + return "if" + this.$arguments.toString$0(0); + }, + $isExpression0: 1, + $isAstNode0: 1, + get$span(receiver) { + return this.span; + } + }; + A.IfRule0.prototype = { + accept$1$1(visitor) { + return visitor.visitIfRule$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + toString$0(_) { + var result = A.ListExtensions_mapIndexed(this.clauses, new A.IfRule_toString_closure0(), type$.IfClause_2, type$.String).join$1(0, " "), + lastClause = this.lastClause; + return lastClause != null ? result + (" " + lastClause.toString$0(0)) : result; + }, + $isAstNode0: 1, + $isStatement0: 1, + get$span(receiver) { + return this.span; + } + }; + A.IfRule_toString_closure0.prototype = { + call$2(index, clause) { + var t1 = index === 0 ? "if" : "else if"; + return "@" + t1 + " " + clause.expression.toString$0(0) + " {" + B.JSArray_methods.join$1(clause.children, " ") + "}"; + }, + $signature: 455 + }; + A.IfRuleClause0.prototype = {}; + A.IfRuleClause$__closure0.prototype = { + call$1(child) { + var t1; + $label0$0: { + if (child instanceof A.VariableDeclaration0 || child instanceof A.FunctionRule0 || child instanceof A.MixinRule0) { + t1 = true; + break $label0$0; + } + if (child instanceof A.ImportRule0) { + t1 = B.JSArray_methods.any$1(child.imports, new A.IfRuleClause$___closure0()); + break $label0$0; + } + t1 = false; + break $label0$0; + } + return t1; + }, + $signature: 208 + }; + A.IfRuleClause$___closure0.prototype = { + call$1($import) { + return $import instanceof A.DynamicImport0; + }, + $signature: 207 + }; + A.IfClause0.prototype = { + toString$0(_) { + return "@if " + this.expression.toString$0(0) + " {" + B.JSArray_methods.join$1(this.children, " ") + "}"; + } + }; + A.ElseClause0.prototype = { + toString$0(_) { + return "@else {" + B.JSArray_methods.join$1(this.children, " ") + "}"; + } + }; + A.ImmutableList0.prototype = {}; + A.ImmutableMap0.prototype = {}; + A.immutableMapToDartMap_closure.prototype = { + call$3(value, key, _) { + this.dartMap.$indexSet(0, key, value); + }, + "call*": "call$3", + $requiredArgCount: 3, + $signature: 458 + }; + A.NodeImporter.prototype = { + loadRelative$3(url, previous, forImport) { + var t1, t2, _null = null; + if ($.$get$url().style.rootLength$1(url) > 0) { + if (!B.JSString_methods.startsWith$1(url, "/") && !B.JSString_methods.startsWith$1(url, "file:")) + return _null; + return this._tryPath$2($.$get$context().style.pathFromUri$1(A._parseUri(url)), forImport); + } + if ((previous == null ? _null : previous.get$scheme()) !== "file") + return _null; + t1 = $.$get$context(); + previous.toString; + t2 = t1.style; + return this._tryPath$2(A.join(t1.dirname$1(t2.pathFromUri$1(A._parseUri(previous))), t2.pathFromUri$1(A._parseUri(url)), _null), forImport); + }, + load$3(_, url, previous, forImport) { + var t1, t2, _i, _0_0, _this = this, + previousString = _this._previousToString$1(previous); + for (t1 = _this._implementation$_importers, t2 = t1.length, _i = 0; _i < t2; ++_i) { + _0_0 = A.wrapJSExceptions(new A.NodeImporter_load_closure(_this, t1[_i], forImport, url, previousString)); + if (_0_0 != null) + return _this._handleImportResult$4(url, previous, _0_0, forImport); + } + return _this._resolveLoadPathFromUrl$2(A.Uri_parse(url), forImport); + }, + loadAsync$3(url, previous, forImport) { + return this.loadAsync$body$NodeImporter(url, previous, forImport); + }, + loadAsync$body$NodeImporter(url, previous, forImport) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.nullable_Record_2_String_and_String), + $async$returnValue, $async$self = this, t1, t2, _i, _0_0, previousString; + var $async$loadAsync$3 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + previousString = $async$self._previousToString$1(previous); + t1 = $async$self._implementation$_importers, t2 = t1.length, _i = 0; + case 3: + // for condition + if (!(_i < t2)) { + // goto after for + $async$goto = 5; + break; + } + $async$goto = 6; + return A._asyncAwait($async$self._callImporterAsync$4(t1[_i], url, previousString, forImport), $async$loadAsync$3); + case 6: + // returning from await. + _0_0 = $async$result; + if (_0_0 != null) { + $async$returnValue = $async$self._handleImportResult$4(url, previous, _0_0, forImport); + // goto return + $async$goto = 1; + break; + } + case 4: + // for update + ++_i; + // goto for condition + $async$goto = 3; + break; + case 5: + // after for + $async$returnValue = $async$self._resolveLoadPathFromUrl$2(A.Uri_parse(url), forImport); + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$loadAsync$3, $async$completer); + }, + _previousToString$1(previous) { + var t1; + $label0$0: { + if (previous == null) { + t1 = "stdin"; + break $label0$0; + } + if ("file" === previous.get$scheme()) { + t1 = $.$get$context().style.pathFromUri$1(A._parseUri(previous)); + break $label0$0; + } + t1 = previous.toString$0(0); + break $label0$0; + } + return t1; + }, + _resolveLoadPathFromUrl$2(url, forImport) { + return url.get$scheme() === "" || url.get$scheme() === "file" ? this._resolveLoadPath$2($.$get$context().style.pathFromUri$1(A._parseUri(url)), forImport) : null; + }, + _resolveLoadPath$2(path, forImport) { + var t1, t2, _i, t3, _1_0, _null = null, + _0_0 = this._tryPath$2(A.absolute(path, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null), forImport); + if (_0_0 != null) + return _0_0; + for (t1 = this._includePaths, t2 = t1.length, _i = 0; _i < t2; ++_i) { + t3 = A.join(t1[_i], path, _null); + _1_0 = this._tryPath$2($.$get$context().absolute$15(t3, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null), forImport); + if (_1_0 != null) + return _1_0; + } + return _null; + }, + _tryPath$2(path, forImport) { + var t1; + if (forImport) { + t1 = type$.nullable_Object; + t1 = A.runZoned(new A.NodeImporter__tryPath_closure(path), A.LinkedHashMap_LinkedHashMap$_literal([B.Symbol__inImportRule, true], t1, t1), type$.nullable_String); + } else + t1 = A.resolveImportPath0(path); + return A.NullableExtension_andThen0(t1, new A.NodeImporter__tryPath_closure0()); + }, + _handleImportResult$4(url, previous, value, forImport) { + var t1, file, contents, t2, resolved; + if (value instanceof self.Error) + throw A.wrapException(value); + if (!type$.NodeImporterResult._is(value)) + return null; + t1 = J.getInterceptor$x(value); + file = t1.get$file(value); + contents = t1.get$contents(value); + t1 = contents == null; + t2 = !t1; + if (t2 && A._asString(new self.Function("value", "return typeof value").call$1(contents)) !== "string") + A.jsThrow(new A.ArgumentError(true, contents, "contents", "must be a string but was: " + A.jsType(contents))); + if (file == null) + return new A._Record_2(t1 ? "" : contents, url); + else if (t2) + return new A._Record_2(contents, $.$get$context().toUri$1(file).toString$0(0)); + else { + resolved = this.loadRelative$3($.$get$context().toUri$1(file).toString$0(0), previous, forImport); + if (resolved == null) + resolved = this._resolveLoadPath$2(file, forImport); + if (resolved != null) + return resolved; + throw A.wrapException("Can't find stylesheet to import."); + } + }, + _callImporterAsync$4(importer, url, previousString, forImport) { + return this._callImporterAsync$body$NodeImporter(importer, url, previousString, forImport); + }, + _callImporterAsync$body$NodeImporter(importer, url, previousString, forImport) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.nullable_Object), + $async$returnValue, $async$self = this, t1, result; + var $async$_callImporterAsync$4 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = new A._Future($.Zone__current, type$._Future_Object); + result = A.wrapJSExceptions(new A.NodeImporter__callImporterAsync_closure($async$self, importer, forImport, url, previousString, new A._AsyncCompleter(t1, type$._AsyncCompleter_Object))); + $async$goto = A._asBool($.$get$_isUndefined().call$1(result)) ? 3 : 4; + break; + case 3: + // then + $async$goto = 5; + return A._asyncAwait(t1, $async$_callImporterAsync$4); + case 5: + // returning from await. + $async$returnValue = $async$result; + // goto return + $async$goto = 1; + break; + case 4: + // join + $async$returnValue = result; + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$_callImporterAsync$4, $async$completer); + }, + _renderContext$1(fromImport) { + var context = {options: type$.RenderContextOptions._as(this._implementation$_options), fromImport: fromImport}; + J.set$context$x(J.get$options$x(context), context); + return context; + } + }; + A.NodeImporter_load_closure.prototype = { + call$0() { + var _this = this; + return J.apply$2$x(_this.importer, _this.$this._renderContext$1(_this.forImport), A._setArrayType([_this.url, _this.previousString], type$.JSArray_Object)); + }, + $signature: 35 + }; + A.NodeImporter__tryPath_closure.prototype = { + call$0() { + return A.resolveImportPath0(this.path); + }, + $signature: 45 + }; + A.NodeImporter__tryPath_closure0.prototype = { + call$1(resolved) { + return new A._Record_2(A.readFile0(resolved), $.$get$context().toUri$1(resolved).toString$0(0)); + }, + $signature: 459 + }; + A.NodeImporter__callImporterAsync_closure.prototype = { + call$0() { + var _this = this; + return J.apply$2$x(_this.importer, _this.$this._renderContext$1(_this.forImport), A._setArrayType([_this.url, _this.previousString, A.allowInterop(_this.completer.get$complete())], type$.JSArray_Object)); + }, + $signature: 35 + }; + A.ModifiableCssImport0.prototype = { + accept$1$1(visitor) { + return visitor.visitCssImport$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + get$span(receiver) { + return this.span; + } + }; + A.ImportCache0.prototype = { + canonicalize$4$baseImporter$baseUrl$forImport(_, url, baseImporter, baseUrl, forImport) { + var t1, relativeResult, _this = this; + if (A.isBrowser()) + t1 = (baseImporter == null || baseImporter instanceof A.NoOpImporter0) && _this._import_cache$_importers.length === 0; + else + t1 = false; + if (t1) + throw A.wrapException(string$.Custom); + if (baseImporter != null && url.get$scheme() === "") { + relativeResult = _this._import_cache$_relativeCanonicalizeCache.putIfAbsent$2(new A._Record_4_baseImporter_baseUrl_forImport([url, baseImporter, baseUrl, forImport]), new A.ImportCache_canonicalize_closure1(_this, baseImporter, baseUrl, url, forImport)); + if (relativeResult != null) + return relativeResult; + } + return _this._import_cache$_canonicalizeCache.putIfAbsent$2(new A._Record_2_forImport(url, forImport), new A.ImportCache_canonicalize_closure2(_this, url, baseUrl, forImport)); + }, + _import_cache$_canonicalize$4(importer, url, baseUrl, forImport) { + var passContainingUrl, t1, result, _null = null, + canonicalize = forImport ? new A.ImportCache__canonicalize_closure1(importer, url) : new A.ImportCache__canonicalize_closure2(importer, url); + if (baseUrl != null) + passContainingUrl = url.get$scheme() === "" || importer.isNonCanonicalScheme$1(url.get$scheme()); + else + passContainingUrl = false; + t1 = passContainingUrl ? baseUrl : _null; + result = A.withContainingUrl0(t1, canonicalize, type$.nullable_Uri); + if (result == null) + return _null; + if (result.get$scheme() === "") + A.WarnForDeprecation_warnForDeprecation0(this._import_cache$_logger, B.Deprecation_E5x, "Importer " + importer.toString$0(0) + " canonicalized " + url.toString$0(0) + " to " + result.toString$0(0) + string$.x2e_Rela, _null, _null); + else if (importer.isNonCanonicalScheme$1(result.get$scheme())) + throw A.wrapException("Importer " + importer.toString$0(0) + " canonicalized " + url.toString$0(0) + " to " + result.toString$0(0) + string$.x2c_whicu); + return new A._Record_3_originalUrl(importer, result, url); + }, + importCanonical$4$originalUrl$quiet(importer, canonicalUrl, originalUrl, quiet) { + return this._import_cache$_importCache.putIfAbsent$2(canonicalUrl, new A.ImportCache_importCanonical_closure0(this, importer, canonicalUrl, originalUrl, quiet)); + }, + importCanonical$3$originalUrl(importer, canonicalUrl, originalUrl) { + return this.importCanonical$4$originalUrl$quiet(importer, canonicalUrl, originalUrl, false); + }, + humanize$1(canonicalUrl) { + var t1 = A.IterableNullableExtension_whereNotNull(this._import_cache$_canonicalizeCache.get$values(0), type$.Record_3_Importer_and_Uri_and_Uri_originalUrl_2), + t2 = t1.$ti; + t2 = A.NullableExtension_andThen0(A.minBy(new A.MappedIterable(new A.WhereIterable(t1, new A.ImportCache_humanize_closure3(canonicalUrl), t2._eval$1("WhereIterable")), new A.ImportCache_humanize_closure4(), t2._eval$1("MappedIterable")), new A.ImportCache_humanize_closure5()), new A.ImportCache_humanize_closure6(canonicalUrl)); + return t2 == null ? canonicalUrl : t2; + }, + sourceMapUrl$1(_, canonicalUrl) { + var t1 = this._import_cache$_resultsCache.$index(0, canonicalUrl); + t1 = t1 == null ? null : t1.get$sourceMapUrl(0); + return t1 == null ? canonicalUrl : t1; + } + }; + A.ImportCache_canonicalize_closure1.prototype = { + call$0() { + var _this = this, + t1 = _this.baseUrl, + t2 = t1 == null ? null : t1.resolveUri$1(_this.url); + if (t2 == null) + t2 = _this.url; + return _this.$this._import_cache$_canonicalize$4(_this.baseImporter, t2, t1, _this.forImport); + }, + $signature: 194 + }; + A.ImportCache_canonicalize_closure2.prototype = { + call$0() { + var t1, t2, t3, t4, t5, t6, _i, _0_0, _this = this; + for (t1 = _this.$this, t2 = t1._import_cache$_importers, t3 = t2.length, t4 = _this.url, t5 = _this.baseUrl, t6 = _this.forImport, _i = 0; _i < t2.length; t2.length === t3 || (0, A.throwConcurrentModificationError)(t2), ++_i) { + _0_0 = t1._import_cache$_canonicalize$4(t2[_i], t4, t5, t6); + if (_0_0 != null) + return _0_0; + } + return null; + }, + $signature: 194 + }; + A.ImportCache__canonicalize_closure1.prototype = { + call$0() { + var t1 = type$.nullable_Object; + return A.runZoned(new A.ImportCache__canonicalize__closure0(this.importer, this.resolved), A.LinkedHashMap_LinkedHashMap$_literal([B.Symbol__inImportRule, true], t1, t1), type$.nullable_Uri); + }, + $signature: 55 + }; + A.ImportCache__canonicalize__closure0.prototype = { + call$0() { + return this.importer.canonicalize$1(0, this.resolved); + }, + $signature: 55 + }; + A.ImportCache__canonicalize_closure2.prototype = { + call$0() { + return this.importer.canonicalize$1(0, this.resolved); + }, + $signature: 55 + }; + A.ImportCache_importCanonical_closure0.prototype = { + call$0() { + var t2, t3, t4, _this = this, + t1 = _this.canonicalUrl, + result = _this.importer.load$1(0, t1); + if (result == null) + return null; + t2 = _this.$this; + t2._import_cache$_resultsCache.$indexSet(0, t1, result); + t3 = result.contents; + t4 = result.syntax; + t1 = _this.originalUrl.resolveUri$1(t1); + return A.Stylesheet_Stylesheet$parse0(t3, t4, _this.quiet ? $.$get$Logger_quiet0() : t2._import_cache$_logger, t1); + }, + $signature: 461 + }; + A.ImportCache_humanize_closure3.prototype = { + call$1(result) { + return J.$eq$(result._1, this.canonicalUrl); + }, + $signature: 462 + }; + A.ImportCache_humanize_closure4.prototype = { + call$1(result) { + return result._2; + }, + $signature: 463 + }; + A.ImportCache_humanize_closure5.prototype = { + call$1(url) { + return url.get$path(url).length; + }, + $signature: 107 + }; + A.ImportCache_humanize_closure6.prototype = { + call$1(url) { + var t1 = $.$get$url(), + t2 = this.canonicalUrl; + return url.resolve$1(0, A.ParsedPath_ParsedPath$parse(t2.get$path(t2), t1.style).get$basename()); + }, + $signature: 44 + }; + A.ImportRule0.prototype = { + accept$1$1(visitor) { + return visitor.visitImportRule$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + toString$0(_) { + return "@import " + B.JSArray_methods.join$1(this.imports, ", ") + ";"; + }, + $isAstNode0: 1, + $isStatement0: 1, + get$span(receiver) { + return this.span; + } + }; + A.JSImporter.prototype = {}; + A.CanonicalizeContext.prototype = {}; + A.JSImporterResult.prototype = {}; + A.Importer0.prototype = { + isNonCanonicalScheme$1(scheme) { + return false; + } + }; + A.NodeImporterResult0.prototype = {}; + A.IncludeRule0.prototype = { + get$spanWithoutContent() { + var t2, t3, + t1 = this.span; + if (!(this.content == null)) { + t2 = t1.file; + t3 = this.$arguments.span; + t3 = A.SpanExtensions_trimRight0(A.SpanExtensions_trimLeft0(t2.span$2(0, A.FileLocation$_(t2, t1._file$_start).offset, t3.get$end(t3).offset))); + t1 = t3; + } + return t1; + }, + accept$1$1(visitor) { + return visitor.visitIncludeRule$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + toString$0(_) { + var t2, _this = this, + t1 = _this.namespace; + t1 = t1 != null ? "@include " + (t1 + ".") : "@include "; + t1 += _this.name; + t2 = _this.$arguments; + if (!t2.get$isEmpty(0)) + t1 += "(" + t2.toString$0(0) + ")"; + t2 = _this.content; + t1 += t2 == null ? ";" : " " + t2.toString$0(0); + return t1.charCodeAt(0) == 0 ? t1 : t1; + }, + $isAstNode0: 1, + $isStatement0: 1, + get$span(receiver) { + return this.span; + } + }; + A.InterpolatedFunctionExpression0.prototype = { + accept$1$1(visitor) { + return visitor.visitInterpolatedFunctionExpression$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + toString$0(_) { + return this.name.toString$0(0) + this.$arguments.toString$0(0); + }, + $isExpression0: 1, + $isAstNode0: 1, + get$span(receiver) { + return this.span; + } + }; + A.Interpolation0.prototype = { + get$asPlain() { + var _0_1, t1, _0_6, _0_6_isSet, first, _null = null, + _0_0 = this.contents; + $label0$0: { + _0_1 = _0_0.length; + if (_0_1 <= 0) { + t1 = ""; + break $label0$0; + } + if (_0_1 === 1) { + _0_6 = _0_0[0]; + t1 = _0_6; + t1 = typeof t1 == "string"; + _0_6_isSet = true; + } else { + _0_6 = _null; + _0_6_isSet = false; + t1 = false; + } + if (t1) { + first = A._asString(_0_6_isSet ? _0_6 : _0_0[0]); + t1 = first; + break $label0$0; + } + t1 = _null; + break $label0$0; + } + return t1; + }, + get$initialPlain() { + var _0_4, t1, _0_4_isSet, first, + _0_0 = this.contents; + $label0$0: { + if (_0_0.length >= 1) { + _0_4 = _0_0[0]; + t1 = _0_4; + t1 = typeof t1 == "string"; + _0_4_isSet = true; + } else { + _0_4 = null; + _0_4_isSet = false; + t1 = false; + } + if (t1) { + first = A._asString(_0_4_isSet ? _0_4 : _0_0[0]); + t1 = first; + break $label0$0; + } + t1 = ""; + break $label0$0; + } + return t1; + }, + Interpolation$20(contents, span) { + var t1, t2, t3, i, t4, t5, + _s8_ = "contents"; + for (t1 = this.contents, t2 = t1.length, t3 = type$.Expression_2, i = 0; i < t2; ++i) { + t4 = t1[i]; + t5 = typeof t4 == "string"; + if (!t5 && !t3._is(t4)) + throw A.wrapException(A.ArgumentError$value(t1, _s8_, string$.May_on)); + if (i !== 0 && typeof t1[i - 1] == "string" && t5) + throw A.wrapException(A.ArgumentError$value(t1, _s8_, "May not contain adjacent Strings.")); + } + }, + toString$0(_) { + var t1 = this.contents; + return new A.MappedListIterable(t1, new A.Interpolation_toString_closure0(), A._arrayInstanceType(t1)._eval$1("MappedListIterable<1,String>")).join$0(0); + }, + $isAstNode0: 1, + get$span(receiver) { + return this.span; + } + }; + A.Interpolation_toString_closure0.prototype = { + call$1(value) { + return typeof value == "string" ? value : "#{" + A.S(value) + "}"; + }, + $signature: 137 + }; + A.SupportsInterpolation0.prototype = { + toString$0(_) { + return "#{" + this.expression.toString$0(0) + "}"; + }, + $isAstNode0: 1, + get$span(receiver) { + return this.span; + } + }; + A.InterpolationBuffer0.prototype = { + writeCharCode$1(character) { + this._interpolation_buffer0$_text._contents += A.Primitives_stringFromCharCode(character); + return null; + }, + addInterpolation$1(interpolation) { + var _0_4, _0_4_isSet, first, rest, _this = this, + toAdd = interpolation.contents, + t1 = toAdd.length; + if (t1 === 0) + return; + if (t1 >= 1) { + _0_4 = toAdd[0]; + t1 = _0_4; + t1 = typeof t1 == "string"; + _0_4_isSet = true; + } else { + _0_4 = null; + _0_4_isSet = false; + t1 = false; + } + if (t1) { + first = A._asString(_0_4_isSet ? _0_4 : toAdd[0]); + rest = B.JSArray_methods.sublist$1(toAdd, 1); + _this._interpolation_buffer0$_text._contents += first; + toAdd = rest; + } + _this._interpolation_buffer0$_flushText$0(); + t1 = _this._interpolation_buffer0$_contents; + B.JSArray_methods.addAll$1(t1, toAdd); + if (typeof B.JSArray_methods.get$last(t1) == "string") + _this._interpolation_buffer0$_text._contents += A.S(t1.pop()); + }, + _interpolation_buffer0$_flushText$0() { + var t1 = this._interpolation_buffer0$_text, + t2 = t1._contents; + if (t2.length === 0) + return; + this._interpolation_buffer0$_contents.push(t2.charCodeAt(0) == 0 ? t2 : t2); + t1._contents = ""; + }, + interpolation$1(span) { + var t1 = A.List_List$of(this._interpolation_buffer0$_contents, true, type$.Object), + t2 = this._interpolation_buffer0$_text._contents; + if (t2.length !== 0) + t1.push(t2.charCodeAt(0) == 0 ? t2 : t2); + return A.Interpolation$0(t1, span); + }, + toString$0(_) { + var t1, t2, _i, t3, element; + for (t1 = this._interpolation_buffer0$_contents, t2 = t1.length, _i = 0, t3 = ""; _i < t1.length; t1.length === t2 || (0, A.throwConcurrentModificationError)(t1), ++_i) { + element = t1[_i]; + t3 = typeof element == "string" ? t3 + element : t3 + "#{" + A.S(element) + A.Primitives_stringFromCharCode(125); + } + t1 = t3 + this._interpolation_buffer0$_text.toString$0(0); + return t1.charCodeAt(0) == 0 ? t1 : t1; + } + }; + A.InterpolationMap0.prototype = { + mapException$1(error) { + var t3, t4, _this = this, + target = error.get$span(error), + source = _this.mapSpan$1(target), + startIndex = _this._interpolation_map$_indexInContents$1(target.get$start(target)), + endIndex = _this._interpolation_map$_indexInContents$1(target.get$end(target)), + t1 = _this._interpolation_map$_interpolation.contents, + t2 = error._span_exception$_message; + if (!A.SubListIterable$(t1, startIndex, null, A._arrayInstanceType(t1)._precomputed1).take$1(0, endIndex - startIndex + 1).any$1(0, new A.InterpolationMap_mapException_closure0())) + return new A.SourceSpanFormatException(error.get$source(), t2, source); + else { + t1 = type$.SourceSpan; + t3 = type$.String; + t4 = A.LinkedHashMap_LinkedHashMap$_literal([target, "error in interpolated output"], t1, t3); + error.get$source(); + return new A.MultiSourceSpanFormatException("", A.ConstantMap_ConstantMap$from(t4, t1, t3), t2, source); + } + }, + mapSpan$1(target) { + var _0_10, t1, _0_20, t2, start, _0_2_isSet, end, _this = this, _null = null, + _0_1 = _this._interpolation_map$_mapLocation$1(target.get$start(target)), + _0_2 = _this._interpolation_map$_mapLocation$1(target.get$end(target)); + $label0$0: { + _0_10 = _0_1; + t1 = type$.FileSpan; + if (t1._is(_0_1)) { + t1._as(_0_10); + _0_20 = _0_2; + t2 = t1._is(_0_2); + start = _0_10; + _0_1 = start; + _0_2_isSet = true; + } else { + start = _null; + _0_20 = start; + _0_1 = _0_10; + _0_2_isSet = false; + t2 = false; + } + if (t2) { + t1 = start.expand$1(0, t1._as(_0_2_isSet ? _0_20 : _0_2)); + break $label0$0; + } + if (t1._is(_0_1)) { + t1._as(_0_1); + if (_0_2_isSet) + t2 = _0_20; + else { + t2 = _0_2; + _0_20 = t2; + _0_2_isSet = true; + } + t2 = t2 instanceof A.FileLocation; + start = _0_1; + } else { + start = _null; + t2 = false; + } + if (t2) { + t1 = _0_2_isSet ? _0_20 : _0_2; + type$.FileLocation._as(t1); + t2 = _this._interpolation_map$_interpolation.span; + t1 = t2.get$file(t2).span$2(0, _this._interpolation_map$_expandInterpolationSpanLeft$1(start.get$start(start)), t1.offset); + break $label0$0; + } + if (_0_1 instanceof A.FileLocation) { + type$.FileLocation._as(_0_1); + if (_0_2_isSet) + t2 = _0_20; + else { + t2 = _0_2; + _0_20 = t2; + _0_2_isSet = true; + } + t2 = t1._is(t2); + start = _0_1; + } else { + start = _null; + t2 = false; + } + if (t2) { + end = t1._as(_0_2_isSet ? _0_20 : _0_2); + t1 = _this._interpolation_map$_interpolation.span; + t1 = t1.get$file(t1).span$2(0, start.offset, _this._interpolation_map$_expandInterpolationSpanRight$1(end.get$end(end))); + break $label0$0; + } + if (_0_1 instanceof A.FileLocation) { + type$.FileLocation._as(_0_1); + if (_0_2_isSet) + t1 = _0_20; + else { + t1 = _0_2; + _0_20 = t1; + _0_2_isSet = true; + } + t1 = t1 instanceof A.FileLocation; + start = _0_1; + } else { + start = _null; + t1 = false; + } + if (t1) { + t1 = _0_2_isSet ? _0_20 : _0_2; + type$.FileLocation._as(t1); + t2 = _this._interpolation_map$_interpolation.span; + t1 = t2.get$file(t2).span$2(0, start.offset, t1.offset); + break $label0$0; + } + t1 = A.throwExpression("[BUG] Unreachable"); + } + return t1; + }, + _interpolation_map$_mapLocation$1(target) { + var t4, previousLocation, _this = this, + index = _this._interpolation_map$_indexInContents$1(target), + t1 = _this._interpolation_map$_interpolation, + t2 = t1.contents, + _0_0 = t2[index], + t3 = type$.Expression_2; + if (t3._is(_0_0)) + return _0_0.get$span(_0_0); + t4 = index === 0; + t1 = t1.span; + if (t4) + previousLocation = t1.get$start(t1); + else { + t1 = t1.get$file(t1); + t2 = t3._as(t2[index - 1]); + t2 = t2.get$span(t2); + previousLocation = A.FileLocation$_(t1, _this._interpolation_map$_expandInterpolationSpanRight$1(t2.get$end(t2))); + } + t1 = t4 ? 0 : _this._interpolation_map$_targetLocations[index - 1].get$offset(); + return A.FileLocation$_(previousLocation.file, previousLocation.offset + (target.offset - t1)); + }, + _interpolation_map$_indexInContents$1(target) { + var t1, t2, t3, i; + for (t1 = this._interpolation_map$_targetLocations, t2 = t1.length, t3 = target.offset, i = 0; i < t2; ++i) + if (t3 < t1[i].get$offset()) + return i; + return this._interpolation_map$_interpolation.contents.length - 1; + }, + _interpolation_map$_expandInterpolationSpanLeft$1(start) { + var i0, prev, char, + source = start.file._decodedChars, + i = start.offset - 1; + for (; i >= 0;) { + i0 = i - 1; + prev = source[i]; + if (prev === 123) { + if (source[i0] === 35) { + i = i0; + break; + } + i = i0; + } else if (prev === 47) { + i = i0 - 1; + if (source[i0] === 42) + for (; true;) { + i0 = i - 1; + if (source[i] !== 42) { + i = i0; + continue; + } + i = i0; + do { + i0 = i - 1; + char = source[i]; + if (char === 42) { + i = i0; + continue; + } else + break; + } while (true); + if (char === 47) { + i = i0; + break; + } + i = i0; + } + } else + i = i0; + } + return i; + }, + _interpolation_map$_expandInterpolationSpanRight$1(end) { + var t1, i0, next, second, t2, char, + source = end.file._decodedChars, + i = end.offset; + for (t1 = source.length; i < t1;) { + i0 = i + 1; + next = source[i]; + if (next === 125) { + i = i0; + break; + } + if (next === 47) { + i = i0 + 1; + second = source[i0]; + if (second === 47) { + while (true) { + i0 = i + 1; + t2 = source[i]; + if (!!(t2 === 10 || t2 === 13 || t2 === 12)) + break; + i = i0; + } + i = i0; + } else if (second === 42) + for (; true;) { + i0 = i + 1; + if (source[i] !== 42) { + i = i0; + continue; + } + i = i0; + do { + i0 = i + 1; + char = source[i]; + if (char === 42) { + i = i0; + continue; + } else + break; + } while (true); + if (char === 47) { + i = i0; + break; + } + i = i0; + } + } else + i = i0; + } + return i; + } + }; + A.InterpolationMap_mapException_closure0.prototype = { + call$1($content) { + return type$.Expression_2._is($content); + }, + $signature: 71 + }; + A._realCasePath_helper0.prototype = { + call$1(path) { + var dirname = $.$get$context().dirname$1(path); + if (dirname === path) + return path; + return $._realCaseCache0.putIfAbsent$2(path, new A._realCasePath_helper_closure0(this, dirname, path)); + }, + $signature: 5 + }; + A._realCasePath_helper_closure0.prototype = { + call$0() { + var matches, t1, _0_0, match, exception, + realDirname = this.helper.call$1(this.dirname), + t2 = this.path, + basename = A.ParsedPath_ParsedPath$parse(t2, $.$get$context().style).get$basename(); + try { + matches = J.where$1$ax(A.listDir0(realDirname), new A._realCasePath_helper__closure0(basename)).toList$0(0); + t1 = null; + _0_0 = matches; + $label0$0: { + match = null; + if (J.get$length$asx(_0_0) === 1) { + match = J.$index$asx(_0_0, 0); + t1 = match; + break $label0$0; + } + t1 = A.join(realDirname, basename, null); + break $label0$0; + } + t1 = t1; + return t1; + } catch (exception) { + if (A.unwrapException(exception) instanceof A.FileSystemException0) + return t2; + else + throw exception; + } + }, + $signature: 27 + }; + A._realCasePath_helper__closure0.prototype = { + call$1(realPath) { + return A.equalsIgnoreCase0(A.ParsedPath_ParsedPath$parse(realPath, $.$get$context().style).get$basename(), this.basename); + }, + $signature: 4 + }; + A.FileSystemException0.prototype = { + toString$0(_) { + var t1 = $.$get$context(); + return t1.prettyUri$1(t1.toUri$1(this.path)) + ": " + this.message; + }, + get$message(receiver) { + return this.message; + } + }; + A._readFile_closure0.prototype = { + call$0() { + return J.readFileSync$2$x(A.fs(), this.path, this.encoding); + }, + $signature: 57 + }; + A.fileExists_closure0.prototype = { + call$0() { + var error, systemError, exception, + t1 = this.path; + if (!J.existsSync$1$x(A.fs(), t1)) + return false; + try { + t1 = J.isFile$0$x(J.statSync$1$x(A.fs(), t1)); + return t1; + } catch (exception) { + error = A.unwrapException(exception); + systemError = type$.JsSystemError._as(error); + if (J.$eq$(J.get$code$x(systemError), "ENOENT")) + return false; + throw exception; + } + }, + $signature: 26 + }; + A.dirExists_closure0.prototype = { + call$0() { + var error, systemError, exception, + t1 = this.path; + if (!J.existsSync$1$x(A.fs(), t1)) + return false; + try { + t1 = J.isDirectory$0$x(J.statSync$1$x(A.fs(), t1)); + return t1; + } catch (exception) { + error = A.unwrapException(exception); + systemError = type$.JsSystemError._as(error); + if (J.$eq$(J.get$code$x(systemError), "ENOENT")) + return false; + throw exception; + } + }, + $signature: 26 + }; + A.listDir_closure0.prototype = { + call$0() { + var t1 = this.path; + if (!this.recursive) + return J.map$1$1$ax(J.readdirSync$1$x(A.fs(), t1), new A.listDir__closure1(t1), type$.String).super$Iterable$where(0, new A.listDir__closure2()); + else + return new A.listDir_closure_list0().call$1(t1); + }, + $signature: 161 + }; + A.listDir__closure1.prototype = { + call$1(child) { + return A.join(this.path, A._asString(child), null); + }, + $signature: 116 + }; + A.listDir__closure2.prototype = { + call$1(child) { + return !A.dirExists0(child); + }, + $signature: 4 + }; + A.listDir_closure_list0.prototype = { + call$1($parent) { + return J.expand$1$1$ax(J.readdirSync$1$x(A.fs(), $parent), new A.listDir__list_closure0($parent, this), type$.String); + }, + $signature: 162 + }; + A.listDir__list_closure0.prototype = { + call$1(child) { + var path = A.join(this.parent, A._asString(child), null); + return A.dirExists0(path) ? this.list.call$1(path) : A._setArrayType([path], type$.JSArray_String); + }, + $signature: 163 + }; + A.main_closure.prototype = { + call$2(_, __) { + }, + $signature: 464 + }; + A.main_closure0.prototype = { + call$2(_, __) { + }, + $signature: 465 + }; + A.JSToDartLogger.prototype = { + warn$4$deprecation$span$trace(_, message, deprecation, span, trace) { + var t1 = this._node, + _0_0 = t1 == null ? null : J.get$warn$x(t1); + if (_0_0 != null) { + t1 = span == null ? type$.nullable_SourceSpan._as(self.undefined) : span; + _0_0.call$2(message, {deprecation: deprecation, span: t1, stack: J.toString$0$(trace)}); + } else + this._withAscii$1(new A.JSToDartLogger_warn_closure(this, message, span, trace, deprecation)); + }, + warn$1(_, message) { + return this.warn$4$deprecation$span$trace(0, message, false, null, null); + }, + warn$2$span(_, message, span) { + return this.warn$4$deprecation$span$trace(0, message, false, span, null); + }, + debug$2(_, message, span) { + var t1 = this._node, + _0_0 = t1 == null ? null : J.get$debug$x(t1); + if (_0_0 != null) + _0_0.call$2(message, {span: span}); + else + this._withAscii$1(new A.JSToDartLogger_debug_closure(this, message, span)); + }, + _withAscii$1$1(callback) { + var t1, + wasAscii = $._glyphs === B.C_AsciiGlyphSet; + $._glyphs = this._ascii ? B.C_AsciiGlyphSet : B.C_UnicodeGlyphSet; + try { + t1 = callback.call$0(); + return t1; + } finally { + $._glyphs = wasAscii ? B.C_AsciiGlyphSet : B.C_UnicodeGlyphSet; + } + }, + _withAscii$1(callback) { + return this._withAscii$1$1(callback, type$.dynamic); + } + }; + A.JSToDartLogger_warn_closure.prototype = { + call$0() { + var _this = this; + _this.$this._fallback.warn$4$deprecation$span$trace(0, _this.message, _this.deprecation, _this.span, _this.trace); + }, + $signature: 1 + }; + A.JSToDartLogger_debug_closure.prototype = { + call$0() { + return this.$this._fallback.debug$2(0, this.message, this.span); + }, + $signature: 0 + }; + A.ModifiableCssKeyframeBlock0.prototype = { + accept$1$1(visitor) { + return visitor.visitCssKeyframeBlock$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + equalsIgnoringChildren$1(other) { + return other instanceof A.ModifiableCssKeyframeBlock0 && B.C_ListEquality.equals$2(0, this.selector.value, other.selector.value); + }, + copyWithoutChildren$0() { + return A.ModifiableCssKeyframeBlock$0(this.selector, this.span); + }, + get$span(receiver) { + return this.span; + } + }; + A.KeyframeSelectorParser0.prototype = { + parse$0() { + return this.wrapSpanFormatException$1(new A.KeyframeSelectorParser_parse_closure0(this)); + }, + _keyframe_selector$_percentage$0() { + var $self, _0_0, + t1 = this.scanner, + t2 = t1.scanChar$1(43) ? "" + A.Primitives_stringFromCharCode(43) : "", + second = t1.peekChar$0(); + if (!(second != null && second >= 48 && second <= 57) && second !== 46) + t1.error$1(0, "Expected number."); + while (true) { + $self = t1.peekChar$0(); + if (!($self != null && $self >= 48 && $self <= 57)) + break; + t2 += A.Primitives_stringFromCharCode(t1.readChar$0()); + } + if (t1.peekChar$0() === 46) { + t2 += A.Primitives_stringFromCharCode(t1.readChar$0()); + while (true) { + $self = t1.peekChar$0(); + if (!($self != null && $self >= 48 && $self <= 57)) + break; + t2 += A.Primitives_stringFromCharCode(t1.readChar$0()); + } + } + if (this.scanIdentChar$1(101)) { + t2 += A.Primitives_stringFromCharCode(101); + _0_0 = t1.peekChar$0(); + if (43 === _0_0 || 45 === _0_0) + t2 += A.Primitives_stringFromCharCode(t1.readChar$0()); + $self = t1.peekChar$0(); + if (!($self != null && $self >= 48 && $self <= 57)) + t1.error$1(0, "Expected digit."); + do { + t2 += A.Primitives_stringFromCharCode(t1.readChar$0()); + $self = t1.peekChar$0(); + } while ($self != null && $self >= 48 && $self <= 57); + } + t1.expectChar$1(37); + t2 += A.Primitives_stringFromCharCode(37); + return t2.charCodeAt(0) == 0 ? t2 : t2; + } + }; + A.KeyframeSelectorParser_parse_closure0.prototype = { + call$0() { + var selectors = A._setArrayType([], type$.JSArray_String), + t1 = this.$this, + t2 = t1.scanner; + do { + t1.whitespace$0(); + if (t1.lookingAtIdentifier$0()) + if (t1.scanIdentifier$1("from")) + selectors.push("from"); + else { + t1.expectIdentifier$2$name("to", '"to" or "from"'); + selectors.push("to"); + } + else + selectors.push(t1._keyframe_selector$_percentage$0()); + t1.whitespace$0(); + } while (t2.scanChar$1(44)); + t2.expectDone$0(); + return selectors; + }, + $signature: 115 + }; + A.LazyFileSpan0.prototype = { + get$span(_) { + var t1 = this._lazy_file_span0$_span; + return t1 == null ? this._lazy_file_span0$_span = this._lazy_file_span0$_builder.call$0() : t1; + }, + compareTo$1(_, other) { + return this.get$span(0).compareTo$1(0, other); + }, + get$context(_) { + var t1 = this.get$span(0); + return t1.get$context(t1); + }, + get$end(_) { + var t1 = this.get$span(0); + return t1.get$end(t1); + }, + expand$1(_, other) { + return this.get$span(0).expand$1(0, other); + }, + get$file(_) { + var t1 = this.get$span(0); + return t1.get$file(t1); + }, + highlight$1$color(color) { + return this.get$span(0).highlight$1$color(color); + }, + get$length(_) { + var t1 = this.get$span(0); + return t1.get$length(t1); + }, + message$2$color(_, message, color) { + return this.get$span(0).message$2$color(0, message, color); + }, + message$1(_, message) { + return this.message$2$color(0, message, null); + }, + get$sourceUrl(_) { + var t1 = this.get$span(0); + return t1.get$sourceUrl(t1); + }, + get$start(_) { + var t1 = this.get$span(0); + return t1.get$start(t1); + }, + get$text() { + return this.get$span(0).get$text(); + }, + $isComparable: 1, + $isFileSpan: 1, + $isSourceSpan: 1, + $isSourceSpanWithContext: 1 + }; + A.render_closure.prototype = { + call$0() { + var error, exception; + try { + this.callback.call$2(null, A.renderSync(this.options)); + } catch (exception) { + error = A.unwrapException(exception); + this.callback.call$2(error, null); + } + return null; + }, + $signature: 1 + }; + A.render_closure0.prototype = { + call$1(result) { + this.callback.call$2(null, result); + }, + $signature: 466 + }; + A.render_closure1.prototype = { + call$2(error, stackTrace) { + var t2, t3, _null = null, + t1 = this.callback; + if (error instanceof A.SassException0) + t1.call$2(A._wrapException(error, stackTrace), _null); + else { + t2 = J.toString$0$(error); + t3 = A.getTrace0(error); + t1.call$2(A._newRenderError(t2, t3 == null ? stackTrace : t3, _null, _null, _null, 3), _null); + } + }, + $signature: 53 + }; + A._parseFunctions_closure.prototype = { + call$2(signature, callback) { + var _0_0, _this = this, t1 = {}, + t2 = _this.options, + context = {options: A._contextOptions(t2, _this.start)}; + J.set$context$x(J.get$options$x(context), context); + t1.fiber = null; + _0_0 = J.get$fiber$x(t2); + if (_0_0 != null) { + t1.fiber = _0_0; + _this.result.push(A.Callable_Callable$fromSignature(B.JSString_methods.trimLeft$0(signature), new A._parseFunctions__closure(t1, callback, context), false)); + } else { + t1 = _this.result; + if (!_this.asynch) + t1.push(A.Callable_Callable$fromSignature(B.JSString_methods.trimLeft$0(signature), new A._parseFunctions__closure0(callback, context), false)); + else + t1.push(A.AsyncCallable_AsyncCallable$fromSignature(B.JSString_methods.trimLeft$0(signature), new A._parseFunctions__closure1(callback, context), false)); + } + }, + $signature: 128 + }; + A._parseFunctions__closure.prototype = { + call$1($arguments) { + var result, + t1 = this._box_0, + currentFiber = J.get$current$x(t1.fiber), + t2 = type$.Object; + t2 = A.List_List$of(J.map$1$1$ax($arguments, A.value0__wrapValue$closure(), t2), true, t2); + t2.push(A.allowInterop(new A._parseFunctions___closure2(currentFiber))); + result = A.wrapJSExceptions(new A._parseFunctions___closure3(this.callback, this.context, t2)); + return A.unwrapValue(A._asBool($.$get$_isUndefined().call$1(result)) ? A.runZoned(new A._parseFunctions___closure4(t1), null, type$.nullable_Object) : result); + }, + $signature: 3 + }; + A._parseFunctions___closure2.prototype = { + call$1(result) { + A.scheduleMicrotask(new A._parseFunctions____closure(this.currentFiber, result)); + }, + call$0() { + return this.call$1(null); + }, + "call*": "call$1", + $requiredArgCount: 0, + $defaultValues() { + return [null]; + }, + $signature: 89 + }; + A._parseFunctions____closure.prototype = { + call$0() { + return J.run$1$x(this.currentFiber, this.result); + }, + $signature: 0 + }; + A._parseFunctions___closure3.prototype = { + call$0() { + return J.apply$2$x(type$.JSFunction._as(this.callback), this.context, this.jsArguments); + }, + $signature: 35 + }; + A._parseFunctions___closure4.prototype = { + call$0() { + return J.yield$0$x(this._box_0.fiber); + }, + $signature: 82 + }; + A._parseFunctions__closure0.prototype = { + call$1($arguments) { + return A.unwrapValue(A.wrapJSExceptions(new A._parseFunctions___closure1(this.callback, this.context, $arguments))); + }, + $signature: 3 + }; + A._parseFunctions___closure1.prototype = { + call$0() { + var t1 = type$.JSFunction._as(this.callback), + t2 = J.map$1$1$ax(this.$arguments, A.value0__wrapValue$closure(), type$.Object); + return J.apply$2$x(t1, this.context, A.List_List$of(t2, true, A._instanceType(t2)._eval$1("ListIterable.E"))); + }, + $signature: 35 + }; + A._parseFunctions__closure1.prototype = { + call$1($arguments) { + return this.$call$body$_parseFunctions__closure($arguments); + }, + $call$body$_parseFunctions__closure($arguments) { + var $async$goto = 0, + $async$completer = A._makeAsyncAwaitCompleter(type$.Value_2), + $async$returnValue, $async$self = this, result, t1, t2, $async$temp1; + var $async$call$1 = A._wrapJsFunctionForAsync(function($async$errorCode, $async$result) { + if ($async$errorCode === 1) + return A._asyncRethrow($async$result, $async$completer); + while (true) + switch ($async$goto) { + case 0: + // Function start + t1 = new A._Future($.Zone__current, type$._Future_nullable_Object); + t2 = type$.Object; + t2 = A.List_List$of(J.map$1$1$ax($arguments, A.value0__wrapValue$closure(), t2), true, t2); + t2.push(A.allowInterop(new A._parseFunctions___closure(new A._AsyncCompleter(t1, type$._AsyncCompleter_nullable_Object)))); + result = A.wrapJSExceptions(new A._parseFunctions___closure0($async$self.callback, $async$self.context, t2)); + $async$temp1 = A; + $async$goto = A._asBool($.$get$_isUndefined().call$1(result)) ? 3 : 5; + break; + case 3: + // then + $async$goto = 6; + return A._asyncAwait(t1, $async$call$1); + case 6: + // returning from await. + // goto join + $async$goto = 4; + break; + case 5: + // else + $async$result = result; + case 4: + // join + $async$returnValue = $async$temp1.unwrapValue($async$result); + // goto return + $async$goto = 1; + break; + case 1: + // return + return A._asyncReturn($async$returnValue, $async$completer); + } + }); + return A._asyncStartSync($async$call$1, $async$completer); + }, + $signature: 98 + }; + A._parseFunctions___closure.prototype = { + call$1(result) { + return this.completer.complete$1(result); + }, + call$0() { + return this.call$1(null); + }, + "call*": "call$1", + $requiredArgCount: 0, + $defaultValues() { + return [null]; + }, + $signature: 252 + }; + A._parseFunctions___closure0.prototype = { + call$0() { + return J.apply$2$x(type$.JSFunction._as(this.callback), this.context, this.jsArguments); + }, + $signature: 35 + }; + A._parseImporter_closure.prototype = { + call$1(importer) { + return type$.JSFunction._as(A.allowInteropCaptureThis(new A._parseImporter__closure(this._box_0, importer))); + }, + $signature: 467 + }; + A._parseImporter__closure.prototype = { + call$4(thisArg, url, previous, _) { + var t1 = this._box_0, + result = J.apply$2$x(this.importer, thisArg, A._setArrayType([url, previous, A.allowInterop(new A._parseImporter___closure(J.get$current$x(t1.fiber)))], type$.JSArray_Object)); + if (A._asBool($.$get$_isUndefined().call$1(result))) + return A.runZoned(new A._parseImporter___closure0(t1), null, type$.Object); + return result; + }, + call$3(thisArg, url, previous) { + return this.call$4(thisArg, url, previous, null); + }, + "call*": "call$4", + $requiredArgCount: 3, + $defaultValues() { + return [null]; + }, + $signature: 468 + }; + A._parseImporter___closure.prototype = { + call$1(result) { + A.scheduleMicrotask(new A._parseImporter____closure(this.currentFiber, result)); + }, + $signature: 469 + }; + A._parseImporter____closure.prototype = { + call$0() { + return J.run$1$x(this.currentFiber, this.result); + }, + $signature: 0 + }; + A._parseImporter___closure0.prototype = { + call$0() { + return J.yield$0$x(this._box_0.fiber); + }, + $signature: 82 + }; + A.LimitedMapView0.prototype = { + get$keys(_) { + return this._limited_map_view0$_keys; + }, + get$length(_) { + return this._limited_map_view0$_keys._collection$_length; + }, + get$isEmpty(_) { + return this._limited_map_view0$_keys._collection$_length === 0; + }, + get$isNotEmpty(_) { + return this._limited_map_view0$_keys._collection$_length !== 0; + }, + $index(_, key) { + return this._limited_map_view0$_keys.contains$1(0, key) ? this._limited_map_view0$_map.$index(0, key) : null; + }, + containsKey$1(key) { + return this._limited_map_view0$_keys.contains$1(0, key); + }, + remove$1(_, key) { + return this._limited_map_view0$_keys.contains$1(0, key) ? this._limited_map_view0$_map.remove$1(0, key) : null; + } + }; + A.ListExpression0.prototype = { + accept$1$1(visitor) { + return visitor.visitListExpression$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + toString$0(_) { + var t2, t3, t4, t5, _this = this, + t1 = _this.hasBrackets; + if (t1) + t2 = "" + A.Primitives_stringFromCharCode(91); + else { + t2 = _this.contents.length; + if (t2 !== 0) + t2 = t2 === 1 && _this.separator === B.ListSeparator_rXA0; + else + t2 = true; + t2 = t2 ? "" + A.Primitives_stringFromCharCode(40) : ""; + } + t3 = _this.contents; + t4 = _this.separator === B.ListSeparator_rXA0; + t5 = t4 ? ", " : " "; + t5 = t2 + new A.MappedListIterable(t3, new A.ListExpression_toString_closure0(_this), A._arrayInstanceType(t3)._eval$1("MappedListIterable<1,String>")).join$1(0, t5); + if (t1) + t1 = t5 + A.Primitives_stringFromCharCode(93); + else { + t1 = t3.length; + if (t1 === 0) + t1 = t5 + A.Primitives_stringFromCharCode(41); + else + t1 = t1 === 1 && t4 ? t5 + ",)" : t5; + } + return t1.charCodeAt(0) == 0 ? t1 : t1; + }, + _list3$_elementNeedsParens$1(expression) { + var childSeparator, t1, _0_13; + $label0$0: { + if (expression instanceof A.ListExpression0 && expression.contents.length >= 2 && !expression.hasBrackets) { + childSeparator = expression.separator; + t1 = this.separator === B.ListSeparator_rXA0 ? childSeparator === B.ListSeparator_rXA0 : childSeparator !== B.ListSeparator_undecided_null_undecided0; + break $label0$0; + } + if (expression instanceof A.UnaryOperationExpression0) { + _0_13 = expression.operator; + if (B.UnaryOperator_gg40 !== _0_13) + t1 = B.UnaryOperator_TLI0 === _0_13; + else + t1 = true; + } else + t1 = false; + if (t1) { + t1 = this.separator === B.ListSeparator_EVt0; + break $label0$0; + } + t1 = false; + break $label0$0; + } + return t1; + }, + $isExpression0: 1, + $isAstNode0: 1, + get$span(receiver) { + return this.span; + } + }; + A.ListExpression_toString_closure0.prototype = { + call$1(element) { + return this.$this._list3$_elementNeedsParens$1(element) ? "(" + element.toString$0(0) + ")" : element.toString$0(0); + }, + $signature: 131 + }; + A._length_closure2.prototype = { + call$1($arguments) { + return A.SassNumber_SassNumber0(J.$index$asx($arguments, 0).get$asList().length, null); + }, + $signature: 11 + }; + A._nth_closure0.prototype = { + call$1($arguments) { + var t1 = J.getInterceptor$asx($arguments), + list = t1.$index($arguments, 0), + index = t1.$index($arguments, 1); + return list.get$asList()[list.sassIndexToListIndex$2(index, "n")]; + }, + $signature: 3 + }; + A._setNth_closure0.prototype = { + call$1($arguments) { + var newList, + t1 = J.getInterceptor$asx($arguments), + list = t1.$index($arguments, 0), + index = t1.$index($arguments, 1), + value = t1.$index($arguments, 2); + t1 = list.get$asList(); + newList = A._setArrayType(t1.slice(0), A._arrayInstanceType(t1)); + newList[list.sassIndexToListIndex$2(index, "n")] = value; + return list.withListContents$1(newList); + }, + $signature: 22 + }; + A._join_closure0.prototype = { + call$1($arguments) { + var _0_1, _0_4, _0_3, _0_10, _0_40, _0_4_isSet, separator, bracketed, t2, _null = null, + t1 = J.getInterceptor$asx($arguments), + list1 = t1.$index($arguments, 0), + list2 = t1.$index($arguments, 1), + separatorParam = t1.$index($arguments, 2).assertString$1("separator"), + bracketedParam = t1.$index($arguments, 3), + _1_0 = separatorParam._string0$_text; + $label1$1: { + if ("auto" === _1_0) { + _0_1 = list1.get$separator(list1); + _0_4 = list2.get$separator(list2); + $label0$0: { + _0_3 = B.ListSeparator_undecided_null_undecided0 === _0_1; + t1 = _0_3; + _0_10 = _0_1; + if (t1) { + t1 = B.ListSeparator_undecided_null_undecided0 === _0_4; + _0_40 = _0_4; + _0_4_isSet = true; + } else { + _0_40 = _null; + _0_4_isSet = false; + t1 = false; + } + if (t1) { + t1 = B.ListSeparator_EVt0; + break $label0$0; + } + if (_0_3) { + separator = _0_4_isSet ? _0_40 : _0_4; + t1 = true; + } else { + separator = _null; + t1 = false; + } + if (!t1) + separator = _0_10; + t1 = separator; + break $label0$0; + } + break $label1$1; + } + if ("space" === _1_0) { + t1 = B.ListSeparator_EVt0; + break $label1$1; + } + if ("comma" === _1_0) { + t1 = B.ListSeparator_rXA0; + break $label1$1; + } + if ("slash" === _1_0) { + t1 = B.ListSeparator_zg90; + break $label1$1; + } + t1 = A.throwExpression(A.SassScriptException$0(string$.x24separ, _null)); + } + bracketed = bracketedParam instanceof A.SassString0 && bracketedParam._string0$_text === "auto" ? list1.get$hasBrackets() : bracketedParam.get$isTruthy(); + t2 = A.List_List$of(list1.get$asList(), true, type$.Value_2); + B.JSArray_methods.addAll$1(t2, list2.get$asList()); + return A.SassList$0(t2, t1, bracketed); + }, + $signature: 22 + }; + A._append_closure2.prototype = { + call$1($arguments) { + var t2, + t1 = J.getInterceptor$asx($arguments), + list = t1.$index($arguments, 0), + value = t1.$index($arguments, 1), + _0_0 = t1.$index($arguments, 2).assertString$1("separator")._string0$_text; + $label0$0: { + if ("auto" === _0_0) { + t1 = list.get$separator(list) === B.ListSeparator_undecided_null_undecided0 ? B.ListSeparator_EVt0 : list.get$separator(list); + break $label0$0; + } + if ("space" === _0_0) { + t1 = B.ListSeparator_EVt0; + break $label0$0; + } + if ("comma" === _0_0) { + t1 = B.ListSeparator_rXA0; + break $label0$0; + } + if ("slash" === _0_0) { + t1 = B.ListSeparator_zg90; + break $label0$0; + } + t1 = A.throwExpression(A.SassScriptException$0(string$.x24separ, null)); + } + t2 = A.List_List$of(list.get$asList(), true, type$.Value_2); + t2.push(value); + return list.withListContents$2$separator(t2, t1); + }, + $signature: 22 + }; + A._zip_closure0.prototype = { + call$1($arguments) { + var results, result, _box_0 = {}, + t1 = J.$index$asx($arguments, 0).get$asList(), + t2 = A._arrayInstanceType(t1)._eval$1("MappedListIterable<1,List>"), + lists = A.List_List$of(new A.MappedListIterable(t1, new A._zip__closure2(), t2), true, t2._eval$1("ListIterable.E")); + if (lists.length === 0) + return B.SassList_Sof1; + _box_0.i = 0; + results = A._setArrayType([], type$.JSArray_SassList_2); + for (t1 = A._arrayInstanceType(lists)._eval$1("MappedListIterable<1,Value0>"), t2 = type$.Value_2; B.JSArray_methods.every$1(lists, new A._zip__closure3(_box_0));) { + result = A.List_List$from(new A.MappedListIterable(lists, new A._zip__closure4(_box_0), t1), false, t2); + result.fixed$length = Array; + result.immutable$list = Array; + results.push(new A.SassList0(result, B.ListSeparator_EVt0, false)); + ++_box_0.i; + } + return A.SassList$0(results, B.ListSeparator_rXA0, false); + }, + $signature: 22 + }; + A._zip__closure2.prototype = { + call$1(list) { + return list.get$asList(); + }, + $signature: 471 + }; + A._zip__closure3.prototype = { + call$1(list) { + return this._box_0.i !== J.get$length$asx(list); + }, + $signature: 472 + }; + A._zip__closure4.prototype = { + call$1(list) { + return J.$index$asx(list, this._box_0.i); + }, + $signature: 3 + }; + A._index_closure2.prototype = { + call$1($arguments) { + var t1 = J.getInterceptor$asx($arguments), + index = B.JSArray_methods.indexOf$1(t1.$index($arguments, 0).get$asList(), t1.$index($arguments, 1)); + return index === -1 ? B.C__SassNull0 : A.SassNumber_SassNumber0(index + 1, null); + }, + $signature: 3 + }; + A._separator_closure0.prototype = { + call$1($arguments) { + var t1, + _0_0 = J.get$separator$x(J.$index$asx($arguments, 0)); + $label0$0: { + if (B.ListSeparator_rXA0 === _0_0) { + t1 = new A.SassString0("comma", false); + break $label0$0; + } + if (B.ListSeparator_zg90 === _0_0) { + t1 = new A.SassString0("slash", false); + break $label0$0; + } + t1 = new A.SassString0("space", false); + break $label0$0; + } + return t1; + }, + $signature: 17 + }; + A._isBracketed_closure0.prototype = { + call$1($arguments) { + return J.$index$asx($arguments, 0).get$hasBrackets() ? B.SassBoolean_true0 : B.SassBoolean_false0; + }, + $signature: 20 + }; + A._slash_closure0.prototype = { + call$1($arguments) { + var list = J.$index$asx($arguments, 0).get$asList(); + if (list.length < 2) + throw A.wrapException(A.SassScriptException$0("At least two elements are required.", null)); + return A.SassList$0(list, B.ListSeparator_zg90, false); + }, + $signature: 22 + }; + A.SelectorList0.prototype = { + get$asSassList() { + var t1 = this.components; + return A.SassList$0(new A.MappedListIterable(t1, new A.SelectorList_asSassList_closure0(), A._arrayInstanceType(t1)._eval$1("MappedListIterable<1,Value0>")), B.ListSeparator_rXA0, false); + }, + accept$1$1(visitor) { + return visitor.visitSelectorList$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + unify$1(other) { + var t3, t4, t5, t6, _i, complex1, _i0, t7, + t1 = type$.JSArray_ComplexSelector_2, + t2 = A._setArrayType([], t1); + for (t3 = this.components, t4 = t3.length, t5 = other.components, t6 = t5.length, _i = 0; _i < t4; ++_i) { + complex1 = t3[_i]; + for (_i0 = 0; _i0 < t6; ++_i0) { + t7 = A.unifyComplex0(A._setArrayType([complex1, t5[_i0]], t1), complex1.span); + if (t7 != null) + B.JSArray_methods.addAll$1(t2, t7); + } + } + return t2.length === 0 ? null : A.SelectorList$0(t2, this.span); + }, + resolveParentSelectors$2$implicitParent($parent, implicitParent) { + var parentSelector, t1, _this = this; + if ($parent == null) { + parentSelector = B.C__ParentSelectorVisitor0.visitSelectorList$1(_this); + if (parentSelector == null) + return _this; + throw A.wrapException(A.SassException$0(string$.Top_le, parentSelector.span, null)); + } + t1 = _this.components; + return A.SelectorList$0(A.flattenVertically0(new A.MappedListIterable(t1, new A.SelectorList_resolveParentSelectors_closure0(_this, implicitParent, $parent), A._arrayInstanceType(t1)._eval$1("MappedListIterable<1,Iterable>")), type$.ComplexSelector_2), _this.span); + }, + resolveParentSelectors$1($parent) { + return this.resolveParentSelectors$2$implicitParent($parent, true); + }, + _list2$_resolveParentSelectorsCompound$2(component, $parent) { + var resolvedSimples, parentSelector, error, stackTrace, t2, resolvedSimples0, exception, + t1 = component.selector, + simples = t1.components, + containsSelectorPseudo = J.any$1$ax(simples, new A.SelectorList__resolveParentSelectorsCompound_closure2()); + if (!containsSelectorPseudo && !(J.get$first$ax(simples) instanceof A.ParentSelector0)) + return null; + if (containsSelectorPseudo) { + t2 = simples; + resolvedSimples0 = new A.MappedListIterable(t2, new A.SelectorList__resolveParentSelectorsCompound_closure3($parent), A.instanceType(t2)._eval$1("MappedListIterable<1,SimpleSelector0>")); + } else + resolvedSimples0 = simples; + resolvedSimples = resolvedSimples0; + parentSelector = J.get$first$ax(simples); + try { + if (!(parentSelector instanceof A.ParentSelector0)) { + t2 = component.span; + t2 = A._setArrayType([A.ComplexSelector$0(B.List_empty14, A._setArrayType([new A.ComplexSelectorComponent0(A.CompoundSelector$0(resolvedSimples, t1.span), A.List_List$unmodifiable(component.combinators, type$.CssValue_Combinator_2), t2)], type$.JSArray_ComplexSelectorComponent_2), t2, false)], type$.JSArray_ComplexSelector_2); + return t2; + } else if (J.get$length$asx(simples) === 1 && parentSelector.suffix == null) { + t1 = $parent.withAdditionalCombinators$1(component.combinators); + return t1.components; + } + } catch (exception) { + t1 = A.unwrapException(exception); + if (t1 instanceof A.SassException0) { + error = t1; + stackTrace = A.getTraceFromException(exception); + A.throwWithTrace0(error.withAdditionalSpan$2(parentSelector.span, "parent selector"), error, stackTrace); + } else + throw exception; + } + t1 = $parent.components; + return new A.MappedListIterable(t1, new A.SelectorList__resolveParentSelectorsCompound_closure4(parentSelector, resolvedSimples, component), A._arrayInstanceType(t1)._eval$1("MappedListIterable<1,ComplexSelector0>")); + }, + isSuperselector$1(other) { + return A.listIsSuperselector0(this.components, other.components); + }, + withAdditionalCombinators$1(combinators) { + var t1; + if (combinators.length === 0) + t1 = this; + else { + t1 = this.components; + t1 = A.SelectorList$0(new A.MappedListIterable(t1, new A.SelectorList_withAdditionalCombinators_closure0(combinators), A._arrayInstanceType(t1)._eval$1("MappedListIterable<1,ComplexSelector0>")), this.span); + } + return t1; + }, + get$hashCode(_) { + return B.C_ListEquality0.hash$1(this.components); + }, + $eq(_, other) { + if (other == null) + return false; + return other instanceof A.SelectorList0 && B.C_ListEquality.equals$2(0, this.components, other.components); + } + }; + A.SelectorList_asSassList_closure0.prototype = { + call$1(complex) { + var t3, t4, _i, component, t5, visitor, t6, t7, _i0, + t1 = type$.JSArray_Value_2, + t2 = A._setArrayType([], t1); + for (t3 = complex.leadingCombinators, t4 = t3.length, _i = 0; _i < t4; ++_i) + t2.push(new A.SassString0(J.toString$0$(t3[_i].value), false)); + for (t3 = complex.components, t4 = t3.length, _i = 0; _i < t4; ++_i) { + component = t3[_i]; + t5 = component.selector; + visitor = A._SerializeVisitor$0(null, true, null, true, false, null, true); + t5.accept$1(visitor); + t5 = A._setArrayType([new A.SassString0(visitor._serialize0$_buffer.toString$0(0), false)], t1); + for (t6 = component.combinators, t7 = t6.length, _i0 = 0; _i0 < t7; ++_i0) + t5.push(new A.SassString0(J.toString$0$(t6[_i0].value), false)); + B.JSArray_methods.addAll$1(t2, t5); + } + return A.SassList$0(t2, B.ListSeparator_EVt0, false); + }, + $signature: 473 + }; + A.SelectorList_resolveParentSelectors_closure0.prototype = { + call$1(complex) { + var t1, newComplexes, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, _i, component, resolved, i, t12, t13, t14, _i0, newComplex, t15, _this = this; + if (complex.accept$1(B.C__ParentSelectorVisitor0) == null) { + if (!_this.implicitParent) + return A._setArrayType([complex], type$.JSArray_ComplexSelector_2); + t1 = _this.parent.components; + return new A.MappedListIterable(t1, new A.SelectorList_resolveParentSelectors__closure1(complex), A._arrayInstanceType(t1)._eval$1("MappedListIterable<1,ComplexSelector0>")); + } + t1 = type$.JSArray_ComplexSelector_2; + newComplexes = A._setArrayType([], t1); + for (t2 = complex.components, t3 = t2.length, t4 = _this.$this, t5 = _this.parent, t6 = type$.ComplexSelector_2, t7 = complex.leadingCombinators, t8 = t7.length === 0, t9 = complex.span, t10 = type$.ComplexSelectorComponent_2, t11 = type$.JSArray_ComplexSelectorComponent_2, _i = 0; _i < t3; ++_i) { + component = t2[_i]; + resolved = t4._list2$_resolveParentSelectorsCompound$2(component, t5); + if (resolved == null) + if (newComplexes.length === 0) + newComplexes.push(A.ComplexSelector$0(t7, A._setArrayType([component], t11), t9, false)); + else + for (i = 0; i < newComplexes.length; ++i) { + t12 = newComplexes[i]; + t13 = t12.leadingCombinators; + t14 = A.List_List$of(t12.components, true, t10); + t14.push(component); + newComplexes[i] = A.ComplexSelector$0(t13, t14, t9, t12.lineBreak || false); + } + else if (newComplexes.length === 0) + B.JSArray_methods.addAll$1(newComplexes, t8 ? resolved : J.map$1$1$ax(resolved, new A.SelectorList_resolveParentSelectors__closure2(complex), t6)); + else { + t12 = A._setArrayType([], t1); + for (t13 = newComplexes.length, t14 = J.getInterceptor$ax(resolved), _i0 = 0; _i0 < newComplexes.length; newComplexes.length === t13 || (0, A.throwConcurrentModificationError)(newComplexes), ++_i0) { + newComplex = newComplexes[_i0]; + for (t15 = t14.get$iterator(resolved); t15.moveNext$0();) + t12.push(newComplex.concatenate$2(t15.get$current(t15), newComplex.span)); + } + newComplexes = t12; + } + } + return newComplexes; + }, + $signature: 474 + }; + A.SelectorList_resolveParentSelectors__closure1.prototype = { + call$1(parentComplex) { + var t1 = this.complex; + return parentComplex.concatenate$2(t1, t1.span); + }, + $signature: 63 + }; + A.SelectorList_resolveParentSelectors__closure2.prototype = { + call$1(resolvedComplex) { + var t1 = resolvedComplex.leadingCombinators, + t2 = this.complex, + t3 = t2.leadingCombinators; + if (t1.length === 0) + t1 = t3; + else { + t3 = A.List_List$of(t3, true, type$.CssValue_Combinator_2); + B.JSArray_methods.addAll$1(t3, t1); + t1 = t3; + } + return A.ComplexSelector$0(t1, resolvedComplex.components, t2.span, resolvedComplex.lineBreak); + }, + $signature: 63 + }; + A.SelectorList__resolveParentSelectorsCompound_closure2.prototype = { + call$1(simple) { + var selector; + if (!(simple instanceof A.PseudoSelector0)) + return false; + selector = simple.selector; + return selector != null && selector.accept$1(B.C__ParentSelectorVisitor0) != null; + }, + $signature: 14 + }; + A.SelectorList__resolveParentSelectorsCompound_closure3.prototype = { + call$1(simple) { + var _0_2, selector, t1; + $label0$0: { + if (simple instanceof A.PseudoSelector0) { + _0_2 = simple.selector; + if (_0_2 != null) { + selector = _0_2 == null ? type$.SelectorList_2._as(_0_2) : _0_2; + t1 = selector.accept$1(B.C__ParentSelectorVisitor0) != null; + } else { + selector = null; + t1 = false; + } + } else { + selector = null; + t1 = false; + } + if (t1) { + t1 = simple.withSelector$1(selector.resolveParentSelectors$2$implicitParent(this.parent, false)); + break $label0$0; + } + t1 = simple; + break $label0$0; + } + return t1; + }, + $signature: 475 + }; + A.SelectorList__resolveParentSelectorsCompound_closure4.prototype = { + call$1(complex) { + var lastComponent, suffix, lastSimples, t1, t2, last, t3, error, stackTrace, t4, t5, t6, t7, exception, _this = this; + try { + t4 = complex.components; + lastComponent = B.JSArray_methods.get$last(t4); + if (lastComponent.combinators.length !== 0) { + t1 = A.MultiSpanSassException$0('Selector "' + complex.toString$0(0) + string$.x22x20can_, A.SpanExtensions_trimRight0(lastComponent.span), "outer selector", A.LinkedHashMap_LinkedHashMap$_literal([_this.parentSelector.span, "parent selector"], type$.FileSpan, type$.String), null); + throw A.wrapException(t1); + } + suffix = _this.parentSelector.suffix; + lastSimples = lastComponent.selector.components; + t5 = type$.SimpleSelector_2; + t6 = _this.resolvedSimples; + t7 = J.getInterceptor$ax(t6); + if (suffix == null) { + t1 = A.List_List$of(lastSimples, true, t5); + J.addAll$1$ax(t1, t7.skip$1(t6, 1)); + t1 = t1; + } else { + t2 = A.List_List$of(A.IterableExtension_get_exceptLast0(lastSimples), true, t5); + J.add$1$ax(t2, J.get$last$ax(lastSimples).addSuffix$1(suffix)); + J.addAll$1$ax(t2, t7.skip$1(t6, 1)); + t1 = t2; + } + t2 = _this.component; + last = A.CompoundSelector$0(t1, t2.selector.span); + t3 = A.List_List$of(A.IterableExtension_get_exceptLast0(t4), true, type$.ComplexSelectorComponent_2); + t4 = t2.span; + J.add$1$ax(t3, new A.ComplexSelectorComponent0(last, A.List_List$unmodifiable(t2.combinators, type$.CssValue_Combinator_2), t4)); + t4 = A.ComplexSelector$0(complex.leadingCombinators, t3, t4, complex.lineBreak); + return t4; + } catch (exception) { + t1 = A.unwrapException(exception); + if (t1 instanceof A.SassException0) { + error = t1; + stackTrace = A.getTraceFromException(exception); + A.throwWithTrace0(error.withAdditionalSpan$2(_this.parentSelector.span, "parent selector"), error, stackTrace); + } else + throw exception; + } + }, + $signature: 63 + }; + A.SelectorList_withAdditionalCombinators_closure0.prototype = { + call$1(complex) { + return complex.withAdditionalCombinators$1(this.combinators); + }, + $signature: 63 + }; + A._ParentSelectorVisitor0.prototype = { + visitParentSelector$1(selector) { + return selector; + } + }; + A.__ParentSelectorVisitor_Object_SelectorSearchVisitor0.prototype = {}; + A.listClass_closure.prototype = { + call$0() { + var t1 = type$.JSClass, + jsClass = t1._as(A.allowInteropCaptureThisNamed("sass.SassList", new A.listClass__closure())); + J.get$$prototype$x(jsClass).get = A.allowInteropCaptureThisNamed("get", new A.listClass__closure0()); + A.JSClassExtension_injectSuperclass(t1._as(B.SassList_nj9.constructor), jsClass); + return jsClass; + }, + $signature: 13 + }; + A.listClass__closure.prototype = { + call$3($self, contentsOrOptions, options) { + var contents, t1, t2; + if (self.immutable.isList(contentsOrOptions)) + contents = J.cast$1$0$ax(J.toArray$0$x(type$.ImmutableList._as(contentsOrOptions)), type$.Value_2); + else if (type$.List_dynamic._is(contentsOrOptions)) + contents = J.cast$1$0$ax(contentsOrOptions, type$.Value_2); + else { + contents = A._setArrayType([], type$.JSArray_Value_2); + type$.nullable__ConstructorOptions._as(contentsOrOptions); + options = contentsOrOptions; + } + t1 = options == null; + if (!t1) { + t2 = J.get$separator$x(options); + t2 = A._asBool($.$get$_isUndefined().call$1(t2)); + } else + t2 = true; + t2 = t2 ? B.ListSeparator_rXA0 : A.jsToDartSeparator(J.get$separator$x(options)); + t1 = t1 ? null : J.get$brackets$x(options); + return A.SassList$0(contents, t2, t1 == null ? false : t1); + }, + call$1($self) { + return this.call$3($self, null, null); + }, + call$2($self, contentsOrOptions) { + return this.call$3($self, contentsOrOptions, null); + }, + "call*": "call$3", + $requiredArgCount: 1, + $defaultValues() { + return [null, null]; + }, + $signature: 476 + }; + A.listClass__closure0.prototype = { + call$2($self, indexFloat) { + var index = B.JSNumber_methods.floor$0(indexFloat); + if (index < 0) + index = $self.get$asList().length + index; + if (index < 0 || index >= $self.get$asList().length) + return self.undefined; + return $self.get$asList()[index]; + }, + $signature: 182 + }; + A._ConstructorOptions.prototype = {}; + A._NodeSassList.prototype = {}; + A.legacyListClass_closure.prototype = { + call$4(thisArg, $length, commaSeparator, dartValue) { + var t1; + if (dartValue == null) { + $length.toString; + t1 = A.Iterable_Iterable$generate($length, new A.legacyListClass__closure(), type$.Value_2); + t1 = A.SassList$0(t1, commaSeparator !== false ? B.ListSeparator_rXA0 : B.ListSeparator_EVt0, false); + } else + t1 = dartValue; + J.set$dartValue$x(thisArg, t1); + }, + call$2(thisArg, $length) { + return this.call$4(thisArg, $length, null, null); + }, + call$3(thisArg, $length, commaSeparator) { + return this.call$4(thisArg, $length, commaSeparator, null); + }, + "call*": "call$4", + $requiredArgCount: 2, + $defaultValues() { + return [null, null]; + }, + $signature: 478 + }; + A.legacyListClass__closure.prototype = { + call$1(_) { + return B.C__SassNull0; + }, + $signature: 181 + }; + A.legacyListClass_closure0.prototype = { + call$2(thisArg, index) { + return A.wrapValue(J.get$dartValue$x(thisArg)._list1$_contents[index]); + }, + $signature: 480 + }; + A.legacyListClass_closure1.prototype = { + call$3(thisArg, index, value) { + var t1 = J.getInterceptor$x(thisArg), + t2 = t1.get$dartValue(thisArg)._list1$_contents, + mutable = A._setArrayType(t2.slice(0), A._arrayInstanceType(t2)); + mutable[index] = A.unwrapValue(value); + t1.set$dartValue(thisArg, t1.get$dartValue(thisArg).withListContents$1(mutable)); + }, + "call*": "call$3", + $requiredArgCount: 3, + $signature: 481 + }; + A.legacyListClass_closure2.prototype = { + call$1(thisArg) { + return J.get$dartValue$x(thisArg)._list1$_separator === B.ListSeparator_rXA0; + }, + $signature: 482 + }; + A.legacyListClass_closure3.prototype = { + call$2(thisArg, isComma) { + var t1 = J.getInterceptor$x(thisArg), + t2 = t1.get$dartValue(thisArg)._list1$_contents, + t3 = isComma ? B.ListSeparator_rXA0 : B.ListSeparator_EVt0; + t1.set$dartValue(thisArg, A.SassList$0(t2, t3, t1.get$dartValue(thisArg)._list1$_hasBrackets)); + }, + $signature: 483 + }; + A.legacyListClass_closure4.prototype = { + call$1(thisArg) { + return J.get$dartValue$x(thisArg)._list1$_contents.length; + }, + $signature: 484 + }; + A.SassList0.prototype = { + get$separator(_) { + return this._list1$_separator; + }, + get$hasBrackets() { + return this._list1$_hasBrackets; + }, + get$isBlank() { + return !this._list1$_hasBrackets && B.JSArray_methods.every$1(this._list1$_contents, new A.SassList_isBlank_closure0()); + }, + get$asList() { + return this._list1$_contents; + }, + get$lengthAsList() { + return this._list1$_contents.length; + }, + SassList$3$brackets0(contents, _separator, brackets) { + if (this._list1$_separator === B.ListSeparator_undecided_null_undecided0 && this._list1$_contents.length > 1) + throw A.wrapException(A.ArgumentError$(string$.A_list, null)); + }, + accept$1$1(visitor) { + return visitor.visitList$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + assertMap$1($name) { + return this._list1$_contents.length === 0 ? B.SassMap_Map_empty0 : this.super$Value$assertMap0($name); + }, + tryMap$0() { + return this._list1$_contents.length === 0 ? B.SassMap_Map_empty0 : null; + }, + $eq(_, other) { + var t1, _this = this; + if (other == null) + return false; + if (!(other instanceof A.SassList0 && other._list1$_separator === _this._list1$_separator && other._list1$_hasBrackets === _this._list1$_hasBrackets && B.C_ListEquality.equals$2(0, other._list1$_contents, _this._list1$_contents))) + t1 = _this._list1$_contents.length === 0 && other instanceof A.SassMap0 && other.get$asList().length === 0; + else + t1 = true; + return t1; + }, + get$hashCode(_) { + return B.C_ListEquality0.hash$1(this._list1$_contents); + } + }; + A.SassList_isBlank_closure0.prototype = { + call$1(element) { + return element.get$isBlank(); + }, + $signature: 49 + }; + A.ListSeparator0.prototype = { + _enumToString$0() { + return "ListSeparator." + this._name; + }, + toString$0(_) { + return this._list1$_name; + } + }; + A.JSLogger.prototype = {}; + A.WarnOptions.prototype = {}; + A.DebugOptions.prototype = {}; + A._QuietLogger0.prototype = { + warn$4$deprecation$span$trace(_, message, deprecation, span, trace) { + }, + warn$2$span(_, message, span) { + return this.warn$4$deprecation$span$trace(0, message, false, span, null); + } + }; + A.LoudComment0.prototype = { + get$span(_) { + return this.text.span; + }, + accept$1$1(visitor) { + return visitor.visitLoudComment$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + toString$0(_) { + return this.text.toString$0(0); + }, + $isAstNode0: 1, + $isStatement0: 1 + }; + A.MapExpression0.prototype = { + accept$1$1(visitor) { + return visitor.visitMapExpression$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + toString$0(_) { + var t2, t3, _i, t4, key, value, + t1 = A._setArrayType([], type$.JSArray_String); + for (t2 = this.pairs, t3 = t2.length, _i = 0; _i < t3; ++_i) { + t4 = t2[_i]; + key = t4._0; + value = t4._1; + t1.push(key.toString$0(0) + ": " + value.toString$0(0)); + } + return "(" + B.JSArray_methods.join$1(t1, ", ") + ")"; + }, + $isExpression0: 1, + $isAstNode0: 1, + get$span(receiver) { + return this.span; + } + }; + A._get_closure0.prototype = { + call$1($arguments) { + var value, + t1 = J.getInterceptor$asx($arguments), + map = t1.$index($arguments, 0).assertMap$1("map"), + t2 = A._setArrayType([t1.$index($arguments, 1)], type$.JSArray_Value_2); + B.JSArray_methods.addAll$1(t2, t1.$index($arguments, 2).get$asList()); + for (t1 = A.IterableExtension_get_exceptLast0(t2), t1 = t1.get$iterator(t1); t1.moveNext$0(); map = value) { + value = map._map0$_contents.$index(0, t1.get$current(t1)); + if (!(value instanceof A.SassMap0)) + return B.C__SassNull0; + } + t1 = map._map0$_contents.$index(0, B.JSArray_methods.get$last(t2)); + return t1 == null ? B.C__SassNull0 : t1; + }, + $signature: 3 + }; + A._set_closure1.prototype = { + call$1($arguments) { + var t1 = J.getInterceptor$asx($arguments); + return A._modify0(t1.$index($arguments, 0).assertMap$1("map"), A._setArrayType([t1.$index($arguments, 1)], type$.JSArray_Value_2), new A._set__closure2($arguments), true); + }, + $signature: 3 + }; + A._set__closure2.prototype = { + call$1(_) { + return J.$index$asx(this.$arguments, 2); + }, + $signature: 41 + }; + A._set_closure2.prototype = { + call$1($arguments) { + var keys, t1 = {}, + t2 = J.getInterceptor$asx($arguments), + map = t2.$index($arguments, 0).assertMap$1("map"), + _0_0 = t2.$index($arguments, 1).get$asList(), + _0_1 = _0_0.length; + if (_0_1 <= 0) + throw A.wrapException(A.SassScriptException$0("Expected $args to contain a key.", null)); + if (_0_1 === 1) + throw A.wrapException(A.SassScriptException$0("Expected $args to contain a value.", null)); + keys = t1.value = null; + if (_0_1 >= 1) { + keys = B.JSArray_methods.sublist$2(_0_0, 0, _0_1 - 1); + t1.value = _0_0[_0_1 - 1]; + t2 = true; + } else + t2 = false; + if (t2) + return A._modify0(map, keys, new A._set__closure1(t1), true); + throw A.wrapException("[BUG] Unreachable code"); + }, + $signature: 3 + }; + A._set__closure1.prototype = { + call$1(_) { + return this._box_0.value; + }, + $signature: 41 + }; + A._merge_closure1.prototype = { + call$1($arguments) { + var t2, + t1 = J.getInterceptor$asx($arguments), + map1 = t1.$index($arguments, 0).assertMap$1("map1"), + map2 = t1.$index($arguments, 1).assertMap$1("map2"); + t1 = type$.Value_2; + t2 = A.LinkedHashMap_LinkedHashMap$of(map1._map0$_contents, t1, t1); + t2.addAll$1(0, map2._map0$_contents); + return new A.SassMap0(A.ConstantMap_ConstantMap$from(t2, t1, t1)); + }, + $signature: 31 + }; + A._merge_closure2.prototype = { + call$1($arguments) { + var keys, last, _null = null, + t1 = J.getInterceptor$asx($arguments), + map1 = t1.$index($arguments, 0).assertMap$1("map1"), + _0_0 = t1.$index($arguments, 1).get$asList(), + _0_1 = _0_0.length; + if (_0_1 <= 0) + throw A.wrapException(A.SassScriptException$0("Expected $args to contain a key.", _null)); + if (_0_1 === 1) + throw A.wrapException(A.SassScriptException$0("Expected $args to contain a map.", _null)); + if (_0_1 >= 1) { + keys = B.JSArray_methods.sublist$2(_0_0, 0, _0_1 - 1); + last = _0_0[_0_1 - 1]; + t1 = true; + } else { + last = _null; + keys = last; + t1 = false; + } + if (t1) + return A._modify0(map1, keys, new A._merge__closure0(last.assertMap$1("map2")), true); + throw A.wrapException("[BUG] Unreachable code"); + }, + $signature: 3 + }; + A._merge__closure0.prototype = { + call$1(oldValue) { + var t1, t2, + nestedMap = oldValue.tryMap$0(); + if (nestedMap == null) + return this.map2; + t1 = type$.Value_2; + t2 = A.LinkedHashMap_LinkedHashMap$of(nestedMap._map0$_contents, t1, t1); + t2.addAll$1(0, this.map2._map0$_contents); + return new A.SassMap0(A.ConstantMap_ConstantMap$from(t2, t1, t1)); + }, + $signature: 485 + }; + A._deepMerge_closure0.prototype = { + call$1($arguments) { + var t1 = J.getInterceptor$asx($arguments); + return A._deepMergeImpl0(t1.$index($arguments, 0).assertMap$1("map1"), t1.$index($arguments, 1).assertMap$1("map2")); + }, + $signature: 31 + }; + A._deepRemove_closure0.prototype = { + call$1($arguments) { + var t1 = J.getInterceptor$asx($arguments), + map = t1.$index($arguments, 0).assertMap$1("map"), + t2 = A._setArrayType([t1.$index($arguments, 1)], type$.JSArray_Value_2); + B.JSArray_methods.addAll$1(t2, t1.$index($arguments, 2).get$asList()); + return A._modify0(map, A.IterableExtension_get_exceptLast0(t2), new A._deepRemove__closure0(t2), false); + }, + $signature: 3 + }; + A._deepRemove__closure0.prototype = { + call$1(value) { + var t1, nestedMap, t2, + _0_0 = value.tryMap$0(); + if (_0_0 != null) { + t1 = _0_0._map0$_contents.containsKey$1(B.JSArray_methods.get$last(this.keys)); + nestedMap = _0_0; + } else { + nestedMap = null; + t1 = false; + } + if (t1) { + t1 = type$.Value_2; + t2 = A.LinkedHashMap_LinkedHashMap$of(nestedMap._map0$_contents, t1, t1); + t2.remove$1(0, B.JSArray_methods.get$last(this.keys)); + return new A.SassMap0(A.ConstantMap_ConstantMap$from(t2, t1, t1)); + } + return value; + }, + $signature: 41 + }; + A._remove_closure1.prototype = { + call$1($arguments) { + return J.$index$asx($arguments, 0).assertMap$1("map"); + }, + $signature: 31 + }; + A._remove_closure2.prototype = { + call$1($arguments) { + var mutableMap, t3, _i, + t1 = J.getInterceptor$asx($arguments), + map = t1.$index($arguments, 0).assertMap$1("map"), + t2 = A._setArrayType([t1.$index($arguments, 1)], type$.JSArray_Value_2); + B.JSArray_methods.addAll$1(t2, t1.$index($arguments, 2).get$asList()); + t1 = type$.Value_2; + mutableMap = A.LinkedHashMap_LinkedHashMap$of(map._map0$_contents, t1, t1); + for (t3 = t2.length, _i = 0; _i < t2.length; t2.length === t3 || (0, A.throwConcurrentModificationError)(t2), ++_i) + mutableMap.remove$1(0, t2[_i]); + return new A.SassMap0(A.ConstantMap_ConstantMap$from(mutableMap, t1, t1)); + }, + $signature: 31 + }; + A._keys_closure0.prototype = { + call$1($arguments) { + var t1 = J.$index$asx($arguments, 0).assertMap$1("map")._map0$_contents; + return A.SassList$0(t1.get$keys(t1), B.ListSeparator_rXA0, false); + }, + $signature: 22 + }; + A._values_closure0.prototype = { + call$1($arguments) { + var t1 = J.$index$asx($arguments, 0).assertMap$1("map")._map0$_contents; + return A.SassList$0(t1.get$values(t1), B.ListSeparator_rXA0, false); + }, + $signature: 22 + }; + A._hasKey_closure0.prototype = { + call$1($arguments) { + var value, + t1 = J.getInterceptor$asx($arguments), + map = t1.$index($arguments, 0).assertMap$1("map"), + t2 = A._setArrayType([t1.$index($arguments, 1)], type$.JSArray_Value_2); + B.JSArray_methods.addAll$1(t2, t1.$index($arguments, 2).get$asList()); + for (t1 = A.IterableExtension_get_exceptLast0(t2), t1 = t1.get$iterator(t1); t1.moveNext$0(); map = value) { + value = map._map0$_contents.$index(0, t1.get$current(t1)); + if (!(value instanceof A.SassMap0)) + return B.SassBoolean_false0; + } + return map._map0$_contents.containsKey$1(B.JSArray_methods.get$last(t2)) ? B.SassBoolean_true0 : B.SassBoolean_false0; + }, + $signature: 20 + }; + A._modify_modifyNestedMap0.prototype = { + call$1(map) { + var nestedMap, _this = this, + t1 = type$.Value_2, + mutableMap = A.LinkedHashMap_LinkedHashMap$of(map._map0$_contents, t1, t1), + t2 = _this.keyIterator, + key = t2.get$current(t2); + if (!t2.moveNext$0()) { + t2 = mutableMap.$index(0, key); + if (t2 == null) + t2 = B.C__SassNull0; + mutableMap.$indexSet(0, key, _this.modify.call$1(t2)); + return new A.SassMap0(A.ConstantMap_ConstantMap$from(mutableMap, t1, t1)); + } + t2 = mutableMap.$index(0, key); + nestedMap = t2 == null ? null : t2.tryMap$0(); + t2 = nestedMap == null; + if (t2 && !_this.addNesting) + return new A.SassMap0(A.ConstantMap_ConstantMap$from(mutableMap, t1, t1)); + mutableMap.$indexSet(0, key, _this.call$1(t2 ? B.SassMap_Map_empty0 : nestedMap)); + return new A.SassMap0(A.ConstantMap_ConstantMap$from(mutableMap, t1, t1)); + }, + $signature: 486 + }; + A.MapExtensions_get_pairs_closure0.prototype = { + call$1(e) { + return new A._Record_2(e.key, e.value); + }, + $signature() { + return this.K._eval$1("@<0>")._bind$1(this.V)._eval$1("+(1,2)(MapEntry<1,2>)"); + } + }; + A.mapClass_closure.prototype = { + call$0() { + var t1 = type$.JSClass, + jsClass = t1._as(A.allowInteropCaptureThisNamed("sass.SassMap", new A.mapClass__closure())), + t2 = J.getInterceptor$x(jsClass); + A.defineGetter(t2.get$$prototype(jsClass), "contents", new A.mapClass__closure0(), null); + t2.get$$prototype(jsClass).get = A.allowInteropCaptureThisNamed("get", new A.mapClass__closure1()); + A.JSClassExtension_injectSuperclass(t1._as(B.SassMap_Map_empty0.constructor), jsClass); + return jsClass; + }, + $signature: 13 + }; + A.mapClass__closure.prototype = { + call$2($self, contents) { + var t1; + if (contents == null) + t1 = B.SassMap_Map_empty0; + else { + t1 = type$.Value_2; + t1 = new A.SassMap0(A.ConstantMap_ConstantMap$from(A.immutableMapToDartMap(contents).cast$2$0(0, t1, t1), t1, t1)); + } + return t1; + }, + call$1($self) { + return this.call$2($self, null); + }, + "call*": "call$2", + $requiredArgCount: 1, + $defaultValues() { + return [null]; + }, + $signature: 487 + }; + A.mapClass__closure0.prototype = { + call$1($self) { + return A.dartMapToImmutableMap($self._map0$_contents); + }, + $signature: 488 + }; + A.mapClass__closure1.prototype = { + call$2($self, indexOrKey) { + var index, t1, _0_0; + if (typeof indexOrKey == "number") { + index = B.JSNumber_methods.floor$0(indexOrKey); + if (index < 0) { + t1 = $self._map0$_contents; + index = t1.get$length(t1) + index; + } + if (index >= 0) { + t1 = $self._map0$_contents; + t1 = index >= t1.get$length(t1); + } else + t1 = true; + if (t1) + return self.undefined; + t1 = type$.Value_2; + _0_0 = A.MapExtensions_get_pairs0($self._map0$_contents, t1, t1).elementAt$1(0, index); + return A.SassList$0(A._setArrayType([_0_0._0, _0_0._1], type$.JSArray_Value_2), B.ListSeparator_EVt0, false); + } else { + t1 = $self._map0$_contents.$index(0, indexOrKey); + return t1 == null ? self.undefined : t1; + } + }, + $signature: 489 + }; + A._NodeSassMap.prototype = {}; + A.legacyMapClass_closure.prototype = { + call$3(thisArg, $length, dartValue) { + var t1, t2, t3, map; + if (dartValue == null) { + $length.toString; + t1 = type$.Value_2; + t2 = A.Iterable_Iterable$generate($length, new A.legacyMapClass__closure(), t1); + t3 = A.Iterable_Iterable$generate($length, new A.legacyMapClass__closure0(), t1); + map = A.LinkedHashMap_LinkedHashMap(null, null, null, t1, t1); + A.MapBase__fillMapWithIterables(map, t2, t3); + t1 = new A.SassMap0(A.ConstantMap_ConstantMap$from(map, t1, t1)); + } else + t1 = dartValue; + J.set$dartValue$x(thisArg, t1); + }, + call$2(thisArg, $length) { + return this.call$3(thisArg, $length, null); + }, + "call*": "call$3", + $requiredArgCount: 2, + $defaultValues() { + return [null]; + }, + $signature: 490 + }; + A.legacyMapClass__closure.prototype = { + call$1(i) { + return A.SassNumber_SassNumber0(i, null); + }, + $signature: 491 + }; + A.legacyMapClass__closure0.prototype = { + call$1(_) { + return B.C__SassNull0; + }, + $signature: 181 + }; + A.legacyMapClass_closure0.prototype = { + call$2(thisArg, index) { + var t1 = J.get$dartValue$x(thisArg)._map0$_contents; + return A.wrapValue(J.elementAt$1$ax(t1.get$keys(t1), index)); + }, + $signature: 175 + }; + A.legacyMapClass_closure1.prototype = { + call$2(thisArg, index) { + var t1 = J.get$dartValue$x(thisArg)._map0$_contents; + return A.wrapValue(t1.get$values(t1).elementAt$1(0, index)); + }, + $signature: 175 + }; + A.legacyMapClass_closure2.prototype = { + call$1(thisArg) { + var t1 = J.get$dartValue$x(thisArg)._map0$_contents; + return t1.get$length(t1); + }, + $signature: 493 + }; + A.legacyMapClass_closure3.prototype = { + call$3(thisArg, index, key) { + var newKey, t2, newMap, t3, i, t4, oldKey, oldValue, + t1 = J.getInterceptor$x(thisArg), + oldMap = t1.get$dartValue(thisArg)._map0$_contents, + $length = oldMap.get$length(oldMap); + A.IndexError_check(index, $length, oldMap, null, "index"); + newKey = A.unwrapValue(key); + t2 = type$.Value_2; + newMap = A.LinkedHashMap_LinkedHashMap$_empty(t2, t2); + for (t3 = A.MapExtensions_get_pairs0(t1.get$dartValue(thisArg)._map0$_contents, t2, t2), t3 = t3.get$iterator(t3), i = 0; t3.moveNext$0();) { + t4 = t3.get$current(t3); + oldKey = t4._0; + oldValue = t4._1; + if (i === index) + newMap.$indexSet(0, newKey, oldValue); + else { + if (newKey.$eq(0, oldKey)) + throw A.wrapException(A.ArgumentError$value(key, "key", "is already in the map")); + newMap.$indexSet(0, oldKey, oldValue); + } + ++i; + } + t1.set$dartValue(thisArg, new A.SassMap0(A.ConstantMap_ConstantMap$from(newMap, t2, t2))); + }, + "call*": "call$3", + $requiredArgCount: 3, + $signature: 173 + }; + A.legacyMapClass_closure4.prototype = { + call$3(thisArg, index, value) { + var t3, + t1 = J.getInterceptor$x(thisArg), + t2 = t1.get$dartValue(thisArg)._map0$_contents, + key = J.elementAt$1$ax(t2.get$keys(t2), index); + t2 = type$.Value_2; + t3 = A.LinkedHashMap_LinkedHashMap$of(t1.get$dartValue(thisArg)._map0$_contents, t2, t2); + t3.$indexSet(0, key, A.unwrapValue(value)); + t1.set$dartValue(thisArg, new A.SassMap0(A.ConstantMap_ConstantMap$from(t3, t2, t2))); + }, + "call*": "call$3", + $requiredArgCount: 3, + $signature: 173 + }; + A.SassMap0.prototype = { + get$separator(_) { + var t1 = this._map0$_contents; + return t1.get$isEmpty(t1) ? B.ListSeparator_undecided_null_undecided0 : B.ListSeparator_rXA0; + }, + get$asList() { + var t3, t4, t5, result, + t1 = type$.JSArray_Value_2, + t2 = A._setArrayType([], t1); + for (t3 = type$.Value_2, t4 = A.MapExtensions_get_pairs0(this._map0$_contents, t3, t3), t4 = t4.get$iterator(t4); t4.moveNext$0();) { + t5 = t4.get$current(t4); + result = A.List_List$from(A._setArrayType([t5._0, t5._1], t1), false, t3); + result.fixed$length = Array; + result.immutable$list = Array; + t2.push(new A.SassList0(result, B.ListSeparator_EVt0, false)); + } + return t2; + }, + get$lengthAsList() { + var t1 = this._map0$_contents; + return t1.get$length(t1); + }, + accept$1$1(visitor) { + return visitor.visitMap$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + assertMap$1($name) { + return this; + }, + tryMap$0() { + return this; + }, + $eq(_, other) { + var t1; + if (other == null) + return false; + if (!(other instanceof A.SassMap0 && B.C_MapEquality.equals$2(0, other._map0$_contents, this._map0$_contents))) { + t1 = this._map0$_contents; + t1 = t1.get$isEmpty(t1) && other instanceof A.SassList0 && other._list1$_contents.length === 0; + } else + t1 = true; + return t1; + }, + get$hashCode(_) { + var t1 = this._map0$_contents; + return t1.get$isEmpty(t1) ? B.C_ListEquality0.hash$1(B.List_empty19) : B.C_MapEquality.hash$1(t1); + } + }; + A.global_closure31.prototype = { + call$1($arguments) { + var t1, t2, + number = J.$index$asx($arguments, 0).assertNumber$1("number"); + if (number.hasUnit$1("%")) { + t1 = number.toString$0(0); + t2 = number.toString$0(0); + A.EvaluationContext_current0().warn$2(0, string$.Passinp + t1 + ")\nTo emit a CSS abs() now: abs(#{" + t2 + string$.x7d__Mor, B.Deprecation_la6); + } + t1 = number.get$numeratorUnits(number); + return A.SassNumber_SassNumber$withUnits0(Math.abs(number._number1$_value), number.get$denominatorUnits(number), t1); + }, + $signature: 11 + }; + A.module_closure11.prototype = { + call$1(value) { + return Math.abs(value); + }, + $signature: 37 + }; + A._ceil_closure0.prototype = { + call$1(value) { + return B.JSNumber_methods.ceil$0(value); + }, + $signature: 37 + }; + A._clamp_closure0.prototype = { + call$1($arguments) { + var t1 = J.getInterceptor$asx($arguments), + min = t1.$index($arguments, 0).assertNumber$1("min"), + number = t1.$index($arguments, 1).assertNumber$1("number"), + max = t1.$index($arguments, 2).assertNumber$1("max"); + number.convertValueToMatch$3(min, "number", "min"); + max.convertValueToMatch$3(min, "max", "min"); + if (min.greaterThanOrEquals$1(max).value) + return min; + if (min.greaterThanOrEquals$1(number).value) + return min; + if (number.greaterThanOrEquals$1(max).value) + return max; + return number; + }, + $signature: 11 + }; + A._floor_closure0.prototype = { + call$1(value) { + return B.JSNumber_methods.floor$0(value); + }, + $signature: 37 + }; + A._max_closure0.prototype = { + call$1($arguments) { + var t1, t2, max, _i, number; + for (t1 = J.$index$asx($arguments, 0).get$asList(), t2 = t1.length, max = null, _i = 0; _i < t1.length; t1.length === t2 || (0, A.throwConcurrentModificationError)(t1), ++_i) { + number = t1[_i].assertNumber$0(); + if (max == null || max.lessThan$1(number).value) + max = number; + } + if (max != null) + return max; + throw A.wrapException(A.SassScriptException$0("At least one argument must be passed.", null)); + }, + $signature: 11 + }; + A._min_closure0.prototype = { + call$1($arguments) { + var t1, t2, min, _i, number; + for (t1 = J.$index$asx($arguments, 0).get$asList(), t2 = t1.length, min = null, _i = 0; _i < t1.length; t1.length === t2 || (0, A.throwConcurrentModificationError)(t1), ++_i) { + number = t1[_i].assertNumber$0(); + if (min == null || min.greaterThan$1(number).value) + min = number; + } + if (min != null) + return min; + throw A.wrapException(A.SassScriptException$0("At least one argument must be passed.", null)); + }, + $signature: 11 + }; + A._round_closure0.prototype = { + call$1(number) { + return B.JSNumber_methods.round$0(number); + }, + $signature: 37 + }; + A._hypot_closure0.prototype = { + call$1($arguments) { + var subtotal, i, i0, t3, t4, + t1 = J.$index$asx($arguments, 0).get$asList(), + t2 = A._arrayInstanceType(t1)._eval$1("MappedListIterable<1,SassNumber0>"), + numbers = A.List_List$of(new A.MappedListIterable(t1, new A._hypot__closure0(), t2), true, t2._eval$1("ListIterable.E")); + t1 = numbers.length; + if (t1 === 0) + throw A.wrapException(A.SassScriptException$0("At least one argument must be passed.", null)); + for (subtotal = 0, i = 0; i < t1; i = i0) { + i0 = i + 1; + subtotal += Math.pow(numbers[i].convertValueToMatch$3(numbers[0], "numbers[" + i0 + "]", "numbers[1]"), 2); + } + t1 = Math.sqrt(subtotal); + t2 = numbers[0]; + t3 = J.getInterceptor$x(t2); + t4 = t3.get$numeratorUnits(t2); + return A.SassNumber_SassNumber$withUnits0(t1, t3.get$denominatorUnits(t2), t4); + }, + $signature: 11 + }; + A._hypot__closure0.prototype = { + call$1(argument) { + return argument.assertNumber$0(); + }, + $signature: 495 + }; + A._log_closure0.prototype = { + call$1($arguments) { + var base, + _s18_ = " to have no units.", + _null = null, + t1 = J.getInterceptor$asx($arguments), + number = t1.$index($arguments, 0).assertNumber$1("number"); + if (number.get$hasUnits()) + throw A.wrapException(A.SassScriptException$0("$number: Expected " + number.toString$0(0) + _s18_, _null)); + else if (J.$eq$(t1.$index($arguments, 1), B.C__SassNull0)) + return A.SassNumber_SassNumber0(Math.log(number._number1$_value), _null); + base = t1.$index($arguments, 1).assertNumber$1("base"); + if (base.get$hasUnits()) + throw A.wrapException(A.SassScriptException$0("$base: Expected " + base.toString$0(0) + _s18_, _null)); + else + return A.SassNumber_SassNumber0(Math.log(number._number1$_value) / Math.log(base._number1$_value), _null); + }, + $signature: 11 + }; + A._pow_closure0.prototype = { + call$1($arguments) { + var t1 = J.getInterceptor$asx($arguments); + return A.pow1(t1.$index($arguments, 0).assertNumber$1("base"), t1.$index($arguments, 1).assertNumber$1("exponent")); + }, + $signature: 11 + }; + A._atan2_closure0.prototype = { + call$1($arguments) { + var t1 = J.getInterceptor$asx($arguments), + y = t1.$index($arguments, 0).assertNumber$1("y"); + return A.SassNumber_SassNumber$withUnits0(Math.atan2(y._number1$_value, t1.$index($arguments, 1).assertNumber$1("x").convertValueToMatch$3(y, "x", "y")) * 57.29577951308232, null, A._setArrayType(["deg"], type$.JSArray_String)); + }, + $signature: 11 + }; + A._compatible_closure0.prototype = { + call$1($arguments) { + var t1 = J.getInterceptor$asx($arguments); + return t1.$index($arguments, 0).assertNumber$1("number1").isComparableTo$1(t1.$index($arguments, 1).assertNumber$1("number2")) ? B.SassBoolean_true0 : B.SassBoolean_false0; + }, + $signature: 20 + }; + A._isUnitless_closure0.prototype = { + call$1($arguments) { + return !J.$index$asx($arguments, 0).assertNumber$1("number").get$hasUnits() ? B.SassBoolean_true0 : B.SassBoolean_false0; + }, + $signature: 20 + }; + A._unit_closure0.prototype = { + call$1($arguments) { + return new A.SassString0(J.$index$asx($arguments, 0).assertNumber$1("number").get$unitString(), true); + }, + $signature: 17 + }; + A._percentage_closure0.prototype = { + call$1($arguments) { + var number = J.$index$asx($arguments, 0).assertNumber$1("number"); + number.assertNoUnits$1("number"); + return A.SassNumber_SassNumber0(number._number1$_value * 100, "%"); + }, + $signature: 11 + }; + A._randomFunction_closure0.prototype = { + call$1($arguments) { + var limit, t2, t3, t4, limitScalar, + t1 = J.getInterceptor$asx($arguments); + if (J.$eq$(t1.$index($arguments, 0), B.C__SassNull0)) + return A.SassNumber_SassNumber0($.$get$_random2().nextDouble$0(), null); + limit = t1.$index($arguments, 0).assertNumber$1("limit"); + if (limit.get$hasUnits()) { + t1 = limit.toString$0(0); + t2 = limit.get$unitString(); + t3 = limit.get$unitString(); + t4 = limit.get$unitString(); + A.EvaluationContext_current0().warn$2(0, string$.math_r + t1 + string$.x29x20in_a + t2 + ")) * 1" + t3 + string$.x0a_To_p + t4 + string$.x29x29__Mo, B.Deprecation_0bn); + } + limitScalar = limit.assertInt$1("limit"); + if (limitScalar < 1) + throw A.wrapException(A.SassScriptException$0("$limit: Must be greater than 0, was " + limit.toString$0(0) + ".", null)); + return A.SassNumber_SassNumber0($.$get$_random2().nextInt$1(limitScalar) + 1, null); + }, + $signature: 11 + }; + A._div_closure0.prototype = { + call$1($arguments) { + var t1 = J.getInterceptor$asx($arguments), + number1 = t1.$index($arguments, 0), + number2 = t1.$index($arguments, 1); + if (!(number1 instanceof A.SassNumber0) || !(number2 instanceof A.SassNumber0)) { + t1 = A.EvaluationContext_current0(); + t1.warn$2(0, string$.math_d, null); + } + return number1.dividedBy$1(number2); + }, + $signature: 3 + }; + A._singleArgumentMathFunc_closure0.prototype = { + call$1($arguments) { + return this.mathFunc.call$1(J.$index$asx($arguments, 0).assertNumber$1("number")); + }, + $signature: 11 + }; + A._numberFunction_closure0.prototype = { + call$1($arguments) { + var number = J.$index$asx($arguments, 0).assertNumber$1("number"), + t1 = this.transform.call$1(number._number1$_value), + t2 = number.get$numeratorUnits(number); + return A.SassNumber_SassNumber$withUnits0(t1, number.get$denominatorUnits(number), t2); + }, + $signature: 11 + }; + A.CssMediaQuery0.prototype = { + merge$1(other) { + var t1, ourModifier, t2, t3, ourType, t4, theirModifier, t5, t6, theirType, t7, t8, negativeConditions, conditions, type, modifier, fewerConditions, fewerConditions0, moreConditions, _this = this, _null = null, _s3_ = "all"; + if (!_this.conjunction || !other.conjunction) + return B._SingletonCssMediaQueryMergeResult_10; + t1 = _this.modifier; + ourModifier = t1 == null ? _null : t1.toLowerCase(); + t2 = _this.type; + t3 = t2 == null; + ourType = t3 ? _null : t2.toLowerCase(); + t4 = other.modifier; + theirModifier = t4 == null ? _null : t4.toLowerCase(); + t5 = other.type; + t6 = t5 == null; + theirType = t6 ? _null : t5.toLowerCase(); + t7 = ourType == null; + if (t7 && theirType == null) { + t1 = A.List_List$of(_this.conditions, true, type$.String); + B.JSArray_methods.addAll$1(t1, other.conditions); + return new A.MediaQuerySuccessfulMergeResult0(A.CssMediaQuery$condition0(t1, true)); + } + t8 = ourModifier === "not"; + if (t8 !== (theirModifier === "not")) { + if (ourType == theirType) { + negativeConditions = t8 ? _this.conditions : other.conditions; + if (B.JSArray_methods.every$1(negativeConditions, B.JSArray_methods.get$contains(t8 ? other.conditions : _this.conditions))) + return B._SingletonCssMediaQueryMergeResult_00; + else + return B._SingletonCssMediaQueryMergeResult_10; + } else if (t3 || A.equalsIgnoreCase0(t2, _s3_) || t6 || A.equalsIgnoreCase0(t5, _s3_)) + return B._SingletonCssMediaQueryMergeResult_10; + if (t8) { + conditions = other.conditions; + type = theirType; + modifier = theirModifier; + } else { + conditions = _this.conditions; + type = ourType; + modifier = ourModifier; + } + } else if (t8) { + if (ourType != theirType) + return B._SingletonCssMediaQueryMergeResult_10; + fewerConditions = _this.conditions; + fewerConditions0 = other.conditions; + t3 = fewerConditions.length > fewerConditions0.length; + moreConditions = t3 ? fewerConditions : fewerConditions0; + if (t3) + fewerConditions = fewerConditions0; + if (!B.JSArray_methods.every$1(fewerConditions, B.JSArray_methods.get$contains(moreConditions))) + return B._SingletonCssMediaQueryMergeResult_10; + conditions = moreConditions; + type = ourType; + modifier = ourModifier; + } else if (t3 || A.equalsIgnoreCase0(t2, _s3_)) { + type = (t6 || A.equalsIgnoreCase0(t5, _s3_)) && t7 ? _null : theirType; + t3 = A.List_List$of(_this.conditions, true, type$.String); + B.JSArray_methods.addAll$1(t3, other.conditions); + conditions = t3; + modifier = theirModifier; + } else { + if (t6 || A.equalsIgnoreCase0(t5, _s3_)) { + t3 = A.List_List$of(_this.conditions, true, type$.String); + B.JSArray_methods.addAll$1(t3, other.conditions); + conditions = t3; + modifier = ourModifier; + } else { + if (ourType != theirType) + return B._SingletonCssMediaQueryMergeResult_00; + else { + modifier = ourModifier == null ? theirModifier : ourModifier; + t3 = A.List_List$of(_this.conditions, true, type$.String); + B.JSArray_methods.addAll$1(t3, other.conditions); + } + conditions = t3; + } + type = ourType; + } + t2 = type == ourType ? t2 : t5; + return new A.MediaQuerySuccessfulMergeResult0(A.CssMediaQuery$type0(t2, conditions, modifier == ourModifier ? t1 : t4)); + }, + $eq(_, other) { + if (other == null) + return false; + return other instanceof A.CssMediaQuery0 && other.modifier == this.modifier && other.type == this.type && B.C_ListEquality.equals$2(0, other.conditions, this.conditions); + }, + get$hashCode(_) { + return J.get$hashCode$(this.modifier) ^ J.get$hashCode$(this.type) ^ B.C_ListEquality0.hash$1(this.conditions); + }, + toString$0(_) { + var t2, _this = this, + t1 = _this.modifier; + t1 = t1 != null ? "" + (t1 + " ") : ""; + t2 = _this.type; + if (t2 != null) { + t1 += t2; + if (_this.conditions.length !== 0) + t1 += " and "; + } + t2 = _this.conjunction ? " and " : " or "; + t2 = t1 + B.JSArray_methods.join$1(_this.conditions, t2); + return t2.charCodeAt(0) == 0 ? t2 : t2; + } + }; + A._SingletonCssMediaQueryMergeResult0.prototype = { + _enumToString$0() { + return "_SingletonCssMediaQueryMergeResult." + this._name; + } + }; + A.MediaQuerySuccessfulMergeResult0.prototype = { + toString$0(_) { + return this.query.toString$0(0); + } + }; + A.MediaQueryParser0.prototype = { + parse$0() { + return this.wrapSpanFormatException$1(new A.MediaQueryParser_parse_closure0(this)); + }, + _media_query$_mediaQuery$0() { + var conditions, conjunction, identifier1, identifier2, type, modifier, _this = this, _s3_ = "and", _null = null; + if (_this.scanner.peekChar$0() === 40) { + conditions = A._setArrayType([_this._media_query$_mediaInParens$0()], type$.JSArray_String); + _this.whitespace$0(); + if (_this.scanIdentifier$1(_s3_)) { + _this.expectWhitespace$0(); + B.JSArray_methods.addAll$1(conditions, _this._media_query$_mediaLogicSequence$1(_s3_)); + conjunction = true; + } else if (_this.scanIdentifier$1("or")) { + _this.expectWhitespace$0(); + B.JSArray_methods.addAll$1(conditions, _this._media_query$_mediaLogicSequence$1("or")); + conjunction = false; + } else + conjunction = true; + return A.CssMediaQuery$condition0(conditions, conjunction); + } + identifier1 = _this.identifier$0(); + if (A.equalsIgnoreCase0(identifier1, "not")) { + _this.expectWhitespace$0(); + if (!_this.lookingAtIdentifier$0()) + return A.CssMediaQuery$condition0(A._setArrayType(["(not " + _this._media_query$_mediaInParens$0() + ")"], type$.JSArray_String), _null); + } + _this.whitespace$0(); + if (!_this.lookingAtIdentifier$0()) + return A.CssMediaQuery$type0(identifier1, _null, _null); + identifier2 = _this.identifier$0(); + if (A.equalsIgnoreCase0(identifier2, _s3_)) { + _this.expectWhitespace$0(); + type = identifier1; + modifier = _null; + } else { + _this.whitespace$0(); + if (_this.scanIdentifier$1(_s3_)) + _this.expectWhitespace$0(); + else + return A.CssMediaQuery$type0(identifier2, _null, identifier1); + type = identifier2; + modifier = identifier1; + } + if (_this.scanIdentifier$1("not")) { + _this.expectWhitespace$0(); + return A.CssMediaQuery$type0(type, A._setArrayType(["(not " + _this._media_query$_mediaInParens$0() + ")"], type$.JSArray_String), modifier); + } + return A.CssMediaQuery$type0(type, _this._media_query$_mediaLogicSequence$1(_s3_), modifier); + }, + _media_query$_mediaLogicSequence$1(operator) { + var t1, t2, _this = this, + result = A._setArrayType([], type$.JSArray_String); + for (t1 = _this.scanner; true;) { + t1.expectChar$2$name(40, "media condition in parentheses"); + t2 = _this.declarationValue$0(); + t1.expectChar$1(41); + result.push("(" + t2 + ")"); + _this.whitespace$0(); + if (!_this.scanIdentifier$1(operator)) + return result; + _this.expectWhitespace$0(); + } + }, + _media_query$_mediaInParens$0() { + var t2, + t1 = this.scanner; + t1.expectChar$2$name(40, "media condition in parentheses"); + t2 = this.declarationValue$0(); + t1.expectChar$1(41); + return "(" + t2 + ")"; + } + }; + A.MediaQueryParser_parse_closure0.prototype = { + call$0() { + var queries = A._setArrayType([], type$.JSArray_CssMediaQuery_2), + t1 = this.$this, + t2 = t1.scanner; + do { + t1.whitespace$0(); + queries.push(t1._media_query$_mediaQuery$0()); + t1.whitespace$0(); + } while (t2.scanChar$1(44)); + t2.expectDone$0(); + return queries; + }, + $signature: 496 + }; + A.ModifiableCssMediaRule0.prototype = { + accept$1$1(visitor) { + return visitor.visitCssMediaRule$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + equalsIgnoringChildren$1(other) { + return other instanceof A.ModifiableCssMediaRule0 && B.C_ListEquality.equals$2(0, this.queries, other.queries); + }, + copyWithoutChildren$0() { + return A.ModifiableCssMediaRule$0(this.queries, this.span); + }, + get$span(receiver) { + return this.span; + } + }; + A.MediaRule0.prototype = { + accept$1$1(visitor) { + return visitor.visitMediaRule$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + toString$0(_) { + var t1 = this.children; + return "@media " + this.query.toString$0(0) + " {" + (t1 && B.JSArray_methods).join$1(t1, " ") + "}"; + }, + get$span(receiver) { + return this.span; + } + }; + A.MergedExtension0.prototype = { + unmerge$0() { + return new A._SyncStarIterable(this.unmerge$body$MergedExtension0(), type$._SyncStarIterable_Extension_2); + }, + unmerge$body$MergedExtension0() { + var $async$self = this; + return function() { + var $async$goto = 0, $async$handler = 1, $async$currentError, right, left; + return function $async$unmerge$0($async$iterator, $async$errorCode, $async$result) { + if ($async$errorCode === 1) { + $async$currentError = $async$result; + $async$goto = $async$handler; + } + while (true) + switch ($async$goto) { + case 0: + // Function start + left = $async$self.left; + $async$goto = left instanceof A.MergedExtension0 ? 2 : 4; + break; + case 2: + // then + $async$goto = 5; + return $async$iterator._yieldStar$1(left.unmerge$0()); + case 5: + // after yield + // goto join + $async$goto = 3; + break; + case 4: + // else + $async$goto = 6; + return $async$iterator._async$_current = left, 1; + case 6: + // after yield + case 3: + // join + right = $async$self.right; + $async$goto = right instanceof A.MergedExtension0 ? 7 : 9; + break; + case 7: + // then + $async$goto = 10; + return $async$iterator._yieldStar$1(right.unmerge$0()); + case 10: + // after yield + // goto join + $async$goto = 8; + break; + case 9: + // else + $async$goto = 11; + return $async$iterator._async$_current = right, 1; + case 11: + // after yield + case 8: + // join + // implicit return + return 0; + case 1: + // rethrow + return $async$iterator._datum = $async$currentError, 3; + } + }; + }; + } + }; + A.MergedMapView0.prototype = { + get$keys(_) { + var t1 = this._merged_map_view$_mapsByKey; + return new A.LinkedHashMapKeyIterable(t1, A._instanceType(t1)._eval$1("LinkedHashMapKeyIterable<1>")); + }, + get$length(_) { + return this._merged_map_view$_mapsByKey.__js_helper$_length; + }, + get$isEmpty(_) { + return this._merged_map_view$_mapsByKey.__js_helper$_length === 0; + }, + get$isNotEmpty(_) { + return this._merged_map_view$_mapsByKey.__js_helper$_length !== 0; + }, + MergedMapView$10(maps, $K, $V) { + var t1, t2, t3, _i, map, t4, t5, t6; + for (t1 = maps.length, t2 = this._merged_map_view$_mapsByKey, t3 = $K._eval$1("@<0>")._bind$1($V)._eval$1("MergedMapView0<1,2>"), _i = 0; _i < maps.length; maps.length === t1 || (0, A.throwConcurrentModificationError)(maps), ++_i) { + map = maps[_i]; + if (t3._is(map)) + for (t4 = map._merged_map_view$_mapsByKey.get$values(0), t5 = A._instanceType(t4), t5 = t5._eval$1("@<1>")._bind$1(t5._rest[1]), t4 = new A.MappedIterator(J.get$iterator$ax(t4.__internal$_iterable), t4._f, t5._eval$1("MappedIterator<1,2>")), t5 = t5._rest[1]; t4.moveNext$0();) { + t6 = t4.__internal$_current; + if (t6 == null) + t6 = t5._as(t6); + A.setAll0(t2, t6.get$keys(t6), t6); + } + else + A.setAll0(t2, map.get$keys(map), map); + } + }, + $index(_, key) { + var t1 = this._merged_map_view$_mapsByKey.$index(0, this.$ti._precomputed1._as(key)); + return t1 == null ? null : t1.$index(0, key); + }, + $indexSet(_, key, value) { + var _0_0 = this._merged_map_view$_mapsByKey.$index(0, key); + if (_0_0 != null) + _0_0.$indexSet(0, key, value); + else + throw A.wrapException(A.UnsupportedError$(string$.New_en)); + }, + remove$1(_, key) { + throw A.wrapException(A.UnsupportedError$(string$.Entrie)); + }, + containsKey$1(key) { + return this._merged_map_view$_mapsByKey.containsKey$1(key); + } + }; + A.global_closure59.prototype = { + call$1($arguments) { + return $._features0.contains$1(0, J.$index$asx($arguments, 0).assertString$1("feature")._string0$_text) ? B.SassBoolean_true0 : B.SassBoolean_false0; + }, + $signature: 20 + }; + A.global_closure60.prototype = { + call$1($arguments) { + return new A.SassString0(A.serializeValue0(J.get$first$ax($arguments), true, true), false); + }, + $signature: 17 + }; + A.global_closure61.prototype = { + call$1($arguments) { + var t1 = J.getInterceptor$asx($arguments), + _0_0 = t1.$index($arguments, 0); + $label0$0: { + if (_0_0 instanceof A.SassArgumentList0) { + t1 = "arglist"; + break $label0$0; + } + if (_0_0 instanceof A.SassBoolean0) { + t1 = "bool"; + break $label0$0; + } + if (_0_0 instanceof A.SassColor0) { + t1 = "color"; + break $label0$0; + } + if (_0_0 instanceof A.SassList0) { + t1 = "list"; + break $label0$0; + } + if (_0_0 instanceof A.SassMap0) { + t1 = "map"; + break $label0$0; + } + if (B.C__SassNull0 === _0_0) { + t1 = "null"; + break $label0$0; + } + if (_0_0 instanceof A.SassNumber0) { + t1 = "number"; + break $label0$0; + } + if (_0_0 instanceof A.SassFunction0) { + t1 = "function"; + break $label0$0; + } + if (_0_0 instanceof A.SassMixin0) { + t1 = "mixin"; + break $label0$0; + } + if (_0_0 instanceof A.SassCalculation0) { + t1 = "calculation"; + break $label0$0; + } + if (_0_0 instanceof A.SassString0) { + t1 = "string"; + break $label0$0; + } + t1 = A.throwExpression("[BUG] Unknown value type " + A.S(t1.$index($arguments, 0))); + } + return new A.SassString0(t1, false); + }, + $signature: 17 + }; + A.global_closure62.prototype = { + call$1($arguments) { + var t2, t3, t4, + t1 = J.getInterceptor$asx($arguments), + _1_0 = t1.$index($arguments, 0); + if (_1_0 instanceof A.SassArgumentList0) { + _1_0._argument_list$_wereKeywordsAccessed = true; + t1 = type$.Value_2; + t2 = A.LinkedHashMap_LinkedHashMap$_empty(t1, t1); + for (t3 = A.MapExtensions_get_pairs0(_1_0._argument_list$_keywords, type$.String, t1), t3 = t3.get$iterator(t3); t3.moveNext$0();) { + t4 = t3.get$current(t3); + t2.$indexSet(0, new A.SassString0(t4._0, false), t4._1); + } + return new A.SassMap0(A.ConstantMap_ConstantMap$from(t2, t1, t1)); + } else + throw A.wrapException("$args: " + A.S(t1.$index($arguments, 0)) + " is not an argument list."); + }, + $signature: 31 + }; + A.local_closure2.prototype = { + call$1($arguments) { + return new A.SassString0(J.$index$asx($arguments, 0).assertCalculation$1("calc").name, true); + }, + $signature: 17 + }; + A.local_closure3.prototype = { + call$1($arguments) { + var t1 = J.$index$asx($arguments, 0).assertCalculation$1("calc").$arguments; + return A.SassList$0(new A.MappedListIterable(t1, new A.local__closure0(), A._arrayInstanceType(t1)._eval$1("MappedListIterable<1,Value0>")), B.ListSeparator_rXA0, false); + }, + $signature: 22 + }; + A.local__closure0.prototype = { + call$1(argument) { + return argument instanceof A.Value0 ? argument : new A.SassString0(J.toString$0$(argument), false); + }, + $signature: 497 + }; + A.local_closure4.prototype = { + call$1($arguments) { + var _0_2, acceptsContent, _0_2_isSet, t1, _0_5, _0_5_isSet, hasContent, + mixin = J.$index$asx($arguments, 0).assertMixin$1("mixin"), + _0_0 = mixin.callable; + $label0$0: { + if (type$.AsyncBuiltInCallable_2._is(_0_0)) { + _0_2 = _0_0.get$acceptsContent(); + acceptsContent = _0_2; + _0_2_isSet = true; + t1 = true; + } else { + _0_2 = null; + _0_2_isSet = false; + acceptsContent = null; + t1 = false; + } + if (!t1) + if (_0_0 instanceof A.BuiltInCallable0) { + acceptsContent = _0_2_isSet ? _0_2 : _0_0.acceptsContent; + t1 = true; + } else + t1 = false; + else + t1 = true; + if (t1) { + t1 = acceptsContent; + break $label0$0; + } + if (_0_0 instanceof A.UserDefinedCallable0) { + _0_5 = _0_0.declaration; + t1 = _0_5 instanceof A.MixinRule0; + _0_5_isSet = true; + } else { + _0_5 = null; + _0_5_isSet = false; + t1 = false; + } + if (t1) { + t1 = _0_5_isSet ? _0_5 : _0_0.declaration; + hasContent = type$.MixinRule_2._as(t1).get$hasContent(); + t1 = hasContent; + break $label0$0; + } + t1 = A.throwExpression(A.UnsupportedError$("Unknown callable type " + mixin.toString$0(0) + ".")); + } + return t1 ? B.SassBoolean_true0 : B.SassBoolean_false0; + }, + $signature: 20 + }; + A.mixinClass_closure.prototype = { + call$0() { + var t1 = type$.JSClass, + jsClass = t1._as(A.allowInteropCaptureThisNamed("sass.SassMixin", new A.mixinClass__closure())); + A.JSClassExtension_injectSuperclass(t1._as(new A.SassMixin0(A.BuiltInCallable$function0("f", "", new A.mixinClass__closure0(), null)).constructor), jsClass); + return jsClass; + }, + $signature: 13 + }; + A.mixinClass__closure.prototype = { + call$1($self) { + A.jsThrow(new self.Error("It is not possible to construct a SassMixin through the JavaScript API")); + }, + $signature: 498 + }; + A.mixinClass__closure0.prototype = { + call$1(_) { + return B.C__SassNull0; + }, + $signature: 3 + }; + A.SassMixin0.prototype = { + accept$1$1(visitor) { + var t1, t2; + if (!visitor._serialize0$_inspect) + A.throwExpression(A.SassScriptException$0(this.toString$0(0) + " isn't a valid CSS value.", null)); + t1 = visitor._serialize0$_buffer; + t1.write$1(0, "get-mixin("); + t2 = this.callable; + visitor._serialize0$_visitQuotedString$1(t2.get$name(t2)); + t1.writeCharCode$1(41); + return null; + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + assertMixin$1($name) { + return this; + }, + $eq(_, other) { + if (other == null) + return false; + return other instanceof A.SassMixin0 && this.callable.$eq(0, other.callable); + }, + get$hashCode(_) { + var t1 = this.callable; + return t1.get$hashCode(t1); + } + }; + A.MixinRule0.prototype = { + get$hasContent() { + var result, _this = this, + value = _this._mixin_rule$__MixinRule_hasContent_FI; + if (value === $) { + result = J.$eq$(B.C__HasContentVisitor0.visitChildren$1(_this.children), true); + _this._mixin_rule$__MixinRule_hasContent_FI !== $ && A.throwUnnamedLateFieldADI(); + _this._mixin_rule$__MixinRule_hasContent_FI = result; + value = result; + } + return value; + }, + accept$1$1(visitor) { + return visitor.visitMixinRule$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + toString$0(_) { + var t1 = "@mixin " + this.name, + t2 = this.$arguments; + if (!(t2.$arguments.length === 0 && t2.restArgument == null)) + t1 += "(" + t2.toString$0(0) + ")"; + t2 = this.children; + t2 = t1 + (" {" + (t2 && B.JSArray_methods).join$1(t2, " ") + "}"); + return t2.charCodeAt(0) == 0 ? t2 : t2; + } + }; + A._HasContentVisitor0.prototype = { + visitContentRule$1(_) { + return true; + } + }; + A.__HasContentVisitor_Object_StatementSearchVisitor0.prototype = {}; + A.ExtendMode0.prototype = { + _enumToString$0() { + return "ExtendMode." + this._name; + }, + toString$0(_) { + return this.name; + } + }; + A.JSModule0.prototype = {}; + A.JSModuleRequire0.prototype = {}; + A.MultiSpan0.prototype = { + get$start(_) { + var t1 = this._multi_span0$_primary; + return t1.get$start(t1); + }, + get$end(_) { + var t1 = this._multi_span0$_primary; + return t1.get$end(t1); + }, + get$text() { + return this._multi_span0$_primary.get$text(); + }, + get$context(_) { + var t1 = this._multi_span0$_primary; + return t1.get$context(t1); + }, + get$file(_) { + var t1 = this._multi_span0$_primary; + return t1.get$file(t1); + }, + get$length(_) { + var t1 = this._multi_span0$_primary; + return t1.get$length(t1); + }, + get$sourceUrl(_) { + var t1 = this._multi_span0$_primary; + return t1.get$sourceUrl(t1); + }, + compareTo$1(_, other) { + return this._multi_span0$_primary.compareTo$1(0, other); + }, + toString$0(_) { + return this._multi_span0$_primary.toString$0(0); + }, + expand$1(_, other) { + return new A.MultiSpan0(this._multi_span0$_primary.expand$1(0, other), this.primaryLabel, this.secondarySpans); + }, + highlight$1$color(color) { + var t1 = color === true || false; + return A.Highlighter$multiple(this._multi_span0$_primary, this.primaryLabel, this.secondarySpans, t1, null, null).highlight$0(); + }, + message$2$color(_, message, color) { + var t1 = J.$eq$(color, true) || typeof color == "string", + t2 = typeof color == "string" ? color : null; + return A.SourceSpanExtension_messageMultiple(this._multi_span0$_primary, message, this.primaryLabel, this.secondarySpans, t1, t2, null); + }, + message$1(_, message) { + return this.message$2$color(0, message, null); + }, + $isComparable: 1, + $isFileSpan: 1, + $isSourceSpan: 1, + $isSourceSpanWithContext: 1 + }; + A.SupportsNegation0.prototype = { + toString$0(_) { + var t1 = this.condition; + if (t1 instanceof A.SupportsNegation0 || t1 instanceof A.SupportsOperation0) + return "not (" + t1.toString$0(0) + ")"; + else + return "not " + t1.toString$0(0); + }, + $isAstNode0: 1, + get$span(receiver) { + return this.span; + } + }; + A.NoOpImporter0.prototype = { + canonicalize$1(_, url) { + return null; + }, + load$1(_, url) { + return null; + }, + toString$0(_) { + return "(unknown)"; + } + }; + A.NoSourceMapBuffer0.prototype = { + get$length(_) { + return this._no_source_map_buffer0$_buffer._contents.length; + }, + forSpan$1$2(span, callback) { + return callback.call$0(); + }, + forSpan$2(span, callback) { + return this.forSpan$1$2(span, callback, type$.dynamic); + }, + write$1(_, object) { + this._no_source_map_buffer0$_buffer._contents += A.S(object); + return null; + }, + writeCharCode$1(charCode) { + this._no_source_map_buffer0$_buffer._contents += A.Primitives_stringFromCharCode(charCode); + return null; + }, + toString$0(_) { + var t1 = this._no_source_map_buffer0$_buffer._contents; + return t1.charCodeAt(0) == 0 ? t1 : t1; + }, + buildSourceMap$1$prefix(prefix) { + return A.throwExpression(A.UnsupportedError$(string$.NoSour)); + } + }; + A._FakeAstNode0.prototype = { + get$span(_) { + return this._node0$_callback.call$0(); + }, + $isAstNode0: 1 + }; + A.CssNode0.prototype = { + toString$0(_) { + return A.serialize0(this, true, null, true, null, false, null, true)._0; + }, + $isAstNode0: 1 + }; + A.CssParentNode0.prototype = {}; + A._IsInvisibleVisitor1.prototype = { + visitCssAtRule$1(rule) { + return false; + }, + visitCssComment$1(comment) { + return this.includeComments && comment.text.charCodeAt(2) !== 33; + }, + visitCssStyleRule$1(rule) { + var t1 = rule._style_rule0$_selector._box0$_inner; + return (this.includeBogus ? t1.value.accept$1(B._IsInvisibleVisitor_true0) : t1.value.accept$1(B._IsInvisibleVisitor_false0)) || this.super$EveryCssVisitor$visitCssStyleRule0(rule); + } + }; + A.__IsInvisibleVisitor_Object_EveryCssVisitor0.prototype = {}; + A.ModifiableCssNode0.prototype = { + get$hasFollowingSibling() { + var t2, + t1 = this._node$_parent; + if (t1 == null) + t1 = null; + else { + t1 = t1.children; + t2 = this._node$_indexInParent; + t2.toString; + t1 = A.SubListIterable$(t1, t2 + 1, null, t1.$ti._eval$1("ListBase.E")).any$1(0, new A.ModifiableCssNode_hasFollowingSibling_closure0()); + } + return t1 === true; + }, + get$isGroupEnd() { + return this.isGroupEnd; + } + }; + A.ModifiableCssNode_hasFollowingSibling_closure0.prototype = { + call$1(sibling) { + return !sibling.accept$1(B._IsInvisibleVisitor_true_false0); + }, + $signature: 130 + }; + A.ModifiableCssParentNode0.prototype = { + get$isChildless() { + return false; + }, + addChild$1(child) { + var t1; + child._node$_parent = this; + t1 = this._node$_children; + child._node$_indexInParent = t1.length; + t1.push(child); + }, + clearChildren$0() { + var t1, t2, _i, child; + for (t1 = this._node$_children, t2 = t1.length, _i = 0; _i < t2; ++_i) { + child = t1[_i]; + child._node$_indexInParent = child._node$_parent = null; + } + B.JSArray_methods.clear$0(t1); + }, + $isCssParentNode0: 1, + get$children(receiver) { + return this.children; + } + }; + A.NodePackageImporter0.prototype = { + isNonCanonicalScheme$1(scheme) { + return scheme === "pkg"; + }, + canonicalize$1(_, url) { + var packageName, jsonPath, jsonString, packageManifest, e, t1, t2, t3, t4, baseDirectory, parts, t5, $name, subpath, packageRoot, exception, _1_0, rootPath, subpathInRoot, _this = this, _null = null; + if (url.get$scheme() === "file") + return $.$get$FilesystemImporter_cwd0().canonicalize$1(0, url); + if (url.get$scheme() !== "pkg") + return _null; + if (url.get$hasAuthority()) + throw A.wrapException(string$.A_pkg_h); + else { + t1 = $.$get$url(); + t2 = t1.style; + if (t2.rootLength$1(url.get$path(url)) > 0) + throw A.wrapException("A pkg: URL's path must not begin with /."); + else if (url.get$path(url).length === 0) + throw A.wrapException("A pkg: URL must not have an empty path."); + else if (url.get$hasQuery() || url.get$hasFragment()) + throw A.wrapException(string$.A_pkg_q); + } + t3 = A.containingUrl0(); + if ((t3 == null ? _null : t3.get$scheme()) === "file") { + t3 = A.containingUrl0(); + t3.toString; + t4 = $.$get$context(); + baseDirectory = t4.dirname$1(t4.style.pathFromUri$1(A._parseUri(t3))); + } else { + t3 = _this._node_package$__NodePackageImporter__entryPointDirectory_F; + t3 === $ && A.throwUnnamedLateFieldNI(); + baseDirectory = t3; + } + packageName = null; + parts = t1.split$1(0, url.get$path(url)); + t3 = B.JSArray_methods.removeAt$1(parts, 0); + t4 = $.$get$context(); + t3.toString; + t5 = t4.style; + $name = t5.pathFromUri$1(A._parseUri(t3)); + if (B.JSString_methods.startsWith$1($name, "@")) + $name = parts.length !== 0 ? t1.join$2(0, $name, B.JSArray_methods.removeAt$1(parts, 0)) : $name; + subpath = parts.length !== 0 ? t5.pathFromUri$1(A._parseUri(t1.joinAll$1(parts))) : _null; + packageName = $name; + if (!J.startsWith$1$s(packageName, ".")) + if (!J.contains$1$asx(packageName, "\\")) + if (!J.contains$1$asx(packageName, "%")) + t1 = J.startsWith$1$s(packageName, "@") && !J.contains$1$asx(packageName, t2.get$separator(t2)); + else + t1 = true; + else + t1 = true; + else + t1 = true; + if (t1) + return _null; + packageRoot = _this._node_package$_resolvePackageRoot$2(packageName, baseDirectory); + if (packageRoot == null) + return _null; + jsonPath = A.join(packageRoot, "package.json", _null); + jsonString = A.readFile0(jsonPath); + packageManifest = null; + try { + packageManifest = type$.Map_String_dynamic._as(B.C_JsonCodec.decode$1(jsonString)); + } catch (exception) { + e = A.unwrapException(exception); + t1 = A.S(jsonPath); + t2 = A.S(packageName); + t3 = A.S(e); + throw A.wrapException("Failed to parse " + t1 + ' for "pkg:' + t2 + '": ' + t3); + } + _1_0 = _this._node_package$_resolvePackageExports$4(packageRoot, subpath, packageManifest, packageName); + if (_1_0 != null) + if (B.Set_HW1We.contains$1(0, A.ParsedPath_ParsedPath$parse(_1_0, t5)._splitExtension$1(1)[1])) + return t4.toUri$1(t4.canonicalize$1(0, _1_0)); + else { + t1 = subpath == null ? "root" : subpath; + throw A.wrapException("The export for '" + t1 + "' in '" + A.S(packageName) + "' resolved to '" + _1_0 + string$.x27x2c_whi); + } + if (subpath == null) { + rootPath = _this._node_package$_resolvePackageRootValues$2(packageRoot, packageManifest); + return rootPath != null ? t4.toUri$1(t4.canonicalize$1(0, rootPath)) : _null; + } + subpathInRoot = A.join(packageRoot, subpath, _null); + return $.$get$FilesystemImporter_cwd0().canonicalize$1(0, t4.toUri$1(subpathInRoot)); + }, + load$1(_, url) { + return $.$get$FilesystemImporter_cwd0().load$1(0, url); + }, + _node_package$_resolvePackageRoot$2(packageName, baseDirectory) { + var potentialPackage, t1; + for (; true;) { + potentialPackage = A.join(baseDirectory, "node_modules", packageName); + if (A.dirExists0(potentialPackage)) + return potentialPackage; + t1 = $.$get$context(); + if (t1.split$1(0, baseDirectory).length === 1) + return null; + baseDirectory = t1.dirname$1(baseDirectory); + } + }, + _node_package$_resolvePackageRootValues$2(packageRoot, packageManifest) { + var t1, sassValue, _1_0, styleValue, _null = null, + _0_0 = packageManifest.$index(0, "sass"); + if (typeof _0_0 == "string") { + t1 = B.Set_HW1We.contains$1(0, A.ParsedPath_ParsedPath$parse(_0_0, $.$get$url().style)._splitExtension$1(1)[1]); + sassValue = _0_0; + } else { + sassValue = _null; + t1 = false; + } + if (t1) + return A.join(packageRoot, sassValue, _null); + else { + _1_0 = packageManifest.$index(0, "style"); + if (typeof _1_0 == "string") { + t1 = B.Set_HW1We.contains$1(0, A.ParsedPath_ParsedPath$parse(_1_0, $.$get$url().style)._splitExtension$1(1)[1]); + styleValue = _1_0; + } else { + styleValue = _null; + t1 = false; + } + if (t1) + return A.join(packageRoot, styleValue, _null); + } + return A.resolveImportPath0(A.join(packageRoot, "index", _null)); + }, + _node_package$_resolvePackageExports$4(packageRoot, subpath, packageManifest, packageName) { + var _0_0, _1_0, _this = this, + exports = packageManifest.$index(0, "exports"); + if (exports == null) + return null; + _0_0 = _this._node_package$_nodePackageExportsResolve$5(packageRoot, _this._node_package$_exportsToCheck$1(subpath), exports, subpath, packageName); + if (_0_0 != null) + return _0_0; + if (subpath != null && A.ParsedPath_ParsedPath$parse(subpath, $.$get$url().style)._splitExtension$1(1)[1].length !== 0) + return null; + _1_0 = _this._node_package$_nodePackageExportsResolve$5(packageRoot, _this._node_package$_exportsToCheck$2$addIndex(subpath, true), exports, subpath, packageName); + if (_1_0 != null) + return _1_0; + return null; + }, + _node_package$_nodePackageExportsResolve$5(packageRoot, subpathVariants, exports, subpath, packageName) { + var t1, matches, _1_1, path; + if (type$.Map_String_dynamic._is(exports) && J.any$1$ax(exports.get$keys(exports), new A.NodePackageImporter__nodePackageExportsResolve_closure3()) && J.any$1$ax(exports.get$keys(exports), new A.NodePackageImporter__nodePackageExportsResolve_closure4())) + throw A.wrapException("`exports` in " + packageName + string$.x20can_n + J.map$1$1$ax(J.get$keys$z(exports), new A.NodePackageImporter__nodePackageExportsResolve_closure5(), type$.String).join$1(0, ",") + " in " + A.join(packageRoot, "package.json", null) + "."); + t1 = A.IterableNullableExtension_whereNotNull(new A.MappedListIterable(subpathVariants, new A.NodePackageImporter__nodePackageExportsResolve_closure6(this, exports, packageRoot), A._arrayInstanceType(subpathVariants)._eval$1("MappedListIterable<1,String?>")), type$.String); + matches = A.List_List$of(t1, true, t1.$ti._eval$1("Iterable.E")); + $label0$1: { + _1_1 = matches.length; + if (_1_1 === 1) { + path = matches[0]; + t1 = path; + break $label0$1; + } + if (_1_1 <= 0) { + t1 = null; + break $label0$1; + } + t1 = subpath == null ? "root" : subpath; + t1 = A.throwExpression(string$.Unable + t1 + " in " + packageName + " should be used. \n\nFound:\n" + B.JSArray_methods.join$1(matches, "\n")); + } + return t1; + }, + _node_package$_compareExpansionKeys$2(keyA, keyB) { + var t1 = B.JSString_methods.contains$1(keyA, "*"), + baseLengthA = t1 ? B.JSString_methods.indexOf$1(keyA, "*") + 1 : keyA.length, + t2 = B.JSString_methods.contains$1(keyB, "*"), + baseLengthB = t2 ? B.JSString_methods.indexOf$1(keyB, "*") + 1 : keyB.length; + if (baseLengthA > baseLengthB) + return -1; + if (baseLengthB > baseLengthA) + return 1; + if (!t1) + return 1; + if (!t2) + return -1; + t1 = keyA.length; + t2 = keyB.length; + if (t1 > t2) + return -1; + if (t2 > t1) + return 1; + return 0; + }, + _node_package$_packageTargetResolve$4(subpath, exports, packageRoot, patternMatch) { + var t2, string, path, map, key, value, _1_0, array, _2_0, _null = null, + t1 = typeof exports == "string"; + if (t1) { + t2 = !B.JSString_methods.startsWith$1(exports, "./"); + string = exports; + } else { + string = _null; + t2 = false; + } + if (t2) + throw A.wrapException("Export '" + A.S(string) + string$.x27x20must + packageRoot + "'."); + if (t1) { + t2 = patternMatch != null; + string = exports; + } else { + string = _null; + t2 = false; + } + if (t2) { + t1 = J.replaceFirst$2$s(string, "*", patternMatch); + t2 = $.$get$context(); + path = t2.normalize$1(A.join(packageRoot, t2.style.pathFromUri$1(A._parseUri(t1)), _null)); + return A.fileExists0(path) ? path : _null; + } + if (t1) { + string = exports; + t1 = true; + } else { + string = _null; + t1 = false; + } + if (t1) { + t1 = $.$get$context(); + string.toString; + return A.join(packageRoot, t1.style.pathFromUri$1(A._parseUri(string)), _null); + } + if (type$.Map_String_dynamic._is(exports)) { + map = exports; + t1 = true; + } else { + map = _null; + t1 = false; + } + if (t1) { + for (t1 = A.MapExtensions_get_pairs(map, type$.String, type$.dynamic), t1 = t1.get$iterator(t1); t1.moveNext$0();) { + t2 = t1.get$current(t1); + key = t2._0; + value = t2._1; + if (!B.Set_gkcz.contains$1(0, key)) + continue; + if (value == null) + continue; + _1_0 = this._node_package$_packageTargetResolve$4(subpath, value, packageRoot, patternMatch); + if (_1_0 != null) + return _1_0; + } + return _null; + } + if (type$.List_nullable_Object._is(exports) && J.get$length$asx(exports) <= 0) + return _null; + if (type$.List_dynamic._is(exports)) { + array = exports; + t1 = true; + } else { + array = _null; + t1 = false; + } + if (t1) { + for (t1 = J.get$iterator$ax(array); t1.moveNext$0();) { + value = t1.get$current(t1); + if (value == null) + continue; + _2_0 = this._node_package$_packageTargetResolve$4(subpath, value, packageRoot, patternMatch); + if (_2_0 != null) + return _2_0; + } + return _null; + } + throw A.wrapException("Invalid 'exports' value " + A.S(exports) + " in " + A.join(packageRoot, "package.json", _null) + "."); + }, + _node_package$_packageTargetResolve$3(subpath, exports, packageRoot) { + return this._node_package$_packageTargetResolve$4(subpath, exports, packageRoot, null); + }, + _node_package$_getMainExport$1(exports) { + var t1, t2, map, _0_4, _0_4_isSet, $export; + $label0$0: { + if (typeof exports == "string") { + t1 = exports; + break $label0$0; + } + if (type$.List_String._is(exports)) { + t1 = exports; + break $label0$0; + } + t1 = type$.Map_String_dynamic._is(exports); + if (t1) { + t2 = !J.any$1$ax(exports.get$keys(exports), new A.NodePackageImporter__getMainExport_closure0()); + map = exports; + } else { + map = null; + t2 = false; + } + if (t2) { + t1 = map; + break $label0$0; + } + if (t1) { + _0_4 = exports.$index(0, "."); + t1 = _0_4 == null; + if (t1) + t2 = exports.containsKey$1("."); + else + t2 = true; + if (t2) + t1 = !t1; + else + t1 = false; + _0_4_isSet = true; + } else { + _0_4 = null; + _0_4_isSet = false; + t1 = false; + } + if (t1) { + $export = _0_4_isSet ? _0_4 : J.$index$asx(exports, "."); + t1 = $export; + break $label0$0; + } + t1 = null; + break $label0$0; + } + return t1; + }, + _node_package$_exportsToCheck$2$addIndex(subpath, addIndex) { + var basename, dirname, t3, t4, _i, path, + t1 = type$.JSArray_String, + paths = A._setArrayType([], t1), + t2 = subpath == null; + if (t2 && addIndex) + subpath = "index"; + else if (!t2 && addIndex) + subpath = A.join(subpath, "index", null); + if (subpath == null) + return A._setArrayType([null], type$.JSArray_nullable_String); + if (B.Set_HW1We.contains$1(0, A.ParsedPath_ParsedPath$parse(subpath, $.$get$url().style)._splitExtension$1(1)[1])) + paths.push(subpath); + else + B.JSArray_methods.addAll$1(paths, A._setArrayType([subpath, subpath + ".scss", subpath + ".sass", subpath + ".css"], t1)); + t1 = $.$get$context(); + t2 = t1.style; + basename = A.ParsedPath_ParsedPath$parse(subpath, t2).get$basename(); + dirname = t1.dirname$1(subpath); + if (B.JSString_methods.startsWith$1(basename, "_")) + return paths; + t1 = A.List_List$of(paths, true, type$.nullable_String); + for (t3 = paths.length, t4 = dirname === ".", _i = 0; _i < paths.length; paths.length === t3 || (0, A.throwConcurrentModificationError)(paths), ++_i) { + path = paths[_i]; + if (t4) + t1.push("_" + A.ParsedPath_ParsedPath$parse(path, t2).get$basename()); + else + t1.push(A.join(dirname, "_" + A.ParsedPath_ParsedPath$parse(path, t2).get$basename(), null)); + } + return t1; + }, + _node_package$_exportsToCheck$1(subpath) { + return this._node_package$_exportsToCheck$2$addIndex(subpath, false); + } + }; + A.NodePackageImporter__nodePackageExportsResolve_closure3.prototype = { + call$1(key) { + return B.JSString_methods.startsWith$1(key, "."); + }, + $signature: 4 + }; + A.NodePackageImporter__nodePackageExportsResolve_closure4.prototype = { + call$1(key) { + return !B.JSString_methods.startsWith$1(key, "."); + }, + $signature: 4 + }; + A.NodePackageImporter__nodePackageExportsResolve_closure5.prototype = { + call$1(key) { + return '"' + key + '"'; + }, + $signature: 5 + }; + A.NodePackageImporter__nodePackageExportsResolve_closure6.prototype = { + call$1(variant) { + var t1, matchKey, t2, t3, t4, t5, t6, _i, expansionKey, _0_0, patternBase, patternTrailer, t7, t8, target, _this = this, _null = null; + if (variant == null) { + t1 = _this.$this; + return A.NullableExtension_andThen(t1._node_package$_getMainExport$1(_this.exports), new A.NodePackageImporter__nodePackageExportsResolve__closure1(t1, variant, _this.packageRoot)); + } else { + t1 = _this.exports; + if (!type$.Map_String_dynamic._is(t1) || J.every$1$ax(t1.get$keys(t1), new A.NodePackageImporter__nodePackageExportsResolve__closure2())) + return _null; + } + matchKey = "./" + $.$get$context().toUri$1(variant).toString$0(0); + if (t1.containsKey$1(matchKey) && J.$index$asx(t1, matchKey) != null && !B.JSString_methods.contains$1(matchKey, "*")) { + t1 = J.$index$asx(t1, matchKey); + if (t1 == null) + t1 = type$.Object._as(t1); + return _this.$this._node_package$_packageTargetResolve$3(matchKey, t1, _this.packageRoot); + } + t2 = A._setArrayType([], type$.JSArray_String); + for (t3 = J.getInterceptor$z(t1), t4 = J.get$iterator$ax(t3.get$keys(t1)); t4.moveNext$0();) { + t5 = t4.get$current(t4); + if (B.JSString_methods.allMatches$1("*", t5).get$length(0) === 1) + t2.push(t5); + } + t4 = _this.$this; + B.JSArray_methods.sort$1(t2, t4.get$_node_package$_compareExpansionKeys()); + for (t5 = t2.length, t6 = matchKey.length, _i = 0; _i < t2.length; t2.length === t5 || (0, A.throwConcurrentModificationError)(t2), ++_i) { + expansionKey = t2[_i]; + _0_0 = expansionKey.split("*"); + if (_0_0.length === 2) { + patternBase = _0_0[0]; + patternTrailer = _0_0[1]; + patternTrailer = patternTrailer; + t7 = true; + } else { + patternTrailer = _null; + patternBase = patternTrailer; + t7 = false; + } + if (!t7) + throw A.wrapException(A.StateError$("Pattern matching error")); + if (!B.JSString_methods.startsWith$1(matchKey, patternBase)) + continue; + if (matchKey === patternBase) + continue; + t7 = patternTrailer.length; + if (t7 !== 0) + t8 = B.JSString_methods.endsWith$1(matchKey, patternTrailer) && t6 >= expansionKey.length; + else + t8 = true; + if (t8) { + target = t3.$index(t1, expansionKey); + if (target == null) + continue; + return t4._node_package$_packageTargetResolve$4(variant, target, _this.packageRoot, B.JSString_methods.substring$2(matchKey, patternBase.length, t6 - t7)); + } + } + return _null; + }, + $signature: 154 + }; + A.NodePackageImporter__nodePackageExportsResolve__closure1.prototype = { + call$1(mainExport) { + return this.$this._node_package$_packageTargetResolve$3(this.variant, mainExport, this.packageRoot); + }, + $signature: 155 + }; + A.NodePackageImporter__nodePackageExportsResolve__closure2.prototype = { + call$1(key) { + return !B.JSString_methods.startsWith$1(key, "."); + }, + $signature: 4 + }; + A.NodePackageImporter__getMainExport_closure0.prototype = { + call$1(key) { + return B.JSString_methods.startsWith$1(key, "."); + }, + $signature: 4 + }; + A.NullExpression0.prototype = { + accept$1$1(visitor) { + return visitor.visitNullExpression$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + toString$0(_) { + return "null"; + }, + $isExpression0: 1, + $isAstNode0: 1, + get$span(receiver) { + return this.span; + } + }; + A.legacyNullClass_closure.prototype = { + call$0() { + var t1 = type$.JSClass, + jsClass = t1._as(A.allowInteropCaptureThisNamed("sass.types.Null", new A.legacyNullClass__closure())); + jsClass.NULL = B.C__SassNull0; + A.JSClassExtension_injectSuperclass(t1._as(B.C__SassNull0.constructor), jsClass); + return jsClass; + }, + $signature: 13 + }; + A.legacyNullClass__closure.prototype = { + call$2(_, __) { + throw A.wrapException("new sass.types.Null() isn't allowed. Use sass.types.Null.NULL instead."); + }, + call$1(_) { + return this.call$2(_, null); + }, + "call*": "call$2", + $requiredArgCount: 1, + $defaultValues() { + return [null]; + }, + $signature: 145 + }; + A._SassNull0.prototype = { + get$isTruthy() { + return false; + }, + get$isBlank() { + return true; + }, + get$realNull() { + return null; + }, + accept$1$1(visitor) { + if (visitor._serialize0$_inspect) + visitor._serialize0$_buffer.write$1(0, "null"); + return null; + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + unaryNot$0() { + return B.SassBoolean_true0; + } + }; + A.NumberExpression0.prototype = { + accept$1$1(visitor) { + return visitor.visitNumberExpression$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + toString$0(_) { + return A.serializeValue0(A.SassNumber_SassNumber0(this.value, this.unit), true, true); + }, + $isExpression0: 1, + $isAstNode0: 1, + get$span(receiver) { + return this.span; + } + }; + A.numberClass_closure.prototype = { + call$0() { + var t1 = type$.JSClass, + jsClass = t1._as(A.allowInteropCaptureThisNamed("sass.SassNumber", new A.numberClass__closure())), + t2 = type$.String, + t3 = type$.Function; + A.LinkedHashMap_LinkedHashMap$_literal(["value", new A.numberClass__closure0(), "isInt", new A.numberClass__closure1(), "asInt", new A.numberClass__closure2(), "numeratorUnits", new A.numberClass__closure3(), "denominatorUnits", new A.numberClass__closure4(), "hasUnits", new A.numberClass__closure5()], t2, t3).forEach$1(0, A.JSClassExtension_get_defineGetter(jsClass)); + A.LinkedHashMap_LinkedHashMap$_literal(["assertInt", new A.numberClass__closure6(), "assertInRange", new A.numberClass__closure7(), "assertNoUnits", new A.numberClass__closure8(), "assertUnit", new A.numberClass__closure9(), "hasUnit", new A.numberClass__closure10(), "compatibleWithUnit", new A.numberClass__closure11(), "convert", new A.numberClass__closure12(), "convertToMatch", new A.numberClass__closure13(), "convertValue", new A.numberClass__closure14(), "convertValueToMatch", new A.numberClass__closure15(), "coerce", new A.numberClass__closure16(), "coerceToMatch", new A.numberClass__closure17(), "coerceValue", new A.numberClass__closure18(), "coerceValueToMatch", new A.numberClass__closure19()], t2, t3).forEach$1(0, A.JSClassExtension_get_defineMethod(jsClass)); + A.JSClassExtension_injectSuperclass(t1._as(self.Object.getPrototypeOf(J.get$$prototype$x(t1._as(A.SassNumber_SassNumber0(0, null).constructor))).constructor), jsClass); + return jsClass; + }, + $signature: 13 + }; + A.numberClass__closure.prototype = { + call$3($self, value, unitOrOptions) { + var t1, t2, _null = null; + if (typeof unitOrOptions == "string") + return A.SassNumber_SassNumber0(value, unitOrOptions); + type$.nullable__ConstructorOptions_2._as(unitOrOptions); + t1 = unitOrOptions == null; + if (t1) + t2 = _null; + else { + t2 = A.NullableExtension_andThen0(J.get$numeratorUnits$x(unitOrOptions), A.immutable__jsToDartList$closure()); + t2 = t2 == null ? _null : J.cast$1$0$ax(t2, type$.String); + } + if (t1) + t1 = _null; + else { + t1 = A.NullableExtension_andThen0(J.get$denominatorUnits$x(unitOrOptions), A.immutable__jsToDartList$closure()); + t1 = t1 == null ? _null : J.cast$1$0$ax(t1, type$.String); + } + return A.SassNumber_SassNumber$withUnits0(value, t1, t2); + }, + call$2($self, value) { + return this.call$3($self, value, null); + }, + "call*": "call$3", + $requiredArgCount: 2, + $defaultValues() { + return [null]; + }, + $signature: 499 + }; + A.numberClass__closure0.prototype = { + call$1($self) { + return $self._number1$_value; + }, + $signature: 500 + }; + A.numberClass__closure1.prototype = { + call$1($self) { + return A.fuzzyIsInt($self._number1$_value); + }, + $signature: 171 + }; + A.numberClass__closure2.prototype = { + call$1($self) { + return A.fuzzyAsInt0($self._number1$_value); + }, + $signature: 502 + }; + A.numberClass__closure3.prototype = { + call$1($self) { + return new self.immutable.List($self.get$numeratorUnits($self)); + }, + $signature: 160 + }; + A.numberClass__closure4.prototype = { + call$1($self) { + return new self.immutable.List($self.get$denominatorUnits($self)); + }, + $signature: 160 + }; + A.numberClass__closure5.prototype = { + call$1($self) { + return $self.get$hasUnits(); + }, + $signature: 171 + }; + A.numberClass__closure6.prototype = { + call$2($self, $name) { + return $self.assertInt$1($name); + }, + call$1($self) { + return this.call$2($self, null); + }, + "call*": "call$2", + $requiredArgCount: 1, + $defaultValues() { + return [null]; + }, + $signature: 504 + }; + A.numberClass__closure7.prototype = { + call$4($self, min, max, $name) { + return $self.valueInRange$3(min, max, $name); + }, + call$3($self, min, max) { + return this.call$4($self, min, max, null); + }, + "call*": "call$4", + $requiredArgCount: 3, + $defaultValues() { + return [null]; + }, + $signature: 505 + }; + A.numberClass__closure8.prototype = { + call$2($self, $name) { + $self.assertNoUnits$1($name); + return $self; + }, + call$1($self) { + return this.call$2($self, null); + }, + "call*": "call$2", + $requiredArgCount: 1, + $defaultValues() { + return [null]; + }, + $signature: 506 + }; + A.numberClass__closure9.prototype = { + call$3($self, unit, $name) { + $self.assertUnit$2(unit, $name); + return $self; + }, + call$2($self, unit) { + return this.call$3($self, unit, null); + }, + "call*": "call$3", + $requiredArgCount: 2, + $defaultValues() { + return [null]; + }, + $signature: 625 + }; + A.numberClass__closure10.prototype = { + call$2($self, unit) { + return $self.hasUnit$1(unit); + }, + $signature: 159 + }; + A.numberClass__closure11.prototype = { + call$2($self, unit) { + return $self.get$hasUnits() && $self.compatibleWithUnit$1(unit); + }, + $signature: 159 + }; + A.numberClass__closure12.prototype = { + call$4($self, numeratorUnits, denominatorUnits, $name) { + var t1 = self.immutable.isOrderedMap(numeratorUnits) ? J.toArray$0$x(type$.ImmutableList._as(numeratorUnits)) : type$.List_dynamic._as(numeratorUnits), + t2 = type$.String; + t1 = J.cast$1$0$ax(t1, t2); + t2 = J.cast$1$0$ax(self.immutable.isOrderedMap(denominatorUnits) ? J.toArray$0$x(type$.ImmutableList._as(denominatorUnits)) : type$.List_dynamic._as(denominatorUnits), t2); + return A.SassNumber_SassNumber$withUnits0($self._number1$_coerceOrConvertValue$4$coerceUnitless$name(t1, t2, false, $name), t2, t1); + }, + call$3($self, numeratorUnits, denominatorUnits) { + return this.call$4($self, numeratorUnits, denominatorUnits, null); + }, + "call*": "call$4", + $requiredArgCount: 3, + $defaultValues() { + return [null]; + }, + $signature: 158 + }; + A.numberClass__closure13.prototype = { + call$4($self, other, $name, otherName) { + return $self.convertToMatch$3(other, $name, otherName); + }, + call$2($self, other) { + return this.call$4($self, other, null, null); + }, + call$3($self, other, $name) { + return this.call$4($self, other, $name, null); + }, + "call*": "call$4", + $requiredArgCount: 2, + $defaultValues() { + return [null, null]; + }, + $signature: 146 + }; + A.numberClass__closure14.prototype = { + call$4($self, numeratorUnits, denominatorUnits, $name) { + var t1 = self.immutable.isOrderedMap(numeratorUnits) ? J.toArray$0$x(type$.ImmutableList._as(numeratorUnits)) : type$.List_dynamic._as(numeratorUnits), + t2 = type$.String; + t1 = J.cast$1$0$ax(t1, t2); + return $self._number1$_coerceOrConvertValue$4$coerceUnitless$name(t1, J.cast$1$0$ax(self.immutable.isOrderedMap(denominatorUnits) ? J.toArray$0$x(type$.ImmutableList._as(denominatorUnits)) : type$.List_dynamic._as(denominatorUnits), t2), false, $name); + }, + call$3($self, numeratorUnits, denominatorUnits) { + return this.call$4($self, numeratorUnits, denominatorUnits, null); + }, + "call*": "call$4", + $requiredArgCount: 3, + $defaultValues() { + return [null]; + }, + $signature: 144 + }; + A.numberClass__closure15.prototype = { + call$4($self, other, $name, otherName) { + return $self.convertValueToMatch$3(other, $name, otherName); + }, + call$2($self, other) { + return this.call$4($self, other, null, null); + }, + call$3($self, other, $name) { + return this.call$4($self, other, $name, null); + }, + "call*": "call$4", + $requiredArgCount: 2, + $defaultValues() { + return [null, null]; + }, + $signature: 157 + }; + A.numberClass__closure16.prototype = { + call$4($self, numeratorUnits, denominatorUnits, $name) { + var t1 = self.immutable.isOrderedMap(numeratorUnits) ? J.toArray$0$x(type$.ImmutableList._as(numeratorUnits)) : type$.List_dynamic._as(numeratorUnits), + t2 = type$.String; + t1 = J.cast$1$0$ax(t1, t2); + return $self.coerce$3(t1, J.cast$1$0$ax(self.immutable.isOrderedMap(denominatorUnits) ? J.toArray$0$x(type$.ImmutableList._as(denominatorUnits)) : type$.List_dynamic._as(denominatorUnits), t2), $name); + }, + call$3($self, numeratorUnits, denominatorUnits) { + return this.call$4($self, numeratorUnits, denominatorUnits, null); + }, + "call*": "call$4", + $requiredArgCount: 3, + $defaultValues() { + return [null]; + }, + $signature: 158 + }; + A.numberClass__closure17.prototype = { + call$4($self, other, $name, otherName) { + return $self.coerceToMatch$3(other, $name, otherName); + }, + call$2($self, other) { + return this.call$4($self, other, null, null); + }, + call$3($self, other, $name) { + return this.call$4($self, other, $name, null); + }, + "call*": "call$4", + $requiredArgCount: 2, + $defaultValues() { + return [null, null]; + }, + $signature: 146 + }; + A.numberClass__closure18.prototype = { + call$4($self, numeratorUnits, denominatorUnits, $name) { + var t1 = self.immutable.isOrderedMap(numeratorUnits) ? J.toArray$0$x(type$.ImmutableList._as(numeratorUnits)) : type$.List_dynamic._as(numeratorUnits), + t2 = type$.String; + t1 = J.cast$1$0$ax(t1, t2); + return $self.coerceValue$3(t1, J.cast$1$0$ax(self.immutable.isOrderedMap(denominatorUnits) ? J.toArray$0$x(type$.ImmutableList._as(denominatorUnits)) : type$.List_dynamic._as(denominatorUnits), t2), $name); + }, + call$3($self, numeratorUnits, denominatorUnits) { + return this.call$4($self, numeratorUnits, denominatorUnits, null); + }, + "call*": "call$4", + $requiredArgCount: 3, + $defaultValues() { + return [null]; + }, + $signature: 144 + }; + A.numberClass__closure19.prototype = { + call$4($self, other, $name, otherName) { + return $self.coerceValueToMatch$3(other, $name, otherName); + }, + call$2($self, other) { + return this.call$4($self, other, null, null); + }, + call$3($self, other, $name) { + return this.call$4($self, other, $name, null); + }, + "call*": "call$4", + $requiredArgCount: 2, + $defaultValues() { + return [null, null]; + }, + $signature: 157 + }; + A._ConstructorOptions0.prototype = {}; + A._NodeSassNumber.prototype = {}; + A.legacyNumberClass_closure.prototype = { + call$4(thisArg, value, unit, dartValue) { + var t1; + if (dartValue == null) { + value.toString; + t1 = A._parseNumber(value, unit); + } else + t1 = dartValue; + J.set$dartValue$x(thisArg, t1); + }, + call$2(thisArg, value) { + return this.call$4(thisArg, value, null, null); + }, + call$3(thisArg, value, unit) { + return this.call$4(thisArg, value, unit, null); + }, + "call*": "call$4", + $requiredArgCount: 2, + $defaultValues() { + return [null, null]; + }, + $signature: 513 + }; + A.legacyNumberClass_closure0.prototype = { + call$1(thisArg) { + return J.get$dartValue$x(thisArg)._number1$_value; + }, + $signature: 514 + }; + A.legacyNumberClass_closure1.prototype = { + call$2(thisArg, value) { + var t1 = J.getInterceptor$x(thisArg), + t2 = J.get$numeratorUnits$x(t1.get$dartValue(thisArg)); + t1.set$dartValue(thisArg, A.SassNumber_SassNumber$withUnits0(value, J.get$denominatorUnits$x(t1.get$dartValue(thisArg)), t2)); + }, + $signature: 515 + }; + A.legacyNumberClass_closure2.prototype = { + call$1(thisArg) { + var t1 = J.getInterceptor$x(thisArg), + t2 = B.JSArray_methods.join$1(J.get$numeratorUnits$x(t1.get$dartValue(thisArg)), "*"), + t3 = J.get$denominatorUnits$x(t1.get$dartValue(thisArg)).length === 0 ? "" : "/"; + return t2 + t3 + B.JSArray_methods.join$1(J.get$denominatorUnits$x(t1.get$dartValue(thisArg)), "*"); + }, + $signature: 516 + }; + A.legacyNumberClass_closure3.prototype = { + call$2(thisArg, unit) { + var t1 = J.getInterceptor$x(thisArg); + t1.set$dartValue(thisArg, A._parseNumber(t1.get$dartValue(thisArg)._number1$_value, unit)); + }, + $signature: 517 + }; + A._parseNumber_closure.prototype = { + call$1(unit) { + return unit.length === 0; + }, + $signature: 4 + }; + A._parseNumber_closure0.prototype = { + call$1(unit) { + return unit.length === 0; + }, + $signature: 4 + }; + A.SassNumber0.prototype = { + get$unitString() { + var _this = this; + return _this.get$hasUnits() ? _this._number1$_unitString$2(_this.get$numeratorUnits(_this), _this.get$denominatorUnits(_this)) : ""; + }, + accept$1$1(visitor) { + return visitor.visitNumber$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + withoutSlash$0() { + var _this = this; + return _this.asSlash == null ? _this : _this.withValue$1(_this._number1$_value); + }, + assertNumber$1($name) { + return this; + }, + assertNumber$0() { + return this.assertNumber$1(null); + }, + assertInt$1($name) { + var _0_0 = A.fuzzyAsInt0(this._number1$_value); + if (_0_0 != null) + return _0_0; + throw A.wrapException(A.SassScriptException$0(this.toString$0(0) + " is not an int.", $name)); + }, + assertInt$0() { + return this.assertInt$1(null); + }, + valueInRange$3(min, max, $name) { + var _this = this, + _0_0 = A.fuzzyCheckRange0(_this._number1$_value, min, max); + if (_0_0 != null) + return _0_0; + throw A.wrapException(A.SassScriptException$0("Expected " + _this.toString$0(0) + " to be within " + A.S(min) + _this.get$unitString() + " and " + A.S(max) + _this.get$unitString() + ".", $name)); + }, + valueInRangeWithUnit$4(min, max, $name, unit) { + var _0_0 = A.fuzzyCheckRange0(this._number1$_value, min, max); + if (_0_0 != null) + return _0_0; + throw A.wrapException(A.SassScriptException$0("Expected " + this.toString$0(0) + " to be within " + min + unit + " and " + max + unit + ".", $name)); + }, + hasCompatibleUnits$1(other) { + var _this = this; + if (_this.get$numeratorUnits(_this).length !== other.get$numeratorUnits(other).length) + return false; + if (_this.get$denominatorUnits(_this).length !== other.get$denominatorUnits(other).length) + return false; + return _this.isComparableTo$1(other); + }, + assertUnit$2(unit, $name) { + if (this.hasUnit$1(unit)) + return; + throw A.wrapException(A.SassScriptException$0("Expected " + this.toString$0(0) + ' to have unit "' + unit + '".', $name)); + }, + assertNoUnits$1($name) { + if (!this.get$hasUnits()) + return; + throw A.wrapException(A.SassScriptException$0("Expected " + this.toString$0(0) + " to have no units.", $name)); + }, + assertNoUnits$0() { + return this.assertNoUnits$1(null); + }, + convertToMatch$3(other, $name, otherName) { + var t1 = this.convertValueToMatch$3(other, $name, otherName), + t2 = other.get$numeratorUnits(other); + return A.SassNumber_SassNumber$withUnits0(t1, other.get$denominatorUnits(other), t2); + }, + convertValueToMatch$3(other, $name, otherName) { + return this._number1$_coerceOrConvertValue$6$coerceUnitless$name$other$otherName(other.get$numeratorUnits(other), other.get$denominatorUnits(other), false, $name, other, otherName); + }, + convertValueToMatch$1(other) { + return this.convertValueToMatch$3(other, null, null); + }, + coerce$3(newNumerators, newDenominators, $name) { + return A.SassNumber_SassNumber$withUnits0(this.coerceValue$3(newNumerators, newDenominators, $name), newDenominators, newNumerators); + }, + coerce$2(newNumerators, newDenominators) { + return this.coerce$3(newNumerators, newDenominators, null); + }, + coerceValue$3(newNumerators, newDenominators, $name) { + return this._number1$_coerceOrConvertValue$4$coerceUnitless$name(newNumerators, newDenominators, true, $name); + }, + coerceValueToUnit$2(unit, $name) { + var t1 = type$.JSArray_String; + return this.coerceValue$3(A._setArrayType([unit], t1), A._setArrayType([], t1), $name); + }, + coerceValueToUnit$1(unit) { + return this.coerceValueToUnit$2(unit, null); + }, + coerceToMatch$3(other, $name, otherName) { + var t1 = this.coerceValueToMatch$3(other, $name, otherName), + t2 = other.get$numeratorUnits(other); + return A.SassNumber_SassNumber$withUnits0(t1, other.get$denominatorUnits(other), t2); + }, + coerceValueToMatch$3(other, $name, otherName) { + return this._number1$_coerceOrConvertValue$6$coerceUnitless$name$other$otherName(other.get$numeratorUnits(other), other.get$denominatorUnits(other), true, $name, other, otherName); + }, + coerceValueToMatch$1(other) { + return this.coerceValueToMatch$3(other, null, null); + }, + _number1$_coerceOrConvertValue$6$coerceUnitless$name$other$otherName(newNumerators, newDenominators, coerceUnitless, $name, other, otherName) { + var t1, otherHasUnits, t2, compatibilityException, oldNumerators, oldDenominators, _this = this, _box_0 = {}; + if (B.C_ListEquality.equals$2(0, _this.get$numeratorUnits(_this), newNumerators) && B.C_ListEquality.equals$2(0, _this.get$denominatorUnits(_this), newDenominators)) + return _this._number1$_value; + t1 = J.getInterceptor$asx(newNumerators); + otherHasUnits = t1.get$isNotEmpty(newNumerators) || J.get$isNotEmpty$asx(newDenominators); + if (coerceUnitless) + t2 = !_this.get$hasUnits() || !otherHasUnits; + else + t2 = false; + if (t2) + return _this._number1$_value; + compatibilityException = new A.SassNumber__coerceOrConvertValue_compatibilityException0(_this, other, otherName, otherHasUnits, $name, newNumerators, newDenominators); + _box_0.value = _this._number1$_value; + t2 = _this.get$numeratorUnits(_this); + oldNumerators = A._setArrayType(t2.slice(0), A._arrayInstanceType(t2)); + for (t1 = t1.get$iterator(newNumerators); t1.moveNext$0();) + A.removeFirstWhere0(oldNumerators, new A.SassNumber__coerceOrConvertValue_closure3(_box_0, t1.get$current(t1)), new A.SassNumber__coerceOrConvertValue_closure4(compatibilityException)); + t1 = _this.get$denominatorUnits(_this); + oldDenominators = A._setArrayType(t1.slice(0), A._arrayInstanceType(t1)); + for (t1 = J.get$iterator$ax(newDenominators); t1.moveNext$0();) + A.removeFirstWhere0(oldDenominators, new A.SassNumber__coerceOrConvertValue_closure5(_box_0, t1.get$current(t1)), new A.SassNumber__coerceOrConvertValue_closure6(compatibilityException)); + if (oldNumerators.length !== 0 || oldDenominators.length !== 0) + throw A.wrapException(compatibilityException.call$0()); + return _box_0.value; + }, + _number1$_coerceOrConvertValue$4$coerceUnitless$name(newNumerators, newDenominators, coerceUnitless, $name) { + return this._number1$_coerceOrConvertValue$6$coerceUnitless$name$other$otherName(newNumerators, newDenominators, coerceUnitless, $name, null, null); + }, + isComparableTo$1(other) { + var exception; + if (!this.get$hasUnits() || !other.get$hasUnits()) + return true; + try { + this.greaterThan$1(other); + return true; + } catch (exception) { + if (A.unwrapException(exception) instanceof A.SassScriptException0) + return false; + else + throw exception; + } + }, + greaterThan$1(other) { + if (other instanceof A.SassNumber0) + return this._number1$_coerceUnits$2(other, A.number2__fuzzyGreaterThan$closure()) ? B.SassBoolean_true0 : B.SassBoolean_false0; + throw A.wrapException(A.SassScriptException$0('Undefined operation "' + this.toString$0(0) + " > " + other.toString$0(0) + '".', null)); + }, + greaterThanOrEquals$1(other) { + if (other instanceof A.SassNumber0) + return this._number1$_coerceUnits$2(other, A.number2__fuzzyGreaterThanOrEquals$closure()) ? B.SassBoolean_true0 : B.SassBoolean_false0; + throw A.wrapException(A.SassScriptException$0('Undefined operation "' + this.toString$0(0) + " >= " + other.toString$0(0) + '".', null)); + }, + lessThan$1(other) { + if (other instanceof A.SassNumber0) + return this._number1$_coerceUnits$2(other, A.number2__fuzzyLessThan$closure()) ? B.SassBoolean_true0 : B.SassBoolean_false0; + throw A.wrapException(A.SassScriptException$0('Undefined operation "' + this.toString$0(0) + " < " + other.toString$0(0) + '".', null)); + }, + lessThanOrEquals$1(other) { + if (other instanceof A.SassNumber0) + return this._number1$_coerceUnits$2(other, A.number2__fuzzyLessThanOrEquals$closure()) ? B.SassBoolean_true0 : B.SassBoolean_false0; + throw A.wrapException(A.SassScriptException$0('Undefined operation "' + this.toString$0(0) + " <= " + other.toString$0(0) + '".', null)); + }, + modulo$1(other) { + if (other instanceof A.SassNumber0) + return this.withValue$1(this._number1$_coerceUnits$2(other, A.number2__moduloLikeSass$closure())); + throw A.wrapException(A.SassScriptException$0('Undefined operation "' + this.toString$0(0) + " % " + other.toString$0(0) + '".', null)); + }, + plus$1(other) { + var _this = this; + if (other instanceof A.SassNumber0) + return _this.withValue$1(_this._number1$_coerceUnits$2(other, new A.SassNumber_plus_closure0())); + if (!(other instanceof A.SassColor0)) + return _this.super$Value$plus0(other); + throw A.wrapException(A.SassScriptException$0('Undefined operation "' + _this.toString$0(0) + " + " + other.toString$0(0) + '".', null)); + }, + minus$1(other) { + var _this = this; + if (other instanceof A.SassNumber0) + return _this.withValue$1(_this._number1$_coerceUnits$2(other, new A.SassNumber_minus_closure0())); + if (!(other instanceof A.SassColor0)) + return _this.super$Value$minus0(other); + throw A.wrapException(A.SassScriptException$0('Undefined operation "' + _this.toString$0(0) + " - " + other.toString$0(0) + '".', null)); + }, + times$1(other) { + var _this = this; + if (other instanceof A.SassNumber0) { + if (!other.get$hasUnits()) + return _this.withValue$1(_this._number1$_value * other._number1$_value); + return _this.multiplyUnits$3(_this._number1$_value * other._number1$_value, other.get$numeratorUnits(other), other.get$denominatorUnits(other)); + } + throw A.wrapException(A.SassScriptException$0('Undefined operation "' + _this.toString$0(0) + " * " + other.toString$0(0) + '".', null)); + }, + dividedBy$1(other) { + var _this = this; + if (other instanceof A.SassNumber0) { + if (!other.get$hasUnits()) + return _this.withValue$1(_this._number1$_value / other._number1$_value); + return _this.multiplyUnits$3(_this._number1$_value / other._number1$_value, other.get$denominatorUnits(other), other.get$numeratorUnits(other)); + } + return _this.super$Value$dividedBy0(other); + }, + unaryPlus$0() { + return this; + }, + _number1$_coerceUnits$1$2(other, operation) { + var t1, exception; + try { + t1 = operation.call$2(this._number1$_value, other.coerceValueToMatch$1(this)); + return t1; + } catch (exception) { + if (A.unwrapException(exception) instanceof A.SassScriptException0) { + this.coerceValueToMatch$1(other); + throw exception; + } else + throw exception; + } + }, + _number1$_coerceUnits$2(other, operation) { + return this._number1$_coerceUnits$1$2(other, operation, type$.dynamic); + }, + multiplyUnits$3(value, otherNumerators, otherDenominators) { + var t1, _0_1, _0_2, _0_3, _0_6, t2, _0_7, _0_9, _0_9_isSet, _0_7_isSet, _0_3_isSet, denominators_case_0, _0_6_isSet, _0_11, _0_10, _0_2_isSet, _0_13, numerators_case_0, _0_13_isSet, _0_11_isSet, t3, t4, denominators_case_1, numerators_case_1, newNumerators, mutableOtherDenominators, _i, numerator, mutableDenominatorUnits, _this = this, _null = null, _box_0 = {}; + _box_0.value = value; + t1 = [_this.get$numeratorUnits(_this), _this.get$denominatorUnits(_this), otherNumerators, otherDenominators]; + _0_1 = t1[0]; + _0_2 = t1[1]; + _0_3 = t1[2]; + _0_6 = _0_3.length <= 0; + t2 = _0_6; + if (t2) { + _0_7 = t1[3]; + _0_9 = _0_7.length <= 0; + t2 = _0_9; + _0_9_isSet = true; + _0_7_isSet = true; + } else { + _0_7 = _null; + _0_9 = _0_7; + _0_9_isSet = false; + _0_7_isSet = false; + t2 = false; + } + _0_3_isSet = true; + denominators_case_0 = _0_2; + _0_6_isSet = true; + if (!t2) { + _0_11 = _0_1.length <= 0; + t2 = _0_11; + _0_10 = _0_1; + if (t2) { + t2 = _0_2; + _0_2_isSet = true; + _0_13 = t2.length <= 0; + t2 = _0_13; + if (t2) { + if (_0_3_isSet) + numerators_case_0 = _0_3; + else { + _0_3 = t1[2]; + numerators_case_0 = _0_3; + _0_3_isSet = true; + } + if (_0_7_isSet) + denominators_case_0 = _0_7; + else { + _0_7 = t1[3]; + denominators_case_0 = _0_7; + _0_7_isSet = true; + } + t2 = true; + } else { + numerators_case_0 = _0_1; + t2 = false; + } + _0_13_isSet = true; + } else { + numerators_case_0 = _0_1; + _0_13 = _null; + _0_2_isSet = true; + _0_13_isSet = false; + t2 = false; + } + _0_1 = _0_10; + _0_11_isSet = true; + } else { + numerators_case_0 = _0_1; + _0_13 = _null; + _0_11 = _0_13; + _0_2_isSet = true; + _0_11_isSet = false; + _0_13_isSet = false; + t2 = true; + } + if (t2) { + t3 = denominators_case_0; + t2 = numerators_case_0; + t4 = true; + } else { + t3 = _null; + t2 = t3; + t4 = false; + } + if (!t4) { + if (_0_11_isSet) + t4 = _0_11; + else { + _0_11 = _0_1.length <= 0; + t4 = _0_11; + } + if (t4) { + if (_0_2_isSet) + denominators_case_1 = _0_2; + else { + _0_2 = t1[1]; + denominators_case_1 = _0_2; + _0_2_isSet = true; + } + if (_0_3_isSet) + numerators_case_1 = _0_3; + else { + _0_3 = t1[2]; + numerators_case_1 = _0_3; + _0_3_isSet = true; + } + if (_0_9_isSet) + t4 = _0_9; + else { + if (_0_7_isSet) + t4 = _0_7; + else { + _0_7 = t1[3]; + t4 = _0_7; + _0_7_isSet = true; + } + _0_9 = t4.length <= 0; + t4 = _0_9; + } + } else { + numerators_case_1 = _null; + denominators_case_1 = numerators_case_1; + t4 = false; + } + if (!t4) { + if (_0_13_isSet) + t4 = _0_13; + else { + _0_13 = (_0_2_isSet ? _0_2 : t1[1]).length <= 0; + t4 = _0_13; + } + if (t4) { + if (_0_6_isSet) + t4 = _0_6; + else { + _0_6 = (_0_3_isSet ? _0_3 : t1[2]).length <= 0; + t4 = _0_6; + } + if (t4) { + denominators_case_1 = _0_7_isSet ? _0_7 : t1[3]; + t1 = true; + } else + t1 = false; + } else + t1 = false; + numerators_case_1 = _0_1; + } else + t1 = true; + if (t1) + if (!_this._number1$_areAnyConvertible$2(numerators_case_1, denominators_case_1)) { + t2 = denominators_case_1; + t1 = numerators_case_1; + t3 = true; + } else { + t1 = t2; + t2 = t3; + t3 = false; + } + else { + t1 = t2; + t2 = t3; + t3 = false; + } + } else { + t1 = t2; + t2 = t3; + t3 = true; + } + if (t3) + return A.SassNumber_SassNumber$withUnits0(value, t2, t1); + newNumerators = A._setArrayType([], type$.JSArray_String); + mutableOtherDenominators = A._setArrayType(otherDenominators.slice(0), A._arrayInstanceType(otherDenominators)); + for (t1 = _this.get$numeratorUnits(_this), t2 = t1.length, _i = 0; _i < t2; ++_i) { + numerator = t1[_i]; + A.removeFirstWhere0(mutableOtherDenominators, new A.SassNumber_multiplyUnits_closure3(_box_0, numerator), new A.SassNumber_multiplyUnits_closure4(newNumerators, numerator)); + } + t1 = _this.get$denominatorUnits(_this); + mutableDenominatorUnits = A._setArrayType(t1.slice(0), A._arrayInstanceType(t1)); + for (t1 = otherNumerators.length, _i = 0; _i < t1; ++_i) { + numerator = otherNumerators[_i]; + A.removeFirstWhere0(mutableDenominatorUnits, new A.SassNumber_multiplyUnits_closure5(_box_0, numerator), new A.SassNumber_multiplyUnits_closure6(newNumerators, numerator)); + } + t1 = _box_0.value; + B.JSArray_methods.addAll$1(mutableDenominatorUnits, mutableOtherDenominators); + return A.SassNumber_SassNumber$withUnits0(t1, mutableDenominatorUnits, newNumerators); + }, + _number1$_areAnyConvertible$2(units1, units2) { + return B.JSArray_methods.any$1(units1, new A.SassNumber__areAnyConvertible_closure0(units2)); + }, + _number1$_unitString$2(numerators, denominators) { + var _0_4, _0_6, t1, _0_7, _0_5, _0_7_isSet, _0_6_isSet, _0_5_isSet, _null = null; + $label0$0: { + _0_4 = J.get$length$asx(numerators) <= 0; + if (_0_4) { + _0_6 = J.get$length$asx(denominators); + t1 = _0_6; + _0_7 = t1 <= 0; + t1 = _0_7; + _0_5 = denominators; + _0_7_isSet = true; + _0_6_isSet = true; + _0_5_isSet = true; + } else { + _0_5 = _null; + _0_6 = _0_5; + _0_7 = _0_6; + _0_7_isSet = false; + _0_6_isSet = false; + _0_5_isSet = false; + t1 = false; + } + if (t1) { + t1 = "no units"; + break $label0$0; + } + if (_0_4) { + if (_0_6_isSet) + t1 = _0_6; + else { + if (_0_5_isSet) + t1 = _0_5; + else { + t1 = denominators; + _0_5 = t1; + _0_5_isSet = true; + } + _0_6 = J.get$length$asx(t1); + t1 = _0_6; + _0_6_isSet = true; + } + t1 = t1 === 1; + } else + t1 = false; + if (t1) { + t1 = J.$index$asx(_0_5_isSet ? _0_5 : denominators, 0) + "^-1"; + break $label0$0; + } + if (_0_4) { + t1 = "(" + J.join$1$ax(denominators, "*") + ")^-1"; + break $label0$0; + } + if (_0_7_isSet) + t1 = _0_7; + else { + if (_0_6_isSet) + t1 = _0_6; + else { + _0_6 = J.get$length$asx(_0_5_isSet ? _0_5 : denominators); + t1 = _0_6; + } + _0_7 = t1 <= 0; + t1 = _0_7; + } + if (t1) { + t1 = J.join$1$ax(numerators, "*"); + break $label0$0; + } + t1 = J.join$1$ax(numerators, "*") + "/" + J.join$1$ax(denominators, "*"); + break $label0$0; + } + return t1; + }, + $eq(_, other) { + var _this = this; + if (other == null) + return false; + if (!(other instanceof A.SassNumber0)) + return false; + if (_this.get$numeratorUnits(_this).length !== other.get$numeratorUnits(other).length || _this.get$denominatorUnits(_this).length !== other.get$denominatorUnits(other).length) + return false; + if (!_this.get$hasUnits()) + return A.fuzzyEquals0(_this._number1$_value, other._number1$_value); + if (!B.C_ListEquality.equals$2(0, _this._number1$_canonicalizeUnitList$1(_this.get$numeratorUnits(_this)), _this._number1$_canonicalizeUnitList$1(other.get$numeratorUnits(other))) || !B.C_ListEquality.equals$2(0, _this._number1$_canonicalizeUnitList$1(_this.get$denominatorUnits(_this)), _this._number1$_canonicalizeUnitList$1(other.get$denominatorUnits(other)))) + return false; + return A.fuzzyEquals0(_this._number1$_value * _this._number1$_canonicalMultiplier$1(_this.get$numeratorUnits(_this)) / _this._number1$_canonicalMultiplier$1(_this.get$denominatorUnits(_this)), other._number1$_value * _this._number1$_canonicalMultiplier$1(other.get$numeratorUnits(other)) / _this._number1$_canonicalMultiplier$1(other.get$denominatorUnits(other))); + }, + get$hashCode(_) { + var _this = this, + t1 = _this.hashCache; + return t1 == null ? _this.hashCache = A.fuzzyHashCode0(_this._number1$_value * _this._number1$_canonicalMultiplier$1(_this.get$numeratorUnits(_this)) / _this._number1$_canonicalMultiplier$1(_this.get$denominatorUnits(_this))) : t1; + }, + _number1$_canonicalizeUnitList$1(units) { + var type, + t1 = units.length; + if (t1 === 0) + return units; + if (t1 === 1) { + type = $.$get$_typesByUnit0().$index(0, B.JSArray_methods.get$first(units)); + if (type == null) + t1 = units; + else { + t1 = B.Map_ws7dy.$index(0, type); + t1.toString; + t1 = A._setArrayType([B.JSArray_methods.get$first(t1)], type$.JSArray_String); + } + return t1; + } + t1 = A._arrayInstanceType(units)._eval$1("MappedListIterable<1,String>"); + t1 = A.List_List$of(new A.MappedListIterable(units, new A.SassNumber__canonicalizeUnitList_closure0(), t1), true, t1._eval$1("ListIterable.E")); + B.JSArray_methods.sort$0(t1); + return t1; + }, + _number1$_canonicalMultiplier$1(units) { + return B.JSArray_methods.fold$2(units, 1, new A.SassNumber__canonicalMultiplier_closure0(this)); + }, + canonicalMultiplierForUnit$1(unit) { + var t1, + innerMap = B.Map_nfuzN.$index(0, unit); + if (innerMap == null) + t1 = 1; + else { + t1 = innerMap.get$values(innerMap); + t1 = 1 / t1.get$first(t1); + } + return t1; + }, + unitSuggestion$2($name, unit) { + var t2, t3, result, _this = this, + t1 = _this.get$denominatorUnits(_this); + t1 = new A.MappedListIterable(t1, new A.SassNumber_unitSuggestion_closure1(), A._arrayInstanceType(t1)._eval$1("MappedListIterable<1,String>")).join$0(0); + t2 = _this.get$numeratorUnits(_this); + t2 = new A.MappedListIterable(t2, new A.SassNumber_unitSuggestion_closure2(), A._arrayInstanceType(t2)._eval$1("MappedListIterable<1,String>")).join$0(0); + t3 = unit == null ? "" : " * 1" + unit; + result = "$" + $name + t1 + t2 + t3; + return _this.get$numeratorUnits(_this).length === 0 ? result : "calc(" + result + ")"; + }, + unitSuggestion$1($name) { + return this.unitSuggestion$2($name, null); + } + }; + A.SassNumber__coerceOrConvertValue_compatibilityException0.prototype = { + call$0() { + var t2, t3, message, t4, type, unit, _this = this, + t1 = _this.other; + if (t1 != null) { + t2 = _this.$this; + t3 = t2.toString$0(0) + " and"; + message = new A.StringBuffer(t3); + t4 = _this.otherName; + if (t4 != null) + t3 = message._contents = t3 + (" $" + t4 + ":"); + t1 = t3 + (" " + t1.toString$0(0) + " have incompatible units"); + message._contents = t1; + if (!t2.get$hasUnits() || !_this.otherHasUnits) + message._contents = t1 + " (one has units and the other doesn't)"; + t1 = message.toString$0(0) + "."; + t2 = _this.name; + return new A.SassScriptException0(t2 == null ? t1 : "$" + t2 + ": " + t1); + } else if (!_this.otherHasUnits) { + t1 = "Expected " + _this.$this.toString$0(0) + " to have no units."; + t2 = _this.name; + return new A.SassScriptException0(t2 == null ? t1 : "$" + t2 + ": " + t1); + } else { + t1 = _this.newNumerators; + t2 = J.getInterceptor$asx(t1); + if (t2.get$length(t1) === 1 && J.get$isEmpty$asx(_this.newDenominators)) { + type = $.$get$_typesByUnit0().$index(0, t2.get$first(t1)); + if (type != null) { + t1 = _this.$this.toString$0(0); + t2 = B.JSArray_methods.contains$1(A._setArrayType([97, 101, 105, 111, 117], type$.JSArray_int), type.charCodeAt(0)) ? "an " + type : "a " + type; + t3 = B.Map_ws7dy.$index(0, type); + t3.toString; + t3 = "Expected " + t1 + " to have " + t2 + " unit (" + B.JSArray_methods.join$1(t3, ", ") + ")."; + t2 = _this.name; + return new A.SassScriptException0(t2 == null ? t3 : "$" + t2 + ": " + t3); + } + } + t3 = _this.newDenominators; + unit = A.pluralize0("unit", t2.get$length(t1) + J.get$length$asx(t3), null); + t2 = _this.$this; + t3 = "Expected " + t2.toString$0(0) + " to have " + unit + " " + t2._number1$_unitString$2(t1, t3) + "."; + t1 = _this.name; + return new A.SassScriptException0(t1 == null ? t3 : "$" + t1 + ": " + t3); + } + }, + $signature: 518 + }; + A.SassNumber__coerceOrConvertValue_closure3.prototype = { + call$1(oldNumerator) { + var factor = A.conversionFactor0(this.newNumerator, oldNumerator); + if (factor == null) + return false; + this._box_0.value *= factor; + return true; + }, + $signature: 4 + }; + A.SassNumber__coerceOrConvertValue_closure4.prototype = { + call$0() { + return A.throwExpression(this.compatibilityException.call$0()); + }, + $signature: 0 + }; + A.SassNumber__coerceOrConvertValue_closure5.prototype = { + call$1(oldDenominator) { + var factor = A.conversionFactor0(this.newDenominator, oldDenominator); + if (factor == null) + return false; + this._box_0.value /= factor; + return true; + }, + $signature: 4 + }; + A.SassNumber__coerceOrConvertValue_closure6.prototype = { + call$0() { + return A.throwExpression(this.compatibilityException.call$0()); + }, + $signature: 0 + }; + A.SassNumber_plus_closure0.prototype = { + call$2(num1, num2) { + return num1 + num2; + }, + $signature: 64 + }; + A.SassNumber_minus_closure0.prototype = { + call$2(num1, num2) { + return num1 - num2; + }, + $signature: 64 + }; + A.SassNumber_multiplyUnits_closure3.prototype = { + call$1(denominator) { + var factor = A.conversionFactor0(this.numerator, denominator); + if (factor == null) + return false; + this._box_0.value /= factor; + return true; + }, + $signature: 4 + }; + A.SassNumber_multiplyUnits_closure4.prototype = { + call$0() { + return this.newNumerators.push(this.numerator); + }, + $signature: 0 + }; + A.SassNumber_multiplyUnits_closure5.prototype = { + call$1(denominator) { + var factor = A.conversionFactor0(this.numerator, denominator); + if (factor == null) + return false; + this._box_0.value /= factor; + return true; + }, + $signature: 4 + }; + A.SassNumber_multiplyUnits_closure6.prototype = { + call$0() { + return this.newNumerators.push(this.numerator); + }, + $signature: 0 + }; + A.SassNumber__areAnyConvertible_closure0.prototype = { + call$1(unit1) { + var t1, + _0_0 = B.Map_nfuzN.$index(0, unit1); + $label0$0: { + if (_0_0 != null) { + t1 = B.JSArray_methods.any$1(this.units2, _0_0.get$containsKey()); + break $label0$0; + } + t1 = B.JSArray_methods.contains$1(this.units2, unit1); + break $label0$0; + } + return t1; + }, + $signature: 4 + }; + A.SassNumber__canonicalizeUnitList_closure0.prototype = { + call$1(unit) { + var t1, + type = $.$get$_typesByUnit0().$index(0, unit); + if (type == null) + t1 = unit; + else { + t1 = B.Map_ws7dy.$index(0, type); + t1.toString; + t1 = B.JSArray_methods.get$first(t1); + } + return t1; + }, + $signature: 5 + }; + A.SassNumber__canonicalMultiplier_closure0.prototype = { + call$2(multiplier, unit) { + return multiplier * this.$this.canonicalMultiplierForUnit$1(unit); + }, + $signature: 221 + }; + A.SassNumber_unitSuggestion_closure1.prototype = { + call$1(unit) { + return " * 1" + unit; + }, + $signature: 5 + }; + A.SassNumber_unitSuggestion_closure2.prototype = { + call$1(unit) { + return " / 1" + unit; + }, + $signature: 5 + }; + A.SupportsOperation0.prototype = { + toString$0(_) { + var _this = this; + return _this._operation0$_parenthesize$1(_this.left) + " " + _this.operator + " " + _this._operation0$_parenthesize$1(_this.right); + }, + _operation0$_parenthesize$1(condition) { + var t1; + if (!(condition instanceof A.SupportsNegation0)) + t1 = condition instanceof A.SupportsOperation0 && condition.operator === this.operator; + else + t1 = true; + return t1 ? "(" + condition.toString$0(0) + ")" : condition.toString$0(0); + }, + $isAstNode0: 1, + get$span(receiver) { + return this.span; + } + }; + A.ParentSelector0.prototype = { + accept$1$1(visitor) { + return visitor.visitParentSelector$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + unify$1(compound) { + return A.throwExpression(A.UnsupportedError$("& doesn't support unification.")); + } + }; + A.ParentStatement0.prototype = {$isAstNode0: 1, $isStatement0: 1}; + A.ParentStatement_closure0.prototype = { + call$1(child) { + var t1; + $label0$0: { + if (child instanceof A.VariableDeclaration0 || child instanceof A.FunctionRule0 || child instanceof A.MixinRule0) { + t1 = true; + break $label0$0; + } + if (child instanceof A.ImportRule0) { + t1 = B.JSArray_methods.any$1(child.imports, new A.ParentStatement__closure0()); + break $label0$0; + } + t1 = false; + break $label0$0; + } + return t1; + }, + $signature: 208 + }; + A.ParentStatement__closure0.prototype = { + call$1($import) { + return $import instanceof A.DynamicImport0; + }, + $signature: 207 + }; + A.ParenthesizedExpression0.prototype = { + accept$1$1(visitor) { + return visitor.visitParenthesizedExpression$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + toString$0(_) { + return "(" + this.expression.toString$0(0) + ")"; + }, + $isExpression0: 1, + $isAstNode0: 1, + get$span(receiver) { + return this.span; + } + }; + A.Parser1.prototype = { + _parser0$_parseIdentifier$0() { + return this.wrapSpanFormatException$1(new A.Parser__parseIdentifier_closure0(this)); + }, + whitespace$0() { + do + this.whitespaceWithoutComments$0(); + while (this.scanComment$0()); + }, + whitespaceWithoutComments$0() { + var t3, + t1 = this.scanner, + t2 = t1.string.length; + while (true) { + if (t1._string_scanner$_position !== t2) { + t3 = t1.peekChar$0(); + t3 = t3 === 32 || t3 === 9 || t3 === 10 || t3 === 13 || t3 === 12; + } else + t3 = false; + if (!t3) + break; + t1.readChar$0(); + } + }, + spaces$0() { + var t3, + t1 = this.scanner, + t2 = t1.string.length; + while (true) { + if (t1._string_scanner$_position !== t2) { + t3 = t1.peekChar$0(); + t3 = t3 === 32 || t3 === 9; + } else + t3 = false; + if (!t3) + break; + t1.readChar$0(); + } + }, + scanComment$0() { + var _0_0, + t1 = this.scanner; + if (t1.peekChar$0() !== 47) + return false; + _0_0 = t1.peekChar$1(1); + if (47 === _0_0) + return this.silentComment$0(); + if (42 === _0_0) { + this.loudComment$0(); + return true; + } + return false; + }, + expectWhitespace$0() { + var t2, t3, + t1 = this.scanner; + if (t1._string_scanner$_position !== t1.string.length) { + t2 = t1.peekChar$0(); + t3 = !(t2 === 32 || t2 === 9 || t2 === 10 || t2 === 13 || t2 === 12 || this.scanComment$0()); + t2 = t3; + } else + t2 = true; + if (t2) + t1.error$1(0, "Expected whitespace."); + this.whitespace$0(); + }, + silentComment$0() { + var t2, t3, + t1 = this.scanner; + t1.expect$1("//"); + t2 = t1.string.length; + while (true) { + if (t1._string_scanner$_position !== t2) { + t3 = t1.peekChar$0(); + t3 = !(t3 === 10 || t3 === 13 || t3 === 12); + } else + t3 = false; + if (!t3) + break; + t1.readChar$0(); + } + return true; + }, + loudComment$0() { + var next, + t1 = this.scanner; + t1.expect$1("/*"); + for (; true;) { + if (t1.readChar$0() !== 42) + continue; + do + next = t1.readChar$0(); + while (next === 42); + if (next === 47) + break; + } + }, + identifier$2$normalize$unit(normalize, unit) { + var t2, _0_0, _this = this, + _s20_ = "Expected identifier.", + text = new A.StringBuffer(""), + t1 = _this.scanner; + if (t1.scanChar$1(45)) { + t2 = text._contents = "" + A.Primitives_stringFromCharCode(45); + if (t1.scanChar$1(45)) { + text._contents = t2 + A.Primitives_stringFromCharCode(45); + _this._parser0$_identifierBody$3$normalize$unit(text, normalize, unit); + t1 = text._contents; + return t1.charCodeAt(0) == 0 ? t1 : t1; + } + } else + t2 = ""; + $label0$0: { + _0_0 = t1.peekChar$0(); + if (_0_0 == null) + t1.error$1(0, _s20_); + if (95 === _0_0 && normalize) { + t1.readChar$0(); + text._contents = t2 + A.Primitives_stringFromCharCode(45); + break $label0$0; + } + if (_0_0 === 95 || A.CharacterExtension_get_isAlphabetic0(_0_0) || _0_0 >= 128) { + text._contents = t2 + A.Primitives_stringFromCharCode(t1.readChar$0()); + break $label0$0; + } + if (92 === _0_0) { + text._contents = t2 + _this.escape$1$identifierStart(true); + break $label0$0; + } + t1.error$1(0, _s20_); + } + _this._parser0$_identifierBody$3$normalize$unit(text, normalize, unit); + t1 = text._contents; + return t1.charCodeAt(0) == 0 ? t1 : t1; + }, + identifier$0() { + return this.identifier$2$normalize$unit(false, false); + }, + identifier$1$normalize(normalize) { + return this.identifier$2$normalize$unit(normalize, false); + }, + identifier$1$unit(unit) { + return this.identifier$2$normalize$unit(false, unit); + }, + _parser0$_identifierBody$3$normalize$unit(text, normalize, unit) { + var t1, _1_0, _0_0, t2; + for (t1 = this.scanner; true;) { + _1_0 = t1.peekChar$0(); + if (_1_0 == null) + break; + if (45 === _1_0 && unit) { + _0_0 = t1.peekChar$1(1); + if (46 !== _0_0) + t2 = A._isInt(_0_0) && _0_0 >= 48 && _0_0 <= 57; + else + t2 = true; + if (t2) + break; + text._contents += A.Primitives_stringFromCharCode(t1.readChar$0()); + continue; + } + if (95 === _1_0 && normalize) { + t1.readChar$0(); + text._contents += A.Primitives_stringFromCharCode(45); + continue; + } + if (_1_0 !== 95) { + if (!(_1_0 >= 97 && _1_0 <= 122)) + t2 = _1_0 >= 65 && _1_0 <= 90; + else + t2 = true; + t2 = t2 || _1_0 >= 128; + } else + t2 = true; + if (!t2) + t2 = _1_0 >= 48 && _1_0 <= 57 || _1_0 === 45; + else + t2 = true; + if (t2) { + text._contents += A.Primitives_stringFromCharCode(t1.readChar$0()); + continue; + } + if (92 === _1_0) { + text._contents += this.escape$0(); + continue; + } + break; + } + }, + _parser0$_identifierBody$1(text) { + return this._parser0$_identifierBody$3$normalize$unit(text, false, false); + }, + string$0() { + var buffer, _0_0, t2, + t1 = this.scanner, + quote = t1.readChar$0(); + if (quote !== 39 && quote !== 34) + t1.error$2$position(0, "Expected string.", t1._string_scanner$_position - 1); + buffer = new A.StringBuffer(""); + for (; true;) { + _0_0 = t1.peekChar$0(); + if (_0_0 === quote) { + t1.readChar$0(); + break; + } + if (_0_0 == null || _0_0 === 10 || _0_0 === 13 || _0_0 === 12) + t1.error$1(0, "Expected " + A.Primitives_stringFromCharCode(quote) + "."); + if (92 === _0_0) { + t2 = t1.peekChar$1(1); + if (t2 === 10 || t2 === 13 || t2 === 12) { + t1.readChar$0(); + t1.readChar$0(); + } else + buffer._contents += A.Primitives_stringFromCharCode(A.consumeEscapedCharacter0(t1)); + continue; + } + buffer._contents += A.Primitives_stringFromCharCode(t1.readChar$0()); + } + t1 = buffer._contents; + return t1.charCodeAt(0) == 0 ? t1 : t1; + }, + declarationValue$1$allowEmpty(allowEmpty) { + var t1, t2, wroteNewline, next, start, end, t3, _0_0, _this = this, + buffer = new A.StringBuffer(""), + brackets = A._setArrayType([], type$.JSArray_int); + for (t1 = _this.scanner, t2 = _this.get$string(), wroteNewline = false; true;) { + next = t1.peekChar$0(); + if (next == null) + break; + if (92 === next) { + buffer._contents += _this.escape$1$identifierStart(true); + wroteNewline = false; + continue; + } + if (34 === next || 39 === next) { + start = t1._string_scanner$_position; + t2.call$0(); + end = t1._string_scanner$_position; + buffer._contents += B.JSString_methods.substring$2(t1.string, start, end); + wroteNewline = false; + continue; + } + if (47 === next) { + if (t1.peekChar$1(1) === 42) { + t3 = _this.get$loudComment(); + start = t1._string_scanner$_position; + t3.call$0(); + end = t1._string_scanner$_position; + buffer._contents += B.JSString_methods.substring$2(t1.string, start, end); + } else + buffer._contents += A.Primitives_stringFromCharCode(t1.readChar$0()); + wroteNewline = false; + continue; + } + if (32 === next || 9 === next) { + if (!wroteNewline) { + t3 = t1.peekChar$1(1); + t3 = !(t3 === 32 || t3 === 9 || t3 === 10 || t3 === 13 || t3 === 12); + } else + t3 = true; + if (t3) + buffer._contents += A.Primitives_stringFromCharCode(32); + t1.readChar$0(); + continue; + } + if (10 === next || 13 === next || 12 === next) { + t3 = t1.peekChar$1(-1); + if (!(t3 === 10 || t3 === 13 || t3 === 12)) + buffer._contents += "\n"; + t1.readChar$0(); + wroteNewline = true; + continue; + } + if (40 === next || 123 === next || 91 === next) { + buffer._contents += A.Primitives_stringFromCharCode(next); + brackets.push(A.opposite0(t1.readChar$0())); + wroteNewline = false; + continue; + } + if (41 === next || 125 === next || 93 === next) { + if (brackets.length === 0) + break; + buffer._contents += A.Primitives_stringFromCharCode(next); + t1.expectChar$1(brackets.pop()); + wroteNewline = false; + continue; + } + if (59 === next) { + if (brackets.length === 0) + break; + buffer._contents += A.Primitives_stringFromCharCode(t1.readChar$0()); + continue; + } + if (117 === next || 85 === next) { + _0_0 = _this.tryUrl$0(); + if (_0_0 != null) + buffer._contents += _0_0; + else + buffer._contents += A.Primitives_stringFromCharCode(t1.readChar$0()); + wroteNewline = false; + continue; + } + if (_this.lookingAtIdentifier$0()) + buffer._contents += _this.identifier$0(); + else + buffer._contents += A.Primitives_stringFromCharCode(t1.readChar$0()); + wroteNewline = false; + } + if (brackets.length !== 0) + t1.expectChar$1(B.JSArray_methods.get$last(brackets)); + if (!allowEmpty && buffer._contents.length === 0) + t1.error$1(0, "Expected token."); + t1 = buffer._contents; + return t1.charCodeAt(0) == 0 ? t1 : t1; + }, + declarationValue$0() { + return this.declarationValue$1$allowEmpty(false); + }, + tryUrl$0() { + var buffer, _0_0, t2, _this = this, + t1 = _this.scanner, + start = new A._SpanScannerState(t1, t1._string_scanner$_position); + if (!_this.scanIdentifier$1("url")) + return null; + if (!t1.scanChar$1(40)) { + t1.set$state(start); + return null; + } + _this.whitespace$0(); + buffer = new A.StringBuffer(""); + buffer._contents = "" + "url("; + for (; true;) { + _0_0 = t1.peekChar$0(); + if (_0_0 == null) + break; + if (92 === _0_0) { + buffer._contents += _this.escape$0(); + continue; + } + if (37 !== _0_0) + if (38 !== _0_0) + if (35 !== _0_0) + t2 = _0_0 >= 42 && _0_0 <= 126 || _0_0 >= 128; + else + t2 = true; + else + t2 = true; + else + t2 = true; + if (t2) { + buffer._contents += A.Primitives_stringFromCharCode(t1.readChar$0()); + continue; + } + if (_0_0 === 32 || _0_0 === 9 || _0_0 === 10 || _0_0 === 13 || _0_0 === 12) { + _this.whitespace$0(); + if (t1.peekChar$0() !== 41) + break; + continue; + } + if (41 === _0_0) { + t2 = buffer._contents += A.Primitives_stringFromCharCode(t1.readChar$0()); + return t2.charCodeAt(0) == 0 ? t2 : t2; + } + break; + } + t1.set$state(start); + return null; + }, + variableName$0() { + this.scanner.expectChar$1(36); + return this.identifier$1$normalize(true); + }, + escape$1$identifierStart(identifierStart) { + var value, _0_0, i, next, t2, exception, + _s25_ = "Expected escape sequence.", + t1 = this.scanner, + start = t1._string_scanner$_position; + t1.expectChar$1(92); + value = 0; + $label0$1: { + _0_0 = t1.peekChar$0(); + if (_0_0 == null) + t1.error$1(0, _s25_); + if (_0_0 === 10 || _0_0 === 13 || _0_0 === 12) + t1.error$1(0, _s25_); + if (A.CharacterExtension_get_isHex0(_0_0)) { + for (i = 0; i < 6; ++i) { + next = t1.peekChar$0(); + if (next != null) { + if (!(next >= 48 && next <= 57)) + if (!(next >= 97 && next <= 102)) + t2 = next >= 65 && next <= 70; + else + t2 = true; + else + t2 = true; + t2 = !t2; + } else + t2 = true; + if (t2) + break; + value *= 16; + value += A.asHex0(t1.readChar$0()); + } + this.scanCharIf$1(new A.Parser_escape_closure0()); + break $label0$1; + } + value = t1.readChar$0(); + } + if (identifierStart) { + t2 = value; + t2 = t2 === 95 || A.CharacterExtension_get_isAlphabetic0(t2) || t2 >= 128; + } else { + t2 = value; + if (!(t2 === 95 || A.CharacterExtension_get_isAlphabetic0(t2) || t2 >= 128)) + t2 = t2 >= 48 && t2 <= 57 || t2 === 45; + else + t2 = true; + } + if (t2) + try { + t2 = A.Primitives_stringFromCharCode(value); + return t2; + } catch (exception) { + if (type$.RangeError._is(A.unwrapException(exception))) + t1.error$3$length$position(0, "Invalid Unicode code point.", t1._string_scanner$_position - start, start); + else + throw exception; + } + else { + if (!(value <= 31)) + if (!J.$eq$(value, 127)) + if (identifierStart) { + t1 = value; + t1 = t1 >= 48 && t1 <= 57; + } else + t1 = false; + else + t1 = true; + else + t1 = true; + if (t1) { + t1 = "" + A.Primitives_stringFromCharCode(92); + if (value > 15) + t1 += A.Primitives_stringFromCharCode(A.hexCharFor0(B.JSNumber_methods._shrOtherPositive$1(value, 4))); + t1 = t1 + A.Primitives_stringFromCharCode(A.hexCharFor0(value & 15)) + A.Primitives_stringFromCharCode(32); + return t1.charCodeAt(0) == 0 ? t1 : t1; + } else + return A.String_String$fromCharCodes(A._setArrayType([92, value], type$.JSArray_int), 0, null); + } + }, + escape$0() { + return this.escape$1$identifierStart(false); + }, + scanCharIf$1(condition) { + var t1 = this.scanner; + if (!condition.call$1(t1.peekChar$0())) + return false; + t1.readChar$0(); + return true; + }, + scanIdentChar$2$caseSensitive(char, caseSensitive) { + var t3, + t1 = new A.Parser_scanIdentChar_matches0(caseSensitive, char), + t2 = this.scanner, + _0_0 = t2.peekChar$0(); + if (_0_0 != null) { + t3 = t1.call$1(_0_0); + t3 = t3; + } else + t3 = false; + if (t3) { + t2.readChar$0(); + return true; + } + if (92 === _0_0) { + t3 = t2._string_scanner$_position; + if (t1.call$1(A.consumeEscapedCharacter0(t2))) + return true; + t2.set$state(new A._SpanScannerState(t2, t3)); + } + return false; + }, + scanIdentChar$1(char) { + return this.scanIdentChar$2$caseSensitive(char, false); + }, + expectIdentChar$1(letter) { + var t1; + if (this.scanIdentChar$2$caseSensitive(letter, false)) + return; + t1 = this.scanner; + t1.error$2$position(0, 'Expected "' + A.Primitives_stringFromCharCode(letter) + '".', t1._string_scanner$_position); + }, + lookingAtIdentifier$1($forward) { + var t1, _1_0, t2, _0_0; + if ($forward == null) + $forward = 0; + t1 = this.scanner; + _1_0 = t1.peekChar$1($forward); + $label0$0: { + if (A._isInt(_1_0)) + t2 = _1_0 === 95 || A.CharacterExtension_get_isAlphabetic0(_1_0) || _1_0 >= 128; + else + t2 = false; + if (t2 || 92 === _1_0) { + t1 = true; + break $label0$0; + } + if (45 === _1_0) { + _0_0 = t1.peekChar$1($forward + 1); + $label1$1: { + if (A._isInt(_0_0)) + t1 = _0_0 === 95 || A.CharacterExtension_get_isAlphabetic0(_0_0) || _0_0 >= 128; + else + t1 = false; + if (t1 || 92 === _0_0 || 45 === _0_0) { + t1 = true; + break $label1$1; + } + t1 = false; + break $label1$1; + } + break $label0$0; + } + t1 = false; + break $label0$0; + } + return t1; + }, + lookingAtIdentifier$0() { + return this.lookingAtIdentifier$1(null); + }, + lookingAtIdentifierBody$0() { + var t1, + next = this.scanner.peekChar$0(); + if (next != null) { + if (!(next === 95 || A.CharacterExtension_get_isAlphabetic0(next) || next >= 128)) + t1 = next >= 48 && next <= 57 || next === 45; + else + t1 = true; + t1 = t1 || next === 92; + } else + t1 = false; + return t1; + }, + scanIdentifier$2$caseSensitive(text, caseSensitive) { + var t1, t2, _this = this; + if (!_this.lookingAtIdentifier$0()) + return false; + t1 = _this.scanner; + t2 = t1._string_scanner$_position; + if (_this._parser0$_consumeIdentifier$2(text, caseSensitive) && !_this.lookingAtIdentifierBody$0()) + return true; + else { + t1.set$state(new A._SpanScannerState(t1, t2)); + return false; + } + }, + scanIdentifier$1(text) { + return this.scanIdentifier$2$caseSensitive(text, false); + }, + _parser0$_consumeIdentifier$2(text, caseSensitive) { + var t1, t2, t3; + for (t1 = new A.CodeUnits(text), t2 = type$.CodeUnits, t1 = new A.ListIterator(t1, t1.get$length(0), t2._eval$1("ListIterator")), t2 = t2._eval$1("ListBase.E"); t1.moveNext$0();) { + t3 = t1.__internal$_current; + if (!this.scanIdentChar$2$caseSensitive(t3 == null ? t2._as(t3) : t3, caseSensitive)) + return false; + } + return true; + }, + expectIdentifier$2$name(text, $name) { + var t1, start, t2, t3, t4, t5, t6; + if ($name == null) + $name = '"' + text + '"'; + t1 = this.scanner; + start = t1._string_scanner$_position; + for (t2 = new A.CodeUnits(text), t3 = type$.CodeUnits, t2 = new A.ListIterator(t2, t2.get$length(0), t3._eval$1("ListIterator")), t4 = "Expected " + $name, t5 = t4 + ".", t3 = t3._eval$1("ListBase.E"); t2.moveNext$0();) { + t6 = t2.__internal$_current; + if (this.scanIdentChar$2$caseSensitive(t6 == null ? t3._as(t6) : t6, false)) + continue; + t1.error$2$position(0, t5, start); + } + if (!this.lookingAtIdentifierBody$0()) + return; + t1.error$2$position(0, t4, start); + }, + expectIdentifier$1(text) { + return this.expectIdentifier$2$name(text, null); + }, + rawText$1(consumer) { + var t1 = this.scanner, + start = t1._string_scanner$_position; + consumer.call$0(); + return t1.substring$1(0, start); + }, + spanFrom$1(state) { + var span = this.scanner.spanFrom$1(state); + return this._parser0$_interpolationMap == null ? span : new A.LazyFileSpan0(new A.Parser_spanFrom_closure0(this, span)); + }, + error$3(_, message, span, trace) { + var exception = new A.StringScannerException(this.scanner.string, message, span); + if (trace == null) + throw A.wrapException(exception); + else + A.throwWithTrace0(exception, this.get$error(this), trace); + }, + error$2(_, message, span) { + return this.error$3(0, message, span, null); + }, + withErrorMessage$1$2(message, callback) { + var error, stackTrace, t1, exception; + try { + t1 = callback.call$0(); + return t1; + } catch (exception) { + t1 = A.unwrapException(exception); + if (type$.SourceSpanFormatException._is(t1)) { + error = t1; + stackTrace = A.getTraceFromException(exception); + t1 = J.get$span$z(error); + A.throwWithTrace0(new A.SourceSpanFormatException(error.get$source(), message, t1), error, stackTrace); + } else + throw exception; + } + }, + withErrorMessage$2(message, callback) { + return this.withErrorMessage$1$2(message, callback, type$.dynamic); + }, + wrapSpanFormatException$1$1(callback) { + var error, stackTrace, map, error0, stackTrace0, span, error1, stackTrace1, span0, secondarySpans, t1, t2, span1, description, _0_0, t3, exception, t4, _this = this, + _s8_ = "expected"; + try { + try { + t3 = callback.call$0(); + return t3; + } catch (exception) { + t3 = A.unwrapException(exception); + if (type$.SourceSpanFormatException._is(t3)) { + error = t3; + stackTrace = A.getTraceFromException(exception); + map = _this._parser0$_interpolationMap; + if (map == null) + throw exception; + A.throwWithTrace0(map.mapException$1(error), error, stackTrace); + } else + throw exception; + } + } catch (exception) { + t3 = A.unwrapException(exception); + if (type$.SourceSpanFormatException._is(t3)) { + error0 = t3; + stackTrace0 = A.getTraceFromException(exception); + span = J.get$span$z(error0); + if (A.startsWithIgnoreCase0(error0._span_exception$_message, _s8_)) + span = _this._parser0$_adjustExceptionSpan$1(span); + t1 = error0._span_exception$_message; + t2 = span; + A.throwWithTrace0(new A.SassFormatException0(B.Set_empty, t1, t2), error0, stackTrace0); + } else if (type$.MultiSourceSpanFormatException._is(t3)) { + error1 = t3; + stackTrace1 = A.getTraceFromException(exception); + span0 = J.get$span$z(error1); + t3 = type$.FileSpan; + t4 = type$.String; + secondarySpans = error1.get$secondarySpans().cast$2$0(0, t3, t4); + if (A.startsWithIgnoreCase0(error1._span_exception$_message, _s8_)) { + span0 = _this._parser0$_adjustExceptionSpan$1(span0); + t1 = A.LinkedHashMap_LinkedHashMap$_empty(t3, t4); + for (t3 = A.MapExtensions_get_pairs0(secondarySpans, t3, t4), t3 = t3.get$iterator(t3); t3.moveNext$0();) { + t2 = t3.get$current(t3); + span1 = null; + description = null; + _0_0 = t2; + span1 = _0_0._0; + description = _0_0._1; + J.$indexSet$ax(t1, _this._parser0$_adjustExceptionSpan$1(span1), description); + } + secondarySpans = t1; + } + A.throwWithTrace0(A.MultiSpanSassFormatException$0(error1._span_exception$_message, span0, error1.get$primaryLabel(), secondarySpans, null), error1, stackTrace1); + } else + throw exception; + } + }, + wrapSpanFormatException$1(callback) { + return this.wrapSpanFormatException$1$1(callback, type$.dynamic); + }, + _parser0$_adjustExceptionSpan$1(span) { + var start, t1; + if (span.get$length(span) > 0) + return span; + start = this._parser0$_firstNewlineBefore$1(span.get$start(span)); + if (start.$eq(0, span.get$start(span))) + t1 = span; + else { + t1 = start.offset; + t1 = A._FileSpan$(start.file, t1, t1); + } + return t1; + }, + _parser0$_firstNewlineBefore$1($location) { + var lastNewline, codeUnit, + t1 = $location.file, + t2 = $location.offset, + text = A.String_String$fromCharCodes(B.NativeUint32List_methods.sublist$2(t1._decodedChars, 0, t2), 0, null), + index = t2 - 1; + for (lastNewline = null; index >= 0;) { + codeUnit = text.charCodeAt(index); + if (!(codeUnit === 32 || codeUnit === 9 || codeUnit === 10 || codeUnit === 13 || codeUnit === 12)) { + if (lastNewline == null) + t1 = $location; + else { + t2 = new A.FileLocation(t1, lastNewline); + t2.FileLocation$_$2(t1, lastNewline); + t1 = t2; + } + return t1; + } + if (codeUnit === 10 || codeUnit === 13 || codeUnit === 12) + lastNewline = index; + --index; + } + return $location; + } + }; + A.Parser__parseIdentifier_closure0.prototype = { + call$0() { + var t1 = this.$this, + result = t1.identifier$0(); + t1.scanner.expectDone$0(); + return result; + }, + $signature: 27 + }; + A.Parser_escape_closure0.prototype = { + call$1(char) { + return char === 32 || char === 9 || char === 10 || char === 13 || char === 12; + }, + $signature: 28 + }; + A.Parser_scanIdentChar_matches0.prototype = { + call$1(actual) { + var t1 = this.char; + return this.caseSensitive ? actual === t1 : A.characterEqualsIgnoreCase0(t1, actual); + }, + $signature: 46 + }; + A.Parser_spanFrom_closure0.prototype = { + call$0() { + return this.$this._parser0$_interpolationMap.mapSpan$1(this.span); + }, + $signature: 25 + }; + A.PlaceholderSelector0.prototype = { + accept$1$1(visitor) { + return visitor.visitPlaceholderSelector$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + addSuffix$1(suffix) { + return new A.PlaceholderSelector0(this.name + suffix, this.span); + }, + $eq(_, other) { + if (other == null) + return false; + return other instanceof A.PlaceholderSelector0 && other.name === this.name; + }, + get$hashCode(_) { + return B.JSString_methods.get$hashCode(this.name); + } + }; + A.PlainCssCallable0.prototype = { + $eq(_, other) { + if (other == null) + return false; + return other instanceof A.PlainCssCallable0 && this.name === other.name; + }, + get$hashCode(_) { + return B.JSString_methods.get$hashCode(this.name); + }, + $isAsyncCallable0: 1, + $isCallable: 1, + get$name(receiver) { + return this.name; + } + }; + A.PrefixedMapView0.prototype = { + get$keys(_) { + return new A._PrefixedKeys0(this); + }, + get$length(_) { + var t1 = this._prefixed_map_view0$_map; + return t1.get$length(t1); + }, + get$isEmpty(_) { + var t1 = this._prefixed_map_view0$_map; + return t1.get$isEmpty(t1); + }, + get$isNotEmpty(_) { + var t1 = this._prefixed_map_view0$_map; + return t1.get$isNotEmpty(t1); + }, + $index(_, key) { + return typeof key == "string" && B.JSString_methods.startsWith$1(key, this._prefixed_map_view0$_prefix) ? this._prefixed_map_view0$_map.$index(0, J.substring$1$s(key, this._prefixed_map_view0$_prefix.length)) : null; + }, + containsKey$1(key) { + return typeof key == "string" && B.JSString_methods.startsWith$1(key, this._prefixed_map_view0$_prefix) && this._prefixed_map_view0$_map.containsKey$1(J.substring$1$s(key, this._prefixed_map_view0$_prefix.length)); + } + }; + A._PrefixedKeys0.prototype = { + get$length(_) { + var t1 = this._prefixed_map_view0$_view._prefixed_map_view0$_map; + return t1.get$length(t1); + }, + get$iterator(_) { + var t1 = this._prefixed_map_view0$_view._prefixed_map_view0$_map; + t1 = J.map$1$1$ax(t1.get$keys(t1), new A._PrefixedKeys_iterator_closure0(this), type$.String); + return t1.get$iterator(t1); + }, + contains$1(_, key) { + return this._prefixed_map_view0$_view.containsKey$1(key); + } + }; + A._PrefixedKeys_iterator_closure0.prototype = { + call$1(key) { + return this.$this._prefixed_map_view0$_view._prefixed_map_view0$_prefix + key; + }, + $signature: 5 + }; + A.PseudoSelector0.prototype = { + get$isHostContext() { + return this.isClass && this.name === "host-context" && this.selector != null; + }, + get$specificity() { + var result, _this = this, + value = _this._pseudo$__PseudoSelector_specificity_FI; + if (value === $) { + result = new A.PseudoSelector_specificity_closure0(_this).call$0(); + _this._pseudo$__PseudoSelector_specificity_FI !== $ && A.throwUnnamedLateFieldADI(); + _this._pseudo$__PseudoSelector_specificity_FI = result; + value = result; + } + return value; + }, + withSelector$1(selector) { + var _this = this; + return A.PseudoSelector$0(_this.name, _this.span, _this.argument, !_this.isClass, selector); + }, + addSuffix$1(suffix) { + var _this = this; + if (_this.argument != null || _this.selector != null) + _this.super$SimpleSelector$addSuffix0(suffix); + return A.PseudoSelector$0(_this.name + suffix, _this.span, null, !_this.isClass, null); + }, + unify$1(compound) { + var other, result, t2, addedThis, _i, simple, _this = this, + t1 = _this.name; + if (t1 === "host" || t1 === "host-context") { + if (!B.JSArray_methods.every$1(compound, new A.PseudoSelector_unify_closure0())) + return null; + } else { + if (compound.length === 1) { + other = compound[0]; + if (!(other instanceof A.UniversalSelector0)) + if (other instanceof A.PseudoSelector0) + t1 = other.isClass && other.name === "host" || other.get$isHostContext(); + else + t1 = false; + else + t1 = true; + } else { + other = null; + t1 = false; + } + if (t1) + return other.unify$1(A._setArrayType([_this], type$.JSArray_SimpleSelector_2)); + } + if (B.JSArray_methods.contains$1(compound, _this)) + return compound; + result = A._setArrayType([], type$.JSArray_SimpleSelector_2); + for (t1 = compound.length, t2 = !_this.isClass, addedThis = false, _i = 0; _i < compound.length; compound.length === t1 || (0, A.throwConcurrentModificationError)(compound), ++_i) { + simple = compound[_i]; + if (simple instanceof A.PseudoSelector0 && !simple.isClass) { + if (t2) + return null; + result.push(_this); + addedThis = true; + } + result.push(simple); + } + if (!addedThis) + result.push(_this); + return result; + }, + isSuperselector$1(other) { + var selector, t1, t2, _this = this; + if (_this.super$SimpleSelector$isSuperselector0(other)) + return true; + selector = _this.selector; + if (selector == null) + return _this.$eq(0, other); + if (other instanceof A.PseudoSelector0 && !_this.isClass && !other.isClass && _this.normalizedName === "slotted" && other.name === _this.name) { + t1 = A.NullableExtension_andThen0(other.selector, selector.get$isSuperselector()); + return t1 == null ? false : t1; + } + t1 = type$.JSArray_SimpleSelector_2; + t2 = _this.span; + return A.compoundIsSuperselector0(A.CompoundSelector$0(A._setArrayType([_this], t1), t2), A.CompoundSelector$0(A._setArrayType([other], t1), t2), null); + }, + accept$1$1(visitor) { + return visitor.visitPseudoSelector$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + $eq(_, other) { + var _this = this; + if (other == null) + return false; + return other instanceof A.PseudoSelector0 && other.name === _this.name && other.isClass === _this.isClass && other.argument == _this.argument && J.$eq$(other.selector, _this.selector); + }, + get$hashCode(_) { + var _this = this, + t1 = B.JSString_methods.get$hashCode(_this.name), + t2 = !_this.isClass ? 519018 : 218159; + return t1 ^ t2 ^ J.get$hashCode$(_this.argument) ^ J.get$hashCode$(_this.selector); + } + }; + A.PseudoSelector_specificity_closure0.prototype = { + call$0() { + var selector, t2, + t1 = this.$this; + if (!t1.isClass) + return 1; + selector = t1.selector; + if (selector == null) + return A.SimpleSelector0.prototype.get$specificity.call(t1); + switch (t1.normalizedName) { + case "where": + return 0; + case "is": + case "not": + case "has": + case "matches": + t1 = selector.components; + return A.IterableIntegerExtension_get_max(new A.MappedListIterable(t1, new A.PseudoSelector_specificity__closure1(), A._arrayInstanceType(t1)._eval$1("MappedListIterable<1,int>"))); + case "nth-child": + case "nth-last-child": + t1 = A.SimpleSelector0.prototype.get$specificity.call(t1); + t2 = selector.components; + return t1 + A.IterableIntegerExtension_get_max(new A.MappedListIterable(t2, new A.PseudoSelector_specificity__closure2(), A._arrayInstanceType(t2)._eval$1("MappedListIterable<1,int>"))); + default: + return A.SimpleSelector0.prototype.get$specificity.call(t1); + } + }, + $signature: 10 + }; + A.PseudoSelector_specificity__closure1.prototype = { + call$1(component) { + return component.get$specificity(); + }, + $signature: 166 + }; + A.PseudoSelector_specificity__closure2.prototype = { + call$1(component) { + return component.get$specificity(); + }, + $signature: 166 + }; + A.PseudoSelector_unify_closure0.prototype = { + call$1(simple) { + var t1; + if (simple instanceof A.PseudoSelector0) + t1 = simple.isClass && simple.name === "host" || simple.selector != null; + else + t1 = false; + return t1; + }, + $signature: 14 + }; + A.PublicMemberMapView0.prototype = { + get$keys(_) { + var t1 = this._public_member_map_view0$_inner; + return J.where$1$ax(t1.get$keys(t1), A.utils0__isPublic$closure()); + }, + containsKey$1(key) { + return typeof key == "string" && A.isPublic0(key) && this._public_member_map_view0$_inner.containsKey$1(key); + }, + $index(_, key) { + if (typeof key == "string" && A.isPublic0(key)) + return this._public_member_map_view0$_inner.$index(0, key); + return null; + } + }; + A.QualifiedName0.prototype = { + $eq(_, other) { + if (other == null) + return false; + return other instanceof A.QualifiedName0 && other.name === this.name && other.namespace == this.namespace; + }, + get$hashCode(_) { + return B.JSString_methods.get$hashCode(this.name) ^ J.get$hashCode$(this.namespace); + }, + toString$0(_) { + var t1 = this.namespace, + t2 = this.name; + return t1 == null ? t2 : t1 + "|" + t2; + } + }; + A.JSClass0.prototype = {}; + A.JSClassExtension_setCustomInspect_closure.prototype = { + call$4($self, _, __, ___) { + return this.inspect.call$1($self); + }, + call$3($self, _, __) { + return this.call$4($self, _, __, null); + }, + "call*": "call$4", + $requiredArgCount: 3, + $defaultValues() { + return [null]; + }, + $signature: 520 + }; + A.JSClassExtension_get_defineStaticMethod_closure.prototype = { + call$2($name, body) { + this._this[$name] = A.allowInteropNamed($name, body); + return null; + }, + $signature: 112 + }; + A.JSClassExtension_get_defineMethod_closure.prototype = { + call$2($name, body) { + J.get$$prototype$x(this._this)[$name] = A.allowInteropCaptureThisNamed($name, body); + return null; + }, + $signature: 112 + }; + A.JSClassExtension_get_defineGetter_closure.prototype = { + call$2($name, body) { + A.defineGetter(J.get$$prototype$x(this._this), $name, body, null); + return null; + }, + $signature: 112 + }; + A.RenderContext0.prototype = {}; + A.RenderContextOptions0.prototype = {}; + A.RenderContextResult0.prototype = {}; + A.RenderContextResultStats0.prototype = {}; + A.RenderOptions.prototype = {}; + A.RenderResult.prototype = {}; + A.RenderResultStats.prototype = {}; + A.ReplaceExpressionVisitor0.prototype = { + visitBinaryOperationExpression$1(node) { + return new A.BinaryOperationExpression0(node.operator, node.left.accept$1(this), node.right.accept$1(this), false); + }, + visitBooleanExpression$1(node) { + return node; + }, + visitColorExpression$1(node) { + return node; + }, + visitFunctionExpression$1(node) { + return new A.FunctionExpression0(node.namespace, node.originalName, this.visitArgumentInvocation$1(node.$arguments), node.span); + }, + visitInterpolatedFunctionExpression$1(node) { + return new A.InterpolatedFunctionExpression0(this.visitInterpolation$1(node.name), this.visitArgumentInvocation$1(node.$arguments), node.span); + }, + visitIfExpression$1(node) { + return new A.IfExpression0(this.visitArgumentInvocation$1(node.$arguments), node.span); + }, + visitListExpression$1(node) { + var t1 = node.contents; + return new A.ListExpression0(A.List_List$unmodifiable(new A.MappedListIterable(t1, new A.ReplaceExpressionVisitor_visitListExpression_closure0(this), A._arrayInstanceType(t1)._eval$1("MappedListIterable<1,Expression0>")), type$.Expression_2), node.separator, node.hasBrackets, node.span); + }, + visitMapExpression$1(node) { + var t2, t3, _i, t4, key, value, + t1 = A._setArrayType([], type$.JSArray_Record_2_Expression_and_Expression_2); + for (t2 = node.pairs, t3 = t2.length, _i = 0; _i < t3; ++_i) { + t4 = t2[_i]; + key = t4._0; + value = t4._1; + t1.push(new A._Record_2(key.accept$1(this), value.accept$1(this))); + } + return new A.MapExpression0(A.List_List$unmodifiable(t1, type$.Record_2_Expression_and_Expression_2), node.span); + }, + visitNullExpression$1(node) { + return node; + }, + visitNumberExpression$1(node) { + return node; + }, + visitParenthesizedExpression$1(node) { + return new A.ParenthesizedExpression0(node.expression.accept$1(this), node.span); + }, + visitSelectorExpression$1(node) { + return node; + }, + visitStringExpression$1(node) { + return new A.StringExpression0(this.visitInterpolation$1(node.text), node.hasQuotes); + }, + visitSupportsExpression$1(node) { + return new A.SupportsExpression0(this.visitSupportsCondition$1(node.condition)); + }, + visitUnaryOperationExpression$1(node) { + return new A.UnaryOperationExpression0(node.operator, node.operand.accept$1(this), node.span); + }, + visitValueExpression$1(node) { + return node; + }, + visitVariableExpression$1(node) { + return node; + }, + visitArgumentInvocation$1(invocation) { + var t5, t6, _this = this, + t1 = invocation.positional, + t2 = type$.String, + t3 = type$.Expression_2, + t4 = A.LinkedHashMap_LinkedHashMap$_empty(t2, t3); + for (t5 = A.MapExtensions_get_pairs0(invocation.named, t2, t3), t5 = t5.get$iterator(t5); t5.moveNext$0();) { + t6 = t5.get$current(t5); + t4.$indexSet(0, t6._0, t6._1.accept$1(_this)); + } + t5 = invocation.rest; + t5 = t5 == null ? null : t5.accept$1(_this); + t6 = invocation.keywordRest; + t6 = t6 == null ? null : t6.accept$1(_this); + return new A.ArgumentInvocation0(A.List_List$unmodifiable(new A.MappedListIterable(t1, new A.ReplaceExpressionVisitor_visitArgumentInvocation_closure0(_this), A._arrayInstanceType(t1)._eval$1("MappedListIterable<1,Expression0>")), t3), A.ConstantMap_ConstantMap$from(t4, t2, t3), t5, t6, invocation.span); + }, + visitSupportsCondition$1(condition) { + var _this = this; + if (condition instanceof A.SupportsOperation0) + return A.SupportsOperation$0(_this.visitSupportsCondition$1(condition.left), _this.visitSupportsCondition$1(condition.right), condition.operator, condition.span); + else if (condition instanceof A.SupportsNegation0) + return new A.SupportsNegation0(_this.visitSupportsCondition$1(condition.condition), condition.span); + else if (condition instanceof A.SupportsInterpolation0) + return new A.SupportsInterpolation0(condition.expression.accept$1(_this), condition.span); + else if (condition instanceof A.SupportsDeclaration0) + return new A.SupportsDeclaration0(condition.name.accept$1(_this), condition.value.accept$1(_this), condition.span); + else + throw A.wrapException(A.SassException$0("BUG: Unknown SupportsCondition " + condition.toString$0(0) + ".", condition.get$span(condition), null)); + }, + visitInterpolation$1(interpolation) { + var t1 = interpolation.contents; + return A.Interpolation$0(new A.MappedListIterable(t1, new A.ReplaceExpressionVisitor_visitInterpolation_closure0(this), A._arrayInstanceType(t1)._eval$1("MappedListIterable<1,Object>")), interpolation.span); + } + }; + A.ReplaceExpressionVisitor_visitListExpression_closure0.prototype = { + call$1(item) { + return item.accept$1(this.$this); + }, + $signature: 177 + }; + A.ReplaceExpressionVisitor_visitArgumentInvocation_closure0.prototype = { + call$1(expression) { + return expression.accept$1(this.$this); + }, + $signature: 177 + }; + A.ReplaceExpressionVisitor_visitInterpolation_closure0.prototype = { + call$1(node) { + return type$.Expression_2._is(node) ? node.accept$1(this.$this) : node; + }, + $signature: 67 + }; + A.ImporterResult0.prototype = { + get$sourceMapUrl(_) { + var t1 = this._result$_sourceMapUrl; + return t1 == null ? A.Uri_Uri$dataFromString(this.contents, B.C_Utf8Codec, null) : t1; + } + }; + A.ReturnRule0.prototype = { + accept$1$1(visitor) { + return visitor.visitReturnRule$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + toString$0(_) { + return "@return " + this.expression.toString$0(0) + ";"; + }, + $isAstNode0: 1, + $isStatement0: 1, + get$span(receiver) { + return this.span; + } + }; + A.SassParser0.prototype = { + get$currentIndentation() { + return this._sass0$_currentIndentation; + }, + get$indented() { + return true; + }, + styleRuleSelector$0() { + var t4, + t1 = this.scanner, + t2 = t1._string_scanner$_position, + t3 = new A.StringBuffer(""), + buffer = new A.InterpolationBuffer0(t3, A._setArrayType([], type$.JSArray_Object)); + do { + buffer.addInterpolation$1(this.almostAnyValue$1$omitComments(true)); + t4 = t3._contents += A.Primitives_stringFromCharCode(10); + } while (B.JSString_methods.endsWith$1(B.JSString_methods.trimRight$0(t4.charCodeAt(0) == 0 ? t4 : t4), ",") && this.scanCharIf$1(new A.SassParser_styleRuleSelector_closure0())); + return buffer.interpolation$1(t1.spanFrom$1(new A._SpanScannerState(t1, t2))); + }, + expectStatementSeparator$1($name) { + var t1, _this = this; + if (!_this.atEndOfStatement$0()) + _this._sass0$_expectNewline$0(); + if (_this._sass0$_peekIndentation$0() <= _this._sass0$_currentIndentation) + return; + t1 = $name == null ? "here" : "beneath a " + $name; + _this.scanner.error$2$position(0, "Nothing may be indented " + t1 + ".", _this._sass0$_nextIndentationEnd.position); + }, + expectStatementSeparator$0() { + return this.expectStatementSeparator$1(null); + }, + atEndOfStatement$0() { + var t1 = this.scanner.peekChar$0(); + if (t1 == null) + t1 = null; + else + t1 = t1 === 10 || t1 === 13 || t1 === 12; + return t1 !== false; + }, + lookingAtChildren$0() { + return this.atEndOfStatement$0() && this._sass0$_peekIndentation$0() > this._sass0$_currentIndentation; + }, + importArgument$0() { + var url, span, innerError, stackTrace, t1, _0_0, start, next, t2, exception, _this = this; + $label0$0: { + t1 = _this.scanner; + _0_0 = t1.peekChar$0(); + if (117 === _0_0 || 85 === _0_0) { + start = new A._SpanScannerState(t1, t1._string_scanner$_position); + if (_this.scanIdentifier$1("url")) + if (t1.scanChar$1(40)) { + t1.set$state(start); + return _this.super$StylesheetParser$importArgument0(); + } else + t1.set$state(start); + break $label0$0; + } + if (39 === _0_0 || 34 === _0_0) + return _this.super$StylesheetParser$importArgument0(); + } + start = new A._SpanScannerState(t1, t1._string_scanner$_position); + next = t1.peekChar$0(); + while (true) { + if (next != null) + if (next !== 44) + if (next !== 59) + t2 = !(next === 10 || next === 13 || next === 12); + else + t2 = false; + else + t2 = false; + else + t2 = false; + if (!t2) + break; + t1.readChar$0(); + next = t1.peekChar$0(); + } + url = t1.substring$1(0, start.position); + span = t1.spanFrom$1(start); + if (_this.isPlainImportUrl$1(url)) + return new A.StaticImport0(A.Interpolation$0(A._setArrayType([A.serializeValue0(new A.SassString0(url, true), true, true)], type$.JSArray_Object), span), null, span); + else + try { + t1 = _this.parseImportUrl$1(url); + return new A.DynamicImport0(t1, span); + } catch (exception) { + t1 = A.unwrapException(exception); + if (type$.FormatException._is(t1)) { + innerError = t1; + stackTrace = A.getTraceFromException(exception); + _this.error$3(0, "Invalid URL: " + J.get$message$x(innerError), span, stackTrace); + } else + throw exception; + } + }, + scanElse$1(ifIndentation) { + var t1, t2, startIndentation, startNextIndentation, startNextIndentationEnd, _this = this; + if (_this._sass0$_peekIndentation$0() !== ifIndentation) + return false; + t1 = _this.scanner; + t2 = t1._string_scanner$_position; + startIndentation = _this._sass0$_currentIndentation; + startNextIndentation = _this._sass0$_nextIndentation; + startNextIndentationEnd = _this._sass0$_nextIndentationEnd; + _this._sass0$_readIndentation$0(); + if (t1.scanChar$1(64) && _this.scanIdentifier$1("else")) + return true; + t1.set$state(new A._SpanScannerState(t1, t2)); + _this._sass0$_currentIndentation = startIndentation; + _this._sass0$_nextIndentation = startNextIndentation; + _this._sass0$_nextIndentationEnd = startNextIndentationEnd; + return false; + }, + children$1(_, child) { + var children = A._setArrayType([], type$.JSArray_Statement_2); + this._sass0$_whileIndentedLower$1(new A.SassParser_children_closure0(this, child, children)); + return children; + }, + statements$1(statement) { + var statements, t2, _1_0, + t1 = this.scanner, + _0_0 = t1.peekChar$0(); + if (9 === _0_0 || 32 === _0_0) + t1.error$3$length$position(0, string$.Indent, t1._string_scanner$_position, 0); + statements = A._setArrayType([], type$.JSArray_Statement_2); + for (t2 = t1.string.length; t1._string_scanner$_position !== t2;) { + _1_0 = this._sass0$_child$1(statement); + if (_1_0 != null) + statements.push(_1_0); + this._sass0$_readIndentation$0(); + } + return statements; + }, + _sass0$_child$1(child) { + var _0_0, _this = this, + t1 = _this.scanner, + _1_0 = t1.peekChar$0(); + $label0$0: { + if (13 === _1_0 || 10 === _1_0 || 12 === _1_0) { + t1 = null; + break $label0$0; + } + if (36 === _1_0) { + t1 = _this.variableDeclarationWithoutNamespace$0(); + break $label0$0; + } + if (47 === _1_0) { + _0_0 = t1.peekChar$1(1); + $label1$1: { + if (47 === _0_0) { + t1 = _this._sass0$_silentComment$0(); + break $label1$1; + } + if (42 === _0_0) { + t1 = _this._sass0$_loudComment$0(); + break $label1$1; + } + t1 = child.call$0(); + break $label1$1; + } + break $label0$0; + } + t1 = child.call$0(); + break $label0$0; + } + return t1; + }, + _sass0$_silentComment$0() { + var buffer, parentIndentation, t3, t4, t5, commentPrefix, i, t6, i0, t7, _this = this, + t1 = _this.scanner, + t2 = t1._string_scanner$_position; + t1.expect$1("//"); + buffer = new A.StringBuffer(""); + parentIndentation = _this._sass0$_currentIndentation; + t3 = t1.string.length; + t4 = 1 + parentIndentation; + t5 = 2 + parentIndentation; + $label0$0: + do { + commentPrefix = t1.scanChar$1(47) ? "///" : "//"; + for (i = commentPrefix.length; true;) { + t6 = buffer._contents += commentPrefix; + for (i0 = i; i0 < _this._sass0$_currentIndentation - parentIndentation; ++i0) { + t6 += A.Primitives_stringFromCharCode(32); + buffer._contents = t6; + } + while (true) { + if (t1._string_scanner$_position !== t3) { + t7 = t1.peekChar$0(); + t7 = !(t7 === 10 || t7 === 13 || t7 === 12); + } else + t7 = false; + if (!t7) + break; + t6 += A.Primitives_stringFromCharCode(t1.readChar$0()); + buffer._contents = t6; + } + buffer._contents = t6 + "\n"; + if (_this._sass0$_peekIndentation$0() < parentIndentation) + break $label0$0; + if (_this._sass0$_peekIndentation$0() === parentIndentation) { + if (t1.peekChar$1(t4) === 47 && t1.peekChar$1(t5) === 47) + _this._sass0$_readIndentation$0(); + break; + } + _this._sass0$_readIndentation$0(); + } + } while (t1.scan$1("//")); + t3 = buffer._contents; + return _this.lastSilentComment = new A.SilentComment0(t3.charCodeAt(0) == 0 ? t3 : t3, t1.spanFrom$1(new A._SpanScannerState(t1, t2))); + }, + _sass0$_loudComment$0() { + var t3, t4, buffer, parentIndentation, t5, t6, first, beginningOfComment, t7, end, i, _0_0, _this = this, + t1 = _this.scanner, + t2 = t1._string_scanner$_position; + t1.expect$1("/*"); + t3 = new A.StringBuffer(""); + t4 = A._setArrayType([], type$.JSArray_Object); + buffer = new A.InterpolationBuffer0(t3, t4); + t3._contents = "" + "/*"; + parentIndentation = _this._sass0$_currentIndentation; + for (t5 = t1.string, t6 = t5.length, first = true; true; first = false) { + if (first) { + beginningOfComment = t1._string_scanner$_position; + _this.spaces$0(); + t7 = t1.peekChar$0(); + if (t7 === 10 || t7 === 13 || t7 === 12) { + _this._sass0$_readIndentation$0(); + t3._contents += A.Primitives_stringFromCharCode(32); + } else { + end = t1._string_scanner$_position; + t3._contents += B.JSString_methods.substring$2(t5, beginningOfComment, end); + } + } else { + t7 = t3._contents += "\n"; + t3._contents = t7 + " * "; + } + for (i = 3; i < _this._sass0$_currentIndentation - parentIndentation; ++i) + t3._contents += A.Primitives_stringFromCharCode(32); + for (; t1._string_scanner$_position !== t6;) { + _0_0 = t1.peekChar$0(); + if (10 === _0_0 || 13 === _0_0 || 12 === _0_0) + break; + if (35 === _0_0) { + if (t1.peekChar$1(1) === 123) { + t7 = _this.singleInterpolation$0(); + buffer._interpolation_buffer0$_flushText$0(); + t4.push(t7); + } else + t3._contents += A.Primitives_stringFromCharCode(t1.readChar$0()); + continue; + } + t3._contents += A.Primitives_stringFromCharCode(t1.readChar$0()); + } + if (_this._sass0$_peekIndentation$0() <= parentIndentation) + break; + for (; _this._sass0$_lookingAtDoubleNewline$0();) { + _this._sass0$_expectNewline$0(); + t7 = t3._contents += "\n"; + t3._contents = t7 + " *"; + } + _this._sass0$_readIndentation$0(); + } + t4 = t3._contents; + if (!B.JSString_methods.endsWith$1(B.JSString_methods.trimRight$0(t4.charCodeAt(0) == 0 ? t4 : t4), "*/")) + t3._contents += " */"; + return new A.LoudComment0(buffer.interpolation$1(t1.spanFrom$1(new A._SpanScannerState(t1, t2)))); + }, + whitespaceWithoutComments$0() { + var t1, t2, next; + for (t1 = this.scanner, t2 = t1.string.length; t1._string_scanner$_position !== t2;) { + next = t1.peekChar$0(); + if (next !== 9 && next !== 32) + break; + t1.readChar$0(); + } + }, + loudComment$0() { + var next, + t1 = this.scanner; + t1.expect$1("/*"); + for (; true;) { + next = t1.readChar$0(); + if (next === 10 || next === 13 || next === 12) + t1.error$1(0, "expected */."); + if (next !== 42) + continue; + do + next = t1.readChar$0(); + while (next === 42); + if (next === 47) + break; + } + }, + _sass0$_expectNewline$0() { + var t1 = this.scanner, + _0_0 = t1.peekChar$0(); + if (59 === _0_0) + t1.error$1(0, string$.semico); + if (13 === _0_0) { + t1.readChar$0(); + if (t1.peekChar$0() === 10) + t1.readChar$0(); + return; + } + if (10 === _0_0 || 12 === _0_0) { + t1.readChar$0(); + return; + } + t1.error$1(0, "expected newline."); + }, + _sass0$_lookingAtDoubleNewline$0() { + var _0_0, + t1 = this.scanner, + _1_0 = t1.peekChar$0(); + $label1$1: { + if (13 === _1_0) { + _0_0 = t1.peekChar$1(1); + $label0$0: { + if (10 === _0_0) { + t1 = t1.peekChar$1(2); + t1 = t1 === 10 || t1 === 13 || t1 === 12; + break $label0$0; + } + if (13 === _0_0 || 12 === _0_0) { + t1 = true; + break $label0$0; + } + t1 = false; + break $label0$0; + } + break $label1$1; + } + if (10 === _1_0 || 12 === _1_0) { + t1 = t1.peekChar$1(1); + t1 = t1 === 10 || t1 === 13 || t1 === 12; + break $label1$1; + } + t1 = false; + break $label1$1; + } + return t1; + }, + _sass0$_whileIndentedLower$1(body) { + var t1, t2, childIndentation, indentation, t3, t4, _this = this, + parentIndentation = _this._sass0$_currentIndentation; + for (t1 = _this.scanner, t2 = t1._sourceFile, childIndentation = null; _this._sass0$_peekIndentation$0() > parentIndentation;) { + indentation = _this._sass0$_readIndentation$0(); + if (childIndentation == null) + childIndentation = indentation; + if (childIndentation !== indentation) { + t3 = t1._string_scanner$_position; + t4 = t2.getColumn$1(t3); + t1.error$3$length$position(0, "Inconsistent indentation, expected " + childIndentation + " spaces.", t2.getColumn$1(t1._string_scanner$_position), t3 - t4); + } + body.call$0(); + } + }, + _sass0$_readIndentation$0() { + var t1, _this = this, + currentIndentation = _this._sass0$_nextIndentation; + if (currentIndentation == null) + currentIndentation = _this._sass0$_nextIndentation = _this._sass0$_peekIndentation$0(); + _this._sass0$_currentIndentation = currentIndentation; + t1 = _this._sass0$_nextIndentationEnd; + t1.toString; + _this.scanner.set$state(t1); + _this._sass0$_nextIndentationEnd = _this._sass0$_nextIndentation = null; + return currentIndentation; + }, + _sass0$_peekIndentation$0() { + var t1, t2, t3, start, containsTab, containsSpace, nextIndentation, _1_0, t4, _this = this, + _0_0 = _this._sass0$_nextIndentation; + if (_0_0 != null) + return _0_0; + t1 = _this.scanner; + t2 = t1._string_scanner$_position; + t3 = t1.string.length; + if (t2 === t3) { + _this._sass0$_nextIndentation = 0; + _this._sass0$_nextIndentationEnd = new A._SpanScannerState(t1, t2); + return 0; + } + start = new A._SpanScannerState(t1, t2); + if (!_this.scanCharIf$1(new A.SassParser__peekIndentation_closure1())) + t1.error$2$position(0, "Expected newline.", t1._string_scanner$_position); + containsTab = A._Cell$(); + containsSpace = A._Cell$(); + nextIndentation = A._Cell$(); + t2 = nextIndentation.__late_helper$_name; + do { + containsSpace._value = containsTab._value = false; + nextIndentation._value = 0; + for (; true;) { + $label0$0: { + _1_0 = t1.peekChar$0(); + if (32 === _1_0) { + containsSpace._value = true; + break $label0$0; + } + if (9 === _1_0) { + containsTab._value = true; + break $label0$0; + } + break; + } + t4 = nextIndentation._value; + if (t4 === nextIndentation) + A.throwExpression(A.LateError$localNI(t2)); + nextIndentation._value = t4 + 1; + t1.readChar$0(); + } + t4 = t1._string_scanner$_position; + if (t4 === t3) { + _this._sass0$_nextIndentation = 0; + _this._sass0$_nextIndentationEnd = new A._SpanScannerState(t1, t4); + t1.set$state(start); + return 0; + } + } while (_this.scanCharIf$1(new A.SassParser__peekIndentation_closure2())); + t2 = containsTab._readLocal$0(); + t3 = containsSpace._readLocal$0(); + if (t2) { + if (t3) { + t2 = t1._string_scanner$_position; + t3 = t1._sourceFile; + t4 = t3.getColumn$1(t2); + t1.error$3$length$position(0, "Tabs and spaces may not be mixed.", t3.getColumn$1(t1._string_scanner$_position), t2 - t4); + } else if (_this._sass0$_spaces === true) { + t2 = t1._string_scanner$_position; + t3 = t1._sourceFile; + t4 = t3.getColumn$1(t2); + t1.error$3$length$position(0, "Expected spaces, was tabs.", t3.getColumn$1(t1._string_scanner$_position), t2 - t4); + } + } else if (t3 && _this._sass0$_spaces === false) { + t2 = t1._string_scanner$_position; + t3 = t1._sourceFile; + t4 = t3.getColumn$1(t2); + t1.error$3$length$position(0, "Expected tabs, was spaces.", t3.getColumn$1(t1._string_scanner$_position), t2 - t4); + } + _this._sass0$_nextIndentation = nextIndentation._readLocal$0(); + if (nextIndentation._readLocal$0() > 0) + if (_this._sass0$_spaces == null) + _this._sass0$_spaces = containsSpace._readLocal$0(); + _this._sass0$_nextIndentationEnd = new A._SpanScannerState(t1, t1._string_scanner$_position); + t1.set$state(start); + return nextIndentation._readLocal$0(); + } + }; + A.SassParser_styleRuleSelector_closure0.prototype = { + call$1(char) { + return char === 10 || char === 13 || char === 12; + }, + $signature: 28 + }; + A.SassParser_children_closure0.prototype = { + call$0() { + var _0_0 = this.$this._sass0$_child$1(this.child); + if (_0_0 != null) + this.children.push(_0_0); + }, + $signature: 0 + }; + A.SassParser__peekIndentation_closure1.prototype = { + call$1(char) { + return char === 10 || char === 13 || char === 12; + }, + $signature: 28 + }; + A.SassParser__peekIndentation_closure2.prototype = { + call$1(char) { + return char === 10 || char === 13 || char === 12; + }, + $signature: 28 + }; + A._Exports.prototype = {}; + A._wrapMain_closure.prototype = { + call$1(_) { + return A._translateReturnValue(this.main.call$0()); + }, + $signature: 106 + }; + A._wrapMain_closure0.prototype = { + call$1(args) { + return A._translateReturnValue(this.main.call$1(A.List_List$from(type$.List_dynamic._as(args), true, type$.String))); + }, + $signature: 106 + }; + A.ScssParser0.prototype = { + get$indented() { + return false; + }, + get$currentIndentation() { + return 0; + }, + styleRuleSelector$0() { + return this.almostAnyValue$0(); + }, + expectStatementSeparator$1($name) { + var t1, _0_0; + this.whitespaceWithoutComments$0(); + t1 = this.scanner; + if (t1._string_scanner$_position === t1.string.length) + return; + _0_0 = t1.peekChar$0(); + if (59 === _0_0 || 125 === _0_0) + return; + t1.expectChar$1(59); + }, + expectStatementSeparator$0() { + return this.expectStatementSeparator$1(null); + }, + atEndOfStatement$0() { + var next = this.scanner.peekChar$0(); + return next == null || next === 59 || next === 125 || next === 123; + }, + lookingAtChildren$0() { + return this.scanner.peekChar$0() === 123; + }, + scanElse$1(ifIndentation) { + var t3, _this = this, + t1 = _this.scanner, + t2 = t1._string_scanner$_position; + _this.whitespace$0(); + t3 = t1._string_scanner$_position; + if (t1.scanChar$1(64)) { + if (_this.scanIdentifier$2$caseSensitive("else", true)) + return true; + if (_this.scanIdentifier$2$caseSensitive("elseif", true)) { + A.WarnForDeprecation_warnForDeprecation0(_this.logger, B.Deprecation_elseif_false_elseif, string$.x40elsei, t1.spanFrom$1(new A._SpanScannerState(t1, t3)), null); + t1.set$position(t1._string_scanner$_position - 2); + return true; + } + } + t1.set$state(new A._SpanScannerState(t1, t2)); + return false; + }, + children$1(_, child) { + var children, _this = this, + t1 = _this.scanner; + t1.expectChar$1(123); + _this.whitespaceWithoutComments$0(); + children = A._setArrayType([], type$.JSArray_Statement_2); + for (; true;) + switch (t1.peekChar$0()) { + case 36: + children.push(_this.variableDeclarationWithoutNamespace$0()); + break; + case 47: + switch (t1.peekChar$1(1)) { + case 47: + children.push(_this._scss0$_silentComment$0()); + _this.whitespaceWithoutComments$0(); + break; + case 42: + children.push(_this._scss0$_loudComment$0()); + _this.whitespaceWithoutComments$0(); + break; + default: + children.push(child.call$0()); + } + break; + case 59: + t1.readChar$0(); + _this.whitespaceWithoutComments$0(); + break; + case 125: + t1.expectChar$1(125); + return children; + default: + children.push(child.call$0()); + } + }, + statements$1(statement) { + var t1, t2, _0_0, _1_0, _this = this, + statements = A._setArrayType([], type$.JSArray_Statement_2); + _this.whitespaceWithoutComments$0(); + for (t1 = _this.scanner, t2 = t1.string.length; t1._string_scanner$_position !== t2;) + switch (t1.peekChar$0()) { + case 36: + statements.push(_this.variableDeclarationWithoutNamespace$0()); + break; + case 47: + switch (t1.peekChar$1(1)) { + case 47: + statements.push(_this._scss0$_silentComment$0()); + _this.whitespaceWithoutComments$0(); + break; + case 42: + statements.push(_this._scss0$_loudComment$0()); + _this.whitespaceWithoutComments$0(); + break; + default: + _0_0 = statement.call$0(); + if (_0_0 != null) + statements.push(_0_0); + } + break; + case 59: + t1.readChar$0(); + _this.whitespaceWithoutComments$0(); + break; + default: + _1_0 = statement.call$0(); + if (_1_0 != null) + statements.push(_1_0); + } + return statements; + }, + _scss0$_silentComment$0() { + var t2, t3, _this = this, + t1 = _this.scanner, + start = new A._SpanScannerState(t1, t1._string_scanner$_position); + t1.expect$1("//"); + t2 = t1.string.length; + do { + while (true) { + if (t1._string_scanner$_position !== t2) { + t3 = t1.readChar$0(); + t3 = !(t3 === 10 || t3 === 13 || t3 === 12); + } else + t3 = false; + if (!t3) + break; + } + if (t1._string_scanner$_position === t2) + break; + _this.spaces$0(); + } while (t1.scan$1("//")); + if (_this.get$plainCss()) + _this.error$2(0, string$.Silent, t1.spanFrom$1(start)); + return _this.lastSilentComment = new A.SilentComment0(t1.substring$1(0, start.position), t1.spanFrom$1(start)); + }, + _scss0$_loudComment$0() { + var t3, t4, buffer, t5, endPosition, t6, result, + t1 = this.scanner, + t2 = t1._string_scanner$_position; + t1.expect$1("/*"); + t3 = new A.StringBuffer(""); + t4 = A._setArrayType([], type$.JSArray_Object); + buffer = new A.InterpolationBuffer0(t3, t4); + t3._contents = "" + "/*"; + $label0$1: + for (; true;) + switch (t1.peekChar$0()) { + case 35: + if (t1.peekChar$1(1) === 123) { + t5 = this.singleInterpolation$0(); + buffer._interpolation_buffer0$_flushText$0(); + t4.push(t5); + } else + t3._contents += A.Primitives_stringFromCharCode(t1.readChar$0()); + break; + case 42: + t3._contents += A.Primitives_stringFromCharCode(t1.readChar$0()); + if (t1.peekChar$0() !== 47) + continue $label0$1; + t3._contents += A.Primitives_stringFromCharCode(t1.readChar$0()); + endPosition = t1._string_scanner$_position; + t5 = t1._sourceFile; + t6 = new A._SpanScannerState(t1, t2).position; + t1 = new A._FileSpan(t5, t6, endPosition); + t1._FileSpan$3(t5, t6, endPosition); + t6 = type$.Object; + t5 = A.List_List$of(t4, true, t6); + t2 = t3._contents; + if (t2.length !== 0) + t5.push(t2.charCodeAt(0) == 0 ? t2 : t2); + result = A.List_List$from(t5, false, t6); + result.fixed$length = Array; + result.immutable$list = Array; + t2 = new A.Interpolation0(result, t1); + t2.Interpolation$20(t5, t1); + return new A.LoudComment0(t2); + case 13: + t1.readChar$0(); + if (t1.peekChar$0() !== 10) + t3._contents += A.Primitives_stringFromCharCode(10); + break; + case 12: + t1.readChar$0(); + t3._contents += A.Primitives_stringFromCharCode(10); + break; + default: + t3._contents += A.Primitives_stringFromCharCode(t1.readChar$0()); + } + } + }; + A.Selector0.prototype = { + assertNotBogus$1$name($name) { + var t1; + if (!this.accept$1(B._IsBogusVisitor_true0)) + return; + t1 = this.toString$0(0); + A.EvaluationContext_current0().warn$2(0, "$" + $name + ": " + (t1 + string$.x20is_nov), B.Deprecation_XV6); + }, + toString$0(_) { + var visitor = A._SerializeVisitor$0(null, true, null, true, false, null, true); + this.accept$1(visitor); + return visitor._serialize0$_buffer.toString$0(0); + }, + $isAstNode0: 1, + get$span(receiver) { + return this.span; + } + }; + A._IsInvisibleVisitor2.prototype = { + visitSelectorList$1(list) { + return B.JSArray_methods.every$1(list.components, this.get$visitComplexSelector()); + }, + visitComplexSelector$1(complex) { + var t1; + if (!this.super$AnySelectorVisitor$visitComplexSelector0(complex)) + t1 = this.includeBogus && complex.accept$1(B._IsBogusVisitor_false0); + else + t1 = true; + return t1; + }, + visitPlaceholderSelector$1(placeholder) { + return true; + }, + visitPseudoSelector$1(pseudo) { + var t1, + _0_0 = pseudo.selector; + if (_0_0 != null) { + if (pseudo.name === "not") + t1 = this.includeBogus && _0_0.accept$1(B._IsBogusVisitor_true0); + else + t1 = this.visitSelectorList$1(_0_0); + return t1; + } else + return false; + } + }; + A._IsBogusVisitor0.prototype = { + visitComplexSelector$1(complex) { + var t2, + t1 = complex.components; + if (t1.length === 0) + return complex.leadingCombinators.length !== 0; + else { + t2 = this.includeLeadingCombinator ? 0 : 1; + return complex.leadingCombinators.length > t2 || B.JSArray_methods.get$last(t1).combinators.length !== 0 || B.JSArray_methods.any$1(t1, new A._IsBogusVisitor_visitComplexSelector_closure0(this)); + } + }, + visitPseudoSelector$1(pseudo) { + var selector = pseudo.selector; + if (selector == null) + return false; + return pseudo.name === "has" ? selector.accept$1(B._IsBogusVisitor_false0) : selector.accept$1(B._IsBogusVisitor_true0); + } + }; + A._IsBogusVisitor_visitComplexSelector_closure0.prototype = { + call$1(component) { + return component.combinators.length > 1 || this.$this.visitCompoundSelector$1(component.selector); + }, + $signature: 51 + }; + A._IsUselessVisitor0.prototype = { + visitComplexSelector$1(complex) { + return complex.leadingCombinators.length > 1 || B.JSArray_methods.any$1(complex.components, new A._IsUselessVisitor_visitComplexSelector_closure0(this)); + }, + visitPseudoSelector$1(pseudo) { + return pseudo.accept$1(B._IsBogusVisitor_true0); + } + }; + A._IsUselessVisitor_visitComplexSelector_closure0.prototype = { + call$1(component) { + return component.combinators.length > 1 || this.$this.visitCompoundSelector$1(component.selector); + }, + $signature: 51 + }; + A.__IsBogusVisitor_Object_AnySelectorVisitor0.prototype = {}; + A.__IsInvisibleVisitor_Object_AnySelectorVisitor0.prototype = {}; + A.__IsUselessVisitor_Object_AnySelectorVisitor0.prototype = {}; + A.SelectorExpression0.prototype = { + accept$1$1(visitor) { + return visitor.visitSelectorExpression$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + toString$0(_) { + return "&"; + }, + $isExpression0: 1, + $isAstNode0: 1, + get$span(receiver) { + return this.span; + } + }; + A._nest_closure0.prototype = { + call$1($arguments) { + var t1 = {}, + selectors = J.$index$asx($arguments, 0).get$asList(); + if (selectors.length === 0) + throw A.wrapException(A.SassScriptException$0(string$.x24selec, null)); + t1.first = true; + return new A.MappedListIterable(selectors, new A._nest__closure1(t1), A._arrayInstanceType(selectors)._eval$1("MappedListIterable<1,SelectorList0>")).reduce$1(0, new A._nest__closure2()).get$asSassList(); + }, + $signature: 22 + }; + A._nest__closure1.prototype = { + call$1(selector) { + var t1 = this._box_0, + result = A.SassApiValue_assertSelector0(selector, !t1.first, null); + t1.first = false; + return result; + }, + $signature: 178 + }; + A._nest__closure2.prototype = { + call$2($parent, child) { + return child.resolveParentSelectors$1($parent); + }, + $signature: 183 + }; + A._append_closure1.prototype = { + call$1($arguments) { + var selectors = J.$index$asx($arguments, 0).get$asList(); + if (selectors.length === 0) + throw A.wrapException(A.SassScriptException$0(string$.x24selec, null)); + return new A.MappedListIterable(selectors, new A._append__closure1(), A._arrayInstanceType(selectors)._eval$1("MappedListIterable<1,SelectorList0>")).reduce$1(0, new A._append__closure2(A.EvaluationContext_current0().get$currentCallableSpan())).get$asSassList(); + }, + $signature: 22 + }; + A._append__closure1.prototype = { + call$1(selector) { + return A.SassApiValue_assertSelector0(selector, false, null); + }, + $signature: 178 + }; + A._append__closure2.prototype = { + call$2($parent, child) { + var t1 = child.components, + t2 = this.span; + return A.SelectorList$0(new A.MappedListIterable(t1, new A._append___closure0($parent, t2), A._arrayInstanceType(t1)._eval$1("MappedListIterable<1,ComplexSelector0>")), t2).resolveParentSelectors$1($parent); + }, + $signature: 183 + }; + A._append___closure0.prototype = { + call$1(complex) { + var _0_0, component, rest, t1, newCompound, t2, _null = null; + if (complex.leadingCombinators.length !== 0) + throw A.wrapException(A.SassScriptException$0("Can't append " + complex.toString$0(0) + " to " + this.parent.toString$0(0) + ".", _null)); + _0_0 = complex.components; + if (_0_0.length >= 1) { + component = _0_0[0]; + rest = B.JSArray_methods.sublist$1(_0_0, 1); + t1 = true; + } else { + rest = _null; + component = rest; + t1 = false; + } + if (!t1) + throw A.wrapException(A.StateError$("Pattern matching error")); + newCompound = A._prependParent0(component.selector); + if (newCompound == null) + throw A.wrapException(A.SassScriptException$0("Can't append " + complex.toString$0(0) + " to " + this.parent.toString$0(0) + ".", _null)); + t1 = this.span; + t2 = A._setArrayType([new A.ComplexSelectorComponent0(newCompound, A.List_List$unmodifiable(component.combinators, type$.CssValue_Combinator_2), t1)], type$.JSArray_ComplexSelectorComponent_2); + B.JSArray_methods.addAll$1(t2, rest); + return A.ComplexSelector$0(B.List_empty14, t2, t1, false); + }, + $signature: 63 + }; + A._extend_closure0.prototype = { + call$1($arguments) { + var target, source, + _s8_ = "selector", + _s8_0 = "extendee", + _s8_1 = "extender", + t1 = J.getInterceptor$asx($arguments), + selector = A.SassApiValue_assertSelector0(t1.$index($arguments, 0), false, _s8_); + selector.assertNotBogus$1$name(_s8_); + target = A.SassApiValue_assertSelector0(t1.$index($arguments, 1), false, _s8_0); + target.assertNotBogus$1$name(_s8_0); + source = A.SassApiValue_assertSelector0(t1.$index($arguments, 2), false, _s8_1); + source.assertNotBogus$1$name(_s8_1); + return A.ExtensionStore__extendOrReplace0(selector, source, target, B.ExtendMode_allTargets_allTargets0, A.EvaluationContext_current0().get$currentCallableSpan()).get$asSassList(); + }, + $signature: 22 + }; + A._replace_closure0.prototype = { + call$1($arguments) { + var target, source, + _s8_ = "selector", + _s8_0 = "original", + _s11_ = "replacement", + t1 = J.getInterceptor$asx($arguments), + selector = A.SassApiValue_assertSelector0(t1.$index($arguments, 0), false, _s8_); + selector.assertNotBogus$1$name(_s8_); + target = A.SassApiValue_assertSelector0(t1.$index($arguments, 1), false, _s8_0); + target.assertNotBogus$1$name(_s8_0); + source = A.SassApiValue_assertSelector0(t1.$index($arguments, 2), false, _s11_); + source.assertNotBogus$1$name(_s11_); + return A.ExtensionStore__extendOrReplace0(selector, source, target, B.ExtendMode_replace_replace0, A.EvaluationContext_current0().get$currentCallableSpan()).get$asSassList(); + }, + $signature: 22 + }; + A._unify_closure0.prototype = { + call$1($arguments) { + var selector2, + _s9_ = "selector1", + _s9_0 = "selector2", + t1 = J.getInterceptor$asx($arguments), + selector1 = A.SassApiValue_assertSelector0(t1.$index($arguments, 0), false, _s9_); + selector1.assertNotBogus$1$name(_s9_); + selector2 = A.SassApiValue_assertSelector0(t1.$index($arguments, 1), false, _s9_0); + selector2.assertNotBogus$1$name(_s9_0); + t1 = selector1.unify$1(selector2); + t1 = t1 == null ? null : t1.get$asSassList(); + return t1 == null ? B.C__SassNull0 : t1; + }, + $signature: 3 + }; + A._isSuperselector_closure0.prototype = { + call$1($arguments) { + var selector2, + t1 = J.getInterceptor$asx($arguments), + selector1 = A.SassApiValue_assertSelector0(t1.$index($arguments, 0), false, "super"); + selector1.assertNotBogus$1$name("super"); + selector2 = A.SassApiValue_assertSelector0(t1.$index($arguments, 1), false, "sub"); + selector2.assertNotBogus$1$name("sub"); + return A.listIsSuperselector0(selector1.components, selector2.components) ? B.SassBoolean_true0 : B.SassBoolean_false0; + }, + $signature: 20 + }; + A._simpleSelectors_closure0.prototype = { + call$1($arguments) { + var t1 = A.SassApiValue_assertCompoundSelector0(J.$index$asx($arguments, 0), "selector").components; + return A.SassList$0(new A.MappedListIterable(t1, new A._simpleSelectors__closure0(), A._arrayInstanceType(t1)._eval$1("MappedListIterable<1,Value0>")), B.ListSeparator_rXA0, false); + }, + $signature: 22 + }; + A._simpleSelectors__closure0.prototype = { + call$1(simple) { + return new A.SassString0(A.serializeSelector0(simple, true), false); + }, + $signature: 525 + }; + A._parse_closure0.prototype = { + call$1($arguments) { + return A.SassApiValue_assertSelector0(J.$index$asx($arguments, 0), false, "selector").get$asSassList(); + }, + $signature: 22 + }; + A.SelectorParser0.prototype = { + parse$0() { + return this.wrapSpanFormatException$1(new A.SelectorParser_parse_closure0(this)); + }, + parseCompoundSelector$0() { + return this.wrapSpanFormatException$1(new A.SelectorParser_parseCompoundSelector_closure0(this)); + }, + _selector$_selectorList$0() { + var t4, t5, lineBreak, _this = this, + t1 = _this.scanner, + t2 = t1._string_scanner$_position, + t3 = t1._sourceFile, + previousLine = t3.getLine$1(t2), + components = A._setArrayType([_this._selector$_complexSelector$0()], type$.JSArray_ComplexSelector_2); + _this.whitespace$0(); + for (t4 = t1.string.length; t1.scanChar$1(44);) { + _this.whitespace$0(); + if (t1.peekChar$0() === 44) + continue; + t5 = t1._string_scanner$_position; + if (t5 === t4) + break; + lineBreak = t3.getLine$1(t5) !== previousLine; + if (lineBreak) + previousLine = t3.getLine$1(t1._string_scanner$_position); + components.push(_this._selector$_complexSelector$1$lineBreak(lineBreak)); + } + return A.SelectorList$0(components, _this.spanFrom$1(new A._SpanScannerState(t1, t2))); + }, + _selector$_complexSelector$1$lineBreak(lineBreak) { + var t4, lastCompound, initialCombinators, _0_0, t5, result, _this = this, + t1 = _this.scanner, + t2 = t1._string_scanner$_position, + componentStart = new A._SpanScannerState(t1, t2), + t3 = type$.JSArray_CssValue_Combinator_2, + combinators = A._setArrayType([], t3), + components = A._setArrayType([], type$.JSArray_ComplexSelectorComponent_2); + for (t4 = type$.CssValue_Combinator_2, lastCompound = null, initialCombinators = null; true;) { + _this.whitespace$0(); + _0_0 = t1.peekChar$0(); + if (43 === _0_0) { + t5 = t1._string_scanner$_position; + t1.readChar$0(); + combinators.push(new A.CssValue0(B.Combinator_4QF0, _this.spanFrom$1(new A._SpanScannerState(t1, t5)), t4)); + continue; + } + if (62 === _0_0) { + t5 = t1._string_scanner$_position; + t1.readChar$0(); + combinators.push(new A.CssValue0(B.Combinator_Cht0, _this.spanFrom$1(new A._SpanScannerState(t1, t5)), t4)); + continue; + } + if (126 === _0_0) { + t5 = t1._string_scanner$_position; + t1.readChar$0(); + combinators.push(new A.CssValue0(B.Combinator_Htt0, _this.spanFrom$1(new A._SpanScannerState(t1, t5)), t4)); + continue; + } + if (_0_0 == null) + break; + if (91 !== _0_0) + if (46 !== _0_0) + if (35 !== _0_0) + if (37 !== _0_0) + if (58 !== _0_0) + if (38 !== _0_0) + if (42 !== _0_0) + if (124 !== _0_0) + t5 = _this.lookingAtIdentifier$0(); + else + t5 = true; + else + t5 = true; + else + t5 = true; + else + t5 = true; + else + t5 = true; + else + t5 = true; + else + t5 = true; + else + t5 = true; + if (t5) { + if (lastCompound != null) { + t5 = _this.spanFrom$1(componentStart); + result = A.List_List$from(combinators, false, t4); + result.fixed$length = Array; + result.immutable$list = Array; + components.push(new A.ComplexSelectorComponent0(lastCompound, result, t5)); + } else if (combinators.length !== 0) { + componentStart = new A._SpanScannerState(t1, t1._string_scanner$_position); + initialCombinators = combinators; + } + lastCompound = _this._selector$_compoundSelector$0(); + combinators = A._setArrayType([], t3); + if (t1.peekChar$0() === 38) + t1.error$1(0, string$.x22x26__ma); + continue; + } + break; + } + if (lastCompound != null) { + t3 = _this.spanFrom$1(componentStart); + components.push(new A.ComplexSelectorComponent0(lastCompound, A.List_List$unmodifiable(combinators, t4), t3)); + } else if (combinators.length !== 0) + initialCombinators = combinators; + else + t1.error$1(0, "expected selector."); + t3 = initialCombinators == null ? B.List_empty14 : initialCombinators; + return A.ComplexSelector$0(t3, components, _this.spanFrom$1(new A._SpanScannerState(t1, t2)), lineBreak); + }, + _selector$_complexSelector$0() { + return this._selector$_complexSelector$1$lineBreak(false); + }, + _selector$_compoundSelector$0() { + var t3, _this = this, + t1 = _this.scanner, + t2 = t1._string_scanner$_position, + components = A._setArrayType([_this._selector$_simpleSelector$0()], type$.JSArray_SimpleSelector_2); + while (true) { + t3 = t1.peekChar$0(); + if (!(t3 === 42 || t3 === 91 || t3 === 46 || t3 === 35 || t3 === 37 || t3 === 58)) + break; + components.push(_this._selector$_simpleSelector$1$allowParent(false)); + } + return A.CompoundSelector$0(components, _this.spanFrom$1(new A._SpanScannerState(t1, t2))); + }, + _selector$_simpleSelector$1$allowParent(allowParent) { + var t2, $name, text, t3, suffix, _this = this, + t1 = _this.scanner, + start = new A._SpanScannerState(t1, t1._string_scanner$_position); + if (allowParent == null) + allowParent = _this._selector$_allowParent; + switch (t1.peekChar$0()) { + case 91: + return _this._selector$_attributeSelector$0(); + case 46: + t2 = t1._string_scanner$_position; + t1.expectChar$1(46); + return new A.ClassSelector0(_this.identifier$0(), _this.spanFrom$1(new A._SpanScannerState(t1, t2))); + case 35: + t2 = t1._string_scanner$_position; + t1.expectChar$1(35); + return new A.IDSelector0(_this.identifier$0(), _this.spanFrom$1(new A._SpanScannerState(t1, t2))); + case 37: + t2 = t1._string_scanner$_position; + t1.expectChar$1(37); + $name = _this.identifier$0(); + t2 = _this.spanFrom$1(new A._SpanScannerState(t1, t2)); + if (!_this._selector$_allowPlaceholder) + _this.error$2(0, string$.Placeh, t1.spanFrom$1(start)); + return new A.PlaceholderSelector0($name, t2); + case 58: + return _this._selector$_pseudoSelector$0(); + case 38: + t2 = t1._string_scanner$_position; + t1.expectChar$1(38); + if (_this.lookingAtIdentifierBody$0()) { + text = new A.StringBuffer(""); + _this._parser0$_identifierBody$1(text); + if (text._contents.length === 0) + t1.error$1(0, "Expected identifier body."); + t3 = text._contents; + suffix = t3.charCodeAt(0) == 0 ? t3 : t3; + } else + suffix = null; + t2 = _this.spanFrom$1(new A._SpanScannerState(t1, t2)); + if (!allowParent) + _this.error$2(0, "Parent selectors aren't allowed here.", t1.spanFrom$1(start)); + return new A.ParentSelector0(suffix, t2); + default: + return _this._selector$_typeOrUniversalSelector$0(); + } + }, + _selector$_simpleSelector$0() { + return this._selector$_simpleSelector$1$allowParent(null); + }, + _selector$_attributeSelector$0() { + var $name, operator, next, value, modifier, _this = this, _null = null, + t1 = _this.scanner, + start = new A._SpanScannerState(t1, t1._string_scanner$_position); + t1.expectChar$1(91); + _this.whitespace$0(); + $name = _this._selector$_attributeName$0(); + _this.whitespace$0(); + if (t1.scanChar$1(93)) + return new A.AttributeSelector0($name, _null, _null, _null, _this.spanFrom$1(start)); + operator = _this._selector$_attributeOperator$0(); + _this.whitespace$0(); + next = t1.peekChar$0(); + value = next === 39 || next === 34 ? _this.string$0() : _this.identifier$0(); + _this.whitespace$0(); + next = t1.peekChar$0(); + modifier = next != null && A.CharacterExtension_get_isAlphabetic0(next) ? A.Primitives_stringFromCharCode(t1.readChar$0()) : _null; + t1.expectChar$1(93); + return new A.AttributeSelector0($name, operator, value, modifier, _this.spanFrom$1(start)); + }, + _selector$_attributeName$0() { + var nameOrNamespace, _this = this, + t1 = _this.scanner; + if (t1.scanChar$1(42)) { + t1.expectChar$1(124); + return new A.QualifiedName0(_this.identifier$0(), "*"); + } + if (t1.scanChar$1(124)) + return new A.QualifiedName0(_this.identifier$0(), ""); + nameOrNamespace = _this.identifier$0(); + if (t1.peekChar$0() !== 124 || t1.peekChar$1(1) === 61) + return new A.QualifiedName0(nameOrNamespace, null); + t1.readChar$0(); + return new A.QualifiedName0(_this.identifier$0(), nameOrNamespace); + }, + _selector$_attributeOperator$0() { + var t1 = this.scanner, + t2 = t1._string_scanner$_position; + switch (t1.readChar$0()) { + case 61: + return B.AttributeOperator_ES60; + case 126: + t1.expectChar$1(61); + return B.AttributeOperator_r600; + case 124: + t1.expectChar$1(61); + return B.AttributeOperator_ivT0; + case 94: + t1.expectChar$1(61); + return B.AttributeOperator_eot0; + case 36: + t1.expectChar$1(61); + return B.AttributeOperator_BGd0; + case 42: + t1.expectChar$1(61); + return B.AttributeOperator_8aB0; + default: + t1.error$2$position(0, 'Expected "]".', t2); + } + }, + _selector$_pseudoSelector$0() { + var element, $name, unvendored, selector, argument, t2, _this = this, _null = null, + t1 = _this.scanner, + start = new A._SpanScannerState(t1, t1._string_scanner$_position); + t1.expectChar$1(58); + element = t1.scanChar$1(58); + $name = _this.identifier$0(); + if (!t1.scanChar$1(40)) + return A.PseudoSelector$0($name, _this.spanFrom$1(start), _null, element, _null); + _this.whitespace$0(); + unvendored = A.unvendor0($name); + if (element) + if ($._selectorPseudoElements0.contains$1(0, unvendored)) { + selector = _this._selector$_selectorList$0(); + argument = _null; + } else { + argument = _this.declarationValue$1$allowEmpty(true); + selector = _null; + } + else if ($._selectorPseudoClasses0.contains$1(0, unvendored)) { + selector = _this._selector$_selectorList$0(); + argument = _null; + } else if (unvendored === "nth-child" || unvendored === "nth-last-child") { + argument = _this._selector$_aNPlusB$0(); + _this.whitespace$0(); + t2 = t1.peekChar$1(-1); + if ((t2 === 32 || t2 === 9 || t2 === 10 || t2 === 13 || t2 === 12) && t1.peekChar$0() !== 41) { + _this.expectIdentifier$1("of"); + argument += " of"; + _this.whitespace$0(); + selector = _this._selector$_selectorList$0(); + } else + selector = _null; + } else { + argument = B.JSString_methods.trimRight$0(_this.declarationValue$1$allowEmpty(true)); + selector = _null; + } + t1.expectChar$1(41); + return A.PseudoSelector$0($name, _this.spanFrom$1(start), argument, element, selector); + }, + _selector$_aNPlusB$0() { + var t1, _0_0, t2, $self, next, _this = this; + $label0$0: { + t1 = _this.scanner; + _0_0 = t1.peekChar$0(); + if (101 === _0_0 || 69 === _0_0) { + _this.expectIdentifier$1("even"); + return "even"; + } + if (111 === _0_0 || 79 === _0_0) { + _this.expectIdentifier$1("odd"); + return "odd"; + } + if (43 === _0_0 || 45 === _0_0) { + t2 = "" + A.Primitives_stringFromCharCode(t1.readChar$0()); + break $label0$0; + } + t2 = ""; + } + $self = t1.peekChar$0(); + if ($self != null && $self >= 48 && $self <= 57) { + do { + t2 += A.Primitives_stringFromCharCode(t1.readChar$0()); + $self = t1.peekChar$0(); + } while ($self != null && $self >= 48 && $self <= 57); + _this.whitespace$0(); + if (!_this.scanIdentChar$1(110)) + return t2.charCodeAt(0) == 0 ? t2 : t2; + } else + _this.expectIdentChar$1(110); + t2 += A.Primitives_stringFromCharCode(110); + _this.whitespace$0(); + next = t1.peekChar$0(); + if (next !== 43 && next !== 45) + return t2.charCodeAt(0) == 0 ? t2 : t2; + t2 += A.Primitives_stringFromCharCode(t1.readChar$0()); + _this.whitespace$0(); + $self = t1.peekChar$0(); + if (!($self != null && $self >= 48 && $self <= 57)) + t1.error$1(0, "Expected a number."); + do { + t2 += A.Primitives_stringFromCharCode(t1.readChar$0()); + $self = t1.peekChar$0(); + } while ($self != null && $self >= 48 && $self <= 57); + return t2.charCodeAt(0) == 0 ? t2 : t2; + }, + _selector$_typeOrUniversalSelector$0() { + var nameOrNamespace, _this = this, + t1 = _this.scanner, + start = new A._SpanScannerState(t1, t1._string_scanner$_position); + if (t1.scanChar$1(42)) { + if (!t1.scanChar$1(124)) + return new A.UniversalSelector0(null, _this.spanFrom$1(start)); + return t1.scanChar$1(42) ? new A.UniversalSelector0("*", _this.spanFrom$1(start)) : new A.TypeSelector0(new A.QualifiedName0(_this.identifier$0(), "*"), _this.spanFrom$1(start)); + } else if (t1.scanChar$1(124)) + return t1.scanChar$1(42) ? new A.UniversalSelector0("", _this.spanFrom$1(start)) : new A.TypeSelector0(new A.QualifiedName0(_this.identifier$0(), ""), _this.spanFrom$1(start)); + nameOrNamespace = _this.identifier$0(); + if (!t1.scanChar$1(124)) + return new A.TypeSelector0(new A.QualifiedName0(nameOrNamespace, null), _this.spanFrom$1(start)); + else if (t1.scanChar$1(42)) + return new A.UniversalSelector0(nameOrNamespace, _this.spanFrom$1(start)); + else + return new A.TypeSelector0(new A.QualifiedName0(_this.identifier$0(), nameOrNamespace), _this.spanFrom$1(start)); + } + }; + A.SelectorParser_parse_closure0.prototype = { + call$0() { + var t1 = this.$this, + selector = t1._selector$_selectorList$0(); + t1 = t1.scanner; + if (t1._string_scanner$_position !== t1.string.length) + t1.error$1(0, "expected selector."); + return selector; + }, + $signature: 526 + }; + A.SelectorParser_parseCompoundSelector_closure0.prototype = { + call$0() { + var t1 = this.$this, + compound = t1._selector$_compoundSelector$0(); + t1 = t1.scanner; + if (t1._string_scanner$_position !== t1.string.length) + t1.error$1(0, "expected selector."); + return compound; + }, + $signature: 527 + }; + A.SelectorSearchVisitor0.prototype = { + visitAttributeSelector$1(attribute) { + return null; + }, + visitClassSelector$1(klass) { + return null; + }, + visitIDSelector$1(id) { + return null; + }, + visitParentSelector$1(placeholder) { + return null; + }, + visitPlaceholderSelector$1(placeholder) { + return null; + }, + visitTypeSelector$1(type) { + return null; + }, + visitUniversalSelector$1(universal) { + return null; + }, + visitComplexSelector$1(complex) { + return A.IterableExtension_search0(complex.components, new A.SelectorSearchVisitor_visitComplexSelector_closure0(this)); + }, + visitCompoundSelector$1(compound) { + return A.IterableExtension_search0(compound.components, new A.SelectorSearchVisitor_visitCompoundSelector_closure0(this)); + }, + visitPseudoSelector$1(pseudo) { + return A.NullableExtension_andThen0(pseudo.selector, this.get$visitSelectorList()); + }, + visitSelectorList$1(list) { + return A.IterableExtension_search0(list.components, this.get$visitComplexSelector()); + } + }; + A.SelectorSearchVisitor_visitComplexSelector_closure0.prototype = { + call$1(component) { + return this.$this.visitCompoundSelector$1(component.selector); + }, + $signature() { + return A._instanceType(this.$this)._eval$1("SelectorSearchVisitor0.T?(ComplexSelectorComponent0)"); + } + }; + A.SelectorSearchVisitor_visitCompoundSelector_closure0.prototype = { + call$1(simple) { + return simple.accept$1(this.$this); + }, + $signature() { + return A._instanceType(this.$this)._eval$1("SelectorSearchVisitor0.T?(SimpleSelector0)"); + } + }; + A.serialize_closure0.prototype = { + call$1(codeUnit) { + return codeUnit > 127; + }, + $signature: 46 + }; + A._SerializeVisitor0.prototype = { + visitCssStylesheet$1(node) { + var t1, t2, t3, t4, t5, t6, t7, previous, previous0, t8, _this = this; + for (t1 = J.get$iterator$ax(node.get$children(node)), t2 = !_this._serialize0$_inspect, t3 = _this._serialize0$_style === B.OutputStyle_10, t4 = !t3, t5 = type$.CssParentNode_2, t6 = _this._serialize0$_buffer, t7 = _this._lineFeed.text, previous = null; t1.moveNext$0();) { + previous0 = t1.get$current(t1); + if (t2) + t8 = t3 ? previous0.accept$1(B._IsInvisibleVisitor_true_true0) : previous0.accept$1(B._IsInvisibleVisitor_true_false0); + else + t8 = false; + if (t8) + continue; + if (previous != null) { + if (t5._is(previous) ? previous.get$isChildless() : !(previous instanceof A.ModifiableCssComment0)) + t6.writeCharCode$1(59); + if (_this._serialize0$_isTrailingComment$2(previous0, previous)) { + if (t4) + t6.writeCharCode$1(32); + } else { + if (t4) + t6.write$1(0, t7); + if (previous.get$isGroupEnd()) + if (t4) + t6.write$1(0, t7); + } + } + previous0.accept$1(_this); + previous = previous0; + } + if (previous != null) + t1 = (t5._is(previous) ? previous.get$isChildless() : !(previous instanceof A.ModifiableCssComment0)) && t4; + else + t1 = false; + if (t1) + t6.writeCharCode$1(59); + }, + visitCssComment$1(node) { + this._serialize0$_buffer.forSpan$2(node.span, new A._SerializeVisitor_visitCssComment_closure0(this, node)); + }, + visitCssAtRule$1(node) { + var t1, _this = this; + _this._serialize0$_writeIndentation$0(); + t1 = _this._serialize0$_buffer; + t1.forSpan$2(node.span, new A._SerializeVisitor_visitCssAtRule_closure0(_this, node)); + if (!node.isChildless) { + if (_this._serialize0$_style !== B.OutputStyle_10) + t1.writeCharCode$1(32); + _this._serialize0$_visitChildren$1(node); + } + }, + visitCssMediaRule$1(node) { + var t1, _this = this; + _this._serialize0$_writeIndentation$0(); + t1 = _this._serialize0$_buffer; + t1.forSpan$2(node.span, new A._SerializeVisitor_visitCssMediaRule_closure0(_this, node)); + if (_this._serialize0$_style !== B.OutputStyle_10) + t1.writeCharCode$1(32); + _this._serialize0$_visitChildren$1(node); + }, + visitCssImport$1(node) { + this._serialize0$_writeIndentation$0(); + this._serialize0$_buffer.forSpan$2(node.span, new A._SerializeVisitor_visitCssImport_closure0(this, node)); + }, + _serialize0$_writeImportUrl$1(url) { + var urlContents, maybeQuote, _this = this; + if (_this._serialize0$_style !== B.OutputStyle_10 || url.charCodeAt(0) !== 117) { + _this._serialize0$_buffer.write$1(0, url); + return; + } + urlContents = B.JSString_methods.substring$2(url, 4, url.length - 1); + maybeQuote = urlContents.charCodeAt(0); + if (maybeQuote === 39 || maybeQuote === 34) + _this._serialize0$_buffer.write$1(0, urlContents); + else + _this._serialize0$_visitQuotedString$1(urlContents); + }, + visitCssKeyframeBlock$1(node) { + var t1, _this = this; + _this._serialize0$_writeIndentation$0(); + t1 = _this._serialize0$_buffer; + t1.forSpan$2(node.selector.span, new A._SerializeVisitor_visitCssKeyframeBlock_closure0(_this, node)); + if (_this._serialize0$_style !== B.OutputStyle_10) + t1.writeCharCode$1(32); + _this._serialize0$_visitChildren$1(node); + }, + _serialize0$_visitMediaQuery$1(query) { + var t1, _1_0, _2_0, condition, operator, t2, _this = this, + _0_0 = query.modifier; + if (_0_0 != null) { + t1 = _this._serialize0$_buffer; + t1.write$1(0, _0_0); + t1.writeCharCode$1(32); + } + _1_0 = query.type; + if (_1_0 != null) { + t1 = _this._serialize0$_buffer; + t1.write$1(0, _1_0); + if (query.conditions.length !== 0) + t1.write$1(0, " and "); + } + _2_0 = query.conditions; + if (_2_0.length === 1) + t1 = B.JSString_methods.startsWith$1(_2_0[0], "(not "); + else + t1 = false; + if (t1) { + t1 = _this._serialize0$_buffer; + t1.write$1(0, "not "); + condition = B.JSArray_methods.get$first(_2_0); + t1.write$1(0, B.JSString_methods.substring$2(condition, 5, condition.length - 1)); + } else { + operator = query.conjunction ? "and" : "or"; + t1 = _this._serialize0$_style === B.OutputStyle_10 ? operator + " " : " " + operator + " "; + t2 = _this._serialize0$_buffer; + _this._serialize0$_writeBetween$3(_2_0, t1, t2.get$write(t2)); + } + }, + visitCssStyleRule$1(node) { + var t1, _this = this; + _this._serialize0$_writeIndentation$0(); + t1 = _this._serialize0$_buffer; + t1.forSpan$2(node._style_rule0$_selector._box0$_inner.value.span, new A._SerializeVisitor_visitCssStyleRule_closure0(_this, node)); + if (_this._serialize0$_style !== B.OutputStyle_10) + t1.writeCharCode$1(32); + _this._serialize0$_visitChildren$1(node); + }, + visitCssSupportsRule$1(node) { + var t1, _this = this; + _this._serialize0$_writeIndentation$0(); + t1 = _this._serialize0$_buffer; + t1.forSpan$2(node.span, new A._SerializeVisitor_visitCssSupportsRule_closure0(_this, node)); + if (_this._serialize0$_style !== B.OutputStyle_10) + t1.writeCharCode$1(32); + _this._serialize0$_visitChildren$1(node); + }, + visitCssDeclaration$1(node) { + var error, stackTrace, error0, stackTrace0, t1, t2, exception, _this = this; + _this._serialize0$_writeIndentation$0(); + t1 = node.name; + _this._serialize0$_write$1(t1); + t2 = _this._serialize0$_buffer; + t2.writeCharCode$1(58); + if (J.startsWith$1$s(t1.value, "--") && node.parsedAsCustomProperty) + t2.forSpan$2(node.value.span, new A._SerializeVisitor_visitCssDeclaration_closure1(_this, node)); + else { + if (_this._serialize0$_style !== B.OutputStyle_10) + t2.writeCharCode$1(32); + try { + t2.forSpan$2(node.valueSpanForMap, new A._SerializeVisitor_visitCssDeclaration_closure2(_this, node)); + } catch (exception) { + t1 = A.unwrapException(exception); + if (t1 instanceof A.MultiSpanSassScriptException0) { + error = t1; + stackTrace = A.getTraceFromException(exception); + A.throwWithTrace0(A.MultiSpanSassException$0(error.message, node.value.span, error.primaryLabel, error.secondarySpans, null), error, stackTrace); + } else if (t1 instanceof A.SassScriptException0) { + error0 = t1; + stackTrace0 = A.getTraceFromException(exception); + t1 = error0.message; + A.throwWithTrace0(new A.SassException0(B.Set_empty, t1, node.value.span), error0, stackTrace0); + } else + throw exception; + } + } + }, + _serialize0$_writeFoldedValue$1(node) { + var t1, t2, next, t3, + scanner = A.StringScanner$(type$.SassString_2._as(node.value.value)._string0$_text, null, null); + for (t1 = scanner.string.length, t2 = this._serialize0$_buffer; scanner._string_scanner$_position !== t1;) { + next = scanner.readChar$0(); + if (next !== 10) { + t2.writeCharCode$1(next); + continue; + } + t2.writeCharCode$1(32); + while (true) { + t3 = scanner.peekChar$0(); + if (!(t3 === 32 || t3 === 9 || t3 === 10 || t3 === 13 || t3 === 12)) + break; + scanner.readChar$0(); + } + } + }, + _serialize0$_writeReindentedValue$1(node) { + var _0_0, t1, _this = this, + value = type$.SassString_2._as(node.value.value)._string0$_text; + $label0$0: { + _0_0 = _this._serialize0$_minimumIndentation$1(value); + if (_0_0 == null) { + _this._serialize0$_buffer.write$1(0, value); + break $label0$0; + } + if (-1 === _0_0) { + t1 = _this._serialize0$_buffer; + t1.write$1(0, A.trimAsciiRight0(value, true)); + t1.writeCharCode$1(32); + break $label0$0; + } + t1 = node.name.span; + t1 = t1.get$start(t1); + _this._serialize0$_writeWithIndent$2(value, Math.min(_0_0, t1.file.getColumn$1(t1.offset))); + } + }, + _serialize0$_minimumIndentation$1(text) { + var character, t2, min, next, min0, + scanner = A.LineScanner$(text), + t1 = scanner.string.length; + while (true) { + if (scanner._string_scanner$_position !== t1) { + character = scanner.super$StringScanner$readChar(); + scanner._adjustLineAndColumn$1(character); + t2 = character !== 10; + } else + t2 = false; + if (!t2) + break; + } + if (scanner._string_scanner$_position === t1) + return scanner.peekChar$1(-1) === 10 ? -1 : null; + for (min = null; scanner._string_scanner$_position !== t1;) { + for (; scanner._string_scanner$_position !== t1;) { + next = scanner.peekChar$0(); + if (next !== 32 && next !== 9) + break; + scanner._adjustLineAndColumn$1(scanner.super$StringScanner$readChar()); + } + if (scanner._string_scanner$_position === t1 || scanner.scanChar$1(10)) + continue; + min0 = scanner._line_scanner$_column; + min = min == null ? min0 : Math.min(min, min0); + while (true) { + if (scanner._string_scanner$_position !== t1) { + character = scanner.super$StringScanner$readChar(); + scanner._adjustLineAndColumn$1(character); + t2 = character !== 10; + } else + t2 = false; + if (!t2) + break; + } + } + return min == null ? -1 : min; + }, + _serialize0$_writeWithIndent$2(text, minimumIndentation) { + var t1, t2, t3, character, lineStart, newlines, end, + scanner = A.LineScanner$(text); + for (t1 = scanner.string, t2 = t1.length, t3 = this._serialize0$_buffer; scanner._string_scanner$_position !== t2;) { + character = scanner.super$StringScanner$readChar(); + scanner._adjustLineAndColumn$1(character); + if (character === 10) + break; + t3.writeCharCode$1(character); + } + for (; true;) { + lineStart = scanner._string_scanner$_position; + for (newlines = 1; true;) { + if (scanner._string_scanner$_position === t2) { + t3.writeCharCode$1(32); + return; + } + $label0$2: { + character = scanner.super$StringScanner$readChar(); + scanner._adjustLineAndColumn$1(character); + if (32 === character || 9 === character) + continue; + if (10 === character) { + lineStart = scanner._string_scanner$_position; + ++newlines; + break $label0$2; + } + break; + } + } + this._serialize0$_writeTimes$2(10, newlines); + this._serialize0$_writeIndentation$0(); + end = scanner._string_scanner$_position; + t3.write$1(0, B.JSString_methods.substring$2(t1, lineStart + minimumIndentation, end)); + for (; true;) { + if (scanner._string_scanner$_position === t2) + return; + character = scanner.super$StringScanner$readChar(); + scanner._adjustLineAndColumn$1(character); + if (character === 10) + break; + t3.writeCharCode$1(character); + } + } + }, + visitCalculation$1(value) { + var t2, _this = this, + t1 = _this._serialize0$_buffer; + t1.write$1(0, value.name); + t1.writeCharCode$1(40); + t2 = _this._serialize0$_style === B.OutputStyle_10 ? "," : ", "; + _this._serialize0$_writeBetween$3(value.$arguments, t2, _this.get$_serialize0$_writeCalculationValue()); + t1.writeCharCode$1(41); + }, + _serialize0$_writeCalculationValue$1(value) { + var t1, _2_4, t2, _2_4_isSet, _0_0, _1_0, first, rest, operator, left, right, parenthesizeLeft, operatorWhitespace, parenthesizeRight, _this = this, _null = null; + $label1$1: { + t1 = value instanceof A.SassNumber0; + if (t1) { + _2_4 = value.get$hasComplexUnits(); + t2 = _2_4 && !_this._serialize0$_inspect; + _2_4_isSet = true; + } else { + _2_4 = _null; + _2_4_isSet = false; + t2 = false; + } + if (t2) + throw A.wrapException(A.SassScriptException$0(A.S(value) + " isn't a valid CSS value.", _null)); + if (t1 && !isFinite(value._number1$_value)) { + $label0$0: { + _0_0 = value._number1$_value; + if (1 / 0 === _0_0) { + _this._serialize0$_buffer.write$1(0, "infinity"); + break $label0$0; + } + if (-1 / 0 === _0_0) { + _this._serialize0$_buffer.write$1(0, "-infinity"); + break $label0$0; + } + if (isNaN(_0_0)) + _this._serialize0$_buffer.write$1(0, "NaN"); + } + t1 = J.getInterceptor$x(value); + _this._serialize0$_writeCalculationUnits$2(t1.get$numeratorUnits(value), t1.get$denominatorUnits(value)); + break $label1$1; + } + if (t1) + t1 = _2_4_isSet ? _2_4 : value.get$hasComplexUnits(); + else + t1 = false; + if (t1) { + _this._serialize0$_writeNumber$1(value._number1$_value); + t1 = J.getInterceptor$x(value); + _1_0 = t1.get$numeratorUnits(value); + if (_1_0.length >= 1) { + first = _1_0[0]; + rest = B.JSArray_methods.sublist$1(_1_0, 1); + _this._serialize0$_buffer.write$1(0, first); + _this._serialize0$_writeCalculationUnits$2(rest, t1.get$denominatorUnits(value)); + } else + _this._serialize0$_writeCalculationUnits$2(A._setArrayType([], type$.JSArray_String), t1.get$denominatorUnits(value)); + break $label1$1; + } + if (value instanceof A.Value0) { + value.accept$1(_this); + break $label1$1; + } + if (value instanceof A.CalculationOperation0) { + operator = value._calculation0$_operator; + left = value._calculation0$_left; + right = value._calculation0$_right; + right = right; + t1 = true; + } else { + right = _null; + left = right; + operator = left; + t1 = false; + } + if (t1) { + parenthesizeLeft = left instanceof A.CalculationOperation0 && left._calculation0$_operator.precedence < operator.precedence; + if (parenthesizeLeft) + _this._serialize0$_buffer.writeCharCode$1(40); + _this._serialize0$_writeCalculationValue$1(left); + if (parenthesizeLeft) + _this._serialize0$_buffer.writeCharCode$1(41); + operatorWhitespace = _this._serialize0$_style !== B.OutputStyle_10 || operator.precedence === 1; + if (operatorWhitespace) + _this._serialize0$_buffer.writeCharCode$1(32); + t1 = _this._serialize0$_buffer; + t1.write$1(0, operator.operator); + if (operatorWhitespace) + t1.writeCharCode$1(32); + if (!(right instanceof A.CalculationOperation0 && _this._serialize0$_parenthesizeCalculationRhs$2(operator, right._calculation0$_operator))) + if (operator === B.CalculationOperator_OvN0) { + if (right instanceof A.SassNumber0) + t2 = isFinite(right._number1$_value) ? right.get$hasComplexUnits() : right.get$hasUnits(); + else + t2 = false; + parenthesizeRight = t2; + } else + parenthesizeRight = false; + else + parenthesizeRight = true; + if (parenthesizeRight) + t1.writeCharCode$1(40); + _this._serialize0$_writeCalculationValue$1(right); + if (parenthesizeRight) + t1.writeCharCode$1(41); + } + } + }, + _serialize0$_writeCalculationUnits$2(numeratorUnits, denominatorUnits) { + var t1, t2, t3, t4; + for (t1 = J.get$iterator$ax(numeratorUnits), t2 = this._serialize0$_buffer, t3 = this._serialize0$_style !== B.OutputStyle_10; t1.moveNext$0();) { + t4 = t1.get$current(t1); + if (t3) + t2.writeCharCode$1(32); + t2.writeCharCode$1(42); + if (t3) + t2.writeCharCode$1(32); + t2.writeCharCode$1(49); + t2.write$1(0, t4); + } + for (t1 = J.get$iterator$ax(denominatorUnits); t1.moveNext$0();) { + t4 = t1.get$current(t1); + if (t3) + t2.writeCharCode$1(32); + t2.writeCharCode$1(47); + if (t3) + t2.writeCharCode$1(32); + t2.writeCharCode$1(49); + t2.write$1(0, t4); + } + }, + _serialize0$_parenthesizeCalculationRhs$2(outer, right) { + var t1; + $label0$0: { + if (B.CalculationOperator_OvN0 === outer) { + t1 = true; + break $label0$0; + } + if (B.CalculationOperator_IyK0 === outer) { + t1 = false; + break $label0$0; + } + t1 = right === B.CalculationOperator_IyK0 || right === B.CalculationOperator_2bx0; + break $label0$0; + } + return t1; + }, + visitColor$1(value) { + var hexLength, _0_0, t1, $name, _1_0, opaque, t2, _3_0, _this = this; + if (_this._serialize0$_style === B.OutputStyle_10) + if (!A.fuzzyEquals0(value._color1$_alpha, 1)) + _this._serialize0$_writeRgb$1(value); + else { + hexLength = _this._serialize0$_canUseShortHex$1(value) ? 4 : 7; + _0_0 = $.$get$namesByColor0().$index(0, value); + if (_0_0 != null) { + t1 = _0_0.length <= hexLength; + $name = _0_0; + } else { + $name = null; + t1 = false; + } + if (t1) + _this._serialize0$_buffer.write$1(0, $name); + else { + t1 = _this._serialize0$_buffer; + if (_this._serialize0$_canUseShortHex$1(value)) { + t1.writeCharCode$1(35); + t1.writeCharCode$1(A.hexCharFor0(value.get$red(0) & 15)); + t1.writeCharCode$1(A.hexCharFor0(value.get$green(0) & 15)); + t1.writeCharCode$1(A.hexCharFor0(value.get$blue(0) & 15)); + } else { + t1.writeCharCode$1(35); + _this._serialize0$_writeHexComponent$1(value.get$red(0)); + _this._serialize0$_writeHexComponent$1(value.get$green(0)); + _this._serialize0$_writeHexComponent$1(value.get$blue(0)); + } + } + } + else { + _1_0 = value.format; + if (_1_0 != null) + $label0$0: { + if (B._ColorFormatEnum_rgbFunction0 === _1_0) { + _this._serialize0$_writeRgb$1(value); + break $label0$0; + } + if (B._ColorFormatEnum_hslFunction0 === _1_0) { + t1 = value._color1$_alpha; + opaque = A.fuzzyEquals0(t1, 1); + t2 = _this._serialize0$_buffer; + t2.write$1(0, opaque ? "hsl(" : "hsla("); + _this._serialize0$_writeNumber$1(value.get$hue(0)); + t2.write$1(0, ", "); + _this._serialize0$_writeNumber$1(value.get$saturation(0)); + t2.writeCharCode$1(37); + t2.write$1(0, ", "); + _this._serialize0$_writeNumber$1(value.get$lightness(0)); + t2.writeCharCode$1(37); + if (!opaque) { + t2.write$1(0, ", "); + _this._serialize0$_writeNumber$1(t1); + } + t2.writeCharCode$1(41); + break $label0$0; + } + if (_1_0 instanceof A.SpanColorFormat0) { + _this._serialize0$_buffer.write$1(0, _1_0._color1$_span.get$text()); + break $label0$0; + } + } + else { + _3_0 = $.$get$namesByColor0().$index(0, value); + if (_3_0 != null) { + t1 = !A.fuzzyEquals0(value._color1$_alpha, 0); + $name = _3_0; + } else { + $name = null; + t1 = false; + } + if (t1) + _this._serialize0$_buffer.write$1(0, $name); + else if (A.fuzzyEquals0(value._color1$_alpha, 1)) { + _this._serialize0$_buffer.writeCharCode$1(35); + _this._serialize0$_writeHexComponent$1(value.get$red(0)); + _this._serialize0$_writeHexComponent$1(value.get$green(0)); + _this._serialize0$_writeHexComponent$1(value.get$blue(0)); + } else + _this._serialize0$_writeRgb$1(value); + } + } + }, + _serialize0$_writeRgb$1(value) { + var t3, + t1 = value._color1$_alpha, + opaque = A.fuzzyEquals0(t1, 1), + t2 = this._serialize0$_buffer; + t2.write$1(0, opaque ? "rgb(" : "rgba("); + t2.write$1(0, value.get$red(0)); + t3 = this._serialize0$_style === B.OutputStyle_10; + t2.write$1(0, t3 ? "," : ", "); + t2.write$1(0, value.get$green(0)); + t2.write$1(0, t3 ? "," : ", "); + t2.write$1(0, value.get$blue(0)); + if (!opaque) { + t2.write$1(0, t3 ? "," : ", "); + this._serialize0$_writeNumber$1(t1); + } + t2.writeCharCode$1(41); + }, + _serialize0$_canUseShortHex$1(color) { + var t1 = color.get$red(0); + if ((t1 & 15) === B.JSInt_methods._shrOtherPositive$1(t1, 4)) { + t1 = color.get$green(0); + if ((t1 & 15) === B.JSInt_methods._shrOtherPositive$1(t1, 4)) { + t1 = color.get$blue(0); + t1 = (t1 & 15) === B.JSInt_methods._shrOtherPositive$1(t1, 4); + } else + t1 = false; + } else + t1 = false; + return t1; + }, + _serialize0$_writeHexComponent$1(color) { + var t1 = this._serialize0$_buffer; + t1.writeCharCode$1(A.hexCharFor0(B.JSInt_methods._shrOtherPositive$1(color, 4))); + t1.writeCharCode$1(A.hexCharFor0(color & 15)); + }, + visitList$1(value) { + var t2, t3, singleton, t4, t5, _this = this, + t1 = value._list1$_hasBrackets; + if (t1) + _this._serialize0$_buffer.writeCharCode$1(91); + else if (value._list1$_contents.length === 0) { + if (!_this._serialize0$_inspect) + throw A.wrapException(A.SassScriptException$0("() isn't a valid CSS value.", null)); + _this._serialize0$_buffer.write$1(0, "()"); + return; + } + t2 = _this._serialize0$_inspect; + if (t2) + if (value._list1$_contents.length === 1) { + t3 = value._list1$_separator; + t3 = t3 === B.ListSeparator_rXA0 || t3 === B.ListSeparator_zg90; + singleton = t3; + } else + singleton = false; + else + singleton = false; + if (singleton && !t1) + _this._serialize0$_buffer.writeCharCode$1(40); + t3 = value._list1$_contents; + t3 = t2 ? t3 : new A.WhereIterable(t3, new A._SerializeVisitor_visitList_closure2(), A._arrayInstanceType(t3)._eval$1("WhereIterable<1>")); + t4 = value._list1$_separator; + t5 = _this._serialize0$_separatorString$1(t4); + _this._serialize0$_writeBetween$3(t3, t5, t2 ? new A._SerializeVisitor_visitList_closure3(_this, value) : new A._SerializeVisitor_visitList_closure4(_this)); + if (singleton) { + t2 = _this._serialize0$_buffer; + t2.write$1(0, t4.separator); + if (!t1) + t2.writeCharCode$1(41); + } + if (t1) + _this._serialize0$_buffer.writeCharCode$1(93); + }, + _serialize0$_separatorString$1(separator) { + var t1; + $label0$0: { + if (B.ListSeparator_rXA0 === separator) { + t1 = this._serialize0$_style === B.OutputStyle_10 ? "," : ", "; + break $label0$0; + } + if (B.ListSeparator_zg90 === separator) { + t1 = this._serialize0$_style === B.OutputStyle_10 ? "/" : " / "; + break $label0$0; + } + if (B.ListSeparator_EVt0 === separator) { + t1 = " "; + break $label0$0; + } + t1 = ""; + break $label0$0; + } + return t1; + }, + _serialize0$_elementNeedsParens$2(separator, value) { + var t1; + $label1$1: { + if (value instanceof A.SassList0 && value._list1$_contents.length > 1 && !value._list1$_hasBrackets) { + $label0$0: { + if (B.ListSeparator_rXA0 === separator) { + t1 = value._list1$_separator === B.ListSeparator_rXA0; + break $label0$0; + } + if (B.ListSeparator_zg90 === separator) { + t1 = value._list1$_separator; + t1 = t1 === B.ListSeparator_rXA0 || t1 === B.ListSeparator_zg90; + break $label0$0; + } + t1 = value._list1$_separator !== B.ListSeparator_undecided_null_undecided0; + break $label0$0; + } + break $label1$1; + } + t1 = false; + break $label1$1; + } + return t1; + }, + visitMap$1(map) { + var t1, t2, _this = this; + if (!_this._serialize0$_inspect) + throw A.wrapException(A.SassScriptException$0(map.toString$0(0) + " isn't a valid CSS value.", null)); + t1 = _this._serialize0$_buffer; + t1.writeCharCode$1(40); + t2 = map._map0$_contents; + _this._serialize0$_writeBetween$3(t2.get$entries(t2), ", ", new A._SerializeVisitor_visitMap_closure0(_this)); + t1.writeCharCode$1(41); + }, + _serialize0$_writeMapElement$1(value) { + var needsParens = value instanceof A.SassList0 && value._list1$_separator === B.ListSeparator_rXA0 && !value._list1$_hasBrackets; + if (needsParens) + this._serialize0$_buffer.writeCharCode$1(40); + value.accept$1(this); + if (needsParens) + this._serialize0$_buffer.writeCharCode$1(41); + }, + visitNumber$1(value) { + var before, after, t1, _1_0, _this = this, + _0_0 = value.asSlash; + if (type$.Record_2_nullable_Object_and_nullable_Object._is(_0_0)) { + before = _0_0._0; + after = _0_0._1; + _this.visitNumber$1(before); + _this._serialize0$_buffer.writeCharCode$1(47); + _this.visitNumber$1(after); + return; + } + t1 = value._number1$_value; + if (!isFinite(t1)) { + _this.visitCalculation$1(new A.SassCalculation0("calc", A.List_List$unmodifiable(A._setArrayType([value], type$.JSArray_Object), type$.Object))); + return; + } + if (value.get$hasComplexUnits()) { + if (!_this._serialize0$_inspect) + throw A.wrapException(A.SassScriptException$0(value.toString$0(0) + " isn't a valid CSS value.", null)); + _this.visitCalculation$1(new A.SassCalculation0("calc", A.List_List$unmodifiable(A._setArrayType([value], type$.JSArray_Object), type$.Object))); + } else { + _this._serialize0$_writeNumber$1(t1); + _1_0 = value.get$numeratorUnits(value); + if (_1_0.length === 1) + _this._serialize0$_buffer.write$1(0, _1_0[0]); + } + }, + _serialize0$_writeNumber$1(number) { + var text, _this = this, + _0_0 = A.fuzzyAsInt0(number); + if (_0_0 != null) { + _this._serialize0$_buffer.write$1(0, _this._serialize0$_removeExponent$1(B.JSInt_methods.toString$0(_0_0))); + return; + } + text = _this._serialize0$_removeExponent$1(B.JSNumber_methods.toString$0(number)); + if (text.length < 12) { + if (_this._serialize0$_style === B.OutputStyle_10 && text.charCodeAt(0) === 48) + text = B.JSString_methods.substring$1(text, 1); + _this._serialize0$_buffer.write$1(0, text); + return; + } + _this._serialize0$_writeRounded$1(text); + }, + _serialize0$_removeExponent$1(text) { + var buffer, t2, t3, additionalZeroes, + negative = text.charCodeAt(0) === 45, + exponent = A._Cell$(), + t1 = text.length, + i = 0; + while (true) { + if (!(i < t1)) { + buffer = null; + break; + } + c$0: { + if (text.charCodeAt(i) !== 101) + break c$0; + buffer = new A.StringBuffer(""); + t2 = buffer._contents = "" + A.Primitives_stringFromCharCode(text.charCodeAt(0)); + if (negative) { + t2 += A.Primitives_stringFromCharCode(text.charCodeAt(1)); + buffer._contents = t2; + if (i > 3) + buffer._contents = t2 + B.JSString_methods.substring$2(text, 3, i); + } else if (i > 2) + buffer._contents = t2 + B.JSString_methods.substring$2(text, 2, i); + exponent._value = A.int_parse(B.JSString_methods.substring$2(text, i + 1, t1), null); + break; + } + ++i; + } + if (buffer == null) + return text; + if (exponent._readLocal$0() > 0) { + t1 = exponent._readLocal$0(); + t2 = buffer._contents; + t3 = negative ? 1 : 0; + additionalZeroes = t1 - (t2.length - 1 - t3); + for (t1 = t2, i = 0; i < additionalZeroes; ++i) + t1 = buffer._contents += A.Primitives_stringFromCharCode(48); + return t1.charCodeAt(0) == 0 ? t1 : t1; + } else { + negative = text.charCodeAt(0) === 45; + t1 = (negative ? "" + A.Primitives_stringFromCharCode(45) : "") + "0."; + t2 = exponent.__late_helper$_name; + i = -1; + while (true) { + t3 = exponent._value; + if (t3 === exponent) + A.throwExpression(A.LateError$localNI(t2)); + if (!(i > t3)) + break; + t1 += A.Primitives_stringFromCharCode(48); + --i; + } + if (negative) { + t2 = buffer._contents; + t2 = B.JSString_methods.substring$1(t2.charCodeAt(0) == 0 ? t2 : t2, 1); + } else + t2 = buffer; + t2 = t1 + A.S(t2); + return t2.charCodeAt(0) == 0 ? t2 : t2; + } + }, + _serialize0$_writeRounded$1(text) { + var t1, digits, negative, textIndex, digitsIndex, textIndex0, codeUnit, digitsIndex0, indexAfterPrecision, digitsIndex1, newDigit, writtenIndex, t2, _this = this; + if (B.JSString_methods.endsWith$1(text, ".0")) { + _this._serialize0$_buffer.write$1(0, B.JSString_methods.substring$2(text, 0, text.length - 2)); + return; + } + t1 = text.length; + digits = new Uint8Array(t1 + 1); + negative = text.charCodeAt(0) === 45; + textIndex = negative ? 1 : 0; + for (digitsIndex = 1; true; textIndex = textIndex0, digitsIndex = digitsIndex0) { + if (textIndex === t1) { + _this._serialize0$_buffer.write$1(0, text); + return; + } + textIndex0 = textIndex + 1; + codeUnit = text.charCodeAt(textIndex); + if (codeUnit === 46) { + textIndex = textIndex0; + break; + } + digitsIndex0 = digitsIndex + 1; + digits[digitsIndex] = codeUnit - 48; + } + indexAfterPrecision = textIndex + 10; + if (indexAfterPrecision >= t1) { + _this._serialize0$_buffer.write$1(0, text); + return; + } + for (digitsIndex0 = digitsIndex; textIndex < indexAfterPrecision; textIndex = textIndex0, digitsIndex0 = digitsIndex1) { + digitsIndex1 = digitsIndex0 + 1; + textIndex0 = textIndex + 1; + digits[digitsIndex0] = text.charCodeAt(textIndex) - 48; + } + if (text.charCodeAt(textIndex) - 48 >= 5) + for (; true; digitsIndex0 = digitsIndex1) { + digitsIndex1 = digitsIndex0 - 1; + newDigit = digits[digitsIndex1] + 1; + digits[digitsIndex1] = newDigit; + if (newDigit !== 10) + break; + } + for (; digitsIndex0 < digitsIndex; ++digitsIndex0) + digits[digitsIndex0] = 0; + while (true) { + t1 = digitsIndex0 > digitsIndex; + if (!(t1 && digits[digitsIndex0 - 1] === 0)) + break; + --digitsIndex0; + } + if (digitsIndex0 === 2 && digits[0] === 0 && digits[1] === 0) { + _this._serialize0$_buffer.writeCharCode$1(48); + return; + } + if (negative) + _this._serialize0$_buffer.writeCharCode$1(45); + if (digits[0] === 0) + writtenIndex = _this._serialize0$_style === B.OutputStyle_10 && digits[1] === 0 ? 2 : 1; + else + writtenIndex = 0; + for (t2 = _this._serialize0$_buffer; writtenIndex < digitsIndex; ++writtenIndex) + t2.writeCharCode$1(48 + digits[writtenIndex]); + if (t1) { + t2.writeCharCode$1(46); + for (; writtenIndex < digitsIndex0; ++writtenIndex) + t2.writeCharCode$1(48 + digits[writtenIndex]); + } + }, + _serialize0$_visitQuotedString$2$forceDoubleQuote(string, forceDoubleQuote) { + var t1, includesSingleQuote, includesDoubleQuote, i, char, _1_2, _1_4, _0_0, quote, _this = this, + buffer = forceDoubleQuote ? _this._serialize0$_buffer : new A.StringBuffer(""); + if (forceDoubleQuote) + buffer.writeCharCode$1(34); + for (t1 = string.length, includesSingleQuote = false, includesDoubleQuote = false, i = 0; i < t1; ++i) { + char = string.charCodeAt(i); + _1_2 = 39 === char; + if (_1_2 && forceDoubleQuote) { + buffer.writeCharCode$1(39); + continue; + } + if (_1_2 && includesDoubleQuote) { + _this._serialize0$_visitQuotedString$2$forceDoubleQuote(string, true); + return; + } + if (_1_2) { + buffer.writeCharCode$1(39); + includesSingleQuote = true; + continue; + } + _1_4 = 34 === char; + if (_1_4 && forceDoubleQuote) { + buffer.writeCharCode$1(92); + buffer.writeCharCode$1(34); + continue; + } + if (_1_4 && includesSingleQuote) { + _this._serialize0$_visitQuotedString$2$forceDoubleQuote(string, true); + return; + } + if (_1_4) { + buffer.writeCharCode$1(34); + includesDoubleQuote = true; + continue; + } + if (0 === char || 1 === char || 2 === char || 3 === char || 4 === char || 5 === char || 6 === char || 7 === char || 8 === char || 10 === char || 11 === char || 12 === char || 13 === char || 14 === char || 15 === char || 16 === char || 17 === char || 18 === char || 19 === char || 20 === char || 21 === char || 22 === char || 23 === char || 24 === char || 25 === char || 26 === char || 27 === char || 28 === char || 29 === char || 30 === char || 31 === char || 127 === char) { + _this._serialize0$_writeEscape$4(buffer, char, string, i); + continue; + } + if (92 === char) { + buffer.writeCharCode$1(92); + buffer.writeCharCode$1(92); + continue; + } + _0_0 = _this._serialize0$_tryPrivateUseCharacter$4(buffer, char, string, i); + if (_0_0 != null) + i = _0_0; + else + buffer.writeCharCode$1(char); + } + if (forceDoubleQuote) + buffer.writeCharCode$1(34); + else { + quote = includesDoubleQuote ? 39 : 34; + t1 = _this._serialize0$_buffer; + t1.writeCharCode$1(quote); + t1.write$1(0, buffer); + t1.writeCharCode$1(quote); + } + }, + _serialize0$_visitQuotedString$1(string) { + return this._serialize0$_visitQuotedString$2$forceDoubleQuote(string, false); + }, + _serialize0$_visitUnquotedString$1(string) { + var t1, t2, afterNewline, i, _1_0, _0_0; + for (t1 = string.length, t2 = this._serialize0$_buffer, afterNewline = false, i = 0; i < t1; ++i) { + _1_0 = string.charCodeAt(i); + if (10 === _1_0) { + t2.writeCharCode$1(32); + afterNewline = true; + continue; + } + if (32 === _1_0) { + if (!afterNewline) + t2.writeCharCode$1(32); + continue; + } + _0_0 = this._serialize0$_tryPrivateUseCharacter$4(t2, _1_0, string, i); + if (_0_0 != null) + i = _0_0; + else + t2.writeCharCode$1(_1_0); + afterNewline = false; + } + }, + _serialize0$_tryPrivateUseCharacter$4(buffer, codeUnit, string, i) { + var t1; + if (this._serialize0$_style === B.OutputStyle_10) + return null; + if (codeUnit >= 57344 && codeUnit <= 63743) { + this._serialize0$_writeEscape$4(buffer, codeUnit, string, i); + return i; + } + if (codeUnit >>> 7 === 439 && string.length > i + 1) { + t1 = i + 1; + this._serialize0$_writeEscape$4(buffer, 65536 + ((codeUnit & 1023) << 10) + (string.charCodeAt(t1) & 1023), string, t1); + return t1; + } + return null; + }, + _serialize0$_writeEscape$4(buffer, character, string, i) { + var t1, next; + buffer.writeCharCode$1(92); + buffer.write$1(0, B.JSInt_methods.toRadixString$1(character, 16)); + t1 = i + 1; + if (string.length === t1) + return; + next = string.charCodeAt(t1); + if (A.CharacterExtension_get_isHex0(next) || 32 === next || 9 === next) + buffer.writeCharCode$1(32); + }, + visitAttributeSelector$1(attribute) { + var _0_0, t2, + t1 = this._serialize0$_buffer; + t1.writeCharCode$1(91); + t1.write$1(0, attribute.name); + _0_0 = attribute.value; + if (_0_0 != null) { + t1.write$1(0, attribute.op); + if (A.Parser_isIdentifier0(_0_0) && !B.JSString_methods.startsWith$1(_0_0, "--")) { + t1.write$1(0, _0_0); + t2 = attribute.modifier; + if (t2 != null) + t1.writeCharCode$1(32); + } else { + this._serialize0$_visitQuotedString$1(_0_0); + t2 = attribute.modifier; + if (t2 != null) + if (this._serialize0$_style !== B.OutputStyle_10) + t1.writeCharCode$1(32); + } + A.NullableExtension_andThen0(t2, t1.get$write(t1)); + } + t1.writeCharCode$1(93); + }, + visitClassSelector$1(klass) { + var t1 = this._serialize0$_buffer; + t1.writeCharCode$1(46); + t1.write$1(0, klass.name); + }, + visitComplexSelector$1(complex) { + var t2, t3, t4, t5, t6, i, component, t7, t8, t9, _this = this, + t1 = complex.leadingCombinators; + _this._serialize0$_writeCombinators$1(t1); + if (t1.length >= 1 && complex.components.length >= 1) + if (_this._serialize0$_style !== B.OutputStyle_10) + _this._serialize0$_buffer.writeCharCode$1(32); + for (t1 = complex.components, t2 = t1.length, t3 = t2 - 1, t4 = _this._serialize0$_buffer, t5 = _this._serialize0$_style === B.OutputStyle_10, t6 = !t5, i = 0; i < t2; ++i) { + component = t1[i]; + _this.visitCompoundSelector$1(component.selector); + t7 = component.combinators; + t8 = t7.length === 0; + if (!t8) + if (t6) + t4.writeCharCode$1(32); + t9 = t5 ? "" : " "; + _this._serialize0$_writeBetween$3(t7, t9, t4.get$write(t4)); + if (i !== t3) + t7 = !t5 || t8; + else + t7 = false; + if (t7) + t4.writeCharCode$1(32); + } + }, + _serialize0$_writeCombinators$1(combinators) { + var t1 = this._serialize0$_style === B.OutputStyle_10 ? "" : " ", + t2 = this._serialize0$_buffer; + return this._serialize0$_writeBetween$3(combinators, t1, t2.get$write(t2)); + }, + visitCompoundSelector$1(compound) { + var t2, t3, _i, + t1 = this._serialize0$_buffer, + start = t1.get$length(t1); + for (t2 = compound.components, t3 = t2.length, _i = 0; _i < t3; ++_i) + t2[_i].accept$1(this); + if (t1.get$length(t1) === start) + t1.writeCharCode$1(42); + }, + visitIDSelector$1(id) { + var t1 = this._serialize0$_buffer; + t1.writeCharCode$1(35); + t1.write$1(0, id.name); + }, + visitSelectorList$1(list) { + var t1, t2, t3, t4, first, t5, _this = this, + complexes = list.components; + for (t1 = J.get$iterator$ax(_this._serialize0$_inspect ? complexes : new A.WhereIterable(complexes, new A._SerializeVisitor_visitSelectorList_closure0(), A._arrayInstanceType(complexes)._eval$1("WhereIterable<1>"))), t2 = _this._serialize0$_style !== B.OutputStyle_10, t3 = _this._serialize0$_buffer, t4 = _this._lineFeed.text, first = true; t1.moveNext$0();) { + t5 = t1.get$current(t1); + if (first) + first = false; + else { + t3.writeCharCode$1(44); + if (t5.lineBreak) { + if (t2) + t3.write$1(0, t4); + _this._serialize0$_writeIndentation$0(); + } else if (t2) + t3.writeCharCode$1(32); + } + _this.visitComplexSelector$1(t5); + } + }, + visitParentSelector$1($parent) { + var t1 = this._serialize0$_buffer; + t1.writeCharCode$1(38); + A.NullableExtension_andThen0($parent.suffix, t1.get$write(t1)); + }, + visitPlaceholderSelector$1(placeholder) { + var t1 = this._serialize0$_buffer; + t1.writeCharCode$1(37); + t1.write$1(0, placeholder.name); + }, + visitPseudoSelector$1(pseudo) { + var _0_4, t2, t3, + t1 = pseudo.name; + if ("not" === t1) { + _0_4 = pseudo.selector; + if (_0_4 instanceof A.SelectorList0) + t2 = (_0_4 == null ? type$.SelectorList_2._as(_0_4) : _0_4).accept$1(B._IsInvisibleVisitor_true0); + else + t2 = false; + } else + t2 = false; + if (t2) + return; + t2 = this._serialize0$_buffer; + t2.writeCharCode$1(58); + if (!pseudo.isSyntacticClass) + t2.writeCharCode$1(58); + t2.write$1(0, t1); + t1 = pseudo.argument; + t3 = t1 == null; + if (t3 && pseudo.selector == null) + return; + t2.writeCharCode$1(40); + if (!t3) { + t2.write$1(0, t1); + if (pseudo.selector != null) + t2.writeCharCode$1(32); + } + A.NullableExtension_andThen0(pseudo.selector, this.get$visitSelectorList()); + t2.writeCharCode$1(41); + }, + visitTypeSelector$1(type) { + this._serialize0$_buffer.write$1(0, type.name); + }, + visitUniversalSelector$1(universal) { + var t2, + t1 = universal.namespace; + if (t1 != null) { + t2 = this._serialize0$_buffer; + t2.write$1(0, t1); + t2.writeCharCode$1(124); + } + this._serialize0$_buffer.writeCharCode$1(42); + }, + _serialize0$_write$1(value) { + return this._serialize0$_buffer.forSpan$2(value.span, new A._SerializeVisitor__write_closure0(this, value)); + }, + _serialize0$_visitChildren$1($parent) { + var t2, t3, t4, t5, t6, t7, t8, prePrevious, previous, t9, previous0, t10, savedIndentation, _this = this, + t1 = _this._serialize0$_buffer; + t1.writeCharCode$1(123); + for (t2 = $parent.children, t3 = t2.$ti, t2 = new A.ListIterator(t2, t2.get$length(0), t3._eval$1("ListIterator")), t4 = _this._serialize0$_style === B.OutputStyle_10, t5 = !t4, t6 = _this.get$_serialize0$_requiresSemicolon(), t7 = !_this._serialize0$_inspect, t3 = t3._eval$1("ListBase.E"), t8 = _this._lineFeed.text, prePrevious = null, previous = null; t2.moveNext$0();) { + t9 = t2.__internal$_current; + previous0 = t9 == null ? t3._as(t9) : t9; + if (t7) + t9 = t4 ? previous0.accept$1(B._IsInvisibleVisitor_true_true0) : previous0.accept$1(B._IsInvisibleVisitor_true_false0); + else + t9 = false; + if (t9) + continue; + t9 = previous == null; + t10 = t9 ? null : t6.call$1(previous); + if (t10 == null ? false : t10) + t1.writeCharCode$1(59); + if (_this._serialize0$_isTrailingComment$2(previous0, t9 ? $parent : previous)) { + if (t5) + t1.writeCharCode$1(32); + savedIndentation = _this._serialize0$_indentation; + _this._serialize0$_indentation = 0; + new A._SerializeVisitor__visitChildren_closure1(_this, previous0).call$0(); + _this._serialize0$_indentation = savedIndentation; + } else { + if (t5) + t1.write$1(0, t8); + ++_this._serialize0$_indentation; + new A._SerializeVisitor__visitChildren_closure2(_this, previous0).call$0(); + --_this._serialize0$_indentation; + } + prePrevious = previous; + previous = previous0; + } + if (previous != null) { + if ((type$.CssParentNode_2._is(previous) ? previous.get$isChildless() : !(previous instanceof A.ModifiableCssComment0)) && t5) + t1.writeCharCode$1(59); + if (prePrevious == null && _this._serialize0$_isTrailingComment$2(previous, $parent)) { + if (t5) + t1.writeCharCode$1(32); + } else { + _this._serialize0$_writeLineFeed$0(); + _this._serialize0$_writeIndentation$0(); + } + } + t1.writeCharCode$1(125); + }, + _serialize0$_requiresSemicolon$1(node) { + return type$.CssParentNode_2._is(node) ? node.get$isChildless() : !(node instanceof A.ModifiableCssComment0); + }, + _serialize0$_isTrailingComment$2(node, previous) { + var t1, t2, t3, searchFrom, endOffset, t4, span; + if (this._serialize0$_style === B.OutputStyle_10) + return false; + if (!(node instanceof A.ModifiableCssComment0)) + return false; + t1 = node.span; + t2 = t1.get$sourceUrl(t1); + t3 = previous.get$span(previous); + if (!J.$eq$(t2, t3.get$sourceUrl(t3))) + return false; + t2 = previous.get$span(previous); + if (!(J.$eq$(t2.get$file(t2).url, t1.get$file(t1).url) && t2.get$start(t2).offset <= t1.get$start(t1).offset && t2.get$end(t2).offset >= t1.get$end(t1).offset)) { + t1 = t1.get$start(t1); + t1 = t1.file.getLine$1(t1.offset); + t2 = previous.get$span(previous); + t2 = t2.get$end(t2); + return t1 === t2.file.getLine$1(t2.offset); + } + t2 = t1.get$start(t1); + t3 = previous.get$span(previous); + searchFrom = t2.offset - t3.get$start(t3).offset - 1; + if (searchFrom < 0) + return false; + endOffset = Math.max(0, B.JSString_methods.lastIndexOf$2(previous.get$span(previous).get$text(), "{", searchFrom)); + t2 = previous.get$span(previous); + t2 = t2.get$file(t2); + t3 = previous.get$span(previous); + t3 = t3.get$start(t3); + t4 = previous.get$span(previous); + span = t2.span$2(0, t3.offset, t4.get$start(t4).offset + endOffset); + t1 = t1.get$start(t1); + t1 = t1.file.getLine$1(t1.offset); + t4 = A.FileLocation$_(span.file, span._end); + return t1 === t4.file.getLine$1(t4.offset); + }, + _serialize0$_writeLineFeed$0() { + if (this._serialize0$_style !== B.OutputStyle_10) + this._serialize0$_buffer.write$1(0, this._lineFeed.text); + }, + _serialize0$_writeIndentation$0() { + var _this = this; + if (_this._serialize0$_style === B.OutputStyle_10) + return; + _this._serialize0$_writeTimes$2(_this._serialize0$_indentCharacter, _this._serialize0$_indentation * _this._serialize0$_indentWidth); + }, + _serialize0$_writeTimes$2(char, times) { + var t1, i; + for (t1 = this._serialize0$_buffer, i = 0; i < times; ++i) + t1.writeCharCode$1(char); + }, + _serialize0$_writeBetween$1$3(iterable, text, callback) { + var t1, t2, first, value; + for (t1 = J.get$iterator$ax(iterable), t2 = this._serialize0$_buffer, first = true; t1.moveNext$0();) { + value = t1.get$current(t1); + if (first) + first = false; + else + t2.write$1(0, text); + callback.call$1(value); + } + }, + _serialize0$_writeBetween$3(iterable, text, callback) { + return this._serialize0$_writeBetween$1$3(iterable, text, callback, type$.dynamic); + } + }; + A._SerializeVisitor_visitCssComment_closure0.prototype = { + call$0() { + var t2, t3, _0_0, minimumIndentation, + t1 = this.$this; + if (t1._serialize0$_style === B.OutputStyle_10 && this.node.text.charCodeAt(2) !== 33) + return; + t2 = this.node; + t3 = t2.text; + if (B.JSString_methods.startsWith$1(t3, A.RegExp_RegExp("/\\*# source(Mapping)?URL=", false))) + return; + _0_0 = t1._serialize0$_minimumIndentation$1(t3); + if (_0_0 != null) { + t2 = t2.span; + t2 = t2.get$start(t2); + minimumIndentation = Math.min(_0_0, t2.file.getColumn$1(t2.offset)); + t1._serialize0$_writeIndentation$0(); + t1._serialize0$_writeWithIndent$2(t3, minimumIndentation); + } else { + t1._serialize0$_writeIndentation$0(); + t1._serialize0$_buffer.write$1(0, t3); + } + }, + $signature: 1 + }; + A._SerializeVisitor_visitCssAtRule_closure0.prototype = { + call$0() { + var t3, _0_0, + t1 = this.$this, + t2 = t1._serialize0$_buffer; + t2.writeCharCode$1(64); + t3 = this.node; + t1._serialize0$_write$1(t3.name); + _0_0 = t3.value; + if (_0_0 != null) { + t2.writeCharCode$1(32); + t1._serialize0$_write$1(_0_0); + } + }, + $signature: 1 + }; + A._SerializeVisitor_visitCssMediaRule_closure0.prototype = { + call$0() { + var t3, firstQuery, t4, t5, + t1 = this.$this, + t2 = t1._serialize0$_buffer; + t2.write$1(0, "@media"); + t3 = this.node.queries; + firstQuery = B.JSArray_methods.get$first(t3); + t4 = t1._serialize0$_style === B.OutputStyle_10; + if (t4) + if (firstQuery.modifier == null) + if (firstQuery.type == null) { + t5 = firstQuery.conditions; + t5 = t5.length === 1 && J.startsWith$1$s(B.JSArray_methods.get$first(t5), "(not "); + } else + t5 = true; + else + t5 = true; + else + t5 = true; + if (t5) + t2.writeCharCode$1(32); + t2 = t4 ? "," : ", "; + t1._serialize0$_writeBetween$3(t3, t2, t1.get$_serialize0$_visitMediaQuery()); + }, + $signature: 1 + }; + A._SerializeVisitor_visitCssImport_closure0.prototype = { + call$0() { + var t3, t4, _0_0, + t1 = this.$this, + t2 = t1._serialize0$_buffer; + t2.write$1(0, "@import"); + t3 = t1._serialize0$_style !== B.OutputStyle_10; + if (t3) + t2.writeCharCode$1(32); + t4 = this.node; + t2.forSpan$2(t4.url.span, new A._SerializeVisitor_visitCssImport__closure0(t1, t4)); + _0_0 = t4.modifiers; + if (_0_0 != null) { + if (t3) + t2.writeCharCode$1(32); + t2.write$1(0, _0_0); + } + }, + $signature: 1 + }; + A._SerializeVisitor_visitCssImport__closure0.prototype = { + call$0() { + return this.$this._serialize0$_writeImportUrl$1(this.node.url.value); + }, + $signature: 0 + }; + A._SerializeVisitor_visitCssKeyframeBlock_closure0.prototype = { + call$0() { + var t1 = this.$this, + t2 = t1._serialize0$_style === B.OutputStyle_10 ? "," : ", ", + t3 = t1._serialize0$_buffer; + return t1._serialize0$_writeBetween$3(this.node.selector.value, t2, t3.get$write(t3)); + }, + $signature: 0 + }; + A._SerializeVisitor_visitCssStyleRule_closure0.prototype = { + call$0() { + return this.$this.visitSelectorList$1(this.node._style_rule0$_selector._box0$_inner.value); + }, + $signature: 0 + }; + A._SerializeVisitor_visitCssSupportsRule_closure0.prototype = { + call$0() { + var t1 = this.$this, + t2 = t1._serialize0$_buffer; + t2.write$1(0, "@supports"); + if (!(t1._serialize0$_style === B.OutputStyle_10 && J.codeUnitAt$1$s(this.node.condition.value, 0) === 40)) + t2.writeCharCode$1(32); + t1._serialize0$_write$1(this.node.condition); + }, + $signature: 1 + }; + A._SerializeVisitor_visitCssDeclaration_closure1.prototype = { + call$0() { + var t1 = this.$this, + t2 = this.node; + if (t1._serialize0$_style === B.OutputStyle_10) + t1._serialize0$_writeFoldedValue$1(t2); + else + t1._serialize0$_writeReindentedValue$1(t2); + }, + $signature: 1 + }; + A._SerializeVisitor_visitCssDeclaration_closure2.prototype = { + call$0() { + return this.node.value.value.accept$1(this.$this); + }, + $signature: 0 + }; + A._SerializeVisitor_visitList_closure2.prototype = { + call$1(element) { + return !element.get$isBlank(); + }, + $signature: 49 + }; + A._SerializeVisitor_visitList_closure3.prototype = { + call$1(element) { + var t1 = this.$this, + needsParens = t1._serialize0$_elementNeedsParens$2(this.value._list1$_separator, element); + if (needsParens) + t1._serialize0$_buffer.writeCharCode$1(40); + element.accept$1(t1); + if (needsParens) + t1._serialize0$_buffer.writeCharCode$1(41); + }, + $signature: 65 + }; + A._SerializeVisitor_visitList_closure4.prototype = { + call$1(element) { + element.accept$1(this.$this); + }, + $signature: 65 + }; + A._SerializeVisitor_visitMap_closure0.prototype = { + call$1(entry) { + var t1 = this.$this; + t1._serialize0$_writeMapElement$1(entry.key); + t1._serialize0$_buffer.write$1(0, ": "); + t1._serialize0$_writeMapElement$1(entry.value); + }, + $signature: 530 + }; + A._SerializeVisitor_visitSelectorList_closure0.prototype = { + call$1(complex) { + return !complex.accept$1(B._IsInvisibleVisitor_true0); + }, + $signature: 16 + }; + A._SerializeVisitor__write_closure0.prototype = { + call$0() { + return this.$this._serialize0$_buffer.write$1(0, this.value.value); + }, + $signature: 0 + }; + A._SerializeVisitor__visitChildren_closure1.prototype = { + call$0() { + return this.child.accept$1(this.$this); + }, + $signature: 0 + }; + A._SerializeVisitor__visitChildren_closure2.prototype = { + call$0() { + this.child.accept$1(this.$this); + }, + $signature: 0 + }; + A.OutputStyle0.prototype = { + _enumToString$0() { + return "OutputStyle." + this._name; + } + }; + A.LineFeed0.prototype = { + _enumToString$0() { + return "LineFeed." + this._name; + }, + toString$0(_) { + return this.name; + } + }; + A.ShadowedModuleView0.prototype = { + get$url(_) { + var t1 = this._shadowed_view0$_inner; + return t1.get$url(t1); + }, + get$upstream() { + return this._shadowed_view0$_inner.get$upstream(); + }, + get$extensionStore() { + return this._shadowed_view0$_inner.get$extensionStore(); + }, + get$css(_) { + var t1 = this._shadowed_view0$_inner; + return t1.get$css(t1); + }, + get$preModuleComments() { + return this._shadowed_view0$_inner.get$preModuleComments(); + }, + get$transitivelyContainsCss() { + return this._shadowed_view0$_inner.get$transitivelyContainsCss(); + }, + get$transitivelyContainsExtensions() { + return this._shadowed_view0$_inner.get$transitivelyContainsExtensions(); + }, + setVariable$3($name, value, nodeWithSpan) { + if (!this.variables.containsKey$1($name)) + throw A.wrapException(A.SassScriptException$0("Undefined variable.", null)); + else + this._shadowed_view0$_inner.setVariable$3($name, value, nodeWithSpan); + }, + variableIdentity$1($name) { + return this._shadowed_view0$_inner.variableIdentity$1($name); + }, + $eq(_, other) { + var t1, t2, _this = this; + if (other == null) + return false; + if (other instanceof A.ShadowedModuleView0) + if (_this._shadowed_view0$_inner.$eq(0, other._shadowed_view0$_inner)) { + t1 = _this.variables; + t1 = t1.get$keys(t1); + t2 = other.variables; + if (B.C_IterableEquality.equals$2(0, t1, t2.get$keys(t2))) { + t1 = _this.functions; + t1 = t1.get$keys(t1); + t2 = other.functions; + if (B.C_IterableEquality.equals$2(0, t1, t2.get$keys(t2))) { + t1 = _this.mixins; + t1 = t1.get$keys(t1); + t2 = other.mixins; + t2 = B.C_IterableEquality.equals$2(0, t1, t2.get$keys(t2)); + t1 = t2; + } else + t1 = false; + } else + t1 = false; + } else + t1 = false; + else + t1 = false; + return t1; + }, + get$hashCode(_) { + var t1 = this._shadowed_view0$_inner; + return t1.get$hashCode(t1); + }, + cloneCss$0() { + var _this = this; + return new A.ShadowedModuleView0(_this._shadowed_view0$_inner.cloneCss$0(), _this.variables, _this.variableNodes, _this.functions, _this.mixins, _this.$ti); + }, + toString$0(_) { + return "shadowed " + this._shadowed_view0$_inner.toString$0(0); + }, + $isModule1: 1, + get$variables() { + return this.variables; + }, + get$variableNodes() { + return this.variableNodes; + }, + get$functions(receiver) { + return this.functions; + }, + get$mixins() { + return this.mixins; + } + }; + A.SilentComment0.prototype = { + accept$1$1(visitor) { + return visitor.visitSilentComment$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + toString$0(_) { + return this.text; + }, + $isAstNode0: 1, + $isStatement0: 1, + get$span(receiver) { + return this.span; + } + }; + A.SimpleSelector0.prototype = { + get$specificity() { + return 1000; + }, + addSuffix$1(suffix) { + return A.throwExpression(A.MultiSpanSassException$0('Selector "' + this.toString$0(0) + "\" can't have a suffix", this.span, "outer selector", A.LinkedHashMap_LinkedHashMap$_empty(type$.FileSpan, type$.String), null)); + }, + unify$1(compound) { + var other, t1, result, addedThis, _i, simple, _this = this; + if (compound.length === 1) { + other = compound[0]; + if (!(other instanceof A.UniversalSelector0)) + if (other instanceof A.PseudoSelector0) + t1 = other.isClass && other.name === "host" || other.get$isHostContext(); + else + t1 = false; + else + t1 = true; + } else { + other = null; + t1 = false; + } + if (t1) + return other.unify$1(A._setArrayType([_this], type$.JSArray_SimpleSelector_2)); + if (B.JSArray_methods.contains$1(compound, _this)) + return compound; + result = A._setArrayType([], type$.JSArray_SimpleSelector_2); + for (t1 = compound.length, addedThis = false, _i = 0; _i < compound.length; compound.length === t1 || (0, A.throwConcurrentModificationError)(compound), ++_i) { + simple = compound[_i]; + if (!addedThis && simple instanceof A.PseudoSelector0) { + result.push(_this); + addedThis = true; + } + result.push(simple); + } + if (!addedThis) + result.push(_this); + return result; + }, + isSuperselector$1(other) { + var list; + if (this.$eq(0, other)) + return true; + if (other instanceof A.PseudoSelector0 && other.isClass) { + list = other.selector; + if (list != null && $._subselectorPseudos0.contains$1(0, other.normalizedName)) + return B.JSArray_methods.every$1(list.components, new A.SimpleSelector_isSuperselector_closure0(this)); + } + return false; + } + }; + A.SimpleSelector_isSuperselector_closure0.prototype = { + call$1(complex) { + var t1 = complex.components; + return t1.length !== 0 && B.JSArray_methods.any$1(B.JSArray_methods.get$last(t1).selector.components, new A.SimpleSelector_isSuperselector__closure0(this.$this)); + }, + $signature: 16 + }; + A.SimpleSelector_isSuperselector__closure0.prototype = { + call$1(simple) { + return this.$this.isSuperselector$1(simple); + }, + $signature: 14 + }; + A.SingleUnitSassNumber0.prototype = { + get$numeratorUnits(_) { + return A.List_List$unmodifiable([this._single_unit$_unit], type$.String); + }, + get$denominatorUnits(_) { + return B.List_empty; + }, + get$hasUnits() { + return true; + }, + get$hasComplexUnits() { + return false; + }, + withValue$1(value) { + return new A.SingleUnitSassNumber0(this._single_unit$_unit, value, null); + }, + withSlash$2(numerator, denominator) { + return new A.SingleUnitSassNumber0(this._single_unit$_unit, this._number1$_value, new A._Record_2(numerator, denominator)); + }, + hasUnit$1(unit) { + return unit === this._single_unit$_unit; + }, + hasCompatibleUnits$1(other) { + return other instanceof A.SingleUnitSassNumber0 && A.conversionFactor0(this._single_unit$_unit, other._single_unit$_unit) != null; + }, + hasPossiblyCompatibleUnits$1(other) { + var t1, knownCompatibilities, otherUnit; + if (!(other instanceof A.SingleUnitSassNumber0)) + return false; + t1 = $.$get$_knownCompatibilitiesByUnit0(); + knownCompatibilities = t1.$index(0, this._single_unit$_unit.toLowerCase()); + if (knownCompatibilities == null) + return true; + otherUnit = other._single_unit$_unit.toLowerCase(); + return knownCompatibilities.contains$1(0, otherUnit) || !t1.containsKey$1(otherUnit); + }, + compatibleWithUnit$1(unit) { + return A.conversionFactor0(this._single_unit$_unit, unit) != null; + }, + coerceToMatch$3(other, $name, otherName) { + var t1 = other instanceof A.SingleUnitSassNumber0 ? this._single_unit$_coerceToUnit$1(other._single_unit$_unit) : null; + return t1 == null ? this.super$SassNumber$coerceToMatch0(other, $name, otherName) : t1; + }, + coerceToMatch$1(other) { + return this.coerceToMatch$3(other, null, null); + }, + coerceValueToMatch$3(other, $name, otherName) { + var t1 = other instanceof A.SingleUnitSassNumber0 ? this._single_unit$_coerceValueToUnit$1(other._single_unit$_unit) : null; + return t1 == null ? this.super$SassNumber$coerceValueToMatch0(other, $name, otherName) : t1; + }, + coerceValueToMatch$1(other) { + return this.coerceValueToMatch$3(other, null, null); + }, + convertToMatch$3(other, $name, otherName) { + var t1 = other instanceof A.SingleUnitSassNumber0 ? this._single_unit$_coerceToUnit$1(other._single_unit$_unit) : null; + return t1 == null ? this.super$SassNumber$convertToMatch(other, $name, otherName) : t1; + }, + convertValueToMatch$3(other, $name, otherName) { + var t1 = other instanceof A.SingleUnitSassNumber0 ? this._single_unit$_coerceValueToUnit$1(other._single_unit$_unit) : null; + return t1 == null ? this.super$SassNumber$convertValueToMatch0(other, $name, otherName) : t1; + }, + convertValueToMatch$1(other) { + return this.convertValueToMatch$3(other, null, null); + }, + coerce$3(newNumerators, newDenominators, $name) { + var t1 = J.getInterceptor$asx(newNumerators); + t1 = t1.get$length(newNumerators) === 1 && J.get$isEmpty$asx(newDenominators) ? this._single_unit$_coerceToUnit$1(t1.$index(newNumerators, 0)) : null; + return t1 == null ? this.super$SassNumber$coerce0(newNumerators, newDenominators, $name) : t1; + }, + coerce$2(newNumerators, newDenominators) { + return this.coerce$3(newNumerators, newDenominators, null); + }, + coerceValue$3(newNumerators, newDenominators, $name) { + var t1 = J.getInterceptor$asx(newNumerators); + t1 = t1.get$length(newNumerators) === 1 && J.get$isEmpty$asx(newDenominators) ? this._single_unit$_coerceValueToUnit$1(t1.$index(newNumerators, 0)) : null; + return t1 == null ? this.super$SassNumber$coerceValue0(newNumerators, newDenominators, $name) : t1; + }, + coerceValueToUnit$2(unit, $name) { + var t1 = this._single_unit$_coerceValueToUnit$1(unit); + return t1 == null ? this.super$SassNumber$coerceValueToUnit0(unit, $name) : t1; + }, + coerceValueToUnit$1(unit) { + return this.coerceValueToUnit$2(unit, null); + }, + _single_unit$_coerceToUnit$1(unit) { + var t1 = this._single_unit$_unit; + if (t1 === unit) + return this; + return A.NullableExtension_andThen0(A.conversionFactor0(unit, t1), new A.SingleUnitSassNumber__coerceToUnit_closure0(this, unit)); + }, + _single_unit$_coerceValueToUnit$1(unit) { + return A.NullableExtension_andThen0(A.conversionFactor0(unit, this._single_unit$_unit), new A.SingleUnitSassNumber__coerceValueToUnit_closure0(this)); + }, + multiplyUnits$3(value, otherNumerators, otherDenominators) { + var mutableOtherDenominators, t1 = {}; + t1.value = value; + t1.newNumerators = otherNumerators; + mutableOtherDenominators = A._setArrayType(otherDenominators.slice(0), A._arrayInstanceType(otherDenominators)); + A.removeFirstWhere0(mutableOtherDenominators, new A.SingleUnitSassNumber_multiplyUnits_closure1(t1, this), new A.SingleUnitSassNumber_multiplyUnits_closure2(t1, this)); + return A.SassNumber_SassNumber$withUnits0(t1.value, mutableOtherDenominators, t1.newNumerators); + }, + unaryMinus$0() { + return new A.SingleUnitSassNumber0(this._single_unit$_unit, -this._number1$_value, null); + }, + $eq(_, other) { + var factor; + if (other == null) + return false; + if (other instanceof A.SingleUnitSassNumber0) { + factor = A.conversionFactor0(other._single_unit$_unit, this._single_unit$_unit); + return factor != null && A.fuzzyEquals0(this._number1$_value * factor, other._number1$_value); + } else + return false; + }, + get$hashCode(_) { + var _this = this, + t1 = _this.hashCache; + return t1 == null ? _this.hashCache = A.fuzzyHashCode0(_this._number1$_value * _this.canonicalMultiplierForUnit$1(_this._single_unit$_unit)) : t1; + } + }; + A.SingleUnitSassNumber__coerceToUnit_closure0.prototype = { + call$1(factor) { + return new A.SingleUnitSassNumber0(this.unit, this.$this._number1$_value * factor, null); + }, + $signature: 531 + }; + A.SingleUnitSassNumber__coerceValueToUnit_closure0.prototype = { + call$1(factor) { + return this.$this._number1$_value * factor; + }, + $signature: 37 + }; + A.SingleUnitSassNumber_multiplyUnits_closure1.prototype = { + call$1(denominator) { + var factor = A.conversionFactor0(denominator, this.$this._single_unit$_unit); + if (factor == null) + return false; + this._box_0.value *= factor; + return true; + }, + $signature: 4 + }; + A.SingleUnitSassNumber_multiplyUnits_closure2.prototype = { + call$0() { + var t1 = A._setArrayType([this.$this._single_unit$_unit], type$.JSArray_String), + t2 = this._box_0; + B.JSArray_methods.addAll$1(t1, t2.newNumerators); + t2.newNumerators = t1; + }, + $signature: 0 + }; + A.SourceMapBuffer0.prototype = { + get$_source_map_buffer0$_targetLocation() { + var t1 = this._source_map_buffer0$_buffer._contents, + t2 = this._source_map_buffer0$_line; + return A.SourceLocation$(t1.length, this._source_map_buffer0$_column, t2, null); + }, + get$length(_) { + return this._source_map_buffer0$_buffer._contents.length; + }, + forSpan$1$2(span, callback) { + var t1, _this = this, + wasInSpan = _this._source_map_buffer0$_inSpan; + _this._source_map_buffer0$_inSpan = true; + _this._source_map_buffer0$_addEntry$2(span.get$start(span), _this.get$_source_map_buffer0$_targetLocation()); + try { + t1 = callback.call$0(); + return t1; + } finally { + _this._source_map_buffer0$_inSpan = wasInSpan; + } + }, + forSpan$2(span, callback) { + return this.forSpan$1$2(span, callback, type$.dynamic); + }, + _source_map_buffer0$_addEntry$2(source, target) { + var entry, t2, + t1 = this._source_map_buffer0$_entries; + if (t1.length !== 0) { + entry = B.JSArray_methods.get$last(t1); + t2 = entry.source; + if (t2.file.getLine$1(t2.offset) === source.file.getLine$1(source.offset) && entry.target.line === target.line) + return; + if (entry.target.offset === target.offset) + return; + } + t1.push(new A.Entry(source, target, null)); + }, + write$1(_, object) { + var t1, i, + string = J.toString$0$(object); + this._source_map_buffer0$_buffer._contents += string; + for (t1 = string.length, i = 0; i < t1; ++i) + if (string.charCodeAt(i) === 10) + this._source_map_buffer0$_writeLine$0(); + else + ++this._source_map_buffer0$_column; + }, + writeCharCode$1(charCode) { + this._source_map_buffer0$_buffer._contents += A.Primitives_stringFromCharCode(charCode); + if (charCode === 10) + this._source_map_buffer0$_writeLine$0(); + else + ++this._source_map_buffer0$_column; + }, + _source_map_buffer0$_writeLine$0() { + var _this = this, + t1 = _this._source_map_buffer0$_entries; + if (B.JSArray_methods.get$last(t1).target.line === _this._source_map_buffer0$_line && B.JSArray_methods.get$last(t1).target.column === _this._source_map_buffer0$_column) + t1.pop(); + ++_this._source_map_buffer0$_line; + _this._source_map_buffer0$_column = 0; + if (_this._source_map_buffer0$_inSpan) + t1.push(new A.Entry(B.JSArray_methods.get$last(t1).source, _this.get$_source_map_buffer0$_targetLocation(), null)); + }, + toString$0(_) { + var t1 = this._source_map_buffer0$_buffer._contents; + return t1.charCodeAt(0) == 0 ? t1 : t1; + }, + buildSourceMap$1$prefix(prefix) { + var i, t2, prefixColumn, _box_0 = {}, + t1 = prefix.length; + if (t1 === 0) + return A.SingleMapping_SingleMapping$fromEntries(this._source_map_buffer0$_entries); + _box_0.prefixColumn = _box_0.prefixLines = 0; + for (i = 0, t2 = 0; i < t1; ++i) + if (prefix.charCodeAt(i) === 10) { + ++_box_0.prefixLines; + _box_0.prefixColumn = 0; + t2 = 0; + } else { + prefixColumn = t2 + 1; + _box_0.prefixColumn = prefixColumn; + t2 = prefixColumn; + } + t2 = this._source_map_buffer0$_entries; + return A.SingleMapping_SingleMapping$fromEntries(new A.MappedListIterable(t2, new A.SourceMapBuffer_buildSourceMap_closure0(_box_0, t1), A._arrayInstanceType(t2)._eval$1("MappedListIterable<1,Entry>"))); + } + }; + A.SourceMapBuffer_buildSourceMap_closure0.prototype = { + call$1(entry) { + var t1 = entry.target, + t2 = t1.line, + t3 = this._box_0, + t4 = t3.prefixLines; + t3 = t2 === 0 ? t3.prefixColumn : 0; + return new A.Entry(entry.source, A.SourceLocation$(t1.offset + this.prefixLength, t1.column + t3, t2 + t4, null), entry.identifierName); + }, + $signature: 204 + }; + A.updateSourceSpanPrototype_closure.prototype = { + call$0() { + return this.span; + }, + $signature: 25 + }; + A.updateSourceSpanPrototype_closure0.prototype = { + call$1(span) { + return span.get$start(span); + }, + $signature: 223 + }; + A.updateSourceSpanPrototype_closure1.prototype = { + call$1(span) { + return span.get$end(span); + }, + $signature: 223 + }; + A.updateSourceSpanPrototype_closure2.prototype = { + call$1(span) { + return A.NullableExtension_andThen0(span.get$sourceUrl(span), A.utils1__dartToJSUrl$closure()); + }, + $signature: 533 + }; + A.updateSourceSpanPrototype_closure3.prototype = { + call$1(span) { + return span.get$text(); + }, + $signature: 256 + }; + A.updateSourceSpanPrototype_closure4.prototype = { + call$1(span) { + return span.get$context(span); + }, + $signature: 256 + }; + A.updateSourceSpanPrototype_closure5.prototype = { + call$1($location) { + return $location.get$line(); + }, + $signature: 246 + }; + A.updateSourceSpanPrototype_closure6.prototype = { + call$1($location) { + return $location.get$column(); + }, + $signature: 246 + }; + A.StatementSearchVisitor0.prototype = { + visitAtRootRule$1(node) { + return this.visitChildren$1(node.children); + }, + visitAtRule$1(node) { + return A.NullableExtension_andThen0(node.children, this.get$visitChildren()); + }, + visitContentBlock$1(node) { + return this.visitChildren$1(node.children); + }, + visitContentRule$1(node) { + return null; + }, + visitDebugRule$1(node) { + return null; + }, + visitDeclaration$1(node) { + return A.NullableExtension_andThen0(node.children, this.get$visitChildren()); + }, + visitEachRule$1(node) { + return this.visitChildren$1(node.children); + }, + visitErrorRule$1(node) { + return null; + }, + visitExtendRule$1(node) { + return null; + }, + visitForRule$1(node) { + return this.visitChildren$1(node.children); + }, + visitForwardRule$1(node) { + return null; + }, + visitFunctionRule$1(node) { + return this.visitChildren$1(node.children); + }, + visitIfRule$1(node) { + var t1 = A.IterableExtension_search0(node.clauses, new A.StatementSearchVisitor_visitIfRule_closure1(this)); + return t1 == null ? A.NullableExtension_andThen0(node.lastClause, new A.StatementSearchVisitor_visitIfRule_closure2(this)) : t1; + }, + visitImportRule$1(node) { + return null; + }, + visitIncludeRule$1(node) { + return A.NullableExtension_andThen0(node.content, this.get$visitContentBlock()); + }, + visitLoudComment$1(node) { + return null; + }, + visitMediaRule$1(node) { + return this.visitChildren$1(node.children); + }, + visitMixinRule$1(node) { + return this.visitChildren$1(node.children); + }, + visitReturnRule$1(node) { + return null; + }, + visitSilentComment$1(node) { + return null; + }, + visitStyleRule$1(node) { + return this.visitChildren$1(node.children); + }, + visitStylesheet$1(node) { + return this.visitChildren$1(node.children); + }, + visitSupportsRule$1(node) { + return this.visitChildren$1(node.children); + }, + visitUseRule$1(node) { + return null; + }, + visitVariableDeclaration$1(node) { + return null; + }, + visitWarnRule$1(node) { + return null; + }, + visitWhileRule$1(node) { + return this.visitChildren$1(node.children); + }, + visitChildren$1(children) { + return A.IterableExtension_search0(children, new A.StatementSearchVisitor_visitChildren_closure0(this)); + } + }; + A.StatementSearchVisitor_visitIfRule_closure1.prototype = { + call$1(clause) { + return A.IterableExtension_search0(clause.children, new A.StatementSearchVisitor_visitIfRule__closure2(this.$this)); + }, + $signature() { + return A._instanceType(this.$this)._eval$1("StatementSearchVisitor0.T?(IfClause0)"); + } + }; + A.StatementSearchVisitor_visitIfRule__closure2.prototype = { + call$1(child) { + return child.accept$1(this.$this); + }, + $signature() { + return A._instanceType(this.$this)._eval$1("StatementSearchVisitor0.T?(Statement0)"); + } + }; + A.StatementSearchVisitor_visitIfRule_closure2.prototype = { + call$1(lastClause) { + return A.IterableExtension_search0(lastClause.children, new A.StatementSearchVisitor_visitIfRule__closure1(this.$this)); + }, + $signature() { + return A._instanceType(this.$this)._eval$1("StatementSearchVisitor0.T?(ElseClause0)"); + } + }; + A.StatementSearchVisitor_visitIfRule__closure1.prototype = { + call$1(child) { + return child.accept$1(this.$this); + }, + $signature() { + return A._instanceType(this.$this)._eval$1("StatementSearchVisitor0.T?(Statement0)"); + } + }; + A.StatementSearchVisitor_visitChildren_closure0.prototype = { + call$1(child) { + return child.accept$1(this.$this); + }, + $signature() { + return A._instanceType(this.$this)._eval$1("StatementSearchVisitor0.T?(Statement0)"); + } + }; + A.StaticImport0.prototype = { + toString$0(_) { + var t1 = this.url.toString$0(0), + t2 = this.modifiers; + return t1 + (t2 == null ? "" : " " + t2.toString$0(0)); + }, + $isImport0: 1, + $isAstNode0: 1, + get$span(receiver) { + return this.span; + } + }; + A.StderrLogger0.prototype = { + warn$4$deprecation$span$trace(_, message, deprecation, span, trace) { + var t2, + result = new A.StringBuffer(""), + t1 = this.color; + if (t1) { + t2 = result._contents = "" + "\x1b[33m\x1b[1m"; + t2 = result._contents = (deprecation ? result._contents = t2 + "Deprecation " : t2) + "Warning\x1b[0m"; + } else + t2 = result._contents = (deprecation ? result._contents = "" + "DEPRECATION " : "") + "WARNING"; + if (span == null) + t1 = result._contents = t2 + (": " + message + "\n"); + else if (trace != null) { + t1 = t2 + (": " + message + "\n\n" + span.highlight$1$color(t1) + "\n"); + result._contents = t1; + } else { + t1 = t2 + (" on " + span.message$2$color(0, "\n" + message, t1) + "\n"); + result._contents = t1; + } + if (trace != null) + result._contents = t1 + (A.indent0(B.JSString_methods.trimRight$0(trace.toString$0(0)), 4) + "\n"); + A.printError0(result); + }, + warn$1(_, message) { + return this.warn$4$deprecation$span$trace(0, message, false, null, null); + }, + warn$3$span$trace(_, message, span, trace) { + return this.warn$4$deprecation$span$trace(0, message, false, span, trace); + }, + warn$2$span(_, message, span) { + return this.warn$4$deprecation$span$trace(0, message, false, span, null); + }, + warn$2$trace(_, message, trace) { + return this.warn$4$deprecation$span$trace(0, message, false, null, trace); + }, + debug$2(_, message, span) { + var url, t3, t4, + t1 = span.file, + t2 = span._file$_start; + if (A.FileLocation$_(t1, t2).file.url == null) + url = "-"; + else { + t3 = A.FileLocation$_(t1, t2).file.url; + t4 = $.$get$context(); + t3.toString; + url = t4.prettyUri$1(t3); + } + t1 = A.FileLocation$_(t1, t2); + t1 = t1.file.getLine$1(t1.offset); + t2 = this.color ? "\x1b[1mDebug\x1b[0m" : "DEBUG"; + t2 = "" + (url + ":" + (t1 + 1) + " ") + t2 + (": " + message); + A.printError0(t2.charCodeAt(0) == 0 ? t2 : t2); + } + }; + A.StringExpression0.prototype = { + get$span(_) { + return this.text.span; + }, + accept$1$1(visitor) { + return visitor.visitStringExpression$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + asInterpolation$1$static($static) { + var t1, t2, quote, t3, t4, buffer, t5, t6, _i, value; + if (!this.hasQuotes) + return this.text; + t1 = this.text; + t2 = t1.contents; + quote = A.StringExpression__bestQuote0(new A.WhereTypeIterable(t2, type$.WhereTypeIterable_String)); + t3 = new A.StringBuffer(""); + t4 = A._setArrayType([], type$.JSArray_Object); + buffer = new A.InterpolationBuffer0(t3, t4); + t3._contents += A.Primitives_stringFromCharCode(quote); + for (t5 = t2.length, t6 = type$.Expression_2, _i = 0; _i < t5; ++_i) { + value = t2[_i]; + if (t6._is(value)) { + buffer._interpolation_buffer0$_flushText$0(); + t4.push(value); + continue; + } + if (typeof value == "string") + A.StringExpression__quoteInnerText0(value, quote, buffer, $static); + } + t3._contents += A.Primitives_stringFromCharCode(quote); + return buffer.interpolation$1(t1.span); + }, + asInterpolation$0() { + return this.asInterpolation$1$static(false); + }, + toString$0(_) { + return this.asInterpolation$0().toString$0(0); + }, + $isExpression0: 1, + $isAstNode0: 1 + }; + A.module_closure10.prototype = { + call$1($arguments) { + var limit, t2, chunks, i, lastEnd, match, t3, + t1 = J.getInterceptor$asx($arguments), + string = t1.$index($arguments, 0).assertString$1("string"), + separator = t1.$index($arguments, 1).assertString$1("separator"); + t1 = t1.$index($arguments, 2).get$realNull(); + limit = t1 == null ? null : t1.assertNumber$1("limit").assertInt$1("limit"); + if (limit != null && limit < 1) + throw A.wrapException(A.SassScriptException$0("$limit: Must be 1 or greater, was " + A.S(limit) + ".", null)); + t1 = string._string0$_text; + if (t1.length === 0) + return B.SassList_Sof2; + else { + t2 = separator._string0$_text; + if (t2.length === 0) + return A.SassList$0(A.MappedIterable_MappedIterable(new A.Runes(t1), new A.module__closure2(string), type$.Runes._eval$1("Iterable.E"), type$.Value_2), B.ListSeparator_rXA0, true); + } + chunks = A._setArrayType([], type$.JSArray_String); + for (t2 = B.JSString_methods.allMatches$1(t2, t1), t2 = new A._StringAllMatchesIterator(t2._input, t2._pattern, t2.__js_helper$_index), i = 0, lastEnd = 0; t2.moveNext$0();) { + match = t2.__js_helper$_current; + t3 = match.start; + chunks.push(B.JSString_methods.substring$2(t1, lastEnd, t3)); + lastEnd = t3 + match.pattern.length; + ++i; + if (i === limit) + break; + } + chunks.push(B.JSString_methods.substring$1(t1, lastEnd)); + return A.SassList$0(new A.MappedListIterable(chunks, new A.module__closure3(string), type$.MappedListIterable_String_Value_2), B.ListSeparator_rXA0, true); + }, + $signature: 22 + }; + A.module__closure2.prototype = { + call$1(rune) { + return new A.SassString0(A.Primitives_stringFromCharCode(rune), this.string._string0$_hasQuotes); + }, + $signature: 536 + }; + A.module__closure3.prototype = { + call$1(chunk) { + return new A.SassString0(chunk, this.string._string0$_hasQuotes); + }, + $signature: 537 + }; + A._unquote_closure0.prototype = { + call$1($arguments) { + var string = J.$index$asx($arguments, 0).assertString$1("string"); + if (!string._string0$_hasQuotes) + return string; + return new A.SassString0(string._string0$_text, false); + }, + $signature: 17 + }; + A._quote_closure0.prototype = { + call$1($arguments) { + var string = J.$index$asx($arguments, 0).assertString$1("string"); + if (string._string0$_hasQuotes) + return string; + return new A.SassString0(string._string0$_text, true); + }, + $signature: 17 + }; + A._length_closure1.prototype = { + call$1($arguments) { + return A.SassNumber_SassNumber0(J.$index$asx($arguments, 0).assertString$1("string").get$_string0$_sassLength(), null); + }, + $signature: 11 + }; + A._insert_closure0.prototype = { + call$1($arguments) { + var indexInt, codeUnitIndex, _s5_ = "index", + t1 = J.getInterceptor$asx($arguments), + string = t1.$index($arguments, 0).assertString$1("string"), + insert = t1.$index($arguments, 1).assertString$1("insert"), + index = t1.$index($arguments, 2).assertNumber$1(_s5_); + index.assertNoUnits$1(_s5_); + indexInt = index.assertInt$1(_s5_); + if (indexInt < 0) + indexInt = Math.max(string.get$_string0$_sassLength() + indexInt + 2, 0); + t1 = string._string0$_text; + codeUnitIndex = A.codepointIndexToCodeUnitIndex0(t1, A._codepointForIndex0(indexInt, string.get$_string0$_sassLength(), false)); + return new A.SassString0(B.JSString_methods.replaceRange$3(t1, codeUnitIndex, codeUnitIndex, insert._string0$_text), string._string0$_hasQuotes); + }, + $signature: 17 + }; + A._index_closure1.prototype = { + call$1($arguments) { + var t1 = J.getInterceptor$asx($arguments), + t2 = t1.$index($arguments, 0).assertString$1("string")._string0$_text, + codeUnitIndex = B.JSString_methods.indexOf$1(t2, t1.$index($arguments, 1).assertString$1("substring")._string0$_text); + if (codeUnitIndex === -1) + return B.C__SassNull0; + return A.SassNumber_SassNumber0(A.codeUnitIndexToCodepointIndex0(t2, codeUnitIndex) + 1, null); + }, + $signature: 3 + }; + A._slice_closure0.prototype = { + call$1($arguments) { + var lengthInCodepoints, endInt, startCodepoint, endCodepoint, + _s8_ = "start-at", + t1 = J.getInterceptor$asx($arguments), + string = t1.$index($arguments, 0).assertString$1("string"), + start = t1.$index($arguments, 1).assertNumber$1(_s8_), + end = t1.$index($arguments, 2).assertNumber$1("end-at"); + start.assertNoUnits$1(_s8_); + end.assertNoUnits$1("end-at"); + lengthInCodepoints = string.get$_string0$_sassLength(); + endInt = end.assertInt$0(); + if (endInt === 0) + return string._string0$_hasQuotes ? $.$get$_emptyQuoted0() : $.$get$_emptyUnquoted0(); + startCodepoint = A._codepointForIndex0(start.assertInt$0(), lengthInCodepoints, false); + endCodepoint = A._codepointForIndex0(endInt, lengthInCodepoints, true); + if (endCodepoint === lengthInCodepoints) + --endCodepoint; + if (endCodepoint < startCodepoint) + return string._string0$_hasQuotes ? $.$get$_emptyQuoted0() : $.$get$_emptyUnquoted0(); + t1 = string._string0$_text; + return new A.SassString0(B.JSString_methods.substring$2(t1, A.codepointIndexToCodeUnitIndex0(t1, startCodepoint), A.codepointIndexToCodeUnitIndex0(t1, endCodepoint + 1)), string._string0$_hasQuotes); + }, + $signature: 17 + }; + A._toUpperCase_closure0.prototype = { + call$1($arguments) { + var t1, t2, i, t3, t4, + string = J.$index$asx($arguments, 0).assertString$1("string"); + for (t1 = string._string0$_text, t2 = t1.length, i = 0, t3 = ""; i < t2; ++i) { + t4 = t1.charCodeAt(i); + t3 += A.Primitives_stringFromCharCode(t4 >= 97 && t4 <= 122 ? t4 & 4294967263 : t4); + } + return new A.SassString0(t3.charCodeAt(0) == 0 ? t3 : t3, string._string0$_hasQuotes); + }, + $signature: 17 + }; + A._toLowerCase_closure0.prototype = { + call$1($arguments) { + var t1, t2, i, t3, t4, + string = J.$index$asx($arguments, 0).assertString$1("string"); + for (t1 = string._string0$_text, t2 = t1.length, i = 0, t3 = ""; i < t2; ++i) { + t4 = t1.charCodeAt(i); + t3 += A.Primitives_stringFromCharCode(t4 >= 65 && t4 <= 90 ? t4 | 32 : t4); + } + return new A.SassString0(t3.charCodeAt(0) == 0 ? t3 : t3, string._string0$_hasQuotes); + }, + $signature: 17 + }; + A._uniqueId_closure0.prototype = { + call$1($arguments) { + var t1 = $.$get$_previousUniqueId0() + ($.$get$_random1().nextInt$1(36) + 1); + $._previousUniqueId0 = t1; + if (t1 > Math.pow(36, 6)) + $._previousUniqueId0 = B.JSInt_methods.$mod($.$get$_previousUniqueId0(), A._asInt(Math.pow(36, 6))); + return new A.SassString0("u" + B.JSString_methods.padLeft$2(B.JSInt_methods.toRadixString$1($.$get$_previousUniqueId0(), 36), 6, "0"), false); + }, + $signature: 17 + }; + A.stringClass_closure.prototype = { + call$0() { + var t2, + t1 = type$.JSClass, + jsClass = t1._as(A.allowInteropCaptureThisNamed("sass.SassString", new A.stringClass__closure())); + A.LinkedHashMap_LinkedHashMap$_literal(["text", new A.stringClass__closure0(), "hasQuotes", new A.stringClass__closure1(), "sassLength", new A.stringClass__closure2()], type$.String, type$.Function).forEach$1(0, A.JSClassExtension_get_defineGetter(jsClass)); + J.get$$prototype$x(jsClass).sassIndexToStringIndex = A.allowInteropCaptureThisNamed("sassIndexToStringIndex", new A.stringClass__closure3()); + t2 = $.$get$_emptyQuoted0(); + A.JSClassExtension_injectSuperclass(t1._as(t2.constructor), jsClass); + return jsClass; + }, + $signature: 13 + }; + A.stringClass__closure.prototype = { + call$3($self, textOrOptions, options) { + var t1; + if (typeof textOrOptions == "string") { + t1 = options == null ? null : J.get$quotes$x(options); + t1 = new A.SassString0(textOrOptions, t1 == null ? true : t1); + } else { + type$.nullable__ConstructorOptions_3._as(textOrOptions); + t1 = textOrOptions == null ? null : J.get$quotes$x(textOrOptions); + t1 = (t1 == null ? true : t1) ? $.$get$_emptyQuoted0() : $.$get$_emptyUnquoted0(); + } + return t1; + }, + call$1($self) { + return this.call$3($self, null, null); + }, + call$2($self, textOrOptions) { + return this.call$3($self, textOrOptions, null); + }, + "call*": "call$3", + $requiredArgCount: 1, + $defaultValues() { + return [null, null]; + }, + $signature: 538 + }; + A.stringClass__closure0.prototype = { + call$1($self) { + return $self._string0$_text; + }, + $signature: 539 + }; + A.stringClass__closure1.prototype = { + call$1($self) { + return $self._string0$_hasQuotes; + }, + $signature: 540 + }; + A.stringClass__closure2.prototype = { + call$1($self) { + return $self.get$_string0$_sassLength(); + }, + $signature: 541 + }; + A.stringClass__closure3.prototype = { + call$3($self, sassIndex, $name) { + var t1, + index = sassIndex.assertNumber$1($name).assertInt$1($name); + if (index === 0) + A.throwExpression(A.SassScriptException$0("String index may not be 0.", $name)); + else if (Math.abs(index) > $self.get$_string0$_sassLength()) + A.throwExpression(A.SassScriptException$0("Invalid index " + sassIndex.toString$0(0) + " for a string with " + $self.get$_string0$_sassLength() + " characters.", $name)); + t1 = index < 0 ? $self.get$_string0$_sassLength() + index : index - 1; + return A.codepointIndexToCodeUnitIndex0($self._string0$_text, t1); + }, + call$2($self, sassIndex) { + return this.call$3($self, sassIndex, null); + }, + "call*": "call$3", + $requiredArgCount: 2, + $defaultValues() { + return [null]; + }, + $signature: 542 + }; + A._ConstructorOptions1.prototype = {}; + A._NodeSassString.prototype = {}; + A.legacyStringClass_closure.prototype = { + call$3(thisArg, value, dartValue) { + var t1; + if (dartValue == null) { + value.toString; + t1 = new A.SassString0(value, false); + } else + t1 = dartValue; + J.set$dartValue$x(thisArg, t1); + }, + call$2(thisArg, value) { + return this.call$3(thisArg, value, null); + }, + "call*": "call$3", + $requiredArgCount: 2, + $defaultValues() { + return [null]; + }, + $signature: 543 + }; + A.legacyStringClass_closure0.prototype = { + call$1(thisArg) { + return J.get$dartValue$x(thisArg)._string0$_text; + }, + $signature: 544 + }; + A.legacyStringClass_closure1.prototype = { + call$2(thisArg, value) { + J.set$dartValue$x(thisArg, new A.SassString0(value, false)); + }, + $signature: 545 + }; + A.SassString0.prototype = { + get$_string0$_sassLength() { + var result, _this = this, + value = _this._string0$__SassString__sassLength_FI; + if (value === $) { + result = new A.Runes(_this._string0$_text).get$length(0); + _this._string0$__SassString__sassLength_FI !== $ && A.throwUnnamedLateFieldADI(); + _this._string0$__SassString__sassLength_FI = result; + value = result; + } + return value; + }, + get$isSpecialNumber() { + var t1, _2_0, _0_0, _1_0; + if (this._string0$_hasQuotes) + return false; + t1 = this._string0$_text; + if (t1.length < 6) + return false; + _2_0 = t1.charCodeAt(0); + $label1$1: { + if (99 === _2_0 || 67 === _2_0) { + _0_0 = t1.charCodeAt(1); + $label0$0: { + if (108 === _0_0 || 76 === _0_0) { + t1 = (t1.charCodeAt(2) | 32) === 97 && (t1.charCodeAt(3) | 32) === 109 && (t1.charCodeAt(4) | 32) === 112 && t1.charCodeAt(5) === 40; + break $label0$0; + } + if (97 === _0_0 || 65 === _0_0) { + t1 = (t1.charCodeAt(2) | 32) === 108 && (t1.charCodeAt(3) | 32) === 99 && t1.charCodeAt(4) === 40; + break $label0$0; + } + t1 = false; + break $label0$0; + } + break $label1$1; + } + if (118 === _2_0 || 86 === _2_0) { + t1 = (t1.charCodeAt(1) | 32) === 97 && (t1.charCodeAt(2) | 32) === 114 && t1.charCodeAt(3) === 40; + break $label1$1; + } + if (101 === _2_0 || 69 === _2_0) { + t1 = (t1.charCodeAt(1) | 32) === 110 && (t1.charCodeAt(2) | 32) === 118 && t1.charCodeAt(3) === 40; + break $label1$1; + } + if (109 === _2_0 || 77 === _2_0) { + _1_0 = t1.charCodeAt(1); + $label2$2: { + if (97 === _1_0 || 65 === _1_0) { + t1 = (t1.charCodeAt(2) | 32) === 120 && t1.charCodeAt(3) === 40; + break $label2$2; + } + if (105 === _1_0 || 73 === _1_0) { + t1 = (t1.charCodeAt(2) | 32) === 110 && t1.charCodeAt(3) === 40; + break $label2$2; + } + t1 = false; + break $label2$2; + } + break $label1$1; + } + t1 = false; + break $label1$1; + } + return t1; + }, + get$isVar() { + if (this._string0$_hasQuotes) + return false; + var t1 = this._string0$_text; + if (t1.length < 8) + return false; + return (t1.charCodeAt(0) | 32) === 118 && (t1.charCodeAt(1) | 32) === 97 && (t1.charCodeAt(2) | 32) === 114 && t1.charCodeAt(3) === 40; + }, + get$isBlank() { + return !this._string0$_hasQuotes && this._string0$_text.length === 0; + }, + accept$1$1(visitor) { + var t1 = visitor._serialize0$_quote && this._string0$_hasQuotes, + t2 = this._string0$_text; + if (t1) + visitor._serialize0$_visitQuotedString$1(t2); + else + visitor._serialize0$_visitUnquotedString$1(t2); + return null; + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + assertString$1($name) { + return this; + }, + plus$1(other) { + var t1 = this._string0$_text, + t2 = this._string0$_hasQuotes; + return other instanceof A.SassString0 ? new A.SassString0(t1 + other._string0$_text, t2) : new A.SassString0(t1 + A.serializeValue0(other, false, true), t2); + }, + $eq(_, other) { + if (other == null) + return false; + return other instanceof A.SassString0 && this._string0$_text === other._string0$_text; + }, + get$hashCode(_) { + var t1 = this._string0$_hashCache; + return t1 == null ? this._string0$_hashCache = B.JSString_methods.get$hashCode(this._string0$_text) : t1; + } + }; + A.ModifiableCssStyleRule0.prototype = { + accept$1$1(visitor) { + return visitor.visitCssStyleRule$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + equalsIgnoringChildren$1(other) { + var t1; + if (other instanceof A.ModifiableCssStyleRule0) + t1 = B.C_ListEquality.equals$2(0, other._style_rule0$_selector._box0$_inner.value.components, this._style_rule0$_selector._box0$_inner.value.components); + else + t1 = false; + return t1; + }, + copyWithoutChildren$0() { + return A.ModifiableCssStyleRule$0(this._style_rule0$_selector, this.span, this.originalSelector); + }, + get$span(receiver) { + return this.span; + } + }; + A.StyleRule0.prototype = { + accept$1$1(visitor) { + return visitor.visitStyleRule$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + toString$0(_) { + var t1 = this.children; + return this.selector.toString$0(0) + " {" + (t1 && B.JSArray_methods).join$1(t1, " ") + "}"; + }, + get$span(receiver) { + return this.span; + } + }; + A.CssStylesheet0.prototype = { + get$isGroupEnd() { + return false; + }, + get$isChildless() { + return false; + }, + accept$1$1(visitor) { + return visitor.visitCssStylesheet$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + get$children(receiver) { + return this.children; + }, + get$span(receiver) { + return this.span; + } + }; + A.ModifiableCssStylesheet0.prototype = { + accept$1$1(visitor) { + return visitor.visitCssStylesheet$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + equalsIgnoringChildren$1(other) { + return other instanceof A.ModifiableCssStylesheet0; + }, + copyWithoutChildren$0() { + return A.ModifiableCssStylesheet$0(this.span); + }, + $isCssStylesheet0: 1, + get$span(receiver) { + return this.span; + } + }; + A.StylesheetParser0.prototype = { + parse$0() { + return this.wrapSpanFormatException$1(new A.StylesheetParser_parse_closure0(this)); + }, + parseArgumentDeclaration$0() { + return this._stylesheet0$_parseSingleProduction$1$1(new A.StylesheetParser_parseArgumentDeclaration_closure0(this), type$.ArgumentDeclaration_2); + }, + _stylesheet0$_parseSingleProduction$1$1(production, $T) { + return this.wrapSpanFormatException$1(new A.StylesheetParser__parseSingleProduction_closure0(this, production, $T)); + }, + parseSignature$1$requireParens(requireParens) { + return this.wrapSpanFormatException$1(new A.StylesheetParser_parseSignature_closure(this, requireParens)); + }, + _stylesheet0$_statement$1$root(root) { + var t2, _this = this, + t1 = _this.scanner, + _0_0 = t1.peekChar$0(); + if (64 === _0_0) + return _this.atRule$2$root(new A.StylesheetParser__statement_closure0(_this), root); + if (43 === _0_0) { + if (!_this.get$indented() || !_this.lookingAtIdentifier$1(1)) + return _this._stylesheet0$_styleRule$0(); + _this._stylesheet0$_isUseAllowed = false; + t2 = t1._string_scanner$_position; + t1.readChar$0(); + return _this._stylesheet0$_includeRule$1(new A._SpanScannerState(t1, t2)); + } + if (61 === _0_0) { + if (!_this.get$indented()) + return _this._stylesheet0$_styleRule$0(); + _this._stylesheet0$_isUseAllowed = false; + t2 = t1._string_scanner$_position; + t1.readChar$0(); + _this.whitespace$0(); + return _this._stylesheet0$_mixinRule$1(new A._SpanScannerState(t1, t2)); + } + if (125 === _0_0) + t1.error$2$length(0, 'unmatched "}".', 1); + return _this._stylesheet0$_inStyleRule || _this._stylesheet0$_inUnknownAtRule || _this._stylesheet0$_inMixin || _this._stylesheet0$_inContentBlock ? _this._stylesheet0$_declarationOrStyleRule$0() : _this._stylesheet0$_variableDeclarationOrStyleRule$0(); + }, + _stylesheet0$_statement$0() { + return this._stylesheet0$_statement$1$root(false); + }, + variableDeclarationWithoutNamespace$2(namespace, start_) { + var t1, start, $name, t2, value, flagStart, t3, guarded, global, _0_0, endPosition, t4, t5, t6, declaration, _this = this, + precedingComment = _this.lastSilentComment; + _this.lastSilentComment = null; + if (start_ == null) { + t1 = _this.scanner; + start = new A._SpanScannerState(t1, t1._string_scanner$_position); + } else + start = start_; + $name = _this.variableName$0(); + t1 = namespace != null; + if (t1) + _this._stylesheet0$_assertPublic$2($name, new A.StylesheetParser_variableDeclarationWithoutNamespace_closure1(_this, start)); + if (_this.get$plainCss()) + _this.error$2(0, string$.Sass_v, _this.scanner.spanFrom$1(start)); + _this.whitespace$0(); + t2 = _this.scanner; + t2.expectChar$1(58); + _this.whitespace$0(); + value = _this._stylesheet0$_expression$0(); + flagStart = new A._SpanScannerState(t2, t2._string_scanner$_position); + for (t3 = _this.logger, guarded = false, global = false; t2.scanChar$1(33);) { + $label0$0: { + _0_0 = _this.identifier$0(); + if ("default" === _0_0) { + if (guarded) { + endPosition = t2._string_scanner$_position; + t4 = t2._sourceFile; + t5 = flagStart.position; + t6 = new A._FileSpan(t4, t5, endPosition); + t6._FileSpan$3(t4, t5, endPosition); + A.WarnForDeprecation_warnForDeprecation0(t3, B.Deprecation_ynv, string$.x21defau, t6, null); + } + guarded = true; + break $label0$0; + } + if ("global" === _0_0) { + if (t1) { + endPosition = t2._string_scanner$_position; + t4 = t2._sourceFile; + t5 = flagStart.position; + t6 = new A._FileSpan(t4, t5, endPosition); + t6._FileSpan$3(t4, t5, endPosition); + _this.error$2(0, string$.x21globai, t6); + } else if (global) { + endPosition = t2._string_scanner$_position; + t4 = t2._sourceFile; + t5 = flagStart.position; + t6 = new A._FileSpan(t4, t5, endPosition); + t6._FileSpan$3(t4, t5, endPosition); + A.WarnForDeprecation_warnForDeprecation0(t3, B.Deprecation_ynv, string$.x21globas, t6, null); + } + global = true; + break $label0$0; + } + endPosition = t2._string_scanner$_position; + t4 = t2._sourceFile; + t5 = flagStart.position; + t6 = new A._FileSpan(t4, t5, endPosition); + t6._FileSpan$3(t4, t5, endPosition); + _this.error$2(0, "Invalid flag name.", t6); + } + _this.whitespace$0(); + flagStart = new A._SpanScannerState(t2, t2._string_scanner$_position); + } + _this.expectStatementSeparator$1("variable declaration"); + declaration = A.VariableDeclaration$0($name, value, t2.spanFrom$1(start), precedingComment, global, guarded, namespace); + if (global) + _this._stylesheet0$_globalVariables.putIfAbsent$2($name, new A.StylesheetParser_variableDeclarationWithoutNamespace_closure2(declaration)); + return declaration; + }, + variableDeclarationWithoutNamespace$0() { + return this.variableDeclarationWithoutNamespace$2(null, null); + }, + _stylesheet0$_variableDeclarationOrStyleRule$0() { + var t1, t2, variableOrInterpolation, t3, _this = this; + if (_this.get$plainCss()) + return _this._stylesheet0$_styleRule$0(); + if (_this.get$indented() && _this.scanner.scanChar$1(92)) + return _this._stylesheet0$_styleRule$0(); + if (!_this.lookingAtIdentifier$0()) + return _this._stylesheet0$_styleRule$0(); + t1 = _this.scanner; + t2 = t1._string_scanner$_position; + variableOrInterpolation = _this._stylesheet0$_variableDeclarationOrInterpolation$0(); + if (variableOrInterpolation instanceof A.VariableDeclaration0) + t1 = variableOrInterpolation; + else { + t3 = new A.InterpolationBuffer0(new A.StringBuffer(""), A._setArrayType([], type$.JSArray_Object)); + t3.addInterpolation$1(type$.Interpolation_2._as(variableOrInterpolation)); + t2 = _this._stylesheet0$_styleRule$2(t3, new A._SpanScannerState(t1, t2)); + t1 = t2; + } + return t1; + }, + _stylesheet0$_declarationOrStyleRule$0() { + var t1, t2, declarationOrBuffer, _this = this; + if (_this.get$plainCss() && _this._stylesheet0$_inStyleRule && !_this._stylesheet0$_inUnknownAtRule) + return _this._stylesheet0$_propertyOrVariableDeclaration$0(); + if (_this.get$indented() && _this.scanner.scanChar$1(92)) + return _this._stylesheet0$_styleRule$0(); + t1 = _this.scanner; + t2 = t1._string_scanner$_position; + declarationOrBuffer = _this._stylesheet0$_declarationOrBuffer$0(); + return type$.Statement_2._is(declarationOrBuffer) ? declarationOrBuffer : _this._stylesheet0$_styleRule$2(type$.InterpolationBuffer_2._as(declarationOrBuffer), new A._SpanScannerState(t1, t2)); + }, + _stylesheet0$_declarationOrBuffer$0() { + var midBuffer, couldBeSelector, beforeDeclaration, additional, t3, startsWithPunctuation, variableOrInterpolation, t4, $name, postColonWhitespace, exception, _this = this, t1 = {}, + t2 = _this.scanner, + start = new A._SpanScannerState(t2, t2._string_scanner$_position), + nameBuffer = new A.InterpolationBuffer0(new A.StringBuffer(""), A._setArrayType([], type$.JSArray_Object)); + if (_this._stylesheet0$_lookingAtPotentialPropertyHack$0()) { + t3 = t2.readChar$0(); + nameBuffer._interpolation_buffer0$_text._contents += A.Primitives_stringFromCharCode(t3); + t3 = _this.rawText$1(_this.get$whitespace()); + nameBuffer._interpolation_buffer0$_text._contents += t3; + startsWithPunctuation = true; + } else + startsWithPunctuation = false; + if (!_this._stylesheet0$_lookingAtInterpolatedIdentifier$0()) + return nameBuffer; + variableOrInterpolation = startsWithPunctuation ? _this.interpolatedIdentifier$0() : _this._stylesheet0$_variableDeclarationOrInterpolation$0(); + if (variableOrInterpolation instanceof A.VariableDeclaration0) + return variableOrInterpolation; + else + nameBuffer.addInterpolation$1(type$.Interpolation_2._as(variableOrInterpolation)); + _this._stylesheet0$_isUseAllowed = false; + if (t2.matches$1("/*")) { + t3 = _this.rawText$1(_this.get$loudComment()); + nameBuffer._interpolation_buffer0$_text._contents += t3; + } + midBuffer = new A.StringBuffer(""); + t3 = _this.get$whitespace(); + midBuffer._contents += _this.rawText$1(t3); + t4 = t2._string_scanner$_position; + if (!t2.scanChar$1(58)) { + if (midBuffer._contents.length !== 0) + nameBuffer._interpolation_buffer0$_text._contents += A.Primitives_stringFromCharCode(32); + return nameBuffer; + } + midBuffer._contents += A.Primitives_stringFromCharCode(58); + $name = nameBuffer.interpolation$1(t2.spanFrom$2(start, new A._SpanScannerState(t2, t4))); + if (B.JSString_methods.startsWith$1($name.get$initialPlain(), "--")) { + t1 = _this._stylesheet0$_interpolatedDeclarationValue$0(); + _this.expectStatementSeparator$1("custom property"); + return A.Declaration$0($name, new A.StringExpression0(t1, false), t2.spanFrom$1(start)); + } + if (t2.scanChar$1(58)) { + t1 = nameBuffer; + t2 = t1._interpolation_buffer0$_text; + t2._contents += A.S(midBuffer); + t2._contents += A.Primitives_stringFromCharCode(58); + return t1; + } else if (_this.get$indented() && _this._stylesheet0$_lookingAtInterpolatedIdentifier$0()) { + t1 = nameBuffer; + t1._interpolation_buffer0$_text._contents += A.S(midBuffer); + return t1; + } + postColonWhitespace = _this.rawText$1(t3); + if (_this.lookingAtChildren$0()) + return _this._stylesheet0$_withChildren$3(_this.get$_stylesheet0$_declarationChild(), start, new A.StylesheetParser__declarationOrBuffer_closure1($name)); + midBuffer._contents += postColonWhitespace; + couldBeSelector = postColonWhitespace.length === 0 && _this._stylesheet0$_lookingAtInterpolatedIdentifier$0(); + beforeDeclaration = new A._SpanScannerState(t2, t2._string_scanner$_position); + t3 = t1.value = null; + try { + t3 = t1.value = _this._stylesheet0$_expression$0(); + if (_this.lookingAtChildren$0()) { + if (couldBeSelector) + _this.expectStatementSeparator$0(); + } else if (!_this.atEndOfStatement$0()) + _this.expectStatementSeparator$0(); + } catch (exception) { + if (type$.FormatException._is(A.unwrapException(exception))) { + if (!couldBeSelector) + throw exception; + t2.set$state(beforeDeclaration); + additional = _this.almostAnyValue$0(); + if (!_this.get$indented() && t2.peekChar$0() === 59) + throw exception; + nameBuffer._interpolation_buffer0$_text._contents += A.S(midBuffer); + nameBuffer.addInterpolation$1(additional); + return nameBuffer; + } else + throw exception; + } + if (_this.lookingAtChildren$0()) + return _this._stylesheet0$_withChildren$3(_this.get$_stylesheet0$_declarationChild(), start, new A.StylesheetParser__declarationOrBuffer_closure2(t1, $name)); + else { + _this.expectStatementSeparator$0(); + return A.Declaration$0($name, t3, t2.spanFrom$1(start)); + } + }, + _stylesheet0$_variableDeclarationOrInterpolation$0() { + var t1, start, identifier, t2, buffer, _this = this; + if (!_this.lookingAtIdentifier$0()) + return _this.interpolatedIdentifier$0(); + t1 = _this.scanner; + start = new A._SpanScannerState(t1, t1._string_scanner$_position); + identifier = _this.identifier$0(); + if (t1.matches$1(".$")) { + t1.readChar$0(); + return _this.variableDeclarationWithoutNamespace$2(identifier, start); + } else { + t2 = new A.StringBuffer(""); + buffer = new A.InterpolationBuffer0(t2, A._setArrayType([], type$.JSArray_Object)); + t2._contents = "" + identifier; + if (_this._stylesheet0$_lookingAtInterpolatedIdentifierBody$0()) + buffer.addInterpolation$1(_this.interpolatedIdentifier$0()); + return buffer.interpolation$1(t1.spanFrom$1(start)); + } + }, + _stylesheet0$_styleRule$2(buffer, start_) { + var t2, start, interpolation, wasInStyleRule, _this = this, t1 = {}; + _this._stylesheet0$_isUseAllowed = false; + if (start_ == null) { + t2 = _this.scanner; + start = new A._SpanScannerState(t2, t2._string_scanner$_position); + } else + start = start_; + interpolation = t1.interpolation = _this.styleRuleSelector$0(); + if (buffer != null) { + buffer.addInterpolation$1(interpolation); + t2 = t1.interpolation = buffer.interpolation$1(_this.scanner.spanFrom$1(start)); + } else + t2 = interpolation; + if (t2.contents.length === 0) + _this.scanner.error$1(0, 'expected "}".'); + wasInStyleRule = _this._stylesheet0$_inStyleRule; + _this._stylesheet0$_inStyleRule = true; + return _this._stylesheet0$_withChildren$3(_this.get$_stylesheet0$_statement(), start, new A.StylesheetParser__styleRule_closure0(t1, _this, wasInStyleRule, start)); + }, + _stylesheet0$_styleRule$0() { + return this._stylesheet0$_styleRule$2(null, null); + }, + _stylesheet0$_propertyOrVariableDeclaration$1$parseCustomProperties(parseCustomProperties) { + var t3, nameBuffer, variableOrInterpolation, $name, value, _this = this, + _s48_ = string$.Nested, + t1 = {}, + t2 = _this.scanner, + start = new A._SpanScannerState(t2, t2._string_scanner$_position); + t1.name = null; + if (_this._stylesheet0$_lookingAtPotentialPropertyHack$0()) { + t3 = new A.StringBuffer(""); + nameBuffer = new A.InterpolationBuffer0(t3, A._setArrayType([], type$.JSArray_Object)); + t3._contents += A.Primitives_stringFromCharCode(t2.readChar$0()); + t3._contents += _this.rawText$1(_this.get$whitespace()); + nameBuffer.addInterpolation$1(_this.interpolatedIdentifier$0()); + t3 = t1.name = nameBuffer.interpolation$1(t2.spanFrom$1(start)); + } else if (!_this.get$plainCss()) { + variableOrInterpolation = _this._stylesheet0$_variableDeclarationOrInterpolation$0(); + if (variableOrInterpolation instanceof A.VariableDeclaration0) + return variableOrInterpolation; + else { + type$.Interpolation_2._as(variableOrInterpolation); + t1.name = variableOrInterpolation; + } + t3 = variableOrInterpolation; + } else { + $name = _this.interpolatedIdentifier$0(); + t1.name = $name; + t3 = $name; + } + _this.whitespace$0(); + t2.expectChar$1(58); + if (parseCustomProperties && B.JSString_methods.startsWith$1(t3.get$initialPlain(), "--")) { + t1 = _this._stylesheet0$_interpolatedDeclarationValue$0(); + _this.expectStatementSeparator$1("custom property"); + return A.Declaration$0(t3, new A.StringExpression0(t1, false), t2.spanFrom$1(start)); + } + _this.whitespace$0(); + if (_this.lookingAtChildren$0()) { + if (_this.get$plainCss()) + t2.error$1(0, _s48_); + return _this._stylesheet0$_withChildren$3(_this.get$_stylesheet0$_declarationChild(), start, new A.StylesheetParser__propertyOrVariableDeclaration_closure1(t1)); + } + value = _this._stylesheet0$_expression$0(); + if (_this.lookingAtChildren$0()) { + if (_this.get$plainCss()) + t2.error$1(0, _s48_); + return _this._stylesheet0$_withChildren$3(_this.get$_stylesheet0$_declarationChild(), start, new A.StylesheetParser__propertyOrVariableDeclaration_closure2(t1, value)); + } else { + _this.expectStatementSeparator$0(); + return A.Declaration$0(t3, value, t2.spanFrom$1(start)); + } + }, + _stylesheet0$_propertyOrVariableDeclaration$0() { + return this._stylesheet0$_propertyOrVariableDeclaration$1$parseCustomProperties(true); + }, + _stylesheet0$_declarationChild$0() { + return this.scanner.peekChar$0() === 64 ? this._stylesheet0$_declarationAtRule$0() : this._stylesheet0$_propertyOrVariableDeclaration$1$parseCustomProperties(false); + }, + atRule$2$root(child, root) { + var $name, wasUseAllowed, value, optional, url, namespace, configuration, span, _this = this, + _s9_ = "@use rule", + t1 = _this.scanner, + start = new A._SpanScannerState(t1, t1._string_scanner$_position); + t1.expectChar$2$name(64, "@-rule"); + $name = _this.interpolatedIdentifier$0(); + _this.whitespace$0(); + wasUseAllowed = _this._stylesheet0$_isUseAllowed; + _this._stylesheet0$_isUseAllowed = false; + switch ($name.get$asPlain()) { + case "at-root": + return _this._stylesheet0$_atRootRule$1(start); + case "content": + return _this._stylesheet0$_contentRule$1(start); + case "debug": + return _this._stylesheet0$_debugRule$1(start); + case "each": + return _this._stylesheet0$_eachRule$2(start, child); + case "else": + return _this._stylesheet0$_disallowedAtRule$1(start); + case "error": + return _this._stylesheet0$_errorRule$1(start); + case "extend": + if (!_this._stylesheet0$_inStyleRule && !_this._stylesheet0$_inMixin && !_this._stylesheet0$_inContentBlock) + _this.error$2(0, string$.x40exten, t1.spanFrom$1(start)); + value = _this.almostAnyValue$0(); + optional = t1.scanChar$1(33); + if (optional) + _this.expectIdentifier$1("optional"); + _this.expectStatementSeparator$1("@extend rule"); + return new A.ExtendRule0(value, optional, t1.spanFrom$1(start)); + case "for": + return _this._stylesheet0$_forRule$2(start, child); + case "forward": + _this._stylesheet0$_isUseAllowed = wasUseAllowed; + if (!root) + _this._stylesheet0$_disallowedAtRule$1(start); + return _this._stylesheet0$_forwardRule$1(start); + case "function": + return _this._stylesheet0$_functionRule$1(start); + case "if": + return _this._stylesheet0$_ifRule$2(start, child); + case "import": + return _this._stylesheet0$_importRule$1(start); + case "include": + return _this._stylesheet0$_includeRule$1(start); + case "media": + return _this.mediaRule$1(start); + case "mixin": + return _this._stylesheet0$_mixinRule$1(start); + case "-moz-document": + return _this.mozDocumentRule$2(start, $name); + case "return": + return _this._stylesheet0$_disallowedAtRule$1(start); + case "supports": + return _this.supportsRule$1(start); + case "use": + _this._stylesheet0$_isUseAllowed = wasUseAllowed; + if (!root) + _this._stylesheet0$_disallowedAtRule$1(start); + url = _this._stylesheet0$_urlString$0(); + _this.whitespace$0(); + namespace = _this._stylesheet0$_useNamespace$2(url, start); + _this.whitespace$0(); + configuration = _this._stylesheet0$_configuration$0(); + _this.expectStatementSeparator$1(_s9_); + span = t1.spanFrom$1(start); + if (!_this._stylesheet0$_isUseAllowed) + _this.error$2(0, string$.x40use_r, span); + _this.expectStatementSeparator$1(_s9_); + t1 = new A.UseRule0(url, namespace, configuration == null ? B.List_empty21 : A.List_List$unmodifiable(configuration, type$.ConfiguredVariable_2), span); + t1.UseRule$4$configuration0(url, namespace, span, configuration); + return t1; + case "warn": + return _this._stylesheet0$_warnRule$1(start); + case "while": + return _this._stylesheet0$_whileRule$2(start, child); + default: + return _this.unknownAtRule$2(start, $name); + } + }, + _stylesheet0$_declarationAtRule$0() { + var _this = this, + t1 = _this.scanner, + start = new A._SpanScannerState(t1, t1._string_scanner$_position), + _0_0 = _this._stylesheet0$_plainAtRuleName$0(); + $label0$0: { + if ("content" === _0_0) { + t1 = _this._stylesheet0$_contentRule$1(start); + break $label0$0; + } + if ("debug" === _0_0) { + t1 = _this._stylesheet0$_debugRule$1(start); + break $label0$0; + } + if ("each" === _0_0) { + t1 = _this._stylesheet0$_eachRule$2(start, _this.get$_stylesheet0$_declarationChild()); + break $label0$0; + } + if ("else" === _0_0) + _this._stylesheet0$_disallowedAtRule$1(start); + if ("error" === _0_0) { + t1 = _this._stylesheet0$_errorRule$1(start); + break $label0$0; + } + if ("for" === _0_0) { + t1 = _this._stylesheet0$_forRule$2(start, _this.get$_stylesheet0$_declarationChild()); + break $label0$0; + } + if ("if" === _0_0) { + t1 = _this._stylesheet0$_ifRule$2(start, _this.get$_stylesheet0$_declarationChild()); + break $label0$0; + } + if ("include" === _0_0) { + t1 = _this._stylesheet0$_includeRule$1(start); + break $label0$0; + } + if ("warn" === _0_0) { + t1 = _this._stylesheet0$_warnRule$1(start); + break $label0$0; + } + if ("while" === _0_0) { + t1 = _this._stylesheet0$_whileRule$2(start, _this.get$_stylesheet0$_declarationChild()); + break $label0$0; + } + t1 = _this._stylesheet0$_disallowedAtRule$1(start); + } + return t1; + }, + _stylesheet0$_functionChild$0() { + var state, variableDeclarationError, stackTrace, statement, t2, namespace, exception, t3, start, _0_0, value, _this = this, + t1 = _this.scanner; + if (t1.peekChar$0() !== 64) { + t2 = t1._string_scanner$_position; + state = new A._SpanScannerState(t1, t2); + try { + namespace = _this.identifier$0(); + t1.expectChar$1(46); + t2 = _this.variableDeclarationWithoutNamespace$2(namespace, new A._SpanScannerState(t1, t2)); + return t2; + } catch (exception) { + t2 = A.unwrapException(exception); + t3 = type$.SourceSpanFormatException; + if (t3._is(t2)) { + variableDeclarationError = t2; + stackTrace = A.getTraceFromException(exception); + t1.set$state(state); + statement = null; + try { + statement = _this._stylesheet0$_declarationOrStyleRule$0(); + } catch (exception) { + if (t3._is(A.unwrapException(exception))) + throw A.wrapException(variableDeclarationError); + else + throw exception; + } + t2 = statement instanceof A.StyleRule0 ? "style rules" : "declarations"; + _this.error$3(0, "@function rules may not contain " + t2 + ".", J.get$span$z(statement), stackTrace); + } else + throw exception; + } + } + start = new A._SpanScannerState(t1, t1._string_scanner$_position); + _0_0 = _this._stylesheet0$_plainAtRuleName$0(); + $label0$0: { + if ("debug" === _0_0) { + t1 = _this._stylesheet0$_debugRule$1(start); + break $label0$0; + } + if ("each" === _0_0) { + t1 = _this._stylesheet0$_eachRule$2(start, _this.get$_stylesheet0$_functionChild()); + break $label0$0; + } + if ("else" === _0_0) + _this._stylesheet0$_disallowedAtRule$1(start); + if ("error" === _0_0) { + t1 = _this._stylesheet0$_errorRule$1(start); + break $label0$0; + } + if ("for" === _0_0) { + t1 = _this._stylesheet0$_forRule$2(start, _this.get$_stylesheet0$_functionChild()); + break $label0$0; + } + if ("if" === _0_0) { + t1 = _this._stylesheet0$_ifRule$2(start, _this.get$_stylesheet0$_functionChild()); + break $label0$0; + } + if ("return" === _0_0) { + value = _this._stylesheet0$_expression$0(); + _this.expectStatementSeparator$1("@return rule"); + t1 = new A.ReturnRule0(value, t1.spanFrom$1(start)); + break $label0$0; + } + if ("warn" === _0_0) { + t1 = _this._stylesheet0$_warnRule$1(start); + break $label0$0; + } + if ("while" === _0_0) { + t1 = _this._stylesheet0$_whileRule$2(start, _this.get$_stylesheet0$_functionChild()); + break $label0$0; + } + t1 = _this._stylesheet0$_disallowedAtRule$1(start); + } + return t1; + }, + _stylesheet0$_plainAtRuleName$0() { + this.scanner.expectChar$2$name(64, "@-rule"); + var $name = this.identifier$0(); + this.whitespace$0(); + return $name; + }, + _stylesheet0$_atRootRule$1(start) { + var t2, t3, t4, buffer, t5, query, _this = this, + t1 = _this.scanner; + if (t1.peekChar$0() === 40) { + t2 = t1._string_scanner$_position; + t3 = new A.StringBuffer(""); + t4 = A._setArrayType([], type$.JSArray_Object); + buffer = new A.InterpolationBuffer0(t3, t4); + t1.expectChar$1(40); + t3._contents += A.Primitives_stringFromCharCode(40); + _this.whitespace$0(); + t5 = _this._stylesheet0$_expression$0(); + buffer._interpolation_buffer0$_flushText$0(); + t4.push(t5); + if (t1.scanChar$1(58)) { + _this.whitespace$0(); + t3._contents += A.Primitives_stringFromCharCode(58); + t3._contents += A.Primitives_stringFromCharCode(32); + t5 = _this._stylesheet0$_expression$0(); + buffer._interpolation_buffer0$_flushText$0(); + t4.push(t5); + } + t1.expectChar$1(41); + _this.whitespace$0(); + t3._contents += A.Primitives_stringFromCharCode(41); + query = buffer.interpolation$1(t1.spanFrom$1(new A._SpanScannerState(t1, t2))); + _this.whitespace$0(); + return _this._stylesheet0$_withChildren$3(_this.get$_stylesheet0$_statement(), start, new A.StylesheetParser__atRootRule_closure1(query)); + } else if (_this.lookingAtChildren$0()) + return _this._stylesheet0$_withChildren$3(_this.get$_stylesheet0$_statement(), start, new A.StylesheetParser__atRootRule_closure2()); + else + return A.AtRootRule$0(A._setArrayType([_this._stylesheet0$_styleRule$0()], type$.JSArray_Statement_2), t1.spanFrom$1(start), null); + }, + _stylesheet0$_contentRule$1(start) { + var t1, $arguments, t2, t3, _this = this; + if (!_this._stylesheet0$_inMixin) + _this.error$2(0, string$.x40conte, _this.scanner.spanFrom$1(start)); + _this.whitespace$0(); + t1 = _this.scanner; + if (t1.peekChar$0() === 40) + $arguments = _this._stylesheet0$_argumentInvocation$1$mixin(true); + else { + t2 = A.FileLocation$_(t1._sourceFile, t1._string_scanner$_position); + t3 = t2.offset; + $arguments = A.ArgumentInvocation$empty0(A._FileSpan$(t2.file, t3, t3)); + } + _this.expectStatementSeparator$1("@content rule"); + return new A.ContentRule0($arguments, t1.spanFrom$1(start)); + }, + _stylesheet0$_debugRule$1(start) { + var value = this._stylesheet0$_expression$0(); + this.expectStatementSeparator$1("@debug rule"); + return new A.DebugRule0(value, this.scanner.spanFrom$1(start)); + }, + _stylesheet0$_eachRule$2(start, child) { + var variables, t1, _this = this, + wasInControlDirective = _this._stylesheet0$_inControlDirective; + _this._stylesheet0$_inControlDirective = true; + variables = A._setArrayType([_this.variableName$0()], type$.JSArray_String); + _this.whitespace$0(); + for (t1 = _this.scanner; t1.scanChar$1(44);) { + _this.whitespace$0(); + t1.expectChar$1(36); + variables.push(_this.identifier$1$normalize(true)); + _this.whitespace$0(); + } + _this.expectIdentifier$1("in"); + _this.whitespace$0(); + return _this._stylesheet0$_withChildren$3(child, start, new A.StylesheetParser__eachRule_closure0(_this, wasInControlDirective, variables, _this._stylesheet0$_expression$0())); + }, + _stylesheet0$_errorRule$1(start) { + var value = this._stylesheet0$_expression$0(); + this.expectStatementSeparator$1("@error rule"); + return new A.ErrorRule0(value, this.scanner.spanFrom$1(start)); + }, + _stylesheet0$_functionRule$1(start) { + var $name, $arguments, _0_0, _this = this, + precedingComment = _this.lastSilentComment; + _this.lastSilentComment = null; + $name = _this.identifier$1$normalize(true); + _this.whitespace$0(); + $arguments = _this._stylesheet0$_argumentDeclaration$0(); + if (_this._stylesheet0$_inMixin || _this._stylesheet0$_inContentBlock) + _this.error$2(0, string$.Mixinscf, _this.scanner.spanFrom$1(start)); + else if (_this._stylesheet0$_inControlDirective) + _this.error$2(0, string$.Functi, _this.scanner.spanFrom$1(start)); + _0_0 = A.unvendor0($name); + if ("calc" === _0_0 || "element" === _0_0 || "expression" === _0_0 || "url" === _0_0 || "and" === _0_0 || "or" === _0_0 || "not" === _0_0 || "clamp" === _0_0) + _this.error$2(0, "Invalid function name.", _this.scanner.spanFrom$1(start)); + _this.whitespace$0(); + return _this._stylesheet0$_withChildren$3(_this.get$_stylesheet0$_functionChild(), start, new A.StylesheetParser__functionRule_closure0($name, $arguments, precedingComment)); + }, + _stylesheet0$_forRule$2(start, child) { + var variable, from, _this = this, t1 = {}, + wasInControlDirective = _this._stylesheet0$_inControlDirective; + _this._stylesheet0$_inControlDirective = true; + variable = _this.variableName$0(); + _this.whitespace$0(); + _this.expectIdentifier$1("from"); + _this.whitespace$0(); + t1.exclusive = null; + from = _this._stylesheet0$_expression$1$until(new A.StylesheetParser__forRule_closure1(t1, _this)); + if (t1.exclusive == null) + _this.scanner.error$1(0, 'Expected "to" or "through".'); + _this.whitespace$0(); + return _this._stylesheet0$_withChildren$3(child, start, new A.StylesheetParser__forRule_closure2(t1, _this, wasInControlDirective, variable, from, _this._stylesheet0$_expression$0())); + }, + _stylesheet0$_forwardRule$1(start) { + var prefix, _0_0, shownMixinsAndFunctions, shownVariables, hiddenVariables, hiddenMixinsAndFunctions, _1_0, configuration, span, t1, t2, t3, t4, _this = this, _null = null, + url = _this._stylesheet0$_urlString$0(); + _this.whitespace$0(); + if (_this.scanIdentifier$1("as")) { + _this.whitespace$0(); + prefix = _this.identifier$1$normalize(true); + _this.scanner.expectChar$1(42); + _this.whitespace$0(); + } else + prefix = _null; + if (_this.scanIdentifier$1("show")) { + _0_0 = _this._stylesheet0$_memberList$0(); + shownMixinsAndFunctions = _0_0._0; + shownVariables = _0_0._1; + hiddenVariables = _null; + hiddenMixinsAndFunctions = hiddenVariables; + } else { + if (_this.scanIdentifier$1("hide")) { + _1_0 = _this._stylesheet0$_memberList$0(); + hiddenMixinsAndFunctions = _1_0._0; + hiddenVariables = _1_0._1; + } else { + hiddenVariables = _null; + hiddenMixinsAndFunctions = hiddenVariables; + } + shownVariables = _null; + shownMixinsAndFunctions = shownVariables; + } + configuration = _this._stylesheet0$_configuration$1$allowGuarded(true); + _this.expectStatementSeparator$1("@forward rule"); + span = _this.scanner.spanFrom$1(start); + if (!_this._stylesheet0$_isUseAllowed) + _this.error$2(0, string$.x40forwa, span); + if (shownMixinsAndFunctions != null) { + shownVariables.toString; + t1 = type$.String; + t2 = A.LinkedHashSet_LinkedHashSet$of(shownMixinsAndFunctions, t1); + t3 = type$.UnmodifiableSetView_String; + t1 = A.LinkedHashSet_LinkedHashSet$of(shownVariables, t1); + t4 = configuration == null ? B.List_empty21 : A.List_List$unmodifiable(configuration, type$.ConfiguredVariable_2); + return new A.ForwardRule0(url, new A.UnmodifiableSetView0(t2, t3), new A.UnmodifiableSetView0(t1, t3), _null, _null, prefix, t4, span); + } else if (hiddenMixinsAndFunctions != null) { + hiddenVariables.toString; + t1 = type$.String; + t2 = A.LinkedHashSet_LinkedHashSet$of(hiddenMixinsAndFunctions, t1); + t3 = type$.UnmodifiableSetView_String; + t1 = A.LinkedHashSet_LinkedHashSet$of(hiddenVariables, t1); + t4 = configuration == null ? B.List_empty21 : A.List_List$unmodifiable(configuration, type$.ConfiguredVariable_2); + return new A.ForwardRule0(url, _null, _null, new A.UnmodifiableSetView0(t2, t3), new A.UnmodifiableSetView0(t1, t3), prefix, t4, span); + } else + return new A.ForwardRule0(url, _null, _null, _null, _null, prefix, configuration == null ? B.List_empty21 : A.List_List$unmodifiable(configuration, type$.ConfiguredVariable_2), span); + }, + _stylesheet0$_memberList$0() { + var _this = this, + t1 = type$.String, + identifiers = A.LinkedHashSet_LinkedHashSet$_empty(t1), + variables = A.LinkedHashSet_LinkedHashSet$_empty(t1); + t1 = _this.scanner; + do { + _this.whitespace$0(); + _this.withErrorMessage$2(string$.Expect, new A.StylesheetParser__memberList_closure0(_this, variables, identifiers)); + _this.whitespace$0(); + } while (t1.scanChar$1(44)); + return new A._Record_2(identifiers, variables); + }, + _stylesheet0$_ifRule$2(start, child) { + var condition, children, clauses, lastClause, span, _this = this, + ifIndentation = _this.get$currentIndentation(), + wasInControlDirective = _this._stylesheet0$_inControlDirective; + _this._stylesheet0$_inControlDirective = true; + condition = _this._stylesheet0$_expression$0(); + children = _this.children$1(0, child); + _this.whitespaceWithoutComments$0(); + clauses = A._setArrayType([A.IfClause$0(condition, children)], type$.JSArray_IfClause_2); + while (true) { + if (!_this.scanElse$1(ifIndentation)) { + lastClause = null; + break; + } + _this.whitespace$0(); + if (_this.scanIdentifier$1("if")) { + _this.whitespace$0(); + clauses.push(A.IfClause$0(_this._stylesheet0$_expression$0(), _this.children$1(0, child))); + } else { + lastClause = A.ElseClause$0(_this.children$1(0, child)); + break; + } + } + _this._stylesheet0$_inControlDirective = wasInControlDirective; + span = _this.scanner.spanFrom$1(start); + _this.whitespaceWithoutComments$0(); + return new A.IfRule0(A.List_List$unmodifiable(clauses, type$.IfClause_2), lastClause, span); + }, + _stylesheet0$_importRule$1(start) { + var argument, t3, _this = this, + imports = A._setArrayType([], type$.JSArray_Import_2), + t1 = _this.scanner, + t2 = _this.logger; + do { + _this.whitespace$0(); + argument = _this.importArgument$0(); + t3 = argument instanceof A.DynamicImport0; + if (t3) + A.WarnForDeprecation_warnForDeprecation0(t2, B.Deprecation_import_true_import, string$.Sass__, argument.span, null); + if ((_this._stylesheet0$_inControlDirective || _this._stylesheet0$_inMixin) && t3) + _this._stylesheet0$_disallowedAtRule$1(start); + imports.push(argument); + _this.whitespace$0(); + } while (t1.scanChar$1(44)); + _this.expectStatementSeparator$1("@import rule"); + t1 = t1.spanFrom$1(start); + return new A.ImportRule0(A.List_List$unmodifiable(imports, type$.Import_2), t1); + }, + importArgument$0() { + var url, urlSpan, innerError, stackTrace, modifiers, t2, exception, _this = this, + t1 = _this.scanner, + start = new A._SpanScannerState(t1, t1._string_scanner$_position), + _0_0 = t1.peekChar$0(); + if (117 === _0_0 || 85 === _0_0) { + url = _this.dynamicUrl$0(); + _this.whitespace$0(); + modifiers = _this.tryImportModifiers$0(); + return new A.StaticImport0(A.Interpolation$0(A._setArrayType([url], type$.JSArray_Object), t1.spanFrom$1(start)), modifiers, t1.spanFrom$1(start)); + } + url = _this.string$0(); + urlSpan = t1.spanFrom$1(start); + _this.whitespace$0(); + modifiers = _this.tryImportModifiers$0(); + if (_this.isPlainImportUrl$1(url) || modifiers != null) { + t2 = urlSpan; + return new A.StaticImport0(A.Interpolation$0(A._setArrayType([A.String_String$fromCharCodes(B.NativeUint32List_methods.sublist$2(t2.file._decodedChars, t2._file$_start, t2._end), 0, null)], type$.JSArray_Object), urlSpan), modifiers, t1.spanFrom$1(start)); + } else + try { + t1 = _this.parseImportUrl$1(url); + return new A.DynamicImport0(t1, urlSpan); + } catch (exception) { + t1 = A.unwrapException(exception); + if (type$.FormatException._is(t1)) { + innerError = t1; + stackTrace = A.getTraceFromException(exception); + _this.error$3(0, "Invalid URL: " + J.get$message$x(innerError), urlSpan, stackTrace); + } else + throw exception; + } + }, + parseImportUrl$1(url) { + var t1 = $.$get$windows(); + if (t1.style.rootLength$1(url) > 0 && !$.$get$url().style.isRootRelative$1(url)) + return t1.toUri$1(url).toString$0(0); + A.Uri_parse(url); + return url; + }, + isPlainImportUrl$1(url) { + var _0_0, t1; + if (url.length < 5) + return false; + if (B.JSString_methods.endsWith$1(url, ".css")) + return true; + _0_0 = url.charCodeAt(0); + $label0$0: { + if (47 === _0_0) { + t1 = url.charCodeAt(1) === 47; + break $label0$0; + } + if (104 === _0_0) { + t1 = B.JSString_methods.startsWith$1(url, "http://") || B.JSString_methods.startsWith$1(url, "https://"); + break $label0$0; + } + t1 = false; + break $label0$0; + } + return t1; + }, + tryImportModifiers$0() { + var t1, start, t2, t3, buffer, identifier, t4, $name, query, endPosition, t5, result, _this = this; + if (!_this._stylesheet0$_lookingAtInterpolatedIdentifier$0() && _this.scanner.peekChar$0() !== 40) + return null; + t1 = _this.scanner; + start = new A._SpanScannerState(t1, t1._string_scanner$_position); + t2 = new A.StringBuffer(""); + t3 = A._setArrayType([], type$.JSArray_Object); + buffer = new A.InterpolationBuffer0(t2, t3); + for (; true;) + if (_this._stylesheet0$_lookingAtInterpolatedIdentifier$0()) { + if (!(t3.length === 0 && t2._contents.length === 0)) + t2._contents += A.Primitives_stringFromCharCode(32); + identifier = _this.interpolatedIdentifier$0(); + buffer.addInterpolation$1(identifier); + t4 = identifier.get$asPlain(); + $name = t4 == null ? null : t4.toLowerCase(); + if ($name !== "and" && t1.scanChar$1(40)) { + if ($name === "supports") { + query = _this._stylesheet0$_importSupportsQuery$0(); + t4 = !(query instanceof A.SupportsDeclaration0); + if (t4) + t2._contents += A.Primitives_stringFromCharCode(40); + buffer._interpolation_buffer0$_flushText$0(); + t3.push(new A.SupportsExpression0(query)); + if (t4) + t2._contents += A.Primitives_stringFromCharCode(41); + } else { + t2._contents += A.Primitives_stringFromCharCode(40); + buffer.addInterpolation$1(_this._stylesheet0$_interpolatedDeclarationValue$2$allowEmpty$allowSemicolon(true, true)); + t2._contents += A.Primitives_stringFromCharCode(41); + } + t1.expectChar$1(41); + _this.whitespace$0(); + } else { + _this.whitespace$0(); + if (t1.scanChar$1(44)) { + t2._contents += ", "; + buffer.addInterpolation$1(_this._stylesheet0$_mediaQueryList$0()); + endPosition = t1._string_scanner$_position; + t4 = t1._sourceFile; + t5 = start.position; + t1 = new A._FileSpan(t4, t5, endPosition); + t1._FileSpan$3(t4, t5, endPosition); + t5 = type$.Object; + t4 = A.List_List$of(t3, true, t5); + t3 = t2._contents; + if (t3.length !== 0) + t4.push(t3.charCodeAt(0) == 0 ? t3 : t3); + result = A.List_List$from(t4, false, t5); + result.fixed$length = Array; + result.immutable$list = Array; + t2 = new A.Interpolation0(result, t1); + t2.Interpolation$20(t4, t1); + return t2; + } + } + } else if (t1.peekChar$0() === 40) { + if (!(t3.length === 0 && t2._contents.length === 0)) + t2._contents += A.Primitives_stringFromCharCode(32); + buffer.addInterpolation$1(_this._stylesheet0$_mediaQueryList$0()); + endPosition = t1._string_scanner$_position; + t1 = t1._sourceFile; + t4 = start.position; + t5 = new A._FileSpan(t1, t4, endPosition); + t5._FileSpan$3(t1, t4, endPosition); + t4 = type$.Object; + t3 = A.List_List$of(t3, true, t4); + t1 = t2._contents; + if (t1.length !== 0) + t3.push(t1.charCodeAt(0) == 0 ? t1 : t1); + result = A.List_List$from(t3, false, t4); + result.fixed$length = Array; + result.immutable$list = Array; + t1 = new A.Interpolation0(result, t5); + t1.Interpolation$20(t3, t5); + return t1; + } else { + endPosition = t1._string_scanner$_position; + t1 = t1._sourceFile; + t4 = start.position; + t5 = new A._FileSpan(t1, t4, endPosition); + t5._FileSpan$3(t1, t4, endPosition); + t4 = type$.Object; + t3 = A.List_List$of(t3, true, t4); + t1 = t2._contents; + if (t1.length !== 0) + t3.push(t1.charCodeAt(0) == 0 ? t1 : t1); + result = A.List_List$from(t3, false, t4); + result.fixed$length = Array; + result.immutable$list = Array; + t1 = new A.Interpolation0(result, t5); + t1.Interpolation$20(t3, t5); + return t1; + } + }, + _stylesheet0$_importSupportsQuery$0() { + var t1, t2, _0_0, $name, _this = this; + if (_this.scanIdentifier$1("not")) { + _this.whitespace$0(); + t1 = _this.scanner; + t2 = t1._string_scanner$_position; + return new A.SupportsNegation0(_this._stylesheet0$_supportsConditionInParens$0(), t1.spanFrom$1(new A._SpanScannerState(t1, t2))); + } else { + t1 = _this.scanner; + if (t1.peekChar$0() === 40) + return _this._stylesheet0$_supportsCondition$0(); + else { + _0_0 = _this._stylesheet0$_tryImportSupportsFunction$0(); + if (_0_0 != null) + return _0_0; + t2 = t1._string_scanner$_position; + $name = _this._stylesheet0$_expression$0(); + t1.expectChar$1(58); + return _this._stylesheet0$_supportsDeclarationValue$2($name, new A._SpanScannerState(t1, t2)); + } + } + }, + _stylesheet0$_tryImportSupportsFunction$0() { + var t1, start, $name, value, _this = this; + if (!_this._stylesheet0$_lookingAtInterpolatedIdentifier$0()) + return null; + t1 = _this.scanner; + start = new A._SpanScannerState(t1, t1._string_scanner$_position); + $name = _this.interpolatedIdentifier$0(); + if (!t1.scanChar$1(40)) { + t1.set$state(start); + return null; + } + value = _this._stylesheet0$_interpolatedDeclarationValue$2$allowEmpty$allowSemicolon(true, true); + t1.expectChar$1(41); + return new A.SupportsFunction0($name, value, t1.spanFrom$1(start)); + }, + _stylesheet0$_includeRule$1(start) { + var name0, namespace, $arguments, t2, t3, contentArguments, contentArguments_, wasInContentBlock, $content, _this = this, _null = null, + $name = _this.identifier$0(), + t1 = _this.scanner; + if (t1.scanChar$1(46)) { + name0 = _this._stylesheet0$_publicIdentifier$0(); + namespace = $name; + $name = name0; + } else { + $name = A.stringReplaceAllUnchecked($name, "_", "-"); + namespace = _null; + } + _this.whitespace$0(); + if (t1.peekChar$0() === 40) + $arguments = _this._stylesheet0$_argumentInvocation$1$mixin(true); + else { + t2 = A.FileLocation$_(t1._sourceFile, t1._string_scanner$_position); + t3 = t2.offset; + $arguments = A.ArgumentInvocation$empty0(A._FileSpan$(t2.file, t3, t3)); + } + _this.whitespace$0(); + if (_this.scanIdentifier$1("using")) { + _this.whitespace$0(); + contentArguments = _this._stylesheet0$_argumentDeclaration$0(); + _this.whitespace$0(); + } else + contentArguments = _null; + t2 = contentArguments == null; + if (!t2 || _this.lookingAtChildren$0()) { + if (t2) { + t2 = A.FileLocation$_(t1._sourceFile, t1._string_scanner$_position); + t3 = t2.offset; + contentArguments_ = new A.ArgumentDeclaration0(B.List_empty22, _null, A._FileSpan$(t2.file, t3, t3)); + } else + contentArguments_ = contentArguments; + wasInContentBlock = _this._stylesheet0$_inContentBlock; + _this._stylesheet0$_inContentBlock = true; + $content = _this._stylesheet0$_withChildren$3(_this.get$_stylesheet0$_statement(), start, new A.StylesheetParser__includeRule_closure0(contentArguments_)); + _this._stylesheet0$_inContentBlock = wasInContentBlock; + } else { + _this.expectStatementSeparator$0(); + $content = _null; + } + t1 = t1.spanFrom$2(start, start); + t2 = $content == null ? $arguments : $content; + return new A.IncludeRule0(namespace, $name, $arguments, $content, t1.expand$1(0, t2.get$span(t2))); + }, + mediaRule$1(start) { + return this._stylesheet0$_withChildren$3(this.get$_stylesheet0$_statement(), start, new A.StylesheetParser_mediaRule_closure0(this._stylesheet0$_mediaQueryList$0())); + }, + _stylesheet0$_mixinRule$1(start) { + var $name, t1, $arguments, t2, t3, _this = this, + precedingComment = _this.lastSilentComment; + _this.lastSilentComment = null; + $name = _this.identifier$1$normalize(true); + _this.whitespace$0(); + t1 = _this.scanner; + if (t1.peekChar$0() === 40) + $arguments = _this._stylesheet0$_argumentDeclaration$0(); + else { + t2 = A.FileLocation$_(t1._sourceFile, t1._string_scanner$_position); + t3 = t2.offset; + $arguments = new A.ArgumentDeclaration0(B.List_empty22, null, A._FileSpan$(t2.file, t3, t3)); + } + if (_this._stylesheet0$_inMixin || _this._stylesheet0$_inContentBlock) + _this.error$2(0, string$.Mixinscm, t1.spanFrom$1(start)); + else if (_this._stylesheet0$_inControlDirective) + _this.error$2(0, string$.Mixinsb, t1.spanFrom$1(start)); + _this.whitespace$0(); + _this._stylesheet0$_inMixin = true; + return _this._stylesheet0$_withChildren$3(_this.get$_stylesheet0$_statement(), start, new A.StylesheetParser__mixinRule_closure0(_this, $name, $arguments, precedingComment)); + }, + mozDocumentRule$2(start, $name) { + var t5, t6, identifier, _0_0, argument, trailing, endPosition, t7, t8, start0, end, _this = this, _box_0 = {}, + t1 = _this.scanner, + t2 = t1._string_scanner$_position, + t3 = new A.StringBuffer(""), + t4 = A._setArrayType([], type$.JSArray_Object), + buffer = new A.InterpolationBuffer0(t3, t4); + _box_0.needsDeprecationWarning = false; + for (t5 = _this.get$whitespace(); true;) { + if (t1.peekChar$0() === 35) { + t6 = _this.singleInterpolation$0(); + buffer._interpolation_buffer0$_flushText$0(); + t4.push(t6); + _box_0.needsDeprecationWarning = true; + } else { + t6 = t1._string_scanner$_position; + identifier = _this.identifier$0(); + $label0$0: { + if ("url" === identifier || "url-prefix" === identifier || "domain" === identifier) { + _0_0 = _this._stylesheet0$_tryUrlContents$2$name(new A._SpanScannerState(t1, t6), identifier); + if (_0_0 != null) + buffer.addInterpolation$1(_0_0); + else { + t1.expectChar$1(40); + _this.whitespace$0(); + argument = _this.interpolatedString$0(); + t1.expectChar$1(41); + t3._contents += identifier; + t3._contents += A.Primitives_stringFromCharCode(40); + buffer.addInterpolation$1(argument.asInterpolation$0()); + t3._contents += A.Primitives_stringFromCharCode(41); + } + t6 = t3._contents; + trailing = t6.charCodeAt(0) == 0 ? t6 : t6; + if (!B.JSString_methods.endsWith$1(trailing, "url-prefix()") && !B.JSString_methods.endsWith$1(trailing, "url-prefix('')") && !B.JSString_methods.endsWith$1(trailing, 'url-prefix("")')) + _box_0.needsDeprecationWarning = true; + break $label0$0; + } + if ("regexp" === identifier) { + t3._contents += "regexp("; + t1.expectChar$1(40); + buffer.addInterpolation$1(_this.interpolatedString$0().asInterpolation$0()); + t1.expectChar$1(41); + t3._contents += A.Primitives_stringFromCharCode(41); + _box_0.needsDeprecationWarning = true; + break $label0$0; + } + endPosition = t1._string_scanner$_position; + t7 = t1._sourceFile; + t8 = new A._FileSpan(t7, t6, endPosition); + t8._FileSpan$3(t7, t6, endPosition); + _this.error$2(0, "Invalid function name.", t8); + } + } + _this.whitespace$0(); + if (!t1.scanChar$1(44)) + break; + t3._contents += A.Primitives_stringFromCharCode(44); + start0 = t1._string_scanner$_position; + t5.call$0(); + end = t1._string_scanner$_position; + t3._contents += B.JSString_methods.substring$2(t1.string, start0, end); + } + return _this._stylesheet0$_withChildren$3(_this.get$_stylesheet0$_statement(), start, new A.StylesheetParser_mozDocumentRule_closure0(_box_0, _this, $name, buffer.interpolation$1(t1.spanFrom$1(new A._SpanScannerState(t1, t2))))); + }, + supportsRule$1(start) { + var _this = this, + condition = _this._stylesheet0$_supportsCondition$0(); + _this.whitespace$0(); + return _this._stylesheet0$_withChildren$3(_this.get$_stylesheet0$_statement(), start, new A.StylesheetParser_supportsRule_closure0(condition)); + }, + _stylesheet0$_useNamespace$2(url, start) { + var namespace, basename, dot, t1, exception, _this = this; + if (_this.scanIdentifier$1("as")) { + _this.whitespace$0(); + return _this.scanner.scanChar$1(42) ? null : _this.identifier$0(); + } + basename = url.get$pathSegments().length === 0 ? "" : B.JSArray_methods.get$last(url.get$pathSegments()); + dot = B.JSString_methods.indexOf$1(basename, "."); + t1 = B.JSString_methods.startsWith$1(basename, "_") ? 1 : 0; + namespace = B.JSString_methods.substring$2(basename, t1, dot === -1 ? basename.length : dot); + try { + t1 = A.SpanScanner$(namespace, null); + t1 = new A.Parser1(t1, _this.logger, null)._parser0$_parseIdentifier$0(); + return t1; + } catch (exception) { + if (type$.SassFormatException_2._is(A.unwrapException(exception))) + _this.error$2(0, 'The default namespace "' + A.S(namespace) + string$.x22x20is_n, _this.scanner.spanFrom$1(start)); + else + throw exception; + } + }, + _stylesheet0$_configuration$1$allowGuarded(allowGuarded) { + var variableNames, configuration, t1, t2, $name, expression, t3, guarded, endPosition, t4, t5, span, _this = this; + if (!_this.scanIdentifier$1("with")) + return null; + variableNames = A.LinkedHashSet_LinkedHashSet$_empty(type$.String); + configuration = A._setArrayType([], type$.JSArray_ConfiguredVariable_2); + _this.whitespace$0(); + t1 = _this.scanner; + t1.expectChar$1(40); + for (; true;) { + _this.whitespace$0(); + t2 = t1._string_scanner$_position; + t1.expectChar$1(36); + $name = _this.identifier$1$normalize(true); + _this.whitespace$0(); + t1.expectChar$1(58); + _this.whitespace$0(); + expression = _this.expressionUntilComma$0(); + t3 = t1._string_scanner$_position; + if (allowGuarded && t1.scanChar$1(33)) + if (_this.identifier$0() === "default") { + _this.whitespace$0(); + guarded = true; + } else { + endPosition = t1._string_scanner$_position; + t4 = t1._sourceFile; + t5 = new A._FileSpan(t4, t3, endPosition); + t5._FileSpan$3(t4, t3, endPosition); + _this.error$2(0, "Invalid flag name.", t5); + guarded = false; + } + else + guarded = false; + endPosition = t1._string_scanner$_position; + t3 = t1._sourceFile; + span = new A._FileSpan(t3, t2, endPosition); + span._FileSpan$3(t3, t2, endPosition); + if (variableNames.contains$1(0, $name)) + _this.error$2(0, string$.The_sa, span); + variableNames.add$1(0, $name); + configuration.push(new A.ConfiguredVariable0($name, expression, guarded, span)); + if (!t1.scanChar$1(44)) + break; + _this.whitespace$0(); + if (!_this._stylesheet0$_lookingAtExpression$0()) + break; + } + t1.expectChar$1(41); + return configuration; + }, + _stylesheet0$_configuration$0() { + return this._stylesheet0$_configuration$1$allowGuarded(false); + }, + _stylesheet0$_warnRule$1(start) { + var value = this._stylesheet0$_expression$0(); + this.expectStatementSeparator$1("@warn rule"); + return new A.WarnRule0(value, this.scanner.spanFrom$1(start)); + }, + _stylesheet0$_whileRule$2(start, child) { + var _this = this, + wasInControlDirective = _this._stylesheet0$_inControlDirective; + _this._stylesheet0$_inControlDirective = true; + return _this._stylesheet0$_withChildren$3(child, start, new A.StylesheetParser__whileRule_closure0(_this, wasInControlDirective, _this._stylesheet0$_expression$0())); + }, + unknownAtRule$2(start, $name) { + var t2, t3, rule, _this = this, t1 = {}, + wasInUnknownAtRule = _this._stylesheet0$_inUnknownAtRule; + _this._stylesheet0$_inUnknownAtRule = true; + t1.value = null; + t2 = _this.scanner; + t3 = t2.peekChar$0() !== 33 && !_this.atEndOfStatement$0() ? t1.value = _this.almostAnyValue$0() : null; + if (_this.lookingAtChildren$0()) + rule = _this._stylesheet0$_withChildren$3(_this.get$_stylesheet0$_statement(), start, new A.StylesheetParser_unknownAtRule_closure0(t1, $name)); + else { + _this.expectStatementSeparator$0(); + rule = A.AtRule$0($name, t2.spanFrom$1(start), null, t3); + } + _this._stylesheet0$_inUnknownAtRule = wasInUnknownAtRule; + return rule; + }, + _stylesheet0$_disallowedAtRule$1(start) { + this.almostAnyValue$0(); + this.error$2(0, "This at-rule is not allowed here.", this.scanner.spanFrom$1(start)); + }, + _stylesheet0$_argumentDeclaration$0() { + var $arguments, named, restArgument, t3, $name, defaultValue, endPosition, t4, t5, _this = this, + t1 = _this.scanner, + t2 = t1._string_scanner$_position; + t1.expectChar$1(40); + _this.whitespace$0(); + $arguments = A._setArrayType([], type$.JSArray_Argument_2); + named = A.LinkedHashSet_LinkedHashSet$_empty(type$.String); + while (true) { + if (!(t1.peekChar$0() === 36)) { + restArgument = null; + break; + } + t3 = t1._string_scanner$_position; + t1.expectChar$1(36); + $name = _this.identifier$1$normalize(true); + _this.whitespace$0(); + if (t1.scanChar$1(58)) { + _this.whitespace$0(); + defaultValue = _this.expressionUntilComma$0(); + } else { + if (t1.scanChar$1(46)) { + t1.expectChar$1(46); + t1.expectChar$1(46); + _this.whitespace$0(); + restArgument = $name; + break; + } + defaultValue = null; + } + endPosition = t1._string_scanner$_position; + t4 = t1._sourceFile; + t5 = new A._FileSpan(t4, t3, endPosition); + t5._FileSpan$3(t4, t3, endPosition); + $arguments.push(new A.Argument0($name, defaultValue, t5)); + if (!named.add$1(0, $name)) + _this.error$2(0, "Duplicate argument.", B.JSArray_methods.get$last($arguments).span); + if (!t1.scanChar$1(44)) { + restArgument = null; + break; + } + _this.whitespace$0(); + } + t1.expectChar$1(41); + t1 = t1.spanFrom$1(new A._SpanScannerState(t1, t2)); + return new A.ArgumentDeclaration0(A.List_List$unmodifiable($arguments, type$.Argument_2), restArgument, t1); + }, + _stylesheet0$_argumentInvocation$2$allowEmptySecondArg$mixin(allowEmptySecondArg, mixin) { + var positional, t3, t4, named, keywordRest, t5, rest, expression, t6, t7, result, _this = this, _null = null, + t1 = _this.scanner, + t2 = t1._string_scanner$_position; + t1.expectChar$1(40); + _this.whitespace$0(); + positional = A._setArrayType([], type$.JSArray_Expression_2); + t3 = type$.String; + t4 = type$.Expression_2; + named = A.LinkedHashMap_LinkedHashMap$_empty(t3, t4); + t5 = !mixin; + rest = _null; + while (true) { + if (!_this._stylesheet0$_lookingAtExpression$0()) { + keywordRest = _null; + break; + } + expression = _this.expressionUntilComma$1$singleEquals(t5); + _this.whitespace$0(); + if (expression instanceof A.VariableExpression0 && t1.scanChar$1(58)) { + _this.whitespace$0(); + t6 = expression.name; + if (named.containsKey$1(t6)) + _this.error$2(0, "Duplicate argument.", expression.span); + named.$indexSet(0, t6, _this.expressionUntilComma$1$singleEquals(t5)); + } else if (t1.scanChar$1(46)) { + t1.expectChar$1(46); + t1.expectChar$1(46); + if (rest != null) { + _this.whitespace$0(); + keywordRest = expression; + break; + } + rest = expression; + } else if (named.__js_helper$_length !== 0) + _this.error$2(0, string$.Positi, expression.get$span(expression)); + else + positional.push(expression); + _this.whitespace$0(); + if (!t1.scanChar$1(44)) { + keywordRest = _null; + break; + } + _this.whitespace$0(); + if (allowEmptySecondArg && positional.length === 1 && named.__js_helper$_length === 0 && rest == null && t1.peekChar$0() === 41) { + t5 = t1._sourceFile; + t6 = t1._string_scanner$_position; + new A.FileLocation(t5, t6).FileLocation$_$2(t5, t6); + t7 = new A._FileSpan(t5, t6, t6); + t7._FileSpan$3(t5, t6, t6); + t6 = A._setArrayType([""], type$.JSArray_Object); + result = A.List_List$from(t6, false, type$.Object); + result.fixed$length = Array; + result.immutable$list = Array; + t5 = new A.Interpolation0(result, t7); + t5.Interpolation$20(t6, t7); + positional.push(new A.StringExpression0(t5, false)); + keywordRest = _null; + break; + } + } + t1.expectChar$1(41); + t1 = t1.spanFrom$1(new A._SpanScannerState(t1, t2)); + return new A.ArgumentInvocation0(A.List_List$unmodifiable(positional, t4), A.ConstantMap_ConstantMap$from(named, t3, t4), rest, keywordRest, t1); + }, + _stylesheet0$_argumentInvocation$0() { + return this._stylesheet0$_argumentInvocation$2$allowEmptySecondArg$mixin(false, false); + }, + _stylesheet0$_argumentInvocation$1$allowEmptySecondArg(allowEmptySecondArg) { + return this._stylesheet0$_argumentInvocation$2$allowEmptySecondArg$mixin(allowEmptySecondArg, false); + }, + _stylesheet0$_argumentInvocation$1$mixin(mixin) { + return this._stylesheet0$_argumentInvocation$2$allowEmptySecondArg$mixin(false, mixin); + }, + _stylesheet0$_expression$3$bracketList$singleEquals$until(bracketList, singleEquals, until) { + var t2, beforeBracket, start, wasInExpression, wasInParentheses, resetState, resolveOneOperation, resolveOperations, addSingleExpression, addOperator, resolveSpaceExpressions, t3, _3_0, _1_0, t4, _3_28, _2_0, _3_32, _3_40, commaExpressions, spaceExpressions, singleExpression, _this = this, + _s20_ = "Expected expression.", + _box_0 = {}, + t1 = until != null; + if (t1 && until.call$0()) + _this.scanner.error$1(0, _s20_); + if (bracketList) { + t2 = _this.scanner; + beforeBracket = new A._SpanScannerState(t2, t2._string_scanner$_position); + t2.expectChar$1(91); + _this.whitespace$0(); + if (t2.scanChar$1(93)) { + t1 = A._setArrayType([], type$.JSArray_Expression_2); + t2 = t2.spanFrom$1(beforeBracket); + return new A.ListExpression0(A.List_List$unmodifiable(t1, type$.Expression_2), B.ListSeparator_undecided_null_undecided0, true, t2); + } + } else + beforeBracket = null; + t2 = _this.scanner; + start = new A._SpanScannerState(t2, t2._string_scanner$_position); + wasInExpression = _this._stylesheet0$_inExpression; + wasInParentheses = _this._stylesheet0$_inParentheses; + _this._stylesheet0$_inExpression = true; + _box_0.operands_ = _box_0.operators_ = _box_0.spaceExpressions_ = _box_0.commaExpressions_ = null; + _box_0.allowSlash = true; + _box_0.singleExpression_ = _this._stylesheet0$_singleExpression$0(); + resetState = new A.StylesheetParser__expression_resetState0(_box_0, _this, start); + resolveOneOperation = new A.StylesheetParser__expression_resolveOneOperation0(_box_0, _this); + resolveOperations = new A.StylesheetParser__expression_resolveOperations0(_box_0, resolveOneOperation); + addSingleExpression = new A.StylesheetParser__expression_addSingleExpression0(_box_0, _this, resetState, resolveOperations); + addOperator = new A.StylesheetParser__expression_addOperator0(_box_0, _this, resolveOneOperation); + resolveSpaceExpressions = new A.StylesheetParser__expression_resolveSpaceExpressions0(_box_0, _this, resolveOperations); + for (t3 = type$.JSArray_Expression_2; true;) { + _this.whitespace$0(); + if (t1 && until.call$0()) + break; + _3_0 = t2.peekChar$0(); + if (_3_0 == null) + break; + if (40 === _3_0) { + addSingleExpression.call$1(_this.parentheses$0()); + continue; + } + if (91 === _3_0) { + addSingleExpression.call$1(_this._stylesheet0$_expression$1$bracketList(true)); + continue; + } + if (36 === _3_0) { + addSingleExpression.call$1(_this._stylesheet0$_variable$0()); + continue; + } + if (38 === _3_0) { + addSingleExpression.call$1(_this._stylesheet0$_selector$0()); + continue; + } + if (39 === _3_0 || 34 === _3_0) { + addSingleExpression.call$1(_this.interpolatedString$0()); + continue; + } + if (35 === _3_0) { + addSingleExpression.call$1(_this._stylesheet0$_hashExpression$0()); + continue; + } + if (61 === _3_0) { + t2.readChar$0(); + if (singleEquals && t2.peekChar$0() !== 61) + addOperator.call$1(B.BinaryOperator_2jN0); + else { + t2.expectChar$1(61); + addOperator.call$1(B.BinaryOperator_ql50); + } + continue; + } + if (33 === _3_0) { + $label0$1: { + _1_0 = t2.peekChar$1(1); + if (61 === _1_0) { + t2.readChar$0(); + t2.readChar$0(); + addOperator.call$1(B.BinaryOperator_ViB0); + break $label0$1; + } + if (_1_0 != null) + if (105 !== _1_0) + if (73 !== _1_0) + t4 = _1_0 === 32 || _1_0 === 9 || _1_0 === 10 || _1_0 === 13 || _1_0 === 12; + else + t4 = true; + else + t4 = true; + else + t4 = true; + if (t4) { + addSingleExpression.call$1(_this._stylesheet0$_importantExpression$0()); + break $label0$1; + } + break; + } + continue; + } + if (60 === _3_0) { + t2.readChar$0(); + addOperator.call$1(t2.scanChar$1(61) ? B.BinaryOperator_kpg0 : B.BinaryOperator_U8c0); + continue; + } + if (62 === _3_0) { + t2.readChar$0(); + addOperator.call$1(t2.scanChar$1(61) ? B.BinaryOperator_7Tg0 : B.BinaryOperator_cIH0); + continue; + } + if (42 === _3_0) { + t2.readChar$0(); + addOperator.call$1(B.BinaryOperator_qN20); + continue; + } + _3_28 = 43 === _3_0; + if (_3_28 && _box_0.singleExpression_ == null) { + addSingleExpression.call$1(_this._stylesheet0$_unaryOperation$0()); + continue; + } + if (_3_28) { + t2.readChar$0(); + addOperator.call$1(B.BinaryOperator_anB0); + continue; + } + if (45 === _3_0) { + _2_0 = t2.peekChar$1(1); + if (A._isInt(_2_0) && _2_0 >= 48 && _2_0 <= 57 || 46 === _2_0) + if (_box_0.singleExpression_ != null) { + t4 = t2.peekChar$1(-1); + t4 = t4 === 32 || t4 === 9 || t4 === 10 || t4 === 13 || t4 === 12; + } else + t4 = true; + else + t4 = false; + if (t4) + addSingleExpression.call$1(_this._stylesheet0$_number$0()); + else if (_this._stylesheet0$_lookingAtInterpolatedIdentifier$0()) + addSingleExpression.call$1(_this.identifierLike$0()); + else if (_box_0.singleExpression_ == null) + addSingleExpression.call$1(_this._stylesheet0$_unaryOperation$0()); + else { + t2.readChar$0(); + addOperator.call$1(B.BinaryOperator_olz0); + } + continue; + } + _3_32 = 47 === _3_0; + if (_3_32 && _box_0.singleExpression_ == null) { + addSingleExpression.call$1(_this._stylesheet0$_unaryOperation$0()); + continue; + } + if (_3_32) { + t2.readChar$0(); + addOperator.call$1(B.BinaryOperator_t8B0); + continue; + } + if (37 === _3_0) { + t2.readChar$0(); + addOperator.call$1(B.BinaryOperator_OTG0); + continue; + } + if (_3_0 >= 48 && _3_0 <= 57) { + addSingleExpression.call$1(_this._stylesheet0$_number$0()); + continue; + } + _3_40 = 46 === _3_0; + if (_3_40 && t2.peekChar$1(1) === 46) + break; + if (_3_40) { + addSingleExpression.call$1(_this._stylesheet0$_number$0()); + continue; + } + if (97 === _3_0 && !_this.get$plainCss() && _this.scanIdentifier$1("and")) { + addOperator.call$1(B.BinaryOperator_SNp0); + continue; + } + if (111 === _3_0 && !_this.get$plainCss() && _this.scanIdentifier$1("or")) { + addOperator.call$1(B.BinaryOperator_M6L0); + continue; + } + if ((117 === _3_0 || 85 === _3_0) && t2.peekChar$1(1) === 43) { + addSingleExpression.call$1(_this._stylesheet0$_unicodeRange$0()); + continue; + } + if (!(_3_0 >= 97 && _3_0 <= 122)) + t4 = _3_0 >= 65 && _3_0 <= 90 || 95 === _3_0 || 92 === _3_0 || _3_0 >= 128; + else + t4 = true; + if (t4) { + addSingleExpression.call$1(_this.identifierLike$0()); + continue; + } + if (44 === _3_0) { + if (_this._stylesheet0$_inParentheses) { + _this._stylesheet0$_inParentheses = false; + if (_box_0.allowSlash) { + resetState.call$0(); + continue; + } + } + commaExpressions = _box_0.commaExpressions_; + if (commaExpressions == null) + commaExpressions = _box_0.commaExpressions_ = A._setArrayType([], t3); + if (_box_0.singleExpression_ == null) + t2.error$1(0, _s20_); + resolveSpaceExpressions.call$0(); + t4 = _box_0.singleExpression_; + t4.toString; + commaExpressions.push(t4); + t2.readChar$0(); + _box_0.allowSlash = true; + _box_0.singleExpression_ = null; + continue; + } + break; + } + if (bracketList) + t2.expectChar$1(93); + commaExpressions = _box_0.commaExpressions_; + spaceExpressions = _box_0.spaceExpressions_; + if (commaExpressions != null) { + resolveSpaceExpressions.call$0(); + _this._stylesheet0$_inParentheses = wasInParentheses; + singleExpression = _box_0.singleExpression_; + if (singleExpression != null) + commaExpressions.push(singleExpression); + _this._stylesheet0$_inExpression = wasInExpression; + t1 = t2.spanFrom$1(beforeBracket == null ? start : beforeBracket); + return new A.ListExpression0(A.List_List$unmodifiable(commaExpressions, type$.Expression_2), B.ListSeparator_rXA0, bracketList, t1); + } else if (bracketList && spaceExpressions != null) { + resolveOperations.call$0(); + _this._stylesheet0$_inExpression = wasInExpression; + t1 = _box_0.singleExpression_; + t1.toString; + spaceExpressions.push(t1); + beforeBracket.toString; + t2 = t2.spanFrom$1(beforeBracket); + return new A.ListExpression0(A.List_List$unmodifiable(spaceExpressions, type$.Expression_2), B.ListSeparator_EVt0, true, t2); + } else { + resolveSpaceExpressions.call$0(); + if (bracketList) { + t1 = _box_0.singleExpression_; + t1.toString; + t3 = A._setArrayType([t1], t3); + beforeBracket.toString; + t2 = t2.spanFrom$1(beforeBracket); + _box_0.singleExpression_ = new A.ListExpression0(A.List_List$unmodifiable(t3, type$.Expression_2), B.ListSeparator_undecided_null_undecided0, true, t2); + } + _this._stylesheet0$_inExpression = wasInExpression; + t1 = _box_0.singleExpression_; + t1.toString; + return t1; + } + }, + _stylesheet0$_expression$2$singleEquals$until(singleEquals, until) { + return this._stylesheet0$_expression$3$bracketList$singleEquals$until(false, singleEquals, until); + }, + _stylesheet0$_expression$1$bracketList(bracketList) { + return this._stylesheet0$_expression$3$bracketList$singleEquals$until(bracketList, false, null); + }, + _stylesheet0$_expression$0() { + return this._stylesheet0$_expression$3$bracketList$singleEquals$until(false, false, null); + }, + _stylesheet0$_expression$1$until(until) { + return this._stylesheet0$_expression$3$bracketList$singleEquals$until(false, false, until); + }, + expressionUntilComma$1$singleEquals(singleEquals) { + return this._stylesheet0$_expression$2$singleEquals$until(singleEquals, new A.StylesheetParser_expressionUntilComma_closure0(this)); + }, + expressionUntilComma$0() { + return this.expressionUntilComma$1$singleEquals(false); + }, + _stylesheet0$_isSlashOperand$1(expression) { + var t1; + if (!(expression instanceof A.NumberExpression0)) + if (!(expression instanceof A.FunctionExpression0)) + t1 = expression instanceof A.BinaryOperationExpression0 && expression.allowsSlash; + else + t1 = true; + else + t1 = true; + return t1; + }, + _stylesheet0$_singleExpression$0() { + var next, t2, _this = this, + _s20_ = "Expected expression.", + t1 = _this.scanner, + _0_0 = t1.peekChar$0(); + $label0$0: { + if (_0_0 == null) + t1.error$1(0, _s20_); + if (40 === _0_0) { + t1 = _this.parentheses$0(); + break $label0$0; + } + if (47 === _0_0) { + t1 = _this._stylesheet0$_unaryOperation$0(); + break $label0$0; + } + if (46 === _0_0) { + t1 = _this._stylesheet0$_number$0(); + break $label0$0; + } + if (91 === _0_0) { + t1 = _this._stylesheet0$_expression$1$bracketList(true); + break $label0$0; + } + if (36 === _0_0) { + t1 = _this._stylesheet0$_variable$0(); + break $label0$0; + } + if (38 === _0_0) { + t1 = _this._stylesheet0$_selector$0(); + break $label0$0; + } + if (39 === _0_0 || 34 === _0_0) { + t1 = _this.interpolatedString$0(); + break $label0$0; + } + if (35 === _0_0) { + t1 = _this._stylesheet0$_hashExpression$0(); + break $label0$0; + } + if (43 === _0_0) { + next = t1.peekChar$1(1); + t1 = next != null && next >= 48 && next <= 57 || next === 46 ? _this._stylesheet0$_number$0() : _this._stylesheet0$_unaryOperation$0(); + break $label0$0; + } + if (45 === _0_0) { + t1 = _this._stylesheet0$_minusExpression$0(); + break $label0$0; + } + if (33 === _0_0) { + t1 = _this._stylesheet0$_importantExpression$0(); + break $label0$0; + } + if ((117 === _0_0 || 85 === _0_0) && t1.peekChar$1(1) === 43) { + t1 = _this._stylesheet0$_unicodeRange$0(); + break $label0$0; + } + if (_0_0 >= 48 && _0_0 <= 57) { + t1 = _this._stylesheet0$_number$0(); + break $label0$0; + } + if (!(_0_0 >= 97 && _0_0 <= 122)) + t2 = _0_0 >= 65 && _0_0 <= 90 || 95 === _0_0 || 92 === _0_0 || _0_0 >= 128; + else + t2 = true; + if (t2) { + t1 = _this.identifierLike$0(); + break $label0$0; + } + t1 = t1.error$1(0, _s20_); + } + return t1; + }, + parentheses$0() { + var start, first, expressions, t1, t2, _this = this, + wasInParentheses = _this._stylesheet0$_inParentheses; + _this._stylesheet0$_inParentheses = true; + try { + t1 = _this.scanner; + start = new A._SpanScannerState(t1, t1._string_scanner$_position); + t1.expectChar$1(40); + _this.whitespace$0(); + if (!_this._stylesheet0$_lookingAtExpression$0()) { + t1.expectChar$1(41); + t2 = A._setArrayType([], type$.JSArray_Expression_2); + t1 = t1.spanFrom$1(start); + t2 = A.List_List$unmodifiable(t2, type$.Expression_2); + return new A.ListExpression0(t2, B.ListSeparator_undecided_null_undecided0, false, t1); + } + first = _this.expressionUntilComma$0(); + if (t1.scanChar$1(58)) { + _this.whitespace$0(); + t1 = _this._stylesheet0$_map$2(first, start); + return t1; + } + if (!t1.scanChar$1(44)) { + t1.expectChar$1(41); + t1 = t1.spanFrom$1(start); + return new A.ParenthesizedExpression0(first, t1); + } + _this.whitespace$0(); + expressions = A._setArrayType([first], type$.JSArray_Expression_2); + for (; true;) { + if (!_this._stylesheet0$_lookingAtExpression$0()) + break; + J.add$1$ax(expressions, _this.expressionUntilComma$0()); + if (!t1.scanChar$1(44)) + break; + _this.whitespace$0(); + } + t1.expectChar$1(41); + t1 = t1.spanFrom$1(start); + t2 = A.List_List$unmodifiable(expressions, type$.Expression_2); + return new A.ListExpression0(t2, B.ListSeparator_rXA0, false, t1); + } finally { + _this._stylesheet0$_inParentheses = wasInParentheses; + } + }, + _stylesheet0$_map$2(first, start) { + var t1, key, _this = this, + pairs = A._setArrayType([new A._Record_2(first, _this.expressionUntilComma$0())], type$.JSArray_Record_2_Expression_and_Expression_2); + for (t1 = _this.scanner; t1.scanChar$1(44);) { + _this.whitespace$0(); + if (!_this._stylesheet0$_lookingAtExpression$0()) + break; + key = _this.expressionUntilComma$0(); + t1.expectChar$1(58); + _this.whitespace$0(); + pairs.push(new A._Record_2(key, _this.expressionUntilComma$0())); + } + t1.expectChar$1(41); + t1 = t1.spanFrom$1(start); + return new A.MapExpression0(A.List_List$unmodifiable(pairs, type$.Record_2_Expression_and_Expression_2), t1); + }, + _stylesheet0$_hashExpression$0() { + var start, t2, identifier, buffer, _this = this, + t1 = _this.scanner; + if (t1.peekChar$1(1) === 123) + return _this.identifierLike$0(); + start = new A._SpanScannerState(t1, t1._string_scanner$_position); + t1.expectChar$1(35); + t2 = t1.peekChar$0(); + if (t2 == null) + t2 = null; + else + t2 = t2 >= 48 && t2 <= 57; + if (t2 === true) + return new A.ColorExpression0(_this._stylesheet0$_hexColorContents$1(start), t1.spanFrom$1(start)); + t2 = t1._string_scanner$_position; + identifier = _this.interpolatedIdentifier$0(); + if (_this._stylesheet0$_isHexColor$1(identifier)) { + t1.set$state(new A._SpanScannerState(t1, t2)); + return new A.ColorExpression0(_this._stylesheet0$_hexColorContents$1(start), t1.spanFrom$1(start)); + } + t2 = new A.StringBuffer(""); + buffer = new A.InterpolationBuffer0(t2, A._setArrayType([], type$.JSArray_Object)); + t2._contents += A.Primitives_stringFromCharCode(35); + buffer.addInterpolation$1(identifier); + return new A.StringExpression0(buffer.interpolation$1(t1.spanFrom$1(start)), false); + }, + _stylesheet0$_hexColorContents$1(start) { + var red, green, blue, alpha, digit4, t2, t3, t4, _this = this, + digit1 = _this._stylesheet0$_hexDigit$0(), + digit2 = _this._stylesheet0$_hexDigit$0(), + digit3 = _this._stylesheet0$_hexDigit$0(), + t1 = _this.scanner, + $self = t1.peekChar$0(); + if (!($self != null && A.CharacterExtension_get_isHex0($self))) { + red = (digit1 << 4 >>> 0) + digit1; + green = (digit2 << 4 >>> 0) + digit2; + blue = (digit3 << 4 >>> 0) + digit3; + alpha = null; + } else { + digit4 = _this._stylesheet0$_hexDigit$0(); + $self = t1.peekChar$0(); + t2 = $self != null && A.CharacterExtension_get_isHex0($self); + t3 = digit1 << 4 >>> 0; + t4 = digit3 << 4 >>> 0; + if (!t2) { + red = t3 + digit1; + green = (digit2 << 4 >>> 0) + digit2; + blue = t4 + digit3; + alpha = ((digit4 << 4 >>> 0) + digit4) / 255; + } else { + red = t3 + digit2; + green = t4 + digit4; + blue = (_this._stylesheet0$_hexDigit$0() << 4 >>> 0) + _this._stylesheet0$_hexDigit$0(); + $self = t1.peekChar$0(); + alpha = $self != null && A.CharacterExtension_get_isHex0($self) ? ((_this._stylesheet0$_hexDigit$0() << 4 >>> 0) + _this._stylesheet0$_hexDigit$0()) / 255 : null; + } + } + t2 = alpha == null; + t3 = t2 ? 1 : alpha; + return A.SassColor$rgbInternal0(red, green, blue, t3, t2 ? new A.SpanColorFormat0(t1.spanFrom$1(start)) : null); + }, + _stylesheet0$_isHexColor$1(interpolation) { + var _0_2, t1, + plain = interpolation.get$asPlain(); + if (typeof plain == "string") { + _0_2 = plain.length; + if (3 !== _0_2) + if (4 !== _0_2) + if (6 !== _0_2) + t1 = 8 === _0_2; + else + t1 = true; + else + t1 = true; + else + t1 = true; + } else + t1 = false; + if (t1) { + t1 = new A.CodeUnits(plain); + return t1.every$1(t1, new A.StylesheetParser__isHexColor_closure0()); + } else + return false; + }, + _stylesheet0$_hexDigit$0() { + var t1 = this.scanner, + t2 = t1.peekChar$0(); + t2 = t2 == null ? null : A.CharacterExtension_get_isHex0(t2); + return t2 === true ? A.asHex0(t1.readChar$0()) : t1.error$1(0, "Expected hex digit."); + }, + _stylesheet0$_minusExpression$0() { + var _this = this, + _0_0 = _this.scanner.peekChar$1(1); + if (A._isInt(_0_0) && _0_0 >= 48 && _0_0 <= 57 || 46 === _0_0) + return _this._stylesheet0$_number$0(); + if (_this._stylesheet0$_lookingAtInterpolatedIdentifier$0()) + return _this.identifierLike$0(); + return _this._stylesheet0$_unaryOperation$0(); + }, + _stylesheet0$_importantExpression$0() { + var t1 = this.scanner, + t2 = t1._string_scanner$_position; + t1.readChar$0(); + this.whitespace$0(); + this.expectIdentifier$1("important"); + t2 = t1.spanFrom$1(new A._SpanScannerState(t1, t2)); + return new A.StringExpression0(A.Interpolation$0(A._setArrayType(["!important"], type$.JSArray_Object), t2), false); + }, + _stylesheet0$_unaryOperation$0() { + var _this = this, + t1 = _this.scanner, + t2 = t1._string_scanner$_position, + operator = _this._stylesheet0$_unaryOperatorFor$1(t1.readChar$0()); + if (operator == null) + t1.error$2$position(0, "Expected unary operator.", t1._string_scanner$_position - 1); + else if (_this.get$plainCss() && operator !== B.UnaryOperator_Ix10) + t1.error$3$length$position(0, "Operators aren't allowed in plain CSS.", 1, t1._string_scanner$_position - 1); + _this.whitespace$0(); + return new A.UnaryOperationExpression0(operator, _this._stylesheet0$_singleExpression$0(), t1.spanFrom$1(new A._SpanScannerState(t1, t2))); + }, + _stylesheet0$_unaryOperatorFor$1(character) { + var t1; + $label0$0: { + if (43 === character) { + t1 = B.UnaryOperator_gg40; + break $label0$0; + } + if (45 === character) { + t1 = B.UnaryOperator_TLI0; + break $label0$0; + } + if (47 === character) { + t1 = B.UnaryOperator_Ix10; + break $label0$0; + } + t1 = null; + break $label0$0; + } + return t1; + }, + _stylesheet0$_number$0() { + var number, unit, _this = this, + t1 = _this.scanner, + t2 = t1._string_scanner$_position, + first = t1.peekChar$0(), + t3 = first !== 43; + if (!t3 || first === 45) + t1.readChar$0(); + if (t1.peekChar$0() !== 46) + _this._stylesheet0$_consumeNaturalNumber$0(); + _this._stylesheet0$_tryDecimal$1$allowTrailingDot(t1._string_scanner$_position !== t2 && t3 && first !== 45); + _this._stylesheet0$_tryExponent$0(); + number = A.double_parse(t1.substring$1(0, t2)); + if (t1.scanChar$1(37)) + unit = "%"; + else { + if (_this.lookingAtIdentifier$0()) + t3 = t1.peekChar$0() !== 45 || t1.peekChar$1(1) !== 45; + else + t3 = false; + unit = t3 ? _this.identifier$1$unit(true) : null; + } + return new A.NumberExpression0(number, unit, t1.spanFrom$1(new A._SpanScannerState(t1, t2))); + }, + _stylesheet0$_consumeNaturalNumber$0() { + var $self, + t1 = this.scanner, + t2 = t1.readChar$0(); + if (!(t2 >= 48 && t2 <= 57)) + t1.error$2$position(0, "Expected digit.", t1._string_scanner$_position - 1); + while (true) { + $self = t1.peekChar$0(); + if (!($self != null && $self >= 48 && $self <= 57)) + break; + t1.readChar$0(); + } + }, + _stylesheet0$_tryDecimal$1$allowTrailingDot(allowTrailingDot) { + var $self, + t1 = this.scanner; + if (t1.peekChar$0() !== 46) + return; + $self = t1.peekChar$1(1); + if (!($self != null && $self >= 48 && $self <= 57)) { + if (allowTrailingDot) + return; + t1.error$2$position(0, "Expected digit.", t1._string_scanner$_position + 1); + } + t1.readChar$0(); + while (true) { + $self = t1.peekChar$0(); + if (!($self != null && $self >= 48 && $self <= 57)) + break; + t1.readChar$0(); + } + }, + _stylesheet0$_tryExponent$0() { + var next, $self, + t1 = this.scanner, + first = t1.peekChar$0(); + if (first !== 101 && first !== 69) + return; + next = t1.peekChar$1(1); + if (!(next != null && next >= 48 && next <= 57) && next !== 45 && next !== 43) + return; + t1.readChar$0(); + if (43 === next || 45 === next) + t1.readChar$0(); + $self = t1.peekChar$0(); + if (!($self != null && $self >= 48 && $self <= 57)) + t1.error$1(0, "Expected digit."); + while (true) { + $self = t1.peekChar$0(); + if (!($self != null && $self >= 48 && $self <= 57)) + break; + t1.readChar$0(); + } + }, + _stylesheet0$_unicodeRange$0() { + var firstRangeLength, hasQuestionMark, t2, secondRangeLength, _this = this, + _s26_ = "Expected at most 6 digits.", + t1 = _this.scanner, + start = new A._SpanScannerState(t1, t1._string_scanner$_position); + _this.expectIdentChar$1(117); + t1.expectChar$1(43); + for (firstRangeLength = 0; _this.scanCharIf$1(new A.StylesheetParser__unicodeRange_closure1());) + ++firstRangeLength; + for (hasQuestionMark = false; t1.scanChar$1(63); hasQuestionMark = true) + ++firstRangeLength; + if (firstRangeLength === 0) + t1.error$1(0, 'Expected hex digit or "?".'); + else if (firstRangeLength > 6) + _this.error$2(0, _s26_, t1.spanFrom$1(start)); + else if (hasQuestionMark) { + t2 = t1.substring$1(0, start.position); + t1 = t1.spanFrom$1(start); + return new A.StringExpression0(A.Interpolation$0(A._setArrayType([t2], type$.JSArray_Object), t1), false); + } + if (t1.scanChar$1(45)) { + t2 = t1._string_scanner$_position; + for (secondRangeLength = 0; _this.scanCharIf$1(new A.StylesheetParser__unicodeRange_closure2());) + ++secondRangeLength; + if (secondRangeLength === 0) + t1.error$1(0, "Expected hex digit."); + else if (secondRangeLength > 6) + _this.error$2(0, _s26_, t1.spanFrom$1(new A._SpanScannerState(t1, t2))); + } + if (_this._stylesheet0$_lookingAtInterpolatedIdentifierBody$0()) + t1.error$1(0, "Expected end of identifier."); + t2 = t1.substring$1(0, start.position); + t1 = t1.spanFrom$1(start); + return new A.StringExpression0(A.Interpolation$0(A._setArrayType([t2], type$.JSArray_Object), t1), false); + }, + _stylesheet0$_variable$0() { + var _this = this, + t1 = _this.scanner, + start = new A._SpanScannerState(t1, t1._string_scanner$_position), + $name = _this.variableName$0(); + if (_this.get$plainCss()) + _this.error$2(0, string$.Sass_v, t1.spanFrom$1(start)); + return new A.VariableExpression0(null, $name, t1.spanFrom$1(start)); + }, + _stylesheet0$_selector$0() { + var t1, start, _this = this; + if (_this.get$plainCss()) + _this.scanner.error$2$length(0, string$.The_pa, 1); + t1 = _this.scanner; + start = new A._SpanScannerState(t1, t1._string_scanner$_position); + t1.expectChar$1(38); + if (t1.scanChar$1(38)) { + _this.logger.warn$2$span(0, string$.In_Sas, t1.spanFrom$1(start)); + t1.set$position(t1._string_scanner$_position - 1); + } + return new A.SelectorExpression0(t1.spanFrom$1(start)); + }, + interpolatedString$0() { + var t3, t4, buffer, _0_0, second, t5, + t1 = this.scanner, + t2 = t1._string_scanner$_position, + quote = t1.readChar$0(); + if (quote !== 39 && quote !== 34) + t1.error$2$position(0, "Expected string.", t2); + t3 = new A.StringBuffer(""); + t4 = A._setArrayType([], type$.JSArray_Object); + buffer = new A.InterpolationBuffer0(t3, t4); + for (; true;) { + _0_0 = t1.peekChar$0(); + if (_0_0 === quote) { + t1.readChar$0(); + break; + } + if (_0_0 == null || _0_0 === 10 || _0_0 === 13 || _0_0 === 12) + t1.error$1(0, "Expected " + A.Primitives_stringFromCharCode(quote) + "."); + if (92 === _0_0) { + second = t1.peekChar$1(1); + if (second === 10 || second === 13 || second === 12) { + t1.readChar$0(); + t1.readChar$0(); + if (second === 13) + t1.scanChar$1(10); + } else + t3._contents += A.Primitives_stringFromCharCode(A.consumeEscapedCharacter0(t1)); + continue; + } + if (35 === _0_0 && t1.peekChar$1(1) === 123) { + t5 = this.singleInterpolation$0(); + buffer._interpolation_buffer0$_flushText$0(); + t4.push(t5); + continue; + } + t3._contents += A.Primitives_stringFromCharCode(t1.readChar$0()); + } + return new A.StringExpression0(buffer.interpolation$1(t1.spanFrom$1(new A._SpanScannerState(t1, t2))), true); + }, + identifierLike$0() { + var invocation, expression, _0_0, _1_0, _2_0, _2_2, _2_4, _this = this, + t1 = _this.scanner, + start = new A._SpanScannerState(t1, t1._string_scanner$_position), + identifier = _this.interpolatedIdentifier$0(), + plain = identifier.get$asPlain(), + lower = A._Cell$(), + t2 = plain != null; + if (t2) { + if (plain === "if" && t1.peekChar$0() === 40) { + invocation = _this._stylesheet0$_argumentInvocation$0(); + return new A.IfExpression0(invocation, identifier.span.expand$1(0, invocation.span)); + } else if (plain === "not") { + _this.whitespace$0(); + expression = _this._stylesheet0$_singleExpression$0(); + return new A.UnaryOperationExpression0(B.UnaryOperator_not_not_not0, expression, identifier.span.expand$1(0, expression.get$span(expression))); + } + lower._value = plain.toLowerCase(); + if (t1.peekChar$0() !== 40) { + switch (plain) { + case "false": + return new A.BooleanExpression0(false, identifier.span); + case "null": + return new A.NullExpression0(identifier.span); + case "true": + return new A.BooleanExpression0(true, identifier.span); + } + _0_0 = $.$get$colorsByName0().$index(0, lower._readLocal$0()); + if (_0_0 != null) { + t1 = identifier.span; + return new A.ColorExpression0(A.SassColor$rgbInternal0(_0_0.get$red(0), _0_0.get$green(0), _0_0.get$blue(0), _0_0._color1$_alpha, new A.SpanColorFormat0(t1)), t1); + } + } + _1_0 = _this.trySpecialFunction$2(lower._readLocal$0(), start); + if (_1_0 != null) + return _1_0; + } + _2_0 = t1.peekChar$0(); + _2_2 = 46 === _2_0; + if (_2_2 && t1.peekChar$1(1) === 46) + return new A.StringExpression0(identifier, false); + if (_2_2) { + t1.readChar$0(); + if (t2) + return _this.namespacedExpression$2(plain, start); + _this.error$2(0, string$.Interpn, identifier.span); + } + _2_4 = 40 === _2_0; + if (_2_4 && t2) + return new A.FunctionExpression0(null, plain, _this._stylesheet0$_argumentInvocation$1$allowEmptySecondArg(J.$eq$(lower._readLocal$0(), "var")), t1.spanFrom$1(start)); + if (_2_4) + return new A.InterpolatedFunctionExpression0(identifier, _this._stylesheet0$_argumentInvocation$0(), t1.spanFrom$1(start)); + return new A.StringExpression0(identifier, false); + }, + namespacedExpression$2(namespace, start) { + var $name, _this = this, + t1 = _this.scanner; + if (t1.peekChar$0() === 36) { + $name = _this.variableName$0(); + _this._stylesheet0$_assertPublic$2($name, new A.StylesheetParser_namespacedExpression_closure0(_this, start)); + return new A.VariableExpression0(namespace, $name, t1.spanFrom$1(start)); + } + return new A.FunctionExpression0(namespace, _this._stylesheet0$_publicIdentifier$0(), _this._stylesheet0$_argumentInvocation$0(), t1.spanFrom$1(start)); + }, + trySpecialFunction$2($name, start) { + var t1, buffer, t2, next, t3, _this = this, + normalized = A.unvendor0($name); + $label0$0: { + if (!("calc" === normalized && normalized !== $name && _this.scanner.scanChar$1(40))) + t1 = ("element" === normalized || "expression" === normalized) && _this.scanner.scanChar$1(40); + else + t1 = true; + if (t1) { + t1 = new A.StringBuffer(""); + buffer = new A.InterpolationBuffer0(t1, A._setArrayType([], type$.JSArray_Object)); + t1._contents = "" + $name; + t1._contents += A.Primitives_stringFromCharCode(40); + break $label0$0; + } + if ("progid" === normalized && _this.scanner.scanChar$1(58)) { + t1 = new A.StringBuffer(""); + buffer = new A.InterpolationBuffer0(t1, A._setArrayType([], type$.JSArray_Object)); + t1._contents = "" + $name; + t1._contents += A.Primitives_stringFromCharCode(58); + t2 = _this.scanner; + next = t2.peekChar$0(); + while (true) { + if (next != null) { + if (!(next >= 97 && next <= 122)) + t3 = next >= 65 && next <= 90; + else + t3 = true; + t3 = t3 || next === 46; + } else + t3 = false; + if (!t3) + break; + t1._contents += A.Primitives_stringFromCharCode(t2.readChar$0()); + next = t2.peekChar$0(); + } + t2.expectChar$1(40); + t1._contents += A.Primitives_stringFromCharCode(40); + break $label0$0; + } + if ("url" === normalized) + return A.NullableExtension_andThen0(_this._stylesheet0$_tryUrlContents$1(start), new A.StylesheetParser_trySpecialFunction_closure0()); + return null; + } + buffer.addInterpolation$1(_this._stylesheet0$_interpolatedDeclarationValue$1$allowEmpty(true)); + t1 = _this.scanner; + t1.expectChar$1(41); + buffer._interpolation_buffer0$_text._contents += A.Primitives_stringFromCharCode(41); + return new A.StringExpression0(buffer.interpolation$1(t1.spanFrom$1(start)), false); + }, + _stylesheet0$_tryUrlContents$2$name(start, $name) { + var t3, t4, buffer, _0_0, _0_6, t5, endPosition, result, _this = this, + t1 = _this.scanner, + t2 = t1._string_scanner$_position; + if (!t1.scanChar$1(40)) + return null; + _this.whitespaceWithoutComments$0(); + t3 = new A.StringBuffer(""); + t4 = A._setArrayType([], type$.JSArray_Object); + buffer = new A.InterpolationBuffer0(t3, t4); + t3._contents = "" + ($name == null ? "url" : $name); + t3._contents += A.Primitives_stringFromCharCode(40); + for (; true;) { + _0_0 = t1.peekChar$0(); + if (_0_0 == null) + break; + if (92 === _0_0) { + t3._contents += _this.escape$0(); + continue; + } + _0_6 = 35 === _0_0; + if (_0_6 && t1.peekChar$1(1) === 123) { + t5 = _this.singleInterpolation$0(); + buffer._interpolation_buffer0$_flushText$0(); + t4.push(t5); + continue; + } + if (33 !== _0_0) + if (37 !== _0_0) + if (38 !== _0_0) + if (!_0_6) + t5 = _0_0 >= 42 && _0_0 <= 126 || _0_0 >= 128; + else + t5 = true; + else + t5 = true; + else + t5 = true; + else + t5 = true; + if (t5) { + t3._contents += A.Primitives_stringFromCharCode(t1.readChar$0()); + continue; + } + if (_0_0 === 32 || _0_0 === 9 || _0_0 === 10 || _0_0 === 13 || _0_0 === 12) { + _this.whitespaceWithoutComments$0(); + if (t1.peekChar$0() !== 41) + break; + continue; + } + if (41 === _0_0) { + t3._contents += A.Primitives_stringFromCharCode(t1.readChar$0()); + endPosition = t1._string_scanner$_position; + t2 = t1._sourceFile; + t5 = start.position; + t1 = new A._FileSpan(t2, t5, endPosition); + t1._FileSpan$3(t2, t5, endPosition); + t5 = type$.Object; + t2 = A.List_List$of(t4, true, t5); + t4 = t3._contents; + if (t4.length !== 0) + t2.push(t4.charCodeAt(0) == 0 ? t4 : t4); + result = A.List_List$from(t2, false, t5); + result.fixed$length = Array; + result.immutable$list = Array; + t3 = new A.Interpolation0(result, t1); + t3.Interpolation$20(t2, t1); + return t3; + } + break; + } + t1.set$state(new A._SpanScannerState(t1, t2)); + return null; + }, + _stylesheet0$_tryUrlContents$1(start) { + return this._stylesheet0$_tryUrlContents$2$name(start, null); + }, + dynamicUrl$0() { + var _0_0, _this = this, + t1 = _this.scanner, + start = new A._SpanScannerState(t1, t1._string_scanner$_position); + _this.expectIdentifier$1("url"); + _0_0 = _this._stylesheet0$_tryUrlContents$1(start); + if (_0_0 != null) + return new A.StringExpression0(_0_0, false); + return new A.InterpolatedFunctionExpression0(A.Interpolation$0(A._setArrayType(["url"], type$.JSArray_Object), t1.spanFrom$1(start)), _this._stylesheet0$_argumentInvocation$0(), t1.spanFrom$1(start)); + }, + almostAnyValue$1$omitComments(omitComments) { + var t4, t5, t6, _1_0, commentStart, end, t7, _0_0, _this = this, + t1 = _this.scanner, + t2 = t1._string_scanner$_position, + t3 = new A.StringBuffer(""), + buffer = new A.InterpolationBuffer0(t3, A._setArrayType([], type$.JSArray_Object)); + for (t4 = t1.string, t5 = t4.length, t6 = !omitComments; true;) + $label0$0: { + _1_0 = t1.peekChar$0(); + if (92 === _1_0) { + t3._contents += A.Primitives_stringFromCharCode(t1.readChar$0()); + t3._contents += A.Primitives_stringFromCharCode(t1.readChar$0()); + break $label0$0; + } + if (34 === _1_0 || 39 === _1_0) { + buffer.addInterpolation$1(_this.interpolatedString$0().asInterpolation$0()); + break $label0$0; + } + if (47 === _1_0) { + commentStart = t1._string_scanner$_position; + if (_this.scanComment$0()) { + if (t6) { + end = t1._string_scanner$_position; + t3._contents += B.JSString_methods.substring$2(t4, commentStart, end); + } + } else + t3._contents += A.Primitives_stringFromCharCode(t1.readChar$0()); + break $label0$0; + } + if (35 === _1_0 && t1.peekChar$1(1) === 123) { + buffer.addInterpolation$1(_this.interpolatedIdentifier$0()); + break $label0$0; + } + if (13 === _1_0 || 10 === _1_0 || 12 === _1_0) { + if (_this.get$indented()) + break; + t3._contents += A.Primitives_stringFromCharCode(t1.readChar$0()); + break $label0$0; + } + if (33 === _1_0 || 59 === _1_0 || 123 === _1_0 || 125 === _1_0) + break; + if (117 === _1_0 || 85 === _1_0) { + t7 = t1._string_scanner$_position; + if (!_this.scanIdentifier$1("url")) { + t3._contents += A.Primitives_stringFromCharCode(t1.readChar$0()); + continue; + } + _0_0 = _this._stylesheet0$_tryUrlContents$1(new A._SpanScannerState(t1, t7)); + if (_0_0 != null) + buffer.addInterpolation$1(_0_0); + else { + if ((t7 === 0 ? 1 / t7 < 0 : t7 < 0) || t7 > t5) + A.throwExpression(A.ArgumentError$("Invalid position " + t7, null)); + t1._string_scanner$_position = t7; + t1._lastMatch = null; + t3._contents += A.Primitives_stringFromCharCode(t1.readChar$0()); + } + break $label0$0; + } + if (_1_0 == null) + break; + t7 = _this.lookingAtIdentifier$0(); + if (t7) { + t3._contents += _this.identifier$0(); + break $label0$0; + } + t3._contents += A.Primitives_stringFromCharCode(t1.readChar$0()); + } + return buffer.interpolation$1(t1.spanFrom$1(new A._SpanScannerState(t1, t2))); + }, + almostAnyValue$0() { + return this.almostAnyValue$1$omitComments(false); + }, + _stylesheet0$_interpolatedDeclarationValue$3$allowColon$allowEmpty$allowSemicolon(allowColon, allowEmpty, allowSemicolon) { + var t4, t5, t6, t7, wroteNewline, _1_0, t8, start, end, _1_14, t9, _1_14_isSet, _1_18, _1_20, _1_20_isSet, _1_18_isSet, bracket, _0_0, _this = this, _null = null, + t1 = _this.scanner, + t2 = t1._string_scanner$_position, + t3 = new A.StringBuffer(""), + buffer = new A.InterpolationBuffer0(t3, A._setArrayType([], type$.JSArray_Object)), + brackets = A._setArrayType([], type$.JSArray_int); + for (t4 = t1.string, t5 = t4.length, t6 = !allowColon, t7 = !allowSemicolon, wroteNewline = false; true;) + $label0$0: { + _1_0 = t1.peekChar$0(); + if (92 === _1_0) { + t3._contents += _this.escape$1$identifierStart(true); + wroteNewline = false; + break $label0$0; + } + if (34 === _1_0 || 39 === _1_0) { + buffer.addInterpolation$1(_this.interpolatedString$0().asInterpolation$0()); + wroteNewline = false; + break $label0$0; + } + if (47 === _1_0 && t1.peekChar$1(1) === 42) { + t8 = _this.get$loudComment(); + start = t1._string_scanner$_position; + t8.call$0(); + end = t1._string_scanner$_position; + t3._contents += B.JSString_methods.substring$2(t4, start, end); + wroteNewline = false; + break $label0$0; + } + if (35 === _1_0 && t1.peekChar$1(1) === 123) { + buffer.addInterpolation$1(_this.interpolatedIdentifier$0()); + wroteNewline = false; + break $label0$0; + } + t8 = 32 !== _1_0; + if (t8) { + _1_14 = 9 === _1_0; + t9 = _1_14; + _1_14_isSet = true; + } else { + _1_14 = _null; + _1_14_isSet = false; + t9 = true; + } + if (t9) + if (!wroteNewline) { + t9 = t1.peekChar$1(1); + t9 = t9 === 32 || t9 === 9 || t9 === 10 || t9 === 13 || t9 === 12; + } else + t9 = false; + else + t9 = false; + if (t9) { + t1.readChar$0(); + break $label0$0; + } + if (t8) + t8 = _1_14_isSet ? _1_14 : 9 === _1_0; + else + t8 = true; + if (t8) { + t3._contents += A.Primitives_stringFromCharCode(t1.readChar$0()); + break $label0$0; + } + t8 = 10 !== _1_0; + if (t8) { + _1_18 = 13 === _1_0; + if (!_1_18) { + _1_20 = 12 === _1_0; + t9 = _1_20; + _1_20_isSet = true; + } else { + _1_20 = _null; + _1_20_isSet = false; + t9 = true; + } + _1_18_isSet = true; + } else { + _1_20 = _null; + _1_18 = _1_20; + _1_18_isSet = false; + _1_20_isSet = false; + t9 = true; + } + if (t9 && _this.get$indented()) + break; + if (t8) + if (!(_1_18_isSet ? _1_18 : 13 === _1_0)) + t8 = _1_20_isSet ? _1_20 : 12 === _1_0; + else + t8 = true; + else + t8 = true; + if (t8) { + t8 = t1.peekChar$1(-1); + if (!(t8 === 10 || t8 === 13 || t8 === 12)) + t3._contents += "\n"; + t1.readChar$0(); + wroteNewline = true; + break $label0$0; + } + if (40 === _1_0 || 123 === _1_0 || 91 === _1_0) { + bracket = t1.readChar$0(); + t3._contents += A.Primitives_stringFromCharCode(bracket); + brackets.push(A.opposite0(bracket)); + wroteNewline = false; + break $label0$0; + } + if (41 === _1_0 || 125 === _1_0 || 93 === _1_0) { + if (brackets.length === 0) + break; + bracket = brackets.pop(); + t1.expectChar$1(bracket); + t3._contents += A.Primitives_stringFromCharCode(bracket); + wroteNewline = false; + break $label0$0; + } + if (59 === _1_0) { + if (t7 && brackets.length === 0) + break; + t3._contents += A.Primitives_stringFromCharCode(t1.readChar$0()); + wroteNewline = false; + break $label0$0; + } + if (58 === _1_0) { + if (t6 && brackets.length === 0) + break; + t3._contents += A.Primitives_stringFromCharCode(t1.readChar$0()); + wroteNewline = false; + break $label0$0; + } + if (117 === _1_0 || 85 === _1_0) { + t8 = t1._string_scanner$_position; + if (!_this.scanIdentifier$1("url")) { + t3._contents += A.Primitives_stringFromCharCode(t1.readChar$0()); + wroteNewline = false; + continue; + } + _0_0 = _this._stylesheet0$_tryUrlContents$1(new A._SpanScannerState(t1, t8)); + if (_0_0 != null) + buffer.addInterpolation$1(_0_0); + else { + if ((t8 === 0 ? 1 / t8 < 0 : t8 < 0) || t8 > t5) + A.throwExpression(A.ArgumentError$("Invalid position " + t8, _null)); + t1._string_scanner$_position = t8; + t1._lastMatch = null; + t3._contents += A.Primitives_stringFromCharCode(t1.readChar$0()); + } + wroteNewline = false; + break $label0$0; + } + if (_1_0 == null) + break; + t8 = _this.lookingAtIdentifier$0(); + if (t8) { + t3._contents += _this.identifier$0(); + wroteNewline = false; + break $label0$0; + } + t3._contents += A.Primitives_stringFromCharCode(t1.readChar$0()); + wroteNewline = false; + } + if (brackets.length !== 0) + t1.expectChar$1(B.JSArray_methods.get$last(brackets)); + if (!allowEmpty && buffer._interpolation_buffer0$_contents.length === 0 && t3._contents.length === 0) + t1.error$1(0, "Expected token."); + return buffer.interpolation$1(t1.spanFrom$1(new A._SpanScannerState(t1, t2))); + }, + _stylesheet0$_interpolatedDeclarationValue$1$allowEmpty(allowEmpty) { + return this._stylesheet0$_interpolatedDeclarationValue$3$allowColon$allowEmpty$allowSemicolon(true, allowEmpty, false); + }, + _stylesheet0$_interpolatedDeclarationValue$2$allowEmpty$allowSemicolon(allowEmpty, allowSemicolon) { + return this._stylesheet0$_interpolatedDeclarationValue$3$allowColon$allowEmpty$allowSemicolon(true, allowEmpty, allowSemicolon); + }, + _stylesheet0$_interpolatedDeclarationValue$0() { + return this._stylesheet0$_interpolatedDeclarationValue$3$allowColon$allowEmpty$allowSemicolon(true, false, false); + }, + interpolatedIdentifier$0() { + var _0_0, _this = this, + _s20_ = "Expected identifier.", + t1 = _this.scanner, + start = new A._SpanScannerState(t1, t1._string_scanner$_position), + t2 = new A.StringBuffer(""), + t3 = A._setArrayType([], type$.JSArray_Object), + buffer = new A.InterpolationBuffer0(t2, t3); + if (t1.scanChar$1(45)) { + t2._contents += A.Primitives_stringFromCharCode(45); + if (t1.scanChar$1(45)) { + t2._contents += A.Primitives_stringFromCharCode(45); + _this._stylesheet0$_interpolatedIdentifierBody$1(buffer); + return buffer.interpolation$1(t1.spanFrom$1(start)); + } + } + $label0$0: { + _0_0 = t1.peekChar$0(); + if (_0_0 == null) + t1.error$1(0, _s20_); + if (_0_0 === 95 || A.CharacterExtension_get_isAlphabetic0(_0_0) || _0_0 >= 128) { + t2._contents += A.Primitives_stringFromCharCode(t1.readChar$0()); + break $label0$0; + } + if (92 === _0_0) { + t2._contents += _this.escape$1$identifierStart(true); + break $label0$0; + } + if (35 === _0_0 && t1.peekChar$1(1) === 123) { + t2 = _this.singleInterpolation$0(); + buffer._interpolation_buffer0$_flushText$0(); + t3.push(t2); + break $label0$0; + } + t1.error$1(0, _s20_); + } + _this._stylesheet0$_interpolatedIdentifierBody$1(buffer); + return buffer.interpolation$1(t1.spanFrom$1(start)); + }, + _stylesheet0$_interpolatedIdentifierBody$1(buffer) { + var t1, t2, t3, _0_0, t4; + for (t1 = buffer._interpolation_buffer0$_contents, t2 = this.scanner, t3 = buffer._interpolation_buffer0$_text; true;) { + _0_0 = t2.peekChar$0(); + if (_0_0 == null) + break; + if (95 !== _0_0) + if (45 !== _0_0) { + if (!(_0_0 >= 97 && _0_0 <= 122)) + t4 = _0_0 >= 65 && _0_0 <= 90; + else + t4 = true; + if (!t4) + t4 = _0_0 >= 48 && _0_0 <= 57; + else + t4 = true; + t4 = t4 || _0_0 >= 128; + } else + t4 = true; + else + t4 = true; + if (t4) { + t3._contents += A.Primitives_stringFromCharCode(t2.readChar$0()); + continue; + } + if (92 === _0_0) { + t3._contents += this.escape$0(); + continue; + } + if (35 === _0_0 && t2.peekChar$1(1) === 123) { + t4 = this.singleInterpolation$0(); + buffer._interpolation_buffer0$_flushText$0(); + t1.push(t4); + continue; + } + break; + } + }, + singleInterpolation$0() { + var contents, _this = this, + t1 = _this.scanner, + t2 = t1._string_scanner$_position; + t1.expect$1("#{"); + _this.whitespace$0(); + contents = _this._stylesheet0$_expression$0(); + t1.expectChar$1(125); + if (_this.get$plainCss()) + _this.error$2(0, string$.Interpp, t1.spanFrom$1(new A._SpanScannerState(t1, t2))); + return contents; + }, + _stylesheet0$_mediaQueryList$0() { + var _this = this, + t1 = _this.scanner, + t2 = t1._string_scanner$_position, + t3 = new A.StringBuffer(""), + buffer = new A.InterpolationBuffer0(t3, A._setArrayType([], type$.JSArray_Object)); + for (; true;) { + _this.whitespace$0(); + _this._stylesheet0$_mediaQuery$1(buffer); + _this.whitespace$0(); + if (!t1.scanChar$1(44)) + break; + t3._contents += A.Primitives_stringFromCharCode(44); + t3._contents += A.Primitives_stringFromCharCode(32); + } + return buffer.interpolation$1(t1.spanFrom$1(new A._SpanScannerState(t1, t2))); + }, + _stylesheet0$_mediaQuery$1(buffer) { + var identifier1, t1, identifier2, _this = this, _s3_ = "and"; + if (_this.scanner.peekChar$0() === 40) { + _this._stylesheet0$_mediaInParens$1(buffer); + _this.whitespace$0(); + if (_this.scanIdentifier$1(_s3_)) { + buffer._interpolation_buffer0$_text._contents += " and "; + _this.expectWhitespace$0(); + _this._stylesheet0$_mediaLogicSequence$2(buffer, _s3_); + } else if (_this.scanIdentifier$1("or")) { + buffer._interpolation_buffer0$_text._contents += " or "; + _this.expectWhitespace$0(); + _this._stylesheet0$_mediaLogicSequence$2(buffer, "or"); + } + return; + } + identifier1 = _this.interpolatedIdentifier$0(); + if (A.equalsIgnoreCase0(identifier1.get$asPlain(), "not")) { + _this.expectWhitespace$0(); + if (!_this._stylesheet0$_lookingAtInterpolatedIdentifier$0()) { + buffer._interpolation_buffer0$_text._contents += "not "; + _this._stylesheet0$_mediaOrInterp$1(buffer); + return; + } + } + _this.whitespace$0(); + buffer.addInterpolation$1(identifier1); + if (!_this._stylesheet0$_lookingAtInterpolatedIdentifier$0()) + return; + t1 = buffer._interpolation_buffer0$_text; + t1._contents += A.Primitives_stringFromCharCode(32); + identifier2 = _this.interpolatedIdentifier$0(); + if (A.equalsIgnoreCase0(identifier2.get$asPlain(), _s3_)) { + _this.expectWhitespace$0(); + t1._contents += " and "; + } else { + _this.whitespace$0(); + buffer.addInterpolation$1(identifier2); + if (_this.scanIdentifier$1(_s3_)) { + _this.expectWhitespace$0(); + t1._contents += " and "; + } else + return; + } + if (_this.scanIdentifier$1("not")) { + _this.expectWhitespace$0(); + t1._contents += "not "; + _this._stylesheet0$_mediaOrInterp$1(buffer); + return; + } + _this._stylesheet0$_mediaLogicSequence$2(buffer, _s3_); + return; + }, + _stylesheet0$_mediaLogicSequence$2(buffer, operator) { + var t1, t2, _this = this; + for (t1 = buffer._interpolation_buffer0$_text; true;) { + _this._stylesheet0$_mediaOrInterp$1(buffer); + _this.whitespace$0(); + if (!_this.scanIdentifier$1(operator)) + return; + _this.expectWhitespace$0(); + t2 = t1._contents += A.Primitives_stringFromCharCode(32); + t1._contents = t2 + operator; + t1._contents += A.Primitives_stringFromCharCode(32); + } + }, + _stylesheet0$_mediaOrInterp$1(buffer) { + var interpolation; + if (this.scanner.peekChar$0() === 35) { + interpolation = this.singleInterpolation$0(); + buffer.addInterpolation$1(A.Interpolation$0(A._setArrayType([interpolation], type$.JSArray_Object), interpolation.get$span(interpolation))); + } else + this._stylesheet0$_mediaInParens$1(buffer); + }, + _stylesheet0$_mediaInParens$1(buffer) { + var t2, t3, t4, next, t5, _this = this, + t1 = _this.scanner; + t1.expectChar$2$name(40, "media condition in parentheses"); + t2 = buffer._interpolation_buffer0$_text; + t2._contents += A.Primitives_stringFromCharCode(40); + _this.whitespace$0(); + if (t1.peekChar$0() === 40) { + _this._stylesheet0$_mediaInParens$1(buffer); + _this.whitespace$0(); + if (_this.scanIdentifier$1("and")) { + t2._contents += " and "; + _this.expectWhitespace$0(); + _this._stylesheet0$_mediaLogicSequence$2(buffer, "and"); + } else if (_this.scanIdentifier$1("or")) { + t2._contents += " or "; + _this.expectWhitespace$0(); + _this._stylesheet0$_mediaLogicSequence$2(buffer, "or"); + } + } else if (_this.scanIdentifier$1("not")) { + t2._contents += "not "; + _this.expectWhitespace$0(); + _this._stylesheet0$_mediaOrInterp$1(buffer); + } else { + t3 = _this._stylesheet0$_expressionUntilComparison$0(); + buffer._interpolation_buffer0$_flushText$0(); + t4 = buffer._interpolation_buffer0$_contents; + t4.push(t3); + if (t1.scanChar$1(58)) { + _this.whitespace$0(); + t2._contents += A.Primitives_stringFromCharCode(58); + t2._contents += A.Primitives_stringFromCharCode(32); + t3 = _this._stylesheet0$_expression$0(); + buffer._interpolation_buffer0$_flushText$0(); + t4.push(t3); + } else { + next = t1.peekChar$0(); + t3 = 60 !== next; + if (!t3 || 62 === next || 61 === next) { + t2._contents += A.Primitives_stringFromCharCode(32); + t2._contents += A.Primitives_stringFromCharCode(t1.readChar$0()); + if ((!t3 || 62 === next) && t1.scanChar$1(61)) + t2._contents += A.Primitives_stringFromCharCode(61); + t2._contents += A.Primitives_stringFromCharCode(32); + _this.whitespace$0(); + t5 = _this._stylesheet0$_expressionUntilComparison$0(); + buffer._interpolation_buffer0$_flushText$0(); + t4.push(t5); + if (!t3 || 62 === next) { + next.toString; + t3 = t1.scanChar$1(next); + } else + t3 = false; + if (t3) { + t2._contents += A.Primitives_stringFromCharCode(32); + t2._contents += A.Primitives_stringFromCharCode(next); + if (t1.scanChar$1(61)) + t2._contents += A.Primitives_stringFromCharCode(61); + t2._contents += A.Primitives_stringFromCharCode(32); + _this.whitespace$0(); + t3 = _this._stylesheet0$_expressionUntilComparison$0(); + buffer._interpolation_buffer0$_flushText$0(); + t4.push(t3); + } + } + } + } + t1.expectChar$1(41); + _this.whitespace$0(); + t2._contents += A.Primitives_stringFromCharCode(41); + }, + _stylesheet0$_expressionUntilComparison$0() { + return this._stylesheet0$_expression$1$until(new A.StylesheetParser__expressionUntilComparison_closure0(this)); + }, + _stylesheet0$_supportsCondition$0() { + var condition, operator, right, endPosition, t3, t4, lowerOperator, _this = this, + t1 = _this.scanner, + t2 = t1._string_scanner$_position; + if (_this.scanIdentifier$1("not")) { + _this.whitespace$0(); + return new A.SupportsNegation0(_this._stylesheet0$_supportsConditionInParens$0(), t1.spanFrom$1(new A._SpanScannerState(t1, t2))); + } + condition = _this._stylesheet0$_supportsConditionInParens$0(); + _this.whitespace$0(); + for (operator = null; _this.lookingAtIdentifier$0();) { + if (operator != null) + _this.expectIdentifier$1(operator); + else if (_this.scanIdentifier$1("or")) + operator = "or"; + else { + _this.expectIdentifier$1("and"); + operator = "and"; + } + _this.whitespace$0(); + right = _this._stylesheet0$_supportsConditionInParens$0(); + endPosition = t1._string_scanner$_position; + t3 = t1._sourceFile; + t4 = new A._FileSpan(t3, t2, endPosition); + t4._FileSpan$3(t3, t2, endPosition); + condition = new A.SupportsOperation0(condition, right, operator, t4); + lowerOperator = operator.toLowerCase(); + if (lowerOperator !== "and" && lowerOperator !== "or") + A.throwExpression(A.ArgumentError$value(operator, "operator", 'may only be "and" or "or".')); + _this.whitespace$0(); + } + return condition; + }, + _stylesheet0$_supportsConditionInParens$0() { + var $name, nameStart, wasInParentheses, identifier, operation, _1_0, contents, identifier0, t2, $arguments, _0_0, _0_4, _0_4_isSet, condition, exception, declaration, _this = this, _null = null, + t1 = _this.scanner, + start = new A._SpanScannerState(t1, t1._string_scanner$_position); + if (_this._stylesheet0$_lookingAtInterpolatedIdentifier$0()) { + identifier0 = _this.interpolatedIdentifier$0(); + t2 = identifier0.get$asPlain(); + if ((t2 == null ? _null : t2.toLowerCase()) === "not") + _this.error$2(0, '"not" is not a valid identifier here.', identifier0.span); + if (t1.scanChar$1(40)) { + $arguments = _this._stylesheet0$_interpolatedDeclarationValue$2$allowEmpty$allowSemicolon(true, true); + t1.expectChar$1(41); + return new A.SupportsFunction0(identifier0, $arguments, t1.spanFrom$1(start)); + } else { + _0_0 = identifier0.contents; + if (_0_0.length === 1) { + _0_4 = _0_0[0]; + t2 = _0_4; + t2 = type$.Expression_2._is(t2); + _0_4_isSet = true; + } else { + _0_4 = _null; + _0_4_isSet = false; + t2 = false; + } + if (t2) { + t2 = _0_4_isSet ? _0_4 : _0_0[0]; + return new A.SupportsInterpolation0(type$.Expression_2._as(t2), t1.spanFrom$1(start)); + } else + _this.error$2(0, "Expected @supports condition.", identifier0.span); + } + } + t1.expectChar$1(40); + _this.whitespace$0(); + if (_this.scanIdentifier$1("not")) { + _this.whitespace$0(); + condition = _this._stylesheet0$_supportsConditionInParens$0(); + t1.expectChar$1(41); + return new A.SupportsNegation0(condition, t1.spanFrom$1(start)); + } else if (t1.peekChar$0() === 40) { + condition = _this._stylesheet0$_supportsCondition$0(); + t1.expectChar$1(41); + return condition; + } + $name = null; + nameStart = new A._SpanScannerState(t1, t1._string_scanner$_position); + wasInParentheses = _this._stylesheet0$_inParentheses; + try { + $name = _this._stylesheet0$_expression$0(); + t1.expectChar$1(58); + } catch (exception) { + if (type$.FormatException._is(A.unwrapException(exception))) { + t1.set$state(nameStart); + _this._stylesheet0$_inParentheses = wasInParentheses; + identifier = _this.interpolatedIdentifier$0(); + operation = null; + _1_0 = _this._stylesheet0$_trySupportsOperation$2(identifier, nameStart); + if (_1_0 != null) { + operation = _1_0; + t1.expectChar$1(41); + return operation; + } + t2 = new A.InterpolationBuffer0(new A.StringBuffer(""), A._setArrayType([], type$.JSArray_Object)); + t2.addInterpolation$1(identifier); + t2.addInterpolation$1(_this._stylesheet0$_interpolatedDeclarationValue$3$allowColon$allowEmpty$allowSemicolon(false, true, true)); + contents = t2.interpolation$1(t1.spanFrom$1(nameStart)); + if (t1.peekChar$0() === 58) + throw exception; + t1.expectChar$1(41); + return new A.SupportsAnything0(contents, t1.spanFrom$1(start)); + } else + throw exception; + } + declaration = _this._stylesheet0$_supportsDeclarationValue$2($name, start); + t1.expectChar$1(41); + return declaration; + }, + _stylesheet0$_supportsDeclarationValue$2($name, start) { + var t1, value, _this = this; + if ($name instanceof A.StringExpression0) + if (!$name.hasQuotes) + t1 = B.JSString_methods.startsWith$1($name.text.get$initialPlain(), "--"); + else + t1 = false; + else + t1 = false; + if (t1) + value = new A.StringExpression0(_this._stylesheet0$_interpolatedDeclarationValue$0(), false); + else { + _this.whitespace$0(); + value = _this._stylesheet0$_expression$0(); + } + return new A.SupportsDeclaration0($name, value, _this.scanner.spanFrom$1(start)); + }, + _stylesheet0$_trySupportsOperation$2(interpolation, start) { + var expression, beforeWhitespace, t2, t3, operator, operation, right, t4, endPosition, t5, t6, lowerOperator, _this = this, _null = null, + t1 = interpolation.contents; + if (t1.length !== 1) + return _null; + expression = B.JSArray_methods.get$first(t1); + if (!type$.Expression_2._is(expression)) + return _null; + t1 = _this.scanner; + beforeWhitespace = new A._SpanScannerState(t1, t1._string_scanner$_position); + _this.whitespace$0(); + for (t2 = start.position, t3 = interpolation.span, operator = _null, operation = operator; _this.lookingAtIdentifier$0();) { + if (operator != null) + _this.expectIdentifier$1(operator); + else if (_this.scanIdentifier$1("and")) + operator = "and"; + else { + if (!_this.scanIdentifier$1("or")) { + if (beforeWhitespace._scanner !== t1) + A.throwExpression(A.ArgumentError$(string$.The_gi, _null)); + t2 = beforeWhitespace.position; + if ((t2 === 0 ? 1 / t2 < 0 : t2 < 0) || t2 > t1.string.length) + A.throwExpression(A.ArgumentError$("Invalid position " + t2, _null)); + t1._string_scanner$_position = t2; + return t1._lastMatch = null; + } + operator = "or"; + } + _this.whitespace$0(); + right = _this._stylesheet0$_supportsConditionInParens$0(); + t4 = operation == null ? new A.SupportsInterpolation0(expression, t3) : operation; + endPosition = t1._string_scanner$_position; + t5 = t1._sourceFile; + t6 = new A._FileSpan(t5, t2, endPosition); + t6._FileSpan$3(t5, t2, endPosition); + operation = new A.SupportsOperation0(t4, right, operator, t6); + lowerOperator = operator.toLowerCase(); + if (lowerOperator !== "and" && lowerOperator !== "or") + A.throwExpression(A.ArgumentError$value(operator, "operator", 'may only be "and" or "or".')); + _this.whitespace$0(); + } + return operation; + }, + _stylesheet0$_lookingAtInterpolatedIdentifier$0() { + var _0_0, + t1 = this.scanner, + _1_0 = t1.peekChar$0(); + $label0$0: { + if (_1_0 == null) { + t1 = false; + break $label0$0; + } + if (_1_0 === 95 || A.CharacterExtension_get_isAlphabetic0(_1_0) || _1_0 >= 128 || 92 === _1_0) { + t1 = true; + break $label0$0; + } + if (35 === _1_0) { + t1 = t1.peekChar$1(1) === 123; + break $label0$0; + } + if (45 === _1_0) { + _0_0 = t1.peekChar$1(1); + $label1$1: { + if (_0_0 == null) { + t1 = false; + break $label1$1; + } + if (35 === _0_0) { + t1 = t1.peekChar$1(2) === 123; + break $label1$1; + } + if (_0_0 === 95 || A.CharacterExtension_get_isAlphabetic0(_0_0) || _0_0 >= 128 || 92 === _0_0 || 45 === _0_0) { + t1 = true; + break $label1$1; + } + t1 = false; + break $label1$1; + } + break $label0$0; + } + t1 = false; + break $label0$0; + } + return t1; + }, + _stylesheet0$_lookingAtPotentialPropertyHack$0() { + var t1 = this.scanner, + _0_0 = t1.peekChar$0(); + $label0$0: { + if (58 === _0_0 || 42 === _0_0 || 46 === _0_0) { + t1 = true; + break $label0$0; + } + if (35 === _0_0) { + t1 = t1.peekChar$1(1) !== 123; + break $label0$0; + } + t1 = false; + break $label0$0; + } + return t1; + }, + _stylesheet0$_lookingAtInterpolatedIdentifierBody$0() { + var t2, + t1 = this.scanner, + _0_0 = t1.peekChar$0(); + $label0$0: { + if (_0_0 == null) { + t1 = false; + break $label0$0; + } + if (!(_0_0 === 95 || A.CharacterExtension_get_isAlphabetic0(_0_0) || _0_0 >= 128)) + t2 = _0_0 >= 48 && _0_0 <= 57 || _0_0 === 45; + else + t2 = true; + if (t2 || 92 === _0_0) { + t1 = true; + break $label0$0; + } + if (35 === _0_0) { + t1 = t1.peekChar$1(1) === 123; + break $label0$0; + } + t1 = false; + break $label0$0; + } + return t1; + }, + _stylesheet0$_lookingAtExpression$0() { + var _0_0, + t1 = this.scanner, + _1_0 = t1.peekChar$0(); + $label0$0: { + if (_1_0 == null) { + t1 = false; + break $label0$0; + } + if (46 === _1_0) { + t1 = t1.peekChar$1(1) !== 46; + break $label0$0; + } + if (33 === _1_0) { + _0_0 = t1.peekChar$1(1); + $label1$1: { + if (_0_0 != null) + if (105 !== _0_0) + if (73 !== _0_0) + t1 = _0_0 === 32 || _0_0 === 9 || _0_0 === 10 || _0_0 === 13 || _0_0 === 12; + else + t1 = true; + else + t1 = true; + else + t1 = true; + if (t1) { + t1 = true; + break $label1$1; + } + t1 = false; + break $label1$1; + } + break $label0$0; + } + if (40 !== _1_0) + if (47 !== _1_0) + if (91 !== _1_0) + if (39 !== _1_0) + if (34 !== _1_0) + if (35 !== _1_0) + if (43 !== _1_0) + if (45 !== _1_0) + if (92 !== _1_0) + if (36 !== _1_0) + if (38 !== _1_0) + if (!(_1_0 === 95 || A.CharacterExtension_get_isAlphabetic0(_1_0) || _1_0 >= 128)) + t1 = _1_0 >= 48 && _1_0 <= 57; + else + t1 = true; + else + t1 = true; + else + t1 = true; + else + t1 = true; + else + t1 = true; + else + t1 = true; + else + t1 = true; + else + t1 = true; + else + t1 = true; + else + t1 = true; + else + t1 = true; + else + t1 = true; + if (t1) { + t1 = true; + break $label0$0; + } + t1 = false; + break $label0$0; + } + return t1; + }, + _stylesheet0$_withChildren$1$3(child, start, create) { + var result = create.call$2(this.children$1(0, child), this.scanner.spanFrom$1(start)); + this.whitespaceWithoutComments$0(); + return result; + }, + _stylesheet0$_withChildren$3(child, start, create) { + return this._stylesheet0$_withChildren$1$3(child, start, create, type$.dynamic); + }, + _stylesheet0$_urlString$0() { + var innerError, stackTrace, t2, exception, + t1 = this.scanner, + start = new A._SpanScannerState(t1, t1._string_scanner$_position), + url = this.string$0(); + try { + t2 = A.Uri_parse(url); + return t2; + } catch (exception) { + t2 = A.unwrapException(exception); + if (type$.FormatException._is(t2)) { + innerError = t2; + stackTrace = A.getTraceFromException(exception); + this.error$3(0, "Invalid URL: " + J.get$message$x(innerError), t1.spanFrom$1(start), stackTrace); + } else + throw exception; + } + }, + _stylesheet0$_publicIdentifier$0() { + var _this = this, + t1 = _this.scanner, + t2 = t1._string_scanner$_position, + result = _this.identifier$1$normalize(true); + _this._stylesheet0$_assertPublic$2(result, new A.StylesheetParser__publicIdentifier_closure0(_this, new A._SpanScannerState(t1, t2))); + return result; + }, + _stylesheet0$_assertPublic$2(identifier, span) { + var first = identifier.charCodeAt(0); + if (!(first === 45 || first === 95)) + return; + this.error$2(0, string$.Privat, span.call$0()); + }, + get$plainCss() { + return false; + } + }; + A.StylesheetParser_parse_closure0.prototype = { + call$0() { + var statements, t4, + t1 = this.$this, + t2 = t1.scanner, + t3 = t2._string_scanner$_position; + t2.scanChar$1(65279); + statements = t1.statements$1(new A.StylesheetParser_parse__closure1(t1)); + t2.expectDone$0(); + t4 = t1._stylesheet0$_globalVariables.get$values(0); + B.JSArray_methods.addAll$1(statements, A.MappedIterable_MappedIterable(t4, new A.StylesheetParser_parse__closure2(), A._instanceType(t4)._eval$1("Iterable.E"), type$.Statement_2)); + return A.Stylesheet$internal0(statements, t2.spanFrom$1(new A._SpanScannerState(t2, t3)), t1.get$plainCss()); + }, + $signature: 548 + }; + A.StylesheetParser_parse__closure1.prototype = { + call$0() { + var t1 = this.$this; + if (t1.scanner.scan$1("@charset")) { + t1.whitespace$0(); + t1.string$0(); + return null; + } + return t1._stylesheet0$_statement$1$root(true); + }, + $signature: 549 + }; + A.StylesheetParser_parse__closure2.prototype = { + call$1(declaration) { + var t1 = declaration.expression; + return A.VariableDeclaration$0(declaration.name, new A.NullExpression0(t1.get$span(t1)), declaration.span, null, false, true, null); + }, + $signature: 550 + }; + A.StylesheetParser_parseArgumentDeclaration_closure0.prototype = { + call$0() { + var $arguments, + t1 = this.$this, + t2 = t1.scanner; + t2.expectChar$2$name(64, "@-rule"); + t1.identifier$0(); + t1.whitespace$0(); + t1.identifier$0(); + $arguments = t1._stylesheet0$_argumentDeclaration$0(); + t1.whitespace$0(); + t2.expectChar$1(123); + return $arguments; + }, + $signature: 551 + }; + A.StylesheetParser__parseSingleProduction_closure0.prototype = { + call$0() { + var result = this.production.call$0(); + this.$this.scanner.expectDone$0(); + return result; + }, + $signature() { + return this.T._eval$1("0()"); + } + }; + A.StylesheetParser_parseSignature_closure.prototype = { + call$0() { + var $arguments, t2, t3, + t1 = this.$this, + $name = t1.identifier$0(); + if (this.requireParens || t1.scanner.peekChar$0() === 40) + $arguments = t1._stylesheet0$_argumentDeclaration$0(); + else { + t2 = t1.scanner; + t2 = A.FileLocation$_(t2._sourceFile, t2._string_scanner$_position); + t3 = t2.offset; + $arguments = new A.ArgumentDeclaration0(B.List_empty22, null, A._FileSpan$(t2.file, t3, t3)); + } + t1.scanner.expectDone$0(); + return new A._Record_2($name, $arguments); + }, + $signature: 552 + }; + A.StylesheetParser__statement_closure0.prototype = { + call$0() { + return this.$this._stylesheet0$_statement$0(); + }, + $signature: 125 + }; + A.StylesheetParser_variableDeclarationWithoutNamespace_closure1.prototype = { + call$0() { + return this.$this.scanner.spanFrom$1(this.start); + }, + $signature: 25 + }; + A.StylesheetParser_variableDeclarationWithoutNamespace_closure2.prototype = { + call$0() { + return this.declaration; + }, + $signature: 553 + }; + A.StylesheetParser__declarationOrBuffer_closure1.prototype = { + call$2(children, span) { + return A.Declaration$nested0(this.name, children, span, null); + }, + $signature: 108 + }; + A.StylesheetParser__declarationOrBuffer_closure2.prototype = { + call$2(children, span) { + return A.Declaration$nested0(this.name, children, span, this._box_0.value); + }, + $signature: 108 + }; + A.StylesheetParser__styleRule_closure0.prototype = { + call$2(children, span) { + var _this = this, + t1 = _this.$this; + if (t1.get$indented() && children.length === 0) + t1.logger.warn$2$span(0, string$.This_s, _this._box_0.interpolation.span); + t1._stylesheet0$_inStyleRule = _this.wasInStyleRule; + return A.StyleRule$0(_this._box_0.interpolation, children, t1.scanner.spanFrom$1(_this.start)); + }, + $signature: 555 + }; + A.StylesheetParser__propertyOrVariableDeclaration_closure1.prototype = { + call$2(children, span) { + return A.Declaration$nested0(this._box_0.name, children, span, null); + }, + $signature: 108 + }; + A.StylesheetParser__propertyOrVariableDeclaration_closure2.prototype = { + call$2(children, span) { + return A.Declaration$nested0(this._box_0.name, children, span, this.value); + }, + $signature: 108 + }; + A.StylesheetParser__atRootRule_closure1.prototype = { + call$2(children, span) { + return A.AtRootRule$0(children, span, this.query); + }, + $signature: 213 + }; + A.StylesheetParser__atRootRule_closure2.prototype = { + call$2(children, span) { + return A.AtRootRule$0(children, span, null); + }, + $signature: 213 + }; + A.StylesheetParser__eachRule_closure0.prototype = { + call$2(children, span) { + var _this = this; + _this.$this._stylesheet0$_inControlDirective = _this.wasInControlDirective; + return A.EachRule$0(_this.variables, _this.list, children, span); + }, + $signature: 557 + }; + A.StylesheetParser__functionRule_closure0.prototype = { + call$2(children, span) { + return A.FunctionRule$0(this.name, this.$arguments, children, span, this.precedingComment); + }, + $signature: 558 + }; + A.StylesheetParser__forRule_closure1.prototype = { + call$0() { + var t1 = this.$this; + if (!t1.lookingAtIdentifier$0()) + return false; + if (t1.scanIdentifier$1("to")) + return this._box_0.exclusive = true; + else if (t1.scanIdentifier$1("through")) { + this._box_0.exclusive = false; + return true; + } else + return false; + }, + $signature: 26 + }; + A.StylesheetParser__forRule_closure2.prototype = { + call$2(children, span) { + var t1, _this = this; + _this.$this._stylesheet0$_inControlDirective = _this.wasInControlDirective; + t1 = _this._box_0.exclusive; + t1.toString; + return A.ForRule$0(_this.variable, _this.from, _this.to, children, span, t1); + }, + $signature: 559 + }; + A.StylesheetParser__memberList_closure0.prototype = { + call$0() { + var t1 = this.$this; + if (t1.scanner.peekChar$0() === 36) + this.variables.add$1(0, t1.variableName$0()); + else + this.identifiers.add$1(0, t1.identifier$1$normalize(true)); + }, + $signature: 1 + }; + A.StylesheetParser__includeRule_closure0.prototype = { + call$2(children, span) { + return A.ContentBlock$0(this.contentArguments_, children, span); + }, + $signature: 560 + }; + A.StylesheetParser_mediaRule_closure0.prototype = { + call$2(children, span) { + return A.MediaRule$0(this.query, children, span); + }, + $signature: 561 + }; + A.StylesheetParser__mixinRule_closure0.prototype = { + call$2(children, span) { + var _this = this; + _this.$this._stylesheet0$_inMixin = false; + return A.MixinRule$0(_this.name, _this.$arguments, children, span, _this.precedingComment); + }, + $signature: 562 + }; + A.StylesheetParser_mozDocumentRule_closure0.prototype = { + call$2(children, span) { + var _this = this; + if (_this._box_0.needsDeprecationWarning) + A.WarnForDeprecation_warnForDeprecation0(_this.$this.logger, B.Deprecation_GbU, string$.x40_moz_, span, null); + return A.AtRule$0(_this.name, span, children, _this.value); + }, + $signature: 210 + }; + A.StylesheetParser_supportsRule_closure0.prototype = { + call$2(children, span) { + return A.SupportsRule$0(this.condition, children, span); + }, + $signature: 564 + }; + A.StylesheetParser__whileRule_closure0.prototype = { + call$2(children, span) { + this.$this._stylesheet0$_inControlDirective = this.wasInControlDirective; + return A.WhileRule$0(this.condition, children, span); + }, + $signature: 565 + }; + A.StylesheetParser_unknownAtRule_closure0.prototype = { + call$2(children, span) { + return A.AtRule$0(this.name, span, children, this._box_0.value); + }, + $signature: 210 + }; + A.StylesheetParser__expression_resetState0.prototype = { + call$0() { + var t2, + t1 = this._box_0; + t1.operands_ = t1.operators_ = t1.spaceExpressions_ = t1.commaExpressions_ = null; + t2 = this.$this; + t2.scanner.set$state(this.start); + t1.allowSlash = true; + t1.singleExpression_ = t2._stylesheet0$_singleExpression$0(); + }, + $signature: 0 + }; + A.StylesheetParser__expression_resolveOneOperation0.prototype = { + call$0() { + var t2, t3, t4, t5, t6, t7, _this = this, + t1 = _this._box_0, + operator = t1.operators_.pop(), + left = t1.operands_.pop(), + right = t1.singleExpression_; + if (right == null) { + t2 = _this.$this.scanner; + t3 = operator.operator.length; + t2.error$3$length$position(0, "Expected expression.", t3, t2._string_scanner$_position - t3); + } + if (t1.allowSlash) { + t2 = _this.$this; + t2 = !t2._stylesheet0$_inParentheses && operator === B.BinaryOperator_t8B0 && t2._stylesheet0$_isSlashOperand$1(left) && t2._stylesheet0$_isSlashOperand$1(right); + } else + t2 = false; + if (t2) + t1.singleExpression_ = new A.BinaryOperationExpression0(B.BinaryOperator_t8B0, left, right, true); + else { + t1.singleExpression_ = new A.BinaryOperationExpression0(operator, left, right, false); + t2 = t1.allowSlash = false; + if (B.BinaryOperator_anB0 === operator || B.BinaryOperator_olz0 === operator) { + t3 = _this.$this; + t4 = t3.scanner.string; + t5 = right.get$span(right); + t5 = t5.get$start(t5); + t6 = right.get$span(right); + t7 = operator.operator; + if (B.JSString_methods.substring$2(t4, t5.offset - 1, t6.get$start(t6).offset) === t7) { + t2 = left.get$span(left); + t2 = t4.charCodeAt(t2.get$end(t2).offset); + t2 = t2 === 32 || t2 === 9 || t2 === 10 || t2 === 13 || t2 === 12; + } + if (t2) { + t2 = left.toString$0(0); + t4 = right.toString$0(0); + t5 = left.toString$0(0); + t6 = right.toString$0(0); + t1 = t1.singleExpression_; + A.WarnForDeprecation_warnForDeprecation0(t3.logger, B.Deprecation_EsU, "This operation is parsed as:\n\n " + t2 + " " + t7 + " " + t4 + string$.x0a_but_ + t5 + " (" + t7 + t6 + ")\n\nAdd a space after " + t7 + string$.x20to_cl, t1.get$span(t1), null); + } + } + } + }, + $signature: 0 + }; + A.StylesheetParser__expression_resolveOperations0.prototype = { + call$0() { + var t1, + operators = this._box_0.operators_; + if (operators == null) + return; + for (t1 = this.resolveOneOperation; operators.length !== 0;) + t1.call$0(); + }, + $signature: 0 + }; + A.StylesheetParser__expression_addSingleExpression0.prototype = { + call$1(expression) { + var t2, spaceExpressions, _this = this, + t1 = _this._box_0; + if (t1.singleExpression_ != null) { + t2 = _this.$this; + if (t2._stylesheet0$_inParentheses) { + t2._stylesheet0$_inParentheses = false; + if (t1.allowSlash) { + _this.resetState.call$0(); + return; + } + } + spaceExpressions = t1.spaceExpressions_; + if (spaceExpressions == null) + spaceExpressions = t1.spaceExpressions_ = A._setArrayType([], type$.JSArray_Expression_2); + _this.resolveOperations.call$0(); + t2 = t1.singleExpression_; + t2.toString; + spaceExpressions.push(t2); + t1.allowSlash = true; + } + t1.singleExpression_ = expression; + }, + $signature: 566 + }; + A.StylesheetParser__expression_addOperator0.prototype = { + call$1(operator) { + var t2, t3, operators, operands, t4, singleExpression, + t1 = this.$this; + if (t1.get$plainCss() && operator !== B.BinaryOperator_2jN0 && operator !== B.BinaryOperator_anB0 && operator !== B.BinaryOperator_olz0 && operator !== B.BinaryOperator_qN20 && operator !== B.BinaryOperator_t8B0) { + t2 = t1.scanner; + t3 = operator.operator.length; + t2.error$3$length$position(0, "Operators aren't allowed in plain CSS.", t3, t2._string_scanner$_position - t3); + } + t2 = this._box_0; + t2.allowSlash = t2.allowSlash && operator === B.BinaryOperator_t8B0; + operators = t2.operators_; + if (operators == null) + operators = t2.operators_ = A._setArrayType([], type$.JSArray_BinaryOperator_2); + operands = t2.operands_; + if (operands == null) + operands = t2.operands_ = A._setArrayType([], type$.JSArray_Expression_2); + t3 = this.resolveOneOperation; + t4 = operator.precedence; + while (true) { + if (!(operators.length !== 0 && B.JSArray_methods.get$last(operators).precedence >= t4)) + break; + t3.call$0(); + } + operators.push(operator); + singleExpression = t2.singleExpression_; + if (singleExpression == null) { + t3 = t1.scanner; + t4 = operator.operator.length; + t3.error$3$length$position(0, "Expected expression.", t4, t3._string_scanner$_position - t4); + } + operands.push(singleExpression); + t1.whitespace$0(); + t2.singleExpression_ = t1._stylesheet0$_singleExpression$0(); + }, + $signature: 567 + }; + A.StylesheetParser__expression_resolveSpaceExpressions0.prototype = { + call$0() { + var t1, spaceExpressions, singleExpression, t2; + this.resolveOperations.call$0(); + t1 = this._box_0; + spaceExpressions = t1.spaceExpressions_; + if (spaceExpressions == null) + return; + singleExpression = t1.singleExpression_; + if (singleExpression == null) + this.$this.scanner.error$1(0, "Expected expression."); + spaceExpressions.push(singleExpression); + t2 = B.JSArray_methods.get$first(spaceExpressions); + t2 = t2.get$span(t2).expand$1(0, singleExpression.get$span(singleExpression)); + t1.singleExpression_ = new A.ListExpression0(A.List_List$unmodifiable(spaceExpressions, type$.Expression_2), B.ListSeparator_EVt0, false, t2); + t1.spaceExpressions_ = null; + }, + $signature: 0 + }; + A.StylesheetParser_expressionUntilComma_closure0.prototype = { + call$0() { + return this.$this.scanner.peekChar$0() === 44; + }, + $signature: 26 + }; + A.StylesheetParser__isHexColor_closure0.prototype = { + call$1(char) { + return A.CharacterExtension_get_isHex0(char); + }, + $signature: 46 + }; + A.StylesheetParser__unicodeRange_closure1.prototype = { + call$1(char) { + return char != null && A.CharacterExtension_get_isHex0(char); + }, + $signature: 28 + }; + A.StylesheetParser__unicodeRange_closure2.prototype = { + call$1(char) { + return char != null && A.CharacterExtension_get_isHex0(char); + }, + $signature: 28 + }; + A.StylesheetParser_namespacedExpression_closure0.prototype = { + call$0() { + return this.$this.scanner.spanFrom$1(this.start); + }, + $signature: 25 + }; + A.StylesheetParser_trySpecialFunction_closure0.prototype = { + call$1(contents) { + return new A.StringExpression0(contents, false); + }, + $signature: 568 + }; + A.StylesheetParser__expressionUntilComparison_closure0.prototype = { + call$0() { + var t1 = this.$this.scanner, + _0_0 = t1.peekChar$0(); + $label0$0: { + if (61 === _0_0) { + t1 = t1.peekChar$1(1) !== 61; + break $label0$0; + } + if (60 === _0_0 || 62 === _0_0) { + t1 = true; + break $label0$0; + } + t1 = false; + break $label0$0; + } + return t1; + }, + $signature: 26 + }; + A.StylesheetParser__publicIdentifier_closure0.prototype = { + call$0() { + return this.$this.scanner.spanFrom$1(this.start); + }, + $signature: 25 + }; + A.Stylesheet0.prototype = { + Stylesheet$internal$3$plainCss0(children, span, plainCss) { + var t1, t2, t3, t4, _i, child; + for (t1 = this.children, t2 = t1.length, t3 = this._stylesheet1$_forwards, t4 = this._stylesheet1$_uses, _i = 0; _i < t2; ++_i) { + child = t1[_i]; + if (child instanceof A.UseRule0) { + t4.push(child); + continue; + } + if (child instanceof A.ForwardRule0) { + t3.push(child); + continue; + } + if (child instanceof A.SilentComment0 || child instanceof A.LoudComment0 || child instanceof A.VariableDeclaration0) + continue; + break; + } + }, + accept$1$1(visitor) { + return visitor.visitStylesheet$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + toString$0(_) { + var t1 = this.children; + return (t1 && B.JSArray_methods).join$1(t1, " "); + }, + get$span(receiver) { + return this.span; + } + }; + A.SupportsExpression0.prototype = { + get$span(_) { + var t1 = this.condition; + return t1.get$span(t1); + }, + accept$1$1(visitor) { + return visitor.visitSupportsExpression$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + toString$0(_) { + return this.condition.toString$0(0); + }, + $isExpression0: 1, + $isAstNode0: 1 + }; + A.ModifiableCssSupportsRule0.prototype = { + accept$1$1(visitor) { + return visitor.visitCssSupportsRule$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + equalsIgnoringChildren$1(other) { + var t1, t2; + if (other instanceof A.ModifiableCssSupportsRule0) { + t1 = this.condition; + t2 = other.condition; + t1 = t1.$ti._is(t2) && J.$eq$(t2.value, t1.value); + } else + t1 = false; + return t1; + }, + copyWithoutChildren$0() { + return A.ModifiableCssSupportsRule$0(this.condition, this.span); + }, + get$span(receiver) { + return this.span; + } + }; + A.SupportsRule0.prototype = { + accept$1$1(visitor) { + return visitor.visitSupportsRule$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + toString$0(_) { + var t1 = this.children; + return "@supports " + this.condition.toString$0(0) + " {" + (t1 && B.JSArray_methods).join$1(t1, " ") + "}"; + }, + get$span(receiver) { + return this.span; + } + }; + A.JSToDartImporter.prototype = { + canonicalize$1(_, url) { + var t1, + result = A.wrapJSExceptions(new A.JSToDartImporter_canonicalize_closure(this, url)); + if (result == null) + return null; + t1 = self.URL; + if (result instanceof t1) + return A.Uri_parse(J.toString$0$(type$.JSUrl._as(result))); + t1 = self.Promise; + if (result instanceof t1) + A.jsThrow(new self.Error("The canonicalize() function can't return a Promise for synchronous compile functions.")); + else + A.jsThrow(new self.Error(string$.The_ca)); + }, + load$1(_, url) { + var t1, contents, syntax, t2, + result = A.wrapJSExceptions(new A.JSToDartImporter_load_closure(this, url)); + if (result == null) + return null; + t1 = self.Promise; + if (result instanceof t1) + A.jsThrow(new self.Error("The load() function can't return a Promise for synchronous compile functions.")); + type$.JSImporterResult._as(result); + t1 = J.getInterceptor$x(result); + contents = t1.get$contents(result); + if (A._asString(new self.Function("value", "return typeof value").call$1(contents)) !== "string") + A.jsThrow(new A.ArgumentError(true, contents, "contents", "must be a string but was: " + A.jsType(contents))); + syntax = t1.get$syntax(result); + if (contents == null || syntax == null) + A.jsThrow(new self.Error(string$.The_lo)); + t2 = A.parseSyntax(syntax); + return A.ImporterResult$(contents, A.NullableExtension_andThen0(t1.get$sourceMapUrl(result), A.utils1__jsToDartUrl$closure()), t2); + }, + isNonCanonicalScheme$1(scheme) { + return this._sync$_nonCanonicalSchemes.contains$1(0, scheme); + } + }; + A.JSToDartImporter_canonicalize_closure.prototype = { + call$0() { + return this.$this._sync$_canonicalize.call$2(this.url.toString$0(0), {fromImport: A.fromImport0(), containingUrl: A.NullableExtension_andThen0(A.containingUrl0(), A.utils1__dartToJSUrl$closure())}); + }, + $signature: 35 + }; + A.JSToDartImporter_load_closure.prototype = { + call$0() { + return this.$this._sync$_load.call$1(new self.URL(this.url.toString$0(0))); + }, + $signature: 35 + }; + A.Syntax0.prototype = { + _enumToString$0() { + return "Syntax." + this._name; + }, + toString$0(_) { + return this._syntax0$_name; + } + }; + A.TypeSelector0.prototype = { + get$specificity() { + return 1; + }, + accept$1$1(visitor) { + return visitor.visitTypeSelector$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + addSuffix$1(suffix) { + var t1 = this.name; + return new A.TypeSelector0(new A.QualifiedName0(t1.name + suffix, t1.namespace), this.span); + }, + unify$1(compound) { + var unified, t1, + _0_0 = B.JSArray_methods.get$first(compound); + if (_0_0 instanceof A.UniversalSelector0 || _0_0 instanceof A.TypeSelector0) { + unified = A.unifyUniversalAndElement0(this, B.JSArray_methods.get$first(compound)); + if (unified == null) + return null; + t1 = A._setArrayType([unified], type$.JSArray_SimpleSelector_2); + B.JSArray_methods.addAll$1(t1, A.SubListIterable$(compound, 1, null, A._arrayInstanceType(compound)._precomputed1)); + return t1; + } else { + t1 = A._setArrayType([this], type$.JSArray_SimpleSelector_2); + B.JSArray_methods.addAll$1(t1, compound); + return t1; + } + }, + isSuperselector$1(other) { + var t1, t2; + if (!this.super$SimpleSelector$isSuperselector0(other)) + if (other instanceof A.TypeSelector0) { + t1 = this.name; + t2 = other.name; + if (t1.name === t2.name) { + t1 = t1.namespace; + t1 = t1 === "*" || t1 == t2.namespace; + } else + t1 = false; + } else + t1 = false; + else + t1 = true; + return t1; + }, + $eq(_, other) { + if (other == null) + return false; + return other instanceof A.TypeSelector0 && other.name.$eq(0, this.name); + }, + get$hashCode(_) { + var t1 = this.name; + return B.JSString_methods.get$hashCode(t1.name) ^ J.get$hashCode$(t1.namespace); + } + }; + A.Types.prototype = {}; + A.UnaryOperationExpression0.prototype = { + accept$1$1(visitor) { + return visitor.visitUnaryOperationExpression$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + toString$0(_) { + var operand, + t1 = this.operator, + t2 = t1.operator; + t1 = t1 === B.UnaryOperator_not_not_not0 ? t2 + A.Primitives_stringFromCharCode(32) : t2; + operand = this.operand; + $label0$0: { + if (!(operand instanceof A.BinaryOperationExpression0)) + if (!(operand instanceof A.UnaryOperationExpression0)) + t2 = operand instanceof A.ListExpression0 && !operand.hasBrackets && operand.contents.length >= 2; + else + t2 = true; + else + t2 = true; + if (t2) { + t2 = true; + break $label0$0; + } + t2 = false; + break $label0$0; + } + if (t2) + t1 += "40"; + t1 += operand.toString$0(0); + if (t2) + t1 += "41"; + return t1.charCodeAt(0) == 0 ? t1 : t1; + }, + $isExpression0: 1, + $isAstNode0: 1, + get$span(receiver) { + return this.span; + } + }; + A.UnaryOperator0.prototype = { + _enumToString$0() { + return "UnaryOperator." + this._name; + }, + toString$0(_) { + return this.name; + } + }; + A.UnitlessSassNumber0.prototype = { + get$numeratorUnits(_) { + return B.List_empty; + }, + get$denominatorUnits(_) { + return B.List_empty; + }, + get$hasUnits() { + return false; + }, + get$hasComplexUnits() { + return false; + }, + withValue$1(value) { + return new A.UnitlessSassNumber0(value, null); + }, + withSlash$2(numerator, denominator) { + return new A.UnitlessSassNumber0(this._number1$_value, new A._Record_2(numerator, denominator)); + }, + hasUnit$1(unit) { + return false; + }, + hasCompatibleUnits$1(other) { + return other instanceof A.UnitlessSassNumber0; + }, + hasPossiblyCompatibleUnits$1(other) { + return other instanceof A.UnitlessSassNumber0; + }, + compatibleWithUnit$1(unit) { + return true; + }, + coerceToMatch$3(other, $name, otherName) { + return other.withValue$1(this._number1$_value); + }, + coerceToMatch$1(other) { + return this.coerceToMatch$3(other, null, null); + }, + coerceValueToMatch$3(other, $name, otherName) { + return this._number1$_value; + }, + coerceValueToMatch$1(other) { + return this.coerceValueToMatch$3(other, null, null); + }, + convertToMatch$3(other, $name, otherName) { + return other.get$hasUnits() ? this.super$SassNumber$convertToMatch(other, $name, otherName) : this; + }, + convertValueToMatch$3(other, $name, otherName) { + return other.get$hasUnits() ? this.super$SassNumber$convertValueToMatch0(other, $name, otherName) : this._number1$_value; + }, + convertValueToMatch$1(other) { + return this.convertValueToMatch$3(other, null, null); + }, + coerce$3(newNumerators, newDenominators, $name) { + return A.SassNumber_SassNumber$withUnits0(this._number1$_value, newDenominators, newNumerators); + }, + coerce$2(newNumerators, newDenominators) { + return this.coerce$3(newNumerators, newDenominators, null); + }, + coerceValue$3(newNumerators, newDenominators, $name) { + return this._number1$_value; + }, + coerceValueToUnit$2(unit, $name) { + return this._number1$_value; + }, + coerceValueToUnit$1(unit) { + return this.coerceValueToUnit$2(unit, null); + }, + greaterThan$1(other) { + var t1, t2; + if (other instanceof A.SassNumber0) { + t1 = this._number1$_value; + t2 = other._number1$_value; + return t1 > t2 && !A.fuzzyEquals0(t1, t2) ? B.SassBoolean_true0 : B.SassBoolean_false0; + } + return this.super$SassNumber$greaterThan0(other); + }, + greaterThanOrEquals$1(other) { + var t1, t2; + if (other instanceof A.SassNumber0) { + t1 = this._number1$_value; + t2 = other._number1$_value; + return t1 > t2 || A.fuzzyEquals0(t1, t2) ? B.SassBoolean_true0 : B.SassBoolean_false0; + } + return this.super$SassNumber$greaterThanOrEquals0(other); + }, + lessThan$1(other) { + var t1, t2; + if (other instanceof A.SassNumber0) { + t1 = this._number1$_value; + t2 = other._number1$_value; + return t1 < t2 && !A.fuzzyEquals0(t1, t2) ? B.SassBoolean_true0 : B.SassBoolean_false0; + } + return this.super$SassNumber$lessThan0(other); + }, + lessThanOrEquals$1(other) { + var t1, t2; + if (other instanceof A.SassNumber0) { + t1 = this._number1$_value; + t2 = other._number1$_value; + return t1 < t2 || A.fuzzyEquals0(t1, t2) ? B.SassBoolean_true0 : B.SassBoolean_false0; + } + return this.super$SassNumber$lessThanOrEquals0(other); + }, + modulo$1(other) { + if (other instanceof A.SassNumber0) + return other.withValue$1(A.moduloLikeSass0(this._number1$_value, other._number1$_value)); + return this.super$SassNumber$modulo0(other); + }, + plus$1(other) { + if (other instanceof A.SassNumber0) + return other.withValue$1(this._number1$_value + other._number1$_value); + return this.super$SassNumber$plus0(other); + }, + minus$1(other) { + if (other instanceof A.SassNumber0) + return other.withValue$1(this._number1$_value - other._number1$_value); + return this.super$SassNumber$minus0(other); + }, + times$1(other) { + if (other instanceof A.SassNumber0) + return other.withValue$1(this._number1$_value * other._number1$_value); + return this.super$SassNumber$times0(other); + }, + dividedBy$1(other) { + var t1, t2; + if (other instanceof A.SassNumber0) { + t1 = this._number1$_value / other._number1$_value; + if (other.get$hasUnits()) { + t2 = other.get$denominatorUnits(other); + t2 = A.SassNumber_SassNumber$withUnits0(t1, other.get$numeratorUnits(other), t2); + t1 = t2; + } else + t1 = new A.UnitlessSassNumber0(t1, null); + return t1; + } + return this.super$SassNumber$dividedBy0(other); + }, + unaryMinus$0() { + return new A.UnitlessSassNumber0(-this._number1$_value, null); + }, + $eq(_, other) { + if (other == null) + return false; + return other instanceof A.UnitlessSassNumber0 && A.fuzzyEquals0(this._number1$_value, other._number1$_value); + }, + get$hashCode(_) { + var t1 = this.hashCache; + return t1 == null ? this.hashCache = A.fuzzyHashCode0(this._number1$_value) : t1; + } + }; + A.UniversalSelector0.prototype = { + get$specificity() { + return 0; + }, + accept$1$1(visitor) { + return visitor.visitUniversalSelector$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + unify$1(compound) { + var _0_4, t1, rest, _0_4_isSet, unified, _this = this, _null = null, + _0_1 = compound.length; + if (_0_1 >= 1) { + _0_4 = compound[0]; + t1 = _0_4; + if (!(t1 instanceof A.UniversalSelector0)) + t1 = _0_4 instanceof A.TypeSelector0; + else + t1 = true; + if (t1) { + rest = B.JSArray_methods.sublist$1(compound, 1); + t1 = true; + } else { + rest = _null; + t1 = false; + } + _0_4_isSet = true; + } else { + rest = _null; + _0_4 = rest; + _0_4_isSet = false; + t1 = false; + } + if (t1) { + unified = A.unifyUniversalAndElement0(_this, B.JSArray_methods.get$first(compound)); + if (unified == null) + return _null; + t1 = A._setArrayType([unified], type$.JSArray_SimpleSelector_2); + B.JSArray_methods.addAll$1(t1, rest); + return t1; + } + if (_0_1 === 1) { + if (_0_4_isSet) + t1 = _0_4; + else { + _0_4 = compound[0]; + t1 = _0_4; + _0_4_isSet = true; + } + if (t1 instanceof A.PseudoSelector0) { + t1 = _0_4_isSet ? _0_4 : compound[0]; + type$.PseudoSelector_2._as(t1); + t1 = t1.isClass && t1.name === "host" || t1.get$isHostContext(); + } else + t1 = false; + } else + t1 = false; + if (t1) + return _null; + if (_0_1 <= 0) + return A._setArrayType([_this], type$.JSArray_SimpleSelector_2); + t1 = _this.namespace; + if (t1 == null || t1 === "*") + t1 = compound; + else { + t1 = A._setArrayType([_this], type$.JSArray_SimpleSelector_2); + B.JSArray_methods.addAll$1(t1, compound); + } + return t1; + }, + isSuperselector$1(other) { + var t1 = this.namespace; + if (t1 === "*") + return true; + if (other instanceof A.TypeSelector0) + return t1 == other.name.namespace; + if (other instanceof A.UniversalSelector0) + return t1 == other.namespace; + return t1 == null || this.super$SimpleSelector$isSuperselector0(other); + }, + $eq(_, other) { + if (other == null) + return false; + return other instanceof A.UniversalSelector0 && other.namespace == this.namespace; + }, + get$hashCode(_) { + return J.get$hashCode$(this.namespace); + } + }; + A.UnprefixedMapView0.prototype = { + get$keys(_) { + return new A._UnprefixedKeys0(this); + }, + $index(_, key) { + return typeof key == "string" ? this._unprefixed_map_view0$_map.$index(0, this._unprefixed_map_view0$_prefix + key) : null; + }, + containsKey$1(key) { + return typeof key == "string" && this._unprefixed_map_view0$_map.containsKey$1(this._unprefixed_map_view0$_prefix + key); + }, + remove$1(_, key) { + return typeof key == "string" ? this._unprefixed_map_view0$_map.remove$1(0, this._unprefixed_map_view0$_prefix + key) : null; + } + }; + A._UnprefixedKeys0.prototype = { + get$iterator(_) { + var t1 = this._unprefixed_map_view0$_view._unprefixed_map_view0$_map; + t1 = J.where$1$ax(t1.get$keys(t1), new A._UnprefixedKeys_iterator_closure1(this)).map$1$1(0, new A._UnprefixedKeys_iterator_closure2(this), type$.String); + return t1.get$iterator(t1); + }, + contains$1(_, key) { + return this._unprefixed_map_view0$_view.containsKey$1(key); + } + }; + A._UnprefixedKeys_iterator_closure1.prototype = { + call$1(key) { + return B.JSString_methods.startsWith$1(key, this.$this._unprefixed_map_view0$_view._unprefixed_map_view0$_prefix); + }, + $signature: 4 + }; + A._UnprefixedKeys_iterator_closure2.prototype = { + call$1(key) { + return B.JSString_methods.substring$1(key, this.$this._unprefixed_map_view0$_view._unprefixed_map_view0$_prefix.length); + }, + $signature: 5 + }; + A.JSUrl0.prototype = {}; + A.UseRule0.prototype = { + UseRule$4$configuration0(url, namespace, span, configuration) { + var t1, t2, _i, variable; + for (t1 = this.configuration, t2 = t1.length, _i = 0; _i < t2; ++_i) { + variable = t1[_i]; + if (variable.isGuarded) + throw A.wrapException(A.ArgumentError$value(variable, "configured variable", "can't be guarded in a @use rule.")); + } + }, + accept$1$1(visitor) { + return visitor.visitUseRule$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + toString$0(_) { + var t1 = this.url, + t2 = "@use " + A.StringExpression_quoteText0(t1.toString$0(0)), + basename = t1.get$pathSegments().length === 0 ? "" : B.JSArray_methods.get$last(t1.get$pathSegments()), + dot = B.JSString_methods.indexOf$1(basename, "."); + t1 = this.namespace; + if (t1 !== B.JSString_methods.substring$2(basename, 0, dot === -1 ? basename.length : dot)) + t1 = t2 + (" as " + (t1 == null ? "*" : t1)); + else + t1 = t2; + t2 = this.configuration; + t1 = (t2.length !== 0 ? t1 + (" with (" + B.JSArray_methods.join$1(t2, ", ") + ")") : t1) + ";"; + return t1.charCodeAt(0) == 0 ? t1 : t1; + }, + $isAstNode0: 1, + $isStatement0: 1, + get$span(receiver) { + return this.span; + } + }; + A.UserDefinedCallable0.prototype = { + get$name(_) { + return this.declaration.name; + }, + $isAsyncCallable0: 1, + $isCallable: 1 + }; + A.resolveImportPath_closure1.prototype = { + call$0() { + return A._exactlyOne0(A._tryPath0($.$get$context().withoutExtension$1(this.path) + ".import" + this.extension)); + }, + $signature: 45 + }; + A.resolveImportPath_closure2.prototype = { + call$0() { + return A._exactlyOne0(A._tryPathWithExtensions0(this.path + ".import")); + }, + $signature: 45 + }; + A._tryPathAsDirectory_closure0.prototype = { + call$0() { + return A._exactlyOne0(A._tryPathWithExtensions0(A.join(this.path, "index.import", null))); + }, + $signature: 45 + }; + A._exactlyOne_closure0.prototype = { + call$1(path) { + var t1 = $.$get$context(); + return " " + t1.prettyUri$1(t1.toUri$1(path)); + }, + $signature: 5 + }; + A._PropertyDescriptor0.prototype = {}; + A.futureToPromise_closure0.prototype = { + call$2(resolve, reject) { + this.future.then$1$2$onError(0, new A.futureToPromise__closure0(resolve), new A.futureToPromise__closure1(reject), type$.void); + }, + $signature: 569 + }; + A.futureToPromise__closure0.prototype = { + call$1(result) { + return this.resolve.call$1(result); + }, + $signature: 33 + }; + A.futureToPromise__closure1.prototype = { + call$2(error, stackTrace) { + A.attachTrace0(error, stackTrace); + this.reject.call$1(error); + }, + $signature: 53 + }; + A.objectToMap_closure.prototype = { + call$2(key, value) { + this.map.$indexSet(0, key, value); + return value; + }, + $signature: 128 + }; + A._RequireMain0.prototype = {}; + A.indent_closure0.prototype = { + call$1(line) { + return B.JSString_methods.$mul(" ", this.indentation) + line; + }, + $signature: 5 + }; + A.flattenVertically_closure1.prototype = { + call$1(inner) { + return A.QueueList_QueueList$from(inner, this.T); + }, + $signature() { + return this.T._eval$1("QueueList<0>(Iterable<0>)"); + } + }; + A.flattenVertically_closure2.prototype = { + call$1(queue) { + this.result.push(queue.removeFirst$0()); + return queue.get$length(0) === 0; + }, + $signature() { + return this.T._eval$1("bool(QueueList<0>)"); + } + }; + A.longestCommonSubsequence_backtrack0.prototype = { + call$2(i, j) { + var selection, t1, _this = this; + if (i === -1 || j === -1) + return A._setArrayType([], _this.T._eval$1("JSArray<0>")); + selection = _this.selections[i][j]; + if (selection != null) { + t1 = _this.call$2(i - 1, j - 1); + J.add$1$ax(t1, selection); + return t1; + } + t1 = _this.lengths; + return t1[i + 1][j] > t1[i][j + 1] ? _this.call$2(i, j - 1) : _this.call$2(i - 1, j); + }, + $signature() { + return this.T._eval$1("List<0>(int,int)"); + } + }; + A.mapAddAll2_closure0.prototype = { + call$2(key, inner) { + var t1 = this.destination, + _0_0 = t1.$index(0, key); + if (_0_0 != null) + _0_0.addAll$1(0, inner); + else + t1.$indexSet(0, key, inner); + }, + $signature() { + return this.K1._eval$1("@<0>")._bind$1(this.K2)._bind$1(this.V)._eval$1("~(1,Map<2,3>)"); + } + }; + A.CssValue0.prototype = { + $eq(_, other) { + if (other == null) + return false; + return this.$ti._is(other) && J.$eq$(other.value, this.value); + }, + get$hashCode(_) { + return J.get$hashCode$(this.value); + }, + toString$0(_) { + return J.toString$0$(this.value); + }, + $isAstNode0: 1, + get$span(receiver) { + return this.span; + } + }; + A.ValueExpression0.prototype = { + accept$1$1(visitor) { + return visitor.visitValueExpression$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + toString$0(_) { + return A.serializeValue0(this.value, true, true); + }, + $isExpression0: 1, + $isAstNode0: 1, + get$span(receiver) { + return this.span; + } + }; + A.valueClass_closure.prototype = { + call$0() { + var t2, + t1 = type$.JSClass, + jsClass = t1._as(self.Object.getPrototypeOf(J.get$$prototype$x(t1._as(B.C__SassNull0.constructor))).constructor); + A.JSClassExtension_setCustomInspect(jsClass, new A.valueClass__closure()); + t1 = type$.String; + t2 = type$.Function; + A.LinkedHashMap_LinkedHashMap$_literal(["asList", new A.valueClass__closure0(), "hasBrackets", new A.valueClass__closure1(), "isTruthy", new A.valueClass__closure2(), "realNull", new A.valueClass__closure3(), "separator", new A.valueClass__closure4()], t1, t2).forEach$1(0, A.JSClassExtension_get_defineGetter(jsClass)); + A.LinkedHashMap_LinkedHashMap$_literal(["sassIndexToListIndex", new A.valueClass__closure5(), "get", new A.valueClass__closure6(), "assertBoolean", new A.valueClass__closure7(), "assertCalculation", new A.valueClass__closure8(), "assertColor", new A.valueClass__closure9(), "assertFunction", new A.valueClass__closure10(), "assertMap", new A.valueClass__closure11(), "assertMixin", new A.valueClass__closure12(), "assertNumber", new A.valueClass__closure13(), "assertString", new A.valueClass__closure14(), "tryMap", new A.valueClass__closure15(), "equals", new A.valueClass__closure16(), "hashCode", new A.valueClass__closure17(), "toString", new A.valueClass__closure18()], t1, t2).forEach$1(0, A.JSClassExtension_get_defineMethod(jsClass)); + return jsClass; + }, + $signature: 13 + }; + A.valueClass__closure.prototype = { + call$1($self) { + return J.toString$0$($self); + }, + $signature: 137 + }; + A.valueClass__closure0.prototype = { + call$1($self) { + return new self.immutable.List($self.get$asList()); + }, + $signature: 570 + }; + A.valueClass__closure1.prototype = { + call$1($self) { + return $self.get$hasBrackets(); + }, + $signature: 49 + }; + A.valueClass__closure2.prototype = { + call$1($self) { + return $self.get$isTruthy(); + }, + $signature: 49 + }; + A.valueClass__closure3.prototype = { + call$1($self) { + return $self.get$realNull(); + }, + $signature: 244 + }; + A.valueClass__closure4.prototype = { + call$1($self) { + return $self.get$separator($self).separator; + }, + $signature: 571 + }; + A.valueClass__closure5.prototype = { + call$3($self, sassIndex, $name) { + return $self.sassIndexToListIndex$2(sassIndex, $name); + }, + call$2($self, sassIndex) { + return this.call$3($self, sassIndex, null); + }, + "call*": "call$3", + $requiredArgCount: 2, + $defaultValues() { + return [null]; + }, + $signature: 572 + }; + A.valueClass__closure6.prototype = { + call$2($self, index) { + return index < 1 && index >= -1 ? $self : self.undefined; + }, + $signature: 182 + }; + A.valueClass__closure7.prototype = { + call$2($self, $name) { + return $self.assertBoolean$1($name); + }, + call$1($self) { + return this.call$2($self, null); + }, + "call*": "call$2", + $requiredArgCount: 1, + $defaultValues() { + return [null]; + }, + $signature: 573 + }; + A.valueClass__closure8.prototype = { + call$2($self, $name) { + return $self.assertCalculation$1($name); + }, + call$1($self) { + return this.call$2($self, null); + }, + "call*": "call$2", + $requiredArgCount: 1, + $defaultValues() { + return [null]; + }, + $signature: 574 + }; + A.valueClass__closure9.prototype = { + call$2($self, $name) { + return $self.assertColor$1($name); + }, + call$1($self) { + return this.call$2($self, null); + }, + "call*": "call$2", + $requiredArgCount: 1, + $defaultValues() { + return [null]; + }, + $signature: 575 + }; + A.valueClass__closure10.prototype = { + call$2($self, $name) { + return $self.assertFunction$1($name); + }, + call$1($self) { + return this.call$2($self, null); + }, + "call*": "call$2", + $requiredArgCount: 1, + $defaultValues() { + return [null]; + }, + $signature: 576 + }; + A.valueClass__closure11.prototype = { + call$2($self, $name) { + return $self.assertMap$1($name); + }, + call$1($self) { + return this.call$2($self, null); + }, + "call*": "call$2", + $requiredArgCount: 1, + $defaultValues() { + return [null]; + }, + $signature: 577 + }; + A.valueClass__closure12.prototype = { + call$2($self, $name) { + return $self.assertMixin$1($name); + }, + call$1($self) { + return this.call$2($self, null); + }, + "call*": "call$2", + $requiredArgCount: 1, + $defaultValues() { + return [null]; + }, + $signature: 578 + }; + A.valueClass__closure13.prototype = { + call$2($self, $name) { + return $self.assertNumber$1($name); + }, + call$1($self) { + return this.call$2($self, null); + }, + "call*": "call$2", + $requiredArgCount: 1, + $defaultValues() { + return [null]; + }, + $signature: 579 + }; + A.valueClass__closure14.prototype = { + call$2($self, $name) { + return $self.assertString$1($name); + }, + call$1($self) { + return this.call$2($self, null); + }, + "call*": "call$2", + $requiredArgCount: 1, + $defaultValues() { + return [null]; + }, + $signature: 580 + }; + A.valueClass__closure15.prototype = { + call$1($self) { + return $self.tryMap$0(); + }, + $signature: 581 + }; + A.valueClass__closure16.prototype = { + call$2($self, other) { + return $self.$eq(0, other); + }, + $signature: 582 + }; + A.valueClass__closure17.prototype = { + call$2($self, _) { + return $self.get$hashCode($self); + }, + call$1($self) { + return this.call$2($self, null); + }, + "call*": "call$2", + $requiredArgCount: 1, + $defaultValues() { + return [null]; + }, + $signature: 583 + }; + A.valueClass__closure18.prototype = { + call$1($self) { + return A.serializeValue0($self, true, true); + }, + $signature: 193 + }; + A.Value0.prototype = { + get$isTruthy() { + return true; + }, + get$separator(_) { + return B.ListSeparator_undecided_null_undecided0; + }, + get$hasBrackets() { + return false; + }, + get$asList() { + return A._setArrayType([this], type$.JSArray_Value_2); + }, + get$lengthAsList() { + return 1; + }, + get$isBlank() { + return false; + }, + get$isSpecialNumber() { + return false; + }, + get$isVar() { + return false; + }, + get$realNull() { + return this; + }, + sassIndexToListIndex$2(sassIndex, $name) { + var t1, t2, index, + indexValue = sassIndex.assertNumber$1($name); + if (indexValue.get$hasUnits()) { + t1 = indexValue.get$unitString(); + t2 = indexValue.unitSuggestion$1($name == null ? "index" : $name); + A.EvaluationContext_current0().warn$2(0, "$" + A.S($name) + ": Passing a number with unit " + t1 + string$.x20is_de + t2 + string$.x0a_Morex3a, B.Deprecation_0bn); + } + index = indexValue.assertInt$1($name); + if (index === 0) + throw A.wrapException(A.SassScriptException$0("List index may not be 0.", $name)); + if (Math.abs(index) > this.get$lengthAsList()) + throw A.wrapException(A.SassScriptException$0("Invalid index " + sassIndex.toString$0(0) + " for a list with " + this.get$lengthAsList() + " elements.", $name)); + return index < 0 ? this.get$lengthAsList() + index : index - 1; + }, + assertBoolean$1($name) { + return A.throwExpression(A.SassScriptException$0(this.toString$0(0) + " is not a boolean.", $name)); + }, + assertCalculation$1($name) { + return A.throwExpression(A.SassScriptException$0(this.toString$0(0) + " is not a calculation.", $name)); + }, + assertColor$1($name) { + return A.throwExpression(A.SassScriptException$0(this.toString$0(0) + " is not a color.", $name)); + }, + assertFunction$1($name) { + return A.throwExpression(A.SassScriptException$0(this.toString$0(0) + " is not a function reference.", $name)); + }, + assertMixin$1($name) { + return A.throwExpression(A.SassScriptException$0(this.toString$0(0) + " is not a mixin reference.", $name)); + }, + assertMap$1($name) { + return A.throwExpression(A.SassScriptException$0(this.toString$0(0) + " is not a map.", $name)); + }, + tryMap$0() { + return null; + }, + assertNumber$1($name) { + return A.throwExpression(A.SassScriptException$0(this.toString$0(0) + " is not a number.", $name)); + }, + assertNumber$0() { + return this.assertNumber$1(null); + }, + assertString$1($name) { + return A.throwExpression(A.SassScriptException$0(this.toString$0(0) + " is not a string.", $name)); + }, + _value$_selectorString$1($name) { + var _0_0 = this._value$_selectorStringOrNull$0(); + if (_0_0 != null) + return _0_0; + throw A.wrapException(A.SassScriptException$0(this.toString$0(0) + string$.x20is_noa, $name)); + }, + _value$_selectorStringOrNull$0() { + var t1, t2, result, _1_0, _i, complex, string, compound, _this = this, _null = null; + if (_this instanceof A.SassString0) + return _this._string0$_text; + if (!(_this instanceof A.SassList0)) + return _null; + t1 = _this._list1$_contents; + t2 = t1.length; + if (t2 === 0) + return _null; + result = A._setArrayType([], type$.JSArray_String); + $label0$1: { + _1_0 = _this._list1$_separator; + if (B.ListSeparator_rXA0 === _1_0) { + for (_i = 0; _i < t2; ++_i) { + complex = t1[_i]; + if (complex instanceof A.SassString0) { + result.push(complex._string0$_text); + continue; + } + if (complex instanceof A.SassList0 && B.ListSeparator_EVt0 === complex._list1$_separator) { + string = complex._value$_selectorStringOrNull$0(); + if (string == null) + return _null; + result.push(string); + continue; + } + return _null; + } + break $label0$1; + } + if (B.ListSeparator_zg90 === _1_0) + return _null; + for (_i = 0; _i < t2; ++_i) { + compound = t1[_i]; + if (!(compound instanceof A.SassString0)) + return _null; + result.push(compound._string0$_text); + } + break $label0$1; + } + return B.JSArray_methods.join$1(result, _1_0 === B.ListSeparator_rXA0 ? ", " : " "); + }, + withListContents$2$separator(contents, separator) { + var t1 = separator == null ? this.get$separator(this) : separator, + t2 = this.get$hasBrackets(); + return A.SassList$0(contents, t1, t2); + }, + withListContents$1(contents) { + return this.withListContents$2$separator(contents, null); + }, + greaterThan$1(other) { + return A.throwExpression(A.SassScriptException$0('Undefined operation "' + this.toString$0(0) + " > " + other.toString$0(0) + '".', null)); + }, + greaterThanOrEquals$1(other) { + return A.throwExpression(A.SassScriptException$0('Undefined operation "' + this.toString$0(0) + " >= " + other.toString$0(0) + '".', null)); + }, + lessThan$1(other) { + return A.throwExpression(A.SassScriptException$0('Undefined operation "' + this.toString$0(0) + " < " + other.toString$0(0) + '".', null)); + }, + lessThanOrEquals$1(other) { + return A.throwExpression(A.SassScriptException$0('Undefined operation "' + this.toString$0(0) + " <= " + other.toString$0(0) + '".', null)); + }, + times$1(other) { + return A.throwExpression(A.SassScriptException$0('Undefined operation "' + this.toString$0(0) + " * " + other.toString$0(0) + '".', null)); + }, + modulo$1(other) { + return A.throwExpression(A.SassScriptException$0('Undefined operation "' + this.toString$0(0) + " % " + other.toString$0(0) + '".', null)); + }, + plus$1(other) { + var t1; + $label0$0: { + if (other instanceof A.SassString0) { + t1 = new A.SassString0(A.serializeValue0(this, false, true) + other._string0$_text, other._string0$_hasQuotes); + break $label0$0; + } + if (other instanceof A.SassCalculation0) + A.throwExpression(A.SassScriptException$0('Undefined operation "' + this.toString$0(0) + " + " + other.toString$0(0) + '".', null)); + t1 = new A.SassString0(A.serializeValue0(this, false, true) + A.serializeValue0(other, false, true), false); + break $label0$0; + } + return t1; + }, + minus$1(other) { + return other instanceof A.SassCalculation0 ? A.throwExpression(A.SassScriptException$0('Undefined operation "' + this.toString$0(0) + " - " + other.toString$0(0) + '".', null)) : new A.SassString0(A.serializeValue0(this, false, true) + "-" + A.serializeValue0(other, false, true), false); + }, + dividedBy$1(other) { + return new A.SassString0(A.serializeValue0(this, false, true) + "/" + A.serializeValue0(other, false, true), false); + }, + unaryPlus$0() { + return new A.SassString0("+" + A.serializeValue0(this, false, true), false); + }, + unaryMinus$0() { + return new A.SassString0("-" + A.serializeValue0(this, false, true), false); + }, + unaryNot$0() { + return B.SassBoolean_false0; + }, + withoutSlash$0() { + return this; + }, + toString$0(_) { + return A.serializeValue0(this, true, true); + } + }; + A.VariableExpression0.prototype = { + accept$1$1(visitor) { + return visitor.visitVariableExpression$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + toString$0(_) { + var t1 = this.span; + return A.String_String$fromCharCodes(B.NativeUint32List_methods.sublist$2(t1.file._decodedChars, t1._file$_start, t1._end), 0, null); + }, + $isExpression0: 1, + $isAstNode0: 1, + get$span(receiver) { + return this.span; + } + }; + A.VariableDeclaration0.prototype = { + accept$1$1(visitor) { + return visitor.visitVariableDeclaration$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + toString$0(_) { + var t1 = this.namespace; + t1 = t1 != null ? "" + (t1 + ".") : ""; + t1 += "$" + this.name + ": " + this.expression.toString$0(0) + ";"; + return t1.charCodeAt(0) == 0 ? t1 : t1; + }, + $isAstNode0: 1, + $isStatement0: 1, + get$span(receiver) { + return this.span; + } + }; + A.WarnRule0.prototype = { + accept$1$1(visitor) { + return visitor.visitWarnRule$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + toString$0(_) { + return "@warn " + this.expression.toString$0(0) + ";"; + }, + $isAstNode0: 1, + $isStatement0: 1, + get$span(receiver) { + return this.span; + } + }; + A.WhileRule0.prototype = { + accept$1$1(visitor) { + return visitor.visitWhileRule$1(this); + }, + accept$1(visitor) { + return this.accept$1$1(visitor, type$.dynamic); + }, + toString$0(_) { + var t1 = this.children; + return "@while " + this.condition.toString$0(0) + " {" + (t1 && B.JSArray_methods).join$1(t1, " ") + "}"; + }, + get$span(receiver) { + return this.span; + } + }; + (function aliases() { + var _ = J.LegacyJavaScriptObject.prototype; + _.super$LegacyJavaScriptObject$toString = _.toString$0; + _ = A.JsLinkedHashMap.prototype; + _.super$JsLinkedHashMap$internalContainsKey = _.internalContainsKey$1; + _.super$JsLinkedHashMap$internalGet = _.internalGet$1; + _.super$JsLinkedHashMap$internalSet = _.internalSet$2; + _.super$JsLinkedHashMap$internalRemove = _.internalRemove$1; + _ = A._BufferingStreamSubscription.prototype; + _.super$_BufferingStreamSubscription$_add = _._async$_add$1; + _.super$_BufferingStreamSubscription$_addError = _._addError$2; + _ = A.ListBase.prototype; + _.super$ListBase$setRange = _.setRange$4; + _ = A.Iterable.prototype; + _.super$Iterable$where = _.where$1; + _.super$Iterable$skipWhile = _.skipWhile$1; + _ = A.ModifiableCssParentNode.prototype; + _.super$ModifiableCssParentNode$addChild = _.addChild$1; + _ = A.SimpleSelector.prototype; + _.super$SimpleSelector$addSuffix = _.addSuffix$1; + _.super$SimpleSelector$unify = _.unify$1; + _.super$SimpleSelector$isSuperselector = _.isSuperselector$1; + _ = A.Parser.prototype; + _.super$Parser$silentComment = _.silentComment$0; + _ = A.StylesheetParser.prototype; + _.super$StylesheetParser$importArgument = _.importArgument$0; + _.super$StylesheetParser$namespacedExpression = _.namespacedExpression$2; + _ = A.Value.prototype; + _.super$Value$assertMap = _.assertMap$1; + _.super$Value$plus = _.plus$1; + _.super$Value$minus = _.minus$1; + _.super$Value$dividedBy = _.dividedBy$1; + _ = A.SassNumber.prototype; + _.super$SassNumber$convertValueToMatch = _.convertValueToMatch$3; + _.super$SassNumber$coerce = _.coerce$3; + _.super$SassNumber$coerceValue = _.coerceValue$3; + _.super$SassNumber$coerceValueToUnit = _.coerceValueToUnit$2; + _.super$SassNumber$coerceToMatch = _.coerceToMatch$3; + _.super$SassNumber$coerceValueToMatch = _.coerceValueToMatch$3; + _.super$SassNumber$greaterThan = _.greaterThan$1; + _.super$SassNumber$greaterThanOrEquals = _.greaterThanOrEquals$1; + _.super$SassNumber$lessThan = _.lessThan$1; + _.super$SassNumber$lessThanOrEquals = _.lessThanOrEquals$1; + _.super$SassNumber$modulo = _.modulo$1; + _.super$SassNumber$plus = _.plus$1; + _.super$SassNumber$minus = _.minus$1; + _.super$SassNumber$times = _.times$1; + _.super$SassNumber$dividedBy = _.dividedBy$1; + _ = A.AnySelectorVisitor.prototype; + _.super$AnySelectorVisitor$visitComplexSelector = _.visitComplexSelector$1; + _ = A.EveryCssVisitor.prototype; + _.super$EveryCssVisitor$visitCssStyleRule = _.visitCssStyleRule$1; + _ = A.ReplaceExpressionVisitor.prototype; + _.super$ReplaceExpressionVisitor$visitBinaryOperationExpression = _.visitBinaryOperationExpression$1; + _.super$ReplaceExpressionVisitor$visitUnaryOperationExpression = _.visitUnaryOperationExpression$1; + _ = A.SourceSpanMixin.prototype; + _.super$SourceSpanMixin$compareTo = _.compareTo$1; + _.super$SourceSpanMixin$$eq = _.$eq; + _ = A.StringScanner.prototype; + _.super$StringScanner$readChar = _.readChar$0; + _.super$StringScanner$scanChar = _.scanChar$1; + _.super$StringScanner$scan = _.scan$1; + _.super$StringScanner$matches = _.matches$1; + _ = A.AnySelectorVisitor0.prototype; + _.super$AnySelectorVisitor$visitComplexSelector0 = _.visitComplexSelector$1; + _ = A.EveryCssVisitor0.prototype; + _.super$EveryCssVisitor$visitCssStyleRule0 = _.visitCssStyleRule$1; + _ = A.ModifiableCssParentNode0.prototype; + _.super$ModifiableCssParentNode$addChild0 = _.addChild$1; + _ = A.SassNumber0.prototype; + _.super$SassNumber$convertToMatch = _.convertToMatch$3; + _.super$SassNumber$convertValueToMatch0 = _.convertValueToMatch$3; + _.super$SassNumber$coerce0 = _.coerce$3; + _.super$SassNumber$coerceValue0 = _.coerceValue$3; + _.super$SassNumber$coerceValueToUnit0 = _.coerceValueToUnit$2; + _.super$SassNumber$coerceToMatch0 = _.coerceToMatch$3; + _.super$SassNumber$coerceValueToMatch0 = _.coerceValueToMatch$3; + _.super$SassNumber$greaterThan0 = _.greaterThan$1; + _.super$SassNumber$greaterThanOrEquals0 = _.greaterThanOrEquals$1; + _.super$SassNumber$lessThan0 = _.lessThan$1; + _.super$SassNumber$lessThanOrEquals0 = _.lessThanOrEquals$1; + _.super$SassNumber$modulo0 = _.modulo$1; + _.super$SassNumber$plus0 = _.plus$1; + _.super$SassNumber$minus0 = _.minus$1; + _.super$SassNumber$times0 = _.times$1; + _.super$SassNumber$dividedBy0 = _.dividedBy$1; + _ = A.Parser1.prototype; + _.super$Parser$silentComment0 = _.silentComment$0; + _ = A.ReplaceExpressionVisitor0.prototype; + _.super$ReplaceExpressionVisitor$visitBinaryOperationExpression0 = _.visitBinaryOperationExpression$1; + _.super$ReplaceExpressionVisitor$visitUnaryOperationExpression0 = _.visitUnaryOperationExpression$1; + _ = A.SimpleSelector0.prototype; + _.super$SimpleSelector$addSuffix0 = _.addSuffix$1; + _.super$SimpleSelector$unify0 = _.unify$1; + _.super$SimpleSelector$isSuperselector0 = _.isSuperselector$1; + _ = A.StylesheetParser0.prototype; + _.super$StylesheetParser$importArgument0 = _.importArgument$0; + _.super$StylesheetParser$namespacedExpression0 = _.namespacedExpression$2; + _ = A.Value0.prototype; + _.super$Value$assertMap0 = _.assertMap$1; + _.super$Value$plus0 = _.plus$1; + _.super$Value$minus0 = _.minus$1; + _.super$Value$dividedBy0 = _.dividedBy$1; + })(); + (function installTearOffs() { + var _static_2 = hunkHelpers._static_2, + _instance_1_i = hunkHelpers._instance_1i, + _instance_1_u = hunkHelpers._instance_1u, + _static_1 = hunkHelpers._static_1, + _static_0 = hunkHelpers._static_0, + _static = hunkHelpers.installStaticTearOff, + _instance = hunkHelpers.installInstanceTearOff, + _instance_2_u = hunkHelpers._instance_2u, + _instance_0_i = hunkHelpers._instance_0i, + _instance_0_u = hunkHelpers._instance_0u; + _static_2(J, "_interceptors_JSArray__compareAny$closure", "JSArray__compareAny", 201); + _instance_1_i(J.JSArray.prototype, "get$contains", "contains$1", 9); + _instance_1_i(A._CastIterableBase.prototype, "get$contains", "contains$1", 9); + _instance_1_u(A.CastMap.prototype, "get$containsKey", "containsKey$1", 9); + _instance_1_u(A.ConstantStringMap.prototype, "get$containsKey", "containsKey$1", 9); + _instance_1_i(A.ConstantStringSet.prototype, "get$contains", "contains$1", 9); + _instance_1_i(A.GeneralConstantSet.prototype, "get$contains", "contains$1", 9); + _instance_1_u(A.JsLinkedHashMap.prototype, "get$containsKey", "containsKey$1", 9); + _static_1(A, "async__AsyncRun__scheduleImmediateJsOverride$closure", "_AsyncRun__scheduleImmediateJsOverride", 135); + _static_1(A, "async__AsyncRun__scheduleImmediateWithSetImmediate$closure", "_AsyncRun__scheduleImmediateWithSetImmediate", 135); + _static_1(A, "async__AsyncRun__scheduleImmediateWithTimer$closure", "_AsyncRun__scheduleImmediateWithTimer", 135); + _static_0(A, "async___startMicrotaskLoop$closure", "_startMicrotaskLoop", 0); + _static_1(A, "async___nullDataHandler$closure", "_nullDataHandler", 76); + _static_2(A, "async___nullErrorHandler$closure", "_nullErrorHandler", 73); + _static_0(A, "async___nullDoneHandler$closure", "_nullDoneHandler", 0); + _static(A, "async___rootHandleUncaughtError$closure", 5, null, ["call$5"], ["_rootHandleUncaughtError"], 586, 0); + _static(A, "async___rootRun$closure", 4, null, ["call$1$4", "call$4"], ["_rootRun", function($self, $parent, zone, f) { + return A._rootRun($self, $parent, zone, f, type$.dynamic); + }], 587, 1); + _static(A, "async___rootRunUnary$closure", 5, null, ["call$2$5", "call$5"], ["_rootRunUnary", function($self, $parent, zone, f, arg) { + var t1 = type$.dynamic; + return A._rootRunUnary($self, $parent, zone, f, arg, t1, t1); + }], 588, 1); + _static(A, "async___rootRunBinary$closure", 6, null, ["call$3$6", "call$6"], ["_rootRunBinary", function($self, $parent, zone, f, arg1, arg2) { + var t1 = type$.dynamic; + return A._rootRunBinary($self, $parent, zone, f, arg1, arg2, t1, t1, t1); + }], 589, 1); + _static(A, "async___rootRegisterCallback$closure", 4, null, ["call$1$4", "call$4"], ["_rootRegisterCallback", function($self, $parent, zone, f) { + return A._rootRegisterCallback($self, $parent, zone, f, type$.dynamic); + }], 590, 0); + _static(A, "async___rootRegisterUnaryCallback$closure", 4, null, ["call$2$4", "call$4"], ["_rootRegisterUnaryCallback", function($self, $parent, zone, f) { + var t1 = type$.dynamic; + return A._rootRegisterUnaryCallback($self, $parent, zone, f, t1, t1); + }], 591, 0); + _static(A, "async___rootRegisterBinaryCallback$closure", 4, null, ["call$3$4", "call$4"], ["_rootRegisterBinaryCallback", function($self, $parent, zone, f) { + var t1 = type$.dynamic; + return A._rootRegisterBinaryCallback($self, $parent, zone, f, t1, t1, t1); + }], 592, 0); + _static(A, "async___rootErrorCallback$closure", 5, null, ["call$5"], ["_rootErrorCallback"], 593, 0); + _static(A, "async___rootScheduleMicrotask$closure", 4, null, ["call$4"], ["_rootScheduleMicrotask"], 594, 0); + _static(A, "async___rootCreateTimer$closure", 5, null, ["call$5"], ["_rootCreateTimer"], 595, 0); + _static(A, "async___rootCreatePeriodicTimer$closure", 5, null, ["call$5"], ["_rootCreatePeriodicTimer"], 596, 0); + _static(A, "async___rootPrint$closure", 4, null, ["call$4"], ["_rootPrint"], 597, 0); + _static_1(A, "async___printToZone$closure", "_printToZone", 90); + _static(A, "async___rootFork$closure", 5, null, ["call$5"], ["_rootFork"], 598, 0); + _instance(A._AsyncCompleter.prototype, "get$complete", 0, 0, function() { + return [null]; + }, ["call$1", "call$0"], ["complete$1", "complete$0"], 252, 0, 0); + _instance_2_u(A._Future.prototype, "get$_completeError", "_completeError$2", 73); + var _; + _instance_1_i(_ = A._StreamController.prototype, "get$add", "add$1", 33); + _instance(_, "get$addError", 0, 1, function() { + return [null]; + }, ["call$2", "call$1"], ["addError$2", "addError$1"], 241, 0, 0); + _instance_0_i(_, "get$close", "close$0", 600); + _instance_1_u(_, "get$_async$_add", "_async$_add$1", 33); + _instance_2_u(_, "get$_addError", "_addError$2", 73); + _instance_0_u(_, "get$_close", "_close$0", 0); + _instance_0_u(_ = A._ControllerSubscription.prototype, "get$_async$_onPause", "_async$_onPause$0", 0); + _instance_0_u(_, "get$_async$_onResume", "_async$_onResume$0", 0); + _instance(_ = A._BufferingStreamSubscription.prototype, "get$pause", 1, 0, null, ["call$1", "call$0"], ["pause$1", "pause$0"], 599, 0, 0); + _instance_0_i(_, "get$resume", "resume$0", 0); + _instance_0_u(_, "get$_async$_onPause", "_async$_onPause$0", 0); + _instance_0_u(_, "get$_async$_onResume", "_async$_onResume$0", 0); + _instance_1_u(_ = A._StreamIterator.prototype, "get$_onData", "_onData$1", 33); + _instance_2_u(_, "get$_onError", "_onError$2", 73); + _instance_0_u(_, "get$_onDone", "_onDone$0", 0); + _instance_0_u(_ = A._ForwardingStreamSubscription.prototype, "get$_async$_onPause", "_async$_onPause$0", 0); + _instance_0_u(_, "get$_async$_onResume", "_async$_onResume$0", 0); + _instance_1_u(_, "get$_handleData", "_handleData$1", 33); + _instance_2_u(_, "get$_handleError", "_handleError$2", 585); + _instance_0_u(_, "get$_handleDone", "_handleDone$0", 0); + _static_2(A, "collection___defaultEquals$closure", "_defaultEquals", 156); + _static_1(A, "collection___defaultHashCode$closure", "_defaultHashCode", 232); + _static_2(A, "collection_ListBase__compareAny$closure", "ListBase__compareAny", 201); + _instance_1_u(A._HashMap.prototype, "get$containsKey", "containsKey$1", 9); + _instance_1_u(A._LinkedCustomHashMap.prototype, "get$containsKey", "containsKey$1", 9); + _instance(_ = A._LinkedHashSet.prototype, "get$_newSimilarSet", 0, 0, null, ["call$1$0", "call$0"], ["_newSimilarSet$1$0", "_newSimilarSet$0"], 167, 0, 0); + _instance_1_i(_, "get$contains", "contains$1", 9); + _instance_1_i(_, "get$add", "add$1", 9); + _instance(A._LinkedIdentityHashSet.prototype, "get$_newSimilarSet", 0, 0, null, ["call$1$0", "call$0"], ["_newSimilarSet$1$0", "_newSimilarSet$0"], 167, 0, 0); + _instance_1_u(A.MapBase.prototype, "get$containsKey", "containsKey$1", 9); + _instance_1_u(A.MapView.prototype, "get$containsKey", "containsKey$1", 9); + _instance_1_i(A.UnmodifiableSetView.prototype, "get$contains", "contains$1", 9); + _static_1(A, "convert___defaultToEncodable$closure", "_defaultToEncodable", 106); + _instance_1_u(A._JsonMap.prototype, "get$containsKey", "containsKey$1", 9); + _static_1(A, "core__identityHashCode$closure", "identityHashCode", 232); + _static_2(A, "core__identical$closure", "identical", 156); + _static_1(A, "core_Uri_decodeComponent$closure", "Uri_decodeComponent", 5); + _instance_1_i(A.Iterable.prototype, "get$contains", "contains$1", 9); + _instance_1_i(A.StringBuffer.prototype, "get$write", "write$1", 33); + _static(A, "math0__max$closure", 2, null, ["call$1$2", "call$2"], ["max", function(a, b) { + return A.max(a, b, type$.num); + }], 601, 1); + _instance_1_u(A.ArgResults.prototype, "get$wasParsed", "wasParsed$1", 4); + _instance_1_u(_ = A.StreamCompleter.prototype, "get$setSourceStream", "setSourceStream$1", 33); + _instance(_, "get$setError", 0, 1, function() { + return [null]; + }, ["call$2", "call$1"], ["setError$2", "setError$1"], 241, 0, 0); + _instance_0_u(_ = A.StreamGroup.prototype, "get$_onListen", "_onListen$0", 0); + _instance_0_u(_, "get$_onPause", "_onPause$0", 0); + _instance_0_u(_, "get$_onResume", "_onResume$0", 0); + _instance_0_u(_, "get$_onCancel", "_onCancel$0", 253); + _instance_0_i(A.ReplAdapter.prototype, "get$exit", "exit$0", 0); + _instance_1_i(A.EmptyUnmodifiableSet.prototype, "get$contains", "contains$1", 9); + _instance_1_i(A.UnionSet.prototype, "get$contains", "contains$1", 9); + _instance_1_i(A._DelegatingIterableBase.prototype, "get$contains", "contains$1", 9); + _instance_1_i(A.MapKeySet.prototype, "get$contains", "contains$1", 9); + _instance_1_u(A.VersionRange.prototype, "get$allows", "allows$1", 512); + _instance_1_u(A._IsInvisibleVisitor0.prototype, "get$visitComplexSelector", "visitComplexSelector$1", 18); + _instance_1_u(A._IsBogusVisitor.prototype, "get$visitComplexSelector", "visitComplexSelector$1", 18); + _instance_1_u(A._IsUselessVisitor.prototype, "get$visitComplexSelector", "visitComplexSelector$1", 18); + _instance_1_u(A.SelectorList.prototype, "get$isSuperselector", "isSuperselector$1", 66); + _instance_1_u(A.PseudoSelector.prototype, "get$isSuperselector", "isSuperselector$1", 15); + _instance_1_u(A.SimpleSelector.prototype, "get$isSuperselector", "isSuperselector$1", 15); + _instance_1_u(A.TypeSelector.prototype, "get$isSuperselector", "isSuperselector$1", 15); + _instance_1_u(A.UniversalSelector.prototype, "get$isSuperselector", "isSuperselector$1", 15); + _instance_1_u(A.EmptyExtensionStore.prototype, "get$addExtensions", "addExtensions$1", 247); + _instance_1_u(A.ExtensionStore.prototype, "get$addExtensions", "addExtensions$1", 247); + _static_1(A, "functions___isUnique$closure", "_isUnique", 15); + _static_1(A, "color0___opacify$closure", "_opacify", 30); + _static_1(A, "color0___transparentize$closure", "_transparentize", 30); + _instance_2_u(A.NodePackageImporter.prototype, "get$_compareExpansionKeys", "_compareExpansionKeys$2", 153); + _instance_0_u(_ = A.Parser.prototype, "get$whitespace", "whitespace$0", 0); + _instance_0_u(_, "get$loudComment", "loudComment$0", 0); + _instance_0_u(_, "get$string", "string$0", 27); + _instance(_, "get$error", 1, 2, function() { + return [null]; + }, ["call$3", "call$2"], ["error$3", "error$2"], 172, 0, 0); + _instance_0_u(A.SassParser.prototype, "get$loudComment", "loudComment$0", 0); + _instance(_ = A.StylesheetParser.prototype, "get$_statement", 0, 0, null, ["call$1$root", "call$0"], ["_statement$1$root", "_statement$0"], 347, 0, 0); + _instance_0_u(_, "get$_declarationChild", "_declarationChild$0", 132); + _instance_0_u(_, "get$_functionChild", "_functionChild$0", 132); + _instance(_, "get$_expression", 0, 0, null, ["call$3$bracketList$singleEquals$until", "call$0", "call$2$singleEquals$until", "call$1$bracketList", "call$1$until"], ["_expression$3$bracketList$singleEquals$until", "_expression$0", "_expression$2$singleEquals$until", "_expression$1$bracketList", "_expression$1$until"], 345, 0, 0); + _instance(A.LazyFileSpan.prototype, "get$message", 1, 1, function() { + return {color: null}; + }, ["call$2$color", "call$1"], ["message$2$color", "message$1"], 126, 0, 0); + _instance_1_u(A.LimitedMapView.prototype, "get$containsKey", "containsKey$1", 9); + _instance_1_u(A.MergedMapView.prototype, "get$containsKey", "containsKey$1", 9); + _instance(A.MultiSpan.prototype, "get$message", 1, 1, function() { + return {color: null}; + }, ["call$2$color", "call$1"], ["message$2$color", "message$1"], 203, 0, 0); + _instance_1_i(A.NoSourceMapBuffer.prototype, "get$write", "write$1", 33); + _instance_1_u(A.PrefixedMapView.prototype, "get$containsKey", "containsKey$1", 9); + _instance_1_u(A.PublicMemberMapView.prototype, "get$containsKey", "containsKey$1", 9); + _instance_1_i(A.SourceMapBuffer.prototype, "get$write", "write$1", 33); + _instance_1_u(A.UnprefixedMapView.prototype, "get$containsKey", "containsKey$1", 9); + _static_1(A, "utils__isPublic$closure", "isPublic", 4); + _static_1(A, "calculation_SassCalculation__simplify$closure", "SassCalculation__simplify", 67); + _instance_1_u(A.AnySelectorVisitor.prototype, "get$visitComplexSelector", "visitComplexSelector$1", 18); + _instance(_ = A._EvaluateVisitor0.prototype, "get$_async_evaluate$_interpolationToValue", 0, 1, null, ["call$3$trim$warnForColor", "call$1", "call$2$warnForColor"], ["_async_evaluate$_interpolationToValue$3$trim$warnForColor", "_async_evaluate$_interpolationToValue$1", "_async_evaluate$_interpolationToValue$2$warnForColor"], 316, 0, 0); + _instance_1_u(_, "get$_async_evaluate$_expressionNode", "_async_evaluate$_expressionNode$1", 211); + _instance(_ = A._EvaluateVisitor.prototype, "get$_interpolationToValue", 0, 1, null, ["call$3$trim$warnForColor", "call$1", "call$2$warnForColor"], ["_interpolationToValue$3$trim$warnForColor", "_interpolationToValue$1", "_interpolationToValue$2$warnForColor"], 298, 0, 0); + _instance_1_u(_, "get$_expressionNode", "_expressionNode$1", 211); + _instance_1_u(_ = A.RecursiveStatementVisitor.prototype, "get$visitContentBlock", "visitContentBlock$1", 278); + _instance_1_u(_, "get$visitChildren", "visitChildren$1", 507); + _instance_1_u(_ = A.SelectorSearchVisitor.prototype, "get$visitComplexSelector", "visitComplexSelector$1", "SelectorSearchVisitor.T?(ComplexSelector)"); + _instance_1_u(_, "get$visitSelectorList", "visitSelectorList$1", "SelectorSearchVisitor.T?(SelectorList)"); + _instance_1_u(_ = A._SerializeVisitor.prototype, "get$_visitMediaQuery", "_visitMediaQuery$1", 389); + _instance_1_u(_, "get$_writeCalculationValue", "_writeCalculationValue$1", 87); + _instance_1_u(_, "get$visitSelectorList", "visitSelectorList$1", 272); + _instance_1_u(_, "get$_requiresSemicolon", "_requiresSemicolon$1", 7); + _instance_1_u(_ = A.StatementSearchVisitor.prototype, "get$visitContentBlock", "visitContentBlock$1", "StatementSearchVisitor.T?(ContentBlock)"); + _instance_1_u(_, "get$visitChildren", "visitChildren$1", "StatementSearchVisitor.T?(List)"); + _instance(A.SourceSpanMixin.prototype, "get$message", 1, 1, function() { + return {color: null}; + }, ["call$2$color", "call$1"], ["message$2$color", "message$1"], 126, 0, 0); + _static_1(A, "frame_Frame___parseVM_tearOff$closure", "Frame___parseVM_tearOff", 110); + _static_1(A, "frame_Frame___parseV8_tearOff$closure", "Frame___parseV8_tearOff", 110); + _static_1(A, "frame_Frame___parseFirefox_tearOff$closure", "Frame___parseFirefox_tearOff", 110); + _static_1(A, "frame_Frame___parseFriendly_tearOff$closure", "Frame___parseFriendly_tearOff", 110); + _static_1(A, "trace_Trace___parseVM_tearOff$closure", "Trace___parseVM_tearOff", 216); + _static_1(A, "trace_Trace___parseFriendly_tearOff$closure", "Trace___parseFriendly_tearOff", 216); + _static(A, "from_handlers__TransformByHandlers__defaultHandleError$closure", 3, null, ["call$1$3", "call$3"], ["TransformByHandlers__defaultHandleError", function(error, stackTrace, sink) { + return A.TransformByHandlers__defaultHandleError(error, stackTrace, sink, type$.dynamic); + }], 604, 0); + _static(A, "rate_limit___collect$closure", 2, null, ["call$1$2", "call$2"], ["_collect", function($event, soFar) { + return A._collect($event, soFar, type$.dynamic); + }], 605, 0); + _instance_1_u(A.AnySelectorVisitor0.prototype, "get$visitComplexSelector", "visitComplexSelector$1", 16); + _instance(_ = A._EvaluateVisitor2.prototype, "get$_async_evaluate0$_interpolationToValue", 0, 1, null, ["call$3$trim$warnForColor", "call$1", "call$2$warnForColor"], ["_async_evaluate0$_interpolationToValue$3$trim$warnForColor", "_async_evaluate0$_interpolationToValue$1", "_async_evaluate0$_interpolationToValue$2$warnForColor"], 311, 0, 0); + _instance_1_u(_, "get$_async_evaluate0$_expressionNode", "_async_evaluate0$_expressionNode$1", 270); + _static_1(A, "calculation1___assertCalculationValue$closure", "_assertCalculationValue", 87); + _static_1(A, "calculation1___isValidClampArg$closure", "_isValidClampArg", 9); + _static_1(A, "calculation0_SassCalculation__simplify$closure", "SassCalculation__simplify0", 67); + _static_1(A, "color2___opacify$closure", "_opacify0", 29); + _static_1(A, "color2___transparentize$closure", "_transparentize0", 29); + _static(A, "compile__compile$closure", 1, function() { + return [null]; + }, ["call$2", "call$1"], ["compile0", function(path) { + return A.compile0(path, null); + }], 606, 0); + _static(A, "compile__compileString$closure", 1, function() { + return [null]; + }, ["call$2", "call$1"], ["compileString0", function(text) { + return A.compileString0(text, null); + }], 607, 0); + _static(A, "compile__compileAsync$closure", 1, function() { + return [null]; + }, ["call$2", "call$1"], ["compileAsync1", function(path) { + return A.compileAsync1(path, null); + }], 608, 0); + _static(A, "compile__compileStringAsync$closure", 1, function() { + return [null]; + }, ["call$2", "call$1"], ["compileStringAsync1", function(text) { + return A.compileStringAsync1(text, null); + }], 609, 0); + _static_1(A, "compile___parseImporter$closure", "_parseImporter0", 610); + _static_1(A, "compile___simplifyCalcArg$closure", "_simplifyCalcArg", 67); + _static_0(A, "compiler__initCompiler$closure", "initCompiler", 611); + _static_0(A, "compiler__initAsyncCompiler$closure", "initAsyncCompiler", 612); + _instance_1_u(A.EmptyExtensionStore0.prototype, "get$addExtensions", "addExtensions$1", 263); + _instance(_ = A._EvaluateVisitor1.prototype, "get$_evaluate0$_interpolationToValue", 0, 1, null, ["call$3$trim$warnForColor", "call$1", "call$2$warnForColor"], ["_evaluate0$_interpolationToValue$3$trim$warnForColor", "_evaluate0$_interpolationToValue$1", "_evaluate0$_interpolationToValue$2$warnForColor"], 419, 0, 0); + _instance_1_u(_, "get$_evaluate0$_expressionNode", "_evaluate0$_expressionNode$1", 270); + _instance_1_u(A.ExtensionStore0.prototype, "get$addExtensions", "addExtensions$1", 263); + _static_1(A, "functions0___isUnique$closure", "_isUnique0", 14); + _static_1(A, "immutable__jsToDartList$closure", "jsToDartList", 613); + _instance(A.LazyFileSpan0.prototype, "get$message", 1, 1, function() { + return {color: null}; + }, ["call$2$color", "call$1"], ["message$2$color", "message$1"], 126, 0, 0); + _static_2(A, "legacy__render$closure", "render", 614); + _static_1(A, "legacy__renderSync$closure", "renderSync", 615); + _instance_1_u(A.LimitedMapView0.prototype, "get$containsKey", "containsKey$1", 9); + _instance_1_u(A.SelectorList0.prototype, "get$isSuperselector", "isSuperselector$1", 72); + _instance_1_u(A.MergedMapView0.prototype, "get$containsKey", "containsKey$1", 9); + _instance(A.MultiSpan0.prototype, "get$message", 1, 1, function() { + return {color: null}; + }, ["call$2$color", "call$1"], ["message$2$color", "message$1"], 203, 0, 0); + _instance_1_i(A.NoSourceMapBuffer0.prototype, "get$write", "write$1", 33); + _instance_2_u(A.NodePackageImporter0.prototype, "get$_node_package$_compareExpansionKeys", "_node_package$_compareExpansionKeys$2", 153); + _instance_0_u(_ = A.Parser1.prototype, "get$whitespace", "whitespace$0", 0); + _instance_0_u(_, "get$loudComment", "loudComment$0", 0); + _instance_0_u(_, "get$string", "string$0", 27); + _instance(_, "get$error", 1, 2, function() { + return [null]; + }, ["call$3", "call$2"], ["error$3", "error$2"], 172, 0, 0); + _instance_1_u(A.PrefixedMapView0.prototype, "get$containsKey", "containsKey$1", 9); + _instance_1_u(A.PseudoSelector0.prototype, "get$isSuperselector", "isSuperselector$1", 14); + _instance_1_u(A.PublicMemberMapView0.prototype, "get$containsKey", "containsKey$1", 9); + _instance_0_u(A.SassParser0.prototype, "get$loudComment", "loudComment$0", 0); + _instance_1_u(A._IsInvisibleVisitor2.prototype, "get$visitComplexSelector", "visitComplexSelector$1", 16); + _instance_1_u(A._IsBogusVisitor0.prototype, "get$visitComplexSelector", "visitComplexSelector$1", 16); + _instance_1_u(A._IsUselessVisitor0.prototype, "get$visitComplexSelector", "visitComplexSelector$1", 16); + _instance_1_u(_ = A.SelectorSearchVisitor0.prototype, "get$visitComplexSelector", "visitComplexSelector$1", "SelectorSearchVisitor0.T?(ComplexSelector0)"); + _instance_1_u(_, "get$visitSelectorList", "visitSelectorList$1", "SelectorSearchVisitor0.T?(SelectorList0)"); + _instance_1_u(_ = A._SerializeVisitor0.prototype, "get$_serialize0$_visitMediaQuery", "_serialize0$_visitMediaQuery$1", 528); + _instance_1_u(_, "get$_serialize0$_writeCalculationValue", "_serialize0$_writeCalculationValue$1", 87); + _instance_1_u(_, "get$visitSelectorList", "visitSelectorList$1", 529); + _instance_1_u(_, "get$_serialize0$_requiresSemicolon", "_serialize0$_requiresSemicolon$1", 8); + _instance_1_u(A.SimpleSelector0.prototype, "get$isSuperselector", "isSuperselector$1", 14); + _instance_1_i(A.SourceMapBuffer0.prototype, "get$write", "write$1", 33); + _instance_1_u(_ = A.StatementSearchVisitor0.prototype, "get$visitContentBlock", "visitContentBlock$1", "StatementSearchVisitor0.T?(ContentBlock0)"); + _instance_1_u(_, "get$visitChildren", "visitChildren$1", "StatementSearchVisitor0.T?(List)"); + _instance(_ = A.StylesheetParser0.prototype, "get$_stylesheet0$_statement", 0, 0, null, ["call$1$root", "call$0"], ["_stylesheet0$_statement$1$root", "_stylesheet0$_statement$0"], 546, 0, 0); + _instance_0_u(_, "get$_stylesheet0$_declarationChild", "_stylesheet0$_declarationChild$0", 125); + _instance_0_u(_, "get$_stylesheet0$_functionChild", "_stylesheet0$_functionChild$0", 125); + _instance_1_u(A.TypeSelector0.prototype, "get$isSuperselector", "isSuperselector$1", 14); + _instance_1_u(A.UniversalSelector0.prototype, "get$isSuperselector", "isSuperselector$1", 14); + _instance_1_u(A.UnprefixedMapView0.prototype, "get$containsKey", "containsKey$1", 9); + _static_1(A, "utils1__jsToDartUrl$closure", "jsToDartUrl", 616); + _static_1(A, "utils1__dartToJSUrl$closure", "dartToJSUrl", 617); + _static_1(A, "utils0__isPublic$closure", "isPublic0", 4); + _static(A, "path__absolute$closure", 1, function() { + return [null, null, null, null, null, null, null, null, null, null, null, null, null, null]; + }, ["call$15", "call$1", "call$2", "call$3", "call$4", "call$5", "call$6"], ["absolute", function(part1) { + var _null = null; + return A.absolute(part1, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null); + }, function(part1, part2) { + var _null = null; + return A.absolute(part1, part2, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null); + }, function(part1, part2, part3) { + var _null = null; + return A.absolute(part1, part2, part3, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null); + }, function(part1, part2, part3, part4) { + var _null = null; + return A.absolute(part1, part2, part3, part4, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null); + }, function(part1, part2, part3, part4, part5) { + var _null = null; + return A.absolute(part1, part2, part3, part4, part5, _null, _null, _null, _null, _null, _null, _null, _null, _null, _null); + }, function(part1, part2, part3, part4, part5, part6) { + var _null = null; + return A.absolute(part1, part2, part3, part4, part5, part6, _null, _null, _null, _null, _null, _null, _null, _null, _null); + }], 618, 0); + _static_1(A, "path__prettyUri$closure", "prettyUri", 619); + _static_2(A, "number0__fuzzyLessThan$closure", "fuzzyLessThan", 43); + _static_2(A, "number0__fuzzyLessThanOrEquals$closure", "fuzzyLessThanOrEquals", 43); + _static_2(A, "number0__fuzzyGreaterThan$closure", "fuzzyGreaterThan", 43); + _static_2(A, "number0__fuzzyGreaterThanOrEquals$closure", "fuzzyGreaterThanOrEquals", 43); + _static_2(A, "number0__moduloLikeSass$closure", "moduloLikeSass", 64); + _static_1(A, "number0__sqrt$closure", "sqrt", 50); + _static_1(A, "number0__sin$closure", "sin", 50); + _static_1(A, "number0__cos$closure", "cos", 50); + _static_1(A, "number0__tan$closure", "tan", 50); + _static_1(A, "number0__atan$closure", "atan", 50); + _static_1(A, "number0__asin$closure", "asin", 50); + _static_1(A, "number0__acos$closure", "acos", 50); + _static_2(A, "number2__fuzzyLessThan$closure", "fuzzyLessThan0", 43); + _static_2(A, "number2__fuzzyLessThanOrEquals$closure", "fuzzyLessThanOrEquals0", 43); + _static_2(A, "number2__fuzzyGreaterThan$closure", "fuzzyGreaterThan0", 43); + _static_2(A, "number2__fuzzyGreaterThanOrEquals$closure", "fuzzyGreaterThanOrEquals0", 43); + _static_1(A, "number2__fuzzyRound$closure", "fuzzyRound0", 622); + _static_2(A, "number2__moduloLikeSass$closure", "moduloLikeSass0", 64); + _static_1(A, "number2__sqrt$closure", "sqrt0", 52); + _static_1(A, "number2__sin$closure", "sin0", 52); + _static_1(A, "number2__cos$closure", "cos0", 52); + _static_1(A, "number2__tan$closure", "tan0", 52); + _static_1(A, "number2__atan$closure", "atan0", 52); + _static_1(A, "number2__asin$closure", "asin0", 52); + _static_1(A, "number2__acos$closure", "acos0", 52); + _static_1(A, "sass__main$closure", "main1", 624); + _static_1(A, "utils2__validateUrlScheme$closure", "validateUrlScheme", 90); + _static_1(A, "value0__wrapValue$closure", "wrapValue", 416); + })(); + (function inheritance() { + var _mixin = hunkHelpers.mixin, + _inherit = hunkHelpers.inherit, + _inheritMany = hunkHelpers.inheritMany; + _inherit(A.Object, null); + _inheritMany(A.Object, [A.JS_CONST, J.Interceptor, J.ArrayIterator, A.Iterable, A.CastIterator, A.Closure, A.MapBase, A.Error, A.ListBase, A.SentinelValue, A.ListIterator, A.MappedIterator, A.WhereIterator, A.ExpandIterator, A.TakeIterator, A.SkipIterator, A.SkipWhileIterator, A.EmptyIterator, A.FollowedByIterator, A.WhereTypeIterator, A.FixedLengthListMixin, A.UnmodifiableListMixin, A.Symbol, A._Record, A.MapView, A.ConstantMap, A._KeysOrValuesOrElementsIterator, A.SetBase, A.JSInvocationMirror, A.TypeErrorDecoder, A.NullThrownFromJavaScriptException, A.ExceptionAndStackTrace, A._StackTrace, A._Required, A.LinkedHashMapCell, A.LinkedHashMapKeyIterator, A.JSSyntaxRegExp, A._MatchImplementation, A._AllMatchesIterator, A.StringMatch, A._StringAllMatchesIterator, A._Cell, A.Rti, A._FunctionParameters, A._Type, A._TimerImpl, A._AsyncAwaitCompleter, A._SyncStarIterator, A.AsyncError, A._Completer, A._FutureListener, A._Future, A._AsyncCallbackEntry, A.Stream, A._StreamController, A._SyncStreamControllerDispatch, A._AsyncStreamControllerDispatch, A._BufferingStreamSubscription, A._AddStreamState, A._DelayedEvent, A._DelayedDone, A._PendingEvents, A._StreamIterator, A._ZoneFunction, A._ZoneSpecification, A._ZoneDelegate, A._Zone, A._HashMapKeyIterator, A._LinkedHashSetCell, A._LinkedHashSetIterator, A._MapBaseValueIterator, A._UnmodifiableMapMixin, A._ListQueueIterator, A._UnmodifiableSetMixin, A.Codec, A.Converter, A._Base64Encoder, A.ByteConversionSink, A._JsonStringifier, A.StringConversionSink, A._Utf8Encoder, A._Utf8Decoder, A.DateTime, A.Duration, A._Enum, A.OutOfMemoryError, A.StackOverflowError, A._Exception, A.FormatException, A.MapEntry, A.Null, A._StringStackTrace, A.RuneIterator, A.StringBuffer, A._Uri, A.UriData, A._SimpleUri, A.Expando, A.NullRejectionException, A._JSRandom, A.ArgParser, A.ArgResults, A.Option, A.OptionType, A.Parser0, A._Usage, A.FutureGroup, A.ErrorResult, A.ValueResult, A.StreamCompleter, A.StreamGroup, A._StreamGroupState, A.StreamQueue, A._NextRequest, A.Repl, A.ReplAdapter, A.DefaultEquality, A.IterableEquality, A.ListEquality, A._MapEntry, A.MapEquality, A._QueueList_Object_ListMixin, A._DelegatingIterableBase, A.UnmodifiableSetMixin, A.Context, A._PathDirection, A._PathRelation, A.Style, A.ParsedPath, A.PathException, A.Version, A.VersionRange, A.CssMediaQuery, A.MediaQuerySuccessfulMergeResult, A.CssNode, A.__IsInvisibleVisitor_Object_EveryCssVisitor, A.CssValue, A._FakeAstNode, A.Argument, A.ArgumentDeclaration, A.ArgumentInvocation, A.AtRootQuery, A.ConfiguredVariable, A._IsCalculationSafeVisitor, A.BinaryOperationExpression, A.BooleanExpression, A.ColorExpression, A.FunctionExpression, A.IfExpression, A.InterpolatedFunctionExpression, A.ListExpression, A.MapExpression, A.NullExpression, A.NumberExpression, A.ParenthesizedExpression, A.SelectorExpression, A.StringExpression, A.SupportsExpression, A.UnaryOperationExpression, A.ValueExpression, A.VariableExpression, A.DynamicImport, A.StaticImport, A.Interpolation, A.ParentStatement, A.ContentRule, A.DebugRule, A.ErrorRule, A.ExtendRule, A.ForwardRule, A.IfRule, A.IfRuleClause, A.ImportRule, A.IncludeRule, A.LoudComment, A.__HasContentVisitor_Object_StatementSearchVisitor, A.ReturnRule, A.SilentComment, A.UseRule, A.VariableDeclaration, A.WarnRule, A.SupportsAnything, A.SupportsDeclaration, A.SupportsFunction, A.SupportsInterpolation, A.SupportsNegation, A.SupportsOperation, A.Selector, A.__IsInvisibleVisitor_Object_AnySelectorVisitor, A.__IsBogusVisitor_Object_AnySelectorVisitor, A.__IsUselessVisitor_Object_AnySelectorVisitor, A.ComplexSelectorComponent, A.__ParentSelectorVisitor_Object_SelectorSearchVisitor, A.QualifiedName, A.AsyncEnvironment, A._EnvironmentModule0, A.AsyncImportCache, A.AsyncBuiltInCallable, A.BuiltInCallable, A.PlainCssCallable, A.UserDefinedCallable, A.CompileResult, A.Configuration, A.ConfiguredValue, A.Environment, A._EnvironmentModule, A.SourceSpanException, A.SassScriptException, A.ExecutableOptions, A.UsageException, A._Watcher, A.EmptyExtensionStore, A.Extension, A.Extender, A.ExtensionStore, A.ImportCache, A.AsyncImporter, A.ImporterResult, A.InterpolationBuffer, A.InterpolationMap, A.FileSystemException, A._QuietLogger, A.DeprecationHandlingLogger, A.StderrLogger, A.TrackingLogger, A.BuiltInModule, A.ForwardedModuleView, A.ShadowedModuleView, A.Parser, A.StylesheetGraph, A.StylesheetNode, A.Box, A.ModifiableBox, A.LazyFileSpan, A.MultiDirWatcher, A.MultiSpan, A.NoSourceMapBuffer, A.SourceMapBuffer, A.Value, A.CalculationOperation, A._ColorFormatEnum, A.SpanColorFormat, A.AnySelectorVisitor, A._EvaluateVisitor0, A._ImportedCssVisitor0, A._EvaluationContext0, A._CloneCssVisitor, A.Evaluator, A._EvaluateVisitor, A._ImportedCssVisitor, A._EvaluationContext, A.EveryCssVisitor, A.__MakeExpressionCalculationSafe_Object_ReplaceExpressionVisitor, A.__FindDependenciesVisitor_Object_RecursiveStatementVisitor, A.DependencyReport, A.RecursiveStatementVisitor, A.ReplaceExpressionVisitor, A.SelectorSearchVisitor, A._SerializeVisitor, A.StatementSearchVisitor, A.Entry, A.Mapping, A.TargetLineEntry, A.TargetEntry, A.SourceFile, A.SourceLocationMixin, A.SourceSpanMixin, A.Highlighter, A._Highlight, A._Line, A.SourceLocation, A.Chain, A.Frame, A.LazyTrace, A.Trace, A.UnparsedFrame, A.StringScanner, A._SpanScannerState, A.AsciiGlyphSet, A.UnicodeGlyphSet, A.WatchEvent, A.ChangeType, A.AnySelectorVisitor0, A.SupportsAnything0, A.Argument0, A.ArgumentDeclaration0, A.ArgumentInvocation0, A.Value0, A.AsyncImporter0, A.AsyncBuiltInCallable0, A.AsyncEnvironment0, A._EnvironmentModule2, A._EvaluateVisitor2, A._ImportedCssVisitor2, A._EvaluationContext2, A.AsyncImportCache0, A.Parser1, A.AtRootQuery0, A.ParentStatement0, A.CssNode0, A.Selector0, A.BinaryOperationExpression0, A.BooleanExpression0, A.Box0, A.ModifiableBox0, A.BuiltInCallable0, A.BuiltInModule0, A.CalculationOperation0, A.CalculationInterpolation, A._CloneCssVisitor0, A.ColorExpression0, A._ColorFormatEnum0, A.SpanColorFormat0, A.CompileResult0, A.Compiler, A.ComplexSelectorComponent0, A.Configuration0, A.ConfiguredValue0, A.ConfiguredVariable0, A.ContentRule0, A.DebugRule0, A.SupportsDeclaration0, A.DeprecationHandlingLogger0, A.DynamicImport0, A.EmptyExtensionStore0, A.Environment0, A._EnvironmentModule1, A.ErrorRule0, A._EvaluateVisitor1, A._ImportedCssVisitor1, A._EvaluationContext1, A.EveryCssVisitor0, A.SassScriptException0, A._IsCalculationSafeVisitor0, A.__MakeExpressionCalculationSafe_Object_ReplaceExpressionVisitor0, A.ExtendRule0, A.Extension0, A.Extender0, A.ExtensionStore0, A.ForwardRule0, A.ForwardedModuleView0, A.FunctionExpression0, A.SupportsFunction0, A.IfExpression0, A.IfRule0, A.IfRuleClause0, A.NodeImporter, A.ImportCache0, A.ImportRule0, A.IncludeRule0, A.InterpolatedFunctionExpression0, A.Interpolation0, A.SupportsInterpolation0, A.InterpolationBuffer0, A.InterpolationMap0, A.FileSystemException0, A.JSToDartLogger, A.LazyFileSpan0, A.ListExpression0, A.__ParentSelectorVisitor_Object_SelectorSearchVisitor0, A._QuietLogger0, A.LoudComment0, A.MapExpression0, A.CssMediaQuery0, A.MediaQuerySuccessfulMergeResult0, A.__HasContentVisitor_Object_StatementSearchVisitor0, A.MultiSpan0, A.SupportsNegation0, A.NoSourceMapBuffer0, A._FakeAstNode0, A.__IsInvisibleVisitor_Object_EveryCssVisitor0, A.NullExpression0, A.NumberExpression0, A.SupportsOperation0, A.ParenthesizedExpression0, A.PlainCssCallable0, A.QualifiedName0, A.ReplaceExpressionVisitor0, A.ImporterResult0, A.ReturnRule0, A.__IsInvisibleVisitor_Object_AnySelectorVisitor0, A.__IsBogusVisitor_Object_AnySelectorVisitor0, A.__IsUselessVisitor_Object_AnySelectorVisitor0, A.SelectorExpression0, A.SelectorSearchVisitor0, A._SerializeVisitor0, A.ShadowedModuleView0, A.SilentComment0, A.SourceMapBuffer0, A.StatementSearchVisitor0, A.StaticImport0, A.StderrLogger0, A.StringExpression0, A.SupportsExpression0, A.UnaryOperationExpression0, A.UseRule0, A.UserDefinedCallable0, A.CssValue0, A.ValueExpression0, A.VariableExpression0, A.VariableDeclaration0, A.WarnRule0]); + _inheritMany(J.Interceptor, [J.JSBool, J.JSNull, J.JavaScriptObject, J.JavaScriptBigInt, J.JavaScriptSymbol, J.JSNumber, J.JSString]); + _inheritMany(J.JavaScriptObject, [J.LegacyJavaScriptObject, J.JSArray, A.NativeByteBuffer, A.NativeTypedData]); + _inheritMany(J.LegacyJavaScriptObject, [J.PlainJavaScriptObject, J.UnknownJavaScriptObject, J.JavaScriptFunction, A.Stdin, A.Stdout, A.ReadlineModule, A.ReadlineOptions, A.ReadlineInterface, A.BufferModule, A.BufferConstants, A.Buffer, A.ConsoleModule, A.Console, A.EventEmitter, A.FS, A.FSConstants, A.FSWatcher, A.ReadStream, A.ReadStreamOptions, A.WriteStream, A.WriteStreamOptions, A.FileOptions, A.StatOptions, A.MkdirOptions, A.RmdirOptions, A.WatchOptions, A.WatchFileOptions, A.Stats, A.Promise, A.Date, A.JsError, A.Atomics, A.Modules, A.Module, A.Net, A.Socket, A.NetAddress, A.NetServer, A.NodeJsError, A.Process, A.CPUUsage, A.Release, A.StreamModule, A.Readable, A.Writable, A.Duplex, A.Transform, A.WritableOptions, A.ReadableOptions, A.Immediate, A.Timeout, A.TTY, A.Util, A.JSArray0, A.Chokidar, A.ChokidarOptions, A.ChokidarWatcher, A.JSFunction, A.ImmutableList, A.ImmutableMap, A.NodeImporterResult, A.RenderContext, A.RenderContextOptions, A.RenderContextResult, A.RenderContextResultStats, A.JSModule, A.JSModuleRequire, A.JSClass, A.JSUrl, A._PropertyDescriptor, A._RequireMain, A.JSArray1, A.Chokidar0, A.ChokidarOptions0, A.ChokidarWatcher0, A._Channels, A._NodeSassColor, A.CompileOptions, A.NodeCompileResult, A.Exports, A.LoggerNamespace, A.FiberClass, A.Fiber, A.JSFunction0, A.ImmutableList0, A.ImmutableMap0, A.JSImporter, A.CanonicalizeContext, A.JSImporterResult, A.NodeImporterResult0, A._ConstructorOptions, A._NodeSassList, A.JSLogger, A.WarnOptions, A.DebugOptions, A._NodeSassMap, A.JSModule0, A.JSModuleRequire0, A._ConstructorOptions0, A._NodeSassNumber, A.JSClass0, A.RenderContext0, A.RenderContextOptions0, A.RenderContextResult0, A.RenderContextResultStats0, A.RenderOptions, A.RenderResult, A.RenderResultStats, A._Exports, A._ConstructorOptions1, A._NodeSassString, A.Types, A.JSUrl0, A._PropertyDescriptor0, A._RequireMain0]); + _inherit(J.JSUnmodifiableArray, J.JSArray); + _inheritMany(J.JSNumber, [J.JSInt, J.JSNumNotInt]); + _inheritMany(A.Iterable, [A._CastIterableBase, A.EfficientLengthIterable, A.MappedIterable, A.WhereIterable, A.ExpandIterable, A.TakeIterable, A.SkipIterable, A.SkipWhileIterable, A.FollowedByIterable, A.WhereTypeIterable, A._KeysOrValues, A._AllMatchesIterable, A._StringAllMatchesIterable, A._SyncStarIterable, A.Runes, A._EmptyUnmodifiableSet_IterableBase_UnmodifiableSetMixin, A._PrefixedKeys, A._UnprefixedKeys, A._PrefixedKeys0, A._UnprefixedKeys0]); + _inheritMany(A._CastIterableBase, [A.CastIterable, A.__CastListBase__CastIterableBase_ListMixin, A.CastSet]); + _inherit(A._EfficientLengthCastIterable, A.CastIterable); + _inherit(A._CastListBase, A.__CastListBase__CastIterableBase_ListMixin); + _inheritMany(A.Closure, [A.Closure2Args, A.CastMap_entries_closure, A.Closure0Args, A.Instantiation, A.TearOffClosure, A.JsLinkedHashMap_values_closure, A.initHooks_closure, A.initHooks_closure1, A._AsyncRun__initializeScheduleImmediate_internalCallback, A._AsyncRun__initializeScheduleImmediate_closure, A._awaitOnObject_closure, A.Future_wait_closure, A._Future__chainForeignFuture_closure, A._Future__propagateToListeners_handleWhenCompleteCallback_closure, A.Stream_Stream$fromFuture_closure, A.Stream_length_closure, A._CustomZone_bindUnaryCallback_closure, A._RootZone_bindUnaryCallback_closure, A._HashMap_values_closure, A._LinkedCustomHashMap_closure, A.MapBase_entries_closure, A._JsonMap_values_closure, A._Uri__makePath_closure, A._createTables_setChars, A._createTables_setRange, A.jsify__convert, A.promiseToFuture_closure1, A.promiseToFuture_closure2, A.ArgParser__addOption_closure, A._Usage__writeOption_closure, A._Usage__buildAllowedList_closure, A.FutureGroup_add_closure, A.StreamGroup__onListen_closure, A.StreamGroup__onCancel_closure, A.StreamQueue__ensureListening_closure, A.alwaysValid_closure, A.ReplAdapter_runAsync__closure, A.UnionSet__iterable_closure, A.UnionSet_contains_closure, A.MapKeySet_difference_closure, A.promiseToFuture_closure, A.promiseToFuture_closure0, A.futureToPromise__closure, A.Context_joinAll_closure, A.Context_split_closure, A._validateArgList_closure, A.ParsedPath__splitExtension_closure, A.PathMap__create_closure0, A.PathMap__create_closure1, A.WindowsStyle_absolutePathToUri_closure, A.Version__splitParts_closure, A.ModifiableCssNode_hasFollowingSibling_closure, A.ArgumentDeclaration_verify_closure, A.ArgumentDeclaration_verify_closure0, A._IsCalculationSafeVisitor_visitListExpression_closure, A.ListExpression_toString_closure, A.Interpolation_toString_closure, A.EachRule_toString_closure, A.IfRuleClause$__closure, A.IfRuleClause$___closure, A.ParentStatement_closure, A.ParentStatement__closure, A._IsBogusVisitor_visitComplexSelector_closure, A._IsUselessVisitor_visitComplexSelector_closure, A.ComplexSelectorComponent_toString_closure, A.IDSelector_unify_closure, A.SelectorList_asSassList_closure, A.SelectorList_resolveParentSelectors_closure, A.SelectorList_resolveParentSelectors__closure, A.SelectorList_resolveParentSelectors__closure0, A.SelectorList__resolveParentSelectorsCompound_closure, A.SelectorList__resolveParentSelectorsCompound_closure0, A.SelectorList__resolveParentSelectorsCompound_closure1, A.SelectorList_withAdditionalCombinators_closure, A.PseudoSelector_specificity__closure, A.PseudoSelector_specificity__closure0, A.PseudoSelector_unify_closure, A.SimpleSelector_isSuperselector_closure, A.SimpleSelector_isSuperselector__closure, A._compileStylesheet_closure0, A.AsyncEnvironment__getVariableFromGlobalModule_closure, A.AsyncEnvironment_setVariable_closure0, A.AsyncEnvironment__getFunctionFromGlobalModule_closure, A.AsyncEnvironment__getMixinFromGlobalModule_closure, A.AsyncEnvironment_toModule_closure, A.AsyncEnvironment_toDummyModule_closure, A._EnvironmentModule__EnvironmentModule_closure5, A._EnvironmentModule__EnvironmentModule_closure6, A._EnvironmentModule__EnvironmentModule_closure7, A._EnvironmentModule__EnvironmentModule_closure8, A._EnvironmentModule__EnvironmentModule_closure9, A._EnvironmentModule__EnvironmentModule_closure10, A.AsyncImportCache_humanize_closure, A.AsyncImportCache_humanize_closure0, A.AsyncImportCache_humanize_closure1, A.AsyncImportCache_humanize_closure2, A.AsyncBuiltInCallable$mixin_closure, A.BuiltInCallable$mixin_closure, A._compileStylesheet_closure, A.Deprecation_fromId_closure, A.Environment__getVariableFromGlobalModule_closure, A.Environment_setVariable_closure0, A.Environment__getFunctionFromGlobalModule_closure, A.Environment__getMixinFromGlobalModule_closure, A.Environment_toModule_closure, A.Environment_toDummyModule_closure, A._EnvironmentModule__EnvironmentModule_closure, A._EnvironmentModule__EnvironmentModule_closure0, A._EnvironmentModule__EnvironmentModule_closure1, A._EnvironmentModule__EnvironmentModule_closure2, A._EnvironmentModule__EnvironmentModule_closure3, A._EnvironmentModule__EnvironmentModule_closure4, A._writeSourceMap_closure, A.ExecutableOptions_emitErrorCss_closure, A.watch_closure, A._Watcher__debounceEvents_closure, A.ExtensionStore_extensionsWhereTarget_closure, A.ExtensionStore__extendComplex_closure, A.ExtensionStore__extendComplex__closure, A.ExtensionStore__extendCompound_closure, A.ExtensionStore__extendCompound_closure0, A.ExtensionStore__extendCompound_closure1, A.ExtensionStore__extendSimple_withoutPseudo, A.ExtensionStore__extendSimple_closure, A.ExtensionStore__extendSimple_closure0, A.ExtensionStore__extendPseudo_closure, A.ExtensionStore__extendPseudo_closure0, A.ExtensionStore__extendPseudo_closure1, A.ExtensionStore__extendPseudo_closure2, A.ExtensionStore__extendPseudo_closure3, A.ExtensionStore__trim_closure, A.ExtensionStore__trim_closure0, A.unifyComplex_closure, A._weaveParents_closure0, A._weaveParents_closure1, A._weaveParents_closure2, A._mustUnify_closure, A._mustUnify__closure, A.paths__closure, A.paths___closure, A.listIsSuperselector_closure, A.listIsSuperselector__closure, A.complexIsSuperselector_closure, A.complexIsSuperselector_closure0, A._compatibleWithPreviousCombinator_closure, A._selectorPseudoIsSuperselector_closure, A._selectorPseudoIsSuperselector_closure0, A._selectorPseudoIsSuperselector_closure1, A._selectorPseudoIsSuperselector_closure2, A._selectorPseudoIsSuperselector_closure3, A._selectorPseudoIsSuperselector__closure, A._selectorPseudoIsSuperselector___closure, A._selectorPseudoIsSuperselector___closure0, A._selectorPseudoIsSuperselector_closure4, A._selectorPseudoIsSuperselector_closure5, A._selectorPseudoArgs_closure, A._selectorPseudoArgs_closure0, A.globalFunctions_closure, A.global_closure0, A.global_closure1, A.global_closure2, A.global_closure3, A.global_closure4, A.global_closure5, A.global_closure6, A.global_closure7, A.global_closure8, A.global_closure9, A.global_closure10, A.global_closure11, A.global_closure12, A.global_closure13, A.global_closure14, A.global_closure15, A.global_closure16, A.global_closure17, A.global_closure18, A.global_closure19, A.global_closure20, A.global_closure21, A.global_closure22, A.global_closure23, A.global_closure24, A.global_closure25, A.global__closure, A.global_closure26, A.module_closure1, A.module_closure2, A.module_closure3, A.module_closure4, A.module_closure5, A.module_closure6, A.module_closure7, A.module_closure8, A.module__closure1, A.module_closure9, A._red_closure, A._green_closure, A._blue_closure, A._mix_closure, A._hue_closure, A._saturation_closure, A._lightness_closure, A._complement_closure, A._adjust_closure, A._scale_closure, A._change_closure, A._ieHexStr_closure, A._ieHexStr_closure_hexString, A._updateComponents_getParam, A._updateComponents_closure, A._updateComponents_closure0, A._updateComponents_updateValue, A._functionString_closure, A._removedColorFunction_closure, A._rgb_closure, A._hsl_closure, A._hwb_closure, A._parseChannels_closure, A._length_closure0, A._nth_closure, A._setNth_closure, A._join_closure, A._append_closure0, A._zip_closure, A._zip__closure, A._zip__closure0, A._zip__closure1, A._index_closure0, A._separator_closure, A._isBracketed_closure, A._slash_closure, A._get_closure, A._set_closure, A._set__closure0, A._set_closure0, A._set__closure, A._merge_closure, A._merge_closure0, A._merge__closure, A._deepMerge_closure, A._deepRemove_closure, A._deepRemove__closure, A._remove_closure, A._remove_closure0, A._keys_closure, A._values_closure, A._hasKey_closure, A._modify_modifyNestedMap, A.global_closure, A.module_closure0, A._ceil_closure, A._clamp_closure, A._floor_closure, A._max_closure, A._min_closure, A._round_closure, A._hypot_closure, A._hypot__closure, A._log_closure, A._pow_closure, A._atan2_closure, A._compatible_closure, A._isUnitless_closure, A._unit_closure, A._percentage_closure, A._randomFunction_closure, A._div_closure, A._singleArgumentMathFunc_closure, A._numberFunction_closure, A.global_closure27, A.global_closure28, A.global_closure29, A.global_closure30, A.local_closure, A.local_closure0, A.local__closure, A.local_closure1, A._nest_closure, A._nest__closure, A._append_closure, A._append__closure, A._append___closure, A._extend_closure, A._replace_closure, A._unify_closure, A._isSuperselector_closure, A._simpleSelectors_closure, A._simpleSelectors__closure, A._parse_closure, A.module_closure, A.module__closure, A.module__closure0, A._unquote_closure, A._quote_closure, A._length_closure, A._insert_closure, A._index_closure, A._slice_closure, A._toUpperCase_closure, A._toLowerCase_closure, A._uniqueId_closure, A.ImportCache_humanize_closure, A.ImportCache_humanize_closure0, A.ImportCache_humanize_closure1, A.ImportCache_humanize_closure2, A.FilesystemImporter_canonicalize_closure, A.NodePackageImporter__nodePackageExportsResolve_closure, A.NodePackageImporter__nodePackageExportsResolve_closure0, A.NodePackageImporter__nodePackageExportsResolve_closure1, A.NodePackageImporter__nodePackageExportsResolve_closure2, A.NodePackageImporter__nodePackageExportsResolve__closure, A.NodePackageImporter__nodePackageExportsResolve__closure0, A.NodePackageImporter__getMainExport_closure, A._exactlyOne_closure, A.InterpolationMap_mapException_closure, A._realCasePath_helper, A._realCasePath_helper__closure, A.readStdin_closure, A.readStdin_closure0, A.readStdin_closure1, A.readStdin_closure2, A.listDir__closure, A.listDir__closure0, A.listDir_closure_list, A.listDir__list_closure, A.watchDir_closure, A.watchDir_closure0, A.watchDir_closure1, A.watchDir_closure2, A.DeprecationHandlingLogger_summarize_closure, A.DeprecationHandlingLogger_summarize_closure0, A._disallowedFunctionNames_closure, A.Parser_escape_closure, A.Parser_scanIdentChar_matches, A.SassParser_styleRuleSelector_closure, A.SassParser__peekIndentation_closure, A.SassParser__peekIndentation_closure0, A.StylesheetParser_parse__closure0, A.StylesheetParser__expression_addSingleExpression, A.StylesheetParser__expression_addOperator, A.StylesheetParser__isHexColor_closure, A.StylesheetParser__unicodeRange_closure, A.StylesheetParser__unicodeRange_closure0, A.StylesheetParser_trySpecialFunction_closure, A.StylesheetGraph_modifiedSince_transitiveModificationTime, A.MapExtensions_get_pairs_closure, A._PrefixedKeys_iterator_closure, A.SourceMapBuffer_buildSourceMap_closure, A._UnprefixedKeys_iterator_closure, A._UnprefixedKeys_iterator_closure0, A.indent_closure, A.flattenVertically_closure, A.flattenVertically_closure0, A.SassCalculation__verifyLength_closure, A.SassColor_SassColor$hwb_toRgb, A.SassList_isBlank_closure, A.SassNumber__coerceOrConvertValue_closure, A.SassNumber__coerceOrConvertValue_closure1, A.SassNumber_multiplyUnits_closure, A.SassNumber_multiplyUnits_closure1, A.SassNumber__areAnyConvertible_closure, A.SassNumber__canonicalizeUnitList_closure, A.SassNumber_unitSuggestion_closure, A.SassNumber_unitSuggestion_closure0, A.SingleUnitSassNumber__coerceToUnit_closure, A.SingleUnitSassNumber__coerceValueToUnit_closure, A.SingleUnitSassNumber_multiplyUnits_closure, A.AnySelectorVisitor_visitComplexSelector_closure, A.AnySelectorVisitor_visitCompoundSelector_closure, A._EvaluateVisitor_closure12, A._EvaluateVisitor_closure13, A._EvaluateVisitor_closure14, A._EvaluateVisitor_closure15, A._EvaluateVisitor_closure16, A._EvaluateVisitor_closure17, A._EvaluateVisitor_closure18, A._EvaluateVisitor_closure19, A._EvaluateVisitor_closure20, A._EvaluateVisitor_closure21, A._EvaluateVisitor_closure22, A._EvaluateVisitor_closure23, A._EvaluateVisitor_closure24, A._EvaluateVisitor__loadModule__closure1, A._EvaluateVisitor__combineCss_closure1, A._EvaluateVisitor__combineCss_closure2, A._EvaluateVisitor__combineCss_visitModule0, A._EvaluateVisitor__extendModules_closure1, A._EvaluateVisitor__scopeForAtRoot_closure5, A._EvaluateVisitor__scopeForAtRoot_closure6, A._EvaluateVisitor__scopeForAtRoot_closure7, A._EvaluateVisitor__scopeForAtRoot_closure8, A._EvaluateVisitor__scopeForAtRoot_closure9, A._EvaluateVisitor__scopeForAtRoot_closure10, A._EvaluateVisitor_visitEachRule_closure2, A._EvaluateVisitor_visitEachRule_closure3, A._EvaluateVisitor_visitEachRule__closure0, A._EvaluateVisitor_visitEachRule___closure0, A._EvaluateVisitor_visitAtRule_closure2, A._EvaluateVisitor_visitAtRule_closure4, A._EvaluateVisitor_visitForRule__closure0, A._EvaluateVisitor_visitIfRule_closure0, A._EvaluateVisitor_visitIfRule___closure0, A._EvaluateVisitor__visitDynamicImport__closure3, A._EvaluateVisitor__visitDynamicImport__closure4, A._EvaluateVisitor__visitDynamicImport__closure5, A._EvaluateVisitor_visitIncludeRule_closure3, A._EvaluateVisitor_visitMediaRule_closure2, A._EvaluateVisitor_visitMediaRule_closure4, A._EvaluateVisitor_visitStyleRule_closure5, A._EvaluateVisitor_visitStyleRule_closure7, A._EvaluateVisitor_visitStyleRule_closure8, A._EvaluateVisitor_visitSupportsRule_closure2, A._EvaluateVisitor_visitWhileRule__closure0, A._EvaluateVisitor__slash_recommendation0, A._EvaluateVisitor_visitListExpression_closure0, A._EvaluateVisitor_visitFunctionExpression_closure3, A._EvaluateVisitor__checkCalculationArguments_check0, A._EvaluateVisitor__runUserDefinedCallable____closure0, A._EvaluateVisitor__runBuiltInCallable_closure4, A._EvaluateVisitor__evaluateArguments_closure3, A._EvaluateVisitor__evaluateArguments_closure4, A._EvaluateVisitor__evaluateArguments_closure6, A._EvaluateVisitor__evaluateMacroArguments_closure3, A._EvaluateVisitor__evaluateMacroArguments_closure4, A._EvaluateVisitor__evaluateMacroArguments_closure6, A._EvaluateVisitor_visitCssAtRule_closure2, A._EvaluateVisitor_visitCssKeyframeBlock_closure2, A._EvaluateVisitor_visitCssMediaRule_closure2, A._EvaluateVisitor_visitCssMediaRule_closure4, A._EvaluateVisitor_visitCssStyleRule_closure2, A._EvaluateVisitor_visitCssSupportsRule_closure2, A._EvaluateVisitor__performInterpolationHelper_closure0, A._EvaluateVisitor__withoutSlash_recommendation0, A._EvaluateVisitor__stackFrame_closure0, A._ImportedCssVisitor_visitCssAtRule_closure0, A._ImportedCssVisitor_visitCssMediaRule_closure0, A._ImportedCssVisitor_visitCssStyleRule_closure0, A._ImportedCssVisitor_visitCssSupportsRule_closure0, A._EvaluateVisitor_closure, A._EvaluateVisitor_closure0, A._EvaluateVisitor_closure1, A._EvaluateVisitor_closure2, A._EvaluateVisitor_closure3, A._EvaluateVisitor_closure4, A._EvaluateVisitor_closure5, A._EvaluateVisitor_closure6, A._EvaluateVisitor_closure7, A._EvaluateVisitor_closure8, A._EvaluateVisitor_closure9, A._EvaluateVisitor_closure10, A._EvaluateVisitor_closure11, A._EvaluateVisitor__loadModule__closure, A._EvaluateVisitor__combineCss_closure, A._EvaluateVisitor__combineCss_closure0, A._EvaluateVisitor__combineCss_visitModule, A._EvaluateVisitor__extendModules_closure, A._EvaluateVisitor__scopeForAtRoot_closure, A._EvaluateVisitor__scopeForAtRoot_closure0, A._EvaluateVisitor__scopeForAtRoot_closure1, A._EvaluateVisitor__scopeForAtRoot_closure2, A._EvaluateVisitor__scopeForAtRoot_closure3, A._EvaluateVisitor__scopeForAtRoot_closure4, A._EvaluateVisitor_visitEachRule_closure, A._EvaluateVisitor_visitEachRule_closure0, A._EvaluateVisitor_visitEachRule__closure, A._EvaluateVisitor_visitEachRule___closure, A._EvaluateVisitor_visitAtRule_closure, A._EvaluateVisitor_visitAtRule_closure1, A._EvaluateVisitor_visitForRule__closure, A._EvaluateVisitor_visitIfRule_closure, A._EvaluateVisitor_visitIfRule___closure, A._EvaluateVisitor__visitDynamicImport__closure, A._EvaluateVisitor__visitDynamicImport__closure0, A._EvaluateVisitor__visitDynamicImport__closure1, A._EvaluateVisitor_visitIncludeRule_closure0, A._EvaluateVisitor_visitMediaRule_closure, A._EvaluateVisitor_visitMediaRule_closure1, A._EvaluateVisitor_visitStyleRule_closure0, A._EvaluateVisitor_visitStyleRule_closure2, A._EvaluateVisitor_visitStyleRule_closure3, A._EvaluateVisitor_visitSupportsRule_closure0, A._EvaluateVisitor_visitWhileRule__closure, A._EvaluateVisitor__slash_recommendation, A._EvaluateVisitor_visitListExpression_closure, A._EvaluateVisitor_visitFunctionExpression_closure0, A._EvaluateVisitor__checkCalculationArguments_check, A._EvaluateVisitor__runUserDefinedCallable____closure, A._EvaluateVisitor__runBuiltInCallable_closure1, A._EvaluateVisitor__evaluateArguments_closure, A._EvaluateVisitor__evaluateArguments_closure0, A._EvaluateVisitor__evaluateArguments_closure2, A._EvaluateVisitor__evaluateMacroArguments_closure, A._EvaluateVisitor__evaluateMacroArguments_closure0, A._EvaluateVisitor__evaluateMacroArguments_closure2, A._EvaluateVisitor_visitCssAtRule_closure0, A._EvaluateVisitor_visitCssKeyframeBlock_closure0, A._EvaluateVisitor_visitCssMediaRule_closure, A._EvaluateVisitor_visitCssMediaRule_closure1, A._EvaluateVisitor_visitCssStyleRule_closure0, A._EvaluateVisitor_visitCssSupportsRule_closure0, A._EvaluateVisitor__performInterpolationHelper_closure, A._EvaluateVisitor__withoutSlash_recommendation, A._EvaluateVisitor__stackFrame_closure, A._ImportedCssVisitor_visitCssAtRule_closure, A._ImportedCssVisitor_visitCssMediaRule_closure, A._ImportedCssVisitor_visitCssStyleRule_closure, A._ImportedCssVisitor_visitCssSupportsRule_closure, A.EveryCssVisitor_visitCssAtRule_closure, A.EveryCssVisitor_visitCssKeyframeBlock_closure, A.EveryCssVisitor_visitCssMediaRule_closure, A.EveryCssVisitor_visitCssStyleRule_closure, A.EveryCssVisitor_visitCssStylesheet_closure, A.EveryCssVisitor_visitCssSupportsRule_closure, A.ReplaceExpressionVisitor_visitListExpression_closure, A.ReplaceExpressionVisitor_visitArgumentInvocation_closure, A.ReplaceExpressionVisitor_visitInterpolation_closure, A.SelectorSearchVisitor_visitComplexSelector_closure, A.SelectorSearchVisitor_visitCompoundSelector_closure, A.serialize_closure, A._SerializeVisitor_visitList_closure, A._SerializeVisitor_visitList_closure0, A._SerializeVisitor_visitList_closure1, A._SerializeVisitor_visitMap_closure, A._SerializeVisitor_visitSelectorList_closure, A.StatementSearchVisitor_visitIfRule_closure, A.StatementSearchVisitor_visitIfRule__closure0, A.StatementSearchVisitor_visitIfRule_closure0, A.StatementSearchVisitor_visitIfRule__closure, A.StatementSearchVisitor_visitChildren_closure, A.SingleMapping_SingleMapping$fromEntries_closure1, A.SingleMapping_toJson_closure, A.Highlighter$__closure, A.Highlighter$___closure, A.Highlighter$__closure0, A.Highlighter__collateLines_closure, A.Highlighter__collateLines_closure1, A.Highlighter__collateLines__closure, A.Highlighter_highlight_closure, A.Chain_Chain$parse_closure, A.Chain_toTrace_closure, A.Chain_toString_closure0, A.Chain_toString__closure0, A.Chain_toString_closure, A.Chain_toString__closure, A.Trace__parseVM_closure, A.Trace$parseV8_closure, A.Trace$parseJSCore_closure, A.Trace$parseFirefox_closure, A.Trace$parseFriendly_closure, A.Trace_terse_closure, A.Trace_foldFrames_closure, A.Trace_foldFrames_closure0, A.Trace_toString_closure0, A.Trace_toString_closure, A.TransformByHandlers_transformByHandlers__closure, A.RateLimit__debounceAggregate_closure0, A.AnySelectorVisitor_visitComplexSelector_closure0, A.AnySelectorVisitor_visitCompoundSelector_closure0, A.ArgumentDeclaration_verify_closure1, A.ArgumentDeclaration_verify_closure2, A.argumentListClass__closure, A.argumentListClass__closure0, A.AsyncBuiltInCallable$mixin_closure0, A._compileStylesheet_closure2, A.AsyncEnvironment__getVariableFromGlobalModule_closure0, A.AsyncEnvironment_setVariable_closure3, A.AsyncEnvironment__getFunctionFromGlobalModule_closure0, A.AsyncEnvironment__getMixinFromGlobalModule_closure0, A.AsyncEnvironment_toModule_closure0, A.AsyncEnvironment_toDummyModule_closure0, A._EnvironmentModule__EnvironmentModule_closure17, A._EnvironmentModule__EnvironmentModule_closure18, A._EnvironmentModule__EnvironmentModule_closure19, A._EnvironmentModule__EnvironmentModule_closure20, A._EnvironmentModule__EnvironmentModule_closure21, A._EnvironmentModule__EnvironmentModule_closure22, A._EvaluateVisitor_closure38, A._EvaluateVisitor_closure39, A._EvaluateVisitor_closure40, A._EvaluateVisitor_closure41, A._EvaluateVisitor_closure42, A._EvaluateVisitor_closure43, A._EvaluateVisitor_closure44, A._EvaluateVisitor_closure45, A._EvaluateVisitor_closure46, A._EvaluateVisitor_closure47, A._EvaluateVisitor_closure48, A._EvaluateVisitor_closure49, A._EvaluateVisitor_closure50, A._EvaluateVisitor__loadModule__closure5, A._EvaluateVisitor__combineCss_closure5, A._EvaluateVisitor__combineCss_closure6, A._EvaluateVisitor__combineCss_visitModule2, A._EvaluateVisitor__extendModules_closure5, A._EvaluateVisitor__scopeForAtRoot_closure17, A._EvaluateVisitor__scopeForAtRoot_closure18, A._EvaluateVisitor__scopeForAtRoot_closure19, A._EvaluateVisitor__scopeForAtRoot_closure20, A._EvaluateVisitor__scopeForAtRoot_closure21, A._EvaluateVisitor__scopeForAtRoot_closure22, A._EvaluateVisitor_visitEachRule_closure8, A._EvaluateVisitor_visitEachRule_closure9, A._EvaluateVisitor_visitEachRule__closure2, A._EvaluateVisitor_visitEachRule___closure2, A._EvaluateVisitor_visitAtRule_closure8, A._EvaluateVisitor_visitAtRule_closure10, A._EvaluateVisitor_visitForRule__closure2, A._EvaluateVisitor_visitIfRule_closure2, A._EvaluateVisitor_visitIfRule___closure2, A._EvaluateVisitor__visitDynamicImport__closure11, A._EvaluateVisitor__visitDynamicImport__closure12, A._EvaluateVisitor__visitDynamicImport__closure13, A._EvaluateVisitor_visitIncludeRule_closure9, A._EvaluateVisitor_visitMediaRule_closure8, A._EvaluateVisitor_visitMediaRule_closure10, A._EvaluateVisitor_visitStyleRule_closure15, A._EvaluateVisitor_visitStyleRule_closure17, A._EvaluateVisitor_visitStyleRule_closure18, A._EvaluateVisitor_visitSupportsRule_closure6, A._EvaluateVisitor_visitWhileRule__closure2, A._EvaluateVisitor__slash_recommendation2, A._EvaluateVisitor_visitListExpression_closure2, A._EvaluateVisitor_visitFunctionExpression_closure9, A._EvaluateVisitor__checkCalculationArguments_check2, A._EvaluateVisitor__runUserDefinedCallable____closure2, A._EvaluateVisitor__runBuiltInCallable_closure10, A._EvaluateVisitor__evaluateArguments_closure11, A._EvaluateVisitor__evaluateArguments_closure12, A._EvaluateVisitor__evaluateArguments_closure14, A._EvaluateVisitor__evaluateMacroArguments_closure11, A._EvaluateVisitor__evaluateMacroArguments_closure12, A._EvaluateVisitor__evaluateMacroArguments_closure14, A._EvaluateVisitor_visitCssAtRule_closure6, A._EvaluateVisitor_visitCssKeyframeBlock_closure6, A._EvaluateVisitor_visitCssMediaRule_closure8, A._EvaluateVisitor_visitCssMediaRule_closure10, A._EvaluateVisitor_visitCssStyleRule_closure6, A._EvaluateVisitor_visitCssSupportsRule_closure6, A._EvaluateVisitor__performInterpolationHelper_closure2, A._EvaluateVisitor__withoutSlash_recommendation2, A._EvaluateVisitor__stackFrame_closure2, A._ImportedCssVisitor_visitCssAtRule_closure2, A._ImportedCssVisitor_visitCssMediaRule_closure2, A._ImportedCssVisitor_visitCssStyleRule_closure2, A._ImportedCssVisitor_visitCssSupportsRule_closure2, A.AsyncImportCache_humanize_closure3, A.AsyncImportCache_humanize_closure4, A.AsyncImportCache_humanize_closure5, A.AsyncImportCache_humanize_closure6, A.booleanClass__closure, A.legacyBooleanClass__closure, A.legacyBooleanClass__closure0, A.BuiltInCallable$mixin_closure0, A.calculationClass__closure, A.calculationClass__closure0, A.calculationClass__closure1, A.calculationClass__closure2, A.calculationClass__closure3, A.calculationClass__closure4, A.calculationClass__closure5, A.calculationOperationClass__closure, A.calculationOperationClass___closure, A.calculationOperationClass__closure1, A.calculationOperationClass__closure2, A.calculationOperationClass__closure3, A.calculationOperationClass__closure4, A.calculationInterpolationClass__closure1, A.calculationInterpolationClass__closure2, A.SassCalculation__verifyLength_closure0, A.global_closure32, A.global_closure33, A.global_closure34, A.global_closure35, A.global_closure36, A.global_closure37, A.global_closure38, A.global_closure39, A.global_closure40, A.global_closure41, A.global_closure42, A.global_closure43, A.global_closure44, A.global_closure45, A.global_closure46, A.global_closure47, A.global_closure48, A.global_closure49, A.global_closure50, A.global_closure51, A.global_closure52, A.global_closure53, A.global_closure54, A.global_closure55, A.global_closure56, A.global_closure57, A.global__closure0, A.global_closure58, A.module_closure12, A.module_closure13, A.module_closure14, A.module_closure15, A.module_closure16, A.module_closure17, A.module_closure18, A.module_closure19, A.module__closure4, A.module_closure20, A._red_closure0, A._green_closure0, A._blue_closure0, A._mix_closure0, A._hue_closure0, A._saturation_closure0, A._lightness_closure0, A._complement_closure0, A._adjust_closure0, A._scale_closure0, A._change_closure0, A._ieHexStr_closure0, A._ieHexStr_closure_hexString0, A._updateComponents_getParam0, A._updateComponents_closure1, A._updateComponents_closure2, A._updateComponents_updateValue0, A._functionString_closure0, A._removedColorFunction_closure0, A._rgb_closure0, A._hsl_closure0, A._hwb_closure0, A._parseChannels_closure0, A.colorClass__closure1, A.colorClass__closure2, A.colorClass__closure3, A.colorClass__closure4, A.colorClass__closure5, A.colorClass__closure6, A.colorClass__closure7, A.colorClass__closure8, A.colorClass__closure9, A.legacyColorClass_closure, A.legacyColorClass_closure0, A.legacyColorClass_closure1, A.legacyColorClass_closure2, A.legacyColorClass_closure3, A.SassColor_SassColor$hwb_toRgb0, A.compileAsync__closure, A.compileStringAsync__closure, A.compileStringAsync__closure0, A._wrapAsyncSassExceptions_closure, A._parseFunctions__closure2, A._parseFunctions__closure3, A.nodePackageImporterClass__closure, A._compileStylesheet_closure1, A.AsyncCompiler_addCompilation_closure, A.compilerClass__closure, A.compilerClass__closure0, A.compilerClass__closure1, A.compilerClass__closure2, A.asyncCompilerClass__closure, A.asyncCompilerClass__closure0, A.asyncCompilerClass__closure1, A.asyncCompilerClass__closure2, A.ComplexSelectorComponent_toString_closure0, A._disallowedFunctionNames_closure0, A.DeprecationHandlingLogger_summarize_closure1, A.DeprecationHandlingLogger_summarize_closure2, A.EachRule_toString_closure0, A.Environment__getVariableFromGlobalModule_closure0, A.Environment_setVariable_closure3, A.Environment__getFunctionFromGlobalModule_closure0, A.Environment__getMixinFromGlobalModule_closure0, A.Environment_toModule_closure0, A.Environment_toDummyModule_closure0, A._EnvironmentModule__EnvironmentModule_closure11, A._EnvironmentModule__EnvironmentModule_closure12, A._EnvironmentModule__EnvironmentModule_closure13, A._EnvironmentModule__EnvironmentModule_closure14, A._EnvironmentModule__EnvironmentModule_closure15, A._EnvironmentModule__EnvironmentModule_closure16, A._EvaluateVisitor_closure25, A._EvaluateVisitor_closure26, A._EvaluateVisitor_closure27, A._EvaluateVisitor_closure28, A._EvaluateVisitor_closure29, A._EvaluateVisitor_closure30, A._EvaluateVisitor_closure31, A._EvaluateVisitor_closure32, A._EvaluateVisitor_closure33, A._EvaluateVisitor_closure34, A._EvaluateVisitor_closure35, A._EvaluateVisitor_closure36, A._EvaluateVisitor_closure37, A._EvaluateVisitor__loadModule__closure3, A._EvaluateVisitor__combineCss_closure3, A._EvaluateVisitor__combineCss_closure4, A._EvaluateVisitor__combineCss_visitModule1, A._EvaluateVisitor__extendModules_closure3, A._EvaluateVisitor__scopeForAtRoot_closure11, A._EvaluateVisitor__scopeForAtRoot_closure12, A._EvaluateVisitor__scopeForAtRoot_closure13, A._EvaluateVisitor__scopeForAtRoot_closure14, A._EvaluateVisitor__scopeForAtRoot_closure15, A._EvaluateVisitor__scopeForAtRoot_closure16, A._EvaluateVisitor_visitEachRule_closure5, A._EvaluateVisitor_visitEachRule_closure6, A._EvaluateVisitor_visitEachRule__closure1, A._EvaluateVisitor_visitEachRule___closure1, A._EvaluateVisitor_visitAtRule_closure5, A._EvaluateVisitor_visitAtRule_closure7, A._EvaluateVisitor_visitForRule__closure1, A._EvaluateVisitor_visitIfRule_closure1, A._EvaluateVisitor_visitIfRule___closure1, A._EvaluateVisitor__visitDynamicImport__closure7, A._EvaluateVisitor__visitDynamicImport__closure8, A._EvaluateVisitor__visitDynamicImport__closure9, A._EvaluateVisitor_visitIncludeRule_closure6, A._EvaluateVisitor_visitMediaRule_closure5, A._EvaluateVisitor_visitMediaRule_closure7, A._EvaluateVisitor_visitStyleRule_closure10, A._EvaluateVisitor_visitStyleRule_closure12, A._EvaluateVisitor_visitStyleRule_closure13, A._EvaluateVisitor_visitSupportsRule_closure4, A._EvaluateVisitor_visitWhileRule__closure1, A._EvaluateVisitor__slash_recommendation1, A._EvaluateVisitor_visitListExpression_closure1, A._EvaluateVisitor_visitFunctionExpression_closure6, A._EvaluateVisitor__checkCalculationArguments_check1, A._EvaluateVisitor__runUserDefinedCallable____closure1, A._EvaluateVisitor__runBuiltInCallable_closure7, A._EvaluateVisitor__evaluateArguments_closure7, A._EvaluateVisitor__evaluateArguments_closure8, A._EvaluateVisitor__evaluateArguments_closure10, A._EvaluateVisitor__evaluateMacroArguments_closure7, A._EvaluateVisitor__evaluateMacroArguments_closure8, A._EvaluateVisitor__evaluateMacroArguments_closure10, A._EvaluateVisitor_visitCssAtRule_closure4, A._EvaluateVisitor_visitCssKeyframeBlock_closure4, A._EvaluateVisitor_visitCssMediaRule_closure5, A._EvaluateVisitor_visitCssMediaRule_closure7, A._EvaluateVisitor_visitCssStyleRule_closure4, A._EvaluateVisitor_visitCssSupportsRule_closure4, A._EvaluateVisitor__performInterpolationHelper_closure1, A._EvaluateVisitor__withoutSlash_recommendation1, A._EvaluateVisitor__stackFrame_closure1, A._ImportedCssVisitor_visitCssAtRule_closure1, A._ImportedCssVisitor_visitCssMediaRule_closure1, A._ImportedCssVisitor_visitCssStyleRule_closure1, A._ImportedCssVisitor_visitCssSupportsRule_closure1, A.EveryCssVisitor_visitCssAtRule_closure0, A.EveryCssVisitor_visitCssKeyframeBlock_closure0, A.EveryCssVisitor_visitCssMediaRule_closure0, A.EveryCssVisitor_visitCssStyleRule_closure0, A.EveryCssVisitor_visitCssStylesheet_closure0, A.EveryCssVisitor_visitCssSupportsRule_closure0, A.exceptionClass__closure, A.exceptionClass__closure0, A.exceptionClass__closure1, A._IsCalculationSafeVisitor_visitListExpression_closure0, A.ExtensionStore_extensionsWhereTarget_closure0, A.ExtensionStore__extendComplex_closure0, A.ExtensionStore__extendComplex__closure0, A.ExtensionStore__extendCompound_closure2, A.ExtensionStore__extendCompound_closure3, A.ExtensionStore__extendCompound_closure4, A.ExtensionStore__extendSimple_withoutPseudo0, A.ExtensionStore__extendSimple_closure1, A.ExtensionStore__extendSimple_closure2, A.ExtensionStore__extendPseudo_closure4, A.ExtensionStore__extendPseudo_closure5, A.ExtensionStore__extendPseudo_closure6, A.ExtensionStore__extendPseudo_closure7, A.ExtensionStore__extendPseudo_closure8, A.ExtensionStore__trim_closure1, A.ExtensionStore__trim_closure2, A.FilesystemImporter_canonicalize_closure0, A.functionClass__closure, A.functionClass__closure0, A.unifyComplex_closure0, A._weaveParents_closure4, A._weaveParents_closure5, A._weaveParents_closure6, A._mustUnify_closure0, A._mustUnify__closure0, A.paths__closure0, A.paths___closure0, A.listIsSuperselector_closure0, A.listIsSuperselector__closure0, A.complexIsSuperselector_closure1, A.complexIsSuperselector_closure2, A._compatibleWithPreviousCombinator_closure0, A._selectorPseudoIsSuperselector_closure6, A._selectorPseudoIsSuperselector_closure7, A._selectorPseudoIsSuperselector_closure8, A._selectorPseudoIsSuperselector_closure9, A._selectorPseudoIsSuperselector_closure10, A._selectorPseudoIsSuperselector__closure0, A._selectorPseudoIsSuperselector___closure1, A._selectorPseudoIsSuperselector___closure2, A._selectorPseudoIsSuperselector_closure11, A._selectorPseudoIsSuperselector_closure12, A._selectorPseudoArgs_closure1, A._selectorPseudoArgs_closure2, A.globalFunctions_closure0, A.IDSelector_unify_closure0, A.IfRuleClause$__closure0, A.IfRuleClause$___closure0, A.immutableMapToDartMap_closure, A.NodeImporter__tryPath_closure0, A.ImportCache_humanize_closure3, A.ImportCache_humanize_closure4, A.ImportCache_humanize_closure5, A.ImportCache_humanize_closure6, A.Interpolation_toString_closure0, A.InterpolationMap_mapException_closure0, A._realCasePath_helper0, A._realCasePath_helper__closure0, A.listDir__closure1, A.listDir__closure2, A.listDir_closure_list0, A.listDir__list_closure0, A.render_closure0, A._parseFunctions__closure, A._parseFunctions___closure2, A._parseFunctions__closure0, A._parseFunctions__closure1, A._parseFunctions___closure, A._parseImporter_closure, A._parseImporter__closure, A._parseImporter___closure, A.ListExpression_toString_closure0, A._length_closure2, A._nth_closure0, A._setNth_closure0, A._join_closure0, A._append_closure2, A._zip_closure0, A._zip__closure2, A._zip__closure3, A._zip__closure4, A._index_closure2, A._separator_closure0, A._isBracketed_closure0, A._slash_closure0, A.SelectorList_asSassList_closure0, A.SelectorList_resolveParentSelectors_closure0, A.SelectorList_resolveParentSelectors__closure1, A.SelectorList_resolveParentSelectors__closure2, A.SelectorList__resolveParentSelectorsCompound_closure2, A.SelectorList__resolveParentSelectorsCompound_closure3, A.SelectorList__resolveParentSelectorsCompound_closure4, A.SelectorList_withAdditionalCombinators_closure0, A.listClass__closure, A.legacyListClass_closure, A.legacyListClass__closure, A.legacyListClass_closure1, A.legacyListClass_closure2, A.legacyListClass_closure4, A.SassList_isBlank_closure0, A._get_closure0, A._set_closure1, A._set__closure2, A._set_closure2, A._set__closure1, A._merge_closure1, A._merge_closure2, A._merge__closure0, A._deepMerge_closure0, A._deepRemove_closure0, A._deepRemove__closure0, A._remove_closure1, A._remove_closure2, A._keys_closure0, A._values_closure0, A._hasKey_closure0, A._modify_modifyNestedMap0, A.MapExtensions_get_pairs_closure0, A.mapClass__closure, A.mapClass__closure0, A.legacyMapClass_closure, A.legacyMapClass__closure, A.legacyMapClass__closure0, A.legacyMapClass_closure2, A.legacyMapClass_closure3, A.legacyMapClass_closure4, A.global_closure31, A.module_closure11, A._ceil_closure0, A._clamp_closure0, A._floor_closure0, A._max_closure0, A._min_closure0, A._round_closure0, A._hypot_closure0, A._hypot__closure0, A._log_closure0, A._pow_closure0, A._atan2_closure0, A._compatible_closure0, A._isUnitless_closure0, A._unit_closure0, A._percentage_closure0, A._randomFunction_closure0, A._div_closure0, A._singleArgumentMathFunc_closure0, A._numberFunction_closure0, A.global_closure59, A.global_closure60, A.global_closure61, A.global_closure62, A.local_closure2, A.local_closure3, A.local__closure0, A.local_closure4, A.mixinClass__closure, A.mixinClass__closure0, A.ModifiableCssNode_hasFollowingSibling_closure0, A.NodePackageImporter__nodePackageExportsResolve_closure3, A.NodePackageImporter__nodePackageExportsResolve_closure4, A.NodePackageImporter__nodePackageExportsResolve_closure5, A.NodePackageImporter__nodePackageExportsResolve_closure6, A.NodePackageImporter__nodePackageExportsResolve__closure1, A.NodePackageImporter__nodePackageExportsResolve__closure2, A.NodePackageImporter__getMainExport_closure0, A.legacyNullClass__closure, A.numberClass__closure, A.numberClass__closure0, A.numberClass__closure1, A.numberClass__closure2, A.numberClass__closure3, A.numberClass__closure4, A.numberClass__closure5, A.numberClass__closure6, A.numberClass__closure7, A.numberClass__closure8, A.numberClass__closure9, A.numberClass__closure12, A.numberClass__closure13, A.numberClass__closure14, A.numberClass__closure15, A.numberClass__closure16, A.numberClass__closure17, A.numberClass__closure18, A.numberClass__closure19, A.legacyNumberClass_closure, A.legacyNumberClass_closure0, A.legacyNumberClass_closure2, A._parseNumber_closure, A._parseNumber_closure0, A.SassNumber__coerceOrConvertValue_closure3, A.SassNumber__coerceOrConvertValue_closure5, A.SassNumber_multiplyUnits_closure3, A.SassNumber_multiplyUnits_closure5, A.SassNumber__areAnyConvertible_closure0, A.SassNumber__canonicalizeUnitList_closure0, A.SassNumber_unitSuggestion_closure1, A.SassNumber_unitSuggestion_closure2, A.ParentStatement_closure0, A.ParentStatement__closure0, A.Parser_escape_closure0, A.Parser_scanIdentChar_matches0, A._PrefixedKeys_iterator_closure0, A.PseudoSelector_specificity__closure1, A.PseudoSelector_specificity__closure2, A.PseudoSelector_unify_closure0, A.JSClassExtension_setCustomInspect_closure, A.ReplaceExpressionVisitor_visitListExpression_closure0, A.ReplaceExpressionVisitor_visitArgumentInvocation_closure0, A.ReplaceExpressionVisitor_visitInterpolation_closure0, A.SassParser_styleRuleSelector_closure0, A.SassParser__peekIndentation_closure1, A.SassParser__peekIndentation_closure2, A._wrapMain_closure, A._wrapMain_closure0, A._IsBogusVisitor_visitComplexSelector_closure0, A._IsUselessVisitor_visitComplexSelector_closure0, A._nest_closure0, A._nest__closure1, A._append_closure1, A._append__closure1, A._append___closure0, A._extend_closure0, A._replace_closure0, A._unify_closure0, A._isSuperselector_closure0, A._simpleSelectors_closure0, A._simpleSelectors__closure0, A._parse_closure0, A.SelectorSearchVisitor_visitComplexSelector_closure0, A.SelectorSearchVisitor_visitCompoundSelector_closure0, A.serialize_closure0, A._SerializeVisitor_visitList_closure2, A._SerializeVisitor_visitList_closure3, A._SerializeVisitor_visitList_closure4, A._SerializeVisitor_visitMap_closure0, A._SerializeVisitor_visitSelectorList_closure0, A.SimpleSelector_isSuperselector_closure0, A.SimpleSelector_isSuperselector__closure0, A.SingleUnitSassNumber__coerceToUnit_closure0, A.SingleUnitSassNumber__coerceValueToUnit_closure0, A.SingleUnitSassNumber_multiplyUnits_closure1, A.SourceMapBuffer_buildSourceMap_closure0, A.updateSourceSpanPrototype_closure0, A.updateSourceSpanPrototype_closure1, A.updateSourceSpanPrototype_closure2, A.updateSourceSpanPrototype_closure3, A.updateSourceSpanPrototype_closure4, A.updateSourceSpanPrototype_closure5, A.updateSourceSpanPrototype_closure6, A.StatementSearchVisitor_visitIfRule_closure1, A.StatementSearchVisitor_visitIfRule__closure2, A.StatementSearchVisitor_visitIfRule_closure2, A.StatementSearchVisitor_visitIfRule__closure1, A.StatementSearchVisitor_visitChildren_closure0, A.module_closure10, A.module__closure2, A.module__closure3, A._unquote_closure0, A._quote_closure0, A._length_closure1, A._insert_closure0, A._index_closure1, A._slice_closure0, A._toUpperCase_closure0, A._toLowerCase_closure0, A._uniqueId_closure0, A.stringClass__closure, A.stringClass__closure0, A.stringClass__closure1, A.stringClass__closure2, A.stringClass__closure3, A.legacyStringClass_closure, A.legacyStringClass_closure0, A.StylesheetParser_parse__closure2, A.StylesheetParser__expression_addSingleExpression0, A.StylesheetParser__expression_addOperator0, A.StylesheetParser__isHexColor_closure0, A.StylesheetParser__unicodeRange_closure1, A.StylesheetParser__unicodeRange_closure2, A.StylesheetParser_trySpecialFunction_closure0, A._UnprefixedKeys_iterator_closure1, A._UnprefixedKeys_iterator_closure2, A._exactlyOne_closure0, A.futureToPromise__closure0, A.indent_closure0, A.flattenVertically_closure1, A.flattenVertically_closure2, A.valueClass__closure, A.valueClass__closure0, A.valueClass__closure1, A.valueClass__closure2, A.valueClass__closure3, A.valueClass__closure4, A.valueClass__closure5, A.valueClass__closure7, A.valueClass__closure8, A.valueClass__closure9, A.valueClass__closure10, A.valueClass__closure11, A.valueClass__closure12, A.valueClass__closure13, A.valueClass__closure14, A.valueClass__closure15, A.valueClass__closure17, A.valueClass__closure18]); + _inheritMany(A.Closure2Args, [A._CastListBase_sort_closure, A.CastMap_forEach_closure, A.Primitives_functionNoSuchMethod_closure, A.JsLinkedHashMap_addAll_closure, A.initHooks_closure0, A._awaitOnObject_closure0, A._wrapJsFunctionForAsync_closure, A.Future_wait_handleError, A._Future__chainForeignFuture_closure0, A.Stream_Stream$fromFuture_closure0, A._AddStreamState_makeErrorHandler_closure, A._HashMap_addAll_closure, A.HashMap_HashMap$from_closure, A.LinkedHashMap_LinkedHashMap$from_closure, A.MapBase_addAll_closure, A.MapBase_mapToString_closure, A._JsonMap_addAll_closure, A._JsonStringifier_writeMap_closure, A.NoSuchMethodError_toString_closure, A.Uri__parseIPv4Address_error, A.Uri_parseIPv6Address_error, A.Uri_parseIPv6Address_parseHex, A._createTables_build, A.Parser_parse_closure, A.FutureGroup_add_closure0, A.StreamQueue__ensureListening_closure1, A.futureToPromise_closure, A.PathMap__create_closure, A.IfRule_toString_closure, A.ComplexSelector_specificity_closure, A.CompoundSelector_specificity_closure, A.ExtensionStore_clone_closure, A._weaveParents_closure, A.paths_closure, A._updateComponents_updateRgb, A._nest__closure0, A._append__closure0, A.ImportCache_clearCanonicalize_closure, A.StylesheetParser__declarationOrBuffer_closure, A.StylesheetParser__declarationOrBuffer_closure0, A.StylesheetParser__styleRule_closure, A.StylesheetParser__propertyOrVariableDeclaration_closure, A.StylesheetParser__propertyOrVariableDeclaration_closure0, A.StylesheetParser__atRootRule_closure, A.StylesheetParser__atRootRule_closure0, A.StylesheetParser__eachRule_closure, A.StylesheetParser__functionRule_closure, A.StylesheetParser__forRule_closure0, A.StylesheetParser__includeRule_closure, A.StylesheetParser_mediaRule_closure, A.StylesheetParser__mixinRule_closure, A.StylesheetParser_mozDocumentRule_closure, A.StylesheetParser_supportsRule_closure, A.StylesheetParser__whileRule_closure, A.StylesheetParser_unknownAtRule_closure, A.longestCommonSubsequence_backtrack, A.mapAddAll2_closure, A.SassNumber_plus_closure, A.SassNumber_minus_closure, A.SassNumber__canonicalMultiplier_closure, A._EvaluateVisitor__closure3, A._EvaluateVisitor__closure4, A._EvaluateVisitor_visitForwardRule_closure1, A._EvaluateVisitor_visitForwardRule_closure2, A._EvaluateVisitor_visitUseRule_closure0, A._EvaluateVisitor__evaluateArguments_closure5, A._EvaluateVisitor__evaluateMacroArguments_closure5, A._EvaluateVisitor__addRestMap_closure0, A._EvaluateVisitor__closure, A._EvaluateVisitor__closure0, A._EvaluateVisitor_visitForwardRule_closure, A._EvaluateVisitor_visitForwardRule_closure0, A._EvaluateVisitor_visitUseRule_closure, A._EvaluateVisitor__evaluateArguments_closure1, A._EvaluateVisitor__evaluateMacroArguments_closure1, A._EvaluateVisitor__addRestMap_closure, A.SingleMapping_toJson_closure0, A.Highlighter__collateLines_closure0, A.Frame_Frame$parseV8_closure_parseLocation, A.TransformByHandlers_transformByHandlers__closure1, A.RateLimit__debounceAggregate_closure, A._EvaluateVisitor__closure11, A._EvaluateVisitor__closure12, A._EvaluateVisitor_visitForwardRule_closure5, A._EvaluateVisitor_visitForwardRule_closure6, A._EvaluateVisitor_visitUseRule_closure2, A._EvaluateVisitor__evaluateArguments_closure13, A._EvaluateVisitor__evaluateMacroArguments_closure13, A._EvaluateVisitor__addRestMap_closure2, A.calculationOperationClass__closure0, A.calculationInterpolationClass__closure, A.calculationInterpolationClass__closure0, A._updateComponents_updateRgb0, A.colorClass__closure, A.colorClass__closure0, A.legacyColorClass_closure4, A.legacyColorClass_closure5, A.legacyColorClass_closure6, A.legacyColorClass_closure7, A._parseFunctions_closure0, A.ComplexSelector_specificity_closure0, A.CompoundSelector_specificity_closure0, A._EvaluateVisitor__closure7, A._EvaluateVisitor__closure8, A._EvaluateVisitor_visitForwardRule_closure3, A._EvaluateVisitor_visitForwardRule_closure4, A._EvaluateVisitor_visitUseRule_closure1, A._EvaluateVisitor__evaluateArguments_closure9, A._EvaluateVisitor__evaluateMacroArguments_closure9, A._EvaluateVisitor__addRestMap_closure1, A.ExtensionStore_clone_closure0, A._weaveParents_closure3, A.paths_closure0, A.IfRule_toString_closure0, A.main_closure, A.main_closure0, A.render_closure1, A._parseFunctions_closure, A.listClass__closure0, A.legacyListClass_closure0, A.legacyListClass_closure3, A.mapClass__closure1, A.legacyMapClass_closure0, A.legacyMapClass_closure1, A.numberClass__closure10, A.numberClass__closure11, A.legacyNumberClass_closure1, A.legacyNumberClass_closure3, A.SassNumber_plus_closure0, A.SassNumber_minus_closure0, A.SassNumber__canonicalMultiplier_closure0, A.JSClassExtension_get_defineStaticMethod_closure, A.JSClassExtension_get_defineMethod_closure, A.JSClassExtension_get_defineGetter_closure, A._nest__closure2, A._append__closure2, A.legacyStringClass_closure1, A.StylesheetParser__declarationOrBuffer_closure1, A.StylesheetParser__declarationOrBuffer_closure2, A.StylesheetParser__styleRule_closure0, A.StylesheetParser__propertyOrVariableDeclaration_closure1, A.StylesheetParser__propertyOrVariableDeclaration_closure2, A.StylesheetParser__atRootRule_closure1, A.StylesheetParser__atRootRule_closure2, A.StylesheetParser__eachRule_closure0, A.StylesheetParser__functionRule_closure0, A.StylesheetParser__forRule_closure2, A.StylesheetParser__includeRule_closure0, A.StylesheetParser_mediaRule_closure0, A.StylesheetParser__mixinRule_closure0, A.StylesheetParser_mozDocumentRule_closure0, A.StylesheetParser_supportsRule_closure0, A.StylesheetParser__whileRule_closure0, A.StylesheetParser_unknownAtRule_closure0, A.futureToPromise_closure0, A.futureToPromise__closure1, A.objectToMap_closure, A.longestCommonSubsequence_backtrack0, A.mapAddAll2_closure0, A.valueClass__closure6, A.valueClass__closure16]); + _inherit(A.CastList, A._CastListBase); + _inheritMany(A.MapBase, [A.CastMap, A.JsLinkedHashMap, A._HashMap, A.UnmodifiableMapBase, A._JsonMap, A.MergedMapView, A.MergedMapView0]); + _inheritMany(A.Error, [A.LateError, A.ReachabilityError, A.TypeError, A.JsNoSuchMethodError, A.UnknownJsTypeError, A._CyclicInitializationError, A.RuntimeError, A._Error, A.JsonUnsupportedObjectError, A.AssertionError, A.ArgumentError, A.NoSuchMethodError, A.UnsupportedError, A.UnimplementedError, A.StateError, A.ConcurrentModificationError]); + _inherit(A.UnmodifiableListBase, A.ListBase); + _inheritMany(A.UnmodifiableListBase, [A.CodeUnits, A.UnmodifiableListView]); + _inheritMany(A.Closure0Args, [A.nullFuture_closure, A._AsyncRun__scheduleImmediateJsOverride_internalCallback, A._AsyncRun__scheduleImmediateWithSetImmediate_internalCallback, A._TimerImpl_internalCallback, A._TimerImpl$periodic_closure, A._Future__addListener_closure, A._Future__prependListeners_closure, A._Future__chainForeignFuture_closure1, A._Future__chainCoreFutureAsync_closure, A._Future__asyncCompleteWithValue_closure, A._Future__asyncCompleteError_closure, A._Future__propagateToListeners_handleWhenCompleteCallback, A._Future__propagateToListeners_handleValueCallback, A._Future__propagateToListeners_handleError, A.Stream_length_closure0, A._StreamController__subscribe_closure, A._StreamController__recordCancel_complete, A._AddStreamState_cancel_closure, A._BufferingStreamSubscription__sendError_sendError, A._BufferingStreamSubscription__sendDone_sendDone, A._PendingEvents_schedule_closure, A._CustomZone_bindCallback_closure, A._CustomZone_bindCallbackGuarded_closure, A._rootHandleError_closure, A._RootZone_bindCallback_closure, A._RootZone_bindCallbackGuarded_closure, A._Utf8Decoder__decoder_closure, A._Utf8Decoder__decoderNonfatal_closure, A.Parser__setOption_closure, A.StreamGroup_add_closure, A.StreamGroup_add_closure0, A.StreamGroup__listenToStream_closure, A.StreamQueue__ensureListening_closure0, A._isStrictMode_closure, A.ReplAdapter_runAsync_closure, A.ParsedPath__splitExtension_closure0, A.PseudoSelector_specificity_closure, A.AsyncEnvironment_setVariable_closure, A.AsyncEnvironment_setVariable_closure1, A.AsyncImportCache_canonicalize_closure, A.AsyncImportCache_canonicalize_closure0, A.AsyncImportCache__canonicalize_closure, A.AsyncImportCache__canonicalize__closure, A.AsyncImportCache__canonicalize_closure0, A.AsyncImportCache_importCanonical_closure, A.Environment_setVariable_closure, A.Environment_setVariable_closure1, A.ExecutableOptions__parser_closure, A.ExecutableOptions_interactive_closure, A.ExecutableOptions_fatalDeprecations_closure, A.ExtensionStore__registerSelector_closure, A.ExtensionStore_addExtension_closure, A.ExtensionStore_addExtension_closure0, A.ExtensionStore_addExtension_closure1, A.ExtensionStore__extendExistingExtensions_closure, A.ExtensionStore__extendExistingExtensions_closure0, A.ExtensionStore_addExtensions_closure, A.ImportCache_canonicalize_closure, A.ImportCache_canonicalize_closure0, A.ImportCache__canonicalize_closure, A.ImportCache__canonicalize__closure, A.ImportCache__canonicalize_closure0, A.ImportCache_importCanonical_closure, A.resolveImportPath_closure, A.resolveImportPath_closure0, A._tryPathAsDirectory_closure, A._realCasePath_helper_closure, A._readFile_closure, A.writeFile_closure, A.deleteFile_closure, A.fileExists_closure, A.dirExists_closure, A.ensureDir_closure, A.listDir_closure, A.modificationTime_closure, A.watchDir_closure3, A.watchDir__closure, A.AtRootQueryParser_parse_closure, A.KeyframeSelectorParser_parse_closure, A.MediaQueryParser_parse_closure, A.Parser__parseIdentifier_closure, A.Parser_spanFrom_closure, A.SassParser_children_closure, A.SelectorParser_parse_closure, A.SelectorParser_parseCompoundSelector_closure, A.StylesheetParser_parse_closure, A.StylesheetParser_parse__closure, A.StylesheetParser_parseArgumentDeclaration_closure, A.StylesheetParser_parseVariableDeclaration_closure, A.StylesheetParser_parseUseRule_closure, A.StylesheetParser__parseSingleProduction_closure, A.StylesheetParser__statement_closure, A.StylesheetParser_variableDeclarationWithoutNamespace_closure, A.StylesheetParser_variableDeclarationWithoutNamespace_closure0, A.StylesheetParser__forRule_closure, A.StylesheetParser__memberList_closure, A.StylesheetParser__expression_resetState, A.StylesheetParser__expression_resolveOneOperation, A.StylesheetParser__expression_resolveOperations, A.StylesheetParser__expression_resolveSpaceExpressions, A.StylesheetParser_expressionUntilComma_closure, A.StylesheetParser_namespacedExpression_closure, A.StylesheetParser__expressionUntilComparison_closure, A.StylesheetParser__publicIdentifier_closure, A.StylesheetGraph_modifiedSince_transitiveModificationTime_closure, A.StylesheetGraph__add_closure, A.StylesheetGraph_addCanonical_closure, A.StylesheetGraph_reload_closure, A.StylesheetGraph__nodeFor_closure, A.StylesheetGraph__nodeFor_closure0, A.SassNumber__coerceOrConvertValue_compatibilityException, A.SassNumber__coerceOrConvertValue_closure0, A.SassNumber__coerceOrConvertValue_closure2, A.SassNumber_multiplyUnits_closure0, A.SassNumber_multiplyUnits_closure2, A.SingleUnitSassNumber_multiplyUnits_closure0, A._EvaluateVisitor__closure6, A._EvaluateVisitor__closure5, A._EvaluateVisitor_run_closure0, A._EvaluateVisitor_run__closure0, A._EvaluateVisitor__loadModule_closure1, A._EvaluateVisitor__loadModule_closure2, A._EvaluateVisitor__loadModule__closure2, A._EvaluateVisitor__execute_closure0, A._EvaluateVisitor__extendModules_closure2, A._EvaluateVisitor_visitAtRootRule_closure1, A._EvaluateVisitor_visitAtRootRule_closure2, A._EvaluateVisitor__scopeForAtRoot__closure0, A._EvaluateVisitor_visitContentRule_closure0, A._EvaluateVisitor_visitDeclaration_closure0, A._EvaluateVisitor_visitEachRule_closure4, A._EvaluateVisitor_visitAtRule_closure3, A._EvaluateVisitor_visitAtRule__closure0, A._EvaluateVisitor_visitForRule_closure4, A._EvaluateVisitor_visitForRule_closure5, A._EvaluateVisitor_visitForRule_closure6, A._EvaluateVisitor_visitForRule_closure7, A._EvaluateVisitor_visitForRule_closure8, A._EvaluateVisitor__registerCommentsForModule_closure0, A._EvaluateVisitor_visitIfRule__closure0, A._EvaluateVisitor__visitDynamicImport_closure0, A._EvaluateVisitor__visitDynamicImport__closure6, A._EvaluateVisitor__applyMixin_closure1, A._EvaluateVisitor__applyMixin__closure2, A._EvaluateVisitor__applyMixin_closure2, A._EvaluateVisitor__applyMixin__closure1, A._EvaluateVisitor__applyMixin___closure0, A._EvaluateVisitor__applyMixin____closure0, A._EvaluateVisitor_visitIncludeRule_closure2, A._EvaluateVisitor_visitIncludeRule_closure4, A._EvaluateVisitor_visitMediaRule_closure3, A._EvaluateVisitor_visitMediaRule__closure0, A._EvaluateVisitor_visitMediaRule___closure0, A._EvaluateVisitor_visitStyleRule_closure4, A._EvaluateVisitor_visitStyleRule_closure6, A._EvaluateVisitor_visitStyleRule__closure0, A._EvaluateVisitor_visitSupportsRule_closure1, A._EvaluateVisitor_visitSupportsRule__closure0, A._EvaluateVisitor__visitSupportsCondition_closure0, A._EvaluateVisitor_visitVariableDeclaration_closure2, A._EvaluateVisitor_visitVariableDeclaration_closure3, A._EvaluateVisitor_visitVariableDeclaration_closure4, A._EvaluateVisitor_visitWarnRule_closure0, A._EvaluateVisitor_visitWhileRule_closure0, A._EvaluateVisitor_visitBinaryOperationExpression_closure0, A._EvaluateVisitor_visitVariableExpression_closure0, A._EvaluateVisitor_visitUnaryOperationExpression_closure0, A._EvaluateVisitor_visitFunctionExpression_closure2, A._EvaluateVisitor_visitFunctionExpression_closure4, A._EvaluateVisitor__visitCalculationExpression_closure0, A._EvaluateVisitor_visitInterpolatedFunctionExpression_closure0, A._EvaluateVisitor__runUserDefinedCallable_closure0, A._EvaluateVisitor__runUserDefinedCallable__closure0, A._EvaluateVisitor__runUserDefinedCallable___closure0, A._EvaluateVisitor__runFunctionCallable_closure0, A._EvaluateVisitor__runBuiltInCallable_closure2, A._EvaluateVisitor__runBuiltInCallable_closure3, A._EvaluateVisitor__verifyArguments_closure0, A._EvaluateVisitor_visitCssAtRule_closure1, A._EvaluateVisitor_visitCssKeyframeBlock_closure1, A._EvaluateVisitor_visitCssMediaRule_closure3, A._EvaluateVisitor_visitCssMediaRule__closure0, A._EvaluateVisitor_visitCssMediaRule___closure0, A._EvaluateVisitor_visitCssStyleRule_closure1, A._EvaluateVisitor_visitCssStyleRule__closure0, A._EvaluateVisitor_visitCssSupportsRule_closure1, A._EvaluateVisitor_visitCssSupportsRule__closure0, A._EvaluateVisitor__serialize_closure0, A._EvaluateVisitor__expressionNode_closure0, A._EvaluateVisitor__closure2, A._EvaluateVisitor__closure1, A._EvaluateVisitor_run_closure, A._EvaluateVisitor_run__closure, A._EvaluateVisitor_runExpression_closure, A._EvaluateVisitor_runExpression__closure, A._EvaluateVisitor_runExpression___closure, A._EvaluateVisitor_runStatement_closure, A._EvaluateVisitor_runStatement__closure, A._EvaluateVisitor_runStatement___closure, A._EvaluateVisitor__loadModule_closure, A._EvaluateVisitor__loadModule_closure0, A._EvaluateVisitor__loadModule__closure0, A._EvaluateVisitor__execute_closure, A._EvaluateVisitor__extendModules_closure0, A._EvaluateVisitor_visitAtRootRule_closure, A._EvaluateVisitor_visitAtRootRule_closure0, A._EvaluateVisitor__scopeForAtRoot__closure, A._EvaluateVisitor_visitContentRule_closure, A._EvaluateVisitor_visitDeclaration_closure, A._EvaluateVisitor_visitEachRule_closure1, A._EvaluateVisitor_visitAtRule_closure0, A._EvaluateVisitor_visitAtRule__closure, A._EvaluateVisitor_visitForRule_closure, A._EvaluateVisitor_visitForRule_closure0, A._EvaluateVisitor_visitForRule_closure1, A._EvaluateVisitor_visitForRule_closure2, A._EvaluateVisitor_visitForRule_closure3, A._EvaluateVisitor__registerCommentsForModule_closure, A._EvaluateVisitor_visitIfRule__closure, A._EvaluateVisitor__visitDynamicImport_closure, A._EvaluateVisitor__visitDynamicImport__closure2, A._EvaluateVisitor__applyMixin_closure, A._EvaluateVisitor__applyMixin__closure0, A._EvaluateVisitor__applyMixin_closure0, A._EvaluateVisitor__applyMixin__closure, A._EvaluateVisitor__applyMixin___closure, A._EvaluateVisitor__applyMixin____closure, A._EvaluateVisitor_visitIncludeRule_closure, A._EvaluateVisitor_visitIncludeRule_closure1, A._EvaluateVisitor_visitMediaRule_closure0, A._EvaluateVisitor_visitMediaRule__closure, A._EvaluateVisitor_visitMediaRule___closure, A._EvaluateVisitor_visitStyleRule_closure, A._EvaluateVisitor_visitStyleRule_closure1, A._EvaluateVisitor_visitStyleRule__closure, A._EvaluateVisitor_visitSupportsRule_closure, A._EvaluateVisitor_visitSupportsRule__closure, A._EvaluateVisitor__visitSupportsCondition_closure, A._EvaluateVisitor_visitVariableDeclaration_closure, A._EvaluateVisitor_visitVariableDeclaration_closure0, A._EvaluateVisitor_visitVariableDeclaration_closure1, A._EvaluateVisitor_visitWarnRule_closure, A._EvaluateVisitor_visitWhileRule_closure, A._EvaluateVisitor_visitBinaryOperationExpression_closure, A._EvaluateVisitor_visitVariableExpression_closure, A._EvaluateVisitor_visitUnaryOperationExpression_closure, A._EvaluateVisitor_visitFunctionExpression_closure, A._EvaluateVisitor_visitFunctionExpression_closure1, A._EvaluateVisitor__visitCalculationExpression_closure, A._EvaluateVisitor_visitInterpolatedFunctionExpression_closure, A._EvaluateVisitor__runUserDefinedCallable_closure, A._EvaluateVisitor__runUserDefinedCallable__closure, A._EvaluateVisitor__runUserDefinedCallable___closure, A._EvaluateVisitor__runFunctionCallable_closure, A._EvaluateVisitor__runBuiltInCallable_closure, A._EvaluateVisitor__runBuiltInCallable_closure0, A._EvaluateVisitor__verifyArguments_closure, A._EvaluateVisitor_visitCssAtRule_closure, A._EvaluateVisitor_visitCssKeyframeBlock_closure, A._EvaluateVisitor_visitCssMediaRule_closure0, A._EvaluateVisitor_visitCssMediaRule__closure, A._EvaluateVisitor_visitCssMediaRule___closure, A._EvaluateVisitor_visitCssStyleRule_closure, A._EvaluateVisitor_visitCssStyleRule__closure, A._EvaluateVisitor_visitCssSupportsRule_closure, A._EvaluateVisitor_visitCssSupportsRule__closure, A._EvaluateVisitor__serialize_closure, A._EvaluateVisitor__expressionNode_closure, A._SerializeVisitor_visitCssComment_closure, A._SerializeVisitor_visitCssAtRule_closure, A._SerializeVisitor_visitCssMediaRule_closure, A._SerializeVisitor_visitCssImport_closure, A._SerializeVisitor_visitCssImport__closure, A._SerializeVisitor_visitCssKeyframeBlock_closure, A._SerializeVisitor_visitCssStyleRule_closure, A._SerializeVisitor_visitCssSupportsRule_closure, A._SerializeVisitor_visitCssDeclaration_closure, A._SerializeVisitor_visitCssDeclaration_closure0, A._SerializeVisitor__write_closure, A._SerializeVisitor__visitChildren_closure, A._SerializeVisitor__visitChildren_closure0, A.SingleMapping_SingleMapping$fromEntries_closure, A.SingleMapping_SingleMapping$fromEntries_closure0, A.Highlighter_closure, A.Highlighter__writeFileStart_closure, A.Highlighter__writeMultilineHighlights_closure, A.Highlighter__writeMultilineHighlights_closure0, A.Highlighter__writeMultilineHighlights_closure1, A.Highlighter__writeMultilineHighlights_closure2, A.Highlighter__writeMultilineHighlights__closure, A.Highlighter__writeMultilineHighlights__closure0, A.Highlighter__writeHighlightedText_closure, A.Highlighter__writeIndicator_closure, A.Highlighter__writeIndicator_closure0, A.Highlighter__writeIndicator_closure1, A.Highlighter__writeLabel_closure, A.Highlighter__writeLabel_closure0, A.Highlighter__writeSidebar_closure, A._Highlight_closure, A.Frame_Frame$parseVM_closure, A.Frame_Frame$parseV8_closure, A.Frame_Frame$_parseFirefoxEval_closure, A.Frame_Frame$parseFirefox_closure, A.Frame_Frame$parseFriendly_closure, A.LazyTrace_terse_closure, A.Trace_Trace$from_closure, A.TransformByHandlers_transformByHandlers_closure, A.TransformByHandlers_transformByHandlers__closure0, A.TransformByHandlers_transformByHandlers__closure2, A.RateLimit__debounceAggregate_closure_emit, A.RateLimit__debounceAggregate__closure, A.argumentListClass_closure, A.JSToDartAsyncImporter_canonicalize_closure, A.JSToDartAsyncImporter_load_closure, A.AsyncEnvironment_setVariable_closure2, A.AsyncEnvironment_setVariable_closure4, A._EvaluateVisitor__closure14, A._EvaluateVisitor__closure13, A._EvaluateVisitor_run_closure2, A._EvaluateVisitor_run__closure2, A._EvaluateVisitor__loadModule_closure5, A._EvaluateVisitor__loadModule_closure6, A._EvaluateVisitor__loadModule__closure6, A._EvaluateVisitor__execute_closure2, A._EvaluateVisitor__extendModules_closure6, A._EvaluateVisitor_visitAtRootRule_closure5, A._EvaluateVisitor_visitAtRootRule_closure6, A._EvaluateVisitor__scopeForAtRoot__closure2, A._EvaluateVisitor_visitContentRule_closure2, A._EvaluateVisitor_visitDeclaration_closure2, A._EvaluateVisitor_visitEachRule_closure10, A._EvaluateVisitor_visitAtRule_closure9, A._EvaluateVisitor_visitAtRule__closure2, A._EvaluateVisitor_visitForRule_closure14, A._EvaluateVisitor_visitForRule_closure15, A._EvaluateVisitor_visitForRule_closure16, A._EvaluateVisitor_visitForRule_closure17, A._EvaluateVisitor_visitForRule_closure18, A._EvaluateVisitor__registerCommentsForModule_closure2, A._EvaluateVisitor_visitIfRule__closure2, A._EvaluateVisitor__visitDynamicImport_closure2, A._EvaluateVisitor__visitDynamicImport__closure14, A._EvaluateVisitor__applyMixin_closure5, A._EvaluateVisitor__applyMixin__closure6, A._EvaluateVisitor__applyMixin_closure6, A._EvaluateVisitor__applyMixin__closure5, A._EvaluateVisitor__applyMixin___closure2, A._EvaluateVisitor__applyMixin____closure2, A._EvaluateVisitor_visitIncludeRule_closure8, A._EvaluateVisitor_visitIncludeRule_closure10, A._EvaluateVisitor_visitMediaRule_closure9, A._EvaluateVisitor_visitMediaRule__closure2, A._EvaluateVisitor_visitMediaRule___closure2, A._EvaluateVisitor_visitStyleRule_closure14, A._EvaluateVisitor_visitStyleRule_closure16, A._EvaluateVisitor_visitStyleRule__closure2, A._EvaluateVisitor_visitSupportsRule_closure5, A._EvaluateVisitor_visitSupportsRule__closure2, A._EvaluateVisitor__visitSupportsCondition_closure2, A._EvaluateVisitor_visitVariableDeclaration_closure8, A._EvaluateVisitor_visitVariableDeclaration_closure9, A._EvaluateVisitor_visitVariableDeclaration_closure10, A._EvaluateVisitor_visitWarnRule_closure2, A._EvaluateVisitor_visitWhileRule_closure2, A._EvaluateVisitor_visitBinaryOperationExpression_closure2, A._EvaluateVisitor_visitVariableExpression_closure2, A._EvaluateVisitor_visitUnaryOperationExpression_closure2, A._EvaluateVisitor_visitFunctionExpression_closure8, A._EvaluateVisitor_visitFunctionExpression_closure10, A._EvaluateVisitor__visitCalculationExpression_closure2, A._EvaluateVisitor_visitInterpolatedFunctionExpression_closure2, A._EvaluateVisitor__runUserDefinedCallable_closure2, A._EvaluateVisitor__runUserDefinedCallable__closure2, A._EvaluateVisitor__runUserDefinedCallable___closure2, A._EvaluateVisitor__runFunctionCallable_closure2, A._EvaluateVisitor__runBuiltInCallable_closure8, A._EvaluateVisitor__runBuiltInCallable_closure9, A._EvaluateVisitor__verifyArguments_closure2, A._EvaluateVisitor_visitCssAtRule_closure5, A._EvaluateVisitor_visitCssKeyframeBlock_closure5, A._EvaluateVisitor_visitCssMediaRule_closure9, A._EvaluateVisitor_visitCssMediaRule__closure2, A._EvaluateVisitor_visitCssMediaRule___closure2, A._EvaluateVisitor_visitCssStyleRule_closure5, A._EvaluateVisitor_visitCssStyleRule__closure2, A._EvaluateVisitor_visitCssSupportsRule_closure5, A._EvaluateVisitor_visitCssSupportsRule__closure2, A._EvaluateVisitor__serialize_closure2, A._EvaluateVisitor__expressionNode_closure2, A.JSToDartAsyncFileImporter_canonicalize_closure, A.AsyncImportCache_canonicalize_closure1, A.AsyncImportCache_canonicalize_closure2, A.AsyncImportCache__canonicalize_closure1, A.AsyncImportCache__canonicalize__closure0, A.AsyncImportCache__canonicalize_closure2, A.AsyncImportCache_importCanonical_closure0, A.AtRootQueryParser_parse_closure0, A.booleanClass_closure, A.legacyBooleanClass_closure, A.calculationClass_closure, A.calculationOperationClass_closure, A.calculationInterpolationClass_closure, A.colorClass_closure, A.compileAsync_closure, A.compileStringAsync_closure, A._parseFunctions___closure6, A._parseFunctions___closure5, A.nodePackageImporterClass_closure, A.compilerClass_closure, A.asyncCompilerClass_closure, A.asyncCompilerClass___closure, A.initAsyncCompiler_closure, A.Environment_setVariable_closure2, A.Environment_setVariable_closure4, A._EvaluateVisitor__closure10, A._EvaluateVisitor__closure9, A._EvaluateVisitor_run_closure1, A._EvaluateVisitor_run__closure1, A._EvaluateVisitor__loadModule_closure3, A._EvaluateVisitor__loadModule_closure4, A._EvaluateVisitor__loadModule__closure4, A._EvaluateVisitor__execute_closure1, A._EvaluateVisitor__extendModules_closure4, A._EvaluateVisitor_visitAtRootRule_closure3, A._EvaluateVisitor_visitAtRootRule_closure4, A._EvaluateVisitor__scopeForAtRoot__closure1, A._EvaluateVisitor_visitContentRule_closure1, A._EvaluateVisitor_visitDeclaration_closure1, A._EvaluateVisitor_visitEachRule_closure7, A._EvaluateVisitor_visitAtRule_closure6, A._EvaluateVisitor_visitAtRule__closure1, A._EvaluateVisitor_visitForRule_closure9, A._EvaluateVisitor_visitForRule_closure10, A._EvaluateVisitor_visitForRule_closure11, A._EvaluateVisitor_visitForRule_closure12, A._EvaluateVisitor_visitForRule_closure13, A._EvaluateVisitor__registerCommentsForModule_closure1, A._EvaluateVisitor_visitIfRule__closure1, A._EvaluateVisitor__visitDynamicImport_closure1, A._EvaluateVisitor__visitDynamicImport__closure10, A._EvaluateVisitor__applyMixin_closure3, A._EvaluateVisitor__applyMixin__closure4, A._EvaluateVisitor__applyMixin_closure4, A._EvaluateVisitor__applyMixin__closure3, A._EvaluateVisitor__applyMixin___closure1, A._EvaluateVisitor__applyMixin____closure1, A._EvaluateVisitor_visitIncludeRule_closure5, A._EvaluateVisitor_visitIncludeRule_closure7, A._EvaluateVisitor_visitMediaRule_closure6, A._EvaluateVisitor_visitMediaRule__closure1, A._EvaluateVisitor_visitMediaRule___closure1, A._EvaluateVisitor_visitStyleRule_closure9, A._EvaluateVisitor_visitStyleRule_closure11, A._EvaluateVisitor_visitStyleRule__closure1, A._EvaluateVisitor_visitSupportsRule_closure3, A._EvaluateVisitor_visitSupportsRule__closure1, A._EvaluateVisitor__visitSupportsCondition_closure1, A._EvaluateVisitor_visitVariableDeclaration_closure5, A._EvaluateVisitor_visitVariableDeclaration_closure6, A._EvaluateVisitor_visitVariableDeclaration_closure7, A._EvaluateVisitor_visitWarnRule_closure1, A._EvaluateVisitor_visitWhileRule_closure1, A._EvaluateVisitor_visitBinaryOperationExpression_closure1, A._EvaluateVisitor_visitVariableExpression_closure1, A._EvaluateVisitor_visitUnaryOperationExpression_closure1, A._EvaluateVisitor_visitFunctionExpression_closure5, A._EvaluateVisitor_visitFunctionExpression_closure7, A._EvaluateVisitor__visitCalculationExpression_closure1, A._EvaluateVisitor_visitInterpolatedFunctionExpression_closure1, A._EvaluateVisitor__runUserDefinedCallable_closure1, A._EvaluateVisitor__runUserDefinedCallable__closure1, A._EvaluateVisitor__runUserDefinedCallable___closure1, A._EvaluateVisitor__runFunctionCallable_closure1, A._EvaluateVisitor__runBuiltInCallable_closure5, A._EvaluateVisitor__runBuiltInCallable_closure6, A._EvaluateVisitor__verifyArguments_closure1, A._EvaluateVisitor_visitCssAtRule_closure3, A._EvaluateVisitor_visitCssKeyframeBlock_closure3, A._EvaluateVisitor_visitCssMediaRule_closure6, A._EvaluateVisitor_visitCssMediaRule__closure1, A._EvaluateVisitor_visitCssMediaRule___closure1, A._EvaluateVisitor_visitCssStyleRule_closure3, A._EvaluateVisitor_visitCssStyleRule__closure1, A._EvaluateVisitor_visitCssSupportsRule_closure3, A._EvaluateVisitor_visitCssSupportsRule__closure1, A._EvaluateVisitor__serialize_closure1, A._EvaluateVisitor__expressionNode_closure1, A.exceptionClass_closure, A.ExtensionStore__registerSelector_closure0, A.ExtensionStore_addExtension_closure2, A.ExtensionStore_addExtension_closure3, A.ExtensionStore_addExtension_closure4, A.ExtensionStore__extendExistingExtensions_closure1, A.ExtensionStore__extendExistingExtensions_closure2, A.ExtensionStore_addExtensions_closure0, A.JSToDartFileImporter_canonicalize_closure, A.functionClass_closure, A.NodeImporter_load_closure, A.NodeImporter__tryPath_closure, A.NodeImporter__callImporterAsync_closure, A.ImportCache_canonicalize_closure1, A.ImportCache_canonicalize_closure2, A.ImportCache__canonicalize_closure1, A.ImportCache__canonicalize__closure0, A.ImportCache__canonicalize_closure2, A.ImportCache_importCanonical_closure0, A._realCasePath_helper_closure0, A._readFile_closure0, A.fileExists_closure0, A.dirExists_closure0, A.listDir_closure0, A.JSToDartLogger_warn_closure, A.JSToDartLogger_debug_closure, A.KeyframeSelectorParser_parse_closure0, A.render_closure, A._parseFunctions____closure, A._parseFunctions___closure3, A._parseFunctions___closure4, A._parseFunctions___closure1, A._parseFunctions___closure0, A._parseImporter____closure, A._parseImporter___closure0, A.listClass_closure, A.mapClass_closure, A.MediaQueryParser_parse_closure0, A.mixinClass_closure, A.legacyNullClass_closure, A.numberClass_closure, A.SassNumber__coerceOrConvertValue_compatibilityException0, A.SassNumber__coerceOrConvertValue_closure4, A.SassNumber__coerceOrConvertValue_closure6, A.SassNumber_multiplyUnits_closure4, A.SassNumber_multiplyUnits_closure6, A.Parser__parseIdentifier_closure0, A.Parser_spanFrom_closure0, A.PseudoSelector_specificity_closure0, A.SassParser_children_closure0, A.SelectorParser_parse_closure0, A.SelectorParser_parseCompoundSelector_closure0, A._SerializeVisitor_visitCssComment_closure0, A._SerializeVisitor_visitCssAtRule_closure0, A._SerializeVisitor_visitCssMediaRule_closure0, A._SerializeVisitor_visitCssImport_closure0, A._SerializeVisitor_visitCssImport__closure0, A._SerializeVisitor_visitCssKeyframeBlock_closure0, A._SerializeVisitor_visitCssStyleRule_closure0, A._SerializeVisitor_visitCssSupportsRule_closure0, A._SerializeVisitor_visitCssDeclaration_closure1, A._SerializeVisitor_visitCssDeclaration_closure2, A._SerializeVisitor__write_closure0, A._SerializeVisitor__visitChildren_closure1, A._SerializeVisitor__visitChildren_closure2, A.SingleUnitSassNumber_multiplyUnits_closure2, A.updateSourceSpanPrototype_closure, A.stringClass_closure, A.StylesheetParser_parse_closure0, A.StylesheetParser_parse__closure1, A.StylesheetParser_parseArgumentDeclaration_closure0, A.StylesheetParser__parseSingleProduction_closure0, A.StylesheetParser_parseSignature_closure, A.StylesheetParser__statement_closure0, A.StylesheetParser_variableDeclarationWithoutNamespace_closure1, A.StylesheetParser_variableDeclarationWithoutNamespace_closure2, A.StylesheetParser__forRule_closure1, A.StylesheetParser__memberList_closure0, A.StylesheetParser__expression_resetState0, A.StylesheetParser__expression_resolveOneOperation0, A.StylesheetParser__expression_resolveOperations0, A.StylesheetParser__expression_resolveSpaceExpressions0, A.StylesheetParser_expressionUntilComma_closure0, A.StylesheetParser_namespacedExpression_closure0, A.StylesheetParser__expressionUntilComparison_closure0, A.StylesheetParser__publicIdentifier_closure0, A.JSToDartImporter_canonicalize_closure, A.JSToDartImporter_load_closure, A.resolveImportPath_closure1, A.resolveImportPath_closure2, A._tryPathAsDirectory_closure0, A.valueClass_closure]); + _inheritMany(A.EfficientLengthIterable, [A.ListIterable, A.EmptyIterable, A.LinkedHashMapKeyIterable, A._HashMapKeyIterable, A._MapBaseValueIterable]); + _inheritMany(A.ListIterable, [A.SubListIterable, A.MappedListIterable, A.ReversedListIterable, A.ListQueue, A._JsonMapKeyIterable, A._GeneratorIterable]); + _inherit(A.EfficientLengthMappedIterable, A.MappedIterable); + _inherit(A.EfficientLengthTakeIterable, A.TakeIterable); + _inherit(A.EfficientLengthSkipIterable, A.SkipIterable); + _inherit(A.EfficientLengthFollowedByIterable, A.FollowedByIterable); + _inheritMany(A._Record, [A._Record2, A._Record3, A._RecordN]); + _inheritMany(A._Record2, [A._Record_2, A._Record_2_forImport, A._Record_2_imports_modules, A._Record_2_loadedUrls_stylesheet, A._Record_2_sourceMap]); + _inheritMany(A._Record3, [A._Record_3, A._Record_3_importer_isDependency, A._Record_3_originalUrl]); + _inheritMany(A._RecordN, [A._Record_4_baseImporter_baseUrl_forImport, A._Record_5_named_namedNodes_positional_positionalNodes_separator]); + _inheritMany(A.MapView, [A._UnmodifiableMapView_MapView__UnmodifiableMapMixin, A.PathMap]); + _inherit(A.UnmodifiableMapView, A._UnmodifiableMapView_MapView__UnmodifiableMapMixin); + _inherit(A.ConstantMapView, A.UnmodifiableMapView); + _inherit(A.ConstantStringMap, A.ConstantMap); + _inheritMany(A.SetBase, [A.ConstantSet, A._SetBase, A._UnmodifiableSetView_SetBase__UnmodifiableSetMixin, A._UnionSet_SetBase_UnmodifiableSetMixin]); + _inheritMany(A.ConstantSet, [A.ConstantStringSet, A.GeneralConstantSet]); + _inherit(A.Instantiation1, A.Instantiation); + _inherit(A.NullError, A.TypeError); + _inheritMany(A.TearOffClosure, [A.StaticClosure, A.BoundClosure]); + _inheritMany(A.JsLinkedHashMap, [A.JsIdentityLinkedHashMap, A.JsConstantLinkedHashMap, A._LinkedCustomHashMap]); + _inheritMany(A.NativeTypedData, [A.NativeByteData, A.NativeTypedArray]); + _inheritMany(A.NativeTypedArray, [A._NativeTypedArrayOfDouble_NativeTypedArray_ListMixin, A._NativeTypedArrayOfInt_NativeTypedArray_ListMixin]); + _inherit(A._NativeTypedArrayOfDouble_NativeTypedArray_ListMixin_FixedLengthListMixin, A._NativeTypedArrayOfDouble_NativeTypedArray_ListMixin); + _inherit(A.NativeTypedArrayOfDouble, A._NativeTypedArrayOfDouble_NativeTypedArray_ListMixin_FixedLengthListMixin); + _inherit(A._NativeTypedArrayOfInt_NativeTypedArray_ListMixin_FixedLengthListMixin, A._NativeTypedArrayOfInt_NativeTypedArray_ListMixin); + _inherit(A.NativeTypedArrayOfInt, A._NativeTypedArrayOfInt_NativeTypedArray_ListMixin_FixedLengthListMixin); + _inheritMany(A.NativeTypedArrayOfDouble, [A.NativeFloat32List, A.NativeFloat64List]); + _inheritMany(A.NativeTypedArrayOfInt, [A.NativeInt16List, A.NativeInt32List, A.NativeInt8List, A.NativeUint16List, A.NativeUint32List, A.NativeUint8ClampedList, A.NativeUint8List]); + _inherit(A._TypeError, A._Error); + _inheritMany(A._Completer, [A._AsyncCompleter, A._SyncCompleter]); + _inheritMany(A._StreamController, [A._AsyncStreamController, A._SyncStreamController]); + _inheritMany(A.Stream, [A._StreamImpl, A._ForwardingStream, A._CompleterStream]); + _inherit(A._ControllerStream, A._StreamImpl); + _inheritMany(A._BufferingStreamSubscription, [A._ControllerSubscription, A._ForwardingStreamSubscription]); + _inherit(A._StreamControllerAddStreamState, A._AddStreamState); + _inheritMany(A._DelayedEvent, [A._DelayedData, A._DelayedError]); + _inherit(A._ExpandStream, A._ForwardingStream); + _inheritMany(A._Zone, [A._CustomZone, A._RootZone]); + _inherit(A._IdentityHashMap, A._HashMap); + _inherit(A._LinkedHashSet, A._SetBase); + _inherit(A._LinkedIdentityHashSet, A._LinkedHashSet); + _inherit(A.UnmodifiableSetView, A._UnmodifiableSetView_SetBase__UnmodifiableSetMixin); + _inheritMany(A.Codec, [A.Encoding, A.Base64Codec, A.JsonCodec]); + _inheritMany(A.Encoding, [A.AsciiCodec, A.Utf8Codec]); + _inheritMany(A.Converter, [A._UnicodeSubsetEncoder, A.Base64Encoder, A.JsonEncoder, A.JsonDecoder, A.Utf8Encoder, A.Utf8Decoder]); + _inherit(A.AsciiEncoder, A._UnicodeSubsetEncoder); + _inheritMany(A.ByteConversionSink, [A._Base64EncoderSink, A._Utf8StringSinkAdapter]); + _inherit(A._Utf8Base64EncoderSink, A._Base64EncoderSink); + _inherit(A.JsonCyclicError, A.JsonUnsupportedObjectError); + _inherit(A._JsonStringStringifier, A._JsonStringifier); + _inherit(A._StringSinkConversionSink, A.StringConversionSink); + _inherit(A._StringCallbackSink, A._StringSinkConversionSink); + _inheritMany(A.ArgumentError, [A.RangeError, A.IndexError]); + _inherit(A._DataUri, A._Uri); + _inherit(A.ArgParserException, A.FormatException); + _inherit(A.EmptyUnmodifiableSet, A._EmptyUnmodifiableSet_IterableBase_UnmodifiableSetMixin); + _inherit(A.QueueList, A._QueueList_Object_ListMixin); + _inherit(A._CastQueueList, A.QueueList); + _inherit(A.UnionSet, A._UnionSet_SetBase_UnmodifiableSetMixin); + _inheritMany(A._DelegatingIterableBase, [A.DelegatingSet, A._MapKeySet__DelegatingIterableBase_UnmodifiableSetMixin]); + _inherit(A._UnmodifiableSetView_DelegatingSet_UnmodifiableSetMixin, A.DelegatingSet); + _inherit(A.UnmodifiableSetView0, A._UnmodifiableSetView_DelegatingSet_UnmodifiableSetMixin); + _inherit(A.MapKeySet, A._MapKeySet__DelegatingIterableBase_UnmodifiableSetMixin); + _inheritMany(A.NodeJsError, [A.JsAssertionError, A.JsRangeError, A.JsReferenceError, A.JsSyntaxError, A.JsTypeError, A.JsSystemError]); + _inheritMany(A.Socket, [A.TTYReadStream, A.TTYWriteStream]); + _inherit(A.InternalStyle, A.Style); + _inheritMany(A.InternalStyle, [A.PosixStyle, A.UrlStyle, A.WindowsStyle]); + _inheritMany(A._Enum, [A._SingletonCssMediaQueryMergeResult, A.BinaryOperator, A.UnaryOperator, A.AttributeOperator, A.Combinator, A.Deprecation, A.ExtendMode, A.Syntax, A.CalculationOperator, A.ListSeparator, A.OutputStyle, A.LineFeed, A.AttributeOperator0, A.BinaryOperator0, A.CalculationOperator0, A.Combinator0, A.Deprecation0, A.ListSeparator0, A._SingletonCssMediaQueryMergeResult0, A.ExtendMode0, A.OutputStyle0, A.LineFeed0, A.Syntax0, A.UnaryOperator0]); + _inheritMany(A.CssNode, [A.ModifiableCssNode, A.CssParentNode]); + _inheritMany(A.ModifiableCssNode, [A.ModifiableCssParentNode, A.ModifiableCssComment, A.ModifiableCssDeclaration, A.ModifiableCssImport]); + _inheritMany(A.ModifiableCssParentNode, [A.ModifiableCssAtRule, A.ModifiableCssKeyframeBlock, A.ModifiableCssMediaRule, A.ModifiableCssStyleRule, A.ModifiableCssStylesheet, A.ModifiableCssSupportsRule]); + _inherit(A._IsInvisibleVisitor, A.__IsInvisibleVisitor_Object_EveryCssVisitor); + _inherit(A.CssStylesheet, A.CssParentNode); + _inheritMany(A.ParentStatement, [A.AtRootRule, A.AtRule, A.CallableDeclaration, A.Declaration, A.EachRule, A.ForRule, A.MediaRule, A.StyleRule, A.Stylesheet, A.SupportsRule, A.WhileRule]); + _inheritMany(A.CallableDeclaration, [A.ContentBlock, A.FunctionRule, A.MixinRule]); + _inheritMany(A.IfRuleClause, [A.IfClause, A.ElseClause]); + _inherit(A._HasContentVisitor, A.__HasContentVisitor_Object_StatementSearchVisitor); + _inherit(A._IsInvisibleVisitor0, A.__IsInvisibleVisitor_Object_AnySelectorVisitor); + _inherit(A._IsBogusVisitor, A.__IsBogusVisitor_Object_AnySelectorVisitor); + _inherit(A._IsUselessVisitor, A.__IsUselessVisitor_Object_AnySelectorVisitor); + _inheritMany(A.Selector, [A.SimpleSelector, A.ComplexSelector, A.CompoundSelector, A.SelectorList]); + _inheritMany(A.SimpleSelector, [A.AttributeSelector, A.ClassSelector, A.IDSelector, A.ParentSelector, A.PlaceholderSelector, A.PseudoSelector, A.TypeSelector, A.UniversalSelector]); + _inherit(A._ParentSelectorVisitor, A.__ParentSelectorVisitor_Object_SelectorSearchVisitor); + _inherit(A.ExplicitConfiguration, A.Configuration); + _inheritMany(A.SourceSpanException, [A.SassException, A.SourceSpanFormatException, A.MultiSourceSpanException, A.SassException0]); + _inheritMany(A.SassException, [A.MultiSpanSassException, A.SassRuntimeException, A.SassFormatException]); + _inheritMany(A.MultiSpanSassException, [A.MultiSpanSassRuntimeException, A.MultiSpanSassFormatException]); + _inherit(A.MultiSpanSassScriptException, A.SassScriptException); + _inherit(A.MergedExtension, A.Extension); + _inherit(A.Importer, A.AsyncImporter); + _inheritMany(A.Importer, [A.FilesystemImporter, A.NoOpImporter, A.NodePackageImporter]); + _inheritMany(A.Parser, [A.AtRootQueryParser, A.StylesheetParser, A.KeyframeSelectorParser, A.MediaQueryParser, A.SelectorParser]); + _inheritMany(A.StylesheetParser, [A.ScssParser, A.SassParser]); + _inherit(A.CssParser, A.ScssParser); + _inheritMany(A.UnmodifiableMapBase, [A.LimitedMapView, A.PrefixedMapView, A.PublicMemberMapView, A.UnprefixedMapView, A.LimitedMapView0, A.PrefixedMapView0, A.PublicMemberMapView0, A.UnprefixedMapView0]); + _inheritMany(A.Value, [A.SassList, A.SassBoolean, A.SassCalculation, A.SassColor, A.SassFunction, A.SassMap, A.SassMixin, A._SassNull, A.SassNumber, A.SassString]); + _inherit(A.SassArgumentList, A.SassList); + _inheritMany(A.SassNumber, [A.ComplexSassNumber, A.SingleUnitSassNumber, A.UnitlessSassNumber]); + _inherit(A._MakeExpressionCalculationSafe, A.__MakeExpressionCalculationSafe_Object_ReplaceExpressionVisitor); + _inherit(A._FindDependenciesVisitor, A.__FindDependenciesVisitor_Object_RecursiveStatementVisitor); + _inherit(A.SingleMapping, A.Mapping); + _inherit(A.FileLocation, A.SourceLocationMixin); + _inheritMany(A.SourceSpanMixin, [A._FileSpan, A.SourceSpanBase]); + _inherit(A.MultiSourceSpanFormatException, A.MultiSourceSpanException); + _inherit(A.SourceSpanWithContext, A.SourceSpanBase); + _inherit(A.StringScannerException, A.SourceSpanFormatException); + _inheritMany(A.StringScanner, [A.LineScanner, A.SpanScanner]); + _inheritMany(A.Value0, [A.SassList0, A.SassBoolean0, A.SassCalculation0, A.SassColor0, A.SassNumber0, A.SassFunction0, A.SassMap0, A.SassMixin0, A._SassNull0, A.SassString0]); + _inherit(A.SassArgumentList0, A.SassList0); + _inheritMany(A.AsyncImporter0, [A.JSToDartAsyncImporter, A.JSToDartAsyncFileImporter, A.Importer0]); + _inheritMany(A.Parser1, [A.AtRootQueryParser0, A.StylesheetParser0, A.KeyframeSelectorParser0, A.MediaQueryParser0, A.SelectorParser0]); + _inheritMany(A.ParentStatement0, [A.AtRootRule0, A.AtRule0, A.CallableDeclaration0, A.Declaration0, A.EachRule0, A.ForRule0, A.MediaRule0, A.StyleRule0, A.Stylesheet0, A.SupportsRule0, A.WhileRule0]); + _inheritMany(A.CssNode0, [A.ModifiableCssNode0, A.CssParentNode0]); + _inheritMany(A.ModifiableCssNode0, [A.ModifiableCssParentNode0, A.ModifiableCssComment0, A.ModifiableCssDeclaration0, A.ModifiableCssImport0]); + _inheritMany(A.ModifiableCssParentNode0, [A.ModifiableCssAtRule0, A.ModifiableCssKeyframeBlock0, A.ModifiableCssMediaRule0, A.ModifiableCssStyleRule0, A.ModifiableCssStylesheet0, A.ModifiableCssSupportsRule0]); + _inheritMany(A.Selector0, [A.SimpleSelector0, A.ComplexSelector0, A.CompoundSelector0, A.SelectorList0]); + _inheritMany(A.SimpleSelector0, [A.AttributeSelector0, A.ClassSelector0, A.IDSelector0, A.ParentSelector0, A.PlaceholderSelector0, A.PseudoSelector0, A.TypeSelector0, A.UniversalSelector0]); + _inherit(A.CompileStringOptions, A.CompileOptions); + _inherit(A.AsyncCompiler, A.Compiler); + _inheritMany(A.SassNumber0, [A.ComplexSassNumber0, A.SingleUnitSassNumber0, A.UnitlessSassNumber0]); + _inherit(A.ExplicitConfiguration0, A.Configuration0); + _inheritMany(A.CallableDeclaration0, [A.ContentBlock0, A.FunctionRule0, A.MixinRule0]); + _inheritMany(A.StylesheetParser0, [A.ScssParser0, A.SassParser0]); + _inherit(A.CssParser0, A.ScssParser0); + _inherit(A._NodeException, A.JsError); + _inheritMany(A.SassException0, [A.MultiSpanSassException0, A.SassRuntimeException0, A.SassFormatException0]); + _inheritMany(A.MultiSpanSassException0, [A.MultiSpanSassRuntimeException0, A.MultiSpanSassFormatException0]); + _inherit(A.MultiSpanSassScriptException0, A.SassScriptException0); + _inherit(A._MakeExpressionCalculationSafe0, A.__MakeExpressionCalculationSafe_Object_ReplaceExpressionVisitor0); + _inheritMany(A.Importer0, [A.JSToDartFileImporter, A.FilesystemImporter0, A.NoOpImporter0, A.NodePackageImporter0, A.JSToDartImporter]); + _inheritMany(A.IfRuleClause0, [A.IfClause0, A.ElseClause0]); + _inherit(A._ParentSelectorVisitor0, A.__ParentSelectorVisitor_Object_SelectorSearchVisitor0); + _inherit(A.MergedExtension0, A.Extension0); + _inherit(A._HasContentVisitor0, A.__HasContentVisitor_Object_StatementSearchVisitor0); + _inherit(A._IsInvisibleVisitor1, A.__IsInvisibleVisitor_Object_EveryCssVisitor0); + _inherit(A._IsInvisibleVisitor2, A.__IsInvisibleVisitor_Object_AnySelectorVisitor0); + _inherit(A._IsBogusVisitor0, A.__IsBogusVisitor_Object_AnySelectorVisitor0); + _inherit(A._IsUselessVisitor0, A.__IsUselessVisitor_Object_AnySelectorVisitor0); + _inherit(A.CssStylesheet0, A.CssParentNode0); + _mixin(A.UnmodifiableListBase, A.UnmodifiableListMixin); + _mixin(A.__CastListBase__CastIterableBase_ListMixin, A.ListBase); + _mixin(A._NativeTypedArrayOfDouble_NativeTypedArray_ListMixin, A.ListBase); + _mixin(A._NativeTypedArrayOfDouble_NativeTypedArray_ListMixin_FixedLengthListMixin, A.FixedLengthListMixin); + _mixin(A._NativeTypedArrayOfInt_NativeTypedArray_ListMixin, A.ListBase); + _mixin(A._NativeTypedArrayOfInt_NativeTypedArray_ListMixin_FixedLengthListMixin, A.FixedLengthListMixin); + _mixin(A._AsyncStreamController, A._AsyncStreamControllerDispatch); + _mixin(A._SyncStreamController, A._SyncStreamControllerDispatch); + _mixin(A.UnmodifiableMapBase, A._UnmodifiableMapMixin); + _mixin(A._UnmodifiableMapView_MapView__UnmodifiableMapMixin, A._UnmodifiableMapMixin); + _mixin(A._UnmodifiableSetView_SetBase__UnmodifiableSetMixin, A._UnmodifiableSetMixin); + _mixin(A._EmptyUnmodifiableSet_IterableBase_UnmodifiableSetMixin, A.UnmodifiableSetMixin); + _mixin(A._QueueList_Object_ListMixin, A.ListBase); + _mixin(A._UnionSet_SetBase_UnmodifiableSetMixin, A.UnmodifiableSetMixin); + _mixin(A._UnmodifiableSetView_DelegatingSet_UnmodifiableSetMixin, A.UnmodifiableSetMixin); + _mixin(A._MapKeySet__DelegatingIterableBase_UnmodifiableSetMixin, A.UnmodifiableSetMixin); + _mixin(A.__IsInvisibleVisitor_Object_EveryCssVisitor, A.EveryCssVisitor); + _mixin(A.__HasContentVisitor_Object_StatementSearchVisitor, A.StatementSearchVisitor); + _mixin(A.__IsBogusVisitor_Object_AnySelectorVisitor, A.AnySelectorVisitor); + _mixin(A.__IsInvisibleVisitor_Object_AnySelectorVisitor, A.AnySelectorVisitor); + _mixin(A.__IsUselessVisitor_Object_AnySelectorVisitor, A.AnySelectorVisitor); + _mixin(A.__ParentSelectorVisitor_Object_SelectorSearchVisitor, A.SelectorSearchVisitor); + _mixin(A.__MakeExpressionCalculationSafe_Object_ReplaceExpressionVisitor, A.ReplaceExpressionVisitor); + _mixin(A.__FindDependenciesVisitor_Object_RecursiveStatementVisitor, A.RecursiveStatementVisitor); + _mixin(A.__MakeExpressionCalculationSafe_Object_ReplaceExpressionVisitor0, A.ReplaceExpressionVisitor0); + _mixin(A.__ParentSelectorVisitor_Object_SelectorSearchVisitor0, A.SelectorSearchVisitor0); + _mixin(A.__HasContentVisitor_Object_StatementSearchVisitor0, A.StatementSearchVisitor0); + _mixin(A.__IsInvisibleVisitor_Object_EveryCssVisitor0, A.EveryCssVisitor0); + _mixin(A.__IsBogusVisitor_Object_AnySelectorVisitor0, A.AnySelectorVisitor0); + _mixin(A.__IsInvisibleVisitor_Object_AnySelectorVisitor0, A.AnySelectorVisitor0); + _mixin(A.__IsUselessVisitor_Object_AnySelectorVisitor0, A.AnySelectorVisitor0); + })(); + var init = { + typeUniverse: {eC: new Map(), tR: {}, eT: {}, tPV: {}, sEA: []}, + mangledGlobalNames: {int: "int", double: "double", num: "num", String: "String", bool: "bool", Null: "Null", List: "List", Object: "Object", Map: "Map"}, + mangledNames: {}, + types: ["~()", "Null()", "Future()", "Value0(List)", "bool(String)", "String(String)", "Value(List)", "bool(CssNode)", "bool(CssNode0)", "bool(Object?)", "int()", "SassNumber0(List)", "SassNumber(List)", "JSClass0()", "bool(SimpleSelector0)", "bool(SimpleSelector)", "bool(ComplexSelector0)", "SassString0(List)", "bool(ComplexSelector)", "SassString(List)", "SassBoolean0(List)", "SassBoolean(List)", "SassList0(List)", "SassList(List)", "Future<~>()", "FileSpan()", "bool()", "String()", "bool(int?)", "SassColor0(List)", "SassColor(List)", "SassMap0(List)", "Null(~())", "~(Object?)", "SassMap(List)", "Object?()", "Value()", "double(double)", "Future(Future<~>())", "Value(Value)", "Value?()", "Value0(Value0)", "Value0?()", "bool(num,num)", "Uri(Uri)", "String?()", "bool(int)", "Value0()", "bool(ComplexSelectorComponent)", "bool(Value0)", "SassNumber(SassNumber)", "bool(ComplexSelectorComponent0)", "SassNumber0(SassNumber0)", "Null(Object,StackTrace)", "Null(@)", "Uri?()", "double(SassColor0)", "@()", "~(Value)", "ValueExpression(Value)", "ValueExpression0(Value0)", "Uri?/()", "ComplexSelector(ComplexSelector)", "ComplexSelector0(ComplexSelector0)", "double(double,double)", "~(Value0)", "bool(SelectorList)", "Object(Object)", "Future()", "bool(Value)", "Future()", "bool(Object)", "bool(SelectorList0)", "~(Object,StackTrace)", "Future()", "Future()", "~(@)", "Frame()", "Future(Statement0)", "SassRuntimeException0(AstNode0)", "~(Value0,Value0)", "Declaration(List,FileSpan)", "Object()", "AsyncCallable0?()", "AsyncCallable?()", "~(Value,Value)", "~(String,Value0)", "~(Object)", "SassRuntimeException(AstNode)", "Null([Object?])", "~(String)", "Stylesheet?()", "Future(Statement)", "List?(List)", "List?(List)", "Null(_NodeSassColor,num)", "double(Value0)", "double(Value)", "Future(List)", "~([int?])", "Callable?()", "~(String,Value)", "~(Module1,bool)", "Value0?(Statement0)", "Callable0?()", "~(Module0,bool)", "@(@)", "int(Uri)", "Declaration0(List,FileSpan)", "Value?(Statement)", "Frame(String)", "+originalUrl(Importer,Uri,Uri)?()", "~(String,Function)", "Null(Module1,bool)", "int(_NodeSassColor)", "List()", "String(@)", "int(SassColor0)", "bool(ModifiableCssNode)", "bool(Expression)", "String(Expression)", "bool(Module0)", "Null(Module0,bool)", "Map()", "bool(Module1)", "Statement0()", "String(String{color:Object?})", "bool(Module0)", "~(String,Object?)", "~(String,@)", "bool(ModifiableCssNode0)", "String(Expression0)", "Statement()", "bool(Expression0)", "bool(@)", "~(~())", "bool(_Highlight)", "String(Object)", "bool(Module1)", "Map()", "SassCalculation0(Object)", "SelectorList(Value)", "SelectorList(SelectorList,SelectorList)", "Object(CalculationOperation0)", "double(SassNumber0,Object,Object[String?])", "0&(@[@])", "SassNumber0(SassNumber0,SassNumber0[String?,String?])", "bool(Statement)", "bool(Import)", "0&(Object[Object?])", "Future<+originalUrl(AsyncImporter0,Uri,Uri)?>()", "String(SassNumber0)", "Uri(String)", "int(String,String)", "String?(String?)", "String?(Object)", "bool(Object?,Object?)", "double(SassNumber0,SassNumber0[String?,String?])", "SassNumber0(SassNumber0,Object,Object[String?])", "bool(SassNumber0,String)", "ImmutableList0(SassNumber0)", "Iterable()", "Iterable(String)", "Iterable(@)", "DateTime()", "AsyncImporter0(Object?)", "int(ComplexSelector0)", "Set<0^>()", "int(int)", "AstNode0?()", "InterpolationMap0(List)", "bool(SassNumber0)", "0&(String,FileSpan[StackTrace?])", "Null(_NodeSassMap,int,Object)", "~(@,@)", "Object(_NodeSassMap,int)", "~(Object?,Object?)", "Expression0(Expression0)", "SelectorList0(Value0)", "int(ComplexSelector)", "bool(String?)", "Value0(int)", "@(Value0,num)", "SelectorList0(SelectorList0,SelectorList0)", "VariableDeclaration()", "AsyncCallable?(Module0)", "MapKeySet>(Map,AstNode>)", "bool(ForwardRule0)", "AtRootRule(List,FileSpan)", "bool(UseRule0)", "List()", "~(String[~])", "Future()", "String(Value0)", "+originalUrl(Importer0,Uri,Uri)?()", "AtRule(List,FileSpan)", "Map(Module0)", "int(int,double?)", "bool(ModifiableCssParentNode0)", "List()", "Future<+originalUrl(AsyncImporter,Uri,Uri)?>()", "int(@,@)", "double(double,double?,num)", "String(String{color:@})", "Entry(Entry)", "int(double)", "Future<~>(List)", "bool(Import0)", "bool(Statement0)", "SassMixin0(List)", "AtRule0(List,FileSpan)", "AstNode(AstNode)", "SassFunction(List)", "AtRootRule0(List,FileSpan)", "SassMixin(List)", "Future<~>(List)", "Trace(String)", "Expression(Expression)", "Future(List)", "@(String)", "bool(Queue>)", "double(double,String)", "List()", "FileLocation(FileSpan)", "bool(ModifiableCssParentNode)", "List()", "Callable0?(Module0)", "double?(String,num{assertPercent:bool,checkPercent:bool,checkUnitless:bool})", "MapKeySet>(Map,AstNode>)", "Map(Module1)", "String(int)", "Future()", "int(Object?)", "List()", "MapKeySet>(Map,AstNode0>)", "bool(UseRule)", "bool(ForwardRule)", "AsyncCallable0?(Module1)", "String(_NodeException)", "Future()", "Map(Module0)", "~(Object[StackTrace?])", "SassNumber0()", "~(Uint8List,String,int)", "Value0?(Value0)", "Future()", "int(SourceLocation)", "~(Iterable)", "~(List)", "InterpolationMap(List)", "AstNode?()", "String(SassNumber)", "~([Object?])", "Future<~>?()", "~(List)", "List()", "String(FileSpan)", "Map(Module1)", "MapKeySet>(Map,AstNode0>)", "bool(Frame)", "Callable?(Module1)", "Trace()", "SassNumber()", "~(Iterable)", "String(Frame)", "int(Frame)", "Set<0&>(Object)", "bool(Queue>)", "Future()", "SassFunction0(List)", "AstNode0(AstNode0)", "bool(PseudoSelector)", "~(SelectorList)", "~(MapEntry)", "SourceFile()", "SourceFile?(int)", "String?(SourceFile?)", "int(_Line)", "~(ContentBlock)", "Object(_Line)", "Object(_Highlight)", "int(_Highlight,_Highlight)", "List<_Line>(MapEntry>)", "SourceSpanWithContext()", "List(Trace)", "int(Trace)", "Value(Expression)", "String(Trace)", "UserDefinedCallable(ContentBlock)", "Value?(IfRuleClause)", "Frame(String,String)", "CssValue(Interpolation)", "Value?(Value)", "Frame(Frame)", "~(Module0)", "Module0()", "+loadedUrls,stylesheet(Set,CssStylesheet)()", "String(Argument0)", "CssValue(Interpolation{trim:bool,warnForColor:bool})", "SassArgumentList0(Object,Object,Object[String?])", "ImmutableMap0(SassArgumentList0)", "Value/()", "Future(Expression)", "Value0?(Module1)", "Module1?(Module1)", "UserDefinedCallable(ContentBlock)", "Future(IfRuleClause)", "Map(Module1)", "Map(Module1)", "Future>(Interpolation)", "Future(Value)", "Future>(Interpolation0{trim:bool,warnForColor:bool})", "~(Module0)", "Future>()", "Future<+loadedUrls,stylesheet(Set,CssStylesheet)>()", "~(Module0,bool)", "Future>(Interpolation{trim:bool,warnForColor:bool})", "SingleUnitSassNumber(double)", "SassScriptException()", "DateTime(StylesheetNode)", "~(Module1,bool)", "Future<+loadedUrls,stylesheet(Set,CssStylesheet0)>()", "Future>()", "StringExpression(Interpolation)", "~(Module1)", "~(BinaryOperator)", "~(Expression)", "WhileRule(List,FileSpan)", "SupportsRule(List,FileSpan)", "Future(Value0)", "MixinRule(List,FileSpan)", "Future>(Interpolation0)", "MediaRule(List,FileSpan)", "ContentBlock(List,FileSpan)", "ForRule(List,FileSpan)", "FunctionRule(List,FileSpan)", "Future(IfRuleClause0)", "EachRule(List,FileSpan)", "StyleRule(List,FileSpan)", "UserDefinedCallable0(ContentBlock0)", "UseRule()", "ArgumentDeclaration()", "VariableDeclaration(VariableDeclaration)", "Statement?()", "Stylesheet()", "Expression({bracketList:bool,singleEquals:bool,until:bool()?})", "Future(Expression0)", "Statement({root:bool})", "Value0/()", "CompoundSelector()", "SelectorList()", "List()", "String(BuiltInCallable)", "AtRootQuery()", "bool(+baseImporter,baseUrl,forImport(Uri,Importer,Uri?,bool),+originalUrl(Importer,Uri,Uri)?)", "Uri(+originalUrl(Importer,Uri,Uri))", "Future()", "bool(+originalUrl(AsyncImporter0,Uri,Uri))", "Uri(+originalUrl(AsyncImporter0,Uri,Uri))", "AtRootQuery0()", "bool(+originalUrl(Importer,Uri,Uri))", "SassString(String)", "SassString(int)", "SassString(SimpleSelector)", "SassCalculation0(Object[Object?,Object?])", "SassCalculation0(SassCalculation0[String?])", "ImmutableList(SassCalculation0)", "Object(Object,String,Object,Object)", "bool(CalculationOperator0)", "bool(CalculationOperation0,Object)", "int(CalculationOperation0)", "String(CalculationOperation0)", "Value(Object)", "CalculationInterpolation(Object,String)", "bool(CalculationInterpolation,Object)", "int(CalculationInterpolation)", "String(CalculationInterpolation)", "SassNumber(Value)", "SassMap(SassMap)", "SassMap(Value)", "bool(List)", "List(Value)", "0&(List)", "0&(List)", "SassColor0(Object,_Channels)", "SassColor0(SassColor0,_Channels)", "String(Value)", "SelectorList?(PseudoSelector)", "Null(_NodeSassColor,num?[num?,num?,num?,SassColor0?])", "~(CssMediaQuery)", "double(_NodeSassColor)", "bool(List>)", "List?(List,List)", "~(SimpleSelector,Set>)", "AsyncImporter0(JSImporter)", "0&(@)", "PseudoSelector(ComplexSelector)", "NodePackageImporter0(Object[String?])", "List(ComplexSelector)", "NodeCompileResult(Compiler,String[CompileOptions?])", "NodeCompileResult(Compiler,String[CompileStringOptions?])", "Null(Compiler)", "Promise(AsyncCompiler,String[CompileOptions?])", "Promise(AsyncCompiler,String[CompileStringOptions?])", "Promise(AsyncCompiler)", "Future()", "int(int,ComplexSelectorComponent0)", "String(CssValue0)", "int(int,SimpleSelector0)", "String(BuiltInCallable0)", "List>(List)", "Value0?(Module1)", "Module1?(Module1)", "List(PseudoSelector)", "List?(SimpleSelector)", "Map(Module1)", "Object(Value0)", "List(Extender)", "Iterable(List)", "CssValue0(Interpolation0{trim:bool,warnForColor:bool})", "Set>()", "bool(Extension)", "List(List)", "+loadedUrls,stylesheet(Set,CssStylesheet0)()", "Module1()", "~(Module1)", "Future<~>(String)", "Set()", "CssValue0(Interpolation0)", "ArgParser()", "Value0?(IfRuleClause0)", "UserDefinedCallable0(ContentBlock0)", "Value0(Expression0)", "Map(Module0)", "FileSpan(_NodeException)", "bool(Extension0)", "Set>()", "Map(Module0)", "Module0?(Module0)", "Iterable(List)", "Value?(Module0)", "List(Extender0)", "List?(SimpleSelector0)", "List(PseudoSelector0)", "List>(List)", "List(ComplexSelector0)", "PseudoSelector0(ComplexSelector0)", "~(SimpleSelector0,Set>)", "SassFunction0(Object,String,Value0(List))", "List?(List,List)", "bool(Deprecation)", "bool(List>)", "Uri(+originalUrl(AsyncImporter,Uri,Uri))", "bool(PseudoSelector0)", "SelectorList0?(PseudoSelector0)", "String(int,IfClause0)", "bool(+originalUrl(AsyncImporter,Uri,Uri))", "Future()", "~(Object?,Object,Object?)", "+(String,String)(String)", "Map(Module0)", "Stylesheet0?()", "bool(+originalUrl(Importer0,Uri,Uri))", "Uri(+originalUrl(Importer0,Uri,Uri))", "~(String,WarnOptions)", "~(String,DebugOptions)", "Null(RenderResult)", "JSFunction0(JSFunction0)", "Object?(Object,String,String[Object?])", "Null(Object)", "Map(Module0)", "List(Value0)", "bool(List)", "SassList0(ComplexSelector0)", "Iterable(ComplexSelector0)", "SimpleSelector0(SimpleSelector0)", "SassList0(Object[Object?,_ConstructorOptions?])", "Module0?(Module0)", "Null(_NodeSassList,int?[bool?,SassList0?])", "Value?(Module0)", "Object(_NodeSassList,int)", "Null(_NodeSassList,int,Object)", "bool(_NodeSassList)", "Null(_NodeSassList,bool)", "int(_NodeSassList)", "SassMap0(Value0)", "SassMap0(SassMap0)", "SassMap0(Object[ImmutableMap0?])", "ImmutableMap0(SassMap0)", "@(SassMap0,Object)", "Null(_NodeSassMap,int?[SassMap0?])", "SassNumber0(int)", "SimpleSelector(SimpleSelector)", "int(_NodeSassMap)", "Iterable(ComplexSelector)", "SassNumber0(Value0)", "List()", "Value0(Object)", "0&(Object)", "SassNumber0(Object,num[Object?])", "double(SassNumber0)", "SassList(ComplexSelector)", "int?(SassNumber0)", "int(int,SimpleSelector)", "int(SassNumber0[String?])", "double(SassNumber0,num,num[String?])", "SassNumber0(SassNumber0[String?])", "~(List)", "String(CssValue)", "int(int,ComplexSelectorComponent)", "String(int,IfClause)", "String(Argument)", "bool(Version)", "Null(_NodeSassNumber,num?[String?,SassNumber0?])", "double(_NodeSassNumber)", "Null(_NodeSassNumber,num)", "String(_NodeSassNumber)", "Null(_NodeSassNumber,String)", "SassScriptException0()", "Object(String)", "String(Object,@,@[@])", "Map(Module1)", "int(String?)", "bool(String?,String?)", "String(String?)", "SassString0(SimpleSelector0)", "SelectorList0()", "CompoundSelector0()", "~(CssMediaQuery0)", "~(SelectorList0)", "~(MapEntry)", "SingleUnitSassNumber0(double)", "Null(Function,Function)", "JSUrl0?(FileSpan)", "~(String,Option)", "Object?(Object?)", "SassString0(int)", "SassString0(String)", "SassString0(Object[Object?,_ConstructorOptions1?])", "String(SassString0)", "bool(SassString0)", "int(SassString0)", "int(SassString0,Value0[String?])", "Null(_NodeSassString,String?[SassString0?])", "String(_NodeSassString)", "Null(_NodeSassString,String)", "Statement0({root:bool})", "Uint8List(@,@)", "Stylesheet0()", "Statement0?()", "VariableDeclaration0(VariableDeclaration0)", "ArgumentDeclaration0()", "+(String,ArgumentDeclaration0)()", "VariableDeclaration0()", "int(int,int)", "StyleRule0(List,FileSpan)", "~(String,int?)", "EachRule0(List,FileSpan)", "FunctionRule0(List,FileSpan)", "ForRule0(List,FileSpan)", "ContentBlock0(List,FileSpan)", "MediaRule0(List,FileSpan)", "MixinRule0(List,FileSpan)", "~(String,int)", "SupportsRule0(List,FileSpan)", "WhileRule0(List,FileSpan)", "~(Expression0)", "~(BinaryOperator0)", "StringExpression0(Interpolation0)", "Null(~(Object?),~(Object?))", "ImmutableList0(Value0)", "String?(Value0)", "int(Value0,Value0[String?])", "SassBoolean0(Value0[String?])", "SassCalculation0(Value0[String?])", "SassColor0(Value0[String?])", "SassFunction0(Value0[String?])", "SassMap0(Value0[String?])", "SassMixin0(Value0[String?])", "SassNumber0(Value0[String?])", "SassString0(Value0[String?])", "SassMap0?(Value0)", "bool(Value0,Object?)", "int(Value0[Object?])", "~(Symbol0,@)", "~(@,StackTrace)", "~(Zone?,ZoneDelegate?,Zone,Object,StackTrace)", "0^(Zone?,ZoneDelegate?,Zone,0^())", "0^(Zone?,ZoneDelegate?,Zone,0^(1^),1^)", "0^(Zone?,ZoneDelegate?,Zone,0^(1^,2^),1^,2^)", "0^()(Zone,ZoneDelegate,Zone,0^())", "0^(1^)(Zone,ZoneDelegate,Zone,0^(1^))", "0^(1^,2^)(Zone,ZoneDelegate,Zone,0^(1^,2^))", "AsyncError?(Zone,ZoneDelegate,Zone,Object,StackTrace?)", "~(Zone?,ZoneDelegate?,Zone,~())", "Timer(Zone,ZoneDelegate,Zone,Duration,~())", "Timer(Zone,ZoneDelegate,Zone,Duration,~(Timer))", "~(Zone,ZoneDelegate,Zone,String)", "Zone(Zone?,ZoneDelegate?,Zone,ZoneSpecification?,Map?)", "~([Future<~>?])", "Future<@>()", "0^(0^,0^)", "Null(@,@)", "_Future<@>(@)", "~(Object,StackTrace,EventSink<0^>)", "List<0^>(0^,List<0^>?)", "NodeCompileResult(String[CompileOptions?])", "NodeCompileResult(String[CompileStringOptions?])", "Promise(String[CompileOptions?])", "Promise(String[CompileStringOptions?])", "Importer0(Object?)", "Compiler()", "Promise()", "List(Object?)", "~(RenderOptions,~(Object?,RenderResult?))", "RenderResult(RenderOptions)", "Uri(JSUrl0)", "JSUrl0(Uri)", "String(String[String?,String?,String?,String?,String?,String?,String?,String?,String?,String?,String?,String?,String?,String?])", "String(Object?)", "~(int,@)", "Null(@,StackTrace)", "int(num)", "@(@,String)", "Future<~>(List)", "SassNumber0(SassNumber0,String[String?])"], + interceptorsByTag: null, + leafTags: null, + arrayRti: Symbol("$ti"), + rttc: { + "2;": (t1, t2) => o => o instanceof A._Record_2 && t1._is(o._0) && t2._is(o._1), + "2;forImport": (t1, t2) => o => o instanceof A._Record_2_forImport && t1._is(o._0) && t2._is(o._1), + "2;sourceMap": (t1, t2) => o => o instanceof A._Record_2_sourceMap && t1._is(o._0) && t2._is(o._1), + "2;imports,modules": (t1, t2) => o => o instanceof A._Record_2_imports_modules && t1._is(o._0) && t2._is(o._1), + "2;loadedUrls,stylesheet": (t1, t2) => o => o instanceof A._Record_2_loadedUrls_stylesheet && t1._is(o._0) && t2._is(o._1), + "3;": (t1, t2, t3) => o => o instanceof A._Record_3 && t1._is(o._0) && t2._is(o._1) && t3._is(o._2), + "3;originalUrl": (t1, t2, t3) => o => o instanceof A._Record_3_originalUrl && t1._is(o._0) && t2._is(o._1) && t3._is(o._2), + "3;importer,isDependency": (t1, t2, t3) => o => o instanceof A._Record_3_importer_isDependency && t1._is(o._0) && t2._is(o._1) && t3._is(o._2), + "4;baseImporter,baseUrl,forImport": types => o => o instanceof A._Record_4_baseImporter_baseUrl_forImport && A.pairwiseIsTest(types, o._values), + "5;named,namedNodes,positional,positionalNodes,separator": types => o => o instanceof A._Record_5_named_namedNodes_positional_positionalNodes_separator && A.pairwiseIsTest(types, o._values) + } + }; + A._Universe_addRules(init.typeUniverse, JSON.parse('{"PlainJavaScriptObject":"LegacyJavaScriptObject","UnknownJavaScriptObject":"LegacyJavaScriptObject","JavaScriptFunction":"LegacyJavaScriptObject","Stdin":"LegacyJavaScriptObject","Stdout":"LegacyJavaScriptObject","ReadlineModule":"LegacyJavaScriptObject","ReadlineOptions":"LegacyJavaScriptObject","ReadlineInterface":"LegacyJavaScriptObject","BufferModule":"LegacyJavaScriptObject","BufferConstants":"LegacyJavaScriptObject","Buffer":"LegacyJavaScriptObject","ConsoleModule":"LegacyJavaScriptObject","Console":"LegacyJavaScriptObject","EventEmitter":"LegacyJavaScriptObject","FS":"LegacyJavaScriptObject","FSConstants":"LegacyJavaScriptObject","FSWatcher":"LegacyJavaScriptObject","ReadStream":"LegacyJavaScriptObject","ReadStreamOptions":"LegacyJavaScriptObject","WriteStream":"LegacyJavaScriptObject","WriteStreamOptions":"LegacyJavaScriptObject","FileOptions":"LegacyJavaScriptObject","StatOptions":"LegacyJavaScriptObject","MkdirOptions":"LegacyJavaScriptObject","RmdirOptions":"LegacyJavaScriptObject","WatchOptions":"LegacyJavaScriptObject","WatchFileOptions":"LegacyJavaScriptObject","Stats":"LegacyJavaScriptObject","Promise":"LegacyJavaScriptObject","Date":"LegacyJavaScriptObject","JsError":"LegacyJavaScriptObject","Atomics":"LegacyJavaScriptObject","Modules":"LegacyJavaScriptObject","Module":"LegacyJavaScriptObject","Net":"LegacyJavaScriptObject","Socket":"LegacyJavaScriptObject","NetAddress":"LegacyJavaScriptObject","NetServer":"LegacyJavaScriptObject","NodeJsError":"LegacyJavaScriptObject","JsAssertionError":"LegacyJavaScriptObject","JsRangeError":"LegacyJavaScriptObject","JsReferenceError":"LegacyJavaScriptObject","JsSyntaxError":"LegacyJavaScriptObject","JsTypeError":"LegacyJavaScriptObject","JsSystemError":"LegacyJavaScriptObject","Process":"LegacyJavaScriptObject","CPUUsage":"LegacyJavaScriptObject","Release":"LegacyJavaScriptObject","StreamModule":"LegacyJavaScriptObject","Readable":"LegacyJavaScriptObject","Writable":"LegacyJavaScriptObject","Duplex":"LegacyJavaScriptObject","Transform":"LegacyJavaScriptObject","WritableOptions":"LegacyJavaScriptObject","ReadableOptions":"LegacyJavaScriptObject","Immediate":"LegacyJavaScriptObject","Timeout":"LegacyJavaScriptObject","TTY":"LegacyJavaScriptObject","TTYReadStream":"LegacyJavaScriptObject","TTYWriteStream":"LegacyJavaScriptObject","Util":"LegacyJavaScriptObject","JSArray0":"LegacyJavaScriptObject","Chokidar":"LegacyJavaScriptObject","ChokidarOptions":"LegacyJavaScriptObject","ChokidarWatcher":"LegacyJavaScriptObject","JSFunction":"LegacyJavaScriptObject","ImmutableList":"LegacyJavaScriptObject","ImmutableMap":"LegacyJavaScriptObject","NodeImporterResult":"LegacyJavaScriptObject","RenderContext":"LegacyJavaScriptObject","RenderContextOptions":"LegacyJavaScriptObject","RenderContextResult":"LegacyJavaScriptObject","RenderContextResultStats":"LegacyJavaScriptObject","JSModule":"LegacyJavaScriptObject","JSModuleRequire":"LegacyJavaScriptObject","JSClass":"LegacyJavaScriptObject","JSUrl":"LegacyJavaScriptObject","_PropertyDescriptor":"LegacyJavaScriptObject","_RequireMain":"LegacyJavaScriptObject","JSArray1":"LegacyJavaScriptObject","Chokidar0":"LegacyJavaScriptObject","ChokidarOptions0":"LegacyJavaScriptObject","ChokidarWatcher0":"LegacyJavaScriptObject","_Channels":"LegacyJavaScriptObject","_NodeSassColor":"LegacyJavaScriptObject","CompileOptions":"LegacyJavaScriptObject","CompileStringOptions":"LegacyJavaScriptObject","NodeCompileResult":"LegacyJavaScriptObject","_NodeException":"LegacyJavaScriptObject","Exports":"LegacyJavaScriptObject","LoggerNamespace":"LegacyJavaScriptObject","Fiber":"LegacyJavaScriptObject","FiberClass":"LegacyJavaScriptObject","JSFunction0":"LegacyJavaScriptObject","ImmutableList0":"LegacyJavaScriptObject","ImmutableMap0":"LegacyJavaScriptObject","JSImporter":"LegacyJavaScriptObject","CanonicalizeContext":"LegacyJavaScriptObject","JSImporterResult":"LegacyJavaScriptObject","NodeImporterResult0":"LegacyJavaScriptObject","_ConstructorOptions":"LegacyJavaScriptObject","_NodeSassList":"LegacyJavaScriptObject","WarnOptions":"LegacyJavaScriptObject","DebugOptions":"LegacyJavaScriptObject","JSLogger":"LegacyJavaScriptObject","_NodeSassMap":"LegacyJavaScriptObject","JSModule0":"LegacyJavaScriptObject","JSModuleRequire0":"LegacyJavaScriptObject","_ConstructorOptions0":"LegacyJavaScriptObject","_NodeSassNumber":"LegacyJavaScriptObject","JSClass0":"LegacyJavaScriptObject","RenderContext0":"LegacyJavaScriptObject","RenderContextOptions0":"LegacyJavaScriptObject","RenderContextResult0":"LegacyJavaScriptObject","RenderContextResultStats0":"LegacyJavaScriptObject","RenderOptions":"LegacyJavaScriptObject","RenderResult":"LegacyJavaScriptObject","RenderResultStats":"LegacyJavaScriptObject","_Exports":"LegacyJavaScriptObject","_ConstructorOptions1":"LegacyJavaScriptObject","_NodeSassString":"LegacyJavaScriptObject","Types":"LegacyJavaScriptObject","JSUrl0":"LegacyJavaScriptObject","_PropertyDescriptor0":"LegacyJavaScriptObject","_RequireMain0":"LegacyJavaScriptObject","JSBool":{"bool":[],"TrustedGetRuntimeType":[]},"JSNull":{"Null":[],"TrustedGetRuntimeType":[]},"LegacyJavaScriptObject":{"Promise":[],"JsSystemError":[],"ImmutableList":[],"_Channels":[],"_NodeSassColor":[],"CompileOptions":[],"CompileStringOptions":[],"NodeCompileResult":[],"_NodeException":[],"Fiber":[],"JSFunction0":[],"ImmutableList0":[],"ImmutableMap0":[],"JSImporter":[],"JSImporterResult":[],"NodeImporterResult0":[],"_ConstructorOptions":[],"_NodeSassList":[],"WarnOptions":[],"DebugOptions":[],"_NodeSassMap":[],"_ConstructorOptions0":[],"_NodeSassNumber":[],"JSClass0":[],"RenderContextOptions0":[],"RenderOptions":[],"RenderResult":[],"_ConstructorOptions1":[],"_NodeSassString":[],"JSUrl0":[]},"JSArray":{"List":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"]},"JSUnmodifiableArray":{"JSArray":["1"],"List":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"]},"JSNumber":{"double":[],"num":[],"Comparable":["num"]},"JSInt":{"double":[],"int":[],"num":[],"Comparable":["num"],"TrustedGetRuntimeType":[]},"JSNumNotInt":{"double":[],"num":[],"Comparable":["num"],"TrustedGetRuntimeType":[]},"JSString":{"String":[],"Comparable":["String"],"TrustedGetRuntimeType":[]},"_CastIterableBase":{"Iterable":["2"]},"CastIterable":{"_CastIterableBase":["1","2"],"Iterable":["2"],"Iterable.E":"2"},"_EfficientLengthCastIterable":{"CastIterable":["1","2"],"_CastIterableBase":["1","2"],"EfficientLengthIterable":["2"],"Iterable":["2"],"Iterable.E":"2"},"_CastListBase":{"ListBase":["2"],"List":["2"],"_CastIterableBase":["1","2"],"EfficientLengthIterable":["2"],"Iterable":["2"]},"CastList":{"_CastListBase":["1","2"],"ListBase":["2"],"List":["2"],"_CastIterableBase":["1","2"],"EfficientLengthIterable":["2"],"Iterable":["2"],"ListBase.E":"2","Iterable.E":"2"},"CastSet":{"Set":["2"],"_CastIterableBase":["1","2"],"EfficientLengthIterable":["2"],"Iterable":["2"],"Iterable.E":"2"},"CastMap":{"MapBase":["3","4"],"Map":["3","4"],"MapBase.V":"4","MapBase.K":"3"},"LateError":{"Error":[]},"ReachabilityError":{"Error":[]},"CodeUnits":{"ListBase":["int"],"List":["int"],"EfficientLengthIterable":["int"],"Iterable":["int"],"ListBase.E":"int"},"EfficientLengthIterable":{"Iterable":["1"]},"ListIterable":{"EfficientLengthIterable":["1"],"Iterable":["1"]},"SubListIterable":{"ListIterable":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"],"ListIterable.E":"1","Iterable.E":"1"},"MappedIterable":{"Iterable":["2"],"Iterable.E":"2"},"EfficientLengthMappedIterable":{"MappedIterable":["1","2"],"EfficientLengthIterable":["2"],"Iterable":["2"],"Iterable.E":"2"},"MappedListIterable":{"ListIterable":["2"],"EfficientLengthIterable":["2"],"Iterable":["2"],"ListIterable.E":"2","Iterable.E":"2"},"WhereIterable":{"Iterable":["1"],"Iterable.E":"1"},"ExpandIterable":{"Iterable":["2"],"Iterable.E":"2"},"TakeIterable":{"Iterable":["1"],"Iterable.E":"1"},"EfficientLengthTakeIterable":{"TakeIterable":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"],"Iterable.E":"1"},"SkipIterable":{"Iterable":["1"],"Iterable.E":"1"},"EfficientLengthSkipIterable":{"SkipIterable":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"],"Iterable.E":"1"},"SkipWhileIterable":{"Iterable":["1"],"Iterable.E":"1"},"EmptyIterable":{"EfficientLengthIterable":["1"],"Iterable":["1"],"Iterable.E":"1"},"FollowedByIterable":{"Iterable":["1"],"Iterable.E":"1"},"EfficientLengthFollowedByIterable":{"FollowedByIterable":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"],"Iterable.E":"1"},"WhereTypeIterable":{"Iterable":["1"],"Iterable.E":"1"},"UnmodifiableListBase":{"ListBase":["1"],"List":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"]},"ReversedListIterable":{"ListIterable":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"],"ListIterable.E":"1","Iterable.E":"1"},"Symbol":{"Symbol0":[]},"ConstantMapView":{"UnmodifiableMapView":["1","2"],"Map":["1","2"]},"ConstantMap":{"Map":["1","2"]},"ConstantStringMap":{"ConstantMap":["1","2"],"Map":["1","2"]},"_KeysOrValues":{"Iterable":["1"],"Iterable.E":"1"},"ConstantSet":{"SetBase":["1"],"Set":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"]},"ConstantStringSet":{"SetBase":["1"],"Set":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"]},"GeneralConstantSet":{"SetBase":["1"],"Set":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"]},"Instantiation":{"Function":[]},"Instantiation1":{"Function":[]},"NullError":{"TypeError":[],"Error":[]},"JsNoSuchMethodError":{"Error":[]},"UnknownJsTypeError":{"Error":[]},"NullThrownFromJavaScriptException":{"Exception":[]},"_StackTrace":{"StackTrace":[]},"Closure":{"Function":[]},"Closure0Args":{"Function":[]},"Closure2Args":{"Function":[]},"TearOffClosure":{"Function":[]},"StaticClosure":{"Function":[]},"BoundClosure":{"Function":[]},"_CyclicInitializationError":{"Error":[]},"RuntimeError":{"Error":[]},"JsLinkedHashMap":{"MapBase":["1","2"],"Map":["1","2"],"MapBase.V":"2","MapBase.K":"1"},"LinkedHashMapKeyIterable":{"EfficientLengthIterable":["1"],"Iterable":["1"],"Iterable.E":"1"},"JsIdentityLinkedHashMap":{"JsLinkedHashMap":["1","2"],"MapBase":["1","2"],"Map":["1","2"],"MapBase.V":"2","MapBase.K":"1"},"JsConstantLinkedHashMap":{"JsLinkedHashMap":["1","2"],"MapBase":["1","2"],"Map":["1","2"],"MapBase.V":"2","MapBase.K":"1"},"_MatchImplementation":{"RegExpMatch":[],"Match":[]},"_AllMatchesIterable":{"Iterable":["RegExpMatch"],"Iterable.E":"RegExpMatch"},"StringMatch":{"Match":[]},"_StringAllMatchesIterable":{"Iterable":["Match"],"Iterable.E":"Match"},"NativeByteBuffer":{"ByteBuffer":[],"TrustedGetRuntimeType":[]},"NativeByteData":{"ByteData":[],"TrustedGetRuntimeType":[]},"NativeTypedArray":{"JavaScriptIndexingBehavior":["1"]},"NativeTypedArrayOfDouble":{"ListBase":["double"],"List":["double"],"JavaScriptIndexingBehavior":["double"],"EfficientLengthIterable":["double"],"Iterable":["double"]},"NativeTypedArrayOfInt":{"ListBase":["int"],"List":["int"],"JavaScriptIndexingBehavior":["int"],"EfficientLengthIterable":["int"],"Iterable":["int"]},"NativeFloat32List":{"NativeTypedArrayOfDouble":[],"ListBase":["double"],"Float32List":[],"List":["double"],"JavaScriptIndexingBehavior":["double"],"EfficientLengthIterable":["double"],"Iterable":["double"],"TrustedGetRuntimeType":[],"ListBase.E":"double"},"NativeFloat64List":{"NativeTypedArrayOfDouble":[],"ListBase":["double"],"Float64List":[],"List":["double"],"JavaScriptIndexingBehavior":["double"],"EfficientLengthIterable":["double"],"Iterable":["double"],"TrustedGetRuntimeType":[],"ListBase.E":"double"},"NativeInt16List":{"NativeTypedArrayOfInt":[],"ListBase":["int"],"Int16List":[],"List":["int"],"JavaScriptIndexingBehavior":["int"],"EfficientLengthIterable":["int"],"Iterable":["int"],"TrustedGetRuntimeType":[],"ListBase.E":"int"},"NativeInt32List":{"NativeTypedArrayOfInt":[],"ListBase":["int"],"Int32List":[],"List":["int"],"JavaScriptIndexingBehavior":["int"],"EfficientLengthIterable":["int"],"Iterable":["int"],"TrustedGetRuntimeType":[],"ListBase.E":"int"},"NativeInt8List":{"NativeTypedArrayOfInt":[],"ListBase":["int"],"Int8List":[],"List":["int"],"JavaScriptIndexingBehavior":["int"],"EfficientLengthIterable":["int"],"Iterable":["int"],"TrustedGetRuntimeType":[],"ListBase.E":"int"},"NativeUint16List":{"NativeTypedArrayOfInt":[],"ListBase":["int"],"Uint16List":[],"List":["int"],"JavaScriptIndexingBehavior":["int"],"EfficientLengthIterable":["int"],"Iterable":["int"],"TrustedGetRuntimeType":[],"ListBase.E":"int"},"NativeUint32List":{"NativeTypedArrayOfInt":[],"ListBase":["int"],"Uint32List":[],"List":["int"],"JavaScriptIndexingBehavior":["int"],"EfficientLengthIterable":["int"],"Iterable":["int"],"TrustedGetRuntimeType":[],"ListBase.E":"int"},"NativeUint8ClampedList":{"NativeTypedArrayOfInt":[],"ListBase":["int"],"Uint8ClampedList":[],"List":["int"],"JavaScriptIndexingBehavior":["int"],"EfficientLengthIterable":["int"],"Iterable":["int"],"TrustedGetRuntimeType":[],"ListBase.E":"int"},"NativeUint8List":{"NativeTypedArrayOfInt":[],"ListBase":["int"],"Uint8List":[],"List":["int"],"JavaScriptIndexingBehavior":["int"],"EfficientLengthIterable":["int"],"Iterable":["int"],"TrustedGetRuntimeType":[],"ListBase.E":"int"},"_Error":{"Error":[]},"_TypeError":{"TypeError":[],"Error":[]},"AsyncError":{"Error":[]},"_Future":{"Future":["1"]},"_SyncStarIterable":{"Iterable":["1"],"Iterable.E":"1"},"_AsyncCompleter":{"_Completer":["1"]},"_SyncCompleter":{"_Completer":["1"]},"_StreamController":{"EventSink":["1"]},"_AsyncStreamController":{"_StreamController":["1"],"EventSink":["1"]},"_SyncStreamController":{"_StreamController":["1"],"EventSink":["1"]},"_ControllerStream":{"_StreamImpl":["1"],"Stream":["1"],"Stream.T":"1"},"_ControllerSubscription":{"_BufferingStreamSubscription":["1"],"StreamSubscription":["1"],"_BufferingStreamSubscription.T":"1"},"_BufferingStreamSubscription":{"StreamSubscription":["1"],"_BufferingStreamSubscription.T":"1"},"_StreamImpl":{"Stream":["1"]},"_ForwardingStream":{"Stream":["2"]},"_ForwardingStreamSubscription":{"_BufferingStreamSubscription":["2"],"StreamSubscription":["2"],"_BufferingStreamSubscription.T":"2"},"_ExpandStream":{"_ForwardingStream":["1","2"],"Stream":["2"],"Stream.T":"2"},"_ZoneSpecification":{"ZoneSpecification":[]},"_ZoneDelegate":{"ZoneDelegate":[]},"_Zone":{"Zone":[]},"_CustomZone":{"Zone":[]},"_RootZone":{"Zone":[]},"Queue":{"EfficientLengthIterable":["1"],"Iterable":["1"]},"_HashMap":{"MapBase":["1","2"],"Map":["1","2"],"MapBase.V":"2","MapBase.K":"1"},"_IdentityHashMap":{"_HashMap":["1","2"],"MapBase":["1","2"],"Map":["1","2"],"MapBase.V":"2","MapBase.K":"1"},"_HashMapKeyIterable":{"EfficientLengthIterable":["1"],"Iterable":["1"],"Iterable.E":"1"},"_LinkedCustomHashMap":{"JsLinkedHashMap":["1","2"],"MapBase":["1","2"],"Map":["1","2"],"MapBase.V":"2","MapBase.K":"1"},"_LinkedHashSet":{"_SetBase":["1"],"SetBase":["1"],"Set":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"]},"_LinkedIdentityHashSet":{"_LinkedHashSet":["1"],"_SetBase":["1"],"SetBase":["1"],"Set":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"]},"UnmodifiableListView":{"ListBase":["1"],"List":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"],"ListBase.E":"1"},"ListBase":{"List":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"]},"MapBase":{"Map":["1","2"]},"UnmodifiableMapBase":{"MapBase":["1","2"],"Map":["1","2"]},"_MapBaseValueIterable":{"EfficientLengthIterable":["2"],"Iterable":["2"],"Iterable.E":"2"},"MapView":{"Map":["1","2"]},"UnmodifiableMapView":{"Map":["1","2"]},"ListQueue":{"Queue":["1"],"ListIterable":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"],"ListIterable.E":"1","Iterable.E":"1"},"SetBase":{"Set":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"]},"_SetBase":{"SetBase":["1"],"Set":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"]},"UnmodifiableSetView":{"SetBase":["1"],"Set":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"]},"_JsonMap":{"MapBase":["String","@"],"Map":["String","@"],"MapBase.V":"@","MapBase.K":"String"},"_JsonMapKeyIterable":{"ListIterable":["String"],"EfficientLengthIterable":["String"],"Iterable":["String"],"ListIterable.E":"String","Iterable.E":"String"},"AsciiCodec":{"Codec":["String","List"]},"_UnicodeSubsetEncoder":{"Converter":["String","List"]},"AsciiEncoder":{"Converter":["String","List"]},"Base64Codec":{"Codec":["List","String"]},"Base64Encoder":{"Converter":["List","String"]},"Encoding":{"Codec":["String","List"]},"JsonUnsupportedObjectError":{"Error":[]},"JsonCyclicError":{"Error":[]},"JsonCodec":{"Codec":["Object?","String"]},"JsonEncoder":{"Converter":["Object?","String"]},"JsonDecoder":{"Converter":["String","Object?"]},"Utf8Codec":{"Codec":["String","List"]},"Utf8Encoder":{"Converter":["String","List"]},"Utf8Decoder":{"Converter":["List","String"]},"DateTime":{"Comparable":["DateTime"]},"double":{"num":[],"Comparable":["num"]},"Duration":{"Comparable":["Duration"]},"int":{"num":[],"Comparable":["num"]},"List":{"EfficientLengthIterable":["1"],"Iterable":["1"]},"num":{"Comparable":["num"]},"RegExpMatch":{"Match":[]},"Set":{"EfficientLengthIterable":["1"],"Iterable":["1"]},"String":{"Comparable":["String"]},"AssertionError":{"Error":[]},"TypeError":{"Error":[]},"ArgumentError":{"Error":[]},"RangeError":{"Error":[]},"IndexError":{"RangeError":[],"Error":[]},"NoSuchMethodError":{"Error":[]},"UnsupportedError":{"Error":[]},"UnimplementedError":{"Error":[]},"StateError":{"Error":[]},"ConcurrentModificationError":{"Error":[]},"OutOfMemoryError":{"Error":[]},"StackOverflowError":{"Error":[]},"_Exception":{"Exception":[]},"FormatException":{"Exception":[]},"_GeneratorIterable":{"ListIterable":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"],"ListIterable.E":"1","Iterable.E":"1"},"_StringStackTrace":{"StackTrace":[]},"Runes":{"Iterable":["int"],"Iterable.E":"int"},"_Uri":{"Uri":[]},"_SimpleUri":{"Uri":[]},"_DataUri":{"Uri":[]},"NullRejectionException":{"Exception":[]},"ArgParserException":{"FormatException":[],"Exception":[]},"ErrorResult":{"Result":["0&"]},"ValueResult":{"Result":["1"]},"_CompleterStream":{"Stream":["1"],"Stream.T":"1"},"_NextRequest":{"_EventRequest":["1"]},"EmptyUnmodifiableSet":{"Set":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"],"Iterable.E":"1"},"QueueList":{"ListBase":["1"],"List":["1"],"Queue":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"],"ListBase.E":"1","QueueList.E":"1"},"_CastQueueList":{"QueueList":["2"],"ListBase":["2"],"List":["2"],"Queue":["2"],"EfficientLengthIterable":["2"],"Iterable":["2"],"ListBase.E":"2","QueueList.E":"2"},"UnionSet":{"SetBase":["1"],"Set":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"]},"UnmodifiableSetView0":{"DelegatingSet":["1"],"Set":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"]},"MapKeySet":{"Set":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"]},"_DelegatingIterableBase":{"Iterable":["1"]},"DelegatingSet":{"Set":["1"],"EfficientLengthIterable":["1"],"Iterable":["1"]},"PathException":{"Exception":[]},"PathMap":{"Map":["String?","1"]},"Version":{"VersionRange":[],"Comparable":["VersionRange"]},"VersionRange":{"Comparable":["VersionRange"]},"ModifiableCssAtRule":{"ModifiableCssParentNode":[],"ModifiableCssNode":[],"CssParentNode":[],"CssNode":[],"AstNode":[]},"ModifiableCssComment":{"ModifiableCssNode":[],"CssComment":[],"CssNode":[],"AstNode":[]},"ModifiableCssDeclaration":{"ModifiableCssNode":[],"CssNode":[],"AstNode":[]},"ModifiableCssImport":{"ModifiableCssNode":[],"CssNode":[],"AstNode":[]},"ModifiableCssKeyframeBlock":{"ModifiableCssParentNode":[],"ModifiableCssNode":[],"CssParentNode":[],"CssNode":[],"AstNode":[]},"ModifiableCssMediaRule":{"ModifiableCssParentNode":[],"ModifiableCssNode":[],"CssParentNode":[],"CssNode":[],"AstNode":[]},"ModifiableCssNode":{"CssNode":[],"AstNode":[]},"ModifiableCssParentNode":{"ModifiableCssNode":[],"CssParentNode":[],"CssNode":[],"AstNode":[]},"ModifiableCssStyleRule":{"ModifiableCssParentNode":[],"ModifiableCssNode":[],"CssParentNode":[],"CssNode":[],"AstNode":[]},"ModifiableCssStylesheet":{"ModifiableCssParentNode":[],"CssStylesheet":[],"ModifiableCssNode":[],"CssParentNode":[],"CssNode":[],"AstNode":[]},"ModifiableCssSupportsRule":{"ModifiableCssParentNode":[],"ModifiableCssNode":[],"CssParentNode":[],"CssNode":[],"AstNode":[]},"CssNode":{"AstNode":[]},"CssParentNode":{"CssNode":[],"AstNode":[]},"CssStylesheet":{"CssParentNode":[],"CssNode":[],"AstNode":[]},"CssValue":{"AstNode":[]},"_FakeAstNode":{"AstNode":[]},"Argument":{"AstNode":[]},"ArgumentDeclaration":{"AstNode":[]},"ArgumentInvocation":{"AstNode":[]},"ConfiguredVariable":{"AstNode":[]},"Expression":{"AstNode":[]},"BinaryOperationExpression":{"Expression":[],"AstNode":[]},"BooleanExpression":{"Expression":[],"AstNode":[]},"ColorExpression":{"Expression":[],"AstNode":[]},"FunctionExpression":{"Expression":[],"AstNode":[]},"IfExpression":{"Expression":[],"AstNode":[]},"InterpolatedFunctionExpression":{"Expression":[],"AstNode":[]},"ListExpression":{"Expression":[],"AstNode":[]},"MapExpression":{"Expression":[],"AstNode":[]},"NullExpression":{"Expression":[],"AstNode":[]},"NumberExpression":{"Expression":[],"AstNode":[]},"ParenthesizedExpression":{"Expression":[],"AstNode":[]},"SelectorExpression":{"Expression":[],"AstNode":[]},"StringExpression":{"Expression":[],"AstNode":[]},"SupportsExpression":{"Expression":[],"AstNode":[]},"UnaryOperationExpression":{"Expression":[],"AstNode":[]},"ValueExpression":{"Expression":[],"AstNode":[]},"VariableExpression":{"Expression":[],"AstNode":[]},"DynamicImport":{"Import":[],"AstNode":[]},"StaticImport":{"Import":[],"AstNode":[]},"Interpolation":{"AstNode":[]},"AtRootRule":{"Statement":[],"AstNode":[]},"AtRule":{"Statement":[],"AstNode":[]},"CallableDeclaration":{"Statement":[],"AstNode":[]},"ContentBlock":{"Statement":[],"AstNode":[]},"ContentRule":{"Statement":[],"AstNode":[]},"DebugRule":{"Statement":[],"AstNode":[]},"Declaration":{"Statement":[],"AstNode":[]},"EachRule":{"Statement":[],"AstNode":[]},"ErrorRule":{"Statement":[],"AstNode":[]},"ExtendRule":{"Statement":[],"AstNode":[]},"ForRule":{"Statement":[],"AstNode":[]},"ForwardRule":{"Statement":[],"AstNode":[]},"FunctionRule":{"Statement":[],"AstNode":[]},"IfClause":{"IfRuleClause":[]},"ElseClause":{"IfRuleClause":[]},"IfRule":{"Statement":[],"AstNode":[]},"ImportRule":{"Statement":[],"AstNode":[]},"IncludeRule":{"Statement":[],"AstNode":[]},"LoudComment":{"Statement":[],"AstNode":[]},"MediaRule":{"Statement":[],"AstNode":[]},"MixinRule":{"Statement":[],"AstNode":[]},"_HasContentVisitor":{"StatementSearchVisitor":["bool"],"StatementSearchVisitor.T":"bool"},"ParentStatement":{"Statement":[],"AstNode":[]},"ReturnRule":{"Statement":[],"AstNode":[]},"SilentComment":{"Statement":[],"AstNode":[]},"StyleRule":{"Statement":[],"AstNode":[]},"Stylesheet":{"Statement":[],"AstNode":[]},"SupportsRule":{"Statement":[],"AstNode":[]},"UseRule":{"Statement":[],"AstNode":[]},"VariableDeclaration":{"Statement":[],"AstNode":[]},"WarnRule":{"Statement":[],"AstNode":[]},"WhileRule":{"Statement":[],"AstNode":[]},"SupportsAnything":{"AstNode":[]},"SupportsDeclaration":{"AstNode":[]},"SupportsFunction":{"AstNode":[]},"SupportsInterpolation":{"AstNode":[]},"SupportsNegation":{"AstNode":[]},"SupportsOperation":{"AstNode":[]},"Selector":{"AstNode":[]},"AttributeSelector":{"SimpleSelector":[],"AstNode":[]},"ClassSelector":{"SimpleSelector":[],"AstNode":[]},"ComplexSelector":{"AstNode":[]},"CompoundSelector":{"AstNode":[]},"IDSelector":{"SimpleSelector":[],"AstNode":[]},"SelectorList":{"AstNode":[]},"_ParentSelectorVisitor":{"SelectorSearchVisitor":["ParentSelector"],"SelectorSearchVisitor.T":"ParentSelector"},"ParentSelector":{"SimpleSelector":[],"AstNode":[]},"PlaceholderSelector":{"SimpleSelector":[],"AstNode":[]},"PseudoSelector":{"SimpleSelector":[],"AstNode":[]},"SimpleSelector":{"AstNode":[]},"TypeSelector":{"SimpleSelector":[],"AstNode":[]},"UniversalSelector":{"SimpleSelector":[],"AstNode":[]},"_EnvironmentModule0":{"Module0":["AsyncCallable"]},"AsyncBuiltInCallable":{"AsyncCallable":[]},"BuiltInCallable":{"Callable0":[],"AsyncBuiltInCallable":[],"AsyncCallable":[]},"PlainCssCallable":{"Callable0":[],"AsyncCallable":[]},"UserDefinedCallable":{"Callable0":[],"AsyncCallable":[]},"ExplicitConfiguration":{"Configuration":[]},"_EnvironmentModule":{"Module0":["Callable0"]},"SassRuntimeException":{"Exception":[]},"SassException":{"Exception":[]},"MultiSpanSassException":{"Exception":[]},"MultiSpanSassRuntimeException":{"SassRuntimeException":[],"Exception":[]},"SassFormatException":{"SourceSpanFormatException":[],"FormatException":[],"Exception":[]},"MultiSpanSassFormatException":{"MultiSourceSpanFormatException":[],"SassFormatException":[],"SourceSpanFormatException":[],"FormatException":[],"Exception":[]},"UsageException":{"Exception":[]},"EmptyExtensionStore":{"ExtensionStore":[]},"MergedExtension":{"Extension":[]},"Importer":{"AsyncImporter":[]},"FilesystemImporter":{"Importer":[],"AsyncImporter":[]},"NodePackageImporter":{"Importer":[],"AsyncImporter":[]},"BuiltInModule":{"Module0":["1"]},"ForwardedModuleView":{"Module0":["1"]},"ShadowedModuleView":{"Module0":["1"]},"LazyFileSpan":{"FileSpan":[],"SourceSpanWithContext":[],"SourceSpan":[],"Comparable":["SourceSpan"]},"LimitedMapView":{"MapBase":["1","2"],"Map":["1","2"],"MapBase.V":"2","MapBase.K":"1"},"MergedMapView":{"MapBase":["1","2"],"Map":["1","2"],"MapBase.V":"2","MapBase.K":"1"},"MultiSpan":{"FileSpan":[],"SourceSpanWithContext":[],"SourceSpan":[],"Comparable":["SourceSpan"]},"PrefixedMapView":{"MapBase":["String","1"],"Map":["String","1"],"MapBase.V":"1","MapBase.K":"String"},"_PrefixedKeys":{"Iterable":["String"],"Iterable.E":"String"},"PublicMemberMapView":{"MapBase":["String","1"],"Map":["String","1"],"MapBase.V":"1","MapBase.K":"String"},"UnprefixedMapView":{"MapBase":["String","1"],"Map":["String","1"],"MapBase.V":"1","MapBase.K":"String"},"_UnprefixedKeys":{"Iterable":["String"],"Iterable.E":"String"},"SassArgumentList":{"SassList":[],"Value":[]},"SassBoolean":{"Value":[]},"SassCalculation":{"Value":[]},"SassColor":{"Value":[]},"SassFunction":{"Value":[]},"SassList":{"Value":[]},"SassMap":{"Value":[]},"SassMixin":{"Value":[]},"_SassNull":{"Value":[]},"SassNumber":{"Value":[]},"ComplexSassNumber":{"SassNumber":[],"Value":[]},"SingleUnitSassNumber":{"SassNumber":[],"Value":[]},"UnitlessSassNumber":{"SassNumber":[],"Value":[]},"SassString":{"Value":[]},"_EvaluationContext0":{"EvaluationContext":[]},"_EvaluationContext":{"EvaluationContext":[]},"Entry":{"Comparable":["Entry"]},"FileLocation":{"SourceLocation":[],"Comparable":["SourceLocation"]},"FileSpan":{"SourceSpanWithContext":[],"SourceSpan":[],"Comparable":["SourceSpan"]},"_FileSpan":{"FileSpan":[],"SourceSpanWithContext":[],"SourceSpan":[],"Comparable":["SourceSpan"]},"SourceLocation":{"Comparable":["SourceLocation"]},"SourceLocationMixin":{"SourceLocation":[],"Comparable":["SourceLocation"]},"SourceSpan":{"Comparable":["SourceSpan"]},"SourceSpanBase":{"SourceSpan":[],"Comparable":["SourceSpan"]},"SourceSpanException":{"Exception":[]},"SourceSpanFormatException":{"FormatException":[],"Exception":[]},"MultiSourceSpanException":{"Exception":[]},"MultiSourceSpanFormatException":{"FormatException":[],"Exception":[]},"SourceSpanMixin":{"SourceSpan":[],"Comparable":["SourceSpan"]},"SourceSpanWithContext":{"SourceSpan":[],"Comparable":["SourceSpan"]},"Chain":{"StackTrace":[]},"LazyTrace":{"Trace":[],"StackTrace":[]},"Trace":{"StackTrace":[]},"UnparsedFrame":{"Frame":[]},"StringScannerException":{"SourceSpanFormatException":[],"FormatException":[],"Exception":[]},"SupportsAnything0":{"AstNode0":[]},"Argument0":{"AstNode0":[]},"ArgumentDeclaration0":{"AstNode0":[]},"ArgumentInvocation0":{"AstNode0":[]},"SassArgumentList0":{"SassList0":[],"Value0":[]},"JSToDartAsyncImporter":{"AsyncImporter0":[]},"AsyncBuiltInCallable0":{"AsyncCallable0":[]},"_EnvironmentModule2":{"Module1":["AsyncCallable0"]},"_EvaluationContext2":{"EvaluationContext0":[]},"JSToDartAsyncFileImporter":{"AsyncImporter0":[]},"AtRootRule0":{"Statement0":[],"AstNode0":[]},"ModifiableCssAtRule0":{"ModifiableCssParentNode0":[],"ModifiableCssNode0":[],"CssParentNode0":[],"CssNode0":[],"AstNode0":[]},"AtRule0":{"Statement0":[],"AstNode0":[]},"AttributeSelector0":{"SimpleSelector0":[],"AstNode0":[]},"BinaryOperationExpression0":{"Expression0":[],"AstNode0":[]},"BooleanExpression0":{"Expression0":[],"AstNode0":[]},"SassBoolean0":{"Value0":[]},"BuiltInCallable0":{"Callable":[],"AsyncBuiltInCallable0":[],"AsyncCallable0":[]},"BuiltInModule0":{"Module1":["1"]},"SassCalculation0":{"Value0":[]},"CallableDeclaration0":{"Statement0":[],"AstNode0":[]},"ClassSelector0":{"SimpleSelector0":[],"AstNode0":[]},"ColorExpression0":{"Expression0":[],"AstNode0":[]},"SassColor0":{"Value0":[]},"ModifiableCssComment0":{"ModifiableCssNode0":[],"CssComment0":[],"CssNode0":[],"AstNode0":[]},"AsyncCompiler":{"Compiler":[]},"ComplexSassNumber0":{"SassNumber0":[],"Value0":[]},"ComplexSelector0":{"AstNode0":[]},"CompoundSelector0":{"AstNode0":[]},"ExplicitConfiguration0":{"Configuration0":[]},"ConfiguredVariable0":{"AstNode0":[]},"ContentBlock0":{"Statement0":[],"AstNode0":[]},"ContentRule0":{"Statement0":[],"AstNode0":[]},"DebugRule0":{"Statement0":[],"AstNode0":[]},"ModifiableCssDeclaration0":{"ModifiableCssNode0":[],"CssNode0":[],"AstNode0":[]},"Declaration0":{"Statement0":[],"AstNode0":[]},"SupportsDeclaration0":{"AstNode0":[]},"DynamicImport0":{"Import0":[],"AstNode0":[]},"EachRule0":{"Statement0":[],"AstNode0":[]},"EmptyExtensionStore0":{"ExtensionStore0":[]},"_EnvironmentModule1":{"Module1":["Callable"]},"ErrorRule0":{"Statement0":[],"AstNode0":[]},"_EvaluationContext1":{"EvaluationContext0":[]},"SassRuntimeException0":{"Exception":[]},"SassException0":{"Exception":[]},"MultiSpanSassException0":{"Exception":[]},"MultiSpanSassRuntimeException0":{"SassRuntimeException0":[],"Exception":[]},"SassFormatException0":{"SourceSpanFormatException":[],"FormatException":[],"Exception":[]},"MultiSpanSassFormatException0":{"MultiSourceSpanFormatException":[],"SassFormatException0":[],"SourceSpanFormatException":[],"FormatException":[],"Exception":[]},"Expression0":{"AstNode0":[]},"ExtendRule0":{"Statement0":[],"AstNode0":[]},"JSToDartFileImporter":{"Importer0":[],"AsyncImporter0":[]},"FilesystemImporter0":{"Importer0":[],"AsyncImporter0":[]},"ForRule0":{"Statement0":[],"AstNode0":[]},"ForwardRule0":{"Statement0":[],"AstNode0":[]},"ForwardedModuleView0":{"Module1":["1"]},"FunctionExpression0":{"Expression0":[],"AstNode0":[]},"SupportsFunction0":{"AstNode0":[]},"SassFunction0":{"Value0":[]},"FunctionRule0":{"Statement0":[],"AstNode0":[]},"IDSelector0":{"SimpleSelector0":[],"AstNode0":[]},"IfExpression0":{"Expression0":[],"AstNode0":[]},"IfClause0":{"IfRuleClause0":[]},"ElseClause0":{"IfRuleClause0":[]},"IfRule0":{"Statement0":[],"AstNode0":[]},"ModifiableCssImport0":{"ModifiableCssNode0":[],"CssNode0":[],"AstNode0":[]},"ImportRule0":{"Statement0":[],"AstNode0":[]},"Importer0":{"AsyncImporter0":[]},"IncludeRule0":{"Statement0":[],"AstNode0":[]},"InterpolatedFunctionExpression0":{"Expression0":[],"AstNode0":[]},"Interpolation0":{"AstNode0":[]},"SupportsInterpolation0":{"AstNode0":[]},"ModifiableCssKeyframeBlock0":{"ModifiableCssParentNode0":[],"ModifiableCssNode0":[],"CssParentNode0":[],"CssNode0":[],"AstNode0":[]},"LazyFileSpan0":{"FileSpan":[],"SourceSpanWithContext":[],"SourceSpan":[],"Comparable":["SourceSpan"]},"LimitedMapView0":{"MapBase":["1","2"],"Map":["1","2"],"MapBase.V":"2","MapBase.K":"1"},"ListExpression0":{"Expression0":[],"AstNode0":[]},"SelectorList0":{"AstNode0":[]},"_ParentSelectorVisitor0":{"SelectorSearchVisitor0":["ParentSelector0"],"SelectorSearchVisitor0.T":"ParentSelector0"},"SassList0":{"Value0":[]},"LoudComment0":{"Statement0":[],"AstNode0":[]},"MapExpression0":{"Expression0":[],"AstNode0":[]},"SassMap0":{"Value0":[]},"ModifiableCssMediaRule0":{"ModifiableCssParentNode0":[],"ModifiableCssNode0":[],"CssParentNode0":[],"CssNode0":[],"AstNode0":[]},"MediaRule0":{"Statement0":[],"AstNode0":[]},"MergedExtension0":{"Extension0":[]},"MergedMapView0":{"MapBase":["1","2"],"Map":["1","2"],"MapBase.V":"2","MapBase.K":"1"},"SassMixin0":{"Value0":[]},"MixinRule0":{"Statement0":[],"AstNode0":[]},"_HasContentVisitor0":{"StatementSearchVisitor0":["bool"],"StatementSearchVisitor0.T":"bool"},"MultiSpan0":{"FileSpan":[],"SourceSpanWithContext":[],"SourceSpan":[],"Comparable":["SourceSpan"]},"SupportsNegation0":{"AstNode0":[]},"NoOpImporter0":{"Importer0":[],"AsyncImporter0":[]},"_FakeAstNode0":{"AstNode0":[]},"CssNode0":{"AstNode0":[]},"CssParentNode0":{"CssNode0":[],"AstNode0":[]},"ModifiableCssNode0":{"CssNode0":[],"AstNode0":[]},"ModifiableCssParentNode0":{"ModifiableCssNode0":[],"CssParentNode0":[],"CssNode0":[],"AstNode0":[]},"NodePackageImporter0":{"Importer0":[],"AsyncImporter0":[]},"NullExpression0":{"Expression0":[],"AstNode0":[]},"_SassNull0":{"Value0":[]},"NumberExpression0":{"Expression0":[],"AstNode0":[]},"SassNumber0":{"Value0":[]},"SupportsOperation0":{"AstNode0":[]},"ParentSelector0":{"SimpleSelector0":[],"AstNode0":[]},"ParentStatement0":{"Statement0":[],"AstNode0":[]},"ParenthesizedExpression0":{"Expression0":[],"AstNode0":[]},"PlaceholderSelector0":{"SimpleSelector0":[],"AstNode0":[]},"PlainCssCallable0":{"Callable":[],"AsyncCallable0":[]},"PrefixedMapView0":{"MapBase":["String","1"],"Map":["String","1"],"MapBase.V":"1","MapBase.K":"String"},"_PrefixedKeys0":{"Iterable":["String"],"Iterable.E":"String"},"PseudoSelector0":{"SimpleSelector0":[],"AstNode0":[]},"PublicMemberMapView0":{"MapBase":["String","1"],"Map":["String","1"],"MapBase.V":"1","MapBase.K":"String"},"ReturnRule0":{"Statement0":[],"AstNode0":[]},"Selector0":{"AstNode0":[]},"SelectorExpression0":{"Expression0":[],"AstNode0":[]},"ShadowedModuleView0":{"Module1":["1"]},"SilentComment0":{"Statement0":[],"AstNode0":[]},"SimpleSelector0":{"AstNode0":[]},"SingleUnitSassNumber0":{"SassNumber0":[],"Value0":[]},"StaticImport0":{"Import0":[],"AstNode0":[]},"StringExpression0":{"Expression0":[],"AstNode0":[]},"SassString0":{"Value0":[]},"ModifiableCssStyleRule0":{"ModifiableCssParentNode0":[],"ModifiableCssNode0":[],"CssParentNode0":[],"CssNode0":[],"AstNode0":[]},"StyleRule0":{"Statement0":[],"AstNode0":[]},"CssStylesheet0":{"CssParentNode0":[],"CssNode0":[],"AstNode0":[]},"ModifiableCssStylesheet0":{"ModifiableCssParentNode0":[],"CssStylesheet0":[],"ModifiableCssNode0":[],"CssParentNode0":[],"CssNode0":[],"AstNode0":[]},"Stylesheet0":{"Statement0":[],"AstNode0":[]},"SupportsExpression0":{"Expression0":[],"AstNode0":[]},"ModifiableCssSupportsRule0":{"ModifiableCssParentNode0":[],"ModifiableCssNode0":[],"CssParentNode0":[],"CssNode0":[],"AstNode0":[]},"SupportsRule0":{"Statement0":[],"AstNode0":[]},"JSToDartImporter":{"Importer0":[],"AsyncImporter0":[]},"TypeSelector0":{"SimpleSelector0":[],"AstNode0":[]},"UnaryOperationExpression0":{"Expression0":[],"AstNode0":[]},"UnitlessSassNumber0":{"SassNumber0":[],"Value0":[]},"UniversalSelector0":{"SimpleSelector0":[],"AstNode0":[]},"UnprefixedMapView0":{"MapBase":["String","1"],"Map":["String","1"],"MapBase.V":"1","MapBase.K":"String"},"_UnprefixedKeys0":{"Iterable":["String"],"Iterable.E":"String"},"UseRule0":{"Statement0":[],"AstNode0":[]},"UserDefinedCallable0":{"Callable":[],"AsyncCallable0":[]},"CssValue0":{"AstNode0":[]},"ValueExpression0":{"Expression0":[],"AstNode0":[]},"VariableExpression0":{"Expression0":[],"AstNode0":[]},"VariableDeclaration0":{"Statement0":[],"AstNode0":[]},"WarnRule0":{"Statement0":[],"AstNode0":[]},"WhileRule0":{"Statement0":[],"AstNode0":[]},"Int8List":{"List":["int"],"EfficientLengthIterable":["int"],"Iterable":["int"]},"Uint8List":{"List":["int"],"EfficientLengthIterable":["int"],"Iterable":["int"]},"Uint8ClampedList":{"List":["int"],"EfficientLengthIterable":["int"],"Iterable":["int"]},"Int16List":{"List":["int"],"EfficientLengthIterable":["int"],"Iterable":["int"]},"Uint16List":{"List":["int"],"EfficientLengthIterable":["int"],"Iterable":["int"]},"Int32List":{"List":["int"],"EfficientLengthIterable":["int"],"Iterable":["int"]},"Uint32List":{"List":["int"],"EfficientLengthIterable":["int"],"Iterable":["int"]},"Float32List":{"List":["double"],"EfficientLengthIterable":["double"],"Iterable":["double"]},"Float64List":{"List":["double"],"EfficientLengthIterable":["double"],"Iterable":["double"]},"CssComment":{"CssNode":[],"AstNode":[]},"Import":{"AstNode":[]},"Statement":{"AstNode":[]},"Callable0":{"AsyncCallable":[]},"Callable":{"AsyncCallable0":[]},"CssComment0":{"CssNode0":[],"AstNode0":[]},"Import0":{"AstNode0":[]},"Statement0":{"AstNode0":[]}}')); + A._Universe_addErasedTypes(init.typeUniverse, JSON.parse('{"WhereIterator":1,"SkipIterator":1,"SkipWhileIterator":1,"EmptyIterator":1,"FollowedByIterator":1,"FixedLengthListMixin":1,"UnmodifiableListMixin":1,"UnmodifiableListBase":1,"__CastListBase__CastIterableBase_ListMixin":2,"ConstantSet":1,"LinkedHashMapKeyIterator":1,"NativeTypedArray":1,"EventSink":1,"_SyncStarIterator":1,"_SyncStreamControllerDispatch":1,"_AsyncStreamControllerDispatch":1,"_AddStreamState":1,"_StreamControllerAddStreamState":1,"_DelayedEvent":1,"_DelayedData":1,"_PendingEvents":1,"_StreamIterator":1,"_ZoneFunction":1,"Queue":1,"UnmodifiableMapBase":2,"_UnmodifiableMapMixin":2,"MapView":2,"_UnmodifiableSetMixin":1,"_UnmodifiableMapView_MapView__UnmodifiableMapMixin":2,"_UnmodifiableSetView_SetBase__UnmodifiableSetMixin":1,"_StringSinkConversionSink":1,"Expando":1,"_EventRequest":1,"_EmptyUnmodifiableSet_IterableBase_UnmodifiableSetMixin":1,"DefaultEquality":1,"IterableEquality":1,"ListEquality":1,"_QueueList_Object_ListMixin":1,"_UnionSet_SetBase_UnmodifiableSetMixin":1,"UnmodifiableSetMixin":1,"_UnmodifiableSetView_DelegatingSet_UnmodifiableSetMixin":1,"_DelegatingIterableBase":1,"_MapKeySet__DelegatingIterableBase_UnmodifiableSetMixin":1,"ParentStatement":1,"ParentStatement0":1}')); + var string$ = { + x0a_BUG_: "\n\nBUG: This should include a source span!", + x0a_Morex20: "\n\nMore info and automated migrator: https://sass-lang.com/d/slash-div", + x0a_Morex3a: "\n\nMore info: https://sass-lang.com/d/function-units", + x0a_See_: "\n\nSee https://sass-lang.com/d/function-units", + x0a_This: "\n\nThis is only an error because you've set the ", + x0a_To_p: "\n\nTo preserve current behavior: math.random(math.div($limit, 1", + x0a_but_: "\n\nbut you may have intended it to mean:\n\n ", + x0aRun_i: "\nRun in verbose mode to see all warnings.", + x0aThis_: "\nThis will be an error in Dart Sass 2.0.0.\n\nMore info: https://sass-lang.com/d/bogus-combinators", + x0aYou_m: "\nYou may not @extend the same selector from within different media queries.", + x20It_wi: " It will be omitted from the generated CSS.", + x20be_an: " be an extender.\nThis will be an error in Dart Sass 2.0.0.\n\nMore info: https://sass-lang.com/d/bogus-combinators", + x20can_n: " can not have both conditions and paths at the same level.\nFound ", + x20depre: " deprecation to be fatal.\nRemove this setting if you need to keep using this feature.", + x20in_in: " in interpolation here.\nIt may end up represented as ", + x20is_as: " is asynchronous.\nThis is probably caused by a bug in a Sass plugin.", + x20is_av: " is available from multiple global modules.", + x20is_de: " is deprecated.\n\nTo preserve current behavior: ", + x20is_noa: " is not a valid selector: it must be a string,\na list of strings, or a list of lists of strings.", + x20is_nov: " is not valid CSS.\nThis will be an error in Dart Sass 2.0.0.\n\nMore info: https://sass-lang.com/d/bogus-combinators", + x20must_b: " must be either nearest, up, down or to-zero.", + x20must_n: " must not be greater than the number of characters in the file, ", + x20repet: " repetitive deprecation warnings omitted.", + x20targe: " targetLocations if the interpolation has ", + x20to_cl: " to clarify that it's meant to be a binary operation, or wrap\nit in parentheses to make it a unary operation. This will be an error in future\nversions of Sass.\n\nMore info and automated migrator: https://sass-lang.com/d/strict-unary", + x20to_co: " to color.opacity() is deprecated.\n\nRecommendation: ", + x20was_a: ' was already loaded, so it can\'t be configured using "with".', + x20was_n: " was not declared with !default in the @used module.", + x20was_p: " was passed both by position and by name.", + x21defau: "!default should only be written once for each variable.\nThis will be an error in Dart Sass 2.0.0.", + x21globai: "!global isn't allowed for variables in other modules.", + x21globas: "!global should only be written once for each variable.\nThis will be an error in Dart Sass 2.0.0.", + x22x20can_: "\" can't be used as a parent in a compound selector.", + x22x20is_ix0a: '" is invalid CSS.\nThis will be an error in Dart Sass 2.0.0.\n\nMore info: https://sass-lang.com/d/bogus-combinators', + x22x20is_ix20: '" is invalid CSS. It will be omitted from the generated CSS.\nThis will be an error in Dart Sass 2.0.0.\n\nMore info: https://sass-lang.com/d/bogus-combinators', + x22x20is_n: '" is not a valid Sass identifier.\n\nRecommendation: add an "as" clause to define an explicit namespace.', + x22x20is_o: "\" is only valid for nesting and shouldn't\nhave children other than style rules.", + x22x26__ma: '"&" may only used at the beginning of a compound selector.', + x22x29__If: "\").\nIf you really want to use the color value here, use '", + x22x2b__an: '"+" and "-" must be surrounded by whitespace in calculations.', + x22packa: '"package:" URLs aren\'t supported on this platform.', + x24css_a: "$css and $module may not both be passed at once.", + x24list1: "$list1, $list2, $separator: auto, $bracketed: auto", + x24selec: "$selectors: At least one selector must be passed.", + x24separ: '$separator: Must be "space", "comma", "slash", or "auto".', + x27x20must: "' must be a path relative to the package root at '", + x27x2c_whi: "', which is not a '.scss', '.sass', or '.css' file.", + x28__isn: "() isn't in the sass:color module.\n\nRecommendation: color.adjust(", + x29x0a_Mor: ")\n\nMore info: https://sass-lang.com/documentation/functions/color#", + x29x20in_a: ") in a future release.\n\nRecommendation: math.random(math.div($limit, 1", + x29x20is_d: ") is deprecated.\n\nTo preserve current behavior: ", + x29x20to_cg: ") to color.grayscale() is deprecated.\n\nRecommendation: ", + x29x20to_ci: ") to color.invert() is deprecated.\n\nRecommendation: ", + x29x29__Mo: "))\n\nMore info: https://sass-lang.com/d/function-units", + x2c_whicu: ", which uses a scheme declared as non-canonical.", + x2c_whicw: ', which will likely produce invalid CSS.\nAlways quote color names when using them as strings or map keys (for example, "', + x2e_Rela: ".\nRelative canonical URLs are deprecated and will eventually be disallowed.", + x3d_____: "===== asynchronous gap ===========================\n", + x40_moz_: "@-moz-document is deprecated and support will be removed in Dart Sass 2.0.0.\n\nFor details, see https://sass-lang.com/d/moz-document.", + x40conte: "@content is only allowed within mixin declarations.", + x40elsei: "@elseif is deprecated and will not be supported in future Sass versions.\n\nRecommendation: @else if", + x40exten: "@extend may only be used within style rules.", + x40forwa: "@forward rules must be written before any other rules.", + x40funct: "@function if($condition, $if-true, $if-false) {", + x40use_r: "@use rules must be written before any other rules.", + A_list: "A list with more than one element must have an explicit separator.", + A_pkg_h: "A pkg: URL must not have a host, port, username or password.", + A_pkg_q: "A pkg: URL must not have a query or fragment.", + ABCDEF: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", + An_impa: "An importer may not have a findFileUrl method as well as canonicalize and load methods.", + An_impu: "An importer must have either canonicalize and load methods, or a findFileUrl method.", + As_of_R: "As of Dart Sass 2.0.0, !global assignments won't be able to declare new variables.\n\nRecommendation: add `", + As_of_S: "As of Dart Sass 2.0.0, !global assignments won't be able to declare new variables.\n\nSince this assignment is at the root of the stylesheet, the !global flag is\nunnecessary and can safely be removed.", + At_rul: "At-rules may not be used within nested declarations.", + Cannotff: "Cannot extract a file path from a URI with a fragment component", + Cannotfq: "Cannot extract a file path from a URI with a query component", + Cannotn: "Cannot extract a non-Windows file path from a file URI with an authority", + Comple: "ComplexSassNumber.hasPossiblyCompatibleUnits is not implemented.", + Could_: 'Could not find an option with short name "-', + CssNod: "CssNodes must have a CssStylesheet transitive parent node.", + Custom: "Custom importers are required to load stylesheets when compiling in the browser.", + Declarm: "Declarations may only be used within style rules.", + Declarw: 'Declarations whose names begin with "--" may not be nested.', + Either: "Either options.data or options.file must be set.", + Entrie: "Entries may not be removed from MergedMapView.", + Error_: "Error handler must accept one Object or one Object and a StackTrace as arguments, and return a value of the returned future's type", + Evalua: "Evaluation handles @include and its content block together.", + Expect: "Expected variable, mixin, or function name", + Functi: "Functions may not be declared in control directives.", + HSL_pa: "HSL parameters may not be passed along with HWB parameters.", + If_con: "If conditions is longer than one element, conjunction may not be null.", + If_par: "If parsedAsCustomProperty is true, value must contain a SassString (was `", + If_str: "If strategy is not null, step is required.", + In_Sas: 'In Sass, "&&" means two copies of the parent selector. You probably want to use "and" instead.', + Indent: "Indenting at the beginning of the document is illegal.", + Interpn: "Interpolation isn't allowed in namespaces.", + Interpp: "Interpolation isn't allowed in plain CSS.", + Invali: 'Invalid return value for custom function "', + It_s_n: "It's not clear which file to import. Found:\n", + Keywor: "Keyword arguments can't be used with calculations.", + May_on: "May only contains Strings or Expressions.", + Media_: "Media rules may not be used within nested declarations.", + Mixinsb: "Mixins may not be declared in control directives.", + Mixinscf: "Mixins may not contain function declarations.", + Mixinscm: "Mixins may not contain mixin declarations.", + Modulel: "Module loop: this module is already being loaded.", + Modulen: "Module namespaces aren't allowed in plain CSS.", + Nested: "Nested declarations aren't allowed in plain CSS.", + New_en: "New entries may not be added to MergedMapView.", + No_Sasc: "No Sass callable is currently being evaluated.", + No_Sass: "No Sass stylesheet is currently being evaluated.", + NoSour: "NoSourceMapBuffer.buildSourceMap() is not supported.", + None_o: "None of the patterns in the switch expression the matched input value. See https://github.com/dart-lang/language/issues/3488 for details.", + Number: "Number to round and step arguments are required.", + Only_2: "Only 2 slash-separated elements allowed, but ", + Only_oa: "Only one argument may be passed to the plain-CSS invert() function.", + Only_op: "Only one positional argument is allowed. All other arguments must be passed by name.", + Other_: "Other modules' members can't be defined with !global.", + Passina: "Passing a string to call() is deprecated and will be illegal in Dart Sass 2.0.0.\n\nRecommendation: call(get-function(", + Passinp: "Passing percentage units to the global abs() function is deprecated.\nIn the future, this will emit a CSS abs() function to be resolved by the browser.\nTo preserve current behavior: math.abs(", + Placeh: "Placeholder selectors aren't allowed here.", + Plain_: "Plain CSS functions don't support keyword arguments.", + Positi: "Positional arguments must come before keyword arguments.", + Privat: "Private members can't be accessed from outside their modules.", + RGB_pa: "RGB parameters may not be passed along with ", + Rest_a: "Rest arguments can't be used with calculations.", + Sass__: "Sass @import rules will be deprecated in the future.\nRemove the --future-deprecation=import flag to silence this warning for now.", + Sass_v: "Sass variables aren't allowed in plain CSS.", + Silent: "Silent comments aren't allowed in plain CSS.", + Style_: "Style rules may not be used within nested declarations.", + Suppor: "Supports rules may not be used within nested declarations.", + The_Ex: "The ExtensionStore and CssStylesheet passed to cloneCssStylesheet() must come from the same compilation.", + The_No: "The Node package importer cannot be used without a filesystem.", + The_ca: "The canonicalize() method must return a URL.", + The_fie: "The findFileUrl() method must return a URL.", + The_fiu: 'The findFileUrl() must return a URL with scheme file://, was "', + The_gi: "The given LineScannerState was not returned by this LineScanner.", + The_lo: "The load() function must return an object with contents and syntax fields.", + The_pa: "The parent selector isn't allowed in plain CSS.", + The_sa: "The same variable may only be configured once.", + The_ta: 'The target selector was not found.\nUse "@extend ', + There_: "There's already a module with namespace \"", + This_d: 'This declaration has no argument named "$', + This_e: "This expression can't be used in a calculation.", + This_f: "This function isn't allowed in plain CSS.", + This_ma: 'This module and the new module both define a variable named "$', + This_mw: 'This module was already loaded, so it can\'t be configured using "with".', + This_o: "This operation can't be used in a calculation.", + This_s: "This selector doesn't have any properties and won't be rendered.", + This_v: "This variable was not declared with !default in the @used module.", + Top_le: 'Top-level selectors may not contain the parent selector "&".', + Unable: "Unable to determine which of multiple potential resolutions found for ", + Unexpe: "Unexpected Zone.current[#_containingUrl] value ", + Using__i: "Using / for division is deprecated and will be removed in Dart Sass 2.0.0.\n\nRecommendation: ", + Using__o: "Using / for division outside of calc() is deprecated and will be removed in Dart Sass 2.0.0.\n\nRecommendation: ", + Using_c: "Using color.alpha() for a Microsoft filter is deprecated.\n\nRecommendation: ", + Variab_: "Variable keyword argument map must have string keys.\n", + Variabs: "Variable keyword arguments must be a map (was ", + You_ma: "You may not @extend selectors across media queries.", + You_pr: "You probably don't mean to use the color value ", + x60_inst: "` instead.\nSee https://sass-lang.com/d/extend-compound for details.\n", + addExt: "addExtensions() can't be called for a const ExtensionStore.", + compou: "compound selectors may no longer be extended.\nConsider `@extend ", + contai: "containingUrl may only be accessed within a call to canonicalize().", + conten: "content-exists() may only be called within a mixin.", + fileEx: "fileExists() is only supported on Node.js", + leadin: "leadingCombinators and components may not both be empty.", + math_d: "math.div() will only support number arguments in a future release.\nUse list.slash() instead for a slash separator.", + math_r: "math.random() will no longer ignore $limit units (", + must_b: "must be a UniversalSelector or a TypeSelector", + parsed: 'parsedAsCustomProperty must be false if name doesn\'t begin with "--".', + semico: "semicolons aren't allowed in the indented syntax.", + throug: "through() must return false for at least one parent of ", + x7d__Mor: "})\nMore info: https://sass-lang.com/d/abs-percent" + }; + var type$ = (function rtii() { + var findType = A.findType; + return { + $env_1_1_String: findType("@"), + ArgParser: findType("ArgParser"), + Argument: findType("Argument"), + ArgumentDeclaration: findType("ArgumentDeclaration"), + ArgumentDeclaration_2: findType("ArgumentDeclaration0"), + Argument_2: findType("Argument0"), + AstNode: findType("AstNode"), + AstNode_2: findType("AstNode0"), + AsyncBuiltInCallable: findType("AsyncBuiltInCallable"), + AsyncBuiltInCallable_2: findType("AsyncBuiltInCallable0"), + AsyncCallable: findType("AsyncCallable"), + AsyncCallable_2: findType("AsyncCallable0"), + AsyncCompiler: findType("AsyncCompiler"), + AsyncImporter: findType("AsyncImporter0"), + Box_SelectorList: findType("Box"), + Box_SelectorList_2: findType("Box0"), + BuiltInCallable: findType("BuiltInCallable"), + BuiltInCallable_2: findType("BuiltInCallable0"), + BuiltInModule_AsyncCallable: findType("BuiltInModule"), + BuiltInModule_AsyncCallable_2: findType("BuiltInModule0"), + BuiltInModule_Callable: findType("BuiltInModule"), + BuiltInModule_Callable_2: findType("BuiltInModule0"), + ByteBuffer: findType("ByteBuffer"), + ByteData: findType("ByteData"), + Callable: findType("Callable0"), + Callable_2: findType("Callable"), + ChangeType: findType("ChangeType"), + CodeUnits: findType("CodeUnits"), + Combinator: findType("Combinator"), + Combinator_2: findType("Combinator0"), + Comparable_dynamic: findType("Comparable<@>"), + Comparable_nullable_Object: findType("Comparable"), + CompileResult: findType("CompileResult"), + CompileResult_2: findType("CompileResult0"), + ComplexSelector: findType("ComplexSelector"), + ComplexSelectorComponent: findType("ComplexSelectorComponent"), + ComplexSelectorComponent_2: findType("ComplexSelectorComponent0"), + ComplexSelector_2: findType("ComplexSelector0"), + Configuration: findType("Configuration"), + Configuration_2: findType("Configuration0"), + ConfiguredValue: findType("ConfiguredValue"), + ConfiguredValue_2: findType("ConfiguredValue0"), + ConfiguredVariable: findType("ConfiguredVariable"), + ConfiguredVariable_2: findType("ConfiguredVariable0"), + ConstantMapView_Symbol_dynamic: findType("ConstantMapView"), + ConstantStringMap_String_double: findType("ConstantStringMap"), + ConstantStringSet_String: findType("ConstantStringSet"), + CssComment: findType("CssComment"), + CssComment_2: findType("CssComment0"), + CssMediaQuery: findType("CssMediaQuery"), + CssMediaQuery_2: findType("CssMediaQuery0"), + CssParentNode: findType("CssParentNode"), + CssParentNode_2: findType("CssParentNode0"), + CssStylesheet: findType("CssStylesheet"), + CssStylesheet_2: findType("CssStylesheet0"), + CssValue_Combinator: findType("CssValue"), + CssValue_Combinator_2: findType("CssValue0"), + CssValue_List_String: findType("CssValue>"), + CssValue_List_String_2: findType("CssValue0>"), + CssValue_String: findType("CssValue"), + CssValue_String_2: findType("CssValue0"), + CssValue_Value: findType("CssValue"), + CssValue_Value_2: findType("CssValue0"), + DateTime: findType("DateTime"), + Deprecation: findType("Deprecation"), + Deprecation_2: findType("Deprecation0"), + EfficientLengthIterable_dynamic: findType("EfficientLengthIterable<@>"), + Error: findType("Error"), + EvaluationContext: findType("EvaluationContext"), + EvaluationContext_2: findType("EvaluationContext0"), + Exception: findType("Exception"), + Expression: findType("Expression"), + Expression_2: findType("Expression0"), + Extender: findType("Extender"), + Extender_2: findType("Extender0"), + Extension: findType("Extension"), + Extension_2: findType("Extension0"), + FileLocation: findType("FileLocation"), + FileSpan: findType("FileSpan"), + Float32List: findType("Float32List"), + Float64List: findType("Float64List"), + FormatException: findType("FormatException"), + Frame: findType("Frame"), + Function: findType("Function"), + FutureGroup_void: findType("FutureGroup<~>"), + FutureOr_Record_2_Set_Uri_loadedUrls_and_CssStylesheet_stylesheet: findType("+loadedUrls,stylesheet(Set,CssStylesheet)/"), + FutureOr_Record_2_Set_Uri_loadedUrls_and_CssStylesheet_stylesheet_2: findType("+loadedUrls,stylesheet(Set,CssStylesheet0)/"), + FutureOr_nullable_Uri: findType("Uri?/"), + Future_Record_2_Set_Uri_loadedUrls_and_CssStylesheet_stylesheet: findType("Future<+loadedUrls,stylesheet(Set,CssStylesheet)>"), + Future_Record_2_Set_Uri_loadedUrls_and_CssStylesheet_stylesheet_2: findType("Future<+loadedUrls,stylesheet(Set,CssStylesheet0)>"), + Future_Value: findType("Future"), + Future_Value_2: findType("Future"), + Future_nullable_CssValue_String: findType("Future?>"), + Future_nullable_CssValue_String_2: findType("Future?>"), + Future_nullable_ImporterResult: findType("Future"), + Future_nullable_Uri: findType("Future"), + Future_nullable_Value: findType("Future"), + Future_nullable_Value_2: findType("Future"), + Future_void: findType("Future<~>"), + IfClause: findType("IfClause"), + IfClause_2: findType("IfClause0"), + ImmutableList: findType("ImmutableList0"), + ImmutableList_2: findType("ImmutableList"), + ImmutableMap: findType("ImmutableMap0"), + Import: findType("Import"), + Import_2: findType("Import0"), + Importer: findType("Importer0"), + ImporterResult: findType("ImporterResult"), + ImporterResult_2: findType("ImporterResult0"), + Int16List: findType("Int16List"), + Int32List: findType("Int32List"), + Int8List: findType("Int8List"), + Interpolation: findType("Interpolation"), + InterpolationBuffer: findType("InterpolationBuffer"), + InterpolationBuffer_2: findType("InterpolationBuffer0"), + Interpolation_2: findType("Interpolation0"), + Iterable_ComplexSelectorComponent: findType("Iterable"), + Iterable_ComplexSelectorComponent_2: findType("Iterable"), + Iterable_dynamic: findType("Iterable<@>"), + Iterable_nullable_Object: findType("Iterable"), + JSArray_Argument: findType("JSArray"), + JSArray_Argument_2: findType("JSArray"), + JSArray_AstNode: findType("JSArray"), + JSArray_AstNode_2: findType("JSArray"), + JSArray_AsyncBuiltInCallable: findType("JSArray"), + JSArray_AsyncBuiltInCallable_2: findType("JSArray"), + JSArray_AsyncCallable: findType("JSArray"), + JSArray_AsyncCallable_2: findType("JSArray"), + JSArray_AsyncImporter: findType("JSArray"), + JSArray_AsyncImporter_2: findType("JSArray"), + JSArray_BinaryOperator: findType("JSArray"), + JSArray_BinaryOperator_2: findType("JSArray"), + JSArray_BuiltInCallable: findType("JSArray"), + JSArray_BuiltInCallable_2: findType("JSArray"), + JSArray_Callable: findType("JSArray"), + JSArray_Callable_2: findType("JSArray"), + JSArray_ComplexSelector: findType("JSArray"), + JSArray_ComplexSelectorComponent: findType("JSArray"), + JSArray_ComplexSelectorComponent_2: findType("JSArray"), + JSArray_ComplexSelector_2: findType("JSArray"), + JSArray_ConfiguredVariable: findType("JSArray"), + JSArray_ConfiguredVariable_2: findType("JSArray"), + JSArray_CssComment: findType("JSArray"), + JSArray_CssComment_2: findType("JSArray"), + JSArray_CssMediaQuery: findType("JSArray"), + JSArray_CssMediaQuery_2: findType("JSArray"), + JSArray_CssNode: findType("JSArray"), + JSArray_CssNode_2: findType("JSArray"), + JSArray_CssValue_Combinator: findType("JSArray>"), + JSArray_CssValue_Combinator_2: findType("JSArray>"), + JSArray_Entry: findType("JSArray"), + JSArray_Expression: findType("JSArray"), + JSArray_Expression_2: findType("JSArray"), + JSArray_Extender: findType("JSArray"), + JSArray_Extender_2: findType("JSArray"), + JSArray_Extension: findType("JSArray"), + JSArray_ExtensionStore: findType("JSArray"), + JSArray_ExtensionStore_2: findType("JSArray"), + JSArray_Extension_2: findType("JSArray"), + JSArray_ForwardRule: findType("JSArray"), + JSArray_ForwardRule_2: findType("JSArray"), + JSArray_Frame: findType("JSArray"), + JSArray_Future_nullable_Record_3_int_and_String_and_nullable_String: findType("JSArray>"), + JSArray_IfClause: findType("JSArray"), + JSArray_IfClause_2: findType("JSArray"), + JSArray_Import: findType("JSArray"), + JSArray_Import_2: findType("JSArray"), + JSArray_Importer: findType("JSArray"), + JSArray_Importer_2: findType("JSArray"), + JSArray_Iterable_ComplexSelectorComponent: findType("JSArray>"), + JSArray_Iterable_ComplexSelectorComponent_2: findType("JSArray>"), + JSArray_JSFunction: findType("JSArray"), + JSArray_List_ComplexSelector: findType("JSArray>"), + JSArray_List_ComplexSelectorComponent: findType("JSArray>"), + JSArray_List_ComplexSelectorComponent_2: findType("JSArray>"), + JSArray_List_ComplexSelector_2: findType("JSArray>"), + JSArray_List_Extender: findType("JSArray>"), + JSArray_List_Extender_2: findType("JSArray>"), + JSArray_List_Iterable_ComplexSelectorComponent: findType("JSArray>>"), + JSArray_List_Iterable_ComplexSelectorComponent_2: findType("JSArray>>"), + JSArray_Map_String_AstNode: findType("JSArray>"), + JSArray_Map_String_AstNode_2: findType("JSArray>"), + JSArray_Map_String_AsyncCallable: findType("JSArray>"), + JSArray_Map_String_AsyncCallable_2: findType("JSArray>"), + JSArray_Map_String_Callable: findType("JSArray>"), + JSArray_Map_String_Callable_2: findType("JSArray>"), + JSArray_Map_String_Value: findType("JSArray>"), + JSArray_Map_String_Value_2: findType("JSArray>"), + JSArray_ModifiableCssImport: findType("JSArray"), + JSArray_ModifiableCssImport_2: findType("JSArray"), + JSArray_ModifiableCssNode: findType("JSArray"), + JSArray_ModifiableCssNode_2: findType("JSArray"), + JSArray_ModifiableCssParentNode: findType("JSArray"), + JSArray_ModifiableCssParentNode_2: findType("JSArray"), + JSArray_Module_AsyncCallable: findType("JSArray>"), + JSArray_Module_AsyncCallable_2: findType("JSArray>"), + JSArray_Module_Callable: findType("JSArray>"), + JSArray_Module_Callable_2: findType("JSArray>"), + JSArray_Object: findType("JSArray"), + JSArray_PseudoSelector: findType("JSArray"), + JSArray_PseudoSelector_2: findType("JSArray"), + JSArray_Record_2_ArgumentDeclaration_and_Value_Function_List_Value: findType("JSArray<+(ArgumentDeclaration,Value(List))>"), + JSArray_Record_2_ArgumentDeclaration_and_Value_Function_List_Value_2: findType("JSArray<+(ArgumentDeclaration0,Value0(List))>"), + JSArray_Record_2_Expression_and_Expression: findType("JSArray<+(Expression,Expression)>"), + JSArray_Record_2_Expression_and_Expression_2: findType("JSArray<+(Expression0,Expression0)>"), + JSArray_Record_2_String_and_AstNode: findType("JSArray<+(String,AstNode)>"), + JSArray_Record_2_String_and_AstNode_2: findType("JSArray<+(String,AstNode0)>"), + JSArray_SassList: findType("JSArray"), + JSArray_SassList_2: findType("JSArray"), + JSArray_SimpleSelector: findType("JSArray"), + JSArray_SimpleSelector_2: findType("JSArray"), + JSArray_SourceLocation: findType("JSArray"), + JSArray_Statement: findType("JSArray"), + JSArray_Statement_2: findType("JSArray"), + JSArray_String: findType("JSArray"), + JSArray_StylesheetNode: findType("JSArray"), + JSArray_TargetEntry: findType("JSArray"), + JSArray_TargetLineEntry: findType("JSArray"), + JSArray_Trace: findType("JSArray"), + JSArray_UseRule: findType("JSArray"), + JSArray_UseRule_2: findType("JSArray"), + JSArray_Value: findType("JSArray"), + JSArray_Value_2: findType("JSArray"), + JSArray_WatchEvent: findType("JSArray"), + JSArray__Highlight: findType("JSArray<_Highlight>"), + JSArray__Line: findType("JSArray<_Line>"), + JSArray_dynamic: findType("JSArray<@>"), + JSArray_int: findType("JSArray"), + JSArray_nullable_Record_3_int_and_String_and_nullable_String: findType("JSArray<+(int,String,String?)?>"), + JSArray_nullable_String: findType("JSArray"), + JSClass: findType("JSClass0"), + JSFunction: findType("JSFunction0"), + JSImporter: findType("JSImporter"), + JSImporterResult: findType("JSImporterResult"), + JSNull: findType("JSNull"), + JSUrl: findType("JSUrl0"), + JavaScriptFunction: findType("JavaScriptFunction"), + JavaScriptIndexingBehavior_dynamic: findType("JavaScriptIndexingBehavior<@>"), + JsIdentityLinkedHashMap_SimpleSelector_int: findType("JsIdentityLinkedHashMap"), + JsIdentityLinkedHashMap_SimpleSelector_int_2: findType("JsIdentityLinkedHashMap"), + JsIdentityLinkedHashMap_of_SelectorList_and_Box_SelectorList: findType("JsIdentityLinkedHashMap>"), + JsIdentityLinkedHashMap_of_SelectorList_and_Box_SelectorList_2: findType("JsIdentityLinkedHashMap>"), + JsLinkedHashMap_Symbol_dynamic: findType("JsLinkedHashMap"), + JsSystemError: findType("JsSystemError"), + LimitedMapView_String_ConfiguredValue: findType("LimitedMapView"), + LimitedMapView_String_ConfiguredValue_2: findType("LimitedMapView0"), + List_ComplexSelectorComponent: findType("List"), + List_ComplexSelectorComponent_2: findType("List"), + List_CssComment: findType("List"), + List_CssComment_2: findType("List"), + List_CssMediaQuery: findType("List"), + List_CssMediaQuery_2: findType("List"), + List_CssValue_Combinator: findType("List>"), + List_CssValue_Combinator_2: findType("List>"), + List_Extension: findType("List"), + List_ExtensionStore: findType("List"), + List_ExtensionStore_2: findType("List"), + List_Extension_2: findType("List"), + List_List_ComplexSelectorComponent: findType("List>"), + List_List_ComplexSelectorComponent_2: findType("List>"), + List_Module_AsyncCallable: findType("List>"), + List_Module_AsyncCallable_2: findType("List>"), + List_Module_Callable: findType("List>"), + List_Module_Callable_2: findType("List>"), + List_String: findType("List"), + List_Value: findType("List"), + List_Value_2: findType("List"), + List_WatchEvent: findType("List"), + List_dynamic: findType("List<@>"), + List_int: findType("List"), + List_nullable_Object: findType("List"), + MapKeySet_Module_AsyncCallable: findType("MapKeySet>"), + MapKeySet_Module_AsyncCallable_2: findType("MapKeySet>"), + MapKeySet_Module_Callable: findType("MapKeySet>"), + MapKeySet_Module_Callable_2: findType("MapKeySet>"), + MapKeySet_SimpleSelector: findType("MapKeySet"), + MapKeySet_SimpleSelector_2: findType("MapKeySet"), + MapKeySet_String: findType("MapKeySet"), + MapKeySet_nullable_Object: findType("MapKeySet"), + Map_ComplexSelector_Extension: findType("Map"), + Map_ComplexSelector_Extension_2: findType("Map"), + Map_String_AstNode: findType("Map"), + Map_String_AstNode_2: findType("Map"), + Map_String_AsyncCallable: findType("Map"), + Map_String_AsyncCallable_2: findType("Map"), + Map_String_Callable: findType("Map"), + Map_String_Callable_2: findType("Map"), + Map_String_Value: findType("Map"), + Map_String_Value_2: findType("Map"), + Map_String_dynamic: findType("Map"), + Map_dynamic_dynamic: findType("Map<@,@>"), + Map_of_nullable_Object_and_nullable_Object: findType("Map"), + MappedIterable_String_Frame: findType("MappedIterable"), + MappedListIterable_Frame_Frame: findType("MappedListIterable"), + MappedListIterable_String_Object: findType("MappedListIterable"), + MappedListIterable_String_String: findType("MappedListIterable"), + MappedListIterable_String_Trace: findType("MappedListIterable"), + MappedListIterable_String_Value: findType("MappedListIterable"), + MappedListIterable_String_Value_2: findType("MappedListIterable"), + MappedListIterable_String_dynamic: findType("MappedListIterable"), + MixinRule: findType("MixinRule"), + MixinRule_2: findType("MixinRule0"), + ModifiableBox_SelectorList: findType("ModifiableBox"), + ModifiableBox_SelectorList_2: findType("ModifiableBox0"), + ModifiableCssAtRule: findType("ModifiableCssAtRule"), + ModifiableCssAtRule_2: findType("ModifiableCssAtRule0"), + ModifiableCssKeyframeBlock: findType("ModifiableCssKeyframeBlock"), + ModifiableCssKeyframeBlock_2: findType("ModifiableCssKeyframeBlock0"), + ModifiableCssMediaRule: findType("ModifiableCssMediaRule"), + ModifiableCssMediaRule_2: findType("ModifiableCssMediaRule0"), + ModifiableCssNode: findType("ModifiableCssNode"), + ModifiableCssNode_2: findType("ModifiableCssNode0"), + ModifiableCssParentNode: findType("ModifiableCssParentNode"), + ModifiableCssParentNode_2: findType("ModifiableCssParentNode0"), + ModifiableCssStyleRule: findType("ModifiableCssStyleRule"), + ModifiableCssStyleRule_2: findType("ModifiableCssStyleRule0"), + ModifiableCssSupportsRule: findType("ModifiableCssSupportsRule"), + ModifiableCssSupportsRule_2: findType("ModifiableCssSupportsRule0"), + Module_AsyncCallable: findType("Module0"), + Module_AsyncCallable_2: findType("Module1"), + Module_Callable: findType("Module0"), + Module_Callable_2: findType("Module1"), + MultiSourceSpanFormatException: findType("MultiSourceSpanFormatException"), + NativeTypedArrayOfDouble: findType("NativeTypedArrayOfDouble"), + NativeTypedArrayOfInt: findType("NativeTypedArrayOfInt"), + NativeUint8List: findType("NativeUint8List"), + Never: findType("0&"), + NodeCompileResult: findType("NodeCompileResult"), + NodeImporterResult: findType("NodeImporterResult0"), + Null: findType("Null"), + Object: findType("Object"), + Option: findType("Option"), + PathMap_ChangeType: findType("PathMap"), + PathMap_Stream_WatchEvent: findType("PathMap>"), + PathMap_String: findType("PathMap"), + PathMap_nullable_String: findType("PathMap"), + Promise: findType("Promise"), + PseudoSelector: findType("PseudoSelector"), + PseudoSelector_2: findType("PseudoSelector0"), + RangeError: findType("RangeError"), + Record: findType("Record"), + Record_0: findType("+()"), + Record_2_Expression_and_Expression: findType("+(Expression,Expression)"), + Record_2_Expression_and_Expression_2: findType("+(Expression0,Expression0)"), + Record_2_List_Expression_and_Map_String_Expression: findType("+(List,Map)"), + Record_2_List_Expression_and_Map_String_Expression_2: findType("+(List,Map)"), + Record_2_Set_Uri_loadedUrls_and_CssStylesheet_stylesheet: findType("+loadedUrls,stylesheet(Set,CssStylesheet)"), + Record_2_Set_Uri_loadedUrls_and_CssStylesheet_stylesheet_2: findType("+loadedUrls,stylesheet(Set,CssStylesheet0)"), + Record_2_String_and_InterpolationMap: findType("+(String,InterpolationMap)"), + Record_2_String_and_InterpolationMap_2: findType("+(String,InterpolationMap0)"), + Record_2_String_and_SourceSpan: findType("+(String,SourceSpan)"), + Record_2_String_and_nullable_InterpolationMap: findType("+(String,InterpolationMap?)"), + Record_2_String_and_nullable_InterpolationMap_2: findType("+(String,InterpolationMap0?)"), + Record_2_Uri_and_bool_forImport: findType("+forImport(Uri,bool)"), + Record_2_nullable_Object_and_nullable_Object: findType("+(Object?,Object?)"), + Record_2_nullable_String_and_nullable_String: findType("+(String?,String?)"), + Record_3_AsyncImporter_and_Uri_and_Uri_originalUrl: findType("+originalUrl(AsyncImporter,Uri,Uri)"), + Record_3_AsyncImporter_and_Uri_and_Uri_originalUrl_2: findType("+originalUrl(AsyncImporter0,Uri,Uri)"), + Record_3_Importer_and_Uri_and_Uri_originalUrl: findType("+originalUrl(Importer,Uri,Uri)"), + Record_3_Importer_and_Uri_and_Uri_originalUrl_2: findType("+originalUrl(Importer0,Uri,Uri)"), + Record_3_Stylesheet_and_nullable_AsyncImporter_importer_and_bool_isDependency: findType("+importer,isDependency(Stylesheet,AsyncImporter?,bool)"), + Record_3_Stylesheet_and_nullable_AsyncImporter_importer_and_bool_isDependency_2: findType("+importer,isDependency(Stylesheet0,AsyncImporter0?,bool)"), + Record_3_nullable_Object_and_nullable_Object_and_nullable_Object_originalUrl: findType("+originalUrl(Object?,Object?,Object?)"), + Record_4_Uri_and_AsyncImporter_baseImporter_and_nullable_Uri_baseUrl_and_bool_forImport: findType("+baseImporter,baseUrl,forImport(Uri,AsyncImporter,Uri?,bool)"), + Record_4_Uri_and_AsyncImporter_baseImporter_and_nullable_Uri_baseUrl_and_bool_forImport_2: findType("+baseImporter,baseUrl,forImport(Uri,AsyncImporter0,Uri?,bool)"), + Record_4_Uri_and_Importer_baseImporter_and_nullable_Uri_baseUrl_and_bool_forImport: findType("+baseImporter,baseUrl,forImport(Uri,Importer,Uri?,bool)"), + Record_4_Uri_and_Importer_baseImporter_and_nullable_Uri_baseUrl_and_bool_forImport_2: findType("+baseImporter,baseUrl,forImport(Uri,Importer0,Uri?,bool)"), + Record_5_Map_String_Value_named_and_Map_String_AstNode_namedNodes_and_List_Value_positional_and_List_AstNode_positionalNodes_and_ListSeparator_separator: findType("+named,namedNodes,positional,positionalNodes,separator(Map,Map,List,List,ListSeparator)"), + Record_5_Map_String_Value_named_and_Map_String_AstNode_namedNodes_and_List_Value_positional_and_List_AstNode_positionalNodes_and_ListSeparator_separator_2: findType("+named,namedNodes,positional,positionalNodes,separator(Map,Map,List,List,ListSeparator0)"), + RegExpMatch: findType("RegExpMatch"), + RenderContextOptions: findType("RenderContextOptions0"), + RenderResult: findType("RenderResult"), + Result_String: findType("Result"), + ReversedListIterable_Frame: findType("ReversedListIterable"), + Runes: findType("Runes"), + SassArgumentList: findType("SassArgumentList"), + SassArgumentList_2: findType("SassArgumentList0"), + SassBoolean: findType("SassBoolean"), + SassBoolean_2: findType("SassBoolean0"), + SassColor: findType("SassColor"), + SassColor_2: findType("SassColor0"), + SassFormatException: findType("SassFormatException"), + SassFormatException_2: findType("SassFormatException0"), + SassList: findType("SassList"), + SassList_2: findType("SassList0"), + SassMap: findType("SassMap"), + SassMap_2: findType("SassMap0"), + SassNumber: findType("SassNumber"), + SassNumber_2: findType("SassNumber0"), + SassRuntimeException: findType("SassRuntimeException"), + SassRuntimeException_2: findType("SassRuntimeException0"), + SassString: findType("SassString"), + SassString_2: findType("SassString0"), + SelectorList: findType("SelectorList"), + SelectorList_2: findType("SelectorList0"), + Set_ModifiableBox_SelectorList: findType("Set>"), + Set_ModifiableBox_SelectorList_2: findType("Set>"), + Set_Uri: findType("Set"), + SimpleSelector: findType("SimpleSelector"), + SimpleSelector_2: findType("SimpleSelector0"), + SourceFile: findType("SourceFile"), + SourceLocation: findType("SourceLocation"), + SourceSpan: findType("SourceSpan"), + SourceSpanFormatException: findType("SourceSpanFormatException"), + SourceSpanWithContext: findType("SourceSpanWithContext"), + StackTrace: findType("StackTrace"), + Statement: findType("Statement"), + Statement_2: findType("Statement0"), + StaticImport: findType("StaticImport"), + StaticImport_2: findType("StaticImport0"), + StreamCompleter_WatchEvent: findType("StreamCompleter"), + StreamGroup_WatchEvent: findType("StreamGroup"), + StreamQueue_String: findType("StreamQueue"), + Stream_WatchEvent: findType("Stream"), + String: findType("String"), + StringExpression: findType("StringExpression"), + StylesheetNode: findType("StylesheetNode"), + Timer: findType("Timer"), + Trace: findType("Trace"), + TrustedGetRuntimeType: findType("TrustedGetRuntimeType"), + TypeError: findType("TypeError"), + TypeSelector: findType("TypeSelector"), + TypeSelector_2: findType("TypeSelector0"), + Uint16List: findType("Uint16List"), + Uint32List: findType("Uint32List"), + Uint8ClampedList: findType("Uint8ClampedList"), + Uint8List: findType("Uint8List"), + UnionSet_Uri: findType("UnionSet"), + UnknownJavaScriptObject: findType("UnknownJavaScriptObject"), + UnmodifiableListView_CssComment: findType("UnmodifiableListView"), + UnmodifiableListView_CssComment_2: findType("UnmodifiableListView"), + UnmodifiableListView_CssNode: findType("UnmodifiableListView"), + UnmodifiableListView_CssNode_2: findType("UnmodifiableListView"), + UnmodifiableListView_ForwardRule: findType("UnmodifiableListView"), + UnmodifiableListView_ForwardRule_2: findType("UnmodifiableListView"), + UnmodifiableListView_ModifiableCssNode: findType("UnmodifiableListView"), + UnmodifiableListView_ModifiableCssNode_2: findType("UnmodifiableListView"), + UnmodifiableListView_String: findType("UnmodifiableListView"), + UnmodifiableListView_UseRule: findType("UnmodifiableListView"), + UnmodifiableListView_UseRule_2: findType("UnmodifiableListView"), + UnmodifiableMapView_String_ArgParser: findType("UnmodifiableMapView"), + UnmodifiableMapView_String_ConfiguredValue: findType("UnmodifiableMapView"), + UnmodifiableMapView_String_ConfiguredValue_2: findType("UnmodifiableMapView"), + UnmodifiableMapView_String_Option: findType("UnmodifiableMapView"), + UnmodifiableMapView_String_Value: findType("UnmodifiableMapView"), + UnmodifiableMapView_String_Value_2: findType("UnmodifiableMapView"), + UnmodifiableMapView_of_Uri_and_nullable_StylesheetNode: findType("UnmodifiableMapView"), + UnmodifiableMapView_of_nullable_String_and_String: findType("UnmodifiableMapView"), + UnmodifiableMapView_of_nullable_String_and_nullable_String: findType("UnmodifiableMapView"), + UnmodifiableSetView_String: findType("UnmodifiableSetView0"), + UnmodifiableSetView_StylesheetNode: findType("UnmodifiableSetView0"), + UnmodifiableSetView_Uri: findType("UnmodifiableSetView0"), + UnprefixedMapView_ConfiguredValue: findType("UnprefixedMapView"), + UnprefixedMapView_ConfiguredValue_2: findType("UnprefixedMapView0"), + Uri: findType("Uri"), + UseRule: findType("UseRule"), + UserDefinedCallable_AsyncEnvironment: findType("UserDefinedCallable"), + UserDefinedCallable_AsyncEnvironment_2: findType("UserDefinedCallable0"), + UserDefinedCallable_Environment: findType("UserDefinedCallable"), + UserDefinedCallable_Environment_2: findType("UserDefinedCallable0"), + Value: findType("Value"), + Value_2: findType("Value0"), + Value_Function_List_Value: findType("Value(List)"), + Value_Function_List_Value_2: findType("Value0(List)"), + VariableDeclaration: findType("VariableDeclaration"), + VariableDeclaration_2: findType("VariableDeclaration0"), + VersionRange: findType("VersionRange"), + WatchEvent: findType("WatchEvent"), + WhereIterable_List_Iterable_ComplexSelectorComponent: findType("WhereIterable>>"), + WhereIterable_List_Iterable_ComplexSelectorComponent_2: findType("WhereIterable>>"), + WhereIterable_String: findType("WhereIterable"), + WhereTypeIterable_PseudoSelector: findType("WhereTypeIterable"), + WhereTypeIterable_PseudoSelector_2: findType("WhereTypeIterable"), + WhereTypeIterable_String: findType("WhereTypeIterable"), + _AsyncCompleter_List_void: findType("_AsyncCompleter>"), + _AsyncCompleter_Object: findType("_AsyncCompleter"), + _AsyncCompleter_Stream_WatchEvent: findType("_AsyncCompleter>"), + _AsyncCompleter_String: findType("_AsyncCompleter"), + _AsyncCompleter_nullable_Object: findType("_AsyncCompleter"), + _CompleterStream_WatchEvent: findType("_CompleterStream"), + _EventRequest_dynamic: findType("_EventRequest<@>"), + _Future_List_void: findType("_Future>"), + _Future_Object: findType("_Future"), + _Future_Stream_WatchEvent: findType("_Future>"), + _Future_String: findType("_Future"), + _Future_Value: findType("_Future"), + _Future_Value_2: findType("_Future"), + _Future_bool: findType("_Future"), + _Future_dynamic: findType("_Future<@>"), + _Future_int: findType("_Future"), + _Future_nullable_Object: findType("_Future"), + _Future_void: findType("_Future<~>"), + _Highlight: findType("_Highlight"), + _IdentityHashMap_of_nullable_Object_and_nullable_Object: findType("_IdentityHashMap"), + _LinkedIdentityHashSet_ComplexSelector: findType("_LinkedIdentityHashSet"), + _LinkedIdentityHashSet_ComplexSelector_2: findType("_LinkedIdentityHashSet"), + _LinkedIdentityHashSet_Extension: findType("_LinkedIdentityHashSet"), + _LinkedIdentityHashSet_Extension_2: findType("_LinkedIdentityHashSet"), + _MapEntry: findType("_MapEntry"), + _NodeException: findType("_NodeException"), + _SyncStarIterable_Extension: findType("_SyncStarIterable"), + _SyncStarIterable_Extension_2: findType("_SyncStarIterable"), + _SyncStarIterable_SimpleSelector: findType("_SyncStarIterable"), + _SyncStarIterable_SimpleSelector_2: findType("_SyncStarIterable"), + _SyncStarIterable_String: findType("_SyncStarIterable"), + bool: findType("bool"), + double: findType("double"), + dynamic: findType("@"), + dynamic_Function: findType("@()"), + dynamic_Function_Object: findType("@(Object)"), + dynamic_Function_Object_StackTrace: findType("@(Object,StackTrace)"), + int: findType("int"), + legacy_Never: findType("0&*"), + legacy_Object: findType("Object*"), + nullable_AstNode: findType("AstNode?"), + nullable_AstNode_2: findType("AstNode0?"), + nullable_CssValue_String: findType("CssValue?"), + nullable_CssValue_String_2: findType("CssValue0?"), + nullable_Future_Null: findType("Future?"), + nullable_Future_void: findType("Future<~>?"), + nullable_ImporterResult: findType("ImporterResult?"), + nullable_ImporterResult_2: findType("ImporterResult0?"), + nullable_Object: findType("Object?"), + nullable_Record_2_String_and_String: findType("+(String,String)?"), + nullable_Record_3_AsyncImporter_and_Uri_and_Uri_originalUrl: findType("+originalUrl(AsyncImporter,Uri,Uri)?"), + nullable_Record_3_AsyncImporter_and_Uri_and_Uri_originalUrl_2: findType("+originalUrl(AsyncImporter0,Uri,Uri)?"), + nullable_Record_3_Importer_and_Uri_and_Uri_originalUrl: findType("+originalUrl(Importer,Uri,Uri)?"), + nullable_Record_3_Importer_and_Uri_and_Uri_originalUrl_2: findType("+originalUrl(Importer0,Uri,Uri)?"), + nullable_Record_3_Stylesheet_and_nullable_AsyncImporter_importer_and_bool_isDependency: findType("+importer,isDependency(Stylesheet0,AsyncImporter0?,bool)?"), + nullable_Record_3_int_and_String_and_nullable_String: findType("+(int,String,String?)?"), + nullable_SourceFile: findType("SourceFile?"), + nullable_SourceSpan: findType("SourceSpan?"), + nullable_StreamSubscription_WatchEvent: findType("StreamSubscription?"), + nullable_String: findType("String?"), + nullable_Stylesheet: findType("Stylesheet?"), + nullable_StylesheetNode: findType("StylesheetNode?"), + nullable_Stylesheet_2: findType("Stylesheet0?"), + nullable_Uri: findType("Uri?"), + nullable_Value: findType("Value?"), + nullable_Value_2: findType("Value0?"), + nullable__ConstructorOptions: findType("_ConstructorOptions?"), + nullable__ConstructorOptions_2: findType("_ConstructorOptions0?"), + nullable__ConstructorOptions_3: findType("_ConstructorOptions1?"), + nullable__Highlight: findType("_Highlight?"), + num: findType("num"), + void: findType("~"), + void_Function_Object: findType("~(Object)"), + void_Function_Object_StackTrace: findType("~(Object,StackTrace)") + }; + })(); + (function constants() { + var makeConstList = hunkHelpers.makeConstList; + B.Interceptor_methods = J.Interceptor.prototype; + B.JSArray_methods = J.JSArray.prototype; + B.JSInt_methods = J.JSInt.prototype; + B.JSNull_methods = J.JSNull.prototype; + B.JSNumber_methods = J.JSNumber.prototype; + B.JSString_methods = J.JSString.prototype; + B.JavaScriptFunction_methods = J.JavaScriptFunction.prototype; + B.JavaScriptObject_methods = J.JavaScriptObject.prototype; + B.NativeUint32List_methods = A.NativeUint32List.prototype; + B.NativeUint8List_methods = A.NativeUint8List.prototype; + B.PlainJavaScriptObject_methods = J.PlainJavaScriptObject.prototype; + B.UnknownJavaScriptObject_methods = J.UnknownJavaScriptObject.prototype; + B.AsciiEncoder_127 = new A.AsciiEncoder(127); + B.C_EmptyUnmodifiableSet1 = new A.EmptyUnmodifiableSet(A.findType("EmptyUnmodifiableSet")); + B.AtRootQuery_UsS = new A.AtRootQuery(false, B.C_EmptyUnmodifiableSet1, false, true); + B.AtRootQuery_UsS0 = new A.AtRootQuery0(false, B.C_EmptyUnmodifiableSet1, false, true); + B.AttributeOperator_8aB = new A.AttributeOperator("*=", "substring"); + B.AttributeOperator_8aB0 = new A.AttributeOperator0("*=", "substring"); + B.AttributeOperator_BGd = new A.AttributeOperator("$=", "suffix"); + B.AttributeOperator_BGd0 = new A.AttributeOperator0("$=", "suffix"); + B.AttributeOperator_ES6 = new A.AttributeOperator("=", "equal"); + B.AttributeOperator_ES60 = new A.AttributeOperator0("=", "equal"); + B.AttributeOperator_eot = new A.AttributeOperator("^=", "prefix"); + B.AttributeOperator_eot0 = new A.AttributeOperator0("^=", "prefix"); + B.AttributeOperator_ivT = new A.AttributeOperator("|=", "dash"); + B.AttributeOperator_ivT0 = new A.AttributeOperator0("|=", "dash"); + B.AttributeOperator_r60 = new A.AttributeOperator("~=", "include"); + B.AttributeOperator_r600 = new A.AttributeOperator0("~=", "include"); + B.BinaryOperator_2jN = new A.BinaryOperator("single equals", "=", 0, false, "singleEquals"); + B.BinaryOperator_2jN0 = new A.BinaryOperator0("single equals", "=", 0, false, "singleEquals"); + B.BinaryOperator_7Tg = new A.BinaryOperator("greater than or equals", ">=", 4, false, "greaterThanOrEquals"); + B.BinaryOperator_7Tg0 = new A.BinaryOperator0("greater than or equals", ">=", 4, false, "greaterThanOrEquals"); + B.BinaryOperator_M6L = new A.BinaryOperator("or", "or", 1, true, "or"); + B.BinaryOperator_M6L0 = new A.BinaryOperator0("or", "or", 1, true, "or"); + B.BinaryOperator_OTG = new A.BinaryOperator("modulo", "%", 6, false, "modulo"); + B.BinaryOperator_OTG0 = new A.BinaryOperator0("modulo", "%", 6, false, "modulo"); + B.BinaryOperator_SNp = new A.BinaryOperator("and", "and", 2, true, "and"); + B.BinaryOperator_SNp0 = new A.BinaryOperator0("and", "and", 2, true, "and"); + B.BinaryOperator_U8c = new A.BinaryOperator("less than", "<", 4, false, "lessThan"); + B.BinaryOperator_U8c0 = new A.BinaryOperator0("less than", "<", 4, false, "lessThan"); + B.BinaryOperator_ViB = new A.BinaryOperator("not equals", "!=", 3, false, "notEquals"); + B.BinaryOperator_ViB0 = new A.BinaryOperator0("not equals", "!=", 3, false, "notEquals"); + B.BinaryOperator_anB = new A.BinaryOperator("plus", "+", 5, true, "plus"); + B.BinaryOperator_anB0 = new A.BinaryOperator0("plus", "+", 5, true, "plus"); + B.BinaryOperator_cIH = new A.BinaryOperator("greater than", ">", 4, false, "greaterThan"); + B.BinaryOperator_cIH0 = new A.BinaryOperator0("greater than", ">", 4, false, "greaterThan"); + B.BinaryOperator_kpg = new A.BinaryOperator("less than or equals", "<=", 4, false, "lessThanOrEquals"); + B.BinaryOperator_kpg0 = new A.BinaryOperator0("less than or equals", "<=", 4, false, "lessThanOrEquals"); + B.BinaryOperator_olz = new A.BinaryOperator("minus", "-", 5, false, "minus"); + B.BinaryOperator_olz0 = new A.BinaryOperator0("minus", "-", 5, false, "minus"); + B.BinaryOperator_qN2 = new A.BinaryOperator("times", "*", 6, true, "times"); + B.BinaryOperator_qN20 = new A.BinaryOperator0("times", "*", 6, true, "times"); + B.BinaryOperator_ql5 = new A.BinaryOperator("equals", "==", 3, false, "equals"); + B.BinaryOperator_ql50 = new A.BinaryOperator0("equals", "==", 3, false, "equals"); + B.BinaryOperator_t8B = new A.BinaryOperator("divided by", "/", 6, false, "dividedBy"); + B.BinaryOperator_t8B0 = new A.BinaryOperator0("divided by", "/", 6, false, "dividedBy"); + B.CONSTANT = new A.Instantiation1(A.math0__max$closure(), A.findType("Instantiation1")); + B.C_AsciiCodec = new A.AsciiCodec(); + B.C_AsciiGlyphSet = new A.AsciiGlyphSet(); + B.C_Base64Encoder = new A.Base64Encoder(); + B.C_Base64Codec = new A.Base64Codec(); + B.C_DefaultEquality = new A.DefaultEquality(); + B.C_EmptyExtensionStore = new A.EmptyExtensionStore(); + B.C_EmptyExtensionStore0 = new A.EmptyExtensionStore0(); + B.C_EmptyIterator = new A.EmptyIterator(); + B.C_EmptyUnmodifiableSet = new A.EmptyUnmodifiableSet(A.findType("EmptyUnmodifiableSet")); + B.C_EmptyUnmodifiableSet0 = new A.EmptyUnmodifiableSet(A.findType("EmptyUnmodifiableSet")); + B.C_IterableEquality = new A.IterableEquality(); + B.C_JS_CONST = function getTagFallback(o) { + var s = Object.prototype.toString.call(o); + return s.substring(8, s.length - 1); +}; + B.C_JS_CONST0 = function() { + var toStringFunction = Object.prototype.toString; + function getTag(o) { + var s = toStringFunction.call(o); + return s.substring(8, s.length - 1); + } + function getUnknownTag(object, tag) { + if (/^HTML[A-Z].*Element$/.test(tag)) { + var name = toStringFunction.call(object); + if (name == "[object Object]") return null; + return "HTMLElement"; + } + } + function getUnknownTagGenericBrowser(object, tag) { + if (object instanceof HTMLElement) return "HTMLElement"; + return getUnknownTag(object, tag); + } + function prototypeForTag(tag) { + if (typeof window == "undefined") return null; + if (typeof window[tag] == "undefined") return null; + var constructor = window[tag]; + if (typeof constructor != "function") return null; + return constructor.prototype; + } + function discriminator(tag) { return null; } + var isBrowser = typeof HTMLElement == "function"; + return { + getTag: getTag, + getUnknownTag: isBrowser ? getUnknownTagGenericBrowser : getUnknownTag, + prototypeForTag: prototypeForTag, + discriminator: discriminator }; +}; + B.C_JS_CONST6 = function(getTagFallback) { + return function(hooks) { + if (typeof navigator != "object") return hooks; + var userAgent = navigator.userAgent; + if (typeof userAgent != "string") return hooks; + if (userAgent.indexOf("DumpRenderTree") >= 0) return hooks; + if (userAgent.indexOf("Chrome") >= 0) { + function confirm(p) { + return typeof window == "object" && window[p] && window[p].name == p; + } + if (confirm("Window") && confirm("HTMLElement")) return hooks; + } + hooks.getTag = getTagFallback; + }; +}; + B.C_JS_CONST1 = function(hooks) { + if (typeof dartExperimentalFixupGetTag != "function") return hooks; + hooks.getTag = dartExperimentalFixupGetTag(hooks.getTag); +}; + B.C_JS_CONST5 = function(hooks) { + if (typeof navigator != "object") return hooks; + var userAgent = navigator.userAgent; + if (typeof userAgent != "string") return hooks; + if (userAgent.indexOf("Firefox") == -1) return hooks; + var getTag = hooks.getTag; + var quickMap = { + "BeforeUnloadEvent": "Event", + "DataTransfer": "Clipboard", + "GeoGeolocation": "Geolocation", + "Location": "!Location", + "WorkerMessageEvent": "MessageEvent", + "XMLDocument": "!Document"}; + function getTagFirefox(o) { + var tag = getTag(o); + return quickMap[tag] || tag; + } + hooks.getTag = getTagFirefox; +}; + B.C_JS_CONST4 = function(hooks) { + if (typeof navigator != "object") return hooks; + var userAgent = navigator.userAgent; + if (typeof userAgent != "string") return hooks; + if (userAgent.indexOf("Trident/") == -1) return hooks; + var getTag = hooks.getTag; + var quickMap = { + "BeforeUnloadEvent": "Event", + "DataTransfer": "Clipboard", + "HTMLDDElement": "HTMLElement", + "HTMLDTElement": "HTMLElement", + "HTMLPhraseElement": "HTMLElement", + "Position": "Geoposition" + }; + function getTagIE(o) { + var tag = getTag(o); + var newTag = quickMap[tag]; + if (newTag) return newTag; + if (tag == "Object") { + if (window.DataView && (o instanceof window.DataView)) return "DataView"; + } + return tag; + } + function prototypeForTagIE(tag) { + var constructor = window[tag]; + if (constructor == null) return null; + return constructor.prototype; + } + hooks.getTag = getTagIE; + hooks.prototypeForTag = prototypeForTagIE; +}; + B.C_JS_CONST2 = function(hooks) { + var getTag = hooks.getTag; + var prototypeForTag = hooks.prototypeForTag; + function getTagFixed(o) { + var tag = getTag(o); + if (tag == "Document") { + if (!!o.xmlVersion) return "!Document"; + return "!HTMLDocument"; + } + return tag; + } + function prototypeForTagFixed(tag) { + if (tag == "Document") return null; + return prototypeForTag(tag); + } + hooks.getTag = getTagFixed; + hooks.prototypeForTag = prototypeForTagFixed; +}; + B.C_JS_CONST3 = function(hooks) { return hooks; } +; + B.C_JsonCodec = new A.JsonCodec(); + B.C_ListEquality0 = new A.ListEquality(); + B.C_ListEquality = new A.ListEquality(); + B.C_MapEquality = new A.MapEquality(A.findType("MapEquality")); + B.C_OutOfMemoryError = new A.OutOfMemoryError(); + B.C_SentinelValue = new A.SentinelValue(); + B.C_UnicodeGlyphSet = new A.UnicodeGlyphSet(); + B.C_Utf8Codec = new A.Utf8Codec(); + B.C_Utf8Encoder = new A.Utf8Encoder(); + B.C__DelayedDone = new A._DelayedDone(); + B.C__HasContentVisitor = new A._HasContentVisitor(); + B.C__HasContentVisitor0 = new A._HasContentVisitor0(); + B.C__IsUselessVisitor = new A._IsUselessVisitor(); + B.C__IsUselessVisitor0 = new A._IsUselessVisitor0(); + B.C__JSRandom = new A._JSRandom(); + B.C__MakeExpressionCalculationSafe = new A._MakeExpressionCalculationSafe(); + B.C__MakeExpressionCalculationSafe0 = new A._MakeExpressionCalculationSafe0(); + B.C__ParentSelectorVisitor = new A._ParentSelectorVisitor(); + B.C__ParentSelectorVisitor0 = new A._ParentSelectorVisitor0(); + B.C__Required = new A._Required(); + B.C__RootZone = new A._RootZone(); + B.C__SassNull = new A._SassNull(); + B.C__SassNull0 = new A._SassNull0(); + B.CalculationOperator_2bx = new A.CalculationOperator("minus", "-", 1, "minus"); + B.CalculationOperator_2bx0 = new A.CalculationOperator0("minus", "-", 1, "minus"); + B.CalculationOperator_IyK = new A.CalculationOperator("plus", "+", 1, "plus"); + B.CalculationOperator_IyK0 = new A.CalculationOperator0("plus", "+", 1, "plus"); + B.CalculationOperator_OvN = new A.CalculationOperator("divided by", "/", 2, "dividedBy"); + B.CalculationOperator_OvN0 = new A.CalculationOperator0("divided by", "/", 2, "dividedBy"); + B.CalculationOperator_jFr = new A.CalculationOperator("times", "*", 2, "times"); + B.CalculationOperator_jFr0 = new A.CalculationOperator0("times", "*", 2, "times"); + B.ChangeType_add = new A.ChangeType("add"); + B.ChangeType_modify = new A.ChangeType("modify"); + B.ChangeType_remove = new A.ChangeType("remove"); + B.Combinator_4QF = new A.Combinator("+", "nextSibling"); + B.Combinator_4QF0 = new A.Combinator0("+", "nextSibling"); + B.Combinator_Cht = new A.Combinator(">", "child"); + B.Combinator_Cht0 = new A.Combinator0(">", "child"); + B.Combinator_Htt = new A.Combinator("~", "followingSibling"); + B.Combinator_Htt0 = new A.Combinator0("~", "followingSibling"); + B.Object_empty = {}; + B.Map_empty17 = new A.ConstantStringMap(B.Object_empty, [], A.findType("ConstantStringMap")); + B.Configuration_Map_empty_null = new A.Configuration(B.Map_empty17, null); + B.Map_empty18 = new A.ConstantStringMap(B.Object_empty, [], A.findType("ConstantStringMap")); + B.Configuration_Map_empty_null0 = new A.Configuration0(B.Map_empty18, null); + B.Deprecation_043 = new A.Deprecation("abs-percent", "1.65.0", "Passing percentages to the Sass abs() function.", false, "absPercent"); + B.Deprecation_0bn = new A.Deprecation0("function-units", false, "functionUnits"); + B.Deprecation_4iQ = new A.Deprecation0("call-string", false, "callString"); + B.Deprecation_8WR = new A.Deprecation("function-units", "1.56.0", "Passing invalid units to built-in functions.", false, "functionUnits"); + B.Deprecation_Auo = new A.Deprecation("duplicate-var-flags", "1.62.0", "Using !default or !global multiple times for one variable.", false, "duplicateVariableFlags"); + B.Deprecation_B8J = new A.Deprecation("import", null, "@import rules.", true, "import"); + B.Deprecation_E5x = new A.Deprecation0("relative-canonical", false, "relativeCanonical"); + B.Deprecation_EsU = new A.Deprecation0("strict-unary", false, "strictUnary"); + B.Deprecation_GbU = new A.Deprecation0("moz-document", false, "mozDocument"); + B.Deprecation_JAZ = new A.Deprecation("elseif", "1.3.2", "@elseif.", false, "elseif"); + B.Deprecation_LT8 = new A.Deprecation0("color-module-compat", false, "colorModuleCompat"); + B.Deprecation_UZD = new A.Deprecation0("null-alpha", false, "nullAlpha"); + B.Deprecation_XV6 = new A.Deprecation0("bogus-combinators", false, "bogusCombinators"); + B.Deprecation_elseif_false_elseif = new A.Deprecation0("elseif", false, "elseif"); + B.Deprecation_gJ9 = new A.Deprecation("moz-document", "1.7.2", "@-moz-document.", false, "mozDocument"); + B.Deprecation_hzy = new A.Deprecation("new-global", "1.17.2", "Declaring new variables with !global.", false, "newGlobal"); + B.Deprecation_import_true_import = new A.Deprecation0("import", true, "import"); + B.Deprecation_la6 = new A.Deprecation0("abs-percent", false, "absPercent"); + B.Deprecation_mFp = new A.Deprecation("relative-canonical", "1.14.2", null, false, "relativeCanonical"); + B.Deprecation_qVK = new A.Deprecation("call-string", "0.0.0", "Passing a string directly to meta.call().", false, "callString"); + B.Deprecation_s4m = new A.Deprecation("color-module-compat", "1.23.0", "Using color module functions in place of plain CSS functions.", false, "colorModuleCompat"); + B.Deprecation_sIK = new A.Deprecation("strict-unary", "1.55.0", "Ambiguous + and - operators.", false, "strictUnary"); + B.Deprecation_vrR = new A.Deprecation("bogus-combinators", "1.54.0", "Leading, trailing, and repeated combinators.", false, "bogusCombinators"); + B.Deprecation_wKk = new A.Deprecation0("new-global", false, "newGlobal"); + B.Deprecation_wWh = new A.Deprecation0("slash-div", false, "slashDiv"); + B.Deprecation_xHK = new A.Deprecation("slash-div", "1.33.0", "/ operator for division.", false, "slashDiv"); + B.Deprecation_ynv = new A.Deprecation0("duplicate-var-flags", false, "duplicateVariableFlags"); + B.Duration_0 = new A.Duration(0); + B.ExtendMode_allTargets_allTargets = new A.ExtendMode("allTargets", "allTargets"); + B.ExtendMode_allTargets_allTargets0 = new A.ExtendMode0("allTargets", "allTargets"); + B.ExtendMode_normal_normal = new A.ExtendMode("normal", "normal"); + B.ExtendMode_normal_normal0 = new A.ExtendMode0("normal", "normal"); + B.ExtendMode_replace_replace = new A.ExtendMode("replace", "replace"); + B.ExtendMode_replace_replace0 = new A.ExtendMode0("replace", "replace"); + B.JsonDecoder_null = new A.JsonDecoder(null); + B.JsonEncoder_null = new A.JsonEncoder(null); + B.LineFeed_SsD = new A.LineFeed0("lf", "\n", "lf"); + B.LineFeed_gg4 = new A.LineFeed0("crlf", "\r\n", "crlf"); + B.LineFeed_lf = new A.LineFeed("lf"); + B.LineFeed_oyU = new A.LineFeed0("cr", "\r", "cr"); + B.LineFeed_t2a = new A.LineFeed0("lfcr", "\n\r", "lfcr"); + B.ListSeparator_EVt = new A.ListSeparator("space", " ", "space"); + B.ListSeparator_EVt0 = new A.ListSeparator0("space", " ", "space"); + B.ListSeparator_rXA = new A.ListSeparator("comma", ",", "comma"); + B.ListSeparator_rXA0 = new A.ListSeparator0("comma", ",", "comma"); + B.ListSeparator_undecided_null_undecided = new A.ListSeparator("undecided", null, "undecided"); + B.ListSeparator_undecided_null_undecided0 = new A.ListSeparator0("undecided", null, "undecided"); + B.ListSeparator_zg9 = new A.ListSeparator("slash", "/", "slash"); + B.ListSeparator_zg90 = new A.ListSeparator0("slash", "/", "slash"); + B.Deprecation_7XU = new A.Deprecation("null-alpha", "1.62.3", "Passing null as alpha in the JS API.", false, "nullAlpha"); + B.Deprecation_WbD = new A.Deprecation("calc-interp", null, null, false, "calcInterp"); + B.Deprecation_A0N = new A.Deprecation("user-authored", null, null, false, "userAuthored"); + B.List_GN8 = A._setArrayType(makeConstList([B.Deprecation_qVK, B.Deprecation_JAZ, B.Deprecation_gJ9, B.Deprecation_mFp, B.Deprecation_hzy, B.Deprecation_s4m, B.Deprecation_xHK, B.Deprecation_vrR, B.Deprecation_sIK, B.Deprecation_8WR, B.Deprecation_043, B.Deprecation_Auo, B.Deprecation_7XU, B.Deprecation_WbD, B.Deprecation_B8J, B.Deprecation_A0N]), A.findType("JSArray")); + B.List_M1A = A._setArrayType(makeConstList([0, 0, 24576, 1023, 65534, 34815, 65534, 18431]), type$.JSArray_int); + B.List_MMm = A._setArrayType(makeConstList([0, 0, 26624, 1023, 65534, 2047, 65534, 2047]), type$.JSArray_int); + B.List_OL3 = A._setArrayType(makeConstList([0, 0, 32722, 12287, 65534, 34815, 65534, 18431]), type$.JSArray_int); + B.List_XRg0 = A._setArrayType(makeConstList([0, 0, 32722, 12287, 65535, 34815, 65534, 18431]), type$.JSArray_int); + B.List_XRg = A._setArrayType(makeConstList([0, 0, 65490, 12287, 65535, 34815, 65534, 18431]), type$.JSArray_int); + B.List_YmH = A._setArrayType(makeConstList([0, 0, 32776, 33792, 1, 10240, 0, 0]), type$.JSArray_int); + B.List_cUt = A._setArrayType(makeConstList([B.CalculationOperator_IyK0, B.CalculationOperator_2bx0, B.CalculationOperator_jFr0, B.CalculationOperator_OvN0]), A.findType("JSArray")); + B.List_ejq = A._setArrayType(makeConstList([0, 0, 32754, 11263, 65534, 34815, 65534, 18431]), type$.JSArray_int); + B.List_empty11 = A._setArrayType(makeConstList([]), type$.JSArray_Argument); + B.List_empty22 = A._setArrayType(makeConstList([]), type$.JSArray_Argument_2); + B.List_empty24 = A._setArrayType(makeConstList([]), type$.JSArray_AsyncCallable_2); + B.List_empty25 = A._setArrayType(makeConstList([]), type$.JSArray_AsyncImporter); + B.List_empty2 = A._setArrayType(makeConstList([]), type$.JSArray_ComplexSelector); + B.List_empty15 = A._setArrayType(makeConstList([]), type$.JSArray_ComplexSelector_2); + B.List_empty0 = A._setArrayType(makeConstList([]), type$.JSArray_ComplexSelectorComponent); + B.List_empty13 = A._setArrayType(makeConstList([]), type$.JSArray_ComplexSelectorComponent_2); + B.List_empty10 = A._setArrayType(makeConstList([]), type$.JSArray_ConfiguredVariable); + B.List_empty21 = A._setArrayType(makeConstList([]), type$.JSArray_ConfiguredVariable_2); + B.List_empty3 = A._setArrayType(makeConstList([]), type$.JSArray_CssNode); + B.List_empty16 = A._setArrayType(makeConstList([]), type$.JSArray_CssNode_2); + B.List_empty1 = A._setArrayType(makeConstList([]), type$.JSArray_CssValue_Combinator); + B.List_empty14 = A._setArrayType(makeConstList([]), type$.JSArray_CssValue_Combinator_2); + B.List_empty9 = A._setArrayType(makeConstList([]), type$.JSArray_Expression); + B.List_empty20 = A._setArrayType(makeConstList([]), type$.JSArray_Expression_2); + B.List_empty5 = A._setArrayType(makeConstList([]), type$.JSArray_Extension); + B.List_empty17 = A._setArrayType(makeConstList([]), type$.JSArray_Extension_2); + B.List_empty23 = A._setArrayType(makeConstList([]), type$.JSArray_Importer_2); + B.List_empty7 = A._setArrayType(makeConstList([]), A.findType("JSArray>")); + B.List_empty18 = A._setArrayType(makeConstList([]), A.findType("JSArray>")); + B.List_empty12 = A._setArrayType(makeConstList([]), type$.JSArray_Statement); + B.List_empty = A._setArrayType(makeConstList([]), type$.JSArray_String); + B.List_empty8 = A._setArrayType(makeConstList([]), type$.JSArray_Value); + B.List_empty19 = A._setArrayType(makeConstList([]), type$.JSArray_Value_2); + B.List_empty4 = A._setArrayType(makeConstList([]), type$.JSArray_int); + B.List_empty6 = A._setArrayType(makeConstList([]), type$.JSArray_dynamic); + B.Object_gR2 = {em: 0, rem: 1, ex: 2, rex: 3, cap: 4, rcap: 5, ch: 6, rch: 7, ic: 8, ric: 9, lh: 10, rlh: 11, vw: 12, lvw: 13, svw: 14, dvw: 15, vh: 16, lvh: 17, svh: 18, dvh: 19, vi: 20, lvi: 21, svi: 22, dvi: 23, vb: 24, lvb: 25, svb: 26, dvb: 27, vmin: 28, lvmin: 29, svmin: 30, dvmin: 31, vmax: 32, lvmax: 33, svmax: 34, dvmax: 35, cqw: 36, cqh: 37, cqi: 38, cqb: 39, cqmin: 40, cqmax: 41, cm: 42, mm: 43, q: 44, in: 45, pt: 46, pc: 47, px: 48}; + B.Set_UGQ3 = new A.ConstantStringSet(B.Object_gR2, 49, type$.ConstantStringSet_String); + B.Object_wEo = {deg: 0, grad: 1, rad: 2, turn: 3}; + B.Set_gf1m2 = new A.ConstantStringSet(B.Object_wEo, 4, type$.ConstantStringSet_String); + B.Object_s_0_ms_1 = {s: 0, ms: 1}; + B.Set_23h = new A.ConstantStringSet(B.Object_s_0_ms_1, 2, type$.ConstantStringSet_String); + B.Object_hz_0_khz_1 = {hz: 0, khz: 1}; + B.Set_AKW81 = new A.ConstantStringSet(B.Object_hz_0_khz_1, 2, type$.ConstantStringSet_String); + B.Object_f7G = {dpi: 0, dpcm: 1, dppx: 2}; + B.Set_wDQui = new A.ConstantStringSet(B.Object_f7G, 3, type$.ConstantStringSet_String); + B.List_gyp = A._setArrayType(makeConstList([B.Set_UGQ3, B.Set_gf1m2, B.Set_23h, B.Set_AKW81, B.Set_wDQui]), A.findType("JSArray>")); + B.List_oFp = A._setArrayType(makeConstList([0, 0, 65490, 45055, 65535, 34815, 65534, 18431]), type$.JSArray_int); + B.List_yzX = A._setArrayType(makeConstList([0, 0, 27858, 1023, 65534, 51199, 65535, 32767]), type$.JSArray_int); + B.Map_empty7 = new A.ConstantStringMap(B.Object_empty, [], A.findType("ConstantStringMap,List>")); + B.Map_empty0 = new A.ConstantStringMap(B.Object_empty, [], A.findType("ConstantStringMap,List>")); + B.Map_empty2 = new A.ConstantStringMap(B.Object_empty, [], A.findType("ConstantStringMap,List>")); + B.Map_empty15 = new A.ConstantStringMap(B.Object_empty, [], A.findType("ConstantStringMap,List>")); + B.Map_empty9 = new A.ConstantStringMap(B.Object_empty, [], A.findType("ConstantStringMap,List>")); + B.Map_empty11 = new A.ConstantStringMap(B.Object_empty, [], A.findType("ConstantStringMap,List>")); + B.Map_empty4 = new A.ConstantStringMap(B.Object_empty, [], A.findType("ConstantStringMap")); + B.Map_empty12 = new A.ConstantStringMap(B.Object_empty, [], A.findType("ConstantStringMap")); + B.Map_empty6 = new A.ConstantStringMap(B.Object_empty, [], A.findType("ConstantStringMap")); + B.Map_empty14 = new A.ConstantStringMap(B.Object_empty, [], A.findType("ConstantStringMap")); + B.Map_empty8 = new A.ConstantStringMap(B.Object_empty, [], A.findType("ConstantStringMap>")); + B.Map_empty1 = new A.ConstantStringMap(B.Object_empty, [], A.findType("ConstantStringMap>")); + B.Map_empty16 = new A.ConstantStringMap(B.Object_empty, [], A.findType("ConstantStringMap>")); + B.Map_empty10 = new A.ConstantStringMap(B.Object_empty, [], A.findType("ConstantStringMap>")); + B.Map_empty5 = new A.ConstantStringMap(B.Object_empty, [], A.findType("ConstantStringMap")); + B.Map_empty13 = new A.ConstantStringMap(B.Object_empty, [], A.findType("ConstantStringMap")); + B.Map_empty3 = new A.ConstantStringMap(B.Object_empty, [], A.findType("ConstantStringMap")); + B.Map_empty = new A.ConstantStringMap(B.Object_empty, [], A.findType("ConstantStringMap")); + B.Object_UMI = {in: 0, cm: 1, pc: 2, mm: 3, q: 4, pt: 5, px: 6, deg: 7, grad: 8, rad: 9, turn: 10, s: 11, ms: 12, Hz: 13, kHz: 14, dpi: 15, dpcm: 16, dppx: 17}; + B.Object_MIo = {in: 0, cm: 1, pc: 2, mm: 3, q: 4, pt: 5, px: 6}; + B.Map_scaO3 = new A.ConstantStringMap(B.Object_MIo, [1, 0.39370078740157477, 0.16666666666666666, 0.03937007874015748, 0.00984251968503937, 0.013888888888888888, 0.010416666666666666], type$.ConstantStringMap_String_double); + B.Map_scsoL = new A.ConstantStringMap(B.Object_MIo, [2.54, 1, 0.42333333333333334, 0.1, 0.025, 0.035277777777777776, 0.026458333333333334], type$.ConstantStringMap_String_double); + B.Map_sci7B = new A.ConstantStringMap(B.Object_MIo, [6, 2.3622047244094486, 1, 0.2362204724409449, 0.05905511811023623, 0.08333333333333333, 0.0625], type$.ConstantStringMap_String_double); + B.Map_sc8pl = new A.ConstantStringMap(B.Object_MIo, [25.4, 10, 4.233333333333333, 1, 0.25, 0.35277777777777775, 0.26458333333333334], type$.ConstantStringMap_String_double); + B.Map_sckr3 = new A.ConstantStringMap(B.Object_MIo, [101.6, 40, 16.933333333333334, 4, 1, 1.411111111111111, 1.0583333333333333], type$.ConstantStringMap_String_double); + B.Map_scaBQ = new A.ConstantStringMap(B.Object_MIo, [72, 28.346456692913385, 12, 2.834645669291339, 0.7086614173228347, 1, 0.75], type$.ConstantStringMap_String_double); + B.Map_scGVy = new A.ConstantStringMap(B.Object_MIo, [96, 37.79527559055118, 16, 3.7795275590551185, 0.9448818897637796, 1.3333333333333333, 1], type$.ConstantStringMap_String_double); + B.Map_ia0 = new A.ConstantStringMap(B.Object_wEo, [1, 0.9, 57.29577951308232, 360], type$.ConstantStringMap_String_double); + B.Map_iaijl = new A.ConstantStringMap(B.Object_wEo, [1.1111111111111112, 1, 63.66197723675813, 400], type$.ConstantStringMap_String_double); + B.Map_iaMqi = new A.ConstantStringMap(B.Object_wEo, [0.017453292519943295, 0.015707963267948967, 1, 6.283185307179586], type$.ConstantStringMap_String_double); + B.Map_iaJel = new A.ConstantStringMap(B.Object_wEo, [0.002777777777777778, 0.0025, 0.15915494309189535, 1], type$.ConstantStringMap_String_double); + B.Map_V0M2a = new A.ConstantStringMap(B.Object_s_0_ms_1, [1, 0.001], type$.ConstantStringMap_String_double); + B.Map_V0nPR = new A.ConstantStringMap(B.Object_s_0_ms_1, [1000, 1], type$.ConstantStringMap_String_double); + B.Object_Hz_0_kHz_1 = {Hz: 0, kHz: 1}; + B.Map_8secN = new A.ConstantStringMap(B.Object_Hz_0_kHz_1, [1, 1000], type$.ConstantStringMap_String_double); + B.Map_8sxHw = new A.ConstantStringMap(B.Object_Hz_0_kHz_1, [0.001, 1], type$.ConstantStringMap_String_double); + B.Map_lyv9F = new A.ConstantStringMap(B.Object_f7G, [1, 2.54, 96], type$.ConstantStringMap_String_double); + B.Map_lyhdB = new A.ConstantStringMap(B.Object_f7G, [0.39370078740157477, 1, 37.79527559055118], type$.ConstantStringMap_String_double); + B.Map_lyCkv = new A.ConstantStringMap(B.Object_f7G, [0.010416666666666666, 0.026458333333333334, 1], type$.ConstantStringMap_String_double); + B.Map_nfuzN = new A.ConstantStringMap(B.Object_UMI, [B.Map_scaO3, B.Map_scsoL, B.Map_sci7B, B.Map_sc8pl, B.Map_sckr3, B.Map_scaBQ, B.Map_scGVy, B.Map_ia0, B.Map_iaijl, B.Map_iaMqi, B.Map_iaJel, B.Map_V0M2a, B.Map_V0nPR, B.Map_8secN, B.Map_8sxHw, B.Map_lyv9F, B.Map_lyhdB, B.Map_lyCkv], A.findType("ConstantStringMap>")); + B.Object_kaS = {length: 0, angle: 1, time: 2, frequency: 3, "pixel density": 4}; + B.List_scn = A._setArrayType(makeConstList(["in", "cm", "pc", "mm", "q", "pt", "px"]), type$.JSArray_String); + B.List_deg_grad_rad_turn = A._setArrayType(makeConstList(["deg", "grad", "rad", "turn"]), type$.JSArray_String); + B.List_s_ms = A._setArrayType(makeConstList(["s", "ms"]), type$.JSArray_String); + B.List_Hz_kHz = A._setArrayType(makeConstList(["Hz", "kHz"]), type$.JSArray_String); + B.List_dpi_dpcm_dppx = A._setArrayType(makeConstList(["dpi", "dpcm", "dppx"]), type$.JSArray_String); + B.Map_ws7dy = new A.ConstantStringMap(B.Object_kaS, [B.List_scn, B.List_deg_grad_rad_turn, B.List_s_ms, B.List_Hz_kHz, B.List_dpi_dpcm_dppx], A.findType("ConstantStringMap>")); + B.OptionType_YwU = new A.OptionType("OptionType.single"); + B.OptionType_nMZ = new A.OptionType("OptionType.flag"); + B.OptionType_qyr = new A.OptionType("OptionType.multiple"); + B.OutputStyle_0 = new A.OutputStyle("expanded"); + B.OutputStyle_00 = new A.OutputStyle0("expanded"); + B.OutputStyle_1 = new A.OutputStyle("compressed"); + B.OutputStyle_10 = new A.OutputStyle0("compressed"); + B.Map_empty19 = new A.ConstantStringMap(B.Object_empty, [], A.findType("ConstantStringMap>")); + B.Record2_EmptyExtensionStore_Map_empty = new A._Record_2(B.C_EmptyExtensionStore, B.Map_empty19); + B.Map_empty20 = new A.ConstantStringMap(B.Object_empty, [], A.findType("ConstantStringMap>")); + B.Record2_EmptyExtensionStore_Map_empty0 = new A._Record_2(B.C_EmptyExtensionStore0, B.Map_empty20); + B.SassBoolean_false = new A.SassBoolean(false); + B.SassBoolean_false0 = new A.SassBoolean0(false); + B.SassBoolean_true = new A.SassBoolean(true); + B.SassBoolean_true0 = new A.SassBoolean0(true); + B.SassList_Sof = new A.SassList(B.List_empty8, B.ListSeparator_rXA, false); + B.SassList_Sof0 = new A.SassList(B.List_empty8, B.ListSeparator_rXA, true); + B.SassList_Sof1 = new A.SassList0(B.List_empty19, B.ListSeparator_rXA0, false); + B.SassList_Sof2 = new A.SassList0(B.List_empty19, B.ListSeparator_rXA0, true); + B.SassList_nj9 = new A.SassList0(B.List_empty19, B.ListSeparator_undecided_null_undecided0, false); + B.Map_empty21 = new A.ConstantStringMap(B.Object_empty, [], A.findType("ConstantStringMap")); + B.SassMap_Map_empty = new A.SassMap(B.Map_empty21); + B.Map_empty22 = new A.ConstantStringMap(B.Object_empty, [], A.findType("ConstantStringMap")); + B.SassMap_Map_empty0 = new A.SassMap0(B.Map_empty22); + B.Set_FIwG4 = new A.GeneralConstantSet([B.BinaryOperator_qN2, B.BinaryOperator_t8B, B.BinaryOperator_anB, B.BinaryOperator_olz], A.findType("GeneralConstantSet")); + B.Set_FIwG40 = new A.GeneralConstantSet([B.BinaryOperator_qN20, B.BinaryOperator_t8B0, B.BinaryOperator_anB0, B.BinaryOperator_olz0], A.findType("GeneralConstantSet")); + B.Object_KpR = {".scss": 0, ".sass": 1, ".css": 2}; + B.Set_HW1We = new A.ConstantStringSet(B.Object_KpR, 3, type$.ConstantStringSet_String); + B.Object_sd2 = {calc: 0, clamp: 1, hypot: 2, sin: 3, cos: 4, tan: 5, asin: 6, acos: 7, atan: 8, sqrt: 9, exp: 10, sign: 11, mod: 12, rem: 13, atan2: 14, pow: 15, log: 16}; + B.Set_WfnXb = new A.ConstantStringSet(B.Object_sd2, 17, type$.ConstantStringSet_String); + B.Object_C0t = {is: 0, matches: 1, where: 2}; + B.Set_aAXJu = new A.ConstantStringSet(B.Object_C0t, 3, type$.ConstantStringSet_String); + B.Set_empty1 = new A.ConstantStringSet(B.Object_empty, 0, A.findType("ConstantStringSet")); + B.Set_empty5 = new A.ConstantStringSet(B.Object_empty, 0, A.findType("ConstantStringSet")); + B.Set_empty2 = new A.ConstantStringSet(B.Object_empty, 0, A.findType("ConstantStringSet>")); + B.Set_empty0 = new A.ConstantStringSet(B.Object_empty, 0, A.findType("ConstantStringSet>")); + B.Set_empty6 = new A.ConstantStringSet(B.Object_empty, 0, A.findType("ConstantStringSet>")); + B.Set_empty4 = new A.ConstantStringSet(B.Object_empty, 0, A.findType("ConstantStringSet>")); + B.Set_empty7 = new A.ConstantStringSet(B.Object_empty, 0, type$.ConstantStringSet_String); + B.Set_empty3 = new A.ConstantStringSet(B.Object_empty, 0, A.findType("ConstantStringSet")); + B.Set_empty = new A.ConstantStringSet(B.Object_empty, 0, A.findType("ConstantStringSet")); + B.Object_s8n = {sass: 0, style: 1, default: 2}; + B.Set_gkcz = new A.ConstantStringSet(B.Object_s8n, 3, type$.ConstantStringSet_String); + B.StderrLogger_false = new A.StderrLogger(false); + B.StderrLogger_false0 = new A.StderrLogger0(false); + B.Symbol__containingUrl = new A.Symbol("_containingUrl"); + B.Symbol__evaluationContext = new A.Symbol("_evaluationContext"); + B.Symbol__extensions = new A.Symbol("_extensions"); + B.Symbol__inImportRule = new A.Symbol("_inImportRule"); + B.Symbol__none = new A.Symbol("_none"); + B.Symbol__sourceSpecificity = new A.Symbol("_sourceSpecificity"); + B.Symbol_call = new A.Symbol("call"); + B.Syntax_CSS_css = new A.Syntax("CSS", "css"); + B.Syntax_CSS_css0 = new A.Syntax0("CSS", "css"); + B.Syntax_SCSS_scss = new A.Syntax("SCSS", "scss"); + B.Syntax_SCSS_scss0 = new A.Syntax0("SCSS", "scss"); + B.Syntax_Sass_sass = new A.Syntax("Sass", "sass"); + B.Syntax_Sass_sass0 = new A.Syntax0("Sass", "sass"); + B.Type_ByteBuffer_RkP = A.typeLiteral("ByteBuffer"); + B.Type_ByteData_zNC = A.typeLiteral("ByteData"); + B.Type_Float32List_LB7 = A.typeLiteral("Float32List"); + B.Type_Float64List_LB7 = A.typeLiteral("Float64List"); + B.Type_Int16List_uXf = A.typeLiteral("Int16List"); + B.Type_Int32List_O50 = A.typeLiteral("Int32List"); + B.Type_Int8List_ekJ = A.typeLiteral("Int8List"); + B.Type_Object_xQ6 = A.typeLiteral("Object"); + B.Type_Uint16List_2bx = A.typeLiteral("Uint16List"); + B.Type_Uint32List_2bx = A.typeLiteral("Uint32List"); + B.Type_Uint8ClampedList_Jik = A.typeLiteral("Uint8ClampedList"); + B.Type_Uint8List_WLA = A.typeLiteral("Uint8List"); + B.UnaryOperator_Ix1 = new A.UnaryOperator("divide", "/", "divide"); + B.UnaryOperator_Ix10 = new A.UnaryOperator0("divide", "/", "divide"); + B.UnaryOperator_TLI = new A.UnaryOperator("minus", "-", "minus"); + B.UnaryOperator_TLI0 = new A.UnaryOperator0("minus", "-", "minus"); + B.UnaryOperator_gg4 = new A.UnaryOperator("plus", "+", "plus"); + B.UnaryOperator_gg40 = new A.UnaryOperator0("plus", "+", "plus"); + B.UnaryOperator_not_not_not = new A.UnaryOperator("not", "not", "not"); + B.UnaryOperator_not_not_not0 = new A.UnaryOperator0("not", "not", "not"); + B.Utf8Decoder_false = new A.Utf8Decoder(false); + B._ColorFormatEnum_hslFunction = new A._ColorFormatEnum("hslFunction"); + B._ColorFormatEnum_hslFunction0 = new A._ColorFormatEnum0("hslFunction"); + B._ColorFormatEnum_rgbFunction = new A._ColorFormatEnum("rgbFunction"); + B._ColorFormatEnum_rgbFunction0 = new A._ColorFormatEnum0("rgbFunction"); + B._IsBogusVisitor_false = new A._IsBogusVisitor(false); + B._IsBogusVisitor_false0 = new A._IsBogusVisitor0(false); + B._IsBogusVisitor_true = new A._IsBogusVisitor(true); + B._IsBogusVisitor_true0 = new A._IsBogusVisitor0(true); + B._IsInvisibleVisitor_false = new A._IsInvisibleVisitor0(false); + B._IsInvisibleVisitor_false0 = new A._IsInvisibleVisitor2(false); + B._IsInvisibleVisitor_false_false = new A._IsInvisibleVisitor(false, false); + B._IsInvisibleVisitor_false_false0 = new A._IsInvisibleVisitor1(false, false); + B._IsInvisibleVisitor_true = new A._IsInvisibleVisitor0(true); + B._IsInvisibleVisitor_true0 = new A._IsInvisibleVisitor2(true); + B._IsInvisibleVisitor_true_false = new A._IsInvisibleVisitor(true, false); + B._IsInvisibleVisitor_true_false0 = new A._IsInvisibleVisitor1(true, false); + B._IsInvisibleVisitor_true_true = new A._IsInvisibleVisitor(true, true); + B._IsInvisibleVisitor_true_true0 = new A._IsInvisibleVisitor1(true, true); + B._PathDirection_8Gl = new A._PathDirection("at root"); + B._PathDirection_988 = new A._PathDirection("below root"); + B._PathDirection_FIw = new A._PathDirection("reaches root"); + B._PathDirection_ZGD = new A._PathDirection("above root"); + B._PathRelation_different = new A._PathRelation("different"); + B._PathRelation_equal = new A._PathRelation("equal"); + B._PathRelation_inconclusive = new A._PathRelation("inconclusive"); + B._PathRelation_within = new A._PathRelation("within"); + B._SingletonCssMediaQueryMergeResult_0 = new A._SingletonCssMediaQueryMergeResult("empty"); + B._SingletonCssMediaQueryMergeResult_00 = new A._SingletonCssMediaQueryMergeResult0("empty"); + B._SingletonCssMediaQueryMergeResult_1 = new A._SingletonCssMediaQueryMergeResult("unrepresentable"); + B._SingletonCssMediaQueryMergeResult_10 = new A._SingletonCssMediaQueryMergeResult0("unrepresentable"); + B._StreamGroupState_canceled = new A._StreamGroupState("canceled"); + B._StreamGroupState_dormant = new A._StreamGroupState("dormant"); + B._StreamGroupState_listening = new A._StreamGroupState("listening"); + B._StreamGroupState_paused = new A._StreamGroupState("paused"); + B._StringStackTrace_3uE = new A._StringStackTrace(""); + B._ZoneFunction_3bB = new A._ZoneFunction(B.C__RootZone, A.async___rootCreatePeriodicTimer$closure()); + B._ZoneFunction_7G2 = new A._ZoneFunction(B.C__RootZone, A.async___rootRegisterBinaryCallback$closure()); + B._ZoneFunction_Eeh = new A._ZoneFunction(B.C__RootZone, A.async___rootRegisterUnaryCallback$closure()); + B._ZoneFunction_NMc = new A._ZoneFunction(B.C__RootZone, A.async___rootHandleUncaughtError$closure()); + B._ZoneFunction__RootZone__rootCreateTimer = new A._ZoneFunction(B.C__RootZone, A.async___rootCreateTimer$closure()); + B._ZoneFunction__RootZone__rootErrorCallback = new A._ZoneFunction(B.C__RootZone, A.async___rootErrorCallback$closure()); + B._ZoneFunction__RootZone__rootFork = new A._ZoneFunction(B.C__RootZone, A.async___rootFork$closure()); + B._ZoneFunction__RootZone__rootPrint = new A._ZoneFunction(B.C__RootZone, A.async___rootPrint$closure()); + B._ZoneFunction__RootZone__rootRegisterCallback = new A._ZoneFunction(B.C__RootZone, A.async___rootRegisterCallback$closure()); + B._ZoneFunction__RootZone__rootRun = new A._ZoneFunction(B.C__RootZone, A.async___rootRun$closure()); + B._ZoneFunction__RootZone__rootRunBinary = new A._ZoneFunction(B.C__RootZone, A.async___rootRunBinary$closure()); + B._ZoneFunction__RootZone__rootRunUnary = new A._ZoneFunction(B.C__RootZone, A.async___rootRunUnary$closure()); + B._ZoneFunction__RootZone__rootScheduleMicrotask = new A._ZoneFunction(B.C__RootZone, A.async___rootScheduleMicrotask$closure()); + B._ZoneSpecification_ALf = new A._ZoneSpecification(null, null, null, null, null, null, null, null, null, null, null, null, null); + })(); + (function staticFields() { + $._JS_INTEROP_INTERCEPTOR_TAG = null; + $.toStringVisiting = A._setArrayType([], type$.JSArray_Object); + $.printToZone = null; + $.Primitives__identityHashCodeProperty = null; + $.BoundClosure__receiverFieldNameCache = null; + $.BoundClosure__interceptorFieldNameCache = null; + $.getTagFunction = null; + $.alternateTagFunction = null; + $.prototypeForTagFunction = null; + $.dispatchRecordsForInstanceTags = null; + $.interceptorsForUncacheableTags = null; + $.initNativeDispatchFlag = null; + $._Record__computedFieldKeys = A._setArrayType([], A.findType("JSArray?>")); + $._nextCallback = null; + $._lastCallback = null; + $._lastPriorityCallback = null; + $._isInCallbackLoop = false; + $.Zone__current = B.C__RootZone; + $._RootZone__rootDelegate = null; + $.Uri__cachedBaseString = ""; + $.Uri__cachedBaseUri = null; + $._fs = null; + $._currentUriBase = null; + $._current = null; + $._subselectorPseudos = A.LinkedHashSet_LinkedHashSet$_literal(["is", "matches", "where", "any", "nth-child", "nth-last-child"], type$.String); + $._rootishPseudoClasses = A.LinkedHashSet_LinkedHashSet$_literal(["root", "scope", "host", "host-context"], type$.String); + $._features = A.LinkedHashSet_LinkedHashSet$_literal(["global-variable-shadowing", "extend-selector-pseudoclass", "units-level-3", "at-error", "custom-property"], type$.String); + $._realCaseCache = function() { + var t1 = type$.String; + return A.LinkedHashMap_LinkedHashMap$_empty(t1, t1); + }(); + $._selectorPseudoClasses = A.LinkedHashSet_LinkedHashSet$_literal(["not", "is", "matches", "where", "current", "any", "has", "host", "host-context"], type$.String); + $._selectorPseudoElements = A.LinkedHashSet_LinkedHashSet$_literal(["slotted"], type$.String); + $._glyphs = B.C_UnicodeGlyphSet; + $._rootishPseudoClasses0 = A.LinkedHashSet_LinkedHashSet$_literal(["root", "scope", "host", "host-context"], type$.String); + $._realCaseCache0 = function() { + var t1 = type$.String; + return A.LinkedHashMap_LinkedHashMap$_empty(t1, t1); + }(); + $._features0 = A.LinkedHashSet_LinkedHashSet$_literal(["global-variable-shadowing", "extend-selector-pseudoclass", "units-level-3", "at-error", "custom-property"], type$.String); + $._selectorPseudoClasses0 = A.LinkedHashSet_LinkedHashSet$_literal(["not", "is", "matches", "where", "current", "any", "has", "host", "host-context"], type$.String); + $._selectorPseudoElements0 = A.LinkedHashSet_LinkedHashSet$_literal(["slotted"], type$.String); + $._subselectorPseudos0 = A.LinkedHashSet_LinkedHashSet$_literal(["is", "matches", "where", "any", "nth-child", "nth-last-child"], type$.String); + })(); + (function lazyInitializers() { + var _lazyFinal = hunkHelpers.lazyFinal, + _lazy = hunkHelpers.lazy; + _lazyFinal($, "DART_CLOSURE_PROPERTY_NAME", "$get$DART_CLOSURE_PROPERTY_NAME", () => A.getIsolateAffinityTag("_$dart_dartClosure")); + _lazyFinal($, "nullFuture", "$get$nullFuture", () => B.C__RootZone.run$1$1(0, new A.nullFuture_closure(), A.findType("Future"))); + _lazyFinal($, "TypeErrorDecoder_noSuchMethodPattern", "$get$TypeErrorDecoder_noSuchMethodPattern", () => A.TypeErrorDecoder_extractPattern(A.TypeErrorDecoder_provokeCallErrorOn({ + toString: function() { + return "$receiver$"; + } + }))); + _lazyFinal($, "TypeErrorDecoder_notClosurePattern", "$get$TypeErrorDecoder_notClosurePattern", () => A.TypeErrorDecoder_extractPattern(A.TypeErrorDecoder_provokeCallErrorOn({$method$: null, + toString: function() { + return "$receiver$"; + } + }))); + _lazyFinal($, "TypeErrorDecoder_nullCallPattern", "$get$TypeErrorDecoder_nullCallPattern", () => A.TypeErrorDecoder_extractPattern(A.TypeErrorDecoder_provokeCallErrorOn(null))); + _lazyFinal($, "TypeErrorDecoder_nullLiteralCallPattern", "$get$TypeErrorDecoder_nullLiteralCallPattern", () => A.TypeErrorDecoder_extractPattern(function() { + var $argumentsExpr$ = "$arguments$"; + try { + null.$method$($argumentsExpr$); + } catch (e) { + return e.message; + } + }())); + _lazyFinal($, "TypeErrorDecoder_undefinedCallPattern", "$get$TypeErrorDecoder_undefinedCallPattern", () => A.TypeErrorDecoder_extractPattern(A.TypeErrorDecoder_provokeCallErrorOn(void 0))); + _lazyFinal($, "TypeErrorDecoder_undefinedLiteralCallPattern", "$get$TypeErrorDecoder_undefinedLiteralCallPattern", () => A.TypeErrorDecoder_extractPattern(function() { + var $argumentsExpr$ = "$arguments$"; + try { + (void 0).$method$($argumentsExpr$); + } catch (e) { + return e.message; + } + }())); + _lazyFinal($, "TypeErrorDecoder_nullPropertyPattern", "$get$TypeErrorDecoder_nullPropertyPattern", () => A.TypeErrorDecoder_extractPattern(A.TypeErrorDecoder_provokePropertyErrorOn(null))); + _lazyFinal($, "TypeErrorDecoder_nullLiteralPropertyPattern", "$get$TypeErrorDecoder_nullLiteralPropertyPattern", () => A.TypeErrorDecoder_extractPattern(function() { + try { + null.$method$; + } catch (e) { + return e.message; + } + }())); + _lazyFinal($, "TypeErrorDecoder_undefinedPropertyPattern", "$get$TypeErrorDecoder_undefinedPropertyPattern", () => A.TypeErrorDecoder_extractPattern(A.TypeErrorDecoder_provokePropertyErrorOn(void 0))); + _lazyFinal($, "TypeErrorDecoder_undefinedLiteralPropertyPattern", "$get$TypeErrorDecoder_undefinedLiteralPropertyPattern", () => A.TypeErrorDecoder_extractPattern(function() { + try { + (void 0).$method$; + } catch (e) { + return e.message; + } + }())); + _lazyFinal($, "_AsyncRun__scheduleImmediateClosure", "$get$_AsyncRun__scheduleImmediateClosure", () => A._AsyncRun__initializeScheduleImmediate()); + _lazyFinal($, "Future__nullFuture", "$get$Future__nullFuture", () => A.findType("_Future")._as($.$get$nullFuture())); + _lazyFinal($, "Future__falseFuture", "$get$Future__falseFuture", () => A._Future$zoneValue(false, B.C__RootZone, type$.bool)); + _lazyFinal($, "_RootZone__rootMap", "$get$_RootZone__rootMap", () => { + var t1 = type$.dynamic; + return A.HashMap_HashMap(t1, t1); + }); + _lazyFinal($, "_Utf8Decoder__reusableBuffer", "$get$_Utf8Decoder__reusableBuffer", () => A.NativeUint8List_NativeUint8List(4096)); + _lazyFinal($, "_Utf8Decoder__decoder", "$get$_Utf8Decoder__decoder", () => new A._Utf8Decoder__decoder_closure().call$0()); + _lazyFinal($, "_Utf8Decoder__decoderNonfatal", "$get$_Utf8Decoder__decoderNonfatal", () => new A._Utf8Decoder__decoderNonfatal_closure().call$0()); + _lazyFinal($, "_Base64Decoder__inverseAlphabet", "$get$_Base64Decoder__inverseAlphabet", () => A.NativeInt8List__create1(A._ensureNativeList(A._setArrayType([-2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -1, -2, -2, -2, -2, -2, 62, -2, 62, -2, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -2, -2, -2, -1, -2, -2, -2, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -2, -2, -2, -2, 63, -2, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -2, -2, -2, -2, -2], type$.JSArray_int)))); + _lazyFinal($, "_Uri__isWindowsCached", "$get$_Uri__isWindowsCached", () => typeof process != "undefined" && Object.prototype.toString.call(process) == "[object process]" && process.platform == "win32"); + _lazyFinal($, "_Uri__needsNoEncoding", "$get$_Uri__needsNoEncoding", () => A.RegExp_RegExp("^[\\-\\.0-9A-Z_a-z~]*$", false)); + _lazyFinal($, "_hashSeed", "$get$_hashSeed", () => A.objectHashCode(B.Type_Object_xQ6)); + _lazyFinal($, "_scannerTables", "$get$_scannerTables", () => A._createTables()); + _lazyFinal($, "Option__invalidChars", "$get$Option__invalidChars", () => A.RegExp_RegExp("[ \\t\\r\\n\"'\\\\/]", false)); + _lazyFinal($, "_isStrictMode", "$get$_isStrictMode", () => new A._isStrictMode_closure().call$0()); + _lazyFinal($, "alwaysValid", "$get$alwaysValid", () => new A.alwaysValid_closure()); + _lazyFinal($, "readline", "$get$readline", () => self.readline); + _lazyFinal($, "windows", "$get$windows", () => A.Context_Context($.$get$Style_windows())); + _lazyFinal($, "url", "$get$url", () => A.Context_Context($.$get$Style_url())); + _lazyFinal($, "context", "$get$context", () => new A.Context($.$get$Style_platform(), null)); + _lazyFinal($, "Style_posix", "$get$Style_posix", () => new A.PosixStyle(A.RegExp_RegExp("/", false), A.RegExp_RegExp("[^/]$", false), A.RegExp_RegExp("^/", false))); + _lazyFinal($, "Style_windows", "$get$Style_windows", () => new A.WindowsStyle(A.RegExp_RegExp("[/\\\\]", false), A.RegExp_RegExp("[^/\\\\]$", false), A.RegExp_RegExp("^(\\\\\\\\[^\\\\]+\\\\[^\\\\/]+|[a-zA-Z]:[/\\\\])", false), A.RegExp_RegExp("^[/\\\\](?![/\\\\])", false))); + _lazyFinal($, "Style_url", "$get$Style_url", () => new A.UrlStyle(A.RegExp_RegExp("/", false), A.RegExp_RegExp("(^[a-zA-Z][-+.a-zA-Z\\d]*://|[^/])$", false), A.RegExp_RegExp("[a-zA-Z][-+.a-zA-Z\\d]*://[^/]*", false), A.RegExp_RegExp("^/", false))); + _lazyFinal($, "Style_platform", "$get$Style_platform", () => A.Style__getPlatformStyle()); + _lazyFinal($, "startVersion", "$get$startVersion", () => A.RegExp_RegExp("^(\\d+)\\.(\\d+)\\.(\\d+)(-([0-9A-Za-z-]+(\\.[0-9A-Za-z-]+)*))?(\\+([0-9A-Za-z-]+(\\.[0-9A-Za-z-]+)*))?", false)); + _lazyFinal($, "completeVersion", "$get$completeVersion", () => A.RegExp_RegExp($.$get$startVersion().pattern + "$", false)); + _lazyFinal($, "IfExpression_declaration", "$get$IfExpression_declaration", () => A.ArgumentDeclaration_ArgumentDeclaration$parse(string$.x40funct, null)); + _lazyFinal($, "colorsByName", "$get$colorsByName", () => A.LinkedHashMap_LinkedHashMap$_literal(["yellowgreen", A.SassColor$rgb(154, 205, 50, 1), "yellow", A.SassColor$rgb(255, 255, 0, 1), "whitesmoke", A.SassColor$rgb(245, 245, 245, 1), "white", A.SassColor$rgb(255, 255, 255, 1), "wheat", A.SassColor$rgb(245, 222, 179, 1), "violet", A.SassColor$rgb(238, 130, 238, 1), "turquoise", A.SassColor$rgb(64, 224, 208, 1), "transparent", A.SassColor$rgb(0, 0, 0, 0), "tomato", A.SassColor$rgb(255, 99, 71, 1), "thistle", A.SassColor$rgb(216, 191, 216, 1), "teal", A.SassColor$rgb(0, 128, 128, 1), "tan", A.SassColor$rgb(210, 180, 140, 1), "steelblue", A.SassColor$rgb(70, 130, 180, 1), "springgreen", A.SassColor$rgb(0, 255, 127, 1), "snow", A.SassColor$rgb(255, 250, 250, 1), "slategrey", A.SassColor$rgb(112, 128, 144, 1), "slategray", A.SassColor$rgb(112, 128, 144, 1), "slateblue", A.SassColor$rgb(106, 90, 205, 1), "skyblue", A.SassColor$rgb(135, 206, 235, 1), "silver", A.SassColor$rgb(192, 192, 192, 1), "sienna", A.SassColor$rgb(160, 82, 45, 1), "seashell", A.SassColor$rgb(255, 245, 238, 1), "seagreen", A.SassColor$rgb(46, 139, 87, 1), "sandybrown", A.SassColor$rgb(244, 164, 96, 1), "salmon", A.SassColor$rgb(250, 128, 114, 1), "saddlebrown", A.SassColor$rgb(139, 69, 19, 1), "royalblue", A.SassColor$rgb(65, 105, 225, 1), "rosybrown", A.SassColor$rgb(188, 143, 143, 1), "red", A.SassColor$rgb(255, 0, 0, 1), "rebeccapurple", A.SassColor$rgb(102, 51, 153, 1), "purple", A.SassColor$rgb(128, 0, 128, 1), "powderblue", A.SassColor$rgb(176, 224, 230, 1), "plum", A.SassColor$rgb(221, 160, 221, 1), "pink", A.SassColor$rgb(255, 192, 203, 1), "peru", A.SassColor$rgb(205, 133, 63, 1), "peachpuff", A.SassColor$rgb(255, 218, 185, 1), "papayawhip", A.SassColor$rgb(255, 239, 213, 1), "palevioletred", A.SassColor$rgb(219, 112, 147, 1), "paleturquoise", A.SassColor$rgb(175, 238, 238, 1), "palegreen", A.SassColor$rgb(152, 251, 152, 1), "palegoldenrod", A.SassColor$rgb(238, 232, 170, 1), "orchid", A.SassColor$rgb(218, 112, 214, 1), "orangered", A.SassColor$rgb(255, 69, 0, 1), "orange", A.SassColor$rgb(255, 165, 0, 1), "olivedrab", A.SassColor$rgb(107, 142, 35, 1), "olive", A.SassColor$rgb(128, 128, 0, 1), "oldlace", A.SassColor$rgb(253, 245, 230, 1), "navy", A.SassColor$rgb(0, 0, 128, 1), "navajowhite", A.SassColor$rgb(255, 222, 173, 1), "moccasin", A.SassColor$rgb(255, 228, 181, 1), "mistyrose", A.SassColor$rgb(255, 228, 225, 1), "mintcream", A.SassColor$rgb(245, 255, 250, 1), "midnightblue", A.SassColor$rgb(25, 25, 112, 1), "mediumvioletred", A.SassColor$rgb(199, 21, 133, 1), "mediumturquoise", A.SassColor$rgb(72, 209, 204, 1), "mediumspringgreen", A.SassColor$rgb(0, 250, 154, 1), "mediumslateblue", A.SassColor$rgb(123, 104, 238, 1), "mediumseagreen", A.SassColor$rgb(60, 179, 113, 1), "mediumpurple", A.SassColor$rgb(147, 112, 219, 1), "mediumorchid", A.SassColor$rgb(186, 85, 211, 1), "mediumblue", A.SassColor$rgb(0, 0, 205, 1), "mediumaquamarine", A.SassColor$rgb(102, 205, 170, 1), "maroon", A.SassColor$rgb(128, 0, 0, 1), "magenta", A.SassColor$rgb(255, 0, 255, 1), "linen", A.SassColor$rgb(250, 240, 230, 1), "limegreen", A.SassColor$rgb(50, 205, 50, 1), "lime", A.SassColor$rgb(0, 255, 0, 1), "lightyellow", A.SassColor$rgb(255, 255, 224, 1), "lightsteelblue", A.SassColor$rgb(176, 196, 222, 1), "lightslategrey", A.SassColor$rgb(119, 136, 153, 1), "lightslategray", A.SassColor$rgb(119, 136, 153, 1), "lightskyblue", A.SassColor$rgb(135, 206, 250, 1), "lightseagreen", A.SassColor$rgb(32, 178, 170, 1), "lightsalmon", A.SassColor$rgb(255, 160, 122, 1), "lightpink", A.SassColor$rgb(255, 182, 193, 1), "lightgrey", A.SassColor$rgb(211, 211, 211, 1), "lightgreen", A.SassColor$rgb(144, 238, 144, 1), "lightgray", A.SassColor$rgb(211, 211, 211, 1), "lightgoldenrodyellow", A.SassColor$rgb(250, 250, 210, 1), "lightcyan", A.SassColor$rgb(224, 255, 255, 1), "lightcoral", A.SassColor$rgb(240, 128, 128, 1), "lightblue", A.SassColor$rgb(173, 216, 230, 1), "lemonchiffon", A.SassColor$rgb(255, 250, 205, 1), "lawngreen", A.SassColor$rgb(124, 252, 0, 1), "lavenderblush", A.SassColor$rgb(255, 240, 245, 1), "lavender", A.SassColor$rgb(230, 230, 250, 1), "khaki", A.SassColor$rgb(240, 230, 140, 1), "ivory", A.SassColor$rgb(255, 255, 240, 1), "indigo", A.SassColor$rgb(75, 0, 130, 1), "indianred", A.SassColor$rgb(205, 92, 92, 1), "hotpink", A.SassColor$rgb(255, 105, 180, 1), "honeydew", A.SassColor$rgb(240, 255, 240, 1), "grey", A.SassColor$rgb(128, 128, 128, 1), "greenyellow", A.SassColor$rgb(173, 255, 47, 1), "green", A.SassColor$rgb(0, 128, 0, 1), "gray", A.SassColor$rgb(128, 128, 128, 1), "goldenrod", A.SassColor$rgb(218, 165, 32, 1), "gold", A.SassColor$rgb(255, 215, 0, 1), "ghostwhite", A.SassColor$rgb(248, 248, 255, 1), "gainsboro", A.SassColor$rgb(220, 220, 220, 1), "fuchsia", A.SassColor$rgb(255, 0, 255, 1), "forestgreen", A.SassColor$rgb(34, 139, 34, 1), "floralwhite", A.SassColor$rgb(255, 250, 240, 1), "firebrick", A.SassColor$rgb(178, 34, 34, 1), "dodgerblue", A.SassColor$rgb(30, 144, 255, 1), "dimgrey", A.SassColor$rgb(105, 105, 105, 1), "dimgray", A.SassColor$rgb(105, 105, 105, 1), "deepskyblue", A.SassColor$rgb(0, 191, 255, 1), "deeppink", A.SassColor$rgb(255, 20, 147, 1), "darkviolet", A.SassColor$rgb(148, 0, 211, 1), "darkturquoise", A.SassColor$rgb(0, 206, 209, 1), "darkslategrey", A.SassColor$rgb(47, 79, 79, 1), "darkslategray", A.SassColor$rgb(47, 79, 79, 1), "darkslateblue", A.SassColor$rgb(72, 61, 139, 1), "darkseagreen", A.SassColor$rgb(143, 188, 143, 1), "darksalmon", A.SassColor$rgb(233, 150, 122, 1), "darkred", A.SassColor$rgb(139, 0, 0, 1), "darkorchid", A.SassColor$rgb(153, 50, 204, 1), "darkorange", A.SassColor$rgb(255, 140, 0, 1), "darkolivegreen", A.SassColor$rgb(85, 107, 47, 1), "darkmagenta", A.SassColor$rgb(139, 0, 139, 1), "darkkhaki", A.SassColor$rgb(189, 183, 107, 1), "darkgrey", A.SassColor$rgb(169, 169, 169, 1), "darkgreen", A.SassColor$rgb(0, 100, 0, 1), "darkgray", A.SassColor$rgb(169, 169, 169, 1), "darkgoldenrod", A.SassColor$rgb(184, 134, 11, 1), "darkcyan", A.SassColor$rgb(0, 139, 139, 1), "darkblue", A.SassColor$rgb(0, 0, 139, 1), "cyan", A.SassColor$rgb(0, 255, 255, 1), "crimson", A.SassColor$rgb(220, 20, 60, 1), "cornsilk", A.SassColor$rgb(255, 248, 220, 1), "cornflowerblue", A.SassColor$rgb(100, 149, 237, 1), "coral", A.SassColor$rgb(255, 127, 80, 1), "chocolate", A.SassColor$rgb(210, 105, 30, 1), "chartreuse", A.SassColor$rgb(127, 255, 0, 1), "cadetblue", A.SassColor$rgb(95, 158, 160, 1), "burlywood", A.SassColor$rgb(222, 184, 135, 1), "brown", A.SassColor$rgb(165, 42, 42, 1), "blueviolet", A.SassColor$rgb(138, 43, 226, 1), "blue", A.SassColor$rgb(0, 0, 255, 1), "blanchedalmond", A.SassColor$rgb(255, 235, 205, 1), "black", A.SassColor$rgb(0, 0, 0, 1), "bisque", A.SassColor$rgb(255, 228, 196, 1), "beige", A.SassColor$rgb(245, 245, 220, 1), "azure", A.SassColor$rgb(240, 255, 255, 1), "aquamarine", A.SassColor$rgb(127, 255, 212, 1), "aqua", A.SassColor$rgb(0, 255, 255, 1), "antiquewhite", A.SassColor$rgb(250, 235, 215, 1), "aliceblue", A.SassColor$rgb(240, 248, 255, 1)], type$.String, type$.SassColor)); + _lazyFinal($, "namesByColor", "$get$namesByColor", () => { + var $name, + t1 = type$.SassColor, + t2 = type$.String, + t3 = A.LinkedHashMap_LinkedHashMap$_empty(t1, t2); + for (t1 = A.MapExtensions_get_pairs($.$get$colorsByName(), t2, t1), t1 = t1.get$iterator(t1); t1.moveNext$0();) { + t2 = t1.get$current(t1); + $name = t2._0; + t3.$indexSet(0, t2._1, $name); + } + return t3; + }); + _lazyFinal($, "ExecutableOptions__separatorBar", "$get$ExecutableOptions__separatorBar", () => A.isWindows() ? "=" : "\u2501"); + _lazyFinal($, "ExecutableOptions__parser", "$get$ExecutableOptions__parser", () => new A.ExecutableOptions__parser_closure().call$0()); + _lazyFinal($, "globalFunctions", "$get$globalFunctions", () => { + var t1 = type$.BuiltInCallable, + t2 = A.List_List$of($.$get$global0(), true, t1); + B.JSArray_methods.addAll$1(t2, $.$get$global1()); + B.JSArray_methods.addAll$1(t2, $.$get$global2()); + B.JSArray_methods.addAll$1(t2, $.$get$global3()); + B.JSArray_methods.addAll$1(t2, $.$get$global4()); + B.JSArray_methods.addAll$1(t2, $.$get$global5()); + B.JSArray_methods.addAll$1(t2, $.$get$global()); + t2.push(A.BuiltInCallable$function("if", "$condition, $if-true, $if-false", new A.globalFunctions_closure(), null)); + return A.UnmodifiableListView$(t2, t1); + }); + _lazyFinal($, "coreModules", "$get$coreModules", () => A.UnmodifiableListView$(A._setArrayType([$.$get$module(), $.$get$module0(), $.$get$module1(), $.$get$module2(), $.$get$module3(), $.$get$module4()], A.findType("JSArray>")), type$.BuiltInModule_Callable)); + _lazyFinal($, "_microsoftFilterStart", "$get$_microsoftFilterStart", () => A.RegExp_RegExp("^[a-zA-Z]+\\s*=", false)); + _lazyFinal($, "global", "$get$global0", () => { + var _s27_ = "$red, $green, $blue, $alpha", + _s19_ = "$red, $green, $blue", + _s37_ = "$hue, $saturation, $lightness, $alpha", + _s29_ = "$hue, $saturation, $lightness", + _s17_ = "$hue, $saturation", + _s15_ = "$color, $amount", + t1 = type$.String, + t2 = type$.Value_Function_List_Value; + return A.UnmodifiableListView$(A._setArrayType([$.$get$_red(), $.$get$_green(), $.$get$_blue(), $.$get$_mix(), A.BuiltInCallable$overloadedFunction("rgb", A.LinkedHashMap_LinkedHashMap$_literal([_s27_, new A.global_closure0(), _s19_, new A.global_closure1(), "$color, $alpha", new A.global_closure2(), "$channels", new A.global_closure3()], t1, t2)), A.BuiltInCallable$overloadedFunction("rgba", A.LinkedHashMap_LinkedHashMap$_literal([_s27_, new A.global_closure4(), _s19_, new A.global_closure5(), "$color, $alpha", new A.global_closure6(), "$channels", new A.global_closure7()], t1, t2)), A._function4("invert", "$color, $weight: 100%", new A.global_closure8()), $.$get$_hue(), $.$get$_saturation(), $.$get$_lightness(), $.$get$_complement(), A.BuiltInCallable$overloadedFunction("hsl", A.LinkedHashMap_LinkedHashMap$_literal([_s37_, new A.global_closure9(), _s29_, new A.global_closure10(), _s17_, new A.global_closure11(), "$channels", new A.global_closure12()], t1, t2)), A.BuiltInCallable$overloadedFunction("hsla", A.LinkedHashMap_LinkedHashMap$_literal([_s37_, new A.global_closure13(), _s29_, new A.global_closure14(), _s17_, new A.global_closure15(), "$channels", new A.global_closure16()], t1, t2)), A._function4("grayscale", "$color", new A.global_closure17()), A._function4("adjust-hue", "$color, $degrees", new A.global_closure18()), A._function4("lighten", _s15_, new A.global_closure19()), A._function4("darken", _s15_, new A.global_closure20()), A.BuiltInCallable$overloadedFunction("saturate", A.LinkedHashMap_LinkedHashMap$_literal(["$amount", new A.global_closure21(), "$color, $amount", new A.global_closure22()], t1, t2)), A._function4("desaturate", _s15_, new A.global_closure23()), A._function4("opacify", _s15_, A.color0___opacify$closure()), A._function4("fade-in", _s15_, A.color0___opacify$closure()), A._function4("transparentize", _s15_, A.color0___transparentize$closure()), A._function4("fade-out", _s15_, A.color0___transparentize$closure()), A.BuiltInCallable$overloadedFunction("alpha", A.LinkedHashMap_LinkedHashMap$_literal(["$color", new A.global_closure24(), "$args...", new A.global_closure25()], t1, t2)), A._function4("opacity", "$color", new A.global_closure26()), $.$get$_ieHexStr(), $.$get$_adjust().withName$1("adjust-color"), $.$get$_scale().withName$1("scale-color"), $.$get$_change().withName$1("change-color")], type$.JSArray_BuiltInCallable), type$.BuiltInCallable); + }); + _lazyFinal($, "module", "$get$module", () => { + var _s9_ = "lightness", + _s10_ = "saturation", + _s6_ = "$color", _s5_ = "alpha", + t1 = type$.String, + t2 = type$.Value_Function_List_Value; + return A.BuiltInModule$("color", A._setArrayType([$.$get$_red(), $.$get$_green(), $.$get$_blue(), $.$get$_mix(), A._function4("invert", "$color, $weight: 100%", new A.module_closure1()), $.$get$_hue(), $.$get$_saturation(), $.$get$_lightness(), $.$get$_complement(), A._removedColorFunction("adjust-hue", "hue", false), A._removedColorFunction("lighten", _s9_, false), A._removedColorFunction("darken", _s9_, true), A._removedColorFunction("saturate", _s10_, false), A._removedColorFunction("desaturate", _s10_, true), A._function4("grayscale", _s6_, new A.module_closure2()), A.BuiltInCallable$overloadedFunction("hwb", A.LinkedHashMap_LinkedHashMap$_literal(["$hue, $whiteness, $blackness, $alpha: 1", new A.module_closure3(), "$channels", new A.module_closure4()], t1, t2)), A._function4("whiteness", _s6_, new A.module_closure5()), A._function4("blackness", _s6_, new A.module_closure6()), A._removedColorFunction("opacify", _s5_, false), A._removedColorFunction("fade-in", _s5_, false), A._removedColorFunction("transparentize", _s5_, true), A._removedColorFunction("fade-out", _s5_, true), A.BuiltInCallable$overloadedFunction(_s5_, A.LinkedHashMap_LinkedHashMap$_literal(["$color", new A.module_closure7(), "$args...", new A.module_closure8()], t1, t2)), A._function4("opacity", _s6_, new A.module_closure9()), $.$get$_adjust(), $.$get$_scale(), $.$get$_change(), $.$get$_ieHexStr()], type$.JSArray_Callable), null, null, type$.Callable); + }); + _lazyFinal($, "_red", "$get$_red", () => A._function4("red", "$color", new A._red_closure())); + _lazyFinal($, "_green", "$get$_green", () => A._function4("green", "$color", new A._green_closure())); + _lazyFinal($, "_blue", "$get$_blue", () => A._function4("blue", "$color", new A._blue_closure())); + _lazyFinal($, "_mix", "$get$_mix", () => A._function4("mix", "$color1, $color2, $weight: 50%", new A._mix_closure())); + _lazyFinal($, "_hue", "$get$_hue", () => A._function4("hue", "$color", new A._hue_closure())); + _lazyFinal($, "_saturation", "$get$_saturation", () => A._function4("saturation", "$color", new A._saturation_closure())); + _lazyFinal($, "_lightness", "$get$_lightness", () => A._function4("lightness", "$color", new A._lightness_closure())); + _lazyFinal($, "_complement", "$get$_complement", () => A._function4("complement", "$color", new A._complement_closure())); + _lazyFinal($, "_adjust", "$get$_adjust", () => A._function4("adjust", "$color, $kwargs...", new A._adjust_closure())); + _lazyFinal($, "_scale", "$get$_scale", () => A._function4("scale", "$color, $kwargs...", new A._scale_closure())); + _lazyFinal($, "_change", "$get$_change", () => A._function4("change", "$color, $kwargs...", new A._change_closure())); + _lazyFinal($, "_ieHexStr", "$get$_ieHexStr", () => A._function4("ie-hex-str", "$color", new A._ieHexStr_closure())); + _lazyFinal($, "global0", "$get$global1", () => A.UnmodifiableListView$(A._setArrayType([$.$get$_length0(), $.$get$_nth(), $.$get$_setNth(), $.$get$_join(), $.$get$_append0(), $.$get$_zip(), $.$get$_index0(), $.$get$_isBracketed(), $.$get$_separator().withName$1("list-separator")], type$.JSArray_BuiltInCallable), type$.BuiltInCallable)); + _lazyFinal($, "module0", "$get$module0", () => A.BuiltInModule$("list", A._setArrayType([$.$get$_length0(), $.$get$_nth(), $.$get$_setNth(), $.$get$_join(), $.$get$_append0(), $.$get$_zip(), $.$get$_index0(), $.$get$_isBracketed(), $.$get$_separator(), $.$get$_slash()], type$.JSArray_Callable), null, null, type$.Callable)); + _lazyFinal($, "_length", "$get$_length0", () => A._function3("length", "$list", new A._length_closure0())); + _lazyFinal($, "_nth", "$get$_nth", () => A._function3("nth", "$list, $n", new A._nth_closure())); + _lazyFinal($, "_setNth", "$get$_setNth", () => A._function3("set-nth", "$list, $n, $value", new A._setNth_closure())); + _lazyFinal($, "_join", "$get$_join", () => A._function3("join", string$.x24list1, new A._join_closure())); + _lazyFinal($, "_append", "$get$_append0", () => A._function3("append", "$list, $val, $separator: auto", new A._append_closure0())); + _lazyFinal($, "_zip", "$get$_zip", () => A._function3("zip", "$lists...", new A._zip_closure())); + _lazyFinal($, "_index", "$get$_index0", () => A._function3("index", "$list, $value", new A._index_closure0())); + _lazyFinal($, "_separator", "$get$_separator", () => A._function3("separator", "$list", new A._separator_closure())); + _lazyFinal($, "_isBracketed", "$get$_isBracketed", () => A._function3("is-bracketed", "$list", new A._isBracketed_closure())); + _lazyFinal($, "_slash", "$get$_slash", () => A._function3("slash", "$elements...", new A._slash_closure())); + _lazyFinal($, "global1", "$get$global2", () => A.UnmodifiableListView$(A._setArrayType([$.$get$_get().withName$1("map-get"), $.$get$_merge().withName$1("map-merge"), $.$get$_remove().withName$1("map-remove"), $.$get$_keys().withName$1("map-keys"), $.$get$_values().withName$1("map-values"), $.$get$_hasKey().withName$1("map-has-key")], type$.JSArray_BuiltInCallable), type$.BuiltInCallable)); + _lazyFinal($, "module1", "$get$module1", () => A.BuiltInModule$("map", A._setArrayType([$.$get$_get(), $.$get$_set(), $.$get$_merge(), $.$get$_remove(), $.$get$_keys(), $.$get$_values(), $.$get$_hasKey(), $.$get$_deepMerge(), $.$get$_deepRemove()], type$.JSArray_Callable), null, null, type$.Callable)); + _lazyFinal($, "_get", "$get$_get", () => A._function2("get", "$map, $key, $keys...", new A._get_closure())); + _lazyFinal($, "_set", "$get$_set", () => A.BuiltInCallable$overloadedFunction("set", A.LinkedHashMap_LinkedHashMap$_literal(["$map, $key, $value", new A._set_closure(), "$map, $args...", new A._set_closure0()], type$.String, type$.Value_Function_List_Value))); + _lazyFinal($, "_merge", "$get$_merge", () => A.BuiltInCallable$overloadedFunction("merge", A.LinkedHashMap_LinkedHashMap$_literal(["$map1, $map2", new A._merge_closure(), "$map1, $args...", new A._merge_closure0()], type$.String, type$.Value_Function_List_Value))); + _lazyFinal($, "_deepMerge", "$get$_deepMerge", () => A._function2("deep-merge", "$map1, $map2", new A._deepMerge_closure())); + _lazyFinal($, "_deepRemove", "$get$_deepRemove", () => A._function2("deep-remove", "$map, $key, $keys...", new A._deepRemove_closure())); + _lazyFinal($, "_remove", "$get$_remove", () => A.BuiltInCallable$overloadedFunction("remove", A.LinkedHashMap_LinkedHashMap$_literal(["$map", new A._remove_closure(), "$map, $key, $keys...", new A._remove_closure0()], type$.String, type$.Value_Function_List_Value))); + _lazyFinal($, "_keys", "$get$_keys", () => A._function2("keys", "$map", new A._keys_closure())); + _lazyFinal($, "_values", "$get$_values", () => A._function2("values", "$map", new A._values_closure())); + _lazyFinal($, "_hasKey", "$get$_hasKey", () => A._function2("has-key", "$map, $key, $keys...", new A._hasKey_closure())); + _lazyFinal($, "global2", "$get$global3", () => A.UnmodifiableListView$(A._setArrayType([A._function1("abs", "$number", new A.global_closure()), $.$get$_ceil(), $.$get$_floor(), $.$get$_max(), $.$get$_min(), $.$get$_percentage(), $.$get$_randomFunction(), $.$get$_round(), $.$get$_unit(), $.$get$_compatible().withName$1("comparable"), $.$get$_isUnitless().withName$1("unitless")], type$.JSArray_BuiltInCallable), type$.BuiltInCallable)); + _lazyFinal($, "module2", "$get$module2", () => { + var _null = null; + return A.BuiltInModule$("math", A._setArrayType([A._numberFunction("abs", new A.module_closure0()), $.$get$_acos(), $.$get$_asin(), $.$get$_atan(), $.$get$_atan2(), $.$get$_ceil(), $.$get$_clamp(), $.$get$_cos(), $.$get$_compatible(), $.$get$_floor(), $.$get$_hypot(), $.$get$_isUnitless(), $.$get$_log(), $.$get$_max(), $.$get$_min(), $.$get$_percentage(), $.$get$_pow(), $.$get$_randomFunction(), $.$get$_round(), $.$get$_sin(), $.$get$_sqrt(), $.$get$_tan(), $.$get$_unit(), $.$get$_div()], type$.JSArray_Callable), _null, A.LinkedHashMap_LinkedHashMap$_literal(["e", A.SassNumber_SassNumber(2.718281828459045, _null), "pi", A.SassNumber_SassNumber(3.141592653589793, _null), "epsilon", A.SassNumber_SassNumber(2220446049250313e-31, _null), "max-safe-integer", A.SassNumber_SassNumber(9007199254740991, _null), "min-safe-integer", A.SassNumber_SassNumber(-9007199254740991, _null), "max-number", A.SassNumber_SassNumber(17976931348623157e292, _null), "min-number", A.SassNumber_SassNumber(5e-324, _null)], type$.String, type$.Value), type$.Callable); + }); + _lazyFinal($, "_ceil", "$get$_ceil", () => A._numberFunction("ceil", new A._ceil_closure())); + _lazyFinal($, "_clamp", "$get$_clamp", () => A._function1("clamp", "$min, $number, $max", new A._clamp_closure())); + _lazyFinal($, "_floor", "$get$_floor", () => A._numberFunction("floor", new A._floor_closure())); + _lazyFinal($, "_max", "$get$_max", () => A._function1("max", "$numbers...", new A._max_closure())); + _lazyFinal($, "_min", "$get$_min", () => A._function1("min", "$numbers...", new A._min_closure())); + _lazyFinal($, "_round", "$get$_round", () => A._numberFunction("round", new A._round_closure())); + _lazyFinal($, "_hypot", "$get$_hypot", () => A._function1("hypot", "$numbers...", new A._hypot_closure())); + _lazyFinal($, "_log", "$get$_log", () => A._function1("log", "$number, $base: null", new A._log_closure())); + _lazyFinal($, "_pow", "$get$_pow", () => A._function1("pow", "$base, $exponent", new A._pow_closure())); + _lazyFinal($, "_sqrt", "$get$_sqrt", () => A._singleArgumentMathFunc("sqrt", A.number0__sqrt$closure())); + _lazyFinal($, "_acos", "$get$_acos", () => A._singleArgumentMathFunc("acos", A.number0__acos$closure())); + _lazyFinal($, "_asin", "$get$_asin", () => A._singleArgumentMathFunc("asin", A.number0__asin$closure())); + _lazyFinal($, "_atan", "$get$_atan", () => A._singleArgumentMathFunc("atan", A.number0__atan$closure())); + _lazyFinal($, "_atan2", "$get$_atan2", () => A._function1("atan2", "$y, $x", new A._atan2_closure())); + _lazyFinal($, "_cos", "$get$_cos", () => A._singleArgumentMathFunc("cos", A.number0__cos$closure())); + _lazyFinal($, "_sin", "$get$_sin", () => A._singleArgumentMathFunc("sin", A.number0__sin$closure())); + _lazyFinal($, "_tan", "$get$_tan", () => A._singleArgumentMathFunc("tan", A.number0__tan$closure())); + _lazyFinal($, "_compatible", "$get$_compatible", () => A._function1("compatible", "$number1, $number2", new A._compatible_closure())); + _lazyFinal($, "_isUnitless", "$get$_isUnitless", () => A._function1("is-unitless", "$number", new A._isUnitless_closure())); + _lazyFinal($, "_unit", "$get$_unit", () => A._function1("unit", "$number", new A._unit_closure())); + _lazyFinal($, "_percentage", "$get$_percentage", () => A._function1("percentage", "$number", new A._percentage_closure())); + _lazyFinal($, "_random", "$get$_random0", () => A.Random_Random()); + _lazyFinal($, "_randomFunction", "$get$_randomFunction", () => A._function1("random", "$limit: null", new A._randomFunction_closure())); + _lazyFinal($, "_div", "$get$_div", () => A._function1("div", "$number1, $number2", new A._div_closure())); + _lazyFinal($, "global3", "$get$global", () => A.UnmodifiableListView$(A._setArrayType([A._function5("feature-exists", "$feature", new A.global_closure27()), A._function5("inspect", "$value", new A.global_closure28()), A._function5("type-of", "$value", new A.global_closure29()), A._function5("keywords", "$args", new A.global_closure30())], type$.JSArray_BuiltInCallable), type$.BuiltInCallable)); + _lazyFinal($, "local", "$get$local", () => A.UnmodifiableListView$(A._setArrayType([A._function5("calc-name", "$calc", new A.local_closure()), A._function5("calc-args", "$calc", new A.local_closure0()), A._function5("accepts-content", "$mixin", new A.local_closure1())], type$.JSArray_BuiltInCallable), type$.BuiltInCallable)); + _lazyFinal($, "global4", "$get$global4", () => A.UnmodifiableListView$(A._setArrayType([$.$get$_isSuperselector(), $.$get$_simpleSelectors(), $.$get$_parse().withName$1("selector-parse"), $.$get$_nest().withName$1("selector-nest"), $.$get$_append().withName$1("selector-append"), $.$get$_extend().withName$1("selector-extend"), $.$get$_replace().withName$1("selector-replace"), $.$get$_unify().withName$1("selector-unify")], type$.JSArray_BuiltInCallable), type$.BuiltInCallable)); + _lazyFinal($, "module3", "$get$module3", () => A.BuiltInModule$("selector", A._setArrayType([$.$get$_isSuperselector(), $.$get$_simpleSelectors(), $.$get$_parse(), $.$get$_nest(), $.$get$_append(), $.$get$_extend(), $.$get$_replace(), $.$get$_unify()], type$.JSArray_Callable), null, null, type$.Callable)); + _lazyFinal($, "_nest", "$get$_nest", () => A._function0("nest", "$selectors...", new A._nest_closure())); + _lazyFinal($, "_append0", "$get$_append", () => A._function0("append", "$selectors...", new A._append_closure())); + _lazyFinal($, "_extend", "$get$_extend", () => A._function0("extend", "$selector, $extendee, $extender", new A._extend_closure())); + _lazyFinal($, "_replace", "$get$_replace", () => A._function0("replace", "$selector, $original, $replacement", new A._replace_closure())); + _lazyFinal($, "_unify", "$get$_unify", () => A._function0("unify", "$selector1, $selector2", new A._unify_closure())); + _lazyFinal($, "_isSuperselector", "$get$_isSuperselector", () => A._function0("is-superselector", "$super, $sub", new A._isSuperselector_closure())); + _lazyFinal($, "_simpleSelectors", "$get$_simpleSelectors", () => A._function0("simple-selectors", "$selector", new A._simpleSelectors_closure())); + _lazyFinal($, "_parse", "$get$_parse", () => A._function0("parse", "$selector", new A._parse_closure())); + _lazyFinal($, "_random0", "$get$_random", () => A.Random_Random()); + _lazy($, "_previousUniqueId", "$get$_previousUniqueId", () => $.$get$_random().nextInt$1(A._asInt(A.pow(36, 6)))); + _lazyFinal($, "global5", "$get$global5", () => A.UnmodifiableListView$(A._setArrayType([$.$get$_unquote(), $.$get$_quote(), $.$get$_toUpperCase(), $.$get$_toLowerCase(), $.$get$_uniqueId(), $.$get$_length().withName$1("str-length"), $.$get$_insert().withName$1("str-insert"), $.$get$_index().withName$1("str-index"), $.$get$_slice().withName$1("str-slice")], type$.JSArray_BuiltInCallable), type$.BuiltInCallable)); + _lazyFinal($, "module4", "$get$module4", () => A.BuiltInModule$("string", A._setArrayType([$.$get$_unquote(), $.$get$_quote(), $.$get$_toUpperCase(), $.$get$_toLowerCase(), $.$get$_length(), $.$get$_insert(), $.$get$_index(), $.$get$_slice(), $.$get$_uniqueId(), A._function("split", "$string, $separator, $limit: null", new A.module_closure())], type$.JSArray_Callable), null, null, type$.Callable)); + _lazyFinal($, "_unquote", "$get$_unquote", () => A._function("unquote", "$string", new A._unquote_closure())); + _lazyFinal($, "_quote", "$get$_quote", () => A._function("quote", "$string", new A._quote_closure())); + _lazyFinal($, "_length0", "$get$_length", () => A._function("length", "$string", new A._length_closure())); + _lazyFinal($, "_insert", "$get$_insert", () => A._function("insert", "$string, $insert, $index", new A._insert_closure())); + _lazyFinal($, "_index0", "$get$_index", () => A._function("index", "$string, $substring", new A._index_closure())); + _lazyFinal($, "_slice", "$get$_slice", () => A._function("slice", "$string, $start-at, $end-at: -1", new A._slice_closure())); + _lazyFinal($, "_toUpperCase", "$get$_toUpperCase", () => A._function("to-upper-case", "$string", new A._toUpperCase_closure())); + _lazyFinal($, "_toLowerCase", "$get$_toLowerCase", () => A._function("to-lower-case", "$string", new A._toLowerCase_closure())); + _lazyFinal($, "_uniqueId", "$get$_uniqueId", () => A._function("unique-id", "", new A._uniqueId_closure())); + _lazyFinal($, "FilesystemImporter_cwd", "$get$FilesystemImporter_cwd", () => A.FilesystemImporter$(".")); + _lazyFinal($, "_jsThrow", "$get$_jsThrow0", () => new self.Function("error", "throw error;")); + _lazyFinal($, "Logger_quiet", "$get$Logger_quiet", () => new A._QuietLogger()); + _lazyFinal($, "_disallowedFunctionNames", "$get$_disallowedFunctionNames", () => { + var t1 = $.$get$globalFunctions(); + t1 = t1.map$1$1(t1, new A._disallowedFunctionNames_closure(), type$.String).toSet$0(0); + t1.add$1(0, "if"); + t1.remove$1(0, "rgb"); + t1.remove$1(0, "rgba"); + t1.remove$1(0, "hsl"); + t1.remove$1(0, "hsla"); + t1.remove$1(0, "grayscale"); + t1.remove$1(0, "invert"); + t1.remove$1(0, "alpha"); + t1.remove$1(0, "opacity"); + t1.remove$1(0, "saturate"); + t1.remove$1(0, "min"); + t1.remove$1(0, "max"); + t1.remove$1(0, "round"); + t1.remove$1(0, "abs"); + return t1; + }); + _lazyFinal($, "_epsilon", "$get$_epsilon", () => A.pow(10, -11)); + _lazyFinal($, "_inverseEpsilon", "$get$_inverseEpsilon", () => A.pow(10, 11)); + _lazyFinal($, "bogusSpan", "$get$bogusSpan", () => A.SourceFile$decoded(A._setArrayType([], type$.JSArray_int), null).span$1(0, 0)); + _lazyFinal($, "_noSourceUrl", "$get$_noSourceUrl", () => A.Uri_parse("-")); + _lazyFinal($, "_traces", "$get$_traces", () => A.Expando$()); + _lazyFinal($, "_typesByUnit", "$get$_typesByUnit", () => { + var t3, type, + t1 = type$.String, + t2 = A.LinkedHashMap_LinkedHashMap$_empty(t1, t1); + for (t1 = A.MapExtensions_get_pairs(B.Map_ws7dy, t1, type$.List_String), t1 = t1.get$iterator(t1); t1.moveNext$0();) { + t3 = t1.get$current(t1); + type = t3._0; + for (t3 = J.get$iterator$ax(t3._1); t3.moveNext$0();) + t2.$indexSet(0, t3.get$current(t3), type); + } + return t2; + }); + _lazyFinal($, "_knownCompatibilitiesByUnit", "$get$_knownCompatibilitiesByUnit", () => { + var _i, set, t2, + t1 = A.LinkedHashMap_LinkedHashMap$_empty(type$.String, A.findType("Set")); + for (_i = 0; _i < 5; ++_i) { + set = B.List_gyp[_i]; + for (t2 = set.get$iterator(set); t2.moveNext$0();) + t1.$indexSet(0, t2.get$current(0), set); + } + return t1; + }); + _lazyFinal($, "_emptyQuoted", "$get$_emptyQuoted", () => A.SassString$("", true)); + _lazyFinal($, "_emptyUnquoted", "$get$_emptyUnquoted", () => A.SassString$("", false)); + _lazyFinal($, "maxInt32", "$get$maxInt32", () => A._asInt(A.pow(2, 31)) - 1); + _lazyFinal($, "minInt32", "$get$minInt32", () => -A._asInt(A.pow(2, 31))); + _lazyFinal($, "_vmFrame", "$get$_vmFrame", () => A.RegExp_RegExp("^#\\d+\\s+(\\S.*) \\((.+?)((?::\\d+){0,2})\\)$", false)); + _lazyFinal($, "_v8Frame", "$get$_v8Frame", () => A.RegExp_RegExp("^\\s*at (?:(\\S.*?)(?: \\[as [^\\]]+\\])? \\((.*)\\)|(.*))$", false)); + _lazyFinal($, "_v8UrlLocation", "$get$_v8UrlLocation", () => A.RegExp_RegExp("^(.*?):(\\d+)(?::(\\d+))?$|native$", false)); + _lazyFinal($, "_v8EvalLocation", "$get$_v8EvalLocation", () => A.RegExp_RegExp("^eval at (?:\\S.*?) \\((.*)\\)(?:, .*?:\\d+:\\d+)?$", false)); + _lazyFinal($, "_firefoxEvalLocation", "$get$_firefoxEvalLocation", () => A.RegExp_RegExp("(\\S+)@(\\S+) line (\\d+) >.* (Function|eval):\\d+:\\d+", false)); + _lazyFinal($, "_firefoxSafariFrame", "$get$_firefoxSafariFrame", () => A.RegExp_RegExp("^(?:([^@(/]*)(?:\\(.*\\))?((?:/[^/]*)*)(?:\\(.*\\))?@)?(.*?):(\\d*)(?::(\\d*))?$", false)); + _lazyFinal($, "_friendlyFrame", "$get$_friendlyFrame", () => A.RegExp_RegExp("^(\\S+)(?: (\\d+)(?::(\\d+))?)?\\s+([^\\d].*)$", false)); + _lazyFinal($, "_asyncBody", "$get$_asyncBody", () => A.RegExp_RegExp("<(|[^>]+)_async_body>", false)); + _lazyFinal($, "_initialDot", "$get$_initialDot", () => A.RegExp_RegExp("^\\.", false)); + _lazyFinal($, "Frame__uriRegExp", "$get$Frame__uriRegExp", () => A.RegExp_RegExp("^[a-zA-Z][-+.a-zA-Z\\d]*://", false)); + _lazyFinal($, "Frame__windowsRegExp", "$get$Frame__windowsRegExp", () => A.RegExp_RegExp("^([a-zA-Z]:[\\\\/]|\\\\\\\\)", false)); + _lazyFinal($, "_terseRegExp", "$get$_terseRegExp", () => A.RegExp_RegExp("(-patch)?([/\\\\].*)?$", false)); + _lazyFinal($, "_v8Trace", "$get$_v8Trace", () => A.RegExp_RegExp("\\n ?at ", false)); + _lazyFinal($, "_v8TraceLine", "$get$_v8TraceLine", () => A.RegExp_RegExp(" ?at ", false)); + _lazyFinal($, "_firefoxEvalTrace", "$get$_firefoxEvalTrace", () => A.RegExp_RegExp("@\\S+ line \\d+ >.* (Function|eval):\\d+:\\d+", false)); + _lazyFinal($, "_firefoxSafariTrace", "$get$_firefoxSafariTrace", () => A.RegExp_RegExp("^(([.0-9A-Za-z_$/<]|\\(.*\\))*@)?[^\\s]*:\\d*$", true)); + _lazyFinal($, "_friendlyTrace", "$get$_friendlyTrace", () => A.RegExp_RegExp("^[^\\s<][^\\s]*( \\d+(:\\d+)?)?[ \\t]+[^\\s]+$", true)); + _lazyFinal($, "vmChainGap", "$get$vmChainGap", () => A.RegExp_RegExp("^\\n?$", true)); + _lazyFinal($, "_newlineRegExp", "$get$_newlineRegExp", () => A.RegExp_RegExp("\\r\\n?|\\n", false)); + _lazyFinal($, "argumentListClass", "$get$argumentListClass", () => new A.argumentListClass_closure().call$0()); + _lazyFinal($, "booleanClass", "$get$booleanClass", () => new A.booleanClass_closure().call$0()); + _lazyFinal($, "legacyBooleanClass", "$get$legacyBooleanClass", () => new A.legacyBooleanClass_closure().call$0()); + _lazyFinal($, "calculationClass", "$get$calculationClass", () => new A.calculationClass_closure().call$0()); + _lazyFinal($, "calculationOperationClass", "$get$calculationOperationClass", () => new A.calculationOperationClass_closure().call$0()); + _lazyFinal($, "calculationInterpolationClass", "$get$calculationInterpolationClass", () => new A.calculationInterpolationClass_closure().call$0()); + _lazyFinal($, "_microsoftFilterStart0", "$get$_microsoftFilterStart0", () => A.RegExp_RegExp("^[a-zA-Z]+\\s*=", false)); + _lazyFinal($, "global6", "$get$global7", () => { + var _s27_ = "$red, $green, $blue, $alpha", + _s19_ = "$red, $green, $blue", + _s37_ = "$hue, $saturation, $lightness, $alpha", + _s29_ = "$hue, $saturation, $lightness", + _s17_ = "$hue, $saturation", + _s15_ = "$color, $amount", + t1 = type$.String, + t2 = type$.Value_Function_List_Value_2; + return A.UnmodifiableListView$(A._setArrayType([$.$get$_red0(), $.$get$_green0(), $.$get$_blue0(), $.$get$_mix0(), A.BuiltInCallable$overloadedFunction0("rgb", A.LinkedHashMap_LinkedHashMap$_literal([_s27_, new A.global_closure32(), _s19_, new A.global_closure33(), "$color, $alpha", new A.global_closure34(), "$channels", new A.global_closure35()], t1, t2)), A.BuiltInCallable$overloadedFunction0("rgba", A.LinkedHashMap_LinkedHashMap$_literal([_s27_, new A.global_closure36(), _s19_, new A.global_closure37(), "$color, $alpha", new A.global_closure38(), "$channels", new A.global_closure39()], t1, t2)), A._function11("invert", "$color, $weight: 100%", new A.global_closure40()), $.$get$_hue0(), $.$get$_saturation0(), $.$get$_lightness0(), $.$get$_complement0(), A.BuiltInCallable$overloadedFunction0("hsl", A.LinkedHashMap_LinkedHashMap$_literal([_s37_, new A.global_closure41(), _s29_, new A.global_closure42(), _s17_, new A.global_closure43(), "$channels", new A.global_closure44()], t1, t2)), A.BuiltInCallable$overloadedFunction0("hsla", A.LinkedHashMap_LinkedHashMap$_literal([_s37_, new A.global_closure45(), _s29_, new A.global_closure46(), _s17_, new A.global_closure47(), "$channels", new A.global_closure48()], t1, t2)), A._function11("grayscale", "$color", new A.global_closure49()), A._function11("adjust-hue", "$color, $degrees", new A.global_closure50()), A._function11("lighten", _s15_, new A.global_closure51()), A._function11("darken", _s15_, new A.global_closure52()), A.BuiltInCallable$overloadedFunction0("saturate", A.LinkedHashMap_LinkedHashMap$_literal(["$amount", new A.global_closure53(), "$color, $amount", new A.global_closure54()], t1, t2)), A._function11("desaturate", _s15_, new A.global_closure55()), A._function11("opacify", _s15_, A.color2___opacify$closure()), A._function11("fade-in", _s15_, A.color2___opacify$closure()), A._function11("transparentize", _s15_, A.color2___transparentize$closure()), A._function11("fade-out", _s15_, A.color2___transparentize$closure()), A.BuiltInCallable$overloadedFunction0("alpha", A.LinkedHashMap_LinkedHashMap$_literal(["$color", new A.global_closure56(), "$args...", new A.global_closure57()], t1, t2)), A._function11("opacity", "$color", new A.global_closure58()), $.$get$_ieHexStr0(), $.$get$_adjust0().withName$1("adjust-color"), $.$get$_scale0().withName$1("scale-color"), $.$get$_change0().withName$1("change-color")], type$.JSArray_BuiltInCallable_2), type$.BuiltInCallable_2); + }); + _lazyFinal($, "module5", "$get$module5", () => { + var _s9_ = "lightness", + _s10_ = "saturation", + _s6_ = "$color", _s5_ = "alpha", + t1 = type$.String, + t2 = type$.Value_Function_List_Value_2; + return A.BuiltInModule$0("color", A._setArrayType([$.$get$_red0(), $.$get$_green0(), $.$get$_blue0(), $.$get$_mix0(), A._function11("invert", "$color, $weight: 100%", new A.module_closure12()), $.$get$_hue0(), $.$get$_saturation0(), $.$get$_lightness0(), $.$get$_complement0(), A._removedColorFunction0("adjust-hue", "hue", false), A._removedColorFunction0("lighten", _s9_, false), A._removedColorFunction0("darken", _s9_, true), A._removedColorFunction0("saturate", _s10_, false), A._removedColorFunction0("desaturate", _s10_, true), A._function11("grayscale", _s6_, new A.module_closure13()), A.BuiltInCallable$overloadedFunction0("hwb", A.LinkedHashMap_LinkedHashMap$_literal(["$hue, $whiteness, $blackness, $alpha: 1", new A.module_closure14(), "$channels", new A.module_closure15()], t1, t2)), A._function11("whiteness", _s6_, new A.module_closure16()), A._function11("blackness", _s6_, new A.module_closure17()), A._removedColorFunction0("opacify", _s5_, false), A._removedColorFunction0("fade-in", _s5_, false), A._removedColorFunction0("transparentize", _s5_, true), A._removedColorFunction0("fade-out", _s5_, true), A.BuiltInCallable$overloadedFunction0(_s5_, A.LinkedHashMap_LinkedHashMap$_literal(["$color", new A.module_closure18(), "$args...", new A.module_closure19()], t1, t2)), A._function11("opacity", _s6_, new A.module_closure20()), $.$get$_adjust0(), $.$get$_scale0(), $.$get$_change0(), $.$get$_ieHexStr0()], type$.JSArray_Callable_2), null, null, type$.Callable_2); + }); + _lazyFinal($, "_red0", "$get$_red0", () => A._function11("red", "$color", new A._red_closure0())); + _lazyFinal($, "_green0", "$get$_green0", () => A._function11("green", "$color", new A._green_closure0())); + _lazyFinal($, "_blue0", "$get$_blue0", () => A._function11("blue", "$color", new A._blue_closure0())); + _lazyFinal($, "_mix0", "$get$_mix0", () => A._function11("mix", "$color1, $color2, $weight: 50%", new A._mix_closure0())); + _lazyFinal($, "_hue0", "$get$_hue0", () => A._function11("hue", "$color", new A._hue_closure0())); + _lazyFinal($, "_saturation0", "$get$_saturation0", () => A._function11("saturation", "$color", new A._saturation_closure0())); + _lazyFinal($, "_lightness0", "$get$_lightness0", () => A._function11("lightness", "$color", new A._lightness_closure0())); + _lazyFinal($, "_complement0", "$get$_complement0", () => A._function11("complement", "$color", new A._complement_closure0())); + _lazyFinal($, "_adjust0", "$get$_adjust0", () => A._function11("adjust", "$color, $kwargs...", new A._adjust_closure0())); + _lazyFinal($, "_scale0", "$get$_scale0", () => A._function11("scale", "$color, $kwargs...", new A._scale_closure0())); + _lazyFinal($, "_change0", "$get$_change0", () => A._function11("change", "$color, $kwargs...", new A._change_closure0())); + _lazyFinal($, "_ieHexStr0", "$get$_ieHexStr0", () => A._function11("ie-hex-str", "$color", new A._ieHexStr_closure0())); + _lazyFinal($, "colorClass", "$get$colorClass", () => new A.colorClass_closure().call$0()); + _lazyFinal($, "legacyColorClass", "$get$legacyColorClass", () => { + var t1 = A.createJSClass("sass.types.Color", new A.legacyColorClass_closure()); + A.JSClassExtension_defineMethods(t1, A.LinkedHashMap_LinkedHashMap$_literal(["getR", new A.legacyColorClass_closure0(), "getG", new A.legacyColorClass_closure1(), "getB", new A.legacyColorClass_closure2(), "getA", new A.legacyColorClass_closure3(), "setR", new A.legacyColorClass_closure4(), "setG", new A.legacyColorClass_closure5(), "setB", new A.legacyColorClass_closure6(), "setA", new A.legacyColorClass_closure7()], type$.String, type$.Function)); + return t1; + }); + _lazyFinal($, "colorsByName0", "$get$colorsByName0", () => A.LinkedHashMap_LinkedHashMap$_literal(["yellowgreen", A.SassColor$rgb0(154, 205, 50, 1), "yellow", A.SassColor$rgb0(255, 255, 0, 1), "whitesmoke", A.SassColor$rgb0(245, 245, 245, 1), "white", A.SassColor$rgb0(255, 255, 255, 1), "wheat", A.SassColor$rgb0(245, 222, 179, 1), "violet", A.SassColor$rgb0(238, 130, 238, 1), "turquoise", A.SassColor$rgb0(64, 224, 208, 1), "transparent", A.SassColor$rgb0(0, 0, 0, 0), "tomato", A.SassColor$rgb0(255, 99, 71, 1), "thistle", A.SassColor$rgb0(216, 191, 216, 1), "teal", A.SassColor$rgb0(0, 128, 128, 1), "tan", A.SassColor$rgb0(210, 180, 140, 1), "steelblue", A.SassColor$rgb0(70, 130, 180, 1), "springgreen", A.SassColor$rgb0(0, 255, 127, 1), "snow", A.SassColor$rgb0(255, 250, 250, 1), "slategrey", A.SassColor$rgb0(112, 128, 144, 1), "slategray", A.SassColor$rgb0(112, 128, 144, 1), "slateblue", A.SassColor$rgb0(106, 90, 205, 1), "skyblue", A.SassColor$rgb0(135, 206, 235, 1), "silver", A.SassColor$rgb0(192, 192, 192, 1), "sienna", A.SassColor$rgb0(160, 82, 45, 1), "seashell", A.SassColor$rgb0(255, 245, 238, 1), "seagreen", A.SassColor$rgb0(46, 139, 87, 1), "sandybrown", A.SassColor$rgb0(244, 164, 96, 1), "salmon", A.SassColor$rgb0(250, 128, 114, 1), "saddlebrown", A.SassColor$rgb0(139, 69, 19, 1), "royalblue", A.SassColor$rgb0(65, 105, 225, 1), "rosybrown", A.SassColor$rgb0(188, 143, 143, 1), "red", A.SassColor$rgb0(255, 0, 0, 1), "rebeccapurple", A.SassColor$rgb0(102, 51, 153, 1), "purple", A.SassColor$rgb0(128, 0, 128, 1), "powderblue", A.SassColor$rgb0(176, 224, 230, 1), "plum", A.SassColor$rgb0(221, 160, 221, 1), "pink", A.SassColor$rgb0(255, 192, 203, 1), "peru", A.SassColor$rgb0(205, 133, 63, 1), "peachpuff", A.SassColor$rgb0(255, 218, 185, 1), "papayawhip", A.SassColor$rgb0(255, 239, 213, 1), "palevioletred", A.SassColor$rgb0(219, 112, 147, 1), "paleturquoise", A.SassColor$rgb0(175, 238, 238, 1), "palegreen", A.SassColor$rgb0(152, 251, 152, 1), "palegoldenrod", A.SassColor$rgb0(238, 232, 170, 1), "orchid", A.SassColor$rgb0(218, 112, 214, 1), "orangered", A.SassColor$rgb0(255, 69, 0, 1), "orange", A.SassColor$rgb0(255, 165, 0, 1), "olivedrab", A.SassColor$rgb0(107, 142, 35, 1), "olive", A.SassColor$rgb0(128, 128, 0, 1), "oldlace", A.SassColor$rgb0(253, 245, 230, 1), "navy", A.SassColor$rgb0(0, 0, 128, 1), "navajowhite", A.SassColor$rgb0(255, 222, 173, 1), "moccasin", A.SassColor$rgb0(255, 228, 181, 1), "mistyrose", A.SassColor$rgb0(255, 228, 225, 1), "mintcream", A.SassColor$rgb0(245, 255, 250, 1), "midnightblue", A.SassColor$rgb0(25, 25, 112, 1), "mediumvioletred", A.SassColor$rgb0(199, 21, 133, 1), "mediumturquoise", A.SassColor$rgb0(72, 209, 204, 1), "mediumspringgreen", A.SassColor$rgb0(0, 250, 154, 1), "mediumslateblue", A.SassColor$rgb0(123, 104, 238, 1), "mediumseagreen", A.SassColor$rgb0(60, 179, 113, 1), "mediumpurple", A.SassColor$rgb0(147, 112, 219, 1), "mediumorchid", A.SassColor$rgb0(186, 85, 211, 1), "mediumblue", A.SassColor$rgb0(0, 0, 205, 1), "mediumaquamarine", A.SassColor$rgb0(102, 205, 170, 1), "maroon", A.SassColor$rgb0(128, 0, 0, 1), "magenta", A.SassColor$rgb0(255, 0, 255, 1), "linen", A.SassColor$rgb0(250, 240, 230, 1), "limegreen", A.SassColor$rgb0(50, 205, 50, 1), "lime", A.SassColor$rgb0(0, 255, 0, 1), "lightyellow", A.SassColor$rgb0(255, 255, 224, 1), "lightsteelblue", A.SassColor$rgb0(176, 196, 222, 1), "lightslategrey", A.SassColor$rgb0(119, 136, 153, 1), "lightslategray", A.SassColor$rgb0(119, 136, 153, 1), "lightskyblue", A.SassColor$rgb0(135, 206, 250, 1), "lightseagreen", A.SassColor$rgb0(32, 178, 170, 1), "lightsalmon", A.SassColor$rgb0(255, 160, 122, 1), "lightpink", A.SassColor$rgb0(255, 182, 193, 1), "lightgrey", A.SassColor$rgb0(211, 211, 211, 1), "lightgreen", A.SassColor$rgb0(144, 238, 144, 1), "lightgray", A.SassColor$rgb0(211, 211, 211, 1), "lightgoldenrodyellow", A.SassColor$rgb0(250, 250, 210, 1), "lightcyan", A.SassColor$rgb0(224, 255, 255, 1), "lightcoral", A.SassColor$rgb0(240, 128, 128, 1), "lightblue", A.SassColor$rgb0(173, 216, 230, 1), "lemonchiffon", A.SassColor$rgb0(255, 250, 205, 1), "lawngreen", A.SassColor$rgb0(124, 252, 0, 1), "lavenderblush", A.SassColor$rgb0(255, 240, 245, 1), "lavender", A.SassColor$rgb0(230, 230, 250, 1), "khaki", A.SassColor$rgb0(240, 230, 140, 1), "ivory", A.SassColor$rgb0(255, 255, 240, 1), "indigo", A.SassColor$rgb0(75, 0, 130, 1), "indianred", A.SassColor$rgb0(205, 92, 92, 1), "hotpink", A.SassColor$rgb0(255, 105, 180, 1), "honeydew", A.SassColor$rgb0(240, 255, 240, 1), "grey", A.SassColor$rgb0(128, 128, 128, 1), "greenyellow", A.SassColor$rgb0(173, 255, 47, 1), "green", A.SassColor$rgb0(0, 128, 0, 1), "gray", A.SassColor$rgb0(128, 128, 128, 1), "goldenrod", A.SassColor$rgb0(218, 165, 32, 1), "gold", A.SassColor$rgb0(255, 215, 0, 1), "ghostwhite", A.SassColor$rgb0(248, 248, 255, 1), "gainsboro", A.SassColor$rgb0(220, 220, 220, 1), "fuchsia", A.SassColor$rgb0(255, 0, 255, 1), "forestgreen", A.SassColor$rgb0(34, 139, 34, 1), "floralwhite", A.SassColor$rgb0(255, 250, 240, 1), "firebrick", A.SassColor$rgb0(178, 34, 34, 1), "dodgerblue", A.SassColor$rgb0(30, 144, 255, 1), "dimgrey", A.SassColor$rgb0(105, 105, 105, 1), "dimgray", A.SassColor$rgb0(105, 105, 105, 1), "deepskyblue", A.SassColor$rgb0(0, 191, 255, 1), "deeppink", A.SassColor$rgb0(255, 20, 147, 1), "darkviolet", A.SassColor$rgb0(148, 0, 211, 1), "darkturquoise", A.SassColor$rgb0(0, 206, 209, 1), "darkslategrey", A.SassColor$rgb0(47, 79, 79, 1), "darkslategray", A.SassColor$rgb0(47, 79, 79, 1), "darkslateblue", A.SassColor$rgb0(72, 61, 139, 1), "darkseagreen", A.SassColor$rgb0(143, 188, 143, 1), "darksalmon", A.SassColor$rgb0(233, 150, 122, 1), "darkred", A.SassColor$rgb0(139, 0, 0, 1), "darkorchid", A.SassColor$rgb0(153, 50, 204, 1), "darkorange", A.SassColor$rgb0(255, 140, 0, 1), "darkolivegreen", A.SassColor$rgb0(85, 107, 47, 1), "darkmagenta", A.SassColor$rgb0(139, 0, 139, 1), "darkkhaki", A.SassColor$rgb0(189, 183, 107, 1), "darkgrey", A.SassColor$rgb0(169, 169, 169, 1), "darkgreen", A.SassColor$rgb0(0, 100, 0, 1), "darkgray", A.SassColor$rgb0(169, 169, 169, 1), "darkgoldenrod", A.SassColor$rgb0(184, 134, 11, 1), "darkcyan", A.SassColor$rgb0(0, 139, 139, 1), "darkblue", A.SassColor$rgb0(0, 0, 139, 1), "cyan", A.SassColor$rgb0(0, 255, 255, 1), "crimson", A.SassColor$rgb0(220, 20, 60, 1), "cornsilk", A.SassColor$rgb0(255, 248, 220, 1), "cornflowerblue", A.SassColor$rgb0(100, 149, 237, 1), "coral", A.SassColor$rgb0(255, 127, 80, 1), "chocolate", A.SassColor$rgb0(210, 105, 30, 1), "chartreuse", A.SassColor$rgb0(127, 255, 0, 1), "cadetblue", A.SassColor$rgb0(95, 158, 160, 1), "burlywood", A.SassColor$rgb0(222, 184, 135, 1), "brown", A.SassColor$rgb0(165, 42, 42, 1), "blueviolet", A.SassColor$rgb0(138, 43, 226, 1), "blue", A.SassColor$rgb0(0, 0, 255, 1), "blanchedalmond", A.SassColor$rgb0(255, 235, 205, 1), "black", A.SassColor$rgb0(0, 0, 0, 1), "bisque", A.SassColor$rgb0(255, 228, 196, 1), "beige", A.SassColor$rgb0(245, 245, 220, 1), "azure", A.SassColor$rgb0(240, 255, 255, 1), "aquamarine", A.SassColor$rgb0(127, 255, 212, 1), "aqua", A.SassColor$rgb0(0, 255, 255, 1), "antiquewhite", A.SassColor$rgb0(250, 235, 215, 1), "aliceblue", A.SassColor$rgb0(240, 248, 255, 1)], type$.String, type$.SassColor_2)); + _lazyFinal($, "namesByColor0", "$get$namesByColor0", () => { + var $name, + t1 = type$.SassColor_2, + t2 = type$.String, + t3 = A.LinkedHashMap_LinkedHashMap$_empty(t1, t2); + for (t1 = A.MapExtensions_get_pairs0($.$get$colorsByName0(), t2, t1), t1 = t1.get$iterator(t1); t1.moveNext$0();) { + t2 = t1.get$current(t1); + $name = t2._0; + t3.$indexSet(0, t2._1, $name); + } + return t3; + }); + _lazyFinal($, "nodePackageImporterClass", "$get$nodePackageImporterClass", () => new A.nodePackageImporterClass_closure().call$0()); + _lazyFinal($, "compilerClass", "$get$compilerClass", () => new A.compilerClass_closure().call$0()); + _lazyFinal($, "asyncCompilerClass", "$get$asyncCompilerClass", () => new A.asyncCompilerClass_closure().call$0()); + _lazyFinal($, "_disallowedFunctionNames0", "$get$_disallowedFunctionNames0", () => { + var t1 = $.$get$globalFunctions0(); + t1 = t1.map$1$1(t1, new A._disallowedFunctionNames_closure0(), type$.String).toSet$0(0); + t1.add$1(0, "if"); + t1.remove$1(0, "rgb"); + t1.remove$1(0, "rgba"); + t1.remove$1(0, "hsl"); + t1.remove$1(0, "hsla"); + t1.remove$1(0, "grayscale"); + t1.remove$1(0, "invert"); + t1.remove$1(0, "alpha"); + t1.remove$1(0, "opacity"); + t1.remove$1(0, "saturate"); + t1.remove$1(0, "min"); + t1.remove$1(0, "max"); + t1.remove$1(0, "round"); + t1.remove$1(0, "abs"); + return t1; + }); + _lazyFinal($, "exceptionClass", "$get$exceptionClass", () => new A.exceptionClass_closure().call$0()); + _lazyFinal($, "FilesystemImporter_cwd0", "$get$FilesystemImporter_cwd0", () => A.FilesystemImporter$0(".")); + _lazyFinal($, "functionClass", "$get$functionClass", () => new A.functionClass_closure().call$0()); + _lazyFinal($, "globalFunctions0", "$get$globalFunctions0", () => { + var t1 = type$.BuiltInCallable_2, + t2 = A.List_List$of($.$get$global7(), true, t1); + B.JSArray_methods.addAll$1(t2, $.$get$global8()); + B.JSArray_methods.addAll$1(t2, $.$get$global9()); + B.JSArray_methods.addAll$1(t2, $.$get$global10()); + B.JSArray_methods.addAll$1(t2, $.$get$global11()); + B.JSArray_methods.addAll$1(t2, $.$get$global12()); + B.JSArray_methods.addAll$1(t2, $.$get$global6()); + t2.push(A.BuiltInCallable$function0("if", "$condition, $if-true, $if-false", new A.globalFunctions_closure0(), null)); + return A.UnmodifiableListView$(t2, t1); + }); + _lazyFinal($, "coreModules0", "$get$coreModules0", () => A.UnmodifiableListView$(A._setArrayType([$.$get$module5(), $.$get$module6(), $.$get$module7(), $.$get$module8(), $.$get$module9(), $.$get$module10()], A.findType("JSArray>")), type$.BuiltInModule_Callable_2)); + _lazyFinal($, "IfExpression_declaration0", "$get$IfExpression_declaration0", () => A.ArgumentDeclaration_ArgumentDeclaration$parse0(string$.x40funct, null)); + _lazyFinal($, "global7", "$get$global8", () => A.UnmodifiableListView$(A._setArrayType([$.$get$_length2(), $.$get$_nth0(), $.$get$_setNth0(), $.$get$_join0(), $.$get$_append2(), $.$get$_zip0(), $.$get$_index2(), $.$get$_isBracketed0(), $.$get$_separator0().withName$1("list-separator")], type$.JSArray_BuiltInCallable_2), type$.BuiltInCallable_2)); + _lazyFinal($, "module6", "$get$module6", () => A.BuiltInModule$0("list", A._setArrayType([$.$get$_length2(), $.$get$_nth0(), $.$get$_setNth0(), $.$get$_join0(), $.$get$_append2(), $.$get$_zip0(), $.$get$_index2(), $.$get$_isBracketed0(), $.$get$_separator0(), $.$get$_slash0()], type$.JSArray_Callable_2), null, null, type$.Callable_2)); + _lazyFinal($, "_length1", "$get$_length2", () => A._function10("length", "$list", new A._length_closure2())); + _lazyFinal($, "_nth0", "$get$_nth0", () => A._function10("nth", "$list, $n", new A._nth_closure0())); + _lazyFinal($, "_setNth0", "$get$_setNth0", () => A._function10("set-nth", "$list, $n, $value", new A._setNth_closure0())); + _lazyFinal($, "_join0", "$get$_join0", () => A._function10("join", string$.x24list1, new A._join_closure0())); + _lazyFinal($, "_append1", "$get$_append2", () => A._function10("append", "$list, $val, $separator: auto", new A._append_closure2())); + _lazyFinal($, "_zip0", "$get$_zip0", () => A._function10("zip", "$lists...", new A._zip_closure0())); + _lazyFinal($, "_index1", "$get$_index2", () => A._function10("index", "$list, $value", new A._index_closure2())); + _lazyFinal($, "_separator0", "$get$_separator0", () => A._function10("separator", "$list", new A._separator_closure0())); + _lazyFinal($, "_isBracketed0", "$get$_isBracketed0", () => A._function10("is-bracketed", "$list", new A._isBracketed_closure0())); + _lazyFinal($, "_slash0", "$get$_slash0", () => A._function10("slash", "$elements...", new A._slash_closure0())); + _lazyFinal($, "listClass", "$get$listClass", () => new A.listClass_closure().call$0()); + _lazyFinal($, "legacyListClass", "$get$legacyListClass", () => { + var t1 = A.createJSClass("sass.types.List", new A.legacyListClass_closure()); + A.JSClassExtension_defineMethods(t1, A.LinkedHashMap_LinkedHashMap$_literal(["getValue", new A.legacyListClass_closure0(), "setValue", new A.legacyListClass_closure1(), "getSeparator", new A.legacyListClass_closure2(), "setSeparator", new A.legacyListClass_closure3(), "getLength", new A.legacyListClass_closure4()], type$.String, type$.Function)); + return t1; + }); + _lazyFinal($, "Logger_quiet0", "$get$Logger_quiet0", () => new A._QuietLogger0()); + _lazyFinal($, "global8", "$get$global9", () => A.UnmodifiableListView$(A._setArrayType([$.$get$_get0().withName$1("map-get"), $.$get$_merge0().withName$1("map-merge"), $.$get$_remove0().withName$1("map-remove"), $.$get$_keys0().withName$1("map-keys"), $.$get$_values0().withName$1("map-values"), $.$get$_hasKey0().withName$1("map-has-key")], type$.JSArray_BuiltInCallable_2), type$.BuiltInCallable_2)); + _lazyFinal($, "module7", "$get$module7", () => A.BuiltInModule$0("map", A._setArrayType([$.$get$_get0(), $.$get$_set0(), $.$get$_merge0(), $.$get$_remove0(), $.$get$_keys0(), $.$get$_values0(), $.$get$_hasKey0(), $.$get$_deepMerge0(), $.$get$_deepRemove0()], type$.JSArray_Callable_2), null, null, type$.Callable_2)); + _lazyFinal($, "_get0", "$get$_get0", () => A._function9("get", "$map, $key, $keys...", new A._get_closure0())); + _lazyFinal($, "_set0", "$get$_set0", () => A.BuiltInCallable$overloadedFunction0("set", A.LinkedHashMap_LinkedHashMap$_literal(["$map, $key, $value", new A._set_closure1(), "$map, $args...", new A._set_closure2()], type$.String, type$.Value_Function_List_Value_2))); + _lazyFinal($, "_merge0", "$get$_merge0", () => A.BuiltInCallable$overloadedFunction0("merge", A.LinkedHashMap_LinkedHashMap$_literal(["$map1, $map2", new A._merge_closure1(), "$map1, $args...", new A._merge_closure2()], type$.String, type$.Value_Function_List_Value_2))); + _lazyFinal($, "_deepMerge0", "$get$_deepMerge0", () => A._function9("deep-merge", "$map1, $map2", new A._deepMerge_closure0())); + _lazyFinal($, "_deepRemove0", "$get$_deepRemove0", () => A._function9("deep-remove", "$map, $key, $keys...", new A._deepRemove_closure0())); + _lazyFinal($, "_remove0", "$get$_remove0", () => A.BuiltInCallable$overloadedFunction0("remove", A.LinkedHashMap_LinkedHashMap$_literal(["$map", new A._remove_closure1(), "$map, $key, $keys...", new A._remove_closure2()], type$.String, type$.Value_Function_List_Value_2))); + _lazyFinal($, "_keys0", "$get$_keys0", () => A._function9("keys", "$map", new A._keys_closure0())); + _lazyFinal($, "_values0", "$get$_values0", () => A._function9("values", "$map", new A._values_closure0())); + _lazyFinal($, "_hasKey0", "$get$_hasKey0", () => A._function9("has-key", "$map, $key, $keys...", new A._hasKey_closure0())); + _lazyFinal($, "mapClass", "$get$mapClass", () => new A.mapClass_closure().call$0()); + _lazyFinal($, "legacyMapClass", "$get$legacyMapClass", () => { + var t1 = A.createJSClass("sass.types.Map", new A.legacyMapClass_closure()); + A.JSClassExtension_defineMethods(t1, A.LinkedHashMap_LinkedHashMap$_literal(["getKey", new A.legacyMapClass_closure0(), "getValue", new A.legacyMapClass_closure1(), "getLength", new A.legacyMapClass_closure2(), "setKey", new A.legacyMapClass_closure3(), "setValue", new A.legacyMapClass_closure4()], type$.String, type$.Function)); + return t1; + }); + _lazyFinal($, "global9", "$get$global10", () => A.UnmodifiableListView$(A._setArrayType([A._function8("abs", "$number", new A.global_closure31()), $.$get$_ceil0(), $.$get$_floor0(), $.$get$_max0(), $.$get$_min0(), $.$get$_percentage0(), $.$get$_randomFunction0(), $.$get$_round0(), $.$get$_unit0(), $.$get$_compatible0().withName$1("comparable"), $.$get$_isUnitless0().withName$1("unitless")], type$.JSArray_BuiltInCallable_2), type$.BuiltInCallable_2)); + _lazyFinal($, "module8", "$get$module8", () => { + var _null = null; + return A.BuiltInModule$0("math", A._setArrayType([A._numberFunction0("abs", new A.module_closure11()), $.$get$_acos0(), $.$get$_asin0(), $.$get$_atan0(), $.$get$_atan20(), $.$get$_ceil0(), $.$get$_clamp0(), $.$get$_cos0(), $.$get$_compatible0(), $.$get$_floor0(), $.$get$_hypot0(), $.$get$_isUnitless0(), $.$get$_log0(), $.$get$_max0(), $.$get$_min0(), $.$get$_percentage0(), $.$get$_pow0(), $.$get$_randomFunction0(), $.$get$_round0(), $.$get$_sin0(), $.$get$_sqrt0(), $.$get$_tan0(), $.$get$_unit0(), $.$get$_div0()], type$.JSArray_Callable_2), _null, A.LinkedHashMap_LinkedHashMap$_literal(["e", A.SassNumber_SassNumber0(2.718281828459045, _null), "pi", A.SassNumber_SassNumber0(3.141592653589793, _null), "epsilon", A.SassNumber_SassNumber0(2220446049250313e-31, _null), "max-safe-integer", A.SassNumber_SassNumber0(9007199254740991, _null), "min-safe-integer", A.SassNumber_SassNumber0(-9007199254740991, _null), "max-number", A.SassNumber_SassNumber0(17976931348623157e292, _null), "min-number", A.SassNumber_SassNumber0(5e-324, _null)], type$.String, type$.Value_2), type$.Callable_2); + }); + _lazyFinal($, "_ceil0", "$get$_ceil0", () => A._numberFunction0("ceil", new A._ceil_closure0())); + _lazyFinal($, "_clamp0", "$get$_clamp0", () => A._function8("clamp", "$min, $number, $max", new A._clamp_closure0())); + _lazyFinal($, "_floor0", "$get$_floor0", () => A._numberFunction0("floor", new A._floor_closure0())); + _lazyFinal($, "_max0", "$get$_max0", () => A._function8("max", "$numbers...", new A._max_closure0())); + _lazyFinal($, "_min0", "$get$_min0", () => A._function8("min", "$numbers...", new A._min_closure0())); + _lazyFinal($, "_round0", "$get$_round0", () => A._numberFunction0("round", new A._round_closure0())); + _lazyFinal($, "_hypot0", "$get$_hypot0", () => A._function8("hypot", "$numbers...", new A._hypot_closure0())); + _lazyFinal($, "_log0", "$get$_log0", () => A._function8("log", "$number, $base: null", new A._log_closure0())); + _lazyFinal($, "_pow0", "$get$_pow0", () => A._function8("pow", "$base, $exponent", new A._pow_closure0())); + _lazyFinal($, "_sqrt0", "$get$_sqrt0", () => A._singleArgumentMathFunc0("sqrt", A.number2__sqrt$closure())); + _lazyFinal($, "_acos0", "$get$_acos0", () => A._singleArgumentMathFunc0("acos", A.number2__acos$closure())); + _lazyFinal($, "_asin0", "$get$_asin0", () => A._singleArgumentMathFunc0("asin", A.number2__asin$closure())); + _lazyFinal($, "_atan0", "$get$_atan0", () => A._singleArgumentMathFunc0("atan", A.number2__atan$closure())); + _lazyFinal($, "_atan20", "$get$_atan20", () => A._function8("atan2", "$y, $x", new A._atan2_closure0())); + _lazyFinal($, "_cos0", "$get$_cos0", () => A._singleArgumentMathFunc0("cos", A.number2__cos$closure())); + _lazyFinal($, "_sin0", "$get$_sin0", () => A._singleArgumentMathFunc0("sin", A.number2__sin$closure())); + _lazyFinal($, "_tan0", "$get$_tan0", () => A._singleArgumentMathFunc0("tan", A.number2__tan$closure())); + _lazyFinal($, "_compatible0", "$get$_compatible0", () => A._function8("compatible", "$number1, $number2", new A._compatible_closure0())); + _lazyFinal($, "_isUnitless0", "$get$_isUnitless0", () => A._function8("is-unitless", "$number", new A._isUnitless_closure0())); + _lazyFinal($, "_unit0", "$get$_unit0", () => A._function8("unit", "$number", new A._unit_closure0())); + _lazyFinal($, "_percentage0", "$get$_percentage0", () => A._function8("percentage", "$number", new A._percentage_closure0())); + _lazyFinal($, "_random1", "$get$_random2", () => A.Random_Random()); + _lazyFinal($, "_randomFunction0", "$get$_randomFunction0", () => A._function8("random", "$limit: null", new A._randomFunction_closure0())); + _lazyFinal($, "_div0", "$get$_div0", () => A._function8("div", "$number1, $number2", new A._div_closure0())); + _lazyFinal($, "global10", "$get$global6", () => A.UnmodifiableListView$(A._setArrayType([A._function12("feature-exists", "$feature", new A.global_closure59()), A._function12("inspect", "$value", new A.global_closure60()), A._function12("type-of", "$value", new A.global_closure61()), A._function12("keywords", "$args", new A.global_closure62())], type$.JSArray_BuiltInCallable_2), type$.BuiltInCallable_2)); + _lazyFinal($, "local0", "$get$local0", () => A.UnmodifiableListView$(A._setArrayType([A._function12("calc-name", "$calc", new A.local_closure2()), A._function12("calc-args", "$calc", new A.local_closure3()), A._function12("accepts-content", "$mixin", new A.local_closure4())], type$.JSArray_BuiltInCallable_2), type$.BuiltInCallable_2)); + _lazyFinal($, "mixinClass", "$get$mixinClass", () => new A.mixinClass_closure().call$0()); + _lazyFinal($, "legacyNullClass", "$get$legacyNullClass", () => new A.legacyNullClass_closure().call$0()); + _lazyFinal($, "_epsilon0", "$get$_epsilon0", () => A.pow(10, -11)); + _lazyFinal($, "_inverseEpsilon0", "$get$_inverseEpsilon0", () => A.pow(10, 11)); + _lazyFinal($, "numberClass", "$get$numberClass", () => new A.numberClass_closure().call$0()); + _lazyFinal($, "legacyNumberClass", "$get$legacyNumberClass", () => { + var t1 = A.createJSClass("sass.types.Number", new A.legacyNumberClass_closure()); + A.JSClassExtension_defineMethods(t1, A.LinkedHashMap_LinkedHashMap$_literal(["getValue", new A.legacyNumberClass_closure0(), "setValue", new A.legacyNumberClass_closure1(), "getUnit", new A.legacyNumberClass_closure2(), "setUnit", new A.legacyNumberClass_closure3()], type$.String, type$.Function)); + return t1; + }); + _lazyFinal($, "_typesByUnit0", "$get$_typesByUnit0", () => { + var t3, type, + t1 = type$.String, + t2 = A.LinkedHashMap_LinkedHashMap$_empty(t1, t1); + for (t1 = A.MapExtensions_get_pairs0(B.Map_ws7dy, t1, type$.List_String), t1 = t1.get$iterator(t1); t1.moveNext$0();) { + t3 = t1.get$current(t1); + type = t3._0; + for (t3 = J.get$iterator$ax(t3._1); t3.moveNext$0();) + t2.$indexSet(0, t3.get$current(t3), type); + } + return t2; + }); + _lazyFinal($, "global11", "$get$global11", () => A.UnmodifiableListView$(A._setArrayType([$.$get$_isSuperselector0(), $.$get$_simpleSelectors0(), $.$get$_parse0().withName$1("selector-parse"), $.$get$_nest0().withName$1("selector-nest"), $.$get$_append1().withName$1("selector-append"), $.$get$_extend0().withName$1("selector-extend"), $.$get$_replace0().withName$1("selector-replace"), $.$get$_unify0().withName$1("selector-unify")], type$.JSArray_BuiltInCallable_2), type$.BuiltInCallable_2)); + _lazyFinal($, "module9", "$get$module9", () => A.BuiltInModule$0("selector", A._setArrayType([$.$get$_isSuperselector0(), $.$get$_simpleSelectors0(), $.$get$_parse0(), $.$get$_nest0(), $.$get$_append1(), $.$get$_extend0(), $.$get$_replace0(), $.$get$_unify0()], type$.JSArray_Callable_2), null, null, type$.Callable_2)); + _lazyFinal($, "_nest0", "$get$_nest0", () => A._function7("nest", "$selectors...", new A._nest_closure0())); + _lazyFinal($, "_append2", "$get$_append1", () => A._function7("append", "$selectors...", new A._append_closure1())); + _lazyFinal($, "_extend0", "$get$_extend0", () => A._function7("extend", "$selector, $extendee, $extender", new A._extend_closure0())); + _lazyFinal($, "_replace0", "$get$_replace0", () => A._function7("replace", "$selector, $original, $replacement", new A._replace_closure0())); + _lazyFinal($, "_unify0", "$get$_unify0", () => A._function7("unify", "$selector1, $selector2", new A._unify_closure0())); + _lazyFinal($, "_isSuperselector0", "$get$_isSuperselector0", () => A._function7("is-superselector", "$super, $sub", new A._isSuperselector_closure0())); + _lazyFinal($, "_simpleSelectors0", "$get$_simpleSelectors0", () => A._function7("simple-selectors", "$selector", new A._simpleSelectors_closure0())); + _lazyFinal($, "_parse0", "$get$_parse0", () => A._function7("parse", "$selector", new A._parse_closure0())); + _lazyFinal($, "_knownCompatibilitiesByUnit0", "$get$_knownCompatibilitiesByUnit0", () => { + var _i, set, t2, + t1 = A.LinkedHashMap_LinkedHashMap$_empty(type$.String, A.findType("Set")); + for (_i = 0; _i < 5; ++_i) { + set = B.List_gyp[_i]; + for (t2 = set.get$iterator(set); t2.moveNext$0();) + t1.$indexSet(0, t2.get$current(0), set); + } + return t1; + }); + _lazyFinal($, "bogusSpan0", "$get$bogusSpan0", () => A.SourceFile$decoded(A._setArrayType([], type$.JSArray_int), null).span$1(0, 0)); + _lazyFinal($, "_random2", "$get$_random1", () => A.Random_Random()); + _lazy($, "_previousUniqueId0", "$get$_previousUniqueId0", () => $.$get$_random1().nextInt$1(A._asInt(A.pow(36, 6)))); + _lazyFinal($, "global12", "$get$global12", () => A.UnmodifiableListView$(A._setArrayType([$.$get$_unquote0(), $.$get$_quote0(), $.$get$_toUpperCase0(), $.$get$_toLowerCase0(), $.$get$_uniqueId0(), $.$get$_length1().withName$1("str-length"), $.$get$_insert0().withName$1("str-insert"), $.$get$_index1().withName$1("str-index"), $.$get$_slice0().withName$1("str-slice")], type$.JSArray_BuiltInCallable_2), type$.BuiltInCallable_2)); + _lazyFinal($, "module10", "$get$module10", () => A.BuiltInModule$0("string", A._setArrayType([$.$get$_unquote0(), $.$get$_quote0(), $.$get$_toUpperCase0(), $.$get$_toLowerCase0(), $.$get$_length1(), $.$get$_insert0(), $.$get$_index1(), $.$get$_slice0(), $.$get$_uniqueId0(), A._function6("split", "$string, $separator, $limit: null", new A.module_closure10())], type$.JSArray_Callable_2), null, null, type$.Callable_2)); + _lazyFinal($, "_unquote0", "$get$_unquote0", () => A._function6("unquote", "$string", new A._unquote_closure0())); + _lazyFinal($, "_quote0", "$get$_quote0", () => A._function6("quote", "$string", new A._quote_closure0())); + _lazyFinal($, "_length2", "$get$_length1", () => A._function6("length", "$string", new A._length_closure1())); + _lazyFinal($, "_insert0", "$get$_insert0", () => A._function6("insert", "$string, $insert, $index", new A._insert_closure0())); + _lazyFinal($, "_index2", "$get$_index1", () => A._function6("index", "$string, $substring", new A._index_closure1())); + _lazyFinal($, "_slice0", "$get$_slice0", () => A._function6("slice", "$string, $start-at, $end-at: -1", new A._slice_closure0())); + _lazyFinal($, "_toUpperCase0", "$get$_toUpperCase0", () => A._function6("to-upper-case", "$string", new A._toUpperCase_closure0())); + _lazyFinal($, "_toLowerCase0", "$get$_toLowerCase0", () => A._function6("to-lower-case", "$string", new A._toLowerCase_closure0())); + _lazyFinal($, "_uniqueId0", "$get$_uniqueId0", () => A._function6("unique-id", "", new A._uniqueId_closure0())); + _lazyFinal($, "stringClass", "$get$stringClass", () => new A.stringClass_closure().call$0()); + _lazyFinal($, "legacyStringClass", "$get$legacyStringClass", () => { + var t1 = A.createJSClass("sass.types.String", new A.legacyStringClass_closure()); + A.JSClassExtension_defineMethods(t1, A.LinkedHashMap_LinkedHashMap$_literal(["getValue", new A.legacyStringClass_closure0(), "setValue", new A.legacyStringClass_closure1()], type$.String, type$.Function)); + return t1; + }); + _lazyFinal($, "_emptyQuoted0", "$get$_emptyQuoted0", () => A.SassString$0("", true)); + _lazyFinal($, "_emptyUnquoted0", "$get$_emptyUnquoted0", () => A.SassString$0("", false)); + _lazyFinal($, "_urlSchemeRegExp", "$get$_urlSchemeRegExp", () => A.RegExp_RegExp("^[a-z0-9+.-]+$", false)); + _lazyFinal($, "_jsThrow0", "$get$_jsThrow", () => new self.Function("error", "throw error;")); + _lazyFinal($, "_isUndefined", "$get$_isUndefined", () => new self.Function("value", "return value === undefined;")); + _lazyFinal($, "_noSourceUrl0", "$get$_noSourceUrl0", () => A.Uri_parse("-")); + _lazyFinal($, "_traces0", "$get$_traces0", () => A.Expando$()); + _lazyFinal($, "valueClass", "$get$valueClass", () => new A.valueClass_closure().call$0()); + })(); + (function nativeSupport() { + !function() { + var intern = function(s) { + var o = {}; + o[s] = 1; + return Object.keys(hunkHelpers.convertToFastObject(o))[0]; + }; + init.getIsolateTag = function(name) { + return intern("___dart_" + name + init.isolateTag); + }; + var tableProperty = "___dart_isolate_tags_"; + var usedProperties = Object[tableProperty] || (Object[tableProperty] = Object.create(null)); + var rootProperty = "_ZxYxX"; + for (var i = 0;; i++) { + var property = intern(rootProperty + "_" + i + "_"); + if (!(property in usedProperties)) { + usedProperties[property] = 1; + init.isolateTag = property; + break; + } + } + init.dispatchPropertyName = init.getIsolateTag("dispatch_record"); + }(); + hunkHelpers.setOrUpdateInterceptorsByTag({ArrayBuffer: A.NativeByteBuffer, ArrayBufferView: A.NativeTypedData, DataView: A.NativeByteData, Float32Array: A.NativeFloat32List, Float64Array: A.NativeFloat64List, Int16Array: A.NativeInt16List, Int32Array: A.NativeInt32List, Int8Array: A.NativeInt8List, Uint16Array: A.NativeUint16List, Uint32Array: A.NativeUint32List, Uint8ClampedArray: A.NativeUint8ClampedList, CanvasPixelArray: A.NativeUint8ClampedList, Uint8Array: A.NativeUint8List}); + hunkHelpers.setOrUpdateLeafTags({ArrayBuffer: true, ArrayBufferView: false, DataView: true, Float32Array: true, Float64Array: true, Int16Array: true, Int32Array: true, Int8Array: true, Uint16Array: true, Uint32Array: true, Uint8ClampedArray: true, CanvasPixelArray: true, Uint8Array: false}); + A.NativeTypedArray.$nativeSuperclassTag = "ArrayBufferView"; + A._NativeTypedArrayOfDouble_NativeTypedArray_ListMixin.$nativeSuperclassTag = "ArrayBufferView"; + A._NativeTypedArrayOfDouble_NativeTypedArray_ListMixin_FixedLengthListMixin.$nativeSuperclassTag = "ArrayBufferView"; + A.NativeTypedArrayOfDouble.$nativeSuperclassTag = "ArrayBufferView"; + A._NativeTypedArrayOfInt_NativeTypedArray_ListMixin.$nativeSuperclassTag = "ArrayBufferView"; + A._NativeTypedArrayOfInt_NativeTypedArray_ListMixin_FixedLengthListMixin.$nativeSuperclassTag = "ArrayBufferView"; + A.NativeTypedArrayOfInt.$nativeSuperclassTag = "ArrayBufferView"; + })(); + Function.prototype.call$0 = function() { + return this(); + }; + Function.prototype.call$1 = function(a) { + return this(a); + }; + Function.prototype.call$2 = function(a, b) { + return this(a, b); + }; + Function.prototype.call$3$1 = function(a) { + return this(a); + }; + Function.prototype.call$2$1 = function(a) { + return this(a); + }; + Function.prototype.call$1$1 = function(a) { + return this(a); + }; + Function.prototype.call$3 = function(a, b, c) { + return this(a, b, c); + }; + Function.prototype.call$4 = function(a, b, c, d) { + return this(a, b, c, d); + }; + Function.prototype.call$3$3 = function(a, b, c) { + return this(a, b, c); + }; + Function.prototype.call$2$2 = function(a, b) { + return this(a, b); + }; + Function.prototype.call$5 = function(a, b, c, d, e) { + return this(a, b, c, d, e); + }; + Function.prototype.call$6 = function(a, b, c, d, e, f) { + return this(a, b, c, d, e, f); + }; + Function.prototype.call$2$0 = function() { + return this(); + }; + Function.prototype.call$1$0 = function() { + return this(); + }; + Function.prototype.call$1$2 = function(a, b) { + return this(a, b); + }; + Function.prototype.call$2$3 = function(a, b, c) { + return this(a, b, c); + }; + convertAllToFastObject(holders); + convertToFastObject($); + (function(callback) { + if (typeof document === "undefined") { + callback(null); + return; + } + if (typeof document.currentScript != "undefined") { + callback(document.currentScript); + return; + } + var scripts = document.scripts; + function onLoad(event) { + for (var i = 0; i < scripts.length; ++i) { + scripts[i].removeEventListener("load", onLoad, false); + } + callback(event.target); + } + for (var i = 0; i < scripts.length; ++i) { + scripts[i].addEventListener("load", onLoad, false); + } + })(function(currentScript) { + init.currentScript = currentScript; + var callMain = A.main2; + if (typeof dartMainRunner === "function") { + dartMainRunner(callMain, []); + } else { + callMain([]); + } + }); +})(); +} diff --git a/node_modules/sass/sass.default.cjs b/node_modules/sass/sass.default.cjs new file mode 100644 index 0000000..94d102a --- /dev/null +++ b/node_modules/sass/sass.default.cjs @@ -0,0 +1,8 @@ +require('./sass.dart.js'); +const library = globalThis._cliPkgExports.pop(); +if (globalThis._cliPkgExports.length === 0) delete globalThis._cliPkgExports; +library.load({ + immutable: require("immutable"), +}); + +module.exports = library; diff --git a/node_modules/sass/sass.default.js b/node_modules/sass/sass.default.js new file mode 100644 index 0000000..b00f8a7 --- /dev/null +++ b/node_modules/sass/sass.default.js @@ -0,0 +1,45 @@ +import * as immutable from "immutable" +import "./sass.dart.js"; + +const _cliPkgLibrary = globalThis._cliPkgExports.pop(); +if (globalThis._cliPkgExports.length === 0) delete globalThis._cliPkgExports; +const _cliPkgExports = {}; +_cliPkgLibrary.load({immutable}, _cliPkgExports); + +export const compile = _cliPkgExports.compile; +export const compileAsync = _cliPkgExports.compileAsync; +export const compileString = _cliPkgExports.compileString; +export const compileStringAsync = _cliPkgExports.compileStringAsync; +export const initCompiler = _cliPkgExports.initCompiler; +export const initAsyncCompiler = _cliPkgExports.initAsyncCompiler; +export const Compiler = _cliPkgExports.Compiler; +export const AsyncCompiler = _cliPkgExports.AsyncCompiler; +export const Logger = _cliPkgExports.Logger; +export const SassArgumentList = _cliPkgExports.SassArgumentList; +export const SassBoolean = _cliPkgExports.SassBoolean; +export const SassCalculation = _cliPkgExports.SassCalculation; +export const CalculationOperation = _cliPkgExports.CalculationOperation; +export const CalculationInterpolation = _cliPkgExports.CalculationInterpolation; +export const SassColor = _cliPkgExports.SassColor; +export const SassFunction = _cliPkgExports.SassFunction; +export const SassList = _cliPkgExports.SassList; +export const SassMap = _cliPkgExports.SassMap; +export const SassMixin = _cliPkgExports.SassMixin; +export const SassNumber = _cliPkgExports.SassNumber; +export const SassString = _cliPkgExports.SassString; +export const Value = _cliPkgExports.Value; +export const CustomFunction = _cliPkgExports.CustomFunction; +export const ListSeparator = _cliPkgExports.ListSeparator; +export const sassFalse = _cliPkgExports.sassFalse; +export const sassNull = _cliPkgExports.sassNull; +export const sassTrue = _cliPkgExports.sassTrue; +export const Exception = _cliPkgExports.Exception; +export const PromiseOr = _cliPkgExports.PromiseOr; +export const info = _cliPkgExports.info; +export const render = _cliPkgExports.render; +export const renderSync = _cliPkgExports.renderSync; +export const TRUE = _cliPkgExports.TRUE; +export const FALSE = _cliPkgExports.FALSE; +export const NULL = _cliPkgExports.NULL; +export const types = _cliPkgExports.types; +export const NodePackageImporter = _cliPkgExports.NodePackageImporter; diff --git a/node_modules/sass/sass.js b/node_modules/sass/sass.js new file mode 100644 index 0000000..992dbb5 --- /dev/null +++ b/node_modules/sass/sass.js @@ -0,0 +1,17 @@ +#!/usr/bin/env node + +require('./sass.dart.js'); +var library = globalThis._cliPkgExports.pop(); +if (globalThis._cliPkgExports.length === 0) delete globalThis._cliPkgExports; + +library.load({ + readline: require("readline"), + chokidar: require("chokidar"), + util: require("util"), + stream: require("stream"), + nodeModule: require("module"), + fs: require("fs"), + immutable: require("immutable"), +}); + +library.cli_pkg_main_0_(process.argv.slice(2)); diff --git a/node_modules/sass/sass.node.js b/node_modules/sass/sass.node.js new file mode 100644 index 0000000..204ae2c --- /dev/null +++ b/node_modules/sass/sass.node.js @@ -0,0 +1,12 @@ +require('./sass.dart.js'); +const library = globalThis._cliPkgExports.pop(); +if (globalThis._cliPkgExports.length === 0) delete globalThis._cliPkgExports; +library.load({ + util: require("util"), + stream: require("stream"), + nodeModule: require("module"), + fs: require("fs"), + immutable: require("immutable"), +}); + +module.exports = library; diff --git a/node_modules/sass/sass.node.mjs b/node_modules/sass/sass.node.mjs new file mode 100644 index 0000000..1d81ad8 --- /dev/null +++ b/node_modules/sass/sass.node.mjs @@ -0,0 +1,199 @@ +import cjs from "./sass.node.js"; + +export const compile = cjs.compile; +export const compileAsync = cjs.compileAsync; +export const compileString = cjs.compileString; +export const compileStringAsync = cjs.compileStringAsync; +export const initCompiler = cjs.initCompiler; +export const initAsyncCompiler = cjs.initAsyncCompiler; +export const Compiler = cjs.Compiler; +export const AsyncCompiler = cjs.AsyncCompiler; +export const Logger = cjs.Logger; +export const SassArgumentList = cjs.SassArgumentList; +export const SassBoolean = cjs.SassBoolean; +export const SassCalculation = cjs.SassCalculation; +export const CalculationOperation = cjs.CalculationOperation; +export const CalculationInterpolation = cjs.CalculationInterpolation; +export const SassColor = cjs.SassColor; +export const SassFunction = cjs.SassFunction; +export const SassList = cjs.SassList; +export const SassMap = cjs.SassMap; +export const SassMixin = cjs.SassMixin; +export const SassNumber = cjs.SassNumber; +export const SassString = cjs.SassString; +export const Value = cjs.Value; +export const CustomFunction = cjs.CustomFunction; +export const ListSeparator = cjs.ListSeparator; +export const sassFalse = cjs.sassFalse; +export const sassNull = cjs.sassNull; +export const sassTrue = cjs.sassTrue; +export const Exception = cjs.Exception; +export const PromiseOr = cjs.PromiseOr; +export const info = cjs.info; +export const render = cjs.render; +export const renderSync = cjs.renderSync; +export const TRUE = cjs.TRUE; +export const FALSE = cjs.FALSE; +export const NULL = cjs.NULL; +export const types = cjs.types; +export const NodePackageImporter = cjs.NodePackageImporter; + +let printedDefaultExportDeprecation = false; +function defaultExportDeprecation() { + if (printedDefaultExportDeprecation) return; + printedDefaultExportDeprecation = true; + console.error( + "`import sass from 'sass'` is deprecated.\n" + + "Please use `import * as sass from 'sass'` instead."); +} + +export default { + get compile() { + defaultExportDeprecation(); + return cjs.compile; + }, + get compileAsync() { + defaultExportDeprecation(); + return cjs.compileAsync; + }, + get compileString() { + defaultExportDeprecation(); + return cjs.compileString; + }, + get compileStringAsync() { + defaultExportDeprecation(); + return cjs.compileStringAsync; + }, + get initCompiler() { + defaultExportDeprecation(); + return cjs.initCompiler; + }, + get initAsyncCompiler() { + defaultExportDeprecation(); + return cjs.initAsyncCompiler; + }, + get Compiler() { + defaultExportDeprecation(); + return cjs.Compiler; + }, + get AsyncCompiler() { + defaultExportDeprecation(); + return cjs.AsyncCompiler; + }, + get Logger() { + defaultExportDeprecation(); + return cjs.Logger; + }, + get SassArgumentList() { + defaultExportDeprecation(); + return cjs.SassArgumentList; + }, + get SassBoolean() { + defaultExportDeprecation(); + return cjs.SassBoolean; + }, + get SassCalculation() { + defaultExportDeprecation(); + return cjs.SassCalculation; + }, + get CalculationOperation() { + defaultExportDeprecation(); + return cjs.CalculationOperation; + }, + get CalculationInterpolation() { + defaultExportDeprecation(); + return cjs.CalculationInterpolation; + }, + get SassColor() { + defaultExportDeprecation(); + return cjs.SassColor; + }, + get SassFunction() { + defaultExportDeprecation(); + return cjs.SassFunction; + }, + get SassList() { + defaultExportDeprecation(); + return cjs.SassList; + }, + get SassMap() { + defaultExportDeprecation(); + return cjs.SassMap; + }, + get SassMixin() { + defaultExportDeprecation(); + return cjs.SassMixin; + }, + get SassNumber() { + defaultExportDeprecation(); + return cjs.SassNumber; + }, + get SassString() { + defaultExportDeprecation(); + return cjs.SassString; + }, + get Value() { + defaultExportDeprecation(); + return cjs.Value; + }, + get CustomFunction() { + defaultExportDeprecation(); + return cjs.CustomFunction; + }, + get ListSeparator() { + defaultExportDeprecation(); + return cjs.ListSeparator; + }, + get sassFalse() { + defaultExportDeprecation(); + return cjs.sassFalse; + }, + get sassNull() { + defaultExportDeprecation(); + return cjs.sassNull; + }, + get sassTrue() { + defaultExportDeprecation(); + return cjs.sassTrue; + }, + get Exception() { + defaultExportDeprecation(); + return cjs.Exception; + }, + get PromiseOr() { + defaultExportDeprecation(); + return cjs.PromiseOr; + }, + get info() { + defaultExportDeprecation(); + return cjs.info; + }, + get render() { + defaultExportDeprecation(); + return cjs.render; + }, + get renderSync() { + defaultExportDeprecation(); + return cjs.renderSync; + }, + get TRUE() { + defaultExportDeprecation(); + return cjs.TRUE; + }, + get FALSE() { + defaultExportDeprecation(); + return cjs.FALSE; + }, + get NULL() { + defaultExportDeprecation(); + return cjs.NULL; + }, + get types() { + defaultExportDeprecation(); + return cjs.types; + }, + get NodePackageImporter() { + defaultExportDeprecation(); + return cjs.NodePackageImporter; + }, +}; diff --git a/node_modules/sass/types/compile.d.ts b/node_modules/sass/types/compile.d.ts new file mode 100644 index 0000000..872754c --- /dev/null +++ b/node_modules/sass/types/compile.d.ts @@ -0,0 +1,342 @@ +import {RawSourceMap} from 'source-map-js'; + +import {Options, StringOptions} from './options'; + +/** + * The result of compiling Sass to CSS. Returned by {@link compile}, {@link + * compileAsync}, {@link compileString}, and {@link compileStringAsync}. + * + * @category Compile + */ +export interface CompileResult { + /** + * The generated CSS. + * + * Note that this *never* includes a `sourceMapUrl` comment—it's up to the + * caller to determine where to save the source map and how to link to it from + * the stylesheet. + */ + css: string; + + /** + * The canonical URLs of all the stylesheets that were loaded during the + * Sass compilation. The order of these URLs is not guaranteed. + */ + loadedUrls: URL[]; + + /** + * The object representation of the source map that maps locations in the + * generated CSS back to locations in the Sass source code. + * + * This typically uses absolute `file:` URLs to refer to Sass files, although + * this can be controlled by having a custom {@link Importer} return {@link + * ImporterResult.sourceMapUrl}. + * + * This is set if and only if {@link Options.sourceMap} is `true`. + */ + sourceMap?: RawSourceMap; +} + +/** + * The result of creating a synchronous compiler. Returned by + * {@link initCompiler}. + * + * @category Compile + */ +export class Compiler { + /** + * Throws an error if constructed directly, instead of via + * {@link initCompiler}. + */ + private constructor(); + + /** + * The {@link compile} method exposed through a Compiler instance while it is + * active. If this is called after {@link dispose} on the Compiler + * instance, an error will be thrown. + * + * During the Compiler instance's lifespan, given the same input, this will + * return an identical result to the {@link compile} method exposed at the + * module root. + */ + compile(path: string, options?: Options<'sync'>): CompileResult; + + /** + * The {@link compileString} method exposed through a Compiler instance while + * it is active. If this is called after {@link dispose} on the Compiler + * instance, an error will be thrown. + * + * During the Compiler instance's lifespan, given the same input, this will + * return an identical result to the {@link compileString} method exposed at + * the module root. + */ + compileString(source: string, options?: StringOptions<'sync'>): CompileResult; + + /** + * Ends the lifespan of this Compiler instance. After this is invoked, all + * calls to the Compiler instance's {@link compile} or {@link compileString} + * methods will result in an error. + */ + dispose(): void; +} + +/** + * The result of creating an asynchronous compiler. Returned by + * {@link initAsyncCompiler}. + * + * @category Compile + */ +export class AsyncCompiler { + /** + * Throws an error if constructed directly, instead of via + * {@link initAsyncCompiler}. + */ + private constructor(); + + /** + * The {@link compileAsync} method exposed through an Async Compiler instance + * while it is active. If this is called after {@link dispose} on the Async + * Compiler instance, an error will be thrown. + * + * During the Async Compiler instance's lifespan, given the same input, this + * will return an identical result to the {@link compileAsync} method exposed + * at the module root. + */ + compileAsync( + path: string, + options?: Options<'async'> + ): Promise; + + /** + * The {@link compileStringAsync} method exposed through an Async Compiler + * instance while it is active. If this is called after {@link dispose} on the + * Async Compiler instance, an error will be thrown. + * + * During the Async Compiler instance's lifespan, given the same input, this + * will return an identical result to the {@link compileStringAsync} method + * exposed at the module root. + */ + compileStringAsync( + source: string, + options?: StringOptions<'async'> + ): Promise; + + /** + * Ends the lifespan of this Async Compiler instance. After this is invoked, + * all subsequent calls to the Compiler instance's `compileAsync` or + * `compileStringAsync` methods will result in an error. + * + * Any compilations that are submitted before `dispose` will not be cancelled, + * and will be allowed to settle. + * + * After all compilations have been settled and Sass completes any internal + * task cleanup, `dispose` will resolve its promise. + */ + dispose(): Promise; +} + +/** + * Synchronously compiles the Sass file at `path` to CSS. If it succeeds it + * returns a {@link CompileResult}, and if it fails it throws an {@link + * Exception}. + * + * This only allows synchronous {@link Importer}s and {@link CustomFunction}s. + * + * **Heads up!** When using the [sass-embedded] npm package for single + * compilations, **{@link compileAsync} is almost always faster than + * {@link compile}**, due to the overhead of emulating synchronous messaging + * with worker threads and concurrent compilations being blocked on main thread. + * + * If you are running multiple compilations with the [sass-embedded] npm + * package, using a {@link Compiler} will provide some speed improvements over + * the module-level methods, and an {@link AsyncCompiler} will be much faster. + * + * [sass-embedded]: https://www.npmjs.com/package/sass-embedded + * + * @example + * + * ```js + * const sass = require('sass'); + * + * const result = sass.compile("style.scss"); + * console.log(result.css); + * ``` + * + * @category Compile + * @compatibility dart: "1.45.0", node: false + */ +export function compile(path: string, options?: Options<'sync'>): CompileResult; + +/** + * Asynchronously compiles the Sass file at `path` to CSS. Returns a promise + * that resolves with a {@link CompileResult} if it succeeds and rejects with an + * {@link Exception} if it fails. + * + * This only allows synchronous or asynchronous {@link Importer}s and + * {@link CustomFunction}s. + * + * **Heads up!** When using the `sass` npm package, **{@link compile} is almost + * twice as fast as {@link compileAsync}**, due to the overhead of making the + * entire evaluation process asynchronous. + * + * @example + * + * ```js + * const sass = require('sass'); + * + * const result = await sass.compileAsync("style.scss"); + * console.log(result.css); + * ``` + * + * @category Compile + * @compatibility dart: "1.45.0", node: false + */ +export function compileAsync( + path: string, + options?: Options<'async'> +): Promise; + +/** + * Synchronously compiles a stylesheet whose contents is `source` to CSS. If it + * succeeds it returns a {@link CompileResult}, and if it fails it throws an + * {@link Exception}. + * + * This only allows synchronous {@link Importer}s and {@link CustomFunction}s. + * + * **Heads up!** When using the [sass-embedded] npm package for single + * compilations, **{@link compileStringAsync} is almost always faster than + * {@link compileString}**, due to the overhead of emulating synchronous + * messaging with worker threads and concurrent compilations being blocked on + * main thread. + * + * If you are running multiple compilations with the [sass-embedded] npm + * package, using a {@link Compiler} will provide some speed improvements over + * the module-level methods, and an {@link AsyncCompiler} will be much faster. + * + * [sass-embedded]: https://www.npmjs.com/package/sass-embedded + * + * @example + * + * ```js + * const sass = require('sass'); + * + * const result = sass.compileString(` + * h1 { + * font-size: 40px; + * code { + * font-face: Roboto Mono; + * } + * }`); + * console.log(result.css); + * ``` + * + * @category Compile + * @compatibility dart: "1.45.0", node: false + */ +export function compileString( + source: string, + options?: StringOptions<'sync'> +): CompileResult; + +/** + * Asynchronously compiles a stylesheet whose contents is `source` to CSS. + * Returns a promise that resolves with a {@link CompileResult} if it succeeds + * and rejects with an {@link Exception} if it fails. + * + * This only allows synchronous or asynchronous {@link Importer}s and {@link + * CustomFunction}s. + * + * **Heads up!** When using the `sass` npm package, **{@link compileString} is + * almost twice as fast as {@link compileStringAsync}**, due to the overhead + * of making the entire evaluation process asynchronous. + * + * @example + * + * ```js + * const sass = require('sass'); + * + * const result = await sass.compileStringAsync(` + * h1 { + * font-size: 40px; + * code { + * font-face: Roboto Mono; + * } + * }`); + * console.log(result.css); + * ``` + * + * @category Compile + * @compatibility dart: "1.45.0", node: false + */ +export function compileStringAsync( + source: string, + options?: StringOptions<'async'> +): Promise; + +/** + * Creates a synchronous {@link Compiler}. Each compiler instance exposes the + * {@link compile} and {@link compileString} methods within the lifespan of the + * Compiler. Given identical input, these methods will return results identical + * to their counterparts exposed at the module root. To use asynchronous + * compilation, use {@link initAsyncCompiler}. + * + * When calling the compile functions multiple times, using a compiler instance + * with the [sass-embedded] npm package is much faster than using the top-level + * compilation methods or the [sass] npm package. + * + * [sass-embedded]: https://www.npmjs.com/package/sass-embedded + * + * [sass]: https://www.npmjs.com/package/sass + * + * @example + * + * ```js + * const sass = require('sass'); + * function setup() { + * const compiler = sass.initCompiler(); + * const result1 = compiler.compileString('a {b: c}').css; + * const result2 = compiler.compileString('a {b: c}').css; + * compiler.dispose(); + * + * // throws error + * const result3 = sass.compileString('a {b: c}').css; + * } + * ``` + * @category Compile + * @compatibility dart: "1.70.0", node: false + */ +export function initCompiler(): Compiler; + +/** + * Creates an asynchronous {@link AsyncCompiler}. Each compiler + * instance exposes the {@link compileAsync} and {@link compileStringAsync} + * methods within the lifespan of the Compiler. Given identical input, these + * methods will return results identical to their counterparts exposed at the + * module root. To use synchronous compilation, use {@link initCompiler}; + * + * When calling the compile functions multiple times, using a compiler instance + * with the [sass-embedded] npm package is much faster than using the top-level + * compilation methods or the [sass] npm package. + * + * [sass-embedded]: https://www.npmjs.com/package/sass-embedded + * + * [sass]: https://www.npmjs.com/package/sass + * + * @example + * + * ```js + * const sass = require('sass'); + * async function setup() { + * const compiler = await sass.initAsyncCompiler(); + * const result1 = await compiler.compileStringAsync('a {b: c}').css; + * const result2 = await compiler.compileStringAsync('a {b: c}').css; + * await compiler.dispose(); + * + * // throws error + * const result3 = await sass.compileStringAsync('a {b: c}').css; + * } + * ``` + * @category Compile + * @compatibility dart: "1.70.0", node: false + */ +export function initAsyncCompiler(): Promise; diff --git a/node_modules/sass/types/exception.d.ts b/node_modules/sass/types/exception.d.ts new file mode 100644 index 0000000..616d652 --- /dev/null +++ b/node_modules/sass/types/exception.d.ts @@ -0,0 +1,41 @@ +import {SourceSpan} from './logger'; + +/** + * An exception thrown because a Sass compilation failed. + * + * @category Other + */ +export class Exception extends Error { + private constructor(); + + /** + * A human-friendly representation of the exception. + * + * Because many tools simply print `Error.message` directly, this includes not + * only the textual description of what went wrong (the {@link sassMessage}) + * but also an indication of where in the Sass stylesheet the error occurred + * (the {@link span}) and the Sass stack trace at the point of error (the + * {@link sassStack}). + */ + message: string; + + /** + * A textual description of what went wrong. + * + * Unlike {@link message}, this does *not* include representations of {@link + * span} or {@link sassStack}. + */ + readonly sassMessage: string; + + /** + * A human-friendly representation of the Sass stack trace at the point of + * error. + */ + readonly sassStack: string; + + /** The location the error occurred in the Sass file that triggered it. */ + readonly span: SourceSpan; + + /** Returns the same string as {@link message}. */ + toString(): string; +} diff --git a/node_modules/sass/types/importer.d.ts b/node_modules/sass/types/importer.d.ts new file mode 100644 index 0000000..27ebceb --- /dev/null +++ b/node_modules/sass/types/importer.d.ts @@ -0,0 +1,465 @@ +import {Syntax} from './options'; +import {PromiseOr} from './util/promise_or'; + +/** + * Contextual information passed to {@link Importer.canonicalize} and {@link + * FileImporter.findFileUrl}. Not all importers will need this information to + * resolve loads, but some may find it useful. + */ +export interface CanonicalizeContext { + /** + * Whether this is being invoked because of a Sass + * `@import` rule, as opposed to a `@use` or `@forward` rule. + * + * This should *only* be used for determining whether or not to load + * [import-only files](https://sass-lang.com/documentation/at-rules/import#import-only-files). + */ + fromImport: boolean; + + /** + * The canonical URL of the file that contains the load, if that information + * is available. + * + * For an {@link Importer}, this is only passed when the `url` parameter is a + * relative URL _or_ when its [URL scheme] is included in {@link + * Importer.nonCanonicalScheme}. This ensures that canonical URLs are always + * resolved the same way regardless of context. + * + * [URL scheme]: https://developer.mozilla.org/en-US/docs/Learn/Common_questions/Web_mechanics/What_is_a_URL#scheme + * + * For a {@link FileImporter}, this is always available as long as Sass knows + * the canonical URL of the containing file. + */ + containingUrl: URL | null; +} + +/** + * A special type of importer that redirects all loads to existing files on + * disk. Although this is less powerful than a full {@link Importer}, it + * automatically takes care of Sass features like resolving partials and file + * extensions and of loading the file from disk. + * + * Like all importers, this implements custom Sass loading logic for [`@use` + * rules](https://sass-lang.com/documentation/at-rules/use) and [`@import` + * rules](https://sass-lang.com/documentation/at-rules/import). It can be passed + * to {@link Options.importers} or {@link StringOptionsWithImporter.importer}. + * + * @typeParam sync - A `FileImporter<'sync'>`'s {@link findFileUrl} must return + * synchronously, but in return it can be passed to {@link compile} and {@link + * compileString} in addition to {@link compileAsync} and {@link + * compileStringAsync}. + * + * A `FileImporter<'async'>`'s {@link findFileUrl} may either return + * synchronously or asynchronously, but it can only be used with {@link + * compileAsync} and {@link compileStringAsync}. + * + * @example + * + * ```js + * const {pathToFileURL} = require('url'); + * + * sass.compile('style.scss', { + * importers: [{ + * // An importer that redirects relative URLs starting with "~" to + * // `node_modules`. + * findFileUrl(url) { + * if (!url.startsWith('~')) return null; + * return new URL(url.substring(1), pathToFileURL('node_modules')); + * } + * }] + * }); + * ``` + * + * @category Importer + */ +export interface FileImporter< + sync extends 'sync' | 'async' = 'sync' | 'async' +> { + /** + * A callback that's called to partially resolve a load (such as + * [`@use`](https://sass-lang.com/documentation/at-rules/use) or + * [`@import`](https://sass-lang.com/documentation/at-rules/import)) to a file + * on disk. + * + * Unlike an {@link Importer}, the compiler will automatically handle relative + * loads for a {@link FileImporter}. See {@link Options.importers} for more + * details on the way loads are resolved. + * + * @param url - The loaded URL. Since this might be relative, it's represented + * as a string rather than a {@link URL} object. + * + * @returns An absolute `file:` URL if this importer recognizes the `url`. + * This may be only partially resolved: the compiler will automatically look + * for [partials](https://sass-lang.com/documentation/at-rules/use#partials), + * [index files](https://sass-lang.com/documentation/at-rules/use#index-files), + * and file extensions based on the returned URL. An importer may also return + * a fully resolved URL if it so chooses. + * + * If this importer doesn't recognize the URL, it should return `null` instead + * to allow other importers or {@link Options.loadPaths | load paths} to + * handle it. + * + * This may also return a `Promise`, but if it does the importer may only be + * passed to {@link compileAsync} and {@link compileStringAsync}, not {@link + * compile} or {@link compileString}. + * + * @throws any - If this importer recognizes `url` but determines that it's + * invalid, it may throw an exception that will be wrapped by Sass. If the + * exception object has a `message` property, it will be used as the wrapped + * exception's message; otherwise, the exception object's `toString()` will be + * used. This means it's safe for importers to throw plain strings. + */ + findFileUrl( + url: string, + context: CanonicalizeContext + ): PromiseOr; + + /** @hidden */ + canonicalize?: never; +} + +/** + * An object that implements custom Sass loading logic for [`@use` + * rules](https://sass-lang.com/documentation/at-rules/use) and [`@import` + * rules](https://sass-lang.com/documentation/at-rules/import). It can be passed + * to {@link Options.importers} or {@link StringOptionsWithImporter.importer}. + * + * Importers that simply redirect to files on disk are encouraged to use the + * {@link FileImporter} interface instead. + * + * ### Resolving a Load + * + * This is the process of resolving a load using a custom importer: + * + * - The compiler encounters `@use "db:foo/bar/baz"`. + * - It calls {@link canonicalize} with `"db:foo/bar/baz"`. + * - {@link canonicalize} returns `new URL("db:foo/bar/baz/_index.scss")`. + * - If the compiler has already loaded a stylesheet with this canonical URL, it + * re-uses the existing module. + * - Otherwise, it calls {@link load} with `new + * URL("db:foo/bar/baz/_index.scss")`. + * - {@link load} returns an {@link ImporterResult} that the compiler uses as + * the contents of the module. + * + * See {@link Options.importers} for more details on the way loads are resolved + * using multiple importers and load paths. + * + * @typeParam sync - An `Importer<'sync'>`'s {@link canonicalize} and {@link + * load} must return synchronously, but in return it can be passed to {@link + * compile} and {@link compileString} in addition to {@link compileAsync} and + * {@link compileStringAsync}. + * + * An `Importer<'async'>`'s {@link canonicalize} and {@link load} may either + * return synchronously or asynchronously, but it can only be used with {@link + * compileAsync} and {@link compileStringAsync}. + * + * @example + * + * ```js + * sass.compile('style.scss', { + * // An importer for URLs like `bgcolor:orange` that generates a + * // stylesheet with the given background color. + * importers: [{ + * canonicalize(url) { + * if (!url.startsWith('bgcolor:')) return null; + * return new URL(url); + * }, + * load(canonicalUrl) { + * return { + * contents: `body {background-color: ${canonicalUrl.pathname}}`, + * syntax: 'scss' + * }; + * } + * }] + * }); + * ``` + * + * @category Importer + */ +export interface Importer { + /** + * If `url` is recognized by this importer, returns its canonical format. + * + * If Sass has already loaded a stylesheet with the returned canonical URL, it + * re-uses the existing parse tree (and the loaded module for `@use`). This + * means that importers **must ensure** that the same canonical URL always + * refers to the same stylesheet, *even across different importers*. As such, + * importers are encouraged to use unique URL schemes to disambiguate between + * one another. + * + * As much as possible, custom importers should canonicalize URLs the same way + * as the built-in filesystem importer: + * + * - The importer should look for stylesheets by adding the prefix `_` to the + * URL's basename, and by adding the extensions `.sass` and `.scss` if the + * URL doesn't already have one of those extensions. For example, if the + * URL was `foo/bar/baz`, the importer would look for: + * - `foo/bar/baz.sass` + * - `foo/bar/baz.scss` + * - `foo/bar/_baz.sass` + * - `foo/bar/_baz.scss` + * + * If the URL was `foo/bar/baz.scss`, the importer would just look for: + * - `foo/bar/baz.scss` + * - `foo/bar/_baz.scss` + * + * If the importer finds a stylesheet at more than one of these URLs, it + * should throw an exception indicating that the URL is ambiguous. Note that + * if the extension is explicitly specified, a stylesheet with the opposite + * extension is allowed to exist. + * + * - If none of the possible paths is valid, the importer should perform the + * same resolution on the URL followed by `/index`. In the example above, + * it would look for: + * - `foo/bar/baz/index.sass` + * - `foo/bar/baz/index.scss` + * - `foo/bar/baz/_index.sass` + * - `foo/bar/baz/_index.scss` + * + * As above, if the importer finds a stylesheet at more than one of these + * URLs, it should throw an exception indicating that the import is + * ambiguous. + * + * If no stylesheets are found, the importer should return `null`. + * + * Calling {@link canonicalize} multiple times with the same URL must return + * the same result. Calling {@link canonicalize} with a URL returned by a + * previous call to {@link canonicalize} must return that URL. + * + * Relative loads in stylesheets loaded from an importer are handled by + * resolving the loaded URL relative to the canonical URL of the stylesheet + * that contains it, and passing that URL back to the importer's {@link + * canonicalize} method. For example, suppose the "Resolving a Load" example + * {@link Importer | above} returned a stylesheet that contained `@use + * "mixins"`: + * + * - The compiler resolves the URL `mixins` relative to the current + * stylesheet's canonical URL `db:foo/bar/baz/_index.scss` to get + * `db:foo/bar/baz/mixins`. + * - It calls {@link canonicalize} with `"db:foo/bar/baz/mixins"`. + * - {@link canonicalize} returns `new URL("db:foo/bar/baz/_mixins.scss")`. + * + * Because of this, {@link canonicalize} must return a meaningful result when + * called with a URL relative to one returned by an earlier call to {@link + * canonicalize}. + * + * @param url - The loaded URL. Since this might be relative, it's represented + * as a string rather than a {@link URL} object. + * + * @returns An absolute URL if this importer recognizes the `url`, or `null` + * if it doesn't. If this returns `null`, other importers or {@link + * Options.loadPaths | load paths} may handle the load. + * + * This may also return a `Promise`, but if it does the importer may only be + * passed to {@link compileAsync} and {@link compileStringAsync}, not {@link + * compile} or {@link compileString}. + * + * @throws any - If this importer recognizes `url` but determines that it's + * invalid, it may throw an exception that will be wrapped by Sass. If the + * exception object has a `message` property, it will be used as the wrapped + * exception's message; otherwise, the exception object's `toString()` will be + * used. This means it's safe for importers to throw plain strings. + */ + canonicalize( + url: string, + context: CanonicalizeContext + ): PromiseOr; + + /** + * Loads the Sass text for the given `canonicalUrl`, or returns `null` if this + * importer can't find the stylesheet it refers to. + * + * @param canonicalUrl - The canonical URL of the stylesheet to load. This is + * guaranteed to come from a call to {@link canonicalize}, although not every + * call to {@link canonicalize} will result in a call to {@link load}. + * + * @returns The contents of the stylesheet at `canonicalUrl` if it can be + * loaded, or `null` if it can't. + * + * This may also return a `Promise`, but if it does the importer may only be + * passed to {@link compileAsync} and {@link compileStringAsync}, not {@link + * compile} or {@link compileString}. + * + * @throws any - If this importer finds a stylesheet at `url` but it fails to + * load for some reason, or if `url` is uniquely associated with this importer + * but doesn't refer to a real stylesheet, the importer may throw an exception + * that will be wrapped by Sass. If the exception object has a `message` + * property, it will be used as the wrapped exception's message; otherwise, + * the exception object's `toString()` will be used. This means it's safe for + * importers to throw plain strings. + */ + load(canonicalUrl: URL): PromiseOr; + + /** @hidden */ + findFileUrl?: never; + + /** + * A URL scheme or set of schemes (without the `:`) that this importer + * promises never to use for URLs returned by {@link canonicalize}. If it does + * return a URL with one of these schemes, that's an error. + * + * If this is set, any call to canonicalize for a URL with a non-canonical + * scheme will be passed {@link CanonicalizeContext.containingUrl} if it's + * known. + * + * These schemes may only contain lowercase ASCII letters, ASCII numerals, + * `+`, `-`, and `.`. They may not be empty. + */ + nonCanonicalScheme?: string | string[]; +} + +declare const nodePackageImporterKey: unique symbol; + +/** + * The built-in Node.js package importer. This loads pkg: URLs from node_modules + * according to the standard Node.js resolution algorithm. + * + * A Node.js package importer is exposed as a class that can be added to the + * `importers` option. + * + *```js + * const sass = require('sass'); + * sass.compileString('@use "pkg:vuetify', { + * importers: [new sass.NodePackageImporter()] + * }); + *``` + * + * ## Writing Sass packages + * + * Package authors can control what is exposed to their users through their + * `package.json` manifest. The recommended method is to add a `sass` + * conditional export to `package.json`. + * + * ```json + * // node_modules/uicomponents/package.json + * { + * "exports": { + * ".": { + * "sass": "./src/scss/index.scss", + * "import": "./dist/js/index.mjs", + * "default": "./dist/js/index.js" + * } + * } + * } + * ``` + * + * This allows a package user to write `@use "pkg:uicomponents"` to load the + * file at `node_modules/uicomponents/src/scss/index.scss`. + * + * The Node.js package importer supports the variety of formats supported by + * Node.js [package entry points], allowing authors to expose multiple subpaths. + * + * [package entry points]: + * https://nodejs.org/api/packages.html#package-entry-points + * + * ```json + * // node_modules/uicomponents/package.json + * { + * "exports": { + * ".": { + * "sass": "./src/scss/index.scss", + * }, + * "./colors.scss": { + * "sass": "./src/scss/_colors.scss", + * }, + * "./theme/*.scss": { + * "sass": "./src/scss/theme/*.scss", + * }, + * } + * } + * ``` + * + * This allows a package user to write: + * + * - `@use "pkg:uicomponents";` to import the root export. + * - `@use "pkg:uicomponents/colors";` to import the colors partial. + * - `@use "pkg:uicomponents/theme/purple";` to import a purple theme. + * + * Note that while library users can rely on the importer to resolve + * [partials](https://sass-lang.com/documentation/at-rules/use#partials), [index + * files](https://sass-lang.com/documentation/at-rules/use#index-files), and + * extensions, library authors must specify the entire file path in `exports`. + * + * In addition to the `sass` condition, the `style` condition is also + * acceptable. Sass will match the `default` condition if it's a relevant file + * type, but authors are discouraged from relying on this. Notably, the key + * order matters, and the importer will resolve to the first value with a key + * that is `sass`, `style`, or `default`, so you should always put `default` + * last. + * + * To help package authors who haven't transitioned to package entry points + * using the `exports` field, the Node.js package importer provides several + * fallback options. If the `pkg:` URL does not have a subpath, the Node.js + * package importer will look for a `sass` or `style` key at the root of + * `package.json`. + * + * ```json + * // node_modules/uicomponents/package.json + * { + * "sass": "./src/scss/index.scss", + * } + * ``` + * + * This allows a user to write `@use "pkg:uicomponents";` to import the + * `index.scss` file. + * + * Finally, the Node.js package importer will look for an `index` file at the + * package root, resolving partials and extensions. For example, if the file + * `_index.scss` exists in the package root of `uicomponents`, a user can import + * that with `@use "pkg:uicomponents";`. + * + * If a `pkg:` URL includes a subpath that doesn't have a match in package entry + * points, the Node.js importer will attempt to find that file relative to the + * package root, resolving for file extensions, partials and index files. For + * example, if the file `src/sass/_colors.scss` exists in the `uicomponents` + * package, a user can import that file using `@use + * "pkg:uicomponents/src/sass/colors";`. + * + * @compatibility dart: "1.71.0", node: false + * @category Importer + */ +export class NodePackageImporter { + /** Used to distinguish this type from any arbitrary object. */ + private readonly [nodePackageImporterKey]: true; + + /** + * The NodePackageImporter has an optional `entryPointDirectory` option, which + * is the directory where the Node Package Importer should start when + * resolving `pkg:` URLs in sources other than files on disk. This will be + * used as the `parentURL` in the [Node Module + * Resolution](https://nodejs.org/api/esm.html#resolution-algorithm-specification) + * algorithm. + * + * In order to be found by the Node Package Importer, a package will need to + * be inside a node_modules folder located in the `entryPointDirectory`, or + * one of its parent directories, up to the filesystem root. + * + * Relative paths will be resolved relative to the current working directory. + * If a path is not provided, this defaults to the parent directory of the + * Node.js entrypoint. If that's not available, this will throw an error. + */ + constructor(entryPointDirectory?: string); +} + +/** + * The result of successfully loading a stylesheet with an {@link Importer}. + * + * @category Importer + */ +export interface ImporterResult { + /** The contents of the stylesheet. */ + contents: string; + + /** The syntax with which to parse {@link contents}. */ + syntax: Syntax; + + /** + * The URL to use to link to the loaded stylesheet's source code in source + * maps. A `file:` URL is ideal because it's accessible to both browsers and + * other build tools, but an `http:` URL is also acceptable. + * + * If this isn't set, it defaults to a `data:` URL that contains the contents + * of the loaded stylesheet. + */ + sourceMapUrl?: URL; +} diff --git a/node_modules/sass/types/index.d.ts b/node_modules/sass/types/index.d.ts new file mode 100644 index 0000000..92831b2 --- /dev/null +++ b/node_modules/sass/types/index.d.ts @@ -0,0 +1,96 @@ +// This is a mirror of the JS API definitions in `spec/js-api`, but with comments +// written to provide user-facing documentation rather than to specify behavior for +// implementations. + +export { + AsyncCompiler, + CompileResult, + Compiler, + compile, + compileAsync, + compileString, + compileStringAsync, + initCompiler, + initAsyncCompiler, +} from './compile'; +export {Exception} from './exception'; +export { + CanonicalizeContext, + FileImporter, + Importer, + ImporterResult, + NodePackageImporter, +} from './importer'; +export {Logger, SourceSpan, SourceLocation} from './logger'; +export { + CustomFunction, + Options, + OutputStyle, + StringOptions, + StringOptionsWithImporter, + StringOptionsWithoutImporter, + Syntax, +} from './options'; +export {PromiseOr} from './util/promise_or'; +export { + CalculationInterpolation, + CalculationOperation, + CalculationOperator, + CalculationValue, + ListSeparator, + SassArgumentList, + SassBoolean, + SassCalculation, + SassColor, + SassFunction, + SassList, + SassMap, + SassMixin, + SassNumber, + SassString, + Value, + sassFalse, + sassNull, + sassTrue, +} from './value'; + +// Legacy APIs +export {LegacyException} from './legacy/exception'; +export { + FALSE, + LegacyAsyncFunction, + LegacyAsyncFunctionDone, + LegacyFunction, + LegacySyncFunction, + LegacyValue, + NULL, + TRUE, + types, +} from './legacy/function'; +export { + LegacyAsyncImporter, + LegacyImporter, + LegacyImporterResult, + LegacyImporterThis, + LegacySyncImporter, +} from './legacy/importer'; +export { + LegacySharedOptions, + LegacyFileOptions, + LegacyStringOptions, + LegacyOptions, +} from './legacy/options'; +export {LegacyPluginThis} from './legacy/plugin_this'; +export {LegacyResult, render, renderSync} from './legacy/render'; + +/** + * Information about the Sass implementation. This always begins with a unique + * identifier for the Sass implementation, followed by U+0009 TAB, followed by + * its npm package version. Some implementations include additional information + * as well, but not in any standardized format. + * + * * For Dart Sass, the implementation name is `dart-sass`. + * * For Node Sass, the implementation name is `node-sass`. + * * For the embedded host, the implementation name is `sass-embedded`. + */ +export const info: string; diff --git a/node_modules/sass/types/legacy/exception.d.ts b/node_modules/sass/types/legacy/exception.d.ts new file mode 100644 index 0000000..29d3a54 --- /dev/null +++ b/node_modules/sass/types/legacy/exception.d.ts @@ -0,0 +1,55 @@ +/** + * The exception type thrown by {@link renderSync} and passed as the error to + * {@link render}'s callback. + * + * @category Legacy + * @deprecated This is only thrown by the legacy {@link render} and {@link + * renderSync} APIs. Use {@link compile}, {@link compileString}, {@link + * compileAsync}, and {@link compileStringAsync} instead. + */ +export interface LegacyException extends Error { + /** + * The error message. For Dart Sass, when possible this includes a highlighted + * indication of where in the source file the error occurred as well as the + * Sass stack trace. + */ + message: string; + + /** + * The error message. For Dart Sass, this is the same as the result of calling + * {@link toString}, which is itself the same as {@link message} but with the + * prefix "Error:". + */ + formatted: string; + + /** + * The (1-based) line number on which the error occurred, if this exception is + * associated with a specific Sass file location. + */ + line?: number; + + /** + * The (1-based) column number within {@link line} at which the error + * occurred, if this exception is associated with a specific Sass file + * location. + */ + column?: number; + + /** + * Analogous to the exit code for an executable. `1` for an error caused by a + * Sass file, `3` for any other type of error. + */ + status: number; + + /** + * If this exception was caused by an error in a Sass file, this will + * represent the Sass file's location. It can be in one of three formats: + * + * * If the Sass file was loaded from disk, this is the path to that file. + * * If the Sass file was generated by an importer, this is its canonical URL. + * * If the Sass file was passed as {@link LegacyStringOptions.data} without a + * corresponding {@link LegacyStringOptions.file}, this is the special + * string `"stdin"`. + */ + file?: string; +} diff --git a/node_modules/sass/types/legacy/function.d.ts b/node_modules/sass/types/legacy/function.d.ts new file mode 100644 index 0000000..7c27eb8 --- /dev/null +++ b/node_modules/sass/types/legacy/function.d.ts @@ -0,0 +1,757 @@ +import {LegacyPluginThis} from './plugin_this'; + +/** + * A synchronous callback that implements a custom Sass function. This can be + * passed to {@link LegacySharedOptions.functions} for either {@link render} or + * {@link renderSync}. + * + * If this throws an error, Sass will treat that as the function failing with + * that error message. + * + * ```js + * const result = sass.renderSync({ + * file: 'style.scss', + * functions: { + * "sum($arg1, $arg2)": (arg1, arg2) => { + * if (!(arg1 instanceof sass.types.Number)) { + * throw new Error("$arg1: Expected a number"); + * } else if (!(arg2 instanceof sass.types.Number)) { + * throw new Error("$arg2: Expected a number"); + * } + * return new sass.types.Number(arg1.getValue() + arg2.getValue()); + * } + * } + * }); + * ``` + * + * @param args - One argument for each argument that's declared in the signature + * that's passed to {@link LegacySharedOptions.functions}. If the signature + * [takes arbitrary + * arguments](https://sass-lang.com/documentation/at-rules/function#taking-arbitrary-arguments), + * they're passed as a single argument list in the last argument. + * + * @category Legacy + * @deprecated This only works with the legacy {@link render} and {@link + * renderSync} APIs. Use {@link CustomFunction} with {@link compile}, {@link + * compileString}, {@link compileAsync}, and {@link compileStringAsync} instead. + */ +export type LegacySyncFunction = ( + this: LegacyPluginThis, + ...args: LegacyValue[] +) => LegacyValue; + +/** + * An asynchronous callback that implements a custom Sass function. This can be + * passed to {@link LegacySharedOptions.functions}, but only for {@link render}. + * + * An asynchronous function must return `undefined`. Its final argument will + * always be a callback, which it should call with the result of the function + * once it's done running. + * + * If this throws an error, Sass will treat that as the function failing with + * that error message. + * + * ```js + * sass.render({ + * file: 'style.scss', + * functions: { + * "sum($arg1, $arg2)": (arg1, arg2, done) => { + * if (!(arg1 instanceof sass.types.Number)) { + * throw new Error("$arg1: Expected a number"); + * } else if (!(arg2 instanceof sass.types.Number)) { + * throw new Error("$arg2: Expected a number"); + * } + * done(new sass.types.Number(arg1.getValue() + arg2.getValue())); + * } + * } + * }, (result, error) => { + * // ... + * }); + * ``` + * + * This is passed one argument for each argument that's declared in the + * signature that's passed to {@link LegacySharedOptions.functions}. If the + * signature [takes arbitrary + * arguments](https://sass-lang.com/documentation/at-rules/function#taking-arbitrary-arguments), + * they're passed as a single argument list in the last argument before the + * callback. + * + * @category Legacy + * @deprecated This only works with the legacy {@link render} and {@link + * renderSync} APIs. Use {@link CustomFunction} with {@link compile}, {@link + * compileString}, {@link compileAsync}, and {@link compileStringAsync} instead. + */ +export type LegacyAsyncFunction = + | ((this: LegacyPluginThis, done: (result: LegacyValue) => void) => void) + | (( + this: LegacyPluginThis, + arg1: LegacyValue, + done: LegacyAsyncFunctionDone + ) => void) + | (( + this: LegacyPluginThis, + arg1: LegacyValue, + arg2: LegacyValue, + done: LegacyAsyncFunctionDone + ) => void) + | (( + this: LegacyPluginThis, + arg1: LegacyValue, + arg2: LegacyValue, + arg3: LegacyValue, + done: LegacyAsyncFunctionDone + ) => void) + | (( + this: LegacyPluginThis, + arg1: LegacyValue, + arg2: LegacyValue, + arg3: LegacyValue, + arg4: LegacyValue, + done: LegacyAsyncFunctionDone + ) => void) + | (( + this: LegacyPluginThis, + arg1: LegacyValue, + arg2: LegacyValue, + arg3: LegacyValue, + arg4: LegacyValue, + arg5: LegacyValue, + done: LegacyAsyncFunctionDone + ) => void) + | (( + this: LegacyPluginThis, + arg1: LegacyValue, + arg2: LegacyValue, + arg3: LegacyValue, + arg4: LegacyValue, + arg5: LegacyValue, + arg6: LegacyValue, + done: LegacyAsyncFunctionDone + ) => void) + | (( + this: LegacyPluginThis, + ...args: [...LegacyValue[], LegacyAsyncFunctionDone] + ) => void); + +/** + * The function called by a {@link LegacyAsyncFunction} to indicate that it's + * finished. + * + * @param result - If this is a {@link LegacyValue}, that indicates that the + * function call completed successfully. If it's a {@link types.Error}, that + * indicates that the function call failed. + * + * @category Legacy + * @deprecated This only works with the legacy {@link render} and {@link + * renderSync} APIs. Use {@link CustomFunction} with {@link compile}, {@link + * compileString}, {@link compileAsync}, and {@link compileStringAsync} instead. + */ +export type LegacyAsyncFunctionDone = ( + result: LegacyValue | types.Error +) => void; + +/** + * A callback that implements a custom Sass function. For {@link renderSync}, + * this must be a {@link LegacySyncFunction} which returns its result directly; + * for {@link render}, it may be either a {@link LegacySyncFunction} or a {@link + * LegacyAsyncFunction} which calls a callback with its result. + * + * See {@link LegacySharedOptions.functions} for more details. + * + * @category Legacy + * @deprecated This only works with the legacy {@link render} and {@link + * renderSync} APIs. Use {@link CustomFunction} with {@link compile}, {@link + * compileString}, {@link compileAsync}, and {@link compileStringAsync} instead. + */ +export type LegacyFunction = sync extends 'async' + ? LegacySyncFunction | LegacyAsyncFunction + : LegacySyncFunction; + +/** + * A type representing all the possible values that may be passed to or returned + * from a {@link LegacyFunction}. + * + * @category Legacy + * @deprecated This only works with the legacy {@link render} and {@link + * renderSync} APIs. Use {@link Value} with {@link compile}, {@link + * compileString}, {@link compileAsync}, and {@link compileStringAsync} instead. + */ +export type LegacyValue = + | types.Null + | types.Number + | types.String + | types.Boolean + | types.Color + | types.List + | types.Map; + +/** + * A shorthand for `sass.types.Boolean.TRUE`. + * + * @category Legacy + * @deprecated This only works with the legacy {@link render} and {@link + * renderSync} APIs. Use {@link sassTrue} with {@link compile}, {@link + * compileString}, {@link compileAsync}, and {@link compileStringAsync} instead. + */ +export const TRUE: types.Boolean; + +/** + * A shorthand for `sass.types.Boolean.FALSE`. + * + * @category Legacy + * @deprecated This only works with the legacy {@link render} and {@link + * renderSync} APIs. Use {@link sassFalse} with {@link compile}, {@link + * compileString}, {@link compileAsync}, and {@link compileStringAsync} instead. + */ +export const FALSE: types.Boolean; + +/** + * A shorthand for `sass.types.Null.NULL`. + * + * @category Legacy + * @deprecated This only works with the legacy {@link render} and {@link + * renderSync} APIs. Use {@link sassNull} with {@link compile}, {@link + * compileString}, {@link compileAsync}, and {@link compileStringAsync} instead. + */ +export const NULL: types.Null; + +/** + * The namespace for value types used in the legacy function API. + * + * @category Legacy + * @deprecated This only works with the legacy {@link render} and {@link + * renderSync} APIs. Use {@link Value} with {@link compile}, {@link + * compileString}, {@link compileAsync}, and {@link compileStringAsync} instead. + */ +export namespace types { + /** + * The class for Sass's singleton [`null` + * value](https://sass-lang.com/documentation/values/null). The value itself + * can be accessed through the {@link NULL} field. + */ + export class Null { + /** Sass's singleton `null` value. */ + static readonly NULL: Null; + } + + /** + * Sass's [number type](https://sass-lang.com/documentation/values/numbers). + */ + export class Number { + /** + * @param value - The numeric value of the number. + * + * @param unit - If passed, the number's unit. + * + * Complex units can be represented as + * `**.../**...`, with numerator units on the + * left-hand side of the `/` and denominator units on the right. A number + * with only numerator units may omit the `/` and the units after it, and a + * number with only denominator units may be represented + * with no units before the `/`. + * + * @example + * + * ```scss + * new sass.types.Number(0.5); // == 0.5 + * new sass.types.Number(10, "px"); // == 10px + * new sass.types.Number(10, "px*px"); // == 10px * 1px + * new sass.types.Number(10, "px/s"); // == math.div(10px, 1s) + * new sass.types.Number(10, "px*px/s*s"); // == 10px * math.div(math.div(1px, 1s), 1s) + * ``` + */ + constructor(value: number, unit?: string); + + /** + * Returns the value of the number, ignoring units. + * + * **Heads up!** This means that `96px` and `1in` will return different + * values, even though they represent the same length. + * + * @example + * + * ```js + * const number = new sass.types.Number(10, "px"); + * number.getValue(); // 10 + * ``` + */ + getValue(): number; + + /** + * Destructively modifies this number by setting its numeric value to + * `value`, independent of its units. + * + * @deprecated Use {@link constructor} instead. + */ + setValue(value: number): void; + + /** + * Returns a string representation of this number's units. Complex units are + * returned in the same format that {@link constructor} accepts them. + * + * @example + * + * ```js + * // number is `10px`. + * number.getUnit(); // "px" + * + * // number is `math.div(10px, 1s)`. + * number.getUnit(); // "px/s" + * ``` + */ + getUnit(): string; + + /** + * Destructively modifies this number by setting its units to `unit`, + * independent of its numeric value. Complex units are specified in the same + * format as {@link constructor}. + * + * @deprecated Use {@link constructor} instead. + */ + setUnit(unit: string): void; + } + + /** + * Sass's [string type](https://sass-lang.com/documentation/values/strings). + * + * **Heads up!** This API currently provides no way of distinguishing between + * a [quoted](https://sass-lang.com/documentation/values/strings#quoted) and + * [unquoted](https://sass-lang.com/documentation/values/strings#unquoted) + * string. + */ + export class String { + /** + * Creates an unquoted string with the given contents. + * + * **Heads up!** This API currently provides no way of creating a + * [quoted](https://sass-lang.com/documentation/values/strings#quoted) + * string. + */ + constructor(value: string); + + /** + * Returns the contents of the string. If the string contains escapes, + * those escapes are included literally if it’s + * [unquoted](https://sass-lang.com/documentation/values/strings#unquoted), + * while the values of the escapes are included if it’s + * [quoted](https://sass-lang.com/documentation/values/strings#quoted). + * + * @example + * + * ``` + * // string is `Arial`. + * string.getValue(); // "Arial" + * + * // string is `"Helvetica Neue"`. + * string.getValue(); // "Helvetica Neue" + * + * // string is `\1F46D`. + * string.getValue(); // "\\1F46D" + * + * // string is `"\1F46D"`. + * string.getValue(); // "👭" + * ``` + */ + getValue(): string; + + /** + * Destructively modifies this string by setting its numeric value to + * `value`. + * + * **Heads up!** Even if the string was originally quoted, this will cause + * it to become unquoted. + * + * @deprecated Use {@link constructor} instead. + */ + setValue(value: string): void; + } + + /** + * Sass's [boolean type](https://sass-lang.com/documentation/values/booleans). + * + * Custom functions should respect Sass’s notion of + * [truthiness](https://sass-lang.com/documentation/at-rules/control/if#truthiness-and-falsiness) + * by treating `false` and `null` as falsey and everything else as truthy. + * + * **Heads up!** Boolean values can't be constructed, they can only be + * accessed through the {@link TRUE} and {@link FALSE} constants. + */ + export class Boolean { + /** + * Returns `true` if this is Sass's `true` value and `false` if this is + * Sass's `false` value. + * + * @example + * + * ```js + * // boolean is `true`. + * boolean.getValue(); // true + * boolean === sass.types.Boolean.TRUE; // true + * + * // boolean is `false`. + * boolean.getValue(); // false + * boolean === sass.types.Boolean.FALSE; // true + * ``` + */ + getValue(): T; + + /** Sass's `true` value. */ + static readonly TRUE: Boolean; + + /** Sass's `false` value. */ + static readonly FALSE: Boolean; + } + + /** + * Sass's [color type](https://sass-lang.com/documentation/values/colors). + */ + export class Color { + /** + * Creates a new Sass color with the given red, green, blue, and alpha + * channels. The red, green, and blue channels must be integers between 0 + * and 255 (inclusive), and alpha must be between 0 and 1 (inclusive). + * + * @example + * + * ```js + * new sass.types.Color(107, 113, 127); // #6b717f + * new sass.types.Color(0, 0, 0, 0); // rgba(0, 0, 0, 0) + * ``` + */ + constructor(r: number, g: number, b: number, a?: number); + + /** + * Creates a new Sass color with alpha, red, green, and blue channels taken + * from respective two-byte chunks of a hexidecimal number. + * + * @example + * + * ```js + * new sass.types.Color(0xff6b717f); // #6b717f + * new sass.types.Color(0x00000000); // rgba(0, 0, 0, 0) + * ``` + */ + constructor(argb: number); + + /** + * Returns the red channel of the color as an integer from 0 to 255. + * + * @example + * + * ```js + * // color is `#6b717f`. + * color.getR(); // 107 + * + * // color is `#b37399`. + * color.getR(); // 179 + * ``` + */ + getR(): number; + + /** + * Sets the red channel of the color. The value must be an integer between 0 + * and 255 (inclusive). + * + * @deprecated Use {@link constructor} instead. + */ + setR(value: number): void; + + /** + * Returns the green channel of the color as an integer from 0 to 255. + * + * @example + * + * ```js + * // color is `#6b717f`. + * color.getG(); // 113 + * + * // color is `#b37399`. + * color.getG(); // 115 + * ``` + */ + getG(): number; + + /** + * Sets the green channel of the color. The value must be an integer between + * 0 and 255 (inclusive). + * + * @deprecated Use {@link constructor} instead. + */ + setG(value: number): void; + + /** + * Returns the blue channel of the color as an integer from 0 to 255. + * + * @example + * + * ```js + * // color is `#6b717f`. + * color.getB(); // 127 + * + * // color is `#b37399`. + * color.getB(); // 153 + * ``` + */ + getB(): number; + + /** + * Sets the blue channel of the color. The value must be an integer between + * 0 and 255 (inclusive). + * + * @deprecated Use {@link constructor} instead. + */ + setB(value: number): void; + + /** + * Returns the alpha channel of the color as a number from 0 to 1. + * + * @example + * + * ```js + * // color is `#6b717f`. + * color.getA(); // 1 + * + * // color is `transparent`. + * color.getA(); // 0 + * ``` + */ + getA(): number; + + /** + * Sets the alpha channel of the color. The value must be between 0 and 1 + * (inclusive). + * + * @deprecated Use {@link constructor} instead. + */ + setA(value: number): void; + } + + /** + * Sass's [list type](https://sass-lang.com/documentation/values/lists). + * + * **Heads up!** This list type’s methods use 0-based indexing, even though + * within Sass lists use 1-based indexing. These methods also don’t support + * using negative numbers to index backwards from the end of the list. + */ + export class List { + /** + * Creates a new Sass list. + * + * **Heads up!** The initial values of the list elements are undefined. + * These elements must be set using {@link setValue} before accessing them + * or passing the list back to Sass. + * + * @example + * + * ```js + * const list = new sass.types.List(3); + * list.setValue(0, new sass.types.Number(10, "px")); + * list.setValue(1, new sass.types.Number(15, "px")); + * list.setValue(2, new sass.types.Number(32, "px")); + * list; // 10px, 15px, 32px + * ``` + * + * @param length - The number of (initially undefined) elements in the list. + * @param commaSeparator - If `true`, the list is comma-separated; otherwise, + * it's space-separated. Defaults to `true`. + */ + constructor(length: number, commaSeparator?: boolean); + + /** + * Returns the element at `index`, or `undefined` if that value hasn't yet + * been set. + * + * @example + * + * ```js + * // list is `10px, 15px, 32px` + * list.getValue(0); // 10px + * list.getValue(2); // 32px + * ``` + * + * @param index - A (0-based) index into this list. + * @throws `Error` if `index` is less than 0 or greater than or equal to the + * number of elements in this list. + */ + getValue(index: number): LegacyValue | undefined; + + /** + * Sets the element at `index` to `value`. + * + * @example + * + * ```js + * // list is `10px, 15px, 32px` + * list.setValue(1, new sass.types.Number(18, "px")); + * list; // 10px, 18px, 32px + * ``` + * + * @param index - A (0-based) index into this list. + * @throws `Error` if `index` is less than 0 or greater than or equal to the + * number of elements in this list. + */ + setValue(index: number, value: LegacyValue): void; + + /** + * Returns `true` if this list is comma-separated and `false` otherwise. + * + * @example + * + * ```js + * // list is `10px, 15px, 32px` + * list.getSeparator(); // true + * + * // list is `1px solid` + * list.getSeparator(); // false + * ``` + */ + getSeparator(): boolean; + + /** + * Sets whether the list is comma-separated. + * + * @param isComma - `true` to make the list comma-separated, `false` otherwise. + */ + setSeparator(isComma: boolean): void; + + /** + * Returns the number of elements in the list. + * + * @example + * + * ```js + * // list is `10px, 15px, 32px` + * list.getLength(); // 3 + * + * // list is `1px solid` + * list.getLength(); // 2 + * ``` + */ + getLength(): number; + } + + /** + * Sass's [map type](https://sass-lang.com/documentation/values/maps). + * + * **Heads up!** This map type is represented as a list of key-value pairs + * rather than a mapping from keys to values. The only way to find the value + * associated with a given key is to iterate through the map checking for that + * key. Maps created through this API are still forbidden from having duplicate + * keys. + */ + export class Map { + /** + * Creates a new Sass map. + * + * **Heads up!** The initial keys and values of the map are undefined. They + * must be set using {@link setKey} and {@link setValue} before accessing + * them or passing the map back to Sass. + * + * @example + * + * ```js + * const map = new sass.types.Map(2); + * map.setKey(0, new sass.types.String("width")); + * map.setValue(0, new sass.types.Number(300, "px")); + * map.setKey(1, new sass.types.String("height")); + * map.setValue(1, new sass.types.Number(100, "px")); + * map; // (width: 300px, height: 100px) + * ``` + * + * @param length - The number of (initially undefined) key/value pairs in the map. + */ + constructor(length: number); + + /** + * Returns the value in the key/value pair at `index`. + * + * @example + * + * ```js + * // map is `(width: 300px, height: 100px)` + * map.getValue(0); // 300px + * map.getValue(1); // 100px + * ``` + * + * @param index - A (0-based) index of a key/value pair in this map. + * @throws `Error` if `index` is less than 0 or greater than or equal to the + * number of pairs in this map. + */ + getValue(index: number): LegacyValue; + + /** + * Sets the value in the key/value pair at `index` to `value`. + * + * @example + * + * ```js + * // map is `("light": 200, "medium": 400, "bold": 600)` + * map.setValue(1, new sass.types.Number(300)); + * map; // ("light": 200, "medium": 300, "bold": 600) + * ``` + * + * @param index - A (0-based) index of a key/value pair in this map. + * @throws `Error` if `index` is less than 0 or greater than or equal to the + * number of pairs in this map. + */ + setValue(index: number, value: LegacyValue): void; + + /** + * Returns the key in the key/value pair at `index`. + * + * @example + * + * ```js + * // map is `(width: 300px, height: 100px)` + * map.getKey(0); // width + * map.getKey(1); // height + * ``` + * + * @param index - A (0-based) index of a key/value pair in this map. + * @throws `Error` if `index` is less than 0 or greater than or equal to the + * number of pairs in this map. + */ + getKey(index: number): LegacyValue; + + /** + * Sets the value in the key/value pair at `index` to `value`. + * + * @example + * + * ```js + * // map is `("light": 200, "medium": 400, "bold": 600)` + * map.setValue(1, new sass.types.String("lighter")); + * map; // ("lighter": 200, "medium": 300, "bold": 600) + * ``` + * + * @param index - A (0-based) index of a key/value pair in this map. + * @throws `Error` if `index` is less than 0 or greater than or equal to the + * number of pairs in this map. + */ + setKey(index: number, key: LegacyValue): void; + + /** + * Returns the number of key/value pairs in this map. + * + * @example + * + * ```js + * // map is `("light": 200, "medium": 400, "bold": 600)` + * map.getLength(); // 3 + * + * // map is `(width: 300px, height: 100px)` + * map.getLength(); // 2 + * ``` + */ + getLength(): number; + } + + /** + * An error that can be returned from a Sass function to signal that it + * encountered an error. This is the only way to signal an error + * asynchronously from a {@link LegacyAsyncFunction}. + */ + export class Error { + constructor(message: string); + } +} diff --git a/node_modules/sass/types/legacy/importer.d.ts b/node_modules/sass/types/legacy/importer.d.ts new file mode 100644 index 0000000..4b7777a --- /dev/null +++ b/node_modules/sass/types/legacy/importer.d.ts @@ -0,0 +1,169 @@ +import {LegacyPluginThis} from './plugin_this'; + +/** + * The value of `this` in the context of a {@link LegacyImporter} function. + * + * @category Legacy + * @deprecated This is only used by the legacy {@link render} and {@link + * renderSync} APIs. Use {@link Importer} with {@link compile}, {@link + * compileString}, {@link compileAsync}, and {@link compileStringAsync} instead. + */ +interface LegacyImporterThis extends LegacyPluginThis { + /** + * Whether the importer is being invoked because of a Sass `@import` rule, as + * opposed to a `@use` or `@forward` rule. + * + * This should *only* be used for determining whether or not to load + * [import-only files](https://sass-lang.com/documentation/at-rules/import#import-only-files). + * + * @compatibility dart: "1.33.0", node: false + */ + fromImport: boolean; +} + +/** + * The result of running a {@link LegacyImporter}. It must be one of the + * following types: + * + * * An object with the key `contents` whose value is the contents of a stylesheet + * (in SCSS syntax). This causes Sass to load that stylesheet’s contents. + * + * * An object with the key `file` whose value is a path on disk. This causes Sass + * to load that file as though it had been imported directly. + * + * * `null`, which indicates that it doesn’t recognize the URL and another + * importer should be tried instead. + * + * * An [Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) + * object, indicating that importing failed. + * + * @category Legacy + * @deprecated This only works with the legacy {@link render} and {@link + * renderSync} APIs. Use {@link ImporterResult} with {@link compile}, {@link + * compileString}, {@link compileAsync}, and {@link compileStringAsync} instead. + */ +export type LegacyImporterResult = + | {file: string} + | {contents: string} + | Error + | null; + +/** + * A synchronous callback that implements custom Sass loading logic for + * [`@import` rules](https://sass-lang.com/documentation/at-rules/import) and + * [`@use` rules](https://sass-lang.com/documentation/at-rules/use). This can be + * passed to {@link LegacySharedOptions.importer} for either {@link render} or + * {@link renderSync}. + * + * See {@link LegacySharedOptions.importer} for more detailed documentation. + * + * ```js + * sass.renderSync({ + * file: "style.scss", + * importer: [ + * function(url, prev) { + * if (url != "big-headers") return null; + * + * return { + * contents: 'h1 { font-size: 40px; }' + * }; + * } + * ] + * }); + * ``` + * + * @param url - The `@use` or `@import` rule’s URL as a string, exactly as it + * appears in the stylesheet. + * + * @param prev - A string identifying the stylesheet that contained the `@use` + * or `@import`. This string’s format depends on how that stylesheet was loaded: + * + * * If the stylesheet was loaded from the filesystem, it’s the absolute path of + * its file. + * * If the stylesheet was loaded from an importer that returned its contents, + * it’s the URL of the `@use` or `@import` rule that loaded it. + * * If the stylesheet came from the data option, it’s the string "stdin". + * + * @category Legacy + * @deprecated This only works with the legacy {@link render} and {@link + * renderSync} APIs. Use {@link Importer} with {@link compile}, {@link + * compileString}, {@link compileAsync}, and {@link compileStringAsync} instead. + */ +type LegacySyncImporter = ( + this: LegacyImporterThis, + url: string, + prev: string +) => LegacyImporterResult; + +/** + * An asynchronous callback that implements custom Sass loading logic for + * [`@import` rules](https://sass-lang.com/documentation/at-rules/import) and + * [`@use` rules](https://sass-lang.com/documentation/at-rules/use). This can be + * passed to {@link LegacySharedOptions.importer} for either {@link render} or + * {@link renderSync}. + * + * An asynchronous importer must return `undefined`, and then call `done` with + * the result of its {@link LegacyImporterResult} once it's done running. + * + * See {@link LegacySharedOptions.importer} for more detailed documentation. + * + * ```js + * sass.render({ + * file: "style.scss", + * importer: [ + * function(url, prev, done) { + * if (url != "big-headers") done(null); + * + * done({ + * contents: 'h1 { font-size: 40px; }' + * }); + * } + * ] + * }); + * ``` + * + * @param url - The `@use` or `@import` rule’s URL as a string, exactly as it + * appears in the stylesheet. + * + * @param prev - A string identifying the stylesheet that contained the `@use` + * or `@import`. This string’s format depends on how that stylesheet was loaded: + * + * * If the stylesheet was loaded from the filesystem, it’s the absolute path of + * its file. + * * If the stylesheet was loaded from an importer that returned its contents, + * it’s the URL of the `@use` or `@import` rule that loaded it. + * * If the stylesheet came from the data option, it’s the string "stdin". + * + * @param done - The callback to call once the importer has finished running. + * + * @category Legacy + * @deprecated This only works with the legacy {@link render} and {@link + * renderSync} APIs. Use {@link Importer} with {@link compile}, {@link + * compileString}, {@link compileAsync}, and {@link compileStringAsync} instead. + */ +type LegacyAsyncImporter = ( + this: LegacyImporterThis, + url: string, + prev: string, + done: (result: LegacyImporterResult) => void +) => void; + +/** + * A callback that implements custom Sass loading logic for [`@import` + * rules](https://sass-lang.com/documentation/at-rules/import) and [`@use` + * rules](https://sass-lang.com/documentation/at-rules/use). For {@link + * renderSync}, this must be a {@link LegacySyncImporter} which returns its + * result directly; for {@link render}, it may be either a {@link + * LegacySyncImporter} or a {@link LegacyAsyncImporter} which calls a callback + * with its result. + * + * See {@link LegacySharedOptions.importer} for more details. + * + * @category Legacy + * @deprecated This only works with the legacy {@link render} and {@link + * renderSync} APIs. Use {@link Importer} with {@link compile}, {@link + * compileString}, {@link compileAsync}, and {@link compileStringAsync} instead. + */ +export type LegacyImporter = sync extends 'async' + ? LegacySyncImporter | LegacyAsyncImporter + : LegacySyncImporter; diff --git a/node_modules/sass/types/legacy/options.d.ts b/node_modules/sass/types/legacy/options.d.ts new file mode 100644 index 0000000..788fc90 --- /dev/null +++ b/node_modules/sass/types/legacy/options.d.ts @@ -0,0 +1,660 @@ +import {Logger} from '../logger'; +import {LegacyImporter} from './importer'; +import {LegacyFunction} from './function'; +import {NodePackageImporter} from '../importer'; + +/** + * Options for {@link render} and {@link renderSync} that are shared between + * {@link LegacyFileOptions} and {@link LegacyStringOptions}. + * + * @typeParam sync - This lets the TypeScript checker verify that {@link + * LegacyAsyncImporter}s and {@link LegacyAsyncFunction}s aren't passed to + * {@link renderSync}. + * + * @category Legacy + * @deprecated This only works with the legacy {@link render} and {@link + * renderSync} APIs. Use {@link Options} with {@link compile}, {@link + * compileString}, {@link compileAsync}, and {@link compileStringAsync} instead. + */ +export interface LegacySharedOptions { + /** + * This array of strings option provides [load + * paths](https://sass-lang.com/documentation/at-rules/import#load-paths) for + * Sass to look for stylesheets. Earlier load paths will take precedence over + * later ones. + * + * ```js + * sass.renderSync({ + * file: "style.scss", + * includePaths: ["node_modules/bootstrap/dist/css"] + * }); + * ``` + * + * Load paths are also loaded from the `SASS_PATH` environment variable, if + * it’s set. This variable should be a list of paths separated by `;` (on + * Windows) or `:` (on other operating systems). Load paths from the + * `includePaths` option take precedence over load paths from `SASS_PATH`. + * + * ```sh + * $ SASS_PATH=node_modules/bootstrap/dist/css sass style.scss style.css + * ``` + * + * @category Input + * @compatibility feature: "SASS_PATH", dart: "1.15.0", node: "3.9.0" + * + * Earlier versions of Dart Sass and Node Sass didn’t support the `SASS_PATH` + * environment variable. + */ + includePaths?: string[]; + + /** + * Whether the generated CSS should use spaces or tabs for indentation. + * + * ```js + * const result = sass.renderSync({ + * file: "style.scss", + * indentType: "tab", + * indentWidth: 1 + * }); + * + * result.css.toString(); + * // "h1 {\n\tfont-size: 40px;\n}\n" + * ``` + * + * @defaultValue `'space'` + * @category Output + * @compatibility dart: true, node: "3.0.0" + */ + indentType?: 'space' | 'tab'; + + /** + * How many spaces or tabs (depending on {@link indentType}) should be used + * per indentation level in the generated CSS. It must be between 0 and 10 + * (inclusive). + * + * @defaultValue `2` + * @category Output + * @compatibility dart: true, node: "3.0.0" + */ + indentWidth?: number; + + /** + * Which character sequence to use at the end of each line in the generated + * CSS. It can have the following values: + * + * * `'lf'` uses U+000A LINE FEED. + * * `'lfcr'` uses U+000A LINE FEED followed by U+000D CARRIAGE RETURN. + * * `'cr'` uses U+000D CARRIAGE RETURN. + * * `'crlf'` uses U+000D CARRIAGE RETURN followed by U+000A LINE FEED. + * + * @defaultValue `'lf'` + * @category Output + * @compatibility dart: true, node: "3.0.0" + */ + linefeed?: 'cr' | 'crlf' | 'lf' | 'lfcr'; + + /** + * If `true`, Sass won't add a link from the generated CSS to the source map. + * + * ```js + * const result = sass.renderSync({ + * file: "style.scss", + * sourceMap: "out.map", + * omitSourceMapUrl: true + * }) + * console.log(result.css.toString()); + * // h1 { + * // font-size: 40px; + * // } + * ``` + * + * @defaultValue `false` + * @category Source Maps + */ + omitSourceMapUrl?: boolean; + + /** + * The location that Sass expects the generated CSS to be saved to. It’s used + * to determine the URL used to link from the generated CSS to the source map, + * and from the source map to the Sass source files. + * + * **Heads up!** Despite the name, Sass does *not* write the CSS output to + * this file. The caller must do that themselves. + * + * ```js + * result = sass.renderSync({ + * file: "style.scss", + * sourceMap: true, + * outFile: "out.css" + * }) + * console.log(result.css.toString()); + * // h1 { + * // font-size: 40px; + * // } + * // /*# sourceMappingURL=out.css.map * / + * ``` + * + * @category Source Maps + */ + outFile?: string; + + /** + * The output style of the compiled CSS. There are four possible output styles: + * + * * `"expanded"` (the default for Dart Sass) writes each selector and + * declaration on its own line. + * + * * `"compressed"` removes as many extra characters as possible, and writes + * the entire stylesheet on a single line. + * + * * `"nested"` (the default for Node Sass, not supported by Dart Sass) + * indents CSS rules to match the nesting of the Sass source. + * + * * `"compact"` (not supported by Dart Sass) puts each CSS rule on its own single line. + * + * @example + * + * ```js + * const source = ` + * h1 { + * font-size: 40px; + * code { + * font-face: Roboto Mono; + * } + * }`; + * + * let result = sass.renderSync({ + * data: source, + * outputStyle: "expanded" + * }); + * console.log(result.css.toString()); + * // h1 { + * // font-size: 40px; + * // } + * // h1 code { + * // font-face: Roboto Mono; + * // } + * + * result = sass.renderSync({ + * data: source, + * outputStyle: "compressed" + * }); + * console.log(result.css.toString()); + * // h1{font-size:40px}h1 code{font-face:Roboto Mono} + * + * result = sass.renderSync({ + * data: source, + * outputStyle: "nested" + * }); + * console.log(result.css.toString()); + * // h1 { + * // font-size: 40px; } + * // h1 code { + * // font-face: Roboto Mono; } + * + * result = sass.renderSync({ + * data: source, + * outputStyle: "compact" + * }); + * console.log(result.css.toString()); + * // h1 { font-size: 40px; } + * // h1 code { font-face: Roboto Mono; } + * ``` + * + * @category Output + */ + outputStyle?: 'compressed' | 'expanded' | 'nested' | 'compact'; + + /** + * Whether or not Sass should generate a source map. If it does, the source + * map will be available as {@link LegacyResult.map} (unless {@link + * sourceMapEmbed} is `true`). + * + * If this option is a string, it’s the path that the source map is expected + * to be written to, which is used to link to the source map from the + * generated CSS and to link *from* the source map to the Sass source files. + * Note that if `sourceMap` is a string and {@link outFile} isn’t passed, Sass + * assumes that the CSS will be written to the same directory as the file + * option if it’s passed. + * + * If this option is `true`, the path is assumed to be {@link outFile} with + * `.map` added to the end. If it’s `true` and {@link outFile} isn’t passed, + * it has no effect. + * + * @example + * + * ```js + * let result = sass.renderSync({ + * file: "style.scss", + * sourceMap: "out.map" + * }) + * console.log(result.css.toString()); + * // h1 { + * // font-size: 40px; + * // } + * // /*# sourceMappingURL=out.map * / + * + * result = sass.renderSync({ + * file: "style.scss", + * sourceMap: true, + * outFile: "out.css" + * }) + * console.log(result.css.toString()); + * // h1 { + * // font-size: 40px; + * // } + * // /*# sourceMappingURL=out.css.map * / + * ``` + * + * @defaultValue `false` + * @category Source Maps + */ + sourceMap?: boolean | string; + + /** + * Whether to embed the entire contents of the Sass files that contributed to + * the generated CSS in the source map. This may produce very large source + * maps, but it guarantees that the source will be available on any computer + * no matter how the CSS is served. + * + * @example + * + * ```js + * sass.renderSync({ + * file: "style.scss", + * sourceMap: "out.map", + * sourceMapContents: true + * }) + * ``` + * + * @defaultValue `false` + * @category Source Maps + */ + sourceMapContents?: boolean; + + /** + * Whether to embed the contents of the source map file in the generated CSS, + * rather than creating a separate file and linking to it from the CSS. + * + * @example + * + * ```js + * sass.renderSync({ + * file: "style.scss", + * sourceMap: "out.map", + * sourceMapEmbed: true + * }); + * ``` + * + * @defaultValue `false` + * @category Source Maps + */ + sourceMapEmbed?: boolean; + + /** + * If this is passed, it's prepended to all the links from the source map to + * the Sass source files. + * + * @category Source Maps + */ + sourceMapRoot?: string; + + /** + * Additional handler(s) for loading files when a [`@use` + * rule](https://sass-lang.com/documentation/at-rules/use) or an [`@import` + * rule](https://sass-lang.com/documentation/at-rules/import) is encountered. + * It can either be a single {@link LegacyImporter} function, or an array of + * {@link LegacyImporter}s. + * + * Importers take the URL of the `@import` or `@use` rule and return a {@link + * LegacyImporterResult} indicating how to handle that rule. For more details, + * see {@link LegacySyncImporter} and {@link LegacyAsyncImporter}. + * + * Loads are resolved by trying, in order: + * + * * Loading a file from disk relative to the file in which the `@use` or + * `@import` appeared. + * + * * Each custom importer. + * + * * Loading a file relative to the current working directory. + * + * * Each load path in {@link includePaths}. + * + * * Each load path specified in the `SASS_PATH` environment variable, which + * should be semicolon-separated on Windows and colon-separated elsewhere. + * + * @example + * + * ```js + * sass.render({ + * file: "style.scss", + * importer: [ + * // This importer uses the synchronous API, and can be passed to either + * // renderSync() or render(). + * function(url, prev) { + * // This generates a stylesheet from scratch for `@use "big-headers"`. + * if (url != "big-headers") return null; + * + * return { + * contents: ` + * h1 { + * font-size: 40px; + * }` + * }; + * }, + * + * // This importer uses the asynchronous API, and can only be passed to + * // render(). + * function(url, prev, done) { + * // Convert `@use "foo/bar"` to "node_modules/foo/sass/bar". + * const components = url.split('/'); + * const innerPath = components.slice(1).join('/'); + * done({ + * file: `node_modules/${components.first}/sass/${innerPath}` + * }); + * } + * ] + * }, function(err, result) { + * // ... + * }); + * ``` + * + * @category Plugins + * @compatibility dart: true, node: "3.0.0" + * + * Versions of Node Sass before 3.0.0 don’t support arrays of importers, nor + * do they support importers that return `Error` objects. + * + * Versions of Node Sass before 2.0.0 don’t support the `importer` option at + * all. + * + * @compatibility feature: "Import order", dart: "1.20.2", node: false + * + * Versions of Dart Sass before 1.20.2 preferred resolving imports using + * {@link includePaths} before resolving them using custom importers. + * + * All versions of Node Sass currently pass imports to importers before + * loading them relative to the file in which the `@import` appears. This + * behavior is considered incorrect and should not be relied on because it + * violates the principle of *locality*, which says that it should be possible + * to reason about a stylesheet without knowing everything about how the + * entire system is set up. If a user tries to import a stylesheet relative to + * another stylesheet, that import should *always* work. It shouldn’t be + * possible for some configuration somewhere else to break it. + */ + importer?: LegacyImporter | LegacyImporter[]; + + /** + * Additional built-in Sass functions that are available in all stylesheets. + * This option takes an object whose keys are Sass function signatures and + * whose values are {@link LegacyFunction}s. Each function should take the + * same arguments as its signature. + * + * Functions are passed subclasses of {@link LegacyValue}, and must return the + * same. + * + * **Heads up!** When writing custom functions, it’s important to ensure that + * all the arguments are the types you expect. Otherwise, users’ stylesheets + * could crash in hard-to-debug ways or, worse, compile to meaningless CSS. + * + * @example + * + * ```js + * sass.render({ + * data: ` + * h1 { + * font-size: pow(2, 5) * 1px; + * }`, + * functions: { + * // This function uses the synchronous API, and can be passed to either + * // renderSync() or render(). + * 'pow($base, $exponent)': function(base, exponent) { + * if (!(base instanceof sass.types.Number)) { + * throw "$base: Expected a number."; + * } else if (base.getUnit()) { + * throw "$base: Expected a unitless number."; + * } + * + * if (!(exponent instanceof sass.types.Number)) { + * throw "$exponent: Expected a number."; + * } else if (exponent.getUnit()) { + * throw "$exponent: Expected a unitless number."; + * } + * + * return new sass.types.Number( + * Math.pow(base.getValue(), exponent.getValue())); + * }, + * + * // This function uses the asynchronous API, and can only be passed to + * // render(). + * 'sqrt($number)': function(number, done) { + * if (!(number instanceof sass.types.Number)) { + * throw "$number: Expected a number."; + * } else if (number.getUnit()) { + * throw "$number: Expected a unitless number."; + * } + * + * done(new sass.types.Number(Math.sqrt(number.getValue()))); + * } + * } + * }, function(err, result) { + * console.log(result.css.toString()); + * // h1 { + * // font-size: 32px; + * // } + * }); + * ``` + * + * @category Plugins + */ + functions?: {[key: string]: LegacyFunction}; + + /** + * By default, if the CSS document contains non-ASCII characters, Sass adds a + * `@charset` declaration (in expanded output mode) or a byte-order mark (in + * compressed mode) to indicate its encoding to browsers or other consumers. + * If `charset` is `false`, these annotations are omitted. + * + * @category Output + * @compatibility dart: "1.39.0", node: false + */ + charset?: boolean; + + /** + * If this option is set to `true`, Sass won’t print warnings that are caused + * by dependencies. A “dependency” is defined as any file that’s loaded + * through {@link includePaths} or {@link importer}. Stylesheets that are + * imported relative to the entrypoint are not considered dependencies. + * + * This is useful for silencing deprecation warnings that you can’t fix on + * your own. However, please also notify your dependencies of the deprecations + * so that they can get fixed as soon as possible! + * + * **Heads up!** If {@link render} or {@link renderSync} is called without + * {@link LegacyFileOptions.file} or {@link LegacyStringOptions.file}, + * all stylesheets it loads will be considered dependencies. Since it + * doesn’t have a path of its own, everything it loads is coming from a load + * path rather than a relative import. + * + * @defaultValue `false` + * @category Messages + * @compatibility dart: "1.35.0", node: false + */ + quietDeps?: boolean; + + /** + * By default, Dart Sass will print only five instances of the same + * deprecation warning per compilation to avoid deluging users in console + * noise. If you set `verbose` to `true`, it will instead print every + * deprecation warning it encounters. + * + * @defaultValue `false` + * @category Messages + * @compatibility dart: "1.35.0", node: false + */ + verbose?: boolean; + + /** + * An object to use to handle warnings and/or debug messages from Sass. + * + * By default, Sass emits warnings and debug messages to standard error, but + * if {@link Logger.warn} or {@link Logger.debug} is set, this will invoke + * them instead. + * + * The special value {@link Logger.silent} can be used to easily silence all + * messages. + * + * @category Messages + * @compatibility dart: "1.43.0", node: false + */ + logger?: Logger; + + /** + * If this option is set to an instance of `NodePackageImporter`, Sass will + * use the built-in Node.js package importer to resolve Sass files with a + * `pkg:` URL scheme. Details for library authors and users can be found in + * the {@link NodePackageImporter} documentation. + * + * @example + * ```js + * sass.renderSync({ + * data: '@use "pkg:vuetify";', + * pkgImporter: new sass.NodePackageImporter() + * }); + * ``` + * @category Plugins + * @compatibility dart: "2.0", node: false + */ + pkgImporter?: NodePackageImporter; +} + +/** + * If {@link file} is passed without {@link data}, Sass will load the stylesheet + * at {@link file} and compile it to CSS. + * + * @typeParam sync - This lets the TypeScript checker verify that {@link + * LegacyAsyncImporter}s and {@link LegacyAsyncFunction}s aren't passed to + * {@link renderSync}. + */ +export interface LegacyFileOptions + extends LegacySharedOptions { + /** + * The path to the file for Sass to load and compile. If the file’s extension + * is `.scss`, it will be parsed as SCSS; if it’s `.sass`, it will be parsed + * as the indented syntax; and if it’s `.css`, it will be parsed as plain CSS. + * If it has no extension, it will be parsed as SCSS. + * + * @example + * + * ```js + * sass.renderSync({file: "style.scss"}); + * ``` + * + * @category Input + * @compatibility feature: "Plain CSS files", dart: "1.11.0", node: "partial" + * + * Node Sass and older versions of Dart Sass support loading files with the + * extension `.css`, but contrary to the specification they’re treated as SCSS + * files rather than being parsed as CSS. This behavior has been deprecated + * and should not be relied on. Any files that use Sass features should use + * the `.scss` extension. + * + * All versions of Node Sass and Dart Sass otherwise support the file option + * as described below. + */ + file: string; + + /** + * See {@link LegacyStringOptions.file} for documentation of passing {@link + * file} along with {@link data}. + * + * @category Input + */ + data?: never; +} + +/** + * If {@link data} is passed, Sass will use it as the contents of the stylesheet + * to compile. + * + * @typeParam sync - This lets the TypeScript checker verify that {@link + * LegacyAsyncImporter}s and {@link LegacyAsyncFunction}s aren't passed to + * {@link renderSync}. + * + * @category Legacy + * @deprecated This only works with the legacy {@link render} and {@link + * renderSync} APIs. Use {@link StringOptions} with {@link compile}, {@link + * compileString}, {@link compileAsync}, and {@link compileStringAsync} instead. + */ +export interface LegacyStringOptions + extends LegacySharedOptions { + /** + * The contents of the stylesheet to compile. Unless {@link file} is passed as + * well, the stylesheet’s URL is set to `"stdin"`. + * + * By default, this stylesheet is parsed as SCSS. This can be controlled using + * {@link indentedSyntax}. + * + * @example + * + * ```js + * sass.renderSync({ + * data: ` + * h1 { + * font-size: 40px; + * }` + * }); + * ``` + * + * @category Input + */ + data: string; + + /** + * If `file` and {@link data} are both passed, `file` is used as the path of + * the stylesheet for error reporting, but {@link data} is used as the + * contents of the stylesheet. In this case, `file`’s extension is not used to + * determine the syntax of the stylesheet. + * + * @category Input + */ + file?: string; + + /** + * This flag controls whether {@link data} is parsed as the indented syntax or + * not. + * + * @example + * + * ```js + * sass.renderSync({ + * data: ` + * h1 + * font-size: 40px`, + * indentedSyntax: true + * }); + * ``` + * + * @defaultValue `false` + * @category Input + */ + indentedSyntax?: boolean; +} + +/** + * Options for {@link render} and {@link renderSync}. This can either be {@link + * LegacyFileOptions} to load a file from disk, or {@link LegacyStringOptions} + * to compile a string of Sass code. + * + * See {@link LegacySharedOptions} for options that are shared across both file + * and string inputs. + * + * @category Legacy + * @deprecated This only works with the legacy {@link render} and {@link + * renderSync} APIs. Use {@link Options} with {@link compile}, {@link + * compileString}, {@link compileAsync}, and {@link compileStringAsync} instead. + */ +export type LegacyOptions = + | LegacyFileOptions + | LegacyStringOptions; diff --git a/node_modules/sass/types/legacy/plugin_this.d.ts b/node_modules/sass/types/legacy/plugin_this.d.ts new file mode 100644 index 0000000..8ccffa7 --- /dev/null +++ b/node_modules/sass/types/legacy/plugin_this.d.ts @@ -0,0 +1,74 @@ +/** + * The value of `this` in the context of a {@link LegacyImporter} or {@link + * LegacyFunction} callback. + * + * @category Legacy + * @deprecated This is only used by the legacy {@link render} and {@link + * renderSync} APIs. Use {@link compile}, {@link compileString}, {@link + * compileAsync}, and {@link compileStringAsync} instead. + */ +export interface LegacyPluginThis { + /** + * A partial representation of the options passed to {@link render} or {@link + * renderSync}. + */ + options: { + /** The same {@link LegacyPluginThis} instance that contains this object. */ + context: LegacyPluginThis; + + /** + * The value passed to {@link LegacyFileOptions.file} or {@link + * LegacyStringOptions.file}. + */ + file?: string; + + /** The value passed to {@link LegacyStringOptions.data}. */ + data?: string; + + /** + * The value passed to {@link LegacySharedOptions.includePaths} separated by + * `";"` on Windows or `":"` on other operating systems. This always + * includes the current working directory as the first entry. + */ + includePaths: string; + + /** Always the number 10. */ + precision: 10; + + /** Always the number 1. */ + style: 1; + + /** 1 if {@link LegacySharedOptions.indentType} was `"tab"`, 0 otherwise. */ + indentType: 1 | 0; + + /** + * The value passed to {@link LegacySharedOptions.indentWidth}, or `2` + * otherwise. + */ + indentWidth: number; + + /** + * The value passed to {@link LegacySharedOptions.linefeed}, or `"\n"` + * otherwise. + */ + linefeed: '\r' | '\r\n' | '\n' | '\n\r'; + + /** A partially-constructed {@link LegacyResult} object. */ + result: { + /** Partial information about the compilation in progress. */ + stats: { + /** + * The number of milliseconds between 1 January 1970 at 00:00:00 UTC and + * the time at which Sass compilation began. + */ + start: number; + + /** + * {@link LegacyFileOptions.file} if it was passed, otherwise the string + * `"data"`. + */ + entry: string; + }; + }; + }; +} diff --git a/node_modules/sass/types/legacy/render.d.ts b/node_modules/sass/types/legacy/render.d.ts new file mode 100644 index 0000000..9f78816 --- /dev/null +++ b/node_modules/sass/types/legacy/render.d.ts @@ -0,0 +1,144 @@ +import {LegacyException} from './exception'; +import {LegacyOptions} from './options'; + +/** + * The object returned by {@link render} and {@link renderSync} after a + * successful compilation. + * + * @category Legacy + * @deprecated This is only used by the legacy {@link render} and {@link + * renderSync} APIs. Use {@link compile}, {@link compileString}, {@link + * compileAsync}, and {@link compileStringAsync} instead. + */ +export interface LegacyResult { + /** + * The compiled CSS. This can be converted to a string by calling + * [Buffer.toString](https://nodejs.org/api/buffer.html#buffer_buf_tostring_encoding_start_end). + * + * @example + * + * ```js + * const result = sass.renderSync({file: "style.scss"}); + * + * console.log(result.css.toString()); + * ``` + */ + css: Buffer; + + /** + * The source map that maps the compiled CSS to the source files from which it + * was generated. This can be converted to a string by calling + * [Buffer.toString](https://nodejs.org/api/buffer.html#buffer_buf_tostring_encoding_start_end). + * + * This is `undefined` unless either + * + * * {@link LegacySharedOptions.sourceMap} is a string; or + * * {@link LegacySharedOptions.sourceMap} is `true` and + * {@link LegacySharedOptions.outFile} is set. + * + * The source map uses absolute [`file:` + * URLs](https://en.wikipedia.org/wiki/File_URI_scheme) to link to the Sass + * source files, except if the source file comes from {@link + * LegacyStringOptions.data} in which case it lists its URL as `"stdin"`. + * + * @example + * + * ```js + * const result = sass.renderSync({ + * file: "style.scss", + * sourceMap: true, + * outFile: "style.css" + * }) + * + * console.log(result.map.toString()); + * ``` + */ + map?: Buffer; + + /** Additional information about the compilation. */ + stats: { + /** + * The absolute path of {@link LegacyFileOptions.file} or {@link + * LegacyStringOptions.file}, or `"data"` if {@link + * LegacyStringOptions.file} wasn't set. + */ + entry: string; + + /** + * The number of milliseconds between 1 January 1970 at 00:00:00 UTC and the + * time at which Sass compilation began. + */ + start: number; + + /** + * The number of milliseconds between 1 January 1970 at 00:00:00 UTC and the + * time at which Sass compilation ended. + */ + end: number; + + /** + * The number of milliseconds it took to compile the Sass file. This is + * always equal to `start` minus `end`. + */ + duration: number; + + /** + * An array of the absolute paths of all Sass files loaded during + * compilation. If a stylesheet was loaded from a {@link LegacyImporter} + * that returned the stylesheet’s contents, the raw string of the `@use` or + * `@import` that loaded that stylesheet included in this array. + */ + includedFiles: string[]; + }; +} + +/** + * This function synchronously compiles a Sass file to CSS. If it succeeds, it + * returns the result, and if it fails it throws an error. + * + * **Heads up!** When using the `sass-embedded` npm package, **{@link render} + * is almost always faster than {@link renderSync}**, due to the overhead of + * emulating synchronous messaging with worker threads and concurrent + * compilations being blocked on main thread. + * + * @example + * + * ```js + * const sass = require('sass'); // or require('node-sass'); + * + * const result = sass.renderSync({file: "style.scss"}); + * // ... + * ``` + * + * @category Legacy + * @deprecated Use {@link compile} or {@link compileString} instead. + */ +export function renderSync(options: LegacyOptions<'sync'>): LegacyResult; + +/** + + * This function asynchronously compiles a Sass file to CSS, and calls + * `callback` with a {@link LegacyResult} if compilation succeeds or {@link + * LegacyException} if it fails. + * + * **Heads up!** When using the `sass` npm package, **{@link renderSync} is + * almost twice as fast as {@link render}** by default, due to the overhead of + * making the entire evaluation process asynchronous. + * + * ```js + * const sass = require('sass'); // or require('node-sass'); + * + * sass.render({ + * file: "style.scss" + * }, function(err, result) { + * // ... + * }); + * ``` + * + * @category Legacy + * @deprecated Use {@link compileAsync} or {@link compileStringAsync} instead. + */ +export function render( + options: LegacyOptions<'async'>, + callback: (exception?: LegacyException, result?: LegacyResult) => void +): void; diff --git a/node_modules/sass/types/logger/index.d.ts b/node_modules/sass/types/logger/index.d.ts new file mode 100644 index 0000000..99196d2 --- /dev/null +++ b/node_modules/sass/types/logger/index.d.ts @@ -0,0 +1,94 @@ +import {SourceSpan} from './source_span'; + +export {SourceLocation} from './source_location'; +export {SourceSpan} from './source_span'; + +/** + * An object that can be passed to {@link LegacySharedOptions.logger} to control + * how Sass emits warnings and debug messages. + * + * @example + * + * ```js + * const fs = require('fs'); + * const sass = require('sass'); + * + * let log = ""; + * sass.renderSync({ + * file: 'input.scss', + * logger: { + * warn(message, options) { + * if (options.span) { + * log += `${span.url}:${span.start.line}:${span.start.column}: ` + + * `${message}\n`; + * } else { + * log += `::: ${message}\n`; + * } + * } + * } + * }); + * + * fs.writeFileSync('log.txt', log); + * ``` + * + * @category Logger + */ +export interface Logger { + /** + * This method is called when Sass emits a warning, whether due to a [`@warn` + * rule](https://sass-lang.com/documentation/at-rules/warn) or a warning + * generated by the Sass compiler. + * + * If this is `undefined`, Sass will print warnings to standard error. + * + * @param message - The warning message. + * @param options.deprecation - Whether this is a deprecation warning. + * @param options.span - The location in the Sass source code that generated this + * warning. + * @param options.stack - The Sass stack trace at the point the warning was issued. + */ + warn?( + message: string, + options: { + deprecation: boolean; + span?: SourceSpan; + stack?: string; + } + ): void; + + /** + * This method is called when Sass emits a debug message due to a [`@debug` + * rule](https://sass-lang.com/documentation/at-rules/debug). + * + * If this is `undefined`, Sass will print debug messages to standard error. + * + * @param message - The debug message. + * @param options.span - The location in the Sass source code that generated this + * debug message. + */ + debug?(message: string, options: {span: SourceSpan}): void; +} + +/** + * A namespace for built-in {@link Logger}s. + * + * @category Logger + * @compatibility dart: "1.43.0", node: false + */ +export namespace Logger { + /** + * A {@link Logger} that silently ignores all warnings and debug messages. + * + * @example + * + * ```js + * const sass = require('sass'); + * + * const result = sass.renderSync({ + * file: 'input.scss', + * logger: sass.Logger.silent, + * }); + * ``` + */ + export const silent: Logger; +} diff --git a/node_modules/sass/types/logger/source_location.d.ts b/node_modules/sass/types/logger/source_location.d.ts new file mode 100644 index 0000000..7192714 --- /dev/null +++ b/node_modules/sass/types/logger/source_location.d.ts @@ -0,0 +1,21 @@ +/** + * A specific location within a source file. + * + * This is always associated with a {@link SourceSpan} which indicates *which* + * file it refers to. + * + * @category Logger + */ +export interface SourceLocation { + /** + * The 0-based index of this location within its source file, in terms of + * UTF-16 code units. + */ + offset: number; + + /** The 0-based line number of this location. */ + line: number; + + /** The 0-based column number of this location. */ + column: number; +} diff --git a/node_modules/sass/types/logger/source_span.d.ts b/node_modules/sass/types/logger/source_span.d.ts new file mode 100644 index 0000000..88eb47f --- /dev/null +++ b/node_modules/sass/types/logger/source_span.d.ts @@ -0,0 +1,34 @@ +import {SourceLocation} from './source_location'; + +/** + * A span of text within a source file. + * + * @category Logger + */ +export interface SourceSpan { + /** The beginning of this span, inclusive. */ + start: SourceLocation; + + /** + * The end of this span, exclusive. + * + * If {@link start} and {@link end} refer to the same location, the span has + * zero length and refers to the point immediately after {@link start} and + * before the next character. + */ + end: SourceLocation; + + /** The canonical URL of the file this span refers to. */ + url?: URL; + + /** The text covered by the span. */ + text: string; + + /** + * Text surrounding the span. + * + * If this is set, it must include only whole lines, and it must include at + * least all line(s) which are partially covered by this span. + */ + context?: string; +} diff --git a/node_modules/sass/types/options.d.ts b/node_modules/sass/types/options.d.ts new file mode 100644 index 0000000..a4910cb --- /dev/null +++ b/node_modules/sass/types/options.d.ts @@ -0,0 +1,439 @@ +import {FileImporter, Importer, NodePackageImporter} from './importer'; +import {Logger} from './logger'; +import {Value} from './value'; +import {PromiseOr} from './util/promise_or'; + +/** + * Syntaxes supported by Sass: + * + * - `'scss'` is the [SCSS + * syntax](https://sass-lang.com/documentation/syntax#scss). + * - `'indented'` is the [indented + * syntax](https://sass-lang.com/documentation/syntax#the-indented-syntax) + * - `'css'` is plain CSS, which is parsed like SCSS but forbids the use of any + * special Sass features. + * + * @category Options + */ +export type Syntax = 'scss' | 'indented' | 'css'; + +/** + * Possible output styles for the compiled CSS: + * + * - `"expanded"` (the default for Dart Sass) writes each selector and + * declaration on its own line. + * + * - `"compressed"` removes as many extra characters as possible, and writes + * the entire stylesheet on a single line. + * + * @category Options + */ +export type OutputStyle = 'expanded' | 'compressed'; + +/** + * A callback that implements a custom Sass function. This can be passed to + * {@link Options.functions}. + * + * ```js + * const result = sass.compile('style.scss', { + * functions: { + * "sum($arg1, $arg2)": (args) => { + * const arg1 = args[0].assertNumber('arg1'); + * const value1 = arg1.value; + * const value2 = args[1].assertNumber('arg2') + * .convertValueToMatch(arg1, 'arg2', 'arg1'); + * return new sass.SassNumber(value1 + value2).coerceToMatch(arg1); + * } + * } + * }); + * ``` + * + * @typeParam sync - A `CustomFunction<'sync'>` must return synchronously, but + * in return it can be passed to {@link compile} and {@link compileString} in + * addition to {@link compileAsync} and {@link compileStringAsync}. + * + * A `CustomFunction<'async'>` may either return synchronously or + * asynchronously, but it can only be used with {@link compileAsync} and {@link + * compileStringAsync}. + * + * @param args - An array of arguments passed by the function's caller. If the + * function takes [arbitrary + * arguments](https://sass-lang.com/documentation/at-rules/function#taking-arbitrary-arguments), + * the last element will be a {@link SassArgumentList}. + * + * @returns The function's result. This may be in the form of a `Promise`, but + * if it is the function may only be passed to {@link compileAsync} and {@link + * compileStringAsync}, not {@link compile} or {@link compileString}. + * + * @throws any - This function may throw an error, which the Sass compiler will + * treat as the function call failing. If the exception object has a `message` + * property, it will be used as the wrapped exception's message; otherwise, the + * exception object's `toString()` will be used. This means it's safe for custom + * functions to throw plain strings. + * + * @category Custom Function + */ +export type CustomFunction = ( + args: Value[] +) => PromiseOr; + +/** + * Options that can be passed to {@link compile}, {@link compileAsync}, {@link + * compileString}, or {@link compileStringAsync}. + * + * @typeParam sync - This lets the TypeScript checker verify that asynchronous + * {@link Importer}s, {@link FileImporter}s, and {@link CustomFunction}s aren't + * passed to {@link compile} or {@link compileString}. + * + * @category Options + */ +export interface Options { + /** + * If this is `true`, the compiler will exclusively use ASCII characters in + * its error and warning messages. Otherwise, it may use non-ASCII Unicode + * characters as well. + * + * @defaultValue `false` + * @category Messages + */ + alertAscii?: boolean; + + /** + * If this is `true`, the compiler will use ANSI color escape codes in its + * error and warning messages. If it's `false`, it won't use these. If it's + * undefined, the compiler will determine whether or not to use colors + * depending on whether the user is using an interactive terminal. + * + * @category Messages + */ + alertColor?: boolean; + + /** + * If `true`, the compiler may prepend `@charset "UTF-8";` or U+FEFF + * (byte-order marker) if it outputs non-ASCII CSS. + * + * If `false`, the compiler never emits these byte sequences. This is ideal + * when concatenating or embedding in HTML ` \ No newline at end of file + diff --git a/pages/realName/realName.vue b/pages/realName/realName.vue index 5ef3329..9453481 100644 --- a/pages/realName/realName.vue +++ b/pages/realName/realName.vue @@ -1,467 +1,745 @@ diff --git a/static/image/passport.png b/static/image/passport.png new file mode 100644 index 0000000..64650d8 Binary files /dev/null and b/static/image/passport.png differ diff --git a/static/image/passport2.png b/static/image/passport2.png new file mode 100644 index 0000000..e81b093 Binary files /dev/null and b/static/image/passport2.png differ diff --git a/unpackage/dist/dev/.sourcemap/mp-weixin/common/main.js.map b/unpackage/dist/dev/.sourcemap/mp-weixin/common/main.js.map new file mode 100644 index 0000000..a418d69 --- /dev/null +++ b/unpackage/dist/dev/.sourcemap/mp-weixin/common/main.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["uni-app:///main.js","webpack:///C:/Users/lenovo/Desktop/uni-Identify-quality/App.vue?30ec","webpack:///C:/Users/lenovo/Desktop/uni-Identify-quality/App.vue?f0bc","uni-app:///App.vue","webpack:///C:/Users/lenovo/Desktop/uni-Identify-quality/App.vue?a02a"],"names":["wx","__webpack_require_UNI_MP_PLUGIN__","__webpack_require__","Vue","config","productionTip","App","mpType","use","uView","tmVuetify","prototype","$api","api","$common","common","app","$mount","render","staticRenderFns","components","renderjs","component","options","__file","onLaunch","uni","onShow","console","onHide"],"mappings":"+IAAA,MAE2D,eAG3D,WACA,WACA,WACA,MAGA,eAEA,YAAqC,2kBAXrCA,EAAGC,kCAAoCC,EAOvCC,UAAIC,OAAOC,eAAgB,EAC3BC,UAAIC,OAAS,MAEbJ,UAAIK,IAAIC,WAERN,UAAIK,IAAIE,WACRP,UAAIQ,UAAUC,KAAOC,UACrBV,UAAIQ,UAAUG,QAAUC,UACxB,IAAMC,EAAM,IAAIb,UAAI,EAAD,GACdG,YAEL,EAAAU,GAAIC,W,8ECpBJ,yHAAIC,EAAQC,EAAmCC,EAC3CC,EADJ,QASIC,EAAY,qBACd,aACAJ,EACAC,GACA,EACA,KACA,KACA,MACA,EACAC,EACAC,GAGFC,EAAUC,QAAQC,OAAS,UACZ,aAAAF,E,yCCvBf,wHAAooB,eAAG,G,0HCCvoB,iBAEA,CACAG,qBAQAC,eACAA,sCAEAC,kBACAC,yBAEAC,kBACAD,0BAEA,c,4DCrBA,wHAA+rC,eAAG,G","file":"common/main.js","sourcesContent":["import 'uni-pages';\r\n// @ts-ignore\r\nwx.__webpack_require_UNI_MP_PLUGIN__ = __webpack_require__;import App from \"./App\";\r\n\r\n\r\nimport Vue from \"vue\";\r\nimport api from \"@/http/\";\r\nimport common from \"./common/index.js\";\r\nimport \"./uni.promisify.adaptor\";\r\nVue.config.productionTip = false;\r\nApp.mpType = \"app\";\r\nimport uView from \"./uview-ui\";\r\nVue.use(uView);\r\nimport tmVuetify from \"./tm-vuetify\";\r\nVue.use(tmVuetify)\r\nVue.prototype.$api = api;\r\nVue.prototype.$common = common;\r\nconst app = new Vue({\r\n ...App,\r\n});\r\napp.$mount();","var render, staticRenderFns, recyclableRender, components\nvar renderjs\nimport script from \"./App.vue?vue&type=script&lang=js&\"\nexport * from \"./App.vue?vue&type=script&lang=js&\"\nimport style0 from \"./App.vue?vue&type=style&index=0&lang=scss&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../Downloads/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null,\n false,\n components,\n renderjs\n)\n\ncomponent.options.__file = \"App.vue\"\nexport default component.exports","import mod from \"-!../../Downloads/HBuilderX/plugins/uniapp-cli/node_modules/babel-loader/lib/index.js!../../Downloads/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--13-1!../../Downloads/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!../../Downloads/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../Downloads/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./App.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../Downloads/HBuilderX/plugins/uniapp-cli/node_modules/babel-loader/lib/index.js!../../Downloads/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--13-1!../../Downloads/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!../../Downloads/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../Downloads/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./App.vue?vue&type=script&lang=js&\"","\r\n\r\n\r\n","import mod from \"-!../../Downloads/HBuilderX/plugins/uniapp-cli/node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../Downloads/HBuilderX/plugins/uniapp-cli/node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!../../Downloads/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/stylePostLoader.js!../../Downloads/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--8-oneOf-1-2!../../Downloads/HBuilderX/plugins/uniapp-cli/node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-3!../../Downloads/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/sass-loader/dist/cjs.js??ref--8-oneOf-1-4!../../Downloads/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--8-oneOf-1-5!../../Downloads/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../Downloads/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./App.vue?vue&type=style&index=0&lang=scss&\"; export default mod; export * from \"-!../../Downloads/HBuilderX/plugins/uniapp-cli/node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../Downloads/HBuilderX/plugins/uniapp-cli/node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!../../Downloads/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/stylePostLoader.js!../../Downloads/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--8-oneOf-1-2!../../Downloads/HBuilderX/plugins/uniapp-cli/node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-3!../../Downloads/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/sass-loader/dist/cjs.js??ref--8-oneOf-1-4!../../Downloads/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--8-oneOf-1-5!../../Downloads/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../Downloads/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./App.vue?vue&type=style&index=0&lang=scss&\""],"sourceRoot":""} \ No newline at end of file diff --git a/unpackage/dist/dev/.sourcemap/mp-weixin/common/vendor.js.map b/unpackage/dist/dev/.sourcemap/mp-weixin/common/vendor.js.map new file mode 100644 index 0000000..d471780 --- /dev/null +++ b/unpackage/dist/dev/.sourcemap/mp-weixin/common/vendor.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack:///./node_modules/@dcloudio/uni-mp-weixin/dist/wx.js?3223","webpack:///./node_modules/@dcloudio/uni-mp-weixin/dist/index.js?df3c","webpack:///(webpack)/buildin/global.js?3698","webpack:///./node_modules/@babel/runtime/helpers/interopRequireDefault.js?47a9","webpack:///./node_modules/@babel/runtime/helpers/slicedToArray.js?34cf","webpack:///./node_modules/@babel/runtime/helpers/arrayWithHoles.js?ed45","webpack:///./node_modules/@babel/runtime/helpers/iterableToArrayLimit.js?7172","webpack:///./node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js?6382","webpack:///./node_modules/@babel/runtime/helpers/arrayLikeToArray.js?6454","webpack:///./node_modules/@babel/runtime/helpers/nonIterableRest.js?dd3e","webpack:///./node_modules/@babel/runtime/helpers/defineProperty.js?7ca3","webpack:///./node_modules/@babel/runtime/helpers/toPropertyKey.js?d551","webpack:///./node_modules/@babel/runtime/helpers/typeof.js?3b2d","webpack:///./node_modules/@babel/runtime/helpers/toPrimitive.js?e6db","webpack:///./node_modules/@babel/runtime/helpers/construct.js?931d","webpack:///./node_modules/@babel/runtime/helpers/setPrototypeOf.js?7647","webpack:///./node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js?011a","webpack:///./node_modules/@babel/runtime/helpers/toConsumableArray.js?af34","webpack:///./node_modules/@babel/runtime/helpers/arrayWithoutHoles.js?a708","webpack:///./node_modules/@babel/runtime/helpers/iterableToArray.js?b893","webpack:///./node_modules/@babel/runtime/helpers/nonIterableSpread.js?9008","webpack:///./node_modules/@dcloudio/uni-i18n/dist/uni-i18n.es.js?d3b4","webpack:///./node_modules/@babel/runtime/helpers/classCallCheck.js?67ad","webpack:///./node_modules/@babel/runtime/helpers/createClass.js?0bdb","webpack:///./node_modules/@dcloudio/vue-cli-plugin-uni/packages/mp-vue/dist/mp.runtime.esm.js?3240","uni-app:///util/tabbar.js","webpack:///./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js?828b","uni-app:///http/index.js","uni-app:///http/login.js","uni-app:///http/interface.js","uni-app:///http/deposit.js","uni-app:///http/mine.js","uni-app:///common/index.js","uni-app:///uni.promisify.adaptor.js","uni-app:///uview-ui/index.js","uni-app:///uview-ui/libs/mixin/mixin.js","uni-app:///uview-ui/libs/mixin/mpMixin.js","uni-app:///uview-ui/libs/luch-request/index.js","uni-app:///uview-ui/libs/luch-request/core/Request.js","uni-app:///uview-ui/libs/luch-request/core/dispatchRequest.js","uni-app:///uview-ui/libs/luch-request/adapters/index.js","uni-app:///uview-ui/libs/luch-request/helpers/buildURL.js","uni-app:///uview-ui/libs/luch-request/utils.js","uni-app:///uview-ui/libs/luch-request/core/buildFullPath.js","uni-app:///uview-ui/libs/luch-request/helpers/isAbsoluteURL.js","uni-app:///uview-ui/libs/luch-request/helpers/combineURLs.js","uni-app:///uview-ui/libs/luch-request/core/settle.js","uni-app:///uview-ui/libs/luch-request/core/InterceptorManager.js","uni-app:///uview-ui/libs/luch-request/core/mergeConfig.js","uni-app:///uview-ui/libs/luch-request/core/defaults.js","uni-app:///uview-ui/libs/luch-request/utils/clone.js","webpack:///./node_modules/buffer/index.js?12e3","webpack:///./node_modules/base64-js/index.js?10ab","webpack:///./node_modules/ieee754/index.js?ba37","webpack:///./node_modules/isarray/index.js?b0e4","uni-app:///uview-ui/libs/util/route.js","webpack:///./node_modules/@dcloudio/vue-cli-plugin-uni/packages/@babel/runtime/regenerator/index.js?7eb4","webpack:///./node_modules/@babel/runtime/helpers/regeneratorRuntime.js?9fc1","webpack:///./node_modules/@babel/runtime/helpers/asyncToGenerator.js?ee10","uni-app:///uview-ui/libs/function/colorGradient.js","uni-app:///uview-ui/libs/function/test.js","uni-app:///uview-ui/libs/function/debounce.js","uni-app:///uview-ui/libs/function/throttle.js","uni-app:///uview-ui/libs/function/index.js","uni-app:///uview-ui/libs/function/digit.js","webpack:///./node_modules/@babel/runtime/helpers/toArray.js?c70d","uni-app:///uview-ui/libs/config/config.js","uni-app:///uview-ui/libs/config/props.js","uni-app:///uview-ui/libs/config/props/actionSheet.js","uni-app:///uview-ui/libs/config/props/album.js","uni-app:///uview-ui/libs/config/props/alert.js","uni-app:///uview-ui/libs/config/props/avatar.js","uni-app:///uview-ui/libs/config/props/avatarGroup.js","uni-app:///uview-ui/libs/config/props/backtop.js","uni-app:///uview-ui/libs/config/props/badge.js","uni-app:///uview-ui/libs/config/props/button.js","uni-app:///uview-ui/libs/config/props/calendar.js","uni-app:///uview-ui/libs/config/props/carKeyboard.js","uni-app:///uview-ui/libs/config/props/cell.js","uni-app:///uview-ui/libs/config/props/cellGroup.js","uni-app:///uview-ui/libs/config/props/checkbox.js","uni-app:///uview-ui/libs/config/props/checkboxGroup.js","uni-app:///uview-ui/libs/config/props/circleProgress.js","uni-app:///uview-ui/libs/config/props/code.js","uni-app:///uview-ui/libs/config/props/codeInput.js","uni-app:///uview-ui/libs/config/props/col.js","uni-app:///uview-ui/libs/config/props/collapse.js","uni-app:///uview-ui/libs/config/props/collapseItem.js","uni-app:///uview-ui/libs/config/props/columnNotice.js","uni-app:///uview-ui/libs/config/props/countDown.js","uni-app:///uview-ui/libs/config/props/countTo.js","uni-app:///uview-ui/libs/config/props/datetimePicker.js","uni-app:///uview-ui/libs/config/props/divider.js","uni-app:///uview-ui/libs/config/props/empty.js","uni-app:///uview-ui/libs/config/props/form.js","uni-app:///uview-ui/libs/config/props/formItem.js","uni-app:///uview-ui/libs/config/props/gap.js","uni-app:///uview-ui/libs/config/props/grid.js","uni-app:///uview-ui/libs/config/props/gridItem.js","uni-app:///uview-ui/libs/config/props/icon.js","uni-app:///uview-ui/libs/config/props/image.js","uni-app:///uview-ui/libs/config/props/indexAnchor.js","uni-app:///uview-ui/libs/config/props/indexList.js","uni-app:///uview-ui/libs/config/props/input.js","uni-app:///uview-ui/libs/config/props/keyboard.js","uni-app:///uview-ui/libs/config/props/line.js","uni-app:///uview-ui/libs/config/props/lineProgress.js","uni-app:///uview-ui/libs/config/props/link.js","uni-app:///uview-ui/libs/config/props/list.js","uni-app:///uview-ui/libs/config/props/listItem.js","uni-app:///uview-ui/libs/config/props/loadingIcon.js","uni-app:///uview-ui/libs/config/props/loadingPage.js","uni-app:///uview-ui/libs/config/props/loadmore.js","uni-app:///uview-ui/libs/config/props/modal.js","uni-app:///uview-ui/libs/config/props/navbar.js","uni-app:///uview-ui/libs/config/color.js","uni-app:///uview-ui/libs/config/props/noNetwork.js","uni-app:///uview-ui/libs/config/props/noticeBar.js","uni-app:///uview-ui/libs/config/props/notify.js","uni-app:///uview-ui/libs/config/props/numberBox.js","uni-app:///uview-ui/libs/config/props/numberKeyboard.js","uni-app:///uview-ui/libs/config/props/overlay.js","uni-app:///uview-ui/libs/config/props/parse.js","uni-app:///uview-ui/libs/config/props/picker.js","uni-app:///uview-ui/libs/config/props/popup.js","uni-app:///uview-ui/libs/config/props/radio.js","uni-app:///uview-ui/libs/config/props/radioGroup.js","uni-app:///uview-ui/libs/config/props/rate.js","uni-app:///uview-ui/libs/config/props/readMore.js","uni-app:///uview-ui/libs/config/props/row.js","uni-app:///uview-ui/libs/config/props/rowNotice.js","uni-app:///uview-ui/libs/config/props/scrollList.js","uni-app:///uview-ui/libs/config/props/search.js","uni-app:///uview-ui/libs/config/props/section.js","uni-app:///uview-ui/libs/config/props/skeleton.js","uni-app:///uview-ui/libs/config/props/slider.js","uni-app:///uview-ui/libs/config/props/statusBar.js","uni-app:///uview-ui/libs/config/props/steps.js","uni-app:///uview-ui/libs/config/props/stepsItem.js","uni-app:///uview-ui/libs/config/props/sticky.js","uni-app:///uview-ui/libs/config/props/subsection.js","uni-app:///uview-ui/libs/config/props/swipeAction.js","uni-app:///uview-ui/libs/config/props/swipeActionItem.js","uni-app:///uview-ui/libs/config/props/swiper.js","uni-app:///uview-ui/libs/config/props/swipterIndicator.js","uni-app:///uview-ui/libs/config/props/switch.js","uni-app:///uview-ui/libs/config/props/tabbar.js","uni-app:///uview-ui/libs/config/props/tabbarItem.js","uni-app:///uview-ui/libs/config/props/tabs.js","uni-app:///uview-ui/libs/config/props/tag.js","uni-app:///uview-ui/libs/config/props/text.js","uni-app:///uview-ui/libs/config/props/textarea.js","uni-app:///uview-ui/libs/config/props/toast.js","uni-app:///uview-ui/libs/config/props/toolbar.js","uni-app:///uview-ui/libs/config/props/tooltip.js","uni-app:///uview-ui/libs/config/props/transition.js","uni-app:///uview-ui/libs/config/props/upload.js","uni-app:///uview-ui/libs/config/zIndex.js","uni-app:///uview-ui/libs/function/platform.js","uni-app:///tm-vuetify/index.js","uni-app:///tm-vuetify/tool/mixin/mixin.js","uni-app:///tm-vuetify/tool/function/wxshare.js","uni-app:///tm-vuetify/tool/function/util.js","uni-app:///tm-vuetify/tool/function/preview.js","uni-app:///tm-vuetify/tool/function/dayjs/index.js","uni-app:///tm-vuetify/tool/function/dayjs/zh-cn.min.js","uni-app:///tm-vuetify/tool/function/dayjs/dayjs.min.js","webpack:///(webpack)/buildin/amd-define.js?0bba","uni-app:///tm-vuetify/tool/function/dayjs/relativeTime.min.js","uni-app:///tm-vuetify/tool/function/dayjs/isBetween.min.js","uni-app:///tm-vuetify/tool/function/dayjs/toObject.min.js","uni-app:///tm-vuetify/tool/function/guid.js","uni-app:///tm-vuetify/tool/function/sleep.js","uni-app:///tm-vuetify/tool/function/randomArray.js","uni-app:///tm-vuetify/tool/function/deepClone.js","uni-app:///tm-vuetify/tool/function/deepMerge.js","uni-app:///tm-vuetify/tool/function/test.js","uni-app:///tm-vuetify/tool/function/random.js","uni-app:///tm-vuetify/tool/function/trim.js","uni-app:///tm-vuetify/tool/function/toast.js","uni-app:///tm-vuetify/tool/function/getParent.js","uni-app:///tm-vuetify/tool/function/getParentAttr.js","uni-app:///tm-vuetify/tool/function/getParentAls.js","uni-app:///tm-vuetify/tool/function/upload.js","uni-app:///tm-vuetify/tool/function/objToString.js","uni-app:///tm-vuetify/tool/function/calendar.js","uni-app:///tm-vuetify/tool/function/signBoard.js","uni-app:///tm-vuetify/tool/function/choujianggailv.js","uni-app:///tm-vuetify/tool/config/config.js","uni-app:///tm-vuetify/tool/store/tm-vuetify.js","webpack:///./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vuex3/dist/vuex.common.js?8f59","uni-app:///tm-vuetify/tool/function/vuex.js","uni-app:///tm-vuetify/tool/function/theme.js","uni-app:///tm-vuetify/tool/request/index.js","uni-app:///http/api.js","uni-app:///http/service.js","uni-app:///uni_modules/uni-forms/components/uni-forms/utils.js","uni-app:///node_modules/dayjs/dayjs.min.js","webpack:///./node_modules/lodash/lodash.js?3387","webpack:///(webpack)/buildin/module.js?c3c2","uni-app:///uview-ui/libs/mixin/button.js","uni-app:///uview-ui/libs/mixin/openType.js","uni-app:///uview-ui/components/u-button/props.js","uni-app:///uview-ui/components/u-input/props.js","uni-app:///uview-ui/components/u-icon/icons.js","uni-app:///uview-ui/components/u-icon/props.js","uni-app:///uview-ui/components/u-radio-group/props.js","uni-app:///uview-ui/components/u-radio/props.js","uni-app:///uview-ui/components/u-upload/utils.js","uni-app:///uview-ui/components/u-upload/mixin.js","uni-app:///uview-ui/components/u-upload/props.js","uni-app:///uview-ui/components/u-checkbox-group/props.js","uni-app:///uview-ui/components/u-checkbox/props.js","uni-app:///uview-ui/components/u-parse/props.js","uni-app:///uview-ui/components/u-parse/parser.js","uni-app:///uview-ui/components/u-count-down/props.js","uni-app:///uview-ui/components/u-count-down/utils.js","uni-app:///uview-ui/components/u-divider/props.js","uni-app:///uview-ui/components/u-action-sheet/props.js","uni-app:///uni_modules/uni-popup/components/uni-popup/popup.js","uni-app:///uni_modules/uni-popup/components/uni-popup/i18n/index.js","uni-app:///uview-ui/components/u-image/props.js","uni-app:///uview-ui/components/u-popup/props.js","uni-app:///uview-ui/components/u-picker/props.js","uni-app:///uview-ui/components/u-loading-page/props.js","uni-app:///uview-ui/components/u-loading-icon/props.js","uni-app:///uview-ui/components/u-line/props.js","uni-app:///uview-ui/components/u-tabbar/props.js","uni-app:///uview-ui/components/u-tabbar-item/props.js","uni-app:///uview-ui/components/u-gap/props.js","uni-app:///uni_modules/uni-transition/components/uni-transition/createAnimation.js","uni-app:///uview-ui/components/u-overlay/props.js","uni-app:///uview-ui/components/u-transition/props.js","uni-app:///uview-ui/components/u-transition/transition.js","uni-app:///uview-ui/components/u-transition/nvue.ani-map.js","uni-app:///uview-ui/components/u-status-bar/props.js","uni-app:///uview-ui/components/u-safe-bottom/props.js","uni-app:///uview-ui/components/u-toolbar/props.js","uni-app:///uview-ui/components/u-badge/props.js"],"names":["objectKeys","singlePageDisableKey","target","globalThis","this","key","join","oldWx","launchOption","getLaunchOptionsSync","isWxKey","scene","includes","indexOf","initWx","newWx","realAtob","b64","b64re","b64DecodeUnicode","str","decodeURIComponent","split","map","c","charCodeAt","toString","slice","getCurrentUserInfo","userInfo","token","wx","getStorageSync","tokenArr","length","uid","role","permission","tokenExpired","JSON","parse","error","Error","message","exp","iat","uniIdMixin","Vue","prototype","uniIDHasRole","roleId","uniIDHasPermission","permissionId","uniIDTokenValid","Date","now","atob","String","replace","test","bitmap","r1","r2","result","i","charAt","fromCharCode","_toString","Object","hasOwnProperty","isFn","fn","isStr","isObject","obj","isPlainObject","call","hasOwn","noop","cached","cache","create","hit","camelizeRE","camelize","_","toUpperCase","sortObject","sortObj","keys","sort","forEach","HOOKS","globalInterceptors","scopedInterceptors","mergeHook","parentVal","childVal","res","concat","Array","isArray","dedupeHooks","hooks","push","removeHook","hook","index","splice","mergeInterceptorHook","interceptor","option","removeInterceptorHook","addInterceptor","method","removeInterceptor","wrapperHook","params","data","isPromise","then","queue","promise","Promise","resolve","callback","wrapperOptions","options","name","oldCallback","wrapperReturnValue","returnValue","returnValueHooks","getApiInterceptorHooks","scopedInterceptor","invokeApi","api","invoke","promiseInterceptor","reject","SYNC_API_RE","CONTEXT_API_RE","CONTEXT_API_RE_EXC","ASYNC_API","CALLBACK_API_RE","isContextApi","isSyncApi","isCallbackApi","handlePromise","catch","err","shouldPromise","promisify","success","fail","complete","assign","finally","constructor","value","reason","EPS","BASE_DEVICE_WIDTH","isIOS","deviceWidth","deviceDPR","checkDeviceWidth","getSystemInfoSync","platform","pixelRatio","windowWidth","upx2px","number","newDeviceWidth","Number","Math","floor","locale","LOCALE_ZH_HANS","LOCALE_ZH_HANT","LOCALE_EN","LOCALE_FR","LOCALE_ES","messages","initI18nMessages","isEnableLocale","localeKeys","__uniConfig","locales","curMessages","userMessages","normalizeLocale","language","i18n","initVueI18n","t","mixin","beforeCreate","unwatch","watchLocale","$forceUpdate","$once","methods","$$t","values","setLocale","getLocale","initAppLocale","appVm","state","observable","localeWatchers","$watchLocale","defineProperty","get","set","v","watch","include","parts","find","part","startsWith","trim","toLowerCase","lang","getLocale$1","getApp","app","allowDefault","$vm","$locale","setLocale$1","oldLocale","onLocaleChangeCallbacks","onLocaleChange","global","interceptors","baseApi","freeze","__proto__","findExistsPageIndex","url","pages","getCurrentPages","len","page","$page","fullPath","deviceId","redirectTo","fromArgs","exists","delta","args","existsPageIndex","previewImage","currentIndex","parseInt","current","isNaN","urls","filter","item","indicator","loop","UUID_KEY","useDeviceId","random","setStorage","addSafeAreaInsets","safeArea","safeAreaInsets","top","left","right","bottom","screenHeight","populateParameters","brand","model","system","theme","version","fontSizeSetting","SDKVersion","deviceOrientation","extraParam","osName","osVersion","hostVersion","deviceType","getGetDeviceType","deviceBrand","getDeviceBrand","_hostName","getHostName","_deviceOrientation","_devicePixelRatio","_SDKVersion","hostLanguage","parameters","appId","process","appName","appVersion","appVersionCode","appLanguage","getAppLanguage","uniCompileVersion","uniRuntimeVersion","uniPlatform","deviceModel","devicePixelRatio","toLocaleLowerCase","hostTheme","hostName","hostSDKVersion","hostFontSizeSetting","windowTop","windowBottom","osLanguage","undefined","osTheme","ua","hostPackageName","browserName","browserVersion","deviceTypeMaps","ipad","windows","mac","deviceTypeMapsKeys","_model","_m","defaultLanguage","_platform","environment","host","env","getSystemInfo","showActionSheet","alertText","title","getAppBaseInfo","getDeviceInfo","getWindowInfo","getAppAuthorizeSetting","locationReducedAccuracy","locationAccuracy","compressImage","compressedHeight","compressHeight","compressedWidth","compressWidth","protocols","todos","canIUses","CALLBACKS","processCallback","methodName","processReturnValue","processArgs","argsOption","keepFromArgs","toArgs","keyOption","console","warn","keepReturnValue","wrapper","protocol","arg1","arg2","apply","todoApis","TODOS","createTodoApi","errMsg","providers","oauth","share","payment","getProvider","service","provider","extraApi","getEmitter","Emitter","ctx","$on","arguments","$off","$emit","cid","cidErrMsg","enabled","eventApi","tryCatch","e","getApiCallbacks","apiCallbacks","param","normalizePushMessage","invokePushCallback","type","invokeGetPushCidCallbacks","onPushMessageCallbacks","stopped","getPushCidCallbacks","getPushClientId","hasSuccess","hasFail","hasComplete","onPushMessage","offPushMessage","baseInfo","shareVideoMessage","miniapp","mocks","findVmByVueId","vm","vuePid","parentVm","$children","childVm","$scope","_$vueId","initBehavior","Behavior","isPage","route","initRelation","detail","triggerEvent","selectAllComponents","mpInstance","selector","$refs","components","component","ref","dataset","toSkip","vueGeneric","scopedComponent","syncRefs","refs","newRefs","oldKeys","Set","newKeys","oldValue","newValue","every","delete","initRefs","forComponents","handleLink","event","vueOptions","parent","markMPComponent","IS_MP","configurable","enumerable","OB","SKIP","isExtensible","WORKLET_RE","initWorkletMethods","mpMethods","vueMethods","matches","match","workletName","MPPage","Page","MPComponent","Component","customizeRE","customize","initTriggerEvent","oldTriggerEvent","newTriggerEvent","comType","newEvent","_triggerEvent","initHook","isComponent","oldHook","__$wrappered","after","PAGE_EVENT_HOOKS","initMocks","$mp","mpType","mock","hasHook","default","extendOptions","super","mixins","initHooks","mpOptions","__call_hook","initUnknownHooks","excludes","findHooks","initHook$1","initVueComponent","VueComponent","extend","initSlots","vueSlots","$slots","slotName","$scopedSlots","initVueIds","vueIds","_$vuePid","initData","context","VUE_APP_DEBUG","stringify","__lifecycle_hooks__","PROP_TYPES","Boolean","createObserver","newVal","oldVal","initBehaviors","vueBehaviors","behaviors","vueExtends","extends","vueMixins","vueProps","props","behavior","properties","initProperties","vueMixin","parsePropType","defaultValue","file","isBehavior","vueId","virtualHost","virtualHostStyle","virtualHostClass","scopedSlotsCompiler","observer","setData","opts","wrapper$1","mp","stopPropagation","preventDefault","markerId","getExtraValue","dataPathsArray","dataPathArray","dataPath","vFor","propPath","valuePath","isInteger","substr","__get_value","vForItem","vForKey","processEventExtra","extra","__args__","extraObj","getObjByArray","arr","element","processEventArgs","isCustom","isCustomMPEvent","currentTarget","ret","arg","ONCE","CUSTOM","isMatchEventType","eventType","optType","getContextVm","$parent","$options","generic","handleEvent","eventOpts","eventOpt","eventsArray","isOnce","eventArray","handlerCtx","handler","path","is","once","eventChannels","getEventChannel","id","eventChannel","initEventChannel","getOpenerEventChannel","callHook","__id__","__eventChannel__","initScopedSlotsParams","center","parents","currentId","propsData","$hasSSP","slot","$getSSP","needAll","$setSSP","$initSSP","$callSSP","destroyed","parseBaseApp","store","$store","mpHost","$i18n","_i18n","appOptions","onLaunch","canIUse","globalData","_isMounted","parseApp","createApp","App","encodeReserveRE","encodeReserveReplacer","commaRE","encode","encodeURIComponent","stringifyQuery","encodeStr","val","val2","x","parseBaseComponent","vueComponentOptions","needVueOptions","multipleSlots","addGlobalClass","componentOptions","__file","lifetimes","attached","$mount","ready","detached","$destroy","pageLifetimes","show","hide","resize","size","__l","__e","externalClasses","wxsCallMethods","callMethod","parseComponent","hooks$1","parseBasePage","vuePageOptions","pageOptions","onLoad","query","copyQuery","parsePage","createPage","createComponent","createSubpackageApp","onShow","onAppShow","onHide","onAppHide","createPlugin","todoApi","canIUseApi","apiName","uni","Proxy","uni$1","g","Function","window","module","exports","_interopRequireDefault","__esModule","arrayWithHoles","require","iterableToArrayLimit","unsupportedIterableToArray","nonIterableRest","_slicedToArray","_arrayWithHoles","_iterableToArrayLimit","r","l","Symbol","iterator","n","u","a","f","o","next","done","arrayLikeToArray","_unsupportedIterableToArray","minLen","from","_arrayLikeToArray","arr2","_nonIterableRest","TypeError","toPropertyKey","_defineProperty","writable","_typeof","toPrimitive","setPrototypeOf","isNativeReflectConstruct","_construct","Reflect","construct","p","bind","_setPrototypeOf","_isNativeReflectConstruct","valueOf","arrayWithoutHoles","iterableToArray","nonIterableSpread","_toConsumableArray","_arrayWithoutHoles","_iterableToArray","iter","_nonIterableSpread","defaultDelimiters","BaseFormatter","_caches","delimiters","tokens","compile","RE_TOKEN_LIST_VALUE","RE_TOKEN_NAMED_VALUE","format","startDelimiter","endDelimiter","position","text","char","sub","isClosed","compiled","mode","defaultFormatter","I18n","fallbackLocale","watcher","formater","watchers","override","interpolate","watchAppLocale","newLocale","$watch","getDefaultLocale","isWatchedAppLocale","add","isString","hasI18nJson","jsonObj","walkJsonObj","isI18nStr","parseI18nJson","compileStr","compileI18nJsonStr","jsonStr","localeValues","unshift","compileJsonObj","compileValue","valueLocales","localValue","walk","resolveLocale","resolveLocaleChain","chain","pop","_classCallCheck","instance","Constructor","_defineProperties","descriptor","_createClass","protoProps","staticProps","emptyObject","isUndef","isDef","isTrue","isFalse","isPrimitive","toRawType","isRegExp","isValidArrayIndex","parseFloat","isFinite","toNumber","makeMap","expectsLowerCase","list","isBuiltInTag","isReservedAttribute","remove","capitalize","hyphenateRE","hyphenate","polyfillBind","boundFn","_length","nativeBind","toArray","start","to","_from","toObject","b","no","identity","looseEqual","isObjectA","isObjectB","isArrayA","isArrayB","getTime","keysA","keysB","looseIndexOf","called","ASSET_TYPES","LIFECYCLE_HOOKS","config","optionMergeStrategies","silent","productionTip","devtools","performance","errorHandler","warnHandler","ignoredElements","keyCodes","isReservedTag","isReservedAttr","isUnknownElement","getTagNamespace","parsePlatformTagName","mustUseProp","async","_lifecycleHooks","unicodeRegExp","isReserved","def","bailRE","RegExp","parsePath","segments","_isServer","hasProto","inBrowser","inWeex","WXEnvironment","weexPlatform","UA","navigator","userAgent","isIE","isEdge","nativeWatch","addEventListener","isServerRendering","VUE_ENV","__VUE_DEVTOOLS_GLOBAL_HOOK__","isNative","Ctor","_Set","hasSymbol","ownKeys","has","clear","tip","generateComponentTrace","formatComponentName","hasConsole","classifyRE","classify","msg","trace","includeFile","$root","_isVue","_componentTag","repeat","tree","currentRecursiveSequence","last","Dep","subs","pushTarget","SharedObject","targetStack","popTarget","addSub","removeSub","depend","addDep","notify","update","VNode","tag","children","elm","asyncFactory","ns","fnContext","fnOptions","fnScopeId","componentInstance","raw","isStatic","isRootInsert","isComment","isCloned","asyncMeta","isAsyncPlaceholder","prototypeAccessors","child","defineProperties","createEmptyVNode","node","createTextVNode","cloneVNode","vnode","cloned","arrayProto","arrayMethods","methodsToPatch","original","inserted","ob","__ob__","observeArray","dep","arrayKeys","getOwnPropertyNames","shouldObserve","toggleObserving","Observer","vmCount","copyAugment","protoAugment","src","observe","asRootData","__v_isMPComponent","defineReactive$$1","customSetter","shallow","property","getOwnPropertyDescriptor","getter","setter","childOb","dependArray","max","del","items","strats","mergeData","toVal","fromVal","mergeDataOrFn","instanceData","defaultData","mergeAssets","assertObjectType","el","defaultStrat","key$1","inject","computed","provide","checkComponents","validateComponentName","normalizeProps","normalizeInject","normalized","normalizeDirectives","dirs","directives","def$$1","mergeOptions","_base","mergeField","strat","resolveAsset","warnMissing","assets","camelizedId","PascalCaseId","validateProp","propOptions","prop","absent","booleanIndex","getTypeIndex","stringIndex","getPropDefaultValue","prevShouldObserve","assertProp","_props","getType","required","valid","expectedTypes","assertedType","assertType","expectedType","validator","getInvalidTypeMessage","simpleCheckRE","isSameType","receivedType","expectedValue","styleValue","receivedValue","isExplicable","isBoolean","explicitTypes","some","elem","handleError","info","cur","errorCaptured","capture","globalHandleError","invokeWithErrorHandling","_handled","logError","timerFunc","initProxy","callbacks","pending","flushCallbacks","copies","setTimeout","MutationObserver","setImmediate","counter","textNode","document","createTextNode","characterData","nextTick","cb","_resolve","allowedGlobals","warnNonPresent","warnReservedPrefix","hasProxy","isBuiltInModifier","hasHandler","isAllowed","$data","getHandler","handlers","render","_withStripped","_renderProxy","mark","measure","seenObjects","traverse","_traverse","seen","isA","isFrozen","depId","perf","clearMarks","clearMeasures","startTag","endTag","normalizeEvent","passive","once$$1","createFnInvoker","fns","invoker","arguments$1","updateListeners","on","oldOn","remove$$1","createOnceHandler","old","extractPropertiesFromVNodeData","attrs","altKey","checkProp","extractPropsFromVNodeData","keyInLowerCase","hash","preserve","simpleNormalizeChildren","normalizeChildren","normalizeArrayChildren","isTextNode","nestedIndex","lastIndex","shift","_isVList","initProvide","_provided","initInjections","resolveInject","provideKey","source","provideDefault","resolveSlots","slots","name$1","isWhitespace","normalizeScopedSlots","normalSlots","prevSlots","hasNormalSlots","isStable","$stable","$key","_normalized","$hasNormal","normalizeScopedSlot","key$2","proxyNormalSlot","proxy","renderList","renderSlot","fallback","bindObject","nodes","scopedSlotFn","_i","$createElement","resolveFilter","isKeyNotMatch","expect","actual","checkKeyCodes","eventKeyCode","builtInKeyCode","eventKeyName","builtInKeyName","mappedKeyCode","bindObjectProps","asProp","isSync","domProps","camelizedKey","hyphenatedKey","$event","renderStatic","isInFor","_staticTrees","staticRenderFns","markStatic","markOnce","markStaticNode","bindObjectListeners","existing","ours","resolveScopedSlots","hasDynamicKeys","contentHashKey","bindDynamicKeys","baseObj","prependModifier","symbol","installRenderHelpers","_o","_n","_s","_l","_t","_q","_f","_k","_b","_v","_e","_u","_g","_d","_p","FunctionalRenderContext","contextVm","this$1","_original","isCompiled","_compiled","needNormalization","listeners","injections","scopedSlots","_scopeId","_c","d","createElement","createFunctionalComponent","mergeProps","renderContext","cloneAndMarkFunctionalResult","vnodes","clone","devtoolsMeta","componentVNodeHooks","init","hydrating","_isDestroyed","keepAlive","mountedNode","prepatch","createComponentInstanceForVnode","activeInstance","oldVnode","updateChildComponent","insert","queueActivatedComponent","activateChildComponent","destroy","deactivateChildComponent","hooksToMerge","baseCtor","resolveAsyncComponent","createAsyncPlaceholder","resolveConstructorOptions","transformModel","functional","nativeOn","abstract","installComponentHooks","_isComponent","_parentVnode","inlineTemplate","toMerge","_merged","mergeHook$1","f1","f2","merged","SIMPLE_NORMALIZE","ALWAYS_NORMALIZE","normalizationType","alwaysNormalize","_createElement","$vnode","pre","applyNS","registerDeepBindings","force","style","class","initRender","_vnode","parentVnode","_renderChildren","parentData","isUpdatingChildComponent","_parentListeners","currentRenderingInstance","renderMixin","$nextTick","_render","renderError","ensureCtor","comp","base","toStringTag","factory","errorComp","resolved","owner","owners","loading","loadingComp","sync","timerLoading","timerTimeout","forceRender","renderCompleted","clearTimeout","delay","timeout","getFirstComponentChild","initEvents","_events","_hasHookEvent","updateComponentListeners","remove$1","_target","onceHandler","oldListeners","eventsMixin","hookRE","i$1","cbs","lowerCaseEvent","setActiveInstance","prevActiveInstance","initLifecycle","_watcher","_inactive","_directInactive","_isBeingDestroyed","lifecycleMixin","_update","prevEl","$el","prevVnode","restoreActiveInstance","__patch__","__vue__","teardown","_watchers","_data","renderChildren","newScopedSlots","oldScopedSlots","hasDynamicScopedSlot","needsForceUpdate","$attrs","$listeners","propKeys","_propKeys","_$updateProperties","isInInactiveTree","direct","j","MAX_UPDATE_COUNT","activatedChildren","circular","waiting","flushing","resetSchedulerState","getNow","createEvent","timeStamp","flushSchedulerQueue","before","run","user","activatedQueue","updatedQueue","callActivatedHooks","callUpdatedHooks","emit","queueWatcher","uid$2","Watcher","expOrFn","isRenderWatcher","deep","lazy","active","dirty","deps","newDeps","depIds","newDepIds","expression","cleanupDeps","tmp","evaluate","sharedPropertyDefinition","sourceKey","initState","initProps","initMethods","initComputed","initWatch","propsOptions","isRoot","_getFormData","__next_tick_pending","getData","computedWatcherOptions","_computedWatchers","isSSR","userDef","defineComputed","shouldCache","createComputedGetter","createGetterInvoker","createWatcher","stateMixin","dataDef","propsDef","$set","$delete","immediate","uid$3","initMixin","_init","_uid","initInternalComponent","_self","_$fallback","_name","vnodeComponentOptions","superOptions","cachedSuperOptions","modifiedOptions","resolveModifiedOptions","modified","latest","sealed","sealedOptions","initUse","use","plugin","installedPlugins","_installedPlugins","install","initMixin$1","initExtend","Super","SuperId","cachedCtors","_Ctor","Sub","initProps$1","initComputed$1","Comp","initAssetRegisters","definition","getComponentName","pattern","pruneCache","keepAliveInstance","cachedNode","pruneCacheEntry","cached$$1","patternTypes","KeepAlive","exclude","created","mounted","ref$1","builtInComponents","initGlobalAPI","configDef","util","defineReactive","ssrContext","ARRAYTYPE","OBJECTTYPE","NULLTYPE","UNDEFINEDTYPE","diff","syncKeys","_diff","rootCurrentType","rootPreType","currentValue","nullOrUndefined","currentType","preType","setResult","preValue","subKey","k","flushCallbacks$1","__next_tick_callbacks","log","hasRenderWatcher","nextTick$1","mpInstance$1","clearInstance","cloneWithData","dataKeys","reduce","compositionApiState","__composition_api_state__","__secret_vfa_state__","rawBindings","patch","__webviewId__","mpData","diffData","$shouldDiffData","createEmptyRender","mountComponent$1","template","updateComponent","renderClass","staticClass","dynamicClass","stringifyClass","stringifyArray","stringifyObject","stringified","parseStyleText","cssText","listDelimiter","propertyDelimiter","normalizeStyleBinding","bindingStyle","MP_METHODS","getTarget","internalMixin","onError","oldEmit","my","createSelectorQuery","createIntersectionObserver","__init_provide","__init_injections","__set_model","modifiers","__set_sync","__get_orig","__get_class","__get_style","dynamicStyle","staticStyle","dynamicStyleObj","styleObj","__map","iteratee","LIFECYCLE_HOOKS$1","lifecycleMixin$1","oldExtend","strategies","tab1","normalizeComponent","scriptExports","functionalTemplate","injectStyles","scopeId","moduleIdentifier","shadowMode","renderjs","__module","__VUE_SSR_CONTEXT__","_registeredComponents","_ssrRegister","shadowRoot","_injectStyles","originalRender","h","login","deposit","mine","http","request","configFun","getTel","register","chenckId","fddRealName","checkFdd","baseUrl","header","dataType","responseType","response","_token","Authorization","_config","statusCode","newResponse","status","curPage","navigateTo","_reslog","requestId","_reqlog","post","put","req","_statusCode","address","fddIsPass","infoOrders","logout","msgToast","content","showToast","duration","icon","vefTel","reg_tel","vefEmpty","removeStorageSync","reLaunch","navigateBack","history","go","back","getLocationParams","pleaseSetTranspileDependencies","$u","date","timeFormat","colorGradient","hexToRgb","rgbToHex","colorToRgba","Request","zIndex","debounce","throttle","mpMixin","color","timestamp","timeFrom","customStyle","customClass","linkType","getRect","$uGetRect","deepMerge","bem","fixed","change","prefix","classes","openPage","urlKey","all","in","boundingClientRect","rect","exec","getParentData","parentName","preventEvent","onReachBottom","beforeDestroy","array","childrenList","defaults","InterceptorManager","mergeConfig","dispatchRequest","fulfilled","rejected","middleware","adapter","mergeKeys","config2","isUndefined","requestTask","buildURL","buildFullPath","baseURL","settle","otherConfig","filePath","optionalKeys","uploadFile","downloadFile","getTask","serializedParams","utils","isURLSearchParams","isDate","toISOString","hashmarkIndex","URLSearchParams","assignValue","requestedURL","isAbsoluteURL","combineURLs","relativeURL","validateStatus","eject","globalsConfig","custom","defaultToConfig2Keys","uploadKeys","defaultsKeys","_instanceof","nativeMap","nativeSet","nativePromise","Map","depth","includeNonEnumerable","allParents","allChildren","useBuffer","Buffer","_clone","proto","__isArray","__isRegExp","__getRegExpFlags","__isDate","isBuffer","copy","getPrototypeOf","keyChild","valueChild","entryChild","objProperty","ReferenceError","getOwnPropertySymbols","symbols","allPropertyNames","propertyName","Infinity","__objToStr","re","flags","ignoreCase","multiline","clonePrototype","base64","ieee754","typedArraySupport","Uint8Array","foo","subarray","byteLength","kMaxLength","TYPED_ARRAY_SUPPORT","createBuffer","that","RangeError","encodingOrOffset","allocUnsafe","ArrayBuffer","fromArrayBuffer","fromString","fromObject","assertSize","alloc","fill","encoding","checked","string","isEncoding","write","fromArrayLike","byteOffset","buffer","isnan","SlowBuffer","isView","loweredCase","utf8ToBytes","base64ToBytes","slowToString","end","hexSlice","utf8Slice","asciiSlice","latin1Slice","base64Slice","utf16leSlice","swap","m","bidirectionalIndexOf","dir","arrayIndexOf","lastIndexOf","indexSize","arrLength","valLength","read","buf","readUInt16BE","foundIndex","found","hexWrite","offset","remaining","strLen","parsed","utf8Write","blitBuffer","asciiWrite","asciiToBytes","latin1Write","base64Write","ucs2Write","utf16leToBytes","fromByteArray","min","secondByte","thirdByte","fourthByte","tempCodePoint","firstByte","codePoint","bytesPerSequence","decodeCodePointsArray","INSPECT_MAX_BYTES","poolSize","_augment","species","allocUnsafeSlow","_isBuffer","compare","y","pos","swap16","swap32","swap64","equals","inspect","thisStart","thisEnd","thisCopy","targetCopy","toJSON","_arr","MAX_ARGUMENTS_LENGTH","codePoints","out","toHex","bytes","checkOffset","ext","checkInt","objectWriteUInt16","littleEndian","objectWriteUInt32","checkIEEE754","writeFloat","noAssert","writeDouble","newBuf","sliceLen","readUIntLE","mul","readUIntBE","readUInt8","readUInt16LE","readUInt32LE","readUInt32BE","readIntLE","pow","readIntBE","readInt8","readInt16LE","readInt16BE","readInt32LE","readInt32BE","readFloatLE","readFloatBE","readDoubleLE","readDoubleBE","writeUIntLE","maxBytes","writeUIntBE","writeUInt8","writeUInt16LE","writeUInt16BE","writeUInt32LE","writeUInt32BE","writeIntLE","limit","writeIntBE","writeInt8","writeInt16LE","writeInt16BE","writeInt32LE","writeInt32BE","writeFloatLE","writeFloatBE","writeDoubleLE","writeDoubleBE","targetStart","code","INVALID_BASE64_RE","base64clean","stringtrim","units","leadSurrogate","byteArray","hi","lo","toByteArray","dst","lookup","revLookup","Arr","getLens","validLen","placeHoldersLen","lens","_byteLength","curByte","tripletToBase64","num","encodeChunk","uint8","output","extraBytes","maxChunkLength","len2","isLE","mLen","nBytes","eLen","eMax","eBias","nBits","s","NaN","rt","abs","LN2","Router","animationType","animationDuration","intercept","addRootPath","queryParams","mixinParam","deepClone","routeIntercept","isNext","switchTab","runtime","_regeneratorRuntime","asyncIterator","define","wrap","Generator","Context","makeInvokeMethod","GeneratorFunction","GeneratorFunctionPrototype","defineIteratorMethods","_invoke","AsyncIterator","__await","callInvokeWithMethodAndArg","delegate","maybeInvokeDelegate","sent","_sent","dispatchException","abrupt","resultName","nextLoc","pushTryEntry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","resetTryEntry","completion","reset","displayName","isGeneratorFunction","awrap","reverse","prev","stop","rval","handle","finish","delegateYield","asyncGeneratorStep","gen","_next","_throw","_asyncToGenerator","self","startColor","endColor","step","startRGB","startR","startG","startB","endRGB","endR","endG","endB","sR","sG","sB","colorArr","hex","round","sColor","reg","sColorNew","sColorChange","rgb","_this","aColor","strHex","aNum","numHex","alpha","email","mobile","dateISO","digits","idCard","carNo","xreg","creg","amount","chinese","letter","enOrNum","contains","range","rangeLength","landline","empty","jsonString","object","func","image","IMAGE_REGEXP","video","VIDEO_REGEXP","regExp","isEmpty","wait","callNow","flag","getPx","unit","sleep","os","sys","gab","guid","firstU","radix","chars","uuid","addStyle","styleArray","addUnit","randomArray","dateTime","formatStr","timeSource","getFullYear","getMonth","padStart","getDate","getHours","getMinutes","getSeconds","beginIndex","timer","tips","isPrefix","arrayFormat","_result","_value","commaStr","toast","type2icon","iconName","priceFormat","decimals","decimalPoint","thousandsSeparator","prec","sep","dec","getDuration","valueNum","padZero","formValidate","formItem","form","validateField","getProperty","firstObj","setProperty","inFn","_obj","setConfig","maxLength","fillString","fillLength","times","ceil","_boundaryCheckingState","strip","precision","toPrecision","digitLength","eSplit","float2Fixed","dLen","checkBoundary","MAX_SAFE_INTEGER","MIN_SAFE_INTEGER","iteratorOperation","operation","num1","num2","others","nums","num1Changed","num2Changed","baseNum","leftValue","plus","minus","divide","ratio","enableBoundaryChecking","_toArray","actionSheet","album","alert","avatar","avatarGroup","backtop","badge","button","calendar","carKeyboard","cell","cellGroup","checkbox","checkboxGroup","circleProgress","codeInput","col","collapse","collapseItem","columnNotice","countDown","countTo","datetimePicker","divider","gap","grid","gridItem","indexAnchor","indexList","input","keyboard","line","lineProgress","link","listItem","loadingIcon","loadingPage","loadmore","modal","navbar","noNetwork","noticeBar","numberBox","numberKeyboard","overlay","picker","popup","radio","radioGroup","rate","readMore","row","rowNotice","scrollList","search","section","skeleton","slider","statusBar","steps","stepsItem","sticky","subsection","swipeAction","swipeActionItem","swiper","swipterIndicator","_switch","tabbar","tabbarItem","tabs","textarea","toolbar","tooltip","transition","upload","description","actions","cancelText","closeOnClickAction","safeAreaInsetBottom","openType","closeOnClickOverlay","keyName","singleSize","multipleSize","space","singleMode","multipleMode","maxCount","previewFullImage","rowCount","showMore","closable","showIcon","effect","fontSize","shape","bgColor","mpAvatar","randomBgColor","defaultUrl","colorIndex","extraValue","scrollTop","iconStyle","isDot","showZero","numberType","inverted","absolute","hairline","plain","disabled","loadingText","loadingMode","loadingSize","formType","appParameter","hoverStopPropagation","sessionFrom","sendMessageTitle","sendMessagePath","sendMessageImg","showMessageCard","dataName","throttleTime","hoverStartTime","hoverStayTime","iconColor","showTitle","showSubtitle","startText","endText","customList","minDate","maxDate","defaultDate","rowHeight","formatter","showLunar","showMark","confirmText","confirmDisabledText","readonly","showConfirm","maxRange","rangePrompt","showRangePrompt","allowSameDay","monthNum","label","border","clickable","isLink","arrowDirection","rightIconStyle","rightIcon","titleStyle","activeColor","inactiveColor","iconSize","labelSize","labelColor","labelDisabled","placement","iconPlacement","borderBottom","percentage","seconds","changeText","keepRunning","uniqueKey","adjustPosition","maxlength","dot","focus","bold","disabledKeyboard","borderColor","disabledDot","span","justify","align","textAlign","accordion","speed","disableTouch","time","autoStart","millisecond","startVal","endVal","autoplay","useEasing","decimal","separator","showToolbar","minHour","maxHour","minMinute","maxMinute","itemHeight","cancelColor","confirmColor","visibleItemCount","defaultIndex","dashed","textPosition","textSize","textColor","lineColor","width","height","marginTop","rules","errorType","labelPosition","labelWidth","labelAlign","labelStyle","leftIcon","leftIconStyle","marginBottom","hoverClass","customPrefix","labelPos","imgMode","radius","lazyLoad","showMenuByLongpress","errorIcon","showLoading","showError","fade","webp","customNavHeight","disabledColor","clearable","password","placeholder","placeholderClass","placeholderStyle","showWordLimit","confirmType","confirmHold","holdKeyboard","autoBlur","disableDefaultPadding","cursor","cursorSpacing","selectionStart","selectionEnd","inputAlign","prefixIcon","prefixIconStyle","suffixIcon","suffixIconStyle","dotDisabled","showTips","showCancel","autoChange","direction","margin","showText","underLine","href","mpTips","showScrollbar","lowerThreshold","upperThreshold","offsetAccuracy","enableFlex","pagingEnabled","scrollable","scrollIntoView","scrollWithAnimation","enableBackToTop","preLoadScreen","anchor","vertical","timingFunction","loadingColor","loadmoreText","nomoreText","showConfirmButton","showCancelButton","buttonReverse","zoom","asyncClose","negativeTop","confirmButtonShape","safeAreaInsetTop","leftText","rightText","titleWidth","leftIconSize","leftIconColor","mainColor","autoBack","primary","warning","contentColor","tipsColor","lightColor","integer","disabledInput","asyncChange","inputWidth","showMinus","showPlus","decimalLength","longPress","buttonSize","disableMinus","disablePlus","opacity","copyLink","errorImg","loadingImg","pauseVideo","previewImg","setTitle","showImgMenu","columns","immediateChange","closeable","overlayStyle","closeIconPos","overlayOpacity","count","gutter","minCount","allowHalf","activeIcon","inactiveIcon","touchable","showHeight","toggle","closeText","openText","textIndent","indicatorWidth","indicatorBarWidth","indicatorColor","indicatorActiveColor","indicatorStyle","clearabled","showAction","actionStyle","actionText","inputStyle","searchIconColor","searchIconSize","placeholderColor","searchIcon","animation","subTitle","subColor","showLine","arrow","animate","rows","rowsWidth","rowsHeight","titleHeight","avatarSize","avatarShape","blockSize","blockColor","showValue","blockStyle","desc","offsetTop","autoClose","threshold","indicatorInactiveColor","indicatorMode","currentItemId","interval","previousMargin","nextMargin","acceleration","displayMultipleItems","easingFunction","swiperIndicator","switch","activeValue","inactiveValue","badgeStyle","activeStyle","inactiveStyle","lineWidth","lineHeight","lineBgSize","itemStyle","closeColor","plainFill","block","lines","decoration","wordWrap","autoHeight","showConfirmBar","isTab","copyText","showCopy","buttons","accept","compressed","camera","maxDuration","uploadIcon","uploadIconColor","useBeforeRead","imageMode","sizeType","multiple","deletable","maxSize","MAX_VALUE","fileList","uploadText","mask","topTips","indexListSticky","$tm","objToString","dayjs","preview","getParent","getParentAttr","getParentAls","HandwritingSelf","choujiang","vx","sharebywx","tmVueTifly_pages","setVueTiflyThemeBlack","commit","vueTifly_black","tmVuetify","black","setTabBarStyle","backgroundColor","$TestColor","$TestUnit","$Querey","clsaaName","ycnum","isAll","rs","rj","selectAll","select","onPageScroll","cfg","wxshareConfig_miniMp","httpUrlAddKey","onShareAppMessage","cg","onShareTimeline","splitData","oArr","minArr","timeMuch","callPhone","phoneNumber","makePhoneCall","scanCode","onlyFromCamera","scanType","setClipboardData","getClipboardData","setCookie","setStorageSync","delCookie","getCookie","uri","rangKey","er","pc","relativeTime","isBetween","weekdays","weekdaysShort","weekdaysMin","months","monthsShort","ordinal","weekStart","yearStart","formats","LT","LTS","L","LL","LLL","LLLL","ll","lll","llll","future","past","mm","hh","dd","M","MM","yy","meridiem","$","z","utcOffset","year","month","w","D","ms","Q","S","O","$L","utc","$x","$offset","$d","substring","UTC","$y","$M","$D","$W","getDay","$H","$m","$s","$ms","getMilliseconds","$utils","isValid","isSame","startOf","endOf","isAfter","isBefore","$g","unix","toDate","daysInMonth","subtract","invalidDate","YY","YYYY","MMM","MMMM","DD","ddd","dddd","H","HH","A","ss","SSS","Z","getTimezoneOffset","toUTCString","$i","isDayjs","en","Ls","fromToBase","thresholds","rounding","toNow","fromNow","years","hours","minutes","milliseconds","timid","rej","checkObject","istrue","testObjec","chinaPost","bankCard","password2","uploadfile","maxfile","uploadUrl","responseStu","file_list","isAuto","maxsize","extension","ots","chooseImage","tempFilePaths","imgarray","fielist","tempFiles","jgsk","isMaxsize","progress","fileId","filelist","selected","fs","chooseFile","chooseMessageFile","ftype","isStop","startupload","upObj","formData","file_name","jsd","isOk","isJsonCallbackData","itecode","onProgressUpdate","chooseImgUpload","dobj","now_day_month","sv","start_time","end_time","_year","_month","textArray","txtdateArray","yesterDay","day","lunarInfo","zodiacs","Gan","Zhi","GY","GM","GD","cyclical","lYearDays","sum","leapDays","leapMonth","monthDays","Lunar","objDate","temp","baseDate","dayCyl","monCyl","yearCyl","leap","isLeap","cDay","lunarMonthCn","lunarDayCn","nStr1","nStr2","getSolarTerm","sTermInfo","solarTerm","solarTerms","tmp1","tmp2","getUTCDate","sDObj","lDObj","shengxiao","jieqi","week","text_week","_thisMothn","toLocaleString","_thisDay","_thisYear","_thisMothn_day","_thisDayDate","monthDay","_thisMothn_lastDay","dateArray","ishs","tdy","tf","Day","week_text","prevMoth","nowMonth","nowDay","nowYear","nextMoth","beginEnd","nongli","dstr","TxtIndex","findIndex","Point","isControl","isAdd","Line","points","changeWidthCount","canvas","line_w","line_color","ellipse","pointLines","begin","middle","preTime","isDown","currentPoint","addPoint","draw","isUp","setStrokeStyle","beginPath","PI","moveTo","lastW","setLineWidth","setLineJoin","setLineCap","minLineW","isChangeW","stroke","lineTo","quadraticCurveTo","controlPoint","startPoint","insertCount","endPoint","dis","z_distance","insertPoints","BezierCalculate","fillStyle","last_point","distance","pushPoint","controlPs","computeControlPoints","first","p1","p2","w1","w2","otherPoints","insertPCount","insertP","diffW","diff1","diff2","second","bwidth","max_speed","max_dif","sqrt","poss","dimersion","mi","prizes","prizeList","randomFrom","lowerValue","upperValue","eachArr","lastArr","deepEach","deepArr","randomIndex","gailv","getResult","ver","V","Vuex","moduleTrue","modulesList","modules","modulePath","moduleName","namespaced","pdefault_cookies_color","pdefault_cookies_black","Store","tmVueTifly_pagesIndex","imageUrl","getters","mutations","setTmVuetifyColor","setPageNow","setPageNowIndex","setTmVuetifyBlack","setWxShare","pcf","applyMixin","vuexInit","devtoolHook","devtoolPlugin","_devtoolHook","targetState","replaceState","subscribe","mutation","prepend","subscribeAction","action","deepCopy","forEachValue","assert","condition","partial","Module","rawModule","_children","_rawModule","rawState","addChild","removeChild","getChild","hasChild","forEachChild","forEachGetter","forEachAction","forEachMutation","ModuleCollection","rawRootModule","targetModule","newModule","assertRawModule","root","getNamespace","namespace","rawChildModule","unregister","isRegistered","functionAssert","expected","objectAssert","assertTypes","assertOptions","makeAssertionMessage","plugins","strict","_committing","_actions","_actionSubscribers","_mutations","_wrappedGetters","_modules","_modulesNamespaceMap","_subscribers","_watcherVM","_makeLocalGettersCache","dispatch","payload","installModule","resetStoreVM","useDevtools","prototypeAccessors$1","genericSubscribe","resetStore","hot","oldVm","_vm","wrappedGetters","$$state","enableStrictMode","_withCommit","rootState","parentState","getNestedState","local","makeLocalContext","namespacedType","registerMutation","registerAction","registerGetter","noNamespace","_type","_payload","_options","unifyObjectStyle","makeLocalGetters","gettersProxy","splitPos","localType","entry","rootGetters","rawGetter","_Vue","registerModule","preserveState","unregisterModule","hasModule","newOptions","committing","mapState","normalizeNamespace","states","isValidMap","normalizeMap","getModuleByNamespace","vuex","mapMutations","mapGetters","mapActions","createNamespacedHelpers","helper","createLogger","collapsed","stateBefore","stateAfter","transformer","mutationTransformer","mut","actionFilter","actionTransformer","act","logMutations","logActions","logger","prevState","nextState","formattedTime","getFormattedTime","formattedMutation","startMessage","endMessage","formattedAction","groupCollapsed","group","groupEnd","pad","index_cjs","tst","rulst","funName","getTheme","setBlack","setTheme","loadingTime","originalData","loadingMask","customConfig","interceptorRequest","hideLoading","resInterceptors","validate","postDataByParams","getDataByParams","typeFilter","getValue","isRuleNumType","isRuleBoolType","isNumber","setDataValue","field","formdata","getDataValue","objGet","getDataValueType","realName","base_name","_basePath","realname","isRealName","rawData","newData","name2arr","objSet","defaultVal","newPath","bool","isRequiredField","isNoField","ruleData","class2type","isEqual","classNameA","classNameB","propsA","propsB","propName","VERSION","LARGE_ARRAY_SIZE","CORE_ERROR_TEXT","FUNC_ERROR_TEXT","INVALID_TEMPL_VAR_ERROR_TEXT","HASH_UNDEFINED","MAX_MEMOIZE_SIZE","PLACEHOLDER","CLONE_DEEP_FLAG","CLONE_FLAT_FLAG","CLONE_SYMBOLS_FLAG","COMPARE_PARTIAL_FLAG","COMPARE_UNORDERED_FLAG","WRAP_BIND_FLAG","WRAP_BIND_KEY_FLAG","WRAP_CURRY_BOUND_FLAG","WRAP_CURRY_FLAG","WRAP_CURRY_RIGHT_FLAG","WRAP_PARTIAL_FLAG","WRAP_PARTIAL_RIGHT_FLAG","WRAP_ARY_FLAG","WRAP_REARG_FLAG","WRAP_FLIP_FLAG","DEFAULT_TRUNC_LENGTH","DEFAULT_TRUNC_OMISSION","HOT_COUNT","HOT_SPAN","LAZY_FILTER_FLAG","LAZY_MAP_FLAG","LAZY_WHILE_FLAG","INFINITY","MAX_INTEGER","NAN","MAX_ARRAY_LENGTH","MAX_ARRAY_INDEX","HALF_MAX_ARRAY_LENGTH","wrapFlags","argsTag","arrayTag","asyncTag","boolTag","dateTag","domExcTag","errorTag","funcTag","genTag","mapTag","numberTag","nullTag","objectTag","promiseTag","proxyTag","regexpTag","setTag","stringTag","symbolTag","undefinedTag","weakMapTag","weakSetTag","arrayBufferTag","dataViewTag","float32Tag","float64Tag","int8Tag","int16Tag","int32Tag","uint8Tag","uint8ClampedTag","uint16Tag","uint32Tag","reEmptyStringLeading","reEmptyStringMiddle","reEmptyStringTrailing","reEscapedHtml","reUnescapedHtml","reHasEscapedHtml","reHasUnescapedHtml","reEscape","reEvaluate","reInterpolate","reIsDeepProp","reIsPlainProp","rePropName","reRegExpChar","reHasRegExpChar","reTrimStart","reWhitespace","reWrapComment","reWrapDetails","reSplitDetails","reAsciiWord","reForbiddenIdentifierChars","reEscapeChar","reEsTemplate","reFlags","reIsBadHex","reIsBinary","reIsHostCtor","reIsOctal","reIsUint","reLatin","reNoMatch","reUnescapedString","rsAstralRange","rsComboMarksRange","reComboHalfMarksRange","rsComboSymbolsRange","rsComboRange","rsDingbatRange","rsLowerRange","rsMathOpRange","rsNonCharRange","rsPunctuationRange","rsSpaceRange","rsUpperRange","rsVarRange","rsBreakRange","rsApos","rsAstral","rsBreak","rsCombo","rsDigits","rsDingbat","rsLower","rsMisc","rsFitz","rsModifier","rsNonAstral","rsRegional","rsSurrPair","rsUpper","rsZWJ","rsMiscLower","rsMiscUpper","rsOptContrLower","rsOptContrUpper","reOptMod","rsOptVar","rsOptJoin","rsOrdLower","rsOrdUpper","rsSeq","rsEmoji","rsSymbol","reApos","reComboMark","reUnicode","reUnicodeWord","reHasUnicode","reHasUnicodeWord","contextProps","templateCounter","typedArrayTags","cloneableTags","deburredLetters","htmlEscapes","htmlUnescapes","stringEscapes","freeParseFloat","freeParseInt","freeGlobal","freeSelf","freeExports","nodeType","freeModule","moduleExports","freeProcess","nodeUtil","types","binding","nodeIsArrayBuffer","isArrayBuffer","nodeIsDate","nodeIsMap","isMap","nodeIsRegExp","nodeIsSet","isSet","nodeIsTypedArray","isTypedArray","thisArg","arrayAggregator","accumulator","arrayEach","arrayEachRight","arrayEvery","predicate","arrayFilter","resIndex","arrayIncludes","baseIndexOf","arrayIncludesWith","comparator","arrayMap","arrayPush","arrayReduce","initAccum","arrayReduceRight","arraySome","asciiSize","baseProperty","asciiToArray","asciiWords","baseFindKey","collection","eachFunc","baseFindIndex","fromIndex","fromRight","strictIndexOf","baseIsNaN","baseIndexOfWith","baseMean","baseSum","basePropertyOf","baseReduce","baseSortBy","comparer","baseTimes","baseToPairs","baseTrim","trimmedEndIndex","baseUnary","baseValues","cacheHas","charsStartIndex","strSymbols","chrSymbols","charsEndIndex","countHolders","deburrLetter","escapeHtmlChar","escapeStringChar","chr","hasUnicode","hasUnicodeWord","iteratorToArray","mapToArray","overArg","transform","replaceHolders","setToArray","setToPairs","strictLastIndexOf","stringSize","unicodeSize","stringToArray","unicodeToArray","unescapeHtmlChar","unicodeWords","runInContext","pick","funcProto","objectProto","coreJsData","funcToString","idCounter","maskSrcKey","IE_PROTO","nativeObjectToString","objectCtorString","oldDash","reIsNative","getPrototype","objectCreate","propertyIsEnumerable","spreadableSymbol","isConcatSpreadable","symIterator","symToStringTag","getNative","ctxClearTimeout","ctxNow","ctxSetTimeout","nativeCeil","nativeFloor","nativeGetSymbols","nativeIsBuffer","nativeIsFinite","nativeJoin","nativeKeys","nativeMax","nativeMin","nativeNow","nativeParseInt","nativeRandom","nativeReverse","DataView","WeakMap","nativeCreate","metaMap","realNames","dataViewCtorString","toSource","mapCtorString","promiseCtorString","setCtorString","weakMapCtorString","symbolProto","symbolValueOf","symbolToString","lodash","isObjectLike","LazyWrapper","LodashWrapper","wrapperClone","baseCreate","baseLodash","chainAll","__wrapped__","__actions__","__chain__","__index__","__values__","__dir__","__filtered__","__iteratees__","__takeCount__","__views__","lazyClone","copyArray","lazyReverse","lazyValue","isArr","isRight","view","getView","iteratees","iterLength","takeCount","baseWrapperValue","outer","iterIndex","Hash","entries","hashClear","__data__","hashDelete","hashGet","hashHas","hashSet","ListCache","listCacheClear","listCacheDelete","assocIndexOf","listCacheGet","listCacheHas","listCacheSet","MapCache","mapCacheClear","mapCacheDelete","getMapData","mapCacheGet","mapCacheHas","mapCacheSet","SetCache","setCacheAdd","setCacheHas","Stack","stackClear","stackDelete","stackGet","stackHas","stackSet","pairs","arrayLikeKeys","inherited","isArg","isArguments","isBuff","isType","skipIndexes","isIndex","arraySample","baseRandom","arraySampleSize","shuffleSelf","baseClamp","arrayShuffle","assignMergeValue","eq","baseAssignValue","objValue","baseAggregator","baseEach","baseAssign","copyObject","baseAssignIn","keysIn","baseAt","paths","skip","lower","upper","baseClone","bitmask","customizer","stack","isDeep","isFlat","isFull","initCloneArray","getTag","isFunc","cloneBuffer","initCloneObject","copySymbolsIn","copySymbols","initCloneByTag","stacked","subValue","keysFunc","getAllKeysIn","getAllKeys","baseConforms","baseConformsTo","baseDelay","baseDifference","isCommon","valuesLength","valuesIndex","templateSettings","createBaseEach","baseForOwn","baseEachRight","baseForOwnRight","baseEvery","baseExtremum","isSymbol","baseFill","toInteger","toLength","baseFilter","baseFlatten","isStrict","isFlattenable","baseFor","createBaseFor","baseForRight","baseFunctions","isFunction","baseGet","castPath","toKey","baseGetAllKeys","symbolsFunc","baseGetTag","getRawTag","objectToString","baseGt","other","baseHas","baseHasIn","baseInRange","baseIntersection","arrays","othLength","othIndex","caches","baseInverter","baseInvoke","baseIsArguments","baseIsArrayBuffer","baseIsDate","baseIsEqual","baseIsEqualDeep","equalFunc","objIsArr","othIsArr","objTag","othTag","objIsObj","othIsObj","isSameTag","equalArrays","equalByTag","objIsWrapped","othIsWrapped","objUnwrapped","othUnwrapped","equalObjects","baseIsMap","baseIsMatch","matchData","noCustomizer","srcValue","baseIsNative","isMasked","baseIsRegExp","baseIsSet","baseIsTypedArray","isLength","baseIteratee","baseMatchesProperty","baseMatches","baseKeys","isPrototype","baseKeysIn","nativeKeysIn","isProto","baseLt","baseMap","isArrayLike","getMatchData","matchesStrictComparable","isKey","isStrictComparable","hasIn","baseMerge","srcIndex","baseMergeDeep","safeGet","mergeFunc","isTyped","isArrayLikeObject","cloneTypedArray","toPlainObject","baseNth","baseOrderBy","orders","getIteratee","criteria","compareMultiple","basePick","basePickBy","baseSet","basePropertyDeep","basePullAll","basePullAt","indexes","previous","baseUnset","baseRange","baseRepeat","baseRest","setToString","overRest","baseSample","baseSampleSize","nested","baseSetData","baseSetToString","constant","baseShuffle","baseSlice","baseSome","baseSortedIndex","retHighest","low","high","mid","baseSortedIndexBy","valIsNaN","valIsNull","valIsSymbol","valIsUndefined","othIsDefined","othIsNull","othIsReflexive","othIsSymbol","setLow","baseSortedUniq","baseToNumber","baseToString","baseUniq","createSet","seenIndex","baseUpdate","updater","baseWhile","isDrop","baseXor","baseZipObject","assignFunc","valsLength","castArrayLikeObject","castFunction","stringToPath","castRest","castSlice","cloneArrayBuffer","arrayBuffer","cloneDataView","dataView","cloneRegExp","regexp","cloneSymbol","typedArray","compareAscending","valIsDefined","valIsReflexive","objCriteria","othCriteria","ordersLength","order","composeArgs","partials","holders","isCurried","argsIndex","argsLength","holdersLength","leftIndex","leftLength","isUncurried","composeArgsRight","holdersIndex","rightIndex","rightLength","isNew","getSymbols","getSymbolsIn","createAggregator","initializer","createAssigner","assigner","sources","guard","isIterateeCall","iterable","createBind","isBind","createCtor","createCaseFirst","trailing","createCompounder","words","deburr","thisBinding","createCurry","arity","getHolder","createRecurry","createHybrid","createFind","findIndexFunc","createFlow","flatRest","funcs","prereq","thru","getFuncName","funcName","isLaziable","plant","partialsRight","holdersRight","argPos","ary","isAry","isBindKey","isFlip","holdersCount","newHolders","reorder","createInverter","toIteratee","createMathOperation","operator","createOver","arrayFunc","createPadding","charsLength","createPartial","createRange","toFinite","createRelationalOperation","wrapFunc","isCurry","newHoldersRight","newPartials","newPartialsRight","setWrapToString","createRound","pair","createToPairs","createWrap","customDefaultsAssignIn","customDefaultsMerge","customOmitClone","isPartial","arrStacked","othStacked","arrValue","othValue","compared","convert","objProps","objLength","othProps","objStacked","skipCtor","objCtor","othCtor","flatten","otherFunc","isKeyable","isOwn","unmasked","stubArray","transforms","getWrapDetails","hasPath","hasFunc","insertWrapDetails","details","ctorString","isMaskable","stubFalse","memoizeCapped","memoize","srcBitmask","newBitmask","isCombo","otherArgs","oldArray","shortOut","reference","updateWrapDetails","lastCalled","stamp","rand","quote","subString","chunk","compact","difference","differenceBy","differenceWith","drop","dropRight","dropRightWhile","dropWhile","findLastIndex","flattenDeep","flattenDepth","fromPairs","head","initial","intersection","mapped","intersectionBy","intersectionWith","nth","pull","pullAll","pullAllBy","pullAllWith","pullAt","sortedIndex","sortedIndexBy","sortedIndexOf","sortedLastIndex","sortedLastIndexBy","sortedLastIndexOf","sortedUniq","sortedUniqBy","tail","take","takeRight","takeRightWhile","takeWhile","union","unionBy","unionWith","uniq","uniqBy","uniqWith","unzip","unzipWith","without","xor","xorBy","xorWith","zip","zipObject","zipObjectDeep","zipWith","tap","wrapperAt","wrapperChain","wrapperCommit","wrapperNext","wrapperToIterator","wrapperPlant","wrapperReverse","wrapped","wrapperValue","countBy","findLast","flatMap","flatMapDeep","flatMapDepth","forEachRight","groupBy","invokeMap","keyBy","orderBy","partition","reduceRight","negate","sample","sampleSize","shuffle","sortBy","bindKey","curry","curryRight","lastArgs","lastThis","maxWait","timerId","lastCallTime","lastInvokeTime","leading","maxing","invokeFunc","leadingEdge","timerExpired","remainingWait","timeSinceLastCall","timeSinceLastInvoke","timeWaiting","shouldInvoke","trailingEdge","cancel","flush","debounced","isInvoking","defer","flip","resolver","memoized","Cache","overArgs","funcsLength","partialRight","rearg","rest","spread","unary","castArray","cloneWith","cloneDeep","cloneDeepWith","conformsTo","gt","gte","isElement","isEqualWith","isError","isMatch","isMatchWith","isNull","isNil","isSafeInteger","isWeakMap","isWeakSet","lt","lte","sign","remainder","isBinary","toSafeInteger","assignIn","assignInWith","assignWith","at","propsIndex","propsLength","defaultsDeep","mergeWith","findKey","findLastKey","forIn","forInRight","forOwn","forOwnRight","functions","functionsIn","invert","invertBy","mapKeys","mapValues","merge","omit","omitBy","pickBy","setWith","toPairs","toPairsIn","isArrLike","unset","updateWith","valuesIn","clamp","inRange","floating","camelCase","word","upperFirst","endsWith","escape","escapeRegExp","kebabCase","lowerCase","lowerFirst","strLength","padEnd","snakeCase","startCase","settings","isEscaping","isEvaluating","imports","importsKeys","importsValues","reDelimiters","sourceURL","escapeValue","interpolateValue","esTemplateValue","evaluateValue","variable","attempt","toLower","toUpper","trimEnd","trimStart","truncate","omission","newEnd","unescape","upperCase","bindAll","methodNames","cond","conforms","defaultTo","flow","flowRight","matchesProperty","methodOf","noConflict","nthArg","over","overEvery","overSome","propertyOf","rangeRight","stubObject","stubString","stubTrue","toPath","uniqueId","augend","addend","dividend","divisor","maxBy","mean","meanBy","minBy","multiply","multiplier","multiplicand","minuend","subtrahend","sumBy","entriesIn","extendWith","each","eachRight","isFilter","takeName","dropName","checkIteratee","isTaker","lodashFunc","retUnwrapped","isLazy","useLazy","isHybrid","isUnwrapped","onlyLazy","chainName","webpackPolyfill","deprecate","onGetUserInfo","onContact","onGetPhoneNumber","onLaunchApp","onOpenSetting","pickExclude","formatImage","thumb","formatVideo","tempFilePath","thumbTempFilePath","formatMedia","formatFile","sourceType","chooseMedia","chooseVideo","afterRead","beforeRead","domain","scrollTable","selectable","tagStyle","useAnchor","trustTags","blockTags","ignoreTags","voidTags","entities","quot","apos","ensp","emsp","nbsp","semi","ndash","mdash","middot","lsquo","rsquo","ldquo","rdquo","bull","hellip","big","caption","cite","small","blankChar","idIndex","decodeEntity","amp","parser","imgList","lexer","onUpdate","popNode","expose","onParse","getUrl","parseStyle","onTagName","tagName","xml","onAttrName","attrName","onAttrVal","onOpenTag","selfClose","siblings","close","autostart","controls","ignore","_j","_style","_src","newSrc","display","onCloseTag","setNavigationBarTitle","xmlns","traversal","_i2","float","face","padding","cellpadding","spacing","cellspacing","trList","cells","_i5","td","_style2","colspan","rowspan","_i6","_i7","_td","table","_i9","_i10","_i8","I","_i4","_i11","_item","flex","getNFCAdapter","onText","checkClose","needVal","attrVal","targetLength","SECOND","MINUTE","HOUR","DAY","parseTimeData","days","parseFormat","timeData","isSameSecond","time1","time2","zhHans","zhHant","MPAnimation","createAnimation","currentStepAnimates","aniObj","styles","animateTypes1","nvueAnimation","animates","_animateRun","_nvueNextAnimate","isEnd","animationData","export","durationTime","animateTypes2","animateTypes3","getClassNames","enter","leave","clickHandler","vueEnter","classNames","inited","transitionEnded","vueLeave","onTransitionEnd"],"mappings":"6KAAA,IAAMA,EAAa,CACjB,KACA,MACA,QACA,UACA,WACA,QACA,gBACA,SACA,UACA,qCAEIC,EAAuB,CAC3B,WACA,SACA,WAEIC,EAA+B,qBAAfC,WAA6BA,WAAc,WAC/D,OAAOC,KADwD,GAI3DC,EAAM,CAAC,IAAK,KAAKC,KAAK,IACtBC,EAAQL,EAAOG,GACfG,EAAeD,EAAME,qBAAuBF,EAAME,uBAAyB,KAEjF,SAASC,EAASL,GAChB,QAAIG,GAAuC,OAAvBA,EAAaG,QAAkBV,EAAqBW,SAASP,MAG1EL,EAAWa,QAAQR,IAAQ,GAA2B,oBAAfE,EAAMF,IAGtD,SAASS,IACP,IAAMC,EAAQ,GACd,IAAK,IAAMV,KAAOE,EACZG,EAAQL,KAEVU,EAAMV,GAAOE,EAAMF,IAGvB,OAAOU,EAETb,EAAOG,GAAOS,IAAQ,MACPZ,EAAOG,GAAI,a,4NCxCtBW,E,sDAHJ,QACA,WAAsB,2kBAItB,IAAMC,EAAM,oEACNC,EAAQ,uEAyBd,SAASC,EAAkBC,GACzB,OAAOC,mBAAmBL,EAASI,GAAKE,MAAM,IAAIC,KAAI,SAAUC,GAC9D,MAAO,KAAO,KAAOA,EAAEC,WAAW,GAAGC,SAAS,KAAKC,OAAO,MACzDrB,KAAK,KAGV,SAASsB,IACP,IAUIC,EAVEC,EAAUC,EAAIC,eAAe,iBAAmB,GAChDC,EAAWH,EAAMR,MAAM,KAC7B,IAAKQ,GAA6B,IAApBG,EAASC,OACrB,MAAO,CACLC,IAAK,KACLC,KAAM,GACNC,WAAY,GACZC,aAAc,GAIlB,IACET,EAAWU,KAAKC,MAAMrB,EAAiBc,EAAS,KAChD,MAAOQ,GACP,MAAM,IAAIC,MAAM,sBAAwBD,EAAME,SAKhD,OAHAd,EAASS,aAA8B,IAAfT,EAASe,WAC1Bf,EAASe,WACTf,EAASgB,IACThB,EAGT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ACb4D,QACAuB,OACAC,QACAC,SACA7H,QACA+H,0BACD,a,gBCrKD,IAAIj6C,EAAiBC,EAAQ,GACzB0C,EAAkB1C,EAAQ,IAC1BE,EAA6BF,EAAQ,GACrCG,EAAkBH,EAAQ,IAC9B,SAASi6C,EAASjiD,GAChB,OAAO+H,EAAe/H,IAAQ0K,EAAgB1K,IAAQkI,EAA2BlI,IAAQmI,IAE3FR,EAAOC,QAAUq6C,EAAUt6C,EAAOC,QAAQE,YAAa,EAAMH,EAAOC,QAAQ,WAAaD,EAAOC,S,+FCNhG,IAAMla,EAAU,SAEhB,EACe,CACXnE,EAAGmE,EACHA,UAEA0H,KAAM,CACF,UACA,UACA,OACA,QACA,WAGJotC,MAAO,CACH,YAAa,UACb,YAAa,UACb,YAAa,UACb,UAAW,UACX,SAAU,UACV,eAAgB,UAChB,kBAAmB,UACnB,eAAgB,UAChB,gBAAiB,WAGrBma,KAAM,MACT,a,yHCxBD,WAEA,WACA,WACA,WACA,WACA,WACA,WACA,WACA,WACA,WACA,WACA,WACA,WACA,WACA,WACA,WACA,WACA,WACA,WACA,WACA,WACA,WACA,WACA,WACA,WACA,WACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,aACA,aACA,aACA,aACA,aACA,aACA,aACA,aACA,aACA,aACA,aACA,aACA,aACA,aACA,aACA,aACA,aACA,aACA,aACA,aACA,aACA,aACA,aACA,aACA,aACA,aACA,aACA,aACA,aACA,aACA,aACA,aACA,aACA,aACA,aACA,aACA,aACA,aACA,aACA,aAAmC,+kBAI/BjrC,UADA8wB,MADJ,IAEU,8QAGH0f,WACAC,WACAC,WACAC,WACAC,WACAC,WACAC,WACAC,WACAC,WACAC,WACAC,WACAC,WACAC,WACAC,WACAC,WACAlQ,WACAmQ,WACAC,WACAC,WACAC,WACAC,WACAC,WACAC,WACAC,WACAC,WACA5H,WACA6D,WACAD,WACAiE,WACAC,WACAC,WACA5iB,WACAib,WACA4H,WACAC,WACAC,WACAC,WACAC,WACAC,WACAC,WACAx0C,WACAy0C,WACAC,WACAC,WACAC,WACAC,WACAC,WACAC,WACAC,YACAvuC,YACAwuC,YACAC,YACAC,YACAvmE,YACAwmE,YACAC,YACAC,YACAC,YACAC,YACAC,YACAC,YACAC,YACAC,YACAC,YACAC,YACAC,YACAC,YACAC,YACAC,YACAC,YACAC,YACAC,YACAC,YACAC,YACAC,YACAC,YACAC,YACAC,YACAC,YACAC,YACAjwC,YACA1K,YACA46C,YACA9H,YACA+H,YACAC,YACAC,YACAC,YAAM,c,+FC5Lb,MASe,CAEX3E,YAAa,CACT18C,MAAM,EACNlU,MAAO,GACPw1D,YAAa,GACbC,QAAS,iBAAM,IACfrkE,MAAO,GACPskE,WAAY,GACZC,oBAAoB,EACpBC,qBAAqB,EACrBC,SAAU,GACVC,qBAAqB,EACrBnN,MAAO,IAEd,a,+FCxBD,MASe,CAEXkI,MAAO,CACH/1D,KAAM,iBAAM,IACZi7D,QAAS,GACTC,WAAY,IACZC,aAAc,GACdC,MAAO,EACPC,WAAY,cACZC,aAAc,aACdC,SAAU,EACVC,kBAAkB,EAClBC,SAAU,EACVC,UAAU,IAEjB,a,+FCxBD,MASe,CAEX1F,MAAO,CACH9wD,MAAO,GACP8D,KAAM,UACN0xD,YAAa,GACbiB,UAAU,EACVC,UAAU,EACVC,OAAQ,QACR3lD,QAAQ,EACR4lD,SAAU,KAEjB,a,+FCrBD,MASe,CAEX7F,OAAQ,CACJppC,IAAK,GACLkvC,MAAO,SACPxiD,KAAM,GACNuG,KAAM,cACNL,KAAM,GACNu8C,QAAS,UACT5lB,MAAO,UACP0lB,SAAU,GACVlnB,KAAM,GACNqnB,UAAU,EACVC,eAAe,EACfC,WAAY,GACZC,WAAY,GACZzkE,KAAM,KAEb,a,+FC3BD,MASe,CAEXu+D,YAAa,CACTl2D,KAAM,iBAAM,IACZu7D,SAAU,EACVQ,MAAO,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,MAAM+kD,MAAMuG,UAGhCC,SAAU,CACN5zD,KAAM0H,QACN5B,QAASmM,EAAIu6B,GAAGnkC,MAAM+kD,MAAMwG,YAGvC,c","file":"common/vendor.js","sourcesContent":["const objectKeys = [\r\n 'qy',\r\n 'env',\r\n 'error',\r\n 'version',\r\n 'lanDebug',\r\n 'cloud',\r\n 'serviceMarket',\r\n 'router',\r\n 'worklet',\r\n '__webpack_require_UNI_MP_PLUGIN__'\r\n]\r\nconst singlePageDisableKey = [\r\n 'lanDebug',\r\n 'router',\r\n 'worklet'\r\n]\r\nconst target = typeof globalThis !== 'undefined' ? globalThis : (function () {\r\n return this\r\n})()\r\n\r\nconst key = ['w', 'x'].join('')\r\nconst oldWx = target[key]\r\nconst launchOption = oldWx.getLaunchOptionsSync ? oldWx.getLaunchOptionsSync() : null\r\n\r\nfunction isWxKey (key) {\r\n if (launchOption && launchOption.scene === 1154 && singlePageDisableKey.includes(key)) {\r\n return false\r\n }\r\n return objectKeys.indexOf(key) > -1 || typeof oldWx[key] === 'function'\r\n}\r\n\r\nfunction initWx () {\r\n const newWx = {}\r\n for (const key in oldWx) {\r\n if (isWxKey(key)) {\r\n // TODO wrapper function\r\n newWx[key] = oldWx[key]\r\n }\r\n }\r\n return newWx\r\n}\r\ntarget[key] = initWx()\r\nexport default target[key]\r\n","import { initVueI18n } from '@dcloudio/uni-i18n';\r\nimport Vue from 'vue';\r\n\r\nlet realAtob;\r\n\r\nconst b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\r\nconst b64re = /^(?:[A-Za-z\\d+/]{4})*?(?:[A-Za-z\\d+/]{2}(?:==)?|[A-Za-z\\d+/]{3}=?)?$/;\r\n\r\nif (typeof atob !== 'function') {\r\n realAtob = function (str) {\r\n str = String(str).replace(/[\\t\\n\\f\\r ]+/g, '');\r\n if (!b64re.test(str)) { throw new Error(\"Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.\") }\r\n\r\n // Adding the padding if missing, for semplicity\r\n str += '=='.slice(2 - (str.length & 3));\r\n var bitmap; var result = ''; var r1; var r2; var i = 0;\r\n for (; i < str.length;) {\r\n bitmap = b64.indexOf(str.charAt(i++)) << 18 | b64.indexOf(str.charAt(i++)) << 12 |\r\n (r1 = b64.indexOf(str.charAt(i++))) << 6 | (r2 = b64.indexOf(str.charAt(i++)));\r\n\r\n result += r1 === 64 ? String.fromCharCode(bitmap >> 16 & 255)\r\n : r2 === 64 ? String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255)\r\n : String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255, bitmap & 255);\r\n }\r\n return result\r\n };\r\n} else {\r\n // 注意atob只能在全局对象上调用,例如:`const Base64 = {atob};Base64.atob('xxxx')`是错误的用法\r\n realAtob = atob;\r\n}\r\n\r\nfunction b64DecodeUnicode (str) {\r\n return decodeURIComponent(realAtob(str).split('').map(function (c) {\r\n return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2)\r\n }).join(''))\r\n}\r\n\r\nfunction getCurrentUserInfo () {\r\n const token = ( wx).getStorageSync('uni_id_token') || '';\r\n const tokenArr = token.split('.');\r\n if (!token || tokenArr.length !== 3) {\r\n return {\r\n uid: null,\r\n role: [],\r\n permission: [],\r\n tokenExpired: 0\r\n }\r\n }\r\n let userInfo;\r\n try {\r\n userInfo = JSON.parse(b64DecodeUnicode(tokenArr[1]));\r\n } catch (error) {\r\n throw new Error('获取当前用户信息出错,详细错误信息为:' + error.message)\r\n }\r\n userInfo.tokenExpired = userInfo.exp * 1000;\r\n delete userInfo.exp;\r\n delete userInfo.iat;\r\n return userInfo\r\n}\r\n\r\nfunction uniIdMixin (Vue) {\r\n Vue.prototype.uniIDHasRole = function (roleId) {\r\n const {\r\n role\r\n } = getCurrentUserInfo();\r\n return role.indexOf(roleId) > -1\r\n };\r\n Vue.prototype.uniIDHasPermission = function (permissionId) {\r\n const {\r\n permission\r\n } = getCurrentUserInfo();\r\n return this.uniIDHasRole('admin') || permission.indexOf(permissionId) > -1\r\n };\r\n Vue.prototype.uniIDTokenValid = function () {\r\n const {\r\n tokenExpired\r\n } = getCurrentUserInfo();\r\n return tokenExpired > Date.now()\r\n };\r\n}\r\n\r\nconst _toString = Object.prototype.toString;\r\nconst hasOwnProperty = Object.prototype.hasOwnProperty;\r\n\r\nfunction isFn (fn) {\r\n return typeof fn === 'function'\r\n}\r\n\r\nfunction isStr (str) {\r\n return typeof str === 'string'\r\n}\r\n\r\nfunction isObject (obj) {\r\n return obj !== null && typeof obj === 'object'\r\n}\r\n\r\nfunction isPlainObject (obj) {\r\n return _toString.call(obj) === '[object Object]'\r\n}\r\n\r\nfunction hasOwn (obj, key) {\r\n return hasOwnProperty.call(obj, key)\r\n}\r\n\r\nfunction noop () {}\r\n\r\n/**\r\n * Create a cached version of a pure function.\r\n */\r\nfunction cached (fn) {\r\n const cache = Object.create(null);\r\n return function cachedFn (str) {\r\n const hit = cache[str];\r\n return hit || (cache[str] = fn(str))\r\n }\r\n}\r\n\r\n/**\r\n * Camelize a hyphen-delimited string.\r\n */\r\nconst camelizeRE = /-(\\w)/g;\r\nconst camelize = cached((str) => {\r\n return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : '')\r\n});\r\n\r\nfunction sortObject (obj) {\r\n const sortObj = {};\r\n if (isPlainObject(obj)) {\r\n Object.keys(obj).sort().forEach(key => {\r\n sortObj[key] = obj[key];\r\n });\r\n }\r\n return !Object.keys(sortObj) ? obj : sortObj\r\n}\r\n\r\nconst HOOKS = [\r\n 'invoke',\r\n 'success',\r\n 'fail',\r\n 'complete',\r\n 'returnValue'\r\n];\r\n\r\nconst globalInterceptors = {};\r\nconst scopedInterceptors = {};\r\n\r\nfunction mergeHook (parentVal, childVal) {\r\n const res = childVal\r\n ? parentVal\r\n ? parentVal.concat(childVal)\r\n : Array.isArray(childVal)\r\n ? childVal : [childVal]\r\n : parentVal;\r\n return res\r\n ? dedupeHooks(res)\r\n : res\r\n}\r\n\r\nfunction dedupeHooks (hooks) {\r\n const res = [];\r\n for (let i = 0; i < hooks.length; i++) {\r\n if (res.indexOf(hooks[i]) === -1) {\r\n res.push(hooks[i]);\r\n }\r\n }\r\n return res\r\n}\r\n\r\nfunction removeHook (hooks, hook) {\r\n const index = hooks.indexOf(hook);\r\n if (index !== -1) {\r\n hooks.splice(index, 1);\r\n }\r\n}\r\n\r\nfunction mergeInterceptorHook (interceptor, option) {\r\n Object.keys(option).forEach(hook => {\r\n if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {\r\n interceptor[hook] = mergeHook(interceptor[hook], option[hook]);\r\n }\r\n });\r\n}\r\n\r\nfunction removeInterceptorHook (interceptor, option) {\r\n if (!interceptor || !option) {\r\n return\r\n }\r\n Object.keys(option).forEach(hook => {\r\n if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {\r\n removeHook(interceptor[hook], option[hook]);\r\n }\r\n });\r\n}\r\n\r\nfunction addInterceptor (method, option) {\r\n if (typeof method === 'string' && isPlainObject(option)) {\r\n mergeInterceptorHook(scopedInterceptors[method] || (scopedInterceptors[method] = {}), option);\r\n } else if (isPlainObject(method)) {\r\n mergeInterceptorHook(globalInterceptors, method);\r\n }\r\n}\r\n\r\nfunction removeInterceptor (method, option) {\r\n if (typeof method === 'string') {\r\n if (isPlainObject(option)) {\r\n removeInterceptorHook(scopedInterceptors[method], option);\r\n } else {\r\n delete scopedInterceptors[method];\r\n }\r\n } else if (isPlainObject(method)) {\r\n removeInterceptorHook(globalInterceptors, method);\r\n }\r\n}\r\n\r\nfunction wrapperHook (hook, params) {\r\n return function (data) {\r\n return hook(data, params) || data\r\n }\r\n}\r\n\r\nfunction isPromise (obj) {\r\n return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function'\r\n}\r\n\r\nfunction queue (hooks, data, params) {\r\n let promise = false;\r\n for (let i = 0; i < hooks.length; i++) {\r\n const hook = hooks[i];\r\n if (promise) {\r\n promise = Promise.resolve(wrapperHook(hook, params));\r\n } else {\r\n const res = hook(data, params);\r\n if (isPromise(res)) {\r\n promise = Promise.resolve(res);\r\n }\r\n if (res === false) {\r\n return {\r\n then () { }\r\n }\r\n }\r\n }\r\n }\r\n return promise || {\r\n then (callback) {\r\n return callback(data)\r\n }\r\n }\r\n}\r\n\r\nfunction wrapperOptions (interceptor, options = {}) {\r\n ['success', 'fail', 'complete'].forEach(name => {\r\n if (Array.isArray(interceptor[name])) {\r\n const oldCallback = options[name];\r\n options[name] = function callbackInterceptor (res) {\r\n queue(interceptor[name], res, options).then((res) => {\r\n /* eslint-disable no-mixed-operators */\r\n return isFn(oldCallback) && oldCallback(res) || res\r\n });\r\n };\r\n }\r\n });\r\n return options\r\n}\r\n\r\nfunction wrapperReturnValue (method, returnValue) {\r\n const returnValueHooks = [];\r\n if (Array.isArray(globalInterceptors.returnValue)) {\r\n returnValueHooks.push(...globalInterceptors.returnValue);\r\n }\r\n const interceptor = scopedInterceptors[method];\r\n if (interceptor && Array.isArray(interceptor.returnValue)) {\r\n returnValueHooks.push(...interceptor.returnValue);\r\n }\r\n returnValueHooks.forEach(hook => {\r\n returnValue = hook(returnValue) || returnValue;\r\n });\r\n return returnValue\r\n}\r\n\r\nfunction getApiInterceptorHooks (method) {\r\n const interceptor = Object.create(null);\r\n Object.keys(globalInterceptors).forEach(hook => {\r\n if (hook !== 'returnValue') {\r\n interceptor[hook] = globalInterceptors[hook].slice();\r\n }\r\n });\r\n const scopedInterceptor = scopedInterceptors[method];\r\n if (scopedInterceptor) {\r\n Object.keys(scopedInterceptor).forEach(hook => {\r\n if (hook !== 'returnValue') {\r\n interceptor[hook] = (interceptor[hook] || []).concat(scopedInterceptor[hook]);\r\n }\r\n });\r\n }\r\n return interceptor\r\n}\r\n\r\nfunction invokeApi (method, api, options, ...params) {\r\n const interceptor = getApiInterceptorHooks(method);\r\n if (interceptor && Object.keys(interceptor).length) {\r\n if (Array.isArray(interceptor.invoke)) {\r\n const res = queue(interceptor.invoke, options);\r\n return res.then((options) => {\r\n // 重新访问 getApiInterceptorHooks, 允许 invoke 中再次调用 addInterceptor,removeInterceptor\r\n return api(\r\n wrapperOptions(getApiInterceptorHooks(method), options),\r\n ...params\r\n )\r\n })\r\n } else {\r\n return api(wrapperOptions(interceptor, options), ...params)\r\n }\r\n }\r\n return api(options, ...params)\r\n}\r\n\r\nconst promiseInterceptor = {\r\n returnValue (res) {\r\n if (!isPromise(res)) {\r\n return res\r\n }\r\n return new Promise((resolve, reject) => {\r\n res.then(res => {\r\n if (res[0]) {\r\n reject(res[0]);\r\n } else {\r\n resolve(res[1]);\r\n }\r\n });\r\n })\r\n }\r\n};\r\n\r\nconst SYNC_API_RE =\r\n /^\\$|Window$|WindowStyle$|sendHostEvent|sendNativeEvent|restoreGlobal|requireGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64|getLocale|setLocale|invokePushCallback|getWindowInfo|getDeviceInfo|getAppBaseInfo|getSystemSetting|getAppAuthorizeSetting|initUTS|requireUTS|registerUTS/;\r\n\r\nconst CONTEXT_API_RE = /^create|Manager$/;\r\n\r\n// Context例外情况\r\nconst CONTEXT_API_RE_EXC = ['createBLEConnection'];\r\n\r\n// 同步例外情况\r\nconst ASYNC_API = ['createBLEConnection', 'createPushMessage'];\r\n\r\nconst CALLBACK_API_RE = /^on|^off/;\r\n\r\nfunction isContextApi (name) {\r\n return CONTEXT_API_RE.test(name) && CONTEXT_API_RE_EXC.indexOf(name) === -1\r\n}\r\nfunction isSyncApi (name) {\r\n return SYNC_API_RE.test(name) && ASYNC_API.indexOf(name) === -1\r\n}\r\n\r\nfunction isCallbackApi (name) {\r\n return CALLBACK_API_RE.test(name) && name !== 'onPush'\r\n}\r\n\r\nfunction handlePromise (promise) {\r\n return promise.then(data => {\r\n return [null, data]\r\n })\r\n .catch(err => [err])\r\n}\r\n\r\nfunction shouldPromise (name) {\r\n if (\r\n isContextApi(name) ||\r\n isSyncApi(name) ||\r\n isCallbackApi(name)\r\n ) {\r\n return false\r\n }\r\n return true\r\n}\r\n\r\n/* eslint-disable no-extend-native */\r\nif (!Promise.prototype.finally) {\r\n Promise.prototype.finally = function (callback) {\r\n const promise = this.constructor;\r\n return this.then(\r\n value => promise.resolve(callback()).then(() => value),\r\n reason => promise.resolve(callback()).then(() => {\r\n throw reason\r\n })\r\n )\r\n };\r\n}\r\n\r\nfunction promisify (name, api) {\r\n if (!shouldPromise(name) || !isFn(api)) {\r\n return api\r\n }\r\n return function promiseApi (options = {}, ...params) {\r\n if (isFn(options.success) || isFn(options.fail) || isFn(options.complete)) {\r\n return wrapperReturnValue(name, invokeApi(name, api, options, ...params))\r\n }\r\n return wrapperReturnValue(name, handlePromise(new Promise((resolve, reject) => {\r\n invokeApi(name, api, Object.assign({}, options, {\r\n success: resolve,\r\n fail: reject\r\n }), ...params);\r\n })))\r\n }\r\n}\r\n\r\nconst EPS = 1e-4;\r\nconst BASE_DEVICE_WIDTH = 750;\r\nlet isIOS = false;\r\nlet deviceWidth = 0;\r\nlet deviceDPR = 0;\r\n\r\nfunction checkDeviceWidth () {\r\n const {\r\n platform,\r\n pixelRatio,\r\n windowWidth\r\n } = wx.getSystemInfoSync(); // uni=>wx runtime 编译目标是 uni 对象,内部不允许直接使用 uni\r\n\r\n deviceWidth = windowWidth;\r\n deviceDPR = pixelRatio;\r\n isIOS = platform === 'ios';\r\n}\r\n\r\nfunction upx2px (number, newDeviceWidth) {\r\n if (deviceWidth === 0) {\r\n checkDeviceWidth();\r\n }\r\n\r\n number = Number(number);\r\n if (number === 0) {\r\n return 0\r\n }\r\n let result = (number / BASE_DEVICE_WIDTH) * (newDeviceWidth || deviceWidth);\r\n if (result < 0) {\r\n result = -result;\r\n }\r\n result = Math.floor(result + EPS);\r\n if (result === 0) {\r\n if (deviceDPR === 1 || !isIOS) {\r\n result = 1;\r\n } else {\r\n result = 0.5;\r\n }\r\n }\r\n return number < 0 ? -result : result\r\n}\r\n\r\nconst LOCALE_ZH_HANS = 'zh-Hans';\r\nconst LOCALE_ZH_HANT = 'zh-Hant';\r\nconst LOCALE_EN = 'en';\r\nconst LOCALE_FR = 'fr';\r\nconst LOCALE_ES = 'es';\r\n\r\nconst messages = {};\r\n\r\nlet locale;\r\n\r\n{\r\n locale = normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN;\r\n}\r\n\r\nfunction initI18nMessages () {\r\n if (!isEnableLocale()) {\r\n return\r\n }\r\n const localeKeys = Object.keys(__uniConfig.locales);\r\n if (localeKeys.length) {\r\n localeKeys.forEach((locale) => {\r\n const curMessages = messages[locale];\r\n const userMessages = __uniConfig.locales[locale];\r\n if (curMessages) {\r\n Object.assign(curMessages, userMessages);\r\n } else {\r\n messages[locale] = userMessages;\r\n }\r\n });\r\n }\r\n}\r\n\r\ninitI18nMessages();\r\n\r\nconst i18n = initVueI18n(\r\n locale,\r\n {}\r\n);\r\nconst t = i18n.t;\r\nconst i18nMixin = (i18n.mixin = {\r\n beforeCreate () {\r\n const unwatch = i18n.i18n.watchLocale(() => {\r\n this.$forceUpdate();\r\n });\r\n this.$once('hook:beforeDestroy', function () {\r\n unwatch();\r\n });\r\n },\r\n methods: {\r\n $$t (key, values) {\r\n return t(key, values)\r\n }\r\n }\r\n});\r\nconst setLocale = i18n.setLocale;\r\nconst getLocale = i18n.getLocale;\r\n\r\nfunction initAppLocale (Vue, appVm, locale) {\r\n const state = Vue.observable({\r\n locale: locale || i18n.getLocale()\r\n });\r\n const localeWatchers = [];\r\n appVm.$watchLocale = fn => {\r\n localeWatchers.push(fn);\r\n };\r\n Object.defineProperty(appVm, '$locale', {\r\n get () {\r\n return state.locale\r\n },\r\n set (v) {\r\n state.locale = v;\r\n localeWatchers.forEach(watch => watch(v));\r\n }\r\n });\r\n}\r\n\r\nfunction isEnableLocale () {\r\n return typeof __uniConfig !== 'undefined' && __uniConfig.locales && !!Object.keys(__uniConfig.locales).length\r\n}\r\n\r\nfunction include (str, parts) {\r\n return !!parts.find((part) => str.indexOf(part) !== -1)\r\n}\r\n\r\nfunction startsWith (str, parts) {\r\n return parts.find((part) => str.indexOf(part) === 0)\r\n}\r\n\r\nfunction normalizeLocale (locale, messages) {\r\n if (!locale) {\r\n return\r\n }\r\n locale = locale.trim().replace(/_/g, '-');\r\n if (messages && messages[locale]) {\r\n return locale\r\n }\r\n locale = locale.toLowerCase();\r\n if (locale === 'chinese') {\r\n // 支付宝\r\n return LOCALE_ZH_HANS\r\n }\r\n if (locale.indexOf('zh') === 0) {\r\n if (locale.indexOf('-hans') > -1) {\r\n return LOCALE_ZH_HANS\r\n }\r\n if (locale.indexOf('-hant') > -1) {\r\n return LOCALE_ZH_HANT\r\n }\r\n if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) {\r\n return LOCALE_ZH_HANT\r\n }\r\n return LOCALE_ZH_HANS\r\n }\r\n const lang = startsWith(locale, [LOCALE_EN, LOCALE_FR, LOCALE_ES]);\r\n if (lang) {\r\n return lang\r\n }\r\n}\r\n// export function initI18n() {\r\n// const localeKeys = Object.keys(__uniConfig.locales || {})\r\n// if (localeKeys.length) {\r\n// localeKeys.forEach((locale) =>\r\n// i18n.add(locale, __uniConfig.locales[locale])\r\n// )\r\n// }\r\n// }\r\n\r\nfunction getLocale$1 () {\r\n // 优先使用 $locale\r\n if (isFn(getApp)) {\r\n const app = getApp({\r\n allowDefault: true\r\n });\r\n if (app && app.$vm) {\r\n return app.$vm.$locale\r\n }\r\n }\r\n return normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN\r\n}\r\n\r\nfunction setLocale$1 (locale) {\r\n const app = isFn(getApp) ? getApp() : false;\r\n if (!app) {\r\n return false\r\n }\r\n const oldLocale = app.$vm.$locale;\r\n if (oldLocale !== locale) {\r\n app.$vm.$locale = locale;\r\n onLocaleChangeCallbacks.forEach((fn) => fn({\r\n locale\r\n }));\r\n return true\r\n }\r\n return false\r\n}\r\n\r\nconst onLocaleChangeCallbacks = [];\r\nfunction onLocaleChange (fn) {\r\n if (onLocaleChangeCallbacks.indexOf(fn) === -1) {\r\n onLocaleChangeCallbacks.push(fn);\r\n }\r\n}\r\n\r\nif (typeof global !== 'undefined') {\r\n global.getLocale = getLocale$1;\r\n}\r\n\r\nconst interceptors = {\r\n promiseInterceptor\r\n};\r\n\r\nvar baseApi = /*#__PURE__*/Object.freeze({\r\n __proto__: null,\r\n upx2px: upx2px,\r\n getLocale: getLocale$1,\r\n setLocale: setLocale$1,\r\n onLocaleChange: onLocaleChange,\r\n addInterceptor: addInterceptor,\r\n removeInterceptor: removeInterceptor,\r\n interceptors: interceptors\r\n});\r\n\r\nfunction findExistsPageIndex (url) {\r\n const pages = getCurrentPages();\r\n let len = pages.length;\r\n while (len--) {\r\n const page = pages[len];\r\n if (page.$page && page.$page.fullPath === url) {\r\n return len\r\n }\r\n }\r\n return -1\r\n}\r\n\r\nvar redirectTo = {\r\n name (fromArgs) {\r\n if (fromArgs.exists === 'back' && fromArgs.delta) {\r\n return 'navigateBack'\r\n }\r\n return 'redirectTo'\r\n },\r\n args (fromArgs) {\r\n if (fromArgs.exists === 'back' && fromArgs.url) {\r\n const existsPageIndex = findExistsPageIndex(fromArgs.url);\r\n if (existsPageIndex !== -1) {\r\n const delta = getCurrentPages().length - 1 - existsPageIndex;\r\n if (delta > 0) {\r\n fromArgs.delta = delta;\r\n }\r\n }\r\n }\r\n }\r\n};\r\n\r\nvar previewImage = {\r\n args (fromArgs) {\r\n let currentIndex = parseInt(fromArgs.current);\r\n if (isNaN(currentIndex)) {\r\n return\r\n }\r\n const urls = fromArgs.urls;\r\n if (!Array.isArray(urls)) {\r\n return\r\n }\r\n const len = urls.length;\r\n if (!len) {\r\n return\r\n }\r\n if (currentIndex < 0) {\r\n currentIndex = 0;\r\n } else if (currentIndex >= len) {\r\n currentIndex = len - 1;\r\n }\r\n if (currentIndex > 0) {\r\n fromArgs.current = urls[currentIndex];\r\n fromArgs.urls = urls.filter(\r\n (item, index) => index < currentIndex ? item !== urls[currentIndex] : true\r\n );\r\n } else {\r\n fromArgs.current = urls[0];\r\n }\r\n return {\r\n indicator: false,\r\n loop: false\r\n }\r\n }\r\n};\r\n\r\nconst UUID_KEY = '__DC_STAT_UUID';\r\nlet deviceId;\r\nfunction useDeviceId (result) {\r\n deviceId = deviceId || wx.getStorageSync(UUID_KEY);\r\n if (!deviceId) {\r\n deviceId = Date.now() + '' + Math.floor(Math.random() * 1e7);\r\n wx.setStorage({\r\n key: UUID_KEY,\r\n data: deviceId\r\n });\r\n }\r\n result.deviceId = deviceId;\r\n}\r\n\r\nfunction addSafeAreaInsets (result) {\r\n if (result.safeArea) {\r\n const safeArea = result.safeArea;\r\n result.safeAreaInsets = {\r\n top: safeArea.top,\r\n left: safeArea.left,\r\n right: result.windowWidth - safeArea.right,\r\n bottom: result.screenHeight - safeArea.bottom\r\n };\r\n }\r\n}\r\n\r\nfunction populateParameters (result) {\r\n const {\r\n brand = '', model = '', system = '',\r\n language = '', theme, version,\r\n platform, fontSizeSetting,\r\n SDKVersion, pixelRatio, deviceOrientation\r\n } = result;\r\n // const isQuickApp = \"mp-weixin\".indexOf('quickapp-webview') !== -1\r\n\r\n const extraParam = {};\r\n\r\n // osName osVersion\r\n let osName = '';\r\n let osVersion = '';\r\n {\r\n osName = system.split(' ')[0] || '';\r\n osVersion = system.split(' ')[1] || '';\r\n }\r\n let hostVersion = version;\r\n\r\n // deviceType\r\n const deviceType = getGetDeviceType(result, model);\r\n\r\n // deviceModel\r\n const deviceBrand = getDeviceBrand(brand);\r\n\r\n // hostName\r\n const _hostName = getHostName(result);\r\n\r\n // deviceOrientation\r\n let _deviceOrientation = deviceOrientation; // 仅 微信 百度 支持\r\n\r\n // devicePixelRatio\r\n let _devicePixelRatio = pixelRatio;\r\n\r\n // SDKVersion\r\n let _SDKVersion = SDKVersion;\r\n\r\n // hostLanguage\r\n const hostLanguage = language.replace(/_/g, '-');\r\n\r\n // wx.getAccountInfoSync\r\n\r\n const parameters = {\r\n appId: process.env.UNI_APP_ID,\r\n appName: process.env.UNI_APP_NAME,\r\n appVersion: process.env.UNI_APP_VERSION_NAME,\r\n appVersionCode: process.env.UNI_APP_VERSION_CODE,\r\n appLanguage: getAppLanguage(hostLanguage),\r\n uniCompileVersion: process.env.UNI_COMPILER_VERSION,\r\n uniRuntimeVersion: process.env.UNI_COMPILER_VERSION,\r\n uniPlatform: process.env.UNI_SUB_PLATFORM || process.env.UNI_PLATFORM,\r\n deviceBrand,\r\n deviceModel: model,\r\n deviceType,\r\n devicePixelRatio: _devicePixelRatio,\r\n deviceOrientation: _deviceOrientation,\r\n osName: osName.toLocaleLowerCase(),\r\n osVersion,\r\n hostTheme: theme,\r\n hostVersion,\r\n hostLanguage,\r\n hostName: _hostName,\r\n hostSDKVersion: _SDKVersion,\r\n hostFontSizeSetting: fontSizeSetting,\r\n windowTop: 0,\r\n windowBottom: 0,\r\n // TODO\r\n osLanguage: undefined,\r\n osTheme: undefined,\r\n ua: undefined,\r\n hostPackageName: undefined,\r\n browserName: undefined,\r\n browserVersion: undefined\r\n };\r\n\r\n Object.assign(result, parameters, extraParam);\r\n}\r\n\r\nfunction getGetDeviceType (result, model) {\r\n let deviceType = result.deviceType || 'phone';\r\n {\r\n const deviceTypeMaps = {\r\n ipad: 'pad',\r\n windows: 'pc',\r\n mac: 'pc'\r\n };\r\n const deviceTypeMapsKeys = Object.keys(deviceTypeMaps);\r\n const _model = model.toLocaleLowerCase();\r\n for (let index = 0; index < deviceTypeMapsKeys.length; index++) {\r\n const _m = deviceTypeMapsKeys[index];\r\n if (_model.indexOf(_m) !== -1) {\r\n deviceType = deviceTypeMaps[_m];\r\n break\r\n }\r\n }\r\n }\r\n return deviceType\r\n}\r\n\r\nfunction getDeviceBrand (brand) {\r\n let deviceBrand = brand;\r\n if (deviceBrand) {\r\n deviceBrand = brand.toLocaleLowerCase();\r\n }\r\n return deviceBrand\r\n}\r\n\r\nfunction getAppLanguage (defaultLanguage) {\r\n return getLocale$1\r\n ? getLocale$1()\r\n : defaultLanguage\r\n}\r\n\r\nfunction getHostName (result) {\r\n const _platform = 'WeChat' ;\r\n let _hostName = result.hostName || _platform; // mp-jd\r\n {\r\n if (result.environment) {\r\n _hostName = result.environment;\r\n } else if (result.host && result.host.env) {\r\n _hostName = result.host.env;\r\n }\r\n }\r\n\r\n return _hostName\r\n}\r\n\r\nvar getSystemInfo = {\r\n returnValue: function (result) {\r\n useDeviceId(result);\r\n addSafeAreaInsets(result);\r\n populateParameters(result);\r\n }\r\n};\r\n\r\nvar showActionSheet = {\r\n args (fromArgs) {\r\n if (typeof fromArgs === 'object') {\r\n fromArgs.alertText = fromArgs.title;\r\n }\r\n }\r\n};\r\n\r\nvar getAppBaseInfo = {\r\n returnValue: function (result) {\r\n const { version, language, SDKVersion, theme } = result;\r\n\r\n const _hostName = getHostName(result);\r\n\r\n const hostLanguage = language.replace('_', '-');\r\n\r\n result = sortObject(Object.assign(result, {\r\n appId: process.env.UNI_APP_ID,\r\n appName: process.env.UNI_APP_NAME,\r\n appVersion: process.env.UNI_APP_VERSION_NAME,\r\n appVersionCode: process.env.UNI_APP_VERSION_CODE,\r\n appLanguage: getAppLanguage(hostLanguage),\r\n hostVersion: version,\r\n hostLanguage,\r\n hostName: _hostName,\r\n hostSDKVersion: SDKVersion,\r\n hostTheme: theme\r\n }));\r\n }\r\n};\r\n\r\nvar getDeviceInfo = {\r\n returnValue: function (result) {\r\n const { brand, model } = result;\r\n const deviceType = getGetDeviceType(result, model);\r\n const deviceBrand = getDeviceBrand(brand);\r\n useDeviceId(result);\r\n\r\n result = sortObject(Object.assign(result, {\r\n deviceType,\r\n deviceBrand,\r\n deviceModel: model\r\n }));\r\n }\r\n};\r\n\r\nvar getWindowInfo = {\r\n returnValue: function (result) {\r\n addSafeAreaInsets(result);\r\n\r\n result = sortObject(Object.assign(result, {\r\n windowTop: 0,\r\n windowBottom: 0\r\n }));\r\n }\r\n};\r\n\r\nvar getAppAuthorizeSetting = {\r\n returnValue: function (result) {\r\n const { locationReducedAccuracy } = result;\r\n\r\n result.locationAccuracy = 'unsupported';\r\n if (locationReducedAccuracy === true) {\r\n result.locationAccuracy = 'reduced';\r\n } else if (locationReducedAccuracy === false) {\r\n result.locationAccuracy = 'full';\r\n }\r\n }\r\n};\r\n\r\n// import navigateTo from 'uni-helpers/navigate-to'\r\n\r\nconst compressImage = {\r\n args (fromArgs) {\r\n // https://developers.weixin.qq.com/community/develop/doc/000c08940c865011298e0a43256800?highLine=compressHeight\r\n if (fromArgs.compressedHeight && !fromArgs.compressHeight) {\r\n fromArgs.compressHeight = fromArgs.compressedHeight;\r\n }\r\n if (fromArgs.compressedWidth && !fromArgs.compressWidth) {\r\n fromArgs.compressWidth = fromArgs.compressedWidth;\r\n }\r\n }\r\n};\r\n\r\nconst protocols = {\r\n redirectTo,\r\n // navigateTo, // 由于在微信开发者工具的页面参数,会显示__id__参数,因此暂时关闭mp-weixin对于navigateTo的AOP\r\n previewImage,\r\n getSystemInfo,\r\n getSystemInfoSync: getSystemInfo,\r\n showActionSheet,\r\n getAppBaseInfo,\r\n getDeviceInfo,\r\n getWindowInfo,\r\n getAppAuthorizeSetting,\r\n compressImage\r\n};\r\nconst todos = [\r\n 'vibrate',\r\n 'preloadPage',\r\n 'unPreloadPage',\r\n 'loadSubPackage'\r\n];\r\nconst canIUses = [];\r\n\r\nconst CALLBACKS = ['success', 'fail', 'cancel', 'complete'];\r\n\r\nfunction processCallback (methodName, method, returnValue) {\r\n return function (res) {\r\n return method(processReturnValue(methodName, res, returnValue))\r\n }\r\n}\r\n\r\nfunction processArgs (methodName, fromArgs, argsOption = {}, returnValue = {}, keepFromArgs = false) {\r\n if (isPlainObject(fromArgs)) { // 一般 api 的参数解析\r\n const toArgs = keepFromArgs === true ? fromArgs : {}; // returnValue 为 false 时,说明是格式化返回值,直接在返回值对象上修改赋值\r\n if (isFn(argsOption)) {\r\n argsOption = argsOption(fromArgs, toArgs) || {};\r\n }\r\n for (const key in fromArgs) {\r\n if (hasOwn(argsOption, key)) {\r\n let keyOption = argsOption[key];\r\n if (isFn(keyOption)) {\r\n keyOption = keyOption(fromArgs[key], fromArgs, toArgs);\r\n }\r\n if (!keyOption) { // 不支持的参数\r\n console.warn(`The '${methodName}' method of platform '微信小程序' does not support option '${key}'`);\r\n } else if (isStr(keyOption)) { // 重写参数 key\r\n toArgs[keyOption] = fromArgs[key];\r\n } else if (isPlainObject(keyOption)) { // {name:newName,value:value}可重新指定参数 key:value\r\n toArgs[keyOption.name ? keyOption.name : key] = keyOption.value;\r\n }\r\n } else if (CALLBACKS.indexOf(key) !== -1) {\r\n if (isFn(fromArgs[key])) {\r\n toArgs[key] = processCallback(methodName, fromArgs[key], returnValue);\r\n }\r\n } else {\r\n if (!keepFromArgs) {\r\n toArgs[key] = fromArgs[key];\r\n }\r\n }\r\n }\r\n return toArgs\r\n } else if (isFn(fromArgs)) {\r\n fromArgs = processCallback(methodName, fromArgs, returnValue);\r\n }\r\n return fromArgs\r\n}\r\n\r\nfunction processReturnValue (methodName, res, returnValue, keepReturnValue = false) {\r\n if (isFn(protocols.returnValue)) { // 处理通用 returnValue\r\n res = protocols.returnValue(methodName, res);\r\n }\r\n return processArgs(methodName, res, returnValue, {}, keepReturnValue)\r\n}\r\n\r\nfunction wrapper (methodName, method) {\r\n if (hasOwn(protocols, methodName)) {\r\n const protocol = protocols[methodName];\r\n if (!protocol) { // 暂不支持的 api\r\n return function () {\r\n console.error(`Platform '微信小程序' does not support '${methodName}'.`);\r\n }\r\n }\r\n return function (arg1, arg2) { // 目前 api 最多两个参数\r\n let options = protocol;\r\n if (isFn(protocol)) {\r\n options = protocol(arg1);\r\n }\r\n\r\n arg1 = processArgs(methodName, arg1, options.args, options.returnValue);\r\n\r\n const args = [arg1];\r\n if (typeof arg2 !== 'undefined') {\r\n args.push(arg2);\r\n }\r\n if (isFn(options.name)) {\r\n methodName = options.name(arg1);\r\n } else if (isStr(options.name)) {\r\n methodName = options.name;\r\n }\r\n const returnValue = wx[methodName].apply(wx, args);\r\n if (isSyncApi(methodName)) { // 同步 api\r\n return processReturnValue(methodName, returnValue, options.returnValue, isContextApi(methodName))\r\n }\r\n return returnValue\r\n }\r\n }\r\n return method\r\n}\r\n\r\nconst todoApis = Object.create(null);\r\n\r\nconst TODOS = [\r\n 'onTabBarMidButtonTap',\r\n 'subscribePush',\r\n 'unsubscribePush',\r\n 'onPush',\r\n 'offPush',\r\n 'share'\r\n];\r\n\r\nfunction createTodoApi (name) {\r\n return function todoApi ({\r\n fail,\r\n complete\r\n }) {\r\n const res = {\r\n errMsg: `${name}:fail method '${name}' not supported`\r\n };\r\n isFn(fail) && fail(res);\r\n isFn(complete) && complete(res);\r\n }\r\n}\r\n\r\nTODOS.forEach(function (name) {\r\n todoApis[name] = createTodoApi(name);\r\n});\r\n\r\nvar providers = {\r\n oauth: ['weixin'],\r\n share: ['weixin'],\r\n payment: ['wxpay'],\r\n push: ['weixin']\r\n};\r\n\r\nfunction getProvider ({\r\n service,\r\n success,\r\n fail,\r\n complete\r\n}) {\r\n let res = false;\r\n if (providers[service]) {\r\n res = {\r\n errMsg: 'getProvider:ok',\r\n service,\r\n provider: providers[service]\r\n };\r\n isFn(success) && success(res);\r\n } else {\r\n res = {\r\n errMsg: 'getProvider:fail service not found'\r\n };\r\n isFn(fail) && fail(res);\r\n }\r\n isFn(complete) && complete(res);\r\n}\r\n\r\nvar extraApi = /*#__PURE__*/Object.freeze({\r\n __proto__: null,\r\n getProvider: getProvider\r\n});\r\n\r\nconst getEmitter = (function () {\r\n let Emitter;\r\n return function getUniEmitter () {\r\n if (!Emitter) {\r\n Emitter = new Vue();\r\n }\r\n return Emitter\r\n }\r\n})();\r\n\r\nfunction apply (ctx, method, args) {\r\n return ctx[method].apply(ctx, args)\r\n}\r\n\r\nfunction $on () {\r\n return apply(getEmitter(), '$on', [...arguments])\r\n}\r\nfunction $off () {\r\n return apply(getEmitter(), '$off', [...arguments])\r\n}\r\nfunction $once () {\r\n return apply(getEmitter(), '$once', [...arguments])\r\n}\r\nfunction $emit () {\r\n return apply(getEmitter(), '$emit', [...arguments])\r\n}\r\n\r\nvar eventApi = /*#__PURE__*/Object.freeze({\r\n __proto__: null,\r\n $on: $on,\r\n $off: $off,\r\n $once: $once,\r\n $emit: $emit\r\n});\r\n\r\n/**\r\n * 框架内 try-catch\r\n */\r\n/**\r\n * 开发者 try-catch\r\n */\r\nfunction tryCatch (fn) {\r\n return function () {\r\n try {\r\n return fn.apply(fn, arguments)\r\n } catch (e) {\r\n // TODO\r\n console.error(e);\r\n }\r\n }\r\n}\r\n\r\nfunction getApiCallbacks (params) {\r\n const apiCallbacks = {};\r\n for (const name in params) {\r\n const param = params[name];\r\n if (isFn(param)) {\r\n apiCallbacks[name] = tryCatch(param);\r\n delete params[name];\r\n }\r\n }\r\n return apiCallbacks\r\n}\r\n\r\nlet cid;\r\nlet cidErrMsg;\r\nlet enabled;\r\n\r\nfunction normalizePushMessage (message) {\r\n try {\r\n return JSON.parse(message)\r\n } catch (e) {}\r\n return message\r\n}\r\n\r\nfunction invokePushCallback (\r\n args\r\n) {\r\n if (args.type === 'enabled') {\r\n enabled = true;\r\n } else if (args.type === 'clientId') {\r\n cid = args.cid;\r\n cidErrMsg = args.errMsg;\r\n invokeGetPushCidCallbacks(cid, args.errMsg);\r\n } else if (args.type === 'pushMsg') {\r\n const message = {\r\n type: 'receive',\r\n data: normalizePushMessage(args.message)\r\n };\r\n for (let i = 0; i < onPushMessageCallbacks.length; i++) {\r\n const callback = onPushMessageCallbacks[i];\r\n callback(message);\r\n // 该消息已被阻止\r\n if (message.stopped) {\r\n break\r\n }\r\n }\r\n } else if (args.type === 'click') {\r\n onPushMessageCallbacks.forEach((callback) => {\r\n callback({\r\n type: 'click',\r\n data: normalizePushMessage(args.message)\r\n });\r\n });\r\n }\r\n}\r\n\r\nconst getPushCidCallbacks = [];\r\n\r\nfunction invokeGetPushCidCallbacks (cid, errMsg) {\r\n getPushCidCallbacks.forEach((callback) => {\r\n callback(cid, errMsg);\r\n });\r\n getPushCidCallbacks.length = 0;\r\n}\r\n\r\nfunction getPushClientId (args) {\r\n if (!isPlainObject(args)) {\r\n args = {};\r\n }\r\n const {\r\n success,\r\n fail,\r\n complete\r\n } = getApiCallbacks(args);\r\n const hasSuccess = isFn(success);\r\n const hasFail = isFn(fail);\r\n const hasComplete = isFn(complete);\r\n\r\n Promise.resolve().then(() => {\r\n if (typeof enabled === 'undefined') {\r\n enabled = false;\r\n cid = '';\r\n cidErrMsg = 'uniPush is not enabled';\r\n }\r\n getPushCidCallbacks.push((cid, errMsg) => {\r\n let res;\r\n if (cid) {\r\n res = {\r\n errMsg: 'getPushClientId:ok',\r\n cid\r\n };\r\n hasSuccess && success(res);\r\n } else {\r\n res = {\r\n errMsg: 'getPushClientId:fail' + (errMsg ? ' ' + errMsg : '')\r\n };\r\n hasFail && fail(res);\r\n }\r\n hasComplete && complete(res);\r\n });\r\n if (typeof cid !== 'undefined') {\r\n invokeGetPushCidCallbacks(cid, cidErrMsg);\r\n }\r\n });\r\n}\r\n\r\nconst onPushMessageCallbacks = [];\r\n// 不使用 defineOnApi 实现,是因为 defineOnApi 依赖 UniServiceJSBridge ,该对象目前在小程序上未提供,故简单实现\r\nconst onPushMessage = (fn) => {\r\n if (onPushMessageCallbacks.indexOf(fn) === -1) {\r\n onPushMessageCallbacks.push(fn);\r\n }\r\n};\r\n\r\nconst offPushMessage = (fn) => {\r\n if (!fn) {\r\n onPushMessageCallbacks.length = 0;\r\n } else {\r\n const index = onPushMessageCallbacks.indexOf(fn);\r\n if (index > -1) {\r\n onPushMessageCallbacks.splice(index, 1);\r\n }\r\n }\r\n};\r\n\r\nlet baseInfo = wx.getAppBaseInfo && wx.getAppBaseInfo();\r\nif (!baseInfo) {\r\n baseInfo = wx.getSystemInfoSync();\r\n}\r\nconst host = baseInfo ? baseInfo.host : null;\r\nconst shareVideoMessage =\r\n host && host.env === 'SAAASDK' ? wx.miniapp.shareVideoMessage : wx.shareVideoMessage;\r\n\r\nvar api = /*#__PURE__*/Object.freeze({\r\n __proto__: null,\r\n shareVideoMessage: shareVideoMessage,\r\n getPushClientId: getPushClientId,\r\n onPushMessage: onPushMessage,\r\n offPushMessage: offPushMessage,\r\n invokePushCallback: invokePushCallback\r\n});\r\n\r\nconst mocks = ['__route__', '__wxExparserNodeId__', '__wxWebviewId__'];\r\n\r\nfunction findVmByVueId (vm, vuePid) {\r\n const $children = vm.$children;\r\n // 优先查找直属(反向查找:https://github.com/dcloudio/uni-app/issues/1200)\r\n for (let i = $children.length - 1; i >= 0; i--) {\r\n const childVm = $children[i];\r\n if (childVm.$scope._$vueId === vuePid) {\r\n return childVm\r\n }\r\n }\r\n // 反向递归查找\r\n let parentVm;\r\n for (let i = $children.length - 1; i >= 0; i--) {\r\n parentVm = findVmByVueId($children[i], vuePid);\r\n if (parentVm) {\r\n return parentVm\r\n }\r\n }\r\n}\r\n\r\nfunction initBehavior (options) {\r\n return Behavior(options)\r\n}\r\n\r\nfunction isPage () {\r\n return !!this.route\r\n}\r\n\r\nfunction initRelation (detail) {\r\n this.triggerEvent('__l', detail);\r\n}\r\n\r\nfunction selectAllComponents (mpInstance, selector, $refs) {\r\n const components = mpInstance.selectAllComponents(selector) || [];\r\n components.forEach(component => {\r\n const ref = component.dataset.ref;\r\n $refs[ref] = component.$vm || toSkip(component);\r\n {\r\n if (component.dataset.vueGeneric === 'scoped') {\r\n component.selectAllComponents('.scoped-ref').forEach(scopedComponent => {\r\n selectAllComponents(scopedComponent, selector, $refs);\r\n });\r\n }\r\n }\r\n });\r\n}\r\n\r\nfunction syncRefs (refs, newRefs) {\r\n const oldKeys = new Set(...Object.keys(refs));\r\n const newKeys = Object.keys(newRefs);\r\n newKeys.forEach(key => {\r\n const oldValue = refs[key];\r\n const newValue = newRefs[key];\r\n if (Array.isArray(oldValue) && Array.isArray(newValue) && oldValue.length === newValue.length && newValue.every(value => oldValue.includes(value))) {\r\n return\r\n }\r\n refs[key] = newValue;\r\n oldKeys.delete(key);\r\n });\r\n oldKeys.forEach(key => {\r\n delete refs[key];\r\n });\r\n return refs\r\n}\r\n\r\nfunction initRefs (vm) {\r\n const mpInstance = vm.$scope;\r\n const refs = {};\r\n Object.defineProperty(vm, '$refs', {\r\n get () {\r\n const $refs = {};\r\n selectAllComponents(mpInstance, '.vue-ref', $refs);\r\n // TODO 暂不考虑 for 中的 scoped\r\n const forComponents = mpInstance.selectAllComponents('.vue-ref-in-for') || [];\r\n forComponents.forEach(component => {\r\n const ref = component.dataset.ref;\r\n if (!$refs[ref]) {\r\n $refs[ref] = [];\r\n }\r\n $refs[ref].push(component.$vm || toSkip(component));\r\n });\r\n return syncRefs(refs, $refs)\r\n }\r\n });\r\n}\r\n\r\nfunction handleLink (event) {\r\n const {\r\n vuePid,\r\n vueOptions\r\n } = event.detail || event.value; // detail 是微信,value 是百度(dipatch)\r\n\r\n let parentVm;\r\n\r\n if (vuePid) {\r\n parentVm = findVmByVueId(this.$vm, vuePid);\r\n }\r\n\r\n if (!parentVm) {\r\n parentVm = this.$vm;\r\n }\r\n\r\n vueOptions.parent = parentVm;\r\n}\r\n\r\nfunction markMPComponent (component) {\r\n // 在 Vue 中标记为小程序组件\r\n const IS_MP = '__v_isMPComponent';\r\n Object.defineProperty(component, IS_MP, {\r\n configurable: true,\r\n enumerable: false,\r\n value: true\r\n });\r\n return component\r\n}\r\n\r\nfunction toSkip (obj) {\r\n const OB = '__ob__';\r\n const SKIP = '__v_skip';\r\n if (isObject(obj) && Object.isExtensible(obj)) {\r\n // 避免被 @vue/composition-api 观测\r\n Object.defineProperty(obj, OB, {\r\n configurable: true,\r\n enumerable: false,\r\n value: {\r\n [SKIP]: true\r\n }\r\n });\r\n }\r\n return obj\r\n}\r\n\r\nconst WORKLET_RE = /_(.*)_worklet_factory_/;\r\nfunction initWorkletMethods (mpMethods, vueMethods) {\r\n if (vueMethods) {\r\n Object.keys(vueMethods).forEach((name) => {\r\n const matches = name.match(WORKLET_RE);\r\n if (matches) {\r\n const workletName = matches[1];\r\n mpMethods[name] = vueMethods[name];\r\n mpMethods[workletName] = vueMethods[workletName];\r\n }\r\n });\r\n }\r\n}\r\n\r\nconst MPPage = Page;\r\nconst MPComponent = Component;\r\n\r\nconst customizeRE = /:/g;\r\n\r\nconst customize = cached((str) => {\r\n return camelize(str.replace(customizeRE, '-'))\r\n});\r\n\r\nfunction initTriggerEvent (mpInstance) {\r\n const oldTriggerEvent = mpInstance.triggerEvent;\r\n const newTriggerEvent = function (event, ...args) {\r\n // 事件名统一转驼峰格式,仅处理:当前组件为 vue 组件、当前组件为 vue 组件子组件\r\n if (this.$vm || (this.dataset && this.dataset.comType)) {\r\n event = customize(event);\r\n } else {\r\n // 针对微信/QQ小程序单独补充驼峰格式事件,以兼容历史项目\r\n const newEvent = customize(event);\r\n if (newEvent !== event) {\r\n oldTriggerEvent.apply(this, [newEvent, ...args]);\r\n }\r\n }\r\n return oldTriggerEvent.apply(this, [event, ...args])\r\n };\r\n try {\r\n // 京东小程序 triggerEvent 为只读\r\n mpInstance.triggerEvent = newTriggerEvent;\r\n } catch (error) {\r\n mpInstance._triggerEvent = newTriggerEvent;\r\n }\r\n}\r\n\r\nfunction initHook (name, options, isComponent) {\r\n const oldHook = options[name];\r\n options[name] = function (...args) {\r\n markMPComponent(this);\r\n initTriggerEvent(this);\r\n if (oldHook) {\r\n return oldHook.apply(this, args)\r\n }\r\n };\r\n}\r\nif (!MPPage.__$wrappered) {\r\n MPPage.__$wrappered = true;\r\n Page = function (options = {}) {\r\n initHook('onLoad', options);\r\n return MPPage(options)\r\n };\r\n Page.after = MPPage.after;\r\n\r\n Component = function (options = {}) {\r\n initHook('created', options);\r\n return MPComponent(options)\r\n };\r\n}\r\n\r\nconst PAGE_EVENT_HOOKS = [\r\n 'onPullDownRefresh',\r\n 'onReachBottom',\r\n 'onAddToFavorites',\r\n 'onShareTimeline',\r\n 'onShareAppMessage',\r\n 'onPageScroll',\r\n 'onResize',\r\n 'onTabItemTap'\r\n];\r\n\r\nfunction initMocks (vm, mocks) {\r\n const mpInstance = vm.$mp[vm.mpType];\r\n mocks.forEach(mock => {\r\n if (hasOwn(mpInstance, mock)) {\r\n vm[mock] = mpInstance[mock];\r\n }\r\n });\r\n}\r\n\r\nfunction hasHook (hook, vueOptions) {\r\n if (!vueOptions) {\r\n return true\r\n }\r\n\r\n if (Vue.options && Array.isArray(Vue.options[hook])) {\r\n return true\r\n }\r\n\r\n vueOptions = vueOptions.default || vueOptions;\r\n\r\n if (isFn(vueOptions)) {\r\n if (isFn(vueOptions.extendOptions[hook])) {\r\n return true\r\n }\r\n if (vueOptions.super &&\r\n vueOptions.super.options &&\r\n Array.isArray(vueOptions.super.options[hook])) {\r\n return true\r\n }\r\n return false\r\n }\r\n\r\n if (isFn(vueOptions[hook]) || Array.isArray(vueOptions[hook])) {\r\n return true\r\n }\r\n const mixins = vueOptions.mixins;\r\n if (Array.isArray(mixins)) {\r\n return !!mixins.find(mixin => hasHook(hook, mixin))\r\n }\r\n}\r\n\r\nfunction initHooks (mpOptions, hooks, vueOptions) {\r\n hooks.forEach(hook => {\r\n if (hasHook(hook, vueOptions)) {\r\n mpOptions[hook] = function (args) {\r\n return this.$vm && this.$vm.__call_hook(hook, args)\r\n };\r\n }\r\n });\r\n}\r\n\r\nfunction initUnknownHooks (mpOptions, vueOptions, excludes = []) {\r\n findHooks(vueOptions).forEach((hook) => initHook$1(mpOptions, hook, excludes));\r\n}\r\n\r\nfunction findHooks (vueOptions, hooks = []) {\r\n if (vueOptions) {\r\n Object.keys(vueOptions).forEach((name) => {\r\n if (name.indexOf('on') === 0 && isFn(vueOptions[name])) {\r\n hooks.push(name);\r\n }\r\n });\r\n }\r\n return hooks\r\n}\r\n\r\nfunction initHook$1 (mpOptions, hook, excludes) {\r\n if (excludes.indexOf(hook) === -1 && !hasOwn(mpOptions, hook)) {\r\n mpOptions[hook] = function (args) {\r\n return this.$vm && this.$vm.__call_hook(hook, args)\r\n };\r\n }\r\n}\r\n\r\nfunction initVueComponent (Vue, vueOptions) {\r\n vueOptions = vueOptions.default || vueOptions;\r\n let VueComponent;\r\n if (isFn(vueOptions)) {\r\n VueComponent = vueOptions;\r\n } else {\r\n VueComponent = Vue.extend(vueOptions);\r\n }\r\n vueOptions = VueComponent.options;\r\n return [VueComponent, vueOptions]\r\n}\r\n\r\nfunction initSlots (vm, vueSlots) {\r\n if (Array.isArray(vueSlots) && vueSlots.length) {\r\n const $slots = Object.create(null);\r\n vueSlots.forEach(slotName => {\r\n $slots[slotName] = true;\r\n });\r\n vm.$scopedSlots = vm.$slots = $slots;\r\n }\r\n}\r\n\r\nfunction initVueIds (vueIds, mpInstance) {\r\n vueIds = (vueIds || '').split(',');\r\n const len = vueIds.length;\r\n\r\n if (len === 1) {\r\n mpInstance._$vueId = vueIds[0];\r\n } else if (len === 2) {\r\n mpInstance._$vueId = vueIds[0];\r\n mpInstance._$vuePid = vueIds[1];\r\n }\r\n}\r\n\r\nfunction initData (vueOptions, context) {\r\n let data = vueOptions.data || {};\r\n const methods = vueOptions.methods || {};\r\n\r\n if (typeof data === 'function') {\r\n try {\r\n data = data.call(context); // 支持 Vue.prototype 上挂的数据\r\n } catch (e) {\r\n if (process.env.VUE_APP_DEBUG) {\r\n console.warn('根据 Vue 的 data 函数初始化小程序 data 失败,请尽量确保 data 函数中不访问 vm 对象,否则可能影响首次数据渲染速度。', data);\r\n }\r\n }\r\n } else {\r\n try {\r\n // 对 data 格式化\r\n data = JSON.parse(JSON.stringify(data));\r\n } catch (e) { }\r\n }\r\n\r\n if (!isPlainObject(data)) {\r\n data = {};\r\n }\r\n\r\n Object.keys(methods).forEach(methodName => {\r\n if (context.__lifecycle_hooks__.indexOf(methodName) === -1 && !hasOwn(data, methodName)) {\r\n data[methodName] = methods[methodName];\r\n }\r\n });\r\n\r\n return data\r\n}\r\n\r\nconst PROP_TYPES = [String, Number, Boolean, Object, Array, null];\r\n\r\nfunction createObserver (name) {\r\n return function observer (newVal, oldVal) {\r\n if (this.$vm) {\r\n this.$vm[name] = newVal; // 为了触发其他非 render watcher\r\n }\r\n }\r\n}\r\n\r\nfunction initBehaviors (vueOptions, initBehavior) {\r\n const vueBehaviors = vueOptions.behaviors;\r\n const vueExtends = vueOptions.extends;\r\n const vueMixins = vueOptions.mixins;\r\n\r\n let vueProps = vueOptions.props;\r\n\r\n if (!vueProps) {\r\n vueOptions.props = vueProps = [];\r\n }\r\n\r\n const behaviors = [];\r\n if (Array.isArray(vueBehaviors)) {\r\n vueBehaviors.forEach(behavior => {\r\n behaviors.push(behavior.replace('uni://', `${\"wx\"}://`));\r\n if (behavior === 'uni://form-field') {\r\n if (Array.isArray(vueProps)) {\r\n vueProps.push('name');\r\n vueProps.push('value');\r\n } else {\r\n vueProps.name = {\r\n type: String,\r\n default: ''\r\n };\r\n vueProps.value = {\r\n type: [String, Number, Boolean, Array, Object, Date],\r\n default: ''\r\n };\r\n }\r\n }\r\n });\r\n }\r\n if (isPlainObject(vueExtends) && vueExtends.props) {\r\n behaviors.push(\r\n initBehavior({\r\n properties: initProperties(vueExtends.props, true)\r\n })\r\n );\r\n }\r\n if (Array.isArray(vueMixins)) {\r\n vueMixins.forEach(vueMixin => {\r\n if (isPlainObject(vueMixin) && vueMixin.props) {\r\n behaviors.push(\r\n initBehavior({\r\n properties: initProperties(vueMixin.props, true)\r\n })\r\n );\r\n }\r\n });\r\n }\r\n return behaviors\r\n}\r\n\r\nfunction parsePropType (key, type, defaultValue, file) {\r\n // [String]=>String\r\n if (Array.isArray(type) && type.length === 1) {\r\n return type[0]\r\n }\r\n return type\r\n}\r\n\r\nfunction initProperties (props, isBehavior = false, file = '', options) {\r\n const properties = {};\r\n if (!isBehavior) {\r\n properties.vueId = {\r\n type: String,\r\n value: ''\r\n };\r\n {\r\n if ( options.virtualHost) {\r\n properties.virtualHostStyle = {\r\n type: null,\r\n value: ''\r\n };\r\n properties.virtualHostClass = {\r\n type: null,\r\n value: ''\r\n };\r\n }\r\n }\r\n // scopedSlotsCompiler auto\r\n properties.scopedSlotsCompiler = {\r\n type: String,\r\n value: ''\r\n };\r\n properties.vueSlots = { // 小程序不能直接定义 $slots 的 props,所以通过 vueSlots 转换到 $slots\r\n type: null,\r\n value: [],\r\n observer: function (newVal, oldVal) {\r\n const $slots = Object.create(null);\r\n newVal.forEach(slotName => {\r\n $slots[slotName] = true;\r\n });\r\n this.setData({\r\n $slots\r\n });\r\n }\r\n };\r\n }\r\n if (Array.isArray(props)) { // ['title']\r\n props.forEach(key => {\r\n properties[key] = {\r\n type: null,\r\n observer: createObserver(key)\r\n };\r\n });\r\n } else if (isPlainObject(props)) { // {title:{type:String,default:''},content:String}\r\n Object.keys(props).forEach(key => {\r\n const opts = props[key];\r\n if (isPlainObject(opts)) { // title:{type:String,default:''}\r\n let value = opts.default;\r\n if (isFn(value)) {\r\n value = value();\r\n }\r\n\r\n opts.type = parsePropType(key, opts.type);\r\n\r\n properties[key] = {\r\n type: PROP_TYPES.indexOf(opts.type) !== -1 ? opts.type : null,\r\n value,\r\n observer: createObserver(key)\r\n };\r\n } else { // content:String\r\n const type = parsePropType(key, opts);\r\n properties[key] = {\r\n type: PROP_TYPES.indexOf(type) !== -1 ? type : null,\r\n observer: createObserver(key)\r\n };\r\n }\r\n });\r\n }\r\n return properties\r\n}\r\n\r\nfunction wrapper$1 (event) {\r\n // TODO 又得兼容 mpvue 的 mp 对象\r\n try {\r\n event.mp = JSON.parse(JSON.stringify(event));\r\n } catch (e) { }\r\n\r\n event.stopPropagation = noop;\r\n event.preventDefault = noop;\r\n\r\n event.target = event.target || {};\r\n\r\n if (!hasOwn(event, 'detail')) {\r\n event.detail = {};\r\n }\r\n\r\n if (hasOwn(event, 'markerId')) {\r\n event.detail = typeof event.detail === 'object' ? event.detail : {};\r\n event.detail.markerId = event.markerId;\r\n }\r\n\r\n if (isPlainObject(event.detail)) {\r\n event.target = Object.assign({}, event.target, event.detail);\r\n }\r\n\r\n return event\r\n}\r\n\r\nfunction getExtraValue (vm, dataPathsArray) {\r\n let context = vm;\r\n dataPathsArray.forEach(dataPathArray => {\r\n const dataPath = dataPathArray[0];\r\n const value = dataPathArray[2];\r\n if (dataPath || typeof value !== 'undefined') { // ['','',index,'disable']\r\n const propPath = dataPathArray[1];\r\n const valuePath = dataPathArray[3];\r\n\r\n let vFor;\r\n if (Number.isInteger(dataPath)) {\r\n vFor = dataPath;\r\n } else if (!dataPath) {\r\n vFor = context;\r\n } else if (typeof dataPath === 'string' && dataPath) {\r\n if (dataPath.indexOf('#s#') === 0) {\r\n vFor = dataPath.substr(3);\r\n } else {\r\n vFor = vm.__get_value(dataPath, context);\r\n }\r\n }\r\n\r\n if (Number.isInteger(vFor)) {\r\n context = value;\r\n } else if (!propPath) {\r\n context = vFor[value];\r\n } else {\r\n if (Array.isArray(vFor)) {\r\n context = vFor.find(vForItem => {\r\n return vm.__get_value(propPath, vForItem) === value\r\n });\r\n } else if (isPlainObject(vFor)) {\r\n context = Object.keys(vFor).find(vForKey => {\r\n return vm.__get_value(propPath, vFor[vForKey]) === value\r\n });\r\n } else {\r\n console.error('v-for 暂不支持循环数据:', vFor);\r\n }\r\n }\r\n\r\n if (valuePath) {\r\n context = vm.__get_value(valuePath, context);\r\n }\r\n }\r\n });\r\n return context\r\n}\r\n\r\nfunction processEventExtra (vm, extra, event, __args__) {\r\n const extraObj = {};\r\n\r\n if (Array.isArray(extra) && extra.length) {\r\n /**\r\n *[\r\n * ['data.items', 'data.id', item.data.id],\r\n * ['metas', 'id', meta.id]\r\n *],\r\n *[\r\n * ['data.items', 'data.id', item.data.id],\r\n * ['metas', 'id', meta.id]\r\n *],\r\n *'test'\r\n */\r\n extra.forEach((dataPath, index) => {\r\n if (typeof dataPath === 'string') {\r\n if (!dataPath) { // model,prop.sync\r\n extraObj['$' + index] = vm;\r\n } else {\r\n if (dataPath === '$event') { // $event\r\n extraObj['$' + index] = event;\r\n } else if (dataPath === 'arguments') {\r\n extraObj['$' + index] = event.detail ? event.detail.__args__ || __args__ : __args__;\r\n } else if (dataPath.indexOf('$event.') === 0) { // $event.target.value\r\n extraObj['$' + index] = vm.__get_value(dataPath.replace('$event.', ''), event);\r\n } else {\r\n extraObj['$' + index] = vm.__get_value(dataPath);\r\n }\r\n }\r\n } else {\r\n extraObj['$' + index] = getExtraValue(vm, dataPath);\r\n }\r\n });\r\n }\r\n\r\n return extraObj\r\n}\r\n\r\nfunction getObjByArray (arr) {\r\n const obj = {};\r\n for (let i = 1; i < arr.length; i++) {\r\n const element = arr[i];\r\n obj[element[0]] = element[1];\r\n }\r\n return obj\r\n}\r\n\r\nfunction processEventArgs (vm, event, args = [], extra = [], isCustom, methodName) {\r\n let isCustomMPEvent = false; // wxcomponent 组件,传递原始 event 对象\r\n\r\n // fixed 用户直接触发 mpInstance.triggerEvent\r\n const __args__ = isPlainObject(event.detail)\r\n ? event.detail.__args__ || [event.detail]\r\n : [event.detail];\r\n\r\n if (isCustom) { // 自定义事件\r\n isCustomMPEvent = event.currentTarget &&\r\n event.currentTarget.dataset &&\r\n event.currentTarget.dataset.comType === 'wx';\r\n if (!args.length) { // 无参数,直接传入 event 或 detail 数组\r\n if (isCustomMPEvent) {\r\n return [event]\r\n }\r\n return __args__\r\n }\r\n }\r\n\r\n const extraObj = processEventExtra(vm, extra, event, __args__);\r\n\r\n const ret = [];\r\n args.forEach(arg => {\r\n if (arg === '$event') {\r\n if (methodName === '__set_model' && !isCustom) { // input v-model value\r\n ret.push(event.target.value);\r\n } else {\r\n if (isCustom && !isCustomMPEvent) {\r\n ret.push(__args__[0]);\r\n } else { // wxcomponent 组件或内置组件\r\n ret.push(event);\r\n }\r\n }\r\n } else {\r\n if (Array.isArray(arg) && arg[0] === 'o') {\r\n ret.push(getObjByArray(arg));\r\n } else if (typeof arg === 'string' && hasOwn(extraObj, arg)) {\r\n ret.push(extraObj[arg]);\r\n } else {\r\n ret.push(arg);\r\n }\r\n }\r\n });\r\n\r\n return ret\r\n}\r\n\r\nconst ONCE = '~';\r\nconst CUSTOM = '^';\r\n\r\nfunction isMatchEventType (eventType, optType) {\r\n return (eventType === optType) ||\r\n (\r\n optType === 'regionchange' &&\r\n (\r\n eventType === 'begin' ||\r\n eventType === 'end'\r\n )\r\n )\r\n}\r\n\r\nfunction getContextVm (vm) {\r\n let $parent = vm.$parent;\r\n // 父组件是 scoped slots 或者其他自定义组件时继续查找\r\n while ($parent && $parent.$parent && ($parent.$options.generic || $parent.$parent.$options.generic || $parent.$scope._$vuePid)) {\r\n $parent = $parent.$parent;\r\n }\r\n return $parent && $parent.$parent\r\n}\r\n\r\nfunction handleEvent (event) {\r\n event = wrapper$1(event);\r\n\r\n // [['tap',[['handle',[1,2,a]],['handle1',[1,2,a]]]]]\r\n const dataset = (event.currentTarget || event.target).dataset;\r\n if (!dataset) {\r\n return console.warn('事件信息不存在')\r\n }\r\n const eventOpts = dataset.eventOpts || dataset['event-opts']; // 支付宝 web-view 组件 dataset 非驼峰\r\n if (!eventOpts) {\r\n return console.warn('事件信息不存在')\r\n }\r\n\r\n // [['handle',[1,2,a]],['handle1',[1,2,a]]]\r\n const eventType = event.type;\r\n\r\n const ret = [];\r\n\r\n eventOpts.forEach(eventOpt => {\r\n let type = eventOpt[0];\r\n const eventsArray = eventOpt[1];\r\n\r\n const isCustom = type.charAt(0) === CUSTOM;\r\n type = isCustom ? type.slice(1) : type;\r\n const isOnce = type.charAt(0) === ONCE;\r\n type = isOnce ? type.slice(1) : type;\r\n\r\n if (eventsArray && isMatchEventType(eventType, type)) {\r\n eventsArray.forEach(eventArray => {\r\n const methodName = eventArray[0];\r\n if (methodName) {\r\n let handlerCtx = this.$vm;\r\n if (handlerCtx.$options.generic) { // mp-weixin,mp-toutiao 抽象节点模拟 scoped slots\r\n handlerCtx = getContextVm(handlerCtx) || handlerCtx;\r\n }\r\n if (methodName === '$emit') {\r\n handlerCtx.$emit.apply(handlerCtx,\r\n processEventArgs(\r\n this.$vm,\r\n event,\r\n eventArray[1],\r\n eventArray[2],\r\n isCustom,\r\n methodName\r\n ));\r\n return\r\n }\r\n const handler = handlerCtx[methodName];\r\n if (!isFn(handler)) {\r\n const type = this.$vm.mpType === 'page' ? 'Page' : 'Component';\r\n const path = this.route || this.is;\r\n throw new Error(`${type} \"${path}\" does not have a method \"${methodName}\"`)\r\n }\r\n if (isOnce) {\r\n if (handler.once) {\r\n return\r\n }\r\n handler.once = true;\r\n }\r\n let params = processEventArgs(\r\n this.$vm,\r\n event,\r\n eventArray[1],\r\n eventArray[2],\r\n isCustom,\r\n methodName\r\n );\r\n params = Array.isArray(params) ? params : [];\r\n // 参数尾部增加原始事件对象用于复杂表达式内获取额外数据\r\n if (/=\\s*\\S+\\.eventParams\\s*\\|\\|\\s*\\S+\\[['\"]event-params['\"]\\]/.test(handler.toString())) {\r\n // eslint-disable-next-line no-sparse-arrays\r\n params = params.concat([, , , , , , , , , , event]);\r\n }\r\n ret.push(handler.apply(handlerCtx, params));\r\n }\r\n });\r\n }\r\n });\r\n\r\n if (\r\n eventType === 'input' &&\r\n ret.length === 1 &&\r\n typeof ret[0] !== 'undefined'\r\n ) {\r\n return ret[0]\r\n }\r\n}\r\n\r\nconst eventChannels = {};\r\n\r\nfunction getEventChannel (id) {\r\n const eventChannel = eventChannels[id];\r\n delete eventChannels[id];\r\n return eventChannel\r\n}\r\n\r\nconst hooks = [\r\n 'onShow',\r\n 'onHide',\r\n 'onError',\r\n 'onPageNotFound',\r\n 'onThemeChange',\r\n 'onUnhandledRejection'\r\n];\r\n\r\nfunction initEventChannel () {\r\n Vue.prototype.getOpenerEventChannel = function () {\r\n // 微信小程序使用自身getOpenerEventChannel\r\n {\r\n return this.$scope.getOpenerEventChannel()\r\n }\r\n };\r\n const callHook = Vue.prototype.__call_hook;\r\n Vue.prototype.__call_hook = function (hook, args) {\r\n if (hook === 'onLoad' && args && args.__id__) {\r\n this.__eventChannel__ = getEventChannel(args.__id__);\r\n delete args.__id__;\r\n }\r\n return callHook.call(this, hook, args)\r\n };\r\n}\r\n\r\nfunction initScopedSlotsParams () {\r\n const center = {};\r\n const parents = {};\r\n\r\n function currentId (fn) {\r\n const vueIds = this.$options.propsData.vueId;\r\n if (vueIds) {\r\n const vueId = vueIds.split(',')[0];\r\n fn(vueId);\r\n }\r\n }\r\n\r\n Vue.prototype.$hasSSP = function (vueId) {\r\n const slot = center[vueId];\r\n if (!slot) {\r\n parents[vueId] = this;\r\n this.$on('hook:destroyed', () => {\r\n delete parents[vueId];\r\n });\r\n }\r\n return slot\r\n };\r\n\r\n Vue.prototype.$getSSP = function (vueId, name, needAll) {\r\n const slot = center[vueId];\r\n if (slot) {\r\n const params = slot[name] || [];\r\n if (needAll) {\r\n return params\r\n }\r\n return params[0]\r\n }\r\n };\r\n\r\n Vue.prototype.$setSSP = function (name, value) {\r\n let index = 0;\r\n currentId.call(this, vueId => {\r\n const slot = center[vueId];\r\n const params = slot[name] = slot[name] || [];\r\n params.push(value);\r\n index = params.length - 1;\r\n });\r\n return index\r\n };\r\n\r\n Vue.prototype.$initSSP = function () {\r\n currentId.call(this, vueId => {\r\n center[vueId] = {};\r\n });\r\n };\r\n\r\n Vue.prototype.$callSSP = function () {\r\n currentId.call(this, vueId => {\r\n if (parents[vueId]) {\r\n parents[vueId].$forceUpdate();\r\n }\r\n });\r\n };\r\n\r\n Vue.mixin({\r\n destroyed () {\r\n const propsData = this.$options.propsData;\r\n const vueId = propsData && propsData.vueId;\r\n if (vueId) {\r\n delete center[vueId];\r\n delete parents[vueId];\r\n }\r\n }\r\n });\r\n}\r\n\r\nfunction parseBaseApp (vm, {\r\n mocks,\r\n initRefs\r\n}) {\r\n initEventChannel();\r\n {\r\n initScopedSlotsParams();\r\n }\r\n if (vm.$options.store) {\r\n Vue.prototype.$store = vm.$options.store;\r\n }\r\n uniIdMixin(Vue);\r\n\r\n Vue.prototype.mpHost = \"mp-weixin\";\r\n\r\n Vue.mixin({\r\n beforeCreate () {\r\n if (!this.$options.mpType) {\r\n return\r\n }\r\n\r\n this.mpType = this.$options.mpType;\r\n\r\n this.$mp = {\r\n data: {},\r\n [this.mpType]: this.$options.mpInstance\r\n };\r\n\r\n this.$scope = this.$options.mpInstance;\r\n\r\n delete this.$options.mpType;\r\n delete this.$options.mpInstance;\r\n if (\r\n ( this.mpType === 'page') &&\r\n typeof getApp === 'function'\r\n ) { // hack vue-i18n\r\n const app = getApp();\r\n if (app.$vm && app.$vm.$i18n) {\r\n this._i18n = app.$vm.$i18n;\r\n }\r\n }\r\n if (this.mpType !== 'app') {\r\n initRefs(this);\r\n initMocks(this, mocks);\r\n }\r\n }\r\n });\r\n\r\n const appOptions = {\r\n onLaunch (args) {\r\n if (this.$vm) { // 已经初始化过了,主要是为了百度,百度 onShow 在 onLaunch 之前\r\n return\r\n }\r\n {\r\n if (wx.canIUse && !wx.canIUse('nextTick')) { // 事实 上2.2.3 即可,简单使用 2.3.0 的 nextTick 判断\r\n console.error('当前微信基础库版本过低,请将 微信开发者工具-详情-项目设置-调试基础库版本 更换为`2.3.0`以上');\r\n }\r\n }\r\n\r\n this.$vm = vm;\r\n\r\n this.$vm.$mp = {\r\n app: this\r\n };\r\n\r\n this.$vm.$scope = this;\r\n // vm 上也挂载 globalData\r\n this.$vm.globalData = this.globalData;\r\n\r\n this.$vm._isMounted = true;\r\n this.$vm.__call_hook('mounted', args);\r\n\r\n this.$vm.__call_hook('onLaunch', args);\r\n }\r\n };\r\n\r\n // 兼容旧版本 globalData\r\n appOptions.globalData = vm.$options.globalData || {};\r\n // 将 methods 中的方法挂在 getApp() 中\r\n const methods = vm.$options.methods;\r\n if (methods) {\r\n Object.keys(methods).forEach(name => {\r\n appOptions[name] = methods[name];\r\n });\r\n }\r\n\r\n initAppLocale(Vue, vm, normalizeLocale(wx.getSystemInfoSync().language) || LOCALE_EN);\r\n\r\n initHooks(appOptions, hooks);\r\n initUnknownHooks(appOptions, vm.$options);\r\n\r\n return appOptions\r\n}\r\n\r\nfunction parseApp (vm) {\r\n return parseBaseApp(vm, {\r\n mocks,\r\n initRefs\r\n })\r\n}\r\n\r\nfunction createApp (vm) {\r\n App(parseApp(vm));\r\n return vm\r\n}\r\n\r\nconst encodeReserveRE = /[!'()*]/g;\r\nconst encodeReserveReplacer = c => '%' + c.charCodeAt(0).toString(16);\r\nconst commaRE = /%2C/g;\r\n\r\n// fixed encodeURIComponent which is more conformant to RFC3986:\r\n// - escapes [!'()*]\r\n// - preserve commas\r\nconst encode = str => encodeURIComponent(str)\r\n .replace(encodeReserveRE, encodeReserveReplacer)\r\n .replace(commaRE, ',');\r\n\r\nfunction stringifyQuery (obj, encodeStr = encode) {\r\n const res = obj ? Object.keys(obj).map(key => {\r\n const val = obj[key];\r\n\r\n if (val === undefined) {\r\n return ''\r\n }\r\n\r\n if (val === null) {\r\n return encodeStr(key)\r\n }\r\n\r\n if (Array.isArray(val)) {\r\n const result = [];\r\n val.forEach(val2 => {\r\n if (val2 === undefined) {\r\n return\r\n }\r\n if (val2 === null) {\r\n result.push(encodeStr(key));\r\n } else {\r\n result.push(encodeStr(key) + '=' + encodeStr(val2));\r\n }\r\n });\r\n return result.join('&')\r\n }\r\n\r\n return encodeStr(key) + '=' + encodeStr(val)\r\n }).filter(x => x.length > 0).join('&') : null;\r\n return res ? `?${res}` : ''\r\n}\r\n\r\nfunction parseBaseComponent (vueComponentOptions, {\r\n isPage,\r\n initRelation\r\n} = {}, needVueOptions) {\r\n const [VueComponent, vueOptions] = initVueComponent(Vue, vueComponentOptions);\r\n\r\n const options = {\r\n multipleSlots: true,\r\n // styleIsolation: 'apply-shared',\r\n addGlobalClass: true,\r\n ...(vueOptions.options || {})\r\n };\r\n\r\n {\r\n // 微信 multipleSlots 部分情况有 bug,导致内容顺序错乱 如 u-list,提供覆盖选项\r\n if (vueOptions['mp-weixin'] && vueOptions['mp-weixin'].options) {\r\n Object.assign(options, vueOptions['mp-weixin'].options);\r\n }\r\n }\r\n\r\n const componentOptions = {\r\n options,\r\n data: initData(vueOptions, Vue.prototype),\r\n behaviors: initBehaviors(vueOptions, initBehavior),\r\n properties: initProperties(vueOptions.props, false, vueOptions.__file, options),\r\n lifetimes: {\r\n attached () {\r\n const properties = this.properties;\r\n\r\n const options = {\r\n mpType: isPage.call(this) ? 'page' : 'component',\r\n mpInstance: this,\r\n propsData: properties\r\n };\r\n\r\n initVueIds(properties.vueId, this);\r\n\r\n // 处理父子关系\r\n initRelation.call(this, {\r\n vuePid: this._$vuePid,\r\n vueOptions: options\r\n });\r\n\r\n // 初始化 vue 实例\r\n this.$vm = new VueComponent(options);\r\n\r\n // 处理$slots,$scopedSlots(暂不支持动态变化$slots)\r\n initSlots(this.$vm, properties.vueSlots);\r\n\r\n // 触发首次 setData\r\n this.$vm.$mount();\r\n },\r\n ready () {\r\n // 当组件 props 默认值为 true,初始化时传入 false 会导致 created,ready 触发, 但 attached 不触发\r\n // https://developers.weixin.qq.com/community/develop/doc/00066ae2844cc0f8eb883e2a557800\r\n if (this.$vm) {\r\n this.$vm._isMounted = true;\r\n this.$vm.__call_hook('mounted');\r\n this.$vm.__call_hook('onReady');\r\n }\r\n },\r\n detached () {\r\n this.$vm && this.$vm.$destroy();\r\n }\r\n },\r\n pageLifetimes: {\r\n show (args) {\r\n this.$vm && this.$vm.__call_hook('onPageShow', args);\r\n },\r\n hide () {\r\n this.$vm && this.$vm.__call_hook('onPageHide');\r\n },\r\n resize (size) {\r\n this.$vm && this.$vm.__call_hook('onPageResize', size);\r\n }\r\n },\r\n methods: {\r\n __l: handleLink,\r\n __e: handleEvent\r\n }\r\n };\r\n // externalClasses\r\n if (vueOptions.externalClasses) {\r\n componentOptions.externalClasses = vueOptions.externalClasses;\r\n }\r\n\r\n if (Array.isArray(vueOptions.wxsCallMethods)) {\r\n vueOptions.wxsCallMethods.forEach(callMethod => {\r\n componentOptions.methods[callMethod] = function (args) {\r\n return this.$vm[callMethod](args)\r\n };\r\n });\r\n }\r\n\r\n if (needVueOptions) {\r\n return [componentOptions, vueOptions, VueComponent]\r\n }\r\n if (isPage) {\r\n return componentOptions\r\n }\r\n return [componentOptions, VueComponent]\r\n}\r\n\r\nfunction parseComponent (vueComponentOptions, needVueOptions) {\r\n return parseBaseComponent(vueComponentOptions, {\r\n isPage,\r\n initRelation\r\n }, needVueOptions)\r\n}\r\n\r\nconst hooks$1 = [\r\n 'onShow',\r\n 'onHide',\r\n 'onUnload'\r\n];\r\n\r\nhooks$1.push(...PAGE_EVENT_HOOKS);\r\n\r\nfunction parseBasePage (vuePageOptions) {\r\n const [pageOptions, vueOptions] = parseComponent(vuePageOptions, true);\r\n\r\n initHooks(pageOptions.methods, hooks$1, vueOptions);\r\n\r\n pageOptions.methods.onLoad = function (query) {\r\n this.options = query;\r\n const copyQuery = Object.assign({}, query);\r\n delete copyQuery.__id__;\r\n this.$page = {\r\n fullPath: '/' + (this.route || this.is) + stringifyQuery(copyQuery)\r\n };\r\n this.$vm.$mp.query = query; // 兼容 mpvue\r\n this.$vm.__call_hook('onLoad', query);\r\n };\r\n {\r\n initUnknownHooks(pageOptions.methods, vuePageOptions, ['onReady']);\r\n }\r\n {\r\n initWorkletMethods(pageOptions.methods, vueOptions.methods);\r\n }\r\n\r\n return pageOptions\r\n}\r\n\r\nfunction parsePage (vuePageOptions) {\r\n return parseBasePage(vuePageOptions)\r\n}\r\n\r\nfunction createPage (vuePageOptions) {\r\n {\r\n return Component(parsePage(vuePageOptions))\r\n }\r\n}\r\n\r\nfunction createComponent (vueOptions) {\r\n {\r\n return Component(parseComponent(vueOptions))\r\n }\r\n}\r\n\r\nfunction createSubpackageApp (vm) {\r\n const appOptions = parseApp(vm);\r\n const app = getApp({\r\n allowDefault: true\r\n });\r\n vm.$scope = app;\r\n const globalData = app.globalData;\r\n if (globalData) {\r\n Object.keys(appOptions.globalData).forEach(name => {\r\n if (!hasOwn(globalData, name)) {\r\n globalData[name] = appOptions.globalData[name];\r\n }\r\n });\r\n }\r\n Object.keys(appOptions).forEach(name => {\r\n if (!hasOwn(app, name)) {\r\n app[name] = appOptions[name];\r\n }\r\n });\r\n if (isFn(appOptions.onShow) && wx.onAppShow) {\r\n wx.onAppShow((...args) => {\r\n vm.__call_hook('onShow', args);\r\n });\r\n }\r\n if (isFn(appOptions.onHide) && wx.onAppHide) {\r\n wx.onAppHide((...args) => {\r\n vm.__call_hook('onHide', args);\r\n });\r\n }\r\n if (isFn(appOptions.onLaunch)) {\r\n const args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();\r\n vm.__call_hook('onLaunch', args);\r\n }\r\n return vm\r\n}\r\n\r\nfunction createPlugin (vm) {\r\n const appOptions = parseApp(vm);\r\n if (isFn(appOptions.onShow) && wx.onAppShow) {\r\n wx.onAppShow((...args) => {\r\n vm.__call_hook('onShow', args);\r\n });\r\n }\r\n if (isFn(appOptions.onHide) && wx.onAppHide) {\r\n wx.onAppHide((...args) => {\r\n vm.__call_hook('onHide', args);\r\n });\r\n }\r\n if (isFn(appOptions.onLaunch)) {\r\n const args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();\r\n vm.__call_hook('onLaunch', args);\r\n }\r\n return vm\r\n}\r\n\r\ntodos.forEach(todoApi => {\r\n protocols[todoApi] = false;\r\n});\r\n\r\ncanIUses.forEach(canIUseApi => {\r\n const apiName = protocols[canIUseApi] && protocols[canIUseApi].name ? protocols[canIUseApi].name\r\n : canIUseApi;\r\n if (!wx.canIUse(apiName)) {\r\n protocols[canIUseApi] = false;\r\n }\r\n});\r\n\r\nlet uni = {};\r\n\r\nif (typeof Proxy !== 'undefined' && \"mp-weixin\" !== 'app-plus') {\r\n uni = new Proxy({}, {\r\n get (target, name) {\r\n if (hasOwn(target, name)) {\r\n return target[name]\r\n }\r\n if (baseApi[name]) {\r\n return baseApi[name]\r\n }\r\n if (api[name]) {\r\n return promisify(name, api[name])\r\n }\r\n {\r\n if (extraApi[name]) {\r\n return promisify(name, extraApi[name])\r\n }\r\n if (todoApis[name]) {\r\n return promisify(name, todoApis[name])\r\n }\r\n }\r\n if (eventApi[name]) {\r\n return eventApi[name]\r\n }\r\n return promisify(name, wrapper(name, wx[name]))\r\n },\r\n set (target, name, value) {\r\n target[name] = value;\r\n return true\r\n }\r\n });\r\n} else {\r\n Object.keys(baseApi).forEach(name => {\r\n uni[name] = baseApi[name];\r\n });\r\n\r\n {\r\n Object.keys(todoApis).forEach(name => {\r\n uni[name] = promisify(name, todoApis[name]);\r\n });\r\n Object.keys(extraApi).forEach(name => {\r\n uni[name] = promisify(name, extraApi[name]);\r\n });\r\n }\r\n\r\n Object.keys(eventApi).forEach(name => {\r\n uni[name] = eventApi[name];\r\n });\r\n\r\n Object.keys(api).forEach(name => {\r\n uni[name] = promisify(name, api[name]);\r\n });\r\n\r\n Object.keys(wx).forEach(name => {\r\n if (hasOwn(wx, name) || hasOwn(protocols, name)) {\r\n uni[name] = promisify(name, wrapper(name, wx[name]));\r\n }\r\n });\r\n}\r\n\r\nwx.createApp = createApp;\r\nwx.createPage = createPage;\r\nwx.createComponent = createComponent;\r\nwx.createSubpackageApp = createSubpackageApp;\r\nwx.createPlugin = createPlugin;\r\n\r\nvar uni$1 = uni;\r\n\r\nexport default uni$1;\r\nexport { createApp, createComponent, createPage, createPlugin, createSubpackageApp };\r\n","var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || new Function(\"return this\")();\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === \"object\") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n","function _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n \"default\": obj\n };\n}\nmodule.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var arrayWithHoles = require(\"./arrayWithHoles.js\");\nvar iterableToArrayLimit = require(\"./iterableToArrayLimit.js\");\nvar unsupportedIterableToArray = require(\"./unsupportedIterableToArray.js\");\nvar nonIterableRest = require(\"./nonIterableRest.js\");\nfunction _slicedToArray(arr, i) {\n return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();\n}\nmodule.exports = _slicedToArray, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}\nmodule.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _iterableToArrayLimit(r, l) {\n var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"];\n if (null != t) {\n var e,\n n,\n i,\n u,\n a = [],\n f = !0,\n o = !1;\n try {\n if (i = (t = t.call(r)).next, 0 === l) {\n if (Object(t) !== t) return;\n f = !1;\n } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);\n } catch (r) {\n o = !0, n = r;\n } finally {\n try {\n if (!f && null != t[\"return\"] && (u = t[\"return\"](), Object(u) !== u)) return;\n } finally {\n if (o) throw n;\n }\n }\n return a;\n }\n}\nmodule.exports = _iterableToArrayLimit, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var arrayLikeToArray = require(\"./arrayLikeToArray.js\");\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);\n}\nmodule.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n return arr2;\n}\nmodule.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\nmodule.exports = _nonIterableRest, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var toPropertyKey = require(\"./toPropertyKey.js\");\nfunction _defineProperty(obj, key, value) {\n key = toPropertyKey(key);\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}\nmodule.exports = _defineProperty, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var _typeof = require(\"./typeof.js\")[\"default\"];\nvar toPrimitive = require(\"./toPrimitive.js\");\nfunction toPropertyKey(t) {\n var i = toPrimitive(t, \"string\");\n return \"symbol\" == _typeof(i) ? i : i + \"\";\n}\nmodule.exports = toPropertyKey, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return (module.exports = _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports), _typeof(o);\n}\nmodule.exports = _typeof, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var _typeof = require(\"./typeof.js\")[\"default\"];\nfunction toPrimitive(t, r) {\n if (\"object\" != _typeof(t) || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != _typeof(i)) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}\nmodule.exports = toPrimitive, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var setPrototypeOf = require(\"./setPrototypeOf.js\");\nvar isNativeReflectConstruct = require(\"./isNativeReflectConstruct.js\");\nfunction _construct(t, e, r) {\n if (isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments);\n var o = [null];\n o.push.apply(o, e);\n var p = new (t.bind.apply(t, o))();\n return r && setPrototypeOf(p, r.prototype), p;\n}\nmodule.exports = _construct, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _setPrototypeOf(o, p) {\n module.exports = _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n return _setPrototypeOf(o, p);\n}\nmodule.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _isNativeReflectConstruct() {\n try {\n var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));\n } catch (t) {}\n return (module.exports = _isNativeReflectConstruct = function _isNativeReflectConstruct() {\n return !!t;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports)();\n}\nmodule.exports = _isNativeReflectConstruct, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var arrayWithoutHoles = require(\"./arrayWithoutHoles.js\");\nvar iterableToArray = require(\"./iterableToArray.js\");\nvar unsupportedIterableToArray = require(\"./unsupportedIterableToArray.js\");\nvar nonIterableSpread = require(\"./nonIterableSpread.js\");\nfunction _toConsumableArray(arr) {\n return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();\n}\nmodule.exports = _toConsumableArray, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var arrayLikeToArray = require(\"./arrayLikeToArray.js\");\nfunction _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) return arrayLikeToArray(arr);\n}\nmodule.exports = _arrayWithoutHoles, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _iterableToArray(iter) {\n if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter);\n}\nmodule.exports = _iterableToArray, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\nmodule.exports = _nonIterableSpread, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","const isObject = (val) => val !== null && typeof val === 'object';\nconst defaultDelimiters = ['{', '}'];\nclass BaseFormatter {\n constructor() {\n this._caches = Object.create(null);\n }\n interpolate(message, values, delimiters = defaultDelimiters) {\n if (!values) {\n return [message];\n }\n let tokens = this._caches[message];\n if (!tokens) {\n tokens = parse(message, delimiters);\n this._caches[message] = tokens;\n }\n return compile(tokens, values);\n }\n}\nconst RE_TOKEN_LIST_VALUE = /^(?:\\d)+/;\nconst RE_TOKEN_NAMED_VALUE = /^(?:\\w)+/;\nfunction parse(format, [startDelimiter, endDelimiter]) {\n const tokens = [];\n let position = 0;\n let text = '';\n while (position < format.length) {\n let char = format[position++];\n if (char === startDelimiter) {\n if (text) {\n tokens.push({ type: 'text', value: text });\n }\n text = '';\n let sub = '';\n char = format[position++];\n while (char !== undefined && char !== endDelimiter) {\n sub += char;\n char = format[position++];\n }\n const isClosed = char === endDelimiter;\n const type = RE_TOKEN_LIST_VALUE.test(sub)\n ? 'list'\n : isClosed && RE_TOKEN_NAMED_VALUE.test(sub)\n ? 'named'\n : 'unknown';\n tokens.push({ value: sub, type });\n }\n // else if (char === '%') {\n // // when found rails i18n syntax, skip text capture\n // if (format[position] !== '{') {\n // text += char\n // }\n // }\n else {\n text += char;\n }\n }\n text && tokens.push({ type: 'text', value: text });\n return tokens;\n}\nfunction compile(tokens, values) {\n const compiled = [];\n let index = 0;\n const mode = Array.isArray(values)\n ? 'list'\n : isObject(values)\n ? 'named'\n : 'unknown';\n if (mode === 'unknown') {\n return compiled;\n }\n while (index < tokens.length) {\n const token = tokens[index];\n switch (token.type) {\n case 'text':\n compiled.push(token.value);\n break;\n case 'list':\n compiled.push(values[parseInt(token.value, 10)]);\n break;\n case 'named':\n if (mode === 'named') {\n compiled.push(values[token.value]);\n }\n else {\n if (process.env.NODE_ENV !== 'production') {\n console.warn(`Type of token '${token.type}' and format of value '${mode}' don't match!`);\n }\n }\n break;\n case 'unknown':\n if (process.env.NODE_ENV !== 'production') {\n console.warn(`Detect 'unknown' type of token!`);\n }\n break;\n }\n index++;\n }\n return compiled;\n}\n\nconst LOCALE_ZH_HANS = 'zh-Hans';\nconst LOCALE_ZH_HANT = 'zh-Hant';\nconst LOCALE_EN = 'en';\nconst LOCALE_FR = 'fr';\nconst LOCALE_ES = 'es';\nconst hasOwnProperty = Object.prototype.hasOwnProperty;\nconst hasOwn = (val, key) => hasOwnProperty.call(val, key);\nconst defaultFormatter = new BaseFormatter();\nfunction include(str, parts) {\n return !!parts.find((part) => str.indexOf(part) !== -1);\n}\nfunction startsWith(str, parts) {\n return parts.find((part) => str.indexOf(part) === 0);\n}\nfunction normalizeLocale(locale, messages) {\n if (!locale) {\n return;\n }\n locale = locale.trim().replace(/_/g, '-');\n if (messages && messages[locale]) {\n return locale;\n }\n locale = locale.toLowerCase();\n if (locale === 'chinese') {\n // 支付宝\n return LOCALE_ZH_HANS;\n }\n if (locale.indexOf('zh') === 0) {\n if (locale.indexOf('-hans') > -1) {\n return LOCALE_ZH_HANS;\n }\n if (locale.indexOf('-hant') > -1) {\n return LOCALE_ZH_HANT;\n }\n if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) {\n return LOCALE_ZH_HANT;\n }\n return LOCALE_ZH_HANS;\n }\n let locales = [LOCALE_EN, LOCALE_FR, LOCALE_ES];\n if (messages && Object.keys(messages).length > 0) {\n locales = Object.keys(messages);\n }\n const lang = startsWith(locale, locales);\n if (lang) {\n return lang;\n }\n}\nclass I18n {\n constructor({ locale, fallbackLocale, messages, watcher, formater, }) {\n this.locale = LOCALE_EN;\n this.fallbackLocale = LOCALE_EN;\n this.message = {};\n this.messages = {};\n this.watchers = [];\n if (fallbackLocale) {\n this.fallbackLocale = fallbackLocale;\n }\n this.formater = formater || defaultFormatter;\n this.messages = messages || {};\n this.setLocale(locale || LOCALE_EN);\n if (watcher) {\n this.watchLocale(watcher);\n }\n }\n setLocale(locale) {\n const oldLocale = this.locale;\n this.locale = normalizeLocale(locale, this.messages) || this.fallbackLocale;\n if (!this.messages[this.locale]) {\n // 可能初始化时不存在\n this.messages[this.locale] = {};\n }\n this.message = this.messages[this.locale];\n // 仅发生变化时,通知\n if (oldLocale !== this.locale) {\n this.watchers.forEach((watcher) => {\n watcher(this.locale, oldLocale);\n });\n }\n }\n getLocale() {\n return this.locale;\n }\n watchLocale(fn) {\n const index = this.watchers.push(fn) - 1;\n return () => {\n this.watchers.splice(index, 1);\n };\n }\n add(locale, message, override = true) {\n const curMessages = this.messages[locale];\n if (curMessages) {\n if (override) {\n Object.assign(curMessages, message);\n }\n else {\n Object.keys(message).forEach((key) => {\n if (!hasOwn(curMessages, key)) {\n curMessages[key] = message[key];\n }\n });\n }\n }\n else {\n this.messages[locale] = message;\n }\n }\n f(message, values, delimiters) {\n return this.formater.interpolate(message, values, delimiters).join('');\n }\n t(key, locale, values) {\n let message = this.message;\n if (typeof locale === 'string') {\n locale = normalizeLocale(locale, this.messages);\n locale && (message = this.messages[locale]);\n }\n else {\n values = locale;\n }\n if (!hasOwn(message, key)) {\n console.warn(`Cannot translate the value of keypath ${key}. Use the value of keypath as default.`);\n return key;\n }\n return this.formater.interpolate(message[key], values).join('');\n }\n}\n\nfunction watchAppLocale(appVm, i18n) {\n // 需要保证 watch 的触发在组件渲染之前\n if (appVm.$watchLocale) {\n // vue2\n appVm.$watchLocale((newLocale) => {\n i18n.setLocale(newLocale);\n });\n }\n else {\n appVm.$watch(() => appVm.$locale, (newLocale) => {\n i18n.setLocale(newLocale);\n });\n }\n}\nfunction getDefaultLocale() {\n if (typeof uni !== 'undefined' && uni.getLocale) {\n return uni.getLocale();\n }\n // 小程序平台,uni 和 uni-i18n 互相引用,导致访问不到 uni,故在 global 上挂了 getLocale\n if (typeof global !== 'undefined' && global.getLocale) {\n return global.getLocale();\n }\n return LOCALE_EN;\n}\nfunction initVueI18n(locale, messages = {}, fallbackLocale, watcher) {\n // 兼容旧版本入参\n if (typeof locale !== 'string') {\n [locale, messages] = [\n messages,\n locale,\n ];\n }\n if (typeof locale !== 'string') {\n // 因为小程序平台,uni-i18n 和 uni 互相引用,导致此时访问 uni 时,为 undefined\n locale = getDefaultLocale();\n }\n if (typeof fallbackLocale !== 'string') {\n fallbackLocale =\n (typeof __uniConfig !== 'undefined' && __uniConfig.fallbackLocale) ||\n LOCALE_EN;\n }\n const i18n = new I18n({\n locale,\n fallbackLocale,\n messages,\n watcher,\n });\n let t = (key, values) => {\n if (typeof getApp !== 'function') {\n // app view\n /* eslint-disable no-func-assign */\n t = function (key, values) {\n return i18n.t(key, values);\n };\n }\n else {\n let isWatchedAppLocale = false;\n t = function (key, values) {\n const appVm = getApp().$vm;\n // 可能$vm还不存在,比如在支付宝小程序中,组件定义较早,在props的default里使用了t()函数(如uni-goods-nav),此时app还未初始化\n // options: {\n // \ttype: Array,\n // \tdefault () {\n // \t\treturn [{\n // \t\t\ticon: 'shop',\n // \t\t\ttext: t(\"uni-goods-nav.options.shop\"),\n // \t\t}, {\n // \t\t\ticon: 'cart',\n // \t\t\ttext: t(\"uni-goods-nav.options.cart\")\n // \t\t}]\n // \t}\n // },\n if (appVm) {\n // 触发响应式\n appVm.$locale;\n if (!isWatchedAppLocale) {\n isWatchedAppLocale = true;\n watchAppLocale(appVm, i18n);\n }\n }\n return i18n.t(key, values);\n };\n }\n return t(key, values);\n };\n return {\n i18n,\n f(message, values, delimiters) {\n return i18n.f(message, values, delimiters);\n },\n t(key, values) {\n return t(key, values);\n },\n add(locale, message, override = true) {\n return i18n.add(locale, message, override);\n },\n watch(fn) {\n return i18n.watchLocale(fn);\n },\n getLocale() {\n return i18n.getLocale();\n },\n setLocale(newLocale) {\n return i18n.setLocale(newLocale);\n },\n };\n}\n\nconst isString = (val) => typeof val === 'string';\nlet formater;\nfunction hasI18nJson(jsonObj, delimiters) {\n if (!formater) {\n formater = new BaseFormatter();\n }\n return walkJsonObj(jsonObj, (jsonObj, key) => {\n const value = jsonObj[key];\n if (isString(value)) {\n if (isI18nStr(value, delimiters)) {\n return true;\n }\n }\n else {\n return hasI18nJson(value, delimiters);\n }\n });\n}\nfunction parseI18nJson(jsonObj, values, delimiters) {\n if (!formater) {\n formater = new BaseFormatter();\n }\n walkJsonObj(jsonObj, (jsonObj, key) => {\n const value = jsonObj[key];\n if (isString(value)) {\n if (isI18nStr(value, delimiters)) {\n jsonObj[key] = compileStr(value, values, delimiters);\n }\n }\n else {\n parseI18nJson(value, values, delimiters);\n }\n });\n return jsonObj;\n}\nfunction compileI18nJsonStr(jsonStr, { locale, locales, delimiters, }) {\n if (!isI18nStr(jsonStr, delimiters)) {\n return jsonStr;\n }\n if (!formater) {\n formater = new BaseFormatter();\n }\n const localeValues = [];\n Object.keys(locales).forEach((name) => {\n if (name !== locale) {\n localeValues.push({\n locale: name,\n values: locales[name],\n });\n }\n });\n localeValues.unshift({ locale, values: locales[locale] });\n try {\n return JSON.stringify(compileJsonObj(JSON.parse(jsonStr), localeValues, delimiters), null, 2);\n }\n catch (e) { }\n return jsonStr;\n}\nfunction isI18nStr(value, delimiters) {\n return value.indexOf(delimiters[0]) > -1;\n}\nfunction compileStr(value, values, delimiters) {\n return formater.interpolate(value, values, delimiters).join('');\n}\nfunction compileValue(jsonObj, key, localeValues, delimiters) {\n const value = jsonObj[key];\n if (isString(value)) {\n // 存在国际化\n if (isI18nStr(value, delimiters)) {\n jsonObj[key] = compileStr(value, localeValues[0].values, delimiters);\n if (localeValues.length > 1) {\n // 格式化国际化语言\n const valueLocales = (jsonObj[key + 'Locales'] = {});\n localeValues.forEach((localValue) => {\n valueLocales[localValue.locale] = compileStr(value, localValue.values, delimiters);\n });\n }\n }\n }\n else {\n compileJsonObj(value, localeValues, delimiters);\n }\n}\nfunction compileJsonObj(jsonObj, localeValues, delimiters) {\n walkJsonObj(jsonObj, (jsonObj, key) => {\n compileValue(jsonObj, key, localeValues, delimiters);\n });\n return jsonObj;\n}\nfunction walkJsonObj(jsonObj, walk) {\n if (Array.isArray(jsonObj)) {\n for (let i = 0; i < jsonObj.length; i++) {\n if (walk(jsonObj, i)) {\n return true;\n }\n }\n }\n else if (isObject(jsonObj)) {\n for (const key in jsonObj) {\n if (walk(jsonObj, key)) {\n return true;\n }\n }\n }\n return false;\n}\n\nfunction resolveLocale(locales) {\n return (locale) => {\n if (!locale) {\n return locale;\n }\n locale = normalizeLocale(locale) || locale;\n return resolveLocaleChain(locale).find((locale) => locales.indexOf(locale) > -1);\n };\n}\nfunction resolveLocaleChain(locale) {\n const chain = [];\n const tokens = locale.split('-');\n while (tokens.length) {\n chain.push(tokens.join('-'));\n tokens.pop();\n }\n return chain;\n}\n\nexport { BaseFormatter as Formatter, I18n, LOCALE_EN, LOCALE_ES, LOCALE_FR, LOCALE_ZH_HANS, LOCALE_ZH_HANT, compileI18nJsonStr, hasI18nJson, initVueI18n, isI18nStr, isString, normalizeLocale, parseI18nJson, resolveLocale };\n","function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\nmodule.exports = _classCallCheck, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var toPropertyKey = require(\"./toPropertyKey.js\");\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor);\n }\n}\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n}\nmodule.exports = _createClass, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","/*!\n * Vue.js v2.6.11\n * (c) 2014-2023 Evan You\n * Released under the MIT License.\n */\n/* */\n\nvar emptyObject = Object.freeze({});\n\n// These helpers produce better VM code in JS engines due to their\n// explicitness and function inlining.\nfunction isUndef (v) {\n return v === undefined || v === null\n}\n\nfunction isDef (v) {\n return v !== undefined && v !== null\n}\n\nfunction isTrue (v) {\n return v === true\n}\n\nfunction isFalse (v) {\n return v === false\n}\n\n/**\n * Check if value is primitive.\n */\nfunction isPrimitive (value) {\n return (\n typeof value === 'string' ||\n typeof value === 'number' ||\n // $flow-disable-line\n typeof value === 'symbol' ||\n typeof value === 'boolean'\n )\n}\n\n/**\n * Quick object check - this is primarily used to tell\n * Objects from primitive values when we know the value\n * is a JSON-compliant type.\n */\nfunction isObject (obj) {\n return obj !== null && typeof obj === 'object'\n}\n\n/**\n * Get the raw type string of a value, e.g., [object Object].\n */\nvar _toString = Object.prototype.toString;\n\nfunction toRawType (value) {\n return _toString.call(value).slice(8, -1)\n}\n\n/**\n * Strict object type check. Only returns true\n * for plain JavaScript objects.\n */\nfunction isPlainObject (obj) {\n return _toString.call(obj) === '[object Object]'\n}\n\nfunction isRegExp (v) {\n return _toString.call(v) === '[object RegExp]'\n}\n\n/**\n * Check if val is a valid array index.\n */\nfunction isValidArrayIndex (val) {\n var n = parseFloat(String(val));\n return n >= 0 && Math.floor(n) === n && isFinite(val)\n}\n\nfunction isPromise (val) {\n return (\n isDef(val) &&\n typeof val.then === 'function' &&\n typeof val.catch === 'function'\n )\n}\n\n/**\n * Convert a value to a string that is actually rendered.\n */\nfunction toString (val) {\n return val == null\n ? ''\n : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)\n ? JSON.stringify(val, null, 2)\n : String(val)\n}\n\n/**\n * Convert an input value to a number for persistence.\n * If the conversion fails, return original string.\n */\nfunction toNumber (val) {\n var n = parseFloat(val);\n return isNaN(n) ? val : n\n}\n\n/**\n * Make a map and return a function for checking if a key\n * is in that map.\n */\nfunction makeMap (\n str,\n expectsLowerCase\n) {\n var map = Object.create(null);\n var list = str.split(',');\n for (var i = 0; i < list.length; i++) {\n map[list[i]] = true;\n }\n return expectsLowerCase\n ? function (val) { return map[val.toLowerCase()]; }\n : function (val) { return map[val]; }\n}\n\n/**\n * Check if a tag is a built-in tag.\n */\nvar isBuiltInTag = makeMap('slot,component', true);\n\n/**\n * Check if an attribute is a reserved attribute.\n */\nvar isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');\n\n/**\n * Remove an item from an array.\n */\nfunction remove (arr, item) {\n if (arr.length) {\n var index = arr.indexOf(item);\n if (index > -1) {\n return arr.splice(index, 1)\n }\n }\n}\n\n/**\n * Check whether an object has the property.\n */\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nfunction hasOwn (obj, key) {\n return hasOwnProperty.call(obj, key)\n}\n\n/**\n * Create a cached version of a pure function.\n */\nfunction cached (fn) {\n var cache = Object.create(null);\n return (function cachedFn (str) {\n var hit = cache[str];\n return hit || (cache[str] = fn(str))\n })\n}\n\n/**\n * Camelize a hyphen-delimited string.\n */\nvar camelizeRE = /-(\\w)/g;\nvar camelize = cached(function (str) {\n return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })\n});\n\n/**\n * Capitalize a string.\n */\nvar capitalize = cached(function (str) {\n return str.charAt(0).toUpperCase() + str.slice(1)\n});\n\n/**\n * Hyphenate a camelCase string.\n */\nvar hyphenateRE = /\\B([A-Z])/g;\nvar hyphenate = cached(function (str) {\n return str.replace(hyphenateRE, '-$1').toLowerCase()\n});\n\n/**\n * Simple bind polyfill for environments that do not support it,\n * e.g., PhantomJS 1.x. Technically, we don't need this anymore\n * since native bind is now performant enough in most browsers.\n * But removing it would mean breaking code that was able to run in\n * PhantomJS 1.x, so this must be kept for backward compatibility.\n */\n\n/* istanbul ignore next */\nfunction polyfillBind (fn, ctx) {\n function boundFn (a) {\n var l = arguments.length;\n return l\n ? l > 1\n ? fn.apply(ctx, arguments)\n : fn.call(ctx, a)\n : fn.call(ctx)\n }\n\n boundFn._length = fn.length;\n return boundFn\n}\n\nfunction nativeBind (fn, ctx) {\n return fn.bind(ctx)\n}\n\nvar bind = Function.prototype.bind\n ? nativeBind\n : polyfillBind;\n\n/**\n * Convert an Array-like object to a real Array.\n */\nfunction toArray (list, start) {\n start = start || 0;\n var i = list.length - start;\n var ret = new Array(i);\n while (i--) {\n ret[i] = list[i + start];\n }\n return ret\n}\n\n/**\n * Mix properties into target object.\n */\nfunction extend (to, _from) {\n for (var key in _from) {\n to[key] = _from[key];\n }\n return to\n}\n\n/**\n * Merge an Array of Objects into a single Object.\n */\nfunction toObject (arr) {\n var res = {};\n for (var i = 0; i < arr.length; i++) {\n if (arr[i]) {\n extend(res, arr[i]);\n }\n }\n return res\n}\n\n/* eslint-disable no-unused-vars */\n\n/**\n * Perform no operation.\n * Stubbing args to make Flow happy without leaving useless transpiled code\n * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).\n */\nfunction noop (a, b, c) {}\n\n/**\n * Always return false.\n */\nvar no = function (a, b, c) { return false; };\n\n/* eslint-enable no-unused-vars */\n\n/**\n * Return the same value.\n */\nvar identity = function (_) { return _; };\n\n/**\n * Check if two values are loosely equal - that is,\n * if they are plain objects, do they have the same shape?\n */\nfunction looseEqual (a, b) {\n if (a === b) { return true }\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n var isArrayA = Array.isArray(a);\n var isArrayB = Array.isArray(b);\n if (isArrayA && isArrayB) {\n return a.length === b.length && a.every(function (e, i) {\n return looseEqual(e, b[i])\n })\n } else if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime()\n } else if (!isArrayA && !isArrayB) {\n var keysA = Object.keys(a);\n var keysB = Object.keys(b);\n return keysA.length === keysB.length && keysA.every(function (key) {\n return looseEqual(a[key], b[key])\n })\n } else {\n /* istanbul ignore next */\n return false\n }\n } catch (e) {\n /* istanbul ignore next */\n return false\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}\n\n/**\n * Return the first index at which a loosely equal value can be\n * found in the array (if value is a plain object, the array must\n * contain an object of the same shape), or -1 if it is not present.\n */\nfunction looseIndexOf (arr, val) {\n for (var i = 0; i < arr.length; i++) {\n if (looseEqual(arr[i], val)) { return i }\n }\n return -1\n}\n\n/**\n * Ensure a function is called only once.\n */\nfunction once (fn) {\n var called = false;\n return function () {\n if (!called) {\n called = true;\n fn.apply(this, arguments);\n }\n }\n}\n\nvar ASSET_TYPES = [\n 'component',\n 'directive',\n 'filter'\n];\n\nvar LIFECYCLE_HOOKS = [\n 'beforeCreate',\n 'created',\n 'beforeMount',\n 'mounted',\n 'beforeUpdate',\n 'updated',\n 'beforeDestroy',\n 'destroyed',\n 'activated',\n 'deactivated',\n 'errorCaptured',\n 'serverPrefetch'\n];\n\n/* */\n\n\n\nvar config = ({\n /**\n * Option merge strategies (used in core/util/options)\n */\n // $flow-disable-line\n optionMergeStrategies: Object.create(null),\n\n /**\n * Whether to suppress warnings.\n */\n silent: false,\n\n /**\n * Show production mode tip message on boot?\n */\n productionTip: process.env.NODE_ENV !== 'production',\n\n /**\n * Whether to enable devtools\n */\n devtools: process.env.NODE_ENV !== 'production',\n\n /**\n * Whether to record perf\n */\n performance: false,\n\n /**\n * Error handler for watcher errors\n */\n errorHandler: null,\n\n /**\n * Warn handler for watcher warns\n */\n warnHandler: null,\n\n /**\n * Ignore certain custom elements\n */\n ignoredElements: [],\n\n /**\n * Custom user key aliases for v-on\n */\n // $flow-disable-line\n keyCodes: Object.create(null),\n\n /**\n * Check if a tag is reserved so that it cannot be registered as a\n * component. This is platform-dependent and may be overwritten.\n */\n isReservedTag: no,\n\n /**\n * Check if an attribute is reserved so that it cannot be used as a component\n * prop. This is platform-dependent and may be overwritten.\n */\n isReservedAttr: no,\n\n /**\n * Check if a tag is an unknown element.\n * Platform-dependent.\n */\n isUnknownElement: no,\n\n /**\n * Get the namespace of an element\n */\n getTagNamespace: noop,\n\n /**\n * Parse the real tag name for the specific platform.\n */\n parsePlatformTagName: identity,\n\n /**\n * Check if an attribute must be bound using property, e.g. value\n * Platform-dependent.\n */\n mustUseProp: no,\n\n /**\n * Perform updates asynchronously. Intended to be used by Vue Test Utils\n * This will significantly reduce performance if set to false.\n */\n async: true,\n\n /**\n * Exposed for legacy reasons\n */\n _lifecycleHooks: LIFECYCLE_HOOKS\n});\n\n/* */\n\n/**\n * unicode letters used for parsing html tags, component names and property paths.\n * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname\n * skipping \\u10000-\\uEFFFF due to it freezing up PhantomJS\n */\nvar unicodeRegExp = /a-zA-Z\\u00B7\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u203F-\\u2040\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD/;\n\n/**\n * Check if a string starts with $ or _\n */\nfunction isReserved (str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F\n}\n\n/**\n * Define a property.\n */\nfunction def (obj, key, val, enumerable) {\n Object.defineProperty(obj, key, {\n value: val,\n enumerable: !!enumerable,\n writable: true,\n configurable: true\n });\n}\n\n/**\n * Parse simple path.\n */\nvar bailRE = new RegExp((\"[^\" + (unicodeRegExp.source) + \".$_\\\\d]\"));\nfunction parsePath (path) {\n if (bailRE.test(path)) {\n return\n }\n var segments = path.split('.');\n return function (obj) {\n for (var i = 0; i < segments.length; i++) {\n if (!obj) { return }\n obj = obj[segments[i]];\n }\n return obj\n }\n}\n\n/* */\n\n// can we use __proto__?\nvar hasProto = '__proto__' in {};\n\n// Browser environment sniffing\nvar inBrowser = typeof window !== 'undefined';\nvar inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;\nvar weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();\nvar UA = inBrowser && window.navigator.userAgent.toLowerCase();\nvar isIE = UA && /msie|trident/.test(UA);\nvar isIE9 = UA && UA.indexOf('msie 9.0') > 0;\nvar isEdge = UA && UA.indexOf('edge/') > 0;\nvar isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');\nvar isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios');\nvar isChrome = UA && /chrome\\/\\d+/.test(UA) && !isEdge;\nvar isPhantomJS = UA && /phantomjs/.test(UA);\nvar isFF = UA && UA.match(/firefox\\/(\\d+)/);\n\n// Firefox has a \"watch\" function on Object.prototype...\nvar nativeWatch = ({}).watch;\nif (inBrowser) {\n try {\n var opts = {};\n Object.defineProperty(opts, 'passive', ({\n get: function get () {\n }\n })); // https://github.com/facebook/flow/issues/285\n window.addEventListener('test-passive', null, opts);\n } catch (e) {}\n}\n\n// this needs to be lazy-evaled because vue may be required before\n// vue-server-renderer can set VUE_ENV\nvar _isServer;\nvar isServerRendering = function () {\n if (_isServer === undefined) {\n /* istanbul ignore if */\n if (!inBrowser && !inWeex && typeof global !== 'undefined') {\n // detect presence of vue-server-renderer and avoid\n // Webpack shimming the process\n _isServer = global['process'] && global['process'].env.VUE_ENV === 'server';\n } else {\n _isServer = false;\n }\n }\n return _isServer\n};\n\n// detect devtools\nvar devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;\n\n/* istanbul ignore next */\nfunction isNative (Ctor) {\n return typeof Ctor === 'function' && /native code/.test(Ctor.toString())\n}\n\nvar hasSymbol =\n typeof Symbol !== 'undefined' && isNative(Symbol) &&\n typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);\n\nvar _Set;\n/* istanbul ignore if */ // $flow-disable-line\nif (typeof Set !== 'undefined' && isNative(Set)) {\n // use native Set when available.\n _Set = Set;\n} else {\n // a non-standard Set polyfill that only works with primitive keys.\n _Set = /*@__PURE__*/(function () {\n function Set () {\n this.set = Object.create(null);\n }\n Set.prototype.has = function has (key) {\n return this.set[key] === true\n };\n Set.prototype.add = function add (key) {\n this.set[key] = true;\n };\n Set.prototype.clear = function clear () {\n this.set = Object.create(null);\n };\n\n return Set;\n }());\n}\n\n/* */\n\nvar warn = noop;\nvar tip = noop;\nvar generateComponentTrace = (noop); // work around flow check\nvar formatComponentName = (noop);\n\nif (process.env.NODE_ENV !== 'production') {\n var hasConsole = typeof console !== 'undefined';\n var classifyRE = /(?:^|[-_])(\\w)/g;\n var classify = function (str) { return str\n .replace(classifyRE, function (c) { return c.toUpperCase(); })\n .replace(/[-_]/g, ''); };\n\n warn = function (msg, vm) {\n var trace = vm ? generateComponentTrace(vm) : '';\n\n if (config.warnHandler) {\n config.warnHandler.call(null, msg, vm, trace);\n } else if (hasConsole && (!config.silent)) {\n console.error((\"[Vue warn]: \" + msg + trace));\n }\n };\n\n tip = function (msg, vm) {\n if (hasConsole && (!config.silent)) {\n console.warn(\"[Vue tip]: \" + msg + (\n vm ? generateComponentTrace(vm) : ''\n ));\n }\n };\n\n formatComponentName = function (vm, includeFile) {\n if (vm.$root === vm) {\n if (vm.$options && vm.$options.__file) { // fixed by xxxxxx\n return ('') + vm.$options.__file\n }\n return ''\n }\n var options = typeof vm === 'function' && vm.cid != null\n ? vm.options\n : vm._isVue\n ? vm.$options || vm.constructor.options\n : vm;\n var name = options.name || options._componentTag;\n var file = options.__file;\n if (!name && file) {\n var match = file.match(/([^/\\\\]+)\\.vue$/);\n name = match && match[1];\n }\n\n return (\n (name ? (\"<\" + (classify(name)) + \">\") : \"\") +\n (file && includeFile !== false ? (\" at \" + file) : '')\n )\n };\n\n var repeat = function (str, n) {\n var res = '';\n while (n) {\n if (n % 2 === 1) { res += str; }\n if (n > 1) { str += str; }\n n >>= 1;\n }\n return res\n };\n\n generateComponentTrace = function (vm) {\n if (vm._isVue && vm.$parent) {\n var tree = [];\n var currentRecursiveSequence = 0;\n while (vm && vm.$options.name !== 'PageBody') {\n if (tree.length > 0) {\n var last = tree[tree.length - 1];\n if (last.constructor === vm.constructor) {\n currentRecursiveSequence++;\n vm = vm.$parent;\n continue\n } else if (currentRecursiveSequence > 0) {\n tree[tree.length - 1] = [last, currentRecursiveSequence];\n currentRecursiveSequence = 0;\n }\n }\n !vm.$options.isReserved && tree.push(vm);\n vm = vm.$parent;\n }\n return '\\n\\nfound in\\n\\n' + tree\n .map(function (vm, i) { return (\"\" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)\n ? ((formatComponentName(vm[0])) + \"... (\" + (vm[1]) + \" recursive calls)\")\n : formatComponentName(vm))); })\n .join('\\n')\n } else {\n return (\"\\n\\n(found in \" + (formatComponentName(vm)) + \")\")\n }\n };\n}\n\n/* */\n\nvar uid = 0;\n\n/**\n * A dep is an observable that can have multiple\n * directives subscribing to it.\n */\nvar Dep = function Dep () {\n this.id = uid++;\n this.subs = [];\n};\n\nDep.prototype.addSub = function addSub (sub) {\n this.subs.push(sub);\n};\n\nDep.prototype.removeSub = function removeSub (sub) {\n remove(this.subs, sub);\n};\n\nDep.prototype.depend = function depend () {\n if (Dep.SharedObject.target) {\n Dep.SharedObject.target.addDep(this);\n }\n};\n\nDep.prototype.notify = function notify () {\n // stabilize the subscriber list first\n var subs = this.subs.slice();\n if (process.env.NODE_ENV !== 'production' && !config.async) {\n // subs aren't sorted in scheduler if not running async\n // we need to sort them now to make sure they fire in correct\n // order\n subs.sort(function (a, b) { return a.id - b.id; });\n }\n for (var i = 0, l = subs.length; i < l; i++) {\n subs[i].update();\n }\n};\n\n// The current target watcher being evaluated.\n// This is globally unique because only one watcher\n// can be evaluated at a time.\n// fixed by xxxxxx (nvue shared vuex)\n/* eslint-disable no-undef */\nDep.SharedObject = {};\nDep.SharedObject.target = null;\nDep.SharedObject.targetStack = [];\n\nfunction pushTarget (target) {\n Dep.SharedObject.targetStack.push(target);\n Dep.SharedObject.target = target;\n Dep.target = target;\n}\n\nfunction popTarget () {\n Dep.SharedObject.targetStack.pop();\n Dep.SharedObject.target = Dep.SharedObject.targetStack[Dep.SharedObject.targetStack.length - 1];\n Dep.target = Dep.SharedObject.target;\n}\n\n/* */\n\nvar VNode = function VNode (\n tag,\n data,\n children,\n text,\n elm,\n context,\n componentOptions,\n asyncFactory\n) {\n this.tag = tag;\n this.data = data;\n this.children = children;\n this.text = text;\n this.elm = elm;\n this.ns = undefined;\n this.context = context;\n this.fnContext = undefined;\n this.fnOptions = undefined;\n this.fnScopeId = undefined;\n this.key = data && data.key;\n this.componentOptions = componentOptions;\n this.componentInstance = undefined;\n this.parent = undefined;\n this.raw = false;\n this.isStatic = false;\n this.isRootInsert = true;\n this.isComment = false;\n this.isCloned = false;\n this.isOnce = false;\n this.asyncFactory = asyncFactory;\n this.asyncMeta = undefined;\n this.isAsyncPlaceholder = false;\n};\n\nvar prototypeAccessors = { child: { configurable: true } };\n\n// DEPRECATED: alias for componentInstance for backwards compat.\n/* istanbul ignore next */\nprototypeAccessors.child.get = function () {\n return this.componentInstance\n};\n\nObject.defineProperties( VNode.prototype, prototypeAccessors );\n\nvar createEmptyVNode = function (text) {\n if ( text === void 0 ) text = '';\n\n var node = new VNode();\n node.text = text;\n node.isComment = true;\n return node\n};\n\nfunction createTextVNode (val) {\n return new VNode(undefined, undefined, undefined, String(val))\n}\n\n// optimized shallow clone\n// used for static nodes and slot nodes because they may be reused across\n// multiple renders, cloning them avoids errors when DOM manipulations rely\n// on their elm reference.\nfunction cloneVNode (vnode) {\n var cloned = new VNode(\n vnode.tag,\n vnode.data,\n // #7975\n // clone children array to avoid mutating original in case of cloning\n // a child.\n vnode.children && vnode.children.slice(),\n vnode.text,\n vnode.elm,\n vnode.context,\n vnode.componentOptions,\n vnode.asyncFactory\n );\n cloned.ns = vnode.ns;\n cloned.isStatic = vnode.isStatic;\n cloned.key = vnode.key;\n cloned.isComment = vnode.isComment;\n cloned.fnContext = vnode.fnContext;\n cloned.fnOptions = vnode.fnOptions;\n cloned.fnScopeId = vnode.fnScopeId;\n cloned.asyncMeta = vnode.asyncMeta;\n cloned.isCloned = true;\n return cloned\n}\n\n/*\n * not type checking this file because flow doesn't play well with\n * dynamically accessing methods on Array prototype\n */\n\nvar arrayProto = Array.prototype;\nvar arrayMethods = Object.create(arrayProto);\n\nvar methodsToPatch = [\n 'push',\n 'pop',\n 'shift',\n 'unshift',\n 'splice',\n 'sort',\n 'reverse'\n];\n\n/**\n * Intercept mutating methods and emit events\n */\nmethodsToPatch.forEach(function (method) {\n // cache original method\n var original = arrayProto[method];\n def(arrayMethods, method, function mutator () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n var result = original.apply(this, args);\n var ob = this.__ob__;\n var inserted;\n switch (method) {\n case 'push':\n case 'unshift':\n inserted = args;\n break\n case 'splice':\n inserted = args.slice(2);\n break\n }\n if (inserted) { ob.observeArray(inserted); }\n // notify change\n ob.dep.notify();\n return result\n });\n});\n\n/* */\n\nvar arrayKeys = Object.getOwnPropertyNames(arrayMethods);\n\n/**\n * In some cases we may want to disable observation inside a component's\n * update computation.\n */\nvar shouldObserve = true;\n\nfunction toggleObserving (value) {\n shouldObserve = value;\n}\n\n/**\n * Observer class that is attached to each observed\n * object. Once attached, the observer converts the target\n * object's property keys into getter/setters that\n * collect dependencies and dispatch updates.\n */\nvar Observer = function Observer (value) {\n this.value = value;\n this.dep = new Dep();\n this.vmCount = 0;\n def(value, '__ob__', this);\n if (Array.isArray(value)) {\n if (hasProto) {\n {// fixed by xxxxxx 微信小程序使用 plugins 之后,数组方法被直接挂载到了数组对象上,需要执行 copyAugment 逻辑\n if(value.push !== value.__proto__.push){\n copyAugment(value, arrayMethods, arrayKeys);\n } else {\n protoAugment(value, arrayMethods);\n }\n }\n } else {\n copyAugment(value, arrayMethods, arrayKeys);\n }\n this.observeArray(value);\n } else {\n this.walk(value);\n }\n};\n\n/**\n * Walk through all properties and convert them into\n * getter/setters. This method should only be called when\n * value type is Object.\n */\nObserver.prototype.walk = function walk (obj) {\n var keys = Object.keys(obj);\n for (var i = 0; i < keys.length; i++) {\n defineReactive$$1(obj, keys[i]);\n }\n};\n\n/**\n * Observe a list of Array items.\n */\nObserver.prototype.observeArray = function observeArray (items) {\n for (var i = 0, l = items.length; i < l; i++) {\n observe(items[i]);\n }\n};\n\n// helpers\n\n/**\n * Augment a target Object or Array by intercepting\n * the prototype chain using __proto__\n */\nfunction protoAugment (target, src) {\n /* eslint-disable no-proto */\n target.__proto__ = src;\n /* eslint-enable no-proto */\n}\n\n/**\n * Augment a target Object or Array by defining\n * hidden properties.\n */\n/* istanbul ignore next */\nfunction copyAugment (target, src, keys) {\n for (var i = 0, l = keys.length; i < l; i++) {\n var key = keys[i];\n def(target, key, src[key]);\n }\n}\n\n/**\n * Attempt to create an observer instance for a value,\n * returns the new observer if successfully observed,\n * or the existing observer if the value already has one.\n */\nfunction observe (value, asRootData) {\n if (!isObject(value) || value instanceof VNode) {\n return\n }\n var ob;\n if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n ob = value.__ob__;\n } else if (\n shouldObserve &&\n !isServerRendering() &&\n (Array.isArray(value) || isPlainObject(value)) &&\n Object.isExtensible(value) &&\n !value._isVue &&\n !value.__v_isMPComponent\n ) {\n ob = new Observer(value);\n }\n if (asRootData && ob) {\n ob.vmCount++;\n }\n return ob\n}\n\n/**\n * Define a reactive property on an Object.\n */\nfunction defineReactive$$1 (\n obj,\n key,\n val,\n customSetter,\n shallow\n) {\n var dep = new Dep();\n\n var property = Object.getOwnPropertyDescriptor(obj, key);\n if (property && property.configurable === false) {\n return\n }\n\n // cater for pre-defined getter/setters\n var getter = property && property.get;\n var setter = property && property.set;\n if ((!getter || setter) && arguments.length === 2) {\n val = obj[key];\n }\n\n var childOb = !shallow && observe(val);\n Object.defineProperty(obj, key, {\n enumerable: true,\n configurable: true,\n get: function reactiveGetter () {\n var value = getter ? getter.call(obj) : val;\n if (Dep.SharedObject.target) { // fixed by xxxxxx\n dep.depend();\n if (childOb) {\n childOb.dep.depend();\n if (Array.isArray(value)) {\n dependArray(value);\n }\n }\n }\n return value\n },\n set: function reactiveSetter (newVal) {\n var value = getter ? getter.call(obj) : val;\n /* eslint-disable no-self-compare */\n if (newVal === value || (newVal !== newVal && value !== value)) {\n return\n }\n /* eslint-enable no-self-compare */\n if (process.env.NODE_ENV !== 'production' && customSetter) {\n customSetter();\n }\n // #7981: for accessor properties without setter\n if (getter && !setter) { return }\n if (setter) {\n setter.call(obj, newVal);\n } else {\n val = newVal;\n }\n childOb = !shallow && observe(newVal);\n dep.notify();\n }\n });\n}\n\n/**\n * Set a property on an object. Adds the new property and\n * triggers change notification if the property doesn't\n * already exist.\n */\nfunction set (target, key, val) {\n if (process.env.NODE_ENV !== 'production' &&\n (isUndef(target) || isPrimitive(target))\n ) {\n warn((\"Cannot set reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.length = Math.max(target.length, key);\n target.splice(key, 1, val);\n return val\n }\n if (key in target && !(key in Object.prototype)) {\n target[key] = val;\n return val\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n process.env.NODE_ENV !== 'production' && warn(\n 'Avoid adding reactive properties to a Vue instance or its root $data ' +\n 'at runtime - declare it upfront in the data option.'\n );\n return val\n }\n if (!ob) {\n target[key] = val;\n return val\n }\n defineReactive$$1(ob.value, key, val);\n ob.dep.notify();\n return val\n}\n\n/**\n * Delete a property and trigger change if necessary.\n */\nfunction del (target, key) {\n if (process.env.NODE_ENV !== 'production' &&\n (isUndef(target) || isPrimitive(target))\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n process.env.NODE_ENV !== 'production' && warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}\n\n/**\n * Collect dependencies on array elements when the array is touched, since\n * we cannot intercept array element access like property getters.\n */\nfunction dependArray (value) {\n for (var e = (void 0), i = 0, l = value.length; i < l; i++) {\n e = value[i];\n e && e.__ob__ && e.__ob__.dep.depend();\n if (Array.isArray(e)) {\n dependArray(e);\n }\n }\n}\n\n/* */\n\n/**\n * Option overwriting strategies are functions that handle\n * how to merge a parent option value and a child option\n * value into the final value.\n */\nvar strats = config.optionMergeStrategies;\n\n/**\n * Options with restrictions\n */\nif (process.env.NODE_ENV !== 'production') {\n strats.el = strats.propsData = function (parent, child, vm, key) {\n if (!vm) {\n warn(\n \"option \\\"\" + key + \"\\\" can only be used during instance \" +\n 'creation with the `new` keyword.'\n );\n }\n return defaultStrat(parent, child)\n };\n}\n\n/**\n * Helper that recursively merges two data objects together.\n */\nfunction mergeData (to, from) {\n if (!from) { return to }\n var key, toVal, fromVal;\n\n var keys = hasSymbol\n ? Reflect.ownKeys(from)\n : Object.keys(from);\n\n for (var i = 0; i < keys.length; i++) {\n key = keys[i];\n // in case the object is already observed...\n if (key === '__ob__') { continue }\n toVal = to[key];\n fromVal = from[key];\n if (!hasOwn(to, key)) {\n set(to, key, fromVal);\n } else if (\n toVal !== fromVal &&\n isPlainObject(toVal) &&\n isPlainObject(fromVal)\n ) {\n mergeData(toVal, fromVal);\n }\n }\n return to\n}\n\n/**\n * Data\n */\nfunction mergeDataOrFn (\n parentVal,\n childVal,\n vm\n) {\n if (!vm) {\n // in a Vue.extend merge, both should be functions\n if (!childVal) {\n return parentVal\n }\n if (!parentVal) {\n return childVal\n }\n // when parentVal & childVal are both present,\n // we need to return a function that returns the\n // merged result of both functions... no need to\n // check if parentVal is a function here because\n // it has to be a function to pass previous merges.\n return function mergedDataFn () {\n return mergeData(\n typeof childVal === 'function' ? childVal.call(this, this) : childVal,\n typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal\n )\n }\n } else {\n return function mergedInstanceDataFn () {\n // instance merge\n var instanceData = typeof childVal === 'function'\n ? childVal.call(vm, vm)\n : childVal;\n var defaultData = typeof parentVal === 'function'\n ? parentVal.call(vm, vm)\n : parentVal;\n if (instanceData) {\n return mergeData(instanceData, defaultData)\n } else {\n return defaultData\n }\n }\n }\n}\n\nstrats.data = function (\n parentVal,\n childVal,\n vm\n) {\n if (!vm) {\n if (childVal && typeof childVal !== 'function') {\n process.env.NODE_ENV !== 'production' && warn(\n 'The \"data\" option should be a function ' +\n 'that returns a per-instance value in component ' +\n 'definitions.',\n vm\n );\n\n return parentVal\n }\n return mergeDataOrFn(parentVal, childVal)\n }\n\n return mergeDataOrFn(parentVal, childVal, vm)\n};\n\n/**\n * Hooks and props are merged as arrays.\n */\nfunction mergeHook (\n parentVal,\n childVal\n) {\n var res = childVal\n ? parentVal\n ? parentVal.concat(childVal)\n : Array.isArray(childVal)\n ? childVal\n : [childVal]\n : parentVal;\n return res\n ? dedupeHooks(res)\n : res\n}\n\nfunction dedupeHooks (hooks) {\n var res = [];\n for (var i = 0; i < hooks.length; i++) {\n if (res.indexOf(hooks[i]) === -1) {\n res.push(hooks[i]);\n }\n }\n return res\n}\n\nLIFECYCLE_HOOKS.forEach(function (hook) {\n strats[hook] = mergeHook;\n});\n\n/**\n * Assets\n *\n * When a vm is present (instance creation), we need to do\n * a three-way merge between constructor options, instance\n * options and parent options.\n */\nfunction mergeAssets (\n parentVal,\n childVal,\n vm,\n key\n) {\n var res = Object.create(parentVal || null);\n if (childVal) {\n process.env.NODE_ENV !== 'production' && assertObjectType(key, childVal, vm);\n return extend(res, childVal)\n } else {\n return res\n }\n}\n\nASSET_TYPES.forEach(function (type) {\n strats[type + 's'] = mergeAssets;\n});\n\n/**\n * Watchers.\n *\n * Watchers hashes should not overwrite one\n * another, so we merge them as arrays.\n */\nstrats.watch = function (\n parentVal,\n childVal,\n vm,\n key\n) {\n // work around Firefox's Object.prototype.watch...\n if (parentVal === nativeWatch) { parentVal = undefined; }\n if (childVal === nativeWatch) { childVal = undefined; }\n /* istanbul ignore if */\n if (!childVal) { return Object.create(parentVal || null) }\n if (process.env.NODE_ENV !== 'production') {\n assertObjectType(key, childVal, vm);\n }\n if (!parentVal) { return childVal }\n var ret = {};\n extend(ret, parentVal);\n for (var key$1 in childVal) {\n var parent = ret[key$1];\n var child = childVal[key$1];\n if (parent && !Array.isArray(parent)) {\n parent = [parent];\n }\n ret[key$1] = parent\n ? parent.concat(child)\n : Array.isArray(child) ? child : [child];\n }\n return ret\n};\n\n/**\n * Other object hashes.\n */\nstrats.props =\nstrats.methods =\nstrats.inject =\nstrats.computed = function (\n parentVal,\n childVal,\n vm,\n key\n) {\n if (childVal && process.env.NODE_ENV !== 'production') {\n assertObjectType(key, childVal, vm);\n }\n if (!parentVal) { return childVal }\n var ret = Object.create(null);\n extend(ret, parentVal);\n if (childVal) { extend(ret, childVal); }\n return ret\n};\nstrats.provide = mergeDataOrFn;\n\n/**\n * Default strategy.\n */\nvar defaultStrat = function (parentVal, childVal) {\n return childVal === undefined\n ? parentVal\n : childVal\n};\n\n/**\n * Validate component names\n */\nfunction checkComponents (options) {\n for (var key in options.components) {\n validateComponentName(key);\n }\n}\n\nfunction validateComponentName (name) {\n if (!new RegExp((\"^[a-zA-Z][\\\\-\\\\.0-9_\" + (unicodeRegExp.source) + \"]*$\")).test(name)) {\n warn(\n 'Invalid component name: \"' + name + '\". Component names ' +\n 'should conform to valid custom element name in html5 specification.'\n );\n }\n if (isBuiltInTag(name) || config.isReservedTag(name)) {\n warn(\n 'Do not use built-in or reserved HTML elements as component ' +\n 'id: ' + name\n );\n }\n}\n\n/**\n * Ensure all props option syntax are normalized into the\n * Object-based format.\n */\nfunction normalizeProps (options, vm) {\n var props = options.props;\n if (!props) { return }\n var res = {};\n var i, val, name;\n if (Array.isArray(props)) {\n i = props.length;\n while (i--) {\n val = props[i];\n if (typeof val === 'string') {\n name = camelize(val);\n res[name] = { type: null };\n } else if (process.env.NODE_ENV !== 'production') {\n warn('props must be strings when using array syntax.');\n }\n }\n } else if (isPlainObject(props)) {\n for (var key in props) {\n val = props[key];\n name = camelize(key);\n res[name] = isPlainObject(val)\n ? val\n : { type: val };\n }\n } else if (process.env.NODE_ENV !== 'production') {\n warn(\n \"Invalid value for option \\\"props\\\": expected an Array or an Object, \" +\n \"but got \" + (toRawType(props)) + \".\",\n vm\n );\n }\n options.props = res;\n}\n\n/**\n * Normalize all injections into Object-based format\n */\nfunction normalizeInject (options, vm) {\n var inject = options.inject;\n if (!inject) { return }\n var normalized = options.inject = {};\n if (Array.isArray(inject)) {\n for (var i = 0; i < inject.length; i++) {\n normalized[inject[i]] = { from: inject[i] };\n }\n } else if (isPlainObject(inject)) {\n for (var key in inject) {\n var val = inject[key];\n normalized[key] = isPlainObject(val)\n ? extend({ from: key }, val)\n : { from: val };\n }\n } else if (process.env.NODE_ENV !== 'production') {\n warn(\n \"Invalid value for option \\\"inject\\\": expected an Array or an Object, \" +\n \"but got \" + (toRawType(inject)) + \".\",\n vm\n );\n }\n}\n\n/**\n * Normalize raw function directives into object format.\n */\nfunction normalizeDirectives (options) {\n var dirs = options.directives;\n if (dirs) {\n for (var key in dirs) {\n var def$$1 = dirs[key];\n if (typeof def$$1 === 'function') {\n dirs[key] = { bind: def$$1, update: def$$1 };\n }\n }\n }\n}\n\nfunction assertObjectType (name, value, vm) {\n if (!isPlainObject(value)) {\n warn(\n \"Invalid value for option \\\"\" + name + \"\\\": expected an Object, \" +\n \"but got \" + (toRawType(value)) + \".\",\n vm\n );\n }\n}\n\n/**\n * Merge two option objects into a new one.\n * Core utility used in both instantiation and inheritance.\n */\nfunction mergeOptions (\n parent,\n child,\n vm\n) {\n if (process.env.NODE_ENV !== 'production') {\n checkComponents(child);\n }\n\n if (typeof child === 'function') {\n child = child.options;\n }\n\n normalizeProps(child, vm);\n normalizeInject(child, vm);\n normalizeDirectives(child);\n\n // Apply extends and mixins on the child options,\n // but only if it is a raw options object that isn't\n // the result of another mergeOptions call.\n // Only merged options has the _base property.\n if (!child._base) {\n if (child.extends) {\n parent = mergeOptions(parent, child.extends, vm);\n }\n if (child.mixins) {\n for (var i = 0, l = child.mixins.length; i < l; i++) {\n parent = mergeOptions(parent, child.mixins[i], vm);\n }\n }\n }\n\n var options = {};\n var key;\n for (key in parent) {\n mergeField(key);\n }\n for (key in child) {\n if (!hasOwn(parent, key)) {\n mergeField(key);\n }\n }\n function mergeField (key) {\n var strat = strats[key] || defaultStrat;\n options[key] = strat(parent[key], child[key], vm, key);\n }\n return options\n}\n\n/**\n * Resolve an asset.\n * This function is used because child instances need access\n * to assets defined in its ancestor chain.\n */\nfunction resolveAsset (\n options,\n type,\n id,\n warnMissing\n) {\n /* istanbul ignore if */\n if (typeof id !== 'string') {\n return\n }\n var assets = options[type];\n // check local registration variations first\n if (hasOwn(assets, id)) { return assets[id] }\n var camelizedId = camelize(id);\n if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }\n var PascalCaseId = capitalize(camelizedId);\n if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }\n // fallback to prototype chain\n var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];\n if (process.env.NODE_ENV !== 'production' && warnMissing && !res) {\n warn(\n 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,\n options\n );\n }\n return res\n}\n\n/* */\n\n\n\nfunction validateProp (\n key,\n propOptions,\n propsData,\n vm\n) {\n var prop = propOptions[key];\n var absent = !hasOwn(propsData, key);\n var value = propsData[key];\n // boolean casting\n var booleanIndex = getTypeIndex(Boolean, prop.type);\n if (booleanIndex > -1) {\n if (absent && !hasOwn(prop, 'default')) {\n value = false;\n } else if (value === '' || value === hyphenate(key)) {\n // only cast empty string / same name to boolean if\n // boolean has higher priority\n var stringIndex = getTypeIndex(String, prop.type);\n if (stringIndex < 0 || booleanIndex < stringIndex) {\n value = true;\n }\n }\n }\n // check default value\n if (value === undefined) {\n value = getPropDefaultValue(vm, prop, key);\n // since the default value is a fresh copy,\n // make sure to observe it.\n var prevShouldObserve = shouldObserve;\n toggleObserving(true);\n observe(value);\n toggleObserving(prevShouldObserve);\n }\n if (\n process.env.NODE_ENV !== 'production' &&\n // skip validation for weex recycle-list child component props\n !(false)\n ) {\n assertProp(prop, key, value, vm, absent);\n }\n return value\n}\n\n/**\n * Get the default value of a prop.\n */\nfunction getPropDefaultValue (vm, prop, key) {\n // no default, return undefined\n if (!hasOwn(prop, 'default')) {\n return undefined\n }\n var def = prop.default;\n // warn against non-factory defaults for Object & Array\n if (process.env.NODE_ENV !== 'production' && isObject(def)) {\n warn(\n 'Invalid default value for prop \"' + key + '\": ' +\n 'Props with type Object/Array must use a factory function ' +\n 'to return the default value.',\n vm\n );\n }\n // the raw prop value was also undefined from previous render,\n // return previous default value to avoid unnecessary watcher trigger\n if (vm && vm.$options.propsData &&\n vm.$options.propsData[key] === undefined &&\n vm._props[key] !== undefined\n ) {\n return vm._props[key]\n }\n // call factory function for non-Function types\n // a value is Function if its prototype is function even across different execution context\n return typeof def === 'function' && getType(prop.type) !== 'Function'\n ? def.call(vm)\n : def\n}\n\n/**\n * Assert whether a prop is valid.\n */\nfunction assertProp (\n prop,\n name,\n value,\n vm,\n absent\n) {\n if (prop.required && absent) {\n warn(\n 'Missing required prop: \"' + name + '\"',\n vm\n );\n return\n }\n if (value == null && !prop.required) {\n return\n }\n var type = prop.type;\n var valid = !type || type === true;\n var expectedTypes = [];\n if (type) {\n if (!Array.isArray(type)) {\n type = [type];\n }\n for (var i = 0; i < type.length && !valid; i++) {\n var assertedType = assertType(value, type[i]);\n expectedTypes.push(assertedType.expectedType || '');\n valid = assertedType.valid;\n }\n }\n\n if (!valid) {\n warn(\n getInvalidTypeMessage(name, value, expectedTypes),\n vm\n );\n return\n }\n var validator = prop.validator;\n if (validator) {\n if (!validator(value)) {\n warn(\n 'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n vm\n );\n }\n }\n}\n\nvar simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;\n\nfunction assertType (value, type) {\n var valid;\n var expectedType = getType(type);\n if (simpleCheckRE.test(expectedType)) {\n var t = typeof value;\n valid = t === expectedType.toLowerCase();\n // for primitive wrapper objects\n if (!valid && t === 'object') {\n valid = value instanceof type;\n }\n } else if (expectedType === 'Object') {\n valid = isPlainObject(value);\n } else if (expectedType === 'Array') {\n valid = Array.isArray(value);\n } else {\n valid = value instanceof type;\n }\n return {\n valid: valid,\n expectedType: expectedType\n }\n}\n\n/**\n * Use function string name to check built-in types,\n * because a simple equality check will fail when running\n * across different vms / iframes.\n */\nfunction getType (fn) {\n var match = fn && fn.toString().match(/^\\s*function (\\w+)/);\n return match ? match[1] : ''\n}\n\nfunction isSameType (a, b) {\n return getType(a) === getType(b)\n}\n\nfunction getTypeIndex (type, expectedTypes) {\n if (!Array.isArray(expectedTypes)) {\n return isSameType(expectedTypes, type) ? 0 : -1\n }\n for (var i = 0, len = expectedTypes.length; i < len; i++) {\n if (isSameType(expectedTypes[i], type)) {\n return i\n }\n }\n return -1\n}\n\nfunction getInvalidTypeMessage (name, value, expectedTypes) {\n var message = \"Invalid prop: type check failed for prop \\\"\" + name + \"\\\".\" +\n \" Expected \" + (expectedTypes.map(capitalize).join(', '));\n var expectedType = expectedTypes[0];\n var receivedType = toRawType(value);\n var expectedValue = styleValue(value, expectedType);\n var receivedValue = styleValue(value, receivedType);\n // check if we need to specify expected value\n if (expectedTypes.length === 1 &&\n isExplicable(expectedType) &&\n !isBoolean(expectedType, receivedType)) {\n message += \" with value \" + expectedValue;\n }\n message += \", got \" + receivedType + \" \";\n // check if we need to specify received value\n if (isExplicable(receivedType)) {\n message += \"with value \" + receivedValue + \".\";\n }\n return message\n}\n\nfunction styleValue (value, type) {\n if (type === 'String') {\n return (\"\\\"\" + value + \"\\\"\")\n } else if (type === 'Number') {\n return (\"\" + (Number(value)))\n } else {\n return (\"\" + value)\n }\n}\n\nfunction isExplicable (value) {\n var explicitTypes = ['string', 'number', 'boolean'];\n return explicitTypes.some(function (elem) { return value.toLowerCase() === elem; })\n}\n\nfunction isBoolean () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; })\n}\n\n/* */\n\nfunction handleError (err, vm, info) {\n // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.\n // See: https://github.com/vuejs/vuex/issues/1505\n pushTarget();\n try {\n if (vm) {\n var cur = vm;\n while ((cur = cur.$parent)) {\n var hooks = cur.$options.errorCaptured;\n if (hooks) {\n for (var i = 0; i < hooks.length; i++) {\n try {\n var capture = hooks[i].call(cur, err, vm, info) === false;\n if (capture) { return }\n } catch (e) {\n globalHandleError(e, cur, 'errorCaptured hook');\n }\n }\n }\n }\n }\n globalHandleError(err, vm, info);\n } finally {\n popTarget();\n }\n}\n\nfunction invokeWithErrorHandling (\n handler,\n context,\n args,\n vm,\n info\n) {\n var res;\n try {\n res = args ? handler.apply(context, args) : handler.call(context);\n if (res && !res._isVue && isPromise(res) && !res._handled) {\n res.catch(function (e) { return handleError(e, vm, info + \" (Promise/async)\"); });\n // issue #9511\n // avoid catch triggering multiple times when nested calls\n res._handled = true;\n }\n } catch (e) {\n handleError(e, vm, info);\n }\n return res\n}\n\nfunction globalHandleError (err, vm, info) {\n if (config.errorHandler) {\n try {\n return config.errorHandler.call(null, err, vm, info)\n } catch (e) {\n // if the user intentionally throws the original error in the handler,\n // do not log it twice\n if (e !== err) {\n logError(e, null, 'config.errorHandler');\n }\n }\n }\n logError(err, vm, info);\n}\n\nfunction logError (err, vm, info) {\n if (process.env.NODE_ENV !== 'production') {\n warn((\"Error in \" + info + \": \\\"\" + (err.toString()) + \"\\\"\"), vm);\n }\n /* istanbul ignore else */\n if ((inBrowser || inWeex) && typeof console !== 'undefined') {\n console.error(err);\n } else {\n throw err\n }\n}\n\n/* */\n\nvar callbacks = [];\nvar pending = false;\n\nfunction flushCallbacks () {\n pending = false;\n var copies = callbacks.slice(0);\n callbacks.length = 0;\n for (var i = 0; i < copies.length; i++) {\n copies[i]();\n }\n}\n\n// Here we have async deferring wrappers using microtasks.\n// In 2.5 we used (macro) tasks (in combination with microtasks).\n// However, it has subtle problems when state is changed right before repaint\n// (e.g. #6813, out-in transitions).\n// Also, using (macro) tasks in event handler would cause some weird behaviors\n// that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).\n// So we now use microtasks everywhere, again.\n// A major drawback of this tradeoff is that there are some scenarios\n// where microtasks have too high a priority and fire in between supposedly\n// sequential events (e.g. #4521, #6690, which have workarounds)\n// or even between bubbling of the same event (#6566).\nvar timerFunc;\n\n// The nextTick behavior leverages the microtask queue, which can be accessed\n// via either native Promise.then or MutationObserver.\n// MutationObserver has wider support, however it is seriously bugged in\n// UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It\n// completely stops working after triggering a few times... so, if native\n// Promise is available, we will use it:\n/* istanbul ignore next, $flow-disable-line */\nif (typeof Promise !== 'undefined' && isNative(Promise)) {\n var p = Promise.resolve();\n timerFunc = function () {\n p.then(flushCallbacks);\n // In problematic UIWebViews, Promise.then doesn't completely break, but\n // it can get stuck in a weird state where callbacks are pushed into the\n // microtask queue but the queue isn't being flushed, until the browser\n // needs to do some other work, e.g. handle a timer. Therefore we can\n // \"force\" the microtask queue to be flushed by adding an empty timer.\n if (isIOS) { setTimeout(noop); }\n };\n} else if (!isIE && typeof MutationObserver !== 'undefined' && (\n isNative(MutationObserver) ||\n // PhantomJS and iOS 7.x\n MutationObserver.toString() === '[object MutationObserverConstructor]'\n)) {\n // Use MutationObserver where native Promise is not available,\n // e.g. PhantomJS, iOS7, Android 4.4\n // (#6466 MutationObserver is unreliable in IE11)\n var counter = 1;\n var observer = new MutationObserver(flushCallbacks);\n var textNode = document.createTextNode(String(counter));\n observer.observe(textNode, {\n characterData: true\n });\n timerFunc = function () {\n counter = (counter + 1) % 2;\n textNode.data = String(counter);\n };\n} else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {\n // Fallback to setImmediate.\n // Technically it leverages the (macro) task queue,\n // but it is still a better choice than setTimeout.\n timerFunc = function () {\n setImmediate(flushCallbacks);\n };\n} else {\n // Fallback to setTimeout.\n timerFunc = function () {\n setTimeout(flushCallbacks, 0);\n };\n}\n\nfunction nextTick (cb, ctx) {\n var _resolve;\n callbacks.push(function () {\n if (cb) {\n try {\n cb.call(ctx);\n } catch (e) {\n handleError(e, ctx, 'nextTick');\n }\n } else if (_resolve) {\n _resolve(ctx);\n }\n });\n if (!pending) {\n pending = true;\n timerFunc();\n }\n // $flow-disable-line\n if (!cb && typeof Promise !== 'undefined') {\n return new Promise(function (resolve) {\n _resolve = resolve;\n })\n }\n}\n\n/* */\n\n/* not type checking this file because flow doesn't play well with Proxy */\n\nvar initProxy;\n\nif (process.env.NODE_ENV !== 'production') {\n var allowedGlobals = makeMap(\n 'Infinity,undefined,NaN,isFinite,isNaN,' +\n 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +\n 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +\n 'require' // for Webpack/Browserify\n );\n\n var warnNonPresent = function (target, key) {\n warn(\n \"Property or method \\\"\" + key + \"\\\" is not defined on the instance but \" +\n 'referenced during render. Make sure that this property is reactive, ' +\n 'either in the data option, or for class-based components, by ' +\n 'initializing the property. ' +\n 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',\n target\n );\n };\n\n var warnReservedPrefix = function (target, key) {\n warn(\n \"Property \\\"\" + key + \"\\\" must be accessed with \\\"$data.\" + key + \"\\\" because \" +\n 'properties starting with \"$\" or \"_\" are not proxied in the Vue instance to ' +\n 'prevent conflicts with Vue internals. ' +\n 'See: https://vuejs.org/v2/api/#data',\n target\n );\n };\n\n var hasProxy =\n typeof Proxy !== 'undefined' && isNative(Proxy);\n\n if (hasProxy) {\n var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');\n config.keyCodes = new Proxy(config.keyCodes, {\n set: function set (target, key, value) {\n if (isBuiltInModifier(key)) {\n warn((\"Avoid overwriting built-in modifier in config.keyCodes: .\" + key));\n return false\n } else {\n target[key] = value;\n return true\n }\n }\n });\n }\n\n var hasHandler = {\n has: function has (target, key) {\n var has = key in target;\n var isAllowed = allowedGlobals(key) ||\n (typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data));\n if (!has && !isAllowed) {\n if (key in target.$data) { warnReservedPrefix(target, key); }\n else { warnNonPresent(target, key); }\n }\n return has || !isAllowed\n }\n };\n\n var getHandler = {\n get: function get (target, key) {\n if (typeof key === 'string' && !(key in target)) {\n if (key in target.$data) { warnReservedPrefix(target, key); }\n else { warnNonPresent(target, key); }\n }\n return target[key]\n }\n };\n\n initProxy = function initProxy (vm) {\n if (hasProxy) {\n // determine which proxy handler to use\n var options = vm.$options;\n var handlers = options.render && options.render._withStripped\n ? getHandler\n : hasHandler;\n vm._renderProxy = new Proxy(vm, handlers);\n } else {\n vm._renderProxy = vm;\n }\n };\n}\n\n/* */\n\nvar seenObjects = new _Set();\n\n/**\n * Recursively traverse an object to evoke all converted\n * getters, so that every nested property inside the object\n * is collected as a \"deep\" dependency.\n */\nfunction traverse (val) {\n _traverse(val, seenObjects);\n seenObjects.clear();\n}\n\nfunction _traverse (val, seen) {\n var i, keys;\n var isA = Array.isArray(val);\n if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) {\n return\n }\n if (val.__ob__) {\n var depId = val.__ob__.dep.id;\n if (seen.has(depId)) {\n return\n }\n seen.add(depId);\n }\n if (isA) {\n i = val.length;\n while (i--) { _traverse(val[i], seen); }\n } else {\n keys = Object.keys(val);\n i = keys.length;\n while (i--) { _traverse(val[keys[i]], seen); }\n }\n}\n\nvar mark;\nvar measure;\n\nif (process.env.NODE_ENV !== 'production') {\n var perf = inBrowser && window.performance;\n /* istanbul ignore if */\n if (\n perf &&\n perf.mark &&\n perf.measure &&\n perf.clearMarks &&\n perf.clearMeasures\n ) {\n mark = function (tag) { return perf.mark(tag); };\n measure = function (name, startTag, endTag) {\n perf.measure(name, startTag, endTag);\n perf.clearMarks(startTag);\n perf.clearMarks(endTag);\n // perf.clearMeasures(name)\n };\n }\n}\n\n/* */\n\nvar normalizeEvent = cached(function (name) {\n var passive = name.charAt(0) === '&';\n name = passive ? name.slice(1) : name;\n var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first\n name = once$$1 ? name.slice(1) : name;\n var capture = name.charAt(0) === '!';\n name = capture ? name.slice(1) : name;\n return {\n name: name,\n once: once$$1,\n capture: capture,\n passive: passive\n }\n});\n\nfunction createFnInvoker (fns, vm) {\n function invoker () {\n var arguments$1 = arguments;\n\n var fns = invoker.fns;\n if (Array.isArray(fns)) {\n var cloned = fns.slice();\n for (var i = 0; i < cloned.length; i++) {\n invokeWithErrorHandling(cloned[i], null, arguments$1, vm, \"v-on handler\");\n }\n } else {\n // return handler return value for single handlers\n return invokeWithErrorHandling(fns, null, arguments, vm, \"v-on handler\")\n }\n }\n invoker.fns = fns;\n return invoker\n}\n\nfunction updateListeners (\n on,\n oldOn,\n add,\n remove$$1,\n createOnceHandler,\n vm\n) {\n var name, def$$1, cur, old, event;\n for (name in on) {\n def$$1 = cur = on[name];\n old = oldOn[name];\n event = normalizeEvent(name);\n if (isUndef(cur)) {\n process.env.NODE_ENV !== 'production' && warn(\n \"Invalid handler for event \\\"\" + (event.name) + \"\\\": got \" + String(cur),\n vm\n );\n } else if (isUndef(old)) {\n if (isUndef(cur.fns)) {\n cur = on[name] = createFnInvoker(cur, vm);\n }\n if (isTrue(event.once)) {\n cur = on[name] = createOnceHandler(event.name, cur, event.capture);\n }\n add(event.name, cur, event.capture, event.passive, event.params);\n } else if (cur !== old) {\n old.fns = cur;\n on[name] = old;\n }\n }\n for (name in oldOn) {\n if (isUndef(on[name])) {\n event = normalizeEvent(name);\n remove$$1(event.name, oldOn[name], event.capture);\n }\n }\n}\n\n/* */\n\n/* */\n\n// fixed by xxxxxx (mp properties)\r\nfunction extractPropertiesFromVNodeData(data, Ctor, res, context) {\r\n var propOptions = Ctor.options.mpOptions && Ctor.options.mpOptions.properties;\r\n if (isUndef(propOptions)) {\r\n return res\r\n }\n var externalClasses = Ctor.options.mpOptions.externalClasses || [];\r\n var attrs = data.attrs;\n var props = data.props;\r\n if (isDef(attrs) || isDef(props)) {\r\n for (var key in propOptions) {\r\n var altKey = hyphenate(key);\n var result = checkProp(res, props, key, altKey, true) ||\n checkProp(res, attrs, key, altKey, false);\n // externalClass\n if (\n result &&\n res[key] &&\n externalClasses.indexOf(altKey) !== -1 &&\n context[camelize(res[key])]\n ) {\n // 赋值 externalClass 真正的值(模板里 externalClass 的值可能是字符串)\n res[key] = context[camelize(res[key])];\n }\r\n }\r\n }\r\n return res\r\n}\n\nfunction extractPropsFromVNodeData (\n data,\n Ctor,\n tag,\n context// fixed by xxxxxx\n) {\n // we are only extracting raw values here.\n // validation and default values are handled in the child\n // component itself.\n var propOptions = Ctor.options.props;\n if (isUndef(propOptions)) {\n // fixed by xxxxxx\n return extractPropertiesFromVNodeData(data, Ctor, {}, context)\n }\n var res = {};\n var attrs = data.attrs;\n var props = data.props;\n if (isDef(attrs) || isDef(props)) {\n for (var key in propOptions) {\n var altKey = hyphenate(key);\n if (process.env.NODE_ENV !== 'production') {\n var keyInLowerCase = key.toLowerCase();\n if (\n key !== keyInLowerCase &&\n attrs && hasOwn(attrs, keyInLowerCase)\n ) {\n tip(\n \"Prop \\\"\" + keyInLowerCase + \"\\\" is passed to component \" +\n (formatComponentName(tag || Ctor)) + \", but the declared prop name is\" +\n \" \\\"\" + key + \"\\\". \" +\n \"Note that HTML attributes are case-insensitive and camelCased \" +\n \"props need to use their kebab-case equivalents when using in-DOM \" +\n \"templates. You should probably use \\\"\" + altKey + \"\\\" instead of \\\"\" + key + \"\\\".\"\n );\n }\n }\n checkProp(res, props, key, altKey, true) ||\n checkProp(res, attrs, key, altKey, false);\n }\n }\n // fixed by xxxxxx\n return extractPropertiesFromVNodeData(data, Ctor, res, context)\n}\n\nfunction checkProp (\n res,\n hash,\n key,\n altKey,\n preserve\n) {\n if (isDef(hash)) {\n if (hasOwn(hash, key)) {\n res[key] = hash[key];\n if (!preserve) {\n delete hash[key];\n }\n return true\n } else if (hasOwn(hash, altKey)) {\n res[key] = hash[altKey];\n if (!preserve) {\n delete hash[altKey];\n }\n return true\n }\n }\n return false\n}\n\n/* */\n\n// The template compiler attempts to minimize the need for normalization by\n// statically analyzing the template at compile time.\n//\n// For plain HTML markup, normalization can be completely skipped because the\n// generated render function is guaranteed to return Array. There are\n// two cases where extra normalization is needed:\n\n// 1. When the children contains components - because a functional component\n// may return an Array instead of a single root. In this case, just a simple\n// normalization is needed - if any child is an Array, we flatten the whole\n// thing with Array.prototype.concat. It is guaranteed to be only 1-level deep\n// because functional components already normalize their own children.\nfunction simpleNormalizeChildren (children) {\n for (var i = 0; i < children.length; i++) {\n if (Array.isArray(children[i])) {\n return Array.prototype.concat.apply([], children)\n }\n }\n return children\n}\n\n// 2. When the children contains constructs that always generated nested Arrays,\n// e.g.